summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx2
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.hxx4
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx2
-rw-r--r--svx/source/cui/ControlFocusHelper.hxx51
-rw-r--r--svx/source/cui/SpellAttrib.cxx178
-rw-r--r--svx/source/cui/SpellAttrib.hxx176
-rw-r--r--svx/source/cui/SpellDialog.cxx2167
-rw-r--r--svx/source/cui/SpellDialog.hrc58
-rw-r--r--svx/source/cui/SpellDialog.src245
-rw-r--r--svx/source/cui/acccfg.cxx1700
-rw-r--r--svx/source/cui/acccfg.hrc78
-rw-r--r--svx/source/cui/acccfg.hxx288
-rw-r--r--svx/source/cui/acccfg.src360
-rw-r--r--svx/source/cui/align.cxx303
-rw-r--r--svx/source/cui/align.hrc87
-rw-r--r--svx/source/cui/align.hxx113
-rw-r--r--svx/source/cui/align.src251
-rw-r--r--svx/source/cui/autocdlg.cxx2780
-rw-r--r--svx/source/cui/autocdlg.hrc162
-rw-r--r--svx/source/cui/autocdlg.hxx508
-rw-r--r--svx/source/cui/autocdlg.src856
-rw-r--r--svx/source/cui/backgrnd.cxx1990
-rw-r--r--svx/source/cui/backgrnd.hrc73
-rw-r--r--svx/source/cui/backgrnd.hxx173
-rw-r--r--svx/source/cui/backgrnd.src307
-rw-r--r--svx/source/cui/bbdlg.cxx79
-rw-r--r--svx/source/cui/bbdlg.hxx59
-rw-r--r--svx/source/cui/bbdlg.src88
-rw-r--r--svx/source/cui/border.cxx1274
-rw-r--r--svx/source/cui/border.hrc109
-rw-r--r--svx/source/cui/border.hxx179
-rw-r--r--svx/source/cui/border.src431
-rw-r--r--svx/source/cui/borderconn.cxx318
-rw-r--r--svx/source/cui/borderconn.hxx79
-rw-r--r--svx/source/cui/cfg.cxx6056
-rw-r--r--svx/source/cui/cfg.hrc108
-rw-r--r--svx/source/cui/cfg.hxx836
-rw-r--r--svx/source/cui/cfg.src875
-rw-r--r--svx/source/cui/cfgchart.cxx327
-rw-r--r--svx/source/cui/cfgchart.hxx118
-rw-r--r--svx/source/cui/cfgutil.cxx1801
-rw-r--r--svx/source/cui/cfgutil.hxx220
-rw-r--r--svx/source/cui/chardlg.cxx4070
-rw-r--r--svx/source/cui/chardlg.h74
-rw-r--r--svx/source/cui/chardlg.hrc184
-rw-r--r--svx/source/cui/chardlg.hxx400
-rw-r--r--svx/source/cui/chardlg.src1133
-rw-r--r--svx/source/cui/charmap.hrc54
-rw-r--r--svx/source/cui/charmap.src161
-rw-r--r--svx/source/cui/commonlingui.cxx294
-rw-r--r--svx/source/cui/commonlingui.hxx174
-rw-r--r--svx/source/cui/commonlingui.src156
-rw-r--r--svx/source/cui/connect.cxx569
-rw-r--r--svx/source/cui/connect.hxx133
-rw-r--r--svx/source/cui/connect.src268
-rw-r--r--svx/source/cui/connpoolconfig.cxx231
-rw-r--r--svx/source/cui/connpoolconfig.hxx57
-rw-r--r--svx/source/cui/connpooloptions.cxx516
-rw-r--r--svx/source/cui/connpooloptions.hrc52
-rw-r--r--svx/source/cui/connpooloptions.hxx95
-rw-r--r--svx/source/cui/connpooloptions.src169
-rw-r--r--svx/source/cui/connpoolsettings.cxx126
-rw-r--r--svx/source/cui/connpoolsettings.hxx111
-rw-r--r--svx/source/cui/cuicharmap.cxx594
-rw-r--r--svx/source/cui/cuicharmap.hxx146
-rw-r--r--svx/source/cui/cuiexp.cxx58
-rw-r--r--svx/source/cui/cuifmsearch.cxx984
-rw-r--r--svx/source/cui/cuifmsearch.hxx230
-rw-r--r--svx/source/cui/cuigaldlg.cxx1290
-rw-r--r--svx/source/cui/cuigaldlg.hxx377
-rw-r--r--svx/source/cui/cuigrfflt.cxx762
-rw-r--r--svx/source/cui/cuigrfflt.hxx256
-rw-r--r--svx/source/cui/cuihyperdlg.cxx423
-rw-r--r--svx/source/cui/cuihyperdlg.hxx117
-rwxr-xr-xsvx/source/cui/cuiimapdlg.hrc50
-rwxr-xr-xsvx/source/cui/cuiimapdlg.src151
-rw-r--r--svx/source/cui/cuiimapwnd.cxx105
-rw-r--r--svx/source/cui/cuiimapwnd.hxx54
-rw-r--r--svx/source/cui/cuioptgenrl.hxx137
-rw-r--r--svx/source/cui/cuisrchdlg.cxx112
-rw-r--r--svx/source/cui/cuisrchdlg.hxx90
-rw-r--r--svx/source/cui/cuitabarea.hxx805
-rw-r--r--svx/source/cui/cuitabline.hxx433
-rw-r--r--svx/source/cui/cuitbxform.cxx84
-rw-r--r--svx/source/cui/cuitbxform.hxx29
-rw-r--r--svx/source/cui/dbregister.cxx519
-rw-r--r--svx/source/cui/dbregister.hrc45
-rw-r--r--svx/source/cui/dbregister.hxx163
-rw-r--r--svx/source/cui/dbregister.src97
-rw-r--r--svx/source/cui/dbregisterednamesconfig.cxx196
-rw-r--r--svx/source/cui/dbregisterednamesconfig.hxx57
-rw-r--r--svx/source/cui/dbregistersettings.cxx81
-rw-r--r--svx/source/cui/dbregistersettings.hxx66
-rw-r--r--svx/source/cui/dlgfact.cxx2393
-rw-r--r--svx/source/cui/dlgfact.hxx818
-rw-r--r--svx/source/cui/dlgname.cxx243
-rw-r--r--svx/source/cui/dlgname.hrc49
-rw-r--r--svx/source/cui/dlgname.hxx207
-rw-r--r--svx/source/cui/dlgname.src272
-rw-r--r--svx/source/cui/doclinkdialog.cxx235
-rw-r--r--svx/source/cui/doclinkdialog.hrc53
-rw-r--r--svx/source/cui/doclinkdialog.hxx96
-rw-r--r--svx/source/cui/doclinkdialog.src154
-rw-r--r--svx/source/cui/dstribut.cxx251
-rw-r--r--svx/source/cui/dstribut.hrc58
-rw-r--r--svx/source/cui/dstribut.hxx128
-rw-r--r--svx/source/cui/dstribut.src293
-rw-r--r--svx/source/cui/eventdlg.cxx250
-rw-r--r--svx/source/cui/eventdlg.hrc46
-rw-r--r--svx/source/cui/eventdlg.src114
-rw-r--r--svx/source/cui/fontsubs.cxx625
-rw-r--r--svx/source/cui/fontsubs.hrc65
-rw-r--r--svx/source/cui/fontsubs.hxx132
-rw-r--r--svx/source/cui/fontsubs.src200
-rw-r--r--svx/source/cui/grfflt.hrc83
-rw-r--r--svx/source/cui/grfflt.src456
-rw-r--r--svx/source/cui/grfpage.cxx858
-rw-r--r--svx/source/cui/grfpage.hrc56
-rw-r--r--svx/source/cui/grfpage.hxx143
-rw-r--r--svx/source/cui/grfpage.src334
-rw-r--r--svx/source/cui/hangulhanjadlg.cxx1929
-rw-r--r--svx/source/cui/hangulhanjadlg.hrc200
-rw-r--r--svx/source/cui/hangulhanjadlg.hxx355
-rw-r--r--svx/source/cui/hangulhanjadlg.src431
-rwxr-xr-xsvx/source/cui/headertablistbox.hxx71
-rw-r--r--svx/source/cui/hldocntp.cxx525
-rw-r--r--svx/source/cui/hldocntp.hxx81
-rw-r--r--svx/source/cui/hldoctp.cxx387
-rw-r--r--svx/source/cui/hldoctp.hxx96
-rw-r--r--svx/source/cui/hlinettp.cxx550
-rw-r--r--svx/source/cui/hlinettp.hxx110
-rw-r--r--svx/source/cui/hlmailtp.cxx367
-rw-r--r--svx/source/cui/hlmailtp.hxx80
-rw-r--r--svx/source/cui/hlmarkwn.cxx549
-rw-r--r--svx/source/cui/hlmarkwn.src98
-rw-r--r--svx/source/cui/hltpbase.cxx880
-rw-r--r--svx/source/cui/hltpbase.hxx218
-rw-r--r--svx/source/cui/iconcdlg.cxx1445
-rw-r--r--svx/source/cui/iconcdlg.hxx292
-rw-r--r--svx/source/cui/iconcdlg.src63
-rw-r--r--svx/source/cui/init.cxx60
-rw-r--r--svx/source/cui/insdlg.cxx1064
-rw-r--r--svx/source/cui/insdlg.hxx217
-rw-r--r--svx/source/cui/insrc.cxx88
-rw-r--r--svx/source/cui/insrc.hrc43
-rw-r--r--svx/source/cui/insrc.hxx72
-rw-r--r--svx/source/cui/insrc.src118
-rw-r--r--svx/source/cui/internationaloptions.cxx172
-rw-r--r--svx/source/cui/internationaloptions.hrc75
-rw-r--r--svx/source/cui/internationaloptions.hxx61
-rw-r--r--svx/source/cui/internationaloptions.src105
-rw-r--r--svx/source/cui/labdlg.cxx657
-rw-r--r--svx/source/cui/labdlg.hrc80
-rw-r--r--svx/source/cui/labdlg.hxx147
-rw-r--r--svx/source/cui/labdlg.src301
-rw-r--r--svx/source/cui/linkdlg.cxx721
-rw-r--r--svx/source/cui/linkdlg.hxx137
-rw-r--r--svx/source/cui/macroass.cxx719
-rw-r--r--svx/source/cui/macroass.hrc85
-rwxr-xr-xsvx/source/cui/macroass.hxx146
-rw-r--r--svx/source/cui/macroass.src143
-rw-r--r--svx/source/cui/macropg.cxx1060
-rw-r--r--svx/source/cui/macropg.hrc104
-rw-r--r--svx/source/cui/macropg.hxx178
-rw-r--r--svx/source/cui/macropg.src461
-rwxr-xr-xsvx/source/cui/makefile.mk234
-rw-r--r--svx/source/cui/measure.cxx881
-rw-r--r--svx/source/cui/measure.hrc56
-rw-r--r--svx/source/cui/measure.hxx132
-rw-r--r--svx/source/cui/measure.src310
-rw-r--r--svx/source/cui/multifil.cxx191
-rw-r--r--svx/source/cui/multifil.hxx62
-rw-r--r--svx/source/cui/multipat.cxx367
-rw-r--r--svx/source/cui/multipat.hxx92
-rw-r--r--svx/source/cui/newtabledlg.cxx78
-rw-r--r--svx/source/cui/newtabledlg.hrc38
-rw-r--r--svx/source/cui/newtabledlg.hxx65
-rw-r--r--svx/source/cui/newtabledlg.src138
-rw-r--r--svx/source/cui/numfmt.cxx1957
-rw-r--r--svx/source/cui/numfmt.hrc77
-rw-r--r--svx/source/cui/numfmt.hxx206
-rw-r--r--svx/source/cui/numfmt.src297
-rw-r--r--svx/source/cui/numpages.cxx4087
-rw-r--r--svx/source/cui/numpages.hrc135
-rw-r--r--svx/source/cui/numpages.hxx472
-rw-r--r--svx/source/cui/numpages.src910
-rw-r--r--svx/source/cui/optHeaderTabListbox.cxx93
-rw-r--r--svx/source/cui/optHeaderTabListbox.hxx48
-rw-r--r--svx/source/cui/optaccessibility.cxx191
-rw-r--r--svx/source/cui/optaccessibility.hxx68
-rw-r--r--svx/source/cui/optasian.cxx475
-rw-r--r--svx/source/cui/optasian.hxx84
-rw-r--r--svx/source/cui/optchart.cxx244
-rw-r--r--svx/source/cui/optchart.hxx92
-rw-r--r--svx/source/cui/optcolor.cxx1642
-rw-r--r--svx/source/cui/optcolor.hxx84
-rw-r--r--svx/source/cui/optctl.cxx182
-rw-r--r--svx/source/cui/optctl.hxx73
-rw-r--r--svx/source/cui/optdict.cxx817
-rw-r--r--svx/source/cui/optdict.hxx191
-rw-r--r--svx/source/cui/optfltr.cxx444
-rw-r--r--svx/source/cui/optfltr.hrc58
-rw-r--r--svx/source/cui/optfltr.hxx118
-rw-r--r--svx/source/cui/optfltr.src204
-rw-r--r--svx/source/cui/optgdlg.cxx1926
-rw-r--r--svx/source/cui/optgdlg.hrc208
-rw-r--r--svx/source/cui/optgdlg.hxx217
-rw-r--r--svx/source/cui/optgdlg.src642
-rw-r--r--svx/source/cui/optgenrl.cxx587
-rw-r--r--svx/source/cui/opthtml.cxx275
-rw-r--r--svx/source/cui/opthtml.hrc66
-rw-r--r--svx/source/cui/opthtml.hxx104
-rw-r--r--svx/source/cui/opthtml.src290
-rw-r--r--svx/source/cui/optimprove.cxx233
-rw-r--r--svx/source/cui/optimprove2.cxx276
-rw-r--r--svx/source/cui/optinet2.cxx2356
-rw-r--r--svx/source/cui/optinet2.hxx357
-rw-r--r--svx/source/cui/optjava.cxx1142
-rw-r--r--svx/source/cui/optjava.hrc86
-rw-r--r--svx/source/cui/optjava.hxx221
-rw-r--r--svx/source/cui/optjava.src290
-rw-r--r--svx/source/cui/optjsearch.cxx393
-rw-r--r--svx/source/cui/optjsearch.hxx96
-rw-r--r--svx/source/cui/optmemory.cxx287
-rw-r--r--svx/source/cui/optmemory.hrc89
-rw-r--r--svx/source/cui/optmemory.hxx92
-rw-r--r--svx/source/cui/optmemory.src210
-rw-r--r--svx/source/cui/optpath.cxx871
-rw-r--r--svx/source/cui/optpath.hxx119
-rw-r--r--svx/source/cui/optsave.cxx826
-rw-r--r--svx/source/cui/optsave.hxx108
-rw-r--r--svx/source/cui/optupdt.cxx424
-rw-r--r--svx/source/cui/optupdt.hrc52
-rw-r--r--svx/source/cui/optupdt.hxx84
-rw-r--r--svx/source/cui/optupdt.src114
-rw-r--r--svx/source/cui/page.cxx1788
-rw-r--r--svx/source/cui/page.h74
-rw-r--r--svx/source/cui/page.hrc87
-rw-r--r--svx/source/cui/page.hxx256
-rw-r--r--svx/source/cui/page.src668
-rw-r--r--svx/source/cui/paragrph.cxx2394
-rw-r--r--svx/source/cui/paragrph.hrc124
-rw-r--r--svx/source/cui/paragrph.hxx336
-rw-r--r--svx/source/cui/paragrph.src734
-rw-r--r--svx/source/cui/pastedlg.cxx314
-rw-r--r--svx/source/cui/pastedlg.hxx98
-rw-r--r--svx/source/cui/plfilter.cxx133
-rw-r--r--svx/source/cui/postdlg.cxx273
-rw-r--r--svx/source/cui/postdlg.hrc54
-rw-r--r--svx/source/cui/postdlg.hxx129
-rw-r--r--svx/source/cui/postdlg.src161
-rw-r--r--svx/source/cui/readonlyimage.cxx88
-rw-r--r--svx/source/cui/readonlyimage.hxx46
-rw-r--r--svx/source/cui/readonlyimage.src55
-rw-r--r--svx/source/cui/scriptdlg.cxx1695
-rw-r--r--svx/source/cui/scriptdlg.hrc83
-rw-r--r--svx/source/cui/scriptdlg.hxx251
-rw-r--r--svx/source/cui/scriptdlg.src310
-rw-r--r--svx/source/cui/sdbcdriverenum.cxx136
-rw-r--r--svx/source/cui/sdbcdriverenum.hxx79
-rw-r--r--svx/source/cui/sdrcelldlg.cxx106
-rw-r--r--svx/source/cui/sdrcelldlg.hxx66
-rw-r--r--svx/source/cui/sdrcelldlg.src142
-rw-r--r--svx/source/cui/securityoptions.cxx116
-rw-r--r--svx/source/cui/securityoptions.hrc83
-rw-r--r--svx/source/cui/securityoptions.hxx94
-rw-r--r--svx/source/cui/securityoptions.src168
-rw-r--r--svx/source/cui/selector.cxx1262
-rw-r--r--svx/source/cui/selector.hrc60
-rw-r--r--svx/source/cui/selector.hxx249
-rw-r--r--svx/source/cui/selector.src215
-rw-r--r--svx/source/cui/showcols.cxx144
-rw-r--r--svx/source/cui/showcols.hxx69
-rw-r--r--svx/source/cui/splitcelldlg.cxx120
-rw-r--r--svx/source/cui/splitcelldlg.hrc45
-rw-r--r--svx/source/cui/splitcelldlg.hxx72
-rw-r--r--svx/source/cui/splitcelldlg.src135
-rw-r--r--svx/source/cui/srchxtra.cxx306
-rw-r--r--svx/source/cui/srchxtra.hrc54
-rw-r--r--svx/source/cui/srchxtra.hxx111
-rw-r--r--svx/source/cui/srchxtra.src281
-rw-r--r--svx/source/cui/svuidlg.hrc139
-rw-r--r--svx/source/cui/svuidlg.src711
-rw-r--r--svx/source/cui/swpossizetabpage.cxx1977
-rw-r--r--svx/source/cui/swpossizetabpage.hrc62
-rw-r--r--svx/source/cui/swpossizetabpage.hxx163
-rw-r--r--svx/source/cui/swpossizetabpage.src299
-rw-r--r--svx/source/cui/tabarea.cxx382
-rw-r--r--svx/source/cui/tabarea.hrc190
-rw-r--r--svx/source/cui/tabarea.src1541
-rw-r--r--svx/source/cui/tabline.cxx306
-rw-r--r--svx/source/cui/tabline.hrc109
-rw-r--r--svx/source/cui/tabline.src803
-rw-r--r--svx/source/cui/tabstpge.cxx755
-rw-r--r--svx/source/cui/tabstpge.hrc66
-rw-r--r--svx/source/cui/tabstpge.hxx161
-rw-r--r--svx/source/cui/tabstpge.src234
-rw-r--r--svx/source/cui/textanim.cxx763
-rw-r--r--svx/source/cui/textanim.hrc50
-rw-r--r--svx/source/cui/textanim.hxx131
-rw-r--r--svx/source/cui/textanim.src322
-rw-r--r--svx/source/cui/textattr.cxx807
-rw-r--r--svx/source/cui/textattr.hrc49
-rw-r--r--svx/source/cui/textattr.hxx138
-rw-r--r--svx/source/cui/textattr.src247
-rw-r--r--svx/source/cui/tparea.cxx2586
-rw-r--r--svx/source/cui/tpbitmap.cxx1179
-rw-r--r--svx/source/cui/tpcolor.cxx1286
-rw-r--r--svx/source/cui/tpgradnt.cxx948
-rw-r--r--svx/source/cui/tphatch.cxx912
-rw-r--r--svx/source/cui/tpline.cxx1959
-rw-r--r--svx/source/cui/tplnedef.cxx1027
-rw-r--r--svx/source/cui/tplneend.cxx762
-rw-r--r--svx/source/cui/tpshadow.cxx620
-rw-r--r--svx/source/cui/transfrm.cxx1706
-rw-r--r--svx/source/cui/transfrm.hrc79
-rw-r--r--svx/source/cui/transfrm.hxx308
-rw-r--r--svx/source/cui/transfrm.src612
-rw-r--r--svx/source/cui/treeopt.cxx2861
-rw-r--r--svx/source/cui/treeopt.hrc103
-rw-r--r--svx/source/cui/treeopt.hxx362
-rw-r--r--svx/source/cui/treeopt.src386
-rw-r--r--svx/source/cui/webconninfo.cxx386
-rw-r--r--svx/source/cui/webconninfo.hrc65
-rw-r--r--svx/source/cui/webconninfo.hxx88
-rw-r--r--svx/source/cui/webconninfo.src106
-rw-r--r--svx/source/cui/winpluginlib.cpp233
-rw-r--r--svx/source/cui/zoom.cxx541
-rw-r--r--svx/source/cui/zoom.hrc56
-rw-r--r--svx/source/cui/zoom.hxx120
-rw-r--r--svx/source/cui/zoom.src159
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx1
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.hxx5
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx4
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx2
-rwxr-xr-x[-rw-r--r--]svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx118
-rw-r--r--svx/source/customshapes/tbxcustomshapes.cxx2
-rw-r--r--svx/source/dialog/_bmpmask.cxx2
-rw-r--r--svx/source/dialog/_contdlg.cxx4
-rw-r--r--svx/source/dialog/charmap.cxx2
-rw-r--r--svx/source/dialog/databaseregistrationui.cxx2
-rw-r--r--svx/source/dialog/dialmgr.cxx2
-rw-r--r--svx/source/dialog/dlgctl3d.cxx2
-rw-r--r--svx/source/dialog/dlgctrl.cxx25
-rw-r--r--svx/source/dialog/dlgutil.cxx2
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--svx/source/dialog/fntctrl.cxx2
-rw-r--r--svx/source/dialog/frmdirlbox.src96
-rw-r--r--svx/source/dialog/graphctl.cxx4
-rw-r--r--svx/source/dialog/grfflt.cxx2
-rw-r--r--svx/source/dialog/hangulhanja.cxx6
-rw-r--r--svx/source/dialog/hdft.cxx4
-rw-r--r--svx/source/dialog/hyperdlg.cxx6
-rw-r--r--svx/source/dialog/hyperdlg.src971
-rw-r--r--svx/source/dialog/hyprlink.cxx48
-rw-r--r--svx/source/dialog/imapdlg.cxx12
-rw-r--r--svx/source/dialog/imapwnd.cxx4
-rw-r--r--svx/source/dialog/imapwnd.hxx2
-rw-r--r--svx/source/dialog/impgrf.cxx14
-rw-r--r--svx/source/dialog/makefile.mk13
-rw-r--r--svx/source/dialog/opengrf.cxx6
-rw-r--r--svx/source/dialog/radiobtnbox.cxx124
-rw-r--r--svx/source/dialog/rlrcitem.cxx4
-rw-r--r--svx/source/dialog/rubydialog.cxx2
-rw-r--r--svx/source/dialog/sdstring.src209
-rw-r--r--svx/source/dialog/srchctrl.cxx2
-rw-r--r--svx/source/dialog/srchdlg.cxx60
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx16
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.src130
-rw-r--r--svx/source/dialog/svxdlg.cxx9
-rw-r--r--svx/source/dialog/svxruler.cxx6
-rw-r--r--svx/source/dialog/thesdlg.cxx2
-rw-r--r--svx/source/editeng/SvXMLAutoCorrectExport.cxx2
-rw-r--r--svx/source/editeng/SvXMLAutoCorrectImport.cxx2
-rw-r--r--svx/source/editeng/acorrcfg.cxx8
-rw-r--r--svx/source/editeng/editattr.hxx2
-rw-r--r--svx/source/editeng/editdbg.hxx2
-rw-r--r--svx/source/editeng/editdoc.hxx6
-rw-r--r--svx/source/editeng/editdoc2.cxx2
-rw-r--r--svx/source/editeng/editeng.cxx6
-rw-r--r--svx/source/editeng/editeng.hrc2
-rw-r--r--svx/source/editeng/editobj.cxx4
-rw-r--r--svx/source/editeng/editobj2.hxx2
-rw-r--r--svx/source/editeng/editview.cxx18
-rw-r--r--svx/source/editeng/edtspell.cxx4
-rw-r--r--svx/source/editeng/eehtml.hxx2
-rw-r--r--svx/source/editeng/eeobj.cxx2
-rw-r--r--svx/source/editeng/eerdll.cxx4
-rw-r--r--svx/source/editeng/eertfpar.cxx2
-rw-r--r--svx/source/editeng/impedit.cxx2
-rw-r--r--svx/source/editeng/impedit.hxx2
-rw-r--r--svx/source/editeng/impedit2.cxx4
-rw-r--r--svx/source/editeng/impedit3.cxx4
-rw-r--r--svx/source/editeng/impedit5.cxx2
-rw-r--r--svx/source/editeng/svxacorr.cxx14
-rw-r--r--svx/source/editeng/txtrange.cxx2
-rw-r--r--svx/source/editeng/unolingu.cxx8
-rw-r--r--svx/source/engine3d/float3d.cxx6
-rw-r--r--svx/source/engine3d/obj3d.cxx4
-rw-r--r--svx/source/engine3d/polysc3d.cxx4
-rw-r--r--svx/source/engine3d/scene3d.cxx4
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx8
-rw-r--r--svx/source/fmcomp/fmgridif.cxx2
-rw-r--r--svx/source/fmcomp/gridcell.cxx4
-rw-r--r--svx/source/fmcomp/gridcols.cxx2
-rw-r--r--svx/source/fmcomp/gridctrl.cxx2
-rw-r--r--svx/source/fmcomp/makefile.mk3
-rw-r--r--svx/source/fmcomp/showcols.src106
-rw-r--r--svx/source/form/ParseContext.cxx2
-rw-r--r--svx/source/form/databaselocationinput.cxx2
-rw-r--r--svx/source/form/datanavi.cxx28
-rw-r--r--svx/source/form/filtnav.cxx2
-rw-r--r--svx/source/form/fmcontrollayout.cxx3
-rw-r--r--svx/source/form/fmctrler.cxx2
-rw-r--r--svx/source/form/fmexch.cxx4
-rw-r--r--svx/source/form/fmobj.cxx2
-rw-r--r--svx/source/form/fmobjfac.cxx2
-rw-r--r--svx/source/form/fmpage.cxx2
-rw-r--r--svx/source/form/fmpgeimp.cxx2
-rw-r--r--svx/source/form/fmsearch.src333
-rw-r--r--svx/source/form/fmshell.cxx18
-rw-r--r--svx/source/form/fmshimp.cxx6
-rw-r--r--svx/source/form/fmsrccfg.cxx2
-rw-r--r--svx/source/form/fmsrcimp.cxx7
-rw-r--r--svx/source/form/fmtextcontroldialogs.cxx4
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx10
-rw-r--r--svx/source/form/fmtools.cxx6
-rw-r--r--svx/source/form/fmundo.cxx4
-rw-r--r--svx/source/form/fmview.cxx18
-rw-r--r--svx/source/form/fmvwimp.cxx8
-rw-r--r--svx/source/form/formcontrolfactory.cxx2
-rw-r--r--svx/source/form/formcontrolling.cxx2
-rw-r--r--svx/source/form/makefile.mk2
-rw-r--r--svx/source/form/navigatortree.cxx1
-rw-r--r--svx/source/form/navigatortreemodel.cxx1
-rw-r--r--svx/source/form/sdbdatacolumn.cxx10
-rw-r--r--svx/source/form/tabwin.cxx2
-rw-r--r--svx/source/form/tbxform.cxx6
-rw-r--r--svx/source/form/tbxform.src69
-rw-r--r--svx/source/form/typemap.cxx4
-rw-r--r--svx/source/gallery2/galbrws.cxx22
-rw-r--r--svx/source/gallery2/galbrws1.cxx15
-rw-r--r--svx/source/gallery2/galbrws1.hxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx25
-rw-r--r--svx/source/gallery2/galctrl.cxx28
-rw-r--r--svx/source/gallery2/galexpl.cxx35
-rw-r--r--svx/source/gallery2/gallery.src456
-rw-r--r--svx/source/gallery2/gallery1.cxx41
-rw-r--r--svx/source/gallery2/galmisc.cxx12
-rw-r--r--svx/source/gallery2/galobj.cxx30
-rw-r--r--svx/source/gallery2/galtheme.cxx32
-rw-r--r--svx/source/gengal/gengal.cxx18
-rw-r--r--svx/source/inc/GraphCtlAccessibleContext.hxx2
-rw-r--r--svx/source/inc/SpellDialog.hxx261
-rw-r--r--svx/source/inc/eventdlg.hxx81
-rw-r--r--svx/source/inc/filtnav.hxx8
-rw-r--r--svx/source/inc/fmPropBrw.hxx2
-rw-r--r--svx/source/inc/fmctrler.hxx2
-rw-r--r--svx/source/inc/fmexpl.hxx8
-rw-r--r--svx/source/inc/fmitems.hxx2
-rw-r--r--svx/source/inc/fmresids.hrc16
-rw-r--r--svx/source/inc/fmsearch.hrc72
-rw-r--r--svx/source/inc/fmshimp.hxx11
-rw-r--r--svx/source/inc/fmsrcimp.hxx2
-rw-r--r--svx/source/inc/fmtools.hxx383
-rw-r--r--svx/source/inc/fmundo.hxx2
-rw-r--r--svx/source/inc/gridcell.hxx2
-rw-r--r--svx/source/inc/hlmarkwn.hrc37
-rw-r--r--svx/source/inc/hlmarkwn.hxx114
-rw-r--r--svx/source/inc/hyperdlg.hrc103
-rw-r--r--svx/source/inc/macropg_impl.hxx76
-rw-r--r--svx/source/inc/optchart.hrc40
-rw-r--r--svx/source/inc/optdict.hrc68
-rw-r--r--svx/source/inc/svdoimp.hxx2
-rw-r--r--svx/source/inc/tabwin.hxx2
-rw-r--r--svx/source/inc/unoedprx.hxx2
-rw-r--r--svx/source/intro/iso.src2
-rw-r--r--svx/source/intro/ooo.src2
-rw-r--r--svx/source/items/SmartTagItem.cxx2
-rw-r--r--svx/source/items/clipfmtitem.cxx2
-rw-r--r--svx/source/items/flditem.cxx2
-rw-r--r--svx/source/items/frmitems.cxx6
-rw-r--r--svx/source/items/makefile.mk1
-rw-r--r--svx/source/items/numfmtsh.cxx4
-rw-r--r--svx/source/items/page.src258
-rw-r--r--svx/source/items/pageitem.cxx2
-rw-r--r--svx/source/items/paraitem.cxx8
-rw-r--r--svx/source/items/textitem.cxx6
-rw-r--r--svx/source/mnuctrls/SmartTagCtl.cxx2
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx4
-rw-r--r--svx/source/mnuctrls/fntszctl.cxx2
-rw-r--r--svx/source/msfilter/countryid.cxx345
-rw-r--r--svx/source/msfilter/escherex.cxx4848
-rw-r--r--svx/source/msfilter/eschesdo.cxx1244
-rw-r--r--svx/source/msfilter/eschesdo.hxx208
-rw-r--r--svx/source/msfilter/makefile.mk78
-rw-r--r--svx/source/msfilter/mscodec.cxx537
-rw-r--r--svx/source/msfilter/msdffimp.cxx8197
-rw-r--r--svx/source/msfilter/msfiltertracer.cxx254
-rw-r--r--svx/source/msfilter/msocximex.cxx5975
-rw-r--r--svx/source/msfilter/msoleexp.cxx376
-rw-r--r--svx/source/msfilter/msvbahelper.cxx384
-rw-r--r--svx/source/msfilter/msvbasic.cxx677
-rw-r--r--svx/source/msfilter/msvbasic.hxx131
-rw-r--r--svx/source/msfilter/svxmsbas.cxx406
-rw-r--r--svx/source/msfilter/svxmsbas2.cxx88
-rw-r--r--svx/source/msfilter/viscache.hxx85
-rw-r--r--svx/source/options/asiancfg.cxx2
-rw-r--r--svx/source/options/htmlcfg.cxx5
-rw-r--r--svx/source/options/makefile.mk20
-rw-r--r--svx/source/options/multipat.src153
-rw-r--r--svx/source/options/optaccessibility.src155
-rw-r--r--svx/source/options/optasian.src177
-rw-r--r--svx/source/options/optchart.src86
-rw-r--r--svx/source/options/optcolor.src552
-rw-r--r--svx/source/options/optctl.src119
-rw-r--r--svx/source/options/optdict.src282
-rw-r--r--svx/source/options/optgenrl.src333
-rw-r--r--svx/source/options/optimprove.src123
-rw-r--r--svx/source/options/optinet2.src647
-rw-r--r--svx/source/options/optjsearch.src223
-rw-r--r--svx/source/options/optlingu.cxx2563
-rw-r--r--svx/source/options/optlingu.hrc91
-rw-r--r--svx/source/options/optlingu.src357
-rw-r--r--svx/source/options/optpath.src203
-rw-r--r--svx/source/options/optsave.src325
-rw-r--r--svx/source/options/optspell.src128
-rw-r--r--svx/source/options/srchcfg.cxx2
-rw-r--r--svx/source/outliner/outl_pch.hxx2
-rw-r--r--svx/source/outliner/outleeng.cxx2
-rw-r--r--svx/source/outliner/outlin2.cxx2
-rw-r--r--svx/source/outliner/outliner.cxx8
-rw-r--r--svx/source/outliner/outliner.hrc2
-rw-r--r--svx/source/outliner/outlvw.cxx4
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcircobj.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx6
-rw-r--r--svx/source/sdr/primitive3d/sdrattributecreator3d.cxx2
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx10
-rw-r--r--svx/source/sdr/properties/captionproperties.cxx4
-rw-r--r--svx/source/sdr/properties/circleproperties.cxx4
-rw-r--r--svx/source/sdr/properties/connectorproperties.cxx4
-rw-r--r--svx/source/sdr/properties/customshapeproperties.cxx10
-rw-r--r--svx/source/sdr/properties/defaultproperties.cxx4
-rw-r--r--svx/source/sdr/properties/e3dcompoundproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dextrudeproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dlatheproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dsceneproperties.cxx4
-rw-r--r--svx/source/sdr/properties/e3dsphereproperties.cxx2
-rw-r--r--svx/source/sdr/properties/emptyproperties.cxx2
-rw-r--r--svx/source/sdr/properties/graphicproperties.cxx4
-rw-r--r--svx/source/sdr/properties/groupproperties.cxx4
-rw-r--r--svx/source/sdr/properties/itemsettools.cxx4
-rw-r--r--svx/source/sdr/properties/measureproperties.cxx4
-rw-r--r--svx/source/sdr/properties/pageproperties.cxx2
-rw-r--r--svx/source/sdr/properties/properties.cxx2
-rw-r--r--svx/source/sdr/properties/textproperties.cxx8
-rw-r--r--svx/source/src/app.hrc6
-rw-r--r--svx/source/src/app.src32
-rw-r--r--svx/source/stbctrls/insctrl.cxx2
-rw-r--r--svx/source/stbctrls/modctrl.cxx2
-rw-r--r--svx/source/stbctrls/pszctrl.cxx6
-rw-r--r--svx/source/stbctrls/selctrl.cxx2
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx6
-rw-r--r--svx/source/svdraw/makefile.mk6
-rw-r--r--svx/source/svdraw/svdattr.cxx2
-rw-r--r--svx/source/svdraw/svdedtv1.cxx6
-rw-r--r--svx/source/svdraw/svdedtv2.cxx2
-rw-r--r--svx/source/svdraw/svdedxv.cxx8
-rw-r--r--svx/source/svdraw/svdetc.cxx62
-rw-r--r--svx/source/svdraw/svdfmtf.cxx2
-rw-r--r--svx/source/svdraw/svdfppt.cxx7813
-rw-r--r--svx/source/svdraw/svdibrow.cxx10
-rw-r--r--svx/source/svdraw/svdmark.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx10
-rw-r--r--svx/source/svdraw/svdoashp.cxx4
-rw-r--r--svx/source/svdraw/svdoattr.cxx12
-rw-r--r--svx/source/svdraw/svdobj.cxx4
-rw-r--r--svx/source/svdraw/svdocapt.cxx2
-rw-r--r--svx/source/svdraw/svdocirc.cxx2
-rw-r--r--svx/source/svdraw/svdoedge.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx6
-rw-r--r--svx/source/svdraw/svdogrp.cxx4
-rw-r--r--svx/source/svdraw/svdomeas.cxx6
-rw-r--r--svx/source/svdraw/svdoole2.cxx6
-rw-r--r--svx/source/svdraw/svdopage.cxx2
-rw-r--r--svx/source/svdraw/svdotext.cxx6
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx2
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx4
-rw-r--r--svx/source/svdraw/svdotxat.cxx12
-rw-r--r--svx/source/svdraw/svdotxed.cxx2
-rw-r--r--svx/source/svdraw/svdotxln.cxx2
-rw-r--r--svx/source/svdraw/svdotxtr.cxx2
-rw-r--r--svx/source/svdraw/svdoutl.cxx2
-rw-r--r--svx/source/svdraw/svdpntv.cxx22
-rw-r--r--svx/source/svdraw/svdtext.cxx2
-rw-r--r--svx/source/svdraw/svdtrans.cxx2
-rw-r--r--svx/source/svdraw/svdundo.cxx2
-rw-r--r--svx/source/svdraw/svdview.cxx16
-rw-r--r--svx/source/svdraw/svdviter.cxx2
-rw-r--r--svx/source/svdraw/svdxcgv.cxx6
-rw-r--r--svx/source/svrtf/rtfgrf.cxx4
-rw-r--r--svx/source/svrtf/rtfitem.cxx4
-rw-r--r--svx/source/svrtf/svxrtf.cxx6
-rw-r--r--svx/source/svxlink/fileobj.cxx4
-rw-r--r--svx/source/svxlink/linkmgr.cxx12
-rw-r--r--svx/source/table/cell.cxx4
-rw-r--r--svx/source/table/celleditsource.cxx6
-rw-r--r--svx/source/table/svdotable.cxx2
-rw-r--r--svx/source/table/tablecontroller.cxx2
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx2
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx4
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx2
-rw-r--r--svx/source/tbxctrls/formatpaintbrushctrl.cxx2
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx6
-rw-r--r--svx/source/tbxctrls/itemwin.cxx22
-rw-r--r--svx/source/tbxctrls/layctrl.cxx2
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx8
-rw-r--r--svx/source/tbxctrls/subtoolboxcontrol.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx22
-rw-r--r--svx/source/tbxctrls/tbxalign.cxx2
-rw-r--r--svx/source/tbxctrls/tbxdrctl.cxx2
-rw-r--r--svx/source/tbxctrls/verttexttbxctrl.cxx4
-rw-r--r--svx/source/toolbars/fontworkbar.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx46
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx10
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src4
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx4
-rw-r--r--svx/source/unodraw/UnoNameItemTable.cxx6
-rw-r--r--svx/source/unodraw/UnoNameItemTable.hxx2
-rw-r--r--svx/source/unodraw/UnoNamespaceMap.cxx2
-rw-r--r--svx/source/unodraw/unobtabl.cxx6
-rw-r--r--svx/source/unodraw/unoctabl.cxx12
-rw-r--r--svx/source/unodraw/unodtabl.cxx4
-rw-r--r--svx/source/unodraw/unofdesc.cxx2
-rw-r--r--svx/source/unodraw/unogtabl.cxx4
-rw-r--r--svx/source/unodraw/unohtabl.cxx4
-rw-r--r--svx/source/unodraw/unoipset.cxx4
-rw-r--r--svx/source/unodraw/unomod.cxx2
-rw-r--r--svx/source/unodraw/unomtabl.cxx8
-rw-r--r--svx/source/unodraw/unonrule.cxx2
-rw-r--r--svx/source/unodraw/unoshap2.cxx2
-rw-r--r--svx/source/unodraw/unoshape.cxx2
-rw-r--r--svx/source/unodraw/unoshtxt.cxx6
-rw-r--r--svx/source/unodraw/unottabl.cxx4
-rw-r--r--svx/source/unoedit/unoedsrc.cxx2
-rw-r--r--svx/source/unoedit/unofored.cxx2
-rw-r--r--svx/source/unoedit/unoforou.cxx6
-rw-r--r--svx/source/unoedit/unotext.cxx8
-rw-r--r--svx/source/unoedit/unotext2.cxx2
-rw-r--r--svx/source/unogallery/unogalitem.cxx12
-rw-r--r--svx/source/unogallery/unogaltheme.cxx126
-rw-r--r--svx/source/unogallery/unogaltheme.hxx2
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx80
-rw-r--r--svx/source/xml/xmlgrhlp.cxx2
-rw-r--r--svx/source/xml/xmltxtexp.cxx4
-rw-r--r--svx/source/xml/xmltxtimp.cxx2
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx4
-rw-r--r--svx/source/xoutdev/xattr.cxx6
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx2
-rw-r--r--svx/source/xoutdev/xexch.cxx8
-rw-r--r--svx/source/xoutdev/xpool.cxx2
-rw-r--r--svx/source/xoutdev/xtabbtmp.cxx2
-rw-r--r--svx/source/xoutdev/xtabcolr.cxx4
-rw-r--r--svx/source/xoutdev/xtabdash.cxx2
-rw-r--r--svx/source/xoutdev/xtabgrdt.cxx2
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx2
-rw-r--r--svx/source/xoutdev/xtablend.cxx2
673 files changed, 1435 insertions, 183605 deletions
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index e4afee69da..0ed80a5af8 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -36,7 +36,7 @@
// Global header
//
//------------------------------------------------------------------------
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/editdata.hxx>
#include <svx/outliner.hxx>
#include <svx/svdmodel.hxx>
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.hxx b/svx/source/accessibility/AccessibleEmptyEditSource.hxx
index a3737c181a..83350ae116 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.hxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.hxx
@@ -31,8 +31,8 @@
#ifndef _SVX_ACCESSIBLEEMPTYEDITSOURCE_HXX
#define _SVX_ACCESSIBLEEMPTYEDITSOURCE_HXX
-#include <svtools/brdcst.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
#include <memory>
#include <svx/unoedsrc.hxx>
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 26c855ba69..89382818f4 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -44,7 +44,7 @@
#include <rtl/uuid.h>
#include <tools/debug.hxx>
#include <tools/gen.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <toolkit/helper/convert.hxx>
#include <svtools/colorcfg.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
diff --git a/svx/source/cui/ControlFocusHelper.hxx b/svx/source/cui/ControlFocusHelper.hxx
deleted file mode 100644
index addf0f8d1d..0000000000
--- a/svx/source/cui/ControlFocusHelper.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: ControlFocusHelper.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SVX_CONTROLL_FUCUS_HELPER_HXX
-#define SVX_CONTROLL_FUCUS_HELPER_HXX
-
-#include <vcl/ctrl.hxx>
-
-// class SvxControlFocusHelper ---------------------------------------------
-
-class SvxControlFocusHelper : public Control
-{
-private:
- Control* m_pFocusCtrl;
-
-public:
- SvxControlFocusHelper( Window* pParent, const ResId& rId ) :
- Control( pParent, rId ), m_pFocusCtrl( NULL ) {}
-
- void SetFocusControl( Control* pCtrl ) { m_pFocusCtrl = pCtrl; }
-
- virtual long Notify( NotifyEvent& rNEvt );
-};
-
-#endif // SVX_CONTROLL_FUCUS_HELPER_HXX
diff --git a/svx/source/cui/SpellAttrib.cxx b/svx/source/cui/SpellAttrib.cxx
deleted file mode 100644
index 8d071f40c5..0000000000
--- a/svx/source/cui/SpellAttrib.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpellAttrib.cxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <SpellAttrib.hxx>
-#include <vcl/font.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
-using namespace svx;
-using namespace com::sun::star::linguistic2;
-using namespace com::sun::star::uno;
-
-/*-- 26.06.2008 10:41:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellErrorAttrib::SpellErrorAttrib( const SpellErrorDescription& rDesc ) :
- TextAttrib(TEXTATTR_SPELL_ERROR),
- m_aSpellErrorDescription( rDesc )
-{
-}
-
-/*-- 10.09.2003 12:54:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellErrorAttrib::SpellErrorAttrib( const SpellErrorAttrib& rAttr ) :
- TextAttrib(TEXTATTR_SPELL_ERROR),
- m_aSpellErrorDescription( rAttr.m_aSpellErrorDescription )
-{
-}
-/*-- 10.09.2003 12:54:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellErrorAttrib::~SpellErrorAttrib()
-{
-}
-/*-- 10.09.2003 12:54:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SpellErrorAttrib::SetFont( Font& ) const
-{
- //this attribute doesn't have a visual effect
-}
-/*-- 10.09.2003 12:54:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-TextAttrib* SpellErrorAttrib::Clone() const
-{
- return new SpellErrorAttrib(*this);
-}
-/*-- 10.09.2003 12:54:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-int SpellErrorAttrib::operator==( const TextAttrib& rAttr ) const
-{
- return Which() == rAttr.Which() &&
- m_aSpellErrorDescription == static_cast<const SpellErrorAttrib&>(rAttr).m_aSpellErrorDescription;
-}
-/*-- 10.09.2003 14:27:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellLanguageAttrib::SpellLanguageAttrib(LanguageType eLang) :
- TextAttrib(TEXTATTR_SPELL_LANGUAGE),
- m_eLanguage(eLang)
-{
-}
-/*-- 10.09.2003 14:27:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellLanguageAttrib::SpellLanguageAttrib( const SpellLanguageAttrib& rAttr ) :
- TextAttrib(TEXTATTR_SPELL_LANGUAGE),
- m_eLanguage(rAttr.m_eLanguage)
-{
-}
-/*-- 10.09.2003 14:27:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellLanguageAttrib::~SpellLanguageAttrib()
-{
-}
-/*-- 10.09.2003 14:27:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SpellLanguageAttrib::SetFont( Font& ) const
-{
- //no visual effect
-}
-/*-- 10.09.2003 14:27:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-TextAttrib* SpellLanguageAttrib::Clone() const
-{
- return new SpellLanguageAttrib(*this);
-}
-/*-- 10.09.2003 14:27:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-int SpellLanguageAttrib::operator==( const TextAttrib& rAttr ) const
-{
- return Which() == rAttr.Which() &&
- m_eLanguage == static_cast<const SpellLanguageAttrib&>(rAttr).m_eLanguage;
-}
-/*-- 31.10.2003 16:07:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellBackgroundAttrib::SpellBackgroundAttrib(const Color& rCol) :
- TextAttrib(TEXTATTR_SPELL_BACKGROUND),
- m_aBackgroundColor(rCol)
-{
-}
-/*-- 31.10.2003 16:07:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellBackgroundAttrib::SpellBackgroundAttrib( const SpellBackgroundAttrib& rAttr ) :
- TextAttrib(TEXTATTR_SPELL_BACKGROUND),
- m_aBackgroundColor(rAttr.m_aBackgroundColor)
-{
-}
-/*-- 31.10.2003 16:07:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellBackgroundAttrib::~SpellBackgroundAttrib()
-{
-}
-/*-- 31.10.2003 16:07:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SpellBackgroundAttrib::SetFont( Font& rFont ) const
-{
- rFont.SetFillColor(m_aBackgroundColor);
-}
-/*-- 31.10.2003 16:07:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-TextAttrib* SpellBackgroundAttrib::Clone() const
-{
- return new SpellBackgroundAttrib(*this);
-}
-/*-- 31.10.2003 16:07:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-int SpellBackgroundAttrib::operator==( const TextAttrib& rAttr ) const
-{
- return Which() == rAttr.Which() &&
- m_aBackgroundColor == static_cast<const SpellBackgroundAttrib&>(rAttr).m_aBackgroundColor;
-}
-
diff --git a/svx/source/cui/SpellAttrib.hxx b/svx/source/cui/SpellAttrib.hxx
deleted file mode 100644
index e7920d24d1..0000000000
--- a/svx/source/cui/SpellAttrib.hxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpellAttrib.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SPELL_ATTRIB
-#define _SVX_SPELL_ATTRIB
-
-#include <svtools/txtattr.hxx>
-#include <i18npool/lang.h>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/linguistic2/XProofreader.hpp>
-#include <tools/color.hxx>
-//namespace com{ namespace sun{ namespace star{ namespace linguistic2{
-// class XSpellAlternatives;
-//}}}}
-
-#define TEXTATTR_SPELL_ERROR (TEXTATTR_USER_START + 1)
-#define TEXTATTR_SPELL_LANGUAGE (TEXTATTR_USER_START + 2)
-#define TEXTATTR_SPELL_BACKGROUND (TEXTATTR_USER_START + 3)
-
-namespace svx{
-struct SpellErrorDescription
-{
- bool bIsGrammarError;
- ::rtl::OUString sErrorText;
- ::rtl::OUString sDialogTitle;
- ::rtl::OUString sExplanation;
- ::com::sun::star::lang::Locale aLocale;
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XProofreader > xGrammarChecker;
- ::rtl::OUString sServiceName; //service name of GrammarChecker/SpellChecker
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSuggestions;
- ::rtl::OUString sRuleId;
-
- SpellErrorDescription() :
- bIsGrammarError( false ){}
-
- SpellErrorDescription( bool bGrammar,
- const ::rtl::OUString& rText,
- const ::com::sun::star::lang::Locale& rLocale,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rSuggestions,
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XProofreader > rxGrammarChecker,
- const ::rtl::OUString& rServiceName,
- const ::rtl::OUString* pDialogTitle = 0,
- const ::rtl::OUString* pExplanation = 0,
- const ::rtl::OUString* pRuleId = 0 ) :
- bIsGrammarError( bGrammar ),
- sErrorText( rText ),
- aLocale( rLocale ),
- xGrammarChecker( rxGrammarChecker ),
- sServiceName( rServiceName ),
- aSuggestions( rSuggestions )
- {
- if( pDialogTitle )
- sDialogTitle = *pDialogTitle;
- if( pExplanation )
- sExplanation = *pExplanation;
- if( pRuleId )
- sRuleId = *pRuleId;
- };
-
- int operator==( const SpellErrorDescription& rDesc ) const
- {
- return bIsGrammarError == rDesc.bIsGrammarError &&
- sErrorText.equals( rDesc.sErrorText ) &&
- aLocale.Language.equals( rDesc.aLocale.Language ) &&
- aLocale.Country.equals( rDesc.aLocale.Country ) &&
- aLocale.Variant.equals( rDesc.aLocale.Variant ) &&
- aSuggestions == rDesc.aSuggestions &&
- xGrammarChecker == rDesc.xGrammarChecker &&
- sDialogTitle.equals( rDesc.sDialogTitle ) &&
- sExplanation.equals( rDesc.sExplanation ) &&
- sRuleId == rDesc.sRuleId;
- }
-};
-/* -----------------10.09.2003 14:23-----------------
-
- --------------------------------------------------*/
-class SpellErrorAttrib : public TextAttrib
-{
-public:
-
-private:
- //com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellAlternatives> m_xAlternatives;
- SpellErrorDescription m_aSpellErrorDescription;
-
- //not accessible
- SpellErrorAttrib();
-public:
-// SpellErrorAttrib(com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellAlternatives> xAlternatives);
- SpellErrorAttrib( const SpellErrorDescription& );
- SpellErrorAttrib( const SpellErrorAttrib& rAttr );
- ~SpellErrorAttrib();
-
- const SpellErrorDescription& GetErrorDescription() const { return m_aSpellErrorDescription; }
-
-
- virtual void SetFont( Font& rFont ) const;
- virtual TextAttrib* Clone() const;
- virtual int operator==( const TextAttrib& rAttr ) const;
-};
-/* -----------------10.09.2003 14:23-----------------
-
- --------------------------------------------------*/
-class SpellLanguageAttrib : public TextAttrib
-{
- LanguageType m_eLanguage;
-
- //not accessible
- SpellLanguageAttrib();
-
-public:
- SpellLanguageAttrib(LanguageType eLanguage);
- SpellLanguageAttrib( const SpellLanguageAttrib& rAttr );
- ~SpellLanguageAttrib();
-
- LanguageType GetLanguage() const {return m_eLanguage;}
- void SetLanguage(LanguageType eLang)
- {m_eLanguage = eLang;}
-
-
- virtual void SetFont( Font& rFont ) const;
- virtual TextAttrib* Clone() const;
- virtual int operator==( const TextAttrib& rAttr ) const;
-};
-/* -----------------31.10.2003 16:01-----------------
-
- --------------------------------------------------*/
-class SpellBackgroundAttrib : public TextAttrib
-{
- Color m_aBackgroundColor;
-
- //not accessible
- SpellBackgroundAttrib();
-
-public:
- SpellBackgroundAttrib(const Color& rCol);
- SpellBackgroundAttrib( const SpellBackgroundAttrib& rAttr );
- ~SpellBackgroundAttrib();
-
- const Color& GetColor() const { return m_aBackgroundColor;}
- void SetColor( const Color& rNewCol ){m_aBackgroundColor = rNewCol;}
-
-
- virtual void SetFont( Font& rFont ) const;
- virtual TextAttrib* Clone() const;
- virtual int operator==( const TextAttrib& rAttr ) const;
-};
-}//namespace svx
-#endif
diff --git a/svx/source/cui/SpellDialog.cxx b/svx/source/cui/SpellDialog.cxx
deleted file mode 100644
index 65e3c90e14..0000000000
--- a/svx/source/cui/SpellDialog.cxx
+++ /dev/null
@@ -1,2167 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpellDialog.cxx,v $
- * $Revision: 1.24 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <tools/ref.hxx>
-#include <tools/shl.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/msgbox.hxx>
-#ifndef _SCRBAR_HXX //autogen
-#include <vcl/scrbar.hxx>
-#endif
-#include <SpellAttrib.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/bindings.hxx>
-#include <svtools/undo.hxx>
-#include <svtools/lingucfg.hxx>
-#include <svtools/textdata.hxx>
-#include <svtools/filter.hxx>
-#include <unolingu.hxx>
-#include <svx/splwrap.hxx>
-#include <linguistic/lngprops.hxx>
-#ifndef _LINGUISTIC_MISC_HHX_
-#include <linguistic/misc.hxx>
-#endif
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XServiceDisplayName.hpp>
-#include <com/sun/star/linguistic2/SpellFailure.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <sfx2/app.hxx>
-#include <vcl/help.hxx>
-#include <vcl/graph.hxx>
-#include <osl/file.hxx>
-#include <impgrf.hxx>
-#include <svx/dialogs.hrc>
-#include <helpid.hrc>
-#include "SpellDialog.hrc"
-
-
-
-#include "optitems.hxx"
-#include <svx/svxenum.hxx>
-#include <svx/SpellDialogChildWindow.hxx>
-#include "SpellDialog.hxx"
-//#include <svx/splwrap.hxx> // Der Wrapper
-#include "dlgutil.hxx" // language
-#include <svx/optlingu.hxx>
-#include <svx/dialmgr.hxx>
-#include "svxerr.hxx"
-#include "treeopt.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::linguistic2;
-
-#define C2U(cChar) ::rtl::OUString::createFromAscii(cChar)
-// struct SpellDialog_Impl ---------------------------------------------
-
-struct SpellDialog_Impl
-{
- Sequence< Reference< XDictionary > > aDics;
-};
-// -----------------------------------------------------------------------
-//#define VENDOR_IMAGE_HEIGHT 44 //as specified
-
-#define SPELLUNDO_CHANGE_LANGUAGE (TEXTUNDO_USER + 1)
-#define SPELLUNDO_CHANGE_TEXTENGINE (TEXTUNDO_USER + 2)
-#define SPELLUNDO_CHANGE_NEXTERROR (TEXTUNDO_USER + 3)
-#define SPELLUNDO_CHANGE_ADD_TO_DICTIONARY (TEXTUNDO_USER + 4)
-#define SPELLUNDO_CHANGE_GROUP (TEXTUNDO_USER + 5) //undo list
-#define SPELLUNDO_MOVE_ERROREND (TEXTUNDO_USER + 6)
-#define SPELLUNDO_UNDO_EDIT_MODE (TEXTUNDO_USER + 7)
-#define SPELLUNDO_ADD_IGNORE_RULE (TEXTUNDO_USER + 8)
-
-namespace svx{
-class SpellUndoAction_Impl : public SfxUndoAction
-{
- USHORT m_nId;
- const Link& m_rActionLink;
- //undo of button enabling
- bool m_bEnableChangePB;
- bool m_bEnableChangeAllPB;
- //undo of MarkNextError - used in change and change all, ignore and ignore all
- long m_nNewErrorStart;
- long m_nNewErrorEnd;
- long m_nOldErrorStart;
- long m_nOldErrorEnd;
- bool m_bIsErrorLanguageSelected;
- ::rtl::OUString m_sRuleId;
- //undo of AddToDictionary
- Reference<XDictionary> m_xDictionary;
- ::rtl::OUString m_sAddedWord;
- //move end of error - ::ChangeMarkedWord()
- long m_nOffset;
-
-public:
- SpellUndoAction_Impl(USHORT nId, const Link& rActionLink) :
- m_nId(nId),
- m_rActionLink( rActionLink),
- m_bEnableChangePB(false),
- m_bEnableChangeAllPB(false),
- m_nNewErrorStart(-1),
- m_nNewErrorEnd(-1),
- m_nOldErrorStart(-1),
- m_nOldErrorEnd(-1),
- m_bIsErrorLanguageSelected(false),
- m_nOffset(0)
- {}
-
- ~SpellUndoAction_Impl();
-
- virtual void Undo();
- virtual USHORT GetId() const;
-
- void SetEnableChangePB(){m_bEnableChangePB = true;}
- bool IsEnableChangePB(){return m_bEnableChangePB;}
-
- void SetEnableChangeAllPB(){m_bEnableChangeAllPB = true;}
- bool IsEnableChangeAllPB(){return m_bEnableChangeAllPB;}
-
- void SetErrorMove(long nNewStart, long nNewEnd, long nOldStart, long nOldEnd)
- {
- m_nNewErrorStart = nNewStart;
- m_nNewErrorEnd = nNewEnd;
- m_nOldErrorStart = nOldStart;
- m_nOldErrorEnd = nOldEnd;
- }
- long GetNewErrorStart() { return m_nNewErrorStart;}
- long GetNewErrorEnd() { return m_nNewErrorEnd;}
- long GetOldErrorStart() { return m_nOldErrorStart;}
- long GetOldErrorEnd() { return m_nOldErrorEnd;}
-
- void SetErrorLanguageSelected(bool bSet){ m_bIsErrorLanguageSelected = bSet;}
- bool IsErrorLanguageSelected() const {return m_bIsErrorLanguageSelected;}
-
-
- void SetDictionary(Reference<XDictionary> xDict) { m_xDictionary = xDict; }
- Reference<XDictionary> GetDictionary() const {return m_xDictionary;}
- void SetAddedWord(const ::rtl::OUString& rWord) {m_sAddedWord = rWord;}
- const ::rtl::OUString& GetAddedWord() const { return m_sAddedWord;}
-
- void SetOffset(long nSet) {m_nOffset = nSet;}
- long GetOffset() const {return m_nOffset;}
-
- void SetErrorType( const ::rtl::OUString& rId ) { m_sRuleId = rId; }
- const ::rtl::OUString& GetErrorType() const { return m_sRuleId; }
-
-};
-}//namespace svx
-using namespace ::svx;
-/*-- 06.11.2003 12:16:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SpellUndoAction_Impl::~SpellUndoAction_Impl()
-{
-}
-/*-- 06.11.2003 12:16:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SpellUndoAction_Impl::Undo()
-{
- m_rActionLink.Call(this);
-}
-/*-- 06.11.2003 12:16:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT SpellUndoAction_Impl::GetId()const
-{
- return m_nId;
-}
-
-// class SvxSpellCheckDialog ---------------------------------------------
-
-SpellDialog::SpellDialog(
- SpellDialogChildWindow* pChildWindow,
- Window * pParent,
- SfxBindings* _pBindings)
- : SfxModelessDialog (_pBindings,
- pChildWindow,
- pParent,
- SVX_RES(RID_SVXDLG_SPELLCHECK)),
-
- aVendorImageFI ( this , SVX_RES( IMG_VENDOR ) ),
- aLanguageFT ( this, SVX_RES( FT_LANGUAGE ) ),
- aLanguageLB ( this, SVX_RES( LB_LANGUAGE ) ),
- aNotInDictFT ( this, SVX_RES( FT_NOTINDICT ) ),
- aSentenceED ( this, SVX_RES( ED_NEWWORD ) ),
- aSuggestionFT ( this, SVX_RES( FT_SUGGESTION ) ),
- aSuggestionLB ( this, SVX_RES( LB_SUGGESTION ) ),
-
- aIgnorePB ( this, SVX_RES( PB_IGNORE ) ),
- aIgnoreAllPB ( this, SVX_RES( PB_IGNOREALL ) ),
- aIgnoreRulePB ( this, SVX_RES( PB_IGNORERULE ) ),
- aAddToDictMB ( this, SVX_RES( MB_ADDTODICT ) ),
-
- aChangePB ( this, SVX_RES( PB_CHANGE ) ),
- aChangeAllPB ( this, SVX_RES( PB_CHANGEALL ) ),
- aExplainPB ( this, SVX_RES( PB_EXPLAIN) ),
- aAutoCorrPB ( this, SVX_RES( PB_AUTOCORR ) ),
-
- aCheckGrammarCB ( this, SVX_RES( CB_CHECK_GRAMMAR ) ),
-
- aHelpPB ( this, SVX_RES( PB_HELP ) ),
- aOptionsPB ( this, SVX_RES( PB_OPTIONS ) ),
- aUndoPB ( this, SVX_RES( PB_UNDO ) ),
- aClosePB ( this, SVX_RES( PB_CLOSE ) ),
- aBackgroundGB ( this, SVX_RES( GB_BACKGROUND ) ),
-
- aVendorImage ( SVX_RES( IMG_DEFAULT_VENDOR ) ),
- aVendorImageHC ( SVX_RES( IMG_DEFAULT_VENDOR_HC ) ),
-
- aResumeST ( SVX_RES(ST_RESUME )),
- aIgnoreOnceST ( aIgnorePB.GetText()),
- aNoSuggestionsST( SVX_RES(ST_NOSUGGESTIONS)),
- m_sTitleSpelling ( SVX_RES( ST_SPELLING ) ),
- m_sTitleSpellingGrammar ( SVX_RES( ST_SPELLING_AND_GRAMMAR ) ),
- m_sTitleSpellingGrammarVendor ( SVX_RES( ST_SPELLING_AND_GRAMMAR_VENDORNAME ) ),
- aDialogUndoLink( LINK (this, SpellDialog, DialogUndoHdl)),
- bModified( false ),
- bFocusLocked( true ),
- rParent ( *pChildWindow ),
- nOldLang ( LANGUAGE_NONE )
-{
- FreeResource();
- xSpell = LinguMgr::GetSpellChecker();
- pImpl = new SpellDialog_Impl;
-
- //HelpIds
- aClosePB. SetHelpId(HID_SPLDLG_BUTTON_CLOSE );
- aIgnorePB. SetHelpId(HID_SPLDLG_BUTTON_IGNORE );
- aIgnoreAllPB. SetHelpId(HID_SPLDLG_BUTTON_IGNOREALL);
- aIgnoreRulePB. SetHelpId(HID_SPLDLG_BUTTON_IGNORERULE);
- aChangePB. SetHelpId(HID_SPLDLG_BUTTON_CHANGE );
- aChangeAllPB. SetHelpId(HID_SPLDLG_BUTTON_CHANGEALL);
- aExplainPB. SetHelpId(HID_SPLDLG_BUTTON_EXPLAIN );
- Init_Impl();
-
- // disable controls if service is missing
- if (!xSpell.is())
- Enable( sal_False );
-
- Application::PostUserEvent( STATIC_LINK(
- this, SpellDialog, InitHdl ) );
-}
-
-// -----------------------------------------------------------------------
-
-SpellDialog::~SpellDialog()
-{
- // save possibly modified user-dictionaries
- Reference< XDictionaryList > xDicList( SvxGetDictionaryList() );
- if (xDicList.is())
- {
- linguistic::SaveDictionaries( xDicList );
- }
-
- delete aAddToDictMB.GetPopupMenu();
- delete pImpl;
-}
-
-// -----------------------------------------------------------------------
-
-void SpellDialog::Init_Impl()
-{
- // Handler initialisieren
- aClosePB.SetClickHdl(LINK( this, SpellDialog, CancelHdl ) );
- aChangePB.SetClickHdl(LINK( this, SpellDialog, ChangeHdl ) );
- aChangeAllPB.SetClickHdl(LINK( this, SpellDialog, ChangeAllHdl ) );
- aIgnorePB.SetClickHdl(LINK( this, SpellDialog, IgnoreHdl ) );
- aIgnoreAllPB.SetClickHdl(LINK( this, SpellDialog, IgnoreAllHdl ) );
- aIgnoreRulePB.SetClickHdl(LINK( this, SpellDialog, IgnoreAllHdl ) );
- aUndoPB.SetClickHdl(LINK( this, SpellDialog, UndoHdl ) );
-
- aAutoCorrPB.SetClickHdl( LINK( this, SpellDialog, ExtClickHdl ) );
- aCheckGrammarCB.SetClickHdl( LINK( this, SpellDialog, CheckGrammarHdl ));
- aOptionsPB .SetClickHdl( LINK( this, SpellDialog, ExtClickHdl ) );
-
- aSuggestionLB.SetDoubleClickHdl( LINK( this, SpellDialog, ChangeHdl ) );
-
- aSentenceED.SetModifyHdl(LINK ( this, SpellDialog, ModifyHdl) );
- aAddToDictMB.SetSelectHdl(LINK ( this, SpellDialog, AddToDictionaryHdl ) );
- aLanguageLB.SetSelectHdl(LINK( this, SpellDialog, LanguageSelectHdl ) );
-
- // initialize language ListBox
- aLanguageLB.SetLanguageList( LANG_LIST_SPELL_USED, FALSE, FALSE, TRUE );
-
- // get current language
- UpdateBoxes_Impl();
-
- // fill dictionary PopupMenu
- InitUserDicts();
-
- aSentenceED.ClearModifyFlag();
- SvxGetChangeAllList()->clear();
-}
-
-// -----------------------------------------------------------------------
-
-void SpellDialog::UpdateBoxes_Impl()
-{
- sal_Int32 i;
- aSuggestionLB.Clear();
-
- const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives();
-
- LanguageType nAltLanguage = LANGUAGE_NONE;
- //String aAltWord;
- Sequence< ::rtl::OUString > aNewWords;
- bool bIsGrammarError = false;
- if( pSpellErrorDescription )
- {
- nAltLanguage = SvxLocaleToLanguage( pSpellErrorDescription->aLocale );
- //aAltWord = String( xAlt->getWord() );
- aNewWords = pSpellErrorDescription->aSuggestions;
- bIsGrammarError = pSpellErrorDescription->bIsGrammarError;
- aExplainPB.SetExplanation(pSpellErrorDescription->sExplanation );
- }
- if( pSpellErrorDescription && pSpellErrorDescription->sDialogTitle.getLength() )
- {
- // use this function to apply the correct image to be used...
- SetTitle_Impl( nAltLanguage );
- // then change the title to the one to be actually used
- SetText( pSpellErrorDescription->sDialogTitle );
- }
- else
- SetTitle_Impl( nAltLanguage );
- SetSelectedLang_Impl( nAltLanguage );
-
-
- // Alternativen eintragen
- const ::rtl::OUString *pNewWords = aNewWords.getConstArray();
- const sal_Int32 nSize = aNewWords.getLength();
- for ( i = 0; i < nSize; ++i )
- {
- String aTmp( pNewWords[i] );
- if ( LISTBOX_ENTRY_NOTFOUND == aSuggestionLB.GetEntryPos( aTmp ) )
- {
- aSuggestionLB.InsertEntry( aTmp );
- aSuggestionLB.SetEntryFlags(aSuggestionLB.GetEntryCount() - 1, LISTBOX_ENTRY_FLAG_MULTILINE);
- }
- }
- if(!nSize)
- aSuggestionLB.InsertEntry( aNoSuggestionsST );
- aAutoCorrPB.Enable( nSize > 0 );
- //aSentenceED.GrabFocus();
-
- aSuggestionFT.Enable(nSize > 0);
- aSuggestionLB.Enable(nSize > 0);
- if( nSize )
- {
- aSuggestionLB.SelectEntryPos(0);
- }
- aChangePB.Enable( nSize > 0);
- aChangeAllPB.Enable(nSize > 0);
- bool bShowChangeAll = !bIsGrammarError;
- aChangeAllPB.Show( bShowChangeAll );
- aExplainPB.Show( !bShowChangeAll );
- aLanguageLB.Enable( bShowChangeAll );
- aIgnoreAllPB.Show( bShowChangeAll );
- aAddToDictMB.Show( bShowChangeAll );
- aIgnoreRulePB.Show( !bShowChangeAll );
- aIgnoreRulePB.Enable(pSpellErrorDescription && pSpellErrorDescription->sRuleId.getLength());
- aExplainPB.Enable( aExplainPB.HasExplanation() );
- aAutoCorrPB.Show( bShowChangeAll && rParent.HasAutoCorrection() );
-
-}
-// -----------------------------------------------------------------------
-
-void SpellDialog::SpellContinue_Impl(bool bUseSavedSentence)
-{
- //initially or after the last error of a sentence MarkNextError will fail
- //then GetNextSentence() has to be called followed again by MarkNextError()
- //MarkNextError is not initally called if the UndoEdit mode is active
- bool bNextSentence = false;
- if((!aSentenceED.IsUndoEditMode() && aSentenceED.MarkNextError()) ||
- true == ( bNextSentence = GetNextSentence_Impl(bUseSavedSentence) && aSentenceED.MarkNextError()))
- {
- const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives();
- if( pSpellErrorDescription )
- {
- UpdateBoxes_Impl();
- Control* aControls[] =
- {
- &aNotInDictFT,
- &aSentenceED,
- &aLanguageFT,
- 0
- };
- sal_Int32 nIdx = 0;
- do
- {
- aControls[nIdx]->Enable(sal_True);
- }
- while(aControls[++nIdx]);
-
-
- }
- if( bNextSentence )
- {
- //remove undo if a new sentence is active
- aSentenceED.ResetUndo();
- aUndoPB.Enable(FALSE);
- }
- }
-}
-/* -----------------10.09.2003 14:04-----------------
- Initialize, asynchronous to prevent virtial calls
- from a constructor
- --------------------------------------------------*/
-IMPL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog *, EMPTYARG )
-{
- pThis->SetUpdateMode( sal_False );
- //show or hide AutoCorrect depending on the modules abilities
- pThis->aAutoCorrPB.Show(pThis->rParent.HasAutoCorrection());
- pThis->SpellContinue_Impl();
- pThis->aSentenceED.ResetUndo();
- pThis->aUndoPB.Enable(FALSE);
-
- pThis->LockFocusChanges(true);
- if( pThis->aChangePB.IsEnabled() )
- pThis->aChangePB.GrabFocus();
- else if( pThis->aIgnorePB.IsEnabled() )
- pThis->aIgnorePB.GrabFocus();
- else if( pThis->aClosePB.IsEnabled() )
- pThis->aClosePB.GrabFocus();
- pThis->LockFocusChanges(false);
- //show grammar CheckBox depending on the modules abilities
- bool bHasGrammarChecking = pThis->rParent.HasGrammarChecking();
- pThis->aCheckGrammarCB.Show( bHasGrammarChecking );
- if( !bHasGrammarChecking )
- {
- //resize the dialog to hide the hidden area of the CheckBox
- Size aBackSize = pThis->aBackgroundGB.GetSizePixel();
- sal_Int32 nDiff = pThis->aBackgroundGB.GetPosPixel().Y() + aBackSize.Height()
- - pThis->aCheckGrammarCB.GetPosPixel().Y();
- aBackSize.Height() -= nDiff;
- pThis->aBackgroundGB.SetSizePixel(aBackSize);
- Button* aButtons[] = { &pThis->aHelpPB, &pThis->aOptionsPB, &pThis->aUndoPB, &pThis->aClosePB, 0 };
- sal_Int32 nButton = 0;
- while( aButtons[nButton])
- {
- Point aPos = aButtons[nButton]->GetPosPixel();
- aPos.Y() -= nDiff;
- aButtons[nButton]->SetPosPixel(aPos);
- ++nButton;
- }
- Size aDlgSize = pThis->GetSizePixel();
- aDlgSize.Height() -= nDiff;
- pThis->SetSizePixel( aDlgSize );
- }
- else
- {
- if( SvtLinguConfig().HasAnyVendorImages() )
- {
- pThis->aVendorImageFI.Show();
- Size aVendorSize = pThis->aVendorImageFI.GetSizePixel();
- Size aImageSize = pThis->aVendorImageFI.GetImage().GetSizePixel();
- if( aImageSize.Height() )
- {
- aVendorSize.Height() = aImageSize.Height();
- if(aVendorSize.Width() < aImageSize.Width())
- aVendorSize.Width() = aImageSize.Width();
- pThis->aVendorImageFI.SetSizePixel( aVendorSize );
- }
- //aVendorSize.Height() = nDiff;
- sal_Int32 nDiff = aVendorSize.Height();
- pThis->aVendorImageFI.SetSizePixel(aVendorSize);
- Control* aControls[] = {
- &pThis->aLanguageFT,
- &pThis->aLanguageLB,
- &pThis->aNotInDictFT,
- &pThis->aSentenceED,
- &pThis->aSuggestionFT,
- &pThis->aSuggestionLB,
- &pThis->aIgnorePB,
- &pThis->aIgnoreAllPB,
- &pThis->aIgnoreRulePB,
- &pThis->aAddToDictMB,
- &pThis->aChangePB,
- &pThis->aChangeAllPB,
- &pThis->aExplainPB,
- &pThis->aAutoCorrPB,
- &pThis->aCheckGrammarCB,
- &pThis->aHelpPB,
- &pThis->aOptionsPB,
- &pThis->aUndoPB,
- &pThis->aClosePB,
- &pThis->aBackgroundGB,
- 0
- };
- sal_Int32 nControl = 0;
- while( aControls[nControl])
- {
- Point aPos = aControls[nControl]->GetPosPixel();
- aPos.Y() += nDiff;
- aControls[nControl]->SetPosPixel(aPos);
- ++nControl;
- }
- Size aDlgSize = pThis->GetSizePixel();
- aDlgSize.Height() += nDiff;
- pThis->SetSizePixel( aDlgSize );
- pThis->Invalidate();
- }
- }
- pThis->aCheckGrammarCB.Check( pThis->rParent.IsGrammarChecking() );
- pThis->SetUpdateMode( sal_True );
- pThis->Show();
- return 0;
-};
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SpellDialog, ExtClickHdl, Button *, pBtn )
-{
- if (&aOptionsPB == pBtn)
- StartSpellOptDlg_Impl();
- else if(&aAutoCorrPB == pBtn)
- {
- //get the currently selected wrong word
- String sCurrentErrorText = aSentenceED.GetErrorText();
- //get the wrong word from the XSpellAlternative
- const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives();
- if( pSpellErrorDescription )
- {
- String sWrong(pSpellErrorDescription->sErrorText);
- //if the word has not been edited in the MultiLineEdit then
- //the current suggestion should be used
- //if it's not the 'no suggestions' entry
- if(sWrong == sCurrentErrorText &&
- aSuggestionLB.IsEnabled() && aSuggestionLB.GetSelectEntryCount() > 0 &&
- aNoSuggestionsST != aSuggestionLB.GetSelectEntry())
- {
- sCurrentErrorText = aSuggestionLB.GetSelectEntry();
- }
- if(sWrong != sCurrentErrorText)
- {
- SvxPrepareAutoCorrect( sWrong, sCurrentErrorText );
- LanguageType eLang = GetSelectedLang_Impl();
- rParent.AddAutoCorrection( sWrong, sCurrentErrorText, eLang );
- }
- }
- }
- return 0;
-}
-// -----------------------------------------------------------------------
-IMPL_LINK( SpellDialog, CheckGrammarHdl, CheckBox*, pBox )
-{
- rParent.SetGrammarChecking( pBox->IsChecked() );
- Impl_Restore();
- return 0;
-}
-
-void SpellDialog::StartSpellOptDlg_Impl()
-{
- sal_uInt16 aSpellInfos[] =
- {
- SID_ATTR_SPELL,SID_ATTR_SPELL,
- SID_SPELL_MODIFIED, SID_SPELL_MODIFIED,
- SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
- 0
- };
- SfxItemSet aSet( SFX_APP()->GetPool(), aSpellInfos);
- aSet.Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL ));
- SfxSingleTabDialog* pDlg =
- new SfxSingleTabDialog( this, aSet, RID_SFXPAGE_LINGU );
- SfxTabPage* pPage = SvxLinguTabPage::Create( pDlg, aSet );
- ( (SvxLinguTabPage*)pPage )->HideGroups( GROUP_MODULES );
- pDlg->SetTabPage( pPage );
- if(RET_OK == pDlg->Execute())
- {
-
- // Benutzerb"ucher anzeigen
- InitUserDicts();
- const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
- if(pOutSet)
- OfaTreeOptionsDialog::ApplyLanguageOptions(*pOutSet);
- }
- delete pDlg;
-
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SpellDialog, ChangeHdl, Button *, EMPTYARG )
-{
- if(aSentenceED.IsUndoEditMode())
- {
- SpellContinue_Impl();
- }
- else
- {
- aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
- String aString = aSentenceED.GetErrorText();
- //dots are sometimes part of the spelled word but they are not necessarily part of the replacement
- bool bDot = aString.Len() && aString.GetChar(aString.Len() - 1 ) == '.';
- if(aSuggestionLB.IsEnabled() &&
- aSuggestionLB.GetSelectEntryCount()>0 &&
- aNoSuggestionsST != aSuggestionLB.GetSelectEntry())
- aString = aSuggestionLB.GetSelectEntry();
- if(bDot && (!aString.Len() || aString.GetChar(aString.Len() - 1 ) != '.'))
- aString += '.';
-
- aSentenceED.ChangeMarkedWord(aString, GetSelectedLang_Impl());
- SpellContinue_Impl();
- bModified = false;
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
- }
- if(!aChangePB.IsEnabled())
- aIgnorePB.GrabFocus();
- return 1;
-}
-
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SpellDialog, ChangeAllHdl, Button *, EMPTYARG )
-{
- aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
- // change the current word first
- String aString = aSentenceED.GetErrorText();
- if(aSuggestionLB.IsEnabled() &&
- aSuggestionLB.GetSelectEntryCount()>0 &&
- aNoSuggestionsST != aSuggestionLB.GetSelectEntry())
- aString = aSuggestionLB.GetSelectEntry();
-
- LanguageType eLang = GetSelectedLang_Impl();
-
- // add new word to ChangeAll list
- String aOldWord( aSentenceED.GetErrorText() );
- SvxPrepareAutoCorrect( aOldWord, aString );
- Reference<XDictionary> aXDictionary( SvxGetChangeAllList(), UNO_QUERY );
- sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary,
- aOldWord , sal_True,
- aString, eLang );
-
- if(nAdded == DIC_ERR_NONE)
- {
- SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
- SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink);
- pAction->SetDictionary(aXDictionary);
- pAction->SetAddedWord(aOldWord);
- aSentenceED.AddUndoAction(pAction);
- }
-
- aSentenceED.ChangeMarkedWord(aString, eLang);
- SpellContinue_Impl();
- bModified = false;
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
- return 1;
-}
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SpellDialog, IgnoreAllHdl, Button *, pButton )
-{
- aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
- // add word to IgnoreAll list
- Reference< XDictionary > aXDictionary( SvxGetIgnoreAllList(), UNO_QUERY );
- //in case the error has been changed manually it has to be restored
- aSentenceED.RestoreCurrentError();
- if( pButton == &aIgnoreRulePB )
- {
- const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives();
- try
- {
- if( pSpellErrorDescription && pSpellErrorDescription->xGrammarChecker.is() )
- {
- pSpellErrorDescription->xGrammarChecker->ignoreRule( pSpellErrorDescription->sRuleId,
- pSpellErrorDescription->aLocale );
- }
- }
- catch( const uno::Exception& )
- {
- }
- }
- else
- {
- String sErrorText(aSentenceED.GetErrorText());
- sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary,
- sErrorText, sal_False,
- ::rtl::OUString(), LANGUAGE_NONE );
- if(nAdded == DIC_ERR_NONE)
- {
- SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
- SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink);
- pAction->SetDictionary(aXDictionary);
- pAction->SetAddedWord(sErrorText);
- aSentenceED.AddUndoAction(pAction);
- }
- }
-
- SpellContinue_Impl();
- bModified = false;
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
- return 1;
-}
-/*-- 06.11.2003 11:24:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SpellDialog, UndoHdl, Button*, EMPTYARG )
-{
- aSentenceED.Undo();
- if(!aSentenceED.GetUndoActionCount())
- aUndoPB.Enable(FALSE);
- return 0;
-}
-/*-- 06.11.2003 12:19:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SpellDialog, DialogUndoHdl, SpellUndoAction_Impl*, pAction )
-{
- switch(pAction->GetId())
- {
- case SPELLUNDO_CHANGE_TEXTENGINE:
- {
- if(pAction->IsEnableChangePB())
- aChangePB.Enable(FALSE);
- if(pAction->IsEnableChangeAllPB())
- aChangeAllPB.Enable(FALSE);
- }
- break;
- case SPELLUNDO_CHANGE_NEXTERROR:
- {
- aSentenceED.MoveErrorMarkTo((USHORT)pAction->GetOldErrorStart(), (USHORT)pAction->GetOldErrorEnd(), false);
- if(pAction->IsErrorLanguageSelected())
- {
- UpdateBoxes_Impl();
- }
- }
- break;
- case SPELLUNDO_CHANGE_ADD_TO_DICTIONARY:
- {
- if(pAction->GetDictionary().is())
- pAction->GetDictionary()->remove(pAction->GetAddedWord());
- }
- break;
- case SPELLUNDO_MOVE_ERROREND :
- {
- if(pAction->GetOffset() != 0)
- aSentenceED.MoveErrorEnd(pAction->GetOffset());
- }
- break;
- case SPELLUNDO_UNDO_EDIT_MODE :
- {
- //refill the dialog with the currently spelled sentence - throw away all changes
- SpellContinue_Impl(true);
- }
- break;
- case SPELLUNDO_ADD_IGNORE_RULE:
- //undo of ignored rules is not supported
- break;
- }
-
- return 0;
-}
-// -----------------------------------------------------------------------
-void SpellDialog::Impl_Restore()
-{
- //clear the "ChangeAllList"
- SvxGetChangeAllList()->clear();
- //get a new sentence
- aSentenceED.SetText(rtl::OUString());
- aSentenceED.ResetModified();
- SpellContinue_Impl();
- aIgnorePB.SetText(aIgnoreOnceST);
-}
-
-IMPL_LINK( SpellDialog, IgnoreHdl, Button *, EMPTYARG )
-{
- if(aIgnorePB.GetText() == aResumeST)
- {
- Impl_Restore();
- }
- else
- {
- //in case the error has been changed manually it has to be restored
- aSentenceED.RestoreCurrentError();
- rParent.ApplyChangedSentence(aSentenceED.CreateSpellPortions(true));
- aSentenceED.ResetModified();
-
- // the word is being ignored
- SpellContinue_Impl();
- bModified = false;
- }
- return 1;
-}
-
-
-// -----------------------------------------------------------------------
-
-sal_Bool SpellDialog::Close()
-{
- GetBindings().GetDispatcher()->
- Execute(rParent.GetType(),
- SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD);
- return sal_True;
-}
-// -----------------------------------------------------------------------
-
-void SpellDialog::SetSelectedLang_Impl( LanguageType nLang )
-{
- aLanguageLB.SelectLanguage( nLang );
-}
-
-// -----------------------------------------------------------------------
-
-LanguageType SpellDialog::GetSelectedLang_Impl() const
-{
- INT16 nLang = aLanguageLB.GetSelectLanguage();
- return nLang;
-}
-/* -----------------28.10.2003 14:27-----------------
-
- --------------------------------------------------*/
-IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox)
-{
- //if currently an error is selected then search for alternatives for
- //this word and fill the alternatives ListBox accordingly
- String sError = aSentenceED.GetErrorText();
- aSuggestionLB.Clear();
- if(sError.Len())
- {
- LanguageType eLanguage = pBox->GetSelectLanguage();
- Reference <XSpellAlternatives> xAlt = xSpell->spell( sError, eLanguage,
- Sequence< PropertyValue >() );
- if( xAlt.is() )
- aSentenceED.SetAlternatives( xAlt );
- else
- {
- aSentenceED.ChangeMarkedWord( sError, eLanguage );
- SpellContinue_Impl();
- }
-
- aSentenceED.AddUndoAction(new SpellUndoAction_Impl(SPELLUNDO_CHANGE_LANGUAGE, aDialogUndoLink));
- }
- SpellDialog::UpdateBoxes_Impl();
- return 0;
-}
-// -----------------------------------------------------------------------
-
-void SpellDialog::SetLanguage( sal_uInt16 nLang )
-
-/* [Beschreibung]
-
- wenn die Sprache im Thesaurus umgestellt wurde,
- muss auch hier die Sprache umgestellt werden.
-*/
-
-{
- SetTitle_Impl( nLang );
-
- // den richtigen Eintrag finden, da sortiert
- aLanguageLB.SelectLanguage( nLang );
-}
-/*-- 16.06.2008 11:27:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-static Image lcl_GetImageFromPngUrl( const ::rtl::OUString &rFileUrl )
-{
- Image aRes;
- ::rtl::OUString aTmp;
- osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp );
- Graphic aGraphic;
- const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) );
- if( GRFILTER_OK == LoadGraphic( aTmp, aFilterName, aGraphic ) )
- {
- aRes = Image( aGraphic.GetBitmapEx() );
- }
- return aRes;
-}
-void SpellDialog::SetTitle_Impl(LanguageType nLang)
-{
- String sTitle( m_sTitleSpelling );
- if( rParent.HasGrammarChecking() )
- {
- String sVendor;
- const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives();
- if( pSpellErrorDescription && pSpellErrorDescription->sServiceName.getLength() )
- {
- bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- ::rtl::OUString sSuggestionImageUrl =
- SvtLinguConfig().GetSpellAndGrammarDialogImage( pSpellErrorDescription->sServiceName, bHighContrast );
- aVendorImageFI.SetImage( lcl_GetImageFromPngUrl( sSuggestionImageUrl ) );
- uno::Reference< lang::XServiceDisplayName > xDisplayName( pSpellErrorDescription->xGrammarChecker, uno::UNO_QUERY );
- if( xDisplayName.is() )
- sVendor = xDisplayName->getServiceDisplayName( pSpellErrorDescription->aLocale );
- }
- else
- {
- bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- aVendorImageFI.SetImage( bHighContrast ? aVendorImageHC : aVendorImage );
- }
-
- if( sVendor.Len() )
- {
- sTitle = m_sTitleSpellingGrammarVendor;
- sTitle.SearchAndReplaceAscii( "$VendorName", sVendor );
- }
- else
- {
- //bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- sTitle = m_sTitleSpellingGrammar;
- }
- }
- sTitle.SearchAndReplaceAscii( "$LANGUAGE ($LOCATION)", ::GetLanguageString(nLang) );
- SetText( sTitle );
-}
-/*-------------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SpellDialog::InitUserDicts()
-{
- sal_uInt16 nLang = aLanguageLB.GetSelectLanguage();
-
- const Reference< XDictionary > *pDic = 0;
-
- // get list of dictionaries
- Reference< XDictionaryList > xDicList( SvxGetDictionaryList() );
- if (xDicList.is())
- {
- // add active, positive dictionary to dic-list (if not already done).
- // This is to ensure that there is at least on dictionary to which
- // words could be added.
- Reference< XDictionary > xDic( SvxGetOrCreatePosDic( xDicList ) );
- if (xDic.is())
- xDic->setActive( sal_True );
-
- pImpl->aDics = xDicList->getDictionaries();
- }
-
- // Benutzerbuecher anzeigen
- const sal_Int32 nSize = pImpl->aDics.getLength();
- pDic = pImpl->aDics.getConstArray();
- sal_Int32 i;
- delete aAddToDictMB.GetPopupMenu();
- PopupMenu* pMenu = new PopupMenu;
- for (i = 0; i < nSize; ++i )
- {
- Reference< XDictionary > xDic( pDic[i], UNO_QUERY );
- if (!xDic.is() || SvxGetIgnoreAllList() == xDic)
- continue;
-
- // add only active and not read-only dictionaries to list
- // from which to choose from
- Reference< frame::XStorable > xStor( xDic, UNO_QUERY );
- if ( xDic->isActive() && (!xStor.is() || !xStor->isReadonly()) )
- {
- sal_Bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
- pMenu->InsertItem( (USHORT)i + 1, ::GetDicInfoStr( xDic->getName(),
- SvxLocaleToLanguage( xDic->getLocale() ), bNegativ ) );
- }
- }
- aAddToDictMB.SetPopupMenu(pMenu);
-
- aAddToDictMB.Disable();
-
- sal_uInt16 k;
- for ( k = 0; k < pMenu->GetItemCount(); ++k )
- {
- sal_uInt16 nId = pMenu->GetItemId(k) - 1;
- sal_Bool bFound = sal_False;
-
- const sal_uInt16 nDicLang = SvxLocaleToLanguage( pDic[nId]->getLocale() );
- const sal_Bool bDicNegativ =
- pDic[nId]->getDictionaryType() == DictionaryType_NEGATIVE;
- // Stimmt die Sprache "uberein, dann enable
- if ((nDicLang == nLang || nDicLang == LANGUAGE_NONE) && !bDicNegativ)
- bFound = sal_True;
-
- if (bFound)
- {
- aAddToDictMB.Enable();
- break;
- }
- }
-}
-/*-- 20.10.2003 15:31:06---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
-{
- aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
- USHORT nItem = pButton->GetCurItemId();
-
- //GetErrorText() returns the current error even if the text is already
- //manually changed
- String sNewWord= aSentenceED.GetErrorText();
-
- Reference< XDictionary > xDic( pImpl->aDics.getConstArray()[ nItem - 1 ], UNO_QUERY );
- sal_Int16 nAddRes = DIC_ERR_UNKNOWN;
- if (xDic.is())
- {
- String sTmpTxt( sNewWord );
- sal_Bool bNegEntry = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
- nAddRes = linguistic::AddEntryToDic( xDic, sTmpTxt, bNegEntry,
- ::rtl::OUString(), LANGUAGE_NONE );
-
- if(nAddRes == DIC_ERR_NONE)
- {
- SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
- SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink);
- pAction->SetDictionary(xDic);
- pAction->SetAddedWord(sTmpTxt);
- aSentenceED.AddUndoAction(pAction);
- }
- // failed because there is already an entry?
- if (DIC_ERR_NONE != nAddRes && xDic->getEntry( sTmpTxt ).is())
- nAddRes = DIC_ERR_NONE;
- }
- if (DIC_ERR_NONE != nAddRes)
- {
- SvxDicError( this, nAddRes );
- return 0; // Nicht weitermachen
- }
- // nach dem Aufnehmen ggf. '='-Zeichen entfernen
- sNewWord.EraseAllChars( sal_Unicode( '=' ) );
-
- // go on
- SpellContinue_Impl();
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
- return 0;
-}
-/*-------------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK(SpellDialog, ModifyHdl, SentenceEditWindow_Impl*, pEd)
-{
- if (&aSentenceED == pEd)
- {
- bModified = true;
- aSuggestionLB.SetNoSelection();
- aSuggestionLB.Disable();
- String sNewText( aSentenceED.GetText() );
- aAutoCorrPB.Enable( sNewText != aSentenceED.GetText() );
- SpellUndoAction_Impl* pSpellAction = new SpellUndoAction_Impl(SPELLUNDO_CHANGE_TEXTENGINE, aDialogUndoLink);
- if(!aChangeAllPB.IsEnabled())
- {
- aChangeAllPB.Enable();
- pSpellAction->SetEnableChangeAllPB();
- }
- if(!aChangePB.IsEnabled())
- {
- aChangePB.Enable();
- pSpellAction->SetEnableChangePB();
- }
- aSentenceED.AddUndoAction(pSpellAction);
- }
- return 0;
-};
-/*-------------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK(SpellDialog, CancelHdl, Button *, EMPTYARG )
-{
- //apply changes first - if there are any
- if(aSentenceED.IsModified())
- {
- rParent.ApplyChangedSentence(aSentenceED.CreateSpellPortions(false));
- }
- Close();
- return 0;
-}
-/*-------------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SpellDialog::Paint( const Rectangle& rRect )
-{
- ModelessDialog::Paint(rRect );
- Rectangle aRect(aBackgroundGB.GetPosPixel(), aBackgroundGB.GetSizePixel());
- DecorationView aDecoView( this );
- aDecoView.DrawButton( aRect, BUTTON_DRAW_NOFILL);
-}
-/*-- 28.10.2003 13:26:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-long SpellDialog::Notify( NotifyEvent& rNEvt )
-{
- /* #i38338#
- * FIXME: LoseFocus and GetFocus are signals from vcl that
- * a window actually got/lost the focus, it never should be
- * forwarded from another window, that is simply wrong.
- * FIXME: overloading the virtual methods GetFocus and LoseFocus
- * in SpellDialogChildWindow by making them pure is at least questionable.
- * The only sensible thing would be to call the new Method differently,
- * e.g. DialogGot/LostFocus or so.
- */
- if( IsVisible() && !bFocusLocked )
- {
- if( rNEvt.GetType() == EVENT_GETFOCUS )
- {
- //notify the child window of the focus change
- rParent.GetFocus();
- }
- else if( rNEvt.GetType() == EVENT_LOSEFOCUS )
- {
- //notify the child window of the focus change
- rParent.LoseFocus();
- }
- }
- return SfxModelessDialog::Notify(rNEvt);
-}
-/* -----------------10.09.2003 08:26-----------------
-
- --------------------------------------------------*/
-void SpellDialog::InvalidateDialog()
-{
- if( bFocusLocked )
- return;
- aIgnorePB.SetText(aResumeST);
- Window* aDisableArr[] =
- {
- &aNotInDictFT,
- &aSentenceED,
- &aSuggestionFT,
- &aSuggestionLB,
- &aLanguageFT,
- &aLanguageLB,
- &aIgnoreAllPB,
- &aIgnoreRulePB,
- &aAddToDictMB,
- &aChangePB,
- &aChangeAllPB,
- &aAutoCorrPB,
- &aUndoPB,
- 0
- };
- sal_Int16 i = 0;
- while(aDisableArr[i])
- {
- aDisableArr[i]->Enable(FALSE);
- i++;
- }
- SfxModelessDialog::Deactivate();
-}
-
-/*-- 10.09.2003 08:35:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence)
-{
- bool bRet = false;
- if(!bUseSavedSentence && aSentenceED.IsModified())
- {
- rParent.ApplyChangedSentence(aSentenceED.CreateSpellPortions(false));
- }
- aSentenceED.ResetModified();
- SpellPortions aSentence = bUseSavedSentence ? m_aSavedSentence : rParent.GetNextWrongSentence();
- if(!bUseSavedSentence)
- m_aSavedSentence = aSentence;
- bool bHasReplaced = false;
- while(aSentence.size())
- {
- //apply all changes that are already part of the "ChangeAllList"
- //returns true if the list still contains errors after the changes have been applied
-
- if(!ApplyChangeAllList_Impl(aSentence, bHasReplaced))
- {
- rParent.ApplyChangedSentence(aSentence);
- aSentence = rParent.GetNextWrongSentence();
- }
- else
- break;
- }
-
- if(aSentence.size())
- {
- SpellPortions::iterator aStart = aSentence.begin();
- rtl::OUString sText;
- while(aStart != aSentence.end())
- {
- // hidden text has to be ignored
- if(!aStart->bIsHidden)
- sText += aStart->sText;
- aStart++;
- }
- aSentenceED.SetText(sText);
- aStart = aSentence.begin();
- sal_Int32 nStartPosition = 0;
- sal_Int32 nEndPosition = 0;
-
- while(aStart != aSentence.end())
- {
- // hidden text has to be ignored
- if(!aStart->bIsHidden)
- {
- nEndPosition += aStart->sText.getLength();
- if(aStart->xAlternatives.is())
- {
- uno::Reference< container::XNamed > xNamed( aStart->xAlternatives, uno::UNO_QUERY );
- ::rtl::OUString sServiceName;
- if( xNamed.is() )
- sServiceName = xNamed->getName();
- SpellErrorDescription aDesc( false, aStart->xAlternatives->getWord(),
- aStart->xAlternatives->getLocale(), aStart->xAlternatives->getAlternatives(), 0, sServiceName);
- aSentenceED.SetAttrib( SpellErrorAttrib(aDesc), 0, (USHORT) nStartPosition, (USHORT) nEndPosition );
- }
- else if(aStart->bIsGrammarError )
- {
- uno::Reference< lang::XServiceInfo > xInfo( aStart->xGrammarChecker, uno::UNO_QUERY );
- SpellErrorDescription aDesc( true,
- aStart->sText,
- SvxCreateLocale( aStart->eLanguage ),
- aStart->aGrammarError.aSuggestions,
- aStart->xGrammarChecker,
- xInfo->getImplementationName(),
- &aStart->sDialogTitle,
- &aStart->aGrammarError.aFullComment,
- &aStart->aGrammarError.aRuleIdentifier );
- aSentenceED.SetAttrib( SpellErrorAttrib(aDesc), 0, (USHORT) nStartPosition, (USHORT) nEndPosition );
- }
- if(aStart->bIsField)
- aSentenceED.SetAttrib( SpellBackgroundAttrib(COL_LIGHTGRAY), 0, (USHORT) nStartPosition, (USHORT) nEndPosition );
- aSentenceED.SetAttrib( SpellLanguageAttrib(aStart->eLanguage), 0, (USHORT) nStartPosition, (USHORT) nEndPosition );
- nStartPosition = nEndPosition;
- }
- aStart++;
- }
- //the edit field needs to be modified to apply the change from the ApplyChangeAllList
- if(!bHasReplaced)
- aSentenceED.ClearModifyFlag();
- aSentenceED.ResetUndo();
- aUndoPB.Enable(FALSE);
- bRet = nStartPosition > 0;
- }
- return bRet;
-}
-/*-- 12.11.2003 15:21:25---------------------------------------------------
- replace errrors that have a replacement in the ChangeAllList
- returns false if the result doesn't contain errors after the replacement
- -----------------------------------------------------------------------*/
-bool SpellDialog::ApplyChangeAllList_Impl(SpellPortions& rSentence, bool &bHasReplaced)
-{
- bHasReplaced = false;
- bool bRet = true;
- SpellPortions::iterator aStart = rSentence.begin();
- Reference<XDictionary> xChangeAll( SvxGetChangeAllList(), UNO_QUERY );
- if(!xChangeAll->getCount())
- return bRet;
- bRet = false;
- while(aStart != rSentence.end())
- {
- if(aStart->xAlternatives.is())
- {
- Reference<XDictionaryEntry> xEntry = xChangeAll->getEntry( aStart->sText );
- if(xEntry.is())
- {
- aStart->sText = xEntry->getReplacementText();
- aStart->xAlternatives = 0;
- bHasReplaced = true;
- }
- else
- bRet = true;
- }
- else if( aStart->bIsGrammarError )
- bRet = true;
- aStart++;
- }
- return bRet;
-}
-/*-- 10.09.2003 10:40:21---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SentenceEditWindow_Impl::SentenceEditWindow_Impl( SpellDialog* pParent, const ResId& rResId ) :
- MultiLineEdit( pParent, rResId ),
- m_nErrorStart(0),
- m_nErrorEnd(0),
- m_bIsUndoEditMode(false)
-{
- DisableSelectionOnFocus();
-}
-/*-- 10.09.2003 10:40:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
-{
-}
-/*-- 20.10.2003 13:42:34---------------------------------------------------
- The selection before inputting a key may have a range or not
- and it may be inside or outside of field or error attributes.
- A range may include the attribute partially, completely or together
- with surrounding text. It may also contain more than one attribute
- or no attribute at all.
- Depending on this starting conditions some actions are necessary:
- Attempts to delete a field are only allowed if the selection is the same
- as the field's selection. Otherwise the field has to be selected and the key
- input action has to be skipped.
- Input of text at the start of the field requires the field attribute to be
- corrected - it is not allowed to grow.
-
- In case of errors the appending of text should grow the error attribute because
- that is what the user usually wants to do.
-
- Backspace at the start of the attribute requires to find out if a field ends
- directly in front of the cursor position. In case of a field this attribute has to be
- selected otherwise the key input method is allowed.
-
- All changes outside of the error attributes switch the dialog mode to a "Undo edit" state that
- removes all visible attributes and switches off further attribute checks.
- Undo in this restarts the dialog with a current sentence newly presented.
- All changes to the sentence are undone including the ones before the "Undo edit state" has been reached
-
- We end up with 9 types of selection
- 1 (LEFT_NO) - no range, start of attribute - can also be 3 at the same time
- 2 (INSIDE_NO) - no range, inside of attribute
- 3 (RIGHT_NO) - no range, end of attribute - can also be 1 at the same time
- 4 (FULL) - range, same as attribute
- 5 (INSIDE_YES) - range, inside of the attribute
- 6 (BRACE)- range, from outside of the attribute to the inside or
- including the complete attribute and something outside,
- maybe more than one attribute
- 7 (OUTSIDE_NO) - no range, not at an attribute
- 8 (OUTSIDE_YES) - range, completely outside of all attributes
-
- What has to be done depending on the attribute type involved
- possible actions: UE - Undo edit mode
- CO - Continue, no additional action is required
- FS - Field has to be completely selected
- EX - The attribute has to be expanded to include the added text
-
- 1 - backspace delete any other
- UE on field FS on error CO on field FS on error CO
-
- 2 - on field FS on error C
- 3 - backspace delete any other
- on field FS on error CO UE on field UE on error EX
-
- if 1 and 3 happen to apply both then backspace and other handling is 1 delete is 3
-
- 4 - on field UE and on error CO
- 5 - on field FS and on error CO
- 6 - on field FS and on error UE
- 7 - UE
- 8 - UE
- -----------------------------------------------------------------------*/
-#define INVALID 0
-#define LEFT_NO 1
-#define INSIDE_NO 2
-#define RIGHT_NO 3
-#define FULL 4
-#define INSIDE_YES 5
-#define BRACE 6
-#define OUTSIDE_NO 7
-#define OUTSIDE_YES 8
-
-#define ACTION_UNDOEDIT 0
-#define ACTION_CONTINUE 1
-#define ACTION_SELECTFIELD 2
-#define ACTION_EXPAND 3
-
-long SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
-{
- bool bChange = false;
- const TextCharAttrib* pErrorAttrib = 0;
- if(rNEvt.GetType() == EVENT_KEYINPUT)
- {
- const KeyEvent& rKeyEvt = *rNEvt.GetKeyEvent();
- bChange = TextEngine::DoesKeyChangeText( rKeyEvt );
- if(bChange && !IsUndoEditMode() &&
- rKeyEvt.GetKeyCode().GetCode() != KEY_TAB)
- {
- TextEngine* pTextEngine = GetTextEngine();
- TextView* pTextView = pTextEngine->GetActiveView();
- const TextSelection& rCurrentSelection = pTextView->GetSelection();
- //determine if the selection contains a field
- bool bHasField = false;
- bool bHasError = false;
- bool bHasFieldLeft = false;
- bool bHasErrorLeft = false;
-// bool bInsideAttr = false;
-
- bool bHasRange = rCurrentSelection.HasRange();
- sal_uInt8 nSelectionType = 0; // invalid type!
-
- TextPaM aCursor(rCurrentSelection.GetStart());
- const TextCharAttrib* pBackAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_BACKGROUND );
- const TextCharAttrib* pErrorAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_ERROR );
- const TextCharAttrib* pBackAttrLeft = 0;
- const TextCharAttrib* pErrorAttrLeft = 0;
-
- bHasField = pBackAttr != 0 && (bHasRange || pBackAttr->GetEnd() > aCursor.GetIndex());
- bHasError = pErrorAttr != 0 && (bHasRange || pErrorAttr->GetEnd() > aCursor.GetIndex());
- if(bHasRange)
- {
- if(pBackAttr &&
- pBackAttr->GetStart() == rCurrentSelection.GetStart().GetIndex() &&
- pBackAttr->GetEnd() == rCurrentSelection.GetEnd().GetIndex())
- {
- nSelectionType = FULL;
- }
- else if(pErrorAttr &&
- pErrorAttr->GetStart() <= rCurrentSelection.GetStart().GetIndex() &&
- pErrorAttr->GetEnd() >= rCurrentSelection.GetEnd().GetIndex())
- {
- nSelectionType = INSIDE_YES;
- }
- else
- {
- nSelectionType = bHasField||bHasError ? BRACE : OUTSIDE_NO;
- while(aCursor.GetIndex() < rCurrentSelection.GetEnd().GetIndex())
- {
- ++aCursor.GetIndex();
- const TextCharAttrib* pIntBackAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_BACKGROUND );
- const TextCharAttrib* pIntErrorAttr = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_ERROR );
- //if any attr has been found then BRACE
- if(pIntBackAttr || pIntErrorAttr)
- nSelectionType = BRACE;
- //the field has to be selected
- if(pIntBackAttr && !pBackAttr)
- pBackAttr = pIntBackAttr;
- bHasField |= pIntBackAttr != 0;
- }
- }
- }
- else
- {
- //no range selection: then 1 2 3 and 8 are possible
- const TextCharAttrib* pCurAttr = pBackAttr ? pBackAttr : pErrorAttr;
- if(pCurAttr)
- {
- nSelectionType = pCurAttr->GetStart() == rCurrentSelection.GetStart().GetIndex() ?
- LEFT_NO : pCurAttr->GetEnd() == rCurrentSelection.GetEnd().GetIndex() ? RIGHT_NO : INSIDE_NO;
- }
- else
- nSelectionType = OUTSIDE_NO;
-
- bHasFieldLeft = pBackAttr && pBackAttr->GetEnd() == aCursor.GetIndex();
- if(bHasFieldLeft)
- {
- pBackAttrLeft = pBackAttr;
- pBackAttr = 0;
- }
- bHasErrorLeft = pErrorAttr && pErrorAttr->GetEnd() == aCursor.GetIndex();
- if(bHasErrorLeft)
- {
- pErrorAttrLeft = pErrorAttr;
- pErrorAttr = 0;
- }
-
- //check previous position if this exists
- //that is a redundant in the case the the attribute found above already is on the left cursor side
- //but it's o.k. for two errors/fields side by side
- if(aCursor.GetIndex())
- {
- --aCursor.GetIndex();
- pBackAttrLeft = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_BACKGROUND );
- pErrorAttrLeft = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_ERROR );
- bHasFieldLeft = pBackAttrLeft !=0;
- bHasErrorLeft = pErrorAttrLeft != 0;
-// bInsideAttr = (bHasField || bHasError) && (bHasFieldLeft || bHasErrorLeft);
- ++aCursor.GetIndex();
- }
- }
- //Here we have to determine if the error found is the one currently active
- bool bIsErrorActive = (pErrorAttr && pErrorAttr->GetStart() == m_nErrorStart) ||
- (pErrorAttrLeft && pErrorAttrLeft->GetStart() == m_nErrorStart);
-
- DBG_ASSERT(nSelectionType != INVALID, "selection type not set!");
-
- const KeyCode& rKeyCode = rKeyEvt.GetKeyCode();
- bool bDelete = rKeyCode.GetCode() == KEY_DELETE;
- bool bBackspace = rKeyCode.GetCode() == KEY_BACKSPACE;
-
- sal_Int8 nAction = ACTION_CONTINUE;
-// nAction = ACTION_UNDOEDIT
-// nAction = ACTION_SELECTFIELD
-// nAction = ACTION_EXPAND
- switch(nSelectionType)
- {
-// 1 - backspace delete any other
-// UE on field FS on error CO on field FS on error CO
- case LEFT_NO :
- if(bBackspace)
- {
- nAction = bHasFieldLeft ? ACTION_SELECTFIELD : ACTION_UNDOEDIT;
- //to force the use of pBackAttrLeft
- pBackAttr = 0;
- }
- else if(bDelete)
- nAction = bHasField ? ACTION_SELECTFIELD : ACTION_CONTINUE;
- else
- nAction = bHasError && !aCursor.GetIndex() ? ACTION_CONTINUE :
- bHasError ? ACTION_EXPAND : bHasErrorLeft ? ACTION_CONTINUE : ACTION_UNDOEDIT;
- break;
-// 2 - on field FS on error C
- case INSIDE_NO :
- nAction = bHasField ? ACTION_SELECTFIELD :
- bIsErrorActive ? ACTION_CONTINUE : ACTION_UNDOEDIT;
- break;
-// 3 - backspace delete any other
-// on field FS on error CO UE on field UE on error EX
- case RIGHT_NO :
- if(bBackspace)
- nAction = bHasFieldLeft ? ACTION_SELECTFIELD : ACTION_CONTINUE;
- else if(bDelete)
- nAction = bHasFieldLeft && bHasError ? ACTION_CONTINUE : ACTION_UNDOEDIT;
- else
- nAction = bHasFieldLeft && bHasError ? ACTION_EXPAND :
- bHasError ? ACTION_CONTINUE : bHasErrorLeft ? ACTION_EXPAND :ACTION_UNDOEDIT;
- break;
-// 4 - on field UE and on error CO
- case FULL :
- nAction = bHasField ? ACTION_UNDOEDIT : ACTION_CONTINUE;
- break;
-// 5 - on field FS and on error CO
- case INSIDE_YES :
- nAction = bHasField ? ACTION_SELECTFIELD : ACTION_CONTINUE;
- break;
-// 6 - on field FS and on error UE
- case BRACE :
- nAction = bHasField ? ACTION_SELECTFIELD : ACTION_UNDOEDIT;;
- break;
-// 7 - UE
-// 8 - UE
- case OUTSIDE_NO :
- case OUTSIDE_YES:
- nAction = ACTION_UNDOEDIT;
- break;
- }
- //save the current paragraph
- USHORT nCurrentLen = GetText().Len();
- if(nAction != ACTION_SELECTFIELD)
- pTextView->GetWindow()->KeyInput(rKeyEvt);
- else
- {
- const TextCharAttrib* pCharAttr = pBackAttr ? pBackAttr : pBackAttrLeft;
- if(pCharAttr)
- {
- TextPaM aStart(0, pCharAttr->GetStart());
- TextPaM aEnd(0, pCharAttr->GetEnd());
- TextSelection aNewSel(aStart, aEnd);
- pTextView->SetSelection( aNewSel);
- }
- }
- if(nAction == ACTION_EXPAND)
- {
- DBG_ASSERT(pErrorAttrLeft || pErrorAttr, "where is the error");
- //text has been added on the right and only the 'error attribute has to be corrected
- if(pErrorAttrLeft)
- {
- TextAttrib* pNewError = pErrorAttrLeft->GetAttr().Clone();
- USHORT nStart = pErrorAttrLeft->GetStart();
- USHORT nEnd = pErrorAttrLeft->GetEnd();
- pTextEngine->RemoveAttrib( 0, *pErrorAttrLeft );
- SetAttrib( *pNewError, 0, nStart, ++nEnd );
- //only active errors move the mark
- if(bIsErrorActive)
- {
- bool bGrammar = static_cast<const SpellErrorAttrib&>(*pNewError).GetErrorDescription().bIsGrammarError;
- MoveErrorMarkTo(nStart, nEnd, bGrammar);
- }
- delete pNewError;
- }
- //text has been added on the left then the error attribute has to be expanded and the
- //field attribute on the right - if any - has to be contracted
- else if(pErrorAttr)
- {
- //determine the change
- USHORT nAddedChars = GetText().Len() - nCurrentLen;
-
- TextAttrib* pNewError = pErrorAttr->GetAttr().Clone();
- USHORT nStart = pErrorAttr->GetStart();
- USHORT nEnd = pErrorAttr->GetEnd();
- pTextEngine->RemoveAttrib( 0, *pErrorAttr );
- nStart = nStart - (USHORT)nAddedChars;
- SetAttrib( *pNewError, 0, nStart - nAddedChars, nEnd );
- //only if the error is active the mark is moved here
- if(bIsErrorActive)
- {
- bool bGrammar = static_cast<const SpellErrorAttrib&>(*pNewError).GetErrorDescription().bIsGrammarError;
- MoveErrorMarkTo(nStart, nEnd, bGrammar);
- }
- delete pNewError;
-
- if(pBackAttrLeft)
- {
- TextAttrib* pNewBack = pBackAttrLeft->GetAttr().Clone();
- USHORT _nStart = pBackAttrLeft->GetStart();
- USHORT _nEnd = pBackAttrLeft->GetEnd();
- pTextEngine->RemoveAttrib( 0, *pBackAttrLeft );
- SetAttrib( *pNewBack, 0, _nStart, _nEnd - nAddedChars);
- delete pNewBack;
- }
- }
- }
- else if(nAction == ACTION_UNDOEDIT)
- {
- SetUndoEditMode(true);
- }
- //make sure the error positions are correct after text changes
- //the old attribute may have been deleted
- //all changes inside of the current error leave the error attribute at the current
- //start position
- if(!IsUndoEditMode() && bIsErrorActive)
- {
- const TextCharAttrib* pFontColor = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_FONTCOLOR );
- pErrorAttrib = pTextEngine->FindCharAttrib( TextPaM(0, m_nErrorStart), TEXTATTR_SPELL_ERROR );
- if(pFontColor && pErrorAttrib )
- {
- m_nErrorStart = pFontColor->GetStart();
- m_nErrorEnd = pFontColor->GetEnd();
- if(pErrorAttrib->GetStart() != m_nErrorStart || pErrorAttrib->GetEnd() != m_nErrorEnd)
- {
- TextAttrib* pNewError = pErrorAttrib->GetAttr().Clone();
- pTextEngine->RemoveAttrib( 0, *pErrorAttr );
- SetAttrib( *pNewError, 0, m_nErrorStart, m_nErrorEnd );
- delete pNewError;
- }
- }
- }
- //this is not a modification anymore
- if(nAction != ACTION_SELECTFIELD && !m_bIsUndoEditMode)
- CallModifyLink();
- }
- else
- bChange = false;
- }
- long nRet = bChange ? 1 : MultiLineEdit::PreNotify(rNEvt);
- return nRet;
-}
-/*-- 10.09.2003 13:38:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-bool SentenceEditWindow_Impl::MarkNextError()
-{
- ExtTextEngine* pTextEngine = GetTextEngine();
- USHORT nTextLen = pTextEngine->GetTextLen(0);
- if(m_nErrorEnd >= nTextLen - 1)
- return false;
- //if it's not already modified the modified flag has to be reset at the and of the marking
- bool bModified = IsModified();
- bool bRet = false;
- const USHORT nOldErrorStart = m_nErrorStart;
- const USHORT nOldErrorEnd = m_nErrorEnd;
-
- //create a cursor behind the end of the last error
- //- or at 0 at the start of the sentence
- TextPaM aCursor(0, m_nErrorEnd ? m_nErrorEnd + 1 : 0);
- //search for SpellErrorAttrib
-
- const TextCharAttrib* pNextError = 0;
- //iterate over the text and search for the next error that maybe has
- //to be replace by a ChangeAllList replacement
- bool bGrammarError = false;
- while(aCursor.GetIndex() < nTextLen)
- {
- while(aCursor.GetIndex() < nTextLen &&
- 0 == (pNextError = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_ERROR)))
- {
- ++aCursor.GetIndex();
- }
- // maybe the error found here is already in the ChangeAllList and has to be replaced
-
- Reference<XDictionary> xChangeAll( SvxGetChangeAllList(), UNO_QUERY );
- Reference<XDictionaryEntry> xEntry;
-
-// Reference <XSpellAlternatives> xAlternatives;
- const SpellErrorDescription* pSpellErrorDescription = 0;
- if(pNextError)
- {
- pSpellErrorDescription = &static_cast<const SpellErrorAttrib&>(pNextError->GetAttr()).GetErrorDescription();
- bGrammarError = pSpellErrorDescription->bIsGrammarError;
- }
- if(xChangeAll->getCount() && pSpellErrorDescription &&
- (xEntry = xChangeAll->getEntry( pSpellErrorDescription->sErrorText )).is())
- {
- m_nErrorStart = pNextError->GetStart();
- m_nErrorEnd = pNextError->GetEnd();
- ChangeMarkedWord(xEntry->getReplacementText(),
- SvxLocaleToLanguage( pSpellErrorDescription->aLocale ));
- aCursor.GetIndex() = aCursor.GetIndex() + (USHORT)(xEntry->getReplacementText().getLength());
- }
- else
- break;
- }
-
- //if an attrib has been found search for the end of the error string
- if(aCursor.GetIndex() < nTextLen)
- {
- m_nErrorStart = aCursor.GetIndex();
- m_nErrorEnd = pNextError->GetEnd();
- MoveErrorMarkTo(m_nErrorStart, m_nErrorEnd, bGrammarError);
- bRet = true;
- //add an undo action
- SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
- SPELLUNDO_CHANGE_NEXTERROR, GetSpellDialog()->aDialogUndoLink);
- pAction->SetErrorMove(m_nErrorStart, m_nErrorEnd, nOldErrorStart, nOldErrorEnd);
- const SpellErrorAttrib* pOldAttrib = static_cast<const SpellErrorAttrib*>(
- pTextEngine->FindAttrib( TextPaM(0, nOldErrorStart), TEXTATTR_SPELL_ERROR ));
- pAction->SetErrorLanguageSelected(pOldAttrib && pOldAttrib->GetErrorDescription().aSuggestions.getLength() &&
- SvxLocaleToLanguage( pOldAttrib->GetErrorDescription().aLocale) ==
- GetSpellDialog()->aLanguageLB.GetSelectLanguage());
- AddUndoAction(pAction);
- }
- else
- m_nErrorStart = m_nErrorEnd = nTextLen;
- if( !bModified )
- ClearModifyFlag();
- SpellDialog* pSpellDialog = GetSpellDialog();
- pSpellDialog->aIgnorePB.Enable(bRet);
- pSpellDialog->aIgnoreAllPB.Enable(bRet);
- pSpellDialog->aAutoCorrPB.Enable(bRet);
- pSpellDialog->aAddToDictMB.Enable(bRet);
- return bRet;
-}
-
-/*-- 06.11.2003 13:30:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::MoveErrorMarkTo(USHORT nStart, USHORT nEnd, bool bGrammarError)
-{
- TextEngine* pTextEngine = GetTextEngine();
- pTextEngine->RemoveAttribs( 0, (USHORT)TEXTATTR_FONTCOLOR, TRUE );
- pTextEngine->RemoveAttribs( 0, (USHORT)TEXTATTR_FONTWEIGHT, TRUE );
- pTextEngine->SetAttrib( TextAttribFontWeight(WEIGHT_BOLD), 0, nStart, nEnd );
- pTextEngine->SetAttrib( TextAttribFontColor(bGrammarError ? COL_LIGHTBLUE : COL_LIGHTRED), 0, nStart, nEnd );
- m_nErrorStart = nStart;
- m_nErrorEnd = nEnd;
-}
-
-/*-- 17.09.2003 10:13:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::ChangeMarkedWord(const String& rNewWord, LanguageType eLanguage)
-{
- //calculate length changes
- long nDiffLen = rNewWord.Len() - m_nErrorEnd + m_nErrorStart;
- TextSelection aSel(TextPaM(0, m_nErrorStart), TextPaM(0, m_nErrorEnd));
- //Remove spell errror attribute
- ExtTextEngine* pTextEngine = GetTextEngine();
- pTextEngine->UndoActionStart( TEXTUNDO_INSERT );
- const TextCharAttrib* pErrorAttrib = pTextEngine->FindCharAttrib( TextPaM(0, m_nErrorStart), TEXTATTR_SPELL_ERROR );
- DBG_ASSERT(pErrorAttrib, "no error attribute found");
-// Reference <XSpellAlternatives> xAlternatives;
- const SpellErrorDescription* pSpellErrorDescription = 0;
- if(pErrorAttrib)
- {
- pTextEngine->RemoveAttrib(0, *pErrorAttrib);
- pSpellErrorDescription = &static_cast<const SpellErrorAttrib&>(pErrorAttrib->GetAttr()).GetErrorDescription();
- }
- const TextCharAttrib* pBackAttrib = pTextEngine->FindCharAttrib( TextPaM(0, m_nErrorStart), TEXTATTR_SPELL_BACKGROUND );
- pTextEngine->ReplaceText( aSel, rNewWord );
- //
- if(!m_nErrorStart)
- {
- //attributes following an error at the start of the text are not moved but expanded from the
- //text engine - this is done to keep full-paragraph-attributes
- //in the current case that handling is not desired
- const TextCharAttrib* pLangAttrib =
- pTextEngine->FindCharAttrib(
- TextPaM(0, m_nErrorEnd), TEXTATTR_SPELL_LANGUAGE );
- USHORT nTextLen = pTextEngine->GetTextLen( 0 );
- if(pLangAttrib && !pLangAttrib->GetStart() && pLangAttrib->GetEnd() ==
- nTextLen)
- {
- SpellLanguageAttrib aNewLangAttrib( static_cast<const SpellLanguageAttrib&>(pLangAttrib->GetAttr()).GetLanguage());
- pTextEngine->RemoveAttrib(0, *pLangAttrib);
- pTextEngine->SetAttrib( aNewLangAttrib, 0, (USHORT)(m_nErrorEnd + nDiffLen) , nTextLen );
- }
- }
- // undo expanded attributes!
- if( pBackAttrib && pBackAttrib->GetStart() < m_nErrorStart && pBackAttrib->GetEnd() == m_nErrorEnd + nDiffLen)
- {
- TextAttrib* pNewBackground = pBackAttrib->GetAttr().Clone();
- USHORT nStart = pBackAttrib->GetStart();
- pTextEngine->RemoveAttrib(0, *pBackAttrib);
- pTextEngine->SetAttrib(*pNewBackground, 0, nStart, m_nErrorStart);
- delete pNewBackground;
- }
- pTextEngine->SetModified(TRUE);
-
- //adjust end position
- long nEndTemp = m_nErrorEnd;
- nEndTemp += nDiffLen;
- m_nErrorEnd = (USHORT)nEndTemp;
-
- SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
- SPELLUNDO_MOVE_ERROREND, GetSpellDialog()->aDialogUndoLink);
- pAction->SetOffset(nDiffLen);
- AddUndoAction(pAction);
- if(pSpellErrorDescription)
- SetAttrib( SpellErrorAttrib(*pSpellErrorDescription), 0, m_nErrorStart, m_nErrorEnd );
- SetAttrib( SpellLanguageAttrib(eLanguage), 0, m_nErrorStart, m_nErrorEnd );
- pTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
-}
-/* -----------------08.10.2003 13:18-----------------
-
- --------------------------------------------------*/
-String SentenceEditWindow_Impl::GetErrorText() const
-{
- return GetTextEngine()->GetText(TextSelection(TextPaM(0, m_nErrorStart), TextPaM(0, m_nErrorEnd) ));
-}
-/*-- 26.06.2008 10:54:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-const SpellErrorDescription* SentenceEditWindow_Impl::GetAlternatives()
-{
- TextPaM aCursor(0, m_nErrorStart);
- const SpellErrorAttrib* pAttrib = static_cast<const SpellErrorAttrib*>(
- GetTextEngine()->FindAttrib( aCursor, TEXTATTR_SPELL_ERROR));
- return pAttrib ? &pAttrib->GetErrorDescription() : 0;
-}
-/*-- 06.09.2004 10:50:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::RestoreCurrentError()
-{
- TextPaM aCursor(0, m_nErrorStart);
- const SpellErrorAttrib* pAttrib = static_cast<const SpellErrorAttrib*>(
- GetTextEngine()->FindAttrib( aCursor, TEXTATTR_SPELL_ERROR));
- if( pAttrib )
- {
- const SpellErrorDescription& rDesc = pAttrib->GetErrorDescription();
- if( !rDesc.sErrorText.equals( GetErrorText() ) )
- ChangeMarkedWord(rDesc.sErrorText, SvxLocaleToLanguage( rDesc.aLocale ));
- }
-}
-/*-- 28.10.2003 14:44:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::SetAlternatives( Reference< XSpellAlternatives> xAlt )
-{
- TextPaM aCursor(0, m_nErrorStart);
- DBG_ASSERT(static_cast<const SpellErrorAttrib*>(
- GetTextEngine()->FindAttrib( aCursor, TEXTATTR_SPELL_ERROR)), "no error set?");
-
- ::rtl::OUString aWord;
- lang::Locale aLocale;
- uno::Sequence< ::rtl::OUString > aAlts;
- ::rtl::OUString sServiceName;
- if (xAlt.is())
- {
- aWord = xAlt->getWord();
- aLocale = xAlt->getLocale();
- aAlts = xAlt->getAlternatives();
- uno::Reference< container::XNamed > xNamed( xAlt, uno::UNO_QUERY );
- if (xNamed.is())
- sServiceName = xNamed->getName();
- }
- SpellErrorDescription aDesc( false, aWord, aLocale, aAlts, 0, sServiceName);
- GetTextEngine()->SetAttrib( SpellErrorAttrib(aDesc), 0, m_nErrorStart, m_nErrorEnd );
-}
-
-/*-- 10.09.2003 14:43:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd )
-{
- GetTextEngine()->SetAttrib(rAttr, nPara, nStart, nEnd);
-}
-/*-- 10.09.2003 14:43:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::SetText( const String& rStr )
-{
- m_nErrorStart = m_nErrorEnd = 0;
- GetTextEngine()->SetText(rStr);
-// InitScrollBars();
-}
-/*-- 08.10.2003 14:35:52---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-struct LanguagePosition_Impl
-{
- USHORT nPosition;
- LanguageType eLanguage;
-
- LanguagePosition_Impl(USHORT nPos, LanguageType eLang) :
- nPosition(nPos),
- eLanguage(eLang)
- {}
-};
-typedef std::vector<LanguagePosition_Impl> LanguagePositions_Impl;
-
-void lcl_InsertBreakPosition_Impl(
- LanguagePositions_Impl& rBreakPositions, USHORT nInsert, LanguageType eLanguage)
-{
- LanguagePositions_Impl::iterator aStart = rBreakPositions.begin();
- while(aStart != rBreakPositions.end())
- {
- if(aStart->nPosition == nInsert)
- {
- //the language of following starts has to overwrite
- //the one of previous ends
- aStart->eLanguage = eLanguage;
- return;
- }
- else if(aStart->nPosition > nInsert)
- {
-
- rBreakPositions.insert(aStart, LanguagePosition_Impl(nInsert, eLanguage));
- return;
- }
- else
- ++aStart;
- }
- rBreakPositions.push_back(LanguagePosition_Impl(nInsert, eLanguage));
-}
-/*-- 17.09.2003 14:26:59---------------------------------------------------
- Returns the text in spell portions. Each portion contains text with an
- equal language and attribute. The spell alternatives are empty.
- -----------------------------------------------------------------------*/
-svx::SpellPortions SentenceEditWindow_Impl::CreateSpellPortions( bool bSetIgnoreFlag ) const
-{
- svx::SpellPortions aRet;
- ExtTextEngine* pTextEngine = GetTextEngine();
- const USHORT nTextLen = pTextEngine->GetTextLen(0);
- if(nTextLen)
- {
- TextPaM aCursor(0, 0);
- LanguagePositions_Impl aBreakPositions;
- const TextCharAttrib* pLastLang = 0;
- const TextCharAttrib* pLastError = 0;
- LanguageType eLang = LANGUAGE_DONTKNOW;
- const TextCharAttrib* pError = 0;
- while(aCursor.GetIndex() < nTextLen)
- {
- const TextCharAttrib* pLang = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_LANGUAGE);
- if(pLang && pLang != pLastLang)
- {
- eLang = static_cast<const SpellLanguageAttrib&>(pLang->GetAttr()).GetLanguage();
- lcl_InsertBreakPosition_Impl(aBreakPositions, pLang->GetStart(), eLang);
- lcl_InsertBreakPosition_Impl(aBreakPositions, pLang->GetEnd(), eLang);
- pLastLang = pLang;
- }
- pError = pTextEngine->FindCharAttrib( aCursor, TEXTATTR_SPELL_ERROR);
- if(pError && pLastError != pError)
- {
- lcl_InsertBreakPosition_Impl(aBreakPositions, pError->GetStart(), eLang);
- lcl_InsertBreakPosition_Impl(aBreakPositions, pError->GetEnd(), eLang);
- pLastError = pError;
-
- }
- aCursor.GetIndex()++;
- }
- //
- if(nTextLen && aBreakPositions.empty())
- {
- //if all content has been overwritten the attributes may have been removed, too
- svx::SpellPortion aPortion1;
- aPortion1.eLanguage = GetSpellDialog()->GetSelectedLang_Impl();
- aPortion1.sText = pTextEngine->GetText(
- TextSelection(TextPaM(0, 0), TextPaM(0, nTextLen)));
-
- aRet.push_back(aPortion1);
-
- }
- else if(!aBreakPositions.empty())
- {
- LanguagePositions_Impl::iterator aStart = aBreakPositions.begin();
- //start should always be Null
- eLang = aStart->eLanguage;
- USHORT nStart = aStart->nPosition;
- DBG_ASSERT(!nStart, "invalid start position - language attribute missing?");
- ++aStart;
-
- while(aStart != aBreakPositions.end())
- {
- svx::SpellPortion aPortion1;
- aPortion1.eLanguage = eLang;
- aPortion1.sText = pTextEngine->GetText(
- TextSelection(TextPaM(0, nStart), TextPaM(0, aStart->nPosition)));
- if( bSetIgnoreFlag && m_nErrorStart == nStart )
- {
- aPortion1.bIgnoreThisError = true;
- }
- aRet.push_back(aPortion1);
- nStart = aStart->nPosition;
- eLang = aStart->eLanguage;
- ++aStart;
- }
- }
-
- // quick partly fix of #i71318. Correct fix needs to patch the TextEngine itself...
- // this one will only prevent text from disappearing. It may to not have the
- // correct language and will probably not spell checked...
- ULONG nPara = pTextEngine->GetParagraphCount();
- if (nPara > 1)
- {
- String aLeftOverText;
- for (ULONG i = 1; i < nPara; ++i)
- {
- aLeftOverText.AppendAscii( "\x0a" ); // the manual line break...
- aLeftOverText += pTextEngine->GetText(i);
- }
- if (pError)
- { // we need to add a new portion containing the left-over text
- svx::SpellPortion aPortion2;
- aPortion2.eLanguage = eLang;
- aPortion2.sText = aLeftOverText;
- aRet.push_back( aPortion2 );
- }
- else
- { // we just need to append the left-over text to the last portion (which had no errors)
- aRet[ aRet.size() - 1 ].sText += aLeftOverText;
- }
- }
- }
- return aRet;
-}
-
-/*-- 06.11.2003 11:30:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::Undo()
-{
- SfxUndoManager& rUndoMgr = GetTextEngine()->GetUndoManager();
- DBG_ASSERT(GetUndoActionCount(), "no undo actions available" );
- if(!GetUndoActionCount())
- return;
- bool bSaveUndoEdit = IsUndoEditMode();
- USHORT nId;
- //if the undo edit mode is active then undo all changes until the UNDO_EDIT_MODE action has been found
- do
- {
- nId = rUndoMgr.GetUndoActionId();
- rUndoMgr.Undo();
- }while(bSaveUndoEdit && SPELLUNDO_UNDO_EDIT_MODE != nId && GetUndoActionCount());
-
- if(bSaveUndoEdit || SPELLUNDO_CHANGE_GROUP == nId)
- GetSpellDialog()->UpdateBoxes_Impl();
-}
-/*-- 06.11.2003 11:30:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::ResetUndo()
-{
- GetTextEngine()->ResetUndo();
-}
-/*-- 06.11.2003 12:30:41---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg )
-{
- SfxUndoManager& rUndoMgr = GetTextEngine()->GetUndoManager();
- rUndoMgr.AddUndoAction(pAction, bTryMerg);
- GetSpellDialog()->aUndoPB.Enable();
-}
-/*-- 06.11.2003 12:38:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT SentenceEditWindow_Impl::GetUndoActionCount()
-{
- return GetTextEngine()->GetUndoManager().GetUndoActionCount();
-}
-
-/*-- 12.11.2003 12:12:38---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::UndoActionStart( USHORT nId )
-{
- GetTextEngine()->UndoActionStart(nId);
-}
-/*-- 12.11.2003 12:12:38---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::UndoActionEnd( USHORT nId )
-{
- GetTextEngine()->UndoActionEnd(nId);
-}
-/*-- 12.11.2003 12:12:38---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::MoveErrorEnd(long nOffset)
-{
- if(nOffset > 0)
- m_nErrorEnd = m_nErrorEnd - (USHORT)nOffset;
- else
- m_nErrorEnd = m_nErrorEnd -(USHORT)- nOffset;
-}
-/*-- 13.11.2003 15:15:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::SetUndoEditMode(bool bSet)
-{
- DBG_ASSERT(!bSet || m_bIsUndoEditMode != bSet, "SetUndoEditMode with equal values?");
- m_bIsUndoEditMode = bSet;
- //disable all buttons except the Change
- SpellDialog* pSpellDialog = GetSpellDialog();
- Control* aControls[] =
- {
- &pSpellDialog->aChangeAllPB,
- &pSpellDialog->aExplainPB,
- &pSpellDialog->aIgnoreAllPB,
- &pSpellDialog->aIgnoreRulePB,
- &pSpellDialog->aIgnorePB,
- &pSpellDialog->aSuggestionLB,
- &pSpellDialog->aSuggestionFT,
- &pSpellDialog->aLanguageFT,
- &pSpellDialog->aLanguageLB,
- &pSpellDialog->aAddToDictMB,
- &pSpellDialog->aAutoCorrPB,
- 0
- };
- sal_Int32 nIdx = 0;
- do
- {
- aControls[nIdx]->Enable(sal_False);
- }
- while(aControls[++nIdx]);
-
- //remove error marks
- TextEngine* pTextEngine = GetTextEngine();
- pTextEngine->RemoveAttribs( 0, (USHORT)TEXTATTR_FONTCOLOR, TRUE );
- pTextEngine->RemoveAttribs( 0, (USHORT)TEXTATTR_FONTWEIGHT, TRUE );
-
- //put the appropriate action on the Undo-stack
- SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
- SPELLUNDO_UNDO_EDIT_MODE, GetSpellDialog()->aDialogUndoLink);
- AddUndoAction(pAction);
- pSpellDialog->aChangePB.Enable();
-}
-
-/*-- 30.06.2008 14:15:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-ExplainButton::~ExplainButton()
-{
-}
-/*-- 30.06.2008 14:15:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void ExplainButton::RequestHelp( const HelpEvent& )
-{
- Help::ShowBalloon( this, GetPosPixel(), m_sExplanation );
-}
-
-void ExplainButton::Click()
-{
- RequestHelp( HelpEvent() );
-}
diff --git a/svx/source/cui/SpellDialog.hrc b/svx/source/cui/SpellDialog.hrc
deleted file mode 100644
index b4be954bf3..0000000000
--- a/svx/source/cui/SpellDialog.hrc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpellDialog.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define FT_SUGGESTION 31
-#define LB_SUGGESTION 32
-#define FT_NOTINDICT 33
-#define ED_NEWWORD 34
-#define FT_LANGUAGE 35
-#define LB_LANGUAGE 36
-#define PB_IGNORE 37
-#define PB_IGNOREALL 38
-#define MB_ADDTODICT 39
-#define PB_CHANGE 40
-#define PB_CHANGEALL 41
-#define PB_AUTOCORR 42
-#define GB_BACKGROUND 43
-#define PB_OPTIONS 44
-#define PB_HELP 45
-#define PB_UNDO 46
-#define PB_CLOSE 47
-#define ST_NOSUGGESTIONS 48
-#define ST_RESUME 50
-#define ST_SPELLING 51
-#define ST_SPELLING_AND_GRAMMAR 52
-#define ST_SPELLING_AND_GRAMMAR_VENDORNAME 53
-#define CB_CHECK_GRAMMAR 54
-#define PB_EXPLAIN 55
-#define IMG_VENDOR 56
-#define IMG_DEFAULT_VENDOR 57
-#define IMG_DEFAULT_VENDOR_HC 58
-#define PB_IGNORERULE 59
diff --git a/svx/source/cui/SpellDialog.src b/svx/source/cui/SpellDialog.src
deleted file mode 100644
index 9b899f77b1..0000000000
--- a/svx/source/cui/SpellDialog.src
+++ /dev/null
@@ -1,245 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpellDialog.src,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "SpellDialog.hrc"
- // pragma ----------------------------------------------------------------
-
-// RID_SVXDLG_SPELLCHECK -------------------------------------------------
-
-#define STD_MASKCOLOR Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }
-
-ModelessDialog RID_SVXDLG_SPELLCHECK
-{
- HelpId = HID_SPELLCHECK ;
- Size = MAP_APPFONT( 270, 188 );
- OutputSize = TRUE;
- Closeable = TRUE ;
- SVLook = TRUE;
- Hide = TRUE;
- Text [ en-US ] = "Spellcheck: " ;
-
- Moveable = TRUE ;
-
- FixedImage IMG_VENDOR
- {
- Pos = MAP_APPFONT ( 0, 0 ) ;
- Size = MAP_APPFONT ( 270, 21 ) ;
- Hide = TRUE;
- };
-
- FixedText FT_LANGUAGE
- {
- Pos = MAP_APPFONT( 6, 8 );
- Size = MAP_APPFONT( 100, 8 );
- Text [ en-US ] = "Text languag~e" ;
- };
- ListBox LB_LANGUAGE
- {
- Pos = MAP_APPFONT( 110, 6 );
- Size = MAP_APPFONT( 93, 55 );
- Border = TRUE;
- Sort = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_NOTINDICT
- {
- Pos = MAP_APPFONT( 6, 26 );
- Size = MAP_APPFONT( 120, 8 );
- Text [ en-US ] = "~Not in dictionary" ;
- };
-
- MultiLineEdit ED_NEWWORD
- {
- Pos = MAP_APPFONT( 6, 37 );
- Size = MAP_APPFONT( 197, 48 );
- Border = TRUE;
- VScroll = TRUE;
- IgnoreTab = TRUE;
- };
-
- FixedText FT_SUGGESTION
- {
- Pos = MAP_APPFONT( 6, 88 );
- Size = MAP_APPFONT( 120, 8 );
- Text [ en-US ] = "~Suggestions" ;
- };
- ListBox LB_SUGGESTION
- {
- Pos = MAP_APPFONT( 6, 99 );
- Size = MAP_APPFONT( 197, 48 );
- Border = TRUE;
- };
-
- CheckBox CB_CHECK_GRAMMAR
- {
- Pos = MAP_APPFONT( 6, 153 );
- Size = MAP_APPFONT( 100, 10 );
- Text [ en-US ] = "Check ~grammar" ;
- Hide = TRUE;
- };
-
- PushButton PB_IGNORE
- {
- Pos = MAP_APPFONT( 209, 37 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "~Ignore Once" ;
- };
-
- PushButton PB_IGNOREALL
- {
- Pos = MAP_APPFONT( 209, 54 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "I~gnore All" ;
- };
- PushButton PB_IGNORERULE
- {
- Pos = MAP_APPFONT( 209, 54 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "I~gnore Rule" ;
- Hide = TRUE;
- };
- MenuButton MB_ADDTODICT
- {
- Pos = MAP_APPFONT( 209, 71 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "~Add" ;
- };
-
- PushButton PB_CHANGE
- {
- Pos = MAP_APPFONT( 209, 99 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "~Change" ;
- DefButton = TRUE ;
- };
-
- PushButton PB_CHANGEALL
- {
- Pos = MAP_APPFONT( 209, 117 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "Change A~ll" ;
- };
- PushButton PB_EXPLAIN
- {
- Pos = MAP_APPFONT( 209, 117 );
- Size = MAP_APPFONT( 55, 14 );
- Hide = TRUE;
- Text [ en-US ] = "~Explain..." ;
- };
- PushButton PB_AUTOCORR
- {
- Pos = MAP_APPFONT( 209, 134 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "AutoCor~rect" ;
- };
- GroupBox GB_BACKGROUND
- {
- Pos = MAP_APPFONT( 1, 21 );
- Size = MAP_APPFONT( 268, 146 );
- Hide=TRUE;
- };
-
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT( 6, 170 );
- Size = MAP_APPFONT( 55, 14 );
- };
- PushButton PB_OPTIONS
- {
- Pos = MAP_APPFONT( 87, 170 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "O~ptions..." ;
- };
- PushButton PB_UNDO
- {
- Pos = MAP_APPFONT( 148, 170 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "~Undo" ;
- };
-
- PushButton PB_CLOSE
- {
- Pos = MAP_APPFONT ( 209 , 170 ) ;
- Size = MAP_APPFONT ( 55 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Cl~ose" ;
- };
- String ST_RESUME
- {
- Text[ en-US ] = "Resu~me";
- };
- String ST_NOSUGGESTIONS
- {
- Text [en-US] = "(no suggestions)";
- };
- String ST_SPELLING
- {
- Text[ en-US ] = "Spelling: $LANGUAGE ($LOCATION)";
- };
- String ST_SPELLING_AND_GRAMMAR
- {
- Text[ en-US ] = "Spelling and Grammar: $LANGUAGE ($LOCATION)";
- };
- String ST_SPELLING_AND_GRAMMAR_VENDORNAME
- {
- Text[ en-US ] = "Spelling and Grammar: $LANGUAGE ($LOCATION) [$VendorName]";
- };
- Image IMG_DEFAULT_VENDOR
- {
- ImageBitmap = Bitmap { File = "vendor01.png"; };
- };
- Image IMG_DEFAULT_VENDOR_HC
- {
- ImageBitmap = Bitmap { File = "vendor01h.png"; };
- };
-
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/acccfg.cxx b/svx/source/cui/acccfg.cxx
deleted file mode 100644
index 43e0bb5bae..0000000000
--- a/svx/source/cui/acccfg.cxx
+++ /dev/null
@@ -1,1700 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: acccfg.cxx,v $
- * $Revision: 1.40 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-//-----------------------------------------------
-// include own files
-
-#include "acccfg.hxx"
-#include "cfgutil.hxx"
-#include <svx/dialmgr.hxx>
-
-#include <sfx2/msg.hxx>
-#include <sfx2/macrconf.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <sfx2/minfitem.hxx>
-#include <svtools/stritem.hxx>
-
-#include "svx/dialogs.hrc"
-#include "acccfg.hrc"
-
-//-----------------------------------------------
-// include interface declarations
-#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/form/XReset.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-
-#ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGERSUPLLIER_HPP_
-#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
-#endif
-#include <com/sun/star/ui/XUIConfigurationManager.hpp>
-#include <com/sun/star/awt/KeyModifier.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-
-//-----------------------------------------------
-// include other projects
-#include <unotools/processfactory.hxx>
-#include <svtools/acceleratorexecute.hxx>
-#include <comphelper/processfactory.hxx>
-#include <svtools/svlbitm.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/help.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <comphelper/sequenceashashmap.hxx>
-
-//-----------------------------------------------
-// namespaces
-
-#ifdef css
- #error "ambigous praeprozessor directive for css ..."
-#else
- namespace css = ::com::sun::star;
-#endif
-
-using namespace com::sun::star;
-
-//-----------------------------------------------
-// definitions
-
-//-----------------------------------------------
-static ::rtl::OUString SERVICE_STORAGEFACTORY = ::rtl::OUString::createFromAscii("com.sun.star.embed.StorageFactory" );
-static ::rtl::OUString SERVICE_UICONFIGMGR = ::rtl::OUString::createFromAscii("com.sun.star.ui.UIConfigurationManager" );
-static ::rtl::OUString SERVICE_DESKTOP = ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop" );
-static ::rtl::OUString SERVICE_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager" );
-static ::rtl::OUString SERVICE_GLOBALACCCFG = ::rtl::OUString::createFromAscii("com.sun.star.ui.GlobalAcceleratorConfiguration" );
-static ::rtl::OUString SERVICE_MODULEUICONFIGSUPPLIER = ::rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier");
-static ::rtl::OUString SERVICE_UICMDDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription" );
-
-static ::rtl::OUString MODULEPROP_SHORTNAME = ::rtl::OUString::createFromAscii("ooSetupFactoryShortName" );
-static ::rtl::OUString MODULEPROP_UINAME = ::rtl::OUString::createFromAscii("ooSetupFactoryUIName" );
-static ::rtl::OUString CMDPROP_UINAME = ::rtl::OUString::createFromAscii("Name" );
-
-static ::rtl::OUString FOLDERNAME_UICONFIG = ::rtl::OUString::createFromAscii("Configurations2" );
-
-static ::rtl::OUString MEDIATYPE_PROPNAME = ::rtl::OUString::createFromAscii("MediaType" );
-static ::rtl::OUString MEDIATYPE_UICONFIG = ::rtl::OUString::createFromAscii("application/vnd.sun.xml.ui.configuration" );
-
-//-----------------------------------------------
-static USHORT __FAR_DATA KEYCODE_ARRAY[] =
-{
- KEY_F1 ,
- KEY_F2 ,
- KEY_F3 ,
- KEY_F4 ,
- KEY_F5 ,
- KEY_F6 ,
- KEY_F7 ,
- KEY_F8 ,
- KEY_F9 ,
- KEY_F10 ,
- KEY_F11 ,
- KEY_F12 ,
-
- KEY_DOWN ,
- KEY_UP ,
- KEY_LEFT ,
- KEY_RIGHT ,
- KEY_HOME ,
- KEY_END ,
- KEY_PAGEUP ,
- KEY_PAGEDOWN ,
- KEY_RETURN ,
- KEY_ESCAPE ,
- KEY_BACKSPACE,
- KEY_INSERT ,
- KEY_DELETE ,
-
- KEY_OPEN ,
- KEY_CUT ,
- KEY_COPY ,
- KEY_PASTE ,
- KEY_UNDO ,
- KEY_REPEAT ,
- KEY_FIND ,
- KEY_PROPERTIES ,
- KEY_FRONT ,
- KEY_CONTEXTMENU ,
- KEY_MENU ,
- KEY_HELP ,
-
- KEY_F1 | KEY_SHIFT,
- KEY_F2 | KEY_SHIFT,
- KEY_F3 | KEY_SHIFT,
- KEY_F4 | KEY_SHIFT,
- KEY_F5 | KEY_SHIFT,
- KEY_F6 | KEY_SHIFT,
- KEY_F7 | KEY_SHIFT,
- KEY_F8 | KEY_SHIFT,
- KEY_F9 | KEY_SHIFT,
- KEY_F10 | KEY_SHIFT,
- KEY_F11 | KEY_SHIFT,
- KEY_F12 | KEY_SHIFT,
-
- KEY_DOWN | KEY_SHIFT,
- KEY_UP | KEY_SHIFT,
- KEY_LEFT | KEY_SHIFT,
- KEY_RIGHT | KEY_SHIFT,
- KEY_HOME | KEY_SHIFT,
- KEY_END | KEY_SHIFT,
- KEY_PAGEUP | KEY_SHIFT,
- KEY_PAGEDOWN | KEY_SHIFT,
- KEY_RETURN | KEY_SHIFT,
- KEY_SPACE | KEY_SHIFT,
- KEY_ESCAPE | KEY_SHIFT,
- KEY_BACKSPACE | KEY_SHIFT,
- KEY_INSERT | KEY_SHIFT,
- KEY_DELETE | KEY_SHIFT,
-
- KEY_0 | KEY_MOD1 ,
- KEY_1 | KEY_MOD1 ,
- KEY_2 | KEY_MOD1 ,
- KEY_3 | KEY_MOD1 ,
- KEY_4 | KEY_MOD1 ,
- KEY_5 | KEY_MOD1 ,
- KEY_6 | KEY_MOD1 ,
- KEY_7 | KEY_MOD1 ,
- KEY_8 | KEY_MOD1 ,
- KEY_9 | KEY_MOD1 ,
- KEY_A | KEY_MOD1 ,
- KEY_B | KEY_MOD1 ,
- KEY_C | KEY_MOD1 ,
- KEY_D | KEY_MOD1 ,
- KEY_E | KEY_MOD1 ,
- KEY_F | KEY_MOD1 ,
- KEY_G | KEY_MOD1 ,
- KEY_H | KEY_MOD1 ,
- KEY_I | KEY_MOD1 ,
- KEY_J | KEY_MOD1 ,
- KEY_K | KEY_MOD1 ,
- KEY_L | KEY_MOD1 ,
- KEY_M | KEY_MOD1 ,
- KEY_N | KEY_MOD1 ,
- KEY_O | KEY_MOD1 ,
- KEY_P | KEY_MOD1 ,
- KEY_Q | KEY_MOD1 ,
- KEY_R | KEY_MOD1 ,
- KEY_S | KEY_MOD1 ,
- KEY_T | KEY_MOD1 ,
- KEY_U | KEY_MOD1 ,
- KEY_V | KEY_MOD1 ,
- KEY_W | KEY_MOD1 ,
- KEY_X | KEY_MOD1 ,
- KEY_Y | KEY_MOD1 ,
- KEY_Z | KEY_MOD1 ,
-
- KEY_F1 | KEY_MOD1 ,
- KEY_F2 | KEY_MOD1 ,
- KEY_F3 | KEY_MOD1 ,
- KEY_F4 | KEY_MOD1 ,
- KEY_F5 | KEY_MOD1 ,
- KEY_F6 | KEY_MOD1 ,
- KEY_F7 | KEY_MOD1 ,
- KEY_F8 | KEY_MOD1 ,
- KEY_F9 | KEY_MOD1 ,
- KEY_F10 | KEY_MOD1 ,
- KEY_F11 | KEY_MOD1 ,
- KEY_F12 | KEY_MOD1 ,
-
- KEY_DOWN | KEY_MOD1 ,
- KEY_UP | KEY_MOD1 ,
- KEY_LEFT | KEY_MOD1 ,
- KEY_RIGHT | KEY_MOD1 ,
- KEY_HOME | KEY_MOD1 ,
- KEY_END | KEY_MOD1 ,
- KEY_PAGEUP | KEY_MOD1 ,
- KEY_PAGEDOWN | KEY_MOD1 ,
- KEY_RETURN | KEY_MOD1 ,
- KEY_SPACE | KEY_MOD1 ,
- KEY_BACKSPACE | KEY_MOD1 ,
- KEY_INSERT | KEY_MOD1 ,
- KEY_DELETE | KEY_MOD1 ,
-
- KEY_ADD | KEY_MOD1 ,
- KEY_SUBTRACT | KEY_MOD1 ,
- KEY_MULTIPLY | KEY_MOD1 ,
- KEY_DIVIDE | KEY_MOD1 ,
-
- KEY_0 | KEY_SHIFT | KEY_MOD1,
- KEY_1 | KEY_SHIFT | KEY_MOD1,
- KEY_2 | KEY_SHIFT | KEY_MOD1,
- KEY_3 | KEY_SHIFT | KEY_MOD1,
- KEY_4 | KEY_SHIFT | KEY_MOD1,
- KEY_5 | KEY_SHIFT | KEY_MOD1,
- KEY_6 | KEY_SHIFT | KEY_MOD1,
- KEY_7 | KEY_SHIFT | KEY_MOD1,
- KEY_8 | KEY_SHIFT | KEY_MOD1,
- KEY_9 | KEY_SHIFT | KEY_MOD1,
- KEY_A | KEY_SHIFT | KEY_MOD1,
- KEY_B | KEY_SHIFT | KEY_MOD1,
- KEY_C | KEY_SHIFT | KEY_MOD1,
- KEY_D | KEY_SHIFT | KEY_MOD1,
- KEY_E | KEY_SHIFT | KEY_MOD1,
- KEY_F | KEY_SHIFT | KEY_MOD1,
- KEY_G | KEY_SHIFT | KEY_MOD1,
- KEY_H | KEY_SHIFT | KEY_MOD1,
- KEY_I | KEY_SHIFT | KEY_MOD1,
- KEY_J | KEY_SHIFT | KEY_MOD1,
- KEY_K | KEY_SHIFT | KEY_MOD1,
- KEY_L | KEY_SHIFT | KEY_MOD1,
- KEY_M | KEY_SHIFT | KEY_MOD1,
- KEY_N | KEY_SHIFT | KEY_MOD1,
- KEY_O | KEY_SHIFT | KEY_MOD1,
- KEY_P | KEY_SHIFT | KEY_MOD1,
- KEY_Q | KEY_SHIFT | KEY_MOD1,
- KEY_R | KEY_SHIFT | KEY_MOD1,
- KEY_S | KEY_SHIFT | KEY_MOD1,
- KEY_T | KEY_SHIFT | KEY_MOD1,
- KEY_U | KEY_SHIFT | KEY_MOD1,
- KEY_V | KEY_SHIFT | KEY_MOD1,
- KEY_W | KEY_SHIFT | KEY_MOD1,
- KEY_X | KEY_SHIFT | KEY_MOD1,
- KEY_Y | KEY_SHIFT | KEY_MOD1,
- KEY_Z | KEY_SHIFT | KEY_MOD1,
-
- KEY_F1 | KEY_SHIFT | KEY_MOD1,
- KEY_F2 | KEY_SHIFT | KEY_MOD1,
- KEY_F3 | KEY_SHIFT | KEY_MOD1,
- KEY_F4 | KEY_SHIFT | KEY_MOD1,
- KEY_F5 | KEY_SHIFT | KEY_MOD1,
- KEY_F6 | KEY_SHIFT | KEY_MOD1,
- KEY_F7 | KEY_SHIFT | KEY_MOD1,
- KEY_F8 | KEY_SHIFT | KEY_MOD1,
- KEY_F9 | KEY_SHIFT | KEY_MOD1,
- KEY_F10 | KEY_SHIFT | KEY_MOD1,
- KEY_F11 | KEY_SHIFT | KEY_MOD1,
- KEY_F12 | KEY_SHIFT | KEY_MOD1,
-
- KEY_DOWN | KEY_SHIFT | KEY_MOD1,
- KEY_UP | KEY_SHIFT | KEY_MOD1,
- KEY_LEFT | KEY_SHIFT | KEY_MOD1,
- KEY_RIGHT | KEY_SHIFT | KEY_MOD1,
- KEY_HOME | KEY_SHIFT | KEY_MOD1,
- KEY_END | KEY_SHIFT | KEY_MOD1,
- KEY_PAGEUP | KEY_SHIFT | KEY_MOD1,
- KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD1,
- KEY_RETURN | KEY_SHIFT | KEY_MOD1,
- KEY_SPACE | KEY_SHIFT | KEY_MOD1,
- KEY_BACKSPACE | KEY_SHIFT | KEY_MOD1,
- KEY_INSERT | KEY_SHIFT | KEY_MOD1,
- KEY_DELETE | KEY_SHIFT | KEY_MOD1,
-
- KEY_0 | KEY_MOD2 ,
- KEY_1 | KEY_MOD2 ,
- KEY_2 | KEY_MOD2 ,
- KEY_3 | KEY_MOD2 ,
- KEY_4 | KEY_MOD2 ,
- KEY_5 | KEY_MOD2 ,
- KEY_6 | KEY_MOD2 ,
- KEY_7 | KEY_MOD2 ,
- KEY_8 | KEY_MOD2 ,
- KEY_9 | KEY_MOD2 ,
- KEY_A | KEY_MOD2 ,
- KEY_B | KEY_MOD2 ,
- KEY_C | KEY_MOD2 ,
- KEY_D | KEY_MOD2 ,
- KEY_E | KEY_MOD2 ,
- KEY_F | KEY_MOD2 ,
- KEY_G | KEY_MOD2 ,
- KEY_H | KEY_MOD2 ,
- KEY_I | KEY_MOD2 ,
- KEY_J | KEY_MOD2 ,
- KEY_K | KEY_MOD2 ,
- KEY_L | KEY_MOD2 ,
- KEY_M | KEY_MOD2 ,
- KEY_N | KEY_MOD2 ,
- KEY_O | KEY_MOD2 ,
- KEY_P | KEY_MOD2 ,
- KEY_Q | KEY_MOD2 ,
- KEY_R | KEY_MOD2 ,
- KEY_S | KEY_MOD2 ,
- KEY_T | KEY_MOD2 ,
- KEY_U | KEY_MOD2 ,
- KEY_V | KEY_MOD2 ,
- KEY_W | KEY_MOD2 ,
- KEY_X | KEY_MOD2 ,
- KEY_Y | KEY_MOD2 ,
- KEY_Z | KEY_MOD2 ,
-
- KEY_F1 | KEY_MOD2 ,
- KEY_F2 | KEY_MOD2 ,
- KEY_F3 | KEY_MOD2 ,
- KEY_F4 | KEY_MOD2 ,
- KEY_F5 | KEY_MOD2 ,
- KEY_F6 | KEY_MOD2 ,
- KEY_F7 | KEY_MOD2 ,
- KEY_F8 | KEY_MOD2 ,
- KEY_F9 | KEY_MOD2 ,
- KEY_F10 | KEY_MOD2 ,
- KEY_F11 | KEY_MOD2 ,
- KEY_F12 | KEY_MOD2 ,
-
- KEY_DOWN | KEY_MOD2 ,
- KEY_UP | KEY_MOD2 ,
- KEY_LEFT | KEY_MOD2 ,
- KEY_RIGHT | KEY_MOD2 ,
- KEY_HOME | KEY_MOD2 ,
- KEY_END | KEY_MOD2 ,
- KEY_PAGEUP | KEY_MOD2 ,
- KEY_PAGEDOWN | KEY_MOD2 ,
- KEY_RETURN | KEY_MOD2 ,
- KEY_SPACE | KEY_MOD2 ,
- KEY_BACKSPACE | KEY_MOD2 ,
- KEY_INSERT | KEY_MOD2 ,
- KEY_DELETE | KEY_MOD2 ,
-
- KEY_0 | KEY_SHIFT | KEY_MOD2,
- KEY_1 | KEY_SHIFT | KEY_MOD2,
- KEY_2 | KEY_SHIFT | KEY_MOD2,
- KEY_3 | KEY_SHIFT | KEY_MOD2,
- KEY_4 | KEY_SHIFT | KEY_MOD2,
- KEY_5 | KEY_SHIFT | KEY_MOD2,
- KEY_6 | KEY_SHIFT | KEY_MOD2,
- KEY_7 | KEY_SHIFT | KEY_MOD2,
- KEY_8 | KEY_SHIFT | KEY_MOD2,
- KEY_9 | KEY_SHIFT | KEY_MOD2,
- KEY_A | KEY_SHIFT | KEY_MOD2,
- KEY_B | KEY_SHIFT | KEY_MOD2,
- KEY_C | KEY_SHIFT | KEY_MOD2,
- KEY_D | KEY_SHIFT | KEY_MOD2,
- KEY_E | KEY_SHIFT | KEY_MOD2,
- KEY_F | KEY_SHIFT | KEY_MOD2,
- KEY_G | KEY_SHIFT | KEY_MOD2,
- KEY_H | KEY_SHIFT | KEY_MOD2,
- KEY_I | KEY_SHIFT | KEY_MOD2,
- KEY_J | KEY_SHIFT | KEY_MOD2,
- KEY_K | KEY_SHIFT | KEY_MOD2,
- KEY_L | KEY_SHIFT | KEY_MOD2,
- KEY_M | KEY_SHIFT | KEY_MOD2,
- KEY_N | KEY_SHIFT | KEY_MOD2,
- KEY_O | KEY_SHIFT | KEY_MOD2,
- KEY_P | KEY_SHIFT | KEY_MOD2,
- KEY_Q | KEY_SHIFT | KEY_MOD2,
- KEY_R | KEY_SHIFT | KEY_MOD2,
- KEY_S | KEY_SHIFT | KEY_MOD2,
- KEY_T | KEY_SHIFT | KEY_MOD2,
- KEY_U | KEY_SHIFT | KEY_MOD2,
- KEY_V | KEY_SHIFT | KEY_MOD2,
- KEY_W | KEY_SHIFT | KEY_MOD2,
- KEY_X | KEY_SHIFT | KEY_MOD2,
- KEY_Y | KEY_SHIFT | KEY_MOD2,
- KEY_Z | KEY_SHIFT | KEY_MOD2,
-
- KEY_F1 | KEY_SHIFT | KEY_MOD2,
- KEY_F2 | KEY_SHIFT | KEY_MOD2,
- KEY_F3 | KEY_SHIFT | KEY_MOD2,
- KEY_F4 | KEY_SHIFT | KEY_MOD2,
- KEY_F5 | KEY_SHIFT | KEY_MOD2,
- KEY_F6 | KEY_SHIFT | KEY_MOD2,
- KEY_F7 | KEY_SHIFT | KEY_MOD2,
- KEY_F8 | KEY_SHIFT | KEY_MOD2,
- KEY_F9 | KEY_SHIFT | KEY_MOD2,
- KEY_F10 | KEY_SHIFT | KEY_MOD2,
- KEY_F11 | KEY_SHIFT | KEY_MOD2,
- KEY_F12 | KEY_SHIFT | KEY_MOD2,
-
- KEY_DOWN | KEY_SHIFT | KEY_MOD2,
- KEY_UP | KEY_SHIFT | KEY_MOD2,
- KEY_LEFT | KEY_SHIFT | KEY_MOD2,
- KEY_RIGHT | KEY_SHIFT | KEY_MOD2,
- KEY_HOME | KEY_SHIFT | KEY_MOD2,
- KEY_END | KEY_SHIFT | KEY_MOD2,
- KEY_PAGEUP | KEY_SHIFT | KEY_MOD2,
- KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD2,
- KEY_RETURN | KEY_SHIFT | KEY_MOD2,
- KEY_SPACE | KEY_SHIFT | KEY_MOD2,
- KEY_BACKSPACE | KEY_SHIFT | KEY_MOD2,
- KEY_INSERT | KEY_SHIFT | KEY_MOD2,
- KEY_DELETE | KEY_SHIFT | KEY_MOD2,
-
- KEY_0 | KEY_MOD1 | KEY_MOD2 ,
- KEY_1 | KEY_MOD1 | KEY_MOD2 ,
- KEY_2 | KEY_MOD1 | KEY_MOD2 ,
- KEY_3 | KEY_MOD1 | KEY_MOD2 ,
- KEY_4 | KEY_MOD1 | KEY_MOD2 ,
- KEY_5 | KEY_MOD1 | KEY_MOD2 ,
- KEY_6 | KEY_MOD1 | KEY_MOD2 ,
- KEY_7 | KEY_MOD1 | KEY_MOD2 ,
- KEY_8 | KEY_MOD1 | KEY_MOD2 ,
- KEY_9 | KEY_MOD1 | KEY_MOD2 ,
- KEY_A | KEY_MOD1 | KEY_MOD2 ,
- KEY_B | KEY_MOD1 | KEY_MOD2 ,
- KEY_C | KEY_MOD1 | KEY_MOD2 ,
- KEY_D | KEY_MOD1 | KEY_MOD2 ,
- KEY_E | KEY_MOD1 | KEY_MOD2 ,
- KEY_F | KEY_MOD1 | KEY_MOD2 ,
- KEY_G | KEY_MOD1 | KEY_MOD2 ,
- KEY_H | KEY_MOD1 | KEY_MOD2 ,
- KEY_I | KEY_MOD1 | KEY_MOD2 ,
- KEY_J | KEY_MOD1 | KEY_MOD2 ,
- KEY_K | KEY_MOD1 | KEY_MOD2 ,
- KEY_L | KEY_MOD1 | KEY_MOD2 ,
- KEY_M | KEY_MOD1 | KEY_MOD2 ,
- KEY_N | KEY_MOD1 | KEY_MOD2 ,
- KEY_O | KEY_MOD1 | KEY_MOD2 ,
- KEY_P | KEY_MOD1 | KEY_MOD2 ,
- KEY_Q | KEY_MOD1 | KEY_MOD2 ,
- KEY_R | KEY_MOD1 | KEY_MOD2 ,
- KEY_S | KEY_MOD1 | KEY_MOD2 ,
- KEY_T | KEY_MOD1 | KEY_MOD2 ,
- KEY_U | KEY_MOD1 | KEY_MOD2 ,
- KEY_V | KEY_MOD1 | KEY_MOD2 ,
- KEY_W | KEY_MOD1 | KEY_MOD2 ,
- KEY_X | KEY_MOD1 | KEY_MOD2 ,
- KEY_Y | KEY_MOD1 | KEY_MOD2 ,
- KEY_Z | KEY_MOD1 | KEY_MOD2 ,
-
- KEY_F1 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F2 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F3 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F4 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F5 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F6 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F7 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F8 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F9 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F10 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F11 | KEY_MOD1 | KEY_MOD2 ,
- KEY_F12 | KEY_MOD1 | KEY_MOD2 ,
-
- KEY_DOWN | KEY_MOD1 | KEY_MOD2 ,
- KEY_UP | KEY_MOD1 | KEY_MOD2 ,
- KEY_LEFT | KEY_MOD1 | KEY_MOD2 ,
- KEY_RIGHT | KEY_MOD1 | KEY_MOD2 ,
- KEY_HOME | KEY_MOD1 | KEY_MOD2 ,
- KEY_END | KEY_MOD1 | KEY_MOD2 ,
- KEY_PAGEUP | KEY_MOD1 | KEY_MOD2 ,
- KEY_PAGEDOWN | KEY_MOD1 | KEY_MOD2 ,
- KEY_RETURN | KEY_MOD1 | KEY_MOD2 ,
- KEY_SPACE | KEY_MOD1 | KEY_MOD2 ,
- KEY_BACKSPACE | KEY_MOD1 | KEY_MOD2 ,
- KEY_INSERT | KEY_MOD1 | KEY_MOD2 ,
- KEY_DELETE | KEY_MOD1 | KEY_MOD2 ,
-
- KEY_0 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_1 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_2 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_3 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_4 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_5 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_6 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_7 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_8 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_9 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_A | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_B | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_C | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_D | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_E | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_G | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_H | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_I | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_J | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_K | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_L | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_M | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_N | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_O | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_P | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_Q | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_R | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_S | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_T | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_U | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_V | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_W | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_X | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_Y | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_Z | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
-
- KEY_F1 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F2 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F3 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F4 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F5 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F6 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F7 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F8 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F9 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F10 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F11 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_F12 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
-
- KEY_DOWN | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_UP | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_LEFT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_RIGHT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_HOME | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_END | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_PAGEUP | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_RETURN | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_SPACE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_BACKSPACE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_INSERT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
- KEY_DELETE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2
-};
-
-static USHORT KEYCODE_ARRAY_SIZE = (sizeof(KEYCODE_ARRAY) / sizeof(KEYCODE_ARRAY[0]));
-
-//-----------------------------------------------
-// seems to be needed to layout the list box, which shows all
-// assignable shortcuts
-static long AccCfgTabs[] =
-{
- 2, // Number of Tabs
- 0,
- 120 // Function
-};
-
-//-----------------------------------------------
-class SfxAccCfgLBoxString_Impl : public SvLBoxString
-{
- public:
- SfxAccCfgLBoxString_Impl( SvLBoxEntry* pEntry,
- USHORT nFlags,
- const String& sText );
-
- virtual ~SfxAccCfgLBoxString_Impl();
-
- virtual void Paint(const Point& aPos ,
- SvLBox& rDevice,
- USHORT nFlags ,
- SvLBoxEntry* pEntry );
-};
-
-//-----------------------------------------------
-SfxAccCfgLBoxString_Impl::SfxAccCfgLBoxString_Impl( SvLBoxEntry* pEntry,
- USHORT nFlags,
- const String& sText )
- : SvLBoxString(pEntry, nFlags, sText)
-{
-}
-
-//-----------------------------------------------
-SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl()
-{
-}
-
-//-----------------------------------------------
-void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos ,
- SvLBox& rDevice,
- USHORT /*nFlags*/,
- SvLBoxEntry* pEntry )
-{
- /*/ ??? realy needed !!!
- Font aOldFont(rDevice.GetFont());
- Font aNewFont(aOldFont );
- rDevice.SetFont( aFont );
- */
-
- if (!pEntry)
- return;
-
- TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
- if (!pUserData)
- return;
-
- if (pUserData->m_bIsConfigurable)
- rDevice.DrawText(aPos, GetText());
- else
- rDevice.DrawCtrlText(aPos, GetText(), 0, STRING_LEN, TEXT_DRAW_DISABLE);
-
- //rDev.SetFont( aOldFont );
-}
-
-//-----------------------------------------------
-void SfxAccCfgTabListBox_Impl::InitEntry( SvLBoxEntry* pEntry ,
- const XubString& sText ,
- const Image& aImage1,
- const Image& aImage2,
- SvLBoxButtonKind eButtonKind)
-{
- SvTabListBox::InitEntry(pEntry, sText, aImage1, aImage2, eButtonKind);
-}
-
-//-----------------------------------------------
-/** select the entry, which match the current key input ... excepting
- keys, which are used for the dialog itself.
- */
-void SfxAccCfgTabListBox_Impl::KeyInput(const KeyEvent& aKey)
-{
- KeyCode aCode1 = aKey.GetKeyCode();
- USHORT nCode1 = aCode1.GetCode();
- USHORT nMod1 = aCode1.GetModifier();
-
- // is it related to our list box ?
- if (
- (nCode1 != KEY_DOWN ) &&
- (nCode1 != KEY_UP ) &&
- (nCode1 != KEY_LEFT ) &&
- (nCode1 != KEY_RIGHT ) &&
- (nCode1 != KEY_PAGEUP ) &&
- (nCode1 != KEY_PAGEDOWN)
- )
- {
- SvLBoxEntry* pEntry = First();
- while (pEntry)
- {
- TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
- if (pUserData)
- {
- USHORT nCode2 = pUserData->m_aKey.GetCode();
- USHORT nMod2 = pUserData->m_aKey.GetModifier();
- if (
- (nCode1 == nCode2) &&
- (nMod1 == nMod2 )
- )
- {
- Select (pEntry);
- MakeVisible(pEntry);
- return;
- }
- }
- pEntry = Next(pEntry);
- }
- }
-
- // no - handle it as normal dialog input
- SvTabListBox::KeyInput(aKey);
-}
-
-//-----------------------------------------------
-SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxItemSet& aSet )
- : SfxTabPage (pParent, SVX_RES(RID_SVXPAGE_KEYBOARD), aSet)
- , m_pMacroInfoItem ()
- , m_pStringItem ()
- , m_pFontItem ()
- , m_pFileDlg (NULL)
- , aEntriesBox (this , this, SVX_RES(BOX_ACC_ENTRIES ))
- , aKeyboardGroup (this , SVX_RES(GRP_ACC_KEYBOARD ))
- , aOfficeButton (this , SVX_RES(RB_OFFICE ))
- , aModuleButton (this , SVX_RES(RB_MODULE ))
- , aChangeButton (this , SVX_RES(BTN_ACC_CHANGE ))
- , aRemoveButton (this , SVX_RES(BTN_ACC_REMOVE ))
- , aGroupText (this , SVX_RES(TXT_ACC_GROUP ))
- , pGroupLBox(new SfxConfigGroupListBox_Impl( this, SVX_RES(BOX_ACC_GROUP), SFX_SLOT_ACCELCONFIG ))
- , aFunctionText (this , SVX_RES(TXT_ACC_FUNCTION ))
- , pFunctionBox(new SfxConfigFunctionListBox_Impl( this, SVX_RES( BOX_ACC_FUNCTION )))
- , aKeyText (this , SVX_RES(TXT_ACC_KEY ))
- , aKeyBox (this , SVX_RES(BOX_ACC_KEY ))
- , aFunctionsGroup (this , SVX_RES(GRP_ACC_FUNCTIONS ))
- , aLoadButton (this , SVX_RES(BTN_LOAD ))
- , aSaveButton (this , SVX_RES(BTN_SAVE ))
- , aResetButton (this , SVX_RES(BTN_RESET ))
- , aLoadAccelConfigStr ( SVX_RES( STR_LOADACCELCONFIG ) )
- , aSaveAccelConfigStr ( SVX_RES( STR_SAVEACCELCONFIG ) )
- , aFilterAllStr ( SVX_RES( STR_SFX_FILTERNAME_ALL ) )
- , aFilterCfgStr ( SVX_RES( STR_FILTERNAME_CFG ) )
- , m_bStylesInfoInitialized(sal_False)
- , m_xGlobal ()
- , m_xModule ()
- , m_xAct ()
-{
- FreeResource();
-
-// install handler functions
- aChangeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, ChangeHdl ));
- aRemoveButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RemoveHdl ));
- aEntriesBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
- pGroupLBox->SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
- pFunctionBox->SetSelectHdl( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
- aKeyBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
- aLoadButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Load ));
- aSaveButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Save ));
- aResetButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Default ));
- aOfficeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
- aModuleButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
-
- // initialize Entriesbox
- aEntriesBox.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN);
- aEntriesBox.SetSelectionMode(SINGLE_SELECTION);
- aEntriesBox.SetTabs(&AccCfgTabs[0], MAP_APPFONT);
- aEntriesBox.Resize(); // OS: Hack for right selection
- aEntriesBox.SetSpaceBetweenEntries(0);
- aEntriesBox.SetDragDropMode(0);
-
- // detect max keyname width
- long nMaxWidth = 0;
- for ( USHORT i = 0; i < KEYCODE_ARRAY_SIZE; ++i )
- {
- long nTmp = GetTextWidth( KeyCode( KEYCODE_ARRAY[i] ).GetName() );
- if ( nTmp > nMaxWidth )
- nMaxWidth = nTmp;
- }
- // recalc second tab
- long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MAP_APPFONT ).Width();
- nNewTab = nNewTab + 5; // additional space
- aEntriesBox.SetTab( 1, nNewTab );
-
- // initialize GroupBox
- pGroupLBox->SetFunctionListBox(pFunctionBox);
-
- // initialize KeyBox
- aKeyBox.SetWindowBits(WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT);
-}
-
-//-----------------------------------------------
-SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
-{
- // free memory - remove all dynamic user data
- SvLBoxEntry* pEntry = aEntriesBox.First();
- while (pEntry)
- {
- TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
- if (pUserData)
- delete pUserData;
- pEntry = aEntriesBox.Next(pEntry);
- }
-
- pEntry = aKeyBox.First();
- while (pEntry)
- {
- TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
- if (pUserData)
- delete pUserData;
- pEntry = aKeyBox.Next(pEntry);
- }
-
- aEntriesBox.Clear();
- aKeyBox.Clear();
-
- delete m_pFileDlg;
- delete pGroupLBox;
- delete pFunctionBox;
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::InitAccCfg()
-{
- // already initialized ?
- if (m_xSMGR.is())
- return; // yes -> do nothing
-
- try
- {
- // no - initialize this instance
- m_xSMGR = ::utl::getProcessServiceFactory();
-
- m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION), css::uno::UNO_QUERY_THROW);
-
- // get the current active frame, which should be our "parent"
- // for this session
- m_xFrame = GetFrame();
- if ( !m_xFrame.is() )
- {
- css::uno::Reference< css::frame::XFramesSupplier > xDesktop(m_xSMGR->createInstance(SERVICE_DESKTOP), css::uno::UNO_QUERY_THROW);
- m_xFrame = xDesktop->getActiveFrame();
- }
-
- // identify module
- css::uno::Reference< css::frame::XModuleManager > xModuleManager (m_xSMGR->createInstance(SERVICE_MODULEMANAGER), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::container::XNameAccess > xModuleManagerCont(xModuleManager , css::uno::UNO_QUERY_THROW);
- m_sModuleLongName = xModuleManager->identify(m_xFrame);
- ::comphelper::SequenceAsHashMap lModuleProps(xModuleManagerCont->getByName(m_sModuleLongName));
- m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_SHORTNAME, ::rtl::OUString());
- m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME , ::rtl::OUString());
-
- // get global accelerator configuration
- m_xGlobal = css::uno::Reference< css::ui::XAcceleratorConfiguration >(m_xSMGR->createInstance(SERVICE_GLOBALACCCFG), css::uno::UNO_QUERY_THROW);
-
- // get module accelerator configuration
- css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(m_xSMGR->createInstance(SERVICE_MODULEUICONFIGSUPPLIER), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::ui::XUIConfigurationManager > xUICfgManager = xModuleCfgSupplier->getUIConfigurationManager(m_sModuleLongName);
- m_xModule = css::uno::Reference< css::ui::XAcceleratorConfiguration >(xUICfgManager->getShortCutManager(), css::uno::UNO_QUERY_THROW);
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { m_xSMGR.clear(); }
-}
-
-//-----------------------------------------------
-/** Initialize text columns with own class to enable custom painting
- This is needed as we have to paint disabled entries by ourself. No support for that in the
- original SvTabListBox!
- */
-void SfxAcceleratorConfigPage::CreateCustomItems( SvLBoxEntry* pEntry,
- const String& sCol1 ,
- const String& sCol2 )
-{
- SfxAccCfgLBoxString_Impl* pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol1);
- pEntry->ReplaceItem(pStringItem, 1);
-
- pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol2);
- pEntry->ReplaceItem(pStringItem, 2);
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xAccMgr)
-{
- if (!xAccMgr.is())
- return;
-
- if (!m_bStylesInfoInitialized)
- {
- css::uno::Reference< css::frame::XController > xController;
- css::uno::Reference< css::frame::XModel > xModel;
- if (m_xFrame.is())
- xController = m_xFrame->getController();
- if (xController.is())
- xModel = xController->getModel();
-
- m_aStylesInfo.setModel(xModel);
- pFunctionBox->SetStylesInfo(&m_aStylesInfo);
- pGroupLBox->SetStylesInfo(&m_aStylesInfo);
- m_bStylesInfoInitialized = sal_True;
- }
-
- // Insert all editable accelerators into list box. It is possible
- // that some accelerators are not mapped on the current system/keyboard
- // but we don't want to lose these mappings.
- USHORT c1 = KEYCODE_ARRAY_SIZE;
- USHORT i1 = 0;
- USHORT nListPos = 0;
- for (i1=0; i1<c1; ++i1)
- {
- KeyCode aKey = KEYCODE_ARRAY[i1];
- String sKey = aKey.GetName();
- if (!sKey.Len())
- continue;
- TAccInfo* pEntry = new TAccInfo(i1, nListPos, aKey);
- SvLBoxEntry* pLBEntry = aEntriesBox.InsertEntryToColumn(sKey, 0L, LIST_APPEND, 0xFFFF);
- pLBEntry->SetUserData(pEntry);
- }
-
- // Assign all commands to its shortcuts - reading the accelerator config.
- css::uno::Sequence< css::awt::KeyEvent > lKeys = xAccMgr->getAllKeyEvents();
- sal_Int32 c2 = lKeys.getLength();
- sal_Int32 i2 = 0;
- USHORT nCol = aEntriesBox.TabCount()-1;
-
- for (i2=0; i2<c2; ++i2)
- {
- const css::awt::KeyEvent& aAWTKey = lKeys[i2];
- ::rtl::OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey);
- String sLabel = GetLabel4Command(sCommand);
- KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey);
- USHORT nPos = MapKeyCodeToPos(aKeyCode);
-
- if (nPos == LISTBOX_ENTRY_NOTFOUND)
- continue;
-
- aEntriesBox.SetEntryText(sLabel, nPos, nCol);
-
- SvLBoxEntry* pLBEntry = aEntriesBox.GetEntry(0, nPos);
- TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData();
-
- pEntry->m_bIsConfigurable = sal_True;
- pEntry->m_sCommand = sCommand;
- CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), sLabel);
- }
-
- // Map the VCL hardcoded key codes and mark them as not changeable
- ULONG c3 = Application::GetReservedKeyCodeCount();
- ULONG i3 = 0;
- for (i3=0; i3<c3; ++i3)
- {
- const KeyCode* pKeyCode = Application::GetReservedKeyCode(i3);
- USHORT nPos = MapKeyCodeToPos(*pKeyCode);
-
- if (nPos == LISTBOX_ENTRY_NOTFOUND)
- continue;
-
- // Hardcoded function mapped so no ID possible and mark entry as not changeable
- SvLBoxEntry* pLBEntry = aEntriesBox.GetEntry(0, nPos);
- TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData();
-
- pEntry->m_bIsConfigurable = sal_False;
- CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), String());
- }
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xAccMgr)
-{
- if (!xAccMgr.is())
- return;
-
- // Go through the list from the bottom to the top ...
- // because logical accelerator must be preferred instead of
- // physical ones!
- SvLBoxEntry* pEntry = aEntriesBox.First();
- while (pEntry)
- {
- TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
- ::rtl::OUString sCommand ;
- css::awt::KeyEvent aAWTKey ;
-
- if (pUserData)
- {
- sCommand = pUserData->m_sCommand;
- aAWTKey = ::svt::AcceleratorExecute::st_VCLKey2AWTKey(pUserData->m_aKey);
- }
-
- try
- {
- if (sCommand.getLength())
- xAccMgr->setKeyEvent(aAWTKey, sCommand);
- else
- xAccMgr->removeKeyEvent(aAWTKey);
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-
- pEntry = aEntriesBox.Next(pEntry);
- }
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::ResetConfig()
-{
- aEntriesBox.Clear();
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, Load, Button*, EMPTYARG )
-{
- // ask for filename, where we should load the new config data from
- StartFileDialog( WB_OPEN | WB_STDMODAL | WB_3DLOOK, aLoadAccelConfigStr );
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, Save, Button*, EMPTYARG )
-{
- StartFileDialog( WB_SAVEAS | WB_STDMODAL | WB_3DLOOK, aLoadAccelConfigStr );
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK(SfxAcceleratorConfigPage, Default, PushButton*, EMPTYARG)
-{
- css::uno::Reference< css::form::XReset > xReset(m_xAct, css::uno::UNO_QUERY);
- if (xReset.is())
- xReset->reset();
-
- aEntriesBox.SetUpdateMode(FALSE);
- ResetConfig();
- Init(m_xAct);
- aEntriesBox.SetUpdateMode(TRUE);
- aEntriesBox.Invalidate();
- aEntriesBox.Select(aEntriesBox.GetEntry(0, 0));
-
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, ChangeHdl, Button*, EMPTYARG )
-{
- USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
- TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
- String sNewCommand = pFunctionBox->GetCurCommand();
- String sLabel = pFunctionBox->GetCurLabel();
- if (!sLabel.Len())
- sLabel = GetLabel4Command(sNewCommand);
-
- pEntry->m_sCommand = sNewCommand;
- USHORT nCol = aEntriesBox.TabCount() - 1;
- aEntriesBox.SetEntryText(sLabel, nPos, nCol);
-
- ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, RemoveHdl, Button *, EMPTYARG )
-{
- // get selected entry
- USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
- TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
-
- // remove function name from selected entry
- USHORT nCol = aEntriesBox.TabCount() - 1;
- aEntriesBox.SetEntryText( String(), nPos, nCol );
- pEntry->m_sCommand = ::rtl::OUString();
-
- ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox )
-{
- // disable help
- Help::ShowBalloon( this, Point(), String() );
- if ( pListBox == &aEntriesBox )
- {
- USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
- TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
- ::rtl::OUString sPossibleNewCommand = pFunctionBox->GetCurCommand();
-
- aRemoveButton.Enable( FALSE );
- aChangeButton.Enable( FALSE );
-
- if (pEntry->m_bIsConfigurable)
- {
- if (pEntry->isConfigured())
- aRemoveButton.Enable( TRUE );
- aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand );
- }
- }
- else if ( pListBox == pGroupLBox )
- {
- pGroupLBox->GroupSelected();
- if ( !pFunctionBox->FirstSelected() )
- aChangeButton.Enable( FALSE );
- }
- else if ( pListBox == pFunctionBox )
- {
- aRemoveButton.Enable( FALSE );
- aChangeButton.Enable( FALSE );
-
- // #i36994 First selected can return zero!
- SvLBoxEntry* pLBEntry = aEntriesBox.FirstSelected();
- if ( pLBEntry != 0 )
- {
- USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( pLBEntry );
- TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
- ::rtl::OUString sPossibleNewCommand = pFunctionBox->GetCurCommand();
-
- if (pEntry->m_bIsConfigurable)
- {
- if (pEntry->isConfigured())
- aRemoveButton.Enable( TRUE );
- aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand );
- }
-
- // update key box
- aKeyBox.Clear();
- SvLBoxEntry* pIt = aEntriesBox.First();
- while ( pIt )
- {
- TAccInfo* pUserData = (TAccInfo*)pIt->GetUserData();
- if ( pUserData && pUserData->m_sCommand == sPossibleNewCommand )
- {
- TAccInfo* pU1 = new TAccInfo(-1, -1, pUserData->m_aKey);
- SvLBoxEntry* pE1 = aKeyBox.InsertEntry( pUserData->m_aKey.GetName(), 0L, TRUE, LIST_APPEND );
- pE1->SetUserData(pU1);
- pE1->EnableChildsOnDemand( FALSE );
- }
- pIt = aEntriesBox.Next(pIt);
- }
- }
- }
- else
- {
- // goto selected "key" entry of the key box
- SvLBoxEntry* pE2 = 0;
- TAccInfo* pU2 = 0;
- USHORT nP2 = LISTBOX_ENTRY_NOTFOUND;
- SvLBoxEntry* pE3 = 0;
-
- pE2 = aKeyBox.FirstSelected();
- if (pE2)
- pU2 = (TAccInfo*)pE2->GetUserData();
- if (pU2)
- nP2 = MapKeyCodeToPos(pU2->m_aKey);
- if (nP2 != LISTBOX_ENTRY_NOTFOUND)
- pE3 = aEntriesBox.GetEntry( 0, nP2 );
- if (pE3)
- {
- aEntriesBox.Select( pE3 );
- aEntriesBox.MakeVisible( pE3 );
- }
- }
-
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, RadioHdl, RadioButton *, EMPTYARG )
-{
- css::uno::Reference< css::ui::XAcceleratorConfiguration > xOld = m_xAct;
-
- if (aOfficeButton.IsChecked())
- m_xAct = m_xGlobal;
- else if (aModuleButton.IsChecked())
- m_xAct = m_xModule;
-
- // nothing changed? => do nothing!
- if ( m_xAct.is() && ( xOld == m_xAct ) )
- return 0;
-
- aEntriesBox.SetUpdateMode( FALSE );
- ResetConfig();
- Init(m_xAct);
- aEntriesBox.SetUpdateMode( TRUE );
- aEntriesBox.Invalidate();
-
- pGroupLBox->Init(m_xSMGR, m_xFrame, m_sModuleLongName);
-
- // pb: #133213# do not select NULL entries
- SvLBoxEntry* pEntry = aEntriesBox.GetEntry( 0, 0 );
- if ( pEntry )
- aEntriesBox.Select( pEntry );
- pEntry = pGroupLBox->GetEntry( 0, 0 );
- if ( pEntry )
- pGroupLBox->Select( pEntry );
-
- ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
- return 1L;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper*, EMPTYARG )
-{
- DBG_ASSERT( m_pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" );
-
- ::rtl::OUString sCfgName;
- if ( ERRCODE_NONE == m_pFileDlg->GetError() )
- sCfgName = m_pFileDlg->GetPath();
-
- if ( !sCfgName.getLength() )
- return 0;
-
- GetTabDialog()->EnterWait();
-
- css::uno::Reference< css::frame::XModel > xDoc ;
- css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ;
- css::uno::Reference< css::embed::XStorage > xRootStorage; // we must hold the root storage alive, if xCfgMgr is used!
-
- try
- {
- // first check if URL points to a document already loaded
- xDoc = SearchForAlreadyLoadedDoc(sCfgName);
- if (xDoc.is())
- {
- // Get ui config manager. There should always be one at the model.
- css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xCfgSupplier(xDoc, css::uno::UNO_QUERY_THROW);
- xCfgMgr = xCfgSupplier->getUIConfigurationManager();
- }
- else
- {
- // URL doesn't point to a loaded document, try to access it as a single storage
- // dont forget to release the storage afterwards!
- css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory(m_xSMGR->createInstance(SERVICE_STORAGEFACTORY), css::uno::UNO_QUERY_THROW);
- css::uno::Sequence< css::uno::Any > lArgs(2);
- lArgs[0] <<= sCfgName;
- lArgs[1] <<= css::embed::ElementModes::READ;
-
- xRootStorage = css::uno::Reference< css::embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::embed::XStorage > xUIConfig = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::READ);
- if (xUIConfig.is())
- {
- xCfgMgr = css::uno::Reference< css::ui::XUIConfigurationManager >(m_xSMGR->createInstance(SERVICE_UICONFIGMGR), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::ui::XUIConfigurationStorage > xCfgMgrStore(xCfgMgr, css::uno::UNO_QUERY_THROW);
- xCfgMgrStore->setStorage(xUIConfig);
- }
- }
-
- if (xCfgMgr.is())
- {
- // open the configuration and update our UI
- css::uno::Reference< css::ui::XAcceleratorConfiguration > xTempAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW);
-
- aEntriesBox.SetUpdateMode(FALSE);
- ResetConfig();
- Init(xTempAccMgr);
- aEntriesBox.SetUpdateMode(TRUE);
- aEntriesBox.Invalidate();
- aEntriesBox.Select(aEntriesBox.GetEntry(0, 0));
-
- }
-
- // dont forget to close the new opened storage!
- // We are the owner of it.
- if (xRootStorage.is())
- {
- css::uno::Reference< css::lang::XComponent > xComponent;
- xComponent = css::uno::Reference< css::lang::XComponent >(xCfgMgr, css::uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->dispose();
- xComponent = css::uno::Reference< css::lang::XComponent >(xRootStorage, css::uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->dispose();
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-
- GetTabDialog()->LeaveWait();
-
- return 0;
-}
-
-//-----------------------------------------------
-IMPL_LINK( SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, EMPTYARG )
-{
- DBG_ASSERT( m_pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" );
-
- ::rtl::OUString sCfgName;
- if ( ERRCODE_NONE == m_pFileDlg->GetError() )
- sCfgName = m_pFileDlg->GetPath();
-
- if ( !sCfgName.getLength() )
- return 0;
-
- GetTabDialog()->EnterWait();
-
- css::uno::Reference< css::frame::XModel > xDoc ;
- css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ;
- css::uno::Reference< css::embed::XStorage > xRootStorage;
-
- try
- {
- // first check if URL points to a document already loaded
- xDoc = SearchForAlreadyLoadedDoc(sCfgName);
- if (xDoc.is())
- {
- // get config manager, force creation if there was none before
- css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xCfgSupplier(xDoc, css::uno::UNO_QUERY_THROW);
- xCfgMgr = xCfgSupplier->getUIConfigurationManager();
- }
- else
- {
- // URL doesn't point to a loaded document, try to access it as a single storage
- css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory(m_xSMGR->createInstance(SERVICE_STORAGEFACTORY), css::uno::UNO_QUERY_THROW);
- css::uno::Sequence< css::uno::Any > lArgs(2);
- lArgs[0] <<= sCfgName;
- lArgs[1] <<= css::embed::ElementModes::WRITE;
-
- xRootStorage = css::uno::Reference< css::embed::XStorage >(
- xStorageFactory->createInstanceWithArguments(lArgs),
- css::uno::UNO_QUERY_THROW);
-
- css::uno::Reference< css::embed::XStorage > xUIConfig(
- xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::WRITE),
- css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::beans::XPropertySet > xUIConfigProps(
- xUIConfig,
- css::uno::UNO_QUERY_THROW);
-
- // set the correct media type if the storage was new created
- ::rtl::OUString sMediaType;
- xUIConfigProps->getPropertyValue(MEDIATYPE_PROPNAME) >>= sMediaType;
- if (!sMediaType.getLength())
- xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, css::uno::makeAny(MEDIATYPE_UICONFIG));
-
- xCfgMgr = css::uno::Reference< css::ui::XUIConfigurationManager >(m_xSMGR->createInstance(SERVICE_UICONFIGMGR), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::ui::XUIConfigurationStorage > xUICfgStore(xCfgMgr, css::uno::UNO_QUERY_THROW);
- xUICfgStore->setStorage(xUIConfig);
- }
-
- if (xCfgMgr.is())
- {
- // get the target configuration access and update with all shortcuts
- // which are set currently at the UI !
- // Dont copy the m_xAct content to it ... because m_xAct will be updated
- // from the UI on pressing the button "OK" only. And inbetween it's not up to date !
- css::uno::Reference< css::ui::XAcceleratorConfiguration > xTargetAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW);
- Apply(xTargetAccMgr);
-
- // commit (order is important!)
- css::uno::Reference< css::ui::XUIConfigurationPersistence > xCommit1(xTargetAccMgr, css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::ui::XUIConfigurationPersistence > xCommit2(xCfgMgr , css::uno::UNO_QUERY_THROW);
- xCommit1->store();
- xCommit2->store();
-
- if (xRootStorage.is())
- {
- // Commit root storage
- css::uno::Reference< css::embed::XTransactedObject > xCommit3(xRootStorage, css::uno::UNO_QUERY_THROW);
- xCommit3->commit();
- }
- }
-
- if (xRootStorage.is())
- {
- css::uno::Reference< css::lang::XComponent > xComponent;
- xComponent = css::uno::Reference< css::lang::XComponent >(xCfgMgr, css::uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->dispose();
- xComponent = css::uno::Reference< css::lang::XComponent >(xRootStorage, css::uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->dispose();
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-
- GetTabDialog()->LeaveWait();
-
- return 0;
-}
-
-::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL )
-{
- ::rtl::OUString aLabel;
- if ( aCmdURL.getLength() )
- {
- try
- {
- uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY );
- if ( xNameAccess.is() )
- {
- uno::Reference< container::XNameAccess > xUICommandLabels;
- const ::rtl::OUString aModule( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) );
- uno::Any a = xNameAccess->getByName( aModule );
- uno::Reference< container::XNameAccess > xUICommands;
- a >>= xUICommandLabels;
- rtl::OUString aStr;
- uno::Sequence< beans::PropertyValue > aPropSeq;
- a = xUICommandLabels->getByName( aCmdURL );
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( "Name" ))
- {
- aPropSeq[i].Value >>= aStr;
- break;
- }
- }
- }
- aLabel = aStr;
- }
- }
- catch ( uno::Exception& )
- {
- }
- }
-
- return aLabel;
-}
-
-
-//-----------------------------------------------
-String SfxAcceleratorConfigPage::GetFunctionName(KeyFuncType eType) const
-{
- ::rtl::OUStringBuffer sName(256);
- sName.appendAscii("\"");
- switch(eType)
- {
- case KEYFUNC_NEW :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:NewDoc") ) );
- break;
-
- case KEYFUNC_OPEN :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Open") ) );
- break;
-
- case KEYFUNC_SAVE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Save") ) );
- break;
-
- case KEYFUNC_SAVEAS :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:SaveAs") ) );
- break;
-
- case KEYFUNC_PRINT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Print") ) );
- break;
-
- case KEYFUNC_CLOSE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Close") ) );
- break;
-
- case KEYFUNC_QUIT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Quit") ) );
- break;
-
- case KEYFUNC_CUT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Cut") ) );
- break;
-
- case KEYFUNC_COPY :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Copy") ) );
- break;
-
- case KEYFUNC_PASTE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Paste") ) );
- break;
-
- case KEYFUNC_UNDO :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Undo") ) );
- break;
-
- case KEYFUNC_REDO :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Redo") ) );
- break;
-
- case KEYFUNC_DELETE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Delete") ) );
- break;
-
- case KEYFUNC_REPEAT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Repeat") ) );
- break;
-
- case KEYFUNC_FIND :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Search") ) );
- break;
-
- case KEYFUNC_FINDBACKWARD :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:SearchBackwards") ) );
- break;
-
- case KEYFUNC_PROPERTIES :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Options") ) );
- break;
-
- case KEYFUNC_FRONT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:ToFront") ) );
- break;
-
- default:
- break;
- }
- sName.appendAscii("\"");
- return String(sName.makeStringAndClear());
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle )
-{
- bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS );
- short nDialogType = bSave ? css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE
- : css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
- if ( m_pFileDlg )
- delete m_pFileDlg;
- m_pFileDlg = new sfx2::FileDialogHelper( nDialogType, 0 );
-
- m_pFileDlg->SetTitle( rTitle );
-// m_pFileDlg->SetDialogHelpId( bSave ? HID_CONFIG_SAVE : HID_CONFIG_LOAD );
- m_pFileDlg->AddFilter( aFilterAllStr, DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) );
- m_pFileDlg->AddFilter( aFilterCfgStr, DEFINE_CONST_UNICODE( "*.cfg" ) );
-
- Link aDlgClosedLink = bSave ? LINK( this, SfxAcceleratorConfigPage, SaveHdl )
- : LINK( this, SfxAcceleratorConfigPage, LoadHdl );
- m_pFileDlg->StartExecuteModal( aDlgClosedLink );
-}
-
-//-----------------------------------------------
-BOOL SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& )
-{
- Apply(m_xAct);
- try
- {
- m_xAct->store();
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { return FALSE; }
-
- return TRUE;
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet )
-{
- // open accelerator configs
- // Note: It initialize some other members too, which are needed here ...
- // e.g. m_sModuleUIName!
- InitAccCfg();
-
- // change te description of the radio button, which switch to the module
- // dependend accelerator configuration
- String sButtonText = aModuleButton.GetText();
- sButtonText.SearchAndReplace(String::CreateFromAscii("$(MODULE)"), m_sModuleUIName);
- aModuleButton.SetText(sButtonText);
-
- if (m_xModule.is())
- aModuleButton.Check();
- else
- {
- aModuleButton.Hide();
- aOfficeButton.Check();
- }
-
- RadioHdl(0);
-
- const SfxPoolItem* pMacroItem=0;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_MACROINFO, TRUE, &pMacroItem ) )
- {
- m_pMacroInfoItem = PTR_CAST( SfxMacroInfoItem, pMacroItem );
- pGroupLBox->SelectMacro( m_pMacroInfoItem );
- }
- else
- {
- const SfxPoolItem* pStringItem=0;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_CHARMAP, TRUE, &pStringItem ) )
- m_pStringItem = PTR_CAST( SfxStringItem, pStringItem );
-
- const SfxPoolItem* pFontItem=0;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_SPECIALCHAR, TRUE, &pFontItem ) )
- m_pFontItem = PTR_CAST( SfxStringItem, pFontItem );
-
- if ( m_pStringItem )
- pGroupLBox->AddAndSelect( m_pStringItem, m_pFontItem );
- }
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::SelectMacro(const SfxMacroInfoItem *pItem)
-{
- m_pMacroInfoItem = pItem;
- pGroupLBox->SelectMacro( pItem );
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr,
- const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr)
-{
- const css::uno::Sequence< css::awt::KeyEvent > lKeys = xSourceAccMgr->getAllKeyEvents();
- sal_Int32 c = lKeys.getLength();
- sal_Int32 i = 0;
- for (i=0; i<c; ++i)
- {
- const css::awt::KeyEvent& rKey = lKeys[i];
- ::rtl::OUString sCommand = xSourceAccMgr->getCommandByKeyEvent(rKey);
- xTargetAccMgr->setKeyEvent(rKey, sCommand);
- }
-}
-
-//-----------------------------------------------
-KeyCode SfxAcceleratorConfigPage::MapPosToKeyCode(USHORT nPos) const
-{
- TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
- KeyCode aCode(KEYCODE_ARRAY[pEntry->m_nKeyPos] & 0xFFF ,
- KEYCODE_ARRAY[pEntry->m_nKeyPos] & (KEY_SHIFT | KEY_MOD2));
- return aCode;
-}
-
-//-----------------------------------------------
-USHORT SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const
-{
- USHORT nCode1 = aKey.GetCode()+aKey.GetModifier();
- SvLBoxEntry* pEntry = aEntriesBox.First();
- USHORT i = 0;
-
- while (pEntry)
- {
- TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
- if (pUserData)
- {
- USHORT nCode2 = pUserData->m_aKey.GetCode()+pUserData->m_aKey.GetModifier();
- if (nCode1 == nCode2)
- return i;
- }
- pEntry = aEntriesBox.Next(pEntry);
- ++i;
- }
-
- return LISTBOX_ENTRY_NOTFOUND;
-}
-
-//-----------------------------------------------
-String SfxAcceleratorConfigPage::GetLabel4Command(const String& sCommand)
-{
- try
- {
- // check global command configuration first
- css::uno::Reference< css::container::XNameAccess > xModuleConf;
- m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf;
- if (xModuleConf.is())
- {
- ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
- String sLabel = String(lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, ::rtl::OUString()));
- if (sLabel.Len())
- return sLabel;
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-
- // may be it's a style URL .. they must be handled special
- SfxStyleInfo_Impl aStyle;
- aStyle.sCommand = sCommand;
- if (m_aStylesInfo.parseStyleCommand(aStyle))
- {
- m_aStylesInfo.getLabel4Style(aStyle);
- return aStyle.sLabel;
- }
- else
- {
- String aRet( String::CreateFromAscii("Symbols: ") );
- xub_StrLen nPos = sCommand.SearchAscii(".uno:InsertSymbol?Symbols:string=");
- if ( nPos == 0 )
- {
- aRet += String( sCommand, 34, sCommand.Len()-34 );
- return aRet;
- }
- }
-
- return sCommand;
-}
-
-SfxTabPage* SfxAcceleratorConfigPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SfxAcceleratorConfigPage( pParent, rAttrSet );
-}
-
-//-----------------------------------------------
-css::uno::Reference< css::frame::XModel > SfxAcceleratorConfigPage::SearchForAlreadyLoadedDoc(const String& /*sName*/)
-{
- return css::uno::Reference< css::frame::XModel >();
-}
-
-SvxShortcutAssignDlg::SvxShortcutAssignDlg( Window* pParent, const uno::Reference< frame::XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
- : SfxSingleTabDialog( pParent, rSet, 0 )
-{
- SfxTabPage* pPage = SfxAcceleratorConfigPage::Create( this, rSet );
- pPage->SetFrame( rxDocumentFrame );
- SetTabPage( pPage );
-
-}
-
-SvxShortcutAssignDlg::~SvxShortcutAssignDlg()
-{
-}
-
-
-// .uno:InsertSymbol?Symbols:string=bla
diff --git a/svx/source/cui/acccfg.hrc b/svx/source/cui/acccfg.hrc
deleted file mode 100644
index 4fecaf4cb1..0000000000
--- a/svx/source/cui/acccfg.hrc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.hrc,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define GRP_FUNCTIONS 22
-#define BTN_ACC_OK 1
-#define BTN_ACC_CANCEL 2
-#define BTN_ACC_CHANGE 3
-#define BTN_ACC_REMOVE 4
-#define BOX_ACC_ENTRIES 5
-#define TXT_ACC_DESCRIPTIONTEXT 6
-#define TXT_ACC_DESCRIPTIONINFO 7
-#define GRP_ACC_KEYBOARD 8
-#define TXT_ACC_GROUP 9
-#define BOX_ACC_GROUP 10
-#define TXT_ACC_FUNCTION 11
-#define BOX_ACC_FUNCTION 12
-#define TXT_ACC_KEY 13
-#define BOX_ACC_KEY 14
-#define GRP_ACC_FUNCTIONS 15
-#define BTN_RESET 20
-#define BTN_LOAD 40
-#define BTN_SAVE 41
-#define RB_OFFICE 44
-#define RB_MODULE 45
-#define STR_LOADACCELCONFIG 46
-#define STR_SAVEACCELCONFIG 47
-
-#define IMG_HARDDISK 48
-#define IMG_HARDDISK_HC 49
-#define STR_PRODMACROS 50
-#define STR_MYMACROS 51
-#define IMG_LIB 52
-#define IMG_LIB_HC 53
-#define IMG_MACRO 54
-#define IMG_MACRO_HC 55
-#define IMG_DOC 56
-#define IMG_DOC_HC 57
-#define STR_GROUP_STYLES 58
-#define STR_PDF_EXPORT_SEND 59
-#define STR_RECHECK_DOCUMENT 60
-#define IMG_INFO 61
-#define STR_BASICNAME 62
-#define BMP_COLLAPSED 63
-#define BMP_EXPANDED 64
-#define BMP_COLLAPSED_HC 65
-#define BMP_EXPANDED_HC 66
-#define STR_BASICMACROS 67
-#define STR_DLG_MACROS 68
-#define STR_HUMAN_APPNAME 69
-#define STR_FILTERNAME_CFG 70
-
diff --git a/svx/source/cui/acccfg.hxx b/svx/source/cui/acccfg.hxx
deleted file mode 100644
index d115544cfb..0000000000
--- a/svx/source/cui/acccfg.hxx
+++ /dev/null
@@ -1,288 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: acccfg.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _ACCCFG_HXX
-#define _ACCCFG_HXX
-
-// #include *****************************************************************
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/ui/XUIConfigurationManager.hpp>
-#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/script/browse/XBrowseNode.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-
-#include <algorithm>
-
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/group.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/svtreebx.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <sfx2/basedlgs.hxx>
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-
-#include <sfx2/minarray.hxx>
-
-#include "cfgutil.hxx"
-
-// class SfxAcceleratorConfigListBox *************************************************
-
-#define css ::com::sun::star
-
-class SfxMacroInfoItem;
-class SfxConfigGroupListBox_Impl;
-class SfxConfigFunctionListBox_Impl;
-class SfxAcceleratorConfigPage;
-
-class SfxAccCfgTabListBox_Impl : public SvTabListBox
-{
- SfxAcceleratorConfigPage* m_pAccelConfigPage;
-
- void KeyInput( const KeyEvent &rKEvt );
-
-protected:
- virtual void InitEntry( SvLBoxEntry*, const XubString&, const Image&, const Image&, SvLBoxButtonKind eButtonKind );
-
-public:
- SfxAccCfgTabListBox_Impl(
- SfxAcceleratorConfigPage* pAccelConfigPage,
- Window *pParent,
- const ResId &rResId ) :
- SvTabListBox( pParent, rResId ),
- m_pAccelConfigPage( pAccelConfigPage )
- {}
-
- void ReplaceEntry( USHORT nPos, const String &rStr );
-};
-
-// class SfxAcceleratorConfigPage ----------------------------------------
-
-struct TAccInfo
-{
- public:
-
- TAccInfo( sal_Int32 nKeyPos ,
- sal_Int32 nListPos,
- const KeyCode& aKey )
- : m_nKeyPos (nKeyPos )
- , m_nListPos (nListPos )
- , m_bIsConfigurable(sal_True )
- , m_sCommand ( )
- , m_aKey (aKey )
- // its important to set TRUE as default -
- // because only fix entries will be disabled later ...
- {}
-
- sal_Bool isConfigured() const
- {
- return (m_nKeyPos>-1 && m_nListPos>-1 && m_sCommand.getLength());
- }
-
- sal_Int32 m_nKeyPos;
- sal_Int32 m_nListPos;
- sal_Bool m_bIsConfigurable;
- ::rtl::OUString m_sCommand;
- KeyCode m_aKey;
-};
-
-namespace sfx2
-{
- class FileDialogHelper;
-}
-
-class SfxAcceleratorConfigPage : public SfxTabPage
-{
- friend class SfxAccCfgTabListBox_Impl;
-private:
- const SfxMacroInfoItem* m_pMacroInfoItem;
- const SfxStringItem* m_pStringItem;
- const SfxStringItem* m_pFontItem;
- sfx2::FileDialogHelper* m_pFileDlg;
-
- SfxAccCfgTabListBox_Impl aEntriesBox;
- FixedLine aKeyboardGroup;
- RadioButton aOfficeButton;
- RadioButton aModuleButton;
- PushButton aChangeButton;
- PushButton aRemoveButton;
- FixedText aGroupText;
- SfxConfigGroupListBox_Impl* pGroupLBox;
- FixedText aFunctionText;
- SfxConfigFunctionListBox_Impl* pFunctionBox;
- FixedText aKeyText;
- SvTreeListBox aKeyBox;
- FixedLine aFunctionsGroup;
- PushButton aLoadButton;
- PushButton aSaveButton;
- PushButton aResetButton;
- String aLoadAccelConfigStr;
- String aSaveAccelConfigStr;
- String aFilterAllStr;
- String aFilterCfgStr;
- SfxStylesInfo_Impl m_aStylesInfo;
- sal_Bool m_bStylesInfoInitialized;
-
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
- css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobal;
- css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModule;
- css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAct;
- css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription;
- css::uno::Reference< css::frame::XFrame > m_xFrame;
-
- ::rtl::OUString m_sModuleLongName;
- ::rtl::OUString m_sModuleShortName;
- ::rtl::OUString m_sModuleUIName;
-
- DECL_LINK( ChangeHdl, Button * );
- DECL_LINK( RemoveHdl, Button * );
- DECL_LINK( SelectHdl, Control * );
- DECL_LINK( Save, Button * );
- DECL_LINK( Load, Button * );
- DECL_LINK( Default, PushButton * );
- DECL_LINK( RadioHdl, RadioButton* );
-
- DECL_LINK( LoadHdl, sfx2::FileDialogHelper* );
- DECL_LINK( SaveHdl, sfx2::FileDialogHelper* );
-
- String GetLabel4Command(const String& sCommand);
- void InitAccCfg();
- KeyCode MapPosToKeyCode( USHORT nPos ) const;
- USHORT MapKeyCodeToPos( const KeyCode &rCode ) const;
- String GetFunctionName( KeyFuncType eType ) const;
- css::uno::Reference< css::frame::XModel > SearchForAlreadyLoadedDoc(const String& sName);
- void StartFileDialog( WinBits nBits, const String& rTitle );
-
- void Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr);
- void ResetConfig();
-
- void CreateCustomItems( SvLBoxEntry* pEntry, const String& aCol1, const String& aCol2 );
-
-public:
- SfxAcceleratorConfigPage( Window *pParent, const SfxItemSet& rItemSet );
- virtual ~SfxAcceleratorConfigPage();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet& );
-
- void SelectMacro(const SfxMacroInfoItem*);
- void Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr);
- void CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr,
- const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr);
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-};
-
-
-class SfxAcceleratorConfigListBox : public ListBox
-{
- void KeyInput( const KeyEvent &rKEvt );
-
-public:
-
- SfxAcceleratorConfigListBox( Window *pParent, ResId &rResId ) :
- ListBox( pParent, rResId ) {}
-
- void ReplaceEntry( USHORT nPos, const String &rStr );
- void ExpandEntry ( USHORT nPos, const String &rStr );
-};
-
-/*
-// class USHORTArr **********************************************************
-
-DECL_2BYTEARRAY(USHORTArr, USHORT, 10, 10)
-
-// class SfxAcceleratorConfigDialog **************************************************
-
-class SfxAcceleratorConfigDialog : public ModalDialog
-{
- OKButton aOKButton;
- CancelButton aCancelButton;
- PushButton aChangeButton;
- PushButton aRemoveButton;
- SfxAcceleratorConfigListBox aEntriesBox;
- FixedText aDescriptionTextText;
- FixedText aDescriptionInfoText;
- FixedLine aKeyboardGroup;
- FixedText aGroupText;
- ListBox aGroupLBox;
- FixedText aFunctionText;
- ListBox aFunctionBox;
- FixedText aKeyText;
- ListBox aKeyBox;
- FixedLine aFunctionsGroup;
-
- USHORTArr aAccelArr;
- USHORTArr aFunctionArr;
- USHORTArr aKeyArr;
-
- void OKHdl ( Button * );
- void ChangeHdl( Button * );
- void RemoveHdl( Button * );
- void SelectHdl( ListBox *pListBox );
-
- KeyCode PosToKeyCode ( USHORT nPos ) const;
- USHORT KeyCodeToPos ( const KeyCode &rCode ) const;
- String GetFunctionName( KeyFuncType eType ) const;
-
-public:
-
- SfxAcceleratorConfigDialog( Window *pParent );
-};
-*/
-
-class SvxShortcutAssignDlg : public SfxSingleTabDialog
-{
-public:
- SvxShortcutAssignDlg(
- Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
- const SfxItemSet& rSet );
- virtual ~SvxShortcutAssignDlg();
-};
-
-
-
-#undef css
-
-#endif
-
diff --git a/svx/source/cui/acccfg.src b/svx/source/cui/acccfg.src
deleted file mode 100644
index a8a5ca549b..0000000000
--- a/svx/source/cui/acccfg.src
+++ /dev/null
@@ -1,360 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.src,v $
- * $Revision: 1.47 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include "svx/dialogs.hrc"
-#include "acccfg.hrc"
-
-#define MASKCOLOR MaskColor = \
- Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
-#define PUSHBUTTON_TEXT_SAVE \
- Text [ en-US ] = "~Save..." ; \
-
-#define PUSHBUTTON_TEXT_RESET \
- Text [ en-US ] = "R~eset" ; \
-
-#define PUSHBUTTON_TEXT_LOAD \
- Text [ en-US ] = "~Load..." ; \
-
-#define PUSHBUTTON_TEXT_REMOVE \
- Text [ en-US ] = "~Delete" ; \
-
-#define PUSHBUTTON_TEXT_CHANGE \
- Text [ en-US ] = "~Modify" ; \
-
-#define PUSHBUTTON_TEXT_NEW \
- Text [ en-US ] = "~New" ; \
-
-#define FIXEDTEXT_TEXT_GROUP \
- Text [ en-US ] = "~Category" ; \
-
-#define FIXEDTEXT_TEXT_FUNCTION \
- Text [ en-US ] = "Function" ; \
-
-#define GROUPBOX_TEXT_FUNCTIONS \
- Text [ en-US ] = "Functions" ; \
-
- // TP_CONFIG_ACCEL -------------------------------------------------------
-TabPage RID_SVXPAGE_KEYBOARD
-{
- HelpId = HID_CONFIG_ACCEL ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 273 , 258 ) ;
- RadioButton RB_OFFICE
- {
- Pos = MAP_APPFONT ( 192 , 6 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text = "%PRODUCTNAME" ;
- };
- RadioButton RB_MODULE
- {
- Pos = MAP_APPFONT ( 192 , 19 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text = "$(MODULE)" ;
- };
- PushButton BTN_ACC_CHANGE
- {
- Pos = MAP_APPFONT ( 192 , 35 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- PUSHBUTTON_TEXT_CHANGE
- };
- PushButton BTN_ACC_REMOVE
- {
- Pos = MAP_APPFONT ( 192 , 52 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- PUSHBUTTON_TEXT_REMOVE
- };
- FixedLine GRP_ACC_KEYBOARD
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 180 , 8 ) ;
- Group = TRUE ;
- Text [ en-US ] = "Shortcut keys";
- };
- Control BOX_ACC_ENTRIES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 174 , 120 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- HelpId = HID_ACCELCONFIG_LISTBOX ;
- };
- FixedLine GRP_ACC_FUNCTIONS
- {
- Pos = MAP_APPFONT ( 6 , 140 ) ;
- Size = MAP_APPFONT ( 258 , 8 ) ;
- Group = TRUE ;
- GROUPBOX_TEXT_FUNCTIONS
- };
- FixedText TXT_ACC_GROUP
- {
- Pos = MAP_APPFONT ( 12 , 151 ) ;
- Size = MAP_APPFONT ( 78 , 8 ) ;
- Group = TRUE ;
- Left = TRUE ;
- FIXEDTEXT_TEXT_GROUP
- };
- Control BOX_ACC_GROUP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 161 ) ;
- Size = MAP_APPFONT ( 78 , 91 ) ;
- TabStop = TRUE ;
- HelpId = HID_CONFIGGROUP_ACC_LISTBOX ;
- };
- FixedText TXT_ACC_FUNCTION
- {
- Pos = MAP_APPFONT ( 93 , 151 ) ;
- Size = MAP_APPFONT ( 88 , 8 ) ;
- Left = TRUE ;
- FIXEDTEXT_TEXT_FUNCTION
- };
- Control BOX_ACC_FUNCTION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 93 , 161 ) ;
- Size = MAP_APPFONT ( 88 , 91 ) ;
- TabStop = TRUE ;
- HelpId = HID_CONFIGFUNCTION_ACC_LISTBOX ;
- };
- FixedText TXT_ACC_KEY
- {
- Pos = MAP_APPFONT ( 184 , 151 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "~Keys" ;
- Left = TRUE ;
- };
- Control BOX_ACC_KEY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 184 , 161 ) ;
- Size = MAP_APPFONT ( 80 , 91 ) ;
- TabStop = TRUE ;
- };
- PushButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 192 , 86 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- PUSHBUTTON_TEXT_LOAD
- };
- PushButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 192 , 103 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- PUSHBUTTON_TEXT_SAVE
- };
- PushButton BTN_RESET
- {
- Pos = MAP_APPFONT ( 192 , 120 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- PUSHBUTTON_TEXT_RESET
- };
- String STR_LOADACCELCONFIG
- {
- Text [ en-US ] = "Load Keyboard Configuration" ;
- };
- String STR_SAVEACCELCONFIG
- {
- Text [ en-US ] = "Save Keyboard Configuration" ;
- };
- String STR_SFX_FILTERNAME_ALL
- {
- Text [ en-US ] = "All files (*.*)" ;
- };
- String STR_FILTERNAME_CFG
- {
- Text [ en-US ] = "Configuration" ;
- };
-};
-
-Resource RID_SVXPAGE_CONFIGGROUPBOX
-{
- String STR_MYMACROS
- {
- Text [ en-US ] = "My Macros";
- };
- String STR_PRODMACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros";
- };
- String STR_BASICMACROS
- {
- Text [ en-US ] = "BASIC Macros" ;
- };
- String STR_DLG_MACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros" ;
- };
- String STR_HUMAN_APPNAME
- {
- TEXT = "%PRODUCTNAME" ;
- };
- String STR_GROUP_STYLES
- {
- Text [ en-US ] = "Styles" ;
- };
- Image IMG_HARDDISK
- {
- ImageBitmap = Bitmap { File = "harddisk_16.bmp" ; };
- MASKCOLOR
- };
- Image IMG_HARDDISK_HC
- {
- ImageBitmap = Bitmap { File = "harddisk_16_h.bmp" ; };
- MASKCOLOR
- };
- Image IMG_LIB
- {
- ImageBitmap = Bitmap { File = "im30820.png"; };
- MASKCOLOR
- };
- Image IMG_LIB_HC
- {
- ImageBitmap = Bitmap { File = "imh30820.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "im30821.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO_HC
- {
- ImageBitmap = Bitmap { File = "imh30821.png"; };
- MASKCOLOR
- };
- Image IMG_DOC
- {
- ImageBitmap = Bitmap { File = "im30826.png"; };
- MASKCOLOR
- };
- Image IMG_DOC_HC
- {
- ImageBitmap = Bitmap { File = "imh30826.png"; };
- MASKCOLOR
- };
- String STR_BASICNAME
- {
- Text = "%PRODUCTNAME Basic" ;
- };
- Image BMP_COLLAPSED
- {
- ImageBitmap = Bitmap
- {
- File = "plus.bmp" ;
- };
- // MaskColor = Color { Predefine = COL_GREEN ; };
- };
- Image BMP_EXPANDED
- {
- ImageBitmap = Bitmap
- {
- File = "minus.bmp" ;
- };
- // MaskColor = Color { Predefine = COL_GREEN ; };
- };
- Image BMP_EXPANDED_HC
- {
- ImageBitmap = Bitmap
- {
- File = "minus_h.bmp" ;
- };
- };
- Image BMP_COLLAPSED_HC
- {
- ImageBitmap = Bitmap
- {
- File = "plus_h.bmp" ;
- };
- };
-};
-
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/align.cxx b/svx/source/cui/align.cxx
deleted file mode 100644
index 8e84817027..0000000000
--- a/svx/source/cui/align.cxx
+++ /dev/null
@@ -1,303 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: align.cxx,v $
- * $Revision: 1.26.272.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <svx/svxenum.hxx>
-
-#include <svx/dialogs.hrc>
-#include "align.hrc"
-#include "rotmodit.hxx"
-
-#include <svx/algitem.hxx>
-#include <svx/frmdiritem.hxx>
-#include "align.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <tools/shl.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/itemconnect.hxx>
-#include <svtools/cjkoptions.hxx>
-#include <svtools/languageoptions.hxx>
-#include <svtools/localresaccess.hxx>
-#include <svx/svxids.hrc> //CHINA001
-#include "flagsdef.hxx" //CHINA001
-#include <svtools/intitem.hxx> //CHINA001
-#include <sfx2/request.hxx> //CHINA001
-
-namespace svx {
-
-// item connections ===========================================================
-
-// horizontal alignment -------------------------------------------------------
-
-typedef sfx::ValueItemWrapper< SvxHorJustifyItem, SvxCellHorJustify, USHORT > HorJustItemWrapper;
-typedef sfx::ListBoxConnection< HorJustItemWrapper > HorJustConnection;
-
-static const HorJustConnection::MapEntryType s_pHorJustMap[] =
-{
- { ALIGNDLG_HORALIGN_STD, SVX_HOR_JUSTIFY_STANDARD },
- { ALIGNDLG_HORALIGN_LEFT, SVX_HOR_JUSTIFY_LEFT },
- { ALIGNDLG_HORALIGN_CENTER, SVX_HOR_JUSTIFY_CENTER },
- { ALIGNDLG_HORALIGN_RIGHT, SVX_HOR_JUSTIFY_RIGHT },
- { ALIGNDLG_HORALIGN_BLOCK, SVX_HOR_JUSTIFY_BLOCK },
- { ALIGNDLG_HORALIGN_FILL, SVX_HOR_JUSTIFY_REPEAT },
- { LISTBOX_ENTRY_NOTFOUND, SVX_HOR_JUSTIFY_STANDARD }
-};
-
-// vertical alignment ---------------------------------------------------------
-
-typedef sfx::ValueItemWrapper< SvxVerJustifyItem, SvxCellVerJustify, USHORT > VerJustItemWrapper;
-typedef sfx::ListBoxConnection< VerJustItemWrapper > VerJustConnection;
-
-static const VerJustConnection::MapEntryType s_pVerJustMap[] =
-{
- { ALIGNDLG_VERALIGN_STD, SVX_VER_JUSTIFY_STANDARD },
- { ALIGNDLG_VERALIGN_TOP, SVX_VER_JUSTIFY_TOP },
- { ALIGNDLG_VERALIGN_MID, SVX_VER_JUSTIFY_CENTER },
- { ALIGNDLG_VERALIGN_BOTTOM, SVX_VER_JUSTIFY_BOTTOM },
- { LISTBOX_ENTRY_NOTFOUND, SVX_VER_JUSTIFY_STANDARD }
-};
-
-// cell rotate mode -----------------------------------------------------------
-
-typedef sfx::ValueItemWrapper< SvxRotateModeItem, SvxRotateMode, USHORT > RotateModeItemWrapper;
-typedef sfx::ValueSetConnection< RotateModeItemWrapper > RotateModeConnection;
-
-static const RotateModeConnection::MapEntryType s_pRotateModeMap[] =
-{
- { IID_BOTTOMLOCK, SVX_ROTATE_MODE_BOTTOM },
- { IID_TOPLOCK, SVX_ROTATE_MODE_TOP },
- { IID_CELLLOCK, SVX_ROTATE_MODE_STANDARD },
- { VALUESET_ITEM_NOTFOUND, SVX_ROTATE_MODE_STANDARD }
-};
-
-// ============================================================================
-
-static USHORT s_pRanges[] =
-{
- SID_ATTR_ALIGN_HOR_JUSTIFY,SID_ATTR_ALIGN_VER_JUSTIFY,
- SID_ATTR_ALIGN_STACKED,SID_ATTR_ALIGN_LINEBREAK,
- SID_ATTR_ALIGN_INDENT,SID_ATTR_ALIGN_INDENT,
- SID_ATTR_ALIGN_DEGREES,SID_ATTR_ALIGN_DEGREES,
- SID_ATTR_ALIGN_LOCKPOS,SID_ATTR_ALIGN_LOCKPOS,
- SID_ATTR_ALIGN_HYPHENATION,SID_ATTR_ALIGN_HYPHENATION,
- SID_ATTR_ALIGN_ASIANVERTICAL,SID_ATTR_ALIGN_ASIANVERTICAL,
- SID_ATTR_FRAMEDIRECTION,SID_ATTR_FRAMEDIRECTION,
- SID_ATTR_ALIGN_SHRINKTOFIT,SID_ATTR_ALIGN_SHRINKTOFIT,
- 0
-};
-
-// ============================================================================
-
-AlignmentTabPage::AlignmentTabPage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_ALIGNMENT ), rCoreAttrs ),
-
- maFlAlignment ( this, SVX_RES( FL_ALIGNMENT ) ),
- maFtHorAlign ( this, SVX_RES( FT_HORALIGN ) ),
- maLbHorAlign ( this, SVX_RES( LB_HORALIGN ) ),
- maFtIndent ( this, SVX_RES( FT_INDENT ) ),
- maEdIndent ( this, SVX_RES( ED_INDENT ) ),
- maFtVerAlign ( this, SVX_RES( FT_VERALIGN ) ),
- maLbVerAlign ( this, SVX_RES( LB_VERALIGN ) ),
-
- maFlOrient ( this, SVX_RES( FL_ORIENTATION ) ),
- maCtrlDial ( this, SVX_RES( CTR_DIAL ) ),
- maFtRotate ( this, SVX_RES( FT_DEGREES ) ),
- maNfRotate ( this, SVX_RES( NF_DEGREES ) ),
- maFtRefEdge ( this, SVX_RES( FT_BORDER_LOCK ) ),
- maVsRefEdge ( this, SVX_RES( CTR_BORDER_LOCK ) ),
- maCbStacked ( this, SVX_RES( BTN_TXTSTACKED ) ),
- maCbAsianMode ( this, SVX_RES( BTN_ASIAN_VERTICAL ) ),
- maOrientHlp ( maCtrlDial, maNfRotate, maCbStacked ),
-
- maFlProperties ( this, SVX_RES( FL_WRAP ) ),
- maBtnWrap ( this, SVX_RES( BTN_WRAP ) ),
- maBtnHyphen ( this, SVX_RES( BTN_HYPH ) ),
- maBtnShrink ( this, SVX_RES( BTN_SHRINK ) ),
- maFtFrameDir ( this, SVX_RES( FT_TEXTFLOW ) ),
- maLbFrameDir ( this, SVX_RES( LB_FRAMEDIR ) )
-{
- InitVsRefEgde();
-
- // windows to be disabled, if stacked text is turned ON
- maOrientHlp.AddDependentWindow( maFtRotate, STATE_CHECK );
- maOrientHlp.AddDependentWindow( maFtRefEdge, STATE_CHECK );
- maOrientHlp.AddDependentWindow( maVsRefEdge, STATE_CHECK );
- // windows to be disabled, if stacked text is turned OFF
- maOrientHlp.AddDependentWindow( maCbAsianMode, STATE_NOCHECK );
-
- Link aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl );
-
- maLbHorAlign.SetSelectHdl( aLink );
- maBtnWrap.SetClickHdl( aLink );
-
- // Asian vertical mode
- maCbAsianMode.Show( SvtCJKOptions().IsVerticalTextEnabled() );
-
- // CTL frame direction
- maLbFrameDir.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP );
- maLbFrameDir.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP );
- maLbFrameDir.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT );
- if( !SvtLanguageOptions().IsCTLFontEnabled() )
- {
- maFtFrameDir.Hide();
- maLbFrameDir.Hide();
- }
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- FreeResource();
-
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, maFtHorAlign, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new HorJustConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, maLbHorAlign, s_pHorJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_INDENT, maFtIndent, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::UInt16MetricConnection( SID_ATTR_ALIGN_INDENT, maEdIndent, FUNIT_TWIP, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_VER_JUSTIFY, maFtVerAlign, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new VerJustConnection( SID_ATTR_ALIGN_VER_JUSTIFY, maLbVerAlign, s_pVerJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new DialControlConnection( SID_ATTR_ALIGN_DEGREES, maCtrlDial, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_DEGREES, maFtRotate, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_LOCKPOS, maFtRefEdge, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new RotateModeConnection( SID_ATTR_ALIGN_LOCKPOS, maVsRefEdge, s_pRotateModeMap, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new OrientStackedConnection( SID_ATTR_ALIGN_STACKED, maOrientHlp ) );
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_STACKED, maCbStacked, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_ASIANVERTICAL, maCbAsianMode, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_LINEBREAK, maBtnWrap, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_HYPHENATION, maBtnHyphen, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_SHRINKTOFIT, maBtnShrink, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_FRAMEDIRECTION, maFtFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) );
- AddItemConnection( new FrameDirListBoxConnection( SID_ATTR_FRAMEDIRECTION, maLbFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) );
-}
-
-AlignmentTabPage::~AlignmentTabPage()
-{
-}
-
-SfxTabPage* AlignmentTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new AlignmentTabPage( pParent, rAttrSet );
-}
-
-USHORT* AlignmentTabPage::GetRanges()
-{
- return s_pRanges;
-}
-
-void AlignmentTabPage::Reset( const SfxItemSet& rCoreAttrs )
-{
- SfxTabPage::Reset( rCoreAttrs );
- UpdateEnableControls();
-}
-
-int AlignmentTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-void AlignmentTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxTabPage::DataChanged( rDCEvt );
- if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- svt::OLocalResourceAccess aLocalResAcc( SVX_RES( RID_SVXPAGE_ALIGNMENT ), RSC_TABPAGE );
- InitVsRefEgde();
- }
-}
-
-void AlignmentTabPage::InitVsRefEgde()
-{
- // remember selection - is deleted in call to ValueSet::Clear()
- USHORT nSel = maVsRefEdge.GetSelectItemId();
-
- ResId aResId( GetSettings().GetStyleSettings().GetHighContrastMode() ? IL_LOCK_BMPS_HC : IL_LOCK_BMPS, DIALOG_MGR() );
- ImageList aImageList( aResId );
- Size aItemSize( aImageList.GetImage( IID_BOTTOMLOCK ).GetSizePixel() );
-
- maVsRefEdge.Clear();
- maVsRefEdge.SetStyle( maVsRefEdge.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
-
- maVsRefEdge.SetColCount( 3 );
- maVsRefEdge.InsertItem( IID_BOTTOMLOCK, aImageList.GetImage( IID_BOTTOMLOCK ), String( SVX_RES( STR_BOTTOMLOCK ) ) );
- maVsRefEdge.InsertItem( IID_TOPLOCK, aImageList.GetImage( IID_TOPLOCK ), String( SVX_RES( STR_TOPLOCK ) ) );
- maVsRefEdge.InsertItem( IID_CELLLOCK, aImageList.GetImage( IID_CELLLOCK ), String( SVX_RES( STR_CELLLOCK ) ) );
-
- maVsRefEdge.SetSizePixel( maVsRefEdge.CalcWindowSizePixel( aItemSize ) );
-
- maVsRefEdge.SelectItem( nSel );
-}
-
-void AlignmentTabPage::UpdateEnableControls()
-{
- USHORT nHorAlign = maLbHorAlign.GetSelectEntryPos();
- bool bHorLeft = (nHorAlign == ALIGNDLG_HORALIGN_LEFT);
- bool bHorBlock = (nHorAlign == ALIGNDLG_HORALIGN_BLOCK);
- bool bHorFill = (nHorAlign == ALIGNDLG_HORALIGN_FILL);
-
- // indent edit field only for left alignment
- maFtIndent.Enable( bHorLeft );
- maEdIndent.Enable( bHorLeft );
-
- // rotation/stacked disabled for fill alignment
- maOrientHlp.Enable( !bHorFill );
-
- // hyphenation only for automatic line breaks or for block alignment
- maBtnHyphen.Enable( maBtnWrap.IsChecked() || bHorBlock );
-
- // shrink only without automatic line break, and not for block and fill
- maBtnShrink.Enable( (maBtnWrap.GetState() == STATE_NOCHECK) && !bHorBlock && !bHorFill );
-
- // visibility of fixed lines
- maFlAlignment.Show( maLbHorAlign.IsVisible() || maEdIndent.IsVisible() || maLbVerAlign.IsVisible() );
- maFlOrient.Show( maCtrlDial.IsVisible() || maVsRefEdge.IsVisible() || maCbStacked.IsVisible() || maCbAsianMode.IsVisible() );
- maFlProperties.Show( maBtnWrap.IsVisible() || maBtnHyphen.IsVisible() || maBtnShrink.IsVisible() || maLbFrameDir.IsVisible() );
-}
-
-IMPL_LINK( AlignmentTabPage, UpdateEnableHdl, void*, EMPTYARG )
-{
- UpdateEnableControls();
- return 0;
-}
-
-// ============================================================================
-
-} // namespace svx
-
diff --git a/svx/source/cui/align.hrc b/svx/source/cui/align.hrc
deleted file mode 100644
index 0eb5bf29f1..0000000000
--- a/svx/source/cui/align.hrc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: align.hrc,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_ALIGN_HRC
-#define _SVX_ALIGN_HRC
-
-// defines ------------------------------------------------------------------
-
-// resource id's
-#define FL_ALIGNMENT 10
-#define FT_HORALIGN 11
-#define LB_HORALIGN 12
-#define FT_INDENT 13
-#define ED_INDENT 14
-#define FT_VERALIGN 15
-#define LB_VERALIGN 16
-
-#define FL_ORIENTATION 20
-#define BTN_TXTSTACKED 21
-#define CTR_DIAL 22
-#define FT_DEGREES 23
-#define NF_DEGREES 24
-#define FT_BORDER_LOCK 25
-#define CTR_BORDER_LOCK 26
-#define BTN_ASIAN_VERTICAL 27
-
-#define FL_WRAP 40
-#define BTN_WRAP 41
-#define BTN_HYPH 42
-#define FT_TEXTFLOW 43
-#define LB_FRAMEDIR 44
-#define BTN_SHRINK 45
-
-//#define ED_INDENT1 100
-
-// list box indexes
-#define ALIGNDLG_HORALIGN_STD 0
-#define ALIGNDLG_HORALIGN_LEFT 1
-#define ALIGNDLG_HORALIGN_CENTER 2
-#define ALIGNDLG_HORALIGN_RIGHT 3
-#define ALIGNDLG_HORALIGN_BLOCK 4
-#define ALIGNDLG_HORALIGN_FILL 5
-
-#define ALIGNDLG_VERALIGN_STD 0
-#define ALIGNDLG_VERALIGN_TOP 1
-#define ALIGNDLG_VERALIGN_MID 2
-#define ALIGNDLG_VERALIGN_BOTTOM 3
-
-// image list for ValueSets:
-#define IL_LOCK_BMPS 1100
-#define IL_LOCK_BMPS_HC 1101
-#define IID_BOTTOMLOCK 1
-#define IID_TOPLOCK 2
-#define IID_CELLLOCK 3
-
-#define STR_BOTTOMLOCK 1
-#define STR_TOPLOCK 2
-#define STR_CELLLOCK 3
-
-#endif
-
diff --git a/svx/source/cui/align.hxx b/svx/source/cui/align.hxx
deleted file mode 100644
index 4d93e16872..0000000000
--- a/svx/source/cui/align.hxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: align.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_ALIGN_HXX
-#define _SVX_ALIGN_HXX
-
-// include ---------------------------------------------------------------
-
-
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
-#include <vcl/imagebtn.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#include <sfx2/tabdlg.hxx>
-#include <svtools/valueset.hxx>
-#include "dialcontrol.hxx"
-#include "wrapfield.hxx"
-#include "orienthelper.hxx"
-#include <svx/frmdirlbox.hxx>
-
-namespace svx {
-
-// ============================================================================
-
-class AlignmentTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
-public:
- virtual ~AlignmentTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- static USHORT* GetRanges();
-
- virtual void Reset( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-private:
- explicit AlignmentTabPage( Window* pParent, const SfxItemSet& rCoreSet );
-
- void InitVsRefEgde();
- void UpdateEnableControls();
-
- DECL_LINK( UpdateEnableHdl, void* );
-
-private:
- FixedLine maFlAlignment;
- FixedText maFtHorAlign;
- ListBox maLbHorAlign;
- FixedText maFtIndent;
- MetricField maEdIndent;
- FixedText maFtVerAlign;
- ListBox maLbVerAlign;
-
- FixedLine maFlOrient;
- DialControl maCtrlDial;
- FixedText maFtRotate;
- WrapField maNfRotate;
- FixedText maFtRefEdge;
- ValueSet maVsRefEdge;
- TriStateBox maCbStacked;
- TriStateBox maCbAsianMode;
- OrientationHelper maOrientHlp;
-
- FixedLine maFlProperties;
- TriStateBox maBtnWrap;
- TriStateBox maBtnHyphen;
- TriStateBox maBtnShrink;
- FixedText maFtFrameDir;
- FrameDirListBox maLbFrameDir;
-};
-
-// ============================================================================
-
-} // namespace svx
-
-#endif
-
diff --git a/svx/source/cui/align.src b/svx/source/cui/align.src
deleted file mode 100644
index 9780555d95..0000000000
--- a/svx/source/cui/align.src
+++ /dev/null
@@ -1,251 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: align.src,v $
- * $Revision: 1.55 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "align.hrc"
- // pragma ----------------------------------------------------------------
-
-#define MASKCOLOR \
- MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }
-
- // define ---------------------------------------------------------------
-#define IL_LOCK_MCOL Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }
- // RID_SVXPAGE_ALIGNMENT -------------------------------------------------
-TabPage RID_SVXPAGE_ALIGNMENT
-{
- HelpId = HID_ALIGNMENT ;
- Hide = TRUE ;
- Text [ en-US ] = "Alignment" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- FixedLine FL_ALIGNMENT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Text alignment";
- };
- FixedText FT_HORALIGN
- {
- Pos = MAP_APPFONT ( 12 ,14 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "Hori~zontal";
- };
- ListBox LB_HORALIGN
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 25 );
- Size = MAP_APPFONT ( 100 , 60 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "Default" ; ALIGNDLG_HORALIGN_STD ; > ;
- < "Left" ; ALIGNDLG_HORALIGN_LEFT ; > ;
- < "Center" ; ALIGNDLG_HORALIGN_CENTER ; > ;
- < "Right" ; ALIGNDLG_HORALIGN_RIGHT ; > ;
- < "Justified" ; ALIGNDLG_HORALIGN_BLOCK ; > ;
- < "Filled" ; ALIGNDLG_HORALIGN_FILL ; > ;
- };
- };
- FixedText FT_INDENT
- {
- Pos = MAP_APPFONT ( 118 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 8 ) ;
- Text [ en-US ] = "I~ndent" ;
- };
- MetricField ED_INDENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 118 , 25 ) ;
- Size = MAP_APPFONT ( 36 , 12 ) ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 990 ;
- SpinSize = 10 ;
- Unit = FUNIT_POINT ;
- };
- FixedText FT_VERALIGN
- {
- Pos = MAP_APPFONT ( 160 , 14 ) ;
- Size = MAP_APPFONT ( 88 , 8 ) ;
- Text [ en-US ] = "~Vertical";
- };
- ListBox LB_VERALIGN
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 160 , 25 );
- Size = MAP_APPFONT ( 88 , 60 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "Default" ; ALIGNDLG_VERALIGN_STD ; > ;
- < "Top" ; ALIGNDLG_VERALIGN_TOP ; > ;
- < "Middle" ; ALIGNDLG_VERALIGN_MID ; > ;
- < "Bottom" ; ALIGNDLG_VERALIGN_BOTTOM ; > ;
- };
- };
- FixedLine FL_ORIENTATION
- {
- Pos = MAP_APPFONT ( 6 , 43 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Text orientation" ;
- };
- TriStateBox BTN_TXTSTACKED
- {
- Pos = MAP_APPFONT ( 133 , 54 ) ;
- Size = MAP_APPFONT ( 115 , 10 ) ;
- TabStop = TRUE ;
- Text[ en-US ] = "Ve~rtically stacked";
- };
- Control CTR_DIAL
- {
- HelpId = HID_ALIGNMENT_CTR_DIAL ;
- Pos = MAP_APPFONT ( 12 , 60 ) ;
- Size = MAP_APPFONT ( 42 , 43 ) ;
- Text = "ABCD" ;
- };
- FixedText FT_DEGREES
- {
- Pos = MAP_APPFONT ( 72 , 54 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "De~grees";
- };
- NumericField NF_DEGREES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 65 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 359 ;
- SpinSize = 5 ;
- StrictFormat = TRUE ;
- };
- FixedText FT_BORDER_LOCK
- {
- Pos = MAP_APPFONT ( 72 , 83 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "Re~ference edge" ;
- };
- Control CTR_BORDER_LOCK
- {
- HelpId = HID_ALIGNMENT_CTR_BORDER_LOCK ;
- Pos = MAP_APPFONT ( 72 , 94 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- TabStop = TRUE ;
- };
- TriStateBox BTN_ASIAN_VERTICAL
- {
- Pos = MAP_APPFONT ( 143 , 68 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Asian layout ~mode" ;
- };
- FixedLine FL_WRAP
- {
- Pos = MAP_APPFONT ( 6 , 115 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Properties" ;
- };
- TriStateBox BTN_WRAP
- {
- Pos = MAP_APPFONT ( 12 , 126 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "~Wrap text automatically" ;
- };
- TriStateBox BTN_HYPH
- {
- Pos = MAP_APPFONT ( 22 , 139 ) ;
- Size = MAP_APPFONT ( 226 , 10 ) ;
- Text [ en-US ] = "Hyphenation ~active";
- };
- TriStateBox BTN_SHRINK
- {
- Pos = MAP_APPFONT( 12, 152 );
- Size = MAP_APPFONT( 236, 10 );
- Text [ en-US ] = "~Shrink to fit cell size";
- };
- FixedText FT_TEXTFLOW
- {
- Pos = MAP_APPFONT( 12 , 170 );
- Size = MAP_APPFONT( 64 , 8 );
- Text [ en-US ] = "Te~xt direction";
- };
- ListBox LB_FRAMEDIR
- {
- Pos = MAP_APPFONT( 78 , 168 );
- Size = MAP_APPFONT( 170 , 50 );
- Border = TRUE;
- DropDown = TRUE;
- };
- ImageList IL_LOCK_BMPS
- {
- Prefix = "lo";
- MaskColor = IL_LOCK_MCOL ;
- IdList =
- {
- IID_BOTTOMLOCK ;
- IID_TOPLOCK ;
- IID_CELLLOCK ;
- };
- IdCount = { 3 ; };
- };
- ImageList IL_LOCK_BMPS_HC
- {
- Prefix = "loh";
- MaskColor = IL_LOCK_MCOL ;
- IdList =
- {
- IID_BOTTOMLOCK ;
- IID_TOPLOCK ;
- IID_CELLLOCK ;
- };
- IdCount = { 3 ; };
- };
- String STR_BOTTOMLOCK
- {
- Text [ en-US ] = "Text Extension From Lower Cell Border" ;
- };
- String STR_TOPLOCK
- {
- Text [ en-US ] = "Text Extension From Upper Cell Border" ;
- };
- String STR_CELLLOCK
- {
- Text [ en-US ] = "Text Extension Inside Cell" ;
- };
-};
- // ********************************************************************** EOF
-
diff --git a/svx/source/cui/autocdlg.cxx b/svx/source/cui/autocdlg.cxx
deleted file mode 100644
index 4da7f0d8d8..0000000000
--- a/svx/source/cui/autocdlg.cxx
+++ /dev/null
@@ -1,2780 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: autocdlg.cxx,v $
- * $Revision: 1.25 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#define _SVSTDARR_STRINGSISORTDTOR
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/field.hxx>
-#include <vcl/keycodes.hxx>
-#include <sot/exchange.hxx>
-#include <svtools/transfer.hxx>
-#include <svtools/syslocale.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/viewsh.hxx>
-#include <unotools/charclass.hxx>
-#include <unotools/collatorwrapper.hxx>
-#include <com/sun/star/i18n/CollatorOptions.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <comphelper/processfactory.hxx>
-
-#include <vcl/svapp.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/request.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <svtools/eitem.hxx>
-#include <svtools/languageoptions.hxx>
-#include <svx/SmartTagMgr.hxx>
-#include <com/sun/star/smarttags/XSmartTagRecognizer.hpp>
-#include <com/sun/star/smarttags/XSmartTagAction.hpp>
-
-#define _OFA_AUTOCDLG_CXX
-#include "autocdlg.hxx"
-#include "autocdlg.hrc"
-#include "helpid.hrc"
-#include "acorrcfg.hxx"
-#include <svx/svxacorr.hxx>
-#include "cuicharmap.hxx"
-#include "unolingu.hxx"
-#include <svx/dialmgr.hxx>
-
-static LanguageType eLastDialogLanguage = LANGUAGE_SYSTEM;
-
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star;
-using namespace ::rtl;
-
-static ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& GetProcessFact()
-{
- static ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > xMSF =
- ::comphelper::getProcessServiceFactory();
- return xMSF;
-}
-
-/*-----------------14.10.96 15.47-------------------
-
---------------------------------------------------*/
-
-OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) :
- SfxTabDialog(pParent, SVX_RES( RID_OFA_AUTOCORR_DLG ), _pSet),
- aLanguageFT( this, SVX_RES(FT_LANG )),
- aLanguageLB( this, SVX_RES(LB_LANG ))
-{
- BOOL bShowSWOptions = FALSE;
- BOOL bOpenSmartTagOptions = FALSE;
-
- if ( _pSet )
- {
- SFX_ITEMSET_ARG( _pSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG, FALSE );
- if ( pItem && pItem->GetValue() )
- bShowSWOptions = TRUE;
-
- SFX_ITEMSET_ARG( _pSet, pItem2, SfxBoolItem, SID_OPEN_SMARTTAGOPTIONS, FALSE );
- if ( pItem2 && pItem2->GetValue() )
- bOpenSmartTagOptions = TRUE;
- }
-
- aLanguageFT.SetZOrder(0, WINDOW_ZORDER_FIRST);
- aLanguageLB.SetZOrder(&aLanguageFT, WINDOW_ZORDER_BEHIND);
- aLanguageLB.SetHelpId(HID_AUTOCORR_LANGUAGE);
- FreeResource();
-
- AddTabPage(RID_OFAPAGE_AUTOCORR_OPTIONS, OfaAutocorrOptionsPage::Create, 0);
- AddTabPage(RID_OFAPAGE_AUTOFMT_APPLY, OfaSwAutoFmtOptionsPage::Create, 0);
- AddTabPage(RID_OFAPAGE_AUTOCOMPLETE_OPTIONS, OfaAutoCompleteTabPage::Create, 0);
- AddTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS, OfaSmartTagOptionsTabPage::Create, 0);
-
- if (!bShowSWOptions)
- {
- RemoveTabPage(RID_OFAPAGE_AUTOFMT_APPLY);
- RemoveTabPage(RID_OFAPAGE_AUTOCOMPLETE_OPTIONS);
- RemoveTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS);
- }
- else
- {
- // remove smart tag tab page if no extensions are installed
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
- if ( !pOpt || !pOpt->pSmartTagMgr || 0 == pOpt->pSmartTagMgr->NumberOfRecognizers() )
- RemoveTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS);
-
- RemoveTabPage(RID_OFAPAGE_AUTOCORR_OPTIONS);
- }
-
- AddTabPage(RID_OFAPAGE_AUTOCORR_REPLACE, OfaAutocorrReplacePage::Create, 0);
- AddTabPage(RID_OFAPAGE_AUTOCORR_EXCEPT, OfaAutocorrExceptPage::Create, 0);
- AddTabPage(RID_OFAPAGE_AUTOCORR_QUOTE, OfaQuoteTabPage::Create, 0);
-
- // initialize languages
- //! LANGUAGE_NONE is displayed as '[All]' and the LanguageType
- //! will be set to LANGUAGE_DONTKNOW
- sal_Int16 nLangList = LANG_LIST_WESTERN;
-
- if( SvtLanguageOptions().IsCTLFontEnabled() )
- nLangList |= LANG_LIST_CTL;
- aLanguageLB.SetLanguageList( nLangList, TRUE, TRUE );
- aLanguageLB.SelectLanguage( LANGUAGE_NONE );
- USHORT nPos = aLanguageLB.GetSelectEntryPos();
- DBG_ASSERT( LISTBOX_ENTRY_NOTFOUND != nPos, "listbox entry missing" );
- aLanguageLB.SetEntryData( nPos, (void*)(long) LANGUAGE_DONTKNOW );
-
- // Initialisierung funktionier fuer static nicht unter Linux - deswegen hier
- if( LANGUAGE_SYSTEM == eLastDialogLanguage )
- eLastDialogLanguage = Application::GetSettings().GetLanguage();
-
- LanguageType nSelectLang = LANGUAGE_DONTKNOW;
- nPos = aLanguageLB.GetEntryPos( (void*)(long) eLastDialogLanguage );
- if (LISTBOX_ENTRY_NOTFOUND != nPos)
- nSelectLang = eLastDialogLanguage;
- aLanguageLB.SelectLanguage( nSelectLang );
-
- aLanguageLB.SetSelectHdl(LINK(this, OfaAutoCorrDlg, SelectLanguageHdl));
-
- Size aMinSize(aLanguageFT.CalcMinimumSize());
- //reserve some extra space for CJK accelerators that are possible inserted
- //later (like '(A)')
- aLanguageFT.SetPosSizePixel( 0, 0, aMinSize.Width() + 20, 0, WINDOW_POSSIZE_WIDTH );
-
- if ( bOpenSmartTagOptions )
- SetCurPageId( RID_OFAPAGE_SMARTTAG_OPTIONS );
-}
-/*-----------------16.10.96 14.06-------------------
-
---------------------------------------------------*/
-
-BOOL lcl_FindEntry( ListBox& rLB, const String& rEntry,
- CollatorWrapper& rCmpClass )
-{
- USHORT nCount = rLB.GetEntryCount();
- USHORT nSelPos = rLB.GetSelectEntryPos();
- USHORT i;
- for(i = 0; i < nCount; i++)
- {
- if( 0 == rCmpClass.compareString(rEntry, rLB.GetEntry(i) ))
- {
- rLB.SelectEntryPos(i, TRUE);
- return TRUE;
- }
- }
- if(LISTBOX_ENTRY_NOTFOUND != nSelPos)
- rLB.SelectEntryPos(nSelPos, FALSE);
- return FALSE;
-}
-
-/* -----------------23.11.98 10:46-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox)
-{
- USHORT nPos = pBox->GetSelectEntryPos();
- void* pVoid = pBox->GetEntryData(nPos);
- LanguageType eNewLang = (LanguageType)(long)pVoid;
- //alte Einstellungen speichern und neu fuellen
- if(eNewLang != eLastDialogLanguage)
- {
- USHORT nPageId = GetCurPageId();
- if(RID_OFAPAGE_AUTOCORR_REPLACE == nPageId)
- ((OfaAutocorrReplacePage*)GetTabPage( nPageId ))->SetLanguage(eNewLang);
- else if(RID_OFAPAGE_AUTOCORR_EXCEPT == nPageId)
- ((OfaAutocorrExceptPage*)GetTabPage( nPageId ))->SetLanguage(eNewLang);
- }
- return 0;
-}
-/*-----------------14.10.96 15.57-------------------
-
---------------------------------------------------*/
-
-OfaAutocorrOptionsPage::OfaAutocorrOptionsPage( Window* pParent,
- const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES( RID_OFAPAGE_AUTOCORR_OPTIONS ), rSet),
- aCheckLB (this, SVX_RES(CLB_SETTINGS )),
-
- sInput (SVX_RES(ST_USE_REPLACE )),
- sDoubleCaps (SVX_RES(ST_CPTL_STT_WORD )),
- sStartCap (SVX_RES(ST_CPTL_STT_SENT )),
- sBoldUnderline (SVX_RES(ST_BOLD_UNDER )),
- sURL (SVX_RES(ST_DETECT_URL )),
- sNoDblSpaces (SVX_RES(STR_NO_DBL_SPACES )),
- sHalf (SVX_RES(ST_FRACTION )),
- sDash (SVX_RES(ST_DASH )),
- sFirst (SVX_RES(ST_ORDINAL ))
-{
- FreeResource();
-
- aCheckLB.SetHelpId(HID_OFAPAGE_AUTOCORR_CLB);
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-OfaAutocorrOptionsPage::~OfaAutocorrOptionsPage()
-{
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-SfxTabPage* OfaAutocorrOptionsPage::Create( Window* pParent,
- const SfxItemSet& rSet)
-{
- return new OfaAutocorrOptionsPage(pParent, rSet);
-}
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-BOOL OfaAutocorrOptionsPage::FillItemSet( SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- long nFlags = pAutoCorrect->GetFlags();
-
- USHORT nPos = 0;
- pAutoCorrect->SetAutoCorrFlag(Autocorrect, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(CptlSttWrd, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(CptlSttSntnc, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ChgWeightUnderl, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(SetINetAttr, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ChgOrdinalNumber, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ChgFractionSymbol, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash, aCheckLB.IsChecked(nPos++));
- pAutoCorrect->SetAutoCorrFlag(IngnoreDoubleSpace, aCheckLB.IsChecked(nPos++));
-
- BOOL bReturn = nFlags != pAutoCorrect->GetFlags();
- if(bReturn )
- {
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetModified();
- pCfg->Commit();
- }
- return bReturn;
-}
-
-/* -----------------23.11.98 16:15-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrOptionsPage::ActivatePage( const SfxItemSet& )
-{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(FALSE);
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-void OfaAutocorrOptionsPage::Reset( const SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- const long nFlags = pAutoCorrect->GetFlags();
-
- aCheckLB.SetUpdateMode(FALSE);
- aCheckLB.Clear();
-
- aCheckLB.InsertEntry(sInput);
- aCheckLB.InsertEntry(sDoubleCaps);
- aCheckLB.InsertEntry(sStartCap);
- aCheckLB.InsertEntry(sBoldUnderline);
- aCheckLB.InsertEntry(sURL);
- aCheckLB.InsertEntry(sFirst);
- aCheckLB.InsertEntry(sHalf);
- aCheckLB.InsertEntry(sDash);
- aCheckLB.InsertEntry(sNoDblSpaces);
-
- USHORT nPos = 0;
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & Autocorrect) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CptlSttWrd) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CptlSttSntnc) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgWeightUnderl) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & SetINetAttr) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgOrdinalNumber) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgFractionSymbol) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgToEnEmDash) );
- aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & IngnoreDoubleSpace) );
-
- aCheckLB.SetUpdateMode(TRUE);
-}
-
-/*********************************************************************/
-/* */
-/* Hilfs-struct fuer dUserDaten der Checklistbox */
-/* */
-/*********************************************************************/
-
-struct ImpUserData
-{
- String *pString;
- Font* pFont;
-
- ImpUserData(String* pText, Font* pFnt)
- { pString = pText; pFont = pFnt;}
-};
-
-
-/*********************************************************************/
-/* */
-/* Dialog fuer Prozenteinstellung */
-/* */
-/*********************************************************************/
-
-class OfaAutoFmtPrcntSet : public ModalDialog
-{
- OKButton aOKPB;
- CancelButton aCancelPB;
- FixedLine aPrcntFL;
- MetricField aPrcntMF;
-
- public:
- OfaAutoFmtPrcntSet(Window* pParent) :
- ModalDialog(pParent, SVX_RES(RID_OFADLG_PRCNT_SET)),
- aOKPB(this, SVX_RES(BT_OK)),
- aCancelPB(this, SVX_RES(BT_CANCEL)),
- aPrcntFL(this, SVX_RES(FL_PRCNT)),
- aPrcntMF(this, SVX_RES(ED_RIGHT_MARGIN))
- {
- FreeResource();
- }
- MetricField& GetPrcntFld(){return aPrcntMF;}
-};
-
-
-/*********************************************************************/
-/* */
-/* veraenderter LBoxString */
-/* */
-/*********************************************************************/
-
-class OfaImpBrwString : public SvLBoxString
-{
-public:
-
- OfaImpBrwString( SvLBoxEntry* pEntry, USHORT nFlags,
- const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr){}
-
- virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags,
- SvLBoxEntry* pEntry);
-};
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-
-void __EXPORT OfaImpBrwString::Paint( const Point& rPos, SvLBox& rDev, USHORT /*nFlags*/,
- SvLBoxEntry* pEntry )
-{
- rDev.DrawText( rPos, GetText() );
- if(pEntry->GetUserData())
- {
- ImpUserData* pUserData = (ImpUserData* )pEntry->GetUserData();
- Point aNewPos(rPos);
- aNewPos.X() += rDev.GetTextWidth(GetText());
- Font aOldFont( rDev.GetFont());
- Font aFont( aOldFont );
- if(pUserData->pFont)
- {
- aFont = *pUserData->pFont;
- aFont.SetColor(aOldFont.GetColor());
- aFont.SetSize(aOldFont.GetSize());
- }
- aFont.SetWeight( WEIGHT_BOLD );
-
- BOOL bFett = TRUE;
- USHORT nPos = 0;
- do {
- String sTxt( pUserData->pString->GetToken( 0, 1, nPos ));
-
- if( bFett )
- rDev.SetFont( aFont );
-
- rDev.DrawText( aNewPos, sTxt );
-
- if( STRING_NOTFOUND != nPos )
- aNewPos.X() += rDev.GetTextWidth( sTxt );
-
- if( bFett )
- rDev.SetFont( aOldFont );
-
- bFett = !bFett;
- } while( STRING_NOTFOUND != nPos );
- }
-}
-
-/*********************************************************************/
-/* */
-/* TabPage Autoformat anwenden */
-/* */
-/*********************************************************************/
-
-#define CBCOL_FIRST 0
-#define CBCOL_SECOND 1
-#define CBCOL_BOTH 2
-
-enum OfaAutoFmtOptions
-{
- USE_REPLACE_TABLE,
- CORR_UPPER,
- BEGIN_UPPER,
- BOLD_UNDERLINE,
- DETECT_URL,
- REPLACE_1ST,
- REPLACE_HALF,
- REPLACE_DASHES,
- DEL_SPACES_AT_STT_END,
- DEL_SPACES_BETWEEN_LINES,
- IGNORE_DBLSPACE,
- APPLY_NUMBERING,
- INSERT_BORDER,
- CREATE_TABLE,
- REPLACE_STYLES,
- DEL_EMPTY_NODE,
- REPLACE_USER_COLL,
- REPLACE_BULLETS,
- REPLACE_QUOTATION,
- MERGE_SINGLE_LINE_PARA
-};
-
-OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( Window* pParent,
- const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES(RID_OFAPAGE_AUTOFMT_APPLY), rSet),
- aCheckLB (this, SVX_RES(CLB_SETTINGS)),
- aEditPB (this, SVX_RES(PB_EDIT)),
- aHeader1Expl (this, SVX_RES(FT_HEADER1_EXPLANATION)),
- aHeader2Expl (this, SVX_RES(FT_HEADER2_EXPLANATION)),
- sHeader1 (SVX_RES( STR_HEADER1 )),
- sHeader2 (SVX_RES( STR_HEADER2 )),
- sDeleteEmptyPara (SVX_RES( ST_DEL_EMPTY_PARA)),
- sUseReplaceTbl (SVX_RES( ST_USE_REPLACE )),
- sCptlSttWord (SVX_RES( ST_CPTL_STT_WORD)),
- sCptlSttSent (SVX_RES( ST_CPTL_STT_SENT)),
- sTypo (SVX_RES( ST_TYPO )),
- sUserStyle (SVX_RES( ST_USER_STYLE )),
- sBullet (SVX_RES( ST_BULLET )),
- sBoldUnder (SVX_RES( ST_BOLD_UNDER )),
- sNoDblSpaces (SVX_RES( STR_NO_DBL_SPACES)),
- sFraction (SVX_RES( ST_FRACTION )),
- sDetectURL (SVX_RES( ST_DETECT_URL )),
- sDash (SVX_RES( ST_DASH )),
- sOrdinal (SVX_RES( ST_ORDINAL )),
- sRightMargin (SVX_RES( ST_RIGHT_MARGIN )),
- sNum (SVX_RES( STR_NUM )),
- sBorder (SVX_RES( STR_BORDER )),
- sTable (SVX_RES( STR_TABLE )),
- sReplaceTemplates (SVX_RES( STR_REPLACE_TEMPLATES)),
- sDelSpaceAtSttEnd (SVX_RES( STR_DEL_SPACES_AT_STT_END)),
- sDelSpaceBetweenLines(SVX_RES(STR_DEL_SPACES_BETWEEN_LINES)),
-
- nPercent ( 50 ),
- pCheckButtonData( NULL )
-
-{
- FreeResource();
-
- //typ. Anfuehrungszeichen einsetzen
- SvtSysLocale aSysLcl;
- const LocaleDataWrapper& rLcl = aSysLcl.GetLocaleData();
- sTypo.SearchAndReplace( String::CreateFromAscii("%1"),
- rLcl.getDoubleQuotationMarkStart());
- sTypo.SearchAndReplace( String::CreateFromAscii("%2"),
- rLcl.getDoubleQuotationMarkEnd());
-
- aCheckLB.SetHelpId(HID_OFAPAGE_AUTOFORMAT_CLB);
- aCheckLB.SetWindowBits(WB_HSCROLL| WB_VSCROLL);
-
- aCheckLB.SetSelectHdl(LINK(this, OfaSwAutoFmtOptionsPage, SelectHdl));
- aCheckLB.SetDoubleClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, EditHdl));
-
- static long aStaticTabs[]=
- {
- 3, 0, 20, 40
- };
-
- aCheckLB.SvxSimpleTable::SetTabs(aStaticTabs);
- String sHeader( sHeader1 );
- sHeader += '\t';
- sHeader += sHeader2;
- sHeader += '\t';
- aCheckLB.InsertHeaderEntry( sHeader, HEADERBAR_APPEND,
- HIB_CENTER | HIB_VCENTER | HIB_FIXEDPOS | HIB_FIXED);
-
- aEditPB.SetClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, EditHdl));
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-SvLBoxEntry* OfaSwAutoFmtOptionsPage::CreateEntry(String& rTxt, USHORT nCol)
-{
- SvLBoxEntry* pEntry = new SvLBoxEntry;
-
- if ( !pCheckButtonData )
- {
- pCheckButtonData = new SvLBoxButtonData( &aCheckLB );
- aCheckLB.SetCheckButtonData( pCheckButtonData );
- }
-
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff!
-
- String sEmpty;
- if (nCol == CBCOL_SECOND)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte
- else
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
-
- if (nCol == CBCOL_FIRST)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte
- else
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
- pEntry->AddItem( new OfaImpBrwString( pEntry, 0, rTxt ) );
-
- return pEntry;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-
-__EXPORT OfaSwAutoFmtOptionsPage::~OfaSwAutoFmtOptionsPage()
-{
- delete (ImpUserData*) aCheckLB.GetUserData( REPLACE_BULLETS );
- delete (ImpUserData*) aCheckLB.GetUserData( APPLY_NUMBERING );
- delete (ImpUserData*) aCheckLB.GetUserData( MERGE_SINGLE_LINE_PARA );
- delete pCheckButtonData;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-SfxTabPage* __EXPORT OfaSwAutoFmtOptionsPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new OfaSwAutoFmtOptionsPage(pParent, rAttrSet);
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-BOOL OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet& )
-{
- BOOL bModified = FALSE;
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
- long nFlags = pAutoCorrect->GetFlags();
-
- BOOL bCheck = aCheckLB.IsChecked(USE_REPLACE_TABLE, CBCOL_FIRST);
- bModified |= pOpt->bAutoCorrect != bCheck;
- pOpt->bAutoCorrect = bCheck;
- pAutoCorrect->SetAutoCorrFlag(Autocorrect,
- aCheckLB.IsChecked(USE_REPLACE_TABLE, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(CORR_UPPER, CBCOL_FIRST);
- bModified |= pOpt->bCptlSttWrd != bCheck;
- pOpt->bCptlSttWrd = bCheck;
- pAutoCorrect->SetAutoCorrFlag(CptlSttWrd,
- aCheckLB.IsChecked(CORR_UPPER, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(BEGIN_UPPER, CBCOL_FIRST);
- bModified |= pOpt->bCptlSttSntnc != bCheck;
- pOpt->bCptlSttSntnc = bCheck;
- pAutoCorrect->SetAutoCorrFlag(CptlSttSntnc,
- aCheckLB.IsChecked(BEGIN_UPPER, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(BOLD_UNDERLINE, CBCOL_FIRST);
- bModified |= pOpt->bChgWeightUnderl != bCheck;
- pOpt->bChgWeightUnderl = bCheck;
- pAutoCorrect->SetAutoCorrFlag(ChgWeightUnderl,
- aCheckLB.IsChecked(BOLD_UNDERLINE, CBCOL_SECOND));
-
- pAutoCorrect->SetAutoCorrFlag(IngnoreDoubleSpace,
- aCheckLB.IsChecked(IGNORE_DBLSPACE, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(DETECT_URL, CBCOL_FIRST);
- bModified |= pOpt->bSetINetAttr != bCheck;
- pOpt->bSetINetAttr = bCheck;
- pAutoCorrect->SetAutoCorrFlag(SetINetAttr,
- aCheckLB.IsChecked(DETECT_URL, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(REPLACE_1ST, CBCOL_FIRST);
- bModified |= pOpt->bChgOrdinalNumber != bCheck;
- pOpt->bChgOrdinalNumber = bCheck;
- pAutoCorrect->SetAutoCorrFlag(ChgOrdinalNumber,
- aCheckLB.IsChecked(REPLACE_1ST, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(DEL_EMPTY_NODE, CBCOL_FIRST);
- bModified |= pOpt->bDelEmptyNode != bCheck;
- pOpt->bDelEmptyNode = bCheck;
-
- bCheck = aCheckLB.IsChecked(REPLACE_QUOTATION, CBCOL_FIRST);
- bModified |= pOpt->bReplaceQuote != bCheck;
- pOpt->bReplaceQuote = bCheck;
-
- bCheck = aCheckLB.IsChecked(REPLACE_USER_COLL, CBCOL_FIRST);
- bModified |= pOpt->bChgUserColl != bCheck;
- pOpt->bChgUserColl = bCheck;
-
- bCheck = aCheckLB.IsChecked(REPLACE_BULLETS, CBCOL_FIRST);
- bModified |= pOpt->bChgEnumNum != bCheck;
- pOpt->bChgEnumNum = bCheck;
- bModified |= aBulletFont != pOpt->aBulletFont;
- pOpt->aBulletFont = aBulletFont;
- bModified |= String(pOpt->cBullet) != sBulletChar;
- pOpt->cBullet = sBulletChar.GetChar(0);
-
- bModified |= aByInputBulletFont != pOpt->aByInputBulletFont;
- bModified |= String(pOpt->cByInputBullet) != sByInputBulletChar;
- pOpt->aByInputBulletFont = aByInputBulletFont;
- pOpt->cByInputBullet = sByInputBulletChar.GetChar(0);
-
- bCheck = aCheckLB.IsChecked(MERGE_SINGLE_LINE_PARA, CBCOL_FIRST);
- bModified |= pOpt->bRightMargin != bCheck;
- pOpt->bRightMargin = bCheck;
- bModified |= nPercent != pOpt->nRightMargin;
- pOpt->nRightMargin = (BYTE)nPercent;
-
- bCheck = aCheckLB.IsChecked(APPLY_NUMBERING, CBCOL_SECOND);
- bModified |= pOpt->bSetNumRule != bCheck;
- pOpt->bSetNumRule = bCheck;
-
- bCheck = aCheckLB.IsChecked(INSERT_BORDER, CBCOL_SECOND);
- bModified |= pOpt->bSetBorder != bCheck;
- pOpt->bSetBorder = bCheck;
-
- bCheck = aCheckLB.IsChecked(CREATE_TABLE, CBCOL_SECOND);
- bModified |= pOpt->bCreateTable != bCheck;
- pOpt->bCreateTable = bCheck;
-
- bCheck = aCheckLB.IsChecked(REPLACE_STYLES, CBCOL_SECOND);
- bModified |= pOpt->bReplaceStyles != bCheck;
- pOpt->bReplaceStyles = bCheck;
-
- bCheck = aCheckLB.IsChecked(REPLACE_HALF, CBCOL_FIRST);
- bModified |= pOpt->bChgFracionSymbol != bCheck;
- pOpt->bChgFracionSymbol = bCheck;
- pAutoCorrect->SetAutoCorrFlag(ChgFractionSymbol,
- aCheckLB.IsChecked(REPLACE_HALF, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(REPLACE_DASHES, CBCOL_FIRST);
- bModified |= pOpt->bChgToEnEmDash != bCheck;
- pOpt->bChgToEnEmDash = bCheck;
- pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash,
- aCheckLB.IsChecked(REPLACE_DASHES, CBCOL_SECOND));
-
- bCheck = aCheckLB.IsChecked(DEL_SPACES_AT_STT_END, CBCOL_FIRST);
- bModified |= pOpt->bAFmtDelSpacesAtSttEnd != bCheck;
- pOpt->bAFmtDelSpacesAtSttEnd = bCheck;
- bCheck = aCheckLB.IsChecked(DEL_SPACES_AT_STT_END, CBCOL_SECOND);
- bModified |= pOpt->bAFmtByInpDelSpacesAtSttEnd != bCheck;
- pOpt->bAFmtByInpDelSpacesAtSttEnd = bCheck;
-
- bCheck = aCheckLB.IsChecked(DEL_SPACES_BETWEEN_LINES, CBCOL_FIRST);
- bModified |= pOpt->bAFmtDelSpacesBetweenLines != bCheck;
- pOpt->bAFmtDelSpacesBetweenLines = bCheck;
- bCheck = aCheckLB.IsChecked(DEL_SPACES_BETWEEN_LINES, CBCOL_SECOND);
- bModified |= pOpt->bAFmtByInpDelSpacesBetweenLines != bCheck;
- pOpt->bAFmtByInpDelSpacesBetweenLines = bCheck;
-
- if(bModified || nFlags != pAutoCorrect->GetFlags())
- {
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetModified();
- pCfg->Commit();
- }
-
- return TRUE;
-}
-
-/* -----------------23.11.98 16:15-------------------
- *
- * --------------------------------------------------*/
-void OfaSwAutoFmtOptionsPage::ActivatePage( const SfxItemSet& )
-{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(FALSE);
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-
-void OfaSwAutoFmtOptionsPage::Reset( const SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
- const long nFlags = pAutoCorrect->GetFlags();
-
- aCheckLB.SetUpdateMode(FALSE);
- aCheckLB.Clear();
-
- // Die folgenden Eintraege muessen in der selben Reihenfolge, wie im
- // OfaAutoFmtOptions-enum eingefuegt werden!
- aCheckLB.GetModel()->Insert(CreateEntry(sUseReplaceTbl, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sCptlSttWord, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sCptlSttSent, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sBoldUnder, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sDetectURL, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sOrdinal, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sFraction, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sDash, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sDelSpaceAtSttEnd, CBCOL_BOTH ));
- aCheckLB.GetModel()->Insert(CreateEntry(sDelSpaceBetweenLines, CBCOL_BOTH ));
-
- aCheckLB.GetModel()->Insert(CreateEntry(sNoDblSpaces, CBCOL_SECOND));
- aCheckLB.GetModel()->Insert(CreateEntry(sNum, CBCOL_SECOND));
- aCheckLB.GetModel()->Insert(CreateEntry(sBorder, CBCOL_SECOND));
- aCheckLB.GetModel()->Insert(CreateEntry(sTable, CBCOL_SECOND));
- aCheckLB.GetModel()->Insert(CreateEntry(sReplaceTemplates, CBCOL_SECOND));
- aCheckLB.GetModel()->Insert(CreateEntry(sDeleteEmptyPara, CBCOL_FIRST ));
- aCheckLB.GetModel()->Insert(CreateEntry(sUserStyle, CBCOL_FIRST ));
- aCheckLB.GetModel()->Insert(CreateEntry(sBullet, CBCOL_FIRST ));
- aCheckLB.GetModel()->Insert(CreateEntry(sTypo, CBCOL_FIRST ));
- aCheckLB.GetModel()->Insert(CreateEntry(sRightMargin, CBCOL_FIRST ));
-
- aCheckLB.CheckEntryPos( USE_REPLACE_TABLE, CBCOL_FIRST, pOpt->bAutoCorrect );
- aCheckLB.CheckEntryPos( USE_REPLACE_TABLE, CBCOL_SECOND, 0 != (nFlags & Autocorrect));
- aCheckLB.CheckEntryPos( CORR_UPPER, CBCOL_FIRST, pOpt->bCptlSttWrd );
- aCheckLB.CheckEntryPos( CORR_UPPER, CBCOL_SECOND, 0 != (nFlags & CptlSttWrd) );
- aCheckLB.CheckEntryPos( BEGIN_UPPER, CBCOL_FIRST, pOpt->bCptlSttSntnc );
- aCheckLB.CheckEntryPos( BEGIN_UPPER, CBCOL_SECOND, 0 != (nFlags & CptlSttSntnc) );
- aCheckLB.CheckEntryPos( BOLD_UNDERLINE, CBCOL_FIRST, pOpt->bChgWeightUnderl );
- aCheckLB.CheckEntryPos( BOLD_UNDERLINE, CBCOL_SECOND, 0 != (nFlags & ChgWeightUnderl) );
- aCheckLB.CheckEntryPos( IGNORE_DBLSPACE, CBCOL_SECOND, 0 != (nFlags & IngnoreDoubleSpace) );
- aCheckLB.CheckEntryPos( DETECT_URL, CBCOL_FIRST, pOpt->bSetINetAttr );
- aCheckLB.CheckEntryPos( DETECT_URL, CBCOL_SECOND, 0 != (nFlags & SetINetAttr) );
- aCheckLB.CheckEntryPos( REPLACE_1ST, CBCOL_FIRST, pOpt->bChgOrdinalNumber );
- aCheckLB.CheckEntryPos( REPLACE_1ST, CBCOL_SECOND, 0 != (nFlags & ChgOrdinalNumber) );
- aCheckLB.CheckEntryPos( REPLACE_HALF, CBCOL_FIRST, pOpt->bChgFracionSymbol );
- aCheckLB.CheckEntryPos( REPLACE_HALF, CBCOL_SECOND, 0 != (nFlags & ChgFractionSymbol) );
- aCheckLB.CheckEntryPos( REPLACE_DASHES, CBCOL_FIRST, pOpt->bChgToEnEmDash );
- aCheckLB.CheckEntryPos( REPLACE_DASHES, CBCOL_SECOND, 0 != (nFlags & ChgToEnEmDash) );
- aCheckLB.CheckEntryPos( DEL_SPACES_AT_STT_END, CBCOL_FIRST, pOpt->bAFmtDelSpacesAtSttEnd );
- aCheckLB.CheckEntryPos( DEL_SPACES_AT_STT_END, CBCOL_SECOND, pOpt->bAFmtByInpDelSpacesAtSttEnd );
- aCheckLB.CheckEntryPos( DEL_SPACES_BETWEEN_LINES, CBCOL_FIRST, pOpt->bAFmtDelSpacesBetweenLines );
- aCheckLB.CheckEntryPos( DEL_SPACES_BETWEEN_LINES, CBCOL_SECOND, pOpt->bAFmtByInpDelSpacesBetweenLines );
- aCheckLB.CheckEntryPos( DEL_EMPTY_NODE, CBCOL_FIRST, pOpt->bDelEmptyNode );
- aCheckLB.CheckEntryPos( REPLACE_QUOTATION, CBCOL_FIRST, pOpt->bReplaceQuote );
- aCheckLB.CheckEntryPos( REPLACE_USER_COLL, CBCOL_FIRST, pOpt->bChgUserColl );
- aCheckLB.CheckEntryPos( REPLACE_BULLETS, CBCOL_FIRST, pOpt->bChgEnumNum );
-
- aBulletFont = pOpt->aBulletFont;
- sBulletChar = pOpt->cBullet;
- ImpUserData* pUserData = new ImpUserData(&sBulletChar, &aBulletFont);
- aCheckLB.SetUserData( REPLACE_BULLETS, pUserData );
-
- nPercent = pOpt->nRightMargin;
- sMargin = ' ';
- sMargin += String::CreateFromInt32( nPercent );
- sMargin += '%';
- pUserData = new ImpUserData(&sMargin, 0);
- aCheckLB.SetUserData( MERGE_SINGLE_LINE_PARA, pUserData );
-
- aCheckLB.CheckEntryPos( APPLY_NUMBERING, CBCOL_SECOND, pOpt->bSetNumRule );
-
- aByInputBulletFont = pOpt->aByInputBulletFont;
- sByInputBulletChar = pOpt->cByInputBullet;
- ImpUserData* pUserData2 = new ImpUserData(&sByInputBulletChar, &aByInputBulletFont);
- aCheckLB.SetUserData( APPLY_NUMBERING , pUserData2 );
-
- aCheckLB.CheckEntryPos( MERGE_SINGLE_LINE_PARA, CBCOL_FIRST, pOpt->bRightMargin );
- aCheckLB.CheckEntryPos( INSERT_BORDER, CBCOL_SECOND, pOpt->bSetBorder );
- aCheckLB.CheckEntryPos( CREATE_TABLE, CBCOL_SECOND, pOpt->bCreateTable );
- aCheckLB.CheckEntryPos( REPLACE_STYLES, CBCOL_SECOND, pOpt->bReplaceStyles );
-
- aCheckLB.SetUpdateMode(TRUE);
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-IMPL_LINK(OfaSwAutoFmtOptionsPage, SelectHdl, OfaACorrCheckListBox*, pBox)
-{
- aEditPB.Enable(0 != pBox->FirstSelected()->GetUserData());
- return 0;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-IMPL_LINK(OfaSwAutoFmtOptionsPage, EditHdl, PushButton*, EMPTYARG)
-{
- ULONG nSelEntryPos = aCheckLB.GetSelectEntryPos();
- if( nSelEntryPos == REPLACE_BULLETS ||
- nSelEntryPos == APPLY_NUMBERING)
- {
- SvxCharacterMap *pMapDlg = new SvxCharacterMap(this);
- ImpUserData* pUserData = (ImpUserData*)aCheckLB.FirstSelected()->GetUserData();
- pMapDlg->SetCharFont(*pUserData->pFont);
- pMapDlg->SetChar( pUserData->pString->GetChar(0) );
- if(RET_OK == pMapDlg->Execute())
- {
- Font aFont(pMapDlg->GetCharFont());
- *pUserData->pFont = aFont;
- sal_UCS4 aChar = pMapDlg->GetChar();
- // using the UCS4 constructor
- rtl::OUString aOUStr( &aChar, 1 );
- *pUserData->pString = aOUStr;
- }
- delete pMapDlg;
- }
- else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos )
- {
- // Dialog fuer Prozenteinstellung
- OfaAutoFmtPrcntSet aDlg(this);
- aDlg.GetPrcntFld().SetValue(nPercent);
- if(RET_OK == aDlg.Execute())
- {
- nPercent = (USHORT)aDlg.GetPrcntFld().GetValue();
- sMargin = ' ';
- sMargin += String::CreateFromInt32( nPercent );
- sMargin += '%';
- }
- }
- aCheckLB.Invalidate();
- return 0;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void OfaACorrCheckListBox::SetTabs()
-{
- SvxSimpleTable::SetTabs();
- USHORT nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
-
- if( aTabs.Count() > 1 )
- {
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(1);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
- }
- if( aTabs.Count() > 2 )
- {
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(2);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
- }
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void OfaACorrCheckListBox::CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked)
-{
- if ( nPos < GetEntryCount() )
- SetCheckButtonState(
- GetEntry(nPos),
- nCol,
- bChecked ? SvButtonState( SV_BUTTON_CHECKED ) :
- SvButtonState( SV_BUTTON_UNCHECKED ) );
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-BOOL OfaACorrCheckListBox::IsChecked(ULONG nPos, USHORT nCol)
-{
- return GetCheckButtonState( GetEntry(nPos), nCol ) == SV_BUTTON_CHECKED;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void OfaACorrCheckListBox::SetCheckButtonState( SvLBoxEntry* pEntry, USHORT nCol, SvButtonState eState)
-{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
-
- DBG_ASSERT(pItem,"SetCheckButton:Item not found");
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- switch( eState )
- {
- case SV_BUTTON_CHECKED:
- pItem->SetStateChecked();
- break;
-
- case SV_BUTTON_UNCHECKED:
- pItem->SetStateUnchecked();
- break;
-
- case SV_BUTTON_TRISTATE:
- pItem->SetStateTristate();
- break;
- }
- InvalidateEntry( pEntry );
- }
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-SvButtonState OfaACorrCheckListBox::GetCheckButtonState( SvLBoxEntry* pEntry, USHORT nCol ) const
-{
- SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
- DBG_ASSERT(pItem,"GetChButnState:Item not found");
-
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- USHORT nButtonFlags = pItem->GetButtonFlags();
- eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
- }
-
- return eState;
-}
-
-void OfaACorrCheckListBox::HBarClick()
-{
- // Sortierung durch diese Ueberladung abgeklemmt
-}
-/* -----------------------------22.05.2002 11:06------------------------------
-
- ---------------------------------------------------------------------------*/
-void OfaACorrCheckListBox::KeyInput( const KeyEvent& rKEvt )
-{
- if(!rKEvt.GetKeyCode().GetModifier() &&
- KEY_SPACE == rKEvt.GetKeyCode().GetCode())
- {
- ULONG nSelPos = GetSelectEntryPos();
- USHORT nCol = GetCurrentTabPos() - 1;
- if ( nCol < 2 )
- {
- CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) );
- CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)GetEntry( nSelPos ) );
- }
- else
- {
- USHORT nCheck = IsChecked(nSelPos, 1) ? 1 : 0;
- if(IsChecked(nSelPos, 0))
- nCheck += 2;
- nCheck--;
- nCheck &= 3;
- CheckEntryPos(nSelPos, 1, 0 != (nCheck & 1));
- CheckEntryPos(nSelPos, 0, 0 != (nCheck & 2));
- }
- }
- else
- SvxSimpleTable::KeyInput(rKEvt);
-}
-/* -----------------19.11.98 15:57-------------------
- *
- * --------------------------------------------------*/
-struct DoubleString
-{
- String sShort;
- String sLong;
- void* pUserData; // CheckBox -> form. Text Bool -> Selektionstext
-};
-typedef DoubleString* DoubleStringPtr;
-SV_DECL_PTRARR_DEL(DoubleStringArray, DoubleStringPtr, 4, 4)
-SV_IMPL_PTRARR(DoubleStringArray, DoubleStringPtr);
-
-/* -----------------19.11.98 16:07-------------------
- *
- * --------------------------------------------------*/
-void lcl_ClearTable(DoubleStringTable& rTable)
-{
- DoubleStringArrayPtr pArray = rTable.Last();
- while(pArray)
- {
- pArray->DeleteAndDestroy(0, pArray->Count());
- delete pArray;
- pArray = rTable.Prev();
- }
- rTable.Clear();
-}
-
-/*-----------------14.10.96 15.57-------------------
-
---------------------------------------------------*/
-
-OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent,
- const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES( RID_OFAPAGE_AUTOCORR_REPLACE ), rSet),
- aTextOnlyCB( this, SVX_RES(CB_TEXT_ONLY )),
- aShortFT ( this, SVX_RES(FT_SHORT )),
- aShortED ( this, SVX_RES(ED_SHORT )),
- aReplaceFT( this, SVX_RES(FT_REPLACE )),
- aReplaceED( this, SVX_RES(ED_REPLACE )),
- aReplaceTLB( this, SVX_RES(TLB_REPLACE )),
- aNewReplacePB( this, SVX_RES(PB_NEW_REPLACE )),
- aDeleteReplacePB(this,SVX_RES(PB_DELETE_REPLACE )),
- sModify(SVX_RES(STR_MODIFY)),
- sNew(aNewReplacePB.GetText()),
- pFormatText(0),
- eLang(eLastDialogLanguage),
- bHasSelectionText(FALSE),
- bFirstSelect(TRUE),
- bReplaceEditChanged(FALSE),
- bSWriter(TRUE)
-{
- FreeResource();
- SfxModule *pMod = *(SfxModule**)GetAppData(SHL_WRITER);
- bSWriter = pMod == SfxModule::GetActiveModule();
-
- ::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage ));
- pCompareClass = new CollatorWrapper( GetProcessFact() );
- pCompareCaseClass = new CollatorWrapper( GetProcessFact() );
- pCompareClass->loadDefaultCollator( aLcl, ::com::sun::star::i18n::
- CollatorOptions::CollatorOptions_IGNORE_CASE );
- pCompareCaseClass->loadDefaultCollator( aLcl, 0 );
- pCharClass = new CharClass( aLcl );
-
- static long nTabs[] = { 2 /* Tab-Count */, 1, 61 };
- aReplaceTLB.SetTabs( &nTabs[0], MAP_APPFONT );
-
- aReplaceTLB.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN);
- aReplaceTLB.SetSelectHdl(LINK(this, OfaAutocorrReplacePage, SelectHdl));
- aNewReplacePB.SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl));
- aDeleteReplacePB.SetClickHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl));
- aShortED.SetModifyHdl(LINK(this, OfaAutocorrReplacePage, ModifyHdl));
- aReplaceED.SetModifyHdl(LINK(this, OfaAutocorrReplacePage, ModifyHdl));
- aShortED.SetActionHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl));
- aReplaceED.SetActionHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl));
-
- aReplaceED.SetSpaces(TRUE);
- aShortED.SetSpaces(TRUE);
- aShortED.SetMaxTextLen(30);
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-OfaAutocorrReplacePage::~OfaAutocorrReplacePage()
-{
- delete pFormatText;
- lcl_ClearTable(aDoubleStringTable);
- delete pCompareClass;
- delete pCompareCaseClass;
- delete pCharClass;
-}
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* OfaAutocorrReplacePage::Create( Window* pParent,
- const SfxItemSet& rSet)
-{
- return new OfaAutocorrReplacePage(pParent, rSet);
-}
-/* -----------------20.11.98 13:26-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrReplacePage::ActivatePage( const SfxItemSet& )
-{
- if(eLang != eLastDialogLanguage)
- SetLanguage(eLastDialogLanguage);
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(TRUE);
-}
-/* -----------------20.11.98 13:26-------------------
- *
- * --------------------------------------------------*/
-int OfaAutocorrReplacePage::DeactivatePage( SfxItemSet* )
-{
- return LEAVE_PAGE;
-}
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-BOOL OfaAutocorrReplacePage::FillItemSet( SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- DoubleStringArrayPtr pDoubleStringArray = aDoubleStringTable.Last();
- while(pDoubleStringArray)
- {
- LanguageType eCurLang = (LanguageType)aDoubleStringTable.GetCurKey();
- if(eCurLang != eLang) // die aktuelle Sprache wird weiter hinten behandelt
- {
- SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eCurLang);
- USHORT nWordListCount = pWordList->Count();
- USHORT nDoubleStringArrayCount = pDoubleStringArray->Count();
- USHORT nPos = nDoubleStringArrayCount;
- USHORT nLastPos = nPos;
- // 1. Durchlauf: Eintraege loeschen oder veraendern:
-
-
- for( USHORT nWordListPos = nWordListCount; nWordListPos; nWordListPos-- )
- {
- SvxAutocorrWordPtr pWordPtr = pWordList->GetObject(nWordListPos - 1);
- String sEntry(pWordPtr->GetShort());
- // formatierter Text steht nur im Writer
- BOOL bFound = !bSWriter && !pWordPtr->IsTextOnly();
- while(!bFound && nPos)
- {
- DoubleString* pDouble = pDoubleStringArray->GetObject( nPos - 1);
-
- if( 0 == pCompareClass->compareString(
- sEntry, pDouble->sShort ))
- {
- nLastPos = nPos - 1;
- bFound = TRUE;
- if( !(pWordPtr->IsTextOnly() == (0 == pDouble->pUserData)
- && 0 == pCompareCaseClass->compareString(
- pWordPtr->GetLong(), pDouble->sLong ) ) )
- {
- pAutoCorrect->PutText(sEntry, pDouble->sLong, eCurLang);
- }
- pDoubleStringArray->DeleteAndDestroy(nPos - 1, 1);
- break;
- }
- nPos--;
- }
- nPos = nLastPos;
- if(!bFound)
- {
- pAutoCorrect->DeleteText(sEntry, eCurLang);
- }
- }
- nDoubleStringArrayCount = pDoubleStringArray->Count();
- for(USHORT nDoubleStringArrayPos = 0; nDoubleStringArrayPos < nDoubleStringArrayCount; nDoubleStringArrayPos++ )
- {
- //jetzt sollte es nur noch neue Eintraege geben
- DoubleString* pDouble = pDoubleStringArray->GetObject( nDoubleStringArrayPos );
- if(pDouble->pUserData == &bHasSelectionText)
- pAutoCorrect->PutText( pDouble->sShort,
- *SfxObjectShell::Current(), eCurLang );
- else
- {
- pAutoCorrect->PutText( pDouble->sShort, pDouble->sLong,
- eCurLang);
- }
- }
- }
- pDoubleStringArray->DeleteAndDestroy(0, pDoubleStringArray->Count());
- delete pDoubleStringArray;
- pDoubleStringArray = aDoubleStringTable.Prev();
- }
- aDoubleStringTable.Clear();
- // jetzt noch die aktuelle Selektion
- SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eLang);
- USHORT nWordListCount = pWordList->Count();
- USHORT nListBoxCount = (USHORT)aReplaceTLB.GetEntryCount();
-
- aReplaceTLB.SetUpdateMode(FALSE);
- USHORT nListBoxPos = nListBoxCount;
- USHORT nLastListBoxPos = nListBoxPos;
- // 1. Durchlauf: Eintraege loeschen oder veraendern:
-
- USHORT i;
- for( i = nWordListCount; i; i-- )
- {
- SvxAutocorrWordPtr pWordPtr = pWordList->GetObject(i- 1);
- String sEntry(pWordPtr->GetShort());
- // formatierter Text steht nur im Writer
- BOOL bFound = !bSWriter && !pWordPtr->IsTextOnly();
- while(!bFound && nListBoxPos)
- {
- SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( nListBoxPos - 1);
- if( 0 == pCompareClass->compareString( sEntry,
- aReplaceTLB.GetEntryText(pEntry, 0)))
- {
- nLastListBoxPos = nListBoxPos - 1;
- bFound = TRUE;
- String sLong = aReplaceTLB.GetEntryText(pEntry, 1);
- if( !(pWordPtr->IsTextOnly() == (0 == pEntry->GetUserData())
- && 0 == pCompareCaseClass->compareString(
- pWordPtr->GetLong(), sLong )))
- {
- pAutoCorrect->PutText(sEntry, sLong, eLang);
- }
- aReplaceTLB.GetModel()->Remove(pEntry);
- break;
-
- }
- nListBoxPos --;
- }
- nListBoxPos = nLastListBoxPos;
- if(!bFound)
- {
- pAutoCorrect->DeleteText(sEntry, eLang);
- }
-
- }
- nListBoxCount = (USHORT)aReplaceTLB.GetEntryCount();
- for(i = 0; i < nListBoxCount; i++ )
- {
- //jetzt sollte es nur noch neue Eintraege geben
- SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( i );
- String sShort = aReplaceTLB.GetEntryText(pEntry, 0);
- if(pEntry->GetUserData() == &bHasSelectionText)
- pAutoCorrect->PutText(sShort, *SfxObjectShell::Current(), eLang);
- else
- {
- String sLong = aReplaceTLB.GetEntryText(pEntry, 1);
- pAutoCorrect->PutText(sShort, sLong, eLang);
- }
- }
-
- return FALSE;
-}
-
-/* -----------------19.11.98 13:16-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrReplacePage::RefillReplaceBox(BOOL bFromReset,
- LanguageType eOldLanguage,
- LanguageType eNewLanguage)
-{
- eLang = eNewLanguage;
- if(bFromReset)
- lcl_ClearTable(aDoubleStringTable);
- else
- {
- DoubleStringArray* pArray = 0;
- if(aDoubleStringTable.IsKeyValid(eOldLanguage))
- {
- pArray = aDoubleStringTable.Seek(ULONG(eOldLanguage));
- pArray->DeleteAndDestroy(0, pArray->Count());
- }
- else
- {
- pArray = new DoubleStringArray;
- aDoubleStringTable.Insert(ULONG(eOldLanguage), pArray);
- }
-
- USHORT nListBoxCount = (USHORT)aReplaceTLB.GetEntryCount();
- USHORT i;
- for(i = 0; i < nListBoxCount; i++)
- {
- DoubleString* pDouble = new DoubleString();
- SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( i );
- pDouble->sShort = aReplaceTLB.GetEntryText(pEntry, 0);
- pDouble->sLong = aReplaceTLB.GetEntryText(pEntry, 1);
- pDouble->pUserData = pEntry->GetUserData();
- pArray->Insert(pDouble, i);
- }
- }
-
- aReplaceTLB.Clear();
- if(!bSWriter)
- {
- if(pFormatText)
- pFormatText->DeleteAndDestroy(0, pFormatText->Count());
- else
- pFormatText = new SvStringsISortDtor();
- }
-
- if(aDoubleStringTable.IsKeyValid(eLang))
- {
- DoubleStringArray* pArray = aDoubleStringTable.Seek(ULONG(eNewLanguage));
- for(USHORT i = 0; i < pArray->Count(); i++)
- {
- DoubleString* pDouble = pArray->GetObject(i);
- BOOL bTextOnly = 0 == pDouble->pUserData;
- // formatierter Text wird nur im Writer angeboten
- if(bSWriter || bTextOnly)
- {
- String sEntry(pDouble->sShort);
- sEntry += '\t';
- sEntry += pDouble->sLong;
- SvLBoxEntry* pEntry = aReplaceTLB.InsertEntry(sEntry);
- aTextOnlyCB.Check(bTextOnly);
- if(!bTextOnly)
- pEntry->SetUserData(pDouble->pUserData); // Das heisst: mit Formatinfo oder sogar mit Selektionstext
- }
- else
- {
- pFormatText->Insert(new String(pDouble->sShort));
- }
- }
- }
- else
- {
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eLang);
-
- for(USHORT i = 0; i < pWordList->Count(); i++)
- {
- SvxAutocorrWordPtr pWordPtr = pWordList->GetObject(i);
- BOOL bTextOnly = pWordPtr->IsTextOnly();
- // formatierter Text wird nur im Writer angeboten
- if(bSWriter || bTextOnly)
- {
- String sEntry(pWordPtr->GetShort());
- sEntry += '\t';
- sEntry += pWordPtr->GetLong();
- SvLBoxEntry* pEntry = aReplaceTLB.InsertEntry(sEntry);
- aTextOnlyCB.Check(pWordPtr->IsTextOnly());
- if(!bTextOnly)
- pEntry->SetUserData(&aTextOnlyCB); // Das heisst: mit Formatinfo
- }
- else
- {
- pFormatText->Insert(new String(pWordPtr->GetShort()));
- }
- }
- aNewReplacePB.Enable(FALSE);
- aDeleteReplacePB.Enable(FALSE);
-
- }
-
- SfxViewShell* pViewShell = SfxViewShell::Current();
- if( pViewShell && pViewShell->HasSelection( TRUE ) )
- {
- bHasSelectionText = TRUE;
- const String sSelection( pViewShell->GetSelectionText() );
- aReplaceED.SetText( sSelection );
- aTextOnlyCB.Check( !bSWriter );
- aTextOnlyCB.Enable( bSWriter && sSelection.Len() );
- }
- else
- aTextOnlyCB.Enable( FALSE );
-}
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-void OfaAutocorrReplacePage::Reset( const SfxItemSet& )
-{
- RefillReplaceBox(TRUE, eLang, eLang);
- aShortED.GrabFocus();
-}
-
-/* -----------------23.11.98 10:33-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet)
-{
- //save old settings an refill
- if(eSet != eLang)
- {
- RefillReplaceBox(FALSE, eLang, eSet);
- eLastDialogLanguage = eSet;
- delete pCompareClass;
- delete pCompareCaseClass;
- delete pCharClass;
-
- ::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage ));
- pCompareClass = new CollatorWrapper( GetProcessFact() );
- pCompareCaseClass = new CollatorWrapper( GetProcessFact() );
- pCompareClass->loadDefaultCollator( aLcl, ::com::sun::star::i18n::
- CollatorOptions::CollatorOptions_IGNORE_CASE );
- pCompareCaseClass->loadDefaultCollator( aLcl, 0 );
- pCharClass = new CharClass( aLcl );
- ModifyHdl(&aShortED);
- }
-}
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-IMPL_LINK(OfaAutocorrReplacePage, SelectHdl, SvTabListBox*, pBox)
-{
- if(!bFirstSelect || !bHasSelectionText)
- {
- SvLBoxEntry* pEntry = pBox->FirstSelected();
- String sTmpShort(pBox->GetEntryText(pEntry, 0));
- // wird der Text ueber den ModifyHdl gesetzt, dann steht der Cursor sonst immer am Wortanfang,
- // obwohl man gerade hier editiert
- BOOL bSameContent = 0 == pCompareClass->compareString(
- sTmpShort, aShortED.GetText() );
- Selection aSel = aShortED.GetSelection();
- if(aShortED.GetText() != sTmpShort)
- {
- aShortED.SetText(sTmpShort);
- //war es nur eine andere Schreibweise, dann muss die Selektion auch wieder gesetzt werden
- if(bSameContent)
- aShortED.SetSelection(aSel);
- }
- aReplaceED.SetText(pBox->GetEntryText(pEntry, 1));
- // mit UserData gibt es eine Formatinfo
- aTextOnlyCB.Check(0 == pEntry->GetUserData());
- }
- else
- bFirstSelect = FALSE;
-
- aNewReplacePB.Enable(FALSE);
- aDeleteReplacePB.Enable();
- return 0;
-};
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-
-IMPL_LINK(OfaAutocorrReplacePage, NewDelHdl, PushButton*, pBtn)
-{
- SvLBoxEntry* _pEntry = aReplaceTLB.FirstSelected();
- if(pBtn == &aDeleteReplacePB)
- {
- DBG_ASSERT(_pEntry, "keine Eintrag selektiert");
- if(_pEntry)
- {
- aReplaceTLB.GetModel()->Remove(_pEntry);
- ModifyHdl(&aShortED);
- return 0;
- }
- }
- if(pBtn == &aNewReplacePB || aNewReplacePB.IsEnabled())
- {
- SvLBoxEntry* _pNewEntry = aReplaceTLB.FirstSelected();
- String sEntry(aShortED.GetText());
- if(sEntry.Len() && ( aReplaceED.GetText().Len() ||
- ( bHasSelectionText && bSWriter ) ))
- {
- aReplaceTLB.SetUpdateMode(FALSE);
- USHORT nPos = USHRT_MAX;
- sEntry += '\t';
- sEntry += aReplaceED.GetText();
- if(_pNewEntry)
- {
- nPos = (USHORT)aReplaceTLB.GetModel()->GetAbsPos(_pNewEntry);
- aReplaceTLB.GetModel()->Remove(_pNewEntry);
- }
- else
- {
- USHORT j;
- for( j = 0; j < aReplaceTLB.GetEntryCount(); j++ )
- {
- SvLBoxEntry* pReplaceEntry = aReplaceTLB.GetEntry(j);
- if( 0 >= pCompareClass->compareString(sEntry,
- aReplaceTLB.GetEntryText(pReplaceEntry, 0) ) )
- break;
- }
- nPos = j;
- }
- SvLBoxEntry* pInsEntry =
- aReplaceTLB.InsertEntry(
- sEntry, static_cast< SvLBoxEntry * >(NULL), false,
- nPos == USHRT_MAX ? LIST_APPEND : nPos);
- if( !bReplaceEditChanged && !aTextOnlyCB.IsChecked())
- pInsEntry->SetUserData(&bHasSelectionText); // neuer formatierter Text
-
- aReplaceTLB.MakeVisible( pInsEntry );
- aReplaceTLB.SetUpdateMode(TRUE);
- // falls der Request aus dem ReplaceEdit kam, dann Focus in das ShortEdit setzen
- if(aReplaceED.HasFocus())
- aShortED.GrabFocus();
-
- }
- }
- else
- {
- // das kann nur ein Enter in einem der beiden Edit-Felder sein und das
- // bedeutet EndDialog() - muss im KeyInput ausgewertet werden
- return 0;
- }
- ModifyHdl(&aShortED);
- return 1;
-}
-
-/*-----------------17.10.96 07.49-------------------
-
---------------------------------------------------*/
-IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt)
-{
- SvLBoxEntry* pFirstSel = aReplaceTLB.FirstSelected();
- BOOL bShort = pEdt == &aShortED;
- const String rEntry = pEdt->GetText();
- const String rRepString = aReplaceED.GetText();
- String aWordStr( pCharClass->lower( rEntry ));
-
- if(bShort)
- {
- if(rEntry.Len())
- {
- BOOL bFound = FALSE;
- BOOL bTmpSelEntry=FALSE;
-
- for(USHORT i = 0; i < aReplaceTLB.GetEntryCount(); i++)
- {
- SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( i );
- String aTestStr=aReplaceTLB.GetEntryText(pEntry, 0);
- if( 0 == pCompareClass->compareString(rEntry, aTestStr ))
- {
- if(rRepString.Len())
- bFirstSelect = TRUE;
- aReplaceTLB.SetCurEntry(pEntry);
- pFirstSel = pEntry;
- aNewReplacePB.SetText(sModify);
- bFound= TRUE;
- break;
- }
- else
- {
- pCharClass->toLower( aTestStr );
- if(aTestStr.Search(aWordStr)==0 && !bTmpSelEntry)
- {
- aReplaceTLB.MakeVisible(pEntry);
- bTmpSelEntry=TRUE;
- }
- }
- }
- if(!bFound)
- {
- aReplaceTLB.SelectAll(FALSE);
- pFirstSel = 0;
- aNewReplacePB.SetText(sNew);
- if(bReplaceEditChanged)
- aTextOnlyCB.Enable(FALSE);
- }
- aDeleteReplacePB.Enable(bFound);
- }
- else if(aReplaceTLB.GetEntryCount()>0)
- {
- SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( 0 );
- aReplaceTLB.MakeVisible(pEntry);
- }
-
- }
- else if(!bShort)
- {
- bReplaceEditChanged = TRUE;
- if(pFirstSel)
- {
- aNewReplacePB.SetText(sModify);
- }
- }
-
- const String& rShortTxt = aShortED.GetText();
- BOOL bEnableNew = rShortTxt.Len() &&
- ( rRepString.Len() ||
- ( bHasSelectionText && bSWriter )) &&
- ( !pFirstSel || rRepString !=
- aReplaceTLB.GetEntryText( pFirstSel, 1 ) );
- if(bEnableNew && pFormatText)
- {
- for(USHORT i = 0; i < pFormatText->Count(); i++)
- if(*pFormatText->GetObject(i) == rShortTxt)
- {
- bEnableNew = FALSE;
- break;
- }
- }
- aNewReplacePB.Enable(bEnableNew);
-
- return 0;
-}
-
-/* -----------------20.11.98 13:48-------------------
- *
- * --------------------------------------------------*/
-
-struct StringsArrays
-{
-
- SvStringsDtor aAbbrevStrings;
- SvStringsDtor aDoubleCapsStrings;
-
- StringsArrays() :
- aAbbrevStrings(5,5), aDoubleCapsStrings(5,5) {}
-};
-typedef StringsArrays* StringsArraysPtr;
-/* -----------------19.11.98 16:07-------------------
- *
- * --------------------------------------------------*/
-BOOL lcl_FindInArray(SvStringsDtor& rStrings, const String& rString)
-{
- for(USHORT i = 0; i < rStrings.Count(); i++)
- if(rString == *rStrings.GetObject(i))
- return TRUE;
- return FALSE;
-}
-
-void lcl_ClearTable(StringsTable& rTable)
-{
- StringsArraysPtr pArrays = rTable.Last();
- while(pArrays)
- {
- delete pArrays;
- pArrays = rTable.Prev();
- }
- rTable.Clear();
-}
-
-/*-----------------14.10.96 15.57-------------------
-
---------------------------------------------------*/
-
-OfaAutocorrExceptPage::OfaAutocorrExceptPage( Window* pParent,
- const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES( RID_OFAPAGE_AUTOCORR_EXCEPT ), rSet),
- aAbbrevFL (this, SVX_RES(FL_ABBREV )),
- aAbbrevED (this, SVX_RES(ED_ABBREV )),
- aAbbrevLB (this, SVX_RES(LB_ABBREV )),
- aNewAbbrevPB (this, SVX_RES(PB_NEWABBREV )),
- aDelAbbrevPB (this, SVX_RES(PB_DELABBREV )),
- aAutoAbbrevCB (this, SVX_RES(CB_AUTOABBREV )),
- aDoubleCapsFL (this, SVX_RES(FL_DOUBLECAPS )),
- aDoubleCapsED (this, SVX_RES(ED_DOUBLE_CAPS )),
- aDoubleCapsLB (this, SVX_RES(LB_DOUBLE_CAPS )),
- aNewDoublePB (this, SVX_RES(PB_NEWDOUBLECAPS)),
- aDelDoublePB (this, SVX_RES(PB_DELDOUBLECAPS)),
- aAutoCapsCB (this, SVX_RES(CB_AUTOCAPS )),
- eLang(eLastDialogLanguage)
-{
- FreeResource();
-
- ::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage ));
- pCompareClass = new CollatorWrapper( GetProcessFact() );
- pCompareClass->loadDefaultCollator( aLcl, ::com::sun::star::i18n::
- CollatorOptions::CollatorOptions_IGNORE_CASE );
-
- aNewAbbrevPB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
- aDelAbbrevPB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
- aNewDoublePB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
- aDelDoublePB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
-
- aAbbrevLB.SetSelectHdl(LINK(this, OfaAutocorrExceptPage, SelectHdl));
- aDoubleCapsLB.SetSelectHdl(LINK(this, OfaAutocorrExceptPage, SelectHdl));
- aAbbrevED.SetModifyHdl(LINK(this, OfaAutocorrExceptPage, ModifyHdl));
- aDoubleCapsED.SetModifyHdl(LINK(this, OfaAutocorrExceptPage, ModifyHdl));
-
- aAbbrevED.SetActionHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
- aDoubleCapsED.SetActionHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
-
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-OfaAutocorrExceptPage::~OfaAutocorrExceptPage()
-{
- lcl_ClearTable(aStringsTable);
- delete pCompareClass;
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* OfaAutocorrExceptPage::Create( Window* pParent,
- const SfxItemSet& rSet)
-{
- return new OfaAutocorrExceptPage(pParent, rSet);
-}
-/* -----------------20.11.98 13:26-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrExceptPage::ActivatePage( const SfxItemSet& )
-{
- if(eLang != eLastDialogLanguage)
- SetLanguage(eLastDialogLanguage);
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(TRUE);
-}
-/* -----------------20.11.98 13:26-------------------
- *
- * --------------------------------------------------*/
-int OfaAutocorrExceptPage::DeactivatePage( SfxItemSet* )
-{
- return LEAVE_PAGE;
-}
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-BOOL OfaAutocorrExceptPage::FillItemSet( SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- StringsArraysPtr pArrays = aStringsTable.Last();
- while(pArrays)
- {
- LanguageType eCurLang = (LanguageType)aStringsTable.GetCurKey();
- if(eCurLang != eLang) // die aktuelle Sprache wird weiter hinten behandelt
- {
- SvStringsISortDtor* pWrdList = pAutoCorrect->LoadWrdSttExceptList(eCurLang);
-
- if(pWrdList)
- {
- USHORT nCount = pWrdList->Count();
- USHORT i;
- for( i = nCount; i; )
- {
- String* pString = pWrdList->GetObject( --i );
- //Eintrag finden u. gfs entfernen
- if( !lcl_FindInArray(pArrays->aDoubleCapsStrings, *pString))
- pWrdList->DeleteAndDestroy( i );
- }
- nCount = pArrays->aDoubleCapsStrings.Count();
- for( i = 0; i < nCount; ++i )
- {
- String* pEntry = new String( *pArrays->aDoubleCapsStrings.GetObject( i ) );
- if( !pWrdList->Insert( pEntry ))
- delete pEntry;
- }
- pAutoCorrect->SaveWrdSttExceptList(eCurLang);
- }
-
- SvStringsISortDtor* pCplList = pAutoCorrect->LoadCplSttExceptList(eCurLang);
-
- if(pCplList)
- {
- USHORT nCount = pCplList->Count();
- USHORT i;
- for( i = nCount; i; )
- {
- String* pString = pCplList->GetObject( --i );
- if( !lcl_FindInArray(pArrays->aAbbrevStrings, *pString))
- pCplList->DeleteAndDestroy( i );
- }
- nCount = pArrays->aAbbrevStrings.Count();
- for( i = 0; i < nCount; ++i )
- {
- String* pEntry = new String( *pArrays->aAbbrevStrings.GetObject(i) );
- if( !pCplList->Insert( pEntry ))
- delete pEntry;
- }
- pAutoCorrect->SaveCplSttExceptList(eCurLang);
- }
- }
- pArrays = aStringsTable.Prev();
- }
- aStringsTable.Clear();
-
- SvStringsISortDtor* pWrdList = pAutoCorrect->LoadWrdSttExceptList(eLang);
-
- if(pWrdList)
- {
- USHORT nCount = pWrdList->Count();
- USHORT i;
- for( i = nCount; i; )
- {
- String* pString = pWrdList->GetObject( --i );
- if( USHRT_MAX == aDoubleCapsLB.GetEntryPos(*pString) )
- pWrdList->DeleteAndDestroy( i );
- }
- nCount = aDoubleCapsLB.GetEntryCount();
- for( i = 0; i < nCount; ++i )
- {
- String* pEntry = new String( aDoubleCapsLB.GetEntry( i ) );
- if( !pWrdList->Insert( pEntry ))
- delete pEntry;
- }
- pAutoCorrect->SaveWrdSttExceptList(eLang);
- }
-
- SvStringsISortDtor* pCplList = pAutoCorrect->LoadCplSttExceptList(eLang);
-
- if(pCplList)
- {
- USHORT nCount = pCplList->Count();
- USHORT i;
- for( i = nCount; i; )
- {
- String* pString = pCplList->GetObject( --i );
- if( USHRT_MAX == aAbbrevLB.GetEntryPos(*pString) )
- pCplList->DeleteAndDestroy( i );
- }
- nCount = aAbbrevLB.GetEntryCount();
- for( i = 0; i < nCount; ++i )
- {
- String* pEntry = new String( aAbbrevLB.GetEntry( i ) );
- if( !pCplList->Insert( pEntry ))
- delete pEntry;
- }
- pAutoCorrect->SaveCplSttExceptList(eLang);
- }
- if(aAutoAbbrevCB.IsChecked() != aAutoAbbrevCB.GetSavedValue())
- pAutoCorrect->SetAutoCorrFlag( SaveWordCplSttLst, aAutoAbbrevCB.IsChecked());
- if(aAutoCapsCB.IsChecked() != aAutoCapsCB.GetSavedValue())
- pAutoCorrect->SetAutoCorrFlag( SaveWordWrdSttLst, aAutoCapsCB.IsChecked());
- return FALSE;
-}
-
-/* -----------------23.11.98 10:33-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrExceptPage::SetLanguage(LanguageType eSet)
-{
- if(eLang != eSet)
- {
- //alte Einstellungen speichern und neu fuellen
- RefillReplaceBoxes(FALSE, eLang, eSet);
- eLastDialogLanguage = eSet;
- delete pCompareClass;
- pCompareClass = new CollatorWrapper( GetProcessFact() );
- pCompareClass->loadDefaultCollator( SvxCreateLocale( eLastDialogLanguage ),
- ::com::sun::star::i18n::
- CollatorOptions::CollatorOptions_IGNORE_CASE );
- ModifyHdl(&aAbbrevED);
- ModifyHdl(&aDoubleCapsED);
- }
-}
-/* -----------------20.11.98 14:06-------------------
- *
- * --------------------------------------------------*/
-void OfaAutocorrExceptPage::RefillReplaceBoxes(BOOL bFromReset,
- LanguageType eOldLanguage,
- LanguageType eNewLanguage)
-{
- eLang = eNewLanguage;
- if(bFromReset)
- lcl_ClearTable(aStringsTable);
- else
- {
- StringsArraysPtr pArrays = 0;
- if(aStringsTable.IsKeyValid(eOldLanguage))
- {
- pArrays = aStringsTable.Seek(ULONG(eOldLanguage));
- pArrays->aAbbrevStrings.DeleteAndDestroy(
- 0, pArrays->aAbbrevStrings.Count());
- pArrays->aDoubleCapsStrings.DeleteAndDestroy(
- 0, pArrays->aDoubleCapsStrings.Count());
- }
- else
- {
- pArrays = new StringsArrays;
- aStringsTable.Insert(ULONG(eOldLanguage), pArrays);
- }
-
- USHORT i;
- for(i = 0; i < aAbbrevLB.GetEntryCount(); i++)
- {
- pArrays->aAbbrevStrings.Insert(
- new String(aAbbrevLB.GetEntry(i)), i);
-
- }
- for(i = 0; i < aDoubleCapsLB.GetEntryCount(); i++)
- {
- pArrays->aDoubleCapsStrings.Insert(
- new String(aDoubleCapsLB.GetEntry(i)), i);
- }
- }
- aDoubleCapsLB.Clear();
- aAbbrevLB.Clear();
- String sTemp;
- aAbbrevED.SetText(sTemp);
- aDoubleCapsED.SetText(sTemp);
-
- if(aStringsTable.IsKeyValid(eLang))
- {
- StringsArraysPtr pArrays = aStringsTable.Seek(ULONG(eLang));
- USHORT i;
- for(i = 0; i < pArrays->aAbbrevStrings.Count(); i++ )
- {
- aAbbrevLB.InsertEntry(*pArrays->aAbbrevStrings.GetObject(i));
- }
- for( i = 0; i < pArrays->aDoubleCapsStrings.Count(); i++ )
- {
- aDoubleCapsLB.InsertEntry(*pArrays->aDoubleCapsStrings.GetObject(i));
- }
- }
- else
- {
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- const SvStringsISortDtor* pCplList = pAutoCorrect->GetCplSttExceptList(eLang);
- const SvStringsISortDtor* pWrdList = pAutoCorrect->GetWrdSttExceptList(eLang);
- USHORT i;
- for( i = 0; i < pCplList->Count(); i++ )
- {
- aAbbrevLB.InsertEntry(*pCplList->GetObject(i));
- }
- for( i = 0; i < pWrdList->Count(); i++ )
- {
- aDoubleCapsLB.InsertEntry(*pWrdList->GetObject(i));
- }
- }
-}
-
-/*-----------------14.10.96 15.58-------------------
-
---------------------------------------------------*/
-
-void OfaAutocorrExceptPage::Reset( const SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- RefillReplaceBoxes(TRUE, eLang, eLang);
- aAutoAbbrevCB. Check( pAutoCorrect->IsAutoCorrFlag( SaveWordCplSttLst ));
- aAutoCapsCB. Check( pAutoCorrect->IsAutoCorrFlag( SaveWordWrdSttLst ));
- aAutoAbbrevCB.SaveValue();
- aAutoCapsCB.SaveValue();
-}
-
-/*-----------------16.10.96 12.27-------------------
-
---------------------------------------------------*/
-
-
-IMPL_LINK(OfaAutocorrExceptPage, NewDelHdl, PushButton*, pBtn)
-{
- if((pBtn == &aNewAbbrevPB || pBtn == (PushButton*)&aAbbrevED )
- && aAbbrevED.GetText().Len())
- {
- aAbbrevLB.InsertEntry(aAbbrevED.GetText());
- ModifyHdl(&aAbbrevED);
- }
- else if(pBtn == &aDelAbbrevPB)
- {
- aAbbrevLB.RemoveEntry(aAbbrevED.GetText());
- ModifyHdl(&aAbbrevED);
- }
- else if((pBtn == &aNewDoublePB || pBtn == (PushButton*)&aDoubleCapsED )
- && aDoubleCapsED.GetText().Len())
- {
- aDoubleCapsLB.InsertEntry(aDoubleCapsED.GetText());
- ModifyHdl(&aDoubleCapsED);
- }
- else if(pBtn == &aDelDoublePB)
- {
- aDoubleCapsLB.RemoveEntry(aDoubleCapsED.GetText());
- ModifyHdl(&aDoubleCapsED);
- }
- return 0;
-}
-
-/*-----------------16.10.96 12.57-------------------
-
---------------------------------------------------*/
-
-IMPL_LINK(OfaAutocorrExceptPage, SelectHdl, ListBox*, pBox)
-{
- if(pBox == &aAbbrevLB)
- {
- aAbbrevED.SetText(pBox->GetSelectEntry());
- aNewAbbrevPB.Enable(FALSE);
- aDelAbbrevPB.Enable();
- }
- else
- {
- aDoubleCapsED.SetText(pBox->GetSelectEntry());
- aNewDoublePB.Enable(FALSE);
- aDelDoublePB.Enable();
- }
- return 0;
-}
-
-/*-----------------16.10.96 13.02-------------------
-
---------------------------------------------------*/
-
-IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt)
-{
-// BOOL bSame = pEdt->GetText() == ->GetSelectEntry();
- const String& sEntry = pEdt->GetText();
- BOOL bEntryLen = 0!= sEntry.Len();
- if(pEdt == &aAbbrevED)
- {
- BOOL bSame = lcl_FindEntry(aAbbrevLB, sEntry, *pCompareClass);
- if(bSame && sEntry != aAbbrevLB.GetSelectEntry())
- pEdt->SetText(aAbbrevLB.GetSelectEntry());
- aNewAbbrevPB.Enable(!bSame && bEntryLen);
- aDelAbbrevPB.Enable(bSame && bEntryLen);
- }
- else
- {
- BOOL bSame = lcl_FindEntry(aDoubleCapsLB, sEntry, *pCompareClass);
- if(bSame && sEntry != aDoubleCapsLB.GetSelectEntry())
- pEdt->SetText(aDoubleCapsLB.GetSelectEntry());
- aNewDoublePB.Enable(!bSame && bEntryLen);
- aDelDoublePB.Enable(bSame && bEntryLen);
- }
- return 0;
-}
-
-/*-----------------16.10.96 15.03-------------------
-
---------------------------------------------------*/
-
-void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt )
-{
- const KeyCode aKeyCode = rKEvt.GetKeyCode();
- const USHORT nModifier = aKeyCode.GetModifier();
- if( aKeyCode.GetCode() == KEY_RETURN )
- {
- //wird bei Enter nichts getan, dann doch die Basisklasse rufen
- // um den Dialog zu schliessen
- if(!nModifier && !aActionLink.Call(this))
- Edit::KeyInput(rKEvt);
- }
- else if(bSpaces || aKeyCode.GetCode() != KEY_SPACE)
- Edit::KeyInput(rKEvt);
-}
-
-/*-----------------03.07.97 13:17-------------------
-
---------------------------------------------------*/
-
-OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES( RID_OFAPAGE_AUTOCORR_QUOTE ), rSet),
- aSingleFL (this, SVX_RES(FL_SINGLE )),
- aSingleTypoCB (this, SVX_RES(CB_SGL_TYPO )),
- aSglStartQuoteFT (this, SVX_RES(FT_SGL_STARTQUOTE )),
- aSglStartQuotePB (this, SVX_RES(PB_SGL_STARTQUOTE )),
- aSglStartExFT (this, SVX_RES(FT_SGSTEX )),
- aSglEndQuoteFT (this, SVX_RES(FT_SGL_ENDQUOTE )),
- aSglEndQuotePB (this, SVX_RES(PB_SGL_ENDQUOTE )),
- aSglEndExFT (this, SVX_RES(FT_SGENEX )),
- aSglStandardPB (this, SVX_RES(PB_SGL_STD )),
-
- aDoubleFL (this, SVX_RES(FL_DOUBLE )),
- aTypoCB (this, SVX_RES(CB_TYPO )),
- aStartQuoteFT (this, SVX_RES(FT_STARTQUOTE )),
- aStartQuotePB (this, SVX_RES(PB_STARTQUOTE )),
- aDblStartExFT (this, SVX_RES(FT_DBSTEX )),
- aEndQuoteFT (this, SVX_RES(FT_ENDQUOTE )),
- aEndQuotePB (this, SVX_RES(PB_ENDQUOTE )),
- aDblEndExFT (this, SVX_RES(FT_DBECEX )),
- aDblStandardPB (this, SVX_RES(PB_DBL_STD )),
-
- sStartQuoteDlg (SVX_RES(STR_CHANGE_START)),
- sEndQuoteDlg (SVX_RES(STR_CHANGE_END)),
-
- sStandard(SVX_RES(ST_STANDARD))
-{
- FreeResource();
-
- aStartQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl));
- aEndQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl));
- aSglStartQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl));
- aSglEndQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl));
- aDblStandardPB.SetClickHdl(LINK(this, OfaQuoteTabPage, StdQuoteHdl));
- aSglStandardPB.SetClickHdl(LINK(this, OfaQuoteTabPage, StdQuoteHdl));
-
-}
-/*-----------------03.07.97 13:17-------------------
-
---------------------------------------------------*/
-OfaQuoteTabPage::~OfaQuoteTabPage()
-{
-}
-/*-----------------03.07.97 13:17-------------------
-
---------------------------------------------------*/
-SfxTabPage* OfaQuoteTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new OfaQuoteTabPage(pParent, rAttrSet);
-}
-/*-----------------03.07.97 13:18-------------------
-
---------------------------------------------------*/
-BOOL OfaQuoteTabPage::FillItemSet( SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
-
- long nFlags = pAutoCorrect->GetFlags();
- pAutoCorrect->SetAutoCorrFlag(ChgQuotes, aTypoCB.IsChecked());
- pAutoCorrect->SetAutoCorrFlag(ChgSglQuotes, aSingleTypoCB.IsChecked());
- BOOL bReturn = nFlags != pAutoCorrect->GetFlags();
- if(cStartQuote != pAutoCorrect->GetStartDoubleQuote())
- {
- bReturn = TRUE;
- sal_Unicode cUCS2 = static_cast<sal_Unicode>(cStartQuote); //TODO
- pAutoCorrect->SetStartDoubleQuote(cUCS2);
- }
- if(cEndQuote != pAutoCorrect->GetEndDoubleQuote())
- {
- bReturn = TRUE;
- sal_Unicode cUCS2 = static_cast<sal_Unicode>(cEndQuote); //TODO
- pAutoCorrect->SetEndDoubleQuote(cUCS2);
- }
- if(cSglStartQuote != pAutoCorrect->GetStartSingleQuote())
- {
- bReturn = TRUE;
- sal_Unicode cUCS2 = static_cast<sal_Unicode>(cSglStartQuote); //TODO
- pAutoCorrect->SetStartSingleQuote(cUCS2);
- }
- if(cSglEndQuote != pAutoCorrect->GetEndSingleQuote())
- {
- bReturn = TRUE;
- sal_Unicode cUCS2 = static_cast<sal_Unicode>(cSglEndQuote); //TODO
- pAutoCorrect->SetEndSingleQuote(cUCS2);
- }
-
- if(bReturn )
- {
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetModified();
- pCfg->Commit();
- }
- return bReturn;
-}
-/* -----------------23.11.98 16:15-------------------
- *
- * --------------------------------------------------*/
-void OfaQuoteTabPage::ActivatePage( const SfxItemSet& )
-{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(FALSE);
-}
-/*-----------------03.07.97 13:18-------------------
-
---------------------------------------------------*/
-void OfaQuoteTabPage::Reset( const SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- const long nFlags = pAutoCorrect->GetFlags();
-
- aTypoCB .Check(0 != (nFlags & ChgQuotes));
- aSingleTypoCB .Check(0 != (nFlags & ChgSglQuotes));
- aTypoCB .SaveValue();
- aSingleTypoCB .SaveValue();
-
- cStartQuote = pAutoCorrect->GetStartDoubleQuote();
- cEndQuote = pAutoCorrect->GetEndDoubleQuote();
- cSglStartQuote = pAutoCorrect->GetStartSingleQuote();
- cSglEndQuote = pAutoCorrect->GetEndSingleQuote();
-
- aSglStartExFT .SetText(ChangeStringExt_Impl(cSglStartQuote));
- aSglEndExFT .SetText(ChangeStringExt_Impl(cSglEndQuote));
- aDblStartExFT .SetText(ChangeStringExt_Impl(cStartQuote));
- aDblEndExFT .SetText(ChangeStringExt_Impl(cEndQuote));
-}
-
-
-/*-----------------15.10.96 16.42-------------------
-
---------------------------------------------------*/
-#define SGL_START 0
-#define DBL_START 1
-#define SGL_END 2
-#define DBL_END 3
-
-
-IMPL_LINK( OfaQuoteTabPage, QuoteHdl, PushButton*, pBtn )
-{
- USHORT nMode = SGL_START;
- if(pBtn == &aSglEndQuotePB)
- nMode = SGL_END;
- else if(pBtn == &aStartQuotePB)
- nMode = DBL_START;
- else if(pBtn == &aEndQuotePB)
- nMode = DBL_END;
- // Zeichenauswahl-Dialog starten
- SvxCharacterMap* pMap = new SvxCharacterMap( this, TRUE );
- pMap->SetCharFont( OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT,
- LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE, 0 ));
- pMap->SetText(nMode < SGL_END ? sStartQuoteDlg : sEndQuoteDlg );
- sal_UCS4 cDlg;
- //The two lines below are added by BerryJia for Bug95846 Time:2002-8-13 15:50
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- LanguageType eLang = Application::GetSettings().GetLanguage();
- switch( nMode )
- {
- case SGL_START:
- cDlg = cSglStartQuote;
- if(cDlg == 0)
- cDlg = pAutoCorrect->GetQuote('\'',TRUE,eLang); //add by BerryJia for Bug95846 Time:2002-8-13 15:50
- break;
- case SGL_END:
- cDlg = cSglEndQuote;
- if(cDlg == 0)
- cDlg = pAutoCorrect->GetQuote('\'',FALSE,eLang); //add by BerryJia for Bug95846 Time:2002-8-13 15:50
- break;
- case DBL_START:
- cDlg = cStartQuote;
- if(cDlg == 0)
- cDlg = pAutoCorrect->GetQuote('\"',TRUE,eLang); //add by BerryJia for Bug95846 Time:2002-8-13 15:50
- break;
- case DBL_END:
- cDlg = cEndQuote;
- if(cDlg == 0)
- cDlg = pAutoCorrect->GetQuote('\"',FALSE,eLang); //add by BerryJia for Bug95846 Time:2002-8-13 15:50
- break;
- default:
- DBG_ERROR("svx::OfaQuoteTabPage::QuoteHdl(), how to initialize cDlg?" );
- cDlg = 0;
- break;
-
- }
- pMap->SetChar( cDlg );
- pMap->DisableFontSelection();
- if(pMap->Execute() == RET_OK)
- {
- sal_UCS4 cNewChar = pMap->GetChar();
- switch( nMode )
- {
- case SGL_START:
- cSglStartQuote = cNewChar;
- aSglStartExFT.SetText(ChangeStringExt_Impl(cNewChar));
- break;
- case SGL_END:
- cSglEndQuote = cNewChar;
- aSglEndExFT.SetText(ChangeStringExt_Impl(cNewChar));
- break;
- case DBL_START:
- cStartQuote = cNewChar;
- aDblStartExFT.SetText(ChangeStringExt_Impl(cNewChar));
- break;
- case DBL_END:
- cEndQuote = cNewChar;
- aDblEndExFT.SetText(ChangeStringExt_Impl(cNewChar));
- break;
- }
- }
- delete pMap;
-
- return 0;
-}
-
-/*-----------------27.06.97 09.55-------------------
-
---------------------------------------------------*/
-IMPL_LINK( OfaQuoteTabPage, StdQuoteHdl, PushButton*, pBtn )
-{
- if(pBtn == &aDblStandardPB)
- {
- cStartQuote = 0;
- aDblStartExFT.SetText(ChangeStringExt_Impl(0));
- cEndQuote = 0;
- aDblEndExFT.SetText(ChangeStringExt_Impl(0));
-
- }
- else
- {
- cSglStartQuote = 0;
- aSglStartExFT.SetText(ChangeStringExt_Impl(0));
- cSglEndQuote = 0;
- aSglEndExFT.SetText(ChangeStringExt_Impl(0));
- }
- return 0;
-}
-
-// --------------------------------------------------
-
-String OfaQuoteTabPage::ChangeStringExt_Impl( sal_UCS4 cChar )
-{
- if( !cChar )
- return sStandard;
-
- // convert codepoint value to unicode-hex string
- sal_UCS4 aStrCodes[32] = { 0, ' ', '(', 'U', '+', '0' };
- aStrCodes[0] = cChar;
- int nFullLen = 5;
- int nHexLen = 4;
- while( (cChar >> (4*nHexLen)) != 0 )
- ++nHexLen;
- for( int i = nHexLen; --i >= 0;)
- {
- sal_UCS4 cHexDigit = ((cChar >> (4*i)) & 0x0f) + '0';
- if( cHexDigit > '9' )
- cHexDigit += 'A' - ('9' + 1);
- aStrCodes[ nFullLen++ ] = cHexDigit;
- }
- aStrCodes[ nFullLen++ ] = ')';
- // using the new UCS4 constructor
- rtl::OUString aOUStr( aStrCodes, nFullLen );
- return aOUStr;
-}
-
-OfaAutoCompleteTabPage::OfaAutoCompleteTabPage( Window* pParent,
- const SfxItemSet& rSet )
- : SfxTabPage(pParent, SVX_RES( RID_OFAPAGE_AUTOCOMPLETE_OPTIONS ), rSet),
- aCBActiv (this, SVX_RES(CB_ACTIV)),
- aCBAppendSpace (this, SVX_RES(CB_APPEND_SPACE)),
- aCBAsTip (this, SVX_RES(CB_AS_TIP)),
- aCBCollect (this, SVX_RES(CB_COLLECT)),
- aCBRemoveList (this, SVX_RES(CB_REMOVE_LIST)),
- aFTExpandKey (this, SVX_RES(FT_EXPAND_KEY)),
- aDCBExpandKey (this, SVX_RES(DCB_EXPAND_KEY)),
- aFTMinWordlen (this, SVX_RES(FT_MIN_WORDLEN)),
- aNFMinWordlen (this, SVX_RES(NF_MIN_WORDLEN)),
- aFTMaxEntries (this, SVX_RES(FT_MAX_ENTRIES)),
- aNFMaxEntries (this, SVX_RES(NF_MAX_ENTRIES)),
- aLBEntries (*this, SVX_RES(LB_ENTRIES)),
- aPBEntries (this, SVX_RES(PB_ENTRIES)),
- pAutoCmpltList( 0 ),
- nAutoCmpltListCnt( 0 )
-{
- FreeResource();
-
- // the defined KEYs
- static const USHORT aKeyCodes[] = {
- KEY_END,
- KEY_RETURN,
- KEY_SPACE,
- KEY_RIGHT,
- KEY_TAB,
- 0
- };
-
- for( const USHORT* pKeys = aKeyCodes; *pKeys; ++pKeys )
- {
- KeyCode aKCode( *pKeys );
- USHORT nPos = aDCBExpandKey.InsertEntry( aKCode.GetName() );
- aDCBExpandKey.SetEntryData( nPos, (void*)(ULONG)*pKeys );
- if( KEY_RETURN == *pKeys ) // default to RETURN
- aDCBExpandKey.SelectEntryPos( nPos );
- }
-
- aPBEntries.SetClickHdl(LINK(this, OfaAutoCompleteTabPage, DeleteHdl));
- aCBActiv.SetToggleHdl(LINK(this, OfaAutoCompleteTabPage, CheckHdl));
- aCBCollect.SetToggleHdl(LINK(this, OfaAutoCompleteTabPage, CheckHdl));
-}
-
-OfaAutoCompleteTabPage::~OfaAutoCompleteTabPage()
-{
-}
-
-SfxTabPage* OfaAutoCompleteTabPage::Create( Window* pParent,
- const SfxItemSet& rSet)
-{
- return new OfaAutoCompleteTabPage( pParent, rSet );
-}
-
-BOOL OfaAutoCompleteTabPage::FillItemSet( SfxItemSet& )
-{
- BOOL bModified = FALSE, bCheck;
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
- USHORT nVal;
-
- bCheck = aCBActiv.IsChecked();
- bModified |= pOpt->bAutoCompleteWords != bCheck;
- pOpt->bAutoCompleteWords = bCheck;
- bCheck = aCBCollect.IsChecked();
- bModified |= pOpt->bAutoCmpltCollectWords != bCheck;
- pOpt->bAutoCmpltCollectWords = bCheck;
- bCheck = !aCBRemoveList.IsChecked(); // inverted value!
- bModified |= pOpt->bAutoCmpltKeepList != bCheck;
- pOpt->bAutoCmpltKeepList = bCheck;
- bCheck = aCBAppendSpace.IsChecked();
- bModified |= pOpt->bAutoCmpltAppendBlanc != bCheck;
- pOpt->bAutoCmpltAppendBlanc = bCheck;
- bCheck = aCBAsTip.IsChecked();
- bModified |= pOpt->bAutoCmpltShowAsTip != bCheck;
- pOpt->bAutoCmpltShowAsTip = bCheck;
-
- nVal = (USHORT)aNFMinWordlen.GetValue();
- bModified |= nVal != pOpt->nAutoCmpltWordLen;
- pOpt->nAutoCmpltWordLen = nVal;
-
- nVal = (USHORT)aNFMaxEntries.GetValue();
- bModified |= nVal != pOpt->nAutoCmpltListLen;
- pOpt->nAutoCmpltListLen = nVal;
-
- nVal = aDCBExpandKey.GetSelectEntryPos();
- if( nVal < aDCBExpandKey.GetEntryCount() )
- {
- ULONG nKey = (ULONG)aDCBExpandKey.GetEntryData( nVal );
- bModified |= nKey != pOpt->nAutoCmpltExpandKey;
- pOpt->nAutoCmpltExpandKey = (USHORT)nKey;
- }
-
- if( pAutoCmpltList && nAutoCmpltListCnt != aLBEntries.GetEntryCount() )
- {
- bModified = TRUE;
- pOpt->pAutoCmpltList = pAutoCmpltList;
- }
- if( bModified )
- {
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetModified();
- pCfg->Commit();
- }
- return TRUE;
-}
-
-void OfaAutoCompleteTabPage::Reset( const SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
-
- aCBActiv.Check( 0 != pOpt->bAutoCompleteWords );
- aCBCollect.Check( 0 != pOpt->bAutoCmpltCollectWords );
- aCBRemoveList.Check( !pOpt->bAutoCmpltKeepList ); //inverted value!
- aCBAppendSpace.Check( 0 != pOpt->bAutoCmpltAppendBlanc );
- aCBAsTip.Check( 0 != pOpt->bAutoCmpltShowAsTip );
-
- aNFMinWordlen.SetValue( pOpt->nAutoCmpltWordLen );
- aNFMaxEntries.SetValue( pOpt->nAutoCmpltListLen );
-
- // select the specific KeyCode:
- {
- ULONG nKey = pOpt->nAutoCmpltExpandKey;
- for( USHORT n = 0, nCnt = aDCBExpandKey.GetEntryCount(); n < nCnt; ++n )
- if( nKey == (ULONG)aDCBExpandKey.GetEntryData( n ))
- {
- aDCBExpandKey.SelectEntryPos( n );
- break;
- }
- }
-
- if( pOpt->pAutoCmpltList && pOpt->pAutoCmpltList->Count() )
- {
- pAutoCmpltList = (SvStringsISortDtor*)pOpt->pAutoCmpltList;
- pOpt->pAutoCmpltList = 0;
- nAutoCmpltListCnt = pAutoCmpltList->Count();
- for( USHORT n = 0; n < nAutoCmpltListCnt; ++n )
- {
- const StringPtr pStr = pAutoCmpltList->GetObject( n );
- USHORT nPos = aLBEntries.InsertEntry( *pStr );
- aLBEntries.SetEntryData( nPos, (void*)pStr );
- }
- }
- else
- {
- aLBEntries.Disable();
- aPBEntries.Disable();
- }
-
- CheckHdl( &aCBActiv );
- CheckHdl( &aCBCollect );
-}
-
-void OfaAutoCompleteTabPage::ActivatePage( const SfxItemSet& )
-{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( FALSE );
-}
-
-IMPL_LINK( OfaAutoCompleteTabPage, DeleteHdl, PushButton*, EMPTYARG )
-{
- USHORT nSelCnt = pAutoCmpltList ? aLBEntries.GetSelectEntryCount() : 0;
- while( nSelCnt )
- {
- USHORT nPos = aLBEntries.GetSelectEntryPos( --nSelCnt );
- const StringPtr pStr = (StringPtr)aLBEntries.GetEntryData( nPos );
- aLBEntries.RemoveEntry( nPos );
- nPos = pAutoCmpltList->GetPos( pStr );
- if( USHRT_MAX != nPos )
- pAutoCmpltList->Remove( nPos );
- }
- return 0;
-}
-
-IMPL_LINK( OfaAutoCompleteTabPage, CheckHdl, CheckBox*, pBox )
-{
- BOOL bEnable = pBox->IsChecked();
- if( pBox == &aCBActiv )
- {
- aCBAppendSpace.Enable( bEnable );
- aCBAppendSpace.Enable( bEnable );
- aCBAsTip.Enable( bEnable );
- aDCBExpandKey.Enable( bEnable );
- }
- else if(&aCBCollect == pBox)
- aCBRemoveList.Enable( bEnable );
- return 0;
-}
-
-void OfaAutoCompleteTabPage::CopyToClipboard() const
-{
- USHORT nSelCnt = aLBEntries.GetSelectEntryCount();
- if( pAutoCmpltList && nSelCnt )
- {
- TransferDataContainer* pCntnr = new TransferDataContainer;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::datatransfer::XTransferable > xRef( pCntnr );
-
- ByteString sData;
- const sal_Char* pLineEnd =
-#if defined(UNX)
- "\012";
-#else
- "\015\012";
-#endif
-
- rtl_TextEncoding nEncode = gsl_getSystemTextEncoding();
-
- for( USHORT n = 0; n < nSelCnt; ++n )
- {
- sData += ByteString( aLBEntries.GetSelectEntry( n ), nEncode );
- sData += pLineEnd;
- }
- pCntnr->CopyByteString( SOT_FORMAT_STRING, sData );
- pCntnr->CopyToClipboard( (Window*)this );
- }
-}
-
-long OfaAutoCompleteTabPage::AutoCompleteMultiListBox::PreNotify(
- NotifyEvent& rNEvt )
-{
- long nHandled = MultiListBox::PreNotify( rNEvt );
-
- if( !nHandled && EVENT_KEYUP == rNEvt.GetType() )
- {
- const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode();
- switch( rKeyCode.GetModifier() | rKeyCode.GetCode() )
- {
- case KEY_DELETE:
- rPage.DeleteHdl( 0 );
- nHandled = 1;
- break;
-
- default:
- if( KEYFUNC_COPY == rKeyCode.GetFunction() )
- {
- rPage.CopyToClipboard();
- nHandled = 1;
- }
- break;
- }
- }
- return nHandled;
-}
-
-// class OfaSmartTagOptionsTabPage ---------------------------------------------
-
-OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( Window* pParent,
- const SfxItemSet& rSet )
- : SfxTabPage(pParent, SVX_RES( RID_OFAPAGE_SMARTTAG_OPTIONS ), rSet),
- m_aMainCB( this, SVX_RES(CB_SMARTTAGS) ),
- m_aSmartTagTypesLB( this, SVX_RES(LB_SMARTTAGS) ),
- m_aPropertiesPB( this, SVX_RES(PB_SMARTTAGS) ),
- m_aTitleFT( this, SVX_RES(FT_SMARTTAGS) )
-{
- FreeResource();
-
- // some options for the list box:
- m_aSmartTagTypesLB.SetWindowBits( m_aSmartTagTypesLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION );
- m_aSmartTagTypesLB.SetHighlightRange();
-
- // set the handlers:
- m_aMainCB.SetToggleHdl(LINK(this, OfaSmartTagOptionsTabPage, CheckHdl));
- m_aPropertiesPB.SetClickHdl(LINK(this, OfaSmartTagOptionsTabPage, ClickHdl));
- m_aSmartTagTypesLB.SetSelectHdl(LINK(this, OfaSmartTagOptionsTabPage, SelectHdl));
-}
-
-OfaSmartTagOptionsTabPage::~OfaSmartTagOptionsTabPage()
-{
-
-}
-
-SfxTabPage* OfaSmartTagOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet)
-{
- return new OfaSmartTagOptionsTabPage( pParent, rSet );
-}
-
-/** This struct is used to associate list box entries with smart tag data
-*/
-struct ImplSmartTagLBUserData
-{
- rtl::OUString maSmartTagType;
- uno::Reference< smarttags::XSmartTagRecognizer > mxRec;
- sal_Int32 mnSmartTagIdx;
-
- ImplSmartTagLBUserData( const rtl::OUString& rSmartTagType,
- uno::Reference< smarttags::XSmartTagRecognizer > xRec,
- sal_Int32 nSmartTagIdx ) :
- maSmartTagType( rSmartTagType ),
- mxRec( xRec ),
- mnSmartTagIdx( nSmartTagIdx ) {}
-};
-
-/** Clears m_aSmartTagTypesLB
-*/
-void OfaSmartTagOptionsTabPage::ClearListBox()
-{
- const ULONG nCount = m_aSmartTagTypesLB.GetEntryCount();
- for ( USHORT i = 0; i < nCount; ++i )
- {
- const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(i);
- const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData());
- delete pUserData;
- }
-
- m_aSmartTagTypesLB.Clear();
-}
-
-/** Inserts items into m_aSmartTagTypesLB
-*/
-void OfaSmartTagOptionsTabPage::FillListBox( const SmartTagMgr& rSmartTagMgr )
-{
- // first we have to clear the list box:
- ClearListBox();
-
- // fill list box:
- const sal_uInt32 nNumberOfRecognizers = rSmartTagMgr.NumberOfRecognizers();
- const lang::Locale aLocale( SvxCreateLocale( eLastDialogLanguage ) );
- std::vector< ActionReference > aActionReferences;
-
- for ( sal_uInt32 i = 0; i < nNumberOfRecognizers; ++i )
- {
- uno::Reference< smarttags::XSmartTagRecognizer > xRec = rSmartTagMgr.GetRecognizer(i);
-
- const rtl::OUString aName = xRec->getName( aLocale );
- const rtl::OUString aDesc = xRec->getDescription( aLocale );
- const sal_Int32 nNumberOfSupportedSmartTags = xRec->getSmartTagCount();
-
- for ( sal_Int32 j = 0; j < nNumberOfSupportedSmartTags; ++j )
- {
- const rtl::OUString aSmartTagType = xRec->getSmartTagName(j);
- rtl::OUString aSmartTagCaption = rSmartTagMgr.GetSmartTagCaption( aSmartTagType, aLocale );
-
- if ( !aSmartTagCaption.getLength() )
- aSmartTagCaption = aSmartTagType;
-
- const rtl::OUString aLBEntry = aSmartTagCaption +
- OUString::createFromAscii(" (") +
- aName +
- OUString::createFromAscii(")");
-
- SvLBoxEntry* pEntry = m_aSmartTagTypesLB.SvTreeListBox::InsertEntry( aLBEntry );
- if ( pEntry )
- {
- const bool bCheck = rSmartTagMgr.IsSmartTagTypeEnabled( aSmartTagType );
- m_aSmartTagTypesLB.SetCheckButtonState( pEntry, bCheck ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
- pEntry->SetUserData(static_cast<void*>(new ImplSmartTagLBUserData( aSmartTagType, xRec, j ) ) );
- }
- }
- }
-}
-
-/** Handler for the push button
-*/
-IMPL_LINK( OfaSmartTagOptionsTabPage, ClickHdl, PushButton*, EMPTYARG )
-{
- const USHORT nPos = m_aSmartTagTypesLB.GetSelectEntryPos();
- const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(nPos);
- const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData());
- uno::Reference< smarttags::XSmartTagRecognizer > xRec = pUserData->mxRec;
- const sal_Int32 nSmartTagIdx = pUserData->mnSmartTagIdx;
-
- const lang::Locale aLocale( SvxCreateLocale( eLastDialogLanguage ) );
- if ( xRec->hasPropertyPage( nSmartTagIdx, aLocale ) )
- xRec->displayPropertyPage( nSmartTagIdx, aLocale );
-
- return 0;
-}
-
-/** Handler for the check box
-*/
-IMPL_LINK( OfaSmartTagOptionsTabPage, CheckHdl, CheckBox*, EMPTYARG )
-{
- const BOOL bEnable = m_aMainCB.IsChecked();
- m_aSmartTagTypesLB.Enable( bEnable );
- m_aSmartTagTypesLB.Invalidate();
- m_aPropertiesPB.Enable( false );
-
- // if the controls are currently enabled, we still have to check
- // if the properties button should be disabled because the currently
- // seleted smart tag type does not have a properties dialog.
- // We do this by calling SelectHdl:
- if ( bEnable )
- SelectHdl( &m_aSmartTagTypesLB );
-
- return 0;
-}
-
-/** Handler for the list box
-*/
-IMPL_LINK(OfaSmartTagOptionsTabPage, SelectHdl, SvxCheckListBox*, EMPTYARG)
-{
- if ( m_aSmartTagTypesLB.GetEntryCount() < 1 )
- return 0;
-
- const USHORT nPos = m_aSmartTagTypesLB.GetSelectEntryPos();
- const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(nPos);
- const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData());
- uno::Reference< smarttags::XSmartTagRecognizer > xRec = pUserData->mxRec;
- const sal_Int32 nSmartTagIdx = pUserData->mnSmartTagIdx;
-
- const lang::Locale aLocale( SvxCreateLocale( eLastDialogLanguage ) );
- if ( xRec->hasPropertyPage( nSmartTagIdx, aLocale ) )
- m_aPropertiesPB.Enable( sal_True );
- else
- m_aPropertiesPB.Enable( sal_False );
-
- return 0;
-}
-
-/** Propagates the current settings to the smart tag manager.
-*/
-BOOL OfaSmartTagOptionsTabPage::FillItemSet( SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
- SmartTagMgr* pSmartTagMgr = pOpt->pSmartTagMgr;
-
- // robust!
- if ( !pSmartTagMgr )
- return FALSE;
-
- BOOL bModifiedSmartTagTypes = FALSE;
- std::vector< rtl::OUString > aDisabledSmartTagTypes;
-
- const ULONG nCount = m_aSmartTagTypesLB.GetEntryCount();
-
- for ( USHORT i = 0; i < nCount; ++i )
- {
- const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(i);
- const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData());
- const BOOL bChecked = m_aSmartTagTypesLB.IsChecked(i);
- const BOOL bIsCurrentlyEnabled = pSmartTagMgr->IsSmartTagTypeEnabled( pUserData->maSmartTagType );
-
- bModifiedSmartTagTypes = bModifiedSmartTagTypes || ( !bChecked != !bIsCurrentlyEnabled );
-
- if ( !bChecked )
- aDisabledSmartTagTypes.push_back( pUserData->maSmartTagType );
-
- delete pUserData;
- }
-
- const BOOL bModifiedRecognize = ( !m_aMainCB.IsChecked() != !pSmartTagMgr->IsLabelTextWithSmartTags() );
- if ( bModifiedSmartTagTypes || bModifiedRecognize )
- {
- bool bLabelTextWithSmartTags = m_aMainCB.IsChecked() ? true : false;
- pSmartTagMgr->WriteConfiguration( bModifiedRecognize ? &bLabelTextWithSmartTags : 0,
- bModifiedSmartTagTypes ? &aDisabledSmartTagTypes : 0 );
- }
-
- return TRUE;
-}
-
-/** Sets the controls based on the current settings at SmartTagMgr.
-*/
-void OfaSmartTagOptionsTabPage::Reset( const SfxItemSet& )
-{
- SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags();
- const SmartTagMgr* pSmartTagMgr = pOpt->pSmartTagMgr;
-
- // robust, should not happen!
- if ( !pSmartTagMgr )
- return;
-
- FillListBox( *pSmartTagMgr );
- m_aSmartTagTypesLB.SelectEntryPos( 0 );
- m_aMainCB.Check( pSmartTagMgr->IsLabelTextWithSmartTags() );
- CheckHdl( &m_aMainCB );
-}
-
-void OfaSmartTagOptionsTabPage::ActivatePage( const SfxItemSet& )
-{
- ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( FALSE );
-}
-
diff --git a/svx/source/cui/autocdlg.hrc b/svx/source/cui/autocdlg.hrc
deleted file mode 100644
index 65770dbae1..0000000000
--- a/svx/source/cui/autocdlg.hrc
+++ /dev/null
@@ -1,162 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: autocdlg.hrc,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_AUTOCDLG_HRC
-#define _SVX_AUTOCDLG_HRC
-
-#include <svx/dialogs.hrc>
-
-// defines ------------------------------------------------------------------
-
-#define CLB_SETTINGS 1
-/*
-#define STR_DOUBLECAPS 3
-#define STR_STARTCAPS 4
-#define STR_FIRST 5
-#define STR_HALF 6
-#define STR_DASH 7
-#define STR_BOLDUNDERLINE 8
-#define STR_URL 9
-*/
-
-#define CB_TYPO 11
-#define FT_STARTQUOTE 12
-#define PB_STARTQUOTE 13
-#define FT_ENDQUOTE 14
-#define PB_ENDQUOTE 15
-
-#define FL_ABBREV 16
-#define ED_ABBREV 17
-#define LB_ABBREV 18
-#define PB_NEWABBREV 19
-#define PB_DELABBREV 20
-#define FL_DOUBLECAPS 21
-#define ED_DOUBLE_CAPS 22
-#define LB_DOUBLE_CAPS 23
-#define PB_NEWDOUBLECAPS 24
-#define PB_DELDOUBLECAPS 25
-
-#define ED_SHORT 31
-#define ED_REPLACE 32
-#define TLB_REPLACE 33
-#define CB_TEXT_ONLY 34
-#define PB_NEW_REPLACE 35
-#define PB_DELETE_REPLACE 36
-#define STR_MODIFY 37
-#define STR_CLOSE_AUTOCORR 38
-#define FT_SHORT 39
-#define FT_REPLACE 40
-#define STR_CHANGE_START 41
-#define STR_CHANGE_END 42
-#define CB_AUTOABBREV 43
-#define CB_AUTOCAPS 44
-
-#define FT_SGL_STARTQUOTE 45
-#define PB_SGL_STARTQUOTE 46
-#define FT_SGL_ENDQUOTE 47
-#define PB_SGL_ENDQUOTE 48
-#define PB_SGL_STD 49
-#define PB_DBL_STD 50
-#define FL_SINGLE 51
-#define FL_DOUBLE 52
-#define FT_SGSTEX 53
-#define FT_SGENEX 54
-#define FT_DBSTEX 55
-#define FT_DBECEX 56
-#define CB_SGL_TYPO 57
-#define ST_STANDARD 58
-
-#define PB_EDIT 61
-#define ST_DEL_EMPTY_PARA 62
-#define ST_TYPO 66
-#define ST_USER_STYLE 67
-#define ST_BULLET 68
-#define STR_DEL_SPACES_AT_STT_END 69
-#define STR_DEL_SPACES_BETWEEN_LINES 70
-
-#define ST_RIGHT_MARGIN 74
-#define STR_NUM 75
-#define STR_BORDER 76
-#define STR_TABLE 77
-#define STR_REPLACE_TEMPLATES 78
-#define FL_PRCNT 79
-
-#define STR_HEADER 90
-#define FT_HEADER_EXPLANATION 91
-#define STR_HEADER1 92
-#define STR_HEADER2 93
-#define FT_HEADER1_EXPLANATION 94
-#define FT_HEADER2_EXPLANATION 95
-
-#define ED_RIGHT_MARGIN 100
-#define BT_OK 101
-#define BT_CANCEL 102
-
-#define BT_AWCP_OK 110
-#define BT_AWCP_CANCEL 111
-#define GB_AWCP_VALUE 112
-#define ED_AWCP_WORD_LEN 113
-#define ED_AWCP_LIST_LEN 114
-#define FT_AWCP_WORD_LEN 115
-#define FT_AWCP_LIST_LEN 116
-
-#define CB_ACTIV 121
-#define CB_COLLECT 122
-#define CB_APPEND_SPACE 123
-#define CB_REMOVE_LIST 124
-#define CB_AS_TIP 125
-#define FT_MIN_WORDLEN 126
-#define FT_MAX_ENTRIES 127
-#define NF_MIN_WORDLEN 128
-#define NF_MAX_ENTRIES 129
-#define FT_EXPAND_KEY 130
-#define DCB_EXPAND_KEY 131
-#define LB_ENTRIES 132
-#define PB_ENTRIES 133
-
-
-#define ST_USE_REPLACE 200
-#define ST_CPTL_STT_WORD 201
-#define ST_CPTL_STT_SENT 202
-#define ST_BOLD_UNDER 203
-#define STR_NO_DBL_SPACES 204
-#define ST_DETECT_URL 205
-#define ST_ORDINAL 206
-#define ST_FRACTION 207
-#define ST_DASH 208
-#define FT_LANG 209
-#define LB_LANG 210
-
-#define CB_SMARTTAGS 220
-#define FT_SMARTTAGS 221
-#define LB_SMARTTAGS 222
-#define PB_SMARTTAGS 223
-
-#endif
-
diff --git a/svx/source/cui/autocdlg.hxx b/svx/source/cui/autocdlg.hxx
deleted file mode 100644
index f6e48d671d..0000000000
--- a/svx/source/cui/autocdlg.hxx
+++ /dev/null
@@ -1,508 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: autocdlg.hxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _OFA_AUTOCDLG_HXX
-#define _OFA_AUTOCDLG_HXX
-
-#include <svtools/langtab.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <tools/table.hxx>
-#include <svx/checklbx.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/metric.hxx>
-#include <svx/langbox.hxx>
-
-class SvxAutoCorrect;
-class CharClass;
-class CollatorWrapper;
-class SmartTagMgr;
-
-// class OfaAutoCorrDlg --------------------------------------------------
-
-class OfaAutoCorrDlg : public SfxTabDialog
-{
- FixedText aLanguageFT;
- SvxLanguageBox aLanguageLB;
-
- DECL_LINK(SelectLanguageHdl, ListBox*);
-public:
-
- OfaAutoCorrDlg(Window* pParent, const SfxItemSet *pSet );
-
- void EnableLanguage(BOOL bEnable)
- { aLanguageFT.Enable(bEnable);
- aLanguageLB.Enable(bEnable);}
-
-};
-
-#ifdef _OFA_AUTOCDLG_CXX
-#include <vcl/group.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/lstbox.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svx/simptabl.hxx>
-
-class SvStringsISortDtor;
-
-// class OfaACorrCheckListBox ------------------------------------------
-
-class OfaACorrCheckListBox : public SvxSimpleTable
-{
- using SvxSimpleTable::SetTabs;
- using SvTreeListBox::GetCheckButtonState;
- using SvTreeListBox::SetCheckButtonState;
-
- protected:
- virtual void SetTabs();
- virtual void HBarClick();
- virtual void KeyInput( const KeyEvent& rKEvt );
-
- public:
- OfaACorrCheckListBox(Window* pParent, const ResId& rResId ) :
- SvxSimpleTable( pParent, rResId ){}
-
- inline void *GetUserData(ULONG nPos) { return GetEntry(nPos)->GetUserData(); }
- inline void SetUserData(ULONG nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
- inline ULONG GetSelectEntryPos() { return GetModel()->GetAbsPos(FirstSelected()); }
-
- BOOL IsChecked(ULONG nPos, USHORT nCol = 0);
- void CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked);
- SvButtonState GetCheckButtonState( SvLBoxEntry*, USHORT nCol ) const;
- void SetCheckButtonState( SvLBoxEntry*, USHORT nCol, SvButtonState );
-};
-
-// class OfaAutocorrOptionsPage ------------------------------------------
-
-
-class OfaAutocorrOptionsPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
-
-private:
- SvxCheckListBox aCheckLB;
-
- String sInput;
- String sDoubleCaps;
- String sStartCap;
- String sBoldUnderline;
- String sURL;
- String sNoDblSpaces;
- String sHalf;
- String sDash;
- String sFirst;
-
-public:
- OfaAutocorrOptionsPage( Window* pParent, const SfxItemSet& rSet );
- ~OfaAutocorrOptionsPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
-
-};
-
-// class OfaSwAutoFmtOptionsPage ----------------------------------------------------
-
-class OfaSwAutoFmtOptionsPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
-
- OfaACorrCheckListBox aCheckLB;
- PushButton aEditPB;
- FixedText aHeader1Expl;
- FixedText aHeader2Expl;
-
- String sHeader1;
- String sHeader2;
-
- String sDeleteEmptyPara;
- String sUseReplaceTbl;
- String sCptlSttWord;
- String sCptlSttSent;
- String sTypo;
- String sUserStyle;
- String sBullet;
- String sByInputBullet;
- String sBoldUnder;
- String sNoDblSpaces;
- String sFraction;
- String sDetectURL;
- String sDash;
- String sOrdinal;
- String sRightMargin;
- String sNum;
- String sBorder;
- String sTable;
- String sReplaceTemplates;
- String sDelSpaceAtSttEnd;
- String sDelSpaceBetweenLines;
-
- String sMargin;
- String sBulletChar;
- String sByInputBulletChar;
-
- Font aBulletFont;
- Font aByInputBulletFont;
- USHORT nPercent;
-
- SvLBoxButtonData* pCheckButtonData;
-
- DECL_LINK(SelectHdl, OfaACorrCheckListBox*);
- DECL_LINK(EditHdl, PushButton*);
- SvLBoxEntry* CreateEntry(String& rTxt, USHORT nCol);
-
-
- OfaSwAutoFmtOptionsPage( Window* pParent,
- const SfxItemSet& rSet );
- ~OfaSwAutoFmtOptionsPage();
-
- public:
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
-};
-
-// class AutoCorrEdit ----------------------------------------------------
-
-class AutoCorrEdit : public Edit
-{
- Link aActionLink;
- BOOL bSpaces;
-
- public:
- AutoCorrEdit(Window* pParent, const ResId& rResId) :
- Edit(pParent, rResId), bSpaces(FALSE){}
-
- void SetActionHdl( const Link& rLink )
- { aActionLink = rLink;}
-
- void SetSpaces(BOOL bSet)
- {bSpaces = bSet;}
-
- virtual void KeyInput( const KeyEvent& rKEvent );
-};
-
-// class OfaAutocorrReplacePage ------------------------------------------
-
-class DoubleStringArray;
-typedef DoubleStringArray* DoubleStringArrayPtr;
-DECLARE_TABLE(DoubleStringTable, DoubleStringArrayPtr)
-
-class OfaAutocorrReplacePage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- CheckBox aTextOnlyCB;
- FixedText aShortFT;
- AutoCorrEdit aShortED;
- FixedText aReplaceFT;
- AutoCorrEdit aReplaceED;
- SvTabListBox aReplaceTLB;
- PushButton aNewReplacePB;
- PushButton aDeleteReplacePB;
-
- String sModify;
- String sNew;
-
- SvStringsISortDtor* pFormatText;
- DoubleStringTable aDoubleStringTable;
- CollatorWrapper* pCompareClass;
- CollatorWrapper* pCompareCaseClass;
- CharClass* pCharClass;
- LanguageType eLang;
-
- BOOL bHasSelectionText;
- BOOL bFirstSelect:1;
- BOOL bReplaceEditChanged:1;
- BOOL bSWriter:1;
-
- DECL_LINK(SelectHdl, SvTabListBox*);
- DECL_LINK(NewDelHdl, PushButton*);
- DECL_LINK(ModifyHdl, Edit*);
-
- void RefillReplaceBox(BOOL bFromReset, //Box mit neuer Sprache fuellen
- LanguageType eOldLanguage,
- LanguageType eNewLanguage);
-
-public:
- OfaAutocorrReplacePage( Window* pParent, const SfxItemSet& rSet );
- ~OfaAutocorrReplacePage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
- void SetLanguage(LanguageType eSet);
-};
-
-// class OfaAutocorrExceptPage ---------------------------------------------
-
-struct StringsArrays;
-typedef StringsArrays* StringsArraysPtr;
-DECLARE_TABLE(StringsTable, StringsArraysPtr)
-
-class OfaAutocorrExceptPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aAbbrevFL;
- AutoCorrEdit aAbbrevED;
- ListBox aAbbrevLB;
- PushButton aNewAbbrevPB;
- PushButton aDelAbbrevPB;
- CheckBox aAutoAbbrevCB;
-
- FixedLine aDoubleCapsFL;
- AutoCorrEdit aDoubleCapsED;
- ListBox aDoubleCapsLB;
- PushButton aNewDoublePB;
- PushButton aDelDoublePB;
- CheckBox aAutoCapsCB;
-
- StringsTable aStringsTable;
- CollatorWrapper* pCompareClass;
- LanguageType eLang;
-
- DECL_LINK(NewDelHdl, PushButton*);
- DECL_LINK(SelectHdl, ListBox*);
- DECL_LINK(ModifyHdl, Edit*);
-
- void RefillReplaceBoxes(BOOL bFromReset, //Box mit neuer Sprache fuellen
- LanguageType eOldLanguage,
- LanguageType eNewLanguage);
-public:
- OfaAutocorrExceptPage( Window* pParent, const SfxItemSet& rSet );
- ~OfaAutocorrExceptPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
- void SetLanguage(LanguageType eSet);
-
-};
-
-// class OfaQuoteTabPage -------------------------------------------------
-
-class OfaQuoteTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
-
-private:
-
- FixedLine aSingleFL;
- CheckBox aSingleTypoCB;
- FixedText aSglStartQuoteFT;
- PushButton aSglStartQuotePB;
- FixedText aSglStartExFT;
- FixedText aSglEndQuoteFT;
- PushButton aSglEndQuotePB;
- FixedText aSglEndExFT;
- PushButton aSglStandardPB;
-
- FixedLine aDoubleFL;
- CheckBox aTypoCB;
- FixedText aStartQuoteFT;
- PushButton aStartQuotePB;
- FixedText aDblStartExFT;
- FixedText aEndQuoteFT;
- PushButton aEndQuotePB;
- FixedText aDblEndExFT;
- PushButton aDblStandardPB;
-
- String sStartQuoteDlg;
- String sEndQuoteDlg;
-
- String sStandard;
-
-
- sal_UCS4 cSglStartQuote;
- sal_UCS4 cSglEndQuote;
-
- sal_UCS4 cStartQuote;
- sal_UCS4 cEndQuote;
-
- DECL_LINK( QuoteHdl, PushButton* );
- DECL_LINK( StdQuoteHdl, PushButton* );
-
- String ChangeStringExt_Impl( sal_UCS4 );
-
- OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet );
-public:
- ~OfaQuoteTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
-};
-
-// class OfaAutoCompleteTabPage ---------------------------------------------
-
-class OfaAutoCompleteTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
-
- class AutoCompleteMultiListBox : public MultiListBox
- {
- OfaAutoCompleteTabPage& rPage;
- public:
- AutoCompleteMultiListBox( OfaAutoCompleteTabPage& rPg,
- const ResId& rResId )
- : MultiListBox( &rPg, rResId ), rPage( rPg ) {}
-
- virtual long PreNotify( NotifyEvent& rNEvt );
- };
-
- CheckBox aCBActiv; //Enable word completion
- CheckBox aCBAppendSpace;//Append space
- CheckBox aCBAsTip; //Show as tip
-
- CheckBox aCBCollect;//Collect words
- CheckBox aCBRemoveList;//...save the list for later use...
- //--removed--CheckBox aCBEndless;//
-
- FixedText aFTExpandKey;
- ListBox aDCBExpandKey;
- FixedText aFTMinWordlen;
- NumericField aNFMinWordlen;
- FixedText aFTMaxEntries;
- NumericField aNFMaxEntries;
- AutoCompleteMultiListBox aLBEntries;
- PushButton aPBEntries;
- SvStringsISortDtor* pAutoCmpltList;
- USHORT nAutoCmpltListCnt;
-
- DECL_LINK( CheckHdl, CheckBox* );
-
- OfaAutoCompleteTabPage( Window* pParent,
- const SfxItemSet& rSet );
-public:
- virtual ~OfaAutoCompleteTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
-
- void CopyToClipboard() const;
- DECL_LINK( DeleteHdl, PushButton* );
-};
-
-// class OfaSmartTagOptionsTabPage ---------------------------------------------
-
-/** Smart tag options tab page
-
- This tab page is used to enable/disable smart tag types
-*/
-class OfaSmartTagOptionsTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
-
-private:
-
- // controls
- CheckBox m_aMainCB;
- SvxCheckListBox m_aSmartTagTypesLB;
- PushButton m_aPropertiesPB;
- FixedText m_aTitleFT;
-
- // construction via Create()
- OfaSmartTagOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
-
- /** Inserts items into m_aSmartTagTypesLB
-
- Reads out the smart tag types supported by the SmartTagMgr and
- inserts the associated strings into the list box.
- */
- void FillListBox( const SmartTagMgr& rSmartTagMgr );
-
- /** Clears the m_aSmartTagTypesLB
- */
- void ClearListBox();
-
- /** Handler for the check box
-
- Enables/disables all controls in the tab page (except from the
- check box.
- */
- DECL_LINK( CheckHdl, CheckBox* );
-
- /** Handler for the push button
-
- Calls the displayPropertyPage function of the smart tag recognizer
- associated with the currently selected smart tag type.
- */
- DECL_LINK( ClickHdl, PushButton* );
-
- /** Handler for the list box
-
- Enables/disables the properties push button if selection in the
- smart tag types list box changes.
- */
- DECL_LINK( SelectHdl, SvxCheckListBox* );
-
-public:
-
- virtual ~OfaSmartTagOptionsTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void ActivatePage( const SfxItemSet& );
-};
-
-#endif // _OFA_AUTOCDLG_CXX
-
-#endif //
-
diff --git a/svx/source/cui/autocdlg.src b/svx/source/cui/autocdlg.src
deleted file mode 100644
index 0d9bc123d4..0000000000
--- a/svx/source/cui/autocdlg.src
+++ /dev/null
@@ -1,856 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: autocdlg.src,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ------------------------------------------------------------------
-#include <svx/svxids.hrc>
-#include "autocdlg.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
- // pragma -------------------------------------------------------------------
-/**************************************************************************/
-/* */
-/* TabDialog RID_OFA_AUTOCORR_DLG */
-/* */
-/**************************************************************************/
-TabDialog RID_OFA_AUTOCORR_DLG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Text [ en-US ] = "AutoCorrect" ;
- Moveable = TRUE ;
- TabControl 1
- {
- SVLook = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_OFAPAGE_AUTOCORR_REPLACE ;
- Text [ en-US ] = "Replace" ;
- };
- PageItem
- {
- Identifier = RID_OFAPAGE_AUTOCORR_EXCEPT ;
- Text [ en-US ] = "Exceptions" ;
- };
- PageItem
- {
- Identifier = RID_OFAPAGE_AUTOCORR_OPTIONS ;
- Text [ en-US ] = "Options" ;
- };
- PageItem
- {
- Identifier = RID_OFAPAGE_AUTOFMT_APPLY ;
- Text [ en-US ] = "Options" ;
- };
- PageItem
- {
- Identifier = RID_OFAPAGE_AUTOCORR_QUOTE ;
- Text [ en-US ] = "Custom Quotes" ;
- };
- PageItem
- {
- Identifier = RID_OFAPAGE_AUTOCOMPLETE_OPTIONS ;
- Text [ en-US ] = "Word Completion";
- };
- PageItem
- {
- Identifier = RID_OFAPAGE_SMARTTAG_OPTIONS ;
- Text [ en-US ] = "Smart Tags";
- };
- };
- };
- FixedText FT_LANG
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 140 , 8 ) ;
-
- Left = TRUE ;
- Text [ en-US ] = "Replacements and exceptions for language:";
- };
- ListBox LB_LANG
- {
- Pos = MAP_APPFONT ( 150 , 3 ) ;
- Size = MAP_APPFONT ( 60 , 100 ) ;
- DropDown = TRUE;
- TabStop = TRUE ;
- Border = TRUE ;
- };
-};
-#define COMMON_CLB_ENTRIES \
- String ST_USE_REPLACE \
- { \
- Text [ en-US ] = "Use replacement table" ; \
- }; \
- String ST_CPTL_STT_WORD \
- { \
- Text [ en-US ] = "Correct TWo INitial CApitals" ; \
- }; \
- String ST_CPTL_STT_SENT \
- { \
- Text [ en-US ] = "Capitalize first letter of every sentence" ; \
- }; \
- String ST_BOLD_UNDER \
- { \
- Text [ en-US ] = "Automatic *bold* and _underline_" ; \
- }; \
- String STR_NO_DBL_SPACES \
- { \
- Text [ en-US ] = "Ignore double spaces" ; \
- }; \
- String ST_DETECT_URL \
- { \
- Text [ en-US ] = "URL Recognition" ; \
- }; \
- String ST_ORDINAL \
- { \
- Text [ en-US ] = "Replace 1st... with 1^st..." ; \
- }; \
- String ST_FRACTION \
- { \
- Text [ en-US ] = "Replace 1/2 ... with ½ ..." ; \
- }; \
- String ST_DASH \
- { \
- Text [ en-US ] = "Replace dashes" ; \
- };
-
-/**************************************************************************/
-/* */
-/* Beschreibung: Autokorrektur-Optionen */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOCORR_OPTIONS
-{
- HelpId = HID_OFAPAGE_AUTOCORR_OPTIONS ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- SVLook = TRUE ;
- Text [ en-US ] = "Settings" ;
- Control CLB_SETTINGS
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 248 , 173 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- COMMON_CLB_ENTRIES
-};
-/**************************************************************************/
-/* */
-/* */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOFMT_APPLY
-{
- HelpID = HID_OFAPAGE_AUTOFMT_OPTIONS ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Control CLB_SETTINGS
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 248 , 149 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_EDIT
- {
- Pos = MAP_APPFONT ( 6 , 162 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
- TabStop = TRUE ;
- };
- String STR_HEADER1
- {
- Text [ en-US ] = "[M]" ;
- };
- String STR_HEADER2
- {
- Text [ en-US ] = "[T]" ;
- };
- FixedText FT_HEADER1_EXPLANATION
- {
- Pos = MAP_APPFONT ( 80 , 159 ) ;
- Size = MAP_APPFONT ( 174 , 8 ) ;
- Text [ en-US ] = "[M]: Replace while modifying existing text" ;
- };
- FixedText FT_HEADER2_EXPLANATION
- {
- Pos = MAP_APPFONT ( 80 , 171 ) ;
- Size = MAP_APPFONT ( 174 , 8 ) ;
- Text [ en-US ] = "[T]: AutoFormat/AutoCorrect while typing" ;
- };
- COMMON_CLB_ENTRIES
- String ST_DEL_EMPTY_PARA
- {
- /* ### ACHTUNG: Neuer Text in Resource? Leere Absätze entfernen : Leere Absõtze entfernen */
- Text [ en-US ] = "Remove blank paragraphs" ;
- };
- String ST_TYPO
- {
- Text [ en-US ] = "Replace \"standard\" quotes with %1custom%2 quotes" ;
- };
- String ST_USER_STYLE
- {
- Text [ en-US ] = "Replace Custom Styles" ;
- };
- String ST_BULLET
- {
- Text [ en-US ] = "Replace bullets with: " ;
- };
- String ST_RIGHT_MARGIN
- {
- /* ### ACHTUNG: Neuer Text in Resource? Zusammenfassen von einzeiligen Absätzen ab : Zusammenfassen von einzeiligen Absõtzen ab */
- // Text [ norwegian_wrong ] = "+++Combine single line paragraphs at" ;
- // Text [ swedish_wrong ] = ~Kombinera enradiga stycken B738vid " ;
- Text [ en-US ] = "Combine single line paragraphs if length greater than" ;
- };
- String STR_NUM
- {
- Text [ en-US ] = "Apply numbering - symbol: " ;
- };
- String STR_BORDER
- {
- Text [ en-US ] = "Apply border" ;
- };
- String STR_TABLE
- {
- Text [ en-US ] = "Create table" ;
- };
- String STR_REPLACE_TEMPLATES
- {
- Text [ en-US ] = "Apply Styles" ;
- };
- String STR_DEL_SPACES_AT_STT_END
- {
- Text [ en-US ] = "Delete spaces and tabs at beginning and end of paragraph";
- };
- String STR_DEL_SPACES_BETWEEN_LINES
- {
- Text [ en-US ] = "Delete spaces and tabs at end and start of line";
- };
-};
-
-ModalDialog RID_OFADLG_PRCNT_SET
-{
- HelpID = SID_AUTOFORMAT ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 155 , 43 ) ;
- Moveable = TRUE ;
- FixedLine FL_PRCNT
- {
- Pos = MAP_APPFONT ( 4 , 3 ) ;
- Size = MAP_APPFONT ( 87 , 8 ) ;
- Text [ en-US ] = "Minimum size" ;
- };
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 99 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 99 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- MetricField ED_RIGHT_MARGIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 7 , 14 ) ;
- Size = MAP_APPFONT ( 31 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- Value = 77 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- First = 10 ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- Text [ en-US ] = "Combine" ;
-};
-
-/**************************************************************************/
-/* */
-/* Beschreibung: Ersetzungstabelle */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOCORR_REPLACE
-{
- HelpId = HID_OFAPAGE_AUTOCORR_REPLACE ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- FixedText FT_SHORT
- {
- Pos = MAP_APPFONT ( 7 , 3 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "Repla~ce" ;
- Left = TRUE ;
- };
- Edit ED_SHORT
- {
- Pos = MAP_APPFONT ( 7 , 13 ) ;
- Size = MAP_APPFONT ( 60 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_REPLACE
- {
- Pos = MAP_APPFONT ( 71 , 3 ) ;
- Size = MAP_APPFONT ( 64 , 8 ) ;
- Text [ en-US ] = "~With:" ;
- Left = TRUE ;
- };
- Edit ED_REPLACE
- {
- Pos = MAP_APPFONT ( 71 , 13 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- CheckBox CB_TEXT_ONLY
- {
- Pos = MAP_APPFONT ( 140 , 3 ) ;
- Size = MAP_APPFONT ( 108 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Text only" ;
- };
- PushButton PB_NEW_REPLACE
- {
- Pos = MAP_APPFONT ( 198 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~New" ;
- };
- PushButton PB_DELETE_REPLACE
- {
- Pos = MAP_APPFONT ( 198 , 32 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Delete" ;
- };
- Control TLB_REPLACE
- {
- HelpId = HID_OFACTL_AUTOCORR_REPLACE ;
- Pos = MAP_APPFONT ( 7 , 29 ) ;
- Size = MAP_APPFONT ( 187 , 150 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- String STR_MODIFY
- {
- Text [ en-US ] = "~Replace" ;
- };
-};
-/**************************************************************************/
-/* */
-/* Beschreibung: Ausnahmelisten */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOCORR_EXCEPT
-{
- HelpId = HID_OFAPAGE_AUTOCORR_EXCEPT ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- FixedLine FL_ABBREV
- {
- Pos = MAP_APPFONT ( 4 , 3 ) ;
- Size = MAP_APPFONT ( 252 , 8 ) ;
- Text [ en-US ] = "Abbreviations (no subsequent capital)" ;
- };
- Edit ED_ABBREV
- {
- Pos = MAP_APPFONT ( 7 , 14 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- TabStop = TRUE ;
- Border = TRUE ;
- };
- ListBox LB_ABBREV
- {
- Pos = MAP_APPFONT ( 7 , 30 ) ;
- Size = MAP_APPFONT ( 123 , 58 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- SORT = TRUE ;
- Border = TRUE ;
- };
- PushButton PB_NEWABBREV
- {
- Pos = MAP_APPFONT ( 198 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Disable = TRUE ;
- Text [ en-US ] = "~New" ;
- };
- PushButton PB_DELABBREV
- {
- Pos = MAP_APPFONT ( 198 , 31 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Disable = TRUE ;
- Text [ en-US ] = "~Delete" ;
- };
- CheckBox CB_AUTOABBREV
- {
- Pos = MAP_APPFONT ( 137 , 78 ) ;
- Size = MAP_APPFONT ( 111 , 10 ) ;
- Text [ en-US ] = "~AutoInclude";
- Text [ en-US ] = "~AutoInclude" ;
- TabStop = TRUE ;
- };
- FixedLine FL_DOUBLECAPS
- {
- Pos = MAP_APPFONT ( 4 , 94 ) ;
- Size = MAP_APPFONT ( 252 , 8 ) ;
- Text [ en-US ] = "Words with TWo INitial CApitals" ;
- };
- Edit ED_DOUBLE_CAPS
- {
- Pos = MAP_APPFONT ( 7 , 105 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- TabStop = TRUE ;
- Border = TRUE ;
- };
- ListBox LB_DOUBLE_CAPS
- {
- Pos = MAP_APPFONT ( 7 , 120 ) ;
- Size = MAP_APPFONT ( 123 , 59 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- SORT = TRUE ;
- Border = TRUE ;
- };
- PushButton PB_NEWDOUBLECAPS
- {
- Pos = MAP_APPFONT ( 198 , 105 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- Text [ en-US ] = "Ne~w" ;
- };
- PushButton PB_DELDOUBLECAPS
- {
- Pos = MAP_APPFONT ( 198 , 122 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- Text [ en-US ] = "Dele~te" ;
- };
- CheckBox CB_AUTOCAPS
- {
- Pos = MAP_APPFONT ( 137 , 169 ) ;
- Size = MAP_APPFONT ( 111 , 10 ) ;
- Text [ en-US ] = "A~utoInclude";
- Text [ en-US ] = "A~utoInclude" ;
- };
-};
-/**************************************************************************/
-/* */
-/* Beschreibung: Typografische Anfuehrungszeichen */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOCORR_QUOTE
-{
- HelpId = HID_OFAPAGE_AUTOCORR_QUOTE ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "Custom Quotes" ;
- FixedLine FL_SINGLE
- {
- Pos = MAP_APPFONT ( 4 , 3 ) ;
- Size = MAP_APPFONT ( 252 , 8 ) ;
- Text [ en-US ] = "Single quotes" ;
- };
- Checkbox CB_SGL_TYPO
- {
- Pos = MAP_APPFONT ( 7 , 14 ) ;
- Size = MAP_APPFONT ( 86 , 10 ) ;
- Text [ en-US ] = "Repla~ce" ;
- };
- FixedText FT_SGL_STARTQUOTE
- {
- Pos = MAP_APPFONT ( 7 , 30 ) ;
- Size = MAP_APPFONT ( 86 , 8 ) ;
- Text [ en-US ] = "~Start quote:" ;
- };
- PushButton PB_SGL_STARTQUOTE
- {
- Pos = MAP_APPFONT ( 105 , 28 ) ;
- Size = MAP_APPFONT ( 12 , 12 ) ;
- Text = "\'" ;
- TabStop = TRUE ;
- };
- FixedText FT_SGSTEX
- {
- Pos = MAP_APPFONT ( 124 , 30 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- };
- FixedText FT_SGL_ENDQUOTE
- {
- Pos = MAP_APPFONT ( 7 , 46 ) ;
- Size = MAP_APPFONT ( 86 , 8 ) ;
- Text [ en-US ] = "~End quote:" ;
- };
- PushButton PB_SGL_ENDQUOTE
- {
- Pos = MAP_APPFONT ( 105 , 44 ) ;
- Size = MAP_APPFONT ( 12 , 12 ) ;
- Text = "\'" ;
- TabStop = TRUE ;
- };
- FixedText FT_SGENEX
- {
- Pos = MAP_APPFONT ( 124 , 46 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- };
- PushButton PB_SGL_STD
- {
- Pos = MAP_APPFONT ( 198 , 63 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Default" ;
- };
- FixedLine FL_DOUBLE
- {
- Pos = MAP_APPFONT ( 4 , 83 ) ;
- Size = MAP_APPFONT ( 252 , 8 ) ;
- Text [ en-US ] = "Double quotes" ;
- };
- CheckBox CB_TYPO
- {
- Pos = MAP_APPFONT ( 7 , 94 ) ;
- Size = MAP_APPFONT ( 86 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Repl~ace" ;
- };
- FixedText FT_STARTQUOTE
- {
- Pos = MAP_APPFONT ( 7 , 110 ) ;
- Size = MAP_APPFONT ( 86 , 8 ) ;
- Text [ en-US ] = "Start q~uote:" ;
- };
- PushButton PB_STARTQUOTE
- {
- Pos = MAP_APPFONT ( 105 , 108 ) ;
- Size = MAP_APPFONT ( 12 , 12 ) ;
- Text = "\"" ;
- TabStop = TRUE ;
- };
- FixedText FT_DBSTEX
- {
- Pos = MAP_APPFONT ( 124 , 110 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- };
- FixedText FT_ENDQUOTE
- {
- Pos = MAP_APPFONT ( 7 , 126 ) ;
- Size = MAP_APPFONT ( 86 , 10 ) ;
- Text [ en-US ] = "E~nd quote:" ;
- };
- PushButton PB_ENDQUOTE
- {
- Pos = MAP_APPFONT ( 105 , 124 ) ;
- Size = MAP_APPFONT ( 12 , 12 ) ;
- Text = "\"" ;
- TabStop = TRUE ;
- };
- FixedText FT_DBECEX
- {
- Pos = MAP_APPFONT ( 124 , 126 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- };
- PushButton PB_DBL_STD
- {
- Pos = MAP_APPFONT ( 195 , 143 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "De~fault" ;
- };
- String STR_CHANGE_START
- {
- Text [ en-US ] = "Start quote" ;
- };
- String STR_CHANGE_END
- {
- Text [ en-US ] = "End quote" ;
- };
- String ST_STANDARD
- {
- Text [ en-US ] = "Default" ;
- };
-};
-
-/**************************************************************************/
-/* */
-/* Beschreibung: automatische Wortergänzung */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOCOMPLETE_OPTIONS
-{
- HelpId = HID_OFAPAGE_AUTOCOMPLETE_OPTIONS ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- CheckBox CB_ACTIV
- {
- Pos = MAP_APPFONT( 4, 3 );
- Size = MAP_APPFONT( 116, 10 );
- Text [ en-US ] = "Enable word ~completion";
- };
- CheckBox CB_APPEND_SPACE
- {
- Pos = MAP_APPFONT( 10, 17 );
- Size = MAP_APPFONT( 110, 10 );
- Text [ en-US ] = "~Append space";
- };
- CheckBox CB_AS_TIP
- {
- Pos = MAP_APPFONT( 10, 31 );
- Size = MAP_APPFONT( 110, 10 );
- Text [ en-US ] = "~Show as tip";
- };
- CheckBox CB_COLLECT
- {
- Pos = MAP_APPFONT( 4, 45 );
- Size = MAP_APPFONT( 116, 10 );
- Text [ en-US ] = "C~ollect words";
- };
- CheckBox CB_REMOVE_LIST
- {
- Pos = MAP_APPFONT( 10, 59 );
- Size = MAP_APPFONT( 110, 40 );
- WordBreak = TRUE;
- Text [ en-US ] = "~When closing a document, remove the words collected from it from the list";
- };
- FixedText FT_EXPAND_KEY
- {
- Pos = MAP_APPFONT( 4, 102 );
- Size = MAP_APPFONT( 116, 8 );
- Text [ en-US ] = "Acc~ept with";
- };
- ListBox DCB_EXPAND_KEY
- {
- Pos = MAP_APPFONT( 4, 113 );
- Size = MAP_APPFONT( 116, 60 );
- TabStop = TRUE;
- DropDown = TRUE;
- Group = TRUE;
- Sort = FALSE;
- };
- FixedText FT_MIN_WORDLEN
- {
- Pos = MAP_APPFONT( 4, 129 );
- Size = MAP_APPFONT( 116, 8 );
- Text [ en-US ] = "Mi~n. word length";
- };
- NumericField NF_MIN_WORDLEN
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 4, 140 );
- Size = MAP_APPFONT( 30, 12 );
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Value = 10 ;
- Minimum = 5 ;
- First = 5 ;
- Last = 100 ;
- Maximum = 100 ;
- SpinSize = 1 ;
- };
- FixedText FT_MAX_ENTRIES
- {
- Pos = MAP_APPFONT( 4, 156 );
- Size = MAP_APPFONT( 116, 8 );
- Text [ en-US ] = "~Max. entries";
- };
- NumericField NF_MAX_ENTRIES
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 4, 167 );
- Size = MAP_APPFONT( 30, 12 );
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Value = 500 ;
- Maximum = 10000;
- Last = 10000 ;
- First = 50 ;
- Minimum = 50;
- SpinSize = 25 ;
- };
- MultiListBox LB_ENTRIES
- {
- Pos = MAP_APPFONT( 127, 3 );
- Size = MAP_APPFONT( 121, 158 );
- TabStop = TRUE;
- DropDown = FALSE;
- Group = TRUE;
- Border = TRUE;
- Sort = TRUE;
- };
- PushButton PB_ENTRIES
- {
- Pos = MAP_APPFONT( 127, 165 );
- Size = MAP_APPFONT( 121, 14 );
- TabStop = TRUE ;
- Text [ en-US ] = "~Delete Entry";
- };
- Text [ en-US ] = "Word Completion";
-};
-
-
-/**************************************************************************/
-/* */
-/* Beschreibung: Smart Tag Options */
-/* */
-/**************************************************************************/
-TabPage RID_OFAPAGE_SMARTTAG_OPTIONS
-{
- HelpId = HID_OFAPAGE_SMARTTAG_OPTIONS ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "Smart Tags";
-
- CheckBox CB_SMARTTAGS
- {
- Pos = MAP_APPFONT( 4, 3 );
- Size = MAP_APPFONT( 116, 10 );
- Text [ en-US ] = "Label text with smart tags";
- };
-
- FixedText FT_SMARTTAGS
- {
- Pos = MAP_APPFONT( 12, 15 );
- Size = MAP_APPFONT( 116, 8 );
- Text [ en-US ] = "Currently installed smart tags";
- };
-
- Control LB_SMARTTAGS
- {
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 172 , 154 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
-
- PushButton PB_SMARTTAGS
- {
- Pos = MAP_APPFONT ( 188 , 25 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Properties...";
- };
-
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/backgrnd.cxx b/svx/source/cui/backgrnd.cxx
deleted file mode 100644
index f297f052e8..0000000000
--- a/svx/source/cui/backgrnd.cxx
+++ /dev/null
@@ -1,1990 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: backgrnd.cxx,v $
- * $Revision: 1.39 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <svtools/pathoptions.hxx>
-#include <svtools/intitem.hxx>
-#include <vcl/msgbox.hxx>
-#include <tools/urlobj.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/docfile.hxx>
-#include <svtools/wallitem.hxx>
-#include <svtools/cntwall.hxx>
-#ifndef _CNTIDS_HRC
-#include <sfx2/cntids.hrc>
-#endif
-
-#define _SVX_BACKGRND_CXX
-
-#include <svx/dialogs.hrc>
-#include "backgrnd.hrc"
-#include <svx/svxitems.hrc>
-
-
-
-
-// Tabellenhintergrund
-#define TBL_DEST_CELL 0
-#define TBL_DEST_ROW 1
-#define TBL_DEST_TBL 2
-
-#include <svx/brshitem.hxx>
-#include "backgrnd.hxx"
-
-#include <svx/xtable.hxx>
-#include "opengrf.hxx"
-#include "impgrf.hxx"
-#include "svxerr.hxx"
-#include "drawitem.hxx"
-#include <svx/dialmgr.hxx>
-#include "htmlmode.hxx"
-#ifndef _SVT_CONTROLDIMS_HRC_
-#include <svtools/controldims.hrc>
-#endif
-#include <svx/svxids.hrc> //CHINA001
-#include "flagsdef.hxx" //CHINA001
-#include <svtools/intitem.hxx> //CHINA001
-#include <sfx2/request.hxx> //CHINA001
-using namespace ::com::sun::star;
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_VIEW_FLD_PIC, SID_VIEW_FLD_PIC,
- SID_ATTR_BRUSH, SID_ATTR_BRUSH,
- SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR,
- 0
-};
-
-struct SvxBackgroundTable_Impl
-{
- SvxBrushItem* pCellBrush;
- SvxBrushItem* pRowBrush;
- SvxBrushItem* pTableBrush;
- USHORT nCellWhich;
- USHORT nRowWhich;
- USHORT nTableWhich;
- USHORT nActPos;
-
- SvxBackgroundTable_Impl() :
- pCellBrush(NULL), pRowBrush(NULL), pTableBrush(NULL),
- nCellWhich(0), nRowWhich(0), nTableWhich(0) {}
-};
-
-struct SvxBackgroundPara_Impl
-{
- SvxBrushItem* pParaBrush;
- SvxBrushItem* pCharBrush;
-
- USHORT nActPos;
-
- SvxBackgroundPara_Impl() :
- pParaBrush(NULL), pCharBrush(NULL) {}
-};
-
-struct SvxBackgroundPage_Impl
-{
- Timer* pLoadTimer;
- BOOL bIsImportDlgInExecute;
-
- SvxBackgroundPage_Impl() :
- pLoadTimer(NULL), bIsImportDlgInExecute(FALSE) {}
-};
-/* -----------------------------15.08.2002 12:21------------------------------
-
- ---------------------------------------------------------------------------*/
-inline BYTE lcl_PercentToTransparency(long nPercent)
-{
- //0xff must not be returned!
- return BYTE(nPercent ? (50 + 0xfe * nPercent) / 100 : 0);
-}
-inline BYTE lcl_TransparencyToPercent(BYTE nTrans)
-{
- return (nTrans * 100 + 127) / 254;
-}
-void lcl_SetTransparency(SvxBrushItem& rBrush, long nTransparency)
-{
- uno::Any aTransparency;
- aTransparency <<= (sal_Int8)nTransparency;
- rBrush.PutValue(aTransparency, MID_GRAPHIC_TRANSPARENCY);
-}
-//-------------------------------------------------------------------------
-
-/* [Beschreibung]
-
-*/
-
-USHORT GetItemId_Impl( ValueSet& rValueSet, const Color& rCol )
-{
- BOOL bFound = FALSE;
- USHORT nCount = rValueSet.GetItemCount();
- USHORT n = 1;
-
- while ( !bFound && n <= nCount )
- {
- Color aValCol = rValueSet.GetItemColor(n);
-
- bFound = ( aValCol.GetRed() == rCol.GetRed()
- && aValCol.GetGreen() == rCol.GetGreen()
- && aValCol.GetBlue() == rCol.GetBlue() );
-
- if ( !bFound )
- n++;
- }
- return bFound ? n : 0;
-}
-
-// class BackgroundPreview -----------------------------------------------
-
-/* [Beschreibung]
-
- Vorschaufenster f"ur Brush oder Bitmap
-*/
-
-class BackgroundPreviewImpl : public Window
-{
-public:
- BackgroundPreviewImpl( Window* pParent,
- const ResId& rResId, BOOL bIsBmpPreview );
- ~BackgroundPreviewImpl();
-
- void NotifyChange( const Color& rColor );
- void NotifyChange( const Bitmap* pBitmap );
-
-protected:
- virtual void Paint( const Rectangle& rRect );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-private:
- const BOOL bIsBmp;
- Bitmap* pBitmap;
- Point aDrawPos;
- Size aDrawSize;
- Rectangle aDrawRect;
- BYTE nTransparency;
-};
-
-//-----------------------------------------------------------------------
-
-BackgroundPreviewImpl::BackgroundPreviewImpl
-(
- Window* pParent,
- const ResId& rResId,
- BOOL bIsBmpPreview
-) :
-
-/* [Beschreibung]
-
-*/
-
- Window( pParent, rResId ),
-
- bIsBmp ( bIsBmpPreview ),
- pBitmap ( NULL ),
- aDrawRect( Point(0,0), GetOutputSizePixel() ),
- nTransparency(0)
-
-{
- SetBorderStyle(WINDOW_BORDER_MONO);
- Paint( aDrawRect );
-}
-
-//-----------------------------------------------------------------------
-
-BackgroundPreviewImpl::~BackgroundPreviewImpl()
-
-/* [Beschreibung]
-
-*/
-
-{
- delete pBitmap;
-}
-
-//-----------------------------------------------------------------------
-void BackgroundPreviewImpl::NotifyChange( const Color& rColor )
-{
- if ( !bIsBmp )
- {
- const static Color aTranspCol( COL_TRANSPARENT );
-
- nTransparency = lcl_TransparencyToPercent( rColor.GetTransparency() );
-
- SetFillColor( rColor == aTranspCol ? GetSettings().GetStyleSettings().GetFieldColor() : (Color) rColor.GetRGBColor() );
- Paint( aDrawRect );
- }
-}
-
-//-----------------------------------------------------------------------
-
-void BackgroundPreviewImpl::NotifyChange( const Bitmap* pNewBitmap )
-/* [Beschreibung]
-
-*/
-
-{
- if ( bIsBmp && (pNewBitmap || pBitmap) )
- {
- if ( pNewBitmap && pBitmap )
- *pBitmap = *pNewBitmap;
- else if ( pNewBitmap && !pBitmap )
- pBitmap = new Bitmap( *pNewBitmap );
- else if ( !pNewBitmap )
- DELETEZ( pBitmap );
-
- if ( pBitmap )
- {
- Size aSize = GetOutputSizePixel();
- // InnerSize == Size without one pixel border
- Size aInnerSize = aSize;
- aInnerSize.Width() -= 2;
- aInnerSize.Height() -= 2;
- aDrawSize = pBitmap->GetSizePixel();
-
- // bitmap bigger than preview window?
- if ( aDrawSize.Width() > aInnerSize.Width() )
- {
- aDrawSize.Height() = aDrawSize.Height() * aInnerSize.Width() / aDrawSize.Width();
- if ( aDrawSize.Height() > aInnerSize.Height() )
- {
- aDrawSize.Width() = aDrawSize.Height();
- aDrawSize.Height() = aInnerSize.Height();
- }
- else
- aDrawSize.Width() = aInnerSize.Width();
- }
- else if ( aDrawSize.Height() > aInnerSize.Height() )
- {
- aDrawSize.Width() = aDrawSize.Width() * aInnerSize.Height() / aDrawSize.Height();
- if ( aDrawSize.Width() > aInnerSize.Width() )
- {
- aDrawSize.Height() = aDrawSize.Width();
- aDrawSize.Width() = aInnerSize.Width();
- }
- else
- aDrawSize.Height() = aInnerSize.Height();
- }
-
- aDrawPos.X() = (aSize.Width() - aDrawSize.Width()) / 2;
- aDrawPos.Y() = (aSize.Height() - aDrawSize.Height()) / 2;
- }
- Invalidate( aDrawRect );
- Update();
- }
-}
-
-//-----------------------------------------------------------------------
-
-void BackgroundPreviewImpl::Paint( const Rectangle& )
-{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- SetBackground(Wallpaper(rStyleSettings.GetWindowColor()));
- SetLineColor();
- if(bIsBmp)
- SetFillColor( Color(COL_TRANSPARENT) );
- DrawRect( aDrawRect );
- if ( bIsBmp )
- {
- if ( pBitmap )
- DrawBitmap( aDrawPos, aDrawSize, *pBitmap );
- else
- {
- Size aSize = GetOutputSizePixel();
- DrawLine( Point(0,0), Point(aSize.Width(),aSize.Height()) );
- DrawLine( Point(0,aSize.Height()), Point(aSize.Width(),0) );
- }
- }
-}
-/* -----------------------------27.02.2002 11:07------------------------------
-
- ---------------------------------------------------------------------------*/
-void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- Invalidate();
- }
- Window::DataChanged( rDCEvt );
-}
-
-// class SvxBackgroundTabPage --------------------------------------------
-
-#define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl)
-
-SvxBackgroundTabPage::SvxBackgroundTabPage( Window* pParent,
- const SfxItemSet& rCoreSet ) :
-
-/* [Beschreibung]
-
-*/
-
- SvxTabPage( pParent, SVX_RES( RID_SVXPAGE_BACKGROUND ), rCoreSet ),
-
- aBorderWin ( this, SVX_RES(CT_BORDER) ),
- aBackgroundColorSet ( &aBorderWin, SVX_RES( SET_BGDCOLOR ) ),
- aBackgroundColorBox ( this, SVX_RES( GB_BGDCOLOR ) ),
- pPreviewWin1 ( new BackgroundPreviewImpl(
- this, SVX_RES( WIN_PREVIEW1 ), FALSE ) ),
- aColTransFT ( this, SVX_RES( FT_COL_TRANS ) ),
- aColTransMF ( this, SVX_RES( MF_COL_TRANS ) ),
- aBtnBrowse ( this, SVX_RES( BTN_BROWSE ) ),
- aBtnLink ( this, SVX_RES( BTN_LINK ) ),
- aBtnPreview ( this, SVX_RES( BTN_PREVIEW ) ),
- aFtFile ( this, SVX_RES( FT_FILE ) ),
- aGbFile ( this, SVX_RES( GB_FILE ) ),
- aBtnPosition ( this, SVX_RES( BTN_POSITION ) ),
- aBtnArea ( this, SVX_RES( BTN_AREA ) ),
- aBtnTile ( this, SVX_RES( BTN_TILE ) ),
- aWndPosition ( this, SVX_RES( WND_POSITION ), RP_MM ),
- aGbPosition ( this, SVX_RES( GB_POSITION ) ),
- aGraphTransFL ( this, SVX_RES( FL_GRAPH_TRANS ) ),
- aGraphTransMF ( this, SVX_RES( MF_GRAPH_TRANS ) ),
- pPreviewWin2 ( new BackgroundPreviewImpl(
- this, SVX_RES( WIN_PREVIEW2 ), TRUE ) ),
- aSelectTxt ( this, SVX_RES( FT_SELECTOR ) ),
- aLbSelect ( this, SVX_RES( LB_SELECTOR ) ),
- aStrBrowse ( SVX_RES( STR_BROWSE ) ),
- aStrUnlinked ( SVX_RES( STR_UNLINKED ) ),
- aTblDesc ( this, SVX_RES( FT_TBL_DESC ) ),
- aTblLBox ( this, SVX_RES( LB_TBL_BOX ) ),
- aParaLBox ( this, SVX_RES( LB_PARA_BOX ) ),
- nHtmlMode ( 0 ),
- bAllowShowSelector ( TRUE ),
- bIsGraphicValid ( FALSE ),
- bLinkOnly ( FALSE ),
- bResized ( FALSE ),
- bColTransparency ( FALSE ),
- bGraphTransparency ( FALSE ),
-
- pPageImpl ( new SvxBackgroundPage_Impl ),
- pImportDlg ( NULL ),
- pTableBck_Impl ( NULL ),
- pParaBck_Impl ( NULL )
-
-{
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- const SfxPoolItem* pItem;
- SfxObjectShell* pShell;
-
- if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_HTML_MODE, FALSE, &pItem )
- || ( 0 != ( pShell = SfxObjectShell::Current()) &&
- 0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
- {
- nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
- }
-
- FillColorValueSets_Impl();
-
- aBackgroundColorSet.SetSelectHdl( HDL(BackgroundColorHdl_Impl) );
- FreeResource();
-}
-
-//------------------------------------------------------------------------
-
-SvxBackgroundTabPage::~SvxBackgroundTabPage()
-
-/* [Beschreibung]
-
-*/
-
-{
- delete pPreviewWin1;
- delete pPreviewWin2;
- delete pPageImpl->pLoadTimer;
- delete pPageImpl;
- delete pImportDlg;
-
- if( pTableBck_Impl)
- {
- delete pTableBck_Impl->pCellBrush;
- delete pTableBck_Impl->pRowBrush;
- delete pTableBck_Impl->pTableBrush;
- delete pTableBck_Impl;
- }
-
- if(pParaBck_Impl)
- {
- delete pParaBck_Impl->pParaBrush;
- delete pParaBck_Impl->pCharBrush;
- delete pParaBck_Impl;
- }
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxBackgroundTabPage::GetRanges()
-
-/* [Beschreibung]
-
- gibt den Bereich der Which-Werte zur"uck
-*/
-
-{
- return pRanges;
-}
-
-//------------------------------------------------------------------------
-
-SfxTabPage* SvxBackgroundTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-
-/* [Beschreibung]
-
- Create-Methode f"ur den TabDialog
-*/
-
-{
- return ( new SvxBackgroundTabPage( pParent, rAttrSet ) );
-}
-
-//------------------------------------------------------------------------
-
-void SvxBackgroundTabPage::Reset( const SfxItemSet& rSet )
-
-/* [Beschreibung]
-
-*/
-
-{
-// os: So ein Unsinn! Irgendwo laesst sich so ein Item immer finden,
-// es muss aber im rSet vorhanden sein!
-// const SfxPoolItem* pX = GetOldItem( rSet, SID_VIEW_FLD_PIC );
-// if( pX && pX->ISA(SfxWallpaperItem))
- if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(GetWhich(SID_VIEW_FLD_PIC), FALSE))
- {
- ResetFromWallpaperItem( rSet );
- return;
- }
-
- // Zustand des Vorschau-Buttons durch UserData persistent
- String aUserData = GetUserData();
- aBtnPreview.Check( aUserData.Len() && sal_Unicode('1') == aUserData.GetChar( 0 ) );
-
- // nach Reset kein ShowSelector() mehr aufrufen d"urfen
- bAllowShowSelector = FALSE;
-
-
- // Input-BrushItem besorgen und auswerten
- const SvxBrushItem* pBgdAttr = NULL;
- USHORT nSlot = SID_ATTR_BRUSH;
- const SfxPoolItem* pItem;
- USHORT nDestValue = USHRT_MAX;
-
- if ( SFX_ITEM_SET == rSet.GetItemState( SID_BACKGRND_DESTINATION,
- FALSE, &pItem ) )
- {
- nDestValue = ((const SfxUInt16Item*)pItem)->GetValue();
- aTblLBox.SelectEntryPos(nDestValue);
-
- switch ( nDestValue )
- {
- case TBL_DEST_CELL:
- nSlot = SID_ATTR_BRUSH;
- break;
- case TBL_DEST_ROW:
- nSlot = SID_ATTR_BRUSH_ROW;
- break;
- case TBL_DEST_TBL:
- nSlot = SID_ATTR_BRUSH_TABLE;
- break;
- }
- }
- else if( SFX_ITEM_SET == rSet.GetItemState(
- SID_PARA_BACKGRND_DESTINATION, FALSE, &pItem ) )
- {
- nDestValue = ((const SfxUInt16Item*)pItem)->GetValue();
- // ist gerade Zeichen aktiviert?
- USHORT nParaSel = aParaLBox.GetSelectEntryPos();
- if(1 == nParaSel)
- {
- // dann war das ein "Standard" - Aufruf
- nDestValue = nParaSel;
- }
- aParaLBox.SelectEntryPos(nDestValue);
-
- switch ( nDestValue )
- {
- case PARA_DEST_PARA:
- nSlot = SID_ATTR_BRUSH;
- break;
- case PARA_DEST_CHAR:
- nSlot = SID_ATTR_BRUSH_CHAR;
- break;
- }
- }
- //#111173# the destination item is missing when the parent style has been changed
- if(USHRT_MAX == nDestValue && (aParaLBox.IsVisible()||aTblLBox.IsVisible()))
- nDestValue = 0;
- USHORT nWhich = GetWhich( nSlot );
-
- if ( rSet.GetItemState( nWhich, FALSE ) >= SFX_ITEM_AVAILABLE )
- pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) );
-
- aBtnTile.Check();
-
- if ( pBgdAttr )
- {
- FillControls_Impl(*pBgdAttr, aUserData);
- aBgdColor = ( (SvxBrushItem*)pBgdAttr )->GetColor();
- }
- else
- {
- aSelectTxt.Hide();
- aLbSelect.Hide();
- aLbSelect.SelectEntryPos( 0 );
- ShowColorUI_Impl();
-
- const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_BRUSH );
-
- if ( pOld )
- aBgdColor = ( (SvxBrushItem*)pOld )->GetColor();
- }
-
- if ( nDestValue != USHRT_MAX )
- {
- if(aTblLBox.IsVisible())
- {
- USHORT nValue = aTblLBox.GetSelectEntryPos();
-
- if ( pTableBck_Impl )
- {
- DELETEZ( pTableBck_Impl->pCellBrush);
- DELETEZ( pTableBck_Impl->pRowBrush);
- DELETEZ( pTableBck_Impl->pTableBrush);
- }
- else
- pTableBck_Impl = new SvxBackgroundTable_Impl();
-
- pTableBck_Impl->nActPos = nValue;
-
- nWhich = GetWhich( SID_ATTR_BRUSH );
- if ( rSet.GetItemState( nWhich, FALSE ) >= SFX_ITEM_AVAILABLE )
- {
- pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) );
- pTableBck_Impl->pCellBrush = new SvxBrushItem(*pBgdAttr);
- }
- pTableBck_Impl->nCellWhich = nWhich;
-
- if ( rSet.GetItemState( SID_ATTR_BRUSH_ROW, FALSE ) >= SFX_ITEM_AVAILABLE )
- {
- pBgdAttr = (const SvxBrushItem*)&( rSet.Get( SID_ATTR_BRUSH_ROW ) );
- pTableBck_Impl->pRowBrush = new SvxBrushItem(*pBgdAttr);
- }
- pTableBck_Impl->nRowWhich = SID_ATTR_BRUSH_ROW;
-
- if ( rSet.GetItemState( SID_ATTR_BRUSH_TABLE, FALSE ) >= SFX_ITEM_AVAILABLE )
- {
- pBgdAttr = (const SvxBrushItem*)&( rSet.Get( SID_ATTR_BRUSH_TABLE ) );
- pTableBck_Impl->pTableBrush = new SvxBrushItem(*pBgdAttr);
- }
- pTableBck_Impl->nTableWhich = SID_ATTR_BRUSH_TABLE;
-
- TblDestinationHdl_Impl(&aTblLBox);
- aTblLBox.SaveValue();
- }
- else
- {
- USHORT nValue = aParaLBox.GetSelectEntryPos();
-
- if ( pParaBck_Impl )
- {
- delete pParaBck_Impl->pParaBrush;
- delete pParaBck_Impl->pCharBrush;
- }
- else
- pParaBck_Impl = new SvxBackgroundPara_Impl();
-
- pParaBck_Impl->nActPos = nValue;
-
- nWhich = GetWhich( SID_ATTR_BRUSH );
- if ( rSet.GetItemState( nWhich, FALSE ) >= SFX_ITEM_AVAILABLE )
- {
- pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) );
- pParaBck_Impl->pParaBrush = new SvxBrushItem(*pBgdAttr);
- }
-
- nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
- SfxItemState eState = rSet.GetItemState( nWhich, TRUE );
- eState = rSet.GetItemState( nWhich, FALSE );
- if ( rSet.GetItemState( nWhich, TRUE ) > SFX_ITEM_AVAILABLE )
- {
- pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) );
- pParaBck_Impl->pCharBrush = new SvxBrushItem(*pBgdAttr);
- }
- else
- pParaBck_Impl->pCharBrush = new SvxBrushItem(SID_ATTR_BRUSH_CHAR);
-
- ParaDestinationHdl_Impl(&aParaLBox);
- aParaLBox.SaveValue();
- }
- }
- if(!bResized)
- {
- if(!aLbSelect.IsVisible() && !aTblLBox.IsVisible() && !aParaLBox.IsVisible())
- {
- long nY(LogicToPixel(Point(11,14), MAP_APPFONT).X());
- long nX(LogicToPixel(Point(11,14), MAP_APPFONT).Y());
- Point aPos(aBorderWin.GetPosPixel());
- aPos.X() = nX;
- aPos.Y() = nY;
- aBorderWin.SetPosPixel(aPos);
- aPos = pPreviewWin1->GetPosPixel();
- aPos.Y() = nY;
- pPreviewWin1->SetPosPixel(aPos);
- aBackgroundColorBox.Hide();
- }
- }
-}
-
-void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet )
-{
- ShowSelector();
-
- // Zustand des Vorschau-Buttons durch UserData persistent
- String aUserData = GetUserData();
- aBtnPreview.Check( aUserData.Len() && sal_Unicode('1') == aUserData.GetChar( 0 ) );
-
- // Input-BrushItem besorgen und auswerten
- const SvxBrushItem* pBgdAttr = NULL;
- USHORT nSlot = SID_VIEW_FLD_PIC;
- USHORT nWhich = GetWhich( nSlot );
- SvxBrushItem* pTemp = 0;
- const CntWallpaperItem* pItem = 0;
-
- if ( rSet.GetItemState( nWhich, FALSE ) >= SFX_ITEM_AVAILABLE )
- {
- pItem = (const CntWallpaperItem*)&rSet.Get( nWhich );
- pTemp = new SvxBrushItem( *pItem, nWhich );
- pBgdAttr = pTemp;
- }
-
- aBtnTile.Check();
-
- if ( pBgdAttr )
- {
- FillControls_Impl(*pBgdAttr, aUserData);
- // Auch bei Anzeige der Grafik, soll die Brush erhalten bleiben
- if( aBgdColor != pBgdAttr->GetColor() )
- {
- aBgdColor = pBgdAttr->GetColor();
- USHORT nCol = GetItemId_Impl( aBackgroundColorSet, aBgdColor );
- aBackgroundColorSet.SelectItem( nCol );
- pPreviewWin1->NotifyChange( aBgdColor );
- }
- }
- else
- {
- aLbSelect.SelectEntryPos( 0 );
- ShowColorUI_Impl();
-
- const SfxPoolItem* pOld = GetOldItem( rSet, SID_VIEW_FLD_PIC );
- if ( pOld )
- aBgdColor = Color( ((CntWallpaperItem*)pOld)->GetColor() );
- }
-
- // We now have always a link to the background
- bLinkOnly = TRUE;
- aBtnLink.Check( TRUE );
- aBtnLink.Show( FALSE );
-// if( !pItem || !pItem->GetWallpaper(FALSE).IsBitmap() )
-// aBtnLink.Check();
-
- delete pTemp;
-}
-
-
-
-//------------------------------------------------------------------------
-
-void SvxBackgroundTabPage::FillUserData()
-
-/* [Beschreibung]
-
- Beim Destruieren einer SfxTabPage wird diese virtuelle Methode gerufen,
- damit die TabPage interne Informationen sichern kann.
-
- In diesem Fall wird der Zustand des Vorschau-Buttons gesichert.
-*/
-
-{
- SetUserData( String( aBtnPreview.IsChecked() ? sal_Unicode('1') : sal_Unicode('0') ) );
-}
-
-//------------------------------------------------------------------------
-
-BOOL SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
-
-/* [Beschreibung]
-
-*/
-
-{
- if ( pPageImpl->pLoadTimer && pPageImpl->pLoadTimer->IsActive() )
- {
- pPageImpl->pLoadTimer->Stop();
- LoadTimerHdl_Impl( pPageImpl->pLoadTimer );
- }
-// os: So ein Unsinn! Irgendwo laesst sich so ein Item immer finden,
-// es muss aber im rSet vorhanden sein!
-
-// const SfxPoolItem* pX = GetOldItem( rCoreSet, SID_VIEW_FLD_PIC );
-// if( pX && pX->ISA(SfxWallpaperItem))
- if(SFX_ITEM_AVAILABLE <= rCoreSet.GetItemState(GetWhich(SID_VIEW_FLD_PIC), FALSE))
- return FillItemSetWithWallpaperItem( rCoreSet, SID_VIEW_FLD_PIC );
-
- BOOL bModified = FALSE;
- USHORT nSlot = SID_ATTR_BRUSH;
-
- if ( aTblLBox.IsVisible() )
- {
- switch( aTblLBox.GetSelectEntryPos() )
- {
- case TBL_DEST_CELL:
- nSlot = SID_ATTR_BRUSH;
- break;
- case TBL_DEST_ROW:
- nSlot = SID_ATTR_BRUSH_ROW;
- break;
- case TBL_DEST_TBL:
- nSlot = SID_ATTR_BRUSH_TABLE;
- break;
- }
- }
- else if(aParaLBox.GetData() == &aParaLBox)
- {
- switch(aParaLBox.GetSelectEntryPos())
- {
- case PARA_DEST_PARA:
- nSlot = SID_ATTR_BRUSH;
- break;
- case PARA_DEST_CHAR:
- nSlot = SID_ATTR_BRUSH_CHAR;
- break;
- }
- }
- USHORT nWhich = GetWhich( nSlot );
-
- const SfxPoolItem* pOld = GetOldItem( rCoreSet, nSlot );
- SfxItemState eOldItemState = rCoreSet.GetItemState(nSlot, FALSE);
- const SfxItemSet& rOldSet = GetItemSet();
-
- BOOL bGraphTransparencyChanged = bGraphTransparency && (aGraphTransMF.GetText() != aGraphTransMF.GetSavedValue());
- if ( pOld )
- {
- const SvxBrushItem& rOldItem = (const SvxBrushItem&)*pOld;
- SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos();
- const BOOL bIsBrush = ( 0 == aLbSelect.GetSelectEntryPos() );
-
- // transparency has to be set if enabled, the color not already set to "No fill" and
- if( bColTransparency &&
- aBgdColor.GetTransparency() < 0xff)
- {
- aBgdColor.SetTransparency(lcl_PercentToTransparency(static_cast<long>(aColTransMF.GetValue())));
- }
- if ( ( (GPOS_NONE == eOldPos) && bIsBrush )
- || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap gewechselt?
- {
- // Hintergrund-Art wurde nicht gewechselt:
-
- if ( (GPOS_NONE == eOldPos) || !aLbSelect.IsVisible() )
- {
- // Brush-Behandlung:
- if ( rOldItem.GetColor() != aBgdColor ||
- (SFX_ITEM_AVAILABLE >= eOldItemState && !aBackgroundColorSet.IsNoSelection()))
- {
- bModified = TRUE;
- rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- rCoreSet.ClearItem( nWhich );
- }
- else
- {
- // Bitmap-Behandlung:
-
- SvxGraphicPosition eNewPos = GetGraphicPosition_Impl();
- const BOOL bIsLink = aBtnLink.IsChecked();
- const BOOL bWasLink = (NULL != rOldItem.GetGraphicLink() );
-
-
- if ( !bIsLink && !bIsGraphicValid )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
-
- if ( bGraphTransparencyChanged ||
- eNewPos != eOldPos
- || bIsLink != bWasLink
- || ( bWasLink && *rOldItem.GetGraphicLink()
- != aBgdGraphicPath )
- || ( !bWasLink && rOldItem.GetGraphic()->GetBitmap()
- != aBgdGraphic.GetBitmap() )
- )
- {
- bModified = TRUE;
-
- SvxBrushItem aTmpBrush(nWhich);
- if ( bIsLink )
- {
- aTmpBrush = SvxBrushItem( aBgdGraphicPath,
- aBgdGraphicFilter,
- eNewPos,
- nWhich );
- }
- else
- aTmpBrush = SvxBrushItem( aBgdGraphic,
- eNewPos,
- nWhich );
- lcl_SetTransparency(aTmpBrush, static_cast<long>(aGraphTransMF.GetValue()));
-
- rCoreSet.Put(aTmpBrush);
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- rCoreSet.ClearItem( nWhich );
- }
- }
- else // Brush <-> Bitmap gewechselt!
- {
- if ( bIsBrush )
- rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
- else
- {
- SvxBrushItem* pTmpBrush = 0;
- if ( aBtnLink.IsChecked() )
- {
- pTmpBrush = new SvxBrushItem( aBgdGraphicPath,
- aBgdGraphicFilter,
- GetGraphicPosition_Impl(),
- nWhich );
- }
- else
- {
- if ( !bIsGraphicValid )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
-
- if ( bIsGraphicValid )
- pTmpBrush = new SvxBrushItem( aBgdGraphic,
- GetGraphicPosition_Impl(),
- nWhich );
- }
- if(pTmpBrush)
- {
- lcl_SetTransparency(*pTmpBrush, static_cast<long>(aGraphTransMF.GetValue()));
- rCoreSet.Put(*pTmpBrush);
- delete pTmpBrush;
- }
- }
- bModified = ( bIsBrush || aBtnLink.IsChecked() || bIsGraphicValid );
- }
- }
- else if ( SID_ATTR_BRUSH_CHAR == nSlot && aBgdColor != Color( COL_WHITE ) )
- {
- rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
- bModified = TRUE;
- }
-
- if( aTblLBox.IsVisible() )
- {
- // Der aktuelle Zustand wurde bereits geputtet
- if( nSlot != SID_ATTR_BRUSH && pTableBck_Impl->pCellBrush)
- {
- const SfxPoolItem* pOldCell =
- GetOldItem( rCoreSet, SID_ATTR_BRUSH );
-
- if ( *pTableBck_Impl->pCellBrush != *pOldCell )
- {
- rCoreSet.Put( *pTableBck_Impl->pCellBrush );
- bModified |= TRUE;
- }
- }
-
- if( nSlot != SID_ATTR_BRUSH_ROW && pTableBck_Impl->pRowBrush)
- {
- const SfxPoolItem* pOldRow =
- GetOldItem( rCoreSet, SID_ATTR_BRUSH_ROW );
-
- if ( *pTableBck_Impl->pRowBrush != *pOldRow )
- {
- rCoreSet.Put( *pTableBck_Impl->pRowBrush );
- bModified |= TRUE;
- }
- }
-
- if( nSlot != SID_ATTR_BRUSH_TABLE && pTableBck_Impl->pTableBrush)
- {
- const SfxPoolItem* pOldTable =
- GetOldItem( rCoreSet, SID_ATTR_BRUSH_TABLE );
-
- if ( *pTableBck_Impl->pTableBrush != *pOldTable )
- {
- rCoreSet.Put( *pTableBck_Impl->pTableBrush );
- bModified |= TRUE;
- }
- }
-
- if( aTblLBox.GetSavedValue() != aTblLBox.GetSelectEntryPos() )
- {
- rCoreSet.Put( SfxUInt16Item( SID_BACKGRND_DESTINATION,
- aTblLBox.GetSelectEntryPos() ) );
- bModified |= TRUE;
- }
- }
- else if(aParaLBox.GetData() == &aParaLBox)
- {
- // Der aktuelle Zustand wurde bereits geputtet
- if( nSlot != SID_ATTR_BRUSH && aParaLBox.IsVisible()) // nicht im Suchen-Format-Dialog
- {
- const SfxPoolItem* pOldPara =
- GetOldItem( rCoreSet, SID_ATTR_BRUSH );
-
- if ( *pParaBck_Impl->pParaBrush != *pOldPara )
- {
- rCoreSet.Put( *pParaBck_Impl->pParaBrush );
- bModified |= TRUE;
- }
- }
-
- if( nSlot != SID_ATTR_BRUSH_CHAR )
- {
- const SfxPoolItem* pOldChar =
- GetOldItem( rCoreSet, SID_ATTR_BRUSH_CHAR );
- DBG_ASSERT(pParaBck_Impl, "pParaBck_Impl == NULL ?");
- if ( pOldChar &&
- //#111173# crash report shows that pParaBck_Impl can be NULL, the cause is unknown
- pParaBck_Impl &&
- (*pParaBck_Impl->pCharBrush != *pOldChar ||
- *pParaBck_Impl->pCharBrush != SvxBrushItem(SID_ATTR_BRUSH_CHAR)))
- {
- rCoreSet.Put( *pParaBck_Impl->pCharBrush );
- bModified |= TRUE;
- }
- }
-
- if( aParaLBox.GetSavedValue() != aParaLBox.GetSelectEntryPos() )
- {
- rCoreSet.Put( SfxUInt16Item( SID_BACKGRND_DESTINATION,
- aParaLBox.GetSelectEntryPos() ) );
- bModified |= TRUE;
- }
- }
- return bModified;
-}
-
-BOOL SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, USHORT nSlot)
-{
- USHORT nWhich = GetWhich( nSlot );
- const SfxPoolItem* pOld = GetOldItem( rCoreSet, nSlot );
- const SfxItemSet& rOldSet = GetItemSet();
- DBG_ASSERT(pOld,"FillItemSetWithWallpaperItem: Item not found");
-
- SvxBrushItem rOldItem( (const CntWallpaperItem&)*pOld, nWhich );
- SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos();
- const BOOL bIsBrush = ( 0 == aLbSelect.GetSelectEntryPos() );
- BOOL bModified = FALSE;
-
- if ( ( (GPOS_NONE == eOldPos) && bIsBrush )
- || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap gewechselt?
- {
- // Hintergrund-Art wurde nicht gewechselt:
-
- if ( (GPOS_NONE == eOldPos) || !aLbSelect.IsVisible() )
- {
- // Brush-Behandlung:
- if ( rOldItem.GetColor() != aBgdColor )
- {
- bModified = TRUE;
- CntWallpaperItem aItem( nWhich );
- aItem.SetColor( aBgdColor );
- rCoreSet.Put( aItem );
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- rCoreSet.ClearItem( nWhich );
- }
- else
- {
- // Bitmap-Behandlung:
- SvxGraphicPosition eNewPos = GetGraphicPosition_Impl();
-
- int bBitmapChanged = ( ( eNewPos != eOldPos ) ||
- ( *rOldItem.GetGraphicLink() != aBgdGraphicPath ) );
- int bBrushChanged = ( rOldItem.GetColor() != aBgdColor );
- if( bBitmapChanged || bBrushChanged )
- {
- bModified = TRUE;
-
- CntWallpaperItem aItem( nWhich );
- WallpaperStyle eWallStyle = SvxBrushItem::GraphicPos2WallpaperStyle(eNewPos);
- aItem.SetStyle( sal::static_int_cast< USHORT >( eWallStyle ) );
- aItem.SetColor( aBgdColor );
- aItem.SetBitmapURL( aBgdGraphicPath );
- rCoreSet.Put( aItem );
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- rCoreSet.ClearItem( nWhich );
- }
- }
- else // Brush <-> Bitmap gewechselt!
- {
- CntWallpaperItem aItem( nWhich );
- if ( bIsBrush )
- {
- aItem.SetColor( aBgdColor );
- rCoreSet.Put( aItem );
- }
- else
- {
- WallpaperStyle eWallStyle =
- SvxBrushItem::GraphicPos2WallpaperStyle( GetGraphicPosition_Impl() );
- aItem.SetStyle( sal::static_int_cast< USHORT >( eWallStyle ) );
- aItem.SetColor( aBgdColor );
- aItem.SetBitmapURL( aBgdGraphicPath );
- rCoreSet.Put( aItem );
- }
-
- bModified = TRUE;
- }
- return bModified;
-}
-
-//-----------------------------------------------------------------------
-
-int SvxBackgroundTabPage::DeactivatePage( SfxItemSet* _pSet )
-
-/* [Beschreibung]
-
- virtuelle Methode, wird beim Deaktivieren gerufen
-*/
-
-{
- if ( pPageImpl->bIsImportDlgInExecute )
- return KEEP_PAGE;
-
- if ( _pSet )
- FillItemSet( *_pSet );
-
- return LEAVE_PAGE;
-}
-
-//-----------------------------------------------------------------------
-
-void SvxBackgroundTabPage::PointChanged( Window* , RECT_POINT )
-
-/* [Beschreibung]
-
-*/
-
-{
- // muss implementiert werden, damit Position-Control funktioniert
-}
-
-//-----------------------------------------------------------------------
-
-void SvxBackgroundTabPage::ShowSelector()
-
-/* [Beschreibung]
-
-*/
-
-{
- if( bAllowShowSelector)
- {
- aSelectTxt.Show();
- aLbSelect.Show();
- aLbSelect.SetSelectHdl( HDL(SelectHdl_Impl) );
- aBtnLink.SetClickHdl( HDL(FileClickHdl_Impl) );
- aBtnPreview.SetClickHdl( HDL(FileClickHdl_Impl) );
- aBtnBrowse.SetClickHdl( HDL(BrowseHdl_Impl) );
- aBtnArea.SetClickHdl( HDL(RadioClickHdl_Impl) );
- aBtnTile.SetClickHdl( HDL(RadioClickHdl_Impl) );
- aBtnPosition.SetClickHdl( HDL(RadioClickHdl_Impl) );
-
- // Verz"ogertes Laden "uber Timer (wg. UI-Update)
- pPageImpl->pLoadTimer = new Timer;
- pPageImpl->pLoadTimer->SetTimeout( 500 ); // 500ms verz"ogern
- pPageImpl->pLoadTimer->SetTimeoutHdl(
- LINK( this, SvxBackgroundTabPage, LoadTimerHdl_Impl ) );
-
- bAllowShowSelector = FALSE;
-
- if(nHtmlMode & HTMLMODE_ON)
- {
- if(!(nHtmlMode & HTMLMODE_GRAPH_POS))
- aBtnPosition.Enable(FALSE);
- aBtnArea.Enable(FALSE);
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-
-void SvxBackgroundTabPage::RaiseLoadError_Impl()
-
-/* [Beschreibung]
-
-*/
-
-{
- SfxErrorContext aContext( ERRCTX_SVX_BACKGROUND,
- String(),
- this,
- RID_SVXERRCTX,
- &DIALOG_MGR() );
-
- ErrorHandler::HandleError(
- *new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE,
- aBgdGraphicPath ) );
-}
-
-//------------------------------------------------------------------------
-
-BOOL SvxBackgroundTabPage::LoadLinkedGraphic_Impl()
-
-/* [Beschreibung]
-
-*/
-
-{
- BOOL bResult = ( aBgdGraphicPath.Len() > 0 ) &&
- ( GRFILTER_OK == LoadGraphic( aBgdGraphicPath,
- aBgdGraphicFilter,
- aBgdGraphic ) );
- return bResult;
-}
-
-//------------------------------------------------------------------------
-
-
-void SvxBackgroundTabPage::FillColorValueSets_Impl()
-
-/* [Beschreibung]
-
- F"ullen des Farb-Sets
-*/
-
-{
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- const SfxPoolItem* pItem = NULL;
- XColorTable* pColorTable = NULL;
- const Size aSize15x15 = Size( 15, 15 );
- FASTBOOL bOwn = FALSE;
-
- if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
-
- if ( !pColorTable )
- {
- bOwn = TRUE;
- pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- }
-
- if ( pColorTable )
- {
- short i = 0;
- long nCount = pColorTable->Count();
- XColorEntry* pEntry = NULL;
- Color aColWhite( COL_WHITE );
- String aStrWhite( SVX_RES( RID_SVXITEMS_COLOR_WHITE ) );
- WinBits nBits = ( aBackgroundColorSet.GetStyle() | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD );
- aBackgroundColorSet.SetText( String( SVX_RES( RID_SVXSTR_TRANSPARENT ) ) );
- aBackgroundColorSet.SetStyle( nBits );
- for ( i = 0; i < nCount; i++ )
- {
- pEntry = pColorTable->GetColor(i);
- aBackgroundColorSet.InsertItem( i + 1, pEntry->GetColor(), pEntry->GetName() );
- }
-
- while ( i < 80 )
- {
- aBackgroundColorSet.InsertItem( i + 1, aColWhite, aStrWhite );
- i++;
- }
-
- if ( nCount > 80 )
- {
- aBackgroundColorSet.SetStyle( nBits | WB_VSCROLL );
- }
- }
-
- if ( bOwn )
- delete pColorTable;
-
- aBackgroundColorSet.SetColCount( 10 );
- aBackgroundColorSet.SetLineCount( 10 );
- aBackgroundColorSet.CalcWindowSizePixel( aSize15x15 );
-
-}
-
-//------------------------------------------------------------------------
-
-
-
-//------------------------------------------------------------------------
-
-void SvxBackgroundTabPage::ShowColorUI_Impl()
-
-/* [Beschreibung]
-
- Die Controls f"ur das Einstellen der Grafik ausblenden und die
- Controls f"ur die Farbeinstellung einblenden.
-*/
-
-{
- if( !aBackgroundColorSet.IsVisible() )
- {
- aBackgroundColorSet.Show();
- aBackgroundColorBox.Show();
- aBorderWin.Show();
- pPreviewWin1->Show();
- aBtnBrowse.Hide();
- aFtFile.Hide();
- aBtnLink.Hide();
- aBtnPreview.Hide();
- aGbFile.Hide();
- aBtnPosition.Hide();
- aBtnArea.Hide();
- aBtnTile.Hide();
- aWndPosition.Hide();
- aGbPosition.Hide();
- pPreviewWin2->Hide();
- aGraphTransFL.Show(FALSE);
- aGraphTransMF.Show(FALSE);
- if(bColTransparency)
- {
- aColTransFT.Show();
- aColTransMF.Show();
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-void SvxBackgroundTabPage::ShowBitmapUI_Impl()
-
-/* [Beschreibung]
-
- Die Controls f"ur die Farbeinstellung ausblenden und die
- Controls f"ur das Einstellen der Grafik einblenden.
-*/
-
-{
- if ( aLbSelect.IsVisible() &&
- (
- aBackgroundColorSet.IsVisible()
- || !aBtnBrowse.IsVisible() ) )
- {
- aBackgroundColorSet.Hide();
- aBackgroundColorBox.Hide();
- aBorderWin.Hide();
- pPreviewWin1->Hide();
- aBtnBrowse.Show();
- aFtFile.Show();
-
- if ( !bLinkOnly && ! nHtmlMode & HTMLMODE_ON )
- aBtnLink.Show();
- aBtnPreview.Show();
- aGbFile.Show();
- aBtnPosition.Show();
- aBtnArea.Show();
- aBtnTile.Show();
- aWndPosition.Show();
- aGbPosition.Show();
- pPreviewWin2->Show();
- if(bGraphTransparency)
- {
- aGraphTransFL.Show();
- aGraphTransMF.Show();
- }
- aColTransFT.Show(FALSE);
- aColTransMF.Show(FALSE);
- }
-}
-
-//------------------------------------------------------------------------
-
-void SvxBackgroundTabPage::SetGraphicPosition_Impl( SvxGraphicPosition ePos )
-
-/* [Beschreibung]
-
- Die Controls f"ur die Grafikposition einstellen.
-*/
-
-{
- switch ( ePos )
- {
- case GPOS_AREA:
- {
- aBtnArea.Check();
- aWndPosition.Disable();
- }
- break;
-
- case GPOS_TILED:
- {
- aBtnTile.Check();
- aWndPosition.Disable();
- }
- break;
-
- default:
- {
- aBtnPosition.Check();
- aWndPosition.Enable();
- RECT_POINT eNewPos = RP_MM;
-
- switch ( ePos )
- {
- case GPOS_MM: break;
- case GPOS_LT: eNewPos = RP_LT; break;
- case GPOS_MT: eNewPos = RP_MT; break;
- case GPOS_RT: eNewPos = RP_RT; break;
- case GPOS_LM: eNewPos = RP_LM; break;
- case GPOS_RM: eNewPos = RP_RM; break;
- case GPOS_LB: eNewPos = RP_LB; break;
- case GPOS_MB: eNewPos = RP_MB; break;
- case GPOS_RB: eNewPos = RP_RB; break;
- default: ;//prevent warning
- }
- aWndPosition.SetActualRP( eNewPos );
- }
- break;
- }
- aWndPosition.Invalidate();
-}
-
-//------------------------------------------------------------------------
-
-SvxGraphicPosition SvxBackgroundTabPage::GetGraphicPosition_Impl()
-
-/* [Beschreibung]
-
- Die Position der Grafik zur"uckgeben.
-*/
-
-{
- if ( aBtnTile.IsChecked() )
- return GPOS_TILED;
- else if ( aBtnArea.IsChecked() )
- return GPOS_AREA;
- else
- {
- switch ( aWndPosition.GetActualRP() )
- {
- case RP_LT: return GPOS_LT;
- case RP_MT: return GPOS_MT;
- case RP_RT: return GPOS_RT;
- case RP_LM: return GPOS_LM;
- case RP_MM: return GPOS_MM;
- case RP_RM: return GPOS_RM;
- case RP_LB: return GPOS_LB;
- case RP_MB: return GPOS_MB;
- case RP_RB: return GPOS_RB;
- }
- }
- return GPOS_MM;
-}
-
-//-----------------------------------------------------------------------
-// Handler
-//-----------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, BackgroundColorHdl_Impl, ValueSet*, EMPTYARG )
-/*
- Handler, called when color selection is changed
-*/
-{
- USHORT nItemId = aBackgroundColorSet.GetSelectItemId();
- Color aColor = nItemId ? ( aBackgroundColorSet.GetItemColor( nItemId ) ) : Color( COL_TRANSPARENT );
- aBgdColor = aColor;
- pPreviewWin1->NotifyChange( aBgdColor );
- BOOL bEnableTransp = aBgdColor.GetTransparency() < 0xff;
- aColTransFT.Enable(bEnableTransp);
- aColTransMF.Enable(bEnableTransp);
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, SelectHdl_Impl, ListBox*, EMPTYARG )
-
-/* [Beschreibung]
-
-*/
-
-{
- if ( 0 == aLbSelect.GetSelectEntryPos() )
- {
- ShowColorUI_Impl();
- aParaLBox.Enable(); // Zeichenhintergrund kann keine Bitmap sein
- }
- else
- {
- ShowBitmapUI_Impl();
- aParaLBox.Enable(FALSE);// Zeichenhintergrund kann keine Bitmap sein
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, FileClickHdl_Impl, CheckBox*, pBox )
-
-/* [Beschreibung]
-
-*/
-
-{
- if ( &aBtnLink == pBox )
- {
- if ( aBtnLink.IsChecked() )
- {
- INetURLObject aObj( aBgdGraphicPath );
- String aFilePath;
- if ( aObj.GetProtocol() == INET_PROT_FILE )
- aFilePath = aObj.getFSysPath( INetURLObject::FSYS_DETECT );
- else
- aFilePath = aBgdGraphicPath;
- aFtFile.SetText( aFilePath );
- }
- else
- aFtFile.SetText( aStrUnlinked );
- }
- else if ( &aBtnPreview == pBox )
- {
- if ( aBtnPreview.IsChecked() )
- {
- if ( !bIsGraphicValid )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
-
- if ( bIsGraphicValid )
- {
- Bitmap aBmp = aBgdGraphic.GetBitmap();
- pPreviewWin2->NotifyChange( &aBmp );
- }
- else
- {
- if ( aBgdGraphicPath.Len() > 0 ) // nur bei gelinkter Grafik
- RaiseLoadError_Impl(); // ein Fehler
- pPreviewWin2->NotifyChange( NULL );
- }
- }
- else
- pPreviewWin2->NotifyChange( NULL );
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, RadioClickHdl_Impl, RadioButton*, pBtn )
-
-/* [Beschreibung]
-
-*/
-
-{
- if ( pBtn == &aBtnPosition )
- {
- if ( !aWndPosition.IsEnabled() )
- {
- aWndPosition.Enable();
- aWndPosition.Invalidate();
- }
- }
- else if ( aWndPosition.IsEnabled() )
- {
- aWndPosition.Disable();
- aWndPosition.Invalidate();
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, BrowseHdl_Impl, PushButton* , EMPTYARG )
-
-/* [Beschreibung]
-
- Handler, gerufen durch das Dr"ucken des Durchsuchen-Buttons.
- Grafik/Einf"ugen-Dialog erzeugen, Pfad setzen und starten.
-*/
-
-{
- if ( pPageImpl->pLoadTimer->IsActive() )
- return 0;
- BOOL bHtml = 0 != ( nHtmlMode & HTMLMODE_ON );
-
- pImportDlg = new SvxOpenGraphicDialog( aStrBrowse );
- if ( bHtml || bLinkOnly )
- pImportDlg->EnableLink(sal_False);
- pImportDlg->SetPath( aBgdGraphicPath, aBtnLink.IsChecked() );
-
- pPageImpl->bIsImportDlgInExecute = TRUE;
- short nErr = pImportDlg->Execute();
- pPageImpl->bIsImportDlgInExecute = FALSE;
-
- if( !nErr )
- {
- if ( bHtml )
- aBtnLink.Check();
- // wenn Verkn"upfen nicht gecheckt ist und die Vorschau auch nicht,
- // dann die Vorschau aktivieren, damit der Anwender sieht,
- // welche Grafik er ausgew"ahlt hat
- if ( !aBtnLink.IsChecked() && !aBtnPreview.IsChecked() )
- aBtnPreview.Check( TRUE );
- // timer-verz"ogertes Laden der Grafik
- pPageImpl->pLoadTimer->Start();
- }
- else
- DELETEZ( pImportDlg );
- return 0;
-}
-
-//-----------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, LoadTimerHdl_Impl, Timer* , pTimer )
-
-/* [Beschreibung]
-
- Verz"ogertes Laden der Grafik.
- Grafik wird nur dann geladen, wenn sie unterschiedlich zur
- aktuellen Grafik ist.
-*/
-
-{
- if ( pTimer == pPageImpl->pLoadTimer )
- {
- pPageImpl->pLoadTimer->Stop();
-
- if ( pImportDlg )
- {
- INetURLObject aOld( aBgdGraphicPath );
- INetURLObject aNew( pImportDlg->GetPath() );
- if ( !aBgdGraphicPath.Len() || aNew != aOld )
- {
- // neue Datei gew"ahlt
- aBgdGraphicPath = pImportDlg->GetPath();
- aBgdGraphicFilter = pImportDlg->GetCurrentFilter();
- BOOL bLink = ( nHtmlMode & HTMLMODE_ON ) || bLinkOnly ? TRUE : pImportDlg->IsAsLink();
- aBtnLink.Check( bLink );
- aBtnLink.Enable();
-
- if ( aBtnPreview.IsChecked() )
- {
- if( !pImportDlg->GetGraphic(aBgdGraphic) )
- {
- bIsGraphicValid = TRUE;
- }
- else
- {
- aBgdGraphicFilter.Erase();
- aBgdGraphicPath.Erase();
- bIsGraphicValid = FALSE;
- }
- }
- else
- bIsGraphicValid = FALSE; // Grafik erst beim Preview-Click laden
-
- if ( aBtnPreview.IsChecked() && bIsGraphicValid )
- {
- Bitmap aBmp = aBgdGraphic.GetBitmap();
- pPreviewWin2->NotifyChange( &aBmp );
- }
- else
- pPreviewWin2->NotifyChange( NULL );
- }
-
- FileClickHdl_Impl( &aBtnLink );
- DELETEZ( pImportDlg );
- }
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------
-
-void SvxBackgroundTabPage::ShowTblControl()
-
-/* [Beschreibung]
-
-*/
-
-{
- aTblLBox .SetSelectHdl( HDL(TblDestinationHdl_Impl) );
- aTblLBox .SelectEntryPos(0);
- aTblDesc.Show();
- aTblLBox.Show();
-}
-
-//-----------------------------------------------------------------------
-
-void SvxBackgroundTabPage::ShowParaControl(BOOL bCharOnly)
-{
- aParaLBox.SetSelectHdl(HDL(ParaDestinationHdl_Impl));
- aParaLBox.SelectEntryPos(0);
- if(!bCharOnly)
- {
- aTblDesc.Show();
- aParaLBox.Show();
- }
- aParaLBox.SetData(&aParaLBox); // hier erkennt man, dass dieser Mode eingeschaltet ist
-}
-//-----------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox )
-
-/* [Beschreibung]
-
-*/
-
-{
- USHORT nSelPos = pBox->GetSelectEntryPos();
- if( pTableBck_Impl && pTableBck_Impl->nActPos != nSelPos)
- {
- SvxBrushItem** pActItem = new (SvxBrushItem*);
- USHORT nWhich = 0;
- switch(pTableBck_Impl->nActPos)
- {
- case TBL_DEST_CELL:
- *pActItem = pTableBck_Impl->pCellBrush;
- nWhich = pTableBck_Impl->nCellWhich;
- break;
- case TBL_DEST_ROW:
- *pActItem = pTableBck_Impl->pRowBrush;
- nWhich = pTableBck_Impl->nRowWhich;
- break;
- case TBL_DEST_TBL:
- *pActItem = pTableBck_Impl->pTableBrush;
- nWhich = pTableBck_Impl->nTableWhich;
- break;
- }
- pTableBck_Impl->nActPos = nSelPos;
- if(!*pActItem)
- *pActItem = new SvxBrushItem(nWhich);
- if(0 == aLbSelect.GetSelectEntryPos()) // Brush ausgewaehlt
- {
- **pActItem = SvxBrushItem( aBgdColor, nWhich );
- }
- else
- {
- SvxGraphicPosition eNewPos = GetGraphicPosition_Impl();
- const BOOL bIsLink = aBtnLink.IsChecked();
-
- if ( !bIsLink && !bIsGraphicValid )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
-
- if ( bIsLink )
- **pActItem = SvxBrushItem( aBgdGraphicPath,
- aBgdGraphicFilter,
- eNewPos,
- (*pActItem)->Which() );
- else
- **pActItem = SvxBrushItem( aBgdGraphic,
- eNewPos,
- (*pActItem)->Which() );
- }
- switch(nSelPos)
- {
- case TBL_DEST_CELL:
- *pActItem = pTableBck_Impl->pCellBrush;
- aLbSelect.Enable();
- nWhich = pTableBck_Impl->nCellWhich;
- break;
- case TBL_DEST_ROW:
- {
- if((nHtmlMode & HTMLMODE_ON) && !(nHtmlMode & HTMLMODE_SOME_STYLES))
- aLbSelect.Disable();
- *pActItem = pTableBck_Impl->pRowBrush;
- nWhich = pTableBck_Impl->nRowWhich;
- }
- break;
- case TBL_DEST_TBL:
- *pActItem = pTableBck_Impl->pTableBrush;
- aLbSelect.Enable();
- nWhich = pTableBck_Impl->nTableWhich;
- break;
- }
- String aUserData = GetUserData();
- if(!*pActItem)
- *pActItem = new SvxBrushItem(nWhich);
- FillControls_Impl(**pActItem, aUserData);
- delete pActItem;
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------
-
-IMPL_LINK( SvxBackgroundTabPage, ParaDestinationHdl_Impl, ListBox*, pBox )
-{
- USHORT nSelPos = pBox->GetSelectEntryPos();
- if( pParaBck_Impl && pParaBck_Impl->nActPos != nSelPos)
- {
- SvxBrushItem** pActItem = new (SvxBrushItem*);
- switch(pParaBck_Impl->nActPos)
- {
- case PARA_DEST_PARA:
- *pActItem = pParaBck_Impl->pParaBrush;
- break;
- case PARA_DEST_CHAR:
- *pActItem = pParaBck_Impl->pCharBrush;
- break;
- }
- pParaBck_Impl->nActPos = nSelPos;
- if(0 == aLbSelect.GetSelectEntryPos()) // Brush ausgewaehlt
- {
- USHORT nWhich = (*pActItem)->Which();
- **pActItem = SvxBrushItem( aBgdColor, nWhich );
- }
- else
- {
- SvxGraphicPosition eNewPos = GetGraphicPosition_Impl();
- const BOOL bIsLink = aBtnLink.IsChecked();
-
- if ( !bIsLink && !bIsGraphicValid )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
-
- if ( bIsLink )
- **pActItem = SvxBrushItem( aBgdGraphicPath,
- aBgdGraphicFilter,
- eNewPos,
- (*pActItem)->Which() );
- else
- **pActItem = SvxBrushItem( aBgdGraphic,
- eNewPos,
- (*pActItem)->Which() );
- }
- switch(nSelPos)
- {
- case PARA_DEST_PARA:
- *pActItem = pParaBck_Impl->pParaBrush;
- aLbSelect.Enable();
- break;
- case PARA_DEST_CHAR:
- {
- *pActItem = pParaBck_Impl->pCharBrush;
- aLbSelect.Enable(FALSE);
- }
- break;
- }
- String aUserData = GetUserData();
- FillControls_Impl(**pActItem, aUserData);
- delete pActItem;
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------
-
-void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
- const String& rUserData )
-
-/* [Beschreibung]
-
-*/
-
-{
- SvxGraphicPosition ePos = rBgdAttr.GetGraphicPos();
- const Color& rColor = rBgdAttr.GetColor();
- if(bColTransparency)
- {
- aColTransMF.SetValue(lcl_TransparencyToPercent(rColor.GetTransparency()));
- aColTransMF.SaveValue();
- BOOL bEnableTransp = rColor.GetTransparency() < 0xff;
- aColTransFT.Enable(bEnableTransp);
- aColTransMF.Enable(bEnableTransp);
- //the default setting should be "no transparency"
- if(!bEnableTransp)
- aColTransMF.SetValue(0);
- }
-
- if ( GPOS_NONE == ePos || !aLbSelect.IsVisible() )
- {
- aLbSelect.SelectEntryPos( 0 );
- ShowColorUI_Impl();
- Color aTrColor( COL_TRANSPARENT );
- aBgdColor = rColor;
-
- USHORT nCol = ( aTrColor != aBgdColor ) ?
- GetItemId_Impl( aBackgroundColorSet, aBgdColor ) : 0;
-
- if( aTrColor != aBgdColor && nCol == 0)
- {
- aBackgroundColorSet.SetNoSelection();
- }
- else
- {
- aBackgroundColorSet.SelectItem( nCol );
- }
-
- pPreviewWin1->NotifyChange( aBgdColor );
- if ( aLbSelect.IsVisible() ) // Grafikteil initialisieren
- {
- aBgdGraphicFilter.Erase();
- aBgdGraphicPath.Erase();
-
- if ( !rUserData.Len() )
- aBtnPreview.Check( FALSE );
- aBtnLink.Check( FALSE );
- aBtnLink.Disable();
- pPreviewWin2->NotifyChange( NULL );
- SetGraphicPosition_Impl( GPOS_TILED ); // Kacheln als Default
- }
- }
- else
- {
- const String* pStrLink = rBgdAttr.GetGraphicLink();
- const String* pStrFilter = rBgdAttr.GetGraphicFilter();
-
- aLbSelect.SelectEntryPos( 1 );
- ShowBitmapUI_Impl();
-
- if ( pStrLink )
- {
-#ifdef DBG_UTIL
- INetURLObject aObj( *pStrLink );
- DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
-#endif
- aBgdGraphicPath = *pStrLink;
- aBtnLink.Check( TRUE );
- aBtnLink.Enable();
- }
- else
- {
- aBgdGraphicPath.Erase();
- aBtnLink.Check( FALSE );
- aBtnLink.Disable();
- }
-
- if(bGraphTransparency)
- {
- const GraphicObject* pObject = rBgdAttr.GetGraphicObject(SfxObjectShell::Current());
- if(pObject)
- aGraphTransMF.SetValue(lcl_TransparencyToPercent(pObject->GetAttr().GetTransparency()));
- else
- aGraphTransMF.SetValue(0);
- aGraphTransMF.SaveValue();
- }
-
- FileClickHdl_Impl( &aBtnLink );
-
- if ( pStrFilter )
- aBgdGraphicFilter = *pStrFilter;
- else
- aBgdGraphicFilter.Erase();
-
- if ( !pStrLink || aBtnPreview.IsChecked() )
- {
- // Grafik ist im Item vorhanden und muss nicht
- // geladen werden:
-
- const Graphic* pGraphic =
- rBgdAttr.GetGraphic( SfxObjectShell::Current() );
-
- if ( !pGraphic && aBtnPreview.IsChecked() )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
- else if ( pGraphic )
- {
- aBgdGraphic = *pGraphic;
- bIsGraphicValid = TRUE;
-
- if ( !rUserData.Len() )
- aBtnPreview.Check();
- }
- else
- {
- RaiseLoadError_Impl();
- bIsGraphicValid = FALSE;
-
- if ( !rUserData.Len() )
- aBtnPreview.Check( FALSE );
- }
- }
-
- if ( aBtnPreview.IsChecked() && bIsGraphicValid )
- {
- Bitmap aBmp = aBgdGraphic.GetBitmap();
- pPreviewWin2->NotifyChange( &aBmp );
- }
- else
- pPreviewWin2->NotifyChange( NULL );
-
- SetGraphicPosition_Impl( ePos );
- }
-}
-/* -----------------------------09.08.2002 14:04------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxBackgroundTabPage::EnableTransparency(BOOL bColor, BOOL bGraphic)
-{
- bColTransparency = bColor;
- bGraphTransparency = bGraphic;
- if(bColor)
- {
- aColTransFT.Show();
- aColTransMF.Show();
- }
- if(bGraphic)
- {
- Size aRectSize(aWndPosition.GetSizePixel());
- Point aRectPos(aWndPosition.GetPosPixel());
- Point aFLPos(aGraphTransFL.GetPosPixel());
- Size aTmp(LogicToPixel(Size(RSC_SP_FLGR_SPACE_Y, RSC_SP_FLGR_SPACE_Y), MAP_APPFONT));
- long nRectHeight = aFLPos.Y() - aRectPos.Y() - aTmp.Height();
- aRectSize.Height() = nRectHeight;
- aWndPosition.SetSizePixel(aRectSize);
- aWndPosition.Invalidate();
- }
-}
-
-void SvxBackgroundTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- if (pFlagItem)
- {
- UINT32 nFlags=pFlagItem->GetValue();
- if ( ( nFlags & SVX_SHOW_TBLCTL ) == SVX_SHOW_TBLCTL )
- ShowTblControl();
- if ( ( nFlags & SVX_SHOW_PARACTL ) == SVX_SHOW_PARACTL )
- ShowParaControl();
- if ( ( nFlags & SVX_SHOW_SELECTOR ) == SVX_SHOW_SELECTOR )
- ShowSelector();
- if ( ( nFlags & SVX_ENABLE_TRANSPARENCY ) == SVX_ENABLE_TRANSPARENCY )
- EnableTransparency(TRUE, TRUE);
- }
-}
diff --git a/svx/source/cui/backgrnd.hrc b/svx/source/cui/backgrnd.hrc
deleted file mode 100644
index 056aceb900..0000000000
--- a/svx/source/cui/backgrnd.hrc
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: backgrnd.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_BACKGRND_HRC
-#define _SVX_BACKGRND_HRC
-
-// defines ------------------------------------------------------------------
-
-#define FT_SELECTOR 1
-#define LB_SELECTOR 1
-
-#define SET_BGDCOLOR 10
-#define GB_BGDCOLOR 11
-#define SET_PATTERN 12
-#define GB_COL_PREVIEW 13
-#define SET_PATCOLOR 14
-#define GB_PATCOLOR 15
-#define CT_BORDER 16
-#define FT_PREVIEW 20
-#define WIN_PREVIEW1 21
-
-#define BTN_BROWSE 20
-#define FT_FILE 21
-#define BTN_LINK 22
-#define BTN_PREVIEW 23
-#define GB_FILE 24
-#define BTN_AREA 25
-#define BTN_TILE 26
-#define BTN_POSITION 27
-#define WND_POSITION 28
-#define GB_POSITION 29
-#define WIN_PREVIEW2 30
-#define GB_PREVIEW 31
-#define LB_TBL_BOX 32
-#define FT_TBL_DESC 33
-#define LB_PARA_BOX 34
-#define FT_COL_TRANS 35
-#define MF_COL_TRANS 36
-#define FL_GRAPH_TRANS 37
-#define MF_GRAPH_TRANS 38
-
-#define STR_BROWSE 1
-#define STR_UNLINKED 2
-
-
-#endif
-
diff --git a/svx/source/cui/backgrnd.hxx b/svx/source/cui/backgrnd.hxx
deleted file mode 100644
index 7c8f3bfe25..0000000000
--- a/svx/source/cui/backgrnd.hxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: backgrnd.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_BACKGRND_HXX
-#define _SVX_BACKGRND_HXX
-
-// include ---------------------------------------------------------------
-
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-#include <svtools/stdctrl.hxx>
-#ifndef _GRAPH_HXX //autogen
-#include <vcl/graph.hxx>
-#endif
-#include <svtools/valueset.hxx>
-#include <svx/dlgctrl.hxx>
-
-// class SvxBackgroundTabPage --------------------------------------------
-/*
-{k:\svx\prototyp\dialog\backgrnd.bmp}
- [Beschreibung]
- Mit dieser TabPage kann eine Brush (z.B. fuer die Hintergrundfarbe eines
- Rahmens) eingestellt werden.
- [Items]
- <SvxBrushItem>: <SID_ATTR_BRUSH>;
-*/
-
-//------------------------------------------------------------------------
-// forwards:
-
-class BackgroundPreviewImpl;
-class SvxOpenGraphicDialog;
-struct SvxBackgroundTable_Impl;
-struct SvxBackgroundPara_Impl;
-struct SvxBackgroundPage_Impl;
-class SvxBrushItem;
-//------------------------------------------------------------------------
-
-class SvxBackgroundTabPage : public SvxTabPage
-{
- using TabPage::DeactivatePage;
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void FillUserData();
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void ShowSelector(); // Umschalt-ListBox aktivieren
- void ShowTblControl(); // fuer den Writer (Zellen/Zeilen/Tabelle)
- void ShowParaControl(BOOL bCharOnly = FALSE); // fuer den Writer (Absatz/Zeichen)
- void EnableTransparency(BOOL bColor, BOOL bGraphic);
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-private:
- SvxBackgroundTabPage( Window* pParent, const SfxItemSet& rCoreSet );
- ~SvxBackgroundTabPage();
-
- // Hintergrundfarbe ------------------------------------
- Control aBorderWin;
- ValueSet aBackgroundColorSet;
- FixedLine aBackgroundColorBox;
- BackgroundPreviewImpl* pPreviewWin1;
- //color transparency
- FixedText aColTransFT;
- MetricField aColTransMF;
- // Hintergrund-Bitmap ----------------------------------
- PushButton aBtnBrowse;
- CheckBox aBtnLink;
- CheckBox aBtnPreview;
- FixedInfo aFtFile;
- FixedLine aGbFile;
- RadioButton aBtnPosition;
- RadioButton aBtnArea;
- RadioButton aBtnTile;
- SvxRectCtl aWndPosition;
- FixedLine aGbPosition;
- //transparency of graphics
- FixedLine aGraphTransFL;
- MetricField aGraphTransMF;
-
- BackgroundPreviewImpl* pPreviewWin2;
- // Selektor --------------------------------------------
- FixedText aSelectTxt;
- ListBox aLbSelect;
- const String aStrBrowse;
- const String aStrUnlinked;
-
- // DDListBox fuer Writer -------------------------------
-
- FixedText aTblDesc;
- ListBox aTblLBox;
- ListBox aParaLBox;
-
- //------------------------------------------------------
- Color aBgdColor;
- USHORT nHtmlMode;
- BOOL bAllowShowSelector : 1;
- BOOL bIsGraphicValid : 1;
- BOOL bLinkOnly : 1;
- BOOL bResized : 1;
- BOOL bColTransparency : 1;
- BOOL bGraphTransparency : 1;
- Graphic aBgdGraphic;
- String aBgdGraphicPath;
- String aBgdGraphicFilter;
-
- SvxBackgroundPage_Impl* pPageImpl;
- SvxOpenGraphicDialog* pImportDlg;
-
- // Items fuer Sw-Tabelle muessen gesammelt werden
- SvxBackgroundTable_Impl* pTableBck_Impl;
- // auch fuer die Absatzvorlage
- SvxBackgroundPara_Impl* pParaBck_Impl;
-
-#ifdef _SVX_BACKGRND_CXX
- void FillColorValueSets_Impl();
- void ShowColorUI_Impl();
- void ShowBitmapUI_Impl();
- BOOL LoadLinkedGraphic_Impl();
- void RaiseLoadError_Impl();
- void SetGraphicPosition_Impl( SvxGraphicPosition ePos );
- SvxGraphicPosition GetGraphicPosition_Impl();
- void FillControls_Impl(const SvxBrushItem& rBgdAttr,
- const String& rUserData);
- BOOL FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, USHORT nSlot);
- void ResetFromWallpaperItem( const SfxItemSet& rSet );
-
- DECL_LINK( LoadTimerHdl_Impl, Timer* );
- DECL_LINK( SelectHdl_Impl, ListBox* );
- DECL_LINK( BrowseHdl_Impl, PushButton* );
- DECL_LINK( RadioClickHdl_Impl, RadioButton* );
- DECL_LINK( FileClickHdl_Impl, CheckBox* );
- DECL_LINK( BackgroundColorHdl_Impl, ValueSet* );
- DECL_LINK( TblDestinationHdl_Impl, ListBox* );
- DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
-#endif
-};
-
-#endif // #ifndef _SVX_BACKGRND_HXX
-
-
diff --git a/svx/source/cui/backgrnd.src b/svx/source/cui/backgrnd.src
deleted file mode 100644
index e9f847534c..0000000000
--- a/svx/source/cui/backgrnd.src
+++ /dev/null
@@ -1,307 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: backgrnd.src,v $
- * $Revision: 1.40 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svtools/controldims.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "backgrnd.hrc"
- // define ----------------------------------------------------------------
-#define UNLINKED_IMAGE \
- Text [ en-US ] = "Unlinked graphic" ; \
-
- // pragma ----------------------------------------------------------------
-
- // RID_SVXPAGE_BACKGROUND ------------------------------------------------
-TabPage RID_SVXPAGE_BACKGROUND
-{
- HelpId = HID_BACKGROUND ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Background" ;
- FixedText FT_SELECTOR
- {
- Pos = MAP_APPFONT ( 6 , 4 ) ;
- Size = MAP_APPFONT ( 24 , 10 ) ;
- Hide = TRUE ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "A~s" ;
- };
- ListBox LB_SELECTOR
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 33 , 3 ) ;
- Size = MAP_APPFONT ( 82 , 48 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Color" ; Default ; > ;
- < "Graphic" ; Default ; > ;
- };
- };
- FixedText FT_TBL_DESC
- {
- Pos = MAP_APPFONT ( 145 , 5 ) ;
- Size = MAP_APPFONT ( 24 , 10 ) ;
- Hide = TRUE ;
- LeftLabel = TRUE ;
- /* ### ACHTUNG: Neuer Text in Resource? Fü~r : F³~r */
- Text [ en-US ] = "F~or" ;
- };
- ListBox LB_TBL_BOX
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 172 , 3 ) ;
- Size = MAP_APPFONT ( 82 , 48 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Cell" ; > ;
- < "Row" ; > ;
- < "Table" ; > ;
- };
- };
- ListBox LB_PARA_BOX
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 172 , 3 ) ;
- Size = MAP_APPFONT ( 82 , 48 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Paragraph" ; > ;
- < "Character" ; > ;
- };
- };
- // Hintergrund-Brush ----------------------------------------------------
- Control CT_BORDER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 116+2 , 145+2 ) ;
- DialogControl = TRUE;
- };
- Control SET_BGDCOLOR
- {
- HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 116 , 145 ) ;
- TabStop = TRUE ;
- };
- FixedLine GB_BGDCOLOR
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 21 ) ;
- Size = MAP_APPFONT ( 248 , 8) ;
- Text [ en-US ] = "Background color" ;
- };
- Window WIN_PREVIEW1
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 166 , 34 ) ;
- Size = MAP_APPFONT ( 82 , 40 ) ;
- };
- FixedText FT_COL_TRANS
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 166, 74 + RSC_SP_CTRL_Y + 2 ) ;
- Size = MAP_APPFONT ( 50 , 8) ;
- Text [ en-US ] = "~Transparency" ;
- };
- MetricField MF_COL_TRANS
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 218 , 74 + RSC_SP_CTRL_Y ) ;
- Size = MAP_APPFONT ( 30 , 12) ;
- Border = TRUE ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- SpinSize = 5 ;
- Minimum = 0;
- Maximum = 100;
- };
-
- // Hintergrund-Bitmap ----------------------------------------------------
- FixedLine GB_FILE
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 23 ) ;
- Size = MAP_APPFONT ( 153 , 8 ) ;
- Text [ en-US ] = "File" ;
- };
- PushButton BTN_BROWSE
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 + RSC_SP_FLGR_INNERBORDER_LEFT , 23 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Browse..." ;
- };
- CheckBox BTN_LINK
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 + RSC_SP_FLGR_INNERBORDER_LEFT + 60 + 2*RSC_SP_CTRL_X, 23 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + 3 ) ;
- Size = MAP_APPFONT ( 78 , 10 ) ;
- Text [ en-US ] = "~Link" ;
- };
- FixedText FT_FILE
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 + RSC_SP_FLGR_INNERBORDER_LEFT , 23 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + RSC_CD_PUSHBUTTON_HEIGHT + RSC_SP_CTRL_Y ) ;
- Size = MAP_APPFONT ( 141 , 8 ) ;
- UNLINKED_IMAGE
- };
- FixedLine GB_POSITION
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 78 ) ;
- Size = MAP_APPFONT ( 153 , 8 ) ;
- Text [ en-US ] = "Type" ;
- };
- RadioButton BTN_POSITION
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 89 ) ;
- Size = MAP_APPFONT ( 49 , 10 ) ;
- Text [ en-US ] = "~Position" ;
- };
- RadioButton BTN_AREA
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 103 ) ;
- Size = MAP_APPFONT ( 49 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Fläche : ~Flõche */
- Text [ en-US ] = "Ar~ea" ;
- };
- RadioButton BTN_TILE
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 117 ) ;
- Size = MAP_APPFONT ( 49 , 10 ) ;
- Text [ en-US ] = "~Tile" ;
- };
- Control WND_POSITION
- {
- HelpId = HID_BACKGROUND_CTL_POSITION ;
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 64 , 89 ) ;
- Size = MAP_APPFONT ( 90 , 87 ) ;
- TabStop = TRUE ;
- };
- FixedLine FL_GRAPH_TRANS
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 6 , 157 ) ;
- Size = MAP_APPFONT ( 153 , 8) ;
- Text [ en-US ] = "Transparency" ;
- };
- MetricField MF_GRAPH_TRANS
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 168 ) ;
- Size = MAP_APPFONT ( 30 , 12) ;
- Border = TRUE ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- SpinSize = 5 ;
- Minimum = 0;
- Maximum = 100;
- };
- Window WIN_PREVIEW2
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 170 , 23 + 4 ) ;
- Size = MAP_APPFONT ( 81 , 139 ) ;
- };
- CheckBox BTN_PREVIEW
- {
- Pos = MAP_APPFONT ( 170 , 23 + 4 + 139 + RSC_SP_CTRL_GROUP_Y ) ;
- Size = MAP_APPFONT ( 141 , 10 ) ;
- Text [ en-US ] = "Pre~view" ;
- };
- String STR_BROWSE
- {
- Text [ en-US ] = "Find graphics" ;
- };
- String STR_UNLINKED
- {
- UNLINKED_IMAGE
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/bbdlg.cxx b/svx/source/cui/bbdlg.cxx
deleted file mode 100644
index 0f5ea570f1..0000000000
--- a/svx/source/cui/bbdlg.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: bbdlg.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-
-#include <svx/dialogs.hrc>
-#include "page.hrc"
-
-#include "bbdlg.hxx"
-#include "border.hxx"
-#include "backgrnd.hxx"
-#include <svx/dialmgr.hxx>
-
-// class SvxBorderBackgroundDlg ------------------------------------------
-
-SvxBorderBackgroundDlg::SvxBorderBackgroundDlg( Window *pParent,
- const SfxItemSet& rCoreSet,
- BOOL bEnableSelector ) :
-
- SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_BBDLG ), &rCoreSet ),
- bEnableBackgroundSelector( bEnableSelector )
-{
- FreeResource();
- AddTabPage( RID_SVXPAGE_BORDER, SvxBorderTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 );
-}
-
-// -----------------------------------------------------------------------
-
-SvxBorderBackgroundDlg::~SvxBorderBackgroundDlg()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBorderBackgroundDlg::PageCreated( USHORT nPageId, SfxTabPage& rTabPage )
-{
- // Umschalten zwischen Farbe/Grafik ermoeglichen:
-
- if ( bEnableBackgroundSelector && (RID_SVXPAGE_BACKGROUND == nPageId) )
- ((SvxBackgroundTabPage&)rTabPage).ShowSelector( );
-}
-
-
diff --git a/svx/source/cui/bbdlg.hxx b/svx/source/cui/bbdlg.hxx
deleted file mode 100644
index 2cca611970..0000000000
--- a/svx/source/cui/bbdlg.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: bbdlg.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_BBDLG_HXX
-#define _SVX_BBDLG_HXX
-
-// include ---------------------------------------------------------------
-
-#include <sfx2/tabdlg.hxx>
-
-/*--------------------------------------------------------------------
- Beschreibung: Border Background Pages buendeln
- --------------------------------------------------------------------*/
-
-class SvxBorderBackgroundDlg: public SfxTabDialog
-{
-public:
- SvxBorderBackgroundDlg( Window *pParent,
- const SfxItemSet& rCoreSet,
- BOOL bEnableSelector = FALSE );
-
- ~SvxBorderBackgroundDlg();
-
-protected:
- virtual void PageCreated( USHORT nPageId, SfxTabPage& rTabPage );
-
-private:
- BOOL bEnableBackgroundSelector; // fuer Border/Background-Dlg
-};
-
-
-#endif
-
diff --git a/svx/source/cui/bbdlg.src b/svx/source/cui/bbdlg.src
deleted file mode 100644
index 3f9e6ba0f5..0000000000
--- a/svx/source/cui/bbdlg.src
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: bbdlg.src,v $
- * $Revision: 1.22 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
- // pragma ----------------------------------------------------------------
-
- // RID_SVXDLG_BBDLG ------------------------------------------------------
-TabDialog RID_SVXDLG_BBDLG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 328 , 155 ) ;
- Text [ en-US ] = "Border / Background" ;
- Moveable = TRUE ;
- // Closeable = TRUE; hat ja einen OKButton
- TabControl 1
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 2 , 10 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_BORDER ;
- Text [ en-US ] = "Borders" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_BACKGROUND ;
- Text [ en-US ] = "Background" ;
- };
- };
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/border.cxx b/svx/source/cui/border.cxx
deleted file mode 100644
index 5cda542e71..0000000000
--- a/svx/source/cui/border.cxx
+++ /dev/null
@@ -1,1274 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: border.cxx,v $
- * $Revision: 1.39 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/module.hxx>
-
-#define _SVX_BORDER_CXX
-
-#include <svx/dialogs.hrc>
-#include <svx/svxitems.hrc>
-#include "border.hrc"
-#include "helpid.hrc"
-
-#define LINESTYLE_HTML_MAX 5
-
-#include <svx/xtable.hxx> // XColorTable
-#include "drawitem.hxx"
-#include <svx/boxitem.hxx>
-#include <svx/shaditem.hxx>
-#include "border.hxx"
-#include "dlgutil.hxx"
-#include <svx/dialmgr.hxx>
-#include "htmlmode.hxx"
-#include <vcl/msgbox.hxx>
-#include <svx/svxids.hrc> //CHINA001
-#include "flagsdef.hxx" //CHINA001
-#include <sfx2/request.hxx>
-#include <svtools/intitem.hxx> //CHINA001
-#include <sfx2/itemconnect.hxx>
-#include "borderconn.hxx"
-
-// -----------------------------------------------------------------------
-
-/*
- * [Beschreibung:]
- * TabPage zum Einstellen der Rahmen-Attribute.
- * Benoetigt
- * ein SvxShadowItem: Schatten
- * ein SvxBoxItem: Linien links,rechts,oben,unten ),
- * ein SvxBoxInfo: Linien vertikal,horizontal, Abstaende, Flags )
- *
- * Linien koennen drei Zustaende haben.
- * 1. Show ( -> gueltige Werte )
- * 2. Hide ( -> NULL-Pointer )
- * 3. DontCare ( -> gesonderte Valid-Flags im InfoItem )
- */
-
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW,
- SID_ATTR_ALIGN_MARGIN, SID_ATTR_ALIGN_MARGIN,
- SID_ATTR_BORDER_CONNECT, SID_ATTR_BORDER_CONNECT,
- SID_SW_COLLAPSING_BORDERS, SID_SW_COLLAPSING_BORDERS,
- SID_ATTR_BORDER_DIAG_TLBR, SID_ATTR_BORDER_DIAG_BLTR,
- 0
-};
-
-BOOL SvxBorderTabPage::bSync = TRUE;
-
-
-//------------------------------------------------------------------------
-
-#define LINE_WIDTH0 (DEF_LINE_WIDTH_0 *100)
-#define LINE_WIDTH1 (DEF_LINE_WIDTH_1 *100)
-#define LINE_WIDTH2 (DEF_LINE_WIDTH_2 *100)
-#define LINE_WIDTH3 (DEF_LINE_WIDTH_3 *100)
-#define LINE_WIDTH4 (DEF_LINE_WIDTH_4 *100)
-#define LINE_WIDTH5 (DEF_LINE_WIDTH_5 *100)
-
-#define DLINE0_OUT (DEF_DOUBLE_LINE0_OUT *100)
-#define DLINE0_IN (DEF_DOUBLE_LINE0_IN *100)
-#define DLINE0_DIST (DEF_DOUBLE_LINE0_DIST *100)
-
-#define DLINE1_OUT (DEF_DOUBLE_LINE1_OUT *100)
-#define DLINE1_IN (DEF_DOUBLE_LINE1_IN *100)
-#define DLINE1_DIST (DEF_DOUBLE_LINE1_DIST *100)
-
-#define DLINE2_OUT (DEF_DOUBLE_LINE2_OUT *100)
-#define DLINE2_IN (DEF_DOUBLE_LINE2_IN *100)
-#define DLINE2_DIST (DEF_DOUBLE_LINE2_DIST *100)
-
-#define DLINE3_OUT (DEF_DOUBLE_LINE3_OUT *100)
-#define DLINE3_IN (DEF_DOUBLE_LINE3_IN *100)
-#define DLINE3_DIST (DEF_DOUBLE_LINE3_DIST *100)
-
-#define DLINE4_OUT (DEF_DOUBLE_LINE4_OUT *100)
-#define DLINE4_IN (DEF_DOUBLE_LINE4_IN *100)
-#define DLINE4_DIST (DEF_DOUBLE_LINE4_DIST *100)
-
-#define DLINE5_OUT (DEF_DOUBLE_LINE5_OUT *100)
-#define DLINE5_IN (DEF_DOUBLE_LINE5_IN *100)
-#define DLINE5_DIST (DEF_DOUBLE_LINE5_DIST *100)
-
-#define DLINE6_OUT (DEF_DOUBLE_LINE6_OUT *100)
-#define DLINE6_IN (DEF_DOUBLE_LINE6_IN *100)
-#define DLINE6_DIST (DEF_DOUBLE_LINE6_DIST *100)
-
-#define DLINE7_OUT (DEF_DOUBLE_LINE7_OUT *100)
-#define DLINE7_IN (DEF_DOUBLE_LINE7_IN *100)
-#define DLINE7_DIST (DEF_DOUBLE_LINE7_DIST *100)
-
-#define DLINE8_OUT (DEF_DOUBLE_LINE8_OUT *100)
-#define DLINE8_IN (DEF_DOUBLE_LINE8_IN *100)
-#define DLINE8_DIST (DEF_DOUBLE_LINE8_DIST *100)
-
-#define DLINE9_OUT (DEF_DOUBLE_LINE9_OUT *100)
-#define DLINE9_IN (DEF_DOUBLE_LINE9_IN *100)
-#define DLINE9_DIST (DEF_DOUBLE_LINE9_DIST *100)
-
-#define DLINE10_OUT (DEF_DOUBLE_LINE10_OUT *100)
-#define DLINE10_IN (DEF_DOUBLE_LINE10_IN *100)
-#define DLINE10_DIST (DEF_DOUBLE_LINE10_DIST*100)
-
-#define RGBCOL(eColorName) (TpBorderRGBColor(eColorName))
-
-// LOKALE FUNKTION
-// Konvertiert in echte RGB-Farben, damit in den Listboxen
-// endlich mal richtig selektiert werden kann.
-
-Color TpBorderRGBColor( ColorData aColorData )
-{
- Color aRGBColor( aColorData );
-
- return( aRGBColor );
-}
-
-// -----------------------------------------------------------------------
-
-Color TpBorderRGBColor( const Color& rColor )
-{
- Color aRGBColor( rColor.GetRed(),
- rColor.GetGreen(),
- rColor.GetBlue() );
-
- return( aRGBColor );
-}
-
-// -----------------------------------------------------------------------
-void lcl_SetDecimalDigitsTo1(MetricField& rField)
-{
- sal_Int64 nMin = rField.Denormalize( rField.GetMin( FUNIT_TWIP ) );
- rField.SetDecimalDigits(1);
- rField.SetMin( rField.Normalize( nMin ), FUNIT_TWIP );
-}
-// -----------------------------------------------------------------------
-
-SvxBorderTabPage::SvxBorderTabPage( Window* pParent,
- const SfxItemSet& rCoreAttrs )
-
- : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_BORDER ), rCoreAttrs ),
-
- aFlBorder ( this, SVX_RES( FL_BORDER ) ),
- aDefaultFT ( this, SVX_RES( FT_DEFAULT ) ),
- aWndPresets ( this, SVX_RES( WIN_PRESETS ) ),
- aUserDefFT ( this, SVX_RES( FT_USERDEF ) ),
- aFrameSel ( this, SVX_RES( WIN_FRAMESEL ) ),
-
- aFlSep1 ( this, SVX_RES( FL_SEPARATOR1 ) ),
- aFlLine ( this, SVX_RES( FL_LINE ) ),
- aStyleFT ( this, SVX_RES( FT_STYLE ) ),
- aLbLineStyle ( this, SVX_RES( LB_LINESTYLE ) ),
- aColorFT ( this, SVX_RES( FT_COLOR ) ),
- aLbLineColor ( this, SVX_RES( LB_LINECOLOR ) ),
-
- aFlSep2 ( this, SVX_RES( FL_SEPARATOR2 ) ),
- aDistanceFL ( this, SVX_RES( FL_DISTANCE ) ),
- aLeftFT ( this, SVX_RES( FT_LEFT ) ),
- aLeftMF ( this, SVX_RES( MF_LEFT ) ),
- aRightFT ( this, SVX_RES( FT_RIGHT ) ),
- aRightMF ( this, SVX_RES( MF_RIGHT ) ),
- aTopFT ( this, SVX_RES( FT_TOP ) ),
- aTopMF ( this, SVX_RES( MF_TOP ) ),
- aBottomFT ( this, SVX_RES( FT_BOTTOM ) ),
- aBottomMF ( this, SVX_RES( MF_BOTTOM ) ),
- aSynchronizeCB ( this, SVX_RES( CB_SYNC ) ),
-
- aFlShadow ( this, SVX_RES( FL_SHADOW ) ),
- aFtShadowPos ( this, SVX_RES( FT_SHADOWPOS ) ),
- aWndShadows ( this, SVX_RES( WIN_SHADOWS ) ),
- aFtShadowSize ( this, SVX_RES( FT_SHADOWSIZE ) ),
- aEdShadowSize ( this, SVX_RES( ED_SHADOWSIZE ) ),
- aFtShadowColor ( this, SVX_RES( FT_SHADOWCOLOR ) ),
- aLbShadowColor ( this, SVX_RES( LB_SHADOWCOLOR ) ),
- aPropertiesFL ( this, SVX_RES( FL_PROPERTIES ) ),
- aMergeWithNextCB( this, SVX_RES( CB_MERGEWITHNEXT ) ),
- aMergeAdjacentBordersCB( this, SVX_RES( CB_MERGEADJACENTBORDERS ) ),
- aShadowImgLstH( SVX_RES(ILH_SDW_BITMAPS)),
- aShadowImgLst( SVX_RES(IL_SDW_BITMAPS)),
- aBorderImgLstH( SVX_RES(ILH_PRE_BITMAPS)),
- aBorderImgLst( SVX_RES(IL_PRE_BITMAPS)),
- nMinValue(0),
- nSWMode(0),
- mbHorEnabled( false ),
- mbVerEnabled( false ),
- mbTLBREnabled( false ),
- mbBLTREnabled( false ),
- mbUseMarginItem( false )
-
-{
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- /* Use SvxMarginItem instead of margins from SvxBoxItem, if present.
- -> Remember this state in mbUseMarginItem, because other special handling
- is needed across various functions... */
- mbUseMarginItem = rCoreAttrs.GetItemState(GetWhich(SID_ATTR_ALIGN_MARGIN),TRUE) != SFX_ITEM_UNKNOWN;
-
- // Metrik einstellen
- FieldUnit eFUnit = GetModuleFieldUnit( &rCoreAttrs );
-
- if( mbUseMarginItem )
- {
- // copied from SvxAlignmentTabPage
- switch ( eFUnit )
- {
- // #103396# the default value (1pt) can't be accurately represented in
- // inches or pica with two decimals, so point is used instead.
- case FUNIT_PICA:
- case FUNIT_INCH:
- case FUNIT_FOOT:
- case FUNIT_MILE:
- eFUnit = FUNIT_POINT;
- break;
-
- case FUNIT_CM:
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ;//prevent warning
- }
- }
- else
- {
- switch ( eFUnit )
- {
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ; //prevent warning
- }
- }
-
- SetFieldUnit( aEdShadowSize, eFUnit );
-
- USHORT nWhich = GetWhich( SID_ATTR_BORDER_INNER, sal_False );
- BOOL bIsDontCare = TRUE;
-
- if ( rCoreAttrs.GetItemState( nWhich, TRUE ) >= SFX_ITEM_AVAILABLE )
- {
- // Absatz oder Tabelle
- const SvxBoxInfoItem* pBoxInfo =
- (const SvxBoxInfoItem*)&( rCoreAttrs.Get( nWhich ) );
-
- mbHorEnabled = pBoxInfo->IsHorEnabled();
- mbVerEnabled = pBoxInfo->IsVerEnabled();
- mbTLBREnabled = sfx::ItemWrapperHelper::IsKnownItem( rCoreAttrs, SID_ATTR_BORDER_DIAG_TLBR );
- mbBLTREnabled = sfx::ItemWrapperHelper::IsKnownItem( rCoreAttrs, SID_ATTR_BORDER_DIAG_BLTR );
-
- if(pBoxInfo->IsDist())
- {
- SetFieldUnit(aLeftMF, eFUnit);
- SetFieldUnit(aRightMF, eFUnit);
- SetFieldUnit(aTopMF, eFUnit);
- SetFieldUnit(aBottomMF, eFUnit);
- aSynchronizeCB.Check(bSync);
- aSynchronizeCB.SetClickHdl(LINK(this, SvxBorderTabPage, SyncHdl_Impl));
- aLeftMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl));
- aRightMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl));
- aTopMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl));
- aBottomMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl));
- }
- else
- {
- aFlSep2.Hide();
- aDistanceFL.Hide();
- aLeftFT.Hide();
- aLeftMF.Hide();
- aRightFT.Hide();
- aRightMF.Hide();
- aTopFT.Hide();
- aTopMF.Hide();
- aBottomFT.Hide();
- aBottomMF.Hide();
- aSynchronizeCB.Hide();
- }
- bIsDontCare = !pBoxInfo->IsValid( VALID_DISABLE );
- }
- if(!mbUseMarginItem && eFUnit == FUNIT_MM && SFX_MAPUNIT_TWIP == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
- {
- //#i91548# changing the number of decimal digits changes the minimum values, too
- lcl_SetDecimalDigitsTo1(aLeftMF);
- lcl_SetDecimalDigitsTo1(aRightMF);
- lcl_SetDecimalDigitsTo1(aTopMF);
- lcl_SetDecimalDigitsTo1(aBottomMF);
- lcl_SetDecimalDigitsTo1(aEdShadowSize);
- }
-
- svx::FrameSelFlags nFlags = svx::FRAMESEL_OUTER;
- if( mbHorEnabled )
- nFlags |= svx::FRAMESEL_INNER_HOR;
- if( mbVerEnabled )
- nFlags |= svx::FRAMESEL_INNER_VER;
- if( mbTLBREnabled )
- nFlags |= svx::FRAMESEL_DIAG_TLBR;
- if( mbBLTREnabled )
- nFlags |= svx::FRAMESEL_DIAG_BLTR;
- if( bIsDontCare )
- nFlags |= svx::FRAMESEL_DONTCARE;
- aFrameSel.Initialize( nFlags );
-
- aFrameSel.SetSelectHdl(LINK(this, SvxBorderTabPage, LinesChanged_Impl));
- aLbLineStyle.SetSelectHdl( LINK( this, SvxBorderTabPage, SelStyleHdl_Impl ) );
- aLbLineColor.SetSelectHdl( LINK( this, SvxBorderTabPage, SelColHdl_Impl ) );
- aLbShadowColor.SetSelectHdl( LINK( this, SvxBorderTabPage, SelColHdl_Impl ) );
- aWndPresets.SetSelectHdl( LINK( this, SvxBorderTabPage, SelPreHdl_Impl ) );
- aWndShadows.SetSelectHdl( LINK( this, SvxBorderTabPage, SelSdwHdl_Impl ) );
-
- FillValueSets();
- FillLineListBox_Impl();
-
- // ColorBox aus der XColorTable fuellen.
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- const SfxPoolItem* pItem = NULL;
- XColorTable* pColorTable = NULL;
-
- DBG_ASSERT( pDocSh, "DocShell not found!" );
-
- if ( pDocSh )
- {
- pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
- }
-
- DBG_ASSERT( pColorTable, "ColorTable not found!" );
-
- if ( pColorTable )
- {
- // fuellen der Linienfarben-Box
- aLbLineColor.SetUpdateMode( FALSE );
-
- for ( long i = 0; i < pColorTable->Count(); ++i )
- {
- XColorEntry* pEntry = pColorTable->GetColor(i);
- aLbLineColor.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
- aLbLineColor.SetUpdateMode( TRUE );
- // dann nur noch in die Schattenfarben-Box kopieren
- aLbShadowColor.CopyEntries( aLbLineColor );
- }
- FreeResource();
-
- // connections
-
- bool bSupportsShadow = !SfxItemPool::IsSlot( GetWhich( SID_ATTR_BORDER_SHADOW ) );
- if( bSupportsShadow )
- AddItemConnection( svx::CreateShadowConnection( rCoreAttrs, aWndShadows, aEdShadowSize, aLbShadowColor ) );
- else
- HideShadowControls();
-
- if( mbUseMarginItem )
- AddItemConnection( svx::CreateMarginConnection( rCoreAttrs, aLeftMF, aRightMF, aTopMF, aBottomMF ) );
- if( aFrameSel.IsBorderEnabled( svx::FRAMEBORDER_TLBR ) )
- AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_TLBR, aFrameSel, svx::FRAMEBORDER_TLBR ) );
- if( aFrameSel.IsBorderEnabled( svx::FRAMEBORDER_BLTR ) )
- AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_BLTR, aFrameSel, svx::FRAMEBORDER_BLTR ) );
- // --> OD 2005-03-01 #i43593# - item connection doesn't work for Writer,
- // because the Writer item sets contain these items
- // checkbox "Merge with next paragraph" only visible for Writer dialog format.paragraph
- AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_BORDER_CONNECT, aMergeWithNextCB, sfx::ITEMCONN_DEFAULT ) );
- aMergeWithNextCB.Hide();
- // checkbox "Merge adjacent line styles" only visible for Writer dialog format.table
- AddItemConnection( new sfx::CheckBoxConnection( SID_SW_COLLAPSING_BORDERS, aMergeAdjacentBordersCB, sfx::ITEMCONN_DEFAULT ) );
- aMergeAdjacentBordersCB.Hide();
- // <--
-}
-
-// -----------------------------------------------------------------------
-
-SvxBorderTabPage::~SvxBorderTabPage()
-{
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxBorderTabPage::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxBorderTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return ( new SvxBorderTabPage( pParent, rAttrSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBorderTabPage::ResetFrameLine_Impl( svx::FrameBorderType eBorder, const SvxBorderLine* pCoreLine, bool bValid )
-{
- if( aFrameSel.IsBorderEnabled( eBorder ) )
- {
- if( bValid )
- aFrameSel.ShowBorder( eBorder, pCoreLine );
- else
- aFrameSel.SetBorderDontCare( eBorder );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBorderTabPage::Reset( const SfxItemSet& rSet )
-{
- SfxTabPage::Reset( rSet );
-
- const SvxBoxItem* pBoxItem;
- const SvxBoxInfoItem* pBoxInfoItem;
- USHORT nWhichBox = GetWhich(SID_ATTR_BORDER_OUTER);
- SfxMapUnit eCoreUnit;
- const Color aColBlack = RGBCOL(COL_BLACK);
-
- pBoxItem = (const SvxBoxItem*)GetItem( rSet, SID_ATTR_BORDER_OUTER );
-
-
- pBoxInfoItem = (const SvxBoxInfoItem*)GetItem( rSet, SID_ATTR_BORDER_INNER, sal_False );
-
- eCoreUnit = rSet.GetPool()->GetMetric( nWhichBox );
-
- if ( pBoxItem && pBoxInfoItem ) // -> Don't Care
- {
- ResetFrameLine_Impl( svx::FRAMEBORDER_LEFT, pBoxItem->GetLeft(), pBoxInfoItem->IsValid( VALID_LEFT ) );
- ResetFrameLine_Impl( svx::FRAMEBORDER_RIGHT, pBoxItem->GetRight(), pBoxInfoItem->IsValid( VALID_RIGHT ) );
- ResetFrameLine_Impl( svx::FRAMEBORDER_TOP, pBoxItem->GetTop(), pBoxInfoItem->IsValid( VALID_TOP ) );
- ResetFrameLine_Impl( svx::FRAMEBORDER_BOTTOM, pBoxItem->GetBottom(), pBoxInfoItem->IsValid( VALID_BOTTOM ) );
- ResetFrameLine_Impl( svx::FRAMEBORDER_VER, pBoxInfoItem->GetVert(), pBoxInfoItem->IsValid( VALID_VERT ) );
- ResetFrameLine_Impl( svx::FRAMEBORDER_HOR, pBoxInfoItem->GetHori(), pBoxInfoItem->IsValid( VALID_HORI ) );
-
- //-------------------
- // Abstand nach innen
- //-------------------
- if( !mbUseMarginItem )
- {
- if ( aLeftMF.IsVisible() )
- {
- SetMetricValue( aLeftMF, pBoxInfoItem->GetDefDist(), eCoreUnit );
- SetMetricValue( aRightMF, pBoxInfoItem->GetDefDist(), eCoreUnit );
- SetMetricValue( aTopMF, pBoxInfoItem->GetDefDist(), eCoreUnit );
- SetMetricValue( aBottomMF, pBoxInfoItem->GetDefDist(), eCoreUnit );
-
- nMinValue = static_cast<long>(aLeftMF.GetValue());
-
- if ( pBoxInfoItem->IsMinDist() )
- {
- aLeftMF.SetFirst( nMinValue );
- aRightMF.SetFirst( nMinValue );
- aTopMF.SetFirst( nMinValue );
- aBottomMF.SetFirst( nMinValue );
- }
-
- if ( pBoxInfoItem->IsDist() )
- {
- if( rSet.GetItemState( nWhichBox, TRUE ) >= SFX_ITEM_DEFAULT )
- {
- BOOL bIsAnyBorderVisible = aFrameSel.IsAnyBorderVisible();
- if( !bIsAnyBorderVisible || !pBoxInfoItem->IsMinDist() )
- {
- aLeftMF.SetMin( 0 );
- aLeftMF.SetFirst( 0 );
- aRightMF.SetMin( 0 );
- aRightMF.SetFirst( 0 );
- aTopMF.SetMin( 0 );
- aTopMF.SetFirst( 0 );
- aBottomMF.SetMin( 0 );
- aBottomMF.SetFirst( 0 );
- }
- long nLeftDist = pBoxItem->GetDistance( BOX_LINE_LEFT);
- SetMetricValue( aLeftMF, nLeftDist, eCoreUnit );
- long nRightDist = pBoxItem->GetDistance( BOX_LINE_RIGHT);
- SetMetricValue( aRightMF, nRightDist, eCoreUnit );
- long nTopDist = pBoxItem->GetDistance( BOX_LINE_TOP);
- SetMetricValue( aTopMF, nTopDist, eCoreUnit );
- long nBottomDist = pBoxItem->GetDistance( BOX_LINE_BOTTOM);
- SetMetricValue( aBottomMF, nBottomDist, eCoreUnit );
-
- // ist der Abstand auf nicht-default gesetzt,
- // dann soll der Wert auch nicht
- // mehr autom. veraendert werden
-
- // if the distance is set with no active border line
- // or it is null with an active border line
- // no automatic changes should be made
- const long nDefDist = bIsAnyBorderVisible ? pBoxInfoItem->GetDefDist() : 0;
- BOOL bDiffDist = (nDefDist != nLeftDist ||
- nDefDist != nRightDist ||
- nDefDist != nTopDist ||
- nDefDist != nBottomDist);
- if((pBoxItem->GetDistance() ||
- bIsAnyBorderVisible) && bDiffDist )
- {
- aLeftMF.SetModifyFlag();
- aRightMF.SetModifyFlag();
- aTopMF.SetModifyFlag();
- aBottomMF.SetModifyFlag();
- }
- }
- else
- {
- // #106224# different margins -> do not fill the edits
- aLeftMF.SetText( String() );
- aRightMF.SetText( String() );
- aTopMF.SetText( String() );
- aBottomMF.SetText( String() );
- }
- }
- aLeftMF.SaveValue();
- aRightMF.SaveValue();
- aTopMF.SaveValue();
- aBottomMF.SaveValue();
- }
- }
- }
- else
- {
- // ResetFrameLine-Aufrufe einsparen:
- aFrameSel.HideAllBorders();
- }
-
- //-------------------------------------------------------------
- // Linie/Linienfarbe in Controllern darstellen, wenn eindeutig:
- //-------------------------------------------------------------
- {
- // Do all visible lines show the same line widths?
- USHORT nPrim, nDist, nSecn;
- bool bWidthEq = aFrameSel.GetVisibleWidth( nPrim, nDist, nSecn );
- if( bWidthEq )
- aLbLineStyle.SelectEntry( nPrim * 100, nSecn * 100, nDist * 100 );
- else
- aLbLineStyle.SelectEntryPos( 1 );
-
- // Do all visible lines show the same line color?
- Color aColor;
- bool bColorEq = aFrameSel.GetVisibleColor( aColor );
- if( !bColorEq )
- aColor.SetColor( COL_BLACK );
-
- USHORT nSelPos = aLbLineColor.GetEntryPos( aColor );
- if( nSelPos == LISTBOX_ENTRY_NOTFOUND )
- nSelPos = aLbLineColor.InsertEntry( aColor, SVX_RESSTR( RID_SVXSTR_COLOR_USER ) );
-
- aLbLineColor.SelectEntryPos( nSelPos );
- aLbLineStyle.SetColor( aColor );
-
- // Select all visible lines, if they are all equal.
- if( bWidthEq && bColorEq )
- aFrameSel.SelectAllVisibleBorders();
-
- // set the current style and color (caches style in control even if nothing is selected)
- SelStyleHdl_Impl( &aLbLineStyle );
- SelColHdl_Impl( &aLbLineColor );
- }
-
- BOOL bEnable = aWndShadows.GetSelectItemId() > 1 ;
- aFtShadowSize.Enable(bEnable);
- aEdShadowSize.Enable(bEnable);
- aFtShadowColor.Enable(bEnable);
- aLbShadowColor.Enable(bEnable);
-
- aWndPresets.SetNoSelection();
-
- // - keine Line - sollte nicht selektiert sein
-
- if ( aLbLineStyle.GetSelectEntryPos() == 0 )
- {
- aLbLineStyle.SelectEntryPos( 1 );
- SelStyleHdl_Impl( &aLbLineStyle );
- }
-
- const SfxPoolItem* pItem;
- SfxObjectShell* pShell;
- if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, FALSE, &pItem) ||
- ( 0 != (pShell = SfxObjectShell::Current()) &&
- 0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
- {
- USHORT nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
- if(nHtmlMode & HTMLMODE_ON)
- {
- //Im Html-Mode gibt es keinen Schatten und nur komplette Umrandungen
- aFtShadowPos .Disable();
- aWndShadows .Disable();
- aFtShadowSize .Disable();
- aEdShadowSize .Disable();
- aFtShadowColor.Disable();
- aLbShadowColor.Disable();
- aFlShadow .Disable();
-
- USHORT nLBCount = aLbLineStyle.GetEntryCount();
- // ist es ein Absatzdialog, dann alle Linien fuer
- // Sw-Export, sonst ist die Page nicht da
- if(!(mbHorEnabled || mbVerEnabled)
- && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS) &&
- SFX_ITEM_AVAILABLE > rSet.GetItemState(GetWhich( SID_ATTR_PARA_LINESPACE )))
- {
- for( USHORT i = nLBCount - 1; i > LINESTYLE_HTML_MAX; --i)
- aLbLineStyle.RemoveEntry(i);
- }
-
- if( !(nSWMode & SW_BORDER_MODE_TABLE) )
- {
- aUserDefFT.Disable();
- aFrameSel.Disable();
- aWndPresets.RemoveItem(3);
- aWndPresets.RemoveItem(4);
- aWndPresets.RemoveItem(5);
- }
- }
- }
-
- LinesChanged_Impl( 0 );
-}
-
-// -----------------------------------------------------------------------
-
-int SvxBorderTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
-
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-#define IS_DONT_CARE(a) ((a).GetState() == svx::FRAMESTATE_DONTCARE )
-
-BOOL SvxBorderTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
-{
- bool bAttrsChanged = SfxTabPage::FillItemSet( rCoreAttrs );
-
- BOOL bPut = TRUE;
- USHORT nBoxWhich = GetWhich( SID_ATTR_BORDER_OUTER );
- USHORT nBoxInfoWhich = rCoreAttrs.GetPool()->GetWhich( SID_ATTR_BORDER_INNER, sal_False );
- const SfxItemSet& rOldSet = GetItemSet();
- SvxBoxItem aBoxItem ( nBoxWhich );
- SvxBoxInfoItem aBoxInfoItem ( nBoxInfoWhich );
- SvxBoxItem* pOldBoxItem = (SvxBoxItem*)GetOldItem( rCoreAttrs, SID_ATTR_BORDER_OUTER );
-
- SfxMapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich );
- const SfxPoolItem* pOld = 0;
-
- //------------------
- // Umrandung aussen:
- //------------------
- typedef ::std::pair<svx::FrameBorderType,USHORT> TBorderPair;
- TBorderPair eTypes1[] = {
- TBorderPair(svx::FRAMEBORDER_TOP,BOX_LINE_TOP),
- TBorderPair(svx::FRAMEBORDER_BOTTOM,BOX_LINE_BOTTOM),
- TBorderPair(svx::FRAMEBORDER_LEFT,BOX_LINE_LEFT),
- TBorderPair(svx::FRAMEBORDER_RIGHT,BOX_LINE_RIGHT),
- };
-
- for (sal_uInt32 i=0; i < sizeof(eTypes1)/sizeof(TBorderPair); ++i)
- aBoxItem.SetLine( aFrameSel.GetFrameBorderStyle( eTypes1[i].first ), eTypes1[i].second );
-
- //--------------------------------
- // Umrandung hor/ver und TableFlag
- //--------------------------------
- TBorderPair eTypes2[] = {
- TBorderPair(svx::FRAMEBORDER_HOR,BOXINFO_LINE_HORI),
- TBorderPair(svx::FRAMEBORDER_VER,BOXINFO_LINE_VERT)
- };
- for (sal_uInt32 j=0; j < sizeof(eTypes2)/sizeof(TBorderPair); ++j)
- aBoxInfoItem.SetLine( aFrameSel.GetFrameBorderStyle( eTypes2[j].first ), eTypes2[j].second );
-
- aBoxInfoItem.EnableHor( mbHorEnabled );
- aBoxInfoItem.EnableVer( mbVerEnabled );
-
- //-------------------
- // Abstand nach Innen
- //-------------------
- if( aLeftMF.IsVisible() )
- {
- // #i40405# enable distance controls for next dialog call
- aBoxInfoItem.SetDist( TRUE );
-
- if( !mbUseMarginItem )
- {
- // #106224# all edits empty: do nothing
- if( aLeftMF.GetText().Len() || aRightMF.GetText().Len() ||
- aTopMF.GetText().Len() || aBottomMF.GetText().Len() )
- {
- if ( ((mbHorEnabled || mbVerEnabled || (nSWMode & SW_BORDER_MODE_TABLE)) &&
- (aLeftMF.IsModified()||aRightMF.IsModified()||
- aTopMF.IsModified()||aBottomMF.IsModified()) )||
- aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_TOP ) != svx::FRAMESTATE_HIDE
- || aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_BOTTOM ) != svx::FRAMESTATE_HIDE
- || aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FRAMESTATE_HIDE
- || aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FRAMESTATE_HIDE )
- {
- SvxBoxInfoItem* pOldBoxInfoItem = (SvxBoxInfoItem*)GetOldItem(
- rCoreAttrs, SID_ATTR_BORDER_INNER );
- if (
- !pOldBoxItem ||
- aLeftMF .GetText() != aLeftMF .GetSavedValue() ||
- aRightMF .GetText() != aRightMF .GetSavedValue() ||
- aTopMF .GetText() != aTopMF .GetSavedValue() ||
- aBottomMF.GetText() != aBottomMF.GetSavedValue() ||
- nMinValue == aLeftMF .GetValue() ||
- nMinValue == aRightMF .GetValue() ||
- nMinValue == aTopMF .GetValue() ||
- nMinValue == aBottomMF.GetValue() ||
- (pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(VALID_DISTANCE))
- )
- {
- aBoxItem.SetDistance( (USHORT)GetCoreValue( aLeftMF, eCoreUnit ), BOX_LINE_LEFT );
- aBoxItem.SetDistance( (USHORT)GetCoreValue( aRightMF, eCoreUnit ), BOX_LINE_RIGHT );
- aBoxItem.SetDistance( (USHORT)GetCoreValue( aTopMF, eCoreUnit ), BOX_LINE_TOP );
- aBoxItem.SetDistance( (USHORT)GetCoreValue( aBottomMF, eCoreUnit ), BOX_LINE_BOTTOM);
- }
- else
- {
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_LEFT ), BOX_LINE_LEFT);
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_RIGHT), BOX_LINE_RIGHT);
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_TOP ), BOX_LINE_TOP);
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_BOTTOM), BOX_LINE_BOTTOM);
- }
- aBoxInfoItem.SetValid( VALID_DISTANCE, TRUE );
- }
- else
- aBoxInfoItem.SetValid( VALID_DISTANCE, FALSE );
- }
- }
- }
-
- //------------------------------------------
- // Don't Care Status im Info-Item vermerken:
- //------------------------------------------
- aBoxInfoItem.SetValid( VALID_TOP, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_TOP ) != svx::FRAMESTATE_DONTCARE );
- aBoxInfoItem.SetValid( VALID_BOTTOM, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_BOTTOM ) != svx::FRAMESTATE_DONTCARE );
- aBoxInfoItem.SetValid( VALID_LEFT, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FRAMESTATE_DONTCARE );
- aBoxInfoItem.SetValid( VALID_RIGHT, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FRAMESTATE_DONTCARE );
- aBoxInfoItem.SetValid( VALID_HORI, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_HOR ) != svx::FRAMESTATE_DONTCARE );
- aBoxInfoItem.SetValid( VALID_VERT, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_VER ) != svx::FRAMESTATE_DONTCARE );
-
- //
- // Put oder Clear der Umrandung?
- //
- bPut = TRUE;
-
- if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nBoxWhich, FALSE ))
- {
- bPut = aBoxItem != (const SvxBoxItem&)(rOldSet.Get(nBoxWhich)) ? sal_True : sal_False;
- }
- if( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nBoxInfoWhich, FALSE ) )
- {
- const SvxBoxInfoItem& rOldBoxInfo = (const SvxBoxInfoItem&)
- rOldSet.Get(nBoxInfoWhich);
-
- aBoxInfoItem.SetMinDist( rOldBoxInfo.IsMinDist() );
- aBoxInfoItem.SetDefDist( rOldBoxInfo.GetDefDist() );
- bPut |= (aBoxInfoItem != rOldBoxInfo );
- }
-
- if ( bPut )
- {
- if ( !pOldBoxItem || !( *pOldBoxItem == aBoxItem ) )
- {
- rCoreAttrs.Put( aBoxItem );
- bAttrsChanged |= TRUE;
- }
- pOld = GetOldItem( rCoreAttrs, SID_ATTR_BORDER_INNER, sal_False );
-
- if ( !pOld || !( *(const SvxBoxInfoItem*)pOld == aBoxInfoItem ) )
- {
- rCoreAttrs.Put( aBoxInfoItem );
- bAttrsChanged |= TRUE;
- }
- }
- else
- {
- rCoreAttrs.ClearItem( nBoxWhich );
- rCoreAttrs.ClearItem( nBoxInfoWhich );
- }
-
- return bAttrsChanged;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBorderTabPage::HideShadowControls()
-{
- aFtShadowPos.Hide();
- aWndShadows.Hide();
- aFtShadowSize.Hide();
- aEdShadowSize.Hide();
- aFtShadowColor.Hide();
- aLbShadowColor.Hide();
- aFlShadow.Hide();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBorderTabPage, SelPreHdl_Impl, void *, EMPTYARG )
-{
- const svx::FrameBorderState SHOW = svx::FRAMESTATE_SHOW;
- const svx::FrameBorderState HIDE = svx::FRAMESTATE_HIDE;
- const svx::FrameBorderState DONT = svx::FRAMESTATE_DONTCARE;
-
- static const svx::FrameBorderState ppeStates[][ svx::FRAMEBORDERTYPE_COUNT ] =
- { /* Left Right Top Bot Hor Ver TLBR BLTR */
-/* ---------------------+--------------------------------------------------- */
-/* IID_PRE_CELL_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_CELL_ALL */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_CELL_LR */ { SHOW, SHOW, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_CELL_TB */ { HIDE, HIDE, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_CELL_L */ { SHOW, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_CELL_DIAG */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, SHOW, SHOW },
-/* IID_PRE_HOR_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_HOR_OUTER */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_HOR_HOR */ { HIDE, HIDE, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE },
-/* IID_PRE_HOR_ALL */ { SHOW, SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE },
-/* IID_PRE_HOR_OUTER2 */ { SHOW, SHOW, SHOW, SHOW, DONT, HIDE, HIDE, HIDE },
-/* IID_PRE_VER_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_VER_OUTER */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_VER_VER */ { SHOW, SHOW, HIDE, HIDE, HIDE, SHOW, HIDE, HIDE },
-/* IID_PRE_VER_ALL */ { SHOW, SHOW, SHOW, SHOW, HIDE, SHOW, HIDE, HIDE },
-/* IID_PRE_VER_OUTER2 */ { SHOW, SHOW, SHOW, SHOW, HIDE, DONT, HIDE, HIDE },
-/* IID_PRE_TABLE_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_TABLE_OUTER */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE },
-/* IID_PRE_TABLE_OUTERH */ { SHOW, SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE },
-/* IID_PRE_TABLE_ALL */ { SHOW, SHOW, SHOW, SHOW, SHOW, SHOW, HIDE, HIDE },
-/* IID_PRE_TABLE_OUTER2 */ { SHOW, SHOW, SHOW, SHOW, DONT, DONT, HIDE, HIDE }
- };
-
- // first hide and deselect all frame borders
- aFrameSel.HideAllBorders();
- aFrameSel.DeselectAllBorders();
-
- // Using image ID to find correct line in table above.
- USHORT nLine = GetPresetImageId( aWndPresets.GetSelectItemId() ) - 1;
-
- // Apply all styles from the table
- for( int nBorder = 0; nBorder < svx::FRAMEBORDERTYPE_COUNT; ++nBorder )
- {
- svx::FrameBorderType eBorder = svx::GetFrameBorderTypeFromIndex( nBorder );
- switch( ppeStates[ nLine ][ nBorder ] )
- {
- case SHOW: aFrameSel.SelectBorder( eBorder ); break;
- case HIDE: /* nothing to do */ break;
- case DONT: aFrameSel.SetBorderDontCare( eBorder ); break;
- }
- }
-
- // Show all lines that have been selected above
- if( aFrameSel.IsAnyBorderSelected() )
- {
- // any visible style, but "no-line" in line list box? -> use hair-line
- if( (aLbLineStyle.GetSelectEntryPos() == 0) || (aLbLineStyle.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND) )
- aLbLineStyle.SelectEntryPos( 1 );
-
- // set current style to all previously selected lines
- SelStyleHdl_Impl( &aLbLineStyle );
- SelColHdl_Impl( &aLbLineColor );
- }
-
- // Presets ValueSet does not show a selection (used as push buttons).
- aWndPresets.SetNoSelection();
-
- LinesChanged_Impl( 0 );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBorderTabPage, SelSdwHdl_Impl, void *, EMPTYARG )
-{
- BOOL bEnable = aWndShadows.GetSelectItemId() > 1;
- aFtShadowSize.Enable(bEnable);
- aEdShadowSize.Enable(bEnable);
- aFtShadowColor.Enable(bEnable);
- aLbShadowColor.Enable(bEnable);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb )
-{
- ColorListBox* pColLb = (ColorListBox*)pLb;
-
- if ( pLb == &aLbLineColor )
- {
- aFrameSel.SetColorToSelection( pColLb->GetSelectEntryColor() );
- aLbLineStyle.SetColor( pColLb->GetSelectEntryColor() );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb )
-{
- if ( pLb == &aLbLineStyle )
- aFrameSel.SetStyleToSelection(
- static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine1() / 100 ),
- static_cast< USHORT >( aLbLineStyle.GetSelectEntryDistance() / 100 ),
- static_cast< USHORT >( aLbLineStyle.GetSelectEntryLine2() / 100 ) );
-
- return 0;
-}
-
-// ============================================================================
-// ValueSet handling
-// ============================================================================
-
-// number of preset images to show
-const USHORT SVX_BORDER_PRESET_COUNT = 5;
-
-// number of shadow images to show
-const USHORT SVX_BORDER_SHADOW_COUNT = 5;
-
-// ----------------------------------------------------------------------------
-
-USHORT SvxBorderTabPage::GetPresetImageId( USHORT nValueSetIdx ) const
-{
- // table with all sets of predefined border styles
- static const USHORT ppnImgIds[][ SVX_BORDER_PRESET_COUNT ] =
- {
- // simple cell without diagonal frame borders
- { IID_PRE_CELL_NONE, IID_PRE_CELL_ALL, IID_PRE_CELL_LR, IID_PRE_CELL_TB, IID_PRE_CELL_L },
- // simple cell with diagonal frame borders
- { IID_PRE_CELL_NONE, IID_PRE_CELL_ALL, IID_PRE_CELL_LR, IID_PRE_CELL_TB, IID_PRE_CELL_DIAG },
- // with horizontal inner frame border
- { IID_PRE_HOR_NONE, IID_PRE_HOR_OUTER, IID_PRE_HOR_HOR, IID_PRE_HOR_ALL, IID_PRE_HOR_OUTER2 },
- // with vertical inner frame border
- { IID_PRE_VER_NONE, IID_PRE_VER_OUTER, IID_PRE_VER_VER, IID_PRE_VER_ALL, IID_PRE_VER_OUTER2 },
- // with horizontal and vertical inner frame borders
- { IID_PRE_TABLE_NONE, IID_PRE_TABLE_OUTER, IID_PRE_TABLE_OUTERH, IID_PRE_TABLE_ALL, IID_PRE_TABLE_OUTER2 }
- };
-
- // find correct set of presets
- int nLine = 0;
- if( !mbHorEnabled && !mbVerEnabled )
- nLine = (mbTLBREnabled || mbBLTREnabled) ? 1 : 0;
- else if( mbHorEnabled && !mbVerEnabled )
- nLine = 2;
- else if( !mbHorEnabled && mbVerEnabled )
- nLine = 3;
- else
- nLine = 4;
-
- DBG_ASSERT( (1 <= nValueSetIdx) && (nValueSetIdx <= SVX_BORDER_PRESET_COUNT),
- "SvxBorderTabPage::GetPresetImageId - wrong index" );
- return ppnImgIds[ nLine ][ nValueSetIdx - 1 ];
-}
-
-USHORT SvxBorderTabPage::GetPresetStringId( USHORT nValueSetIdx ) const
-{
- // string resource IDs for each image (in order of the IID_PRE_* image IDs)
- static const USHORT pnStrIds[] =
- {
- RID_SVXSTR_TABLE_PRESET_NONE,
- RID_SVXSTR_PARA_PRESET_ALL,
- RID_SVXSTR_PARA_PRESET_LEFTRIGHT,
- RID_SVXSTR_PARA_PRESET_TOPBOTTOM,
- RID_SVXSTR_PARA_PRESET_ONLYLEFT,
- RID_SVXSTR_PARA_PRESET_DIAGONAL,
-
- RID_SVXSTR_TABLE_PRESET_NONE,
- RID_SVXSTR_TABLE_PRESET_ONLYOUTER,
- RID_SVXSTR_HOR_PRESET_ONLYHOR,
- RID_SVXSTR_TABLE_PRESET_OUTERALL,
- RID_SVXSTR_TABLE_PRESET_OUTERINNER,
-
- RID_SVXSTR_TABLE_PRESET_NONE,
- RID_SVXSTR_TABLE_PRESET_ONLYOUTER,
- RID_SVXSTR_VER_PRESET_ONLYVER,
- RID_SVXSTR_TABLE_PRESET_OUTERALL,
- RID_SVXSTR_TABLE_PRESET_OUTERINNER,
-
- RID_SVXSTR_TABLE_PRESET_NONE,
- RID_SVXSTR_TABLE_PRESET_ONLYOUTER,
- RID_SVXSTR_TABLE_PRESET_OUTERHORI,
- RID_SVXSTR_TABLE_PRESET_OUTERALL,
- RID_SVXSTR_TABLE_PRESET_OUTERINNER
- };
- return pnStrIds[ GetPresetImageId( nValueSetIdx ) - 1 ];
-}
-
-// ----------------------------------------------------------------------------
-
-void SvxBorderTabPage::FillPresetVS()
-{
- // find correct image list
- bool bHC = aWndPresets.GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList& rImgList = bHC ? aBorderImgLstH : aBorderImgLst;
- Size aImgSize( rImgList.GetImage( IID_PRE_CELL_NONE ).GetSizePixel() );
-
- // basic initialization of the ValueSet
- aWndPresets.SetColCount( SVX_BORDER_PRESET_COUNT );
- aWndPresets.SetStyle( aWndPresets.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
- aWndPresets.SetSizePixel( aWndPresets.CalcWindowSizePixel( aImgSize ) );
-
- // insert images and help texts
- for( USHORT nVSIdx = 1; nVSIdx <= SVX_BORDER_PRESET_COUNT; ++nVSIdx )
- {
- aWndPresets.InsertItem( nVSIdx );
- aWndPresets.SetItemImage( nVSIdx, rImgList.GetImage( GetPresetImageId( nVSIdx ) ) );
- aWndPresets.SetItemText( nVSIdx, SVX_RESSTR( GetPresetStringId( nVSIdx ) ) );
- }
-
- // show the control
- aWndPresets.SetNoSelection();
- aWndPresets.Show();
-}
-
-// ----------------------------------------------------------------------------
-
-void SvxBorderTabPage::FillShadowVS()
-{
- // find correct image list
- bool bHC = aWndPresets.GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList& rImgList = bHC ? aShadowImgLstH : aShadowImgLst;
- Size aImgSize( rImgList.GetImage( IID_SHADOWNONE ).GetSizePixel() );
-
- // basic initialization of the ValueSet
- aWndShadows.SetColCount( SVX_BORDER_SHADOW_COUNT );
- aWndShadows.SetStyle( aWndShadows.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
- aWndShadows.SetSizePixel( aWndShadows.CalcWindowSizePixel( aImgSize ) );
-
- // image resource IDs
- static const USHORT pnImgIds[ SVX_BORDER_SHADOW_COUNT ] =
- { IID_SHADOWNONE, IID_SHADOW_BOT_RIGHT, IID_SHADOW_TOP_RIGHT, IID_SHADOW_BOT_LEFT, IID_SHADOW_TOP_LEFT };
- // string resource IDs for each image
- static const USHORT pnStrIds[ SVX_BORDER_SHADOW_COUNT ] =
- { RID_SVXSTR_SHADOW_STYLE_NONE, RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT, RID_SVXSTR_SHADOW_STYLE_TOPRIGHT, RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT, RID_SVXSTR_SHADOW_STYLE_TOPLEFT };
-
- // insert images and help texts
- for( USHORT nVSIdx = 1; nVSIdx <= SVX_BORDER_SHADOW_COUNT; ++nVSIdx )
- {
- aWndShadows.InsertItem( nVSIdx );
- aWndShadows.SetItemImage( nVSIdx, rImgList.GetImage( pnImgIds[ nVSIdx - 1 ] ) );
- aWndShadows.SetItemText( nVSIdx, SVX_RESSTR( pnStrIds[ nVSIdx - 1 ] ) );
- }
-
- // show the control
- aWndShadows.SelectItem( 1 );
- aWndShadows.Show();
-}
-
-// ----------------------------------------------------------------------------
-
-void SvxBorderTabPage::FillValueSets()
-{
- FillPresetVS();
- FillShadowVS();
-}
-
-// ============================================================================
-
-void SvxBorderTabPage::FillLineListBox_Impl()
-{
- aLbLineStyle.SetUnit( FUNIT_POINT );
- aLbLineStyle.SetSourceUnit( FUNIT_TWIP );
-
- // Writer 2.0 Defaults:
- aLbLineStyle.InsertEntry( SVX_RESSTR( STR_NONE ) );
-
- aLbLineStyle.InsertEntry( LINE_WIDTH0 );
- aLbLineStyle.InsertEntry( LINE_WIDTH5 );
- aLbLineStyle.InsertEntry( LINE_WIDTH1 );
- aLbLineStyle.InsertEntry( LINE_WIDTH2 );
- aLbLineStyle.InsertEntry( LINE_WIDTH3 );
- aLbLineStyle.InsertEntry( LINE_WIDTH4 );
-
- // OS: wenn hier neue Linienstaerken zugfuegt werden, dann
- // LINESTYLE_HTML_MAX anpassen
-
- aLbLineStyle.InsertEntry( DLINE0_OUT, DLINE0_IN, DLINE0_DIST );
- aLbLineStyle.InsertEntry( DLINE7_OUT, DLINE7_IN, DLINE7_DIST );
- aLbLineStyle.InsertEntry( DLINE1_OUT, DLINE1_IN, DLINE1_DIST );
- aLbLineStyle.InsertEntry( DLINE2_OUT, DLINE2_IN, DLINE2_DIST );
- aLbLineStyle.InsertEntry( DLINE8_OUT, DLINE8_IN, DLINE8_DIST );
- aLbLineStyle.InsertEntry( DLINE9_OUT, DLINE9_IN, DLINE9_DIST );
- aLbLineStyle.InsertEntry( DLINE10_OUT,DLINE10_IN,DLINE10_DIST);
- aLbLineStyle.InsertEntry( DLINE3_OUT, DLINE3_IN, DLINE3_DIST );
- aLbLineStyle.InsertEntry( DLINE4_OUT, DLINE4_IN, DLINE4_DIST );
- aLbLineStyle.InsertEntry( DLINE5_OUT, DLINE5_IN, DLINE5_DIST );
- aLbLineStyle.InsertEntry( DLINE6_OUT, DLINE6_IN, DLINE6_DIST );
-}
-
-// -----------------------------------------------------------------------
-IMPL_LINK( SvxBorderTabPage, LinesChanged_Impl, void*, EMPTYARG )
-{
- if(!mbUseMarginItem && aLeftMF.IsVisible())
- {
- BOOL bLineSet = aFrameSel.IsAnyBorderVisible();
- BOOL bMinAllowed = 0 != (nSWMode & (SW_BORDER_MODE_FRAME|SW_BORDER_MODE_TABLE));
- BOOL bSpaceModified = aLeftMF .IsModified()||
- aRightMF .IsModified()||
- aTopMF .IsModified()||
- aBottomMF.IsModified();
-
- if(bLineSet)
- {
- if(!bMinAllowed)
- {
- aLeftMF .SetFirst(nMinValue);
- aRightMF .SetFirst(nMinValue);
- aTopMF .SetFirst(nMinValue);
- aBottomMF.SetFirst(nMinValue);
- }
- if(!bSpaceModified)
- {
- aLeftMF .SetValue(nMinValue);
- aRightMF .SetValue(nMinValue);
- aTopMF .SetValue(nMinValue);
- aBottomMF.SetValue(nMinValue);
- }
- }
- else
- {
- aLeftMF .SetMin(0);
- aRightMF .SetMin(0);
- aTopMF .SetMin(0);
- aBottomMF.SetMin(0);
- aLeftMF .SetFirst(0);
- aRightMF .SetFirst(0);
- aTopMF .SetFirst(0);
- aBottomMF.SetFirst(0);
- if(!bSpaceModified)
- {
- aLeftMF .SetValue(0);
- aRightMF .SetValue(0);
- aTopMF .SetValue(0);
- aBottomMF.SetValue(0);
- }
- }
- //fuer Tabellen ist alles erlaubt
- USHORT nValid = VALID_TOP|VALID_BOTTOM|VALID_LEFT|VALID_RIGHT;
-
- //fuer Rahmen und Absatz wird das Edit disabled, wenn keine Border gesetzt ist
- if(nSWMode & (SW_BORDER_MODE_FRAME|SW_BORDER_MODE_PARA))
- {
- if(bLineSet)
- {
- nValid = (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_TOP) == svx::FRAMESTATE_SHOW) ? VALID_TOP : 0;
- nValid |= (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_BOTTOM) == svx::FRAMESTATE_SHOW) ? VALID_BOTTOM : 0;
- nValid |= (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_LEFT) == svx::FRAMESTATE_SHOW) ? VALID_LEFT : 0;
- nValid |= (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) == svx::FRAMESTATE_SHOW) ? VALID_RIGHT : 0;
- }
- else
- nValid = 0;
- }
- aLeftFT.Enable(0 != (nValid&VALID_LEFT));
- aRightFT.Enable(0 != (nValid&VALID_RIGHT));
- aTopFT.Enable(0 != (nValid&VALID_TOP));
- aBottomFT.Enable(0 != (nValid&VALID_BOTTOM));
- aLeftMF.Enable(0 != (nValid&VALID_LEFT));
- aRightMF.Enable(0 != (nValid&VALID_RIGHT));
- aTopMF.Enable(0 != (nValid&VALID_TOP));
- aBottomMF.Enable(0 != (nValid&VALID_BOTTOM));
- aSynchronizeCB.Enable( aRightMF.IsEnabled() || aTopMF.IsEnabled() ||
- aBottomMF.IsEnabled() || aLeftMF.IsEnabled() );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBorderTabPage, ModifyDistanceHdl_Impl, MetricField*, pField)
-{
- if ( bSync )
- {
- sal_Int64 nVal = pField->GetValue();
- if(pField != &aLeftMF)
- aLeftMF.SetValue(nVal);
- if(pField != &aRightMF)
- aRightMF.SetValue(nVal);
- if(pField != &aTopMF)
- aTopMF.SetValue(nVal);
- if(pField != &aBottomMF)
- aBottomMF.SetValue(nVal);
- }
- return 0;
-}
-
-IMPL_LINK( SvxBorderTabPage, SyncHdl_Impl, CheckBox*, pBox)
-{
- bSync = pBox->IsChecked();
- return 0;
-}
-
-/* -----------------------------03.06.2002 10:15------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxBorderTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- FillValueSets();
-
- SfxTabPage::DataChanged( rDCEvt );
-}
-
-void SvxBorderTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pSWModeItem,SfxUInt16Item,SID_SWMODE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- if (pSWModeItem)
- {
- nSWMode = pSWModeItem->GetValue();
- // --> OD 2005-03-01 #i43593#
- // show checkbox <aMergeWithNextCB> for format.paragraph
- if ( nSWMode == SW_BORDER_MODE_PARA )
- {
- aMergeWithNextCB.Show();
- aPropertiesFL.Show();
- }
- // show checkbox <aMergeAdjacentBordersCB> for format.paragraph
- else if ( nSWMode == SW_BORDER_MODE_TABLE )
- {
- aMergeAdjacentBordersCB.Show();
- aPropertiesFL.Show();
- }
- // <--
- }
- if (pFlagItem)
- if ( ( pFlagItem->GetValue() & SVX_HIDESHADOWCTL ) == SVX_HIDESHADOWCTL )
- HideShadowControls();
-}
-
-// ============================================================================
-
diff --git a/svx/source/cui/border.hrc b/svx/source/cui/border.hrc
deleted file mode 100644
index b0c7e8a4f5..0000000000
--- a/svx/source/cui/border.hrc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: border.hrc,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_BORDER_HRC
-#define _SVX_BORDER_HRC
-
-// defines ------------------------------------------------------------------
-
-#define FL_BORDER 10
-#define WIN_PRESETS 11
-#define WIN_FRAMESEL 12
-
-#define FL_SEPARATOR1 19
-#define FL_LINE 20
-#define LB_LINESTYLE 21
-#define LB_LINECOLOR 22
-
-#define FL_SEPARATOR2 29
-#define FL_SHADOW 30
-#define FT_SHADOWPOS 31
-#define WIN_SHADOWS 32
-#define FT_SHADOWSIZE 33
-#define ED_SHADOWSIZE 34
-#define FT_SHADOWCOLOR 35
-#define LB_SHADOWCOLOR 36
-
-#define FT_XSPACE 41
-#define ED_XSPACE 42
-
-#define FL_DISTANCE 50
-#define FT_LEFT 51
-#define MF_LEFT 52
-#define FT_RIGHT 53
-#define MF_RIGHT 54
-#define FT_TOP 55
-#define MF_TOP 56
-#define FT_BOTTOM 57
-#define MF_BOTTOM 58
-#define CB_SYNC 59
-#define FT_DEFAULT 60
-#define FT_USERDEF 61
-#define FT_STYLE 62
-#define FT_COLOR 63
-#define FL_PROPERTIES 64
-#define CB_MERGEWITHNEXT 65
-#define CB_MERGEADJACENTBORDERS 66
-
-// ImageListe fuer ValueSets:
-#define IL_PRE_BITMAPS 1400
-#define ILH_PRE_BITMAPS 1401
-#define IID_PRE_CELL_NONE 1
-#define IID_PRE_CELL_ALL 2
-#define IID_PRE_CELL_LR 3
-#define IID_PRE_CELL_TB 4
-#define IID_PRE_CELL_L 5
-#define IID_PRE_CELL_DIAG 6
-#define IID_PRE_HOR_NONE 7
-#define IID_PRE_HOR_OUTER 8
-#define IID_PRE_HOR_HOR 9
-#define IID_PRE_HOR_ALL 10
-#define IID_PRE_HOR_OUTER2 11
-#define IID_PRE_VER_NONE 12
-#define IID_PRE_VER_OUTER 13
-#define IID_PRE_VER_VER 14
-#define IID_PRE_VER_ALL 15
-#define IID_PRE_VER_OUTER2 16
-#define IID_PRE_TABLE_NONE 17
-#define IID_PRE_TABLE_OUTER 18
-#define IID_PRE_TABLE_OUTERH 19
-#define IID_PRE_TABLE_ALL 20
-#define IID_PRE_TABLE_OUTER2 21
-
-#define IL_SDW_BITMAPS 1500
-#define ILH_SDW_BITMAPS 1501
-#define IID_SHADOWNONE 1
-#define IID_SHADOW_BOT_RIGHT 2
-#define IID_SHADOW_BOT_LEFT 3
-#define IID_SHADOW_TOP_RIGHT 4
-#define IID_SHADOW_TOP_LEFT 5
-
-
-#endif
-
diff --git a/svx/source/cui/border.hxx b/svx/source/cui/border.hxx
deleted file mode 100644
index 3ac644685d..0000000000
--- a/svx/source/cui/border.hxx
+++ /dev/null
@@ -1,179 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: border.hxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_BORDER_HXX
-#define _SVX_BORDER_HXX
-
-// include ---------------------------------------------------------------
-
-
-#include <svtools/ctrlbox.hxx>
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#include <svtools/valueset.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/frmsel.hxx>
-// forward ---------------------------------------------------------------
-
-class SvxBorderLine;
-class XColorTable;
-
-// class SvxBorderTabPage ------------------------------------------------
-/*
-{k:\svx\prototyp\dialog\border.bmp}
-[Beschreibung]
-TabPage zur Einstellung der Umrandung (Staerke, Farbe, Schatten, ...)
-[Items]
-<SvxBoxItem><SID_ATTR_BORDER_OUTER>
-<SvxBoxInfoItem><SID_ATTR_BORDER_INNER>
-<SvxShadowItem><SID_ATTR_BORDER_SHADOW>
-*/
-
-// Border-Modes for paragraphs, textframes and tables
-//CHINA001 #define SW_BORDER_MODE_PARA 0x01
-//CHINA001 #define SW_BORDER_MODE_TABLE 0x02
-//CHINA001 #define SW_BORDER_MODE_FRAME 0x04
-#include "flagsdef.hxx"//CHINA001
-
-class SvxBorderTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
-public:
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rCoreAttrs );
- virtual void Reset( const SfxItemSet& );
-
- void HideShadowControls();
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-private:
- SvxBorderTabPage( Window* pParent, const SfxItemSet& rCoreAttrs );
- ~SvxBorderTabPage();
-
- // Controls
- FixedLine aFlBorder;
- FixedText aDefaultFT;
- ValueSet aWndPresets;
- FixedText aUserDefFT;
- svx::FrameSelector aFrameSel;
-
- FixedLine aFlSep1;
- FixedLine aFlLine;
- FixedText aStyleFT;
- LineListBox aLbLineStyle;
- FixedText aColorFT;
- ColorListBox aLbLineColor;
-
- FixedLine aFlSep2;
- FixedLine aDistanceFL;
- FixedText aLeftFT;
- MetricField aLeftMF;
- FixedText aRightFT;
- MetricField aRightMF;
- FixedText aTopFT;
- MetricField aTopMF;
- FixedText aBottomFT;
- MetricField aBottomMF;
- CheckBox aSynchronizeCB;
-
- FixedLine aFlShadow;
- FixedText aFtShadowPos;
- ValueSet aWndShadows;
- FixedText aFtShadowSize;
- MetricField aEdShadowSize;
- FixedText aFtShadowColor;
- ColorListBox aLbShadowColor;
-
- //properties - "Merge with next paragraph" in Writer
- FixedLine aPropertiesFL;
- CheckBox aMergeWithNextCB;
- // --> collapsing table borders FME 2005-05-27 #i29550#
- CheckBox aMergeAdjacentBordersCB;
- // <--
-
- ImageList aShadowImgLstH;
- ImageList aShadowImgLst;
- ImageList aBorderImgLstH;
- ImageList aBorderImgLst;
-
- long nMinValue; // minimum distance
- int nSWMode; // table, textframe, paragraph
-
- bool mbHorEnabled; /// true = Inner horizontal border enabled.
- bool mbVerEnabled; /// true = Inner vertical border enabled.
- bool mbTLBREnabled; /// true = Top-left to bottom-right border enabled.
- bool mbBLTREnabled; /// true = Bottom-left to top-right border enabled.
- bool mbUseMarginItem;
-
- static BOOL bSync;
-
-#ifdef _SVX_BORDER_CXX
- // Handler
- DECL_LINK( SelStyleHdl_Impl, ListBox* pLb );
- DECL_LINK( SelColHdl_Impl, ListBox* pLb );
- DECL_LINK( SelPreHdl_Impl, void* );
- DECL_LINK( SelSdwHdl_Impl, void* );
- DECL_LINK( LinesChanged_Impl, void* );
- DECL_LINK( ModifyDistanceHdl_Impl, MetricField*);
- DECL_LINK( SyncHdl_Impl, CheckBox*);
-
- USHORT GetPresetImageId( USHORT nValueSetIdx ) const;
- USHORT GetPresetStringId( USHORT nValueSetIdx ) const;
-
- void FillPresetVS();
- void FillShadowVS();
- void FillValueSets();
-
- // Filler
- void FillLineListBox_Impl();
-
- // Setzen von einzelnen Frame-/Core-Linien
- void ResetFrameLine_Impl( svx::FrameBorderType eBorder,
- const SvxBorderLine* pCurLine,
- bool bValid );
-#endif
-};
-
-
-#endif
-
diff --git a/svx/source/cui/border.src b/svx/source/cui/border.src
deleted file mode 100644
index dbbb81bc0f..0000000000
--- a/svx/source/cui/border.src
+++ /dev/null
@@ -1,431 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: border.src,v $
- * $Revision: 1.64 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "border.hrc"
- // pragma ----------------------------------------------------------------
-
- // define ---------------------------------------------------------------
-#define STD_MASKCOLOR Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; }
- // RID_SVXPAGE_BORDER ---------------------------------------------------
-TabPage RID_SVXPAGE_BORDER
-{
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Helpid = HID_BORDER ;
- Hide = TRUE ;
- Text [ en-US ] = "Borders" ;
- FixedLine FL_BORDER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "Line arrangement" ;
- };
- FixedText FT_DEFAULT
- {
- Pos = MAP_APPFONT ( 12, 14) ;
- Size = MAP_APPFONT ( 64, 8) ;
- Text [ en-US ] = "~Default";
- };
- Control WIN_PRESETS
- {
- HelpId = HID_BORDER_CTL_PRESETS ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 61 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_USERDEF
- {
- Pos = MAP_APPFONT (12 , 41) ;
- Size = MAP_APPFONT ( 64, 8) ;
- Text [ en-US ] = "~User-defined";
- };
- Control WIN_FRAMESEL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 61 , 65 ) ;
- TabStop = TRUE ;
- Text = "Border control";
- };
- FixedLine FL_SEPARATOR1
- {
- Pos = MAP_APPFONT ( 77 , 14 ) ;
- Size = MAP_APPFONT ( 4 , 104 ) ;
- Vert = TRUE ;
- };
- FixedLine FL_LINE
- {
- Pos = MAP_APPFONT ( 82 , 3 ) ;
- Size = MAP_APPFONT ( 83 , 8 ) ;
- Text [ en-US ] = "Line" ;
- };
- FixedText FT_STYLE
- {
- Pos = MAP_APPFONT ( 88, 14) ;
- Size = MAP_APPFONT ( 77, 8) ;
- Text [ en-US ] = "St~yle";
- };
- ListBox LB_LINESTYLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 88 , 25 ) ;
- Size = MAP_APPFONT ( 74 , 66 ) ;
- };
- FixedText FT_COLOR
- {
- Pos = MAP_APPFONT ( 88, 95 ) ;
- Size = MAP_APPFONT ( 77, 8 ) ;
- Text [ en-US ] = "~Color";
- };
- ListBox LB_LINECOLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 88 , 106 ) ;
- Size = MAP_APPFONT ( 74 , 68 ) ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedLine FL_SEPARATOR2
- {
- Pos = MAP_APPFONT ( 166 , 14 ) ;
- Size = MAP_APPFONT ( 4 , 104 ) ;
- Vert = TRUE ;
- };
- FixedText FT_LEFT
- {
- Pos = MAP_APPFONT ( 177 , 16 ) ;
- Size = MAP_APPFONT ( 34 , 8 ) ;
- Text [ en-US ] = "~Left";
- };
- MetricField MF_LEFT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 213 , 14 ) ;
- Size = MAP_APPFONT ( 38 , 12 ) ;
- Spin = TRUE ;
- Repeat = TRUE ;
- SpinSize = 10 ;
- First = 100 ;
- Last = 5000 ;
- Maximum = 5000 ;
- Minimum = 0 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- };
- FixedText FT_RIGHT
- {
- Pos = MAP_APPFONT ( 177 , 32 ) ;
- Size = MAP_APPFONT ( 34 , 8 ) ;
- Text [ en-US ] = "Right";
- };
- MetricField MF_RIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 213 , 30 ) ;
- Size = MAP_APPFONT ( 38 , 12 ) ;
- Spin = TRUE ;
- Repeat = TRUE ;
- SpinSize = 10 ;
- First = 100 ;
- Last = 5000 ;
- Maximum = 5000 ;
- Minimum = 0 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- };
- FixedText FT_TOP
- {
- Pos = MAP_APPFONT ( 177 , 48 ) ;
- Size = MAP_APPFONT ( 34 , 8 ) ;
- Text [ en-US ] = "~Top";
- };
- MetricField MF_TOP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 213 , 46 ) ;
- Size = MAP_APPFONT ( 38 , 12 ) ;
- Spin = TRUE ;
- Repeat = TRUE ;
- SpinSize = 10 ;
- First = 100 ;
- Last = 5000 ;
- Maximum = 5000 ;
- Minimum = 0 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- };
- FixedText FT_BOTTOM
- {
- Pos = MAP_APPFONT ( 177 , 64 ) ;
- Size = MAP_APPFONT ( 34 , 8 ) ;
- Text [ en-US ] = "~Bottom";
- };
- MetricField MF_BOTTOM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 213 , 62 ) ;
- Size = MAP_APPFONT ( 38 , 12 ) ;
- Spin = TRUE ;
- Repeat = TRUE ;
- SpinSize = 10 ;
- First = 100 ;
- Last = 5000 ;
- Maximum = 5000 ;
- Minimum = 0 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- };
- CheckBox CB_SYNC
- {
- Pos = MAP_APPFONT ( 177 , 78 ) ;
- Size = MAP_APPFONT ( 74 , 10 ) ;
- Text [ en-US ] = "Synchronize";
- };
- FixedLine FL_DISTANCE
- {
- Pos = MAP_APPFONT ( 171 , 3 ) ;
- Size = MAP_APPFONT ( 83 , 8 ) ;
- Text [ en-US ] = "Spacing to contents";
- };
-
- FixedText FT_SHADOWPOS
- {
- Pos = MAP_APPFONT ( 12 , 133 ) ;
- Size = MAP_APPFONT ( 74 , 8 ) ;
- Text [ en-US ] = "~Position" ;
- };
- Control WIN_SHADOWS
- {
- HelpId = HID_BORDER_CTL_SHADOWS ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 144 ) ;
- Size = MAP_APPFONT ( 74 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_SHADOWSIZE
- {
- Pos = MAP_APPFONT ( 88 , 133 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "Distan~ce";
- };
- MetricField ED_SHADOWSIZE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 88 , 144 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Spin = TRUE ;
- Repeat = TRUE ;
- SpinSize = 10 ;
- First = 100 ;
- Last = 5000 ;
- Maximum = 5000 ;
- Minimum = 50 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- };
- FixedText FT_SHADOWCOLOR
- {
- Pos = MAP_APPFONT ( 177 , 133 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "C~olor" ;
- };
- ListBox LB_SHADOWCOLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 177 , 144 ) ;
- Size = MAP_APPFONT ( 74 , 68 ) ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedLine FL_SHADOW
- {
- Pos = MAP_APPFONT ( 6 , 123 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Shadow style" ;
- };
- FixedLine FL_PROPERTIES
- {
- Pos = MAP_APPFONT ( 6 , 162 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Hide = TRUE;
- Text [ en-US ] = "Properties" ;
- };
- CheckBox CB_MERGEWITHNEXT
- {
- Pos = MAP_APPFONT ( 12 , 173 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Hide = TRUE;
- Text [ en-US ] = "~Merge with next paragraph" ;
- };
- CheckBox CB_MERGEADJACENTBORDERS
- {
- Pos = MAP_APPFONT ( 12 , 173 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Hide = TRUE;
- Text [ en-US ] = "~Merge adjacent line styles" ;
- };
-
-#define _PREVIEW_IDLIST_ \
- IdList = \
- { \
- IID_PRE_CELL_NONE ; \
- IID_PRE_CELL_ALL ; \
- IID_PRE_CELL_LR ; \
- IID_PRE_CELL_TB ; \
- IID_PRE_CELL_L ; \
- IID_PRE_CELL_DIAG ; \
- IID_PRE_HOR_NONE ; \
- IID_PRE_HOR_OUTER ; \
- IID_PRE_HOR_HOR ; \
- IID_PRE_HOR_ALL ; \
- IID_PRE_HOR_OUTER2 ; \
- IID_PRE_VER_NONE ; \
- IID_PRE_VER_OUTER ; \
- IID_PRE_VER_VER ; \
- IID_PRE_VER_ALL ; \
- IID_PRE_VER_OUTER2 ; \
- IID_PRE_TABLE_NONE ; \
- IID_PRE_TABLE_OUTER ; \
- IID_PRE_TABLE_OUTERH ; \
- IID_PRE_TABLE_ALL ; \
- IID_PRE_TABLE_OUTER2 ; \
- }; \
- IdCount = { 21 ; };
-
- ImageList IL_PRE_BITMAPS
- {
- Prefix = "pr";
- MaskColor = STD_MASKCOLOR ;
- _PREVIEW_IDLIST_
- };
- ImageList ILH_PRE_BITMAPS
- {
- Prefix = "prh";
- MaskColor = STD_MASKCOLOR ;
- _PREVIEW_IDLIST_
- };
-
-#define _SHADOW_IDLIST_ \
- IdList = \
- { \
- IID_SHADOWNONE ; \
- IID_SHADOW_BOT_RIGHT ; \
- IID_SHADOW_BOT_LEFT ; \
- IID_SHADOW_TOP_RIGHT ; \
- IID_SHADOW_TOP_LEFT ; \
- }; \
- IdCount = { 5 ; };
-
- ImageList IL_SDW_BITMAPS
- {
- Prefix = "sh";
- MaskColor = STD_MASKCOLOR ;
- _SHADOW_IDLIST_
- };
- ImageList ILH_SDW_BITMAPS
- {
- Prefix = "shh";
- MaskColor = STD_MASKCOLOR ;
- _SHADOW_IDLIST_
- };
-};
-
-String RID_SVXSTR_TABLE_PRESET_NONE
-{
- Text [ en-US ] = "Set No Borders" ;
-};
-String RID_SVXSTR_TABLE_PRESET_ONLYOUTER
-{
- Text [ en-US ] = "Set Outer Border Only" ;
-};
-String RID_SVXSTR_TABLE_PRESET_OUTERHORI
-{
- Text [ en-US ] = "Set Outer Border and Horizontal Lines" ;
-};
-String RID_SVXSTR_TABLE_PRESET_OUTERALL
-{
- Text [ en-US ] = "Set Outer Border and All Inner Lines" ;
-};
-String RID_SVXSTR_TABLE_PRESET_OUTERINNER
-{
- Text [ en-US ] = "Set Outer Border Without Changing Inner Lines" ;
-};
-String RID_SVXSTR_PARA_PRESET_DIAGONAL
-{
- Text [ en-US ] = "Set Diagonal Lines Only" ;
-};
-String RID_SVXSTR_PARA_PRESET_ALL
-{
- Text [ en-US ] = "Set All Four Borders" ;
-};
-String RID_SVXSTR_PARA_PRESET_LEFTRIGHT
-{
- Text [ en-US ] = "Set Left and Right Borders Only" ;
-};
-String RID_SVXSTR_PARA_PRESET_TOPBOTTOM
-{
- Text [ en-US ] = "Set Top and Bottom Borders Only" ;
-};
-String RID_SVXSTR_PARA_PRESET_ONLYLEFT
-{
- Text [ en-US ] = "Set Left Border Only" ;
-};
-String RID_SVXSTR_HOR_PRESET_ONLYHOR
-{
- Text [ en-US ] = "Set Top and Bottom Borders, and All Inner Lines";
-};
-String RID_SVXSTR_VER_PRESET_ONLYVER
-{
- Text [ en-US ] = "Set Left and Right Borders, and All Inner Lines";
-};
-String RID_SVXSTR_SHADOW_STYLE_NONE
-{
- Text [ en-US ] = "No Shadow" ;
-};
-String RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT
-{
- Text [ en-US ] = "Cast Shadow to Bottom Right" ;
-};
-String RID_SVXSTR_SHADOW_STYLE_TOPRIGHT
-{
- Text [ en-US ] = "Cast Shadow to Top Right" ;
-};
-String RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT
-{
- Text [ en-US ] = "Cast Shadow to Bottom Left" ;
-};
-String RID_SVXSTR_SHADOW_STYLE_TOPLEFT
-{
- Text [ en-US ] = "Cast Shadow to Top Left" ;
-};
-
-// **********************************************************************
diff --git a/svx/source/cui/borderconn.cxx b/svx/source/cui/borderconn.cxx
deleted file mode 100644
index 82f51bf2b8..0000000000
--- a/svx/source/cui/borderconn.cxx
+++ /dev/null
@@ -1,318 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: borderconn.cxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "borderconn.hxx"
-#include <svx/frmsel.hxx>
-#include "bolnitem.hxx"
-#include <svx/boxitem.hxx>
-#include <svx/algitem.hxx>
-#include <svx/shaditem.hxx>
-
-namespace svx {
-
-/* ============================================================================
-SvxLineItem connection
-----------------------
-Connects an SvxLineItem (that contains the style of one line of a cell border)
-with one frame border from a svx::FrameSelector control. If this connection is
-used, no additional code is needed in the Reset() and FillItemSet() functions
-of the tab page.
-============================================================================ */
-
-// 1st: item wrappers ---------------------------------------------------------
-
-class LineItemWrapper : public sfx::SingleItemWrapper< SvxLineItem, const SvxBorderLine* >
-{
-public:
- inline explicit LineItemWrapper( USHORT nSlot ) : SingleItemWrapperType( nSlot ) {}
-
- virtual const SvxBorderLine* GetItemValue( const SvxLineItem& rItem ) const
- { return rItem.GetLine(); }
- virtual void SetItemValue( SvxLineItem& rItem, const SvxBorderLine* pLine ) const
- { rItem.SetLine( pLine ); }
-};
-
-// 2nd: control wrappers ------------------------------------------------------
-
-class FrameSelectorWrapper : public sfx::SingleControlWrapper< FrameSelector, const SvxBorderLine* >
-{
-public:
- inline explicit FrameSelectorWrapper( FrameSelector& rFrameSel, FrameBorderType eBorder ) :
- SingleControlWrapperType( rFrameSel ), meBorder( eBorder ) {}
-
- virtual bool IsControlDontKnow() const;
- virtual void SetControlDontKnow( bool bSet );
-
- virtual const SvxBorderLine* GetControlValue() const;
- virtual void SetControlValue( const SvxBorderLine* pLine );
-
-private:
- FrameBorderType meBorder; /// The line this wrapper works with.
-};
-
-bool FrameSelectorWrapper::IsControlDontKnow() const
-{
- return GetControl().GetFrameBorderState( meBorder ) == FRAMESTATE_DONTCARE;
-}
-
-void FrameSelectorWrapper::SetControlDontKnow( bool bSet )
-{
- if( bSet )
- GetControl().SetBorderDontCare( meBorder );
-}
-
-const SvxBorderLine* FrameSelectorWrapper::GetControlValue() const
-{
- return GetControl().GetFrameBorderStyle( meBorder );
-}
-
-void FrameSelectorWrapper::SetControlValue( const SvxBorderLine* pLine )
-{
- GetControl().ShowBorder( meBorder, pLine );
-}
-
-// 3rd: connection ------------------------------------------------------------
-
-typedef sfx::ItemControlConnection< LineItemWrapper, FrameSelectorWrapper > FrameLineConnection;
-
-/* ============================================================================
-SvxMarginItem connection
-------------------------
-Connects an SvxMarginItem (that contains the inner margin of all cell borders)
-with the numerical edit controls of the SvxBorderTabPage. If this connection is
-used, no additional code is needed in the Reset() and FillItemSet() functions
-of the tab page.
-============================================================================ */
-
-// 1st: item wrappers ---------------------------------------------------------
-
-typedef sfx::IdentItemWrapper< SvxMarginItem > MarginItemWrapper;
-
-// 2nd: control wrappers ------------------------------------------------------
-
-class MarginControlsWrapper : public sfx::MultiControlWrapper< SvxMarginItem >
-{
-public:
- explicit MarginControlsWrapper(
- MetricField& rMfLeft, MetricField& rMfRight,
- MetricField& rMfTop, MetricField& rMfBottom );
-
- virtual SvxMarginItem GetControlValue() const;
- virtual void SetControlValue( SvxMarginItem aItem );
-
-private:
- sfx::Int16MetricFieldWrapper maLeftWrp;
- sfx::Int16MetricFieldWrapper maRightWrp;
- sfx::Int16MetricFieldWrapper maTopWrp;
- sfx::Int16MetricFieldWrapper maBottomWrp;
-};
-
-MarginControlsWrapper::MarginControlsWrapper(
- MetricField& rMfLeft, MetricField& rMfRight, MetricField& rMfTop, MetricField& rMfBottom ) :
- maLeftWrp( rMfLeft, FUNIT_TWIP ),
- maRightWrp( rMfRight, FUNIT_TWIP ),
- maTopWrp( rMfTop, FUNIT_TWIP ),
- maBottomWrp( rMfBottom, FUNIT_TWIP )
-{
- RegisterControlWrapper( maLeftWrp );
- RegisterControlWrapper( maRightWrp );
- RegisterControlWrapper( maTopWrp );
- RegisterControlWrapper( maBottomWrp );
-}
-
-SvxMarginItem MarginControlsWrapper::GetControlValue() const
-{
- SvxMarginItem aItem( GetDefaultValue() );
- if( !maLeftWrp.IsControlDontKnow() )
- aItem.SetLeftMargin( maLeftWrp.GetControlValue() );
- if( !maRightWrp.IsControlDontKnow() )
- aItem.SetRightMargin( maRightWrp.GetControlValue() );
- if( !maTopWrp.IsControlDontKnow() )
- aItem.SetTopMargin( maTopWrp.GetControlValue() );
- if( !maBottomWrp.IsControlDontKnow() )
- aItem.SetBottomMargin( maBottomWrp.GetControlValue() );
- return aItem;
-}
-
-void MarginControlsWrapper::SetControlValue( SvxMarginItem aItem )
-{
- maLeftWrp.SetControlValue( aItem.GetLeftMargin() );
- maRightWrp.SetControlValue( aItem.GetRightMargin() );
- maTopWrp.SetControlValue( aItem.GetTopMargin() );
- maBottomWrp.SetControlValue( aItem.GetBottomMargin() );
-}
-
-// 3rd: connection ------------------------------------------------------------
-
-class MarginConnection : public sfx::ItemControlConnection< MarginItemWrapper, MarginControlsWrapper >
-{
-public:
- explicit MarginConnection( const SfxItemSet& rItemSet,
- MetricField& rMfLeft, MetricField& rMfRight,
- MetricField& rMfTop, MetricField& rMfBottom,
- sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT );
-};
-
-MarginConnection::MarginConnection( const SfxItemSet& rItemSet,
- MetricField& rMfLeft, MetricField& rMfRight, MetricField& rMfTop, MetricField& rMfBottom,
- sfx::ItemConnFlags nFlags ) :
- ItemControlConnectionType( SID_ATTR_ALIGN_MARGIN, new MarginControlsWrapper( rMfLeft, rMfRight, rMfTop, rMfBottom ), nFlags )
-{
- mxCtrlWrp->SetDefaultValue( maItemWrp.GetDefaultItem( rItemSet ) );
-}
-
-/* ============================================================================
-SvxShadowItem connection
-------------------------
-Connects an SvxShadowItem (that contains shadow position, size, and color) with
-the controls of the SvxBorderTabPage. If this connection is used, no additional
-code is needed in the Reset() and FillItemSet() functions of the tab page.
-============================================================================ */
-
-// 1st: item wrappers ---------------------------------------------------------
-
-typedef sfx::IdentItemWrapper< SvxShadowItem > ShadowItemWrapper;
-
-// 2nd: control wrappers ------------------------------------------------------
-
-typedef sfx::ValueSetWrapper< SvxShadowLocation > ShadowPosWrapper;
-static const ShadowPosWrapper::MapEntryType s_pShadowPosMap[] =
-{
- { 1, SVX_SHADOW_NONE },
- { 2, SVX_SHADOW_BOTTOMRIGHT },
- { 3, SVX_SHADOW_TOPRIGHT },
- { 4, SVX_SHADOW_BOTTOMLEFT },
- { 5, SVX_SHADOW_TOPLEFT },
- { VALUESET_ITEM_NOTFOUND, SVX_SHADOW_NONE }
-};
-
-class ShadowControlsWrapper : public sfx::MultiControlWrapper< SvxShadowItem >
-{
-public:
- explicit ShadowControlsWrapper( ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor );
-
- virtual SvxShadowItem GetControlValue() const;
- virtual void SetControlValue( SvxShadowItem aItem );
-
-private:
- ShadowPosWrapper maPosWrp;
- sfx::UShortMetricFieldWrapper maSizeWrp;
- sfx::ColorListBoxWrapper maColorWrp;
-};
-
-ShadowControlsWrapper::ShadowControlsWrapper(
- ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor ) :
- maPosWrp( rVsPos, s_pShadowPosMap ),
- maSizeWrp( rMfSize, FUNIT_TWIP ),
- maColorWrp( rLbColor )
-{
- RegisterControlWrapper( maPosWrp );
- RegisterControlWrapper( maSizeWrp );
- RegisterControlWrapper( maColorWrp );
-}
-
-SvxShadowItem ShadowControlsWrapper::GetControlValue() const
-{
- SvxShadowItem aItem( GetDefaultValue() );
- if( !maPosWrp.IsControlDontKnow() )
- aItem.SetLocation( maPosWrp.GetControlValue() );
- if( !maSizeWrp.IsControlDontKnow() )
- aItem.SetWidth( maSizeWrp.GetControlValue() );
- if( !maColorWrp.IsControlDontKnow() )
- aItem.SetColor( maColorWrp.GetControlValue() );
- return aItem;
-}
-
-void ShadowControlsWrapper::SetControlValue( SvxShadowItem aItem )
-{
- maPosWrp.SetControlValue( aItem.GetLocation() );
- maSizeWrp.SetControlValue( aItem.GetWidth() );
- maColorWrp.SetControlValue( aItem.GetColor() );
-}
-
-// 3rd: connection ------------------------------------------------------------
-
-class ShadowConnection : public sfx::ItemControlConnection< ShadowItemWrapper, ShadowControlsWrapper >
-{
-public:
- explicit ShadowConnection( const SfxItemSet& rItemSet,
- ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor,
- sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT );
-};
-
-ShadowConnection::ShadowConnection( const SfxItemSet& rItemSet,
- ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor, sfx::ItemConnFlags nFlags ) :
- ItemControlConnectionType( SID_ATTR_BORDER_SHADOW, new ShadowControlsWrapper( rVsPos, rMfSize, rLbColor ), nFlags )
-{
- mxCtrlWrp->SetDefaultValue( maItemWrp.GetDefaultItem( rItemSet ) );
-}
-
-// ============================================================================
-// ============================================================================
-
-sfx::ItemConnectionBase* CreateFrameLineConnection( USHORT nSlot,
- FrameSelector& rFrameSel, FrameBorderType eBorder, sfx::ItemConnFlags nFlags )
-{
- return new FrameLineConnection( nSlot, new FrameSelectorWrapper( rFrameSel, eBorder ), nFlags );
-}
-
-sfx::ItemConnectionBase* CreateFrameBoxConnection( USHORT /*nBoxSlot*/, USHORT /*nBoxInfoSlot*/,
- FrameSelector& /*rFrameSel*/, FrameBorderType /*eBorder*/, sfx::ItemConnFlags /*nFlags*/ )
-{
- DBG_ERRORFILE( "svx::CreateFrameBoxConnection - not implemented" );
- return 0;
-}
-
-sfx::ItemConnectionBase* CreateMarginConnection( const SfxItemSet& rItemSet,
- MetricField& rMfLeft, MetricField& rMfRight,
- MetricField& rMfTop, MetricField& rMfBottom,
- sfx::ItemConnFlags nFlags )
-{
- return new MarginConnection( rItemSet, rMfLeft, rMfRight, rMfTop, rMfBottom, nFlags );
-}
-
-sfx::ItemConnectionBase* CreateShadowConnection( const SfxItemSet& rItemSet,
- ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor,
- sfx::ItemConnFlags nFlags )
-{
- return new ShadowConnection( rItemSet, rVsPos, rMfSize, rLbColor, nFlags );
-}
-
-// ============================================================================
-
-} // namespace svx
-
diff --git a/svx/source/cui/borderconn.hxx b/svx/source/cui/borderconn.hxx
deleted file mode 100644
index 740c9c79f2..0000000000
--- a/svx/source/cui/borderconn.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: borderconn.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SVX_BORDERCONN_HXX
-#define SVX_BORDERCONN_HXX
-
-#include <sfx2/itemconnect.hxx>
-#include <svx/framebordertype.hxx>
-
-class SfxItemSet;
-class MetricField;
-class ValueSet;
-class ColorListBox;
-
-namespace svx {
-
-class FrameSelector;
-
-// ============================================================================
-
-/** Creates an item connection object that connects an SvxLineItem with an
- svx::FrameSelector control. */
-sfx::ItemConnectionBase* CreateFrameLineConnection( USHORT nSlot,
- FrameSelector& rFrameSel, FrameBorderType eBorder,
- sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT );
-
-/** Creates an item connection object that connects an SvxBoxItem and an
- SvxBoxInfoItem with an svx::FrameSelector control. */
-sfx::ItemConnectionBase* CreateFrameBoxConnection(
- USHORT nBoxSlot, USHORT nBoxInfoSlot,
- FrameSelector& rFrameSel, FrameBorderType eBorder,
- sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT );
-
-/** Creates an item connection object that connects an SvxMarginItem with the
- controls of the SvxBorderTabPage. */
-sfx::ItemConnectionBase* CreateMarginConnection( const SfxItemSet& rItemSet,
- MetricField& rMfLeft, MetricField& rMfRight,
- MetricField& rMfTop, MetricField& rMfBottom,
- sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT );
-
-/** Creates an item connection object that connects an SvxShadowItem with the
- controls of the SvxBorderTabPage. */
-sfx::ItemConnectionBase* CreateShadowConnection( const SfxItemSet& rItemSet,
- ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor,
- sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT );
-
-// ============================================================================
-
-} // namespace svx
-
-#endif
-
diff --git a/svx/source/cui/cfg.cxx b/svx/source/cui/cfg.cxx
deleted file mode 100644
index d172735208..0000000000
--- a/svx/source/cui/cfg.cxx
+++ /dev/null
@@ -1,6056 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.cxx,v $
- * $Revision: 1.50.84.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include <stdlib.h>
-#include <time.h>
-
-#ifndef _HELP_HXX //autogen
-#include <vcl/help.hxx>
-#endif
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
-#include <vcl/decoview.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/scrbar.hxx>
-
-//added for issue73355
-//#ifndef _SV_SVDATA_HXX
-//#include <vcl/svdata.hxx>
-//#endif
-//issue73355 ends
-
-#include <sfx2/app.hxx>
-#include <sfx2/sfxdlg.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/msg.hxx>
-#include <sfx2/msgpool.hxx>
-#include <sfx2/mnumgr.hxx>
-#include <sfx2/macrconf.hxx>
-#include <sfx2/minfitem.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/request.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/miscopt.hxx>
-#include <tools/diagnose_ex.h>
-#include <toolkit/unohlp.hxx>
-
-#include <algorithm>
-//add
-#include <svx/dialogs.hrc>
-#include "cfg.hrc"
-#include "helpid.hrc"
-
-#include "acccfg.hxx"
-#include "cfg.hxx"
-#include "eventdlg.hxx"
-#include <svx/dialmgr.hxx>
-
-#include <comphelper/documentinfo.hxx>
-#include <comphelper/processfactory.hxx>
-#ifndef _UNOTOOLS_CONFIGMGR_HXX_
-#include <unotools/configmgr.hxx>
-#endif
-#include <com/sun/star/ui/ItemType.hpp>
-#include <com/sun/star/ui/ItemStyle.hpp>
-#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/ui/XUIConfiguration.hpp>
-#include <com/sun/star/ui/XUIConfigurationListener.hpp>
-#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
-#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
-#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
-#include <com/sun/star/ui/XModuleUIConfigurationManager.hpp>
-#include <com/sun/star/ui/XUIElement.hpp>
-#ifndef _COM_SUN_STAR_UI_UIElementType_HPP_
-#include <com/sun/star/ui/UIElementType.hpp>
-#endif
-#include <com/sun/star/ui/ImageType.hpp>
-#include <com/sun/star/frame/XLayoutManager.hpp>
-#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
-#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/frame/XFrames.hpp>
-#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-
-#include "dlgname.hxx"
-
-#define PRTSTR(x) rtl::OUStringToOString(x, RTL_TEXTENCODING_ASCII_US).pData->buffer
-
-#define ENTRY_HEIGHT 16
-
-static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL";
-static const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL";
-static const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer";
-static const char ITEM_DESCRIPTOR_LABEL[] = "Label";
-static const char ITEM_DESCRIPTOR_TYPE[] = "Type";
-static const char ITEM_DESCRIPTOR_STYLE[] = "Style";
-static const char ITEM_DESCRIPTOR_ISVISIBLE[] = "IsVisible";
-static const char ITEM_DESCRIPTOR_RESOURCEURL[] = "ResourceURL";
-static const char ITEM_DESCRIPTOR_UINAME[] = "UIName";
-
-static const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
-static const char ITEM_TOOLBAR_URL[] = "private:resource/toolbar/";
-
-static const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
-static const char CUSTOM_MENU_STR[] = "vnd.openoffice.org:CustomMenu";
-
-static const char __FAR_DATA pSeparatorStr[] =
- "----------------------------------";
-static const char __FAR_DATA pMenuSeparatorStr[] = " | ";
-
-#ifdef _MSC_VER
-#pragma warning (disable:4355)
-#endif
-
-using rtl::OUString;
-namespace css = com::sun::star;
-namespace uno = com::sun::star::uno;
-namespace frame = com::sun::star::frame;
-namespace lang = com::sun::star::lang;
-namespace container = com::sun::star::container;
-namespace beans = com::sun::star::beans;
-namespace graphic = com::sun::star::graphic;
-
-void printPropertySet(
- const OUString& prefix,
- const uno::Reference< beans::XPropertySet >& xPropSet )
-{
- uno::Reference< beans::XPropertySetInfo > xPropSetInfo =
- xPropSet->getPropertySetInfo();
-
- uno::Sequence< beans::Property > aPropDetails =
- xPropSetInfo->getProperties();
-
- OSL_TRACE("printPropertySet: %d properties", aPropDetails.getLength());
-
- for ( sal_Int32 i = 0; i < aPropDetails.getLength(); i++ )
- {
- OUString tmp;
- sal_Int32 ival;
-
- uno::Any a = xPropSet->getPropertyValue( aPropDetails[i].Name );
-
- if ( ( a >>= tmp ) /* && tmp.getLength() != 0 */ )
- {
- OSL_TRACE("%s: Got property: %s = %s",
- PRTSTR(prefix), PRTSTR(aPropDetails[i].Name), PRTSTR(tmp));
- }
- else if ( ( a >>= ival ) )
- {
- OSL_TRACE("%s: Got property: %s = %d",
- PRTSTR(prefix), PRTSTR(aPropDetails[i].Name), PRTSTR(tmp));
- }
- else
- {
- OSL_TRACE("%s: Got property: %s of type %s",
- PRTSTR(prefix), PRTSTR(aPropDetails[i].Name), PRTSTR(a.getValueTypeName()));
- }
- }
-}
-
-void printProperties(
- const OUString& prefix,
- const uno::Sequence< beans::PropertyValue >& aProp )
-{
- for ( sal_Int32 i = 0; i < aProp.getLength(); i++ )
- {
- OUString tmp;
-
- aProp[i].Value >>= tmp;
-
- OSL_TRACE("%s: Got property: %s = %s",
- PRTSTR(prefix), PRTSTR(aProp[i].Name), PRTSTR(tmp));
- }
-}
-
-void printEntries(SvxEntries* entries)
-{
- SvxEntries::const_iterator iter = entries->begin();
-
- for ( ; iter != entries->end(); iter++ )
- {
- SvxConfigEntry* entry = *iter;
-
- OSL_TRACE("printEntries: %s", PRTSTR(entry->GetName()));
- }
-}
-
-OUString
-stripHotKey( const OUString& str )
-{
- sal_Int32 index = str.indexOf( '~' );
- if ( index == -1 )
- {
- return str;
- }
- else
- {
- return str.replaceAt( index, 1, OUString() );
- }
-}
-
-OUString replaceSaveInName(
- const OUString& rMessage,
- const OUString& rSaveInName )
-{
- OUString name;
- OUString placeholder = OUString::createFromAscii( "%SAVE IN SELECTION%" );
-
- sal_Int32 pos = rMessage.indexOf( placeholder );
-
- if ( pos != -1 )
- {
- name = rMessage.replaceAt(
- pos, placeholder.getLength(), rSaveInName );
- }
- else
- {
- // don't change the message
- }
-
- return name;
-}
-
-OUString
-replaceSixteen( const OUString& str, sal_Int32 nReplacement )
-{
- OUString result( str );
- OUString sixteen = OUString::valueOf( (sal_Int32)16 );
- OUString expected = OUString::valueOf( nReplacement );
-
- sal_Int32 len = sixteen.getLength();
- sal_Int32 index = result.indexOf( sixteen );
-
- while ( index != -1 )
- {
- result = result.replaceAt( index, len, expected );
- index = result.indexOf( sixteen, index );
- }
-
- return result;
-}
-
-OUString
-generateCustomName(
- const OUString& prefix,
- SvxEntries* entries,
- sal_Int32 suffix = 1 )
-{
- // find and replace the %n placeholder in the prefix string
- OUString name;
- OUString placeholder = OUString::createFromAscii( "%n" );
-
- sal_Int32 pos = prefix.indexOf(
- OUString::createFromAscii( "%n" ) );
-
- if ( pos != -1 )
- {
- name = prefix.replaceAt(
- pos, placeholder.getLength(), OUString::valueOf( suffix ) );
- }
- else
- {
- // no placeholder found so just append the suffix
- name = prefix + OUString::valueOf( suffix );
- }
-
- // now check is there is an already existing entry with this name
- SvxEntries::const_iterator iter = entries->begin();
-
- SvxConfigEntry* pEntry;
- while ( iter != entries->end() )
- {
- pEntry = *iter;
-
- if ( name.equals( pEntry->GetName() ) )
- {
- break;
- }
- iter++;
- }
-
- if ( iter != entries->end() )
- {
- // name already exists so try the next number up
- return generateCustomName( prefix, entries, ++suffix );
- }
-
- return name;
-}
-
-sal_uInt32 generateRandomValue()
-{
- srand( unsigned( time( NULL ) ));
- return sal_uInt32( rand() );
-}
-
-OUString
-generateCustomURL(
- SvxEntries* entries )
-{
- OUString url = OUString::createFromAscii( ITEM_TOOLBAR_URL );
- url += OUString::createFromAscii( CUSTOM_TOOLBAR_STR );
-
- // use a random number to minimize possible clash with existing custom toolbars
- url += OUString::valueOf( sal_Int64( generateRandomValue() ), 16 );
-
- // now check is there is an already existing entry with this url
- SvxEntries::const_iterator iter = entries->begin();
-
- SvxConfigEntry* pEntry;
- while ( iter != entries->end() )
- {
- pEntry = *iter;
-
- if ( url.equals( pEntry->GetCommand() ) )
- {
- break;
- }
- iter++;
- }
-
- if ( iter != entries->end() )
- {
- // url already exists so try the next number up
- return generateCustomURL( entries );
- }
-
- return url;
-}
-
-OUString
-generateCustomMenuURL(
- SvxEntries* entries,
- sal_Int32 suffix = 1 )
-{
- OUString url = OUString::createFromAscii( CUSTOM_MENU_STR );
- url += OUString::valueOf( suffix );
-
- // now check is there is an already existing entry with this url
- SvxEntries::const_iterator iter = entries->begin();
-
- SvxConfigEntry* pEntry;
- while ( iter != entries->end() )
- {
- pEntry = *iter;
-
- if ( url.equals( pEntry->GetCommand() ) )
- {
- break;
- }
- iter++;
- }
-
- if ( iter != entries->end() )
- {
- // url already exists so try the next number up
- return generateCustomMenuURL( entries, ++suffix );
- }
-
- return url;
-}
-
-static sal_Int16 theImageType =
- css::ui::ImageType::COLOR_NORMAL |
- css::ui::ImageType::SIZE_DEFAULT;
-
-void InitImageType()
-{
- theImageType =
- css::ui::ImageType::COLOR_NORMAL |
- css::ui::ImageType::SIZE_DEFAULT;
-
- if ( SvtMiscOptions().AreCurrentSymbolsLarge() )
- {
- theImageType |= css::ui::ImageType::SIZE_LARGE;
- }
-
- Window* topwin = Application::GetActiveTopWindow();
- if ( topwin != NULL &&
- topwin->GetSettings().GetStyleSettings().GetHighContrastMode() )
- {
- theImageType |= css::ui::ImageType::COLOR_HIGHCONTRAST;
- }
-}
-
-sal_Int16 GetImageType()
-{
- return theImageType;
-}
-
-void RemoveEntry( SvxEntries* pEntries, SvxConfigEntry* pChildEntry )
-{
- SvxEntries::iterator iter = pEntries->begin();
-
- while ( iter != pEntries->end() )
- {
- if ( pChildEntry == *iter )
- {
- pEntries->erase( iter );
- break;
- }
- iter++;
- }
-}
-
-bool
-SvxConfigPage::CanConfig( const OUString& aModuleId )
-{
- OSL_TRACE("SupportsDocumentConfig: %s", PRTSTR(aModuleId));
-
- if ( aModuleId.equalsAscii( "com.sun.star.script.BasicIDE" )
- || aModuleId.equalsAscii( "com.sun.star.frame.Bibliography" )
- )
- {
- return FALSE;
- }
- return TRUE;
-}
-
-OUString GetModuleName( const OUString& aModuleId )
-{
- if ( aModuleId.equalsAscii( "com.sun.star.text.TextDocument" ) ||
- aModuleId.equalsAscii( "com.sun.star.text.GlobalDocument" ) )
- return OUString::createFromAscii("Writer");
- else if ( aModuleId.equalsAscii( "com.sun.star.text.WebDocument" ) )
- return OUString::createFromAscii("Writer/Web");
- else if ( aModuleId.equalsAscii( "com.sun.star.drawing.DrawingDocument" ) )
- return OUString::createFromAscii("Draw");
- else if ( aModuleId.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) )
- return OUString::createFromAscii("Impress");
- else if ( aModuleId.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" ) )
- return OUString::createFromAscii("Calc");
- else if ( aModuleId.equalsAscii( "com.sun.star.script.BasicIDE" ) )
- return OUString::createFromAscii("Basic");
- else if ( aModuleId.equalsAscii( "com.sun.star.formula.FormulaProperties" ) )
- return OUString::createFromAscii("Math");
- else if ( aModuleId.equalsAscii( "com.sun.star.sdb.RelationDesign" ) )
- return OUString::createFromAscii("Relation Design");
- else if ( aModuleId.equalsAscii( "com.sun.star.sdb.QueryDesign" ) )
- return OUString::createFromAscii("Query Design");
- else if ( aModuleId.equalsAscii( "com.sun.star.sdb.TableDesign" ) )
- return OUString::createFromAscii("Table Design");
- else if ( aModuleId.equalsAscii( "com.sun.star.sdb.DataSourceBrowser" ) )
- return OUString::createFromAscii("Data Source Browser" );
- else if ( aModuleId.equalsAscii( "com.sun.star.sdb.DatabaseDocument" ) )
- return OUString::createFromAscii("Database" );
-
- return ::rtl::OUString();
-}
-
-OUString GetUIModuleName( const OUString& aModuleId, const uno::Reference< css::frame::XModuleManager >& rModuleManager )
-{
- OUString aModuleUIName;
-
- if ( rModuleManager.is() )
- {
- uno::Reference< css::container::XNameAccess > xNameAccess( rModuleManager, uno::UNO_QUERY );
- if ( xNameAccess.is() )
- {
- try
- {
- uno::Any a = xNameAccess->getByName( aModuleId );
- uno::Sequence< beans::PropertyValue > aSeq;
-
- if ( a >>= aSeq )
- {
- OUString aUIName;
- for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
- {
- if ( aSeq[i].Name.equalsAscii( "ooSetupFactoryUIName" ))
- {
- aSeq[i].Value >>= aModuleUIName;
- break;
- }
- }
- }
- }
- catch ( uno::RuntimeException& e )
- {
- throw e;
- }
- catch ( uno::Exception& )
- {
- }
- }
- }
-
- if ( aModuleUIName.getLength() == 0 )
- aModuleUIName = GetModuleName( aModuleId );
-
- return aModuleUIName;
-}
-
-bool GetMenuItemData(
- const uno::Reference< container::XIndexAccess >& rItemContainer,
- sal_Int32 nIndex,
- OUString& rCommandURL,
- OUString& rHelpURL,
- OUString& rLabel,
- sal_uInt16& rType,
- uno::Reference< container::XIndexAccess >& rSubMenu )
-{
- try
- {
- uno::Sequence< beans::PropertyValue > aProp;
- if ( rItemContainer->getByIndex( nIndex ) >>= aProp )
- {
- for ( sal_Int32 i = 0; i < aProp.getLength(); i++ )
- {
- if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL ))
- {
- aProp[i].Value >>= rCommandURL;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL ))
- {
- aProp[i].Value >>= rHelpURL;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_CONTAINER ))
- {
- aProp[i].Value >>= rSubMenu;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ))
- {
- aProp[i].Value >>= rLabel;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE ))
- {
- aProp[i].Value >>= rType;
- }
- }
-
- return TRUE;
- }
- }
- catch ( ::com::sun::star::lang::IndexOutOfBoundsException& )
- {
- }
-
- return FALSE;
-}
-
-bool GetToolbarItemData(
- const uno::Reference< container::XIndexAccess >& rItemContainer,
- sal_Int32 nIndex,
- OUString& rCommandURL,
- OUString& rHelpURL,
- OUString& rLabel,
- sal_uInt16& rType,
- sal_Bool& rIsVisible,
- sal_Int32& rStyle,
- uno::Reference< container::XIndexAccess >& rSubMenu )
-{
- try
- {
- uno::Sequence< beans::PropertyValue > aProp;
- if ( rItemContainer->getByIndex( nIndex ) >>= aProp )
- {
- for ( sal_Int32 i = 0; i < aProp.getLength(); i++ )
- {
- if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL ))
- {
- aProp[i].Value >>= rCommandURL;
- }
- if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE ))
- {
- aProp[i].Value >>= rStyle;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL ))
- {
- aProp[i].Value >>= rHelpURL;
- }
- else if (aProp[i].Name.equalsAscii(ITEM_DESCRIPTOR_CONTAINER))
- {
- aProp[i].Value >>= rSubMenu;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ))
- {
- aProp[i].Value >>= rLabel;
- }
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE ))
- {
- aProp[i].Value >>= rType;
- }
- else if (aProp[i].Name.equalsAscii(ITEM_DESCRIPTOR_ISVISIBLE))
- {
- aProp[i].Value >>= rIsVisible;
- }
- }
-
- return sal_True;
- }
- }
- catch ( ::com::sun::star::lang::IndexOutOfBoundsException& )
- {
- }
-
- return sal_False;
-}
-
-uno::Sequence< beans::PropertyValue >
-ConvertSvxConfigEntry(
- const uno::Reference< container::XNameAccess >& xCommandToLabelMap,
- const SvxConfigEntry* pEntry )
-{
- static const OUString aDescriptorCommandURL (
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ) );
-
- static const OUString aDescriptorType(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) );
-
- static const OUString aDescriptorLabel(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) );
-
- static const OUString aDescriptorHelpURL(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) );
-
- static const OUString aDescriptorContainer(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) );
-
- uno::Sequence< beans::PropertyValue > aPropSeq( 4 );
-
- aPropSeq[0].Name = aDescriptorCommandURL;
- aPropSeq[0].Value <<= rtl::OUString( pEntry->GetCommand() );
-
- aPropSeq[1].Name = aDescriptorType;
- aPropSeq[1].Value <<= css::ui::ItemType::DEFAULT;
-
- // If the name has not been changed and the name is the same as
- // in the default command to label map then the label can be stored
- // as an empty string.
- // It will be initialised again later using the command to label map.
- aPropSeq[2].Name = aDescriptorLabel;
- if ( pEntry->HasChangedName() == FALSE && pEntry->GetCommand().getLength() )
- {
- BOOL isDefaultName = FALSE;
- try
- {
- uno::Any a( xCommandToLabelMap->getByName( pEntry->GetCommand() ) );
- uno::Sequence< beans::PropertyValue > tmpPropSeq;
- if ( a >>= tmpPropSeq )
- {
- for ( sal_Int32 i = 0; i < tmpPropSeq.getLength(); i++ )
- {
- if ( tmpPropSeq[i].Name.equals( aDescriptorLabel ) )
- {
- OUString tmpLabel;
- tmpPropSeq[i].Value >>= tmpLabel;
-
- if ( tmpLabel.equals( pEntry->GetName() ) )
- {
- isDefaultName = TRUE;
- }
-
- break;
- }
- }
- }
- }
- catch ( container::NoSuchElementException& )
- {
- // isDefaultName is left as FALSE
- }
-
- if ( isDefaultName )
- {
- aPropSeq[2].Value <<= rtl::OUString();
- }
- else
- {
- aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() );
- }
- }
- else
- {
- aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() );
- }
-
- aPropSeq[3].Name = aDescriptorHelpURL;
- aPropSeq[3].Value <<= rtl::OUString( pEntry->GetHelpURL() );
-
- return aPropSeq;
-}
-
-uno::Sequence< beans::PropertyValue >
-ConvertToolbarEntry(
- const uno::Reference< container::XNameAccess >& xCommandToLabelMap,
- const SvxConfigEntry* pEntry )
-{
- static const OUString aDescriptorCommandURL (
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ) );
-
- static const OUString aDescriptorType(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) );
-
- static const OUString aDescriptorLabel(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) );
-
- static const OUString aDescriptorHelpURL(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) );
-
- static const OUString aDescriptorContainer(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) );
-
- static const OUString aIsVisible(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_ISVISIBLE ) );
-
- uno::Sequence< beans::PropertyValue > aPropSeq( 5 );
-
- aPropSeq[0].Name = aDescriptorCommandURL;
- aPropSeq[0].Value <<= rtl::OUString( pEntry->GetCommand() );
-
- aPropSeq[1].Name = aDescriptorType;
- aPropSeq[1].Value <<= css::ui::ItemType::DEFAULT;
-
- // If the name has not been changed and the name is the same as
- // in the default command to label map then the label can be stored
- // as an empty string.
- // It will be initialised again later using the command to label map.
- aPropSeq[2].Name = aDescriptorLabel;
- if ( pEntry->HasChangedName() == FALSE && pEntry->GetCommand().getLength() )
- {
- BOOL isDefaultName = FALSE;
- try
- {
- uno::Any a( xCommandToLabelMap->getByName( pEntry->GetCommand() ) );
- uno::Sequence< beans::PropertyValue > tmpPropSeq;
- if ( a >>= tmpPropSeq )
- {
- for ( sal_Int32 i = 0; i < tmpPropSeq.getLength(); i++ )
- {
- if ( tmpPropSeq[i].Name.equals( aDescriptorLabel ) )
- {
- OUString tmpLabel;
- tmpPropSeq[i].Value >>= tmpLabel;
-
- if ( tmpLabel.equals( pEntry->GetName() ) )
- {
- isDefaultName = TRUE;
- }
-
- break;
- }
- }
- }
- }
- catch ( container::NoSuchElementException& )
- {
- // isDefaultName is left as FALSE
- }
-
- if ( isDefaultName )
- {
- aPropSeq[2].Value <<= rtl::OUString();
- }
- else
- {
- aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() );
- }
- }
- else
- {
- aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() );
- }
-
- aPropSeq[3].Name = aDescriptorHelpURL;
- aPropSeq[3].Value <<= rtl::OUString( pEntry->GetHelpURL() );
-
- aPropSeq[4].Name = aIsVisible;
- aPropSeq[4].Value <<= pEntry->IsVisible();
-
- return aPropSeq;
-}
-
-SfxTabPage *CreateSvxMenuConfigPage( Window *pParent, const SfxItemSet& rSet )
-{
- return new SvxMenuConfigPage( pParent, rSet );
-}
-
-SfxTabPage *CreateKeyboardConfigPage( Window *pParent, const SfxItemSet& rSet )
-{
- return new SfxAcceleratorConfigPage( pParent, rSet );
-}
-
-SfxTabPage *CreateSvxToolbarConfigPage( Window *pParent, const SfxItemSet& rSet )
-{
- return new SvxToolbarConfigPage( pParent, rSet );
-}
-
-SfxTabPage *CreateSvxEventConfigPage( Window *pParent, const SfxItemSet& rSet )
-{
- return new SvxEventConfigPage( pParent, rSet, SvxEventConfigPage::EarlyInit() );
-}
-
-sal_Bool impl_showKeyConfigTabPage( const css::uno::Reference< css::frame::XFrame >& xFrame )
-{
- static ::rtl::OUString SERVICENAME_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager");
- static ::rtl::OUString SERVICENAME_DESKTOP = ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop" );
- static ::rtl::OUString MODULEID_STARTMODULE = ::rtl::OUString::createFromAscii("com.sun.star.frame.StartModule" );
-
- try
- {
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- css::uno::Reference< css::frame::XFramesSupplier > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::frame::XModuleManager > xMM (xSMGR->createInstance(SERVICENAME_MODULEMANAGER), css::uno::UNO_QUERY_THROW);
-
- if (xMM.is() && xFrame.is())
- {
- ::rtl::OUString sModuleId = xMM->identify(xFrame);
- if (
- ( sModuleId.getLength() ) &&
- (!sModuleId.equals(MODULEID_STARTMODULE))
- )
- return sal_True;
- }
- }
- catch(const css::uno::Exception&)
- {}
-
- return sal_False;
-}
-
-/******************************************************************************
- *
- * SvxConfigDialog is the configuration dialog which is brought up from the
- * Tools menu. It includes tabs for customizing menus, toolbars, events and
- * key bindings.
- *
- *****************************************************************************/
-SvxConfigDialog::SvxConfigDialog(
- Window * pParent, const SfxItemSet* pSet_ )
- :
- SfxTabDialog( pParent,
- SVX_RES( RID_SVXDLG_CUSTOMIZE ), pSet_ )
-{
- FreeResource();
-
- InitImageType();
-
- AddTabPage( RID_SVXPAGE_MENUS, CreateSvxMenuConfigPage, NULL );
- AddTabPage( RID_SVXPAGE_KEYBOARD, CreateKeyboardConfigPage, NULL );
- AddTabPage( RID_SVXPAGE_TOOLBARS, CreateSvxToolbarConfigPage, NULL );
- AddTabPage( RID_SVXPAGE_EVENTS, CreateSvxEventConfigPage, NULL );
-
- const SfxPoolItem* pItem =
- pSet_->GetItem( pSet_->GetPool()->GetWhich( SID_CONFIG ) );
-
- if ( pItem )
- {
- OUString text = ((const SfxStringItem*)pItem)->GetValue();
-
- if (text.indexOf(OUString::createFromAscii(ITEM_TOOLBAR_URL)) == 0)
- {
- SetCurPageId( RID_SVXPAGE_TOOLBARS );
- }
- }
-}
-
-void SvxConfigDialog::SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
-{
- m_xFrame = xFrame;
-
- if (!impl_showKeyConfigTabPage( xFrame ))
- RemoveTabPage( RID_SVXPAGE_KEYBOARD );
-}
-
-SvxConfigDialog::~SvxConfigDialog()
-{
-}
-
-short SvxConfigDialog::Ok()
-{
- return SfxTabDialog::Ok();
-}
-
-void SvxConfigDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
-{
- (void)rPage;
-
- switch ( nId )
- {
- case RID_SVXPAGE_MENUS:
- case RID_SVXPAGE_TOOLBARS:
- case RID_SVXPAGE_KEYBOARD:
- {
- rPage.SetFrame(m_xFrame);
- }
- break;
- case RID_SVXPAGE_EVENTS:
- {
- dynamic_cast< SvxEventConfigPage& >( rPage ).LateInit( m_xFrame );
- };
- break;
- default:
- break;
- }
-}
-
-void SvxConfigDialog::ActivateTabPage( USHORT nSlotId )
-{
- (void)nSlotId;
-}
-
-/******************************************************************************
- *
- * The SaveInData class is used to hold data for entries in the Save In
- * ListBox controls in the menu and toolbar tabs
- *
- ******************************************************************************/
-
-// Initialize static variable which holds default XImageManager
-uno::Reference< css::ui::XImageManager>* SaveInData::xDefaultImgMgr = NULL;
-
-SaveInData::SaveInData(
- const uno::Reference< css::ui::XUIConfigurationManager >& xCfgMgr,
- const uno::Reference< css::ui::XUIConfigurationManager >& xParentCfgMgr,
- const OUString& aModuleId,
- bool isDocConfig )
- :
- bModified( FALSE ),
- bDocConfig( isDocConfig ),
- bReadOnly( FALSE ),
- m_xCfgMgr( xCfgMgr ),
- m_xParentCfgMgr( xParentCfgMgr )
-{
- uno::Reference< beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
-
- xProps->getPropertyValue(
- OUString::createFromAscii( "DefaultContext" ))
- >>= m_xComponentContext;
-
- m_aSeparatorSeq.realloc( 1 );
- m_aSeparatorSeq[0].Name = OUString(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) );
- m_aSeparatorSeq[0].Value <<= css::ui::ItemType::SEPARATOR_LINE;
-
- if ( bDocConfig )
- {
- uno::Reference< css::ui::XUIConfigurationPersistence >
- xDocPersistence( GetConfigManager(), uno::UNO_QUERY );
-
- bReadOnly = xDocPersistence->isReadOnly();
- }
-
- m_xServiceManager = uno::Reference< lang::XMultiServiceFactory >(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-
- uno::Reference< container::XNameAccess > xNameAccess(
- m_xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.UICommandDescription" ) ) ),
- uno::UNO_QUERY );
-
- if ( xNameAccess.is() )
- xNameAccess->getByName( aModuleId ) >>= m_xCommandToLabelMap;
-
- if ( !m_xImgMgr.is() )
- {
- m_xImgMgr = uno::Reference< css::ui::XImageManager >(
- GetConfigManager()->getImageManager(), uno::UNO_QUERY );
- }
-
- if ( !IsDocConfig() )
- {
- // If this is not a document configuration then it is the settings
- // for the module (writer, calc, impress etc.) Use this as the default
- // XImageManager instance
- xDefaultImgMgr = &m_xImgMgr;
- }
- else
- {
- // If this is a document configuration then use the module image manager
- // as default.
- if ( m_xParentCfgMgr.is() )
- {
- m_xParentImgMgr = uno::Reference< css::ui::XImageManager >(
- m_xParentCfgMgr->getImageManager(), uno::UNO_QUERY );
- xDefaultImgMgr = &m_xParentImgMgr;
- }
- }
-}
-
-uno::Reference< graphic::XGraphic > GetGraphic(
- const uno::Reference< css::ui::XImageManager >& xImageManager,
- const OUString& rCommandURL )
-{
- uno::Reference< graphic::XGraphic > result;
-
- if ( xImageManager.is() )
- {
- // TODO handle large and high contrast graphics
- uno::Sequence< uno::Reference< graphic::XGraphic > > aGraphicSeq;
-
- uno::Sequence< OUString > aImageCmdSeq( 1 );
- aImageCmdSeq[0] = rCommandURL;
-
- try
- {
- aGraphicSeq =
- xImageManager->getImages( GetImageType(), aImageCmdSeq );
-
- if ( aGraphicSeq.getLength() > 0 )
- {
- result = aGraphicSeq[0];
- }
- }
- catch ( uno::Exception& )
- {
- // will return empty XGraphic
- }
- }
-
- return result;
-}
-
-Image SaveInData::GetImage( const OUString& rCommandURL )
-{
- Image aImage;
-
- uno::Reference< graphic::XGraphic > xGraphic =
- GetGraphic( m_xImgMgr, rCommandURL );
-
- if ( xGraphic.is() )
- {
- aImage = Image( xGraphic );
- }
- else if ( xDefaultImgMgr != NULL && (*xDefaultImgMgr).is() )
- {
- xGraphic = GetGraphic( (*xDefaultImgMgr), rCommandURL );
-
- if ( xGraphic.is() )
- {
- aImage = Image( xGraphic );
- }
- }
-
- return aImage;
-}
-
-bool SaveInData::PersistChanges(
- const uno::Reference< uno::XInterface >& xManager )
-{
- bool result = TRUE;
-
- try
- {
- if ( xManager.is() && !IsReadOnly() )
- {
- uno::Reference< css::ui::XUIConfigurationPersistence >
- xConfigPersistence( xManager, uno::UNO_QUERY );
-
- if ( xConfigPersistence->isModified() )
- {
- xConfigPersistence->store();
- }
- }
- }
- catch ( com::sun::star::io::IOException& )
- {
- result = FALSE;
- }
-
- return result;
-}
-
-/******************************************************************************
- *
- * The MenuSaveInData class extends SaveInData and provides menu specific
- * load and store functionality.
- *
- ******************************************************************************/
-
-// Initialize static variable which holds default Menu data
-MenuSaveInData* MenuSaveInData::pDefaultData = NULL;
-
-MenuSaveInData::MenuSaveInData(
- const uno::Reference< css::ui::XUIConfigurationManager >& cfgmgr,
- const uno::Reference< css::ui::XUIConfigurationManager >& xParentCfgMgr,
- const OUString& aModuleId,
- bool isDocConfig )
- :
- SaveInData( cfgmgr, xParentCfgMgr, aModuleId, isDocConfig ),
- m_aMenuResourceURL(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_MENUBAR_URL ) ),
- m_aDescriptorContainer(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) ),
- pRootEntry( 0 )
-{
- try
- {
- OUString url( RTL_CONSTASCII_USTRINGPARAM( ITEM_MENUBAR_URL ) );
- m_xMenuSettings = GetConfigManager()->getSettings( url, sal_False );
- }
- catch ( container::NoSuchElementException& )
- {
- // will use menu settings for the module
- }
-
- // If this is not a document configuration then it is the settings
- // for the module (writer, calc, impress etc.). These settings should
- // be set as the default to be used for SaveIn locations that do not
- // have custom settings
- if ( !IsDocConfig() )
- {
- SetDefaultData( this );
- }
-}
-
-MenuSaveInData::~MenuSaveInData()
-{
- if ( pRootEntry != NULL )
- {
- delete pRootEntry;
- }
-}
-
-SvxEntries*
-MenuSaveInData::GetEntries()
-{
- if ( pRootEntry == NULL )
- {
- pRootEntry = new SvxConfigEntry(
- String::CreateFromAscii("MainMenus"), String(), TRUE );
-
- if ( m_xMenuSettings.is() )
- {
- LoadSubMenus( m_xMenuSettings, String(), pRootEntry );
- }
- else if ( GetDefaultData() != NULL )
- {
- // If the doc has no config settings use module config settings
- LoadSubMenus( GetDefaultData()->m_xMenuSettings, String(), pRootEntry );
- }
- }
-
- return pRootEntry->GetEntries();
-}
-
-void
-MenuSaveInData::SetEntries( SvxEntries* pNewEntries )
-{
- // delete old menu hierarchy first
- if ( pRootEntry != NULL )
- {
- delete pRootEntry->GetEntries();
- }
-
- // now set new menu hierarchy
- pRootEntry->SetEntries( pNewEntries );
-}
-
-bool MenuSaveInData::LoadSubMenus(
- const uno::Reference< container::XIndexAccess >& xMenuSettings,
- const OUString& rBaseTitle,
- SvxConfigEntry* pParentData )
-{
- SvxEntries* pEntries = pParentData->GetEntries();
-
- for ( sal_Int32 nIndex = 0; nIndex < xMenuSettings->getCount(); nIndex++ )
- {
- uno::Reference< container::XIndexAccess > xSubMenu;
- OUString aCommandURL;
- OUString aHelpURL;
- OUString aLabel;
- bool bIsUserDefined = TRUE;
-
- sal_uInt16 nType( css::ui::ItemType::DEFAULT );
-
- bool bItem = GetMenuItemData( xMenuSettings, nIndex,
- aCommandURL, aHelpURL, aLabel, nType, xSubMenu );
-
- if ( bItem )
- {
- if ( nType == css::ui::ItemType::DEFAULT )
- {
- uno::Any a;
- try
- {
- a = m_xCommandToLabelMap->getByName( aCommandURL );
- bIsUserDefined = FALSE;
- }
- catch ( container::NoSuchElementException& )
- {
- bIsUserDefined = TRUE;
- }
-
- // If custom label not set retrieve it from the command
- // to info service
- if ( aLabel.equals( OUString() ) )
- {
- uno::Sequence< beans::PropertyValue > aPropSeq;
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) )
- {
- aPropSeq[i].Value >>= aLabel;
- break;
- }
- }
- }
- }
-
- if ( xSubMenu.is() )
- {
- // popup menu
- SvxConfigEntry* pEntry = new SvxConfigEntry(
- aLabel, aCommandURL, TRUE );
-
- pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
-
- pEntries->push_back( pEntry );
-
- OUString subMenuTitle( rBaseTitle );
-
- if ( subMenuTitle.getLength() != 0 )
- {
- subMenuTitle +=
- OUString::createFromAscii(pMenuSeparatorStr);
- }
- else
- {
- pEntry->SetMain( TRUE );
- }
-
- subMenuTitle += stripHotKey( aLabel );
-
- LoadSubMenus( xSubMenu, subMenuTitle, pEntry );
- }
- else
- {
- SvxConfigEntry* pEntry = new SvxConfigEntry(
- aLabel, aCommandURL, FALSE );
- pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
- pEntries->push_back( pEntry );
- }
- }
- else
- {
- SvxConfigEntry* pEntry = new SvxConfigEntry;
- pEntry->SetUserDefined( bIsUserDefined );
- pEntries->push_back( pEntry );
- }
- }
- }
- return true;
-}
-
-bool MenuSaveInData::Apply()
-{
- bool result = FALSE;
-
- if ( IsModified() )
- {
- // Apply new menu bar structure to our settings container
- m_xMenuSettings = uno::Reference< container::XIndexAccess >(
- GetConfigManager()->createSettings(), uno::UNO_QUERY );
-
- uno::Reference< container::XIndexContainer > xIndexContainer (
- m_xMenuSettings, uno::UNO_QUERY );
-
- uno::Reference< lang::XSingleComponentFactory > xFactory (
- m_xMenuSettings, uno::UNO_QUERY );
-
- Apply( pRootEntry, xIndexContainer, xFactory, NULL );
-
- try
- {
- if ( GetConfigManager()->hasSettings( m_aMenuResourceURL ) )
- {
- GetConfigManager()->replaceSettings(
- m_aMenuResourceURL, m_xMenuSettings );
- }
- else
- {
- GetConfigManager()->insertSettings(
- m_aMenuResourceURL, m_xMenuSettings );
- }
- }
- catch ( container::NoSuchElementException& )
- {
- OSL_TRACE("caught container::NoSuchElementException saving settings");
- }
- catch ( com::sun::star::io::IOException& )
- {
- OSL_TRACE("caught IOException saving settings");
- }
- catch ( com::sun::star::uno::Exception& )
- {
- OSL_TRACE("caught some other exception saving settings");
- }
-
- SetModified( FALSE );
-
- result = PersistChanges( GetConfigManager() );
- }
-
- return result;
-}
-
-void MenuSaveInData::Apply(
- SvxConfigEntry* pRootEntry_,
- uno::Reference< container::XIndexContainer >& rMenuBar,
- uno::Reference< lang::XSingleComponentFactory >& rFactory,
- SvLBoxEntry *pParentEntry )
-{
- (void)pRootEntry_;
- (void)pParentEntry;
-
- SvxEntries::const_iterator iter = GetEntries()->begin();
- SvxEntries::const_iterator end = GetEntries()->end();
-
- for ( ; iter != end; iter++ )
- {
- SvxConfigEntry* pEntryData = *iter;
-
- uno::Sequence< beans::PropertyValue > aPropValueSeq =
- ConvertSvxConfigEntry( m_xCommandToLabelMap, pEntryData );
-
- uno::Reference< container::XIndexContainer > xSubMenuBar(
- rFactory->createInstanceWithContext( m_xComponentContext ),
- uno::UNO_QUERY );
-
- sal_Int32 nIndex = aPropValueSeq.getLength();
- aPropValueSeq.realloc( nIndex + 1 );
- aPropValueSeq[nIndex].Name = m_aDescriptorContainer;
- aPropValueSeq[nIndex].Value <<= xSubMenuBar;
- rMenuBar->insertByIndex(
- rMenuBar->getCount(), uno::makeAny( aPropValueSeq ));
- ApplyMenu( xSubMenuBar, rFactory, pEntryData );
- }
-}
-
-void MenuSaveInData::ApplyMenu(
- uno::Reference< container::XIndexContainer >& rMenuBar,
- uno::Reference< lang::XSingleComponentFactory >& rFactory,
- SvxConfigEntry* pMenuData )
-{
- SvxEntries::const_iterator iter = pMenuData->GetEntries()->begin();
- SvxEntries::const_iterator end = pMenuData->GetEntries()->end();
-
- for ( ; iter != end; iter++ )
- {
- SvxConfigEntry* pEntry = *iter;
-
- if ( pEntry->IsPopup() )
- {
- uno::Sequence< beans::PropertyValue > aPropValueSeq =
- ConvertSvxConfigEntry( m_xCommandToLabelMap, pEntry );
-
- uno::Reference< container::XIndexContainer > xSubMenuBar(
- rFactory->createInstanceWithContext( m_xComponentContext ),
- uno::UNO_QUERY );
-
- sal_Int32 nIndex = aPropValueSeq.getLength();
- aPropValueSeq.realloc( nIndex + 1 );
- aPropValueSeq[nIndex].Name = m_aDescriptorContainer;
- aPropValueSeq[nIndex].Value <<= xSubMenuBar;
-
- rMenuBar->insertByIndex(
- rMenuBar->getCount(), uno::makeAny( aPropValueSeq ));
-
- ApplyMenu( xSubMenuBar, rFactory, pEntry );
- }
- else if ( pEntry->IsSeparator() )
- {
- rMenuBar->insertByIndex(
- rMenuBar->getCount(), uno::makeAny( m_aSeparatorSeq ));
- }
- else
- {
- uno::Sequence< beans::PropertyValue > aPropValueSeq =
- ConvertSvxConfigEntry( m_xCommandToLabelMap, pEntry );
- rMenuBar->insertByIndex(
- rMenuBar->getCount(), uno::makeAny( aPropValueSeq ));
- }
- }
-}
-
-void
-MenuSaveInData::Reset()
-{
- GetConfigManager()->reset();
-
- delete pRootEntry;
- pRootEntry = NULL;
-
- try
- {
- m_xMenuSettings = GetConfigManager()->getSettings(
- m_aMenuResourceURL, sal_False );
- }
- catch ( container::NoSuchElementException& )
- {
- // will use default settings
- }
-}
-
-class PopupPainter : public SvLBoxString
-{
-public:
- PopupPainter( SvLBoxEntry* pEntry, const String& rStr )
- : SvLBoxString( pEntry, 0, rStr )
- { }
-
- ~PopupPainter() { }
-
- void Paint( const Point& rPos, SvLBox& rOutDev,
- USHORT nViewDataEntryFlags, SvLBoxEntry* pEntry )
- {
- SvLBoxString::Paint( rPos, rOutDev, nViewDataEntryFlags, pEntry );
-
- Color aOldFillColor = rOutDev.GetFillColor();
-
- SvTreeListBox* pTreeBox = static_cast< SvTreeListBox* >( &rOutDev );
- long nX = pTreeBox->GetSizePixel().Width();
-
- ScrollBar* pVScroll = pTreeBox->GetVScroll();
- if ( pVScroll->IsVisible() )
- {
- nX -= pVScroll->GetSizePixel().Width();
- }
-
- SvViewDataItem* pItem = rOutDev.GetViewDataItem( pEntry, this );
- nX -= pItem->aSize.Height();
-
- long nSize = pItem->aSize.Height() / 2;
- long nHalfSize = nSize / 2;
- long nY = rPos.Y() + nHalfSize;
-
- if ( aOldFillColor == COL_WHITE )
- {
- rOutDev.SetFillColor( Color( COL_BLACK ) );
- }
- else
- {
- rOutDev.SetFillColor( Color( COL_WHITE ) );
- }
-
- long n = 0;
- while ( n <= nHalfSize )
- {
- rOutDev.DrawRect( Rectangle( nX+n, nY+n, nX+n, nY+nSize-n ) );
- n++;
- }
-
- rOutDev.SetFillColor( aOldFillColor );
- }
-};
-
-/******************************************************************************
- *
- * SvxMenuEntriesListBox is the listbox in which the menu items for a
- * particular menu are shown. We have a custom listbox because we need
- * to add drag'n'drop support from the Macro Selector and within the
- * listbox
- *
- *****************************************************************************/
-SvxMenuEntriesListBox::SvxMenuEntriesListBox(
- Window* pParent, const ResId& rResId)
- : SvTreeListBox( pParent, rResId )
- , pPage( (SvxMenuConfigPage*) pParent )
- , m_bIsInternalDrag( FALSE )
-{
- SetWindowBits(
- GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HIDESELECTION );
-
- SetSpaceBetweenEntries( 3 );
- SetEntryHeight( ENTRY_HEIGHT );
-
- SetHighlightRange();
- SetSelectionMode(SINGLE_SELECTION);
-
- SetDragDropMode( SV_DRAGDROP_CTRL_MOVE |
- SV_DRAGDROP_APP_COPY |
- SV_DRAGDROP_ENABLE_TOP |
- SV_DRAGDROP_APP_DROP);
-}
-
-SvxMenuEntriesListBox::~SvxMenuEntriesListBox()
-{
- // do nothing
-}
-
-// drag and drop support
-DragDropMode SvxMenuEntriesListBox::NotifyStartDrag(
- TransferDataContainer& aTransferDataContainer, SvLBoxEntry* pEntry )
-{
- (void)aTransferDataContainer;
- (void)pEntry;
-
- m_bIsInternalDrag = TRUE;
- return GetDragDropMode();
-}
-
-void SvxMenuEntriesListBox::DragFinished( sal_Int8 nDropAction )
-{
- (void)nDropAction;
- m_bIsInternalDrag = FALSE;
-}
-
-sal_Int8 SvxMenuEntriesListBox::AcceptDrop( const AcceptDropEvent& rEvt )
-{
- if ( m_bIsInternalDrag )
- {
- // internal copy isn't allowed!
- if ( rEvt.mnAction == DND_ACTION_COPY )
- return DND_ACTION_NONE;
- else
- return SvTreeListBox::AcceptDrop( rEvt );
- }
-
- // Always do COPY instead of MOVE if D&D comes from outside!
- AcceptDropEvent aNewAcceptDropEvent( rEvt );
- aNewAcceptDropEvent.mnAction = DND_ACTION_COPY;
- return SvTreeListBox::AcceptDrop( aNewAcceptDropEvent );
-}
-
-BOOL SvxMenuEntriesListBox::NotifyAcceptDrop( SvLBoxEntry* )
-{
- return TRUE;
-}
-
-BOOL SvxMenuEntriesListBox::NotifyMoving(
- SvLBoxEntry* pTarget, SvLBoxEntry* pSource,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos)
-{
- // only try to do a move if we are dragging within the list box
- if ( m_bIsInternalDrag )
- {
- if ( pPage->MoveEntryData( pSource, pTarget ) == TRUE )
- {
- SvTreeListBox::NotifyMoving(
- pTarget, pSource, rpNewParent, rNewChildPos );
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- else
- {
- return NotifyCopying( pTarget, pSource, rpNewParent, rNewChildPos );
- }
-}
-
-BOOL SvxMenuEntriesListBox::NotifyCopying(
- SvLBoxEntry* pTarget, SvLBoxEntry* pSource,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos)
-{
- (void)pSource;
- (void)rpNewParent;
- (void)rNewChildPos;
-
- if ( !m_bIsInternalDrag )
- {
- // if the target is NULL then add function to the start of the list
- pPage->AddFunction( pTarget, pTarget == NULL );
-
- // AddFunction already adds the listbox entry so return FALSE
- // to stop another listbox entry being added
- return FALSE;
- }
-
- // Copying is only allowed from external controls, not within the listbox
- return FALSE;
-}
-
-void SvxMenuEntriesListBox::KeyInput( const KeyEvent& rKeyEvent )
-{
- KeyCode keycode = rKeyEvent.GetKeyCode();
-
- // support DELETE for removing the current entry
- if ( keycode == KEY_DELETE )
- {
- pPage->DeleteSelectedContent();
- }
- // support CTRL+UP and CTRL+DOWN for moving selected entries
- else if ( keycode.GetCode() == KEY_UP && keycode.IsMod1() )
- {
- pPage->MoveEntry( TRUE );
- }
- else if ( keycode.GetCode() == KEY_DOWN && keycode.IsMod1() )
- {
- pPage->MoveEntry( FALSE );
- }
- else
- {
- // pass on to superclass
- SvTreeListBox::KeyInput( rKeyEvent );
- }
-}
-
-// class SvxDescriptionEdit ----------------------------------------------
-
-SvxDescriptionEdit::SvxDescriptionEdit( Window* pParent, const ResId& _rId ) :
-
- ExtMultiLineEdit( pParent, _rId )
-
-{
- // calculate the available space for help text
- m_aRealRect = Rectangle( Point(), GetSizePixel() );
- if ( GetVScrollBar() )
- m_aRealRect.Right() -= ( GetVScrollBar()->GetSizePixel().Width() + 4 );
-
- SetLeftMargin(2);
- SetBorderStyle( WINDOW_BORDER_MONO );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxDescriptionEdit::SetNewText( const String& _rText )
-{
- String sTemp( _rText );
- sal_Bool bShow = sal_False;
- if ( sTemp.Len() > 0 )
- {
- // detect if a scrollbar is necessary
- Rectangle aRect = GetTextRect( m_aRealRect, sTemp, TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE );
- bShow = ( aRect.Bottom() > m_aRealRect.Bottom() );
- }
-
- if ( GetVScrollBar() )
- GetVScrollBar()->Show( bShow );
-
- if ( bShow )
- sTemp += '\n';
-
- SetText( sTemp );
-}
-
-/******************************************************************************
- *
- * SvxConfigPage is the abstract base class on which the Menu and Toolbar
- * configuration tabpages are based. It includes methods which are common to
- * both tabpages to add, delete, move and rename items etc.
- *
- *****************************************************************************/
-SvxConfigPage::SvxConfigPage(
- Window *pParent, const SfxItemSet& rSet )
- :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_MENUS ), rSet ),
- bInitialised( FALSE ),
- pCurrentSaveInData( 0 ),
- aTopLevelSeparator( this, SVX_RES( GRP_MENUS ) ),
- aTopLevelLabel( this, SVX_RES( FT_MENUS ) ),
- aTopLevelListBox( this, SVX_RES( LB_MENUS ) ),
- aNewTopLevelButton( this, SVX_RES( BTN_NEW ) ),
- aModifyTopLevelButton( this, SVX_RES( BTN_CHANGE ) ),
- aContentsSeparator( this, SVX_RES( GRP_MENU_SEPARATOR ) ),
- aContentsLabel( this, SVX_RES( GRP_MENU_ENTRIES ) ),
- aContentsListBox( 0 ),
- aAddCommandsButton( this, SVX_RES( BTN_ADD_COMMANDS ) ),
- aModifyCommandButton( this, SVX_RES( BTN_CHANGE_ENTRY ) ),
- aMoveUpButton( this, SVX_RES( BTN_UP ) ),
- aMoveDownButton( this, SVX_RES( BTN_DOWN ) ),
- aSaveInText( this, SVX_RES( TXT_SAVEIN ) ),
- aSaveInListBox( this, SVX_RES( LB_SAVEIN ) ),
- aDescriptionLabel( this, SVX_RES( FT_DESCRIPTION ) ),
- aDescriptionField( this, SVX_RES( ED_DESCRIPTION ) ),
- pSelectorDlg( 0 )
-{
- aDescriptionField.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() );
- aDescriptionField.SetAutoScroll( TRUE );
- aDescriptionField.EnableCursor( FALSE );
-}
-
-SvxConfigPage::~SvxConfigPage()
-{
-}
-
-void SvxConfigPage::Reset( const SfxItemSet& )
-{
- // If we haven't initialised our XMultiServiceFactory reference
- // then Reset is being called at the opening of the dialog.
- //
- // Load menu configuration data for the module of the currently
- // selected document, for the currently selected document, and for
- // all other open documents of the same module type
- if ( !bInitialised )
- {
- USHORT nPos = 0;
- uno::Reference < css::ui::XUIConfigurationManager > xCfgMgr;
- uno::Reference < css::ui::XUIConfigurationManager > xDocCfgMgr;
-
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-
- m_xFrame = GetFrame();
- OUString aModuleId = GetFrameWithDefaultAndIdentify( m_xFrame );
-
- // replace %MODULENAME in the label with the correct module name
- uno::Reference< css::frame::XModuleManager > xModuleManager(
- xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.ModuleManager" ) ) ),
- uno::UNO_QUERY_THROW );
- OUString aModuleName = GetUIModuleName( aModuleId, xModuleManager );
-
- OUString title = aTopLevelSeparator.GetText();
- OUString aSearchString = OUString::createFromAscii( "%MODULENAME" );
- sal_Int32 index = title.indexOf( aSearchString );
-
- if ( index != -1 )
- {
- title = title.replaceAt(
- index, aSearchString.getLength(), aModuleName );
- aTopLevelSeparator.SetText( title );
- }
-
- uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier >
- xModuleCfgSupplier( xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ))),
- uno::UNO_QUERY );
-
- // Set up data for module specific menus
- SaveInData* pModuleData = NULL;
-
- try
- {
- xCfgMgr =
- xModuleCfgSupplier->getUIConfigurationManager( aModuleId );
-
- pModuleData = CreateSaveInData( xCfgMgr,
- uno::Reference< css::ui::XUIConfigurationManager >(),
- aModuleId,
- FALSE );
- }
- catch ( container::NoSuchElementException& )
- {
- }
-
- if ( pModuleData != NULL )
- {
- OUString label;
- utl::ConfigManager::GetDirectConfigProperty(
- utl::ConfigManager::PRODUCTNAME ) >>= label;
- label += OUString::createFromAscii( " " );
- label += aModuleName;
-
- nPos = aSaveInListBox.InsertEntry( label );
- aSaveInListBox.SetEntryData( nPos, pModuleData );
- }
-
- // try to retrieve the document based ui configuration manager
- OUString aTitle;
- uno::Reference< frame::XController > xController =
- m_xFrame->getController();
- if ( CanConfig( aModuleId ) && xController.is() )
- {
- uno::Reference< frame::XModel > xModel( xController->getModel() );
- if ( xModel.is() )
- {
- uno::Reference< css::ui::XUIConfigurationManagerSupplier >
- xCfgSupplier( xModel, uno::UNO_QUERY );
-
- if ( xCfgSupplier.is() )
- {
- xDocCfgMgr = xCfgSupplier->getUIConfigurationManager();
- }
- aTitle = ::comphelper::DocumentInfo::getDocumentTitle( xModel );
- }
- }
-
- SaveInData* pDocData = NULL;
- if ( xDocCfgMgr.is() )
- {
- pDocData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, TRUE );
-
- if ( !pDocData->IsReadOnly() )
- {
- nPos = aSaveInListBox.InsertEntry( aTitle );
- aSaveInListBox.SetEntryData( nPos, pDocData );
- }
- }
-
- // if an item to select has been passed in (eg. the ResourceURL for a
- // toolbar) then try to select the SaveInData entry that has that item
- bool bURLToSelectFound = FALSE;
- if ( m_aURLToSelect.getLength() != 0 )
- {
- if ( pDocData != NULL && pDocData->HasURL( m_aURLToSelect ) )
- {
- aSaveInListBox.SelectEntryPos( nPos, TRUE );
- pCurrentSaveInData = pDocData;
- bURLToSelectFound = TRUE;
- }
- else if ( pModuleData->HasURL( m_aURLToSelect ) )
- {
- aSaveInListBox.SelectEntryPos( 0, TRUE );
- pCurrentSaveInData = pModuleData;
- bURLToSelectFound = TRUE;
- }
- }
-
- if ( bURLToSelectFound == FALSE )
- {
- // if the document has menu configuration settings select it
- // it the SaveIn listbox, otherwise select the module data
- if ( pDocData != NULL && pDocData->HasSettings() )
- {
- aSaveInListBox.SelectEntryPos( nPos, TRUE );
- pCurrentSaveInData = pDocData;
- }
- else
- {
- aSaveInListBox.SelectEntryPos( 0, TRUE );
- pCurrentSaveInData = pModuleData;
- }
- }
-
-#ifdef DBG_UTIL
- DBG_ASSERT( pCurrentSaveInData, "SvxConfigPage::Reset(): no SaveInData" );
-#endif
-
- if ( CanConfig( aModuleId ) )
- {
- // Load configuration for other open documents which have
- // same module type
- uno::Sequence< uno::Reference< frame::XFrame > > aFrameList;
- try
- {
- uno::Reference< frame::XFramesSupplier > xFramesSupplier(
- xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.Desktop" ) ) ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< frame::XFrames > xFrames =
- xFramesSupplier->getFrames();
-
- aFrameList = xFrames->queryFrames(
- frame::FrameSearchFlag::ALL & ~frame::FrameSearchFlag::SELF );
-
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- for ( sal_Int32 i = 0; i < aFrameList.getLength(); i++ )
- {
- SaveInData* pData = NULL;
- uno::Reference < frame::XFrame > xf = aFrameList[i];
-
- if ( xf.is() && xf != m_xFrame )
- {
- OUString aCheckId;
- try{
- aCheckId = xModuleManager->identify( xf );
- } catch(const uno::Exception&)
- { aCheckId = ::rtl::OUString(); }
-
- if ( aModuleId.equals( aCheckId ) )
- {
- // try to get the document based ui configuration manager
- OUString aTitle2;
- uno::Reference< frame::XController > xController_ =
- xf->getController();
-
- if ( xController_.is() )
- {
- uno::Reference< frame::XModel > xModel(
- xController_->getModel() );
-
- if ( xModel.is() )
- {
- uno::Reference<
- css::ui::XUIConfigurationManagerSupplier >
- xCfgSupplier( xModel, uno::UNO_QUERY );
-
- if ( xCfgSupplier.is() )
- {
- xDocCfgMgr =
- xCfgSupplier->getUIConfigurationManager();
- }
- aTitle2 = ::comphelper::DocumentInfo::getDocumentTitle( xModel );
- }
- }
-
- if ( xDocCfgMgr.is() )
- {
- pData = CreateSaveInData( xDocCfgMgr, xCfgMgr, aModuleId, TRUE );
-
- if ( pData && !pData->IsReadOnly() )
- {
- nPos = aSaveInListBox.InsertEntry( aTitle2 );
- aSaveInListBox.SetEntryData( nPos, pData );
- }
- }
- }
- }
- }
- }
-
- aSaveInListBox.SetSelectHdl(
- LINK( this, SvxConfigPage, SelectSaveInLocation ) );
-
- bInitialised = TRUE;
-
- Init();
- }
- else
- {
- if ( QueryReset() == RET_YES )
- {
- // Reset menu configuration for currently selected SaveInData
- GetSaveInData()->Reset();
-
- Init();
- }
- }
-}
-
-::rtl::OUString SvxConfigPage::GetFrameWithDefaultAndIdentify( uno::Reference< frame::XFrame >& _inout_rxFrame )
-{
- ::rtl::OUString sModuleID;
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-
- uno::Reference< frame::XFramesSupplier > xFramesSupplier(
- xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.Desktop" ) ) ),
- uno::UNO_QUERY_THROW );
-
- if ( !_inout_rxFrame.is() )
- _inout_rxFrame = xFramesSupplier->getActiveFrame();
-
- if ( !_inout_rxFrame.is() )
- {
- uno::Reference< frame::XDesktop > xDesktop( xFramesSupplier, uno::UNO_QUERY_THROW );
- _inout_rxFrame = xDesktop->getCurrentFrame();
- }
-
- if ( !_inout_rxFrame.is() && SfxViewFrame::Current() )
- _inout_rxFrame = SfxViewFrame::Current()->GetFrame()->GetFrameInterface();
-
- if ( !_inout_rxFrame.is() )
- {
- DBG_ERRORFILE( "SvxConfigPage::GetFrameWithDefaultAndIdentify(): no frame found!" );
- return sModuleID;
- }
-
- uno::Reference< css::frame::XModuleManager > xModuleManager(
- xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.frame.ModuleManager" ) ) ),
- uno::UNO_QUERY_THROW );
-
- try
- {
- sModuleID = xModuleManager->identify( _inout_rxFrame );
- }
- catch ( const frame::UnknownModuleException& )
- {
- }
-
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return sModuleID;
-}
-
-BOOL SvxConfigPage::FillItemSet( SfxItemSet& )
-{
- bool result = FALSE;
-
- for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); i++ )
- {
- SaveInData* pData =
- (SaveInData*) aSaveInListBox.GetEntryData( i );
-
- result = pData->Apply();
- }
- return result;
-}
-
-void SvxConfigPage::PositionContentsListBox()
-{
- if ( aContentsListBox == NULL )
- {
- return;
- }
-
- Point p, newp;
- Size s, news;
- long x, y, width, height;
-
- // x and width is same as aTopLevelListBox
- x = aTopLevelListBox.GetPosPixel().X();
- width = aTopLevelListBox.GetSizePixel().Width();
-
- // y is same as aAddCommandsButton
- y = aAddCommandsButton.GetPosPixel().Y();
-
- // get gap between aAddCommandsButton and aContentsSeparator
- p = aContentsSeparator.GetPosPixel();
- s = aContentsSeparator.GetSizePixel();
- long gap = y - ( p.Y() + s.Height() );
-
- height = aSaveInListBox.GetPosPixel().Y() - y - gap;
-
- aContentsListBox->SetPosPixel( Point( x, y ) );
- aContentsListBox->SetSizePixel( Size( width, height ) );
-}
-
-IMPL_LINK( SvxConfigPage, SelectSaveInLocation, ListBox *, pBox )
-{
- (void)pBox;
-
- pCurrentSaveInData = (SaveInData*) aSaveInListBox.GetEntryData(
- aSaveInListBox.GetSelectEntryPos());
-
- Init();
- return 1;
-}
-
-void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect )
-{
- USHORT nSelectionPos = aTopLevelListBox.GetSelectEntryPos();
- aTopLevelListBox.Clear();
-
- if ( GetSaveInData() && GetSaveInData()->GetEntries() )
- {
- SvxEntries::const_iterator iter = GetSaveInData()->GetEntries()->begin();
- SvxEntries::const_iterator end = GetSaveInData()->GetEntries()->end();
-
- for ( ; iter != end; iter++ )
- {
- SvxConfigEntry* pEntryData = *iter;
- USHORT nPos = aTopLevelListBox.InsertEntry( stripHotKey( pEntryData->GetName() ) );
- aTopLevelListBox.SetEntryData( nPos, pEntryData );
-
- if ( pEntryData == pToSelect )
- nSelectionPos = nPos;
-
- AddSubMenusToUI( stripHotKey( pEntryData->GetName() ), pEntryData );
- }
- }
-#ifdef DBG_UTIL
- else
- {
- DBG_ASSERT( GetSaveInData(), "SvxConfigPage::ReloadTopLevelListBox(): no SaveInData" );
- DBG_ASSERT( GetSaveInData()->GetEntries() ,
- "SvxConfigPage::ReloadTopLevelListBox(): no SaveInData entries" );
- }
-#endif
-
- nSelectionPos = nSelectionPos < aTopLevelListBox.GetEntryCount() ?
- nSelectionPos : aTopLevelListBox.GetEntryCount() - 1;
-
- aTopLevelListBox.SelectEntryPos( nSelectionPos, TRUE );
- aTopLevelListBox.GetSelectHdl().Call( this );
-}
-
-void SvxConfigPage::AddSubMenusToUI(
- const String& rBaseTitle, SvxConfigEntry* pParentData )
-{
- SvxEntries::const_iterator iter = pParentData->GetEntries()->begin();
- SvxEntries::const_iterator end = pParentData->GetEntries()->end();
-
- for ( ; iter != end; iter++ )
- {
- SvxConfigEntry* pEntryData = *iter;
-
- if ( pEntryData->IsPopup() )
- {
- OUString subMenuTitle( rBaseTitle );
- subMenuTitle += OUString::createFromAscii( pMenuSeparatorStr );
- subMenuTitle += stripHotKey( pEntryData->GetName() );
-
- USHORT nPos = aTopLevelListBox.InsertEntry( subMenuTitle );
- aTopLevelListBox.SetEntryData( nPos, pEntryData );
-
- AddSubMenusToUI( subMenuTitle, pEntryData );
- }
- }
-}
-
-SvxEntries* SvxConfigPage::FindParentForChild(
- SvxEntries* pRootEntries, SvxConfigEntry* pChildData )
-{
- SvxEntries::const_iterator iter = pRootEntries->begin();
- SvxEntries::const_iterator end = pRootEntries->end();
-
- for ( ; iter != end; iter++ )
- {
- SvxConfigEntry* pEntryData = *iter;
-
- if ( pEntryData == pChildData )
- {
- return pRootEntries;
- }
- else if ( pEntryData->IsPopup() )
- {
- SvxEntries* result =
- FindParentForChild( pEntryData->GetEntries(), pChildData );
-
- if ( result != NULL )
- {
- return result;
- }
- }
- }
- return NULL;
-}
-
-SvLBoxEntry* SvxConfigPage::AddFunction(
- SvLBoxEntry* pTarget, bool bFront, bool bAllowDuplicates )
-{
- String aDisplayName = pSelectorDlg->GetSelectedDisplayName();
- String aHelpText = pSelectorDlg->GetSelectedHelpText();
- String aURL = pSelectorDlg->GetScriptURL();
-
- if ( !aURL.Len() )
- {
- return NULL;
- }
-
- SvxConfigEntry* pNewEntryData =
- new SvxConfigEntry( aDisplayName, aURL, FALSE );
- pNewEntryData->SetUserDefined( TRUE );
- pNewEntryData->SetHelpURL( aURL );
-
- // check that this function is not already in the menu
- SvxConfigEntry* pParent = GetTopLevelSelection();
-
- SvxEntries::const_iterator iter = pParent->GetEntries()->begin();
- SvxEntries::const_iterator end = pParent->GetEntries()->end();
-
- if ( !bAllowDuplicates )
- {
- while ( iter != end )
- {
- SvxConfigEntry *pCurEntry = *iter;
-
- if ( pCurEntry->GetCommand() == pNewEntryData->GetCommand() )
- {
- // asynchronous error message, because of MsgBoxes
- PostUserEvent(
- LINK( this, SvxConfigPage, AsyncInfoMsg ) );
- return NULL;
- }
-
- iter++;
- }
- }
-
- return InsertEntry( pNewEntryData, pTarget, bFront );
-}
-
-SvLBoxEntry* SvxConfigPage::InsertEntry(
- SvxConfigEntry* pNewEntryData,
- SvLBoxEntry* pTarget,
- bool bFront )
-{
- // Grab the entries list for the currently selected menu
- SvxEntries* pEntries = GetTopLevelSelection()->GetEntries();
-
- SvLBoxEntry* pNewEntry = NULL;
- SvLBoxEntry* pCurEntry =
- pTarget != NULL ? pTarget : aContentsListBox->GetCurEntry();
-
- if ( bFront )
- {
- pEntries->insert( pEntries->begin(), pNewEntryData );
- pNewEntry = InsertEntryIntoUI( pNewEntryData, 0 );
- }
- else if ( pCurEntry == NULL || pCurEntry == aContentsListBox->Last() )
- {
- pEntries->push_back( pNewEntryData );
- pNewEntry = InsertEntryIntoUI( pNewEntryData );
- }
- else
- {
- SvxConfigEntry* pEntryData =
- (SvxConfigEntry*) pCurEntry->GetUserData();
-
- SvxEntries::iterator iter = pEntries->begin();
- SvxEntries::const_iterator end = pEntries->end();
-
- // Advance the iterator to the data for currently selected entry
- USHORT nPos = 0;
- while (*iter != pEntryData && ++iter != end)
- {
- nPos++;
- }
-
- // Now step past it to the entry after the currently selected one
- iter++;
- nPos++;
-
- // Now add the new entry to the UI and to the parent's list
- if ( iter != end )
- {
- pEntries->insert( iter, pNewEntryData );
- pNewEntry = InsertEntryIntoUI( pNewEntryData, nPos );
- }
- }
-
- if ( pNewEntry != NULL )
- {
- aContentsListBox->Select( pNewEntry );
- aContentsListBox->MakeVisible( pNewEntry );
-
- GetSaveInData()->SetModified( TRUE );
- }
-
- return pNewEntry;
-}
-
-SvLBoxEntry* SvxConfigPage::InsertEntryIntoUI(
- SvxConfigEntry* pNewEntryData, ULONG nPos )
-{
- SvLBoxEntry* pNewEntry = NULL;
-
- if (pNewEntryData->IsSeparator())
- {
- pNewEntry = aContentsListBox->InsertEntry(
- String::CreateFromAscii( pSeparatorStr ),
- 0, FALSE, nPos, pNewEntryData );
- }
- else
- {
- OUString aName = stripHotKey( pNewEntryData->GetName() );
-
- Image aImage = GetSaveInData()->GetImage(
- pNewEntryData->GetCommand());
-
- if ( !!aImage )
- {
- pNewEntry = aContentsListBox->InsertEntry(
- aName, aImage, aImage, 0, FALSE, nPos, pNewEntryData );
- }
- else
- {
- pNewEntry = aContentsListBox->InsertEntry(
- aName, 0, FALSE, nPos, pNewEntryData );
- }
-
- if ( pNewEntryData->IsPopup() ||
- pNewEntryData->GetStyle() & css::ui::ItemStyle::DROP_DOWN )
- {
- // add new popup painter, it gets destructed by the entry
- pNewEntry->ReplaceItem(
- new PopupPainter( pNewEntry, aName ),
- pNewEntry->ItemCount() - 1 );
- }
- }
-
- return pNewEntry;
-}
-
-IMPL_LINK( SvxConfigPage, AsyncInfoMsg, String*, pMsg )
-{
- (void)pMsg;
-
- // Asynchronous msg because of D&D
- InfoBox( this, SVX_RES(
- IBX_MNUCFG_ALREADY_INCLUDED ) ).Execute();
-
- return 0;
-}
-
-IMPL_LINK( SvxConfigPage, MoveHdl, Button *, pButton )
-{
- MoveEntry( pButton == &aMoveUpButton );
- return 0;
-}
-
-void SvxConfigPage::MoveEntry( bool bMoveUp )
-{
- SvLBoxEntry *pSourceEntry = aContentsListBox->FirstSelected();
- SvLBoxEntry *pTargetEntry = NULL;
- SvLBoxEntry *pToSelect = NULL;
-
- if ( !pSourceEntry )
- {
- return;
- }
-
- if ( bMoveUp )
- {
- // Move Up is just a Move Down with the source and target reversed
- pTargetEntry = pSourceEntry;
- pSourceEntry = aContentsListBox->PrevSibling( pTargetEntry );
- pToSelect = pTargetEntry;
- }
- else
- {
- pTargetEntry = aContentsListBox->NextSibling( pSourceEntry );
- pToSelect = pSourceEntry;
- }
-
- if ( MoveEntryData( pSourceEntry, pTargetEntry ) )
- {
- aContentsListBox->GetModel()->Move( pSourceEntry, pTargetEntry );
- aContentsListBox->Select( pToSelect );
- aContentsListBox->MakeVisible( pToSelect );
-
- UpdateButtonStates();
- }
-}
-
-bool SvxConfigPage::MoveEntryData(
- SvLBoxEntry* pSourceEntry, SvLBoxEntry* pTargetEntry )
-{
- //modified by shizhoubo for issue53677
- if ( NULL == pSourceEntry || NULL == pTargetEntry )
- {
- return FALSE;
- }
-
- // Grab the entries list for the currently selected menu
- SvxEntries* pEntries = GetTopLevelSelection()->GetEntries();
-
- SvxConfigEntry* pSourceData =
- (SvxConfigEntry*) pSourceEntry->GetUserData();
-
- if ( pTargetEntry == NULL )
- {
- RemoveEntry( pEntries, pSourceData );
- pEntries->insert(
- pEntries->begin(), pSourceData );
-
- GetSaveInData()->SetModified( TRUE );
-
- return TRUE;
- }
- else
- {
- SvxConfigEntry* pTargetData =
- (SvxConfigEntry*) pTargetEntry->GetUserData();
-
- if ( pSourceData != NULL && pTargetData != NULL )
- {
- // remove the source entry from our list
- RemoveEntry( pEntries, pSourceData );
-
- SvxEntries::iterator iter = pEntries->begin();
- SvxEntries::const_iterator end = pEntries->end();
-
- // advance the iterator to the position of the target entry
- while (*iter != pTargetData && ++iter != end) ;
-
- // insert the source entry at the position after the target
- pEntries->insert( ++iter, pSourceData );
-
- GetSaveInData()->SetModified( TRUE );
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-SvxMenuConfigPage::SvxMenuConfigPage(
- Window *pParent, const SfxItemSet& rSet )
- :
- SvxConfigPage( pParent, rSet )
-{
- aContentsListBox = new SvxMenuEntriesListBox( this, SVX_RES( BOX_ENTRIES ) );
- FreeResource();
-
- PositionContentsListBox();
- aContentsListBox->SetZOrder( &aAddCommandsButton, WINDOW_ZORDER_BEFOR );
-
- aTopLevelListBox.SetSelectHdl(
- LINK( this, SvxMenuConfigPage, SelectMenu ) );
-
- aContentsListBox->SetSelectHdl(
- LINK( this, SvxMenuConfigPage, SelectMenuEntry ) );
-
- aMoveUpButton.SetClickHdl ( LINK( this, SvxConfigPage, MoveHdl) );
- aMoveDownButton.SetClickHdl ( LINK( this, SvxConfigPage, MoveHdl) );
-
- aNewTopLevelButton.SetClickHdl (
- LINK( this, SvxMenuConfigPage, NewMenuHdl ) );
-
- aAddCommandsButton.SetClickHdl (
- LINK( this, SvxMenuConfigPage, AddCommandsHdl ) );
-
- PopupMenu* pMenu = new PopupMenu( SVX_RES( MODIFY_MENU ) );
- pMenu->SetMenuFlags(
- pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES );
-
- aModifyTopLevelButton.SetPopupMenu( pMenu );
- aModifyTopLevelButton.SetSelectHdl(
- LINK( this, SvxMenuConfigPage, MenuSelectHdl ) );
-
- PopupMenu* pEntry = new PopupMenu( SVX_RES( MODIFY_ENTRY ) );
- pEntry->SetMenuFlags(
- pEntry->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES );
-
- aModifyCommandButton.SetPopupMenu( pEntry );
- aModifyCommandButton.SetSelectHdl(
- LINK( this, SvxMenuConfigPage, EntrySelectHdl ) );
-}
-
-// Populates the Menu combo box
-void SvxMenuConfigPage::Init()
-{
- // ensure that the UI is cleared before populating it
- aTopLevelListBox.Clear();
- aContentsListBox->Clear();
-
- ReloadTopLevelListBox();
-
- aTopLevelListBox.SelectEntryPos(0, TRUE);
- aTopLevelListBox.GetSelectHdl().Call(this);
-}
-
-SvxMenuConfigPage::~SvxMenuConfigPage()
-{
- for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); i++ )
- {
- MenuSaveInData* pData =
- (MenuSaveInData*) aSaveInListBox.GetEntryData( i );
-
- delete pData;
- }
-
- if ( pSelectorDlg != NULL )
- {
- delete pSelectorDlg;
- }
-
- delete aContentsListBox;
-}
-
-IMPL_LINK( SvxMenuConfigPage, SelectMenuEntry, Control *, pBox )
-{
- (void)pBox;
-
- UpdateButtonStates();
-
- return 1;
-}
-
-void SvxMenuConfigPage::UpdateButtonStates()
-{
- PopupMenu* pPopup = aModifyCommandButton.GetPopupMenu();
-
- // Disable Up and Down buttons depending on current selection
- SvLBoxEntry* selection = aContentsListBox->GetCurEntry();
-
- if ( aContentsListBox->GetEntryCount() == 0 || selection == NULL )
- {
- aMoveUpButton.Enable( FALSE );
- aMoveDownButton.Enable( FALSE );
-
- pPopup->EnableItem( ID_BEGIN_GROUP, TRUE );
- pPopup->EnableItem( ID_RENAME, FALSE );
- pPopup->EnableItem( ID_DELETE, FALSE );
-
- aDescriptionField.Clear();
-
- return;
- }
-
- SvLBoxEntry* first = aContentsListBox->First();
- SvLBoxEntry* last = aContentsListBox->Last();
-
- aMoveUpButton.Enable( selection != first );
- aMoveDownButton.Enable( selection != last );
-
- SvxConfigEntry* pEntryData =
- (SvxConfigEntry*) selection->GetUserData();
-
- if ( pEntryData->IsSeparator() )
- {
- pPopup->EnableItem( ID_DELETE, TRUE );
- pPopup->EnableItem( ID_BEGIN_GROUP, FALSE );
- pPopup->EnableItem( ID_RENAME, FALSE );
-
- aDescriptionField.Clear();
- }
- else
- {
- pPopup->EnableItem( ID_BEGIN_GROUP, TRUE );
- pPopup->EnableItem( ID_DELETE, TRUE );
- pPopup->EnableItem( ID_RENAME, TRUE );
-
- aDescriptionField.SetNewText( pEntryData->GetHelpText() );
- }
-}
-
-void SvxMenuConfigPage::DeleteSelectedTopLevel()
-{
- SvxConfigEntry* pMenuData = GetTopLevelSelection();
-
- SvxEntries* pParentEntries =
- FindParentForChild( GetSaveInData()->GetEntries(), pMenuData );
-
- RemoveEntry( pParentEntries, pMenuData );
- delete pMenuData;
-
- ReloadTopLevelListBox();
-
- GetSaveInData()->SetModified( TRUE );
-}
-
-bool SvxMenuConfigPage::DeleteSelectedContent()
-{
- SvLBoxEntry *pActEntry = aContentsListBox->FirstSelected();
-
- if ( pActEntry != NULL )
- {
- // get currently selected menu entry
- SvxConfigEntry* pMenuEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- // get currently selected menu
- SvxConfigEntry* pMenu = GetTopLevelSelection();
-
- // remove menu entry from the list for this menu
- RemoveEntry( pMenu->GetEntries(), pMenuEntry );
-
- // remove menu entry from UI
- aContentsListBox->GetModel()->Remove( pActEntry );
-
- // if this is a submenu entry, redraw the menus list box
- if ( pMenuEntry->IsPopup() )
- {
- ReloadTopLevelListBox();
- }
-
- // delete data for menu entry
- delete pMenuEntry;
-
- GetSaveInData()->SetModified( TRUE );
-
- return TRUE;
- }
- return FALSE;
-}
-
-short SvxMenuConfigPage::QueryReset()
-{
- String msg =
- String( SVX_RES( RID_SVXSTR_CONFIRM_MENU_RESET ) );
-
- String saveInName = aSaveInListBox.GetEntry(
- aSaveInListBox.GetSelectEntryPos() );
-
- OUString label = replaceSaveInName( msg, saveInName );
-
- QueryBox qbox( this, WB_YES_NO, label );
-
- return qbox.Execute();
-}
-
-IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox )
-{
- (void)pBox;
-
- aContentsListBox->Clear();
-
- SvxConfigEntry* pMenuData = GetTopLevelSelection();
-
- PopupMenu* pPopup = aModifyTopLevelButton.GetPopupMenu();
- pPopup->EnableItem( ID_DELETE, pMenuData->IsDeletable() );
- pPopup->EnableItem( ID_RENAME, pMenuData->IsRenamable() );
- pPopup->EnableItem( ID_MOVE, pMenuData->IsMovable() );
-
- SvxEntries* pEntries = pMenuData->GetEntries();
- SvxEntries::const_iterator iter = pEntries->begin();
-
- for ( ; iter != pEntries->end(); iter++ )
- {
- SvxConfigEntry* pEntry = *iter;
- InsertEntryIntoUI( pEntry );
- }
-
- UpdateButtonStates();
-
- return 0;
-}
-
-IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
-{
- switch( pButton->GetCurItemId() )
- {
- case ID_DELETE:
- {
- DeleteSelectedTopLevel();
- break;
- }
- case ID_RENAME:
- {
- SvxConfigEntry* pMenuData = GetTopLevelSelection();
-
- String aNewName( stripHotKey( pMenuData->GetName() ) );
- String aDesc = SVX_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
-
- SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU );
- pNameDialog->SetText( SVX_RESSTR( RID_SVXSTR_RENAME_MENU ) );
-
- bool ret = pNameDialog->Execute();
-
- if ( ret == RET_OK ) {
- pNameDialog->GetName( aNewName );
- pMenuData->SetName( aNewName );
-
- ReloadTopLevelListBox();
-
- GetSaveInData()->SetModified( TRUE );
- }
-
- // #i68101# Moemory leak (!)
- delete pNameDialog;
-
- break;
- }
- case ID_MOVE:
- {
- SvxConfigEntry* pMenuData = GetTopLevelSelection();
-
- SvxMainMenuOrganizerDialog* pDialog =
- new SvxMainMenuOrganizerDialog( this,
- GetSaveInData()->GetEntries(), pMenuData );
-
- bool ret = pDialog->Execute();
-
- if ( ret == RET_OK )
- {
- GetSaveInData()->SetEntries( pDialog->GetEntries() );
-
- ReloadTopLevelListBox( pDialog->GetSelectedEntry() );
-
- GetSaveInData()->SetModified( TRUE );
- }
-
- delete pDialog;
-
- break;
- }
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
-{
- switch( pButton->GetCurItemId() )
- {
- case ID_ADD_SUBMENU:
- {
- String aNewName;
- String aDesc = SVX_RESSSTR( RID_SVXSTR_SUBMENU_NAME );
-
- SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
- pNameDialog->SetText( SVX_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
-
- bool ret = pNameDialog->Execute();
-
- if ( ret == RET_OK ) {
- pNameDialog->GetName(aNewName);
-
- SvxConfigEntry* pNewEntryData =
- new SvxConfigEntry( aNewName, aNewName, TRUE );
- pNewEntryData->SetUserDefined( TRUE );
-
- InsertEntry( pNewEntryData );
-
- ReloadTopLevelListBox();
-
- GetSaveInData()->SetModified( TRUE );
- }
-
- delete pNameDialog;
-
- break;
- }
- case ID_BEGIN_GROUP:
- {
- SvxConfigEntry* pNewEntryData = new SvxConfigEntry;
- pNewEntryData->SetUserDefined( TRUE );
- InsertEntry( pNewEntryData );
-
- break;
- }
- case ID_DELETE:
- {
- DeleteSelectedContent();
- break;
- }
- case ID_RENAME:
- {
- SvLBoxEntry* pActEntry = aContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- String aNewName( stripHotKey( pEntry->GetName() ) );
- String aDesc = SVX_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
-
- SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM );
- pNameDialog->SetText( SVX_RESSTR( RID_SVXSTR_RENAME_MENU ) );
-
- bool ret = pNameDialog->Execute();
-
- if ( ret == RET_OK ) {
- pNameDialog->GetName(aNewName);
-
- pEntry->SetName( aNewName );
- aContentsListBox->SetEntryText( pActEntry, aNewName );
-
- GetSaveInData()->SetModified( TRUE );
- }
-
- delete pNameDialog;
-
- break;
- }
- default:
- {
- return FALSE;
- }
- }
-
- if ( GetSaveInData()->IsModified() )
- {
- UpdateButtonStates();
- }
-
- return TRUE;
-}
-
-IMPL_LINK( SvxMenuConfigPage, AddFunctionHdl,
- SvxScriptSelectorDialog *, pDialog )
-{
- (void)pDialog;
-
- AddFunction();
-
- return 0;
-}
-
-IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton )
-{
- (void)pButton;
-
- SvxMainMenuOrganizerDialog* pDialog =
- new SvxMainMenuOrganizerDialog( 0,
- GetSaveInData()->GetEntries(), NULL, TRUE );
-
- bool ret = pDialog->Execute();
-
- if ( ret == RET_OK )
- {
- GetSaveInData()->SetEntries( pDialog->GetEntries() );
- ReloadTopLevelListBox( pDialog->GetSelectedEntry() );
- GetSaveInData()->SetModified( TRUE );
- }
-
- delete pDialog;
-
- return 0;
-}
-
-IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton )
-{
- (void)pButton;
-
- if ( pSelectorDlg == NULL )
- {
- // Create Script Selector which also shows builtin commands
- pSelectorDlg = new SvxScriptSelectorDialog( this, TRUE, m_xFrame );
-
- pSelectorDlg->SetAddHdl(
- LINK( this, SvxMenuConfigPage, AddFunctionHdl ) );
-
- pSelectorDlg->SetDialogDescription( String(
- SVX_RES( RID_SVXSTR_MENU_ADDCOMMANDS_DESCRIPTION ) ) );
- }
-
- // Position the Script Selector over the Add button so it is
- // beside the menu contents list and does not obscure it
- pSelectorDlg->SetPosPixel( aAddCommandsButton.GetPosPixel() );
-
- pSelectorDlg->SetImageProvider(
- static_cast< ImageProvider* >( GetSaveInData() ) );
-
- pSelectorDlg->Show();
- return 1;
-}
-
-SaveInData* SvxMenuConfigPage::CreateSaveInData(
- const uno::Reference< css::ui::XUIConfigurationManager >& xCfgMgr,
- const uno::Reference< css::ui::XUIConfigurationManager >& xParentCfgMgr,
- const OUString& aModuleId,
- bool bDocConfig )
-{
- return static_cast< SaveInData* >(
- new MenuSaveInData( xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig ));
-}
-
-SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
- Window* pParent, SvxEntries* entries,
- SvxConfigEntry* selection, bool bCreateMenu )
- :
- ModalDialog( pParent, SVX_RES( MD_MENU_ORGANISER ) ),
- aMenuNameText( this, SVX_RES( TXT_MENU_NAME ) ),
- aMenuNameEdit( this, SVX_RES( EDIT_MENU_NAME ) ),
- aMenuListText( this, SVX_RES( TXT_MENU ) ),
- aMenuListBox( this, SVX_RES( BOX_MAIN_MENUS ) ),
- aMoveUpButton( this, SVX_RES( BTN_MENU_UP ) ),
- aMoveDownButton( this, SVX_RES( BTN_MENU_DOWN ) ),
- aOKButton( this, SVX_RES( BTN_MENU_ADD ) ),
- aCloseButton( this, SVX_RES( BTN_MENU_CLOSE ) ),
- aHelpButton( this, SVX_RES( BTN_MENU_HELP ) ),
- bModified( FALSE )
-{
- FreeResource();
-
- // Copy the entries list passed in
- if ( entries != NULL )
- {
- SvxConfigEntry* pEntry;
- SvLBoxEntry* pLBEntry;
-
- pEntries = new SvxEntries();
- SvxEntries::const_iterator iter = entries->begin();
-
- while ( iter != entries->end() )
- {
- pEntry = *iter;
- pLBEntry =
- aMenuListBox.InsertEntry( stripHotKey( pEntry->GetName() ) );
- pLBEntry->SetUserData( pEntry );
- pEntries->push_back( pEntry );
-
- if ( pEntry == selection )
- {
- aMenuListBox.Select( pLBEntry );
- }
- iter++;
- }
- }
-
- if ( bCreateMenu )
- {
- // Generate custom name for new menu
- String prefix =
- String( SVX_RES( RID_SVXSTR_NEW_MENU ) );
-
- OUString newname = generateCustomName( prefix, entries );
- OUString newurl = generateCustomMenuURL( pEntries );
-
- SvxConfigEntry* pNewEntryData =
- new SvxConfigEntry( newname, newurl, TRUE );
- pNewEntryData->SetUserDefined( TRUE );
- pNewEntryData->SetMain( TRUE );
-
- pNewMenuEntry =
- aMenuListBox.InsertEntry( stripHotKey( pNewEntryData->GetName() ) );
- aMenuListBox.Select( pNewMenuEntry );
-
- pNewMenuEntry->SetUserData( pNewEntryData );
-
- pEntries->push_back( pNewEntryData );
-
- aMenuNameEdit.SetText( newname );
- aMenuNameEdit.SetModifyHdl(
- LINK( this, SvxMainMenuOrganizerDialog, ModifyHdl ) );
- }
- else
- {
- Point p, newp;
- Size s, news;
-
- // get offset to bottom of name textfield from top of dialog
- p = aMenuNameEdit.GetPosPixel();
- s = aMenuNameEdit.GetSizePixel();
- long offset = p.Y() + s.Height();
-
- // reposition menu list and label
- aMenuListText.SetPosPixel( aMenuNameText.GetPosPixel() );
- aMenuListBox.SetPosPixel( aMenuNameEdit.GetPosPixel() );
-
- // reposition up and down buttons
- p = aMoveUpButton.GetPosPixel();
- newp = Point( p.X(), p.Y() - offset );
- aMoveUpButton.SetPosPixel( newp );
-
- p = aMoveDownButton.GetPosPixel();
- newp = Point( p.X(), p.Y() - offset );
- aMoveDownButton.SetPosPixel( newp );
-
- // change size of dialog
- s = GetSizePixel();
- news = Size( s.Width(), s.Height() - offset );
- SetSizePixel( news );
-
- // hide name label and textfield
- aMenuNameText.Hide();
- aMenuNameEdit.Hide();
-
- // change the title
- SetText( SVX_RES( RID_SVXSTR_MOVE_MENU ) );
- }
-
- aMenuListBox.SetSelectHdl(
- LINK( this, SvxMainMenuOrganizerDialog, SelectHdl ) );
-
- aMoveUpButton.SetClickHdl (
- LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );
- aMoveDownButton.SetClickHdl (
- LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );
-}
-
-IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
-{
- (void)pEdit;
-
- // if the Edit control is empty do not change the name
- if ( aMenuNameEdit.GetText().Equals( String() ) )
- {
- return 0;
- }
-
- SvxConfigEntry* pNewEntryData =
- (SvxConfigEntry*) pNewMenuEntry->GetUserData();
-
- pNewEntryData->SetName( aMenuNameEdit.GetText() );
-
- aMenuListBox.SetEntryText( pNewMenuEntry, pNewEntryData->GetName() );
-
- return 0;
-}
-
-SvxMainMenuOrganizerDialog::~SvxMainMenuOrganizerDialog()
-{
-}
-
-IMPL_LINK( SvxMainMenuOrganizerDialog, SelectHdl, Control*, pCtrl )
-{
- (void)pCtrl;
- UpdateButtonStates();
- return 1;
-}
-
-void SvxMainMenuOrganizerDialog::UpdateButtonStates()
-{
- // Disable Up and Down buttons depending on current selection
- SvLBoxEntry* selection = aMenuListBox.GetCurEntry();
- SvLBoxEntry* first = aMenuListBox.First();
- SvLBoxEntry* last = aMenuListBox.Last();
-
- aMoveUpButton.Enable( selection != first );
- aMoveDownButton.Enable( selection != last );
-}
-
-IMPL_LINK( SvxMainMenuOrganizerDialog, MoveHdl, Button *, pButton )
-{
- SvLBoxEntry *pSourceEntry = aMenuListBox.FirstSelected();
- SvLBoxEntry *pTargetEntry = NULL;
-
- if ( !pSourceEntry )
- {
- return 0;
- }
-
- if ( pButton == &aMoveDownButton )
- {
- pTargetEntry = aMenuListBox.NextSibling( pSourceEntry );
- }
- else if ( pButton == &aMoveUpButton )
- {
- // Move Up is just a Move Down with the source and target reversed
- pTargetEntry = pSourceEntry;
- pSourceEntry = aMenuListBox.PrevSibling( pTargetEntry );
- }
-
- if ( pSourceEntry != NULL && pTargetEntry != NULL )
- {
- SvxConfigEntry* pSourceData =
- (SvxConfigEntry*) pSourceEntry->GetUserData();
- SvxConfigEntry* pTargetData =
- (SvxConfigEntry*) pTargetEntry->GetUserData();
-
- SvxEntries::iterator iter1 = GetEntries()->begin();
- SvxEntries::iterator iter2 = GetEntries()->begin();
- SvxEntries::const_iterator end = GetEntries()->end();
-
- // Advance the iterators to the positions of the source and target
- while (*iter1 != pSourceData && ++iter1 != end) ;
- while (*iter2 != pTargetData && ++iter2 != end) ;
-
- // Now swap the entries in the menu list and in the UI
- if ( iter1 != end && iter2 != end )
- {
- std::swap( *iter1, *iter2 );
- aMenuListBox.GetModel()->Move( pSourceEntry, pTargetEntry );
- aMenuListBox.MakeVisible( pSourceEntry );
-
- bModified = TRUE;
- }
- }
-
- if ( bModified )
- {
- UpdateButtonStates();
- }
-
- return 0;
-}
-
-SvxEntries* SvxMainMenuOrganizerDialog::GetEntries()
-{
- return pEntries;
-}
-
-SvxConfigEntry* SvxMainMenuOrganizerDialog::GetSelectedEntry()
-{
- return (SvxConfigEntry*)aMenuListBox.FirstSelected()->GetUserData();
-}
-
-SvxConfigEntry::SvxConfigEntry(
- const uno::Sequence< beans::PropertyValue >& rProperties,
- const uno::Reference< container::XNameAccess >& rCommandToLabelMap )
- :
- nId( 1 ),
- bPopUp( FALSE ),
- bStrEdited( FALSE ),
- bIsUserDefined( FALSE ),
- bIsMain( FALSE ),
- bIsParentData( FALSE ),
- bIsVisible( TRUE ),
- nStyle( 0 ),
- pEntries( 0 )
-{
- sal_uInt16 nType( css::ui::ItemType::DEFAULT );
- OUString aHelpURL_;
-
- for ( sal_Int32 i = 0; i < rProperties.getLength(); i++ )
- {
- if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL ))
- {
- rProperties[i].Value >>= aCommand;
- }
- else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL ))
- {
- rProperties[i].Value >>= aHelpURL_;
- }
- else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ))
- {
- rProperties[i].Value >>= aLabel;
- }
- else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE ))
- {
- rProperties[i].Value >>= nType;
- }
- }
-
- if ( nType == css::ui::ItemType::DEFAULT )
- {
- uno::Any a;
- try
- {
- a = rCommandToLabelMap->getByName( aCommand );
- bIsUserDefined = FALSE;
- }
- catch ( container::NoSuchElementException& )
- {
- bIsUserDefined = TRUE;
- }
-
- // If custom label not set retrieve it from the command to info service
- if ( aLabel.equals( OUString() ) )
- {
- uno::Sequence< beans::PropertyValue > aPropSeq;
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) )
- {
- aPropSeq[i].Value >>= aLabel;
- break;
- }
- }
- }
- }
- }
-}
-
-const OUString&
-SvxConfigEntry::GetHelpText()
-{
- if ( aHelpText.getLength() == 0 )
- {
- OUString helpid = OUString::createFromAscii( "helpid:" );
- if ( aHelpURL.indexOf( helpid ) != -1 )
- {
- aHelpURL = aHelpURL.copy( helpid.getLength() );
- }
-
- Help* pHelp = Application::GetHelp();
- if ( aHelpURL.toInt32() != 0 )
- {
- aHelpText = pHelp->GetHelpText( aHelpURL.toInt32(), NULL );
- }
-
- if ( aHelpText.getLength() == 0 && aCommand.getLength() != 0 )
- {
- aHelpText = pHelp->GetHelpText( aCommand, NULL );
- }
- }
-
- return aHelpText;
-}
-
-uno::Sequence< beans::PropertyValue >
-SvxConfigEntry::GetProperties(
- const uno::Reference< container::XNameAccess >& rCommandToLabelMap )
-{
- if ( IsSeparator() )
- {
- uno::Sequence< beans::PropertyValue > aPropSeq( 1 );
-
- aPropSeq[0].Name = OUString(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) );
- aPropSeq[0].Value <<= css::ui::ItemType::SEPARATOR_LINE;
-
- return aPropSeq;
- }
-
- static const OUString aDescriptorCommandURL (
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ) );
-
- static const OUString aDescriptorType(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) );
-
- static const OUString aDescriptorLabel(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) );
-
- static const OUString aDescriptorHelpURL(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) );
-
- uno::Sequence< beans::PropertyValue > aPropSeq( 4 );
-
- aPropSeq[0].Name = aDescriptorCommandURL;
- aPropSeq[0].Value <<= rtl::OUString( GetCommand() );
-
- aPropSeq[1].Name = aDescriptorType;
- aPropSeq[1].Value <<= css::ui::ItemType::DEFAULT;
-
- // If the name has not been changed and the name is the same as
- // in the default command to label map then the label can be stored
- // as an empty string.
- // It will be initialised again later using the command to label map.
- aPropSeq[2].Name = aDescriptorLabel;
- if ( HasChangedName() == FALSE && GetCommand().getLength() )
- {
- BOOL isDefaultName = FALSE;
- try
- {
- uno::Any a( rCommandToLabelMap->getByName( GetCommand() ) );
- uno::Sequence< beans::PropertyValue > tmpPropSeq;
- if ( a >>= tmpPropSeq )
- {
- for ( sal_Int32 i = 0; i < tmpPropSeq.getLength(); i++ )
- {
- if ( tmpPropSeq[i].Name.equals( aDescriptorLabel ) )
- {
- OUString tmpLabel;
- tmpPropSeq[i].Value >>= tmpLabel;
-
- if ( tmpLabel.equals( GetName() ) )
- {
- isDefaultName = TRUE;
- }
-
- break;
- }
- }
- }
- }
- catch ( container::NoSuchElementException& )
- {
- // isDefaultName is left as FALSE
- }
-
- if ( isDefaultName )
- {
- aPropSeq[2].Value <<= rtl::OUString();
- }
- else
- {
- aPropSeq[2].Value <<= rtl::OUString( GetName() );
- }
- }
- else
- {
- aPropSeq[2].Value <<= rtl::OUString( GetName() );
- }
-
- aPropSeq[3].Name = aDescriptorHelpURL;
- aPropSeq[3].Value <<= rtl::OUString( GetHelpURL() );
-
- return aPropSeq;
-}
-
-/*
-SvxMenuConfigEntry::SvxMenuConfigEntry(
- const uno::Sequence< beans::PropertyValue >& rProperties,
- const uno::Reference< container::XNameAccess >& rCommandToLabelMap )
- :
- SvxConfigEntry( rProperties, rCommandToLabelMap )
-{
- uno::Reference< container::XIndexAccess > aChildren;
-
- for ( sal_Int32 i = 0; i < rProperties.getLength(); i++ )
- {
- if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_CONTAINER ))
- {
- rProperties[i].Value >>= aChildren;
- }
- }
-
- if ( aChildren.is() )
- {
- SetPopup( TRUE );
- SetEntries( new SvxEntries() );
-
- uno::Sequence< beans::PropertyValue > aProps;
- for ( sal_Int32 i = 0; i < aChildren->getCount(); i++ )
- {
- if ( aChildren->getByIndex( i ) >>= aProps )
- {
- SvxConfigEntry* pEntry =
- new SvxMenuConfigEntry( aProps, rCommandToLabelMap );
- GetEntries()->push_back( pEntry );
- }
- }
- }
-}
-*/
-
-SvxConfigEntry::SvxConfigEntry( const OUString& rDisplayName,
- const OUString& rCommandURL, bool bPopup, bool bParentData )
- : nId( 1 )
- , aLabel(rDisplayName)
- , aCommand(rCommandURL)
- , bPopUp(bPopup)
- , bStrEdited( FALSE )
- , bIsUserDefined( FALSE )
- , bIsMain( FALSE )
- , bIsParentData( bParentData )
- , bIsVisible( TRUE )
- , nStyle( 0 )
- , pEntries( 0 )
-{
- if (bPopUp)
- {
- pEntries = new SvxEntries();
- }
-}
-
-SvxConfigEntry::~SvxConfigEntry()
-{
- if ( pEntries != NULL )
- {
- SvxEntries::const_iterator iter = pEntries->begin();
-
- for ( ; iter != pEntries->end(); iter++ )
- {
- delete *iter;
- }
- delete pEntries;
- }
-}
-
-bool SvxConfigEntry::IsMovable()
-{
- if ( IsPopup() && !IsMain() )
- {
- return FALSE;
- }
- return TRUE;
-}
-
-bool SvxConfigEntry::IsDeletable()
-{
- if ( IsMain() && !IsUserDefined() )
- {
- return FALSE;
- }
- return TRUE;
-}
-
-bool SvxConfigEntry::IsRenamable()
-{
- if ( IsMain() && !IsUserDefined() )
- {
- return FALSE;
- }
- return TRUE;
-}
-
-SvxToolbarConfigPage::SvxToolbarConfigPage(
- Window *pParent, const SfxItemSet& rSet )
- :
- SvxConfigPage( pParent, rSet )
-{
- SetHelpId( HID_SVX_CONFIG_TOOLBAR );
-
- aContentsListBox = new SvxToolbarEntriesListBox(this, SVX_RES(BOX_ENTRIES));
- FreeResource();
- PositionContentsListBox();
- aContentsListBox->SetZOrder( &aAddCommandsButton, WINDOW_ZORDER_BEFOR );
-
- aContentsListBox->SetHelpId( HID_SVX_CONFIG_TOOLBAR_CONTENTS );
- aNewTopLevelButton.SetHelpId( HID_SVX_NEW_TOOLBAR );
- aModifyTopLevelButton.SetHelpId( HID_SVX_MODIFY_TOOLBAR );
- aAddCommandsButton.SetHelpId( HID_SVX_NEW_TOOLBAR_ITEM );
- aModifyCommandButton.SetHelpId( HID_SVX_MODIFY_TOOLBAR_ITEM );
- aSaveInListBox.SetHelpId( HID_SVX_SAVE_IN );
-
- aTopLevelSeparator.SetText(
- SVX_RES ( RID_SVXSTR_PRODUCTNAME_TOOLBARS ) );
-
- aTopLevelLabel.SetText( SVX_RES( RID_SVXSTR_TOOLBAR ) );
- aModifyTopLevelButton.SetText( SVX_RES( RID_SVXSTR_TOOLBAR ) );
- aContentsSeparator.SetText( SVX_RES( RID_SVXSTR_TOOLBAR_CONTENT ) );
- aContentsLabel.SetText( SVX_RES( RID_SVXSTR_COMMANDS ) );
-
- aTopLevelListBox.SetSelectHdl(
- LINK( this, SvxToolbarConfigPage, SelectToolbar ) );
- aContentsListBox->SetSelectHdl(
- LINK( this, SvxToolbarConfigPage, SelectToolbarEntry ) );
-
- aNewTopLevelButton.SetClickHdl (
- LINK( this, SvxToolbarConfigPage, NewToolbarHdl ) );
-
- aAddCommandsButton.SetClickHdl (
- LINK( this, SvxToolbarConfigPage, AddCommandsHdl ) );
-
- aMoveUpButton.SetClickHdl ( LINK( this, SvxToolbarConfigPage, MoveHdl) );
- aMoveDownButton.SetClickHdl ( LINK( this, SvxToolbarConfigPage, MoveHdl) );
- // Always enable Up and Down buttons
- // added for issue i53677 by shizhoubo
- aMoveDownButton.Enable( TRUE );
- aMoveUpButton.Enable( TRUE );
-
- PopupMenu* pMenu = new PopupMenu( SVX_RES( MODIFY_TOOLBAR ) );
- pMenu->SetMenuFlags(
- pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES );
-
- aModifyTopLevelButton.SetPopupMenu( pMenu );
- aModifyTopLevelButton.SetSelectHdl(
- LINK( this, SvxToolbarConfigPage, ToolbarSelectHdl ) );
-
- PopupMenu* pEntry = new PopupMenu(
- SVX_RES( MODIFY_TOOLBAR_CONTENT ) );
- pEntry->SetMenuFlags(
- pEntry->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES );
-
- aModifyCommandButton.SetPopupMenu( pEntry );
- aModifyCommandButton.SetSelectHdl(
- LINK( this, SvxToolbarConfigPage, EntrySelectHdl ) );
-
- // default toolbar to select is standardbar unless a different one
- // has been passed in
- m_aURLToSelect = OUString::createFromAscii( ITEM_TOOLBAR_URL );
- m_aURLToSelect += OUString::createFromAscii( "standardbar" );
-
- const SfxPoolItem* pItem =
- rSet.GetItem( rSet.GetPool()->GetWhich( SID_CONFIG ) );
-
- if ( pItem )
- {
- OUString text = ((const SfxStringItem*)pItem)->GetValue();
- if (text.indexOf(OUString::createFromAscii(ITEM_TOOLBAR_URL)) == 0)
- {
- m_aURLToSelect = text.copy( 0 );
- }
- }
-
- long nTxtW = aTopLevelLabel.GetCtrlTextWidth( aTopLevelLabel.GetText() );
- long nCtrlW = aTopLevelLabel.GetSizePixel().Width();
- if ( nTxtW >= nCtrlW )
- {
- long nDelta = Max( (long)10, nTxtW - nCtrlW );
- Size aNewSz = aTopLevelLabel.GetSizePixel();
- aNewSz.Width() += nDelta;
- aTopLevelLabel.SetSizePixel( aNewSz );
- aNewSz = aTopLevelListBox.GetSizePixel();
- aNewSz.Width() -= nDelta;
- Point aNewPt = aTopLevelListBox.GetPosPixel();
- aNewPt.X() += nDelta;
- aTopLevelListBox.SetPosSizePixel( aNewPt, aNewSz );
- }
-}
-
-SvxToolbarConfigPage::~SvxToolbarConfigPage()
-{
- for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); i++ )
- {
- ToolbarSaveInData* pData =
- (ToolbarSaveInData*) aSaveInListBox.GetEntryData( i );
-
- delete pData;
- }
-
- if ( pSelectorDlg != NULL )
- {
- delete pSelectorDlg;
- }
-
-
- delete aContentsListBox;
-}
-
-void SvxToolbarConfigPage::DeleteSelectedTopLevel()
-{
- USHORT nSelectionPos = aTopLevelListBox.GetSelectEntryPos();
- ToolbarSaveInData* pSaveInData = (ToolbarSaveInData*) GetSaveInData();
- pSaveInData->RemoveToolbar( GetTopLevelSelection() );
-
- if ( aTopLevelListBox.GetEntryCount() > 1 )
- {
- // select next entry after the one being deleted
- // selection position is indexed from 0 so need to
- // subtract one from the entry count
- if ( nSelectionPos != aTopLevelListBox.GetEntryCount() - 1 )
- {
- aTopLevelListBox.SelectEntryPos( nSelectionPos + 1, TRUE );
- }
- else
- {
- aTopLevelListBox.SelectEntryPos( nSelectionPos - 1, TRUE );
- }
- aTopLevelListBox.GetSelectHdl().Call( this );
-
- // and now remove the entry
- aTopLevelListBox.RemoveEntry( nSelectionPos );
- }
- else
- {
- ReloadTopLevelListBox();
- }
-}
-
-bool SvxToolbarConfigPage::DeleteSelectedContent()
-{
- SvLBoxEntry *pActEntry = aContentsListBox->FirstSelected();
-
- if ( pActEntry != NULL )
- {
- // get currently selected entry
- SvxConfigEntry* pEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- SvxConfigEntry* pToolbar = GetTopLevelSelection();
-
- // remove entry from the list for this toolbar
- RemoveEntry( pToolbar->GetEntries(), pEntry );
-
- // remove toolbar entry from UI
- aContentsListBox->GetModel()->Remove( pActEntry );
-
- // delete data for toolbar entry
- delete pEntry;
-
- (( ToolbarSaveInData* ) GetSaveInData())->ApplyToolbar( pToolbar );
- UpdateButtonStates();
-
- // if this is the last entry in the toolbar and it is a user
- // defined toolbar pop up a dialog asking the user if they
- // want to delete the toolbar
- if ( aContentsListBox->GetEntryCount() == 0 &&
- GetTopLevelSelection()->IsDeletable() )
- {
- QueryBox qbox( this,
- SVX_RES( QBX_CONFIRM_DELETE_TOOLBAR ) );
-
- if ( qbox.Execute() == RET_YES )
- {
- DeleteSelectedTopLevel();
- }
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-IMPL_LINK( SvxToolbarConfigPage, MoveHdl, Button *, pButton )
-{
- MoveEntry( pButton == &aMoveUpButton );
- return 0;
-}
-
-void SvxToolbarConfigPage::MoveEntry( bool bMoveUp )
-{
- SvxConfigPage::MoveEntry( bMoveUp );
-
- // Apply change to currently selected toolbar
- SvxConfigEntry* pToolbar = GetTopLevelSelection();
- if ( pToolbar )
- ((ToolbarSaveInData*)GetSaveInData())->ApplyToolbar( pToolbar );
- else
- {
- DBG_ERRORFILE( "SvxToolbarConfigPage::MoveEntry(): no entry" );
- UpdateButtonStates();
- }
-}
-
-IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
-{
- USHORT nSelectionPos = aTopLevelListBox.GetSelectEntryPos();
-
- SvxConfigEntry* pToolbar =
- (SvxConfigEntry*)aTopLevelListBox.GetEntryData( nSelectionPos );
-
- ToolbarSaveInData* pSaveInData = (ToolbarSaveInData*) GetSaveInData();
-
- switch( pButton->GetCurItemId() )
- {
- case ID_DELETE:
- {
- DeleteSelectedTopLevel();
- UpdateButtonStates();
- break;
- }
- case ID_RENAME:
- {
- String aNewName( stripHotKey( pToolbar->GetName() ) );
- String aDesc = SVX_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
-
- SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
- pNameDialog->SetText( SVX_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
-
- bool ret = pNameDialog->Execute();
-
- if ( ret == RET_OK )
- {
- pNameDialog->GetName(aNewName);
-
- pToolbar->SetName( aNewName );
- pSaveInData->ApplyToolbar( pToolbar );
-
- // have to use remove and insert to change the name
- aTopLevelListBox.RemoveEntry( nSelectionPos );
- nSelectionPos =
- aTopLevelListBox.InsertEntry( aNewName, nSelectionPos );
- aTopLevelListBox.SetEntryData( nSelectionPos, pToolbar );
- aTopLevelListBox.SelectEntryPos( nSelectionPos );
- }
-
- delete pNameDialog;
-
- break;
- }
- case ID_DEFAULT_STYLE:
- {
- QueryBox qbox( this,
- SVX_RES( QBX_CONFIRM_RESTORE_DEFAULT ) );
-
- if ( qbox.Execute() == RET_YES )
- {
- ToolbarSaveInData* pSaveInData_ =
- (ToolbarSaveInData*) GetSaveInData();
-
- pSaveInData_->RestoreToolbar( pToolbar );
-
- aTopLevelListBox.GetSelectHdl().Call( this );
- }
-
- break;
- }
- case ID_ICONS_ONLY:
- {
- pToolbar->SetStyle( 0 );
- pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 0 );
-
- aTopLevelListBox.GetSelectHdl().Call( this );
-
- break;
- }
- case ID_TEXT_ONLY:
- {
- pToolbar->SetStyle( 1 );
- pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 1 );
-
- aTopLevelListBox.GetSelectHdl().Call( this );
-
- break;
- }
- case ID_ICONS_AND_TEXT:
- {
- pToolbar->SetStyle( 2 );
- pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 2 );
-
- aTopLevelListBox.GetSelectHdl().Call( this );
-
- break;
- }
- }
- return 1;
-}
-
-IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
-{
- bool bNeedsApply = FALSE;
-
- // get currently selected toolbar
- SvxConfigEntry* pToolbar = GetTopLevelSelection();
-
- switch( pButton->GetCurItemId() )
- {
- case ID_RENAME:
- {
- SvLBoxEntry* pActEntry = aContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- String aNewName( stripHotKey( pEntry->GetName() ) );
- String aDesc = SVX_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
-
- SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
- pNameDialog->SetText( SVX_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
-
- bool ret = pNameDialog->Execute();
-
- if ( ret == RET_OK ) {
- pNameDialog->GetName(aNewName);
-
- pEntry->SetName( aNewName );
- aContentsListBox->SetEntryText( pActEntry, aNewName );
-
- bNeedsApply = TRUE;
- }
-
- delete pNameDialog;
- break;
- }
- case ID_DEFAULT_COMMAND:
- {
- SvLBoxEntry* pActEntry = aContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- USHORT nSelectionPos = 0;
-
- // find position of entry within the list
- for ( USHORT i = 0; i < aContentsListBox->GetEntryCount(); i++ )
- {
- if ( aContentsListBox->GetEntry( 0, i ) == pActEntry )
- {
- nSelectionPos = i;
- break;
- }
- }
-
- ToolbarSaveInData* pSaveInData =
- (ToolbarSaveInData*) GetSaveInData();
-
- OUString aSystemName =
- pSaveInData->GetSystemUIName( pEntry->GetCommand() );
-
- if ( !pEntry->GetName().equals( aSystemName ) )
- {
- pEntry->SetName( aSystemName );
- aContentsListBox->SetEntryText(
- pActEntry, stripHotKey( aSystemName ) );
- bNeedsApply = TRUE;
- }
-
- uno::Sequence< OUString > aURLSeq( 1 );
- aURLSeq[ 0 ] = pEntry->GetCommand();
-
- try
- {
- GetSaveInData()->GetImageManager()->removeImages(
- GetImageType(), aURLSeq );
-
- // reset backup in entry
- pEntry->SetBackupGraphic(
- uno::Reference< graphic::XGraphic >() );
-
- GetSaveInData()->PersistChanges(
- GetSaveInData()->GetImageManager() );
-
- aContentsListBox->GetModel()->Remove( pActEntry );
-
- SvLBoxEntry* pNewLBEntry =
- InsertEntryIntoUI( pEntry, nSelectionPos );
-
- aContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ?
- SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
-
- aContentsListBox->Select( pNewLBEntry );
- aContentsListBox->MakeVisible( pNewLBEntry );
-
- bNeedsApply = TRUE;
- }
- catch ( uno::Exception& )
- {
- OSL_TRACE("Error restoring image");
- }
- break;
- }
- case ID_BEGIN_GROUP:
- {
- SvxConfigEntry* pNewEntryData = new SvxConfigEntry;
- pNewEntryData->SetUserDefined( TRUE );
-
- SvLBoxEntry* pNewLBEntry = InsertEntry( pNewEntryData );
-
- aContentsListBox->SetCheckButtonState(
- pNewLBEntry, SV_BUTTON_TRISTATE );
-
- bNeedsApply = TRUE;
- break;
- }
- case ID_DELETE:
- {
- DeleteSelectedContent();
- break;
- }
- case ID_ICON_ONLY:
- {
- break;
- }
- case ID_TEXT_ONLY:
- {
- break;
- }
- case ID_ICON_AND_TEXT:
- {
- break;
- }
- case ID_CHANGE_SYMBOL:
- {
- SvLBoxEntry* pActEntry = aContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- USHORT nSelectionPos = 0;
-
- // find position of entry within the list
- for ( USHORT i = 0; i < aContentsListBox->GetEntryCount(); i++ )
- {
- if ( aContentsListBox->GetEntry( 0, i ) == pActEntry )
- {
- nSelectionPos = i;
- break;
- }
- }
-
- SvxIconSelectorDialog* pIconDialog =
- new SvxIconSelectorDialog( 0,
- GetSaveInData()->GetImageManager(),
- GetSaveInData()->GetParentImageManager() );
-
- bool ret = pIconDialog->Execute();
-
- if ( ret == RET_OK )
- {
- uno::Reference< graphic::XGraphic > newgraphic =
- pIconDialog->GetSelectedIcon();
-
- if ( newgraphic.is() )
- {
- uno::Sequence< uno::Reference< graphic::XGraphic > >
- aGraphicSeq( 1 );
-
- uno::Sequence< OUString > aURLSeq( 1 );
- aURLSeq[ 0 ] = pEntry->GetCommand();
-
- if ( !pEntry->GetBackupGraphic().is() )
- {
- uno::Reference< graphic::XGraphic > backup;
- backup = GetGraphic(
- GetSaveInData()->GetImageManager(), aURLSeq[ 0 ] );
-
- if ( backup.is() )
- {
- pEntry->SetBackupGraphic( backup );
- }
- }
-
- aGraphicSeq[ 0 ] = newgraphic;
- try
- {
- GetSaveInData()->GetImageManager()->replaceImages(
- GetImageType(), aURLSeq, aGraphicSeq );
-
- Image aImage( newgraphic );
-
- aContentsListBox->GetModel()->Remove( pActEntry );
- SvLBoxEntry* pNewLBEntry =
- InsertEntryIntoUI( pEntry, nSelectionPos );
-
- aContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ?
- SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
-
- aContentsListBox->Select( pNewLBEntry );
- aContentsListBox->MakeVisible( pNewLBEntry );
-
- GetSaveInData()->PersistChanges(
- GetSaveInData()->GetImageManager() );
- }
- catch ( uno::Exception& )
- {
- OSL_TRACE("Error replacing image");
- }
- }
- }
-
- delete pIconDialog;
-
- break;
- }
- case ID_RESET_SYMBOL:
- {
- SvLBoxEntry* pActEntry = aContentsListBox->GetCurEntry();
- SvxConfigEntry* pEntry =
- (SvxConfigEntry*) pActEntry->GetUserData();
-
- USHORT nSelectionPos = 0;
-
- // find position of entry within the list
- for ( USHORT i = 0; i < aContentsListBox->GetEntryCount(); i++ )
- {
- if ( aContentsListBox->GetEntry( 0, i ) == pActEntry )
- {
- nSelectionPos = i;
- break;
- }
- }
-
- uno::Reference< graphic::XGraphic > backup =
- pEntry->GetBackupGraphic();
-
- uno::Sequence< uno::Reference< graphic::XGraphic > >
- aGraphicSeq( 1 );
- aGraphicSeq[ 0 ] = backup;
-
- uno::Sequence< OUString > aURLSeq( 1 );
- aURLSeq[ 0 ] = pEntry->GetCommand();
-
- try
- {
- GetSaveInData()->GetImageManager()->replaceImages(
- GetImageType(), aURLSeq, aGraphicSeq );
-
- Image aImage( backup );
- aContentsListBox->GetModel()->Remove( pActEntry );
-
- SvLBoxEntry* pNewLBEntry =
- InsertEntryIntoUI( pEntry, nSelectionPos );
-
- aContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ?
- SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
-
- aContentsListBox->Select( pNewLBEntry );
- aContentsListBox->MakeVisible( pNewLBEntry );
-
- // reset backup in entry
- pEntry->SetBackupGraphic(
- uno::Reference< graphic::XGraphic >() );
-
- GetSaveInData()->PersistChanges(
- GetSaveInData()->GetImageManager() );
- }
- catch ( uno::Exception& )
- {
- OSL_TRACE("Error resetting image");
- }
- break;
- }
- }
-
- if ( bNeedsApply == TRUE )
- {
- (( ToolbarSaveInData* ) GetSaveInData())->ApplyToolbar( pToolbar );
- UpdateButtonStates();
- }
-
- return 1;
-}
-
-void SvxToolbarConfigPage::Init()
-{
- // ensure that the UI is cleared before populating it
- aTopLevelListBox.Clear();
- aContentsListBox->Clear();
-
- ReloadTopLevelListBox();
-
- USHORT nPos = 0;
- if ( m_aURLToSelect.getLength() != 0 )
- {
- for ( USHORT i = 0 ; i < aTopLevelListBox.GetEntryCount(); i++ )
- {
- SvxConfigEntry* pData =
- (SvxConfigEntry*) aTopLevelListBox.GetEntryData( i );
-
- if ( pData->GetCommand().equals( m_aURLToSelect ) )
- {
- nPos = i;
- break;
- }
- }
-
- // in future select the default toolbar: Standard
- m_aURLToSelect = OUString::createFromAscii( ITEM_TOOLBAR_URL );
- m_aURLToSelect += OUString::createFromAscii( "standardbar" );
- }
-
- aTopLevelListBox.SelectEntryPos(nPos, TRUE);
- aTopLevelListBox.GetSelectHdl().Call(this);
-}
-
-SaveInData* SvxToolbarConfigPage::CreateSaveInData(
- const uno::Reference< css::ui::XUIConfigurationManager >& xCfgMgr,
- const uno::Reference< css::ui::XUIConfigurationManager >& xParentCfgMgr,
- const OUString& aModuleId,
- bool bDocConfig )
-{
- return static_cast< SaveInData* >(
- new ToolbarSaveInData( xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig ));
-}
-
-ToolbarSaveInData::ToolbarSaveInData(
- const uno::Reference < css::ui::XUIConfigurationManager >& xCfgMgr,
- const uno::Reference < css::ui::XUIConfigurationManager >& xParentCfgMgr,
- const OUString& aModuleId,
- bool docConfig ) :
-
- SaveInData ( xCfgMgr, xParentCfgMgr, aModuleId, docConfig ),
- pRootEntry ( NULL ),
- m_aDescriptorContainer ( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) )
-
-{
- // Initialize the m_xPersistentWindowState variable which is used
- // to get the default properties of system toolbars such as name
- uno::Reference< container::XNameAccess > xPWSS(
- m_xServiceManager->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ui.WindowStateConfiguration" ) ) ),
- uno::UNO_QUERY );
-
- if ( xPWSS.is() )
- xPWSS->getByName( aModuleId ) >>= m_xPersistentWindowState;
-}
-
-ToolbarSaveInData::~ToolbarSaveInData()
-{
- delete pRootEntry;
-}
-
-void ToolbarSaveInData::SetSystemStyle(
- uno::Reference< frame::XFrame > xFrame,
- const OUString& rResourceURL,
- sal_Int32 nStyle )
-{
- // change the style using the API
- SetSystemStyle( rResourceURL, nStyle );
-
- // this code is a temporary hack as the UI is not updating after
- // changing the toolbar style via the API
- uno::Reference< css::frame::XLayoutManager > xLayoutManager;
- Window *window = NULL;
-
- uno::Reference< beans::XPropertySet > xPropSet( xFrame, uno::UNO_QUERY );
- if ( xPropSet.is() )
- {
- uno::Any a = xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) );
- a >>= xLayoutManager;
- }
-
- if ( xLayoutManager.is() )
- {
- uno::Reference< css::ui::XUIElement > xUIElement =
- xLayoutManager->getElement( rResourceURL );
-
- // check reference before we call getRealInterface. The layout manager
- // can only provide references for elements that have been created
- // before. It's possible that the current element is not available.
- uno::Reference< com::sun::star::awt::XWindow > xWindow;
- if ( xUIElement.is() )
- xWindow = uno::Reference< com::sun::star::awt::XWindow >(
- xUIElement->getRealInterface(), uno::UNO_QUERY );
-
- window = VCLUnoHelper::GetWindow( xWindow );
- }
-
- if ( window != NULL && window->GetType() == WINDOW_TOOLBOX )
- {
- ToolBox* toolbox = (ToolBox*)window;
-
- if ( nStyle == 0 )
- {
- toolbox->SetButtonType( BUTTON_SYMBOL );
- }
- else if ( nStyle == 1 )
- {
- toolbox->SetButtonType( BUTTON_TEXT );
- }
- if ( nStyle == 2 )
- {
- toolbox->SetButtonType( BUTTON_SYMBOLTEXT );
- }
- }
-}
-
-void ToolbarSaveInData::SetSystemStyle(
- const OUString& rResourceURL,
- sal_Int32 nStyle )
-{
- if ( rResourceURL.indexOf( OUString::createFromAscii( "private" ) ) == 0 &&
- m_xPersistentWindowState.is() &&
- m_xPersistentWindowState->hasByName( rResourceURL ) )
- {
- try
- {
- uno::Sequence< beans::PropertyValue > aProps;
-
- uno::Any a( m_xPersistentWindowState->getByName( rResourceURL ) );
-
- if ( a >>= aProps )
- {
- for ( sal_Int32 i = 0; i < aProps.getLength(); i++ )
- {
- if ( aProps[ i ].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE) )
- {
- aProps[ i ].Value = uno::makeAny( nStyle );
- break;
- }
- }
- }
-
- uno::Reference< container::XNameReplace >
- xNameReplace( m_xPersistentWindowState, uno::UNO_QUERY );
-
- xNameReplace->replaceByName( rResourceURL, uno::makeAny( aProps ) );
- }
- catch ( uno::Exception& )
- {
- // do nothing, a default value is returned
- OSL_TRACE("Exception setting toolbar style");
- }
- }
-}
-
-sal_Int32 ToolbarSaveInData::GetSystemStyle( const OUString& rResourceURL )
-{
- sal_Int32 result = 0;
-
- if ( rResourceURL.indexOf( OUString::createFromAscii( "private" ) ) == 0 &&
- m_xPersistentWindowState.is() &&
- m_xPersistentWindowState->hasByName( rResourceURL ) )
- {
- try
- {
- uno::Sequence< beans::PropertyValue > aProps;
- uno::Any a( m_xPersistentWindowState->getByName( rResourceURL ) );
-
- if ( a >>= aProps )
- {
- for ( sal_Int32 i = 0; i < aProps.getLength(); i++ )
- {
- if ( aProps[ i ].Name.equalsAscii( ITEM_DESCRIPTOR_STYLE) )
- {
- aProps[i].Value >>= result;
- break;
- }
- }
- }
- }
- catch ( uno::Exception& )
- {
- // do nothing, a default value is returned
- }
- }
-
- return result;
-}
-
-OUString ToolbarSaveInData::GetSystemUIName( const OUString& rResourceURL )
-{
- OUString result;
-
- if ( rResourceURL.indexOf( OUString::createFromAscii( "private" ) ) == 0 &&
- m_xPersistentWindowState.is() &&
- m_xPersistentWindowState->hasByName( rResourceURL ) )
- {
- try
- {
- uno::Sequence< beans::PropertyValue > aProps;
- uno::Any a( m_xPersistentWindowState->getByName( rResourceURL ) );
-
- if ( a >>= aProps )
- {
- for ( sal_Int32 i = 0; i < aProps.getLength(); i++ )
- {
- if ( aProps[ i ].Name.equalsAscii( ITEM_DESCRIPTOR_UINAME) )
- {
- aProps[ i ].Value >>= result;
- }
- }
- }
- }
- catch ( uno::Exception& )
- {
- // do nothing, an empty UIName will be returned
- }
- }
-
- if ( rResourceURL.indexOf( OUString::createFromAscii( ".uno" ) ) == 0 &&
- m_xCommandToLabelMap.is() &&
- m_xCommandToLabelMap->hasByName( rResourceURL ) )
- {
- uno::Any a;
- try
- {
- a = m_xCommandToLabelMap->getByName( rResourceURL );
-
- uno::Sequence< beans::PropertyValue > aPropSeq;
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) )
- {
- aPropSeq[i].Value >>= result;
- }
- }
- }
- }
- catch ( uno::Exception& )
- {
- // not a system command name
- }
- }
-
- return result;
-}
-
-bool EntrySort( SvxConfigEntry* a, SvxConfigEntry* b )
-{
- return a->GetName().compareTo( b->GetName() ) < 0;
-}
-
-SvxEntries* ToolbarSaveInData::GetEntries()
-{
- typedef ::std::hash_map< ::rtl::OUString,
- bool,
- ::rtl::OUStringHash,
- ::std::equal_to< ::rtl::OUString > > ToolbarInfo;
-
- ToolbarInfo aToolbarInfo;
-
- if ( pRootEntry == NULL )
- {
-
- pRootEntry = new SvxConfigEntry(
- String::CreateFromAscii("MainToolbars"), String(), TRUE );
-
- uno::Sequence< uno::Sequence < beans::PropertyValue > > info =
- GetConfigManager()->getUIElementsInfo(
- css::ui::UIElementType::TOOLBAR );
-
- for ( sal_Int32 i = 0; i < info.getLength(); i++ )
- {
- uno::Sequence< beans::PropertyValue > props = info[ i ];
-
- OUString url;
- OUString systemname;
- OUString uiname;
-
- for ( sal_Int32 j = 0; j < props.getLength(); j++ )
- {
- if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_RESOURCEURL) )
- {
- props[ j ].Value >>= url;
- systemname = url.copy( url.lastIndexOf( '/' ) + 1 );
- }
- else if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_UINAME) )
- {
- props[ j ].Value >>= uiname;
- }
- }
-
- try
- {
- uno::Reference< container::XIndexAccess > xToolbarSettings =
- GetConfigManager()->getSettings( url, sal_False );
-
- if ( uiname.getLength() == 0 )
- {
- // try to get the name from m_xPersistentWindowState
- uiname = GetSystemUIName( url );
-
- if ( uiname.getLength() == 0 )
- {
- uiname = systemname;
- }
- }
-
- SvxConfigEntry* pEntry = new SvxConfigEntry(
- uiname, url, TRUE );
-
- pEntry->SetMain( TRUE );
- pEntry->SetStyle( GetSystemStyle( url ) );
-
-
- // insert into hash_map to filter duplicates from the parent
- aToolbarInfo.insert( ToolbarInfo::value_type( systemname, true ));
-
- OUString custom = OUString::createFromAscii(CUSTOM_TOOLBAR_STR);
- if ( systemname.indexOf( custom ) == 0 )
- {
- pEntry->SetUserDefined( TRUE );
- }
- else
- {
- pEntry->SetUserDefined( FALSE );
- }
-
- pRootEntry->GetEntries()->push_back( pEntry );
-
- LoadToolbar( xToolbarSettings, pEntry );
- }
- catch ( container::NoSuchElementException& )
- {
- // TODO, handle resourceURL with no settings
- }
- }
-
- uno::Reference< css::ui::XUIConfigurationManager > xParentCfgMgr = GetParentConfigManager();
- if ( xParentCfgMgr.is() )
- {
- // Retrieve also the parent toolbars to make it possible
- // to configure module toolbars and save them into the document
- // config manager.
- uno::Sequence< uno::Sequence < beans::PropertyValue > > info_ =
- xParentCfgMgr->getUIElementsInfo(
- css::ui::UIElementType::TOOLBAR );
-
- for ( sal_Int32 i = 0; i < info_.getLength(); i++ )
- {
- uno::Sequence< beans::PropertyValue > props = info_[ i ];
-
- OUString url;
- OUString systemname;
- OUString uiname;
-
- for ( sal_Int32 j = 0; j < props.getLength(); j++ )
- {
- if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_RESOURCEURL) )
- {
- props[ j ].Value >>= url;
- systemname = url.copy( url.lastIndexOf( '/' ) + 1 );
- }
- else if ( props[ j ].Name.equalsAscii( ITEM_DESCRIPTOR_UINAME) )
- {
- props[ j ].Value >>= uiname;
- }
- }
-
- // custom toolbars of the parent are not visible in the document layer
- OUString custom = OUString::createFromAscii(CUSTOM_TOOLBAR_STR);
- if ( systemname.indexOf( custom ) == 0 )
- continue;
-
- // check if toolbar is already in the document layer
- ToolbarInfo::const_iterator pIter = aToolbarInfo.find( systemname );
- if ( pIter == aToolbarInfo.end() )
- {
- aToolbarInfo.insert( ToolbarInfo::value_type( systemname, true ));
-
- try
- {
- uno::Reference< container::XIndexAccess > xToolbarSettings =
- xParentCfgMgr->getSettings( url, sal_False );
-
- if ( uiname.getLength() == 0 )
- {
- // try to get the name from m_xPersistentWindowState
- uiname = GetSystemUIName( url );
-
- if ( uiname.getLength() == 0 )
- {
- uiname = systemname;
- }
- }
-
- SvxConfigEntry* pEntry = new SvxConfigEntry(
- uiname, url, TRUE, TRUE );
-
- pEntry->SetMain( TRUE );
- pEntry->SetStyle( GetSystemStyle( url ) );
-
- if ( systemname.indexOf( custom ) == 0 )
- {
- pEntry->SetUserDefined( TRUE );
- }
- else
- {
- pEntry->SetUserDefined( FALSE );
- }
-
- pRootEntry->GetEntries()->push_back( pEntry );
-
- LoadToolbar( xToolbarSettings, pEntry );
- }
- catch ( container::NoSuchElementException& )
- {
- // TODO, handle resourceURL with no settings
- }
- }
- }
- }
-
- std::sort( GetEntries()->begin(), GetEntries()->end(), EntrySort );
- }
-
- return pRootEntry->GetEntries();
-}
-
-void
-ToolbarSaveInData::SetEntries( SvxEntries* pNewEntries )
-{
- // delete old menu hierarchy first
- if ( pRootEntry != NULL && pRootEntry->GetEntries() != NULL )
- {
- delete pRootEntry->GetEntries();
- }
-
- // now set new menu hierarchy
- pRootEntry->SetEntries( pNewEntries );
-}
-
-bool
-ToolbarSaveInData::HasURL( const OUString& rURL )
-{
- SvxEntries::const_iterator iter = GetEntries()->begin();
- SvxEntries::const_iterator end = GetEntries()->end();
-
- while ( iter != end )
- {
- SvxConfigEntry* pEntry = *iter;
-
- if ( pEntry->GetCommand().equals( rURL ) )
- {
- if ( pEntry->IsParentData() )
- return FALSE;
- else
- return TRUE;
- }
-
- iter++;
- }
- return FALSE;
-}
-
-bool ToolbarSaveInData::HasSettings()
-{
- // return true if there is at least one toolbar entry
- if ( GetEntries()->size() > 0 )
- {
- return TRUE;
- }
- return FALSE;
-}
-
-void ToolbarSaveInData::Reset()
-{
- SvxEntries::const_iterator toolbars = GetEntries()->begin();
- SvxEntries::const_iterator end = GetEntries()->end();
-
- // reset each toolbar by calling removeSettings for it's toolbar URL
- for ( ; toolbars != end; toolbars++ )
- {
- SvxConfigEntry* pToolbar = *toolbars;
-
- try
- {
- OUString url = pToolbar->GetCommand();
- GetConfigManager()->removeSettings( url );
- }
- catch ( uno::Exception& )
- {
- // error occured removing the settings
- // TODO - add error dialog in future?
- }
- }
-
- // persist changes to toolbar storage
- PersistChanges( GetConfigManager() );
-
- // now delete the root SvxConfigEntry the next call to GetEntries()
- // causes it to be reinitialised
- delete pRootEntry;
- pRootEntry = NULL;
-
- // reset all icons to default
- try
- {
- GetImageManager()->reset();
- PersistChanges( GetImageManager() );
- }
- catch ( uno::Exception& )
- {
- OSL_TRACE("Error resetting all icons when resetting toolbars");
- }
-}
-
-bool ToolbarSaveInData::Apply()
-{
- // toolbar changes are instantly applied
- return FALSE;
-}
-
-void ToolbarSaveInData::ApplyToolbar(
- uno::Reference< container::XIndexContainer >& rToolbarBar,
- uno::Reference< lang::XSingleComponentFactory >& rFactory,
- SvxConfigEntry* pToolbarData )
-{
- SvxEntries::const_iterator iter = pToolbarData->GetEntries()->begin();
- SvxEntries::const_iterator end = pToolbarData->GetEntries()->end();
-
- for ( ; iter != end; iter++ )
- {
- SvxConfigEntry* pEntry = *iter;
-
- if ( pEntry->IsPopup() )
- {
- uno::Sequence< beans::PropertyValue > aPropValueSeq =
- ConvertToolbarEntry( m_xCommandToLabelMap, pEntry );
-
- uno::Reference< container::XIndexContainer > xSubMenuBar(
- rFactory->createInstanceWithContext( m_xComponentContext ),
- uno::UNO_QUERY );
-
- sal_Int32 nIndex = aPropValueSeq.getLength();
- aPropValueSeq.realloc( nIndex + 1 );
- aPropValueSeq[nIndex].Name = m_aDescriptorContainer;
- aPropValueSeq[nIndex].Value <<= xSubMenuBar;
- rToolbarBar->insertByIndex(
- rToolbarBar->getCount(), uno::makeAny( aPropValueSeq ));
-
- ApplyToolbar( xSubMenuBar, rFactory, pEntry );
- }
- else if ( pEntry->IsSeparator() )
- {
- rToolbarBar->insertByIndex(
- rToolbarBar->getCount(), uno::makeAny( m_aSeparatorSeq ));
- }
- else
- {
- uno::Sequence< beans::PropertyValue > aPropValueSeq =
- ConvertToolbarEntry( m_xCommandToLabelMap, pEntry );
-
- rToolbarBar->insertByIndex(
- rToolbarBar->getCount(), uno::makeAny( aPropValueSeq ));
- }
- }
-}
-
-void ToolbarSaveInData::ApplyToolbar( SvxConfigEntry* pToolbar )
-{
- // Apply new toolbar structure to our settings container
- uno::Reference< container::XIndexAccess > xSettings(
- GetConfigManager()->createSettings(), uno::UNO_QUERY );
-
- uno::Reference< container::XIndexContainer > xIndexContainer (
- xSettings, uno::UNO_QUERY );
-
- uno::Reference< lang::XSingleComponentFactory > xFactory (
- xSettings, uno::UNO_QUERY );
-
- ApplyToolbar( xIndexContainer, xFactory, pToolbar );
-
- uno::Reference< beans::XPropertySet > xProps(
- xSettings, uno::UNO_QUERY );
-
- if ( pToolbar->IsUserDefined() )
- {
- xProps->setPropertyValue(
- OUString::createFromAscii( ITEM_DESCRIPTOR_UINAME ),
- uno::makeAny( OUString( pToolbar->GetName() ) ) );
- }
-
- try
- {
- if ( GetConfigManager()->hasSettings( pToolbar->GetCommand() ) )
- {
- GetConfigManager()->replaceSettings(
- pToolbar->GetCommand(), xSettings );
- }
- else
- {
- GetConfigManager()->insertSettings(
- pToolbar->GetCommand(), xSettings );
- if ( pToolbar->IsParentData() )
- pToolbar->SetParentData( false );
- }
- }
- catch ( container::NoSuchElementException& )
- {
- OSL_TRACE("caught container::NoSuchElementException saving settings");
- }
- catch ( com::sun::star::io::IOException& )
- {
- OSL_TRACE("caught IOException saving settings");
- }
- catch ( com::sun::star::uno::Exception& )
- {
- OSL_TRACE("caught some other exception saving settings");
- }
-
- PersistChanges( GetConfigManager() );
-}
-
-void ToolbarSaveInData::CreateToolbar( SvxConfigEntry* pToolbar )
-{
- // show the new toolbar in the UI also
- uno::Reference< container::XIndexAccess >
- xSettings( GetConfigManager()->createSettings(), uno::UNO_QUERY );
-
- uno::Reference< container::XIndexContainer >
- xIndexContainer ( xSettings, uno::UNO_QUERY );
-
- uno::Reference< beans::XPropertySet >
- xPropertySet( xSettings, uno::UNO_QUERY );
-
- xPropertySet->setPropertyValue(
- OUString::createFromAscii( ITEM_DESCRIPTOR_UINAME ),
- uno::makeAny( pToolbar->GetName() ) );
-
- try
- {
- GetConfigManager()->insertSettings( pToolbar->GetCommand(), xSettings );
- }
- catch ( container::ElementExistException& )
- {
- OSL_TRACE("caught ElementExistsException saving settings");
- }
- catch ( com::sun::star::lang::IllegalArgumentException& )
- {
- OSL_TRACE("caught IOException saving settings");
- }
- catch ( com::sun::star::lang::IllegalAccessException& )
- {
- OSL_TRACE("caught IOException saving settings");
- }
- catch ( com::sun::star::uno::Exception& )
- {
- OSL_TRACE("caught some other exception saving settings");
- }
-
- GetEntries()->push_back( pToolbar );
-
- PersistChanges( GetConfigManager() );
-}
-
-void ToolbarSaveInData::RemoveToolbar( SvxConfigEntry* pToolbar )
-{
- try
- {
- OUString url = pToolbar->GetCommand();
- GetConfigManager()->removeSettings( url );
- RemoveEntry( GetEntries(), pToolbar );
- delete pToolbar;
-
- PersistChanges( GetConfigManager() );
-
- // remove the persistent window state data
- css::uno::Reference< css::container::XNameContainer > xNameContainer(
- m_xPersistentWindowState, css::uno::UNO_QUERY_THROW );
-
- xNameContainer->removeByName( url );
- }
- catch ( uno::Exception& )
- {
- // error occured removing the settings
- }
-}
-
-void ToolbarSaveInData::RestoreToolbar( SvxConfigEntry* pToolbar )
-{
- OUString url = pToolbar->GetCommand();
-
- // Restore of toolbar is done by removing it from
- // it's configuration manager and then getting it again
- bool bParentToolbar = pToolbar->IsParentData();
-
- // Cannot restore parent toolbar
- if ( bParentToolbar )
- return;
-
- try
- {
- GetConfigManager()->removeSettings( url );
- pToolbar->GetEntries()->clear();
- PersistChanges( GetConfigManager() );
- }
- catch ( uno::Exception& )
- {
- // if an error occurs removing the settings then just return
- return;
- }
-
- // Now reload the toolbar settings
- try
- {
- uno::Reference< container::XIndexAccess > xToolbarSettings;
- if ( IsDocConfig() )
- {
- xToolbarSettings = GetParentConfigManager()->getSettings( url, sal_False );
- pToolbar->SetParentData( true );
- }
- else
- xToolbarSettings = GetConfigManager()->getSettings( url, sal_False );
-
- LoadToolbar( xToolbarSettings, pToolbar );
-
- // After reloading, ensure that the icon is reset of each entry
- // in the toolbar
- SvxEntries::const_iterator iter = pToolbar->GetEntries()->begin();
- uno::Sequence< OUString > aURLSeq( 1 );
- for ( ; iter != pToolbar->GetEntries()->end(); iter++ )
- {
- SvxConfigEntry* pEntry = *iter;
- aURLSeq[ 0 ] = pEntry->GetCommand();
-
- try
- {
- GetImageManager()->removeImages( GetImageType(), aURLSeq );
- }
- catch ( uno::Exception& )
- {
- OSL_TRACE("Error restoring icon when resetting toolbar");
- }
- }
- PersistChanges( GetImageManager() );
- }
- catch ( container::NoSuchElementException& )
- {
- // cannot find the resource URL after removing it
- // so no entry will appear in the toolbar list
- }
-}
-
-void ToolbarSaveInData::ReloadToolbar( const OUString& rResourceURL )
-{
- SvxEntries::const_iterator iter = GetEntries()->begin();
- SvxConfigEntry* pToolbar = NULL;
-
- for ( ; iter != GetEntries()->end(); iter++ )
- {
- SvxConfigEntry* pEntry = *iter;
-
- if ( pEntry->GetCommand().equals( rResourceURL ) )
- {
- pToolbar = pEntry;
- break;
- }
- }
-
- if ( pToolbar != NULL )
- {
- delete pToolbar->GetEntries();
-
- try
- {
- uno::Reference< container::XIndexAccess > xToolbarSettings;
-
- if ( pToolbar->IsParentData() )
- {
- xToolbarSettings = GetParentConfigManager()->getSettings(
- pToolbar->GetCommand(), sal_False);
- }
- else
- {
- xToolbarSettings = GetConfigManager()->getSettings(
- pToolbar->GetCommand(), sal_False);
- }
-
- LoadToolbar( xToolbarSettings, pToolbar );
- }
- catch ( container::NoSuchElementException& )
- {
- // toolbar not found for some reason
- // it will not appear in the toolbar list
- }
- }
-}
-
-bool ToolbarSaveInData::LoadToolbar(
- const uno::Reference< container::XIndexAccess >& xToolbarSettings,
- SvxConfigEntry* pParentData )
-{
- SvxEntries* pEntries = pParentData->GetEntries();
-
- for ( sal_Int32 nIndex = 0; nIndex < xToolbarSettings->getCount(); nIndex++ )
- {
- uno::Reference< container::XIndexAccess > xSubMenu;
- OUString aCommandURL;
- OUString aHelpURL;
- OUString aLabel;
- bool bIsUserDefined = TRUE;
- sal_Bool bIsVisible;
- sal_Int32 nStyle;
-
- sal_uInt16 nType( css::ui::ItemType::DEFAULT );
-
- bool bItem = GetToolbarItemData( xToolbarSettings, nIndex, aCommandURL,
- aHelpURL, aLabel, nType, bIsVisible, nStyle, xSubMenu );
-
- if ( bItem )
- {
- if ( nType == css::ui::ItemType::DEFAULT )
- {
- uno::Any a;
- try
- {
- a = m_xCommandToLabelMap->getByName( aCommandURL );
- bIsUserDefined = FALSE;
- }
- catch ( container::NoSuchElementException& )
- {
- bIsUserDefined = TRUE;
- }
-
- // If custom label not set retrieve it from the command
- // to info service
- if ( aLabel.equals( OUString() ) )
- {
- uno::Sequence< beans::PropertyValue > aPropSeq;
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) )
- {
- aPropSeq[i].Value >>= aLabel;
- break;
- }
- }
- }
- }
-
- if ( xSubMenu.is() )
- {
- SvxConfigEntry* pEntry = new SvxConfigEntry(
- aLabel, aCommandURL, TRUE );
-
- pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
- pEntry->SetVisible( bIsVisible );
-
- pEntries->push_back( pEntry );
-
- LoadToolbar( xSubMenu, pEntry );
- }
- else
- {
- SvxConfigEntry* pEntry = new SvxConfigEntry(
- aLabel, aCommandURL, FALSE );
- pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
- pEntry->SetVisible( bIsVisible );
- pEntry->SetStyle( nStyle );
- pEntries->push_back( pEntry );
- }
- }
- else
- {
- SvxConfigEntry* pEntry = new SvxConfigEntry;
- pEntry->SetUserDefined( bIsUserDefined );
- pEntries->push_back( pEntry );
- }
- }
- }
-
- return true;
-}
-
-IMPL_LINK( SvxToolbarConfigPage, SelectToolbarEntry, Control *, pBox )
-{
- (void)pBox;
- UpdateButtonStates();
- return 1;
-}
-
-void SvxToolbarConfigPage::UpdateButtonStates()
-{
- PopupMenu* pPopup = aModifyCommandButton.GetPopupMenu();
- pPopup->EnableItem( ID_RENAME, FALSE );
- pPopup->EnableItem( ID_DELETE, FALSE );
- pPopup->EnableItem( ID_BEGIN_GROUP, FALSE );
- pPopup->EnableItem( ID_DEFAULT_COMMAND, FALSE );
- pPopup->EnableItem( ID_ICON_ONLY, FALSE );
- pPopup->EnableItem( ID_ICON_AND_TEXT, FALSE );
- pPopup->EnableItem( ID_TEXT_ONLY, FALSE );
- pPopup->EnableItem( ID_CHANGE_SYMBOL, FALSE );
- pPopup->EnableItem( ID_RESET_SYMBOL, FALSE );
-
- aDescriptionField.Clear();
-
- SvLBoxEntry* selection = aContentsListBox->GetCurEntry();
- if ( aContentsListBox->GetEntryCount() == 0 || selection == NULL )
- {
- return;
- }
-
- SvxConfigEntry* pEntryData = (SvxConfigEntry*) selection->GetUserData();
- if ( pEntryData->IsSeparator() )
- pPopup->EnableItem( ID_DELETE, TRUE );
- else
- {
- pPopup->EnableItem( ID_BEGIN_GROUP, TRUE );
- pPopup->EnableItem( ID_DELETE, TRUE );
- pPopup->EnableItem( ID_RENAME, TRUE );
- pPopup->EnableItem( ID_ICON_ONLY, TRUE );
- pPopup->EnableItem( ID_ICON_AND_TEXT, TRUE );
- pPopup->EnableItem( ID_TEXT_ONLY, TRUE );
- pPopup->EnableItem( ID_CHANGE_SYMBOL, TRUE );
-
- if ( !pEntryData->IsUserDefined() )
- pPopup->EnableItem( ID_DEFAULT_COMMAND, TRUE );
-
- if ( pEntryData->IsIconModified() )
- pPopup->EnableItem( ID_RESET_SYMBOL, TRUE );
-
- aDescriptionField.SetNewText( pEntryData->GetHelpText() );
- }
-}
-
-short SvxToolbarConfigPage::QueryReset()
-{
- String msg =
- String( SVX_RES( RID_SVXSTR_CONFIRM_TOOLBAR_RESET ) );
-
- String saveInName = aSaveInListBox.GetEntry(
- aSaveInListBox.GetSelectEntryPos() );
-
- OUString label = replaceSaveInName( msg, saveInName );
-
- QueryBox qbox( this, WB_YES_NO, label );
-
- return qbox.Execute();
-}
-
-IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox )
-{
- (void)pBox;
-
- aContentsListBox->Clear();
-
- SvxConfigEntry* pToolbar = GetTopLevelSelection();
- if ( pToolbar == NULL )
- {
- aModifyTopLevelButton.Enable( FALSE );
- aModifyCommandButton.Enable( FALSE );
- aAddCommandsButton.Enable( FALSE );
-
- return 0;
- }
-
- aModifyTopLevelButton.Enable( TRUE );
- aModifyCommandButton.Enable( TRUE );
- aAddCommandsButton.Enable( TRUE );
-
- PopupMenu* pPopup = aModifyTopLevelButton.GetPopupMenu();
-
- pPopup->EnableItem( ID_DELETE, pToolbar->IsDeletable() );
- pPopup->EnableItem( ID_RENAME, pToolbar->IsRenamable() );
- pPopup->EnableItem( ID_DEFAULT_STYLE, !pToolbar->IsRenamable() );
-
- switch( pToolbar->GetStyle() )
- {
- case 0:
- {
- pPopup->CheckItem( ID_ICONS_ONLY );
- break;
- }
- case 1:
- {
- pPopup->CheckItem( ID_TEXT_ONLY );
- break;
- }
- case 2:
- {
- pPopup->CheckItem( ID_ICONS_AND_TEXT );
- break;
- }
- }
-
- SvxEntries* pEntries = pToolbar->GetEntries();
- SvxEntries::const_iterator iter = pEntries->begin();
-
- for ( ; iter != pEntries->end(); iter++ )
- {
- SvxConfigEntry* pEntry = *iter;
-
- SvLBoxEntry* pNewLBEntry = InsertEntryIntoUI( pEntry );
-
- if (pEntry->IsBinding())
- {
- aContentsListBox->SetCheckButtonState( pNewLBEntry,
- pEntry->IsVisible() ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
- }
- else
- {
- aContentsListBox->SetCheckButtonState(
- pNewLBEntry, SV_BUTTON_TRISTATE );
- }
- }
-
- UpdateButtonStates();
-
- return 0;
-}
-
-IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton )
-{
- (void)pButton;
-
- String prefix =
- String( SVX_RES( RID_SVXSTR_NEW_TOOLBAR ) );
-
- OUString aNewName =
- generateCustomName( prefix, GetSaveInData()->GetEntries() );
-
- OUString aNewURL =
- generateCustomURL( GetSaveInData()->GetEntries() );
-
- SvxNewToolbarDialog* pNameDialog = new SvxNewToolbarDialog( 0, aNewName );
-
- USHORT nInsertPos;
- for ( USHORT i = 0 ; i < aSaveInListBox.GetEntryCount(); i++ )
- {
- SaveInData* pData =
- (SaveInData*) aSaveInListBox.GetEntryData( i );
-
- nInsertPos = pNameDialog->aSaveInListBox.InsertEntry(
- aSaveInListBox.GetEntry( i ) );
-
- pNameDialog->aSaveInListBox.SetEntryData( nInsertPos, pData );
- }
-
- pNameDialog->aSaveInListBox.SelectEntryPos(
- aSaveInListBox.GetSelectEntryPos(), TRUE );
-
- bool ret = pNameDialog->Execute();
- if ( ret == RET_OK )
- {
- pNameDialog->GetName( aNewName );
-
- nInsertPos = pNameDialog->aSaveInListBox.GetSelectEntryPos();
-
- ToolbarSaveInData* pData = (ToolbarSaveInData*)
- pNameDialog->aSaveInListBox.GetEntryData( nInsertPos );
-
- if ( GetSaveInData() != pData )
- {
- aSaveInListBox.SelectEntryPos( nInsertPos, TRUE );
- aSaveInListBox.GetSelectHdl().Call(this);
- }
-
- SvxConfigEntry* pToolbar =
- new SvxConfigEntry( aNewName, aNewURL, TRUE );
-
- pToolbar->SetUserDefined( TRUE );
- pToolbar->SetMain( TRUE );
-
- pData->CreateToolbar( pToolbar );
-
- nInsertPos = aTopLevelListBox.InsertEntry( pToolbar->GetName() );
- aTopLevelListBox.SetEntryData( nInsertPos, pToolbar );
- aTopLevelListBox.SelectEntryPos( nInsertPos, TRUE );
- aTopLevelListBox.GetSelectHdl().Call(this);
-
- pData->SetModified( TRUE );
- }
-
- delete pNameDialog;
-
- return 0;
-}
-
-IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton )
-{
- (void)pButton;
-
- if ( pSelectorDlg == NULL )
- {
- // Create Script Selector which shows slot commands
- pSelectorDlg = new SvxScriptSelectorDialog( this, TRUE, m_xFrame );
-
- // Position the Script Selector over the Add button so it is
- // beside the menu contents list and does not obscure it
- pSelectorDlg->SetPosPixel( aAddCommandsButton.GetPosPixel() );
-
- pSelectorDlg->SetAddHdl(
- LINK( this, SvxToolbarConfigPage, AddFunctionHdl ) );
- }
-
- pSelectorDlg->SetImageProvider(
- static_cast< ImageProvider* >( GetSaveInData() ) );
-
- pSelectorDlg->Show();
- return 1;
-}
-
-IMPL_LINK( SvxToolbarConfigPage, AddFunctionHdl,
- SvxScriptSelectorDialog *, pDialog )
-{
- (void)pDialog;
-
- AddFunction();
-
- return 0;
-}
-
-SvLBoxEntry* SvxToolbarConfigPage::AddFunction(
- SvLBoxEntry* pTarget, bool bFront, bool bAllowDuplicates )
-{
- SvLBoxEntry* pNewLBEntry =
- SvxConfigPage::AddFunction( pTarget, bFront, bAllowDuplicates );
-
- SvxConfigEntry* pEntry = (SvxConfigEntry*) pNewLBEntry->GetUserData();
-
- if ( pEntry->IsBinding() )
- {
- pEntry->SetVisible( TRUE );
- aContentsListBox->SetCheckButtonState(
- pNewLBEntry, SV_BUTTON_CHECKED );
- }
- else
- {
- aContentsListBox->SetCheckButtonState(
- pNewLBEntry, SV_BUTTON_TRISTATE );
- }
-
- // get currently selected toolbar and apply change
- SvxConfigEntry* pToolbar = GetTopLevelSelection();
-
- if ( pToolbar != NULL )
- {
- ( ( ToolbarSaveInData* ) GetSaveInData() )->ApplyToolbar( pToolbar );
- }
-
- return pNewLBEntry;
-}
-
-// -----------------------------------------------------------------------
-
-SvxToolbarEntriesListBox::SvxToolbarEntriesListBox(
- Window* pParent, const ResId& aResId )
- :
- SvxMenuEntriesListBox( pParent, aResId ),
- pPage( ( SvxToolbarConfigPage* ) pParent )
-{
- m_pButtonData = new SvLBoxButtonData( this );
- BuildCheckBoxButtonImages( m_pButtonData );
- EnableCheckButton( m_pButtonData );
-
- m_bHiContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode();
-}
-
-// --------------------------------------------------------
-
-SvxToolbarEntriesListBox::~SvxToolbarEntriesListBox()
-{
- delete m_pButtonData;
-}
-
-// --------------------------------------------------------
-
-void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pData )
-{
- // Build checkbox images according to the current application
- // settings. This is necessary to be able to have correct colors
- // in all color modes, like high contrast.
- const AllSettings& rSettings = Application::GetSettings();
-
- VirtualDevice aDev;
- Size aSize( 26, 20 );
-
- aDev.SetOutputSizePixel( aSize );
-
- Image aImage = GetSizedImage( aDev, aSize,
- CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT ));
-
- // Fill button data struct with new images
- pData->aBmps[SV_BMP_UNCHECKED] = aImage;
- pData->aBmps[SV_BMP_CHECKED] = GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED ));
- pData->aBmps[SV_BMP_HICHECKED] = GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED ));
- pData->aBmps[SV_BMP_HIUNCHECKED] = GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED));
- pData->aBmps[SV_BMP_TRISTATE] = GetSizedImage( aDev, aSize, Image() ); // Use tristate bitmaps to have no checkbox for separator entries
- pData->aBmps[SV_BMP_HITRISTATE] = GetSizedImage( aDev, aSize, Image() );
-
- // Get image size
- m_aCheckBoxImageSizePixel = aImage.GetSizePixel();
-}
-
-Image SvxToolbarEntriesListBox::GetSizedImage(
- VirtualDevice& aDev, const Size& aNewSize, const Image& aImage )
-{
- // Create new checkbox images for treelistbox. They must have a
- // decent width to have a clear column for the visibility checkbox.
-
- // Standard transparent color is light magenta as is won't be
- // used for other things
- Color aFillColor( COL_LIGHTMAGENTA );
-
- // Position image at the center of (width-2),(height) rectangle.
- // We need 2 pixels to have a bigger border to the next button image
- USHORT nPosX = std::max( (USHORT) (((( aNewSize.Width() - 2 ) - aImage.GetSizePixel().Width() ) / 2 ) - 1), (USHORT) 0 );
- USHORT nPosY = std::max( (USHORT) (((( aNewSize.Height() - 2 ) - aImage.GetSizePixel().Height() ) / 2 ) + 1), (USHORT) 0 );
- Point aPos( nPosX > 0 ? nPosX : 0, nPosY > 0 ? nPosY : 0 );
- aDev.SetFillColor( aFillColor );
- aDev.SetLineColor( aFillColor );
- aDev.DrawRect( Rectangle( Point(), aNewSize ));
- aDev.DrawImage( aPos, aImage );
-
- // Draw separator line 2 pixels left from the right border
- Color aLineColor = GetDisplayBackground().GetColor().IsDark() ? Color( COL_WHITE ) : Color( COL_BLACK );
- aDev.SetLineColor( aLineColor );
- aDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
-
- // Create new image that uses the fillcolor as transparent
- return Image( aDev.GetBitmap( Point(), aNewSize ), aFillColor );
-}
-
-void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SvTreeListBox::DataChanged( rDCEvt );
-
- if (( rDCEvt.GetType() == DATACHANGED_SETTINGS ) &&
- ( rDCEvt.GetFlags() & SETTINGS_STYLE ))
- {
- // We have to reset all images because we change to/from high contrast mode
- m_bHiContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- BuildCheckBoxButtonImages( m_pButtonData );
- Invalidate();
- }
-}
-
-// --------------------------------------------------------
-
-void SvxToolbarEntriesListBox::ChangeVisibility( SvLBoxEntry* pEntry )
-{
- if ( pEntry != NULL )
- {
- SvxConfigEntry* pEntryData =
- (SvxConfigEntry*) pEntry->GetUserData();
-
- if ( pEntryData->IsBinding() )
- {
- pEntryData->SetVisible( !pEntryData->IsVisible() );
-
- SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
-
- ToolbarSaveInData* pToolbarSaveInData = ( ToolbarSaveInData* )
- pPage->GetSaveInData();
-
- pToolbarSaveInData->ApplyToolbar( pToolbar );
-
- SetCheckButtonState( pEntry, pEntryData->IsVisible() ?
- SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
- }
- }
-}
-
-void SvxToolbarEntriesListBox::CheckButtonHdl()
-{
- ChangeVisibility( GetHdlEntry() );
-}
-
-void SvxToolbarEntriesListBox::KeyInput( const KeyEvent& rKeyEvent )
-{
- // space key will change visibility of toolbar items
- if ( rKeyEvent.GetKeyCode() == KEY_SPACE )
- {
- ChangeVisibility( GetCurEntry() );
- }
- else
- {
- // pass on to superclass
- SvxMenuEntriesListBox::KeyInput( rKeyEvent );
- }
-}
-
-BOOL SvxToolbarEntriesListBox::NotifyMoving(
- SvLBoxEntry* pTarget, SvLBoxEntry* pSource,
- SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos)
-{
- bool result = SvxMenuEntriesListBox::NotifyMoving(
- pTarget, pSource, rpNewParent, rNewChildPos );
-
- if ( result == TRUE )
- {
- // Instant Apply changes to UI
- SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
- if ( pToolbar != NULL )
- {
- ToolbarSaveInData* pSaveInData =
- ( ToolbarSaveInData*) pPage->GetSaveInData();
- pSaveInData->ApplyToolbar( pToolbar );
- }
- }
-
- return result;
-}
-
-BOOL SvxToolbarEntriesListBox::NotifyCopying(
- SvLBoxEntry* pTarget,
- SvLBoxEntry* pSource,
- SvLBoxEntry*& rpNewParent,
- ULONG& rNewChildPos)
-{
- (void)pSource;
- (void)rpNewParent;
- (void)rNewChildPos;
-
- if ( !m_bIsInternalDrag )
- {
- // if the target is NULL then add function to the start of the list
- ((SvxToolbarConfigPage*)pPage)->AddFunction( pTarget, pTarget == NULL );
-
- // Instant Apply changes to UI
- SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
- if ( pToolbar != NULL )
- {
- ToolbarSaveInData* pSaveInData =
- ( ToolbarSaveInData*) pPage->GetSaveInData();
- pSaveInData->ApplyToolbar( pToolbar );
- }
-
- // AddFunction already adds the listbox entry so return FALSE
- // to stop another listbox entry being added
- return FALSE;
- }
-
- // Copying is only allowed from external controls, not within the listbox
- return FALSE;
-}
-
-SvxNewToolbarDialog::SvxNewToolbarDialog(
- Window* pWindow, const String& rName )
- :
- ModalDialog ( pWindow, SVX_RES( MD_NEW_TOOLBAR ) ),
- aFtDescription ( this, SVX_RES( FT_NAME ) ),
- aEdtName ( this, SVX_RES( EDT_STRING ) ),
- aSaveInText ( this, SVX_RES( TXT_SAVEIN ) ),
- aBtnOK ( this, SVX_RES( BTN_OK ) ),
- aBtnCancel ( this, SVX_RES( BTN_CANCEL ) ),
- aBtnHelp ( this, SVX_RES( BTN_HELP ) ),
- aSaveInListBox ( this, SVX_RES( LB_SAVEIN ) )
-{
- FreeResource();
-
- aEdtName.SetText( rName );
- aEdtName.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
- ModifyHdl(&aEdtName);
- aEdtName.SetModifyHdl(LINK(this, SvxNewToolbarDialog, ModifyHdl));
-}
-
-IMPL_LINK(SvxNewToolbarDialog, ModifyHdl, Edit*, pEdit)
-{
- (void)pEdit;
-
- if(aCheckNameHdl.IsSet())
- aBtnOK.Enable(aCheckNameHdl.Call(this) > 0);
-
- return 0;
-}
-
-/*******************************************************************************
-*
-* The SvxIconSelectorDialog class
-*
-*******************************************************************************/
-SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow,
- const uno::Reference< css::ui::XImageManager >& rXImageManager,
- const uno::Reference< css::ui::XImageManager >& rXParentImageManager )
- :
- ModalDialog ( pWindow, SVX_RES( MD_ICONSELECTOR ) ),
- aFtDescription ( this, SVX_RES( FT_SYMBOLS ) ),
- aTbSymbol ( this, SVX_RES( TB_SYMBOLS ) ),
- aFtNote ( this, SVX_RES( FT_NOTE ) ),
- aBtnOK ( this, SVX_RES( BTN_OK ) ),
- aBtnCancel ( this, SVX_RES( BTN_CANCEL ) ),
- aBtnHelp ( this, SVX_RES( BTN_HELP ) ),
- aBtnImport ( this, SVX_RES( BTN_IMPORT ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aFlSeparator ( this, SVX_RES( FL_SEPARATOR ) ),
- m_nNextId ( 0 ),
- m_xImageManager ( rXImageManager ),
- m_xParentImageManager( rXParentImageManager )
-{
- FreeResource();
-
- typedef ::std::hash_map< ::rtl::OUString,
- bool,
- ::rtl::OUStringHash,
- ::std::equal_to< ::rtl::OUString > > ImageInfo;
-
- aTbSymbol.SetPageScroll( TRUE );
-
- bool bLargeIcons = GetImageType() & css::ui::ImageType::SIZE_LARGE;
- m_nExpectedSize = bLargeIcons ? 26 : 16;
-
- if ( m_nExpectedSize != 16 )
- {
- aFtNote.SetText( replaceSixteen( aFtNote.GetText(), m_nExpectedSize ) );
- }
-
- uno::Reference< lang::XMultiServiceFactory > xServiceManager =
- ::comphelper::getProcessServiceFactory();
-
- if ( xServiceManager.is() )
- {
- m_xGraphProvider = uno::Reference< graphic::XGraphicProvider >(
- xServiceManager->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.graphic.GraphicProvider" ) ),
- uno::UNO_QUERY );
- }
-
- if ( !m_xGraphProvider.is() )
- {
- aBtnImport.Enable( FALSE );
- }
-
- uno::Reference< beans::XPropertySet > xPropSet(
- xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.util.PathSettings" ) ),
- uno::UNO_QUERY );
-
- uno::Any aAny = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserConfig" ) ) );
-
- ::rtl::OUString aDirectory;
-
- aAny >>= aDirectory;
-
- sal_Int32 aCount = aDirectory.getLength();
-
- if ( aCount > 0 )
- {
- sal_Unicode aChar = aDirectory[ aCount-1 ];
- if ( aChar != '/')
- {
- aDirectory += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
- }
- }
- else
- {
- aBtnImport.Enable( FALSE );
- }
-
- aDirectory += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "soffice.cfg/import" ) );
-
- uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
- xServiceManager->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.embed.FileSystemStorageFactory" )),
- uno::UNO_QUERY );
-
- uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[ 0 ] <<= aDirectory;
- aArgs[ 1 ] <<= com::sun::star::embed::ElementModes::READWRITE;
-
- uno::Reference< com::sun::star::embed::XStorage > xStorage(
- xStorageFactory->createInstanceWithArguments( aArgs ), uno::UNO_QUERY );
-
- uno::Sequence< uno::Any > aProp( 2 );
- beans::PropertyValue aPropValue;
-
- aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserConfigStorage" ) );
- aPropValue.Value <<= xStorage;
- aProp[ 0 ] <<= aPropValue;
-
- aPropValue.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" ) );
- aPropValue.Value <<= com::sun::star::embed::ElementModes::READWRITE;
- aProp[ 1 ] <<= aPropValue;
-
- m_xImportedImageManager = uno::Reference< com::sun::star::ui::XImageManager >(
- xServiceManager->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii( "com.sun.star.ui.ImageManager" ), aProp ),
- uno::UNO_QUERY );
-
- ImageInfo mImageInfo;
- uno::Sequence< OUString > names;
- if ( m_xImportedImageManager.is() )
- {
- names = m_xImportedImageManager->getAllImageNames( GetImageType() );
- for ( sal_Int32 n = 0; n < names.getLength(); n++ )
- mImageInfo.insert( ImageInfo::value_type( names[n], false ));
- }
- USHORT nId = 1;
- ImageInfo::const_iterator pConstIter = mImageInfo.begin();
- uno::Sequence< OUString > name( 1 );
- while ( pConstIter != mImageInfo.end() )
- {
- name[ 0 ] = pConstIter->first;
- uno::Sequence< uno::Reference< graphic::XGraphic> > graphics = m_xImportedImageManager->getImages( GetImageType(), name );
- if ( graphics.getLength() > 0 )
- {
- Image img = Image( graphics[ 0 ] );
- aTbSymbol.InsertItem( nId, img, pConstIter->first );
-
- graphics[ 0 ]->acquire();
-
- aTbSymbol.SetItemData(
- nId, static_cast< void * > ( graphics[ 0 ].get() ) );
-
- ++nId;
- }
- ++pConstIter;
- }
-
- ImageInfo aImageInfo;
-
- if ( m_xParentImageManager.is() )
- {
- names = m_xParentImageManager->getAllImageNames( GetImageType() );
- for ( sal_Int32 n = 0; n < names.getLength(); n++ )
- aImageInfo.insert( ImageInfo::value_type( names[n], false ));
- }
-
- names = m_xImageManager->getAllImageNames( GetImageType() );
- for ( sal_Int32 n = 0; n < names.getLength(); n++ )
- {
- ImageInfo::iterator pIter = aImageInfo.find( names[n] );
- if ( pIter != aImageInfo.end() )
- pIter->second = true;
- else
- aImageInfo.insert( ImageInfo::value_type( names[n], true ));
- }
-
- // large growth factor, expecting many entries
- pConstIter = aImageInfo.begin();
- while ( pConstIter != aImageInfo.end() )
- {
- name[ 0 ] = pConstIter->first;
-
- uno::Sequence< uno::Reference< graphic::XGraphic> > graphics;
- try
- {
- if ( pConstIter->second )
- graphics = m_xImageManager->getImages( GetImageType(), name );
- else
- graphics = m_xParentImageManager->getImages( GetImageType(), name );
- }
- catch ( uno::Exception& )
- {
- // can't get sequence for this name so it will not be
- // added to the list
- }
-
- if ( graphics.getLength() > 0 )
- {
- Image img = Image( graphics[ 0 ] );
- aTbSymbol.InsertItem( nId, img, pConstIter->first );
-
- uno::Reference< graphic::XGraphic > xGraphic = graphics[ 0 ];
-
- if ( xGraphic.is() )
- xGraphic->acquire();
-
- aTbSymbol.SetItemData(
- nId, static_cast< void * > ( xGraphic.get() ) );
-
- ++nId;
- }
-
- ++pConstIter;
- }
-
- aBtnDelete.Enable( FALSE );
- aTbSymbol.SetSelectHdl( LINK(this, SvxIconSelectorDialog, SelectHdl) );
- aBtnImport.SetClickHdl( LINK(this, SvxIconSelectorDialog, ImportHdl) );
- aBtnDelete.SetClickHdl( LINK(this, SvxIconSelectorDialog, DeleteHdl) );
-
- m_nNextId = aTbSymbol.GetItemCount()+1;
-}
-
-SvxIconSelectorDialog::~SvxIconSelectorDialog()
-{
- USHORT nCount = aTbSymbol.GetItemCount();
-
- for (USHORT n = 0; n < nCount; n++ )
- {
- USHORT nId = aTbSymbol.GetItemId(n);
-
- uno::XInterface* xi = static_cast< uno::XInterface* >(
- aTbSymbol.GetItemData( nId ) );
-
- if ( xi != NULL )
- {
- xi->release();
- }
- }
-}
-
-uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon()
-{
- uno::Reference< graphic::XGraphic > result;
-
- USHORT nId;
- for ( USHORT n = 0; n < aTbSymbol.GetItemCount(); n++ )
- {
- nId = aTbSymbol.GetItemId( n );
- if ( aTbSymbol.IsItemChecked( nId ) )
- {
- result = uno::Reference< graphic::XGraphic >(
- reinterpret_cast< graphic::XGraphic* >(
- aTbSymbol.GetItemData( nId ) ) );
- }
- }
-
- return result;
-}
-
-IMPL_LINK( SvxIconSelectorDialog, SelectHdl, ToolBox *, pToolBox )
-{
- (void)pToolBox;
-
- USHORT nCount = aTbSymbol.GetItemCount();
-
- for (USHORT n = 0; n < nCount; n++ )
- {
- USHORT nId = aTbSymbol.GetItemId( n );
-
- if ( aTbSymbol.IsItemChecked( nId ) )
- {
- aTbSymbol.CheckItem( nId, FALSE );
- }
- }
-
- USHORT nId = aTbSymbol.GetCurItemId();
- aTbSymbol.CheckItem( nId );
-
- ::rtl::OUString aSelImageText = aTbSymbol.GetItemText( nId );
- if ( m_xImportedImageManager->hasImage( GetImageType(), aSelImageText ) )
- {
- aBtnDelete.Enable( TRUE );
- }
- else
- {
- aBtnDelete.Enable( FALSE );
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxIconSelectorDialog, ImportHdl, PushButton *, pButton )
-{
- (void)pButton;
-
- sfx2::FileDialogHelper aImportDialog(
- css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW,
- SFXWB_GRAPHIC | SFXWB_MULTISELECTION );
-
- // disable the link checkbox in the dialog
- uno::Reference< css::ui::dialogs::XFilePickerControlAccess >
- xController( aImportDialog.GetFilePicker(), uno::UNO_QUERY);
- if ( xController.is() )
- {
- xController->enableControl(
- css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK,
- sal_False);
- }
-
- aImportDialog.SetCurrentFilter(
- String::CreateFromAscii( "PNG - Portable Network Graphic" ) );
-
- if ( ERRCODE_NONE == aImportDialog.Execute() )
- {
- uno::Sequence< OUString > paths = aImportDialog.GetMPath();
- ImportGraphics ( paths );
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxIconSelectorDialog, DeleteHdl, PushButton *, pButton )
-{
- (void)pButton;
-
- OUString message = String( SVX_RES( RID_SVXSTR_DELETE_ICON_CONFIRM ) );
- bool ret = WarningBox( this, WinBits(WB_OK_CANCEL), message ).Execute();
-
- if ( ret == RET_OK )
- {
- USHORT nCount = aTbSymbol.GetItemCount();
-
- for (USHORT n = 0; n < nCount; n++ )
- {
- USHORT nId = aTbSymbol.GetItemId( n );
-
- if ( aTbSymbol.IsItemChecked( nId ) )
- {
- ::rtl::OUString aSelImageText = aTbSymbol.GetItemText( nId );
- uno::Sequence< OUString > URLs(1);
- URLs[0] = aSelImageText;
- aTbSymbol.RemoveItem( aTbSymbol.GetItemPos( nId ) );
- m_xImportedImageManager->removeImages( GetImageType(), URLs );
- uno::Reference< css::ui::XUIConfigurationPersistence >
- xConfigPersistence( m_xImportedImageManager, uno::UNO_QUERY );
- if ( xConfigPersistence.is() && xConfigPersistence->isModified() )
- {
- xConfigPersistence->store();
- }
- break;
- }
- }
- }
- return 0;
-}
-
-bool SvxIconSelectorDialog::ReplaceGraphicItem(
- const ::rtl::OUString& aURL )
-{
- uno::Sequence< OUString > URLs(1);
- uno::Sequence< uno::Reference<graphic::XGraphic > > aImportGraph( 1 );
- uno::Reference< css::ui::XUIConfigurationPersistence >
- xConfigPer( m_xImportedImageManager, uno::UNO_QUERY );
-
- uno::Reference< graphic::XGraphic > xGraphic;
- uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
- aMediaProps[0].Name = ::rtl::OUString::createFromAscii("URL");
- aMediaProps[0].Value <<= aURL;
-
- com::sun::star::awt::Size aSize;
- bool bOK = FALSE;
- try
- {
- xGraphic = m_xGraphProvider->queryGraphic( aMediaProps );
-
- uno::Reference< beans::XPropertySet > props =
- m_xGraphProvider->queryGraphicDescriptor( aMediaProps );
- uno::Any a = props->getPropertyValue(
- OUString::createFromAscii("SizePixel") );
- a >>= aSize;
- if (0 == aSize.Width || 0 == aSize.Height)
- return FALSE;
- else
- bOK = TRUE;
- }
- catch ( uno::Exception& )
- {
- return false;
- }
-
- bool bResult( false );
- USHORT nCount = aTbSymbol.GetItemCount();
- for (USHORT n = 0; n < nCount; n++ )
- {
- USHORT nId = aTbSymbol.GetItemId( n );
-
- if ( OUString( aTbSymbol.GetItemText( nId ) ) == aURL )
- {
- try
- {
- // replace/insert image with provided URL
- aTbSymbol.RemoveItem( aTbSymbol.GetItemPos( nId ) );
- aMediaProps[0].Value <<= aURL;
-
- Image aImage( xGraphic );
- if ( bOK && ((aSize.Width != m_nExpectedSize) || (aSize.Height != m_nExpectedSize)) )
- {
- BitmapEx aBitmap = aImage.GetBitmapEx();
- BitmapEx aBitmapex = AutoScaleBitmap(aBitmap, m_nExpectedSize);
- aImage = Image( aBitmapex);
- }
- aTbSymbol.InsertItem( nId,aImage, aURL, 0, 0 ); //modify
-
- xGraphic = aImage.GetXGraphic();
-
- URLs[0] = aURL;
- aImportGraph[ 0 ] = xGraphic;
- m_xImportedImageManager->replaceImages( GetImageType(), URLs, aImportGraph );
- xConfigPer->store();
-
- bResult = true;
- break;
- }
- catch ( ::com::sun::star::uno::Exception& )
- {
- break;
- }
- }
- }
-
- return bResult;
-}
-
-void SvxIconSelectorDialog::ImportGraphics(
- const uno::Sequence< OUString >& rPaths )
-{
- uno::Sequence< OUString > rejected( rPaths.getLength() );
- sal_Int32 rejectedCount = 0;
-
- USHORT ret = 0;
- sal_Int32 aIndex;
- OUString aIconName;
- uno::Sequence< OUString > URLs(1);
- uno::Sequence< uno::Reference<graphic::XGraphic > > aImportGraph( 1 );
- uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
- aMediaProps[0].Name = ::rtl::OUString::createFromAscii("URL");
- uno::Reference< css::ui::XUIConfigurationPersistence >
- xConfigPer( m_xImportedImageManager, uno::UNO_QUERY );
-
- if ( rPaths.getLength() == 1 )
- {
- if ( m_xImportedImageManager->hasImage( GetImageType(), rPaths[0] ) )
- {
- aIndex = rPaths[0].lastIndexOf( '/' );
- aIconName = rPaths[0].copy( aIndex+1 );
- ret = SvxIconReplacementDialog( this, aIconName ).ShowDialog();
- if ( ret == 2 )
- {
- ReplaceGraphicItem( rPaths[0] );
- }
- }
- else
- {
- if ( ImportGraphic( rPaths[0] ) == FALSE )
- {
- rejected[0] = rPaths[0];
- rejectedCount = 1;
- }
- }
- }
- else
- {
- ::rtl::OUString aSourcePath( rPaths[0] );
- if ( rPaths[0].lastIndexOf( '/' ) != rPaths[0].getLength() -1 )
- aSourcePath = rPaths[0] + ::rtl::OUString::createFromAscii( "/" );
-
- for ( sal_Int32 i = 1; i < rPaths.getLength(); i++ )
- {
- ::rtl::OUString aPath = aSourcePath + rPaths[i];
- if ( m_xImportedImageManager->hasImage( GetImageType(), aPath ) )
- {
- aIndex = rPaths[i].lastIndexOf( '/' );
- aIconName = rPaths[i].copy( aIndex+1 );
- ret = SvxIconReplacementDialog( this, aIconName, TRUE ).ShowDialog();
- if ( ret == 2 )
- {
- ReplaceGraphicItem( aPath );
- }
- else if ( ret == 5 )
- {
- for ( sal_Int32 k = i; k < rPaths.getLength(); k++ )
- {
- aPath = aSourcePath + rPaths[k];
- bool bHasReplaced = ReplaceGraphicItem( aPath );
-
- if ( !bHasReplaced )
- {
- bool result = ImportGraphic( aPath );
- if ( result == FALSE )
- {
- rejected[ rejectedCount ] = rPaths[i];
- rejectedCount++;
- }
- }
- }
- break;
- }
- }
- else
- {
- bool result = ImportGraphic( aSourcePath + rPaths[i] );
- if ( result == FALSE )
- {
- rejected[ rejectedCount ] = rPaths[i];
- rejectedCount++;
- }
- }
- }
- }
-
- if ( rejectedCount != 0 )
- {
- OUString message =OUString::createFromAscii("");
- OUString newLine = OUString::createFromAscii("\n");
- rtl::OUString fPath = OUString::createFromAscii("");
- if (rejectedCount > 1)
- fPath = rPaths[0].copy(8) + ::rtl::OUString::createFromAscii( "/" );
- for ( sal_Int32 i = 0; i < rejectedCount; i++ )
- {
- message += fPath + rejected[i];
- message += newLine;
- }
-
- SvxIconChangeDialog aDialog(this, message);
- aDialog.Execute();
- }
-}
-
-bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL )
-{
- bool result = FALSE;
-
- USHORT nId = m_nNextId;
- ++m_nNextId;
-
- uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
- aMediaProps[0].Name = ::rtl::OUString::createFromAscii("URL");
-
- uno::Reference< graphic::XGraphic > xGraphic;
- com::sun::star::awt::Size aSize;
- bool bOK = TRUE;
- aMediaProps[0].Value <<= aURL;
- try
- {
- uno::Reference< beans::XPropertySet > props =
- m_xGraphProvider->queryGraphicDescriptor( aMediaProps );
-
- uno::Any a = props->getPropertyValue(
- OUString::createFromAscii("SizePixel") );
-
- xGraphic = m_xGraphProvider->queryGraphic( aMediaProps );
- if ( xGraphic.is() )
- {
- a >>= aSize;
- if ( 0 == aSize.Width || 0 == aSize.Height )
- bOK = FALSE;
-
- Image aImage( xGraphic );
-
- if ( bOK && ((aSize.Width != m_nExpectedSize) || (aSize.Height != m_nExpectedSize)) )
- {
- BitmapEx aBitmap = aImage.GetBitmapEx();
- BitmapEx aBitmapex = AutoScaleBitmap(aBitmap, m_nExpectedSize);
- aImage = Image( aBitmapex);
- }
- if ( bOK && !!aImage )
- {
- aTbSymbol.InsertItem( nId, aImage, aURL, 0, 0 );
-
- xGraphic = aImage.GetXGraphic();
- xGraphic->acquire();
-
- aTbSymbol.SetItemData(
- nId, static_cast< void * > ( xGraphic.get() ) );
- uno::Sequence< OUString > aImportURL( 1 );
- aImportURL[ 0 ] = aURL;
- uno::Sequence< uno::Reference<graphic::XGraphic > > aImportGraph( 1 );
- aImportGraph[ 0 ] = xGraphic;
- m_xImportedImageManager->insertImages( GetImageType(), aImportURL, aImportGraph );
- uno::Reference< css::ui::XUIConfigurationPersistence >
- xConfigPersistence( m_xImportedImageManager, uno::UNO_QUERY );
-
- if ( xConfigPersistence.is() && xConfigPersistence->isModified() )
- {
- xConfigPersistence->store();
- }
-
- result = TRUE;
- }
- else
- {
- OSL_TRACE("could not create Image from XGraphic");
- }
- }
- else
- {
- OSL_TRACE("could not get query XGraphic");
- }
- }
- catch( uno::Exception& e )
- {
- OSL_TRACE("Caught exception importing XGraphic: %s", PRTSTR(e.Message));
- }
- return result;
-}
-
-/*******************************************************************************
-*
-* The SvxIconReplacementDialog class
-*
-*******************************************************************************/
-SvxIconReplacementDialog :: SvxIconReplacementDialog(
- Window *pWindow, const rtl::OUString& aMessage, bool /*bYestoAll*/ )
- :
-MessBox( pWindow, WB_DEF_YES, String( SVX_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ) ), String( SVX_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) ) )
-
-{
- SetImage( WarningBox::GetStandardImage() );
- SetMessText( ReplaceIconName( aMessage ) );
- RemoveButton( 1 );
- AddButton( BUTTON_YES, 2, 0 );
- AddButton( String( SVX_RES( RID_SVXSTR_YESTOALL ) ), 5, 0 );
- AddButton( BUTTON_NO, 3, 0 );
- AddButton( BUTTON_CANCEL, 4, 0 );
-}
-
-SvxIconReplacementDialog :: SvxIconReplacementDialog(
- Window *pWindow, const rtl::OUString& aMessage )
- :
-MessBox( pWindow, WB_YES_NO_CANCEL, String( SVX_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ) ), String( SVX_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) ) )
-{
- SetImage( WarningBox::GetStandardImage() );
- SetMessText( ReplaceIconName( aMessage ));
-}
-
-rtl::OUString SvxIconReplacementDialog :: ReplaceIconName( const OUString& rMessage )
-{
- rtl::OUString name;
- rtl::OUString message = String( SVX_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) );
- rtl::OUString placeholder = OUString::createFromAscii( "%ICONNAME" );
- sal_Int32 pos = message.indexOf( placeholder );
- if ( pos != -1 )
- {
- name = message.replaceAt(
- pos, placeholder.getLength(), rMessage );
- }
- return name;
-}
-
-USHORT SvxIconReplacementDialog :: ShowDialog()
-{
- this->Execute();
- return ( this->GetCurButtonId() );
-}
-/*******************************************************************************
-*
-* The SvxIconChangeDialog class added for issue83555
-*
-*******************************************************************************/
-SvxIconChangeDialog::SvxIconChangeDialog(
- Window *pWindow, const rtl::OUString& aMessage)
- :
- ModalDialog ( pWindow, SVX_RES( MD_ICONCHANGE ) ),
- aFImageInfo (this, SVX_RES( FI_INFO ) ),
- aBtnOK (this, SVX_RES(MD_BTN_OK)),
- aDescriptionLabel (this, SVX_RES(FTCHGE_DESCRIPTION)),
- aLineEditDescription (this, SVX_RES(EDT_ADDR))
-{
- FreeResource();
- aFImageInfo.SetImage(InfoBox::GetStandardImage());
- aLineEditDescription.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() );
- aLineEditDescription.SetAutoScroll( TRUE );
- aLineEditDescription.EnableCursor( FALSE );
- aLineEditDescription.SetText(aMessage);
-}
-
-BitmapEx SvxIconSelectorDialog::AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize)
-{
- Point aEmptyPoint(0,0);
- sal_Int32 imgNewWidth = 0;
- sal_Int32 imgNewHeight = 0;
- double imgposX = 0;
- double imgposY = 0;
- BitmapEx aRet = aBitmap;
- double imgOldWidth = aRet.GetSizePixel().Width();
- double imgOldHeight =aRet.GetSizePixel().Height();
-
- Size aScaledSize;
- if (imgOldWidth >= aStandardSize || imgOldHeight >= aStandardSize)
- {
- if (imgOldWidth >= imgOldHeight)
- {
- imgNewWidth = aStandardSize;
- imgNewHeight = sal_Int32(imgOldHeight / (imgOldWidth / aStandardSize) + 0.5);
- imgposX = 0;
- imgposY = (aStandardSize - (imgOldHeight / (imgOldWidth / aStandardSize) + 0.5)) / 2 + 0.5;
- }
- else
- {
- imgNewHeight = aStandardSize;
- imgNewWidth = sal_Int32(imgOldWidth / (imgOldHeight / aStandardSize) + 0.5);
- imgposY = 0;
- imgposX = (aStandardSize - (imgOldWidth / (imgOldHeight / aStandardSize) + 0.5)) / 2 + 0.5;
- }
-
- aScaledSize = Size( imgNewWidth, imgNewHeight );
- aRet.Scale( aScaledSize, BMP_SCALE_INTERPOLATE );
- }
- else
- {
- imgposX = (aStandardSize - imgOldWidth) / 2 + 0.5;
- imgposY = (aStandardSize - imgOldHeight) / 2 + 0.5;
- }
-
- Size aBmpSize = aRet.GetSizePixel();
- Size aStdSize( aStandardSize, aStandardSize );
- Rectangle aRect(aEmptyPoint, aStdSize );
-
- VirtualDevice aVirDevice( *Application::GetDefaultDevice(), 0, 1 );
- aVirDevice.SetOutputSizePixel( aStdSize );
- aVirDevice.SetFillColor( COL_TRANSPARENT );
- aVirDevice.SetLineColor( COL_TRANSPARENT );
-
- //draw a rect into virDevice
- aVirDevice.DrawRect( aRect );
- Point aPointPixel( (long)imgposX, (long)imgposY );
- aVirDevice.DrawBitmapEx( aPointPixel, aRet );
- aRet = aVirDevice.GetBitmapEx( aEmptyPoint, aStdSize );
-
- return aRet;
-}
diff --git a/svx/source/cui/cfg.hrc b/svx/source/cui/cfg.hrc
deleted file mode 100644
index fa8ad15fb8..0000000000
--- a/svx/source/cui/cfg.hrc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.hrc,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define CFG_OFFSET 300
-
-#define GRP_MENUS (9 + CFG_OFFSET)
-#define FT_MENUS (10 + CFG_OFFSET)
-#define LB_MENUS (11 + CFG_OFFSET)
-#define BTN_NEW (12 + CFG_OFFSET)
-#define BTN_CHANGE (14 + CFG_OFFSET)
-#define GRP_MENU_SEPARATOR (15 + CFG_OFFSET)
-#define GRP_MENU_ENTRIES (16 + CFG_OFFSET)
-#define BOX_ENTRIES (17 + CFG_OFFSET)
-#define BTN_CHANGE_ENTRY (18 + CFG_OFFSET)
-#define BTN_UP (19 + CFG_OFFSET)
-#define BTN_DOWN (20 + CFG_OFFSET)
-#define FT_DESCRIPTION (22 + CFG_OFFSET)
-#define TXT_SAVEIN (23 + CFG_OFFSET)
-#define LB_SAVEIN (24 + CFG_OFFSET)
-#define ED_DESCRIPTION (25 + CFG_OFFSET)
-#define BTN_ADD_COMMANDS (26 + CFG_OFFSET)
-
-#define MODIFY_MENU (40 + CFG_OFFSET)
-#define MODIFY_ENTRY (41 + CFG_OFFSET)
-#define ID_RENAME (42 + CFG_OFFSET)
-#define ID_MOVE (43 + CFG_OFFSET)
-#define ID_DELETE (44 + CFG_OFFSET)
-#define ID_ADD_SUBMENU (45 + CFG_OFFSET)
-#define ID_BEGIN_GROUP (46 + CFG_OFFSET)
-#define ID_DEFAULT_STYLE (47 + CFG_OFFSET)
-#define ID_ICONS_ONLY (48 + CFG_OFFSET)
-#define ID_ICONS_AND_TEXT (49 + CFG_OFFSET)
-#define ID_ICON_ONLY (50 + CFG_OFFSET)
-#define ID_ICON_AND_TEXT (51 + CFG_OFFSET)
-#define ID_TEXT_ONLY (52 + CFG_OFFSET)
-#define ID_CHANGE_SYMBOL (53 + CFG_OFFSET)
-#define ID_RESET_SYMBOL (54 + CFG_OFFSET)
-#define ID_DEFAULT_COMMAND (55 + CFG_OFFSET)
-
-#define MODIFY_TOOLBAR (60 + CFG_OFFSET)
-#define MODIFY_TOOLBAR_CONTENT (61 + CFG_OFFSET)
-
-#define IBX_MNUCFG_ALREADY_INCLUDED (63 + CFG_OFFSET)
-#define QBX_CONFIRM_RESET (64 + CFG_OFFSET)
-#define QBX_CONFIRM_DELETE_MENU (65 + CFG_OFFSET)
-#define QBX_CONFIRM_RESTORE_DEFAULT (66 + CFG_OFFSET)
-#define QBX_CONFIRM_DELETE_TOOLBAR (67 + CFG_OFFSET)
-
-#define MD_MENU_ORGANISER (79 + CFG_OFFSET)
-#define TXT_MENU (80 + CFG_OFFSET)
-#define BOX_MAIN_MENUS (81 + CFG_OFFSET)
-#define BTN_MENU_UP (82 + CFG_OFFSET)
-#define BTN_MENU_DOWN (83 + CFG_OFFSET)
-#define BTN_MENU_ADD (84 + CFG_OFFSET)
-#define BTN_MENU_CLOSE (85 + CFG_OFFSET)
-#define BTN_MENU_HELP (86 + CFG_OFFSET)
-#define TXT_MENU_NAME (87 + CFG_OFFSET)
-#define EDIT_MENU_NAME (88 + CFG_OFFSET)
-
-#define MD_ICONSELECTOR (90 + CFG_OFFSET)
-#define FT_SYMBOLS (91 + CFG_OFFSET)
-#define TB_SYMBOLS (92 + CFG_OFFSET)
-#define FT_NOTE (93 + CFG_OFFSET)
-#define BTN_IMPORT (97 + CFG_OFFSET)
-#define IMAGE_BTN_COLOR (98 + CFG_OFFSET)
-
-#define MD_NEW_TOOLBAR (101 + CFG_OFFSET)
-#define EDT_STRING (102 + CFG_OFFSET)
-#define BTN_OK (103 + CFG_OFFSET)
-#define BTN_CANCEL (104 + CFG_OFFSET)
-#define BTN_HELP (105 + CFG_OFFSET)
-#define FT_NAME (106 + CFG_OFFSET)
-
-#define FL_SEPARATOR (108 + CFG_OFFSET)
-#define BTN_DELETE (109 + CFG_OFFSET)
-//added for issue83555
-#define MD_ICONCHANGE (119 + CFG_OFFSET)
-#define FTCHGE_DESCRIPTION (120 + CFG_OFFSET)
-#define EDT_ADDR (121 + CFG_OFFSET)
-#define MD_BTN_OK (122 + CFG_OFFSET)
-#define FI_INFO (123 + CFG_OFFSET)
diff --git a/svx/source/cui/cfg.hxx b/svx/source/cui/cfg.hxx
deleted file mode 100644
index 4aee5295e2..0000000000
--- a/svx/source/cui/cfg.hxx
+++ /dev/null
@@ -1,836 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.hxx,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVXCFG_HXX
-#define _SVXCFG_HXX
-
-#include <vcl/lstbox.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/menubtn.hxx>
-#include <vcl/toolbox.hxx>
-#include <svtools/svtreebx.hxx>
-#include <svtools/svmedit2.hxx>
-#include <svtools/svmedit.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/ui/XUIConfigurationListener.hpp>
-#include <com/sun/star/ui/XUIConfigurationManager.hpp>
-#include <com/sun/star/ui/XImageManager.hpp>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx> // SvUShorts
-#include <sfx2/minarray.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <vector>
-#include <vcl/msgbox.hxx>
-
-#include "selector.hxx"
-
-class SvxConfigEntry;
-class SvxConfigPage;
-class SvxMenuConfigPage;
-class SvxToolbarConfigPage;
-
-typedef std::vector< SvxConfigEntry* > SvxEntries;
-
-class SvxConfigDialog : public SfxTabDialog
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
-
-public:
- SvxConfigDialog( Window*, const SfxItemSet* );
- ~SvxConfigDialog();
-
- void ActivateTabPage( USHORT );
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
- virtual short Ok();
-
- void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
-};
-
-class SaveInData : public ImageProvider
-{
-private:
-
- bool bModified;
-
- bool bDocConfig;
- bool bReadOnly;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::ui::XUIConfigurationManager > m_xCfgMgr;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::ui::XUIConfigurationManager > m_xParentCfgMgr;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::ui::XImageManager > m_xImgMgr;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::ui::XImageManager > m_xParentImgMgr;
-
- static ::com::sun::star::uno::Reference
- < com::sun::star::ui::XImageManager >* xDefaultImgMgr;
-
-public:
-
- SaveInData(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >& xCfgMgr,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >& xParentCfgMgr,
- const rtl::OUString& aModuleId,
- bool docConfig );
-
- ~SaveInData() {}
-
- bool PersistChanges(
- const com::sun::star::uno::Reference
- < com::sun::star::uno::XInterface >& xManager );
-
- void SetModified( bool bValue = TRUE ) { bModified = bValue; }
- bool IsModified( ) { return bModified; }
-
- bool IsReadOnly( ) { return bReadOnly; }
- bool IsDocConfig( ) { return bDocConfig; }
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::ui::XUIConfigurationManager >
- GetConfigManager() { return m_xCfgMgr; };
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::ui::XUIConfigurationManager >
- GetParentConfigManager() { return m_xParentCfgMgr; };
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::ui::XImageManager >
- GetImageManager() { return m_xImgMgr; };
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::ui::XImageManager >
- GetParentImageManager() { return m_xParentImgMgr; };
-
- ::com::sun::star::uno::Reference
- < com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::container::XNameAccess > m_xCommandToLabelMap;
-
- com::sun::star::uno::Reference
- < com::sun::star::uno::XComponentContext > m_xComponentContext;
-
- com::sun::star::uno::Sequence
- < com::sun::star::beans::PropertyValue > m_aSeparatorSeq;
-
- Image GetImage( const rtl::OUString& rCommandURL );
-
- virtual bool HasURL( const rtl::OUString& aURL ) = 0;
- virtual bool HasSettings() = 0;
- virtual SvxEntries* GetEntries() = 0;
- virtual void SetEntries( SvxEntries* ) = 0;
- virtual void Reset() = 0;
- virtual bool Apply() = 0;
-};
-
-class MenuSaveInData : public SaveInData
-{
-private:
-
- rtl::OUString m_aMenuResourceURL;
- rtl::OUString m_aDescriptorContainer;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::container::XIndexAccess > m_xMenuSettings;
-
- SvxConfigEntry* pRootEntry;
-
- // static holder of the default menu data
- static MenuSaveInData* pDefaultData;
-
- static void SetDefaultData( MenuSaveInData* pData ) {pDefaultData = pData;}
- static MenuSaveInData* GetDefaultData() { return pDefaultData; }
-
- void Apply( bool bDefault );
-
- void Apply(
- SvxConfigEntry* pRootEntry,
- com::sun::star::uno::Reference<
- com::sun::star::container::XIndexContainer >& rNewMenuBar,
- com::sun::star::uno::Reference<
- com::sun::star::lang::XSingleComponentFactory >& rFactory,
- SvLBoxEntry *pParent = NULL );
-
- void ApplyMenu(
- com::sun::star::uno::Reference<
- com::sun::star::container::XIndexContainer >& rNewMenuBar,
- com::sun::star::uno::Reference<
- com::sun::star::lang::XSingleComponentFactory >& rFactory,
- SvxConfigEntry *pMenuData = NULL );
-
- bool LoadSubMenus(
- const ::com::sun::star::uno::Reference<
- com::sun::star::container::XIndexAccess >& xMenuBarSettings,
- const rtl::OUString& rBaseTitle, SvxConfigEntry* pParentData );
-
-public:
-
- MenuSaveInData(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const rtl::OUString& aModuleId,
- bool docConfig );
-
- ~MenuSaveInData();
-
- // methods inherited from SaveInData
- SvxEntries* GetEntries();
- void SetEntries( SvxEntries* );
- bool HasURL( const rtl::OUString& URL ) { (void)URL; return FALSE; }
- bool HasSettings() { return m_xMenuSettings.is(); }
- void Reset();
- bool Apply();
-};
-
-class SvxConfigEntry
-{
-private:
-
- // common properties
- USHORT nId;
- ::rtl::OUString aHelpText;
- ::rtl::OUString aLabel;
- ::rtl::OUString aCommand;
- ::rtl::OUString aHelpURL;
-
- bool bPopUp;
- bool bStrEdited;
- bool bIsUserDefined;
- bool bIsMain;
- bool bIsDeletable;
- bool bIsMovable;
- bool bIsParentData;
-
- // toolbar specific properties
- bool bIsVisible;
- sal_Int32 nStyle;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::graphic::XGraphic > xBackupGraphic;
-
- SvxEntries *pEntries;
-
-public:
-
- SvxConfigEntry(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::beans::PropertyValue >& rProperties,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XNameAccess >& rCommandToLabelMap );
-
- SvxConfigEntry( const ::rtl::OUString& rDisplayName,
- const ::rtl::OUString& rCommandURL,
- bool bPopup = FALSE,
- bool bParentData = FALSE );
-
- SvxConfigEntry()
- :
- nId( 0 ),
- bPopUp( FALSE ),
- bStrEdited( FALSE ),
- bIsUserDefined( FALSE ),
- bIsMain( FALSE ),
- bIsParentData( FALSE ),
- bIsVisible( TRUE ),
- nStyle( 0 ),
- pEntries( 0 )
- {}
-
- ~SvxConfigEntry();
-
- const ::rtl::OUString& GetCommand() const { return aCommand; }
- void SetCommand( const String& rCmd ) { aCommand = rCmd; }
-
- const ::rtl::OUString& GetName() const { return aLabel; }
- void SetName( const String& rStr ) { aLabel = rStr; bStrEdited = TRUE; }
- bool HasChangedName() const { return bStrEdited; }
-
- const ::rtl::OUString& GetHelpText() ;
- void SetHelpText( const String& rStr ) { aHelpText = rStr; }
-
- const ::rtl::OUString& GetHelpURL() const { return aHelpURL; }
- void SetHelpURL( const String& rStr ) { aHelpURL = rStr; }
-
- void SetPopup( bool bOn = TRUE ) { bPopUp = bOn; }
- bool IsPopup() const { return bPopUp; }
-
- void SetUserDefined( bool bOn = TRUE ) { bIsUserDefined = bOn; }
- bool IsUserDefined() const { return bIsUserDefined; }
-
- bool IsBinding() const { return !bPopUp; }
- bool IsSeparator() const { return nId == 0; }
-
- SvxEntries* GetEntries() const { return pEntries; }
- void SetEntries( SvxEntries* entries ) { pEntries = entries; }
- bool HasEntries() const { return pEntries != NULL; }
-
- void SetMain( bool bValue = TRUE ) { bIsMain = bValue; }
- bool IsMain() { return bIsMain; }
-
- void SetParentData( bool bValue = TRUE ) { bIsParentData = bValue; }
- bool IsParentData() { return bIsParentData; }
-
- bool IsMovable();
- bool IsDeletable();
- bool IsRenamable();
-
- void SetVisible( bool b ) { bIsVisible = b; }
- bool IsVisible() const { return bIsVisible; }
-
- void SetBackupGraphic(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::graphic::XGraphic > graphic )
- { xBackupGraphic = graphic; }
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::graphic::XGraphic >
- GetBackupGraphic()
- { return xBackupGraphic; }
-
- bool IsIconModified() { return xBackupGraphic.is(); }
-
- sal_Int32 GetStyle() { return nStyle; }
- void SetStyle( sal_Int32 style ) { nStyle = style; }
-
- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
- GetProperties(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XNameAccess >& rCommandToLabelMap );
-};
-
-class SvxMenuEntriesListBox : public SvTreeListBox
-{
-private:
- SvxConfigPage* pPage;
-
-protected:
- bool m_bIsInternalDrag;
-
-public:
- SvxMenuEntriesListBox( Window*, const ResId& );
- ~SvxMenuEntriesListBox();
-
- virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
-
- virtual BOOL NotifyAcceptDrop( SvLBoxEntry* pEntry );
-
- virtual BOOL NotifyMoving( SvLBoxEntry*, SvLBoxEntry*,
- SvLBoxEntry*&, ULONG& );
-
- virtual BOOL NotifyCopying( SvLBoxEntry*, SvLBoxEntry*,
- SvLBoxEntry*&, ULONG&);
-
- virtual DragDropMode NotifyStartDrag(
- TransferDataContainer&, SvLBoxEntry* );
-
- virtual void DragFinished( sal_Int8 );
-
- void KeyInput( const KeyEvent& rKeyEvent );
-};
-
-class SvxDescriptionEdit : public ExtMultiLineEdit
-{
-private:
- Rectangle m_aRealRect;
-
-public:
- SvxDescriptionEdit( Window* pParent, const ResId& _rId );
- inline ~SvxDescriptionEdit() {}
-
- void SetNewText( const String& _rText );
- inline void Clear() { SetNewText( String() ); }
-};
-
-class SvxConfigPage : public SfxTabPage
-{
-private:
-
- bool bInitialised;
- SaveInData* pCurrentSaveInData;
-
- DECL_LINK( SelectSaveInLocation, ListBox * );
- DECL_LINK( AsyncInfoMsg, String* );
-
- bool SwapEntryData( SvLBoxEntry* pSourceEntry, SvLBoxEntry* pTargetEntry );
- void AlignControls();
-
-protected:
-
- // the top section of the tab page where top level menus and toolbars
- // are displayed in a listbox
- FixedLine aTopLevelSeparator;
- FixedText aTopLevelLabel;
- ListBox aTopLevelListBox;
- PushButton aNewTopLevelButton;
- MenuButton aModifyTopLevelButton;
-
- // the contents section where the contents of the selected
- // menu or toolbar are displayed
- FixedLine aContentsSeparator;
- FixedText aContentsLabel;
- SvTreeListBox* aContentsListBox;
-
- PushButton aAddCommandsButton;
- MenuButton aModifyCommandButton;
-
- ImageButton aMoveUpButton;
- ImageButton aMoveDownButton;
-
- FixedText aSaveInText;
- ListBox aSaveInListBox;
-
- FixedText aDescriptionLabel;
- SvxDescriptionEdit aDescriptionField;
-
- SvxScriptSelectorDialog* pSelectorDlg;
-
- // the ResourceURL to select when opening the dialog
- rtl::OUString m_aURLToSelect;
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::frame::XFrame > m_xFrame;
-
- SvxConfigPage( Window*, /* const ResId&, */ const SfxItemSet& );
- virtual ~SvxConfigPage();
-
- DECL_LINK( MoveHdl, Button * );
-
- virtual SaveInData* CreateSaveInData(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const rtl::OUString& aModuleId,
- bool docConfig ) = 0;
-
- virtual void Init() = 0;
- virtual void UpdateButtonStates() = 0;
- virtual short QueryReset() = 0;
-
- void PositionContentsListBox();
-
- SvLBoxEntry* InsertEntry( SvxConfigEntry* pNewEntryData,
- SvLBoxEntry* pTarget = NULL,
- bool bFront = FALSE );
-
- void AddSubMenusToUI( const String& rBaseTitle,
- SvxConfigEntry* pParentData );
-
- SvLBoxEntry* InsertEntryIntoUI ( SvxConfigEntry* pNewEntryData,
- ULONG nPos = LIST_APPEND );
-
- SvxEntries* FindParentForChild( SvxEntries* pParentEntries,
- SvxConfigEntry* pChildData );
-
- void ReloadTopLevelListBox( SvxConfigEntry* pSelection = NULL );
-
-public:
-
- static bool CanConfig( const ::rtl::OUString& rModuleId );
-
- SaveInData* GetSaveInData() { return pCurrentSaveInData; }
-
- SvLBoxEntry* AddFunction( SvLBoxEntry* pTarget = NULL,
- bool bFront = FALSE,
- bool bAllowDuplicates = FALSE );
-
- virtual void MoveEntry( bool bMoveUp );
-
- bool MoveEntryData( SvLBoxEntry* pSourceEntry,
- SvLBoxEntry* pTargetEntry );
-
- BOOL FillItemSet( SfxItemSet& );
- void Reset( const SfxItemSet& );
-
- virtual bool DeleteSelectedContent() = 0;
- virtual void DeleteSelectedTopLevel() = 0;
-
- SvxConfigEntry* GetTopLevelSelection()
- {
- return (SvxConfigEntry*) aTopLevelListBox.GetEntryData(
- aTopLevelListBox.GetSelectEntryPos() );
- }
-
- /** identifies the module in the given frame. If the frame is <NULL/>, a default
- frame will be determined beforehand.
-
- If the given frame is <NULL/>, a default frame will be used: The method the active
- frame of the desktop, then the current frame. If both are <NULL/>,
- the SfxViewFrame::Current's XFrame is used. If this is <NULL/>, too, an empty string is returned.
-
- If the given frame is not <NULL/>, or an default frame could be successfully determined, then
- the ModuleManager is asked for the module ID of the component in the frame.
- */
- static ::rtl::OUString
- GetFrameWithDefaultAndIdentify( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _inout_rxFrame );
-};
-
-class SvxMenuConfigPage : public SvxConfigPage
-{
-private:
-
- DECL_LINK( SelectMenu, ListBox * );
- DECL_LINK( SelectMenuEntry, Control * );
- DECL_LINK( NewMenuHdl, Button * );
- DECL_LINK( MenuSelectHdl, MenuButton * );
- DECL_LINK( EntrySelectHdl, MenuButton * );
- DECL_LINK( AddCommandsHdl, Button * );
- DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog * );
-
- void Init();
- void UpdateButtonStates();
- short QueryReset();
- bool DeleteSelectedContent();
- void DeleteSelectedTopLevel();
-
-public:
- SvxMenuConfigPage( Window *pParent, const SfxItemSet& rItemSet );
- ~SvxMenuConfigPage();
-
- SaveInData* CreateSaveInData(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const rtl::OUString& aModuleId,
- bool docConfig );
-};
-
-class SvxMainMenuOrganizerDialog : public ModalDialog
-{
- FixedText aMenuNameText;
- Edit aMenuNameEdit;
- FixedText aMenuListText;
- SvTreeListBox aMenuListBox;
- ImageButton aMoveUpButton;
- ImageButton aMoveDownButton;
- OKButton aOKButton;
- CancelButton aCloseButton;
- HelpButton aHelpButton;
-
- SvxEntries* pEntries;
- SvLBoxEntry* pNewMenuEntry;
- bool bModified;
-
- void UpdateButtonStates();
-
- DECL_LINK( MoveHdl, Button * );
- DECL_LINK( ModifyHdl, Edit * );
- DECL_LINK( SelectHdl, Control* );
-
-public:
- SvxMainMenuOrganizerDialog (
- Window*, SvxEntries*,
- SvxConfigEntry*, bool bCreateMenu = FALSE );
-
- ~SvxMainMenuOrganizerDialog ();
-
- SvxEntries* GetEntries();
- void SetEntries( SvxEntries* );
- SvxConfigEntry* GetSelectedEntry();
-};
-
-class SvxToolbarEntriesListBox : public SvxMenuEntriesListBox
-{
- Size m_aCheckBoxImageSizePixel;
- Link m_aChangedListener;
- SvLBoxButtonData* m_pButtonData;
- BOOL m_bHiContrastMode;
- SvxConfigPage* pPage;
-
- void ChangeVisibility( SvLBoxEntry* pEntry );
-
-protected:
-
- virtual void CheckButtonHdl();
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void BuildCheckBoxButtonImages( SvLBoxButtonData* );
- Image GetSizedImage(
- VirtualDevice& aDev, const Size& aNewSize, const Image& aImage );
-
-public:
-
- SvxToolbarEntriesListBox(
- Window* pParent, const ResId& );
-
- ~SvxToolbarEntriesListBox();
-
- void SetChangedListener( const Link& aChangedListener )
- { m_aChangedListener = aChangedListener; }
-
- const Link& GetChangedListener() const { return m_aChangedListener; }
-
- Size GetCheckBoxPixelSize() const
- { return m_aCheckBoxImageSizePixel; }
-
- virtual BOOL NotifyMoving(
- SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, ULONG& );
-
- virtual BOOL NotifyCopying(
- SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, ULONG&);
-
- void KeyInput( const KeyEvent& rKeyEvent );
-};
-
-class SvxToolbarConfigPage : public SvxConfigPage
-{
-private:
-
- DECL_LINK( SelectToolbar, ListBox * );
- DECL_LINK( SelectToolbarEntry, Control * );
- DECL_LINK( ToolbarSelectHdl, MenuButton * );
- DECL_LINK( EntrySelectHdl, MenuButton * );
- DECL_LINK( NewToolbarHdl, Button * );
- DECL_LINK( AddCommandsHdl, Button * );
- DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog * );
- DECL_LINK( MoveHdl, Button * );
-
- void UpdateButtonStates();
- short QueryReset();
- void Init();
- bool DeleteSelectedContent();
- void DeleteSelectedTopLevel();
-
-public:
- SvxToolbarConfigPage( Window *pParent, const SfxItemSet& rItemSet );
- ~SvxToolbarConfigPage();
-
- SvLBoxEntry* AddFunction( SvLBoxEntry* pTarget = NULL,
- bool bFront = FALSE,
- bool bAllowDuplicates = TRUE );
-
- void MoveEntry( bool bMoveUp );
-
- SaveInData* CreateSaveInData(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const rtl::OUString& aModuleId,
- bool docConfig );
-};
-
-class ToolbarSaveInData : public SaveInData
-{
-private:
-
- SvxConfigEntry* pRootEntry;
- rtl::OUString m_aDescriptorContainer;
-
- ::com::sun::star::uno::Reference
- < com::sun::star::container::XNameAccess > m_xPersistentWindowState;
-
- bool LoadToolbar(
- const ::com::sun::star::uno::Reference<
- com::sun::star::container::XIndexAccess >& xToolBarSettings,
- SvxConfigEntry* pParentData );
-
- void ApplyToolbar(
- com::sun::star::uno::Reference<
- com::sun::star::container::XIndexContainer >& rNewToolbarBar,
- com::sun::star::uno::Reference<
- com::sun::star::lang::XSingleComponentFactory >& rFactory,
- SvxConfigEntry *pToolbar = NULL );
-
-public:
-
- ToolbarSaveInData(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::ui::XUIConfigurationManager >&,
- const rtl::OUString& aModuleId,
- bool docConfig );
-
- ~ToolbarSaveInData();
-
- void CreateToolbar( SvxConfigEntry* pToolbar );
- void RestoreToolbar( SvxConfigEntry* pToolbar );
- void RemoveToolbar( SvxConfigEntry* pToolbar );
- void ApplyToolbar( SvxConfigEntry* pToolbar );
- void ReloadToolbar( const rtl::OUString& rURL );
-
- rtl::OUString GetSystemUIName( const rtl::OUString& rResourceURL );
-
- sal_Int32 GetSystemStyle( const rtl::OUString& rResourceURL );
-
- void SetSystemStyle(
- const rtl::OUString& rResourceURL, sal_Int32 nStyle );
-
- void SetSystemStyle(
- ::com::sun::star::uno::Reference
- < ::com::sun::star::frame::XFrame > xFrame,
- const rtl::OUString& rResourceURL, sal_Int32 nStyle );
-
- SvxEntries* GetEntries();
- void SetEntries( SvxEntries* );
- bool HasSettings();
- bool HasURL( const rtl::OUString& rURL );
- void Reset();
- bool Apply();
-};
-
-class SvxNewToolbarDialog : public ModalDialog
-{
-private:
- FixedText aFtDescription;
- Edit aEdtName;
- FixedText aSaveInText;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- Link aCheckNameHdl;
-
- DECL_LINK(ModifyHdl, Edit*);
-
-public:
- SvxNewToolbarDialog( Window* pWindow, const String& rName );
-
- ListBox aSaveInListBox;
-
- void GetName( rtl::OUString& rName ){rName = aEdtName.GetText();}
-
- void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
- {
- aCheckNameHdl = rLink;
- if ( bCheckImmediately )
- aBtnOK.Enable( rLink.Call( this ) > 0 );
- }
-
- void SetEditHelpId(ULONG nHelpId) {aEdtName.SetHelpId(nHelpId);}
-};
-
-class SvxIconSelectorDialog : public ModalDialog
-{
-private:
- FixedText aFtDescription;
- ToolBox aTbSymbol;
- FixedText aFtNote;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- PushButton aBtnImport;
- PushButton aBtnDelete;
- FixedLine aFlSeparator;
- sal_uInt16 m_nNextId;
-
- sal_Int32 m_nExpectedSize;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::ui::XImageManager > m_xImageManager;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::ui::XImageManager > m_xParentImageManager;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::ui::XImageManager > m_xImportedImageManager;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::graphic::XGraphicProvider > m_xGraphProvider;
-
- bool ReplaceGraphicItem( const ::rtl::OUString& aURL );
-
- bool ImportGraphic( const ::rtl::OUString& aURL );
-
- void ImportGraphics(
- const com::sun::star::uno::Sequence< rtl::OUString >& aURLs );
-
- BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);// Added by shizhoubo
-
-public:
-
- SvxIconSelectorDialog(
- Window *pWindow,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::ui::XImageManager >& rXImageManager,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::ui::XImageManager >& rXParentImageManager
- );
-
- ~SvxIconSelectorDialog();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
- GetSelectedIcon();
-
- DECL_LINK( SelectHdl, ToolBox * );
- DECL_LINK( ImportHdl, PushButton * );
- DECL_LINK( DeleteHdl, PushButton * );
-};
-
-class SvxIconReplacementDialog : public MessBox
-{
-public:
- SvxIconReplacementDialog(
- Window *pWindow,
- const rtl::OUString& aMessage,
- bool aYestoAll);
-
- SvxIconReplacementDialog(
- Window *pWindow,
- const rtl::OUString& aMessage );
-
- rtl::OUString ReplaceIconName( const rtl::OUString& );
- USHORT ShowDialog();
-};
-//added for issue83555
-class SvxIconChangeDialog : public ModalDialog
-{
-private:
- FixedImage aFImageInfo;
- OKButton aBtnOK;
- FixedText aDescriptionLabel;
- SvxDescriptionEdit aLineEditDescription;
-public:
- SvxIconChangeDialog(Window *pWindow, const rtl::OUString& aMessage);
-};
-#endif // _SVXCFG_HXX
diff --git a/svx/source/cui/cfg.src b/svx/source/cui/cfg.src
deleted file mode 100644
index 978ae6308b..0000000000
--- a/svx/source/cui/cfg.src
+++ /dev/null
@@ -1,875 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.src,v $
- * $Revision: 1.21 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svx/dialogs.hrc>
-#include "cfg.hrc"
-#include "helpid.hrc"
-
-TabDialog RID_SVXDLG_CUSTOMIZE
-{
- OutputSize = TRUE ;
- Text [ de ] = "Anpassen" ;
- Text [ en-US ] = "Customize" ;
- Moveable = TRUE ;
- SvLook = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_MENUS ;
- Text [ de ] = "Menüs" ;
- Text [ en-US ] = "Menus" ;
- PageResID = 300 ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_KEYBOARD ;
- Text [ de ] = "Tastatur" ;
- Text [ en-US ] = "Keyboard" ;
- PageResID = 301 ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_TOOLBARS ;
- Text [ de ] = "Symbolleisten" ;
- Text [ en-US ] = "Toolbars" ;
- PageResID = 302 ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_EVENTS ;
- Text [ de ] = "Ereignisse" ;
- Text [ en-US ] = "Events" ;
- PageResID = 303 ;
- };
- };
- };
-};
-
-#define TEXT_MENU \
- Text [ de ] = "Menü" ; \
- Text [ en-US ] = "Menu" ;\
-
-#define TEXT_BEGIN_GROUP \
- Text [ de ] = "Gruppe beginnen" ; \
- Text [ en-US ] = "Begin a Group" ;\
-
-#define TEXT_RENAME \
- Text [ de ] = "Umbenennen..." ; \
- Text [ en-US ] = "Rename..." ;\
-
-#define TEXT_DELETE \
- Text [ de ] = "Entfernen..." ; \
- Text [ en-US ] = "Delete..." ;\
-
-#define TEXT_DELETE_NODOTS \
- Text [ de ] = "Entfernen" ; \
- Text [ en-US ] = "Delete" ;\
-
-#define TEXT_MOVE \
- Text [ de ] = "Verschieben..." ; \
- Text [ en-US ] = "Move..." ;\
-
-#define TEXT_DEFAULT_STYLE \
- Text [ de ] = "Standard Einstellungen herstellen" ; \
- Text [ en-US ] = "Restore Default Settings" ;\
-
-#define TEXT_DEFAULT_COMMAND \
- Text [ de ] = "Standardbefehl ~wiederherstellen" ; \
- Text [ en-US ] = "Restore Default Command" ;\
-
-#define TEXT_TEXT_ONLY \
- Text [ de ] = "Nur Text" ; \
- Text [ en-US ] = "Text only" ;\
-
-#define TEXT_TOOLBAR_NAME \
- Text [ de ] = "Name der Symbolleiste" ; \
- Text [ en-US ] = "Toolbar Name" ;\
-
-#define TEXT_SAVE_IN \
- Text [ de ] = "Speichern in" ; \
- Text [ en-US ] = "Save In" ;\
-
-TabPage RID_SVXPAGE_MENUS
-{
- Hide = TRUE ;
- Size = MAP_APPFONT ( 273 , 258 ) ;
- HelpId = HID_SVX_CONFIG_MENU ;
- FixedLine GRP_MENUS
- {
- Pos = MAP_APPFONT ( 6 , 11 ) ;
- Size = MAP_APPFONT ( 261 , 8 ) ;
- Text [ de ] = "%PRODUCTNAME %MODULENAME Menüs" ;
- Text [ en-US ] = "%PRODUCTNAME %MODULENAME Menus" ;
- };
- FixedText FT_MENUS
- {
- Pos = MAP_APPFONT ( 9 , 24 ) ;
- Size = MAP_APPFONT ( 55 , 8 ) ;
- TEXT_MENU
- };
- ListBox LB_MENUS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 64 , 22 ) ;
- Size = MAP_APPFONT ( 108 , 108 ) ;
- DropDown = TRUE ;
- };
- PushButton BTN_NEW
- {
- Pos = MAP_APPFONT ( 192 , 22 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Text [ de ] = "Neu..." ;
- Text [ en-US ] = "New..." ;
- };
- MenuButton BTN_CHANGE
- {
- Pos = MAP_APPFONT ( 192 , 39 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- TEXT_MENU
- };
- FixedLine GRP_MENU_SEPARATOR
- {
- Pos = MAP_APPFONT ( 6 , 56 ) ;
- Size = MAP_APPFONT ( 261 , 8 ) ;
- Text [ de ] = "Menüinhalt" ;
- Text [ en-US ] = "Menu Content" ;
- };
- FixedText GRP_MENU_ENTRIES
- {
- Pos = MAP_APPFONT ( 9 , 67 ) ;
- Size = MAP_APPFONT ( 55 , 8 ) ;
- Group = TRUE ;
- Text [ de ] = "Einträge" ;
- Text [ en-US ] = "Entries" ;
- };
- Control BOX_ENTRIES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 64 , 67 ) ;
- Size = MAP_APPFONT ( 108 , 115 ) ;
- TabStop = TRUE ;
- HelpId = HID_SVX_CONFIG_MENU_CONTENTS ;
- };
- PushButton BTN_ADD_COMMANDS
- {
- Pos = MAP_APPFONT ( 192 , 67 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Text [ de ] = "Hinzufügen..." ;
- Text [ en-US ] = "Add..." ;
- };
- MenuButton BTN_CHANGE_ENTRY
- {
- Pos = MAP_APPFONT ( 192 , 84 ) ;
- Size = MAP_APPFONT ( 75 , 14 ) ;
- TabStop = TRUE ;
- Text [ de ] = "Ändern" ;
- Text [ en-US ] = "Modify" ;
- };
- ImageButton BTN_UP
- {
- Pos = MAP_APPFONT ( 175 , 102 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TabStop = TRUE ;
- Symbol = IMAGEBUTTON_ARROW_UP ;
- Disable = TRUE ;
- };
- ImageButton BTN_DOWN
- {
- Pos = MAP_APPFONT ( 175 , 119 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TabStop = TRUE ;
- Symbol = IMAGEBUTTON_ARROW_DOWN ;
- Disable = TRUE ;
- };
- FixedText TXT_SAVEIN
- {
- Pos = MAP_APPFONT ( 9 , 190 ) ;
- Size = MAP_APPFONT ( 55 , 8 ) ;
- Group = TRUE ;
- TEXT_SAVE_IN
- };
- ListBox LB_SAVEIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 64 , 188 ) ;
- Size = MAP_APPFONT ( 108 , 53 ) ;
- DropDown = TRUE ;
- };
- FixedText FT_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 205 ) ;
- Size = MAP_APPFONT ( 261 , 8 ) ;
- Text [ de ] = "Beschreibung" ;
- Text [ en-US ] = "Description" ;
- };
- MultiLineEdit ED_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 216 ) ;
- Size = MAP_APPFONT ( 261 , 36 ) ;
- Border = TRUE;
- VScroll = TRUE;
- IgnoreTab = TRUE;
- ReadOnly = TRUE;
- };
-};
-
-Menu MODIFY_MENU
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = ID_MOVE ;
- TEXT_MOVE
- };
- MenuItem
- {
- Identifier = ID_RENAME ;
- TEXT_RENAME
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_DELETE ;
- TEXT_DELETE
- };
- };
-};
-
-Menu MODIFY_ENTRY
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = ID_ADD_SUBMENU ;
- Text [ de ] = "Untermenü einfügen..." ;
- Text [ en-US ] = "Add Submenu..." ;
- };
- MenuItem
- {
- Identifier = ID_BEGIN_GROUP ;
- TEXT_BEGIN_GROUP
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_RENAME ;
- TEXT_RENAME
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_DELETE ;
- TEXT_DELETE_NODOTS
- };
- };
-};
-
-Menu MODIFY_TOOLBAR
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = ID_RENAME ;
- TEXT_RENAME
- };
- MenuItem
- {
- Identifier = ID_DELETE ;
- TEXT_DELETE_NODOTS
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_DEFAULT_STYLE ;
- TEXT_DEFAULT_STYLE
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_ICONS_ONLY ;
- RadioCheck = TRUE ;
- AutoCheck = TRUE ;
- Text [ de ] = "Nur Symbole" ;
- Text [ en-US ] = "Icons Only" ;
- };
- MenuItem
- {
- Identifier = ID_TEXT_ONLY ;
- RadioCheck = TRUE ;
- AutoCheck = TRUE ;
- TEXT_TEXT_ONLY
- };
- MenuItem
- {
- Identifier = ID_ICONS_AND_TEXT ;
- RadioCheck = TRUE ;
- AutoCheck = TRUE ;
- Text [ de ] = "Symbole & Text" ;
- Text [ en-US ] = "Icons & Text" ;
- };
- };
-};
-
-Menu MODIFY_TOOLBAR_CONTENT
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = ID_RENAME ;
- TEXT_RENAME
- };
- MenuItem
- {
- Identifier = ID_DELETE ;
- TEXT_DELETE_NODOTS
- };
- MenuItem
- {
- Identifier = ID_DEFAULT_COMMAND ;
- TEXT_DEFAULT_COMMAND
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_BEGIN_GROUP ;
- TEXT_BEGIN_GROUP
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- /*
- MenuItem
- {
- Identifier = ID_ICON_ONLY ;
- Text [ de ] = "Nur Symbol" ;
- Text [ en-US ] = "Icon Only" ;
- RadioCheck = TRUE ;
- AutoCheck = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_TEXT_ONLY ;
- Text [ de ] = "Nur Text" ;
- Text [ en-US ] = "Text Only" ;
- RadioCheck = TRUE ;
- AutoCheck = TRUE ;
- };
- MenuItem
- {
- Identifier = ID_ICON_AND_TEXT ;
- Text [ de ] = "Symbol & Text" ;
- Text [ en-US ] = "Icon & Text" ;
- RadioCheck = TRUE ;
- AutoCheck = TRUE ;
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- */
- MenuItem
- {
- Identifier = ID_CHANGE_SYMBOL ;
- Text [ de ] = "Symbol austauschen..." ;
- Text [ en-US ] = "Change Icon..." ;
- };
- MenuItem
- {
- Identifier = ID_RESET_SYMBOL ;
- Text [ de ] = "Symbol zurücksetzen" ;
- Text [ en-US ] = "Reset Icon" ;
- };
- };
-};
-
-/* %n will be replaced at runtime by a number starting with 1 and increasing as necessary */
-String RID_SVXSTR_NEW_MENU
-{
- Text [ de ] = "Neues Menü %n";
- Text [ en-US ] = "New Menu %n";
-};
-
-/* %n will be replaced at runtime by a number starting with 1 and increasing as necessary */
-String RID_SVXSTR_NEW_TOOLBAR
-{
- Text [ de ] = "Neue Symbolleiste %n";
- Text [ en-US ] = "New Toolbar %n";
-};
-
-String RID_SVXSTR_MOVE_MENU
-{
- Text [ de ] = "Menü verschieben";
- Text [ en-US ] = "Move Menu";
-};
-
-String RID_SVXSTR_ADD_SUBMENU
-{
- Text [ de ] = "Untermenü hinzufügen";
- Text [ en-US ] = "Add Submenu";
-};
-
-String RID_SVXSTR_SUBMENU_NAME
-{
- Text [ de ] = "Name des Untermenüs";
- Text [ en-US ] = "Submenu name";
-};
-
-String RID_SVXSTR_MENU_ADDCOMMANDS_DESCRIPTION
-{
- Text [ de ] = "Um Befehle einem menu hinzuzufügen, wählen Sie zuerst eine Kategorie und dann den Befehl. Alternativ ziehen Sie den Befehl in die Befehlsliste auf der Registerseite 'Menüs' im Dialog 'Anpassen'.";
- Text [ en-US ] = "To add a command to a menu, select the category and then the command. You can also drag the command to the Commands list of the Menus tab page in the Customize dialog.";
-};
-
-ModalDialog MD_MENU_ORGANISER
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 172 , 154 ) ;
- Text [ de ] = "Neues Menü" ;
- Text [ en-US ] = "New Menu" ;
- SvLook = TRUE ;
- Moveable = TRUE ;
- HelpId = HID_SVX_CONFIG_MENU_ORGANIZER;
- FixedText TXT_MENU_NAME
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 93 , 8 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Text [ de ] = "Menüname" ;
- Text [ en-US ] = "Menu name" ;
- };
- Edit EDIT_MENU_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 19 ) ;
- Size = MAP_APPFONT ( 93 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText TXT_MENU
- {
- Pos = MAP_APPFONT ( 6 , 37 ) ;
- Size = MAP_APPFONT ( 93 , 8 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Text [ de ] = "Menüposition" ;
- Text [ en-US ] = "Menu position" ;
- };
- Control BOX_MAIN_MENUS
- {
- HelpId = HID_SVX_CONFIG_MENU_LISTBOX ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 48 ) ;
- Size = MAP_APPFONT ( 93 , 100 ) ;
- TabStop = TRUE ;
- };
- ImageButton BTN_MENU_UP
- {
- Pos = MAP_APPFONT ( 102 , 80 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TabStop = TRUE ;
- Symbol = IMAGEBUTTON_ARROW_UP ;
- };
- ImageButton BTN_MENU_DOWN
- {
- Pos = MAP_APPFONT ( 102 , 97 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- TabStop = TRUE ;
- Symbol = IMAGEBUTTON_ARROW_DOWN ;
- };
- OKButton BTN_MENU_ADD
- {
- DefButton = TRUE;
- Pos = MAP_APPFONT ( 119 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- CancelButton BTN_MENU_CLOSE
- {
- Pos = MAP_APPFONT ( 119 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_MENU_HELP
- {
- Pos = MAP_APPFONT ( 119 , 40 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
-// MD_NEW_TOOLBAR -------------------------------------------------
-ModalDialog MD_NEW_TOOLBAR
-{
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 165 , 63 ) ;
- Text [ de ] = "Name" ;
- Text [ en-US ] = "Name" ;
- Moveable = TRUE ;
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 98 , 8 ) ;
- TEXT_TOOLBAR_NAME
- WordBreak = TRUE ;
- };
- Edit EDT_STRING
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 17 ) ;
- Size = MAP_APPFONT ( 97 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText TXT_SAVEIN
- {
- Pos = MAP_APPFONT ( 6 , 35 ) ;
- Size = MAP_APPFONT ( 98 , 8 ) ;
- Group = TRUE ;
- TEXT_SAVE_IN
- };
- ListBox LB_SAVEIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 43 ) ;
- Size = MAP_APPFONT ( 97 , 53 ) ;
- DropDown = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 109 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 109 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 109 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-#ifndef IMAGE_STDBTN_COLOR
-#define IMAGE_STDBTN_COLOR Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
-#endif
-
-ModalDialog MD_ICONSELECTOR
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 240 , 152 ) ;
- Text [ de ] = "Symbole Austauschen" ;
- Text [ en-US ] = "Change Icon" ;
- Moveable = TRUE ;
- HelpId = HID_SVX_CONFIG_ICON_SELECTOR;
- FixedText FT_SYMBOLS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 172 , 8 ) ;
- Text [ de ] = "Symbole" ;
- Text [ en-US ] = "Icons" ;
- };
- ToolBox TB_SYMBOLS
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 160 , 80 ) ;
- Scroll = TRUE ;
- LineSpacing = TRUE ;
- Customize = FALSE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 60 , 130 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 120 , 130 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 180 , 130 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- PushButton BTN_IMPORT
- {
- Pos = MAP_APPFONT ( 184 , 7 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ de ] = "Importieren..." ;
- Text[ en-US ] = "Import...";
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 184 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text[ en-US ] = "Delete...";
- };
- FixedText FT_NOTE
- {
- Pos = MAP_APPFONT ( 12 , 95 ) ;
- Size = MAP_APPFONT ( 200 , 24 ) ;
- Text [ de ] = "Hinweis:\nBitte beachten Sie das für einen erfolgreichen Import die Symbole eine Größe von 16x16 Pixel haben müssen." ;
- Text [ en-US ] = "Note:\nThe size of an icon should be 16x16 pixel to achieve best quality. Different sized icons will be scaled automatically." ;
- Left = TRUE ;
- WordBreak = TRUE;
- };
- FixedLine FL_SEPARATOR
- {
- Pos = MAP_APPFONT ( 0, 120 );
- Size = MAP_APPFONT ( 240, 8 );
- };
- Color IMAGE_BTN_COLOR
- {
- Red = 0xC000 ;
- Green = 0xC000 ;
- Blue = 0xC000 ;
- };
-};
-//added for issue83555
-ModalDialog MD_ICONCHANGE
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 200 , 150 ) ;
- Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION" ;
- Moveable = TRUE ;
- FixedImage FI_INFO
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 24 , 24 ) ;
- Fixed = Image
- {
-
- };
- };
- FixedText FTCHGE_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 30 ,15 ) ;
- Size = MAP_APPFONT ( 200 , 50 ) ;
- Text [ en-US ] = "The files listed below could not be imported.\nThe file format could not be interpreted." ;
- };
-
- MultiLineEdit EDT_ADDR
- {
- Pos = MAP_APPFONT ( 30 , 38) ;
- Size = MAP_APPFONT ( 140 , 83 ) ;
- Border = TRUE;
- // VScroll = TRUE;
- IgnoreTab = TRUE;
- ReadOnly = TRUE;
- };
- OKButton MD_BTN_OK
- {
- Pos = MAP_APPFONT ( 68 , 131 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
-
-};
-
-// Strings ---------------------------------------------------------------
-String RID_SVXSTR_IMPORT_ICON_ERROR
-{
- Text [ de ] = "Die aufgelisteten Dateien konnten nicht importiert werden. Die Symbole entsprechen nicht der Größe von 16x16 Pixel." ;
- Text [ en-US ] = "The files listed below could not be imported. The file format could not be interpreted." ;
-};
-
-String RID_SVXSTR_DELETE_ICON_CONFIRM //added for issue73355
-{
- Text [ en-US ] = "Are you sure to delete the image?" ;
-};
-
-String RID_SVXSTR_REPLACE_ICON_WARNING //added for issue73355
-{
- Text [ en-US ] = "The icon %ICONNAME is already contained in the image list.\nWould you like to replace the existing icon?";
-};
-
-String RID_SVXSTR_REPLACE_ICON_CONFIRM //added for issue73355
-{
- Text [ en-US ] = "Confirm Icon Replacement";
-};
-
-String RID_SVXSTR_YESTOALL //added for issue73355
-{
- Text [ en-US ] = "Yes to All";
-};
-
-String RID_SVXSTR_PRODUCTNAME_TOOLBARS
-{
- Text [ de ] = "%PRODUCTNAME %MODULENAME Symbolleisten" ;
- Text [ en-US ] = "%PRODUCTNAME %MODULENAME Toolbars" ;
-};
-
-String RID_SVXSTR_TOOLBAR
-{
- Text [ de ] = "Symbolleiste" ;
- Text [ en-US ] = "Toolbar" ;
-};
-
-String RID_SVXSTR_TOOLBAR_CONTENT
-{
- Text [ de ] = "Symbolleisteninhalt" ;
- Text [ en-US ] = "Toolbar Content" ;
-};
-
-String RID_SVXSTR_COMMANDS
-{
- Text [ de ] = "Befehle" ;
- Text [ en-US ] = "Commands" ;
-};
-
-String RID_SVXSTR_COMMAND
-{
- Text [ de ] = "Befehl" ;
- Text [ en-US ] = "Command" ;
-};
-
-String RID_SVXSTR_TOOLBAR_NAME
-{
- TEXT_TOOLBAR_NAME
-};
-
-/* %MENUNAME will be replaced at runtime by the name of the selected menu. */
-QueryBox QBX_CONFIRM_DELETE_MENU
-{
- Message [ de ] = "Sind Sie sicher, dass Sie das Menü '%MENUNAME' löschen möchten?";
- Message [ en-US ] = "Are you sure you want to delete the '%MENUNAME' menu?";
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_NO ;
-};
-
-QueryBox QBX_CONFIRM_DELETE_TOOLBAR
-{
- Message [ de ] = "Die Symbolleiste beinhaltet keine Befehle mehr. Soll die Symbolleiste gelöscht werden?";
- Message [ en-US ] = "There are no more commands on the toolbar. Do you want to delete the toolbar?";
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_NO ;
-};
-
-/* Translators: Do not translate %SAVE IN SELECTION% It is a placeholder and will be
- replaced at runtime by the name of the selected application or document.
-*/
-QueryBox QBX_CONFIRM_RESET
-{
- Message [ de ] = "Die Menükonfiguration für %SAVE IN SELECTION% wird auf die Standardeinstellung zurückgesetzt. Möchten Sie fortfahren?";
- Message [ en-US ] = "The menu configuration for %SAVE IN SELECTION% will be reset to the factory settings. Do you want to continue?";
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_NO ;
-};
-
-/* Translators: Do not translate %SAVE IN SELECTION% It is a placeholder
- and will be replaced at runtime by the name of the selected application
- or document.
-*/
-String RID_SVXSTR_CONFIRM_MENU_RESET
-{
- Text [ de ] = "Die Menükonfiguration für %SAVE IN SELECTION% wird auf die Standardeinstellung zurückgesetzt. Möchten Sie fortfahren?";
- Text [ en-US ] = "The menu configuration for %SAVE IN SELECTION% will be reset to the factory settings. Do you want to continue?";
-};
-
-String RID_SVXSTR_CONFIRM_TOOLBAR_RESET
-{
- Text [ de ] = "Die Symbolleistenkonfiguration für %SAVE IN SELECTION% wird auf die Standardeinstellung zurückgesetzt. Möchten Sie fortfahren?";
- Text [ en-US ] = "The toolbar configuration for %SAVE IN SELECTION% will be reset to the factory settings. Do you want to continue?";
-};
-
-QueryBox QBX_CONFIRM_RESTORE_DEFAULT
-{
- Message [ de ] = "Alle Anpassungen die an dieser Symbolleiste vorgenommen wurden werden gelöscht. Möchten Sie diese Symbolleiste wirklich zurücksetzen?";
- Message [ en-US ] = "This will delete all changes previously made to this toolbar. Do you really want to reset the toolbar?";
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_NO ;
-};
-
-InfoBox IBX_MNUCFG_ALREADY_INCLUDED
-{
- Message [ de ] = "Die Funktion ist bereits in diesem Popup enthalten." ;
- Message [ en-US ] = "Function is already included in this popup." ;
-};
-
-String RID_SVXSTR_LABEL_NEW_NAME
-{
- Text [ de ] = "~Neuer Name";
- Text [ en-US ] = "~New name";
-};
-
-String RID_SVXSTR_RENAME_MENU
-{
- Text [ de ] = "Menü umbenennen";
- Text [ en-US ] = "Rename Menu";
-};
-
-String RID_SVXSTR_RENAME_TOOLBAR
-{
- Text [ de ] = "Symbolleiste umbenennen";
- Text [ en-US ] = "Rename Toolbar";
-};
-
-
diff --git a/svx/source/cui/cfgchart.cxx b/svx/source/cui/cfgchart.cxx
deleted file mode 100644
index 2925fd9e7f..0000000000
--- a/svx/source/cui/cfgchart.cxx
+++ /dev/null
@@ -1,327 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfgchart.cxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-// header for SvStream
-#include <tools/stream.hxx>
-// header for SAL_STATIC_CAST
-#include <sal/types.h>
-
-#include "cfgchart.hxx"
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-
-#define ROW_COLOR_COUNT 12
-
-using namespace com::sun::star;
-
-TYPEINIT1( SvxChartColorTableItem, SfxPoolItem );
-
-SvxChartColorTable::SvxChartColorTable()
-{}
-
-SvxChartColorTable::SvxChartColorTable( const SvxChartColorTable & _rSource ) :
- m_aColorEntries( _rSource.m_aColorEntries )
-{}
-
-// accessors
-size_t SvxChartColorTable::size() const
-{
- return m_aColorEntries.size();
-}
-
-const XColorEntry & SvxChartColorTable::operator[]( size_t _nIndex ) const
-{
- if ( _nIndex >= m_aColorEntries.size() )
- {
- DBG_ERRORFILE( "SvxChartColorTable::[] invalid index" );
- return m_aColorEntries[ 0 ];
- }
-
- return m_aColorEntries[ _nIndex ];
-}
-
-ColorData SvxChartColorTable::getColorData( size_t _nIndex ) const
-{
- if ( _nIndex >= m_aColorEntries.size() )
- {
- DBG_ERRORFILE( "SvxChartColorTable::getColorData invalid index" );
- return COL_BLACK;
- }
-
- // GetColor should be const but unfortunately isn't
- return const_cast< XColorEntry & >( m_aColorEntries[ _nIndex ] ).GetColor().GetRGBColor();
-}
-
-// mutators
-void SvxChartColorTable::clear()
-{
- m_aColorEntries.clear();
-}
-
-void SvxChartColorTable::append( const XColorEntry & _rEntry )
-{
- m_aColorEntries.push_back( _rEntry );
-}
-
-void SvxChartColorTable::replace( size_t _nIndex, const XColorEntry & _rEntry )
-{
- DBG_ASSERT( _nIndex <= m_aColorEntries.size(),
- "SvxChartColorTable::replace invalid index" );
-
- Color aCol1 = m_aColorEntries[ _nIndex ].GetColor(), aCol2;
- m_aColorEntries[ _nIndex ] = _rEntry;
- aCol2 = m_aColorEntries[ _nIndex ].GetColor();
- if ( aCol2 != const_cast< XColorEntry& >( _rEntry ).GetColor() )
- {
- DBG_ERRORFILE( "wrong color" );
- }
-}
-
-void SvxChartColorTable::useDefault()
-{
- ColorData aColors[] = {
- RGB_COLORDATA( 0x00, 0x45, 0x86 ),
- RGB_COLORDATA( 0xff, 0x42, 0x0e ),
- RGB_COLORDATA( 0xff, 0xd3, 0x20 ),
- RGB_COLORDATA( 0x57, 0x9d, 0x1c ),
- RGB_COLORDATA( 0x7e, 0x00, 0x21 ),
- RGB_COLORDATA( 0x83, 0xca, 0xff ),
- RGB_COLORDATA( 0x31, 0x40, 0x04 ),
- RGB_COLORDATA( 0xae, 0xcf, 0x00 ),
- RGB_COLORDATA( 0x4b, 0x1f, 0x6f ),
- RGB_COLORDATA( 0xff, 0x95, 0x0e ),
- RGB_COLORDATA( 0xc5, 0x00, 0x0b ),
- RGB_COLORDATA( 0x00, 0x84, 0xd1 )
- };
-
- clear();
-
- String aResName( SVX_RES( RID_SVXSTR_DIAGRAM_ROW ) );
- String aPrefix, aPostfix, aName;
- xub_StrLen nPos = aResName.SearchAscii( "$(ROW)" );
- if( nPos != STRING_NOTFOUND )
- {
- aPrefix = String( aResName, 0, nPos );
- aPostfix = String( aResName, nPos + sizeof( "$(ROW)" ) - 1, STRING_LEN );
- }
- else
- aPrefix = aResName;
-
- for( sal_Int32 i=0; i<ROW_COLOR_COUNT; i++ )
- {
- aName = aPrefix;
- aName.Append( String::CreateFromInt32( i + 1 ));
- aName.Append( aPostfix );
-
- append( XColorEntry( aColors[ i % sizeof( aColors ) ], aName ));
- }
-}
-
-// comparison
-bool SvxChartColorTable::operator==( const SvxChartColorTable & _rOther ) const
-{
- // note: XColorEntry has no operator ==
- bool bEqual = ( this->m_aColorEntries.size() == _rOther.m_aColorEntries.size() );
-
- if( bEqual )
- {
- for( size_t i = 0; i < m_aColorEntries.size(); ++i )
- {
- if( getColorData( i ) != _rOther.getColorData( i ))
- {
- bEqual = false;
- break;
- }
- }
- }
-
- return bEqual;
-}
-
-// ====================
-// class SvxChartOptions
-// ====================
-
-SvxChartOptions::SvxChartOptions() :
- ::utl::ConfigItem( rtl::OUString::createFromAscii( "Office.Chart" )),
- mbIsInitialized( FALSE )
-{
- maPropertyNames.realloc( 1 );
- maPropertyNames[ 0 ] = ::rtl::OUString::createFromAscii( "DefaultColor/Series" );
-}
-
-SvxChartOptions::~SvxChartOptions()
-{
-}
-
-const SvxChartColorTable& SvxChartOptions::GetDefaultColors()
-{
- if ( !mbIsInitialized )
- mbIsInitialized = RetrieveOptions();
- return maDefColors;
-}
-
-void SvxChartOptions::SetDefaultColors( const SvxChartColorTable& aCol )
-{
- maDefColors = aCol;
- SetModified();
-}
-
-BOOL SvxChartOptions::RetrieveOptions()
-{
- // get sequence containing all properties
-
- uno::Sequence< ::rtl::OUString > aNames = GetPropertyNames();
- uno::Sequence< uno::Any > aProperties( aNames.getLength());
- aProperties = GetProperties( aNames );
-
- if( aProperties.getLength() == aNames.getLength())
- {
- // 1. default colors for series
- maDefColors.clear();
- uno::Sequence< sal_Int64 > aColorSeq;
- aProperties[ 0 ] >>= aColorSeq;
-
- sal_Int32 nCount = aColorSeq.getLength();
- Color aCol;
-
- // create strings for entry names
- String aResName( SVX_RES( RID_SVXSTR_DIAGRAM_ROW ) );
- String aPrefix, aPostfix, aName;
- xub_StrLen nPos = aResName.SearchAscii( "$(ROW)" );
- if( nPos != STRING_NOTFOUND )
- {
- aPrefix = String( aResName, 0, nPos );
- aPostfix = String( aResName, nPos + sizeof( "$(ROW)" ) - 1, STRING_LEN );
- }
- else
- aPrefix = aResName;
-
- // set color values
- for( sal_Int32 i=0; i < nCount; i++ )
- {
- aCol.SetColor( SAL_STATIC_CAST( ColorData, aColorSeq[ i ] ));
-
- aName = aPrefix;
- aName.Append( String::CreateFromInt32( i + 1 ));
- aName.Append( aPostfix );
-
- maDefColors.append( XColorEntry( aCol, aName ));
- }
- return TRUE;
- }
- return FALSE;
-}
-
-void SvxChartOptions::Commit()
-{
- uno::Sequence< ::rtl::OUString > aNames = GetPropertyNames();
- uno::Sequence< uno::Any > aValues( aNames.getLength());
-
- if( aValues.getLength() >= 1 )
- {
- // 1. default colors for series
- // convert list to sequence
- const size_t nCount = maDefColors.size();
- uno::Sequence< sal_Int64 > aColors( nCount );
- for( size_t i=0; i < nCount; i++ )
- {
- ColorData aData = maDefColors.getColorData( i );
- aColors[ i ] = aData;
- }
-
- aValues[ 0 ] <<= aColors;
- }
-
- PutProperties( aNames, aValues );
-}
-
-// --------------------
-// class SvxChartColorTableItem
-// --------------------
-
-SvxChartColorTableItem::SvxChartColorTableItem( USHORT nWhich_, const SvxChartColorTable& aTable ) :
- SfxPoolItem( nWhich_ ),
- m_aColorTable( aTable )
-{
-}
-
-SvxChartColorTableItem::SvxChartColorTableItem( const SvxChartColorTableItem& rOther ) :
- SfxPoolItem( rOther ),
- m_aColorTable( rOther.m_aColorTable )
-{
-}
-
-SfxPoolItem* __EXPORT SvxChartColorTableItem::Clone( SfxItemPool * ) const
-{
- return new SvxChartColorTableItem( *this );
-}
-
-int __EXPORT SvxChartColorTableItem::operator==( const SfxPoolItem& rAttr ) const
-{
- DBG_ASSERT( SfxPoolItem::operator==( rAttr ), "SvxChartColorTableItem::operator== : types differ" );
-
- const SvxChartColorTableItem * rCTItem( dynamic_cast< const SvxChartColorTableItem * >( & rAttr ));
- if( rCTItem )
- {
- return (this->m_aColorTable == rCTItem->GetColorTable());
- }
-
- return 0;
-}
-
-void __EXPORT SvxChartColorTableItem::SetOptions( SvxChartOptions* pOpts ) const
-{
- if ( pOpts )
- pOpts->SetDefaultColors( m_aColorTable );
-}
-
-
-SvxChartColorTable & SvxChartColorTableItem::GetColorTable()
-{
- return m_aColorTable;
-}
-
-const SvxChartColorTable & SvxChartColorTableItem::GetColorTable() const
-{
- return m_aColorTable;
-}
-
-void SvxChartColorTableItem::ReplaceColorByIndex( size_t _nIndex, const XColorEntry & _rEntry )
-{
- m_aColorTable.replace( _nIndex, _rEntry );
-}
diff --git a/svx/source/cui/cfgchart.hxx b/svx/source/cui/cfgchart.hxx
deleted file mode 100644
index b519823466..0000000000
--- a/svx/source/cui/cfgchart.hxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfgchart.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_CFGCHART_HXX
-#define _SVX_CFGCHART_HXX
-
-// header for TYPEINFO
-#include <tools/rtti.hxx>
-// header for ConfigItem
-#include <unotools/configitem.hxx>
-// header for SfxPoolItem
-#include <svtools/poolitem.hxx>
-// header for XColorEntry
-#include <svx/xtable.hxx>
-
-#include <vector>
-
-class SvxChartColorTable
-{
-private:
- ::std::vector< XColorEntry > m_aColorEntries;
-
-public:
- SvxChartColorTable();
- explicit SvxChartColorTable( const SvxChartColorTable & _rSource );
-
- // accessors
- size_t size() const;
- const XColorEntry & operator[]( size_t _nIndex ) const;
- ColorData getColorData( size_t _nIndex ) const;
-
- // mutators
- void clear();
- void append( const XColorEntry & _rEntry );
- void replace( size_t _nIndex, const XColorEntry & _rEntry );
- void useDefault();
-
- // comparison
- bool operator==( const SvxChartColorTable & _rOther ) const;
-};
-
-// ====================
-// all options
-// ====================
-class SvxChartOptions : public ::utl::ConfigItem
-{
-private:
- SvxChartColorTable maDefColors;
- BOOL mbIsInitialized;
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString >
- maPropertyNames;
-
- inline ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPropertyNames() const
- { return maPropertyNames; }
- BOOL RetrieveOptions();
-
-public:
- SvxChartOptions();
- virtual ~SvxChartOptions();
-
- const SvxChartColorTable& GetDefaultColors();
- void SetDefaultColors( const SvxChartColorTable& aCol );
-
- virtual void Commit();
-};
-
-// ====================
-// items
-// ====================
-class SvxChartColorTableItem : public SfxPoolItem
-{
-public:
- TYPEINFO();
- SvxChartColorTableItem( USHORT nWhich, const SvxChartColorTable& );
- SvxChartColorTableItem( const SvxChartColorTableItem& );
-
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual int operator==( const SfxPoolItem& ) const;
- void SetOptions( SvxChartOptions* pOpts ) const;
-
- const SvxChartColorTable & GetColorTable() const ;
- SvxChartColorTable & GetColorTable();
- void ReplaceColorByIndex( size_t _nIndex, const XColorEntry & _rEntry );
-
-private:
- SvxChartColorTable m_aColorTable;
-};
-
-#endif // _SVX_CFGCHART_HXX
-
diff --git a/svx/source/cui/cfgutil.cxx b/svx/source/cui/cfgutil.cxx
deleted file mode 100644
index 9df95d970d..0000000000
--- a/svx/source/cui/cfgutil.cxx
+++ /dev/null
@@ -1,1801 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.cxx,v $
- * $Revision: 1.65 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include "cfgutil.hxx"
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
-#include <com/sun/star/script/provider/XScriptProvider.hpp>
-#include <com/sun/star/script/browse/XBrowseNode.hpp>
-#include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
-
-#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
-#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include <com/sun/star/document/XScriptInvocationContext.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-
-#include "acccfg.hrc"
-#include "helpid.hrc"
-#include <basic/sbx.hxx>
-#include <basic/basicmanagerrepository.hxx>
-#include <basic/sbstar.hxx>
-#include <basic/sbxmeth.hxx>
-#include <basic/sbmod.hxx>
-#include <basic/basmgr.hxx>
-#include <tools/urlobj.hxx>
-#include "svx/dialogs.hrc"
-#include <sfx2/app.hxx>
-#include <sfx2/macrconf.hxx>
-#include <sfx2/minfitem.hxx>
-#include <unotools/processfactory.hxx>
-#include <comphelper/documentinfo.hxx>
-#include <svtools/imagemgr.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <comphelper/sequenceashashmap.hxx>
-#include <unotools/configmgr.hxx>
-#include "svx/dialmgr.hxx"
-#include <svtools/stritem.hxx>
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::document;
-namespace css = ::com::sun::star;
-
-static ::rtl::OUString SERVICE_UICATEGORYDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.ui.UICategoryDescription" );
-static ::rtl::OUString SERVICE_UICMDDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription");
-
-SfxStylesInfo_Impl::SfxStylesInfo_Impl()
-{}
-
-void SfxStylesInfo_Impl::setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel)
-{
- m_xDoc = xModel;
-}
-
-static ::rtl::OUString FAMILY_CHARACTERSTYLE = ::rtl::OUString::createFromAscii("CharacterStyles");
-static ::rtl::OUString FAMILY_PARAGRAPHSTYLE = ::rtl::OUString::createFromAscii("ParagraphStyles");
-static ::rtl::OUString FAMILY_FRAMESTYLE = ::rtl::OUString::createFromAscii("FrameStyles" );
-static ::rtl::OUString FAMILY_PAGESTYLE = ::rtl::OUString::createFromAscii("PageStyles" );
-static ::rtl::OUString FAMILY_NUMBERINGSTYLE = ::rtl::OUString::createFromAscii("NumberingStyles");
-
-static ::rtl::OUString CMDURL_SPART = ::rtl::OUString::createFromAscii(".uno:StyleApply?Style:string=");
-static ::rtl::OUString CMDURL_FPART2 = ::rtl::OUString::createFromAscii("&FamilyName:string=");
-
-static ::rtl::OUString CMDURL_STYLEPROT_ONLY = ::rtl::OUString::createFromAscii(".uno:StyleApply?");
-static ::rtl::OUString CMDURL_SPART_ONLY = ::rtl::OUString::createFromAscii("Style:string=");
-static ::rtl::OUString CMDURL_FPART_ONLY = ::rtl::OUString::createFromAscii("FamilyName:string=");
-
-static ::rtl::OUString STYLEPROP_UINAME = ::rtl::OUString::createFromAscii("DisplayName");
-
-::rtl::OUString SfxStylesInfo_Impl::generateCommand(const ::rtl::OUString& sFamily, const ::rtl::OUString& sStyle)
-{
- ::rtl::OUStringBuffer sCommand(1024);
- sCommand.append(CMDURL_SPART );
- sCommand.append(sStyle );
- sCommand.append(CMDURL_FPART2);
- sCommand.append(sFamily );
- return sCommand.makeStringAndClear();
-}
-
-sal_Bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle)
-{
- static sal_Int32 LEN_STYLEPROT = CMDURL_STYLEPROT_ONLY.getLength();
- static sal_Int32 LEN_SPART = CMDURL_SPART_ONLY.getLength();
- static sal_Int32 LEN_FPART = CMDURL_FPART_ONLY.getLength();
-
- if (aStyle.sCommand.indexOf(CMDURL_STYLEPROT_ONLY, 0) != 0)
- return sal_False;
-
- aStyle.sFamily = ::rtl::OUString();
- aStyle.sStyle = ::rtl::OUString();
-
- sal_Int32 nCmdLen = aStyle.sCommand.getLength();
- ::rtl::OUString sCmdArgs = aStyle.sCommand.copy(LEN_STYLEPROT, nCmdLen-LEN_STYLEPROT);
- sal_Int32 i = sCmdArgs.indexOf('&');
- if (i<0)
- return sal_False;
-
- ::rtl::OUString sArg = sCmdArgs.copy(0, i);
- if (sArg.indexOf(CMDURL_SPART_ONLY) == 0)
- aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART);
- else
- if (sArg.indexOf(CMDURL_FPART_ONLY) == 0)
- aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART);
-
- sArg = sCmdArgs.copy(i+1, sCmdArgs.getLength()-i-1);
- if (sArg.indexOf(CMDURL_SPART_ONLY) == 0)
- aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART);
- else
- if (sArg.indexOf(CMDURL_FPART_ONLY) == 0)
- aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART);
-
- if (aStyle.sFamily.getLength() && aStyle.sStyle.getLength())
- return sal_True;
-
- return sal_False;
-}
-
-void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle)
-{
- try
- {
- css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY);
-
- css::uno::Reference< css::container::XNameAccess > xFamilies;
- if (xModel.is())
- xFamilies = xModel->getStyleFamilies();
-
- css::uno::Reference< css::container::XNameAccess > xStyleSet;
- if (xFamilies.is())
- xFamilies->getByName(aStyle.sFamily) >>= xStyleSet;
-
- css::uno::Reference< css::beans::XPropertySet > xStyle;
- if (xStyleSet.is())
- xStyleSet->getByName(aStyle.sStyle) >>= xStyle;
-
- aStyle.sLabel = ::rtl::OUString();
- if (xStyle.is())
- xStyle->getPropertyValue(STYLEPROP_UINAME) >>= aStyle.sLabel;
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { aStyle.sLabel = ::rtl::OUString(); }
-
- if (!aStyle.sLabel.getLength())
- {
- aStyle.sLabel = aStyle.sCommand;
- /*
- #if OSL_DEBUG_LEVEL > 1
- ::rtl::OUStringBuffer sMsg(256);
- sMsg.appendAscii("There is no UIName for the style command \"");
- sMsg.append (aStyle.sCommand );
- sMsg.appendAscii("\". The UI will be invalid then ..." );
- OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
- #endif
- */
- }
-}
-
-::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies()
-{
- // Its an optional interface!
- css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY);
- if (!xModel.is())
- return ::std::vector< SfxStyleInfo_Impl >();
-
- css::uno::Reference< css::container::XNameAccess > xCont = xModel->getStyleFamilies();
- css::uno::Sequence< ::rtl::OUString > lFamilyNames = xCont->getElementNames();
- ::std::vector< SfxStyleInfo_Impl > lFamilies;
- sal_Int32 c = lFamilyNames.getLength();
- sal_Int32 i = 0;
- for(i=0; i<c; ++i)
- {
- SfxStyleInfo_Impl aFamilyInfo;
- aFamilyInfo.sFamily = lFamilyNames[i];
-
- try
- {
- css::uno::Reference< css::beans::XPropertySet > xFamilyInfo;
- xCont->getByName(aFamilyInfo.sFamily) >>= xFamilyInfo;
- if (!xFamilyInfo.is())
- {
- // TODO_AS currently there is no support for an UIName property .. use internal family name instead
- aFamilyInfo.sLabel = aFamilyInfo.sFamily;
- }
- else
- xFamilyInfo->getPropertyValue(STYLEPROP_UINAME) >>= aFamilyInfo.sLabel;
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { return ::std::vector< SfxStyleInfo_Impl >(); }
-
- lFamilies.push_back(aFamilyInfo);
- }
-
- return lFamilies;
-}
-
-::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const ::rtl::OUString& sFamily)
-{
- static ::rtl::OUString PROP_UINAME = ::rtl::OUString::createFromAscii("DisplayName");
-
- css::uno::Sequence< ::rtl::OUString > lStyleNames;
- css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::container::XNameAccess > xFamilies = xModel->getStyleFamilies();
- css::uno::Reference< css::container::XNameAccess > xStyleSet;
- try
- {
- xFamilies->getByName(sFamily) >>= xStyleSet;
- lStyleNames = xStyleSet->getElementNames();
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { return ::std::vector< SfxStyleInfo_Impl >(); }
-
- ::std::vector< SfxStyleInfo_Impl > lStyles;
- sal_Int32 c = lStyleNames.getLength();
- sal_Int32 i = 0;
- for (i=0; i<c; ++i)
- {
- SfxStyleInfo_Impl aStyleInfo;
- aStyleInfo.sFamily = sFamily;
- aStyleInfo.sStyle = lStyleNames[i];
- aStyleInfo.sCommand = SfxStylesInfo_Impl::generateCommand(aStyleInfo.sFamily, aStyleInfo.sStyle);
-
- try
- {
- css::uno::Reference< css::beans::XPropertySet > xStyle;
- xStyleSet->getByName(aStyleInfo.sStyle) >>= xStyle;
- if (!xStyle.is())
- continue;
- xStyle->getPropertyValue(PROP_UINAME) >>= aStyleInfo.sLabel;
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { continue; }
-
- lStyles.push_back(aStyleInfo);
- }
- return lStyles;
-}
-SV_IMPL_PTRARR(SfxGroupInfoArr_Impl, SfxGroupInfoPtr);
-SfxConfigFunctionListBox_Impl::SfxConfigFunctionListBox_Impl( Window* pParent, const ResId& rResId)
- : SvTreeListBox( pParent, rResId )
- , pCurEntry( 0 )
- , pStylesInfo( 0 )
-{
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
- GetModel()->SetSortMode( SortAscending );
-
- // Timer f"ur die BallonHelp
- aTimer.SetTimeout( 200 );
- aTimer.SetTimeoutHdl(
- LINK( this, SfxConfigFunctionListBox_Impl, TimerHdl ) );
-}
-
-SfxConfigFunctionListBox_Impl::~SfxConfigFunctionListBox_Impl()
-{
- ClearAll();
-}
-
-void SfxConfigFunctionListBox_Impl::MouseMove( const MouseEvent& )
-{
- /* --> PB 2004-12-01 #i37000# - no own help text needed any longer
- Point aMousePos = rMEvt.GetPosPixel();
- pCurEntry = GetCurEntry();
-
- if ( pCurEntry && GetEntry( aMousePos ) == pCurEntry )
- aTimer.Start();
- else
- {
- Help::ShowBalloon( this, aMousePos, String() );
- aTimer.Stop();
- }
- */
-}
-
-
-IMPL_LINK( SfxConfigFunctionListBox_Impl, TimerHdl, Timer*, pTimer)
-/* Beschreibung
- Timer-Handler f"ur die Einblendung eines Hilfetextes. Wenn nach Ablauf des Timers
- der Mauszeiger immer noch auf dem aktuell selektierten Eintrag steht, wird der
- Helptext des Entries als Balloon-Help eingeblendet.
-*/
-{
- (void)pTimer; // unused
- /* --> PB 2004-12-01 #i37000# - no own help text needed any longer
- aTimer.Stop();
- Point aMousePos = GetPointerPosPixel();
- SvLBoxEntry *pEntry = GetCurEntry();
- if ( pEntry && GetEntry( aMousePos ) == pEntry && pCurEntry == pEntry )
- {
- String sHelpText = GetHelpText( pEntry );
- Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), sHelpText );
- }
- */
- return 0L;
-}
-
-void SfxConfigFunctionListBox_Impl::ClearAll()
-/* Beschreibung
- L"oscht alle Eintr"age in der FunctionListBox, alle UserDaten und alle evtl.
- vorhandenen MacroInfos.
-*/
-{
- USHORT nCount = aArr.Count();
- for ( USHORT i=0; i<nCount; i++ )
- {
- SfxGroupInfo_Impl *pData = aArr[i];
-
- if ( pData->nKind == SFX_CFGFUNCTION_MACRO ||
- pData->nKind == SFX_CFGFUNCTION_SCRIPT )
- {
- SfxMacroInfo *pInfo = (SfxMacroInfo*) pData->pObject;
- SFX_APP()->GetMacroConfig()->ReleaseSlotId( pInfo->GetSlotId() );
- delete pInfo;
- }
-
- if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER
- || pData->nKind == SFX_CFGGROUP_DOCBASICMGR
- )
- {
- XInterface* xi = static_cast<XInterface *>(pData->pObject);
- if (xi != NULL)
- {
- xi->release();
- }
- }
-
- delete pData;
- }
-
- aArr.Remove( 0, nCount );
- Clear();
-}
-
-SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName )
-/* Beschreibung
- Ermittelt den SvLBoxEntry zu einem "ubergebenen String. Das setzt voraus, da\s
- die Namen eindeutig sind.
-*/
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- if ( GetEntryText( pEntry ) == rName )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId )
-/* Beschreibung
- Ermittelt den SvLBoxEntry zu einer "ubergebenen Id.
-*/
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pData && pData->nOrd == nId )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-SfxMacroInfo* SfxConfigFunctionListBox_Impl::GetMacroInfo()
-/* Beschreibung
- Gibt die MacroInfo des selektierten Entry zur"uck ( sofern vorhanden ).
-*/
-{
- SvLBoxEntry *pEntry = FirstSelected();
- if ( pEntry )
- {
- SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pData && ( pData->nKind == SFX_CFGFUNCTION_MACRO ||
- pData->nKind == SFX_CFGFUNCTION_SCRIPT ) )
- return (SfxMacroInfo*) pData->pObject;
- }
-
- return 0;
-}
-
-String SfxConfigFunctionListBox_Impl::GetCurCommand()
-{
- SvLBoxEntry *pEntry = FirstSelected();
- if (!pEntry)
- return String();
- SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if (!pData)
- return String();
- return pData->sCommand;
-}
-
-String SfxConfigFunctionListBox_Impl::GetCurLabel()
-{
- SvLBoxEntry *pEntry = FirstSelected();
- if (!pEntry)
- return String();
- SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if (!pData)
- return String();
- if (pData->sLabel.Len())
- return pData->sLabel;
- return pData->sCommand;
-}
-
-USHORT SfxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry )
-/* Beschreibung
- Gibt die Ordnungsnummer ( SlotId oder Macro-Nummer ) des Eintrags zur"uck.
-*/
-{
- SfxGroupInfo_Impl *pData = pEntry ?
- (SfxGroupInfo_Impl*) pEntry->GetUserData() : 0;
- if ( pData )
- return pData->nOrd;
- return 0;
-}
-
-/*
-String SfxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry )
-{
- // Information zum selektierten Entry aus den Userdaten holen
- SfxGroupInfo_Impl *pInfo = pEntry ? (SfxGroupInfo_Impl*) pEntry->GetUserData(): 0;
- if ( pInfo )
- {
- switch ( pInfo->nKind )
- {
- case SFX_CFGGROUP_FUNCTION :
- case SFX_CFGFUNCTION_SLOT :
- {
- // Eintrag ist eine Funktion, Hilfe aus der Office-Hilfe
- USHORT nId = pInfo->nOrd;
- String aText = Application::GetHelp()->GetHelpText( nId, this );
-
- if ( !aText.Len() )
- aText = SFX_SLOTPOOL().GetSlotHelpText_Impl( nId );
- return aText;
- }
-
- case SFX_CFGGROUP_SCRIPTCONTAINER :
- case SFX_CFGFUNCTION_SCRIPT :
- case SFX_CFGGROUP_BASICMGR :
- case SFX_CFGGROUP_DOCBASICMGR :
- case SFX_CFGGROUP_BASICLIB :
- case SFX_CFGGROUP_BASICMOD :
- case SFX_CFGFUNCTION_MACRO :
- {
- // Eintrag ist ein Macro, Hilfe aus der MacroInfo
- SfxMacroInfo *pMacInfo = (SfxMacroInfo*) pInfo->pObject;
- return pMacInfo->GetHelpText();
- }
-
- case SFX_CFGGROUP_STYLES :
- return String();
- }
- }
-
- return String();
-}*/
-
-void SfxConfigFunctionListBox_Impl::FunctionSelected()
-/* Beschreibung
- Setzt die Balloonhelp zur"uck, da diese immer den Helptext des selektierten
- Entry anzeigen soll.
-*/
-{
- /* --> PB 2004-12-01 #i37000# - no own help text needed any longer
- Help::ShowBalloon( this, Point(), String() );
- */
-}
-
-void SfxConfigFunctionListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles)
-{
- pStylesInfo = pStyles;
-}
-
-struct SvxConfigGroupBoxResource_Impl : public Resource
-{
- Image m_hdImage;
- Image m_hdImage_hc;
- Image m_libImage;
- Image m_libImage_hc;
- Image m_macImage;
- Image m_macImage_hc;
- Image m_docImage;
- Image m_docImage_hc;
- ::rtl::OUString m_sMyMacros;
- ::rtl::OUString m_sProdMacros;
- String m_sMacros;
- String m_sDlgMacros;
- String m_aHumanAppName;
- String m_aStrGroupStyles;
- String m_aScriptType;
- Image m_collapsedImage;
- Image m_collapsedImage_hc;
- Image m_expandedImage;
- Image m_expandedImage_hc;
-
- SvxConfigGroupBoxResource_Impl();
-};
-
-SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() :
- Resource(SVX_RES(RID_SVXPAGE_CONFIGGROUPBOX)),
- m_hdImage(SVX_RES(IMG_HARDDISK)),
- m_hdImage_hc(SVX_RES(IMG_HARDDISK_HC)),
- m_libImage(SVX_RES(IMG_LIB)),
- m_libImage_hc(SVX_RES(IMG_LIB_HC)),
- m_macImage(SVX_RES(IMG_MACRO)),
- m_macImage_hc(SVX_RES(IMG_MACRO_HC)),
- m_docImage(SVX_RES(IMG_DOC)),
- m_docImage_hc(SVX_RES(IMG_DOC_HC)),
- m_sMyMacros(String(SVX_RES(STR_MYMACROS))),
- m_sProdMacros(String(SVX_RES(STR_PRODMACROS))),
- m_sMacros(String(SVX_RES(STR_BASICMACROS))),
- m_sDlgMacros(String(SVX_RES(STR_DLG_MACROS))),
- m_aHumanAppName(String(SVX_RES(STR_HUMAN_APPNAME))),
- m_aStrGroupStyles(String(SVX_RES(STR_GROUP_STYLES))),
- m_aScriptType(String(SVX_RES(STR_BASICNAME))),
- m_collapsedImage(SVX_RES(BMP_COLLAPSED)),
- m_collapsedImage_hc(SVX_RES(BMP_COLLAPSED_HC)),
- m_expandedImage(SVX_RES(BMP_EXPANDED)),
- m_expandedImage_hc(SVX_RES(BMP_EXPANDED_HC))
-{
- FreeResource();
-}
-
-SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl(
- Window* pParent, const ResId& rResId, ULONG nConfigMode )
- : SvTreeListBox( pParent, rResId )
- , pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), bShowSF( FALSE ), bShowBasic( TRUE ), pStylesInfo(0)
-{
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
- SetNodeBitmaps( pImp->m_collapsedImage, pImp->m_expandedImage, BMP_COLOR_NORMAL );
- SetNodeBitmaps( pImp->m_collapsedImage_hc, pImp->m_expandedImage_hc, BMP_COLOR_HIGHCONTRAST );
-
- // Check configuration to see whether only Basic macros,
- // only Scripting Framework scripts, or both should be listed
- Any value;
- sal_Bool tmp = false;
-
- value = ::utl::ConfigManager::GetConfigManager()->GetLocalProperty(
- ::rtl::OUString::createFromAscii(
- "Office.Scripting/ScriptDisplaySettings/ShowBasic" ) );
-
- value >>= tmp;
-
- if (tmp == sal_True) {
- bShowBasic = TRUE;
- }
- else {
- bShowBasic = FALSE;
- }
-
- value = ::utl::ConfigManager::GetConfigManager()->GetLocalProperty(
- ::rtl::OUString::createFromAscii(
- "Office.Scripting/ScriptDisplaySettings/ShowSF" ) );
-
- value >>= tmp;
-
- if (tmp == sal_True) {
- bShowSF = TRUE;
- }
- else {
- bShowSF = FALSE;
- }
-}
-
-
-SfxConfigGroupListBox_Impl::~SfxConfigGroupListBox_Impl()
-{
- ClearAll();
-}
-
-void SfxConfigGroupListBox_Impl::ClearAll()
-{
- USHORT nCount = aArr.Count();
- for ( USHORT i=0; i<nCount; i++ )
- {
- SfxGroupInfo_Impl *pData = aArr[i];
- if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER
- || pData->nKind == SFX_CFGGROUP_DOCBASICMGR
- )
- {
- XInterface* xi = static_cast<XInterface *>(pData->pObject);
- if (xi != NULL)
- {
- xi->release();
- }
- }
- delete pData;
- }
-
- aArr.Remove( 0, nCount );
- Clear();
-}
-
-void SfxConfigGroupListBox_Impl::SetScriptType( const String& rScriptType )
-{
- pImp->m_aScriptType = rScriptType;
- ULONG nPos=0;
- SvLBoxEntry *pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ );
- while ( pEntry )
- {
- SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pInfo->nKind == SFX_CFGGROUP_BASICLIB && ( IsExpanded( pEntry ) || pInfo->bWasOpened ) )
- {
- Collapse( pEntry );
- SvLBoxEntry *pChild = FirstChild( pEntry );
- while (pChild)
- {
- GetModel()->Remove( pChild );
- pChild = FirstChild( pEntry );
- }
-
- Expand( pEntry );
- }
-
- pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ );
- }
-}
-
-void SfxConfigGroupListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles)
-{
- pStylesInfo = pStyles;
-}
-
-String SfxConfigGroupListBox_Impl::GetGroup()
-/* Beschreibung
- Gibt den Namen der selektierten Funktionsgruppe bzw. des selektierten
- Basics zur"uck.
-*/
-{
- SvLBoxEntry *pEntry = FirstSelected();
- while ( pEntry )
- {
- SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pInfo->nKind == SFX_CFGGROUP_FUNCTION )
- return GetEntryText( pEntry );
-
- if ( pInfo->nKind == SFX_CFGGROUP_BASICMGR )
- {
- BasicManager *pMgr = (BasicManager*) pInfo->pObject;
- return pMgr->GetName();
- }
-
- if ( pInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
- {
- Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) );
- return ::comphelper::DocumentInfo::getDocumentTitle( xDoc );
- }
-
- pEntry = GetParent( pEntry );
- }
-
- return String();
-}
-
-//-----------------------------------------------
-BasicManager* SfxConfigGroupListBox_Impl::GetBasicManager( const SvLBoxEntry& _rEntry )
-{
- BasicManager* pBasMgr = NULL;
-
- SfxGroupInfo_Impl* pInfo = (SfxGroupInfo_Impl*) _rEntry.GetUserData();
- switch ( pInfo->nKind )
- {
- case SFX_CFGGROUP_BASICMGR :
- pBasMgr = (BasicManager*) pInfo->pObject;
- break;
- case SFX_CFGGROUP_DOCBASICMGR :
- {
- Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) );
- pBasMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc );
- }
- break;
- }
- return pBasMgr;
-}
-
-//-----------------------------------------------
-void SfxConfigGroupListBox_Impl::InitModule()
-{
- try
- {
- css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider(m_xFrame, css::uno::UNO_QUERY_THROW);
- css::uno::Sequence< sal_Int16 > lGroups = xProvider->getSupportedCommandGroups();
- sal_Int32 c1 = lGroups.getLength();
- sal_Int32 i1 = 0;
-
- for (i1=0; i1<c1; ++i1)
- {
- sal_Int16& rGroupID = lGroups[i1];
- ::rtl::OUString sGroupID = ::rtl::OUString::valueOf((sal_Int32)rGroupID);
- ::rtl::OUString sGroupName ;
-
- try
- {
- m_xModuleCategoryInfo->getByName(sGroupID) >>= sGroupName;
- if (!sGroupName.getLength())
- continue;
- }
- catch(const css::container::NoSuchElementException&)
- { continue; }
-
- SvLBoxEntry* pEntry = InsertEntry(sGroupName, NULL);
- SfxGroupInfo_Impl* pInfo = new SfxGroupInfo_Impl(SFX_CFGGROUP_FUNCTION, rGroupID);
- pEntry->SetUserData(pInfo);
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-}
-
-//-----------------------------------------------
-void SfxConfigGroupListBox_Impl::InitBasic()
-{
-}
-
-//-----------------------------------------------
-void SfxConfigGroupListBox_Impl::InitStyles()
-{
-}
-
-//-----------------------------------------------
-namespace
-{
- //...........................................
- /** examines a component whether it supports XEmbeddedScripts, or provides access to such a
- component by implementing XScriptInvocationContext.
- @return
- the model which supports the embedded scripts, or <NULL/> if it cannot find such a
- model
- */
- static Reference< XModel > lcl_getDocumentWithScripts_throw( const Reference< XInterface >& _rxComponent )
- {
- Reference< XEmbeddedScripts > xScripts( _rxComponent, UNO_QUERY );
- if ( !xScripts.is() )
- {
- Reference< XScriptInvocationContext > xContext( _rxComponent, UNO_QUERY );
- if ( xContext.is() )
- xScripts.set( xContext->getScriptContainer(), UNO_QUERY );
- }
-
- return Reference< XModel >( xScripts, UNO_QUERY );
- }
-
- //...........................................
- static Reference< XModel > lcl_getScriptableDocument_nothrow( const Reference< XFrame >& _rxFrame )
- {
- Reference< XModel > xDocument;
-
- // examine our associated frame
- try
- {
- OSL_ENSURE( _rxFrame.is(), "lcl_getScriptableDocument_nothrow: you need to pass a frame to this dialog/tab page!" );
- if ( _rxFrame.is() )
- {
- // first try the model in the frame
- Reference< XController > xController( _rxFrame->getController(), UNO_SET_THROW );
- xDocument = lcl_getDocumentWithScripts_throw( xController->getModel() );
-
- if ( !xDocument.is() )
- {
- // if there is no suitable document in the frame, try the controller
- xDocument = lcl_getDocumentWithScripts_throw( _rxFrame->getController() );
- }
- }
- }
- catch( const Exception& )
- {
- //DBG_UNHANDLED_EXCEPTION();
- }
-
- return xDocument;
- }
-}
-
-//-----------------------------------------------
-void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
- const css::uno::Reference< css::frame::XFrame >& xFrame ,
- const ::rtl::OUString& sModuleLongName)
-{
- SetUpdateMode(FALSE);
- ClearAll(); // Remove all old entries from treelist box
-
- m_xFrame = xFrame;
- if ( xSMGR.is())
- {
- m_xSMGR = xSMGR;
- m_sModuleLongName = sModuleLongName;
-
- m_xGlobalCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICATEGORYDESCRIPTION), css::uno::UNO_QUERY_THROW);
- m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName) , css::uno::UNO_QUERY_THROW);
- m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION) , css::uno::UNO_QUERY_THROW);
-
- InitModule();
- InitBasic();
- InitStyles();
- }
-
- /*
-
- // Verwendet wird der aktuelle Slotpool
- if ( nMode )
- {
- pSlotPool = pPool ? pPool : &SFX_SLOTPOOL();
- for ( USHORT i=1; i<pSlotPool->GetGroupCount(); i++ )
- {
- // Gruppe anw"ahlen ( Gruppe 0 ist intern )
- String aName = pSlotPool->SeekGroup( i );
- const SfxSlot *pSfxSlot = pSlotPool->FirstSlot();
- if ( pSfxSlot )
- {
- // Check if all entries are not useable. Don't
- // insert a group without any useable function.
- sal_Bool bActiveEntries = sal_False;
- while ( pSfxSlot )
- {
- USHORT nId = pSfxSlot->GetSlotId();
- if ( pSfxSlot->GetMode() & nMode )
- {
- bActiveEntries = sal_True;
- break;
- }
-
- pSfxSlot = pSlotPool->NextSlot();
- }
-
- if ( bActiveEntries )
- {
- // Wenn Gruppe nicht leer
- SvLBoxEntry *pEntry = InsertEntry( aName, NULL );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_FUNCTION, i );
- aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- }
- }
- }
- }
-*/
- SfxApplication *pSfxApp = SFX_APP();
- if ( bShowBasic )
- {
- // Basics einsammeln
- pSfxApp->EnterBasicCall();
- String aMacroName(' ');
- aMacroName += pImp->m_sDlgMacros;
-
- // Zuerst AppBasic
- BasicManager *pAppBasicMgr = pSfxApp->GetBasicManager();
- BOOL bInsert = TRUE;
- /*
- if ( pArr )
- {
- bInsert = FALSE;
- for ( USHORT n=0; n<pArr->Count(); n++ )
- {
- if ( *(*pArr)[n] == pSfxApp->GetName() )
- {
- bInsert = TRUE;
- break;
- }
- }
- }
- */
-
- if ( bInsert )
- {
- pAppBasicMgr->SetName( pSfxApp->GetName() );
- if ( pAppBasicMgr->GetLibCount() )
- {
- // Nur einf"ugen, wenn Bibliotheken vorhanden
- String aAppBasTitle( pImp->m_aHumanAppName );
- aAppBasTitle += aMacroName;
- SvLBoxEntry *pEntry = InsertEntry( aAppBasTitle, 0 );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMGR, 0, pAppBasicMgr );
- // aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- pEntry->EnableChildsOnDemand( TRUE );
- // Expand( pEntry );
- }
- }
-
- Reference< XModel > xDoc( lcl_getScriptableDocument_nothrow( m_xFrame ) );
- if ( xDoc.is() )
- {
- BasicManager* pBasicMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc );
- if ( pBasicMgr != pAppBasicMgr && pBasicMgr->GetLibCount() )
- {
- String sDocTitle( ::comphelper::DocumentInfo::getDocumentTitle( xDoc ) );
- pBasicMgr->SetName( sDocTitle );
-
- // Nur einf"ugen, wenn eigenes Basic mit Bibliotheken
- SvLBoxEntry *pEntry = InsertEntry( sDocTitle.Append( aMacroName ), NULL );
- xDoc->acquire();
- SfxGroupInfo_Impl *pInfo =
- new SfxGroupInfo_Impl( SFX_CFGGROUP_DOCBASICMGR, 0, xDoc.get() );
- pEntry->SetUserData( pInfo );
- pEntry->EnableChildsOnDemand( TRUE );
- }
- }
-
- pSfxApp->LeaveBasicCall();
- }
-
- OSL_TRACE("** ** About to initialise SF Scripts");
- if ( bShowSF )
- {
- OSL_TRACE("** ** bShowSF");
- // Add Scripting Framework entries
- Reference< browse::XBrowseNode > rootNode;
- Reference< XComponentContext > xCtx;
- try
- {
- Reference < beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
- Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName(
- ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW );
- rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
- //rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) );
- }
- catch( Exception& e )
- {
- OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s",
- ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- // TODO exception handling
- }
-
-
- if ( rootNode.is() )
- {
- if ( nMode )
- {
- //We call acquire on the XBrowseNode so that it does not
- //get autodestructed and become invalid when accessed later.
- rootNode->acquire();
-
- SfxGroupInfo_Impl *pInfo =
- new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0,
- static_cast<void *>(rootNode.get()));
-
- String aTitle(pImp->m_sDlgMacros);
- SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL );
- pNewEntry->SetUserData( pInfo );
- pNewEntry->EnableChildsOnDemand( TRUE );
- aArr.Insert( pInfo, aArr.Count() );
- }
- else
- {
- //We are only showing scripts not slot APIs so skip
- //Root node and show location nodes
- try {
- if ( rootNode->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > children =
- rootNode->getChildNodes();
- BOOL bIsRootNode = FALSE;
-
- ::rtl::OUString user = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString share = ::rtl::OUString::createFromAscii("share");
- if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") ))
- {
- bIsRootNode = TRUE;
- }
-
- //To mimic current starbasic behaviour we
- //need to make sure that only the current document
- //is displayed in the config tree. Tests below
- //set the bDisplay flag to FALSE if the current
- //node is a first level child of the Root and is NOT
- //either the current document, user or share
- ::rtl::OUString currentDocTitle;
- Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) );
- if ( xDocument.is() )
- {
- currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument );
- }
-
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
- {
- Reference< browse::XBrowseNode >& theChild = children[n];
- BOOL bDisplay = TRUE;
- ::rtl::OUString uiName = theChild->getName();
- if ( bIsRootNode )
- {
- if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) ||
- theChild->getName().equals( currentDocTitle ) ) ) )
- {
- bDisplay=FALSE;
- }
- else
- {
- if ( uiName.equals( user ) )
- {
- uiName = pImp->m_sMyMacros;
- }
- else if ( uiName.equals( share ) )
- {
- uiName = pImp->m_sProdMacros;
- }
- }
- }
- if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay )
- {
-
-// We call acquire on the XBrowseNode so that it does not
-// get autodestructed and become invalid when accessed later.
- theChild->acquire();
-
- SfxGroupInfo_Impl* pInfo =
- new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER,
- 0, static_cast<void *>( theChild.get()));
-
- Image aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_NORMAL );
- SvLBoxEntry* pNewEntry =
- InsertEntry( uiName, NULL);
- SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_HIGHCONTRAST );
- SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
-
- pNewEntry->SetUserData( pInfo );
- aArr.Insert( pInfo, aArr.Count() );
-
- if ( children[n]->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > grandchildren =
- children[n]->getChildNodes();
-
- for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ )
- {
- if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER )
- {
- pNewEntry->EnableChildsOnDemand( TRUE );
- m = grandchildren.getLength();
- }
- }
- }
- }
- }
- }
- }
- catch (RuntimeException&) {
- // do nothing, the entry will not be displayed in the UI
- }
- }
- }
- }
-
- // add styles
- if ( m_xSMGR.is() )
- {
- String sStyle( pImp->m_aStrGroupStyles );
- SvLBoxEntry *pEntry = InsertEntry( sStyle, 0 );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, 0 ); // TODO last parameter should contain user data
- aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- pEntry->EnableChildsOnDemand( TRUE );
- }
-
-/* {
- String sSymbols( String::CreateFromAscii("Symbols") );
- SvLBoxEntry *pEntry = InsertEntry( sSymbols, 0 );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_SPECIALCHARACTERS, 0, 0 ); // TODO last parameter should contain user data
- aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- } */
-
- MakeVisible( GetEntry( 0,0 ) );
- SetUpdateMode( TRUE );
-}
-Image SfxConfigGroupListBox_Impl::GetImage( Reference< browse::XBrowseNode > node, Reference< XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast )
-{
- Image aImage;
- if ( bIsRootNode )
- {
- ::rtl::OUString user = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString share = ::rtl::OUString::createFromAscii("share");
- if (node->getName().equals( user ) || node->getName().equals(share ) )
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = pImp->m_hdImage;
- else
- aImage = pImp->m_hdImage_hc;
- }
- else
- {
- ::rtl::OUString factoryURL;
- ::rtl::OUString nodeName = node->getName();
- Reference<XInterface> xDocumentModel = getDocumentModel(xCtx, nodeName );
- if ( xDocumentModel.is() )
- {
- Reference< ::com::sun::star::frame::XModuleManager >
- xModuleManager(
- xCtx->getServiceManager()
- ->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("" // xxx todo
- "com.sun.star.frame.ModuleManager"),
- xCtx ),
- UNO_QUERY_THROW );
- Reference<container::XNameAccess> xModuleConfig(
- xModuleManager, UNO_QUERY_THROW );
- // get the long name of the document:
- ::rtl::OUString appModule( xModuleManager->identify(
- xDocumentModel ) );
- Sequence<beans::PropertyValue> moduleDescr;
- Any aAny = xModuleConfig->getByName(appModule);
- if( sal_True != ( aAny >>= moduleDescr ) )
- {
- throw RuntimeException(::rtl::OUString::createFromAscii("SFTreeListBox::Init: failed to get PropertyValue"), Reference< XInterface >());
- }
- beans::PropertyValue const * pmoduleDescr =
- moduleDescr.getConstArray();
- for ( sal_Int32 pos = moduleDescr.getLength(); pos--; )
- {
- if (pmoduleDescr[ pos ].Name.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM(
- "ooSetupFactoryEmptyDocumentURL") ))
- {
- pmoduleDescr[ pos ].Value >>= factoryURL;
- OSL_TRACE("factory url for doc images is %s",
- ::rtl::OUStringToOString( factoryURL , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- break;
- }
- }
- }
- if( factoryURL.getLength() > 0 )
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = SvFileInformationManager::GetFileImage(
- INetURLObject(factoryURL), false,
- BMP_COLOR_NORMAL );
- else
- aImage = SvFileInformationManager::GetFileImage(
- INetURLObject(factoryURL), false,
- BMP_COLOR_HIGHCONTRAST );
- }
- else
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = pImp->m_docImage;
- else
- aImage = pImp->m_docImage_hc;
- }
- }
- }
- else
- {
- if( node->getType() == browse::BrowseNodeTypes::SCRIPT )
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = pImp->m_macImage;
- else
- aImage = pImp->m_macImage_hc;
- }
- else
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = pImp->m_libImage;
- else
- aImage = pImp->m_libImage_hc;
- }
- }
- return aImage;
-}
-
-Reference< XInterface >
-SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName )
-{
- Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ),
- UNO_QUERY );
-
- Reference< container::XEnumerationAccess > componentsAccess =
- desktop->getComponents();
- Reference< container::XEnumeration > components =
- componentsAccess->createEnumeration();
- while (components->hasMoreElements())
- {
- Reference< frame::XModel > model(
- components->nextElement(), UNO_QUERY );
- if ( model.is() )
- {
- ::rtl::OUString sTdocUrl =
- ::comphelper::DocumentInfo::getDocumentTitle( model );
- if( sTdocUrl.equals( docName ) )
- {
- xModel = model;
- break;
- }
- }
- }
- return xModel;
-}
-
-::rtl::OUString SfxConfigGroupListBox_Impl::parseLocationName( const ::rtl::OUString& location )
-{
- // strip out the last leaf of location name
- // e.g. file://dir1/dir2/Blah.sxw - > Blah.sxw
- ::rtl::OUString temp = location;
- sal_Int32 lastSlashIndex = temp.lastIndexOf( ::rtl::OUString::createFromAscii( "/" ) );
-
- if ( ( lastSlashIndex + 1 ) < temp.getLength() )
- {
- temp = temp.copy( lastSlashIndex + 1 );
- }
- // maybe we should throw here!!!
- else
- {
- OSL_TRACE("Something wrong with name, perhaps we should throw an exception");
- }
- return temp;
-}
-
-//-----------------------------------------------
-::rtl::OUString SfxConfigGroupListBox_Impl::MapCommand2UIName(const ::rtl::OUString& sCommand)
-{
- ::rtl::OUString sUIName;
- try
- {
- css::uno::Reference< css::container::XNameAccess > xModuleConf;
- m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf;
- if (xModuleConf.is())
- {
- ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
- sUIName = lProps.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("Name"), ::rtl::OUString());
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(css::uno::Exception&)
- { sUIName = ::rtl::OUString(); }
-
- // fallback for missing UINames !?
- if (!sUIName.getLength())
- {
- sUIName = sCommand;
- /*
- #if OSL_DEBUG_LEVEL > 1
- ::rtl::OUStringBuffer sMsg(256);
- sMsg.appendAscii("There is no UIName for the internal command \"");
- sMsg.append (sCommand );
- sMsg.appendAscii("\". The UI will be invalid then ..." );
- OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
- #endif
- */
- }
-
- return sUIName;
-}
-
-//-----------------------------------------------
-void SfxConfigGroupListBox_Impl::GroupSelected()
-/* Beschreibung
- Eine Funktionsgruppe oder eine Basicmodul wurde selektiert. Alle Funktionen bzw.
- Macros werden in der Functionlistbox anzeigt.
-*/
-{
- SvLBoxEntry *pEntry = FirstSelected();
- SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- pFunctionListBox->SetUpdateMode(FALSE);
- pFunctionListBox->ClearAll();
- if ( pInfo->nKind != SFX_CFGGROUP_FUNCTION &&
- pInfo->nKind != SFX_CFGGROUP_BASICMOD &&
- pInfo->nKind != SFX_CFGGROUP_SCRIPTCONTAINER &&
- pInfo->nKind != SFX_CFGGROUP_STYLES )
- {
- pFunctionListBox->SetUpdateMode(TRUE);
- return;
- }
-
- switch ( pInfo->nKind )
- {
- case SFX_CFGGROUP_FUNCTION :
- {
- USHORT nGroup = pInfo->nOrd;
- css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider (m_xFrame, css::uno::UNO_QUERY_THROW);
- css::uno::Sequence< css::frame::DispatchInformation > lCommands = xProvider->getConfigurableDispatchInformation(nGroup);
- sal_Int32 c = lCommands.getLength();
- sal_Int32 i = 0;
-
- for (i=0; i<c; ++i)
- {
- const css::frame::DispatchInformation& rInfo = lCommands[i];
- ::rtl::OUString sUIName = MapCommand2UIName(rInfo.Command);
- SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry(sUIName, NULL);
- SfxGroupInfo_Impl* pGrpInfo = new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SLOT, 0);
- pGrpInfo->sCommand = rInfo.Command;
- pGrpInfo->sLabel = sUIName;
- pFuncEntry->SetUserData(pGrpInfo);
- }
-
- break;
- }
-
- case SFX_CFGGROUP_BASICMOD :
- {
- SvLBoxEntry *pLibEntry = GetParent( pEntry );
- SfxGroupInfo_Impl *pLibInfo =
- (SfxGroupInfo_Impl*) pLibEntry->GetUserData();
- SvLBoxEntry *pBasEntry = GetParent( pLibEntry );
- SfxGroupInfo_Impl *pBasInfo =
- (SfxGroupInfo_Impl*) pBasEntry->GetUserData();
-
- StarBASIC *pLib = (StarBASIC*) pLibInfo->pObject;
- Reference< XModel > xDoc;
- if ( pBasInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
- xDoc = static_cast< XModel* >( pBasInfo->pObject );
-
- SbModule *pMod = (SbModule*) pInfo->pObject;
- for ( USHORT nMeth=0; nMeth < pMod->GetMethods()->Count(); nMeth++ )
- {
- SbxMethod *pMeth = (SbxMethod*)pMod->GetMethods()->Get(nMeth);
- SfxMacroInfoPtr pInf = new SfxMacroInfo( !xDoc.is(),
- pLib->GetName(),
- pMod->GetName(),
- pMeth->GetName());
- if ( pMeth->GetInfo() )
- pInf->SetHelpText( pMeth->GetInfo()->GetComment() );
- USHORT nId = SFX_APP()->GetMacroConfig()->GetSlotId( pInf );
- if ( !nId )
- break; // Kein Slot mehr frei
-
- SvLBoxEntry* pFuncEntry =
- pFunctionListBox->InsertEntry( pMeth->GetName(), NULL );
- SfxGroupInfo_Impl *pGrpInfo =
- new SfxGroupInfo_Impl( SFX_CFGFUNCTION_MACRO, nId, pInf );
- pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() );
- pFuncEntry->SetUserData( pGrpInfo );
- }
-
- break;
- }
-
- case SFX_CFGGROUP_SCRIPTCONTAINER:
- {
- if ( !GetChildCount( pEntry ) )
- {
- Reference< browse::XBrowseNode > rootNode(
- reinterpret_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ;
-
- try {
- if ( rootNode->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > children =
- rootNode->getChildNodes();
-
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
- {
- if (children[n]->getType() == browse::BrowseNodeTypes::SCRIPT)
- {
- ::rtl::OUString uri;
-
- Reference < beans::XPropertySet >xPropSet( children[n], UNO_QUERY );
- if (!xPropSet.is())
- {
- continue;
- }
-
- Any value =
- xPropSet->getPropertyValue( String::CreateFromAscii( "URI" ) );
- value >>= uri;
-
- SfxMacroInfo* aInfo = new SfxMacroInfo( (String)uri );
- aInfo->SetHelpText( uri );
- SFX_APP()->GetMacroConfig()->GetSlotId( aInfo );
-
- SfxGroupInfo_Impl* pGrpInfo =
- new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SCRIPT,
- aInfo->GetSlotId(), aInfo);
-
- Image aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL );
- SvLBoxEntry* pNewEntry =
- pFunctionListBox->InsertEntry( children[n]->getName(), NULL );
- pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST );
- pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
- pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
-
- pGrpInfo->sCommand = uri;
- pGrpInfo->sLabel = children[n]->getName();
- pNewEntry->SetUserData( pGrpInfo );
-
- pFunctionListBox->aArr.Insert(
- pGrpInfo, pFunctionListBox->aArr.Count() );
-
- }
- }
- }
- }
- catch (RuntimeException&) {
- // do nothing, the entry will not be displayed in the UI
- }
- }
- break;
- }
-
- case SFX_CFGGROUP_STYLES :
- {
- SfxStyleInfo_Impl* pFamily = (SfxStyleInfo_Impl*)(pInfo->pObject);
- if (pFamily)
- {
- const ::std::vector< SfxStyleInfo_Impl > lStyles = pStylesInfo->getStyles(pFamily->sFamily);
- ::std::vector< SfxStyleInfo_Impl >::const_iterator pIt;
- for ( pIt = lStyles.begin();
- pIt != lStyles.end() ;
- ++pIt )
- {
- SfxStyleInfo_Impl* pStyle = new SfxStyleInfo_Impl(*pIt);
- SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry( pStyle->sLabel, NULL );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pStyle );
- pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() );
- pGrpInfo->sCommand = pStyle->sCommand;
- pGrpInfo->sLabel = pStyle->sLabel;
- pFuncEntry->SetUserData( pGrpInfo );
- }
- }
- break;
- }
-
- default:
- return;
- }
-
- if ( pFunctionListBox->GetEntryCount() )
- pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) );
-
- pFunctionListBox->SetUpdateMode(TRUE);
-}
-
-BOOL SfxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent )
-{
- BOOL bRet = SvTreeListBox::Expand( pParent );
- if ( bRet )
- {
- // Wieviele Entries k"onnen angezeigt werden ?
- ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight();
-
- // Wieviele Kinder sollen angezeigt werden ?
- ULONG nChildCount = GetVisibleChildCount( pParent );
-
- // Passen alle Kinder und der parent gleichzeitig in die View ?
- if ( nChildCount+1 > nEntries )
- {
- // Wenn nicht, wenigstens parent ganz nach oben schieben
- MakeVisible( pParent, TRUE );
- }
- else
- {
- // An welcher relativen ViewPosition steht der aufzuklappende parent
- SvLBoxEntry *pEntry = GetFirstEntryInView();
- ULONG nParentPos = 0;
- while ( pEntry && pEntry != pParent )
- {
- nParentPos++;
- pEntry = GetNextEntryInView( pEntry );
- }
-
- // Ist unter dem parent noch genug Platz f"ur alle Kinder ?
- if ( nParentPos + nChildCount + 1 > nEntries )
- ScrollOutputArea( (short)( nEntries - ( nParentPos + nChildCount + 1 ) ) );
- }
- }
-
- return bRet;
-}
-
-void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry )
-/* Beschreibung
- Ein Basic oder eine Bibliothek werden ge"offnet
-*/
-{
- SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- pInfo->bWasOpened = TRUE;
- switch ( pInfo->nKind )
- {
- case SFX_CFGGROUP_BASICMGR :
- case SFX_CFGGROUP_DOCBASICMGR :
- {
- if ( !GetChildCount( pEntry ) )
- {
- // Erstmaliges "Offnen
- BasicManager* pMgr( GetBasicManager( *pEntry ) );
-
- SvLBoxEntry *pLibEntry = 0;
- for ( USHORT nLib=0; nLib<pMgr->GetLibCount(); nLib++)
- {
- StarBASIC* pLib = pMgr->GetLib( nLib );
- pLibEntry = InsertEntry( pMgr->GetLibName( nLib ), pEntry );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICLIB, nLib, pLib );
- aArr.Insert( pGrpInfo, aArr.Count() );
- pLibEntry->SetUserData( pGrpInfo );
- pLibEntry->EnableChildsOnDemand( TRUE );
- }
- }
-
- break;
- }
-
- case SFX_CFGGROUP_BASICLIB :
- {
- if ( !GetChildCount( pEntry ) )
- {
- // Erstmaliges "Offnen
- StarBASIC *pLib = (StarBASIC*) pInfo->pObject;
- if ( !pLib )
- {
- // Lib mu\s nachgeladen werden
- SvLBoxEntry *pParent = GetParent( pEntry );
- BasicManager *pMgr( GetBasicManager( *pParent ) );
-
- if ( pMgr->LoadLib( pInfo->nOrd ) )
- pInfo->pObject = pLib = pMgr->GetLib( pInfo->nOrd );
- else
- break;
- }
-
- SvLBoxEntry *pModEntry = 0;
- for ( USHORT nMod=0; nMod<pLib->GetModules()->Count(); nMod++ )
- {
- SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod );
-
- BOOL bIsStarScript = FALSE; //pMod->ISA( SbJScriptModule );
- BOOL bWantsStarScript = pImp->m_aScriptType.EqualsAscii("StarScript");
- if ( bIsStarScript != bWantsStarScript )
- continue;
- pModEntry = InsertEntry( pMod->GetName(), pEntry );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMOD, 0, pMod );
- aArr.Insert( pGrpInfo, aArr.Count() );
- pModEntry->SetUserData( pGrpInfo );
- }
- }
-
- break;
- }
-
- case SFX_CFGGROUP_SCRIPTCONTAINER:
- {
- if ( !GetChildCount( pEntry ) )
- {
- Reference< browse::XBrowseNode > rootNode(
- reinterpret_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ;
-
- try {
- if ( rootNode->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > children =
- rootNode->getChildNodes();
- BOOL bIsRootNode = FALSE;
-
- ::rtl::OUString user = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString share = ::rtl::OUString::createFromAscii("share");
- if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") ))
- {
- bIsRootNode = TRUE;
- }
-
- /* To mimic current starbasic behaviour we
- need to make sure that only the current document
- is displayed in the config tree. Tests below
- set the bDisplay flag to FALSE if the current
- node is a first level child of the Root and is NOT
- either the current document, user or share */
- ::rtl::OUString currentDocTitle;
- Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) );
- if ( xDocument.is() )
- {
- currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument );
- }
-
- sal_Int32 nLen = children.getLength();
- for ( sal_Int32 n = 0; n < nLen; n++ )
- {
- Reference< browse::XBrowseNode >& theChild = children[n];
- ::rtl::OUString aName( theChild->getName() );
- BOOL bDisplay = TRUE;
- if ( bIsRootNode )
- {
- if ( !( (aName.equals(user) || aName.equals(share) || aName.equals(currentDocTitle) ) ) )
- bDisplay=FALSE;
- }
- if ( children[n].is() && children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay )
- {
-
- /*
- We call acquire on the XBrowseNode so that it does not
- get autodestructed and become invalid when accessed later.
- */
- theChild->acquire();
-
- SfxGroupInfo_Impl* pGrpInfo =
- new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER,
- 0, static_cast<void *>( theChild.get()));
-
- Image aImage = GetImage( theChild, Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL );
- SvLBoxEntry* pNewEntry =
- InsertEntry( theChild->getName(), pEntry );
- SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- aImage = GetImage( theChild, Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST );
- SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
-
- pNewEntry->SetUserData( pGrpInfo );
- aArr.Insert( pGrpInfo, aArr.Count() );
-
- if ( children[n]->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > grandchildren =
- children[n]->getChildNodes();
-
- for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ )
- {
- if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER )
- {
- pNewEntry->EnableChildsOnDemand( TRUE );
- m = grandchildren.getLength();
- }
- }
- }
- }
- }
- }
- }
- catch (RuntimeException&) {
- // do nothing, the entry will not be displayed in the UI
- }
- }
- break;
- }
-
- case SFX_CFGGROUP_STYLES:
- {
- if ( !GetChildCount( pEntry ) )
- {
- const ::std::vector< SfxStyleInfo_Impl > lStyleFamilies = pStylesInfo->getStyleFamilies();
- ::std::vector< SfxStyleInfo_Impl >::const_iterator pIt;
- for ( pIt = lStyleFamilies.begin();
- pIt != lStyleFamilies.end() ;
- ++pIt )
- {
- SfxStyleInfo_Impl* pFamily = new SfxStyleInfo_Impl(*pIt);
- SvLBoxEntry* pStyleEntry = InsertEntry( pFamily->sLabel, pEntry );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pFamily );
- aArr.Insert( pGrpInfo, aArr.Count() );
- pStyleEntry->SetUserData( pGrpInfo );
- pStyleEntry->EnableChildsOnDemand( FALSE );
- }
- }
- break;
- }
-
- default:
- DBG_ERROR( "Falscher Gruppentyp!" );
- break;
- }
-}
-
-void SfxConfigGroupListBox_Impl::AddAndSelect( const SfxStringItem* , const SfxStringItem* )
-{
- /*
- if ( pText )
- {
- Select( GetEntry( GetEntryCount()-1) );
- SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry( pText->GetValue(), NULL );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_SPECIALCHARACTERS, 0, 0 );
- String aCommand = String::CreateFromAscii(".uno:InsertSymbol?Symbols:string=");
- aCommand += pText->GetValue();
- pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() );
- pGrpInfo->sCommand = aCommand;
- pGrpInfo->sLabel = String::CreateFromAscii("Symbols: ");
- pGrpInfo->sLabel += pText->GetValue();
- pFuncEntry->SetUserData( pGrpInfo );
- }
- */
-}
-
-void SfxConfigGroupListBox_Impl::SelectMacro( const SfxMacroInfoItem *pItem )
-{
- SelectMacro( pItem->GetBasicManager()->GetName(),
- pItem->GetQualifiedName() );
-}
-
-void SfxConfigGroupListBox_Impl::SelectMacro( const String& rBasic,
- const String& rMacro )
-{
- String aBasicName( rBasic );
- aBasicName += ' ';
- aBasicName += pImp->m_sMacros;
- String aLib, aModule, aMethod;
- USHORT nCount = rMacro.GetTokenCount('.');
- aMethod = rMacro.GetToken( nCount-1, '.' );
- if ( nCount > 2 )
- {
- aLib = rMacro.GetToken( 0, '.' );
- aModule = rMacro.GetToken( nCount-2, '.' );
- }
-
- SvLBoxEntry *pEntry = FirstChild(0);
- while ( pEntry )
- {
- String aEntryBas = GetEntryText( pEntry );
- if ( aEntryBas == aBasicName )
- {
- Expand( pEntry );
- SvLBoxEntry *pLib = FirstChild( pEntry );
- while ( pLib )
- {
- String aEntryLib = GetEntryText( pLib );
- if ( aEntryLib == aLib )
- {
- Expand( pLib );
- SvLBoxEntry *pMod = FirstChild( pLib );
- while ( pMod )
- {
- String aEntryMod = GetEntryText( pMod );
- if ( aEntryMod == aModule )
- {
- Expand( pMod );
- MakeVisible( pMod );
- Select( pMod );
- SvLBoxEntry *pMethod = pFunctionListBox->First();
- while ( pMethod )
- {
- String aEntryMethod = GetEntryText( pMethod );
- if ( aEntryMethod == aMethod )
- {
- pFunctionListBox->Select( pMethod );
- pFunctionListBox->MakeVisible( pMethod );
- return;
- }
- pMethod = pFunctionListBox->Next( pMethod );
- }
- }
- pMod = NextSibling( pMod );
- }
- }
- pLib = NextSibling( pLib );
- }
- }
- pEntry = NextSibling( pEntry );
- }
-}
diff --git a/svx/source/cui/cfgutil.hxx b/svx/source/cui/cfgutil.hxx
deleted file mode 100644
index 0f789ee0b8..0000000000
--- a/svx/source/cui/cfgutil.hxx
+++ /dev/null
@@ -1,220 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cfg.hxx,v $
- * $Revision: 1.41 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CFGUTIL_HXX
-#define _CFGUTIL_HXX
-
-#include <vector>
-#include <rtl/ustring.hxx>
-#include <tools/string.hxx>
-
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/script/browse/XBrowseNode.hpp>
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-
-#include <vcl/timer.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/svtreebx.hxx>
-#include <vcl/image.hxx>
-
-class BasicManager;
-class SfxSlotPool;
-class SfxStringItem;
-class SfxFontItem;
-class SfxMacroInfoItem;
-class SfxMacroInfo;
-struct SfxStyleInfo_Impl;
-struct SfxStylesInfo_Impl;
-
-#define css ::com::sun::star
-
-struct SfxStyleInfo_Impl
-{
- ::rtl::OUString sFamily;
- ::rtl::OUString sStyle;
- ::rtl::OUString sCommand;
- ::rtl::OUString sLabel;
-
- SfxStyleInfo_Impl()
- {}
-
- SfxStyleInfo_Impl(const SfxStyleInfo_Impl& rCopy)
- {
- sFamily = rCopy.sFamily;
- sStyle = rCopy.sStyle;
- sCommand = rCopy.sCommand;
- sLabel = rCopy.sLabel;
- }
-};
-
-struct SfxStylesInfo_Impl
-{
- private:
-
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDoc;
-
- public:
-
- SfxStylesInfo_Impl();
- void setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel);
-
- sal_Bool parseStyleCommand(SfxStyleInfo_Impl& aStyle);
- void getLabel4Style(SfxStyleInfo_Impl& aStyle);
-
- ::std::vector< SfxStyleInfo_Impl > getStyleFamilies();
- ::std::vector< SfxStyleInfo_Impl > getStyles(const ::rtl::OUString& sFamily);
-
- static ::rtl::OUString generateCommand(const ::rtl::OUString& sFamily, const ::rtl::OUString& sStyle);
-};
-
-#define SFX_CFGGROUP_FUNCTION 1
-#define SFX_CFGGROUP_BASICMGR 2
-#define SFX_CFGGROUP_DOCBASICMGR 3
-#define SFX_CFGGROUP_BASICLIB 4
-#define SFX_CFGGROUP_BASICMOD 5
-#define SFX_CFGFUNCTION_MACRO 6
-#define SFX_CFGFUNCTION_SLOT 7
-#define SFX_CFGGROUP_SCRIPTCONTAINER 8
-#define SFX_CFGFUNCTION_SCRIPT 9
-#define SFX_CFGGROUP_STYLES 10
-#define SFX_CFGGROUP_SPECIALCHARACTERS 11
-
-struct SfxGroupInfo_Impl
-{
- USHORT nKind;
- USHORT nOrd;
- void* pObject;
- BOOL bWasOpened;
- String sCommand;
- String sLabel;
-
- SfxGroupInfo_Impl( USHORT n, USHORT nr, void* pObj = 0 ) :
- nKind( n ), nOrd( nr ), pObject( pObj ), bWasOpened(FALSE) {}
-};
-
-typedef SfxGroupInfo_Impl* SfxGroupInfoPtr;
-SV_DECL_PTRARR_DEL(SfxGroupInfoArr_Impl, SfxGroupInfoPtr, 5, 5)
-
-class SfxConfigFunctionListBox_Impl : public SvTreeListBox
-{
- friend class SfxConfigGroupListBox_Impl;
- Timer aTimer;
- SvLBoxEntry* pCurEntry;
- SfxGroupInfoArr_Impl aArr;
- SfxStylesInfo_Impl* pStylesInfo;
-
- DECL_LINK( TimerHdl, Timer* );
- virtual void MouseMove( const MouseEvent& rMEvt );
-
-public:
- SfxConfigFunctionListBox_Impl( Window*, const ResId& );
- ~SfxConfigFunctionListBox_Impl();
-
- void ClearAll();
- SvLBoxEntry* GetEntry_Impl( USHORT nId );
- SvLBoxEntry* GetEntry_Impl( const String& );
- USHORT GetId( SvLBoxEntry *pEntry );
- using Window::GetHelpText;
- String GetHelpText( SvLBoxEntry *pEntry );
- USHORT GetCurId() { return GetId( FirstSelected() ); }
- String GetCurCommand();
- String GetCurLabel();
- SfxMacroInfo* GetMacroInfo();
- void FunctionSelected();
- void SetStylesInfo(SfxStylesInfo_Impl* pStyles);
-};
-
-struct SvxConfigGroupBoxResource_Impl;
-class SfxConfigGroupListBox_Impl : public SvTreeListBox
-{
- SvxConfigGroupBoxResource_Impl* pImp;
- //SfxSlotPool* pSlotPool;
- SfxConfigFunctionListBox_Impl* pFunctionListBox;
- SfxGroupInfoArr_Impl aArr;
- ULONG nMode;
- BOOL bShowSF; // show Scripting Framework scripts
- BOOL bShowBasic; // show Basic scripts
-
- ::rtl::OUString m_sModuleLongName;
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
- css::uno::Reference< css::frame::XFrame > m_xFrame;
- css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo;
- css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo;
- css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription;
-
- Image GetImage( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > node, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, ::rtl::OUString& docName );
- ::rtl::OUString parseLocationName( const ::rtl::OUString& location );
-
- void InitModule();
- void InitBasic();
- void InitStyles();
-
- ::rtl::OUString MapCommand2UIName(const ::rtl::OUString& sCommand);
-
- SfxStylesInfo_Impl* pStylesInfo;
-
-protected:
- virtual void RequestingChilds( SvLBoxEntry *pEntry);
- using SvListView::Expand;
- virtual BOOL Expand( SvLBoxEntry* pParent );
-
-public:
- SfxConfigGroupListBox_Impl ( Window* pParent,
- const ResId&,
- ULONG nConfigMode = 0 );
- ~SfxConfigGroupListBox_Impl();
- void ClearAll();
-
- void Init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
- const css::uno::Reference< css::frame::XFrame >& xFrame ,
- const ::rtl::OUString& sModuleLongName);
- void SetFunctionListBox( SfxConfigFunctionListBox_Impl *pBox )
- { pFunctionListBox = pBox; }
- void Open( SvLBoxEntry*, BOOL );
- void GroupSelected();
- void SelectMacro( const SfxMacroInfoItem* );
- void AddAndSelect( const SfxStringItem*, const SfxStringItem* );
- void SelectMacro( const String&, const String& );
- String GetGroup();
- BasicManager* GetBasicManager( const SvLBoxEntry& _rEntry );
- void SetScriptType( const String& rScriptType );
- void SetStylesInfo(SfxStylesInfo_Impl* pStyles);
-};
-
-#undef css
-
-#endif
-
diff --git a/svx/source/cui/chardlg.cxx b/svx/source/cui/chardlg.cxx
deleted file mode 100644
index 7a717188c2..0000000000
--- a/svx/source/cui/chardlg.cxx
+++ /dev/null
@@ -1,4070 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: chardlg.cxx,v $
- * $Revision: 1.102.148.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <unolingu.hxx>
-#include <vcl/svapp.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/ctrltool.hxx>
-#include <svtools/sfontitm.hxx>
-#include <sfx2/printer.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <vcl/msgbox.hxx>
-
-#define _SVX_CHARDLG_CXX
-#include <svtools/languageoptions.hxx>
-
-#include <svx/dialogs.hrc>
-#include <svx/svxitems.hrc>
-#include "chardlg.hrc"
-
-//Erstmal definieren, damit die Klassendeklarionen angezogen werden.
-
-#include <svx/xtable.hxx> // XColorTable
-#include "chardlg.hxx"
-#include "fontitem.hxx"
-#include <svx/postitem.hxx>
-#include <svx/udlnitem.hxx>
-#include <svx/crsditem.hxx>
-#include <svx/cntritem.hxx>
-#include <svx/langitem.hxx>
-#include <svx/wghtitem.hxx>
-#include <svx/fhgtitem.hxx>
-#include <svx/shdditem.hxx>
-#include <svx/escpitem.hxx>
-#include <svx/prszitem.hxx>
-#include <svx/wrlmitem.hxx>
-#include <svx/cmapitem.hxx>
-#include <svx/kernitem.hxx>
-#include <svx/blnkitem.hxx>
-#include "flstitem.hxx"
-#include <svx/akrnitem.hxx>
-#include <svx/brshitem.hxx>
-#include <svx/colritem.hxx>
-#include "drawitem.hxx"
-#include "dlgutil.hxx"
-#include <svx/dialmgr.hxx>
-#include "htmlmode.hxx"
-#include "cuicharmap.hxx"
-#include "chardlg.h"
-#include <svx/emphitem.hxx>
-#include <svx/charreliefitem.hxx>
-#include <svx/twolinesitem.hxx>
-#include <charhiddenitem.hxx>
-#include <svtools/stritem.hxx>
-#include <svx/charscaleitem.hxx>
-#include <svx/charrotateitem.hxx>
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
-#include <svtools/intitem.hxx> //CHINA001
-#include <sfx2/request.hxx> //CHINA001
-#include "flagsdef.hxx" //CHINA001
-
-using namespace ::com::sun::star;
-
-// define ----------------------------------------------------------------
-
-#define ISITEMSET rSet.GetItemState(nWhich)>=SFX_ITEM_DEFAULT
-
-#define CLEARTITEM rSet.InvalidateItem(nWhich)
-
-#define LW_NORMAL 0
-#define LW_GESPERRT 1
-#define LW_SCHMAL 2
-
-// static ----------------------------------------------------------------
-
-static USHORT pNameRanges[] =
-{
- SID_ATTR_CHAR_FONT,
- SID_ATTR_CHAR_WEIGHT,
- SID_ATTR_CHAR_FONTHEIGHT,
- SID_ATTR_CHAR_FONTHEIGHT,
- SID_ATTR_CHAR_COLOR,
- SID_ATTR_CHAR_COLOR,
- SID_ATTR_CHAR_LANGUAGE,
- SID_ATTR_CHAR_LANGUAGE,
- SID_ATTR_CHAR_CJK_FONT,
- SID_ATTR_CHAR_CJK_WEIGHT,
- SID_ATTR_CHAR_CTL_FONT,
- SID_ATTR_CHAR_CTL_WEIGHT,
- 0
-};
-
-static USHORT pEffectsRanges[] =
-{
- SID_ATTR_CHAR_SHADOWED,
- SID_ATTR_CHAR_UNDERLINE,
- SID_ATTR_CHAR_COLOR,
- SID_ATTR_CHAR_COLOR,
- SID_ATTR_CHAR_CASEMAP,
- SID_ATTR_CHAR_CASEMAP,
- SID_ATTR_FLASH,
- SID_ATTR_FLASH,
- SID_ATTR_CHAR_EMPHASISMARK,
- SID_ATTR_CHAR_EMPHASISMARK,
- SID_ATTR_CHAR_RELIEF,
- SID_ATTR_CHAR_RELIEF,
- SID_ATTR_CHAR_HIDDEN,
- SID_ATTR_CHAR_HIDDEN,
- SID_ATTR_CHAR_OVERLINE,
- SID_ATTR_CHAR_OVERLINE,
- 0
-};
-
-static USHORT pPositionRanges[] =
-{
- SID_ATTR_CHAR_KERNING,
- SID_ATTR_CHAR_KERNING,
- SID_ATTR_CHAR_ESCAPEMENT,
- SID_ATTR_CHAR_ESCAPEMENT,
- SID_ATTR_CHAR_AUTOKERN,
- SID_ATTR_CHAR_AUTOKERN,
- SID_ATTR_CHAR_ROTATED,
- SID_ATTR_CHAR_SCALEWIDTH,
- SID_ATTR_CHAR_WIDTH_FIT_TO_LINE,
- SID_ATTR_CHAR_WIDTH_FIT_TO_LINE,
- 0
-};
-
-static USHORT pTwoLinesRanges[] =
-{
- SID_ATTR_CHAR_TWO_LINES,
- SID_ATTR_CHAR_TWO_LINES,
- 0
-};
-
-// C-Funktion ------------------------------------------------------------
-
-inline BOOL StateToAttr( TriState aState )
-{
- return ( STATE_CHECK == aState );
-}
-
-// class SvxCharBasePage -------------------------------------------------
-
-inline SvxFont& SvxCharBasePage::GetPreviewFont()
-{
- return m_aPreviewWin.GetFont();
-}
-
-// -----------------------------------------------------------------------
-
-inline SvxFont& SvxCharBasePage::GetPreviewCJKFont()
-{
- return m_aPreviewWin.GetCJKFont();
-}
-// -----------------------------------------------------------------------
-
-inline SvxFont& SvxCharBasePage::GetPreviewCTLFont()
-{
- return m_aPreviewWin.GetCTLFont();
-}
-
-// -----------------------------------------------------------------------
-
-SvxCharBasePage::SvxCharBasePage( Window* pParent, const ResId& rResId, const SfxItemSet& rItemset,
- USHORT nResIdPrewievWin, USHORT nResIdFontTypeFT ):
- SfxTabPage( pParent, rResId, rItemset ),
- m_aPreviewWin( this, ResId( nResIdPrewievWin, *rResId.GetResMgr() ) ),
- m_aFontTypeFT( this, ResId( nResIdFontTypeFT, *rResId.GetResMgr() ) ),
- m_bPreviewBackgroundToCharacter( FALSE )
-{
-}
-
-// -----------------------------------------------------------------------
-
-SvxCharBasePage::~SvxCharBasePage()
-{
-}
-
-// -----------------------------------------------------------------------
-
-//void SvxCharBasePage::SetPrevFontAttributes( const SfxItemSet& rSet )
-void SvxCharBasePage::ActivatePage( const SfxItemSet& rSet )
-{
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
- USHORT nWhich;
-
- nWhich = GetWhich( SID_CHAR_DLG_PREVIEW_STRING );
- if( ISITEMSET )
- {
- const SfxStringItem& rItem = ( SfxStringItem& ) rSet.Get( nWhich );
- ::rtl::OUString aString = rItem.GetValue();
- if( aString.getLength() != 0 )
- m_aPreviewWin.SetPreviewText( aString );
- else
- m_aPreviewWin.SetFontNameAsPreviewText();
- }
-
- // Underline
- FontUnderline eUnderline;
- nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE );
- if( ISITEMSET )
- {
- const SvxUnderlineItem& rItem = ( SvxUnderlineItem& ) rSet.Get( nWhich );
- eUnderline = ( FontUnderline ) rItem.GetValue();
- m_aPreviewWin.SetTextLineColor( rItem.GetColor() );
- }
- else
- eUnderline = UNDERLINE_NONE;
-
- rFont.SetUnderline( eUnderline );
- rCJKFont.SetUnderline( eUnderline );
- rCTLFont.SetUnderline( eUnderline );
-
- // Overline
- FontUnderline eOverline;
- nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE );
- if( ISITEMSET )
- {
- const SvxOverlineItem& rItem = ( SvxOverlineItem& ) rSet.Get( nWhich );
- eOverline = ( FontUnderline ) rItem.GetValue();
- m_aPreviewWin.SetOverlineColor( rItem.GetColor() );
- }
- else
- eOverline = UNDERLINE_NONE;
-
- rFont.SetOverline( eOverline );
- rCJKFont.SetOverline( eOverline );
- rCTLFont.SetOverline( eOverline );
-
- // Strikeout
- FontStrikeout eStrikeout;
- nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT );
- if( ISITEMSET )
- {
- const SvxCrossedOutItem& rItem = ( SvxCrossedOutItem& ) rSet.Get( nWhich );
- eStrikeout = ( FontStrikeout ) rItem.GetValue();
- }
- else
- eStrikeout = STRIKEOUT_NONE;
-
- rFont.SetStrikeout( eStrikeout );
- rCJKFont.SetStrikeout( eStrikeout );
- rCTLFont.SetStrikeout( eStrikeout );
-
- // WordLineMode
- nWhich = GetWhich( SID_ATTR_CHAR_WORDLINEMODE );
- if( ISITEMSET )
- {
- const SvxWordLineModeItem& rItem = ( SvxWordLineModeItem& ) rSet.Get( nWhich );
- rFont.SetWordLineMode( rItem.GetValue() );
- rCJKFont.SetWordLineMode( rItem.GetValue() );
- rCTLFont.SetWordLineMode( rItem.GetValue() );
- }
-
- // Emphasis
- nWhich = GetWhich( SID_ATTR_CHAR_EMPHASISMARK );
- if( ISITEMSET )
- {
- const SvxEmphasisMarkItem& rItem = ( SvxEmphasisMarkItem& ) rSet.Get( nWhich );
- FontEmphasisMark eMark = rItem.GetEmphasisMark();
- rFont.SetEmphasisMark( eMark );
- rCJKFont.SetEmphasisMark( eMark );
- rCTLFont.SetEmphasisMark( eMark );
- }
-
- // Relief
- nWhich = GetWhich( SID_ATTR_CHAR_RELIEF );
- if( ISITEMSET )
- {
- const SvxCharReliefItem& rItem = ( SvxCharReliefItem& ) rSet.Get( nWhich );
- FontRelief eFontRelief = ( FontRelief ) rItem.GetValue();
- rFont.SetRelief( eFontRelief );
- rCJKFont.SetRelief( eFontRelief );
- rCTLFont.SetRelief( eFontRelief );
- }
-
- // Effects
- nWhich = GetWhich( SID_ATTR_CHAR_CASEMAP );
- if( ISITEMSET )
- {
- const SvxCaseMapItem& rItem = ( SvxCaseMapItem& ) rSet.Get( nWhich );
- SvxCaseMap eCaseMap = ( SvxCaseMap ) rItem.GetValue();
- rFont.SetCaseMap( eCaseMap );
- rCJKFont.SetCaseMap( eCaseMap );
- // #i78474# small caps do not exist in CTL fonts
- rCTLFont.SetCaseMap( eCaseMap == SVX_CASEMAP_KAPITAELCHEN ? SVX_CASEMAP_NOT_MAPPED : eCaseMap );
- }
-
- // Outline
- nWhich = GetWhich( SID_ATTR_CHAR_CONTOUR );
- if( ISITEMSET )
- {
- const SvxContourItem& rItem = ( SvxContourItem& ) rSet.Get( nWhich );
- BOOL bOutline = rItem.GetValue();
- rFont.SetOutline( bOutline );
- rCJKFont.SetOutline( bOutline );
- rCTLFont.SetOutline( bOutline );
- }
-
- // Shadow
- nWhich = GetWhich( SID_ATTR_CHAR_SHADOWED );
- if( ISITEMSET )
- {
- const SvxShadowedItem& rItem = ( SvxShadowedItem& ) rSet.Get( nWhich );
- BOOL bShadow = rItem.GetValue();
- rFont.SetShadow( bShadow );
- rCJKFont.SetShadow( bShadow );
- rCTLFont.SetShadow( bShadow );
- }
-
- // Background
- BOOL bTransparent;
- nWhich = GetWhich( m_bPreviewBackgroundToCharacter ? SID_ATTR_BRUSH : SID_ATTR_BRUSH_CHAR );
- if( ISITEMSET )
- {
- const SvxBrushItem& rBrush = ( SvxBrushItem& ) rSet.Get( nWhich );
- const Color& rColor = rBrush.GetColor();
- bTransparent = rColor.GetTransparency() > 0;
- rFont.SetFillColor( rColor );
- rCJKFont.SetFillColor( rColor );
- rCTLFont.SetFillColor( rColor );
- }
- else
- bTransparent = TRUE;
-
- rFont.SetTransparent( bTransparent );
- rCJKFont.SetTransparent( bTransparent );
- rCTLFont.SetTransparent( bTransparent );
-
- Color aBackCol( COL_TRANSPARENT );
- if( !m_bPreviewBackgroundToCharacter )
- {
- nWhich = GetWhich( SID_ATTR_BRUSH );
- if( ISITEMSET )
- {
- const SvxBrushItem& rBrush = ( SvxBrushItem& ) rSet.Get( nWhich );
- if( GPOS_NONE == rBrush.GetGraphicPos() )
- aBackCol = rBrush.GetColor();
- }
- }
- m_aPreviewWin.SetBackColor( aBackCol );
-
- // Font
- SetPrevFont( rSet, SID_ATTR_CHAR_FONT, rFont );
- SetPrevFont( rSet, SID_ATTR_CHAR_CJK_FONT, rCJKFont );
- SetPrevFont( rSet, SID_ATTR_CHAR_CTL_FONT, rCTLFont );
-
- // Style
- SetPrevFontStyle( rSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, rFont );
- SetPrevFontStyle( rSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, rCJKFont );
- SetPrevFontStyle( rSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, rCTLFont );
-
- // Size
- SetPrevFontSize( rSet, SID_ATTR_CHAR_FONTHEIGHT, rFont );
- SetPrevFontSize( rSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, rCJKFont );
- SetPrevFontSize( rSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, rCTLFont );
-
- // Color
- nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
- if( ISITEMSET )
- {
- const SvxColorItem& rItem = ( SvxColorItem& ) rSet.Get( nWhich );
- Color aCol( rItem.GetValue() );
- rFont.SetColor( aCol );
- rCJKFont.SetColor( aCol );
- rCTLFont.SetColor( aCol );
-
- m_aPreviewWin.AutoCorrectFontColor(); // handle color COL_AUTO
- }
-
- // Kerning
- nWhich = GetWhich( SID_ATTR_CHAR_KERNING );
- if( ISITEMSET )
- {
- const SvxKerningItem& rItem = ( SvxKerningItem& ) rSet.Get( nWhich );
- short nKern = ( short )
- LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MAP_TWIP );
- rFont.SetFixKerning( nKern );
- rCJKFont.SetFixKerning( nKern );
- rCTLFont.SetFixKerning( nKern );
- }
-
- // Escapement
- nWhich = GetWhich( SID_ATTR_CHAR_ESCAPEMENT );
- const BYTE nProp = 100;
- short nEsc;
- BYTE nEscProp;
- if( ISITEMSET )
- {
- const SvxEscapementItem& rItem = ( SvxEscapementItem& ) rSet.Get( nWhich );
- nEsc = rItem.GetEsc();
- nEscProp = rItem.GetProp();
-
- if( nEsc == DFLT_ESC_AUTO_SUPER )
- nEsc = DFLT_ESC_SUPER;
- else if( nEsc == DFLT_ESC_AUTO_SUB )
- nEsc = DFLT_ESC_SUB;
- }
- else
- {
- nEsc = 0;
- nEscProp = 100;
- }
-
- SetPrevFontEscapement( nProp, nEscProp, nEsc );
-
- // Font width scale
- SetPrevFontWidthScale( rSet );
-
- m_aPreviewWin.Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharBasePage::SetPrevFontSize( const SfxItemSet& rSet, USHORT nSlot, SvxFont& rFont )
-{
- USHORT nWhich = GetWhich( nSlot );
- long nH;
- if( rSet.GetItemState( nWhich ) >= SFX_ITEM_SET )
- {
- nH = LogicToLogic( ( ( SvxFontHeightItem& ) rSet.Get( nWhich ) ).GetHeight(),
- ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ),
- MAP_TWIP );
- }
- else
- nH = 240; // as default 12pt
-
- rFont.SetSize( Size( 0, nH ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharBasePage::SetPrevFont( const SfxItemSet& rSet, USHORT nSlot, SvxFont& rFont )
-{
- USHORT nWhich = GetWhich( nSlot );
- if( ISITEMSET )
- {
- const SvxFontItem& rFontItem = ( SvxFontItem& ) rSet.Get( nWhich );
- rFont.SetFamily( rFontItem.GetFamily() );
- rFont.SetName( rFontItem.GetFamilyName() );
- rFont.SetPitch( rFontItem.GetPitch() );
- rFont.SetCharSet( rFontItem.GetCharSet() );
- rFont.SetStyleName( rFontItem.GetStyleName() );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharBasePage::SetPrevFontStyle( const SfxItemSet& rSet, USHORT nPosture, USHORT nWeight, SvxFont& rFont )
-{
- USHORT nWhich = GetWhich( nPosture );
- if( ISITEMSET )
- {
- const SvxPostureItem& rItem = ( SvxPostureItem& ) rSet.Get( nWhich );
- rFont.SetItalic( ( FontItalic ) rItem.GetValue() != ITALIC_NONE ? ITALIC_NORMAL : ITALIC_NONE );
- }
-
- nWhich = GetWhich( nWeight );
- if( ISITEMSET )
- {
- SvxWeightItem& rItem = ( SvxWeightItem& ) rSet.Get( nWhich );
- rFont.SetWeight( ( FontWeight ) rItem.GetValue() != WEIGHT_NORMAL ? WEIGHT_BOLD : WEIGHT_NORMAL );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharBasePage::SetPrevFontWidthScale( const SfxItemSet& rSet )
-{
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
- if( ISITEMSET )
- {
- const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich );
-
- m_aPreviewWin.SetFontWidthScale( rItem.GetValue() );
- }
-}
-
-// -----------------------------------------------------------------------
-namespace
-{
- // -----------------------------------------------------------------------
- void setPrevFontEscapement(SvxFont& _rFont,BYTE nProp, BYTE nEscProp, short nEsc )
- {
- _rFont.SetPropr( nProp );
- _rFont.SetProprRel( nEscProp );
- _rFont.SetEscapement( nEsc );
- }
- // -----------------------------------------------------------------------
- // -----------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------
-
-void SvxCharBasePage::SetPrevFontEscapement( BYTE nProp, BYTE nEscProp, short nEsc )
-{
- setPrevFontEscapement(GetPreviewFont(),nProp,nEscProp,nEsc);
- setPrevFontEscapement(GetPreviewCJKFont(),nProp,nEscProp,nEsc);
- setPrevFontEscapement(GetPreviewCTLFont(),nProp,nEscProp,nEsc);
- m_aPreviewWin.Invalidate();
-}
-
-// SvxCharNamePage_Impl --------------------------------------------------
-
-struct SvxCharNamePage_Impl
-{
- Timer m_aUpdateTimer;
- String m_aNoStyleText;
- String m_aTransparentText;
- const FontList* m_pFontList;
- USHORT m_nExtraEntryPos;
- BOOL m_bMustDelete;
- BOOL m_bInSearchMode;
-
- SvxCharNamePage_Impl() :
-
- m_pFontList ( NULL ),
- m_nExtraEntryPos( LISTBOX_ENTRY_NOTFOUND ),
- m_bMustDelete ( FALSE ),
- m_bInSearchMode ( FALSE )
-
- {
- m_aUpdateTimer.SetTimeout( 350 );
- }
-
- ~SvxCharNamePage_Impl()
- {
- if ( m_bMustDelete )
- delete m_pFontList;
- }
-};
-
-// class SvxCharNamePage -------------------------------------------------
-
-SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet ) :
-
- SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_NAME ), rInSet, WIN_CHAR_PREVIEW, FT_CHAR_FONTTYPE ),
- m_pImpl ( new SvxCharNamePage_Impl )
-{
- m_pImpl->m_aNoStyleText = String( SVX_RES( STR_CHARNAME_NOSTYLE ) );
- m_pImpl->m_aTransparentText = String( SVX_RES( STR_CHARNAME_TRANSPARENT ) );
-
- SvtLanguageOptions aLanguageOptions;
- sal_Bool bCJK = ( aLanguageOptions.IsCJKFontEnabled() || aLanguageOptions.IsCTLFontEnabled() );
-
- m_pWestLine = new FixedLine( this, SVX_RES( FL_WEST ) );
- m_pWestFontNameFT = new FixedText( this, SVX_RES( bCJK ? FT_WEST_NAME : FT_WEST_NAME_NOCJK ) );
- m_pWestFontNameLB = new FontNameBox( this, SVX_RES( bCJK ? LB_WEST_NAME : LB_WEST_NAME_NOCJK ) );
- m_pWestFontStyleFT = new FixedText( this, SVX_RES( bCJK ? FT_WEST_STYLE : FT_WEST_STYLE_NOCJK ) );
- m_pWestFontStyleLB = new FontStyleBox( this, SVX_RES( bCJK ? LB_WEST_STYLE : LB_WEST_STYLE_NOCJK ) );
- m_pWestFontSizeFT = new FixedText( this, SVX_RES( bCJK ? FT_WEST_SIZE : FT_WEST_SIZE_NOCJK ) );
- m_pWestFontSizeLB = new FontSizeBox( this, SVX_RES( bCJK ? LB_WEST_SIZE : LB_WEST_SIZE_NOCJK ) );
-
- if( !bCJK )
- {
- m_pColorFL = new FixedLine( this, SVX_RES( FL_COLOR2 ) );
- m_pColorFT = new FixedText( this, SVX_RES( FT_COLOR2 ) );
- m_pColorLB = new ColorListBox( this, SVX_RES( LB_COLOR2 ) );
- }
-
- m_pWestFontLanguageFT = new FixedText( this, SVX_RES( bCJK ? FT_WEST_LANG : FT_WEST_LANG_NOCJK ) );
- m_pWestFontLanguageLB = new SvxLanguageBox( this, SVX_RES( bCJK ? LB_WEST_LANG : LB_WEST_LANG_NOCJK ) );
-
- m_pEastLine = new FixedLine( this, SVX_RES( FL_EAST ) );
- m_pEastFontNameFT = new FixedText( this, SVX_RES( FT_EAST_NAME ) );
- m_pEastFontNameLB = new FontNameBox( this, SVX_RES( LB_EAST_NAME ) );
- m_pEastFontStyleFT = new FixedText( this, SVX_RES( FT_EAST_STYLE ) );
- m_pEastFontStyleLB = new FontStyleBox( this, SVX_RES( LB_EAST_STYLE ) );
- m_pEastFontSizeFT = new FixedText( this, SVX_RES( FT_EAST_SIZE ) );
- m_pEastFontSizeLB = new FontSizeBox( this, SVX_RES( LB_EAST_SIZE ) );
- m_pEastFontLanguageFT = new FixedText( this, SVX_RES( FT_EAST_LANG ) );
- m_pEastFontLanguageLB = new SvxLanguageBox( this, SVX_RES( LB_EAST_LANG ) );
-
- m_pCTLLine = new FixedLine( this, SVX_RES( FL_CTL ) );
- m_pCTLFontNameFT = new FixedText( this, SVX_RES( FT_CTL_NAME ) );
- m_pCTLFontNameLB = new FontNameBox( this, SVX_RES( LB_CTL_NAME ) );
- m_pCTLFontStyleFT = new FixedText( this, SVX_RES( FT_CTL_STYLE ) );
- m_pCTLFontStyleLB = new FontStyleBox( this, SVX_RES( LB_CTL_STYLE ) );
- m_pCTLFontSizeFT = new FixedText( this, SVX_RES( FT_CTL_SIZE ) );
- m_pCTLFontSizeLB = new FontSizeBox( this, SVX_RES( LB_CTL_SIZE ) );
- m_pCTLFontLanguageFT = new FixedText( this, SVX_RES( FT_CTL_LANG ) );
- m_pCTLFontLanguageLB = new SvxLanguageBox( this, SVX_RES( LB_CTL_LANG ) );
-
- if( bCJK )
- {
- m_pColorFL = new FixedLine( this, SVX_RES( FL_COLOR2 ) );
- m_pColorFT = new FixedText( this, SVX_RES( FT_COLOR2 ) );
- m_pColorLB = new ColorListBox( this, SVX_RES( LB_COLOR2 ) );
- }
-
- m_pWestLine ->Show( bCJK );
- m_pColorFL ->Show( bCJK );
-
- bCJK = aLanguageOptions.IsCJKFontEnabled();
- m_pEastLine ->Show( bCJK );
- m_pEastFontNameFT ->Show( bCJK );
- m_pEastFontNameLB ->Show( bCJK );
- m_pEastFontStyleFT ->Show( bCJK );
- m_pEastFontStyleLB ->Show( bCJK );
- m_pEastFontSizeFT ->Show( bCJK );
- m_pEastFontSizeLB ->Show( bCJK );
- m_pEastFontLanguageFT ->Show( bCJK );
- m_pEastFontLanguageLB ->Show( bCJK );
-
- sal_Bool bShowCTL = aLanguageOptions.IsCTLFontEnabled();
- if ( bShowCTL && !bCJK )
- {
- // move CTL controls to the places of the CJK controls, if these controls aren't visible
- m_pCTLLine ->SetPosPixel( m_pEastLine->GetPosPixel() );
- m_pCTLFontNameFT ->SetPosPixel( m_pEastFontNameFT->GetPosPixel() );
- m_pCTLFontNameLB ->SetPosPixel( m_pEastFontNameLB->GetPosPixel() );
- m_pCTLFontStyleFT ->SetPosPixel( m_pEastFontStyleFT->GetPosPixel() );
- m_pCTLFontStyleLB ->SetPosPixel( m_pEastFontStyleLB->GetPosPixel() );
- m_pCTLFontSizeFT ->SetPosPixel( m_pEastFontSizeFT->GetPosPixel() );
- m_pCTLFontSizeLB ->SetPosPixel( m_pEastFontSizeLB->GetPosPixel() );
- m_pCTLFontLanguageFT ->SetPosPixel( m_pEastFontLanguageFT->GetPosPixel() );
- m_pCTLFontLanguageLB ->SetPosPixel( m_pEastFontLanguageLB->GetPosPixel() );
- }
- m_pCTLLine ->Show( bShowCTL );
- m_pCTLFontNameFT ->Show( bShowCTL );
- m_pCTLFontNameLB ->Show( bShowCTL );
- m_pCTLFontStyleFT ->Show( bShowCTL );
- m_pCTLFontStyleLB ->Show( bShowCTL );
- m_pCTLFontSizeFT ->Show( bShowCTL );
- m_pCTLFontSizeLB ->Show( bShowCTL );
- m_pCTLFontLanguageFT ->Show( bShowCTL );
- m_pCTLFontLanguageLB ->Show( bShowCTL );
-
- FreeResource();
-
- m_pWestFontLanguageLB->SetLanguageList( LANG_LIST_WESTERN, TRUE, FALSE, TRUE );
- m_pEastFontLanguageLB->SetLanguageList( LANG_LIST_CJK, TRUE, FALSE, TRUE );
- m_pCTLFontLanguageLB->SetLanguageList( LANG_LIST_CTL, TRUE, FALSE, TRUE );
-
- Initialize();
-}
-
-// -----------------------------------------------------------------------
-
-SvxCharNamePage::~SvxCharNamePage()
-{
- delete m_pImpl;
-
- delete m_pWestLine;
- delete m_pWestFontNameFT;
- delete m_pWestFontNameLB;
- delete m_pWestFontStyleFT;
- delete m_pWestFontStyleLB;
- delete m_pWestFontSizeFT;
- delete m_pWestFontSizeLB;
- delete m_pWestFontLanguageFT;
- delete m_pWestFontLanguageLB;
-
- delete m_pEastLine;
- delete m_pEastFontNameFT;
- delete m_pEastFontNameLB;
- delete m_pEastFontStyleFT;
- delete m_pEastFontStyleLB;
- delete m_pEastFontSizeFT;
- delete m_pEastFontSizeLB;
- delete m_pEastFontLanguageFT;
- delete m_pEastFontLanguageLB;
-
- delete m_pCTLLine;
- delete m_pCTLFontNameFT;
- delete m_pCTLFontNameLB;
- delete m_pCTLFontStyleFT;
- delete m_pCTLFontStyleLB;
- delete m_pCTLFontSizeFT;
- delete m_pCTLFontSizeLB;
- delete m_pCTLFontLanguageFT;
- delete m_pCTLFontLanguageLB;
-
- delete m_pColorFL;
- delete m_pColorFT;
- delete m_pColorLB;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::Initialize()
-{
- // to handle the changes of the other pages
- SetExchangeSupport();
-
- // fill the color box
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- //DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorTable* pColorTable = NULL;
- FASTBOOL bKillTable = FALSE;
- const SfxPoolItem* pItem = NULL;
-
- if ( pDocSh )
- {
- pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
- }
-
- if ( !pColorTable )
- {
- pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = TRUE;
- }
-
- m_pColorLB->SetUpdateMode( FALSE );
-
- {
- SfxPoolItem* pDummy;
- SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh );
- if( !pFrame || SFX_ITEM_DEFAULT > pFrame->GetBindings().QueryState(
- SID_ATTR_AUTO_COLOR_INVALID, pDummy ))
- m_pColorLB->InsertEntry( Color( COL_AUTO ),
- SVX_RESSTR( RID_SVXSTR_AUTOMATIC ));
- }
- for ( long i = 0; i < pColorTable->Count(); i++ )
- {
- XColorEntry* pEntry = pColorTable->GetColor(i);
- m_pColorLB->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
-
- m_pColorLB->SetUpdateMode( TRUE );
-
- if ( bKillTable )
- delete pColorTable;
-
- m_pColorLB->SetSelectHdl( LINK( this, SvxCharNamePage, ColorBoxSelectHdl_Impl ) );
-
- Link aLink = LINK( this, SvxCharNamePage, FontModifyHdl_Impl );
- m_pWestFontNameLB->SetModifyHdl( aLink );
- m_pWestFontStyleLB->SetModifyHdl( aLink );
- m_pWestFontSizeLB->SetModifyHdl( aLink );
- m_pEastFontNameLB->SetModifyHdl( aLink );
- m_pEastFontStyleLB->SetModifyHdl( aLink );
- m_pEastFontSizeLB->SetModifyHdl( aLink );
- m_pCTLFontNameLB->SetModifyHdl( aLink );
- m_pCTLFontStyleLB->SetModifyHdl( aLink );
- m_pCTLFontSizeLB->SetModifyHdl( aLink );
-
- m_pImpl->m_aUpdateTimer.SetTimeoutHdl( LINK( this, SvxCharNamePage, UpdateHdl_Impl ) );
-
- m_pColorFL->Hide();
- m_pColorFT->Hide();
- m_pColorLB->Hide();
-}
-
-// -----------------------------------------------------------------------
-
-const FontList* SvxCharNamePage::GetFontList() const
-{
- if ( !m_pImpl->m_pFontList )
- {
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- const SfxPoolItem* pItem;
-
- /* #110771# SvxFontListItem::GetFontList can return NULL */
- if ( pDocSh )
- {
- pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
- if ( pItem != NULL )
- {
- DBG_ASSERT(NULL != ( (SvxFontListItem*)pItem )->GetFontList(),
- "Where is the font list?");
- m_pImpl->m_pFontList = static_cast<const SvxFontListItem*>(pItem )->GetFontList()->Clone();
- m_pImpl->m_bMustDelete = TRUE;
- }
- }
- if(!m_pImpl->m_pFontList)
- {
- m_pImpl->m_pFontList =
- new FontList( Application::GetDefaultDevice() );
- m_pImpl->m_bMustDelete = TRUE;
- }
- }
-
- return m_pImpl->m_pFontList;
-}
-
-// -----------------------------------------------------------------------------
-namespace
-{
- FontInfo calcFontInfo( SvxFont& _rFont,
- SvxCharNamePage* _pPage,
- const FontNameBox* _pFontNameLB,
- const FontStyleBox* _pFontStyleLB,
- const FontSizeBox* _pFontSizeLB,
- const FontList* _pFontList,
- USHORT _nFontWhich,
- USHORT _nFontHeightWhich)
- {
- Size aSize = _rFont.GetSize();
- aSize.Width() = 0;
- FontInfo aFontInfo;
- String sFontName(_pFontNameLB->GetText());
- BOOL bFontAvailable = _pFontList->IsAvailable( sFontName );
- if(bFontAvailable || _pFontNameLB->GetSavedValue() != sFontName)
- aFontInfo = _pFontList->Get( sFontName, _pFontStyleLB->GetText() );
- else
- {
- //get the font from itemset
- SfxItemState eState = _pPage->GetItemSet().GetItemState( _nFontWhich );
- if ( eState >= SFX_ITEM_DEFAULT )
- {
- const SvxFontItem* pFontItem = (const SvxFontItem*)&( _pPage->GetItemSet().Get( _nFontWhich ) );
- aFontInfo.SetName(pFontItem->GetFamilyName());
- aFontInfo.SetStyleName(pFontItem->GetStyleName());
- aFontInfo.SetFamily(pFontItem->GetFamily());
- aFontInfo.SetPitch(pFontItem->GetPitch());
- aFontInfo.SetCharSet(pFontItem->GetCharSet());
- }
- }
- if ( _pFontSizeLB->IsRelative() )
- {
- DBG_ASSERT( _pPage->GetItemSet().GetParent(), "No parent set" );
- const SvxFontHeightItem& rOldItem = (SvxFontHeightItem&)_pPage->GetItemSet().GetParent()->Get( _nFontHeightWhich );
-
- // alter Wert, skaliert
- long nHeight;
- if ( _pFontSizeLB->IsPtRelative() )
- nHeight = rOldItem.GetHeight() + PointToTwips( static_cast<long>(_pFontSizeLB->GetValue() / 10) );
- else
- nHeight = static_cast<long>(rOldItem.GetHeight() * _pFontSizeLB->GetValue() / 100);
-
- // Umrechnung in twips fuer das Beispiel-Window
- aSize.Height() =
- ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), SFX_FUNIT_TWIP );
- }
- else if ( _pFontSizeLB->GetText().Len() )
- aSize.Height() = PointToTwips( static_cast<long>(_pFontSizeLB->GetValue() / 10) );
- else
- aSize.Height() = 200; // default 10pt
- aFontInfo.SetSize( aSize );
-
- _rFont.SetFamily( aFontInfo.GetFamily() );
- _rFont.SetName( aFontInfo.GetName() );
- _rFont.SetStyleName( aFontInfo.GetStyleName() );
- _rFont.SetPitch( aFontInfo.GetPitch() );
- _rFont.SetCharSet( aFontInfo.GetCharSet() );
- _rFont.SetWeight( aFontInfo.GetWeight() );
- _rFont.SetItalic( aFontInfo.GetItalic() );
- _rFont.SetSize( aFontInfo.GetSize() );
-
- return aFontInfo;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::UpdatePreview_Impl()
-{
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
- // Size
- Size aSize = rFont.GetSize();
- aSize.Width() = 0;
- Size aCJKSize = rCJKFont.GetSize();
- aCJKSize.Width() = 0;
- Size aCTLSize = rCTLFont.GetSize();
- aCTLSize.Width() = 0;
- // Font
- const FontList* pFontList = GetFontList();
- FontInfo aFontInfo =
- calcFontInfo(rFont,this,m_pWestFontNameLB,m_pWestFontStyleLB,m_pWestFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_FONT ),GetWhich( SID_ATTR_CHAR_FONTHEIGHT ));
-
- calcFontInfo(rCJKFont,this,m_pEastFontNameLB,m_pEastFontStyleLB,m_pEastFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_CJK_FONT ),GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT ));
-
- calcFontInfo(rCTLFont,this,m_pCTLFontNameLB,m_pCTLFontStyleLB,m_pCTLFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_CTL_FONT ),GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT ));
-
- m_aPreviewWin.Invalidate();
- m_aFontTypeFT.SetText( pFontList->GetFontMapText( aFontInfo ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::FillStyleBox_Impl( const FontNameBox* pNameBox )
-{
- const FontList* pFontList = GetFontList();
- DBG_ASSERT( pFontList, "no fontlist" );
-
- FontStyleBox* pStyleBox = NULL;
-
- if ( m_pWestFontNameLB == pNameBox )
- pStyleBox = m_pWestFontStyleLB;
- else if ( m_pEastFontNameLB == pNameBox )
- pStyleBox = m_pEastFontStyleLB;
- else if ( m_pCTLFontNameLB == pNameBox )
- pStyleBox = m_pCTLFontStyleLB;
- else
- {
- DBG_ERRORFILE( "invalid font name box" );
- }
-
- pStyleBox->Fill( pNameBox->GetText(), pFontList );
-
- if ( m_pImpl->m_bInSearchMode )
- {
- // Bei der Suche zus"atzliche Eintr"age:
- // "Nicht Fett" und "Nicht Kursiv"
- String aEntry = m_pImpl->m_aNoStyleText;
- const sal_Char sS[] = "%1";
- aEntry.SearchAndReplaceAscii( sS, pFontList->GetBoldStr() );
- m_pImpl->m_nExtraEntryPos = pStyleBox->InsertEntry( aEntry );
- aEntry = m_pImpl->m_aNoStyleText;
- aEntry.SearchAndReplaceAscii( sS, pFontList->GetItalicStr() );
- pStyleBox->InsertEntry( aEntry );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::FillSizeBox_Impl( const FontNameBox* pNameBox )
-{
- const FontList* pFontList = GetFontList();
- DBG_ASSERT( pFontList, "no fontlist" );
-
- FontStyleBox* pStyleBox = NULL;
- FontSizeBox* pSizeBox = NULL;
-
- if ( m_pWestFontNameLB == pNameBox )
- {
- pStyleBox = m_pWestFontStyleLB;
- pSizeBox = m_pWestFontSizeLB;
- }
- else if ( m_pEastFontNameLB == pNameBox )
- {
- pStyleBox = m_pEastFontStyleLB;
- pSizeBox = m_pEastFontSizeLB;
- }
- else if ( m_pCTLFontNameLB == pNameBox )
- {
- pStyleBox = m_pCTLFontStyleLB;
- pSizeBox = m_pCTLFontSizeLB;
- }
- else
- {
- DBG_ERRORFILE( "invalid font name box" );
- }
-
- FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) );
- pSizeBox->Fill( &_aFontInfo, pFontList );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp )
-{
- FixedText* pNameLabel = NULL;
- FontNameBox* pNameBox = NULL;
- FixedText* pStyleLabel = NULL;
- FontStyleBox* pStyleBox = NULL;
- FixedText* pSizeLabel = NULL;
- FontSizeBox* pSizeBox = NULL;
- FixedText* pLangFT = NULL;
- SvxLanguageBox* pLangBox = NULL;
- USHORT nWhich = 0;
-
- switch ( eLangGrp )
- {
- case Western :
- pNameLabel = m_pWestFontNameFT;
- pNameBox = m_pWestFontNameLB;
- pStyleLabel = m_pWestFontStyleFT;
- pStyleBox = m_pWestFontStyleLB;
- pSizeLabel = m_pWestFontSizeFT;
- pSizeBox = m_pWestFontSizeLB;
- pLangFT = m_pWestFontLanguageFT;
- pLangBox = m_pWestFontLanguageLB;
- nWhich = GetWhich( SID_ATTR_CHAR_FONT );
- break;
-
- case Asian :
- pNameLabel = m_pEastFontNameFT;
- pNameBox = m_pEastFontNameLB;
- pStyleLabel = m_pEastFontStyleFT;
- pStyleBox = m_pEastFontStyleLB;
- pSizeLabel = m_pEastFontSizeFT;
- pSizeBox = m_pEastFontSizeLB;
- pLangFT = m_pEastFontLanguageFT;
- pLangBox = m_pEastFontLanguageLB;
- nWhich = GetWhich( SID_ATTR_CHAR_CJK_FONT );
- break;
-
- case Ctl :
- pNameLabel = m_pCTLFontNameFT;
- pNameBox = m_pCTLFontNameLB;
- pStyleLabel = m_pCTLFontStyleFT;
- pStyleBox = m_pCTLFontStyleLB;
- pSizeLabel = m_pCTLFontSizeFT;
- pSizeBox = m_pCTLFontSizeLB;
- pLangFT = m_pCTLFontLanguageFT;
- pLangBox = m_pCTLFontLanguageLB;
- nWhich = GetWhich( SID_ATTR_CHAR_CTL_FONT );
- break;
- }
-
- // die FontListBox fuellen
- const FontList* pFontList = GetFontList();
- pNameBox->Fill( pFontList );
-
- // Font ermitteln
- const SvxFontItem* pFontItem = NULL;
- SfxItemState eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DEFAULT )
- {
- pFontItem = (const SvxFontItem*)&( rSet.Get( nWhich ) );
- pNameBox->SetText( pFontItem->GetFamilyName() );
- }
- else
- {
- pNameBox->SetText( String() );
- }
-
- FillStyleBox_Impl( pNameBox );
-
- FASTBOOL bStyle = FALSE;
- FASTBOOL bStyleAvailable = TRUE;
- FontItalic eItalic = ITALIC_NONE;
- FontWeight eWeight = WEIGHT_NORMAL;
- switch ( eLangGrp )
- {
- case Western : nWhich = GetWhich( SID_ATTR_CHAR_POSTURE ); break;
- case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_POSTURE ); break;
- case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_POSTURE ); break;
- }
- eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DEFAULT )
- {
- const SvxPostureItem& rItem = (SvxPostureItem&)rSet.Get( nWhich );
- eItalic = (FontItalic)rItem.GetValue();
- bStyle = TRUE;
- }
- bStyleAvailable = bStyleAvailable && (eState >= SFX_ITEM_DONTCARE);
-
- switch ( eLangGrp )
- {
- case Western : nWhich = GetWhich( SID_ATTR_CHAR_WEIGHT ); break;
- case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_WEIGHT ); break;
- case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_WEIGHT ); break;
- }
- eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DEFAULT )
- {
- SvxWeightItem& rItem = (SvxWeightItem&)rSet.Get( nWhich );
- eWeight = (FontWeight)rItem.GetValue();
- }
- else
- bStyle = FALSE;
- bStyleAvailable = bStyleAvailable && (eState >= SFX_ITEM_DONTCARE);
-
- // Aktuell eingestellter Font
- if ( bStyle && pFontItem )
- {
- FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic );
- pStyleBox->SetText( pFontList->GetStyleName( aInfo ) );
- }
- else if ( !m_pImpl->m_bInSearchMode || !bStyle )
- {
- pStyleBox->SetText( String() );
- }
- else if ( bStyle )
- {
- FontInfo aInfo = pFontList->Get( String(), eWeight, eItalic );
- pStyleBox->SetText( pFontList->GetStyleName( aInfo ) );
- }
- if (!bStyleAvailable)
- {
- pStyleBox->Disable( );
- pStyleLabel->Disable( );
- }
-
- // SizeBox fuellen
- FillSizeBox_Impl( pNameBox );
- switch ( eLangGrp )
- {
- case Western : nWhich = GetWhich( SID_ATTR_CHAR_FONTHEIGHT ); break;
- case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT ); break;
- case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT ); break;
- }
- eState = rSet.GetItemState( nWhich );
-
- if ( pSizeBox->IsRelativeMode() )
- {
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
- const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( nWhich );
-
- if( rItem.GetProp() != 100 || SFX_MAPUNIT_RELATIVE != rItem.GetPropUnit() )
- {
- BOOL bPtRel = SFX_MAPUNIT_POINT == rItem.GetPropUnit();
- pSizeBox->SetPtRelative( bPtRel );
- pSizeBox->SetValue( bPtRel ? ((short)rItem.GetProp()) * 10 : rItem.GetProp() );
- }
- else
- {
- pSizeBox->SetRelative();
- pSizeBox->SetValue( (long)CalcToPoint( rItem.GetHeight(), eUnit, 10 ) );
- }
- }
- else if ( eState >= SFX_ITEM_DEFAULT )
- {
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
- const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( nWhich );
- pSizeBox->SetValue( (long)CalcToPoint( rItem.GetHeight(), eUnit, 10 ) );
- }
- else
- {
- pSizeBox->SetText( String() );
- if ( eState <= SFX_ITEM_READONLY )
- {
- pSizeBox->Disable( );
- pSizeLabel->Disable( );
- }
- }
-
- switch ( eLangGrp )
- {
- case Western : nWhich = GetWhich( SID_ATTR_CHAR_LANGUAGE ); break;
- case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_LANGUAGE ); break;
- case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_LANGUAGE ); break;
- }
- pLangBox->SetNoSelection();
- eState = rSet.GetItemState( nWhich );
-
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- pLangFT->Hide();
- pLangBox->Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- pLangFT->Disable();
- pLangBox->Disable();
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxLanguageItem& rItem = (SvxLanguageItem&)rSet.Get( nWhich );
- LanguageType eLangType = (LanguageType)rItem.GetValue();
- DBG_ASSERT( eLangType != LANGUAGE_SYSTEM, "LANGUAGE_SYSTEM not allowed" );
- if ( eLangType != LANGUAGE_DONTKNOW )
- pLangBox->SelectLanguage( eLangType );
- break;
- }
- }
-
- if ( Western == eLangGrp )
- m_aFontTypeFT.SetText( pFontList->GetFontMapText(
- pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ) );
-
- // save these settings
- pNameBox->SaveValue();
- pStyleBox->SaveValue();
- pSizeBox->SaveValue();
- pLangBox->SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp )
-{
- BOOL bModified = FALSE;
-
- FontNameBox* pNameBox = NULL;
- FontStyleBox* pStyleBox = NULL;
- FontSizeBox* pSizeBox = NULL;
- SvxLanguageBox* pLangBox = NULL;
- USHORT nWhich = 0;
- USHORT nSlot = 0;
-
- switch ( eLangGrp )
- {
- case Western :
- pNameBox = m_pWestFontNameLB;
- pStyleBox = m_pWestFontStyleLB;
- pSizeBox = m_pWestFontSizeLB;
- pLangBox = m_pWestFontLanguageLB;
- nSlot = SID_ATTR_CHAR_FONT;
- break;
-
- case Asian :
- pNameBox = m_pEastFontNameLB;
- pStyleBox = m_pEastFontStyleLB;
- pSizeBox = m_pEastFontSizeLB;
- pLangBox = m_pEastFontLanguageLB;
- nSlot = SID_ATTR_CHAR_CJK_FONT;
- break;
-
- case Ctl :
- pNameBox = m_pCTLFontNameLB;
- pStyleBox = m_pCTLFontStyleLB;
- pSizeBox = m_pCTLFontSizeLB;
- pLangBox = m_pCTLFontLanguageLB;
- nSlot = SID_ATTR_CHAR_CTL_FONT;
- break;
- }
-
- nWhich = GetWhich( nSlot );
- const SfxPoolItem* pItem = NULL;
- const SfxItemSet& rOldSet = GetItemSet();
- const SfxPoolItem* pOld = NULL;
-
- const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
-
- FASTBOOL bChanged = TRUE;
- const String& rFontName = pNameBox->GetText();
- const FontList* pFontList = GetFontList();
- String aStyleBoxText =pStyleBox->GetText();
- USHORT nEntryPos = pStyleBox->GetEntryPos( aStyleBoxText );
- if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
- aStyleBoxText.Erase();
- FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) );
- SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetName(), aInfo.GetStyleName(),
- aInfo.GetPitch(), aInfo.GetCharSet(), nWhich );
- pOld = GetOldItem( rSet, nSlot );
-
- if ( pOld )
- {
- const SvxFontItem& rItem = *( (const SvxFontItem*)pOld );
-
- if ( rItem.GetFamilyName() == aFontItem.GetFamilyName() )
- bChanged = FALSE;
- }
-
- if ( !bChanged )
- bChanged = !pNameBox->GetSavedValue().Len();
-
- if ( !bChanged && pExampleSet &&
- pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- ( (SvxFontItem*)pItem )->GetFamilyName() != aFontItem.GetFamilyName() )
- bChanged = TRUE;
-
- if ( bChanged && rFontName.Len() )
- {
- rSet.Put( aFontItem );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- rSet.ClearItem( nWhich );
-
-
- bChanged = TRUE;
- switch ( eLangGrp )
- {
- case Western : nSlot = SID_ATTR_CHAR_WEIGHT; break;
- case Asian : nSlot = SID_ATTR_CHAR_CJK_WEIGHT; break;
- case Ctl : nSlot = SID_ATTR_CHAR_CTL_WEIGHT; break;
- }
- nWhich = GetWhich( nSlot );
- FontWeight eWeight = aInfo.GetWeight();
- if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
- eWeight = WEIGHT_NORMAL;
- SvxWeightItem aWeightItem( eWeight, nWhich );
- pOld = GetOldItem( rSet, nSlot );
-
- if ( pOld )
- {
- const SvxWeightItem& rItem = *( (const SvxWeightItem*)pOld );
-
- if ( rItem.GetValue() == aWeightItem.GetValue() )
- bChanged = FALSE;
- }
-
- if ( !bChanged )
- {
- bChanged = !pStyleBox->GetSavedValue().Len();
-
- if ( m_pImpl->m_bInSearchMode && bChanged &&
- aInfo.GetWeight() == WEIGHT_NORMAL && aInfo.GetItalic() != ITALIC_NONE )
- bChanged = FALSE;
- }
-
- if ( !bChanged && pExampleSet &&
- pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- ( (SvxWeightItem*)pItem )->GetValue() != aWeightItem.GetValue() )
- bChanged = TRUE;
-
- if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
- bChanged = ( nEntryPos == m_pImpl->m_nExtraEntryPos );
-
- String aText( pStyleBox->GetText() ); // Tristate, dann Text leer
-
- if ( bChanged && aText.Len() )
- {
- rSet.Put( aWeightItem );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
- switch ( eLangGrp )
- {
- case Western : nSlot = SID_ATTR_CHAR_POSTURE; break;
- case Asian : nSlot = SID_ATTR_CHAR_CJK_POSTURE; break;
- case Ctl : nSlot = SID_ATTR_CHAR_CTL_POSTURE; break;
- }
- nWhich = GetWhich( nSlot );
- FontItalic eItalic = aInfo.GetItalic();
- if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
- eItalic = ITALIC_NONE;
- SvxPostureItem aPostureItem( eItalic, nWhich );
- pOld = GetOldItem( rSet, nSlot );
-
- if ( pOld )
- {
- const SvxPostureItem& rItem = *( (const SvxPostureItem*)pOld );
-
- if ( rItem.GetValue() == aPostureItem.GetValue() )
- bChanged = FALSE;
- }
-
- if ( !bChanged )
- {
- bChanged = !pStyleBox->GetSavedValue().Len();
-
- if ( m_pImpl->m_bInSearchMode && bChanged &&
- aInfo.GetItalic() == ITALIC_NONE && aInfo.GetWeight() != WEIGHT_NORMAL )
- bChanged = FALSE;
- }
-
- if ( !bChanged && pExampleSet &&
- pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- ( (SvxPostureItem*)pItem )->GetValue() != aPostureItem.GetValue() )
- bChanged = TRUE;
-
- if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
- bChanged = ( nEntryPos == ( m_pImpl->m_nExtraEntryPos + 1 ) );
-
- if ( bChanged && aText.Len() )
- {
- rSet.Put( aPostureItem );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- // FontSize
- long nSize = static_cast<long>(pSizeBox->GetValue());
-
- if ( !pSizeBox->GetText().Len() ) // GetValue() gibt dann Min-Wert zurueck
- nSize = 0;
- long nSavedSize = pSizeBox->GetSavedValue().ToInt32();
- FASTBOOL bRel = TRUE;
-
- if ( !pSizeBox->IsRelative() )
- {
- nSavedSize *= 10;
- bRel = FALSE;
- }
-
- switch ( eLangGrp )
- {
- case Western : nSlot = SID_ATTR_CHAR_FONTHEIGHT; break;
- case Asian : nSlot = SID_ATTR_CHAR_CJK_FONTHEIGHT; break;
- case Ctl : nSlot = SID_ATTR_CHAR_CTL_FONTHEIGHT; break;
- }
- nWhich = GetWhich( nSlot );
- const SvxFontHeightItem* pOldHeight = (const SvxFontHeightItem*)GetOldItem( rSet, nSlot );
- bChanged = ( nSize != nSavedSize );
-
- if ( !bChanged && pExampleSet &&
- pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET )
- {
- float fSize = (float)nSize / 10;
- long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) );
- if ( ( (SvxFontHeightItem*)pItem )->GetHeight() != (UINT32)nVal )
- bChanged = TRUE;
- }
-
- if ( bChanged || !pOldHeight ||
- bRel != ( SFX_MAPUNIT_RELATIVE != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) )
- {
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
- if ( pSizeBox->IsRelative() )
- {
- DBG_ASSERT( GetItemSet().GetParent(), "No parent set" );
- const SvxFontHeightItem& rOldItem =
- (const SvxFontHeightItem&)GetItemSet().GetParent()->Get( nWhich );
-
- SvxFontHeightItem aHeight( 240, 100, nWhich );
- if ( pSizeBox->IsPtRelative() )
- aHeight.SetHeight( rOldItem.GetHeight(), (USHORT)( nSize / 10 ), SFX_MAPUNIT_POINT, eUnit );
- else
- aHeight.SetHeight( rOldItem.GetHeight(), (USHORT)nSize, SFX_MAPUNIT_RELATIVE );
- rSet.Put( aHeight );
- }
- else
- {
- float fSize = (float)nSize / 10;
- rSet.Put( SvxFontHeightItem( CalcToUnit( fSize, eUnit ), 100, nWhich ) );
- }
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
- switch ( eLangGrp )
- {
- case Western : nSlot = SID_ATTR_CHAR_LANGUAGE; break;
- case Asian : nSlot = SID_ATTR_CHAR_CJK_LANGUAGE; break;
- case Ctl : nSlot = SID_ATTR_CHAR_CTL_LANGUAGE; break;
- }
- nWhich = GetWhich( nSlot );
- pOld = GetOldItem( rSet, nSlot );
- USHORT nLangPos = pLangBox->GetSelectEntryPos();
- LanguageType eLangType = (LanguageType)(ULONG)pLangBox->GetEntryData( nLangPos );
-
- if ( pOld )
- {
- const SvxLanguageItem& rItem = *( (const SvxLanguageItem*)pOld );
-
- if ( nLangPos == LISTBOX_ENTRY_NOTFOUND || eLangType == (LanguageType)rItem.GetValue() )
- bChanged = FALSE;
- }
-
- if ( !bChanged )
- bChanged = ( pLangBox->GetSavedValue() == LISTBOX_ENTRY_NOTFOUND );
-
- if ( bChanged && nLangPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rSet.Put( SvxLanguageItem( eLangType, nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::ResetColor_Impl( const SfxItemSet& rSet )
-{
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
- SfxItemState eState = rSet.GetItemState( nWhich );
-
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_pColorLB->Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_pColorLB->Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_pColorLB->SetNoSelection();
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
- const SvxColorItem& rItem = (SvxColorItem&)rSet.Get( nWhich );
- Color aColor = rItem.GetValue();
- rFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
- rCJKFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
- rCTLFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
- m_aPreviewWin.Invalidate();
- USHORT nSelPos = m_pColorLB->GetEntryPos( aColor );
- if ( nSelPos == LISTBOX_ENTRY_NOTFOUND && aColor == Color( COL_TRANSPARENT ) )
- nSelPos = m_pColorLB->GetEntryPos( m_pImpl->m_aTransparentText );
-
- if ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
- m_pColorLB->SelectEntryPos( nSelPos );
- else
- {
- nSelPos = m_pColorLB->GetEntryPos( aColor );
- if ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
- m_pColorLB->SelectEntryPos( nSelPos );
- else
- m_pColorLB->SelectEntryPos(
- m_pColorLB->InsertEntry( aColor, String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) );
- }
- break;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharNamePage::FillItemSetColor_Impl( SfxItemSet& rSet )
-{
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
- const SvxColorItem* pOld = (const SvxColorItem*)GetOldItem( rSet, SID_ATTR_CHAR_COLOR );
- const SvxColorItem* pItem = NULL;
- BOOL bChanged = TRUE;
- const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
- const SfxItemSet& rOldSet = GetItemSet();
-
- Color aSelectedColor;
- if ( m_pColorLB->GetSelectEntry() == m_pImpl->m_aTransparentText )
- aSelectedColor = Color( COL_TRANSPARENT );
- else
- aSelectedColor = m_pColorLB->GetSelectEntryColor();
-
- if ( pOld && pOld->GetValue() == aSelectedColor )
- bChanged = FALSE;
-
- if ( !bChanged )
- bChanged = ( m_pColorLB->GetSavedValue() == LISTBOX_ENTRY_NOTFOUND );
-
- if ( !bChanged && pExampleSet &&
- pExampleSet->GetItemState( nWhich, FALSE, (const SfxPoolItem**)&pItem ) == SFX_ITEM_SET &&
- ( (SvxColorItem*)pItem )->GetValue() != aSelectedColor )
- bChanged = TRUE;
-
- BOOL bModified = FALSE;
-
- if ( bChanged && m_pColorLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
- {
- rSet.Put( SvxColorItem( aSelectedColor, nWhich ) );
- bModified = TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharNamePage, UpdateHdl_Impl, Timer*, EMPTYARG )
-{
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharNamePage, FontModifyHdl_Impl, void*, pNameBox )
-{
- m_pImpl->m_aUpdateTimer.Start();
-
- if ( m_pWestFontNameLB == pNameBox || m_pEastFontNameLB == pNameBox || m_pCTLFontNameLB == pNameBox )
- {
- FillStyleBox_Impl( (FontNameBox*)pNameBox );
- FillSizeBox_Impl( (FontNameBox*)pNameBox );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharNamePage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox )
-{
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
- Color aSelectedColor;
- if ( pBox->GetSelectEntry() == m_pImpl->m_aTransparentText )
- aSelectedColor = Color( COL_TRANSPARENT );
- else
- aSelectedColor = pBox->GetSelectEntryColor();
- rFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor );
- rCJKFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor );
- rCTLFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor );
- m_aPreviewWin.Invalidate();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::ActivatePage( const SfxItemSet& rSet )
-{
- SvxCharBasePage::ActivatePage( rSet );
-
- UpdatePreview_Impl(); // instead of asynchronous calling in ctor
-}
-
-// -----------------------------------------------------------------------
-
-int SvxCharNamePage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxCharNamePage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxCharNamePage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxCharNamePage::GetRanges()
-{
- return pNameRanges;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::Reset( const SfxItemSet& rSet )
-{
- Reset_Impl( rSet, Western );
- Reset_Impl( rSet, Asian );
- Reset_Impl( rSet, Ctl );
- ResetColor_Impl( rSet );
- m_pColorLB->SaveValue();
-
- SetPrevFontWidthScale( rSet );
- UpdatePreview_Impl();
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharNamePage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bModified = FillItemSet_Impl( rSet, Western );
- bModified |= FillItemSet_Impl( rSet, Asian );
- bModified |= FillItemSet_Impl( rSet, Ctl );
-//! bModified |= FillItemSetColor_Impl( rSet );
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::SetFontList( const SvxFontListItem& rItem )
-{
- if ( m_pImpl->m_bMustDelete )
- {
- delete m_pImpl->m_pFontList;
- }
- m_pImpl->m_pFontList = rItem.GetFontList()->Clone();
- m_pImpl->m_bMustDelete = TRUE;
-}
-
-// -----------------------------------------------------------------------
-namespace
-{
- void enableRelativeMode( SvxCharNamePage* _pPage, FontSizeBox* _pFontSizeLB, USHORT _nHeightWhich )
- {
- _pFontSizeLB->EnableRelativeMode( 5, 995, 5 ); // min 5%, max 995%, step 5
-
- const SvxFontHeightItem& rHeightItem =
- (SvxFontHeightItem&)_pPage->GetItemSet().GetParent()->Get( _nHeightWhich );
- SfxMapUnit eUnit = _pPage->GetItemSet().GetPool()->GetMetric( _nHeightWhich );
- short nCurHeight =
- static_cast< short >( CalcToPoint( rHeightItem.GetHeight(), eUnit, 1 ) * 10 );
-
- // ausgehend von der akt. Hoehe:
- // - negativ bis minimal 2 pt
- // - positiv bis maximal 999 pt
- _pFontSizeLB->EnablePtRelativeMode( sal::static_int_cast< short >(-(nCurHeight - 20)), (9999 - nCurHeight), 10 );
- }
-}
-// -----------------------------------------------------------------------------
-
-void SvxCharNamePage::EnableRelativeMode()
-{
- DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no ParentSet!" );
- enableRelativeMode(this,m_pWestFontSizeLB,GetWhich( SID_ATTR_CHAR_FONTHEIGHT ));
- enableRelativeMode(this,m_pEastFontSizeLB,GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT ));
- enableRelativeMode(this,m_pCTLFontSizeLB,GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT ));
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharNamePage::EnableSearchMode()
-{
- m_pImpl->m_bInSearchMode = TRUE;
-}
-// -----------------------------------------------------------------------
-void SvxCharNamePage::DisableControls( USHORT nDisable )
-{
- if ( DISABLE_LANGUAGE & nDisable )
- {
- if ( m_pWestFontLanguageFT ) m_pWestFontLanguageFT->Disable();
- if ( m_pWestFontLanguageLB ) m_pWestFontLanguageLB->Disable();
- if ( m_pEastFontLanguageFT ) m_pEastFontLanguageFT->Disable();
- if ( m_pEastFontLanguageLB ) m_pEastFontLanguageLB->Disable();
- if ( m_pCTLFontLanguageFT ) m_pCTLFontLanguageFT->Disable();
- if ( m_pCTLFontLanguageLB ) m_pCTLFontLanguageLB->Disable();
- }
-
- if ( DISABLE_HIDE_LANGUAGE & nDisable )
- {
- if ( m_pWestFontLanguageFT ) m_pWestFontLanguageFT->Hide();
- if ( m_pWestFontLanguageLB ) m_pWestFontLanguageLB->Hide();
- if ( m_pEastFontLanguageFT ) m_pEastFontLanguageFT->Hide();
- if ( m_pEastFontLanguageLB ) m_pEastFontLanguageLB->Hide();
- if ( m_pCTLFontLanguageFT ) m_pCTLFontLanguageFT->Hide();
- if ( m_pCTLFontLanguageLB ) m_pCTLFontLanguageLB->Hide();
- }
-}
-
-// -----------------------------------------------------------------------
-void SvxCharNamePage::SetPreviewBackgroundToCharacter()
-{
- m_bPreviewBackgroundToCharacter = sal_True;
-}
-
-// -----------------------------------------------------------------------
-void SvxCharNamePage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pFontListItem,SvxFontListItem,SID_ATTR_CHAR_FONTLIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDisalbeItem,SfxUInt16Item,SID_DISABLE_CTL,sal_False);
- if (pFontListItem)
- SetFontList(*pFontListItem);
- //CHINA001 SetFontList(pFontListItem->GetFontList());
-
- if (pFlagItem)
- {
- UINT32 nFlags=pFlagItem->GetValue();
- if ( ( nFlags & SVX_RELATIVE_MODE ) == SVX_RELATIVE_MODE )
- EnableRelativeMode();
- if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER )
- SetPreviewBackgroundToCharacter();
- }
- if (pDisalbeItem)
- DisableControls(pDisalbeItem->GetValue());
-}
-// class SvxCharEffectsPage ----------------------------------------------
-
-SvxCharEffectsPage::SvxCharEffectsPage( Window* pParent, const SfxItemSet& rInSet ) :
-
- SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_EFFECTS ), rInSet, WIN_EFFECTS_PREVIEW, FT_EFFECTS_FONTTYPE ),
-
- m_aFontColorFT ( this, SVX_RES( FT_FONTCOLOR ) ),
- m_aFontColorLB ( this, SVX_RES( LB_FONTCOLOR ) ),
-
- m_aEffectsFT ( this, SVX_RES( FT_EFFECTS ) ),
- m_aEffectsLB ( this, 0 ),
-
- m_aEffects2LB ( this, SVX_RES( LB_EFFECTS2 ) ),
-
- m_aReliefFT ( this, SVX_RES( FT_RELIEF ) ),
- m_aReliefLB ( this, SVX_RES( LB_RELIEF ) ),
-
- m_aOutlineBtn ( this, SVX_RES( CB_OUTLINE ) ),
- m_aShadowBtn ( this, SVX_RES( CB_SHADOW ) ),
- m_aBlinkingBtn ( this, SVX_RES( CB_BLINKING ) ),
- m_aHiddenBtn ( this, SVX_RES( CB_CHARHIDDEN ) ),
-
- m_aVerticalLine ( this, SVX_RES( FL_EFFECTS_VERTICAL ) ),
-
- m_aOverlineFT ( this, SVX_RES( FT_OVERLINE ) ),
- m_aOverlineLB ( this, SVX_RES( LB_OVERLINE ) ),
- m_aOverlineColorFT ( this, SVX_RES( FT_OVERLINE_COLOR ) ),
- m_aOverlineColorLB ( this, SVX_RES( LB_OVERLINE_COLOR ) ),
- m_aStrikeoutFT ( this, SVX_RES( FT_STRIKEOUT ) ),
- m_aStrikeoutLB ( this, SVX_RES( LB_STRIKEOUT ) ),
- m_aUnderlineFT ( this, SVX_RES( FT_UNDERLINE ) ),
- m_aUnderlineLB ( this, SVX_RES( LB_UNDERLINE ) ),
- m_aUnderlineColorFT ( this, SVX_RES( FT_UNDERLINE_COLOR ) ),
- m_aUnderlineColorLB ( this, SVX_RES( LB_UNDERLINE_COLOR ) ),
- m_aIndividualWordsBtn ( this, SVX_RES( CB_INDIVIDUALWORDS ) ),
-
- m_aAsianLine ( this, SVX_RES( FL_EFFECTS_ASIAN ) ),
-
- m_aEmphasisFT ( this, SVX_RES( FT_EMPHASIS ) ),
- m_aEmphasisLB ( this, SVX_RES( LB_EMPHASIS ) ),
- m_aPositionFT ( this, SVX_RES( FT_POSITION ) ),
- m_aPositionLB ( this, SVX_RES( LB_POSITION ) ),
-
- m_aTransparentColorName ( SVX_RES( STR_CHARNAME_TRANSPARENT ) )
-
-{
- m_aEffectsLB.Hide();
- FreeResource();
- Initialize();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharEffectsPage::Initialize()
-{
- // to handle the changes of the other pages
- SetExchangeSupport();
-
- // HTML-Mode
- const SfxPoolItem* pItem;
- SfxObjectShell* pShell;
- if ( SFX_ITEM_SET == GetItemSet().GetItemState( SID_HTML_MODE, FALSE, &pItem ) ||
- ( NULL != ( pShell = SfxObjectShell::Current() ) &&
- NULL != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
- {
- m_nHtmlMode = ( (const SfxUInt16Item*)pItem )->GetValue();
- if ( ( m_nHtmlMode & HTMLMODE_ON ) == HTMLMODE_ON )
- {
- //!!! hide some controls please
- }
- }
-
- // fill the color box
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorTable* pColorTable = NULL;
- FASTBOOL bKillTable = FALSE;
-
- if ( pDocSh )
- {
- pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
- }
-
- if ( !pColorTable )
- {
- pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = TRUE;
- }
-
- m_aUnderlineColorLB.SetUpdateMode( FALSE );
- m_aOverlineColorLB.SetUpdateMode( FALSE );
- m_aFontColorLB.SetUpdateMode( FALSE );
-
- {
- SfxPoolItem* pDummy;
- SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh );
- if ( !pFrame ||
- SFX_ITEM_DEFAULT > pFrame->GetBindings().QueryState( SID_ATTR_AUTO_COLOR_INVALID, pDummy ) )
- {
- m_aUnderlineColorLB.InsertAutomaticEntry();
- m_aOverlineColorLB.InsertAutomaticEntry();
- m_aFontColorLB.InsertAutomaticEntry();
- }
- }
- for ( long i = 0; i < pColorTable->Count(); i++ )
- {
- XColorEntry* pEntry = pColorTable->GetColor(i);
- m_aUnderlineColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- m_aOverlineColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- m_aFontColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
-
- m_aUnderlineColorLB.SetUpdateMode( TRUE );
- m_aOverlineColorLB.SetUpdateMode( TRUE );
- m_aFontColorLB.SetUpdateMode( TRUE );
- m_aFontColorLB.SetSelectHdl( LINK( this, SvxCharEffectsPage, ColorBoxSelectHdl_Impl ) );
-
- if ( bKillTable )
- delete pColorTable;
-
- // handler
- Link aLink = LINK( this, SvxCharEffectsPage, SelectHdl_Impl );
- m_aUnderlineLB.SetSelectHdl( aLink );
- m_aUnderlineColorLB.SetSelectHdl( aLink );
- m_aOverlineLB.SetSelectHdl( aLink );
- m_aOverlineColorLB.SetSelectHdl( aLink );
- m_aStrikeoutLB.SetSelectHdl( aLink );
- m_aEmphasisLB.SetSelectHdl( aLink );
- m_aPositionLB.SetSelectHdl( aLink );
- m_aEffects2LB.SetSelectHdl( aLink );
- m_aReliefLB.SetSelectHdl( aLink );
-
- m_aUnderlineLB.SelectEntryPos( 0 );
- m_aUnderlineColorLB.SelectEntryPos( 0 );
- m_aOverlineLB.SelectEntryPos( 0 );
- m_aOverlineColorLB.SelectEntryPos( 0 );
- m_aStrikeoutLB.SelectEntryPos( 0 );
- m_aEmphasisLB.SelectEntryPos( 0 );
- m_aPositionLB.SelectEntryPos( 0 );
- SelectHdl_Impl( NULL );
- SelectHdl_Impl( &m_aEmphasisLB );
-
- m_aEffects2LB.SelectEntryPos( 0 );
-
- m_aIndividualWordsBtn.SetClickHdl( LINK( this, SvxCharEffectsPage, CbClickHdl_Impl ) );
- aLink = LINK( this, SvxCharEffectsPage, TristClickHdl_Impl );
- m_aOutlineBtn.SetClickHdl( aLink );
- m_aShadowBtn.SetClickHdl( aLink );
-
- if ( !SvtLanguageOptions().IsAsianTypographyEnabled() )
- {
- m_aAsianLine.Hide();
- m_aEmphasisFT.Hide();
- m_aEmphasisLB.Hide();
- m_aPositionFT.Hide();
- m_aPositionLB.Hide();
- }
-}
-// -----------------------------------------------------------------------
-
-void SvxCharEffectsPage::UpdatePreview_Impl()
-{
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
-
- USHORT nPos = m_aUnderlineLB.GetSelectEntryPos();
- FontUnderline eUnderline = (FontUnderline)(ULONG)m_aUnderlineLB.GetEntryData( nPos );
- nPos = m_aOverlineLB.GetSelectEntryPos();
- FontUnderline eOverline = (FontUnderline)(ULONG)m_aOverlineLB.GetEntryData( nPos );
- nPos = m_aStrikeoutLB.GetSelectEntryPos();
- FontStrikeout eStrikeout = (FontStrikeout)(ULONG)m_aStrikeoutLB.GetEntryData( nPos );
- rFont.SetUnderline( eUnderline );
- rCJKFont.SetUnderline( eUnderline );
- rCTLFont.SetUnderline( eUnderline );
- m_aPreviewWin.SetTextLineColor( m_aUnderlineColorLB.GetSelectEntryColor() );
- rFont.SetOverline( eOverline );
- rCJKFont.SetOverline( eOverline );
- rCTLFont.SetOverline( eOverline );
- m_aPreviewWin.SetOverlineColor( m_aOverlineColorLB.GetSelectEntryColor() );
- rFont.SetStrikeout( eStrikeout );
- rCJKFont.SetStrikeout( eStrikeout );
- rCTLFont.SetStrikeout( eStrikeout );
-
- nPos = m_aPositionLB.GetSelectEntryPos();
- BOOL bUnder = ( CHRDLG_POSITION_UNDER == (ULONG)m_aPositionLB.GetEntryData( nPos ) );
- FontEmphasisMark eMark = (FontEmphasisMark)m_aEmphasisLB.GetSelectEntryPos();
- eMark |= bUnder ? EMPHASISMARK_POS_BELOW : EMPHASISMARK_POS_ABOVE;
- rFont.SetEmphasisMark( eMark );
- rCJKFont.SetEmphasisMark( eMark );
- rCTLFont.SetEmphasisMark( eMark );
-
- USHORT nRelief = m_aReliefLB.GetSelectEntryPos();
- if(LISTBOX_ENTRY_NOTFOUND != nRelief)
- {
- rFont.SetRelief( (FontRelief)nRelief );
- rCJKFont.SetRelief( (FontRelief)nRelief );
- rCTLFont.SetRelief( (FontRelief)nRelief );
- }
-
- rFont.SetOutline( StateToAttr( m_aOutlineBtn.GetState() ) );
- rCJKFont.SetOutline( rFont.IsOutline() );
- rCTLFont.SetOutline( rFont.IsOutline() );
-
- rFont.SetShadow( StateToAttr( m_aShadowBtn.GetState() ) );
- rCJKFont.SetShadow( rFont.IsShadow() );
- rCTLFont.SetShadow( rFont.IsShadow() );
-
- USHORT nCapsPos = m_aEffects2LB.GetSelectEntryPos();
- if ( nCapsPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rFont.SetCaseMap( (SvxCaseMap)nCapsPos );
- rCJKFont.SetCaseMap( (SvxCaseMap)nCapsPos );
- // #i78474# small caps do not exist in CTL fonts
- rCTLFont.SetCaseMap( static_cast<SvxCaseMap>( nCapsPos == SVX_CASEMAP_KAPITAELCHEN ? SVX_CASEMAP_NOT_MAPPED : (SvxCaseMap)nCapsPos) );
- }
-
- BOOL bWordLine = m_aIndividualWordsBtn.IsChecked();
- rFont.SetWordLineMode( bWordLine );
- rCJKFont.SetWordLineMode( bWordLine );
- rCTLFont.SetWordLineMode( bWordLine );
-
- m_aPreviewWin.Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharEffectsPage::SetCaseMap_Impl( SvxCaseMap eCaseMap )
-{
- if ( SVX_CASEMAP_END > eCaseMap )
- m_aEffects2LB.SelectEntryPos(
- sal::static_int_cast< USHORT >( eCaseMap ) );
- else
- {
- m_aEffects2LB.SetNoSelection();
- eCaseMap = SVX_CASEMAP_NOT_MAPPED;
- }
-
- UpdatePreview_Impl();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet )
-{
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
- SfxItemState eState = rSet.GetItemState( nWhich );
-
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aFontColorFT.Hide();
- m_aFontColorLB.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aFontColorFT.Disable();
- m_aFontColorLB.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aFontColorLB.SetNoSelection();
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
-
- const SvxColorItem& rItem = (SvxColorItem&)rSet.Get( nWhich );
- Color aColor = rItem.GetValue();
- rFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
- rCJKFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
- rCTLFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor );
-
- m_aPreviewWin.Invalidate();
- USHORT nSelPos = m_aFontColorLB.GetEntryPos( aColor );
- if ( nSelPos == LISTBOX_ENTRY_NOTFOUND && aColor == Color( COL_TRANSPARENT ) )
- nSelPos = m_aFontColorLB.GetEntryPos( m_aTransparentColorName );
-
- if ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
- m_aFontColorLB.SelectEntryPos( nSelPos );
- else
- {
- nSelPos = m_aFontColorLB.GetEntryPos( aColor );
- if ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
- m_aFontColorLB.SelectEntryPos( nSelPos );
- else
- m_aFontColorLB.SelectEntryPos(
- m_aFontColorLB.InsertEntry( aColor, String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) );
- }
- break;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
-{
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
- const SvxColorItem* pOld = (const SvxColorItem*)GetOldItem( rSet, SID_ATTR_CHAR_COLOR );
- const SvxColorItem* pItem = NULL;
- BOOL bChanged = TRUE;
- const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
- const SfxItemSet& rOldSet = GetItemSet();
-
- Color aSelectedColor;
- if ( m_aFontColorLB.GetSelectEntry() == m_aTransparentColorName )
- aSelectedColor = Color( COL_TRANSPARENT );
- else
- aSelectedColor = m_aFontColorLB.GetSelectEntryColor();
-
- if ( pOld && pOld->GetValue() == aSelectedColor )
- bChanged = FALSE;
-
- if ( !bChanged )
- bChanged = ( m_aFontColorLB.GetSavedValue() == LISTBOX_ENTRY_NOTFOUND );
-
- if ( !bChanged && pExampleSet &&
- pExampleSet->GetItemState( nWhich, FALSE, (const SfxPoolItem**)&pItem ) == SFX_ITEM_SET &&
- ( (SvxColorItem*)pItem )->GetValue() != aSelectedColor )
- bChanged = TRUE;
-
- BOOL bModified = FALSE;
-
- if ( bChanged && m_aFontColorLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
- {
- rSet.Put( SvxColorItem( aSelectedColor, nWhich ) );
- bModified = TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox )
-{
- if ( &m_aEmphasisLB == pBox )
- {
- USHORT nEPos = m_aEmphasisLB.GetSelectEntryPos();
- BOOL bEnable = ( nEPos > 0 && nEPos != LISTBOX_ENTRY_NOTFOUND );
- m_aPositionFT.Enable( bEnable );
- m_aPositionLB.Enable( bEnable );
- }
- else if( &m_aReliefLB == pBox)
- {
- BOOL bEnable = ( pBox->GetSelectEntryPos() == 0 );
- m_aOutlineBtn.Enable( bEnable );
- m_aShadowBtn.Enable( bEnable );
- }
- else if ( &m_aPositionLB != pBox )
- {
- USHORT nUPos = m_aUnderlineLB.GetSelectEntryPos(),
- nOPos = m_aOverlineLB.GetSelectEntryPos(),
- nSPos = m_aStrikeoutLB.GetSelectEntryPos();
- BOOL bUEnable = ( nUPos > 0 && nUPos != LISTBOX_ENTRY_NOTFOUND );
- BOOL bOEnable = ( nOPos > 0 && nOPos != LISTBOX_ENTRY_NOTFOUND );
- m_aUnderlineColorFT.Enable( bUEnable );
- m_aUnderlineColorLB.Enable( bUEnable );
- m_aOverlineColorFT.Enable( bOEnable );
- m_aOverlineColorLB.Enable( bOEnable );
- m_aIndividualWordsBtn.Enable( bUEnable || bOEnable || ( nSPos > 0 && nSPos != LISTBOX_ENTRY_NOTFOUND ) );
- }
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharEffectsPage, UpdatePreview_Impl, ListBox*, EMPTYARG )
-{
- bool bEnable = ( ( m_aUnderlineLB.GetSelectEntryPos() > 0 ) ||
- ( m_aOverlineLB.GetSelectEntryPos() > 0 ) ||
- ( m_aStrikeoutLB.GetSelectEntryPos() > 0 ) );
- m_aIndividualWordsBtn.Enable( bEnable );
-
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharEffectsPage, CbClickHdl_Impl, CheckBox*, EMPTYARG )
-{
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharEffectsPage, TristClickHdl_Impl, TriStateBox*, EMPTYARG )
-{
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox )
-{
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
-
- Color aSelectedColor;
- if ( pBox->GetSelectEntry() == m_aTransparentColorName )
- aSelectedColor = Color( COL_TRANSPARENT );
- else
- aSelectedColor = pBox->GetSelectEntryColor();
- rFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor );
- rCJKFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor );
- rCTLFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor );
-
- m_aPreviewWin.Invalidate();
- return 0;
-}
-// -----------------------------------------------------------------------
-
-int SvxCharEffectsPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxCharEffectsPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxCharEffectsPage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxCharEffectsPage::GetRanges()
-{
- return pEffectsRanges;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharEffectsPage::Reset( const SfxItemSet& rSet )
-{
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
-
- BOOL bEnable = FALSE;
-
- // Underline
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE );
- rFont.SetUnderline( UNDERLINE_NONE );
- rCJKFont.SetUnderline( UNDERLINE_NONE );
- rCTLFont.SetUnderline( UNDERLINE_NONE );
-
- m_aUnderlineLB.SelectEntryPos( 0 );
- SfxItemState eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DONTCARE )
- {
- if ( eState == SFX_ITEM_DONTCARE )
- m_aUnderlineLB.SetNoSelection();
- else
- {
- const SvxUnderlineItem& rItem = (SvxUnderlineItem&)rSet.Get( nWhich );
- FontUnderline eUnderline = (FontUnderline)rItem.GetValue();
- rFont.SetUnderline( eUnderline );
- rCJKFont.SetUnderline( eUnderline );
- rCTLFont.SetUnderline( eUnderline );
-
- if ( eUnderline != UNDERLINE_NONE )
- {
- for ( USHORT i = 0; i < m_aUnderlineLB.GetEntryCount(); ++i )
- {
- if ( (FontUnderline)(ULONG)m_aUnderlineLB.GetEntryData(i) == eUnderline )
- {
- m_aUnderlineLB.SelectEntryPos(i);
- bEnable |= TRUE;
- break;
- }
- }
-
- Color aColor = rItem.GetColor();
- USHORT nPos = m_aUnderlineColorLB.GetEntryPos( aColor );
-
- if ( LISTBOX_ENTRY_NOTFOUND != nPos )
- m_aUnderlineColorLB.SelectEntryPos( nPos );
- else
- {
- nPos = m_aUnderlineColorLB.GetEntryPos( aColor );
- if ( LISTBOX_ENTRY_NOTFOUND != nPos )
- m_aUnderlineColorLB.SelectEntryPos( nPos );
- else
- m_aUnderlineColorLB.SelectEntryPos(
- m_aUnderlineColorLB.InsertEntry( aColor,
- String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) );
- }
- }
- else
- {
- m_aUnderlineColorLB.SelectEntry( Color( COL_AUTO ));
- m_aUnderlineColorLB.Disable();
- }
- }
- }
-
- // Overline
- nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE );
- rFont.SetOverline( UNDERLINE_NONE );
- rCJKFont.SetOverline( UNDERLINE_NONE );
- rCTLFont.SetOverline( UNDERLINE_NONE );
-
- m_aOverlineLB.SelectEntryPos( 0 );
- eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DONTCARE )
- {
- if ( eState == SFX_ITEM_DONTCARE )
- m_aOverlineLB.SetNoSelection();
- else
- {
- const SvxOverlineItem& rItem = (SvxOverlineItem&)rSet.Get( nWhich );
- FontUnderline eOverline = (FontUnderline)rItem.GetValue();
- rFont.SetOverline( eOverline );
- rCJKFont.SetOverline( eOverline );
- rCTLFont.SetOverline( eOverline );
-
- if ( eOverline != UNDERLINE_NONE )
- {
- for ( USHORT i = 0; i < m_aOverlineLB.GetEntryCount(); ++i )
- {
- if ( (FontUnderline)(ULONG)m_aOverlineLB.GetEntryData(i) == eOverline )
- {
- m_aOverlineLB.SelectEntryPos(i);
- bEnable |= TRUE;
- break;
- }
- }
-
- Color aColor = rItem.GetColor();
- USHORT nPos = m_aOverlineColorLB.GetEntryPos( aColor );
-
- if ( LISTBOX_ENTRY_NOTFOUND != nPos )
- m_aOverlineColorLB.SelectEntryPos( nPos );
- else
- {
- nPos = m_aOverlineColorLB.GetEntryPos( aColor );
- if ( LISTBOX_ENTRY_NOTFOUND != nPos )
- m_aOverlineColorLB.SelectEntryPos( nPos );
- else
- m_aOverlineColorLB.SelectEntryPos(
- m_aOverlineColorLB.InsertEntry( aColor,
- String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) );
- }
- }
- else
- {
- m_aOverlineColorLB.SelectEntry( Color( COL_AUTO ));
- m_aOverlineColorLB.Disable();
- }
- }
- }
-
- // Strikeout
- nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT );
- rFont.SetStrikeout( STRIKEOUT_NONE );
- rCJKFont.SetStrikeout( STRIKEOUT_NONE );
- rCTLFont.SetStrikeout( STRIKEOUT_NONE );
-
- m_aStrikeoutLB.SelectEntryPos( 0 );
- eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DONTCARE )
- {
- if ( eState == SFX_ITEM_DONTCARE )
- m_aStrikeoutLB.SetNoSelection();
- else
- {
- const SvxCrossedOutItem& rItem = (SvxCrossedOutItem&)rSet.Get( nWhich );
- FontStrikeout eStrikeout = (FontStrikeout)rItem.GetValue();
- rFont.SetStrikeout( eStrikeout );
- rCJKFont.SetStrikeout( eStrikeout );
- rCTLFont.SetStrikeout( eStrikeout );
-
- if ( eStrikeout != STRIKEOUT_NONE )
- {
- for ( USHORT i = 0; i < m_aStrikeoutLB.GetEntryCount(); ++i )
- {
- if ( (FontStrikeout)(ULONG)m_aStrikeoutLB.GetEntryData(i) == eStrikeout )
- {
- m_aStrikeoutLB.SelectEntryPos(i);
- bEnable |= TRUE;
- break;
- }
- }
- }
- }
- }
-
- // WordLineMode
- nWhich = GetWhich( SID_ATTR_CHAR_WORDLINEMODE );
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aIndividualWordsBtn.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aIndividualWordsBtn.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aIndividualWordsBtn.SetState( STATE_DONTKNOW );
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxWordLineModeItem& rItem = (SvxWordLineModeItem&)rSet.Get( nWhich );
- rFont.SetWordLineMode( rItem.GetValue() );
- rCJKFont.SetWordLineMode( rItem.GetValue() );
- rCTLFont.SetWordLineMode( rItem.GetValue() );
-
- m_aIndividualWordsBtn.Check( rItem.GetValue() );
- m_aIndividualWordsBtn.Enable( bEnable );
- break;
- }
- }
-
- // Emphasis
- nWhich = GetWhich( SID_ATTR_CHAR_EMPHASISMARK );
- eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DEFAULT )
- {
- const SvxEmphasisMarkItem& rItem = (SvxEmphasisMarkItem&)rSet.Get( nWhich );
- FontEmphasisMark eMark = rItem.GetEmphasisMark();
- rFont.SetEmphasisMark( eMark );
- rCJKFont.SetEmphasisMark( eMark );
- rCTLFont.SetEmphasisMark( eMark );
-
- m_aEmphasisLB.SelectEntryPos( (USHORT)( eMark & EMPHASISMARK_STYLE ) );
- eMark &= ~EMPHASISMARK_STYLE;
- ULONG nEntryData = ( eMark == EMPHASISMARK_POS_ABOVE )
- ? CHRDLG_POSITION_OVER
- : ( eMark == EMPHASISMARK_POS_BELOW ) ? CHRDLG_POSITION_UNDER : 0;
-
- for ( USHORT i = 0; i < m_aPositionLB.GetEntryCount(); i++ )
- {
- if ( nEntryData == (ULONG)m_aPositionLB.GetEntryData(i) )
- {
- m_aPositionLB.SelectEntryPos(i);
- break;
- }
- }
- }
- else if ( eState == SFX_ITEM_DONTCARE )
- m_aEmphasisLB.SetNoSelection( );
- else if ( eState == SFX_ITEM_UNKNOWN )
- {
- m_aEmphasisFT.Hide();
- m_aEmphasisLB.Hide();
- }
- else // SFX_ITEM_DISABLED or SFX_ITEM_READONLY
- {
- m_aEmphasisFT.Disable();
- m_aEmphasisLB.Disable();
- }
-
- // the select handler for the underline/overline/strikeout list boxes
-// SelectHdl_Impl( NULL );
- DBG_ASSERT(m_aUnderlineLB.GetSelectHdl() == m_aOverlineLB.GetSelectHdl(),
- "SvxCharEffectsPage::Reset: inconsistence (1)!");
- DBG_ASSERT(m_aUnderlineLB.GetSelectHdl() == m_aStrikeoutLB.GetSelectHdl(),
- "SvxCharEffectsPage::Reset: inconsistence (1)!");
- m_aUnderlineLB.GetSelectHdl().Call(NULL);
- // don't call SelectHdl_Impl directly!
- // in DisableControls, we may have re-reouted the select handler
- // 30.05.2001 - 86262 - frank.schoenheit@germany.sun.com
-
- // the select handler for the emphasis listbox
-// SelectHdl_Impl( &m_aEmphasisLB );
- DBG_ASSERT(m_aEmphasisLB.GetSelectHdl() == LINK(this, SvxCharEffectsPage, SelectHdl_Impl),
- "SvxCharEffectsPage::Reset: inconsistence (2)!");
- m_aEmphasisLB.GetSelectHdl().Call( &m_aEmphasisLB );
- // this is for consistency only. Here it would be allowed to call SelectHdl_Impl directly ...
-
- // Effects
- SvxCaseMap eCaseMap = SVX_CASEMAP_END;
- nWhich = GetWhich( SID_ATTR_CHAR_CASEMAP );
- eState = rSet.GetItemState( nWhich );
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aEffectsFT.Hide();
- m_aEffects2LB.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aEffectsFT.Disable();
- m_aEffects2LB.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aEffects2LB.SetNoSelection();
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxCaseMapItem& rItem = (const SvxCaseMapItem&)rSet.Get( nWhich );
- eCaseMap = (SvxCaseMap)rItem.GetValue();
- break;
- }
- }
- SetCaseMap_Impl( eCaseMap );
-
- //Relief
- nWhich = GetWhich(SID_ATTR_CHAR_RELIEF);
- eState = rSet.GetItemState( nWhich );
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aReliefFT.Hide();
- m_aReliefLB.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aReliefFT.Disable();
- m_aReliefLB.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aReliefLB.SetNoSelection();
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxCharReliefItem& rItem = (const SvxCharReliefItem&)rSet.Get( nWhich );
- m_aReliefLB.SelectEntryPos(rItem.GetValue());
- SelectHdl_Impl(&m_aReliefLB);
- break;
- }
- }
-
- // Outline
- nWhich = GetWhich( SID_ATTR_CHAR_CONTOUR );
- eState = rSet.GetItemState( nWhich );
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aOutlineBtn.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aOutlineBtn.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aOutlineBtn.SetState( STATE_DONTKNOW );
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxContourItem& rItem = (SvxContourItem&)rSet.Get( nWhich );
- m_aOutlineBtn.SetState( (TriState)rItem.GetValue() );
- m_aOutlineBtn.EnableTriState( FALSE );
- break;
- }
- }
-
- // Shadow
- nWhich = GetWhich( SID_ATTR_CHAR_SHADOWED );
- eState = rSet.GetItemState( nWhich );
-
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aShadowBtn.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aShadowBtn.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aShadowBtn.SetState( STATE_DONTKNOW );
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxShadowedItem& rItem = (SvxShadowedItem&)rSet.Get( nWhich );
- m_aShadowBtn.SetState( (TriState)rItem.GetValue() );
- m_aShadowBtn.EnableTriState( FALSE );
- break;
- }
- }
-
- // Blinking
- nWhich = GetWhich( SID_ATTR_FLASH );
- eState = rSet.GetItemState( nWhich );
-
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aBlinkingBtn.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aBlinkingBtn.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aBlinkingBtn.SetState( STATE_DONTKNOW );
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxBlinkItem& rItem = (SvxBlinkItem&)rSet.Get( nWhich );
- m_aBlinkingBtn.SetState( (TriState)rItem.GetValue() );
- m_aBlinkingBtn.EnableTriState( FALSE );
- break;
- }
- }
- // Hidden
- nWhich = GetWhich( SID_ATTR_CHAR_HIDDEN );
- eState = rSet.GetItemState( nWhich );
-
- switch ( eState )
- {
- case SFX_ITEM_UNKNOWN:
- m_aHiddenBtn.Hide();
- break;
-
- case SFX_ITEM_DISABLED:
- case SFX_ITEM_READONLY:
- m_aHiddenBtn.Disable();
- break;
-
- case SFX_ITEM_DONTCARE:
- m_aHiddenBtn.SetState( STATE_DONTKNOW );
- break;
-
- case SFX_ITEM_DEFAULT:
- case SFX_ITEM_SET:
- {
- const SvxCharHiddenItem& rItem = (SvxCharHiddenItem&)rSet.Get( nWhich );
- m_aHiddenBtn.SetState( (TriState)rItem.GetValue() );
- m_aHiddenBtn.EnableTriState( FALSE );
- break;
- }
- }
-
- SetPrevFontWidthScale( rSet );
- ResetColor_Impl( rSet );
-
- // preview update
- m_aPreviewWin.Invalidate();
-
- // save this settings
- m_aUnderlineLB.SaveValue();
- m_aUnderlineColorLB.SaveValue();
- m_aOverlineLB.SaveValue();
- m_aOverlineColorLB.SaveValue();
- m_aStrikeoutLB.SaveValue();
- m_aIndividualWordsBtn.SaveValue();
- m_aEmphasisLB.SaveValue();
- m_aPositionLB.SaveValue();
- m_aEffects2LB.SaveValue();
- m_aReliefLB.SaveValue();
- m_aOutlineBtn.SaveValue();
- m_aShadowBtn.SaveValue();
- m_aBlinkingBtn.SaveValue();
- m_aHiddenBtn.SaveValue();
- m_aFontColorLB.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
-{
- const SfxPoolItem* pOld = 0;
- const SfxItemSet& rOldSet = GetItemSet();
- BOOL bModified = FALSE;
- FASTBOOL bChanged = TRUE;
-
- // Underline
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_UNDERLINE );
- USHORT nPos = m_aUnderlineLB.GetSelectEntryPos();
- FontUnderline eUnder = (FontUnderline)(ULONG)m_aUnderlineLB.GetEntryData( nPos );
-
- if ( pOld )
- {
- //! if there are different underline styles in the selection the
- //! item-state in the 'rOldSet' will be invalid. In this case
- //! changing the underline style will be allowed if a style is
- //! selected in the listbox.
- BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
- SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE );
-
- const SvxUnderlineItem& rItem = *( (const SvxUnderlineItem*)pOld );
- if ( (FontUnderline)rItem.GetValue() == eUnder &&
- ( UNDERLINE_NONE == eUnder || rItem.GetColor() == m_aUnderlineColorLB.GetSelectEntryColor() ) &&
- ! bAllowChg )
- bChanged = FALSE;
- }
-
- if ( bChanged )
- {
- SvxUnderlineItem aNewItem( eUnder, nWhich );
- aNewItem.SetColor( m_aUnderlineColorLB.GetSelectEntryColor() );
- rSet.Put( aNewItem );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Overline
- nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_OVERLINE );
- nPos = m_aOverlineLB.GetSelectEntryPos();
- FontUnderline eOver = (FontUnderline)(ULONG)m_aOverlineLB.GetEntryData( nPos );
-
- if ( pOld )
- {
- //! if there are different underline styles in the selection the
- //! item-state in the 'rOldSet' will be invalid. In this case
- //! changing the underline style will be allowed if a style is
- //! selected in the listbox.
- BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
- SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE );
-
- const SvxOverlineItem& rItem = *( (const SvxOverlineItem*)pOld );
- if ( (FontUnderline)rItem.GetValue() == eOver &&
- ( UNDERLINE_NONE == eOver || rItem.GetColor() == m_aOverlineColorLB.GetSelectEntryColor() ) &&
- ! bAllowChg )
- bChanged = FALSE;
- }
-
- if ( bChanged )
- {
- SvxOverlineItem aNewItem( eOver, nWhich );
- aNewItem.SetColor( m_aOverlineColorLB.GetSelectEntryColor() );
- rSet.Put( aNewItem );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Strikeout
- nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_STRIKEOUT );
- nPos = m_aStrikeoutLB.GetSelectEntryPos();
- FontStrikeout eStrike = (FontStrikeout)(ULONG)m_aStrikeoutLB.GetEntryData( nPos );
-
- if ( pOld )
- {
- //! if there are different strikeout styles in the selection the
- //! item-state in the 'rOldSet' will be invalid. In this case
- //! changing the strikeout style will be allowed if a style is
- //! selected in the listbox.
- BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
- SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE );
-
- const SvxCrossedOutItem& rItem = *( (const SvxCrossedOutItem*)pOld );
- if ( !m_aStrikeoutLB.IsEnabled()
- || ((FontStrikeout)rItem.GetValue() == eStrike && !bAllowChg) )
- bChanged = FALSE;
- }
-
- if ( bChanged )
- {
- rSet.Put( SvxCrossedOutItem( eStrike, nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Individual words
- nWhich = GetWhich( SID_ATTR_CHAR_WORDLINEMODE );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_WORDLINEMODE );
-
- if ( pOld )
- {
- const SvxWordLineModeItem& rItem = *( (const SvxWordLineModeItem*)pOld );
- if ( rItem.GetValue() == m_aIndividualWordsBtn.IsChecked() )
- bChanged = FALSE;
- }
-
- if ( rOldSet.GetItemState( nWhich ) == SFX_ITEM_DONTCARE &&
- m_aIndividualWordsBtn.IsChecked() == m_aIndividualWordsBtn.GetSavedValue() )
- bChanged = FALSE;
-
- if ( bChanged )
- {
- rSet.Put( SvxWordLineModeItem( m_aIndividualWordsBtn.IsChecked(), nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Emphasis
- nWhich = GetWhich( SID_ATTR_CHAR_EMPHASISMARK );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_EMPHASISMARK );
- USHORT nMarkPos = m_aEmphasisLB.GetSelectEntryPos();
- USHORT nPosPos = m_aPositionLB.GetSelectEntryPos();
- FontEmphasisMark eMark = (FontEmphasisMark)nMarkPos;
- if ( m_aPositionLB.IsEnabled() )
- {
- eMark |= ( CHRDLG_POSITION_UNDER == (ULONG)m_aPositionLB.GetEntryData( nPosPos ) )
- ? EMPHASISMARK_POS_BELOW : EMPHASISMARK_POS_ABOVE;
- }
-
- if ( pOld )
- {
- if( rOldSet.GetItemState( nWhich ) != SFX_ITEM_DONTCARE )
- {
- const SvxEmphasisMarkItem& rItem = *( (const SvxEmphasisMarkItem*)pOld );
- if ( rItem.GetEmphasisMark() == eMark )
- bChanged = FALSE;
- }
- }
-
- if ( rOldSet.GetItemState( nWhich ) == SFX_ITEM_DONTCARE &&
- m_aEmphasisLB.GetSavedValue() == nMarkPos && m_aPositionLB.GetSavedValue() == nPosPos )
- bChanged = FALSE;
-
- if ( bChanged )
- {
- rSet.Put( SvxEmphasisMarkItem( eMark, nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Effects
- nWhich = GetWhich( SID_ATTR_CHAR_CASEMAP );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_CASEMAP );
- SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED;
- FASTBOOL bChecked = FALSE;
- USHORT nCapsPos = m_aEffects2LB.GetSelectEntryPos();
- if ( nCapsPos != LISTBOX_ENTRY_NOTFOUND )
- {
- eCaseMap = (SvxCaseMap)nCapsPos;
- bChecked = TRUE;
- }
-
- if ( pOld )
- {
- //! if there are different effect styles in the selection the
- //! item-state in the 'rOldSet' will be invalid. In this case
- //! changing the effect style will be allowed if a style is
- //! selected in the listbox.
- BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos &&
- SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE );
-
- const SvxCaseMapItem& rItem = *( (const SvxCaseMapItem*)pOld );
- if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg )
- bChanged = FALSE;
- }
-
- if ( bChanged && bChecked )
- {
- rSet.Put( SvxCaseMapItem( eCaseMap, nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- //Relief
- nWhich = GetWhich(SID_ATTR_CHAR_RELIEF);
- if(m_aReliefLB.GetSelectEntryPos() != m_aReliefLB.GetSavedValue())
- {
- m_aReliefLB.SaveValue();
- SvxCharReliefItem aRelief((FontRelief)m_aReliefLB.GetSelectEntryPos(), nWhich);
- rSet.Put(aRelief);
- }
-
- // Outline
- const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
- nWhich = GetWhich( SID_ATTR_CHAR_CONTOUR );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_CONTOUR );
- TriState eState = m_aOutlineBtn.GetState();
- const SfxPoolItem* pItem;
-
- if ( pOld )
- {
- const SvxContourItem& rItem = *( (const SvxContourItem*)pOld );
- if ( rItem.GetValue() == StateToAttr( eState ) && m_aOutlineBtn.GetSavedValue() == eState )
- bChanged = FALSE;
- }
-
- if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- !StateToAttr( eState ) && ( (SvxContourItem*)pItem )->GetValue() )
- bChanged = TRUE;
-
- if ( bChanged && eState != STATE_DONTKNOW )
- {
- rSet.Put( SvxContourItem( StateToAttr( eState ), nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Shadow
- nWhich = GetWhich( SID_ATTR_CHAR_SHADOWED );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_SHADOWED );
- eState = m_aShadowBtn.GetState();
-
- if ( pOld )
- {
- const SvxShadowedItem& rItem = *( (const SvxShadowedItem*)pOld );
- if ( rItem.GetValue() == StateToAttr( eState ) && m_aShadowBtn.GetSavedValue() == eState )
- bChanged = FALSE;
- }
-
- if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- !StateToAttr( eState ) && ( (SvxShadowedItem*)pItem )->GetValue() )
- bChanged = TRUE;
-
- if ( bChanged && eState != STATE_DONTKNOW )
- {
- rSet.Put( SvxShadowedItem( StateToAttr( eState ), nWhich ) );
- bModified = TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Blinking
- nWhich = GetWhich( SID_ATTR_FLASH );
- pOld = GetOldItem( rSet, SID_ATTR_FLASH );
- eState = m_aBlinkingBtn.GetState();
-
- if ( pOld )
- {
- const SvxBlinkItem& rItem = *( (const SvxBlinkItem*)pOld );
- if ( rItem.GetValue() == StateToAttr( eState ) && m_aBlinkingBtn.GetSavedValue() == eState )
- bChanged = FALSE;
- }
-
- if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- !StateToAttr( eState ) && ( (SvxBlinkItem*)pItem )->GetValue() )
- bChanged = TRUE;
-
- if ( bChanged && eState != STATE_DONTKNOW )
- {
- rSet.Put( SvxBlinkItem( StateToAttr( eState ), nWhich ) );
- bModified = TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- // Hidden
- nWhich = GetWhich( SID_ATTR_CHAR_HIDDEN );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_HIDDEN );
- eState = m_aHiddenBtn.GetState();
- bChanged = TRUE;
-
- if ( pOld )
- {
- const SvxCharHiddenItem& rItem = *( (const SvxCharHiddenItem*)pOld );
- if ( rItem.GetValue() == StateToAttr( eState ) && m_aHiddenBtn.GetSavedValue() == eState )
- bChanged = FALSE;
- }
-
- if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, FALSE, &pItem ) == SFX_ITEM_SET &&
- !StateToAttr( eState ) && ( (SvxCharHiddenItem*)pItem )->GetValue() )
- bChanged = TRUE;
-
- if ( bChanged && eState != STATE_DONTKNOW )
- {
- rSet.Put( SvxCharHiddenItem( StateToAttr( eState ), nWhich ) );
- bModified = TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bModified |= FillItemSetColor_Impl( rSet );
-
- return bModified;
-}
-
-void SvxCharEffectsPage::DisableControls( USHORT nDisable )
-{
- if ( ( DISABLE_CASEMAP & nDisable ) == DISABLE_CASEMAP )
- {
- m_aEffectsFT.Disable();
- m_aEffects2LB.Disable();
- }
-
- if ( ( DISABLE_WORDLINE & nDisable ) == DISABLE_WORDLINE )
- m_aIndividualWordsBtn.Disable();
-
- if ( ( DISABLE_BLINK & nDisable ) == DISABLE_BLINK )
- m_aBlinkingBtn.Disable();
-
- if ( ( DISABLE_UNDERLINE_COLOR & nDisable ) == DISABLE_UNDERLINE_COLOR )
- {
- // disable the controls
- m_aUnderlineColorFT.Disable( );
- m_aUnderlineColorLB.Disable( );
- // and reroute the selection handler of the controls which normally would affect the color box dis-/enabling
- m_aUnderlineLB.SetSelectHdl(LINK(this, SvxCharEffectsPage, UpdatePreview_Impl));
- m_aStrikeoutLB.SetSelectHdl(LINK(this, SvxCharEffectsPage, UpdatePreview_Impl));
- }
-}
-
-void SvxCharEffectsPage::EnableFlash()
-{
- if ( !( ( m_nHtmlMode & HTMLMODE_ON ) && !( m_nHtmlMode & HTMLMODE_BLINK ) ) )
- m_aBlinkingBtn.Show();
-}
-
-// -----------------------------------------------------------------------
-void SvxCharEffectsPage::SetPreviewBackgroundToCharacter()
-{
- m_bPreviewBackgroundToCharacter = TRUE;
-}
-
-// -----------------------------------------------------------------------
-void SvxCharEffectsPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pDisableCtlItem,SfxUInt16Item,SID_DISABLE_CTL,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- if (pDisableCtlItem)
- DisableControls(pDisableCtlItem->GetValue());
-
- if (pFlagItem)
- {
- UINT32 nFlags=pFlagItem->GetValue();
- if ( ( nFlags & SVX_ENABLE_FLASH ) == SVX_ENABLE_FLASH )
- EnableFlash();
- if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER )
- SetPreviewBackgroundToCharacter();
- }
-}
-
-// class SvxCharPositionPage ---------------------------------------------
-
-SvxCharPositionPage::SvxCharPositionPage( Window* pParent, const SfxItemSet& rInSet ) :
-
- SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_POSITION ), rInSet, WIN_POS_PREVIEW, FT_POS_FONTTYPE ),
-
- m_aPositionLine ( this, SVX_RES( FL_POSITION ) ),
- m_aHighPosBtn ( this, SVX_RES( RB_HIGHPOS ) ),
- m_aNormalPosBtn ( this, SVX_RES( RB_NORMALPOS ) ),
- m_aLowPosBtn ( this, SVX_RES( RB_LOWPOS ) ),
- m_aHighLowFT ( this, SVX_RES( FT_HIGHLOW ) ),
- m_aHighLowEdit ( this, SVX_RES( ED_HIGHLOW ) ),
- m_aHighLowRB ( this, SVX_RES( CB_HIGHLOW ) ),
- m_aFontSizeFT ( this, SVX_RES( FT_FONTSIZE ) ),
- m_aFontSizeEdit ( this, SVX_RES( ED_FONTSIZE ) ),
- m_aRotationScalingFL( this, SVX_RES( FL_ROTATION_SCALING ) ),
- m_aScalingFL ( this, SVX_RES( FL_SCALING ) ),
- m_a0degRB ( this, SVX_RES( RB_0_DEG ) ),
- m_a90degRB ( this, SVX_RES( RB_90_DEG ) ),
- m_a270degRB ( this, SVX_RES( RB_270_DEG ) ),
- m_aFitToLineCB ( this, SVX_RES( CB_FIT_TO_LINE ) ),
- m_aScaleWidthFT ( this, SVX_RES( FT_SCALE_WIDTH ) ),
- m_aScaleWidthMF ( this, SVX_RES( MF_SCALE_WIDTH ) ),
-
- m_aKerningLine ( this, SVX_RES( FL_KERNING2 ) ),
- m_aKerningLB ( this, SVX_RES( LB_KERNING2 ) ),
- m_aKerningFT ( this, SVX_RES( FT_KERNING2 ) ),
- m_aKerningEdit ( this, SVX_RES( ED_KERNING2 ) ),
- m_aPairKerningBtn ( this, SVX_RES( CB_PAIRKERNING ) ),
-
- m_nSuperEsc ( (short)DFLT_ESC_SUPER ),
- m_nSubEsc ( (short)DFLT_ESC_SUB ),
- m_nScaleWidthItemSetVal ( 100 ),
- m_nScaleWidthInitialVal ( 100 ),
- m_nSuperProp ( (BYTE)DFLT_ESC_PROP ),
- m_nSubProp ( (BYTE)DFLT_ESC_PROP )
-{
- FreeResource();
- Initialize();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharPositionPage::Initialize()
-{
- // to handle the changes of the other pages
- SetExchangeSupport();
-
- GetPreviewFont().SetSize( Size( 0, 240 ) );
- GetPreviewCJKFont().SetSize( Size( 0, 240 ) );
- GetPreviewCTLFont().SetSize( Size( 0, 240 ) );
-
- m_aNormalPosBtn.Check();
- PositionHdl_Impl( &m_aNormalPosBtn );
- m_aKerningLB.SelectEntryPos( 0 );
- KerningSelectHdl_Impl( NULL );
-
- Link aLink = LINK( this, SvxCharPositionPage, PositionHdl_Impl );
- m_aHighPosBtn.SetClickHdl( aLink );
- m_aNormalPosBtn.SetClickHdl( aLink );
- m_aLowPosBtn.SetClickHdl( aLink );
-
- aLink = LINK( this, SvxCharPositionPage, RotationHdl_Impl );
- m_a0degRB .SetClickHdl( aLink );
- m_a90degRB .SetClickHdl( aLink );
- m_a270degRB.SetClickHdl( aLink );
-
- aLink = LINK( this, SvxCharPositionPage, FontModifyHdl_Impl );
- m_aHighLowEdit.SetModifyHdl( aLink );
- m_aFontSizeEdit.SetModifyHdl( aLink );
-
- aLink = LINK( this, SvxCharPositionPage, LoseFocusHdl_Impl );
- m_aHighLowEdit.SetLoseFocusHdl( aLink );
- m_aFontSizeEdit.SetLoseFocusHdl( aLink );
-
- m_aHighLowRB.SetClickHdl( LINK( this, SvxCharPositionPage, AutoPositionHdl_Impl ) );
- m_aFitToLineCB.SetClickHdl( LINK( this, SvxCharPositionPage, FitToLineHdl_Impl ) );
- m_aKerningLB.SetSelectHdl( LINK( this, SvxCharPositionPage, KerningSelectHdl_Impl ) );
- m_aKerningEdit.SetModifyHdl( LINK( this, SvxCharPositionPage, KerningModifyHdl_Impl ) );
- m_aPairKerningBtn.SetClickHdl( LINK( this, SvxCharPositionPage, PairKerningHdl_Impl ) );
- m_aScaleWidthMF.SetModifyHdl( LINK( this, SvxCharPositionPage, ScaleWidthModifyHdl_Impl ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharPositionPage::UpdatePreview_Impl( BYTE nProp, BYTE nEscProp, short nEsc )
-{
- SetPrevFontEscapement( nProp, nEscProp, nEsc );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharPositionPage::SetEscapement_Impl( USHORT nEsc )
-{
- SvxEscapementItem aEscItm( (SvxEscapement)nEsc, SID_ATTR_CHAR_ESCAPEMENT );
-
- if ( SVX_ESCAPEMENT_SUPERSCRIPT == nEsc )
- {
- aEscItm.GetEsc() = m_nSuperEsc;
- aEscItm.GetProp() = m_nSuperProp;
- }
- else if ( SVX_ESCAPEMENT_SUBSCRIPT == nEsc )
- {
- aEscItm.GetEsc() = m_nSubEsc;
- aEscItm.GetProp() = m_nSubProp;
- }
-
- short nFac = aEscItm.GetEsc() < 0 ? -1 : 1;
-
- m_aHighLowEdit.SetValue( aEscItm.GetEsc() * nFac );
- m_aFontSizeEdit.SetValue( aEscItm.GetProp() );
-
- if ( SVX_ESCAPEMENT_OFF == nEsc )
- {
- m_aHighLowFT.Disable();
- m_aHighLowEdit.Disable();
- m_aFontSizeFT.Disable();
- m_aFontSizeEdit.Disable();
- m_aHighLowRB.Disable();
- }
- else
- {
- m_aFontSizeFT.Enable();
- m_aFontSizeEdit.Enable();
- m_aHighLowRB.Enable();
-
- if ( !m_aHighLowRB.IsChecked() )
- {
- m_aHighLowFT.Enable();
- m_aHighLowEdit.Enable();
- }
- else
- AutoPositionHdl_Impl( &m_aHighLowRB );
- }
-
- UpdatePreview_Impl( 100, aEscItm.GetProp(), aEscItm.GetEsc() );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, PositionHdl_Impl, RadioButton*, pBtn )
-{
- USHORT nEsc = SVX_ESCAPEMENT_OFF; // also when pBtn == NULL
-
- if ( &m_aHighPosBtn == pBtn )
- nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
- else if ( &m_aLowPosBtn == pBtn )
- nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
-
- SetEscapement_Impl( nEsc );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, RotationHdl_Impl, RadioButton*, pBtn )
-{
- BOOL bEnable = FALSE;
- if (&m_a90degRB == pBtn || &m_a270degRB == pBtn)
- bEnable = TRUE;
- else
- OSL_ENSURE( &m_a0degRB == pBtn, "unexpected button" );
- m_aFitToLineCB.Enable( bEnable );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, FontModifyHdl_Impl, MetricField*, EMPTYARG )
-{
- BYTE nEscProp = (BYTE)m_aFontSizeEdit.GetValue();
- short nEsc = (short)m_aHighLowEdit.GetValue();
- nEsc *= m_aLowPosBtn.IsChecked() ? -1 : 1;
- UpdatePreview_Impl( 100, nEscProp, nEsc );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, AutoPositionHdl_Impl, CheckBox*, pBox )
-{
- if ( pBox->IsChecked() )
- {
- m_aHighLowFT.Disable();
- m_aHighLowEdit.Disable();
- }
- else
- PositionHdl_Impl( m_aHighPosBtn.IsChecked() ? &m_aHighPosBtn
- : m_aLowPosBtn.IsChecked() ? &m_aLowPosBtn
- : &m_aNormalPosBtn );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, FitToLineHdl_Impl, CheckBox*, pBox )
-{
- if ( &m_aFitToLineCB == pBox)
- {
- UINT16 nVal = m_nScaleWidthInitialVal;
- if (m_aFitToLineCB.IsChecked())
- nVal = m_nScaleWidthItemSetVal;
- m_aScaleWidthMF.SetValue( nVal );
-
- m_aPreviewWin.SetFontWidthScale( nVal );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, KerningSelectHdl_Impl, ListBox*, EMPTYARG )
-{
- if ( m_aKerningLB.GetSelectEntryPos() > 0 )
- {
- m_aKerningFT.Enable();
- m_aKerningEdit.Enable();
-
- if ( m_aKerningLB.GetSelectEntryPos() == 2 )
- {
- // Condensed -> max value == 1/6 of the current font height
- SvxFont& rFont = GetPreviewFont();
- long nMax = rFont.GetSize().Height() / 6;
- m_aKerningEdit.SetMax( m_aKerningEdit.Normalize( nMax ), FUNIT_TWIP );
- m_aKerningEdit.SetLast( m_aKerningEdit.GetMax( m_aKerningEdit.GetUnit() ) );
- }
- else
- {
- m_aKerningEdit.SetMax( 9999 );
- m_aKerningEdit.SetLast( 9999 );
- }
- }
- else
- {
- m_aKerningEdit.SetValue( 0 );
- m_aKerningFT.Disable();
- m_aKerningEdit.Disable();
- }
-
- KerningModifyHdl_Impl( NULL );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, KerningModifyHdl_Impl, MetricField*, EMPTYARG )
-{
- long nVal = static_cast<long>(m_aKerningEdit.GetValue());
- nVal = LogicToLogic( nVal, MAP_POINT, MAP_TWIP );
- long nKern = (short)m_aKerningEdit.Denormalize( nVal );
-
- // Condensed? -> then negative
- if ( m_aKerningLB.GetSelectEntryPos() == 2 )
- nKern *= -1;
-
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
-
- rFont.SetFixKerning( (short)nKern );
- rCJKFont.SetFixKerning( (short)nKern );
- rCTLFont.SetFixKerning( (short)nKern );
- m_aPreviewWin.Invalidate();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, PairKerningHdl_Impl, CheckBox*, EMPTYARG )
-{
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField )
-{
-#ifdef DBG_UTIL
- sal_Bool bHigh = m_aHighPosBtn.IsChecked();
-#endif
- sal_Bool bLow = m_aLowPosBtn.IsChecked();
- DBG_ASSERT( bHigh || bLow, "normal position is not valid" );
-
- if ( &m_aHighLowEdit == pField )
- {
- if ( bLow )
- m_nSubEsc = (short)m_aHighLowEdit.GetValue() * -1;
- else
- m_nSuperEsc = (short)m_aHighLowEdit.GetValue();
- }
- else if ( &m_aFontSizeEdit == pField )
- {
- if ( bLow )
- m_nSubProp = (BYTE)m_aFontSizeEdit.GetValue();
- else
- m_nSuperProp = (BYTE)m_aFontSizeEdit.GetValue();
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharPositionPage, ScaleWidthModifyHdl_Impl, MetricField*, EMPTYARG )
-{
- m_aPreviewWin.SetFontWidthScale( USHORT( m_aScaleWidthMF.GetValue() ) );
-
- return 0;
-}
-
-/* -----------------28.08.2003 12:12-----------------
-
- --------------------------------------------------*/
-void SvxCharPositionPage::ActivatePage( const SfxItemSet& rSet )
-{
- //update the preview
- SvxCharBasePage::ActivatePage( rSet );
-
- //the only thing that has to be checked is the max. allowed value for the
- //condense edit field
- if ( m_aKerningLB.GetSelectEntryPos() == 2 )
- {
- // Condensed -> max value == 1/6 of the current font height
- SvxFont& rFont = GetPreviewFont();
- long nMax = rFont.GetSize().Height() / 6;
- long nKern = (short)m_aKerningEdit.Denormalize( LogicToLogic( static_cast<long>(m_aKerningEdit.GetValue()), MAP_POINT, MAP_TWIP ) );
- m_aKerningEdit.SetMax( m_aKerningEdit.Normalize( nKern > nMax ? nKern : nMax ), FUNIT_TWIP );
- m_aKerningEdit.SetLast( m_aKerningEdit.GetMax( m_aKerningEdit.GetUnit() ) );
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxCharPositionPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxCharPositionPage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxCharPositionPage::GetRanges()
-{
- return pPositionRanges;
-}
-
-// -----------------------------------------------------------------------
-#define ENABLE_AND_CHECK( aCheckBox ) \
- if ( !aCheckBox.IsEnabled() ) \
- aCheckBox.Enable(); \
- aCheckBox.Check( TRUE )
-
-void SvxCharPositionPage::Reset( const SfxItemSet& rSet )
-{
- String sUser = GetUserData();
-
- if ( sUser.Len() )
- {
- m_nSuperEsc = (short)sUser.GetToken( 0 ).ToInt32();
- m_nSubEsc = (short)sUser.GetToken( 1 ).ToInt32();
- m_nSuperProp = (BYTE)sUser.GetToken( 2 ).ToInt32();
- m_nSubProp = (BYTE)sUser.GetToken( 3 ).ToInt32();
- }
-
- short nEsc = 0;
- BYTE nEscProp = 100;
- BYTE nProp = 100;
-
- m_aHighLowFT.Disable();
- m_aHighLowEdit.Disable();
- m_aFontSizeFT.Disable();
- m_aFontSizeEdit.Disable();
-
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_ESCAPEMENT );
-
- if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT )
- {
- const SvxEscapementItem& rItem = (SvxEscapementItem&)rSet.Get( nWhich );
- nEsc = rItem.GetEsc();
- nEscProp = rItem.GetProp();
-
- if ( nEsc != 0 )
- {
- m_aHighLowFT.Enable();
- m_aHighLowEdit.Enable();
- m_aFontSizeFT.Enable();
- m_aFontSizeEdit.Enable();
-
- short nFac;
-
- if ( nEsc > 0 )
- {
- nFac = 1;
- m_aHighPosBtn.Check( TRUE );
- if ( nEsc == DFLT_ESC_AUTO_SUPER )
- {
- ENABLE_AND_CHECK( m_aHighLowRB );
- nEsc = DFLT_ESC_SUPER;
- }
- }
- else
- {
- nFac = -1;
- m_aLowPosBtn.Check( TRUE );
- if ( nEsc == DFLT_ESC_AUTO_SUB )
- {
- ENABLE_AND_CHECK( m_aHighLowRB );
- nEsc = DFLT_ESC_SUB;
- }
- }
-
- if ( m_aHighLowRB.IsChecked() )
- {
- m_aHighLowFT.Disable();
- m_aHighLowEdit.Disable();
- }
- m_aHighLowEdit.SetValue( m_aHighLowEdit.Normalize( nFac * nEsc ) );
- }
- else
- {
- m_aNormalPosBtn.Check( TRUE );
- m_aHighLowRB.Check( TRUE );
- PositionHdl_Impl( NULL );
- }
- //the height has to be set after the handler is called to keep the value also if the escapement is zero
- m_aFontSizeEdit.SetValue( m_aFontSizeEdit.Normalize( nEscProp ) );
- }
- else
- {
- m_aHighPosBtn.Check( FALSE );
- m_aNormalPosBtn.Check( FALSE );
- m_aLowPosBtn.Check( FALSE );
- }
-
- // BspFont setzen
- SetPrevFontEscapement( nProp, nEscProp, nEsc );
-
- // Kerning
- nWhich = GetWhich( SID_ATTR_CHAR_KERNING );
-
- if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT )
- {
- const SvxKerningItem& rItem = (SvxKerningItem&)rSet.Get( nWhich );
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
- MapUnit eOrgUnit = (MapUnit)eUnit;
- MapUnit ePntUnit( MAP_POINT );
- long nBig = static_cast<long>(m_aKerningEdit.Normalize( static_cast<long>(rItem.GetValue()) ));
- long nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit );
-
- // Kerning am Font setzen, vorher in Twips umrechnen
- long nKern = LogicToLogic( rItem.GetValue(), (MapUnit)eUnit, MAP_TWIP );
- rFont.SetFixKerning( (short)nKern );
- rCJKFont.SetFixKerning( (short)nKern );
- rCTLFont.SetFixKerning( (short)nKern );
-
- if ( nKerning > 0 )
- {
- m_aKerningLB.SelectEntryPos( LW_GESPERRT );
- }
- else if ( nKerning < 0 )
- {
- m_aKerningLB.SelectEntryPos( LW_SCHMAL );
- nKerning = -nKerning;
- }
- else
- {
- nKerning = 0;
- m_aKerningLB.SelectEntryPos( LW_NORMAL );
- }
- //enable/disable and set min/max of the Edit
- KerningSelectHdl_Impl(&m_aKerningLB);
- //the attribute value must be displayed also if it's above the maximum allowed value
- long nVal = static_cast<long>(m_aKerningEdit.GetMax());
- if(nVal < nKerning)
- m_aKerningEdit.SetMax( nKerning );
- m_aKerningEdit.SetValue( nKerning );
- }
- else
- m_aKerningEdit.SetText( String() );
-
- // Pair kerning
- nWhich = GetWhich( SID_ATTR_CHAR_AUTOKERN );
-
- if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT )
- {
- const SvxAutoKernItem& rItem = (SvxAutoKernItem&)rSet.Get( nWhich );
- m_aPairKerningBtn.Check( rItem.GetValue() );
- }
- else
- m_aPairKerningBtn.Check( FALSE );
-
- // Scale Width
- nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
- if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT )
- {
- const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich );
- m_nScaleWidthInitialVal = rItem.GetValue();
- m_aScaleWidthMF.SetValue( m_nScaleWidthInitialVal );
- }
- else
- m_aScaleWidthMF.SetValue( 100 );
-
- nWhich = GetWhich( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE );
- if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT )
- m_nScaleWidthItemSetVal = ((SfxUInt16Item&) rSet.Get( nWhich )).GetValue();
-
- // Rotation
- nWhich = GetWhich( SID_ATTR_CHAR_ROTATED );
- SfxItemState eState = rSet.GetItemState( nWhich );
- if( SFX_ITEM_UNKNOWN == eState )
- {
- m_aRotationScalingFL.Hide();
- m_aScalingFL.Show();
- m_a0degRB.Hide();
- m_a90degRB.Hide();
- m_a270degRB.Hide();
- m_aFitToLineCB.Hide();
- m_aFitToLineCB .Hide();
-
-
- // move the following controls upwards
- Window* aCntrlArr[] = {
- &m_aScaleWidthFT, &m_aScaleWidthMF, &m_aKerningLine,
- &m_aKerningLB, &m_aKerningFT, &m_aKerningEdit, &m_aPairKerningBtn,
- 0 };
-
- long nDiff = m_aScaleWidthMF.GetPosPixel().Y() -
- m_a0degRB.GetPosPixel().Y();
-
- for( Window** ppW = aCntrlArr; *ppW; ++ppW )
- {
- Point aPnt( (*ppW)->GetPosPixel() );
- aPnt.Y() -= nDiff;
- (*ppW)->SetPosPixel( aPnt );
- }
- }
- else
- {
- m_aScalingFL.Hide();
-
- Link aOldLink( m_aFitToLineCB.GetClickHdl() );
- m_aFitToLineCB.SetClickHdl( Link() );
- if( eState >= SFX_ITEM_DEFAULT )
- {
- const SvxCharRotateItem& rItem =
- (SvxCharRotateItem&) rSet.Get( nWhich );
- if (rItem.IsBottomToTop())
- m_a90degRB.Check( TRUE );
- else if (rItem.IsTopToBotton())
- m_a270degRB.Check( TRUE );
- else
- {
- DBG_ASSERT( 0 == rItem.GetValue(), "incorrect value" );
- m_a0degRB.Check( TRUE );
- }
- m_aFitToLineCB.Check( rItem.IsFitToLine() );
- }
- else
- {
- if( eState == SFX_ITEM_DONTCARE )
- {
- m_a0degRB.Check( FALSE );
- m_a90degRB.Check( FALSE );
- m_a270degRB.Check( FALSE );
- }
- else
- m_a0degRB.Check( TRUE );
-
- m_aFitToLineCB.Check( FALSE );
- }
- m_aFitToLineCB.SetClickHdl( aOldLink );
- m_aFitToLineCB.Enable( !m_a0degRB.IsChecked() );
-
- // is this value set?
- if( SFX_ITEM_UNKNOWN == rSet.GetItemState( GetWhich(
- SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ) ))
- m_aFitToLineCB.Hide();
- }
-
- m_aHighPosBtn.SaveValue();
- m_aNormalPosBtn.SaveValue();
- m_aLowPosBtn.SaveValue();
- m_a0degRB.SaveValue();
- m_a90degRB.SaveValue();
- m_a270degRB.SaveValue();
- m_aFitToLineCB.SaveValue();
- m_aScaleWidthMF.SaveValue();
- m_aKerningLB.SaveValue();
- m_aKerningEdit.SaveValue();
- m_aPairKerningBtn.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
-{
- // Position (hoch, normal oder tief)
- const SfxItemSet& rOldSet = GetItemSet();
- BOOL bModified = FALSE, bChanged = TRUE;
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_ESCAPEMENT );
- const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_ESCAPEMENT );
- const FASTBOOL bHigh = m_aHighPosBtn.IsChecked();
- short nEsc;
- BYTE nEscProp;
-
- if ( bHigh || m_aLowPosBtn.IsChecked() )
- {
- if ( m_aHighLowRB.IsChecked() )
- nEsc = bHigh ? DFLT_ESC_AUTO_SUPER : DFLT_ESC_AUTO_SUB;
- else
- {
- nEsc = (short)m_aHighLowEdit.Denormalize( m_aHighLowEdit.GetValue() );
- nEsc *= bHigh ? 1 : -1;
- }
- nEscProp = (BYTE)m_aFontSizeEdit.Denormalize( m_aFontSizeEdit.GetValue() );
- }
- else
- {
- nEsc = 0;
- nEscProp = 100;
- }
-
- if ( pOld )
- {
- const SvxEscapementItem& rItem = *( (const SvxEscapementItem*)pOld );
- if ( rItem.GetEsc() == nEsc && rItem.GetProp() == nEscProp )
- bChanged = FALSE;
- }
-
- if ( !bChanged && !m_aHighPosBtn.GetSavedValue() &&
- !m_aNormalPosBtn.GetSavedValue() && !m_aLowPosBtn.GetSavedValue() )
- bChanged = TRUE;
-
- if ( bChanged &&
- ( m_aHighPosBtn.IsChecked() || m_aNormalPosBtn.IsChecked() || m_aLowPosBtn.IsChecked() ) )
- {
- rSet.Put( SvxEscapementItem( nEsc, nEscProp, nWhich ) );
- bModified = TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Kerning
- nWhich = GetWhich( SID_ATTR_CHAR_KERNING );
- pOld = GetOldItem( rSet, SID_ATTR_CHAR_KERNING );
- USHORT nPos = m_aKerningLB.GetSelectEntryPos();
- short nKerning = 0;
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
-
- if ( nPos == LW_GESPERRT || nPos == LW_SCHMAL )
- {
- long nTmp = static_cast<long>(m_aKerningEdit.GetValue());
- long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
- nKerning = (short)m_aKerningEdit.Denormalize( nVal );
-
- if ( nPos == LW_SCHMAL )
- nKerning *= - 1;
- }
-
- if ( pOld )
- {
- const SvxKerningItem& rItem = *( (const SvxKerningItem*)pOld );
- if ( rItem.GetValue() == nKerning )
- bChanged = FALSE;
- }
-
- if ( !bChanged &&
- ( m_aKerningLB.GetSavedValue() == LISTBOX_ENTRY_NOTFOUND ||
- ( !m_aKerningEdit.GetSavedValue().Len() && m_aKerningEdit.IsEnabled() ) ) )
- bChanged = TRUE;
-
- if ( bChanged && nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rSet.Put( SvxKerningItem( nKerning, nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- bChanged = TRUE;
-
- // Pair-Kerning
- nWhich = GetWhich( SID_ATTR_CHAR_AUTOKERN );
-
- if ( m_aPairKerningBtn.IsChecked() != m_aPairKerningBtn.GetSavedValue() )
- {
- rSet.Put( SvxAutoKernItem( m_aPairKerningBtn.IsChecked(), nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- // Scale Width
- nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
- if ( m_aScaleWidthMF.GetText() != m_aScaleWidthMF.GetSavedValue() )
- {
- rSet.Put( SvxCharScaleWidthItem( (USHORT)m_aScaleWidthMF.GetValue(), nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- // Rotation
- nWhich = GetWhich( SID_ATTR_CHAR_ROTATED );
- if ( m_a0degRB .IsChecked() != m_a0degRB .GetSavedValue() ||
- m_a90degRB .IsChecked() != m_a90degRB .GetSavedValue() ||
- m_a270degRB .IsChecked() != m_a270degRB .GetSavedValue() ||
- m_aFitToLineCB.IsChecked() != m_aFitToLineCB.GetSavedValue() )
- {
- SvxCharRotateItem aItem( 0, m_aFitToLineCB.IsChecked(), nWhich );
- if (m_a90degRB.IsChecked())
- aItem.SetBottomToTop();
- else if (m_a270degRB.IsChecked())
- aItem.SetTopToBotton();
- rSet.Put( aItem );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharPositionPage::FillUserData()
-{
- const sal_Unicode cTok = ';';
-
- String sUser( UniString::CreateFromInt32( m_nSuperEsc ) );
- sUser.Append( cTok );
- sUser.Append( UniString::CreateFromInt32( m_nSubEsc ) );
- sUser.Append( cTok );
- sUser.Append( UniString::CreateFromInt32( m_nSuperProp ) );
- sUser.Append( cTok );
- sUser.Append( UniString::CreateFromInt32( m_nSubProp ) );
- SetUserData( sUser );
-}
-
-// -----------------------------------------------------------------------
-void SvxCharPositionPage::SetPreviewBackgroundToCharacter()
-{
- m_bPreviewBackgroundToCharacter = TRUE;
-}
-// -----------------------------------------------------------------------
-void SvxCharPositionPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- if (pFlagItem)
- {
- UINT32 nFlags=pFlagItem->GetValue();
- if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER )
- SetPreviewBackgroundToCharacter();
- }
-}
-// class SvxCharTwoLinesPage ------------------------------------------------
-
-SvxCharTwoLinesPage::SvxCharTwoLinesPage( Window* pParent, const SfxItemSet& rInSet ) :
-
- SvxCharBasePage( pParent, SVX_RES( RID_SVXPAGE_CHAR_TWOLINES ), rInSet, WIN_TWOLINES_PREVIEW, FT_TWOLINES_FONTTYPE ),
-
- m_aSwitchOnLine ( this, SVX_RES( FL_SWITCHON ) ),
- m_aTwoLinesBtn ( this, SVX_RES( CB_TWOLINES ) ),
-
- m_aEncloseLine ( this, SVX_RES( FL_ENCLOSE ) ),
- m_aStartBracketFT ( this, SVX_RES( FT_STARTBRACKET ) ),
- m_aStartBracketLB ( this, SVX_RES( ED_STARTBRACKET ) ),
- m_aEndBracketFT ( this, SVX_RES( FT_ENDBRACKET ) ),
- m_aEndBracketLB ( this, SVX_RES( ED_ENDBRACKET ) ),
- m_nStartBracketPosition( 0 ),
- m_nEndBracketPosition( 0 )
-{
- FreeResource();
- Initialize();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharTwoLinesPage::Initialize()
-{
- Size aSize = m_aStartBracketLB.GetSizePixel();
- aSize.Height() = m_aStartBracketLB.CalcSize( 1, 6 ).Height();
- m_aStartBracketLB.SetSizePixel( aSize );
- aSize = m_aEndBracketLB.GetSizePixel();
- aSize.Height() = m_aEndBracketLB.CalcSize( 1, 6 ).Height();
- m_aEndBracketLB.SetSizePixel( aSize );
-
- m_aTwoLinesBtn.Check( FALSE );
- TwoLinesHdl_Impl( NULL );
-
- m_aTwoLinesBtn.SetClickHdl( LINK( this, SvxCharTwoLinesPage, TwoLinesHdl_Impl ) );
-
- Link aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl );
- m_aStartBracketLB.SetSelectHdl( aLink );
- m_aEndBracketLB.SetSelectHdl( aLink );
-
- SvxFont& rFont = GetPreviewFont();
- SvxFont& rCJKFont = GetPreviewCJKFont();
- SvxFont& rCTLFont = GetPreviewCTLFont();
- rFont.SetSize( Size( 0, 220 ) );
- rCJKFont.SetSize( Size( 0, 220 ) );
- rCTLFont.SetSize( Size( 0, 220 ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox )
-{
- //CHINA001 SvxCharacterMap aDlg( this );
- bool bStart = pBox == &m_aStartBracketLB;
- //SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- //if(pFact)
- {
- //AbstractSvxCharacterMap* aDlg = pFact->CreateSvxCharacterMap( this, RID_SVXDLG_CHARMAP );
- SvxCharacterMap* aDlg = new SvxCharacterMap( this );
- aDlg->DisableFontSelection();//CHINA001 aDlg.DisableFontSelection();
-
- if ( aDlg->Execute() == RET_OK )//CHINA001 ( aDlg.Execute() == RET_OK )
- {
- sal_Unicode cChar = (sal_Unicode) aDlg->GetChar();//CHINA001 aDlg.GetChar();
- SetBracket( cChar, bStart );
- }
- else
- {
- pBox->SelectEntryPos( bStart ? m_nStartBracketPosition : m_nEndBracketPosition );
- }
- delete aDlg; //add CHINA001
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, BOOL bStart )
-{
- USHORT nEntryPos = 0;
- ListBox* pBox = bStart ? &m_aStartBracketLB : &m_aEndBracketLB;
- if ( 0 == cBracket )
- pBox->SelectEntryPos(0);
- else
- {
- FASTBOOL bFound = FALSE;
- for ( USHORT i = 1; i < pBox->GetEntryCount(); ++i )
- {
- if ( (ULONG)pBox->GetEntryData(i) != CHRDLG_ENCLOSE_SPECIAL_CHAR )
- {
- const sal_Unicode cChar = pBox->GetEntry(i).GetChar(0);
- if ( cChar == cBracket )
- {
- pBox->SelectEntryPos(i);
- nEntryPos = i;
- bFound = TRUE;
- break;
- }
- }
- }
-
- if ( !bFound )
- {
- nEntryPos = pBox->InsertEntry( String( cBracket ) );
- pBox->SelectEntryPos( nEntryPos );
- }
- }
- if( bStart )
- m_nStartBracketPosition = nEntryPos;
- else
- m_nEndBracketPosition = nEntryPos;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharTwoLinesPage, TwoLinesHdl_Impl, CheckBox*, EMPTYARG )
-{
- BOOL bChecked = m_aTwoLinesBtn.IsChecked();
- m_aStartBracketFT.Enable( bChecked );
- m_aStartBracketLB.Enable( bChecked );
- m_aEndBracketFT.Enable( bChecked );
- m_aEndBracketLB.Enable( bChecked );
-
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox*, pBox )
-{
- USHORT nPos = pBox->GetSelectEntryPos();
- if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == (ULONG)pBox->GetEntryData( nPos ) )
- SelectCharacter( pBox );
- else
- {
- bool bStart = pBox == &m_aStartBracketLB;
- if( bStart )
- m_nStartBracketPosition = nPos;
- else
- m_nEndBracketPosition = nPos;
- }
- UpdatePreview_Impl();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharTwoLinesPage::ActivatePage( const SfxItemSet& rSet )
-{
- SvxCharBasePage::ActivatePage( rSet );
-}
-
-// -----------------------------------------------------------------------
-
-int SvxCharTwoLinesPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxCharTwoLinesPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxCharTwoLinesPage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxCharTwoLinesPage::GetRanges()
-{
- return pTwoLinesRanges;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharTwoLinesPage::Reset( const SfxItemSet& rSet )
-{
- m_aTwoLinesBtn.Check( FALSE );
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES );
- SfxItemState eState = rSet.GetItemState( nWhich );
-
- if ( eState >= SFX_ITEM_DONTCARE )
- {
- const SvxTwoLinesItem& rItem = (SvxTwoLinesItem&)rSet.Get( nWhich );
- m_aTwoLinesBtn.Check( rItem.GetValue() );
-
- if ( rItem.GetValue() )
- {
- SetBracket( rItem.GetStartBracket(), TRUE );
- SetBracket( rItem.GetEndBracket(), FALSE );
- }
- }
- TwoLinesHdl_Impl( NULL );
-
- SetPrevFontWidthScale( rSet );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCharTwoLinesPage::FillItemSet( SfxItemSet& rSet )
-{
- const SfxItemSet& rOldSet = GetItemSet();
- BOOL bModified = FALSE, bChanged = TRUE;
- USHORT nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES );
- const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_TWO_LINES );
- sal_Bool bOn = m_aTwoLinesBtn.IsChecked();
- sal_Unicode cStart = ( bOn && m_aStartBracketLB.GetSelectEntryPos() > 0 )
- ? m_aStartBracketLB.GetSelectEntry().GetChar(0) : 0;
- sal_Unicode cEnd = ( bOn && m_aEndBracketLB.GetSelectEntryPos() > 0 )
- ? m_aEndBracketLB.GetSelectEntry().GetChar(0) : 0;
-
- if ( pOld )
- {
- const SvxTwoLinesItem& rItem = *( (const SvxTwoLinesItem*)pOld );
- if ( rItem.GetValue() == bOn &&
- ( !bOn || ( rItem.GetStartBracket() == cStart && rItem.GetEndBracket() == cEnd ) ) )
- bChanged = FALSE;
- }
-
- if ( bChanged )
- {
- rSet.Put( SvxTwoLinesItem( bOn, cStart, cEnd, nWhich ) );
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, FALSE ) )
- CLEARTITEM;
-
- return bModified;
-}
-/* -----------------------------04.12.00 09:48--------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxCharTwoLinesPage::UpdatePreview_Impl()
-{
- sal_Unicode cStart = m_aStartBracketLB.GetSelectEntryPos() > 0
- ? m_aStartBracketLB.GetSelectEntry().GetChar(0) : 0;
- sal_Unicode cEnd = m_aEndBracketLB.GetSelectEntryPos() > 0
- ? m_aEndBracketLB.GetSelectEntry().GetChar(0) : 0;
- m_aPreviewWin.SetBrackets(cStart, cEnd);
- m_aPreviewWin.SetTwoLines(m_aTwoLinesBtn.IsChecked());
- m_aPreviewWin.Invalidate();
-}
-// -----------------------------------------------------------------------
-void SvxCharTwoLinesPage::SetPreviewBackgroundToCharacter()
-{
- m_bPreviewBackgroundToCharacter = TRUE;
-}
-
-// -----------------------------------------------------------------------
-void SvxCharTwoLinesPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- if (pFlagItem)
- {
- UINT32 nFlags=pFlagItem->GetValue();
- if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER )
- SetPreviewBackgroundToCharacter();
- }
-}
diff --git a/svx/source/cui/chardlg.h b/svx/source/cui/chardlg.h
deleted file mode 100644
index 960276cba3..0000000000
--- a/svx/source/cui/chardlg.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: chardlg.h,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_CHARDLG_H
-#define _SVX_CHARDLG_H
-
-// define ----------------------------------------------------------------
-
-#define CHRDLG_UNDERLINE_NONE 0
-#define CHRDLG_UNDERLINE_SINGLE 1
-#define CHRDLG_UNDERLINE_DOUBLE 2
-#define CHRDLG_UNDERLINE_DOTTED 3
-#define CHRDLG_UNDERLINE_DONTKNOW 4
-#define CHRDLG_UNDERLINE_DASH 5
-#define CHRDLG_UNDERLINE_LONGDASH 6
-#define CHRDLG_UNDERLINE_DASHDOT 7
-#define CHRDLG_UNDERLINE_DASHDOTDOT 8
-#define CHRDLG_UNDERLINE_SMALLWAVE 9
-#define CHRDLG_UNDERLINE_WAVE 10
-#define CHRDLG_UNDERLINE_DOUBLEWAVE 11
-#define CHRDLG_UNDERLINE_BOLD 12
-#define CHRDLG_UNDERLINE_BOLDDOTTED 13
-#define CHRDLG_UNDERLINE_BOLDDASH 14
-#define CHRDLG_UNDERLINE_BOLDLONGDASH 15
-#define CHRDLG_UNDERLINE_BOLDDASHDOT 16
-#define CHRDLG_UNDERLINE_BOLDDASHDOTDOT 17
-#define CHRDLG_UNDERLINE_BOLDWAVE 18
-
-#define CHRDLG_STRIKEOUT_NONE 0
-#define CHRDLG_STRIKEOUT_SINGLE 1
-#define CHRDLG_STRIKEOUT_DOUBLE 2
-#define CHRDLG_STRIKEOUT_DONTKNOW 3
-#define CHRDLG_STRIKEOUT_BOLD 4
-#define CHRDLG_STRIKEOUT_SLASH 5
-#define CHRDLG_STRIKEOUT_X 6
-
-#define CHRDLG_ENCLOSE_NONE 0
-#define CHRDLG_ENCLOSE_ROUND 1
-#define CHRDLG_ENCLOSE_SQUARE 2
-#define CHRDLG_ENCLOSE_POINTED 3
-#define CHRDLG_ENCLOSE_CURVED 4
-#define CHRDLG_ENCLOSE_SPECIAL_CHAR 5
-
-#define CHRDLG_POSITION_OVER 0
-#define CHRDLG_POSITION_UNDER 1
-
-#endif
-
diff --git a/svx/source/cui/chardlg.hrc b/svx/source/cui/chardlg.hrc
deleted file mode 100644
index 303d1b7887..0000000000
--- a/svx/source/cui/chardlg.hrc
+++ /dev/null
@@ -1,184 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: chardlg.hrc,v $
- * $Revision: 1.15.212.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_CHARDLG_HRC
-#define _SVX_CHARDLG_HRC
-
-// defines ------------------------------------------------------------------
-
-// NamePage -----------------------------------------------------------------
-
-#define FL_WEST 100
-#define FT_WEST_NAME 101
-#define LB_WEST_NAME 102
-#define FT_WEST_STYLE 103
-#define LB_WEST_STYLE 104
-#define FT_WEST_SIZE 105
-#define LB_WEST_SIZE 106
-#define FT_WEST_LANG 107
-#define LB_WEST_LANG 108
-
-#define FL_EAST 110
-#define FT_EAST_NAME 111
-#define LB_EAST_NAME 112
-#define FT_EAST_STYLE 113
-#define LB_EAST_STYLE 114
-#define FT_EAST_SIZE 115
-#define LB_EAST_SIZE 116
-#define FT_EAST_LANG 117
-#define LB_EAST_LANG 118
-
-#define FL_CTL 120
-#define FT_CTL_NAME 121
-#define LB_CTL_NAME 122
-#define FT_CTL_STYLE 123
-#define LB_CTL_STYLE 124
-#define FT_CTL_SIZE 125
-#define LB_CTL_SIZE 126
-#define FT_CTL_LANG 127
-#define LB_CTL_LANG 128
-
-#define WIN_CHAR_PREVIEW 131
-#define FT_CHAR_FONTTYPE 132
-
-#define FL_COLOR2 140
-#define FT_COLOR2 141
-#define LB_COLOR2 142
-
-#define STR_CHARNAME_NOSTYLE 150
-#define STR_CHARNAME_TRANSPARENT 151
-
-// EffectsPage --------------------------------------------------------------
-
-#define FT_FONTCOLOR 201
-#define LB_FONTCOLOR 202
-
-#define FT_EFFECTS 203
-#define LB_EFFECTS 204
-#define LB_EFFECTS2 205
-
-#define FT_RELIEF 206
-#define LB_RELIEF 207
-
-#define CB_OUTLINE 208
-#define CB_SHADOW 209
-#define CB_BLINKING 210
-#define CB_CHARHIDDEN 211
-
-#define FL_EFFECTS_VERTICAL 220
-
-#define FT_OVERLINE 221
-#define LB_OVERLINE 222
-#define FT_OVERLINE_COLOR 223
-#define LB_OVERLINE_COLOR 224
-
-#define FT_STRIKEOUT 225
-#define LB_STRIKEOUT 226
-
-#define FT_UNDERLINE 227
-#define LB_UNDERLINE 228
-#define FT_UNDERLINE_COLOR 229
-#define LB_UNDERLINE_COLOR 230
-
-#define CB_INDIVIDUALWORDS 231
-
-#define FL_EFFECTS_ASIAN 240
-
-#define FT_EMPHASIS 241
-#define LB_EMPHASIS 242
-#define FT_POSITION 243
-#define LB_POSITION 244
-
-#define WIN_EFFECTS_PREVIEW 251
-#define FT_EFFECTS_FONTTYPE 252
-
-#define STR_EFFECTS_TRANSPARENT 260
-#define STR_EFFECTS_CAPITALS 261
-#define STR_EFFECTS_LOWERCASE 262
-#define STR_EFFECTS_TITLE 263
-#define STR_EFFECTS_SMALL 264
-#define STR_EFFECTS_OUTLINE 265
-#define STR_EFFECTS_SHADOW 266
-#define STR_EFFECTS_BLINKING 267
-
-// PositionPage -------------------------------------------------------------
-
-#define FL_POSITION 300
-#define RB_HIGHPOS 301
-#define RB_NORMALPOS 302
-#define RB_LOWPOS 303
-#define FT_HIGHLOW 304
-#define ED_HIGHLOW 305
-#define CB_HIGHLOW 306
-#define FT_FONTSIZE 307
-#define ED_FONTSIZE 308
-#define FL_ROTATION_SCALING 309
-#define FL_SCALING 310
-#define RB_0_DEG 311
-#define RB_90_DEG 312
-#define RB_270_DEG 313
-#define CB_FIT_TO_LINE 314
-#define FT_SCALE_WIDTH 315
-#define MF_SCALE_WIDTH 316
-
-#define FL_KERNING2 320
-#define LB_KERNING2 321
-#define FT_KERNING2 322
-#define ED_KERNING2 323
-#define CB_PAIRKERNING 324
-
-#define WIN_POS_PREVIEW 331
-#define FT_POS_FONTTYPE 332
-
-// TwoLinesPage -------------------------------------------------------------
-
-#define FL_SWITCHON 400
-#define CB_TWOLINES 401
-
-#define FL_ENCLOSE 410
-#define FT_STARTBRACKET 411
-#define ED_STARTBRACKET 412
-#define FT_ENDBRACKET 413
-#define ED_ENDBRACKET 414
-
-#define FL_TWOLINES_PREVIEW 420
-#define WIN_TWOLINES_PREVIEW 421
-#define FT_TWOLINES_FONTTYPE 422
-
-#define FT_WEST_NAME_NOCJK 423
-#define LB_WEST_NAME_NOCJK 424
-#define FT_WEST_STYLE_NOCJK 425
-#define LB_WEST_STYLE_NOCJK 426
-#define FT_WEST_SIZE_NOCJK 427
-#define LB_WEST_SIZE_NOCJK 428
-#define FT_WEST_LANG_NOCJK 429
-#define LB_WEST_LANG_NOCJK 430
-
-#endif
-
diff --git a/svx/source/cui/chardlg.hxx b/svx/source/cui/chardlg.hxx
deleted file mode 100644
index e89ac291e7..0000000000
--- a/svx/source/cui/chardlg.hxx
+++ /dev/null
@@ -1,400 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: chardlg.hxx,v $
- * $Revision: 1.8.184.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_CHARDLG_HXX
-#define _SVX_CHARDLG_HXX
-
-// include ---------------------------------------------------------------
-
-#include <svtools/ctrlbox.hxx>
-#include <svtools/stdctrl.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/fntctrl.hxx>
-#include <svx/checklbx.hxx>
-#include <svx/langbox.hxx>
-
-// forward ---------------------------------------------------------------
-
-class SvxFontListItem;
-class FontList;
-
-// -----------------------------------------------------------------------
-
-#define DISABLE_CASEMAP ((USHORT)0x0001)
-#define DISABLE_WORDLINE ((USHORT)0x0002)
-#define DISABLE_BLINK ((USHORT)0x0004)
-#define DISABLE_UNDERLINE_COLOR ((USHORT)0x0008)
-
-#define DISABLE_LANGUAGE ((USHORT)0x0010)
-#define DISABLE_HIDE_LANGUAGE ((USHORT)0x0020)
-
-// class SvxCharBasePage -------------------------------------------------
-
-class SvxCharBasePage : public SfxTabPage
-{
-protected:
- SvxFontPrevWindow m_aPreviewWin;
- FixedInfo m_aFontTypeFT;
-
- BOOL m_bPreviewBackgroundToCharacter;
-
- SvxCharBasePage( Window* pParent, const ResId& rResIdTabPage, const SfxItemSet&,
- USHORT nResIdPrewievWin, USHORT nResIdFontTypeFT );
- virtual ~SvxCharBasePage();
-
- void SetPrevFontSize( const SfxItemSet& rSet, USHORT nSlot, SvxFont& rFont );
- void SetPrevFont( const SfxItemSet& rSet, USHORT nSlot, SvxFont& rFont );
- void SetPrevFontStyle( const SfxItemSet& rSet, USHORT nSlotPosture, USHORT nSlotWeight, SvxFont& rFont ); // posture/weight
- void SetPrevFontWidthScale( const SfxItemSet& rSet );
-
- void SetPrevFontEscapement( BYTE nProp, BYTE nEscProp, short nEsc );
-
- inline SvxFont& GetPreviewFont();
- inline SvxFont& GetPreviewCJKFont();
- inline SvxFont& GetPreviewCTLFont();
-
-public:
- using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
-
- virtual void ActivatePage( const SfxItemSet& rSet );
-// virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-};
-
-// class SvxCharNamePage -------------------------------------------------
-
-struct SvxCharNamePage_Impl;
-
-class SvxCharNamePage : public SvxCharBasePage
-{
-
-private:
- FixedLine* m_pWestLine;
- FixedText* m_pWestFontNameFT;
- FontNameBox* m_pWestFontNameLB;
- FixedText* m_pWestFontStyleFT;
- FontStyleBox* m_pWestFontStyleLB;
- FixedText* m_pWestFontSizeFT;
- FontSizeBox* m_pWestFontSizeLB;
- FixedText* m_pWestFontLanguageFT;
- SvxLanguageBox* m_pWestFontLanguageLB;
-
- FixedLine* m_pEastLine;
- FixedText* m_pEastFontNameFT;
- FontNameBox* m_pEastFontNameLB;
- FixedText* m_pEastFontStyleFT;
- FontStyleBox* m_pEastFontStyleLB;
- FixedText* m_pEastFontSizeFT;
- FontSizeBox* m_pEastFontSizeLB;
- FixedText* m_pEastFontLanguageFT;
- SvxLanguageBox* m_pEastFontLanguageLB;
-
- FixedLine* m_pCTLLine;
- FixedText* m_pCTLFontNameFT;
- FontNameBox* m_pCTLFontNameLB;
- FixedText* m_pCTLFontStyleFT;
- FontStyleBox* m_pCTLFontStyleLB;
- FixedText* m_pCTLFontSizeFT;
- FontSizeBox* m_pCTLFontSizeLB;
- FixedText* m_pCTLFontLanguageFT;
- SvxLanguageBox* m_pCTLFontLanguageLB;
-
- FixedLine* m_pColorFL;
- FixedText* m_pColorFT;
- ColorListBox* m_pColorLB;
-
- SvxCharNamePage_Impl* m_pImpl;
-
- SvxCharNamePage( Window* pParent, const SfxItemSet& rSet );
-
- void Initialize();
- const FontList* GetFontList() const;
- void UpdatePreview_Impl();
- void FillStyleBox_Impl( const FontNameBox* rBox );
- void FillSizeBox_Impl( const FontNameBox* rBox );
-
- enum LanguageGroup
- {
- /** Language for western text.
- */
- Western = 0,
-
- /** Language for asian text.
- */
- Asian,
-
- /** Language for ctl text.
- */
- Ctl
- };
-
- void Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp );
- BOOL FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp );
- void ResetColor_Impl( const SfxItemSet& rSet );
- BOOL FillItemSetColor_Impl( SfxItemSet& rSet );
-
- DECL_LINK( UpdateHdl_Impl, Timer* );
- DECL_LINK( FontModifyHdl_Impl, void* );
- DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
-
-public:
- using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- ~SvxCharNamePage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual void Reset( const SfxItemSet& rSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
-
- void SetFontList( const SvxFontListItem& rItem );
- void EnableRelativeMode();
- void EnableSearchMode();
- // the writer uses SID_ATTR_BRUSH as font background
- void SetPreviewBackgroundToCharacter();
-
- void DisableControls( USHORT nDisable );
- virtual void PageCreated (SfxAllItemSet aSet);
-};
-
-// class SvxCharEffectsPage ----------------------------------------------
-
-class SvxCharEffectsPage : public SvxCharBasePage
-{
-
-private:
- FixedText m_aFontColorFT;
- ColorListBox m_aFontColorLB;
-
- FixedText m_aEffectsFT;
- SvxCheckListBox m_aEffectsLB;
-
- ListBox m_aEffects2LB;
-
- FixedText m_aReliefFT;
- ListBox m_aReliefLB;
-
- TriStateBox m_aOutlineBtn;
- TriStateBox m_aShadowBtn;
- TriStateBox m_aBlinkingBtn;
- TriStateBox m_aHiddenBtn;
-
- FixedLine m_aVerticalLine;
-
- FixedText m_aOverlineFT;
- ListBox m_aOverlineLB;
- FixedText m_aOverlineColorFT;
- ColorListBox m_aOverlineColorLB;
-
- FixedText m_aStrikeoutFT;
- ListBox m_aStrikeoutLB;
-
- FixedText m_aUnderlineFT;
- ListBox m_aUnderlineLB;
- FixedText m_aUnderlineColorFT;
- ColorListBox m_aUnderlineColorLB;
-
- CheckBox m_aIndividualWordsBtn;
-
- FixedLine m_aAsianLine;
-
- FixedText m_aEmphasisFT;
- ListBox m_aEmphasisLB;
-
- FixedText m_aPositionFT;
- ListBox m_aPositionLB;
-
- USHORT m_nHtmlMode;
-
- String m_aTransparentColorName;
-
- SvxCharEffectsPage( Window* pParent, const SfxItemSet& rSet );
-
- void Initialize();
- void UpdatePreview_Impl();
- void SetCaseMap_Impl( SvxCaseMap eCaseMap );
- void ResetColor_Impl( const SfxItemSet& rSet );
- BOOL FillItemSetColor_Impl( SfxItemSet& rSet );
-
- DECL_LINK( SelectHdl_Impl, ListBox* );
- DECL_LINK( CbClickHdl_Impl, CheckBox* );
- DECL_LINK( TristClickHdl_Impl, TriStateBox* );
- DECL_LINK( UpdatePreview_Impl, ListBox* );
- DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
-
-public:
-// using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
-
-// virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual void Reset( const SfxItemSet& rSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
-
- void DisableControls( USHORT nDisable );
- void EnableFlash();
- // the writer uses SID_ATTR_BRUSH as font background
- void SetPreviewBackgroundToCharacter();
- virtual void PageCreated (SfxAllItemSet aSet);
-};
-
-// class SvxCharPositionPage ---------------------------------------------
-
-class SvxCharPositionPage : public SvxCharBasePage
-{
-
-private:
- FixedLine m_aPositionLine;
- RadioButton m_aHighPosBtn;
- RadioButton m_aNormalPosBtn;
- RadioButton m_aLowPosBtn;
- FixedText m_aHighLowFT;
- MetricField m_aHighLowEdit;
- CheckBox m_aHighLowRB;
- FixedText m_aFontSizeFT;
- MetricField m_aFontSizeEdit;
- FixedLine m_aRotationScalingFL;
- FixedLine m_aScalingFL;
- RadioButton m_a0degRB;
- RadioButton m_a90degRB;
- RadioButton m_a270degRB;
- CheckBox m_aFitToLineCB;
- FixedText m_aScaleWidthFT;
- MetricField m_aScaleWidthMF;
-
- FixedLine m_aKerningLine;
- ListBox m_aKerningLB;
- FixedText m_aKerningFT;
- MetricField m_aKerningEdit;
- CheckBox m_aPairKerningBtn;
-
- short m_nSuperEsc;
- short m_nSubEsc;
-
- UINT16 m_nScaleWidthItemSetVal;
- UINT16 m_nScaleWidthInitialVal;
-
- BYTE m_nSuperProp;
- BYTE m_nSubProp;
-
- SvxCharPositionPage( Window* pParent, const SfxItemSet& rSet );
-
- void Initialize();
- void UpdatePreview_Impl( BYTE nProp, BYTE nEscProp, short nEsc );
- void SetEscapement_Impl( USHORT nEsc );
-
- DECL_LINK( PositionHdl_Impl, RadioButton* );
- DECL_LINK( RotationHdl_Impl, RadioButton* );
- DECL_LINK( FontModifyHdl_Impl, MetricField* );
- DECL_LINK( AutoPositionHdl_Impl, CheckBox* );
- DECL_LINK( FitToLineHdl_Impl, CheckBox* );
- DECL_LINK( KerningSelectHdl_Impl, ListBox* );
- DECL_LINK( KerningModifyHdl_Impl, MetricField* );
- DECL_LINK( PairKerningHdl_Impl, CheckBox* );
- DECL_LINK( LoseFocusHdl_Impl, MetricField* );
- DECL_LINK( ScaleWidthModifyHdl_Impl, MetricField* );
-
-public:
- using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
-
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
- virtual void ActivatePage( const SfxItemSet& rSet );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual void Reset( const SfxItemSet& rSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void FillUserData();
- // the writer uses SID_ATTR_BRUSH as font background
- void SetPreviewBackgroundToCharacter();
- virtual void PageCreated (SfxAllItemSet aSet);
-};
-
-// class SvxCharTwoLinesPage ---------------------------------------------
-
-class SvxCharTwoLinesPage : public SvxCharBasePage
-{
-private:
- FixedLine m_aSwitchOnLine;
- CheckBox m_aTwoLinesBtn;
-
- FixedLine m_aEncloseLine;
- FixedText m_aStartBracketFT;
- ListBox m_aStartBracketLB;
- FixedText m_aEndBracketFT;
- ListBox m_aEndBracketLB;
-
- USHORT m_nStartBracketPosition;
- USHORT m_nEndBracketPosition;
-
- SvxCharTwoLinesPage( Window* pParent, const SfxItemSet& rSet );
-
- void UpdatePreview_Impl();
- void Initialize();
- void SelectCharacter( ListBox* pBox );
- void SetBracket( sal_Unicode cBracket, BOOL bStart );
-
- DECL_LINK( TwoLinesHdl_Impl, CheckBox* );
- DECL_LINK( CharacterMapHdl_Impl, ListBox* );
-
-public:
- using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual void Reset( const SfxItemSet& rSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- // the writer uses SID_ATTR_BRUSH as font background
- void SetPreviewBackgroundToCharacter();
- virtual void PageCreated (SfxAllItemSet aSet);
-};
-
-#endif // #ifndef _SVX_CHARDLG_HXX
-
diff --git a/svx/source/cui/chardlg.src b/svx/source/cui/chardlg.src
deleted file mode 100644
index 19ad1e0904..0000000000
--- a/svx/source/cui/chardlg.src
+++ /dev/null
@@ -1,1133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: chardlg.src,v $
- * $Revision: 1.78.20.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "chardlg.hrc"
-#include "chardlg.h"
-
-// unbekannte Zeichenfarbe
-String RID_SVXSTR_COLOR_USER
-{
- Text [ en-US ] = "User" ;
-};
-
-// RID_SVXPAGE_CHAR_NAME ----------------------------------------------------
-
-TabPage RID_SVXPAGE_CHAR_NAME
-{
- HelpId = HID_SVXPAGE_CHAR_NAME ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine FL_WEST
- {
- Pos = MAP_APPFONT ( 6 , 3 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Western text font";
- };
- FixedText FT_WEST_NAME
- {
- Pos = MAP_APPFONT ( 12 , 14 );
- Size = MAP_APPFONT ( 80 , 8 );
- Text [ en-US ] = "Font";
- };
- FixedText FT_WEST_NAME_NOCJK
- {
- Pos = MAP_APPFONT ( 12 , 6 );
- Size = MAP_APPFONT ( 112 , 8 );
- Text [ en-US ] = "~Font";
- };
- ComboBox LB_WEST_NAME
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 25 );
- Size = MAP_APPFONT ( 80 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- ComboBox LB_WEST_NAME_NOCJK
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 17 );
- Size = MAP_APPFONT ( 112 , 71 );
- TabStop = TRUE;
- DropDown = FALSE;
- };
- FixedText FT_WEST_STYLE
- {
- Pos = MAP_APPFONT ( 96 , 14 );
- Size = MAP_APPFONT ( 40 , 8 );
- Text [ en-US ] = "~Typeface";
- };
- FixedText FT_WEST_STYLE_NOCJK
- {
- Pos = MAP_APPFONT ( 130 , 6 );
- Size = MAP_APPFONT ( 72 , 8 );
- Text [ en-US ] = "~Typeface";
- };
- ComboBox LB_WEST_STYLE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 96 , 25 );
- Size = MAP_APPFONT ( 40 , 48 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- "Normal" ;
- "Italic" ;
- "Bold" ;
- "Bold italic" ;
- };
- };
- ComboBox LB_WEST_STYLE_NOCJK
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 130 , 17 );
- Size = MAP_APPFONT ( 72 , 71 );
- TabStop = TRUE;
- DropDown = FALSE;
- StringList [ en-US ] =
- {
- "Normal" ;
- "Italic" ;
- "Bold" ;
- "Bold italic" ;
- };
- };
- FixedText FT_WEST_SIZE
- {
- Pos = MAP_APPFONT ( 140 , 14 );
- Size = MAP_APPFONT ( 38 , 8 );
- Text [ en-US ] = "Size";
- };
- FixedText FT_WEST_SIZE_NOCJK
- {
- Pos = MAP_APPFONT ( 208 , 6 );
- Size = MAP_APPFONT ( 40 , 8 );
- Text [ en-US ] = "Size";
- };
- MetricBox LB_WEST_SIZE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 140 , 25 );
- Size = MAP_APPFONT ( 38 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- MetricBox LB_WEST_SIZE_NOCJK
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 208 , 17 );
- Size = MAP_APPFONT ( 40 , 71 );
- TabStop = TRUE;
- DropDown = FALSE;
- };
- FixedText FT_WEST_LANG
- {
- Pos = MAP_APPFONT ( 182 , 14 );
- Size = MAP_APPFONT ( 66 , 8 );
- Text [ en-US ] = "Language";
- };
- FixedText FT_WEST_LANG_NOCJK
- {
- Pos = MAP_APPFONT ( 130 , 94 );
- Size = MAP_APPFONT ( 72 , 8 );
- Text [ en-US ] = "~Language";
- };
- ListBox LB_WEST_LANG
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 182 , 25 );
- Size = MAP_APPFONT ( 66 , 72 );
- TabStop = TRUE;
- Sort = TRUE ;
- DropDown = TRUE;
- };
- ListBox LB_WEST_LANG_NOCJK
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 130 , 105 );
- Size = MAP_APPFONT ( 72 , 72 );
- TabStop = TRUE;
- Sort = TRUE ;
- DropDown = TRUE;
- };
- FixedLine FL_EAST
- {
- Pos = MAP_APPFONT ( 6 , 43 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Asian text font";
- };
- FixedText FT_EAST_NAME
- {
- Pos = MAP_APPFONT ( 12 , 54 );
- Size = MAP_APPFONT ( 80 , 8 );
- Text [ en-US ] = "Font";
- };
- ComboBox LB_EAST_NAME
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 65 );
- Size = MAP_APPFONT ( 80 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_EAST_STYLE
- {
- Pos = MAP_APPFONT ( 96 , 54 );
- Size = MAP_APPFONT ( 40 , 8 );
- Text [ en-US ] = "T~ypeface";
- };
- ComboBox LB_EAST_STYLE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 96 , 65 );
- Size = MAP_APPFONT ( 40 , 48 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- "Normal" ;
- "Italic" ;
- "Bold" ;
- "Bold italic" ;
- };
- };
- FixedText FT_EAST_SIZE
- {
- Pos = MAP_APPFONT ( 140 , 54 );
- Size = MAP_APPFONT ( 38 , 8 );
- Text [ en-US ] = "Size";
- };
- MetricBox LB_EAST_SIZE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 140 , 65 );
- Size = MAP_APPFONT ( 38 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_EAST_LANG
- {
- Pos = MAP_APPFONT ( 182 , 54 );
- Size = MAP_APPFONT ( 66 , 8 );
- Text [ en-US ] = "Language";
- };
- ListBox LB_EAST_LANG
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 182 , 65 );
- Size = MAP_APPFONT ( 66 , 72 );
- TabStop = TRUE;
- Sort = TRUE ;
- DropDown = TRUE;
- };
- FixedLine FL_CTL
- {
- Pos = MAP_APPFONT ( 6 , 83 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "CTL font";
- };
- FixedText FT_CTL_NAME
- {
- Pos = MAP_APPFONT ( 12 , 94 );
- Size = MAP_APPFONT ( 80 , 8 );
- Text [ en-US ] = "Font";
- };
- ComboBox LB_CTL_NAME
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 105 );
- Size = MAP_APPFONT ( 80 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_CTL_STYLE
- {
- Pos = MAP_APPFONT ( 96 , 94 );
- Size = MAP_APPFONT ( 40 , 8 );
- Text [ en-US ] = "Ty~peface";
- };
- ComboBox LB_CTL_STYLE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 96 , 105 );
- Size = MAP_APPFONT ( 40 , 48 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- "Normal" ;
- "Italic" ;
- "Bold" ;
- "Bold italic" ;
- };
- };
- FixedText FT_CTL_SIZE
- {
- Pos = MAP_APPFONT ( 140 , 94 );
- Size = MAP_APPFONT ( 38 , 8 );
- Text [ en-US ] = "Size";
- };
- MetricBox LB_CTL_SIZE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 140 , 105 );
- Size = MAP_APPFONT ( 38 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_CTL_LANG
- {
- Pos = MAP_APPFONT ( 182 , 94 );
- Size = MAP_APPFONT ( 66 , 8 );
- Text [ en-US ] = "Language";
- };
- ListBox LB_CTL_LANG
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 182 , 105 );
- Size = MAP_APPFONT ( 66 , 72 );
- TabStop = TRUE;
- Sort = TRUE ;
- DropDown = TRUE;
- };
- Window WIN_CHAR_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 149 ) ;
- Size = MAP_APPFONT ( 248 , 37 ) ;
- Text [ en-US ] = "Example";
- };
- FixedText FT_CHAR_FONTTYPE
- {
- Pos = MAP_APPFONT ( 6 , 129 ) ;
- Size = MAP_APPFONT ( 248 , 16 ) ;
- WordBreak = TRUE ;
- };
- FixedLine FL_COLOR2
- {
- Pos = MAP_APPFONT ( 6 , 83 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Color" ;
- };
- FixedText FT_COLOR2
- {
- Pos = MAP_APPFONT ( 12 , 94 );
- Size = MAP_APPFONT ( 58 , 8 );
- Text [ en-US ] = "Font ~color" ;
- };
- ListBox LB_COLOR2
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 105 );
- Size = MAP_APPFONT ( 58 , 100 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- String STR_CHARNAME_NOSTYLE
- {
- Text [ en-US ] = "No %1";
- };
- String STR_CHARNAME_TRANSPARENT
- {
- Text [ en-US ] = "Transparent";
- };
-};
-
-// RID_SVXPAGE_CHAR_EFFECTS ---------------------------------------------------
-
-TabPage RID_SVXPAGE_CHAR_EFFECTS
-{
- HelpId = HID_SVXPAGE_CHAR_EFFECTS ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedText FT_FONTCOLOR
- {
- Pos = MAP_APPFONT ( 10 , 4 );
- Size = MAP_APPFONT ( 82 , 8 );
- Text [ en-US ] = "Font ~color" ;
- };
- ListBox LB_FONTCOLOR
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 10 , 15 );
- Size = MAP_APPFONT ( 82 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_EFFECTS
- {
- Pos = MAP_APPFONT( 10 , 33 );
- Size = MAP_APPFONT( 82 , 8 );
- Text [ en-US ] = "~Effects" ;
- };
- ListBox LB_EFFECTS2
- {
- Pos = MAP_APPFONT ( 10 , 44 ) ;
- Size = MAP_APPFONT ( 82 , 56 ) ;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "(Without)" ; Default ; > ;
- < "Capitals" ; Default ; > ;
- < "Lowercase" ; Default ; > ;
- < "Title" ; Default ; > ;
- < "Small capitals" ; Default ; > ;
- };
- };
- FixedText FT_RELIEF
- {
- Pos = MAP_APPFONT ( 10 , 62 );
- Size = MAP_APPFONT ( 82 , 8 );
- Text [ en-US ] = "~Relief";
- };
- ListBox LB_RELIEF
- {
- Pos = MAP_APPFONT ( 10 , 73 ) ;
- Size = MAP_APPFONT ( 82 , 56 ) ;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "(Without)" ; Default ; > ;
- < "Embossed" ; Default ; > ;
- < "Engraved" ; Default ; > ;
- };
- };
- TriStateBox CB_OUTLINE
- {
- Pos = MAP_APPFONT ( 10 , 93 ) ;
- Size = MAP_APPFONT ( 82 , 10 ) ;
- Text [ en-US ] = "Out~line" ;
- };
- TriStateBox CB_SHADOW
- {
- Pos = MAP_APPFONT ( 10 , 107 ) ;
- Size = MAP_APPFONT ( 82 , 10 ) ;
- Text [ en-US ] = "Sha~dow" ;
- };
- TriStateBox CB_BLINKING
- {
- Pos = MAP_APPFONT ( 10 , 121 ) ;
- Size = MAP_APPFONT ( 82 , 10 ) ;
- Hide = TRUE;
- Text [ en-US ] = "~Blinking" ;
- };
- TriStateBox CB_CHARHIDDEN
- {
- Pos = MAP_APPFONT ( 10 , 135 ) ;
- Size = MAP_APPFONT ( 82 , 10 ) ;
- Text [ en-US ] = "H~idden" ;
- };
- FixedLine FL_EFFECTS_VERTICAL
- {
- Pos = MAP_APPFONT ( 100 , 4 ) ;
- Size = MAP_APPFONT ( 4 , 142 ) ;
- Vert = TRUE;
- };
- FixedText FT_OVERLINE
- {
- Pos = MAP_APPFONT( 110 , 4 );
- Size = MAP_APPFONT( 68 , 8 );
- Text [ en-US ] = "~Overlining" ;
- };
- ListBox LB_OVERLINE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 110 , 15 );
- Size = MAP_APPFONT ( 68 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "(Without)" ; CHRDLG_UNDERLINE_NONE ; > ;
- < "Single" ; CHRDLG_UNDERLINE_SINGLE ; > ;
- < "Double" ; CHRDLG_UNDERLINE_DOUBLE ; > ;
- < "Bold"; CHRDLG_UNDERLINE_BOLD; > ;
- < "Dotted" ; CHRDLG_UNDERLINE_DOTTED ; > ;
- < "Dotted (Bold)" ; CHRDLG_UNDERLINE_BOLDDOTTED; > ;
- < "Dash"; CHRDLG_UNDERLINE_DASH; > ;
- < "Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASH; > ;
- < "Long Dash"; CHRDLG_UNDERLINE_LONGDASH; > ;
- < "Long Dash (Bold)"; CHRDLG_UNDERLINE_BOLDLONGDASH; > ;
- < "Dot Dash"; CHRDLG_UNDERLINE_DASHDOT; > ;
- < "Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOT; > ;
- < "Dot Dot Dash"; CHRDLG_UNDERLINE_DASHDOTDOT; > ;
- < "Dot Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOTDOT; > ;
- < "Wave"; CHRDLG_UNDERLINE_WAVE; > ;
- < "Wave (Bold)"; CHRDLG_UNDERLINE_BOLDWAVE; > ;
- < "Double Wave"; CHRDLG_UNDERLINE_DOUBLEWAVE; > ;
- };
- };
- FixedText FT_OVERLINE_COLOR
- {
- Pos = MAP_APPFONT ( 184 , 4 );
- Size = MAP_APPFONT ( 68 , 8 );
- Text [ en-US ] = "O~verline color";
- };
- ListBox LB_OVERLINE_COLOR
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 184 , 15 );
- Size = MAP_APPFONT ( 68 , 100 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- FixedText FT_STRIKEOUT
- {
- Pos = MAP_APPFONT ( 110 , 33 );
- Size = MAP_APPFONT ( 68 , 8 );
- Text [ en-US ] = "~Strikethrough" ;
- };
- ListBox LB_STRIKEOUT
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 110 , 44 );
- Size = MAP_APPFONT ( 68 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "(Without)" ; CHRDLG_STRIKEOUT_NONE ; > ;
- < "Single" ; CHRDLG_STRIKEOUT_SINGLE ; > ;
- < "Double" ; CHRDLG_STRIKEOUT_DOUBLE ; > ;
- < "Bold" ; CHRDLG_STRIKEOUT_BOLD ; > ;
- < "With /" ; CHRDLG_STRIKEOUT_SLASH ; > ;
- < "With X" ; CHRDLG_STRIKEOUT_X ; > ;
- };
- };
- FixedText FT_UNDERLINE
- {
- Pos = MAP_APPFONT( 110 , 62 );
- Size = MAP_APPFONT( 68 , 8 );
- Text [ en-US ] = "~Underlining" ;
- };
- ListBox LB_UNDERLINE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 110 , 73 );
- Size = MAP_APPFONT ( 68 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "(Without)" ; CHRDLG_UNDERLINE_NONE ; > ;
- < "Single" ; CHRDLG_UNDERLINE_SINGLE ; > ;
- < "Double" ; CHRDLG_UNDERLINE_DOUBLE ; > ;
- < "Bold"; CHRDLG_UNDERLINE_BOLD; > ;
- < "Dotted" ; CHRDLG_UNDERLINE_DOTTED ; > ;
- < "Dotted (Bold)" ; CHRDLG_UNDERLINE_BOLDDOTTED; > ;
- < "Dash"; CHRDLG_UNDERLINE_DASH; > ;
- < "Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASH; > ;
- < "Long Dash"; CHRDLG_UNDERLINE_LONGDASH; > ;
- < "Long Dash (Bold)"; CHRDLG_UNDERLINE_BOLDLONGDASH; > ;
- < "Dot Dash"; CHRDLG_UNDERLINE_DASHDOT; > ;
- < "Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOT; > ;
- < "Dot Dot Dash"; CHRDLG_UNDERLINE_DASHDOTDOT; > ;
- < "Dot Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOTDOT; > ;
- < "Wave"; CHRDLG_UNDERLINE_WAVE; > ;
- < "Wave (Bold)"; CHRDLG_UNDERLINE_BOLDWAVE; > ;
- < "Double Wave"; CHRDLG_UNDERLINE_DOUBLEWAVE; > ;
- };
- };
- FixedText FT_UNDERLINE_COLOR
- {
- Pos = MAP_APPFONT ( 184 , 62 );
- Size = MAP_APPFONT ( 68 , 8 );
- Text [ en-US ] = "U~nderline color";
- };
- ListBox LB_UNDERLINE_COLOR
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 184 , 73 );
- Size = MAP_APPFONT ( 68 , 100 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- CheckBox CB_INDIVIDUALWORDS
- {
- Pos = MAP_APPFONT ( 110 , 93 );
- Size = MAP_APPFONT ( 68 , 10 );
- TabStop = TRUE;
- Text [ en-US ] = "Individual ~words" ;
- };
- FixedLine FL_EFFECTS_ASIAN
- {
- Pos = MAP_APPFONT ( 106 , 110 ) ;
- Size = MAP_APPFONT ( 148 , 4 ) ;
- };
- FixedText FT_EMPHASIS
- {
- Pos = MAP_APPFONT ( 110 , 117 );
- Size = MAP_APPFONT ( 68 , 8 );
- Text [ en-US ] = "Emp~hasis mark" ;
- };
- ListBox LB_EMPHASIS
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 110 , 128 );
- Size = MAP_APPFONT ( 68 , 72 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "(Without)" ; default ; > ;
- < "Dot" ; default ; > ;
- < "Circle" ; default ; > ;
- < "Disc" ; default ; > ;
- < "Accent" ; default ; > ;
- };
- };
- FixedText FT_POSITION
- {
- Pos = MAP_APPFONT ( 184 , 117 );
- Size = MAP_APPFONT ( 68 , 8 );
- Text [ en-US ] = "~Position" ;
- };
- ListBox LB_POSITION
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 184 , 128 );
- Size = MAP_APPFONT ( 68 , 48 );
- TabStop = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "Above text" ; CHRDLG_POSITION_OVER ; > ;
- < "Below text" ; CHRDLG_POSITION_UNDER ; > ;
- };
- };
- Window WIN_EFFECTS_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 149 ) ;
- Size = MAP_APPFONT ( 248 , 37 ) ;
- Text [ en-US ] = "Example";
- };
- FixedText FT_EFFECTS_FONTTYPE
- {
- Pos = MAP_APPFONT ( 6 , 168 ) ;
- Size = MAP_APPFONT ( 248 , 16 ) ;
- WordBreak = TRUE ;
- Hide = TRUE;
- };
- String STR_EFFECTS_CAPITALS
- {
- Text [ en-US ] = "Capitals" ;
- };
- String STR_EFFECTS_LOWERCASE
- {
- Text [ en-US ] = "Lowercase" ;
- };
- String STR_EFFECTS_TITLE
- {
- Text [ en-US ] = "Title" ;
- };
- String STR_EFFECTS_SMALL
- {
- Text [ en-US ] = "Small Capitals" ;
- };
- String STR_EFFECTS_OUTLINE
- {
- Text [ en-US ] = "Outline" ;
- };
- String STR_EFFECTS_SHADOW
- {
- Text [ en-US ] = "Shadow" ;
- };
- String STR_EFFECTS_BLINKING
- {
- Text [ en-US ] = "Blinking" ;
- };
- String STR_CHARNAME_TRANSPARENT
- {
- Text [ en-US ] = "Transparent";
- };
-};
-
-// RID_SVXPAGE_CHAR_POSITION ------------------------------------------------
-
-TabPage RID_SVXPAGE_CHAR_POSITION
-{
- HelpId = HID_SVXPAGE_CHAR_POSITION ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 6 , 3 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Position" ;
- };
- RadioButton RB_HIGHPOS
- {
- Pos = MAP_APPFONT ( 12 , 16 );
- Size = MAP_APPFONT ( 58 , 10 );
- Text [ en-US ] = "Superscript" ;
- TabStop = TRUE;
- };
- RadioButton RB_NORMALPOS
- {
- Pos = MAP_APPFONT ( 12 , 30 );
- Size = MAP_APPFONT ( 58 , 10 );
- Text [ en-US ] = "Normal" ;
- TabStop = TRUE;
- };
- RadioButton RB_LOWPOS
- {
- Pos = MAP_APPFONT ( 12 , 44 );
- Size = MAP_APPFONT ( 58 , 10 );
- Text [ en-US ] = "Subscript" ;
- TabStop = TRUE;
- };
- FixedText FT_HIGHLOW
- {
- Pos = MAP_APPFONT ( 74 , 16 );
- Size = MAP_APPFONT ( 58 , 8 );
- Text [ en-US ] = "~Raise/lower by" ;
- };
- MetricField ED_HIGHLOW
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 136 , 14 );
- Size = MAP_APPFONT ( 30 , 12 );
- TabStop = TRUE;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- First = 1 ;
- Last = 100 ;
- SpinSize = 1 ;
- };
- CheckBox CB_HIGHLOW
- {
- Pos = MAP_APPFONT ( 172 , 16 );
- Size = MAP_APPFONT ( 76 , 10 );
- Text [ en-US ] = "A~utomatic" ;
- TabStop = TRUE;
- };
- FixedText FT_FONTSIZE
- {
- Pos = MAP_APPFONT ( 74 , 32 );
- Size = MAP_APPFONT ( 58 , 8 );
- Text [ en-US ] = "Relative font size" ;
- };
- MetricField ED_FONTSIZE
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 136 , 30 );
- Size = MAP_APPFONT ( 30 , 12 );
- TabStop = TRUE;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- First = 1 ;
- Last = 100 ;
- SpinSize = 1 ;
- };
- FixedLine FL_ROTATION_SCALING
- {
- Pos = MAP_APPFONT ( 6 , 59 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Rotation / scaling" ;
- };
- FixedLine FL_SCALING
- {
- Pos = MAP_APPFONT ( 6 , 59 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Scaling" ;
- };
- RadioButton RB_0_DEG
- {
- Pos = MAP_APPFONT ( 12 , 70 );
- Size = MAP_APPFONT ( 46 , 10 );
- TabStop = TRUE;
- Text [ en-US ] = "~0 degrees" ;
- };
- RadioButton RB_90_DEG
- {
- Pos = MAP_APPFONT ( 62 , 70 );
- Size = MAP_APPFONT ( 46 , 10 );
- TabStop = TRUE;
- Text [ en-US ] = "~90 degrees" ;
- };
- RadioButton RB_270_DEG
- {
- Pos = MAP_APPFONT ( 112 , 70 );
- Size = MAP_APPFONT ( 46 , 10 );
- TabStop = TRUE;
- Text [ en-US ] = "~270 degrees" ;
- };
- CheckBox CB_FIT_TO_LINE
- {
- Pos = MAP_APPFONT ( 162 , 70 );
- Size = MAP_APPFONT ( 86 , 10 );
- TabStop = TRUE;
- Text [ en-US ] = "Fit to line" ;
- };
- FixedText FT_SCALE_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 86 );
- Size = MAP_APPFONT ( 80 , 8 );
- Text [ en-US ] = "Scale ~width" ;
- };
- MetricField MF_SCALE_WIDTH
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 94 , 84 );
- Size = MAP_APPFONT ( 30 , 12 );
- TabStop = TRUE;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 999 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- First = 50 ;
- Last = 200 ;
- SpinSize = 1 ;
- };
- FixedLine FL_KERNING2
- {
- Pos = MAP_APPFONT ( 6 , 100 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Spacing" ;
- };
- ListBox LB_KERNING2
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 111 );
- Size = MAP_APPFONT ( 72 , 48 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Default" ; Default ; > ;
- < "Expanded" ; Default ; > ;
- < "Condensed" ; Default ; > ;
- };
- };
- FixedText FT_KERNING2
- {
- Pos = MAP_APPFONT ( 86 , 113 );
- Size = MAP_APPFONT ( 24 , 8 );
- Center = TRUE ;
- Text [ en-US ] = "b~y" ;
- };
- MetricField ED_KERNING2
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 112 , 111 );
- Size = MAP_APPFONT ( 40 , 12 );
- TabStop = TRUE;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 9999 ;
- DecimalDigits = 1 ;
- Unit = FUNIT_POINT ;
- SpinSize = 10 ;
- };
- CheckBox CB_PAIRKERNING
- {
- Pos = MAP_APPFONT ( 156 , 113 );
- Size = MAP_APPFONT ( 92 , 10 );
- Text [ en-US ] = "~Pair kerning" ;
- TabStop = TRUE;
- };
- Window WIN_POS_PREVIEW
- {
- Text [ en-US ] = "Example" ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 149 ) ;
- Size = MAP_APPFONT ( 248 , 37 ) ;
- };
- FixedText FT_POS_FONTTYPE
- {
- Pos = MAP_APPFONT ( 6 , 168 ) ;
- Size = MAP_APPFONT ( 248 , 16 ) ;
- WordBreak = TRUE ;
- Hide = TRUE;
- };
-};
-
-TabPage RID_SVXPAGE_CHAR_TWOLINES
-{
- HelpId = HID_SVXPAGE_CHAR_TWOLINES ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine FL_SWITCHON
- {
- Pos = MAP_APPFONT ( 6 , 3 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Double-lined" ;
- };
- CheckBox CB_TWOLINES
- {
- Pos = MAP_APPFONT ( 12 , 14 );
- Size = MAP_APPFONT ( 236 , 10 );
- Text [ en-US ] = "~Write in double lines" ;
- TabStop = TRUE;
- };
- FixedLine FL_ENCLOSE
- {
- Pos = MAP_APPFONT ( 6 , 30 );
- Size = MAP_APPFONT ( 248 , 8 );
- Text [ en-US ] = "Enclosing character" ;
- };
- FixedText FT_STARTBRACKET
- {
- Pos = MAP_APPFONT ( 12 , 41 );
- Size = MAP_APPFONT ( 90 , 8 );
- Text [ en-US ] = "I~nitial character" ;
- };
- ListBox ED_STARTBRACKET
- {
- Pos = MAP_APPFONT ( 12 , 52 );
- Size = MAP_APPFONT ( 90 , 72 );
- TabStop = TRUE;
- Border = TRUE;
- StringList [ en-US ] =
- {
- < "(None)" ; CHRDLG_ENCLOSE_NONE ; > ;
- < "(" ; CHRDLG_ENCLOSE_ROUND ; > ;
- < "[" ; CHRDLG_ENCLOSE_SQUARE ; > ;
- < "<" ; CHRDLG_ENCLOSE_POINTED ; > ;
- < "{" ; CHRDLG_ENCLOSE_CURVED ; > ;
- < "Other Characters..." ; CHRDLG_ENCLOSE_SPECIAL_CHAR ; > ;
- };
- };
- FixedText FT_ENDBRACKET
- {
- Pos = MAP_APPFONT ( 108 , 41 );
- Size = MAP_APPFONT ( 90 , 8 );
- Text [ en-US ] = "Final charact~er" ;
- };
- ListBox ED_ENDBRACKET
- {
- Pos = MAP_APPFONT ( 108 , 52 );
- Size = MAP_APPFONT ( 90 , 72 );
- TabStop = TRUE;
- Border = TRUE;
- StringList [ en-US ] =
- {
- < "(None)" ; CHRDLG_ENCLOSE_NONE ; > ;
- < ")" ; CHRDLG_ENCLOSE_ROUND ; > ;
- < "]" ; CHRDLG_ENCLOSE_SQUARE ; > ;
- < ">" ; CHRDLG_ENCLOSE_POINTED ; > ;
- < "}" ; CHRDLG_ENCLOSE_CURVED ; > ;
- < "Other Characters..." ; CHRDLG_ENCLOSE_SPECIAL_CHAR ; > ;
- };
- };
- Window WIN_TWOLINES_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 149 ) ;
- Size = MAP_APPFONT ( 248 , 37 ) ;
- Text [ en-US ] = "Example" ;
- };
- FixedText FT_TWOLINES_FONTTYPE
- {
- Pos = MAP_APPFONT ( 6 , 168 ) ;
- Size = MAP_APPFONT ( 248 , 16 ) ;
- WordBreak = TRUE ;
- Hide = TRUE;
- };
-};
-
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/charmap.hrc b/svx/source/cui/charmap.hrc
deleted file mode 100644
index 5f018a9b51..0000000000
--- a/svx/source/cui/charmap.hrc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: charmap.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_CHARMAP_HRC
-#define _SVX_CHARMAP_HRC
-
-// defines ------------------------------------------------------------------
-
-#define CT_SHOWSET 10
-#define FT_FONT 11
-#define LB_FONT 12
-#define CT_SHOWTEXT 13
-#define FT_SYMBOLE 14
-#define CT_SHOWCHAR 15
-#define FT_CHARCODE 16
-#define BTN_CHAR_OK 17
-#define BTN_CHAR_CANCEL 18
-#define BTN_CHAR_HELP 19
-#define BTN_DELETE 20
-#define FT_SUBSET 30
-#define LB_SUBSET 31
-#define ED_SHORTCUT 32
-#define BT_ASSIGN 33
-#define FT_ASSIGN 34
-#define CT_ASSIGN 35
-
-#endif
-
diff --git a/svx/source/cui/charmap.src b/svx/source/cui/charmap.src
deleted file mode 100644
index 5fdecf8a0e..0000000000
--- a/svx/source/cui/charmap.src
+++ /dev/null
@@ -1,161 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: charmap.src,v $
- * $Revision: 1.57 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include ---------------------------------------------------------------
-#include <svx/svxids.hrc>
-#include <svx/dialogs.hrc>
-#include "charmap.hrc"
-#include "helpid.hrc"
-
- // RID_SVXDLG_CHARMAP ----------------------------------------------------
-ModalDialog RID_SVXDLG_CHARMAP
-{
- HelpId = SID_CHARMAP ;
- SvLook = TRUE ;
- Text [ en-US ] = "Special Characters";
-/* Size = MAP_APPFONT ( 297 , 169 ) ; */
- Size = MAP_APPFONT ( 297 , 153 ) ;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Control CT_SHOWSET
- {
- HelpId = HID_CHARMAP_CTL_SHOWSET ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 24 ) ;
- Size = MAP_APPFONT ( 230 , 112 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- };
- FixedText FT_FONT
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 33 , 8 ) ;
- Text [ en-US ] = "~Font" ;
- Left = TRUE ;
- Group = TRUE ;
- };
- ListBox LB_FONT
- {
- Pos = MAP_APPFONT ( 42 , 6 ) ;
- Size = MAP_APPFONT ( 70 , 58 ) ;
- Sort = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_SUBSET
- {
- Pos = MAP_APPFONT ( 118 , 8 ) ;
- Size = MAP_APPFONT ( 42 , 8 ) ;
- Text [ en-US ] = "~Subset";
- };
- ListBox LB_SUBSET
- {
- Pos = MAP_APPFONT ( 161 , 6 ) ;
- Size = MAP_APPFONT ( 63 , 68 ) ;
- Sort = FALSE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_SYMBOLE
- {
- Pos = MAP_APPFONT ( 6 , 140 ) ;
- Size = MAP_APPFONT ( 38 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Characters:";
- };
- Control CT_SHOWTEXT
- {
- HelpId = HID_CHARMAP_CTL_SHOWTEXT ;
- Pos = MAP_APPFONT ( 46 , 137 ) ;
-/* Size = MAP_APPFONT ( 190 , 16 ) ; */
- Size = MAP_APPFONT ( 244 , 16 ) ;
- Group = TRUE ;
- };
- Control CT_SHOWCHAR
- {
- HelpId = HID_CHARMAP_CTL_SHOWCHAR ;
- Pos = MAP_APPFONT ( 241 , 79 ) ;
- Size = MAP_APPFONT ( 50 , 44 ) ;
- Group = TRUE ;
- };
- FixedText FT_CHARCODE
- {
- Pos = MAP_APPFONT ( 241 , 126 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Center = TRUE ;
- };
- OKButton BTN_CHAR_OK
- {
- Pos = MAP_APPFONT ( 242 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CHAR_CANCEL
- {
- Pos = MAP_APPFONT ( 242 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_CHAR_HELP
- {
- Pos = MAP_APPFONT ( 242 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 242 , 63 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete";
- };
-/*
- PushButton BT_ASSIGN
- {
- Pos = MAP_APPFONT ( 242 , 140 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Assign shortcut...";
- };
- FixedText FT_ASSIGN
- {
- Pos = MAP_APPFONT ( 6 , 156 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Shortcut key: ";
- };
- Control CT_ASSIGN
- {
- Pos = MAP_APPFONT ( 60 , 156 ) ;
- Size = MAP_APPFONT ( 160 , 8 ) ;
- };
-*/
-};
-
-// ********************************************************************** EOF
diff --git a/svx/source/cui/commonlingui.cxx b/svx/source/cui/commonlingui.cxx
deleted file mode 100644
index d8108f93db..0000000000
--- a/svx/source/cui/commonlingui.cxx
+++ /dev/null
@@ -1,294 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: commonlingui.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include "commonlingui.hxx"
-
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include <svx/dialmgr.hxx>
-#include <vcl/decoview.hxx>
-
-#include "hangulhanjadlg.hrc"
-
-//=============================================================================
-// SvxClickInfoCtr
-//=============================================================================
-
-//-----------------------------------------------------------------------------
-SvxClickInfoCtr::SvxClickInfoCtr( Window* pParent, const ResId& rResId ) :
- Control( pParent, rResId ),
- aFixedInfo( this)
-{
- aFixedInfo.SetSizePixel(GetOutputSizePixel());
- aFixedInfo.Show();
-}
-
-//-----------------------------------------------------------------------------
-void SvxClickInfoCtr::MouseButtonDown( const MouseEvent& )
-{
- aActivateLink.Call(this);
-}
-
-//-----------------------------------------------------------------------------
-long SvxClickInfoCtr::PreNotify( NotifyEvent& rNEvt )
-{
- if(rNEvt.GetType()==EVENT_GETFOCUS || rNEvt.GetType()==EVENT_MOUSEBUTTONDOWN)
- {
- aActivateLink.Call(this);
- }
-
- return Control::PreNotify(rNEvt);
-}
-
-//-----------------------------------------------------------------------------
-void SvxClickInfoCtr::SetText( const XubString& rStr )
-{
- aFixedInfo.SetText(rStr );
-}
-
-//-----------------------------------------------------------------------------
-XubString SvxClickInfoCtr::GetText() const
-{
- return aFixedInfo.GetText();
-}
-
-//-----------------------------------------------------------------------------
-__EXPORT SvxClickInfoCtr::~SvxClickInfoCtr()
-{
-}
-
-//=============================================================================
-// SvxCommonLinguisticControl
-//=============================================================================
-//-----------------------------------------------------------------------------
-SvxCommonLinguisticControl::SvxCommonLinguisticControl( ModalDialog* _pParent )
- :Window( _pParent, SVX_RES( RID_SVX_WND_COMMON_LINGU ) )
- ,aWordText ( this, SVX_RES( FT_WORD ) )
- ,aAktWord ( this, SVX_RES( FT_AKTWORD ) )
- ,aNewWord ( this, SVX_RES( FT_NEWWORD ) )
- ,aNewWordED ( this, SVX_RES( ED_NEWWORD ) )
- ,aSuggestionFT ( this, SVX_RES( FT_SUGGESTION ) )
- ,aIgnoreBtn ( this, SVX_RES( BTN_IGNORE ) )
- ,aIgnoreAllBtn ( this, SVX_RES( BTN_IGNOREALL ) )
- ,aChangeBtn ( this, SVX_RES( BTN_CHANGE ) )
- ,aChangeAllBtn ( this, SVX_RES( BTN_CHANGEALL ) )
- ,aOptionsBtn ( this, SVX_RES( BTN_OPTIONS ) )
- ,aStatusText ( this, SVX_RES( FT_STATUS ) )
- ,aHelpBtn ( this, SVX_RES( BTN_SPL_HELP ) )
- ,aCancelBtn ( this, SVX_RES( BTN_SPL_CANCEL ) )
- ,aAuditBox ( this, SVX_RES( GB_AUDIT ) )
-{
- FreeResource();
-
-#ifdef FS_PRIV_DEBUG
- SetType( WINDOW_TABPAGE );
-#endif
-
- SetPosSizePixel( Point( 0, 0 ), _pParent->GetOutputSizePixel() );
- Show();
-}
-
-// -----------------------------------------------------------------------
-PushButton* SvxCommonLinguisticControl::implGetButton( ButtonType _eType ) const
-{
- const PushButton* pButton = NULL;
- switch ( _eType )
- {
- case eClose: pButton = &aCancelBtn; break;
- case eIgnore: pButton = &aIgnoreBtn; break;
- case eIgnoreAll: pButton = &aIgnoreAllBtn; break;
- case eChange: pButton = &aChangeBtn; break;
- case eChangeAll: pButton = &aChangeAllBtn; break;
- case eOptions: pButton = &aOptionsBtn; break;
- }
- return const_cast< PushButton* >( pButton );
-}
-
-// -----------------------------------------------------------------------
-void SvxCommonLinguisticControl::SetButtonHandler( ButtonType _eType, const Link& _rHandler )
-{
- Button* pButton = GetButton( _eType );
- if ( pButton )
- pButton->SetClickHdl( _rHandler );
-}
-
-// -----------------------------------------------------------------------
-void SvxCommonLinguisticControl::EnableButton( ButtonType _eType, sal_Bool _bEnable )
-{
- Button* pButton = GetButton( _eType );
- if ( pButton )
- pButton->Enable( _bEnable );
-}
-
-// -----------------------------------------------------------------------
-void SvxCommonLinguisticControl::InsertControlGroup( Window& _rFirstGroupWindow, Window& _rLastGroupWindow, ControlGroup _eInsertAfter )
-{
- Window* pInsertAfter = NULL; // will be the last window of our own "undividable" group, after which we insert the foreign group
- switch ( _eInsertAfter )
- {
- case eLeftRightWords : pInsertAfter = &aNewWordED; break;
- case eSuggestionLabel : pInsertAfter = &aSuggestionFT; break;
- case eActionButtons : pInsertAfter = &aChangeAllBtn; break;
- case eDialogButtons : pInsertAfter = &aCancelBtn; break;
- }
-
- // now loop through the remaining windows of the foreign group
- Window* pInsertBehind = pInsertAfter;
- Window* pInsert = &_rFirstGroupWindow;
-
- // some strange thing below: asking a window for WINDOW_NEXT or WINDOW_PREV does not take into
- // account the border window, _but_ SetZOrder _does_!. Thus, when advancing through a chain
- // of windows, we need to work with the border windows (WINDOW_BORDER), instead of simply
- // asking for WINDOW_NEXT.
-
- Window* pLoopEnd = _rLastGroupWindow.GetWindow( WINDOW_BORDER );
- while ( pInsert && ( pInsertBehind != pLoopEnd ) )
- {
- // we'll destroy the NEXT relation immediately, so remember the next window
- DBG_ASSERT( pInsert->GetWindow( WINDOW_BORDER ), "SvxCommonLinguisticControl::InsertControlGroup: border window is expected to be non NULL!" );
- Window* pNextInsert = pInsert->GetWindow( WINDOW_BORDER )->GetWindow( WINDOW_NEXT );
- // knit
- pInsert->SetZOrder( pInsertBehind, WINDOW_ZORDER_BEHIND );
- // advance
- pInsertBehind = pInsert;
- pInsert = pNextInsert;
- }
- DBG_ASSERT( pInsertBehind == pLoopEnd, "SvxCommonLinguisticControl::InsertControlGroup: controls do not form a group!" );
- // if we did not reach pLoopEnd, then we did not reach _rLastGroupWindow in the loop, then
- // (FirstWindow, LastWindow) was no valid control group
-}
-
-// -----------------------------------------------------------------------
-String SvxCommonLinguisticControl::GetNewEditWord()
-{
- return aNewWordED.GetText();
-}
-
-// -----------------------------------------------------------------------
-void SvxCommonLinguisticControl::SetNewEditWord( const String& _rNew )
-{
- aNewWordED.SetText( _rNew );
-}
-
-//-----------------------------------------------------------------------------
-void SvxCommonLinguisticControl::UpdateIgnoreHelp( )
-{
-
- String aInfoStr( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
- aInfoStr.Append( GetCurrentText() );
-
- String aString = GetNonMnemonicString( aIgnoreAllBtn.GetText() );
- aString.Append( aInfoStr );
- aIgnoreAllBtn.SetQuickHelpText( aString );
-
- aString = GetNonMnemonicString( aIgnoreBtn.GetText() );
- aString.Append( aInfoStr );
- aIgnoreBtn.SetQuickHelpText( aString );
-}
-
-//-----------------------------------------------------------------------------
-void SvxCommonLinguisticControl::UpdateChangesHelp( const String& _rNewText )
-{
- String aInfoStr( RTL_CONSTASCII_USTRINGPARAM( ": " ) );
- aInfoStr.Append( GetCurrentText() );
- aInfoStr.Append( String( RTL_CONSTASCII_USTRINGPARAM( " -> " ) ) );
- aInfoStr.Append( _rNewText );
- // TODO: shouldn't this be part of the resources, for proper localization?
-
- String aString = GetNonMnemonicString( aChangeAllBtn.GetText() );
- aString.Append( aInfoStr );
- aChangeAllBtn.SetQuickHelpText( aString );
-
- aString = GetNonMnemonicString( aChangeBtn.GetText() );
- aString.Append( aInfoStr );
- aChangeBtn.SetQuickHelpText( aString );
-}
-
-//-----------------------------------------------------------------------------
-void SvxCommonLinguisticControl::Paint( const Rectangle& rRect )
-{
- Window::Paint(rRect );
-
- DecorationView aDecoView( this );
-
- Rectangle aRect( aAuditBox.GetPosPixel(), aAuditBox.GetSizePixel() );
- aDecoView.DrawButton( aRect, BUTTON_DRAW_NOFILL );
-}
-
-//-----------------------------------------------------------------------------
-void SvxCommonLinguisticControl::Enlarge( sal_Int32 _nX, sal_Int32 _nY )
-{
- Size aSize;
- Point aPos;
-
- // the controls which need to be resized
- {
- Window* pResize[] =
- {
- this, &aAuditBox, &aStatusText
- };
- for ( sal_uInt32 i = 0; i < sizeof( pResize ) / sizeof( pResize[0] ); ++i )
- {
- aSize = pResize[i]->GetSizePixel( );
- pResize[i]->SetSizePixel( Size( aSize.Width() + _nX, aSize.Height() + _nY ) );
- }
- }
-
- // the controls which stick to the bottom of the window
- {
- Window* pMoveDown[] =
- {
- &aStatusText, &aHelpBtn, &aCancelBtn
- };
- for ( sal_uInt32 i = 0; i < sizeof( pMoveDown ) / sizeof( pMoveDown[0] ); ++i )
- {
- aPos = pMoveDown[i]->GetPosPixel();
- aPos.Y() += _nY;
- pMoveDown[i]->SetPosPixel( aPos );
- }
- }
-
- // the controls which stick to the right
- {
- Window* pMoveRight[] =
- {
- &aIgnoreBtn, &aIgnoreAllBtn, &aChangeBtn, &aChangeAllBtn, &aOptionsBtn, &aHelpBtn, &aCancelBtn
- };
- for ( sal_uInt32 i = 0; i < sizeof( pMoveRight ) / sizeof( pMoveRight[0] ); ++i )
- {
- aPos = pMoveRight[i]->GetPosPixel();
- aPos.X() += _nX;
- pMoveRight[i]->SetPosPixel( aPos );
- }
- }
-}
diff --git a/svx/source/cui/commonlingui.hxx b/svx/source/cui/commonlingui.hxx
deleted file mode 100644
index a6b8142789..0000000000
--- a/svx/source/cui/commonlingui.hxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: commonlingui.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SVX_COMMON_LINGUI_HXX
-#define SVX_COMMON_LINGUI_HXX
-
-#include <vcl/ctrl.hxx>
-#include <svtools/stdctrl.hxx>
-#include <vcl/edit.hxx>
-#include <svx/svxbox.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/group.hxx>
-#include <vcl/dialog.hxx>
-
-//=============================================================================
-// SvxClickInfoCtr
-//=============================================================================
-
-class SvxClickInfoCtr: public Control
-{
-private:
- FixedInfo aFixedInfo;
- Link aActivateLink;
-
-public:
- SvxClickInfoCtr( Window* pParent, const ResId& rResId );
- ~SvxClickInfoCtr();
-
- virtual void SetText( const XubString& rStr );
- virtual XubString GetText() const;
-
- void SetActivateHdl( const Link& rLink ) { aActivateLink = rLink; }
- const Link& GetActivateHdl() const { return aActivateLink; }
-
-protected:
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual long PreNotify( NotifyEvent& rNEvt );
-
-};
-
-//=============================================================================
-// SvxCommonLinguisticControl
-//=============================================================================
-class SvxCommonLinguisticControl : public Window
-{
-public:
- enum ButtonType
- {
- eClose,
- eIgnore,
- eIgnoreAll,
- eChange,
- eChangeAll,
- eOptions
- };
-
-protected:
- FixedText aWordText;
- SvxClickInfoCtr aAktWord;
-
- FixedText aNewWord;
- Edit aNewWordED;
-
- FixedText aSuggestionFT;
-
- PushButton aIgnoreBtn;
- PushButton aIgnoreAllBtn;
- PushButton aChangeBtn;
- PushButton aChangeAllBtn;
- PushButton aOptionsBtn;
-
- FixedInfo aStatusText;
- HelpButton aHelpBtn;
- CancelButton aCancelBtn;
-
- GroupBox aAuditBox;
-
-protected:
- virtual void Paint( const Rectangle& rRect );
-
-private:
- PushButton* implGetButton( ButtonType _eType ) const;
-
-public:
- SvxCommonLinguisticControl( ModalDialog* _pParent );
-
- // handlers
- inline void SetResetWordHdl( const Link& _rLink ) { aAktWord.SetActivateHdl( _rLink ); }
- inline const Link& GetResetWordHdl() const { return aAktWord.GetActivateHdl(); }
-
- void SetButtonHandler( ButtonType _eType, const Link& _rHandler );
- void EnableButton( ButtonType _eType, sal_Bool _bEnable );
-
- inline PushButton* GetButton( ButtonType _eType ) { return implGetButton( _eType ); }
- inline const PushButton* GetButton( ButtonType _eType ) const { return implGetButton( _eType ); }
-
- // users of this class may want to insert own controls in some places, where the ordinary
- // Z-Order determined by construction time is not sufficient
- // Use the following methods for this
- enum ControlGroup // control groups in this window which cannot be devided (e.g. are adjacent in the Z order)
- {
- eLeftRightWords, // the controls for the two words (original and suggestion), including the labels
- eSuggestionLabel, // the label for the suggestion
- eActionButtons, // the group of "ignore(all)" / "change(all)" buttons
- eDialogButtons // the group of dialog control buttons (help and close)
- };
- void InsertControlGroup( Window& _rFirstGroupWindow, Window& _rLastGroupWindow, ControlGroup _eInsertAfter );
-
- /** enlarges the window
-
- Some controls "stick" to the borders: The group of change/ignore buttons, for instance, sticks
- to the right, the dictionary list as well as the close/help buttons stick to the bottom of the
- window.
- */
- void Enlarge( sal_Int32 _nX, sal_Int32 _nY );
-
- // control access methods
- inline void SetCurrentText( const String& _rText ) { aAktWord.SetText( _rText ); }
- inline String GetCurrentText( ) const { return aAktWord.GetText(); }
-
- inline void SetStatusText( const String& _rText ) { aStatusText.SetText( _rText ); }
- inline String GetStatusText( ) const { return aStatusText.GetText(); }
-
- inline Edit& GetWordInputControl() { return aNewWordED; }
- inline const Edit& GetWordInputControl() const { return aNewWordED; }
-
- // returns the location (upper-left corner) of the group of action buttons
- inline Point GetActionButtonsLocation( ) const { return aIgnoreBtn.GetPosPixel(); }
-
- // updates the help texts for the "change" and "change all" buttons according to the currently
- // entered texts
- void UpdateChangesHelp( const String& _rNewText );
- inline void UpdateChangesHelp( ) { UpdateChangesHelp( GetWordInputControl().GetText() ); }
-
- // updates the help texts for the "ignore" and "always ignore" buttons according to the currently
- // entered texts
- void UpdateIgnoreHelp( );
-
- String GetNewEditWord();
- void SetNewEditWord( const String& _rNew );
-};
-
-
-
-#endif // SVX_COMMON_LINGUI_HXX
diff --git a/svx/source/cui/commonlingui.src b/svx/source/cui/commonlingui.src
deleted file mode 100644
index f3d3c05c1a..0000000000
--- a/svx/source/cui/commonlingui.src
+++ /dev/null
@@ -1,156 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: commonlingui.src,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "hangulhanjadlg.hrc"
-
-Window RID_SVX_WND_COMMON_LINGU
-{
- DialogControl = TRUE; // we want to tab out of this
- Hide = TRUE;
-
- FixedText FT_WORD
- {
- Pos = MAP_APPFONT( 6, 9 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "Origi~nal";
- };
- Control FT_AKTWORD
- {
- HelpId=HID_SPELLDLG_SETWORD;
- Pos = MAP_APPFONT( 51, 9 );
- Size = MAP_APPFONT( 164, 10 );
- Border =FALSE;
- TabStop = TRUE;
- };
-
- FixedText FT_NEWWORD
- {
- Pos = MAP_APPFONT( 6, 25 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "~Word" ;
- };
-
- Edit ED_NEWWORD
- {
- Pos = MAP_APPFONT( 51, 24 );
- Size = MAP_APPFONT( 137, 12 );
- Border = TRUE;
- };
-
- FixedText FT_SUGGESTION
- {
- Pos = MAP_APPFONT( 6, 48 );
- Size = MAP_APPFONT( 42, 10 );
- Text [ en-US ] = "~Suggestions" ;
- };
-
- PushButton BTN_IGNORE
- {
- Pos = MAP_APPFONT( 224, 6 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "~Ignore" ;
- };
-
- PushButton BTN_IGNOREALL
- {
- Pos = MAP_APPFONT( 224, 22 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "Always I~gnore" ;
- };
-
- PushButton BTN_CHANGE
- {
- Pos = MAP_APPFONT( 224, 40 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "~Replace" ;
- DefButton = TRUE ;
- };
-
- PushButton BTN_CHANGEALL
- {
- Pos = MAP_APPFONT( 224, 56 );
- Size = MAP_APPFONT( 55, 14 );
- Text [ en-US ] = "Always R~eplace" ;
- };
-
- PushButton BTN_OPTIONS
- {
- Pos = MAP_APPFONT( 224, 129 );
- Size = MAP_APPFONT( 55, 14 );
- Hide = TRUE ;
- Text [ en-US ] = "Options..." ;
- };
-
- FixedText FT_STATUS
- {
- Pos = MAP_APPFONT( 6, 155 );
- Size = MAP_APPFONT( 130, 10 );
- };
-
- GroupBox GB_AUDIT
- {
- Pos = MAP_APPFONT( 1, 1 );
- Size = MAP_APPFONT( 283, 148 );
- Hide=TRUE;
- };
-
- HelpButton BTN_SPL_HELP
- {
- Pos = MAP_APPFONT( 160, 153 );
- Size = MAP_APPFONT( 55, 14 );
- };
-
- CancelButton BTN_SPL_CANCEL
- {
- Pos = MAP_APPFONT ( 224 , 153 ) ;
- Size = MAP_APPFONT ( 55 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Close" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/connect.cxx b/svx/source/cui/connect.cxx
deleted file mode 100644
index 486bb02403..0000000000
--- a/svx/source/cui/connect.cxx
+++ /dev/null
@@ -1,569 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connect.cxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <tools/shl.hxx>
-#include "ofaitem.hxx" // add CHINA001
-#include <sfx2/request.hxx> // add CHINA001
-#define _SVX_CONNECT_CXX
-
-#include <svx/svdoedge.hxx>
-#include <svx/svdattr.hxx>
-#include <svx/svdattrx.hxx>
-#include <svx/svdview.hxx>
-
-#include "connctrl.hxx"
-#include "connect.hxx"
-#include "connect.hrc"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-
-#include <svx/dialogs.hrc>
-
-static USHORT pRanges[] =
-{
- SDRATTR_EDGE_FIRST,
- SDRATTR_EDGE_LAST,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern von Konnektoren (Connectors)
-|*
-\************************************************************************/
-
-SvxConnectionDialog::SvxConnectionDialog( Window* pParent, const SfxItemSet& rInAttrs,
- const SdrView* pSdrView ) :
- SfxSingleTabDialog( pParent, rInAttrs, RID_SVXPAGE_CONNECTION )
-{
- SvxConnectionPage* _pPage = new SvxConnectionPage( this, rInAttrs );
-
- _pPage->SetView( pSdrView );
- _pPage->Construct();
-
- SetTabPage( _pPage );
- SetText( _pPage->GetText() );
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxConnectionDialog::~SvxConnectionDialog()
-{
-}
-
-/*************************************************************************
-|*
-|* Seite zum Aendern von Konnektoren (Connectors)
-|*
-\************************************************************************/
-
-SvxConnectionPage::SvxConnectionPage( Window* pWindow, const SfxItemSet& rInAttrs ) :
- SfxTabPage ( pWindow, SVX_RES( RID_SVXPAGE_CONNECTION ),
- rInAttrs ),
-
- aFtType ( this, SVX_RES( FT_TYPE ) ),
- aLbType ( this, SVX_RES( LB_TYPE ) ),
-
- aFlDelta ( this, SVX_RES( FL_DELTA ) ),
- aFtLine1 ( this, SVX_RES( FT_LINE_1 ) ),
- aMtrFldLine1 ( this, SVX_RES( MTR_FLD_LINE_1 ) ),
- aFtLine2 ( this, SVX_RES( FT_LINE_2 ) ),
- aMtrFldLine2 ( this, SVX_RES( MTR_FLD_LINE_2 ) ),
- aFtLine3 ( this, SVX_RES( FT_LINE_3 ) ),
- aMtrFldLine3 ( this, SVX_RES( MTR_FLD_LINE_3 ) ),
-
- aFlDistance ( this, SVX_RES( FL_DISTANCE ) ),
- aFtHorz1 ( this, SVX_RES( FT_HORZ_1 ) ),
- aMtrFldHorz1 ( this, SVX_RES( MTR_FLD_HORZ_1 ) ),
- aFtVert1 ( this, SVX_RES( FT_VERT_1 ) ),
- aMtrFldVert1 ( this, SVX_RES( MTR_FLD_VERT_1 ) ),
- aFtHorz2 ( this, SVX_RES( FT_HORZ_2 ) ),
- aMtrFldHorz2 ( this, SVX_RES( MTR_FLD_HORZ_2 ) ),
- aFtVert2 ( this, SVX_RES( FT_VERT_2 ) ),
- aMtrFldVert2 ( this, SVX_RES( MTR_FLD_VERT_2 ) ),
-
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ), rInAttrs ),
- rOutAttrs ( rInAttrs ),
- aAttrSet ( *rInAttrs.GetPool() )
-{
- FreeResource();
-
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- eUnit = pPool->GetMetric( SDRATTR_EDGENODE1HORZDIST );
-
- FillTypeLB();
-
- const FieldUnit eFUnit = GetModuleFieldUnit( &rInAttrs );
- SetFieldUnit( aMtrFldHorz1, eFUnit );
- SetFieldUnit( aMtrFldHorz2, eFUnit );
- SetFieldUnit( aMtrFldVert1, eFUnit );
- SetFieldUnit( aMtrFldVert2, eFUnit );
- SetFieldUnit( aMtrFldLine1, eFUnit );
- SetFieldUnit( aMtrFldLine2, eFUnit );
- SetFieldUnit( aMtrFldLine3, eFUnit );
- if( eFUnit == FUNIT_MM )
- {
- aMtrFldHorz1.SetSpinSize( 50 );
- aMtrFldHorz2.SetSpinSize( 50 );
- aMtrFldVert1.SetSpinSize( 50 );
- aMtrFldVert2.SetSpinSize( 50 );
- aMtrFldLine1.SetSpinSize( 50 );
- aMtrFldLine2.SetSpinSize( 50 );
- aMtrFldLine3.SetSpinSize( 50 );
- }
-
- // disable 3D border
- aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO);
-
- Link aLink( LINK( this, SvxConnectionPage, ChangeAttrHdl_Impl ) );
- aMtrFldHorz1.SetModifyHdl( aLink );
- aMtrFldVert1.SetModifyHdl( aLink );
- aMtrFldHorz2.SetModifyHdl( aLink );
- aMtrFldVert2.SetModifyHdl( aLink );
- aMtrFldLine1.SetModifyHdl( aLink );
- aMtrFldLine2.SetModifyHdl( aLink );
- aMtrFldLine3.SetModifyHdl( aLink );
- aLbType.SetSelectHdl( aLink );
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxConnectionPage::~SvxConnectionPage()
-{
-}
-
-/*************************************************************************
-|*
-|* Liest uebergebenen Item-Set
-|*
-\************************************************************************/
-
-void __EXPORT SvxConnectionPage::Reset( const SfxItemSet& rAttrs )
-{
- const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_EDGENODE1HORZDIST );
- const SfxItemPool* pPool = rAttrs.GetPool();
-
- // SdrEdgeNode1HorzDistItem
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1HORZDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeNode1HorzDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldHorz1, nValue, eUnit );
- }
- else
- aMtrFldHorz1.SetEmptyFieldValue();
-
- aMtrFldHorz1.SaveValue();
-
- // SdrEdgeNode2HorzDistItem
- pItem = GetItem( rAttrs, SDRATTR_EDGENODE2HORZDIST );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2HORZDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeNode2HorzDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldHorz2, nValue, eUnit );
- }
- else
- aMtrFldHorz2.SetEmptyFieldValue();
-
- aMtrFldHorz2.SaveValue();
-
- // SdrEdgeNode1VertDistItem
- pItem = GetItem( rAttrs, SDRATTR_EDGENODE1VERTDIST );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1VERTDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeNode1VertDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldVert1, nValue, eUnit );
- }
- else
- aMtrFldVert1.SetEmptyFieldValue();
-
- aMtrFldVert1.SaveValue();
-
- // SdrEdgeNode2VertDistItem
- pItem = GetItem( rAttrs, SDRATTR_EDGENODE2VERTDIST );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2VERTDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeNode2VertDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldVert2, nValue, eUnit );
- }
- else
- aMtrFldVert2.SetEmptyFieldValue();
-
- aMtrFldVert2.SaveValue();
-
- // SdrEdgeLine1DeltaItem
- pItem = GetItem( rAttrs, SDRATTR_EDGELINE1DELTA );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE1DELTA );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeLine1DeltaItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldLine1, nValue, eUnit );
- }
- else
- aMtrFldLine1.SetEmptyFieldValue();
-
- aMtrFldLine1.SaveValue();
-
- // SdrEdgeLine2DeltaItem
- pItem = GetItem( rAttrs, SDRATTR_EDGELINE2DELTA );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE2DELTA );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeLine2DeltaItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldLine2, nValue, eUnit );
- }
- else
- aMtrFldLine2.SetEmptyFieldValue();
-
- aMtrFldLine2.SaveValue();
-
- // SdrEdgeLine3DeltaItem
- pItem = GetItem( rAttrs, SDRATTR_EDGELINE3DELTA );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE3DELTA );
- if( pItem )
- {
- long nValue = ( ( const SdrEdgeLine3DeltaItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldLine3, nValue, eUnit );
- }
- else
- aMtrFldLine3.SetEmptyFieldValue();
-
- aMtrFldLine3.SaveValue();
-
- // SdrEdgeLineDeltaAnzItem
- pItem = GetItem( rAttrs, SDRATTR_EDGELINEDELTAANZ );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINEDELTAANZ );
- if( pItem )
- {
- UINT16 nValue = ( ( const SdrEdgeLineDeltaAnzItem* )pItem )->GetValue();
- if( nValue <= 2 )
- {
- aFtLine3.Enable( FALSE );
- aMtrFldLine3.Enable( FALSE );
- aMtrFldLine3.SetEmptyFieldValue();
- }
- if( nValue <= 1 )
- {
- aFtLine2.Enable( FALSE );
- aMtrFldLine2.Enable( FALSE );
- aMtrFldLine2.SetEmptyFieldValue();
- }
- if( nValue == 0 )
- {
- aFtLine1.Enable( FALSE );
- aMtrFldLine1.Enable( FALSE );
- aMtrFldLine1.SetEmptyFieldValue();
- }
- }
-
- // SdrEdgeKindItem
- pItem = GetItem( rAttrs, SDRATTR_EDGEKIND );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND );
- if( pItem )
- {
- SdrEdgeKind nValue = ( ( const SdrEdgeKindItem* )pItem )->GetValue();
- aLbType.SelectEntryPos( sal::static_int_cast< USHORT >(nValue) );
- }
- else
- aLbType.SetNoSelection();
- aLbType.SaveValue();
-}
-
-/*************************************************************************
-|*
-|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
-|*
-\************************************************************************/
-
-BOOL SvxConnectionPage::FillItemSet( SfxItemSet& rAttrs)
-{
- BOOL bModified = FALSE;
- INT32 nValue;
-
- if( aMtrFldHorz1.GetText() != aMtrFldHorz1.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldHorz1, eUnit );
- rAttrs.Put( SdrEdgeNode1HorzDistItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldHorz2.GetText() != aMtrFldHorz2.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldHorz2, eUnit );
- rAttrs.Put( SdrEdgeNode2HorzDistItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldVert1.GetText() != aMtrFldVert1.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldVert1, eUnit );
- rAttrs.Put( SdrEdgeNode1VertDistItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldVert2.GetText() != aMtrFldVert2.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldVert2, eUnit );
- rAttrs.Put( SdrEdgeNode2VertDistItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldLine1.GetText() != aMtrFldLine1.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldLine1, eUnit );
- rAttrs.Put( SdrEdgeLine1DeltaItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldLine2.GetText() != aMtrFldLine2.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldLine2, eUnit );
- rAttrs.Put( SdrEdgeLine2DeltaItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldLine3.GetText() != aMtrFldLine3.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldLine3, eUnit );
- rAttrs.Put( SdrEdgeLine3DeltaItem( nValue ) );
- bModified = TRUE;
- }
-
-
- USHORT nPos = aLbType.GetSelectEntryPos();
- if( nPos != aLbType.GetSavedValue() )
- {
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rAttrs.Put( SdrEdgeKindItem( (SdrEdgeKind) nPos ) );
- bModified = TRUE;
- }
- }
-
- return( bModified );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxConnectionPage::Construct()
-{
- DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
-
- aCtlPreview.SetView( pView );
- aCtlPreview.Construct();
-}
-
-/*************************************************************************
-|*
-|* Erzeugt die Seite
-|*
-\************************************************************************/
-
-SfxTabPage* SvxConnectionPage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxConnectionPage( pWindow, rAttrs ) );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-USHORT* SvxConnectionPage::GetRanges()
-{
- return( pRanges );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p )
-{
- if( p == &aMtrFldHorz1 )
- {
- INT32 nValue = GetCoreValue( aMtrFldHorz1, eUnit );
- aAttrSet.Put( SdrEdgeNode1HorzDistItem( nValue ) );
- }
-
- if( p == &aMtrFldHorz2 )
- {
- INT32 nValue = GetCoreValue( aMtrFldHorz2, eUnit );
- aAttrSet.Put( SdrEdgeNode2HorzDistItem( nValue ) );
- }
-
- if( p == &aMtrFldVert1 )
- {
- INT32 nValue = GetCoreValue( aMtrFldVert1, eUnit );
- aAttrSet.Put( SdrEdgeNode1VertDistItem( nValue ) );
- }
-
- if( p == &aMtrFldVert2 )
- {
- INT32 nValue = GetCoreValue( aMtrFldVert2, eUnit );
- aAttrSet.Put( SdrEdgeNode2VertDistItem( nValue ) );
- }
-
- if( p == &aMtrFldLine1 )
- {
- INT32 nValue = GetCoreValue( aMtrFldLine1, eUnit );
- aAttrSet.Put( SdrEdgeLine1DeltaItem( nValue ) );
- }
-
- if( p == &aMtrFldLine2 )
- {
- INT32 nValue = GetCoreValue( aMtrFldLine2, eUnit );
- aAttrSet.Put( SdrEdgeLine2DeltaItem( nValue ) );
- }
-
- if( p == &aMtrFldLine3 )
- {
- INT32 nValue = GetCoreValue( aMtrFldLine3, eUnit );
- aAttrSet.Put( SdrEdgeLine3DeltaItem( nValue ) );
- }
-
-
- if( p == &aLbType )
- {
- USHORT nPos = aLbType.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aAttrSet.Put( SdrEdgeKindItem( (SdrEdgeKind) nPos ) );
- }
- }
-
- aCtlPreview.SetAttributes( aAttrSet );
-
- if( p == &aLbType )
- {
- // Anzahl der Linienversaetze ermitteln
- USHORT nCount = aCtlPreview.GetLineDeltaAnz();
-
- aFtLine3.Enable( nCount > 2 );
- aMtrFldLine3.Enable( nCount > 2 );
- if( nCount > 2 )
- aMtrFldLine3.SetValue( aMtrFldLine3.GetValue() );
- else
- aMtrFldLine3.SetEmptyFieldValue();
-
- aFtLine2.Enable( nCount > 1 );
- aMtrFldLine2.Enable( nCount > 1 );
- if( nCount > 1 )
- aMtrFldLine2.SetValue( aMtrFldLine2.GetValue() );
- else
- aMtrFldLine2.SetEmptyFieldValue();
-
- aFtLine1.Enable( nCount > 0 );
- aMtrFldLine1.Enable( nCount > 0 );
- if( nCount > 0 )
- aMtrFldLine1.SetValue( aMtrFldLine1.GetValue() );
- else
- aMtrFldLine1.SetEmptyFieldValue();
-
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxConnectionPage::FillTypeLB()
-{
- // ListBox mit Verbindernamen fuellen
- const SfxPoolItem* pItem = GetItem( rOutAttrs, SDRATTR_EDGEKIND );
- const SfxItemPool* pPool = rOutAttrs.GetPool();
-
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND );
- if( pItem )
- {
- const SdrEdgeKindItem* pEdgeKindItem = (const SdrEdgeKindItem*) pItem;
- USHORT nCount = pEdgeKindItem->GetValueCount();
- String aStr;
-
- for( USHORT i = 0; i < nCount; i++ )
- {
- aStr = pEdgeKindItem->GetValueTextByPos( i );
- aLbType.InsertEntry( aStr );
- }
- }
-}
-void SvxConnectionPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG(&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
- if (pOfaPtrItem)
- SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue()) );
-
- Construct();
-}
-
diff --git a/svx/source/cui/connect.hxx b/svx/source/cui/connect.hxx
deleted file mode 100644
index 9da2afa42d..0000000000
--- a/svx/source/cui/connect.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connect.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_CONNECT_HXX
-#define _SVX_CONNECT_HXX
-
-// include ---------------------------------------------------------------
-
-#include "connctrl.hxx"
-#include <sfx2/tabdlg.hxx>
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-#include <sfx2/basedlgs.hxx>
-
-class SdrView;
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern von Konnektoren (Connectors)
-|*
-\************************************************************************/
-
-class SvxConnectionPage : public SfxTabPage
-{
-private:
- FixedText aFtType;
- ListBox aLbType;
-
- FixedLine aFlDelta;
- FixedText aFtLine1;
- MetricField aMtrFldLine1;
- FixedText aFtLine2;
- MetricField aMtrFldLine2;
- FixedText aFtLine3;
- MetricField aMtrFldLine3;
-
- FixedLine aFlDistance;
- FixedText aFtHorz1;
- MetricField aMtrFldHorz1;
- FixedText aFtVert1;
- MetricField aMtrFldVert1;
- FixedText aFtHorz2;
- MetricField aMtrFldHorz2;
- FixedText aFtVert2;
- MetricField aMtrFldVert2;
-
- SvxXConnectionPreview aCtlPreview;
-
- const SfxItemSet& rOutAttrs;
- SfxItemSet aAttrSet;
- const SdrView* pView;
- SfxMapUnit eUnit;
-
-#ifdef _SVX_CONNECT_CXX
- void FillTypeLB();
-
- DECL_LINK( ChangeAttrHdl_Impl, void * );
-#endif
-
-public:
-
- SvxConnectionPage( Window* pWindow, const SfxItemSet& rInAttrs );
- ~SvxConnectionPage();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- void Construct();
- void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-};
-
-/*************************************************************************
-|*
-|* Von SfxSingleTabDialog abgeleitet, um vom Control "uber virtuelle Methode
-|* benachrichtigt werden zu k"onnen.
-|*
-\************************************************************************/
-
-class SvxConnectionDialog : public SfxSingleTabDialog
-{
-public:
- SvxConnectionDialog( Window* pParent, const SfxItemSet& rAttr,
- const SdrView* pView );
- ~SvxConnectionDialog();
-};
-
-
-#endif // _SVX_CONNECT_HXX
-
diff --git a/svx/source/cui/connect.src b/svx/source/cui/connect.src
deleted file mode 100644
index 21031303e7..0000000000
--- a/svx/source/cui/connect.src
+++ /dev/null
@@ -1,268 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connect.src,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // pragma ----------------------------------------------------------------
-
- // include ---------------------------------------------------------------
-#include <svtools/controldims.hrc>
-#include "connect.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
- // RID_SVXPAGE_CONNECTION ------------------------------------------------
-TabPage RID_SVXPAGE_CONNECTION
-{
- HelpId = HID_PAGE_CONNECTION ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Connector" ;
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 25 , 8 ) ;
- Text [ en-US ] = "~Type" ;
- };
- ListBox LB_TYPE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 37 , 6 ) ;
- Size = MAP_APPFONT ( 83 , 54 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedLine FL_DELTA
- {
- Pos = MAP_APPFONT ( 6 , 24 ) ;
- Size = MAP_APPFONT ( 120 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Line skew" ;
- };
- FixedText FT_LINE_1
- {
- Pos = MAP_APPFONT ( 12 , 37 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "Line ~1" ;
- };
- MetricField MTR_FLD_LINE_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 35 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- FixedText FT_LINE_2
- {
- Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "Line ~2" ;
- };
- MetricField MTR_FLD_LINE_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 51 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- FixedText FT_LINE_3
- {
- Pos = MAP_APPFONT ( 12 , 69 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "Line ~3" ;
- };
- MetricField MTR_FLD_LINE_3
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 67 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- FixedLine FL_DISTANCE
- {
- Pos = MAP_APPFONT ( 6 , 85 ) ;
- Size = MAP_APPFONT ( 120 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Line spacing" ;
- };
- FixedText FT_HORZ_1
- {
- Pos = MAP_APPFONT ( 12 , 98 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "~Begin horizontal" ;
- };
- MetricField MTR_FLD_HORZ_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 96 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- FixedText FT_HORZ_2
- {
- Pos = MAP_APPFONT ( 12 , 130 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "End ~horizontal" ;
- };
- MetricField MTR_FLD_HORZ_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 128 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- FixedText FT_VERT_1
- {
- Pos = MAP_APPFONT ( 12 , 114 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "Begin ~vertical" ;
- };
- MetricField MTR_FLD_VERT_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 112 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- FixedText FT_VERT_2
- {
- Pos = MAP_APPFONT ( 12 , 146 ) ;
- Size = MAP_APPFONT ( 66 , 8 ) ;
- Text [ en-US ] = "~End vertical" ;
- };
- MetricField MTR_FLD_VERT_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 144 ) ;
- Size = MAP_APPFONT ( 41 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- Unit = FUNIT_CM ;
- };
- Control CTL_PREVIEW
- {
- HelpId = HID_PAGE_CONNECTION_CTL_PREVIEW ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 + 120 + RSC_SP_FLGR_SPACE_Y + RSC_SP_FLGR_INNERBORDER_LEFT , 35 ) ;
- Size = MAP_APPFONT ( 118 , 121 ) ;
- QuickHelpText [ en-US ] = "Preview";
- };
-};
- // ******************************************************************* EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/connpoolconfig.cxx b/svx/source/cui/connpoolconfig.cxx
deleted file mode 100644
index 8965dc9105..0000000000
--- a/svx/source/cui/connpoolconfig.cxx
+++ /dev/null
@@ -1,231 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpoolconfig.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "connpoolconfig.hxx"
-#include "connpoolsettings.hxx"
-
-#include "connpooloptions.hxx"
-#include <svtools/itemset.hxx>
-#include <unotools/confignode.hxx>
-#include <comphelper/extract.hxx>
-#include <svtools/eitem.hxx>
-#include <comphelper/processfactory.hxx>
-#include "sdbcdriverenum.hxx"
-
-#include <svx/svxids.hrc>
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- using namespace ::utl;
- using namespace ::com::sun::star::uno;
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getConnectionPoolNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("org.openoffice.Office.DataAccess/ConnectionPool");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getEnablePoolingNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("EnablePooling");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getDriverSettingsNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("DriverSettings");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getDriverNameNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("DriverName");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getEnableNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Enable");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getTimeoutNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Timeout");
- return s_sNodeName;
- }
-
- //====================================================================
- //= ConnectionPoolConfig
- //====================================================================
- //--------------------------------------------------------------------
- void ConnectionPoolConfig::GetOptions(SfxItemSet& _rFillItems)
- {
- // the config node where all pooling relevant info are stored under
- OConfigurationTreeRoot aConnectionPoolRoot = OConfigurationTreeRoot::createWithServiceFactory(
- ::comphelper::getProcessServiceFactory(), getConnectionPoolNodeName(), -1, OConfigurationTreeRoot::CM_READONLY);
-
- // the global "enabled" flag
- Any aEnabled = aConnectionPoolRoot.getNodeValue(getEnablePoolingNodeName());
- sal_Bool bEnabled = sal_True;
- aEnabled >>= bEnabled;
- _rFillItems.Put(SfxBoolItem(SID_SB_POOLING_ENABLED, bEnabled));
-
- // the settings for the single drivers
- DriverPoolingSettings aSettings;
- // first get all the drivers register at the driver manager
- ODriverEnumeration aEnumDrivers;
- for ( ODriverEnumeration::const_iterator aLoopDrivers = aEnumDrivers.begin();
- aLoopDrivers != aEnumDrivers.end();
- ++aLoopDrivers
- )
- {
- aSettings.push_back(DriverPooling(*aLoopDrivers, sal_False, 120));
- }
-
- // then look for which of them settings are stored in the configuration
- OConfigurationNode aDriverSettings = aConnectionPoolRoot.openNode(getDriverSettingsNodeName());
-
- Sequence< ::rtl::OUString > aDriverKeys = aDriverSettings.getNodeNames();
- const ::rtl::OUString* pDriverKeys = aDriverKeys.getConstArray();
- const ::rtl::OUString* pDriverKeysEnd = pDriverKeys + aDriverKeys.getLength();
- for (;pDriverKeys != pDriverKeysEnd; ++pDriverKeys)
- {
- // the name of the driver in this round
- OConfigurationNode aThisDriverSettings = aDriverSettings.openNode(*pDriverKeys);
- ::rtl::OUString sThisDriverName;
- aThisDriverSettings.getNodeValue(getDriverNameNodeName()) >>= sThisDriverName;
-
- // look if we (resp. the driver manager) know this driver
- // doing O(n) search here, which is expensive, but this doesn't matter in this small case ...
- DriverPoolingSettings::iterator aLookup;
- for ( aLookup = aSettings.begin();
- aLookup != aSettings.end();
- ++aLookup
- )
- if (sThisDriverName.equals(aLookup->sName))
- break;
-
- if (aLookup == aSettings.end())
- { // do not know the driver - add it
- aSettings.push_back(DriverPooling(sThisDriverName, sal_False, 120));
-
- // and the position of the new entry
- aLookup = aSettings.end();
- --aLookup;
- }
-
- // now fill this entry with the settings from the configuration
- aThisDriverSettings.getNodeValue(getEnableNodeName()) >>= aLookup->bEnabled;
- aThisDriverSettings.getNodeValue(getTimeoutNodeName()) >>= aLookup->nTimeoutSeconds;
- }
-
- _rFillItems.Put(DriverPoolingSettingsItem(SID_SB_DRIVER_TIMEOUTS, aSettings));
- }
-
- //--------------------------------------------------------------------
- void ConnectionPoolConfig::SetOptions(const SfxItemSet& _rSourceItems)
- {
- // the config node where all pooling relevant info are stored under
- OConfigurationTreeRoot aConnectionPoolRoot = OConfigurationTreeRoot::createWithServiceFactory(
- ::comphelper::getProcessServiceFactory(), getConnectionPoolNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE);
-
- if (!aConnectionPoolRoot.isValid())
- // already asserted by the OConfigurationTreeRoot
- return;
-
- sal_Bool bNeedCommit = sal_False;
-
- // the global "enabled" flag
- SFX_ITEMSET_GET( _rSourceItems, pEnabled, SfxBoolItem, SID_SB_POOLING_ENABLED, sal_True );
- if (pEnabled)
- {
- sal_Bool bEnabled = pEnabled->GetValue();
- aConnectionPoolRoot.setNodeValue(getEnablePoolingNodeName(), Any(&bEnabled, ::getBooleanCppuType()));
- bNeedCommit = sal_True;
- }
-
- // the settings for the single drivers
- SFX_ITEMSET_GET( _rSourceItems, pDriverSettings, DriverPoolingSettingsItem, SID_SB_DRIVER_TIMEOUTS, sal_True );
- if (pDriverSettings)
- {
- OConfigurationNode aDriverSettings = aConnectionPoolRoot.openNode(getDriverSettingsNodeName());
- if (!aDriverSettings.isValid())
- return;
-
- ::rtl::OUString sThisDriverName;
- OConfigurationNode aThisDriverSettings;
-
- const DriverPoolingSettings& rNewSettings = pDriverSettings->getSettings();
- for ( DriverPoolingSettings::const_iterator aLoop = rNewSettings.begin();
- aLoop != rNewSettings.end();
- ++aLoop
- )
- {
- // need the name as ::rtl::OUString
- sThisDriverName = aLoop->sName;
-
- // the sub-node for this driver
- if (aDriverSettings.hasByName(aLoop->sName))
- aThisDriverSettings = aDriverSettings.openNode(aLoop->sName);
- else
- aThisDriverSettings = aDriverSettings.createNode(aLoop->sName);
-
- // set the values
- aThisDriverSettings.setNodeValue(getDriverNameNodeName(), makeAny(sThisDriverName));
- aThisDriverSettings.setNodeValue(getEnableNodeName(), Any(&aLoop->bEnabled, ::getBooleanCppuType()));
- aThisDriverSettings.setNodeValue(getTimeoutNodeName(), makeAny(aLoop->nTimeoutSeconds));
- }
- bNeedCommit = sal_True;
- }
- if (bNeedCommit)
- aConnectionPoolRoot.commit();
- }
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-
diff --git a/svx/source/cui/connpoolconfig.hxx b/svx/source/cui/connpoolconfig.hxx
deleted file mode 100644
index ebcdb70659..0000000000
--- a/svx/source/cui/connpoolconfig.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpoolconfig.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFAPP_CONNPOOLCONFIG_HXX_
-#define _OFFAPP_CONNPOOLCONFIG_HXX_
-
-class SfxItemSet;
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- //====================================================================
- //= ConnectionPoolConfig
- //====================================================================
- class ConnectionPoolConfig
- {
-
- public:
- static void GetOptions(SfxItemSet& _rFillItems);
- static void SetOptions(const SfxItemSet& _rSourceItems);
- };
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-#endif // _OFFAPP_CONNPOOLCONFIG_HXX_
-
-
diff --git a/svx/source/cui/connpooloptions.cxx b/svx/source/cui/connpooloptions.cxx
deleted file mode 100644
index de9b1ec86c..0000000000
--- a/svx/source/cui/connpooloptions.cxx
+++ /dev/null
@@ -1,516 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpooloptions.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "connpooloptions.hxx"
-#ifndef _OFFAPP_CONNPOOLOPTIONS_HRC_
-#include "connpooloptions.hrc"
-#endif
-#include <svtools/editbrowsebox.hxx>
-#include <vcl/field.hxx>
-#include "connpoolsettings.hxx"
-#include <svtools/eitem.hxx>
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <svx/dialmgr.hxx>
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- //====================================================================
- //= DriverListControl
- //====================================================================
- typedef ::svt::EditBrowseBox DriverListControl_Base;
- class DriverListControl : public DriverListControl_Base
- {
- using Window::Update;
- protected:
- DriverPoolingSettings m_aSavedSettings;
- DriverPoolingSettings m_aSettings;
- DriverPoolingSettings::const_iterator m_aSeekRow;
-
- String m_sYes;
- String m_sNo;
-
- Link m_aRowChangeHandler;
-
- public:
- DriverListControl( Window* _pParent, const ResId& _rId);
-
- virtual void Init();
- void Update(const DriverPoolingSettings& _rSettings);
- virtual String GetCellText( long nRow, USHORT nColId ) const;
-
- // the handler will be called with a DriverPoolingSettings::const_iterator as parameter,
- // or NULL if no valid current row exists
- void SetRowChangeHandler(const Link& _rHdl) { m_aRowChangeHandler = _rHdl; }
- Link GetRowChangeHandler() const { return m_aRowChangeHandler; }
-
- const DriverPooling* getCurrentRow() const;
- DriverPooling* getCurrentRow();
- void updateCurrentRow();
-
- const DriverPoolingSettings& getSettings() const { return m_aSettings; }
-
- void saveValue() { m_aSavedSettings = m_aSettings; }
- sal_Bool isModified() const;
-
- protected:
- virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol );
- virtual ::svt::CellController* GetController( long nRow, USHORT nCol );
-
- virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const;
-
- virtual BOOL SeekRow( long nRow );
- virtual BOOL SaveModified();
-
- virtual sal_Bool IsTabAllowed(sal_Bool _bForward) const;
-
- virtual void StateChanged( StateChangedType nStateChange );
-
- virtual void CursorMoved();
-
- protected:
- virtual sal_uInt32 GetTotalCellWidth(long nRow, USHORT nColId);
-
-
- private:
- String implGetCellText(DriverPoolingSettings::const_iterator _rPos, sal_uInt16 _nColId) const;
- };
-
- //--------------------------------------------------------------------
- DriverListControl::DriverListControl( Window* _pParent, const ResId& _rId)
-// :DriverListControl_Base(_pParent, _rId, DBBF_NOROWPICTURE, BROWSER_AUTO_VSCROLL | BROWSER_AUTO_HSCROLL | BROWSER_COLUMNSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_HIDESELECT | BROWSER_CURSOR_WO_FOCUS)
- :DriverListControl_Base(_pParent, _rId, EBBF_NOROWPICTURE, BROWSER_AUTO_VSCROLL | BROWSER_AUTO_HSCROLL | BROWSER_HIDECURSOR | BROWSER_AUTOSIZE_LASTCOL)
- ,m_aSeekRow(m_aSettings.end())
- ,m_sYes(ResId(STR_YES,*_rId.GetResMgr()))
- ,m_sNo(ResId(STR_NO,*_rId.GetResMgr()))
- {
- SetStyle((GetStyle() & ~WB_HSCROLL) | WB_AUTOHSCROLL);
-
- SetUniqueId(UID_OFA_CONNPOOL_DRIVERLIST_BACK);
- GetDataWindow().SetHelpId(HID_OFA_CONNPOOL_DRIVERLIST);
- }
-
- //--------------------------------------------------------------------
- sal_Bool DriverListControl::IsTabAllowed(sal_Bool /*_bForward*/) const
- {
- // no travinling within the fields via RETURN and TAB
- return sal_False;
- }
-
- //--------------------------------------------------------------------
- sal_Bool DriverListControl::isModified() const
- {
- if (m_aSettings.size() != m_aSavedSettings.size())
- return sal_True;
-
- DriverPoolingSettings::const_iterator aCurrent = m_aSettings.begin();
- DriverPoolingSettings::const_iterator aCurrentEnd = m_aSettings.end();
- DriverPoolingSettings::const_iterator aSaved = m_aSavedSettings.begin();
- for (;aCurrent != aCurrentEnd; ++aCurrent, ++aSaved)
- {
- if (*aCurrent != *aSaved)
- return sal_True;
- }
-
- return sal_False;
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::Init()
- {
- DriverListControl_Base::Init();
-
- Size aColWidth = LogicToPixel(Size(160, 0), MAP_APPFONT);
- InsertDataColumn(1, String(SVX_RES(STR_DRIVER_NAME)), aColWidth.Width());
- aColWidth = LogicToPixel(Size(30, 0), MAP_APPFONT);
- InsertDataColumn(2, String(SVX_RES(STR_POOLED_FLAG)), aColWidth.Width());
- aColWidth = LogicToPixel(Size(60, 0), MAP_APPFONT);
- InsertDataColumn(3, String(SVX_RES(STR_POOL_TIMEOUT)), aColWidth.Width());
- // Attention: the resource of the string is local to the resource of the enclosing dialog!
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::CursorMoved()
- {
- DriverListControl_Base::CursorMoved();
-
- // call the row change handler
- if ( m_aRowChangeHandler.IsSet() )
- {
- if ( GetCurRow() >= 0 )
- { // == -1 may happen in case the browse box has just been cleared
- m_aRowChangeHandler.Call( getCurrentRow() );
- }
- }
- }
-
- //--------------------------------------------------------------------
- const DriverPooling* DriverListControl::getCurrentRow() const
- {
- OSL_ENSURE( ( GetCurRow() < m_aSettings.size() ) && ( GetCurRow() >= 0 ),
- "DriverListControl::getCurrentRow: invalid current row!");
-
- if ( ( GetCurRow() >= 0 ) && ( GetCurRow() < m_aSettings.size() ) )
- return &(*(m_aSettings.begin() + GetCurRow()));
-
- return NULL;
- }
-
- //--------------------------------------------------------------------
- DriverPooling* DriverListControl::getCurrentRow()
- {
- OSL_ENSURE( ( GetCurRow() < m_aSettings.size() ) && ( GetCurRow() >= 0 ),
- "DriverListControl::getCurrentRow: invalid current row!");
-
- if ( ( GetCurRow() >= 0 ) && ( GetCurRow() < m_aSettings.size() ) )
- return &(*(m_aSettings.begin() + GetCurRow()));
-
- return NULL;
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::updateCurrentRow()
- {
- Window::Invalidate( GetRowRectPixel( GetCurRow() ), INVALIDATE_UPDATE );
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::Update(const DriverPoolingSettings& _rSettings)
- {
- m_aSettings = _rSettings;
-
- SetUpdateMode(sal_False);
- RowRemoved(0, GetRowCount());
- RowInserted(0, m_aSettings.size());
- SetUpdateMode(sal_True);
-
- ActivateCell(1, 0);
- }
-
- //--------------------------------------------------------------------
- sal_uInt32 DriverListControl::GetTotalCellWidth(long nRow, USHORT nColId)
- {
- return GetDataWindow().GetTextWidth(GetCellText(nRow, nColId));
- }
-
- //--------------------------------------------------------------------
- String DriverListControl::implGetCellText(DriverPoolingSettings::const_iterator _rPos, sal_uInt16 _nColId) const
- {
- OSL_ENSURE(_rPos < m_aSettings.end(), "DriverListControl::implGetCellText: invalid position!");
-
- String sReturn;
- switch (_nColId)
- {
- case 1:
- sReturn = _rPos->sName;
- break;
- case 2:
- sReturn = _rPos->bEnabled ? m_sYes : m_sNo;
- break;
- case 3:
- if (_rPos->bEnabled)
- sReturn = String::CreateFromInt32(_rPos->nTimeoutSeconds);
- break;
- default:
- OSL_ENSURE(sal_False, "DriverListControl::implGetCellText: invalid column id!");
- }
- return sReturn;
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::StateChanged( StateChangedType nStateChange )
- {
- if (STATE_CHANGE_ENABLE == nStateChange)
- Window::Invalidate(INVALIDATE_UPDATE);
- DriverListControl_Base::StateChanged( nStateChange );
- }
-
- //--------------------------------------------------------------------
- String DriverListControl::GetCellText( long nRow, USHORT nColId ) const
- {
- String sReturn;
- if (nRow > m_aSettings.size())
- {
- OSL_ENSURE(sal_False, "DriverListControl::GetCellText: don't ask me for such rows!");
- }
- else
- {
- sReturn = implGetCellText(m_aSettings.begin() + nRow, nColId);
- }
- return sReturn;
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol )
- {
- rController->GetWindow().SetText(GetCellText(nRow, nCol));
- }
-
- //--------------------------------------------------------------------
- ::svt::CellController* DriverListControl::GetController( long /*nRow*/, USHORT /*nCol*/ )
- {
- return NULL;
- }
-
- //--------------------------------------------------------------------
- BOOL DriverListControl::SaveModified()
- {
- return TRUE;
- }
-
- //--------------------------------------------------------------------
- BOOL DriverListControl::SeekRow( long _nRow )
- {
- DriverListControl_Base::SeekRow(_nRow);
-
- if (_nRow < m_aSettings.size())
- m_aSeekRow = m_aSettings.begin() + _nRow;
- else
- m_aSeekRow = m_aSettings.end();
-
- return m_aSeekRow != m_aSettings.end();
- }
-
- //--------------------------------------------------------------------
- void DriverListControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const
- {
- OSL_ENSURE(m_aSeekRow != m_aSettings.end(), "DriverListControl::PaintCell: invalid row!");
-
- if (m_aSeekRow != m_aSettings.end())
- {
- rDev.SetClipRegion(rRect);
-
- sal_uInt16 nStyle = TEXT_DRAW_CLIP;
- if (!IsEnabled())
- nStyle |= TEXT_DRAW_DISABLE;
- switch (nColId)
- {
- case 1: nStyle |= TEXT_DRAW_LEFT; break;
- case 2:
- case 3: nStyle |= TEXT_DRAW_CENTER; break;
- }
-
- rDev.DrawText(rRect, implGetCellText(m_aSeekRow, nColId), nStyle);
-
- rDev.SetClipRegion();
- }
- }
-
- //====================================================================
- //= ConnectionPoolOptionsPage
- //====================================================================
- //--------------------------------------------------------------------
- ConnectionPoolOptionsPage::ConnectionPoolOptionsPage(Window* _pParent, const SfxItemSet& _rAttrSet)
- :SfxTabPage(_pParent, SVX_RES(RID_OFAPAGE_CONNPOOLOPTIONS ), _rAttrSet)
- ,m_aFrame (this, SVX_RES(FL_POOLING))
- ,m_aEnablePooling (this, SVX_RES(CB_POOL_CONNS))
- ,m_aDriversLabel (this, SVX_RES(FT_DRIVERS))
- ,m_pDriverList(new DriverListControl(this, SVX_RES(CTRL_DRIVER_LIST)))
- ,m_aDriverLabel (this, SVX_RES(FT_DRIVERLABEL))
- ,m_aDriver (this, SVX_RES(FT_DRIVER))
- ,m_aDriverPoolingEnabled(this, SVX_RES(CB_DRIVERPOOLING))
- ,m_aTimeoutLabel (this, SVX_RES(FT_TIMEOUT))
- ,m_aTimeout (this, SVX_RES(NF_TIMEOUT))
- {
- m_pDriverList->Init();
- m_pDriverList->Show();
-
- FreeResource();
-
- m_aEnablePooling.SetClickHdl( LINK(this, ConnectionPoolOptionsPage, OnEnabledDisabled) );
- m_aDriverPoolingEnabled.SetClickHdl( LINK(this, ConnectionPoolOptionsPage, OnEnabledDisabled) );
-
- m_pDriverList->SetRowChangeHandler( LINK(this, ConnectionPoolOptionsPage, OnDriverRowChanged) );
- }
-
- //--------------------------------------------------------------------
- SfxTabPage* ConnectionPoolOptionsPage::Create(Window* _pParent, const SfxItemSet& _rAttrSet)
- {
- return new ConnectionPoolOptionsPage(_pParent, _rAttrSet);
- }
-
- //--------------------------------------------------------------------
- ConnectionPoolOptionsPage::~ConnectionPoolOptionsPage()
- {
- delete m_pDriverList;
- }
-
- //--------------------------------------------------------------------
- void ConnectionPoolOptionsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bFromReset*/)
- {
- // the enabled flag
- SFX_ITEMSET_GET( _rSet, pEnabled, SfxBoolItem, SID_SB_POOLING_ENABLED, sal_True );
- OSL_ENSURE(pEnabled, "ConnectionPoolOptionsPage::implInitControls: missing the Enabled item!");
- m_aEnablePooling.Check(pEnabled ? pEnabled->GetValue() : sal_True);
-
- m_aEnablePooling.SaveValue();
-
- // the settings for the single drivers
- SFX_ITEMSET_GET( _rSet, pDriverSettings, DriverPoolingSettingsItem, SID_SB_DRIVER_TIMEOUTS, sal_True );
- if (pDriverSettings)
- m_pDriverList->Update(pDriverSettings->getSettings());
- else
- {
- OSL_ENSURE(sal_False, "ConnectionPoolOptionsPage::implInitControls: missing the DriverTimeouts item!");
- m_pDriverList->Update(DriverPoolingSettings());
- }
- m_pDriverList->saveValue();
-
- // reflect the new settings
- OnEnabledDisabled(&m_aEnablePooling);
- }
-
- //--------------------------------------------------------------------
- long ConnectionPoolOptionsPage::Notify( NotifyEvent& _rNEvt )
- {
- if (EVENT_LOSEFOCUS == _rNEvt.GetType())
- if (m_aTimeout.IsWindowOrChild(_rNEvt.GetWindow()))
- commitTimeoutField();
-
- return SfxTabPage::Notify(_rNEvt);
- }
-
- //--------------------------------------------------------------------
- BOOL ConnectionPoolOptionsPage::FillItemSet(SfxItemSet& _rSet)
- {
- commitTimeoutField();
-
- sal_Bool bModified = sal_False;
- // the enabled flag
- if (m_aEnablePooling.GetSavedValue() != m_aEnablePooling.IsChecked())
- {
- _rSet.Put(SfxBoolItem(SID_SB_POOLING_ENABLED, m_aEnablePooling.IsChecked()), SID_SB_POOLING_ENABLED);
- bModified = sal_True;
- }
-
- // the settings for the single drivers
- if (m_pDriverList->isModified())
- {
- _rSet.Put(DriverPoolingSettingsItem(SID_SB_DRIVER_TIMEOUTS, m_pDriverList->getSettings()), SID_SB_DRIVER_TIMEOUTS);
- bModified = sal_True;
- }
-
- return bModified;
- }
-
- //--------------------------------------------------------------------
- void ConnectionPoolOptionsPage::ActivatePage( const SfxItemSet& _rSet)
- {
- SfxTabPage::ActivatePage(_rSet);
- implInitControls(_rSet, sal_False);
- }
-
- //--------------------------------------------------------------------
- void ConnectionPoolOptionsPage::Reset(const SfxItemSet& _rSet)
- {
- implInitControls(_rSet, sal_True);
- }
-
- //--------------------------------------------------------------------
- IMPL_LINK( ConnectionPoolOptionsPage, OnDriverRowChanged, const void*, _pRowIterator )
- {
- sal_Bool bValidRow = (NULL != _pRowIterator);
- m_aDriverPoolingEnabled.Enable(bValidRow && m_aEnablePooling.IsChecked());
- m_aTimeoutLabel.Enable(bValidRow);
- m_aTimeout.Enable(bValidRow);
-
- if (!bValidRow)
- { // positioned on an invalid row
- m_aDriver.SetText(String());
- }
- else
- {
- const DriverPooling *pDriverPos = static_cast<const DriverPooling*>(_pRowIterator);
-
- m_aDriver.SetText(pDriverPos->sName);
- m_aDriverPoolingEnabled.Check(pDriverPos->bEnabled);
- m_aTimeout.SetText(String::CreateFromInt32(pDriverPos->nTimeoutSeconds));
-
- OnEnabledDisabled(&m_aDriverPoolingEnabled);
- }
-
- return 0L;
- }
-
- //--------------------------------------------------------------------
- void ConnectionPoolOptionsPage::commitTimeoutField()
- {
- if (DriverPooling* pCurrentDriver = m_pDriverList->getCurrentRow())
- {
- pCurrentDriver->nTimeoutSeconds = static_cast<long>(m_aTimeout.GetValue());
- m_pDriverList->updateCurrentRow();
- }
- }
-
- //--------------------------------------------------------------------
- IMPL_LINK( ConnectionPoolOptionsPage, OnEnabledDisabled, const CheckBox*, _pCheckBox )
- {
- sal_Bool bGloballyEnabled = m_aEnablePooling.IsChecked();
- sal_Bool bLocalDriverChanged = &m_aDriverPoolingEnabled == _pCheckBox;
-
- if (&m_aEnablePooling == _pCheckBox)
- {
- m_aDriversLabel.Enable(bGloballyEnabled);
- m_pDriverList->Enable(bGloballyEnabled);
- m_aDriverLabel.Enable(bGloballyEnabled);
- m_aDriver.Enable(bGloballyEnabled);
- m_aDriverPoolingEnabled.Enable(bGloballyEnabled);
- }
- else
- OSL_ENSURE(bLocalDriverChanged, "ConnectionPoolOptionsPage::OnEnabledDisabled: where did this come from?");
-
- m_aTimeoutLabel.Enable(bGloballyEnabled && m_aDriverPoolingEnabled.IsChecked());
- m_aTimeout.Enable(bGloballyEnabled && m_aDriverPoolingEnabled.IsChecked());
-
- if (bLocalDriverChanged)
- {
- // update the list
- m_pDriverList->getCurrentRow()->bEnabled = m_aDriverPoolingEnabled.IsChecked();
- m_pDriverList->updateCurrentRow();
- }
-
- return 0L;
- }
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-
diff --git a/svx/source/cui/connpooloptions.hrc b/svx/source/cui/connpooloptions.hrc
deleted file mode 100644
index eae7028968..0000000000
--- a/svx/source/cui/connpooloptions.hrc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpooloptions.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFAPP_CONNPOOLOPTIONS_HRC_
-#define _OFFAPP_CONNPOOLOPTIONS_HRC_
-
-#define FL_POOLING 1
-#define CB_POOL_CONNS 2
-#define FT_DRIVERS 3
-#define CTRL_DRIVER_LIST 4
-#define FT_DRIVERLABEL 5
-#define FT_DRIVER 6
-#define CB_DRIVERPOOLING 7
-#define FT_TIMEOUT 8
-#define NF_TIMEOUT 9
-
-#define STR_DRIVER_NAME 1
-#define STR_POOLED_FLAG 2
-#define STR_POOL_TIMEOUT 3
-#define STR_YES 4
-#define STR_NO 5
-
-#endif // _OFFAPP_CONNPOOLOPTIONS_HRC_
-
-
diff --git a/svx/source/cui/connpooloptions.hxx b/svx/source/cui/connpooloptions.hxx
deleted file mode 100644
index 9bba07f614..0000000000
--- a/svx/source/cui/connpooloptions.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpooloptions.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFAPP_CONNPOOLOPTIONS_HXX_
-#define _OFFAPP_CONNPOOLOPTIONS_HXX_
-
-#include <svtools/solar.hrc>
-#include <sfx2/tabdlg.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
-#include <databaseregistrationui.hxx>
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- //====================================================================
- //= ConnectionPoolOptionsPage
- //====================================================================
- class DriverListControl;
- class ConnectionPoolOptionsPage : public SfxTabPage
- {
- using TabPage::ActivatePage;
-
- protected:
- FixedLine m_aFrame;
- CheckBox m_aEnablePooling;
- FixedText m_aDriversLabel;
- DriverListControl* m_pDriverList;
- FixedText m_aDriverLabel;
- FixedText m_aDriver;
- CheckBox m_aDriverPoolingEnabled;
- FixedText m_aTimeoutLabel;
- NumericField m_aTimeout;
-
- protected:
- ConnectionPoolOptionsPage(Window* _pParent, const SfxItemSet& _rAttrSet);
-
- public:
- static SfxTabPage* Create(Window* _pParent, const SfxItemSet& _rAttrSet);
-
- ~ConnectionPoolOptionsPage();
-
- protected:
- virtual long Notify( NotifyEvent& _rNEvt );
-
- virtual BOOL FillItemSet(SfxItemSet& _rSet);
- virtual void Reset(const SfxItemSet& _rSet);
- virtual void ActivatePage( const SfxItemSet& _rSet);
-
- protected:
- DECL_LINK( OnEnabledDisabled, const CheckBox* );
- DECL_LINK( OnDriverRowChanged, const void* );
-
- void implInitControls(const SfxItemSet& _rSet, sal_Bool _bFromReset);
-
- void commitTimeoutField();
- };
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-#endif // _OFFAPP_CONNPOOLOPTIONS_HXX_
-
-
diff --git a/svx/source/cui/connpooloptions.src b/svx/source/cui/connpooloptions.src
deleted file mode 100644
index 7ca11257e6..0000000000
--- a/svx/source/cui/connpooloptions.src
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpooloptions.src,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "connpooloptions.hrc"
-#include <svx/dialogs.hrc>
-
-#define PAGE_SIZE_X 260
-#define PAGE_SIZE_Y 185
-
-#define LIST_SIZE_Y 100
-
-TabPage RID_OFAPAGE_CONNPOOLOPTIONS
-{
- // HelpId = ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( PAGE_SIZE_X, PAGE_SIZE_Y ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
-
- FixedLine FL_POOLING
- {
- Pos = MAP_APPFONT( 4, 3 );
- Size = MAP_APPFONT( PAGE_SIZE_X - 8, 8 );
- Text [ en-US ] = "Connection pool";
- };
- CheckBox CB_POOL_CONNS
- {
- Pos = MAP_APPFONT( 7, 15 );
- Size = MAP_APPFONT( PAGE_SIZE_X - 14, 10 );
- Text [ en-US ] = "Connection pooling enabled";
- };
- FixedText FT_DRIVERS
- {
- Pos = MAP_APPFONT( 17, 28 );
- Size = MAP_APPFONT( PAGE_SIZE_X - 14 - 8, 8 );
- Text [ en-US ] = "Drivers known in %PRODUCTNAME";
- };
- Control CTRL_DRIVER_LIST
- {
- Pos = MAP_APPFONT( 17, 39 );
- Size = MAP_APPFONT( PAGE_SIZE_X - 14 - 8, LIST_SIZE_Y );
- TabStop = TRUE;
- Border = TRUE;
- SVLook = TRUE;
- };
- FixedText FT_DRIVERLABEL
- {
- Pos = MAP_APPFONT( 17, 39 + LIST_SIZE_Y + 4 );
- Size = MAP_APPFONT( 70, 8 );
- Text [ en-US ] = "Current driver:";
- };
- FixedText FT_DRIVER
- {
- Pos = MAP_APPFONT( 17 + 70 + 3, 39 + LIST_SIZE_Y + 4 );
- Size = MAP_APPFONT( PAGE_SIZE_X - ( 15 + 70 + 3 ) - 7, 8 );
- };
- CheckBox CB_DRIVERPOOLING
- {
- Pos = MAP_APPFONT( 17, 39 + LIST_SIZE_Y + 4 + 8 + 3 );
- Size = MAP_APPFONT( PAGE_SIZE_X - 23, 10 );
- Text [ en-US ] = "Enable pooling for this driver";
- };
- FixedText FT_TIMEOUT
- {
- Pos = MAP_APPFONT( 27, 39 + LIST_SIZE_Y + 4 + 8 + 3 + 10 + 3 + 2 );
- Size = MAP_APPFONT( 100, 8 );
- Text [ en-US ] = "Timeout (seconds)";
- };
- NumericField NF_TIMEOUT
- {
- Pos = MAP_APPFONT( 27 + 100 + 3, 39 + LIST_SIZE_Y + 4 + 8 + 3 + 10 + 3 );
- Size = MAP_APPFONT( 40, 12 );
- SvLook = TRUE;
- Border = TRUE;
- Right = TRUE;
- Spin = TRUE;
- Repeat = TRUE;
- Minimum = 30;
- Maximum = 600;
- StrictFormat = TRUE;
- DecimalDigits = 0;
- SpinSize = 1;
- };
-
- String STR_DRIVER_NAME
- {
- Text [ en-US ] = "Driver name";
- };
- String STR_POOLED_FLAG
- {
- Text [ en-US ] = "Pool";
- };
- String STR_POOL_TIMEOUT
- {
- Text [ en-US ] = "Timeout";
- };
- String STR_YES
- {
- Text [ en-US ] = "Yes";
- };
- String STR_NO
- {
- Text [ en-US ] = "No";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/connpoolsettings.cxx b/svx/source/cui/connpoolsettings.cxx
deleted file mode 100644
index af588f0b73..0000000000
--- a/svx/source/cui/connpoolsettings.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpoolsettings.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "connpoolsettings.hxx"
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- //====================================================================
- //= DriverPooling
- //====================================================================
- //--------------------------------------------------------------------
- DriverPooling::DriverPooling()
- :bEnabled(sal_False)
- ,nTimeoutSeconds(0)
- {
- }
-
- //--------------------------------------------------------------------
- DriverPooling::DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout )
- :sName(_rName)
- ,bEnabled(_bEnabled)
- ,nTimeoutSeconds(_nTimeout)
- {
- }
-
- //--------------------------------------------------------------------
- sal_Bool DriverPooling::operator == (const DriverPooling& _rR) const
- {
- return (sName == _rR.sName)
- && (bEnabled == _rR.bEnabled)
- && (nTimeoutSeconds == _rR.nTimeoutSeconds);
- }
-
- //====================================================================
- //= DriverPoolingSettings
- //====================================================================
- //--------------------------------------------------------------------
- DriverPoolingSettings::DriverPoolingSettings()
- {
- }
-
- //====================================================================
- //= DriverPoolingSettingsItem
- //====================================================================
- TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
- //--------------------------------------------------------------------
- DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings )
- :SfxPoolItem(_nId)
- ,m_aSettings(_rSettings)
- {
- }
-
- //--------------------------------------------------------------------
- int DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
- {
- const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
- if (!pItem)
- return sal_False;
-
- if (m_aSettings.size() != pItem->m_aSettings.size())
- return sal_False;
-
- DriverPoolingSettings::const_iterator aOwn = m_aSettings.begin();
- DriverPoolingSettings::const_iterator aOwnEnd = m_aSettings.end();
- DriverPoolingSettings::const_iterator aForeign = pItem->m_aSettings.begin();
- while (aOwn < aOwnEnd)
- {
- if (*aOwn != *aForeign)
- return sal_False;
-
- ++aForeign;
- ++aOwn;
- }
-
- return sal_True;
- }
-
- //--------------------------------------------------------------------
- SfxPoolItem* DriverPoolingSettingsItem::Clone( SfxItemPool * ) const
- {
- return new DriverPoolingSettingsItem(Which(), m_aSettings);
- }
-
- //--------------------------------------------------------------------
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-
diff --git a/svx/source/cui/connpoolsettings.hxx b/svx/source/cui/connpoolsettings.hxx
deleted file mode 100644
index 7788ea7e80..0000000000
--- a/svx/source/cui/connpoolsettings.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: connpoolsettings.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFAPP_CONNPOOLSETTINGS_HXX_
-#define _OFFAPP_CONNPOOLSETTINGS_HXX_
-
-#include <tools/string.hxx>
-#include <comphelper/stl_types.hxx>
-#include <svtools/poolitem.hxx>
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- //====================================================================
- //= DriverPooling
- //====================================================================
- struct DriverPooling
- {
- String sName;
- sal_Bool bEnabled;
- sal_Int32 nTimeoutSeconds;
-
- DriverPooling();
- DriverPooling( const String& _rName, sal_Bool _bEnabled, const sal_Int32 _nTimeout );
-
- sal_Bool operator == (const DriverPooling& _rR) const;
- sal_Bool operator != (const DriverPooling& _rR) const { return !operator ==(_rR); }
- };
-
- //====================================================================
- //= DriverPoolingSettings
- //====================================================================
- class DriverPoolingSettings
- {
- protected:
- DECLARE_STL_VECTOR( DriverPooling, DriverSettings );
- DriverSettings m_aDrivers;
-
- public:
- typedef ConstDriverSettingsIterator const_iterator;
- typedef DriverSettingsIterator iterator;
-
- public:
- DriverPoolingSettings();
-
- sal_Int32 size() const { return m_aDrivers.size(); }
-
- const_iterator begin() const { return m_aDrivers.begin(); }
- const_iterator end() const { return m_aDrivers.end(); }
-
- iterator begin() { return m_aDrivers.begin(); }
- iterator end() { return m_aDrivers.end(); }
-
- void push_back(const DriverPooling& _rElement) { m_aDrivers.push_back(_rElement); }
- };
-
- //====================================================================
- //= DriverPoolingSettingsItem
- //====================================================================
- class DriverPoolingSettingsItem : public SfxPoolItem
- {
- protected:
- DriverPoolingSettings m_aSettings;
-
- public:
- TYPEINFO();
-
- DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings );
-
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
-
- const DriverPoolingSettings& getSettings() const { return m_aSettings; }
- };
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-#endif // _OFFAPP_CONNPOOLSETTINGS_HXX_
-
-
diff --git a/svx/source/cui/cuicharmap.cxx b/svx/source/cui/cuicharmap.cxx
deleted file mode 100644
index d06d962c86..0000000000
--- a/svx/source/cui/cuicharmap.cxx
+++ /dev/null
@@ -1,594 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <stdio.h>
-
-#define _CUI_CHARMAP_CXX_
-#include <tools/shl.hxx>
-#include <tools/debug.hxx>
-#include <vcl/sound.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/colorcfg.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/itempool.hxx>
-
-#include <rtl/textenc.h>
-#include <svx/ucsubset.hxx>
-
-#include <svx/dialogs.hrc>
-#include <svx/dialmgr.hxx>
-#include "cuicharmap.hxx"
-#include <sfx2/request.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/app.hxx>
-#include <fontitem.hxx>
-#include "charmap.hrc"
-#include "macroass.hxx"
-
-// class SvxCharacterMap =================================================
-
-SvxCharacterMap::SvxCharacterMap( Window* pParent, BOOL bOne, const SfxItemSet* pSet ) :
- SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_CHARMAP ) ),
- mpCharMapData( 0 )
-{
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, FN_PARAM_1, FALSE );
- if ( pItem )
- bOne = pItem->GetValue();
-
- mpCharMapData = new SvxCharMapData( this, bOne, &DIALOG_MGR() );
-
- SFX_ITEMSET_ARG( pSet, pCharItem, SfxInt32Item, SID_ATTR_CHAR, FALSE );
- if ( pCharItem )
- SetChar( pCharItem->GetValue() );
-
-
- SFX_ITEMSET_ARG( pSet, pDisableItem, SfxBoolItem, FN_PARAM_2, FALSE );
- if ( pDisableItem && pDisableItem->GetValue() )
- DisableFontSelection();
-
- SFX_ITEMSET_ARG( pSet, pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, FALSE );
- SFX_ITEMSET_ARG( pSet, pFontNameItem, SfxStringItem, SID_FONT_NAME, FALSE );
- if ( pFontItem )
- {
- Font aFont( pFontItem->GetFamilyName(), pFontItem->GetStyleName(), GetCharFont().GetSize() );
- aFont.SetCharSet( pFontItem->GetCharSet() );
- aFont.SetPitch( pFontItem->GetPitch() );
- SetCharFont( aFont );
- }
- else if ( pFontNameItem )
- {
- Font aFont( GetCharFont() );
- aFont.SetName( pFontNameItem->GetValue() );
- SetCharFont( aFont );
- }
-
- FreeResource();
- CreateOutputItemSet( pSet ? *pSet->GetPool() : SFX_APP()->GetPool() );
-}
-
-// -----------------------------------------------------------------------
-
-SvxCharacterMap::~SvxCharacterMap()
-{
- delete mpCharMapData;
-}
-
-// -----------------------------------------------------------------------
-
-const Font& SvxCharacterMap::GetCharFont() const
-{
- return mpCharMapData->aFont;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharacterMap::SetChar( sal_UCS4 c )
-{
- mpCharMapData->aShowSet.SelectCharacter( c );
-}
-
-// -----------------------------------------------------------------------
-
-sal_UCS4 SvxCharacterMap::GetChar() const
-{
- return mpCharMapData->aShowSet.GetSelectCharacter();
-}
-
-// -----------------------------------------------------------------------
-
-String SvxCharacterMap::GetCharacters() const
-{
- return mpCharMapData->aShowText.GetText();
-}
-
-
-// -----------------------------------------------------------------------
-
-void SvxCharacterMap::DisableFontSelection()
-{
- mpCharMapData->aFontText.Disable();
- mpCharMapData->aFontLB.Disable();
-}
-
-void SvxCharacterMap::SetCharFont( const Font& rFont )
-{
- mpCharMapData->SetCharFont( rFont );
-}
-
-short SvxCharacterMap::Execute()
-{
- short nResult = SfxModalDialog::Execute();
- if ( nResult == RET_OK )
- {
- SfxItemSet* pSet = GetItemSet();
- if ( pSet )
- {
- const SfxItemPool* pPool = pSet->GetPool();
- const Font& rFont( GetCharFont() );
- pSet->Put( SfxStringItem( pPool->GetWhich(SID_CHARMAP), GetCharacters() ) );
- pSet->Put( SvxFontItem( rFont.GetFamily(), rFont.GetName(),
- rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), pPool->GetWhich(SID_ATTR_CHAR_FONT) ) );
- pSet->Put( SfxStringItem( pPool->GetWhich(SID_FONT_NAME), rFont.GetName() ) );
- pSet->Put( SfxInt32Item( pPool->GetWhich(SID_ATTR_CHAR), GetChar() ) );
- }
- }
-
- return nResult;
-}
-
-
-// class SvxShowText =====================================================
-
-SvxShowText::SvxShowText( Window* pParent, const ResId& rResId, BOOL bCenter )
-: Control( pParent, rResId ),
- mbCenter( bCenter)
-{}
-
-// -----------------------------------------------------------------------
-
-void SvxShowText::Paint( const Rectangle& )
-{
- Color aTextCol = GetTextColor();
-
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- const Color aWindowTextColor( rStyleSettings.GetDialogTextColor() );
- SetTextColor( aWindowTextColor );
-
- const String aText = GetText();
- const Size aSize = GetOutputSizePixel();
- Point aPoint( 2, mnY );
-
- // adjust position using ink boundary if possible
- Rectangle aBoundRect;
- if( !GetTextBoundRect( aBoundRect, aText ) || aBoundRect.IsEmpty() )
- aPoint.X() = (aSize.Width() - GetTextWidth( aText )) / 2;
- else
- {
- // adjust position before it gets out of bounds
- aBoundRect += aPoint;
-
- // shift back vertically if needed
- int nYLDelta = aBoundRect.Top();
- int nYHDelta = aSize.Height() - aBoundRect.Bottom();
- if( nYLDelta <= 0 )
- aPoint.Y() -= nYLDelta - 1;
- else if( nYHDelta <= 0 )
- aPoint.Y() += nYHDelta - 1;
-
- if( mbCenter )
- {
- // move glyph to middle of cell
- aPoint.X() = -aBoundRect.Left()
- + (aSize.Width() - aBoundRect.GetWidth()) / 2;
- }
- else
- {
- // shift back horizontally if needed
- int nXLDelta = aBoundRect.Left();
- int nXHDelta = aSize.Width() - aBoundRect.Right();
- if( nXLDelta <= 0 )
- aPoint.X() -= nXLDelta - 1;
- else if( nXHDelta <= 0 )
- aPoint.X() += nXHDelta - 1;
- }
- }
-
- DrawText( aPoint, aText );
- SetTextColor( aTextCol );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxShowText::SetFont( const Font& rFont )
-{
- long nWinHeight = GetOutputSizePixel().Height();
- Font aFont = rFont;
- aFont.SetWeight( WEIGHT_NORMAL );
- aFont.SetAlign( ALIGN_TOP );
- aFont.SetSize( PixelToLogic( Size( 0, nWinHeight/2 ) ) );
- aFont.SetTransparent( TRUE );
- Control::SetFont( aFont );
- mnY = ( nWinHeight - GetTextHeight() ) / 2;
-
- Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxShowText::SetText( const String& rText )
-{
- Control::SetText( rText );
- Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-SvxShowText::~SvxShowText()
-{}
-
-// class SvxCharacterMap =================================================
-
-SvxCharMapData::SvxCharMapData( SfxModalDialog* pDialog, BOOL bOne_, ResMgr* pResContext )
-: mpDialog( pDialog ),
- aShowSet ( pDialog, ResId( CT_SHOWSET, *pResContext ) ),
- aShowText ( pDialog, ResId( CT_SHOWTEXT, *pResContext ) ),
-// aShowShortcut ( pDialog, ResId( CT_ASSIGN, *pResContext ) ),
- aOKBtn ( pDialog, ResId( BTN_CHAR_OK, *pResContext ) ),
- aCancelBtn ( pDialog, ResId( BTN_CHAR_CANCEL, *pResContext ) ),
- aHelpBtn ( pDialog, ResId( BTN_CHAR_HELP, *pResContext ) ),
- aDeleteBtn ( pDialog, ResId( BTN_DELETE, *pResContext ) ),
-// aAssignBtn ( pDialog, ResId( BT_ASSIGN, *pResContext ) ),
- aFontText ( pDialog, ResId( FT_FONT, *pResContext ) ),
- aFontLB ( pDialog, ResId( LB_FONT, *pResContext ) ),
- aSubsetText ( pDialog, ResId( FT_SUBSET, *pResContext ) ),
- aSubsetLB ( pDialog, ResId( LB_SUBSET, *pResContext ) ),
- aSymbolText ( pDialog, ResId( FT_SYMBOLE, *pResContext ) ),
- aShowChar ( pDialog, ResId( CT_SHOWCHAR, *pResContext ), TRUE ),
- aCharCodeText ( pDialog, ResId( FT_CHARCODE, *pResContext ) ),
-// aAssignText ( pDialog, ResId( FT_ASSIGN, *pResContext ) ),
- bOne( bOne_ ),
- pSubsetMap( NULL )
-{
- aFont = pDialog->GetFont();
- aFont.SetTransparent( TRUE );
- aFont.SetFamily( FAMILY_DONTKNOW );
- aFont.SetPitch( PITCH_DONTKNOW );
- aFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW );
-
- if ( bOne )
- {
- Size aDlgSize = pDialog->GetSizePixel();
- pDialog->SetSizePixel( Size( aDlgSize.Width(),
- aDlgSize.Height()-aShowText.GetSizePixel().Height() ) );
- aSymbolText.Hide();
- aShowText.Hide();
- aDeleteBtn.Hide();
- }
-
- String aDefStr( aFont.GetName() );
- String aLastName;
- int nCount = mpDialog->GetDevFontCount();
- for ( int i = 0; i < nCount; i++ )
- {
- String aFontName( mpDialog->GetDevFont( i ).GetName() );
- if ( aFontName != aLastName )
- {
- aLastName = aFontName;
- USHORT nPos = aFontLB.InsertEntry( aFontName );
- aFontLB.SetEntryData( nPos, (void*)(ULONG)i );
- }
- }
- // the font may not be in the list =>
- // try to find a font name token in list and select found font,
- // else select topmost entry
- FASTBOOL bFound = (aFontLB.GetEntryPos( aDefStr ) == LISTBOX_ENTRY_NOTFOUND );
- if( !bFound )
- {
- for ( xub_StrLen i = 0; i < aDefStr.GetTokenCount(); ++i )
- {
- String aToken = aDefStr.GetToken(i);
- if ( aFontLB.GetEntryPos( aToken ) != LISTBOX_ENTRY_NOTFOUND )
- {
- aDefStr = aToken;
- bFound = TRUE;
- break;
- }
- }
- }
-
- if ( bFound )
- aFontLB.SelectEntry( aDefStr );
- else if ( aFontLB.GetEntryCount() )
- aFontLB.SelectEntryPos(0);
- FontSelectHdl( &aFontLB );
-
- aOKBtn.SetClickHdl( LINK( this, SvxCharMapData, OKHdl ) );
- aFontLB.SetSelectHdl( LINK( this, SvxCharMapData, FontSelectHdl ) );
- aSubsetLB.SetSelectHdl( LINK( this, SvxCharMapData, SubsetSelectHdl ) );
- aShowSet.SetDoubleClickHdl( LINK( this, SvxCharMapData, CharDoubleClickHdl ) );
- aShowSet.SetSelectHdl( LINK( this, SvxCharMapData, CharSelectHdl ) );
- aShowSet.SetHighlightHdl( LINK( this, SvxCharMapData, CharHighlightHdl ) );
- aShowSet.SetPreSelectHdl( LINK( this, SvxCharMapData, CharPreSelectHdl ) );
- aDeleteBtn.SetClickHdl( LINK( this, SvxCharMapData, DeleteHdl ) );
-// aAssignBtn.SetClickHdl( LINK( this, SvxCharMapData, AssignHdl ) );
-
- if( SvxShowCharSet::getSelectedChar() == ' ')
- aOKBtn.Disable();
- else
- aOKBtn.Enable();
-
- // left align aShowText field
- int nLeftEdge = aSymbolText.GetPosPixel().X();
- nLeftEdge += aSymbolText.GetTextWidth( aSymbolText.GetText() );
- Size aNewSize = aShowText.GetOutputSizePixel();
- aShowText.SetPosPixel( Point( nLeftEdge+4, aShowText.GetPosPixel().Y() ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCharMapData::SetCharFont( const Font& rFont )
-{
- // first get the underlying info in order to get font names
- // like "Times New Roman;Times" resolved
- Font aTmp( mpDialog->GetFontMetric( rFont ) );
-
- if ( aFontLB.GetEntryPos( aTmp.GetName() ) == LISTBOX_ENTRY_NOTFOUND )
- return;
-
- aFontLB.SelectEntry( aTmp.GetName() );
- aFont = aTmp;
- FontSelectHdl( &aFontLB );
-
- // for compatibility reasons
- mpDialog->ModalDialog::SetFont( aFont );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, OKHdl, OKButton *, EMPTYARG )
-{
- String aStr = aShowText.GetText();
-
- if ( !aStr.Len() )
- {
- sal_UCS4 cChar = aShowSet.GetSelectCharacter();
- // using the new UCS4 constructor
- rtl::OUString aOUStr( &cChar, 1 );
- aShowText.SetText( aOUStr );
- }
- mpDialog->EndDialog( TRUE );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, FontSelectHdl, ListBox *, EMPTYARG )
-{
- USHORT nPos = aFontLB.GetSelectEntryPos(),
- nFont = (USHORT)(ULONG)aFontLB.GetEntryData( nPos );
- aFont = mpDialog->GetDevFont( nFont );
- aFont.SetWeight( WEIGHT_DONTKNOW );
- aFont.SetItalic( ITALIC_NONE );
- aFont.SetWidthType( WIDTH_DONTKNOW );
- aFont.SetPitch( PITCH_DONTKNOW );
- aFont.SetFamily( FAMILY_DONTKNOW );
-
- // notify children using this font
- aShowSet.SetFont( aFont );
- aShowChar.SetFont( aFont );
- aShowText.SetFont( aFont );
-
- // right align some fields to aShowSet
- int nRightEdge = aShowSet.GetPosPixel().X() + aShowSet.GetOutputSizePixel().Width();
- Size aNewSize = aSubsetLB.GetOutputSizePixel();
- aNewSize.setWidth( nRightEdge - aSubsetLB.GetPosPixel().X() );
- aSubsetLB.SetOutputSizePixel( aNewSize );
-
- // setup unicode subset listbar with font specific subsets,
- // hide unicode subset listbar for symbol fonts
- // TODO: get info from the Font once it provides it
- if( pSubsetMap)
- delete pSubsetMap;
- pSubsetMap = NULL;
-
- BOOL bNeedSubset = (aFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL);
- if( bNeedSubset )
- {
- FontCharMap aFontCharMap;
- aShowSet.GetFontCharMap( aFontCharMap );
- pSubsetMap = new SubsetMap( &aFontCharMap );
-
- // update subset listbox for new font's unicode subsets
- aSubsetLB.Clear();
- // TODO: is it worth to improve the stupid linear search?
- bool bFirst = true;
- const Subset* s;
- while( NULL != (s = pSubsetMap->GetNextSubset( bFirst )) )
- {
- USHORT nPos_ = aSubsetLB.InsertEntry( s->GetName() );
- aSubsetLB.SetEntryData( nPos_, (void*)s );
- // NOTE: subset must live at least as long as the selected font
- if( bFirst )
- aSubsetLB.SelectEntryPos( nPos_ );
- bFirst = false;
- }
- if( aSubsetLB.GetEntryCount() <= 1 )
- bNeedSubset = FALSE;
- }
-
- aSubsetText.Show( bNeedSubset);
- aSubsetLB.Show( bNeedSubset);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, SubsetSelectHdl, ListBox *, EMPTYARG )
-{
- USHORT nPos = aSubsetLB.GetSelectEntryPos();
- const Subset* pSubset = reinterpret_cast<const Subset*> (aSubsetLB.GetEntryData(nPos));
- if( pSubset )
- {
- sal_UCS4 cFirst = pSubset->GetRangeMin();
- aShowSet.SelectCharacter( cFirst );
- }
- aSubsetLB.SelectEntryPos( nPos );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, CharDoubleClickHdl, Control *, EMPTYARG )
-{
- mpDialog->EndDialog( TRUE );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, CharSelectHdl, Control *, EMPTYARG )
-{
- if ( !bOne )
- {
- String aText = aShowText.GetText();
-
- if ( aText.Len() == CHARMAP_MAXLEN )
- Sound::Beep( SOUND_WARNING );
- else
- {
- sal_UCS4 cChar = aShowSet.GetSelectCharacter();
- // using the new UCS4 constructor
- rtl::OUString aOUStr( &cChar, 1 );
- aShowText.SetText( aText + aOUStr );
- }
-
- }
- aOKBtn.Enable();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, CharHighlightHdl, Control *, EMPTYARG )
-{
- String aText;
- sal_UCS4 cChar = aShowSet.GetSelectCharacter();
- sal_Bool bSelect = (cChar > 0);
-
- // show char sample
- if ( bSelect )
- {
- // using the new UCS4 constructor
- aText = rtl::OUString( &cChar, 1 );
-
- const Subset* pSubset = NULL;
- if( pSubsetMap )
- pSubset = pSubsetMap->GetSubsetByUnicode( cChar );
- if( pSubset )
- aSubsetLB.SelectEntry( pSubset->GetName() );
- else
- aSubsetLB.SetNoSelection();
- }
- aShowChar.SetText( aText );
- aShowChar.Update();
-
- // show char code
- if ( bSelect )
- {
- char aBuf[32];
- snprintf( aBuf, sizeof(aBuf), "U+%04X", static_cast<unsigned>(cChar) );
- if( cChar < 0x0100 )
- snprintf( aBuf+6, sizeof(aBuf)-6, " (%u)", static_cast<unsigned>(cChar) );
- aText = String::CreateFromAscii( aBuf );
- }
- aCharCodeText.SetText( aText );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, CharPreSelectHdl, Control *, EMPTYARG )
-{
- // adjust subset selection
- if( pSubsetMap )
- {
- sal_UCS4 cChar = aShowSet.GetSelectCharacter();
- const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar );
- if( pSubset )
- aSubsetLB.SelectEntry( pSubset->GetName() );
- }
-
- aOKBtn.Enable();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxCharMapData, DeleteHdl, PushButton *, EMPTYARG )
-{
- aShowText.SetText( String() );
- aOKBtn.Disable();
- return 0;
-}
-
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/stritem.hxx>
-
-IMPL_LINK( SvxCharMapData, AssignHdl, PushButton *, EMPTYARG )
-{
- SfxAllItemSet aSet( SfxObjectShell::Current()->GetPool() );
- aSet.Put( SfxStringItem( SID_CHARMAP, String::CreateFromAscii("test") ) );
- SfxModalDialog* pDlg = new SfxMacroAssignDlg( mpDialog, com::sun::star::uno::Reference < com::sun::star::frame::XFrame >(), aSet );
- if ( pDlg && pDlg->Execute() == RET_OK )
- {
- const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pOutSet->GetItemState( SID_CHARMAP, FALSE, &pItem ) )
- {
- // show assigned shortcut
- }
- }
-
- delete pDlg;
-
- return 0;
-}
diff --git a/svx/source/cui/cuicharmap.hxx b/svx/source/cui/cuicharmap.hxx
deleted file mode 100644
index 7ab3974fb1..0000000000
--- a/svx/source/cui/cuicharmap.hxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuicharmap.hxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CUI_CHARMAP_HXX
-#define _CUI_CHARMAP_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/ctrl.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <svx/charmap.hxx>
-
-class SubsetMap;
-class SvxCharMapData;
-
-// define ----------------------------------------------------------------
-
-#define CHARMAP_MAXLEN 32
-
-namespace svx
-{
- struct SvxShowCharSetItem;
- class SvxShowCharSetVirtualAcc;
-}
-// class SvxCharacterMap -------------------------------------------------
-// the main purpose of this dialog is to enable the use of characters
-// that are not easily accesible from the keyboard
-
-// class SvxShowText =====================================================
-
-class SvxShowText : public Control
-{
-public:
- SvxShowText( Window* pParent,
- const ResId& rResId,
- BOOL bCenter = FALSE );
- ~SvxShowText();
-
- void SetFont( const Font& rFont );
- void SetText( const String& rText );
-
-protected:
- virtual void Paint( const Rectangle& );
-
-private:
- long mnY;
- BOOL mbCenter;
-
-};
-
-class SvxCharMapData
-{
-public:
- SvxCharMapData( class SfxModalDialog* pDialog, BOOL bOne_, ResMgr* pResContext );
-
- void SetCharFont( const Font& rFont );
-
-private:
-friend class SvxCharacterMap;
- SfxModalDialog* mpDialog;
-
- SvxShowCharSet aShowSet;
- SvxShowText aShowText;
-// SvxShowText aShowShortcut;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
- PushButton aDeleteBtn;
-// PushButton aAssignBtn;
- FixedText aFontText;
- ListBox aFontLB;
- FixedText aSubsetText;
- ListBox aSubsetLB;
- FixedText aSymbolText;
- SvxShowText aShowChar;
- FixedText aCharCodeText;
-// FixedText aAssignText;
- Font aFont;
- BOOL bOne;
- const SubsetMap* pSubsetMap;
-
- DECL_LINK( OKHdl, OKButton* );
- DECL_LINK( FontSelectHdl, ListBox* );
- DECL_LINK( SubsetSelectHdl, ListBox* );
- DECL_LINK( CharDoubleClickHdl, Control* pControl );
- DECL_LINK( CharSelectHdl, Control* pControl );
- DECL_LINK( CharHighlightHdl, Control* pControl );
- DECL_LINK( CharPreSelectHdl, Control* pControl );
- DECL_LINK( DeleteHdl, PushButton* pBtn );
- DECL_LINK( AssignHdl, PushButton* pBtn );
-};
-
-class SvxCharacterMap : public SfxModalDialog
-{
-private:
- SvxCharMapData* mpCharMapData;
-
-public:
- SvxCharacterMap( Window* pParent, BOOL bOne=TRUE, const SfxItemSet* pSet=0 );
- ~SvxCharacterMap();
-
- void DisableFontSelection();
-
- const Font& GetCharFont() const;
- void SetCharFont( const Font& rFont );
-
- void SetChar( sal_UCS4 );
- sal_UCS4 GetChar() const;
-
- String GetCharacters() const;
-
- virtual short Execute();
-};
-
-#endif
-
diff --git a/svx/source/cui/cuiexp.cxx b/svx/source/cui/cuiexp.cxx
deleted file mode 100644
index cb85d0704d..0000000000
--- a/svx/source/cui/cuiexp.cxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuiexp.cxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "dlgfact.hxx"
-#include "sal/types.h"
-
-namespace cui
-{
- static AbstractDialogFactory_Impl* pFactory=NULL;
- AbstractDialogFactory_Impl* GetFactory()
- {
- if ( !pFactory )
- pFactory = new AbstractDialogFactory_Impl;
- return pFactory;
- }
-}
-
-extern "C"
-{
- SAL_DLLPUBLIC_EXPORT VclAbstractDialogFactory* CreateDialogFactory()
- {
- return ::cui::GetFactory();
- }
-}
diff --git a/svx/source/cui/cuifmsearch.cxx b/svx/source/cui/cuifmsearch.cxx
deleted file mode 100644
index 4549d9c7b3..0000000000
--- a/svx/source/cui/cuifmsearch.cxx
+++ /dev/null
@@ -1,984 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuifmsearch.cxx,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#ifndef _SVX_FMRESIDS_HRC
-#include "fmresids.hrc"
-#endif // _SVX_FMRESIDS_HRC
-#include <tools/debug.hxx>
-#include <vcl/msgbox.hxx>
-
-
-#include <vcl/svapp.hxx>
-#include <tools/shl.hxx>
-#include <svx/dialmgr.hxx>
-
-#include <sfx2/tabdlg.hxx> //add by CHINA001 for SfxItemSet
-#include <osl/mutex.hxx>
-#include <sfx2/app.hxx>
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include <svtools/filerec.hxx>
-#include "fmsrcimp.hxx"
-#include "fmsrccfg.hxx"
-
-#ifndef _FMSEARCH_HRC
-#include "fmsearch.hrc"
-#endif // _FMSEARCH_HRC
-#include "cuifmsearch.hxx"
-#include "srchdlg.hxx"
-#include <svtools/cjkoptions.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <comphelper/processfactory.hxx>
-
-#include <svx/svxdlg.hxx> //CHINA001
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::i18n;
-using namespace ::svxform;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::util;
-
-#define MAX_HISTORY_ENTRIES 50
-
-//------------------------------------------------------------------------
-void FmSearchDialog::initCommon( const Reference< XResultSet >& _rxCursor )
-{
- // init the engine
- DBG_ASSERT( m_pSearchEngine, "FmSearchDialog::initCommon: have no engine!" );
- m_pSearchEngine->SetProgressHandler(LINK(this, FmSearchDialog, OnSearchProgress));
-
- // some layout changes according to available CJK options
- SvtCJKOptions aCJKOptions;
- if (!aCJKOptions.IsJapaneseFindEnabled())
- {
- sal_Int32 nUpper = m_cbApprox.GetPosPixel().Y();
- sal_Int32 nDifference = m_aSoundsLikeCJKSettings.GetPosPixel().Y() - nUpper;
-
- // hide the options for the japanese search
- Control* pFieldsToMove[] = { &m_flState, &m_ftRecordLabel, &m_ftRecord, &m_ftHint };
- implMoveControls(pFieldsToMove, sizeof(pFieldsToMove)/sizeof(pFieldsToMove[0]), nDifference, &m_flOptions);
-
- m_aSoundsLikeCJK.Hide();
- m_aSoundsLikeCJKSettings.Hide();
- }
-
- if (!aCJKOptions.IsCJKFontEnabled())
- {
- m_aHalfFullFormsCJK.Hide();
-
- // never ignore the width (ignoring is expensive) if the option is not available at all
- // 04.12.2001 - 91973 - fs@openoffice.org
- m_pSearchEngine->SetIgnoreWidthCJK( sal_False );
- }
-
- // some initial record texts
- m_ftRecord.SetText( String::CreateFromInt32( _rxCursor->getRow() ) );
- m_pbClose.SetHelpText(String());
-}
-
-//------------------------------------------------------------------------
-FmSearchDialog::FmSearchDialog(Window* pParent, const UniString& sInitialText, const ::std::vector< String >& _rContexts, sal_Int16 nInitialContext,
- const Link& lnkContextSupplier)
- :ModalDialog(pParent, SVX_RES(RID_SVXDLG_SEARCHFORM))
- ,m_flSearchFor (this, SVX_RES(FL_SEARCHFOR))
- ,m_rbSearchForText (this, SVX_RES(RB_SEARCHFORTEXT))
- ,m_rbSearchForNull (this, SVX_RES(RB_SEARCHFORNULL))
- ,m_rbSearchForNotNull (this, SVX_RES(RB_SEARCHFORNOTNULL))
- ,m_cmbSearchText (this, SVX_RES(CMB_SEARCHTEXT))
- ,m_flWhere (this, SVX_RES(FL_WHERE))
- ,m_ftForm (this, SVX_RES(FT_FORM))
- ,m_lbForm (this, SVX_RES(LB_FORM))
- ,m_rbAllFields (this, SVX_RES(RB_ALLFIELDS))
- ,m_rbSingleField (this, SVX_RES(RB_SINGLEFIELD))
- ,m_lbField (this, SVX_RES(LB_FIELD))
- ,m_flOptions (this, SVX_RES(FL_OPTIONS))
- ,m_ftPosition (this, SVX_RES(FT_POSITION))
- ,m_lbPosition (this, SVX_RES(LB_POSITION))
- ,m_cbUseFormat (this, SVX_RES(CB_USEFORMATTER))
- ,m_cbCase (this, SVX_RES(CB_CASE))
- ,m_cbBackwards (this, SVX_RES(CB_BACKWARD))
- ,m_cbStartOver (this, SVX_RES(CB_STARTOVER))
- ,m_cbWildCard (this, SVX_RES(CB_WILDCARD))
- ,m_cbRegular (this, SVX_RES(CB_REGULAR))
- ,m_cbApprox (this, SVX_RES(CB_APPROX))
- ,m_pbApproxSettings (this, SVX_RES(PB_APPROXSETTINGS))
- ,m_aHalfFullFormsCJK (this, SVX_RES(CB_HALFFULLFORMS))
- ,m_aSoundsLikeCJK (this, SVX_RES(CB_SOUNDSLIKECJK))
- ,m_aSoundsLikeCJKSettings (this, SVX_RES(PB_SOUNDSLIKESETTINGS))
- ,m_flState (this, SVX_RES(FL_STATE))
- ,m_ftRecordLabel (this, SVX_RES(FT_RECORDLABEL))
- ,m_ftRecord (this, SVX_RES(FT_RECORD))
- ,m_ftHint (this, SVX_RES(FT_HINT))
- ,m_pbSearchAgain (this, SVX_RES(PB_SEARCH))
- ,m_pbClose (this, SVX_RES(1))
- ,m_pbHelp (this, SVX_RES(1))
- ,m_sSearch ( m_pbSearchAgain.GetText() )
- ,m_sCancel ( Button::GetStandardText( BUTTON_CANCEL ) )
- ,m_pPreSearchFocus( NULL )
- ,m_lnkContextSupplier(lnkContextSupplier)
- ,m_pConfig( NULL )
-{
- DBG_ASSERT(m_lnkContextSupplier.IsSet(), "FmSearchDialog::FmSearchDialog : have no ContextSupplier !");
-
- // erst mal die Informationen fuer den initialen Kontext
- FmSearchContext fmscInitial;
- fmscInitial.nContext = nInitialContext;
- m_lnkContextSupplier.Call(&fmscInitial);
- DBG_ASSERT(fmscInitial.xCursor.is(), "FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplier !");
- DBG_ASSERT(fmscInitial.strUsedFields.GetTokenCount(';') == (xub_StrLen)fmscInitial.arrFields.size(),
- "FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplied !");
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
- for (sal_Int32 i=0; i<(sal_Int32)fmscInitial.arrFields.size(); ++i)
- DBG_ASSERT(fmscInitial.arrFields.at(i).is(), "FmSearchDialog::FmSearchDialog : invalid data supplied by ContextSupplier !");
-#endif // (OSL_DEBUG_LEVEL > 1) || DBG_UTIL
-
- for ( ::std::vector< String >::const_iterator context = _rContexts.begin();
- context != _rContexts.end();
- ++context
- )
- {
- m_arrContextFields.push_back(String());
- m_lbForm.InsertEntry(*context);
- }
- m_lbForm.SelectEntryPos(nInitialContext);
-
- m_lbForm.SetSelectHdl(LINK(this, FmSearchDialog, OnContextSelection));
-
- if (m_arrContextFields.size() == 1)
- { // remove the context selection listbox and rearrange the controls accordingly
- sal_Int32 nUpper = m_lbForm.GetPosPixel().Y();
- sal_Int32 nDifference = m_rbAllFields.GetPosPixel().Y() - nUpper;
-
- // move all controls below the affected ones up
- Control* pFieldsToMove[] = { &m_rbAllFields, &m_rbSingleField, &m_lbField, &m_flOptions, &m_ftPosition, &m_lbPosition,
- &m_cbUseFormat, &m_cbCase, &m_cbBackwards, &m_cbStartOver, &m_cbWildCard, &m_cbRegular, &m_cbApprox,
- &m_pbApproxSettings, &m_aHalfFullFormsCJK, &m_aSoundsLikeCJK, &m_aSoundsLikeCJKSettings,
- &m_flState, &m_ftRecordLabel, &m_ftRecord, &m_ftHint };
-
- implMoveControls(pFieldsToMove, sizeof(pFieldsToMove)/sizeof(pFieldsToMove[0]), nDifference, &m_flWhere);
-
- Point pt = m_rbAllFields.GetPosPixel();
- pt.X() = m_ftForm.GetPosPixel().X();
- m_rbAllFields.SetPosPixel( pt );
- pt = m_rbSingleField.GetPosPixel();
- pt.X() = m_ftForm.GetPosPixel().X();
- m_rbSingleField.SetPosPixel( pt );
-
- // hide dispensable controls
- m_ftForm.Hide();
- m_lbForm.Hide();
- }
-
- m_pSearchEngine = new FmSearchEngine(
- ::comphelper::getProcessServiceFactory(), fmscInitial.xCursor, fmscInitial.strUsedFields, fmscInitial.arrFields, SM_ALLOWSCHEDULE );
- initCommon( fmscInitial.xCursor );
-
- if (fmscInitial.sFieldDisplayNames.Len() != 0)
- { // use the display names if supplied
- DBG_ASSERT(fmscInitial.sFieldDisplayNames.GetTokenCount() == fmscInitial.strUsedFields.GetTokenCount(),
- "FmSearchDialog::FmSearchDialog : invalid initial context description !");
- Init(fmscInitial.sFieldDisplayNames, sInitialText);
- }
- else
- Init(fmscInitial.strUsedFields, sInitialText);
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::implMoveControls(
- Control** _ppControls,
- sal_Int32 _nControls,
- sal_Int32 _nUp,
- Control* /*_pToResize*/)
-{
- for (sal_Int32 i=0; i<_nControls; ++i)
- {
- Point pt = _ppControls[i]->GetPosPixel();
- pt.Y() -= _nUp;
- _ppControls[i]->SetPosPixel(pt);
- }
-
- // resize myself
- Size sz = GetSizePixel();
- sz.Height() -= _nUp;
- SetSizePixel(sz);
-}
-
-//------------------------------------------------------------------------
-FmSearchDialog::~FmSearchDialog()
-{
- if (m_aDelayedPaint.IsActive())
- m_aDelayedPaint.Stop();
-
- SaveParams();
-
- if (m_pConfig)
- {
- delete m_pConfig;
- m_pConfig = NULL;
- }
-
- delete m_pSearchEngine;
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::Init(const UniString& strVisibleFields, const UniString& sInitialText)
-{
- // die Initialisierung all der Controls
- m_rbSearchForText.SetClickHdl(LINK(this, FmSearchDialog, OnClickedFieldRadios));
- m_rbSearchForNull.SetClickHdl(LINK(this, FmSearchDialog, OnClickedFieldRadios));
- m_rbSearchForNotNull.SetClickHdl(LINK(this, FmSearchDialog, OnClickedFieldRadios));
-
- m_rbAllFields.SetClickHdl(LINK(this, FmSearchDialog, OnClickedFieldRadios));
- m_rbSingleField.SetClickHdl(LINK(this, FmSearchDialog, OnClickedFieldRadios));
-
- m_pbSearchAgain.SetClickHdl(LINK(this, FmSearchDialog, OnClickedSearchAgain));
- m_pbApproxSettings.SetClickHdl(LINK(this, FmSearchDialog, OnClickedSpecialSettings));
- m_aSoundsLikeCJKSettings.SetClickHdl(LINK(this, FmSearchDialog, OnClickedSpecialSettings));
-
- m_lbPosition.SetSelectHdl(LINK(this, FmSearchDialog, OnPositionSelected));
- m_lbField.SetSelectHdl(LINK(this, FmSearchDialog, OnFieldSelected));
-
- m_cmbSearchText.SetModifyHdl(LINK(this, FmSearchDialog, OnSearchTextModified));
- m_cmbSearchText.EnableAutocomplete(sal_False);
-
- m_cbUseFormat.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_cbBackwards.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_cbStartOver.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_cbCase.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_cbWildCard.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_cbRegular.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_cbApprox.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_aHalfFullFormsCJK.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
- m_aSoundsLikeCJK.SetToggleHdl(LINK(this, FmSearchDialog, OnCheckBoxToggled));
-
- // die Listboxen fuellen
- // die Methoden des Feldvergleiches
- USHORT nResIds[] = {
- RID_STR_SEARCH_ANYWHERE,
- RID_STR_SEARCH_BEGINNING,
- RID_STR_SEARCH_END,
- RID_STR_SEARCH_WHOLE
- };
- for ( size_t i=0; i<sizeof(nResIds)/sizeof(nResIds[0]); ++i )
- m_lbPosition.InsertEntry( String( SVX_RES( nResIds[i] ) ) );
- m_lbPosition.SelectEntryPos(MATCHING_ANYWHERE);
-
- // die Feld-Listbox
- for (USHORT i=0; i<strVisibleFields.GetTokenCount(';'); ++i)
- m_lbField.InsertEntry(strVisibleFields.GetToken(i, ';'));
-
-
- m_pConfig = new FmSearchConfigItem;
- LoadParams();
-
- m_cmbSearchText.SetText(sInitialText);
- // wenn die Edit-Zeile den Text veraendert hat (weil er zum Beispiel Steuerzeichen enthielt, wie das bei Memofeldern der Fall
- // sein kann), nehme ich einen leeren UniString
- UniString sRealSetText = m_cmbSearchText.GetText();
- if (!sRealSetText.Equals(sInitialText))
- m_cmbSearchText.SetText(UniString());
- LINK(this, FmSearchDialog, OnSearchTextModified).Call(&m_cmbSearchText);
-
- // initial die ganzen UI-Elemente fuer die Suche an
- m_aDelayedPaint.SetTimeoutHdl(LINK(this, FmSearchDialog, OnDelayedPaint));
- m_aDelayedPaint.SetTimeout(500);
- EnableSearchUI(sal_True);
-
- if ( m_rbSearchForText.IsChecked() )
- m_cmbSearchText.GrabFocus();
-
- FreeResource();
-}
-
-//------------------------------------------------------------------------
-sal_Bool FmSearchDialog::Close()
-{
- // Wenn der Close-Button disabled ist und man im Dialog ESC drueckt, dann wird irgendwo vom Frame trotzdem Close aufgerufen,
- // was ich allerdings nicht will, wenn ich gerade mitten in einer (eventuell in einem extra Thread laufenden) Suche bin
- if (!m_pbClose.IsEnabled())
- return sal_False;
- return ModalDialog::Close();
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnClickedFieldRadios, Button*, pButton)
-{
- if ((pButton == &m_rbSearchForText) || (pButton == &m_rbSearchForNull) || (pButton == &m_rbSearchForNotNull))
- {
- EnableSearchForDependees(sal_True);
- }
- else
- // die Feldlistbox entsprechend en- oder disablen
- if (pButton == &m_rbSingleField)
- {
- m_lbField.Enable();
- m_pSearchEngine->RebuildUsedFields(m_lbField.GetSelectEntryPos());
- }
- else
- {
- m_lbField.Disable();
- m_pSearchEngine->RebuildUsedFields(-1);
- }
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnClickedSearchAgain, Button*, EMPTYARG)
-{
- if (m_pbClose.IsEnabled())
- { // der Button hat die Funktion 'Suchen'
- UniString strThisRoundText = m_cmbSearchText.GetText();
- // zur History dazu
- m_cmbSearchText.RemoveEntry(strThisRoundText);
- m_cmbSearchText.InsertEntry(strThisRoundText, 0);
- // das Remove/Insert stellt a) sicher, dass der UniString nicht zweimal auftaucht, b), dass die zuletzt gesuchten Strings am
- // Anfang stehen
- // und die Listenlaenge beschraenken
- while (m_cmbSearchText.GetEntryCount() > MAX_HISTORY_ENTRIES)
- m_cmbSearchText.RemoveEntry(m_cmbSearchText.GetEntryCount()-1);
-
- // den 'Ueberlauf'-Hint rausnehmen
- m_ftHint.SetText(UniString());
- m_ftHint.Invalidate();
-
- if (m_cbStartOver.IsChecked())
- {
- m_cbStartOver.Check(sal_False);
- EnableSearchUI(sal_False);
- if (m_rbSearchForText.IsChecked())
- m_pSearchEngine->StartOver(strThisRoundText);
- else
- m_pSearchEngine->StartOverSpecial(m_rbSearchForNull.IsChecked());
- }
- else
- {
- EnableSearchUI(sal_False);
- if (m_rbSearchForText.IsChecked())
- m_pSearchEngine->SearchNext(strThisRoundText);
- else
- m_pSearchEngine->SearchNextSpecial(m_rbSearchForNull.IsChecked());
- }
- }
- else
- { // der Button hat die Fukntion 'Abbrechen'
- DBG_ASSERT(m_pSearchEngine->GetSearchMode() != SM_BRUTE, "FmSearchDialog, OnClickedSearchAgain : falscher Modus !");
- // der CancelButton wird normalerweise nur disabled, wenn ich in einem Thread oder mit Reschedule arbeite
- m_pSearchEngine->CancelSearch();
- // mein ProgressHandler wird gerufen, wenn es wirklich zu Ende ist, das hier war nur eine Anforderung
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton )
-{
- if (&m_pbApproxSettings == pButton)
- {
- AbstractSvxSearchSimilarityDialog* pDlg = NULL;
-
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- pDlg = pFact->CreateSvxSearchSimilarityDialog( this, m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(),
- m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() );
- DBG_ASSERT( pDlg, "FmSearchDialog, OnClickedSpecialSettings: could not load the dialog!" );
-
- if ( pDlg && pDlg->Execute() == RET_OK )
- {
- m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() );
- m_pSearchEngine->SetLevOther( pDlg->GetOther() );
- m_pSearchEngine->SetLevShorter(pDlg->GetShorter() );
- m_pSearchEngine->SetLevLonger( pDlg->GetLonger() );
- }
- delete pDlg;
- }
- else if (&m_aSoundsLikeCJKSettings == pButton)
- {
- SfxItemSet aSet( SFX_APP()->GetPool() );
- //CHINA001 SvxJSearchOptionsDialog aDlg( this, aSet, RID_SVXPAGE_JSEARCH_OPTIONS, m_pSearchEngine->GetTransliterationFlags() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if(pFact)
- {
- AbstractSvxJSearchOptionsDialog* aDlg = pFact->CreateSvxJSearchOptionsDialog( this, aSet, RID_SVXPAGE_JSEARCH_OPTIONS, m_pSearchEngine->GetTransliterationFlags(), RID_SVXPAGE_JSEARCH_OPTIONS );
- DBG_ASSERT(aDlg, "Dialogdiet fail!");//CHINA001
- aDlg->Execute(); //CHINA001 aDlg.Execute();
-
-
- INT32 nFlags = aDlg->GetTransliterationFlags(); //CHINA001 INT32 nFlags = aDlg.GetTransliterationFlags();
- m_pSearchEngine->SetTransliterationFlags(nFlags);
-
- m_cbCase.Check(m_pSearchEngine->GetCaseSensitive());
- OnCheckBoxToggled( &m_cbCase );
- m_aHalfFullFormsCJK.Check( !m_pSearchEngine->GetIgnoreWidthCJK() );
- OnCheckBoxToggled( &m_aHalfFullFormsCJK );
- delete aDlg; //add for CHINA001
- }
- }
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnSearchTextModified, ComboBox*, EMPTYARG)
-{
- if ((m_cmbSearchText.GetText().Len() != 0) || !m_rbSearchForText.IsChecked())
- m_pbSearchAgain.Enable();
- else
- m_pbSearchAgain.Disable();
-
- m_pSearchEngine->InvalidatePreviousLoc();
- return 0;
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnPositionSelected, ListBox*, pBox)
-{
- (void) pBox; // avoid warning
- DBG_ASSERT(pBox->GetSelectEntryCount() == 1, "FmSearchDialog::OnMethodSelected : unerwartet : nicht genau ein Eintrag selektiert !");
-
- m_pSearchEngine->SetPosition(m_lbPosition.GetSelectEntryPos());
- return 0;
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnFieldSelected, ListBox*, pBox)
-{
- (void) pBox; // avoid warning
- DBG_ASSERT(pBox->GetSelectEntryCount() == 1, "FmSearchDialog::OnFieldSelected : unerwartet : nicht genau ein Eintrag selektiert !");
-
- m_pSearchEngine->RebuildUsedFields(m_rbAllFields.IsChecked() ? -1 : (sal_Int16)m_lbField.GetSelectEntryPos());
- // ruft auch m_pSearchEngine->InvalidatePreviousLoc auf
-
- sal_Int32 nCurrentContext = m_lbForm.GetSelectEntryPos();
- if (nCurrentContext != LISTBOX_ENTRY_NOTFOUND)
- m_arrContextFields[nCurrentContext] = UniString(m_lbField.GetSelectEntry());
- return 0;
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnCheckBoxToggled, CheckBox*, pBox)
-{
- sal_Bool bChecked = pBox->IsChecked();
-
- // Formatter oder case -> an die Engine weiterreichen
- if (pBox == &m_cbUseFormat)
- m_pSearchEngine->SetFormatterUsing(bChecked);
- else if (pBox == &m_cbCase)
- m_pSearchEngine->SetCaseSensitive(bChecked);
- // Richtung -> weiterreichen und Checkbox-Text fuer StartOver neu setzen
- else if (pBox == &m_cbBackwards)
- {
- m_cbStartOver.SetText( String( SVX_RES( bChecked ? RID_STR_FROM_BOTTOM : RID_STR_FROM_TOP ) ) );
- m_pSearchEngine->SetDirection(!bChecked);
- }
- // Aehnlichkeitssuche oder regulaerer Ausdruck
- else if ((pBox == &m_cbApprox) || (pBox == &m_cbRegular) || (pBox == &m_cbWildCard))
- {
- // die beiden jeweils anderen Boxes disablen oder enablen
- CheckBox* pBoxes[] = { &m_cbWildCard, &m_cbRegular, &m_cbApprox };
- for (sal_uInt32 i=0; i<sizeof(pBoxes)/sizeof(CheckBox*); ++i)
- {
- if (pBoxes[i] != pBox)
- {
- if (bChecked)
- pBoxes[i]->Disable();
- else
- pBoxes[i]->Enable();
- }
- }
-
- // an die Engine weiterreichen
- m_pSearchEngine->SetWildcard(m_cbWildCard.IsEnabled() ? m_cbWildCard.IsChecked() : sal_False);
- m_pSearchEngine->SetRegular(m_cbRegular.IsEnabled() ? m_cbRegular.IsChecked() : sal_False);
- m_pSearchEngine->SetLevenshtein(m_cbApprox.IsEnabled() ? m_cbApprox.IsChecked() : sal_False);
- // (Boxes, die disabled sind, muessen als sal_False an die Engine gehen)
-
- // die Position-Listbox anpassen (ist bei Wildcard-Suche nicht erlaubt)
- if (pBox == &m_cbWildCard)
- {
- if (bChecked)
- {
- m_ftPosition.Disable();
- m_lbPosition.Disable();
- }
- else
- {
- m_ftPosition.Enable();
- m_lbPosition.Enable();
- }
- }
-
- // und den Button fuer die Aehnlichkeitssuche
- if (pBox == &m_cbApprox)
- {
- if (bChecked)
- m_pbApproxSettings.Enable();
- else
- m_pbApproxSettings.Disable();
- }
- }
- else if (pBox == &m_aHalfFullFormsCJK)
- {
- // forward to the search engine
- m_pSearchEngine->SetIgnoreWidthCJK( !bChecked );
- }
- else if (pBox == &m_aSoundsLikeCJK)
- {
- m_aSoundsLikeCJKSettings.Enable(bChecked);
-
- // two other buttons which depend on this one
- sal_Bool bEnable = ( m_rbSearchForText.IsChecked()
- && !m_aSoundsLikeCJK.IsChecked()
- )
- || !SvtCJKOptions().IsJapaneseFindEnabled();
- m_cbCase.Enable(bEnable);
- m_aHalfFullFormsCJK.Enable(bEnable);
-
- // forward to the search engine
- m_pSearchEngine->SetTransliteration( bChecked );
- }
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::InitContext(sal_Int16 nContext)
-{
- FmSearchContext fmscContext;
- fmscContext.nContext = nContext;
-
-#ifdef DBG_UTIL
- sal_uInt32 nResult =
-#endif
- m_lnkContextSupplier.Call(&fmscContext);
- DBG_ASSERT(nResult > 0, "FmSearchDialog::InitContext : ContextSupplier didn't give me any controls !");
-
- // packen wir zuerst die Feld-Namen in die entsprechende Listbox
- m_lbField.Clear();
-
- if (fmscContext.sFieldDisplayNames.Len() != 0)
- {
- // use the display names if supplied
- DBG_ASSERT(fmscContext.sFieldDisplayNames.GetTokenCount() == fmscContext.strUsedFields.GetTokenCount(),
- "FmSearchDialog::InitContext : invalid context description supplied !");
- for (xub_StrLen i=0; i<fmscContext.sFieldDisplayNames.GetTokenCount(); ++i)
- m_lbField.InsertEntry(fmscContext.sFieldDisplayNames.GetToken(i));
- }
- else
- // else use the field names
- for (xub_StrLen i=0; i<fmscContext.strUsedFields.GetTokenCount(); ++i)
- m_lbField.InsertEntry(fmscContext.strUsedFields.GetToken(i));
-
- if (nContext < (sal_Int32)m_arrContextFields.size() && m_arrContextFields[nContext].Len())
- {
- m_lbField.SelectEntry(m_arrContextFields[nContext]);
- }
- else
- {
- m_lbField.SelectEntryPos(0);
- if (m_rbSingleField.IsChecked() && (m_lbField.GetEntryCount() > 1))
- m_lbField.GrabFocus();
- }
-
- // dann geben wir der Engine Bescheid
- m_pSearchEngine->SwitchToContext(fmscContext.xCursor, fmscContext.strUsedFields, fmscContext.arrFields,
- m_rbAllFields.IsChecked() ? -1 : 0);
-
- // und die Position des neuen Cursors anzeigen
- m_ftRecord.SetText(String::CreateFromInt32(fmscContext.xCursor->getRow()));
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK( FmSearchDialog, OnContextSelection, ListBox*, pBox)
-{
- InitContext(pBox->GetSelectEntryPos());
- return 0L;
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::EnableSearchUI(sal_Bool bEnable)
-{
- // wenn die Controls disabled werden sollen, schalte ich mal eben kurz ihr Paint aus und verzoegert wieder an
- if (!bEnable)
- EnableControlPaint(sal_False);
- else
- { // beim Enablen teste ich, ob der Timer fuer das delayed paint aktiv ist und stoppe ihn wenn noetig
- if (m_aDelayedPaint.IsActive())
- m_aDelayedPaint.Stop();
- }
- // (das ganze geht unten noch weiter)
- // diese kleine Verrenkung fuehrt hoffentlich dazu, dass es nicht flackert, wenn man die SearchUI schnell hintereinander
- // aus- und wieder einschaltet (wie das bei einem kurzen Suchvorgang zwangslaeufig der Fall ist)
-
- if ( !bEnable )
- {
- // if one of my children has the focus, remember it
- // 104332 - 2002-10-17 - fs@openoffice.org
- Window* pFocusWindow = Application::GetFocusWindow( );
- if ( pFocusWindow && IsChild( pFocusWindow ) )
- m_pPreSearchFocus = pFocusWindow;
- else
- m_pPreSearchFocus = NULL;
- }
-
- // der Suchen-Button hat einen Doppelfunktion, seinen Text entsprechend anpassen
- String sButtonText( bEnable ? m_sSearch : m_sCancel );
- m_pbSearchAgain.SetText( sButtonText );
-
- // jetzt Controls en- oder disablen
- if (m_pSearchEngine->GetSearchMode() != SM_BRUTE)
- {
- m_flSearchFor.Enable (bEnable);
- m_rbSearchForText.Enable (bEnable);
- m_rbSearchForNull.Enable (bEnable);
- m_rbSearchForNotNull.Enable (bEnable);
- m_flWhere.Enable (bEnable);
- m_ftForm.Enable (bEnable);
- m_lbForm.Enable (bEnable);
- m_rbAllFields.Enable (bEnable);
- m_rbSingleField.Enable (bEnable);
- m_lbField.Enable (bEnable && m_rbSingleField.IsChecked());
- m_flOptions.Enable (bEnable);
- m_cbBackwards.Enable (bEnable);
- m_cbStartOver.Enable (bEnable);
- m_pbClose.Enable (bEnable);
- EnableSearchForDependees (bEnable);
-
- if ( !bEnable )
- { // this means we're preparing for starting a search
- // In this case, EnableSearchForDependees disabled the search button
- // But as we're about to use it for cancelling the search, we really need to enable it, again
- // 07.12.2001 - 95246 - fs@openoffice.org
- m_pbSearchAgain.Enable( sal_True );
- }
- }
-
- // und den Rest fuer das delayed paint
- if (!bEnable)
- m_aDelayedPaint.Start();
- else
- EnableControlPaint(sal_True);
-
- if ( bEnable )
- { // restore focus
- // 104332 - 2002-10-17 - fs@openoffice.org
- if ( m_pPreSearchFocus )
- {
- m_pPreSearchFocus->GrabFocus();
- if ( WINDOW_EDIT == m_pPreSearchFocus->GetType() )
- {
- Edit* pEdit = static_cast< Edit* >( m_pPreSearchFocus );
- pEdit->SetSelection( Selection( 0, pEdit->GetText().Len() ) );
- }
- }
- m_pPreSearchFocus = NULL;
- }
-
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::EnableSearchForDependees(sal_Bool bEnable)
-{
- sal_Bool bSearchingForText = m_rbSearchForText.IsChecked();
- m_pbSearchAgain.Enable(bEnable && (!bSearchingForText || (m_cmbSearchText.GetText().Len() != 0)));
-
- bEnable = bEnable && bSearchingForText;
-
- sal_Bool bEnableRedundants = !m_aSoundsLikeCJK.IsChecked() || !SvtCJKOptions().IsJapaneseFindEnabled();
-
- m_cmbSearchText.Enable (bEnable);
- m_ftPosition.Enable (bEnable && !m_cbWildCard.IsChecked());
- m_cbWildCard.Enable (bEnable && !m_cbRegular.IsChecked() && !m_cbApprox.IsChecked());
- m_cbRegular.Enable (bEnable && !m_cbWildCard.IsChecked() && !m_cbApprox.IsChecked());
- m_cbApprox.Enable (bEnable && !m_cbWildCard.IsChecked() && !m_cbRegular.IsChecked());
- m_pbApproxSettings.Enable (bEnable && m_cbApprox.IsChecked());
- m_aHalfFullFormsCJK.Enable (bEnable && bEnableRedundants);
- m_aSoundsLikeCJK.Enable (bEnable);
- m_aSoundsLikeCJKSettings.Enable (bEnable && m_aSoundsLikeCJK.IsChecked());
- m_lbPosition.Enable (bEnable && !m_cbWildCard.IsChecked());
- m_cbUseFormat.Enable (bEnable);
- m_cbCase.Enable (bEnable && bEnableRedundants);
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::EnableControlPaint(sal_Bool bEnable)
-{
- Control* pAffectedControls[] = { &m_flSearchFor, &m_rbSearchForText, &m_cmbSearchText, &m_rbSearchForNull, &m_rbSearchForNotNull,
- &m_rbSearchForText, &m_flWhere, &m_rbAllFields, &m_rbSingleField, &m_lbField, &m_flOptions, &m_ftPosition, &m_lbPosition,
- &m_cbUseFormat, &m_cbCase, &m_cbBackwards, &m_cbStartOver, &m_cbWildCard, &m_cbRegular, &m_cbApprox, &m_pbApproxSettings,
- &m_pbSearchAgain, &m_pbClose };
-
- if (!bEnable)
- for (sal_uInt32 i=0; i<sizeof(pAffectedControls)/sizeof(pAffectedControls[0]); ++i)
- {
- pAffectedControls[i]->SetUpdateMode(bEnable);
- pAffectedControls[i]->EnablePaint(bEnable);
- }
- else
- for (sal_uInt32 i=0; i<sizeof(pAffectedControls)/sizeof(pAffectedControls[0]); ++i)
- {
- pAffectedControls[i]->EnablePaint(bEnable);
- pAffectedControls[i]->SetUpdateMode(bEnable);
- }
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnDelayedPaint, void*, EMPTYARG)
-{
- EnableControlPaint(sal_True);
- return 0L;
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::OnFound(const ::com::sun::star::uno::Any& aCursorPos, sal_Int16 nFieldPos)
-{
- FmFoundRecordInformation friInfo;
- friInfo.nContext = m_lbForm.GetSelectEntryPos();
- // wenn ich keine Suche in Kontexten mache, steht hier was ungueltiges drin, aber dann ist es auch egal
- friInfo.aPosition = aCursorPos;
- if (m_rbAllFields.IsChecked())
- friInfo.nFieldPos = nFieldPos;
- else
- friInfo.nFieldPos = m_lbField.GetSelectEntryPos();
- // das setzt natuerlich voraus, dass ich wirklich in dem Feld gesucht habe, dass in der Listbox ausgewaehlt ist,
- // genau das wird auch in RebuildUsedFields sichergestellt
-
- // dem Handler Bescheid sagen
- m_lnkFoundHandler.Call(&friInfo);
-
- // und wieder Focus auf mich
- m_cmbSearchText.GrabFocus();
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK(FmSearchDialog, OnSearchProgress, FmSearchProgress*, pProgress)
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- // diese eine Methode Thread-sicher machen (das ist ein Overkill, die ganze restliche Applikation dafuer zu blockieren,
- // aber im Augenblick haben wir kein anderes Sicherheitskonpzept)
-
- switch (pProgress->aSearchState)
- {
- case FmSearchProgress::STATE_PROGRESS:
- if (pProgress->bOverflow)
- {
- String sHint( SVX_RES( m_cbBackwards.IsChecked() ? RID_STR_OVERFLOW_BACKWARD : RID_STR_OVERFLOW_FORWARD ) );
- m_ftHint.SetText( sHint );
- m_ftHint.Invalidate();
- }
-
- m_ftRecord.SetText(String::CreateFromInt32(1 + pProgress->nCurrentRecord));
- m_ftRecord.Invalidate();
- break;
-
- case FmSearchProgress::STATE_PROGRESS_COUNTING:
- m_ftHint.SetText(SVX_RESSTR(RID_STR_SEARCH_COUNTING));
- m_ftHint.Invalidate();
-
- m_ftRecord.SetText(String::CreateFromInt32(pProgress->nCurrentRecord));
- m_ftRecord.Invalidate();
- break;
-
- case FmSearchProgress::STATE_SUCCESSFULL:
- OnFound(pProgress->aBookmark, (sal_Int16)pProgress->nFieldIndex);
- EnableSearchUI(sal_True);
- break;
-
- case FmSearchProgress::STATE_ERROR:
- case FmSearchProgress::STATE_NOTHINGFOUND:
- {
- sal_uInt16 nErrorId = (FmSearchProgress::STATE_ERROR == pProgress->aSearchState)
- ? RID_SVXERR_SEARCH_GENERAL_ERROR
- : RID_SVXERR_SEARCH_NORECORD;
- ErrorBox(this, SVX_RES(nErrorId)).Execute();
- }
- // KEIN break !
- case FmSearchProgress::STATE_CANCELED:
- EnableSearchUI(sal_True);
- if (m_lnkCanceledNotFoundHdl.IsSet())
- {
- FmFoundRecordInformation friInfo;
- friInfo.nContext = m_lbForm.GetSelectEntryPos();
- // wenn ich keine Suche in Kontexten mache, steht hier was ungueltiges drin, aber dann ist es auch egal
- friInfo.aPosition = pProgress->aBookmark;
- m_lnkCanceledNotFoundHdl.Call(&friInfo);
- }
- break;
- }
-
- m_ftRecord.SetText(String::CreateFromInt32(1 + pProgress->nCurrentRecord));
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::LoadParams()
-{
- FmSearchParams aParams(m_pConfig->getParams());
-
- const ::rtl::OUString* pHistory = aParams.aHistory.getConstArray();
- const ::rtl::OUString* pHistoryEnd = pHistory + aParams.aHistory.getLength();
- for (; pHistory != pHistoryEnd; ++pHistory)
- m_cmbSearchText.InsertEntry( *pHistory );
-
- // die Einstellungen nehme ich an meinen UI-Elementen vor und rufe dann einfach den entsprechenden Change-Handler auf,
- // dadurch werden die Daten an die SearchEngine weitergereicht und alle abhaengigen Enstellungen vorgenommen
-
- // aktuelles Feld
- sal_uInt16 nInitialField = m_lbField.GetEntryPos( String( aParams.sSingleSearchField ) );
- if (nInitialField == COMBOBOX_ENTRY_NOTFOUND)
- nInitialField = 0;
- m_lbField.SelectEntryPos(nInitialField);
- LINK(this, FmSearchDialog, OnFieldSelected).Call(&m_lbField);
- // alle/einzelnes Feld (NACH dem Selektieren des Feldes, da OnClickedFieldRadios dort einen gueltigen Eintrag erwartet)
- if (aParams.bAllFields)
- {
- m_rbSingleField.Check(sal_False);
- m_rbAllFields.Check(sal_True);
- LINK(this, FmSearchDialog, OnClickedFieldRadios).Call(&m_rbAllFields);
- // OnClickedFieldRadios ruft auch um RebuildUsedFields
- }
- else
- {
- m_rbAllFields.Check(sal_False);
- m_rbSingleField.Check(sal_True);
- LINK(this, FmSearchDialog, OnClickedFieldRadios).Call(&m_rbSingleField);
- }
-
- // Position im Feld
- m_lbPosition.SelectEntryPos(aParams.nPosition);
- LINK(this, FmSearchDialog, OnPositionSelected).Call(&m_lbPosition);
-
- // Feld-Formatierung/Case-Sensitivitaet/Richtung
- m_cbUseFormat.Check(aParams.bUseFormatter);
- m_cbCase.Check( aParams.isCaseSensitive() );
- m_cbBackwards.Check(aParams.bBackwards);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_cbUseFormat);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_cbCase);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_cbBackwards);
-
- m_aHalfFullFormsCJK.Check( !aParams.isIgnoreWidthCJK( ) ); // BEWARE: this checkbox has a inverse semantics!
- m_aSoundsLikeCJK.Check( aParams.bSoundsLikeCJK );
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_aHalfFullFormsCJK);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_aSoundsLikeCJK);
-
- // die drei Checkboxen fuer spezielle Sucharten
- // erst mal alle ruecksetzen
- m_cbWildCard.Check(sal_False);
- m_cbRegular.Check(sal_False);
- m_cbApprox.Check(sal_False);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_cbWildCard);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_cbRegular);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(&m_cbApprox);
-
- // dann die richtige setzen
- CheckBox* pToCheck = NULL;
- if (aParams.bWildcard)
- pToCheck = &m_cbWildCard;
- if (aParams.bRegular)
- pToCheck = &m_cbRegular;
- if (aParams.bApproxSearch)
- pToCheck = &m_cbApprox;
- if (aParams.bSoundsLikeCJK)
- pToCheck = &m_aSoundsLikeCJK;
- if (pToCheck)
- {
- pToCheck->Check(sal_True);
- LINK(this, FmSearchDialog, OnCheckBoxToggled).Call(pToCheck);
- }
-
- // die Levenshtein-Parameter direkt an der SearchEngine setzen
- m_pSearchEngine->SetLevRelaxed(aParams.bLevRelaxed);
- m_pSearchEngine->SetLevOther(aParams.nLevOther);
- m_pSearchEngine->SetLevShorter(aParams.nLevShorter);
- m_pSearchEngine->SetLevLonger(aParams.nLevLonger);
-
- m_pSearchEngine->SetTransliterationFlags( aParams.getTransliterationFlags( ) );
-
- m_rbSearchForText.Check(sal_False);
- m_rbSearchForNull.Check(sal_False);
- m_rbSearchForNotNull.Check(sal_False);
- switch (aParams.nSearchForType)
- {
- case 1: m_rbSearchForNull.Check(sal_True); break;
- case 2: m_rbSearchForNotNull.Check(sal_True); break;
- default: m_rbSearchForText.Check(sal_True); break;
- }
- LINK(this, FmSearchDialog, OnClickedFieldRadios).Call(&m_rbSearchForText);
-}
-
-//------------------------------------------------------------------------
-void FmSearchDialog::SaveParams() const
-{
- if (!m_pConfig)
- return;
-
- FmSearchParams aCurrentSettings;
-
- aCurrentSettings.aHistory.realloc( m_cmbSearchText.GetEntryCount() );
- ::rtl::OUString* pHistory = aCurrentSettings.aHistory.getArray();
- for (sal_uInt16 i=0; i<m_cmbSearchText.GetEntryCount(); ++i, ++pHistory)
- *pHistory = m_cmbSearchText.GetEntry(i);
-
- aCurrentSettings.sSingleSearchField = m_lbField.GetSelectEntry();
- aCurrentSettings.bAllFields = m_rbAllFields.IsChecked();
- aCurrentSettings.nPosition = m_pSearchEngine->GetPosition();
- aCurrentSettings.bUseFormatter = m_pSearchEngine->GetFormatterUsing();
- aCurrentSettings.setCaseSensitive ( m_pSearchEngine->GetCaseSensitive() );
- aCurrentSettings.bBackwards = !m_pSearchEngine->GetDirection();
- aCurrentSettings.bWildcard = m_pSearchEngine->GetWildcard();
- aCurrentSettings.bRegular = m_pSearchEngine->GetRegular();
- aCurrentSettings.bApproxSearch = m_pSearchEngine->GetLevenshtein();
- aCurrentSettings.bLevRelaxed = m_pSearchEngine->GetLevRelaxed();
- aCurrentSettings.nLevOther = m_pSearchEngine->GetLevOther();
- aCurrentSettings.nLevShorter = m_pSearchEngine->GetLevShorter();
- aCurrentSettings.nLevLonger = m_pSearchEngine->GetLevLonger();
-
- aCurrentSettings.bSoundsLikeCJK = m_pSearchEngine->GetTransliteration();
- aCurrentSettings.setTransliterationFlags ( m_pSearchEngine->GetTransliterationFlags() );
-
- if (m_rbSearchForNull.IsChecked())
- aCurrentSettings.nSearchForType = 1;
- else if (m_rbSearchForNotNull.IsChecked())
- aCurrentSettings.nSearchForType = 2;
- else
- aCurrentSettings.nSearchForType = 0;
-
- m_pConfig->setParams( aCurrentSettings );
-}
-
diff --git a/svx/source/cui/cuifmsearch.hxx b/svx/source/cui/cuifmsearch.hxx
deleted file mode 100644
index 23b1ceeccf..0000000000
--- a/svx/source/cui/cuifmsearch.hxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuifmsearch.hxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CUI_FMSEARCH_HXX
-#define _CUI_FMSEARCH_HXX
-
-#include <com/sun/star/sdbc/XResultSet.hpp>
-
-#include <svx/fmsearch.hxx> //CHINA001
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-
-#ifndef _DIALOG_HXX //autogen
-#include <vcl/dialog.hxx>
-#endif
-
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
-#include <vcl/combobox.hxx>
-#include <vcl/lstbox.hxx>
-#include <tools/link.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/stl_types.hxx>
-#include <tools/string.hxx>
-
-namespace svxform {
- class FmSearchConfigItem;
-}
-
-// ===================================================================================================
-// = class FmSearchDialog - Dialog fuer Suchen in Formularen/Tabellen
-// ===================================================================================================
-
-struct FmSearchProgress;
-
-class FmSearchEngine;
-
-class FmSearchDialog : public ModalDialog
-{
- friend class FmSearchEngine;
-
- // meine ganzen Controls
- FixedLine m_flSearchFor;
- RadioButton m_rbSearchForText;
- RadioButton m_rbSearchForNull;
- RadioButton m_rbSearchForNotNull;
- ComboBox m_cmbSearchText;
- FixedLine m_flWhere;
- FixedText m_ftForm;
- ListBox m_lbForm;
- RadioButton m_rbAllFields;
- RadioButton m_rbSingleField;
- ListBox m_lbField;
- FixedLine m_flOptions;
- FixedText m_ftPosition;
- ListBox m_lbPosition;
- CheckBox m_cbUseFormat;
- CheckBox m_cbCase;
- CheckBox m_cbBackwards;
- CheckBox m_cbStartOver;
- CheckBox m_cbWildCard;
- CheckBox m_cbRegular;
- CheckBox m_cbApprox;
- PushButton m_pbApproxSettings;
- CheckBox m_aHalfFullFormsCJK;
- CheckBox m_aSoundsLikeCJK;
- PushButton m_aSoundsLikeCJKSettings;
- FixedLine m_flState;
- FixedText m_ftRecordLabel;
- FixedText m_ftRecord;
- FixedText m_ftHint;
- PushButton m_pbSearchAgain;
- CancelButton m_pbClose;
- HelpButton m_pbHelp;
- String m_sSearch;
- String m_sCancel;
-
- Window* m_pPreSearchFocus;
-
- Link m_lnkFoundHandler; // Handler fuer "gefunden"
- Link m_lnkCanceledNotFoundHdl; // Handler fuer Positionierung des Cursors
-
- Link m_lnkContextSupplier; // fuer Suche in verschiedenen Kontexten
-
- // ein Array, in dem ich mir fuer jeden Kontext das aktuell selektierte Feld merke
- ::std::vector<String> m_arrContextFields;
-
- // fuer die eigentliche Arbeit ...
- FmSearchEngine* m_pSearchEngine;
-
- Timer m_aDelayedPaint;
- // siehe EnableSearchUI
-
- ::svxform::FmSearchConfigItem* m_pConfig;
-public:
- /** hiermit kann in verschiedenen Saetzen von Feldern gesucht werden. Es gibt eine Reihe von Kontexten, deren Namen in
- strContexts stehen (getrennt durch ';'), der Benutzer kann einen davon auswaehlen.
- Wenn der Benutzer einen Kontext auswaehlt, wird lnkContextSupplier aufgerufen, er bekommt einen Zeiger auf eine
- FmSearchContext-Struktur, die gefuellt werden muss.
- Fuer die Suche gilt dann :
- a) bei formatierter Suche wird der Iterator selber verwendet (wie beim ersten Constructor auch)
- b) bei formatierter Suche wird NICHT der FormatKey an den Fields des Iterators verwendet, sondern die entsprechende
- TextComponent wird gefragt (deshalb auch die Verwendung des originalen Iterator, durch dessen Move werden hoffentlich
- die hinter den TextComponent-Interfaces stehenden Controls geupdatet)
- c) bei nicht formatierter Suche wird ein Clone des Iterators verwendet (da ich hier die TextComponent-Interfaces nicht
- fragen muss)
- (natuerlich zwingend erforderlich : der String Nummer i in strUsedFields eines Kontexts muss mit dem Interface Nummer i
- in arrFields des Kontexts korrespondieren)
- */
- FmSearchDialog(Window* pParent, const String& strInitialText, const ::std::vector< String >& _rContexts, sal_Int16 nInitialContext,
- const Link& lnkContextSupplier);
-
- virtual ~FmSearchDialog();
-
- /** der Found-Handler bekommt im "gefunden"-Fall einen Zeiger auf eine FmFoundRecordInformation-Struktur
- (dieser ist nur im Handler gueltig, wenn man sich also die Daten merken muss, nicht den Zeiger, sondern die
- Struktur kopieren)
- Dieser Handler MUSS gesetzt werden.
- Ausserdem sollte beachtet werden, dass waehrend des Handlers der Suchdialog immer noch modal ist
- */
- void SetFoundHandler(const Link& lnk) { m_lnkFoundHandler = lnk; }
- /**
- Wenn die Suche abgebrochen oder erfolglos beendet wurde, wird im Suchdialog immer der aktuelle Datensatz angezeigt
- Damit das mit der eventuellen Anzeige des Aufrufers synchron geht, existiert dieser Handler (der nicht undbedingt gesetzt
- werden muss).
- Der dem Handler uebergebene Zeiger zeigt auf eine FmFoundRecordInformation-Struktur, bei der aPosition und eventuell
- (bei Suche mit Kontexten) nContext gueltig sind.
- */
- void SetCanceledNotFoundHdl(const Link& lnk) { m_lnkCanceledNotFoundHdl = lnk; }
-
- inline void SetActiveField(const String& strField);
-
-protected:
- virtual sal_Bool Close();
-
- void Init(const String& strVisibleFields, const String& strInitialText);
- // nur von den Constructoren aus zu verwenden
-
- void OnFound(const ::com::sun::star::uno::Any& aCursorPos, sal_Int16 nFieldPos);
-
- void EnableSearchUI(sal_Bool bEnable);
- // beim Suchen in einem eigenen Thread moechte ich natuerlich die UI zum Starten/Parameter-Setzen der Suche disablen
- // Bei bEnable == sal_False wird fuer alle betroffenen Controls das Painten kurz aus- und mittels m_aDelayedPaint nach
- // einer kurzen Weile wieder angeschaltet. Wenn inzwischen eine Anforderung mit bEnable==sal_True kommt, wird der Timer gestoppt
- // und das Painten gleich wieder angeschaltet. Als Konsequenz dieses umstaendlichen Vorgehens ist kein Flackern zu sehen,
- // wenn man schnell hintereinander aus- und wieder einschaltet.
-
- void EnableSearchForDependees(sal_Bool bEnable);
-
- void EnableControlPaint(sal_Bool bEnable);
- // enabled (disabled) fuer alle wichtigen Controls ihr Paint
-
- void InitContext(sal_Int16 nContext);
-
- void LoadParams();
- void SaveParams() const;
-
-private:
- // Handler fuer die Controls
- DECL_LINK( OnClickedFieldRadios, Button* );
- DECL_LINK( OnClickedSearchAgain, Button* );
- DECL_LINK( OnClickedSpecialSettings, Button* );
-
- DECL_LINK( OnSearchTextModified, ComboBox* );
-
- DECL_LINK( OnPositionSelected, ListBox* );
- DECL_LINK( OnFieldSelected, ListBox* );
-
- DECL_LINK( OnCheckBoxToggled, CheckBox* );
-
- DECL_LINK( OnContextSelection, ListBox* );
-
- // Such-Fortschritt
- DECL_LINK( OnSearchProgress, FmSearchProgress* );
-
- DECL_LINK( OnDelayedPaint, void* );
- // siehe EnableSearchUI
-
- void implMoveControls(Control** _ppControls, sal_Int32 _nControls, sal_Int32 _nUp, Control* _pToResize);
-
- void initCommon( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& _rxCursor );
-};
-
-inline void FmSearchDialog::SetActiveField(const String& strField)
-{
- sal_uInt16 nInitialField = m_lbField.GetEntryPos(strField);
- if (nInitialField == COMBOBOX_ENTRY_NOTFOUND)
- nInitialField = 0;
- m_lbField.SelectEntryPos(nInitialField);
- LINK(this, FmSearchDialog, OnFieldSelected).Call(&m_lbField);
-}
-
-#endif // _CUI_FMSEARCH_HXX
diff --git a/svx/source/cui/cuigaldlg.cxx b/svx/source/cui/cuigaldlg.cxx
deleted file mode 100644
index 3c3bb1364e..0000000000
--- a/svx/source/cui/cuigaldlg.cxx
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuigaldlg.cxx,v $
- * $Revision: 1.15 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <algorithm>
-#include <ucbhelper/content.hxx>
-#include <vos/mutex.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
-#include <avmedia/mediawindow.hxx>
-#include <svtools/pathoptions.hxx>
-#include <avmedia/mediawindow.hxx>
-#include "opengrf.hxx"
-#include "impgrf.hxx"
-#include "gallery1.hxx"
-#include "galtheme.hxx"
-#include "galbrws2.hxx"
-#include "galdlg.hxx"
-#include "cuigaldlg.hxx" //CHINA001
-#include <svtools/pickerhelper.hxx>
-#ifndef _SVX_HELPID_HRC
-#include "helpid.hrc"
-#endif
-#include <svtools/syslocale.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
-
-// --------------
-// - Namespaces -
-// --------------
-
-using namespace ::ucbhelper;
-using namespace ::rtl;
-using namespace ::cppu;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::uno;
-
-
-// -----------
-// - Defines -
-// -----------
-
-#define MAXPATH 1024
-
-// ----------------
-// - SearchThread -
-// ----------------
-
-SearchThread::SearchThread( SearchProgress* pProgess,
- TPGalleryThemeProperties* pBrowser,
- const INetURLObject& rStartURL ) :
- mpProgress ( pProgess ),
- mpBrowser ( pBrowser ),
- maStartURL ( rStartURL )
-{
-}
-
-// ------------------------------------------------------------------------
-
-SearchThread::~SearchThread()
-{
-}
-
-// ------------------------------------------------------------------------
-
-void SAL_CALL SearchThread::run()
-{
- const String aFileType( mpBrowser->aCbbFileType.GetText() );
-
- if( aFileType.Len() )
- {
- const sal_uInt16 nFileNumber = mpBrowser->aCbbFileType.GetEntryPos( aFileType );
- sal_uInt16 nBeginFormat, nEndFormat;
- ::std::vector< String > aFormats;
-
- if( !nFileNumber || ( nFileNumber >= mpBrowser->aCbbFileType.GetEntryCount() ) )
- {
- nBeginFormat = 1;
- nEndFormat = mpBrowser->aCbbFileType.GetEntryCount() - 1;
- }
- else
- nBeginFormat = nEndFormat = nFileNumber;
-
- for( sal_uInt16 i = nBeginFormat; i <= nEndFormat; ++i )
- aFormats.push_back( ( (FilterEntry*) mpBrowser->aFilterEntryList.GetObject( i ) )->aFilterName.ToLowerAscii() );
-
- ImplSearch( maStartURL, aFormats, mpBrowser->bSearchRecursive );
- }
-}
-
-// ------------------------------------------------------------------------
-
-void SAL_CALL SearchThread::onTerminated()
-{
- Application::PostUserEvent( LINK( mpProgress, SearchProgress, CleanUpHdl ) );
-}
-
-// ------------------------------------------------------------------------
-
-void SearchThread::ImplSearch( const INetURLObject& rStartURL,
- const ::std::vector< String >& rFormats,
- BOOL bRecursive )
-{
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- mpProgress->SetDirectory( rStartURL );
- mpProgress->Sync();
- }
-
- try
- {
- ::com::sun::star::uno::Reference< XCommandEnvironment > xEnv;
- Content aCnt( rStartURL.GetMainURL( INetURLObject::NO_DECODE ), xEnv );
- Sequence< OUString > aProps( 2 );
-
- aProps.getArray()[ 0 ] = OUString::createFromAscii( "IsFolder" );
- aProps.getArray()[ 1 ] = OUString::createFromAscii( "IsDocument" );
- ::com::sun::star::uno::Reference< XResultSet > xResultSet(
- aCnt.createCursor( aProps, INCLUDE_FOLDERS_AND_DOCUMENTS ) );
-
- if( xResultSet.is() )
- {
- ::com::sun::star::uno::Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY_THROW );
- ::com::sun::star::uno::Reference< XRow > xRow( xResultSet, UNO_QUERY_THROW );
-
- while( xResultSet->next() && schedule() )
- {
- INetURLObject aFoundURL( xContentAccess->queryContentIdentifierString() );
- DBG_ASSERT( aFoundURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- sal_Bool bFolder = xRow->getBoolean( 1 ); // property "IsFolder"
- if ( xRow->wasNull() )
- bFolder = sal_False;
-
- if( bRecursive && bFolder )
- ImplSearch( aFoundURL, rFormats, TRUE );
- else
- {
- sal_Bool bDocument = xRow->getBoolean( 2 ); // property "IsDocument"
- if ( xRow->wasNull() )
- bDocument = sal_False;
-
- if( bDocument )
- {
- GraphicDescriptor aDesc( aFoundURL );
- String aFileName;
-
- if( ( aDesc.Detect() &&
- ::std::find( rFormats.begin(),
- rFormats.end(),
- aDesc.GetImportFormatShortName(
- aDesc.GetFileFormat() ).ToLowerAscii() )
- != rFormats.end() ) ||
- ::std::find( rFormats.begin(),
- rFormats.end(),
- String(aFoundURL.GetExtension().toAsciiLowerCase()) )
- != rFormats.end() )
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- mpBrowser->aFoundList.Insert(
- new String( aFoundURL.GetMainURL( INetURLObject::NO_DECODE ) ),
- LIST_APPEND );
- mpBrowser->aLbxFound.InsertEntry(
- GetReducedString( aFoundURL, 50 ),
- (USHORT) mpBrowser->aFoundList.Count() - 1 );
- }
- }
- }
- }
- }
- }
- catch( const ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
-}
-
-// ------------------
-// - SearchProgress -
-// ------------------
-
-SearchProgress::SearchProgress( Window* pParent, const INetURLObject& rStartURL ) :
- ModalDialog ( pParent, GAL_RESID(RID_SVXDLG_GALLERY_SEARCH_PROGRESS ) ),
- aFtSearchDir ( this, GAL_RESID( FT_SEARCH_DIR ) ),
- aFLSearchDir ( this, GAL_RESID( FL_SEARCH_DIR ) ),
- aFtSearchType ( this, GAL_RESID( FT_SEARCH_TYPE ) ),
- aFLSearchType ( this, GAL_RESID( FL_SEARCH_TYPE ) ),
- aBtnCancel ( this, GAL_RESID( BTN_CANCEL ) ),
- maSearchThread ( this, (TPGalleryThemeProperties*) pParent, rStartURL )
-{
- FreeResource();
- aBtnCancel.SetClickHdl( LINK( this, SearchProgress, ClickCancelBtn ) );
-}
-
-// ------------------------------------------------------------------------
-
-void SearchProgress::Terminate()
-{
- maSearchThread.terminate();
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( SearchProgress, ClickCancelBtn, void*, EMPTYARG )
-{
- Terminate();
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( SearchProgress, CleanUpHdl, void*, EMPTYARG )
-{
- EndDialog( RET_OK );
- delete this;
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-short SearchProgress::Execute()
-{
- DBG_ERROR( "SearchProgress cannot be executed via Dialog::Execute!\n"
- "It creates a thread that will call back to VCL apartment => deadlock!\n"
- "Use Dialog::StartExecuteModal to execute the dialog!" );
- return RET_CANCEL;
-}
-
-// ------------------------------------------------------------------------
-
-void SearchProgress::StartExecuteModal( const Link& rEndDialogHdl )
-{
- maSearchThread.create();
- ModalDialog::StartExecuteModal( rEndDialogHdl );
-}
-
-// --------------
-// - TakeThread -
-// --------------
-
-TakeThread::TakeThread( TakeProgress* pProgess, TPGalleryThemeProperties* pBrowser, List& rTakenList ) :
- mpProgress ( pProgess ),
- mpBrowser ( pBrowser ),
- mrTakenList ( rTakenList )
-{
-}
-
-// ------------------------------------------------------------------------
-
-TakeThread::~TakeThread()
-{
-}
-
-// ------------------------------------------------------------------------
-
-void SAL_CALL TakeThread::run()
-{
- String aName;
- INetURLObject aURL;
- USHORT nEntries;
- GalleryTheme* pThm = mpBrowser->GetXChgData()->pTheme;
- USHORT nPos;
- GalleryProgress* pStatusProgress;
-
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- pStatusProgress = new GalleryProgress;
- nEntries = mpBrowser->bTakeAll ? mpBrowser->aLbxFound.GetEntryCount() : mpBrowser->aLbxFound.GetSelectEntryCount();
- pThm->LockBroadcaster();
- }
-
- for( USHORT i = 0; i < nEntries && schedule(); i++ )
- {
- // kompletten Filenamen aus FoundList holen
- if( mpBrowser->bTakeAll )
- aURL = INetURLObject(*mpBrowser->aFoundList.GetObject( nPos = i ));
- else
- aURL = INetURLObject(*mpBrowser->aFoundList.GetObject( nPos = mpBrowser->aLbxFound.GetSelectEntryPos( i ) ));
-
- // Position in Taken-Liste uebernehmen
- mrTakenList.Insert( (void*) (ULONG)nPos, LIST_APPEND );
-
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- mpProgress->SetFile( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
- pStatusProgress->Update( i, nEntries - 1 );
- mpProgress->Sync();
- pThm->InsertURL( aURL );
- }
- }
-
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- pThm->UnlockBroadcaster();
- delete pStatusProgress;
- }
-}
-
-// ------------------------------------------------------------------------
-
-void SAL_CALL TakeThread::onTerminated()
-{
- Application::PostUserEvent( LINK( mpProgress, TakeProgress, CleanUpHdl ) );
-}
-
-// ----------------
-// - TakeProgress -
-// ----------------
-
-TakeProgress::TakeProgress( Window* pWindow ) :
- ModalDialog ( pWindow, GAL_RESID( RID_SVXDLG_GALLERY_TAKE_PROGRESS ) ),
- aFtTakeFile ( this, GAL_RESID( FT_TAKE_FILE ) ),
- aFLTakeProgress( this, GAL_RESID( FL_TAKE_PROGRESS ) ),
- aBtnCancel ( this, GAL_RESID( BTN_CANCEL ) ),
- maTakeThread ( this, (TPGalleryThemeProperties*) pWindow, maTakenList )
-
-{
- FreeResource();
- aBtnCancel.SetClickHdl( LINK( this, TakeProgress, ClickCancelBtn ) );
-}
-
-// ------------------------------------------------------------------------
-
-
-void TakeProgress::Terminate()
-{
- maTakeThread.terminate();
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TakeProgress, ClickCancelBtn, void*, EMPTYARG )
-{
- Terminate();
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TakeProgress, CleanUpHdl, void*, EMPTYARG )
-{
- TPGalleryThemeProperties* mpBrowser = (TPGalleryThemeProperties*) GetParent();
- ::std::bit_vector aRemoveEntries( mpBrowser->aFoundList.Count(), false );
- ::std::vector< String > aRemainingVector;
- sal_uInt32 i, nCount;
-
- GetParent()->EnterWait();
- mpBrowser->aLbxFound.SetUpdateMode( FALSE );
- mpBrowser->aLbxFound.SetNoSelection();
-
- // mark all taken positions in aRemoveEntries
- for( i = 0UL, nCount = maTakenList.Count(); i < nCount; ++i )
- aRemoveEntries[ (ULONG) maTakenList.GetObject( i ) ] = true;
-
- maTakenList.Clear();
-
- // refill found list
- for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i )
- if( !aRemoveEntries[ i ] )
- aRemainingVector.push_back( *mpBrowser->aFoundList.GetObject( i ) );
-
- for( String* pStr = mpBrowser->aFoundList.First(); pStr; pStr = mpBrowser->aFoundList.Next() )
- delete pStr;
-
- mpBrowser->aFoundList.Clear();
-
- for( i = 0, nCount = aRemainingVector.size(); i < nCount; ++i )
- mpBrowser->aFoundList.Insert( new String( aRemainingVector[ i ] ), LIST_APPEND );
-
- aRemainingVector.clear();
-
- // refill list box
- for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i )
- if( !aRemoveEntries[ i ] )
- aRemainingVector.push_back( mpBrowser->aLbxFound.GetEntry( (sal_uInt16) i ) );
-
- mpBrowser->aLbxFound.Clear();
-
- for( i = 0, nCount = aRemainingVector.size(); i < nCount; ++i )
- mpBrowser->aLbxFound.InsertEntry( aRemainingVector[ i ] );
-
- aRemainingVector.clear();
-
- mpBrowser->aLbxFound.SetUpdateMode( TRUE );
- mpBrowser->SelectFoundHdl( NULL );
- GetParent()->LeaveWait();
-
- EndDialog( RET_OK );
- delete this;
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-short TakeProgress::Execute()
-{
- DBG_ERROR( "TakeProgress cannot be executed via Dialog::Execute!\n"
- "It creates a thread that will call back to VCL apartment => deadlock!\n"
- "Use Dialog::StartExecuteModal to execute the dialog!" );
- return RET_CANCEL;
-}
-
-// ------------------------------------------------------------------------
-
-void TakeProgress::StartExecuteModal( const Link& rEndDialogHdl )
-{
- maTakeThread.create();
- ModalDialog::StartExecuteModal( rEndDialogHdl );
-}
-
-// ---------------------
-// - ActualizeProgress -
-// ---------------------
-
-ActualizeProgress::ActualizeProgress( Window* pWindow, GalleryTheme* pThm ) :
- ModalDialog ( pWindow, GAL_RESID( RID_SVXDLG_GALLERY_ACTUALIZE_PROGRESS ) ),
- aFtActualizeFile ( this, GAL_RESID( FT_ACTUALIZE_FILE ) ),
- aFLActualizeProgress ( this, GAL_RESID( FL_ACTUALIZE_PROGRESS ) ),
- aBtnCancel ( this, GAL_RESID( BTN_CANCEL ) ),
- pTheme ( pThm )
-{
- FreeResource();
- aBtnCancel.SetClickHdl( LINK( this, ActualizeProgress, ClickCancelBtn ) );
-}
-
-// ------------------------------------------------------------------------
-
-short ActualizeProgress::Execute()
-{
- short nRet;
-
- pTimer = new Timer;
-
- if ( pTimer )
- {
- pTimer->SetTimeoutHdl( LINK( this, ActualizeProgress, TimeoutHdl ) );
- pTimer->SetTimeout( 500 );
- pTimer->Start();
- }
-
- nRet = ModalDialog::Execute();
-
- return nRet;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( ActualizeProgress, ClickCancelBtn, void*, EMPTYARG )
-{
- pTheme->AbortActualize();
- EndDialog( RET_OK );
-
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( ActualizeProgress, TimeoutHdl, Timer*, _pTimer )
-{
- if ( _pTimer )
- {
- _pTimer->Stop();
- delete _pTimer;
- }
-
- pTheme->Actualize( LINK( this, ActualizeProgress, ActualizeHdl ), &aStatusProgress );
- ClickCancelBtn( NULL );
-
- return 0;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( ActualizeProgress, ActualizeHdl, INetURLObject*, pURL )
-{
- for( long i = 0; i < 128; i++ )
- Application::Reschedule();
-
- Flush();
- Sync();
-
- if( pURL )
- {
- aFtActualizeFile.SetText( GetReducedString( *pURL, 30 ) );
- aFtActualizeFile.Flush();
- aFtActualizeFile.Sync();
- }
-
- return 0;
-}
-
-// ---------------
-// - TitleDialog -
-// ---------------
-
-TitleDialog::TitleDialog( Window* pParent, const String& rOldTitle ) :
- ModalDialog ( pParent, GAL_RESID( RID_SVXDLG_GALLERY_TITLE ) ),
- maOk ( this, GAL_RESID( BTN_OK ) ),
- maCancel ( this, GAL_RESID( BTN_CANCEL ) ),
- maHelp ( this, GAL_RESID( BTN_HELP ) ),
- maFL ( this, GAL_RESID( FL_TITLE ) ),
- maEdit ( this, GAL_RESID( EDT_TITLE ) )
-{
- FreeResource();
- maEdit.SetText( rOldTitle );
- maEdit.GrabFocus();
-}
-
-// -------------------
-// - GalleryIdDialog -
-// -------------------
-
-GalleryIdDialog::GalleryIdDialog( Window* pParent, GalleryTheme* _pThm ) :
- ModalDialog ( pParent, GAL_RESID( RID_SVXDLG_GALLERY_THEMEID ) ),
- aBtnOk ( this, GAL_RESID( BTN_OK ) ),
- aBtnCancel ( this, GAL_RESID( BTN_CANCEL ) ),
- aFLId ( this, GAL_RESID( FL_ID ) ),
- aLbResName ( this, GAL_RESID( LB_RESNAME ) ),
- pThm ( _pThm )
-{
- FreeResource();
-
- aLbResName.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "!!! No Id !!!" ) ) );
-
- for( USHORT i = RID_GALLERYSTR_THEME_FIRST; i <= RID_GALLERYSTR_THEME_LAST; i++ )
- aLbResName.InsertEntry( String( GAL_RESID( i ) ) );
-
- aLbResName.SelectEntryPos( (USHORT) pThm->GetId() );
- aLbResName.GrabFocus();
-
- aBtnOk.SetClickHdl( LINK( this, GalleryIdDialog, ClickOkHdl ) );
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GalleryIdDialog, ClickOkHdl, void*, EMPTYARG )
-{
- Gallery* pGal = pThm->GetParent();
- const ULONG nId = GetId();
- BOOL bDifferentThemeExists = FALSE;
-
- for( ULONG i = 0, nCount = pGal->GetThemeCount(); i < nCount && !bDifferentThemeExists; i++ )
- {
- const GalleryThemeEntry* pInfo = pGal->GetThemeInfo( i );
-
- if( ( pInfo->GetId() == nId ) && ( pInfo->GetThemeName() != pThm->GetName() ) )
- {
- String aStr( GAL_RESID( RID_SVXSTR_GALLERY_ID_EXISTS ) );
-
- aStr += String( RTL_CONSTASCII_USTRINGPARAM( " (" ) );
- aStr += pInfo->GetThemeName();
- aStr += ')';
-
- InfoBox aBox( this, aStr );
- aBox.Execute();
- aLbResName.GrabFocus();
- bDifferentThemeExists = TRUE;
- }
- }
-
- if( !bDifferentThemeExists )
- EndDialog( RET_OK );
-
- return 0L;
-}
-
-
-// --------------------------
-// - GalleryThemeProperties -
-// --------------------------
-
-GalleryThemeProperties::GalleryThemeProperties( Window* pParent, ExchangeData* _pData, SfxItemSet* pItemSet ) :
- SfxTabDialog ( pParent, GAL_RESID( RID_SVXTABDLG_GALLERYTHEME ), pItemSet ),
- pData ( _pData )
-{
- FreeResource();
-
- AddTabPage( RID_SVXTABPAGE_GALLERY_GENERAL, TPGalleryThemeGeneral::Create, 0 );
- AddTabPage( RID_SVXTABPAGE_GALLERYTHEME_FILES, TPGalleryThemeProperties::Create, 0 );
-
- if( pData->pTheme->IsReadOnly() )
- RemoveTabPage( RID_SVXTABPAGE_GALLERYTHEME_FILES );
-
- String aText( GetText() );
-
- aText += pData->pTheme->GetName();
-
- if( pData->pTheme->IsReadOnly() )
- aText += String( GAL_RESID( RID_SVXSTR_GALLERY_READONLY ) );
-
- SetText( aText );
-}
-
-// ------------------------------------------------------------------------
-
-void GalleryThemeProperties::PageCreated( USHORT nId, SfxTabPage &rPage )
-{
- if( RID_SVXTABPAGE_GALLERY_GENERAL == nId )
- ( (TPGalleryThemeGeneral&) rPage ).SetXChgData( pData );
- else
- ( (TPGalleryThemeProperties&) rPage ).SetXChgData( pData );
-}
-
-// -------------------------
-// - TPGalleryThemeGeneral -
-// -------------------------
-
-TPGalleryThemeGeneral::TPGalleryThemeGeneral( Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage ( pParent, GAL_RESID( RID_SVXTABPAGE_GALLERY_GENERAL ), rSet ),
- aFiMSImage ( this, GAL_RESID( FI_MS_IMAGE ) ),
- aEdtMSName ( this, GAL_RESID( EDT_MS_NAME ) ),
- aFlMSGeneralFirst ( this, GAL_RESID( FL_MS_GENERAL_FIRST ) ),
- aFtMSType ( this, GAL_RESID( FT_MS_TYPE ) ),
- aFtMSShowType ( this, GAL_RESID( FT_MS_SHOW_TYPE ) ),
- aFtMSPath ( this, GAL_RESID( FT_MS_PATH ) ),
- aFtMSShowPath ( this, GAL_RESID( FT_MS_SHOW_PATH ) ),
- aFtMSContent ( this, GAL_RESID( FT_MS_CONTENT ) ),
- aFtMSShowContent ( this, GAL_RESID( FT_MS_SHOW_CONTENT ) ),
- aFlMSGeneralSecond ( this, GAL_RESID( FL_MS_GENERAL_SECOND ) ),
- aFtMSChangeDate ( this, GAL_RESID( FT_MS_CHANGEDATE ) ),
- aFtMSShowChangeDate ( this, GAL_RESID( FT_MS_SHOW_CHANGEDATE ) )
-{
- FreeResource();
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
-{
- pData = _pData;
-
- GalleryTheme* pThm = pData->pTheme;
- String aOutStr( String::CreateFromInt32( pThm->GetObjectCount() ) );
- String aObjStr( GAL_RESID( RID_SVXSTR_GALLERYPROPS_OBJECT ) );
- String aAccess;
- String aType( GAL_RESID( RID_SVXSTR_GALLERYPROPS_GALTHEME ) );
- BOOL bReadOnly = pThm->IsReadOnly() && !pThm->IsImported();
-
- aEdtMSName.SetHelpId( HID_GALLERY_EDIT_MSNAME );
- aEdtMSName.SetText( pThm->GetName() );
- aEdtMSName.SetReadOnly( bReadOnly );
-
- if( bReadOnly )
- aEdtMSName.Disable();
- else
- aEdtMSName.Enable();
-
- if( pThm->IsReadOnly() )
- aType += String( GAL_RESID( RID_SVXSTR_GALLERY_READONLY ) );
-
- aFtMSShowType.SetText( aType );
- aFtMSShowPath.SetText( pThm->GetSdgURL().GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
-
- // Ein- oder Mehrzahl?
- if ( 1 == pThm->GetObjectCount() )
- aObjStr = aObjStr.GetToken( 0 );
- else
- aObjStr = aObjStr.GetToken( 1 );
-
- aOutStr += ' ';
- aOutStr += aObjStr;
-
- aFtMSShowContent.SetText( aOutStr );
-
- // get locale wrapper (singleton)
- const LocaleDataWrapper& aLocaleData = SvtSysLocale().GetLocaleData();
-
- // ChangeDate/Time
- aAccess = aLocaleData.getDate( pData->aThemeChangeDate );
- aAccess += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) );
- aAccess += aLocaleData.getTime( pData->aThemeChangeTime );
- aFtMSShowChangeDate.SetText( aAccess );
-
- // Image setzen
- USHORT nId;
-
- if( pThm->IsImported() )
- nId = RID_SVXBMP_THEME_IMPORTED_BIG;
- else if( pThm->IsReadOnly() )
- nId = RID_SVXBMP_THEME_READONLY_BIG;
- else if( pThm->IsDefault() )
- nId = RID_SVXBMP_THEME_DEFAULT_BIG;
- else
- nId = RID_SVXBMP_THEME_NORMAL_BIG;
-
- aFiMSImage.SetImage( Image( Bitmap( GAL_RESID( nId ) ), COL_LIGHTMAGENTA ) );
-}
-
-// ------------------------------------------------------------------------
-
-BOOL TPGalleryThemeGeneral::FillItemSet( SfxItemSet& /*rSet*/ )
-{
- pData->aEditedTitle = aEdtMSName.GetText();
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-SfxTabPage* TPGalleryThemeGeneral::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new TPGalleryThemeGeneral( pParent, rSet );
-}
-
-// ----------------------------
-// - TPGalleryThemeProperties -
-// ----------------------------
-
-TPGalleryThemeProperties::TPGalleryThemeProperties( Window* pWindow, const SfxItemSet& rSet ) :
- SfxTabPage ( pWindow, GAL_RESID( RID_SVXTABPAGE_GALLERYTHEME_FILES ), rSet ),
- aBtnSearch ( this, GAL_RESID(BTN_SEARCH ) ),
- aBtnTake ( this, GAL_RESID(BTN_TAKE ) ),
- aBtnTakeAll ( this, GAL_RESID(BTN_TAKEALL ) ),
- aCbxPreview ( this, GAL_RESID(CBX_PREVIEW ) ),
- aCbbFileType ( this, GAL_RESID(CBB_FILETYPE ) ),
- aLbxFound ( this, GAL_RESID(LBX_FOUND ) ),
- aFtFileType ( this, GAL_RESID(FT_FILETYPE ) ),
- aWndPreview ( this, GAL_RESID( WND_BRSPRV ) ),
- nCurFilterPos (0),
- nFirstExtFilterPos (0),
- bEntriesFound (FALSE),
- bInputAllowed (TRUE),
- bSearchRecursive (FALSE),
- xDialogListener ( new ::svt::DialogClosedListener() )
-{
- FreeResource();
-
- xDialogListener->SetDialogClosedLink( LINK( this, TPGalleryThemeProperties, DialogClosedHdl ) );
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeProperties::SetXChgData( ExchangeData* _pData )
-{
- pData = _pData;
-
- aPreviewTimer.SetTimeoutHdl( LINK( this, TPGalleryThemeProperties, PreviewTimerHdl ) );
- aPreviewTimer.SetTimeout( 500 );
- aBtnSearch.SetClickHdl(LINK(this, TPGalleryThemeProperties, ClickSearchHdl));
- aBtnTake.SetClickHdl(LINK(this, TPGalleryThemeProperties, ClickTakeHdl));
- aBtnTakeAll.SetClickHdl(LINK(this, TPGalleryThemeProperties, ClickTakeAllHdl));
- aCbxPreview.SetClickHdl(LINK(this, TPGalleryThemeProperties, ClickPreviewHdl));
- aCbbFileType.SetSelectHdl(LINK(this, TPGalleryThemeProperties, SelectFileTypeHdl));
- aCbbFileType.EnableDDAutoWidth( sal_False );
- aLbxFound.SetDoubleClickHdl(LINK(this, TPGalleryThemeProperties, DClickFoundHdl));
- aLbxFound.SetSelectHdl(LINK(this, TPGalleryThemeProperties, SelectFoundHdl));
- aLbxFound.InsertEntry(String(GAL_RESID(RID_SVXSTR_GALLERY_NOFILES)));
- aLbxFound.Show();
-
- FillFilterList();
-
- aBtnTake.Enable();
- aBtnTakeAll.Disable();
- aCbxPreview.Disable();
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeProperties::StartSearchFiles( const String& _rFolderURL, short _nDlgResult )
-{
- if ( RET_OK == _nDlgResult )
- {
- aURL = INetURLObject( _rFolderURL );
- bSearchRecursive = sal_True; // UI choice no longer possible, windows file picker allows no user controls
- SearchFiles();
- }
-
- nCurFilterPos = aCbbFileType.GetEntryPos( aCbbFileType.GetText() );
-}
-
-// ------------------------------------------------------------------------
-
-TPGalleryThemeProperties::~TPGalleryThemeProperties()
-{
- xMediaPlayer.clear();
- xDialogListener.clear();
-
- for( String* pStr = aFoundList.First(); pStr; pStr = aFoundList.Next() )
- delete pStr;
-
- for( void* pEntry = aFilterEntryList.First(); pEntry; pEntry = aFilterEntryList.Next() )
- delete (FilterEntry*) pEntry;
-}
-
-// ------------------------------------------------------------------------
-
-SfxTabPage* TPGalleryThemeProperties::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new TPGalleryThemeProperties( pParent, rSet );
-}
-
-// ------------------------------------------------------------------------
-
-::rtl::OUString TPGalleryThemeProperties::addExtension( const ::rtl::OUString& _rDisplayText, const ::rtl::OUString& _rExtension )
-{
- ::rtl::OUString sAllFilter( RTL_CONSTASCII_USTRINGPARAM( "(*.*)" ) );
- ::rtl::OUString sOpenBracket( RTL_CONSTASCII_USTRINGPARAM( " (" ) );
- ::rtl::OUString sCloseBracket( RTL_CONSTASCII_USTRINGPARAM( ")" ) );
- ::rtl::OUString sRet = _rDisplayText;
-
- if ( sRet.indexOf( sAllFilter ) == -1 )
- {
- String sExt = _rExtension;
- sRet += sOpenBracket;
- sRet += sExt;
- sRet += sCloseBracket;
- }
- return sRet;
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeProperties::FillFilterList()
-{
- GraphicFilter* pFilter = GetGrfFilter();
- String aExt;
- String aName;
- FilterEntry* pFilterEntry;
- FilterEntry* pTestEntry;
- sal_uInt16 i, nKeyCount;
- BOOL bInList;
-
- // graphic filters
- for( i = 0, nKeyCount = pFilter->GetImportFormatCount(); i < nKeyCount; i++ )
- {
- aExt = pFilter->GetImportFormatShortName( i );
- aName = pFilter->GetImportFormatName( i );
- pTestEntry = (FilterEntry*) aFilterEntryList.First();
- bInList = FALSE;
-
- String aExtensions;
- int j = 0;
- String sWildcard;
- while( TRUE )
- {
- sWildcard = pFilter->GetImportWildcard( i, j++ );
- if ( !sWildcard.Len() )
- break;
- if ( aExtensions.Search( sWildcard ) == STRING_NOTFOUND )
- {
- if ( aExtensions.Len() )
- aExtensions += sal_Unicode(';');
- aExtensions += sWildcard;
- }
- }
- aName = addExtension( aName, aExtensions );
-
- while( pTestEntry )
- {
- if ( pTestEntry->aFilterName == aExt )
- {
- bInList = TRUE;
- break;
- }
- pTestEntry = (FilterEntry*) aFilterEntryList.Next();
- }
- if ( !bInList )
- {
- pFilterEntry = new FilterEntry;
- pFilterEntry->aFilterName = aExt;
- aFilterEntryList.Insert( pFilterEntry, aCbbFileType.InsertEntry( aName ) );
- }
- }
-
- // media filters
- static const ::rtl::OUString aWildcard( RTL_CONSTASCII_USTRINGPARAM( "*." ) );
- ::avmedia::FilterNameVector aFilters;
- const ::rtl::OUString aSeparator( RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- ::rtl::OUString aAllTypes;
-
- ::avmedia::MediaWindow::getMediaFilters( aFilters );
-
- for( unsigned long l = 0; l < aFilters.size(); ++l )
- {
- for( sal_Int32 nIndex = 0; nIndex >= 0; )
- {
- ::rtl::OUString aFilterWildcard( aWildcard );
-
- pFilterEntry = new FilterEntry;
- pFilterEntry->aFilterName = aFilters[ l ].second.getToken( 0, ';', nIndex );
- nFirstExtFilterPos = aCbbFileType.InsertEntry( addExtension( aFilters[ l ].first,
- aFilterWildcard += pFilterEntry->aFilterName ) );
- aFilterEntryList.Insert( pFilterEntry, nFirstExtFilterPos );
- }
- }
-
- // 'All' filters
- String aExtensions;
-
- // graphic filters
- for ( i = 0; i < nKeyCount; ++i )
- {
- int j = 0;
- String sWildcard;
- while( TRUE )
- {
- sWildcard = pFilter->GetImportWildcard( i, j++ );
- if ( !sWildcard.Len() )
- break;
- if ( aExtensions.Search( sWildcard ) == STRING_NOTFOUND )
- {
- if ( aExtensions.Len() )
- aExtensions += sal_Unicode( ';' );
-
- aExtensions += sWildcard;
- }
- }
- }
-
- // media filters
- for( unsigned long k = 0; k < aFilters.size(); ++k )
- {
- for( sal_Int32 nIndex = 0; nIndex >= 0; )
- {
- if ( aExtensions.Len() )
- aExtensions += sal_Unicode( ';' );
- ( aExtensions += String( aWildcard ) ) += String( aFilters[ k ].second.getToken( 0, ';', nIndex ) );
- }
- }
-
-#if defined(WIN) || defined(WNT)
- if ( aExtensions.Len() > 240 )
- aExtensions = DEFINE_CONST_UNICODE( "*.*" );
-#endif
-
- pFilterEntry = new FilterEntry;
- pFilterEntry->aFilterName = String( GAL_RESID( RID_SVXSTR_GALLERY_ALLFILES ) );
- pFilterEntry->aFilterName = addExtension( pFilterEntry->aFilterName, aExtensions );
- aFilterEntryList.Insert(pFilterEntry, aCbbFileType. InsertEntry( pFilterEntry->aFilterName, 0 ) );
-
- aCbbFileType.SetText( pFilterEntry->aFilterName );
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, SelectFileTypeHdl, void *, EMPTYARG )
-{
- String aText( aCbbFileType.GetText() );
-
- if( bInputAllowed && ( aLastFilterName != aText ) )
- {
- aLastFilterName = aText;
-
- if( QueryBox( this, WB_YES_NO, String( GAL_RESID( RID_SVXSTR_GALLERY_SEARCH ) ) ).Execute() == RET_YES )
- SearchFiles();
- }
-
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeProperties::SearchFiles()
-{
- SearchProgress* pProgress = new SearchProgress( this, aURL );
-
- for( String* pStr = aFoundList.First(); pStr; pStr = aFoundList.Next() )
- delete pStr;
-
- aFoundList.Clear();
- aLbxFound.Clear();
-
- pProgress->SetFileType( aCbbFileType.GetText() );
- pProgress->SetDirectory( rtl::OUString() );
- pProgress->Update();
-
- pProgress->StartExecuteModal( LINK( this, TPGalleryThemeProperties, EndSearchProgressHdl ) );
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, ClickCloseBrowserHdl, void *, EMPTYARG )
-{
- if( bInputAllowed )
- aPreviewTimer.Stop();
-
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, ClickSearchHdl, void *, EMPTYARG )
-{
- if( bInputAllowed )
- {
- try
- {
- // setup folder picker
- ::com::sun::star::uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- if( xMgr.is() )
- {
- xFolderPicker = ::com::sun::star::uno::Reference< XFolderPicker >(
- xMgr->createInstance( OUString::createFromAscii( "com.sun.star.ui.dialogs.FolderPicker" )), UNO_QUERY );
-
- if ( xFolderPicker.is() )
- {
-// svt::SetDialogHelpId( xFolderPicker, HID_GALLERY_NEWTHEME_FINDFILES );
- String aDlgPathName( SvtPathOptions().GetGraphicPath() );
- xFolderPicker->setDisplayDirectory(aDlgPathName);
-
- aPreviewTimer.Stop();
-
- ::com::sun::star::uno::Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY );
- if ( xAsyncDlg.is() )
- xAsyncDlg->startExecuteModal( xDialogListener.get() );
- else
- {
- if( xFolderPicker->execute() == RET_OK )
- {
- aURL = INetURLObject( xFolderPicker->getDirectory() );
- bSearchRecursive = sal_True; // UI choice no longer possible, windows file picker allows no user controls
- SearchFiles();
- }
-
- nCurFilterPos = aCbbFileType.GetEntryPos( aCbbFileType.GetText() );
- }
- }
- }
- }
- catch(IllegalArgumentException)
- {
-#ifdef DBG_UTIL
- DBG_ERROR( "Folder picker failed with illegal arguments" );
-#endif
- }
- }
-
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeProperties::TakeFiles()
-{
- if( aLbxFound.GetSelectEntryCount() || ( bTakeAll && bEntriesFound ) )
- {
- TakeProgress* pTakeProgress = new TakeProgress( this );
- pTakeProgress->Update();
-
- pTakeProgress->StartExecuteModal(
- Link() /* no postprocessing needed, pTakeProgress
- will be deleted in TakeProgress::CleanupHdl */ );
- }
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, ClickPreviewHdl, void *, EMPTYARG )
-{
- if ( bInputAllowed )
- {
- aPreviewTimer.Stop();
- aPreviewString.Erase();
-
- if( !aCbxPreview.IsChecked() )
- {
- xMediaPlayer.clear();
- aWndPreview.SetGraphic( Graphic() );
- aWndPreview.Invalidate();
- }
- else
- DoPreview();
- }
-
- return 0;
-}
-
-// ------------------------------------------------------------------------
-
-void TPGalleryThemeProperties::DoPreview()
-{
- String aString( aLbxFound.GetSelectEntry() );
-
- if( aString != aPreviewString )
- {
- Graphic aGraphic;
- INetURLObject _aURL( *aFoundList.GetObject( aLbxFound.GetEntryPos( aString ) ) );
-
- bInputAllowed = FALSE;
-
- if( ::avmedia::MediaWindow::isMediaURL( _aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) )
- {
- aGraphic = BitmapEx( GAL_RESID( RID_SVXBMP_GALLERY_MEDIA ) );
- xMediaPlayer = ::avmedia::MediaWindow::createPlayer( _aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- if( xMediaPlayer.is() )
- xMediaPlayer->start();
- }
- else
- {
- GraphicFilter* pFilter = GetGrfFilter();
- GalleryProgress aProgress( pFilter );
-
- if( pFilter->ImportGraphic( aGraphic, _aURL, GRFILTER_FORMAT_DONTKNOW ) )
- {
- GetParent()->LeaveWait();
- ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTSPATH );
- GetParent()->EnterWait();
- }
- }
-
- aWndPreview.SetGraphic( aGraphic );
- aWndPreview.Invalidate();
- bInputAllowed = TRUE;
- aPreviewString = aString;
- }
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, ClickTakeHdl, void*, EMPTYARG )
-{
- if( bInputAllowed )
- {
- aPreviewTimer.Stop();
-
- if( !aLbxFound.GetSelectEntryCount() || !bEntriesFound )
- {
- SvxOpenGraphicDialog aDlg(String( RTL_CONSTASCII_USTRINGPARAM( "Gallery" ) ) );
-// aDlg.SetDialogHelpId( HID_GALLERY_NEWTHEME_ADDFILES );
- aDlg.EnableLink(sal_False);
- aDlg.AsLink(sal_False);
-
- if( !aDlg.Execute() )
- pData->pTheme->InsertURL( INetURLObject( aDlg.GetPath() ) );
- }
- else
- {
- bTakeAll = FALSE;
- TakeFiles();
- }
- }
-
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, ClickTakeAllHdl, void *, EMPTYARG )
-{
- if( bInputAllowed )
- {
- aPreviewTimer.Stop();
- bTakeAll = TRUE;
- TakeFiles();
- }
-
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, SelectFoundHdl, void *, EMPTYARG )
-{
- if( bInputAllowed )
- {
- BOOL bPreviewPossible = FALSE;
-
- aPreviewTimer.Stop();
-
- if( bEntriesFound )
- {
- if( aLbxFound.GetSelectEntryCount() == 1 )
- {
- aCbxPreview.Enable();
- bPreviewPossible = TRUE;
- }
- else
- aCbxPreview.Disable();
-
- if( aFoundList.Count() )
- aBtnTakeAll.Enable();
- else
- aBtnTakeAll.Disable();
- }
-
- if( bPreviewPossible && aCbxPreview.IsChecked() )
- aPreviewTimer.Start();
- }
-
- return 0;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, DClickFoundHdl, void *, EMPTYARG )
-{
- if( bInputAllowed )
- {
- aPreviewTimer.Stop();
-
- return (aLbxFound.GetSelectEntryCount() == 1 && bEntriesFound) ?
- ClickTakeHdl(NULL) : 0;
- }
- else
- return 0;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, PreviewTimerHdl, void *, EMPTYARG )
-{
- aPreviewTimer.Stop();
- DoPreview();
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, EndSearchProgressHdl, SearchProgress *, EMPTYARG )
-{
- if( aFoundList.Count() )
- {
- aLbxFound.SelectEntryPos( 0 );
- aBtnTakeAll.Enable();
- aCbxPreview.Enable();
- bEntriesFound = TRUE;
- }
- else
- {
- aLbxFound.InsertEntry( String( GAL_RESID( RID_SVXSTR_GALLERY_NOFILES ) ) );
- aBtnTakeAll.Disable();
- aCbxPreview.Disable();
- bEntriesFound = FALSE;
- }
- return 0L;
-}
-
-// ------------------------------------------------------------------------
-
-IMPL_LINK( TPGalleryThemeProperties, DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent*, pEvt )
-{
- DBG_ASSERT( xFolderPicker.is() == sal_True, "TPGalleryThemeProperties::DialogClosedHdl(): no folder picker" );
-
- String sURL = String( xFolderPicker->getDirectory() );
- StartSearchFiles( sURL, pEvt->DialogResult );
-
- return 0L;
-}
-
diff --git a/svx/source/cui/cuigaldlg.hxx b/svx/source/cui/cuigaldlg.hxx
deleted file mode 100644
index 5290fd1cc2..0000000000
--- a/svx/source/cui/cuigaldlg.hxx
+++ /dev/null
@@ -1,377 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuigaldlg.hxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CUI_GALDLG_HXX_
-#define _CUI_GALDLG_HXX_
-
-#include <vos/thread.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/graph.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/combobox.hxx>
-#include <svtools/slstitm.hxx>
-#include <svtools/transfer.hxx>
-#include <goodies/grfmgr.hxx>
-#include <sfx2/tabdlg.hxx>
-#include "galctrl.hxx"
-#include "galmisc.hxx"
-#include "galdlg.hxx" //CHINA001
-#include <com/sun/star/media/XPlayer.hpp>
-#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
-#include <svtools/dialogclosedlistener.hxx>
-
-// ------------
-// - Forwards -
-// ------------
-
-class Gallery;
-class GalleryTheme;
-class SearchProgress;
-class TakeProgress;
-class TPGalleryThemeProperties;
-
-// ---------------
-// - FilterEntry -
-// ---------------
-
-struct FilterEntry
-{
- String aFilterName;
-};
-
-// ----------------
-// - SearchThread -
-// ----------------
-
-class SearchThread : public ::vos::OThread
-{
-private:
-
- SearchProgress* mpProgress;
- TPGalleryThemeProperties* mpBrowser;
- INetURLObject maStartURL;
-
- void ImplSearch( const INetURLObject& rStartURL,
- const ::std::vector< String >& rFormats,
- BOOL bRecursive );
-
- virtual void SAL_CALL run();
- virtual void SAL_CALL onTerminated();
-
-public:
-
- SearchThread( SearchProgress* pProgess,
- TPGalleryThemeProperties* pBrowser,
- const INetURLObject& rStartURL );
- virtual ~SearchThread();
-};
-
-// ------------------
-// - SearchProgress -
-// ------------------
-
-class SearchProgress : public ModalDialog
-{
-private:
-
- FixedText aFtSearchDir;
- FixedLine aFLSearchDir;
- FixedText aFtSearchType;
- FixedLine aFLSearchType;
- CancelButton aBtnCancel;
- SearchThread maSearchThread;
-
- DECL_LINK( ClickCancelBtn, void* );
- void Terminate();
-
-public:
- SearchProgress( Window* pParent, const INetURLObject& rStartURL );
- ~SearchProgress() {};
-
- DECL_LINK( CleanUpHdl, void* );
-
- virtual short Execute();
- virtual void StartExecuteModal( const Link& rEndDialogHdl );
- void SetFileType( const String& rType ) { aFtSearchType.SetText( rType ); }
- void SetDirectory( const INetURLObject& rURL ) { aFtSearchDir.SetText( GetReducedString( rURL, 30 ) ); }
-};
-
-// --------------
-// - TakeThread -
-// --------------
-
-class TakeThread : public ::vos::OThread
-{
-private:
-
- TakeProgress* mpProgress;
- TPGalleryThemeProperties* mpBrowser;
- List& mrTakenList;
-
- virtual void SAL_CALL run();
- virtual void SAL_CALL onTerminated();
-
-public:
-
- TakeThread( TakeProgress* pProgess, TPGalleryThemeProperties* pBrowser, List& rTakenList );
- virtual ~TakeThread();
-};
-
-// ----------------
-// - TakeProgress -
-// ----------------
-
-class TakeProgress : public ModalDialog
-{
-private:
-
- FixedText aFtTakeFile;
- FixedLine aFLTakeProgress;
- CancelButton aBtnCancel;
- TakeThread maTakeThread;
- List maTakenList;
-
- DECL_LINK( ClickCancelBtn, void* );
- void Terminate();
-
-public:
-
- TakeProgress( Window* pWindow );
- ~TakeProgress() {};
-
- DECL_LINK( CleanUpHdl, void* );
-
- void SetFile( const INetURLObject& rURL ) { aFtTakeFile.SetText( GetReducedString( rURL, 30 ) ); }
- virtual short Execute();
- virtual void StartExecuteModal( const Link& rEndDialogHdl );
-};
-
-// ---------------------
-// - ActualizeProgress -
-// ---------------------
-
-class ActualizeProgress : public ModalDialog
-{
-private:
-
- FixedText aFtActualizeFile;
- FixedLine aFLActualizeProgress;
- CancelButton aBtnCancel;
- Timer* pTimer;
- GalleryTheme* pTheme;
- GalleryProgress aStatusProgress;
-
- DECL_LINK( ClickCancelBtn, void* );
- DECL_LINK( TimeoutHdl, Timer* );
- DECL_LINK( ActualizeHdl, INetURLObject* pURL );
-
-public:
- ActualizeProgress( Window* pWindow, GalleryTheme* pThm );
- ~ActualizeProgress() {};
-
- virtual short Execute();
-};
-
-// ---------------
-// - TitleDialog -
-// ---------------
-
-class TitleDialog : public ModalDialog
-{
-private:
-
- OKButton maOk;
- CancelButton maCancel;
- HelpButton maHelp;
- FixedLine maFL;
- Edit maEdit;
-
-public:
-
- TitleDialog( Window* pParent, const String& rOldText );
- String GetTitle() const { return maEdit.GetText(); }
-};
-
-// -------------------
-// - GalleryIdDialog -
-// -------------------
-
-class GalleryIdDialog : public ModalDialog
-{
-private:
-
- OKButton aBtnOk;
- CancelButton aBtnCancel;
- FixedLine aFLId;
- ListBox aLbResName;
- GalleryTheme* pThm;
-
- DECL_LINK( ClickOkHdl, void* );
- DECL_LINK( ClickResNameHdl, void* );
-
-public:
-
- GalleryIdDialog( Window* pParent, GalleryTheme* pThm );
- ~GalleryIdDialog() {}
-
- ULONG GetId() const { return aLbResName.GetSelectEntryPos(); }
-};
-
-// --------------------------
-// - GalleryThemeProperties -
-// --------------------------
-
-class GalleryThemeProperties : public SfxTabDialog
-{
- ExchangeData* pData;
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-public:
-
- GalleryThemeProperties( Window* pParent, ExchangeData* pData, SfxItemSet* pItemSet );
- ~GalleryThemeProperties() {}
-};
-
-// -------------------------
-// - TPGalleryThemeGeneral -
-// -------------------------
-
-class TPGalleryThemeGeneral : public SfxTabPage
-{
-private:
-
- FixedImage aFiMSImage;
- Edit aEdtMSName;
- FixedLine aFlMSGeneralFirst;
- FixedText aFtMSType;
- FixedText aFtMSShowType;
- FixedText aFtMSPath;
- FixedText aFtMSShowPath;
- FixedText aFtMSContent;
- FixedText aFtMSShowContent;
- FixedLine aFlMSGeneralSecond;
- FixedText aFtMSChangeDate;
- FixedText aFtMSShowChangeDate;
- ExchangeData* pData;
-
- virtual void Reset( const SfxItemSet& ) {}
- virtual BOOL FillItemSet( SfxItemSet& rSet );
-
-
-public:
-
- TPGalleryThemeGeneral( Window* pParent, const SfxItemSet& rSet );
- ~TPGalleryThemeGeneral() {}
-
- void SetXChgData( ExchangeData* pData );
- const ExchangeData* GetXChgData() const { return pData; }
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
-};
-
-// ----------------------------
-// - TPGalleryThemeProperties -
-// ----------------------------
-
-class TPGalleryThemeProperties : public SfxTabPage
-{
- friend class SearchThread;
- friend class TakeProgress;
- friend class TakeThread;
-
- PushButton aBtnSearch;
- PushButton aBtnTake;
- PushButton aBtnTakeAll;
- CheckBox aCbxPreview;
- ComboBox aCbbFileType;
- MultiListBox aLbxFound;
- FixedText aFtFileType;
- GalleryPreview aWndPreview;
-
- ExchangeData* pData;
- StringList aFoundList;
- List aFilterEntryList;
- Timer aPreviewTimer;
- String aLastFilterName;
- String aPreviewString;
- INetURLObject aURL;
- USHORT nCurFilterPos;
- USHORT nFirstExtFilterPos;
- BOOL bEntriesFound;
- BOOL bInputAllowed;
- BOOL bTakeAll;
- BOOL bSearchRecursive;
-
- ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
- ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > xMediaPlayer;
- ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker;
-
- virtual void Reset( const SfxItemSet& /*rSet*/ ) {}
- virtual BOOL FillItemSet( SfxItemSet& /*rSet*/ ) { return TRUE; }
- ::rtl::OUString addExtension( const ::rtl::OUString&, const ::rtl::OUString& );
- void FillFilterList();
-
- void SearchFiles();
- void TakeFiles();
- void DoPreview();
-
- DECL_LINK( ClickPreviewHdl, void* );
- DECL_LINK( ClickCloseBrowserHdl, void* );
- DECL_LINK( ClickSearchHdl, void* );
- DECL_LINK( ClickTakeHdl, void* );
- DECL_LINK( ClickTakeAllHdl, void* );
- DECL_LINK( SelectFoundHdl, void* );
- DECL_LINK( SelectThemeHdl, void* );
- DECL_LINK( SelectFileTypeHdl, void* );
- DECL_LINK( DClickFoundHdl, void* );
- DECL_LINK( PreviewTimerHdl, void* );
- DECL_LINK( EndSearchProgressHdl, SearchProgress* );
- DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
-
-public:
- TPGalleryThemeProperties( Window* pWindow, const SfxItemSet& rSet );
- ~TPGalleryThemeProperties();
-
- void SetXChgData( ExchangeData* pData );
- const ExchangeData* GetXChgData() const { return pData; }
-
- void StartSearchFiles( const String& _rFolderURL, short _nDlgResult );
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
-};
-
-#endif // _CUI_GALDLG_HXX_
diff --git a/svx/source/cui/cuigrfflt.cxx b/svx/source/cui/cuigrfflt.cxx
deleted file mode 100644
index 39c4e44e31..0000000000
--- a/svx/source/cui/cuigrfflt.cxx
+++ /dev/null
@@ -1,762 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuigrfflt.cxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/request.hxx>
-
-#include <svx/dialmgr.hxx>
-#include "cuigrfflt.hxx"
-#include "grfflt.hrc"
-#include <svx/dialogs.hrc>
-
-// --------------------
-// - SvxGraphicFilter -
-// --------------------
-/*
-ULONG SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObject& rFilterObject )
-{
- const Graphic& rGraphic = rFilterObject.GetGraphic();
- ULONG nRet;
-
- if( rGraphic.GetType() == GRAPHIC_BITMAP )
- {
- SfxViewFrame* pViewFrame = SfxViewFrame::Current();
- SfxObjectShell* pShell = pViewFrame ? pViewFrame->GetObjectShell() : NULL;
- Window* pWindow = ( pViewFrame && pViewFrame->GetViewShell() ) ? pViewFrame->GetViewShell()->GetWindow() : NULL;
- Graphic aGraphic;
-
- switch( rReq.GetSlot() )
- {
- case( SID_GRFFILTER_INVERT ):
- {
- if( pShell )
- pShell->SetWaitCursor( TRUE );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnimation( rGraphic.GetAnimation() );
-
- if( aAnimation.Invert() )
- aGraphic = aAnimation;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Invert() )
- aGraphic = aBmpEx;
- }
-
- if( pShell )
- pShell->SetWaitCursor( FALSE );
- }
- break;
-
- case( SID_GRFFILTER_SMOOTH ):
- {
- if( pShell )
- pShell->SetWaitCursor( TRUE );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnimation( rGraphic.GetAnimation() );
-
- if( aAnimation.Filter( BMP_FILTER_SMOOTH ) )
- aGraphic = aAnimation;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SMOOTH ) )
- aGraphic = aBmpEx;
- }
-
- if( pShell )
- pShell->SetWaitCursor( FALSE );
- }
- break;
-
- case( SID_GRFFILTER_SHARPEN ):
- {
- if( pShell )
- pShell->SetWaitCursor( TRUE );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnimation( rGraphic.GetAnimation() );
-
- if( aAnimation.Filter( BMP_FILTER_SHARPEN ) )
- aGraphic = aAnimation;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SHARPEN ) )
- aGraphic = aBmpEx;
- }
-
- if( pShell )
- pShell->SetWaitCursor( FALSE );
- }
- break;
-
- case( SID_GRFFILTER_REMOVENOISE ):
- {
- if( pShell )
- pShell->SetWaitCursor( TRUE );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnimation( rGraphic.GetAnimation() );
-
- if( aAnimation.Filter( BMP_FILTER_REMOVENOISE ) )
- aGraphic = aAnimation;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_REMOVENOISE ) )
- aGraphic = aBmpEx;
- }
-
- if( pShell )
- pShell->SetWaitCursor( FALSE );
- }
- break;
-
- case( SID_GRFFILTER_SOBEL ):
- {
- if( pShell )
- pShell->SetWaitCursor( TRUE );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnimation( rGraphic.GetAnimation() );
-
- if( aAnimation.Filter( BMP_FILTER_SOBEL_GREY ) )
- aGraphic = aAnimation;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SOBEL_GREY ) )
- aGraphic = aBmpEx;
- }
-
- if( pShell )
- pShell->SetWaitCursor( FALSE );
- }
- break;
-
- case( SID_GRFFILTER_MOSAIC ):
- {
- GraphicFilterMosaic aDlg( pWindow, rGraphic, 4, 4, FALSE );
-
- if( aDlg.Execute() == RET_OK )
- aGraphic = aDlg.GetFilteredGraphic( rGraphic, 1.0, 1.0 );
- }
- break;
-
- case( SID_GRFFILTER_EMBOSS ):
- {
- GraphicFilterEmboss aDlg( pWindow, rGraphic, RP_MM );
-
- if( aDlg.Execute() == RET_OK )
- aGraphic = aDlg.GetFilteredGraphic( rGraphic, 1.0, 1.0 );
- }
- break;
-
- case( SID_GRFFILTER_POSTER ):
- {
- GraphicFilterPoster aDlg( pWindow, rGraphic, 16 );
-
- if( aDlg.Execute() == RET_OK )
- aGraphic = aDlg.GetFilteredGraphic( rGraphic, 1.0, 1.0 );
- }
- break;
-
- case( SID_GRFFILTER_POPART ):
- {
- if( pShell )
- pShell->SetWaitCursor( TRUE );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnimation( rGraphic.GetAnimation() );
-
- if( aAnimation.Filter( BMP_FILTER_POPART ) )
- aGraphic = aAnimation;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_POPART ) )
- aGraphic = aBmpEx;
- }
-
- if( pShell )
- pShell->SetWaitCursor( FALSE );
- }
- break;
-
- case( SID_GRFFILTER_SEPIA ):
- {
- GraphicFilterSepia aDlg( pWindow, rGraphic, 10 );
-
- if( aDlg.Execute() == RET_OK )
- aGraphic = aDlg.GetFilteredGraphic( rGraphic, 1.0, 1.0 );
- }
- break;
-
- case( SID_GRFFILTER_SOLARIZE ):
- {
- GraphicFilterSolarize aDlg( pWindow, rGraphic, 128, FALSE );
-
- if( aDlg.Execute() == RET_OK )
- aGraphic = aDlg.GetFilteredGraphic( rGraphic, 1.0, 1.0 );
- }
- break;
-
- default:
- {
- DBG_ERROR( "SvxGraphicFilter: selected filter slot not yet implemented" );
- nRet = SVX_GRAPHICFILTER_UNSUPPORTED_SLOT;
- }
- break;
- }
-
- if( aGraphic.GetType() != GRAPHIC_NONE )
- {
- rFilterObject.SetGraphic( aGraphic );
- nRet = SVX_GRAPHICFILTER_ERRCODE_NONE;
- }
- }
- else
- nRet = SVX_GRAPHICFILTER_UNSUPPORTED_GRAPHICTYPE;
-
- return nRet;
-}
-
-// -----------------------------------------------------------------------------
-
-void SvxGraphicFilter::DisableGraphicFilterSlots( SfxItemSet& rSet )
-{
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER ) )
- rSet.DisableItem( SID_GRFFILTER );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_INVERT ) )
- rSet.DisableItem( SID_GRFFILTER_INVERT );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SMOOTH ) )
- rSet.DisableItem( SID_GRFFILTER_SMOOTH );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SHARPEN ) )
- rSet.DisableItem( SID_GRFFILTER_SHARPEN );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_REMOVENOISE ) )
- rSet.DisableItem( SID_GRFFILTER_REMOVENOISE );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SOBEL ) )
- rSet.DisableItem( SID_GRFFILTER_SOBEL );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_MOSAIC ) )
- rSet.DisableItem( SID_GRFFILTER_MOSAIC );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_EMBOSS ) )
- rSet.DisableItem( SID_GRFFILTER_EMBOSS );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_POSTER ) )
- rSet.DisableItem( SID_GRFFILTER_POSTER );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_POPART ) )
- rSet.DisableItem( SID_GRFFILTER_POPART );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SEPIA ) )
- rSet.DisableItem( SID_GRFFILTER_SEPIA );
-
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SOLARIZE ) )
- rSet.DisableItem( SID_GRFFILTER_SOLARIZE );
-};
-*/
-// --------------------------------------
-// - GraphicFilterDialog::PreviewWindow -
-// --------------------------------------
-
-GraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId& rResId ) :
- Control( pParent, rResId )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterDialog::PreviewWindow::~PreviewWindow()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
-{
- Control::Paint( rRect );
-
- const Size aGrfSize( LogicToPixel( maGraphic.GetPrefSize(), maGraphic.GetPrefMapMode() ) );
- const Size aOutSize( GetOutputSizePixel() );
- const Point aGrfPos( ( aOutSize.Width() - aGrfSize.Width() ) >> 1,
- ( aOutSize.Height() - aGrfSize.Height() ) >> 1 );
-
- if( maGraphic.IsAnimated() )
- maGraphic.StartAnimation( this , aGrfPos, aGrfSize );
- else
- maGraphic.Draw( this, aGrfPos, aGrfSize );
-}
-
-// -----------------------------------------------------------------------------
-
-void GraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic )
-{
- maGraphic = rGraphic;
-
- if( maGraphic.IsAnimated() || maGraphic.IsTransparent() )
- Invalidate();
- else
- Paint( Rectangle( Point(), GetOutputSizePixel() ) );
-}
-
-// -----------------------
-// - GraphicFilterDialog -
-// -----------------------
-
-GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic ) :
- ModalDialog ( pParent, rResId ),
- maModifyHdl ( LINK( this, GraphicFilterDialog, ImplModifyHdl ) ),
- mfScaleX ( 0.0 ),
- mfScaleY ( 0.0 ),
- maSizePixel ( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ),
- maPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- maFlParameter ( this, SVX_RES( FL_PARAMETER ) ),
- maBtnOK ( this, SVX_RES( BTN_OK ) ),
- maBtnCancel ( this, SVX_RES( BTN_CANCEL ) ),
- maBtnHelp ( this, SVX_RES( BTN_HELP ) )
-{
- const Size aPreviewSize( maPreview.GetOutputSizePixel() );
- Size aGrfSize( maSizePixel );
-
- if( rGraphic.GetType() == GRAPHIC_BITMAP &&
- aPreviewSize.Width() && aPreviewSize.Height() &&
- aGrfSize.Width() && aGrfSize.Height() )
- {
- const double fGrfWH = (double) aGrfSize.Width() / aGrfSize.Height();
- const double fPreWH = (double) aPreviewSize.Width() / aPreviewSize.Height();
-
- if( fGrfWH < fPreWH )
- {
- aGrfSize.Width() = (long) ( aPreviewSize.Height() * fGrfWH );
- aGrfSize.Height()= aPreviewSize.Height();
- }
- else
- {
- aGrfSize.Width() = aPreviewSize.Width();
- aGrfSize.Height()= (long) ( aPreviewSize.Width() / fGrfWH);
- }
-
- mfScaleX = (double) aGrfSize.Width() / maSizePixel.Width();
- mfScaleY = (double) aGrfSize.Height() / maSizePixel.Height();
-
- if( !rGraphic.IsAnimated() )
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Scale( aGrfSize, BMP_SCALE_INTERPOLATE ) )
- maGraphic = aBmpEx;
- }
- }
-
- maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) );
- maTimer.SetTimeout( 100 );
- ImplModifyHdl( NULL );
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterDialog::~GraphicFilterDialog()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GraphicFilterDialog, ImplPreviewTimeoutHdl, Timer*, EMPTYARG )
-{
- maTimer.Stop();
- maPreview.SetGraphic( GetFilteredGraphic( maGraphic, mfScaleX, mfScaleY ) );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GraphicFilterDialog, ImplModifyHdl, void*, EMPTYARG )
-{
- if( maGraphic.GetType() == GRAPHIC_BITMAP )
- {
- maTimer.Stop();
- maTimer.Start();
- }
-
- return 0;
-}
-
-// ----------------
-// - FilterMosaic -
-// ----------------
-
-GraphicFilterMosaic::GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
- USHORT nTileWidth, USHORT nTileHeight, BOOL bEnhanceEdges ) :
- GraphicFilterDialog( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_MOSAIC ), rGraphic ),
- maFtWidth ( this, SVX_RES( DLG_FILTERMOSAIC_FT_WIDTH ) ),
- maMtrWidth ( this, SVX_RES( DLG_FILTERMOSAIC_MTR_WIDTH ) ),
- maFtHeight ( this, SVX_RES( DLG_FILTERMOSAIC_FT_HEIGHT ) ),
- maMtrHeight ( this, SVX_RES( DLG_FILTERMOSAIC_MTR_HEIGHT ) ),
- maCbxEdges ( this, SVX_RES( DLG_FILTERMOSAIC_CBX_EDGES ) )
-{
- FreeResource();
-
- maMtrWidth.SetValue( nTileWidth );
- maMtrWidth.SetLast( GetGraphicSizePixel().Width() );
- maMtrWidth.SetModifyHdl( GetModifyHdl() );
-
- maMtrHeight.SetValue( nTileHeight );
- maMtrHeight.SetLast( GetGraphicSizePixel().Height() );
- maMtrHeight.SetModifyHdl( GetModifyHdl() );
-
- maCbxEdges.Check( bEnhanceEdges );
- maCbxEdges.SetToggleHdl( GetModifyHdl() );
-
- maMtrWidth.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterMosaic::~GraphicFilterMosaic()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
- double fScaleX, double fScaleY )
-{
- Graphic aRet;
- const Size aSize( Max( FRound( GetTileWidth() * fScaleX ), 1L ),
- Max( FRound( GetTileHeight() * fScaleY ), 1L ) );
- BmpFilterParam aParam( aSize );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_MOSAIC, &aParam ) )
- {
- if( IsEnhanceEdges() )
- aAnim.Filter( BMP_FILTER_SHARPEN );
-
- aRet = aAnim;
- }
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_MOSAIC, &aParam ) )
- {
- if( IsEnhanceEdges() )
- aBmpEx.Filter( BMP_FILTER_SHARPEN );
-
- aRet = aBmpEx;
- }
- }
-
- return aRet;
-}
-
-// ------------------
-// - GraphicFilterSolarize -
-// ------------------
-
-GraphicFilterSolarize::GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
- BYTE cGreyThreshold, BOOL bInvert ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
- maFtThreshold ( this, SVX_RES( DLG_FILTERSOLARIZE_FT_THRESHOLD ) ),
- maMtrThreshold ( this, SVX_RES( DLG_FILTERSOLARIZE_MTR_THRESHOLD ) ),
- maCbxInvert ( this, SVX_RES( DLG_FILTERSOLARIZE_CBX_INVERT ) )
-{
- FreeResource();
-
- maMtrThreshold.SetValue( FRound( cGreyThreshold / 2.55 ) );
- maMtrThreshold.SetModifyHdl( GetModifyHdl() );
-
- maCbxInvert.Check( bInvert );
- maCbxInvert.SetToggleHdl( GetModifyHdl() );
-
- maMtrThreshold.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterSolarize::~GraphicFilterSolarize()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic,
- double /*fScaleX*/, double /*fScaleY*/ )
-{
- Graphic aRet;
- BmpFilterParam aParam( GetGreyThreshold() );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
- {
- if( IsInvert() )
- aAnim.Invert();
-
- aRet = aAnim;
- }
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
- {
- if( IsInvert() )
- aBmpEx.Invert();
-
- aRet = aBmpEx;
- }
- }
-
- return aRet;
-}
-
-// ----------------------
-// - GraphicFilterSepia -
-// ----------------------
-
-GraphicFilterSepia::GraphicFilterSepia( Window* pParent, const Graphic& rGraphic,
- USHORT nSepiaPercent ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_SEPIA ), rGraphic ),
- maFtSepia ( this, SVX_RES( DLG_FILTERSEPIA_FT_SEPIA ) ),
- maMtrSepia ( this, SVX_RES( DLG_FILTERSEPIA_MTR_SEPIA ) )
-{
- FreeResource();
-
- maMtrSepia.SetValue( nSepiaPercent );
- maMtrSepia.SetModifyHdl( GetModifyHdl() );
-
- maMtrSepia.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterSepia::~GraphicFilterSepia()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic,
- double /*fScaleX*/, double /*fScaleY*/ )
-{
- Graphic aRet;
- BmpFilterParam aParam( GetSepiaPercent() );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_SEPIA, &aParam ) )
- aRet = aAnim;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SEPIA, &aParam ) )
- aRet = aBmpEx;
- }
-
- return aRet;
-}
-
-// -----------------------
-// - GraphicFilterPoster -
-// -----------------------
-
-GraphicFilterPoster::GraphicFilterPoster( Window* pParent, const Graphic& rGraphic,
- USHORT nPosterCount ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_POSTER ), rGraphic ),
- maFtPoster ( this, SVX_RES( DLG_FILTERPOSTER_FT_POSTER ) ),
- maNumPoster ( this, SVX_RES( DLG_FILTERPOSTER_NUM_POSTER ) )
-{
- FreeResource();
-
- maNumPoster.SetFirst( 2 );
- maNumPoster.SetLast( rGraphic.GetBitmapEx().GetBitCount() );
- maNumPoster.SetValue( nPosterCount );
- maNumPoster.SetModifyHdl( GetModifyHdl() );
- maNumPoster.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterPoster::~GraphicFilterPoster()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic,
- double /*fScaleX*/, double /*fScaleY*/ )
-{
- Graphic aRet;
- const USHORT nPosterCount = GetPosterColorCount();
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) )
- aRet = aAnim;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) )
- aRet = aBmpEx;
- }
-
- return aRet;
-}
-
-// -----------------------
-// - GraphicFilterEmboss -
-// -----------------------
-
-void GraphicFilterEmboss::EmbossControl::MouseButtonDown( const MouseEvent& rEvt )
-{
- const RECT_POINT eOldRP = GetActualRP();
-
- SvxRectCtl::MouseButtonDown( rEvt );
-
- if( GetActualRP() != eOldRP )
- maModifyHdl.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterEmboss::GraphicFilterEmboss( Window* pParent, const Graphic& rGraphic,
- RECT_POINT eLightSource ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_EMBOSS ), rGraphic ),
- maFtLight ( this, SVX_RES( DLG_FILTEREMBOSS_FT_LIGHT ) ),
- maCtlLight ( this, SVX_RES( DLG_FILTEREMBOSS_CTL_LIGHT ), eLightSource )
-{
- FreeResource();
-
- maCtlLight.SetModifyHdl( GetModifyHdl() );
- maCtlLight.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterEmboss::~GraphicFilterEmboss()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic,
- double /*fScaleX*/, double /*fScaleY*/ )
-{
- Graphic aRet;
- USHORT nAzim, nElev;
-
- switch( maCtlLight.GetActualRP() )
- {
- default: DBG_ERROR("svx::GraphicFilterEmboss::GetFilteredGraphic(), unknown Reference Point!" );
- case( RP_LT ): nAzim = 4500, nElev = 4500; break;
- case( RP_MT ): nAzim = 9000, nElev = 4500; break;
- case( RP_RT ): nAzim = 13500, nElev = 4500; break;
- case( RP_LM ): nAzim = 0, nElev = 4500; break;
- case( RP_MM ): nAzim = 0, nElev = 9000; break;
- case( RP_RM ): nAzim = 18000, nElev = 4500; break;
- case( RP_LB ): nAzim = 31500, nElev = 4500; break;
- case( RP_MB ): nAzim = 27000, nElev = 4500; break;
- case( RP_RB ): nAzim = 22500, nElev = 4500; break;
- }
-
- BmpFilterParam aParam( nAzim, nElev );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
- aRet = aAnim;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
- aRet = aBmpEx;
- }
-
- return aRet;
-}
diff --git a/svx/source/cui/cuigrfflt.hxx b/svx/source/cui/cuigrfflt.hxx
deleted file mode 100644
index adf9519993..0000000000
--- a/svx/source/cui/cuigrfflt.hxx
+++ /dev/null
@@ -1,256 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuigrfflt.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CUI_GRFFLT_HXX
-#define _CUI_GRFFLT_HXX
-
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/timer.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/group.hxx>
-#include <vcl/salbtype.hxx>
-#include <goodies/grfmgr.hxx>
-#include <svx/graphctl.hxx>
-#include <svx/dlgctrl.hxx>
-#include <svx/rectenum.hxx>
-/*
-// ---------------
-// - Error codes -
-// ---------------
-
-#define SVX_GRAPHICFILTER_ERRCODE_NONE 0x00000000
-#define SVX_GRAPHICFILTER_UNSUPPORTED_GRAPHICTYPE 0x00000001
-#define SVX_GRAPHICFILTER_UNSUPPORTED_SLOT 0x00000002
-
-// --------------------
-// - SvxGraphicFilter -
-// --------------------
-
-class SfxRequest;
-class SfxItemSet;
-
-class SvxGraphicFilter
-{
-public:
-
- static ULONG ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObject& rFilterObject );
- static void DisableGraphicFilterSlots( SfxItemSet& rSet );
-};
-*/
-// -----------------------
-// - GraphicFilterDialog -
-// -----------------------
-
-class GraphicFilterDialog : public ModalDialog
-{
-private:
-
- class PreviewWindow : public Control
- {
- private:
-
- GraphicObject maGraphic;
-
- virtual void Paint( const Rectangle& rRect );
-
- public:
-
- PreviewWindow( Window* pParent, const ResId& rResId );
- ~PreviewWindow();
-
- void SetGraphic( const Graphic& rGraphic );
- };
-
-private:
-
- Timer maTimer;
- Link maModifyHdl;
- Graphic maGraphic;
- double mfScaleX;
- double mfScaleY;
- Size maSizePixel;
- PreviewWindow maPreview;
- FixedLine maFlParameter;
- OKButton maBtnOK;
- CancelButton maBtnCancel;
- HelpButton maBtnHelp;
-
- DECL_LINK( ImplPreviewTimeoutHdl, Timer* pTimer );
- DECL_LINK( ImplModifyHdl, void* p );
-
-protected:
-
- const Link& GetModifyHdl() const { return maModifyHdl; }
- const Size& GetGraphicSizePixel() const { return maSizePixel; }
-
-public:
-
- GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic );
- ~GraphicFilterDialog();
-
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
-};
-
-// -----------------------
-// - GraphicFilterMosaic -
-// -----------------------
-
-class GraphicFilterMosaic : public GraphicFilterDialog
-{
-private:
-
- FixedText maFtWidth;
- MetricField maMtrWidth;
- FixedText maFtHeight;
- MetricField maMtrHeight;
- CheckBox maCbxEdges;
-
-public:
-
- GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
- USHORT nTileWidth, USHORT nTileHeight, BOOL bEnhanceEdges );
- ~GraphicFilterMosaic();
-
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- long GetTileWidth() const { return static_cast<long>(maMtrWidth.GetValue()); }
- long GetTileHeight() const { return static_cast<long>(maMtrHeight.GetValue()); }
- BOOL IsEnhanceEdges() const { return maCbxEdges.IsChecked(); }
-};
-
-// -------------------------
-// - GraphicFilterSolarize -
-// -------------------------
-
-class GraphicFilterSolarize : public GraphicFilterDialog
-{
-private:
-
- FixedText maFtThreshold;
- MetricField maMtrThreshold;
- CheckBox maCbxInvert;
-
-public:
-
- GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
- BYTE nGreyThreshold, BOOL bInvert );
- ~GraphicFilterSolarize();
-
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- BYTE GetGreyThreshold() const { return( (BYTE) FRound( maMtrThreshold.GetValue() * 2.55 ) ); }
- BOOL IsInvert() const { return maCbxInvert.IsChecked(); }
-};
-
-// ----------------------
-// - GraphicFilterSepia -
-// ----------------------
-
-class GraphicFilterSepia : public GraphicFilterDialog
-{
-private:
-
- FixedText maFtSepia;
- MetricField maMtrSepia;
-
-public:
-
- GraphicFilterSepia( Window* pParent, const Graphic& rGraphic,
- USHORT nSepiaPercent );
- ~GraphicFilterSepia();
-
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- USHORT GetSepiaPercent() const
- { return sal::static_int_cast< USHORT >(maMtrSepia.GetValue()); }
-};
-
-// -----------------------
-// - GraphicFilterPoster -
-// -----------------------
-
-class GraphicFilterPoster : public GraphicFilterDialog
-{
-private:
-
- FixedText maFtPoster;
- NumericField maNumPoster;
-
-public:
-
- GraphicFilterPoster( Window* pParent, const Graphic& rGraphic,
- USHORT nPosterColorCount );
- ~GraphicFilterPoster();
-
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- USHORT GetPosterColorCount() const { return( (USHORT) maNumPoster.GetValue() ); }
-};
-
-// -----------------------
-// - GraphicFilterEmboss -
-// -----------------------
-
-class GraphicFilterEmboss : public GraphicFilterDialog
-{
-private:
-
- class EmbossControl : public SvxRectCtl
- {
- private:
-
- Link maModifyHdl;
-
- virtual void MouseButtonDown( const MouseEvent& rEvt );
-
- public:
-
- EmbossControl( Window* pParent, const ResId& rResId, RECT_POINT eRectPoint ) :
- SvxRectCtl( pParent, rResId ) { SetActualRP( eRectPoint ); }
-
- void SetModifyHdl( const Link& rHdl ) { maModifyHdl = rHdl; }
- };
-
-private:
-
- FixedText maFtLight;
- EmbossControl maCtlLight;
-
-public:
-
- GraphicFilterEmboss( Window* pParent, const Graphic& rGraphic,
- RECT_POINT eLightSource );
- ~GraphicFilterEmboss();
-
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- RECT_POINT GetLightSource() const { return maCtlLight.GetActualRP(); }
-};
-
-#endif
diff --git a/svx/source/cui/cuihyperdlg.cxx b/svx/source/cui/cuihyperdlg.cxx
deleted file mode 100644
index 3eb69780d8..0000000000
--- a/svx/source/cui/cuihyperdlg.cxx
+++ /dev/null
@@ -1,423 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuihyperdlg.cxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <vcl/settings.hxx>
-#include <svtools/viewoptions.hxx>
-
-#include "cuihyperdlg.hxx"
-
-#include "hlinettp.hxx"
-#include "hlmailtp.hxx"
-#include "hldoctp.hxx"
-#include "hldocntp.hxx"
-
-#include "hyperdlg.hrc"
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::frame::XFrame;
-
-//########################################################################
-//# #
-//# Childwindow-Wrapper-Class #
-//# #
-//########################################################################
-
-SvxHlinkCtrl::SvxHlinkCtrl( USHORT _nId, SfxBindings & rBindings, SvxHpLinkDlg* pDlg )
-: SfxControllerItem ( _nId, rBindings )
- ,aOnlineForwarder ( SID_INTERNET_ONLINE , *this )
- ,aRdOnlyForwarder ( SID_READONLY_MODE, *this )
-{
- pParent = pDlg;
-}
-
-void SvxHlinkCtrl::StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState )
-{
- if ( eState == SFX_ITEM_AVAILABLE )
- {
- switch ( nSID )
- {
- case SID_INTERNET_ONLINE :
- {
- pParent->EnableInetBrowse( !( (SfxBoolItem*)pState)->GetValue() );
- }
- break;
- case SID_HYPERLINK_GETLINK :
- {
- pParent->SetPage ( (SvxHyperlinkItem*)pState);
- }
- break;
- case SID_READONLY_MODE :
- {
- pParent->SetReadOnlyMode( ( (SfxBoolItem*)pState)->GetValue() == TRUE );
- }
- break;
- }
- }
-}
-
-
-
-// -----------------------------------------------------------------------
-
-
-
-//########################################################################
-//# #
-//# Hyperlink - Dialog #
-//# #
-//########################################################################
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
-: IconChoiceDialog( pParent, SVX_RES ( RID_SVXDLG_NEWHYPERLINK ) ),
- maCtrl ( SID_HYPERLINK_GETLINK, *pBindings, this ),
- mpBindings ( pBindings ),
- mbReadOnly ( sal_False ),
- mbIsHTMLDoc ( sal_False )
-{
- mbGrabFocus = sal_True;
- // insert pages
- Image aImage;
- Image aImageHC;
- String aStrTitle;
- SvxIconChoiceCtrlEntry* pEntry = NULL;
-
- aStrTitle = SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLINETTP );
- aImage = Image( SVX_RES ( RID_SVXBMP_HLINETTP ) );
- aImageHC = Image( SVX_RES ( RID_SVXBMP_HLINETTP_H ) );
- pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_INTERNET, aStrTitle, aImage, aImageHC, SvxHyperlinkInternetTp::Create );
- pEntry->SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLINETTP_HELP ) );
- aStrTitle = SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLMAILTP );
- aImage = Image( SVX_RES ( RID_SVXBMP_HLMAILTP ) );
- aImageHC = Image( SVX_RES ( RID_SVXBMP_HLMAILTP_H ) );
- pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_MAIL, aStrTitle, aImage, aImageHC, SvxHyperlinkMailTp::Create );
- pEntry->SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLMAILTP_HELP ) );
- aStrTitle = SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCTP );
- aImage = Image( SVX_RES ( RID_SVXBMP_HLDOCTP ) );
- aImageHC = Image( SVX_RES ( RID_SVXBMP_HLDOCTP_H ) );
- pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_DOCUMENT, aStrTitle, aImage, aImageHC, SvxHyperlinkDocTp::Create );
- pEntry->SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCTP_HELP ) );
- aStrTitle = SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP );
- aImage = Image( SVX_RES ( RID_SVXBMP_HLDOCNTP ) );
- aImageHC = Image( SVX_RES ( RID_SVXBMP_HLDOCNTP_H ) );
- pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_NEWDOCUMENT, aStrTitle, aImage, aImageHC, SvxHyperlinkNewDocTp::Create );
- pEntry->SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP ) );
-
- // all tab pages set -> create mnemonics
- // CreateIconTextAutoMnemonics(); #99671# not useful, because this is not what user expects when using mnemonics on the pages
-
- // create itemset for tabpages
- mpItemSet = new SfxItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
- SID_HYPERLINK_SETLINK );
-
- SvxHyperlinkItem aItem;
- mpItemSet->Put (aItem, SID_HYPERLINK_GETLINK);
-
- SetInputSet (mpItemSet);
-
- // Init Dialog
- Start (FALSE);
-
- pBindings->Update( SID_READONLY_MODE );
-
- // set OK/Cancel - button
- GetOKButton().SetText ( SVX_RESSTR(RID_SVXSTR_HYPDLG_APPLYBUT) );
- GetCancelButton().SetText ( SVX_RESSTR(RID_SVXSTR_HYPDLG_CLOSEBUT) );
-
- GetOKButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickApplyHdl_Impl ) );
- GetCancelButton().SetClickHdl( LINK ( this, SvxHpLinkDlg, ClickCloseHdl_Impl ) );
-}
-
-SvxHpLinkDlg::~SvxHpLinkDlg ()
-{
- // delete config item, so the base class (IconChoiceDialog) can not load it on the next start
- SvtViewOptions aViewOpt( E_TABDIALOG, String::CreateFromInt32( SID_HYPERLINK_DIALOG ) );
- aViewOpt.Delete();
-
- delete mpItemSet;
-}
-
-/*************************************************************************
-|*
-|* Close Dialog-Window
-|*
-|************************************************************************/
-
-BOOL SvxHpLinkDlg::Close()
-{
- GetDispatcher()->Execute( SID_HYPERLINK_DIALOG,
- SFX_CALLMODE_ASYNCHRON |
- SFX_CALLMODE_RECORD);
- return TRUE;
-}
-
-/*************************************************************************
-|*
-|* When extrawindow is visible and its never moved by user, then move that
-|* window, too.
-|*
-|************************************************************************/
-
-void SvxHpLinkDlg::Move()
-{
- SvxHyperlinkTabPageBase* pCurrentPage = ( SvxHyperlinkTabPageBase* )
- GetTabPage ( GetCurPageId() );
-
- if( pCurrentPage->IsMarkWndVisible () )
- {
- // Pos&Size of this dialog-window
- Point aDlgPos ( GetPosPixel () );
- Size aDlgSize ( GetSizePixel () );
-
- // Size of Office-Main-Window
- Size aWindowSize( SFX_APP()->GetTopWindow()->GetSizePixel() );
-
- // Size of Extrawindow
- Size aExtraWndSize( pCurrentPage->GetSizeExtraWnd() );
-
- BOOL bDoInvalid ;
- if( aDlgPos.X()+(1.02*aDlgSize.Width())+aExtraWndSize.Width() > aWindowSize.Width() )
- {
- if( aDlgPos.X() - ( 0.02*aDlgSize.Width() ) - aExtraWndSize.Width() < 0 )
- {
- // Pos Extrawindow anywhere
- bDoInvalid = pCurrentPage->MoveToExtraWnd( Point( 1, long(1.1*aDlgPos.Y()) ), TRUE );
- }
- else
- {
- // Pos Extrawindow on the left side of Dialog
- bDoInvalid = pCurrentPage->MoveToExtraWnd( aDlgPos -
- Point( long(0.02*aDlgSize.Width()), 0 ) -
- Point( aExtraWndSize.Width(), 0 ) );
- }
- }
- else
- {
- // Pos Extrawindow on the right side of Dialog
- bDoInvalid = pCurrentPage->MoveToExtraWnd ( aDlgPos + Point( long(1.02*aDlgSize.Width()), 0 ) );
- }
-
- if ( bDoInvalid )
- Invalidate(INVALIDATE_BACKGROUND);
- }
-
- Window::Move();
-}
-
-/*long SvxHpLinkDlg::PreNotify( NotifyEvent& rNEvt )
-{
- long nRet = 0;
-
- if( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- DBG_ASSERT( rNEvt.GetKeyEvent(), "-SvxHpLinkDlg::PreNotify(): no KeyEvent for key event?!" );
-
- const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
-
- if( KEY_MOD2 == pKEvt->GetKeyCode().GetModifier() && pKEvt->GetCharCode() && HandleShortCutKey( *pKEvt ) )
- nRet = 1;
- }
-
- if( !nRet )
- nRet = IconChoiceDialog::PreNotify( rNEvt );
-
- return nRet;
-}*/
-
-/*************************************************************************
-|*
-|* Click on Apply-button
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHpLinkDlg, ClickApplyHdl_Impl, void *, EMPTYARG )
-{
- SfxItemSet aItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
- SID_HYPERLINK_SETLINK );
-
- SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)
- GetTabPage ( GetCurPageId() );
-
- if ( pCurrentPage->AskApply() )
- {
- pCurrentPage->FillItemSet( aItemSet );
-
- SvxHyperlinkItem *aItem = (SvxHyperlinkItem *)
- aItemSet.GetItem (SID_HYPERLINK_SETLINK);
-
- String aStrEmpty;
- if ( aItem->GetURL() != aStrEmpty )
- GetDispatcher()->Execute( SID_HYPERLINK_SETLINK, SFX_CALLMODE_ASYNCHRON |
- SFX_CALLMODE_RECORD, aItem, 0L);
-
- ( (SvxHyperlinkTabPageBase*)GetTabPage ( GetCurPageId() ) )->DoApply();
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Click on Close-button
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHpLinkDlg, ClickCloseHdl_Impl, void *, EMPTYARG )
-{
- Close();
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Set Page
-|*
-|************************************************************************/
-
-USHORT SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem )
-{
- USHORT nPageId = RID_SVXPAGE_HYPERLINK_INTERNET;
-
- String aStrURL ( pItem->GetURL() );
- INetURLObject aURL ( aStrURL );
- INetProtocol eProtocolTyp = aURL.GetProtocol();
-
- switch ( eProtocolTyp )
- {
- case INET_PROT_HTTP :
- case INET_PROT_FTP :
- case INET_PROT_TELNET :
- nPageId = RID_SVXPAGE_HYPERLINK_INTERNET;
- break;
- case INET_PROT_FILE :
- case INET_PROT_POP3 :
- case INET_PROT_IMAP :
- nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT;
- break;
- case INET_PROT_MAILTO :
- case INET_PROT_NEWS :
- nPageId = RID_SVXPAGE_HYPERLINK_MAIL;
- break;
- default :
- sal_Char const sNewsSrvScheme[] = "news://";
- // TODO news:// is nonsense
-
- if ( aStrURL.SearchAscii( sNewsSrvScheme ) == 0 )
- nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT;
- else
- {
- sal_Char const sHash[] = "#";
- if( aStrURL.SearchAscii( sHash ) == 0 )
- nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT;
- else
- {
- eProtocolTyp = INET_PROT_NOT_VALID;
- nPageId = GetCurPageId();
- }
- }
- break;
- }
-
- ShowPage (nPageId);
-
- SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)GetTabPage( nPageId );
-
- mbIsHTMLDoc = (pItem->GetInsertMode() & HLINK_HTMLMODE) ? true : false;
-
- SfxItemSet& aPageSet = (SfxItemSet&)GetTabPage (nPageId)->GetItemSet ();
- aPageSet.Put ( *pItem );
-
- pCurrentPage->Reset( aPageSet );
- if ( mbGrabFocus )
- {
- pCurrentPage->SetInitFocus(); // #92535# grab the focus only once at initialization
- mbGrabFocus = sal_False;
- }
- return nPageId;
-}
-
-/*************************************************************************
-|*
-|* Enable/Disable to browse targets in a html-doc
-|*
-|************************************************************************/
-
-void SvxHpLinkDlg::EnableInetBrowse( sal_Bool bEnable )
-{
- SvxHyperlinkTabPageBase* pCurrentPage = ( SvxHyperlinkTabPageBase* )
- GetTabPage ( GetCurPageId() );
- pCurrentPage->SetOnlineMode( bEnable );
-}
-
-/*************************************************************************
-|*
-|* Enable/Disable ReadOnly mode
-|*
-|************************************************************************/
-
-void SvxHpLinkDlg::SetReadOnlyMode( sal_Bool bRdOnly )
-{
- mbReadOnly = bRdOnly;
- if ( bRdOnly )
- GetOKButton().Disable();
- else
- GetOKButton().Enable();
-}
-
-/*************************************************************************
-|*
-|* late-initialization of newly created pages
-|*
-|************************************************************************/
-
-void SvxHpLinkDlg::PageCreated( USHORT /*nId*/, IconChoicePage& rPage )
-{
- SvxHyperlinkTabPageBase& rHyperlinkPage = dynamic_cast< SvxHyperlinkTabPageBase& >( rPage );
- Reference< XFrame > xDocumentFrame;
- if ( mpBindings )
- xDocumentFrame = mpBindings->GetActiveFrame();
- OSL_ENSURE( xDocumentFrame.is(), "SvxHpLinkDlg::PageCreated: macro assignment functionality won't work with a proper frame!" );
- rHyperlinkPage.SetDocumentFrame( xDocumentFrame );
-}
diff --git a/svx/source/cui/cuihyperdlg.hxx b/svx/source/cui/cuihyperdlg.hxx
deleted file mode 100644
index fcd733aca5..0000000000
--- a/svx/source/cui/cuihyperdlg.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuihyperdlg.hxx,v $
- * $Revision: 1.4.216.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CUI_TAB_HYPERLINK_HXX
-#define _CUI_TAB_HYPERLINK_HXX
-
-// include ---------------------------------------------------------------
-
-#include <hlnkitem.hxx>
-#include <sfx2/childwin.hxx>
-#include <sfx2/ctrlitem.hxx>
-#include <sfx2/bindings.hxx>
-#include <vcl/image.hxx>
-
-#include "iconcdlg.hxx"
-
-/*************************************************************************
-|*
-|* Hyperlink-Dialog
-|*
-\************************************************************************/
-
-class SvxHpLinkDlg;
-class SvxHlinkCtrl : public SfxControllerItem
-{
-private :
- SvxHpLinkDlg *pParent;
-
- SfxStatusForwarder aOnlineForwarder;
- SfxStatusForwarder aRdOnlyForwarder;
-
-public :
- SvxHlinkCtrl( USHORT nId, SfxBindings & rBindings, SvxHpLinkDlg* pDlg);
-
- virtual void StateChanged( USHORT nSID, SfxItemState eState,
- const SfxPoolItem* pState );
-};
-
-
-
-/*************************************************************************
-|*
-|* Hyperlink-Dialog
-|*
-\************************************************************************/
-
-class SvxHpLinkDlg : public IconChoiceDialog
-{
-private:
- SvxHlinkCtrl maCtrl; // Controler
- SfxBindings* mpBindings;
- SfxItemSet* mpItemSet;
-
- sal_Bool mbDummy1 : 1;
- sal_Bool mbDummy2 : 1;
- sal_Bool mbDummy3 : 1;
- sal_Bool mbDummy4 : 1;
- sal_Bool mbDummy5 : 1;
- sal_Bool mbGrabFocus : 1;
- sal_Bool mbReadOnly : 1;
- sal_Bool mbIsHTMLDoc : 1;
-
- void* mpDummy1;
- void* mpDummy2;
-
- DECL_LINK (ClickApplyHdl_Impl, void * );
- DECL_LINK (ClickCloseHdl_Impl, void * );
-
-protected:
- virtual BOOL Close();
- virtual void Move();
-
-// virtual long PreNotify( NotifyEvent& rNEvt );
-public:
- SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings );
- ~SvxHpLinkDlg ();
-
- virtual void PageCreated( USHORT nId, IconChoicePage& rPage );
-
- USHORT SetPage( SvxHyperlinkItem* pItem );
- void EnableInetBrowse( sal_Bool bEnable = sal_True );
- void SetReadOnlyMode( sal_Bool bReadOnly = sal_False );
- inline BOOL IsHTMLDoc() const { return mbIsHTMLDoc; }
-
- inline SfxBindings* GetBindings() const { return mpBindings; };
- inline SfxDispatcher* GetDispatcher() const { return mpBindings->GetDispatcher(); }
-};
-
-
-#endif // _CUI_TAB_HYPERLINK_HXX
diff --git a/svx/source/cui/cuiimapdlg.hrc b/svx/source/cui/cuiimapdlg.hrc
deleted file mode 100755
index 7912b88523..0000000000
--- a/svx/source/cui/cuiimapdlg.hrc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: imapdlg.hrc,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svx/dialogs.hrc>
-
-// ImapDlg-Dialoge
-#define RID_SVX_IMAPDLG_START RID_SVX_IMAP_START
-
-#define RID_SVXDLG_IMAPURL (RID_SVX_IMAPDLG_START + 2)
-
-#define FT_URLDESCRIPTION 1
-#define FT_URL1 2
-#define FT_TARGET 3
-#define FT_NAME 4
-#define FT_DESCRIPTION 5
-#define EDT_URLDESCRIPTION 1
-#define EDT_URL 2
-#define EDT_NAME 3
-#define EDT_DESCRIPTION 4
-#define BTN_HELP1 1
-#define BTN_OK1 2
-#define BTN_CANCEL1 3
-#define FL_URL 1
-#define CBB_TARGETS 1
diff --git a/svx/source/cui/cuiimapdlg.src b/svx/source/cui/cuiimapdlg.src
deleted file mode 100755
index c686fce380..0000000000
--- a/svx/source/cui/cuiimapdlg.src
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: imapdlg.src,v $
- * $Revision: 1.53 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include "cuiimapdlg.hrc"
- // pragma ----------------------------------------------------------------
-
-ModalDialog RID_SVXDLG_IMAPURL
-{
- SVLook = TRUE ;
- OutputSize = TRUE ;
- Closeable = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 214 , 188 ) ;
- Text [ en-US ] = "Properties" ;
-
- FixedText FT_URL1
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "~URL" ;
- };
- Edit EDT_URL
- {
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Pos = MAP_APPFONT ( 6 , 17 ) ;
- Size = MAP_APPFONT ( 202 , 12 ) ;
- };
-
- FixedText FT_TARGET
- {
- Pos = MAP_APPFONT ( 6 , 32 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "F~rame" ;
- };
- ComboBox CBB_TARGETS
- {
- Border = TRUE ;
- Sort = TRUE ;
- Pos = MAP_APPFONT ( 6 , 43 ) ;
- Size = MAP_APPFONT ( 101 , 50 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- HScroll = TRUE ;
- };
-
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 6 , 59 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "~Name" ;
- };
- Edit EDT_NAME
- {
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Pos = MAP_APPFONT ( 6 , 70 ) ;
- Size = MAP_APPFONT ( 202 , 12 ) ;
- };
-
- FixedText FT_URLDESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 85 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "Alternative ~text" ;
- };
-
- Edit EDT_URLDESCRIPTION
- {
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Pos = MAP_APPFONT ( 6 , 96 ) ;
- Size = MAP_APPFONT ( 202 , 12 ) ;
- };
- FixedText FT_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 111 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "~Description" ;
- };
-
- MultiLineEdit EDT_DESCRIPTION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 122 ) ;
- Size = MAP_APPFONT ( 202 , 34 ) ;
- TabStop = TRUE ;
- IgnoreTab = TRUE;
- VScroll = TRUE;
- };
-
- FixedLine FL_URL
- {
- Pos = MAP_APPFONT ( 0 , 160 ) ;
- Size = MAP_APPFONT ( 214 , 4 ) ;
- };
-
- // Buttons
- HelpButton BTN_HELP1
- {
- Pos = MAP_APPFONT ( 6, 168 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-
- OKButton BTN_OK1
- {
- TabStop = TRUE ;
- DefButton = TRUE ;
- Pos = MAP_APPFONT ( 107 , 168 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-
- CancelButton BTN_CANCEL1
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 160 , 168 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
diff --git a/svx/source/cui/cuiimapwnd.cxx b/svx/source/cui/cuiimapwnd.cxx
deleted file mode 100644
index 72147f49e6..0000000000
--- a/svx/source/cui/cuiimapwnd.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuiimapwnd.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <tools/urlobj.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/help.hxx>
-#include <sfx2/sfxsids.hrc> // SID_ATTR_MACROITEM
-#define _ANIMATION
-#include "macroass.hxx"
-#include <svtools/imaprect.hxx>
-#include <svtools/imapcirc.hxx>
-#include <svtools/imappoly.hxx>
-#include <svtools/urlbmk.hxx>
-
-#include <xoutbmp.hxx>
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-#include <svx/svxids.hrc>
-#include <cuiimapdlg.hrc>
-#include <cuiimapwnd.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svdorect.hxx>
-#include <svx/svdocirc.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/xfltrit.hxx>
-#include <svx/svdpagv.hxx>
-#include <svtools/urihelper.hxx>
-#include <svx/xfillit.hxx>
-#include <svx/xlineit.hxx>
-
-#include <sot/formats.hxx>
-
-#define TRANSCOL Color( COL_WHITE )
-
-/*************************************************************************
-|*
-|* URLDlg
-|*
-\************************************************************************/
-
-URLDlg::URLDlg( Window* pWindow, const String& rURL, const String& rAlternativeText, const String& rDescription, const String& rTarget, const String& rName, TargetList& rTargetList )
-: ModalDialog( pWindow, SVX_RES( RID_SVXDLG_IMAPURL ) )
-, maFtURL( this, SVX_RES( FT_URL1 ) )
-, maEdtURL( this, SVX_RES( EDT_URL ) )
-, maFtTarget( this, SVX_RES( FT_TARGET ) )
-, maCbbTargets( this, SVX_RES( CBB_TARGETS ) )
-, maFtName( this, SVX_RES( FT_NAME ) )
-, maEdtName( this, SVX_RES( EDT_NAME ) )
-, maFtAlternativeText( this, SVX_RES( FT_URLDESCRIPTION ) )
-, maEdtAlternativeText( this, SVX_RES( EDT_URLDESCRIPTION ) )
-, maFtDescription( this, SVX_RES( FT_DESCRIPTION ) )
-, maEdtDescription( this, SVX_RES( EDT_DESCRIPTION ) )
-, maFlURL( this, SVX_RES( FL_URL ) )
-, maBtnHelp( this, SVX_RES( BTN_HELP1 ) )
-, maBtnOk( this, SVX_RES( BTN_OK1 ) )
-, maBtnCancel( this, SVX_RES( BTN_CANCEL1 ) )
-{
- FreeResource();
-
- maEdtURL.SetText( rURL );
- maEdtAlternativeText.SetText( rAlternativeText );
- maEdtDescription.SetText( rDescription );
- maEdtName.SetText( rName );
-
- for( String* pStr = rTargetList.First(); pStr; pStr = rTargetList.Next() )
- maCbbTargets.InsertEntry( *pStr );
-
- if( !rTarget.Len() )
- maCbbTargets.SetText( String::CreateFromAscii( "_self" ) );
- else
- maCbbTargets.SetText( rTarget );
-}
diff --git a/svx/source/cui/cuiimapwnd.hxx b/svx/source/cui/cuiimapwnd.hxx
deleted file mode 100644
index ff3582ae3a..0000000000
--- a/svx/source/cui/cuiimapwnd.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef _CUI_IMAPWND_HXX
-#define _CUI_IMAPWND_HXX
-
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/button.hxx>
-#include <vcl/menu.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/imapobj.hxx>
-#include <svtools/transfer.hxx>
-#include <svtools/imap.hxx>
-#include <sfx2/frame.hxx>
-#include <svtools/svmedit.hxx>
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-class URLDlg : public ModalDialog
-{
- FixedText maFtURL;
- Edit maEdtURL;
- FixedText maFtTarget;
- ComboBox maCbbTargets;
- FixedText maFtName;
- Edit maEdtName;
- FixedText maFtAlternativeText;
- Edit maEdtAlternativeText;
- FixedText maFtDescription;
- MultiLineEdit maEdtDescription;
- FixedLine maFlURL;
- HelpButton maBtnHelp;
- OKButton maBtnOk;
- CancelButton maBtnCancel;
-
-public:
-
- URLDlg( Window* pWindow,
- const String& rURL, const String& rAlternativeText, const String& rDescription,
- const String& rTarget, const String& rName,
- TargetList& rTargetList );
-
- String GetURL() const { return maEdtURL.GetText(); }
- String GetAltText() const { return maEdtAlternativeText.GetText(); }
- String GetDesc() const { return maEdtDescription.GetText(); }
- String GetTarget() const { return maCbbTargets.GetText(); }
- String GetName() const { return maEdtName.GetText(); }
-};
-
-#endif
diff --git a/svx/source/cui/cuioptgenrl.hxx b/svx/source/cui/cuioptgenrl.hxx
deleted file mode 100644
index 818c23478d..0000000000
--- a/svx/source/cui/cuioptgenrl.hxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuioptgenrl.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_CUIOPTGENRL_HXX
-#define _SVX_CUIOPTGENRL_HXX
-
-// include ---------------------------------------------------------------
-
-#include <optgenrl.hxx>
-#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-
-// forward ---------------------------------------------------------------
-
-struct GeneralTabPage_Impl;
-
-#define SfxGeneralTabPage SvxGeneralTabPage
-#define INDEX_NOTSET ((sal_Int16)-1)
-
-// class SvxUserEdit -----------------------------------------------------
-
-class SvxUserEdit : public Edit
-{
-private:
- sal_Int16 m_nIndex;
- FixedText* m_pLabel;
-
-public:
- SvxUserEdit( Window* pParent, const ResId& rResId,
- sal_Int16 nIndex = INDEX_NOTSET, FixedText* pLabel = NULL ) :
- Edit( pParent, rResId, true ), m_nIndex( nIndex ), m_pLabel( pLabel ) {}
-
- inline void SetIndex( sal_Int16 nIndex ) { m_nIndex = nIndex; }
- inline sal_Int16 GetIndex() const { return m_nIndex; }
- inline void SetLabel( FixedText* pLabel ) { m_pLabel = pLabel; }
- inline FixedText* GetLabel() const { return m_pLabel; }
-};
-
-// class SvxGeneralTabPage -----------------------------------------------
-
-class SvxGeneralTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-private:
- FixedText aCompanyLbl;
- SvxUserEdit aCompanyEdit;
- FixedText aNameLbl;
- FixedText aNameLblRuss;
- FixedText aNameLblEastern;
- SvxUserEdit aFirstName;
- SvxUserEdit aFatherName;
- SvxUserEdit aName;
- SvxUserEdit aShortName;
- FixedText aStreetLbl;
- FixedText aStreetLblRuss;
- SvxUserEdit aStreetEdit;
- SvxUserEdit aApartmentNrEdit;
- FixedText aCityLbl;
- SvxUserEdit aPLZEdit;
- SvxUserEdit aCityEdit;
- SvxUserEdit aUsCityEdit;
- SvxUserEdit aUsStateEdit;
- SvxUserEdit aUsZipEdit;
- FixedText aCountryLbl;
- SvxUserEdit aCountryEdit;
- FixedText aTitlePosLbl;
- SvxUserEdit aTitleEdit;
- SvxUserEdit aPositionEdit;
- FixedText aPhoneLbl;
- SvxUserEdit aTelPrivEdit;
- SvxUserEdit aTelCompanyEdit;
- FixedText aFaxMailLbl;
- SvxUserEdit aFaxEdit;
- SvxUserEdit aEmailEdit;
- FixedLine aAddrFrm;
- CheckBox aUseDataCB;
-
- GeneralTabPage_Impl* pImpl;
-
-
-#ifdef _SVX_OPTGENRL_CXX
- DECL_LINK( ModifyHdl_Impl, Edit * );
-
- sal_Bool GetAddress_Impl();
- void SetAddress_Impl();
-#endif
-
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet );
-
-public:
- SvxGeneralTabPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxGeneralTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-#endif // #ifndef _SVX_CUIOPTGENRL_HXX
-
-
diff --git a/svx/source/cui/cuisrchdlg.cxx b/svx/source/cui/cuisrchdlg.cxx
deleted file mode 100644
index 6cbe6268d0..0000000000
--- a/svx/source/cui/cuisrchdlg.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuisrchdlg.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <vcl/wrkwin.hxx>
-#include <vcl/morebtn.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/slstitm.hxx>
-#include <svtools/itemiter.hxx>
-#include <svtools/style.hxx>
-#include <svtools/searchopt.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <svtools/cjkoptions.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-
-#define _CUI_SRCHDLG_CXX
-#include "cuisrchdlg.hxx"
-
-#include <svx/dialogs.hrc>
-#include <svx/svxitems.hrc>
-//#include "srchdlg.hrc"
-
-
-#define ITEMID_SETITEM 0
-
-#include <sfx2/srchitem.hxx>
-#include <svx/pageitem.hxx>
-//#include "srchctrl.hxx"
-//CHINA001 #include "srchxtra.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <optjsearch.hxx>
-#include <svx/brshitem.hxx>
-#include "backgrnd.hxx"
-
-
-// class SvxJSearchOptionsDialog -----------------------------------------
-
-SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(
- Window *pParent,
- const SfxItemSet& rOptionsSet, USHORT /*nUniqueId*/, INT32 nInitialFlags ) :
- SfxSingleTabDialog ( pParent, rOptionsSet, RID_SVXPAGE_JSEARCH_OPTIONS ),
- nInitialTlFlags( nInitialFlags )
-{
- pPage = (SvxJSearchOptionsPage *)
- SvxJSearchOptionsPage::Create( this, rOptionsSet );
- SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
- pPage->EnableSaveOptions( FALSE );
-}
-
-
-SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog()
-{
- // pPage will be implicitly destroyed by the
- // SfxSingleTabDialog destructor
-}
-
-
-void SvxJSearchOptionsDialog::Activate()
-{
- pPage->SetTransliterationFlags( nInitialTlFlags );
-}
-
-
-INT32 SvxJSearchOptionsDialog::GetTransliterationFlags() const
-{
- return pPage->GetTransliterationFlags();
-}
-
-
-void SvxJSearchOptionsDialog::SetTransliterationFlags( INT32 nSettings )
-{
- pPage->SetTransliterationFlags( nSettings );
-}
diff --git a/svx/source/cui/cuisrchdlg.hxx b/svx/source/cui/cuisrchdlg.hxx
deleted file mode 100644
index 7ed9b2a508..0000000000
--- a/svx/source/cui/cuisrchdlg.hxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuisrchdlg.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CUI_SRCHDLG_HXX
-#define _CUI_SRCHDLG_HXX
-
-// include ---------------------------------------------------------------
-
-
-#include <svtools/stdctrl.hxx>
-#ifndef _COMBOBOX_HXX //autogen
-#include <vcl/combobox.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
-#include <vcl/dialog.hxx>
-#endif
-#include <sfx2/childwin.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <svtools/svarray.hxx>
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-#include <svtools/svmedit.hxx>
-#include <sfx2/srchdefs.hxx>
-
-class SvxJSearchOptionsPage;
-
-class SvxJSearchOptionsDialog : public SfxSingleTabDialog
-{
- INT32 nInitialTlFlags;
- SvxJSearchOptionsPage *pPage;
-
- // disallow copy-constructor and assignment-operator for now
- SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & );
- SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & );
-
-public:
- SvxJSearchOptionsDialog( Window *pParent,
- const SfxItemSet& rOptionsSet, USHORT nUniqueId,
- INT32 nInitialFlags );
- virtual ~SvxJSearchOptionsDialog();
-
- // Window
- virtual void Activate();
-
- INT32 GetTransliterationFlags() const;
- void SetTransliterationFlags( INT32 nSettings );
-};
-
-#endif
diff --git a/svx/source/cui/cuitabarea.hxx b/svx/source/cui/cuitabarea.hxx
deleted file mode 100644
index d21e105957..0000000000
--- a/svx/source/cui/cuitabarea.hxx
+++ /dev/null
@@ -1,805 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuitabarea.hxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CUI_TAB_AREA_HXX
-#define _CUI_TAB_AREA_HXX
-
-// include ---------------------------------------------------------------
-
-#include <svx/tabarea.hxx>
-
-/*************************************************************************
-|*
-|* Fl"achen-Tab-Dialog
-|*
-\************************************************************************/
-
-class SvxAreaTabDialog : public SfxTabDialog
-{
-private:
- SdrModel* mpDrawModel;
-// const SdrView* mpView;
-
- XColorTable* mpColorTab;
- XColorTable* mpNewColorTab;
- XGradientList* mpGradientList;
- XGradientList* mpNewGradientList;
- XHatchList* mpHatchingList;
- XHatchList* mpNewHatchingList;
- XBitmapList* mpBitmapList;
- XBitmapList* mpNewBitmapList;
-
- const SfxItemSet& mrOutAttrs;
-
- ChangeType mnColorTableState;
- ChangeType mnBitmapListState;
- ChangeType mnGradientListState;
- ChangeType mnHatchingListState;
-
- USHORT mnPageType;
- USHORT mnDlgType;
- USHORT mnPos;
- BOOL mbAreaTP;
- BOOL mbDeleteColorTable;
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-protected:
- virtual short Ok();
-#ifdef _SVX_TABAREA_CXX
- DECL_LINK( CancelHdlImpl, void * );
- void SavePalettes();
-#endif
-
-public:
- SvxAreaTabDialog( Window* pParent,
- const SfxItemSet* pAttr, SdrModel* pModel,
- const SdrView* pSdrView = NULL );
- ~SvxAreaTabDialog();
-
- void SetNewColorTable( XColorTable* pColTab )
- { mpNewColorTab = pColTab; }
- XColorTable* GetNewColorTable() const { return mpNewColorTab; }
- const XColorTable* GetColorTable() const { return mpColorTab; }
-
- void SetNewGradientList( XGradientList* pGrdLst)
- { mpNewGradientList = pGrdLst; }
- XGradientList* GetNewGradientList() const
- { return mpNewGradientList; }
- const XGradientList* GetGradientList() const { return mpGradientList; }
-
- void SetNewHatchingList( XHatchList* pHtchLst)
- { mpNewHatchingList = pHtchLst; }
- XHatchList* GetNewHatchingList() const
- { return mpNewHatchingList; }
- const XHatchList* GetHatchingList() const { return mpHatchingList; }
-
- void SetNewBitmapList( XBitmapList* pBmpLst)
- { mpNewBitmapList = pBmpLst; }
- XBitmapList* GetNewBitmapList() const { return mpNewBitmapList; }
- const XBitmapList* GetBitmapList() const { return mpBitmapList; }
-
- void DontDeleteColorTable() { mbDeleteColorTable = FALSE; }
-};
-
-/*************************************************************************
-|*
-|* Transparence-Tab-Page
-|*
-\************************************************************************/
-
-class SvxTransparenceTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- const SfxItemSet& rOutAttrs;
- RECT_POINT eRP;
-
- //CHINA001 UINT16* pPageType;
- //CHINA001 UINT16* pDlgType;
- UINT16 nPageType; //add CHINA001
- UINT16 nDlgType; //add CHINA001
-
- // main selection
- FixedLine aFlProp;
- RadioButton aRbtTransOff;
- RadioButton aRbtTransLinear;
- RadioButton aRbtTransGradient;
-
- // linear transparency
- MetricField aMtrTransparent;
-
- // gradient transparency
- FixedText aFtTrgrType;
- ListBox aLbTrgrGradientType;
- FixedText aFtTrgrCenterX;
- MetricField aMtrTrgrCenterX;
- FixedText aFtTrgrCenterY;
- MetricField aMtrTrgrCenterY;
- FixedText aFtTrgrAngle;
- MetricField aMtrTrgrAngle;
- FixedText aFtTrgrBorder;
- MetricField aMtrTrgrBorder;
- FixedText aFtTrgrStartValue;
- MetricField aMtrTrgrStartValue;
- FixedText aFtTrgrEndValue;
- MetricField aMtrTrgrEndValue;
-
- // preview
- SvxXRectPreview aCtlBitmapPreview;
- SvxXRectPreview aCtlXRectPreview;
- BOOL bBitmap;
-
- XOutdevItemPool* pXPool;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
-
-#ifdef _SVX_TPAREA_CXX
- DECL_LINK(ClickTransOffHdl_Impl, void * );
- DECL_LINK(ClickTransLinearHdl_Impl, void * );
- DECL_LINK(ClickTransGradientHdl_Impl, void * );
- DECL_LINK(ModifyTransparentHdl_Impl, void*);
- DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
- DECL_LINK(ModifiedTrgrHdl_Impl, void*);
-#endif
-
- void ActivateLinear(BOOL bActivate);
- void ActivateGradient(BOOL bActivate);
- void SetControlState_Impl(XGradientStyle eXGS);
-
- BOOL InitPreview ( const SfxItemSet& rSet );
- void InvalidatePreview (BOOL bEnable = TRUE );
-
-public:
- SvxTransparenceTabPage(Window* pParent, const SfxItemSet& rInAttrs);
- void Construct();
-
- static SfxTabPage* Create(Window*, const SfxItemSet&);
- static UINT16* GetRanges();
-
- virtual BOOL FillItemSet(SfxItemSet&);
- virtual void Reset(const SfxItemSet&);
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet* pSet);
- virtual void PointChanged(Window* pWindow, RECT_POINT eRP);
-
- //CHINA001 void SetPageType(UINT16 *pInType) { pPageType = pInType; }
- //CHINA001 void SetDlgType(UINT16* pInType) { pDlgType = pInType; }
- void SetPageType(UINT16 nInType) { nPageType = nInType; } //add CHINA001
- void SetDlgType(UINT16 nInType) { nDlgType = nInType; }//add CHINA001
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-};
-
-/*************************************************************************
-|*
-|* Fl"achen-Tab-Page
-|*
-\************************************************************************/
-
-class SvxAreaTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlProp;
- ListBox aTypeLB;
-
- ColorLB aLbColor;
- GradientLB aLbGradient;
- HatchingLB aLbHatching;
- BitmapLB aLbBitmap;
- SvxXRectPreview aCtlBitmapPreview;
-
- TriStateBox aTsbStepCount;
- FixedLine aFlStepCount;
- NumericField aNumFldStepCount;
-
- CheckBox aCbxHatchBckgrd;
- ColorLB aLbHatchBckgrdColor;
-
- FixedLine aFlSize;
- TriStateBox aTsbOriginal;
- TriStateBox aTsbScale;
- FixedText aFtXSize;
- MetricField aMtrFldXSize;
- FixedText aFtYSize;
- MetricField aMtrFldYSize;
- FixedLine aFlPosition;
- SvxRectCtl aCtlPosition;
- FixedText aFtXOffset;
- MetricField aMtrFldXOffset;
- FixedText aFtYOffset;
- MetricField aMtrFldYOffset;
- TriStateBox aTsbTile;
- TriStateBox aTsbStretch;
- FixedLine aFlOffset;
- RadioButton aRbtRow;
- RadioButton aRbtColumn;
- MetricField aMtrFldOffset;
-
- SvxXRectPreview aCtlXRectPreview;
-
- const SfxItemSet& rOutAttrs;
- RECT_POINT eRP;
-
- XColorTable* pColorTab;
- XGradientList* pGradientList;
- XHatchList* pHatchingList;
- XBitmapList* pBitmapList;
-
- ChangeType* pnColorTableState;
- ChangeType* pnBitmapListState;
- ChangeType* pnGradientListState;
- ChangeType* pnHatchingListState;
-
- //CHINA001 USHORT* pPageType;
- //CHINA001 USHORT* pDlgType;
- //CHINA001 USHORT* pPos;
- UINT16 nPageType; //add CHINA001
- UINT16 nDlgType;//add CHINA001
- UINT16 nPos; //add CHINA001
-
- BOOL* pbAreaTP;
-
- XOutdevItemPool* pXPool;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
-
- SfxMapUnit ePoolUnit;
- FieldUnit eFUnit;
-
-#ifdef _SVX_TPAREA_CXX
- DECL_LINK( SelectDialogTypeHdl_Impl, ListBox * );
- DECL_LINK( ClickInvisibleHdl_Impl, void * );
- DECL_LINK( ClickColorHdl_Impl, void * );
- DECL_LINK( ModifyColorHdl_Impl, void * );
- DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * );
- DECL_LINK( ClickGradientHdl_Impl, void * );
- DECL_LINK( ModifyGradientHdl_Impl, void * );
- DECL_LINK( ClickHatchingHdl_Impl, void * );
- DECL_LINK( ModifyHatchingHdl_Impl, void * );
- DECL_LINK( ToggleHatchBckgrdColorHdl_Impl, void * );
- DECL_LINK( ClickBitmapHdl_Impl, void * );
- DECL_LINK( ModifyBitmapHdl_Impl, void * );
-// DECL_LINK( ModifyTransparentHdl_Impl, void * );
- DECL_LINK( ModifyStepCountHdl_Impl, void * );
- DECL_LINK( ModifyTileHdl_Impl, void * );
- DECL_LINK( ClickScaleHdl_Impl, void * );
-#endif
-
-public:
- SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
- void SetGradientList( XGradientList* pGrdLst)
- { pGradientList = pGrdLst; }
- void SetHatchingList( XHatchList* pHtchLst)
- { pHatchingList = pHtchLst; }
- void SetBitmapList( XBitmapList* pBmpLst) { pBitmapList = pBmpLst; }
-
- //CHINA001 void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetPageType( UINT16 nInType ) { nPageType = nInType; } //add CHINA001
- //CHINA001 void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetDlgType( UINT16 nInType ) { nDlgType = nInType; }//add CHINA001
- //CHINA001 void SetPos( USHORT* pInPos ) { pPos = pInPos; }
- void SetPos( UINT16 nInPos ) { nPos = nInPos; }//add CHINA001
- void SetAreaTP( BOOL* pIn ) { pbAreaTP = pIn; }
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
- void SetGrdChgd( ChangeType* pIn ) { pnGradientListState = pIn; }
- void SetHtchChgd( ChangeType* pIn ) { pnHatchingListState = pIn; }
- void SetBmpChgd( ChangeType* pIn ) { pnBitmapListState = pIn; }
-};
-
-/*************************************************************************
-|*
-|* Schatten-Tab-Page
-|*
-\************************************************************************/
-
-class SvxShadowTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlProp;
- TriStateBox aTsbShowShadow;
- FixedText aFtPosition;
- SvxRectCtl aCtlPosition;
- FixedText aFtDistance;
- MetricField aMtrDistance;
- FixedText aFtShadowColor;
- ColorLB aLbShadowColor;
- FixedText aFtTransparent;
- MetricField aMtrTransparent;
- SvxXShadowPreview aCtlXRectPreview;
-
- const SfxItemSet& rOutAttrs;
- RECT_POINT eRP;
-
- XColorTable* pColorTab;
- ChangeType* pnColorTableState;
- UINT16 nPageType; //add CHINA001
- UINT16 nDlgType; //add CHINA001
- USHORT* pPos;
- BOOL* pbAreaTP;
-
- BOOL bDisable;
-
- XOutdevItemPool* pXPool;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
- SfxMapUnit ePoolUnit;
-
-#ifdef _SVX_TPSHADOW_CXX
- DECL_LINK( ClickShadowHdl_Impl, void * );
- DECL_LINK( ModifyShadowHdl_Impl, void * );
-#endif
-
-public:
- SvxShadowTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
-//CHINA001 void SetPageType( USHORT* pInType ) { pPageType = pInType; }
-//CHINA001 void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPageType( UINT16 nInType ) { nPageType = nInType; } //add CHINA001
- void SetDlgType( UINT16 nInType ) { nDlgType = nInType; } //add CHINA001
- void SetAreaTP( BOOL* pIn ) { pbAreaTP = pIn; }
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
- void DisablePage( BOOL bIn ) { bDisable = bIn; }
-};
-
-/*************************************************************************
-|*
-|* Farbverlauf-Tab-Page
-|*
-\************************************************************************/
-
-class SvxGradientTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlProp;
- FixedText aFtType;
- ListBox aLbGradientType;
- FixedText aFtCenterX;
- MetricField aMtrCenterX;
- FixedText aFtCenterY;
- MetricField aMtrCenterY;
- FixedText aFtAngle;
- MetricField aMtrAngle;
- FixedText aFtBorder;
- MetricField aMtrBorder;
- FixedText aFtColorFrom;
- ColorLB aLbColorFrom;
- MetricField aMtrColorFrom;
- FixedText aFtColorTo;
- ColorLB aLbColorTo;
- MetricField aMtrColorTo;
- GradientLB aLbGradients;
- SvxXRectPreview aCtlPreview;
- PushButton aBtnAdd;
- PushButton aBtnModify;
- PushButton aBtnDelete;
- ImageButton aBtnLoad;
- ImageButton aBtnSave;
-
- const SfxItemSet& rOutAttrs;
-
- XColorTable* pColorTab;
- XGradientList* pGradientList;
-
- ChangeType* pnGradientListState;
- ChangeType* pnColorTableState;
- USHORT* pPageType;
- USHORT* pDlgType;
- USHORT* pPos;
- BOOL* pbAreaTP;
-
- XOutdevItemPool* pXPool;
- XFillStyleItem aXFStyleItem;
- XFillGradientItem aXGradientItem;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
-
-#ifdef _SVX_TPGRADNT_CXX
- DECL_LINK( ClickAddHdl_Impl, void * );
- DECL_LINK( ClickModifyHdl_Impl, void * );
- DECL_LINK( ClickDeleteHdl_Impl, void * );
- DECL_LINK( ChangeGradientHdl_Impl, void * );
- DECL_LINK( ModifiedHdl_Impl, void * );
- DECL_LINK( ClickLoadHdl_Impl, void * );
- DECL_LINK( ClickSaveHdl_Impl, void * );
-
- long CheckChanges_Impl();
- void SetControlState_Impl( XGradientStyle eXGS );
-#endif
-
-public:
- SvxGradientTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
- void SetGradientList( XGradientList* pGrdLst)
- { pGradientList = pGrdLst; }
-
- void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPos( USHORT* pInPos ) { pPos = pInPos; }
- void SetAreaTP( BOOL* pIn ) { pbAreaTP = pIn; }
-
- void SetGrdChgd( ChangeType* pIn ) { pnGradientListState = pIn; }
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
-};
-
-/*************************************************************************
-|*
-|* Schraffuren-Tab-Page
-|*
-\************************************************************************/
-
-class SvxHatchTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedText aFtDistance;
- MetricField aMtrDistance;
- FixedText aFtAngle;
- MetricField aMtrAngle;
- SvxRectCtl aCtlAngle;
- FixedLine aFlProp;
- FixedText aFtLineType;
- ListBox aLbLineType;
- FixedText aFtLineColor;
- ColorLB aLbLineColor;
- HatchingLB aLbHatchings;
- SvxXRectPreview aCtlPreview;
- PushButton aBtnAdd;
- PushButton aBtnModify;
- PushButton aBtnDelete;
- ImageButton aBtnLoad;
- ImageButton aBtnSave;
-
- const SfxItemSet& rOutAttrs;
- RECT_POINT eRP;
-
- XColorTable* pColorTab;
- XHatchList* pHatchingList;
-
- ChangeType* pnHatchingListState;
- ChangeType* pnColorTableState;
- USHORT* pPageType;
- USHORT* pDlgType;
- USHORT* pPos;
- BOOL* pbAreaTP;
-
- XOutdevItemPool* pXPool;
- XFillStyleItem aXFStyleItem;
- XFillHatchItem aXHatchItem;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
-
- SfxMapUnit ePoolUnit;
-
-#ifdef _SVX_TPHATCH_CXX
- DECL_LINK( ChangeHatchHdl_Impl, void * );
- DECL_LINK( ModifiedHdl_Impl, void * );
- DECL_LINK( ClickAddHdl_Impl, void * );
- DECL_LINK( ClickModifyHdl_Impl, void * );
- DECL_LINK( ClickDeleteHdl_Impl, void * );
- DECL_LINK( ClickLoadHdl_Impl, void * );
- DECL_LINK( ClickSaveHdl_Impl, void * );
-
- long CheckChanges_Impl();
-#endif
-
-public:
- SvxHatchTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
- void SetHatchingList( XHatchList* pHtchLst)
- { pHatchingList = pHtchLst; }
-
- void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPos( USHORT* pInPos ) { pPos = pInPos; }
- void SetAreaTP( BOOL* pIn ) { pbAreaTP = pIn; }
-
- void SetHtchChgd( ChangeType* pIn ) { pnHatchingListState = pIn; }
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-/*************************************************************************
-|*
-|* Bitmap-Tab-Page
-|*
-\************************************************************************/
-
-class SvxBitmapTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- SvxPixelCtl aCtlPixel;
- FixedText aFtPixelEdit;
- FixedText aFtColor;
- ColorLB aLbColor;
- FixedText aFtBackgroundColor;
- ColorLB aLbBackgroundColor;
- FixedText aLbBitmapsHidden;
- BitmapLB aLbBitmaps;
- FixedLine aFlProp;
- SvxXRectPreview aCtlPreview;
- PushButton aBtnAdd;
- PushButton aBtnModify;
- PushButton aBtnImport;
- PushButton aBtnDelete;
- ImageButton aBtnLoad;
- ImageButton aBtnSave;
-
- SvxBitmapCtl aBitmapCtl;
-
- const SfxItemSet& rOutAttrs;
-
- XColorTable* pColorTab;
- XBitmapList* pBitmapList;
-
- ChangeType* pnBitmapListState;
- ChangeType* pnColorTableState;
- USHORT* pPageType;
- USHORT* pDlgType;
- USHORT* pPos;
- BOOL* pbAreaTP;
-
- BOOL bBmpChanged;
-
- XOutdevItemPool* pXPool;
- XFillStyleItem aXFStyleItem;
- XFillBitmapItem aXBitmapItem;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
-
-#ifdef _SVX_TPBITMAP_CXX
- DECL_LINK( ClickAddHdl_Impl, void * );
- DECL_LINK( ClickImportHdl_Impl, void * );
- DECL_LINK( ClickModifyHdl_Impl, void * );
- DECL_LINK( ClickDeleteHdl_Impl, void * );
- DECL_LINK( ChangeBitmapHdl_Impl, void * );
- DECL_LINK( ChangePixelColorHdl_Impl, void * );
- DECL_LINK( ChangeBackgrndColorHdl_Impl, void * );
- DECL_LINK( ClickLoadHdl_Impl, void * );
- DECL_LINK( ClickSaveHdl_Impl, void * );
-
- long CheckChanges_Impl();
-#endif
-
-public:
- SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
- void SetBitmapList( XBitmapList* pBmpLst) { pBitmapList = pBmpLst; }
-
- void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPos( USHORT* pInPos ) { pPos = pInPos; }
- void SetAreaTP( BOOL* pIn ) { pbAreaTP = pIn; }
-
- void SetBmpChgd( ChangeType* pIn ) { pnBitmapListState = pIn; }
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
-
- /** Return a label that is associated with the given control. This
- label is used to the determine the name for the control.
- @param pLabeled
- The control for which to return a label.
- @return
- Return a label control that provides a name for the specified
- control.
- */
- virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
-};
-
-/*************************************************************************
-|*
-|* Farben-Tab-Page
-|*
-\************************************************************************/
-
-class SvxColorTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlProp;
- FixedText aFtName;
- Edit aEdtName;
- FixedText aFtColor;
- ColorLB aLbColor;
-
- FixedText aTableNameFT;
- ValueSet aValSetColorTable;
-
- SvxXRectPreview aCtlPreviewOld;
- SvxXRectPreview aCtlPreviewNew;
-
- ListBox aLbColorModel;
- FixedText aFtColorModel1;
- MetricField aMtrFldColorModel1;
- FixedText aFtColorModel2;
- MetricField aMtrFldColorModel2;
- FixedText aFtColorModel3;
- MetricField aMtrFldColorModel3;
-
- FixedText aFtColorModel4;
- MetricField aMtrFldColorModel4;
-
- PushButton aBtnAdd;
- PushButton aBtnModify;
- PushButton aBtnWorkOn;
- PushButton aBtnDelete;
- ImageButton aBtnLoad;
- ImageButton aBtnSave;
-
- const SfxItemSet& rOutAttrs;
-
- XColorTable* pColorTab;
-
- ChangeType* pnColorTableState;
- USHORT* pPageType;
- USHORT* pDlgType;
- USHORT* pPos;
- BOOL* pbAreaTP;
- BOOL bDeleteColorTable;
-
- XOutdevItemPool* pXPool;
- XFillStyleItem aXFStyleItem;
- XFillColorItem aXFillColorItem;
- XFillAttrSetItem aXFillAttr;
- SfxItemSet& rXFSet;
-
- ColorModel eCM;
-
- Color aAktuellColor;
-
-#ifdef _SVX_TPCOLOR_CXX
- void ConvertColorValues (Color& rColor, ColorModel eModell);
- void RgbToCmyk_Impl( Color& rColor, USHORT& rK );
- void CmykToRgb_Impl( Color& rColor, const USHORT nKey );
- USHORT ColorToPercent_Impl( USHORT nColor );
- USHORT PercentToColor_Impl( USHORT nPercent );
-
- void FillValueSet_Impl( ValueSet& rVs );
- //-----------------------------------------------------------------------------------------------------
- DECL_LINK( ClickAddHdl_Impl, void * ); // Button 'Hinzufuegen'
- DECL_LINK( ClickModifyHdl_Impl, void * ); // Button 'Aendern'
- DECL_LINK( ClickDeleteHdl_Impl, void * ); // Button 'loeschen'
- DECL_LINK( ClickWorkOnHdl_Impl, void * ); // Button 'Bearbeiten'
-
- DECL_LINK( SelectColorLBHdl_Impl, void * ); // Farbe aus Listbox auswählen
- DECL_LINK( SelectValSetHdl_Impl, void * ); // Farbe aus Farbpalette (links) auswählen
- DECL_LINK( SelectColorModelHdl_Impl, void * ); // Auswahl Listbox 'Farbmodell'
- long ChangeColorHdl_Impl( void* p );
- DECL_LINK( ModifiedHdl_Impl, void * ); // Inhalt der Farbwerte-Felder wurde verändert
- DECL_LINK( ClickLoadHdl_Impl, void * ); // Button 'Farbtabelle laden'
- DECL_LINK( ClickSaveHdl_Impl, void * ); // Button 'Farbtabelle sichern'
-
- long CheckChanges_Impl();
-#endif
-
-public:
- SvxColorTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
-
- void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPos( USHORT* pInPos ) { pPos = pInPos; }
- void SetAreaTP( BOOL* pIn ) { pbAreaTP = pIn; }
-
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
-
- void SetDeleteColorTable( BOOL bIn ) { bDeleteColorTable = bIn; }
-
- virtual void FillUserData();
-};
-
-
-#endif // _CUI_TAB_AREA_HXX
-
diff --git a/svx/source/cui/cuitabline.hxx b/svx/source/cui/cuitabline.hxx
deleted file mode 100644
index 79ef6f5efe..0000000000
--- a/svx/source/cui/cuitabline.hxx
+++ /dev/null
@@ -1,433 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuitabline.hxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CUI_TAB_LINE_HXX
-#define _CUI_TAB_LINE_HXX
-
-// include ---------------------------------------------------------------
-#include <svx/tabline.hxx>
-/*************************************************************************
-|*
-|* Transform-Tab-Dialog
-|*
-\************************************************************************/
-
-class SvxLineTabDialog : public SfxTabDialog
-{
-private:
- SdrModel* pDrawModel;
- const SdrObject* pObj;
-
- const SfxItemSet& rOutAttrs;
-
- XColorTable* pColorTab;
- XColorTable* mpNewColorTab;
- XDashList* pDashList;
- XDashList* pNewDashList;
- XLineEndList* pLineEndList;
- XLineEndList* pNewLineEndList;
- BOOL bObjSelected;
-
- ChangeType nLineEndListState;
- ChangeType nDashListState;
- ChangeType mnColorTableState;
-
- USHORT nPageType;
- USHORT nDlgType;
- USHORT nPosDashLb;
- USHORT nPosLineEndLb;
- USHORT mnPos;
- BOOL mbAreaTP;
- BOOL mbDeleteColorTable;
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-protected:
- virtual short Ok();
-#ifdef _SVX_TABLINE_CXX
- DECL_LINK( CancelHdlImpl, void * );
- void SavePalettes();
-#endif
-
-public:
- SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr,
- SdrModel* pModel, const SdrObject* pObj = NULL,
- BOOL bHasObj = TRUE );
- ~SvxLineTabDialog();
-
- void SetNewDashList( XDashList* pInLst)
- { pNewDashList = pInLst; }
- XDashList* GetNewDashList() const { return pNewDashList; }
- const XDashList* GetDashList() const { return pDashList; }
-
- void SetNewLineEndList( XLineEndList* pInLst)
- { pNewLineEndList = pInLst; }
- XLineEndList* GetNewLineEndList() const { return pNewLineEndList; }
- const XLineEndList* GetLineEndList() const { return pLineEndList; }
-
- void SetNewColorTable( XColorTable* pColTab ) { mpNewColorTab = pColTab; }
- XColorTable* GetNewColorTable() const { return mpNewColorTab; }
- const XColorTable* GetColorTable() const { return pColorTab; }
-};
-
-/*************************************************************************
-|*
-|* Linien-Tab-Page
-|*
-\************************************************************************/
-
-class SvxLineTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-private:
- FixedText aFtLineStyle;
- LineLB aLbLineStyle;
- FixedText aFtColor;
- ColorLB aLbColor;
- FixedText aFtLineWidth;
- MetricField aMtrLineWidth;
- FixedText aFtTransparent;
- MetricField aMtrTransparent;
- FixedLine aFlLine;
- FixedText aFtLineEndsStyle;
- LineEndLB aLbStartStyle;
- FixedText aFtLineEndsWidth;
- MetricField aMtrStartWidth;
- TriStateBox aTsbCenterStart;
- LineEndLB aLbEndStyle;
- MetricField aMtrEndWidth;
- TriStateBox aTsbCenterEnd;
- CheckBox aCbxSynchronize;
- FixedLine aFlLineEnds;
- SvxXLinePreview aCtlPreview;
- FixedLine aFLSeparator;
-
- // #116827#
- FixedLine maFLEdgeStyle;
- FixedText maFTEdgeStyle;
- LineEndLB maLBEdgeStyle;
-
- //#58425# Symbole auf einer Linie (z.B. StarChart) ->
- SdrObjList* pSymbolList; //a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview. The list position is to be used cyclic.
- bool bNewSize;
- Graphic aAutoSymbolGraphic; //a graphic to be displayed in the preview in case that an automatic symbol is choosen
- long nNumMenuGalleryItems;
- long nSymbolType;
- SfxItemSet* pSymbolAttr; //attributes for the shown symbols; only necessary if not equal to line properties
- FixedLine aFlSymbol;
- MenuButton aSymbolMB;
- FixedText aSymbolWidthFT;
- MetricField aSymbolWidthMF;
- FixedText aSymbolHeightFT;
- MetricField aSymbolHeightMF;
- CheckBox aSymbolRatioCB;
- List aGrfNames;
- List aGrfBrushItems;
- String sNumCharFmtName;
- BOOL bLastWidthModified;
- Size aSymbolLastSize;
- Graphic aSymbolGraphic;
- Size aSymbolSize;
- BOOL bSymbols;
-
- const SfxItemSet& rOutAttrs;
- RECT_POINT eRP;
- BOOL bObjSelected;
-
- XOutdevItemPool* pXPool;
- XLineStyleItem aXLStyle;
- XLineWidthItem aXWidth;
- XLineDashItem aXDash;
- XLineColorItem aXColor;
- XLineAttrSetItem aXLineAttr;
- SfxItemSet& rXLSet;
-
- XColorTable* pColorTab;
- XDashList* pDashList;
- XLineEndList* pLineEndList;
-
- ChangeType* pnLineEndListState;
- ChangeType* pnDashListState;
- ChangeType* pnColorTableState;
- UINT16 nPageType; //add CHINA001
- UINT16 nDlgType; //add CHINA001
- USHORT* pPosDashLb;
- USHORT* pPosLineEndLb;
-
- SfxMapUnit ePoolUnit;
-
- // #63083#
- INT32 nActLineWidth;
-
- //Handler für Gallery-Popup-Menue-Button + Size
- DECL_LINK( GraphicHdl_Impl, MenuButton * );
- DECL_LINK( MenuCreateHdl_Impl, MenuButton * );
- DECL_STATIC_LINK( SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
- DECL_LINK( SizeHdl_Impl, MetricField * );
- DECL_LINK( RatioHdl_Impl, CheckBox * );
- // <- Symbole
-
-#ifdef _SVX_TPLINE_CXX
- DECL_LINK( ClickInvisibleHdl_Impl, void * );
- DECL_LINK( ChangeStartHdl_Impl, void * );
- DECL_LINK( ChangeEndHdl_Impl, void * );
- DECL_LINK( ChangePreviewHdl_Impl, void * );
- DECL_LINK( ChangeTransparentHdl_Impl, void * );
-
- // #116827#
- DECL_LINK( ChangeEdgeStyleHdl_Impl, void * );
-
- BOOL FillXLSet_Impl();
-#endif
-
- void FillListboxes();
-public:
-
- void ShowSymbolControls(BOOL bOn);
-
- SvxLineTabPage( Window* pParent, const SfxItemSet& rInAttrs );
- virtual ~SvxLineTabPage();
-
- void Construct();
-
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet& );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- virtual void FillUserData();
-
- void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
- void SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
- void SetLineEndList( XLineEndList* pLneEndLst) { pLineEndList = pLneEndLst; }
- void SetObjSelected( BOOL bHasObj ) { bObjSelected = bHasObj; }
-
- void SetPageType( UINT16 nInType ) { nPageType = nInType; }//CHINA001 void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( UINT16 nInType ) { nDlgType = nInType; } //CHINA001 void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPosDashLb( USHORT* pInPos ) { pPosDashLb = pInPos; }
- void SetPosLineEndLb( USHORT* pInPos ) { pPosLineEndLb = pInPos; }
-
- void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
- void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
- void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
-
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-/*************************************************************************
-|*
-|* Linien-Definitions-Tab-Page
-|*
-\************************************************************************/
-
-class SvxLineDefTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-private:
- FixedLine aFlDefinition;
- FixedText aFTLinestyle;
- LineLB aLbLineStyles;
- FixedText aFtType;
- ListBox aLbType1;
- ListBox aLbType2;
- FixedText aFtNumber;
- NumericField aNumFldNumber1;
- NumericField aNumFldNumber2;
- FixedText aFtLength;
- MetricField aMtrLength1;
- MetricField aMtrLength2;
- FixedText aFtDistance;
- MetricField aMtrDistance;
- CheckBox aCbxSynchronize;
- PushButton aBtnAdd;
- PushButton aBtnModify;
- PushButton aBtnDelete;
- ImageButton aBtnLoad;
- ImageButton aBtnSave;
- SvxXLinePreview aCtlPreview;
-
- const SfxItemSet& rOutAttrs;
- XDash aDash;
- BOOL bObjSelected;
-
- XOutdevItemPool* pXPool;
- XLineStyleItem aXLStyle;
- XLineWidthItem aXWidth;
- XLineDashItem aXDash;
- XLineColorItem aXColor;
- XLineAttrSetItem aXLineAttr;
- SfxItemSet& rXLSet;
-
- XDashList* pDashList;
-
- ChangeType* pnDashListState;
- USHORT* pPageType;
- USHORT* pDlgType;
- USHORT* pPosDashLb;
-
- SfxMapUnit ePoolUnit;
- FieldUnit eFUnit;
-
-#ifdef _SVX_TPLNEDEF_CXX
- void FillDash_Impl();
- void FillDialog_Impl();
-
- DECL_LINK( ClickAddHdl_Impl, void * );
- DECL_LINK( ClickModifyHdl_Impl, void * );
- DECL_LINK( ClickDeleteHdl_Impl, void * );
- DECL_LINK( SelectLinestyleHdl_Impl, void * );
- DECL_LINK( ChangePreviewHdl_Impl, void * );
- DECL_LINK( ChangeNumber1Hdl_Impl, void * );
- DECL_LINK( ChangeNumber2Hdl_Impl, void * );
- DECL_LINK( ClickLoadHdl_Impl, void * );
- DECL_LINK( ClickSaveHdl_Impl, void * );
- DECL_LINK( ChangeMetricHdl_Impl, void * );
- DECL_LINK( SelectTypeHdl_Impl, void * );
-
- void CheckChanges_Impl();
-#endif
-
-public:
- SvxLineDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- void SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
- void SetObjSelected( BOOL bHasObj ) { bObjSelected = bHasObj; }
-
- void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPosDashLb( USHORT* pInPos ) { pPosDashLb = pInPos; }
-
- void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-/*************************************************************************
-|*
-|* Linienenden-Definitions-Tab-Page
-|*
-\************************************************************************/
-
-class SvxLineEndDefTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlTip;
- FixedText aFTTitle;
- Edit aEdtName;
- FixedText aFTLineEndStyle;
- LineEndLB aLbLineEnds;
- PushButton aBtnAdd;
- PushButton aBtnModify;
- PushButton aBtnDelete;
- ImageButton aBtnLoad;
- ImageButton aBtnSave;
- FixedInfo aFiTip;
- SvxXLinePreview aCtlPreview;
-
- const SfxItemSet& rOutAttrs;
- const SdrObject* pPolyObj;
- BOOL bObjSelected;
-
- XOutdevItemPool* pXPool;
- XLineStyleItem aXLStyle;
- XLineWidthItem aXWidth;
- XLineColorItem aXColor;
- XLineAttrSetItem aXLineAttr;
- SfxItemSet& rXLSet;
-
- XLineEndList* pLineEndList;
-
- ChangeType* pnLineEndListState;
- USHORT* pPageType;
- USHORT* pDlgType;
- USHORT* pPosLineEndLb;
-
-#ifdef _SVX_TPLNEEND_CXX
- DECL_LINK( ClickAddHdl_Impl, void * );
- DECL_LINK( ClickModifyHdl_Impl, void * );
- DECL_LINK( ClickDeleteHdl_Impl, void * );
- DECL_LINK( ClickLoadHdl_Impl, void * );
- DECL_LINK( ClickSaveHdl_Impl, void * );
- DECL_LINK( SelectLineEndHdl_Impl, void * );
- long ChangePreviewHdl_Impl( void* p );
-
- void CheckChanges_Impl();
-#endif
-
-public:
- SvxLineEndDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
- ~SvxLineEndDefTabPage();
-
- void Construct();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- void SetLineEndList( XLineEndList* pInList ) { pLineEndList = pInList; }
- void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
- void SetObjSelected( BOOL bHasObj ) { bObjSelected = bHasObj; }
-
- void SetPageType( USHORT* pInType ) { pPageType = pInType; }
- void SetDlgType( USHORT* pInType ) { pDlgType = pInType; }
- void SetPosLineEndLb( USHORT* pInPos ) { pPosLineEndLb = pInPos; }
-
- void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-
-#endif // _CUI_TAB_LINE_HXX
-
diff --git a/svx/source/cui/cuitbxform.cxx b/svx/source/cui/cuitbxform.cxx
deleted file mode 100644
index 9cbbaca680..0000000000
--- a/svx/source/cui/cuitbxform.cxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: cuitbxform.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
-#include <tools/ref.hxx>
-#include <tools/shl.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
-#include <sfx2/dispatch.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/fixed.hxx>
-#include "fmitems.hxx"
-#include <vcl/sound.hxx>
-#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-/*
-#include "tbxctl.hxx"
-#include "tbxdraw.hxx"
-*/
-#include "cuitbxform.hxx"
-#ifndef _SVX_FMRESIDS_HRC
-#include "fmresids.hrc"
-#endif
-#include "fmitems.hxx"
-#ifndef _SVX_FMHELP_HRC
-#include "fmhelp.hrc"
-#endif
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/viewsh.hxx>
-//========================================================================
-// class FmInputRecordNoDialog
-//========================================================================
-
-FmInputRecordNoDialog::FmInputRecordNoDialog(Window * pParent)
- :ModalDialog( pParent, SVX_RES(RID_SVX_DLG_INPUTRECORDNO))
- ,m_aLabel(this, SVX_RES(1))
- ,m_aRecordNo(this, SVX_RES(1))
- ,m_aOk(this, SVX_RES(1))
- ,m_aCancel(this, SVX_RES(1))
-{
- m_aRecordNo.SetMin(1);
- m_aRecordNo.SetMax(0x7FFFFFFF);
- m_aRecordNo.SetStrictFormat(TRUE);
- m_aRecordNo.SetDecimalDigits(0);
-
- FreeResource();
-}
diff --git a/svx/source/cui/cuitbxform.hxx b/svx/source/cui/cuitbxform.hxx
deleted file mode 100644
index afec3d404e..0000000000
--- a/svx/source/cui/cuitbxform.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _CUI_TBXFORM_HXX
-#define _CUI_TBXFORM_HXX
-
-#include <sfx2/tbxctrl.hxx>
-#include <vcl/field.hxx>
-#include <vcl/dialog.hxx>
-
-#ifndef _SV_BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-
-//========================================================================
-
-class FmInputRecordNoDialog : public ModalDialog
-{
-public:
- FixedText m_aLabel;
- NumericField m_aRecordNo;
- OKButton m_aOk;
- CancelButton m_aCancel;
-
-public:
- FmInputRecordNoDialog(Window * pParent);
-
- void SetValue(long dNew) { m_aRecordNo.SetValue(dNew); }
- long GetValue() const { return static_cast<long>(m_aRecordNo.GetValue()); }
-};
-
-#endif
diff --git a/svx/source/cui/dbregister.cxx b/svx/source/cui/dbregister.cxx
deleted file mode 100644
index 0a38f57481..0000000000
--- a/svx/source/cui/dbregister.cxx
+++ /dev/null
@@ -1,519 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregister.cxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "dbregister.hxx"
-#include "dbregister.hrc"
-#include "dbregistersettings.hxx"
-#include "connpooloptions.hxx"
-#ifndef SVTOOLS_FILENOTATION_HXX_
-#include <svtools/filenotation.hxx>
-#endif
-#include <svx/dialogs.hrc>
-#include <svx/svxids.hrc>
-#include "helpid.hrc"
-#include <svtools/editbrowsebox.hxx>
-#include <svx/dialogs.hrc>
-#include <vcl/field.hxx>
-#include <svtools/eitem.hxx>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <vcl/msgbox.hxx>
-#include <svtools/svtabbx.hxx>
-
-#include <svtools/itemset.hxx>
-#include "doclinkdialog.hxx"
-#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
-#include "optHeaderTabListbox.hxx"
-#include <sfx2/docfilt.hxx>
-#include <svx/dialmgr.hxx>
-#include "dbregisterednamesconfig.hxx"
-
-#define TAB_WIDTH1 80
-#define TAB_WIDTH_MIN 10
-#define TAB_WIDTH2 1000
-#define ITEMID_TYPE 1
-#define ITEMID_PATH 2
-//........................................................................
-namespace svx
-{
-//........................................................................
-
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::uno;
-using namespace ::svt;
-
-// class RegistrationItemSetHolder -------------------------------------------------
-
-RegistrationItemSetHolder::RegistrationItemSetHolder( const SfxItemSet& _rMasterSet )
- :m_aRegistrationItems( _rMasterSet )
-{
- DbRegisteredNamesConfig::GetOptions( m_aRegistrationItems );
-}
-
-RegistrationItemSetHolder::~RegistrationItemSetHolder()
-{
-}
-
-// class DatabaseRegistrationDialog ------------------------------------------------
-
-DatabaseRegistrationDialog::DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rInAttrs )
- :RegistrationItemSetHolder( rInAttrs )
- ,SfxSingleTabDialog( pParent, getRegistrationItems(), RID_SFXPAGE_DBREGISTER )
-{
- SfxTabPage* page = DbRegistrationOptionsPage::Create( this, getRegistrationItems() );
-
- SetTabPage( page );
- SetText( page->GetText() );
-}
-
-DatabaseRegistrationDialog::~DatabaseRegistrationDialog()
-{
-}
-
-short DatabaseRegistrationDialog::Execute()
-{
- short result = SfxSingleTabDialog::Execute();
- if ( result == RET_OK )
- {
- DBG_ASSERT( GetOutputItemSet(), "DatabaseRegistrationDialog::Execute: no output items!" );
- if ( GetOutputItemSet() )
- DbRegisteredNamesConfig::SetOptions( *GetOutputItemSet() );
- }
- return result;
-}
-
-// class DbRegistrationOptionsPage --------------------------------------------------
-
-DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SFXPAGE_DBREGISTER), rSet ),
-
- aTypeText ( this, SVX_RES( FT_TYPE ) ),
- aPathText ( this, SVX_RES( FT_PATH ) ),
- aPathCtrl ( this, SVX_RES( LB_PATH ) ),
- m_aNew ( this, SVX_RES( BTN_NEW ) ),
- m_aEdit ( this, SVX_RES( BTN_EDIT ) ),
- m_aDelete ( this, SVX_RES( BTN_DELETE ) ),
- aStdBox ( this, SVX_RES( GB_STD ) ),
- pHeaderBar ( NULL ),
- pPathBox ( NULL ),
- m_pCurEntry ( NULL ),
- m_nOldCount ( 0 ),
- m_bModified ( FALSE )
-{
- m_aNew.SetClickHdl( LINK( this, DbRegistrationOptionsPage, NewHdl ) );
- m_aEdit.SetClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
- m_aDelete.SetClickHdl( LINK( this, DbRegistrationOptionsPage, DeleteHdl ) );
-
- Size aBoxSize = aPathCtrl.GetOutputSizePixel();
-
-
- WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new ::svx::OptHeaderTabListBox( &aPathCtrl, nBits );
-
- pHeaderBar = new HeaderBar( &aPathCtrl, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
- pHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( aBoxSize.Width(), 16 ) );
- pHeaderBar->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, HeaderSelect_Impl ) );
- pHeaderBar->SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
- Size aSz;
- aSz.Width() = TAB_WIDTH1;
- pHeaderBar->InsertItem( ITEMID_TYPE, aTypeText.GetText(),
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
- HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
- aSz.Width() = TAB_WIDTH2;
- pHeaderBar->InsertItem( ITEMID_PATH, aPathText.GetText(),
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
- HIB_LEFT | HIB_VCENTER );
-
- static long nTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
- Size aHeadSize = pHeaderBar->GetSizePixel();
-
- aPathCtrl.SetFocusControl( pPathBox );
- pPathBox->SetWindowBits( nBits );
- pPathBox->SetDoubleClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
- pPathBox->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, PathSelect_Impl ) );
- pPathBox->SetSelectionMode( SINGLE_SELECTION );
- pPathBox->SetPosSizePixel( Point( 0, aHeadSize.Height() ),
- Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
- pPathBox->SetTabs( &nTabs[0], MAP_APPFONT );
- pPathBox->InitHeaderBar( pHeaderBar );
- pPathBox->SetHighlightRange();
-
- pPathBox->SetHelpId( HID_DBPATH_CTL_PATH );
- pHeaderBar->SetHelpId( HID_DBPATH_HEADERBAR );
-
- pPathBox->Show();
- pHeaderBar->Show();
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-DbRegistrationOptionsPage::~DbRegistrationOptionsPage()
-{
- // #110603# do not grab focus to a destroyed window !!!
- aPathCtrl.SetFocusControl( NULL );
-
- pHeaderBar->Hide();
- for ( USHORT i = 0; i < pPathBox->GetEntryCount(); ++i )
- delete static_cast<String*>(pPathBox->GetEntry(i)->GetUserData());
- delete pPathBox;
- delete pHeaderBar;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* DbRegistrationOptionsPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return ( new DbRegistrationOptionsPage( pParent, rAttrSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL DbRegistrationOptionsPage::FillItemSet( SfxItemSet& rCoreSet )
-{
- // the settings for the single drivers
- sal_Bool bModified = sal_False;
- TNameLocationMap aMap;
- ULONG nCount = pPathBox->GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
- {
- SvLBoxEntry* pEntry = pPathBox->GetEntry(i);
- String* pPath = static_cast<String*>(pEntry->GetUserData());
- if ( pPath && pPath->Len() )
- {
- OFileNotation aTransformer(*pPath);
- aMap.insert(TNameLocationMap::value_type(::rtl::OUString(pPathBox->GetEntryText(pEntry,0)),aTransformer.get(OFileNotation::N_URL)));
- }
- }
- if ( m_nOldCount != aMap.size() || m_bModified )
- {
- rCoreSet.Put(DatabaseMapItem(SID_SB_DB_REGISTER, aMap), SID_SB_DB_REGISTER);
- bModified = sal_True;
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet )
-{
- // the settings for the single drivers
- SFX_ITEMSET_GET( rSet, pSettings, DatabaseMapItem, SID_SB_DB_REGISTER, sal_True );
-
- if ( pSettings )
- {
- // TabListBox f"ullen
- pPathBox->Clear();
-
- const TNameLocationMap& rMap = pSettings->getSettings();
- m_nOldCount = rMap.size();
- TNameLocationMap::const_iterator aIter = rMap.begin();
- TNameLocationMap::const_iterator aEnd = rMap.end();
- for (; aIter != aEnd; ++aIter)
- {
- OFileNotation aTransformer(aIter->second);
- insertNewEntry(aIter->first,aTransformer.get(OFileNotation::N_SYSTEM));
- }
-
- String aUserData = GetUserData();
-
- if ( aUserData.Len() )
- {
- // Spaltenbreite restaurieren
- pHeaderBar->SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
- HeaderEndDrag_Impl( NULL );
- // Sortierrichtung restaurieren
- BOOL bUp = (BOOL)(USHORT)aUserData.GetToken(1).ToInt32();
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
-
- if ( bUp )
- {
- nBits &= ~HIB_UPARROW;
- nBits |= HIB_DOWNARROW;
- }
- else
- {
- nBits &= ~HIB_DOWNARROW;
- nBits |= HIB_UPARROW;
- }
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
- HeaderSelect_Impl( NULL );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void DbRegistrationOptionsPage::FillUserData()
-{
- String aUserData = String::CreateFromInt32( pHeaderBar->GetItemSize( ITEMID_TYPE ) );
- aUserData += ';';
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- aUserData += bUp ? '1' : '0';
- SetUserData( aUserData );
-}
-// -----------------------------------------------------------------------
-
-IMPL_LINK( DbRegistrationOptionsPage, DeleteHdl, void *, EMPTYARG )
-{
- SvLBoxEntry* pEntry = pPathBox->FirstSelected();
- if ( pEntry )
- {
- QueryBox aQuery(this,SVX_RES(QUERY_DELETE_CONFIRM));
- if ( aQuery.Execute() == RET_YES )
- pPathBox->GetModel()->Remove(pEntry);
- }
- return 0;
-}
-// -----------------------------------------------------------------------
-IMPL_LINK( DbRegistrationOptionsPage, NewHdl, void *, EMPTYARG )
-{
- String sNewName,sNewLocation;
- openLinkDialog(sNewName,sNewLocation);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( DbRegistrationOptionsPage, EditHdl, void *, EMPTYARG )
-{
- SvLBoxEntry* pEntry = pPathBox->GetCurEntry();
- if ( pEntry )
- {
- String* pOldLocation = static_cast<String*>(pEntry->GetUserData());
- String sOldName = pPathBox->GetEntryText(pEntry,0);
- m_pCurEntry = pEntry;
- openLinkDialog(sOldName,*pOldLocation,pEntry);
- m_pCurEntry = NULL;
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( DbRegistrationOptionsPage, HeaderSelect_Impl, HeaderBar*, pBar )
-{
- if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
- return 0;
-
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- SvSortMode eMode = SortAscending;
-
- if ( bUp )
- {
- nBits &= ~HIB_UPARROW;
- nBits |= HIB_DOWNARROW;
- eMode = SortDescending;
- }
- else
- {
- nBits &= ~HIB_DOWNARROW;
- nBits |= HIB_UPARROW;
- }
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
- SvTreeList* pModel = pPathBox->GetModel();
- pModel->SetSortMode( eMode );
- pModel->Resort();
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( DbRegistrationOptionsPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
-{
- if ( pBar && !pBar->GetCurItemId() )
- return 0;
-
- if ( !pHeaderBar->IsItemMode() )
- {
- Size aSz;
- USHORT nTabs = pHeaderBar->GetItemCount();
- long nTmpSz = 0;
- long nWidth = pHeaderBar->GetItemSize(ITEMID_TYPE);
- long nBarWidth = pHeaderBar->GetSizePixel().Width();
-
- if(nWidth < TAB_WIDTH_MIN)
- pHeaderBar->SetItemSize( ITEMID_TYPE, TAB_WIDTH_MIN);
- else if ( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- pHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
-
- for ( USHORT i = 1; i <= nTabs; ++i )
- {
- long _nWidth = pHeaderBar->GetItemSize(i);
- aSz.Width() = _nWidth + nTmpSz;
- nTmpSz += _nWidth;
- pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT );
- }
- }
- return 1;
-}
-// -----------------------------------------------------------------------
-
-IMPL_LINK( DbRegistrationOptionsPage, PathSelect_Impl, SvTabListBox *, EMPTYARG )
-
-/* [Beschreibung]
-
-*/
-
-{
- SvLBoxEntry* pEntry = pPathBox->FirstSelected();
-
- m_aEdit.Enable( pEntry != NULL);
- m_aDelete.Enable( pEntry != NULL);
- return 0;
-}
-// -----------------------------------------------------------------------------
-void DbRegistrationOptionsPage::insertNewEntry(const ::rtl::OUString& _sName,const ::rtl::OUString& _sLocation)
-{
- String aStr( _sName );
- aStr += '\t';
- aStr += String(_sLocation);
- SvLBoxEntry* pEntry = pPathBox->InsertEntry( aStr );
- String* pLocation = new String( _sLocation );
- pEntry->SetUserData( pLocation );
-}
-// -----------------------------------------------------------------------------
-String DbRegistrationOptionsPage::getFileLocation(const String& _sLocation)
-{
- try
- {
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) );
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XFilePicker > xFilePicker( xFactory->createInstance( aService ), UNO_QUERY );
- OSL_ENSURE(xFilePicker.is() ,"Could create file picker service!");
- Reference < XFilterManager> xFilterManager(xFilePicker,UNO_QUERY);
- static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)");
- const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType);
- if ( pFilter )
- {
- xFilterManager->appendFilter( pFilter->GetUIName(),pFilter->GetDefaultExtension());
- xFilterManager->setCurrentFilter(pFilter->GetUIName());
- }
-
- INetURLObject aURL( _sLocation, INET_PROT_FILE );
- xFilePicker->setMultiSelectionMode(sal_False);
- xFilePicker->setDisplayDirectory( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- short nRet = xFilePicker->execute();
-
- if ( ExecutableDialogResults::OK == nRet )
- {
-
- // old path is an URL?
- INetURLObject aObj( _sLocation );
- FASTBOOL bURL = ( aObj.GetProtocol() != INET_PROT_NOT_VALID );
- Sequence< ::rtl::OUString > aFiles = xFilePicker->getFiles();
- INetURLObject aNewObj( aFiles[0] );
- aNewObj.removeFinalSlash();
-
- // then the new path also an URL else system path
- String sNewLocation = bURL ? rtl::OUString(aFiles[0]) : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT );
-
- if (
-#ifdef UNX
- // Unix is case sensitive
- ( sNewLocation != _sLocation )
-#else
- ( sNewLocation.CompareIgnoreCaseToAscii( _sLocation ) != COMPARE_EQUAL )
-#endif
- )
- return sNewLocation;
- }
- }
- catch( Exception& )
- {
- DBG_ERRORFILE( "DbRegistrationOptionsPage::EditLocationHdl: exception from folder picker" );
- }
-
- return String();
-}
-// -----------------------------------------------------------------------------
-void DbRegistrationOptionsPage::openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvLBoxEntry* _pEntry)
-{
- ODocumentLinkDialog aDlg(this,_pEntry == NULL);
-
- aDlg.set(_sOldName,_sOldLocation);
- aDlg.setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
-
- if ( aDlg.Execute() == RET_OK )
- {
- String sNewName,sNewLocation;
- aDlg.get(sNewName,sNewLocation);
- if ( _pEntry == NULL || sNewName != _sOldName || sNewLocation != _sOldLocation )
- {
- if ( _pEntry )
- {
- delete static_cast<String*>(_pEntry->GetUserData());
- pPathBox->GetModel()->Remove(_pEntry);
- }
- insertNewEntry(sNewName,sNewLocation);
- m_bModified = sal_True;
- }
- }
-}
-// -----------------------------------------------------------------------------
-IMPL_LINK( DbRegistrationOptionsPage, NameValidator, String*, _pName )
-{
- if ( _pName )
- {
- ULONG nCount = pPathBox->GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
- {
- SvLBoxEntry* pEntry = pPathBox->GetEntry(i);
- if ( (!m_pCurEntry || m_pCurEntry != pEntry) && pPathBox->GetEntryText(pEntry,0) == *_pName )
- return 0L;
- }
- }
- return 1L;
-}
-//........................................................................
-} // namespace svx
-//........................................................................
-
-
diff --git a/svx/source/cui/dbregister.hrc b/svx/source/cui/dbregister.hrc
deleted file mode 100644
index 9e52057467..0000000000
--- a/svx/source/cui/dbregister.hrc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregister.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SVX_DBREGISTER_HRC
-#define SVX_DBREGISTER_HRC
-// defines ---------------------------------------------------------------
-
-#define FT_TYPE 10
-#define FT_PATH 11
-#define LB_PATH 12
-#define BTN_NEW 13
-#define BTN_EDIT 14
-#define GB_STD 15
-#define IMG_LOCK 16
-#define IMG_LOCK_HC 17
-#define BTN_DELETE 18
-
-#endif // SVX_DBREGISTER_HRC
-
diff --git a/svx/source/cui/dbregister.hxx b/svx/source/cui/dbregister.hxx
deleted file mode 100644
index 303687300e..0000000000
--- a/svx/source/cui/dbregister.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregister.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SVX_DBREGISTER_HXX
-#define SVX_DBREGISTER_HXX
-
-#include "optpath.hxx"
-#include <tools/string.hxx>
-#include <comphelper/stl_types.hxx>
-#include <svtools/poolitem.hxx>
-#include "ControlFocusHelper.hxx"
-#include <sfx2/basedlgs.hxx>
-
-class SvLBoxEntry;
-namespace svx
-{
- class OptHeaderTabListBox;
-}
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- //====================================================================
- //= DbRegistrationOptionsPage
- //====================================================================
- class DbRegistrationOptionsPage : public SfxTabPage
- {
- private:
- FixedText aTypeText;
- FixedText aPathText;
- SvxControlFocusHelper aPathCtrl;
- PushButton m_aNew;
- PushButton m_aEdit;
- PushButton m_aDelete;
- FixedLine aStdBox;
-
- HeaderBar* pHeaderBar;
- ::svx::OptHeaderTabListBox* pPathBox;
- SvLBoxEntry* m_pCurEntry;
- ULONG m_nOldCount;
- BOOL m_bModified;
-
-
-#ifdef SVX_DBREGISTER_HXX
- DECL_LINK( NewHdl, void * );
- DECL_LINK( EditHdl, void * );
- DECL_LINK( DeleteHdl, void * );
-
- DECL_LINK( PathSelect_Impl, SvTabListBox* );
-
- DECL_LINK( HeaderSelect_Impl, HeaderBar * );
- DECL_LINK( HeaderEndDrag_Impl, HeaderBar * );
- DECL_LINK( NameValidator, String*);
-
-
- /** inserts a new entry in the tablistbox
- @param _sName
- The name of the entry.
- @param _sLocation
- The location of the file.
- */
- void insertNewEntry(const ::rtl::OUString& _sName,const ::rtl::OUString& _sLocation);
-
- /** opens the LinkDialog to create a register pair
- @param _sOldName
- The old name of the entry may be empty.
- @param _sOldLocation
- The old location of the entry may be empty.
- @param _pEntry
- The entry to remove if the entry will be changed
- */
- void openLinkDialog(const String& _sOldName,const String& _sOldLocation,SvLBoxEntry* _pEntry = NULL);
-
- /** opens a file pciker to select a database file
- @param _sLocation
- If set, the file picker use it as default directory
- @return
- the location of the database file
- */
- String getFileLocation(const String& _sLocation);
-#endif
-
- public:
- DbRegistrationOptionsPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~DbRegistrationOptionsPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void FillUserData();
- };
-
- //====================================================================
- //= RegistrationItemSetHolder
- //====================================================================
- /** helper for DatabaseRegistrationDialog
-
- Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects
- the current registration state.
- */
- class RegistrationItemSetHolder
- {
- private:
- SfxItemSet m_aRegistrationItems;
-
- protected:
- RegistrationItemSetHolder( const SfxItemSet& _rMasterSet );
- ~RegistrationItemSetHolder();
-
- protected:
- const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; }
- };
-
- //====================================================================
- //= DatabaseRegistrationDialog
- //====================================================================
- class DatabaseRegistrationDialog :public RegistrationItemSetHolder
- ,public SfxSingleTabDialog
- {
- public:
- DatabaseRegistrationDialog( Window* pParent, const SfxItemSet& rAttr );
- ~DatabaseRegistrationDialog();
-
- virtual short Execute();
- };
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
-#endif // SVX_DBREGISTER_HXX
-
-
diff --git a/svx/source/cui/dbregister.src b/svx/source/cui/dbregister.src
deleted file mode 100644
index a1be562c03..0000000000
--- a/svx/source/cui/dbregister.src
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregister.src,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "dbregister.hrc"
-#include <svx/dialogs.hrc>
-#ifndef _SVX_SVXIDS_HRC //autogen
-#include <svx/svxids.hrc>
-#endif
-#ifndef _SVX_DIALOGS_HRC //autogen
-#include <svx/dialogs.hrc>
-#endif
-
-// RID_SFXPAGE_PATH -----------------------------------------------------
-#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; }
-TabPage RID_SFXPAGE_DBREGISTER
-{
- // HelpId = HID_OPTIONS_DBREGISTER ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Registered databases" ;
-
- FixedText FT_TYPE
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Registered name" ;
- };
- FixedText FT_PATH
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 110 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Database file" ;
- };
- Control LB_PATH
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 147 ) ;
- Border = TRUE ;
- TabStop = TRUE;
- };
- PushButton BTN_NEW
- {
- Pos = MAP_APPFONT ( 47 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~New..." ;
- };
- PushButton BTN_EDIT
- {
- Pos = MAP_APPFONT ( 183 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 115 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~Delete" ;
- };
- FixedLine GB_STD
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Registered databases" ;
- };
-};
-
diff --git a/svx/source/cui/dbregisterednamesconfig.cxx b/svx/source/cui/dbregisterednamesconfig.cxx
deleted file mode 100644
index 3fdfa74f9d..0000000000
--- a/svx/source/cui/dbregisterednamesconfig.cxx
+++ /dev/null
@@ -1,196 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregisterednamesconfig.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "dbregisterednamesconfig.hxx"
-
-
-#include <svtools/itemset.hxx>
-#include <tools/diagnose_ex.h>
-
-#include <svx/svxids.hrc>
-#include <unotools/confignode.hxx>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/uno/XNamingService.hpp>
-#include <svtools/eitem.hxx>
-#include <comphelper/processfactory.hxx>
-#include <svtools/pathoptions.hxx>
-#include "dbregistersettings.hxx"
-#include "connpooloptions.hxx"
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- using namespace ::utl;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::container;
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getDbRegisteredNamesNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("org.openoffice.Office.DataAccess/RegisteredNames");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getDbNameNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Name");
- return s_sNodeName;
- }
-
- //--------------------------------------------------------------------
- static const ::rtl::OUString& getDbLocationNodeName()
- {
- static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Location");
- return s_sNodeName;
- }
-
- //====================================================================
- //= DbRegisteredNamesConfig
- //====================================================================
- //--------------------------------------------------------------------
- void DbRegisteredNamesConfig::GetOptions(SfxItemSet& _rFillItems)
- {
- // the config node where all pooling relevant info are stored under
- OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory(
- ::comphelper::getProcessServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY);
-
- TNameLocationMap aSettings;
-
- // then look for which of them settings are stored in the configuration
- Sequence< ::rtl::OUString > aDriverKeys = aDbRegisteredNamesRoot.getNodeNames();
- const ::rtl::OUString* pDriverKeys = aDriverKeys.getConstArray();
- const ::rtl::OUString* pDriverKeysEnd = pDriverKeys + aDriverKeys.getLength();
- for (;pDriverKeys != pDriverKeysEnd; ++pDriverKeys)
- {
- // the name of the driver in this round
- OConfigurationNode aThisDriverSettings = aDbRegisteredNamesRoot.openNode(*pDriverKeys);
- ::rtl::OUString sName, sLocation;
- aThisDriverSettings.getNodeValue(getDbNameNodeName()) >>= sName;
- aThisDriverSettings.getNodeValue(getDbLocationNodeName()) >>= sLocation;
- sLocation = SvtPathOptions().SubstituteVariable(sLocation);
-
- aSettings.insert(TNameLocationMap::value_type(sName,sLocation));
- }
-
- _rFillItems.Put(DatabaseMapItem(SID_SB_DB_REGISTER, aSettings));
- }
-
- //--------------------------------------------------------------------
- void DbRegisteredNamesConfig::SetOptions(const SfxItemSet& _rSourceItems)
- {
- // the config node where all pooling relevant info are stored under
- OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory(
- ::comphelper::getProcessServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE);
-
- if (!aDbRegisteredNamesRoot.isValid())
- // already asserted by the OConfigurationTreeRoot
- return;
-
- sal_Bool bNeedCommit = sal_False;
-
-
- // the settings for the single drivers
- SFX_ITEMSET_GET( _rSourceItems, pDriverSettings, DatabaseMapItem, SID_SB_DB_REGISTER, sal_True );
- if (pDriverSettings)
- {
- Reference< XNameAccess > xDatabaseContext = Reference< XNameAccess >(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseContext"))), UNO_QUERY);
- Reference< XNamingService> xNamingService(xDatabaseContext,UNO_QUERY);
- ::rtl::OUString sName, sLocation;
- OConfigurationNode aThisDriverSettings;
-
- const TNameLocationMap& rNewSettings = pDriverSettings->getSettings();
- TNameLocationMap::const_iterator aEnd = rNewSettings.end();
- for ( TNameLocationMap::const_iterator aLoop = rNewSettings.begin();
- aLoop != aEnd;
- ++aLoop
- )
- {
- // need the name as ::rtl::OUString
- sName = aLoop->first;
-
- // the sub-node for this driver
- if (aDbRegisteredNamesRoot.hasByName(sName))
- {
- aThisDriverSettings = aDbRegisteredNamesRoot.openNode(sName);
- // set the values
- aThisDriverSettings.setNodeValue(getDbNameNodeName(), makeAny(sName));
- aThisDriverSettings.setNodeValue(getDbLocationNodeName(), makeAny(aLoop->second));
- bNeedCommit = sal_True;
- }
- else
- {
- try
- {
- xNamingService->registerObject(sName,Reference< ::com::sun::star::uno::XInterface >(xDatabaseContext->getByName(aLoop->second),UNO_QUERY));
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- }
- if (bNeedCommit)
- aDbRegisteredNamesRoot.commit();
-
- // delete unused entry
- Sequence< ::rtl::OUString > aDriverKeys = xDatabaseContext->getElementNames();
- const ::rtl::OUString* pDriverKeys = aDriverKeys.getConstArray();
- const ::rtl::OUString* pDriverKeysEnd = pDriverKeys + aDriverKeys.getLength();
- for (;pDriverKeys != pDriverKeysEnd; ++pDriverKeys)
- {
- if ( rNewSettings.find(*pDriverKeys) == rNewSettings.end() )
- {
- try
- {
- xNamingService->revokeObject(*pDriverKeys);
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- }
- }
- }
-
-//........................................................................
-} // namespace svx
-//........................................................................
diff --git a/svx/source/cui/dbregisterednamesconfig.hxx b/svx/source/cui/dbregisterednamesconfig.hxx
deleted file mode 100644
index 3dc1f36637..0000000000
--- a/svx/source/cui/dbregisterednamesconfig.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregisterednamesconfig.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SVX_DBREGISTEREDNAMESCONFIG_HXX
-#define SVX_DBREGISTEREDNAMESCONFIG_HXX
-
-class SfxItemSet;
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- //====================================================================
- //= DbRegisteredNamesConfig
- //====================================================================
- class DbRegisteredNamesConfig
- {
-
- public:
- static void GetOptions(SfxItemSet& _rFillItems);
- static void SetOptions(const SfxItemSet& _rSourceItems);
- };
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
-#endif // SVX_DBREGISTEREDNAMESCONFIG_HXX
-
-
diff --git a/svx/source/cui/dbregistersettings.cxx b/svx/source/cui/dbregistersettings.cxx
deleted file mode 100644
index 77aad8c7d2..0000000000
--- a/svx/source/cui/dbregistersettings.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregistersettings.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "dbregistersettings.hxx"
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- //====================================================================
- //= DatabaseMapItem
- //====================================================================
- TYPEINIT1( DatabaseMapItem, SfxPoolItem )
- //--------------------------------------------------------------------
- DatabaseMapItem::DatabaseMapItem( sal_uInt16 _nId, const TNameLocationMap& _rSettings )
- :SfxPoolItem(_nId)
- ,m_aSettings(_rSettings)
- {
- }
-
- //--------------------------------------------------------------------
- int DatabaseMapItem::operator==( const SfxPoolItem& _rCompare ) const
- {
- const DatabaseMapItem* pItem = PTR_CAST(DatabaseMapItem, &_rCompare);
- if (!pItem)
- return sal_False;
-
- if (m_aSettings.size() != pItem->m_aSettings.size())
- return sal_False;
-
- return m_aSettings != pItem->m_aSettings;
- }
-
- //--------------------------------------------------------------------
- SfxPoolItem* DatabaseMapItem::Clone( SfxItemPool * ) const
- {
- return new DatabaseMapItem(Which(), m_aSettings);
- }
-
- //--------------------------------------------------------------------
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
-
diff --git a/svx/source/cui/dbregistersettings.hxx b/svx/source/cui/dbregistersettings.hxx
deleted file mode 100644
index c6639a66bb..0000000000
--- a/svx/source/cui/dbregistersettings.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dbregistersettings.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SVX_DBREGISTERSETTING_HXX
-#define SVX_DBREGISTERSETTING_HXX
-
-#include <comphelper/stl_types.hxx>
-#include <svtools/poolitem.hxx>
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- //====================================================================
- //= DatabaseMapItem
- //====================================================================
- DECLARE_STL_USTRINGACCESS_MAP(::rtl::OUString,TNameLocationMap);
- class DatabaseMapItem : public SfxPoolItem
- {
- protected:
- TNameLocationMap m_aSettings;
-
- public:
- TYPEINFO();
-
- DatabaseMapItem( sal_uInt16 _nId, const TNameLocationMap& _rSettings );
-
- virtual int operator==( const SfxPoolItem& ) const;
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
-
- const TNameLocationMap& getSettings() const { return m_aSettings; }
- };
-
-//........................................................................
-} // namespace svx
-//........................................................................
-#endif // SVX_DBREGISTERSETTING_HXX
-
diff --git a/svx/source/cui/dlgfact.cxx b/svx/source/cui/dlgfact.cxx
deleted file mode 100644
index 28f879e77b..0000000000
--- a/svx/source/cui/dlgfact.cxx
+++ /dev/null
@@ -1,2393 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dlgfact.cxx,v $
- * $Revision: 1.48 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "numfmt.hxx" //add for SvxNumberFormatTabPage
-
-#include "dlgfact.hxx"
-
-// class ResId
-#include <tools/rc.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/request.hxx>
-#include <svx/optimprove.hxx>
-#include "splitcelldlg.hxx"
-#include <svx/dialogs.hrc>
-#include "fmresids.hrc"
-#include "gallery.hrc"
-//#include "imapdlg.hrc"
-// dialogs and tabpages
-#include "dstribut.hxx"
-#include "cuigaldlg.hxx"
-#include "cuiimapwnd.hxx"
-#include "hlmarkwn.hxx"
-#include "cuicharmap.hxx"
-#include "srchxtra.hxx"
-#include "textanim.hxx"
-#include "autocdlg.hxx"
-#include "treeopt.hxx"
-#include "internationaloptions.hxx"
-#include "labdlg.hxx"
-#include "dstribut.hxx"
-#include "hangulhanjadlg.hxx" //add for HangulHanjaConversionDialog
-#include "showcols.hxx" //add for FmShowColsDialog
-#include "zoom.hxx" //add for SvxZoomDialog
-#include "cuigaldlg.hxx" //add for Gallery 6 Dialogs and 1 TabPage
-#include "cuiimapwnd.hxx" //add for URLDlg
-#include "hlmarkwn.hxx" //add for SvxHlinkDlgMarkWnd
-#include "srchxtra.hxx" //add for SvxSearchFormatDialog
-#include "transfrm.hxx" //add for SvxTransformTabDialog
-#include "bbdlg.hxx" //add for SvxBorderBackgroundDlg
-#include "cuisrchdlg.hxx" //add for SvxJSearchOptionsDialog
-#include "cuitbxform.hxx" //add for FmInputRecordNoDialog
-#include "optdict.hxx" //add for SvxNewDictionaryDialog
-#include "dlgname.hxx" //add for SvxNameDialog & SvxMessDialog
-#include "multipat.hxx" //add for SvxMultiPathDialog
-#include "multifil.hxx" //add for SvxMultiFileDialog
-#include "cuihyperdlg.hxx" //add for SvxHpLinkDlg
-#include "cuifmsearch.hxx" //add for FmSearchDialog
-#include "cuigrfflt.hxx" //add for GraphicFilterDialog
-#include "cuitabarea.hxx" //add for SvxAreaTabDialog
-#include "cuitabline.hxx" //add for SvxLineTabDialog
-#include "measure.hxx" //add for SvxMeasureDialog
-#include "connect.hxx" //add for SvxConnectionDialog
-#include "dbregister.hxx" // add for DatabaseRegistrationDialog
-#include "cuioptgenrl.hxx" //add for SvxGeneralTabPage
-#include <optasian.hxx>
-#include "insdlg.hxx"
-#include "pastedlg.hxx"
-#include "linkdlg.hxx"
-#include "SpellDialog.hxx"
-#include "cfg.hxx" //add for SvxConfigDialog
-
-#include "numpages.hxx" // add for
-#include "paragrph.hxx" //add for
-#include "tabstpge.hxx" // add for
-#include "textattr.hxx" // add for SvxTextAttrPage
-#include "align.hxx" //add for SvxAlignmentTabPage
-#include "backgrnd.hxx" //add for SvxBackgroundTabPage
-#include "border.hxx" //add for SvxBorderTabPage
-#include "chardlg.hxx" //add for SvxCharNamePage,SvxCharEffectsPage,SvxCharPositionPage,SvxCharTwoLinesPage
-#include "page.hxx" //add for SvxPageDescPage
-#include "postdlg.hxx" //add for SvxPostItDialog
-#include "grfpage.hxx" //add for SvxGrfCropPage
-#include "scriptdlg.hxx" // for ScriptOrgDialog
-#include "selector.hxx" // for SvxScriptSelectorDialog
-#include "macropg.hxx" // for SvxMacroAssignDlg
-#include "sdrcelldlg.hxx"
-#include "newtabledlg.hxx"
-#include "macroass.hxx"
-#include "acccfg.hxx"
-#include "insrc.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::container;
-
-using ::com::sun::star::uno::Reference;
-
-using namespace svx;
-// AbstractTabDialog implementations just forwards everything to the dialog
-IMPL_ABSTDLG_BASE(AbstractSfxDialog_Impl)
-IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl)
-IMPL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxDistributeDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
-
-AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl() \
-{
- delete pDlg;
-}
-short AbstractSvxZoomDialog_Impl::Execute()
-{
- return pDlg->Execute();
-}
-
-//IMPL_ABSTDLG_BASE(AbstractSvxZoomDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSearchProgress_Impl);
-IMPL_ABSTDLG_BASE(AbstractTakeProgress_Impl);
-IMPL_ABSTDLG_BASE(AbstractTitleDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractScriptSelectorDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractGalleryIdDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractURLDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxHlinkDlgMarkWnd_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxSearchSimilarityDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxTransformTabDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxCaptionDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractFmInputRecordNoDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxNewDictionaryDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxNameDialog_Impl);
-
-// #i68101#
-IMPL_ABSTDLG_BASE(AbstractSvxObjectNameDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl);
-
-IMPL_ABSTDLG_BASE(AbstractSvxMessDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxMultiPathDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxMultiFileDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxHpLinkDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractFmSearchDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxAreaTabDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractPasteDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractInsertObjectDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractLinksDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSpellDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxPostItDialog_Impl);
-
-//////////////////////////////////////////////////////////////////////////
-// VclAbstractDialog2_Impl
-//////////////////////////////////////////////////////////////////////////
-
-// virtual
-VclAbstractDialog2_Impl::~VclAbstractDialog2_Impl()
-{
- delete m_pDlg;
-}
-
-// virtual
-void VclAbstractDialog2_Impl::StartExecuteModal( const Link& rEndDialogHdl )
-{
- m_aEndDlgHdl = rEndDialogHdl;
- m_pDlg->StartExecuteModal(
- LINK( this, VclAbstractDialog2_Impl, EndDialogHdl ) );
-}
-
-// virtual
-long VclAbstractDialog2_Impl::GetResult()
-{
- return m_pDlg->GetResult();
-}
-
-IMPL_LINK( VclAbstractDialog2_Impl, EndDialogHdl, Dialog*, pDlg )
-{
- if ( pDlg != m_pDlg )
- {
- DBG_ERRORFILE( "VclAbstractDialog2_Impl::EndDialogHdl(): wrong dialog" );
- }
-
- m_aEndDlgHdl.Call( this );
- m_aEndDlgHdl = Link();
-
- return 0L;
-}
-
-//////////////////////////////////////////////////////////////////////////
-
-void AbstractTabDialog_Impl::SetCurPageId( USHORT nId )
-{
- pDlg->SetCurPageId( nId );
-}
-
-const SfxItemSet* AbstractTabDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-//add by CHINA001
-const USHORT* AbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
-{
- return pDlg->GetInputRanges( pItem );
-}
-//add by CHINA001
-void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
-{
- pDlg->SetInputSet( pInSet );
-}
-//From class Window.
-void AbstractTabDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-String AbstractTabDialog_Impl::GetText() const
-{
- return pDlg->GetText();
-}
-
-// AbstractTabDialog_Impl end
-
-const SfxItemSet* AbstractSfxDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-
-void AbstractSfxDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-
-String AbstractSfxDialog_Impl::GetText() const
-{
- return pDlg->GetText();
-}
-
-//for SvxDistributeDialog begin
-SvxDistributeHorizontal AbstractSvxDistributeDialog_Impl::GetDistributeHor()const
-{
- return pDlg->GetDistributeHor();
-}
-SvxDistributeVertical AbstractSvxDistributeDialog_Impl::GetDistributeVer()const
-{
- return pDlg->GetDistributeVer();
-}
-//for SvxDistributeDialog end
-
-// for HangulHanjaConversionDialog begin
-void AbstractHangulHanjaConversionDialog_Impl::EndDialog(long nResult)
-{
- pDlg->EndDialog(nResult);
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::EnableRubySupport( sal_Bool _bVal )
-{
- pDlg->EnableRubySupport(_bVal);
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetByCharacter( sal_Bool _bByCharacter )
-{
- pDlg->SetByCharacter(_bByCharacter);
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetConversionDirectionState( sal_Bool _bTryBothDirections, HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection )
-{
- pDlg->SetConversionDirectionState(_bTryBothDirections, _ePrimaryConversionDirection);
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormat( HangulHanjaConversion::ConversionFormat _eType )
-{
- pDlg->SetConversionFormat(_eType);
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetOptionsChangedHdl( const Link& _rHdl )
-{
- pDlg->SetOptionsChangedHdl(_rHdl );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreHdl( const Link& _rHdl )
-{
- pDlg->SetIgnoreHdl(_rHdl );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetIgnoreAllHdl( const Link& _rHdl )
-{
- pDlg->SetIgnoreAllHdl(_rHdl );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetChangeHdl( const Link& _rHdl )
-{
- pDlg->SetChangeHdl(_rHdl );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetChangeAllHdl( const Link& _rHdl )
-{
- pDlg->SetChangeAllHdl(_rHdl );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetClickByCharacterHdl( const Link& _rHdl )
-{
- pDlg->SetClickByCharacterHdl(_rHdl );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetConversionFormatChangedHdl( const Link& _rHdl )
-{
- pDlg->SetConversionFormatChangedHdl(_rHdl );
-}
-void AbstractHangulHanjaConversionDialog_Impl::SetFindHdl( const Link& _rHdl )
-{
- pDlg->SetFindHdl(_rHdl );
-}
-
-sal_Bool AbstractHangulHanjaConversionDialog_Impl::GetUseBothDirections( ) const
-{
- return pDlg->GetUseBothDirections();
-}
-
-HangulHanjaConversion::ConversionDirection AbstractHangulHanjaConversionDialog_Impl::GetDirection( HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const
-{
- return pDlg->GetDirection( _eDefaultDirection );
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::SetCurrentString(
- const String& _rNewString,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rSuggestions,
- bool _bOriginatesFromDocument
- )
-{
- pDlg->SetCurrentString(_rNewString,_rSuggestions,_bOriginatesFromDocument);
-}
-String AbstractHangulHanjaConversionDialog_Impl::GetCurrentString( ) const
-{
- return pDlg->GetCurrentString();
-}
-HangulHanjaConversion::ConversionFormat AbstractHangulHanjaConversionDialog_Impl::GetConversionFormat( ) const
-{
- return pDlg->GetConversionFormat();
-}
-
-void AbstractHangulHanjaConversionDialog_Impl::FocusSuggestion( )
-{
- pDlg->FocusSuggestion();
-}
-
-String AbstractHangulHanjaConversionDialog_Impl::GetCurrentSuggestion( ) const
-{
- return pDlg->GetCurrentSuggestion();
-}
-
-Reference < com::sun::star::embed::XEmbeddedObject > AbstractInsertObjectDialog_Impl::GetObject()
-{
- return pDlg->GetObject();
-}
-
-BOOL AbstractInsertObjectDialog_Impl::IsCreateNew()
-{
- return pDlg->IsCreateNew();
-}
-
-::Reference< ::com::sun::star::io::XInputStream > AbstractInsertObjectDialog_Impl::GetIconIfIconified( ::rtl::OUString* pGraphicMediaType )
-{
- return pDlg->GetIconIfIconified( pGraphicMediaType );
-}
-
-void AbstractPasteDialog_Impl::Insert( SotFormatStringId nFormat, const String & rFormatName )
-{
- pDlg->Insert( nFormat, rFormatName );
-}
-
-void AbstractPasteDialog_Impl::SetObjName( const SvGlobalName & rClass, const String & rObjName )
-{
- pDlg->SetObjName( rClass, rObjName );
-}
-
-ULONG AbstractPasteDialog_Impl::GetFormat( const TransferableDataHelper& aHelper,
- const DataFlavorExVector* pFormats,
- const TransferableObjectDescriptor* pDesc )
-{
- return pDlg->GetFormat( aHelper, pFormats, pDesc );
-}
-
-// for HangulHanjaConversionDialog end
-// for FmShowColsDialog begin
-void AbstractFmShowColsDialog_Impl::SetColumns(const ::Reference< ::com::sun::star::container::XIndexContainer>& xCols)
-{
- pDlg->SetColumns(xCols);
-}
-
-//for FmShowColsDialog end
-
-//for SvxZoomDialog begin
-void AbstractSvxZoomDialog_Impl::SetLimits( USHORT nMin, USHORT nMax )
-{
- pDlg->SetLimits( nMin, nMax );
-}
-
-void AbstractSvxZoomDialog_Impl::HideButton( USHORT nBtnId )
-{
- pDlg->HideButton( nBtnId );
-}
-
-const SfxItemSet* AbstractSvxZoomDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-
-//for SvxZoomDialog end
-// svx::SvxSpellDialog
-/*-- 04.05.2004 08:26:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void AbstractSpellDialog_Impl::SetLanguage( sal_uInt16 nLang )
-{
- pDlg->SetLanguage(nLang);
-}
-/*-- 04.05.2004 08:26:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-sal_Bool AbstractSpellDialog_Impl::Close()
-{
- return pDlg->Close();
-}
-/*-- 04.05.2004 08:26:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void AbstractSpellDialog_Impl::Invalidate()
-{
- pDlg->InvalidateDialog();
-}
-/*-- 04.05.2004 08:26:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-Window* AbstractSpellDialog_Impl::GetWindow()
-{
- return pDlg;
-}
-/*-- 04.05.2004 08:26:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SfxBindings& AbstractSpellDialog_Impl::GetBindings()
-{
- return pDlg->GetBindings();
-}
-// end svx::SvxSpellDialog
-
-//for SvxSpellCheckDialog begin
-//STRIP001 void AbstractSvxSpellCheckDialog_Impl::SetNewEditWord( const String& _rNew )
-//STRIP001 {
-//STRIP001 return pDlg->SetNewEditWord(_rNew );
-//STRIP001 }
-//STRIP001
-//STRIP001 void AbstractSvxSpellCheckDialog_Impl::SetLanguage( sal_uInt16 nLang )
-//STRIP001 {
-//STRIP001 return pDlg->SetLanguage( nLang );
-//STRIP001 }
-//STRIP001
-//STRIP001 void AbstractSvxSpellCheckDialog_Impl::HideAutoCorrect()
-//STRIP001 {
-//STRIP001 return pDlg->HideAutoCorrect();
-//STRIP001 }
-//STRIP001
-//STRIP001 String AbstractSvxSpellCheckDialog_Impl::GetNewEditWord()
-//STRIP001 {
-//STRIP001 return pDlg->GetNewEditWord();
-//STRIP001 }
-//STRIP001
-//STRIP001 void AbstractSvxSpellCheckDialog_Impl::SetNewEditWord( const String& _rNew )
-//STRIP001 {
-//STRIP001 return pDlg->SetNewEditWord( _rNew );
-//STRIP001 }
-//STRIP001
-//for SvxSpellCheckDialog end
-
-//for SearchProgress begin
-void AbstractSearchProgress_Impl::Update()
-{
- pDlg->Update();
-}
-
-void AbstractSearchProgress_Impl::Sync()
-{
- pDlg-> Sync();
-}
-
-void AbstractSearchProgress_Impl::SetFileType( const String& rType )
-{
- pDlg->SetFileType( rType );
-}
-
-void AbstractSearchProgress_Impl::SetDirectory( const INetURLObject& rURL )
-{
- pDlg->SetDirectory( rURL );
-}
-PLinkStub AbstractSearchProgress_Impl::GetLinkStubCleanUpHdl()
-{
- return SearchProgress::LinkStubCleanUpHdl;
-}
-//for SearchProgress end
-
-//for TakeProgress begin
-void AbstractTakeProgress_Impl::Update()
-{
- pDlg->Update();
-}
-
-void AbstractTakeProgress_Impl::Sync()
-{
- pDlg-> Sync();
-}
-
-void AbstractTakeProgress_Impl::SetFile( const INetURLObject& rURL )
-{
- pDlg->SetFile( rURL );
-}
-
-PLinkStub AbstractTakeProgress_Impl::GetLinkStubCleanUpHdl()
-{
- return TakeProgress::LinkStubCleanUpHdl;
-}
-//for TakeProgress end
-
-//for TitleDialog begin
-String AbstractTitleDialog_Impl::GetTitle() const
-{
- return pDlg->GetTitle();
-}
-//for TitleDialog end
-
-//for GalleryIdDialog begin
-ULONG AbstractGalleryIdDialog_Impl::GetId() const
-{
- return pDlg->GetId();
-}
-//for GalleryIdDialog end
-
-//for VclAbstracRefreshableDialog begin
-void VclAbstractRefreshableDialog_Impl::Update()
-{
- pDlg->Update();
-}
-
-void VclAbstractRefreshableDialog_Impl::Sync()
-{
- pDlg-> Sync();
-}
-//for VclAbstracRefreshableDialog end
-
-//for URLDlg begin
-String AbstractURLDlg_Impl::GetURL() const
-{
- return pDlg->GetURL();
-}
-
-String AbstractURLDlg_Impl::GetAltText() const
-{
- return pDlg->GetAltText();
-}
-
-String AbstractURLDlg_Impl::GetDesc() const
-{
- return pDlg->GetDesc();
-}
-
-String AbstractURLDlg_Impl::GetTarget() const
-{
- return pDlg->GetTarget();
-}
-
-String AbstractURLDlg_Impl::GetName() const
-{
- return pDlg->GetName();
-}
-//for URLDlg end
-
-// AbstractSvxHlinkDlgMarkWnd_Impl begin
-
-void AbstractSvxHlinkDlgMarkWnd_Impl::Hide( USHORT nFlags )
-{
- ((Window*)pDlg)->Hide( nFlags );
-}
-
-void AbstractSvxHlinkDlgMarkWnd_Impl::SetSizePixel( const Size& rNewSize )
-{
- pDlg->SetSizePixel( rNewSize );
-}
-
-Size AbstractSvxHlinkDlgMarkWnd_Impl::GetSizePixel() const
-{
- return pDlg->GetSizePixel();
-}
-
-BOOL AbstractSvxHlinkDlgMarkWnd_Impl::IsVisible( ) const
-{
- return (( Window* )pDlg)->IsVisible();
-}
-
-void AbstractSvxHlinkDlgMarkWnd_Impl::Invalidate( USHORT nFlags )
-{
- (( Window* )pDlg)->Invalidate(nFlags);
-}
-
-BOOL AbstractSvxHlinkDlgMarkWnd_Impl::MoveTo( Point aNewPos )const
-{
- return pDlg->MoveTo(aNewPos);
-}
-
-BOOL AbstractSvxHlinkDlgMarkWnd_Impl::ConnectToDialog( BOOL bDoit )const
-{
- return pDlg->ConnectToDialog(bDoit);
-}
-
-void AbstractSvxHlinkDlgMarkWnd_Impl::RefreshTree ( String aStrURL )
-{
- pDlg->RefreshTree(aStrURL);
-}
-
-void AbstractSvxHlinkDlgMarkWnd_Impl::SelectEntry ( String aStrMark )
-{
- pDlg->SelectEntry(aStrMark);
-}
-
-USHORT AbstractSvxHlinkDlgMarkWnd_Impl::SetError( USHORT nError)
-{
- return pDlg->SetError(nError);
-}
-
-// AbstractSvxHlinkDlgMarkWnd_Impl end
-
-//for SvxSearchSimilarityDialog begin
-USHORT AbstractSvxSearchSimilarityDialog_Impl::GetOther()
-{
- return pDlg->GetOther();
-}
-
-USHORT AbstractSvxSearchSimilarityDialog_Impl::GetShorter()
-{
- return pDlg->GetShorter();
-}
-
-USHORT AbstractSvxSearchSimilarityDialog_Impl::GetLonger()
-{
- return pDlg-> GetLonger();
-}
-
-BOOL AbstractSvxSearchSimilarityDialog_Impl::IsRelaxed()
-{
- return pDlg-> IsRelaxed();
-}
-//for SvxSearchSimilarityDialog end
-
-// AbstractSvxTransformTabDialog implementations just forwards everything to the dialog
-void AbstractSvxTransformTabDialog_Impl::SetCurPageId( USHORT nId )
-{
- pDlg->SetCurPageId( nId );
-}
-const SfxItemSet* AbstractSvxTransformTabDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-//
-const USHORT* AbstractSvxTransformTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
-{
- return pDlg->GetInputRanges( pItem );
-}
-//
-void AbstractSvxTransformTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
-{
- pDlg->SetInputSet( pInSet );
-}
-//From class Window.
-void AbstractSvxTransformTabDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-String AbstractSvxTransformTabDialog_Impl::GetText() const
-{
- return pDlg->GetText();
-}
-void AbstractSvxTransformTabDialog_Impl::SetValidateFramePosLink( const Link& rLink )
-{
- pDlg->SetValidateFramePosLink( rLink );
-}
-// AbstractSvxTransformTabDialog end
-
-// AbstractSvxCaptionDialog implementations just forwards everything to the dialog
-void AbstractSvxCaptionDialog_Impl::SetCurPageId( USHORT nId )
-{
- pDlg->SetCurPageId( nId );
-}
-const SfxItemSet* AbstractSvxCaptionDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-//
-const USHORT* AbstractSvxCaptionDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
-{
- return pDlg->GetInputRanges( pItem );
-}
-//
-void AbstractSvxCaptionDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
-{
- pDlg->SetInputSet( pInSet );
-}
-//From class Window.
-void AbstractSvxCaptionDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-String AbstractSvxCaptionDialog_Impl::GetText() const
-{
- return pDlg->GetText();
-}
-void AbstractSvxCaptionDialog_Impl::SetValidateFramePosLink( const Link& rLink )
-{
- pDlg->SetValidateFramePosLink( rLink );
-}
-// SvxAbstractCaptionDialog end
-
-//for SvxJSearchOptionsDialog begin
-INT32 AbstractSvxJSearchOptionsDialog_Impl::GetTransliterationFlags() const
-{
- return pDlg->GetTransliterationFlags();
-}
-//for SvxJSearchOptionsDialog end
-
-//for FmInputRecordNoDialog begin
-void AbstractFmInputRecordNoDialog_Impl::SetValue(long nNew)
-{
- pDlg->SetValue(nNew);
-}
-
-long AbstractFmInputRecordNoDialog_Impl::GetValue() const
-{
- return pDlg->GetValue();
-}
-//for FmInputRecordNoDialog end
-
-//for SvxNewDictionaryDialog begin
-::Reference<
- ::com::sun::star::linguistic2::XDictionary > AbstractSvxNewDictionaryDialog_Impl::GetNewDictionary()
-{
- return pDlg->GetNewDictionary();
-}
-//for SvxNewDictionaryDialog end
-
-//for SvxNameDialog begin
-void AbstractSvxNameDialog_Impl::GetName( String& rName )
-{
- pDlg->GetName( rName );
-}
-void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const Link& rLink, bool bCheckImmediately )
-{
- aCheckNameHdl = rLink;
- if( rLink.IsSet() )
- pDlg->SetCheckNameHdl( LINK(this, AbstractSvxNameDialog_Impl, CheckNameHdl), bCheckImmediately );
- else
- pDlg->SetCheckNameHdl( Link(), bCheckImmediately );
-}
-void AbstractSvxNameDialog_Impl::SetEditHelpId(ULONG nHelpId)
-{
- pDlg->SetEditHelpId( nHelpId );
-}
-void AbstractSvxNameDialog_Impl::SetHelpId( ULONG nHelpId )
-{
- pDlg->SetHelpId( nHelpId );
-}
-void AbstractSvxNameDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-IMPL_LINK( AbstractSvxNameDialog_Impl, CheckNameHdl, Window*, EMPTYARG )
-{
- if( aCheckNameHdl.IsSet() )
- return aCheckNameHdl.Call(this);
- return 0;
-}
-//for SvxNameDialog end
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-
-void AbstractSvxObjectNameDialog_Impl::GetName(String& rName)
-{
- pDlg->GetName(rName);
-}
-
-void AbstractSvxObjectNameDialog_Impl::SetCheckNameHdl(const Link& rLink, bool bCheckImmediately)
-{
- aCheckNameHdl = rLink;
-
- if(rLink.IsSet())
- {
- pDlg->SetCheckNameHdl(LINK(this, AbstractSvxObjectNameDialog_Impl, CheckNameHdl), bCheckImmediately);
- }
- else
- {
- pDlg->SetCheckNameHdl(Link(), bCheckImmediately);
- }
-}
-
-IMPL_LINK(AbstractSvxObjectNameDialog_Impl, CheckNameHdl, Window*, EMPTYARG)
-{
- if(aCheckNameHdl.IsSet())
- {
- return aCheckNameHdl.Call(this);
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-
-void AbstractSvxObjectTitleDescDialog_Impl::GetTitle(String& rTitle)
-{
- pDlg->GetTitle(rTitle);
-}
-
-void AbstractSvxObjectTitleDescDialog_Impl::GetDescription(String& rDescription)
-{
- pDlg->GetDescription(rDescription);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-
-//for SvxMessDialog begin
-void AbstractSvxMessDialog_Impl::SetButtonText( USHORT nBtnId, const String& rNewTxt )
-{
- pDlg->SetButtonText( nBtnId, rNewTxt );
-}
-//for SvxMessDialog end
-
-//for SvxMultiPathDialog begin
-String AbstractSvxMultiPathDialog_Impl::GetPath() const
-{
- return pDlg->GetPath();
-}
-
-void AbstractSvxMultiPathDialog_Impl::SetPath( const String& rPath )
-{
- pDlg->SetPath( rPath );
-}
-
-void AbstractSvxMultiPathDialog_Impl::EnableRadioButtonMode()
-{
- pDlg->EnableRadioButtonMode();
-}
-
-void AbstractSvxMultiPathDialog_Impl::SetTitle( const String& rNewTitle )
-{
- pDlg->SetText( rNewTitle );
-}
-//for SvxMultiPathDialog end
-
-//for SvxMultiFileDialog begin
-String AbstractSvxMultiFileDialog_Impl::GetPath() const
-{
- return pDlg->GetPath();
-}
-
-void AbstractSvxMultiFileDialog_Impl::SetPath( const String& rPath )
-{
- pDlg->SetPath( rPath );
-}
-
-String AbstractSvxMultiFileDialog_Impl::GetFiles() const
-{
- return pDlg->GetFiles();
-}
-
-void AbstractSvxMultiFileDialog_Impl::SetFiles( const String& rPath )
-{
- pDlg->SetFiles( rPath );
-}
-
-void AbstractSvxMultiFileDialog_Impl::SetClassPathMode()
-{
- pDlg->SetClassPathMode();
-}
-
-void AbstractSvxMultiFileDialog_Impl::EnableRadioButtonMode()
-{
- pDlg->EnableRadioButtonMode();
-}
-
-void AbstractSvxMultiFileDialog_Impl::SetTitle( const String& rNewTitle )
-{
- pDlg->SetText( rNewTitle );
-}
-
-void AbstractSvxMultiFileDialog_Impl::SetHelpId( ULONG nHelpId )
-{
- pDlg->SetHelpId( nHelpId );
-}
-//for SvxMultiFileDialog end
-
-//for SvxHpLinkDlg begin
-Window * AbstractSvxHpLinkDlg_Impl::GetWindow()
-{
- return (Window *)pDlg;
-}
-
-sal_Bool AbstractSvxHpLinkDlg_Impl::QueryClose()
-{
- return pDlg->QueryClose();
-}
-//for SvxHpLinkDlg end
-
-
-//for FmSearchDialog begin
-void AbstractFmSearchDialog_Impl::SetFoundHandler(const Link& lnk)
-{
- pDlg->SetFoundHandler(lnk);
-}
-void AbstractFmSearchDialog_Impl::SetCanceledNotFoundHdl(const Link& lnk)
-{
- pDlg->SetCanceledNotFoundHdl(lnk);
-}
-void AbstractFmSearchDialog_Impl::SetActiveField(const String& strField)
-{
- pDlg->SetActiveField(strField);
-}
-//for FmSearchDialog end
-
-//for GraphicFilterDialog begin
-Graphic AbstractGraphicFilterDialog_Impl::GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY )
-{
- return pDlg->GetFilteredGraphic( rGraphic, fScaleX, fScaleY );
-}
-//for GraphicFilterDialog end
-
-// AbstractSvxAreaTabDialog implementations just forwards everything to the dialog
-void AbstractSvxAreaTabDialog_Impl::SetCurPageId( USHORT nId )
-{
- pDlg->SetCurPageId( nId );
-}
-
-const SfxItemSet* AbstractSvxAreaTabDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-//add by CHINA001
-const USHORT* AbstractSvxAreaTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
-{
- return pDlg->GetInputRanges( pItem );
-}
-//add by CHINA001
-void AbstractSvxAreaTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
-{
- pDlg->SetInputSet( pInSet );
-}
-//From class Window.
-void AbstractSvxAreaTabDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-String AbstractSvxAreaTabDialog_Impl::GetText() const
-{
- return pDlg->GetText();
-}
-
-void AbstractSvxAreaTabDialog_Impl::DontDeleteColorTable()
-{
- return pDlg->DontDeleteColorTable();
-}
-// AbstractSvxAreaTabDialog_Impl end
-
-// add SvxPostItDialog begin
-void AbstractSvxPostItDialog_Impl::SetText( const XubString& rStr )
-{
- pDlg->SetText( rStr );
-}
-const SfxItemSet* AbstractSvxPostItDialog_Impl::GetOutputItemSet() const
-{
- return pDlg->GetOutputItemSet();
-}
-void AbstractSvxPostItDialog_Impl::EnableTravel(BOOL bNext, BOOL bPrev)
-{
- pDlg->EnableTravel( bNext, bPrev );
-}
-String AbstractSvxPostItDialog_Impl::GetNote()
-{
- return pDlg->GetNote();
-}
-void AbstractSvxPostItDialog_Impl::SetNote(const String& rTxt)
-{
- pDlg->SetNote( rTxt );
-}
-void AbstractSvxPostItDialog_Impl::ShowLastAuthor(const String& rAuthor, const String& rDate)
-{
- pDlg->ShowLastAuthor( rAuthor, rDate );
-}
-void AbstractSvxPostItDialog_Impl::DontChangeAuthor()
-{
- pDlg->DontChangeAuthor();
-}
-void AbstractSvxPostItDialog_Impl::HideAuthor()
-{
- pDlg->HideAuthor();
-}
-void AbstractSvxPostItDialog_Impl::SetReadonlyPostIt(BOOL bDisable)
-{
- pDlg->SetReadonlyPostIt( bDisable );
-}
-BOOL AbstractSvxPostItDialog_Impl::IsOkEnabled() const
-{
- return pDlg->IsOkEnabled();
-}
-void AbstractSvxPostItDialog_Impl::SetNextHdl( const Link& rLink )
-{
- aNextHdl = rLink;
- if( rLink.IsSet() )
- pDlg->SetNextHdl( LINK(this, AbstractSvxPostItDialog_Impl, NextHdl ) );
- else
- pDlg->SetNextHdl( Link() );
-}
-void AbstractSvxPostItDialog_Impl::SetPrevHdl( const Link& rLink )
-{
- aPrevHdl = rLink;
- if( rLink.IsSet() )
- pDlg->SetPrevHdl( LINK(this, AbstractSvxPostItDialog_Impl, PrevHdl ) );
- else
- pDlg->SetPrevHdl( Link() );
-}
-IMPL_LINK( AbstractSvxPostItDialog_Impl, NextHdl, Window*, EMPTYARG )
-{
- if( aNextHdl.IsSet() )
- aNextHdl.Call(this);
- return 0;
-}
-IMPL_LINK( AbstractSvxPostItDialog_Impl, PrevHdl, Window*, EMPTYARG )
-{
- if( aPrevHdl.IsSet() )
- aPrevHdl.Call(this);
- return 0;
-}
-Window * AbstractSvxPostItDialog_Impl::GetWindow()
-{
- return (Window *)pDlg;
-}
-
-// SvxPostItDialog end
-
-//--------------------------------------------------------------
-// Create dialogs with simplest interface
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( Window* pParent, sal_uInt32 nResId )
-{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case SID_OPTIONS_TREEDIALOG :
- case SID_OPTIONS_DATABASES :
- case SID_LANGUAGE_OPTIONS :
- {
- bool bActivateLastSelection = false;
- if (nResId == SID_OPTIONS_TREEDIALOG)
- bActivateLastSelection = true;
- Reference< frame::XFrame > xFrame;
- OfaTreeOptionsDialog* pOptDlg = new OfaTreeOptionsDialog( pParent, xFrame, bActivateLastSelection );
- if (nResId == SID_OPTIONS_DATABASES)
- {
- pOptDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS);
- }
- else if (nResId == SID_LANGUAGE_OPTIONS)
- {
- //open the tab page "tools/options/languages"
- pOptDlg->ActivatePage(OFA_TP_LANGUAGES_FOR_SET_DOCUMENT_LANGUAGE);
- }
- pDlg = pOptDlg;
- }
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- return 0;
-}
-
-// dialogs that use SfxBindings
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( Window* /*pParent*/, const SfxBindings&, sal_uInt32 )
-{
- return 0;
-}
-
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateFrameDialog(
- Window* pParent, const Reference< frame::XFrame >& rxFrame,
- sal_uInt32 nResId, const String& rParameter )
-{
- Dialog* pDlg = NULL;
- if ( SID_OPTIONS_TREEDIALOG == nResId || SID_OPTIONS_DATABASES == nResId )
- {
- // only activate last page if we dont want to activate a special page
- bool bActivateLastSelection = ( nResId != SID_OPTIONS_DATABASES && rParameter.Len() == 0 );
- OfaTreeOptionsDialog* pOptDlg = new OfaTreeOptionsDialog( pParent, rxFrame, bActivateLastSelection );
- if ( nResId == SID_OPTIONS_DATABASES )
- pOptDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS);
- else if ( rParameter.Len() > 0 )
- pOptDlg->ActivatePage( rParameter );
- pDlg = pOptDlg;
- }
-
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- else
- return NULL;
-}
-
-// TabDialog outside the drawing layer
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nResId,
- Window* pParent,
- const SfxItemSet* pAttrSet,
- SfxViewFrame* ,
- bool /*bEditFmt*/,
- const String * )
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_OFA_AUTOCORR_DLG :
- pDlg = new OfaAutoCorrDlg( pParent, pAttrSet );
- break;
- case RID_SVXDLG_CUSTOMIZE :
- pDlg = new SvxConfigDialog( pParent, pAttrSet );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nResId,
- Window* pParent,
- const SfxItemSet* pAttrSet,
- const Reference< frame::XFrame >& xViewFrame,
- bool /*bEditFmt*/,
- const String * )
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_OFA_AUTOCORR_DLG :
- pDlg = new OfaAutoCorrDlg( pParent, pAttrSet );
- break;
- case RID_SVXDLG_CUSTOMIZE :
- {
- SvxConfigDialog* pDlg1 = new SvxConfigDialog( pParent, pAttrSet );
- pDlg1->SetFrame(xViewFrame);
- pDlg = (SfxTabDialog*)pDlg1;
- }
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-
-// TabDialog that use functionality of the drawing layer
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTextTabDialog( Window* pParent,
- const SfxItemSet* pAttrSet,
- sal_uInt32 nResId,
- SdrView* pView,
- SdrModel* )
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_TEXT :
- pDlg = new SvxTextTabDialog( pParent, pAttrSet, pView );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-
-//TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog CHINA001
-AbstractSvxCaptionDialog* AbstractDialogFactory_Impl::CreateCaptionDialog( Window* pParent,
- const SdrView* pView,
- sal_uInt32 nResId,
- USHORT nAnchorTypes )
-{
- SvxCaptionTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_CAPTION :
- pDlg = new SvxCaptionTabDialog( pParent, pView, nAnchorTypes );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxCaptionDialog_Impl( pDlg );
- return 0;
-}
-
-AbstractSvxDistributeDialog* AbstractDialogFactory_Impl::CreateSvxDistributeDialog(Window* pParent,
- const SfxItemSet& rAttr,
- sal_uInt32 nResId,
- SvxDistributeHorizontal eHor ,
- SvxDistributeVertical eVer)
-{
- SvxDistributeDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXPAGE_DISTRIBUTE :
- pDlg = new SvxDistributeDialog( pParent, rAttr, eHor, eVer);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxDistributeDialog_Impl( pDlg );
- return 0;
-}
-
-AbstractHangulHanjaConversionDialog* AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(Window* pParent,
- HangulHanjaConversion::ConversionDirection _ePrimaryDirection,
- sal_uInt32 nResId)
-{
- HangulHanjaConversionDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_MDLG_HANGULHANJA :
- pDlg = new HangulHanjaConversionDialog( pParent, _ePrimaryDirection);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractHangulHanjaConversionDialog_Impl( pDlg );
- return 0;
-}
-
-AbstractFmShowColsDialog * AbstractDialogFactory_Impl::CreateFmShowColsDialog( Window* pParent, //add for FmShowColsDialog
- sal_uInt32 nResId)
-{
- FmShowColsDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_DLG_SHOWGRIDCOLUMNS :
- pDlg = new FmShowColsDialog( pParent);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractFmShowColsDialog_Impl( pDlg );
- return 0;
-}
-AbstractSvxZoomDialog * AbstractDialogFactory_Impl::CreateSvxZoomDialog( Window* pParent, //add for SvxZoomDialog
- const SfxItemSet& rCoreSet,
- sal_uInt32 nResId)
-{
- SvxZoomDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_ZOOM :
- pDlg = new SvxZoomDialog( pParent, rCoreSet);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxZoomDialog_Impl( pDlg );
- return 0;
-}
-
-/*-- 04.05.2004 08:18:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-AbstractSpellDialog * AbstractDialogFactory_Impl::CreateSvxSpellDialog(
- Window* pParent,
- SfxBindings* pBindings,
- svx::SpellDialogChildWindow* pSpellChildWindow )
-{
- svx::SpellDialog* pDlg = new svx::SpellDialog(pSpellChildWindow, pParent, pBindings);
- return new AbstractSpellDialog_Impl(pDlg);
-}
-
-//CHINA001 GalleryDialog start
-VclAbstractRefreshableDialog * AbstractDialogFactory_Impl::CreateActualizeProgressDialog( Window* pParent, //add for ActualizeProgress
- GalleryTheme* pThm,
- sal_uInt32 nResId)
-{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_GALLERY_ACTUALIZE_PROGRESS :
- pDlg = new ActualizeProgress( pParent, pThm);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new VclAbstractRefreshableDialog_Impl( pDlg );
- return 0;
-}
-
-AbstractSearchProgress * AbstractDialogFactory_Impl::CreateSearchProgressDialog( Window* pParent, //add for SearchProgress
- const INetURLObject& rStartURL,
- sal_uInt32 nResId)
-{
- SearchProgress* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_GALLERY_SEARCH_PROGRESS :
- pDlg = new SearchProgress( pParent, rStartURL);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSearchProgress_Impl( pDlg );
- return 0;
-}
-
-AbstractTakeProgress * AbstractDialogFactory_Impl::CreateTakeProgressDialog( Window* pParent, //add for TakeProgress
- sal_uInt32 nResId)
-{
- TakeProgress* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_GALLERY_TAKE_PROGRESS :
- pDlg = new TakeProgress( pParent );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTakeProgress_Impl( pDlg );
- return 0;
-}
-
-VclAbstractDialog*
-AbstractDialogFactory_Impl::CreateScriptErrorDialog(
- Window* pParent, ::com::sun::star::uno::Any aException )
-{
- return new SvxScriptErrorDialog( pParent, aException );
-}
-
-AbstractScriptSelectorDialog*
-AbstractDialogFactory_Impl::CreateScriptSelectorDialog(
- Window* pParent, BOOL bShowSlots, const Reference< frame::XFrame >& _rxFrame )
-{
- SvxScriptSelectorDialog* pDlg = NULL;
-
- pDlg = new SvxScriptSelectorDialog( pParent, bShowSlots, _rxFrame );
-
- if (pDlg)
- {
- return new AbstractScriptSelectorDialog_Impl( pDlg );
- }
- return 0;
-}
-
-String AbstractScriptSelectorDialog_Impl::GetScriptURL() const
-{
- if (pDlg)
- return pDlg->GetScriptURL();
- return String();
-}
-
-void AbstractScriptSelectorDialog_Impl::SetRunLabel()
-{
- if (pDlg)
- pDlg->SetRunLabel();
- return;
-}
-
-VclAbstractDialog * AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog( Window* pParent, //add for SvxScriptOrgDialog
- const String& rLanguage)
-{
- Dialog* pDlg=NULL;
-
- pDlg = new SvxScriptOrgDialog( pParent, rLanguage);
-
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- return 0;
-}
-
-AbstractTitleDialog * AbstractDialogFactory_Impl::CreateTitleDialog( Window* pParent, //add for TitleDialog
- const String& rOldText,
- sal_uInt32 nResId)
-{
- TitleDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_GALLERY_TITLE :
- pDlg = new TitleDialog( pParent, rOldText);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTitleDialog_Impl( pDlg );
- return 0;
-}
-
-AbstractGalleryIdDialog * AbstractDialogFactory_Impl::CreateGalleryIdDialog( Window* pParent, //add for SvxZoomDialog
- GalleryTheme* pThm,
- sal_uInt32 nResId)
-{
- GalleryIdDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_GALLERY_THEMEID :
- pDlg = new GalleryIdDialog( pParent, pThm);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractGalleryIdDialog_Impl( pDlg );
- return 0;
-}
-
-VclAbstractDialog2 * AbstractDialogFactory_Impl::CreateGalleryThemePropertiesDialog( Window* pParent, //add for GalleryThemeProperties
- ExchangeData* pData,
- SfxItemSet* pItemSet,
- sal_uInt32 nResId)
-{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXTABDLG_GALLERYTHEME :
- pDlg = new GalleryThemeProperties( pParent, pData, pItemSet);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new VclAbstractDialog2_Impl( pDlg );
- return 0;
-}
-//CHINA001 GalleryDialog end
-
-AbstractURLDlg * AbstractDialogFactory_Impl::CreateURLDialog( Window* pParent, //add for URLDlg
- const String& rURL, const String& rAltText, const String& rDescription,
- const String& rTarget, const String& rName,
- TargetList& rTargetList )
-{
- URLDlg* pDlg = new URLDlg( pParent, rURL, rAltText, rDescription, rTarget, rName, rTargetList);
- return new AbstractURLDlg_Impl( pDlg );
-}
-//CHINA001 URLDlg end
-
-//CHINA001 SvxHlinkDlgMarkWnd begin
-AbstractSvxHlinkDlgMarkWnd* AbstractDialogFactory_Impl::CreateSvxHlinkDlgMarkWndDialog( SvxHyperlinkTabPageBase* pParent, sal_uInt32 nResId )
-{
- SvxHlinkDlgMarkWnd* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXFLOAT_HYPERLINK_MARKWND :
- pDlg = new SvxHlinkDlgMarkWnd( pParent );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxHlinkDlgMarkWnd_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxHlinkDlgMarkWnd end
-
-SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( sal_uInt32 nResId,
- Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& ,
- const SfxItemSet* pAttrSet )
-{
- SfxModalDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_CHARMAP :
- pDlg = new SvxCharacterMap( pParent, TRUE, pAttrSet );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSfxDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxCharacterMap end
-
-//CHINA001 SvxSearchFormatDialog begin
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog( Window* pParent,
- const SfxItemSet& rSet,
- sal_uInt32 nResId)
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_SEARCHFORMAT :
- pDlg = new SvxSearchFormatDialog( pParent, rSet );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxSearchFormatDialog end
-
-//CHINA001 SvxSearchAttributeDialog begin
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog( Window* pParent,
- SearchAttrItemList& rLst,
- const USHORT* pWhRanges,
- sal_uInt32 nResId ) //add for SvxSearchAttributeDialog
-{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_SEARCHATTR :
- pDlg = new SvxSearchAttributeDialog( pParent, rLst, pWhRanges);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxSearchAttributeDialog end
-
-//CHINA001 SvxSearchSimilarityDialog begin
-AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchSimilarityDialog( Window* pParent,
- BOOL bRelax,
- USHORT nOther,
- USHORT nShorter,
- USHORT nLonger)
-{
- SvxSearchSimilarityDialog* pDlg = new SvxSearchSimilarityDialog( pParent, bRelax, nOther, nShorter, nLonger );
- if ( pDlg )
- return new AbstractSvxSearchSimilarityDialog_Impl( pDlg );
- return NULL;
-}
-//CHINA001 SvxSearchSimilarityDialog end
-
-//CHINA001 SvxBorderBackgroundDlg begin
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg( Window* pParent,
- const SfxItemSet& rCoreSet,
- sal_uInt32 nResId,
- BOOL bEnableSelector)
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_BBDLG :
- pDlg = new SvxBorderBackgroundDlg( pParent, rCoreSet, bEnableSelector);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxBorderBackgroundDlg end
-
-//CHINA001 SvxTransformTabDialog begin
-AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pView,
- sal_uInt32 nResId,
- USHORT nAnchorTypes )
-{
- SvxTransformTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_TRANSFORM :
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pView, nAnchorTypes);
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxTransformTabDialog_Impl( pDlg );
- return 0;
-}
-
-//CHINA001 SvxTransformTabDialog end
-
-//CHINA001 SchTransformTabDialog begin
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pSdrView,
- sal_uInt32 nResId,
- bool bSizeTabPage
- )
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE :
- {
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE);
- pDlg->RemoveTabPage( RID_SVXPAGE_ANGLE );
- pDlg->RemoveTabPage( RID_SVXPAGE_SLANT );
- }
- break;
- case RID_SCH_TransformTabDLG_SVXPAGE_SLANT:
- {
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE);
- pDlg->RemoveTabPage( RID_SVXPAGE_SLANT );
- }
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SchTransformTabDialog end
-
-//CHINA001 SvxJSearchOptionsDialog begin
-AbstractSvxJSearchOptionsDialog * AbstractDialogFactory_Impl::CreateSvxJSearchOptionsDialog( Window* pParent,
- const SfxItemSet& rOptionsSet, USHORT nUniqueId,
- INT32 nInitialFlags,
- sal_uInt32 nResId)
-{
- SvxJSearchOptionsDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXPAGE_JSEARCH_OPTIONS :
- pDlg = new SvxJSearchOptionsDialog( pParent, rOptionsSet, nUniqueId, nInitialFlags );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxJSearchOptionsDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxJSearchOptionsDialog end
-
-//CHINA001 FmInputRecordNoDialog begin
-AbstractFmInputRecordNoDialog * AbstractDialogFactory_Impl::CreateFmInputRecordNoDialog( Window* pParent,
- sal_uInt32 nResId)
-{
- FmInputRecordNoDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_DLG_INPUTRECORDNO :
- pDlg = new FmInputRecordNoDialog( pParent );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractFmInputRecordNoDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 FmInputRecordNoDialog end
-
-//CHINA001 SvxNewDictionaryDialog begin
-AbstractSvxNewDictionaryDialog * AbstractDialogFactory_Impl::CreateSvxNewDictionaryDialog( Window* pParent,
- ::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl,
- sal_uInt32 nResId )
-{
- SvxNewDictionaryDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SFXDLG_NEWDICT :
- pDlg = new SvxNewDictionaryDialog( pParent, xSpl );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxNewDictionaryDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxNewDictionaryDialog end
-
-//CHINA001 SvxEditDictionaryDialog begin
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialog( Window* pParent,
- const String& rName,
- ::Reference< ::com::sun::star::linguistic2::XSpellChecker1> &xSpl,
- sal_uInt32 nResId )
-{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SFXDLG_EDITDICT :
- pDlg = new SvxEditDictionaryDialog( pParent, rName, xSpl );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxEditDictionaryDialog end
-
-//CHINA001 SvxNameDialog begin
-AbstractSvxNameDialog * AbstractDialogFactory_Impl::CreateSvxNameDialog( Window* pParent,
- const String& rName, const String& rDesc,
- sal_uInt32 nResId )
-{
- SvxNameDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_NAME :
- pDlg = new SvxNameDialog( pParent, rName, rDesc );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxNameDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxNameDialog end
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-
-AbstractSvxObjectNameDialog* AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(Window* pParent, const String& rName, sal_uInt32 nResId)
-{
- return ((RID_SVXDLG_OBJECT_NAME == nResId)
- ? new AbstractSvxObjectNameDialog_Impl(new SvxObjectNameDialog(pParent, rName))
- : NULL);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-
-AbstractSvxObjectTitleDescDialog* AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(Window* pParent, const String& rTitle, const String& rDescription, sal_uInt32 nResId)
-{
- return ((RID_SVXDLG_OBJECT_TITLE_DESC == nResId)
- ? new AbstractSvxObjectTitleDescDialog_Impl(new SvxObjectTitleDescDialog(pParent, rTitle, rDescription))
- : NULL);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-
-//CHINA001 SvxMessDialog begin
-AbstractSvxMessDialog * AbstractDialogFactory_Impl::CreateSvxMessDialog( Window* pParent, sal_uInt32 nResId,
- const String& rText, const String& rDesc, Image* pImg )
-{
- SvxMessDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_MESSBOX :
- pDlg = new SvxMessDialog( pParent, rText, rDesc, pImg );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxMessDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxMessDialog end
-
-//CHINA001 SvxMultiPathDialog begin
-AbstractSvxMultiPathDialog * AbstractDialogFactory_Impl::CreateSvxMultiPathDialog( Window* pParent, sal_uInt32 nResId,
- BOOL bEmptyAllowed )
-{
- SvxMultiPathDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_MULTIPATH :
- pDlg = new SvxMultiPathDialog( pParent, bEmptyAllowed );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxMultiPathDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxMultiPathDialog end
-
-//CHINA001 SvxMultiFileDialog begin
-AbstractSvxMultiFileDialog * AbstractDialogFactory_Impl::CreateSvxMultiFileDialog( Window* pParent, sal_uInt32 nResId,
- BOOL bEmptyAllowed )
-{
- SvxMultiFileDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_MULTIPATH :
- pDlg = new SvxMultiFileDialog( pParent, bEmptyAllowed );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxMultiFileDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxMultiFileDialog end
-
-//CHINA001 SvxHpLinkDlg begin
-AbstractSvxHpLinkDlg * AbstractDialogFactory_Impl::CreateSvxHpLinkDlg (Window* pParent, //add for SvxMultiFileDialog
- SfxBindings* pBindings,
- sal_uInt32 nResId)
-{
- SvxHpLinkDlg* pDlg=NULL;
- switch ( nResId )
- {
- case SID_HYPERLINK_DIALOG :
- pDlg = new SvxHpLinkDlg( pParent, pBindings );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxHpLinkDlg_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxHpLinkDlg end
-
-//CHINA001 FmSearchDialog begin
-AbstractFmSearchDialog* AbstractDialogFactory_Impl::CreateFmSearchDialog(Window* pParent, //add for FmSearchDialog
- const String& strInitialText,
- const ::std::vector< String >& _rContexts,
- sal_Int16 nInitialContext,
- const Link& lnkContextSupplier)
-{
- FmSearchDialog* pDlg = new FmSearchDialog( pParent, strInitialText, _rContexts, nInitialContext, lnkContextSupplier );
- if ( pDlg )
- return new AbstractFmSearchDialog_Impl( pDlg );
- return 0;
-}
-
-//CHINA001 FmSearchDialog end
-
-//CHINA001 GraphicFilterEmboss begin
-AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterEmboss (Window* pParent, //add for GraphicFilterEmboss
- const Graphic& rGraphic,
- RECT_POINT eLightSource,
- sal_uInt32 nResId)
-{
- GraphicFilterDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_GRFFILTER_DLG_EMBOSS :
- pDlg = new GraphicFilterEmboss( pParent, rGraphic, eLightSource );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractGraphicFilterDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 GraphicFilterEmboss end
-
-//CHINA001 GraphicFilterPoster & GraphicFilterSepia begin
-AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPosterSepia (Window* pParent, //add for GraphicFilterPoster & GraphicFilterSepia
- const Graphic& rGraphic,
- USHORT nCount,
- sal_uInt32 nResId)
-{
- GraphicFilterDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_GRFFILTER_DLG_POSTER :
- pDlg = new GraphicFilterPoster( pParent, rGraphic, nCount );
- break;
- case RID_SVX_GRFFILTER_DLG_SEPIA :
- pDlg = new GraphicFilterSepia( pParent, rGraphic, nCount );
- break;
-
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractGraphicFilterDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 GraphicFilterPoster & GraphicFilterSepia end
-
-//CHINA001 GraphicFilterSolarize begin
-AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSolarize (Window* pParent, //add for GraphicFilterSolarize
- const Graphic& rGraphic,
- BYTE nGreyThreshold, BOOL bInvert,
- sal_uInt32 nResId)
-{
- GraphicFilterDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_GRFFILTER_DLG_SOLARIZE :
- pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractGraphicFilterDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 GraphicFilterSolarize end
-
-//CHINA001 GraphicFilterMosaic begin
-AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMosaic (Window* pParent, //add for GraphicFilterMosaic
- const Graphic& rGraphic,
- USHORT nTileWidth, USHORT nTileHeight, BOOL bEnhanceEdges,
- sal_uInt32 nResId)
-{
- GraphicFilterDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVX_GRFFILTER_DLG_MOSAIC :
- pDlg = new GraphicFilterMosaic( pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractGraphicFilterDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 GraphicFilterMosaic end
-//CHINA001 SvxAreaTabDialog begin
-AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( Window* pParent,
- const SfxItemSet* pAttr,
- SdrModel* pModel,
- sal_uInt32 nResId,
- const SdrView* pSdrView )
-{
- SvxAreaTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_AREA :
- pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel,pSdrView );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxAreaTabDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxAreaTabDialog end
-//CHINA001 SvxLineTabDialog begin
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog
- SdrModel* pModel,
- sal_uInt32 nResId,
- const SdrObject* pObj ,
- BOOL bHasObj)
-{
- SfxTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_LINE :
- pDlg = new SvxLineTabDialog( pParent, pAttr, pModel,pObj,bHasObj );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractTabDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxLineTabDialog end
-
-SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent,
- const SfxItemSet& rAttr,
- const Reference< XFrame >& _rxDocumentFrame,
- sal_uInt32 nResId
- )
-{
- SfxModalDialog* pDlg=NULL;
- switch ( nResId )
- {
- case SID_EVENTCONFIG :
- pDlg = new SfxMacroAssignDlg( pParent, _rxDocumentFrame, rAttr );
- break;
- case RID_SVXPAGE_MACROASSIGN :
- pDlg = new SvxShortcutAssignDlg( pParent, _rxDocumentFrame, rAttr );
- break;
- case RID_SVXDLG_CHARMAP :
- pDlg = new SvxCharacterMap( pParent, TRUE, &rAttr );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSfxDialog_Impl( pDlg );
- return 0;
-}
-
-//CHINA001 SvxMeasureDialog & SvxConnectionDialog begin
-SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent,
- const SfxItemSet& rAttr,
- const SdrView* pView,
- sal_uInt32 nResId
- )
-{
- SfxSingleTabDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXPAGE_MEASURE :
- pDlg = new SvxMeasureDialog( pParent, rAttr, pView );
- break;
- case RID_SVXPAGE_CONNECTION :
- pDlg = new SvxConnectionDialog( pParent, rAttr, pView );
- break;
- case RID_SFXPAGE_DBREGISTER :
- pDlg = new DatabaseRegistrationDialog( pParent, rAttr );
- break;
- case RID_SVXPAGE_IMPROVEMENT :
- {
- String help_url;
- SFX_ITEMSET_ARG( &rAttr, pItem, SfxStringItem, SID_CURRENT_URL, sal_False );
- if ( pItem )
- help_url = pItem->GetValue();
- pDlg = new SvxImprovementDialog( pParent, help_url);
- }
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSfxDialog_Impl( pDlg );
- return 0;
-}
-
-//CHINA001 SvxPostItDialog begin
-AbstractSvxPostItDialog* AbstractDialogFactory_Impl::CreateSvxPostItDialog( Window* pParent,
- const SfxItemSet& rCoreSet,
- sal_uInt32 nResId,
- BOOL bPrevNext, BOOL bRedline )
-{
- SvxPostItDialog* pDlg=NULL;
- switch ( nResId )
- {
- case RID_SVXDLG_POSTIT :
- pDlg = new SvxPostItDialog( pParent, rCoreSet, bPrevNext, bRedline );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSvxPostItDialog_Impl( pDlg );
- return 0;
-}
-//CHINA001 SvxPostItDialog end
-
-class SvxMacroAssignDialog : public VclAbstractDialog
-{
-public:
- SvxMacroAssignDialog( Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
- const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
- :m_aItems( SFX_APP()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
- {
- m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
- m_pDialog.reset( new SvxMacroAssignDlg( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
- }
-
- virtual short Execute();
- virtual ~SvxMacroAssignDialog();
-
-private:
- SfxItemSet m_aItems;
- ::std::auto_ptr< SvxMacroAssignDlg > m_pDialog;
-};
-
-short SvxMacroAssignDialog::Execute()
-{
- return m_pDialog->Execute();
-}
-
-SvxMacroAssignDialog::~SvxMacroAssignDialog()
-{
-}
-
-VclAbstractDialog * AbstractDialogFactory_Impl::CreateSvxMacroAssignDlg(
- Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
- const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
-{
- return new SvxMacroAssignDialog( _pParent, _rxDocumentFrame, _bUnoDialogMode, _rxEvents, _nInitiallySelectedEvent );
-}
-
-// Factories for TabPages
-CreateTabPage AbstractDialogFactory_Impl::GetTabPageCreatorFunc( USHORT nId )
-{
- switch ( nId )
- {
- case RID_OFA_TP_INTERNATIONAL:
- return ::offapp::InternationalOptionsPage::CreateSc;
- case RID_OFA_TP_INTERNATIONAL_SD:
- case RID_OFA_TP_INTERNATIONAL_IMPR:
- return offapp::InternationalOptionsPage::CreateSd;
- case RID_SVXPAGE_TEXTANIMATION :
- return SvxTextAnimationPage::Create;
- case RID_SVXTABPAGE_GALLERY_GENERAL :
- return TPGalleryThemeGeneral::Create;
- case RID_SVXPAGE_TRANSPARENCE :
- return SvxTransparenceTabPage::Create;
- case RID_SVXPAGE_AREA :
- return SvxAreaTabPage::Create;
- case RID_SVXPAGE_SHADOW :
- return SvxShadowTabPage::Create;
- case RID_SVXPAGE_LINE :
- return SvxLineTabPage::Create;
- case RID_SVXPAGE_CONNECTION :
- return SvxConnectionPage::Create;
- case RID_SVXPAGE_MEASURE :
- return SvxMeasurePage::Create;
- case RID_SFXPAGE_GENERAL :
- return SvxGeneralTabPage::Create;
- case RID_SVXPAGE_PICK_SINGLE_NUM :
- return SvxSingleNumPickTabPage::Create;
- case RID_SVXPAGE_PICK_BMP :
- return SvxBitmapPickTabPage::Create;
- case RID_SVXPAGE_PICK_BULLET :
- return SvxBulletPickTabPage::Create;
- case RID_SVXPAGE_NUM_OPTIONS :
- return SvxNumOptionsTabPage::Create;
- case RID_SVXPAGE_PICK_NUM :
- return SvxNumPickTabPage::Create;
- case RID_SVXPAGE_NUM_POSITION :
- return SvxNumPositionTabPage::Create;
- case RID_SVXPAGE_PARA_ASIAN :
- return SvxAsianTabPage::Create;
- case RID_SVXPAGE_EXT_PARAGRAPH :
- return SvxExtParagraphTabPage::Create;
- case RID_SVXPAGE_ALIGN_PARAGRAPH :
- return SvxParaAlignTabPage::Create;
- case RID_SVXPAGE_STD_PARAGRAPH :
- return SvxStdParagraphTabPage::Create;
- case RID_SVXPAGE_TABULATOR :
- return SvxTabulatorTabPage::Create;
- case RID_SVXPAGE_TEXTATTR :
- return SvxTextAttrPage::Create;
- case RID_SVXPAGE_ALIGNMENT :
- return svx::AlignmentTabPage::Create;
- case RID_SW_TP_BACKGROUND :
- case RID_SVXPAGE_BACKGROUND :
- return SvxBackgroundTabPage::Create;
- case RID_SVXPAGE_BORDER :
- return SvxBorderTabPage::Create;
- case RID_SVXPAGE_CHAR_NAME :
- return SvxCharNamePage::Create;
- case RID_SVXPAGE_CHAR_EFFECTS :
- return SvxCharEffectsPage::Create;
- case RID_SVXPAGE_CHAR_POSITION :
- return SvxCharPositionPage::Create;
- case RID_SVXPAGE_CHAR_TWOLINES :
- return SvxCharTwoLinesPage::Create;
- case RID_SVXPAGE_NUMBERFORMAT :
- return SvxNumberFormatTabPage::Create;
- case RID_SVXPAGE_PAGE :
- return SvxPageDescPage::Create;
- case RID_SVXPAGE_GRFCROP :
- return SvxGrfCropPage::Create;
- case RID_SVXPAGE_MACROASSIGN :
- return SfxMacroTabPage::Create;
- default:
- break;
- }
-
- return 0;
-}
-CreateSvxDistributePage AbstractDialogFactory_Impl::GetSvxDistributePageCreatorFunc(USHORT nId )
-{
- switch ( nId )
- {
- case RID_SVXPAGE_DISTRIBUTE:
- return SvxDistributePage::Create;
- default:
- break;
- }
-
- return 0;
-}
-DialogGetRanges AbstractDialogFactory_Impl::GetDialogGetRangesFunc( USHORT nId )
-{
- switch ( nId )
- {
- case RID_SVXDLG_POSTIT:
- return SvxPostItDialog::GetRanges; //add for SvxPostItDialog
- default:
- break;
- }
-
- return 0;
-}
-GetTabPageRanges AbstractDialogFactory_Impl::GetTabPageRangesFunc( USHORT nId )
-{
- switch ( nId )
- {
- case RID_SVXPAGE_TEXTANIMATION :
- return SvxTextAnimationPage::GetRanges;
- case RID_SVXPAGE_DISTRIBUTE:
- return SvxDistributePage::GetRanges;
- case RID_SVXPAGE_TRANSPARENCE :
- return SvxTransparenceTabPage::GetRanges;
- case RID_SVXPAGE_AREA :
- return SvxAreaTabPage::GetRanges;
- case RID_SVXPAGE_SHADOW :
- return SvxShadowTabPage::GetRanges;
- case RID_SVXPAGE_LINE :
- return SvxLineTabPage::GetRanges;
- case RID_SVXPAGE_CONNECTION :
- return SvxConnectionPage::GetRanges;
- case RID_SVXPAGE_MEASURE :
- return SvxMeasurePage::GetRanges;
- case RID_SVXPAGE_PARA_ASIAN :
- return SvxAsianTabPage::GetRanges;
- case RID_SVXPAGE_EXT_PARAGRAPH :
- return SvxExtParagraphTabPage::GetRanges;
- case RID_SVXPAGE_ALIGN_PARAGRAPH :
- return SvxParaAlignTabPage::GetRanges;
- case RID_SVXPAGE_STD_PARAGRAPH :
- return SvxStdParagraphTabPage::GetRanges;
- case RID_SVXPAGE_TABULATOR :
- return SvxTabulatorTabPage::GetRanges;
- case RID_SVXPAGE_TEXTATTR :
- return SvxTextAttrPage::GetRanges;
- case RID_SVXPAGE_ALIGNMENT :
- return svx::AlignmentTabPage::GetRanges;
- case RID_SW_TP_BACKGROUND :
- case RID_SVXPAGE_BACKGROUND :
- return SvxBackgroundTabPage::GetRanges;
- case RID_SVXPAGE_BORDER :
- return SvxBorderTabPage::GetRanges;
- case RID_SVXPAGE_CHAR_NAME :
- return SvxCharNamePage::GetRanges;
- case RID_SVXPAGE_CHAR_EFFECTS :
- return SvxCharEffectsPage::GetRanges;
- case RID_SVXPAGE_CHAR_POSITION :
- return SvxCharPositionPage::GetRanges;
- case RID_SVXPAGE_CHAR_TWOLINES :
- return SvxCharTwoLinesPage::GetRanges;
- case RID_SVXPAGE_NUMBERFORMAT :
- return SvxNumberFormatTabPage::GetRanges;
- case RID_SVXPAGE_PAGE :
- return SvxPageDescPage::GetRanges;
- case RID_SVXPAGE_ASIAN_LAYOUT:
- return SvxAsianLayoutPage::GetRanges;
- default:
- break;
- }
-
- return 0;
-}
-
-SfxAbstractInsertObjectDialog* AbstractDialogFactory_Impl::CreateInsertObjectDialog( Window* pParent, USHORT nSlotId,
- const Reference < com::sun::star::embed::XStorage >& xStor,
- const SvObjectServerList* pList )
-{
- InsertObjectDialog_Impl* pDlg=0;
- switch ( nSlotId )
- {
- case SID_INSERT_OBJECT : pDlg = new SvInsertOleDlg( pParent, xStor, pList ); break;
- case SID_INSERT_PLUGIN : pDlg = new SvInsertPlugInDialog( pParent, xStor ); break;
- case SID_INSERT_APPLET : pDlg = new SvInsertAppletDialog( pParent, xStor ); break;
- case SID_INSERT_FLOATINGFRAME : pDlg = new SfxInsertFloatingFrameDialog( pParent, xStor ); break;
- default: break;
- }
-
- if ( pDlg )
- {
- pDlg->SetHelpId( nSlotId );
- return new AbstractInsertObjectDialog_Impl( pDlg );
- }
- return 0;
-}
-
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateEditObjectDialog( Window* pParent, USHORT nSlotId,
- const Reference < com::sun::star::embed::XEmbeddedObject >& xObj )
-{
- InsertObjectDialog_Impl* pDlg=0;
- switch ( nSlotId )
- {
- case SID_INSERT_APPLET : pDlg = new SvInsertAppletDialog( pParent, xObj ); break;
- case SID_INSERT_FLOATINGFRAME : pDlg = new SfxInsertFloatingFrameDialog( pParent, xObj ); break;
- default: break;
- }
-
- if ( pDlg )
- {
- pDlg->SetHelpId( nSlotId );
- return new VclAbstractDialog_Impl( pDlg );
- }
- return 0;
-}
-
-SfxAbstractPasteDialog* AbstractDialogFactory_Impl::CreatePasteDialog( Window* pParent )
-{
- return new AbstractPasteDialog_Impl( new SvPasteObjectDialog( pParent ) );
-}
-
-SfxAbstractLinksDialog* AbstractDialogFactory_Impl::CreateLinksDialog( Window* pParent, sfx2::SvLinkManager* pMgr, BOOL bHTML, sfx2::SvBaseLink* p)
-{
- SvBaseLinksDlg* pLinkDlg = new SvBaseLinksDlg( pParent, pMgr, bHTML );
- if ( p )
- pLinkDlg->SetActLink(p);
- return new AbstractLinksDialog_Impl( pLinkDlg );
-}
-
-SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* /*pObj*/ )
-{
- return new AbstractTabDialog_Impl( new SvxFormatCellsDialog( pParent, pAttr, pModel ) );
-}
-
-SvxAbstractSplittTableDialog* AbstractDialogFactory_Impl::CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
-{
- return new SvxSplitTableDlg( pParent, bIsTableVertical, nMaxVertical, nMaxHorizontal );
-}
-
-SvxAbstractNewTableDialog* AbstractDialogFactory_Impl::CreateSvxNewTableDialog( Window* pParent )
-{
- return new SvxNewTableDialog( pParent );
-}
-
-VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog(
- Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& /*rApplicationContext*/ )
-{
- return new VclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
-}
-
-SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId )
-{
- return new SvxInsRowColDlg( pParent, bCol, nHelpId );
-}
diff --git a/svx/source/cui/dlgfact.hxx b/svx/source/cui/dlgfact.hxx
deleted file mode 100644
index a6bd99c97d..0000000000
--- a/svx/source/cui/dlgfact.hxx
+++ /dev/null
@@ -1,818 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dlgfact.hxx,v $
- * $Revision: 1.35 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CUI_DLGFACT_HXX
-#define _CUI_DLGFACT_HXX
-// include ---------------------------------------------------------------
-#include <svx/svxdlg.hxx> //CHINA001 #include <svx/svxdlg.hxx>
-#include <com/sun/star/container/XNameReplace.hpp>
-
-#include "tools/link.hxx"
-#include <com/sun/star/frame/XFrame.hpp>
-
-//#include <sfx2/basedlgs.hxx>
-//#include "dstribut.hxx"
-//#include "cuigaldlg.hxx"
-//#include "cuiimapwnd.hxx"
-//#include "hlmarkwn.hxx"
-//#include "cuicharmap.hxx"
-//#include "srchxtra.hxx"
-
-class SfxTabDialog;
-class SfxModalDialog;
-class Dialog;
-class SfxItemPool;
-class FmShowColsDialog;
-class SvxZoomDialog;
-class FmInputRecordNoDialog;
-class SvxJSearchOptionsDialog;
-class FmFormShell;
-class SvxNewDictionaryDialog;
-class SvxNameDialog;
-
-// #i68101#
-class SvxObjectNameDialog;
-class SvxObjectTitleDescDialog;
-
-class SvxMessDialog;
-class SvxMultiPathDialog;
-class SvxMultiFileDialog;
-class SvxHpLinkDlg;
-class FmSearchDialog;
-class Graphic;
-class GraphicFilterDialog;
-class SvxAreaTabDialog;
-class InsertObjectDialog_Impl;
-class SvPasteObjectDialog;
-class SvBaseLinksDlg;
-class SvxTransformTabDialog;
-class SvxCaptionTabDialog;
-
-namespace svx{
-class HangulHanjaConversionDialog;
-}
-using namespace svx;
-
-#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- DialogClass* pDlg; \
-public: \
- Class( DialogClass* p) \
- : pDlg(p) \
- {} \
- virtual ~Class(); \
- virtual short Execute() ;
-// virtual void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 )
-
-#define IMPL_ABSTDLG_BASE(Class) \
-Class::~Class() \
-{ \
- delete pDlg; \
-} \
-short Class::Execute() \
-{ \
- return pDlg->Execute(); \
-}
-
-//for GalleryThemeProperties begin
-class VclAbstractDialog2_Impl : public VclAbstractDialog2
-{
- Dialog* m_pDlg;
- Link m_aEndDlgHdl;
-public:
- VclAbstractDialog2_Impl( Dialog* p ) : m_pDlg( p ) {} \
- virtual ~VclAbstractDialog2_Impl();
- virtual void StartExecuteModal( const Link& rEndDialogHdl );
- virtual long GetResult();
-private:
- DECL_LINK( EndDialogHdl, Dialog* );
-};
-//for GalleryThemeProperties end
-
-class VclAbstractDialog_Impl : public VclAbstractDialog
-{
- DECL_ABSTDLG_BASE(VclAbstractDialog_Impl,Dialog)
-};
-
-//for ActualizeProgress begin
-class VclAbstractRefreshableDialog_Impl : public VclAbstractRefreshableDialog
-{
- DECL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl,Dialog)
- virtual void Update() ;
- virtual void Sync() ;
-};
-//for ActualizeProgress end
-
-class AbstractSfxDialog_Impl : public SfxAbstractDialog
-{
- DECL_ABSTDLG_BASE(AbstractSfxDialog_Impl,SfxModalDialog)
- virtual const SfxItemSet* GetOutputItemSet() const;
-
- //From class Window.
- virtual void SetText( const XubString& rStr );
- virtual String GetText() const ;
-};
-
-class AbstractTabDialog_Impl : public SfxAbstractTabDialog
-{
- DECL_ABSTDLG_BASE(AbstractTabDialog_Impl,SfxTabDialog)
- virtual void SetCurPageId( USHORT nId );
- virtual const SfxItemSet* GetOutputItemSet() const;
- virtual const USHORT* GetInputRanges( const SfxItemPool& pItem ); //add by CHINA001
- virtual void SetInputSet( const SfxItemSet* pInSet ); //add by CHINA001
- //From class Window.
- virtual void SetText( const XubString& rStr ); //add by CHINA001
- virtual String GetText() const; //add by CHINA001
-};
-
-//for SvxDistributeDialog begin
-class SvxDistributeDialog;
-class AbstractSvxDistributeDialog_Impl: public AbstractSvxDistributeDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxDistributeDialog_Impl,SvxDistributeDialog)
-public:
- virtual SvxDistributeHorizontal GetDistributeHor() const;
- virtual SvxDistributeVertical GetDistributeVer() const;
-};
-//for SvxDistributeDialog end
-
-// for HangulHanjaConversionDialog begin
-class AbstractHangulHanjaConversionDialog_Impl: public AbstractHangulHanjaConversionDialog
-{
- DECL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl,HangulHanjaConversionDialog)
- virtual void EndDialog(long nResult = 0);
- virtual void EnableRubySupport( sal_Bool _bVal );
- virtual void SetByCharacter( sal_Bool _bByCharacter ) ;
- virtual void SetConversionDirectionState( sal_Bool _bTryBothDirections, HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection );
- virtual void SetConversionFormat( HangulHanjaConversion::ConversionFormat _eType );
- virtual void SetOptionsChangedHdl( const Link& _rHdl );
- virtual void SetIgnoreHdl( const Link& _rHdl );
- virtual void SetIgnoreAllHdl( const Link& _rHdl ) ;
- virtual void SetChangeHdl( const Link& _rHdl ) ;
- virtual void SetChangeAllHdl( const Link& _rHdl ) ;
- virtual void SetClickByCharacterHdl( const Link& _rHdl ) ;
- virtual void SetConversionFormatChangedHdl( const Link& _rHdl ) ;
- virtual void SetFindHdl( const Link& _rHdl );
- virtual sal_Bool GetUseBothDirections( ) const;
- virtual HangulHanjaConversion::ConversionDirection GetDirection( HangulHanjaConversion::ConversionDirection _eDefaultDirection ) const;
- virtual void SetCurrentString(
- const String& _rNewString,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rSuggestions,
- bool _bOriginatesFromDocument = true
- );
- virtual String GetCurrentString( ) const ;
- virtual HangulHanjaConversion::ConversionFormat GetConversionFormat( ) const ;
- virtual void FocusSuggestion( );
- virtual String GetCurrentSuggestion( ) const;
-};
-
-// for HangulHanjaConversionDialog end
-
-// for FmShowColsDialog begin
-class FmShowColsDialog;
-class AbstractFmShowColsDialog_Impl : public AbstractFmShowColsDialog
-{
- DECL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl,FmShowColsDialog)
- virtual void SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols);
-};
-//for FmShowColsDialog end
-
-
-//for SvxZoomDialog begin
-class SvxZoomDialog;
-class AbstractSvxZoomDialog_Impl : public AbstractSvxZoomDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxZoomDialog_Impl,SvxZoomDialog)
- virtual void SetLimits( USHORT nMin, USHORT nMax );
- virtual void HideButton( USHORT nBtnId );
- virtual const SfxItemSet* GetOutputItemSet() const ;
-
-};
-//for SvxZoomDialog end
-
-//for SvxSpellDialog begin
-namespace svx{ class SpellDialog;}
-class AbstractSpellDialog_Impl : public AbstractSpellDialog
-{
- public:
- DECL_ABSTDLG_BASE(AbstractSpellDialog_Impl, svx::SpellDialog)
- virtual void SetLanguage( sal_uInt16 nLang );
- virtual sal_Bool Close();
- virtual void Invalidate();
- virtual Window* GetWindow();
- virtual SfxBindings& GetBindings();
-};
-
-//for SvxSpellCheckDialog begin
-//STRIP001 class AbstractSvxSpellCheckDialog_Impl : public AbstractSvxSpellCheckDialog //add for FmShowColsDialog
-//STRIP001 {
-//STRIP001 SvxSpellCheckDialog * pDlg;
-//STRIP001 public
-//STRIP001 AbstractSvxSpellCheckDialog_Impl ( SvxSpellCheckDialog* p)
-//STRIP001 : pDlg(p)
-//STRIP001 {}
-//STRIP001 virtual USHORT Execute() ;
-//STRIP001 virtual void SetNewEditWord( const String& _rNew ) ;
-//STRIP001 virtual void SetLanguage( sal_uInt16 nLang ) ;
-//STRIP001 virtual void HideAutoCorrect() ;
-//STRIP001 virtual String GetNewEditWord();
-//STRIP001 virtual void SetNewEditWord( const String& _rNew );
-//STRIP001 }
-//for SvxSpellCheckDialog end
-
-
-//for SearchProgress begin
-class SearchProgress;
-class AbstractSearchProgress_Impl : public AbstractSearchProgress
-{
- DECL_ABSTDLG_BASE(AbstractSearchProgress_Impl,SearchProgress)
- virtual void Update() ;
- virtual void Sync() ;
- virtual void SetFileType( const String& rType ) ;
- virtual void SetDirectory( const INetURLObject& rURL ) ;
- virtual PLinkStub GetLinkStubCleanUpHdl() ;
-
-};
-//for SearchProgress end
-
-//for TakeProgress begin
-class TakeProgress;
-class AbstractTakeProgress_Impl : public AbstractTakeProgress
-{
- DECL_ABSTDLG_BASE(AbstractTakeProgress_Impl,TakeProgress)
- virtual void Update() ;
- virtual void Sync() ;
- virtual void SetFile( const INetURLObject& rURL ) ;
- virtual PLinkStub GetLinkStubCleanUpHdl() ;
-
-};
-//for TakeProgress end
-
-//for TitleDialog begin
-class TitleDialog;
-class AbstractTitleDialog_Impl : public AbstractTitleDialog
-{
- DECL_ABSTDLG_BASE(AbstractTitleDialog_Impl,TitleDialog)
- virtual String GetTitle() const ;
-
-};
-//for TitleDialog end
-
-//for SvxScriptSelectorDialog begin
-class SvxScriptSelectorDialog;
-class AbstractScriptSelectorDialog_Impl : public AbstractScriptSelectorDialog
-{
- DECL_ABSTDLG_BASE(
- AbstractScriptSelectorDialog_Impl, SvxScriptSelectorDialog)
-
- virtual String GetScriptURL() const;
-
- virtual void SetRunLabel();
-};
-
-//for GalleryIdDialog begin
-class GalleryIdDialog;
-class AbstractGalleryIdDialog_Impl : public AbstractGalleryIdDialog
-{
- DECL_ABSTDLG_BASE(AbstractGalleryIdDialog_Impl,GalleryIdDialog)
- virtual ULONG GetId() const ;
-
-};
-//for GalleryIdDialog end
-
-//for URLDlg start
-class URLDlg;
-class AbstractURLDlg_Impl :public AbstractURLDlg
-{
- DECL_ABSTDLG_BASE(AbstractURLDlg_Impl,URLDlg)
- virtual String GetURL() const;
- virtual String GetAltText() const;
- virtual String GetDesc() const;
- virtual String GetTarget() const;
- virtual String GetName() const;
-};
-//for URLDlg end
-
-//for SvxHlinkDlgMarkWnd begin
-class SvxHlinkDlgMarkWnd;
-class AbstractSvxHlinkDlgMarkWnd_Impl : public AbstractSvxHlinkDlgMarkWnd
-{
- DECL_ABSTDLG_BASE(AbstractSvxHlinkDlgMarkWnd_Impl,SvxHlinkDlgMarkWnd)
- virtual void Hide( USHORT nFlags = 0 );
- virtual BOOL IsVisible() const ;
- virtual void Invalidate( USHORT nFlags = 0 );
- virtual void SetSizePixel( const Size& rNewSize );
- virtual Size GetSizePixel() const;
- virtual BOOL MoveTo ( Point aNewPos )const;
- virtual BOOL ConnectToDialog( BOOL bDoit = TRUE )const;
- virtual void RefreshTree ( String aStrURL ) ;
- virtual void SelectEntry ( String aStrMark );
- virtual USHORT SetError( USHORT nError) ;
-
-};
-//for SvxHlinkDlgMarkWnd end
-
-//for SvxSearchSimilarityDialog begin
-class SvxSearchSimilarityDialog;
-class AbstractSvxSearchSimilarityDialog_Impl :public AbstractSvxSearchSimilarityDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxSearchSimilarityDialog_Impl,SvxSearchSimilarityDialog)
- virtual USHORT GetOther();
- virtual USHORT GetShorter();
- virtual USHORT GetLonger();
- virtual BOOL IsRelaxed();
-};
-//for SvxSearchSimilarityDialog end
-
-//for SvxJSearchOptionsDialog end
-class SvxJSearchOptionsDialog;
-class AbstractSvxJSearchOptionsDialog_Impl :public AbstractSvxJSearchOptionsDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl,SvxJSearchOptionsDialog)
- virtual INT32 GetTransliterationFlags() const;
-};
-//for SvxJSearchOptionsDialog end
-
-class AbstractSvxTransformTabDialog_Impl : public AbstractSvxTransformTabDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxTransformTabDialog_Impl,SvxTransformTabDialog)
- virtual void SetValidateFramePosLink( const Link& rLink );
- virtual void SetCurPageId( USHORT nId );
- virtual const SfxItemSet* GetOutputItemSet() const;
- virtual const USHORT* GetInputRanges( const SfxItemPool& pItem );
- virtual void SetInputSet( const SfxItemSet* pInSet );
- virtual void SetText( const XubString& rStr );
- virtual String GetText() const;
-};
-class AbstractSvxCaptionDialog_Impl : public AbstractSvxCaptionDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxCaptionDialog_Impl,SvxCaptionTabDialog)
- virtual void SetValidateFramePosLink( const Link& rLink );
- virtual void SetCurPageId( USHORT nId );
- virtual const SfxItemSet* GetOutputItemSet() const;
- virtual const USHORT* GetInputRanges( const SfxItemPool& pItem );
- virtual void SetInputSet( const SfxItemSet* pInSet );
- virtual void SetText( const XubString& rStr );
- virtual String GetText() const;
-};
-
-//for FmInputRecordNoDialog end
-class FmInputRecordNoDialog;
-class AbstractFmInputRecordNoDialog_Impl :public AbstractFmInputRecordNoDialog
-{
- DECL_ABSTDLG_BASE(AbstractFmInputRecordNoDialog_Impl,FmInputRecordNoDialog)
- virtual void SetValue(long nNew) ;
- virtual long GetValue() const ;
-};
-//for FmInputRecordNoDialog end
-
-//for SvxNewDictionaryDialog end
-class SvxNewDictionaryDialog;
-class AbstractSvxNewDictionaryDialog_Impl :public AbstractSvxNewDictionaryDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxNewDictionaryDialog_Impl,SvxNewDictionaryDialog)
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetNewDictionary();
-};
-//for SvxNewDictionaryDialog end
-
-//for SvxNameDialog end
-class SvxNameDialog;
-class AbstractSvxNameDialog_Impl :public AbstractSvxNameDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxNameDialog_Impl,SvxNameDialog)
- virtual void GetName( String& rName ) ;
- virtual void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) ;
- virtual void SetEditHelpId(ULONG nHelpId) ;
- //from class Window
- virtual void SetHelpId( ULONG nHelpId ) ;
- virtual void SetText( const XubString& rStr ) ;
-private:
- Link aCheckNameHdl;
- DECL_LINK( CheckNameHdl, Window*);
-};
-//for SvxNameDialog end
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-
-// predefines
-class SvxObjectNameDialog;
-class SvxObjectTitleDescDialog;
-
-class AbstractSvxObjectNameDialog_Impl :public AbstractSvxObjectNameDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxObjectNameDialog_Impl, SvxObjectNameDialog)
- virtual void GetName(String& rName) ;
- virtual void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false);
-
-private:
- Link aCheckNameHdl;
- DECL_LINK(CheckNameHdl, Window*);
-};
-
-class AbstractSvxObjectTitleDescDialog_Impl :public AbstractSvxObjectTitleDescDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxObjectTitleDescDialog_Impl, SvxObjectTitleDescDialog)
- virtual void GetTitle(String& rName);
- virtual void GetDescription(String& rName);
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-
-//for SvxMessDialog end
-class SvxMessDialog;
-class AbstractSvxMessDialog_Impl :public AbstractSvxMessDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxMessDialog_Impl,SvxMessDialog)
- virtual void SetButtonText( USHORT nBtnId, const String& rNewTxt );
-};
-//for SvxMessDialog end
-
-//for SvxMultiPathDialog end
-class SvxMultiPathDialog;
-class AbstractSvxMultiPathDialog_Impl :public AbstractSvxMultiPathDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxMultiPathDialog_Impl,SvxMultiPathDialog)
- virtual String GetPath() const;
- virtual void SetPath( const String& rPath );
- virtual void EnableRadioButtonMode();
- virtual void SetTitle( const String& rNewTitle );
-};
-//for SvxMultiPathDialog end
-
-//for SvxMultiFileDialog begin
-class SvxMultiFileDialog;
-class AbstractSvxMultiFileDialog_Impl :public AbstractSvxMultiFileDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxMultiFileDialog_Impl,SvxMultiFileDialog)
- virtual String GetFiles() const ;
- virtual void SetFiles( const String& rPath ) ;
- //from SvxMultiPathDialog
- virtual String GetPath() const;
- virtual void SetPath( const String& rPath );
- virtual void SetClassPathMode();
- virtual void EnableRadioButtonMode();
- virtual void SetTitle( const String& rNewTitle );
- //From Class Window
- virtual void SetHelpId( ULONG nHelpId ) ;
-
-};
-//for SvxMultiFileDialog end
-
-//for SvxHpLinkDlg begin
-class SvxHpLinkDlg;
-class AbstractSvxHpLinkDlg_Impl :public AbstractSvxHpLinkDlg
-{
- DECL_ABSTDLG_BASE(AbstractSvxHpLinkDlg_Impl,SvxHpLinkDlg)
- virtual Window* GetWindow();
- virtual sal_Bool QueryClose();
-};
-//for SvxHpLinkDlg end
-
-//for FmSearchDialog begin
-class FmSearchDialog;
-class AbstractFmSearchDialog_Impl :public AbstractFmSearchDialog
-{
- DECL_ABSTDLG_BASE(AbstractFmSearchDialog_Impl,FmSearchDialog)
- virtual void SetFoundHandler(const Link& lnk) ;
- virtual void SetCanceledNotFoundHdl(const Link& lnk);
- virtual void SetActiveField(const String& strField);
-};
-//for FmSearchDialog end
-
-//for GraphicFilterDialog begin
-class GraphicFilterDialog;
-class AbstractGraphicFilterDialog_Impl :public AbstractGraphicFilterDialog
-{
- DECL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl,GraphicFilterDialog)
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
-};
-//for GraphicFilterDialog end
-
-//add for SvxAreaTabDialog begin
-class SvxAreaTabDialog;
-class AbstractSvxAreaTabDialog_Impl :public AbstractSvxAreaTabDialog
-{
- DECL_ABSTDLG_BASE(AbstractSvxAreaTabDialog_Impl,SvxAreaTabDialog)
- virtual void SetCurPageId( USHORT nId );
- virtual const SfxItemSet* GetOutputItemSet() const;
- virtual const USHORT* GetInputRanges( const SfxItemPool& pItem );
- virtual void SetInputSet( const SfxItemSet* pInSet );
- //From class Window.
- virtual void SetText( const XubString& rStr );
- virtual String GetText() const;
- virtual void DontDeleteColorTable() ;
-};
-//add for SvxAreaTabDialog end
-
-class AbstractInsertObjectDialog_Impl : public SfxAbstractInsertObjectDialog
-{
- DECL_ABSTDLG_BASE(AbstractInsertObjectDialog_Impl, InsertObjectDialog_Impl)
- virtual com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
- virtual BOOL IsCreateNew();
-};
-
-class AbstractPasteDialog_Impl : public SfxAbstractPasteDialog
-{
-public:
- DECL_ABSTDLG_BASE(AbstractPasteDialog_Impl, SvPasteObjectDialog )
- virtual void Insert( SotFormatStringId nFormat, const String & rFormatName );
- virtual void SetObjName( const SvGlobalName & rClass, const String & rObjName );
- virtual ULONG GetFormat( const TransferableDataHelper& aHelper,
- const DataFlavorExVector* pFormats=0,
- const TransferableObjectDescriptor* pDesc=0 );
-};
-
-class AbstractLinksDialog_Impl : public SfxAbstractLinksDialog
-{
-public:
- DECL_ABSTDLG_BASE(AbstractLinksDialog_Impl, SvBaseLinksDlg )
-};
-
-
-//add for SvxPostItDialog begin
-class SvxPostItDialog;
-class AbstractSvxPostItDialog_Impl :public AbstractSvxPostItDialog
-{
- DECL_ABSTDLG_BASE( AbstractSvxPostItDialog_Impl, SvxPostItDialog )
- virtual void SetText( const XubString& rStr ); //From class Window
- virtual const SfxItemSet* GetOutputItemSet() const;
- virtual void SetPrevHdl( const Link& rLink ) ;
- virtual void SetNextHdl( const Link& rLink ) ;
- virtual void EnableTravel(BOOL bNext, BOOL bPrev) ;
- virtual String GetNote() ;
- virtual void SetNote(const String& rTxt) ;
- virtual void ShowLastAuthor(const String& rAuthor, const String& rDate) ;
- virtual void DontChangeAuthor() ;
- virtual void HideAuthor() ;
- virtual void SetReadonlyPostIt(BOOL bDisable) ;
- virtual BOOL IsOkEnabled() const ;
- virtual Window * GetWindow();
-private:
- Link aNextHdl;
- Link aPrevHdl;
- DECL_LINK( NextHdl, Window*);
- DECL_LINK( PrevHdl, Window*);
-};
-//add for SvxPostItDialog end
-
-//------------------------------------------------------------------------
-//AbstractDialogFactory_Impl implementations
-class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory
-{
-
-public:
- virtual VclAbstractDialog* CreateVclDialog( Window* pParent, sal_uInt32 nResId );
- virtual VclAbstractDialog* CreateSfxDialog( Window* pParent, const SfxBindings& rBindings, sal_uInt32 nResId );
- virtual SfxAbstractDialog* CreateSfxDialog( sal_uInt32 nResId,
- Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xViewFrame,
- const SfxItemSet* pAttrSet=0 );
- virtual SfxAbstractDialog* CreateSfxDialog( Window* pParent,
- const SfxItemSet& rAttr,
- const SdrView* pView,
- sal_uInt32 nResId );
- virtual SfxAbstractDialog* CreateSfxDialog( Window* pParent, //add for SvxMeasureDialog & SvxConnectionDialog
- const SfxItemSet& rAttr,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame,
- sal_uInt32 nResId
- );
- virtual VclAbstractDialog* CreateFrameDialog( Window* pParent, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame, sal_uInt32 nResId, const String& rParameter );
- virtual SfxAbstractTabDialog* CreateTabDialog( sal_uInt32 nResId,
- Window* pParent,
- const SfxItemSet* pAttrSet,
- SfxViewFrame* pViewFrame,
- bool bEditFmt=false,
- const String *pUserButtonText=0 );
- virtual SfxAbstractTabDialog* CreateTabDialog( sal_uInt32 nResId,
- Window* pParent,
- const SfxItemSet* pAttrSet,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xViewFrame,
- bool bEditFmt=false,
- const String *pUserButtonText=0 );
- virtual SfxAbstractTabDialog* CreateTextTabDialog( Window* pParent,
- const SfxItemSet* pAttrSet,
- sal_uInt32 nResId,
- SdrView* pView,
- SdrModel* pModel=0 ); //add for SvxTextTabDialog
- virtual SfxAbstractTabDialog* CreateTabItemDialog( Window* pParent,
- const SfxItemSet& rSet,
- sal_uInt32 nResId); //add by CHINA001
- virtual AbstractSvxCaptionDialog* CreateCaptionDialog( Window* pParent,
- const SdrView* pView,
- sal_uInt32 nResId,
- USHORT nAnchorTypes = 0 ); //add for SvxCaptionTabDialog CHINA001
- virtual AbstractSvxDistributeDialog* CreateSvxDistributeDialog(Window* pParent,
- const SfxItemSet& rAttr,
- sal_uInt32 nResId,
- SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
- SvxDistributeVertical eVer = SvxDistributeVerticalNone);
- virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, USHORT nSlotId,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStor,
- const SvObjectServerList* pList = 0 );
- virtual VclAbstractDialog* CreateEditObjectDialog( Window* pParent, USHORT nSlotId,
- const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
- virtual SfxAbstractPasteDialog* CreatePasteDialog( Window* pParent );
- virtual SfxAbstractLinksDialog* CreateLinksDialog( Window* pParent, sfx2::SvLinkManager* pMgr, BOOL bHTML, sfx2::SvBaseLink* p=0 );
-
- virtual AbstractHangulHanjaConversionDialog * CreateHangulHanjaConversionDialog( Window* _pParent, //add for HangulHanjaConversionDialog CHINA001
- HangulHanjaConversion::ConversionDirection _ePrimaryDirection,
- sal_uInt32 nResId);
-
- virtual AbstractFmShowColsDialog * CreateFmShowColsDialog( Window* pParent, //add for FmShowColsDialog
- sal_uInt32 nResId);
- virtual AbstractSvxZoomDialog * CreateSvxZoomDialog( Window* pParent, //add for SvxZoomDialog
- const SfxItemSet& rCoreSet,
- sal_uInt32 nResId);
- virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( Window* pParent, //add for SvxBorderBackgroundDlg
- const SfxItemSet& rCoreSet,
- sal_uInt32 nResId,
- BOOL bEnableSelector = FALSE) ;
- virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( Window* pParent, //add for SvxTransformTabDialog
- const SfxItemSet* pAttr,
- const SdrView* pView,
- sal_uInt32 nResId,
- USHORT nAnchorTypes = 0) ;
- virtual SfxAbstractTabDialog* CreateSchTransformTabDialog( Window* pParent, //add for SchTransformTabDialog
- const SfxItemSet* pAttr,
- const SdrView* pSdrView,
- sal_uInt32 nResId,
- bool bSizeTabPage = false
- );
- virtual AbstractSpellDialog * CreateSvxSpellDialog(
- Window* pParent,
- SfxBindings* pBindings,
- svx::SpellDialogChildWindow* pSpellChildWindow );
-
-//STRIP001 virtual AbstractSvxSpellCheckDialog * CreateSvxSpellCheckDialog( Window* pParent, //add for SvxSpellCheckDialog
-//STRIP001 ::com::sun::star::uno::Reference<
-//STRIP001 ::com::sun::star::linguistic2::XSpellChecker1 > &xChecker,
-//STRIP001 SvxSpellWrapper* pWrapper,
-//STRIP001 sal_uInt32 nResId);
- virtual VclAbstractRefreshableDialog * CreateActualizeProgressDialog( Window* pParent, //add for ActualizeProgress
- GalleryTheme* pThm,
- sal_uInt32 nResId);
- virtual AbstractSearchProgress * CreateSearchProgressDialog( Window* pParent, //add for SearchProgress
- const INetURLObject& rStartURL,
- sal_uInt32 nResId);
- virtual AbstractTakeProgress * CreateTakeProgressDialog( Window* pParent, //add for TakeProgress
- sal_uInt32 nResId);
- virtual AbstractTitleDialog * CreateTitleDialog( Window* pParent, //add for TitleDialog
- const String& rOldText,
- sal_uInt32 nResId);
- virtual AbstractGalleryIdDialog * CreateGalleryIdDialog( Window* pParent, //add for SvxZoomDialog
- GalleryTheme* pThm,
- sal_uInt32 nResId);
- virtual VclAbstractDialog2 * CreateGalleryThemePropertiesDialog( Window* pParent, //add for GalleryThemeProperties
- ExchangeData* pData,
- SfxItemSet* pItemSet,
- sal_uInt32 nResId);
- virtual AbstractURLDlg * CreateURLDialog( Window* pParent, //add for URLDlg
- const String& rURL, const String& rAltText, const String& rDescription,
- const String& rTarget, const String& rName,
- TargetList& rTargetList );
- virtual AbstractSvxHlinkDlgMarkWnd* CreateSvxHlinkDlgMarkWndDialog( SvxHyperlinkTabPageBase* pParent, sal_uInt32 nResId ); //add for SvxHlinkDlgMarkWnd
-
- virtual VclAbstractDialog* CreateSvxSearchAttributeDialog( Window* pParent,
- SearchAttrItemList& rLst,
- const USHORT* pWhRanges,
- sal_uInt32 nResId ); //add for SvxSearchAttributeDialog
- virtual AbstractSvxSearchSimilarityDialog * CreateSvxSearchSimilarityDialog( Window* pParent,
- BOOL bRelax,
- USHORT nOther,
- USHORT nShorter,
- USHORT nLonger); //add for SvxSearchSimilarityDialog
- virtual AbstractSvxJSearchOptionsDialog * CreateSvxJSearchOptionsDialog( Window* pParent,
- const SfxItemSet& rOptionsSet, USHORT nUniqueId,
- INT32 nInitialFlags,
- sal_uInt32 nResId); //add for SvxJSearchOptionsDialog
- virtual AbstractFmInputRecordNoDialog * CreateFmInputRecordNoDialog( Window* pParent,
- sal_uInt32 nResId); //add for FmInputRecordNoDialog
- virtual AbstractSvxNewDictionaryDialog* CreateSvxNewDictionaryDialog( Window* pParent,
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl,
- sal_uInt32 nResId ); //add for SvxNewDictionaryDialog
- virtual VclAbstractDialog * CreateSvxEditDictionaryDialog( Window* pParent,
- const String& rName,
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1> &xSpl,
- sal_uInt32 nResId);//add for SvxEditDictionaryDialog
- virtual AbstractSvxNameDialog * CreateSvxNameDialog( Window* pParent,
- const String& rName, const String& rDesc,
- sal_uInt32 nResId ); //add for SvxNameDialog
-
- // #i68101#
- virtual AbstractSvxObjectNameDialog* CreateSvxObjectNameDialog(Window* pParent, const String& rName, sal_uInt32 nResId);
- virtual AbstractSvxObjectTitleDescDialog* CreateSvxObjectTitleDescDialog(Window* pParent, const String& rTitle, const String& rDescription, sal_uInt32 nResId);
-
- virtual AbstractSvxMessDialog * CreateSvxMessDialog( Window* pParent, sal_uInt32 nResId,
- const String& rText, const String& rDesc,
- Image* pImg = NULL ); //add for SvxMessDialog
- virtual AbstractSvxMultiPathDialog * CreateSvxMultiPathDialog( Window* pParent, sal_uInt32 nResId,
- BOOL bEmptyAllowed = FALSE ); //add for SvxMultiPathDialog
- virtual AbstractSvxMultiFileDialog * CreateSvxMultiFileDialog( Window* pParent, sal_uInt32 nResId,
- BOOL bEmptyAllowed = FALSE ); //add for SvxMultiFileDialog
- virtual AbstractSvxHpLinkDlg * CreateSvxHpLinkDlg (Window* pParent, //add for SvxHpLink
- SfxBindings* pBindings,
- sal_uInt32 nResId);
- virtual AbstractFmSearchDialog* CreateFmSearchDialog(Window* pParent, //add for FmSearchDialog
- const String& strInitialText,
- const ::std::vector< String >& _rContexts,
- sal_Int16 nInitialContext,
- const Link& lnkContextSupplier);
- virtual AbstractGraphicFilterDialog * CreateGraphicFilterEmboss (Window* pParent, //add for GraphicFilterEmboss
- const Graphic& rGraphic,
- RECT_POINT eLightSource,
- sal_uInt32 nResId);
- virtual AbstractGraphicFilterDialog * CreateGraphicFilterPosterSepia (Window* pParent, //add for GraphicFilterPoster & GraphicFilterSepia
- const Graphic& rGraphic,
- USHORT nCount,
- sal_uInt32 nResId);
- virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent, //add for GraphicFilterSolarize
- const Graphic& rGraphic,
- BYTE nGreyThreshold, BOOL bInvert,
- sal_uInt32 nResId);
- virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent, //add for GraphicFilterMosaic
- const Graphic& rGraphic,
- USHORT nTileWidth, USHORT nTileHeight, BOOL bEnhanceEdges,
- sal_uInt32 nResId);
- virtual AbstractSvxAreaTabDialog* CreateSvxAreaTabDialog( Window* pParent,//add for SvxAreaTabDialog
- const SfxItemSet* pAttr,
- SdrModel* pModel,
- sal_uInt32 nResId,
- const SdrView* pSdrView = NULL ); //add for SvxAreaTabDialog
- virtual SfxAbstractTabDialog* CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, //add for SvxLineTabDialog
- SdrModel* pModel,
- sal_uInt32 nResId,
- const SdrObject* pObj = NULL,
- BOOL bHasObj = TRUE );
- virtual AbstractSvxPostItDialog* CreateSvxPostItDialog( Window* pParent, //add for SvxPostItDialog
- const SfxItemSet& rCoreSet,
- sal_uInt32 nResId,
- BOOL bPrevNext = FALSE, BOOL bRedline = FALSE );
-
- // For TabPage
- virtual CreateTabPage GetTabPageCreatorFunc( USHORT nId );
- virtual CreateSvxDistributePage GetSvxDistributePageCreatorFunc(USHORT nId );
-
-
- virtual GetTabPageRanges GetTabPageRangesFunc( USHORT nId );
- virtual DialogGetRanges GetDialogGetRangesFunc( USHORT nId ); //add for SvxPostItDialog
- virtual VclAbstractDialog* CreateSvxScriptOrgDialog( Window* pParent, const String& rLanguage );
-
- virtual AbstractScriptSelectorDialog*
- CreateScriptSelectorDialog(
- Window* pParent,
- BOOL bShowSlots,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
- );
-
- virtual VclAbstractDialog* CreateScriptErrorDialog(
- Window* pParent, ::com::sun::star::uno::Any aException);
-
- virtual VclAbstractDialog* CreateSvxMacroAssignDlg(
- Window* _pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxDocumentFrame,
- const bool _bUnoDialogMode,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace >& _rxEvents,
- const sal_uInt16 _nInitiallySelectedEvent
- );
-
- virtual SfxAbstractTabDialog* CreateSvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* pObj = NULL );
-
- virtual SvxAbstractSplittTableDialog* CreateSvxSplittTableDialog( Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal );
-
- virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) ;
-
- virtual VclAbstractDialog* CreateOptionsDialog(
- Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& rApplicationContext );
-
- virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId );
-};
-
-#endif
-
diff --git a/svx/source/cui/dlgname.cxx b/svx/source/cui/dlgname.cxx
deleted file mode 100644
index 7358247101..0000000000
--- a/svx/source/cui/dlgname.cxx
+++ /dev/null
@@ -1,243 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dlgname.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <tools/ref.hxx>
-#include <tools/list.hxx>
-#include <tools/shl.hxx>
-#include <tools/debug.hxx>
-#include <vcl/msgbox.hxx>
-
-#include <svx/dialogs.hrc>
-
-#include "dlgname.hxx"
-#include "defdlgname.hxx" //CHINA001
-#include "dlgname.hrc"
-#include <svx/dialmgr.hxx>
-
-#define MAX_DESCRIPTION_LINES ((long)5)
-
-/*************************************************************************
-|*
-|* Dialog zum Editieren eines Namens
-|*
-\************************************************************************/
-
-SvxNameDialog::SvxNameDialog( Window* pWindow, const String& rName, const String& rDesc ) :
- ModalDialog ( pWindow, SVX_RES( RID_SVXDLG_NAME ) ),
- aFtDescription ( this, SVX_RES( FT_DESCRIPTION ) ),
- aEdtName ( this, SVX_RES( EDT_STRING ) ),
- aBtnOK ( this, SVX_RES( BTN_OK ) ),
- aBtnCancel ( this, SVX_RES( BTN_CANCEL ) ),
- aBtnHelp ( this, SVX_RES( BTN_HELP ) )
-{
- FreeResource();
-
- aFtDescription.SetText( rDesc );
- aEdtName.SetText( rName );
- aEdtName.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
- ModifyHdl(&aEdtName);
- aEdtName.SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl));
-
- // dynamic height of the description field
- Size aSize = aFtDescription.GetSizePixel();
- long nTxtWidth = aFtDescription.GetCtrlTextWidth( rDesc );
- if ( nTxtWidth > aSize.Width() )
- {
- long nLines = Min( ( nTxtWidth / aSize.Width() + 1 ), MAX_DESCRIPTION_LINES );
- long nHeight = aSize.Height();
- aSize.Height() = nHeight * nLines;
- aFtDescription.SetSizePixel( aSize );
- Point aPnt = aEdtName.GetPosPixel();
- aPnt.Y() += ( aSize.Height() - nHeight );
- aEdtName.SetPosPixel( aPnt );
- }
-}
-
-/* -----------------------------27.02.2002 15:22------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxNameDialog, ModifyHdl, Edit*, EMPTYARG)
-{
- if(aCheckNameHdl.IsSet())
- aBtnOK.Enable(aCheckNameHdl.Call(this) > 0);
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-// Dialog for editing Object Name
-// plus uniqueness-callback-linkHandler
-
-SvxObjectNameDialog::SvxObjectNameDialog(
- Window* pWindow,
- const String& rName)
-: ModalDialog(pWindow, SVX_RES(RID_SVXDLG_OBJECT_NAME)),
- aFtName(this, SVX_RES(NTD_FT_NAME)),
- aEdtName(this, SVX_RES(NTD_EDT_NAME)),
- aFlSeparator(this, SVX_RES(FL_SEPARATOR_A)),
- aBtnHelp(this, SVX_RES(BTN_HELP)),
- aBtnOK(this, SVX_RES(BTN_OK)),
- aBtnCancel(this, SVX_RES(BTN_CANCEL))
-{
- FreeResource();
-
- // set name
- aEdtName.SetText(rName);
-
- // activate name
- aEdtName.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
- ModifyHdl(&aEdtName);
- aEdtName.SetModifyHdl(LINK(this, SvxObjectNameDialog, ModifyHdl));
-}
-
-IMPL_LINK(SvxObjectNameDialog, ModifyHdl, Edit*, EMPTYARG)
-{
- if(aCheckNameHdl.IsSet())
- {
- aBtnOK.Enable(aCheckNameHdl.Call(this) > 0);
- }
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-// Dialog for editing Object Title and Description
-
-SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
- Window* pWindow,
- const String& rTitle,
- const String& rDescription)
-: ModalDialog(pWindow, SVX_RES(RID_SVXDLG_OBJECT_TITLE_DESC)),
- aFtTitle(this, SVX_RES(NTD_FT_TITLE)),
- aEdtTitle(this, SVX_RES(NTD_EDT_TITLE)),
- aFtDescription(this, SVX_RES(NTD_FT_DESC)),
- aEdtDescription(this, SVX_RES(NTD_EDT_DESC)),
- aFlSeparator(this, SVX_RES(FL_SEPARATOR_B)),
- aBtnHelp(this, SVX_RES(BTN_HELP)),
- aBtnOK(this, SVX_RES(BTN_OK)),
- aBtnCancel(this, SVX_RES(BTN_CANCEL))
-{
- FreeResource();
-
- // set title & desc
- aEdtTitle.SetText(rTitle);
- aEdtDescription.SetText(rDescription);
-
- // activate title
- aEdtTitle.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-
-/*************************************************************************
-|*
-|* Dialog zum Abbrechen, Speichern oder Hinzufuegen
-|*
-\************************************************************************/
-
-SvxMessDialog::SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg ) :
- ModalDialog ( pWindow, SVX_RES( RID_SVXDLG_MESSBOX ) ),
- aFtDescription ( this, SVX_RES( FT_DESCRIPTION ) ),
- aBtn1 ( this, SVX_RES( BTN_1 ) ),
- aBtn2 ( this, SVX_RES( BTN_2 ) ),
- aBtnCancel ( this, SVX_RES( BTN_CANCEL ) ),
- aFtImage ( this )
-{
- FreeResource();
-
- if( pImg )
- {
- pImage = new Image( *pImg );
- aFtImage.SetImage( *pImage );
- aFtImage.SetStyle( ( aFtImage.GetStyle()/* | WB_NOTABSTOP */) & ~WB_3DLOOK );
- aFtImage.SetPosSizePixel( LogicToPixel( Point( 3, 6 ), MAP_APPFONT ),
- aFtImage.GetImage().GetSizePixel() );
- aFtImage.Show();
- }
-
- SetText( rText );
- aFtDescription.SetText( rDesc );
-
- aBtn1.SetClickHdl( LINK( this, SvxMessDialog, Button1Hdl ) );
- aBtn2.SetClickHdl( LINK( this, SvxMessDialog, Button2Hdl ) );
-}
-
-SvxMessDialog::~SvxMessDialog()
-{
- if( pImage )
- delete pImage;
-}
-
-/*************************************************************************/
-
-IMPL_LINK_INLINE_START( SvxMessDialog, Button1Hdl, Button *, EMPTYARG )
-{
- EndDialog( RET_BTN_1 );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxMessDialog, Button1Hdl, Button *, EMPTYARG )
-
-/*************************************************************************/
-
-IMPL_LINK_INLINE_START( SvxMessDialog, Button2Hdl, Button *, EMPTYARG )
-{
- EndDialog( RET_BTN_2 );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxMessDialog, Button2Hdl, Button *, EMPTYARG )
-
-/*************************************************************************/
-
-void SvxMessDialog::SetButtonText( USHORT nBtnId, const String& rNewTxt )
-{
- switch ( nBtnId )
- {
- case MESS_BTN_1:
- aBtn1.SetText( rNewTxt );
- break;
-
- case MESS_BTN_2:
- aBtn2.SetText( rNewTxt );
- break;
-
- default:
- DBG_ERROR( "Falsche Button-Nummer!!!" );
- }
-}
-
-
diff --git a/svx/source/cui/dlgname.hrc b/svx/source/cui/dlgname.hrc
deleted file mode 100644
index 80ec21290f..0000000000
--- a/svx/source/cui/dlgname.hrc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dlgname.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define EDT_STRING 1
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define FT_DESCRIPTION 1
-#define BTN_1 1
-#define BTN_2 2
-
-// #i68101#
-#define NTD_FT_NAME 2
-#define NTD_EDT_NAME 2
-#define NTD_FT_TITLE 3
-#define NTD_EDT_TITLE 3
-#define NTD_FT_DESC 4
-#define NTD_EDT_DESC 4
-#define FL_SEPARATOR_A 1
-#define FL_SEPARATOR_B 2
-
-// eof
diff --git a/svx/source/cui/dlgname.hxx b/svx/source/cui/dlgname.hxx
deleted file mode 100644
index cd13055a40..0000000000
--- a/svx/source/cui/dlgname.hxx
+++ /dev/null
@@ -1,207 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dlgname.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_DLG_NAME_HXX
-#define _SVX_DLG_NAME_HXX
-
-
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
-#include <vcl/dialog.hxx>
-#endif
-#include <vcl/fixed.hxx>
-
-// #i68101#
-#include <svtools/svmedit.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Editieren eines Namens
-|*
-\************************************************************************/
-class SvxNameDialog : public ModalDialog
-{
-private:
- FixedText aFtDescription;
- Edit aEdtName;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- Link aCheckNameHdl;
-#if _SOLAR__PRIVATE
- DECL_LINK(ModifyHdl, Edit*);
-#endif
-
-public:
- SvxNameDialog( Window* pWindow, const String& rName, const String& rDesc );
-
- void GetName( String& rName ){rName = aEdtName.GetText();}
-
- /** add a callback Link that is called whenever the content of the edit
- field is changed. The Link result determines wether the OK
- Button is enabled (> 0) or disabled (== 0).
-
- @param rLink a Callback declared with DECL_LINK and implemented with
- IMPL_LINK, that is executed on modification.
-
- @param bCheckImmediately If true, the Link is called directly after
- setting it. It is recommended to set this flag to true to avoid
- an inconsistent state if the initial String (given in the CTOR)
- does not satisfy the check condition.
-
- @todo Remove the parameter bCheckImmediately and incorporate the 'true'
- behaviour as default.
- */
- void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
- {
- aCheckNameHdl = rLink;
- if ( bCheckImmediately )
- aBtnOK.Enable( rLink.Call( this ) > 0 );
- }
-
- void SetEditHelpId(ULONG nHelpId) {aEdtName.SetHelpId(nHelpId);}
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-// Dialog for editing Object Title and Description
-// plus uniqueness-callback-linkHandler
-
-class SvxObjectNameDialog : public ModalDialog
-{
-private:
- // name
- FixedText aFtName;
- Edit aEdtName;
-
- // separator
- FixedLine aFlSeparator;
-
- // buttons
- HelpButton aBtnHelp;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
-
- // callback link for name uniqueness
- Link aCheckNameHdl;
-#if _SOLAR__PRIVATE
- DECL_LINK(ModifyHdl, Edit*);
-#endif
-
-public:
- // constructor
- SvxObjectNameDialog(Window* pWindow, const String& rName);
-
- // data access
- void GetName(String& rName) {rName = aEdtName.GetText(); }
-
- // set handler
- void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false)
- {
- aCheckNameHdl = rLink;
-
- if(bCheckImmediately)
- {
- aBtnOK.Enable(rLink.Call(this) > 0);
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-// #i68101#
-// Dialog for editing Object Title and Description
-
-class SvxObjectTitleDescDialog : public ModalDialog
-{
-private:
- // title
- FixedText aFtTitle;
- Edit aEdtTitle;
-
- // description
- FixedText aFtDescription;
- MultiLineEdit aEdtDescription;
-
- // separator
- FixedLine aFlSeparator;
-
- // buttons
- HelpButton aBtnHelp;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
-
-public:
- // constructor
- SvxObjectTitleDescDialog(Window* pWindow, const String& rTitle, const String& rDesc);
-
- // data access
- void GetTitle(String& rTitle) {rTitle = aEdtTitle.GetText(); }
- void GetDescription(String& rDescription) {rDescription = aEdtDescription.GetText(); }
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////
-
-/*************************************************************************
-|*
-|* Dialog zum Abbrechen, Speichern oder Hinzufuegen
-|*
-\************************************************************************/
-class SvxMessDialog : public ModalDialog
-{
-private:
- FixedText aFtDescription;
- PushButton aBtn1;
- PushButton aBtn2;
- CancelButton aBtnCancel;
- FixedImage aFtImage;
- Image* pImage;
-#if _SOLAR__PRIVATE
- DECL_LINK( Button1Hdl, Button * );
- DECL_LINK( Button2Hdl, Button * );
-#endif
-public:
- SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg = NULL );
- ~SvxMessDialog();
-
- void SetButtonText( USHORT nBtnId, const String& rNewTxt );
-};
-
-
-
-#endif // _SVX_DLG_NAME_HXX
-
diff --git a/svx/source/cui/dlgname.src b/svx/source/cui/dlgname.src
deleted file mode 100644
index 2b99ce7e33..0000000000
--- a/svx/source/cui/dlgname.src
+++ /dev/null
@@ -1,272 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dlgname.src,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include ------------------------------------------------------------------
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "dlgname.hrc"
-
-// RID_SVXDLG_NAME ----------------------------------------------------------
-
-ModalDialog RID_SVXDLG_NAME
-{
- HelpId = HID_DLG_NAME ;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 180 , 63 ) ;
- Text [ en-US ] = "Name" ;
- Moveable = TRUE ;
- FixedText FT_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- WordBreak = TRUE ;
- };
- Edit EDT_STRING
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 17 ) ;
- Size = MAP_APPFONT ( 112 , 12 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 124 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 124 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 124 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// #i68101#
-// RID_SVXDLG_OBJECT_NAME ----------------------------------------------------------
-
-ModalDialog RID_SVXDLG_OBJECT_NAME
-{
- HelpId = HID_DLG_OBJECT_NAME;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 180 , 54 + 2) ;
- Text [ en-US ] = "Name" ;
- Moveable = TRUE ;
-
- // name
- FixedText NTD_FT_NAME
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 168 , 8 ) ;
- Text [ en-US ] = "~Name";
- };
- Edit NTD_EDT_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 168 , 12 ) ;
- TabStop = TRUE ;
- };
-
- // divider
- FixedLine FL_SEPARATOR_A
- {
- Pos = MAP_APPFONT ( 0 , 39 - 6 - 2 ) ;
- Size = MAP_APPFONT ( 180 , 8 ) ;
- };
-
- // Buttons
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 6, 39 - 3 + 3) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 174 - (50 + 50 + 6), 39 - 3 + 3) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 174 - (50), 39 - 3 + 3) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// #i68101#
-// RID_SVXDLG_OBJECTTITLE_DESC ----------------------------------------------------------
-
-ModalDialog RID_SVXDLG_OBJECT_TITLE_DESC
-{
- HelpId = HID_DLG_OBJECT_TITLE_DESC;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 180 , 78 + 27 ) ;
- Text [ en-US ] = "Description" ;
- Moveable = TRUE ;
-
- // title
- FixedText NTD_FT_TITLE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 168 , 8 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "~Title";
- };
- Edit NTD_EDT_TITLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 168 , 12 ) ;
- TabStop = TRUE ;
- };
-
- // description
- FixedText NTD_FT_DESC
- {
- Pos = MAP_APPFONT ( 6 , 30 ) ;
- Size = MAP_APPFONT ( 168 , 8 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "~Description";
- };
- MultiLineEdit NTD_EDT_DESC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 41 ) ;
- Size = MAP_APPFONT ( 168 , (12 * 3) - 2 ) ;
- TabStop = TRUE ;
- IgnoreTab = TRUE;
- VScroll = TRUE;
- };
-
- // divider
- FixedLine FL_SEPARATOR_B
- {
- Pos = MAP_APPFONT ( 0 , 41 + 39 ) ;
- Size = MAP_APPFONT ( 180 , 8 ) ;
- };
-
- // Buttons
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 6, 41 + 39 + 3 + 5) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 174 - (50 + 50 + 6), 41 + 39 + 3 + 5) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 174 - (50), 41 + 39 + 3 + 5) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// RID_SVXDLG_MESSBOX -------------------------------------------------------
-
-ModalDialog RID_SVXDLG_MESSBOX
-{
- HelpId = HID_DLG_MESSBOX ;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 212 , 64 ) ;
- Text = "" ;
- Moveable = TRUE ;
- PushButton BTN_1
- {
- Pos = MAP_APPFONT ( 25 , 44 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- PushButton BTN_2
- {
- Pos = MAP_APPFONT ( 78 , 44 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 131 , 44 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 28 , 6 ) ;
- Size = MAP_APPFONT ( 200 , 35 ) ;
- WordBreak = TRUE ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/doclinkdialog.cxx b/svx/source/cui/doclinkdialog.cxx
deleted file mode 100644
index d4dc239aaa..0000000000
--- a/svx/source/cui/doclinkdialog.cxx
+++ /dev/null
@@ -1,235 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: doclinkdialog.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "doclinkdialog.hxx"
-#ifndef _SVX_DOCLINKDIALOG_HRC_
-#include "doclinkdialog.hrc"
-#endif
-#include <svx/dialogs.hrc>
-#include <svx/svxids.hrc>
-#include <tools/debug.hxx>
-#ifndef SVTOOLS_FILENOTATION_HXX_
-#include <svtools/filenotation.hxx>
-#endif
-#include <vcl/msgbox.hxx>
-#include <ucbhelper/content.hxx>
-#include <svx/dialmgr.hxx>
-#include <tools/urlobj.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <sfx2/docfilt.hxx>
-//......................................................................
-namespace svx
-{
-//......................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::ucb;
- using namespace ::svt;
-
- //==================================================================
- //= ODocumentLinkDialog
- //==================================================================
- //------------------------------------------------------------------
- ODocumentLinkDialog::ODocumentLinkDialog( Window* _pParent, sal_Bool _bCreateNew )
- :ModalDialog( _pParent, SVX_RES(DLG_DOCUMENTLINK) )
- ,m_aURLLabel (this, SVX_RES(FT_URL))
- ,m_aURL (this, SVX_RES(CMB_URL))
- ,m_aBrowseFile (this, SVX_RES(PB_BROWSEFILE))
- ,m_aNameLabel (this, SVX_RES(FT_NAME))
- ,m_aName (this, SVX_RES(ET_NAME))
- ,m_aBottomLine (this, SVX_RES(FL_BOTTOM))
- ,m_aOK (this, SVX_RES(BTN_OK))
- ,m_aCancel (this, SVX_RES(BTN_CANCEL))
- ,m_aHelp (this, SVX_RES(BTN_HELP))
- ,m_bCreatingNew(_bCreateNew)
- {
- String sText = String( SVX_RES( m_bCreatingNew ? STR_NEW_LINK : STR_EDIT_LINK ) );
- SetText(sText);
-
- FreeResource();
-
- String sTemp = String::CreateFromAscii("*.odb");
- m_aURL.SetFilter(sTemp);
-
- m_aName.SetModifyHdl( LINK(this, ODocumentLinkDialog, OnTextModified) );
- m_aURL.SetModifyHdl( LINK(this, ODocumentLinkDialog, OnTextModified) );
- m_aBrowseFile.SetClickHdl( LINK(this, ODocumentLinkDialog, OnBrowseFile) );
- m_aOK.SetClickHdl( LINK(this, ODocumentLinkDialog, OnOk) );
-
- m_aURL.SetDropDownLineCount(10);
-
- validate();
-
- // m_aURL.SetHelpId( HID_DOCLINKEDIT_URL );
- m_aURL.SetDropDownLineCount( 5 );
- }
-
- //------------------------------------------------------------------
- void ODocumentLinkDialog::set( const String& _rName, const String& _rURL )
- {
- m_aName.SetText(_rName);
- m_aURL.SetText(_rURL);
- validate();
- }
-
- //------------------------------------------------------------------
- void ODocumentLinkDialog::get( String& _rName, String& _rURL ) const
- {
- _rName = m_aName.GetText();
- _rURL = m_aURL.GetText();
- }
-
- //------------------------------------------------------------------
- void ODocumentLinkDialog::validate( )
- {
-
- m_aOK.Enable( (0 != m_aName.GetText().Len()) && ( 0 != m_aURL.GetText().Len() ) );
- }
-
- //------------------------------------------------------------------
- IMPL_LINK( ODocumentLinkDialog, OnOk, void*, EMPTYARG )
- {
- // get the current URL
- ::rtl::OUString sURL = m_aURL.GetText();
- OFileNotation aTransformer(sURL);
- sURL = aTransformer.get(OFileNotation::N_URL);
-
- // check for the existence of the selected file
- sal_Bool bFileExists = sal_False;
- try
- {
- ::ucbhelper::Content aFile(sURL, Reference< XCommandEnvironment >());
- if (aFile.isDocument())
- bFileExists = sal_True;
- }
- catch(Exception&)
- {
- }
-
- if (!bFileExists)
- {
- String sMsg = String(SVX_RES(STR_LINKEDDOC_DOESNOTEXIST));
- sMsg.SearchAndReplaceAscii("$file$", m_aURL.GetText());
- ErrorBox aError(this, WB_OK , sMsg);
- aError.Execute();
- return 0L;
- } // if (!bFileExists)
- INetURLObject aURL( sURL );
- if ( aURL.GetProtocol() != INET_PROT_FILE )
- {
- String sMsg = String(SVX_RES(STR_LINKEDDOC_NO_SYSTEM_FILE));
- sMsg.SearchAndReplaceAscii("$file$", m_aURL.GetText());
- ErrorBox aError(this, WB_OK , sMsg);
- aError.Execute();
- return 0L;
- }
-
- String sCurrentText = m_aName.GetText();
- if ( m_aNameValidator.IsSet() )
- {
- if ( !m_aNameValidator.Call( &sCurrentText ) )
- {
- String sMsg = String(SVX_RES(STR_NAME_CONFLICT));
- sMsg.SearchAndReplaceAscii("$file$", sCurrentText);
- InfoBox aError(this, sMsg);
- aError.Execute();
-
- m_aName.SetSelection(Selection(0,sCurrentText.Len()));
- m_aName.GrabFocus();
- return 0L;
- }
- }
-
- EndDialog(RET_OK);
- return 0L;
- }
-
- //------------------------------------------------------------------
- IMPL_LINK( ODocumentLinkDialog, OnBrowseFile, void*, EMPTYARG )
- {
- ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN);
- static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)");
- const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType);
- if ( pFilter )
- {
- aFileDlg.AddFilter(pFilter->GetUIName(),pFilter->GetDefaultExtension());
- aFileDlg.SetCurrentFilter(pFilter->GetUIName());
- }
-
- String sPath = m_aURL.GetText();
- if (sPath.Len())
- {
- OFileNotation aTransformer( sPath, OFileNotation::N_SYSTEM );
- aFileDlg.SetDisplayDirectory( aTransformer.get( OFileNotation::N_URL ) );
- }
-
- if (0 != aFileDlg.Execute())
- return 0L;
-
- if (0 == m_aName.GetText().Len())
- { // default the name to the base of the chosen URL
- INetURLObject aParser;
-
- aParser.SetSmartProtocol(INET_PROT_FILE);
- aParser.SetSmartURL(aFileDlg.GetPath());
-
- m_aName.SetText(aParser.getBase(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET));
-
- m_aName.SetSelection(Selection(0,m_aName.GetText().Len()));
- m_aName.GrabFocus();
- }
- else
- m_aURL.GrabFocus();
-
- // get the path in system notation
- OFileNotation aTransformer(aFileDlg.GetPath(), OFileNotation::N_URL);
- m_aURL.SetText(aTransformer.get(OFileNotation::N_SYSTEM));
-
- validate();
- return 0L;
- }
-
- //------------------------------------------------------------------
- IMPL_LINK( ODocumentLinkDialog, OnTextModified, Control*, EMPTYARG )
- {
- validate( );
- return 0L;
- }
-
-//......................................................................
-} // namespace svx
-//......................................................................
-
diff --git a/svx/source/cui/doclinkdialog.hrc b/svx/source/cui/doclinkdialog.hrc
deleted file mode 100644
index b83b0dbf67..0000000000
--- a/svx/source/cui/doclinkdialog.hrc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: doclinkdialog.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_DOCLINKDIALOG_HRC_
-#define _SVX_DOCLINKDIALOG_HRC_
-
-#define FT_NAME 1
-#define FT_URL 2
-
-#define ET_NAME 1
-
-#define CMB_URL 1
-
-#define PB_BROWSEFILE 1
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-
-#define FL_BOTTOM 1
-
-#define STR_EDIT_LINK 1
-#define STR_NEW_LINK 2
-
-#endif // _SVX_DOCLINKDIALOG_HRC_
-
diff --git a/svx/source/cui/doclinkdialog.hxx b/svx/source/cui/doclinkdialog.hxx
deleted file mode 100644
index 04e341c614..0000000000
--- a/svx/source/cui/doclinkdialog.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: doclinkdialog.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_DOCLINKDIALOG_HXX_
-#define _SVX_DOCLINKDIALOG_HXX_
-
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <svtools/inettbc.hxx>
-#include <svtools/urlcontrol.hxx>
-
-//......................................................................
-namespace svx
-{
-//......................................................................
-
- //==================================================================
- //= ODocumentLinkDialog
- //==================================================================
- /** dialog for editing document links associated with data sources
- */
- class ODocumentLinkDialog : public ModalDialog
- {
- protected:
- FixedText m_aURLLabel;
- ::svt::OFileURLControl m_aURL;
- PushButton m_aBrowseFile;
- FixedText m_aNameLabel;
- Edit m_aName;
-
- FixedLine m_aBottomLine;
- OKButton m_aOK;
- CancelButton m_aCancel;
- HelpButton m_aHelp;
-
- sal_Bool m_bCreatingNew;
-
- Link m_aNameValidator;
-
- public:
- ODocumentLinkDialog( Window* _pParent, sal_Bool _bCreateNew );
-
- // name validation has to be done by an external instance
- // the validator link gets a pointer to a String, and should return 0 if the string is not
- // acceptable
- void setNameValidator( const Link& _rValidator ) { m_aNameValidator = _rValidator; }
- Link getNameValidator( ) const { return m_aNameValidator; }
-
- void set( const String& _rName, const String& _rURL );
- void get( String& _rName, String& _rURL ) const;
-
- protected:
- DECL_LINK( OnTextModified, Control* );
- DECL_LINK( OnBrowseFile, void* );
- DECL_LINK( OnOk, void* );
-
- void validate( );
- };
-
-//......................................................................
-} // namespace svx
-//......................................................................
-
-#endif // _SVX_DOCLINKDIALOG_HXX_
-
diff --git a/svx/source/cui/doclinkdialog.src b/svx/source/cui/doclinkdialog.src
deleted file mode 100644
index 29a72695d7..0000000000
--- a/svx/source/cui/doclinkdialog.src
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: doclinkdialog.src,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-#ifndef _SVX_DOCLINKDIALOG_HRC_
-#include "doclinkdialog.hrc"
-#endif
-
-#define DIALOG_SIZE_X 200
-#define DIALOG_SIZE_Y 94
-#define BUTTON_SIZE_X 50
-#define BUTTON_SIZE_Y 14
-
-#define LABEL_WIDTH 50
-
-#define HEIGHT_LABEL 8
-#define HEIGHT_EDIT 12
-
-#define LINE_1_Y 6
-#define LINE_2_Y LINE_1_Y + HEIGHT_EDIT + 4
-#define OFFSET_Y 6
-
-ModalDialog DLG_DOCUMENTLINK
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( DIALOG_SIZE_X , DIALOG_SIZE_Y ) ;
-
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- FixedText FT_URL
- {
-
- Pos = MAP_APPFONT ( 6, LINE_1_Y ) ;
- Size = MAP_APPFONT ( DIALOG_SIZE_X - 6, HEIGHT_LABEL ) ;
- Group = TRUE;
-
- Text [ en-US ] = "~Database file";
- };
- ComboBox CMB_URL
- {
- Pos = MAP_APPFONT ( 6 , LINE_1_Y + OFFSET_Y + HEIGHT_LABEL - 3) ;
- Size = MAP_APPFONT ( DIALOG_SIZE_X - 3*LINE_1_Y - BUTTON_SIZE_X , HEIGHT_EDIT ) ;
-
- SVLook = TRUE ;
- Border = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_BROWSEFILE
- {
- Pos = MAP_APPFONT ( DIALOG_SIZE_X - BUTTON_SIZE_X - 6 , LINE_1_Y + OFFSET_Y + HEIGHT_LABEL - 4) ;
- Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y );
- Text [ en-US ] = "~Browse...";
- };
-
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 6, LINE_1_Y + 2*OFFSET_Y + HEIGHT_LABEL + BUTTON_SIZE_Y - 3) ;
- Size = MAP_APPFONT ( DIALOG_SIZE_X - 6, HEIGHT_LABEL ) ;
- Group = TRUE;
-
- Text [ en-US ] = "Registered ~name";
- };
- Edit ET_NAME
- {
- Pos = MAP_APPFONT ( 6, LINE_1_Y + 3*OFFSET_Y + 2*HEIGHT_LABEL + BUTTON_SIZE_Y - 6) ;
- Size = MAP_APPFONT ( DIALOG_SIZE_X - 3*LINE_1_Y - BUTTON_SIZE_X , HEIGHT_EDIT ) ;
- TabStop = TRUE ;
- Border = TRUE ;
- };
-
- FixedLine FL_BOTTOM
- {
- Pos = MAP_APPFONT ( 4, LINE_1_Y + 4*OFFSET_Y + 2*HEIGHT_LABEL + BUTTON_SIZE_Y + HEIGHT_EDIT - 6);
- Size = MAP_APPFONT ( DIALOG_SIZE_X - 8, 8 );
- };
-
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( DIALOG_SIZE_X - 3 * ( BUTTON_SIZE_X + 3 ) - 6, DIALOG_SIZE_Y - 6 - BUTTON_SIZE_Y );
- Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y );
- DefButton = TRUE;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( DIALOG_SIZE_X - 2 * ( BUTTON_SIZE_X + 3 ) - 6, DIALOG_SIZE_Y - 6 - BUTTON_SIZE_Y );
- Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y );
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( DIALOG_SIZE_X - 1 * ( BUTTON_SIZE_X + 3 ) - 3, DIALOG_SIZE_Y - 6 - BUTTON_SIZE_Y );
- Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y );
- };
-
- String STR_EDIT_LINK
- {
- Text [ en-US ] = "Edit Database Link";
- };
- String STR_NEW_LINK
- {
- Text [ en-US ] = "Create Database Link";
- };
-};
-
-String STR_LINKEDDOC_DOESNOTEXIST
-{
- Text [ en-US ] = "The file\n$file$\ndoes not exist.";
-};
-
-String STR_LINKEDDOC_NO_SYSTEM_FILE
-{
- Text [ en-US ] = "The file\n$file$\ndoes not exist in the local file system.";
-};
-
-String STR_NAME_CONFLICT
-{
- Text [ en-US ] = "The name '$file$' is already used for another database.\nPlease choose a different name.";
-};
-
-QueryBox QUERY_DELETE_CONFIRM
-{
- Buttons = WB_YES_NO ;
- Message [ en-US ] = "Do you want to delete the entry?" ;
-};
diff --git a/svx/source/cui/dstribut.cxx b/svx/source/cui/dstribut.cxx
deleted file mode 100644
index 4d47be04c3..0000000000
--- a/svx/source/cui/dstribut.cxx
+++ /dev/null
@@ -1,251 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dstribut.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <sfx2/basedlgs.hxx>
-
-#include <svx/dialogs.hrc>
-#include "dstribut.hxx"
-#include "dstribut.hrc"
-
-#include <svx/svddef.hxx>
-#include <svx/dialmgr.hxx>
-#include <tools/shl.hxx>
-
-static USHORT pRanges[] =
-{
- SDRATTR_MEASURE_FIRST,
- SDRATTR_MEASURE_LAST,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog
-|*
-\************************************************************************/
-
-SvxDistributeDialog::SvxDistributeDialog(
- Window* pParent,
- const SfxItemSet& rInAttrs,
- SvxDistributeHorizontal eHor,
- SvxDistributeVertical eVer)
-: SfxSingleTabDialog(pParent, rInAttrs, RID_SVXPAGE_DISTRIBUTE ),
- mpPage(0L)
-{
- mpPage = new SvxDistributePage(this, rInAttrs, eHor, eVer);
- SetTabPage(mpPage);
- SetText(mpPage->GetText());
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxDistributeDialog::~SvxDistributeDialog()
-{
-}
-
-/*************************************************************************
-|*
-|* Tabpage
-|*
-\************************************************************************/
-
-SvxDistributePage::SvxDistributePage(
- Window* pWindow,
- const SfxItemSet& rInAttrs,
- SvxDistributeHorizontal eHor,
- SvxDistributeVertical eVer)
-: SvxTabPage(pWindow, SVX_RES(RID_SVXPAGE_DISTRIBUTE), rInAttrs),
- meDistributeHor(eHor),
- meDistributeVer(eVer),
- maFlHorizontal (this, SVX_RES(FL_HORIZONTAL )),
- maBtnHorNone (this, SVX_RES(BTN_HOR_NONE )),
- maBtnHorLeft (this, SVX_RES(BTN_HOR_LEFT )),
- maBtnHorCenter (this, SVX_RES(BTN_HOR_CENTER )),
- maBtnHorDistance (this, SVX_RES(BTN_HOR_DISTANCE )),
- maBtnHorRight (this, SVX_RES(BTN_HOR_RIGHT )),
- maHorLow (this, SVX_RES(IMG_HOR_LOW )),
- maHorCenter (this, SVX_RES(IMG_HOR_CENTER )),
- maHorDistance (this, SVX_RES(IMG_HOR_DISTANCE )),
- maHorHigh (this, SVX_RES(IMG_HOR_HIGH )),
- maFlVertical (this, SVX_RES(FL_VERTICAL )),
- maBtnVerNone (this, SVX_RES(BTN_VER_NONE )),
- maBtnVerTop (this, SVX_RES(BTN_VER_TOP )),
- maBtnVerCenter (this, SVX_RES(BTN_VER_CENTER )),
- maBtnVerDistance (this, SVX_RES(BTN_VER_DISTANCE )),
- maBtnVerBottom (this, SVX_RES(BTN_VER_BOTTOM )),
- maVerLow (this, SVX_RES(IMG_VER_LOW )),
- maVerCenter (this, SVX_RES(IMG_VER_CENTER )),
- maVerDistance (this, SVX_RES(IMG_VER_DISTANCE )),
- maVerHigh (this, SVX_RES(IMG_VER_HIGH ))
-{
- maHorLow.SetModeImage( Image( SVX_RES( IMG_HOR_LOW_H ) ), BMP_COLOR_HIGHCONTRAST );
- maHorCenter.SetModeImage( Image( SVX_RES( IMG_HOR_CENTER_H ) ), BMP_COLOR_HIGHCONTRAST );
- maHorDistance.SetModeImage( Image( SVX_RES( IMG_HOR_DISTANCE_H ) ), BMP_COLOR_HIGHCONTRAST );
- maHorHigh.SetModeImage( Image( SVX_RES( IMG_HOR_HIGH_H ) ), BMP_COLOR_HIGHCONTRAST );
- maVerDistance.SetModeImage( Image( SVX_RES( IMG_VER_DISTANCE_H ) ), BMP_COLOR_HIGHCONTRAST );
- maVerLow.SetModeImage( Image( SVX_RES( IMG_VER_LOW_H ) ), BMP_COLOR_HIGHCONTRAST );
- maVerCenter.SetModeImage( Image( SVX_RES( IMG_VER_CENTER_H ) ), BMP_COLOR_HIGHCONTRAST );
- maVerHigh.SetModeImage( Image( SVX_RES( IMG_VER_HIGH_H ) ), BMP_COLOR_HIGHCONTRAST );
-
- FreeResource();
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxDistributePage::~SvxDistributePage()
-{
-}
-
-/*************************************************************************
-|*
-|* create the tabpage
-|*
-\************************************************************************/
-
-SfxTabPage* SvxDistributePage::Create(Window* pWindow, const SfxItemSet& rAttrs,
- SvxDistributeHorizontal eHor, SvxDistributeVertical eVer)
-{
- return(new SvxDistributePage(pWindow, rAttrs, eHor, eVer));
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-UINT16* SvxDistributePage::GetRanges()
-{
- return(pRanges);
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxDistributePage::PointChanged(Window* /*pWindow*/, RECT_POINT /*eRP*/)
-{
-}
-
-/*************************************************************************
-|*
-|* read the delivered Item-Set
-|*
-\************************************************************************/
-
-void __EXPORT SvxDistributePage::Reset(const SfxItemSet& )
-{
- maBtnHorNone.SetState(FALSE);
- maBtnHorLeft.SetState(FALSE);
- maBtnHorCenter.SetState(FALSE);
- maBtnHorDistance.SetState(FALSE);
- maBtnHorRight.SetState(FALSE);
-
- switch(meDistributeHor)
- {
- case SvxDistributeHorizontalNone : maBtnHorNone.SetState(TRUE); break;
- case SvxDistributeHorizontalLeft : maBtnHorLeft.SetState(TRUE); break;
- case SvxDistributeHorizontalCenter : maBtnHorCenter.SetState(TRUE); break;
- case SvxDistributeHorizontalDistance : maBtnHorDistance.SetState(TRUE); break;
- case SvxDistributeHorizontalRight : maBtnHorRight.SetState(TRUE); break;
- }
-
- maBtnVerNone.SetState(FALSE);
- maBtnVerTop.SetState(FALSE);
- maBtnVerCenter.SetState(FALSE);
- maBtnVerDistance.SetState(FALSE);
- maBtnVerBottom.SetState(FALSE);
-
- switch(meDistributeVer)
- {
- case SvxDistributeVerticalNone : maBtnVerNone.SetState(TRUE); break;
- case SvxDistributeVerticalTop : maBtnVerTop.SetState(TRUE); break;
- case SvxDistributeVerticalCenter : maBtnVerCenter.SetState(TRUE); break;
- case SvxDistributeVerticalDistance : maBtnVerDistance.SetState(TRUE); break;
- case SvxDistributeVerticalBottom : maBtnVerBottom.SetState(TRUE); break;
- }
-}
-
-/*************************************************************************
-|*
-|* Fill the delivered Item-Set with dialogbox-attributes
-|*
-\************************************************************************/
-
-BOOL SvxDistributePage::FillItemSet( SfxItemSet& )
-{
- SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontalNone);
- SvxDistributeVertical eDistributeVer(SvxDistributeVerticalNone);
-
- if(maBtnHorLeft.IsChecked())
- eDistributeHor = SvxDistributeHorizontalLeft;
- else if(maBtnHorCenter.IsChecked())
- eDistributeHor = SvxDistributeHorizontalCenter;
- else if(maBtnHorDistance.IsChecked())
- eDistributeHor = SvxDistributeHorizontalDistance;
- else if(maBtnHorRight.IsChecked())
- eDistributeHor = SvxDistributeHorizontalRight;
-
- if(maBtnVerTop.IsChecked())
- eDistributeVer = SvxDistributeVerticalTop;
- else if(maBtnVerCenter.IsChecked())
- eDistributeVer = SvxDistributeVerticalCenter;
- else if(maBtnVerDistance.IsChecked())
- eDistributeVer = SvxDistributeVerticalDistance;
- else if(maBtnVerBottom.IsChecked())
- eDistributeVer = SvxDistributeVerticalBottom;
-
- if(eDistributeHor != meDistributeHor || eDistributeVer != meDistributeVer)
- {
- meDistributeHor = eDistributeHor;
- meDistributeVer = eDistributeVer;
- return TRUE;
- }
-
- return FALSE;
-}
-
-
diff --git a/svx/source/cui/dstribut.hrc b/svx/source/cui/dstribut.hrc
deleted file mode 100644
index c6d891dc19..0000000000
--- a/svx/source/cui/dstribut.hrc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dstribut.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define FL_HORIZONTAL 1
-#define BTN_HOR_NONE 2
-#define BTN_HOR_LEFT 3
-#define BTN_HOR_CENTER 4
-#define BTN_HOR_DISTANCE 5
-#define BTN_HOR_RIGHT 6
-#define FL_VERTICAL 7
-#define BTN_VER_NONE 8
-#define BTN_VER_TOP 9
-#define BTN_VER_CENTER 10
-#define BTN_VER_DISTANCE 11
-#define BTN_VER_BOTTOM 12
-#define IMG_HOR_LOW 14
-#define IMG_HOR_CENTER 15
-#define IMG_HOR_DISTANCE 16
-#define IMG_HOR_HIGH 17
-#define IMG_VER_LOW 18
-#define IMG_VER_CENTER 19
-#define IMG_VER_DISTANCE 20
-#define IMG_VER_HIGH 21
-
-#define IMG_HOR_LOW_H 22
-#define IMG_HOR_CENTER_H 23
-#define IMG_HOR_DISTANCE_H 24
-#define IMG_HOR_HIGH_H 25
-#define IMG_VER_LOW_H 26
-#define IMG_VER_CENTER_H 27
-#define IMG_VER_DISTANCE_H 28
-#define IMG_VER_HIGH_H 29
diff --git a/svx/source/cui/dstribut.hxx b/svx/source/cui/dstribut.hxx
deleted file mode 100644
index d4642555dd..0000000000
--- a/svx/source/cui/dstribut.hxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dstribut.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_DSTRIBUT_HXX
-#define _SVX_DSTRIBUT_HXX
-
-#include <svx/dlgctrl.hxx>
-#include <vcl/group.hxx>
-#include <vcl/fixed.hxx>
-#include <svx/dstribut_enum.hxx> //CHINA001
-/*************************************************************************
-|*
-\************************************************************************/
-
-/*
-enum SvxDistributeHorizontal
-{
- SvxDistributeHorizontalNone = 0,
- SvxDistributeHorizontalLeft,
- SvxDistributeHorizontalCenter,
- SvxDistributeHorizontalDistance,
- SvxDistributeHorizontalRight
-};
-
-enum SvxDistributeVertical
-{
- SvxDistributeVerticalNone = 0,
- SvxDistributeVerticalTop,
- SvxDistributeVerticalCenter,
- SvxDistributeVerticalDistance,
- SvxDistributeVerticalBottom
-};
-*/
-
-/*************************************************************************
-|*
-\************************************************************************/
-
-class SvxDistributePage : public SvxTabPage
-{
- SvxDistributeHorizontal meDistributeHor;
- SvxDistributeVertical meDistributeVer;
-
- FixedLine maFlHorizontal ;
- RadioButton maBtnHorNone ;
- RadioButton maBtnHorLeft ;
- RadioButton maBtnHorCenter ;
- RadioButton maBtnHorDistance ;
- RadioButton maBtnHorRight ;
- FixedImage maHorLow ;
- FixedImage maHorCenter ;
- FixedImage maHorDistance ;
- FixedImage maHorHigh ;
- FixedLine maFlVertical ;
- RadioButton maBtnVerNone ;
- RadioButton maBtnVerTop ;
- RadioButton maBtnVerCenter ;
- RadioButton maBtnVerDistance ;
- RadioButton maBtnVerBottom ;
- FixedImage maVerLow ;
- FixedImage maVerCenter ;
- FixedImage maVerDistance ;
- FixedImage maVerHigh ;
-
-public:
- SvxDistributePage(Window* pWindow, const SfxItemSet& rInAttrs,
- SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
- SvxDistributeVertical eVer = SvxDistributeVerticalNone);
- ~SvxDistributePage();
-
- static SfxTabPage* Create(Window*, const SfxItemSet&,
- SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
- static UINT16* GetRanges();
- virtual BOOL FillItemSet(SfxItemSet&);
- virtual void Reset(const SfxItemSet&);
- virtual void PointChanged(Window* pWindow, RECT_POINT eRP);
-
- SvxDistributeHorizontal GetDistributeHor() const { return meDistributeHor; }
- SvxDistributeVertical GetDistributeVer() const { return meDistributeVer; }
-};
-
-/*************************************************************************
-|*
-\************************************************************************/
-
-class SvxDistributeDialog : public SfxSingleTabDialog
-{
- SvxDistributePage* mpPage;
-
-public:
- SvxDistributeDialog(Window* pParent, const SfxItemSet& rAttr,
- SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
- SvxDistributeVertical eVer = SvxDistributeVerticalNone);
- ~SvxDistributeDialog();
-
- SvxDistributeHorizontal GetDistributeHor() const { return mpPage->GetDistributeHor(); }
- SvxDistributeVertical GetDistributeVer() const { return mpPage->GetDistributeVer(); }
-};
-
-
-#endif // _SVX_DSTRIBUT_HXX
-
diff --git a/svx/source/cui/dstribut.src b/svx/source/cui/dstribut.src
deleted file mode 100644
index a3239c0d76..0000000000
--- a/svx/source/cui/dstribut.src
+++ /dev/null
@@ -1,293 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dstribut.src,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "dstribut.hrc"
-#include "helpid.hrc"
-
-// RID_SVXPAGE_DISTRIBUTE ---------------------------------------------------
-#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; }
-TabPage RID_SVXPAGE_DISTRIBUTE
-{
- HelpId = HID_PAGE_DISTRIBUTE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 81 ) ;
- Text [ en-US ] = "Distribution" ;
-
- FixedLine FL_HORIZONTAL
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Horizontal" ;
- };
-
- RadioButton BTN_HOR_NONE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 48 , 10 ) ;
- Text [ en-US ] = "~None" ;
- };
-
- RadioButton BTN_HOR_LEFT
- {
- Pos = MAP_APPFONT ( 56 , 26 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Left" ;
- };
-
- RadioButton BTN_HOR_CENTER
- {
- Pos = MAP_APPFONT ( 105 , 26 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Center" ;
- };
-
- RadioButton BTN_HOR_DISTANCE
- {
- Pos = MAP_APPFONT ( 154 , 26 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Spacing" ;
- };
-
- RadioButton BTN_HOR_RIGHT
- {
- Pos = MAP_APPFONT ( 203 , 26 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Right" ;
- };
-
- FixedImage IMG_HOR_LOW {
- Pos = MAP_APPFONT ( 65 , 10 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dsth_low.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedImage IMG_HOR_CENTER {
- Pos = MAP_APPFONT ( 114 , 10 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dsth_cen.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedImage IMG_HOR_DISTANCE {
- Pos = MAP_APPFONT ( 163 , 10 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dsth_dst.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedImage IMG_HOR_HIGH {
- Pos = MAP_APPFONT ( 212 , 10 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dsth_hig.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedLine FL_VERTICAL
- {
- Pos = MAP_APPFONT ( 6 , 42 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Vertical" ;
- };
-
- RadioButton BTN_VER_NONE
- {
- Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 46 , 10 ) ;
- Text [ en-US ] = "N~one" ;
- };
-
- RadioButton BTN_VER_TOP
- {
- Pos = MAP_APPFONT ( 56 , 65 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Top" ;
- };
-
- RadioButton BTN_VER_CENTER
- {
- Pos = MAP_APPFONT ( 105 , 65 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "C~enter" ;
- };
-
- RadioButton BTN_VER_DISTANCE
- {
- Pos = MAP_APPFONT ( 154 , 65 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "S~pacing" ;
- };
-
- RadioButton BTN_VER_BOTTOM
- {
- Pos = MAP_APPFONT ( 203 , 65 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "~Bottom" ;
- };
-
- FixedImage IMG_VER_HIGH {
- Pos = MAP_APPFONT ( 65 , 49 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dstv_hig.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedImage IMG_VER_CENTER {
- Pos = MAP_APPFONT ( 114 , 49 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dstv_cen.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedImage IMG_VER_DISTANCE {
- Pos = MAP_APPFONT ( 163 , 49 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dstv_dst.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- FixedImage IMG_VER_LOW {
- Pos = MAP_APPFONT ( 212 , 49 );
- Size = MAP_APPFONT ( 15 , 16 );
- Hide = FALSE;
- Fixed = Image {
- ImageBitmap = Bitmap { File = "dstv_low.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
-
- Image IMG_HOR_LOW_H
- {
- ImageBitmap = Bitmap { File = "dsth_low_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_HOR_DISTANCE_H
- {
- ImageBitmap = Bitmap { File = "dsth_dst_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_HOR_CENTER_H
- {
- ImageBitmap = Bitmap { File = "dsth_cen_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_HOR_HIGH_H
- {
- ImageBitmap = Bitmap { File = "dsth_hig_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_VER_HIGH_H
- {
- ImageBitmap = Bitmap { File = "dstv_hig_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_VER_CENTER_H
- {
- ImageBitmap = Bitmap { File = "dstv_cen_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_VER_DISTANCE_H
- {
- ImageBitmap = Bitmap { File = "dstv_dst_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
- Image IMG_VER_LOW_H
- {
- ImageBitmap = Bitmap { File = "dstv_low_h.bmp" ; };
- MaskColor = STD_MASKCOLOR ;
- };
-
-};
-
-// ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/eventdlg.cxx b/svx/source/cui/eventdlg.cxx
deleted file mode 100644
index b1ddbe6398..0000000000
--- a/svx/source/cui/eventdlg.cxx
+++ /dev/null
@@ -1,250 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: eventdlg.cxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-// include ***************************************************************
-#include <svtools/svmedit.hxx>
-#include <tools/diagnose_ex.h>
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-
-#include <comphelper/processfactory.hxx>
-#include <comphelper/documentinfo.hxx>
-#include <unotools/configmgr.hxx>
-#include <rtl/ustring.hxx>
-
-#include "eventdlg.hxx"
-
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/evntconf.hxx>
-#include <sfx2/macrconf.hxx>
-#include <sfx2/minfitem.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/docfac.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <svtools/eventcfg.hxx>
-
-#include "headertablistbox.hxx"
-#include "macropg_impl.hxx"
-
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-#include "eventdlg.hrc"
-#include "helpid.hrc"
-#include "selector.hxx"
-#include "cfg.hxx"
-
-
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-// -----------------------------------------------------------------------
-
-SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, SvxEventConfigPage::EarlyInit ) :
-
- _SvxMacroTabPage( pParent, SVX_RES(RID_SVXPAGE_EVENTS), rSet ),
- aSaveInText( this, SVX_RES( TXT_SAVEIN ) ),
- aSaveInListBox( this, SVX_RES( LB_SAVEIN ) ),
- bAppConfig ( TRUE )
-{
- mpImpl->pStrEvent = new String( SVX_RES( STR_EVENT ));
- mpImpl->pAssignedMacro = new String( SVX_RES( STR_ASSMACRO ));
- mpImpl->pEventLB = new _HeaderTabListBox( this, SVX_RES( LB_EVENT ));
- mpImpl->pAssignFT = new FixedText( this, SVX_RES( FT_ASSIGN ));
- mpImpl->pAssignPB = new PushButton( this, SVX_RES( PB_ASSIGN ));
- mpImpl->pDeletePB = new PushButton( this, SVX_RES( PB_DELETE ));
- mpImpl->pMacroImg = new Image( SVX_RES( IMG_MACRO) );
- mpImpl->pComponentImg = new Image( SVX_RES( IMG_COMPONENT) );
- mpImpl->pMacroImg_h = new Image( SVX_RES( IMG_MACRO_H) );
- mpImpl->pComponentImg_h = new Image( SVX_RES( IMG_COMPONENT_H) );
-
- FreeResource();
-
- // must be done after FreeResource is called
- InitResources();
-
- mpImpl->pEventLB->GetListBox().SetHelpId( HID_SVX_MACRO_LB_EVENT );
-
- aSaveInListBox.SetSelectHdl( LINK( this, SvxEventConfigPage,
- SelectHdl_Impl ) );
-
- uno::Reference< document::XEventsSupplier > xSupplier;
-
-// xSupplier = uno::Reference< document::XEventsSupplier >( new GlobalEventConfig());
- xSupplier = uno::Reference< document::XEventsSupplier > (
- ::comphelper::getProcessServiceFactory()->createInstance(
- OUString::createFromAscii(
- "com.sun.star.frame.GlobalEventBroadcaster" ) ),
- uno::UNO_QUERY );
-
- USHORT nPos(0);
- if ( xSupplier.is() )
- {
- m_xAppEvents = xSupplier->getEvents();
- OUString label;
- utl::ConfigManager::GetDirectConfigProperty(
- utl::ConfigManager::PRODUCTNAME ) >>= label;
- nPos = aSaveInListBox.InsertEntry( label );
- aSaveInListBox.SetEntryData( nPos, new bool(true) );
- aSaveInListBox.SelectEntryPos( nPos, TRUE );
- }
-}
-
-// -----------------------------------------------------------------------
-void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFrame )
-{
- SetFrame( _rxFrame );
- ImplInitDocument();
-
- InitAndSetHandler( m_xAppEvents, m_xDocumentEvents, m_xDocumentModifiable );
-
- SelectHdl_Impl( NULL );
-}
-
-// -----------------------------------------------------------------------
-
-SvxEventConfigPage::~SvxEventConfigPage()
-{
- //DF Do I need to delete bools?
-}
-
-// -----------------------------------------------------------------------
-
-void SvxEventConfigPage::ImplInitDocument()
-{
- uno::Reference< frame::XFrame > xFrame( GetFrame() );
- OUString aModuleId = SvxConfigPage::GetFrameWithDefaultAndIdentify( xFrame );
- if ( !xFrame.is() )
- return;
-
- try
- {
- uno::Reference< frame::XModel > xModel;
- if ( !SvxConfigPage::CanConfig( aModuleId ) )
- return;
-
- uno::Reference< frame::XController > xController =
- xFrame->getController();
-
- if ( xController.is() )
- {
- xModel = xController->getModel();
- }
-
- if ( !xModel.is() )
- return;
-
- uno::Reference< document::XEventsSupplier > xSupplier( xModel, uno::UNO_QUERY );
-
- if ( xSupplier.is() )
- {
- m_xDocumentEvents = xSupplier->getEvents();
- m_xDocumentModifiable = m_xDocumentModifiable.query( xModel );
-
- OUString aTitle = ::comphelper::DocumentInfo::getDocumentTitle( xModel );
- USHORT nPos = aSaveInListBox.InsertEntry( aTitle );
-
- aSaveInListBox.SetEntryData( nPos, new bool(false) );
- aSaveInListBox.SelectEntryPos( nPos, TRUE );
-
- bAppConfig = false;
- }
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox )
-{
- (void)pBox;
-
- bool* bApp = (bool*) aSaveInListBox.GetEntryData(
- aSaveInListBox.GetSelectEntryPos());
-
- mpImpl->pEventLB->SetUpdateMode( FALSE );
- bAppConfig = *bApp;
- if ( *bApp )
- {
- SetReadOnly( FALSE );
- _SvxMacroTabPage::DisplayAppEvents( true );
- }
- else
- {
- bool isReadonly = FALSE;
-
- uno::Reference< frame::XFramesSupplier > xFramesSupplier(
- ::comphelper::getProcessServiceFactory()->createInstance(
- OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ),
- uno::UNO_QUERY );
-
- uno::Reference< frame::XFrame > xFrame =
- xFramesSupplier->getActiveFrame();
-
- if ( xFrame.is() )
- {
- uno::Reference< frame::XController > xController =
- xFrame->getController();
-
- if ( xController.is() )
- {
- uno::Reference< frame::XStorable > xStorable(
- xController->getModel(), uno::UNO_QUERY );
- isReadonly = xStorable->isReadonly();
- }
- }
-
- SetReadOnly( isReadonly );
- _SvxMacroTabPage::DisplayAppEvents( false );
- }
-
- mpImpl->pEventLB->SetUpdateMode( TRUE );
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxEventConfigPage::FillItemSet( SfxItemSet& rSet )
-{
- return _SvxMacroTabPage::FillItemSet( rSet );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxEventConfigPage::Reset( const SfxItemSet& )
-{
- _SvxMacroTabPage::Reset();
-}
-
diff --git a/svx/source/cui/eventdlg.hrc b/svx/source/cui/eventdlg.hrc
deleted file mode 100644
index 1e5484cb22..0000000000
--- a/svx/source/cui/eventdlg.hrc
+++ /dev/null
@@ -1,46 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: eventdlg.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* StarView ressource header file */
-
- ////DF temp to figure out what's needed from these
-//DF #include "sfx.hrc"
-#include <svx/dialogs.hrc>
-#include "macropg.hrc"
-
-#define TXT_SAVEIN 10
-#define LB_SAVEIN 11
-
-#define MB_CONFIG 17
-#define CB_WARNING 18
-#define CB_WARNING_ALWAYS 19
-#define GB_SAFETY 20
-#define ID_APP 21
-#define ID_DOC 22
diff --git a/svx/source/cui/eventdlg.src b/svx/source/cui/eventdlg.src
deleted file mode 100644
index b3fa250c51..0000000000
--- a/svx/source/cui/eventdlg.src
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: eventdlg.src,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "helpid.hrc"
-#include "eventdlg.hrc"
-
-#define MASKCOLOR MaskColor = \
- Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
- // TP_CONFIG_EVENT -------------------------------------------------------
-TabPage RID_SVXPAGE_EVENTS
-{
- HelpId = HID_SVX_CONFIG_EVENT ;
- OutputSize = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 272 , 258 ) ;
- String STR_EVENT
- {
- Text [ en-US ] = "Event" ;
- };
- String STR_ASSMACRO
- {
- Text [ en-US ] = "Assigned Action" ;
- };
- Control LB_EVENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 205 , 229 ) ;
- TabStop = TRUE ;
- HelpID = HID_SVX_MACRO_LB_EVENT ;
- };
- FixedText TXT_SAVEIN
- {
- Pos = MAP_APPFONT ( 6 , 240 ) ;
- Size = MAP_APPFONT ( 55 , 8 ) ;
- Group = TRUE ;
- Text [ en-US ] = "Save In" ;
- };
- ListBox LB_SAVEIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 54 , 238 ) ;
- Size = MAP_APPFONT ( 132 , 53 ) ;
- DropDown = TRUE ;
- };
- FixedText FT_ASSIGN
- {
- Pos = MAP_APPFONT ( 217, ROW0 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Assign:" ;
- };
- PushButton PB_ASSIGN
- {
- Pos = MAP_APPFONT ( 217 , ROW0A ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- Text [ en-US ] = "M~acro..." ;
- };
- PushButton PB_DELETE
- {
- Pos = MAP_APPFONT ( 217 , ROW0A+RSC_CD_PUSHBUTTON_HEIGHT+12 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- Text [ en-US ] = "~Remove" ;
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "id018.png"; };
- MASKCOLOR
- };
- Image IMG_COMPONENT
- {
- ImageBitmap = Bitmap { File = "component_16.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO_H
- {
- ImageBitmap = Bitmap { File = "idh018.png"; };
- MASKCOLOR
- };
- Image IMG_COMPONENT_H
- {
- ImageBitmap = Bitmap { File = "component_16_h.png"; };
- MASKCOLOR
- };
-};
diff --git a/svx/source/cui/fontsubs.cxx b/svx/source/cui/fontsubs.cxx
deleted file mode 100644
index 9c35b1a833..0000000000
--- a/svx/source/cui/fontsubs.cxx
+++ /dev/null
@@ -1,625 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontsubs.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#ifdef PRECOMPILED
-#include "svxpch.hxx"
-#endif
-#include <tools/shl.hxx>
-#include <svtools/ctrltool.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#ifndef _OFA_FONTSUBSTCONFIG_HXX
-#include <svtools/fontsubstconfig.hxx>
-#endif
-#include <svtools/sourceviewconfig.hxx>
-
-#include "fontsubs.hrc"
-#include "fontsubs.hxx"
-#include <svx/dialmgr.hxx>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-/*********************************************************************/
-/* */
-/* TabPage Fontersetzung */
-/* */
-/*********************************************************************/
-
-#define CBCOL_FIRST 0
-#define CBCOL_SECOND 1
-#define CBCOL_BOTH 2
-
-SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent,
- const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES(RID_SVX_FONT_SUBSTITUTION), rSet),
- aUseTableCB (this, SVX_RES(CB_USETABLE)),
- aFont1FT (this, SVX_RES(FT_FONT1)),
- aFont1CB (this, SVX_RES(CB_FONT1)),
- aFont2FT (this, SVX_RES(FT_FONT2)),
- aFont2CB (this, SVX_RES(CB_FONT2)),
- aNewDelTBX (this, SVX_RES(TBX_SUBSTNEWDEL)),
- aCheckLB (this, SVX_RES(CLB_SUBSTITUTES)),
-
- aSourceViewFontsFL (this, SVX_RES(FL_SOURCEVIEW )),
- aFontNameFT (this, SVX_RES(FT_FONTNAME )),
- aFontNameLB (this, SVX_RES(LB_FONTNAME )),
- aNonPropFontsOnlyCB(this, SVX_RES(CB_NONPROP )),
- aFontHeightFT (this, SVX_RES(FT_FONTHEIGHT )),
- aFontHeightLB (this, SVX_RES(LB_FONTHEIGHT )),
-
- aImageList (SVX_RES(IL_ICON)),
-
- sAutomatic (SVX_RES( STR_AUTOMATIC )),
- pConfig(new SvtFontSubstConfig),
- pSourceViewConfig(new svt::SourceViewConfig),
-
- sHeader1 (SVX_RES( STR_HEADER1 )),
- sHeader2 (SVX_RES( STR_HEADER2 )),
- sHeader3 (SVX_RES( STR_HEADER3 )),
- sHeader4 (SVX_RES( STR_HEADER4 )),
-
- sFontGroup ("FontSubstitution"),
- pCheckButtonData(0)
-{
- FreeResource();
-
- aTextColor = aCheckLB.GetTextColor();
-
- for(USHORT k = 0; k < aNewDelTBX.GetItemCount(); k++)
- aNewDelTBX.SetItemImage(aNewDelTBX.GetItemId(k),
- aImageList.GetImage(aNewDelTBX.GetItemId(k)));
-
- aNewDelTBX.SetSizePixel( aNewDelTBX.CalcWindowSizePixel() );
-
- long nDelta = ( aFont1CB.GetSizePixel().Height() -
- aNewDelTBX.GetSizePixel().Height() ) / 2;
- Point aNewPnt = aNewDelTBX.GetPosPixel();
- aNewPnt.Y() += nDelta;
- aNewDelTBX.SetPosPixel( aNewPnt );
-
- aCheckLB.SetHelpId(HID_OFA_FONT_SUBST_CLB);
- aCheckLB.SetWindowBits(aCheckLB.GetStyle()|WB_HSCROLL|WB_VSCROLL);
- aCheckLB.SetSelectionMode(MULTIPLE_SELECTION);
- aCheckLB.SortByCol(2);
-
- Link aLink(LINK(this, SvxFontSubstTabPage, SelectHdl));
-
- aCheckLB.SetSelectHdl(aLink);
- aUseTableCB.SetClickHdl(aLink);
- aFont1CB.SetSelectHdl(aLink);
- aFont1CB.SetModifyHdl(aLink);
- aFont2CB.SetSelectHdl(aLink);
- aFont2CB.SetModifyHdl(aLink);
- aNewDelTBX.SetClickHdl(aLink);
-
- aNonPropFontsOnlyCB.SetClickHdl(LINK(this, SvxFontSubstTabPage, NonPropFontsHdl));
-
- static long aStaticTabs[] = { 4, 0, 0, 0, 0 };
- long nW1 = GetTextWidth( sHeader1 );
- long nW2 = GetTextWidth( sHeader2 );
- long nMax = Max( nW1, nW2 ) + 6; // width of the longest header + a little offset
- long nMin = aFontNameFT.LogicToPixel( Size( 30, 0 ), MAP_APPFONT ).Width();
- nMax = Max( nMax, nMin );
- const long nDoubleMax = 2*nMax;
- const long nRest = aCheckLB.GetSizePixel().Width() - nDoubleMax;
- aStaticTabs[2] = nMax;
- aStaticTabs[3] = nDoubleMax;
- aStaticTabs[4] = nDoubleMax + nRest/2;
- aCheckLB.SvxSimpleTable::SetTabs( aStaticTabs, MAP_PIXEL );
-
- String sHeader(sHeader1);
- String sTab(String::CreateFromAscii("\t"));
- String sTabSpace(String::CreateFromAscii("\t "));
- sHeader += sTab;
- sHeader += sHeader2;
- sHeader += sTabSpace;
- sHeader += sHeader3;
- sHeader += sTabSpace;
- sHeader += sHeader4;
-// sHeader += sTabSpace;
- aCheckLB.InsertHeaderEntry(sHeader);
-
- HeaderBar* pBar = aCheckLB.GetTheHeaderBar();
-
- HeaderBarItemBits nBits = pBar->GetItemBits(1) | HIB_FIXEDPOS | HIB_FIXED;
- nBits &= ~HIB_CLICKABLE;
- pBar->SetItemBits(1, nBits);
- pBar->SetItemBits(2, nBits);
-
- USHORT nHeight;
- for(nHeight = 6; nHeight <= 16; nHeight++)
- aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
- for(nHeight = 18; nHeight <= 28; nHeight+= 2)
- aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
- for(nHeight = 32; nHeight <= 48; nHeight+= 4)
- aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
- for(nHeight = 54; nHeight <= 72; nHeight+= 6)
- aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
- for(nHeight = 80; nHeight <= 96; nHeight+= 8)
- aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight));
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-SvLBoxEntry* SvxFontSubstTabPage::CreateEntry(String& rFont1, String& rFont2)
-{
- SvLBoxEntry* pEntry = new SvLBoxEntry;
-
- if( !pCheckButtonData )
- pCheckButtonData = new SvLBoxButtonData( &aCheckLB );
-
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff!
-
- pEntry->AddItem( new SvLBoxButton( pEntry,
- SvLBoxButtonKind_enabledCheckbox, 0,
- pCheckButtonData ) );
- pEntry->AddItem( new SvLBoxButton( pEntry,
- SvLBoxButtonKind_enabledCheckbox, 0,
- pCheckButtonData ) );
-
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rFont1 ) );
- pEntry->AddItem( new SvLBoxString( pEntry, 0, rFont2 ) );
-
- return pEntry;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-
- SvxFontSubstTabPage::~SvxFontSubstTabPage()
-{
- delete pCheckButtonData;
- delete pConfig;
- delete pSourceViewConfig;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-SfxTabPage* SvxFontSubstTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxFontSubstTabPage(pParent, rAttrSet);
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-BOOL SvxFontSubstTabPage::FillItemSet( SfxItemSet& )
-{
- pConfig->ClearSubstitutions();// remove all entries
-
- pConfig->Enable(aUseTableCB.IsChecked());
-
- SvLBoxEntry* pEntry = aCheckLB.First();
-
- while (pEntry)
- {
- SubstitutionStruct aAdd;
- aAdd.sFont = aCheckLB.GetEntryText(pEntry, 0);
- aAdd.sReplaceBy = aCheckLB.GetEntryText(pEntry, 1);
- aAdd.bReplaceAlways = aCheckLB.IsChecked(pEntry, 0);
- aAdd.bReplaceOnScreenOnly = aCheckLB.IsChecked(pEntry, 1);
- pConfig->AddSubstitution(aAdd);
- pEntry = aCheckLB.Next(pEntry);
- }
- if(pConfig->IsModified())
- pConfig->Commit();
- pConfig->Apply();
- if(aFontHeightLB.GetSavedValue() != aFontHeightLB.GetSelectEntryPos())
- pSourceViewConfig->SetFontHeight((sal_Int16)aFontHeightLB.GetSelectEntry().ToInt32());
- if(aNonPropFontsOnlyCB.GetSavedValue() != aNonPropFontsOnlyCB.IsChecked())
- pSourceViewConfig->SetShowProportionalFontsOnly(aNonPropFontsOnlyCB.IsChecked());
- //font name changes cannot be detected by saved values
- String sFontName;
- if(aFontNameLB.GetSelectEntryPos())
- sFontName = aFontNameLB.GetSelectEntry();
- pSourceViewConfig->SetFontName(sFontName);
-
- return FALSE;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-
-void SvxFontSubstTabPage::Reset( const SfxItemSet& )
-{
- aCheckLB.SetUpdateMode(FALSE);
- aCheckLB.Clear();
-
- FontList aFntLst( Application::GetDefaultDevice() );
- aFont1CB.Fill( &aFntLst );
- aFont2CB.Fill( &aFntLst );
-
- sal_Int32 nCount = pConfig->SubstitutionCount();
- if (nCount)
- aUseTableCB.Check(pConfig->IsEnabled());
-
- for (sal_Int32 i = 0; i < nCount; i++)
- {
- const SubstitutionStruct* pSubs = pConfig->GetSubstitution(i);
- String aTmpStr1(pSubs->sFont);
- String aTmpStr2(pSubs->sReplaceBy);
- SvLBoxEntry* pEntry = CreateEntry(aTmpStr1, aTmpStr2);
- aCheckLB.Insert(pEntry);
- aCheckLB.CheckEntry(pEntry, 0, pSubs->bReplaceAlways);
- aCheckLB.CheckEntry(pEntry, 1, pSubs->bReplaceOnScreenOnly);
- }
-
- CheckEnable();
- aCheckLB.SetUpdateMode(TRUE);
-
- //fill font name box first
- aNonPropFontsOnlyCB.Check(pSourceViewConfig->IsShowProportionalFontsOnly());
- NonPropFontsHdl(&aNonPropFontsOnlyCB);
- String sFontName(pSourceViewConfig->GetFontName());
- if(sFontName.Len())
- aFontNameLB.SelectEntry(sFontName);
- else
- aFontNameLB.SelectEntryPos(0);
- short nFontHeight = pSourceViewConfig->GetFontHeight();
- aFontHeightLB.SelectEntry(String::CreateFromInt32(nFontHeight));
- aNonPropFontsOnlyCB.SaveValue();
- aFontHeightLB.SaveValue();
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-IMPL_LINK(SvxFontSubstTabPage, SelectHdl, Window*, pWin)
-{
- if (pWin == &aNewDelTBX)
- {
- SvLBoxEntry* pEntry;
- // nCol ist behaemmerterweise die nCol'te Textspalte, werden nicht gezaehlt!
- // Daher als Spalte "0".
- ULONG nPos = aCheckLB.GetEntryPos(aFont1CB.GetText(), 0);
-
- switch (aNewDelTBX.GetCurItemId())
- {
- case BT_SUBSTAPPLY:
- {
- if (nPos != 0xffffffff)
- {
- // Eintrag aendern
- aCheckLB.SetEntryText(aFont2CB.GetText(), nPos, 1);
- pEntry = aCheckLB.GetEntry(nPos);
- }
- else
- {
- // Neuer Eintrag
- String sFont1 = aFont1CB.GetText();
- String sFont2 = aFont2CB.GetText();
-
- pEntry = CreateEntry(sFont1, sFont2);
- aCheckLB.Insert(pEntry);
- }
- aCheckLB.SelectAll(FALSE);
- aCheckLB.Select(pEntry);
- }
- break;
-
- case BT_SUBSTDELETE:
- {
- if (nPos != 0xffffffff)
- {
- pEntry = aCheckLB.FirstSelected();
- while (pEntry)
- {
- SvLBoxEntry* pDelEntry = pEntry;
- pEntry = aCheckLB.NextSelected(pEntry);
- aCheckLB.RemoveEntry(pDelEntry);
- }
- }
- }
- break;
- }
- }
-
- if (pWin == &aCheckLB)
- {
- SvLBoxEntry* pEntry = aCheckLB.FirstSelected();
-
- if (aCheckLB.NextSelected(pEntry) == 0)
- {
- aFont1CB.SetText(aCheckLB.GetEntryText(pEntry, 0));
- aFont2CB.SetText(aCheckLB.GetEntryText(pEntry, 1));
- }
- }
-
- if (pWin == &aFont1CB)
- {
- ULONG nPos = aCheckLB.GetEntryPos(aFont1CB.GetText(), 0);
-
- if (nPos != 0xffffffff)
- {
- SvLBoxEntry* pEntry = aCheckLB.GetEntry(nPos);
-
- if (pEntry != aCheckLB.FirstSelected())
- {
- aCheckLB.SelectAll(FALSE);
- aCheckLB.Select(pEntry);
- }
- }
- }
-
- CheckEnable();
-
- return 0;
-}
-/* -----------------------------29.08.2002 11:47------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxFontSubstTabPage, NonPropFontsHdl, CheckBox*, pBox)
-{
- String sFontName = aFontNameLB.GetSelectEntry();
- BOOL bNonPropOnly = pBox->IsChecked();
- aFontNameLB.Clear();
- FontList aFntLst( Application::GetDefaultDevice() );
- aFontNameLB.InsertEntry(sAutomatic);
- USHORT nFontCount = aFntLst.GetFontNameCount();
- for(USHORT nFont = 0; nFont < nFontCount; nFont++)
- {
- const FontInfo& rInfo = aFntLst.GetFontName( nFont );
- if(!bNonPropOnly || rInfo.GetPitch() == PITCH_FIXED)
- aFontNameLB.InsertEntry(rInfo.GetName());
- }
- aFontNameLB.SelectEntry(sFontName);
- return 0;
-}
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void SvxFontSubstTabPage::CheckEnable()
-{
- BOOL bEnableAll = aUseTableCB.IsChecked();
-
- if (bEnableAll)
- {
- BOOL bApply, bDelete;
-
- SvLBoxEntry* pEntry = aCheckLB.FirstSelected();
-
- String sEntry = aFont1CB.GetText();
- sEntry += '\t';
- sEntry += aFont2CB.GetText();
-
-/* if (!aFont1CB.GetText().Len() || !aFont2CB.GetText().Len() ||
- aFont1CB.GetText() == aFont2CB.GetText() ||
- aCheckLB.GetEntryPos(sEntry) != 0xffffffff ||
- (pEntry != 0 && aCheckLB.NextSelected(pEntry) != 0))
- bApply = FALSE;
- else
- bApply = TRUE;*/
-
- // Wegen OS/2-Optimierungsfehler (Bug #56267) etwas umstaendlicher:
- if (!aFont1CB.GetText().Len() || !aFont2CB.GetText().Len())
- bApply = FALSE;
- else if(aFont1CB.GetText() == aFont2CB.GetText())
- bApply = FALSE;
- else if(aCheckLB.GetEntryPos(sEntry) != 0xffffffff)
- bApply = FALSE;
- else if(pEntry != 0 && aCheckLB.NextSelected(pEntry) != 0)
- bApply = FALSE;
- else
- bApply = TRUE;
-
- bDelete = pEntry != 0;
-
- aNewDelTBX.EnableItem(BT_SUBSTAPPLY, bApply);
- aNewDelTBX.EnableItem(BT_SUBSTDELETE, bDelete);
- }
-
- if (bEnableAll)
- {
- if (!aCheckLB.IsEnabled())
- {
- aCheckLB.EnableTable();
- aCheckLB.SetTextColor(aTextColor);
- aCheckLB.Invalidate();
- SelectHdl(&aFont1CB);
- }
- }
- else
- {
- if (aCheckLB.IsEnabled())
- {
- aCheckLB.DisableTable();
- aCheckLB.SetTextColor(Color(COL_GRAY));
- aCheckLB.Invalidate();
- aCheckLB.SelectAll(FALSE);
- }
- }
- aNewDelTBX.Enable(bEnableAll);
- aFont1FT.Enable(bEnableAll);
- aFont1CB.Enable(bEnableAll);
- aFont2FT.Enable(bEnableAll);
- aFont2CB.Enable(bEnableAll);
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void SvxFontSubstCheckListBox::SetTabs()
-{
- SvxSimpleTable::SetTabs();
- USHORT nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
-
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(1);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
-
- pTab = (SvLBoxTab*)aTabs.GetObject(2);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
-}
-/* -----------------------------22.05.2002 11:06------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxFontSubstCheckListBox::KeyInput( const KeyEvent& rKEvt )
-{
- if(!rKEvt.GetKeyCode().GetModifier() &&
- KEY_SPACE == rKEvt.GetKeyCode().GetCode())
- {
- ULONG nSelPos = GetModel()->GetAbsPos(GetCurEntry());
- USHORT nCol = GetCurrentTabPos() - 1;
- if ( nCol < 2 )
- {
- CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) );
- CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)GetEntry( nSelPos ) );
- }
- else
- {
- USHORT nCheck = IsChecked(nSelPos, 1) ? 1 : 0;
- if(IsChecked(nSelPos, 0))
- nCheck += 2;
- nCheck--;
- nCheck &= 3;
- CheckEntryPos(nSelPos, 1, 0 != (nCheck & 1));
- CheckEntryPos(nSelPos, 0, 0 != (nCheck & 2));
- }
- }
- else
- SvxSimpleTable::KeyInput(rKEvt);
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void SvxFontSubstCheckListBox::CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked)
-{
- if ( nPos < GetEntryCount() )
- SetCheckButtonState(
- GetEntry(nPos),
- nCol,
- bChecked ? SvButtonState( SV_BUTTON_CHECKED ) :
- SvButtonState( SV_BUTTON_UNCHECKED ) );
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void SvxFontSubstCheckListBox::CheckEntry(SvLBoxEntry* pEntry, USHORT nCol, BOOL bChecked)
-{
- if ( pEntry )
- SetCheckButtonState(
- pEntry,
- nCol,
- bChecked ? SvButtonState( SV_BUTTON_CHECKED ) :
- SvButtonState( SV_BUTTON_UNCHECKED ) );
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-BOOL SvxFontSubstCheckListBox::IsChecked(ULONG nPos, USHORT nCol)
-{
- return GetCheckButtonState( GetEntry(nPos), nCol ) == SV_BUTTON_CHECKED;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-BOOL SvxFontSubstCheckListBox::IsChecked(SvLBoxEntry* pEntry, USHORT nCol)
-{
- return GetCheckButtonState( pEntry, nCol ) == SV_BUTTON_CHECKED;
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-void SvxFontSubstCheckListBox::SetCheckButtonState( SvLBoxEntry* pEntry, USHORT nCol, SvButtonState eState)
-{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
-
- DBG_ASSERT(pItem,"SetCheckButton:Item not found");
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- switch( eState )
- {
- case SV_BUTTON_CHECKED:
- pItem->SetStateChecked();
- break;
-
- case SV_BUTTON_UNCHECKED:
- pItem->SetStateUnchecked();
- break;
-
- case SV_BUTTON_TRISTATE:
- pItem->SetStateTristate();
- break;
- }
- InvalidateEntry( pEntry );
- }
-}
-
-/*********************************************************************/
-/* */
-/*********************************************************************/
-
-SvButtonState SvxFontSubstCheckListBox::GetCheckButtonState( SvLBoxEntry* pEntry, USHORT nCol ) const
-{
- SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
- DBG_ASSERT(pItem,"GetChButnState:Item not found");
-
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- USHORT nButtonFlags = pItem->GetButtonFlags();
- eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
- }
-
- return eState;
-}
-
-
diff --git a/svx/source/cui/fontsubs.hrc b/svx/source/cui/fontsubs.hrc
deleted file mode 100644
index d60ec121d1..0000000000
--- a/svx/source/cui/fontsubs.hrc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontsubs.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_FONT_SUBSTITUTION
-#define _SVX_FONT_SUBSTITUTION
-
-#include <svx/dialogs.hrc>
-
-// defines ------------------------------------------------------------------
-
-#define CLB_SUBSTITUTES 1
-#define FT_FONT1 2
-#define CB_FONT1 3
-#define FT_FONT2 4
-#define CB_FONT2 5
-#define TBX_SUBSTNEWDEL 6
-#define BT_SUBSTAPPLY 7
-#define BT_SUBSTDELETE 8
-//#define BT_SUBSTINFO 9
-
-#define STR_HEADER1 10
-#define STR_HEADER2 11
-#define STR_HEADER3 12
-#define STR_HEADER4 13
-
-#define IL_ICON 20
-#define CB_USETABLE 21
-
-#define FL_SOURCEVIEW 22
-#define FT_FONTNAME 23
-#define LB_FONTNAME 24
-#define CB_NONPROP 25
-#define FT_FONTHEIGHT 26
-#define LB_FONTHEIGHT 27
-#define STR_AUTOMATIC 28
-
-#endif
-
-
diff --git a/svx/source/cui/fontsubs.hxx b/svx/source/cui/fontsubs.hxx
deleted file mode 100644
index c4ea5416a0..0000000000
--- a/svx/source/cui/fontsubs.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontsubs.hxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_FONT_SUBSTITUTION_HXX
-#define _SVX_FONT_SUBSTITUTION_HXX
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/fixed.hxx>
-#include <svx/simptabl.hxx>
-#include <vcl/toolbox.hxx>
-#include <svtools/ctrlbox.hxx>
-
-// class SvxFontSubstCheckListBox ------------------------------------------
-
-class SvxFontSubstCheckListBox : public SvxSimpleTable
-{
- friend class SvxFontSubstTabPage;
- using SvxSimpleTable::SetTabs;
- using SvTreeListBox::GetCheckButtonState;
- using SvTreeListBox::SetCheckButtonState;
-
- protected:
- virtual void SetTabs();
- virtual void KeyInput( const KeyEvent& rKEvt );
-
- public:
- SvxFontSubstCheckListBox(Window* pParent, const ResId& rResId ) :
- SvxSimpleTable( pParent, rResId ){}
-
- inline void *GetUserData(ULONG nPos) { return GetEntry(nPos)->GetUserData(); }
- inline void SetUserData(ULONG nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
-
- BOOL IsChecked(ULONG nPos, USHORT nCol = 0);
- BOOL IsChecked(SvLBoxEntry* pEntry, USHORT nCol = 0);
- void CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked);
- void CheckEntry(SvLBoxEntry* pEntry, USHORT nCol, BOOL bChecked);
- SvButtonState GetCheckButtonState( SvLBoxEntry*, USHORT nCol ) const;
- void SetCheckButtonState( SvLBoxEntry*, USHORT nCol, SvButtonState );
-};
-
-// class SvxFontSubstTabPage ----------------------------------------------------
-class SvtFontSubstConfig;
-namespace svt {class SourceViewConfig;}
-class SvxFontSubstTabPage : public SfxTabPage
-{
- CheckBox aUseTableCB;
- FixedText aFont1FT;
- FontNameBox aFont1CB;
- FixedText aFont2FT;
- FontNameBox aFont2CB;
- ToolBox aNewDelTBX;
- SvxFontSubstCheckListBox aCheckLB;
-
- FixedLine aSourceViewFontsFL;
- FixedText aFontNameFT;
- ListBox aFontNameLB;
- CheckBox aNonPropFontsOnlyCB;
- FixedText aFontHeightFT;
- ListBox aFontHeightLB;
-
- ImageList aImageList;
- String sAutomatic;
-
- SvtFontSubstConfig* pConfig;
- svt::SourceViewConfig* pSourceViewConfig;
-
- String sHeader1;
- String sHeader2;
- String sHeader3;
- String sHeader4;
-
- Color aTextColor;
- ByteString sFontGroup;
-
- SvLBoxButtonData* pCheckButtonData;
-
- DECL_LINK(SelectHdl, Window *pWin = 0);
- DECL_LINK(NonPropFontsHdl, CheckBox* pBox);
-
- SvLBoxEntry* CreateEntry(String& rFont1, String& rFont2);
- void CheckEnable();
-
-
- SvxFontSubstTabPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxFontSubstTabPage();
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-
-#endif // _SVX_FONT_SUBSTITUTION_HXX
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/fontsubs.src b/svx/source/cui/fontsubs.src
deleted file mode 100644
index 8d0a0ab7b0..0000000000
--- a/svx/source/cui/fontsubs.src
+++ /dev/null
@@ -1,200 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontsubs.src,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include ------------------------------------------------------------------
-
-#include <svx/svxids.hrc>
-#include "fontsubs.hrc"
-#include "helpid.hrc"
-
- // pragma -------------------------------------------------------------------
-
-
-
-
-/**************************************************************************/
-/* */
-/* */
-/* */
-/**************************************************************************/
-
-TabPage RID_SVX_FONT_SUBSTITUTION
-{
- HelpID = HID_OFA_FONT_SUBSTITUTION ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- CheckBox CB_USETABLE
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 248 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Apply replacement table";
- };
- FixedText FT_FONT1
- {
- Pos = MAP_APPFONT ( 6 , 20 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "~Font";
- };
- ComboBox CB_FONT1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 33 ) ;
- Size = MAP_APPFONT ( 100 , 100 ) ;
- TabStop = TRUE ;
- AutoSize = TRUE ;
- AutoHScroll = TRUE ;
- DDExtraWidth = TRUE ;
- DropDown = TRUE;
- Sort = TRUE;
- };
- FixedText FT_FONT2
- {
- Pos = MAP_APPFONT ( 110 , 20 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Re~place with";
- };
- ComboBox CB_FONT2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 110 , 33 ) ;
- Size = MAP_APPFONT ( 100 , 100 ) ;
- TabStop = TRUE ;
- AutoSize = TRUE ;
- AutoHScroll = TRUE ;
- DDExtraWidth = TRUE ;
- DropDown = TRUE;
- Sort = TRUE;
- };
- ImageList IL_ICON
- {
- Prefix = "nu";
- MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
- IdList =
- {
- BT_SUBSTAPPLY ;
- BT_SUBSTDELETE ;
- };
- IdCount = { 2 ; };
- };
- ToolBox TBX_SUBSTNEWDEL
- {
- Pos = MAP_APPFONT ( 214 , 33 ) ;
- SVLook = TRUE ;
- Border = FALSE ;
- ItemList =
- {
- ToolBoxItem
- {
- Identifier = BT_SUBSTAPPLY ;
- HelpID = HID_OFA_SUBST_APPLY ;
- Text [ en-US ] = "Apply" ;
- };
- ToolBoxItem
- {
- Identifier = BT_SUBSTDELETE ;
- HelpID = HID_OFA_SUBST_DELETE ;
- Text [ en-US ] = "Delete" ;
- };
- };
- };
- Control CLB_SUBSTITUTES
- {
- Pos = MAP_APPFONT ( 6 , 48 ) ;
- Size = MAP_APPFONT ( 248 , 75 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedLine FL_SOURCEVIEW
- {
- Pos = MAP_APPFONT ( 6 , 129 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Font settings for HTML, Basic and SQL sources" ;
- };
- FixedText FT_FONTNAME
- {
- Pos = MAP_APPFONT ( 6 , 142 ) ;
- Size = MAP_APPFONT ( 57 , 8 ) ;
- Text [ en-US ] = "Fonts" ;
- };
- ListBox LB_FONTNAME
- {
- Pos = MAP_APPFONT ( 65 , 140 ) ;
- Size = MAP_APPFONT ( 100 , 68 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE;
- };
- CheckBox CB_NONPROP
- {
- Pos = MAP_APPFONT ( 65 , 155 ) ;
- Size = MAP_APPFONT ( 180 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Non-proportional fonts only" ;
- };
- FixedText FT_FONTHEIGHT
- {
- Pos = MAP_APPFONT ( 6 , 171 ) ;
- Size = MAP_APPFONT ( 57 , 8 ) ;
- Text [ en-US ] ="~Size";
- };
- ListBox LB_FONTHEIGHT
- {
- Pos = MAP_APPFONT ( 65 , 169 ) ;
- Size = MAP_APPFONT ( 30 , 68 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE;
- };
- String STR_HEADER1
- {
- Text [ en-US ] = "Always";
- };
- String STR_HEADER2
- {
- Text [ en-US ] = "Screen only";
- };
- String STR_HEADER3
- {
- Text [ en-US ] = "Font";
- };
- String STR_HEADER4
- {
- Text [ en-US ] = "Replace with";
- };
- String STR_AUTOMATIC
- {
- Text [ en-US ] = "Automatic";
- };
-};
-
diff --git a/svx/source/cui/grfflt.hrc b/svx/source/cui/grfflt.hrc
deleted file mode 100644
index a119db4330..0000000000
--- a/svx/source/cui/grfflt.hrc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: grfflt.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_DLGFLT_HRC
-#define _SVX_DLGFLT_HRC
-
-// ----------
-// - Common -
-// ----------
-
-#define BTN_OK 101
-#define BTN_CANCEL 102
-#define BTN_HELP 103
-#define CTL_PREVIEW 105
-#define FL_PARAMETER 106
-
-// --------------------
-// - DLG_FILTERMOSAIC -
-// --------------------
-
-#define DLG_FILTERMOSAIC_FT_WIDTH 1
-#define DLG_FILTERMOSAIC_MTR_WIDTH 2
-#define DLG_FILTERMOSAIC_FT_HEIGHT 3
-#define DLG_FILTERMOSAIC_MTR_HEIGHT 4
-#define DLG_FILTERMOSAIC_CBX_EDGES 5
-
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-#define DLG_FILTERSOLARIZE_FT_THRESHOLD 1
-#define DLG_FILTERSOLARIZE_MTR_THRESHOLD 2
-#define DLG_FILTERSOLARIZE_CBX_INVERT 3
-
-// -------------------
-// - DLG_FILTERSEPIA -
-// -------------------
-
-#define DLG_FILTERSEPIA_FT_SEPIA 1
-#define DLG_FILTERSEPIA_MTR_SEPIA 2
-
-// --------------------
-// - DLG_FILTERPOSTER -
-// --------------------
-
-#define DLG_FILTERPOSTER_FT_POSTER 1
-#define DLG_FILTERPOSTER_NUM_POSTER 2
-
-// --------------------
-// - DLG_FILTEREMBOSS -
-// --------------------
-
-#define DLG_FILTEREMBOSS_FT_LIGHT 1
-#define DLG_FILTEREMBOSS_CTL_LIGHT 2
-
-#endif
diff --git a/svx/source/cui/grfflt.src b/svx/source/cui/grfflt.src
deleted file mode 100644
index 24ade4cc67..0000000000
--- a/svx/source/cui/grfflt.src
+++ /dev/null
@@ -1,456 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: grfflt.src,v $
- * $Revision: 1.45 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/controldims.hrc>
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "grfflt.hrc"
-
-// --------------------
-// - DLG_FILTERMOSAIC -
-// --------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_MOSAIC
-{
- HelpID = SID_GRFFILTER_MOSAIC;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Mosaic" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y0 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERMOSAIC_FT_WIDTH
- {
- Pos = MAP_APPFONT ( 12, MA_Y0 ) ;
- Size = MAP_APPFONT ( 77, 10 ) ;
- Text [ en-US ] = "~Width" ;
- };
-#define MA_Y1 MA_Y0 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- MetricField DLG_FILTERMOSAIC_MTR_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y1 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 999 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = " Pixel" ;
- First = 1 ;
- Last = 999 ;
- SpinSize = 1 ;
- };
-#define MA_Y2 MA_Y1 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- FixedText DLG_FILTERMOSAIC_FT_HEIGHT
- {
- Pos = MAP_APPFONT ( 12, MA_Y2 ) ;
- Size = MAP_APPFONT ( 77, 10 ) ;
- Text [ en-US ] = "H~eight" ;
- };
-#define MA_Y3 MA_Y2 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- MetricField DLG_FILTERMOSAIC_MTR_HEIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12, MA_Y3 ) ;
- Size = MAP_APPFONT ( 35, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 999 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = " Pixel" ;
- First = 1 ;
- Last = 999 ;
- SpinSize = 1 ;
- };
-#define MA_Y4 MA_Y3 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_Y
- CheckBox DLG_FILTERMOSAIC_CBX_EDGES
- {
- Pos = MAP_APPFONT ( 12, MA_Y4 ) ;
- Size = MAP_APPFONT ( 91, 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "E~nhance edges" ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_SOLARIZE
-{
- HelpID = SID_GRFFILTER_SOLARIZE;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Solarization" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y5 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERSOLARIZE_FT_THRESHOLD
- {
- Pos = MAP_APPFONT ( 12, MA_Y5 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Threshold ~value" ;
- };
-#define MA_Y6 MA_Y5 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- MetricField DLG_FILTERSOLARIZE_MTR_THRESHOLD
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y6 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = " %" ;
- Last = 100 ;
- SpinSize = 1 ;
- };
-#define MA_Y7 MA_Y6 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- CheckBox DLG_FILTERSOLARIZE_CBX_INVERT
- {
- Pos = MAP_APPFONT ( 12, 46 ) ;
- Size = MAP_APPFONT ( 77, 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Invert" ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_SEPIA
-{
- HelpID = SID_GRFFILTER_SEPIA;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Aging" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y8 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERSEPIA_FT_SEPIA
- {
- Pos = MAP_APPFONT ( 12 , MA_Y8 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Aging degree" ;
- };
-#define MA_Y9 MA_Y8 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- MetricField DLG_FILTERSEPIA_MTR_SEPIA
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y9 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = " %" ;
- First = 1 ;
- Last = 100 ;
- SpinSize = 1 ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// --------------------
-// - DLG_FILTERPOSTER -
-// --------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_POSTER
-{
- HelpID = SID_GRFFILTER_POSTER;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Posterize" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y10 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERPOSTER_FT_POSTER
- {
- Pos = MAP_APPFONT ( 12 , MA_Y10 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Poster colors" ;
- };
-#define MA_Y11 MA_Y10 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- NumericField DLG_FILTERPOSTER_NUM_POSTER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y11 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 2 ;
- Maximum = 64 ;
- StrictFormat = TRUE ;
- First = 2 ;
- Last = 64 ;
- SpinSize = 1 ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// --------------------
-// - DLG_FILTEREMBOSS -
-// --------------------
-
-TabPage RID_SVX_GRFFILTER_DLG_EMBOSS_TAB
-{
- Pos = MAP_APPFONT ( 0, 0 ) ;
- Size = MAP_APPFONT ( 0, 0 ) ;
-};
-
-ModalDialog RID_SVX_GRFFILTER_DLG_EMBOSS
-{
- HelpID = SID_GRFFILTER_EMBOSS;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Relief" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y12 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTEREMBOSS_FT_LIGHT
- {
- Pos = MAP_APPFONT ( 12 , MA_Y12 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Light source" ;
- };
-#define MA_Y13 MA_Y12 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- Control DLG_FILTEREMBOSS_CTL_LIGHT
- {
- HelpID = HID_GRFFILTER_EMBOSS_LIGHT ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y13 ) ;
- Size = MAP_APPFONT ( 77 , 60 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/grfpage.cxx b/svx/source/cui/grfpage.cxx
deleted file mode 100644
index aabc03766f..0000000000
--- a/svx/source/cui/grfpage.cxx
+++ /dev/null
@@ -1,858 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: grfpage.cxx,v $
- * $Revision: 1.20 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-
-
-
-#include <tools/shl.hxx>
-#include <svtools/eitem.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/sfxsids.hrc>
-
-
-#include <svx/dialmgr.hxx>
-#include <dlgutil.hxx>
-#include <svx/sizeitem.hxx>
-#include <svx/brshitem.hxx>
-
-#ifndef _GRFPAGE_HXX
-#include <grfpage.hxx>
-#endif
-#include <svx/grfcrop.hxx>
-
-#ifndef _GRFPAGE_HRC
-#include <grfpage.hrc>
-#endif
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#ifndef _SVX_SVXIDS_HRC
-#include <svx/svxids.hrc>
-#endif
-
-
-#define CM_1_TO_TWIP 567
-
-
-inline long lcl_GetValue( MetricField& rMetric, FieldUnit eUnit )
-{
- return static_cast<long>(rMetric.Denormalize( rMetric.GetValue( eUnit )));
-}
-
-/*--------------------------------------------------------------------
- Beschreibung: Grafik zuschneiden
- --------------------------------------------------------------------*/
-
-SvxGrfCropPage::SvxGrfCropPage ( Window *pParent, const SfxItemSet &rSet )
- : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_GRFCROP ), rSet ),
- aCropFL( this, SVX_RES( FL_CROP )),
- aZoomConstRB( this, SVX_RES( RB_ZOOMCONST)),
- aSizeConstRB( this, SVX_RES( RB_SIZECONST)),
- aLeftFT( this, SVX_RES( FT_LEFT )),
- aLeftMF( this, SVX_RES( MF_LEFT )),
- aRightFT( this, SVX_RES( FT_RIGHT )),
- aRightMF( this, SVX_RES( MF_RIGHT )),
- aTopFT( this, SVX_RES( FT_TOP )),
- aTopMF( this, SVX_RES( MF_TOP )),
- aBottomFT( this, SVX_RES( FT_BOTTOM )),
- aBottomMF( this, SVX_RES( MF_BOTTOM )),
- aZoomFL( this, SVX_RES( FL_ZOOM )),
- aWidthZoomFT( this, SVX_RES( FT_WIDTHZOOM )),
- aWidthZoomMF( this, SVX_RES( MF_WIDTHZOOM )),
- aHeightZoomFT( this, SVX_RES( FT_HEIGHTZOOM)),
- aHeightZoomMF( this, SVX_RES( MF_HEIGHTZOOM)),
- aSizeFL( this, SVX_RES( FL_SIZE )),
- aWidthFT( this, SVX_RES( FT_WIDTH )),
- aWidthMF( this, SVX_RES( MF_WIDTH )),
- aHeightFT( this, SVX_RES( FT_HEIGHT )),
- aHeightMF( this, SVX_RES( MF_HEIGHT )),
- aOrigSizeFT( this, SVX_RES(FT_ORIG_SIZE)),
- aOrigSizePB( this, SVX_RES( PB_ORGSIZE )),
- aExampleWN( this, SVX_RES( WN_BSP )),
- pLastCropField(0),
- bInitialized(FALSE),
- bSetOrigSize(FALSE)
-{
- FreeResource();
-
- SetExchangeSupport();
-
- // set the correct metric
- const FieldUnit eMetric = GetModuleFieldUnit( &rSet );
-
- SetFieldUnit( aWidthMF, eMetric );
- SetFieldUnit( aHeightMF, eMetric );
- SetFieldUnit( aLeftMF, eMetric );
- SetFieldUnit( aRightMF, eMetric );
- SetFieldUnit( aTopMF , eMetric );
- SetFieldUnit( aBottomMF, eMetric );
-
- Link aLk = LINK(this, SvxGrfCropPage, SizeHdl);
- aWidthMF.SetModifyHdl( aLk );
- aHeightMF.SetModifyHdl( aLk );
-
- aLk = LINK(this, SvxGrfCropPage, ZoomHdl);
- aWidthZoomMF.SetModifyHdl( aLk );
- aHeightZoomMF.SetModifyHdl( aLk );
-
- aLk = LINK(this, SvxGrfCropPage, CropHdl);
- aLeftMF.SetDownHdl( aLk );
- aRightMF.SetDownHdl( aLk );
- aTopMF.SetDownHdl( aLk );
- aBottomMF.SetDownHdl( aLk );
- aLeftMF.SetUpHdl( aLk );
- aRightMF.SetUpHdl( aLk );
- aTopMF.SetUpHdl( aLk );
- aBottomMF.SetUpHdl( aLk );
-
- aLk = LINK(this, SvxGrfCropPage, CropModifyHdl);
- aLeftMF.SetModifyHdl( aLk );
- aRightMF.SetModifyHdl( aLk );
- aTopMF.SetModifyHdl( aLk );
- aBottomMF.SetModifyHdl( aLk );
-
- aLk = LINK(this, SvxGrfCropPage, CropLoseFocusHdl);
- aLeftMF.SetLoseFocusHdl( aLk );
- aRightMF.SetLoseFocusHdl( aLk );
- aTopMF.SetLoseFocusHdl( aLk );
- aBottomMF.SetLoseFocusHdl( aLk );
-
- aLk = LINK(this, SvxGrfCropPage, OrigSizeHdl);
- aOrigSizePB.SetClickHdl( aLk );
-
- aTimer.SetTimeoutHdl(LINK(this, SvxGrfCropPage, Timeout));
- aTimer.SetTimeout( 1500 );
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-SvxGrfCropPage::~SvxGrfCropPage()
-{
- aTimer.Stop();
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-SfxTabPage* SvxGrfCropPage::Create(Window *pParent, const SfxItemSet &rSet)
-{
- return new SvxGrfCropPage( pParent, rSet );
-}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-void SvxGrfCropPage::Reset( const SfxItemSet &rSet )
-{
- const SfxPoolItem* pItem;
- const SfxItemPool& rPool = *rSet.GetPool();
-
- if(SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich(
- SID_ATTR_GRAF_KEEP_ZOOM ), TRUE, &pItem ))
- {
- if( ((const SfxBoolItem*)pItem)->GetValue() )
- aZoomConstRB.Check();
- else
- aSizeConstRB.Check();
- aZoomConstRB.SaveValue();
- }
-
- USHORT nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
- if( SFX_ITEM_SET == rSet.GetItemState( nW, TRUE, &pItem))
- {
- FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW ));
-
- SvxGrfCrop* pCrop = (SvxGrfCrop*)pItem;
-
- aExampleWN.SetLeft( pCrop->GetLeft());
- aExampleWN.SetRight( pCrop->GetRight());
- aExampleWN.SetTop( pCrop->GetTop());
- aExampleWN.SetBottom( pCrop->GetBottom());
-
- aLeftMF.SetValue( aLeftMF.Normalize( pCrop->GetLeft()), eUnit );
- aRightMF.SetValue( aRightMF.Normalize( pCrop->GetRight()), eUnit );
- aTopMF.SetValue( aTopMF.Normalize( pCrop->GetTop()), eUnit );
- aBottomMF.SetValue( aBottomMF.Normalize( pCrop->GetBottom()), eUnit );
- }
- else
- {
- aLeftMF.SetValue( 0 );
- aRightMF.SetValue( 0 );
- aTopMF.SetValue( 0 );
- aBottomMF.SetValue( 0 );
- }
-
- nW = rPool.GetWhich( SID_ATTR_PAGE_SIZE );
- if ( SFX_ITEM_SET == rSet.GetItemState( nW, FALSE, &pItem ) )
- {
- // Orientation und Size aus dem PageItem
- FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW ));
-
- aPageSize = ((const SvxSizeItem*)pItem)->GetSize();
-
- sal_Int64 nTmp = aHeightMF.Normalize(aPageSize.Height());
- aHeightMF.SetMax( nTmp, eUnit );
- nTmp = aWidthMF.Normalize(aPageSize.Width());
- aWidthMF.SetMax( nTmp, eUnit );
- nTmp = aWidthMF.Normalize( 23 );
- aHeightMF.SetMin( nTmp, eUnit );
- aWidthMF.SetMin( nTmp, eUnit );
- }
- else
- {
- aPageSize = OutputDevice::LogicToLogic(
- Size( CM_1_TO_TWIP, CM_1_TO_TWIP ),
- MapMode( MAP_TWIP ),
- MapMode( (MapUnit)rSet.GetPool()->GetMetric( nW ) ) );
- }
-
- BOOL bFound = FALSE;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, FALSE, &pItem ) )
- {
- const Graphic* pGrf = ((SvxBrushItem*)pItem)->GetGraphic();
- if( pGrf )
- aOrigSize = GetGrfOrigSize( *pGrf );
-
- if( aOrigSize.Width() && aOrigSize.Height() )
- {
- CalcMinMaxBorder();
- aExampleWN.SetGraphic( *pGrf );
- aExampleWN.SetFrameSize( aOrigSize );
-
- bFound = TRUE;
- if( ((SvxBrushItem*)pItem)->GetGraphicLink() )
- aGraphicName = *((SvxBrushItem*)pItem)->GetGraphicLink();
- }
- }
-
- GraphicHasChanged( bFound );
- bReset = TRUE;
- ActivatePage( rSet );
- bReset = FALSE;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-BOOL SvxGrfCropPage::FillItemSet(SfxItemSet &rSet)
-{
- const SfxItemPool& rPool = *rSet.GetPool();
- BOOL bModified = FALSE;
- if( aWidthMF.GetSavedValue() != aWidthMF.GetText() ||
- aHeightMF.GetSavedValue() != aHeightMF.GetText() )
- {
- USHORT nW = rPool.GetWhich( SID_ATTR_GRAF_FRMSIZE );
- FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW ));
-
- SvxSizeItem aSz( nW );
-
- // die Groesse koennte schon von einer anderen Page gesetzt worden sein
- // #44204#
- const SfxItemSet* pExSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
- const SfxPoolItem* pItem = 0;
- if( pExSet && SFX_ITEM_SET ==
- pExSet->GetItemState( nW, FALSE, &pItem ) )
- aSz = *(const SvxSizeItem*)pItem;
- else
- aSz = (const SvxSizeItem&)GetItemSet().Get( nW );
-
- Size aTmpSz( aSz.GetSize() );
- if( aWidthMF.GetText() != aWidthMF.GetSavedValue() )
- aTmpSz.Width() = lcl_GetValue( aWidthMF, eUnit );
- if( aHeightMF.GetText() != aHeightMF.GetSavedValue() )
- aTmpSz.Height() = lcl_GetValue( aHeightMF, eUnit );
- aSz.SetSize( aTmpSz );
- aWidthMF.SaveValue();
- aHeightMF.SaveValue();
-
- bModified |= 0 != rSet.Put( aSz );
-
- if( bSetOrigSize )
- {
- bModified |= 0 != rSet.Put( SvxSizeItem( rPool.GetWhich(
- SID_ATTR_GRAF_FRMSIZE_PERCENT ), Size( 0, 0 )) );
- }
- }
- if( aLeftMF.IsModified() || aRightMF.IsModified() ||
- aTopMF.IsModified() || aBottomMF.IsModified() )
- {
- USHORT nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
- FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW ));
- SvxGrfCrop* pNew = (SvxGrfCrop*)rSet.Get( nW ).Clone();
-
- pNew->SetLeft( lcl_GetValue( aLeftMF, eUnit ) );
- pNew->SetRight( lcl_GetValue( aRightMF, eUnit ) );
- pNew->SetTop( lcl_GetValue( aTopMF, eUnit ) );
- pNew->SetBottom( lcl_GetValue( aBottomMF, eUnit ) );
- bModified |= 0 != rSet.Put( *pNew );
- delete pNew;
- }
-
- if( aZoomConstRB.GetSavedValue() != aZoomConstRB.IsChecked() )
- {
- bModified |= 0 != rSet.Put( SfxBoolItem( rPool.GetWhich(
- SID_ATTR_GRAF_KEEP_ZOOM), aZoomConstRB.IsChecked() ) );
- }
-
- bInitialized = FALSE;
-
- return bModified;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
-{
-#ifdef DBG_UTIL
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
-#endif
-
- bSetOrigSize = FALSE;
-
- // Size
- Size aSize;
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_FRMSIZE, FALSE, &pItem ) )
- aSize = ((const SvxSizeItem*)pItem)->GetSize();
-
- nOldWidth = aSize.Width();
- nOldHeight = aSize.Height();
-
- sal_Int64 nWidth = aWidthMF.Normalize(nOldWidth);
- sal_Int64 nHeight = aHeightMF.Normalize(nOldHeight);
-
- if (nWidth != aWidthMF.GetValue(FUNIT_TWIP))
- {
- if(!bReset)
- {
- // Wert wurde von Umlauf-Tabpage geaendert und muss
- // mit Modify-Flag gesetzt werden
- aWidthMF.SetUserValue(nWidth, FUNIT_TWIP);
- }
- else
- aWidthMF.SetValue(nWidth, FUNIT_TWIP);
- }
- aWidthMF.SaveValue();
-
- if (nHeight != aHeightMF.GetValue(FUNIT_TWIP))
- {
- if (!bReset)
- {
- // Wert wurde von Umlauf-Tabpage geaendert und muss
- // mit Modify-Flag gesetzt werden
- aHeightMF.SetUserValue(nHeight, FUNIT_TWIP);
- }
- else
- aHeightMF.SetValue(nHeight, FUNIT_TWIP);
- }
- aHeightMF.SaveValue();
- bInitialized = TRUE;
-
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, FALSE, &pItem ) )
- {
- const SvxBrushItem& rBrush = *(SvxBrushItem*)pItem;
- if( rBrush.GetGraphicLink() &&
- aGraphicName != *rBrush.GetGraphicLink() )
- aGraphicName = *rBrush.GetGraphicLink();
-
- const Graphic* pGrf = rBrush.GetGraphic();
- if( pGrf )
- {
- aExampleWN.SetGraphic( *pGrf );
- aOrigSize = GetGrfOrigSize( *pGrf );
- aExampleWN.SetFrameSize(aOrigSize);
- GraphicHasChanged( aOrigSize.Width() && aOrigSize.Height() );
- CalcMinMaxBorder();
- }
- else
- GraphicHasChanged( FALSE );
- }
-
- CalcZoom();
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-int SvxGrfCropPage::DeactivatePage(SfxItemSet *_pSet)
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return TRUE;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung: Massstab geaendert, Groesse anpassen
- --------------------------------------------------------------------*/
-
-IMPL_LINK( SvxGrfCropPage, ZoomHdl, MetricField *, pField )
-{
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ) );
-
- if( pField == &aWidthZoomMF )
- {
- long nLRBorders = lcl_GetValue(aLeftMF, eUnit)
- +lcl_GetValue(aRightMF, eUnit);
- aWidthMF.SetValue( aWidthMF.Normalize(
- ((aOrigSize.Width() - nLRBorders) * pField->GetValue())/100L),
- eUnit);
- }
- else
- {
- long nULBorders = lcl_GetValue(aTopMF, eUnit)
- +lcl_GetValue(aBottomMF, eUnit);
- aHeightMF.SetValue( aHeightMF.Normalize(
- ((aOrigSize.Height() - nULBorders ) * pField->GetValue())/100L) ,
- eUnit );
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung: Groesse aendern, Massstab anpassen
- --------------------------------------------------------------------*/
-
-IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField )
-{
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ) );
-
- Size aSize( lcl_GetValue(aWidthMF, eUnit),
- lcl_GetValue(aHeightMF, eUnit) );
-
- if(pField == &aWidthMF)
- {
- long nWidth = aOrigSize.Width() -
- ( lcl_GetValue(aLeftMF, eUnit) +
- lcl_GetValue(aRightMF, eUnit) );
- if(!nWidth)
- nWidth++;
- USHORT nZoom = (USHORT)( aSize.Width() * 100L / nWidth);
- aWidthZoomMF.SetValue(nZoom);
- }
- else
- {
- long nHeight = aOrigSize.Height() -
- ( lcl_GetValue(aTopMF, eUnit) +
- lcl_GetValue(aBottomMF, eUnit));
- if(!nHeight)
- nHeight++;
- USHORT nZoom = (USHORT)( aSize.Height() * 100L/ nHeight);
- aHeightZoomMF.SetValue(nZoom);
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung: Raender auswerten
- --------------------------------------------------------------------*/
-
-IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField )
-{
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ) );
-
- BOOL bZoom = aZoomConstRB.IsChecked();
- if( pField == &aLeftMF || pField == &aRightMF )
- {
- long nLeft = lcl_GetValue( aLeftMF, eUnit );
- long nRight = lcl_GetValue( aRightMF, eUnit );
- long nWidthZoom = static_cast<long>(aWidthZoomMF.GetValue());
- if(bZoom && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom )
- / 100 >= aPageSize.Width() ) )
- {
- if(pField == &aLeftMF)
- {
-// nLeft = aPageSize.Width() -
-// ((nRight + aOrigSize.Width()) * nWidthZoom) / 100;
- nLeft = aOrigSize.Width() -
- ( aPageSize.Width() * 100 / nWidthZoom + nRight );
- aLeftMF.SetValue( aLeftMF.Normalize( nLeft ), eUnit );
- }
- else
- {
-// nRight = aPageSize.Width() -
-// ((nLeft - aOrigSize.Width()) * nWidthZoom) / 100;
- nRight = aOrigSize.Width() -
- ( aPageSize.Width() * 100 / nWidthZoom + nLeft );
- aRightMF.SetValue( aRightMF.Normalize( nRight ), eUnit );
- }
- }
- aExampleWN.SetLeft(nLeft);
- aExampleWN.SetRight(nRight);
- if(bZoom)
- {
- //Massstab bleibt -> Breite neu berechnen
- ZoomHdl(&aWidthZoomMF);
- }
- }
- else
- {
- long nTop = lcl_GetValue( aTopMF, eUnit );
- long nBottom = lcl_GetValue( aBottomMF, eUnit );
- long nHeightZoom = static_cast<long>(aHeightZoomMF.GetValue());
- if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom)
- / 100 >= aPageSize.Height()))
- {
- if(pField == &aTopMF)
- {
-// nTop = aPageSize.Height() -
-// ((aOrigSize.Height() - nBottom) * nHeightZoom)/ 100;
- nTop = aOrigSize.Height() -
- ( aPageSize.Height() * 100 / nHeightZoom + nBottom);
- aTopMF.SetValue( aWidthMF.Normalize( nTop ), eUnit );
- }
- else
- {
-// nBottom = aPageSize.Height() -
-// ((aOrigSize.Height() - nTop)*nHeightZoom) / 100;
- nBottom = aOrigSize.Height() -
- ( aPageSize.Height() * 100 / nHeightZoom + nTop);
- aBottomMF.SetValue( aWidthMF.Normalize( nBottom ), eUnit );
- }
- }
- aExampleWN.SetTop( nTop );
- aExampleWN.SetBottom( nBottom );
- if(bZoom)
- {
- //Massstab bleibt -> Hoehe neu berechnen
- ZoomHdl(&aHeightZoomMF);
- }
- }
- aExampleWN.Invalidate();
- //Groesse und Raender veraendert -> Massstab neu berechnen
- if(!bZoom)
- CalcZoom();
- CalcMinMaxBorder();
- return 0;
-}
-/*--------------------------------------------------------------------
- Beschreibung: Originalgroesse einstellen
- --------------------------------------------------------------------*/
-
-IMPL_LINK( SvxGrfCropPage, OrigSizeHdl, PushButton *, EMPTYARG )
-{
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ) );
-
- long nWidth = aOrigSize.Width() -
- lcl_GetValue( aLeftMF, eUnit ) -
- lcl_GetValue( aRightMF, eUnit );
- aWidthMF.SetValue( aWidthMF.Normalize( nWidth ), eUnit );
- long nHeight = aOrigSize.Height() -
- lcl_GetValue( aTopMF, eUnit ) -
- lcl_GetValue( aBottomMF, eUnit );
- aHeightMF.SetValue( aHeightMF.Normalize( nHeight ), eUnit );
- aWidthZoomMF.SetValue(100);
- aHeightZoomMF.SetValue(100);
- bSetOrigSize = TRUE;
- return 0;
-}
-/*--------------------------------------------------------------------
- Beschreibung: Massstab berechnen
- --------------------------------------------------------------------*/
-
-void SvxGrfCropPage::CalcZoom()
-{
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ) );
-
- long nWidth = lcl_GetValue( aWidthMF, eUnit );
- long nHeight = lcl_GetValue( aHeightMF, eUnit );
- long nLRBorders = lcl_GetValue( aLeftMF, eUnit ) +
- lcl_GetValue( aRightMF, eUnit );
- long nULBorders = lcl_GetValue( aTopMF, eUnit ) +
- lcl_GetValue( aBottomMF, eUnit );
- USHORT nZoom = 0;
- long nDen;
- if( (nDen = aOrigSize.Width() - nLRBorders) > 0)
- nZoom = (USHORT)((( nWidth * 1000L / nDen )+5)/10);
- aWidthZoomMF.SetValue(nZoom);
- if( (nDen = aOrigSize.Height() - nULBorders) > 0)
- nZoom = (USHORT)((( nHeight * 1000L / nDen )+5)/10);
- else
- nZoom = 0;
- aHeightZoomMF.SetValue(nZoom);
-}
-
-/*--------------------------------------------------------------------
- Beschreibung: Minimal-/Maximalwerte fuer die Raender setzen
- --------------------------------------------------------------------*/
-
-void SvxGrfCropPage::CalcMinMaxBorder()
-{
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ) );
- long nR = lcl_GetValue(aRightMF, eUnit );
- long nMinWidth = (aOrigSize.Width() * 10) /11;
- long nMin = nMinWidth - (nR >= 0 ? nR : 0);
- aLeftMF.SetMax( aLeftMF.Normalize(nMin), eUnit );
-
- long nL = lcl_GetValue(aLeftMF, eUnit );
- nMin = nMinWidth - (nL >= 0 ? nL : 0);
- aRightMF.SetMax( aRightMF.Normalize(nMin), eUnit );
-
- // Zoom nicht unter 2%
-/* nMin = (aOrigSize.Width() * 102) /100;
- aLeftMF.SetMax(aPageSize.Width() - nR - nMin);
- aRightMF.SetMax(aPageSize.Width() - nL - nMin);
-*/
- long nUp = lcl_GetValue( aTopMF, eUnit );
- long nMinHeight = (aOrigSize.Height() * 10) /11;
- nMin = nMinHeight - (nUp >= 0 ? nUp : 0);
- aBottomMF.SetMax( aBottomMF.Normalize(nMin), eUnit );
-
- long nLow = lcl_GetValue(aBottomMF, eUnit );
- nMin = nMinHeight - (nLow >= 0 ? nLow : 0);
- aTopMF.SetMax( aTopMF.Normalize(nMin), eUnit );
-
- // Zoom nicht unter 2%
-/* nMin = (aOrigSize.Height() * 102) /100;
- aTopMF.SetMax(aPageSize.Height() - nLow - nMin);
- aBottomMF.SetMax(aPageSize.Height() - nUp - nMin);*/
-}
-/*--------------------------------------------------------------------
- Beschreibung: Spinsize auf 1/20 der Originalgroesse setzen,
- FixedText mit der Originalgroesse fuellen
- --------------------------------------------------------------------*/
-
-void SvxGrfCropPage::GraphicHasChanged( BOOL bFound )
-{
- if( bFound )
- {
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
- SID_ATTR_GRAF_CROP ) ));
-
- sal_Int64 nSpin = aLeftMF.Normalize(aOrigSize.Width()) / 20;
- nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0,
- eUnit, aLeftMF.GetUnit());
-
- // Ist der Rand zu gross, wird er auf beiden Seiten auf 1/3 eingestellt.
- long nR = lcl_GetValue( aRightMF, eUnit );
- long nL = lcl_GetValue( aLeftMF, eUnit );
- if((nL + nR) < - aOrigSize.Width())
- {
- long nVal = aOrigSize.Width() / -3;
- aRightMF.SetValue( aRightMF.Normalize( nVal ), eUnit );
- aLeftMF.SetValue( aLeftMF.Normalize( nVal ), eUnit );
- aExampleWN.SetLeft(nVal);
- aExampleWN.SetRight(nVal);
- }
- long nUp = lcl_GetValue(aTopMF, eUnit );
- long nLow = lcl_GetValue(aBottomMF, eUnit );
- if((nUp + nLow) < - aOrigSize.Height())
- {
- long nVal = aOrigSize.Height() / -3;
- aTopMF.SetValue( aTopMF.Normalize( nVal ), eUnit );
- aBottomMF.SetValue( aBottomMF.Normalize( nVal ), eUnit );
- aExampleWN.SetTop(nVal);
- aExampleWN.SetBottom(nVal);
- }
-
- aLeftMF.SetSpinSize(nSpin);
- aRightMF.SetSpinSize(nSpin);
- nSpin = aTopMF.Normalize(aOrigSize.Height()) / 20;
- nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0,
- eUnit, aLeftMF.GetUnit() );
- aTopMF.SetSpinSize(nSpin);
- aBottomMF.SetSpinSize(nSpin);
-
- //Originalgroesse anzeigen
- const FieldUnit eMetric = GetModuleFieldUnit( &GetItemSet() );
-
- MetricField aFld(this, WB_HIDE);
- SetFieldUnit( aFld, eMetric );
- aFld.SetDecimalDigits( aWidthMF.GetDecimalDigits() );
- aFld.SetMax( LONG_MAX - 1 );
-
- aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit );
- String sTemp = aFld.GetText();
- aFld.SetValue( aFld.Normalize( aOrigSize.Height() ), eUnit );
- sTemp += UniString::CreateFromAscii(" x ");
- sTemp += aFld.GetText();
- aOrigSizeFT.SetText(sTemp);
- }
- aLeftFT .Enable(bFound);
- aLeftMF .Enable(bFound);
- aRightFT .Enable(bFound);
- aRightMF .Enable(bFound);
- aTopFT .Enable(bFound);
- aTopMF .Enable(bFound);
- aBottomFT .Enable(bFound);
- aBottomMF .Enable(bFound);
- aSizeConstRB .Enable(bFound);
- aZoomConstRB .Enable(bFound);
- aWidthFT .Enable(bFound);
- aWidthMF .Enable(bFound);
- aHeightFT .Enable(bFound);
- aHeightMF .Enable(bFound);
- aWidthZoomFT .Enable(bFound);
- aWidthZoomMF .Enable(bFound);
- aHeightZoomFT .Enable(bFound);
- aHeightZoomMF .Enable(bFound);
- aExampleWN .Enable(bFound);
- aOrigSizePB .Enable(bFound);
- aOrigSizeFT .Enable(bFound);
-}
-
-IMPL_LINK( SvxGrfCropPage, Timeout, Timer *, EMPTYARG )
-{
- DBG_ASSERT(pLastCropField,"Timeout ohne Feld?");
- CropHdl(pLastCropField);
- pLastCropField = 0;
- return 0;
-}
-
-
-IMPL_LINK( SvxGrfCropPage, CropLoseFocusHdl, MetricField*, pField )
-{
- aTimer.Stop();
- CropHdl(pField);
- pLastCropField = 0;
- return 0;
-}
-
-
-IMPL_LINK( SvxGrfCropPage, CropModifyHdl, MetricField *, pField )
-{
- aTimer.Start();
- pLastCropField = pField;
- return 0;
-}
-
-Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const
-{
- const MapMode aMapTwip( MAP_TWIP );
- Size aSize( rGrf.GetPrefSize() );
- if( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
- aSize = PixelToLogic( aSize, aMapTwip );
- else
- aSize = OutputDevice::LogicToLogic( aSize,
- rGrf.GetPrefMapMode(), aMapTwip );
- return aSize;
-}
-
-/*****************************************************************/
-
-SvxGrfCropPage::SvxCropExample::SvxCropExample( Window* pPar,
- const ResId& rResId )
- : Window( pPar, rResId ),
- aFrameSize( OutputDevice::LogicToLogic(
- Size( CM_1_TO_TWIP / 2, CM_1_TO_TWIP / 2 ),
- MapMode( MAP_TWIP ), GetMapMode() )),
- aTopLeft(0,0), aBottomRight(0,0)
-{
- SetBorderStyle( WINDOW_BORDER_MONO );
-}
-
-void SvxGrfCropPage::SvxCropExample::Paint( const Rectangle& )
-{
- Size aWinSize( PixelToLogic(GetOutputSizePixel() ));
- SetLineColor();
- SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() );
- SetRasterOp( ROP_OVERPAINT );
- DrawRect( Rectangle( Point(), aWinSize ) );
-
- SetLineColor( Color( COL_WHITE ) );
- Rectangle aRect(Point((aWinSize.Width() - aFrameSize.Width())/2,
- (aWinSize.Height() - aFrameSize.Height())/2),
- aFrameSize );
- aGrf.Draw( this, aRect.TopLeft(), aRect.GetSize() );
-
- Size aSz( 2, 0 );
- aSz = PixelToLogic( aSz );
- SetFillColor( Color( COL_TRANSPARENT ) );
- SetRasterOp( ROP_INVERT );
- aRect.Left() += aTopLeft.Y();
- aRect.Top() += aTopLeft.X();
- aRect.Right() -= aBottomRight.Y();
- aRect.Bottom() -= aBottomRight.X();
- DrawRect( aRect );
-}
-
-void SvxGrfCropPage::SvxCropExample::SetFrameSize( const Size& rSz )
-{
- aFrameSize = rSz;
- if(!aFrameSize.Width())
- aFrameSize.Width() = 1;
- if(!aFrameSize.Height())
- aFrameSize.Height() = 1;
- Size aWinSize( GetOutputSizePixel() );
- Fraction aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 );
- Fraction aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 );
-
- if( aYScale < aXScale )
- aXScale = aYScale;
-
- MapMode aMapMode( GetMapMode() );
-
- aMapMode.SetScaleX( aXScale );
- aMapMode.SetScaleY( aXScale );
-
- SetMapMode( aMapMode );
- Invalidate();
-}
-
-
-
-
diff --git a/svx/source/cui/grfpage.hrc b/svx/source/cui/grfpage.hrc
deleted file mode 100644
index b5e2022ff5..0000000000
--- a/svx/source/cui/grfpage.hrc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: grfpage.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define FT_BOTTOM 1
-#define FT_HEIGHT 2
-#define FT_HEIGHTZOOM 3
-#define FT_LEFT 4
-#define FT_ORIG_SIZE 5
-#define FT_RIGHT 6
-#define FT_TOP 7
-#define FT_WIDTH 8
-#define FT_WIDTHZOOM 9
-#define FL_CROP 10
-#define FL_SIZE 12
-#define FL_ZOOM 13
-#define MF_BOTTOM 14
-#define MF_HEIGHT 15
-#define MF_HEIGHTZOOM 16
-#define MF_LEFT 17
-#define MF_RIGHT 18
-#define MF_TOP 19
-#define MF_WIDTH 20
-#define MF_WIDTHZOOM 21
-#define PB_ORGSIZE 22
-#define RB_SIZECONST 23
-#define RB_ZOOMCONST 24
-#define WN_BSP 25
-
-
diff --git a/svx/source/cui/grfpage.hxx b/svx/source/cui/grfpage.hxx
deleted file mode 100644
index 2f66c75bdd..0000000000
--- a/svx/source/cui/grfpage.hxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: grfpage.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_GRFPAGE_HXX
-#define _SVX_GRFPAGE_HXX
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-#include <vcl/graph.hxx>
-#include <sfx2/tabdlg.hxx>
-
-
-class SvxGrfCropPage : public SfxTabPage
-{
- using Window::CalcZoom;
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- class SvxCropExample : public Window
- {
- Size aFrameSize;
- Point aTopLeft, aBottomRight;
- Graphic aGrf;
-
- public:
- SvxCropExample( Window* pPar, const ResId& rResId );
-
- virtual void Paint( const Rectangle& rRect );
-
- void SetTopLeft( const Point& rNew ) { aTopLeft = rNew; }
- void SetTop( long nVal ) { aTopLeft.X() = nVal; }
- void SetBottom( long nVal ) { aBottomRight.X() = nVal; }
- void SetLeft( long nVal ) { aTopLeft.Y() = nVal; }
- void SetRight( long nVal) { aBottomRight.Y() = nVal; }
- void SetBottomRight(const Point& rNew ) { aBottomRight = rNew; }
- void SetFrameSize( const Size& rSz );
- void SetGraphic( const Graphic& rGrf ) { aGrf = rGrf; }
- const Graphic& GetGraphic() const { return aGrf; }
- };
-
- FixedLine aCropFL;
- RadioButton aZoomConstRB;
- RadioButton aSizeConstRB;
- FixedText aLeftFT;
- MetricField aLeftMF;
- FixedText aRightFT;
- MetricField aRightMF;
- FixedText aTopFT;
- MetricField aTopMF;
- FixedText aBottomFT;
- MetricField aBottomMF;
-
- FixedLine aZoomFL;
- FixedText aWidthZoomFT;
- MetricField aWidthZoomMF;
- FixedText aHeightZoomFT;
- MetricField aHeightZoomMF;
-
- FixedLine aSizeFL;
- FixedText aWidthFT;
- MetricField aWidthMF;
- FixedText aHeightFT;
- MetricField aHeightMF;
- FixedText aOrigSizeFT;
- PushButton aOrigSizePB;
-
- // Example
- SvxCropExample aExampleWN;
-
-
- Timer aTimer;
- String aGraphicName;
- Size aOrigSize;
- Size aPageSize;
- const MetricField* pLastCropField;
- long nOldWidth;
- long nOldHeight;
- BOOL bReset;
- BOOL bInitialized;
- BOOL bSetOrigSize;
-
-
- SvxGrfCropPage( Window *pParent, const SfxItemSet &rSet );
- virtual ~SvxGrfCropPage();
-
- DECL_LINK( ZoomHdl, MetricField * );
- DECL_LINK( SizeHdl, MetricField * );
- DECL_LINK( CropHdl, const MetricField * );
- DECL_LINK( CropLoseFocusHdl, MetricField * );
- DECL_LINK( CropModifyHdl, MetricField * );
- DECL_LINK( OrigSizeHdl, PushButton * );
- DECL_LINK( Timeout, Timer * );
-
- void CalcZoom();
- void CalcMinMaxBorder();
- void GraphicHasChanged(BOOL bFound);
- virtual void ActivatePage(const SfxItemSet& rSet);
-
- Size GetGrfOrigSize( const Graphic& ) const;
-public:
- static SfxTabPage *Create( Window *pParent, const SfxItemSet &rSet );
-
- virtual BOOL FillItemSet( SfxItemSet &rSet );
- virtual void Reset( const SfxItemSet &rSet );
- virtual int DeactivatePage( SfxItemSet *pSet );
-};
-
-
-#endif
diff --git a/svx/source/cui/grfpage.src b/svx/source/cui/grfpage.src
deleted file mode 100644
index c8ebbf1348..0000000000
--- a/svx/source/cui/grfpage.src
+++ /dev/null
@@ -1,334 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: grfpage.src,v $
- * $Revision: 1.30 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "grfpage.hrc"
-
-/************************************************************/
-/* */
-/* */
-/* Crop-Page */
-/* */
-/* */
-/************************************************************/
-TabPage RID_SVXPAGE_GRFCROP
-{
- Hide = TRUE ;
- HelpID = HID_SVXPAGE_GRFCROP;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_CROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 164 , 8 ) ;
- Text [ en-US ] = "Crop" ;
- };
- FixedText FT_LEFT
- {
- Pos = MAP_APPFONT ( 12 , 44 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Text [ en-US ] = "~Left" ;
- };
- MetricField MF_LEFT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 42 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Text = "12,99" ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_RIGHT
- {
- Pos = MAP_APPFONT ( 12 , 60 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "~Right" ;
- };
- MetricField MF_RIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 58 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_TOP
- {
- Pos = MAP_APPFONT ( 94 , 44 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Text [ en-US ] = "~Top" ;
- };
- MetricField MF_TOP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 124 , 42 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Text = "12,99" ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_BOTTOM
- {
- Pos = MAP_APPFONT ( 94 , 60 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "~Bottom" ;
- };
- MetricField MF_BOTTOM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 124 , 58 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- RadioButton RB_SIZECONST
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 152 , 10 ) ;
- Text [ en-US ] = "Keep image si~ze" ;
- };
- RadioButton RB_ZOOMCONST
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 152 , 10 ) ;
- Check = TRUE ;
- Text [ en-US ] = "Keep ~scale" ;
- };
- Window WN_BSP
- {
- Pos = MAP_APPFONT ( 176 , 6 ) ;
- Size = MAP_APPFONT ( 78 , 78 ) ;
- Border = TRUE ;
- };
- FixedLine FL_ZOOM
- {
- Pos = MAP_APPFONT ( 6, 76 ) ;
- Size = MAP_APPFONT ( 164 , 8 ) ;
- Text [ en-US ] = "Scale" ;
- };
- FixedText FT_WIDTHZOOM
- {
- Left = TRUE ;
- Pos = MAP_APPFONT ( 12 , 89 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Text [ en-US ] = "~Width" ;
- };
- MetricField MF_WIDTHZOOM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 87 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Text = "12,99" ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 9999 ;
- First = 5 ;
- Last = 1000 ;
- Maximum = 9999 ;
- Value = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- SpinSize = 10 ;
- };
- FixedText FT_HEIGHTZOOM
- {
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Text [ en-US ] = "H~eight" ;
- Left = TRUE ;
- };
- MetricField MF_HEIGHTZOOM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 103 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 9999 ;
- First = 5 ;
- Last = 1000 ;
- Maximum = 9999 ;
- Value = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- SpinSize = 10 ;
- };
- FixedLine FL_SIZE
- {
- Pos = MAP_APPFONT ( 6 , 121 ) ;
- Size = MAP_APPFONT ( 164 , 8 ) ;
- Text [ en-US ] = "Image size" ;
- };
- FixedText FT_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 134 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "~Width" ;
- };
- MetricField MF_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 132 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Text = "12,99" ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 5 ;
- Maximum = 20000 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 5 ;
- Last = 20000 ;
- SpinSize = 10 ;
- };
- FixedText FT_HEIGHT
- {
- Pos = MAP_APPFONT ( 12 , 150 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "H~eight" ;
- };
- MetricField MF_HEIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 148 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 5 ;
- Maximum = 20000 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 5 ;
- Last = 20000 ;
- SpinSize = 10 ;
- };
- FixedText FT_ORIG_SIZE
- {
- Pos = MAP_APPFONT ( 176 , 132 ) ;
- Size = MAP_APPFONT ( 74 , 8 ) ;
- };
- PushButton PB_ORGSIZE
- {
- Pos = MAP_APPFONT ( 176 , 143 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original Size" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/hangulhanjadlg.cxx b/svx/source/cui/hangulhanjadlg.cxx
deleted file mode 100644
index 1ee49881f0..0000000000
--- a/svx/source/cui/hangulhanjadlg.cxx
+++ /dev/null
@@ -1,1929 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hangulhanjadlg.cxx,v $
- * $Revision: 1.19 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "hangulhanjadlg.hxx"
-#ifndef SVX_HANGUL_HANJA_DLG_HRC
-#include "hangulhanjadlg.hrc"
-#endif
-#include "commonlingui.hxx"
-#include <svx/dialmgr.hxx>
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#include <algorithm>
-#include <tools/urlobj.hxx>
-#include <vcl/controllayout.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/lingucfg.hxx>
-#include <svtools/linguprops.hxx>
-//#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
-//#include <com/sun/star/frame/XStorable.hpp>
-//#endif
-#ifndef _COM_SUN_STAR_LINGUISTIC2_CONVERSIONDICTIONARYTYPE_HPP_
-#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
-#ifndef _COM_SUN_STAR_LINGUISTIC2_CONVERSIONDIRECTION_HDL_
-#include <com/sun/star/linguistic2/ConversionDirection.hdl>
-#endif
-#endif
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#ifndef _COM_SUN_STAR_I18N_TEXTCONVERSIONOPTION_HDL_
-#include <com/sun/star/i18n/TextConversionOption.hdl>
-#endif
-#include <com/sun/star/util/XFlushable.hpp>
-
-#include <comphelper/processfactory.hxx>
-//#include <ucbhelper/content.hxx>
-
-
-#define HHC HangulHanjaConversion
-#define LINE_CNT static_cast< USHORT >(2)
-
-//.............................................................................
-namespace svx
-{
-//.............................................................................
-/*
- using HangulHanjaConversion::eSimpleConversion;
- using HangulHanjaConversion::eHangulBracketed;
- using HangulHanjaConversion::eHanjaBracketed;
- using HangulHanjaConversion::eRubyHanjaAbove;
- using HangulHanjaConversion::eRubyHanjaBelow;
- using HangulHanjaConversion::eRubyHangulAbove;
- using HangulHanjaConversion::eRubyHangulBelow;
-*/
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::linguistic2;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
- using ::rtl::OUString;
-
- //-------------------------------------------------------------------------
- namespace
- {
- class FontSwitch
- {
- private:
- OutputDevice& m_rDev;
-
- public:
- inline FontSwitch( OutputDevice& _rDev, const Font& _rTemporaryFont )
- :m_rDev( _rDev )
- {
- m_rDev.Push( PUSH_FONT );
- m_rDev.SetFont( _rTemporaryFont );
- }
- inline ~FontSwitch( )
- {
- m_rDev.Pop( );
- }
- };
- }
-
- //=========================================================================
- //= PseudoRubyText
- //=========================================================================
- /** a class which allows to draw two texts in a pseudo-ruby way (which basically
- means one text above or below the other, and a little bit smaller)
- */
- class PseudoRubyText
- {
- public:
- enum RubyPosition
- {
- eAbove, eBelow
- };
-
- protected:
- const String m_sPrimaryText;
- const String m_sSecondaryText;
- const RubyPosition m_ePosition;
-
- public:
- PseudoRubyText( const String& _rPrimary, const String& _rSecondary, const RubyPosition _ePosition );
-
- public:
- void Paint( OutputDevice& _rDevice, const Rectangle& _rRect, USHORT _nTextStyle,
- Rectangle* _pPrimaryLocation = NULL, Rectangle* _pSecondaryLocation = NULL,
- ::vcl::ControlLayoutData* _pLayoutData = NULL );
- };
-
- //-------------------------------------------------------------------------
- PseudoRubyText::PseudoRubyText( const String& _rPrimary, const String& _rSecondary, const RubyPosition _ePosition )
- :m_sPrimaryText( _rPrimary )
- ,m_sSecondaryText( _rSecondary )
- ,m_ePosition( _ePosition )
- {
- }
-
- //-------------------------------------------------------------------------
- void PseudoRubyText::Paint( OutputDevice& _rDevice, const Rectangle& _rRect, USHORT _nTextStyle,
- Rectangle* _pPrimaryLocation, Rectangle* _pSecondaryLocation, ::vcl::ControlLayoutData* _pLayoutData )
- {
- bool bLayoutOnly = NULL != _pLayoutData;
- MetricVector* pTextMetrics = bLayoutOnly ? &_pLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayoutOnly ? &_pLayoutData->m_aDisplayText : NULL;
-
- Size aPlaygroundSize( _rRect.GetSize() );
-
- // the font for the secondary text:
- Font aSmallerFont( _rDevice.GetFont() );
- // heuristic: 80% of the original size
- aSmallerFont.SetHeight( (long)( 0.8 * aSmallerFont.GetHeight() ) );
-
- // let's calculate the size of our two texts
- Rectangle aPrimaryRect = _rDevice.GetTextRect( _rRect, m_sPrimaryText, _nTextStyle );
- Rectangle aSecondaryRect;
- {
- FontSwitch aFontRestore( _rDevice, aSmallerFont );
- aSecondaryRect = _rDevice.GetTextRect( _rRect, m_sSecondaryText, _nTextStyle );
- }
-
- // position these rectangles properly
- // x-axis:
- sal_Int32 nCombinedWidth = ::std::max( aSecondaryRect.GetWidth(), aPrimaryRect.GetWidth() );
- // the rectangle where both texts will reside is as high as possible, and as wide as the
- // widest of both text rects
- aPrimaryRect.Left() = aSecondaryRect.Left() = _rRect.Left();
- aPrimaryRect.Right() = aSecondaryRect.Right() = _rRect.Left() + nCombinedWidth;
- if ( TEXT_DRAW_RIGHT & _nTextStyle )
- {
- // move the rectangles to the right
- aPrimaryRect.Move( aPlaygroundSize.Width() - nCombinedWidth, 0 );
- aSecondaryRect.Move( aPlaygroundSize.Width() - nCombinedWidth, 0 );
- }
- else if ( TEXT_DRAW_CENTER & _nTextStyle )
- {
- // center the rectangles
- aPrimaryRect.Move( ( aPlaygroundSize.Width() - nCombinedWidth ) / 2, 0 );
- aSecondaryRect.Move( ( aPlaygroundSize.Width() - nCombinedWidth ) / 2, 0 );
- }
-
- // y-axis:
- sal_Int32 nCombinedHeight = aPrimaryRect.GetHeight() + aSecondaryRect.GetHeight();
- // align to the top, for the moment
- aPrimaryRect.Move( 0, _rRect.Top() - aPrimaryRect.Top() );
- aSecondaryRect.Move( 0, aPrimaryRect.Top() + aPrimaryRect.GetHeight() - aSecondaryRect.Top() );
- if ( TEXT_DRAW_BOTTOM & _nTextStyle )
- {
- // move the rects to the bottom
- aPrimaryRect.Move( 0, aPlaygroundSize.Height() - nCombinedHeight );
- aSecondaryRect.Move( 0, aPlaygroundSize.Height() - nCombinedHeight );
- }
- else if ( TEXT_DRAW_VCENTER & _nTextStyle )
- {
- // move the rects to the bottom
- aPrimaryRect.Move( 0, ( aPlaygroundSize.Height() - nCombinedHeight ) / 2 );
- aSecondaryRect.Move( 0, ( aPlaygroundSize.Height() - nCombinedHeight ) / 2 );
- }
-
- // 'til here, everything we did assumes that the secondary text is painted _below_ the primary
- // text. If this isn't the case, we need to correct the rectangles
- if ( eAbove == m_ePosition )
- {
- sal_Int32 nVertDistance = aSecondaryRect.Top() - aPrimaryRect.Top();
- aSecondaryRect.Move( 0, -nVertDistance );
- aPrimaryRect.Move( 0, nCombinedHeight - nVertDistance );
- }
-
- // now draw the texts
- // as we already calculated the precise rectangles for the texts, we don't want to
- // use the alignment flags given - within it's rect, every text is centered
- USHORT nDrawTextStyle( _nTextStyle );
- nDrawTextStyle &= ~( TEXT_DRAW_RIGHT | TEXT_DRAW_LEFT | TEXT_DRAW_BOTTOM | TEXT_DRAW_TOP );
- nDrawTextStyle |= TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER;
-
- _rDevice.DrawText( aPrimaryRect, m_sPrimaryText, nDrawTextStyle, pTextMetrics, pDisplayText );
- {
- FontSwitch aFontRestore( _rDevice, aSmallerFont );
- _rDevice.DrawText( aSecondaryRect, m_sSecondaryText, nDrawTextStyle, pTextMetrics, pDisplayText );
- }
-
- // outta here
- if ( _pPrimaryLocation )
- *_pPrimaryLocation = aPrimaryRect;
- if ( _pSecondaryLocation )
- *_pSecondaryLocation = aSecondaryRect;
- }
-
- //=========================================================================
- //= RubyRadioButton
- //=========================================================================
- class RubyRadioButton :public RadioButton
- ,protected PseudoRubyText
- {
- using svx::PseudoRubyText::Paint;
-
- public:
- RubyRadioButton(
- Window* _pParent,
- const ResId& _rId, // the text in the resource will be taken as primary text
- const String& _rSecondary, // this will be the secondary text which will be printed somewhat smaller
- const PseudoRubyText::RubyPosition _ePosition );
-
- protected:
- virtual void Paint( const Rectangle& _rRect );
- };
-
- //-------------------------------------------------------------------------
- RubyRadioButton::RubyRadioButton( Window* _pParent, const ResId& _rId,
- const String& _rSecondary, const PseudoRubyText::RubyPosition _ePosition )
- :RadioButton( _pParent, _rId )
- ,PseudoRubyText( RadioButton::GetText(), _rSecondary, _ePosition )
- {
- }
-
- //-------------------------------------------------------------------------
- void RubyRadioButton::Paint( const Rectangle& )
- {
- HideFocus();
-
- // calculate the size of the radio image - we're to paint our text _after_ this image
- DBG_ASSERT( !GetModeRadioImage(), "RubyRadioButton::Paint: images not supported!" );
- Size aImageSize = GetRadioImage( GetSettings(), 0 ).GetSizePixel();
- aImageSize.Width() = CalcZoom( aImageSize.Width() );
- aImageSize.Height() = CalcZoom( aImageSize.Height() );
-
- Rectangle aOverallRect( Point( 0, 0 ), GetOutputSizePixel() );
- aOverallRect.Left() += aImageSize.Width() + 4; // 4 is the separator between the image and the text
- // inflate the rect a little bit (because the VCL radio button does the same)
- Rectangle aTextRect( aOverallRect );
- ++aTextRect.Left(); --aTextRect.Right();
- ++aTextRect.Top(); --aTextRect.Bottom();
-
- // calculate the text flags for the painting
- USHORT nTextStyle = TEXT_DRAW_MNEMONIC;
- WinBits nStyle = GetStyle( );
-
- // the horizontal alignment
- if ( nStyle & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
- else if ( nStyle & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
- else
- nTextStyle |= TEXT_DRAW_LEFT;
- // the vertical alignment
- if ( nStyle & WB_BOTTOM )
- nTextStyle |= TEXT_DRAW_BOTTOM;
- else if ( nStyle & WB_VCENTER )
- nTextStyle |= TEXT_DRAW_VCENTER;
- else
- nTextStyle |= TEXT_DRAW_TOP;
- // mnemonics
- if ( 0 == ( nStyle & WB_NOLABEL ) )
- nTextStyle |= TEXT_DRAW_MNEMONIC;
-
- // paint the ruby text
- Rectangle aPrimaryTextLocation, aSecondaryTextLocation;
- PseudoRubyText::Paint( *this, aTextRect, nTextStyle, &aPrimaryTextLocation, &aSecondaryTextLocation );
-
- // the focus rectangle is to be painted around both texts
- Rectangle aCombinedRect( aPrimaryTextLocation );
- aCombinedRect.Union( aSecondaryTextLocation );
- SetFocusRect( aCombinedRect );
-
- // let the base class paint the radio button
- // for this, give it the proper location to paint the image (vertically centered, relative to our text)
- Rectangle aImageLocation( Point( 0, 0 ), aImageSize );
- sal_Int32 nTextHeight = aSecondaryTextLocation.Bottom() - aPrimaryTextLocation.Top();
- aImageLocation.Top() = aPrimaryTextLocation.Top() + ( nTextHeight - aImageSize.Height() ) / 2;
- aImageLocation.Bottom() = aImageLocation.Top() + aImageSize.Height();
- SetStateRect( aImageLocation );
- DrawRadioButtonState( );
-
- // mouse clicks should be recognized in a rect which is one pixel larger in each direction, plus
- // includes the image
- aCombinedRect.Left() = aImageLocation.Left(); ++aCombinedRect.Right();
- --aCombinedRect.Top(); ++aCombinedRect.Bottom();
- SetMouseRect( aCombinedRect );
-
- // paint the focus rect, if necessary
- if ( HasFocus() )
- ShowFocus( aTextRect );
- }
-
- //=========================================================================
- //= SuggestionSet
- //=========================================================================
- //-------------------------------------------------------------------------
-
- SuggestionSet::SuggestionSet( Window* pParent )
- : ValueSet( pParent, pParent->GetStyle() | WB_BORDER )
-
- {
- }
-
- SuggestionSet::~SuggestionSet()
- {
- ClearSet();
- }
-
- void SuggestionSet::UserDraw( const UserDrawEvent& rUDEvt )
- {
- OutputDevice* pDev = rUDEvt.GetDevice();
- Rectangle aRect = rUDEvt.GetRect();
- USHORT nItemId = rUDEvt.GetItemId();
-
- String sText = *static_cast< String* >( GetItemData( nItemId ) );
- pDev->DrawText( aRect, sText, TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER );
- }
-
- void SuggestionSet::ClearSet()
- {
- USHORT i, nCount = GetItemCount();
- for ( i = 0; i < nCount; ++i )
- delete static_cast< String* >( GetItemData(i) );
- Clear();
- }
-
- //=========================================================================
- //= SuggestionDisplay
- //=========================================================================
- //-------------------------------------------------------------------------
-
- SuggestionDisplay::SuggestionDisplay( Window* pParent, const ResId& rResId )
- : Control( pParent, rResId )
- , m_bDisplayListBox(true)
- , m_aValueSet(this)
- , m_aListBox(this,GetStyle() | WB_BORDER )
- , m_bInSelectionUpdate(false)
- {
- m_aValueSet.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
- m_aListBox.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
-
- m_aValueSet.SetLineCount( LINE_CNT );
- m_aValueSet.SetStyle( m_aValueSet.GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
- m_aValueSet.SetBorderStyle( WINDOW_BORDER_MONO );
- String aOneCharacter(RTL_CONSTASCII_STRINGPARAM("AU"));
- long nItemWidth = 2*GetTextWidth( aOneCharacter );
- m_aValueSet.SetItemWidth( nItemWidth );
-
- Point aPos(0,0);
- Size aSize(GetSizePixel());
- m_aValueSet.SetSizePixel(aSize);
- m_aListBox.SetSizePixel(aSize);
-
- implUpdateDisplay();
- }
-
- SuggestionDisplay::~SuggestionDisplay()
- {
- }
-
- void SuggestionDisplay::implUpdateDisplay()
- {
- bool bShowBox = IsVisible() && m_bDisplayListBox;
- bool bShowSet = IsVisible() && !m_bDisplayListBox;
-
- m_aListBox.Show(bShowBox);
- m_aValueSet.Show(bShowSet);
- }
-
- void SuggestionDisplay::StateChanged( StateChangedType nStateChange )
- {
- if( STATE_CHANGE_VISIBLE == nStateChange )
- implUpdateDisplay();
- }
-
- Control& SuggestionDisplay::implGetCurrentControl()
- {
- if( m_bDisplayListBox )
- return m_aListBox;
- return m_aValueSet;
- }
-
- void SuggestionDisplay::KeyInput( const KeyEvent& rKEvt )
- {
- implGetCurrentControl().KeyInput( rKEvt );
- }
- void SuggestionDisplay::KeyUp( const KeyEvent& rKEvt )
- {
- implGetCurrentControl().KeyUp( rKEvt );
- }
- void SuggestionDisplay::Activate()
- {
- implGetCurrentControl().Activate();
- }
- void SuggestionDisplay::Deactivate()
- {
- implGetCurrentControl().Deactivate();
- }
- void SuggestionDisplay::GetFocus()
- {
- implGetCurrentControl().GetFocus();
- }
- void SuggestionDisplay::LoseFocus()
- {
- implGetCurrentControl().LoseFocus();
- }
- void SuggestionDisplay::Command( const CommandEvent& rCEvt )
- {
- implGetCurrentControl().Command( rCEvt );
- }
-
- void SuggestionDisplay::DisplayListBox( bool bDisplayListBox )
- {
- if( m_bDisplayListBox != bDisplayListBox )
- {
- Control& rOldControl = implGetCurrentControl();
- BOOL bHasFocus = rOldControl.HasFocus();
-
- m_bDisplayListBox = bDisplayListBox;
-
- if( bHasFocus )
- {
- Control& rNewControl = implGetCurrentControl();
- rNewControl.GrabFocus();
- }
-
- implUpdateDisplay();
- }
- }
-
- IMPL_LINK( SuggestionDisplay, SelectSuggestionHdl, Control*, pControl )
- {
- if( m_bInSelectionUpdate )
- return 0L;
-
- m_bInSelectionUpdate = true;
- if(pControl==&m_aListBox)
- {
- USHORT nPos = m_aListBox.GetSelectEntryPos();
- m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
- }
- else
- {
- USHORT nPos = m_aValueSet.GetSelectItemId()-1; //itemid == pos+1 (id 0 has special meaning)
- m_aListBox.SelectEntryPos( nPos );
- }
- m_bInSelectionUpdate = false;
- m_aSelectLink.Call(this);
- return 0L;
- }
-
- void SuggestionDisplay::SetSelectHdl( const Link& rLink )
- {
- m_aSelectLink = rLink;
- }
- void SuggestionDisplay::Clear()
- {
- m_aListBox.Clear();
- m_aValueSet.Clear();
- }
- void SuggestionDisplay::InsertEntry( const XubString& rStr )
- {
- USHORT nItemId = m_aListBox.InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
- m_aValueSet.InsertItem( nItemId );
- String* pItemData = new String(rStr);
- m_aValueSet.SetItemData( nItemId, pItemData );
- }
- void SuggestionDisplay::SelectEntryPos( USHORT nPos )
- {
- m_aListBox.SelectEntryPos( nPos );
- m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
- }
- USHORT SuggestionDisplay::GetEntryCount() const
- {
- return m_aListBox.GetEntryCount();
- }
- XubString SuggestionDisplay::GetEntry( USHORT nPos ) const
- {
- return m_aListBox.GetEntry( nPos );
- }
- XubString SuggestionDisplay::GetSelectEntry() const
- {
- return m_aListBox.GetSelectEntry();
- }
- void SuggestionDisplay::SetHelpIds()
- {
- this->SetHelpId( HID_HANGULDLG_SUGGESTIONS );
- m_aValueSet.SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
- m_aListBox.SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
- }
-
- //=========================================================================
- //= HangulHanjaConversionDialog
- //=========================================================================
- //-------------------------------------------------------------------------
- HangulHanjaConversionDialog::HangulHanjaConversionDialog( Window* _pParent, HHC::ConversionDirection _ePrimaryDirection )
- :ModalDialog( _pParent, SVX_RES( RID_SVX_MDLG_HANGULHANJA ) )
- ,m_pPlayground( new SvxCommonLinguisticControl( this ) )
- ,m_aFind ( m_pPlayground.get(), SVX_RES( PB_FIND ) )
- ,m_aSuggestions ( m_pPlayground.get(), SVX_RES( CTL_SUGGESTIONS ) )
- ,m_aFormat ( m_pPlayground.get(), SVX_RES( FT_FORMAT ) )
- ,m_aSimpleConversion( m_pPlayground.get(), SVX_RES( RB_SIMPLE_CONVERSION ) )
- ,m_aHangulBracketed ( m_pPlayground.get(), SVX_RES( RB_HANJA_HANGUL_BRACKETED ) )
- ,m_aHanjaBracketed ( m_pPlayground.get(), SVX_RES( RB_HANGUL_HANJA_BRACKETED ) )
- ,m_aConversion ( m_pPlayground.get(), SVX_RES( FT_CONVERSION ) )
- ,m_aHangulOnly ( m_pPlayground.get(), SVX_RES( CB_HANGUL_ONLY ) )
- ,m_aHanjaOnly ( m_pPlayground.get(), SVX_RES( CB_HANJA_ONLY ) )
- ,m_aReplaceByChar ( m_pPlayground.get(), SVX_RES( CB_REPLACE_BY_CHARACTER ) )
- ,m_pIgnoreNonPrimary( NULL )
- ,m_bDocumentMode( true )
- {
- // special creation of the 4 pseudo-ruby radio buttons
- String sSecondaryHangul( SVX_RES( STR_HANGUL ) );
- String sSecondaryHanja( SVX_RES( STR_HANJA ) );
- m_pHanjaAbove.reset( new RubyRadioButton( m_pPlayground.get(), SVX_RES( RB_HANGUL_HANJA_ABOVE ), sSecondaryHanja, PseudoRubyText::eAbove ) );
- m_pHanjaBelow.reset( new RubyRadioButton( m_pPlayground.get(), SVX_RES( RB_HANGUL_HANJA_BELOW ), sSecondaryHanja, PseudoRubyText::eBelow ) );
- m_pHangulAbove.reset( new RubyRadioButton( m_pPlayground.get(), SVX_RES( RB_HANJA_HANGUL_ABOVE ), sSecondaryHangul, PseudoRubyText::eAbove ) );
- m_pHangulBelow.reset( new RubyRadioButton( m_pPlayground.get(), SVX_RES( RB_HANJA_HANGUL_BELOW ), sSecondaryHangul, PseudoRubyText::eBelow ) );
-
- // since these 4 buttons are not created within the other members, they have a wrong initial Z-Order
- // correct this
- m_pHanjaAbove->SetZOrder( &m_aHanjaBracketed, WINDOW_ZORDER_BEHIND );
- m_pHanjaBelow->SetZOrder( m_pHanjaAbove.get(), WINDOW_ZORDER_BEHIND );
- m_pHangulAbove->SetZOrder( m_pHanjaBelow.get(), WINDOW_ZORDER_BEHIND );
- m_pHangulBelow->SetZOrder( m_pHangulAbove.get(), WINDOW_ZORDER_BEHIND );
-
- // VCL automatically sets the WB_GROUP bit, if the previous sibling (at the moment of creation)
- // is no radion button
- m_pHanjaAbove->SetStyle( m_pHanjaAbove->GetStyle() & ~WB_GROUP );
-
- // the "Find" button and the word input control may not have the proper distance/extensions
- // -> correct this
- Point aDistance = LogicToPixel( Point( 3, 0 ), MAP_APPFONT );
- sal_Int32 nTooLargeByPixels =
- // right margin of the word input control
- ( m_pPlayground->GetWordInputControl().GetPosPixel().X()
- + m_pPlayground->GetWordInputControl().GetSizePixel().Width()
- )
- // minus left margin of the find button
- - m_aFind.GetPosPixel().X()
- // plus desired distance between the both
- + aDistance.X();
- // make the word input control smaller
- Size aSize = m_pPlayground->GetWordInputControl().GetSizePixel();
- aSize.Width() -= nTooLargeByPixels;
- m_pPlayground->GetWordInputControl().SetSizePixel( aSize );
-
- // additionall, the playground is not wide enough (in it's default size)
- sal_Int32 nEnlargeWidth = 0;
- {
- FixedText aBottomAnchor( m_pPlayground.get(), SVX_RES( FT_RESIZE_ANCHOR ) );
- Point aAnchorPos = aBottomAnchor.GetPosPixel();
-
- nEnlargeWidth = aAnchorPos.X() - m_pPlayground->GetActionButtonsLocation().X();
- }
- m_pPlayground->Enlarge( nEnlargeWidth, 0 );
-
- // insert our controls into the z-order of the playground
- m_pPlayground->InsertControlGroup( m_aFind, m_aFind, SvxCommonLinguisticControl::eLeftRightWords );
- m_pPlayground->InsertControlGroup( m_aSuggestions, m_aHanjaOnly, SvxCommonLinguisticControl::eSuggestionLabel );
- m_pPlayground->InsertControlGroup( m_aReplaceByChar, m_aReplaceByChar, SvxCommonLinguisticControl::eActionButtons );
-
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eClose, LINK( this, HangulHanjaConversionDialog, OnClose ) );
- m_pPlayground->GetWordInputControl().SetModifyHdl( LINK( this, HangulHanjaConversionDialog, OnSuggestionModified ) );
- m_aSuggestions.SetSelectHdl( LINK( this, HangulHanjaConversionDialog, OnSuggestionSelected ) );
-
- m_aReplaceByChar.SetClickHdl( LINK( this, HangulHanjaConversionDialog, ClickByCharacterHdl ) );
-
- m_aHangulOnly.SetClickHdl( LINK( this, HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
- m_aHanjaOnly.SetClickHdl( LINK( this, HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
-
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eOptions,
- LINK( this, HangulHanjaConversionDialog, OnOption ) );
- m_pPlayground->GetButton( SvxCommonLinguisticControl::eOptions )->Show();
-// m_pPlayground->EnableButton( SvxCommonLinguisticControl::eOptions, true );
-
- if ( HangulHanjaConversion::eHangulToHanja == _ePrimaryDirection )
- {
-// m_aHanjaOnly.Enable( sal_False );
- m_pIgnoreNonPrimary = &m_aHangulOnly;
- }
- else
- {
-// m_aHangulOnly.Enable( sal_False );
- m_pIgnoreNonPrimary = &m_aHanjaOnly;
- }
-// m_pIgnoreNonPrimary->Check();
-
- // initial focus
- FocusSuggestion( );
-
- // initial control values
- m_aSimpleConversion.Check();
-
- m_pPlayground->GetButton(SvxCommonLinguisticControl::eClose )->SetHelpId(HID_HANGULDLG_BUTTON_CLOSE );
- m_pPlayground->GetButton(SvxCommonLinguisticControl::eIgnore )->SetHelpId(HID_HANGULDLG_BUTTON_IGNORE );
- m_pPlayground->GetButton(SvxCommonLinguisticControl::eIgnoreAll )->SetHelpId(HID_HANGULDLG_BUTTON_IGNOREALL);
- m_pPlayground->GetButton(SvxCommonLinguisticControl::eChange )->SetHelpId(HID_HANGULDLG_BUTTON_CHANGE );
- m_pPlayground->GetButton(SvxCommonLinguisticControl::eChangeAll )->SetHelpId(HID_HANGULDLG_BUTTON_CHANGEALL);
- m_pPlayground->GetButton(SvxCommonLinguisticControl::eOptions )->SetHelpId(HID_HANGULDLG_BUTTON_OPTIONS );
- m_pPlayground->GetWordInputControl().SetHelpId(HID_HANGULDLG_EDIT_NEWWORD);
-
- FreeResource();
-
- m_aSuggestions.SetHelpIds();
- }
-
- //-------------------------------------------------------------------------
- HangulHanjaConversionDialog::~HangulHanjaConversionDialog( )
- {
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::FillSuggestions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rSuggestions )
- {
- m_aSuggestions.Clear();
-
- const ::rtl::OUString* pSuggestions = _rSuggestions.getConstArray();
- const ::rtl::OUString* pSuggestionsEnd = _rSuggestions.getConstArray() + _rSuggestions.getLength();
- while ( pSuggestions != pSuggestionsEnd )
- m_aSuggestions.InsertEntry( *pSuggestions++ );
-
- // select the first suggestion, and fill in the suggestion edit field
- String sFirstSuggestion;
- if ( m_aSuggestions.GetEntryCount() )
- {
- sFirstSuggestion = m_aSuggestions.GetEntry( 0 );
- m_aSuggestions.SelectEntryPos( 0 );
- }
- m_pPlayground->GetWordInputControl().SetText( sFirstSuggestion );
- m_pPlayground->GetWordInputControl().SaveValue();
- OnSuggestionModified( &m_pPlayground->GetWordInputControl() );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetOptionsChangedHdl( const Link& _rHdl )
- {
- m_aOptionsChangedLink = _rHdl;
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetIgnoreHdl( const Link& _rHdl )
- {
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eIgnore, _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetIgnoreAllHdl( const Link& _rHdl )
- {
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eIgnoreAll, _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetChangeHdl( const Link& _rHdl )
- {
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eChange, _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetChangeAllHdl( const Link& _rHdl )
- {
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eChangeAll, _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetOptionsHdl( const Link& _rHdl )
- {
- m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eOptions, _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetFindHdl( const Link& _rHdl )
- {
- m_aFind.SetClickHdl( _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetConversionFormatChangedHdl( const Link& _rHdl )
- {
- m_aSimpleConversion.SetClickHdl( _rHdl );
- m_aHangulBracketed.SetClickHdl( _rHdl );
- m_aHanjaBracketed.SetClickHdl( _rHdl );
- m_pHanjaAbove->SetClickHdl( _rHdl );
- m_pHanjaBelow->SetClickHdl( _rHdl );
- m_pHangulAbove->SetClickHdl( _rHdl );
- m_pHangulBelow->SetClickHdl( _rHdl );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetClickByCharacterHdl( const Link& _rHdl )
- {
- m_aClickByCharacterLink = _rHdl;
- }
-
- //-------------------------------------------------------------------------
- IMPL_LINK( HangulHanjaConversionDialog, OnSuggestionSelected, void*, EMPTYARG )
- {
- m_pPlayground->GetWordInputControl().SetText( m_aSuggestions.GetSelectEntry() );
- OnSuggestionModified( NULL );
- return 0L;
- }
-
- //-------------------------------------------------------------------------
- IMPL_LINK( HangulHanjaConversionDialog, OnSuggestionModified, void*, EMPTYARG )
- {
- m_aFind.Enable( m_pPlayground->GetWordInputControl().GetSavedValue() != m_pPlayground->GetWordInputControl().GetText() );
-
- bool bSameLen = m_pPlayground->GetWordInputControl().GetText().Len() == m_pPlayground->GetCurrentText().Len();
- m_pPlayground->EnableButton( SvxCommonLinguisticControl::eChange, m_bDocumentMode && bSameLen );
- m_pPlayground->EnableButton( SvxCommonLinguisticControl::eChangeAll, m_bDocumentMode && bSameLen );
-
- return 0L;
- }
-
- //-------------------------------------------------------------------------
- IMPL_LINK( HangulHanjaConversionDialog, ClickByCharacterHdl, CheckBox *, pBox )
- {
- m_aClickByCharacterLink.Call(pBox);
-
- bool bByCharacter = pBox->IsChecked();
- m_aSuggestions.DisplayListBox( !bByCharacter );
-
- return 0L;
- }
-
- //-------------------------------------------------------------------------
- IMPL_LINK( HangulHanjaConversionDialog, OnConversionDirectionClicked, CheckBox *, pBox )
- {
- CheckBox *pOtherBox = 0;
- if (pBox == &m_aHangulOnly)
- pOtherBox = &m_aHanjaOnly;
- else if (pBox == &m_aHanjaOnly)
- pOtherBox = &m_aHangulOnly;
- if (pBox && pOtherBox)
- {
- BOOL bBoxChecked = pBox->IsChecked();
- if (bBoxChecked)
- pOtherBox->Check( FALSE );
- pOtherBox->Enable( !bBoxChecked );
- }
-
- return 0L;
- }
-
- //-------------------------------------------------------------------------
- IMPL_LINK( HangulHanjaConversionDialog, OnClose, void*, EMPTYARG )
- {
- Close();
- return 0L;
- }
-
- IMPL_LINK( HangulHanjaConversionDialog, OnOption, void*, EMPTYARG )
- {
- HangulHanjaOptionsDialog aOptDlg( this );
- aOptDlg.Execute();
- m_aOptionsChangedLink.Call(this);
- return 0L;
- }
-
- //-------------------------------------------------------------------------
- String HangulHanjaConversionDialog::GetCurrentString( ) const
- {
- return m_pPlayground->GetCurrentText( );
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::FocusSuggestion( )
- {
- m_pPlayground->GetWordInputControl().GrabFocus();
- }
-
- //-------------------------------------------------------------------------
- namespace
- {
- void lcl_modifyWindowStyle( Window* _pWin, WinBits _nSet, WinBits _nReset )
- {
- DBG_ASSERT( 0 == ( _nSet & _nReset ), "lcl_modifyWindowStyle: set _and_ reset the same bit?" );
- if ( _pWin )
- _pWin->SetStyle( ( _pWin->GetStyle() | _nSet ) & ~_nReset );
- }
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetCurrentString( const String& _rNewString,
- const Sequence< ::rtl::OUString >& _rSuggestions, bool _bOriginatesFromDocument )
- {
- m_pPlayground->SetCurrentText( _rNewString );
-
- bool bOldDocumentMode = m_bDocumentMode;
- m_bDocumentMode = _bOriginatesFromDocument; // before FillSuggestions!
- FillSuggestions( _rSuggestions );
-
- m_pPlayground->EnableButton( SvxCommonLinguisticControl::eIgnoreAll, m_bDocumentMode );
- // all other buttons have been implicitly enabled or disabled during filling in the suggestions
-
- // switch the def button depending if we're working for document text
- if ( bOldDocumentMode != m_bDocumentMode )
- {
- Window* pOldDefButton = NULL;
- Window* pNewDefButton = NULL;
- if ( m_bDocumentMode )
- {
- pOldDefButton = &m_aFind;
- pNewDefButton = m_pPlayground->GetButton( SvxCommonLinguisticControl::eChange );
- }
- else
- {
- pOldDefButton = m_pPlayground->GetButton( SvxCommonLinguisticControl::eChange );
- pNewDefButton = &m_aFind;
- }
-
- DBG_ASSERT( WB_DEFBUTTON == ( pOldDefButton->GetStyle( ) & WB_DEFBUTTON ),
- "HangulHanjaConversionDialog::SetCurrentString: wrong previous default button (1)!" );
- DBG_ASSERT( 0 == ( pNewDefButton->GetStyle( ) & WB_DEFBUTTON ),
- "HangulHanjaConversionDialog::SetCurrentString: wrong previous default button (2)!" );
-
- lcl_modifyWindowStyle( pOldDefButton, 0, WB_DEFBUTTON );
- lcl_modifyWindowStyle( pNewDefButton, WB_DEFBUTTON, 0 );
-
- // give the focus to the new def button temporarily - VCL is somewhat peculiar
- // in recognizing a new default button
- sal_uInt32 nSaveFocusId = Window::SaveFocus();
- pNewDefButton->GrabFocus();
- Window::EndSaveFocus( nSaveFocusId );
- }
- }
-
- //-------------------------------------------------------------------------
- String HangulHanjaConversionDialog::GetCurrentSuggestion( ) const
- {
- return m_pPlayground->GetWordInputControl().GetText();
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetByCharacter( sal_Bool _bByCharacter )
- {
- m_aReplaceByChar.Check( _bByCharacter );
- m_aSuggestions.DisplayListBox( !_bByCharacter );
- }
-
- //-------------------------------------------------------------------------
- sal_Bool HangulHanjaConversionDialog::GetByCharacter( ) const
- {
- return m_aReplaceByChar.IsChecked();
- }
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetConversionDirectionState(
- sal_Bool _bTryBothDirections,
- HHC::ConversionDirection _ePrimaryConversionDirection )
- {
- // default state: try both direction
- m_aHangulOnly.Check( FALSE );
- m_aHangulOnly.Enable( TRUE );
- m_aHanjaOnly.Check( FALSE );
- m_aHanjaOnly.Enable( TRUE );
-
- if (!_bTryBothDirections)
- {
- CheckBox *pBox = _ePrimaryConversionDirection == HHC::eHangulToHanja?
- &m_aHangulOnly : &m_aHanjaOnly;
- pBox->Check( sal_True );
- OnConversionDirectionClicked( pBox );
- }
- }
-
- //-------------------------------------------------------------------------
- sal_Bool HangulHanjaConversionDialog::GetUseBothDirections( ) const
- {
-// DBG_ASSERT( m_pIgnoreNonPrimary, "HangulHanjaConversionDialog::GetUseBothDirections: where's the check box pointer?" );
-// return m_pIgnoreNonPrimary ? !m_pIgnoreNonPrimary->IsChecked( ) : sal_True;
- return !m_aHangulOnly.IsChecked() && !m_aHanjaOnly.IsChecked();
- }
-
- //-------------------------------------------------------------------------
- HHC::ConversionDirection HangulHanjaConversionDialog::GetDirection(
- HHC::ConversionDirection eDefaultDirection ) const
- {
- HHC::ConversionDirection eDirection = eDefaultDirection;
- if (m_aHangulOnly.IsChecked() && !m_aHanjaOnly.IsChecked())
- eDirection = HHC::eHangulToHanja;
- else if (!m_aHangulOnly.IsChecked() && m_aHanjaOnly.IsChecked())
- eDirection = HHC::eHanjaToHangul;
- return eDirection;
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::SetConversionFormat( HHC::ConversionFormat _eType )
- {
- switch ( _eType )
- {
- case HHC::eSimpleConversion: m_aSimpleConversion.Check(); break;
- case HHC::eHangulBracketed: m_aHangulBracketed.Check(); break;
- case HHC::eHanjaBracketed: m_aHanjaBracketed.Check(); break;
- case HHC::eRubyHanjaAbove: m_pHanjaAbove->Check(); break;
- case HHC::eRubyHanjaBelow: m_pHanjaBelow->Check(); break;
- case HHC::eRubyHangulAbove: m_pHangulAbove->Check(); break;
- case HHC::eRubyHangulBelow: m_pHangulBelow->Check(); break;
- default:
- DBG_ERROR( "HangulHanjaConversionDialog::SetConversionFormat: unknown type!" );
- }
- }
-
- //-------------------------------------------------------------------------
- HHC::ConversionFormat HangulHanjaConversionDialog::GetConversionFormat( ) const
- {
- if ( m_aSimpleConversion.IsChecked() )
- return HHC::eSimpleConversion;
- if ( m_aHangulBracketed.IsChecked() )
- return HHC::eHangulBracketed;
- if ( m_aHanjaBracketed.IsChecked() )
- return HHC::eHanjaBracketed;
- if ( m_pHanjaAbove->IsChecked() )
- return HHC::eRubyHanjaAbove;
- if ( m_pHanjaBelow->IsChecked() )
- return HHC::eRubyHanjaBelow;
- if ( m_pHangulAbove->IsChecked() )
- return HHC::eRubyHangulAbove;
- if ( m_pHangulBelow->IsChecked() )
- return HHC::eRubyHangulBelow;
-
- DBG_ERROR( "HangulHanjaConversionDialog::GetConversionFormat: no radio checked?" );
- return HHC::eSimpleConversion;
- }
-
- //-------------------------------------------------------------------------
- void HangulHanjaConversionDialog::EnableRubySupport( sal_Bool bVal )
- {
- m_pHanjaAbove->Enable( bVal );
- m_pHanjaBelow->Enable( bVal );
- m_pHangulAbove->Enable( bVal );
- m_pHangulBelow->Enable( bVal );
- }
-
-
- //=========================================================================
- //= HangulHanjaOptionsDialog
- //=========================================================================
- //-------------------------------------------------------------------------
-
- void HangulHanjaOptionsDialog::Init( void )
- {
- if( !m_xConversionDictionaryList.is() )
- {
- Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- if( xMgr.is() )
- {
- m_xConversionDictionaryList = Reference< XConversionDictionaryList >( xMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ConversionDictionaryList")) ),
- UNO_QUERY );
- }
- }
-
- m_aDictList.clear();
- m_aDictsLB.Clear();
-
- if( m_xConversionDictionaryList.is() )
- {
- Reference< XNameContainer > xNameCont = m_xConversionDictionaryList->getDictionaryContainer();
- Reference< XNameAccess > xNameAccess = Reference< XNameAccess >( xNameCont, UNO_QUERY );
- if( xNameAccess.is() )
- {
- Sequence< ::rtl::OUString > aDictNames( xNameAccess->getElementNames() );
-
- const ::rtl::OUString* pDic = aDictNames.getConstArray();
- sal_Int32 nCount = aDictNames.getLength();
-
- sal_Int32 i;
- for( i = 0 ; i < nCount ; ++i )
- {
- Any aAny( xNameAccess->getByName( pDic[ i ] ) );
- Reference< XConversionDictionary > xDic;
- if( ( aAny >>= xDic ) && xDic.is() )
- {
- if( LANGUAGE_KOREAN == SvxLocaleToLanguage( xDic->getLocale() ) )
- {
- m_aDictList.push_back( xDic );
- AddDict( xDic->getName(), xDic->isActive() );
- }
- }
- }
- }
- }
- }
-
- IMPL_LINK( HangulHanjaOptionsDialog, OkHdl, void*, EMPTYARG )
- {
- sal_uInt32 nCnt = m_aDictList.size();
- sal_uInt32 n = 0;
- sal_uInt32 nActiveDics = 0;
- Sequence< OUString > aActiveDics;
-
- aActiveDics.realloc( nCnt );
- OUString* pActActiveDic = aActiveDics.getArray();
-
- while( nCnt )
- {
- Reference< XConversionDictionary > xDict = m_aDictList[ n ];
- SvLBoxEntry* pEntry = m_aDictsLB.SvTreeListBox::GetEntry( n );
-
- DBG_ASSERT( xDict.is(), "-HangulHanjaOptionsDialog::OkHdl(): someone is evaporated..." );
- DBG_ASSERT( pEntry, "-HangulHanjaOptionsDialog::OkHdl(): no one there in list?" );
-
- bool bActive = m_aDictsLB.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED;
- xDict->setActive( bActive );
- Reference< util::XFlushable > xFlush( xDict, uno::UNO_QUERY );
- if( xFlush.is() )
- xFlush->flush();
-
- if( bActive )
- {
- pActActiveDic[ nActiveDics ] = xDict->getName();
- ++nActiveDics;
- }
-
- ++n;
- --nCnt;
- }
-
- // save configuration
- aActiveDics.realloc( nActiveDics );
- Any aTmp;
- SvtLinguConfig aLngCfg;
- aTmp <<= aActiveDics;
- aLngCfg.SetProperty( UPH_ACTIVE_CONVERSION_DICTIONARIES, aTmp );
-
- aTmp <<= bool( m_aIgnorepostCB.IsChecked() );
- aLngCfg.SetProperty( UPH_IS_IGNORE_POST_POSITIONAL_WORD, aTmp );
-
- aTmp <<= bool( m_aShowrecentlyfirstCB.IsChecked() );
- aLngCfg.SetProperty( UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST, aTmp );
-
- aTmp <<= bool( m_aAutoreplaceuniqueCB.IsChecked() );
- aLngCfg.SetProperty( UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES, aTmp );
-
- EndDialog( RET_OK );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaOptionsDialog, DictsLB_SelectHdl, void*, EMPTYARG )
- {
- bool bSel = m_aDictsLB.FirstSelected() != NULL;
-
- m_aEditPB.Enable( bSel );
- m_aDeletePB.Enable( bSel );
-
- return 0;
- }
-
- IMPL_LINK( HangulHanjaOptionsDialog, NewDictHdl, void*, EMPTYARG )
- {
- String aName;
- HangulHanjaNewDictDialog aNewDlg( this );
- aNewDlg.Execute();
- if( aNewDlg.GetName( aName ) )
- {
- if( m_xConversionDictionaryList.is() )
- {
- try
- {
- Reference< XConversionDictionary > xDic =
- m_xConversionDictionaryList->addNewDictionary( aName, SvxCreateLocale( LANGUAGE_KOREAN ), ConversionDictionaryType::HANGUL_HANJA );
-
- if( xDic.is() )
- {
- //adapt local caches:
- m_aDictList.push_back( xDic );
- AddDict( xDic->getName(), xDic->isActive() );
- }
- }
- catch( const ElementExistException& )
- {
- }
- catch( const NoSupportException& )
- {
- }
- }
- }
-
- return 0L;
- }
-
- IMPL_LINK( HangulHanjaOptionsDialog, EditDictHdl, void*, EMPTYARG )
- {
- SvLBoxEntry* pEntry = m_aDictsLB.FirstSelected();
- DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
- if( pEntry )
- {
- HangulHanjaEditDictDialog aEdDlg( this, m_aDictList, m_aDictsLB.GetSelectEntryPos() );
- aEdDlg.Execute();
- }
- return 0L;
- }
-
- IMPL_LINK( HangulHanjaOptionsDialog, DeleteDictHdl, void*, EMPTYARG )
- {
- USHORT nSelPos = m_aDictsLB.GetSelectEntryPos();
- if( nSelPos != LISTBOX_ENTRY_NOTFOUND )
- {
- Reference< XConversionDictionary > xDic( m_aDictList[ nSelPos ] );
- if( m_xConversionDictionaryList.is() && xDic.is() )
- {
- Reference< XNameContainer > xNameCont = m_xConversionDictionaryList->getDictionaryContainer();
- if( xNameCont.is() )
- {
- try
- {
- xNameCont->removeByName( xDic->getName() );
-
- //adapt local caches:
- HHDictList::iterator aIter(m_aDictList.begin());
- m_aDictList.erase(aIter+nSelPos );
- m_aDictsLB.RemoveEntry( nSelPos );
- }
- catch( const ElementExistException& )
- {
- }
- catch( const NoSupportException& )
- {
- }
- }
- }
- }
-
- return 0L;
- }
-
- HangulHanjaOptionsDialog::HangulHanjaOptionsDialog( Window* _pParent )
- :ModalDialog ( _pParent, SVX_RES( RID_SVX_MDLG_HANGULHANJA_OPT ) )
- ,m_aUserdefdictFT ( this, SVX_RES( FT_USERDEFDICT ) )
- ,m_aDictsLB ( this, SVX_RES( LB_DICTS ) )
- ,m_aOptionsFL ( this, SVX_RES( FL_OPTIONS ) )
- ,m_aIgnorepostCB ( this, SVX_RES( CB_IGNOREPOST ) )
- ,m_aShowrecentlyfirstCB ( this, SVX_RES( CB_SHOWRECENTLYFIRST ) )
- ,m_aAutoreplaceuniqueCB ( this, SVX_RES( CB_AUTOREPLACEUNIQUE ) )
- ,m_aNewPB ( this, SVX_RES( PB_HHO_NEW ) )
- ,m_aEditPB ( this, SVX_RES( PB_HHO_EDIT ) )
- ,m_aDeletePB ( this, SVX_RES( PB_HHO_DELETE ) )
- ,m_aOkPB ( this, SVX_RES( PB_HHO_OK ) )
- ,m_aCancelPB ( this, SVX_RES( PB_HHO_CANCEL ) )
- ,m_aHelpPB ( this, SVX_RES( PB_HHO_HELP ) )
-
- ,m_pCheckButtonData ( NULL )
- ,m_xConversionDictionaryList( NULL )
- {
- m_aDictsLB.SetWindowBits( WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
- m_aDictsLB.SetSelectionMode( SINGLE_SELECTION );
- m_aDictsLB.SetHighlightRange();
-// m_aDictsLB.SetHelpId( xxx );
- m_aDictsLB.SetSelectHdl( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) );
- m_aDictsLB.SetDeselectHdl( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) );
-
- m_aOkPB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, OkHdl ) );
- m_aNewPB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, NewDictHdl ) );
- m_aEditPB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, EditDictHdl ) );
- m_aDeletePB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, DeleteDictHdl ) );
-
- FreeResource();
-
- SvtLinguConfig aLngCfg;
- Any aTmp;
- bool bVal = bool();
- aTmp = aLngCfg.GetProperty( UPH_IS_IGNORE_POST_POSITIONAL_WORD );
- if( aTmp >>= bVal )
- m_aIgnorepostCB.Check( bVal );
-
- aTmp = aLngCfg.GetProperty( UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST );
- if( aTmp >>= bVal )
- m_aShowrecentlyfirstCB.Check( bVal );
-
- aTmp = aLngCfg.GetProperty( UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES );
- if( aTmp >>= bVal )
- m_aAutoreplaceuniqueCB.Check( bVal );
-
- Init();
- }
-
- HangulHanjaOptionsDialog::~HangulHanjaOptionsDialog()
- {
- SvLBoxEntry* pEntry = m_aDictsLB.First();
- String* pDel;
- while( pEntry )
- {
- pDel = ( String* ) pEntry->GetUserData();
- if( pDel )
- delete pDel;
- pEntry = m_aDictsLB.Next( pEntry );
- }
-
- if( m_pCheckButtonData )
- delete m_pCheckButtonData;
- }
-
- void HangulHanjaOptionsDialog::AddDict( const String& _rName, bool _bChecked )
- {
- SvLBoxEntry* pEntry = m_aDictsLB.SvTreeListBox::InsertEntry( _rName );
- m_aDictsLB.SetCheckButtonState( pEntry, _bChecked? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
- pEntry->SetUserData( new String( _rName ) );
- }
-
- //=========================================================================
- //= HangulHanjaNewDictDialog
- //=========================================================================
- //-------------------------------------------------------------------------
-
- IMPL_LINK( HangulHanjaNewDictDialog, OKHdl, void*, EMPTYARG )
- {
- String aName( m_aDictNameED.GetText() );
-
- aName.EraseTrailingChars();
- m_bEntered = aName.Len() > 0;
- if( m_bEntered )
- m_aDictNameED.SetText( aName ); // do this in case of trailing chars have been deleted
-
- EndDialog( RET_OK );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaNewDictDialog, ModifyHdl, void*, EMPTYARG )
- {
- String aName( m_aDictNameED.GetText() );
-
- aName.EraseTrailingChars();
- m_aOkBtn.Enable( aName.Len() > 0 );
-
- return 0;
- }
-
- HangulHanjaNewDictDialog::HangulHanjaNewDictDialog( Window* _pParent )
- :ModalDialog ( _pParent, SVX_RES( RID_SVX_MDLG_HANGULHANJA_NEWDICT ) )
- ,m_aNewDictFL ( this, SVX_RES( FL_NEWDICT ) )
- ,m_aDictNameFT ( this, SVX_RES( FT_DICTNAME ) )
- ,m_aDictNameED ( this, SVX_RES( ED_DICTNAME ) )
- ,m_aOkBtn ( this, SVX_RES( PB_NEWDICT_OK ) )
- ,m_aCancelBtn ( this, SVX_RES( PB_NEWDICT_ESC ) )
- ,m_aHelpBtn ( this, SVX_RES( PB_NEWDICT_HLP ) )
-
- ,m_bEntered ( false )
- {
- m_aOkBtn.SetClickHdl( LINK( this, HangulHanjaNewDictDialog, OKHdl ) );
-
- m_aDictNameED.SetModifyHdl( LINK( this, HangulHanjaNewDictDialog, ModifyHdl ) );
-
- FreeResource();
- }
-
- HangulHanjaNewDictDialog::~HangulHanjaNewDictDialog()
- {
- }
-
- bool HangulHanjaNewDictDialog::GetName( String& _rRetName ) const
- {
- if( m_bEntered )
- {
- _rRetName = m_aDictNameED.GetText();
- _rRetName.EraseTrailingChars();
- }
-
- return m_bEntered;
- }
-
- //=========================================================================
- //= HangulHanjaEditDictDialog
- //=========================================================================
- //-------------------------------------------------------------------------
-
- class SuggestionList
- {
- private:
- protected:
- sal_uInt16 m_nSize;
- String** m_ppElements;
- sal_uInt16 m_nNumOfEntries;
- sal_uInt16 m_nAct;
-
- const String* _Next( void );
- public:
- SuggestionList( sal_uInt16 _nNumOfElements );
- virtual ~SuggestionList();
-
- bool Set( const String& _rElement, sal_uInt16 _nNumOfElement );
- bool Reset( sal_uInt16 _nNumOfElement );
- const String* Get( sal_uInt16 _nNumOfElement ) const;
- void Clear( void );
-
- const String* First( void );
- const String* Next( void );
-
- inline sal_uInt16 GetCount( void ) const;
- };
-
- inline sal_uInt16 SuggestionList::GetCount( void ) const
- {
- return m_nNumOfEntries;
- }
-
- SuggestionList::SuggestionList( sal_uInt16 _nNumOfElements )
- {
- if( !_nNumOfElements )
- _nNumOfElements = 1;
-
- m_nSize = _nNumOfElements;
-
- m_ppElements = new String*[ m_nSize ];
- m_nAct = m_nNumOfEntries = 0;
-
- String** ppNull = m_ppElements;
- sal_uInt16 n = _nNumOfElements;
- while( n )
- {
- *ppNull = NULL;
- ++ppNull;
- --n;
- }
- }
-
- SuggestionList::~SuggestionList()
- {
- Clear();
- }
-
- bool SuggestionList::Set( const String& _rElement, sal_uInt16 _nNumOfElement )
- {
- bool bRet = _nNumOfElement < m_nSize;
- if( bRet )
- {
- String** ppElem = m_ppElements + _nNumOfElement;
- if( *ppElem )
- **ppElem = _rElement;
- else
- {
- *ppElem = new String( _rElement );
- ++m_nNumOfEntries;
- }
- }
-
- return bRet;
- }
-
- bool SuggestionList::Reset( sal_uInt16 _nNumOfElement )
- {
- bool bRet = _nNumOfElement < m_nSize;
- if( bRet )
- {
- String** ppElem = m_ppElements + _nNumOfElement;
- if( *ppElem )
- {
- delete *ppElem;
- *ppElem = NULL;
- --m_nNumOfEntries;
- }
- }
-
- return bRet;
- }
-
- const String* SuggestionList::Get( sal_uInt16 _nNumOfElement ) const
- {
- const String* pRet;
-
- if( _nNumOfElement < m_nSize )
- pRet = m_ppElements[ _nNumOfElement ];
- else
- pRet = NULL;
-
- return pRet;
- }
-
- void SuggestionList::Clear( void )
- {
- if( m_nNumOfEntries )
- {
- String** ppDel = m_ppElements;
- sal_uInt16 nCnt = m_nSize;
- while( nCnt )
- {
- if( *ppDel )
- {
- delete *ppDel;
- *ppDel = NULL;
- }
-
- ++ppDel;
- --nCnt;
- }
-
- m_nNumOfEntries = m_nAct = 0;
- }
- }
-
- const String* SuggestionList::_Next( void )
- {
- const String* pRet = NULL;
- while( m_nAct < m_nSize && !pRet )
- {
- pRet = m_ppElements[ m_nAct ];
- if( !pRet )
- ++m_nAct;
- }
-
- return pRet;
- }
-
- const String* SuggestionList::First( void )
- {
- m_nAct = 0;
- return _Next();
- }
-
- const String* SuggestionList::Next( void )
- {
- const String* pRet;
-
- if( m_nAct < m_nNumOfEntries )
- {
- ++m_nAct;
- pRet = _Next();
- }
- else
- pRet = NULL;
-
- return pRet;
- }
-
-
- bool SuggestionEdit::ShouldScroll( bool _bUp ) const
- {
- bool bRet = false;
-
- if( _bUp )
- {
- if( !m_pPrev )
- bRet = m_rScrollBar.GetThumbPos() > m_rScrollBar.GetRangeMin();
- }
- else
- {
- if( !m_pNext )
- bRet = m_rScrollBar.GetThumbPos() < ( m_rScrollBar.GetRangeMax() - 4 );
- }
-
- return bRet;
- }
-
- void SuggestionEdit::DoJump( bool _bUp )
- {
- const Link& rLoseFocusHdl = GetLoseFocusHdl();
- if( rLoseFocusHdl.IsSet() )
- rLoseFocusHdl.Call( this );
- m_rScrollBar.SetThumbPos( m_rScrollBar.GetThumbPos() + ( _bUp? -1 : 1 ) );
-
- ( static_cast< HangulHanjaEditDictDialog* >( GetParent() ) )->UpdateScrollbar();
- }
-
- SuggestionEdit::SuggestionEdit( Window* pParent, const ResId& rResId,
- ScrollBar& _rScrollBar, SuggestionEdit* _pPrev, SuggestionEdit* _pNext )
- :Edit( pParent, rResId )
- ,m_pPrev( _pPrev )
- ,m_pNext( _pNext )
- ,m_rScrollBar( _rScrollBar )
- {
- }
-
- SuggestionEdit::~SuggestionEdit()
- {
- }
-
- long SuggestionEdit::PreNotify( NotifyEvent& rNEvt )
- {
- long nHandled = 0;
- if( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- const KeyCode& rKeyCode = pKEvt->GetKeyCode();
- USHORT nMod = rKeyCode.GetModifier();
- USHORT nCode = rKeyCode.GetCode();
- if( nCode == KEY_TAB && ( !nMod || KEY_SHIFT == nMod ) )
- {
- bool bUp = KEY_SHIFT == nMod;
- if( ShouldScroll( bUp ) )
- {
- DoJump( bUp );
- SetSelection( Selection( 0, SELECTION_MAX ) );
- // Tab-travel doesn't really happen, so emulate it by setting a selection manually
- nHandled = 1;
- }
- }
- else if( KEY_UP == nCode || KEY_DOWN == nCode )
- {
- bool bUp = KEY_UP == nCode;
- if( ShouldScroll( bUp ) )
- {
- DoJump( bUp );
- nHandled = 1;
- }
- else if( bUp )
- {
- if( m_pPrev )
- {
- m_pPrev->GrabFocus();
- nHandled = 1;
- }
- }
- else if( m_pNext )
- {
- m_pNext->GrabFocus();
- nHandled = 1;
- }
- }
- }
-
- if( !nHandled )
- nHandled = Edit::PreNotify( rNEvt );
- return nHandled;
- }
-
-
- namespace
- {
- bool GetConversions( Reference< XConversionDictionary > _xDict,
- const OUString& _rOrg,
- Sequence< OUString >& _rEntries )
- {
- bool bRet = false;
- if( _xDict.is() && _rOrg.getLength() )
- {
- try
- {
- _rEntries = _xDict->getConversions( _rOrg,
- 0,
- _rOrg.getLength(),
- ConversionDirection_FROM_LEFT,
- ::com::sun::star::i18n::TextConversionOption::NONE );
- bRet = _rEntries.getLength() > 0;
- }
- catch( const IllegalArgumentException& )
- {
- }
- }
-
- return bRet;
- }
- }
-
-
- IMPL_LINK( HangulHanjaEditDictDialog, ScrollHdl, void*, EMPTYARG )
- {
- UpdateScrollbar();
-
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, OriginalModifyHdl, void*, EMPTYARG )
- {
- m_bModifiedOriginal = true;
- m_aOriginal = m_aOriginalLB.GetText();
- m_aOriginal.EraseTrailingChars();
-
- UpdateSuggestions();
- UpdateButtonStates();
-
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl1, Edit*, pEdit )
- {
- EditModify( pEdit, 0 );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl2, Edit*, pEdit )
- {
- EditModify( pEdit, 1 );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl3, Edit*, pEdit )
- {
- EditModify( pEdit, 2 );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl4, Edit*, pEdit )
- {
- EditModify( pEdit, 3 );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, BookLBSelectHdl, void*, EMPTYARG )
- {
- InitEditDictDialog( m_aBookLB.GetSelectEntryPos() );
- return 0;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, NewPBPushHdl, void*, EMPTYARG )
- {
- DBG_ASSERT( m_pSuggestions, "-HangulHanjaEditDictDialog::NewPBPushHdl(): no suggestions... search in hell..." );
- Reference< XConversionDictionary > xDict = m_rDictList[ m_nCurrentDict ];
- if( xDict.is() && m_pSuggestions )
- {
- //delete old entry
- bool bRemovedSomething = DeleteEntryFromDictionary( m_aOriginal, xDict );
-
- OUString aLeft( m_aOriginal );
- const String* pRight = m_pSuggestions->First();
- bool bAddedSomething = false;
- while( pRight )
- {
- try
- {
- //add new entry
- xDict->addEntry( aLeft, *pRight );
- bAddedSomething = true;
- }
- catch( const IllegalArgumentException& )
- {
- }
- catch( const ElementExistException& )
- {
- }
-
- pRight = m_pSuggestions->Next();
- }
-
- if(bAddedSomething||bRemovedSomething)
- InitEditDictDialog( m_nCurrentDict );
- }
- else
- {
- DBG_WARNING( "+HangulHanjaEditDictDialog::NewPBPushHdl(): dictionary faded away..." );
- }
- return 0;
- }
-
- bool HangulHanjaEditDictDialog::DeleteEntryFromDictionary( const OUString&, const Reference< XConversionDictionary >& xDict )
- {
- bool bRemovedSomething = false;
- if( xDict.is() )
- {
- OUString aOrg( m_aOriginal );
- Sequence< OUString > aEntries;
- GetConversions( xDict, m_aOriginal, aEntries );
-
- sal_uInt32 n = aEntries.getLength();
- OUString* pEntry = aEntries.getArray();
- while( n )
- {
- try
- {
- xDict->removeEntry( aOrg, *pEntry );
- bRemovedSomething = true;
- }
- catch( const NoSuchElementException& )
- { // can not be...
- }
-
- ++pEntry;
- --n;
- }
- }
- return bRemovedSomething;
- }
-
- IMPL_LINK( HangulHanjaEditDictDialog, DeletePBPushHdl, void*, EMPTYARG )
- {
- if( DeleteEntryFromDictionary( m_aOriginal, m_rDictList[ m_nCurrentDict ] ) )
- {
- m_aOriginal.Erase();
- m_bModifiedOriginal = true;
- InitEditDictDialog( m_nCurrentDict );
- }
- return 0;
- }
-
- void HangulHanjaEditDictDialog::InitEditDictDialog( sal_uInt32 _nSelDict )
- {
- if( m_pSuggestions )
- m_pSuggestions->Clear();
-
- if( m_nCurrentDict != _nSelDict )
- {
- m_nCurrentDict = _nSelDict;
- m_aOriginal.Erase();
- m_bModifiedOriginal = true;
- }
-
- UpdateOriginalLB();
-
- m_aOriginalLB.SetText( m_aOriginal.Len()? m_aOriginal : m_aEditHintText, Selection( 0, SELECTION_MAX ) );
- m_aOriginalLB.GrabFocus();
-
- UpdateSuggestions();
- UpdateButtonStates();
- }
-
- void HangulHanjaEditDictDialog::UpdateOriginalLB( void )
- {
- m_aOriginalLB.Clear();
- Reference< XConversionDictionary > xDict = m_rDictList[ m_nCurrentDict ];
- if( xDict.is() )
- {
- Sequence< OUString > aEntries = xDict->getConversionEntries( ConversionDirection_FROM_LEFT );
- sal_uInt32 n = aEntries.getLength();
- OUString* pEntry = aEntries.getArray();
- while( n )
- {
- m_aOriginalLB.InsertEntry( *pEntry );
-
- ++pEntry;
- --n;
- }
- }
- else
- {
- DBG_WARNING( "+HangulHanjaEditDictDialog::UpdateOriginalLB(): dictionary faded away..." );
- }
- }
-
- void HangulHanjaEditDictDialog::UpdateButtonStates()
- {
- bool bHaveValidOriginalString = m_aOriginal.Len() && m_aOriginal != m_aEditHintText;
- bool bNew = bHaveValidOriginalString && m_pSuggestions && m_pSuggestions->GetCount() > 0;
- bNew = bNew && (m_bModifiedSuggestions || m_bModifiedOriginal);
-
- m_aNewPB.Enable( bNew );
- m_aDeletePB.Enable( !m_bModifiedOriginal && bHaveValidOriginalString );
- }
-
- void HangulHanjaEditDictDialog::UpdateSuggestions( void )
- {
- Sequence< OUString > aEntries;
- bool bFound = GetConversions( m_rDictList[ m_nCurrentDict ], m_aOriginal, aEntries );
- if( bFound )
- {
- m_bModifiedOriginal = false;
-
- if( m_pSuggestions )
- m_pSuggestions->Clear();
-
- //fill found entries into boxes
- sal_uInt32 nCnt = aEntries.getLength();
- sal_uInt32 n = 0;
- if( nCnt )
- {
- if( !m_pSuggestions )
- m_pSuggestions = new SuggestionList( MAXNUM_SUGGESTIONS );
-
- const OUString* pSugg = aEntries.getConstArray();
- while( nCnt )
- {
- m_pSuggestions->Set( pSugg[ n ], sal_uInt16( n ) );
- ++n;
- --nCnt;
- }
- }
- m_bModifiedSuggestions=false;
- }
-
- m_aScrollSB.SetThumbPos( 0 );
- UpdateScrollbar(); // will force edits to be filled new
- }
-
- void HangulHanjaEditDictDialog::SetEditText( Edit& _rEdit, sal_uInt16 _nEntryNum )
- {
- String aStr;
- if( m_pSuggestions )
- {
- const String* p = m_pSuggestions->Get( _nEntryNum );
- if( p )
- aStr = *p;
- }
-
- _rEdit.SetText( aStr );
- }
-
- void HangulHanjaEditDictDialog::EditModify( Edit* _pEdit, sal_uInt8 _nEntryOffset )
- {
- m_bModifiedSuggestions = true;
-
- String aTxt( _pEdit->GetText() );
- sal_uInt16 nEntryNum = m_nTopPos + _nEntryOffset;
- if( aTxt.Len() == 0 )
- {
- //reset suggestion
- if( m_pSuggestions )
- m_pSuggestions->Reset( nEntryNum );
- }
- else
- {
- //set suggestion
- if( !m_pSuggestions )
- m_pSuggestions = new SuggestionList( MAXNUM_SUGGESTIONS );
- m_pSuggestions->Set( aTxt, nEntryNum );
- }
-
- UpdateButtonStates();
- }
-
- HangulHanjaEditDictDialog::HangulHanjaEditDictDialog( Window* _pParent, HHDictList& _rDictList, sal_uInt32 _nSelDict )
- :ModalDialog ( _pParent, SVX_RES( RID_SVX_MDLG_HANGULHANJA_EDIT ) )
- ,m_aEditHintText ( SVX_RES( STR_EDITHINT ) )
- ,m_rDictList ( _rDictList )
- ,m_nCurrentDict ( 0xFFFFFFFF )
- ,m_pSuggestions ( NULL )
- ,m_aBookFT ( this, SVX_RES( FT_BOOK ) )
- ,m_aBookLB ( this, SVX_RES( LB_BOOK ) )
- ,m_aOriginalFT ( this, SVX_RES( FT_ORIGINAL ) )
- ,m_aOriginalLB ( this, SVX_RES( LB_ORIGINAL ) )
- ,m_aSuggestionsFT ( this, SVX_RES( FT_SUGGESTIONS ) )
- ,m_aEdit1 ( this, SVX_RES( ED_1 ), m_aScrollSB, NULL, &m_aEdit2 )
- ,m_aEdit2 ( this, SVX_RES( ED_2 ), m_aScrollSB, &m_aEdit1, &m_aEdit3 )
- ,m_aEdit3 ( this, SVX_RES( ED_3 ), m_aScrollSB, &m_aEdit2, &m_aEdit4 )
- ,m_aEdit4 ( this, SVX_RES( ED_4 ), m_aScrollSB, &m_aEdit3, NULL )
- ,m_aScrollSB ( this, SVX_RES( SB_SCROLL ) )
- ,m_aNewPB ( this, SVX_RES( PB_HHE_NEW ) )
- ,m_aDeletePB ( this, SVX_RES( PB_HHE_DELETE ) )
- ,m_aHelpPB ( this, SVX_RES( PB_HHE_HELP ) )
- ,m_aClosePB ( this, SVX_RES( PB_HHE_CLOSE ) )
- ,m_nTopPos ( 0 )
- ,m_bModifiedSuggestions ( false )
- ,m_bModifiedOriginal ( false )
- {
- m_aOriginalLB.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, OriginalModifyHdl ) );
-
- m_aNewPB.SetClickHdl( LINK( this, HangulHanjaEditDictDialog, NewPBPushHdl ) );
- m_aNewPB.Enable( false );
-
- m_aDeletePB.SetClickHdl( LINK( this, HangulHanjaEditDictDialog, DeletePBPushHdl ) );
-
- m_aDeletePB.Enable( false );
-
- #if( MAXNUM_SUGGESTIONS <= 4 )
- #error number of suggestions should not under-run the value of 5
- #endif
-
- Link aScrLk( LINK( this, HangulHanjaEditDictDialog, ScrollHdl ) );
- m_aScrollSB.SetScrollHdl( aScrLk );
- m_aScrollSB.SetEndScrollHdl( aScrLk );
- m_aScrollSB.SetRangeMin( 0 );
- m_aScrollSB.SetRangeMax( MAXNUM_SUGGESTIONS );
- m_aScrollSB.SetPageSize( 4 ); // because we have 4 edits / page
- m_aScrollSB.SetVisibleSize( 4 );
-
- m_aEdit1.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl1 ) );
- m_aEdit2.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl2 ) );
- m_aEdit3.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl3 ) );
- m_aEdit4.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl4 ) );
-
- m_aBookLB.SetSelectHdl( LINK( this, HangulHanjaEditDictDialog, BookLBSelectHdl ) );
- sal_uInt32 nDictCnt = m_rDictList.size();
- for( sal_uInt32 n = 0 ; n < nDictCnt ; ++n )
- {
- Reference< XConversionDictionary > xDic( m_rDictList[n] );
- String aName;
- if(xDic.is())
- aName = xDic->getName();
- m_aBookLB.InsertEntry( aName );
- }
- m_aBookLB.SelectEntryPos( USHORT( _nSelDict ) );
-
- FreeResource();
-
- InitEditDictDialog( _nSelDict );
- }
-
- HangulHanjaEditDictDialog::~HangulHanjaEditDictDialog()
- {
- if( m_pSuggestions )
- delete m_pSuggestions;
- }
-
- void HangulHanjaEditDictDialog::UpdateScrollbar( void )
- {
- sal_uInt16 nPos = sal_uInt16( m_aScrollSB.GetThumbPos() );
- m_nTopPos = nPos;
-
- SetEditText( m_aEdit1, nPos++ );
- SetEditText( m_aEdit2, nPos++ );
- SetEditText( m_aEdit3, nPos++ );
- SetEditText( m_aEdit4, nPos );
- }
-
-//.............................................................................
-} // namespace svx
-//.............................................................................
diff --git a/svx/source/cui/hangulhanjadlg.hrc b/svx/source/cui/hangulhanjadlg.hrc
deleted file mode 100644
index 22e0e11aa7..0000000000
--- a/svx/source/cui/hangulhanjadlg.hrc
+++ /dev/null
@@ -1,200 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hangulhanjadlg.hrc,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SVX_HANGUL_HANJA_DLG_HRC
-#define SVX_HANGUL_HANJA_DLG_HRC
-
-#ifndef _SVT_CONTROLDIMS_HRC_
-#include <svtools/controldims.hrc>
-#endif
-
-// PushButton
-#define PB_FIND 1
-
-// Control
-#define CTL_SUGGESTIONS 1
-
-// FixedText
-#define FT_FORMAT 1
-#define FT_RESIZE_ANCHOR 2
-#define FT_CONVERSION 3
-
-// RadioButton
-#define RB_SIMPLE_CONVERSION 1
-#define RB_HANJA_HANGUL_BRACKETED 2
-#define RB_HANGUL_HANJA_BRACKETED 3
-#define RB_HANGUL_HANJA_ABOVE 4
-#define RB_HANGUL_HANJA_BELOW 5
-#define RB_HANJA_HANGUL_ABOVE 6
-#define RB_HANJA_HANGUL_BELOW 7
-
-// CheckBox
-#define CB_REPLACE_BY_CHARACTER 1
-#define CB_HANGUL_ONLY 2
-#define CB_HANJA_ONLY 3
-
-// String
-#define STR_HANGUL 1
-#define STR_HANJA 2
-
-#define FT_WORD 10
-#define FT_AKTWORD 11
-#define FT_NEWWORD 12
-#define GB_AUDIT 13
-#define BTN_IGNORE 14
-#define BTN_IGNOREALL 15
-#define BTN_CHANGE 16
-#define BTN_CHANGEALL 17
-#define FT_STATUS 18
-#define BTN_SPL_CANCEL 19
-#define BTN_SPL_HELP 20
-#define ED_NEWWORD 21
-#define FT_SUGGESTION 22
-
-
-
-// Hangul / Hanja Options Dialog
-
-#define FT_USERDEFDICT 1
-#define FL_OPTIONS 2
-#define BTN_OPTIONS 10
-
-#define LB_DICTS 1
-
-#define CB_IGNOREPOST 1
-#define CB_SHOWRECENTLYFIRST 3
-#define CB_AUTOREPLACEUNIQUE 4
-
-#define PB_HHO_NEW 1
-#define PB_HHO_EDIT 2
-#define PB_HHO_DELETE 3
-#define PB_HHO_OK 4
-#define PB_HHO_CANCEL 5
-#define PB_HHO_HELP 6
-
-// metrics
-
-#define HHO_DLGWIDTH 287
-#define HHx_DLGHIGHT 175
-#define HHO_COL_1 RSC_SP_DLG_INNERBORDER_LEFT
-#define HHO_COL_1a (HHO_COL_1+3)
-#define HHO_COL_6 (HHO_DLGWIDTH-6)
-#define HHO_COL_5 (HHO_COL_6-50)
-#define HHO_COL_4 (HHO_COL_5-12)
-#define HHO_COL_3 (HHO_COL_4-50)
-#define HHO_COL_2 (HHO_COL_3-6)
-
-#define HHO_ROW_1 RSC_SP_DLG_INNERBORDER_TOP
-#define HHO_ROW_2 (HHO_ROW_1+8+2)
-#define HHO_ROW_3 (HHO_ROW_2+14)
-#define HHO_ROW_4 (HHO_ROW_3+2)
-#define HHO_ROW_5 (HHO_ROW_4+14)
-#define HHO_ROW_6 (HHO_ROW_5+2)
-#define HHO_ROW_7 (HHO_ROW_6+14)
-#define HHO_ROW_8 (HHO_ROW_7+4)
-#define HHO_ROW_9 (HHO_ROW_8+8+4)
-#define HHO_ROW_11 (HHO_ROW_9+8+4)
-#define HHO_ROW_12 (HHO_ROW_11+8+4)
-
-#define HHO_ROW_a1 HHO_ROW_1
-#define HHO_ROW_a2 (HHO_ROW_a1+14)
-#define HHO_ROW_a3 (HHO_ROW_a2+2)
-#define HHO_ROW_a4 (HHO_ROW_a3+14)
-#define HHO_ROW_a5 (HHO_ROW_a4+4)
-#define HHO_ROW_a6 (HHO_ROW_a5+14)
-
-
-// Hangul / Hanja New Dictonary Dialog
-#define FL_NEWDICT 1
-
-#define FT_DICTNAME 1
-
-#define ED_DICTNAME 1
-
-#define PB_NEWDICT_OK 1
-#define PB_NEWDICT_ESC 2
-#define PB_NEWDICT_HLP 3
-
-
-// Hangul Hanja Edit Custom Dictionary Dialog
-#define MAXNUM_SUGGESTIONS 50
-
-#define STR_EDITHINT 1
-
-#define FT_BOOK 1
-#define FT_ORIGINAL 2
-#define FT_SUGGESTIONS 3
-
-#define LB_BOOK 1
-#define LB_ORIGINAL 2
-
-#define PB_HHE_NEW 1
-#define PB_HHE_DELETE 2
-#define PB_HHE_HELP 3
-#define PB_HHE_CLOSE 4
-
-#define SB_SCROLL 1
-
-#define ED_1 1
-#define ED_2 2
-#define ED_3 3
-#define ED_4 4
-
-// metrics
-
-#define RSC_CD_VSCRLWIDTH 8 // vertical scroll bar width
-#define HHE_DLGWIDTH HHO_DLGWIDTH
-#define HHE_COL_1 RSC_SP_DLG_INNERBORDER_LEFT
-#define HHE_COL_6 (HHE_DLGWIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define HHE_COL_5 (HHE_COL_6-RSC_CD_PUSHBUTTON_WIDTH)
-#define HHE_COL_4 (HHE_COL_5-6)
-#define HHE_COL_3_2 (HHE_COL_4-RSC_CD_VSCRLWIDTH)
-#define HHE_COL_3_1 (HHE_COL_3_2-RSC_SP_CTRL_GROUP_X)
-#define HHE_COL_3_0 (HHE_COL_3_2-RSC_CD_PUSHBUTTON_WIDTH)
-#define HHE_COL_2 (HHE_COL_1+50)
-#define HHE_COL_3 (HHE_COL_2+1)
-
-#define HHE_ROW_1 RSC_SP_DLG_INNERBORDER_TOP
-#define HHE_ROW_2 (HHE_ROW_1+2)
-#define HHE_ROW_3 (HHE_ROW_2+12)
-#define HHE_ROW_4 (HHE_ROW_3+12)
-#define HHE_ROW_5 (HHE_ROW_4+8+2)
-#define HHE_ROW_6 (HHE_ROW_5+12)
-#define HHE_ROW_7 (HHE_ROW_6+2)
-#define HHE_ROW_8 (HHE_ROW_7+2)
-#define HHE_ROW_9 (HHE_ROW_6+12)
-#define HHE_ROW_10 (HHE_ROW_8+RSC_SP_CTRL_GROUP_Y)
-#define HHE_ROW_11 (HHE_ROW_10+8+2)
-#define HHE_ROW_12 (HHE_ROW_11+4*12)
-#define HHE_ROW_14 (HHx_DLGHIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM)
-#define HHE_ROW_13 (HHE_ROW_14-RSC_CD_PUSHBUTTON_HEIGHT)
-#define HHE_ROW_a1 (HHE_ROW_5)
-#define HHE_ROW_a3 (HHE_ROW_a1+RSC_CD_PUSHBUTTON_HEIGHT+2)
-
-#endif // SVX_HANGUL_HANJA_DLG_HRC
diff --git a/svx/source/cui/hangulhanjadlg.hxx b/svx/source/cui/hangulhanjadlg.hxx
deleted file mode 100644
index 9830de4cab..0000000000
--- a/svx/source/cui/hangulhanjadlg.hxx
+++ /dev/null
@@ -1,355 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hangulhanjadlg.hxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SVX_HANGUL_HANJA_DLG_HXX
-#define SVX_HANGUL_HANJA_DLG_HXX
-
-#include <vcl/dialog.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/lstbox.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/scrbar.hxx>
-#include <svx/checklbx.hxx>
-#include <svx/hangulhanja.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include "unolingu.hxx"
-#include <com/sun/star/linguistic2/XConversionDictionaryList.hpp>
-#include <svtools/valueset.hxx>
-
-#include <vector>
-#include <memory> // for auto_ptr
-
-class SvxCommonLinguisticControl;
-//.............................................................................
-namespace svx
-{
-//.............................................................................
-
- //=========================================================================
- //= HangulHanjaConversionDialog
- //=========================================================================
-
- class SuggestionSet : public ValueSet
- {
- public:
- SuggestionSet( Window* pParent );
- virtual ~SuggestionSet();
-
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
- void ClearSet();
- };
-
- class SuggestionDisplay : public Control
- {
- public:
- SuggestionDisplay( Window* pParent, const ResId& rResId );
- virtual ~SuggestionDisplay();
-
- void DisplayListBox( bool bDisplayListBox );
-
- void SetSelectHdl( const Link& rLink );
-
- void Clear();
- void InsertEntry( const XubString& rStr );
- void SelectEntryPos( USHORT nPos );
-
- USHORT GetEntryCount() const;
-
- XubString GetEntry( USHORT nPos ) const;
- XubString GetSelectEntry() const;
-
- virtual void StateChanged( StateChangedType nStateChange );
-
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void KeyUp( const KeyEvent& rKEvt );
- virtual void Activate();
- virtual void Deactivate();
- virtual void GetFocus();
- virtual void LoseFocus();
- virtual void Command( const CommandEvent& rCEvt );
-
- DECL_LINK( SelectSuggestionHdl, Control* );
-
- void SetHelpIds();
-
- private:
- void implUpdateDisplay();
- Control& implGetCurrentControl();
-
- private:
- bool m_bDisplayListBox;//otherwise ValueSet
- SuggestionSet m_aValueSet;
- ListBox m_aListBox;
-
- Link m_aSelectLink;
- bool m_bInSelectionUpdate;
- };
-
- class HangulHanjaConversionDialog : public ModalDialog
- {
- private:
- ::std::auto_ptr< SvxCommonLinguisticControl >
- m_pPlayground; // order matters: before all other controls!
-
- PushButton m_aFind;
- SuggestionDisplay m_aSuggestions;
- FixedText m_aFormat;
- RadioButton m_aSimpleConversion;
- RadioButton m_aHangulBracketed;
- RadioButton m_aHanjaBracketed;
- ::std::auto_ptr< RadioButton > m_pHanjaAbove;
- ::std::auto_ptr< RadioButton > m_pHanjaBelow;
- ::std::auto_ptr< RadioButton > m_pHangulAbove;
- ::std::auto_ptr< RadioButton > m_pHangulBelow;
- FixedText m_aConversion;
- CheckBox m_aHangulOnly;
- CheckBox m_aHanjaOnly;
- CheckBox m_aReplaceByChar;
-
- CheckBox* m_pIgnoreNonPrimary;
- bool m_bDocumentMode;
- // are we working for a document? This is normally true, but in case
- // the user uses the "find" functionality, we switch to working
- // with what the user entered, which then does not have any relation to
- // the document anymore. Some functionality must be disabled then
-
- Link m_aOptionsChangedLink;
- Link m_aClickByCharacterLink;
-
- public:
- HangulHanjaConversionDialog(
- Window* _pParent,
- HangulHanjaConversion::ConversionDirection _ePrimaryDirection );
- ~HangulHanjaConversionDialog( );
-
- public:
- void SetOptionsChangedHdl( const Link& _rHdl );
- void SetIgnoreHdl( const Link& _rHdl );
- void SetIgnoreAllHdl( const Link& _rHdl );
- void SetChangeHdl( const Link& _rHdl );
- void SetChangeAllHdl( const Link& _rHdl );
- void SetOptionsHdl( const Link& _rHdl );
-
- void SetClickByCharacterHdl( const Link& _rHdl );
- void SetConversionFormatChangedHdl( const Link& _rHdl );
- void SetFindHdl( const Link& _rHdl );
-
- String GetCurrentString( ) const;
- void SetCurrentString(
- const String& _rNewString,
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rSuggestions,
- bool _bOriginatesFromDocument = true
- );
-
- void FocusSuggestion( );
-
- // retrieves the current suggestion
- String GetCurrentSuggestion( ) const;
-
- void SetConversionFormat( HangulHanjaConversion::ConversionFormat _eType );
- HangulHanjaConversion::ConversionFormat GetConversionFormat( ) const;
-
- void SetByCharacter( sal_Bool _bByCharacter );
- sal_Bool GetByCharacter( ) const;
-
- void SetConversionDirectionState( sal_Bool _bTryBothDirections, HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection );
-
- // should text which does not match the primary conversion direction be ignored?
- sal_Bool GetUseBothDirections( ) const;
-
- // get current conversion direction to use
- // (return argument if GetUseBothDirections is true)
- HangulHanjaConversion::ConversionDirection GetDirection( HangulHanjaConversion::ConversionDirection eDefaultDirection ) const;
-
- // enables or disbales the checkboxes for ruby formatted replacements
- void EnableRubySupport( sal_Bool bVal );
-
- private:
- DECL_LINK( OnClose, void* );
- DECL_LINK( OnOption, void* );
- DECL_LINK( OnSuggestionModified, void* );
- DECL_LINK( OnSuggestionSelected, void* );
- DECL_LINK( OnConversionDirectionClicked, CheckBox* );
- DECL_LINK( ClickByCharacterHdl, CheckBox* );
-
- // fill the suggestion list box with suggestions for the actual input
- void FillSuggestions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rSuggestions );
- };
-
-
- typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XConversionDictionary > > HHDictList;
-
- class HangulHanjaOptionsDialog : public ModalDialog
- {
- private:
- FixedText m_aUserdefdictFT;
- SvxCheckListBox m_aDictsLB;
- FixedLine m_aOptionsFL;
- CheckBox m_aIgnorepostCB;
- CheckBox m_aShowrecentlyfirstCB;
- CheckBox m_aAutoreplaceuniqueCB;
- PushButton m_aNewPB;
- PushButton m_aEditPB;
- PushButton m_aDeletePB;
- OKButton m_aOkPB;
- CancelButton m_aCancelPB;
- HelpButton m_aHelpPB;
-
- SvLBoxButtonData* m_pCheckButtonData;
-
- HHDictList m_aDictList;
- ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XConversionDictionaryList > m_xConversionDictionaryList;
-
- DECL_LINK( OkHdl, void* );
- DECL_LINK( OnNew, void* );
- DECL_LINK( OnEdit, void* );
- DECL_LINK( OnDelete, void* );
- DECL_LINK( DictsLB_SelectHdl, void* );
- DECL_LINK( NewDictHdl, void* );
- DECL_LINK( EditDictHdl, void* );
- DECL_LINK( DeleteDictHdl, void* );
-
- void Init( void ); // reads settings from core and init controls
- public:
- HangulHanjaOptionsDialog( Window* _pParent );
- virtual ~HangulHanjaOptionsDialog();
-
- void AddDict( const String& _rName, bool _bChecked );
- };
-
-
- class HangulHanjaNewDictDialog : public ModalDialog
- {
- private:
- FixedLine m_aNewDictFL;
- FixedText m_aDictNameFT;
- Edit m_aDictNameED;
- OKButton m_aOkBtn;
- CancelButton m_aCancelBtn;
- HelpButton m_aHelpBtn;
-
- bool m_bEntered;
-
- DECL_LINK( OKHdl, void* );
- DECL_LINK( ModifyHdl, void* );
- protected:
- public:
- HangulHanjaNewDictDialog( Window* _pParent );
- virtual ~HangulHanjaNewDictDialog();
-
- bool GetName( String& _rRetName ) const;
- };
-
-
- class SuggestionList;
-
- class SuggestionEdit : public Edit
- {
- private:
- SuggestionEdit* m_pPrev;
- SuggestionEdit* m_pNext;
- ScrollBar& m_rScrollBar;
-
- bool ShouldScroll( bool _bUp ) const;
- void DoJump( bool _bUp );
- public:
- SuggestionEdit( Window* pParent, const ResId& rResId,
- ScrollBar& _rScrollBar,
- SuggestionEdit* _pPrev, SuggestionEdit* _pNext );
- virtual ~SuggestionEdit();
- virtual long PreNotify( NotifyEvent& rNEvt );
- };
-
-
- class HangulHanjaEditDictDialog : public ModalDialog
- {
- private:
- const String m_aEditHintText;
- HHDictList& m_rDictList;
- sal_uInt32 m_nCurrentDict;
-
- String m_aOriginal;
- SuggestionList* m_pSuggestions;
-
- FixedText m_aBookFT;
- ListBox m_aBookLB;
- FixedText m_aOriginalFT;
- ComboBox m_aOriginalLB;
- FixedText m_aSuggestionsFT;
- SuggestionEdit m_aEdit1;
- SuggestionEdit m_aEdit2;
- SuggestionEdit m_aEdit3;
- SuggestionEdit m_aEdit4;
- ScrollBar m_aScrollSB;
- PushButton m_aNewPB;
- PushButton m_aDeletePB;
- HelpButton m_aHelpPB;
- CancelButton m_aClosePB;
-
- sal_uInt16 m_nTopPos;
- bool m_bModifiedSuggestions;
- bool m_bModifiedOriginal;
-
- DECL_LINK( OriginalModifyHdl, void* );
- DECL_LINK( ScrollHdl, void* );
- DECL_LINK( EditModifyHdl1, Edit* );
- DECL_LINK( EditModifyHdl2, Edit* );
- DECL_LINK( EditModifyHdl3, Edit* );
- DECL_LINK( EditModifyHdl4, Edit* );
-
- DECL_LINK( BookLBSelectHdl, void* );
- DECL_LINK( NewPBPushHdl, void* );
- DECL_LINK( DeletePBPushHdl, void* );
-
- void InitEditDictDialog( sal_uInt32 _nSelDict );
- void UpdateOriginalLB( void );
- void UpdateSuggestions( void );
- void UpdateButtonStates();
-
- void SetEditText( Edit& _rEdit, sal_uInt16 _nEntryNum );
- void EditModify( Edit* _pEdit, sal_uInt8 _nEntryOffset );
- void EditFocusLost( Edit* _pEdit, sal_uInt8 _nEntryOffset );
-
- bool DeleteEntryFromDictionary( const ::rtl::OUString& rEntry, const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XConversionDictionary >& xDict );
-
- public:
- HangulHanjaEditDictDialog( Window* _pParent, HHDictList& _rDictList, sal_uInt32 _nSelDict );
- ~HangulHanjaEditDictDialog();
-
- void UpdateScrollbar( void );
- };
-
-//.............................................................................
-} // namespace svx
-//.............................................................................
-
-#endif // SVX_HANGUL_HANJA_HXX
diff --git a/svx/source/cui/hangulhanjadlg.src b/svx/source/cui/hangulhanjadlg.src
deleted file mode 100644
index 0d0041b67e..0000000000
--- a/svx/source/cui/hangulhanjadlg.src
+++ /dev/null
@@ -1,431 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hangulhanjadlg.src,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#ifndef SVX_HANGUL_HANJA_DLG_HRC
-#include "hangulhanjadlg.hrc"
-#endif
-
-ModalDialog RID_SVX_MDLG_HANGULHANJA
-{
- HelpId = HID_DIALOG_HANGULHANJA;
- Size = MAP_APPFONT( 302, 175 );
- OutputSize = TRUE;
- Closeable = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE;
-
- Text [ en-US ] = "Hangul/Hanja Conversion";
-
- PushButton PB_FIND
- {
- Pos = MAP_APPFONT( 207, 23 );
- Size = MAP_APPFONT( 30, 14 );
-
- Text [ en-US ] = "~Find";
- };
-
- Control CTL_SUGGESTIONS
- {
- Pos = MAP_APPFONT( 51, 46 );
- Size = MAP_APPFONT( 186, 30 );
- TabStop = TRUE ;
- };
-
- FixedText FT_FORMAT
- {
- Pos = MAP_APPFONT( 6, 81 );
- Size = MAP_APPFONT( 42, 8 );
-
- Text [ en-US ] = "Format";
- };
-
- RadioButton RB_SIMPLE_CONVERSION
- {
- Pos = MAP_APPFONT( 51, 81 );
- Size = MAP_APPFONT( 60, 8 );
-
- Group = TRUE;
-
- Text [ en-US ] = "~Hangul/Hanja";
- };
-
- RadioButton RB_HANJA_HANGUL_BRACKETED
- {
- Pos = MAP_APPFONT( 114, 81 );
- Size = MAP_APPFONT( 60, 8 );
-
- Text [ en-US ] = "Hanja (Han~gul)";
- };
-
- RadioButton RB_HANGUL_HANJA_BRACKETED
- {
- Pos = MAP_APPFONT( 177, 81 );
- Size = MAP_APPFONT( 60, 8 );
-
- Text [ en-US ] = "Hang~ul (Hanja)";
- };
-
- RadioButton RB_HANGUL_HANJA_ABOVE
- {
- Pos = MAP_APPFONT( 51, 95 );
- Size = MAP_APPFONT( 60, 16 );
-
- // this is the _primary_ text
- Text [ en-US ] = "Hangu~l";
- };
-
- RadioButton RB_HANGUL_HANJA_BELOW
- {
- Pos = MAP_APPFONT( 114, 95 );
- Size = MAP_APPFONT( 60, 16 );
-
- // this is the _primary_ text
- Text [ en-US ] = "Hang~ul";
- };
-
- RadioButton RB_HANJA_HANGUL_ABOVE
- {
- Pos = MAP_APPFONT( 56, 114 );
- Size = MAP_APPFONT( 60, 16 );
-
- // this is the _primary_ text
- Text [ en-US ] = "Han~ja";
- };
-
- RadioButton RB_HANJA_HANGUL_BELOW
- {
- Pos = MAP_APPFONT( 114, 114 );
- Size = MAP_APPFONT( 60, 16 );
-
- // this is the _primary_ text
- Text [ en-US ] = "Ha~nja";
- };
-
- FixedText FT_CONVERSION
- {
- Pos = MAP_APPFONT( 6, 134 );
- Size = MAP_APPFONT( 42, 8 );
-
- Text [ en-US ] = "Conversion";
- };
-
- CheckBox CB_HANGUL_ONLY
- {
- Pos = MAP_APPFONT( 51, 134 );
- Size = MAP_APPFONT( 60, 8 );
-
- Text [ en-US ] = "Hangul ~only";
- };
-
- CheckBox CB_HANJA_ONLY
- {
- Pos = MAP_APPFONT( 114, 134 );
- Size = MAP_APPFONT( 55, 8 );
-
- Text [ en-US ] = "Hanja onl~y";
- };
-
- // this element is only for determining where our radio button group ends (in both directions)
- FixedText FT_RESIZE_ANCHOR
- {
- Pos = MAP_APPFONT( 241, 133 );
- };
-
- CheckBox CB_REPLACE_BY_CHARACTER
- {
- Pos = MAP_APPFONT( 241, 81 );
- Size = MAP_APPFONT( 55, 24 );
-
- WordBreak = TRUE;
-
- Text [ en-US ] = "Replace b~y character";
- };
-
- String STR_HANGUL
- {
- Text [ en-US ] = "Hangul";
- };
-
- String STR_HANJA
- {
- Text [ en-US ] = "Hanja";
- };
-};
-
-ModalDialog RID_SVX_MDLG_HANGULHANJA_OPT
-{
- OutputSize = TRUE ;
- Hide = TRUE ;
- SVLook = TRUE ;
- HelpId = HID_HANGULHANJA_OPT_DLG;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( HHO_DLGWIDTH , HHx_DLGHIGHT ) ;
- Text [ en-US ] = "Hangul/Hanja Options" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- FixedText FT_USERDEFDICT
- {
- Pos = MAP_APPFONT ( HHO_COL_1 , HHO_ROW_1 ) ;
- Size = MAP_APPFONT ( HHO_COL_2 - HHO_COL_1, 8 ) ;
- Text[ en-US ] = "User-defined dictionaries";
- };
- Control LB_DICTS
- {
- Pos = MAP_APPFONT ( HHO_COL_1 , HHO_ROW_2 ) ;
- Size = MAP_APPFONT ( HHO_COL_2 - HHO_COL_1 , HHO_ROW_7 - HHO_ROW_2 ) ;
- HelpId = HID_HANGULHANJA_OPT_DICTS_LB;
- TabStop = TRUE;
- Border = TRUE;
- };
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT ( HHO_COL_1 , HHO_ROW_8 ) ;
- Size = MAP_APPFONT ( HHO_COL_4 - HHO_COL_1, 8 ) ;
- Text[ en-US ] = "Options";
- };
- CheckBox CB_IGNOREPOST
- {
- Pos = MAP_APPFONT ( HHO_COL_1a, HHO_ROW_9 ) ;
- Size = MAP_APPFONT ( HHO_COL_6 - HHO_COL_1a , 12 ) ;
- Text[ en-US ] = "Ignore post-positional word";
- };
- CheckBox CB_SHOWRECENTLYFIRST
- {
- Pos = MAP_APPFONT ( HHO_COL_1a, HHO_ROW_11 ) ;
- Size = MAP_APPFONT ( HHO_COL_6 - HHO_COL_1a , 12 ) ;
- Text [ en-US ] = "Show recently used entries first";
- };
- CheckBox CB_AUTOREPLACEUNIQUE
- {
- Pos = MAP_APPFONT ( HHO_COL_1a, HHO_ROW_12 ) ;
- Size = MAP_APPFONT ( HHO_COL_6 - HHO_COL_1a , 12 ) ;
- Text [ en-US ] = "Replace all unique entries automatically";
- };
- PushButton PB_HHO_NEW
- {
- Pos = MAP_APPFONT ( HHO_COL_3 , HHO_ROW_2 ) ;
- Size = MAP_APPFONT ( HHO_COL_4 - HHO_COL_3 , 14 ) ;
- Text [ en-US ] = "New...";
- };
- PushButton PB_HHO_EDIT
- {
- Pos = MAP_APPFONT ( HHO_COL_3 , HHO_ROW_4 ) ;
- Size = MAP_APPFONT ( HHO_COL_4 - HHO_COL_3 , 14 ) ;
- Text [ en-US ] = "Edit...";
- };
- PushButton PB_HHO_DELETE
- {
- Pos = MAP_APPFONT ( HHO_COL_3 , HHO_ROW_6 ) ;
- Size = MAP_APPFONT ( HHO_COL_4 - HHO_COL_3 , 14 ) ;
- Text [ en-US ] = "Delete";
- };
- OKButton PB_HHO_OK
- {
- DefButton = TRUE;
- Pos = MAP_APPFONT ( HHO_COL_5 , HHO_ROW_a1 ) ;
- Size = MAP_APPFONT ( HHO_COL_6 - HHO_COL_5 , 14 ) ;
- };
- CancelButton PB_HHO_CANCEL
- {
- Pos = MAP_APPFONT ( HHO_COL_5 , HHO_ROW_a3 ) ;
- Size = MAP_APPFONT ( HHO_COL_6 - HHO_COL_5 , 14 ) ;
- };
- HelpButton PB_HHO_HELP
- {
- Pos = MAP_APPFONT ( HHO_COL_5 , HHO_ROW_a5 ) ;
- Size = MAP_APPFONT ( HHO_COL_6 - HHO_COL_5 , 14 ) ;
- };
-
-};
-
-
-ModalDialog RID_SVX_MDLG_HANGULHANJA_NEWDICT
-{
- HelpId = HID_HANGULHANJA_NEWDICT_DLG;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 213 , 66 ) ;
- Moveable = TRUE ;
-
- Text [ en-US ] = "New Dictionary" ;
-
- FixedLine FL_NEWDICT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 145 , 8 ) ;
- Text [ en-US ] = "Dictionary" ;
- };
- FixedText FT_DICTNAME
- {
- Pos = MAP_APPFONT ( 11 , 15 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "~Name" ;
- };
- Edit ED_DICTNAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 14 ) ;
- Size = MAP_APPFONT ( 90 , 12 ) ;
- MaxTextLength = 32 ;
- };
- OKButton PB_NEWDICT_OK
- {
- Pos = MAP_APPFONT ( 157 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton PB_NEWDICT_ESC
- {
- Pos = MAP_APPFONT ( 157 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton PB_NEWDICT_HLP
- {
- Pos = MAP_APPFONT ( 157 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
-
-ModalDialog RID_SVX_MDLG_HANGULHANJA_EDIT
-{
- OutputSize = TRUE ;
- Hide = TRUE ;
- SVLook = TRUE ;
- HelpId = HID_HANGULHANJA_EDIT_DLG;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( HHE_DLGWIDTH , HHx_DLGHIGHT ) ;
- Text [ en-US ] = "Edit Custom Dictionary" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- String STR_EDITHINT
- {
- Text [ en-US ] = "[Enter text here]";
- };
- FixedText FT_BOOK
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_2 ) ;
- Size = MAP_APPFONT ( HHE_COL_2 - HHE_COL_1, 8 ) ;
- Text [ en-US ] = "Book";
- };
- ListBox LB_BOOK
- {
- Pos = MAP_APPFONT ( HHE_COL_3 , HHE_ROW_1 ) ;
- Size = MAP_APPFONT ( HHE_COL_4 - HHE_COL_3 , 60 ) ;
- DropDown = TRUE;
- Border = TRUE;
- };
- FixedText FT_ORIGINAL
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_4 ) ;
- Size = MAP_APPFONT ( HHE_COL_4 - HHE_COL_1, 8 ) ;
- Text [ en-US ] = "Original";
- };
- ComboBox LB_ORIGINAL
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_5 ) ;
- Size = MAP_APPFONT ( HHE_COL_4 - HHE_COL_1 , 60 ) ;
- DropDown = TRUE;
- Border = TRUE;
- };
- FixedText FT_SUGGESTIONS
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_10 ) ;
- Size = MAP_APPFONT ( HHE_COL_4 - HHE_COL_1, 8 ) ;
- Text [ en-US ] = "Suggestions (max. 8)";
- };
- Edit ED_1
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_11 ) ;
- Size = MAP_APPFONT ( HHE_COL_3_1 - HHE_COL_1 , 12 ) ;
- Hide = False;
- Border = TRUE;
- };
- Edit ED_2
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_11 + 12 ) ;
- Size = MAP_APPFONT ( HHE_COL_3_1 - HHE_COL_1 , 12 ) ;
- Hide = False;
- Border = TRUE;
- };
- Edit ED_3
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_11 + 24 ) ;
- Size = MAP_APPFONT ( HHE_COL_3_1 - HHE_COL_1 , 12 ) ;
- Hide = False;
- Border = TRUE;
- };
- Edit ED_4
- {
- Pos = MAP_APPFONT ( HHE_COL_1 , HHE_ROW_11 + 36 ) ;
- Size = MAP_APPFONT ( HHE_COL_3_1 - HHE_COL_1 , 12 ) ;
- Hide = False;
- Border = TRUE;
- };
- ScrollBar SB_SCROLL
- {
- Pos = MAP_APPFONT ( HHE_COL_3_2 , HHE_ROW_11 ) ;
- Size = MAP_APPFONT ( RSC_CD_VSCRLWIDTH , HHE_ROW_12 - HHE_ROW_11 ) ; // height = 48
- VScroll = TRUE ;
- Drag = TRUE ;
- };
- PushButton PB_HHE_NEW
- {
- Pos = MAP_APPFONT ( HHE_COL_5 , HHE_ROW_a1 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "New";
- };
- PushButton PB_HHE_DELETE
- {
- Pos = MAP_APPFONT ( HHE_COL_5 , HHE_ROW_a3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Delete";
- };
- HelpButton PB_HHE_HELP
- {
- Pos = MAP_APPFONT ( HHE_COL_3_0 , HHE_ROW_13 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- };
- CancelButton PB_HHE_CLOSE
- {
- Pos = MAP_APPFONT ( HHE_COL_5 , HHE_ROW_13 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Close";
- };
-};
-
-
-
diff --git a/svx/source/cui/headertablistbox.hxx b/svx/source/cui/headertablistbox.hxx
deleted file mode 100755
index 7c5500fd95..0000000000
--- a/svx/source/cui/headertablistbox.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: headertablistbox.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _HEADERTABLISTBOX_HXX
-#define _HEADERTABLISTBOX_HXX
-
-#include <svtools/headbar.hxx>
-#include <svtools/svtabbx.hxx>
-
-
-class _HeaderTabListBox : public Control
-{
-private:
- SvHeaderTabListBox maListBox;
- HeaderBar maHeaderBar;
-protected:
- DECL_LINK( HeaderEndDrag_Impl, HeaderBar* );
- virtual long Notify( NotifyEvent& rNEvt );
-public:
- _HeaderTabListBox( Window* pParent, const ResId& rId );
- virtual ~_HeaderTabListBox();
-
- inline SvHeaderTabListBox& GetListBox( void );
- inline HeaderBar& GetHeaderBar( void );
-
- void ConnectElements( void );
- // should be called after all manipulations on elements are done
- // calcs real sizes depending on sizes of this
- void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 ); // same meaning as Windows::Show()
- void Enable( bool bEnable = true, bool bChild = true ); // same meaning as Windows::Enable()
-};
-
-inline SvHeaderTabListBox& _HeaderTabListBox::GetListBox( void )
-{
- return maListBox;
-}
-
-inline HeaderBar& _HeaderTabListBox::GetHeaderBar( void )
-{
- return maHeaderBar;
-}
-
-
-#endif
diff --git a/svx/source/cui/hldocntp.cxx b/svx/source/cui/hldocntp.cxx
deleted file mode 100644
index 3bd3bb6c8b..0000000000
--- a/svx/source/cui/hldocntp.cxx
+++ /dev/null
@@ -1,525 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hldocntp.cxx,v $
- * $Revision: 1.40 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "hldocntp.hxx"
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/docfac.hxx>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/uno/Exception.hpp>
-#include <unotools/localfilehelper.hxx>
-#include <tools/config.hxx>
-#include <vcl/image.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/dynamicmenuoptions.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/ucbhelper.hxx>
-
-#include "hyperdlg.hrc"
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::uno;
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-/*************************************************************************
-|*
-|* Data-struct for documenttypes in listbox
-|*
-|************************************************************************/
-
-struct DocumentTypeData
-{
- String aStrURL;
- String aStrExt;
- DocumentTypeData (String aURL, String aExt) : aStrURL(aURL), aStrExt(aExt)
- {}
-};
-
-sal_Bool SvxHyperlinkNewDocTp::ImplGetURLObject( const String& rPath, const String& rBase, INetURLObject& aURLObject ) const
-{
- sal_Bool bIsValidURL = rPath.Len() != 0;
- if ( bIsValidURL )
- {
- aURLObject.SetURL( rPath );
- if ( aURLObject.GetProtocol() == INET_PROT_NOT_VALID ) // test if the source is already a valid url
- { // if not we have to create a url from a physical file name
- bool wasAbs;
- INetURLObject base(rBase);
- base.setFinalSlash();
- aURLObject = base.smartRel2Abs(
- rPath, wasAbs, true, INetURLObject::ENCODE_ALL,
- RTL_TEXTENCODING_UTF8, true);
- }
- bIsValidURL = aURLObject.GetProtocol() != INET_PROT_NOT_VALID;
- if ( bIsValidURL )
- {
- String aBase( aURLObject.getName( INetURLObject::LAST_SEGMENT, sal_False ) );
- if ( ( aBase.Len() == 0 ) || ( aBase.GetChar( 0 ) == '.' ) )
- bIsValidURL = sal_False;
- }
- if ( bIsValidURL )
- {
- USHORT nPos = maLbDocTypes.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- aURLObject.SetExtension( ((DocumentTypeData*)maLbDocTypes.GetEntryData( nPos ))->aStrExt );
- }
-
- }
- return bIsValidURL;
-}
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( Window *pParent, const SfxItemSet& rItemSet)
-: SvxHyperlinkTabPageBase ( pParent, SVX_RES( RID_SVXPAGE_HYPERLINK_NEWDOCUMENT ), rItemSet ),
- maGrpNewDoc ( this, SVX_RES (GRP_NEWDOCUMENT) ),
- maRbtEditNow ( this, SVX_RES (RB_EDITNOW) ),
- maRbtEditLater ( this, SVX_RES (RB_EDITLATER) ),
- maFtPath ( this, SVX_RES (FT_PATH_NEWDOC) ),
- maCbbPath ( this, INET_PROT_FILE ),
- maBtCreate ( this, SVX_RES (BTN_CREATE) ),
- maFtDocTypes ( this, SVX_RES (FT_DOCUMENT_TYPES) ),
- maLbDocTypes ( this, SVX_RES (LB_DOCUMENT_TYPES) )
-{
- // Set HC bitmaps and disable display of bitmap names.
- maBtCreate.SetModeImage( Image( SVX_RES( IMG_CREATE_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maBtCreate.EnableTextDisplay (FALSE);
-
- InitStdControls();
- FreeResource();
-
- SetExchangeSupport ();
-
- maCbbPath.SetPosSizePixel ( LogicToPixel( Point( COL_2 , 25 ), MAP_APPFONT ),
- LogicToPixel( Size ( 176 - COL_DIFF, 60), MAP_APPFONT ) );
- maCbbPath.Show();
- maCbbPath.SetBaseURL(SvtPathOptions().GetWorkPath());
-// maCbbPath.SetHelpId( HID_HYPERDLG_DOC_PATH );
-
- // set defaults
- maRbtEditNow.Check();
-
- maBtCreate.SetClickHdl ( LINK ( this, SvxHyperlinkNewDocTp, ClickNewHdl_Impl ) );
-
- FillDocumentList ();
-}
-
-SvxHyperlinkNewDocTp::~SvxHyperlinkNewDocTp ()
-{
- for ( USHORT n=0; n<maLbDocTypes.GetEntryCount(); n++ )
- {
- DocumentTypeData* pTypeData = (DocumentTypeData*)
- maLbDocTypes.GetEntryData ( n );
- delete pTypeData;
- }
-}
-
-/*************************************************************************
-|*
-|* Fill the all dialog-controls except controls in groupbox "more..."
-|*
-|************************************************************************/
-
-
-void SvxHyperlinkNewDocTp::FillDlgFields ( String& /*aStrURL*/ )
-{
-}
-
-#define INTERNETSHORTCUT_ID_TAG "InternetShortcut"
-#define INTERNETSHORTCUT_TITLE_TAG "Title"
-#define INTERNETSHORTCUT_TARGET_TAG "Target"
-#define INTERNETSHORTCUT_FOLDER_TAG "Folder"
-#define INTERNETSHORTCUT_URL_TAG "URL"
-#define INTERNETSHORTCUT_ICONID_TAG "IconIndex"
-
-void SvxHyperlinkNewDocTp::ReadURLFile( const String& rFile, String& rTitle, String& rURL, sal_Int32& rIconId, BOOL* pShowAsFolder )
-{
- // Open file
- Config aCfg( rFile );
- aCfg.SetGroup( INTERNETSHORTCUT_ID_TAG );
-
- // read URL
- rURL = aCfg.ReadKey( ByteString( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_URL_TAG) ), RTL_TEXTENCODING_ASCII_US );
- SvtPathOptions aPathOpt;
- rURL = aPathOpt.SubstituteVariable( rURL );
-
- // read target
- if ( pShowAsFolder )
- {
- String aTemp( aCfg.ReadKey( ByteString( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_TARGET_TAG ) ), RTL_TEXTENCODING_ASCII_US ) );
- *pShowAsFolder = aTemp == String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_FOLDER_TAG ) );
- }
-
- // read image-ID
- String aStrIconId( aCfg.ReadKey( ByteString( RTL_CONSTASCII_STRINGPARAM( INTERNETSHORTCUT_ICONID_TAG ) ), RTL_TEXTENCODING_ASCII_US ) );
- rIconId = aStrIconId.ToInt32();
-
- // read title
- String aLangStr = aPathOpt.SubstituteVariable( DEFINE_CONST_UNICODE("$(vlang)") );
- ByteString aLang( aLangStr, RTL_TEXTENCODING_UTF8 );
- ByteString aGroup = INTERNETSHORTCUT_ID_TAG;
- ( ( aGroup += '-' ) += aLang ) += ".W";
- aCfg.SetGroup( aGroup );
- rTitle = String( aCfg.ReadKey( INTERNETSHORTCUT_TITLE_TAG ), RTL_TEXTENCODING_UTF7 );
-}
-
-void SvxHyperlinkNewDocTp::FillDocumentList ()
-{
- EnterWait();
-
- uno::Sequence< uno::Sequence< beans::PropertyValue > >
- aDynamicMenuEntries( SvtDynamicMenuOptions().GetMenu( E_NEWMENU ) );
-
- sal_uInt32 i, nCount = aDynamicMenuEntries.getLength();
- for ( i = 0; i < nCount; i++ )
- {
- uno::Sequence< beans::PropertyValue >& rDynamicMenuEntry = aDynamicMenuEntries[ i ];
-
- rtl::OUString aDocumentUrl, aTitle, aImageId, aTargetName;
-
- for ( int e = 0; e < rDynamicMenuEntry.getLength(); e++ )
- {
- if ( rDynamicMenuEntry[ e ].Name == DYNAMICMENU_PROPERTYNAME_URL )
- rDynamicMenuEntry[ e ].Value >>= aDocumentUrl;
- else if ( rDynamicMenuEntry[e].Name == DYNAMICMENU_PROPERTYNAME_TITLE )
- rDynamicMenuEntry[e].Value >>= aTitle;
- else if ( rDynamicMenuEntry[e].Name == DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER )
- rDynamicMenuEntry[e].Value >>= aImageId;
- else if ( rDynamicMenuEntry[e].Name == DYNAMICMENU_PROPERTYNAME_TARGETNAME )
- rDynamicMenuEntry[e].Value >>= aTargetName;
- }
- //#i96822# business cards, labels and database should not be inserted here
- if( aDocumentUrl.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "private:factory/swriter?slot=21051" ) ) ||
- aDocumentUrl.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "private:factory/swriter?slot=21052" )) ||
- aDocumentUrl.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "private:factory/sdatabase?Interactive" )))
- continue;
-
- // Insert into listbox
- if ( aDocumentUrl.getLength() )
- {
- if ( aDocumentUrl.equalsAscii( "private:factory/simpress?slot=6686" ) ) // SJ: #106216# do not start
- aDocumentUrl = String( RTL_CONSTASCII_USTRINGPARAM( "private:factory/simpress" ) ); // the AutoPilot for impress
-
- // insert private-url and default-extension as user-data
- const SfxFilter* pFilter = SfxFilter::GetDefaultFilterFromFactory( aDocumentUrl );
- if ( pFilter )
- {
- // insert doc-name and image
- String aTitleName( aTitle );
- aTitleName.Erase( aTitleName.Search( (sal_Unicode)'~' ), 1 );
-
- sal_Int16 nPos = maLbDocTypes.InsertEntry ( aTitleName );
- String aStrDefExt( pFilter->GetDefaultExtension () );
- DocumentTypeData *pTypeData = new DocumentTypeData ( aDocumentUrl, aStrDefExt.Copy( 2, aStrDefExt.Len() ) );
- maLbDocTypes.SetEntryData ( nPos, pTypeData );
- }
- }
- }
- maLbDocTypes.SelectEntryPos ( 0 );
-
- LeaveWait();
-}
-
-/*************************************************************************
-|*
-|* retrieve and prepare data from dialog-fields
-|*
-|************************************************************************/
-
-void SvxHyperlinkNewDocTp::GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode )
-{
- // get data from dialog-controls
- aStrURL = maCbbPath.GetText();
- INetURLObject aURL;
- if ( ImplGetURLObject( aStrURL, maCbbPath.GetBaseURL(), aURL ) )
- {
- aStrURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
- }
-
- GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode );
-}
-
-/*************************************************************************
-|*
-|* static method to create Tabpage
-|*
-|************************************************************************/
-
-IconChoicePage* SvxHyperlinkNewDocTp::Create( Window* pWindow, const SfxItemSet& rItemSet )
-{
- return( new SvxHyperlinkNewDocTp( pWindow, rItemSet ) );
-}
-
-/*************************************************************************
-|*
-|* Set initial focus
-|*
-|************************************************************************/
-
-void SvxHyperlinkNewDocTp::SetInitFocus()
-{
- maCbbPath.GrabFocus();
-}
-
-/*************************************************************************
-|*
-|* Ask page whether an insert is possible
-|*
-\************************************************************************/
-
-BOOL SvxHyperlinkNewDocTp::AskApply()
-{
- INetURLObject aINetURLObject;
- sal_Bool bRet = ImplGetURLObject( maCbbPath.GetText(), maCbbPath.GetBaseURL(), aINetURLObject );
- if ( !bRet )
- {
- WarningBox aWarning( this, WB_OK, SVX_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
- aWarning.Execute();
- }
- return bRet;
-}
-
-/*************************************************************************
-|*
-|* Any action to do after apply-button is pressed
-|*
-\************************************************************************/
-
-void SvxHyperlinkNewDocTp::DoApply ()
-{
- EnterWait();
-
- // get data from dialog-controls
- String aStrNewName = maCbbPath.GetText();
-
- if ( aStrNewName == aEmptyStr )
- aStrNewName = maStrInitURL;
-
- ///////////////////////////////////////////////////////
- // create a real URL-String
-
- INetURLObject aURL;
- if ( ImplGetURLObject( aStrNewName, maCbbPath.GetBaseURL(), aURL ) )
- {
-
- ///////////////////////////////////////////////////////
- // create Document
-
- aStrNewName = aURL.GetURLPath( INetURLObject::NO_DECODE );
- SfxViewFrame *pViewFrame = NULL;
- try
- {
- bool bCreate = true;
-
- // check if file exists, warn before we overwrite it
- {
- com::sun::star::uno::Reference < com::sun::star::task::XInteractionHandler > xHandler;
- SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, xHandler );
-
- sal_Bool bOk = pIStm && ( pIStm->GetError() == 0);
-
- if( pIStm )
- delete pIStm;
-
- if( bOk )
- {
- WarningBox aWarning( this, WB_YES_NO, SVX_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
- bCreate = aWarning.Execute() == BUTTON_YES;
- }
- }
-
- if( bCreate )
- {
- // current document
- SfxViewFrame* pCurrentDocFrame = SfxViewFrame::Current();
-
- if ( aStrNewName != aEmptyStr )
- {
- // get private-url
- USHORT nPos = maLbDocTypes.GetSelectEntryPos();
- if( nPos == LISTBOX_ENTRY_NOTFOUND )
- nPos=0;
- String aStrDocName ( ( ( DocumentTypeData* )
- maLbDocTypes.GetEntryData( nPos ) )->aStrURL );
-
- // create items
- SfxStringItem aName( SID_FILE_NAME, aStrDocName );
- SfxStringItem aReferer( SID_REFERER, UniString::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "private:user" ) ) );
- SfxStringItem aFrame( SID_TARGETNAME, UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_blank" ) ) );
- //SfxBoolItem aFrame( SID_OPEN_NEW_VIEW, TRUE );
-
- String aStrFlags ( sal_Unicode('S') );
- if ( maRbtEditLater.IsChecked() )
- {
- aStrFlags += sal_Unicode('H');
- }
- SfxStringItem aFlags (SID_OPTIONS, aStrFlags);
-
- // open url
- const SfxPoolItem* pReturn = GetDispatcher()->Execute( SID_OPENDOC,
- SFX_CALLMODE_SYNCHRON,
- &aName, &aFlags,
- &aFrame, &aReferer, 0L );
-
- // save new doc
- const SfxViewFrameItem *pItem = PTR_CAST( SfxViewFrameItem, pReturn ); // SJ: pReturn is NULL if the Hyperlink
- if ( pItem ) // creation is cancelled #106216#
- {
- pViewFrame = pItem->GetFrame();
- if (pViewFrame)
- {
- //SfxViewFrame *pViewFrame = pFrame->GetCurrentViewFrame();
- SfxStringItem aNewName( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- pViewFrame->GetDispatcher()->Execute( SID_SAVEASDOC,
- SFX_CALLMODE_SYNCHRON,
- &aNewName, 0L );
-
- }
- }
- }
-
- if ( maRbtEditNow.IsChecked() && pCurrentDocFrame )
- {
- pCurrentDocFrame->ToTop();
- }
- }
- }
- catch( uno::Exception )
- {
- }
-
- if ( pViewFrame && maRbtEditLater.IsChecked() )
- {
- SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
- pObjShell->DoClose();
- }
- }
-
- LeaveWait();
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : new
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkNewDocTp, ClickNewHdl_Impl, void *, EMPTYARG )
-{
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
- uno::Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- uno::Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), UNO_QUERY );
-
- String aStrURL;
- String aTempStrURL( maCbbPath.GetText() );
- utl::LocalFileHelper::ConvertSystemPathToURL( aTempStrURL, maCbbPath.GetBaseURL(), aStrURL );
-
- String aStrPath = aStrURL;
- BOOL bZeroPath = ( aStrPath.Len() == 0 );
- BOOL bHandleFileName = bZeroPath; // when path has length of 0, then the rest should always be handled
- // as file name, otherwise we do not yet know
-
- if( bZeroPath )
- aStrPath = SvtPathOptions().GetWorkPath();
- else if( !::utl::UCBContentHelper::IsFolder( aStrURL ) )
- bHandleFileName = TRUE;
-
- xFolderPicker->setDisplayDirectory( aStrPath );
- DisableClose( sal_True );
- sal_Int16 nResult = xFolderPicker->execute();
- DisableClose( sal_False );
- if( ExecutableDialogResults::OK == nResult )
- {
- sal_Char const sSlash[] = "/";
-
- INetURLObject aURL( aStrURL, INET_PROT_FILE );
- String aStrName;
- if( bHandleFileName )
- aStrName = bZeroPath? aTempStrURL : String(aURL.getName());
-
- maCbbPath.SetBaseURL( xFolderPicker->getDirectory() );
- String aStrTmp( xFolderPicker->getDirectory() );
-
- if( aStrTmp.GetChar( aStrTmp.Len() - 1 ) != sSlash[0] )
- aStrTmp.AppendAscii( sSlash );
-
- // append old file name
- if( bHandleFileName )
- aStrTmp += aStrName;
-
- INetURLObject aNewURL( aStrTmp );
-
- if( aStrName.Len() > 0 && aNewURL.getExtension().getLength() > 0 &&
- maLbDocTypes.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
- {
- // get private-url
- USHORT nPos = maLbDocTypes.GetSelectEntryPos();
- aNewURL.setExtension( ( ( DocumentTypeData* ) maLbDocTypes.GetEntryData( nPos ) )->aStrExt );
- }
-
- if( aNewURL.GetProtocol() == INET_PROT_FILE )
- {
- utl::LocalFileHelper::ConvertURLToSystemPath( aNewURL.GetMainURL( INetURLObject::NO_DECODE ), aStrTmp );
- }
- else
- {
- aStrTmp = aNewURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
- }
-
- maCbbPath.SetText ( aStrTmp );
- }
- return( 0L );
-}
-
diff --git a/svx/source/cui/hldocntp.hxx b/svx/source/cui/hldocntp.hxx
deleted file mode 100644
index e005e58192..0000000000
--- a/svx/source/cui/hldocntp.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hldocntp.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABPAGE_DOCNEW_HYPERLINK_HXX
-#define _SVX_TABPAGE_DOCNEW_HYPERLINK_HXX
-
-#include "hltpbase.hxx"
-
-/*************************************************************************
-|*
-|* Tabpage : Hyperlink - New Document
-|*
-\************************************************************************/
-
-class SvxHyperlinkNewDocTp : public SvxHyperlinkTabPageBase
-{
-private:
- FixedLine maGrpNewDoc;
- RadioButton maRbtEditNow;
- RadioButton maRbtEditLater;
- FixedText maFtPath;
- SvxHyperURLBox maCbbPath;
- ImageButton maBtCreate;
- FixedText maFtDocTypes;
- ListBox maLbDocTypes;
-
- sal_Bool ImplGetURLObject( const String& rPath, const String& rBase, INetURLObject& aURLObject ) const;
- void FillDocumentList ();
-
- DECL_LINK (ClickNewHdl_Impl , void * ); // Button : New
-
- Image GetImage( USHORT nId );
- void ReadURLFile( const String& rFile, String& rTitle, String& rURL, sal_Int32& rIconId, BOOL* pShowAsFolder);//, String* pFrame, String* pOpenAs, String* pDefTempl, String* pDefURL );
- //String ReadURL_Impl( Config& rURLFile, const DirEntry& rFile );
-
-protected:
- void FillDlgFields ( String& aStrURL );
- void GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode );
-
-public:
- SvxHyperlinkNewDocTp ( Window *pParent, const SfxItemSet& rItemSet);
- ~SvxHyperlinkNewDocTp ();
-
- static IconChoicePage* Create( Window* pWindow, const SfxItemSet& rItemSet );
-
- virtual BOOL AskApply ();
- virtual void DoApply ();
-
- virtual void SetInitFocus();
-};
-
-
-#endif // _SVX_TABPAGE_DOCNEW_HYPERLINK_HXX
diff --git a/svx/source/cui/hldoctp.cxx b/svx/source/cui/hldoctp.cxx
deleted file mode 100644
index 2abec10a01..0000000000
--- a/svx/source/cui/hldoctp.cxx
+++ /dev/null
@@ -1,387 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hldoctp.cxx,v $
- * $Revision: 1.28 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include "cuihyperdlg.hxx"
-#include <unotools/localfilehelper.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-#include "hldoctp.hxx"
-#include "hyperdlg.hrc"
-#include "hlmarkwn_def.hxx" //ADD CHINA001
-
-sal_Char __READONLY_DATA sHash[] = "#";
-sal_Char __READONLY_DATA sFileScheme[] = INET_FILE_SCHEME;
-sal_Char __READONLY_DATA sPortalFileScheme[] = "vnd.sun.star.wfs://";
-sal_Char __READONLY_DATA sNewsSRVScheme[] = "news://";
- // TODO news:// is nonsense
-sal_Char __READONLY_DATA sHTTPScheme[] = INET_HTTP_SCHEME;
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHyperlinkDocTp::SvxHyperlinkDocTp ( Window *pParent, const SfxItemSet& rItemSet)
- : SvxHyperlinkTabPageBase ( pParent, SVX_RES( RID_SVXPAGE_HYPERLINK_DOCUMENT ), rItemSet ),
- maGrpDocument ( this, SVX_RES (GRP_DOCUMENT) ),
- maFtPath ( this, SVX_RES (FT_PATH_DOC) ),
- maCbbPath ( this, INET_PROT_FILE ),
- maBtFileopen ( this, SVX_RES (BTN_FILEOPEN) ),
- maGrpTarget ( this, SVX_RES (GRP_TARGET) ),
- maFtTarget ( this, SVX_RES (FT_TARGET_DOC) ),
- maEdTarget ( this, SVX_RES (ED_TARGET_DOC) ),
- maFtURL ( this, SVX_RES (FT_URL) ),
- maFtFullURL ( this, SVX_RES (FT_FULL_URL) ),
- maBtBrowse ( this, SVX_RES (BTN_BROWSE) ),
- mbMarkWndOpen ( FALSE )
-{
- // Set HC bitmaps and disable display of bitmap names.
- maBtBrowse.SetModeImage( Image( SVX_RES( IMG_BROWSE_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maBtBrowse.EnableTextDisplay (FALSE);
- maBtFileopen.SetModeImage( Image( SVX_RES( IMG_FILEOPEN_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maBtFileopen.EnableTextDisplay (FALSE);
-
- InitStdControls();
- FreeResource();
-
- // Init URL-Box (pos&size, Open-Handler)
- maCbbPath.SetPosSizePixel ( LogicToPixel( Point( COL_2, 15 ), MAP_APPFONT ),
- LogicToPixel( Size ( 176 - COL_DIFF, 60), MAP_APPFONT ) );
- maCbbPath.Show();
- String aFileScheme( INET_FILE_SCHEME, RTL_TEXTENCODING_ASCII_US );
- maCbbPath.SetBaseURL(aFileScheme);
- maCbbPath.SetHelpId( HID_HYPERDLG_DOC_PATH );
-
- SetExchangeSupport ();
-
- // overload handlers
- maBtFileopen.SetClickHdl ( LINK ( this, SvxHyperlinkDocTp, ClickFileopenHdl_Impl ) );
- maBtBrowse.SetClickHdl ( LINK ( this, SvxHyperlinkDocTp, ClickTargetHdl_Impl ) );
- maCbbPath.SetModifyHdl ( LINK ( this, SvxHyperlinkDocTp, ModifiedPathHdl_Impl ) );
- maEdTarget.SetModifyHdl ( LINK ( this, SvxHyperlinkDocTp, ModifiedTargetHdl_Impl ) );
-
- maCbbPath.SetLoseFocusHdl( LINK ( this, SvxHyperlinkDocTp, LostFocusPathHdl_Impl ) );
-
- maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkDocTp, TimeoutHdl_Impl ) );
-}
-
-SvxHyperlinkDocTp::~SvxHyperlinkDocTp ()
-{
-}
-
-/*************************************************************************
-|*
-|* Fill all dialog-controls except controls in groupbox "more..."
-|*
-|************************************************************************/
-
-void SvxHyperlinkDocTp::FillDlgFields ( String& aStrURL )
-{
- INetURLObject aURL ( aStrURL );
-
- String aStrMark;
- xub_StrLen nPos = aStrURL.SearchAscii( sHash );
- // path
- maCbbPath.SetText ( aStrURL.Copy( 0, ( nPos == STRING_NOTFOUND ? aStrURL.Len() : nPos ) ) );
-
- // set target in document at editfield
- if ( nPos != STRING_NOTFOUND && nPos<aStrURL.Len()-1 )
- aStrMark = aStrURL.Copy( nPos+1, aStrURL.Len() );
- maEdTarget.SetText ( aStrMark );
-
- ModifiedPathHdl_Impl ( NULL );
-}
-
-/*************************************************************************
-|*
-|* retrieve current url-string
-|*
-|************************************************************************/
-
-String SvxHyperlinkDocTp::GetCurrentURL ()
-{
- // get data from dialog-controls
- String aStrURL;
- String aStrPath ( maCbbPath.GetText() );
- const String aBaseURL ( maCbbPath.GetBaseURL() );
- String aStrMark( maEdTarget.GetText() );
-
- if ( aStrPath != aEmptyStr )
- {
- INetURLObject aURL( aStrPath );
- if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) // maybe the path is already a valid
- aStrURL = aStrPath; // hyperlink, then we can use this path directly
- else
- utl::LocalFileHelper::ConvertSystemPathToURL( aStrPath, aBaseURL, aStrURL );
-
- //#105788# always create a URL even if it is not valid
- if( aStrURL == aEmptyStr )
- aStrURL = aStrPath;
- }
-
- if( aStrMark != aEmptyStr )
- {
- aStrURL.AppendAscii( sHash );
- aStrURL += aStrMark;
- }
-
- return aStrURL;
-}
-
-/*************************************************************************
-|*
-|* retrieve and prepare data from dialog-fields
-|*
-|************************************************************************/
-
-void SvxHyperlinkDocTp::GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode )
-{
- // get data from standard-fields
- aStrURL = GetCurrentURL();
-
- if( aStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ||
- aStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) )
- aStrURL=aEmptyStr;
-
- GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode );
-}
-
-/*************************************************************************
-|*
-|* static method to create Tabpage
-|*
-|************************************************************************/
-
-IconChoicePage* SvxHyperlinkDocTp::Create( Window* pWindow, const SfxItemSet& rItemSet )
-{
- return( new SvxHyperlinkDocTp( pWindow, rItemSet ) );
-}
-
-/*************************************************************************
-|*
-|* Set initial focus
-|*
-|************************************************************************/
-
-void SvxHyperlinkDocTp::SetInitFocus()
-{
- maCbbPath.GrabFocus();
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : fileopen
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkDocTp, ClickFileopenHdl_Impl, void *, EMPTYARG )
-{
- // Open Fileopen-Dialog
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0,
- GetParent() );
- String aOldURL( GetCurrentURL() );
- if( aOldURL.EqualsIgnoreCaseAscii( sFileScheme, 0, sizeof( sFileScheme ) - 1 ) ||
- aOldURL.EqualsIgnoreCaseAscii( sPortalFileScheme, 0, sizeof( sFileScheme ) - 1 ) )
- {
- aDlg.SetDisplayDirectory( aOldURL );
- }
-
- DisableClose( sal_True );
- ErrCode nError = aDlg.Execute();
- DisableClose( sal_False );
-
- if ( ERRCODE_NONE == nError )
- {
- String aURL( aDlg.GetPath() );
- String aPath;
-
- utl::LocalFileHelper::ConvertURLToSystemPath( aURL, aPath );
-
- maCbbPath.SetBaseURL( aURL );
- maCbbPath.SetText( aPath );
-
- if ( aOldURL != GetCurrentURL() )
- ModifiedPathHdl_Impl (NULL);
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : target
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkDocTp, ClickTargetHdl_Impl, void *, EMPTYARG )
-{
- if ( GetPathType ( maStrURL ) == Type_ExistsFile ||
- maStrURL == aEmptyStr ||
- maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ||
- maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ||
- maStrURL.SearchAscii( sHash ) == 0 )
- {
- mpMarkWnd->SetError( LERR_NOERROR );
-
- EnterWait();
-
- if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ||
- maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) )
- mpMarkWnd->RefreshTree ( aEmptyStr );
- else
- mpMarkWnd->RefreshTree ( maStrURL );
-
- LeaveWait();
- }
- else
- mpMarkWnd->SetError( LERR_DOCNOTOPEN );
-
- ShowMarkWnd ();
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Contens of combobox "Path" modified
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkDocTp, ModifiedPathHdl_Impl, void *, EMPTYARG )
-{
- maStrURL = GetCurrentURL();
-
- maTimer.SetTimeout( 2500 );
- maTimer.Start();
-
- maFtFullURL.SetText( maStrURL );
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* If path-field was modify, to browse the new doc after timeout
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkDocTp, TimeoutHdl_Impl, Timer *, EMPTYARG )
-{
- if ( IsMarkWndVisible() && ( GetPathType( maStrURL )==Type_ExistsFile ||
- maStrURL == aEmptyStr ||
- maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) )
- {
- EnterWait();
-
- if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ||
- maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) )
- mpMarkWnd->RefreshTree ( aEmptyStr );
- else
- mpMarkWnd->RefreshTree ( maStrURL );
-
- LeaveWait();
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Contens of editfield "Target" modified
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkDocTp, ModifiedTargetHdl_Impl, void *, EMPTYARG )
-{
- maStrURL = GetCurrentURL();
-
- if ( IsMarkWndVisible() )
- mpMarkWnd->SelectEntry ( maEdTarget.GetText() );
-
- maFtFullURL.SetText( maStrURL );
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* editfield "Target" lost focus
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkDocTp, LostFocusPathHdl_Impl, void *, EMPTYARG )
-{
- maStrURL = GetCurrentURL();
-
- maFtFullURL.SetText( maStrURL );
-
- return (0L);
-}
-
-/*************************************************************************
-|*
-|* Get String from Bookmark-Wnd
-|*
-|************************************************************************/
-
-void SvxHyperlinkDocTp::SetMarkStr ( String& aStrMark )
-{
- maEdTarget.SetText ( aStrMark );
-
- ModifiedTargetHdl_Impl ( NULL );
-}
-
-/*************************************************************************
-|*
-|* retrieve kind of pathstr
-|*
-|************************************************************************/
-
-SvxHyperlinkDocTp::EPathType SvxHyperlinkDocTp::GetPathType ( String& aStrPath )
-{
- INetURLObject aURL( aStrPath, INET_PROT_FILE );
-
- if( aURL.HasError() )
- return Type_Invalid;
- else
- return Type_ExistsFile;
-}
diff --git a/svx/source/cui/hldoctp.hxx b/svx/source/cui/hldoctp.hxx
deleted file mode 100644
index 9f2ee7171c..0000000000
--- a/svx/source/cui/hldoctp.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hldoctp.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABPAGE_DOC_HYPERLINK_HXX
-#define _SVX_TABPAGE_DOC_HYPERLINK_HXX
-
-#include "hltpbase.hxx"
-
-/*************************************************************************
-|*
-|* Tabpage : Hyperlink - Document
-|*
-\************************************************************************/
-
-class SvxHyperlinkDocTp : public SvxHyperlinkTabPageBase
-{
-private:
- FixedLine maGrpDocument;
- FixedText maFtPath;
- SvxHyperURLBox maCbbPath;
- ImageButton maBtFileopen;
-
- FixedLine maGrpTarget;
- FixedText maFtTarget;
- Edit maEdTarget;
- FixedText maFtURL;
- FixedText maFtFullURL;
- ImageButton maBtBrowse;
-
- String maStrURL;
-
- BOOL mbMarkWndOpen;
-
- DECL_LINK (ClickFileopenHdl_Impl , void * ); // Button : Fileopen
- DECL_LINK (ClickTargetHdl_Impl , void * ); // Button : Target
-
- DECL_LINK (ModifiedPathHdl_Impl , void * ); // Contens of combobox "Path" modified
- DECL_LINK (ModifiedTargetHdl_Impl, void * ); // Contens of editfield "Target" modified
-
- DECL_LINK (LostFocusPathHdl_Impl, void * ); // Combobox "path" lost its focus
-
- DECL_LINK (TimeoutHdl_Impl , Timer * ); // Handler for timer -timeout
-
- enum EPathType { Type_Unknown, Type_Invalid,
- Type_ExistsFile, Type_File,
- Type_ExistsDir, Type_Dir };
- EPathType GetPathType ( String& aStrPath );
-
-protected:
- void FillDlgFields ( String& aStrURL );
- void GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode );
- virtual BOOL ShouldOpenMarkWnd () {return mbMarkWndOpen;}
- virtual void SetMarkWndShouldOpen (BOOL bOpen) {mbMarkWndOpen=bOpen;}
- String GetCurrentURL ();
-
-public:
- SvxHyperlinkDocTp ( Window *pParent, const SfxItemSet& rItemSet);
- ~SvxHyperlinkDocTp ();
-
- static IconChoicePage* Create( Window* pWindow, const SfxItemSet& rItemSet );
-
- virtual void SetMarkStr ( String& aStrMark );
-
- virtual void SetInitFocus();
-};
-
-
-#endif // _SVX_TABPAGE_DOC_HYPERLINK_HXX
diff --git a/svx/source/cui/hlinettp.cxx b/svx/source/cui/hlinettp.cxx
deleted file mode 100644
index 177affd720..0000000000
--- a/svx/source/cui/hlinettp.cxx
+++ /dev/null
@@ -1,550 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlinettp.cxx,v $
- * $Revision: 1.30 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <svtools/adrparse.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/useroptions.hxx>
-
-#include "hlinettp.hxx"
-#include "hyperdlg.hrc"
-#include "hlmarkwn_def.hxx" //ADD CHINA001
-
-#define STD_DOC_SUBPATH "internal"
-#define STD_DOC_NAME "url_transfer.htm"
-
-sal_Char __READONLY_DATA sAnonymous[] = "anonymous";
-sal_Char __READONLY_DATA sHTTPScheme[] = INET_HTTP_SCHEME;
-sal_Char __READONLY_DATA sHTTPSScheme[] = INET_HTTPS_SCHEME;
-sal_Char __READONLY_DATA sFTPScheme[] = INET_FTP_SCHEME;
-sal_Char __READONLY_DATA sTelnetScheme[] = INET_TELNET_SCHEME;
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( Window *pParent,
- const SfxItemSet& rItemSet)
-: SvxHyperlinkTabPageBase ( pParent, SVX_RES( RID_SVXPAGE_HYPERLINK_INTERNET ),
- rItemSet ) ,
- maGrpLinkTyp ( this, SVX_RES (GRP_LINKTYPE) ),
- maRbtLinktypInternet ( this, SVX_RES (RB_LINKTYP_INTERNET) ),
- maRbtLinktypFTP ( this, SVX_RES (RB_LINKTYP_FTP) ),
- maRbtLinktypTelnet ( this, SVX_RES (RB_LINKTYP_TELNET) ),
- maFtTarget ( this, SVX_RES (FT_TARGET_HTML) ),
- maCbbTarget ( this, INET_PROT_HTTP ),
- maFtLogin ( this, SVX_RES (FT_LOGIN) ),
- maEdLogin ( this, SVX_RES (ED_LOGIN) ),
- maFtPassword ( this, SVX_RES (FT_PASSWD) ),
- maEdPassword ( this, SVX_RES (ED_PASSWD) ),
- maCbAnonymous ( this, SVX_RES (CBX_ANONYMOUS) ),
- maBtBrowse ( this, SVX_RES (BTN_BROWSE) ),
- maBtTarget ( this, SVX_RES (BTN_TARGET) ),
- mbMarkWndOpen ( FALSE )
-{
- // Set HC bitmaps and display display of bitmap names.
- maBtBrowse.SetModeImage( Image( SVX_RES( IMG_BROWSE_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maBtBrowse.EnableTextDisplay (FALSE);
- maBtTarget.SetModeImage( Image( SVX_RES( IMG_TARGET_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maBtTarget.EnableTextDisplay (FALSE);
-
- InitStdControls();
- FreeResource();
-
- // Init URL-Box (pos&size, Open-Handler)
- maCbbTarget.SetPosSizePixel ( LogicToPixel( Point( COL_2, 25 ), MAP_APPFONT ),
- LogicToPixel( Size ( 176 - COL_DIFF, 60), MAP_APPFONT ) );
- maCbbTarget.Show();
- maCbbTarget.SetHelpId( HID_HYPERDLG_INET_PATH );
-
- // Find Path to Std-Doc
- String aStrBasePaths( SvtPathOptions().GetTemplatePath() );
- for( xub_StrLen n = 0; n < aStrBasePaths.GetTokenCount(); n++ )
- {
- INetURLObject aURL( aStrBasePaths.GetToken( n ) );
- aURL.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( STD_DOC_SUBPATH ) ) );
- aURL.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( STD_DOC_NAME ) ) );
- if ( FileExists( aURL ) )
- {
- maStrStdDocURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
- break;
- }
- }
- SetExchangeSupport ();
-
- ///////////////////////////////////////
- // set defaults
- maRbtLinktypInternet.Check ();
- maFtLogin.Show( FALSE );
- maFtPassword.Show( FALSE );
- maEdLogin.Show( FALSE );
- maEdPassword.Show( FALSE );
- maCbAnonymous.Show( FALSE );
- maBtTarget.Enable( FALSE );
- maBtBrowse.Enable( maStrStdDocURL != aEmptyStr );
-
- ///////////////////////////////////////
- // overload handlers
- Link aLink( LINK ( this, SvxHyperlinkInternetTp, Click_SmartProtocol_Impl ) );
- maRbtLinktypInternet.SetClickHdl( aLink );
- maRbtLinktypFTP.SetClickHdl ( aLink );
- maRbtLinktypTelnet.SetClickHdl ( aLink );
- maCbAnonymous.SetClickHdl ( LINK ( this, SvxHyperlinkInternetTp, ClickAnonymousHdl_Impl ) );
- maBtBrowse.SetClickHdl ( LINK ( this, SvxHyperlinkInternetTp, ClickBrowseHdl_Impl ) );
- maBtTarget.SetClickHdl ( LINK ( this, SvxHyperlinkInternetTp, ClickTargetHdl_Impl ) );
- maEdLogin.SetModifyHdl ( LINK ( this, SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl ) );
- maCbbTarget.SetLoseFocusHdl ( LINK ( this, SvxHyperlinkInternetTp, LostFocusTargetHdl_Impl ) );
- maCbbTarget.SetModifyHdl ( LINK ( this, SvxHyperlinkInternetTp, ModifiedTargetHdl_Impl ) );
- maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkInternetTp, TimeoutHdl_Impl ) );
-}
-
-SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp ()
-{
-}
-
-/*************************************************************************
-|*
-|* Fill the all dialog-controls except controls in groupbox "more..."
-|*
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::FillDlgFields ( String& aStrURL )
-{
- INetURLObject aURL( aStrURL );
- String aStrScheme = GetSchemeFromURL( aStrURL );
-
- // set additional controls for FTP: Username / Password
- if ( aStrScheme.SearchAscii( sFTPScheme ) == 0 )
- {
- if ( String(aURL.GetUser()).ToLowerAscii().SearchAscii ( sAnonymous ) == 0 )
- setAnonymousFTPUser();
- else
- setFTPUser(aURL.GetUser(), aURL.GetPass());
-
- //do not show password and user in url
- if(aURL.GetUser().getLength()!=0 || aURL.GetPass().getLength()!=0 )
- aURL.SetUserAndPass(aEmptyStr,aEmptyStr);
- }
-
- // set URL-field
- // Show the scheme, #72740
- if ( aURL.GetProtocol() != INET_PROT_NOT_VALID )
- maCbbTarget.SetText( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
- else
- maCbbTarget.SetText( aStrURL ); // #77696#
-
- SetScheme( aStrScheme );
-}
-
-void SvxHyperlinkInternetTp::setAnonymousFTPUser()
-{
- maEdLogin.SetText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM ( sAnonymous ) ) );
- SvAddressParser aAddress( SvtUserOptions().GetEmail() );
- maEdPassword.SetText( aAddress.Count() ? aAddress.GetEmailAddress(0) : String() );
-
- maFtLogin.Disable ();
- maFtPassword.Disable ();
- maEdLogin.Disable ();
- maEdPassword.Disable ();
- maCbAnonymous.Check();
-}
-
-void SvxHyperlinkInternetTp::setFTPUser(const String& rUser, const String& rPassword)
-{
- maEdLogin.SetText ( rUser );
- maEdPassword.SetText ( rPassword );
-
- maFtLogin.Enable ();
- maFtPassword.Enable ();
- maEdLogin.Enable ();
- maEdPassword.Enable ();
- maCbAnonymous.Check(FALSE);
-}
-
-/*************************************************************************
-|*
-|* retrieve and prepare data from dialog-fields
-|*
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode )
-{
- aStrURL = CreateAbsoluteURL();
- GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode );
-}
-
-String SvxHyperlinkInternetTp::CreateAbsoluteURL() const
-{
- String aStrURL = maCbbTarget.GetText();
- String aScheme = GetSchemeFromURL(aStrURL);
-
- INetURLObject aURL(aStrURL);
-
- if( aURL.GetProtocol() == INET_PROT_NOT_VALID )
- {
- aURL.SetSmartProtocol( GetSmartProtocolFromButtons() );
- aURL.SetSmartURL(aStrURL);
- }
-
- // username and password for ftp-url
- if( aURL.GetProtocol() == INET_PROT_FTP && maEdLogin.GetText().Len()!=0 )
- aURL.SetUserAndPass ( maEdLogin.GetText(), maEdPassword.GetText() );
-
- if ( aURL.GetProtocol() != INET_PROT_NOT_VALID )
- return aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
- else //#105788# always create a URL even if it is not valid
- return aStrURL;
-}
-
-/*************************************************************************
-|*
-|* static method to create Tabpage
-|*
-|************************************************************************/
-
-IconChoicePage* SvxHyperlinkInternetTp::Create( Window* pWindow, const SfxItemSet& rItemSet )
-{
- return( new SvxHyperlinkInternetTp( pWindow, rItemSet ) );
-}
-
-/*************************************************************************
-|*
-|* Set initial focus
-|*
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::SetInitFocus()
-{
- maCbbTarget.GrabFocus();
-}
-
-/*************************************************************************
-|*
-|* Contens of editfield "Taregt" modified
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, ModifiedTargetHdl_Impl, void *, EMPTYARG )
-{
- String aScheme = GetSchemeFromURL( maCbbTarget.GetText() );
- if(aScheme.Len()!=0)
- SetScheme( aScheme );
-
- // start timer
- maTimer.SetTimeout( 2500 );
- maTimer.Start();
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* If target-field was modify, to browse the new doc afeter timeout
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, TimeoutHdl_Impl, Timer *, EMPTYARG )
-{
- RefreshMarkWindow();
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Contens of editfield "Login" modified
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl, void *, EMPTYARG )
-{
- String aStrLogin ( maEdLogin.GetText() );
- if ( aStrLogin.EqualsIgnoreCaseAscii( sAnonymous ) )
- {
- maCbAnonymous.Check();
- ClickAnonymousHdl_Impl(NULL);
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::SetScheme( const String& aScheme )
-{
- //if aScheme is empty or unknown the default beaviour is like it where HTTP
-
- BOOL bFTP = aScheme.SearchAscii( sFTPScheme ) == 0;
- BOOL bTelnet = FALSE;
- if( !bFTP )
- bTelnet = aScheme.SearchAscii( sTelnetScheme ) == 0;
- BOOL bInternet = !(bFTP || bTelnet);
-
- //update protocol button selection:
- maRbtLinktypFTP.Check(bFTP);
- maRbtLinktypTelnet.Check(bTelnet);
- maRbtLinktypInternet.Check(bInternet);
-
- //update target:
- RemoveImproperProtocol(aScheme);
- maCbbTarget.SetSmartProtocol( GetSmartProtocolFromButtons() );
-
- //show/hide special fields for FTP:
- maFtLogin.Show( bFTP );
- maFtPassword.Show( bFTP );
- maEdLogin.Show( bFTP );
- maEdPassword.Show( bFTP );
- maCbAnonymous.Show( bFTP );
-
- //update 'link target in document'-window and opening-button
- if( aScheme.SearchAscii( sHTTPScheme ) == 0 || aScheme.Len() == 0 )
- {
- maBtTarget.Enable();
- if ( mbMarkWndOpen )
- ShowMarkWnd ();
- }
- else
- {
- //disable for https, ftp and telnet
- maBtTarget.Disable();
- if ( mbMarkWndOpen )
- HideMarkWnd ();
- }
-}
-
-/*************************************************************************
-|*
-|* Remove protocol if it does not fit to the current button selection
-|*
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::RemoveImproperProtocol(const String& aProperScheme)
-{
- String aStrURL ( maCbbTarget.GetText() );
- if ( aStrURL != aEmptyStr )
- {
- String aStrScheme = GetSchemeFromURL( aStrURL );
- if ( aStrScheme != aEmptyStr && aStrScheme != aProperScheme )
- {
- aStrURL.Erase ( 0, aStrScheme.Len() );
- maCbbTarget.SetText ( aStrURL );
- }
- }
-}
-
-String SvxHyperlinkInternetTp::GetSchemeFromButtons() const
-{
- if( maRbtLinktypFTP.IsChecked() )
- {
- return String::CreateFromAscii( INET_FTP_SCHEME );
- }
- else if( maRbtLinktypTelnet.IsChecked() )
- {
- return String::CreateFromAscii( INET_TELNET_SCHEME );
- }
- return String::CreateFromAscii( INET_HTTP_SCHEME );
-}
-
-INetProtocol SvxHyperlinkInternetTp::GetSmartProtocolFromButtons() const
-{
- if( maRbtLinktypFTP.IsChecked() )
- {
- return INET_PROT_FTP;
- }
- else if( maRbtLinktypTelnet.IsChecked() )
- {
- return INET_PROT_TELNET;
- }
- return INET_PROT_HTTP;
-}
-
-/*************************************************************************
-|*
-|* Click on Radiobutton : Internet, FTP or Telnet
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, Click_SmartProtocol_Impl, void*, EMPTYARG )
-{
- String aScheme = GetSchemeFromButtons();
- SetScheme( aScheme );
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Click on Checkbox : Anonymous user
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, ClickAnonymousHdl_Impl, void *, EMPTYARG )
-{
- // disable login-editfields if checked
- if ( maCbAnonymous.IsChecked() )
- {
- if ( maEdLogin.GetText().ToLowerAscii().SearchAscii ( sAnonymous ) == 0 )
- {
- maStrOldUser = aEmptyStr;
- maStrOldPassword = aEmptyStr;
- }
- else
- {
- maStrOldUser = maEdLogin.GetText();
- maStrOldPassword = maEdPassword.GetText();
- }
-
- setAnonymousFTPUser();
- }
- else
- setFTPUser(maStrOldUser, maStrOldPassword);
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Combobox Target lost the focus
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, LostFocusTargetHdl_Impl, void *, EMPTYARG )
-{
- RefreshMarkWindow();
- return (0L);
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : Browse
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, ClickBrowseHdl_Impl, void *, EMPTYARG )
-{
- /////////////////////////////////////////////////
- // Open URL if available
-
- SfxStringItem aName( SID_FILE_NAME, maStrStdDocURL );
- SfxStringItem aRefererItem( SID_REFERER, UniString::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "private:user" ) ) );
- SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, TRUE );
- SfxBoolItem aSilent( SID_SILENT, TRUE );
- SfxBoolItem aReadOnly( SID_DOC_READONLY, TRUE );
-
- SfxBoolItem aBrowse( SID_BROWSE, TRUE );
-
- const SfxPoolItem *ppItems[] = { &aName, &aNewView, &aSilent, &aReadOnly, &aRefererItem, &aBrowse, NULL };
- (((SvxHpLinkDlg*)mpDialog)->GetBindings())->Execute( SID_OPENDOC, ppItems, 0, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : Target
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkInternetTp, ClickTargetHdl_Impl, void *, EMPTYARG )
-{
- RefreshMarkWindow();
- ShowMarkWnd ();
- mbMarkWndOpen = IsMarkWndVisible ();
-
- return( 0L );
-}
-
-void SvxHyperlinkInternetTp::RefreshMarkWindow()
-{
- if ( maRbtLinktypInternet.IsChecked() && IsMarkWndVisible() )
- {
- EnterWait();
- String aStrURL( CreateAbsoluteURL() );
- if ( aStrURL != aEmptyStr )
- mpMarkWnd->RefreshTree ( aStrURL );
- else
- mpMarkWnd->SetError( LERR_DOCNOTOPEN );
- LeaveWait();
- }
-
-}
-
-/*************************************************************************
-|*
-|* Get String from Bookmark-Wnd
-|*
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::SetMarkStr ( String& aStrMark )
-{
- String aStrURL ( maCbbTarget.GetText() );
-
- const sal_Unicode sUHash = '#';
- xub_StrLen nPos = aStrURL.SearchBackward( sUHash );
-
- if( nPos != STRING_NOTFOUND )
- aStrURL.Erase ( nPos );
-
- aStrURL += sUHash;
- aStrURL += aStrMark;
-
- maCbbTarget.SetText ( aStrURL );
-}
-
-/*************************************************************************
-|*
-|* Enable Browse-Button in subject to the office is in onlinemode
-|*
-|************************************************************************/
-
-void SvxHyperlinkInternetTp::SetOnlineMode( BOOL /*bEnable*/ )
-{
- // State of target-button in subject to the current url-string
- // ( Can't display any targets in an document, if there is no
- // valid url to a document )
- String aStrCurrentTarget( maCbbTarget.GetText() );
- aStrCurrentTarget.EraseTrailingChars();
-
- if( aStrCurrentTarget == aEmptyStr ||
- aStrCurrentTarget.EqualsIgnoreCaseAscii( sHTTPScheme ) ||
- aStrCurrentTarget.EqualsIgnoreCaseAscii( sHTTPSScheme ) )
- maBtTarget.Enable( FALSE );
- else
- maBtTarget.Enable( TRUE );
-}
diff --git a/svx/source/cui/hlinettp.hxx b/svx/source/cui/hlinettp.hxx
deleted file mode 100644
index 565429ceda..0000000000
--- a/svx/source/cui/hlinettp.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlinettp.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABPAGE_INET_HYPERLINK_HXX
-#define _SVX_TABPAGE_INET_HYPERLINK_HXX
-
-#include <hyperdlg.hxx>
-#include "cuihyperdlg.hxx"
-#include "hltpbase.hxx"
-
-/*************************************************************************
-|*
-|* Tabpage : Hyperlink - Internet
-|*
-\************************************************************************/
-
-class SvxHyperlinkInternetTp : public SvxHyperlinkTabPageBase
-{
-private:
- FixedLine maGrpLinkTyp;
- RadioButton maRbtLinktypInternet;
- RadioButton maRbtLinktypFTP;
- RadioButton maRbtLinktypTelnet;
- FixedText maFtTarget;
- SvxHyperURLBox maCbbTarget;
- FixedText maFtLogin;
- Edit maEdLogin;
- FixedText maFtPassword;
- Edit maEdPassword;
- CheckBox maCbAnonymous;
- ImageButton maBtBrowse;
- ImageButton maBtTarget;
-
- String maStrOldUser;
- String maStrOldPassword;
-
- BOOL mbMarkWndOpen;
-
- String maStrStdDocURL;
-
- DECL_LINK (Click_SmartProtocol_Impl , void * ); // Radiobutton clicked: Type Internet, FTP or Telnet
- DECL_LINK (ClickAnonymousHdl_Impl , void * ); // Checkbox : Anonymer Benutzer
- DECL_LINK (ClickBrowseHdl_Impl , void * ); // Button : Browse
- DECL_LINK (ClickTargetHdl_Impl , void * ); // Button : Ziel
- DECL_LINK (ModifiedLoginHdl_Impl , void * ); // Contens of editfield "Login" modified
- DECL_LINK (LostFocusTargetHdl_Impl , void * ); // Combobox "Target" lost its focus
- DECL_LINK (ModifiedTargetHdl_Impl , void * ); // Contens of editfield "Target" modified
-
- DECL_LINK (TimeoutHdl_Impl , Timer * ); // Handler for timer -timeout
-
-
- void SetScheme( const String& aScheme );
- void RemoveImproperProtocol(const String& aProperScheme);
- String GetSchemeFromButtons() const;
- INetProtocol GetSmartProtocolFromButtons() const;
-
- String CreateAbsoluteURL() const;
-
- void setAnonymousFTPUser();
- void setFTPUser(const String& rUser, const String& rPassword);
- void RefreshMarkWindow();
-
-protected:
- virtual void FillDlgFields ( String& aStrURL );
- virtual void GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode );
- virtual BOOL ShouldOpenMarkWnd () {return ( mbMarkWndOpen && maRbtLinktypInternet.IsChecked() );}
- virtual void SetMarkWndShouldOpen (BOOL bOpen) {mbMarkWndOpen=bOpen;}
-
-public:
- SvxHyperlinkInternetTp ( Window *pParent, const SfxItemSet& rItemSet);
- ~SvxHyperlinkInternetTp ();
-
- static IconChoicePage* Create( Window* pWindow, const SfxItemSet& rItemSet );
-
- virtual void SetMarkStr ( String& aStrMark );
- virtual void SetOnlineMode( BOOL bEnable );
-
- virtual void SetInitFocus();
-};
-
-
-#endif // _SVX_TABPAGE_INET_HYPERLINK_HXX
diff --git a/svx/source/cui/hlmailtp.cxx b/svx/source/cui/hlmailtp.cxx
deleted file mode 100644
index 283d9d243a..0000000000
--- a/svx/source/cui/hlmailtp.cxx
+++ /dev/null
@@ -1,367 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlmailtp.cxx,v $
- * $Revision: 1.23 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <sfx2/request.hxx>
-
-#include <comphelper/processfactory.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/moduleoptions.hxx>
-
-#include "hlmailtp.hxx"
-#include "hyperdlg.hrc"
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHyperlinkMailTp::SvxHyperlinkMailTp ( Window *pParent, const SfxItemSet& rItemSet)
-: SvxHyperlinkTabPageBase ( pParent, SVX_RES( RID_SVXPAGE_HYPERLINK_MAIL ),
- rItemSet ),
- maGrpMailNews ( this, SVX_RES (GRP_MAILNEWS) ),
- maRbtMail ( this, SVX_RES (RB_LINKTYP_MAIL) ),
- maRbtNews ( this, SVX_RES (RB_LINKTYP_NEWS) ),
- maFtReceiver ( this, SVX_RES (FT_RECEIVER) ),
- maCbbReceiver ( this, INET_PROT_MAILTO ),
- maBtAdrBook ( this, SVX_RES (BTN_ADRESSBOOK) ),
- maFtSubject ( this, SVX_RES (FT_SUBJECT) ),
- maEdSubject ( this, SVX_RES (ED_SUBJECT) )
-{
- // Set HC bitmaps and disable display of bitmap names.
- maBtAdrBook.SetModeImage( Image( SVX_RES( IMG_ADRESSBOOK_HC ) ), BMP_COLOR_HIGHCONTRAST );
- maBtAdrBook.EnableTextDisplay (FALSE);
-
- InitStdControls();
- FreeResource();
-
- // Init URL-Box (pos&size, Open-Handler)
- maCbbReceiver.SetPosSizePixel ( LogicToPixel( Point( COL_2, 25 ), MAP_APPFONT ),
- LogicToPixel( Size ( 176 - COL_DIFF, 60), MAP_APPFONT ) );
-
- maCbbReceiver.Show();
- maCbbReceiver.SetHelpId( HID_HYPERDLG_MAIL_PATH );
-
- SetExchangeSupport ();
-
- // set defaults
- maRbtMail.Check ();
-
- // overload handlers
- maRbtMail.SetClickHdl ( LINK ( this, SvxHyperlinkMailTp, Click_SmartProtocol_Impl ) );
- maRbtNews.SetClickHdl ( LINK ( this, SvxHyperlinkMailTp, Click_SmartProtocol_Impl ) );
- maBtAdrBook.SetClickHdl ( LINK ( this, SvxHyperlinkMailTp, ClickAdrBookHdl_Impl ) );
- maCbbReceiver.SetModifyHdl ( LINK ( this, SvxHyperlinkMailTp, ModifiedReceiverHdl_Impl) );
-
- if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) )
- maBtAdrBook.Hide();
-}
-
-SvxHyperlinkMailTp::~SvxHyperlinkMailTp ()
-{
-}
-
-/*************************************************************************
-|*
-|* Fill the all dialog-controls except controls in groupbox "more..."
-|*
-|************************************************************************/
-
-void SvxHyperlinkMailTp::FillDlgFields ( String& aStrURL )
-{
- const sal_Char sMailtoScheme[] = INET_MAILTO_SCHEME;
-
- INetURLObject aURL( aStrURL );
- String aStrScheme = GetSchemeFromURL( aStrURL );
-
- // set URL-field and additional controls
- String aStrURLc ( aStrURL );
- // set additional controls for EMail:
- if ( aStrScheme.SearchAscii( sMailtoScheme ) == 0 )
- {
- // Find mail-subject
- String aStrSubject, aStrTmp ( aStrURLc );
-
- const sal_Char sSubject[] = "subject";
- xub_StrLen nPos = aStrTmp.ToLowerAscii().SearchAscii( sSubject, 0 );
- nPos = aStrTmp.Search( sal_Unicode( '=' ), nPos );
-
- if ( nPos != STRING_NOTFOUND )
- aStrSubject = aStrURLc.Copy( nPos+1, aStrURLc.Len() );
-
- nPos = aStrURLc.Search ( sal_Unicode( '?' ), 0);
-
- aStrURLc = aStrURLc.Copy( 0, ( nPos == STRING_NOTFOUND ?
- aStrURLc.Len() : nPos ) );
-
- maEdSubject.SetText ( aStrSubject );
- }
- else
- {
- maEdSubject.SetText (aEmptyStr);
- }
-
- maCbbReceiver.SetText ( aStrURLc );
-
- SetScheme( aStrScheme );
-}
-
-/*************************************************************************
-|*
-|* retrieve and prepare data from dialog-fields
-|*
-|************************************************************************/
-
-void SvxHyperlinkMailTp::GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode )
-{
- aStrURL = CreateAbsoluteURL();
- GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode );
-}
-
-String SvxHyperlinkMailTp::CreateAbsoluteURL() const
-{
- String aStrURL = maCbbReceiver.GetText();
- INetURLObject aURL(aStrURL);
-
- if( aURL.GetProtocol() == INET_PROT_NOT_VALID )
- {
- aURL.SetSmartProtocol( GetSmartProtocolFromButtons() );
- aURL.SetSmartURL(aStrURL);
- }
-
- // subject for EMail-url
- if( aURL.GetProtocol() == INET_PROT_MAILTO )
- {
- if ( maEdSubject.GetText() != aEmptyStr )
- {
- String aQuery = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "subject=" ) );
- aQuery.Append( maEdSubject.GetText() );
- aURL.SetParam(aQuery);
- }
- }
-
- if ( aURL.GetProtocol() != INET_PROT_NOT_VALID )
- return aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
- else //#105788# always create a URL even if it is not valid
- return aStrURL;
-}
-
-/*************************************************************************
-|*
-|* static method to create Tabpage
-|*
-|************************************************************************/
-
-IconChoicePage* SvxHyperlinkMailTp::Create( Window* pWindow, const SfxItemSet& rItemSet )
-{
- return( new SvxHyperlinkMailTp( pWindow, rItemSet ) );
-}
-
-/*************************************************************************
-|*
-|* Set initial focus
-|*
-|************************************************************************/
-
-void SvxHyperlinkMailTp::SetInitFocus()
-{
- maCbbReceiver.GrabFocus();
-}
-
-/*************************************************************************
-|************************************************************************/
-
-void SvxHyperlinkMailTp::SetScheme( const String& aScheme )
-{
- //if aScheme is empty or unknown the default beaviour is like it where MAIL
- const sal_Char sNewsScheme[] = INET_NEWS_SCHEME;
-
- BOOL bMail = aScheme.SearchAscii( sNewsScheme ) != 0;
-
- //update protocol button selection:
- maRbtMail.Check(bMail);
- maRbtNews.Check(!bMail);
-
- //update target:
- RemoveImproperProtocol(aScheme);
- maCbbReceiver.SetSmartProtocol( GetSmartProtocolFromButtons() );
-
- //show/hide special fields for MAIL:
- maFtSubject.Enable(bMail);
- maEdSubject.Enable(bMail);
-}
-
-/*************************************************************************
-|*
-|* Remove protocol if it does not fit to the current button selection
-|*
-|************************************************************************/
-
-void SvxHyperlinkMailTp::RemoveImproperProtocol(const String& aProperScheme)
-{
- String aStrURL ( maCbbReceiver.GetText() );
- if ( aStrURL != aEmptyStr )
- {
- String aStrScheme = GetSchemeFromURL( aStrURL );
- if ( aStrScheme != aEmptyStr && aStrScheme != aProperScheme )
- {
- aStrURL.Erase ( 0, aStrScheme.Len() );
- maCbbReceiver.SetText ( aStrURL );
- }
- }
-}
-
-String SvxHyperlinkMailTp::GetSchemeFromButtons() const
-{
- if( maRbtNews.IsChecked() )
- {
- return String::CreateFromAscii( INET_NEWS_SCHEME );
- }
- return String::CreateFromAscii( INET_MAILTO_SCHEME );
-}
-
-INetProtocol SvxHyperlinkMailTp::GetSmartProtocolFromButtons() const
-{
- if( maRbtNews.IsChecked() )
- {
- return INET_PROT_NEWS;
- }
- return INET_PROT_MAILTO;
-}
-
-/*************************************************************************
-|*
-|* Click on radiobutton : Type EMail
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkMailTp, Click_SmartProtocol_Impl, void *, EMPTYARG )
-{
- String aScheme = GetSchemeFromButtons();
- SetScheme( aScheme );
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Contens of editfield "receiver" modified
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkMailTp, ModifiedReceiverHdl_Impl, void *, EMPTYARG )
-{
- String aScheme = GetSchemeFromURL( maCbbReceiver.GetText() );
- if(aScheme.Len()!=0)
- SetScheme( aScheme );
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : addressbook
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkMailTp, ClickAdrBookHdl_Impl, void *, EMPTYARG )
-{
- SfxViewFrame* pViewFrame = SfxViewFrame::Current();
- if( pViewFrame )
- {
- SfxItemPool &rPool = pViewFrame->GetPool();
- SfxRequest aReq(SID_VIEW_DATA_SOURCE_BROWSER, 0, rPool);
- pViewFrame->ExecuteSlot( aReq, sal_True );
- }
-
-
-/* uno::Reference< frame::XDispatchProvider > xProv( pViewFrame->GetFrame()->GetFrameInterface(), uno::UNO_QUERY );
- if ( xProv.is() )
- {
-!!! (pb) we need a new config item here
- SfxAppIniManagerProperty aProp;
- GetpApp()->Property( aProp );
- if( !aProp.GetIniManager() )
- return ( 0L );
-
- String aAddressBook = aProp.GetIniManager()->Get( SFX_KEY_ADDRESSBOOK );
- INetURLObject aObj;
- aObj.SetSmartProtocol( INET_PROT_FILE );
- aObj.SetURL( aAddressBook.GetToken( 0, sal_Unicode( ';' ) ) );
-
- String aMark( RTL_CONSTASCII_USTRINGPARAM( "db:Table;" ) );
- aMark += aAddressBook.GetToken( 1, sal_Unicode( ';' ) );
- aObj.SetMark( aMark );
-
- util::URL aURL;
- aURL.Complete = ::rtl::OUString( aObj.GetMainURL( INetURLObject::NO_DECODE ) );
-
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- uno::Reference< util::XURLTransformer > xTrans( xFactory->createInstance
- ( OUString::createFromAscii( "com.sun.star.util.URLTransformer" ) ),
- uno::UNO_QUERY);
- xTrans->parseStrict( aURL );
-
- uno::Reference< frame::XDispatch > aDisp = xProv->queryDispatch( aURL,
- OUString::createFromAscii( "_beamer" ),
- frame::FrameSearchFlag::GLOBAL |
- frame::FrameSearchFlag::CREATE );
- if ( aDisp.is() )
- {
- uno::Sequence< beans::PropertyValue > aArgs(1);
- beans::PropertyValue* pArg = aArgs.getArray();
- pArg[0].Name = DEFINE_CONST_UNICODE("Referer");
- pArg[0].Value = uno::makeAny( OUString( DEFINE_CONST_UNICODE("private:user") ) );
- aDisp->dispatch( aURL, aArgs );
- }
- }
- }
-*/
-
- return( 0L );
-}
-
-
diff --git a/svx/source/cui/hlmailtp.hxx b/svx/source/cui/hlmailtp.hxx
deleted file mode 100644
index 39b2bc2670..0000000000
--- a/svx/source/cui/hlmailtp.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlmailtp.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABPAGE_MAIL_HYPERLINK_HXX
-#define _SVX_TABPAGE_MAIL_HYPERLINK_HXX
-
-#include "hltpbase.hxx"
-
-/*************************************************************************
-|*
-|* Tabpage : Hyperlink - Mail & News
-|*
-\************************************************************************/
-
-class SvxHyperlinkMailTp : public SvxHyperlinkTabPageBase
-{
-private:
- FixedLine maGrpMailNews;
- RadioButton maRbtMail;
- RadioButton maRbtNews;
- FixedText maFtReceiver;
- SvxHyperURLBox maCbbReceiver;
- ImageButton maBtAdrBook;
- FixedText maFtSubject;
- Edit maEdSubject;
-
- DECL_LINK (Click_SmartProtocol_Impl, void * ); // Radiobutton clicked: Type EMAIl or News
- DECL_LINK (ClickAdrBookHdl_Impl , void * ); // Button : Address book
- DECL_LINK (ModifiedReceiverHdl_Impl, void * ); // Combobox "receiver" modified
-
- void SetScheme( const String& aScheme );
- void RemoveImproperProtocol(const String& aProperScheme);
- String GetSchemeFromButtons() const;
- INetProtocol GetSmartProtocolFromButtons() const;
-
- String CreateAbsoluteURL() const;
-
-protected:
- virtual void FillDlgFields ( String& aStrURL );
- virtual void GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode );
-
-public:
- SvxHyperlinkMailTp ( Window *pParent, const SfxItemSet& rItemSet);
- ~SvxHyperlinkMailTp ();
-
- static IconChoicePage* Create( Window* pWindow, const SfxItemSet& rItemSet );
-
- virtual void SetInitFocus();
-};
-
-
-#endif // _SVX_TABPAGE_MAIL_HYPERLINK_HXX
diff --git a/svx/source/cui/hlmarkwn.cxx b/svx/source/cui/hlmarkwn.cxx
deleted file mode 100644
index e65fbb228d..0000000000
--- a/svx/source/cui/hlmarkwn.cxx
+++ /dev/null
@@ -1,549 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlmarkwn.cxx,v $
- * $Revision: 1.19.216.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <vcl/wrkwin.hxx>
-#include <svx/dialmgr.hxx>
-#include <sfx2/docfile.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/settings.hxx>
-
-// UNO-Stuff
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/document/XLinkTargetSupplier.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-#include <toolkit/unohlp.hxx>
-
-#include <svx/dialogs.hrc>
-#include "hlmarkwn.hrc"
-#include "hlmarkwn.hxx"
-#include "hltpbase.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::rtl;
-
-/*************************************************************************
-|*
-|* Userdata-struct for tree-entries
-|*
-|************************************************************************/
-
-struct TargetData
-{
- OUString aUStrLinkname;
- BOOL bIsTarget;
-
- TargetData ( OUString aUStrLName, BOOL bTarget )
- : bIsTarget ( bTarget )
- {
- if ( bIsTarget )
- aUStrLinkname = aUStrLName;
- }
-};
-
-
-//########################################################################
-//# #
-//# Tree-Window #
-//# #
-//########################################################################
-
-SvxHlmarkTreeLBox::SvxHlmarkTreeLBox( Window* pParent, const ResId& rResId )
-: SvTreeListBox ( pParent, rResId ),
- mpParentWnd ( (SvxHlinkDlgMarkWnd*) pParent )
-{
- SetNodeDefaultImages();
-}
-
-void SvxHlmarkTreeLBox::Paint( const Rectangle& rRect )
-{
- if( mpParentWnd->mnError == LERR_NOERROR )
- {
- SvTreeListBox::Paint(rRect);
- }
- else
- {
- Erase();
-
- Rectangle aDrawRect( Point( 0, 0 ), GetSizePixel() );
-
- String aStrMessage;
-
- switch( mpParentWnd->mnError )
- {
- case LERR_NOENTRIES :
- aStrMessage = SVX_RESSTR( RID_SVXSTR_HYPDLG_ERR_LERR_NOENTRIES );
- break;
- case LERR_DOCNOTOPEN :
- aStrMessage = SVX_RESSTR( RID_SVXSTR_HYPDLG_ERR_LERR_DOCNOTOPEN );
- break;
- }
-
- DrawText( aDrawRect, aStrMessage, TEXT_DRAW_LEFT | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- }
-
-}
-
-//########################################################################
-//# #
-//# Window-Class #
-//# #
-//########################################################################
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
-: ModalDialog( (Window*)pParent, SVX_RES ( RID_SVXFLOAT_HYPERLINK_MARKWND ) ),
- maBtApply( this, SVX_RES (BT_APPLY) ),
- maBtClose( this, SVX_RES (BT_CLOSE) ),
- maLbTree ( this, SVX_RES (TLB_MARK) ),
- mbUserMoved ( FALSE ),
- mbFirst ( TRUE ),
- mpParent ( pParent ),
- mnError ( LERR_NOERROR )
-{
- FreeResource();
-
- maBtApply.SetClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl ) );
- maBtClose.SetClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickCloseHdl_Impl ) );
- maLbTree.SetDoubleClickHdl ( LINK ( this, SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl ) );
-
- // Tree-ListBox mit Linien versehen
- maLbTree.SetWindowBits( WinBits( WB_TABSTOP | WB_BORDER | WB_HASLINES |
- WB_HASBUTTONS | //WB_HASLINESATROOT |
- WB_HSCROLL | WB_HASBUTTONSATROOT ) );
-}
-
-SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd()
-{
- ClearTree();
-}
-
-/*************************************************************************
-|*
-|* Set an errorstatus
-|*
-|************************************************************************/
-
-USHORT SvxHlinkDlgMarkWnd::SetError( USHORT nError)
-{
- USHORT nOldError = mnError;
- mnError = nError;
-
- if( mnError != LERR_NOERROR )
- ClearTree();
-
- maLbTree.Invalidate();
-
- return nOldError;
-}
-
-/*************************************************************************
-|*
-|* Move window
-|*
-|************************************************************************/
-
-BOOL SvxHlinkDlgMarkWnd::MoveTo ( Point aNewPos )
-{
- if ( !mbUserMoved )
- {
- BOOL bOldStatus = mbUserMoved;
- SetPosPixel ( aNewPos );
- mbUserMoved = bOldStatus;
- }
-
- return mbUserMoved;
-}
-
-void SvxHlinkDlgMarkWnd::Move ()
-{
- Window::Move();
-
- if ( IsReallyVisible() )
- mbUserMoved = TRUE;
-}
-
-BOOL SvxHlinkDlgMarkWnd::ConnectToDialog( BOOL bDoit )
-{
- BOOL bOldStatus = mbUserMoved;
-
- mbUserMoved = !bDoit;
-
- return bOldStatus;
-}
-
-/*************************************************************************
-|*
-|* Interface to refresh tree
-|*
-|************************************************************************/
-
-void SvxHlinkDlgMarkWnd::RefreshTree ( String aStrURL )
-{
- String aEmptyStr;
- OUString aUStrURL;
-
- EnterWait();
-
- ClearTree();
-
- xub_StrLen nPos = aStrURL.Search ( sal_Unicode('#') );
-
- if( nPos != 0 )
- aUStrURL = ::rtl::OUString( aStrURL );
-
- if( !RefreshFromDoc ( aUStrURL ) )
- maLbTree.Invalidate();
-
- if ( nPos != STRING_NOTFOUND )
- {
- String aStrMark = aStrURL.Copy ( nPos+1 );
- SelectEntry ( aStrMark );
- }
-
- LeaveWait();
-
- maStrLastURL = aStrURL;
-}
-
-/*************************************************************************
-|*
-|* get links from document
-|*
-|************************************************************************/
-
-BOOL SvxHlinkDlgMarkWnd::RefreshFromDoc( OUString aURL )
-{
- mnError = LERR_NOERROR;
-
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- uno::Reference< frame::XDesktop > xDesktop( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ),
- uno::UNO_QUERY );
- if( xDesktop.is() )
- {
- uno::Reference< lang::XComponent > xComp;
-
- if( aURL.getLength() )
- {
- // load from url
- uno::Reference< frame::XComponentLoader > xLoader( xDesktop, uno::UNO_QUERY );
- if( xLoader.is() )
- {
- try
- {
- uno::Sequence< beans::PropertyValue > aArg(1);
- aArg.getArray()[0].Name = OUString::createFromAscii( "Hidden" );
- aArg.getArray()[0].Value <<= (sal_Bool) TRUE;
- xComp = xLoader->loadComponentFromURL( aURL, OUString::createFromAscii( "_blank" ), 0, aArg );
- }
- catch( const io::IOException& )
- {
-
- }
- catch( const lang::IllegalArgumentException& )
- {
-
- }
- }
- }
- else
- {
- // the component with user focus ( current document )
- xComp = xDesktop->getCurrentComponent();
- }
-
- if( xComp.is() )
- {
- uno::Reference< document::XLinkTargetSupplier > xLTS( xComp, uno::UNO_QUERY );
-
- if( xLTS.is() )
- {
- if( FillTree( xLTS->getLinks() ) == 0 )
- mnError = LERR_NOENTRIES;
- }
- else
- mnError = LERR_DOCNOTOPEN;
-
- if ( aURL.getLength() )
- xComp->dispose();
- }
- else
- {
- if( aURL.getLength() )
- mnError=LERR_DOCNOTOPEN;
- }
- }
- }
- return (mnError==0);
-}
-/*
-void SvxHlinkDlgMarkWnd::Error(int nNr)
-{
- switch(nNr)
- {
- case 0:
- {
- Rectangle aDrawRect( Point( 0, 0 ), maLbTree.GetSizePixel() );
- //maLbTree.SetTextColor( Color(COL_BLACK) );
- //maLbTree.DrawText( aDrawRect, "Keine Ziele im Dokument vorhanden.", TEXT_DRAW_LEFT);// | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- maLbTree.DrawText( Point(0,0), "Keine Ziele im Dokument vorhanden.");
- maLbTree.DrawLine(aDrawRect.TopLeft(), aDrawRect.BottomRight() );
- }
- break;
- case 1:
- Rectangle aDrawRect( Point( 0, 0 ), maLbTree.GetSizePixel() );
- maLbTree.DrawText( aDrawRect, "Das Dokument konnte nicht ge�ffnet werden.", TEXT_DRAW_LEFT | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
- break;
- }
-}
-*/
-/*************************************************************************
-|*
-|* Fill Tree-Control
-|*
-|************************************************************************/
-
-int SvxHlinkDlgMarkWnd::FillTree( uno::Reference< container::XNameAccess > xLinks, SvLBoxEntry* pParentEntry )
-{
- int nEntries=0;
- const uno::Sequence< OUString > aNames( xLinks->getElementNames() );
- const ULONG nLinks = aNames.getLength();
- const OUString* pNames = aNames.getConstArray();
-
- Color aMaskColor( COL_LIGHTMAGENTA );
- const OUString aProp_LinkDisplayName( RTL_CONSTASCII_USTRINGPARAM( "LinkDisplayName" ) );
- const OUString aProp_LinkTarget( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.LinkTarget" ) );
- const OUString aProp_LinkDisplayBitmap( RTL_CONSTASCII_USTRINGPARAM( "LinkDisplayBitmap" ) );
- for( ULONG i = 0; i < nLinks; i++ )
- {
- uno::Any aAny;
- OUString aLink( *pNames++ );
-
- BOOL bError = FALSE;
- try
- {
- aAny = xLinks->getByName( aLink );
- }
- catch(const uno::Exception&)
- {
- // if the name of the target was invalid (like empty headings)
- // no object can be provided
- bError = TRUE;
- }
- if(bError)
- continue;
-
- uno::Reference< beans::XPropertySet > xTarget;
-
- if( aAny >>= xTarget )
- {
- try
- {
- // get name to display
- aAny = xTarget->getPropertyValue( aProp_LinkDisplayName );
- OUString aDisplayName;
- aAny >>= aDisplayName;
- String aStrDisplayname ( aDisplayName );
-
- // is it a target ?
- uno::Reference< lang::XServiceInfo > xSI( xTarget, uno::UNO_QUERY );
- BOOL bIsTarget = xSI->supportsService( aProp_LinkTarget );
-
- // create userdata
- TargetData *pData = new TargetData ( aLink, bIsTarget );
-
- SvLBoxEntry* pEntry;
-
- try
- {
- // get bitmap for the tree-entry
- uno::Reference< awt::XBitmap > aXBitmap( xTarget->getPropertyValue( aProp_LinkDisplayBitmap ), uno::UNO_QUERY );
- if( aXBitmap.is() )
- {
- Image aBmp( VCLUnoHelper::GetBitmap( aXBitmap ).GetBitmap(), aMaskColor );
- // insert Displayname into treelist with bitmaps
- pEntry = maLbTree.InsertEntry ( aStrDisplayname,
- aBmp, aBmp,
- pParentEntry,
- FALSE, LIST_APPEND,
- (void*)pData );
- maLbTree.SetExpandedEntryBmp( pEntry, aBmp, BMP_COLOR_HIGHCONTRAST );
- maLbTree.SetCollapsedEntryBmp( pEntry, aBmp, BMP_COLOR_HIGHCONTRAST );
- nEntries++;
- }
- else
- {
- // insert Displayname into treelist without bitmaps
- pEntry = maLbTree.InsertEntry ( aStrDisplayname,
- pParentEntry,
- FALSE, LIST_APPEND,
- (void*)pData );
- nEntries++;
- }
- }
- catch(const com::sun::star::uno::Exception&)
- {
- // insert Displayname into treelist without bitmaps
- pEntry = maLbTree.InsertEntry ( aStrDisplayname,
- pParentEntry,
- FALSE, LIST_APPEND,
- (void*)pData );
- nEntries++;
- }
-
- uno::Reference< document::XLinkTargetSupplier > xLTS( xTarget, uno::UNO_QUERY );
- if( xLTS.is() )
- nEntries += FillTree( xLTS->getLinks(), pEntry );
- }
- catch(const com::sun::star::uno::Exception&)
- {
- }
- }
- }
-
- return nEntries;
-}
-
-/*************************************************************************
-|*
-|* Clear Tree
-|*
-|************************************************************************/
-
-void SvxHlinkDlgMarkWnd::ClearTree()
-{
- SvLBoxEntry* pEntry = maLbTree.First();
-
- while ( pEntry )
- {
- TargetData* pUserData = ( TargetData * ) pEntry->GetUserData();
- delete pUserData;
-
- pEntry = maLbTree.Next( pEntry );
- }
-
- maLbTree.Clear();
-}
-
-/*************************************************************************
-|*
-|* Find Entry for Strng
-|*
-|************************************************************************/
-
-SvLBoxEntry* SvxHlinkDlgMarkWnd::FindEntry ( String aStrName )
-{
- BOOL bFound=FALSE;
- SvLBoxEntry* pEntry = maLbTree.First();
-
- while ( pEntry && !bFound )
- {
- TargetData* pUserData = ( TargetData * ) pEntry->GetUserData ();
- if ( aStrName == String( pUserData->aUStrLinkname ) )
- bFound = TRUE;
- else
- pEntry = maLbTree.Next( pEntry );
- }
-
- return pEntry;
-}
-
-/*************************************************************************
-|*
-|* Select Entry
-|*
-|************************************************************************/
-
-void SvxHlinkDlgMarkWnd::SelectEntry ( String aStrMark )
-{
- SvLBoxEntry* pEntry = FindEntry ( aStrMark );
- if ( pEntry )
- {
- maLbTree.Select ( pEntry );
- maLbTree.MakeVisible ( pEntry );
- }
-}
-
-/*************************************************************************
-|*
-|* Click on Apply-Button / Doubleclick on item in tree
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHlinkDlgMarkWnd, ClickApplyHdl_Impl, void *, EMPTYARG )
-{
- SvLBoxEntry* pEntry = maLbTree.GetCurEntry();
-
- if ( pEntry )
- {
- TargetData *pData = ( TargetData * )pEntry->GetUserData();
-
- if ( pData->bIsTarget )
- {
- String aStrMark ( pData->aUStrLinkname );
- mpParent->SetMarkStr ( aStrMark );
- }
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Click on Close-Button
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHlinkDlgMarkWnd, ClickCloseHdl_Impl, void *, EMPTYARG )
-{
- Close();
-
- return( 0L );
-}
-
-
diff --git a/svx/source/cui/hlmarkwn.src b/svx/source/cui/hlmarkwn.src
deleted file mode 100644
index e14ece64ae..0000000000
--- a/svx/source/cui/hlmarkwn.src
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlmarkwn.src,v $
- * $Revision: 1.27 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "hlmarkwn.hrc"
-
-ModalDialog RID_SVXFLOAT_HYPERLINK_MARKWND
-{
- HelpID = HID_HYPERLINK_MARKWND;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;//?????
- Sizeable = FALSE ;
- Border = TRUE ;
- Hide = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 109 , 185 ) ;
- Text [ en-US ] = "Target in Document" ;
- PushButton BT_APPLY
- {
- HelpId = HID_HYPERLINK_MARKWND_APPLY;
- Pos = MAP_APPFONT ( 3 , 168 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- Text [ en-US ] = "Apply" ;
- };
- PushButton BT_CLOSE
- {
- HelpId = HID_HYPERLINK_MARKWND_CLOSE;
- Pos = MAP_APPFONT ( 56 , 168 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "Close" ;
- };
- Control TLB_MARK
- {
- HelpId = HID_HYPERLINK_MARKWND_TREE;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 103 , 162 ) ;
- TabStop = TRUE ;
- };
-};
-
-String RID_SVXSTR_HYPDLG_ERR_LERR_NOENTRIES
-{
- Text [ en-US ] = "Targets do not exist in the document." ;
-};
-
-String RID_SVXSTR_HYPDLG_ERR_LERR_DOCNOTOPEN
-{
- Text [ en-US ] = "Couldn't open the document." ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/hltpbase.cxx b/svx/source/cui/hltpbase.cxx
deleted file mode 100644
index 2e76c5be4a..0000000000
--- a/svx/source/cui/hltpbase.cxx
+++ /dev/null
@@ -1,880 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hltpbase.cxx,v $
- * $Revision: 1.37.216.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <sfx2/frame.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sot/formats.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <svtools/macitem.hxx>
-#include <ucbhelper/content.hxx>
-#include <unotools/localfilehelper.hxx>
-#include "hyperdlg.hrc"
-//CHINA001 #ifndef _SVX_TAB_HYPERLINK_HXX
-//CHINA001 #include "hyperdlg.hxx"
-//CHINA001 #endif
-#include "cuihyperdlg.hxx" //CHINA001
-#include "hltpbase.hxx"
-#include "macroass.hxx"
-
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialogs.hrc> //CHINA001
-
-using namespace ::ucbhelper;
-
-//########################################################################
-//# #
-//# ComboBox-Control, wich is filled with all current framenames #
-//# #
-//########################################################################
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxFramesComboBox::SvxFramesComboBox ( Window* pParent, const ResId& rResId,
- SfxDispatcher* pDispatch )
-: ComboBox (pParent, rResId)
-{
- TargetList* pList = new TargetList;
- SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0;
- SfxFrame* pFrame = pViewFrame ? pViewFrame->GetTopFrame() : 0;
- if ( pFrame )
- {
- pFrame->GetTargetList(*pList);
- USHORT nCount = (USHORT)pList->Count();
- if( nCount )
- {
- USHORT i;
- for ( i = 0; i < nCount; i++ )
- {
- InsertEntry(*pList->GetObject(i));
- }
- for ( i = nCount; i; i-- )
- {
- delete pList->GetObject( i - 1 );
- }
- }
- delete pList;
- }
-}
-
-SvxFramesComboBox::~SvxFramesComboBox ()
-{
-}
-//########################################################################
-//# #
-//# ComboBox-Control for URL's with History and Autocompletion #
-//# #
-//########################################################################
-
-/*************************************************************************
-|*
-|* Contructor / Destructor
-|*
-|************************************************************************/
-
-SvxHyperURLBox::SvxHyperURLBox( Window* pParent, INetProtocol eSmart, BOOL bAddresses )
-: SvtURLBox ( pParent, eSmart ),
- DropTargetHelper ( this ),
- mbAccessAddress (bAddresses)
-{
-}
-
-sal_Int8 SvxHyperURLBox::AcceptDrop( const AcceptDropEvent& /* rEvt */ )
-{
- return( IsDropFormatSupported( FORMAT_STRING ) ? DND_ACTION_COPY : DND_ACTION_NONE );
-}
-
-sal_Int8 SvxHyperURLBox::ExecuteDrop( const ExecuteDropEvent& rEvt )
-{
- TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
- String aString;
- sal_Int8 nRet = DND_ACTION_NONE;
-
- if( aDataHelper.GetString( FORMAT_STRING, aString ) )
- {
- SetText( aString );
- nRet = DND_ACTION_COPY;
- }
-
- return nRet;
-}
-
-/*
-Diese Methode parsed eine EMailadresse aus einem D&D-DataObjekt aus der Adre�datenbank heraus
-
-#ifndef _OFF_OFADBMGR_HXX
-#include <offmgr/ofadbmgr.hxx>
-#endif
-#ifndef _SFX_APP_HXX
-#include <offmgr/app.hxx>
-#endif
-#ifndef _SDB_SDBCURS_HXX
-#include <sdb/sdbcurs.hxx>
-#endif
-
-#define DB_DD_DELIM ((char)11)
-
-String SvxHyperURLBox::GetAllEmailNamesFromDragItem( USHORT nItem )
-{
-#if !defined( ICC ) && !defined( SOLARIS )
- String aAddress;
-
- if ( DragServer::HasFormat( nItem, SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ) )
- {
- ULONG nLen = DragServer::GetDataLen( nItem, SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ) - 1;
- USHORT i = 0;
- String aTxt;
- char *pTxt = aTxt.AllocStrBuf( (USHORT)nLen );
- DragServer::PasteData( nItem, pTxt, nLen, SOT_FORMATSTR_ID_SBA_DATAEXCHANGE );
- String aDBName = aTxt.GetToken( i++, DB_DD_DELIM );
- String aTableName = aTxt.GetToken( i++, DB_DD_DELIM );
- i++; // Format"anderung
- String aStatement = aTxt.GetToken( i++, DB_DD_DELIM );
- if ( !aStatement )
- {
- aDBName += DB_DELIM;
- aDBName += aTableName;
- }
- else
- {
- // use here another delimiter, because the OfaDBMgr uses two
- // delimiters ( (char)11 and ; )
- aDBName += ';';
- aDBName += aStatement;
- }
- SbaSelectionListRef pSelectionList;
- pSelectionList.Clear();
- pSelectionList = new SbaSelectionList;
- USHORT nTokCnt = aTxt.GetTokenCount( DB_DD_DELIM );
-
- for ( ; i < nTokCnt; ++i )
- pSelectionList->Insert(
- (void*)(USHORT)aTxt.GetToken( i, DB_DD_DELIM ), LIST_APPEND );
-
- OfaDBMgr* pDBMgr = SFX_APP()->GetOfaDBMgr();
- BOOL bBasic = DBMGR_STD;
-
- if ( !pDBMgr->OpenDB( bBasic, aDBName ) )
- return aAddress;
-
- OfaDBParam& rParam = pDBMgr->GetDBData( bBasic );
- pDBMgr->ChangeStatement( bBasic, aStatement );
- rParam.pSelectionList->Clear();
-
- if ( pSelectionList.Is() &&
- (long)pSelectionList->GetObject(0) != -1L )
- *rParam.pSelectionList = *pSelectionList;
-
- if ( !pDBMgr->ToFirstSelectedRecord( bBasic ) )
- {
- pDBMgr->CloseAll();
- return aAddress;
- }
-
- if ( pDBMgr->IsSuccessful( bBasic ) )
- {
- // Spaltenk"opfe
- SbaDBDataDefRef aDBDef = pDBMgr->OpenColumnNames( bBasic );
-
- if ( aDBDef.Is() )
- {
- SbaColumn* pCol = aDBDef->GetColumn("EMAIL");
- ULONG nPos = 0;
-
- if ( pCol )
- nPos = aDBDef->GetOriginalColumns().GetPos( pCol ) + 1;
- for ( i = 0 ; nPos && i < pSelectionList->Count(); ++i )
- {
- ULONG nIndex = (ULONG)pSelectionList->GetObject(i);
-
- // N"achsten zu lesenden Datensatz ansteuern
-
- BOOL bEnd = rParam.GetCursor()->IsOffRange();
-
- if ( !bEnd )
- {
- const ODbRowRef aRow =
- pDBMgr->GetSelectedRecord( bBasic, i );
-
- if ( aRow.Is() )
- {
- aAddress += pDBMgr->
- ImportDBField( (USHORT)nPos, &aDBDef, aRow.getBodyPtr() );
- aAddress += ',';
- }
- else
- {
- aAddress.Erase();
- break;
- }
- }
- else
- break;
- }
- }
- }
- pDBMgr->CloseAll();
- }
- aAddress.EraseTrailingChars( ',' );
- return aAddress;
-#else
- return String();
-#endif
-}
-*/
-
-void SvxHyperURLBox::Select()
-{
- SvtURLBox::Select();
-}
-void SvxHyperURLBox::Modify()
-{
- SvtURLBox::Modify();
-}
-long SvxHyperURLBox::Notify( NotifyEvent& rNEvt )
-{
- return SvtURLBox::Notify( rNEvt );
-}
-long SvxHyperURLBox::PreNotify( NotifyEvent& rNEvt )
-{
- return SvtURLBox::PreNotify( rNEvt );
-}
-
-//########################################################################
-//# #
-//# Hyperlink-Dialog: Tabpages-Baseclass #
-//# #
-//########################################################################
-
-/*************************************************************************
-|*
-|* Con/Destructor, Initialize
-|*
-\************************************************************************/
-
-SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( Window *pParent,
- const ResId &rResId,
- const SfxItemSet& rItemSet )
-: IconChoicePage ( pParent, rResId, rItemSet ),
- mpGrpMore ( NULL ),
- mpFtFrame ( NULL ),
- mpCbbFrame ( NULL ),
- mpFtForm ( NULL ),
- mpLbForm ( NULL ),
- mpFtIndication ( NULL ),
- mpEdIndication ( NULL ),
- mpFtText ( NULL ),
- mpEdText ( NULL ),
- mpBtScript ( NULL ),
- mbIsCloseDisabled ( sal_False ),
- mpDialog ( pParent ),
- mbStdControlsInit ( FALSE ),
- aEmptyStr()
-{
- // create bookmark-window
- mpMarkWnd = new SvxHlinkDlgMarkWnd ( this );
-}
-
-SvxHyperlinkTabPageBase::~SvxHyperlinkTabPageBase ()
-{
- maTimer.Stop();
-
- if ( mbStdControlsInit )
- {
- delete mpGrpMore;
- delete mpFtFrame;
- delete mpCbbFrame;
- delete mpFtForm;
- delete mpLbForm;
- delete mpFtIndication;
- delete mpEdIndication;
- delete mpFtText;
- delete mpEdText ;
- delete mpBtScript;
- }
-
- delete mpMarkWnd;
-}
-
-void SvxHyperlinkTabPageBase::ActivatePage()
-{
- TabPage::ActivatePage();
-}
-
-void SvxHyperlinkTabPageBase::DeactivatePage()
-{
- TabPage::DeactivatePage();
-}
-
-sal_Bool SvxHyperlinkTabPageBase::QueryClose()
-{
- return !mbIsCloseDisabled;
-}
-
-void SvxHyperlinkTabPageBase::InitStdControls ()
-{
- if ( !mbStdControlsInit )
- {
- mpGrpMore = new FixedLine ( this, ResId (GRP_MORE, *m_pResMgr) );
- mpFtFrame = new FixedText ( this, ResId (FT_FRAME, *m_pResMgr) );
- mpCbbFrame = new SvxFramesComboBox ( this, ResId (CB_FRAME, *m_pResMgr), GetDispatcher() );
- mpFtForm = new FixedText ( this, ResId (FT_FORM, *m_pResMgr) );
- mpLbForm = new ListBox ( this, ResId (LB_FORM, *m_pResMgr) );
- mpFtIndication= new FixedText ( this, ResId (FT_INDICATION, *m_pResMgr) );
- mpEdIndication= new Edit ( this, ResId (ED_INDICATION, *m_pResMgr) );
- mpFtText = new FixedText ( this, ResId (FT_TEXT, *m_pResMgr) );
- mpEdText = new Edit ( this, ResId (ED_TEXT, *m_pResMgr) );
- mpBtScript = new ImageButton ( this, ResId (BTN_SCRIPT, *m_pResMgr) );
-
- mpBtScript->SetClickHdl ( LINK ( this, SvxHyperlinkTabPageBase, ClickScriptHdl_Impl ) );
-
- mpBtScript->SetModeImage( Image( ResId( IMG_SCRIPT_HC, *m_pResMgr ) ), BMP_COLOR_HIGHCONTRAST );
- mpBtScript->EnableTextDisplay (FALSE);
- }
-
- mbStdControlsInit = TRUE;
-}
-
-/*************************************************************************
-|*
-|* Move Extra-Window
-|*
-\************************************************************************/
-
-BOOL SvxHyperlinkTabPageBase::MoveToExtraWnd( Point aNewPos, BOOL bDisConnectDlg )
-{
- BOOL bReturn = mpMarkWnd->MoveTo ( aNewPos );
-
- if( bDisConnectDlg )
- mpMarkWnd->ConnectToDialog( FALSE );
-
- return ( !bReturn && IsMarkWndVisible() );
-}
-
-/*************************************************************************
-|*
-|* Show Extra-Window
-|*
-\************************************************************************/
-
-void SvxHyperlinkTabPageBase::ShowMarkWnd ()
-{
- ( ( Window* ) mpMarkWnd )->Show();
-
- // Size of dialog-window in screen pixels
- Rectangle aDlgRect( mpDialog->GetWindowExtentsRelative( NULL ) );
- Point aDlgPos ( aDlgRect.TopLeft() );
- Size aDlgSize ( mpDialog->GetSizePixel () );
-
- // Absolute size of the screen
- Rectangle aScreen( mpDialog->GetDesktopRectPixel() );
-
- // Size of Extrawindow
- Size aExtraWndSize( mpMarkWnd->GetSizePixel () );
-
- // mpMarkWnd is a child of mpDialog, so coordinates for positioning must be relative to mpDialog
- if( aDlgPos.X()+(1.05*aDlgSize.Width())+aExtraWndSize.Width() > aScreen.Right() )
- {
- if( aDlgPos.X() - ( 0.05*aDlgSize.Width() ) - aExtraWndSize.Width() < 0 )
- {
- // Pos Extrawindow anywhere
- MoveToExtraWnd( Point(10,10) ); // very unlikely
- mpMarkWnd->ConnectToDialog( FALSE );
- }
- else
- {
- // Pos Extrawindow on the left side of Dialog
- MoveToExtraWnd( Point(0,0) - Point( long(0.05*aDlgSize.Width()), 0 ) - Point( aExtraWndSize.Width(), 0 ) );
- }
- }
- else
- {
- // Pos Extrawindow on the right side of Dialog
- MoveToExtraWnd ( Point( long(1.05*aDlgSize.getWidth()), 0 ) );
- }
-
- // Set size of Extra-Window
- mpMarkWnd->SetSizePixel( Size( aExtraWndSize.Width(), aDlgSize.Height() ) );
-}
-
-/*************************************************************************
-|*
-|* Fill Dialogfields
-|*
-\************************************************************************/
-
-void SvxHyperlinkTabPageBase::FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem )
-{
- // Frame
- USHORT nPos = mpCbbFrame->GetEntryPos ( pHyperlinkItem->GetTargetFrame() );
- if ( nPos != LISTBOX_ENTRY_NOTFOUND)
- mpCbbFrame->SetText ( pHyperlinkItem->GetTargetFrame() );
-
- // Form
- String aStrFormText = SVX_RESSTR( RID_SVXSTR_HYPERDLG_FROM_TEXT );
- String aStrFormButton = SVX_RESSTR( RID_SVXSTR_HYPERDLG_FORM_BUTTON );
-
- if( pHyperlinkItem->GetInsertMode() & HLINK_HTMLMODE )
- {
- mpLbForm->Clear();
- mpLbForm->InsertEntry( aStrFormText );
- mpLbForm->SelectEntryPos ( 0 );
- }
- else
- {
- mpLbForm->Clear();
- mpLbForm->InsertEntry( aStrFormText );
- mpLbForm->InsertEntry( aStrFormButton );
- mpLbForm->SelectEntryPos ( pHyperlinkItem->GetInsertMode() == HLINK_BUTTON ? 1 : 0 );
- }
-
- // URL
- mpEdIndication->SetText ( pHyperlinkItem->GetName() );
-
- // Name
- mpEdText->SetText ( pHyperlinkItem->GetIntName() );
-
- // Script-button
- if ( !pHyperlinkItem->GetMacroEvents() )
- mpBtScript->Disable();
- else
- mpBtScript->Enable();
-}
-
-/*************************************************************************
-|*
-|* Any action to do after apply-button is pressed
-|*
-\************************************************************************/
-
-void SvxHyperlinkTabPageBase::DoApply ()
-{
- // default-implemtation : do nothing
-}
-
-/*************************************************************************
-|*
-|* Ask page whether an insert is possible
-|*
-\************************************************************************/
-
-BOOL SvxHyperlinkTabPageBase::AskApply ()
-{
- // default-implementation
- return TRUE;
-}
-
-/*************************************************************************
-|*
-|* This method would be called from bookmark-window to set new mark-string
-|*
-\************************************************************************/
-
-void SvxHyperlinkTabPageBase::SetMarkStr ( String& /*aStrMark*/ )
-{
- // default-implemtation : do nothing
-}
-
-/*************************************************************************
-|*
-|* This method will be called from the dialog-class if the state off
-|* the online-mode has changed.
-|*
-\************************************************************************/
-
-void SvxHyperlinkTabPageBase::SetOnlineMode( BOOL /*bEnable*/ )
-{
- // default-implemtation : do nothing
-}
-
-/*************************************************************************
-|*
-|* Set initial focus
-|*
-|************************************************************************/
-
-void SvxHyperlinkTabPageBase::SetInitFocus()
-{
- GrabFocus();
-}
-
-/*************************************************************************
-|*
-|* Ask dialog whether the curretn doc is a HTML-doc
-|*
-|************************************************************************/
-
-BOOL SvxHyperlinkTabPageBase::IsHTMLDoc() const
-{
- return ((SvxHpLinkDlg*)mpDialog)->IsHTMLDoc();
-}
-
-/*************************************************************************
-|*
-|* retrieve dispatcher
-|*
-|************************************************************************/
-
-SfxDispatcher* SvxHyperlinkTabPageBase::GetDispatcher() const
-{
- return ((SvxHpLinkDlg*)mpDialog)->GetDispatcher();
-}
-
-/*************************************************************************
-|*
-|* Click on imagebutton : Script
-|*
-|************************************************************************/
-
-IMPL_LINK ( SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, void *, EMPTYARG )
-{
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- GetItemSet().GetItem (SID_HYPERLINK_GETLINK);
-
- if ( pHyperlinkItem->GetMacroEvents() )
- {
- // get macros from itemset
- const SvxMacroTableDtor* pMacroTbl = pHyperlinkItem->GetMacroTbl();
- SvxMacroItem aItem ( GetWhich(SID_ATTR_MACROITEM) );
- if( pMacroTbl )
- aItem.SetMacroTable( *pMacroTbl );
-
- // create empty itemset for macro-dlg
- SfxItemSet* pItemSet = new SfxItemSet(SFX_APP()->GetPool(),
- SID_ATTR_MACROITEM,
- SID_ATTR_MACROITEM );
- pItemSet->Put ( aItem, SID_ATTR_MACROITEM );
-
- // --> PB 2006-01-13 #123474#
- /* disable HyperLinkDlg for input while the MacroAssignDlg is working
- because if no JAVA is installed an error box occurs and then it is possible
- to close the HyperLinkDlg before its child (MacroAssignDlg) -> GPF
- */
- BOOL bIsInputEnabled = GetParent()->IsInputEnabled();
- if ( bIsInputEnabled )
- GetParent()->EnableInput( FALSE );
- // <--
- SfxMacroAssignDlg aDlg( this, mxDocumentFrame, *pItemSet );
-
- // add events
- SfxMacroTabPage *pMacroPage = (SfxMacroTabPage*) aDlg.GetTabPage();
-
- if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOVER_OBJECT )
- pMacroPage->AddEvent( String( SVX_RESSTR(RID_SVXSTR_HYPDLG_MACROACT1) ),
- SFX_EVENT_MOUSEOVER_OBJECT );
- if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSECLICK_OBJECT )
- pMacroPage->AddEvent( String( SVX_RESSTR(RID_SVXSTR_HYPDLG_MACROACT2) ),
- SFX_EVENT_MOUSECLICK_OBJECT);
- if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOUT_OBJECT )
- pMacroPage->AddEvent( String( SVX_RESSTR(RID_SVXSTR_HYPDLG_MACROACT3) ),
- SFX_EVENT_MOUSEOUT_OBJECT);
-
- // --> PB 2006-01-13 #123474#
- if ( bIsInputEnabled )
- GetParent()->EnableInput( TRUE );
- // <--
- // execute dlg
- DisableClose( sal_True );
- short nRet = aDlg.Execute();
- DisableClose( sal_False );
- if ( RET_OK == nRet )
- {
- const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, FALSE, &pItem ))
- {
- pHyperlinkItem->SetMacroTable( ((SvxMacroItem*)pItem)->GetMacroTable() );
- }
- }
- delete pItemSet;
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Get Macro-Infos
-|*
-|************************************************************************/
-
-USHORT SvxHyperlinkTabPageBase::GetMacroEvents()
-{
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- GetItemSet().GetItem (SID_HYPERLINK_GETLINK);
-
- return pHyperlinkItem->GetMacroEvents();
-}
-
-SvxMacroTableDtor* SvxHyperlinkTabPageBase::GetMacroTable()
-{
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- GetItemSet().GetItem (SID_HYPERLINK_GETLINK);
-
- return ( (SvxMacroTableDtor*)pHyperlinkItem->GetMacroTbl() );
-}
-
-/*************************************************************************
-|*
-|* Does the given file exists ?
-|*
-|************************************************************************/
-
-BOOL SvxHyperlinkTabPageBase::FileExists( const INetURLObject& rURL )
-{
- BOOL bRet = FALSE;
-
- if( rURL.GetFull().getLength() > 0 )
- {
- try
- {
- Content aCnt( rURL.GetMainURL( INetURLObject::NO_DECODE ), ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- ::rtl::OUString aTitle;
-
- aCnt.getPropertyValue( ::rtl::OUString::createFromAscii( "Title" ) ) >>= aTitle;
- bRet = ( aTitle.getLength() > 0 );
- }
- catch( ... )
- {
- DBG_ERROR( "FileExists: ucb error" );
- }
- }
-
- return bRet;
-}
-
-/*************************************************************************
-|*
-|* try to detect the current protocol that is used in aStrURL
-|*
-|************************************************************************/
-
-String SvxHyperlinkTabPageBase::GetSchemeFromURL( String aStrURL )
-{
- String aStrScheme;
-
- INetURLObject aURL( aStrURL );
- INetProtocol aProtocol = aURL.GetProtocol();
-
- // #77696#
- // our new INetUrlObject now has the ability
- // to detect if an Url is valid or not :-(
- if ( aProtocol == INET_PROT_NOT_VALID )
- {
- if ( aStrURL.EqualsIgnoreCaseAscii( INET_HTTP_SCHEME, 0, 7 ) )
- {
- aStrScheme = String::CreateFromAscii( INET_HTTP_SCHEME );
- }
- else if ( aStrURL.EqualsIgnoreCaseAscii( INET_HTTPS_SCHEME, 0, 8 ) )
- {
- aStrScheme = String::CreateFromAscii( INET_HTTPS_SCHEME );
- }
- else if ( aStrURL.EqualsIgnoreCaseAscii( INET_FTP_SCHEME, 0, 6 ) )
- {
- aStrScheme = String::CreateFromAscii( INET_FTP_SCHEME );
- }
- else if ( aStrURL.EqualsIgnoreCaseAscii( INET_MAILTO_SCHEME, 0, 7 ) )
- {
- aStrScheme = String::CreateFromAscii( INET_MAILTO_SCHEME );
- }
- else if ( aStrURL.EqualsIgnoreCaseAscii( INET_NEWS_SCHEME, 0, 5 ) )
- {
- aStrScheme = String::CreateFromAscii( INET_NEWS_SCHEME );
- }
- else if ( aStrURL.EqualsIgnoreCaseAscii( INET_TELNET_SCHEME, 0, 9 ) )
- {
- aStrScheme = String::CreateFromAscii( INET_TELNET_SCHEME );
- }
- }
- else
- aStrScheme = INetURLObject::GetScheme( aProtocol );
- return aStrScheme;
-}
-
-
-void SvxHyperlinkTabPageBase::GetDataFromCommonFields( String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode )
-{
- aStrIntName = mpEdText->GetText();
- aStrName = mpEdIndication->GetText();
- aStrFrame = mpCbbFrame->GetText();
- eMode = (SvxLinkInsertMode) (mpLbForm->GetSelectEntryPos()+1);
- if( IsHTMLDoc() )
- eMode = (SvxLinkInsertMode) ( UINT16(eMode) | HLINK_HTMLMODE );
-}
-
-/*************************************************************************
-|*
-|* reset dialog-fields
-|*
-|************************************************************************/
-
-void SvxHyperlinkTabPageBase::Reset( const SfxItemSet& rItemSet)
-{
- ///////////////////////////////////////
- // Set dialog-fields from create-itemset
- maStrInitURL = aEmptyStr;
-
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- rItemSet.GetItem (SID_HYPERLINK_GETLINK);
-
- if ( pHyperlinkItem )
- {
- // set dialog-fields
- FillStandardDlgFields (pHyperlinkItem);
-
- // set all other fields
- FillDlgFields ( (String&)pHyperlinkItem->GetURL() );
-
- // Store initial URL
- maStrInitURL = pHyperlinkItem->GetURL();
- }
-}
-
-/*************************************************************************
-|*
-|* Fill output-ItemSet
-|*
-|************************************************************************/
-
-BOOL SvxHyperlinkTabPageBase::FillItemSet( SfxItemSet& rOut)
-{
- String aStrURL, aStrName, aStrIntName, aStrFrame;
- SvxLinkInsertMode eMode;
-
- GetCurentItemData ( aStrURL, aStrName, aStrIntName, aStrFrame, eMode);
- if ( !aStrName.Len() ) //automatically create a visible name if the link is created without name
- aStrName = CreateUiNameFromURL(aStrURL);
-
- USHORT nEvents = GetMacroEvents();
- SvxMacroTableDtor* pTable = GetMacroTable();
-
- SvxHyperlinkItem aItem( SID_HYPERLINK_SETLINK, aStrName, aStrURL, aStrFrame,
- aStrIntName, eMode, nEvents, pTable );
- rOut.Put (aItem);
-
- return TRUE;
-}
-
-String SvxHyperlinkTabPageBase::CreateUiNameFromURL( const String& aStrURL )
-{
- String aStrUiURL;
- INetURLObject aURLObj( aStrURL );
-
- switch(aURLObj.GetProtocol())
- {
- case INET_PROT_FILE:
- utl::LocalFileHelper::ConvertURLToSystemPath( aURLObj.GetMainURL(INetURLObject::NO_DECODE), aStrUiURL );
- break;
- case INET_PROT_FTP :
- {
- //remove password from name
- INetURLObject aTmpURL(aURLObj);
- aTmpURL.SetPass(aEmptyStr);
- aStrUiURL = aTmpURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
- }
- break;
- default :
- {
- aStrUiURL = aURLObj.GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS);
- }
- }
- if(!aStrUiURL.Len())
- return aStrURL;
- return aStrUiURL;
-}
-
-/*************************************************************************
-|*
-|* Activate / Deactivate Tabpage
-|*
-|************************************************************************/
-
-void SvxHyperlinkTabPageBase::ActivatePage( const SfxItemSet& rItemSet )
-{
- ///////////////////////////////////////
- // Set dialog-fields from input-itemset
- SvxHyperlinkItem *pHyperlinkItem = (SvxHyperlinkItem *)
- rItemSet.GetItem (SID_HYPERLINK_GETLINK);
-
- if ( pHyperlinkItem )
- {
- // standard-fields
- FillStandardDlgFields (pHyperlinkItem);
- }
-
- // show mark-window if it was open before
- if ( ShouldOpenMarkWnd () )
- ShowMarkWnd ();
-}
-
-int SvxHyperlinkTabPageBase::DeactivatePage( SfxItemSet* _pSet)
-{
- // hide mark-wnd
- SetMarkWndShouldOpen( IsMarkWndVisible () );
- HideMarkWnd ();
-
- // retrieve data of dialog
- String aStrURL, aStrName, aStrIntName, aStrFrame;
- SvxLinkInsertMode eMode;
-
- GetCurentItemData ( aStrURL, aStrName, aStrIntName, aStrFrame, eMode);
-
- USHORT nEvents = GetMacroEvents();
- SvxMacroTableDtor* pTable = GetMacroTable();
-
- if( _pSet )
- {
- SvxHyperlinkItem aItem( SID_HYPERLINK_GETLINK, aStrName, aStrURL, aStrFrame,
- aStrIntName, eMode, nEvents, pTable );
- _pSet->Put( aItem );
- }
-
- return( LEAVE_PAGE );
-}
-
-BOOL SvxHyperlinkTabPageBase::ShouldOpenMarkWnd()
-{
- return FALSE;
-}
-
-void SvxHyperlinkTabPageBase::SetMarkWndShouldOpen(BOOL)
-{
-}
diff --git a/svx/source/cui/hltpbase.hxx b/svx/source/cui/hltpbase.hxx
deleted file mode 100644
index 6a8ed9a030..0000000000
--- a/svx/source/cui/hltpbase.hxx
+++ /dev/null
@@ -1,218 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hltpbase.hxx,v $
- * $Revision: 1.8.216.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABBASE_HYPERLINK_HXX
-#define _SVX_TABBASE_HYPERLINK_HXX
-
-#define INET_TELNET_SCHEME "telnet://"
-
-#include <sfx2/app.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <vcl/group.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/fixed.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/transfer.hxx>
-#include <sfx2/dispatch.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <svtools/inettbc.hxx>
-#include <vcl/timer.hxx>
-
-#include <svx/dialmgr.hxx>
-#include <sfx2/docfile.hxx>
-#include <svx/dialogs.hrc>
-
-#include <com/sun/star/frame/XFrame.hpp>
-
-#ifndef _SVX_HELPID_HRC
-#include "helpid.hrc"
-#endif
-
-#include "hlnkitem.hxx"
-
-#include "hlmarkwn.hxx"
-#include "iconcdlg.hxx"
-
-
-/*************************************************************************
-|*
-|* ComboBox-Control, wich is filled with all current framenames
-|*
-\************************************************************************/
-
-class SvxFramesComboBox : public ComboBox
-{
-public:
- SvxFramesComboBox (Window* pParent, const ResId& rResId, SfxDispatcher* pDispatch);
- ~SvxFramesComboBox ();
-};
-
-/*************************************************************************
-|*
-|* ComboBox-Control for URL's with History and Autocompletion
-|*
-\************************************************************************/
-
-class SvxHyperURLBox : public SvtURLBox, public DropTargetHelper
-{
-private:
- BOOL mbAccessAddress;
-
-// String GetAllEmailNamesFromDragItem( USHORT nItem );
-
-protected:
-
- virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
- virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
-
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void Select();
- virtual void Modify();
- virtual long PreNotify( NotifyEvent& rNEvt );
-
-public:
- SvxHyperURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_FILE, BOOL bAddresses = FALSE );
-
-};
-
-/*************************************************************************
-|*
-|* Tabpage : Basisclass
-|*
-\************************************************************************/
-
-class SvxHyperlinkTabPageBase : public IconChoicePage
-{
-private:
- FixedLine *mpGrpMore;
- FixedText *mpFtFrame;
- SvxFramesComboBox *mpCbbFrame;
- FixedText *mpFtForm;
- ListBox *mpLbForm;
- FixedText *mpFtIndication;
- Edit *mpEdIndication;
- FixedText *mpFtText;
- Edit *mpEdText;
- ImageButton *mpBtScript;
-
- sal_Bool mbIsCloseDisabled;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
- mxDocumentFrame;
-
-protected:
- Window* mpDialog;
-
- BOOL mbStdControlsInit;
-
- String maStrInitURL;
-
- Timer maTimer;
-
- SvxHlinkDlgMarkWnd* mpMarkWnd;
-
- void InitStdControls ();
- virtual void FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem );
- virtual void FillDlgFields ( String& aStrURL ) = 0;
- virtual void GetCurentItemData ( String& aStrURL, String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode ) = 0;
- virtual String CreateUiNameFromURL( const String& aStrURL );
-
- void GetDataFromCommonFields( String& aStrName,
- String& aStrIntName, String& aStrFrame,
- SvxLinkInsertMode& eMode );
-
- DECL_LINK (ClickScriptHdl_Impl, void * ); // Button : Script
-
- String aEmptyStr;
-
- BOOL FileExists( const INetURLObject& rURL );
- static String GetSchemeFromURL( String aStrURL );
-
- inline void DisableClose( sal_Bool _bDisable ) { mbIsCloseDisabled = _bDisable; }
-
-public:
- SvxHyperlinkTabPageBase (
- Window *pParent,
- const ResId &rResId,
- const SfxItemSet& rItemSet
- );
- virtual ~SvxHyperlinkTabPageBase ();
-
- void SetDocumentFrame(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame )
- {
- mxDocumentFrame = rxDocumentFrame;
- }
-
- virtual BOOL AskApply ();
- virtual void DoApply ();
- virtual void SetOnlineMode( BOOL bEnable );
- virtual void SetInitFocus();
- virtual void SetMarkStr ( String& aStrMark );
- virtual void Reset( const SfxItemSet& );
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void ActivatePage( const SfxItemSet& rItemSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
- BOOL IsMarkWndVisible () { return ((Window*)mpMarkWnd)->IsVisible(); }
- Size GetSizeExtraWnd () { return ( mpMarkWnd->GetSizePixel() ); }
- BOOL MoveToExtraWnd ( Point aNewPos, BOOL bDisConnectDlg = FALSE );
-
- virtual void ActivatePage();
- virtual void DeactivatePage();
- virtual sal_Bool QueryClose();
-
-protected:
- virtual BOOL ShouldOpenMarkWnd();
- virtual void SetMarkWndShouldOpen(BOOL bOpen);
-
- void ShowMarkWnd ();
- void HideMarkWnd () { ( ( Window* ) mpMarkWnd )->Hide(); }
- void InvalidateMarkWnd () { ( ( Window* ) mpMarkWnd )->Invalidate(); }
-
- SfxDispatcher* GetDispatcher() const;
-
- USHORT GetMacroEvents();
- SvxMacroTableDtor* GetMacroTable();
-
- BOOL IsHTMLDoc() const;
-};
-
-#endif // _SVX_TABBASE_HYPERLINK_HXX
-
diff --git a/svx/source/cui/iconcdlg.cxx b/svx/source/cui/iconcdlg.cxx
deleted file mode 100644
index 7bd9843fb2..0000000000
--- a/svx/source/cui/iconcdlg.cxx
+++ /dev/null
@@ -1,1445 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: iconcdlg.cxx,v $
- * $Revision: 1.24 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <sfx2/app.hxx>
-#include <tools/rc.h>
-#include <tools/shl.hxx>
-
-#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
-#include <svx/dialmgr.hxx>
-
-#include "iconcdlg.hxx"
-
-#ifndef _SVX_HELPID_HRC
-#include "helpid.hrc"
-#endif
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include <svtools/viewoptions.hxx>
-#include <svtools/apearcfg.hxx>
-#include <vcl/mnemonic.hxx>
-#include <vcl/i18nhelp.hxx>
-
-#ifdef WNT
-int __cdecl IconcDlgCmpUS_Impl( const void* p1, const void* p2 )
-#else
-#if defined(OS2) && defined(ICC)
-int _Optlink IconcDlgCmpUS_Impl( const void* p1, const void* p2 )
-#else
-int IconcDlgCmpUS_Impl( const void* p1, const void* p2 )
-#endif
-#endif
-{
- return *(USHORT*)p1 - *(USHORT*)p2;
-}
-
-// some stuff for easier changes for SvtViewOptions
-static const sal_Char* pViewOptDataName = "dialog data";
-#define VIEWOPT_DATANAME ::rtl::OUString::createFromAscii( pViewOptDataName )
-
-static inline void SetViewOptUserItem( SvtViewOptions& rOpt, const String& rData )
-{
- rOpt.SetUserItem( VIEWOPT_DATANAME, ::com::sun::star::uno::makeAny( ::rtl::OUString( rData ) ) );
-}
-
-static inline String GetViewOptUserItem( const SvtViewOptions& rOpt )
-{
- ::com::sun::star::uno::Any aAny( rOpt.GetUserItem( VIEWOPT_DATANAME ) );
- ::rtl::OUString aUserData;
- aAny >>= aUserData;
-
- return String( aUserData );
-}
-
-
-//#####################################################################
-//
-// Class IconChoicePage
-//
-//#####################################################################
-
-/**********************************************************************
-|
-| Ctor / Dtor
-|
-\**********************************************************************/
-
-IconChoicePage::IconChoicePage( Window *pParent, const ResId &rResId,
- const SfxItemSet &rAttrSet )
-: TabPage ( pParent, rResId ),
- pSet ( &rAttrSet ),
- bHasExchangeSupport ( FALSE ),
- pDialog ( NULL ),
- bStandard ( FALSE )
-{
- SetStyle ( GetStyle() | WB_DIALOGCONTROL | WB_HIDE );
-}
-
-// -----------------------------------------------------------------------
-
-IconChoicePage::~IconChoicePage()
-{
-}
-
-/**********************************************************************
-|
-| Activate / Deaktivate
-|
-\**********************************************************************/
-
-void IconChoicePage::ActivatePage( const SfxItemSet& )
-{
-}
-
-// -----------------------------------------------------------------------
-
-int IconChoicePage::DeactivatePage( SfxItemSet* )
-{
- return LEAVE_PAGE;
-}
-
-/**********************************************************************
-|
-| ...
-|
-\**********************************************************************/
-
-void IconChoicePage::FillUserData()
-{
-}
-
-// -----------------------------------------------------------------------
-
-BOOL IconChoicePage::IsReadOnly() const
-{
- return FALSE;
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool IconChoicePage::QueryClose()
-{
- return sal_True;
-}
-
-/**********************************************************************
-|
-| handling itemsets
-|
-\**********************************************************************/
-
-const SfxPoolItem* IconChoicePage::GetItem( const SfxItemSet& rSet,
- USHORT nSlot )
-{
- const SfxItemPool* pPool = rSet.GetPool();
- USHORT nWh = pPool->GetWhich( nSlot );
- const SfxPoolItem* pItem = 0;
- rSet.GetItemState( nWh, TRUE, &pItem );
-
- if ( !pItem && nWh != nSlot )
- pItem = &pPool->GetDefaultItem( nWh );
-
- return pItem;
-}
-
-// -----------------------------------------------------------------------
-
-const SfxPoolItem* IconChoicePage::GetOldItem( const SfxItemSet& rSet,
- USHORT nSlot )
-{
- const SfxItemSet& rOldSet = GetItemSet();
- USHORT nWh = GetWhich( nSlot );
- const SfxPoolItem* pItem = 0;
-
- if ( bStandard && rOldSet.GetParent() )
- pItem = GetItem( *rOldSet.GetParent(), nSlot );
- else if ( rSet.GetParent() && SFX_ITEM_DONTCARE == rSet.GetItemState( nWh ) )
- pItem = GetItem( *rSet.GetParent(), nSlot );
- else
- pItem = GetItem( rOldSet, nSlot );
-
- return pItem;
-}
-
-// -----------------------------------------------------------------------
-
-const SfxPoolItem* IconChoicePage::GetExchangeItem( const SfxItemSet& rSet,
- USHORT nSlot )
-{
- if ( pDialog && !pDialog->IsInOK() && pDialog->GetExampleSet() )
- return GetItem( *pDialog->GetExampleSet(), nSlot );
- else
- return GetOldItem( rSet, nSlot );
-}
-
-/**********************************************************************
-|
-| window-methods
-|
-\**********************************************************************/
-
-void IconChoicePage::ImplInitSettings()
-{
- Window* pParent = GetParent();
- if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() )
- {
- EnableChildTransparentMode( TRUE );
- SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- SetPaintTransparent( TRUE );
- SetBackground();
- }
- else
- {
- EnableChildTransparentMode( FALSE );
- SetParentClipMode( 0 );
- SetPaintTransparent( FALSE );
-
- if ( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( pParent->GetBackground() );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoicePage::StateChanged( StateChangedType nType )
-{
- Window::StateChanged( nType );
-
- if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
- {
- ImplInitSettings();
- Invalidate();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoicePage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Window::DataChanged( rDCEvt );
-
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- ImplInitSettings();
- Invalidate();
- }
-}
-
-//#####################################################################
-//
-// Class IconChoiceDialog
-//
-//#####################################################################
-
-/**********************************************************************
-|
-| Ctor / Dtor
-|
-\**********************************************************************/
-
-IconChoiceDialog::IconChoiceDialog ( Window* pParent, const ResId &rResId,
- const EIconChoicePos ePos,
- const SfxItemSet *pItemSet )//, BOOL bEditFmt, const String *pUserButtonText = 0 )
-: ModalDialog ( pParent, rResId ),
- meChoicePos ( ePos ),
- maIconCtrl ( this, WB_3DLOOK | WB_ICON | WB_BORDER |
- WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
- /* WB_NOSELECTION | */ WB_NODRAGSELECTION | WB_TABSTOP ),
- mnCurrentPageId ( USHRT_MAX ),
-
- aOKBtn ( this, WB_DEFBUTTON ),
- aCancelBtn ( this, WB_DEFBUTTON ),
- aHelpBtn ( this ),
- aResetBtn ( this ),
- pSet ( pItemSet ),
- pOutSet ( NULL ),
- pExampleSet ( NULL ),
- pRanges ( NULL ),
- nResId ( rResId.GetId() ),
-
- bHideResetBtn ( FALSE ),
- bModal ( FALSE ),
- bInOK ( FALSE ),
- bModified ( FALSE ),
- bItemsReset ( FALSE )
-{
- // IconChoiceCtrl-Settings
- //maIconCtrl.SetBackground ( Wallpaper( Color (146, 146, 186) ) );
-
- maIconCtrl.SetStyle (WB_3DLOOK | WB_ICON | WB_BORDER | WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME | /* WB_NOSELECTION | */ WB_NODRAGSELECTION | WB_TABSTOP | WB_CLIPCHILDREN );
- SetCtrlPos ( meChoicePos );
- maIconCtrl.SetClickHdl ( LINK ( this, IconChoiceDialog , ChosePageHdl_Impl ) );
- maIconCtrl.Show();
- maIconCtrl.SetChoiceWithCursor ( TRUE );
- maIconCtrl.SetSelectionMode( SINGLE_SELECTION );
- maIconCtrl.SetHelpId( HID_ICCDIALOG_CHOICECTRL );
-
- // ItemSet
- if ( pSet )
- {
- pExampleSet = new SfxItemSet( *pSet );
- pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
- }
-
- // Buttons
- aOKBtn.SetClickHdl ( LINK( this, IconChoiceDialog, OkHdl ) );
- aOKBtn.SetHelpId( HID_ICCDIALOG_OK_BTN );
- aCancelBtn.SetHelpId( HID_ICCDIALOG_CANCEL_BTN );
- aResetBtn.SetClickHdl( LINK( this, IconChoiceDialog, ResetHdl ) );
- aResetBtn.SetText( SVX_RESSTR(RID_SVXSTR_ICONCHOICEDLG_RESETBUT) );
- aResetBtn.SetHelpId( HID_ICCDIALOG_RESET_BTN );
- aOKBtn.Show();
- aCancelBtn.Show();
- aHelpBtn.Show();
- aResetBtn.Show();
-
- SetPosSizeCtrls ( TRUE );
-}
-
-// -----------------------------------------------------------------------
-
-/*
-IconChoiceDialog ::IconChoiceDialog ( SfxViewFrame *pViewFrame, Window* pParent, const ResId &rResId,
- const SfxItemSet * = 0, BOOL bEditFmt = FALSE,
- const String *pUserButtonText = 0 )
-: meChoicePos ( PosLeft ), // Default erst ma Links
- maIconCtrl ( this, Die_Winbits ),
- aOKBtn ( this ),
- pUserBtn ( pUserButtonText? new PushButton(this): 0 ),
- aCancelBtn ( this ),
- aHelpBtn ( this ),
- aResetBtn ( this ),
- aBaseFmtBtn ( this ),
- mnCurrentPageId ( 0 )
-{
- FreeResource();
-}
-*/
-
-// -----------------------------------------------------------------------
-
-IconChoiceDialog ::~IconChoiceDialog ()
-{
- ULONG i;
-
- // save configuration at INI-Manager
- // and remove pages
- SvtViewOptions aTabDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
- aTabDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)).GetBuffer() ) );
- aTabDlgOpt.SetPageID( mnCurrentPageId );
-
- const ULONG nCount = maPageList.Count();
-
- for ( i = 0; i < nCount; ++i )
- {
- IconChoicePageData* pData = maPageList.GetObject(i);
-
- if ( pData->pPage )
- {
- pData->pPage->FillUserData();
- String aPageData(pData->pPage->GetUserData());
- if ( aPageData.Len() )
- {
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) );
-
- SetViewOptUserItem( aTabPageOpt, aPageData );
- }
-
- if ( pData->bOnDemand )
- delete (SfxItemSet*)&pData->pPage->GetItemSet();
- delete pData->pPage;
- }
- delete pData;
- }
-
- // remove Pagelist
-/* for ( i=0; i<maPageList.Count(); i++ )
- {
- IconChoicePageData* pData = (IconChoicePageData*)maPageList.GetObject ( i );
-
- if ( pData->bOnDemand )
- delete ( SfxItemSet * )&( pData->pPage->GetItemSet() );
-
- delete pData->pPage;
- delete pData;
- }*/
-
- // remove Userdata from Icons
- for ( i=0; i<maIconCtrl.GetEntryCount(); i++)
- {
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.GetEntry ( i );
- USHORT* pUserData = (USHORT*) pEntry->GetUserData();
- delete pUserData;
- }
-
- //
- if ( pRanges )
- delete pRanges;
- if ( pOutSet )
- delete pOutSet;
-}
-
-/**********************************************************************
-|
-| add new page
-|
-\**********************************************************************/
-
-SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage( USHORT nId, const String& rIconText,
- const Image& rChoiceIcon,
- CreatePage pCreateFunc /* != 0 */,
- GetPageRanges pRangesFunc /* darf 0 sein */,
- BOOL bItemsOnDemand, ULONG /*nPos*/ )
-{
- IconChoicePageData* pData = new IconChoicePageData ( nId, pCreateFunc,
- pRangesFunc,
- bItemsOnDemand );
- maPageList.Insert ( pData, LIST_APPEND );
-
- pData->fnGetRanges = pRangesFunc;
- pData->bOnDemand = bItemsOnDemand;
-
- USHORT *pId = new USHORT ( nId );
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.InsertEntry( rIconText, rChoiceIcon );
- pEntry->SetUserData ( (void*) pId );
- return pEntry;
-}
-
-SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage( USHORT nId, const String& rIconText,
- const Image& rChoiceIcon,
- const Image& rChoiceIconHC,
- CreatePage pCreateFunc /* != 0 */,
- GetPageRanges pRangesFunc /* darf 0 sein */,
- BOOL bItemsOnDemand, ULONG /*nPos*/ )
-{
- IconChoicePageData* pData = new IconChoicePageData ( nId, pCreateFunc,
- pRangesFunc,
- bItemsOnDemand );
- maPageList.Insert ( pData, LIST_APPEND );
-
- pData->fnGetRanges = pRangesFunc;
- pData->bOnDemand = bItemsOnDemand;
-
- USHORT *pId = new USHORT ( nId );
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.InsertEntry( rIconText, rChoiceIcon, rChoiceIconHC );
- pEntry->SetUserData ( (void*) pId );
- return pEntry;
-}
-
-/**********************************************************************
-|
-| remove page
-|
-\**********************************************************************/
-
-void IconChoiceDialog::RemoveTabPage( USHORT nId )
-{
- IconChoicePageData* pData = GetPageData ( nId );
-
- // remove page from list
- if ( pData )
- {
- maPageList.Remove ( pData );
-
- // save settings
- if ( pData->pPage )
- {
- pData->pPage->FillUserData();
- String aPageData(pData->pPage->GetUserData());
- if ( aPageData.Len() )
- {
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) );
-
- SetViewOptUserItem( aTabPageOpt, aPageData );
- }
- }
-
- if ( pData->bOnDemand )
- delete ( SfxItemSet * )&( pData->pPage->GetItemSet() );
-
- delete pData->pPage;
- delete pData;
- }
-
- // remove Icon
- BOOL bFound=FALSE;
- for ( ULONG i=0; i<maIconCtrl.GetEntryCount() && !bFound; i++)
- {
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.GetEntry ( i );
- USHORT* pUserData = (USHORT*) pEntry->GetUserData();
-
- if ( *pUserData == nId )
- {
- delete pUserData;
- maIconCtrl.RemoveEntry ( pEntry );
- bFound = TRUE;
- }
- }
-
- // was it the current page ?
- if ( nId == mnCurrentPageId )
- {
- mnCurrentPageId = maPageList.First()->nId;
- }
-
- Invalidate ();
-}
-
-/**********************************************************************
-|
-| Paint-method
-|
-\**********************************************************************/
-
-void IconChoiceDialog::Paint( const Rectangle& rRect )
-{
- Dialog::Paint ( rRect );
-
- for ( ULONG i=0; i<maPageList.Count(); i++ )
- {
- IconChoicePageData* pData = (IconChoicePageData*)maPageList.GetObject ( i );
-
- if ( pData->nId == mnCurrentPageId )
- {
- ShowPageImpl ( pData );
- }
- else
- {
- HidePageImpl ( pData );
- }
- }
-}
-
-EIconChoicePos IconChoiceDialog::SetCtrlPos( const EIconChoicePos& rPos )
-{
- WinBits aWinBits = maIconCtrl.GetStyle ();
-
- switch ( meChoicePos )
- {
- case PosLeft :
- aWinBits &= ~WB_ALIGN_TOP & ~WB_NOVSCROLL;
- aWinBits |= WB_ALIGN_LEFT | WB_NOHSCROLL;
- break;
- case PosRight :
- aWinBits &= ~WB_ALIGN_TOP & ~WB_NOVSCROLL;
- aWinBits |= WB_ALIGN_LEFT | WB_NOHSCROLL;
- break;
- case PosTop :
- aWinBits &= ~WB_ALIGN_LEFT & ~WB_NOHSCROLL;
- aWinBits |= WB_ALIGN_TOP | WB_NOVSCROLL;
- break;
- case PosBottom :
- aWinBits &= ~WB_ALIGN_LEFT & ~WB_NOHSCROLL;
- aWinBits |= WB_ALIGN_TOP | WB_NOVSCROLL;
- break;
- };
- maIconCtrl.SetStyle ( aWinBits );
-
- SetPosSizeCtrls();
-
-
- EIconChoicePos eOldPos = meChoicePos;
- meChoicePos = rPos;
-
- return eOldPos;
-}
-
-void IconChoiceDialog::SetCtrlColor ( const Color& rColor )
-{
- Wallpaper aWallpaper ( rColor );
- maIconCtrl.SetBackground( aWallpaper );
- maIconCtrl.SetFontColorToBackground ();
-}
-
-/**********************************************************************
-|
-| Show / Hide page or button
-|
-\**********************************************************************/
-
-void IconChoiceDialog::ShowPageImpl ( IconChoicePageData* pData )
-{
- if ( pData->pPage )
- pData->pPage->Show();
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::HidePageImpl ( IconChoicePageData* pData )
-{
- if ( pData->pPage )
- pData->pPage->Hide();
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::RemoveResetButton()
-{
- aResetBtn.Hide();
- bHideResetBtn = TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::ShowPage( USHORT nId )
-{
- bool bInvalidate = GetCurPageId() != nId;
- SetCurPageId( nId );
- ActivatePageImpl( );
- if(bInvalidate)
- Invalidate();
-}
-
-/**********************************************************************
-|
-| Resize Dialog
-|
-\**********************************************************************/
-
-#define ICONCTRL_WIDTH_PIXEL 110
-#define ICONCTRL_HEIGHT_PIXEL 75
-#define MINSIZE_BUTTON_WIDTH 70
-#define MINSIZE_BUTTON_HEIGHT 22
-
-void IconChoiceDialog::Resize()
-{
- Dialog::Resize ();
-
- if ( IsReallyVisible() )
- {
- SetPosSizeCtrls ();
- }
-}
-
-void IconChoiceDialog::SetPosSizeCtrls ( BOOL bInit )
-{
- const Point aCtrlOffset ( LogicToPixel( Point( CTRLS_OFFSET, CTRLS_OFFSET ), MAP_APPFONT ) );
- Size aOutSize ( GetOutputSizePixel() );
-
- ////////////////////////////////////////
- // Button-Defaults
- //
- Size aDefaultButtonSize = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
-
- // Reset-Button
- Size aResetButtonSize ( bInit ? aDefaultButtonSize :
- aResetBtn.GetSizePixel () );
-
- ////////////////////////////////////////
- // IconChoiceCtrl resizen & positionieren
- //
- SvtTabAppearanceCfg aCfg;
- const long nDefaultWidth = (aCfg.GetScaleFactor() * ICONCTRL_WIDTH_PIXEL) / 100;
- const long nDefaultHeight = (aCfg.GetScaleFactor() * ICONCTRL_HEIGHT_PIXEL) / 100;
-
- Size aNewIconCtrlSize ( nDefaultWidth,
- aOutSize.Height()-(2*aCtrlOffset.X()) );
- Point aIconCtrlPos;
- switch ( meChoicePos )
- {
- case PosLeft :
- aIconCtrlPos = aCtrlOffset;
- aNewIconCtrlSize = Size ( nDefaultWidth,
- aOutSize.Height()-(2*aCtrlOffset.X()) );
- break;
- case PosRight :
- aIconCtrlPos = Point ( aOutSize.Width() - nDefaultWidth -
- aCtrlOffset.X(), aCtrlOffset.X() );
- aNewIconCtrlSize = Size ( nDefaultWidth,
- aOutSize.Height()-(2*aCtrlOffset.X()) );
- break;
- case PosTop :
- aIconCtrlPos = aCtrlOffset;
- aNewIconCtrlSize = Size ( aOutSize.Width()-(2*aCtrlOffset.X()),
- nDefaultHeight );
- break;
- case PosBottom :
- aIconCtrlPos = Point ( aCtrlOffset.X(), aOutSize.Height() -
- aResetButtonSize.Height() - (2*aCtrlOffset.X()) -
- nDefaultHeight );
- aNewIconCtrlSize = Size ( aOutSize.Width()-(2*aCtrlOffset.X()),
- nDefaultHeight );
- break;
- };
- maIconCtrl.SetPosSizePixel ( aIconCtrlPos, aNewIconCtrlSize );
- maIconCtrl.ArrangeIcons();
-
- ////////////////////////////////////////
- // Pages resizen & positionieren
- //
- for ( ULONG i=0; i<maPageList.Count(); i++ )
- {
- IconChoicePageData* pData = (IconChoicePageData*)maPageList.GetObject ( i );
-
- Point aNewPagePos;
- Size aNewPageSize;
- switch ( meChoicePos )
- {
- case PosLeft :
- aNewPagePos = Point ( aNewIconCtrlSize.Width() + (2*CTRLS_OFFSET),
- CTRLS_OFFSET );
- aNewPageSize = Size ( aOutSize.Width() - aNewIconCtrlSize.Width() -
- (3*CTRLS_OFFSET),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- (3*CTRLS_OFFSET) );
- break;
- case PosRight :
- aNewPagePos = aCtrlOffset;
- aNewPageSize = Size ( aOutSize.Width() - aNewIconCtrlSize.Width() -
- (3*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- (3*aCtrlOffset.X()) );
- break;
- case PosTop :
- aNewPagePos = Point ( aCtrlOffset.X(), aNewIconCtrlSize.Height() +
- (2*aCtrlOffset.X()) );
- aNewPageSize = Size ( aOutSize.Width() - (2*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- aNewIconCtrlSize.Height() - (4*aCtrlOffset.X()) );
- break;
- case PosBottom :
- aNewPagePos = aCtrlOffset;
- aNewPageSize = Size ( aOutSize.Width() - (2*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- aNewIconCtrlSize.Height() - (4*aCtrlOffset.X()) );
- break;
- };
-
- if ( pData->pPage )
- pData->pPage->SetPosSizePixel ( aNewPagePos, aNewPageSize );
- }
-
- ////////////////////////////////////////
- // Buttons positionieren
- //
- ULONG nXOffset=0;
- if ( meChoicePos == PosRight )
- nXOffset = aNewIconCtrlSize.Width()+(2*aCtrlOffset.X());
-
- aResetBtn.SetPosSizePixel ( Point( aOutSize.Width() - nXOffset -
- aResetButtonSize.Width()-aCtrlOffset.X(),
- aOutSize.Height()-aResetButtonSize.Height()-
- aCtrlOffset.X() ),
- aResetButtonSize );
- // Help-Button
- Size aHelpButtonSize ( bInit ? aDefaultButtonSize :
- aHelpBtn.GetSizePixel () );
- aHelpBtn.SetPosSizePixel ( Point( aOutSize.Width()-aResetButtonSize.Width()-
- aHelpButtonSize.Width()- nXOffset -
- (2*aCtrlOffset.X()),
- aOutSize.Height()-aHelpButtonSize.Height()-
- aCtrlOffset.X() ),
- aHelpButtonSize );
- // Cancel-Button
- Size aCancelButtonSize ( bInit ? aDefaultButtonSize :
- aCancelBtn.GetSizePixel () );
- aCancelBtn.SetPosSizePixel ( Point( aOutSize.Width()-aCancelButtonSize.Width()-
- aResetButtonSize.Width()-aHelpButtonSize.Width()-
- (3*aCtrlOffset.X()) - nXOffset,
- aOutSize.Height()-aCancelButtonSize.Height()-
- aCtrlOffset.X() ),
- aCancelButtonSize );
- // OK-Button
- Size aOKButtonSize ( bInit ? aDefaultButtonSize : aOKBtn.GetSizePixel () );
- aOKBtn.SetPosSizePixel ( Point( aOutSize.Width()-aOKButtonSize.Width()-
- aCancelButtonSize.Width()-aResetButtonSize.Width()-
- aHelpButtonSize.Width()-(4*aCtrlOffset.X())- nXOffset,
- aOutSize.Height()-aOKButtonSize.Height()-aCtrlOffset.X() ),
- aOKButtonSize );
-
- Invalidate();
-}
-
-void IconChoiceDialog::SetPosSizePages ( USHORT nId )
-{
- const Point aCtrlOffset ( LogicToPixel( Point( CTRLS_OFFSET, CTRLS_OFFSET ), MAP_APPFONT ) );
- IconChoicePageData* pData = GetPageData ( nId );
-
- if ( pData->pPage )
- {
- Size aOutSize ( GetOutputSizePixel() );
- Size aIconCtrlSize ( maIconCtrl.GetSizePixel() );
-
- Point aNewPagePos;
- Size aNewPageSize;
- switch ( meChoicePos )
- {
- case PosLeft :
- aNewPagePos = Point ( aIconCtrlSize.Width() + (2*aCtrlOffset.X()),
- aCtrlOffset.X() );
- aNewPageSize = Size ( aOutSize.Width() - maIconCtrl.GetSizePixel().Width() -
- (3*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- (3*aCtrlOffset.X()) );
- break;
- case PosRight :
- aNewPagePos = aCtrlOffset;
- aNewPageSize = Size ( aOutSize.Width() - maIconCtrl.GetSizePixel().Width() -
- (3*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- (3*aCtrlOffset.X()) );
- break;
- case PosTop :
- aNewPagePos = Point ( aCtrlOffset.X(), aIconCtrlSize.Height() +
- (2*aCtrlOffset.X()) );
- aNewPageSize = Size ( aOutSize.Width() - (2*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- maIconCtrl.GetSizePixel().Height() - (4*aCtrlOffset.X()) );
- break;
- case PosBottom :
- aNewPagePos = aCtrlOffset;
- aNewPageSize = Size ( aOutSize.Width() - (2*aCtrlOffset.X()),
- aOutSize.Height() - aOKBtn.GetSizePixel().Height() -
- maIconCtrl.GetSizePixel().Height() - (4*aCtrlOffset.X()) );
- break;
- };
-
- pData->pPage->SetPosSizePixel ( aNewPagePos, aNewPageSize );
- }
-}
-
-/**********************************************************************
-|
-| select a page
-|
-\**********************************************************************/
-
-IMPL_LINK ( IconChoiceDialog , ChosePageHdl_Impl, void *, EMPTYARG )
-{
- ULONG nPos;
-
- SvxIconChoiceCtrlEntry *pEntry = maIconCtrl.GetSelectedEntry ( nPos );
- if ( !pEntry )
- pEntry = maIconCtrl.GetCursor( );
-
- USHORT *pId = (USHORT*)pEntry->GetUserData ();
-
- if( *pId != mnCurrentPageId )
- {
- IconChoicePageData* pData = GetPageData ( mnCurrentPageId );
- if ( pData->pPage )
- DeActivatePageImpl();
-
- SetCurPageId ( *pId );
-
- ActivatePageImpl();
- Invalidate();
- }
-
- return 0L;
-}
-
-/**********************************************************************
-|
-| Button-handler
-|
-\**********************************************************************/
-
-IMPL_LINK( IconChoiceDialog, OkHdl, Button *, EMPTYARG )
-{
- bInOK = TRUE;
-
- if ( OK_Impl() )
- {
- if ( bModal )
- EndDialog( Ok() );
- else
- {
- Ok();
- Close();
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( IconChoiceDialog, ResetHdl, Button *, EMPTYARG )
-{
- ResetPageImpl ();
-
- IconChoicePageData* pData = GetPageData ( mnCurrentPageId );
- DBG_ASSERT( pData, "Id nicht bekannt" );
-
- if ( pData->bOnDemand )
- {
- // CSet auf AIS hat hier Probleme, daher getrennt
- const SfxItemSet* _pSet = &( pData->pPage->GetItemSet() );
- pData->pPage->Reset( *(SfxItemSet*)_pSet );
- }
- else
- pData->pPage->Reset( *pSet );
-
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( IconChoiceDialog, CancelHdl, Button*, EMPTYARG )
-{
- Close();
-
- return 0;
-}
-
-/**********************************************************************
-|
-| call page
-|
-\**********************************************************************/
-
-void IconChoiceDialog::ActivatePageImpl ()
-{
- DBG_ASSERT( maPageList.Count(), "keine Pages angemeldet" );
- IconChoicePageData* pData = GetPageData ( mnCurrentPageId );
- DBG_ASSERT( pData, "Id nicht bekannt" );
- if ( pData )
- {
- if ( !pData->pPage )
- {
- const SfxItemSet* pTmpSet = 0;
-
- if ( pSet )
- {
- if ( bItemsReset && pSet->GetParent() )
- pTmpSet = pSet->GetParent();
- else
- pTmpSet = pSet;
- }
-
- if ( pTmpSet && !pData->bOnDemand )
- pData->pPage = (pData->fnCreatePage)( this, *pTmpSet );
- else
- pData->pPage = (pData->fnCreatePage)( this, *CreateInputItemSet( mnCurrentPageId ) );
-
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) );
- pData->pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) );
- SetPosSizePages ( pData->nId );
-
- if ( pData->bOnDemand )
- pData->pPage->Reset( (SfxItemSet &)pData->pPage->GetItemSet() );
- else
- pData->pPage->Reset( *pSet );
-
- PageCreated( mnCurrentPageId, *pData->pPage );
- }
- else if ( pData->bRefresh )
- {
- pData->pPage->Reset( *pSet );
- }
-
- pData->bRefresh = FALSE;
-
- if ( pExampleSet )
- pData->pPage->ActivatePage( *pExampleSet );
- }
-
- SetHelpId( pData->pPage->GetHelpId() );
-
- BOOL bReadOnly = pData->pPage->IsReadOnly();
- if ( bReadOnly || bHideResetBtn )
- aResetBtn.Hide();
- else
- aResetBtn.Show();
-
-}
-
-// -----------------------------------------------------------------------
-
-BOOL IconChoiceDialog::DeActivatePageImpl ()
-{
- IconChoicePageData *pData = GetPageData ( mnCurrentPageId );
-
- int nRet = IconChoicePage::LEAVE_PAGE;
-
- if ( pData )
- {
- IconChoicePage * pPage = pData->pPage;
-
- if ( !pExampleSet && pPage->HasExchangeSupport() && pSet )
- pExampleSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
-
- if ( pSet )
- {
- SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
-
- if ( pPage->HasExchangeSupport() )
- nRet = pPage->DeactivatePage( &aTmp );
-
- if ( ( IconChoicePage::LEAVE_PAGE & nRet ) == IconChoicePage::LEAVE_PAGE &&
- aTmp.Count() )
- {
- pExampleSet->Put( aTmp );
- pOutSet->Put( aTmp );
- }
- }
- else
- {
- if ( pPage->HasExchangeSupport() ) //!!!
- {
- if ( !pExampleSet )
- {
- SfxItemPool* pPool = pPage->GetItemSet().GetPool();
- pExampleSet =
- new SfxItemSet( *pPool, GetInputRanges( *pPool ) );
- }
- nRet = pPage->DeactivatePage( pExampleSet );
- }
- else
- nRet = pPage->DeactivatePage( NULL );
- }
-
- if ( nRet & IconChoicePage::REFRESH_SET )
- {
- pSet = GetRefreshedSet();
- DBG_ASSERT( pSet, "GetRefreshedSet() liefert NULL" );
- // alle Pages als neu zu initialsieren flaggen
- const ULONG nCount = maPageList.Count();
-
- for ( USHORT i = 0; i < nCount; ++i )
- {
- IconChoicePageData* pObj = (IconChoicePageData*)maPageList.GetObject(i);
-
- if ( pObj->pPage != pPage ) // eigene Page nicht mehr refreshen
- pObj->bRefresh = TRUE;
- else
- pObj->bRefresh = FALSE;
- }
- }
- }
-
- if ( nRet & IconChoicePage::LEAVE_PAGE )
- return TRUE;
- else
- return FALSE;
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::ResetPageImpl ()
-{
- IconChoicePageData *pData = GetPageData ( mnCurrentPageId );
-
- DBG_ASSERT( pData, "Id nicht bekannt" );
-
- if ( pData->bOnDemand )
- {
- // CSet auf AIS hat hier Probleme, daher getrennt
- const SfxItemSet* _pSet = &pData->pPage->GetItemSet();
- pData->pPage->Reset( *(SfxItemSet*)_pSet );
- }
- else
- pData->pPage->Reset( *pSet );
-}
-
-/**********************************************************************
-|
-| handling itemsets
-|
-\**********************************************************************/
-
-const USHORT* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool )
-{
- if ( pSet )
- {
- DBG_ERRORFILE( "Set bereits vorhanden!" );
- return pSet->GetRanges();
- }
-
- if ( pRanges )
- return pRanges;
- SvUShorts aUS( 16, 16 );
- ULONG nCount = maPageList.Count();
-
- USHORT i;
- for ( i = 0; i < nCount; ++i )
- {
- IconChoicePageData* pData = maPageList.GetObject (i);
-
- if ( pData->fnGetRanges )
- {
- const USHORT* pTmpRanges = (pData->fnGetRanges)();
- const USHORT* pIter = pTmpRanges;
-
- USHORT nLen;
- for( nLen = 0; *pIter; ++nLen, ++pIter )
- ;
- aUS.Insert( pTmpRanges, nLen, aUS.Count() );
- }
- }
-
- // remove double Id's
-#ifndef TF_POOLABLE
- if ( rPool.HasMap() )
-#endif
- {
- nCount = aUS.Count();
-
- for ( i = 0; i < nCount; ++i )
- aUS[i] = rPool.GetWhich( aUS[i] );
- }
-
- // sortieren
- if ( aUS.Count() > 1 )
- {
-#if defined __SUNPRO_CC
-#pragma disable_warn
-#endif
- qsort( (void*)aUS.GetData(), aUS.Count(), sizeof(USHORT), IconcDlgCmpUS_Impl );
-#if defined __SUNPRO_CC
-#pragma enable_warn
-#endif
- }
-
- pRanges = new USHORT[aUS.Count() + 1];
- memcpy(pRanges, aUS.GetData(), sizeof(USHORT) * aUS.Count());
- pRanges[aUS.Count()] = 0;
-
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::SetInputSet( const SfxItemSet* pInSet )
-{
- FASTBOOL bSet = ( pSet != NULL );
-
- pSet = pInSet;
-
- if ( !bSet && !pExampleSet && !pOutSet )
- {
- pExampleSet = new SfxItemSet( *pSet );
- pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
- }
-}
-
-// -----------------------------------------------------------------------
-
-// Liefert die Pages, die ihre Sets onDemand liefern, das OutputItemSet.
-const SfxItemSet* IconChoiceDialog::GetOutputItemSet ( USHORT nId )
-{
- IconChoicePageData * pData = GetPageData ( nId );
- DBG_ASSERT( pData, "TabPage nicht gefunden" );
-
- if ( pData )
- {
- if ( !pData->pPage )
- return NULL;
-
- if ( pData->bOnDemand )
- return &pData->pPage->GetItemSet();
-
- return pOutSet;
- }
-
- return NULL;
-}
-
-// -----------------------------------------------------------------------
-
-int IconChoiceDialog::FillOutputItemSet()
-{
- int nRet = IconChoicePage::LEAVE_PAGE;
- if ( OK_Impl() )
- Ok();
- else
- nRet = IconChoicePage::KEEP_PAGE;
- return nRet;
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::PageCreated( USHORT /*nId*/, IconChoicePage& /*rPage*/ )
-{
- // not interested in
-}
-
-// -----------------------------------------------------------------------
-
-SfxItemSet* IconChoiceDialog::CreateInputItemSet( USHORT )
-{
- DBG_WARNINGFILE( "CreateInputItemSet nicht implementiert" );
-
- return 0;
-}
-
-/**********************************************************************
-|
-| start dialog
-|
-\**********************************************************************/
-
-short IconChoiceDialog::Execute()
-{
- if ( !maPageList.Count() )
- return RET_CANCEL;
-
- Start_Impl();
-
- return Dialog::Execute();
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::Start( BOOL bShow )
-{
-
- aCancelBtn.SetClickHdl( LINK( this, IconChoiceDialog, CancelHdl ) );
- bModal = FALSE;
-
- Start_Impl();
-
- if ( bShow )
- Window::Show();
-
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool IconChoiceDialog::QueryClose()
-{
- sal_Bool bRet = sal_True;
- const ULONG nCount = maPageList.Count();
- for ( ULONG i = 0; i < nCount; ++i )
- {
- IconChoicePageData* pData = maPageList.GetObject(i);
- if ( pData->pPage && !pData->pPage->QueryClose() )
- {
- bRet = sal_False;
- break;
- }
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::Start_Impl()
-{
- Point aPos;
- USHORT nActPage;
-
- if ( mnCurrentPageId == 0 || mnCurrentPageId == USHRT_MAX )
- nActPage = maPageList.GetObject(0)->nId;//First()->nId;
- else
- nActPage = mnCurrentPageId;
-
- // Konfiguration vorhanden?
- SvtViewOptions aTabDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
-
- if ( aTabDlgOpt.Exists() )
- {
- // ggf. Position aus Konfig
- SetWindowState( ByteString( aTabDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
-
- // initiale TabPage aus Programm/Hilfe/Konfig
- nActPage = (USHORT)aTabDlgOpt.GetPageID();
-
- if ( USHRT_MAX != mnCurrentPageId )
- nActPage = mnCurrentPageId;
-
- if ( GetPageData ( nActPage ) == NULL )
- nActPage = ( (IconChoicePageData*)maPageList.GetObject(0) )->nId;
- }
- else if ( USHRT_MAX != mnCurrentPageId && GetPageData ( mnCurrentPageId ) != NULL )
- nActPage = mnCurrentPageId;
-
- mnCurrentPageId = nActPage;
-
- FocusOnIcon( mnCurrentPageId );
-
- ActivatePageImpl();
-}
-
-// -----------------------------------------------------------------------
-
-const SfxItemSet* IconChoiceDialog::GetRefreshedSet()
-{
- DBG_ERRORFILE( "GetRefreshedSet nicht implementiert" );
- return 0;
-}
-
-/**********************************************************************
-|
-| tool-methods
-|
-\**********************************************************************/
-
-IconChoicePageData* IconChoiceDialog::GetPageData ( USHORT nId )
-{
- IconChoicePageData *pRet = NULL;
- BOOL bFound = FALSE;
-
- for ( ULONG i=0; i<maPageList.Count() && !bFound; i++ )
- {
- IconChoicePageData* pData = (IconChoicePageData*)maPageList.GetObject ( i );
-
- if ( pData->nId == nId )
- {
- pRet = pData;
- }
- }
-
- return pRet;
-}
-
-/**********************************************************************
-|
-| OK-Status
-|
-\**********************************************************************/
-
-BOOL IconChoiceDialog::OK_Impl()
-{
- IconChoicePage* pPage = GetPageData ( mnCurrentPageId )->pPage;
-
- bool bEnd = !pPage;
- if ( pPage )
- {
- int nRet = IconChoicePage::LEAVE_PAGE;
- if ( pSet )
- {
- SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
- BOOL bRet = FALSE;
-
- if ( pPage->HasExchangeSupport() )
- nRet = pPage->DeactivatePage( &aTmp );
-
- if ( ( IconChoicePage::LEAVE_PAGE & nRet ) == IconChoicePage::LEAVE_PAGE
- && aTmp.Count() )
- {
- pExampleSet->Put( aTmp );
- pOutSet->Put( aTmp );
- }
- else if ( bRet )
- bModified |= TRUE;
- }
- else
- nRet = pPage->DeactivatePage( NULL );
- bEnd = nRet;
- }
-
- return bEnd;
-}
-
-// -----------------------------------------------------------------------
-
-short IconChoiceDialog::Ok()
-{
- bInOK = TRUE;
-
- if ( !pOutSet )
- {
- if ( !pExampleSet && pSet )
- pOutSet = pSet->Clone( FALSE ); // ohne Items
- else if ( pExampleSet )
- pOutSet = new SfxItemSet( *pExampleSet );
- }
- BOOL _bModified = FALSE;
-
- const ULONG nCount = maPageList.Count();
-
- for ( USHORT i = 0; i < nCount; ++i )
- {
- IconChoicePageData* pData = GetPageData ( i );
-
- IconChoicePage* pPage = pData->pPage;
-
- if ( pPage )
- {
- if ( pData->bOnDemand )
- {
- SfxItemSet& rSet = (SfxItemSet&)pPage->GetItemSet();
- rSet.ClearItem();
- _bModified |= pPage->FillItemSet( rSet );
- }
- else if ( pSet && !pPage->HasExchangeSupport() )
- {
- SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
-
- if ( pPage->FillItemSet( aTmp ) )
- {
- _bModified |= TRUE;
- pExampleSet->Put( aTmp );
- pOutSet->Put( aTmp );
- }
- }
- }
- }
-
- if ( _bModified || ( pOutSet && pOutSet->Count() > 0 ) )
- _bModified |= TRUE;
-
- return _bModified ? RET_OK : RET_CANCEL;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL IconChoiceDialog::IsInOK() const
-{
- return bInOK;
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::FocusOnIcon( USHORT nId )
-{
- // set focus to icon for the current visible page
- for ( USHORT i=0; i<maIconCtrl.GetEntryCount(); i++)
- {
- SvxIconChoiceCtrlEntry* pEntry = maIconCtrl.GetEntry ( i );
- USHORT* pUserData = (USHORT*) pEntry->GetUserData();
-
- if ( pUserData && *pUserData == nId )
- {
- maIconCtrl.SetCursor( pEntry );
- break;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void IconChoiceDialog::CreateIconTextAutoMnemonics( void )
-{
- maIconCtrl.CreateAutoMnemonics();
-}
diff --git a/svx/source/cui/iconcdlg.hxx b/svx/source/cui/iconcdlg.hxx
deleted file mode 100644
index 4dce9737d2..0000000000
--- a/svx/source/cui/iconcdlg.hxx
+++ /dev/null
@@ -1,292 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: iconcdlg.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _ICCDLG_HXX
-#define _ICCDLG_HXX
-
-#include <vcl/tabpage.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/dialog.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/image.hxx>
-#include <svtools/ivctrl.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
-#include <tools/list.hxx>
-#include <tools/string.hxx>
-
-#define CTRLS_OFFSET 3
-#define BUTTON_DISTANCE 8
-#define RET_USER 100
-#define RET_USER_CANCEL 101
-
-// forward-declarations
-struct IconChoicePageData;
-class IconChoiceDialog;
-class IconChoicePage;
-
-// Create-Function
-typedef IconChoicePage* (*CreatePage)(Window *pParent, const SfxItemSet &rAttrSet);
-typedef USHORT* (*GetPageRanges)(); // liefert internationale Which-Wert
-
-// page-list
-DECLARE_LIST( IconChoicePageList, IconChoicePageData * )
-
-// position of iconchoicectrl
-enum EIconChoicePos { PosLeft, PosRight, PosTop, PosBottom };
-
-/**********************************************************************
-|
-| Data-structure for pages in dialog
-|
-\**********************************************************************/
-
-struct IconChoicePageData
-{
- USHORT nId; // Die ID
- CreatePage fnCreatePage; // Pointer auf die Factory
- GetPageRanges fnGetRanges;// Pointer auf die Ranges-Funktion
- IconChoicePage* pPage; // die TabPage selber
- BOOL bOnDemand; // Flag: ItemSet onDemand
- BOOL bRefresh; // Flag: Seite mu\s neu initialisiert werden
-
- // Konstruktor
- IconChoicePageData( USHORT Id, CreatePage fnPage, GetPageRanges fnRanges, BOOL bDemand )
- : nId ( Id ),
- fnCreatePage ( fnPage ),
- fnGetRanges ( fnRanges ),
- pPage ( NULL ),
- bOnDemand ( bDemand ),
- bRefresh ( FALSE )
- {}
-};
-
-/**********************************************************************
-|
-| IconChoicePage
-|
-\**********************************************************************/
-
-class IconChoicePage : public TabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private :
- const SfxItemSet* pSet;
- String aUserString;
- BOOL bHasExchangeSupport;
- IconChoiceDialog* pDialog;
- BOOL bStandard;
-
- void SetDialog( IconChoiceDialog* pNew ) { pDialog = pNew; }
- IconChoiceDialog* GetDialog() const { return pDialog; }
-
- void SetInputSet( const SfxItemSet* pNew ) { pSet = pNew; }
-
- void ImplInitSettings();
-
-protected :
- IconChoicePage( Window *pParent, const ResId &, const SfxItemSet &rAttrSet );
-
- USHORT GetSlot( USHORT nWhich ) const { return pSet->GetPool()->GetSlotId( nWhich ); }
- USHORT GetWhich( USHORT nSlot ) const { return pSet->GetPool()->GetWhich( nSlot ); }
- const SfxPoolItem* GetOldItem( const SfxItemSet& rSet, USHORT nSlot );
- const SfxPoolItem* GetExchangeItem( const SfxItemSet& rSet, USHORT nSlot );
-
-public :
- virtual ~IconChoicePage();
-
- const SfxItemSet& GetItemSet() const { return *pSet; }
-
- virtual BOOL FillItemSet( SfxItemSet& ) = 0;
- virtual void Reset( const SfxItemSet& ) = 0;
-
- BOOL HasExchangeSupport() const { return bHasExchangeSupport; }
- void SetExchangeSupport( BOOL bNew = TRUE ) { bHasExchangeSupport = bNew; }
-
- enum {
- KEEP_PAGE = 0x0000, // Fehlerbehandlung; Seite nicht wechseln
- // 2. F"ullen eines ItemSets f"ur die Aktualilsierung
- // "ubergeordneter Beispiele; dieser Pointer kann immer
- // NULL sein!!
- LEAVE_PAGE = 0x0001,
- // Set aktualisieren und andere Page aktualisieren
- REFRESH_SET = 0x0002
- };
-
- virtual void ActivatePage( const SfxItemSet& );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
- void SetUserData(const String& rString) { aUserString = rString; }
- String GetUserData() { return aUserString; }
- virtual void FillUserData();
- virtual BOOL IsReadOnly() const;
- virtual sal_Bool QueryClose();
-
- static const SfxPoolItem* GetItem( const SfxItemSet& rSet, USHORT nSlot );
-
- void StateChanged( StateChangedType nType );
- void DataChanged( const DataChangedEvent& rDCEvt );
-};
-
-/**********************************************************************
-|
-| IconChoiceDialog
-|
-\**********************************************************************/
-
-class IconChoiceDialog : public ModalDialog
-{
-private :
- friend class IconChoicePage;
-
- EIconChoicePos meChoicePos; // Position des IconChoiceCtrl's
- IconChoicePageList maPageList; // Liste von PageData-Pointer
-
- SvtIconChoiceCtrl maIconCtrl; // DAS IconChoice-Control
-
- USHORT mnCurrentPageId; // Id der aktuell sichtbaren Page
-
- // Buttons
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
- PushButton aResetBtn;
-
- const SfxItemSet* pSet;
- SfxItemSet* pOutSet;
- SfxItemSet* pExampleSet;
- USHORT* pRanges;
-
- sal_uInt32 nResId;
-
- BOOL bHideResetBtn;
- BOOL bModal;
- BOOL bInOK;
- BOOL bModified;
- BOOL bItemsReset;
-
- DECL_LINK ( ChosePageHdl_Impl, void * );
- DECL_LINK ( OkHdl, Button * );
- DECL_LINK ( ResetHdl, Button * );
- DECL_LINK ( CancelHdl, Button * );
-
- IconChoicePageData* GetPageData ( USHORT nId );
- void Start_Impl();
- BOOL OK_Impl();
-
- void SetPosSizeCtrls ( BOOL bInit = FALSE );
- void SetPosSizePages ( USHORT nId );
-
- void FocusOnIcon ( USHORT nId );
-
-protected :
- void ShowPageImpl ( IconChoicePageData* pData );
- void HidePageImpl ( IconChoicePageData* pData );
-
- virtual void PageCreated( USHORT nId, IconChoicePage& rPage );
- virtual SfxItemSet* CreateInputItemSet( USHORT nId );
- inline SfxItemSet* GetInputSetImpl() { return (SfxItemSet*)pSet; }
- inline IconChoicePage* GetTabPage( USHORT nPageId )
- { return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage:NULL); }
- const SfxItemSet* GetRefreshedSet();
-
- void ActivatePageImpl ();
- BOOL DeActivatePageImpl ();
- void ResetPageImpl ();
-
- short Ok();
- BOOL IsInOK() const;
-
-public :
-
- // im Ctor könnte auch die Position des IconChoiceCtrl's gesetzt werden.
-
- IconChoiceDialog ( Window* pParent, const ResId &rResId,
- const EIconChoicePos ePos = PosLeft, const SfxItemSet * pItemSet = 0 );
- ~IconChoiceDialog ();
-
- ///////////////////////////////////////////////////////////////////////////////////
- // virtuelle Methoden
- //
- virtual void Paint( const Rectangle& rRect );
- virtual void Resize();
-
- ///////////////////////////////////////////////////////////////////////////////////
- // Schnittstelle
- //
-
- SvxIconChoiceCtrlEntry* AddTabPage(
- USHORT nId, const String& rIconText, const Image& rChoiceIcon,
- CreatePage pCreateFunc /* != NULL */, GetPageRanges pRangesFunc = NULL /* NULL allowed*/,
- BOOL bItemsOnDemand = FALSE, ULONG nPos = LIST_APPEND );
-
- SvxIconChoiceCtrlEntry* AddTabPage(
- USHORT nId, const String& rIconText, const Image& rChoiceIcon, const Image& rChoiceIconHC,
- CreatePage pCreateFunc /* != NULL */, GetPageRanges pRangesFunc = NULL /* NULL allowed*/,
- BOOL bItemsOnDemand = FALSE, ULONG nPos = LIST_APPEND );
-
- void RemoveTabPage( USHORT nId );
-
- void SetCurPageId( USHORT nId ) { mnCurrentPageId = nId; FocusOnIcon( nId ); }
- USHORT GetCurPageId() const { return mnCurrentPageId; }
- void ShowPage( USHORT nId );
-
- // liefert ggf. per Map konvertierte lokale Slots
- const USHORT* GetInputRanges( const SfxItemPool& );
- void SetInputSet( const SfxItemSet* pInSet );
- const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
- const SfxItemSet* GetOutputItemSet( USHORT nId );
- int FillOutputItemSet();
-
- const OKButton& GetOKButton() const { return aOKBtn; }
- OKButton& GetOKButton() { return aOKBtn; }
- const CancelButton& GetCancelButton() const { return aCancelBtn; }
- CancelButton& GetCancelButton() { return aCancelBtn; }
- const HelpButton& GetHelpButton() const { return aHelpBtn; }
- HelpButton& GetHelpButton() { return aHelpBtn; }
-
- void RemoveResetButton();
-
- short Execute();
- void Start( BOOL bShow = TRUE );
- sal_Bool QueryClose();
-
- const SfxItemSet* GetExampleSet() const { return pExampleSet; }
-
- void SetCtrlColor ( const Color& rColor );
- EIconChoicePos SetCtrlPos ( const EIconChoicePos& rPos );
-
- void CreateIconTextAutoMnemonics( void );
-};
-
-#endif //_ICCDLG_HXX
-
diff --git a/svx/source/cui/iconcdlg.src b/svx/source/cui/iconcdlg.src
deleted file mode 100644
index fdfa000aa2..0000000000
--- a/svx/source/cui/iconcdlg.src
+++ /dev/null
@@ -1,63 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: iconcdlg.src,v $
- * $Revision: 1.19 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svx/dialogs.hrc>
-
-String RID_SVXSTR_ICONCHOICEDLG_RESETBUT
-{
- Text [ en-US ] = "~Back" ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/init.cxx b/svx/source/cui/init.cxx
deleted file mode 100644
index 8b282f3c40..0000000000
--- a/svx/source/cui/init.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: init.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <vcl/msgbox.hxx>
-#include "cuicharmap.hxx"
-
-// ------------------------------------------------------------------------
-// hook to call special character dialog for edits
-// caution: needs C-Linkage since dynamically loaded via symbol name
-extern "C"
-{
-bool GetSpecialCharsForEdit(Window* i_pParent, const Font& i_rFont, String& o_rResult)
-{
- bool bRet = false;
- SvxCharacterMap* aDlg = new SvxCharacterMap( i_pParent );
- aDlg->DisableFontSelection();
- aDlg->SetCharFont(i_rFont);
- if ( aDlg->Execute() == RET_OK )
- {
- o_rResult = aDlg->GetCharacters();
- bRet = true;
- }
- delete aDlg;
- return bRet;
-}
-}
diff --git a/svx/source/cui/insdlg.cxx b/svx/source/cui/insdlg.cxx
deleted file mode 100644
index 3d72463198..0000000000
--- a/svx/source/cui/insdlg.cxx
+++ /dev/null
@@ -1,1064 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: insdlg.cxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/embed/EmbedStates.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/embed/XInsertObjectDialog.hpp>
-#include <com/sun/star/ucb/CommandAbortedException.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-
-#include "insdlg.hxx"
-#include <svx/dialmgr.hxx>
-#include <svtools/sores.hxx>
-
-#include <stdio.h>
-#include <tools/urlobj.hxx>
-#include <tools/debug.hxx>
-#include <svtools/urihelper.hxx>
-#include <svtools/svmedit.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/svapp.hxx>
-#include <sot/clsids.hxx>
-#include <sfx2/frmdescr.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <svtools/ownlist.hxx>
-#include <comphelper/seqstream.hxx>
-
-#include "svuidlg.hrc"
-
-
-#include <osl/file.hxx>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <unotools/processfactory.hxx>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::ui::dialogs;
-using ::rtl::OUString;
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-
-
-static String impl_getSvtResString( sal_uInt32 nId )
-{
- String aRet;
- com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- ResMgr* pMgr = ResMgr::CreateResMgr( "svt", aLocale );
- if( pMgr )
- {
- aRet = String( ResId( nId, *pMgr ) );
- delete pMgr;
- }
- return aRet;
-}
-
-BOOL InsertObjectDialog_Impl::IsCreateNew() const
-{
- return FALSE;
-}
-
-uno::Reference< io::XInputStream > InsertObjectDialog_Impl::GetIconIfIconified( ::rtl::OUString* /*pGraphicMediaType*/ )
-{
- return uno::Reference< io::XInputStream >();
-}
-
-InsertObjectDialog_Impl::InsertObjectDialog_Impl( Window * pParent, const ResId & rResId, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage )
- : ModalDialog( pParent, rResId )
- , m_xStorage( xStorage )
- , aCnt( m_xStorage )
-{
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvInsertOleDlg, DoubleClickHdl, ListBox *, EMPTYARG )
-{
- EndDialog( RET_OK );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvInsertOleDlg, DoubleClickHdl, ListBox *, pListBox )
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvInsertOleDlg, BrowseHdl, PushButton *, EMPTYARG )
-{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- Reference< XFilePicker > xFilePicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ), UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
- if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
- {
- Sequence< Any > aServiceType( 1 );
- aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
- xInit->initialize( aServiceType );
-
- // add filter
- try
- {
- xFilterMgr->appendFilter(
- OUString(),
- OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) )
- );
- }
- catch( IllegalArgumentException& )
- {
- DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
- }
-
- if( xFilePicker->execute() == ExecutableDialogResults::OK )
- {
- Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- aEdFilepath.SetText( aObj.PathToFileName() );
- }
- }
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvInsertOleDlg, RadioHdl, RadioButton *, EMPTYARG )
-{
- if ( aRbNewObject.IsChecked() )
- {
- aLbObjecttype.Show();
- aEdFilepath.Hide();
- aBtnFilepath.Hide();
- aCbFilelink.Hide();
- aGbObject.SetText( _aOldStr );
- }
- else
- {
- aCbFilelink.Show();
- aLbObjecttype.Hide();
- aEdFilepath.Show();
- aBtnFilepath.Show();
- aCbFilelink.Show();
- aGbObject.SetText( aStrFile );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvInsertOleDlg::SelectDefault()
-{
- aLbObjecttype.SelectEntryPos( 0 );
-}
-
-void SvInsertOleDlg::FillObjectServerList( SvObjectServerList* pList )
-{
- pList->FillInsertObjects();
-}
-
-// -----------------------------------------------------------------------
-SvInsertOleDlg::SvInsertOleDlg
-(
- Window* pParent,
- const Reference < embed::XStorage >& xStorage,
- const SvObjectServerList* pServers
-)
- : InsertObjectDialog_Impl( pParent, SVX_RES( MD_INSERT_OLEOBJECT ), xStorage ),
- aRbNewObject( this, SVX_RES( RB_NEW_OBJECT ) ),
- aRbObjectFromfile( this, SVX_RES( RB_OBJECT_FROMFILE ) ),
- aLbObjecttype( this, SVX_RES( LB_OBJECTTYPE ) ),
- aEdFilepath( this, SVX_RES( ED_FILEPATH ) ),
- aBtnFilepath( this, SVX_RES( BTN_FILEPATH ) ),
- aCbFilelink( this, SVX_RES( CB_FILELINK ) ),
- aGbObject( this, SVX_RES( GB_OBJECT ) ),
- aOKButton1( this, SVX_RES( 1 ) ),
- aCancelButton1( this, SVX_RES( 1 ) ),
- aHelpButton1( this, SVX_RES( 1 ) ),
- aStrFile( SVX_RES( STR_FILE ) ),
- m_pServers( pServers )
-{
- FreeResource();
- _aOldStr = aGbObject.GetText();
- aLbObjecttype.SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) );
- aBtnFilepath.SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) );
- Link aLink( LINK( this, SvInsertOleDlg, RadioHdl ) );
- aRbNewObject.SetClickHdl( aLink );
- aRbObjectFromfile.SetClickHdl( aLink );
- aRbNewObject.Check( TRUE );
- RadioHdl( NULL );
-}
-
-short SvInsertOleDlg::Execute()
-{
- short nRet = RET_OK;
- SvObjectServerList aObjS;
- if ( !m_pServers )
- {
- // if no list was provided, take the complete one
- aObjS.FillInsertObjects();
- m_pServers = &aObjS;
- }
-
- // fill listbox and select default
- ListBox& rBox = GetObjectTypes();
- rBox.SetUpdateMode( FALSE );
- for ( ULONG i = 0; i < m_pServers->Count(); i++ )
- rBox.InsertEntry( (*m_pServers)[i].GetHumanName() );
- rBox.SetUpdateMode( TRUE );
- SelectDefault();
- ::rtl::OUString aName;
-
- DBG_ASSERT( m_xStorage.is(), "No storage!");
- if ( m_xStorage.is() && ( nRet = Dialog::Execute() ) == RET_OK )
- {
- String aFileName;
- BOOL bLink = FALSE;
- BOOL bCreateNew = IsCreateNew();
- if ( bCreateNew )
- {
- // create and insert new embedded object
- String aServerName = rBox.GetSelectEntry();
- const SvObjectServer* pS = m_pServers->Get( aServerName );
- if ( pS )
- {
- if( pS->GetClassName() == SvGlobalName( SO3_OUT_CLASSID ) )
- {
- try
- {
- uno::Reference < embed::XInsertObjectDialog > xDialogCreator(
- ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.MSOLEObjectSystemCreator")) ),
- uno::UNO_QUERY );
-
- if ( xDialogCreator.is() )
- {
- aName = aCnt.CreateUniqueObjectName();
- embed::InsertedObjectInfo aNewInf = xDialogCreator->createInstanceByDialog(
- m_xStorage,
- aName,
- uno::Sequence < beans::PropertyValue >() );
-
- OSL_ENSURE( aNewInf.Object.is(), "The object must be created or an exception must be thrown!" );
- m_xObj = aNewInf.Object;
- for ( sal_Int32 nInd = 0; nInd < aNewInf.Options.getLength(); nInd++ )
- if ( aNewInf.Options[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Icon" ) ) ) )
- {
- aNewInf.Options[nInd].Value >>= m_aIconMetaFile;
- }
- else if ( aNewInf.Options[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IconFormat" ) ) ) )
- {
- datatransfer::DataFlavor aFlavor;
- if ( aNewInf.Options[nInd].Value >>= aFlavor )
- m_aIconMediaType = aFlavor.MimeType;
- }
-
- }
- }
- catch( ucb::CommandAbortedException& )
- {
- // the user has pressed cancel
- }
- catch( uno::Exception& )
- {
- // TODO: Error handling
- }
- }
- else
- {
- // create object with desired ClassId
- m_xObj = aCnt.CreateEmbeddedObject( pS->GetClassName().GetByteSequence(), aName );
- }
-
- if ( !m_xObj.is() )
- {
- if( aFileName.Len() ) // from OLE Dialog
- {
- // Objekt konnte nicht aus Datei erzeugt werden
- // global Resource from svtools (former so3 resource)
- String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) );
- aErr.SearchAndReplace( String( '%' ), aFileName );
- ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
- }
- else
- {
- // Objekt konnte nicht erzeugt werden
- // global Resource from svtools (former so3 resource)
- String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE ) );
- aErr.SearchAndReplace( String( '%' ), aServerName );
- ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
- }
- }
- }
- }
- else
- {
- aFileName = GetFilePath();
- INetURLObject aURL;
- aURL.SetSmartProtocol( INET_PROT_FILE );
- aURL.SetSmartURL( aFileName );
- aFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
- bLink = IsLinked();
-
- if ( aFileName.Len() )
- {
- // create MediaDescriptor for file to create object from
- uno::Sequence < beans::PropertyValue > aMedium( 2 );
- aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
- aMedium[0].Value <<= ::rtl::OUString( aFileName );
-
- uno::Reference< task::XInteractionHandler > xInteraction;
- uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
- if ( xFactory.is() )
- xInteraction = uno::Reference< task::XInteractionHandler >(
- xFactory->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ),
- uno::UNO_QUERY_THROW );
-
- if ( xInteraction.is() )
- {
- aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) );
- aMedium[1].Value <<= xInteraction;
- }
- else
- {
- OSL_ASSERT( "Can not get InteractionHandler!\n" );
- aMedium.realloc( 1 );
- }
-
- // create object from media descriptor
- if ( bLink )
- m_xObj = aCnt.InsertEmbeddedLink( aMedium, aName );
- else
- m_xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
- }
-
- if ( !m_xObj.is() )
- {
- // Objekt konnte nicht aus Datei erzeugt werden
- // global Resource from svtools (former so3 resource)
- String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) );
- aErr.SearchAndReplace( String( '%' ), aFileName );
- ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
- }
- }
- }
-
- m_pServers = 0;
- return nRet;
-}
-
-uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( ::rtl::OUString* pGraphicMediaType )
-{
- if ( m_aIconMetaFile.getLength() )
- {
- if ( pGraphicMediaType )
- *pGraphicMediaType = m_aIconMediaType;
-
- return uno::Reference< io::XInputStream >( new ::comphelper::SequenceInputStream( m_aIconMetaFile ) );
- }
-
- return uno::Reference< io::XInputStream >();
-}
-
-IMPL_LINK( SvInsertPlugInDialog, BrowseHdl, PushButton *, EMPTYARG )
-{
- Sequence< OUString > aFilterNames, aFilterTypes;
- void fillNetscapePluginFilters( Sequence< OUString >& rNames, Sequence< OUString >& rTypes );
- fillNetscapePluginFilters( aFilterNames, aFilterTypes );
-
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- Reference< XFilePicker > xFilePicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ), UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
- if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
- {
- Sequence< Any > aServiceType( 1 );
- aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
- xInit->initialize( aServiceType );
-
- // add the filters
- try
- {
- const OUString* pNames = aFilterNames.getConstArray();
- const OUString* pTypes = aFilterTypes.getConstArray();
- for( int i = 0; i < aFilterNames.getLength(); i++ )
- xFilterMgr->appendFilter( pNames[i], pTypes[i] );
- }
- catch( IllegalArgumentException& )
- {
- DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
- }
-
- if( xFilePicker->execute() == ExecutableDialogResults::OK )
- {
- Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- aEdFileurl.SetText( aObj.PathToFileName() );
- }
- }
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SvInsertPlugInDialog::SvInsertPlugInDialog( Window* pParent, const uno::Reference < embed::XStorage >& xStorage )
- : InsertObjectDialog_Impl( pParent, SVX_RES( MD_INSERT_OBJECT_PLUGIN ), xStorage ),
- aEdFileurl( this, SVX_RES( ED_FILEURL ) ),
- aBtnFileurl( this, SVX_RES( BTN_FILEURL ) ),
- aGbFileurl( this, SVX_RES( GB_FILEURL ) ),
- aEdPluginsOptions( this, SVX_RES( ED_PLUGINS_OPTIONS ) ),
- aGbPluginsOptions( this, SVX_RES( GB_PLUGINS_OPTIONS ) ),
- aOKButton1( this, SVX_RES( 1 ) ),
- aCancelButton1( this, SVX_RES( 1 ) ),
- aHelpButton1( this, SVX_RES( 1 ) ),
- m_pURL(0)
-{
- FreeResource();
- aBtnFileurl.SetClickHdl( LINK( this, SvInsertPlugInDialog, BrowseHdl ) );
-}
-
-SvInsertPlugInDialog::~SvInsertPlugInDialog()
-{
- delete m_pURL;
-}
-
-// -----------------------------------------------------------------------
-
-static void Plugin_ImplFillCommandSequence( const String& aCommands, uno::Sequence< beans::PropertyValue >& aCommandSequence )
-{
- USHORT nEaten;
- SvCommandList aLst;
- aLst.AppendCommands( aCommands, &nEaten );
-
- const sal_Int32 nCount = aLst.Count();
- aCommandSequence.realloc( nCount );
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
- {
- const SvCommand& rCommand = aLst[ nIndex ];
-
- aCommandSequence[nIndex].Name = rCommand.GetCommand();
- aCommandSequence[nIndex].Handle = -1;
- aCommandSequence[nIndex].Value = makeAny( OUString( rCommand.GetArgument() ) );
- aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
- }
-}
-
-short SvInsertPlugInDialog::Execute()
-{
- short nRet = RET_OK;
- m_aCommands.Erase();
- DBG_ASSERT( m_xStorage.is(), "No storage!");
- if ( m_xStorage.is() && ( nRet = Dialog::Execute() ) == RET_OK )
- {
- if ( !m_pURL )
- m_pURL = new INetURLObject();
- else
- *m_pURL = INetURLObject();
-
- m_aCommands = GetPlugInOptions();
- String aURL = GetPlugInFile();
-
- // URL can be a valid and absolute URL or a system file name
- m_pURL->SetSmartProtocol( INET_PROT_FILE );
- if ( !aURL.Len() || m_pURL->SetSmartURL( aURL ) )
- {
- // create a plugin object
- ::rtl::OUString aName;
- SvGlobalName aClassId( SO3_PLUGIN_CLASSID );
- m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName );
- }
-
- if ( m_xObj.is() )
- {
- // set properties from dialog
- if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
-
- uno::Reference < beans::XPropertySet > xSet( m_xObj->getComponent(), uno::UNO_QUERY );
- if ( xSet.is() )
- {
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
- makeAny( ::rtl::OUString( m_pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) );
- uno::Sequence< beans::PropertyValue > aCommandSequence;
- Plugin_ImplFillCommandSequence( m_aCommands, aCommandSequence );
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginCommands"), makeAny( aCommandSequence ) );
- }
- }
- else
- {
- // PlugIn konnte nicht erzeugt werden
- // global Resource from svtools (former so3 resource)
- String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_PLUGIN ) );
- aErr.SearchAndReplace( String( '%' ), aURL );
- ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute();
- }
- }
-
- return nRet;
-}
-
-// class SvInsertAppletDlg -----------------------------------------------
-
-IMPL_LINK( SvInsertAppletDialog, BrowseHdl, PushButton *, EMPTYARG )
-{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- Reference< XFilePicker > xFilePicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ), UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
- if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
- {
- Sequence< Any > aServiceType( 1 );
- aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
- xInit->initialize( aServiceType );
-
- // add filter
- try
- {
- xFilterMgr->appendFilter(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "Applet" ) ),
- OUString( RTL_CONSTASCII_USTRINGPARAM( "*.class" ) )
- );
- }
- catch( IllegalArgumentException& )
- {
- DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
- }
-
- if( xFilePicker->execute() == ExecutableDialogResults::OK )
- {
- Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
-
- INetURLObject aObj( aPathSeq[0] );
- aEdClassfile.SetText( aObj.getName() );
- aObj.removeSegment();
- aEdClasslocation.SetText( aObj.PathToFileName() );
- }
- }
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SvInsertAppletDialog::SvInsertAppletDialog( Window* pParent, const uno::Reference < embed::XStorage >& xStorage )
- : InsertObjectDialog_Impl( pParent, SVX_RES( MD_INSERT_OBJECT_APPLET ), xStorage ),
- aFtClassfile( this, SVX_RES( FT_CLASSFILE ) ),
- aEdClassfile( this, SVX_RES( ED_CLASSFILE ) ),
- aFtClasslocation( this, SVX_RES( FT_CLASSLOCATION ) ),
- aEdClasslocation( this, SVX_RES( ED_CLASSLOCATION ) ),
- aBtnClass( this, SVX_RES( BTN_CLASS ) ),
- aGbClass( this, SVX_RES( GB_CLASS ) ),
- aEdAppletOptions( this, SVX_RES( ED_APPLET_OPTIONS ) ),
- aGbAppletOptions( this, SVX_RES( GB_APPLET_OPTIONS ) ),
- aOKButton1( this, SVX_RES( 1 ) ),
- aCancelButton1( this, SVX_RES( 1 ) ),
- aHelpButton1( this, SVX_RES( 1 ) ),
- m_pURL(0)
-{
- FreeResource();
- aBtnClass.SetClickHdl( LINK( this, SvInsertAppletDialog, BrowseHdl ) );
-}
-
-SvInsertAppletDialog::SvInsertAppletDialog( Window* pParent, const uno::Reference < embed::XEmbeddedObject >& xObj )
- : InsertObjectDialog_Impl( pParent, SVX_RES( MD_INSERT_OBJECT_APPLET ), uno::Reference < embed::XStorage >() ),
- aFtClassfile( this, SVX_RES( FT_CLASSFILE ) ),
- aEdClassfile( this, SVX_RES( ED_CLASSFILE ) ),
- aFtClasslocation( this, SVX_RES( FT_CLASSLOCATION ) ),
- aEdClasslocation( this, SVX_RES( ED_CLASSLOCATION ) ),
- aBtnClass( this, SVX_RES( BTN_CLASS ) ),
- aGbClass( this, SVX_RES( GB_CLASS ) ),
- aEdAppletOptions( this, SVX_RES( ED_APPLET_OPTIONS ) ),
- aGbAppletOptions( this, SVX_RES( GB_APPLET_OPTIONS ) ),
- aOKButton1( this, SVX_RES( 1 ) ),
- aCancelButton1( this, SVX_RES( 1 ) ),
- aHelpButton1( this, SVX_RES( 1 ) ),
- m_pURL(0)
-{
- m_xObj = xObj;
- FreeResource();
- aBtnClass.SetClickHdl( LINK( this, SvInsertAppletDialog, BrowseHdl ) );
-}
-
-
-SvInsertAppletDialog::~SvInsertAppletDialog()
-{
- delete m_pURL;
-}
-
-short SvInsertAppletDialog::Execute()
-{
- short nRet = RET_OK;
- m_aClass.Erase();
- m_aCommands.Erase();
-
- BOOL bOK = FALSE;
- uno::Reference < beans::XPropertySet > xSet;
- if ( m_xObj.is() )
- {
- try
- {
- if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
- xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY );
- ::rtl::OUString aStr;
- uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("AppletCode") );
- if ( aAny >>= aStr )
- SetClass( aStr );
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("AppletCodeBase") );
- if ( aAny >>= aStr )
- SetClassLocation( aStr );
- uno::Sequence< beans::PropertyValue > aCommands;
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("AppletCommands") );
- if ( aAny >>= aCommands )
- {
- SvCommandList aList;
- aList.FillFromSequence( aCommands );
- SetAppletOptions( aList.GetCommands() );
- }
-
- String aText( SVX_RES( STR_EDIT_APPLET ) );
- SetText( aText );
- bOK = TRUE;
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR( "No Applet!" );
- }
- }
- else
- {
- DBG_ASSERT( m_xStorage.is(), "No storage!");
- bOK = m_xStorage.is();
- }
-
- if ( bOK && ( nRet = Dialog::Execute() ) == RET_OK )
- {
- if ( !m_xObj.is() )
- {
- ::rtl::OUString aName;
- SvGlobalName aClassId( SO3_APPLET_CLASSID );
- m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName );
- if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
- xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY );
- }
-
- if ( m_xObj.is() )
- {
- try
- {
- BOOL bIPActive = m_xObj->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE;
- if ( bIPActive )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
-
- String aClassLocation = GetClassLocation();
-
- // Hack, aFileName wird auch fuer Class benutzt
- m_aClass = GetClass();
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("AppletCode"), makeAny( ::rtl::OUString( m_aClass ) ) );
-
- ::rtl::OUString tmp = aClassLocation;
- ::osl::File::getFileURLFromSystemPath(tmp, tmp);
- aClassLocation = tmp;
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("AppletCodeBase"), makeAny( tmp ) );
- m_aCommands = GetAppletOptions();
-
- uno::Sequence< beans::PropertyValue > aCommandSequence;
- Plugin_ImplFillCommandSequence( m_aCommands, aCommandSequence );
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("AppletCommands"), makeAny( aCommandSequence ) );
-
- if ( bIPActive )
- m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE );
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR( "No Applet!" );
- }
- }
- }
-
- return nRet;
-}
-
-SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( Window *pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage )
- : InsertObjectDialog_Impl( pParent, SVX_RES( MD_INSERT_OBJECT_IFRAME ), xStorage )
- , aFTName ( this, SVX_RES( FT_FRAMENAME ) )
- , aEDName ( this, SVX_RES( ED_FRAMENAME ) )
- , aFTURL ( this, SVX_RES( FT_URL ) )
- , aEDURL ( this, SVX_RES( ED_URL ) )
- , aBTOpen ( this, SVX_RES(BT_FILEOPEN ) )
- , aRBScrollingOn ( this, SVX_RES( RB_SCROLLINGON ) )
- , aRBScrollingOff ( this, SVX_RES( RB_SCROLLINGOFF ) )
- , aRBScrollingAuto ( this, SVX_RES( RB_SCROLLINGAUTO ) )
- , aFLScrolling ( this, SVX_RES( GB_SCROLLING ) )
- , aFLSepLeft( this, SVX_RES( FL_SEP_LEFT ) )
- , aRBFrameBorderOn ( this, SVX_RES( RB_FRMBORDER_ON ) )
- , aRBFrameBorderOff ( this, SVX_RES( RB_FRMBORDER_OFF ) )
- , aFLFrameBorder( this, SVX_RES( GB_BORDER ) )
- , aFLSepRight( this, SVX_RES( FL_SEP_RIGHT ) )
- , aFTMarginWidth ( this, SVX_RES( FT_MARGINWIDTH ) )
- , aNMMarginWidth ( this, SVX_RES( NM_MARGINWIDTH ) )
- , aCBMarginWidthDefault( this, SVX_RES( CB_MARGINHEIGHTDEFAULT ) )
- , aFTMarginHeight ( this, SVX_RES( FT_MARGINHEIGHT ) )
- , aNMMarginHeight ( this, SVX_RES( NM_MARGINHEIGHT ) )
- , aCBMarginHeightDefault( this, SVX_RES( CB_MARGINHEIGHTDEFAULT ) )
- , aFLMargin( this, SVX_RES( GB_MARGIN ) )
- , aOKButton1( this, SVX_RES( 1 ) )
- , aCancelButton1( this, SVX_RES( 1 ) )
- , aHelpButton1( this, SVX_RES( 1 ) )
-{
- FreeResource();
-
- aFLSepLeft.SetStyle(aFLSepLeft.GetStyle()|WB_VERT);
- aFLSepRight.SetStyle(aFLSepRight.GetStyle()|WB_VERT);
-
- Link aLink( STATIC_LINK( this, SfxInsertFloatingFrameDialog, CheckHdl ) );
- aCBMarginWidthDefault.SetClickHdl( aLink );
- aCBMarginHeightDefault.SetClickHdl( aLink );
-
- aCBMarginWidthDefault.Check();
- aCBMarginHeightDefault.Check();
- aRBScrollingAuto.Check();
- aRBFrameBorderOn.Check();
-
- aBTOpen.SetClickHdl( STATIC_LINK( this, SfxInsertFloatingFrameDialog, OpenHdl ) );
-}
-
-SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( Window *pParent, const uno::Reference < embed::XEmbeddedObject >& xObj )
- : InsertObjectDialog_Impl( pParent, SVX_RES( MD_INSERT_OBJECT_IFRAME ), uno::Reference < embed::XStorage >() )
- , aFTName ( this, SVX_RES( FT_FRAMENAME ) )
- , aEDName ( this, SVX_RES( ED_FRAMENAME ) )
- , aFTURL ( this, SVX_RES( FT_URL ) )
- , aEDURL ( this, SVX_RES( ED_URL ) )
- , aBTOpen ( this, SVX_RES(BT_FILEOPEN ) )
- , aRBScrollingOn ( this, SVX_RES( RB_SCROLLINGON ) )
- , aRBScrollingOff ( this, SVX_RES( RB_SCROLLINGOFF ) )
- , aRBScrollingAuto ( this, SVX_RES( RB_SCROLLINGAUTO ) )
- , aFLScrolling ( this, SVX_RES( GB_SCROLLING ) )
- , aFLSepLeft( this, SVX_RES( FL_SEP_LEFT ) )
- , aRBFrameBorderOn ( this, SVX_RES( RB_FRMBORDER_ON ) )
- , aRBFrameBorderOff ( this, SVX_RES( RB_FRMBORDER_OFF ) )
- , aFLFrameBorder( this, SVX_RES( GB_BORDER ) )
- , aFLSepRight( this, SVX_RES( FL_SEP_RIGHT ) )
- , aFTMarginWidth ( this, SVX_RES( FT_MARGINWIDTH ) )
- , aNMMarginWidth ( this, SVX_RES( NM_MARGINWIDTH ) )
- , aCBMarginWidthDefault( this, SVX_RES( CB_MARGINHEIGHTDEFAULT ) )
- , aFTMarginHeight ( this, SVX_RES( FT_MARGINHEIGHT ) )
- , aNMMarginHeight ( this, SVX_RES( NM_MARGINHEIGHT ) )
- , aCBMarginHeightDefault( this, SVX_RES( CB_MARGINHEIGHTDEFAULT ) )
- , aFLMargin( this, SVX_RES( GB_MARGIN ) )
- , aOKButton1( this, SVX_RES( 1 ) )
- , aCancelButton1( this, SVX_RES( 1 ) )
- , aHelpButton1( this, SVX_RES( 1 ) )
-{
- FreeResource();
-
- m_xObj = xObj;
-
- aFLSepLeft.SetStyle(aFLSepLeft.GetStyle()|WB_VERT);
- aFLSepRight.SetStyle(aFLSepRight.GetStyle()|WB_VERT);
-
- Link aLink( STATIC_LINK( this, SfxInsertFloatingFrameDialog, CheckHdl ) );
- aCBMarginWidthDefault.SetClickHdl( aLink );
- aCBMarginHeightDefault.SetClickHdl( aLink );
-
- aCBMarginWidthDefault.Check();
- aCBMarginHeightDefault.Check();
- aRBScrollingAuto.Check();
- aRBFrameBorderOn.Check();
-
- aBTOpen.SetClickHdl( STATIC_LINK( this, SfxInsertFloatingFrameDialog, OpenHdl ) );
-}
-
-short SfxInsertFloatingFrameDialog::Execute()
-{
- short nRet = RET_OK;
- BOOL bOK = FALSE;
- uno::Reference < beans::XPropertySet > xSet;
- if ( m_xObj.is() )
- {
- try
- {
- if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
- xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY );
- ::rtl::OUString aStr;
- uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameURL") );
- if ( aAny >>= aStr )
- aEDURL.SetText( aStr );
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameName") );
- if ( aAny >>= aStr )
- aEDName.SetText( aStr );
-
- sal_Int32 nSize = SIZE_NOT_SET;
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth") );
- aAny >>= nSize;
-
- if ( nSize == SIZE_NOT_SET )
- {
- aCBMarginWidthDefault.Check( TRUE );
- aNMMarginWidth.SetText( String::CreateFromInt32( DEFAULT_MARGIN_WIDTH ) );
- aFTMarginWidth.Enable( FALSE );
- aNMMarginWidth.Enable( FALSE );
- }
- else
- aNMMarginWidth.SetText( String::CreateFromInt32( nSize ) );
-
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight") );
- aAny >>= nSize;
-
- if ( nSize == SIZE_NOT_SET )
- {
- aCBMarginHeightDefault.Check( TRUE );
- aNMMarginHeight.SetText( String::CreateFromInt32( DEFAULT_MARGIN_HEIGHT ) );
- aFTMarginHeight.Enable( FALSE );
- aNMMarginHeight.Enable( FALSE );
- }
- else
- aNMMarginHeight.SetText( String::CreateFromInt32( nSize ) );
-
- BOOL bScrollOn = FALSE;
- BOOL bScrollOff = FALSE;
- BOOL bScrollAuto = FALSE;
-
- sal_Bool bSet = sal_False;
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll") );
- aAny >>= bSet;
- if ( !bSet )
- {
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode") );
- aAny >>= bSet;
- bScrollOn = bSet;
- bScrollOff = !bSet;
- }
- else
- bScrollAuto = TRUE;
-
- aRBScrollingOn.Check( bScrollOn );
- aRBScrollingOff.Check( bScrollOff );
- aRBScrollingAuto.Check( bScrollAuto );
-
- bSet = sal_False;
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder") );
- aAny >>= bSet;
- if ( !bSet )
- {
- aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder") );
- aAny >>= bSet;
- aRBFrameBorderOn.Check( bSet );
- aRBFrameBorderOff.Check( !bSet );
- }
-
- SetUpdateMode( TRUE );
- bOK = TRUE;
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR( "No IFrame!" );
- }
- }
- else
- {
- DBG_ASSERT( m_xStorage.is(), "No storage!");
- bOK = m_xStorage.is();
- }
-
- if ( bOK && ( nRet = Dialog::Execute() ) == RET_OK )
- {
- ::rtl::OUString aURL;
- if ( aEDURL.GetText().Len() )
- {
- // URL can be a valid and absolute URL or a system file name
- INetURLObject aObj;
- aObj.SetSmartProtocol( INET_PROT_FILE );
- if ( aObj.SetSmartURL( aEDURL.GetText() ) )
- aURL = aObj.GetMainURL( INetURLObject::NO_DECODE );
- }
-
- if ( !m_xObj.is() && aURL.getLength() )
- {
- // create the object
- ::rtl::OUString aName;
- SvGlobalName aClassId( SO3_IFRAME_CLASSID );
- m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName );
- if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
- xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY );
- }
-
- if ( m_xObj.is() )
- {
- try
- {
- BOOL bIPActive = m_xObj->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE;
- if ( bIPActive )
- m_xObj->changeState( embed::EmbedStates::RUNNING );
-
- ::rtl::OUString aName = aEDName.GetText();
- ScrollingMode eScroll = ScrollingNo;
- if ( aRBScrollingOn.IsChecked() )
- eScroll = ScrollingYes;
- if ( aRBScrollingOff.IsChecked() )
- eScroll = ScrollingNo;
- if ( aRBScrollingAuto.IsChecked() )
- eScroll = ScrollingAuto;
-
- sal_Bool bHasBorder = aRBFrameBorderOn.IsChecked();
-
- long lMarginWidth;
- if ( !aCBMarginWidthDefault.IsChecked() )
- lMarginWidth = (long) aNMMarginWidth.GetText().ToInt32();
- else
- lMarginWidth = SIZE_NOT_SET;
-
- long lMarginHeight;
- if ( !aCBMarginHeightDefault.IsChecked() )
- lMarginHeight = (long) aNMMarginHeight.GetText().ToInt32();
- else
- lMarginHeight = SIZE_NOT_SET;
-
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameURL"), makeAny( aURL ) );
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameName"), makeAny( aName ) );
-
- if ( eScroll == ScrollingAuto )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll"),
- makeAny( sal_True ) );
- else
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode"),
- makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) );
-
- //if ( aFrmDescr.IsFrameBorderSet() )
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder"),
- makeAny( bHasBorder ) );
- /*else
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder"),
- makeAny( sal_True ) );*/
-
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth"),
- makeAny( sal_Int32( lMarginWidth ) ) );
-
- xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight"),
- makeAny( sal_Int32( lMarginHeight ) ) );
-
- if ( bIPActive )
- m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE );
- }
- catch ( uno::Exception& )
- {
- DBG_ERROR( "No IFrame!" );
- }
- }
- }
-
- return nRet;
-}
-
-//------------------------------------------------------------------------------
-
-IMPL_STATIC_LINK( SfxInsertFloatingFrameDialog, CheckHdl, CheckBox*, pCB )
-{
- if ( pCB == &pThis->aCBMarginWidthDefault )
- {
- if ( pCB->IsChecked() )
- pThis->aNMMarginWidth.SetText( String::CreateFromInt32( DEFAULT_MARGIN_WIDTH ) );
- pThis->aFTMarginWidth.Enable( !pCB->IsChecked() );
- pThis->aNMMarginWidth.Enable( !pCB->IsChecked() );
- }
-
- if ( pCB == &pThis->aCBMarginHeightDefault )
- {
- if ( pCB->IsChecked() )
- pThis->aNMMarginHeight.SetText( String::CreateFromInt32( DEFAULT_MARGIN_HEIGHT ) );
- pThis->aFTMarginHeight.Enable( !pCB->IsChecked() );
- pThis->aNMMarginHeight.Enable( !pCB->IsChecked() );
- }
-
- return 0L;
-}
-
-//------------------------------------------------------------------------------
-
-IMPL_STATIC_LINK( SfxInsertFloatingFrameDialog, OpenHdl, PushButton*, EMPTYARG )
-{
- Window* pOldParent = Application::GetDefDialogParent();
- Application::SetDefDialogParent( pThis );
-
- // create the file dialog
- sfx2::FileDialogHelper aFileDlg( WB_OPEN | SFXWB_PASSWORD, String() );
-
- // set the title
- aFileDlg.SetTitle( OUString( String( SVX_RES( MD_INSERT_OBJECT_IFRAME ) ) ) );
-
- // show the dialog
- if ( aFileDlg.Execute() == ERRCODE_NONE )
- pThis->aEDURL.SetText(
- INetURLObject( aFileDlg.GetPath() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
-
- Application::SetDefDialogParent( pOldParent );
- return 0L;
-}
-
diff --git a/svx/source/cui/insdlg.hxx b/svx/source/cui/insdlg.hxx
deleted file mode 100644
index 8e4d170492..0000000000
--- a/svx/source/cui/insdlg.hxx
+++ /dev/null
@@ -1,217 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: insdlg.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_INSDLG_HXX
-#define _SVX_INSDLG_HXX
-
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-
-#include <svtools/insdlg.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
-#include <svtools/svmedit.hxx> // MultiLineEdit
-#include <comphelper/embeddedobjectcontainer.hxx>
-
-class INetURLObject;
-
-class InsertObjectDialog_Impl : public ModalDialog
-{
-protected:
- com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > m_xObj;
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& m_xStorage;
- comphelper::EmbeddedObjectContainer aCnt;
-
- InsertObjectDialog_Impl( Window * pParent, const ResId & rResId, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
-public:
- com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()
- { return m_xObj; }
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
- virtual BOOL IsCreateNew() const;
-};
-
-class SvInsertOleDlg : public InsertObjectDialog_Impl
-{
- RadioButton aRbNewObject;
- RadioButton aRbObjectFromfile;
- ListBox aLbObjecttype;
- Edit aEdFilepath;
- PushButton aBtnFilepath;
- CheckBox aCbFilelink;
- FixedLine aGbObject;
- OKButton aOKButton1;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- String aStrFile;
- String _aOldStr;
- const SvObjectServerList* m_pServers;
-
- ::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
- ::rtl::OUString m_aIconMediaType;
-
- DECL_LINK( DoubleClickHdl, ListBox* );
- DECL_LINK( BrowseHdl, PushButton* );
- DECL_LINK( RadioHdl, RadioButton* );
- void SelectDefault();
- ListBox& GetObjectTypes()
- { return aLbObjecttype; }
- String GetFilePath() const { return aEdFilepath.GetText(); }
- BOOL IsLinked() const { return aCbFilelink.IsChecked(); }
- BOOL IsCreateNew() const { return aRbNewObject.IsChecked(); }
-
-public:
- static void FillObjectServerList( SvObjectServerList* );
-
- SvInsertOleDlg( Window* pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
- const SvObjectServerList* pServers = NULL );
- virtual short Execute();
-
- // get replacement for the iconified embedded object and the mediatype of the replacement
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
-};
-
-// class SvInsertPlugInDialog --------------------------------------------
-
-class SvInsertPlugInDialog : public InsertObjectDialog_Impl
-{
-private:
- Edit aEdFileurl;
- PushButton aBtnFileurl;
- FixedLine aGbFileurl;
- MultiLineEdit aEdPluginsOptions;
- FixedLine aGbPluginsOptions;
- OKButton aOKButton1;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- INetURLObject* m_pURL;
- String m_aCommands;
-
- DECL_LINK( BrowseHdl, PushButton * );
- String GetPlugInFile() const { return aEdFileurl.GetText(); }
- String GetPlugInOptions() const { return aEdPluginsOptions.GetText(); }
-
-public:
- SvInsertPlugInDialog( Window* pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
-
- ~SvInsertPlugInDialog();
-
- virtual short Execute();
-};
-
-// class SvInsertAppletDialog --------------------------------------------
-
-class SvInsertAppletDialog : public InsertObjectDialog_Impl
-{
-private:
- FixedText aFtClassfile;
- Edit aEdClassfile;
- FixedText aFtClasslocation;
- Edit aEdClasslocation;
- PushButton aBtnClass;
- FixedLine aGbClass;
- MultiLineEdit aEdAppletOptions;
- FixedLine aGbAppletOptions;
- OKButton aOKButton1;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- INetURLObject* m_pURL;
- String m_aClass;
- String m_aCommands;
- String GetClass() const { return aEdClassfile.GetText(); }
- String GetClassLocation() const { return aEdClasslocation.GetText(); }
- String GetAppletOptions() const { return aEdAppletOptions.GetText(); }
-
- void SetClass( const String &rClass ) { aEdClassfile.SetText(rClass); }
- void SetClassLocation( const String &rLocation ) { aEdClasslocation.SetText(rLocation); }
- void SetAppletOptions( const String &rOptions ) { aEdAppletOptions.SetText(rOptions); }
- DECL_LINK( BrowseHdl, PushButton * );
-
-public:
- SvInsertAppletDialog( Window* pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
- SvInsertAppletDialog( Window* pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
- ~SvInsertAppletDialog();
-
- virtual short Execute();
-};
-
-class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
-{
-private:
- FixedText aFTName;
- Edit aEDName;
- FixedText aFTURL;
- Edit aEDURL;
- PushButton aBTOpen;
-
- RadioButton aRBScrollingOn;
- RadioButton aRBScrollingOff;
- RadioButton aRBScrollingAuto;
- FixedLine aFLScrolling;
-
- FixedLine aFLSepLeft;
- RadioButton aRBFrameBorderOn;
- RadioButton aRBFrameBorderOff;
- FixedLine aFLFrameBorder;
-
- FixedLine aFLSepRight;
- FixedText aFTMarginWidth;
- NumericField aNMMarginWidth;
- CheckBox aCBMarginWidthDefault;
- FixedText aFTMarginHeight;
- NumericField aNMMarginHeight;
- CheckBox aCBMarginHeightDefault;
- FixedLine aFLMargin;
-
- OKButton aOKButton1;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
-
- DECL_STATIC_LINK( SfxInsertFloatingFrameDialog, OpenHdl, PushButton* );
- DECL_STATIC_LINK( SfxInsertFloatingFrameDialog, CheckHdl, CheckBox* );
-
-public:
- SfxInsertFloatingFrameDialog( Window *pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
- SfxInsertFloatingFrameDialog( Window* pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
- virtual short Execute();
-};
-
-#endif // _SVX_INSDLG_HXX
-
diff --git a/svx/source/cui/insrc.cxx b/svx/source/cui/insrc.cxx
deleted file mode 100644
index e0a7bdc5f0..0000000000
--- a/svx/source/cui/insrc.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: insrc.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <svx/dialmgr.hxx>
-#include <svx/svxdlg.hxx>
-#include <svx/dialogs.hrc>
-#include "insrc.hxx"
-#include "insrc.hrc"
-
-bool SvxInsRowColDlg::isInsertBefore() const
-{
- return !aAfterBtn.IsChecked();
-}
-
-sal_uInt16 SvxInsRowColDlg::getInsertCount() const
-{
- return static_cast< sal_uInt16 >( aCountEdit.GetValue() );
-}
-
-SvxInsRowColDlg::SvxInsRowColDlg(Window* pParent, bool bCol, ULONG nHelpId )
- : ModalDialog( pParent, SVX_RES(DLG_INS_ROW_COL) ),
- aCount( this, SVX_RES( FT_COUNT ) ),
- aCountEdit( this, SVX_RES( ED_COUNT ) ),
- aInsFL( this, SVX_RES( FL_INS ) ),
- aBeforeBtn( this, SVX_RES( CB_POS_BEFORE ) ),
- aAfterBtn( this, SVX_RES( CB_POS_AFTER ) ),
- aPosFL( this, SVX_RES( FL_POS ) ),
- aRow(SVX_RES(STR_ROW)),
- aCol(SVX_RES(STR_COL)),
- aOKBtn( this, SVX_RES( BT_OK ) ),
- aCancelBtn( this, SVX_RES( BT_CANCEL ) ),
- aHelpBtn( this, SVX_RES( BT_HELP ) ),
- bColumn( bCol )
-{
- FreeResource();
- String aTmp( GetText() );
- if( bColumn )
- {
- aTmp += aCol;
- }
- else
- {
- aTmp += aRow;
- }
- SetText( aTmp );
- SetHelpId( nHelpId );
-}
-
-short SvxInsRowColDlg::Execute(void)
-{
- return ModalDialog::Execute();
-}
-
-
-
diff --git a/svx/source/cui/insrc.hrc b/svx/source/cui/insrc.hrc
deleted file mode 100644
index 133bcf70c3..0000000000
--- a/svx/source/cui/insrc.hrc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: insrc.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define FT_COUNT 1
-#define ED_COUNT 2
-#define FL_INS 3
-
-#define CB_POS_BEFORE 10
-#define CB_POS_AFTER 11
-#define FL_POS 12
-
-#define STR_ROW 20
-#define STR_COL 21
-
-#define BT_OK 100
-#define BT_CANCEL 101
-#define BT_HELP 102
diff --git a/svx/source/cui/insrc.hxx b/svx/source/cui/insrc.hxx
deleted file mode 100644
index ea6dd8569d..0000000000
--- a/svx/source/cui/insrc.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: insrc.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_INSRC_HXX
-#define _SVX_INSRC_HXX
-
-#include <svx/stddlg.hxx>
-
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/button.hxx>
-#include <vcl/group.hxx>
-#include <vcl/button.hxx>
-
-#include <tools/string.hxx>
-
-class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog
-{
- FixedText aCount;
- NumericField aCountEdit;
- FixedLine aInsFL;
-
- RadioButton aBeforeBtn;
- RadioButton aAfterBtn;
- FixedLine aPosFL;
-
- String aRow;
- String aCol;
-
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
- bool bColumn;
-
-public:
- SvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId );
-
- virtual short Execute(void);
-
- virtual bool isInsertBefore() const;
- virtual sal_uInt16 getInsertCount() const;
-};
-
-#endif
-
diff --git a/svx/source/cui/insrc.src b/svx/source/cui/insrc.src
deleted file mode 100644
index 58b6ec63a6..0000000000
--- a/svx/source/cui/insrc.src
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: insrc.src,v $
- * $Revision: 1.32 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include <svx/dialogs.hrc>
-#include "insrc.hrc"
-
-ModalDialog DLG_INS_ROW_COL
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 136 , 84 ) ;
- Text [ en-US ] = "Insert" ;
- Moveable = TRUE ;
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 80 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 80 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 80 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- RadioButton CB_POS_BEFORE
- {
- Pos = MAP_APPFONT ( 12 , 49 ) ;
- Size = MAP_APPFONT ( 56 , 10 ) ;
- Text [ en-US ] = "~Before" ;
- TabStop = TRUE ;
- };
- RadioButton CB_POS_AFTER
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 56 , 10 ) ;
- Text [ en-US ] = "A~fter" ;
- TabStop = TRUE ;
- Check = TRUE ;
- };
- NumericField ED_COUNT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 44 , 14 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 99 ;
- Value = 1 ;
- First = 1 ;
- Last = 5 ;
- };
- FixedLine FL_INS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 68 , 8 ) ;
- Text [ en-US ] = "Insert" ;
- };
- FixedLine FL_POS
- {
- Pos = MAP_APPFONT ( 6 , 38 ) ;
- Size = MAP_APPFONT ( 68 , 8 ) ;
- Text [ en-US ] = "Position";
- };
- FixedText FT_COUNT
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "~Number" ;
- Left = TRUE ;
- };
- String STR_ROW
- {
- Text [ en-US ] = " Rows" ;
- };
- String STR_COL
- {
- Text [ en-US ] = " Columns" ;
- };
-};
diff --git a/svx/source/cui/internationaloptions.cxx b/svx/source/cui/internationaloptions.cxx
deleted file mode 100644
index 266c0a715c..0000000000
--- a/svx/source/cui/internationaloptions.cxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: internationaloptions.cxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "internationaloptions.hxx"
-#ifndef _OFFAPP_INTERNATIONALOPTIONS_HRC_
-#include "internationaloptions.hrc"
-#endif
-#include <svtools/eitem.hxx>
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <svx/dialmgr.hxx>
-
-namespace offapp
-{
-
- struct InternationalOptionsPage::IMPL
- {
- FixedLine m_aFL_DefaultTextDirection;
- RadioButton m_aRB_TxtDirLeft2Right;
- RadioButton m_aRB_TxtDirRight2Left;
- FixedLine m_aFL_SheetView;
- CheckBox m_aCB_ShtVwRight2Left;
- CheckBox m_aCB_ShtVwCurrentDocOnly;
-
- BOOL m_bEnable_SheetView_Opt : 1;
-
- inline IMPL( Window* _pParent );
-
- inline void EnableOption_SheetView( BOOL _bEnable = TRUE );
- void ShowOption_SheetView( BOOL _bShow = TRUE );
-
- BOOL FillItemSet( SfxItemSet& _rSet );
- void Reset( const SfxItemSet& _rSet );
- };
-
- inline InternationalOptionsPage::IMPL::IMPL( Window* _pParent ) :
- m_aFL_DefaultTextDirection ( _pParent, SVX_RES( FL_DEFTXTDIRECTION ) )
- ,m_aRB_TxtDirLeft2Right ( _pParent, SVX_RES( RB_TXTDIR_LEFT2RIGHT ) )
- ,m_aRB_TxtDirRight2Left ( _pParent, SVX_RES( RB_TXTDIR_RIGHT2LEFT ) )
- ,m_aFL_SheetView ( _pParent, SVX_RES( FL_SHEETVIEW ) )
- ,m_aCB_ShtVwRight2Left ( _pParent, SVX_RES( CB_SHTVW_RIGHT2LEFT ) )
- ,m_aCB_ShtVwCurrentDocOnly ( _pParent, SVX_RES( CB_SHTVW_CURRENTDOCONLY ) )
-
- ,m_bEnable_SheetView_Opt ( FALSE )
- {
- ShowOption_SheetView( m_bEnable_SheetView_Opt );
- }
-
- inline void InternationalOptionsPage::IMPL::EnableOption_SheetView( BOOL _bEnable )
- {
- if( m_bEnable_SheetView_Opt != _bEnable )
- {
- ShowOption_SheetView( _bEnable );
-
- m_bEnable_SheetView_Opt = _bEnable;
- }
- }
-
- void InternationalOptionsPage::IMPL::ShowOption_SheetView( BOOL _bShow )
- {
- m_aFL_SheetView.Show( _bShow );
- m_aCB_ShtVwRight2Left.Show( _bShow );
- m_aCB_ShtVwCurrentDocOnly.Show( _bShow );
- }
-
- BOOL InternationalOptionsPage::IMPL::FillItemSet( SfxItemSet& _rSet )
- {
- DBG_ASSERT( _rSet.GetPool(), "-InternationalOptionsPage::FillItemSet(): no pool gives rums!" );
-
- // handling of DefaultTextDirection stuff
- _rSet.Put( SfxBoolItem( _rSet.GetPool()->GetWhich( SID_ATTR_PARA_LEFT_TO_RIGHT ),
- m_aRB_TxtDirLeft2Right.IsChecked() ),
- SID_ATTR_PARA_LEFT_TO_RIGHT );
-
- // handling of SheetView stuff
-// if( m_bEnable_SheetView_Opt )
-// {
-// }
-
- return TRUE;
- }
-
- void InternationalOptionsPage::IMPL::Reset( const SfxItemSet& _rSet )
- {
- // handling of DefaultTextDirection stuff
- const SfxBoolItem* pLeft2RightItem = static_cast< const SfxBoolItem* >( GetItem( _rSet, SID_ATTR_PARA_LEFT_TO_RIGHT ) );
-
- DBG_ASSERT( pLeft2RightItem, "+InternationalOptionsPage::Reset(): SID_ATTR_PARA_LEFT_TO_RIGHT not set!" );
-
- BOOL bLeft2Right = pLeft2RightItem? pLeft2RightItem->GetValue() : TRUE;
- m_aRB_TxtDirLeft2Right.Check( bLeft2Right );
-
- // handling of SheetView stuff
-// if( m_bEnable_SheetView_Opt )
-// {
-// m_aCB_ShtVwRight2Left.Check( FALSE );
-//
-// m_aCB_ShtVwCurrentDocOnly.Check( FALSE );
-// }
- }
-
- InternationalOptionsPage::InternationalOptionsPage( Window* _pParent, const SfxItemSet& _rAttrSet ) :
- SfxTabPage ( _pParent, SVX_RES( RID_OFA_TP_INTERNATIONAL ), _rAttrSet )
-
- ,m_pImpl ( new IMPL( this ) )
- {
- FreeResource();
- }
-
- SfxTabPage* InternationalOptionsPage::CreateSd( Window* _pParent, const SfxItemSet& _rAttrSet )
- {
- return new InternationalOptionsPage( _pParent, _rAttrSet );
- }
-
- SfxTabPage* InternationalOptionsPage::CreateSc( Window* _pParent, const SfxItemSet& _rAttrSet )
- {
- InternationalOptionsPage* p = new InternationalOptionsPage( _pParent, _rAttrSet );
-// p->m_pImpl->EnableOption_SheetView();
- return p;
- }
-
- InternationalOptionsPage::~InternationalOptionsPage()
- {
- DELETEZ( m_pImpl );
- }
-
- BOOL InternationalOptionsPage::FillItemSet( SfxItemSet& _rSet )
- {
- return m_pImpl->FillItemSet( _rSet );
- }
-
- void InternationalOptionsPage::Reset( const SfxItemSet& _rSet )
- {
- m_pImpl->Reset( _rSet );
- }
-
-} // /namespace offapp
-
diff --git a/svx/source/cui/internationaloptions.hrc b/svx/source/cui/internationaloptions.hrc
deleted file mode 100644
index 84c8450274..0000000000
--- a/svx/source/cui/internationaloptions.hrc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: internationaloptions.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFAPP_INTERNATIONALOPTIONS_HRC_
-#define _OFFAPP_INTERNATIONALOPTIONS_HRC_
-
-#include <svtools/controldims.hrc>
-
-// general sizes
-#define PAGE_SIZE_X 260
-#define PAGE_SIZE_Y 185
-
-// x-positions
-#define COL_0 RSC_SP_TBPG_INNERBORDER_LEFT
-#define COL_1 (COL_0 + RSC_SP_FLGR_SPACE_X)
-#define COL_2 (COL_1 + RSC_SP_CHK_TEXTINDENT)
-#define COL_LAST (PAGE_SIZE_X - RSC_SP_TBPG_INNERBORDER_RIGHT)
-
-// heights
-#define HEIGHT_FL RSC_CD_FIXEDLINE_HEIGHT
-#define HEIGHT_RB RSC_CD_RADIOBUTTON_HEIGHT
-#define HEIGHT_CB RSC_CD_CHECKBOX_HEIGHT
-
-// vertical spacing
-#define SPACE_FL_NEXTCTRL_Y RSC_SP_CTRL_DESC_Y
-
-// y-positions
-#define ROW_0 RSC_SP_TBPG_INNERBORDER_TOP
-#define ROW_1 (ROW_0 + HEIGHT_FL + SPACE_FL_NEXTCTRL_Y)
-#define ROW_2 (ROW_1 + HEIGHT_RB + RSC_SP_CTRL_GROUP_Y)
-#define ROW_3 (ROW_2 + HEIGHT_RB + RSC_SP_FLGR_SPACE_Y)
-#define ROW_4 (ROW_3 + HEIGHT_FL + SPACE_FL_NEXTCTRL_Y)
-#define ROW_5 (ROW_4 + HEIGHT_CB + RSC_SP_CTRL_GROUP_Y)
-
-// misc calculation makros
-#define WIDTH2END( startcol ) (COL_LAST - startcol)
-
-
-// resource IDs
-#define FL_DEFTXTDIRECTION 1
-#define RB_TXTDIR_LEFT2RIGHT 2
-#define RB_TXTDIR_RIGHT2LEFT 3
-#define FL_SHEETVIEW 4
-#define CB_SHTVW_RIGHT2LEFT 5
-#define CB_SHTVW_CURRENTDOCONLY 6
-
-#endif
-
diff --git a/svx/source/cui/internationaloptions.hxx b/svx/source/cui/internationaloptions.hxx
deleted file mode 100644
index 439dc2a272..0000000000
--- a/svx/source/cui/internationaloptions.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: internationaloptions.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFAPP_INTERNATIONALOPTIONS_HXX_
-#define _OFFAPP_INTERNATIONALOPTIONS_HXX_
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/fixed.hxx>
-
-namespace offapp
-{
- class InternationalOptionsPage : public SfxTabPage
- {
- private:
- struct IMPL;
- IMPL* m_pImpl;
-
- protected:
- InternationalOptionsPage( Window* _pParent, const SfxItemSet& _rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& _rSet );
- virtual void Reset( const SfxItemSet& _rSet );
-
- public:
- virtual ~InternationalOptionsPage();
-
- static SfxTabPage* CreateSd( Window* _pParent, const SfxItemSet& _rAttrSet );
- static SfxTabPage* CreateSc( Window* _pParent, const SfxItemSet& _rAttrSet );
- };
-
-} // /namespace offapp
-
-#endif
-
diff --git a/svx/source/cui/internationaloptions.src b/svx/source/cui/internationaloptions.src
deleted file mode 100644
index f98109c84e..0000000000
--- a/svx/source/cui/internationaloptions.src
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: internationaloptions.src,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "internationaloptions.hrc"
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-TabPage RID_OFA_TP_INTERNATIONAL
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( PAGE_SIZE_X, PAGE_SIZE_Y ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
-
- FixedLine FL_DEFTXTDIRECTION
- {
- Pos = MAP_APPFONT( COL_0, ROW_0 );
- Size = MAP_APPFONT( WIDTH2END( COL_0 ), HEIGHT_FL );
- Text [ en-US ] = "Default text direction";
- };
-
- RadioButton RB_TXTDIR_LEFT2RIGHT
- {
- Pos = MAP_APPFONT( COL_1, ROW_1 );
- Size = MAP_APPFONT( WIDTH2END( COL_1 ), HEIGHT_RB );
- Group = TRUE;
- Text [ en-US ] = "~Left-to-right";
- };
-
- RadioButton RB_TXTDIR_RIGHT2LEFT
- {
- Pos = MAP_APPFONT( COL_1, ROW_2 );
- Size = MAP_APPFONT( WIDTH2END( COL_1 ), HEIGHT_RB );
- Text [ en-US ] = "~Right-to-left";
- };
-
- FixedLine FL_SHEETVIEW
- {
- Pos = MAP_APPFONT( COL_0, ROW_3 );
- Size = MAP_APPFONT( WIDTH2END( COL_0 ), HEIGHT_FL );
- Text [ en-US ] = "Sheet view";
- };
-
- CheckBox CB_SHTVW_RIGHT2LEFT
- {
- Pos = MAP_APPFONT( COL_1, ROW_4 );
- Size = MAP_APPFONT( WIDTH2END( COL_1 ), HEIGHT_CB );
- Text [ en-US ] = "Right-~to-left";
- };
-
- CheckBox CB_SHTVW_CURRENTDOCONLY
- {
- Pos = MAP_APPFONT( COL_2, ROW_5 );
- Size = MAP_APPFONT( WIDTH2END( COL_2 ), HEIGHT_CB );
- Text [ en-US ] = "~Current document only";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/labdlg.cxx b/svx/source/cui/labdlg.cxx
deleted file mode 100644
index 1c7cebefe9..0000000000
--- a/svx/source/cui/labdlg.cxx
+++ /dev/null
@@ -1,657 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: labdlg.cxx,v $
- * $Revision: 1.19 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <swpossizetabpage.hxx>
-
-#define _SVX_LABDLG_CXX
-
-#include <svx/svdattrx.hxx>
-#include <svx/dialogs.hrc>
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include "transfrm.hxx"
-
-#include "labdlg.hrc"
-#include "labdlg.hxx"
-
-// define ----------------------------------------------------------------
-
-#define AZ_OPTIMAL 0
-#define AZ_VON_OBEN 1
-#define AZ_VON_LINKS 2
-#define AZ_HORIZONTAL 3
-#define AZ_VERTIKAL 4
-
-#define AT_OBEN 0
-#define AT_MITTE 1
-#define AT_UNTEN 2
-
-#define WK_OPTIMAL 0
-#define WK_30 1
-#define WK_45 2
-#define WK_60 3
-#define WK_90 4
-
-// static ----------------------------------------------------------------
-
-static USHORT pCaptionRanges[] =
-{
- SDRATTR_CAPTIONTYPE,
- SDRATTR_CAPTIONFIXEDANGLE,
- SDRATTR_CAPTIONANGLE,
- SDRATTR_CAPTIONGAP,
- SDRATTR_CAPTIONESCDIR,
- SDRATTR_CAPTIONESCISREL,
- SDRATTR_CAPTIONESCREL,
- SDRATTR_CAPTIONESCABS,
- SDRATTR_CAPTIONLINELEN,
- SDRATTR_CAPTIONFITLINELEN,
- 0
-};
-
-// -----------------------------------------------------------------------
-
-SvxCaptionTabPage::SvxCaptionTabPage(Window* pParent, const SfxItemSet& rInAttrs)
- : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_CAPTION ), rInAttrs ),
-
- aCT_CAPTTYPE( this, SVX_RES( CT_CAPTTYPE ) ),
- aFT_ABSTAND( this, SVX_RES( FT_ABSTAND ) ),
- aMF_ABSTAND( this, SVX_RES( MF_ABSTAND ) ),
- aFT_WINKEL( this, SVX_RES( FT_WINKEL ) ),
- aLB_WINKEL( this, SVX_RES( LB_WINKEL ) ),
- aFT_ANSATZ( this, SVX_RES( FT_ANSATZ ) ),
- aLB_ANSATZ( this, SVX_RES( LB_ANSATZ ) ),
- aFT_UM( this, SVX_RES( FT_UM ) ),
- aMF_ANSATZ( this, SVX_RES( MF_ANSATZ ) ),
- aFT_ANSATZ_REL( this, SVX_RES( FT_ANSATZ_REL ) ),
- aLB_ANSATZ_REL( this, SVX_RES( LB_ANSATZ_REL ) ),
- aFT_LAENGE( this, SVX_RES( FT_LAENGE ) ),
- aMF_LAENGE( this, SVX_RES( MF_LAENGE ) ),
- aCB_LAENGE( this, SVX_RES( CB_LAENGE ) ),
-
- aStrHorzList( SVX_RES(STR_HORZ_LIST) ),
- aStrVertList( SVX_RES(STR_VERT_LIST) ),
-
- rOutAttrs ( rInAttrs )
-{
- //------------NYI-------------------------------------------
- aFT_WINKEL.Hide();
- aLB_WINKEL.Hide();
-
- //------------Positionen korrigieren-------------------------
- aFT_ANSATZ_REL.SetPosPixel( aFT_UM.GetPosPixel() );
- aLB_ANSATZ_REL.SetPosPixel(
- Point(
- aFT_ANSATZ_REL.GetPosPixel().X()+aFT_ANSATZ_REL.GetSizePixel().Width()+6,
- aLB_ANSATZ.GetPosPixel().Y() )
- );
-
- aMF_ANSATZ.SetPosPixel(
- Point(
- aFT_UM.GetPosPixel().X()+aFT_UM.GetSizePixel().Width()+6,
- aLB_ANSATZ.GetPosPixel().Y() )
- );
-
- sal_uInt16 nBitmap;
- for( nBitmap = 0; nBitmap < CAPTYPE_BITMAPS_COUNT; nBitmap++ )
- {
- mpBmpCapTypes[nBitmap] = new Image(Bitmap(SVX_RES(BMP_CAPTTYPE_1 + nBitmap)), COL_LIGHTMAGENTA );
- mpBmpCapTypesH[nBitmap] = new Image(Bitmap(SVX_RES(BMP_CAPTTYPE_1_H + nBitmap)), COL_LIGHTMAGENTA );
- }
-
- //------------ValueSet installieren--------------------------
- aCT_CAPTTYPE.SetStyle( aCT_CAPTTYPE.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD );
- aCT_CAPTTYPE.SetColCount(5);//XXX
- aCT_CAPTTYPE.SetLineCount(1);
- aCT_CAPTTYPE.SetSelectHdl(LINK( this, SvxCaptionTabPage, SelectCaptTypeHdl_Impl));
-
- Image aImage;
- aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_1, aImage, String(SVX_RES(STR_CAPTTYPE_1)));
- aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_2, aImage, String(SVX_RES(STR_CAPTTYPE_2)));
- aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_3, aImage, String(SVX_RES(STR_CAPTTYPE_3)));
-
- FillValueSet();
-
- aLB_ANSATZ.SetSelectHdl(LINK(this,SvxCaptionTabPage,AnsatzSelectHdl_Impl));
- aLB_ANSATZ_REL.SetSelectHdl(LINK(this,SvxCaptionTabPage,AnsatzRelSelectHdl_Impl));
- aCB_LAENGE.SetClickHdl(LINK(this,SvxCaptionTabPage,LineOptHdl_Impl));
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxCaptionTabPage::~SvxCaptionTabPage()
-{
- sal_uInt16 nBitmap;
- for( nBitmap = 0; nBitmap < CAPTYPE_BITMAPS_COUNT; nBitmap++ )
- {
- delete mpBmpCapTypes[nBitmap];
- delete mpBmpCapTypesH[nBitmap];
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCaptionTabPage::Construct()
-{
- // Setzen des Rechtecks und der Workingarea
- DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxCaptionTabPage::FillItemSet( SfxItemSet& _rOutAttrs)
-{
- SfxItemPool* pPool = _rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
-
- SfxMapUnit eUnit;
-
- nCaptionType = aCT_CAPTTYPE.GetSelectItemId()-1;
-
- _rOutAttrs.Put( SdrCaptionTypeItem( (SdrCaptionType) nCaptionType ) );
-
- if( aMF_ABSTAND.IsValueModified() )
- {
- eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONGAP ) );
- _rOutAttrs.Put( SdrCaptionGapItem( GetCoreValue(aMF_ABSTAND, eUnit ) ) );
- }
-
- // Sonderbehandlung!!! XXX
- if( nCaptionType==SDRCAPT_TYPE1 )
- {
- switch( nEscDir )
- {
- case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break;
- case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break;
- }
- }
-
- _rOutAttrs.Put( SdrCaptionEscDirItem( (SdrCaptionEscDir)nEscDir ) );
-
- bEscRel = aLB_ANSATZ_REL.IsVisible();
- _rOutAttrs.Put( SdrCaptionEscIsRelItem( bEscRel ) );
-
- if( bEscRel )
- {
- long nVal = 0;
-
- switch( aLB_ANSATZ_REL.GetSelectEntryPos() )
- {
- case AT_OBEN: nVal=0;break;
- case AT_MITTE: nVal=5000;break;
- case AT_UNTEN: nVal=10000;break;
- }
- _rOutAttrs.Put( SdrCaptionEscRelItem( nVal ) );
- }
- else
- {
- if( aMF_ANSATZ.IsValueModified() )
- {
- eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONESCABS ) );
- _rOutAttrs.Put( SdrCaptionEscAbsItem( GetCoreValue(aMF_ANSATZ, eUnit ) ) );
- }
- }
-
- bFitLineLen = aCB_LAENGE.IsChecked();
- _rOutAttrs.Put( SdrCaptionFitLineLenItem( bFitLineLen ) );
-
- if( ! bFitLineLen )
- {
- if( aMF_LAENGE.IsValueModified() )
- {
- eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONLINELEN ) );
- _rOutAttrs.Put( SdrCaptionLineLenItem( GetCoreValue(aMF_LAENGE, eUnit ) ) );
- }
- }
-
-//NYI-------------die Winkel muessen noch hier rein!!! XXX----------------------
-
- return( TRUE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCaptionTabPage::Reset( const SfxItemSet& )
-{
-
- //------------Metrik einstellen-----------------------------
-
- FieldUnit eFUnit = GetModuleFieldUnit( &rOutAttrs );
-
- switch ( eFUnit )
- {
- case FUNIT_CM:
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ;//prevent warning
- }
- SetFieldUnit( aMF_ABSTAND, eFUnit );
- SetFieldUnit( aMF_ANSATZ, eFUnit );
- SetFieldUnit( aMF_LAENGE, eFUnit );
-
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
-
- USHORT nWhich;
- SfxMapUnit eUnit;
-
- //------- Winkel ----------
- nWhich = GetWhich( SDRATTR_CAPTIONANGLE );
- nFixedAngle = ( ( const SdrCaptionAngleItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
-
- //------- absolute Ansatzentfernung ----------
- nWhich = GetWhich( SDRATTR_CAPTIONESCABS );
- eUnit = pPool->GetMetric( nWhich );
- nEscAbs = ( ( const SdrCaptionEscAbsItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
- SetMetricValue( aMF_ANSATZ, nEscAbs, eUnit );
- nEscAbs = static_cast<long>(aMF_ANSATZ.GetValue());
-
- //------- relative Ansatzentfernung ----------
- nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
- nEscRel = (long)( ( const SdrCaptionEscRelItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
-
- //------- Linienlaenge ----------
- nWhich = GetWhich( SDRATTR_CAPTIONLINELEN );
- eUnit = pPool->GetMetric( nWhich );
- nLineLen = ( ( const SdrCaptionLineLenItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
- SetMetricValue( aMF_LAENGE, nLineLen, eUnit );
- nLineLen = static_cast<long>(aMF_LAENGE.GetValue());
-
- //------- Abstand zur Box ----------
- nWhich = GetWhich( SDRATTR_CAPTIONGAP );
- eUnit = pPool->GetMetric( nWhich );
- nGap = ( ( const SdrCaptionGapItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
- SetMetricValue( aMF_ABSTAND, nGap, eUnit );
- nGap = static_cast<long>(aMF_ABSTAND.GetValue());
-
- nCaptionType = (short)( ( const SdrCaptionTypeItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
- bFixedAngle = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFIXEDANGLE ) ) ).GetValue();
- bFitLineLen = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
- nEscDir = (short)( ( const SdrCaptionEscDirItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
- bEscRel = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
-
- // Sonderbehandlung!!! XXX
- if( nCaptionType==SDRCAPT_TYPE1 )
- {
- switch( nEscDir )
- {
- case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break;
- case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break;
- }
- }
-
- nAnsatzRelPos=AT_MITTE;
- nAnsatzTypePos=AZ_OPTIMAL;
- nWinkelTypePos=WK_OPTIMAL;
-
- aMF_ABSTAND.SetValue( nGap );
-
- if( nEscDir == SDRCAPT_ESCHORIZONTAL )
- {
- if( bEscRel )
- {
- if( nEscRel < 3333 )
- nAnsatzRelPos = AT_OBEN;
- if( nEscRel > 6666 )
- nAnsatzRelPos = AT_UNTEN;
- nAnsatzTypePos = AZ_HORIZONTAL;
- }
- else
- {
- nAnsatzTypePos = AZ_VON_OBEN;
- aMF_ANSATZ.SetValue( nEscAbs );
- }
- }
- else if( nEscDir == SDRCAPT_ESCVERTICAL )
- {
- if( bEscRel )
- {
- if( nEscRel < 3333 )
- nAnsatzRelPos = AT_OBEN;
- if( nEscRel > 6666 )
- nAnsatzRelPos = AT_UNTEN;
- nAnsatzTypePos = AZ_VERTIKAL;
- }
- else
- {
- nAnsatzTypePos = AZ_VON_LINKS;
- aMF_ANSATZ.SetValue( nEscAbs );
- }
- }
- else if( nEscDir == SDRCAPT_ESCBESTFIT )
- {
- nAnsatzTypePos = AZ_OPTIMAL;
- }
-
- if( bFixedAngle )
- {
- if( nFixedAngle <= 3000 )
- nWinkelTypePos=WK_30;
- else if( nFixedAngle <= 4500 )
- nWinkelTypePos=WK_45;
- else if( nFixedAngle <= 6000 )
- nWinkelTypePos=WK_60;
- else
- nWinkelTypePos=WK_90;
- }
-
- aCB_LAENGE.Check( bFitLineLen );
- aMF_LAENGE.SetValue( nLineLen );
-
- aLB_ANSATZ.SelectEntryPos( nAnsatzTypePos );
- aLB_WINKEL.SelectEntryPos( nWinkelTypePos );
-
- SetupAnsatz_Impl( nAnsatzTypePos );
- aCT_CAPTTYPE.SelectItem( nCaptionType+1 );// Enum beginnt bei 0!
- SetupType_Impl( nCaptionType+1 );
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxCaptionTabPage::Create( Window* pWindow,
- const SfxItemSet& rOutAttrs )
-{
- return( new SvxCaptionTabPage( pWindow, rOutAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxCaptionTabPage::GetRanges()
-{
- return( pCaptionRanges );
-}
-
-//------------------------------------------------------------------------
-
-void SvxCaptionTabPage::SetupAnsatz_Impl( USHORT nType )
-{
- xub_StrLen nCnt=0, nIdx=0;
-
- switch( nType )
- {
- case AZ_OPTIMAL:
-// aMF_ANSATZ.Hide(); //XXX auch bei OPTIMAL werden Abswerte genommen
-// aFT_UM.Hide();
- aMF_ANSATZ.Show();
- aFT_UM.Show();
- aFT_ANSATZ_REL.Hide();
- aLB_ANSATZ_REL.Hide();
- nEscDir = SDRCAPT_ESCBESTFIT;
- break;
-
- case AZ_VON_OBEN:
- aMF_ANSATZ.Show();
- aFT_UM.Show();
- aFT_ANSATZ_REL.Hide();
- aLB_ANSATZ_REL.Hide();
- nEscDir = SDRCAPT_ESCHORIZONTAL;
- break;
-
- case AZ_VON_LINKS:
- aMF_ANSATZ.Show();
- aFT_UM.Show();
- aFT_ANSATZ_REL.Hide();
- aLB_ANSATZ_REL.Hide();
- nEscDir = SDRCAPT_ESCVERTICAL;
- break;
-
- case AZ_HORIZONTAL:
- aLB_ANSATZ_REL.Clear();
- nCnt = aStrHorzList.GetTokenCount();
- for( nIdx=0 ; nIdx<nCnt ; nIdx++ )
- aLB_ANSATZ_REL.InsertEntry( aStrHorzList.GetToken(nIdx) );
- aLB_ANSATZ_REL.SelectEntryPos( nAnsatzRelPos );
-
- aMF_ANSATZ.Hide();
- aFT_UM.Hide();
- aFT_ANSATZ_REL.Show();
- aLB_ANSATZ_REL.Show();
- nEscDir = SDRCAPT_ESCHORIZONTAL;
- break;
-
- case AZ_VERTIKAL:
- aLB_ANSATZ_REL.Clear();
- nCnt = aStrVertList.GetTokenCount();
- for( nIdx=0 ; nIdx<nCnt ; nIdx++ )
- aLB_ANSATZ_REL.InsertEntry( aStrVertList.GetToken(nIdx) );
- aLB_ANSATZ_REL.SelectEntryPos( nAnsatzRelPos );
-
- aMF_ANSATZ.Hide();
- aFT_UM.Hide();
- aFT_ANSATZ_REL.Show();
- aLB_ANSATZ_REL.Show();
- nEscDir = SDRCAPT_ESCVERTICAL;
- break;
- }
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox )
-{
- if( pListBox == &aLB_ANSATZ )
- {
- SetupAnsatz_Impl( aLB_ANSATZ.GetSelectEntryPos() );
- }
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox )
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox )
-{
- if( pListBox == &aLB_ANSATZ_REL )
- {
- nAnsatzRelPos = aLB_ANSATZ_REL.GetSelectEntryPos();
- }
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox )
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxCaptionTabPage, LineOptHdl_Impl, Button *, pButton )
-{
- if( pButton == &aCB_LAENGE )
- {
- if( aCB_LAENGE.IsChecked() || ! aCB_LAENGE.IsEnabled() )
- {
- aFT_LAENGE.Disable();
- aMF_LAENGE.Disable();
- }
- else
- {
- aFT_LAENGE.Enable();
- aMF_LAENGE.Enable();
- }
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxCaptionTabPage, SelectCaptTypeHdl_Impl, void *, EMPTYARG )
-{
- SetupType_Impl( aCT_CAPTTYPE.GetSelectItemId() );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxCaptionTabPage, SelectCaptTypeHdl_Impl, void *, EMPTYARG )
-
-//------------------------------------------------------------------------
-
-void SvxCaptionTabPage::SetupType_Impl( USHORT nType )
-{
- switch( nType-1 )
- {
- case SDRCAPT_TYPE1:
- aFT_WINKEL.Disable();
- aLB_WINKEL.Disable();
- aFT_LAENGE.Disable();
- aCB_LAENGE.Disable();
- LineOptHdl_Impl( &aCB_LAENGE );
- break;
-
- case SDRCAPT_TYPE2:
- aFT_WINKEL.Enable();
- aLB_WINKEL.Enable();
- aFT_LAENGE.Disable();
- aCB_LAENGE.Disable();
- LineOptHdl_Impl( &aCB_LAENGE );
- break;
-
- case SDRCAPT_TYPE3:
- aFT_WINKEL.Enable();
- aLB_WINKEL.Enable();
- aFT_LAENGE.Enable();
- aCB_LAENGE.Enable();
- LineOptHdl_Impl( &aCB_LAENGE );
- break;
-
- case SDRCAPT_TYPE4:
- aFT_WINKEL.Enable();
- aLB_WINKEL.Enable();
- aFT_LAENGE.Enable();
- aCB_LAENGE.Enable();
- LineOptHdl_Impl( &aCB_LAENGE );
- break;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCaptionTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxTabPage::DataChanged( rDCEvt );
-
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- FillValueSet();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCaptionTabPage::FillValueSet()
-{
- bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- Image** ppBitmaps = bHighContrast ? mpBmpCapTypesH : mpBmpCapTypes;
- aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_1, *(ppBitmaps[0]) );
- aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_2, *(ppBitmaps[1]) );
- aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_3, *(ppBitmaps[2]) );
-}
-
-//========================================================================
-
-
-SvxCaptionTabDialog::SvxCaptionTabDialog(Window* pParent, const SdrView* pSdrView, USHORT nAnchorTypes)
- : SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_CAPTION ) ),
- pView ( pSdrView ),
- nAnchorCtrls(nAnchorTypes)
-{
- FreeResource();
-
- DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
-
- //different positioning page in Writer
- if(nAnchorCtrls & 0x00ff )
- {
- AddTabPage( RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create,
- SvxSwPosSizeTabPage::GetRanges );
- RemoveTabPage( RID_SVXPAGE_POSITION_SIZE);
- }
- else
- {
- AddTabPage( RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create,
- SvxPositionSizeTabPage::GetRanges );
- RemoveTabPage( RID_SVXPAGE_SWPOSSIZE );
- }
- AddTabPage( RID_SVXPAGE_CAPTION, SvxCaptionTabPage::Create,
- SvxCaptionTabPage::GetRanges );
-}
-
-// -----------------------------------------------------------------------
-
-SvxCaptionTabDialog::~SvxCaptionTabDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void SvxCaptionTabDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
-{
- switch( nId )
- {
- case RID_SVXPAGE_POSITION_SIZE:
- ( (SvxPositionSizeTabPage&) rPage ).SetView( pView );
- ( (SvxPositionSizeTabPage&) rPage ).Construct();
- if( nAnchorCtrls & SVX_OBJ_NORESIZE )
- ( (SvxPositionSizeTabPage&) rPage ).DisableResize();
-
- if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
- ( (SvxPositionSizeTabPage&) rPage ).DisableProtect();
- break;
- case RID_SVXPAGE_SWPOSSIZE :
- {
- SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage);
- rSwPage.EnableAnchorTypes(nAnchorCtrls);
- rSwPage.SetValidateFramePosLink( aValidateLink );
- }
- break;
-
- case RID_SVXPAGE_CAPTION:
- ( (SvxCaptionTabPage&) rPage ).SetView( pView );
- ( (SvxCaptionTabPage&) rPage ).Construct();
- break;
- }
-}
-/*-- 05.03.2004 13:54:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxCaptionTabDialog::SetValidateFramePosLink( const Link& rLink )
-{
- aValidateLink = rLink;
-}
-
-
diff --git a/svx/source/cui/labdlg.hrc b/svx/source/cui/labdlg.hrc
deleted file mode 100644
index 4916dbbfd0..0000000000
--- a/svx/source/cui/labdlg.hrc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: labdlg.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svx/dialogs.hrc>
-//#define RID_SVXPAGE_CAPTION 1000
-//#define RID_SVXDLG_CAPTION 1001
-
-#define TAB_CONTROL 1
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-
-#define FT_ABSTAND 1
-#define FT_WINKEL 2
-#define FT_ANSATZ 3
-#define FT_LAENGE 4
-#define FT_UM 5
-#define FT_ANSATZ_REL 6
-
-#define CT_CAPTTYPE 1
-
-#define MF_ABSTAND 1
-#define MF_ANSATZ 2
-#define MF_LAENGE 3
-
-#define CB_LAENGE 1
-
-#define CM_LAENGE 1
-
-#define LB_WINKEL 1
-#define LB_ANSATZ 2
-#define LB_ANSATZ_REL 3
-
-#define STR_CAPTTYPE_1 1
-#define STR_CAPTTYPE_2 2
-#define STR_CAPTTYPE_3 3
-#define STR_CAPTTYPE_4 4
-#define STR_HORZ_LIST 10
-#define STR_VERT_LIST 11
-
-#define BMP_CAPTTYPE_1 1
-#define BMP_CAPTTYPE_2 2
-#define BMP_CAPTTYPE_3 3
-#define BMP_CAPTTYPE_4 4
-
-#define BMP_CAPTTYPE_1_H 5
-#define BMP_CAPTTYPE_2_H 6
-#define BMP_CAPTTYPE_3_H 7
-#define BMP_CAPTTYPE_4_H 8
-
-#define SHOW_HORZ 1
-#define SHOW_VERT 2
-#define SHOW_ABS 3
-#define SHOW_NONE 4
diff --git a/svx/source/cui/labdlg.hxx b/svx/source/cui/labdlg.hxx
deleted file mode 100644
index c1ec3e261c..0000000000
--- a/svx/source/cui/labdlg.hxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: labdlg.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_LABDLG_HXX
-#define _SVX_LABDLG_HXX
-
-// include ---------------------------------------------------------------
-
-
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#include <svtools/valueset.hxx>
-#include <sfx2/tabdlg.hxx>
-class SdrView;
-
-// class SvxCaptionTabPage -----------------------------------------------
-
-const sal_uInt16 CAPTYPE_BITMAPS_COUNT = 3;
-
-class SvxCaptionTabPage : public SfxTabPage
-{
-private:
- ValueSet aCT_CAPTTYPE;
- FixedText aFT_ABSTAND;
- MetricField aMF_ABSTAND;
- FixedText aFT_WINKEL;
- ListBox aLB_WINKEL;
- FixedText aFT_ANSATZ;
- ListBox aLB_ANSATZ;
- FixedText aFT_UM;
- MetricField aMF_ANSATZ;
- FixedText aFT_ANSATZ_REL;
- ListBox aLB_ANSATZ_REL;
- FixedText aFT_LAENGE;
- MetricField aMF_LAENGE;
- CheckBox aCB_LAENGE;
-
- Image* mpBmpCapTypes[CAPTYPE_BITMAPS_COUNT];
- Image* mpBmpCapTypesH[CAPTYPE_BITMAPS_COUNT];
-
- String aStrHorzList;
- String aStrVertList;
-
- short nCaptionType;
- BOOL bFixedAngle;
- INT32 nFixedAngle;
- INT32 nGap;
- short nEscDir;
- BOOL bEscRel;
- INT32 nEscAbs;
- INT32 nEscRel;
- INT32 nLineLen;
- BOOL bFitLineLen;
-
- USHORT nAnsatzRelPos;
- USHORT nAnsatzTypePos;
- USHORT nWinkelTypePos;
-
-#ifdef _SVX_LABDLG_CXX
- void SetupAnsatz_Impl( USHORT nType );
- void SetupType_Impl( USHORT nType );
- DECL_LINK( AnsatzSelectHdl_Impl, ListBox * );
- DECL_LINK( AnsatzRelSelectHdl_Impl, ListBox * );
- DECL_LINK( LineOptHdl_Impl, Button * );
- DECL_LINK( SelectCaptTypeHdl_Impl, void * );
-#endif
-
- const SfxItemSet& rOutAttrs;
- const SdrView* pView;
-
-public:
- SvxCaptionTabPage( Window* pParent, const SfxItemSet& rInAttrs );
- virtual ~SvxCaptionTabPage();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
- void Construct();
- void SetView( const SdrView* pSdrView )
- { pView = pSdrView; }
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- void FillValueSet();
-};
-
-// class SvxCaptionTabDialog ---------------------------------------------
-
-class SvxCaptionTabDialog : public SfxTabDialog
-{
-private:
-// const SfxItemSet& rOutAttrs;
- const SdrView* pView;
- USHORT nAnchorCtrls;
-
- Link aValidateLink;
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-public:
-
- SvxCaptionTabDialog(Window* pParent, const SdrView* pView,
- USHORT nAnchorTypes = 0 );
-
- ~SvxCaptionTabDialog();
-
- //link for the Writer to validate positions
- void SetValidateFramePosLink( const Link& rLink );
-};
-
-
-#endif //_SVX_LABDLG_HXX
-
diff --git a/svx/source/cui/labdlg.src b/svx/source/cui/labdlg.src
deleted file mode 100644
index baacc7af89..0000000000
--- a/svx/source/cui/labdlg.src
+++ /dev/null
@@ -1,301 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: labdlg.src,v $
- * $Revision: 1.34 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include "labdlg.hrc"
- // pragma ----------------------------------------------------------------
-
- // RID_SVXPAGE_CAPTION ---------------------------------------------------
-TabPage RID_SVXPAGE_CAPTION
-{
- HelpId = HID_CAPTION ;
- Hide = TRUE ;
- //Size = MAP_APPFONT ( 189 , 97 ) ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Callouts" ;
- Control CT_CAPTTYPE
- {
- HelpId = HID_CAPTION_CTL_TYPE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 187 , 38 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_ABSTAND
- {
- Pos = MAP_APPFONT ( 6 , 53 ) ;
- Size = MAP_APPFONT ( 42 , 8 ) ;
- Text [ en-US ] = "~Spacing" ;
- };
- MetricField MF_ABSTAND
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 50 , 51 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 240000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 50 ;
- };
- FixedText FT_WINKEL
- {
- Pos = MAP_APPFONT ( 106 , 53 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~Angle" ;
- };
- ListBox LB_WINKEL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 143 , 51 ) ;
- Size = MAP_APPFONT ( 50 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- CurPos = 0 ;
- StringList [ en-US ] =
- {
- < "Free" ; 1 ; > ;
- < "30 Degrees" ; 3000 ; > ;
- < "45 Degrees" ; 4500 ; > ;
- < "60 Degrees" ; 6000 ; > ;
- < "90 Degrees" ; 9000 ; > ;
- };
- };
- FixedText FT_ANSATZ
- {
- Pos = MAP_APPFONT ( 6 , 69 ) ;
- Size = MAP_APPFONT ( 42 , 8 ) ;
- Text [ en-US ] = "~Extension" ;
- };
- ListBox LB_ANSATZ
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 50 , 67 ) ;
- Size = MAP_APPFONT ( 50 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- CurPos = 0 ;
- StringList [ en-US ] =
- {
- < "Optimal" ; 4 ; > ;
- < "From top" ; 3 ; > ;
- < "From left" ; 3 ; > ;
- < "Horizontal" ; 1 ; > ;
- < "Vertical" ; 2 ; > ;
- };
- };
- FixedText FT_UM
- {
- Pos = MAP_APPFONT ( 106 , 69 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~By" ;
- };
- MetricField MF_ANSATZ
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 143 , 67 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 240000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 50 ;
- };
- FixedText FT_ANSATZ_REL
- {
- Pos = MAP_APPFONT ( 106 , 69 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~Position" ;
- };
- ListBox LB_ANSATZ_REL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 143 , 67 ) ;
- Size = MAP_APPFONT ( 50 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_LAENGE
- {
- Pos = MAP_APPFONT ( 6 , 85 ) ;
- Size = MAP_APPFONT ( 42 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Länge : ~Lõnge */
- /* ### ACHTUNG: Neuer Text in Resource? ~Länge : ~Lõnge */
- Text [ en-US ] = "~Length" ;
- };
- MetricField MF_LAENGE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 50 , 83 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 240000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 50 ;
- };
- CheckBox CB_LAENGE
- {
- Pos = MAP_APPFONT ( 106 , 84 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Optimal" ;
- };
- String STR_CAPTTYPE_1
- {
- Text [ en-US ] = "Straight Line" ;
- };
- String STR_CAPTTYPE_2
- {
- Text [ en-US ] = "Angled Line" ;
- };
- String STR_CAPTTYPE_3
- {
- Text [ en-US ] = "Angled Connector Line" ;
- };
- String STR_CAPTTYPE_4
- {
- Text [ en-US ] = "Double-angled line" ;
- };
- String STR_HORZ_LIST
- {
- Text [ en-US ] = "Top;Middle;Bottom" ;
- };
- String STR_VERT_LIST
- {
- Text [ en-US ] = "Left;Middle;Right" ;
- };
- Bitmap BMP_CAPTTYPE_1
- {
- File = "legtyp1.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_2
- {
- File = "legtyp2.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_3
- {
- File = "legtyp3.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_4
- {
- File = "legtyp4.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_1_H
- {
- File = "legtyp1_hc.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_2_H
- {
- File = "legtyp2_hc.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_3_H
- {
- File = "legtyp3_hc.bmp" ;
- };
- Bitmap BMP_CAPTTYPE_4_H
- {
- File = "legtyp4_hc.bmp" ;
- };
-};
- // RID_SVXDLG_CAPTION ----------------------------------------------------
-
-#define _POS_SIZE_TEXT \
- Text [ en-US ] = "Position and Size" ; \
-
-TabDialog RID_SVXDLG_CAPTION\
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 237 , 161 ) ;
- Text [ en-US ] = "Callouts" ;\
- Moveable = TRUE ;
- TabControl TAB_CONTROL\
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 189 , 97 ) ;
- PageList =
- {
- PageItem\
- {
- Identifier = RID_SVXPAGE_POSITION_SIZE ;
- PageResID = RID_SVXPAGE_POSITION_SIZE ;
- _POS_SIZE_TEXT
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_SWPOSSIZE;
- PageResID = RID_SVXPAGE_SWPOSSIZE;
- _POS_SIZE_TEXT
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_CAPTION ;
- PageResID = RID_SVXPAGE_CAPTION ;
- Text [ en-US ] = "Callout" ;
- };
- };
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/linkdlg.cxx b/svx/source/cui/linkdlg.cxx
deleted file mode 100644
index cb4fe626f8..0000000000
--- a/svx/source/cui/linkdlg.cxx
+++ /dev/null
@@ -1,721 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: linkdlg.cxx,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <linkdlg.hxx>
-#include <vcl/svapp.hxx>
-
-#include <tools/urlobj.hxx>
-#include <svtools/svmedit.hxx>
-#include <svtools/filedlg.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/timer.hxx>
-#include <svtools/svtabbx.hxx>
-
-#include <svuidlg.hrc>
-#include <sfx2/linkmgr.hxx>
-#include <sfx2/linksrc.hxx>
-#include <svtools/soerr.hxx>
-#include <sfx2/lnkbase.hxx>
-#include <sfx2/objsh.hxx>
-
-#include <svx/dialmgr.hxx>
-
-#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
-
-#define MAX_FILENAME 18
-#define MAX_LINKNAME 18
-#define MAX_TYPENAME 15
-#define MAX_UPDATENAME 10
-
-#define FILEOBJECT ( OBJECT_CLIENT_FILE & ~OBJECT_CLIENT_SO )
-
-using namespace sfx2;
-
-SV_DECL_IMPL_REF_LIST(SvBaseLink,SvBaseLink*)
-
-// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
-static long nTabs[] =
- { 4, // Number of Tabs
- 0, 77, 144, 209
- };
-
-
-SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, SvLinkManager* pMgr, BOOL bHtml )
- : ModalDialog( pParent, SVX_RES( MD_UPDATE_BASELINKS ) ),
- aFtFiles( this, SVX_RES( FT_FILES ) ),
- aFtLinks( this, SVX_RES( FT_LINKS ) ),
- aFtType( this, SVX_RES( FT_TYPE ) ),
- aFtStatus( this, SVX_RES( FT_STATUS ) ),
- aCancelButton1( this, SVX_RES( 1 ) ),
- aHelpButton1( this, SVX_RES( 1 ) ),
- aPbUpdateNow( this, SVX_RES( PB_UPDATE_NOW ) ),
- aPbOpenSource( this, SVX_RES( PB_OPEN_SOURCE ) ),
- aPbChangeSource( this, SVX_RES( PB_CHANGE_SOURCE ) ),
- aPbBreakLink( this, SVX_RES( PB_BREAK_LINK ) ),
- aFtFiles2( this, SVX_RES( FT_FILES2 ) ),
- aFtSource2( this, SVX_RES( FT_SOURCE2 ) ),
- aFtType2( this, SVX_RES( FT_TYPE2 ) ),
- aFtUpdate( this, SVX_RES( FT_UPDATE ) ),
- aRbAutomatic( this, SVX_RES( RB_AUTOMATIC ) ),
- aRbManual( this, SVX_RES( RB_MANUAL ) ),
- aFtFullFileName( this, SVX_RES( FT_FULL_FILE_NAME ) ),
- aFtFullSourceName( this, SVX_RES( FT_FULL_SOURCE_NAME ) ),
- aFtFullTypeName( this, SVX_RES( FT_FULL_TYPE_NAME ) ),
- aStrAutolink( SVX_RES( STR_AUTOLINK ) ),
- aStrManuallink( SVX_RES( STR_MANUALLINK ) ),
- aStrBrokenlink( SVX_RES( STR_BROKENLINK ) ),
- aStrGraphiclink( SVX_RES( STR_GRAPHICLINK ) ),
- aStrButtonclose( SVX_RES( STR_BUTTONCLOSE ) ),
- aStrCloselinkmsg( SVX_RES( STR_CLOSELINKMSG ) ),
- aStrCloselinkmsgMulti( SVX_RES( STR_CLOSELINKMSG_MULTI ) ),
- aStrWaitinglink( SVX_RES( STR_WAITINGLINK ) ),
- pLinkMgr( NULL ),
- bHtmlMode(bHtml),
- aTbLinks( this, SVX_RES(TB_LINKS ) )
-{
- FreeResource();
-
- aTbLinks.SetHelpId(HID_LINKDLG_TABLB);
- aTbLinks.SetSelectionMode( MULTIPLE_SELECTION );
- aTbLinks.SetTabs( &nTabs[0], MAP_APPFONT );
- aTbLinks.Resize(); // OS: Hack fuer richtige Selektion
-
- //JP 24.02.99: UpdateTimer fuer DDE-/Grf-Links, auf die gewarted wird
- aUpdateTimer.SetTimeoutHdl( LINK( this, SvBaseLinksDlg, UpdateWaitingHdl ) );
- aUpdateTimer.SetTimeout( 1000 );
-
- OpenSource().Hide();
-
- Links().SetSelectHdl( LINK( this, SvBaseLinksDlg, LinksSelectHdl ) );
- Links().SetDoubleClickHdl( LINK( this, SvBaseLinksDlg, LinksDoubleClickHdl ) );
- Automatic().SetClickHdl( LINK( this, SvBaseLinksDlg, AutomaticClickHdl ) );
- Manual().SetClickHdl( LINK( this, SvBaseLinksDlg, ManualClickHdl ) );
- UpdateNow().SetClickHdl( LINK( this, SvBaseLinksDlg, UpdateNowClickHdl ) );
-// OpenSource().SetClickHdl( LINK( this, SvBaseLinksDlg, OpenSourceClickHdl ) );
- ChangeSource().SetClickHdl( LINK( this, SvBaseLinksDlg, ChangeSourceClickHdl ) );
- if(!bHtmlMode)
- BreakLink().SetClickHdl( LINK( this, SvBaseLinksDlg, BreakLinkClickHdl ) );
- else
- BreakLink().Hide();
-
- SetManager( pMgr );
-}
-
-SvBaseLinksDlg::~SvBaseLinksDlg()
-{
-}
-
-/*************************************************************************
-|* SvBaseLinksDlg::Handler()
-|*
-|* Beschreibung
-|* Ersterstellung MM 14.06.94
-|* Letzte Aenderung JP 30.05.95
-*************************************************************************/
-IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
-{
- USHORT nSelectionCount = pSvTabListBox ?
- (USHORT)pSvTabListBox->GetSelectionCount() : 0;
- if(nSelectionCount > 1)
- {
- //bei Mehrfachselektion ggf. alte Eintraege deselektieren
- SvLBoxEntry* pEntry = 0;
- SvBaseLink* pLink = 0;
- pEntry = pSvTabListBox->GetHdlEntry();
- pLink = (SvBaseLink*)pEntry->GetUserData();
- USHORT nObjectType = pLink->GetObjType();
- if((OBJECT_CLIENT_FILE & nObjectType) != OBJECT_CLIENT_FILE)
- {
- pSvTabListBox->SelectAll(FALSE);
- pSvTabListBox->Select(pEntry);
- nSelectionCount = 1;
- }
- else
- {
- for( USHORT i = 0; i < nSelectionCount; i++)
- {
- pEntry = i == 0 ? pSvTabListBox->FirstSelected() :
- pSvTabListBox->NextSelected(pEntry);
- DBG_ASSERT(pEntry, "Wo ist der Entry?");
- pLink = (SvBaseLink*)pEntry->GetUserData();
- DBG_ASSERT(pLink, "Wo ist der Link?");
- if( (OBJECT_CLIENT_FILE & pLink->GetObjType()) != OBJECT_CLIENT_FILE )
- pSvTabListBox->Select( pEntry, FALSE );
-
- }
- }
-
- UpdateNow().Enable();
-
- Automatic().Disable();
- Manual().Check();
- Manual().Disable();
- }
- else
- {
- USHORT nPos;
- SvBaseLink* pLink = GetSelEntry( &nPos );
- if( !pLink )
- return 0;
-
- UpdateNow().Enable();
-
- String sType, sLink;
- String *pLinkNm = &sLink, *pFilter = 0;
-
- if( FILEOBJECT & pLink->GetObjType() )
- {
- Automatic().Disable();
- Manual().Check();
- Manual().Disable();
- if( OBJECT_CLIENT_GRF == pLink->GetObjType() )
- pLinkNm = 0, pFilter = &sLink;
- }
- else
- {
- Automatic().Enable();
- Manual().Enable();
-
- if( LINKUPDATE_ALWAYS == pLink->GetUpdateMode() )
- Automatic().Check();
- else
- Manual().Check();
- }
-
- String aFileName;
- pLinkMgr->GetDisplayNames( pLink, &sType, &aFileName, pLinkNm, pFilter );
-
- FileName().SetText( aFileName );
- SourceName().SetText( sLink );
- TypeName().SetText( sType );
- }
- return 0;
-}
-
-IMPL_LINK_INLINE_START( SvBaseLinksDlg, LinksDoubleClickHdl, SvTabListBox *, pSvTabListBox )
-{
- (void)pSvTabListBox;
-
- ChangeSourceClickHdl( 0 );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvBaseLinksDlg, LinksDoubleClickHdl, SvTabListBox *, pSvTabListBox )
-
-IMPL_LINK_INLINE_START( SvBaseLinksDlg, AutomaticClickHdl, RadioButton *, pRadioButton )
-{
- (void)pRadioButton;
-
- USHORT nPos;
- SvBaseLink* pLink = GetSelEntry( &nPos );
- if( pLink && !( FILEOBJECT & pLink->GetObjType() ) &&
- LINKUPDATE_ALWAYS != pLink->GetUpdateMode() )
- SetType( *pLink, nPos, LINKUPDATE_ALWAYS );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvBaseLinksDlg, AutomaticClickHdl, RadioButton *, pRadioButton )
-
-IMPL_LINK_INLINE_START( SvBaseLinksDlg, ManualClickHdl, RadioButton *, pRadioButton )
-{
- (void)pRadioButton;
-
- USHORT nPos;
- SvBaseLink* pLink = GetSelEntry( &nPos );
- if( pLink && !( FILEOBJECT & pLink->GetObjType() ) &&
- LINKUPDATE_ONCALL != pLink->GetUpdateMode())
- SetType( *pLink, nPos, LINKUPDATE_ONCALL );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvBaseLinksDlg, ManualClickHdl, RadioButton *, pRadioButton )
-
-IMPL_LINK( SvBaseLinksDlg, UpdateNowClickHdl, PushButton *, EMPTYARG )
-{
- SvTabListBox& rListBox = Links();
- USHORT nSelCnt = (USHORT)rListBox.GetSelectionCount();
- if( 255 < nSelCnt )
- nSelCnt = 255;
-
- std::vector< SvBaseLink* > aLnkArr;
- std::vector< USHORT > aPosArr;
-
- SvLBoxEntry* pE = rListBox.FirstSelected();
- while( pE )
- {
- USHORT nFndPos = (USHORT)rListBox.GetModel()->GetAbsPos( pE );
- if( LISTBOX_ENTRY_NOTFOUND != nFndPos )
- {
- aLnkArr.push_back( static_cast< SvBaseLink* >( pE->GetUserData() ) );
- aPosArr.push_back( nFndPos );
- }
- pE = rListBox.NextSelected( pE );
- }
-
- if( !aLnkArr.empty() )
- {
- for( USHORT n = 0; n < aLnkArr.size(); ++n )
- {
- SvBaseLinkRef xLink = aLnkArr[ n ];
-
- // suche erstmal im Array nach dem Eintrag
- for( USHORT i = 0; i < pLinkMgr->GetLinks().Count(); ++i )
- if( &xLink == *pLinkMgr->GetLinks()[ i ] )
- {
- xLink->SetUseCache( FALSE );
- SetType( *xLink, aPosArr[ n ], xLink->GetUpdateMode() );
- xLink->SetUseCache( TRUE );
- break;
- }
- }
-
- // falls jemand der Meinung ist, seine Links auszutauschen (SD)
- SvLinkManager* pNewMgr = pLinkMgr;
- pLinkMgr = 0;
- SetManager( pNewMgr );
-
-
- if( 0 == (pE = rListBox.GetEntry( aPosArr[ 0 ] )) ||
- pE->GetUserData() != aLnkArr[ 0 ] )
- {
- // suche mal den Link
- pE = rListBox.First();
- while( pE )
- {
- if( pE->GetUserData() == aLnkArr[ 0 ] )
- break;
- pE = rListBox.Next( pE );
- }
-
- if( !pE )
- pE = rListBox.FirstSelected();
- }
-
- if( pE )
- {
- SvLBoxEntry* pSelEntry = rListBox.FirstSelected();
- if( pE != pSelEntry )
- rListBox.Select( pSelEntry, FALSE );
- rListBox.Select( pE );
- rListBox.MakeVisible( pE );
- }
- }
- return 0;
-}
-
-/*
-IMPL_LINK_INLINE_START( SvBaseLinksDlg, OpenSourceClickHdl, PushButton *, pPushButton )
-{
- DBG_ASSERT( !this, "Open noch nicht impl." );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvBaseLinksDlg, OpenSourceClickHdl, PushButton *, pPushButton )
-*/
-
-IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton )
-{
- (void)pPushButton;
-
- USHORT nSelectionCount = (USHORT)Links().GetSelectionCount();
- if(nSelectionCount > 1)
- {
- PathDialog aPathDlg( this );
- String sType, sFile, sLinkName;
- String sFilter;
- SvLBoxEntry* pEntry = Links().FirstSelected();
- SvBaseLink* pLink = (SvBaseLink*)pEntry->GetUserData();
- pLinkMgr->GetDisplayNames( pLink, &sType, &sFile, 0, 0 );
- INetURLObject aUrl(sFile);
- if(aUrl.GetProtocol() == INET_PROT_FILE)
- {
- rtl::OUString sOldPath(aUrl.PathToFileName());
- sal_Int32 nLen = aUrl.GetName().getLength();
- sOldPath = sOldPath.copy(0, sOldPath.getLength() - nLen);
- aPathDlg.SetPath(sOldPath);
- }
- if(aPathDlg.Execute() == RET_OK)
- {
- String aPath = aPathDlg.GetPath();
-
- for( USHORT i = 0; i < nSelectionCount; i++)
- {
- pEntry = i==0 ?
- Links().FirstSelected() :
- Links().NextSelected( pEntry );
- DBG_ASSERT(pEntry,"Wo ist der Entry");
- pLink = (SvBaseLink*)pEntry->GetUserData();
- DBG_ASSERT(pLink,"Wo ist der Link");
- pLinkMgr->GetDisplayNames( pLink, &sType, &sFile, &sLinkName, &sFilter );
- INetURLObject aUrl_(sFile);
- INetURLObject aUrl2(aPath, INET_PROT_FILE);
- aUrl2.insertName( aUrl_.getName() );
- String sNewLinkName;
- MakeLnkName( sNewLinkName, 0 ,
- aUrl2.GetMainURL(INetURLObject::DECODE_TO_IURI), sLinkName, &sFilter);
- pLink->SetLinkSourceName( sNewLinkName );
- pLink->Update();
- }
- if( pLinkMgr->GetPersist() )
- pLinkMgr->GetPersist()->SetModified();
- SvLinkManager* pNewMgr = pLinkMgr;
- pLinkMgr = 0;
- SetManager( pNewMgr );
- }
- }
- else
- {
- USHORT nPos;
- SvBaseLink* pLink = GetSelEntry( &nPos );
- if ( pLink && (pLink->GetLinkSourceName().Len() != 0) )
- pLink->Edit( this, LINK( this, SvBaseLinksDlg, EndEditHdl ) );
- }
- return 0;
-}
-
-IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
-{
- (void)pPushButton;
-
- BOOL bModified = FALSE;
- if(Links().GetSelectionCount() <= 1)
- {
- USHORT nPos;
- SvBaseLinkRef xLink = GetSelEntry( &nPos );
- if( !xLink.Is() )
- return 0;
-
- QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
-
- if( RET_YES == aBox.Execute() )
- {
- Links().GetModel()->Remove( Links().GetEntry( nPos ) );
-
- // falls Object noch vorhanden, dann das schliessen
- BOOL bNewLnkMgr = OBJECT_CLIENT_FILE == xLink->GetObjType();
-
- // dem Link sagen, das er aufgeloest wird!
- xLink->Closed();
-
- // falls einer vergessen hat sich auszutragen
- if( xLink.Is() )
- pLinkMgr->Remove( &xLink );
-
- if( bNewLnkMgr )
- {
- SvLinkManager* pNewMgr = pLinkMgr;
- pLinkMgr = 0;
- SetManager( pNewMgr );
-
- SvLBoxEntry* pEntry = Links().GetEntry( nPos ? --nPos : 0 );
- if( pEntry )
- Links().SetCurEntry( pEntry );
- }
- bModified = TRUE;
- }
- }
- else
- {
- QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
-
- if( RET_YES == aBox.Execute() )
- {
-
- SvBaseLinkMemberList aLinkList;
- SvLBoxEntry* pEntry = Links().FirstSelected();
- while ( pEntry )
- {
- void * pUD = pEntry->GetUserData();
- if( pUD )
- aLinkList.Append( (SvBaseLink*)pUD );
- pEntry = Links().NextSelected(pEntry);
- }
- Links().RemoveSelection();
- for( ULONG i = 0; i < aLinkList.Count(); i++ )
- {
- SvBaseLinkRef xLink = aLinkList.GetObject( i );
- // dem Link sagen, das er aufgeloest wird!
- xLink->Closed();
-
- // falls einer vergessen hat sich auszutragen
- pLinkMgr->Remove( &xLink );
- bModified = TRUE;
- }
- //Danach alle selektierten Eintraege entfernen
- }
- }
- if(bModified)
- {
- if( !Links().GetEntryCount() )
- {
- // Der letzte macht das Licht aus
- Automatic().Disable();
- Manual().Disable();
- UpdateNow().Disable();
-// OpenSource().Disable();
- ChangeSource().Disable();
- BreakLink().Disable();
-
- String aEmpty;
- SourceName().SetText( aEmpty );
- TypeName().SetText( aEmpty );
- }
- if( pLinkMgr->GetPersist() )
- pLinkMgr->GetPersist()->SetModified();
- }
- return 0;
-}
-
-IMPL_LINK( SvBaseLinksDlg, UpdateWaitingHdl, Timer*, pTimer )
-{
- (void)pTimer;
-// for( SvLBoxEntry* pBox = Links().First(); pBox;
-// pBox = Links().Next( pBox ))
-
- Links().SetUpdateMode(FALSE);
- for( ULONG nPos = Links().GetEntryCount(); nPos; )
- {
- SvLBoxEntry* pBox = Links().GetEntry( --nPos );
- SvBaseLinkRef xLink( (SvBaseLink*)pBox->GetUserData() );
- if( xLink.Is() )
- {
- String sCur( ImplGetStateStr( *xLink ) ),
- sOld( Links().GetEntryText( pBox, 3 ) );
- if( sCur != sOld )
- Links().SetEntryText( sCur, pBox, 3 );
- }
- }
- Links().SetUpdateMode(TRUE);
- return 0;
-}
-
-IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink )
-{
- USHORT nPos;
- SvBaseLink* pLink = GetSelEntry( &nPos );
-
- if ( pLink != _pLink && _pLink && _pLink->WasLastEditOK() )
- {
- // JP 09.01.98:
- // StarImpress/Draw tauschen die LinkObjecte selbst aus!
- // also suche den Link im Manager, wenn der nicht mehr existiert,
- // dann setze fuelle die Liste komplett neu. Ansonsten braucht
- // nur der editierte Linkt aktualisiert werden.
- BOOL bLinkFnd = FALSE;
- for( USHORT n = pLinkMgr->GetLinks().Count(); n; )
- if( _pLink == &(*pLinkMgr->GetLinks()[ --n ]) )
- {
- bLinkFnd = TRUE;
- break;
- }
-
- if( bLinkFnd )
- {
- Links().SetUpdateMode(FALSE);
- Links().GetModel()->Remove( Links().GetEntry( nPos ) );
- SvLBoxEntry* pToUnselect = Links().FirstSelected();
- InsertEntry( *_pLink, nPos, sal_True );
- if(pToUnselect)
- Links().Select(pToUnselect, FALSE);
- Links().SetUpdateMode(TRUE);
- }
- else
- {
- SvLinkManager* pNewMgr = pLinkMgr;
- pLinkMgr = 0;
- SetManager( pNewMgr );
- }
- if( pLinkMgr->GetPersist() )
- pLinkMgr->GetPersist()->SetModified();
- }
- else if ( pLink == _pLink )
- {
- DBG_ERRORFILE( "SvBaseLinksDlg::EndEditHdl(): wrong link" );
- }
- return 0;
-}
-
-String SvBaseLinksDlg::ImplGetStateStr( const SvBaseLink& rLnk )
-{
- String sRet;
- if( !rLnk.GetObj() )
- sRet = Brokenlink();
- else if( rLnk.GetObj()->IsPending() )
- {
- sRet = Waitinglink();
- StartUpdateTimer();
- }
- else if( LINKUPDATE_ALWAYS == rLnk.GetUpdateMode() )
- sRet = Autolink();
- else
- sRet = Manuallink();
-
- return sRet;
-}
-
-void SvBaseLinksDlg::SetManager( SvLinkManager* pNewMgr )
-{
- if( pLinkMgr == pNewMgr )
- return;
-
- if( pNewMgr )
- // Update muss vor Clear gestoppt werden
- Links().SetUpdateMode( FALSE );
-
- Links().Clear();
- pLinkMgr = pNewMgr;
-
- if( pLinkMgr )
- {
- SvBaseLinks& rLnks = (SvBaseLinks&)pLinkMgr->GetLinks();
- for( USHORT n = 0; n < rLnks.Count(); ++n )
- {
- SvBaseLinkRef* pLinkRef = rLnks[ n ];
- if( !pLinkRef->Is() )
- {
- rLnks.Remove( n, 1 );
- --n;
- continue;
- }
- if( (*pLinkRef)->IsVisible() )
- InsertEntry( **pLinkRef );
- }
-
- if( rLnks.Count() )
- {
- SvLBoxEntry* pEntry = Links().GetEntry( 0 );
- Links().SetCurEntry( pEntry );
- Links().Select( pEntry );
- LinksSelectHdl( 0 );
- }
- Links().SetUpdateMode( TRUE );
- Links().Invalidate();
- }
-}
-
-
-void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, USHORT nPos, sal_Bool bSelect )
-{
- String aEntry, sFileNm, sLinkNm, sTypeNm, sFilter;
-
- pLinkMgr->GetDisplayNames( (SvBaseLink*)&rLink, &sTypeNm, &sFileNm, &sLinkNm, &sFilter );
-
- // GetTab(0) gibt die Position der von der TabListBox automatisch eingefuegten
- // Bitmap. Die Breite der ersten Textspalte ergibt sich deshalb aus Tab(2)-Tab(1)
- long nWidthPixel = Links().GetLogicTab( 2 ) - Links().GetLogicTab( 1 );
- nWidthPixel -= SV_TAB_BORDER;
- XubString aTxt = Links().GetEllipsisString( sFileNm, nWidthPixel, TEXT_DRAW_PATHELLIPSIS );
- INetURLObject aPath( sFileNm, INET_PROT_FILE );
- String aFileName = aPath.getName();
- if( aFileName.Len() > aTxt.Len() )
- aTxt = aFileName;
- else if( aTxt.Search( aFileName, aTxt.Len() - aFileName.Len() ) == STRING_NOTFOUND )
- // filename not in string
- aTxt = aFileName;
-
- aEntry = aTxt;
- aEntry += '\t';
- if( OBJECT_CLIENT_GRF == rLink.GetObjType() )
- aEntry += sFilter;
- else
- aEntry += sLinkNm;
- aEntry += '\t';
- aEntry += sTypeNm;
- aEntry += '\t';
- aEntry += ImplGetStateStr( rLink );
-
- SvLBoxEntry * pE = Links().InsertEntryToColumn( aEntry, nPos );
- pE->SetUserData( (void*)&rLink );
- if(bSelect)
- Links().Select(pE);
-}
-
-SvBaseLink* SvBaseLinksDlg::GetSelEntry( USHORT* pPos )
-{
- SvLBoxEntry* pE = Links().FirstSelected();
- USHORT nPos;
- if( pE && LISTBOX_ENTRY_NOTFOUND !=
- ( nPos = (USHORT)Links().GetModel()->GetAbsPos( pE ) ) )
- {
- DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
-
- if( pPos )
- *pPos = nPos;
- return (SvBaseLink*)pE->GetUserData();
- }
- return 0;
-}
-
-void SvBaseLinksDlg::SetType( SvBaseLink& rLink,
- USHORT nSelPos,
- USHORT nType )
-{
- rLink.SetUpdateMode( nType );
- rLink.Update();
- SvLBoxEntry* pBox = Links().GetEntry( nSelPos );
- Links().SetEntryText( ImplGetStateStr( rLink ), pBox, 3 );
- if( pLinkMgr->GetPersist() )
- pLinkMgr->GetPersist()->SetModified();
-}
-
-void SvBaseLinksDlg::SetActLink( SvBaseLink * pLink )
-{
- if( pLinkMgr )
- {
- const SvBaseLinks& rLnks = pLinkMgr->GetLinks();
- USHORT nSelect = 0;
- for( USHORT n = 0; n < rLnks.Count(); ++n )
- {
- SvBaseLinkRef* pLinkRef = rLnks[ n ];
- // #109573# only visible links have been inserted into the TreeListBox,
- // invisible ones have to be skipped here
- if( (*pLinkRef)->IsVisible() )
- {
- if( pLink == *pLinkRef )
- {
- Links().Select( Links().GetEntry( nSelect ) );
- LinksSelectHdl( 0 );
- return ;
- }
- nSelect++;
- }
- }
- }
-}
-
diff --git a/svx/source/cui/linkdlg.hxx b/svx/source/cui/linkdlg.hxx
deleted file mode 100644
index 2b746d16b0..0000000000
--- a/svx/source/cui/linkdlg.hxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: linkdlg.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _LINKDLG_HXX
-#define _LINKDLG_HXX
-
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
-
-#include <svtools/svmedit.hxx> // MultiLineEdit
-#include <svtools/svtabbx.hxx> // MultiLineEdit
-
-/********************** SvUpdateLinksDialog ******************************
-*************************************************************************/
-namespace sfx2
-{
- class SvLinkManager;
- class SvBaseLink;
-}
-
-class SvBaseLinksDlg : public ModalDialog
-{
- using Window::SetType;
-
- FixedText aFtFiles;
- FixedText aFtLinks;
- FixedText aFtType;
- FixedText aFtStatus;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- PushButton aPbUpdateNow;
- PushButton aPbOpenSource;
- PushButton aPbChangeSource;
- PushButton aPbBreakLink;
- FixedText aFtFiles2;
- FixedText aFtSource2;
- FixedText aFtType2;
- FixedText aFtUpdate;
- RadioButton aRbAutomatic;
- RadioButton aRbManual;
- FixedText aFtFullFileName;
- FixedText aFtFullSourceName;
- FixedText aFtFullTypeName;
- String aStrAutolink;
- String aStrManuallink;
- String aStrBrokenlink;
- String aStrGraphiclink;
- String aStrButtonclose;
- String aStrCloselinkmsg;
- String aStrCloselinkmsgMulti;
- String aStrWaitinglink;
- sfx2::SvLinkManager* pLinkMgr;
- BOOL bHtmlMode;
- SvTabListBox aTbLinks;
- Timer aUpdateTimer;
-
-#if _SOLAR__PRIVATE
- DECL_LINK( LinksSelectHdl, SvTabListBox * );
- DECL_LINK( LinksDoubleClickHdl, SvTabListBox * );
- DECL_LINK( AutomaticClickHdl, RadioButton * );
- DECL_LINK( ManualClickHdl, RadioButton * );
- DECL_LINK( UpdateNowClickHdl, PushButton * );
- DECL_LINK( OpenSourceClickHdl, PushButton * );
- DECL_LINK( ChangeSourceClickHdl, PushButton * );
- DECL_LINK( BreakLinkClickHdl, PushButton * );
- DECL_LINK( UpdateWaitingHdl, Timer * );
- DECL_LINK( EndEditHdl, sfx2::SvBaseLink* );
- sfx2::SvBaseLink* GetSelEntry( USHORT* pPos );
- String ImplGetStateStr( const sfx2::SvBaseLink& );
- void SetType( sfx2::SvBaseLink& rLink, USHORT nPos, USHORT nType );
- void InsertEntry( const sfx2::SvBaseLink& rLink, USHORT nPos = LISTBOX_APPEND, sal_Bool bSelect = sal_False);
-#endif
-
- void StartUpdateTimer() { aUpdateTimer.Start(); }
-
- SvTabListBox& Links() { return aTbLinks; }
- FixedText& FileName() { return aFtFullFileName; }
- FixedText& SourceName() { return aFtFullSourceName; }
- FixedText& TypeName() { return aFtFullTypeName; }
- RadioButton& Automatic() { return aRbAutomatic; }
- RadioButton& Manual() { return aRbManual; }
- PushButton& UpdateNow() { return aPbUpdateNow; }
- PushButton& OpenSource() { return aPbOpenSource; }
- PushButton& ChangeSource() { return aPbChangeSource; }
- PushButton& BreakLink() { return aPbBreakLink; }
-
- String& Autolink() { return aStrAutolink; }
- String& Manuallink() { return aStrManuallink; }
- String& Brokenlink() { return aStrBrokenlink; }
- String& Graphiclink() { return aStrGraphiclink; }
- String& Buttonclose() { return aStrButtonclose; }
- String& Closelinkmsg() { return aStrCloselinkmsg; }
- String& CloselinkmsgMulti() { return aStrCloselinkmsgMulti; }
- String& Waitinglink() { return aStrWaitinglink; }
- void SetManager( sfx2::SvLinkManager* );
-
-public:
- SvBaseLinksDlg( Window * pParent, sfx2::SvLinkManager*, BOOL bHtml = FALSE );
- ~SvBaseLinksDlg();
- void SetActLink( sfx2::SvBaseLink * pLink );
-};
-
-#endif // _LINKDLG_HXX
diff --git a/svx/source/cui/macroass.cxx b/svx/source/cui/macroass.cxx
deleted file mode 100644
index ed8f8a46f3..0000000000
--- a/svx/source/cui/macroass.cxx
+++ /dev/null
@@ -1,719 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.cxx,v $
- * $Revision: 1.21 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#define ITEMID_MACRO 0
-#include <svtools/macitem.hxx>
-#undef ITEMID_MACRO
-
-#include "macroass.hxx"
-
-#include <basic/basmgr.hxx>
-#include <svx/dialmgr.hxx>
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-
-#include <svtools/svmedit.hxx>
-#include "cfgutil.hxx"
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#include "macroass.hrc"
-#include "svx/dialogs.hrc"
-#include <sfx2/macrconf.hxx>
-#include "headertablistbox.hxx"
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::frame::XFrame;
-
-class _SfxMacroTabPage_Impl
-{
-public:
- _SfxMacroTabPage_Impl( void );
- ~_SfxMacroTabPage_Impl();
-
- String maStaticMacroLBLabel;
- PushButton* pAssignPB;
- PushButton* pDeletePB;
- String* pStrEvent;
- String* pAssignedMacro;
- ListBox* pScriptTypeLB;
- _HeaderTabListBox* pEventLB;
- SfxConfigGroupListBox_Impl* pGroupLB;
- FixedText* pFT_MacroLBLabel;
- SfxConfigFunctionListBox_Impl* pMacroLB;
-
- FixedText* pMacroFT;
- String* pMacroStr;
- FNGetRangeHdl fnGetRange;
- FNGetMacrosOfRangeHdl fnGetMacroOfRange;
-
- BOOL bReadOnly;
- Timer maFillGroupTimer;
- BOOL bGotEvents;
-};
-
-_SfxMacroTabPage_Impl::_SfxMacroTabPage_Impl( void ) :
- pAssignPB( NULL ),
- pDeletePB( NULL ),
- pStrEvent( NULL ),
- pAssignedMacro( NULL ),
- pScriptTypeLB( NULL ),
- pEventLB( NULL ),
- pGroupLB( NULL ),
- pFT_MacroLBLabel( NULL ),
- pMacroLB( NULL ),
- pMacroFT( NULL ),
- pMacroStr( NULL ),
- fnGetRange( NULL ),
- fnGetMacroOfRange( NULL ),
- bReadOnly( FALSE ),
- bGotEvents( FALSE )
-{
-}
-
-_SfxMacroTabPage_Impl::~_SfxMacroTabPage_Impl()
-{
- delete pAssignPB;
- delete pDeletePB;
- delete pStrEvent;
- delete pAssignedMacro;
- delete pScriptTypeLB;
- delete pEventLB;
- delete pGroupLB;
- delete pMacroLB;
- delete pFT_MacroLBLabel;
- delete pMacroFT;
- delete pMacroStr;
-}
-
-
-SvStringsDtor* _ImpGetRangeHdl( _SfxMacroTabPage*, const String& rLanguage );
-SvStringsDtor* _ImpGetMacrosOfRangeHdl( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
-
-static USHORT __FAR_DATA aPageRg[] = {
- SID_ATTR_MACROITEM, SID_ATTR_MACROITEM,
- 0
-};
-
-// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
-static long nTabs[] =
- {
- 2, // Number of Tabs
- 0, 90
- };
-
-#define TAB_WIDTH_MIN 10
-
-// IDs for items in HeaderBar of EventLB
-#define ITEMID_EVENT 1
-#define ITMEID_ASSMACRO 2
-
-
-#define LB_EVENTS_ITEMPOS 1
-#define LB_MACROS_ITEMPOS 2
-
-String ConvertToUIName_Impl( SvxMacro *pMacro, const String& /*rLanguage*/ )
-{
- String aName( pMacro->GetMacName() );
- String aEntry;
- if ( ! pMacro->GetLanguage().EqualsAscii("JavaScript") )
- {
- USHORT nCount = aName.GetTokenCount('.');
- aEntry = aName.GetToken( nCount-1, '.' );
- if ( nCount > 2 )
- {
- aEntry += '(';
- aEntry += aName.GetToken( 0, '.' );
- aEntry += '.';
- aEntry += aName.GetToken( nCount-2, '.' );
- aEntry += ')';
- }
- return aEntry;
- }
- else
- return aName;
-}
-
-void _SfxMacroTabPage::EnableButtons( const String& rLangName )
-{
- // Solange die Eventbox leer ist, nichts tun
- const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected();
- if ( pE )
- {
- // Gebundenes Macro holen
- const SvxMacro* pM = aTbl.Get( (USHORT)(ULONG) pE->GetUserData() );
- mpImpl->pDeletePB->Enable( 0 != pM && !mpImpl->bReadOnly );
-
- // Bei gleichem ScriptType Zuweisung nur, wenn Macro sich
- // ge"andert hat; bei verschiedenem ScriptType, wenn Script nicht leer
- String sEventMacro;
- sEventMacro = ((SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS ))->GetText();
- if ( rLangName.EqualsAscii("JavaScript") )
- {
- DBG_ERROR( "_SfxMacroTabPage::EnableButtons(): this is not an up to date usage!" );
- }
- else
- {
- SfxMacroInfo* pInfo = mpImpl->pMacroLB->GetMacroInfo();
- String sSelMacro;
- if ( pInfo )
- sSelMacro = pInfo->GetMacroName();
- if( pM && rLangName != pM->GetLanguage() )
- mpImpl->pAssignPB->Enable( pInfo != 0 && !mpImpl->bReadOnly );
- else
- mpImpl->pAssignPB->Enable( pInfo && !mpImpl->bReadOnly && !sSelMacro.EqualsIgnoreCaseAscii( sEventMacro ) );
- }
- }
-}
-
-_SfxMacroTabPage::_SfxMacroTabPage( Window* pParent, const ResId& rResId, const SfxItemSet& rAttrSet )
- : SfxTabPage( pParent, rResId, rAttrSet )
-
-{
- mpImpl = new _SfxMacroTabPage_Impl;
- mpImpl->fnGetRange = &_ImpGetRangeHdl;
- mpImpl->fnGetMacroOfRange = &_ImpGetMacrosOfRangeHdl;
-}
-
-_SfxMacroTabPage::~_SfxMacroTabPage()
-{
- DELETEZ( mpImpl );
-}
-
-void _SfxMacroTabPage::AddEvent( const String & rEventName, USHORT nEventId )
-{
- String sTmp( rEventName );
- sTmp += '\t';
-
- // falls die Tabelle schon gueltig ist
- SvxMacro* pM = aTbl.Get( nEventId );
- if( pM )
- {
- String sNew( ConvertToUIName_Impl( pM, mpImpl->pScriptTypeLB->GetSelectEntry() ) );
- sTmp += sNew;
- }
-
- SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().InsertEntry( sTmp );
- pE->SetUserData( reinterpret_cast< void* >( sal::static_int_cast< sal_IntPtr >( nEventId )) );
-}
-
-void _SfxMacroTabPage::ScriptChanged( const String& aLangName )
-{
- // neue Bereiche und deren Funktionen besorgen
- {
- mpImpl->pGroupLB->SetScriptType( aLangName );
- mpImpl->pGroupLB->Show();
- mpImpl->pMacroLB->Show();
- mpImpl->pMacroFT->SetText( *mpImpl->pMacroStr );
- }
-
- EnableButtons( aLangName );
-}
-
-void _SfxMacroTabPage::SetGetRangeLink( FNGetRangeHdl pFn )
-{
- mpImpl->fnGetRange = pFn;
-}
-
-FNGetRangeHdl _SfxMacroTabPage::GetGetRangeLink() const
-{
- return mpImpl->fnGetRange;
-}
-
-void _SfxMacroTabPage::SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn )
-{
- mpImpl->fnGetMacroOfRange = pFn;
-}
-
-FNGetMacrosOfRangeHdl _SfxMacroTabPage::GetGetMacrosOfRangeLink() const
-{
- return mpImpl->fnGetMacroOfRange;
-}
-
-BOOL _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet )
-{
- SvxMacroItem aItem( GetWhich( aPageRg[0] ) );
- ((SvxMacroTableDtor&)aItem.GetMacroTable()) = aTbl;
-
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET != GetItemSet().GetItemState( aItem.Which(), TRUE, &pItem )
- || aItem != *(SvxMacroItem*)pItem )
- {
- rSet.Put( aItem );
- return TRUE;
- }
- return FALSE;
-}
-
-void _SfxMacroTabPage::PageCreated (SfxAllItemSet aSet)
-{
- const SfxPoolItem* pEventsItem;
- if( !mpImpl->bGotEvents && SFX_ITEM_SET == aSet.GetItemState( SID_EVENTCONFIG, TRUE, &pEventsItem ) )
- {
- mpImpl->bGotEvents = TRUE;
- const SfxEventNamesList& rList = ((SfxEventNamesItem*)pEventsItem)->GetEvents();
- for ( USHORT nNo = 0; nNo < rList.Count(); ++nNo )
- {
- const SfxEventName *pOwn = rList.GetObject(nNo);
- AddEvent( pOwn->maUIName, pOwn->mnId );
- }
- }
-}
-
-void _SfxMacroTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( aPageRg[0] ), TRUE, &pItem ))
- aTbl = ((SvxMacroItem*)pItem)->GetMacroTable();
-
- const SfxPoolItem* pEventsItem;
- if( !mpImpl->bGotEvents && SFX_ITEM_SET == rSet.GetItemState( SID_EVENTCONFIG, TRUE, &pEventsItem ) )
- {
- mpImpl->bGotEvents = TRUE;
- const SfxEventNamesList& rList = ((SfxEventNamesItem*)pEventsItem)->GetEvents();
- for ( USHORT nNo = 0; nNo < rList.Count(); ++nNo )
- {
- const SfxEventName *pOwn = rList.GetObject(nNo);
- AddEvent( pOwn->maUIName, pOwn->mnId );
- }
- }
-
- FillEvents();
-
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.GetEntry( 0 );
- if( pE )
- rListBox.SetCurEntry( pE );
-}
-
-void _SfxMacroTabPage::SetReadOnly( BOOL bSet )
-{
- mpImpl->bReadOnly = bSet;
-}
-
-BOOL _SfxMacroTabPage::IsReadOnly() const
-{
- return mpImpl->bReadOnly;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG )
-{
- _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl;
- SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.FirstSelected();
- ULONG nPos;
- if( !pE || LISTBOX_ENTRY_NOTFOUND ==
- ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) )
- {
- DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
- return 0;
- }
-
- USHORT nEventId = (USHORT)(ULONG)pE->GetUserData();
- String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry();
-
- const SvxMacro* pM = pThis->aTbl.Get( nEventId );
- if( pM )
- {
- if( aLanguage != pM->GetLanguage() )
- {
- pImpl->pScriptTypeLB->SelectEntry( pM->GetLanguage() );
- pThis->ScriptChanged( pM->GetLanguage() );
- }
- else
- {
- DBG_ASSERT( !aLanguage.EqualsAscii("JavaScript"), "_SfxMacroTabPage, SelectEvent_Impl(): outdated use!" );
- }
- }
-
- pThis->EnableButtons( aLanguage );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox*, EMPTYARG )
-{
- _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl;
- String sSel( pImpl->pGroupLB->GetGroup() );
- String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry();
- if( !aLanguage.EqualsAscii( "JavaScript" ) )
- {
- pImpl->pGroupLB->GroupSelected();
- SfxMacroInfo* pMacro = pImpl->pMacroLB->GetMacroInfo();
- String aLabelText;
- if( pMacro )
- {
- aLabelText = pImpl->maStaticMacroLBLabel;
- aLabelText += pMacro->GetModuleName();
- }
- else
- {
- // Wenn dort ein Macro drin ist, wurde es selektiert und der
- // AssignButton schon in SelectMacro richtig enabled
- pImpl->pAssignPB->Enable( FALSE );
- }
-
- pImpl->pFT_MacroLBLabel->SetText( aLabelText );
- }
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox*, EMPTYARG )
-{
- _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl;
- pImpl->pMacroLB->FunctionSelected();
- pThis->EnableButtons( pImpl->pScriptTypeLB->GetSelectEntry() );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit*, EMPTYARG )
-{
- pThis->EnableButtons( DEFINE_CONST_UNICODE("JavaScript") );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
-{
- _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl;
- SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.FirstSelected();
- ULONG nPos;
- if( !pE || LISTBOX_ENTRY_NOTFOUND ==
- ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) )
- {
- DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
- return 0;
- }
-
- const BOOL bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled();
-
- // aus der Tabelle entfernen
- USHORT nEvent = (USHORT)(ULONG)pE->GetUserData();
- SvxMacro *pRemoveMacro = pThis->aTbl.Remove( nEvent );
- delete pRemoveMacro;
-
- String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry();
- String sNew;
- if( bAssEnabled )
- {
- String sGroup;
- String sMacro;
- String aEntryText( sNew );
- DBG_ASSERT( !aLanguage.EqualsAscii("JavaScript"), "_SfxMacroTabPage, AssignDeleteHdl_Impl(): outdated use!" );
-
- SfxMacroInfo* pMacro = pImpl->pMacroLB->GetMacroInfo();
- sMacro = pMacro->GetQualifiedName();
- sGroup = pImpl->pGroupLB->GetGroup();
- sNew = pMacro->GetMacroName();
-
- if( sMacro.CompareToAscii( "vnd.sun.star.script:", 20 ) == COMPARE_EQUAL )
- {
- OSL_TRACE("ASSIGN_DELETE: Its a script");
- pThis->aTbl.Insert(
- nEvent, new SvxMacro( sMacro, String::CreateFromAscii("Script") ) );
- }
- else
- {
- OSL_TRACE("ASSIGN_DELETE: Its a basic macro");
- String sBasicName/*(SfxResId(STR_BASICNAME))*/;
- if ( aLanguage == sBasicName )
- pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, sGroup, STARBASIC ) );
- else
- pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, aLanguage ) );
- }
- }
-
- pImpl->pEventLB->SetUpdateMode( FALSE );
- pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS );
- rListBox.GetModel()->InvalidateEntry( pE );
- rListBox.Select( pE );
- rListBox.MakeVisible( pE );
- rListBox.SetUpdateMode( TRUE );
-
- pThis->EnableButtons( aLanguage );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton*, EMPTYARG )
-{
- pThis->ScriptChanged( pThis->mpImpl->pScriptTypeLB->GetSelectEntry() );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer*, EMPTYARG )
-{
- // FillMacroList() can take a long time -> show wait cursor and disable input
- SfxTabDialog* pTabDlg = pThis->GetTabDialog();
- // perhaps the tabpage is part of a SingleTabDialog then pTabDlg == NULL
- if ( pTabDlg )
- {
- pTabDlg->EnterWait();
- pTabDlg->EnableInput( FALSE );
- }
- pThis->FillMacroList();
- if ( pTabDlg )
- {
- pTabDlg->EnableInput( TRUE );
- pTabDlg->LeaveWait();
- }
- return 0;
-}
-
-void _SfxMacroTabPage::InitAndSetHandler()
-{
- // Handler installieren
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- HeaderBar& rHeaderBar = mpImpl->pEventLB->GetHeaderBar();
- Link aLnk(STATIC_LINK(this, _SfxMacroTabPage, AssignDeleteHdl_Impl ));
- mpImpl->pMacroLB->SetDoubleClickHdl( aLnk );
- mpImpl->pDeletePB->SetClickHdl( aLnk );
- mpImpl->pAssignPB->SetClickHdl( aLnk );
- rListBox.SetDoubleClickHdl( aLnk );
-
- rListBox.SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectEvent_Impl ));
- mpImpl->pGroupLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectGroup_Impl ));
- mpImpl->pMacroLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectMacro_Impl ));
-
- mpImpl->pScriptTypeLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, ChangeScriptHdl_Impl ));
-
- rListBox.SetSelectionMode( SINGLE_SELECTION );
- rListBox.SetTabs( &nTabs[0], MAP_APPFONT );
- Size aSize( nTabs[ 2 ], 0 );
- rHeaderBar.InsertItem( ITEMID_EVENT, *mpImpl->pStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
- aSize.Width() = 1764; // don't know what, so 42^2 is best to use...
- rHeaderBar.InsertItem( ITMEID_ASSMACRO, *mpImpl->pAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
- rListBox.SetSpaceBetweenEntries( 0 );
-
- mpImpl->pEventLB->Show();
- mpImpl->pEventLB->ConnectElements();
-
- mpImpl->pEventLB->Enable( TRUE );
- mpImpl->pGroupLB->Enable( TRUE );
- mpImpl->pMacroLB->Enable( TRUE );
-
- mpImpl->pScriptTypeLB->SetDropDownLineCount( 3 );
- String sBasicName/*(SfxResId(STR_BASICNAME))*/;
- mpImpl->pScriptTypeLB->InsertEntry( sBasicName );
- mpImpl->pScriptTypeLB->SelectEntry( sBasicName );
-
- mpImpl->pGroupLB->SetFunctionListBox( mpImpl->pMacroLB );
-
- mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
- mpImpl->maFillGroupTimer.SetTimeout( 0 );
- mpImpl->maFillGroupTimer.Start();
-}
-
-void _SfxMacroTabPage::FillMacroList()
-{
- String aLanguage = mpImpl->pScriptTypeLB->GetSelectEntry();
- if( ! aLanguage.EqualsAscii("JavaScript") )
- {
- // 2 Listboxen
- SvStringsDtor* pArr = (*mpImpl->fnGetRange)( this, String(/*SfxResId(STR_BASICNAME)*/) );
- if( pArr )
- {
- mpImpl->pGroupLB->Init(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >(),
- GetFrame(),
- ::rtl::OUString() );
-
- delete pArr;
- }
- }
-}
-
-void _SfxMacroTabPage::FillEvents()
-{
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
-
- String aLanguage = mpImpl->pScriptTypeLB->GetSelectEntry();
- ULONG nEntryCnt = rListBox.GetEntryCount();
-
- // Events aus der Tabelle holen und die EventListBox entsprechen fuellen
- for( ULONG n = 0 ; n < nEntryCnt ; ++n )
- {
- SvLBoxEntry* pE = rListBox.GetEntry( n );
- if( pE )
- {
- SvLBoxString* pLItem = ( SvLBoxString* ) pE->GetItem( LB_MACROS_ITEMPOS );
- DBG_ASSERT( pLItem && SV_ITEM_ID_LBOXSTRING == pLItem->IsA(), "_SfxMacroTabPage::FillEvents(): no LBoxString" );
-
- String sOld( pLItem->GetText() );
- String sNew;
- USHORT nEventId = ( USHORT ) ( ULONG ) pE->GetUserData();
- if( aTbl.IsKeyValid( nEventId ) )
- sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ), aLanguage );
-
- if( sOld != sNew )
- {
- pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS );
- rListBox.GetModel()->InvalidateEntry( pE );
- }
- }
- }
-}
-
-void _SfxMacroTabPage::SelectEvent( const String & /*rEventName*/, USHORT nEventId )
-{
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- ULONG nEntryCnt = rListBox.GetEntryCount();
-
- for( ULONG n = 0 ; n < nEntryCnt ; ++n )
- {
- SvLBoxEntry* pE = rListBox.GetEntry( n );
- if( pE && ( USHORT ) ( ULONG ) pE->GetUserData() == nEventId )
- {
- rListBox.SetCurEntry( pE );
- rListBox.MakeVisible( pE );
- break;
- }
- }
-}
-
-
-SvStringsDtor* __EXPORT _ImpGetRangeHdl( _SfxMacroTabPage* /*pTbPg*/, const String& rLanguage )
-{
- SvStringsDtor* pNew = new SvStringsDtor;
- SfxApplication* pSfxApp = SFX_APP();
-
- if ( !rLanguage.EqualsAscii("JavaScript") )
- {
- pSfxApp->EnterBasicCall();
-
- // AppBasic einf"ugen
- String* pNewEntry = new String( pSfxApp->GetName() );
- pNew->Insert( pNewEntry, pNew->Count() );
-
- // Aktuelles Dokument
- SfxObjectShell* pDoc = SfxObjectShell::Current();
- if ( pDoc )
- {
- String aTitle = pDoc->GetTitle();
-
- // Hack f"ur Aufruf aus der Basic-IDE : das Basic ermitteln, das
- // gerade bearbeitet wird
-
- String aAppName(DEFINE_CONST_UNICODE("BASIC - "));
- USHORT nLen = aAppName.Len();
- if ( aTitle.CompareIgnoreCaseToAscii( aAppName, nLen ) == COMPARE_EQUAL )
- {
- // Basic-Namensprefix entfernen
- aTitle.Erase( 0, nLen );
- USHORT nIndex=0, nCount=aTitle.GetTokenCount('.');
- if ( nCount > 1 )
- {
- // Namen der Library entfernen
- aTitle.GetToken( nCount-2, '.', nIndex );
- aTitle.Erase( nIndex-1 );
- }
-
- // Wenn das App-Basic gerade in der Basic-IDE bearbeitet wird, kein
- // Dokument verwenden
- pDoc = SfxObjectShell::GetFirst();
- while( pDoc )
- {
- if ( aTitle == pDoc->GetTitle() )
- break;
- pDoc = SfxObjectShell::GetNext( *pDoc );
- }
- }
-
- if ( pDoc && pDoc->GetBasicManager() != SFX_APP()->GetBasicManager() &&
- pDoc->GetBasicManager()->GetLibCount() )
- {
- pNewEntry = new String( aTitle );
- pNew->Insert( pNewEntry, pNew->Count() );
- }
- }
-
- pSfxApp->LeaveBasicCall();
- }
-
- return pNew;
-}
-
-// besorgen der Funktionen eines Bereiches
-SvStringsDtor* __EXPORT _ImpGetMacrosOfRangeHdl(
- _SfxMacroTabPage* /*pTbPg*/,
- const String& /*rLanguage*/,
- const String& /*rRange*/ )
-{
- SvStringsDtor* pNew = new SvStringsDtor;
- return pNew;
-}
-
-
-SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
- : _SfxMacroTabPage( pParent, rResId, rSet )
-{
- mpImpl->pStrEvent = new String( SVX_RES( STR_EVENT ) );
- mpImpl->pAssignedMacro = new String( SVX_RES( STR_ASSMACRO ) );
- mpImpl->pEventLB = new _HeaderTabListBox( this, SVX_RES( LB_EVENT ) );
- mpImpl->pAssignPB = new PushButton( this, SVX_RES( PB_ASSIGN ) );
- mpImpl->pDeletePB = new PushButton( this, SVX_RES( PB_DELETE ) );
- mpImpl->pScriptTypeLB = new ListBox(this, SVX_RES( LB_SCRIPTTYPE ) );
- mpImpl->pScriptTypeLB->Hide();
- mpImpl->pMacroFT = new FixedText( this, SVX_RES( FT_MACRO ) );
- mpImpl->pGroupLB = new SfxConfigGroupListBox_Impl( this, SVX_RES( LB_GROUP ) );
- mpImpl->pFT_MacroLBLabel = new FixedText( this, SVX_RES( FT_LABEL4LB_MACROS ) );
- mpImpl->maStaticMacroLBLabel= mpImpl->pFT_MacroLBLabel->GetText();
- mpImpl->pMacroLB = new SfxConfigFunctionListBox_Impl( this, SVX_RES( LB_MACROS ) );
- mpImpl->pMacroStr = new String( SVX_RES( STR_MACROS ) );
-
- FreeResource();
-
- SetFrame( rxDocumentFrame );
-
- InitAndSetHandler();
-
- ScriptChanged( String( /*SfxResId(STR_BASICNAME)*/ ) );
-}
-
-SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SfxMacroTabPage( pParent, SVX_RES( RID_SVXPAGE_EVENTASSIGN ), NULL, rAttrSet );
-}
-
-SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
- : SfxSingleTabDialog( pParent, rSet, 0 )
-{
- SfxTabPage* pPage = SfxMacroTabPage::Create( this, rSet );
- pPage->SetFrame( rxDocumentFrame );
- SetTabPage( pPage );
-}
-
-SfxMacroAssignDlg::~SfxMacroAssignDlg()
-{
-}
-
-
diff --git a/svx/source/cui/macroass.hrc b/svx/source/cui/macroass.hrc
deleted file mode 100644
index b92135bd9e..0000000000
--- a/svx/source/cui/macroass.hrc
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MACROASS_HRC
-#define _MACROASS_HRC
-
-#ifndef _SVT_CONTROLDIMS_HRC_
-#include <svtools/controldims.hrc>
-#endif
-
-#define LB_EVENT 2
-#define PB_ASSIGN 3
-#define PB_DELETE 4
-#define FT_MACRO 5
-#define LB_GROUP 6
-#define LB_MACROS 7
-#define LB_SCRIPTTYPE 8
-#define FT_LABEL4LB_MACROS 9
-#define STR_JAVASCRIPT 10
-#define STR_MACROS 11
-#define ED_JAVASCRIPT 12
-#define STR_EVENT 13
-#define STR_ASSMACRO 14
-
-
-// COL0<---------------WIDTH_1_2--------------->COL3<->COL4<----WIDTH4---->COL5
-// <--WIDTH1-->COL1<-SPACE1->COL2<--WIDTH2->
-
-#define WIDTH_TP 260 // of whole tabpage
-#define COL5 (WIDTH_TP-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define COL4 (COL5-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL3 (COL4-RSC_SP_CTRL_X)
-#define COL0 (RSC_SP_TBPG_INNERBORDER_LEFT)
-#define WIDTH1_2 (COL3-COL0) // width of upper listbox
-#define SPACE1 4 // space between lower listboxes
-#define WIDTH1 ((WIDTH1_2-SPACE1)/2) // width of lower left listbox
-#define WIDTH2 (WIDTH1_2-WIDTH1-SPACE1) // width of lower right listbox
-#define COL1 (COL0+WIDTH1)
-#define COL2 (COL1+SPACE1)
-
-#define HEIGHT_TP 185 // of whole tabpage
-#define HEIGHT0 62 // of upper listbox
-#define ROW0 6 // more than RSC_SP_FLGR_INNERBORDER_TOP cause of bad design
-#define ROW1 (ROW0+RSC_CD_PUSHBUTTON_HEIGHT) // Assign button
-#define ROW2 (ROW1+RSC_SP_CTRL_GROUP_Y)
-#define ROW3 (ROW2+RSC_CD_PUSHBUTTON_HEIGHT) // Remove button
-#define ROW4 (ROW3+RSC_SP_CTRL_GROUP_Y)
-#define ROW5 (ROW4+RSC_CD_DROPDOWN_HEIGHT) // script type listbox (hidden)
-#define ROW6 (ROW0+HEIGHT0)
-#define ROW7 (ROW6+RSC_SP_CTRL_Y)
-#define HEIGHT_EXTRA7 (RSC_CD_FIXEDTEXT_HEIGHT) // additional height for FT_LABEL4LB_MACROS
-#define ROW7A (ROW7+HEIGHT_EXTRA7)
-#define ROW8 (ROW7+RSC_CD_FIXEDTEXT_HEIGHT+HEIGHT_EXTRA7)// label for lower listboxes (2 lines!)
-#define ROW9 (HEIGHT_TP-RSC_SP_TBPG_INNERBORDER_BOTTOM)
-#define HEIGHT8 (ROW9-ROW8) // of lower listboxes
-
-#endif
-
diff --git a/svx/source/cui/macroass.hxx b/svx/source/cui/macroass.hxx
deleted file mode 100755
index 55476b1120..0000000000
--- a/svx/source/cui/macroass.hxx
+++ /dev/null
@@ -1,146 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _MACROASS_HXX
-#define _MACROASS_HXX
-
-#include "sal/config.h"
-
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svtools/macitem.hxx>
-#include <vcl/lstbox.hxx>
-#include <com/sun/star/frame/XFrame.hpp>
-
-class _SfxMacroTabPage;
-class SvStringsDtor;
-class SvTabListBox;
-class Edit;
-class String;
-
-typedef SvStringsDtor* (*FNGetRangeHdl)( _SfxMacroTabPage*, const String& rLanguage );
-typedef SvStringsDtor* (*FNGetMacrosOfRangeHdl)( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
-
-class SfxConfigGroupListBox_Impl;
-class SfxConfigFunctionListBox_Impl;
-class _HeaderTabListBox;
-class _SfxMacroTabPage_Impl;
-
-class _SfxMacroTabPage : public SfxTabPage
-{
- SvxMacroTableDtor aTbl;
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
-
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
-
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton * );
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit* );
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
-
-protected:
- _SfxMacroTabPage_Impl* mpImpl;
-
- _SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
-
- void InitAndSetHandler();
- void FillEvents();
- void FillMacroList();
- void EnableButtons( const String& rLanguage );
-
-public:
-
- virtual ~_SfxMacroTabPage();
-
- void AddEvent( const String & rEventName, USHORT nEventId );
-
- const SvxMacroTableDtor& GetMacroTbl() const;
- void SetMacroTbl( const SvxMacroTableDtor& rTbl );
- void ClearMacroTbl();
-
- virtual void ScriptChanged( const String& rLanguage );
- virtual void PageCreated (SfxAllItemSet aSet);
-
- // zum setzen / abfragen der Links
- void SetGetRangeLink( FNGetRangeHdl pFn );
- FNGetRangeHdl GetGetRangeLink() const;
- void SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn );
- FNGetMacrosOfRangeHdl GetGetMacrosOfRangeLink() const;
-
- // --------- Erben aus der Basis -------------
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void SetReadOnly( BOOL bSet );
- BOOL IsReadOnly() const;
- void SelectEvent( const String& rEventName, USHORT nEventId );
-};
-
-inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
-{
- return aTbl;
-}
-
-inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
-{
- aTbl = rTbl;
-}
-
-inline void _SfxMacroTabPage::ClearMacroTbl()
-{
- aTbl.DelDtor();
-}
-
-class SfxMacroTabPage : public _SfxMacroTabPage
-{
-public:
- SfxMacroTabPage(
- Window* pParent,
- const ResId& rId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
- const SfxItemSet& rSet
- );
-
- // --------- Erben aus der Basis -------------
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-};
-
-class SfxMacroAssignDlg : public SfxSingleTabDialog
-{
-public:
- SfxMacroAssignDlg(
- Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
- const SfxItemSet& rSet );
- virtual ~SfxMacroAssignDlg();
-};
-
-#endif
diff --git a/svx/source/cui/macroass.src b/svx/source/cui/macroass.src
deleted file mode 100644
index 84004470fb..0000000000
--- a/svx/source/cui/macroass.src
+++ /dev/null
@@ -1,143 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.src,v $
- * $Revision: 1.39 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "macroass.hrc"
-#include "svx/dialogs.hrc"
-#include "helpid.hrc"
-TabPage RID_SVXPAGE_EVENTASSIGN
-{
- Hide = TRUE ;
- SVLook = TRUE ;
- DialogControl = TRUE ;
- Size = MAP_APPFONT ( WIDTH_TP , HEIGHT_TP ) ;
- Text [ en-US ] = "Assign Macro" ;
- String STR_EVENT
- {
- Text [ en-US ] = "Event" ;
- };
- String STR_ASSMACRO
- {
- Text [ en-US ] = "Assigned macro";
- };
- Control LB_EVENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL0 , ROW0 ) ;
- Size = MAP_APPFONT ( WIDTH1_2 , HEIGHT0 ) ;
- TabStop = TRUE ;
- DialogControl = TRUE ;
- ClipChildren = TRUE ;
- Disable = TRUE ;
- Group = TRUE ;
- HelpID = HID_MACRO_LB_EVENT ;
- };
- FixedText FT_MACRO
- {
- Pos = MAP_APPFONT ( COL0 , ROW7A ) ;
- Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Group = TRUE ;
- };
- Control LB_GROUP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL0 , ROW8 ) ;
- Size = MAP_APPFONT ( WIDTH1 , HEIGHT8 ) ;
- TabStop = TRUE ;
- Group = TRUE ;
- HelpId = HID_MACRO_GROUP ;
- };
- FixedText FT_LABEL4LB_MACROS
- {
- Pos = MAP_APPFONT ( COL2 , ROW7 ) ;
- Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT + HEIGHT_EXTRA7 ) ;
- WordBreak = TRUE;
- Text [ en-US ] = "~Existing macros in:\n" ;
- };
- Control LB_MACROS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL2 , ROW8 ) ;
- Size = MAP_APPFONT ( WIDTH2 , HEIGHT8 ) ;
- TabStop = TRUE ;
- HelpId = HID_MACRO_MACROS ;
- };
- PushButton PB_ASSIGN
- {
- Pos = MAP_APPFONT ( COL4 , ROW0 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- // ### ACHTUNG: Neuer Text in Resource? Z~uweisen : Zuweisen
- Disable = TRUE ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Assign" ;
- };
- PushButton PB_DELETE
- {
- Pos = MAP_APPFONT ( COL4 , ROW2 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Disable = TRUE ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Remove" ;
- };
- ListBox LB_SCRIPTTYPE
- {
- Pos = MAP_APPFONT ( COL4 , ROW4 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , 60 ) ;
- // en-US was missing
- Text [ en-US ] = "~Scripting Language" ;
- TabStop = TRUE ;
- Disable = FALSE ;
- DropDown = TRUE ;
- };
- String STR_MACROS
- {
- Text [ en-US ] = "Macros" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/macropg.cxx b/svx/source/cui/macropg.cxx
deleted file mode 100644
index e5cd28b20f..0000000000
--- a/svx/source/cui/macropg.cxx
+++ /dev/null
@@ -1,1060 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.cxx,v $
- * $Revision: 1.22.166.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <basic/basmgr.hxx>
-
-
-#include "macropg.hxx"
-#include <vcl/msgbox.hxx>
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-#ifndef _SV_MEDIT_HXX
-#include <svtools/svmedit.hxx>
-#endif
-#ifndef _EITEM_HXX
-#include <svtools/eitem.hxx>
-#endif
-#include <tools/diagnose_ex.h>
-
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/macrconf.hxx>
-#include <sfx2/sfxdefs.hxx>
-
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-#include <svx/dialmgr.hxx>
-#include "selector.hxx"
-#include "cfg.hxx"
-#include "macropg.hrc"
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "headertablistbox.hxx"
-#include "macropg_impl.hxx"
-
-#include <comphelper/namedvaluecollection.hxx>
-
-#include <algorithm>
-#include <set>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-static ::rtl::OUString aVndSunStarUNO =
- ::rtl::OUString::createFromAscii( "vnd.sun.star.UNO:" );
-static ::rtl::OUString aVndSunStarScript =
- ::rtl::OUString::createFromAscii( "vnd.sun.star.script:" );
-
-_SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ) :
- pAssignFT( NULL ),
- pAssignPB( NULL ),
- pAssignComponentPB( NULL ),
- pDeletePB( NULL ),
- pMacroImg( NULL ),
- pComponentImg( NULL ),
- pMacroImg_h( NULL ),
- pComponentImg_h( NULL ),
- pStrEvent( NULL ),
- pAssignedMacro( NULL ),
- pEventLB( NULL ),
- bReadOnly( FALSE ),
- bIDEDialogMode( FALSE )
-{
- const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == rAttrSet.GetItemState( SID_ATTR_MACROITEM, FALSE, &pItem ) )
- bIDEDialogMode = ((const SfxBoolItem*)pItem)->GetValue();
-}
-
-_SvxMacroTabPage_Impl::~_SvxMacroTabPage_Impl()
-{
- delete pAssignFT;
- delete pAssignPB;
- delete pAssignComponentPB;
- delete pDeletePB;
- delete pMacroImg;
- delete pComponentImg;
- delete pMacroImg_h;
- delete pComponentImg_h;
- delete pStrEvent;
- delete pAssignedMacro;
- delete pEventLB;
-}
-
-// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
-static long nTabs[] =
- {
- 2, // Number of Tabs
- 0, 90
- };
-
-#define TAB_WIDTH_MIN 10
-
-// IDs for items in HeaderBar of EventLB
-#define ITEMID_EVENT 1
-#define ITMEID_ASSMACRO 2
-
-
-#define LB_EVENTS_ITEMPOS 1
-#define LB_MACROS_ITEMPOS 2
-
-
-IMPL_LINK( _HeaderTabListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
-{
- DBG_ASSERT( pBar == &maHeaderBar, "*_HeaderTabListBox::HeaderEndDrag_Impl: something is wrong here..." );
- (void)pBar;
-
- if( !maHeaderBar.GetCurItemId() )
- return 0;
-
- if( !maHeaderBar.IsItemMode() )
- {
- Size aSz;
- USHORT _nTabs = maHeaderBar.GetItemCount();
- long nTmpSz = 0;
- long nWidth = maHeaderBar.GetItemSize( ITEMID_EVENT );
- long nBarWidth = maHeaderBar.GetSizePixel().Width();
-
- if( nWidth < TAB_WIDTH_MIN )
- maHeaderBar.SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN );
- else if( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- maHeaderBar.SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN );
-
- {
- long _nWidth;
- for( USHORT i = 1 ; i < _nTabs ; ++i )
- {
- _nWidth = maHeaderBar.GetItemSize( i );
- aSz.Width() = _nWidth + nTmpSz;
- nTmpSz += _nWidth;
- maListBox.SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width(), MAP_APPFONT );
- }
- }
- }
- return 1;
-}
-
-long _HeaderTabListBox::Notify( NotifyEvent& rNEvt )
-{
- long nRet = Control::Notify( rNEvt );
-
- if( rNEvt.GetType() == EVENT_GETFOCUS )
- {
- if ( rNEvt.GetWindow() != &maListBox )
- maListBox.GrabFocus();
- }
-
- return nRet;
-}
-
-_HeaderTabListBox::_HeaderTabListBox( Window* pParent, const ResId& rId ) :
- Control( pParent, rId ),
- maListBox( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ),
- maHeaderBar( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER )
-{
-// maListBox.SetWindowBits( WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
-}
-
-_HeaderTabListBox::~_HeaderTabListBox()
-{
-}
-
-void _HeaderTabListBox::ConnectElements( void )
-{
- // calc pos and size of header bar
- Point aPnt( 0, 0 );
- Size aSize( maHeaderBar.CalcWindowSizePixel() );
- Size aCtrlSize( GetOutputSizePixel() );
- aSize.Width() = aCtrlSize.Width();
- maHeaderBar.SetPosSizePixel( aPnt, aSize );
-
- // calc pos and size of ListBox
- aPnt.Y() += aSize.Height();
- aSize.Height() = aCtrlSize.Height() - aSize.Height();
- maListBox.SetPosSizePixel( aPnt, aSize );
-
- // set handler
- maHeaderBar.SetEndDragHdl( LINK( this, _HeaderTabListBox, HeaderEndDrag_Impl ) );
-
- maListBox.InitHeaderBar( &maHeaderBar );
-}
-
-void _HeaderTabListBox::Show( BOOL bVisible, USHORT nFlags )
-{
- maListBox.Show( bVisible, nFlags );
- maHeaderBar.Show( bVisible, nFlags );
-}
-
-void _HeaderTabListBox::Enable( bool bEnable, bool bChild )
-{
- maListBox.Enable( bEnable, bChild );
- maHeaderBar.Enable( bEnable, bChild );
-}
-
-// assign button ("Add Command") is enabled only if it is not read only
-// delete button ("Remove Command") is enabled if a current binding exists
-// and it is not read only
-void _SvxMacroTabPage::EnableButtons( const String& /*rLangName*/ )
-{
- const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected();
- if ( pE )
- {
- SvLBoxString* pEventMacro = (SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS );
- mpImpl->pDeletePB->Enable( 0 != pEventMacro && !mpImpl->bReadOnly );
-
- mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly );
- if( mpImpl->pAssignComponentPB )
- mpImpl->pAssignComponentPB->Enable( !mpImpl->bReadOnly );
- }
-}
-
-_SvxMacroTabPage::_SvxMacroTabPage( Window* pParent, const ResId& rResId, const SfxItemSet& rAttrSet )
- : SfxTabPage( pParent, rResId, rAttrSet ),
- m_xAppEvents(0),
- m_xDocEvents(0),
- bReadOnly(false),
- bDocModified(false),
- bAppEvents(false),
- bInitialized(false)
-{
- mpImpl = new _SvxMacroTabPage_Impl( rAttrSet );
-}
-
-_SvxMacroTabPage::~_SvxMacroTabPage()
-{
- // need to delete the user data
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.GetEntry( 0 );
- while( pE )
- {
- ::rtl::OUString* pEventName = (::rtl::OUString*)pE->GetUserData();
- delete pEventName;
- pE->SetUserData((void*)0);
- pE = rListBox.NextSibling( pE );
- }
- DELETEZ( mpImpl );
-}
-// -----------------------------------------------------------------------------
-void _SvxMacroTabPage::InitResources()
-{
- // Note: the order here controls the order in which the events are displayed in the UI!
-
- // the event name to UI string mappings for App Events
- aDisplayNames.push_back( EventDisplayName( "OnStartApp", RID_SVXSTR_EVENT_STARTAPP ) );
- aDisplayNames.push_back( EventDisplayName( "OnCloseApp", RID_SVXSTR_EVENT_CLOSEAPP ) );
- aDisplayNames.push_back( EventDisplayName( "OnCreate", RID_SVXSTR_EVENT_CREATEDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnNew", RID_SVXSTR_EVENT_NEWDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnLoadFinished", RID_SVXSTR_EVENT_LOADDOCFINISHED ) );
- aDisplayNames.push_back( EventDisplayName( "OnLoad", RID_SVXSTR_EVENT_OPENDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnPrepareUnload", RID_SVXSTR_EVENT_PREPARECLOSEDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnUnload", RID_SVXSTR_EVENT_CLOSEDOC ) ) ;
- aDisplayNames.push_back( EventDisplayName( "OnViewCreated", RID_SVXSTR_EVENT_VIEWCREATED ) );
- aDisplayNames.push_back( EventDisplayName( "OnPrepareViewClosing", RID_SVXSTR_EVENT_PREPARECLOSEVIEW ) );
- aDisplayNames.push_back( EventDisplayName( "OnViewClosed", RID_SVXSTR_EVENT_CLOSEVIEW ) ) ;
- aDisplayNames.push_back( EventDisplayName( "OnFocus", RID_SVXSTR_EVENT_ACTIVATEDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnUnfocus", RID_SVXSTR_EVENT_DEACTIVATEDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnSave", RID_SVXSTR_EVENT_SAVEDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveDone", RID_SVXSTR_EVENT_SAVEDOCDONE ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveFailed", RID_SVXSTR_EVENT_SAVEDOCFAILED ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveAs", RID_SVXSTR_EVENT_SAVEASDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveAsDone", RID_SVXSTR_EVENT_SAVEASDOCDONE ) );
- aDisplayNames.push_back( EventDisplayName( "OnSaveAsFailed", RID_SVXSTR_EVENT_SAVEASDOCFAILED ) );
- aDisplayNames.push_back( EventDisplayName( "OnCopyTo", RID_SVXSTR_EVENT_COPYTODOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnCopyToDone", RID_SVXSTR_EVENT_COPYTODOCDONE ) );
- aDisplayNames.push_back( EventDisplayName( "OnCopyToFailed", RID_SVXSTR_EVENT_COPYTODOCFAILED ) );
- aDisplayNames.push_back( EventDisplayName( "OnPrint", RID_SVXSTR_EVENT_PRINTDOC ) );
- aDisplayNames.push_back( EventDisplayName( "OnModifyChanged", RID_SVXSTR_EVENT_MODIFYCHANGED ) );
- aDisplayNames.push_back( EventDisplayName( "OnTitleChanged", RID_SVXSTR_EVENT_TITLECHANGED ) );
-// aDisplayNames.push_back( EventDisplayName( "OnModeChanged", RID_SVXSTR_EVENT_MODECHANGED ) );
-// aDisplayNames.push_back( EventDisplayName( "OnVisAreaChanged", RID_SVXSTR_EVENT_VISAREACHANGED ) );
-// aDisplayNames.push_back( EventDisplayName( "OnStorageChanged", RID_SVXSTR_EVENT_STORAGECHANGED ) );
-
- // application specific events
- aDisplayNames.push_back( EventDisplayName( "OnMailMerge", RID_SVXSTR_EVENT_MAILMERGE ) );
- aDisplayNames.push_back( EventDisplayName( "OnMailMergeFinished", RID_SVXSTR_EVENT_MAILMERGE_END ) );
- aDisplayNames.push_back( EventDisplayName( "OnFieldMerge", RID_SVXSTR_EVENT_FIELDMERGE ) );
- aDisplayNames.push_back( EventDisplayName( "OnFieldMergeFinished", RID_SVXSTR_EVENT_FIELDMERGE_FINISHED ) );
- aDisplayNames.push_back( EventDisplayName( "OnPageCountChange", RID_SVXSTR_EVENT_PAGECOUNTCHANGE ) );
- aDisplayNames.push_back( EventDisplayName( "OnSubComponentOpened", RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED ) );
- aDisplayNames.push_back( EventDisplayName( "OnSubComponentClosed", RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED ) );
-// aDisplayNames.push_back( EventDisplayName( "OnLayoutFinished", RID_SVXSTR_EVENT_LAYOUT_FINISHED ) );
-
- // the event name to UI string mappings for forms & dialogs
- //
- aDisplayNames.push_back( EventDisplayName( "approveAction", RID_SVXSTR_EVENT_APPROVEACTIONPERFORMED ) );
- aDisplayNames.push_back( EventDisplayName( "actionPerformed", RID_SVXSTR_EVENT_ACTIONPERFORMED ) );
- aDisplayNames.push_back( EventDisplayName( "changed", RID_SVXSTR_EVENT_CHANGED ) );
- aDisplayNames.push_back( EventDisplayName( "textChanged", RID_SVXSTR_EVENT_TEXTCHANGED ) );
- aDisplayNames.push_back( EventDisplayName( "itemStateChanged", RID_SVXSTR_EVENT_ITEMSTATECHANGED ) );
- aDisplayNames.push_back( EventDisplayName( "focusGained", RID_SVXSTR_EVENT_FOCUSGAINED ) );
- aDisplayNames.push_back( EventDisplayName( "focusLost", RID_SVXSTR_EVENT_FOCUSLOST ) );
- aDisplayNames.push_back( EventDisplayName( "keyPressed", RID_SVXSTR_EVENT_KEYTYPED ) );
- aDisplayNames.push_back( EventDisplayName( "keyReleased", RID_SVXSTR_EVENT_KEYUP ) );
- aDisplayNames.push_back( EventDisplayName( "mouseEntered", RID_SVXSTR_EVENT_MOUSEENTERED ) );
- aDisplayNames.push_back( EventDisplayName( "mouseDragged", RID_SVXSTR_EVENT_MOUSEDRAGGED ) );
- aDisplayNames.push_back( EventDisplayName( "mouseMoved", RID_SVXSTR_EVENT_MOUSEMOVED ) );
- aDisplayNames.push_back( EventDisplayName( "mousePressed", RID_SVXSTR_EVENT_MOUSEPRESSED ) );
- aDisplayNames.push_back( EventDisplayName( "mouseReleased", RID_SVXSTR_EVENT_MOUSERELEASED ) );
- aDisplayNames.push_back( EventDisplayName( "mouseExited", RID_SVXSTR_EVENT_MOUSEEXITED ) );
- aDisplayNames.push_back( EventDisplayName( "approveReset", RID_SVXSTR_EVENT_APPROVERESETTED ) );
- aDisplayNames.push_back( EventDisplayName( "resetted", RID_SVXSTR_EVENT_RESETTED ) );
- aDisplayNames.push_back( EventDisplayName( "approveSubmit", RID_SVXSTR_EVENT_SUBMITTED ) );
- aDisplayNames.push_back( EventDisplayName( "approveUpdate", RID_SVXSTR_EVENT_BEFOREUPDATE ) );
- aDisplayNames.push_back( EventDisplayName( "updated", RID_SVXSTR_EVENT_AFTERUPDATE ) );
- aDisplayNames.push_back( EventDisplayName( "loaded", RID_SVXSTR_EVENT_LOADED ) );
- aDisplayNames.push_back( EventDisplayName( "reloading", RID_SVXSTR_EVENT_RELOADING ) );
- aDisplayNames.push_back( EventDisplayName( "reloaded", RID_SVXSTR_EVENT_RELOADED ) );
- aDisplayNames.push_back( EventDisplayName( "unloading", RID_SVXSTR_EVENT_UNLOADING ) );
- aDisplayNames.push_back( EventDisplayName( "unloaded", RID_SVXSTR_EVENT_UNLOADED ) );
- aDisplayNames.push_back( EventDisplayName( "confirmDelete", RID_SVXSTR_EVENT_CONFIRMDELETE ) );
- aDisplayNames.push_back( EventDisplayName( "approveRowChange", RID_SVXSTR_EVENT_APPROVEROWCHANGE ) );
- aDisplayNames.push_back( EventDisplayName( "rowChanged", RID_SVXSTR_EVENT_ROWCHANGE ) );
- aDisplayNames.push_back( EventDisplayName( "approveCursorMove", RID_SVXSTR_EVENT_POSITIONING ) );
- aDisplayNames.push_back( EventDisplayName( "cursorMoved", RID_SVXSTR_EVENT_POSITIONED ) );
- aDisplayNames.push_back( EventDisplayName( "approveParameter", RID_SVXSTR_EVENT_APPROVEPARAMETER ) );
- aDisplayNames.push_back( EventDisplayName( "errorOccured", RID_SVXSTR_EVENT_ERROROCCURED ) );
- aDisplayNames.push_back( EventDisplayName( "adjustmentValueChanged", RID_SVXSTR_EVENT_ADJUSTMENTVALUECHANGED ) );
-}
-
-// the following method is called when the user clicks OK
-// We use the contents of the hashes to replace the settings
-BOOL _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ )
-{
- try
- {
- ::rtl::OUString eventName;
- if( m_xAppEvents.is() )
- {
- EventsHash::iterator h_itEnd = m_appEventsHash.end();
- EventsHash::iterator h_it = m_appEventsHash.begin();
- for ( ; h_it != h_itEnd; ++h_it )
- {
- eventName = h_it->first;
- try
- {
- m_xAppEvents->replaceByName( eventName, GetPropsByName( eventName, m_appEventsHash ) );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- }
- if( m_xDocEvents.is() && bDocModified )
- {
- EventsHash::iterator h_itEnd = m_docEventsHash.end();
- EventsHash::iterator h_it = m_docEventsHash.begin();
- for ( ; h_it != h_itEnd; ++h_it )
- {
- eventName = h_it->first;
- try
- {
- m_xDocEvents->replaceByName( eventName, GetPropsByName( eventName, m_docEventsHash ) );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- // if we have a valid XModifiable (in the case of doc events)
- // call setModified(true)
- // in principle this should not be necessary (see issue ??)
- if(m_xModifiable.is())
- {
- m_xModifiable->setModified( sal_True );
- }
- }
- }
- catch(Exception&)
- {
- }
- // what is the return value about??
- return FALSE;
-}
-
-// the following method clears the bindings in the hashes for both doc & app
-void _SvxMacroTabPage::Reset()
-{
- // called once in creation - don't reset the data this time
- if(!bInitialized)
- {
- bInitialized = true;
- return;
- }
-
- try
- {
- ::rtl::OUString sEmpty;
- if( m_xAppEvents.is() )
- {
- EventsHash::iterator h_itEnd = m_appEventsHash.end();
- EventsHash::iterator h_it = m_appEventsHash.begin();
- for ( ; h_it != h_itEnd; ++h_it )
- {
- h_it->second.second = sEmpty;
- }
- }
- if( m_xDocEvents.is() && bDocModified )
- {
- EventsHash::iterator h_itEnd = m_docEventsHash.end();
- EventsHash::iterator h_it = m_docEventsHash.begin();
- for ( ; h_it != h_itEnd; ++h_it )
- {
- h_it->second.second = sEmpty;
- }
- // if we have a valid XModifiable (in the case of doc events)
- // call setModified(true)
- if(m_xModifiable.is())
- {
- m_xModifiable->setModified( sal_True );
- }
- }
- }
- catch(Exception&)
- {
- }
- DisplayAppEvents(bAppEvents);
-}
-
-void _SvxMacroTabPage::SetReadOnly( BOOL bSet )
-{
- mpImpl->bReadOnly = bSet;
-}
-
-BOOL _SvxMacroTabPage::IsReadOnly() const
-{
- return mpImpl->bReadOnly;
-}
-
-
-class IconLBoxString : public SvLBoxString
-{
- Image* m_pMacroImg;
- Image* m_pComponentImg;
- Image* m_pMacroImg_h;
- Image* m_pComponentImg_h;
- int m_nxImageOffset;
-
- public:
- IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String& sText,
- Image* pMacroImg, Image* pComponentImg,
- Image* pMacroImg_h, Image* pComponentImg_h );
- virtual void Paint(const Point& aPos, SvLBox& aDevice, USHORT nFlags, SvLBoxEntry* pEntry );
-};
-
-
-IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String& sText,
- Image* pMacroImg, Image* pComponentImg, Image* pMacroImg_h, Image* pComponentImg_h )
- : SvLBoxString( pEntry, nFlags, sText )
- , m_pMacroImg( pMacroImg )
- , m_pComponentImg( pComponentImg )
- , m_pMacroImg_h( pMacroImg_h )
- , m_pComponentImg_h( pComponentImg_h )
-{
- m_nxImageOffset = 20;
-}
-
-//===============================================
-void IconLBoxString::Paint( const Point& aPos, SvLBox& aDevice,
- USHORT /*nFlags*/, SvLBoxEntry* /*pEntry*/ )
-{
- String aTxt( GetText() );
- if( aTxt.Len() )
- {
- ::rtl::OUString aURL( aTxt );
- sal_Int32 nIndex = aURL.indexOf( aVndSunStarUNO );
- bool bUNO = nIndex == 0;
-
- BOOL bHC = aDevice.GetSettings().GetStyleSettings().GetHighContrastMode();
- const Image* pImg;
- if( bHC )
- pImg = bUNO ? m_pComponentImg_h : m_pMacroImg_h;
- else
- pImg = bUNO ? m_pComponentImg : m_pMacroImg;
- aDevice.DrawImage( aPos, *pImg );
-
- ::rtl::OUString aPureMethod;
- if( bUNO )
- {
- sal_Int32 nBegin = aVndSunStarUNO.getLength();
- aPureMethod = aURL.copy( nBegin );
- }
- else
- {
- sal_Int32 nBegin = aVndSunStarScript.getLength();
- aPureMethod = aURL.copy( nBegin );
- aPureMethod = aPureMethod.copy( 0, aPureMethod.indexOf( '?' ) );
- }
-
- Point aPnt(aPos);
- aPnt.X() += m_nxImageOffset;
- aDevice.DrawText( aPnt, aPureMethod );
- }
-}
-
-
-// displays the app events if appEvents=true, otherwise displays the doc events
-void _SvxMacroTabPage::DisplayAppEvents( bool appEvents)
-{
- bAppEvents = appEvents;
-
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- mpImpl->pEventLB->SetUpdateMode( FALSE );
- rListBox.Clear();
- SvLBoxEntry* pE = rListBox.GetEntry( 0 );
- EventsHash* eventsHash;
- Reference< container::XNameReplace> nameReplace;
- if(bAppEvents)
- {
- eventsHash = &m_appEventsHash;
- nameReplace = m_xAppEvents;
- }
- else
- {
- eventsHash = &m_docEventsHash;
- nameReplace = m_xDocEvents;
- }
- // have to use the original XNameReplace since the hash iterators do
- // not guarantee the order in which the elements are returned
- if(!nameReplace.is())
- {
- return;
- }
-
- Sequence< ::rtl::OUString > eventNames = nameReplace->getElementNames();
- ::std::set< ::rtl::OUString > aEventNamesCache;
- ::std::copy(
- eventNames.getConstArray(),
- eventNames.getConstArray() + eventNames.getLength(),
- ::std::insert_iterator< ::std::set< ::rtl::OUString > >( aEventNamesCache, aEventNamesCache.end() )
- );
-
- for ( EventDisplayNames::const_iterator displayableEvent = aDisplayNames.begin();
- displayableEvent != aDisplayNames.end();
- ++displayableEvent
- )
- {
- ::rtl::OUString sEventName( ::rtl::OUString::createFromAscii( displayableEvent->pAsciiEventName ) );
- if ( !nameReplace->hasByName( sEventName ) )
- continue;
-
- EventsHash::iterator h_it = eventsHash->find( sEventName );
- if( h_it == eventsHash->end() )
- {
- OSL_ENSURE( false, "_SvxMacroTabPage::DisplayAppEvents: something's suspicious here!" );
- continue;
- }
-
- ::rtl::OUString eventURL = h_it->second.second;
- String displayName( SVX_RES( displayableEvent->nEventResourceID ) );
-
- displayName += '\t';
- SvLBoxEntry* _pE = rListBox.InsertEntry( displayName );
- ::rtl::OUString* pEventName = new ::rtl::OUString( sEventName );
- _pE->SetUserData( (void*)pEventName );
- String sNew( eventURL );
- _pE->ReplaceItem( new IconLBoxString( _pE, 0, sNew,
- mpImpl->pMacroImg, mpImpl->pComponentImg,
- mpImpl->pMacroImg_h, mpImpl->pComponentImg_h ), LB_MACROS_ITEMPOS );
- rListBox.GetModel()->InvalidateEntry( _pE );
- rListBox.Select( _pE );
- rListBox.MakeVisible( _pE );
- }
-
- pE = rListBox.GetEntry(0);
- if( pE )
- {
- rListBox.Select( pE );
- rListBox.MakeVisible( pE );
- }
-
- rListBox.SetUpdateMode( TRUE );
- EnableButtons( String() );
-}
-
-// select event handler on the listbox
-IMPL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG )
-{
- _SvxMacroTabPage_Impl* pImpl = pThis->mpImpl;
- SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.FirstSelected();
- ULONG nPos;
-
- if( !pE || LISTBOX_ENTRY_NOTFOUND ==
- ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) )
- {
- DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
- return 0;
- }
-
- pThis->EnableButtons( String() );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SvxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
-{
- return GenericHandler_Impl( pThis, pBtn );
-}
-
-IMPL_STATIC_LINK( _SvxMacroTabPage, DoubleClickHdl_Impl, SvTabListBox *, EMPTYARG )
-{
- return GenericHandler_Impl( pThis, NULL );
-}
-
-// handler for double click on the listbox, and for the assign/delete buttons
-long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* pBtn )
-{
- _SvxMacroTabPage_Impl* pImpl = pThis->mpImpl;
- SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.FirstSelected();
- ULONG nPos;
- if( !pE || LISTBOX_ENTRY_NOTFOUND ==
- ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) )
- {
- DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
- return 0;
- }
-
- const BOOL bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled();
-
- ::rtl::OUString* pEventName = (::rtl::OUString*)pE->GetUserData();
-
- ::rtl::OUString sEventURL;
- ::rtl::OUString sEventType;
- if(pThis->bAppEvents)
- {
- EventsHash::iterator h_it = pThis->m_appEventsHash.find( *pEventName );
- if(h_it != pThis->m_appEventsHash.end() )
- {
- sEventType = h_it->second.first;
- sEventURL = h_it->second.second;
- }
- }
- else
- {
- EventsHash::iterator h_it = pThis->m_docEventsHash.find( *pEventName );
- if(h_it != pThis->m_docEventsHash.end() )
- {
- sEventType = h_it->second.first;
- sEventURL = h_it->second.second;
- }
- }
-
- bool bDoubleClick = (pBtn == NULL);
- bool bUNOAssigned = (sEventURL.indexOf( aVndSunStarUNO ) == 0);
- if( pBtn == pImpl->pDeletePB )
- {
- // delete pressed
- sEventType = ::rtl::OUString::createFromAscii("Script");
- sEventURL = ::rtl::OUString();
- if(!pThis->bAppEvents)
- pThis->bDocModified = true;
- }
- else if ( ( ( pBtn != NULL )
- && ( pBtn == pImpl->pAssignComponentPB )
- )
- || ( bDoubleClick
- && bUNOAssigned
- )
- )
- {
- AssignComponentDialog* pAssignDlg = new AssignComponentDialog( pThis, sEventURL );
-
- short ret = pAssignDlg->Execute();
- if( ret )
- {
- sEventType = ::rtl::OUString::createFromAscii("UNO");
- sEventURL = pAssignDlg->getURL();
- if(!pThis->bAppEvents)
- pThis->bDocModified = true;
- }
- delete pAssignDlg;
- }
- else if( bAssEnabled )
- {
- // assign pressed
- SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog( pThis, FALSE, pThis->GetFrame() );
- if( pDlg )
- {
- short ret = pDlg->Execute();
- if ( ret )
- {
- sEventType = ::rtl::OUString::createFromAscii("Script");
- sEventURL = pDlg->GetScriptURL();
- if(!pThis->bAppEvents)
- pThis->bDocModified = true;
- }
- }
- }
-
- // update the hashes
- if(pThis->bAppEvents)
- {
- EventsHash::iterator h_it = pThis->m_appEventsHash.find( *pEventName );
- h_it->second.first = sEventType;
- h_it->second.second = sEventURL;
- }
- else
- {
- EventsHash::iterator h_it = pThis->m_docEventsHash.find( *pEventName );
- h_it->second.first = sEventType;
- h_it->second.second = sEventURL;
- }
-
- // update the listbox entry
- pImpl->pEventLB->SetUpdateMode( FALSE );
- // pE->ReplaceItem( new SvLBoxString( pE, 0, sEventURL ), LB_MACROS_ITEMPOS );
- pE->ReplaceItem( new IconLBoxString( pE, 0, sEventURL,
- pImpl->pMacroImg, pImpl->pComponentImg,
- pImpl->pMacroImg_h, pImpl->pComponentImg_h ), LB_MACROS_ITEMPOS );
-
- rListBox.GetModel()->InvalidateEntry( pE );
- rListBox.Select( pE );
- rListBox.MakeVisible( pE );
- rListBox.SetUpdateMode( TRUE );
-
- pThis->EnableButtons( String() );
- return 0;
-}
-
-// pass in the XNameReplace.
-// can remove the 3rd arg once issue ?? is fixed
-void _SvxMacroTabPage::InitAndSetHandler( Reference< container::XNameReplace> xAppEvents, Reference< container::XNameReplace> xDocEvents, Reference< util::XModifiable > xModifiable )
-{
- m_xAppEvents = xAppEvents;
- m_xDocEvents = xDocEvents;
- m_xModifiable = xModifiable;
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- HeaderBar& rHeaderBar = mpImpl->pEventLB->GetHeaderBar();
- Link aLnk(STATIC_LINK(this, _SvxMacroTabPage, AssignDeleteHdl_Impl ));
- mpImpl->pDeletePB->SetClickHdl( aLnk );
- mpImpl->pAssignPB->SetClickHdl( aLnk );
- if( mpImpl->pAssignComponentPB )
- mpImpl->pAssignComponentPB->SetClickHdl( aLnk );
- rListBox.SetDoubleClickHdl( STATIC_LINK(this, _SvxMacroTabPage, DoubleClickHdl_Impl ) );
-
- rListBox.SetSelectHdl( STATIC_LINK( this, _SvxMacroTabPage, SelectEvent_Impl ));
-
- rListBox.SetSelectionMode( SINGLE_SELECTION );
- rListBox.SetTabs( &nTabs[0], MAP_APPFONT );
- Size aSize( nTabs[ 2 ], 0 );
- rHeaderBar.InsertItem( ITEMID_EVENT, *mpImpl->pStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
- aSize.Width() = 1764; // don't know what, so 42^2 is best to use...
- rHeaderBar.InsertItem( ITMEID_ASSMACRO, *mpImpl->pAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
- rListBox.SetSpaceBetweenEntries( 0 );
-
- mpImpl->pEventLB->Show();
- mpImpl->pEventLB->ConnectElements();
-
- long nMinLineHeight = mpImpl->pMacroImg->GetSizePixel().Height() + 2;
- if( nMinLineHeight > mpImpl->pEventLB->GetListBox().GetEntryHeight() )
- mpImpl->pEventLB->GetListBox().SetEntryHeight(
- sal::static_int_cast< short >(nMinLineHeight) );
-
- mpImpl->pEventLB->Enable( TRUE );
-
- if(!m_xAppEvents.is())
- {
- return;
- }
- Sequence< ::rtl::OUString > eventNames = m_xAppEvents->getElementNames();
- sal_Int32 nEventCount = eventNames.getLength();
- for(sal_Int32 nEvent = 0; nEvent < nEventCount; ++nEvent )
- {
- //need exception handling here
- try
- {
- m_appEventsHash[ eventNames[nEvent] ] = GetPairFromAny( m_xAppEvents->getByName( eventNames[nEvent] ) );
- }
- catch (Exception e)
- {}
- }
- if(m_xDocEvents.is())
- {
- eventNames = m_xDocEvents->getElementNames();
- nEventCount = eventNames.getLength();
- for(sal_Int32 nEvent = 0; nEvent < nEventCount; ++nEvent )
- {
- try
- {
- m_docEventsHash[ eventNames[nEvent] ] = GetPairFromAny( m_xDocEvents->getByName( eventNames[nEvent] ) );
- }
- catch (Exception e)
- {}
- }
- }
-}
-
-// returns the two props EventType & Script for a given event name
-Any _SvxMacroTabPage::GetPropsByName( const ::rtl::OUString& eventName, EventsHash& eventsHash )
-{
- const ::std::pair< ::rtl::OUString, ::rtl::OUString >& rAssignedEvent( eventsHash[ eventName ] );
-
- Any aReturn;
- ::comphelper::NamedValueCollection aProps;
- if ( rAssignedEvent.first.getLength() && rAssignedEvent.second.getLength() )
- {
- aProps.put( "EventType", rAssignedEvent.first );
- aProps.put( "Script", rAssignedEvent.second );
- }
- aReturn <<= aProps.getPropertyValues();
-
- return aReturn;
-}
-
-// converts the Any returned by GetByName into a pair which can be stored in
-// the EventHash
-::std::pair< ::rtl::OUString, ::rtl::OUString > _SvxMacroTabPage::GetPairFromAny( Any aAny )
-{
- Sequence< beans::PropertyValue > props;
- ::rtl::OUString type, url;
- if( sal_True == ( aAny >>= props ) )
- {
- ::comphelper::NamedValueCollection aProps( props );
- type = aProps.getOrDefault( "EventType", type );
- url = aProps.getOrDefault( "Script", url );
- }
- return ::std::make_pair( type, url );
-}
-
-SvxMacroTabPage::SvxMacroTabPage( Window* pParent, const Reference< frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet, Reference< container::XNameReplace > xNameReplace, sal_uInt16 nSelectedIndex )
- : _SvxMacroTabPage( pParent, SVX_RES( RID_SVXPAGE_MACROASSIGN ), rSet )
-{
- mpImpl->pStrEvent = new String( SVX_RES( STR_EVENT ) );
- mpImpl->pAssignedMacro = new String( SVX_RES( STR_ASSMACRO ) );
- mpImpl->pEventLB = new _HeaderTabListBox( this, SVX_RES( LB_EVENT ) );
- mpImpl->pAssignFT = new FixedText( this, SVX_RES( FT_ASSIGN ) );
- mpImpl->pAssignPB = new PushButton( this, SVX_RES( PB_ASSIGN ) );
- mpImpl->pDeletePB = new PushButton( this, SVX_RES( PB_DELETE ) );
- mpImpl->pAssignComponentPB = new PushButton( this, SVX_RES( PB_ASSIGN_COMPONENT ) );
- mpImpl->pMacroImg = new Image( SVX_RES(IMG_MACRO) );
- mpImpl->pComponentImg = new Image( SVX_RES(IMG_COMPONENT) );
- mpImpl->pMacroImg_h = new Image( SVX_RES(IMG_MACRO_H) );
- mpImpl->pComponentImg_h = new Image( SVX_RES(IMG_COMPONENT_H) );
-
- FreeResource();
-
- SetFrame( _rxDocumentFrame );
-
- if( !mpImpl->bIDEDialogMode )
- {
- // Size aSizeAssign;
- // Point aPosAssign;
- // mpImpl->pAssignPB->GetPosSizePixel( aPosAssign, aSizeAssign );
- Point aPosAssign = mpImpl->pAssignPB->GetPosPixel();
- Point aPosComp = mpImpl->pAssignComponentPB->GetPosPixel();
-
- Point aPosDelete = mpImpl->pDeletePB->GetPosPixel();
- long nYDiff = aPosComp.Y() - aPosAssign.Y();
- aPosDelete.Y() -= nYDiff;
- mpImpl->pDeletePB->SetPosPixel( aPosDelete );
-
- mpImpl->pAssignComponentPB->Hide();
- mpImpl->pAssignComponentPB->Disable();
- }
-
- // must be done after FreeResource is called
- InitResources();
-
- mpImpl->pEventLB->GetListBox().SetHelpId( HID_SVX_MACRO_LB_EVENT );
-
- InitAndSetHandler( xNameReplace, Reference< container::XNameReplace>(0), Reference< util::XModifiable >(0));
- DisplayAppEvents(true);
- SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- SvLBoxEntry* pE = rListBox.GetEntry( (ULONG)nSelectedIndex );
- if( pE )
- rListBox.Select(pE);
-}
-
-SvxMacroTabPage::~SvxMacroTabPage()
-{
-}
-
-SvxMacroAssignDlg::SvxMacroAssignDlg( Window* pParent, const Reference< frame::XFrame >& _rxDocumentFrame, const SfxItemSet& rSet,
- const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex )
- : SvxMacroAssignSingleTabDialog( pParent, rSet, 0 )
-{
- SetTabPage( new SvxMacroTabPage( this, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex ) );
-}
-
-SvxMacroAssignDlg::~SvxMacroAssignDlg()
-{
-}
-
-
-//===============================================
-
-IMPL_LINK(AssignComponentDialog, ButtonHandler, Button *, EMPTYARG)
-{
- ::rtl::OUString aMethodName = maMethodEdit.GetText();
- maURL = ::rtl::OUString();
- if( aMethodName.getLength() )
- {
- maURL = aVndSunStarUNO;
- maURL += aMethodName;
- }
- EndDialog(1);
- return 0;
-}
-
-AssignComponentDialog::AssignComponentDialog( Window * pParent, const ::rtl::OUString& rURL )
- : ModalDialog( pParent, SVX_RES( RID_SVXDLG_ASSIGNCOMPONENT ) )
- , maMethodLabel( this, SVX_RES( FT_METHOD ) )
- , maMethodEdit( this, SVX_RES( EDIT_METHOD ) )
- , maOKButton( this, SVX_RES( RID_PB_OK ) )
- , maCancelButton( this, SVX_RES( RID_PB_CANCEL ) )
- , maHelpButton( this, SVX_RES( RID_PB_HELP ) )
- , maURL( rURL )
-{
- FreeResource();
- maOKButton.SetClickHdl(LINK(this, AssignComponentDialog, ButtonHandler));
-
- ::rtl::OUString aMethodName;
- if( maURL.getLength() )
- {
- sal_Int32 nIndex = maURL.indexOf( aVndSunStarUNO );
- if( nIndex == 0 )
- {
- sal_Int32 nBegin = aVndSunStarUNO.getLength();
- aMethodName = maURL.copy( nBegin );
- }
- }
- maMethodEdit.SetText( aMethodName, Selection( 0, SELECTION_MAX ) );
-}
-
-AssignComponentDialog::~AssignComponentDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxMacroAssignSingleTabDialog, OKHdl_Impl, Button *, pButton )
-{
- (void)pButton; //unused
- pPage->FillItemSet( *pOutSet );
- EndDialog( RET_CANCEL );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SvxMacroAssignSingleTabDialog::SvxMacroAssignSingleTabDialog
- ( Window *pParent, const SfxItemSet& rSet, sal_uInt16 nUniqueId ) :
- SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
- pFixedLine ( 0 ),
- pOKBtn ( 0 ),
- pCancelBtn ( 0 ),
- pHelpBtn ( 0 ),
- pPage ( 0 ),
- pOptions ( &rSet ),
- pOutSet ( 0 )
-{}
-
-
-// -----------------------------------------------------------------------
-
-SvxMacroAssignSingleTabDialog::~SvxMacroAssignSingleTabDialog()
-{
- delete pFixedLine;
- delete pOKBtn;
- delete pCancelBtn;
- delete pHelpBtn;
- delete pPage;
-}
-
-// -----------------------------------------------------------------------
-
-// According to SfxSingleTabDialog
-void SvxMacroAssignSingleTabDialog::SetTabPage( SfxTabPage* pTabPage )
-{
- pFixedLine = new FixedLine( this );
-
- pOKBtn = new OKButton( this, WB_DEFBUTTON );
- pOKBtn->SetClickHdl( LINK( this, SvxMacroAssignSingleTabDialog, OKHdl_Impl ) );
-
- pCancelBtn = new CancelButton( this );
- pHelpBtn = new HelpButton( this );
-
- pPage = pTabPage;
-
- if ( pPage )
- {
- String sUserData;
- pPage->SetUserData( sUserData );
- pPage->Reset( *pOptions );
- pPage->Show();
-
- // Set dialog's and buttons' size and position according to tabpage size
- long nSpaceX = LogicToPixel( Size( 6, 0 ), MAP_APPFONT ).Width();
- long nSpaceY = LogicToPixel( Size( 0, 6 ), MAP_APPFONT ).Height();
- long nHalfSpaceX = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
- long nHalfSpaceY = LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
-
- pPage->SetPosPixel( Point() );
- Size aTabpageSize( pPage->GetSizePixel() );
- Size aDialogSize( aTabpageSize );
- Size aButtonSize = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
- long nButtonWidth = aButtonSize.Width();
- long nButtonHeight = aButtonSize.Height();
-
- Size aFixedLineSize( aTabpageSize );
- long nFixedLineHeight = LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height();
- aFixedLineSize.Height() = nFixedLineHeight;
-
- aDialogSize.Height() += nFixedLineHeight + nButtonHeight + nSpaceY + nHalfSpaceY;
- SetOutputSizePixel( aDialogSize );
-
- long nButtonPosY = aTabpageSize.Height() + nFixedLineHeight + nHalfSpaceY;
- long nHelpButtonPosX = nSpaceX;
- pHelpBtn->SetPosSizePixel( Point( nHelpButtonPosX, nButtonPosY), aButtonSize );
- pHelpBtn->Show();
-
- long nCancelButtonPosX = aDialogSize.Width() - nButtonWidth - nSpaceX + 1;
- pCancelBtn->SetPosSizePixel( Point( nCancelButtonPosX, nButtonPosY), aButtonSize );
- pCancelBtn->Show();
-
- long nOkButtonPosX = nCancelButtonPosX - nButtonWidth - nHalfSpaceX;
- pOKBtn->SetPosSizePixel( Point( nOkButtonPosX, nButtonPosY), aButtonSize );
- pOKBtn->Show();
-
- long nFixedLinePosY = aTabpageSize.Height();
- pFixedLine->SetPosSizePixel( Point( 0, nFixedLinePosY), aFixedLineSize );
- pFixedLine->Show();
-
- // Get text from TabPage
- SetText( pPage->GetText() );
-
- // Get IDs from TabPage
- SetHelpId( pPage->GetHelpId() );
- SetUniqueId( pPage->GetUniqueId() );
- }
-}
diff --git a/svx/source/cui/macropg.hrc b/svx/source/cui/macropg.hrc
deleted file mode 100644
index 661d6b71e0..0000000000
--- a/svx/source/cui/macropg.hrc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MACROPG_HRC
-#define _MACROPG_HRC
-
-#ifndef _SVT_CONTROLDIMS_HRC_
-#include <svtools/controldims.hrc>
-#endif
-
-#define LB_EVENT 1
-#define PB_ASSIGN 2
-#define PB_DELETE 3
-#define STR_EVENT 4
-#define STR_ASSMACRO 5
-#define FT_ASSIGN 6
-#define PB_ASSIGN_COMPONENT 7
-
-// Starting new IDs with 30 as eventdlg.hrc also includes this file
-#define IMG_MACRO 30
-#define IMG_COMPONENT 31
-#define IMG_MACRO_H 32
-#define IMG_COMPONENT_H 33
-
-#define RID_PB_OK 41
-#define RID_PB_CANCEL 42
-#define RID_PB_HELP 43
-#define FT_METHOD 44
-#define EDIT_METHOD 45
-
-
-// COL0<---------------WIDTH_1_2--------------->COL3<->COL4<----WIDTH4---->COL5
-// <--WIDTH1-->COL1<-SPACE1->COL2<--WIDTH2->
-
-#define WIDTH_TP 260 // of whole tabpage
-#define COL5 (WIDTH_TP-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define COL4 (COL5-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL3 (COL4-RSC_SP_CTRL_X)
-#define COL0 (RSC_SP_TBPG_INNERBORDER_LEFT)
-#define WIDTH1_2 (COL3-COL0) // width of upper listbox
-#define SPACE1 4 // space between lower listboxes
-#define WIDTH1 ((WIDTH1_2-SPACE1)/2) // width of lower left listbox
-#define WIDTH2 (WIDTH1_2-WIDTH1-SPACE1) // width of lower right listbox
-#define COL1 (COL0+WIDTH1)
-#define COL2 (COL1+SPACE1)
-
-#define HEIGHT0 158 // of upper listbox
-#define HEIGHT_TP (HEIGHT0+6) // of whole tabpage
-#define ROW0 6 // more than RSC_SP_FLGR_INNERBORDER_TOP cause of bad design
-#define ROW0A (ROW0+RSC_CD_FIXEDTEXT_HEIGHT+SPACE1)
-#define ROW1 (ROW0A+RSC_CD_PUSHBUTTON_HEIGHT) // Assign button
-#define ROW2 (ROW1+RSC_SP_CTRL_GROUP_Y)
-#define ROW3 (ROW2+RSC_CD_PUSHBUTTON_HEIGHT) // Assign component button
-#define ROW4 (ROW3+RSC_SP_CTRL_GROUP_Y)
-#define ROW5_REMOVE (ROW4+RSC_SP_CTRL_GROUP_Y) // Remove button
-#define ROW5 (ROW4+RSC_CD_DROPDOWN_HEIGHT) // script type listbox (hidden)
-#define ROW6 (ROW0+HEIGHT0)
-#define ROW7 (ROW6+RSC_SP_CTRL_Y)
-#define HEIGHT_EXTRA7 (RSC_CD_FIXEDTEXT_HEIGHT) // additional height for FT_LABEL4LB_MACROS
-#define ROW7A (ROW7+HEIGHT_EXTRA7)
-#define ROW8 (ROW7+RSC_CD_FIXEDTEXT_HEIGHT+HEIGHT_EXTRA7)// label for lower listboxes (2 lines!)
-#define ROW9 (HEIGHT_TP-RSC_SP_TBPG_INNERBORDER_BOTTOM)
-#define HEIGHT8 (ROW9-ROW8) // of lower listboxes
-
-#define COMP_EDIT_WIDTH 100
-#define COMP_DIST_Y 6
-#define COMP_WIDTH (COMP_EDIT_WIDTH+RSC_CD_PUSHBUTTON_WIDTH+3*COMP_DIST_Y)
-#define COMP_COL0 COMP_DIST_Y
-#define COMP_COL1 (COMP_COL0+COMP_EDIT_WIDTH+COMP_DIST_Y)
-#define COMP_ROW0 6
-#define COMP_ROW1 (COMP_ROW0+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_CTRL_GROUP_Y)
-#define COMP_ROW2 (COMP_ROW1+RSC_CD_PUSHBUTTON_HEIGHT+2*RSC_SP_CTRL_GROUP_Y)
-#define COMP_ROWEDIT (COMP_ROW0+RSC_CD_FIXEDTEXT_HEIGHT+2)
-#define COMP_HEIGHT (COMP_ROW2+RSC_CD_PUSHBUTTON_HEIGHT+2*RSC_SP_CTRL_GROUP_Y)
-
-#endif
-
diff --git a/svx/source/cui/macropg.hxx b/svx/source/cui/macropg.hxx
deleted file mode 100644
index 31f1de9cbe..0000000000
--- a/svx/source/cui/macropg.hxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.hxx,v $
- * $Revision: 1.11.166.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _MACROPG_HXX
-#define _MACROPG_HXX
-
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/tabdlg.hxx>
-
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <svtools/macitem.hxx>
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#include <rtl/ustring.hxx>
-
-#include <hash_map>
-#include <vector>
-
-typedef ::std::hash_map< ::rtl::OUString, ::std::pair< ::rtl::OUString, ::rtl::OUString >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > EventsHash;
-
-struct EventDisplayName
-{
- const sal_Char* pAsciiEventName;
- USHORT nEventResourceID;
- EventDisplayName() : pAsciiEventName( NULL ), nEventResourceID(0) { }
- EventDisplayName( const sal_Char* _pAsciiName, const USHORT _nResId )
- : pAsciiEventName( _pAsciiName )
- , nEventResourceID( _nResId )
- {
- }
-};
-typedef ::std::vector< EventDisplayName > EventDisplayNames;
-
-class _SvxMacroTabPage;
-class SvStringsDtor;
-class SvTabListBox;
-class Edit;
-class String;
-
-class _HeaderTabListBox;
-class _SvxMacroTabPage_Impl;
-
-
-class _SvxMacroTabPage : public SfxTabPage
-{
-#if _SOLAR__PRIVATE
- DECL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
- DECL_STATIC_LINK( _SvxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
- DECL_STATIC_LINK( _SvxMacroTabPage, DoubleClickHdl_Impl, SvTabListBox * );
-
- static long GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* pBtn );
-
-#endif
-protected:
- _SvxMacroTabPage_Impl* mpImpl;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xAppEvents;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xDocEvents;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > m_xModifiable;
- EventsHash m_appEventsHash;
- EventsHash m_docEventsHash;
- bool bReadOnly, bDocModified, bAppEvents, bInitialized;
- EventDisplayNames aDisplayNames;
-
- _SvxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
-
- void EnableButtons( const String& rLanguage );
- ::com::sun::star::uno::Any GetPropsByName( const ::rtl::OUString& eventName, EventsHash& eventsHash );
- ::std::pair< ::rtl::OUString, ::rtl::OUString > GetPairFromAny( ::com::sun::star::uno::Any aAny );
-
-public:
-
- virtual ~_SvxMacroTabPage();
- void InitResources();
-
- void InitAndSetHandler( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xAppEvents, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xDocEvents, ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > xModifiable );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
-
- using SfxTabPage::Reset;
- virtual void Reset();
-
- void DisplayAppEvents( bool appEvents);
- void SetReadOnly( BOOL bSet );
- BOOL IsReadOnly() const;
-};
-
-class SvxMacroTabPage : public _SvxMacroTabPage
-{
-public:
- SvxMacroTabPage(
- Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxDocumentFrame,
- const SfxItemSet& rSet,
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xNameReplace,
- sal_uInt16 nSelectedIndex
- );
- virtual ~SvxMacroTabPage();
-};
-
-// class SvxMacroAssignDlg --------------------------------------------------
-
-typedef USHORT* (*GetTabPageRanges)(); // liefert internationale Which-Werte
-
-class SvxMacroAssignSingleTabDialog : public SfxModalDialog
-{
-public:
- SvxMacroAssignSingleTabDialog( Window* pParent, const SfxItemSet& rOptionsSet, USHORT nUniqueId );
-
- virtual ~SvxMacroAssignSingleTabDialog();
-
- void SetTabPage( SfxTabPage* pTabPage );
- // SfxTabPage* GetTabPage() const { return pPage; }
-
- // OKButton* GetOKButton() const { return pOKBtn; }
- // CancelButton* GetCancelButton() const { return pCancelBtn; }
-
-private:
- SfxViewFrame* pFrame;
-
- FixedLine* pFixedLine;
-
- OKButton* pOKBtn;
- CancelButton* pCancelBtn;
- HelpButton* pHelpBtn;
-
- SfxTabPage* pPage;
- const SfxItemSet* pOptions;
- SfxItemSet* pOutSet;
-
-#if _SOLAR__PRIVATE
- DECL_DLLPRIVATE_LINK( OKHdl_Impl, Button * );
-#endif
-};
-
-
-class SvxMacroAssignDlg : public SvxMacroAssignSingleTabDialog
-{
-public:
- SvxMacroAssignDlg(
- Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxDocumentFrame,
- const SfxItemSet& rSet,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace >& xNameReplace,
- sal_uInt16 nSelectedIndex
- );
- virtual ~SvxMacroAssignDlg();
-};
-
-#endif
diff --git a/svx/source/cui/macropg.src b/svx/source/cui/macropg.src
deleted file mode 100644
index 20201ec2b1..0000000000
--- a/svx/source/cui/macropg.src
+++ /dev/null
@@ -1,461 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg.src,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <sfx2/sfx.hrc>
-#include "macropg.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#define MASKCOLOR MaskColor = \
- Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
-TabPage RID_SVXPAGE_MACROASSIGN
-{
- // HelpID = HID_MACROASSIGN ;
- Hide = TRUE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( WIDTH_TP , HEIGHT_TP ) ;
- Text [ en-US ] = "Assign action" ;
- String STR_EVENT
- {
- Text [ en-US ] = "Event" ;
- };
- String STR_ASSMACRO
- {
- Text [ en-US ] = "Assigned Action" ;
- };
- Control LB_EVENT
- {
- Border = TRUE ;
- TabStop = TRUE;
- Pos = MAP_APPFONT ( COL0 , ROW0 ) ;
- Size = MAP_APPFONT ( WIDTH1_2 , HEIGHT0 ) ;
- HelpID = HID_SVX_MACRO_LB_EVENT ;
- };
- FixedText FT_ASSIGN
- {
- Pos = MAP_APPFONT ( COL4 , ROW0 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Assign:" ;
- };
- PushButton PB_ASSIGN
- {
- Pos = MAP_APPFONT ( COL4 , ROW0A ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "M~acro..." ;
- Disable = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_ASSIGN_COMPONENT
- {
- Pos = MAP_APPFONT ( COL4 , ROW2 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Disable = TRUE ;
- TabStop = TRUE ;
- Text [ en-US ] = "Com~ponent..." ;
- };
- PushButton PB_DELETE
- {
- Pos = MAP_APPFONT ( COL4 , ROW5_REMOVE ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "~Remove" ;
- Disable = TRUE ;
- TabStop = TRUE ;
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "id018.png"; };
- MASKCOLOR
- };
- Image IMG_COMPONENT
- {
- ImageBitmap = Bitmap { File = "component_16.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO_H
- {
- ImageBitmap = Bitmap { File = "idh018.png"; };
- MASKCOLOR
- };
- Image IMG_COMPONENT_H
- {
- ImageBitmap = Bitmap { File = "component_16_h.png"; };
- MASKCOLOR
- };
-};
-
-ModalDialog RID_SVXDLG_ASSIGNCOMPONENT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( COMP_WIDTH , COMP_HEIGHT ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "Assign Component";
- OKButton RID_PB_OK
- {
- Pos = MAP_APPFONT ( COMP_COL1 , COMP_ROW0 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton RID_PB_CANCEL
- {
- Pos = MAP_APPFONT ( COMP_COL1 , COMP_ROW1 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
- HelpButton RID_PB_HELP
- {
- Pos = MAP_APPFONT ( COMP_COL1 , COMP_ROW2 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- };
- FixedText FT_METHOD
- {
- Pos = MAP_APPFONT ( COMP_COL0 , ROW0 ) ;
- Size = MAP_APPFONT ( COMP_EDIT_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Component method name" ;
- };
- Edit EDIT_METHOD
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COMP_COL0 , COMP_ROWEDIT ) ;
- Size = MAP_APPFONT ( COMP_EDIT_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ;
- TabStop = TRUE ;
- };
-};
-
-
-//DF
-String RID_SVXSTR_EVENT_STARTAPP
-{
- Text [ en-US ] = "Start Application" ;
-};
-
-String RID_SVXSTR_EVENT_CLOSEAPP
-{
- Text [ en-US ] = "Close Application" ;
-};
-
-String RID_SVXSTR_EVENT_NEWDOC
-{
- Text [ en-US ] = "New Document" ;
-};
-
-String RID_SVXSTR_EVENT_CLOSEDOC
-{
- Text [ en-US ] = "Document closed" ;
-};
-
-String RID_SVXSTR_EVENT_PREPARECLOSEDOC
-{
- Text [ en-US ] = "Document is going to be closed" ;
-};
-
-String RID_SVXSTR_EVENT_OPENDOC
-{
- Text [ en-US ] = "Open Document" ;
-};
-
-String RID_SVXSTR_EVENT_SAVEDOC
-{
- Text [ en-US ] = "Save Document" ;
-};
-
-String RID_SVXSTR_EVENT_SAVEASDOC
-{
- Text [ en-US ] = "Save Document As" ;
-};
-
-String RID_SVXSTR_EVENT_SAVEDOCDONE
-{
- Text [ en-US ] = "Document has been saved" ;
-};
-
-String RID_SVXSTR_EVENT_SAVEASDOCDONE
-{
- Text [ en-US ] = "Document has been saved as" ;
-};
-
-String RID_SVXSTR_EVENT_ACTIVATEDOC
-{
- Text [ en-US ] = "Activate Document" ;
-};
-
-String RID_SVXSTR_EVENT_DEACTIVATEDOC
-{
- Text [ en-US ] = "Deactivate Document" ;
-};
-
-String RID_SVXSTR_EVENT_PRINTDOC
-{
- Text [ en-US ] = "Print Document" ;
-};
-
-String RID_SVXSTR_EVENT_MODIFYCHANGED
-{
- Text [ en-US ] = "'Modified' status was changed" ;
-};
-String RID_SVXSTR_EVENT_MAILMERGE
-{
- Text [ en-US ] = "Printing of form letters started" ;
-};
-String RID_SVXSTR_EVENT_MAILMERGE_END
-{
- Text [ en-US ] = "Printing of form letters finished" ;
-};
-String RID_SVXSTR_EVENT_FIELDMERGE
-{
- Text [ en-US ] = "Merging of form fields started" ;
-};
-String RID_SVXSTR_EVENT_FIELDMERGE_FINISHED
-{
- Text [ en-US ] = "Merging of form fields finished" ;
-};
-String RID_SVXSTR_EVENT_PAGECOUNTCHANGE
-{
- Text [ en-US ] = "Changing the page count" ;
-};
-String RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED
-{
- Text [ en-US ] = "Loaded a sub component" ;
-};
-String RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED
-{
- Text [ en-US ] = "Closed a sub component" ;
-};
-String RID_SVXSTR_EVENT_APPROVEPARAMETER
-{
- Text [ en-US ] = "Fill parameters" ;
-};
-String RID_SVXSTR_EVENT_ACTIONPERFORMED
-{
- Text [ en-US ] = "Execute action" ;
-};
-String RID_SVXSTR_EVENT_AFTERUPDATE
-{
- Text [ en-US ] = "After updating" ;
-};
-String RID_SVXSTR_EVENT_BEFOREUPDATE
-{
- Text [ en-US ] = "Before updating" ;
-};
-String RID_SVXSTR_EVENT_APPROVEROWCHANGE
-{
- Text [ en-US ] = "Before record action" ;
-};
-String RID_SVXSTR_EVENT_ROWCHANGE
-{
- Text [ en-US ] = "After record action" ;
-};
-String RID_SVXSTR_EVENT_CONFIRMDELETE
-{
- Text [ en-US ] = "Confirm deletion" ;
-};
-String RID_SVXSTR_EVENT_ERROROCCURED
-{
- Text [ en-US ] = "Error occurred" ;
-};
-String RID_SVXSTR_EVENT_ADJUSTMENTVALUECHANGED
-{
- Text [ en-US ] = "While adjusting";
-};
-String RID_SVXSTR_EVENT_FOCUSGAINED
-{
- Text [ en-US ] = "When receiving focus" ;
-};
-String RID_SVXSTR_EVENT_FOCUSLOST
-{
- Text [ en-US ] = "When losing focus" ;
-};
-String RID_SVXSTR_EVENT_ITEMSTATECHANGED
-{
- Text [ en-US ] = "Item status changed" ;
-};
-String RID_SVXSTR_EVENT_KEYTYPED
-{
- Text [ en-US ] = "Key pressed" ;
-};
-String RID_SVXSTR_EVENT_KEYUP
-{
- Text [ en-US ] = "Key released" ;
-};
-String RID_SVXSTR_EVENT_LOADED
-{
- Text [ en-US ] = "When loading" ;
-};
-String RID_SVXSTR_EVENT_RELOADING
-{
- Text [ en-US ] = "Before reloading" ;
-};
-String RID_SVXSTR_EVENT_RELOADED
-{
- Text [ en-US ] = "When reloading" ;
-};
-String RID_SVXSTR_EVENT_MOUSEDRAGGED
-{
- Text [ en-US ] = "Mouse moved while key pressed" ;
-};
-String RID_SVXSTR_EVENT_MOUSEENTERED
-{
- Text [ en-US ] = "Mouse inside" ;
-};
-String RID_SVXSTR_EVENT_MOUSEEXITED
-{
- Text [ en-US ] = "Mouse outside" ;
-};
-String RID_SVXSTR_EVENT_MOUSEMOVED
-{
- Text [ en-US ] = "Mouse moved" ;
-};
-String RID_SVXSTR_EVENT_MOUSEPRESSED
-{
- Text [ en-US ] = "Mouse button pressed" ;
-};
-String RID_SVXSTR_EVENT_MOUSERELEASED
-{
- Text [ en-US ] = "Mouse button released" ;
-};
-String RID_SVXSTR_EVENT_POSITIONING
-{
- Text [ en-US ] = "Before record change" ;
-};
-String RID_SVXSTR_EVENT_POSITIONED
-{
- Text [ en-US ] = "After record change" ;
-};
-String RID_SVXSTR_EVENT_RESETTED
-{
- Text [ en-US ] = "After resetting" ;
-};
-String RID_SVXSTR_EVENT_APPROVERESETTED
-{
- Text [ en-US ] = "Prior to reset" ;
-};
-String RID_SVXSTR_EVENT_APPROVEACTIONPERFORMED
-{
- Text [ en-US ] = "Approve action" ;
-};
-String RID_SVXSTR_EVENT_SUBMITTED
-{
- Text [ en-US ] = "Before submitting" ;
-};
-String RID_SVXSTR_EVENT_TEXTCHANGED
-{
- Text [ en-US ] = "Text modified" ;
-};
-String RID_SVXSTR_EVENT_UNLOADING
-{
- Text [ en-US ] = "Before unloading" ;
-};
-String RID_SVXSTR_EVENT_UNLOADED
-{
- Text [ en-US ] = "When unloading" ;
-};
-String RID_SVXSTR_EVENT_CHANGED
-{
- Text [ en-US ] = "Changed" ;
-};
-
-String RID_SVXSTR_EVENT_CREATEDOC
-{
- Text [ en-US ] = "Document created" ;
-};
-
-String RID_SVXSTR_EVENT_LOADDOCFINISHED
-{
- Text [ en-US ] = "Document loading finished" ;
-};
-
-String RID_SVXSTR_EVENT_SAVEDOCFAILED
-{
- Text [ en-US ] = "Saving of document failed" ;
-};
-
-String RID_SVXSTR_EVENT_SAVEASDOCFAILED
-{
- Text [ en-US ] = "'Save as' has failed" ;
-};
-
-String RID_SVXSTR_EVENT_COPYTODOC
-{
- Text [ en-US ] = "Storing or exporting copy of document" ;
-};
-
-String RID_SVXSTR_EVENT_COPYTODOCDONE
-{
- Text [ en-US ] = "Document copy has been created" ;
-};
-
-String RID_SVXSTR_EVENT_COPYTODOCFAILED
-{
- Text [ en-US ] = "Creating of document copy failed" ;
-};
-
-String RID_SVXSTR_EVENT_VIEWCREATED
-{
- Text [ en-US ] = "View created" ;
-};
-
-String RID_SVXSTR_EVENT_PREPARECLOSEVIEW
-{
- Text [ en-US ] = "View is going to be closed" ;
-};
-
-String RID_SVXSTR_EVENT_CLOSEVIEW
-{
- Text [ en-US ] = "View closed" ;
-};
-
-String RID_SVXSTR_EVENT_TITLECHANGED
-{
- Text [ en-US ] = "Document title changed" ;
-};
-
-String RID_SVXSTR_EVENT_MODECHANGED
-{
- Text [ en-US ] = "Document mode changed" ;
-};
-
-String RID_SVXSTR_EVENT_VISAREACHANGED
-{
- Text [ en-US ] = "Visible area changed" ;
-};
-
-String RID_SVXSTR_EVENT_STORAGECHANGED
-{
- Text [ en-US ] = "Document has got a new storage" ;
-};
-
-String RID_SVXSTR_EVENT_LAYOUT_FINISHED
-{
- Text [ en-US ] = "Document layout finished" ;
-};
diff --git a/svx/source/cui/makefile.mk b/svx/source/cui/makefile.mk
deleted file mode 100755
index 7a1db4a85f..0000000000
--- a/svx/source/cui/makefile.mk
+++ /dev/null
@@ -1,234 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.65 $
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-PRJNAME=svx
-TARGET=cui
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(ENABLE_LAYOUT)" == "TRUE"
-CFLAGS+= -DENABLE_LAYOUT=1 -I../$(PRJ)/layout/inc -I../$(PRJ)/layout/$(INPATH)/inc
-.ENDIF # ENABLE_LAYOUT == TRUE
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=cui
-SRC1FILES = \
- acccfg.src \
- align.src \
- autocdlg.src \
- backgrnd.src \
- bbdlg.src \
- border.src \
- cfg.src \
- chardlg.src \
- charmap.src \
- commonlingui.src \
- connect.src \
- connpooloptions.src \
- cuiimapdlg.src \
- dbregister.src \
- doclinkdialog.src \
- dstribut.src \
- eventdlg.src \
- fontsubs.src \
- grfflt.src \
- grfpage.src \
- hangulhanjadlg.src \
- hlmarkwn.src\
- iconcdlg.src \
- internationaloptions.src \
- macroass.src \
- macropg.src \
- measure.src \
- newtabledlg.src \
- numfmt.src \
- numpages.src \
- optfltr.src \
- optgdlg.src \
- opthtml.src \
- optjava.src \
- optmemory.src \
- optupdt.src \
- page.src \
- paragrph.src \
- postdlg.src \
- readonlyimage.src \
- scriptdlg.src \
- sdrcelldlg.src \
- securityoptions.src \
- selector.src \
- SpellDialog.src \
- splitcelldlg.src\
- srchxtra.src \
- svuidlg.src \
- swpossizetabpage.src \
- tabstpge.src \
- textanim.src \
- textattr.src \
- treeopt.src \
- webconninfo.src \
- zoom.src \
- insrc.src
-
-SRS2NAME=cuidrawdlgs
-SRC2FILES = \
- dlgname.src \
- labdlg.src \
- tabarea.src \
- tabline.src \
- transfrm.src
-
-SLOFILES+=\
- $(SLO)$/tparea.obj \
- $(SLO)$/borderconn.obj \
- $(SLO)$/cuiexp.obj \
- $(SLO)$/dlgfact.obj \
- $(SLO)$/init.obj \
- $(SLO)$/scriptdlg.obj \
- $(SLO)$/commonlingui.obj \
- $(SLO)$/selector.obj \
- $(SLO)$/fontsubs.obj \
- $(SLO)$/linkdlg.obj \
- $(SLO)$/pastedlg.obj \
- $(SLO)$/plfilter.obj \
- $(SLO)$/insdlg.obj \
- $(SLO)$/optHeaderTabListbox.obj \
- $(SLO)$/sdbcdriverenum.obj \
- $(SLO)$/connpoolsettings.obj \
- $(SLO)$/dbregisterednamesconfig.obj \
- $(SLO)$/dbregistersettings.obj \
- $(SLO)$/dbregister.obj \
- $(SLO)$/doclinkdialog.obj \
- $(SLO)$/connpoolconfig.obj \
- $(SLO)$/internationaloptions.obj \
- $(SLO)$/connpooloptions.obj \
- $(SLO)$/optgdlg.obj \
- $(SLO)$/optmemory.obj \
- $(SLO)$/opthtml.obj \
- $(SLO)$/optfltr.obj \
- $(SLO)$/treeopt.obj \
- $(SLO)$/autocdlg.obj \
- $(SLO)$/textanim.obj \
- $(SLO)$/labdlg.obj \
- $(SLO)$/dstribut.obj \
- $(SLO)$/hangulhanjadlg.obj \
- $(SLO)$/showcols.obj \
- $(SLO)$/zoom.obj \
- $(SLO)$/cuigaldlg.obj \
- $(SLO)$/cuiimapwnd.obj \
- $(SLO)$/hlmarkwn.obj \
- $(SLO)$/cuicharmap.obj \
- $(SLO)$/srchxtra.obj \
- $(SLO)$/bbdlg.obj \
- $(SLO)$/swpossizetabpage.obj \
- $(SLO)$/transfrm.obj \
- $(SLO)$/cuisrchdlg.obj \
- $(SLO)$/cuitbxform.obj \
- $(SLO)$/optdict.obj \
- $(SLO)$/dlgname.obj \
- $(SLO)$/multipat.obj \
- $(SLO)$/multifil.obj \
- $(SLO)$/iconcdlg.obj \
- $(SLO)$/hltpbase.obj \
- $(SLO)$/hldocntp.obj \
- $(SLO)$/hldoctp.obj \
- $(SLO)$/hlinettp.obj \
- $(SLO)$/hlmailtp.obj \
- $(SLO)$/cuihyperdlg.obj \
- $(SLO)$/cuifmsearch.obj \
- $(SLO)$/cuigrfflt.obj \
- $(SLO)$/readonlyimage.obj \
- $(SLO)$/optaccessibility.obj \
- $(SLO)$/optsave.obj \
- $(SLO)$/optasian.obj \
- $(SLO)$/optpath.obj \
- $(SLO)$/optcolor.obj \
- $(SLO)$/optjsearch.obj \
- $(SLO)$/optinet2.obj \
- $(SLO)$/securityoptions.obj \
- $(SLO)$/webconninfo.obj \
- $(SLO)$/optctl.obj \
- $(SLO)$/optjava.obj \
- $(SLO)$/optupdt.obj \
- $(SLO)$/optimprove.obj \
- $(SLO)$/optimprove2.obj \
- $(SLO)$/optgenrl.obj \
- $(SLO)$/connect.obj \
- $(SLO)$/tabarea.obj \
- $(SLO)$/tabline.obj \
- $(SLO)$/measure.obj \
- $(SLO)$/tpshadow.obj \
- $(SLO)$/tpline.obj \
- $(SLO)$/tpgradnt.obj \
- $(SLO)$/tpcolor.obj \
- $(SLO)$/tpbitmap.obj \
- $(SLO)$/tphatch.obj \
- $(SLO)$/tplneend.obj \
- $(SLO)$/tplnedef.obj \
- $(SLO)$/SpellAttrib.obj \
- $(SLO)$/SpellDialog.obj \
- $(SLO)$/numpages.obj \
- $(SLO)$/paragrph.obj \
- $(SLO)$/tabstpge.obj \
- $(SLO)$/textattr.obj \
- $(SLO)$/align.obj \
- $(SLO)$/backgrnd.obj \
- $(SLO)$/border.obj \
- $(SLO)$/chardlg.obj \
- $(SLO)$/numfmt.obj \
- $(SLO)$/page.obj \
- $(SLO)$/postdlg.obj \
- $(SLO)$/sdrcelldlg.obj \
- $(SLO)$/splitcelldlg.obj \
- $(SLO)$/newtabledlg.obj \
- $(SLO)$/grfpage.obj \
- $(SLO)$/cfgchart.obj \
- $(SLO)$/eventdlg.obj \
- $(SLO)$/macropg.obj \
- $(SLO)$/acccfg.obj\
- $(SLO)$/macroass.obj \
- $(SLO)$/cfg.obj \
- $(SLO)$/cfgutil.obj \
- $(SLO)$/optchart.obj \
- $(SLO)$/insrc.obj
-
-.IF "$(GUI)"=="WNT"
-SLOFILES+=$(SLO)$/winpluginlib.obj
-.ENDIF
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svx/source/cui/measure.cxx b/svx/source/cui/measure.cxx
deleted file mode 100644
index 4093e8c2c7..0000000000
--- a/svx/source/cui/measure.cxx
+++ /dev/null
@@ -1,881 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: measure.cxx,v $
- * $Revision: 1.18 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-
-// include ---------------------------------------------------------------
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <tools/shl.hxx>
-
-#include <svx/dialogs.hrc>
-
-#define _SVX_MEASURE_CXX
-
-#include <svx/svdomeas.hxx>
-#include <svx/svdattr.hxx>
-#include <svx/svdattrx.hxx>
-#include <svx/svdview.hxx>
-
-#include "measctrl.hxx"
-#include "measure.hxx"
-#include "measure.hrc"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <svx/strarray.hxx>
-#include <sfx2/request.hxx> //add CHINA001
-#include "ofaitem.hxx" //add CHINA001
-
-static USHORT pRanges[] =
-{
- SDRATTR_MEASURE_FIRST,
- SDRATTR_MEASURE_LAST,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog to change measure-attributes
-|*
-\************************************************************************/
-
-SvxMeasureDialog::SvxMeasureDialog( Window* pParent, const SfxItemSet& rInAttrs,
- const SdrView* pSdrView ) :
- SfxSingleTabDialog( pParent, rInAttrs, RID_SVXPAGE_MEASURE )
-{
- SvxMeasurePage* _pPage = new SvxMeasurePage( this, rInAttrs );
-
- _pPage->SetView( pSdrView );
- _pPage->Construct();
-
- SetTabPage( _pPage );
- SetText( _pPage->GetText() );
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxMeasureDialog::~SvxMeasureDialog()
-{
-}
-
-/*************************************************************************
-|*
-|* Tabpage for changing measure-attributes
-|*
-\************************************************************************/
-
-SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) :
- SvxTabPage ( pWindow, SVX_RES( RID_SVXPAGE_MEASURE ),
- rInAttrs ),
-
- aFlLine ( this, SVX_RES( FL_LINE ) ),
- aFtLineDist ( this, SVX_RES( FT_LINE_DIST ) ),
- aMtrFldLineDist ( this, SVX_RES( MTR_LINE_DIST ) ),
- aFtHelplineOverhang ( this, SVX_RES( FT_HELPLINE_OVERHANG ) ),
- aMtrFldHelplineOverhang ( this, SVX_RES( MTR_FLD_HELPLINE_OVERHANG ) ),
- aFtHelplineDist ( this, SVX_RES( FT_HELPLINE_DIST ) ),
- aMtrFldHelplineDist ( this, SVX_RES( MTR_FLD_HELPLINE_DIST ) ),
- aFtHelpline1Len ( this, SVX_RES( FT_HELPLINE1_LEN ) ),
- aMtrFldHelpline1Len ( this, SVX_RES( MTR_FLD_HELPLINE1_LEN ) ),
- aFtHelpline2Len ( this, SVX_RES( FT_HELPLINE2_LEN ) ),
- aMtrFldHelpline2Len ( this, SVX_RES( MTR_FLD_HELPLINE2_LEN ) ),
- aTsbBelowRefEdge ( this, SVX_RES( TSB_BELOW_REF_EDGE ) ),
- aFtDecimalPlaces ( this, SVX_RES( FT_DECIMALPLACES ) ),
- aMtrFldDecimalPlaces ( this, SVX_RES( MTR_FLD_DECIMALPLACES ) ),
-
- aFlLabel ( this, SVX_RES( FL_LABEL ) ),
- aFtPosition ( this, SVX_RES( FT_POSITION ) ),
- aCtlPosition ( this, SVX_RES( CTL_POSITION ) ),
- aTsbAutoPosV ( this, SVX_RES( TSB_AUTOPOSV ) ),
- aTsbAutoPosH ( this, SVX_RES( TSB_AUTOPOSH ) ),
- aTsbShowUnit ( this, SVX_RES( TSB_SHOW_UNIT ) ),
- aLbUnit ( this, SVX_RES( LB_UNIT ) ),
- aTsbParallel ( this, SVX_RES( TSB_PARALLEL ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ), rInAttrs ),
-
- aFlVert ( this, SVX_RES( FL_VERT ) ),
- rOutAttrs ( rInAttrs ),
- aAttrSet ( *rInAttrs.GetPool() ),
- pView( 0 ),
-
- bPositionModified ( FALSE )
-{
- FillUnitLB();
-
- FreeResource();
-
- const FieldUnit eFUnit = GetModuleFieldUnit( &rInAttrs );
- SetFieldUnit( aMtrFldLineDist, eFUnit );
- SetFieldUnit( aMtrFldHelplineOverhang, eFUnit );
- SetFieldUnit( aMtrFldHelplineDist, eFUnit );
- SetFieldUnit( aMtrFldHelpline1Len, eFUnit );
- SetFieldUnit( aMtrFldHelpline2Len, eFUnit );
- if( eFUnit == FUNIT_MM )
- {
- aMtrFldLineDist.SetSpinSize( 50 );
- aMtrFldHelplineOverhang.SetSpinSize( 50 );
- aMtrFldHelplineDist.SetSpinSize( 50 );
- aMtrFldHelpline1Len.SetSpinSize( 50 );
- aMtrFldHelpline2Len.SetSpinSize( 50 );
- }
-
- aTsbAutoPosV.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) );
- aTsbAutoPosH.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) );
-
- // set background and border of iconchoicectrl
- const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
- aCtlPreview.SetBackground ( rStyles.GetWindowColor() );
- aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO);
-
- Link aLink( LINK( this, SvxMeasurePage, ChangeAttrHdl_Impl ) );
- aMtrFldLineDist.SetModifyHdl( aLink );
- aMtrFldHelplineOverhang.SetModifyHdl( aLink );
- aMtrFldHelplineDist.SetModifyHdl( aLink );
- aMtrFldHelpline1Len.SetModifyHdl( aLink );
- aMtrFldHelpline2Len.SetModifyHdl( aLink );
- aMtrFldDecimalPlaces.SetModifyHdl( aLink );
- aTsbBelowRefEdge.SetClickHdl( aLink );
- aTsbParallel.SetClickHdl( aLink );
- aTsbShowUnit.SetClickHdl( aLink );
- aLbUnit.SetSelectHdl( aLink );
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxMeasurePage::~SvxMeasurePage()
-{
-}
-
-/*************************************************************************
-|*
-|* read the delivered Item-Set
-|*
-\************************************************************************/
-
-void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
-{
- SfxItemPool* pPool = rAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- eUnit = pPool->GetMetric( SDRATTR_MEASURELINEDIST );
-
- const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_MEASURELINEDIST );
-
- // SdrMeasureLineDistItem
- if( pItem == NULL )
- pItem = &pPool->GetDefaultItem( SDRATTR_MEASURELINEDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrMeasureLineDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldLineDist, nValue, eUnit );
- }
- else
- {
- aMtrFldLineDist.SetText( String() );
- }
- aMtrFldLineDist.SaveValue();
-
- // SdrMeasureHelplineOverhangItem
- pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG );
- if( pItem == NULL )
- pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEOVERHANG );
- if( pItem )
- {
- long nValue = ( ( const SdrMeasureHelplineOverhangItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldHelplineOverhang, nValue, eUnit );
- }
- else
- {
- aMtrFldHelplineOverhang.SetText( String() );
- }
- aMtrFldHelplineOverhang.SaveValue();
-
- // SdrMeasureHelplineDistItem
- pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEDIST );
- if( pItem == NULL )
- pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrMeasureHelplineDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldHelplineDist, nValue, eUnit );
- }
- else
- {
- aMtrFldHelplineDist.SetText( String() );
- }
- aMtrFldHelplineDist.SaveValue();
-
- // SdrMeasureHelpline1LenItem
- pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE1LEN );
- if( pItem == NULL )
- pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE1LEN );
- if( pItem )
- {
- long nValue = ( ( const SdrMeasureHelpline1LenItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldHelpline1Len, nValue, eUnit );
- }
- else
- {
- aMtrFldHelpline1Len.SetText( String() );
- }
- aMtrFldHelpline1Len.SaveValue();
-
- // SdrMeasureHelpline2LenItem
- pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE2LEN );
- if( pItem == NULL )
- pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE2LEN );
- if( pItem )
- {
- long nValue = ( ( const SdrMeasureHelpline2LenItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldHelpline2Len, nValue, eUnit );
- }
- else
- {
- aMtrFldHelpline2Len.SetText( String() );
- }
- aMtrFldHelpline2Len.SaveValue();
-
- // SdrMeasureBelowRefEdgeItem
- if( rAttrs.GetItemState( SDRATTR_MEASUREBELOWREFEDGE ) != SFX_ITEM_DONTCARE )
- {
- aTsbBelowRefEdge.SetState( ( ( const SdrMeasureBelowRefEdgeItem& )rAttrs.Get( SDRATTR_MEASUREBELOWREFEDGE ) ).
- GetValue() ? STATE_CHECK : STATE_NOCHECK );
- aTsbBelowRefEdge.EnableTriState( FALSE );
- }
- else
- {
- aTsbBelowRefEdge.SetState( STATE_DONTKNOW );
- }
- aTsbBelowRefEdge.SaveValue();
-
- // SdrMeasureDecimalPlacesItem
- pItem = GetItem( rAttrs, SDRATTR_MEASUREDECIMALPLACES );
- if( pItem == NULL )
- pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREDECIMALPLACES );
- if( pItem )
- {
- INT16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue();
- aMtrFldDecimalPlaces.SetValue( nValue );
- }
- else
- {
- aMtrFldDecimalPlaces.SetText( String() );
- }
- aMtrFldDecimalPlaces.SaveValue();
-
- // SdrMeasureTextRota90Item
- // Attention: negate !
- if( rAttrs.GetItemState( SDRATTR_MEASURETEXTROTA90 ) != SFX_ITEM_DONTCARE )
- {
- aTsbParallel.SetState( ( ( const SdrMeasureTextRota90Item& )rAttrs.Get( SDRATTR_MEASURETEXTROTA90 ) ).
- GetValue() ? STATE_NOCHECK : STATE_CHECK );
- aTsbParallel.EnableTriState( FALSE );
- }
- else
- {
- aTsbParallel.SetState( STATE_DONTKNOW );
- }
- aTsbParallel.SaveValue();
-
- // SdrMeasureShowUnitItem
- if( rAttrs.GetItemState( SDRATTR_MEASURESHOWUNIT ) != SFX_ITEM_DONTCARE )
- {
- aTsbShowUnit.SetState( ( ( const SdrMeasureShowUnitItem& )rAttrs.Get( SDRATTR_MEASURESHOWUNIT ) ).
- GetValue() ? STATE_CHECK : STATE_NOCHECK );
- aTsbShowUnit.EnableTriState( FALSE );
- }
- else
- {
- aTsbShowUnit.SetState( STATE_DONTKNOW );
- }
- aTsbShowUnit.SaveValue();
-
- // SdrMeasureUnitItem
- if( rAttrs.GetItemState( SDRATTR_MEASUREUNIT ) != SFX_ITEM_DONTCARE )
- {
- long nFieldUnit = (long) ( ( const SdrMeasureUnitItem& )rAttrs.
- Get( SDRATTR_MEASUREUNIT ) ).GetValue();
-
- for( USHORT i = 0; i < aLbUnit.GetEntryCount(); ++i )
- {
- if ( (long)aLbUnit.GetEntryData( i ) == nFieldUnit )
- {
- aLbUnit.SelectEntryPos( i );
- break;
- }
- }
- }
- else
- {
- aLbUnit.SetNoSelection();
- }
- aLbUnit.SaveValue();
-
- // Position
- if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE )
- {
- SdrMeasureTextVPos eVPos = (SdrMeasureTextVPos)
- ( ( const SdrMeasureTextVPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
- {
- if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE )
- {
- aTsbAutoPosV.EnableTriState( FALSE );
- aTsbAutoPosH.EnableTriState( FALSE );
-
- SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos)
- ( ( const SdrMeasureTextHPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
- RECT_POINT eRP = RP_MM;
- switch( eVPos )
- {
- case SDRMEASURE_ABOVE:
- switch( eHPos )
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LT; break;
- case SDRMEASURE_TEXTINSIDE: eRP = RP_MT; break;
- case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RT; break;
- case SDRMEASURE_TEXTHAUTO: eRP = RP_MT; break;
- }
- break;
- case SDRMEASURETEXT_VERTICALCENTERED:
- switch( eHPos )
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LM; break;
- case SDRMEASURE_TEXTINSIDE: eRP = RP_MM; break;
- case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RM; break;
- case SDRMEASURE_TEXTHAUTO: eRP = RP_MM; break;
- }
- break;
- case SDRMEASURE_BELOW:
- switch( eHPos )
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LB; break;
- case SDRMEASURE_TEXTINSIDE: eRP = RP_MB; break;
- case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RB; break;
- case SDRMEASURE_TEXTHAUTO: eRP = RP_MB; break;
- }
- break;
- case SDRMEASURE_TEXTVAUTO:
- switch( eHPos )
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LM; break;
- case SDRMEASURE_TEXTINSIDE: eRP = RP_MM; break;
- case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RM; break;
- case SDRMEASURE_TEXTHAUTO: eRP = RP_MM; break;
- }
- break;
- default: ;//prevent warning
- }
-
- CTL_STATE nState = 0;
-
- if( eHPos == SDRMEASURE_TEXTHAUTO )
- {
- aTsbAutoPosH.SetState( STATE_CHECK );
- nState = CS_NOHORZ;
- }
-
- if( eVPos == SDRMEASURE_TEXTVAUTO )
- {
- aTsbAutoPosV.SetState( STATE_CHECK );
- nState |= CS_NOVERT;
- }
-
- aCtlPosition.SetState( nState );
- aCtlPosition.SetActualRP( eRP );
- }
- }
- }
- else
- {
- aCtlPosition.Reset();
- aTsbAutoPosV.SetState( STATE_DONTKNOW );
- aTsbAutoPosH.SetState( STATE_DONTKNOW );
- }
-
- // put the attributes to the preview-control,
- // otherwise the control don't know about
- // the settings of the dialog (#67930)
- ChangeAttrHdl_Impl( &aTsbShowUnit );
- aCtlPreview.SetAttributes( rAttrs );
-
- bPositionModified = FALSE;
-}
-
-/*************************************************************************
-|*
-|* Fill the delivered Item-Set with dialogbox-attributes
-|*
-\************************************************************************/
-
-BOOL SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs)
-{
- BOOL bModified = FALSE;
- INT32 nValue;
- TriState eState;
-
- if( aMtrFldLineDist.GetText() != aMtrFldLineDist.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldLineDist, eUnit );
- rAttrs.Put( SdrMeasureLineDistItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldHelplineOverhang.GetText() != aMtrFldHelplineOverhang.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit );
- rAttrs.Put( SdrMeasureHelplineOverhangItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldHelplineDist.GetText() != aMtrFldHelplineDist.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldHelplineDist, eUnit );
- rAttrs.Put( SdrMeasureHelplineDistItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldHelpline1Len.GetText() != aMtrFldHelpline1Len.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit );
- rAttrs.Put( SdrMeasureHelpline1LenItem( nValue ) );
- bModified = TRUE;
- }
-
- if( aMtrFldHelpline2Len.GetText() != aMtrFldHelpline2Len.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit );
- rAttrs.Put( SdrMeasureHelpline2LenItem( nValue ) );
- bModified = TRUE;
- }
-
- eState = aTsbBelowRefEdge.GetState();
- if( eState != aTsbBelowRefEdge.GetSavedValue() )
- {
- rAttrs.Put( SdrMeasureBelowRefEdgeItem( (BOOL) STATE_CHECK == eState ) );
- bModified = TRUE;
- }
-
- if( aMtrFldDecimalPlaces.GetText() != aMtrFldDecimalPlaces.GetSavedValue() )
- {
- nValue = static_cast<INT32>(aMtrFldDecimalPlaces.GetValue());
- rAttrs.Put(
- SdrMeasureDecimalPlacesItem(
- sal::static_int_cast< INT16 >( nValue ) ) );
- bModified = TRUE;
- }
-
- eState = aTsbParallel.GetState();
- if( eState != aTsbParallel.GetSavedValue() )
- {
- rAttrs.Put( SdrMeasureTextRota90Item( (BOOL) STATE_NOCHECK == eState ) );
- bModified = TRUE;
- }
-
- eState = aTsbShowUnit.GetState();
- if( eState != aTsbShowUnit.GetSavedValue() )
- {
- rAttrs.Put( SdrMeasureShowUnitItem( (BOOL) STATE_CHECK == eState ) );
- bModified = TRUE;
- }
-
- USHORT nPos = aLbUnit.GetSelectEntryPos();
- if( nPos != aLbUnit.GetSavedValue() )
- {
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- USHORT nFieldUnit = (USHORT)(long)aLbUnit.GetEntryData( nPos );
- FieldUnit _eUnit = (FieldUnit) nFieldUnit;
- rAttrs.Put( SdrMeasureUnitItem( _eUnit ) );
- bModified = TRUE;
- }
- }
-
-//enum SdrMeasureTextHPos {SDRMEASURE_TEXTHAUTO,SDRMEASURE_TEXTLEFTOUTSIDE,SDRMEASURE_TEXTINSIDE,SDRMEASURE_TEXTRIGHTOUTSIDE};
-//enum SdrMeasureTextVPos {SDRMEASURE_TEXTVAUTO,SDRMEASURE_ABOVE,SDRMEASURETEXT_VERTICALCENTERED,SDRMEASURE_BELOW};
-
- if( bPositionModified )
- {
- // Position
- SdrMeasureTextVPos eVPos, eOldVPos;
- SdrMeasureTextHPos eHPos, eOldHPos;
-
- RECT_POINT eRP = aCtlPosition.GetActualRP();
- switch( eRP )
- {
- default:
- case RP_LT: eVPos = SDRMEASURE_ABOVE;
- eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
- case RP_LM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
- eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
- case RP_LB: eVPos = SDRMEASURE_BELOW;
- eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
- case RP_MT: eVPos = SDRMEASURE_ABOVE;
- eHPos = SDRMEASURE_TEXTINSIDE; break;
- case RP_MM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
- eHPos = SDRMEASURE_TEXTINSIDE; break;
- case RP_MB: eVPos = SDRMEASURE_BELOW;
- eHPos = SDRMEASURE_TEXTINSIDE; break;
- case RP_RT: eVPos = SDRMEASURE_ABOVE;
- eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
- case RP_RM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
- eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
- case RP_RB: eVPos = SDRMEASURE_BELOW;
- eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
- }
- if( aTsbAutoPosH.GetState() == STATE_CHECK )
- eHPos = SDRMEASURE_TEXTHAUTO;
-
- if( aTsbAutoPosV.GetState() == STATE_CHECK )
- eVPos = SDRMEASURE_TEXTVAUTO;
-
- if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE )
- {
- eOldVPos = (SdrMeasureTextVPos)
- ( ( const SdrMeasureTextVPosItem& )rOutAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue();
- if( eOldVPos != eVPos )
- {
- rAttrs.Put( SdrMeasureTextVPosItem( eVPos ) );
- bModified = TRUE;
- }
- }
- else
- {
- rAttrs.Put( SdrMeasureTextVPosItem( eVPos ) );
- bModified = TRUE;
- }
-
- if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE )
- {
- eOldHPos = (SdrMeasureTextHPos)
- ( ( const SdrMeasureTextHPosItem& )rOutAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue();
- if( eOldHPos != eHPos )
- {
- rAttrs.Put( SdrMeasureTextHPosItem( eHPos ) );
- bModified = TRUE;
- }
- }
- else
- {
- rAttrs.Put( SdrMeasureTextHPosItem( eHPos ) );
- bModified = TRUE;
- }
- }
-
- return( bModified );
-}
-
-/*************************************************************************
-|*
-|* The View have to set at the measure-object to be able to notify
-|* unit and floatingpoint-values
-|*
-\************************************************************************/
-
-void SvxMeasurePage::Construct()
-{
- DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
-
- aCtlPreview.pMeasureObj->SetModel( pView->GetModel() );
- aCtlPreview.Invalidate();
-}
-
-/*************************************************************************
-|*
-|* create the tabpage
-|*
-\************************************************************************/
-
-SfxTabPage* SvxMeasurePage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxMeasurePage( pWindow, rAttrs ) );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-USHORT* SvxMeasurePage::GetRanges()
-{
- return( pRanges );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxMeasurePage::PointChanged( Window* pWindow, RECT_POINT /*eRP*/ )
-{
- ChangeAttrHdl_Impl( pWindow );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p )
-{
- if( aTsbAutoPosH.GetState() == STATE_CHECK )
- {
- switch( aCtlPosition.GetActualRP() )
- {
- case RP_LT:
- case RP_RT:
- aCtlPosition.SetActualRP( RP_MT );
- break;
-
- case RP_LM:
- case RP_RM:
- aCtlPosition.SetActualRP( RP_MM );
- break;
-
- case RP_LB:
- case RP_RB:
- aCtlPosition.SetActualRP( RP_MB );
- break;
- default: ;//prevent warning
- }
- }
- if( aTsbAutoPosV.GetState() == STATE_CHECK )
- {
- switch( aCtlPosition.GetActualRP() )
- {
- case RP_LT:
- case RP_LB:
- aCtlPosition.SetActualRP( RP_LM );
- break;
-
- case RP_MT:
- case RP_MB:
- aCtlPosition.SetActualRP( RP_MM );
- break;
-
- case RP_RT:
- case RP_RB:
- aCtlPosition.SetActualRP( RP_RM );
- break;
- default: ;//prevent warning
- }
- }
- ChangeAttrHdl_Impl( p );
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p )
-{
-
- if( p == &aMtrFldLineDist )
- {
- INT32 nValue = GetCoreValue( aMtrFldLineDist, eUnit );
- aAttrSet.Put( SdrMeasureLineDistItem( nValue ) );
- }
-
- if( p == &aMtrFldHelplineOverhang )
- {
- INT32 nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit );
- aAttrSet.Put( SdrMeasureHelplineOverhangItem( nValue) );
- }
-
- if( p == &aMtrFldHelplineDist )
- {
- INT32 nValue = GetCoreValue( aMtrFldHelplineDist, eUnit );
- aAttrSet.Put( SdrMeasureHelplineDistItem( nValue) );
- }
-
- if( p == &aMtrFldHelpline1Len )
- {
- INT32 nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit );
- aAttrSet.Put( SdrMeasureHelpline1LenItem( nValue ) );
- }
-
- if( p == &aMtrFldHelpline2Len )
- {
- INT32 nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit );
- aAttrSet.Put( SdrMeasureHelpline2LenItem( nValue ) );
- }
-
- if( p == &aTsbBelowRefEdge )
- {
- TriState eState = aTsbBelowRefEdge.GetState();
- if( eState != STATE_DONTKNOW )
- aAttrSet.Put( SdrMeasureBelowRefEdgeItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- if( p == &aMtrFldDecimalPlaces )
- {
- INT16 nValue = sal::static_int_cast< INT16 >(
- aMtrFldDecimalPlaces.GetValue() );
- aAttrSet.Put( SdrMeasureDecimalPlacesItem( nValue ) );
- }
-
- if( p == &aTsbParallel )
- {
- TriState eState = aTsbParallel.GetState();
- if( eState != STATE_DONTKNOW )
- aAttrSet.Put( SdrMeasureTextRota90Item( (BOOL) !STATE_CHECK == eState ) );
- }
-
- if( p == &aTsbShowUnit )
- {
- TriState eState = aTsbShowUnit.GetState();
- if( eState != STATE_DONTKNOW )
- aAttrSet.Put( SdrMeasureShowUnitItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- if( p == &aLbUnit )
- {
- USHORT nPos = aLbUnit.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- USHORT nFieldUnit = (USHORT)(long)aLbUnit.GetEntryData( nPos );
- FieldUnit _eUnit = (FieldUnit) nFieldUnit;
- aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) );
- }
- }
-
- if( p == &aTsbAutoPosV || p == &aTsbAutoPosH || p == &aCtlPosition )
- {
- bPositionModified = TRUE;
-
- // Position
- RECT_POINT eRP = aCtlPosition.GetActualRP();
- SdrMeasureTextVPos eVPos;
- SdrMeasureTextHPos eHPos;
-
- switch( eRP )
- {
- default:
- case RP_LT: eVPos = SDRMEASURE_ABOVE;
- eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
- case RP_LM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
- eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
- case RP_LB: eVPos = SDRMEASURE_BELOW;
- eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
- case RP_MT: eVPos = SDRMEASURE_ABOVE;
- eHPos = SDRMEASURE_TEXTINSIDE; break;
- case RP_MM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
- eHPos = SDRMEASURE_TEXTINSIDE; break;
- case RP_MB: eVPos = SDRMEASURE_BELOW;
- eHPos = SDRMEASURE_TEXTINSIDE; break;
- case RP_RT: eVPos = SDRMEASURE_ABOVE;
- eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
- case RP_RM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
- eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
- case RP_RB: eVPos = SDRMEASURE_BELOW;
- eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
- }
-
- CTL_STATE nState = 0;
-
- if( aTsbAutoPosH.GetState() == STATE_CHECK )
- {
- eHPos = SDRMEASURE_TEXTHAUTO;
- nState = CS_NOHORZ;
- }
-
- if( aTsbAutoPosV.GetState() == STATE_CHECK )
- {
- eVPos = SDRMEASURE_TEXTVAUTO;
- nState |= CS_NOVERT;
- }
-
- if( p == &aTsbAutoPosV || p == &aTsbAutoPosH )
- aCtlPosition.SetState( nState );
-
- aAttrSet.Put( SdrMeasureTextVPosItem( eVPos ) );
- aAttrSet.Put( SdrMeasureTextHPosItem( eHPos ) );
- }
-
- aCtlPreview.SetAttributes( aAttrSet );
- aCtlPreview.Invalidate();
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxMeasurePage::FillUnitLB()
-{
- // fill ListBox with metrics
- SvxStringArray aMetricArr( RID_SVXSTR_FIELDUNIT_TABLE );
-
- long nUnit = FUNIT_NONE;
- String aStrMetric( SVX_RES( STR_MEASURE_AUTOMATIC ) );
- USHORT nPos = aLbUnit.InsertEntry( aStrMetric );
- aLbUnit.SetEntryData( nPos, (void*)nUnit );
-
- for( USHORT i = 0; i < aMetricArr.Count(); ++i )
- {
- aStrMetric = aMetricArr.GetStringByPos( i );
- nUnit = aMetricArr.GetValue( i );
- nPos = aLbUnit.InsertEntry( aStrMetric );
- aLbUnit.SetEntryData( nPos, (void*)nUnit );
- }
-}
-void SvxMeasurePage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
-
- if (pOfaPtrItem)
- SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue()));
-
- Construct();
-}
-
diff --git a/svx/source/cui/measure.hrc b/svx/source/cui/measure.hrc
deleted file mode 100644
index 2989139da9..0000000000
--- a/svx/source/cui/measure.hrc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: measure.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define FL_LINE 1
-#define FL_LABEL 2
-#define FL_VERT 3
-
-#define FT_LINE_DIST 1
-#define FT_HELPLINE_OVERHANG 2
-#define FT_HELPLINE_DIST 3
-#define FT_HELPLINE1_LEN 4
-#define FT_HELPLINE2_LEN 5
-#define FT_POSITION 6
-#define FT_DECIMALPLACES 7
-#define MTR_LINE_DIST 1
-#define MTR_FLD_HELPLINE_OVERHANG 2
-#define MTR_FLD_HELPLINE_DIST 3
-#define MTR_FLD_HELPLINE1_LEN 4
-#define MTR_FLD_HELPLINE2_LEN 5
-#define MTR_FLD_DECIMALPLACES 6
-#define TSB_BELOW_REF_EDGE 1
-#define TSB_SHOW_UNIT 2
-#define TSB_AUTOPOSV 3
-#define TSB_AUTOPOSH 4
-#define TSB_PARALLEL 5
-#define CTL_POSITION 1
-#define CTL_PREVIEW 2
-#define LB_UNIT 1
-
-#define STR_MEASURE_AUTOMATIC 1
diff --git a/svx/source/cui/measure.hxx b/svx/source/cui/measure.hxx
deleted file mode 100644
index 8b1394ea8b..0000000000
--- a/svx/source/cui/measure.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: measure.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_MEASURE_HXX
-#define _SVX_MEASURE_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <sfx2/basedlgs.hxx>
-#ifndef _SVX_DLGCTRL_HXX
-#include <svx/dlgctrl.hxx>
-#endif
-#include "measctrl.hxx"
-
-class SdrView;
-
-/*************************************************************************
-|*
-|* Dialog zum "Andern von TextAttributen
-|*
-\************************************************************************/
-
-class SvxMeasurePage : public SvxTabPage
-{
-private:
-
- FixedLine aFlLine;
- FixedText aFtLineDist;
- MetricField aMtrFldLineDist;
- FixedText aFtHelplineOverhang;
- MetricField aMtrFldHelplineOverhang;
- FixedText aFtHelplineDist;
- MetricField aMtrFldHelplineDist;
- FixedText aFtHelpline1Len;
- MetricField aMtrFldHelpline1Len;
- FixedText aFtHelpline2Len;
- MetricField aMtrFldHelpline2Len;
- TriStateBox aTsbBelowRefEdge;
- FixedText aFtDecimalPlaces;
- MetricField aMtrFldDecimalPlaces;
-
- FixedLine aFlLabel;
- FixedText aFtPosition;
- SvxRectCtl aCtlPosition;
- TriStateBox aTsbAutoPosV;
- TriStateBox aTsbAutoPosH;
- TriStateBox aTsbShowUnit;
- ListBox aLbUnit;
- TriStateBox aTsbParallel;
-
- SvxXMeasurePreview aCtlPreview;
-
- FixedLine aFlVert;
-
- const SfxItemSet& rOutAttrs;
- SfxItemSet aAttrSet;
- const SdrView* pView;
- SfxMapUnit eUnit;
-
- BOOL bPositionModified;
-
-#ifdef _SVX_MEASURE_CXX
- void FillUnitLB();
-
- DECL_LINK( ClickAutoPosHdl_Impl, void * );
- DECL_LINK( ChangeAttrHdl_Impl, void * );
-#endif
-
-public:
-
- SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs );
- ~SvxMeasurePage();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void Construct();
- void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-};
-
-/*************************************************************************
-|*
-|* Von SfxSingleTabDialog abgeleitet, um vom Control "uber virtuelle Methode
-|* benachrichtigt werden zu k"onnen.
-|*
-\************************************************************************/
-
-class SvxMeasureDialog : public SfxSingleTabDialog
-{
-public:
- SvxMeasureDialog( Window* pParent, const SfxItemSet& rAttr,
- const SdrView* pView );
- ~SvxMeasureDialog();
-};
-
-
-#endif // _SVX_MEASURE_HXX
-
diff --git a/svx/source/cui/measure.src b/svx/source/cui/measure.src
deleted file mode 100644
index 83c66b2904..0000000000
--- a/svx/source/cui/measure.src
+++ /dev/null
@@ -1,310 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: measure.src,v $
- * $Revision: 1.30 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "measure.hrc"
-#include "helpid.hrc"
-#define DELTA 20
- // pragma ----------------------------------------------------------------
-
- // RID_SVXPAGE_MEASURE ---------------------------------------------------
-TabPage RID_SVXPAGE_MEASURE
-{
- HelpId = HID_PAGE_MEASURE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Dimensioning" ;
-
- FixedLine FL_LINE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Line";
- };
- FixedText FT_LINE_DIST
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
- Text [ en-US ] = "Line ~distance" ;
- };
- MetricField MTR_LINE_DIST
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 78 , 14 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_MM ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- FixedText FT_HELPLINE_OVERHANG
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
- Text [ en-US ] = "Guide ~overhang" ;
- };
- MetricField MTR_FLD_HELPLINE_OVERHANG
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 78 , 30 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_MM ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- FixedText FT_HELPLINE_DIST
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
- Text [ en-US ] = "~Guide distance" ;
- };
- MetricField MTR_FLD_HELPLINE_DIST
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 78 , 46 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_MM ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- FixedText FT_HELPLINE1_LEN
- {
- Pos = MAP_APPFONT ( 12 , 64 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
- Text [ en-US ] = "~Left guide" ;
- };
- MetricField MTR_FLD_HELPLINE1_LEN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 78 , 62 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_MM ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- FixedText FT_HELPLINE2_LEN
- {
- Pos = MAP_APPFONT ( 12 , 80 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
- Text [ en-US ] = "~Right guide" ;
- };
- MetricField MTR_FLD_HELPLINE2_LEN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 78 , 78 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_MM ;
- DecimalDigits = 2 ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- TriStateBox TSB_BELOW_REF_EDGE
- {
- Pos = MAP_APPFONT ( 12 , 96 ) ;
- Size = MAP_APPFONT ( 108 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Measure ~below object";
- };
- FixedText FT_DECIMALPLACES
- {
- Pos = MAP_APPFONT ( 12 , 112 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
-
- Text [ en-US ] = "Decimal places" ;
- };
- MetricField MTR_FLD_DECIMALPLACES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 78 , 110 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 99 ;
- StrictFormat = TRUE ;
- Last = 99 ;
- SpinSize = 1 ;
- };
- FixedLine FL_VERT
- {
- Pos = MAP_APPFONT ( 127 , 14 ) ;
- Size = MAP_APPFONT ( 4 , 108 ) ;
- Vert = TRUE ;
- };
- FixedLine FL_LABEL
- {
- Pos = MAP_APPFONT ( 132 , 3 ) ;
- Size = MAP_APPFONT ( 122 , 8 ) ;
- Text [ en-US ] = "Legend";
- };
- FixedText FT_POSITION
- {
- Pos = MAP_APPFONT ( 138 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "~Text position" ;
- };
- Control CTL_POSITION
- {
- HelpId = HID_MEASURE_CTL_POSITION ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 154 , 25 ) ;
- Size = MAP_APPFONT ( 60 , 24 ) ;
- TabStop = TRUE ;
- };
- TriStateBox TSB_AUTOPOSV
- {
- Pos = MAP_APPFONT ( 154 , 54 ) ;
- Size = MAP_APPFONT ( 101 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~AutoVertical" ;
- };
- TriStateBox TSB_AUTOPOSH
- {
- Pos = MAP_APPFONT ( 154 , 68 ) ;
- Size = MAP_APPFONT ( 101 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "A~utoHorizontal" ;
- };
- TriStateBox TSB_PARALLEL
- {
- Pos = MAP_APPFONT ( 138 , 82 ) ;
- Size = MAP_APPFONT ( 110 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Parallel to line";
- };
- TriStateBox TSB_SHOW_UNIT
- {
- Pos = MAP_APPFONT ( 138 , 96 ) ;
- Size = MAP_APPFONT ( 64+40 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Show ~meas. units" ;
- };
- ListBox LB_UNIT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 154 , 110 ) ;
- Size = MAP_APPFONT ( 60 , 80+35 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- Control CTL_PREVIEW
- {
- HelpId = HID_MEASURE_CTL_PREVIEW ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 132 ) ;
- Size = MAP_APPFONT ( 248 , 47 ) ;
- };
- String STR_MEASURE_AUTOMATIC
- {
- Text [ en-US ] = "Automatic" ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/multifil.cxx b/svx/source/cui/multifil.cxx
deleted file mode 100644
index 4ea8d0d7f9..0000000000
--- a/svx/source/cui/multifil.cxx
+++ /dev/null
@@ -1,191 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: multifil.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/filedlghelper.hxx>
-
-#include <tools/urlobj.hxx>
-
-#include "multipat.hxx"
-#include "multifil.hxx"
-#include <svx/dialmgr.hxx>
-
-#include "multipat.hrc"
-#include <svx/dialogs.hrc>
-
-// #97807# -------------
-#include <com/sun/star/ucb/XContentProvider.hpp>
-#include <ucbhelper/contentbroker.hxx>
-
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-using namespace com::sun::star::ucb;
-using namespace com::sun::star::uno;
-
-// class SvxMultiFileDialog ----------------------------------------------
-
-IMPL_LINK( SvxMultiFileDialog, AddHdl_Impl, PushButton *, pBtn )
-{
- sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
-
- if ( IsClassPathMode() )
- {
- aDlg.SetTitle( SVX_RES( RID_SVXSTR_ARCHIVE_TITLE ) );
- aDlg.AddFilter( SVX_RES( RID_SVXSTR_ARCHIVE_HEADLINE ), String::CreateFromAscii("*.jar;*.zip") );
- }
-
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- // #97807# URL content comparison of entries -----------
- INetURLObject aFile( aDlg.GetPath() );
- String sInsFile = aFile.getFSysPath( INetURLObject::FSYS_DETECT );
- ::ucbhelper::Content aContent( aFile.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >() );
- Reference< XContent > xContent = aContent.get();
- OSL_ENSURE( xContent.is(), "AddHdl_Impl: invalid content interface!" );
- Reference< XContentIdentifier > xID = xContent->getIdentifier();
- OSL_ENSURE( xID.is(), "AddHdl_Impl: invalid ID interface!" );
- // ensure the content of files are valid
-
- USHORT nCount = aPathLB.GetEntryCount();
- BOOL bDuplicated = FALSE;
- try
- {
- if( nCount > 0 ) // start comparison
- {
- USHORT i;
- ::ucbhelper::Content & VContent = aContent; // temporary Content reference
- Reference< XContent > xVContent;
- Reference< XContentIdentifier > xVID;
- for( i = 0; i < nCount; i++ )
- {
- String sVFile = aPathLB.GetEntry( i );
- std::map< String, ::ucbhelper::Content >::iterator aCur = aFileContentMap.find( sVFile );
- if( aCur == aFileContentMap.end() ) // look for File Content in aFileContentMap, but not find it.
- {
- INetURLObject aVFile( sVFile, INetURLObject::FSYS_DETECT );
- aFileContentMap[sVFile] = ::ucbhelper::Content( aVFile.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >() );
- VContent = aFileContentMap.find( sVFile )->second;
- }
- else
- VContent = aCur->second;
- xVContent = VContent.get();
- OSL_ENSURE( xVContent.is(), "AddHdl_Impl: invalid content interface!" );
- xVID = xVContent->getIdentifier();
- OSL_ENSURE( xVID.is(), "AddHdl_Impl: invalid ID interface!" );
- if ( xID.is() && xVID.is() )
- {
- // get a generic content provider
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- Reference< XContentProvider > xProvider;
- if ( pBroker )
- xProvider = pBroker->getContentProviderInterface();
- if ( xProvider.is() )
- {
- if ( 0 == xProvider->compareContentIds( xID, xVID ) )
- {
- bDuplicated = TRUE;
- break;
- }
- }
- }
- }
- } // end of if the entries are more than zero.
- } // end of try(}
- catch( const Exception& ) // catch every exception of comparison
- {
- OSL_ENSURE( sal_False, "AddHdl_Impl: caught an unexpected exception!" );
- }
-
- if ( bDuplicated ) // #97807# --------------------
- {
- String sMsg( SVX_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sInsFile );
- InfoBox( pBtn, sMsg ).Execute();
- }
- else
- {
- USHORT nPos = aPathLB.InsertEntry( sInsFile, LISTBOX_APPEND );
- aPathLB.SetEntryData( nPos, (void*) new String( sInsFile ) );
- }
-
- } // end of if ( aDlg.Execute() == ERRCODE_NONE )
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxMultiFileDialog, DelHdl_Impl, PushButton *, EMPTYARG )
-{
- USHORT nPos = aPathLB.GetSelectEntryPos();
- aPathLB.RemoveEntry( nPos );
- USHORT nCnt = aPathLB.GetEntryCount();
-
- if ( nCnt )
- {
- nCnt--;
-
- if ( nPos > nCnt )
- nPos = nCnt;
- aPathLB.SelectEntryPos( nPos );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SvxMultiFileDialog::SvxMultiFileDialog( Window* pParent, BOOL bEmptyAllowed ) :
-
- SvxMultiPathDialog( pParent, bEmptyAllowed )
-
-{
- aAddBtn.SetClickHdl( LINK( this, SvxMultiFileDialog, AddHdl_Impl ) );
- aDelBtn.SetClickHdl( LINK( this, SvxMultiFileDialog, DelHdl_Impl ) );
- SetText( SVX_RES( RID_SVXSTR_FILE_TITLE ) );
- aPathFL.SetText( SVX_RES( RID_SVXSTR_FILE_HEADLINE ) );
- aDelBtn.Enable();
-}
-
-// -----------------------------------------------------------------------
-
-SvxMultiFileDialog::~SvxMultiFileDialog()
-{
-}
-
-
diff --git a/svx/source/cui/multifil.hxx b/svx/source/cui/multifil.hxx
deleted file mode 100644
index 33c844ddc7..0000000000
--- a/svx/source/cui/multifil.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: multifil.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_MULTIFIL_HXX
-#define _SVX_MULTIFIL_HXX
-
-// include ---------------------------------------------------------------
-
-#include "multipat.hxx"
-
-// #97807# ----------------------------------------------------
-#include <ucbhelper/content.hxx>
-#include <map>
-
-// class SvxMultiFileDialog ----------------------------------------------
-
-class SvxMultiFileDialog : public SvxMultiPathDialog
-{
-private:
- // #97807# -------------------------------------
- std::map< String, ::ucbhelper::Content > aFileContentMap;
-
- DECL_LINK( AddHdl_Impl, PushButton * );
- DECL_LINK( DelHdl_Impl, PushButton * );
-
-public:
- SvxMultiFileDialog( Window* pParent, BOOL bEmptyAllowed = FALSE );
- ~SvxMultiFileDialog();
-
- String GetFiles() const { return SvxMultiPathDialog::GetPath(); }
- void SetFiles( const String& rPath ) { SvxMultiPathDialog::SetPath(rPath); aDelBtn.Enable(); }
-};
-
-
-#endif
-
diff --git a/svx/source/cui/multipat.cxx b/svx/source/cui/multipat.cxx
deleted file mode 100644
index ce074bcb87..0000000000
--- a/svx/source/cui/multipat.cxx
+++ /dev/null
@@ -1,367 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: multipat.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/debug.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/filedlghelper.hxx>
-
-#include "multipat.hxx"
-#include <svx/dialmgr.hxx>
-
-#include "multipat.hrc"
-#include <svx/dialogs.hrc>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-
-#include <unotools/localfilehelper.hxx>
-#include <svtools/pathoptions.hxx>
-
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::uno;
-
-// struct MultiPath_Impl -------------------------------------------------
-
-struct MultiPath_Impl
-{
- BOOL bEmptyAllowed;
- BOOL bIsClassPathMode;
- bool bIsRadioButtonMode;
-
- MultiPath_Impl( BOOL bAllowed ) :
- bEmptyAllowed( bAllowed ), bIsClassPathMode( FALSE ), bIsRadioButtonMode( false ) {}
-};
-
-// class SvxMultiPathDialog ----------------------------------------------
-
-IMPL_LINK( SvxMultiPathDialog, SelectHdl_Impl, void *, EMPTYARG )
-{
- ULONG nCount = pImpl->bIsRadioButtonMode ? aRadioLB.GetEntryCount() : aPathLB.GetEntryCount();
- bool bIsSelected = pImpl->bIsRadioButtonMode
- ? aRadioLB.FirstSelected() != NULL
- : aPathLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND;
- BOOL bEnable = ( pImpl->bEmptyAllowed || nCount > 1 );
- aDelBtn.Enable( bEnable && bIsSelected );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxMultiPathDialog, CheckHdl_Impl, svx::SvxRadioButtonListBox *, pBox )
-{
- SvLBoxEntry* pEntry =
- pBox ? pBox->GetEntry( pBox->GetCurMousePoint() ) : aRadioLB.FirstSelected();
- if ( pEntry )
- aRadioLB.HandleEntryChecked( pEntry );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxMultiPathDialog, AddHdl_Impl, PushButton *, EMPTYARG )
-{
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), UNO_QUERY );
-
- if ( xFolderPicker->execute() == ExecutableDialogResults::OK )
- {
- INetURLObject aPath( xFolderPicker->getDirectory() );
- aPath.removeFinalSlash();
- String aURL = aPath.GetMainURL( INetURLObject::NO_DECODE );
- String sInsPath;
- ::utl::LocalFileHelper::ConvertURLToSystemPath( aURL, sInsPath );
-
- if ( pImpl->bIsRadioButtonMode )
- {
- ULONG nPos = aRadioLB.GetEntryPos( sInsPath, 1 );
- if ( 0xffffffff == nPos ) //See svtools/source/contnr/svtabbx.cxx SvTabListBox::GetEntryPos
- {
- String sNewEntry( '\t' );
- sNewEntry += sInsPath;
- SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sNewEntry );
- String* pData = new String( aURL );
- pEntry->SetUserData( pData );
- }
- else
- {
- String sMsg( SVX_RES( RID_MULTIPATH_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sInsPath );
- InfoBox( this, sMsg ).Execute();
- }
- }
- else
- {
- if ( LISTBOX_ENTRY_NOTFOUND != aPathLB.GetEntryPos( sInsPath ) )
- {
- String sMsg( SVX_RES( RID_MULTIPATH_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sInsPath );
- InfoBox( this, sMsg ).Execute();
- }
- else
- {
- USHORT nPos = aPathLB.InsertEntry( sInsPath, LISTBOX_APPEND );
- aPathLB.SetEntryData( nPos, (void*)new String( aURL ) );
- }
- }
- SelectHdl_Impl( NULL );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxMultiPathDialog, DelHdl_Impl, PushButton *, EMPTYARG )
-{
- if ( pImpl->bIsRadioButtonMode )
- {
- SvLBoxEntry* pEntry = aRadioLB.FirstSelected();
- delete (String*)pEntry->GetUserData();
- bool bChecked = aRadioLB.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED;
- ULONG nPos = aRadioLB.GetEntryPos( pEntry );
- aRadioLB.RemoveEntry( pEntry );
- ULONG nCnt = aRadioLB.GetEntryCount();
- if ( nCnt )
- {
- nCnt--;
- if ( nPos > nCnt )
- nPos = nCnt;
- pEntry = aRadioLB.GetEntry( nPos );
- if ( bChecked )
- {
- aRadioLB.SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
- aRadioLB.HandleEntryChecked( pEntry );
- }
- else
- aRadioLB.Select( pEntry );
- }
- }
- else
- {
- USHORT nPos = aPathLB.GetSelectEntryPos();
- aPathLB.RemoveEntry( nPos );
- USHORT nCnt = aPathLB.GetEntryCount();
-
- if ( nCnt )
- {
- nCnt--;
-
- if ( nPos > nCnt )
- nPos = nCnt;
- aPathLB.SelectEntryPos( nPos );
- }
- }
- SelectHdl_Impl( NULL );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SvxMultiPathDialog::SvxMultiPathDialog( Window* pParent, BOOL bEmptyAllowed ) :
-
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_MULTIPATH ) ),
-
- aPathFL ( this, SVX_RES( FL_MULTIPATH) ),
- aPathLB ( this, SVX_RES( LB_MULTIPATH ) ),
- aRadioLB ( this, SVX_RES( LB_RADIOBUTTON ) ),
- aRadioFT ( this, SVX_RES( FT_RADIOBUTTON ) ),
- aAddBtn ( this, SVX_RES( BTN_ADD_MULTIPATH ) ),
- aDelBtn ( this, SVX_RES( BTN_DEL_MULTIPATH ) ),
- aOKBtn ( this, SVX_RES( BTN_MULTIPATH_OK ) ),
- aCancelBtn ( this, SVX_RES( BTN_MULTIPATH_CANCEL ) ),
- aHelpButton ( this, SVX_RES( BTN_MULTIPATH_HELP ) ),
- pImpl ( new MultiPath_Impl( bEmptyAllowed ) )
-
-{
- static long aStaticTabs[]= { 2, 0, 12 };
- aRadioLB.SvxSimpleTable::SetTabs( aStaticTabs );
- String sHeader( SVX_RES( STR_HEADER_PATHS ) );
- aRadioLB.SetQuickHelpText( sHeader );
- sHeader.Insert( '\t', 0 );
- aRadioLB.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT );
-
- FreeResource();
-
- aPathLB.SetSelectHdl( LINK( this, SvxMultiPathDialog, SelectHdl_Impl ) );
- aRadioLB.SetSelectHdl( LINK( this, SvxMultiPathDialog, SelectHdl_Impl ) );
- aRadioLB.SetCheckButtonHdl( LINK( this, SvxMultiPathDialog, CheckHdl_Impl ) );
- aAddBtn.SetClickHdl( LINK( this, SvxMultiPathDialog, AddHdl_Impl ) );
- aDelBtn.SetClickHdl( LINK( this, SvxMultiPathDialog, DelHdl_Impl ) );
-
- SelectHdl_Impl( NULL );
-}
-
-// -----------------------------------------------------------------------
-
-SvxMultiPathDialog::~SvxMultiPathDialog()
-{
- USHORT nPos = aPathLB.GetEntryCount();
- while ( nPos-- )
- delete (String*)aPathLB.GetEntryData(nPos);
- nPos = (USHORT)aRadioLB.GetEntryCount();
- while ( nPos-- )
- {
- SvLBoxEntry* pEntry = aRadioLB.GetEntry( nPos );
- delete (String*)pEntry->GetUserData();
- }
- delete pImpl;
-}
-
-// -----------------------------------------------------------------------
-
-String SvxMultiPathDialog::GetPath() const
-{
- String sNewPath;
- sal_Unicode cDelim = pImpl->bIsClassPathMode ? CLASSPATH_DELIMITER : SVT_SEARCHPATH_DELIMITER;
-
- if ( pImpl->bIsRadioButtonMode )
- {
- String sWritable;
- for ( USHORT i = 0; i < aRadioLB.GetEntryCount(); ++i )
- {
- SvLBoxEntry* pEntry = aRadioLB.GetEntry(i);
- if ( aRadioLB.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED )
- sWritable = *(String*)pEntry->GetUserData();
- else
- {
- if ( sNewPath.Len() > 0 )
- sNewPath += cDelim;
- sNewPath += *(String*)pEntry->GetUserData();
- }
- }
- if ( sNewPath.Len() > 0 )
- sNewPath += cDelim;
- sNewPath += sWritable;
- }
- else
- {
- for ( USHORT i = 0; i < aPathLB.GetEntryCount(); ++i )
- {
- if ( sNewPath.Len() > 0 )
- sNewPath += cDelim;
- sNewPath += *(String*)aPathLB.GetEntryData(i);
- }
- }
- return sNewPath;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxMultiPathDialog::SetPath( const String& rPath )
-{
- sal_Unicode cDelim = pImpl->bIsClassPathMode ? CLASSPATH_DELIMITER : SVT_SEARCHPATH_DELIMITER;
- USHORT nPos, nCount = rPath.GetTokenCount( cDelim );
-
- for ( USHORT i = 0; i < nCount; ++i )
- {
- String sPath = rPath.GetToken( i, cDelim );
- String sSystemPath;
- sal_Bool bIsSystemPath =
- ::utl::LocalFileHelper::ConvertURLToSystemPath( sPath, sSystemPath );
-
- if ( pImpl->bIsRadioButtonMode )
- {
- String sEntry( '\t' );
- sEntry += bIsSystemPath ? sSystemPath : sPath;
- SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sEntry );
- String* pURL = new String( sPath );
- pEntry->SetUserData( pURL );
- }
- else
- {
- if ( bIsSystemPath )
- nPos = aPathLB.InsertEntry( sSystemPath, LISTBOX_APPEND );
- else
- nPos = aPathLB.InsertEntry( sPath, LISTBOX_APPEND );
- aPathLB.SetEntryData( nPos, (void*)new String( sPath ) );
- }
- }
-
- if ( pImpl->bIsRadioButtonMode && nCount > 0 )
- {
- SvLBoxEntry* pEntry = aRadioLB.GetEntry( nCount - 1 );
- if ( pEntry )
- {
- aRadioLB.SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
- aRadioLB.HandleEntryChecked( pEntry );
- }
- }
-
- SelectHdl_Impl( NULL );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxMultiPathDialog::SetClassPathMode()
-{
- pImpl->bIsClassPathMode = TRUE;
- SetText( SVX_RES( RID_SVXSTR_ARCHIVE_TITLE ));
- aPathFL.SetText( SVX_RES( RID_SVXSTR_ARCHIVE_HEADLINE ) );
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool SvxMultiPathDialog::IsClassPathMode() const
-{
- return pImpl->bIsClassPathMode;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxMultiPathDialog::EnableRadioButtonMode()
-{
- pImpl->bIsRadioButtonMode = true;
-
- aPathFL.Hide();
- aPathLB.Hide();
-
- aRadioLB.ShowTable();
- aRadioFT.Show();
-
- Point aNewPos = aAddBtn.GetPosPixel();
- long nDelta = aNewPos.Y() - aRadioLB.GetPosPixel().Y();
- aNewPos.Y() -= nDelta;
- aAddBtn.SetPosPixel( aNewPos );
- aNewPos = aDelBtn.GetPosPixel();
- aNewPos.Y() -= nDelta;
- aDelBtn.SetPosPixel( aNewPos );
-}
-
diff --git a/svx/source/cui/multipat.hxx b/svx/source/cui/multipat.hxx
deleted file mode 100644
index 2b0d446eda..0000000000
--- a/svx/source/cui/multipat.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: multipat.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_MULTIPAT_HXX
-#define _SVX_MULTIPAT_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/dialog.hxx>
-#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/fixed.hxx>
-
-#include "radiobtnbox.hxx"
-
-// define ----------------------------------------------------------------
-
-// different delimiter for Unix (:) and Windows (;)
-
-#ifdef UNX
-#define CLASSPATH_DELIMITER ':'
-#else
-#define CLASSPATH_DELIMITER ';'
-#endif
-
-// forward ---------------------------------------------------------------
-
-struct MultiPath_Impl;
-
-// class SvxMultiPathDialog ----------------------------------------------
-
-class SvxMultiPathDialog : public ModalDialog
-{
-protected:
- FixedLine aPathFL;
- ListBox aPathLB;
- svx::SvxRadioButtonListBox aRadioLB;
- FixedText aRadioFT;
- PushButton aAddBtn;
- PushButton aDelBtn;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpButton;
-
- MultiPath_Impl* pImpl;
-
- DECL_LINK( AddHdl_Impl, PushButton * );
- DECL_LINK( DelHdl_Impl, PushButton * );
- DECL_LINK( SelectHdl_Impl, void * );
- DECL_LINK( CheckHdl_Impl, svx::SvxRadioButtonListBox * );
-
-public:
- SvxMultiPathDialog( Window* pParent, BOOL bEmptyAllowed = FALSE );
- ~SvxMultiPathDialog();
-
- String GetPath() const;
- void SetPath( const String& rPath );
- void SetClassPathMode();
- sal_Bool IsClassPathMode() const;
- void EnableRadioButtonMode();
-};
-
-#endif // #ifndef _SVX_MULTIPAT_HXX
-
diff --git a/svx/source/cui/newtabledlg.cxx b/svx/source/cui/newtabledlg.cxx
deleted file mode 100644
index 6e8b7a59f7..0000000000
--- a/svx/source/cui/newtabledlg.cxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: newtabledlg.cxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include "svx/dialogs.hrc"
-#include "svx/dialmgr.hxx"
-#include "newtabledlg.hxx"
-#include "newtabledlg.hrc"
-
-SvxNewTableDialog::SvxNewTableDialog( Window* pParent )
-: ModalDialog( pParent, SVX_RES( RID_SVX_NEWTABLE_DLG ) )
-, maFtColumns( this, SVX_RES( FT_COLUMNS ) )
-, maNumColumns( this, SVX_RES( NF_COLUMNS ) )
-, maFtRows( this, SVX_RES( FT_ROWS ) )
-, maNumRows( this, SVX_RES( NF_ROWS ) )
-, maFlSep( this, SVX_RES( FL_SEP ) )
-, maHelpButton( this, SVX_RES( BTN_HELP ) )
-, maOkButton( this, SVX_RES( BTN_OK ) )
-, maCancelButton( this, SVX_RES( BTN_CANCEL ) )
-{
- maNumRows.SetValue(2);
- maNumColumns.SetValue(5);
- FreeResource();
-}
-
-short SvxNewTableDialog::Execute(void)
-{
- return ModalDialog::Execute();
-}
-
-void SvxNewTableDialog::Apply(void)
-{
-}
-
-sal_Int32 SvxNewTableDialog::getRows() const
-{
- return sal::static_int_cast< sal_Int32 >( maNumRows.GetValue() );
-}
-
-sal_Int32 SvxNewTableDialog::getColumns() const
-{
- return sal::static_int_cast< sal_Int32 >( maNumColumns.GetValue() );
-}
diff --git a/svx/source/cui/newtabledlg.hrc b/svx/source/cui/newtabledlg.hrc
deleted file mode 100644
index 8eba4acee2..0000000000
--- a/svx/source/cui/newtabledlg.hrc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: newtabledlg.hrc,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define FT_COLUMNS 1
-#define NF_COLUMNS 2
-#define FT_ROWS 3
-#define NF_ROWS 4
-#define FL_SEP 5
-#define BTN_HELP 6
-#define BTN_OK 7
-#define BTN_CANCEL 8
diff --git a/svx/source/cui/newtabledlg.hxx b/svx/source/cui/newtabledlg.hxx
deleted file mode 100644
index a9426c0c07..0000000000
--- a/svx/source/cui/newtabledlg.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: newtabledlg.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_NEWTABLEDLG_HXX
-#define _SVX_NEWTABLEDLG_HXX
-
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/button.hxx>
-
-#include <svx/stddlg.hxx>
-#include <svx/svxdlg.hxx>
-
-class SvxNewTableDialog : public SvxAbstractNewTableDialog, public ModalDialog
-{
-private:
- FixedText maFtColumns;
- NumericField maNumColumns;
- FixedText maFtRows;
- NumericField maNumRows;
-
- FixedLine maFlSep;
- HelpButton maHelpButton;
- OKButton maOkButton;
- CancelButton maCancelButton;
-
-public:
- SvxNewTableDialog( Window* pWindow );
-
- virtual short Execute(void);
- virtual void Apply(void);
-
- virtual sal_Int32 getRows() const;
- virtual sal_Int32 getColumns() const;
-};
-
-#endif // _SVX_NEWTABLEDLG_HXX
-
-
diff --git a/svx/source/cui/newtabledlg.src b/svx/source/cui/newtabledlg.src
deleted file mode 100644
index 8b2bb5bacc..0000000000
--- a/svx/source/cui/newtabledlg.src
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: newtabledlg.src,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "newtabledlg.hrc"
-#include "svx/dialogs.hrc"
-
-ModalDialog RID_SVX_NEWTABLE_DLG
-{
- OutputSize = TRUE;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 181 , 6+15+15+15+14+6 ) ;
- Text [ en-US ] = "Insert Table" ;
-
- FixedText FT_COLUMNS
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "Number of columns:" ;
- };
- NumericField NF_COLUMNS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 80 , 6 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 75 ;
- SpinSize = 1 ;
- StrictFormat = TRUE ;
- };
- FixedText FT_ROWS
- {
- Pos = MAP_APPFONT ( 6 , 8+15 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "Number of rows:" ;
- };
- NumericField NF_ROWS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 80 , 6+15 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 75 ;
- SpinSize = 1 ;
- StrictFormat = TRUE ;
- };
- FixedLine FL_SEP
- {
- Pos = MAP_APPFONT ( 0 , 6+15+15 ) ;
- Size = MAP_APPFONT ( 181 , 12 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 6 , 6+15+15+15 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 69 , 6+15+15+15 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 125 , 6+15+15+15 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/numfmt.cxx b/svx/source/cui/numfmt.cxx
deleted file mode 100644
index 614cd5259f..0000000000
--- a/svx/source/cui/numfmt.cxx
+++ /dev/null
@@ -1,1957 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numfmt.cxx,v $
- * $Revision: 1.32.128.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#if !ENABLE_LAYOUT_EXPERIMENTAL
-//#undef ENABLE_LAYOUT
-#endif
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/svapp.hxx>
-#include <unotools/localedatawrapper.hxx>
-#include <i18npool/lang.h>
-
-#define _SVSTDARR_STRINGS
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-#include <svtools/colorcfg.hxx>
-
-#define _SVX_NUMFMT_CXX
-
-#include <svx/dialogs.hrc>
-#include "numfmt.hrc"
-
-#include <svx/numinf.hxx>
-
-#include "numfmt.hxx"
-#include <svx/numfmtsh.hxx>
-#include <svx/dialmgr.hxx>
-#include <sfx2/request.hxx> //CHINA001
-#include <sfx2/app.hxx> //CHINA001
-#include <sfx2/basedlgs.hxx>
-#include "flagsdef.hxx" //CHINA001
-
-#define NUMKEY_UNDEFINED SAL_MAX_UINT32
-
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_ATTR_NUMBERFORMAT_VALUE,
- SID_ATTR_NUMBERFORMAT_INFO,
- SID_ATTR_NUMBERFORMAT_NOLANGUAGE,
- SID_ATTR_NUMBERFORMAT_NOLANGUAGE,
- SID_ATTR_NUMBERFORMAT_ONE_AREA,
- SID_ATTR_NUMBERFORMAT_ONE_AREA,
- SID_ATTR_NUMBERFORMAT_SOURCE,
- SID_ATTR_NUMBERFORMAT_SOURCE,
- 0
-};
-
-/*************************************************************************
-#* Methode: SvxNumberPreviewImpl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberPreview
-#*
-#* Funktion: Konstruktor der Klasse SvxNumberPreviewImpl
-#*
-#* Input: Fenster, Resource-ID
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-SvxNumberPreviewImpl::SvxNumberPreviewImpl( Window* pParent, const ResId& rResId ) :
-
- Window( pParent, rResId )
-
-{
- Font aFont( GetFont() );
- aFont.SetTransparent( TRUE );
- aFont.SetColor( Application::GetSettings().GetStyleSettings().GetFieldColor() );
- SetFont( aFont );
- InitSettings( TRUE, TRUE );
- SetBorderStyle( WINDOW_BORDER_MONO );
-}
-
-/*************************************************************************
-#* Methode: SvxNumberPreviewImpl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberPreview
-#*
-#* Funktion: Destruktor der Klasse SvxNumberPreviewImpl
-#*
-#* Input: ---
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-SvxNumberPreviewImpl::~SvxNumberPreviewImpl()
-{
-}
-
-/*************************************************************************
-#* Methode: NotifyChange Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberPreviewImpl
-#*
-#* Funktion: Funktion fuer das Aendern des Preview- Strings
-#*
-#* Input: String, Farbe
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberPreviewImpl::NotifyChange( const String& rPrevStr,
- const Color* pColor )
-{
- aPrevStr = rPrevStr;
- svtools::ColorConfig aColorConfig;
- Color aWindowTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
- aPrevCol = pColor ? *pColor : aWindowTextColor;
- Invalidate();
- Update();
-}
-
-/*************************************************************************
-#* Methode: Paint Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberPreviewImpl
-#*
-#* Funktion: Funktion fuer das neu zeichnen des Fensters.
-#*
-#* Input: ---
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberPreviewImpl::Paint( const Rectangle& )
-{
- Font aDrawFont = GetFont();
- Size aSzWnd = GetOutputSizePixel();
- Point aPosText = Point( (aSzWnd.Width() - GetTextWidth( aPrevStr )) /2,
- (aSzWnd.Height() - GetTextHeight())/2 );
-
- aDrawFont.SetColor( aPrevCol );
- SetFont( aDrawFont );
- DrawText( aPosText, aPrevStr );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxNumberPreviewImpl::InitSettings( BOOL bForeground, BOOL bBackground )
-{
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- if ( bForeground )
- {
- svtools::ColorConfig aColorConfig;
- Color aTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
-
- if ( IsControlForeground() )
- aTextColor = GetControlForeground();
- SetTextColor( aTextColor );
- }
-
- if ( bBackground )
- {
- if ( IsControlBackground() )
- SetBackground( GetControlBackground() );
- else
- SetBackground( rStyleSettings.GetWindowColor() );
- }
- Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxNumberPreviewImpl::StateChanged( StateChangedType nType )
-{
- if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
- InitSettings( TRUE, FALSE );
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
- InitSettings( FALSE, TRUE );
-
- Window::StateChanged( nType );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxNumberPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Window::DataChanged( rDCEvt );
-
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
- InitSettings( TRUE, TRUE );
-}
-
-// class SvxNumberFormatTabPage ------------------------------------------
-
-#define REMOVE_DONTKNOW() \
- if ( !aFtLanguage.IsEnabled() ) \
- { \
- aFtLanguage .Enable(); \
- aLbLanguage .Enable(); \
- aLbLanguage .SelectLanguage( pNumFmtShell->GetCurLanguage() ); \
- }
-
-#define HDL(hdl) LINK( this, SvxNumberFormatTabPage, hdl )
-
-#include <layout/layout-pre.hxx>
-
-#if ENABLE_LAYOUT
-#undef SVX_RES
-#define SVX_RES(x) #x
-#define SVX_RES_PLAIN(x) ResId (x, DIALOG_MGR ())
-#define THIS_SVX_RES(x) this, #x
-#undef SfxTabPage
-#define SfxTabPage( parent, id, args ) SfxTabPage( parent, "number-format.xml", id, &args )
-#else /* !ENABLE_LAYOUT */
-#define SVX_RES_PLAIN SVX_RES
-#define THIS_SVX_RES SVX_RES
-#endif /* !ENABLE_LAYOUT */
-
-SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window* pParent,
- const SfxItemSet& rCoreAttrs )
-
- : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_NUMBERFORMAT ), rCoreAttrs ),
-
- aFtCategory ( this, SVX_RES( FT_CATEGORY ) ),
- aLbCategory ( this, SVX_RES( LB_CATEGORY ) ),
- aFtFormat ( this, SVX_RES( FT_FORMAT ) ),
- aLbCurrency ( this, SVX_RES( LB_CURRENCY) ),
- aLbFormat ( this, SVX_RES( LB_FORMAT ) ),
- aFtLanguage ( this, SVX_RES( FT_LANGUAGE ) ),
- aLbLanguage ( this, SVX_RES( LB_LANGUAGE ), FALSE ),
- aCbSourceFormat ( this, SVX_RES( CB_SOURCEFORMAT ) ),
- aFtDecimals ( this, SVX_RES( FT_DECIMALS ) ),
- aEdDecimals ( this, SVX_RES( ED_DECIMALS ) ),
- aFtLeadZeroes ( this, SVX_RES( FT_LEADZEROES ) ),
- aEdLeadZeroes ( this, SVX_RES( ED_LEADZEROES ) ),
- aBtnNegRed ( this, SVX_RES( BTN_NEGRED ) ),
- aBtnThousand ( this, SVX_RES( BTN_THOUSAND ) ),
- aFlOptions ( this, SVX_RES( FL_OPTIONS ) ),
-
- aFtEdFormat ( this, SVX_RES( FT_EDFORMAT ) ),
- aEdFormat ( this, SVX_RES( ED_FORMAT ) ),
- aIbAdd ( this, SVX_RES( IB_ADD ) ),
- aIbInfo ( this, SVX_RES( IB_INFO ) ),
- aIbRemove ( this, SVX_RES( IB_REMOVE ) ),
- aFtComment ( this, SVX_RES( FT_COMMENT ) ),
- aEdComment ( this, SVX_RES( ED_COMMENT ) ),
-
-#if ENABLE_LAYOUT
- aWndPreview ( LAYOUT_THIS_WINDOW(this), SVX_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
-#else
- aWndPreview ( this, SVX_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
-#endif
- pNumItem ( NULL ),
- pNumFmtShell ( NULL ),
- nInitFormat ( ULONG_MAX ),
-
- sAutomaticEntry ( THIS_SVX_RES( STR_AUTO_ENTRY)),
- pLastActivWindow( NULL )
-{
-#if ENABLE_LAYOUT
- aLbFormat.Clear ();
-#endif /* ENABLE_LAYOUT */
-
- Init_Impl();
- SetExchangeSupport(); // diese Page braucht ExchangeSupport
- FreeResource();
- nFixedCategory=-1;
-}
-
-SvxNumberFormatTabPage::~SvxNumberFormatTabPage()
-{
- delete pNumFmtShell;
- delete pNumItem;
-}
-
-void SvxNumberFormatTabPage::Init_Impl()
-{
- ImageList aIconList( SVX_RES_PLAIN ( IL_ICON ) );
- ImageList aIconListHC( SVX_RES_PLAIN ( IL_ICON_HC ) );
-
- bNumItemFlag=TRUE;
- bOneAreaFlag=FALSE;
-
- nCatHeight=aLbCategory.GetSizePixel().Height();
-
- nCurFormatY =aLbFormat.GetPosPixel().Y();
- nCurFormatHeight=aLbFormat.GetSizePixel().Height();
- nStdFormatY =aLbCurrency.GetPosPixel().Y();
- nStdFormatHeight=nCurFormatY-nStdFormatY+nCurFormatHeight;
-
- aIbAdd. SetModeImage( aIconList.GetImage( IID_ADD ) );
- aIbAdd. SetModeImage( aIconListHC.GetImage( IID_ADD ), BMP_COLOR_HIGHCONTRAST );
-
- aIbRemove. SetModeImage( aIconList.GetImage( IID_REMOVE ) );
- aIbRemove. SetModeImage( aIconListHC.GetImage( IID_REMOVE ), BMP_COLOR_HIGHCONTRAST );
-
- aIbInfo. SetModeImage( aIconList.GetImage( IID_INFO ) );
- aIbInfo. SetModeImage( aIconListHC.GetImage( IID_INFO ), BMP_COLOR_HIGHCONTRAST );
-
- aIbAdd.Enable(FALSE );
- aIbRemove.Enable(FALSE );
- aIbInfo.Enable(FALSE );
-
- aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert
- //holen
- aEdComment.Hide();
-
- aCbSourceFormat.Check( FALSE );
- aCbSourceFormat.Disable();
- aCbSourceFormat.Hide();
-
-// Handler verbinden
- Link aLink = LINK( this, SvxNumberFormatTabPage, SelFormatHdl_Impl );
-
- aLbCategory .SetSelectHdl( aLink );
- aLbFormat .SetSelectHdl( aLink );
- aLbLanguage .SetSelectHdl( aLink );
- aLbCurrency .SetSelectHdl( aLink );
- aCbSourceFormat .SetClickHdl( aLink );
-
- aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl );
-
- aEdDecimals .SetModifyHdl( aLink );
- aEdLeadZeroes .SetModifyHdl( aLink );
- aBtnNegRed .SetClickHdl( aLink );
- aBtnThousand .SetClickHdl( aLink );
- aLbFormat .SetDoubleClickHdl( HDL( DoubleClickHdl_Impl ) );
- aEdFormat .SetModifyHdl( HDL( EditHdl_Impl ) );
- aIbAdd.SetClickHdl( HDL( ClickHdl_Impl ) );
- aIbRemove.SetClickHdl( HDL( ClickHdl_Impl ) );
- aIbInfo.SetClickHdl( HDL( ClickHdl_Impl ) );
-
- aLink = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl);
-
- aEdComment .SetLoseFocusHdl( aLink);
- aResetWinTimer .SetTimeoutHdl(LINK( this, SvxNumberFormatTabPage, TimeHdl_Impl));
- aResetWinTimer .SetTimeout( 10);
-
- // Sprachen-ListBox initialisieren
-
- aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM );
- // Don't list ambiguous locales where we won't be able to convert the
- // LanguageType back to an identical Language_Country name and therefore
- // couldn't load the i18n LocaleData. Show DebugMsg in non-PRODUCT version.
- ::com::sun::star::uno::Sequence< sal_uInt16 > xLang =
- LocaleDataWrapper::getInstalledLanguageTypes();
- sal_Int32 nCount = xLang.getLength();
- for ( sal_Int32 i=0; i<nCount; i++ )
- {
- aLbLanguage.InsertLanguage( xLang[i] );
- }
-}
-
-/*************************************************************************
-#* Methode: GetRanges Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Liefert Bereichsangaben zurueck.
-#*
-#* Input: ---
-#*
-#* Output: Bereich
-#*
-#************************************************************************/
-
-USHORT* SvxNumberFormatTabPage::GetRanges()
-{
- return pRanges;
-}
-
-
-/*************************************************************************
-#* Methode: Create Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Erzeugt eine neue Zahlenformat- Seite.
-#*
-#* Input: Fenster, SfxItemSet
-#*
-#* Output: neue TabPage
-#*
-#************************************************************************/
-
-SfxTabPage* SvxNumberFormatTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return ( new SvxNumberFormatTabPage( pParent, rAttrSet ) );
-}
-
-
-/*************************************************************************
-#* Methode: Reset Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Die Attribute des Dialogs werden mit Hilfe
-#* des Itemsets neu eingestellt.
-#*
-#* Input: SfxItemSet
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxUInt32Item* pValFmtAttr = NULL;
- const SfxPoolItem* pItem = NULL;
- const SfxBoolItem* pAutoEntryAttr = NULL;
-
- USHORT nCatLbSelPos = 0;
- USHORT nFmtLbSelPos = 0;
- LanguageType eLangType = LANGUAGE_DONTKNOW;
- SvxDelStrgs aFmtEntryList;
- SvxNumberValueType eValType = SVX_VALUE_TYPE_UNDEFINED;
- double nValDouble = 0;
- String aValString;
- SfxItemState eState = SFX_ITEM_DONTCARE;
-
-
- eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_NOLANGUAGE ),TRUE,&pItem);
-
- if(eState==SFX_ITEM_SET)
- {
- const SfxBoolItem* pBoolLangItem = (const SfxBoolItem*)
- GetItem( rSet, SID_ATTR_NUMBERFORMAT_NOLANGUAGE);
-
- if(pBoolLangItem!=NULL && pBoolLangItem->GetValue())
- {
- HideLanguage();
- }
- else
- {
- HideLanguage(FALSE);
- }
-
- }
-
- eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_INFO ),TRUE,&pItem);
-
- if(eState==SFX_ITEM_SET)
- {
- if(pNumItem==NULL)
- {
- bNumItemFlag=TRUE;
- pNumItem= (SvxNumberInfoItem *) pItem->Clone();
- }
- else
- {
- bNumItemFlag=FALSE;
- }
- }
- else
- {
- bNumItemFlag=FALSE;
- }
-
-
- eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_ONE_AREA ));
-
- if(eState==SFX_ITEM_SET)
- {
- const SfxBoolItem* pBoolItem = (const SfxBoolItem*)
- GetItem( rSet, SID_ATTR_NUMBERFORMAT_ONE_AREA);
-
- if(pBoolItem!=NULL)
- {
- bOneAreaFlag= pBoolItem->GetValue();
- }
- }
- //bOneAreaFlag=TRUE; //@@ Debug-Test
-
- eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE ) );
-
- if ( eState == SFX_ITEM_SET )
- {
- const SfxBoolItem* pBoolItem = (const SfxBoolItem*)
- GetItem( rSet, SID_ATTR_NUMBERFORMAT_SOURCE );
- if ( pBoolItem )
- aCbSourceFormat.Check( pBoolItem->GetValue() );
- else
- aCbSourceFormat.Check( FALSE );
- aCbSourceFormat.Enable();
- aCbSourceFormat.Show();
- }
- else
- {
- BOOL bInit = FALSE; // set to TRUE for debug test
- aCbSourceFormat.Check( bInit );
- aCbSourceFormat.Enable( bInit );
- aCbSourceFormat.Show( bInit );
- }
-
- // pNumItem muss von aussen gesetzt worden sein!
- DBG_ASSERT( pNumItem, "No NumberInfo, no NumberFormatter, good bye.CRASH. :-(" );
-
- // aktuellen Zahlenformat-Tabellenindex holen
- eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_VALUE ) );
-
- if ( SFX_ITEM_DONTCARE != eState )
- pValFmtAttr = (const SfxUInt32Item*)
- GetItem( rSet, SID_ATTR_NUMBERFORMAT_VALUE );
-
- eValType = pNumItem->GetValueType();
-
- switch ( eValType )
- {
- case SVX_VALUE_TYPE_STRING:
- aValString = pNumItem->GetValueString();
- break;
- case SVX_VALUE_TYPE_NUMBER:
- // #50441# string may be set in addition to the value
- aValString = pNumItem->GetValueString();
- nValDouble = pNumItem->GetValueDouble();
- break;
- case SVX_VALUE_TYPE_UNDEFINED:
- default:
- break;
- }
-
- // nun sind alle Informationen fuer die Formatierer-Shell beisammen:
-
- if ( pNumFmtShell )
- delete pNumFmtShell; // ggF. alte Shell loeschen (==Reset)
-
- nInitFormat = ( pValFmtAttr ) // Init-Key merken
- ? pValFmtAttr->GetValue() // (fuer FillItemSet())
- : ULONG_MAX; // == DONT_KNOW
-
-
- if ( eValType == SVX_VALUE_TYPE_STRING )
- pNumFmtShell =SvxNumberFormatShell::Create(
- pNumItem->GetNumberFormatter(),
- (pValFmtAttr) ? nInitFormat : 0L,
- eValType,
- aValString );
- else
- pNumFmtShell =SvxNumberFormatShell::Create(
- pNumItem->GetNumberFormatter(),
- (pValFmtAttr) ? nInitFormat : 0L,
- eValType,
- nValDouble,
- &aValString );
-
- FillCurrencyBox();
-
- String aPrevString;
- Color* pDummy = NULL;
- pNumFmtShell->GetInitSettings( nCatLbSelPos, eLangType, nFmtLbSelPos,
- aFmtEntryList, aPrevString, pDummy );
-
- aLbCurrency.SelectEntryPos((USHORT)pNumFmtShell->GetCurrencySymbol());
-
- nFixedCategory=nCatLbSelPos;
- if(bOneAreaFlag)
- {
- String sFixedCategory=aLbCategory.GetEntry(nFixedCategory);
- aLbCategory.Clear();
- aLbCategory.InsertEntry(sFixedCategory);
- SetCategory(0);
- }
- else
- {
- SetCategory(nCatLbSelPos );
- }
- eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_ADD_AUTO ) );
- if(SFX_ITEM_SET == eState)
- pAutoEntryAttr = (const SfxBoolItem*)
- GetItem( rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO );
- // no_NO is an alias for nb_NO and normally isn't listed, we need it for
- // backwards compatibility, but only if the format passed is of
- // LanguageType no_NO.
- if ( eLangType == LANGUAGE_NORWEGIAN )
- {
- aLbLanguage.RemoveLanguage( eLangType ); // in case we're already called
- aLbLanguage.InsertLanguage( eLangType );
- }
- aLbLanguage.SelectLanguage( eLangType );
- if(pAutoEntryAttr)
- AddAutomaticLanguage_Impl(eLangType, pAutoEntryAttr->GetValue());
- UpdateFormatListBox_Impl(FALSE,TRUE);
-
-//! erAck 26.01.01
-//! This spoils everything because it rematches currency formats based on
-//! the selected aLbCurrency entry instead of the current format.
-//! Besides that everything seems to be initialized by now, so why call it?
-// SelFormatHdl_Impl( &aLbCategory );
-
- if ( pValFmtAttr )
- {
- EditHdl_Impl( &aEdFormat ); // UpdateOptions_Impl() als Seiteneffekt
- }
- else // DONT_KNOW
- {
- // Kategoriewechsel und direkte Eingabe sind moeglich, sonst nix:
- Obstructing();
- }
-
- if ( aCbSourceFormat.IsChecked() )
- {
- // everything disabled except SourceFormat checkbox
- EnableBySourceFormat_Impl();
- }
-
- DeleteEntryList_Impl(aFmtEntryList);
-}
-
-/*************************************************************************
-#* Methode: Obstructing Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Sperren der Controls mit Ausnahme von Kategoriewechsel
-#* und direkter Eingabe.
-#*
-#* Input: ---
-#*
-#* Output: ---
-#*
-#************************************************************************/
-void SvxNumberFormatTabPage::Obstructing()
-{
- aLbFormat .SetNoSelection();
- aLbLanguage .SetNoSelection();
- aFtLanguage .Disable();
- aLbLanguage .Disable();
-
- aIbAdd.Enable(FALSE );
- aIbRemove.Enable(FALSE );
- aIbInfo.Enable(FALSE );
-
- aBtnNegRed .Disable();
- aBtnThousand .Disable();
- aFtLeadZeroes .Disable();
- aFtDecimals .Disable();
- aEdLeadZeroes .Disable();
- aEdDecimals .Disable();
- aFlOptions .Disable();
- aEdDecimals .SetText( String() );
- aEdLeadZeroes .SetText( String() );
- aBtnNegRed .Check( FALSE );
- aBtnThousand .Check( FALSE );
- aWndPreview .NotifyChange( String() );
-
- aLbCategory .SelectEntryPos( 0 );
- aEdFormat .SetText( String() );
- aFtComment .SetText( String() );
- aEdComment .SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert
- //holen
-
- aEdFormat .GrabFocus();
-}
-
-
-/*************************************************************************
-#* Enable/Disable dialog parts depending on the value of the SourceFormat
-#* checkbox.
-#************************************************************************/
-void SvxNumberFormatTabPage::EnableBySourceFormat_Impl()
-{
- BOOL bEnable = !aCbSourceFormat.IsChecked();
- if ( !bEnable )
- aCbSourceFormat.GrabFocus();
- aFtCategory .Enable( bEnable );
- aLbCategory .Enable( bEnable );
- aFtFormat .Enable( bEnable );
- aLbCurrency .Enable( bEnable );
- aLbFormat .Enable( bEnable );
- aFtLanguage .Enable( bEnable );
- aLbLanguage .Enable( bEnable );
- aFtDecimals .Enable( bEnable );
- aEdDecimals .Enable( bEnable );
- aFtLeadZeroes .Enable( bEnable );
- aEdLeadZeroes .Enable( bEnable );
- aBtnNegRed .Enable( bEnable );
- aBtnThousand .Enable( bEnable );
- aFlOptions .Enable( bEnable );
- aFtEdFormat .Enable( bEnable );
- aEdFormat .Enable( bEnable );
- aIbAdd .Enable( bEnable );
- aIbRemove .Enable( bEnable );
- aIbInfo .Enable( bEnable );
- aFtComment .Enable( bEnable );
- aEdComment .Enable( bEnable );
- aLbFormat.Invalidate(); // #i43322#
-}
-
-
-/*************************************************************************
-#* Methode: HideLanguage Datum:14.05.98
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Versteckt die Spracheinstellung:
-#*
-#* Input: BOOL nFlag
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberFormatTabPage::HideLanguage(BOOL nFlag)
-{
- Size aSize=aLbCategory.GetSizePixel();
-
- if(nFlag)
- {
- aSize.Height()=aLbFormat.GetSizePixel().Height();
- }
- else
- {
- aSize.Height()=nCatHeight;
- }
-
- aLbCategory.SetSizePixel(aSize);
-
- aFtLanguage.Show(!nFlag);
- aLbLanguage.Show(!nFlag);
-}
-
-/*************************************************************************
-#* Methode: FillItemSet Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Stellt die Attribute im ItemSet ein,
-#* sowie in der DocShell den numItem, wenn
-#* bNumItemFlag nicht gesetzt ist.
-#*
-#* Input: SfxItemSet
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-BOOL SvxNumberFormatTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
-{
- BOOL bDataChanged = aFtLanguage.IsEnabled() || aCbSourceFormat.IsEnabled();
- if ( bDataChanged )
- {
- const SfxItemSet& rMyItemSet = GetItemSet();
- USHORT nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_VALUE );
- SfxItemState eItemState = rMyItemSet.GetItemState( nWhich, FALSE );
-
- // OK chosen - Is format code input entered already taken over?
- // If not, simulate Add. Upon syntax error ignore input and prevent Put.
- String aFormat = aEdFormat.GetText();
- sal_uInt32 nCurKey = pNumFmtShell->GetCurNumFmtKey();
-
- if ( aIbAdd.IsEnabled() || pNumFmtShell->IsTmpCurrencyFormat(aFormat) )
- { // #79599# It is not sufficient to just add the format code (or
- // delete it in case of bOneAreaFlag and resulting category change).
- // Upon switching tab pages we need all settings to be consistent
- // in case this page will be redisplayed later.
- bDataChanged = (ClickHdl_Impl( &aIbAdd ) != 0);
- nCurKey = pNumFmtShell->GetCurNumFmtKey();
- }
- else if(nCurKey == NUMKEY_UNDEFINED)
- { // something went wrong, e.g. in Writer #70281#
- pNumFmtShell->FindEntry(aFormat, &nCurKey);
- }
-
- //---------------------------------------------------------------
- // Chosen format:
- // --------------
- if ( bDataChanged )
- {
- bDataChanged = ( nInitFormat != nCurKey );
-
- if (bDataChanged)
- {
- rCoreAttrs.Put( SfxUInt32Item( nWhich, nCurKey ) );
- }
- else if(SFX_ITEM_DEFAULT == eItemState)
- {
- rCoreAttrs.ClearItem( nWhich );
- }
- }
-
- // --------------------------------------------------------------
- // List of changed user defined formats:
- // -------------------------------------
- const sal_uInt32 nDelCount = pNumFmtShell->GetUpdateDataCount();
-
- if ( nDelCount > 0 )
- {
- sal_uInt32* pDelArr = new sal_uInt32[nDelCount];
-
- pNumFmtShell->GetUpdateData( pDelArr, nDelCount );
- pNumItem->SetDelFormatArray( pDelArr, nDelCount );
-
- if(bNumItemFlag==TRUE)
- {
- rCoreAttrs.Put( *pNumItem );
- }
- else
- {
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
-
- DBG_ASSERT( pDocSh, "DocShell not found!" );
-
-
- if ( pDocSh )
- pDocSh->PutItem( *pNumItem );
- }
- delete [] pDelArr;
- }
-
- //---------------------------------------------------------------
- // Whether source format is to be taken or not:
- // --------------------------------------------
- if ( aCbSourceFormat.IsEnabled() )
- {
- USHORT _nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE );
- SfxItemState _eItemState = rMyItemSet.GetItemState( _nWhich, FALSE );
- const SfxBoolItem* pBoolItem = (const SfxBoolItem*)
- GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE );
- BOOL bOld = (pBoolItem ? pBoolItem->GetValue() : FALSE);
- rCoreAttrs.Put( SfxBoolItem( _nWhich, aCbSourceFormat.IsChecked() ) );
- if ( !bDataChanged )
- bDataChanged = (bOld != (BOOL) aCbSourceFormat.IsChecked() ||
- _eItemState != SFX_ITEM_SET);
- }
-
- // FillItemSet is only called on OK, here we can notify the
- // NumberFormatShell that all new user defined formats are valid.
- pNumFmtShell->ValidateNewEntries();
- if(aLbLanguage.IsVisible() &&
- LISTBOX_ENTRY_NOTFOUND != aLbLanguage.GetEntryPos(sAutomaticEntry))
- rCoreAttrs.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO,
- aLbLanguage.GetSelectEntry() == sAutomaticEntry));
- }
-
- return bDataChanged;
-}
-
-
-int SvxNumberFormatTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
-/* if ( (ULONG_MAX != nInitFormat) && _pSet )
- {
- const ULONG nCurKey = pNumFmtShell->GetCurNumFmtKey();
- const USHORT nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_VALUE );
- SfxItemState eItemState = GetItemSet().GetItemState( nWhich, FALSE );
-
- if ( (nInitFormat == nCurKey) && (SFX_ITEM_DEFAULT == eItemState) )
- _pSet->ClearItem( nWhich );
- else
- _pSet->Put( SfxUInt32Item( nWhich, nCurKey ) );
- }
- */
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-void SvxNumberFormatTabPage::SetInfoItem( const SvxNumberInfoItem& rItem )
-{
- if(pNumItem==NULL)
- {
- pNumItem = (SvxNumberInfoItem*)rItem.Clone();
- }
-}
-
-void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries )
-{
- String* pEntry;
- String aTmpString;
- String aTmpCatString;
- Font aFont=aLbCategory.GetFont();
- USHORT i = 0;
- short nTmpCatPos;
- short aPrivCat;
-
- aLbFormat.Clear();
- aLbFormat.SetUpdateMode( FALSE );
-
- USHORT nCount = rEntries.Count();
-
- if(nCount<1) return;
-
- if(bOneAreaFlag)
- {
- nTmpCatPos=nFixedCategory;
- }
- else
- {
- nTmpCatPos=aLbCategory.GetSelectEntryPos();
- }
-
- switch (nTmpCatPos)
- {
- case CAT_ALL:
- case CAT_TEXT:
- case CAT_NUMBER: i=1;
- pEntry=rEntries[0];
- if(pEntry!=NULL)
- {
- if (nTmpCatPos == CAT_TEXT)
- aTmpString=*pEntry;
- else
- aTmpString = pNumFmtShell->GetStandardName();
- aPrivCat=pNumFmtShell->GetCategory4Entry(0);
- aLbFormat.InsertFontEntry( aTmpString, aFont );
- }
- break;
-
- default: break;
- }
-
- if(pNumFmtShell!=NULL)
- {
- for ( ; i < nCount; ++i )
- {
- pEntry = rEntries[i];
- aPrivCat=pNumFmtShell->GetCategory4Entry(i);
- if(aPrivCat!=CAT_TEXT)
- {
- Color* pPreviewColor = NULL;
- String aPreviewString( GetExpColorString( pPreviewColor, *pEntry, aPrivCat ) );
- Font aEntryFont( aLbFormat.GetFont() );
- aLbFormat.InsertFontEntry( aPreviewString, aEntryFont, pPreviewColor );
- }
- else
- {
- aLbFormat.InsertFontEntry(*pEntry,aFont);
- }
- }
- }
- aLbFormat.SetUpdateMode( TRUE );
- DeleteEntryList_Impl(rEntries);
-}
-
-
-/*************************************************************************
-#* Methode: DeleteEntryList_Impl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Loescht eine SvStrings- Liste
-#*
-#* Input: String-liste
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberFormatTabPage::DeleteEntryList_Impl( SvxDelStrgs& rEntries )
-{
- USHORT nCount = rEntries.Count();
- rEntries.DeleteAndDestroy(0,nCount);
-}
-
-
-/*************************************************************************
-#* Methode: UpdateOptions_Impl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Stellt je nach eingestelltem Format die Options-
-#* attribute neu ein.
-#*
-#* Input: Flag, ob sich die Kategorie geaendert hat.
-#*
-#* Output: ---
-#*
-#***?********************************************************************/
-
-void SvxNumberFormatTabPage::UpdateOptions_Impl( BOOL bCheckCatChange /*= FALSE*/ )
-{
- SvxDelStrgs aEntryList;
- String theFormat = aEdFormat.GetText();
- USHORT nCurCategory = aLbCategory.GetSelectEntryPos();
- USHORT nCategory = nCurCategory;
- USHORT nDecimals = 0;
- USHORT nZeroes = 0;
- BOOL bNegRed = FALSE;
- BOOL bThousand = FALSE;
- short nTmpCatPos;
- USHORT nCurrencyPos =aLbCurrency.GetSelectEntryPos();
-
- if(bOneAreaFlag)
- {
- nTmpCatPos=nFixedCategory;
- nCurCategory=nFixedCategory;
- }
- else
- {
- nTmpCatPos=nCurCategory;
- }
-
-
- pNumFmtShell->GetOptions( theFormat,
- bThousand, bNegRed,
- nDecimals, nZeroes,
- nCategory );
- BOOL bDoIt=FALSE;
- if(nCategory==CAT_CURRENCY)
- {
- USHORT nTstPos=pNumFmtShell->FindCurrencyFormat(theFormat);
- if(nCurrencyPos!=nTstPos && nTstPos!=(USHORT)-1)
- {
- aLbCurrency.SelectEntryPos(nTstPos);
- pNumFmtShell->SetCurrencySymbol(nTstPos);
- bDoIt=TRUE;
- }
- }
-
-
-
- if ( nCategory != nCurCategory || bDoIt)
- {
- if ( bCheckCatChange )
- {
- if(bOneAreaFlag)
- SetCategory(0);
- else
- SetCategory(nCategory );
-
- UpdateFormatListBox_Impl( TRUE, FALSE );
- }
- }
- else if ( aLbFormat.GetEntryCount() > 0 )
- {
- sal_uInt32 nCurEntryKey=NUMKEY_UNDEFINED;
- if(!pNumFmtShell->FindEntry( aEdFormat.GetText(),&nCurEntryKey))
- {
- aLbFormat.SetNoSelection();
- }
- }
- if(bOneAreaFlag)
- {
- nCategory=nFixedCategory;
- }
-
- switch ( nCategory )
- {
- case CAT_NUMBER:
- case CAT_PERCENT:
- case CAT_CURRENCY:
- aFlOptions.Enable();
- aFtDecimals.Enable();
- aEdDecimals.Enable();
- aFtLeadZeroes.Enable();
- aEdLeadZeroes.Enable();
- aBtnNegRed.Enable();
- aBtnThousand.Enable();
- /*
- aEdDecimals .SetValue( nDecimals );
- aEdLeadZeroes.SetValue( nZeroes );
- */
- aEdDecimals .SetText( UniString::CreateFromInt32( nDecimals ) );
- aEdLeadZeroes.SetText( UniString::CreateFromInt32( nZeroes ) );
- aBtnNegRed .Check( bNegRed );
- aBtnThousand .Check( bThousand );
- break;
-
- case CAT_ALL:
- case CAT_USERDEFINED:
- case CAT_TEXT:
- case CAT_DATE:
- case CAT_TIME:
- case CAT_BOOLEAN:
- case CAT_SCIENTIFIC:
- case CAT_FRACTION:
- default:
- aFlOptions .Disable();
- aFtDecimals .Disable();
- aEdDecimals .Disable();
- aFtLeadZeroes .Disable();
- aEdLeadZeroes .Disable();
- aBtnNegRed .Disable();
- aBtnThousand .Disable();
- aEdDecimals .SetText( UniString::CreateFromInt32( 0 ) );
- aEdLeadZeroes .SetText( UniString::CreateFromInt32( 0 ) );
- aBtnNegRed .Check( FALSE );
- aBtnThousand .Check( FALSE );
- }
-}
-
-
-/*************************************************************************
-#* Methode: UpdateFormatListBox_Impl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Aktualisiert die Format- Listbox und zusaetzlich
-#* wird abhaengig vom bUpdateEdit- Flag der String
-#* in der Editbox geaendert.
-#*
-#* Input: Flags fuer Kategorie und Editbox
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
- (
- USHORT bCat, // Category oder Land/Sprache ListBox?
- BOOL bUpdateEdit // Format-Edit aktualisieren?
- )
-{
- SvxDelStrgs aEntryList;
- short nFmtLbSelPos = 0;
- short nTmpCatPos;
-
- if(bOneAreaFlag)
- {
- nTmpCatPos=nFixedCategory;
- }
- else
- {
- nTmpCatPos=aLbCategory.GetSelectEntryPos();
- }
-
-
- if ( bCat )
- {
- Point aPos=aLbFormat.GetPosPixel();
- Size aSize=aLbFormat.GetSizePixel();
-
- if(nTmpCatPos!=CAT_CURRENCY)
- {
- aPos.Y()=nStdFormatY;
- aSize.Height()=nStdFormatHeight;
- aLbFormat.SetPosSizePixel(aPos,aSize);
-#if ENABLE_LAYOUT
- aLbCurrency.Disable();
-#else /* !ENABLE_LAYOUT */
- aLbCurrency.Hide();
-#endif /* !ENABLE_LAYOUT */
- }
- else
- {
- aPos.Y()=nCurFormatY;
- aSize.Height()=nCurFormatHeight;
- aLbFormat.SetPosSizePixel(aPos,aSize);
-#if ENABLE_LAYOUT
- aLbCurrency.Enable();
-#else /* !ENABLE_LAYOUT */
- aLbCurrency.Show();
-#endif /* !ENABLE_LAYOUT */
- }
-
- pNumFmtShell->CategoryChanged( nTmpCatPos,nFmtLbSelPos, aEntryList );
- }
- else
- pNumFmtShell->LanguageChanged( aLbLanguage.GetSelectLanguage(),
- nFmtLbSelPos,aEntryList );
-
- REMOVE_DONTKNOW() // ggF. UI-Enable
-
-
- if ( (aEntryList.Count() > 0) && (nFmtLbSelPos != SELPOS_NONE) )
- {
- if(bUpdateEdit)
- {
- String aFormat=*aEntryList[nFmtLbSelPos];
- aEdFormat.SetText(aFormat);
- aFtComment.SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos));
-
- //@23.09.97 aEdFormat.SetText( aLbFormat.GetSelectEntry() );
- }
-
- if(!bOneAreaFlag || !bCat)
- {
- FillFormatListBox_Impl( aEntryList );
- aLbFormat.SelectEntryPos( nFmtLbSelPos );
-
- aFtComment.SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos));
- if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos))
- {
- if(pNumFmtShell->GetComment4Entry(nFmtLbSelPos).Len()==0)
- {
- aFtComment.SetText(aLbCategory.GetEntry(1));
- }
- }
- ChangePreviewText( (USHORT)nFmtLbSelPos );
- }
-
- }
- else
- {
- FillFormatListBox_Impl( aEntryList );
- if(nFmtLbSelPos != SELPOS_NONE)
- {
- aLbFormat.SelectEntryPos( (USHORT)nFmtLbSelPos );
-
- aFtComment.SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos));
- if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos))
- {
- if(pNumFmtShell->GetComment4Entry(nFmtLbSelPos).Len()==0)
- {
- aFtComment.SetText(aLbCategory.GetEntry(1));
- }
- }
- }
- else
- {
- aLbFormat.SetNoSelection();
- }
-
- if ( bUpdateEdit )
- {
- aEdFormat.SetText( String() );
- aWndPreview.NotifyChange( String() );
- }
- }
-}
-
-
-/*************************************************************************
-#* Handle: DoubleClickHdl_Impl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Bei einem Doppelklick in die Format- Listbox
-#* wird der Wert uebernommen und der OK-Button
-#* ausgeloest
-#*
-#* Input: Pointer auf Listbox
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-IMPL_LINK( SvxNumberFormatTabPage, DoubleClickHdl_Impl, SvxFontListBox*, pLb )
-{
- if ( pLb == &aLbFormat )
- {
- SelFormatHdl_Impl( pLb );
-
- if ( fnOkHdl.IsSet() )
- { // Uebergangsloesung, sollte von SfxTabPage angeboten werden
- fnOkHdl.Call( NULL );
- }
- else
- {
- SfxSingleTabDialog* pParent = dynamic_cast< SfxSingleTabDialog* >( GetParent() );
- OKButton* pOKButton = pParent ? pParent->GetOKButton() : NULL;
- if ( pOKButton )
- pOKButton->Click();
- }
- }
- return 0;
-}
-
-
-/*************************************************************************
-#* Methode: SelFormatHdl_Impl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Wird aufgerufen, wenn sich die Sprache, die Kategorie
-#* oder das Format aendert. Dem entsprechend werden die
-#* Einstellungen geaendert.
-#*
-#* Input: Pointer auf Listbox
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb )
-{
- if ( (CheckBox*)pLb == &aCbSourceFormat )
- {
- EnableBySourceFormat_Impl(); // enable/disable everything else
- if ( aCbSourceFormat.IsChecked() )
- return 0; // just disabled everything else
-
- // Reinit options enable/disable for current selection.
-
-#if ENABLE_LAYOUT
- if (aLbFormat.GetSelectEntryPos () == LISTBOX_ENTRY_NOTFOUND)
-#else /* !ENABLE_LAYOUT */
- // Current category may be UserDefined with no format entries defined.
- // And yes, aLbFormat is a SvxFontListBox with ULONG list positions,
- // implementation returns a LIST_APPEND if empty, comparison with
- // USHORT LISTBOX_ENTRY_NOTFOUND wouldn't match.
- if ( aLbFormat.GetSelectEntryPos() == LIST_APPEND )
-#endif /* !ENABLE_LAYOUT */
- pLb = &aLbCategory; // continue with the current category selected
- else
- pLb = &aLbFormat; // continue with the current format selected
- }
-
- short nTmpCatPos;
-
- if(bOneAreaFlag)
- {
- nTmpCatPos=nFixedCategory;
- }
- else
- {
- nTmpCatPos=aLbCategory.GetSelectEntryPos();
- }
-
- USHORT nCurrencyPos=LISTBOX_ENTRY_NOTFOUND ;
-
- if(nTmpCatPos==CAT_CURRENCY && (ListBox *)pLb == &aLbCurrency )
- {
- nCurrencyPos=aLbCurrency.GetSelectEntryPos();
- pNumFmtShell->SetCurrencySymbol(nCurrencyPos);
- }
-
- //--------------------------------------------------------------------
- // Format-ListBox ----------------------------------------------------
- if ( (SvxFontListBox *)pLb == &aLbFormat )
- {
- USHORT nSelPos = (USHORT) aLbFormat.GetSelectEntryPos();
- String aFormat = aLbFormat.GetSelectEntry();
- String aComment;
- SvxDelStrgs aEntryList;
-
- short nFmtLbSelPos = nSelPos;
-
- aFormat=pNumFmtShell->GetFormat4Entry(nSelPos);
- aComment=pNumFmtShell->GetComment4Entry(nSelPos);
- if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos))
- {
- if(pNumFmtShell->GetComment4Entry(nFmtLbSelPos).Len()==0)
- {
- aComment=aLbCategory.GetEntry(1);
- }
- }
-
- if ( aFormat.Len() > 0 )
- {
- if(!aEdFormat.HasFocus()) aEdFormat.SetText( aFormat );
- aFtComment.SetText(aComment);
- ChangePreviewText( nSelPos );
- }
-
- REMOVE_DONTKNOW() // ggF. UI-Enable
-
- if ( pNumFmtShell->FindEntry( aFormat) )
- {
- aIbAdd.Enable(FALSE );
- BOOL bIsUserDef=pNumFmtShell->IsUserDefined( aFormat );
- aIbRemove.Enable(bIsUserDef);
- aIbInfo.Enable(bIsUserDef);
-
- }
- else
- {
- aIbAdd.Enable(TRUE );
- aIbInfo.Enable(TRUE );
- aIbRemove.Enable(FALSE );
- aFtComment.SetText(aEdComment.GetText());
-
- }
- UpdateOptions_Impl( FALSE );
-
- //-------
- return 0;
- //-------
- }
-
- //--------------------------------------------------------------------
- // Kategorie-ListBox -------------------------------------------------
- if ( pLb == &aLbCategory || pLb == &aLbCurrency)
- {
- UpdateFormatListBox_Impl( TRUE, TRUE );
- EditHdl_Impl( NULL );
- UpdateOptions_Impl( FALSE );
-
- //-------
- return 0;
- //-------
- }
-
- //--------------------------------------------------------------------
- // Sprache/Land-ListBox ----------------------------------------------
- if ( pLb == &aLbLanguage )
- {
- UpdateFormatListBox_Impl( FALSE, TRUE );
- EditHdl_Impl( &aEdFormat );
-
- //-------
- return 0;
- //-------
- }
- return 0;
-}
-
-
-/*************************************************************************
-#* Methode: ClickHdl_Impl, ImageButton* pIB Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Wenn, der Hinzufuegen- oder Entfernen- Button
-#* wird diese Funktion aufgerufen und die Zahlenformat-
-#* Liste den entsprechend geaendert.
-#*
-#* Input: Toolbox- Button
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB)
-{
- BOOL bAdded = FALSE;
- BOOL bDeleted = FALSE;
- ULONG nReturn = 0;
- const ULONG nReturnChanged = 0x1; // THE boolean return value
- const ULONG nReturnAdded = 0x2; // temp: format added
- const ULONG nReturnOneArea = 0x4; // temp: one area but category changed => ignored
-
- if(pIB==&aIbAdd)
- { // Also called from FillItemSet() if a temporary currency format has
- // to be added, not only if the Add button is enabled.
- String aFormat = aEdFormat.GetText();
- SvxDelStrgs aEntryList;
- SvxDelStrgs a2EntryList;
- USHORT nCatLbSelPos = 0;
- short nFmtLbSelPos = SELPOS_NONE;
- xub_StrLen nErrPos=0;
-
- pNumFmtShell->SetCurCurrencyEntry(NULL);
- bAdded = pNumFmtShell->AddFormat( aFormat, nErrPos,
- nCatLbSelPos, nFmtLbSelPos,
- aEntryList);
- if ( bAdded )
- nReturn |= nReturnChanged | nReturnAdded;
-
- if(pLastActivWindow== (Window *) &aEdComment)
- {
- aEdFormat.GrabFocus();
- aEdComment.Hide();
- aFtComment.Show();
- aFtComment.SetText(aEdComment.GetText());
- }
-
- if ( !nErrPos ) // Syntax ok?
- {
- if(nCatLbSelPos==CAT_CURRENCY)
- {
- aLbCurrency.SelectEntryPos((USHORT)pNumFmtShell->GetCurrencySymbol());
- }
-
- if(bOneAreaFlag && (nFixedCategory!=nCatLbSelPos))
- {
- if(bAdded) DeleteEntryList_Impl(aEntryList);
- bDeleted = pNumFmtShell->RemoveFormat( aFormat,
- nCatLbSelPos,
- nFmtLbSelPos,
- a2EntryList);
- if(bDeleted) DeleteEntryList_Impl(a2EntryList);
- aEdFormat.GrabFocus();
- aEdFormat.SetSelection( Selection( (short)nErrPos, SELECTION_MAX ) );
- nReturn |= nReturnOneArea;
- }
- else
- {
- if ( bAdded && (nFmtLbSelPos != SELPOS_NONE) )
- {
- // Alles klar
- if(bOneAreaFlag) //@@ ???
- SetCategory(0);
- else
- SetCategory(nCatLbSelPos );
-
- FillFormatListBox_Impl( aEntryList );
- if(aEdComment.GetText()!=aLbCategory.GetEntry(1))
- {
- pNumFmtShell->SetComment4Entry(nFmtLbSelPos,
- aEdComment.GetText());
- }
- else
- {
- pNumFmtShell->SetComment4Entry(nFmtLbSelPos,
- String());
- }
- aLbFormat.SelectEntryPos( (USHORT)nFmtLbSelPos );
- aEdFormat.SetText( aFormat );
-
- //aEdComment.SetText(String()); //@@ ???
- aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert
- //holen
- ChangePreviewText( (USHORT)nFmtLbSelPos );
- }
- }
- }
- else // Syntaxfehler
- {
- aEdFormat.GrabFocus();
- aEdFormat.SetSelection( Selection( (short)nErrPos, SELECTION_MAX ) );
- }
- EditHdl_Impl( &aEdFormat );
- nReturn = ((nReturn & nReturnOneArea) ? 0 : (nReturn & nReturnChanged));
- }
- else if(pIB==&aIbRemove)
- {
- String aFormat = aEdFormat.GetText();
- SvxDelStrgs aEntryList;
- USHORT nCatLbSelPos = 0;
- short nFmtLbSelPos = SELPOS_NONE;
-
- bDeleted = pNumFmtShell->RemoveFormat( aFormat,
- nCatLbSelPos,
- nFmtLbSelPos,
- aEntryList );
-
- aEdComment.SetText(aLbCategory.GetEntry(1));
- if ( bDeleted )
- {
- if(nFmtLbSelPos>=0 && nFmtLbSelPos<aEntryList.Count())
- {
- aFormat = *aEntryList[nFmtLbSelPos];
- }
-
- FillFormatListBox_Impl( aEntryList );
-
- if ( nFmtLbSelPos != SELPOS_NONE )
- {
- if(bOneAreaFlag) //@@ ???
- SetCategory(0);
- else
- SetCategory(nCatLbSelPos );
-
- aLbFormat.SelectEntryPos( (USHORT)nFmtLbSelPos );
- aEdFormat.SetText( aFormat );
- ChangePreviewText( (USHORT)nFmtLbSelPos );
- }
- else
- {
- // auf "Alle/Standard" setzen
- SetCategory(0 );
- SelFormatHdl_Impl( &aLbCategory );
- }
- }
- EditHdl_Impl( &aEdFormat );
- }
- else if(pIB==&aIbInfo)
- {
- if(!(pLastActivWindow== (Window *) &aEdComment))
- {
- aEdComment.SetText(aFtComment.GetText());
- aEdComment.Show();
- aFtComment.Hide();
- aEdComment.GrabFocus();
- }
- else
- {
- aEdFormat.GrabFocus();
- aEdComment.Hide();
- aFtComment.Show();
- }
- }
-
- return nReturn;
-}
-
-
-/*************************************************************************
-#* Methode: EditHdl_Impl Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Wenn der Eintrag im Eingabefeld geaendert wird,
-#* so wird die Vorschau aktualisiert und
-#*
-#* Input: Pointer auf Editbox
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat )
-{
- sal_uInt32 nCurKey = NUMKEY_UNDEFINED;
-
- if ( aEdFormat.GetText().Len() == 0 )
- {
- aIbAdd.Enable(FALSE );
- aIbRemove.Enable(FALSE );
- aIbInfo.Enable(FALSE );
- aFtComment.SetText(String());
- }
- else
- {
- String aFormat = aEdFormat.GetText();
- //aFtComment.SetText(String());
- MakePreviewText( aFormat );
-
- if ( pNumFmtShell->FindEntry( aFormat, &nCurKey ) )
- {
- aIbAdd.Enable(FALSE );
- BOOL bUserDef=pNumFmtShell->IsUserDefined( aFormat );
-
- aIbRemove.Enable(bUserDef);
- aIbInfo.Enable(bUserDef);
-
- if(bUserDef)
- {
- USHORT nTmpCurPos=pNumFmtShell->FindCurrencyFormat(aFormat );
-
- if(nTmpCurPos!=(USHORT)-1)
- aLbCurrency.SelectEntryPos(nTmpCurPos);
- }
- short nPosi=pNumFmtShell->GetListPos4Entry(aFormat);
- if(nPosi>=0)
- aLbFormat.SelectEntryPos( (USHORT)nPosi);
-
- }
- else
- {
-
- aIbAdd.Enable(TRUE );
- aIbInfo.Enable(TRUE);
- aIbRemove.Enable(FALSE );
-
- aFtComment.SetText(aEdComment.GetText());
-
- }
- }
-
- if ( pEdFormat )
- {
- pNumFmtShell->SetCurNumFmtKey( nCurKey );
- UpdateOptions_Impl( TRUE );
- }
-
- return 0;
-}
-
-
-/*************************************************************************
-#* Methode: NotifyChange Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Fuehrt Aenderungen in den Zahlen- Attributen durch.
-#*
-#* Input: Options- Controls
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl )
-{
- if ( ((NumericField*)pOptCtrl == &aEdLeadZeroes)
- || ((NumericField*)pOptCtrl == &aEdDecimals)
- || ((CheckBox*) pOptCtrl == &aBtnNegRed)
- || ((CheckBox*) pOptCtrl == &aBtnThousand) )
- {
- String aFormat;
- BOOL bThousand = aBtnThousand.IsEnabled()
- && aBtnThousand.IsChecked();
- BOOL bNegRed = aBtnNegRed.IsEnabled()
- && aBtnNegRed.IsChecked();
- USHORT nPrecision = (aEdDecimals.IsEnabled())
- ? (USHORT)aEdDecimals.GetValue()
- : (USHORT)0;
- USHORT nLeadZeroes = (aEdLeadZeroes.IsEnabled())
- ? (USHORT)aEdLeadZeroes.GetValue()
- : (USHORT)0;
-
- pNumFmtShell->MakeFormat( aFormat,
- bThousand, bNegRed,
- nPrecision, nLeadZeroes,
- (USHORT)aLbFormat.GetSelectEntryPos() );
-
- aEdFormat.SetText( aFormat );
- //aFtComment.SetText(String());
- MakePreviewText( aFormat );
-
- if ( pNumFmtShell->FindEntry( aFormat ) )
- {
- aIbAdd.Enable(FALSE );
- BOOL bUserDef=pNumFmtShell->IsUserDefined( aFormat );
- aIbRemove.Enable(bUserDef);
- aIbInfo.Enable(bUserDef);
- EditHdl_Impl( &aEdFormat);
-
- }
- else
- {
- EditHdl_Impl( NULL );
- aLbFormat.SetNoSelection();
- }
- }
- return 0;
-}
-
-IMPL_LINK( SvxNumberFormatTabPage, TimeHdl_Impl, Timer*, EMPTYARG)
-{
- pLastActivWindow=NULL;
- return 0;
-}
-
-
-/*************************************************************************
-#* Methode: LostFocusHdl_Impl Datum:30.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Fuehrt Aenderungen in den Zahlen- Attributen durch.
-#*
-#* Input: Options- Controls
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Edit *, pEd)
-{
- if (pEd==&aEdComment)
- {
- aResetWinTimer.Start();
- aFtComment.SetText(aEdComment.GetText());
- aEdComment.Hide();
- aFtComment.Show();
- if(!aIbAdd.IsEnabled())
- {
- USHORT nSelPos = (USHORT) aLbFormat.GetSelectEntryPos();
- pNumFmtShell->SetComment4Entry(nSelPos,
- aEdComment.GetText());
- aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert
- //holen
- }
- }
- return 0;
-}
-
-/*************************************************************************
-#* Methode: NotifyChange Datum:02.10.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Fuehrt Aenderungen in den Zahlen- Attributen durch.
-#*
-#* Input: Options- Controls
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-String SvxNumberFormatTabPage::GetExpColorString(
- Color*& rpPreviewColor, const String& rFormatStr, short nTmpCatPos)
-{
- double nVal = 0;
- switch (nTmpCatPos)
- {
- case CAT_CURRENCY: nVal=SVX_NUMVAL_CURRENCY; break;
-
- case CAT_SCIENTIFIC:
- case CAT_FRACTION:
- case CAT_NUMBER: nVal=SVX_NUMVAL_STANDARD; break;
-
- case CAT_PERCENT: nVal=SVX_NUMVAL_PERCENT; break;
-
- case CAT_ALL: nVal=SVX_NUMVAL_STANDARD; break;
-
- case CAT_TIME: nVal=SVX_NUMVAL_TIME; break;
- case CAT_DATE: nVal=SVX_NUMVAL_DATE; break;
-
- case CAT_BOOLEAN: nVal=SVX_NUMVAL_BOOLEAN; break;
-
- case CAT_USERDEFINED:
- case CAT_TEXT:
- default: nVal=0;break;
- }
-
- String aPreviewString;
- pNumFmtShell->MakePrevStringFromVal( rFormatStr, aPreviewString, rpPreviewColor, nVal );
- return aPreviewString;
-}
-
-void SvxNumberFormatTabPage::MakePreviewText( const String& rFormat )
-{
- String aPreviewString;
- Color* pPreviewColor = NULL;
- pNumFmtShell->MakePreviewString( rFormat, aPreviewString, pPreviewColor );
- aWndPreview.NotifyChange( aPreviewString, pPreviewColor );
-}
-
-void SvxNumberFormatTabPage::ChangePreviewText( USHORT nPos )
-{
- String aPreviewString;
- Color* pPreviewColor = NULL;
- pNumFmtShell->FormatChanged( nPos, aPreviewString, pPreviewColor );
- aWndPreview.NotifyChange( aPreviewString, pPreviewColor );
-}
-
-long SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt )
-{
- if(rNEvt.GetType()==EVENT_LOSEFOCUS)
- {
- if ( rNEvt.GetWindow() == dynamic_cast< Window* >( &aEdComment ) && !aEdComment.IsVisible() )
- {
- pLastActivWindow = NULL;
- }
- else
- {
- pLastActivWindow = rNEvt.GetWindow();
- }
- }
-
- return SfxTabPage::PreNotify( rNEvt );
-}
-/*************************************************************************
-#* Methode: SetOkHdl Datum:01.11.97
-#*------------------------------------------------------------------------
-#*
-#* Klasse: SvxNumberFormatTabPage
-#*
-#* Funktion: Setzt den OkHandler neu.
-#*
-#* Input: Neuer OkHandler
-#*
-#* Output: ---
-#*
-#************************************************************************/
-
-void SvxNumberFormatTabPage::SetOkHdl( const Link& rOkHandler )
-{
- fnOkHdl = rOkHandler;
-}
-
-void SvxNumberFormatTabPage::FillCurrencyBox()
-{
- SvStringsDtor aList;
- NfShCurrencyEntries rEntries;
- XubString* pEntry = NULL;
- USHORT nPos=0;
- USHORT nSelPos=0;
-
- pNumFmtShell->GetCurrencySymbols( aList, &nSelPos);
-
- for(USHORT i=1;i<aList.Count();i++)
- {
- pEntry=aList[i];
- nPos=aLbCurrency.InsertEntry( *pEntry);
- }
- aLbCurrency.SelectEntryPos(nSelPos);
-}
-
-void SvxNumberFormatTabPage::SetCategory(USHORT nPos)
-{
- USHORT nCurCategory = aLbCategory.GetSelectEntryPos();
- Point aPos=aLbFormat.GetPosPixel();
- Size aSize=aLbFormat.GetSizePixel();
- USHORT nTmpCatPos;
-
- if(bOneAreaFlag)
- {
- nTmpCatPos=nFixedCategory;
- }
- else
- {
- nTmpCatPos=nPos;
- }
-
- if(aLbCategory.GetEntryCount()==1 || nCurCategory!=nPos)
- {
- if(nTmpCatPos!=CAT_CURRENCY)
- {
- aPos.Y()=nStdFormatY;
- aSize.Height()=nStdFormatHeight;
- aLbFormat.SetPosSizePixel(aPos,aSize);
- aLbCurrency.Hide();
- }
- else
- {
- aPos.Y()=nCurFormatY;
- aSize.Height()=nCurFormatHeight;
- aLbFormat.SetPosSizePixel(aPos,aSize);
- aLbCurrency.Show();
- }
- }
- aLbCategory.SelectEntryPos(nPos);
-}
-/* -----------------12.11.2002 14:35-----------------
- * to support Writer text field language handling an
- * additional entry needs to be inserted into the ListBox
- * which marks a certain language as automatically detected
- * Additionally the "Default" language is removed
- * --------------------------------------------------*/
-void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, BOOL bSelect)
-{
- aLbLanguage.RemoveLanguage(LANGUAGE_SYSTEM);
- USHORT nPos = aLbLanguage.InsertEntry(sAutomaticEntry);
- aLbLanguage.SetEntryData(nPos, (void*)(ULONG)eAutoLang);
- if(bSelect)
- aLbLanguage.SelectEntryPos(nPos);
-}
-
-void SvxNumberFormatTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pNumberInfoItem,SvxNumberInfoItem,SID_ATTR_NUMBERFORMAT_INFO,sal_False);
- SFX_ITEMSET_ARG (&aSet,pLinkItem,SfxLinkItem,SID_LINK_TYPE,sal_False);
- if (pNumberInfoItem)
- SetNumberFormatList(*pNumberInfoItem);
- if (pLinkItem)
- SetOkHdl(pLinkItem->GetValue());
-}
diff --git a/svx/source/cui/numfmt.hrc b/svx/source/cui/numfmt.hrc
deleted file mode 100644
index 15757e76ac..0000000000
--- a/svx/source/cui/numfmt.hrc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numfmt.hrc,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_NUMFMT_HRC
-#define _SVX_NUMFMT_HRC
-
-// defines ------------------------------------------------------------------
-
-//================================================
-// Zahlen-TabPage:
-#define WND_NUMBER_PREVIEW 2
-#define FT_CATEGORY 3
-#define FT_FORMAT 4
-#define FT_OPTIONS 5
-#define FT_EDFORMAT 6
-#define LB_CATEGORY 9
-#define LB_FORMAT 10
-#define FL_OPTIONS 11
-#define FT_LANGUAGE 12
-#define LB_LANGUAGE 13
-#define ED_FORMAT 14
-#define BTN_ADD 15
-#define BTN_REMOVE 16
-#define BMP_CHECK 17
-#define BMP_DCHECK 18
-#define BMP_CROSS 19
-#define BMP_DCROSS 20
-#define FT_DECIMALS 21
-#define ED_DECIMALS 22
-#define FT_LEADZEROES 23
-#define ED_LEADZEROES 24
-#define BTN_NEGRED 25
-#define BTN_THOUSAND 26
-#define FT_COMMENT 27
-#define ED_COMMENT 28
-#define IB_ADD 29
-#define IB_REMOVE 30
-#define IB_INFO 31
-#define IL_ICON 32
-#define LB_CURRENCY 33
-#define CB_SOURCEFORMAT 34
-#define IL_ICON_HC 35
-#define STR_AUTO_ENTRY 36
-
-#define TBX_ADDREMOVE 1
-#define IID_ADD 1
-#define IID_REMOVE 2
-#define IID_INFO 3
-
-#endif
-
diff --git a/svx/source/cui/numfmt.hxx b/svx/source/cui/numfmt.hxx
deleted file mode 100644
index b5e2df0af4..0000000000
--- a/svx/source/cui/numfmt.hxx
+++ /dev/null
@@ -1,206 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numfmt.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_NUMFMT_HXX
-#define _SVX_NUMFMT_HXX
-
-//------------------------------------------------------------------------
-
-#include <vcl/window.hxx>
-#include <tools/color.hxx>
-#include <tools/string.hxx>
-#include <sfx2/tabdlg.hxx>
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
-
-#ifndef _TOOLBOX_HXX //autogen
-#include <vcl/toolbox.hxx>
-#endif
-
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-#include <svx/langbox.hxx>
-#include "fontlb.hxx"
-
-//CHINA001 #define SVX_NUMVAL_STANDARD -1234.12345678901234
-//CHINA001 #define SVX_NUMVAL_CURRENCY -1234
-//CHINA001 #define SVX_NUMVAL_PERCENT -0.1295
-//CHINA001 #define SVX_NUMVAL_TIME 36525.5678935185
-//CHINA001 #define SVX_NUMVAL_DATE 36525.5678935185
-//CHINA001 #define SVX_NUMVAL_BOOLEAN 1
-
-//------------------------------------------------------------------------
-
-class SvxNumberFormatShell;
-class SvxNumberInfoItem;
-
-//------------------------------------------------------------------------
-
-class SvxNumberPreviewImpl : public Window
-{
-private:
- String aPrevStr;
- Color aPrevCol;
-
- void InitSettings( BOOL bForeground, BOOL bBackground );
-
-protected:
- virtual void Paint( const Rectangle& rRect );
- virtual void StateChanged( StateChangedType nStateChange );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-public:
- SvxNumberPreviewImpl( Window* pParent, const ResId& rResId );
- ~SvxNumberPreviewImpl();
-
- void NotifyChange( const String& rPrevStr, const Color* pColor = NULL );
-};
-
-// -----------------------------------------------------------------------
-
-#include <sfx2/layout.hxx>
-#include <layout/layout-pre.hxx>
-
-class SvxNumberFormatTabPage : public SfxTabPage
-{
- using SfxTabPage::DeactivatePage;
-
-public:
- ~SvxNumberFormatTabPage();
-
-#undef SfxTabPage
-#define SfxTabPage ::SfxTabPage
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual int DeactivatePage ( SfxItemSet* pSet = NULL );
-
- void SetInfoItem( const SvxNumberInfoItem& rItem );
- void SetNumberFormatList( const SvxNumberInfoItem& rItem )
- { SetInfoItem( rItem ); }
-
- void SetOkHdl( const Link& rOkHandler );
- void HideLanguage(BOOL nFlag=TRUE);
- virtual long PreNotify( NotifyEvent& rNEvt );
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-private:
- SvxNumberFormatTabPage( Window* pParent,
- const SfxItemSet& rCoreAttrs );
- FixedText aFtCategory;
- ListBox aLbCategory;
- FixedText aFtFormat;
- ListBox aLbCurrency;
- SvxFontListBox aLbFormat;
- FixedText aFtLanguage;
- SvxLanguageBox aLbLanguage;
- CheckBox aCbSourceFormat;
-
- FixedText aFtDecimals;
- NumericField aEdDecimals;
- FixedText aFtLeadZeroes;
- NumericField aEdLeadZeroes;
- CheckBox aBtnNegRed;
- CheckBox aBtnThousand;
- FixedLine aFlOptions;
-
- FixedText aFtEdFormat;
- Edit aEdFormat;
- ImageButton aIbAdd;
- ImageButton aIbInfo;
- ImageButton aIbRemove;
-
- FixedText aFtComment;
- Edit aEdComment;
- Timer aResetWinTimer;
-
- SvxNumberPreviewImpl aWndPreview;
-
- SvxNumberInfoItem* pNumItem;
- SvxNumberFormatShell* pNumFmtShell;
- ULONG nInitFormat;
- Link fnOkHdl;
-
- BOOL bNumItemFlag; //Fuer Handling mit DocShell
- BOOL bOneAreaFlag;
- short nFixedCategory;
-
- long nCatHeight;
-
- long nCurFormatY;
- long nCurFormatHeight;
- long nStdFormatY;
- long nStdFormatHeight;
- LocalizedString sAutomaticEntry;
-
- Window* pLastActivWindow;
-
-#ifdef _SVX_NUMFMT_CXX
- void Init_Impl();
- void FillCurrencyBox();
- void FillFormatListBox_Impl( SvxDelStrgs& rEntries );
- void UpdateOptions_Impl( BOOL bCheckCatChange );
- void UpdateFormatListBox_Impl( USHORT bCat, BOOL bUpdateEdit );
- void DeleteEntryList_Impl( SvxDelStrgs& rEntries );
- void Obstructing();
- void EnableBySourceFormat_Impl();
- void SetCategory( USHORT nPos );
- String GetExpColorString( Color*& rpPreviewColor, const String& aFormatStr, short nTmpCatPos );
- void MakePreviewText( const String& rFormat );
- void ChangePreviewText( USHORT nPos );
- void AddAutomaticLanguage_Impl(LanguageType eAutoLang, BOOL bSelect);
- // Handler
- DECL_LINK( LostFocusHdl_Impl, Edit* pEd );
- DECL_LINK( DoubleClickHdl_Impl, SvxFontListBox* pLb );
- DECL_LINK( SelFormatHdl_Impl, void * );
- DECL_LINK( ClickHdl_Impl, ImageButton* pIB );
- DECL_LINK( EditHdl_Impl, Edit* pEdFormat );
- DECL_LINK( OptHdl_Impl, void * );
- DECL_LINK( TimeHdl_Impl, Timer * );
-
-#endif
-};
-
-#include <layout/layout-post.hxx>
-
-#endif
-
diff --git a/svx/source/cui/numfmt.src b/svx/source/cui/numfmt.src
deleted file mode 100644
index 6380215e0d..0000000000
--- a/svx/source/cui/numfmt.src
+++ /dev/null
@@ -1,297 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numfmt.src,v $
- * $Revision: 1.51 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "numfmt.hrc"
- // pragma ----------------------------------------------------------------
-
- // RID_SVXPAGE_NUMBERFORMAT ----------------------------------------------
-TabPage RID_SVXPAGE_NUMBERFORMAT
-{
- HelpId = HID_NUMBERFORMAT ;
- Hide = TRUE ;
- Text [ en-US ] = "Number Format" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedText FT_CATEGORY
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "~Category" ;
- };
- ListBox LB_CATEGORY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 70 , 71 ) ;
- AutoHScroll = TRUE ;
- StringList [ en-US ] =
- {
- < "All" ; Default ; > ;
- < "User-defined" ; Default ; > ;
- < "Number" ; Default ; > ;
- < "Percent" ; Default ; > ;
- < "Currency" ; Default ; > ;
- < "Date" ; Default ; > ;
- < "Time" ; Default ; > ;
- < "Scientific" ; Default ; > ;
- < "Fraction" ; Default ; > ;
- < "Boolean Value" ; Default ; > ;
- < "Text" ; Default ; > ;
- };
- };
- FixedText FT_EDFORMAT
- {
- Pos = MAP_APPFONT ( 6 , 136 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "~Format code" ;
- };
- Edit ED_FORMAT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 147 ) ;
- Size = MAP_APPFONT ( 200 , 12 ) ;
- };
- FixedText FT_COMMENT
- {
- Pos = MAP_APPFONT ( 6 , 163 ) ;
- Size = MAP_APPFONT ( 248 , 16 ) ;
- WordBreak = TRUE ;
- NoLabel = TRUE ;
- };
- Edit ED_COMMENT
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 163 ) ;
- Size = MAP_APPFONT ( 248 , 12 ) ;
- };
- FixedText FT_FORMAT
- {
- Pos = MAP_APPFONT ( 82 , 3 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Text [ en-US ] = "F~ormat" ;
- };
-
- ListBox LB_CURRENCY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 82 , 14 ) ;
- Size = MAP_APPFONT ( 90 , 71 ) ;
- DropDown = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Automatically" ; Default ; > ;
- };
- };
-
- Control LB_FORMAT
- {
- HelpId = HID_NUMBERFORMAT_LB_FORMAT ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 82 , 27 ) ;
- Size = MAP_APPFONT ( 90 , 58 ) ;
- TabStop = TRUE ;
- };
-
- FixedText FT_DECIMALS
- {
- Pos = MAP_APPFONT ( 12 , 104 ) ;
- Size = MAP_APPFONT ( 69 , 8 ) ;
- Text [ en-US ] = "~Decimal places" ;
- };
- NumericField ED_DECIMALS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 84 , 102 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Spin = TRUE ;
- Maximum = 20 ;
- Last = 15 ;
- First = 0 ;
- StrictFormat = TRUE ;
- SpinSize = 1 ;
- Repeat = TRUE ;
- };
- FixedText FT_LEADZEROES
- {
- Pos = MAP_APPFONT ( 12 , 120 ) ;
- Size = MAP_APPFONT ( 69 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Führende ~Nullen : F³hrende ~Nullen */
- Text [ en-US ] = "Leading ~zeroes" ;
- };
- NumericField ED_LEADZEROES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 84 , 118 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Spin = TRUE ;
- Maximum = 20 ;
- Last = 15 ;
- First = 0 ;
- StrictFormat = TRUE ;
- SpinSize = 1 ;
- Repeat = TRUE ;
- };
- CheckBox BTN_NEGRED
- {
- Pos = MAP_APPFONT ( 133 , 104 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- Text [ en-US ] = "~Negative numbers red" ;
- };
- CheckBox BTN_THOUSAND
- {
- Pos = MAP_APPFONT ( 133 , 120 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- Text [ en-US ] = "~Thousands separator" ;
- };
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 91 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Options" ;
- };
- FixedText FT_LANGUAGE
- {
- Pos = MAP_APPFONT ( 178 , 3 ) ;
- Size = MAP_APPFONT ( 76 , 8 ) ;
- Text [ en-US ] = "~Language" ;
- };
- ListBox LB_LANGUAGE
- {
- Border = TRUE ;
- Sort = TRUE ;
- Pos = MAP_APPFONT ( 178 , 14 ) ;
- Size = MAP_APPFONT ( 76 , 71 ) ;
- DropDown = TRUE ;
- };
- CheckBox CB_SOURCEFORMAT
- {
- Pos = MAP_APPFONT ( 178 , 42 ) ;
- Size = MAP_APPFONT ( 76 , 10 ) ;
- Text [ en-US ] = "So~urce format" ;
- };
- Window WND_NUMBER_PREVIEW
- {
- Border = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 178 , 67 ) ;
- Size = MAP_APPFONT ( 76 , 18 ) ;
- HelpId = HID_NUMBERFORMAT_WND_NUMBER_PREVIEW ;
- };
- ImageButton IB_ADD
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 208 , 146 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- HelpId = HID_NUMBERFORMAT_TBI_ADD ;
- QuickHelpText [ en-US ] = "Add" ;
- };
- ImageButton IB_REMOVE
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 240 , 146 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- HelpId = HID_NUMBERFORMAT_TBI_REMOVE ;
- QuickHelpText [ en-US ] = "Remove" ;
- };
- ImageButton IB_INFO
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 224 , 146 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- HelpId = HID_NUMBERFORMAT_TBI_INFO ;
- QuickHelpText [ en-US ] = "Edit Comment" ;
- };
- ImageList IL_ICON
- {
- Prefix = "nu";
- MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
- IdList =
- {
- IID_ADD ;
- IID_REMOVE ;
- IID_INFO ;
- };
- IdCount = { 3 ; };
- };
- ImageList IL_ICON_HC
- {
- Prefix = "nuh";
- MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
- IdList =
- {
- IID_ADD ;
- IID_REMOVE ;
- IID_INFO ;
- };
- IdCount = { 3 ; };
- };
-
- String STR_AUTO_ENTRY
- {
- Text [ en-US ] = "Automatic";
- };
-
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/numpages.cxx b/svx/source/cui/numpages.cxx
deleted file mode 100644
index 6069efd2cb..0000000000
--- a/svx/source/cui/numpages.cxx
+++ /dev/null
@@ -1,4087 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numpages.cxx,v $
- * $Revision: 1.64 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/RelOrientation.hpp>
-
-#include <numpages.hxx>
-#include <numpages.hrc>
-#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include <tools/shl.hxx>
-#include <i18npool/mslangid.hxx>
-#include <svtools/valueset.hxx>
-#ifndef _SVX_HELPID_HRC
-#include <helpid.hrc>
-#endif
-#include <svx/numitem.hxx>
-#include <svtools/eitem.hxx>
-#include <vcl/svapp.hxx>
-#include <gallery.hxx>
-#include <svtools/urihelper.hxx>
-#include <svx/brshitem.hxx>
-#include <svtools/intitem.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/graph.hxx>
-#include <vcl/msgbox.hxx>
-#include "cuicharmap.hxx"
-#include <flstitem.hxx>
-#include <dlgutil.hxx>
-#include <svx/xtable.hxx>
-#include <drawitem.hxx>
-#include <numvset.hxx>
-#include <htmlmode.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/ctrltool.hxx>
-#include <unolingu.hxx>
-#include <com/sun/star/style/NumberingType.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/text/XDefaultNumberingProvider.hpp>
-#include <com/sun/star/text/XNumberingFormatter.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/text/XNumberingTypeInfo.hpp>
-
-#include <algorithm>
-#include <vector>
-#include "opengrf.hxx"
-
-#include <svx/dialogs.hrc> //CHINA001
-#include <sfx2/request.hxx> //CHINA001
-#include <svtools/aeitem.hxx> //add CHINA001
-#include <svtools/stritem.hxx>//add CHINA001
-#include <svtools/slstitm.hxx> //add CHINA001
-
-using namespace com::sun::star;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::i18n;
-using namespace com::sun::star::text;
-using namespace com::sun::star::container;
-using namespace com::sun::star::style;
-using rtl::OUString;
-#define C2U(cChar) OUString::createFromAscii(cChar)
-
-SV_IMPL_PTRARR(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr);
-
-/*-----------------07.02.97 15.37-------------------
-
---------------------------------------------------*/
-#define NUM_PAGETYPE_BULLET 0
-#define NUM_PAGETYPE_SINGLENUM 1
-#define NUM_PAGETYPE_NUM 2
-#define NUM_PAGETYPE_BMP 3
-#define PAGETYPE_USER_START 10
-
-#define SHOW_NUMBERING 0
-#define SHOW_BULLET 1
-#define SHOW_BITMAP 2
-
-#define MAX_BMP_WIDTH 16
-#define MAX_BMP_HEIGHT 16
-
-static BOOL bLastRelative = FALSE;
-static const sal_Char cNumberingType[] = "NumberingType";
-static const sal_Char cValue[] = "Value";
-static const sal_Char cParentNumbering[] = "ParentNumbering";
-static const sal_Char cPrefix[] = "Prefix";
-static const sal_Char cSuffix[] = "Suffix";
-static const sal_Char cBulletChar[] = "BulletChar";
-static const sal_Char cBulletFontName[] = "BulletFontName";
-/* -----------------------------31.01.01 10:23--------------------------------
-
- ---------------------------------------------------------------------------*/
-Reference<XDefaultNumberingProvider> lcl_GetNumberingProvider()
-{
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
- Reference<XDefaultNumberingProvider> xRet(xI, UNO_QUERY);
- DBG_ASSERT(xRet.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
-
- return xRet;
-}
-/* -----------------------------31.01.01 11:40--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxNumSettings_ImplPtr lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps)
-{
- const PropertyValue* pValues = rLevelProps.getConstArray();
- SvxNumSettings_ImplPtr pNew = new SvxNumSettings_Impl;
- for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
- {
- if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cNumberingType)))
- pValues[j].Value >>= pNew->nNumberType;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cPrefix)))
- pValues[j].Value >>= pNew->sPrefix;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cSuffix)))
- pValues[j].Value >>= pNew->sSuffix;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cParentNumbering)))
- pValues[j].Value >>= pNew->nParentNumbering;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cBulletChar)))
- pValues[j].Value >>= pNew->sBulletChar;
- else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cBulletFontName)))
- pValues[j].Value >>= pNew->sBulletFont;
- }
- return pNew;
-}
-/* -----------------28.10.98 08:32-------------------
- *
- * --------------------------------------------------*/
-// Die Auswahl an Bullets aus den StarSymbol
-static const sal_Unicode aBulletTypes[] =
-{
- 0x2022,
- 0x25cf,
- 0xe00c,
- 0xe00a,
- 0x2794,
- 0x27a2,
- 0x2717,
- 0x2714
-};
-/* -----------------28.10.98 09:42-------------------
- *
- * --------------------------------------------------*/
-static sal_Char __READONLY_DATA aNumChar[] =
-{
- 'A', //CHARS_UPPER_LETTER
- 'a', //CHARS_LOWER_LETTER
- 'I', //ROMAN_UPPER
- 'i', //ROMAN_LOWER
- '1', //ARABIC
- ' '
-};
-
-/*-----------------18.03.98 08:35-------------------
- Ist eins der maskierten Formate gesetzt?
---------------------------------------------------*/
-BOOL lcl_IsNumFmtSet(SvxNumRule* pNum, USHORT nLevelMask)
-{
- BOOL bRet = FALSE;
- USHORT nMask = 1;
- for( USHORT i = 0; i < SVX_MAX_NUM && !bRet; i++ )
- {
- if(nLevelMask & nMask)
- bRet |= 0 != pNum->Get( i );
- nMask <<= 1 ;
- }
- return bRet;
-}
-/* -----------------28.10.98 08:50-------------------
- *
- * --------------------------------------------------*/
-
-Font& lcl_GetDefaultBulletFont()
-{
- static BOOL bInit = 0;
- static Font aDefBulletFont( UniString::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "StarSymbol" ) ),
- String(), Size( 0, 14 ) );
- if(!bInit)
- {
- aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
- aDefBulletFont.SetFamily( FAMILY_DONTKNOW );
- aDefBulletFont.SetPitch( PITCH_DONTKNOW );
- aDefBulletFont.SetWeight( WEIGHT_DONTKNOW );
- aDefBulletFont.SetTransparent( TRUE );
- bInit = TRUE;
- }
- return aDefBulletFont;
-}
-
-
-/**************************************************************************/
-/* */
-/* */
-/**************************************************************************/
-
-
-SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(Window* pParent,
- const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_PICK_SINGLE_NUM ), rSet ),
- aValuesFL( this, SVX_RES(FL_VALUES) ),
- pExamplesVS( new SvxNumValueSet(this, SVX_RES(VS_VALUES), NUM_PAGETYPE_SINGLENUM )),
- pActNum(0),
- pSaveNum(0),
- nActNumLvl( USHRT_MAX ),
- bModified(FALSE),
- bPreset(FALSE),
- nNumItemId(SID_ATTR_NUMBERING_RULE)
-{
- FreeResource();
- SetExchangeSupport();
- pExamplesVS->SetSelectHdl(LINK(this, SvxSingleNumPickTabPage, NumSelectHdl_Impl));
- pExamplesVS->SetDoubleClickHdl(LINK(this, SvxSingleNumPickTabPage, DoubleClickHdl_Impl));
- pExamplesVS->SetHelpId(HID_VALUESET_SINGLENUM );
-
- Reference<XDefaultNumberingProvider> xDefNum = lcl_GetNumberingProvider();
- if(xDefNum.is())
- {
- Sequence< Sequence< PropertyValue > > aNumberings;
- LanguageType eLang = Application::GetSettings().GetLanguage();
- Locale aLocale = SvxCreateLocale(eLang);
- try
- {
- aNumberings =
- xDefNum->getDefaultContinuousNumberingLevels( aLocale );
-
-
- sal_Int32 nLength = aNumberings.getLength() > NUM_VALUSET_COUNT ? NUM_VALUSET_COUNT :aNumberings.getLength();
-
- const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
- for(sal_Int32 i = 0; i < nLength; i++)
- {
- SvxNumSettings_ImplPtr pNew = lcl_CreateNumSettingsPtr(pValuesArr[i]);
- aNumSettingsArr.Insert(pNew, aNumSettingsArr.Count());
- }
- }
- catch(Exception&)
- {
- }
- Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY);
- pExamplesVS->SetNumberingSettings(aNumberings, xFormat, aLocale);
- }
-}
-/*-----------------07.02.97 12.08-------------------
-
---------------------------------------------------*/
-
- SvxSingleNumPickTabPage::~SvxSingleNumPickTabPage()
-{
- delete pActNum;
- delete pExamplesVS;
- delete pSaveNum;
- aNumSettingsArr.DeleteAndDestroy(0, aNumSettingsArr.Count());
-}
-
-/*-----------------07.02.97 12.13-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* SvxSingleNumPickTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxSingleNumPickTabPage(pParent, rAttrSet);
-}
-
-/*-----------------07.02.97 12.09-------------------
-
---------------------------------------------------*/
-
-
-BOOL SvxSingleNumPickTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if(bPreset || bModified && pSaveNum)
- {
- *pSaveNum = *pActNum;
- rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
- rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
- }
-
- return bModified;
-}
-
-/*-----------------08.02.97 16.27-------------------
-
---------------------------------------------------*/
-
-void SvxSingleNumPickTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem;
- bPreset = FALSE;
- BOOL bIsPreset = FALSE;
- const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
- if(pExampleSet)
- {
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, FALSE, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, FALSE, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
- }
- if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, FALSE, &pItem))
- {
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
- }
- if(*pSaveNum != *pActNum)
- {
- *pActNum = *pSaveNum;
- pExamplesVS->SetNoSelection();
- }
- // ersten Eintrag vorselektieren
- if(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))
- {
- pExamplesVS->SelectItem(1);
- NumSelectHdl_Impl(pExamplesVS);
- bPreset = TRUE;
- }
- bPreset |= bIsPreset;
-
- bModified = FALSE;
-}
-
-/*-----------------08.02.97 11.28-------------------
-
---------------------------------------------------*/
-
-int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
-{
- if(_pSet)
- FillItemSet(*_pSet);
- return TRUE;
-}
-
-/*-----------------07.02.97 12.09-------------------
-
---------------------------------------------------*/
-
-
-void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
-
- if( eState != SFX_ITEM_SET )
- {
- pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
- eState = SFX_ITEM_SET;
- }
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
-
- if(!pActNum)
- pActNum = new SvxNumRule(*pSaveNum);
- else if(*pSaveNum != *pActNum)
- *pActNum = *pSaveNum;
-}
-/*-----------------08.02.97 11.40-------------------
-
---------------------------------------------------*/
-
-IMPL_LINK(SvxSingleNumPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
-{
- if(pActNum)
- {
- bPreset = FALSE;
- bModified = TRUE;
- USHORT nIdx = pExamplesVS->GetSelectItemId() - 1;
- DBG_ASSERT(aNumSettingsArr.Count() > nIdx, "wrong index");
- if(aNumSettingsArr.Count() <= nIdx)
- return 0;
- SvxNumSettings_ImplPtr _pSet = aNumSettingsArr.GetObject(nIdx);
- sal_Int16 eNewType = _pSet->nNumberType;
- const sal_Unicode cLocalPrefix = _pSet->sPrefix.getLength() ? _pSet->sPrefix.getStr()[0] : 0;
- const sal_Unicode cLocalSuffix = _pSet->sSuffix.getLength() ? _pSet->sSuffix.getStr()[0] : 0;
-
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aFmt(pActNum->GetLevel(i));
- aFmt.SetNumberingType(eNewType);
- String aEmptyStr;
- if(cLocalPrefix == ' ')
- aFmt.SetPrefix( aEmptyStr );
- else
- aFmt.SetPrefix(_pSet->sPrefix);
- if(cLocalSuffix == ' ')
- aFmt.SetSuffix( aEmptyStr );
- else
- aFmt.SetSuffix(_pSet->sSuffix);
- aFmt.SetCharFmtName(sNumCharFmtName);
- // #62069# // #92724#
- aFmt.SetBulletRelSize(100);
- pActNum->SetLevel(i, aFmt);
- }
- nMask <<= 1 ;
- }
- }
- return 0;
-}
-
-/*-----------------06.06.97 11.15-------------------
-
---------------------------------------------------*/
-IMPL_LINK(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG)
-{
- NumSelectHdl_Impl(pExamplesVS);
- OKButton& rOk = GetTabDialog()->GetOKButton();
- rOk.GetClickHdl().Call(&rOk);
- return 0;
-}
-
-/**************************************************************************/
-/* */
-/* */
-/**************************************************************************/
-
-
-SvxBulletPickTabPage::SvxBulletPickTabPage(Window* pParent,
- const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_PICK_BULLET ), rSet ),
- aValuesFL( this, SVX_RES(FL_VALUES) ),
- pExamplesVS( new SvxNumValueSet(this, SVX_RES(VS_VALUES), NUM_PAGETYPE_BULLET )),
- pActNum(0),
- pSaveNum(0),
- nActNumLvl( USHRT_MAX ),
- bModified(FALSE),
- bPreset(FALSE),
- nNumItemId(SID_ATTR_NUMBERING_RULE)
-{
- FreeResource();
- SetExchangeSupport();
- pExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
- pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
- pExamplesVS->SetHelpId(HID_VALUESET_BULLET );
-
-}
-/*-----------------07.02.97 12.10-------------------
-
---------------------------------------------------*/
-
-
- SvxBulletPickTabPage::~SvxBulletPickTabPage()
-{
- delete pActNum;
- delete pExamplesVS;
- delete pSaveNum;
-}
-/*-----------------07.02.97 12.10-------------------
-
---------------------------------------------------*/
-
-
-SfxTabPage* SvxBulletPickTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxBulletPickTabPage(pParent, rAttrSet);
-}
-
-/*-----------------07.02.97 12.10-------------------
-
---------------------------------------------------*/
-
-
-BOOL SvxBulletPickTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if(bPreset || bModified && pActNum)
- {
- *pSaveNum = *pActNum;
- rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
- rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
- }
- return bModified;
-}
-/*-----------------08.02.97 16.28-------------------
-
---------------------------------------------------*/
-
-void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem;
- bPreset = FALSE;
- BOOL bIsPreset = FALSE;
- const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
- if(pExampleSet)
- {
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, FALSE, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, FALSE, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
- }
- if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, FALSE, &pItem))
- {
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
- }
- if(*pSaveNum != *pActNum)
- {
- *pActNum = *pSaveNum;
- pExamplesVS->SetNoSelection();
- }
- // ersten Eintrag vorselektieren
- if(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))
- {
- pExamplesVS->SelectItem(1);
- NumSelectHdl_Impl(pExamplesVS);
- bPreset = TRUE;
- }
- bPreset |= bIsPreset;
- bModified = FALSE;
-}
-/*-----------------08.02.97 11.28-------------------
-
---------------------------------------------------*/
-
-int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet)
-{
- if(_pSet)
- FillItemSet(*_pSet);
- return TRUE;
-}
-
-/*-----------------07.02.97 12.11-------------------
-
---------------------------------------------------*/
-
-
-void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
-
- if( eState != SFX_ITEM_SET )
- {
- pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
- eState = SFX_ITEM_SET;
- }
-
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
-
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
-
- if(!pActNum)
- pActNum = new SvxNumRule(*pSaveNum);
- else if(*pSaveNum != *pActNum)
- *pActNum = *pSaveNum;
-}
-/*-----------------08.02.97 11.58-------------------
-
---------------------------------------------------*/
-
-IMPL_LINK(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
-{
- if(pActNum)
- {
- bPreset = FALSE;
- bModified = TRUE;
- sal_Unicode cChar = aBulletTypes[pExamplesVS->GetSelectItemId() - 1];
- Font& rActBulletFont = lcl_GetDefaultBulletFont();
-
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aFmt(pActNum->GetLevel(i));
- aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
- aFmt.SetBulletFont(&rActBulletFont);
- aFmt.SetBulletChar(cChar );
- aFmt.SetCharFmtName(sBulletCharFmtName);
- // #62069# // #92724#
- aFmt.SetBulletRelSize(45);
- pActNum->SetLevel(i, aFmt);
- }
- nMask <<= 1;
- }
- }
-
- return 0;
-}
-
-/*-----------------06.06.97 11.16-------------------
-
---------------------------------------------------*/
-IMPL_LINK(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG)
-{
- NumSelectHdl_Impl(pExamplesVS);
- OKButton& rOk = GetTabDialog()->GetOKButton();
- rOk.GetClickHdl().Call(&rOk);
- return 0;
-}
-
-//Add CHINA001
-void SvxBulletPickTabPage::PageCreated(SfxAllItemSet aSet)
-{
-
- SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
-
- if (pBulletCharFmt)
- SetCharFmtName( pBulletCharFmt->GetValue());
-
-
-}
-//end of add CHINA001
-/**************************************************************************/
-/* */
-/* */
-/**************************************************************************/
-
-
-SvxNumPickTabPage::SvxNumPickTabPage(Window* pParent,
- const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_PICK_NUM ), rSet ),
- aValuesFL( this, SVX_RES(FL_VALUES) ),
- pExamplesVS( new SvxNumValueSet(this, SVX_RES(VS_VALUES), NUM_PAGETYPE_NUM )),
- pActNum(0),
- pSaveNum(0),
- nActNumLvl( USHRT_MAX ),
- nNumItemId(SID_ATTR_NUMBERING_RULE),
- bModified(FALSE),
- bPreset(FALSE)
-{
-
- FreeResource();
-
- SetExchangeSupport();
-
- pExamplesVS->SetSelectHdl(LINK(this, SvxNumPickTabPage, NumSelectHdl_Impl));
- pExamplesVS->SetDoubleClickHdl(LINK(this, SvxNumPickTabPage, DoubleClickHdl_Impl));
- pExamplesVS->SetHelpId(HID_VALUESET_NUM );
-
- Reference<XDefaultNumberingProvider> xDefNum = lcl_GetNumberingProvider();
- if(xDefNum.is())
- {
- Sequence<Reference<XIndexAccess> > aOutlineAccess;
- LanguageType eLang = Application::GetSettings().GetLanguage();
- Locale aLocale = SvxCreateLocale(eLang);
- try
- {
- aOutlineAccess = xDefNum->getDefaultOutlineNumberings( aLocale );
-
- for(sal_Int32 nItem = 0;
- nItem < aOutlineAccess.getLength() && nItem < NUM_VALUSET_COUNT;
- nItem++ )
- {
- SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[ nItem ];
-
- Reference<XIndexAccess> xLevel = aOutlineAccess.getConstArray()[nItem];
- for(sal_Int32 nLevel = 0; nLevel < xLevel->getCount() && nLevel < 5; nLevel++)
- {
- Any aValueAny = xLevel->getByIndex(nLevel);
- Sequence<PropertyValue> aLevelProps;
- aValueAny >>= aLevelProps;
- SvxNumSettings_ImplPtr pNew = lcl_CreateNumSettingsPtr(aLevelProps);
- rItemArr.Insert( pNew, rItemArr.Count() );
- }
- }
- }
- catch(Exception&)
- {
- }
- Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY);
- pExamplesVS->SetOutlineNumberingSettings(aOutlineAccess, xFormat, aLocale);
- }
-}
-/*-----------------07.02.97 12.12-------------------
-
---------------------------------------------------*/
-
-
- SvxNumPickTabPage::~SvxNumPickTabPage()
-{
- delete pActNum;
- delete pExamplesVS;
- delete pSaveNum;
-}
-
-/*-----------------07.02.97 12.12-------------------
-
---------------------------------------------------*/
-
-
-SfxTabPage* SvxNumPickTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxNumPickTabPage(pParent, rAttrSet);
-}
-
-/*-----------------07.02.97 12.12-------------------
-
---------------------------------------------------*/
-
-
-BOOL SvxNumPickTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if(bPreset || bModified && pActNum)
- {
- *pSaveNum = *pActNum;
- rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
- rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
- }
- return bModified;
-}
-/*-----------------08.02.97 16.28-------------------
-
---------------------------------------------------*/
-
-void SvxNumPickTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem;
- bPreset = FALSE;
- BOOL bIsPreset = FALSE;
- const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
- if(pExampleSet)
- {
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, FALSE, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, FALSE, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
- }
- if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, FALSE, &pItem))
- {
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
- }
- if(*pSaveNum != *pActNum)
- {
- *pActNum = *pSaveNum;
- pExamplesVS->SetNoSelection();
- }
- // ersten Eintrag vorselektieren
- if(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))
- {
- pExamplesVS->SelectItem(1);
- NumSelectHdl_Impl(pExamplesVS);
- bPreset = TRUE;
- }
- bPreset |= bIsPreset;
- bModified = FALSE;
-}
-
-/* -----------------08.02.97 11.29-------------------
-
---------------------------------------------------*/
-
-int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet)
-{
- if(_pSet)
- FillItemSet(*_pSet);
- return TRUE;
-}
-
-/*-----------------07.02.97 12.12-------------------
-
---------------------------------------------------*/
-
-void SvxNumPickTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
-
- if( eState != SFX_ITEM_SET )
- {
- pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
- eState = SFX_ITEM_SET;
- }
-
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
-
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
- if(!pActNum)
- pActNum = new SvxNumRule(*pSaveNum);
- else if(*pSaveNum != *pActNum)
- *pActNum = *pSaveNum;
-
-}
-
-/*-----------------08.02.97 11.58-------------------
- Hier werden alle Ebenen veraendert,
---------------------------------------------------*/
-
-IMPL_LINK(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
-{
- if(pActNum)
- {
- bPreset = FALSE;
- bModified = TRUE;
-
- const FontList* pList = 0;
-
- SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[pExamplesVS->GetSelectItemId() - 1];
-
- Font& rActBulletFont = lcl_GetDefaultBulletFont();
- SvxNumSettings_ImplPtr pLevelSettings = 0;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(rItemArr.Count() > i)
- pLevelSettings = rItemArr[i];
- if(!pLevelSettings)
- break;
- SvxNumberFormat aFmt(pActNum->GetLevel(i));
- aFmt.SetNumberingType( pLevelSettings->nNumberType );
- USHORT nUpperLevelOrChar = (USHORT)pLevelSettings->nParentNumbering;
- if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
- {
- if( pLevelSettings->sBulletFont.getLength() &&
- pLevelSettings->sBulletFont.compareTo(
- rActBulletFont.GetName()))
- {
- //search for the font
- if(!pList)
- {
- SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
- const SvxFontListItem* pFontListItem =
- (const SvxFontListItem* )pCurDocShell
- ->GetItem( SID_ATTR_CHAR_FONTLIST );
- pList = pFontListItem ? pFontListItem->GetFontList() : 0;
- }
- if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) )
- {
- FontInfo aInfo = pList->Get(
- pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE);
- Font aFont(aInfo);
- aFmt.SetBulletFont(&aFont);
- }
- else
- {
- //if it cannot be found then create a new one
- Font aCreateFont( pLevelSettings->sBulletFont,
- String(), Size( 0, 14 ) );
- aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW );
- aCreateFont.SetFamily( FAMILY_DONTKNOW );
- aCreateFont.SetPitch( PITCH_DONTKNOW );
- aCreateFont.SetWeight( WEIGHT_DONTKNOW );
- aCreateFont.SetTransparent( TRUE );
- aFmt.SetBulletFont( &aCreateFont );
- }
- }
- else
- aFmt.SetBulletFont( &rActBulletFont );
-
- aFmt.SetBulletChar( pLevelSettings->sBulletChar.getLength()
- ? pLevelSettings->sBulletChar.getStr()[0]
- : 0 );
- aFmt.SetCharFmtName( sBulletCharFmtName );
- // #62069# // #92724#
- aFmt.SetBulletRelSize(45);
- }
- else
- {
- aFmt.SetIncludeUpperLevels(sal::static_int_cast< BYTE >(0 != nUpperLevelOrChar ? pActNum->GetLevelCount() : 0));
- aFmt.SetCharFmtName(sNumCharFmtName);
- // #62069# // #92724#
- aFmt.SetBulletRelSize(100);
- }
- aFmt.SetPrefix(pLevelSettings->sPrefix);
- aFmt.SetSuffix(pLevelSettings->sSuffix);
- pActNum->SetLevel(i, aFmt);
- }
- }
- return 0;
-}
-
-/*-----------------06.06.97 11.16-------------------
-
---------------------------------------------------*/
-IMPL_LINK(SvxNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG)
-{
- NumSelectHdl_Impl(pExamplesVS);
- OKButton& rOk = GetTabDialog()->GetOKButton();
- rOk.GetClickHdl().Call(&rOk);
- return 0;
-}
-
-//add CHINA001 begin
-void SvxNumPickTabPage::PageCreated(SfxAllItemSet aSet)
-{
- SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT,sal_False);
- SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
-
-
- if (pNumCharFmt &&pBulletCharFmt)
- SetCharFmtNames( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue());
-}
-//end of CHINA001
-/*-----------------07.02.97 15.59-------------------
-
---------------------------------------------------*/
-void lcl_PaintLevel(OutputDevice* pVDev, sal_Int16 nNumberingType,
- const OUString& rBulletChar, const OUString& rText, const OUString& rFontName,
- Point& rLeft, Font& rRuleFont, const Font& rTextFont)
-{
-
- if(NumberingType::CHAR_SPECIAL == nNumberingType )
- {
- rRuleFont.SetStyleName(rFontName);
- pVDev->SetFont(rRuleFont);
- pVDev->DrawText(rLeft, rBulletChar);
- rLeft.X() += pVDev->GetTextWidth(rBulletChar);
- }
- else
- {
- pVDev->SetFont(rTextFont);
- pVDev->DrawText(rLeft, rText);
- rLeft.X() += pVDev->GetTextWidth(rText);
- }
-}
-
-/**************************************************************************/
-/* */
-/* */
-/**************************************************************************/
-
-SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent,
- const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_PICK_BMP ), rSet ),
- aValuesFL( this, SVX_RES(FL_VALUES) ),
- pExamplesVS( new SvxBmpNumValueSet(this, SVX_RES(VS_VALUES)/*, aGrfNames*/ )),
- aErrorText( this, SVX_RES(FT_ERROR)),
- aLinkedCB( this, SVX_RES(CB_LINKED)),
- pActNum(0),
- pSaveNum(0),
- nActNumLvl( USHRT_MAX ),
- nNumItemId(SID_ATTR_NUMBERING_RULE),
- bModified(FALSE),
- bPreset(FALSE)
-{
- FreeResource();
- SetExchangeSupport();
- eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
- pExamplesVS->SetSelectHdl(LINK(this, SvxBitmapPickTabPage, NumSelectHdl_Impl));
- pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBitmapPickTabPage, DoubleClickHdl_Impl));
- aLinkedCB.SetClickHdl(LINK(this, SvxBitmapPickTabPage, LinkBmpHdl_Impl));
-
- // Grafiknamen ermitteln
-
- GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
- pExamplesVS->SetHelpId(HID_VALUESET_NUMBMP );
- for(USHORT i = 0; i < aGrfNames.Count(); i++)
- {
- pExamplesVS->InsertItem( i + 1, i);
- String* pGrfNm = (String*) aGrfNames.GetObject(i);
- INetURLObject aObj(*pGrfNm);
- if(aObj.GetProtocol() == INET_PROT_FILE)
- *pGrfNm = aObj.PathToFileName();
- pExamplesVS->SetItemText( i + 1, *pGrfNm );
- }
- if(!aGrfNames.Count())
- {
- aErrorText.Show();
- }
- else
- {
- pExamplesVS->Show();
- pExamplesVS->Format();
- }
-
-}
-
-/*-----------------12.02.97 07.46-------------------
-
---------------------------------------------------*/
-
- SvxBitmapPickTabPage::~SvxBitmapPickTabPage()
-{
- String* pStr = (String*)aGrfNames.First();
- while( pStr )
- {
- delete pStr;
- pStr = (String*)aGrfNames.Next();
- }
- delete pExamplesVS;
- delete pActNum;
- delete pSaveNum;
-}
-
-/*-----------------12.02.97 07.46-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* SvxBitmapPickTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxBitmapPickTabPage(pParent, rAttrSet);
-}
-
-/*-----------------12.02.97 07.46-------------------
-
---------------------------------------------------*/
-
-void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem;
- bPreset = FALSE;
- BOOL bIsPreset = FALSE;
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
- const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
- if(pExampleSet)
- {
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, FALSE, &pItem))
- bIsPreset = ((const SfxBoolItem*)pItem)->GetValue();
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, FALSE, &pItem))
- nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
- }
- if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, FALSE, &pItem))
- {
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
- }
- if(*pSaveNum != *pActNum)
- {
- *pActNum = *pSaveNum;
- pExamplesVS->SetNoSelection();
- }
- // ersten Eintrag vorselektieren
- if(aGrfNames.Count() &&
- (pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset)))
- {
- pExamplesVS->SelectItem(1);
- NumSelectHdl_Impl(pExamplesVS);
- bPreset = TRUE;
- }
- bPreset |= bIsPreset;
- bModified = FALSE;
-}
-/*-----------------12.02.97 07.46-------------------
-
---------------------------------------------------*/
-
-int SvxBitmapPickTabPage::DeactivatePage(SfxItemSet *_pSet)
-{
- if(_pSet)
- FillItemSet(*_pSet);
- return TRUE;
-}
-/*-----------------12.02.97 07.46-------------------
-
---------------------------------------------------*/
-
-BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if ( !aGrfNames.Count() )
- {
-// das ist im SfxItemSet leider nicht zulaessig #52134#
-// rSet.DisableItem(SID_ATTR_NUMBERING_RULE);
- return FALSE;
- }
- if(bPreset || bModified && pActNum)
- {
- *pSaveNum = *pActNum;
- rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
- rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
- }
-
- return bModified;
-}
-/*-----------------12.02.97 07.46-------------------
-
---------------------------------------------------*/
-
-void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
-
- if( eState != SFX_ITEM_SET )
- {
- pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
- eState = SFX_ITEM_SET;
- }
-
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
-
- if(!pActNum)
- pActNum = new SvxNumRule(*pSaveNum);
- else if(*pSaveNum != *pActNum)
- *pActNum = *pSaveNum;
- if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP))
- {
- aLinkedCB.Check(FALSE);
- aLinkedCB.Enable(FALSE);
- }
- else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP))
- {
- aLinkedCB.Check(TRUE);
- aLinkedCB.Enable(FALSE);
- }
-}
-
-/*-----------------12.02.97 07.53-------------------
-
---------------------------------------------------*/
-
-IMPL_LINK(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG)
-{
- if(pActNum)
- {
- bPreset = FALSE;
- bModified = TRUE;
- USHORT nIdx = pExamplesVS->GetSelectItemId() - 1;
-
- String* pGrfName = 0;
- if(aGrfNames.Count() > nIdx)
- pGrfName = (String*)aGrfNames.GetObject(nIdx);
-
- USHORT nMask = 1;
- String aEmptyStr;
- USHORT nSetNumberingType = SVX_NUM_BITMAP;
- if(aLinkedCB.IsChecked())
- nSetNumberingType |= LINK_TOKEN;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aFmt(pActNum->GetLevel(i));
- aFmt.SetNumberingType(nSetNumberingType);
- aFmt.SetPrefix( aEmptyStr );
- aFmt.SetSuffix( aEmptyStr );
- aFmt.SetCharFmtName( sNumCharFmtName );
-
- Graphic aGraphic;
- if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, nIdx, &aGraphic))
- {
- Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
- sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit);
- SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
- aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
- }
- else if(pGrfName)
- aFmt.SetGraphic( *pGrfName );
- pActNum->SetLevel(i, aFmt);
- }
- nMask <<= 1 ;
- }
- }
-
- return 0;
-}
-
-/*-----------------06.06.97 11.17-------------------
-
---------------------------------------------------*/
-IMPL_LINK(SvxBitmapPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG)
-{
- NumSelectHdl_Impl(pExamplesVS);
- OKButton& rOk = GetTabDialog()->GetOKButton();
- rOk.GetClickHdl().Call(&rOk);
- return 0;
-}
-/* -----------------03.11.99 13:46-------------------
-
- --------------------------------------------------*/
-IMPL_LINK(SvxBitmapPickTabPage, LinkBmpHdl_Impl, CheckBox*, EMPTYARG )
-{
- if(!pExamplesVS->IsNoSelection())
- {
- NumSelectHdl_Impl(pExamplesVS);
- }
- return 0;
-}
-/*-----------------13.02.97 09.40-------------------
-
---------------------------------------------------*/
-
-//CHINA001 SvxBmpNumValueSet::SvxBmpNumValueSet( Window* pParent, const ResId& rResId/*, const List& rStrNames*/ ) :
-//CHINA001
-//CHINA001 SvxNumValueSet( pParent, rResId, NUM_PAGETYPE_BMP ),
-//CHINA001 // rStrList ( rStrNames ),
-//CHINA001 bGrfNotFound( FALSE )
-//CHINA001
-//CHINA001 {
-//CHINA001 GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
-//CHINA001 SetStyle( GetStyle() | WB_VSCROLL );
-//CHINA001 SetLineCount( 3 );
-//CHINA001 aFormatTimer.SetTimeout(300);
-//CHINA001 aFormatTimer.SetTimeoutHdl(LINK(this, SvxBmpNumValueSet, FormatHdl_Impl));
-//CHINA001 }
-//CHINA001
-//CHINA001 /*-----------------13.02.97 09.41-------------------
-//CHINA001
-//CHINA001 --------------------------------------------------*/
-//CHINA001
-//CHINA001 SvxBmpNumValueSet::~SvxBmpNumValueSet()
-//CHINA001 {
-//CHINA001 GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
-//CHINA001 aFormatTimer.Stop();
-//CHINA001 }
-//CHINA001 /*-----------------13.02.97 09.41-------------------
-//CHINA001
-//CHINA001 --------------------------------------------------*/
-//CHINA001
-//CHINA001 void SvxBmpNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
-//CHINA001 {
-//CHINA001 SvxNumValueSet::UserDraw(rUDEvt);
-//CHINA001
-//CHINA001 Rectangle aRect = rUDEvt.GetRect();
-//CHINA001 OutputDevice* pDev = rUDEvt.GetDevice();
-//CHINA001 USHORT nItemId = rUDEvt.GetItemId();
-//CHINA001 Point aBLPos = aRect.TopLeft();
-//CHINA001
-//CHINA001 int nRectHeight = aRect.GetHeight();
-//CHINA001 Size aSize(nRectHeight/8, nRectHeight/8);
-//CHINA001
-//CHINA001 Graphic aGraphic;
-//CHINA001 if(!GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, nItemId - 1,
-//CHINA001 &aGraphic, NULL))
-//CHINA001 {
-//CHINA001 bGrfNotFound = TRUE;
-//CHINA001 }
-//CHINA001 else
-//CHINA001 {
-//CHINA001 Point aPos(aBLPos.X() + 5, 0);
-//CHINA001 for( USHORT i = 0; i < 3; i++ )
-//CHINA001 {
-//CHINA001 USHORT nY = 11 + i * 33;
-//CHINA001 aPos.Y() = aBLPos.Y() + nRectHeight * nY / 100;
-//CHINA001 aGraphic.Draw( pDev, aPos, aSize );
-//CHINA001 }
-//CHINA001 }
-//CHINA001 }
-//CHINA001
-//CHINA001 /*-----------------14.02.97 07.34-------------------
-//CHINA001
-//CHINA001 --------------------------------------------------*/
-//CHINA001
-//CHINA001 IMPL_LINK(SvxBmpNumValueSet, FormatHdl_Impl, Timer*, EMPTYARG)
-//CHINA001 {
-//CHINA001 // nur, wenn eine Grafik nicht da war, muss formatiert werden
-//CHINA001 if(bGrfNotFound)
-//CHINA001 {
-//CHINA001 bGrfNotFound = FALSE;
-//CHINA001 Format();
-//CHINA001 }
-//CHINA001 Invalidate();
-//CHINA001 return 0;
-//CHINA001 }
-/*-----------------01.12.97 16:15-------------------
- Tabpage Numerierungsoptionen
---------------------------------------------------*/
-#define NUM_NO_GRAPHIC 1000
-SvxNumOptionsTabPage::SvxNumOptionsTabPage(Window* pParent,
- const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_NUM_OPTIONS ), rSet ),
-
- aFormatFL( this, SVX_RES(FL_FORMAT )),
- aLevelFT( this, SVX_RES(FT_LEVEL )),
- aLevelLB( this, SVX_RES(LB_LEVEL )),
- aFmtFT( this, SVX_RES(FT_FMT )),
- aFmtLB( this, SVX_RES(LB_FMT )),
- aPrefixFT( this, SVX_RES(FT_PREFIX )),
- aPrefixED( this, SVX_RES(ED_PREFIX )),
- aSuffixFT( this, SVX_RES(FT_SUFFIX )),
- aSuffixED( this, SVX_RES(ED_SUFFIX )),
- aCharFmtFT( this, SVX_RES(FT_CHARFMT )),
- aCharFmtLB( this, SVX_RES(LB_CHARFMT )),
- aBulColorFT( this, SVX_RES(FT_BUL_COLOR)),
- aBulColLB( this, SVX_RES(LB_BUL_COLOR)),
- aBulRelSizeFT( this, SVX_RES(FT_BUL_REL_SIZE)),
- aBulRelSizeMF( this, SVX_RES(MF_BUL_REL_SIZE)),
- aAllLevelFT( this, SVX_RES(FT_ALL_LEVEL)),
- aAllLevelNF( this, SVX_RES(NF_ALL_LEVEL)),
- aStartFT( this, SVX_RES(FT_START )),
- aStartED( this, SVX_RES(ED_START )),
- aBulletPB( this, SVX_RES(PB_BULLET )),
- aAlignFT( this, SVX_RES(FT_ALIGN )),
- aAlignLB( this, SVX_RES(LB_ALIGN )),
- aBitmapFT( this, SVX_RES(FT_BITMAP )),
- aBitmapMB( this, SVX_RES(MB_BITMAP )),
- aSizeFT( this, SVX_RES(FT_SIZE )),
- aWidthMF( this, SVX_RES(MF_WIDTH )),
- aMultFT( this, SVX_RES(FT_MULT )),
- aHeightMF( this, SVX_RES(MF_HEIGHT )),
- aRatioCB( this, SVX_RES(CB_RATIO )),
- aOrientFT( this, SVX_RES(FT_ORIENT )),
- aOrientLB( this, SVX_RES(LB_ORIENT )),
- aSameLevelFL( this, SVX_RES(FL_SAME_LEVEL)),
- aSameLevelCB( this, SVX_RES(CB_SAME_LEVEL)),
- pPreviewWIN( new SvxNumberingPreview(this, SVX_RES(WIN_PREVIEW ))),
- pActNum(0),
- pSaveNum(0),
- bLastWidthModified(FALSE),
- bModified(FALSE),
- bPreset(FALSE),
- bAutomaticCharStyles(TRUE),
- bHTMLMode(FALSE),
- bMenuButtonInitialized(FALSE),
- sBullet(SVX_RES(STR_BULLET)),
- nBullet(0xff),
- nActNumLvl(USHRT_MAX),
- nNumItemId(SID_ATTR_NUMBERING_RULE)
-{
- sStartWith = aStartFT.GetText();
- pPreviewWIN->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
- SetExchangeSupport();
- aActBulletFont = lcl_GetDefaultBulletFont();
-
- aBulletPB.SetClickHdl(LINK(this, SvxNumOptionsTabPage, BulletHdl_Impl));
- aFmtLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl));
- aBitmapMB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl));
- aLevelLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl));
- aCharFmtLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl));
- aWidthMF.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
- aHeightMF.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
- aRatioCB.SetClickHdl(LINK(this, SvxNumOptionsTabPage, RatioHdl_Impl));
- aStartED.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- aPrefixED.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- aSuffixED.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- aAllLevelNF.SetModifyHdl(LINK(this,SvxNumOptionsTabPage, AllLevelHdl_Impl));
- aOrientLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, OrientHdl_Impl));
- aSameLevelCB.SetClickHdl(LINK(this, SvxNumOptionsTabPage, SameLevelHdl_Impl));
- aBulRelSizeMF.SetModifyHdl(LINK(this,SvxNumOptionsTabPage, BulRelSizeHdl_Impl));
- aBulColLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, BulColorHdl_Impl));
- aInvalidateTimer.SetTimeoutHdl(LINK(this, SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl));
- aInvalidateTimer.SetTimeout(50);
-
- aBitmapMB.GetPopupMenu()->SetHighlightHdl(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl));
- PopupMenu* pPopup = new PopupMenu;
- aBitmapMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup );
-
- pPopup->InsertItem( NUM_NO_GRAPHIC, String(SVX_RES(ST_POPUP_EMPTY_ENTRY)) );
- pPopup->EnableItem( NUM_NO_GRAPHIC, FALSE );
-
- eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
-
- FreeResource();
-
- //get advanced numbering types from the component
- Reference<XDefaultNumberingProvider> xDefNum = lcl_GetNumberingProvider();
- Reference<XNumberingTypeInfo> xInfo(xDefNum, UNO_QUERY);
-
- // Extended numbering schemes present in the resource but not offered by
- // the i18n framework per configuration must be removed from the listbox.
- // Watch out for the ugly 0x88/*SVX_NUM_BITMAP|0x80*/ to not remove that.
- const USHORT nDontRemove = 0xffff;
- ::std::vector< USHORT> aRemove( aFmtLB.GetEntryCount(), nDontRemove);
- for (size_t i=0; i<aRemove.size(); ++i)
- {
- USHORT nEntryData = (USHORT)(ULONG)aFmtLB.GetEntryData(
- sal::static_int_cast< USHORT >(i));
- if (nEntryData > NumberingType::CHARS_LOWER_LETTER_N &&
- nEntryData != (SVX_NUM_BITMAP | 0x80))
- aRemove[i] = nEntryData;
- }
- if(xInfo.is())
- {
- Sequence<sal_Int16> aTypes = xInfo->getSupportedNumberingTypes( );
- const sal_Int16* pTypes = aTypes.getConstArray();
- for(sal_Int32 nType = 0; nType < aTypes.getLength(); nType++)
- {
- sal_Int16 nCurrent = pTypes[nType];
- if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
- {
- sal_Bool bInsert = sal_True;
- for(USHORT nEntry = 0; nEntry < aFmtLB.GetEntryCount(); nEntry++)
- {
- USHORT nEntryData = (USHORT)(ULONG)aFmtLB.GetEntryData(nEntry);
- if(nEntryData == (USHORT) nCurrent)
- {
- bInsert = sal_False;
- aRemove[nEntry] = nDontRemove;
- break;
- }
- }
- if(bInsert)
- {
- OUString aIdent = xInfo->getNumberingIdentifier( nCurrent );
- USHORT nPos = aFmtLB.InsertEntry(aIdent);
- aFmtLB.SetEntryData(nPos,(void*)(ULONG)nCurrent);
- }
- }
- }
- }
- for (size_t i=0; i<aRemove.size(); ++i)
- {
- if (aRemove[i] != nDontRemove)
- {
- USHORT nPos = aFmtLB.GetEntryPos( (void*)(ULONG)aRemove[i]);
- aFmtLB.RemoveEntry( nPos);
- }
- }
-}
-
-/*-----------------01.12.97 16:30-------------------
-
---------------------------------------------------*/
-SvxNumOptionsTabPage::~SvxNumOptionsTabPage()
-{
- delete aBitmapMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY );
- String* pStr = (String*)aGrfNames.First();
- while( pStr )
- {
- delete pStr;
- pStr = (String*)aGrfNames.Next();
- }
- delete pActNum;
- delete pPreviewWIN;
- delete pSaveNum;
-}
-
-/*-----------------03.12.97 07:52-------------------
-
---------------------------------------------------*/
-void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
-{
- if(eMetric == FUNIT_MM)
- {
- aWidthMF .SetDecimalDigits(1);
- aHeightMF .SetDecimalDigits(1);
- }
- aWidthMF .SetUnit( eMetric );
- aHeightMF .SetUnit( eMetric );
-}
-
-/*-----------------01.12.97 16:30-------------------
-
---------------------------------------------------*/
-SfxTabPage* SvxNumOptionsTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxNumOptionsTabPage(pParent, rAttrSet);
-};
-/*-----------------01.12.97 16:29-------------------
-
---------------------------------------------------*/
-void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem;
- const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
- UINT16 nTmpNumLvl = USHRT_MAX;
- if(pExampleSet)
- {
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, FALSE, &pItem))
- bPreset = ((const SfxBoolItem*)pItem)->GetValue();
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, FALSE, &pItem))
- nTmpNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
- }
- if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, FALSE, &pItem))
- {
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
- }
- //
- bModified = (!pActNum->Get( 0 ) || bPreset);
- if(*pActNum != *pSaveNum ||
- nActNumLvl != nTmpNumLvl)
- {
- nActNumLvl = nTmpNumLvl;
- USHORT nMask = 1;
- aLevelLB.SetUpdateMode(FALSE);
- aLevelLB.SetNoSelection();
- aLevelLB.SelectEntryPos( pActNum->GetLevelCount(), nActNumLvl == USHRT_MAX);
- if(nActNumLvl != USHRT_MAX)
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- aLevelLB.SelectEntryPos( i, TRUE);
- nMask <<= 1 ;
- }
- aLevelLB.SetUpdateMode(TRUE);
- *pActNum = *pSaveNum;
- InitControls();
- }
-
-}
-/*-----------------01.12.97 16:29-------------------
-
---------------------------------------------------*/
-int SvxNumOptionsTabPage::DeactivatePage(SfxItemSet * _pSet)
-{
- if(_pSet)
- FillItemSet(*_pSet);
- return TRUE;
-}
-/*-----------------01.12.97 16:29-------------------
-
---------------------------------------------------*/
-BOOL SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet )
-{
- rSet.Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl));
- if(bModified && pActNum)
- {
- *pSaveNum = *pActNum;
- rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
- rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, FALSE));
- }
- return bModified;
-};
-/*-----------------01.12.97 16:29-------------------
-
---------------------------------------------------*/
-void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
-
- if( eState != SFX_ITEM_SET )
- {
- pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
- eState = SFX_ITEM_SET;
- }
-
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
-
- // Ebenen einfuegen
- if(!aLevelLB.GetEntryCount())
- {
- for(USHORT i = 1; i <= pSaveNum->GetLevelCount(); i++)
- aLevelLB.InsertEntry( UniString::CreateFromInt32(i));
- if(pSaveNum->GetLevelCount() > 1)
- {
- String sEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "1 - " ) ) );
- sEntry += UniString::CreateFromInt32( pSaveNum->GetLevelCount() );
- aLevelLB.InsertEntry(sEntry);
- aLevelLB.SelectEntry(sEntry);
- }
- else
- aLevelLB.SelectEntryPos(0);
- }
- else
- aLevelLB.SelectEntryPos(aLevelLB.GetEntryCount() - 1);
-
-// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel();
- USHORT nMask = 1;
- aLevelLB.SetUpdateMode(FALSE);
- aLevelLB.SetNoSelection();
- if(nActNumLvl == USHRT_MAX)
- {
- aLevelLB.SelectEntryPos( pSaveNum->GetLevelCount(), TRUE);
- }
- else
- for(USHORT i = 0; i < pSaveNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- aLevelLB.SelectEntryPos( i, TRUE);
- nMask <<= 1 ;
- }
- aLevelLB.SetUpdateMode(TRUE);
-
- if(!pActNum)
- pActNum = new SvxNumRule(*pSaveNum);
- else if(*pSaveNum != *pActNum)
- *pActNum = *pSaveNum;
- pPreviewWIN->SetNumRule(pActNum);
- aSameLevelCB.Check(pActNum->IsContinuousNumbering());
-
- //ColorListBox bei Bedarf fuellen
- if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) )
- {
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorTable* pColorTable = NULL;
- FASTBOOL bKillTable = FALSE;
- if ( pDocSh )
- {
- pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
- }
-
- if ( !pColorTable )
- {
- pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = TRUE;
- }
-
- aBulColLB.InsertEntry( Color( COL_AUTO ), SVX_RESSTR( RID_SVXSTR_AUTOMATIC ));
-
- for ( long i = 0; i < pColorTable->Count(); i++ )
- {
- XColorEntry* pEntry = pColorTable->GetColor(i);
- aBulColLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
-
- if ( bKillTable )
- delete pColorTable;
- }
-
- SfxObjectShell* pShell;
- if ( SFX_ITEM_SET == rSet.GetItemState( SID_HTML_MODE, FALSE, &pItem )
- || ( 0 != ( pShell = SfxObjectShell::Current()) &&
- 0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
- {
- USHORT nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
- bHTMLMode = 0 != (nHtmlMode&HTMLMODE_ON);
- }
-
- BOOL bCharFmt = pActNum->IsFeatureSupported(NUM_CHAR_STYLE);
- aCharFmtFT.Show(bCharFmt);
- aCharFmtLB.Show(bCharFmt);
-
- BOOL bContinuous = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
-
- BOOL bAllLevel = bContinuous && !bHTMLMode;
- aAllLevelFT.Show(bAllLevel);
- aAllLevelNF.Show(bAllLevel);
-
- aSameLevelFL.Show(bContinuous);
- aSameLevelCB.Show(bContinuous);
- //wieder Missbrauch: im Draw gibt es die Numerierung nur bis zum Bitmap
- // without SVX_NUM_NUMBER_NONE
- //remove types that are unsupported by Draw/Impress
- if(!bContinuous)
- {
- USHORT nFmtCount = aFmtLB.GetEntryCount();
- for(USHORT i = nFmtCount; i; i--)
- {
- USHORT nEntryData = (USHORT)(ULONG)aFmtLB.GetEntryData(i - 1);
- if(/*SVX_NUM_NUMBER_NONE == nEntryData ||*/
- ((SVX_NUM_BITMAP|LINK_TOKEN) == nEntryData))
- aFmtLB.RemoveEntry(i - 1);
- }
- }
- //one must be enabled
- if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP))
- {
- long nData = SVX_NUM_BITMAP|LINK_TOKEN;
- USHORT nPos = aFmtLB.GetEntryPos((void*)nData);
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- aFmtLB.RemoveEntry(nPos);
- }
- else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP))
- {
- long nData = SVX_NUM_BITMAP;
- USHORT nPos = aFmtLB.GetEntryPos((void*)nData);
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- aFmtLB.RemoveEntry(nPos);
- }
- if(pActNum->IsFeatureSupported(NUM_SYMBOL_ALIGNMENT))
- {
- aAlignFT.Show();
- aAlignLB.Show();
- Size aSz(aFormatFL.GetSizePixel());
- aSz.Height() = aLevelFT.GetSizePixel().Height();
- aFormatFL.SetSizePixel(aSz);
- aAlignLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
- }
-
- //MegaHack: Aufgrund eines nicht fixbaren 'designfehlers' im Impress
- //Alle arten der numerischen Aufzaehlungen loeschen
- if(pActNum->IsFeatureSupported(NUM_NO_NUMBERS))
- {
- USHORT nFmtCount = aFmtLB.GetEntryCount();
- for(USHORT i = nFmtCount; i; i--)
- {
- USHORT nEntryData = (USHORT)(ULONG)aFmtLB.GetEntryData(i - 1);
- if( /*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE)
- aFmtLB.RemoveEntry(i - 1);
- }
- }
-
- InitControls();
- bModified = FALSE;
-
-}
-/*-----------------02.12.97 13:47-------------------
-
---------------------------------------------------*/
-void SvxNumOptionsTabPage::InitControls()
-{
- BOOL bShowBullet = TRUE;
- BOOL bShowBitmap = TRUE;
- BOOL bSameType = TRUE;
- BOOL bSameStart = TRUE;
- BOOL bSamePrefix = TRUE;
- BOOL bSameSuffix = TRUE;
- BOOL bAllLevel = TRUE;
- BOOL bSameCharFmt = TRUE;
- BOOL bSameVOrient = TRUE;
- BOOL bSameSize = TRUE;
- BOOL bSameBulColor = TRUE;
- BOOL bSameBulRelSize= TRUE;
- BOOL bSameAdjust = TRUE;
-
- const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM];
- String sFirstCharFmt;
- sal_Int16 eFirstOrient = text::VertOrientation::NONE;
- Size aFirstSize(0,0);
- USHORT nMask = 1;
- USHORT nLvl = USHRT_MAX;
- USHORT nHighestLevel = 0;
- String aEmptyStr;
-
- BOOL bBullColor = pActNum->IsFeatureSupported(NUM_BULLET_COLOR);
- BOOL bBullRelSize = pActNum->IsFeatureSupported(NUM_BULLET_REL_SIZE);
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- aNumFmtArr[i] = &pActNum->GetLevel(i);
- bShowBullet &= aNumFmtArr[i]->GetNumberingType() == SVX_NUM_CHAR_SPECIAL;
- bShowBitmap &= (aNumFmtArr[i]->GetNumberingType()&(~LINK_TOKEN)) == SVX_NUM_BITMAP;
- if(USHRT_MAX == nLvl)
- {
- nLvl = i;
- sFirstCharFmt = aNumFmtArr[i]->GetCharFmtName();
- eFirstOrient = aNumFmtArr[i]->GetVertOrient();
- if(bShowBitmap)
- aFirstSize = aNumFmtArr[i]->GetGraphicSize();
- }
- if( i > nLvl)
- {
- bSameType &= aNumFmtArr[i]->GetNumberingType() == aNumFmtArr[nLvl]->GetNumberingType();
- bSameStart = aNumFmtArr[i]->GetStart() == aNumFmtArr[nLvl]->GetStart();
-
- bSamePrefix = aNumFmtArr[i]->GetPrefix() == aNumFmtArr[nLvl]->GetPrefix();
- bSameSuffix = aNumFmtArr[i]->GetSuffix() == aNumFmtArr[nLvl]->GetSuffix();
- bAllLevel &= aNumFmtArr[i]->GetIncludeUpperLevels() == aNumFmtArr[nLvl]->GetIncludeUpperLevels();
- bSameCharFmt &= sFirstCharFmt == aNumFmtArr[i]->GetCharFmtName();
- bSameVOrient &= eFirstOrient == aNumFmtArr[i]->GetVertOrient();
- if(bShowBitmap && bSameSize)
- bSameSize &= aNumFmtArr[i]->GetGraphicSize() == aFirstSize;
- bSameBulColor &= aNumFmtArr[i]->GetBulletColor() == aNumFmtArr[nLvl]->GetBulletColor();
- bSameBulRelSize &= aNumFmtArr[i]->GetBulletRelSize() == aNumFmtArr[nLvl]->GetBulletRelSize();
- bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust();
- }
- nHighestLevel = i;
- }
- else
- aNumFmtArr[i] = 0;
-
- nMask <<= 1 ;
-
- }
- SwitchNumberType(bShowBullet ? 1 : bShowBitmap ? 2 : 0);
- CheckForStartValue_Impl(aNumFmtArr[nLvl]->GetNumberingType());
- if(bShowBitmap)
- {
- if(!bSameVOrient || eFirstOrient == text::VertOrientation::NONE)
- aOrientLB.SetNoSelection();
- else
- aOrientLB.SelectEntryPos(
- sal::static_int_cast< USHORT >(eFirstOrient - 1));
- // kein text::VertOrientation::NONE
-
- if(bSameSize)
- {
- SetMetricValue(aHeightMF, aFirstSize.Height(), eCoreUnit);
- SetMetricValue(aWidthMF, aFirstSize.Width(), eCoreUnit);
- }
- else
- {
- aHeightMF.SetText(aEmptyStr);
- aWidthMF.SetText(aEmptyStr);
- }
- }
-
- if(bSameType)
- {
- USHORT nLBData = (USHORT) aNumFmtArr[nLvl]->GetNumberingType();
- aFmtLB.SelectEntryPos(aFmtLB.GetEntryPos( (void*)sal::static_int_cast<sal_uIntPtr>( nLBData ) ));
- }
- else
- aFmtLB.SetNoSelection();
-
- aAllLevelNF.Enable(nHighestLevel > 0 && !aSameLevelCB.IsChecked());
- aAllLevelNF.SetMax(nHighestLevel + 1);
- if(bAllLevel)
- {
- aAllLevelNF.SetValue(aNumFmtArr[nLvl]->GetIncludeUpperLevels());
- }
- else
- {
- aAllLevelNF.SetText(aEmptyStr);
- }
- if(bSameAdjust)
- {
- USHORT nPos = 1; // zentriert
- if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT)
- nPos = 0;
- else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT)
- nPos = 2;
- aAlignLB.SelectEntryPos(nPos);
- }
- else
- {
- aAlignLB.SetNoSelection();
- }
-
- if(bBullRelSize)
- {
- if(bSameBulRelSize)
- aBulRelSizeMF.SetValue(aNumFmtArr[nLvl]->GetBulletRelSize());
- else
- aBulRelSizeMF.SetText(aEmptyStr);
- }
- if(bBullColor)
- {
- if(bSameBulColor)
- aBulColLB.SelectEntry(aNumFmtArr[nLvl]->GetBulletColor());
- else
- aBulColLB.SetNoSelection();
- }
- switch(nBullet)
- {
- case SHOW_NUMBERING:
- if(bSameStart)
- {
- aStartED.SetValue(aNumFmtArr[nLvl]->GetStart());
- }
- else
- aStartED.SetText(aEmptyStr);
- break;
- case SHOW_BULLET:
- {
-// const Font* pFnt = aNumFmtArr[Lvl]->GetBulletFont();
-// if(pFnt)
-// ChgTxtFont(aBulletFT, *pFnt);
-// aBulletFT.SetText(String((char)aNumFmtArr[nLvl]->GetBulletChar()));
- }
- break;
- case SHOW_BITMAP:
- break;
- }
-
- if(bSamePrefix)
- aPrefixED.SetText(aNumFmtArr[nLvl]->GetPrefix());
- else
- aPrefixED.SetText(aEmptyStr);
- if(bSameSuffix)
- aSuffixED.SetText(aNumFmtArr[nLvl]->GetSuffix());
- else
- aSuffixED.SetText(aEmptyStr);
-
- if(bSameCharFmt)
- {
- if(sFirstCharFmt.Len())
- aCharFmtLB.SelectEntry(sFirstCharFmt);
- else
- aCharFmtLB.SelectEntryPos( 0 );
- }
- else
- aCharFmtLB.SetNoSelection();
-
- pPreviewWIN->SetLevel(nActNumLvl);
- pPreviewWIN->Invalidate();
-}
-
-/*-----------------02.12.97 14:01-------------------
- 0 - Nummer; 1 - Bullet; 2 - Bitmap
---------------------------------------------------*/
-
-void SvxNumOptionsTabPage::SwitchNumberType( BYTE nType, BOOL )
-{
- if(nBullet == nType)
- return;
- nBullet = nType;
- BOOL bBitmap = FALSE;
- BOOL bBullet = FALSE;
- BOOL bEnableBitmap = FALSE;
- if(nType == SHOW_NUMBERING)
- {
- // Label umschalten, alten Text merken
- aStartFT.SetText(sStartWith);
-
- }
- else if(nType == SHOW_BULLET)
- {
- // Label umschalten, alten Text merken
- aStartFT.SetText(sBullet);
- bBullet = TRUE;
- }
- else
- {
- bBitmap = TRUE;
- bEnableBitmap = TRUE;
- }
- BOOL bNumeric = !(bBitmap||bBullet);
- aPrefixFT.Show(bNumeric);
- aPrefixED.Show(bNumeric);
- aSuffixFT.Show(bNumeric);
- aSuffixED.Show(bNumeric);
-
- BOOL bCharFmt = pActNum->IsFeatureSupported(NUM_CHAR_STYLE);
- aCharFmtFT.Show(!bBitmap && bCharFmt);
- aCharFmtLB.Show(!bBitmap && bCharFmt);
-
- // das ist eigentlich Missbrauch, da fuer die vollst. Numerierung kein
- // eigenes Flag existiert
- BOOL bAllLevelFeature = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
- BOOL bAllLevel = bNumeric && bAllLevelFeature && !bHTMLMode;
- aAllLevelFT.Show(bAllLevel);
- aAllLevelNF.Show(bAllLevel);
-
- aStartFT.Show(!bBitmap);
- aStartED.Show(!(bBullet||bBitmap));
-
- aBulletPB.Show(bBullet);
- BOOL bBullColor = pActNum->IsFeatureSupported(NUM_BULLET_COLOR);
- aBulColorFT.Show( !bBitmap && bBullColor );
- aBulColLB.Show( !bBitmap && bBullColor );
- BOOL bBullResSize = pActNum->IsFeatureSupported(NUM_BULLET_REL_SIZE);
- aBulRelSizeFT.Show( !bBitmap && bBullResSize );
- aBulRelSizeMF.Show( !bBitmap && bBullResSize );
-
- aBitmapFT .Show(bBitmap);
- aBitmapMB .Show(bBitmap);
-
- aSizeFT .Show(bBitmap);
- aWidthMF .Show(bBitmap);
- aMultFT .Show(bBitmap);
- aHeightMF .Show(bBitmap);
- aRatioCB .Show(bBitmap);
-
- aOrientFT .Show(bBitmap && bAllLevelFeature);
- aOrientLB .Show(bBitmap && bAllLevelFeature);
-
- aSizeFT .Enable(bEnableBitmap);
- aWidthMF .Enable(bEnableBitmap);
- aMultFT .Enable(bEnableBitmap);
- aHeightMF .Enable(bEnableBitmap);
- aRatioCB .Enable(bEnableBitmap);
- aOrientFT .Enable(bEnableBitmap);
- aOrientLB .Enable(bEnableBitmap);
-
-}
-/*-----------------02.12.97 13:51-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox *, pBox )
-{
- USHORT nSaveNumLvl = nActNumLvl;
- nActNumLvl = 0;
- if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) &&
- (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff))
- {
- nActNumLvl = 0xFFFF;
- pBox->SetUpdateMode(FALSE);
- for( USHORT i = 0; i < pActNum->GetLevelCount(); i++ )
- pBox->SelectEntryPos( i, FALSE );
- pBox->SetUpdateMode(TRUE);
- }
- else if(pBox->GetSelectEntryCount())
- {
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); i++ )
- {
- if(pBox->IsEntryPosSelected( i ))
- nActNumLvl |= nMask;
- nMask <<= 1;
- }
- pBox->SelectEntryPos( pActNum->GetLevelCount(), FALSE );
- }
- else
- {
- nActNumLvl = nSaveNumLvl;
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); i++ )
- {
- if(nActNumLvl & nMask)
- {
- pBox->SelectEntryPos(i);
- break;
- }
- nMask <<=1;
- }
- }
- InitControls();
- return 0;
-}
-/* -----------------------------05.04.2002 15:30------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer*, EMPTYARG )
-{
- pPreviewWIN->Invalidate();
- return 0;
-}
-/*-----------------03.12.97 12:01-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, NumericField*, pBox )
-{
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- USHORT nMask = 1;
- for(USHORT e = 0; e < pActNum->GetLevelCount(); e++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
- aNumFmt.SetIncludeUpperLevels((BYTE) std::min(pBox->GetValue(), sal_Int64(e + 1)) );
- pActNum->SetLevel(e, aNumFmt);
- }
- nMask <<= 1;
- }
- }
- SetModified();
- return 0;
-}
-
-/*-----------------02.12.97 08:56-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox )
-{
- String sSelectStyle;
- sal_Int16 eOldType;
- BOOL bShowOrient = FALSE;
- BOOL bBmp = FALSE;
- String aEmptyStr;
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- eOldType = aNumFmt.GetNumberingType();
- // PAGEDESC gibt es nicht
- USHORT nNumType = (USHORT)(ULONG)pBox->GetEntryData(pBox->GetSelectEntryPos());
- aNumFmt.SetNumberingType((sal_Int16)nNumType);
- sal_uInt16 nNumberingType = aNumFmt.GetNumberingType();
- if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN)))
- {
- bBmp |= 0 != aNumFmt.GetBrush();
- aNumFmt.SetIncludeUpperLevels( FALSE );
- aNumFmt.SetSuffix( aEmptyStr );
- aNumFmt.SetPrefix( aEmptyStr );
- if(!bBmp)
- aNumFmt.SetGraphic(aEmptyStr);
- pActNum->SetLevel(i, aNumFmt);
- SwitchNumberType(SHOW_BITMAP, bBmp );
- bShowOrient = TRUE;
- }
- else if( SVX_NUM_CHAR_SPECIAL == nNumberingType )
- {
- aNumFmt.SetIncludeUpperLevels( FALSE );
- aNumFmt.SetSuffix( aEmptyStr );
- aNumFmt.SetPrefix( aEmptyStr );
- if( !aNumFmt.GetBulletFont() )
- aNumFmt.SetBulletFont(&aActBulletFont);
- if( !aNumFmt.GetBulletChar() )
- aNumFmt.SetBulletChar( SVX_DEF_BULLET );
- pActNum->SetLevel(i, aNumFmt);
- SwitchNumberType(SHOW_BULLET);
- //ChgTxtFont(aBulletFT, *aNumFmt.GetBulletFont());
- //aBulletFT.SetText( aNumFmt.GetBulletChar() );
- // Zuweisung der Zeichenvorlage automatisch
- if(bAutomaticCharStyles)
- {
- sSelectStyle = sBulletCharFmtName;
- }
- }
- else
- {
- aNumFmt.SetPrefix( aPrefixED.GetText() );
- aNumFmt.SetSuffix( aSuffixED.GetText() );
-// aNumFmt.SetBulletFont(0);
- SwitchNumberType(SHOW_NUMBERING);
- pActNum->SetLevel(i, aNumFmt);
- CheckForStartValue_Impl(nNumberingType);
-
- // Zuweisung der Zeichenvorlage automatisch
- if(bAutomaticCharStyles)
- {
- sSelectStyle = sNumCharFmtName;
- }
- }
- }
- nMask <<= 1;
- }
- BOOL bAllLevelFeature = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
- if(bShowOrient && bAllLevelFeature)
- {
- aOrientFT.Show();
- aOrientLB.Show();
- }
- else
- {
- aOrientFT.Hide();
- aOrientLB.Hide();
- }
- SetModified();
- if(sSelectStyle.Len())
- {
- aCharFmtLB.SelectEntry(sSelectStyle);
- CharFmtHdl_Impl(&aCharFmtLB);
- // bAutomaticCharStyles wird im CharFmtHdl_Impl zurueckgesetzt
- bAutomaticCharStyles = TRUE;
- }
- return 0;
-}
-/* -----------------06.11.2002 14:27-----------------
- *
- * --------------------------------------------------*/
-void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
-{
- BOOL bIsNull = aStartED.GetValue() == 0;
- BOOL bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
- SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
- SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
- aStartED.SetMin(bNoZeroAllowed ? 1 : 0);
- if(bIsNull && bNoZeroAllowed)
- aStartED.GetModifyHdl().Call(&aStartED);
-}
-/*-----------------03.12.97 16:43-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox *, pBox )
-{
- USHORT nPos = pBox->GetSelectEntryPos();
- nPos ++; // kein VERT_NONE
-
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- if(SVX_NUM_BITMAP == (aNumFmt.GetNumberingType()&(~LINK_TOKEN)))
- {
- const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
- const Size& rSize = aNumFmt.GetGraphicSize();
- sal_Int16 eOrient = (sal_Int16)nPos;
- aNumFmt.SetGraphicBrush( pBrushItem, &rSize, &eOrient );
- pActNum->SetLevel(i, aNumFmt);
- }
- }
- nMask <<= 1;
- }
- SetModified(FALSE);
- return 0;
-
-}
-
-/*-----------------06.12.97 12:00-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, SameLevelHdl_Impl, CheckBox *, pBox )
-{
- BOOL bSet = pBox->IsChecked();
- pActNum->SetContinuousNumbering(bSet);
- BOOL bRepaint = FALSE;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- if(aNumFmt.GetNumberingType() != SVX_NUM_NUMBER_NONE)
- {
- bRepaint = TRUE;
- break;
- }
- }
- SetModified(bRepaint);
- InitControls();
- return 0;
-}
-/* -----------------16.11.98 14:20-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox*, pBox )
-{
- Color nSetColor = pBox->GetSelectEntryColor();
-
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- aNumFmt.SetBulletColor(nSetColor);
- pActNum->SetLevel(i, aNumFmt);
- }
- nMask <<= 1;
- }
- SetModified();
- return 0;
-}
-/* -----------------16.11.98 14:20-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, MetricField *, pField)
-{
- USHORT nRelSize = (USHORT)pField->GetValue();
-
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- aNumFmt.SetBulletRelSize(nRelSize);
- pActNum->SetLevel(i, aNumFmt);
- }
- nMask <<= 1;
- }
- SetModified();
- return 0;
-}
-
-/*-----------------02.12.97 10:50-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton )
-{
- USHORT nItemId = pButton->GetCurItemId();
- String aGrfName;
- Size aSize;
- sal_Bool bSucc(sal_False);
- SvxOpenGraphicDialog aGrfDlg( SVX_RES(RID_STR_EDIT_GRAPHIC) );
-// aGrfDlg.SetDialogHelpId( HID_NUMBERINGOPT_SEL_GRF_FROM_FILE );
-
- if(MN_GALLERY_ENTRY <= nItemId )
- {
- aGrfName = *((String*)aGrfNames.GetObject( nItemId - MN_GALLERY_ENTRY));
- Graphic aGraphic;
- if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, nItemId - MN_GALLERY_ENTRY, &aGraphic))
- {
- aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
- bSucc = sal_True;
- }
- }
- else
- {
- aGrfDlg.EnableLink( sal_False );
- aGrfDlg.AsLink( sal_False );
- if ( !aGrfDlg.Execute() )
- {
- // ausgewaehlten Filter merken
- aGrfName = aGrfDlg.GetPath();
-
- Graphic aGraphic;
- if( !aGrfDlg.GetGraphic(aGraphic) )
- {
- aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
- bSucc = sal_True;
- }
- }
- }
- if(bSucc)
- {
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit);
-
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- aNumFmt.SetCharFmtName(sNumCharFmtName);
- aNumFmt.SetGraphic(aGrfName);
-
- // Size schon mal fuer spaeteren Groessenabgleich setzen
- const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
- // initiate asynchronous loading
- sal_Int16 eOrient = aNumFmt.GetVertOrient();
- aNumFmt.SetGraphicBrush( pBrushItem, &aSize, &eOrient );
- aInitSize[i] = aNumFmt.GetGraphicSize();
-
- pActNum->SetLevel(i, aNumFmt);
- }
- nMask <<= 1;
- }
- aRatioCB .Enable();
- aSizeFT .Enable();
- aMultFT.Enable();
- aWidthMF .Enable();
- aHeightMF.Enable();
- SetMetricValue(aWidthMF, aSize.Width(), eCoreUnit);
- SetMetricValue(aHeightMF, aSize.Height(), eCoreUnit);
- aOrientFT.Enable();
- aOrientLB.Enable();
- SetModified();
- //needed due to asynchronous loading of graphics in the SvxBrushItem
- aInvalidateTimer.Start();
- }
- return 0;
-}
-/* -----------------27.07.99 12:20-------------------
-
- --------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, PopupActivateHdl_Impl, Menu *, EMPTYARG )
-{
- if(!bMenuButtonInitialized)
- {
- bMenuButtonInitialized = TRUE;
- EnterWait();
- PopupMenu* pPopup = aBitmapMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY );
- GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
- if(aGrfNames.Count())
- {
- pPopup->RemoveItem( pPopup->GetItemPos( NUM_NO_GRAPHIC ));
- String aEmptyStr;
- GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
-
- for(USHORT i = 0; i < aGrfNames.Count(); i++)
- {
- Graphic aGraphic;
- String sGrfName = *(const String*)aGrfNames.GetObject(i);
- INetURLObject aObj(sGrfName);
- if(aObj.GetProtocol() == INET_PROT_FILE)
- sGrfName = aObj.PathToFileName();
- if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, i, &aGraphic))
- {
- Bitmap aBitmap(aGraphic.GetBitmap());
- Size aSize(aBitmap.GetSizePixel());
- if(aSize.Width() > MAX_BMP_WIDTH ||
- aSize.Height() > MAX_BMP_HEIGHT)
- {
- BOOL bWidth = aSize.Width() > aSize.Height();
- double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
- aBitmap.Scale(nScale, nScale);
- }
- Image aImage(aBitmap);
-
- pPopup->InsertItem(MN_GALLERY_ENTRY + i, sGrfName, aImage );
- }
- else
- {
- Image aImage;
- pPopup->InsertItem(
- MN_GALLERY_ENTRY + i, sGrfName, aImage );
- }
- }
- GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
- }
- LeaveWait();
- }
- return 0;
-}
-
-/*-----------------02.12.97 10:58-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, BulletHdl_Impl, Button *, EMPTYARG )
-{
- SvxCharacterMap* pMap = new SvxCharacterMap( this, TRUE );
-
- USHORT nMask = 1;
- const Font* pFmtFont = 0;
- BOOL bSameBullet = TRUE;
- sal_Unicode cBullet = 0;
- BOOL bFirst = TRUE;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- const SvxNumberFormat& rCurFmt = pActNum->GetLevel(i);
- if(bFirst)
- {
- cBullet = rCurFmt.GetBulletChar();
- }
- else if(rCurFmt.GetBulletChar() != cBullet )
- {
- bSameBullet = FALSE;
- break;
- }
- if(!pFmtFont)
- pFmtFont = rCurFmt.GetBulletFont();
- bFirst = FALSE;
- }
- nMask <<= 1;
-
- }
-
- if(pFmtFont)
- pMap->SetCharFont(*pFmtFont);
- else
- pMap->SetCharFont(aActBulletFont);
- if(bSameBullet)
- pMap->SetChar( cBullet );
- if(pMap->Execute() == RET_OK)
- {
- // Font Numrules umstellen
- aActBulletFont = pMap->GetCharFont();
-
- USHORT _nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & _nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- aNumFmt.SetBulletFont(&aActBulletFont); ;
- aNumFmt.SetBulletChar( (sal_Unicode) pMap->GetChar() );
- pActNum->SetLevel(i, aNumFmt);
- }
- _nMask <<= 1;
- }
-
- SetModified();
- }
- delete pMap;
- return 0;
-}
-
-/*-----------------03.03.97 15:21-------------------
-
---------------------------------------------------*/
-
-IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, MetricField *, pField)
-{
- BOOL bWidth = pField == &aWidthMF;
- bLastWidthModified = bWidth;
- BOOL bRatio = aRatioCB.IsChecked();
- long nWidthVal = static_cast<long>(aWidthMF.Denormalize(aWidthMF.GetValue(FUNIT_100TH_MM)));
- long nHeightVal = static_cast<long>(aHeightMF.Denormalize(aHeightMF.GetValue(FUNIT_100TH_MM)));
- nWidthVal = OutputDevice::LogicToLogic( nWidthVal ,
- MAP_100TH_MM, (MapUnit)eCoreUnit );
- nHeightVal = OutputDevice::LogicToLogic( nHeightVal,
- MAP_100TH_MM, (MapUnit)eCoreUnit);
- double fSizeRatio;
-
- BOOL bRepaint = FALSE;
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- if(SVX_NUM_BITMAP == (aNumFmt.GetNumberingType()&(~LINK_TOKEN)))
- {
- Size aSize(aNumFmt.GetGraphicSize() );
- Size aSaveSize(aSize);
-
- if (aInitSize[i].Height())
- fSizeRatio = (double)aInitSize[i].Width() / (double)aInitSize[i].Height();
- else
- fSizeRatio = (double)1;
-
- if(bWidth)
- {
- long nDelta = nWidthVal - aInitSize[i].Width();
- aSize.Width() = nWidthVal;
- if (bRatio)
- {
- aSize.Height() = aInitSize[i].Height() + (long)((double)nDelta / fSizeRatio);
- aHeightMF.SetUserValue(aHeightMF.Normalize(
- OutputDevice::LogicToLogic( aSize.Height(), (MapUnit)eCoreUnit, MAP_100TH_MM )),
- FUNIT_100TH_MM);
- }
- }
- else
- {
- long nDelta = nHeightVal - aInitSize[i].Height();
- aSize.Height() = nHeightVal;
- if (bRatio)
- {
- aSize.Width() = aInitSize[i].Width() + (long)((double)nDelta * fSizeRatio);
- aWidthMF.SetUserValue(aWidthMF.Normalize(
- OutputDevice::LogicToLogic( aSize.Width(), (MapUnit)eCoreUnit, MAP_100TH_MM )),
- FUNIT_100TH_MM);
- }
- }
- const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
- sal_Int16 eOrient = aNumFmt.GetVertOrient();
- if(aSize != aSaveSize)
- bRepaint = TRUE;
- aNumFmt.SetGraphicBrush( pBrushItem, &aSize, &eOrient );
- pActNum->SetLevel(i, aNumFmt);
- }
- }
- nMask <<= 1;
- }
- SetModified(bRepaint);
- return 0;
-}
-
-/*------------------------------------------------------------------------
- Beschreibung:
-------------------------------------------------------------------------*/
-
-IMPL_LINK( SvxNumOptionsTabPage, RatioHdl_Impl, CheckBox *, pBox )
-{
- if (pBox->IsChecked())
- {
- if (bLastWidthModified)
- SizeHdl_Impl(&aWidthMF);
- else
- SizeHdl_Impl(&aHeightMF);
- }
- return 0;
-}
-
-/*-----------------02.12.97 16:07-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, CharFmtHdl_Impl, ListBox *, EMPTYARG )
-{
- bAutomaticCharStyles = FALSE;
- USHORT nEntryPos = aCharFmtLB.GetSelectEntryPos();
- String sEntry = aCharFmtLB.GetSelectEntry();
- USHORT nMask = 1;
- String aEmptyStr;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- if( 0 == nEntryPos )
- aNumFmt.SetCharFmtName(aEmptyStr);
- else
- {
- if(SVX_NUM_BITMAP != (aNumFmt.GetNumberingType()&(~LINK_TOKEN)))
- aNumFmt.SetCharFmtName(sEntry);
- }
- pActNum->SetLevel(i, aNumFmt);
- }
- nMask <<= 1;
- }
- SetModified(FALSE);
- return 0;
-
-};
-
-/*-----------------03.12.97 11:01-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit *, pEdit )
-{
- BOOL bPrefix = pEdit == &aPrefixED;
- BOOL bSuffix = pEdit == &aSuffixED;
- BOOL bStart = pEdit == &aStartED;
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
- if(bPrefix)
- aNumFmt.SetPrefix( aPrefixED.GetText() );
- else if(bSuffix)
- aNumFmt.SetSuffix( aSuffixED.GetText() );
- else if(bStart)
- aNumFmt.SetStart( (USHORT)aStartED.GetValue() );
- else //align
- {
- USHORT nPos = aAlignLB.GetSelectEntryPos();
- SvxAdjust eAdjust = SVX_ADJUST_CENTER;
- if(nPos == 0)
- eAdjust = SVX_ADJUST_LEFT;
- else if(nPos == 2)
- eAdjust = SVX_ADJUST_RIGHT;
- aNumFmt.SetNumAdjust( eAdjust );
- }
- pActNum->SetLevel(i, aNumFmt);
- }
- nMask <<= 1;
- }
- SetModified();
-
- return 0;
-}
-
-/*-----------------09.12.97 11:49-------------------
-
---------------------------------------------------*/
-USHORT lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, USHORT nXStart,
- USHORT nYStart, USHORT nDivision)
-{
- const SvxBrushItem* pBrushItem = rFmt.GetBrush();
- USHORT nRet = 0;
- if(pBrushItem)
- {
- const Graphic* pGrf = pBrushItem->GetGraphic();
- if(pGrf)
- {
- Size aGSize( rFmt.GetGraphicSize() );
- aGSize.Width() /= nDivision;
- nRet = (USHORT)aGSize.Width();
- aGSize.Height() /= nDivision;
- pGrf->Draw( pVDev, Point(nXStart,nYStart),
- pVDev->PixelToLogic( aGSize ) );
- }
- }
- return nRet;
-
-}
-
-/*-----------------09.12.97 11:54-------------------
-
---------------------------------------------------*/
-USHORT lcl_DrawBullet(VirtualDevice* pVDev,
- const SvxNumberFormat& rFmt, USHORT nXStart,
- USHORT nYStart, const Size& rSize)
-{
- Font aTmpFont(pVDev->GetFont());
-
- //per Uno kann es sein, dass kein Font gesetzt ist!
- Font aFont(rFmt.GetBulletFont() ? *rFmt.GetBulletFont() : aTmpFont);
- Size aTmpSize(rSize);
- aTmpSize.Width() *= rFmt.GetBulletRelSize();
- aTmpSize.Width() /= 100 ;
- aTmpSize.Height() *= rFmt.GetBulletRelSize();
- aTmpSize.Height() /= 100 ;
- // bei einer Hoehe von Null wird in Ursprungshoehe gezeichnet
- if(!aTmpSize.Height())
- aTmpSize.Height() = 1;
- aFont.SetSize(aTmpSize);
- aFont.SetTransparent(TRUE);
- Color aBulletColor = rFmt.GetBulletColor();
- if(aBulletColor.GetColor() == COL_AUTO)
- aBulletColor = Color(pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK);
- else if(aBulletColor == pVDev->GetFillColor())
- aBulletColor.Invert();
- aFont.SetColor(aBulletColor);
- pVDev->SetFont( aFont );
- String aText(sal_Unicode(rFmt.GetBulletChar()));
- long nY = nYStart;
- nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
- pVDev->DrawText( Point(nXStart, nY), aText );
- USHORT nRet = (USHORT)pVDev->GetTextWidth(aText);
-
- pVDev->SetFont(aTmpFont);
- return nRet;
-}
-/*-----------------02.12.97 10:34-------------------
- Vorschau der Numerierung painten
---------------------------------------------------*/
-void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ )
-{
- Size aSize(PixelToLogic(GetOutputSizePixel()));
- Rectangle aRect(Point(0,0), aSize);
-
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- const Color aBackColor = rStyleSettings.GetFieldColor();
- const Color aTextColor = rStyleSettings.GetFieldTextColor();
-
- VirtualDevice* pVDev = new VirtualDevice(*this);
- pVDev->EnableRTL( IsRTLEnabled() );
- pVDev->SetMapMode(GetMapMode());
- pVDev->SetOutputSize( aSize );
-
- Color aLineColor(COL_LIGHTGRAY);
- if(aLineColor == aBackColor)
- aLineColor.Invert();
- pVDev->SetLineColor(aLineColor);
- pVDev->SetFillColor( aBackColor );
- 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 = sal::static_int_cast< USHORT >(aSize.Width() / (3 * pActNum->GetLevelCount()));
- if(pActNum->GetLevelCount() < 10)
- nXStep /= 2;
- USHORT nYStart = 4;
- // fuer ein einziges Level darf nicht die gesamte Hoehe benutzt werden
- USHORT nYStep = sal::static_int_cast< USHORT >((aSize.Height() - 6)/ (pActNum->GetLevelCount() > 1 ? pActNum->GetLevelCount() : 5));
- aStdFont = OutputDevice::GetDefaultFont(
- DEFAULTFONT_UI_SANS, MsLangId::getSystemLanguage(), DEFAULTFONT_FLAGS_ONLYONE);
- aStdFont.SetColor(aTextColor);
- aStdFont.SetFillColor(aBackColor);
-
- //
- USHORT nFontHeight = nYStep * 6 / 10;
- if(bPosition)
- nFontHeight = nYStep * 15 / 10;
- aStdFont.SetSize(Size( 0, nFontHeight ));
-
- SvxNodeNum aNum( (BYTE)0 );
- USHORT nPreNum = pActNum->GetLevel(0).GetStart();
-
- if(bPosition)
- {
- USHORT nLineHeight = nFontHeight * 8 / 7;
- BYTE nStart = 0;
- while( !(nActLevel & (1<<nStart)) )
- {
- nStart++;
- }
- if(nStart)
- nStart--;
- BYTE nEnd = std::min( (BYTE)(nStart + 3), (BYTE)pActNum->GetLevelCount() );
- for( BYTE nLevel = nStart; nLevel < nEnd; ++nLevel )
- {
- const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel);
- aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart();
-
- // --> OD 2008-01-16 #newlistlevelattrs#
- USHORT nXStart( 0 );
- short nTextOffset( 0 );
- USHORT nNumberXPos( 0 );
- if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- {
- nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
- nTextOffset = rFmt.GetCharTextDistance() / nWidthRelation;
- nNumberXPos = nXStart;
- USHORT nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation;
-
- if(nFirstLineOffset <= nNumberXPos)
- nNumberXPos = nNumberXPos - nFirstLineOffset;
- else
- nNumberXPos = 0;
- //im draw ist das zulaeesig
- if(nTextOffset < 0)
- nNumberXPos = nNumberXPos + nTextOffset;
- }
- else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
- {
- const long nTmpNumberXPos( ( rFmt.GetIndentAt() +
- rFmt.GetFirstLineIndent() ) /
- nWidthRelation );
- if ( nTmpNumberXPos < 0 )
- {
- nNumberXPos = 0;
- }
- else
- {
- nNumberXPos = static_cast<USHORT>( nTmpNumberXPos );
- }
- }
- // <--
-
- USHORT nBulletWidth = 0;
- if( SVX_NUM_BITMAP == (rFmt.GetNumberingType() &(~LINK_TOKEN)))
- {
- nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(pVDev, rFmt,
- nNumberXPos,
- nYStart, nWidthRelation) : 0;
- }
- else if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() )
- {
- nBulletWidth = rFmt.IsShowSymbol() ?
- lcl_DrawBullet(pVDev, rFmt, nNumberXPos, nYStart, aStdFont.GetSize()) : 0;
- }
- else
- {
- pVDev->SetFont(aStdFont);
- aNum.SetLevel( nLevel );
- if(pActNum->IsContinuousNumbering())
- aNum.GetLevelVal()[nLevel] = nPreNum;
- String aText(pActNum->MakeNumString( aNum ));
- Font aSaveFont = pVDev->GetFont();
- Font aColorFont(aSaveFont);
- Color aTmpBulletColor = rFmt.GetBulletColor();
- if(aTmpBulletColor.GetColor() == COL_AUTO)
- aTmpBulletColor = Color(aBackColor.IsDark() ? COL_WHITE : COL_BLACK);
- else if(aTmpBulletColor == aBackColor)
- aTmpBulletColor.Invert();
- aColorFont.SetColor(aTmpBulletColor);
- pVDev->SetFont(aColorFont);
- pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
- pVDev->SetFont(aSaveFont);
- nBulletWidth = (USHORT)pVDev->GetTextWidth(aText);
- nPreNum++;
- }
- // --> OD 2008-01-16 #newlistlevelattrs#
- if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT &&
- rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE )
- {
- pVDev->SetFont(aStdFont);
- String aText(' ');
- pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
- nBulletWidth = nBulletWidth + (USHORT)pVDev->GetTextWidth(aText);
- }
-
- // --> OD 2008-01-16 #newlistlevelattrs#
- USHORT nTextXPos( 0 );
- if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- {
- nTextXPos = nXStart;
- if(nTextOffset < 0)
- nTextXPos = nTextXPos + nTextOffset;
- if(nNumberXPos + nBulletWidth + nTextOffset > nTextXPos )
- nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
- }
- else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
- {
- switch ( rFmt.GetLabelFollowedBy() )
- {
- case SvxNumberFormat::LISTTAB:
- {
- nTextXPos = static_cast<USHORT>(
- rFmt.GetListtabPos() / nWidthRelation );
- if ( nTextXPos < nNumberXPos + nBulletWidth )
- {
- nTextXPos = nNumberXPos + nBulletWidth;
- }
- }
- break;
- case SvxNumberFormat::SPACE:
- case SvxNumberFormat::NOTHING:
- {
- nTextXPos = nNumberXPos + nBulletWidth;
- }
- break;
- }
-
- nXStart = static_cast<USHORT>( rFmt.GetIndentAt() / nWidthRelation );
- }
- // <--
-
- Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
- pVDev->SetFillColor( aBackColor );
- pVDev->DrawRect( aRect1 );
-
- Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2 ), Size(aSize.Width() / 2, 2));
- pVDev->DrawRect( aRect2 );
- nYStart += 2 * nLineHeight;
- }
- }
- else
- {
- //#i5153# painting gray or black rectangles as 'normal' numbering text
- String sMsg( RTL_CONSTASCII_USTRINGPARAM( "Preview") );
- long nWidth = pVDev->GetTextWidth(sMsg);
- long nTextHeight = pVDev->GetTextHeight();
- long nRectHeight = nTextHeight * 2 / 3;
- long nTopOffset = nTextHeight - nRectHeight;
- Color aBlackColor(COL_BLACK);
- if(aBlackColor == aBackColor)
- aBlackColor.Invert();
-
- for( BYTE nLevel = 0; nLevel < pActNum->GetLevelCount();
- ++nLevel, nYStart = nYStart + nYStep )
- {
- const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel);
- aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart();
- // --> OD 2008-01-31 #newlistlevelattrs#
- USHORT nXStart( 0 );
- if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- {
- nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
- }
- else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
- {
- const long nTmpXStart( ( rFmt.GetIndentAt() +
- rFmt.GetFirstLineIndent() ) /
- nWidthRelation );
- if ( nTmpXStart < 0 )
- {
- nXStart = 0;
- }
- else
- {
- nXStart = static_cast<USHORT>(nTmpXStart);
- }
- }
- nXStart /= 2;
- nXStart += 2;
- // <--
- USHORT nTextOffset = 2 * nXStep;
- if( SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN)) )
- {
- if(rFmt.IsShowSymbol())
- {
- nTextOffset = lcl_DrawGraphic(pVDev, rFmt, nXStart, nYStart, nWidthRelation);
- nTextOffset = nTextOffset + nXStep;
- }
- }
- else if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() )
- {
- if(rFmt.IsShowSymbol())
- {
- nTextOffset = lcl_DrawBullet(pVDev, rFmt, nXStart, nYStart, aStdFont.GetSize());
- nTextOffset = nTextOffset + nXStep;
- }
- }
- else
- {
- Font aColorFont(aStdFont);
- Color aTmpBulletColor = rFmt.GetBulletColor();
- if(aTmpBulletColor.GetColor() == COL_AUTO)
- aTmpBulletColor = Color(aBackColor.IsDark() ? COL_WHITE : COL_BLACK);
- else if(aTmpBulletColor == aBackColor)
- aTmpBulletColor.Invert();
- aColorFont.SetColor(aTmpBulletColor);
- pVDev->SetFont(aColorFont);
- aNum.SetLevel( nLevel );
- if(pActNum->IsContinuousNumbering())
- aNum.GetLevelVal()[nLevel] = nPreNum;
- String aText(pActNum->MakeNumString( aNum ));
- pVDev->DrawText( Point(nXStart, nYStart), aText );
- pVDev->SetFont(aStdFont);
- nTextOffset = (USHORT)pVDev->GetTextWidth(aText);
- nTextOffset = nTextOffset + nXStep;
- nPreNum++;
- }
- if(pOutlineNames)
- {
- //#i5153# outline numberings still use the style names as text
- pVDev->SetFont(aStdFont);
- sMsg = pOutlineNames[nLevel];
- pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg );
- }
- else
- {
- //#i5153# the selected rectangle(s) should be black
- if( 0 != (nActLevel & (1<<nLevel)))
- {
- pVDev->SetFillColor( aBlackColor );
- pVDev->SetLineColor( aBlackColor );
- }
- else
- {
- //#i5153# unselected levels are gray
- pVDev->SetFillColor( aLineColor );
- pVDev->SetLineColor( aLineColor );
- }
- Rectangle aRect1(Point(nXStart + nTextOffset, nYStart + nTopOffset), Size(nWidth, nRectHeight));
- pVDev->DrawRect(aRect1);
- }
- }
- }
- }
- DrawOutDev( Point(0,0), aSize,
- Point(0,0), aSize,
- *pVDev );
- delete pVDev;
-
-}
-
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-SvxNumPositionTabPage::SvxNumPositionTabPage(Window* pParent,
- const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_NUM_POSITION ), rSet ),
- aPositionFL( this, SVX_RES(FL_POSITION )),
- aLevelFT( this, SVX_RES(FT_LEVEL )),
- aLevelLB( this, SVX_RES(LB_LEVEL )),
- aDistBorderFT( this, SVX_RES(FT_BORDERDIST )),
- aDistBorderMF( this, SVX_RES(MF_BORDERDIST )),
- aRelativeCB( this, SVX_RES(CB_RELATIVE )),
- aIndentFT( this, SVX_RES(FT_INDENT )),
- aIndentMF( this, SVX_RES(MF_INDENT )),
- aDistNumFT( this, SVX_RES(FT_NUMDIST )),
- aDistNumMF( this, SVX_RES(MF_NUMDIST )),
- aAlignFT( this, SVX_RES(FT_ALIGN )),
- aAlignLB( this, SVX_RES(LB_ALIGN )),
- // --> OD 2008-01-10 #newlistlevelattrs#
- aLabelFollowedByFT( this, SVX_RES(FT_LABEL_FOLLOWED_BY) ),
- aLabelFollowedByLB( this, SVX_RES(LB_LABEL_FOLLOWED_BY) ),
- aListtabFT( this, SVX_RES(FT_LISTTAB) ),
- aListtabMF( this, SVX_RES(MF_LISTTAB) ),
- aAlign2FT( this, SVX_RES(FT_ALIGN_2) ),
- aAlign2LB( this, SVX_RES(LB_ALIGN_2) ),
- aAlignedAtFT( this, SVX_RES(FT_ALIGNED_AT) ),
- aAlignedAtMF( this, SVX_RES(MF_ALIGNED_AT) ),
- aIndentAtFT( this, SVX_RES(FT_INDENT_AT) ),
- aIndentAtMF( this, SVX_RES(MF_INDENT_AT) ),
- // <--
- aStandardPB( this, SVX_RES(PB_STANDARD )),
- pPreviewWIN( new SvxNumberingPreview(this, SVX_RES(WIN_PREVIEW ))),
- pActNum(0),
- pSaveNum(0),
- nActNumLvl( USHRT_MAX ),
- nNumItemId(SID_ATTR_NUMBERING_RULE),
- bModified(false),
- bPreset(false),
- bInInintControl(FALSE),
- // --> OD 2008-01-11 #newlistlevelattrs#
- bLabelAlignmentPosAndSpaceModeActive( false )
- // <--
-{
- FreeResource();
- SetExchangeSupport();
- pPreviewWIN->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
-
- aRelativeCB.Check();
- aAlignLB.SetSelectHdl(LINK(this, SvxNumPositionTabPage, EditModifyHdl_Impl));
- // --> OD 2008-01-10 #newlistlevelattrs#
- aAlign2LB.SetSelectHdl(LINK(this, SvxNumPositionTabPage, EditModifyHdl_Impl));
- for ( USHORT i = 0; i < aAlignLB.GetEntryCount(); ++i )
- {
- aAlign2LB.InsertEntry( aAlignLB.GetEntry( i ) );
- }
- aAlign2LB.SetDropDownLineCount( aAlign2LB.GetEntryCount() );
- aAlign2FT.SetText( aAlignFT.GetText() );
- // <--
-
- Link aLk = LINK(this, SvxNumPositionTabPage, DistanceHdl_Impl);
-
- aDistBorderMF.SetUpHdl(aLk);
- aDistBorderMF.SetDownHdl(aLk);
- aDistBorderMF.SetLoseFocusHdl(aLk);
-
- aDistNumMF.SetUpHdl(aLk);
- aDistNumMF.SetDownHdl(aLk);
- aDistNumMF.SetLoseFocusHdl(aLk);
-
- aIndentMF.SetUpHdl(aLk);
- aIndentMF.SetDownHdl(aLk);
- aIndentMF.SetLoseFocusHdl(aLk);
-
- // --> OD 2008-01-10 #newlistlevelattrs#
- aLabelFollowedByLB.SetDropDownLineCount( aLabelFollowedByLB.GetEntryCount() );
- aLabelFollowedByLB.SetSelectHdl( LINK(this, SvxNumPositionTabPage, LabelFollowedByHdl_Impl) );
-
- aLk = LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl);
- aListtabMF.SetUpHdl(aLk);
- aListtabMF.SetDownHdl(aLk);
- aListtabMF.SetLoseFocusHdl(aLk);
-
- aLk = LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl);
- aAlignedAtMF.SetUpHdl(aLk);
- aAlignedAtMF.SetDownHdl(aLk);
- aAlignedAtMF.SetLoseFocusHdl(aLk);
-
- aLk = LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl);
- aIndentAtMF.SetUpHdl(aLk);
- aIndentAtMF.SetDownHdl(aLk);
- aIndentAtMF.SetLoseFocusHdl(aLk);
- // <--
-
- aLevelLB.SetSelectHdl(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl));
- aRelativeCB.SetClickHdl(LINK(this, SvxNumPositionTabPage, RelativeHdl_Impl));
- aStandardPB.SetClickHdl(LINK(this, SvxNumPositionTabPage, StandardHdl_Impl));
-
-
- aRelativeCB.Check(bLastRelative);
- pPreviewWIN->SetPositionMode();
- eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
-
- //HACK("der Wert sollte mal sinnvol gesetzt werden")
- long nWidth = 10000;
- nWidth = OutputDevice::LogicToLogic( nWidth,
- (MapUnit)eCoreUnit, MAP_100TH_MM );
-
- aDistBorderMF.SetMax(aDistBorderMF.Normalize( nWidth ), FUNIT_100TH_MM );
- aDistNumMF .SetMax(aDistNumMF .Normalize( nWidth ), FUNIT_100TH_MM );
- aIndentMF .SetMax(aIndentMF .Normalize( nWidth ), FUNIT_100TH_MM );
- // --> OD 2008-02-18 #newlistlevelattrs#
- aListtabMF.SetMax(aListtabMF.Normalize( nWidth ), FUNIT_100TH_MM );
- aAlignedAtMF.SetMax(aAlignedAtMF.Normalize( nWidth ), FUNIT_100TH_MM );
- aIndentAtMF.SetMax(aIndentAtMF.Normalize( nWidth ), FUNIT_100TH_MM );
- // <--
- long nLast2 = nWidth /2;
- aDistBorderMF.SetLast( aDistBorderMF.Normalize( nLast2 ), FUNIT_100TH_MM );
- aDistNumMF .SetLast( aDistNumMF .Normalize( nLast2 ), FUNIT_100TH_MM );
- aIndentMF .SetLast( aIndentMF .Normalize( nLast2 ), FUNIT_100TH_MM );
- // --> OD 2008-02-18 #newlistlevelattrs#
- aListtabMF.SetLast(aListtabMF.Normalize( nLast2 ), FUNIT_100TH_MM );
- aAlignedAtMF.SetLast(aAlignedAtMF.Normalize( nLast2 ), FUNIT_100TH_MM );
- aIndentAtMF.SetLast(aIndentAtMF.Normalize( nLast2 ), FUNIT_100TH_MM );
- // <--
-
-#if OSL_DEBUG_LEVEL > 1
- pDebugFixedText = new FixedText(this, 0);
- pDebugFixedText->Show();
- Size aSize(200, 20);
- Point aPos(250,0);
-
- pDebugFixedText->SetPosSizePixel(aPos, aSize);
- pDebugFixedText->SetText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Das ist ein Debug-Text" ) ) );
-#endif
-}
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-SvxNumPositionTabPage::~SvxNumPositionTabPage()
-{
- delete pActNum;
- delete pPreviewWIN;
- delete pSaveNum;
-#if OSL_DEBUG_LEVEL > 1
- delete pDebugFixedText;
-#endif
-}
-/*-------------------------------------------------------*/
-
-#if OSL_DEBUG_LEVEL > 1
-void lcl_PrintDebugOutput(FixedText& rFixed, const SvxNumberFormat& rNumFmt)
-{
-#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-
- sal_Char const sHash[] = " # ";
- if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- {
- String sDebugText( UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetAbsLSpace() ) ) );
- sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) );
- sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetCharTextDistance() ) );
- sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) );
- sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetFirstLineOffset() ) );
- rFixed.SetText(sDebugText);
- }
- else if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
- {
- String sDebugText( UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetListtabPos() ) ) );
- sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) );
- sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetFirstLineIndent() ) );
- sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) );
- sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetIndentAt() ) );
- rFixed.SetText(sDebugText);
- }
-
-}
-#endif
-
-/*-----------------03.12.97 10:06-------------------
-
---------------------------------------------------*/
-void SvxNumPositionTabPage::InitControls()
-{
- bInInintControl = TRUE;
- // --> OD 2008-01-11 #newlistlevelattrs#
- const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive &&
- aRelativeCB.IsEnabled() && aRelativeCB.IsChecked();
- // <--
- const bool bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 &&
- USHRT_MAX != nActNumLvl;
-
- aDistBorderMF.Enable( !bLabelAlignmentPosAndSpaceModeActive &&
- ( bSingleSelection || bRelative ) );
- aDistBorderFT.Enable( !bLabelAlignmentPosAndSpaceModeActive &&
- ( bSingleSelection || bRelative ) );
-
- bool bSetDistEmpty = false;
- bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive;
- bool bSameDist = !bLabelAlignmentPosAndSpaceModeActive;
- bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive;
- bool bSameAdjust = true;
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- bool bSameLabelFollowedBy = bLabelAlignmentPosAndSpaceModeActive;
- bool bSameListtab = bLabelAlignmentPosAndSpaceModeActive;
- bool bSameAlignAt = bLabelAlignmentPosAndSpaceModeActive;
- bool bSameIndentAt = bLabelAlignmentPosAndSpaceModeActive;
- // <--
-
- const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM];
- USHORT nMask = 1;
- USHORT nLvl = USHRT_MAX;
- long nFirstBorderText = 0;
- long nFirstBorderTextRelative = -1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- aNumFmtArr[i] = &pActNum->GetLevel(i);
- if(nActNumLvl & nMask)
- {
- if(USHRT_MAX == nLvl)
- {
- nLvl = i;
- if ( !bLabelAlignmentPosAndSpaceModeActive )
- {
- nFirstBorderText = nLvl > 0 ?
- aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset() -
- aNumFmtArr[nLvl - 1]->GetAbsLSpace() + aNumFmtArr[nLvl - 1]->GetFirstLineOffset():
- aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset();
- }
- }
-
- if( i > nLvl)
- {
- // --> OD 2008-01-11 #newlistlevelattrs#
- bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust();
- if ( !bLabelAlignmentPosAndSpaceModeActive )
- {
- if(bRelative)
- {
- if(nFirstBorderTextRelative == -1)
- nFirstBorderTextRelative =
- (aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() -
- aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset());
- else
- bSameDistBorderNum &= nFirstBorderTextRelative ==
- (aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() -
- aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset());
- }
- else
- bSameDistBorderNum &=
- aNumFmtArr[i]->GetAbsLSpace() - aNumFmtArr[i]->GetFirstLineOffset() ==
- aNumFmtArr[i - 1]->GetAbsLSpace() - aNumFmtArr[i - 1]->GetFirstLineOffset();
-
- bSameDist &= aNumFmtArr[i]->GetCharTextDistance() == aNumFmtArr[nLvl]->GetCharTextDistance();
- bSameIndent &= aNumFmtArr[i]->GetFirstLineOffset() == aNumFmtArr[nLvl]->GetFirstLineOffset();
- }
- else
- {
- bSameLabelFollowedBy &=
- aNumFmtArr[i]->GetLabelFollowedBy() == aNumFmtArr[nLvl]->GetLabelFollowedBy();
- bSameListtab &=
- aNumFmtArr[i]->GetListtabPos() == aNumFmtArr[nLvl]->GetListtabPos();
- bSameAlignAt &=
- ( ( aNumFmtArr[i]->GetIndentAt() + aNumFmtArr[i]->GetFirstLineIndent() )
- == ( aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent() ) );
- bSameIndentAt &=
- aNumFmtArr[i]->GetIndentAt() == aNumFmtArr[nLvl]->GetIndentAt();
- }
- // <--
- }
- }
- nMask <<= 1;
-
- }
- if(bSameDistBorderNum)
- {
- long nDistBorderNum;
- if(bRelative)
- {
- nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset();
- if(nLvl)
- nDistBorderNum -= (long)aNumFmtArr[nLvl - 1]->GetAbsLSpace()+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
- }
- else
- {
- nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset();
- }
- SetMetricValue(aDistBorderMF, nDistBorderNum, eCoreUnit);
- }
- else
- bSetDistEmpty = true;
-
-#if OSL_DEBUG_LEVEL > 1
- lcl_PrintDebugOutput(*pDebugFixedText, *aNumFmtArr[nLvl]);
-#endif
-
- const String aEmptyStr;
- if(bSameDist)
- SetMetricValue(aDistNumMF, aNumFmtArr[nLvl]->GetCharTextDistance(), eCoreUnit);
- else
- aDistNumMF.SetText(aEmptyStr);
- if(bSameIndent)
- SetMetricValue(aIndentMF, - aNumFmtArr[nLvl]->GetFirstLineOffset(), eCoreUnit);
- else
- aIndentMF.SetText(aEmptyStr);
-
- if(bSameAdjust)
- {
- USHORT nPos = 1; // zentriert
- if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT)
- nPos = 0;
- else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT)
- nPos = 2;
- aAlignLB.SelectEntryPos(nPos);
- // --> OD 2008-01-11 #newlistlevelattrs#
- aAlign2LB.SelectEntryPos( nPos );
- // <--
- }
- else
- {
- aAlignLB.SetNoSelection();
- // --> OD 2008-01-11 #newlistlevelattrs#
- aAlign2LB.SetNoSelection();
- // <--
- }
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- if ( bSameLabelFollowedBy )
- {
- USHORT nPos = 0; // LISTTAB
- if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::SPACE )
- {
- nPos = 1;
- }
- else if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::NOTHING )
- {
- nPos = 2;
- }
- aLabelFollowedByLB.SelectEntryPos( nPos );
- }
- else
- {
- aLabelFollowedByLB.SetNoSelection();
- }
-
- if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
- {
- aListtabFT.Enable( true );
- aListtabMF.Enable( true );
- if ( bSameListtab )
- {
- SetMetricValue( aListtabMF, aNumFmtArr[nLvl]->GetListtabPos(), eCoreUnit );
- }
- else
- {
- aListtabMF.SetText(aEmptyStr);
- }
- }
- else
- {
- aListtabFT.Enable( false );
- aListtabMF.Enable( false );
- aListtabMF.SetText(aEmptyStr);
- }
-
- if ( bSameAlignAt )
- {
- SetMetricValue( aAlignedAtMF,
- aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent(),
- eCoreUnit );
- }
- else
- {
- aAlignedAtMF.SetText(aEmptyStr);
- }
-
- if ( bSameIndentAt )
- {
- SetMetricValue( aIndentAtMF, aNumFmtArr[nLvl]->GetIndentAt(), eCoreUnit );
- }
- else
- {
- aIndentAtMF.SetText(aEmptyStr);
- }
- // <--
-
- if ( bSetDistEmpty )
- aDistBorderMF.SetText(aEmptyStr);
-
- bInInintControl = FALSE;
-}
-
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-void SvxNumPositionTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem;
- UINT16 nTmpNumLvl = USHRT_MAX;
- const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
- if(pExampleSet)
- {
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, FALSE, &pItem))
- bPreset = ((const SfxBoolItem*)pItem)->GetValue();
- if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, FALSE, &pItem))
- nTmpNumLvl = ((const SfxUInt16Item*)pItem)->GetValue();
- }
- //
- if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, FALSE, &pItem))
- {
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
- }
- bModified = (!pActNum->Get( 0 ) || bPreset);
- if(*pSaveNum != *pActNum ||
- nActNumLvl != nTmpNumLvl )
- {
- *pActNum = *pSaveNum;
- nActNumLvl = nTmpNumLvl;
- USHORT nMask = 1;
- aLevelLB.SetUpdateMode(FALSE);
- aLevelLB.SetNoSelection();
- aLevelLB.SelectEntryPos( pActNum->GetLevelCount(), nActNumLvl == USHRT_MAX);
- if(nActNumLvl != USHRT_MAX)
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- aLevelLB.SelectEntryPos( i, TRUE);
- nMask <<= 1 ;
- }
- aRelativeCB.Enable(nActNumLvl != 1);
- aLevelLB.SetUpdateMode(TRUE);
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- InitPosAndSpaceMode();
- ShowControlsDependingOnPosAndSpaceMode();
- // <--
-
- InitControls();
- }
- pPreviewWIN->SetLevel(nActNumLvl);
- pPreviewWIN->Invalidate();
-}
-
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-int SvxNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet)
-{
- if(_pSet)
- FillItemSet(*_pSet);
- return TRUE;
-}
-
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-BOOL SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
-{
- rSet.Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl));
-
- if(bModified && pActNum)
- {
- *pSaveNum = *pActNum;
- rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
- rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, FALSE));
- }
- return bModified;
-}
-
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem;
- //im Draw gibt es das Item als WhichId, im Writer nur als SlotId
- SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem);
- if(eState != SFX_ITEM_SET)
- {
- nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
- eState = rSet.GetItemState(nNumItemId, FALSE, &pItem);
-
- if( eState != SFX_ITEM_SET )
- {
- pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) );
- eState = SFX_ITEM_SET;
- }
-
- }
- DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!");
- delete pSaveNum;
- pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule());
-
- // Ebenen einfuegen
- if(!aLevelLB.GetEntryCount())
- {
- for(USHORT i = 1; i <= pSaveNum->GetLevelCount(); i++)
- aLevelLB.InsertEntry(UniString::CreateFromInt32(i));
- if(pSaveNum->GetLevelCount() > 1)
- {
- String sEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "1 - ") ) );
- sEntry.Append( UniString::CreateFromInt32( pSaveNum->GetLevelCount() ) );
- aLevelLB.InsertEntry(sEntry);
- aLevelLB.SelectEntry(sEntry);
- }
- else
- aLevelLB.SelectEntryPos(0);
- }
- else
- aLevelLB.SelectEntryPos(aLevelLB.GetEntryCount() - 1);
- USHORT nMask = 1;
- aLevelLB.SetUpdateMode(FALSE);
- aLevelLB.SetNoSelection();
- if(nActNumLvl == USHRT_MAX)
- {
- aLevelLB.SelectEntryPos( pSaveNum->GetLevelCount(), TRUE);
- }
- else
- for(USHORT i = 0; i < pSaveNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- aLevelLB.SelectEntryPos( i, TRUE);
- nMask <<= 1;
- }
- aLevelLB.SetUpdateMode(TRUE);
-
- if(!pActNum)
- pActNum = new SvxNumRule(*pSaveNum);
- else if(*pSaveNum != *pActNum)
- *pActNum = *pSaveNum;
- pPreviewWIN->SetNumRule(pActNum);
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- InitPosAndSpaceMode();
- ShowControlsDependingOnPosAndSpaceMode();
-// const BOOL bDraw = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
-// aDistNumFT.Show(bDraw);
-// aDistNumMF.Show(bDraw);
- // <--
-
- InitControls();
- bModified = FALSE;
-}
-
-// --> OD 2008-01-11 #newlistlevelattrs#
-void SvxNumPositionTabPage::InitPosAndSpaceMode()
-{
- if ( pActNum == 0 )
- {
- DBG_ASSERT( false,
- "<SvxNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" );
- return;
- }
-
- SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode =
- SvxNumberFormat::LABEL_ALIGNMENT;
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); ++i )
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
- ePosAndSpaceMode = aNumFmt.GetPositionAndSpaceMode();
- if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
- {
- break;
- }
- }
- nMask <<= 1;
- }
-
- bLabelAlignmentPosAndSpaceModeActive =
- ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT;
-}
-
-void SvxNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
-{
- aDistBorderFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
- aDistBorderMF.Show( !bLabelAlignmentPosAndSpaceModeActive );
- aRelativeCB.Show( !bLabelAlignmentPosAndSpaceModeActive );
- aIndentFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
- aIndentMF.Show( !bLabelAlignmentPosAndSpaceModeActive );
- aDistNumFT.Show( !bLabelAlignmentPosAndSpaceModeActive &&
- pActNum->IsFeatureSupported(NUM_CONTINUOUS) );
- aDistNumMF.Show( !bLabelAlignmentPosAndSpaceModeActive &&
- pActNum->IsFeatureSupported(NUM_CONTINUOUS));
- aAlignFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
- aAlignLB.Show( !bLabelAlignmentPosAndSpaceModeActive );
-
- aLabelFollowedByFT.Show( bLabelAlignmentPosAndSpaceModeActive );
- aLabelFollowedByLB.Show( bLabelAlignmentPosAndSpaceModeActive );
- aListtabFT.Show( bLabelAlignmentPosAndSpaceModeActive );
- aListtabMF.Show( bLabelAlignmentPosAndSpaceModeActive );
- aAlign2FT.Show( bLabelAlignmentPosAndSpaceModeActive );
- aAlign2LB.Show( bLabelAlignmentPosAndSpaceModeActive );
- aAlignedAtFT.Show( bLabelAlignmentPosAndSpaceModeActive );
- aAlignedAtMF.Show( bLabelAlignmentPosAndSpaceModeActive );
- aIndentAtFT.Show( bLabelAlignmentPosAndSpaceModeActive );
- aIndentAtMF.Show( bLabelAlignmentPosAndSpaceModeActive );
-}
-// <--
-
-/*-----------------03.12.97 10:02-------------------
-
---------------------------------------------------*/
-SfxTabPage* SvxNumPositionTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet)
-{
- return new SvxNumPositionTabPage(pParent, rAttrSet);
-}
-
-/*-----------------04.12.97 12:51-------------------
-
---------------------------------------------------*/
-void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric)
-{
- if(eMetric == FUNIT_MM)
- {
- aDistBorderMF .SetDecimalDigits(1);
- aDistNumMF .SetDecimalDigits(1);
- aIndentMF .SetDecimalDigits(1);
- // --> OD 2008-02-18 #newlistlevelattrs#
- aListtabMF.SetDecimalDigits(1);
- aAlignedAtMF.SetDecimalDigits(1);
- aIndentAtMF.SetDecimalDigits(1);
- // <--
- }
- aDistBorderMF .SetUnit( eMetric );
- aDistNumMF .SetUnit( eMetric );
- aIndentMF .SetUnit( eMetric );
- // --> OD 2008-02-18 #newlistlevelattrs#
- aListtabMF.SetUnit( eMetric );
- aAlignedAtMF.SetUnit( eMetric );
- aIndentAtMF.SetUnit( eMetric );
- // <--
-}
-
-/*-----------------03.12.97 11:06-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumPositionTabPage, EditModifyHdl_Impl, Edit *, EMPTYARG )
-{
- USHORT nMask = 1;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- const USHORT nPos = aAlignLB.IsVisible()
- ? aAlignLB.GetSelectEntryPos()
- : aAlign2LB.GetSelectEntryPos();
- // <--
- SvxAdjust eAdjust = SVX_ADJUST_CENTER;
- if(nPos == 0)
- eAdjust = SVX_ADJUST_LEFT;
- else if(nPos == 2)
- eAdjust = SVX_ADJUST_RIGHT;
- aNumFmt.SetNumAdjust( eAdjust );
- pActNum->SetLevel(i, aNumFmt);
- }
- nMask <<= 1;
- }
- SetModified();
- return 0;
-}
-/*-----------------03.12.97 11:11-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox )
-{
- USHORT nSaveNumLvl = nActNumLvl;
- nActNumLvl = 0;
- if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) &&
- (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff))
- {
- nActNumLvl = 0xFFFF;
- pBox->SetUpdateMode(FALSE);
- for( USHORT i = 0; i < pActNum->GetLevelCount(); i++ )
- pBox->SelectEntryPos( i, FALSE );
- pBox->SetUpdateMode(TRUE);
- }
- else if(pBox->GetSelectEntryCount())
- {
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); i++ )
- {
- if(pBox->IsEntryPosSelected( i ))
- nActNumLvl |= nMask;
- nMask <<= 1;
- }
- pBox->SelectEntryPos( pActNum->GetLevelCount(), FALSE );
- }
- else
- {
- nActNumLvl = nSaveNumLvl;
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); i++ )
- {
- if(nActNumLvl & nMask)
- {
- pBox->SelectEntryPos(i);
- break;
- }
- nMask <<=1;
- }
- }
- aRelativeCB.Enable(nActNumLvl != 1);
- SetModified();
- // --> OD 2008-01-15 #newlistlevelattrs#
- InitPosAndSpaceMode();
- ShowControlsDependingOnPosAndSpaceMode();
- // <--
- InitControls();
- return 0;
-}
-/*-----------------03.12.97 12:24-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, MetricField *, pFld )
-{
- if(bInInintControl)
- return 0;
- long nValue = GetCoreValue(*pFld, eCoreUnit);
- USHORT nMask = 1;
-#if OSL_DEBUG_LEVEL > 1
- BOOL bFirst = TRUE;
-#endif
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) );
- if(pFld == &aDistBorderMF)
- {
-
- if(aRelativeCB.IsChecked())
- {
- if(0 == i)
- {
- long nTmp = aNumFmt.GetFirstLineOffset();
- aNumFmt.SetAbsLSpace( USHORT(nValue - nTmp));
- }
- else
- {
- long nTmp = pActNum->GetLevel( i - 1 ).GetAbsLSpace() +
- pActNum->GetLevel( i - 1 ).GetFirstLineOffset() -
- pActNum->GetLevel( i ).GetFirstLineOffset();
-
- aNumFmt.SetAbsLSpace( USHORT(nValue + nTmp));
- }
- }
- else
- {
- aNumFmt.SetAbsLSpace( (short)nValue - aNumFmt.GetFirstLineOffset());
- }
- }
- else if(pFld == &aDistNumMF)
- {
- aNumFmt.SetCharTextDistance( (short)nValue );
- }
- else if(pFld == &aIndentMF)
- {
- //jetzt muss mit dem FirstLineOffset auch der AbsLSpace veraendert werden
- long nDiff = nValue + aNumFmt.GetFirstLineOffset();
- long nAbsLSpace = aNumFmt.GetAbsLSpace();
- aNumFmt.SetAbsLSpace(USHORT(nAbsLSpace + nDiff));
- aNumFmt.SetFirstLineOffset( -(short)nValue );
- }
-
-#if OSL_DEBUG_LEVEL > 1
- if(bFirst)
- lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt);
- bFirst = FALSE;
-#endif
- pActNum->SetLevel( i, aNumFmt );
- }
- nMask <<= 1;
- }
-
- SetModified();
- if(!aDistBorderMF.IsEnabled())
- {
- String aEmptyStr;
- aDistBorderMF.SetText(aEmptyStr);
- }
-
- return 0;
-}
-
-/*-----------------04.12.97 12:35-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumPositionTabPage, RelativeHdl_Impl, CheckBox *, pBox )
-{
- BOOL bOn = pBox->IsChecked();
- BOOL bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 && USHRT_MAX != nActNumLvl;
- BOOL bSetValue = FALSE;
- long nValue = 0;
- if(bOn || bSingleSelection)
- {
- USHORT nMask = 1;
- BOOL bFirst = TRUE;
- bSetValue = TRUE;
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- const SvxNumberFormat &rNumFmt = pActNum->GetLevel(i);
- if(bFirst)
- {
- nValue = rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset();
- if(bOn && i)
- nValue -= (pActNum->GetLevel(i - 1).GetAbsLSpace() + pActNum->GetLevel(i - 1).GetFirstLineOffset());
- }
- else
- bSetValue = nValue ==
- (rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset()) -
- (pActNum->GetLevel(i - 1).GetAbsLSpace() + pActNum->GetLevel(i - 1).GetFirstLineOffset());
- bFirst = FALSE;
- }
- nMask <<= 1;
- }
-
- }
- String aEmptyStr;
- if(bSetValue)
- SetMetricValue(aDistBorderMF, nValue, eCoreUnit);
- else
- aDistBorderMF.SetText(aEmptyStr);
- aDistBorderMF.Enable(bOn || bSingleSelection);
- aDistBorderFT.Enable(bOn || bSingleSelection);
- bLastRelative = bOn;
- return 0;
-}
-
-// --> OD 2008-01-14 #newlistlevelattrs#
-IMPL_LINK( SvxNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG )
-{
- // determine value to be set at the chosen list levels
- SvxNumberFormat::SvxNumLabelFollowedBy eLabelFollowedBy =
- SvxNumberFormat::LISTTAB;
- {
- const USHORT nPos = aLabelFollowedByLB.GetSelectEntryPos();
- if ( nPos == 1 )
- {
- eLabelFollowedBy = SvxNumberFormat::SPACE;
- }
- else if ( nPos == 2 )
- {
- eLabelFollowedBy = SvxNumberFormat::NOTHING;
- }
- }
-
- // set value at the chosen list levels
- bool bSameListtabPos = true;
- USHORT nFirstLvl = USHRT_MAX;
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); ++i )
- {
- if ( nActNumLvl & nMask )
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
- aNumFmt.SetLabelFollowedBy( eLabelFollowedBy );
- pActNum->SetLevel( i, aNumFmt );
-
- if ( nFirstLvl == USHRT_MAX )
- {
- nFirstLvl = i;
- }
- else
- {
- bSameListtabPos &= aNumFmt.GetListtabPos() ==
- pActNum->GetLevel( nFirstLvl ).GetListtabPos();
- }
- }
- nMask <<= 1;
- }
-
- // enable/disable metric field for list tab stop position depending on
- // selected item following the list label.
- aListtabFT.Enable( eLabelFollowedBy == SvxNumberFormat::LISTTAB );
- aListtabMF.Enable( eLabelFollowedBy == SvxNumberFormat::LISTTAB );
- if ( bSameListtabPos && eLabelFollowedBy == SvxNumberFormat::LISTTAB )
- {
- SetMetricValue( aListtabMF, pActNum->GetLevel( nFirstLvl ).GetListtabPos(), eCoreUnit );
- }
- else
- {
- aListtabMF.SetText( String() );
- }
-
- SetModified();
-
- return 0;
-}
-// <--
-
-// --> OD 2008-01-14 #newlistlevelattrs#
-IMPL_LINK( SvxNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld )
-{
- // determine value to be set at the chosen list levels
- const long nValue = GetCoreValue( *pFld, eCoreUnit );
-
- // set value at the chosen list levels
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); ++i )
- {
- if ( nActNumLvl & nMask )
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
- aNumFmt.SetListtabPos( nValue );
- pActNum->SetLevel( i, aNumFmt );
-#if OSL_DEBUG_LEVEL > 1
- lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt);
-#endif
- }
- nMask <<= 1;
- }
-
- SetModified();
-
- return 0;
-}
-// <--
-
-// --> OD 2008-01-14 #newlistlevelattrs#
-IMPL_LINK( SvxNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld )
-{
- // determine value to be set at the chosen list levels
- const long nValue = GetCoreValue( *pFld, eCoreUnit );
-
- // set value at the chosen list levels
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); ++i )
- {
- if ( nActNumLvl & nMask )
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
- const long nFirstLineIndent = nValue - aNumFmt.GetIndentAt();
- aNumFmt.SetFirstLineIndent( nFirstLineIndent );
- pActNum->SetLevel( i, aNumFmt );
-#if OSL_DEBUG_LEVEL > 1
- lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt);
-#endif
- }
- nMask <<= 1;
- }
-
- SetModified();
-
- return 0;
-}
-// <--
-
-// --> OD 2008-01-14 #newlistlevelattrs#
-IMPL_LINK( SvxNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld )
-{
- // determine value to be set at the chosen list levels
- const long nValue = GetCoreValue( *pFld, eCoreUnit );
-
- // set value at the chosen list levels
- USHORT nMask = 1;
- for( USHORT i = 0; i < pActNum->GetLevelCount(); ++i )
- {
- if ( nActNumLvl & nMask )
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
- const long nAlignedAt = aNumFmt.GetIndentAt() +
- aNumFmt.GetFirstLineIndent();
- aNumFmt.SetIndentAt( nValue );
- const long nNewFirstLineIndent = nAlignedAt - nValue;
- aNumFmt.SetFirstLineIndent( nNewFirstLineIndent );
- pActNum->SetLevel( i, aNumFmt );
-#if OSL_DEBUG_LEVEL > 1
- lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt);
-#endif
- }
- nMask <<= 1;
- }
-
- SetModified();
-
- return 0;
-}
-// <--
-/*-----------------05.12.97 15:33-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxNumPositionTabPage, StandardHdl_Impl, PushButton *, EMPTYARG )
-{
- USHORT nMask = 1;
- // --> OD 2008-02-11 #newlistlevelattrs#
- SvxNumRule aTmpNumRule( pActNum->GetFeatureFlags(),
- pActNum->GetLevelCount(),
- pActNum->IsContinuousNumbering(),
- SVX_RULETYPE_NUMBERING,
- pActNum->GetLevel( 0 ).GetPositionAndSpaceMode() );
- // <--
- for(USHORT i = 0; i < pActNum->GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) );
- SvxNumberFormat aTempFmt(aTmpNumRule.GetLevel( i ));
- // --> OD 2008-02-05 #newlistlevelattrs#
- aNumFmt.SetPositionAndSpaceMode( aTempFmt.GetPositionAndSpaceMode() );
- if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- {
- aNumFmt.SetAbsLSpace( aTempFmt.GetAbsLSpace() );
- aNumFmt.SetCharTextDistance( aTempFmt.GetCharTextDistance() );
- aNumFmt.SetFirstLineOffset( aTempFmt.GetFirstLineOffset() );
- }
- else if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
- {
- aNumFmt.SetNumAdjust( aTempFmt.GetNumAdjust() );
- aNumFmt.SetLabelFollowedBy( aTempFmt.GetLabelFollowedBy() );
- aNumFmt.SetListtabPos( aTempFmt.GetListtabPos() );
- aNumFmt.SetFirstLineIndent( aTempFmt.GetFirstLineIndent() );
- aNumFmt.SetIndentAt( aTempFmt.GetIndentAt() );
- }
- // <--
-
- pActNum->SetLevel( i, aNumFmt );
- }
- nMask <<= 1;
- }
-
- InitControls();
- SetModified();
- return 0;
-}
-
-void SvxNumPositionTabPage::SetModified(BOOL bRepaint)
-{
- bModified = TRUE;
- if(bRepaint)
- {
- pPreviewWIN->SetLevel(nActNumLvl);
- pPreviewWIN->Invalidate();
- }
-}
-
-void SvxNumOptionsTabPage::SetModified(BOOL bRepaint)
-{
- bModified = TRUE;
- if(bRepaint)
- {
- pPreviewWIN->SetLevel(nActNumLvl);
- pPreviewWIN->Invalidate();
- }
-}
-
-//Add CHINA001
-void SvxNumOptionsTabPage::PageCreated(SfxAllItemSet aSet)
-{
- SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_CHAR_FMT_LIST_BOX,sal_False);
- SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT,sal_False);
- SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
- SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM,sal_False);
-
- if (pNumCharFmt &&pBulletCharFmt)
- SetCharFmts( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue());
-
- if (pListItem)
- {
- ListBox& myCharFmtLB = GetCharFmtListBox();
- const List *pList = (pListItem)->GetList();
- sal_uInt32 nCount = pList->Count();;
- for(sal_uInt32 i = 0; i < nCount; i++)
- {
- myCharFmtLB.InsertEntry(*(const String*)(pList->GetObject(i)) );
-
- }
- }
- if (pMetricItem)
- SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
-}
-
-//end of add CHINA001
-
-//add CHINA001 begin
-
-void SvxNumPositionTabPage::PageCreated(SfxAllItemSet aSet)
-{
- SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM,sal_False);
-
- if (pMetricItem)
- SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
-}
diff --git a/svx/source/cui/numpages.hrc b/svx/source/cui/numpages.hrc
deleted file mode 100644
index 76cc93c919..0000000000
--- a/svx/source/cui/numpages.hrc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numpages.hrc,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define FT_ALIGN 50
-#define LB_ALIGN 51
-#define FT_DIST_BORDER 52
-#define MF_DIST_BORDER 53
-#define FT_DIST_NUM 54
-#define MF_DIST_NUM 55
-#define GB_POS 56
-
-#define LB_FMT_CHAR 60
-#define FT_FMT_CHAR 61
-
-#define FT_WIDTH 67
-#define FI_URL 68
-#define FT_HEIGHT 70
-
-
-#define MN_STD_NUMBER 120
-#define MD_DEL_NUMBER 121
-#define MN_STD_BULLET 122
-#define MN_DEL_BULLET 123
-
-#define STR_BULLET 200
-//#define STR_NUMFMT_1 201
-//#define STR_NUMFMT_2 202
-//#define STR_NUMFMT_3 203
-//#define STR_NUMFMT_4 204
-//#define STR_NUMFMT_5 205
-//#define STR_NUMFMT_6 206
-//#define STR_NUMFMT_7 207
-//#define STR_NUMFMT_8 208
-//#define STR_NUMFMT_7_HTML 209
-
-#define LB_FORM 210
-#define ED_FORM 211
-#define GB_FORM 212
-
-#define BT_BULLET 213
-
-#define FL_VALUES 220
-#define VS_VALUES 221
-#define ST_CUSTOMIZE 222
-#define FT_ERROR 223
-#define CB_LINKED 224
-
-#define FT_LEVEL 151
-#define LB_LEVEL 152
-#define FL_FORMAT 153
-#define FL_POSITION 154
-#define FT_PREFIX 155
-#define ED_PREFIX 156
-#define FT_FMT 157
-#define LB_FMT 158
-#define FT_SUFFIX 159
-#define ED_SUFFIX 160
-#define FT_BORDERDIST 161
-#define MF_BORDERDIST 162
-#define FT_NUMDIST 163
-#define MF_NUMDIST 164
-#define FT_INDENT 165
-#define MF_INDENT 166
-#define FT_CHARFMT 167
-#define LB_CHARFMT 168
-#define NF_ALL_LEVEL 169
-#define FT_START 170
-#define ED_START 171
-#define FT_BULLET 172
-#define PB_BULLET 173
-#define WIN_PREVIEW 174
-#define FT_BITMAP 175
-#define PB_SEARCH 176
-#define CB_RATIO 177
-#define FT_SIZE 178
-#define MF_WIDTH 179
-#define FT_MULT 180
-#define MF_HEIGHT 181
-#define FT_ORIENT 182
-#define LB_ORIENT 183
-#define MB_BITMAP 184
-#define CB_RELATIVE 185
-#define FT_ALL_LEVEL 186
-#define PB_STANDARD 187
-#define CB_SAME_LEVEL 188
-#define FL_SAME_LEVEL 189
-#define FT_BUL_COLOR 190
-#define LB_BUL_COLOR 191
-#define FT_BUL_REL_SIZE 192
-#define MF_BUL_REL_SIZE 193
-// 194 removed
-#define ST_POPUP_EMPTY_ENTRY 195
-
-#define MN_GRAPHIC_DLG 1
-#define MN_GALLERY 2
-#define MN_GALLERY_ENTRY 100
-
-#define FT_LABEL_FOLLOWED_BY 250
-#define LB_LABEL_FOLLOWED_BY 251
-#define FT_LISTTAB 252
-#define MF_LISTTAB 253
-#define FT_ALIGN_2 254
-#define LB_ALIGN_2 255
-#define FT_ALIGNED_AT 256
-#define MF_ALIGNED_AT 257
-#define FT_INDENT_AT 258
-#define MF_INDENT_AT 259
-
diff --git a/svx/source/cui/numpages.hxx b/svx/source/cui/numpages.hxx
deleted file mode 100644
index d0c00b121f..0000000000
--- a/svx/source/cui/numpages.hxx
+++ /dev/null
@@ -1,472 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numpages.hxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_NUMPAGES_HXX
-#define _SVX_NUMPAGES_HXX
-
-// include ---------------------------------------------------------------
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/group.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/menubtn.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/field.hxx>
-#ifndef _SVX_NUMDEF_HXX
-#include <svx/numdef.hxx>
-#endif
-#include <svtools/ctrlbox.hxx>
-#include <svtools/svarray.hxx>
-
-// -----------------------------------------------------------------------
-class SvxNumRule;
-class SvxBmpNumValueSet;
-class SvxNumValueSet;
-class ValueSet;
-class SvxNumberingPreview;
-class SvxBrushItem;
-
-/*-----------------13.02.97 14.02-------------------
-
---------------------------------------------------*/
-
-struct SvxNumSettings_Impl
-{
- short nNumberType;
- short nParentNumbering;
- rtl::OUString sPrefix;
- rtl::OUString sSuffix;
- rtl::OUString sBulletChar;
- rtl::OUString sBulletFont;
- SvxNumSettings_Impl() :
- nNumberType(0),
- nParentNumbering(0)
- {}
-};
-
-typedef SvxNumSettings_Impl* SvxNumSettings_ImplPtr;
-SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr,8,4)
-
-/*-----------------07.02.97 11.36-------------------
-
---------------------------------------------------*/
-class SvxSingleNumPickTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- FixedLine aValuesFL;
- SvxNumValueSet* pExamplesVS;
- SvxNumSettingsArr_Impl aNumSettingsArr;
- SvxNumRule* pActNum;
- SvxNumRule* pSaveNum;
- USHORT nActNumLvl;
- BOOL bModified : 1;
- BOOL bPreset : 1;
-
- String sNumCharFmtName;
- USHORT nNumItemId;
-
- protected:
- DECL_LINK( NumSelectHdl_Impl, ValueSet*);
- DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
-
- public:
- SvxSingleNumPickTabPage(Window* pParent,
- const SfxItemSet& rSet);
- ~SvxSingleNumPickTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet *pSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void SetNumCharFmtName(const String& rName){sNumCharFmtName = rName;}
-};
-
-/*-----------------07.02.97 11.36-------------------
-
---------------------------------------------------*/
-
-class SvxBulletPickTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- FixedLine aValuesFL;
- SvxNumValueSet* pExamplesVS;
- SvxNumRule* pActNum;
- SvxNumRule* pSaveNum;
- USHORT nActNumLvl;
- BOOL bModified : 1;
- BOOL bPreset : 1;
- USHORT nNumItemId;
-
- String sBulletCharFmtName;
- protected:
- DECL_LINK(NumSelectHdl_Impl, ValueSet*);
- DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
- public:
- SvxBulletPickTabPage(Window* pParent,
- const SfxItemSet& rSet);
- ~SvxBulletPickTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet *pSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void SetCharFmtName(const String& rName){sBulletCharFmtName = rName;}
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-/*-----------------07.02.97 11.36-------------------
- TabPage fuer vollstaendig Numerierung
---------------------------------------------------*/
-#define NUMTYPE_MEMBER 4 // Anzahl der Elemente des FormatStrings je Ebene
-#define NUM_VALUSET_COUNT 16
-class SvxNumPickTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- FixedLine aValuesFL;
- SvxNumValueSet* pExamplesVS;
- String sNumCharFmtName;
- String sBulletCharFmtName;
-
- SvxNumSettingsArr_Impl aNumSettingsArrays[NUM_VALUSET_COUNT]; // wird mit den fuenf Formaten initialisiert
-
- SvxNumRule* pActNum;
- SvxNumRule* pSaveNum;
- USHORT nActNumLvl;
- USHORT nNumItemId;
- BOOL bModified : 1;
- BOOL bPreset : 1;
-
-
- protected:
- DECL_LINK(NumSelectHdl_Impl, ValueSet*);
- DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
-
- public:
- SvxNumPickTabPage(Window* pParent,
- const SfxItemSet& rSet);
- ~SvxNumPickTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet *pSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void SetCharFmtNames(const String& rCharName, const String& rBulName)
- { sNumCharFmtName = rCharName;
- sBulletCharFmtName = rBulName;}
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-/*-----------------12.02.97 07.42-------------------
-
---------------------------------------------------*/
-class SvxBitmapPickTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- FixedLine aValuesFL;
- SvxBmpNumValueSet* pExamplesVS;
- FixedText aErrorText;
- CheckBox aLinkedCB;
-
- List aGrfNames;
- String sNumCharFmtName;
-
- SvxNumRule* pActNum;
- SvxNumRule* pSaveNum;
- USHORT nActNumLvl;
- USHORT nNumItemId;
- SfxMapUnit eCoreUnit;
- BOOL bModified : 1;
- BOOL bPreset : 1;
-
- protected:
- DECL_LINK( NumSelectHdl_Impl, ValueSet*);
- DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
- DECL_LINK( LinkBmpHdl_Impl, CheckBox* );
-
- public:
- SvxBitmapPickTabPage(Window* pParent,
- const SfxItemSet& rSet);
- ~SvxBitmapPickTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet *pSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void SetNumCharFmtName(const String& rName){sNumCharFmtName = rName;}
-};
-
-/*-----------------01.12.97 16:13-------------------
-
---------------------------------------------------*/
-class SvxNumOptionsTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- FixedLine aFormatFL;
- FixedText aLevelFT;
- MultiListBox aLevelLB;
-
- FixedText aFmtFT;
- ListBox aFmtLB;
- FixedText aPrefixFT;
- Edit aPrefixED;
- FixedText aSuffixFT;
- Edit aSuffixED;
- FixedText aCharFmtFT;
- ListBox aCharFmtLB;
- FixedText aBulColorFT;
- ColorListBox aBulColLB;
- FixedText aBulRelSizeFT;
- MetricField aBulRelSizeMF;
- FixedText aAllLevelFT;
- NumericField aAllLevelNF;
- FixedText aStartFT;
- NumericField aStartED;
- PushButton aBulletPB;
- FixedText aAlignFT;
- ListBox aAlignLB;
- FixedText aBitmapFT;
- MenuButton aBitmapMB;
- FixedText aSizeFT;
- MetricField aWidthMF;
- FixedText aMultFT;
- MetricField aHeightMF;
- CheckBox aRatioCB;
- FixedText aOrientFT;
- ListBox aOrientLB;
-
- FixedLine aSameLevelFL;
- CheckBox aSameLevelCB;
-
- String sNumCharFmtName;
- String sBulletCharFmtName;
-
- Timer aInvalidateTimer;
-
- SvxNumberingPreview* pPreviewWIN;
-
- SvxNumRule* pActNum;
- SvxNumRule* pSaveNum;
-
- Size aInitSize[SVX_MAX_NUM];
-
- BOOL bLastWidthModified : 1;
- BOOL bModified : 1;
- BOOL bPreset : 1;
- BOOL bAutomaticCharStyles: 1;
- BOOL bHTMLMode : 1;
- BOOL bMenuButtonInitialized : 1;
-
- List aGrfNames;
- Font aActBulletFont;
- String sBullet;
- String sStartWith;
-
- BYTE nBullet;
- USHORT nActNumLvl;
- USHORT nNumItemId;
- SfxMapUnit eCoreUnit;
-
- void InitControls();
- void SwitchNumberType( BYTE nType, BOOL bBmp = FALSE );
- void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
-
- DECL_LINK( NumberTypeSelectHdl_Impl, ListBox * );
- DECL_LINK( LevelHdl_Impl, ListBox * );
- DECL_LINK( PopupActivateHdl_Impl, Menu * );
- DECL_LINK( GraphicHdl_Impl, MenuButton * );
- DECL_LINK( BulletHdl_Impl, Button * );
- DECL_LINK( SizeHdl_Impl, MetricField * );
- DECL_LINK( RatioHdl_Impl, CheckBox * );
- DECL_LINK( CharFmtHdl_Impl, ListBox * );
- DECL_LINK( EditModifyHdl_Impl, Edit * );
- DECL_LINK( AllLevelHdl_Impl, NumericField * );
- DECL_LINK( OrientHdl_Impl, ListBox * );
- DECL_LINK( SameLevelHdl_Impl, CheckBox * );
- DECL_LINK( BulColorHdl_Impl, ColorListBox* );
- DECL_LINK( BulRelSizeHdl_Impl, MetricField *);
- DECL_LINK( PreviewInvalidateHdl_Impl, Timer* );
-
- DECL_STATIC_LINK( SvxNumOptionsTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
-
- public:
- SvxNumOptionsTabPage(Window* pParent,
- const SfxItemSet& rSet);
- ~SvxNumOptionsTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet *pSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
-//??? void SetWrtShell(SwWrtShell* pSh);
- void SetCharFmts(const String& rNumName, const String& rBulletName )
- {
- sNumCharFmtName = rNumName;
- sBulletCharFmtName = rBulletName;
- }
- void SetMetric(FieldUnit eSet);
-
- ListBox& GetCharFmtListBox() {return aCharFmtLB;}
- void SetModified(BOOL bRepaint = TRUE);
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-/*-----------------03.12.97 10:18-------------------
-
---------------------------------------------------*/
-class SvxNumPositionTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- FixedLine aPositionFL;
- FixedText aLevelFT;
- MultiListBox aLevelLB;
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- // former set of controls shown for numbering rules containing list level
- // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
- FixedText aDistBorderFT;
- MetricField aDistBorderMF;
- CheckBox aRelativeCB;
- FixedText aIndentFT;
- MetricField aIndentMF;
- FixedText aDistNumFT;
- MetricField aDistNumMF;
- FixedText aAlignFT;
- ListBox aAlignLB;
- // <--
-
- // --> OD 2008-01-10 #newlistlevelattrs#
- // new set of controls shown for numbering rules containing list level
- // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
- FixedText aLabelFollowedByFT;
- ListBox aLabelFollowedByLB;
- FixedText aListtabFT;
- MetricField aListtabMF;
- FixedText aAlign2FT;
- ListBox aAlign2LB;
- FixedText aAlignedAtFT;
- MetricField aAlignedAtMF;
- FixedText aIndentAtFT;
- MetricField aIndentAtMF;
- // <--
-
- PushButton aStandardPB;
-
-#if OSL_DEBUG_LEVEL > 1
- FixedText* pDebugFixedText;
-#endif
- SvxNumberingPreview* pPreviewWIN;
-
- SvxNumRule* pActNum;
- SvxNumRule* pSaveNum;
-
- USHORT nActNumLvl;
- USHORT nNumItemId;
- SfxMapUnit eCoreUnit;
-
- BOOL bModified : 1;
- BOOL bPreset : 1;
- BOOL bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein
- // --> OD 2008-01-11 #newlistlevelattrs#
- bool bLabelAlignmentPosAndSpaceModeActive;
- // <--
-
- void InitControls();
-
- DECL_LINK( LevelHdl_Impl, ListBox * );
- DECL_LINK( EditModifyHdl_Impl, Edit*);
- DECL_LINK( DistanceHdl_Impl, MetricField * );
- DECL_LINK( RelativeHdl_Impl, CheckBox * );
- DECL_LINK( StandardHdl_Impl, PushButton * );
-
- // --> OD 2008-01-11 #newlistlevelattrs#
- void InitPosAndSpaceMode();
- void ShowControlsDependingOnPosAndSpaceMode();
-
- DECL_LINK( LabelFollowedByHdl_Impl, ListBox* );
- DECL_LINK( ListtabPosHdl_Impl, MetricField* );
- DECL_LINK( AlignAtHdl_Impl, MetricField* );
- DECL_LINK( IndentAtHdl_Impl, MetricField* );
- // <--
-
-public:
- SvxNumPositionTabPage(Window* pParent,
- const SfxItemSet& rSet);
- ~SvxNumPositionTabPage();
-
- virtual void ActivatePage(const SfxItemSet& rSet);
- virtual int DeactivatePage(SfxItemSet *pSet);
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet);
-
- void SetMetric(FieldUnit eSet);
- void SetModified(BOOL bRepaint = TRUE);
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-#endif
-
-
-
-
diff --git a/svx/source/cui/numpages.src b/svx/source/cui/numpages.src
deleted file mode 100644
index 9c6206045d..0000000000
--- a/svx/source/cui/numpages.src
+++ /dev/null
@@ -1,910 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: numpages.src,v $
- * $Revision: 1.64.242.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-#include <helpid.hrc>
-#include <numpages.hrc>
-
-/**************************************************************************/
-/* */
-/* TabPage */
-/* */
-/**************************************************************************/
-TabPage RID_SVXPAGE_PICK_BULLET
-{
- HelpID = HID_SVXPAGE_PICK_BULLET ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- FixedLine FL_VALUES
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
- Control VS_VALUES
- {
- Pos = MAP_APPFONT ( 9 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 167 ) ;
- TabStop = TRUE ;
- };
-};
-/**************************************************************************/
-/* */
-/* TabPage */
-/* */
-/**************************************************************************/
-TabPage RID_SVXPAGE_PICK_SINGLE_NUM
-{
- HelpID = HID_SVXPAGE_PICK_SINGLE_NUM ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- FixedLine FL_VALUES
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
- Control VS_VALUES
- {
- Pos = MAP_APPFONT ( 9 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 167 ) ;
- TabStop = TRUE ;
- };
-};
-/**************************************************************************/
-/* */
-/* TabPage */
-/* */
-/**************************************************************************/
-TabPage RID_SVXPAGE_PICK_NUM
-{
- HelpID = HID_SVXPAGE_PICK_NUM;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- FixedLine FL_VALUES
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
- Control VS_VALUES
- {
- Pos = MAP_APPFONT ( 9 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 167 ) ;
- TabStop = TRUE ;
- };
-};
-/**************************************************************************/
-/* */
-/* TabPage */
-/* */
-/**************************************************************************/
-TabPage RID_SVXPAGE_PICK_BMP
-{
- HelpID = HID_SVXPAGE_PICK_BMP;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- FixedLine FL_VALUES
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
- Control VS_VALUES
- {
- Pos = MAP_APPFONT ( 9 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 152 ) ;
- TabStop = TRUE ;
- Hide = TRUE ;
- };
- CheckBox CB_LINKED
- {
- Pos = MAP_APPFONT ( 9 , 169 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Link graphics";
- };
- FixedText FT_ERROR
- {
- Pos = MAP_APPFONT ( 9 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 30 ) ;
- Text [ en-US ] = "The Gallery theme 'Bullets' is empty (no graphics)." ;
- Hide = TRUE ;
- WordBreak = TRUE ;
- };
-};
-/**************************************************************************/
-/* */
-/* TabPage Numerierungsoptionen */
-/* */
-/**************************************************************************/
-TabPage RID_SVXPAGE_NUM_OPTIONS
-{
- HelpID = HID_SVXPAGE_NUM_OPTIONS ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- FixedText FT_LEVEL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Level" ;
- };
- MultiListBox LB_LEVEL
- {
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 26 , 154 ) ;
- TabStop = TRUE ;
- DropDown = FALSE ;
- Border = TRUE ;
- SimpleMode = TRUE ;
- };
- FixedLine FL_FORMAT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Format" ;
- };
- FixedText FT_FMT
- {
- Pos = MAP_APPFONT ( 50 , 27 ) ;
- Size = MAP_APPFONT ( 50, 8 ) ;
- Text [ en-US ] = "~Numbering" ;
- };
- ListBox LB_FMT
- {
- Pos = MAP_APPFONT ( 103 , 25 ) ;
- Size = MAP_APPFONT ( 67 , 72 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- CurPos = 0 ;
- StringList [ en-US ] =
- {
- < "1, 2, 3, ... " ; 4/*SVX_NUM_ARABIC */; > ;
- < "A, B, C, ... " ; 0/*SVX_NUM_CHARS_UPPER_LETTER */; > ;
- < "a, b, c, ..." ; 1/*SVX_NUM_CHARS_LOWER_LETTER */; > ;
- < "I, II, III, ... " ; 2/*SVX_NUM_ROMAN_UPPER */; > ;
- < "i, ii, iii, ... " ; 3/*SVX_NUM_ROMAN_LOWER */; > ;
- < "A, .., AA, .., AAA, ... " ; 9/*SVX_NUM_CHARS_UPPER_LETTER_N*/; > ;
- < "a, .., aa, .., aaa, ..." ; 10/*SVX_NUM_CHARS_LOWER_LETTER_N*/; > ;
- < "Bullet" ; 6/*SVX_NUM_CHAR_SPECIAL */; > ;
- < "Graphics" ; 8/*SVX_NUM_BITMAP */; > ;
- < "Linked graphics" ; 0x88/*SVX_NUM_BITMAP|0x80 */; > ;
- < "None" ; 5/*SVX_NUM_NUMBER_NONE */; > ;
- < "Native Numbering" ; 12 /*NATIVE_NUMBERING */; > ;
- < "Ð, Б, .., Ðа, Ðб, ... (Bulgarian)" ; 38 /*CHARS_CYRILLIC_UPPER_LETTER_BG */; > ;
- < "а, б, .., аа, аб, ... (Bulgarian)" ; 39 /*CHARS_CYRILLIC_LOWER_LETTER_BG */; > ;
- < "Ð, Б, .., Ðа, Бб, ... (Bulgarian)" ; 40 /*CHARS_CYRILLIC_UPPER_LETTER_N_BG */; > ;
- < "а, б, .., аа, бб, ... (Bulgarian)" ; 41 /*CHARS_CYRILLIC_LOWER_LETTER_N_BG */; > ;
- < "Ð, Б, .., Ðа, Ðб, ... (Russian)" ; 42 /*CHARS_CYRILLIC_UPPER_LETTER_RU */; > ;
- < "а, б, .., аа, аб, ... (Russian)" ; 43 /*CHARS_CYRILLIC_LOWER_LETTER_RU */; > ;
- < "Ð, Б, .., Ðа, Бб, ... (Russian)" ; 44 /*CHARS_CYRILLIC_UPPER_LETTER_N_RU */; > ;
- < "а, б, .., аа, бб, ... (Russian)" ; 45 /*CHARS_CYRILLIC_LOWER_LETTER_N_RU */; > ;
- < "Ð, Б, .., Ðа, Ðб, ... (Serbian)" ; 48 /*CHARS_CYRILLIC_UPPER_LETTER_SR */; > ;
- < "а, б, .., аа, аб, ... (Serbian)" ; 49 /*CHARS_CYRILLIC_LOWER_LETTER_SR */; > ;
- < "Ð, Б, .., Ðа, Бб, ... (Serbian)" ; 50 /*CHARS_CYRILLIC_UPPER_LETTER_N_SR */; > ;
- < "а, б, .., аа, бб, ... (Serbian)" ; 51 /*CHARS_CYRILLIC_LOWER_LETTER_N_SR */; > ;
-
- };
- };
- FixedText FT_PREFIX
- {
- Pos = MAP_APPFONT ( 50 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Before" ;
- Left = TRUE ;
- };
- Edit ED_PREFIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 41 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- MaxTextLength = 50 ;
- };
- FixedText FT_SUFFIX
- {
- Pos = MAP_APPFONT ( 50 , 59 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "After" ;
- Left = TRUE ;
- };
- Edit ED_SUFFIX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 57 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- MaxTextLength = 50 ;
- };
- FixedText FT_CHARFMT
- {
- Pos = MAP_APPFONT ( 50 , 75 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Character Style" ;
- };
- ListBox LB_CHARFMT
- {
- TabStop = TRUE ;
- DropDown = TRUE ;
- Pos = MAP_APPFONT ( 103 , 73 ) ;
- Size = MAP_APPFONT ( 67 , 72 ) ;
- };
- FixedText FT_BUL_COLOR
- {
- Pos = MAP_APPFONT ( 50 , 75 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Hide = TRUE;
- Text [ en-US ] = "Color";
- };
- ListBox LB_BUL_COLOR
- {
- TabStop = TRUE ;
- DropDown = TRUE ;
- Pos = MAP_APPFONT ( 103 , 73 ) ;
- Size = MAP_APPFONT ( 67 , 100 ) ;
- Hide = TRUE;
- };
- FixedText FT_BUL_REL_SIZE
- {
- Pos = MAP_APPFONT ( 50 , 91 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Hide = TRUE;
- Text [ en-US ] = "~Relative size";
- };
- MetricField MF_BUL_REL_SIZE
- {
- Pos = MAP_APPFONT ( 103 , 89 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- Border = TRUE ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- SpinSize = 1 ;
- Minimum = 1;
- Maximum = 250;
- Hide = TRUE;
- };
- FixedText FT_ALL_LEVEL
- {
- Pos = MAP_APPFONT ( 50 , 91 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Show sublevels" ;
- };
- NumericField NF_ALL_LEVEL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 89 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 10 ;
- Value = 1 ;
- First = 1 ;
- Last = 10 ;
- };
- FixedText FT_START
- {
- Pos = MAP_APPFONT ( 50 , 107 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Start at" ;
- Left = TRUE ;
- };
- NumericField ED_START
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 105 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 65535 ;
- Value = 1 ;
- First = 0 ;
- Last = 65535 ;
- };
- FixedText FT_ALIGN
- {
- Pos = MAP_APPFONT ( 50 , 135 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Alignment" ;
- Hide = TRUE;
- };
- ListBox LB_ALIGN
- {
- Pos = MAP_APPFONT ( 103 , 133 ) ;
- Size = MAP_APPFONT ( 40 , 40 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Hide = TRUE;
- StringList [ en-US ] =
- {
- < "Left" ; > ;
- < "Centered" ; > ;
- < "Right" ; > ;
- };
- };
- String STR_BULLET
- {
- Text [ en-US ] = "Character" ;
- };
- PushButton PB_BULLET
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 103 , 105 ) ;
- Size = MAP_APPFONT ( 12 , 12 ) ;
- Text = "..." ;
- TabStop = TRUE ;
- };
- FixedText FT_BITMAP
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 50 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Graphics" ;
- };
- MenuButton MB_BITMAP
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 103 , 41 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- ButtonMenu = Menu
- {
- ItemList =
- {
- MenuItem
- {
- Identifier = MN_GRAPHIC_DLG ;
- // HelpID = HID_NUM_NAMED_NUMS ;
- Text [ en-US ] = "From file..." ;
- };
- MenuItem
- {
- Identifier = MN_GALLERY ;
- Text [ en-US ] = "Gallery";
- };
- };
- };
- Text [ en-US ] = "Select..." ;
- };
- FixedText FT_SIZE
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 50 , 61 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MF_WIDTH
- {
- Pos = MAP_APPFONT ( 103 , 59 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Hide = TRUE ;
- };
- FixedText FT_MULT
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 50 , 77 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Height" ;
- };
- MetricField MF_HEIGHT
- {
- Pos = MAP_APPFONT ( 103 , 75 ) ;
- Size = MAP_APPFONT ( 67 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Hide = TRUE ;
- };
- CheckBox CB_RATIO
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 50 , 91 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- Text [ en-US ] = "Keep ratio" ;
- };
- FixedText FT_ORIENT
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 50 , 105 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Alignment" ;
- };
- ListBox LB_ORIENT
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 103 , 103 ) ;
- Size = MAP_APPFONT ( 67 , 72 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- CurPos = 0 ;
- StringList [ en-US ] =
- {
- < "Top of baseline" ; > ;
- < "Center of baseline" ; > ;
- < "Bottom of baseline" ; > ;
- < "Top of character" ; > ;
- < "Center of character" ; > ;
- < "Bottom of character" ; > ;
- < "Top of line" ; > ;
- < "Center of line" ; > ;
- < "Bottom of line" ; > ;
- };
- };
- FixedLine FL_SAME_LEVEL
- {
- Pos = MAP_APPFONT ( 47 , 156 ) ;
- Size = MAP_APPFONT ( 126 , 8 ) ;
- Text [ en-US ] = "All levels" ;
- };
- CheckBox CB_SAME_LEVEL
- {
- Pos = MAP_APPFONT ( 53 , 167 ) ;
- Size = MAP_APPFONT ( 114 , 10 ) ;
- Text [ en-US ] = "~Consecutive numbering" ;
- };
- Window WIN_PREVIEW
- {
- Pos = MAP_APPFONT ( 179 , 25 ) ;
- Size = MAP_APPFONT ( 69 , 154 ) ;
- Border = TRUE ;
- };
- String ST_POPUP_EMPTY_ENTRY
- {
- Text [ en-US ] = "There are no graphics in the 'Bullets' Gallery theme.";
- };
-
-};
-/**************************************************************************/
-/* */
-/* TabPage Positionen */
-/* */
-/**************************************************************************/
-TabPage RID_SVXPAGE_NUM_POSITION
-{
- HelpID = HID_SVXPAGE_NUM_POSITION ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- FixedText FT_LEVEL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 50, 8 ) ;
- Text [ en-US ] = "Level" ;
- };
- MultiListBox LB_LEVEL
- {
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 26 , 154 ) ;
- TabStop = TRUE ;
- DropDown = FALSE ;
- Border = TRUE ;
- SimpleMode = TRUE ;
- };
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Group = TRUE ;
- Text [ en-US ] = "Position and spacing" ;
- };
- FixedText FT_BORDERDIST
- {
- Pos = MAP_APPFONT ( 50 , 27 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Indent" ;
- };
- MetricField MF_BORDERDIST
- {
- Pos = MAP_APPFONT ( 198 , 25 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -1999 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- };
- CheckBox CB_RELATIVE
- {
- Pos = MAP_APPFONT ( 198 , 41 ) ;
- Size = MAP_APPFONT ( 52 , 10 ) ;
- Text [ en-US ] = "Relati~ve" ;
- };
- FixedText FT_INDENT
- {
- Pos = MAP_APPFONT ( 50 , 59 ) ;
- Size = MAP_APPFONT ( 105 , 8 ) ;
- Text [ en-US ] = "Width of numbering" ;
- };
- MetricField MF_INDENT
- {
- Pos = MAP_APPFONT ( 198 , 57 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- };
- FixedText FT_NUMDIST
- {
- Pos = MAP_APPFONT ( 50 , 75 ) ;
- Size = MAP_APPFONT ( 105 , 8 ) ;
- Text [ en-US ] = "Minimum space numbering <-> text" ;
- };
- MetricField MF_NUMDIST
- {
- Pos = MAP_APPFONT ( 198 , 73 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_ALIGN
- {
- Pos = MAP_APPFONT ( 50 , 91 ) ;
- Size = MAP_APPFONT ( 105 , 8 ) ;
- Text [ en-US ] = "N~umbering alignment" ;
- };
- ListBox LB_ALIGN
- {
- Pos = MAP_APPFONT ( 198 , 89 ) ;
- Size = MAP_APPFONT ( 40 , 40 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Left" ; > ;
- < "Centered" ; > ;
- < "Right" ; > ;
- };
- };
- FixedText FT_LABEL_FOLLOWED_BY
- {
- Pos = MAP_APPFONT ( 50 , 27 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "Numbering followed by" ;
- };
- ListBox LB_LABEL_FOLLOWED_BY
- {
- Pos = MAP_APPFONT ( 198 , 25 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Tab stop" ; > ;
- < "Space" ; > ;
- < "Nothing" ; > ;
- };
- };
- FixedText FT_LISTTAB
- {
- Pos = MAP_APPFONT ( 50 , 43 ) ;
- Size = MAP_APPFONT ( 143 , 10 ) ;
- Right = TRUE ;
- Text [ en-US ] = "at" ;
- };
- MetricField MF_LISTTAB
- {
- Pos = MAP_APPFONT ( 198 , 41 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- };
- FixedText FT_ALIGN_2
- {
- Pos = MAP_APPFONT ( 50 , 59 ) ;
- Size = MAP_APPFONT ( 105 , 8 ) ;
- };
- ListBox LB_ALIGN_2
- {
- Pos = MAP_APPFONT ( 198 , 57 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_ALIGNED_AT
- {
- Pos = MAP_APPFONT ( 50 , 75 ) ;
- Size = MAP_APPFONT ( 105 , 8 ) ;
- Text [ en-US ] = "Aligned at" ;
- };
- MetricField MF_ALIGNED_AT
- {
- Pos = MAP_APPFONT ( 198 , 73 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -1999 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_INDENT_AT
- {
- Pos = MAP_APPFONT ( 50 , 91 ) ;
- Size = MAP_APPFONT ( 105 , 8 ) ;
- Text [ en-US ] = "Indent at" ;
- };
- MetricField MF_INDENT_AT
- {
- Pos = MAP_APPFONT ( 198 , 89 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -1999 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_STANDARD
- {
- Pos = MAP_APPFONT ( 198 , 165 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "Default" ;
- };
- Window WIN_PREVIEW
- {
- Pos = MAP_APPFONT ( 50 , 113 ) ;
- Size = MAP_APPFONT ( 143 , 67 ) ;
- Border = TRUE ;
- };
-};
-
-String RID_STR_EDIT_GRAPHIC
-{
- Text [ en-US ] = "Link" ;
-};
-String RID_STR_FULLNUMS_1 { Text = "1.|1.1|a)|61589|61589" ; };
-String RID_STR_FULLNUMS_2 { Text = "1.|a)|61589|61589|61589" ; };
-String RID_STR_FULLNUMS_3 { Text = "1.|(a)|i.|A.|61589" ; };
-String RID_STR_FULLNUMS_4 { Text = "1.|1.|1.|1.|1." ; };
-String RID_STR_FULLNUMS_5 { Text = "I.|A.|i.|a)|61589" ; };
-String RID_STR_FULLNUMS_6 { Text = "A.|I.|a.|i.|61589" ; };
-String RID_STR_FULLNUMS_7 { Text = "1|1.1|1.1.1|1.1.1.1|1.1.1.1.1" ; };
-String RID_STR_FULLNUMS_8 { Text = "61487|61488|61485|61589|61589" ; };
-String RID_STR_FULLNUMS_7_HTML { Text = "I.|I.|I|I.|I." ; };
-
-String RID_SVXSTR_BULLET_DESCRIPTION_0
-{
- Text [en-US] = "Solid small circular bullets";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_1
-{
- Text [en-US] = "Solid large circular bullets";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_2
-{
- Text [en-US] = "Solid diamond bullets";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_3
-{
- Text [en-US] = "Solid large square bullets";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_4
-{
- Text [en-US] = "Right pointing arrow bullets filled out";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_5
-{
- Text [en-US] = "Right pointing arrow bullets";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_6
-{
- Text [en-US] = "Check mark bullets";
-};
-String RID_SVXSTR_BULLET_DESCRIPTION_7
-{
- Text [en-US] = "Tick mark bullets";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_0
-{
- Text [en-US] = "Number 1) 2) 3)";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_1
-{
- Text [en-US] = "Number 1. 2. 3.";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_2
-{
- Text [en-US] = "Number (1) (2) (3)";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_3
-{
- Text [en-US] = "Uppercase Roman number I. II. III.";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_4
-{
- Text [en-US] = "Uppercase letter A) B) C)";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_5
-{
- Text [en-US] = "Lowercase letter a) b) c)";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_6
-{
- Text [en-US] = "Lowercase letter (a) (b) (c)";
-};
-String RID_SVXSTR_SINGLENUM_DESCRIPTION_7
-{
- Text [en-US] = "Lowercase Roman number i. ii. iii.";
-};
-
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_0
-{
- Text [en-US] = "Numeric, numeric, lowercase letters, solid small circular bullet";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_1
-{
- Text [en-US] = "Numeric, lowercase letters, solid small circular bullet";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_2
-{
- Text [en-US] = "Numeric, lowercase letters, lowercase Roman, uppercase letters, solid small circular bullet";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_3
-{
- Text [en-US] = "Numeric";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_4
-{
- Text [en-US] = "Uppercase Roman, uppercase letters, lowercase Roman, lowercase letters, solid small circular bullet";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_5
-{
- Text [en-US] = "Uppercase letters, uppercase Roman, lowercase letters, lowercase Roman, solid small circular bullet";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_6
-{
- Text [en-US] = "Numeric with all sublevels";
-};
-String RID_SVXSTR_OUTLINENUM_DESCRIPTION_7
-{
- Text [en-US] = "Right pointing bullet, right pointing arrow bullet, solid diamond bullet, solid small circular bullet";
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/optHeaderTabListbox.cxx b/svx/source/cui/optHeaderTabListbox.cxx
deleted file mode 100644
index e7cc607a61..0000000000
--- a/svx/source/cui/optHeaderTabListbox.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optHeaderTabListbox.cxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "optHeaderTabListbox.hxx"
-#include <vcl/svapp.hxx>
-#include <svtools/headbar.hxx>
-
-
-namespace svx
-{
-// class OptLBoxString_Impl ----------------------------------------------
-
-class OptLBoxString_Impl : public SvLBoxString
-{
-public:
- OptLBoxString_Impl( SvLBoxEntry* pEntry, USHORT nFlags, const String& rTxt ) :
- SvLBoxString( pEntry, nFlags, rTxt ) {}
-
- virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, SvLBoxEntry* pEntry );
-};
-
-// -----------------------------------------------------------------------
-
-void OptLBoxString_Impl::Paint( const Point& rPos, SvLBox& rDev, USHORT, SvLBoxEntry* pEntry )
-{
- Font aOldFont( rDev.GetFont() );
- Font aFont( aOldFont );
- //detect readonly state by asking for a valid Image
- if(pEntry && !(!((OptHeaderTabListBox&)rDev).GetCollapsedEntryBmp(pEntry)))
- aFont.SetColor( Application::GetSettings().GetStyleSettings().GetDeactiveTextColor() );
- rDev.SetFont( aFont );
- rDev.DrawText( rPos, GetText() );
- rDev.SetFont( aOldFont );
-}
-// -----------------------------------------------------------------------------
-
-OptHeaderTabListBox::OptHeaderTabListBox( Window* pParent, WinBits nWinStyle ) :
-
- SvHeaderTabListBox( pParent, nWinStyle )
-{
-}
-
-// -----------------------------------------------------------------------
-void OptHeaderTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rTxt,
- const Image& rImg1, const Image& rImg2,
- SvLBoxButtonKind eButtonKind )
-{
- SvTabListBox::InitEntry( pEntry, rTxt, rImg1, rImg2, eButtonKind );
- USHORT _nTabCount = TabCount();
-
- for ( USHORT nCol = 1; nCol < _nTabCount; ++nCol )
- {
- // alle Spalten mit eigener Klasse initialisieren (Spalte 0 == Bitmap)
- SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nCol );
- OptLBoxString_Impl* pStr = new OptLBoxString_Impl( pEntry, 0, pCol->GetText() );
- pEntry->ReplaceItem( pStr, nCol );
- }
-}
-
-} // namespace svx
diff --git a/svx/source/cui/optHeaderTabListbox.hxx b/svx/source/cui/optHeaderTabListbox.hxx
deleted file mode 100644
index 98288257ca..0000000000
--- a/svx/source/cui/optHeaderTabListbox.hxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optHeaderTabListbox.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SVX_OPTHEADERTABLISTBOX_HXX
-#define SVX_OPTHEADERTABLISTBOX_HXX
-
-#include <svtools/svtabbx.hxx>
-
-namespace svx
-{
- // class OptHeaderTabListBox ---------------------------------------------
-
- class OptHeaderTabListBox : public SvHeaderTabListBox
- {
- public:
- OptHeaderTabListBox( Window* pParent, WinBits nBits );
-
- virtual void InitEntry( SvLBoxEntry*, const XubString&, const Image&, const Image&, SvLBoxButtonKind );
- };
-} // svx
-#endif // SVX_OPTHEADERTABLISTBOX_HXX
-
diff --git a/svx/source/cui/optaccessibility.cxx b/svx/source/cui/optaccessibility.cxx
deleted file mode 100644
index d815959bbf..0000000000
--- a/svx/source/cui/optaccessibility.cxx
+++ /dev/null
@@ -1,191 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optaccessibility.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <optaccessibility.hxx>
-#include <optaccessibility.hrc>
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-#include <svtools/accessibilityoptions.hxx>
-#include <vcl/settings.hxx>
-#include <vcl/svapp.hxx>
-
-static void MovePosY( Window& _rWin, long _nDelta )
-{
- Point aPoint = _rWin.GetPosPixel();
- aPoint.Y() += _nDelta;
-
- _rWin.SetPosPixel( aPoint );
-}
-
-struct SvxAccessibilityOptionsTabPage_Impl
-{
- SvtAccessibilityOptions m_aConfig;
- SvxAccessibilityOptionsTabPage_Impl()
- : m_aConfig(){}
-};
-
-SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage( Window* pParent, const SfxItemSet& rSet )
- :SfxTabPage(pParent, SVX_RES( RID_SVXPAGE_ACCESSIBILITYCONFIG ), rSet)
- ,m_aMiscellaneousLabel (this, SVX_RES(FL_MISCELLANEOUS ))
- ,m_aAccessibilityTool (this, SVX_RES(CB_ACCESSIBILITY_TOOL ))
- ,m_aTextSelectionInReadonly (this, SVX_RES(CB_TEXTSELECTION ))
- ,m_aAnimatedGraphics (this, SVX_RES(CB_ANIMATED_GRAPHICS ))
- ,m_aAnimatedTexts (this, SVX_RES(CB_ANIMATED_TEXTS ))
- ,m_aTipHelpCB (this, SVX_RES(CB_TIPHELP ))
- ,m_aTipHelpNF (this, SVX_RES(NF_TIPHELP ))
- ,m_aTipHelpFT (this, SVX_RES(FT_TIPHELP ))
- ,m_aHCOptionsLabel (this, SVX_RES(FL_HC_OPTIONS ))
- ,m_aAutoDetectHC (this, SVX_RES(CB_AUTO_DETECT_HC ))
- ,m_aAutomaticFontColor (this, SVX_RES(CB_AUTOMATIC_FONT_COLOR))
- ,m_aPagePreviews (this, SVX_RES(CB_PAGE_PREVIEWS ))
- ,m_pImpl(new SvxAccessibilityOptionsTabPage_Impl)
-{
- FreeResource();
- m_aTipHelpCB.SetClickHdl(LINK(this, SvxAccessibilityOptionsTabPage, TipHelpHdl));
-
- long nHeightDelta = 0; // to correct positions _under_ m_aAccessibilityTool
-
-#ifdef UNX
- {
- // UNIX: read the gconf2 setting instead to use the checkbox
- m_aAccessibilityTool.Hide();
- nHeightDelta = -( ROWA_2 - ROWA_1 );
- }
-#else
- // calculate the height of the checkbox. Do we need two (default in resource) or only one line
- String aText = m_aAccessibilityTool.GetText();
- long nWidth = m_aAccessibilityTool.GetTextWidth( aText );
- long nCtrlWidth = m_aAccessibilityTool.GetSizePixel().Width() - ( COL2 - COL1 );
- if ( nWidth > nCtrlWidth )
- {
- long nDelta = 2 * RSC_CD_FIXEDLINE_HEIGHT + LINESPACE - RSC_CD_CHECKBOX_HEIGHT;
- nHeightDelta = nDelta;
- Size aSize = m_aAccessibilityTool.LogicToPixel( Size( 0, nDelta ), MAP_APPFONT );
- nDelta = aSize.Height();
- aSize = m_aAccessibilityTool.GetSizePixel();
- aSize.Height() += nDelta;
- m_aAccessibilityTool.SetSizePixel( aSize );
- }
-#endif
-
- if( nHeightDelta )
- { //adjust positions of controls under m_aAccessibilityTool
- Size aSize = m_aAccessibilityTool.LogicToPixel( Size( 0, nHeightDelta ), MAP_APPFONT );
- nHeightDelta = aSize.Height();
-
- MovePosY( m_aTextSelectionInReadonly, nHeightDelta );
- MovePosY( m_aAnimatedGraphics, nHeightDelta );
- MovePosY( m_aAnimatedTexts, nHeightDelta );
- MovePosY( m_aTipHelpCB, nHeightDelta );
- MovePosY( m_aTipHelpNF, nHeightDelta );
- MovePosY( m_aTipHelpFT, nHeightDelta );
- MovePosY( m_aHCOptionsLabel, nHeightDelta );
- MovePosY( m_aAutoDetectHC, nHeightDelta );
- MovePosY( m_aAutomaticFontColor, nHeightDelta );
- MovePosY( m_aPagePreviews, nHeightDelta );
- }
-}
-
-SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage()
-{
- delete m_pImpl;
-}
-
-SfxTabPage* SvxAccessibilityOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxAccessibilityOptionsTabPage(pParent, rAttrSet);
-}
-
-BOOL SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet& )
-{
- //aConfig.Set... from controls
-
- m_pImpl->m_aConfig.SetIsForPagePreviews( m_aPagePreviews.IsChecked() );
- m_pImpl->m_aConfig.SetIsHelpTipsDisappear( m_aTipHelpCB.IsChecked() );
- m_pImpl->m_aConfig.SetHelpTipSeconds( (short)m_aTipHelpNF.GetValue() );
- m_pImpl->m_aConfig.SetIsAllowAnimatedGraphics( m_aAnimatedGraphics.IsChecked() );
- m_pImpl->m_aConfig.SetIsAllowAnimatedText( m_aAnimatedTexts.IsChecked() );
- m_pImpl->m_aConfig.SetIsAutomaticFontColor( m_aAutomaticFontColor.IsChecked() );
- m_pImpl->m_aConfig.SetSelectionInReadonly( m_aTextSelectionInReadonly.IsChecked());
- m_pImpl->m_aConfig.SetAutoDetectSystemHC( m_aAutoDetectHC.IsChecked());
-
- if(m_pImpl->m_aConfig.IsModified())
- m_pImpl->m_aConfig.Commit();
-
- AllSettings aAllSettings = Application::GetSettings();
- MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
-#ifndef UNX
- aMiscSettings.SetEnableATToolSupport( m_aAccessibilityTool.IsChecked() );
-#endif
- aAllSettings.SetMiscSettings(aMiscSettings);
- Application::MergeSystemSettings( aAllSettings );
- Application::SetSettings(aAllSettings);
-
- return FALSE;
-}
-
-void SvxAccessibilityOptionsTabPage::Reset( const SfxItemSet& )
-{
- //set controls from aConfig.Get...
-
- m_aPagePreviews.Check( m_pImpl->m_aConfig.GetIsForPagePreviews() );
- EnableTipHelp( m_pImpl->m_aConfig.GetIsHelpTipsDisappear() );
- m_aTipHelpNF.SetValue( m_pImpl->m_aConfig.GetHelpTipSeconds() );
- m_aAnimatedGraphics.Check( m_pImpl->m_aConfig.GetIsAllowAnimatedGraphics() );
- m_aAnimatedTexts.Check( m_pImpl->m_aConfig.GetIsAllowAnimatedText() );
- m_aAutomaticFontColor.Check( m_pImpl->m_aConfig.GetIsAutomaticFontColor() );
-// m_aSystemFont.Check( m_pImpl->m_aConfig.GetIsSystemFont() );
- m_aTextSelectionInReadonly.Check( m_pImpl->m_aConfig.IsSelectionInReadonly() );
- m_aAutoDetectHC.Check( m_pImpl->m_aConfig.GetAutoDetectSystemHC() );
-
-
- AllSettings aAllSettings = Application::GetSettings();
- MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
- m_aAccessibilityTool.Check( aMiscSettings.GetEnableATToolSupport() );
-}
-
-IMPL_LINK(SvxAccessibilityOptionsTabPage, TipHelpHdl, CheckBox*, pBox)
-{
- sal_Bool bChecked = pBox->IsChecked();
- m_aTipHelpNF.Enable(bChecked);
- return 0;
-}
-
-void SvxAccessibilityOptionsTabPage::EnableTipHelp(sal_Bool bCheck)
-{
- m_aTipHelpCB.Check(bCheck);
- m_aTipHelpNF.Enable(bCheck);
-}
diff --git a/svx/source/cui/optaccessibility.hxx b/svx/source/cui/optaccessibility.hxx
deleted file mode 100644
index 037bbaacd9..0000000000
--- a/svx/source/cui/optaccessibility.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optaccessibility.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTACCESSIBILITY_HXX
-#define _SVX_OPTACCESSIBILITY_HXX
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-struct SvxAccessibilityOptionsTabPage_Impl;
-class SvxAccessibilityOptionsTabPage : public SfxTabPage
-{
- FixedLine m_aMiscellaneousLabel; // FL_MISCELLANEOUS
- CheckBox m_aAccessibilityTool; // CB_ACCESSIBILITY_TOOL
- CheckBox m_aTextSelectionInReadonly; // CB_TEXTSELECTION
- CheckBox m_aAnimatedGraphics; // CB_ANIMATED_GRAPHICS
- CheckBox m_aAnimatedTexts; // CB_ANIMATED_TEXTS
- CheckBox m_aTipHelpCB; // CB_TIPHELP
- NumericField m_aTipHelpNF; // NF_TIPHELP
- FixedText m_aTipHelpFT; // FT_TIPHELP
- FixedLine m_aHCOptionsLabel; // FL_HC_OPTIONS
- CheckBox m_aAutoDetectHC; // CB_AUTO_DETECT_HC
- CheckBox m_aAutomaticFontColor; // CB_AUTOMATIC_FONT_COLOR
- CheckBox m_aPagePreviews; // CB_PAGEPREVIEWS
-
- DECL_LINK(TipHelpHdl, CheckBox*);
- void EnableTipHelp(sal_Bool bCheck);
-
- SvxAccessibilityOptionsTabPage_Impl* m_pImpl;
-
- SvxAccessibilityOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
-public:
-
- virtual ~SvxAccessibilityOptionsTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-#endif
-
diff --git a/svx/source/cui/optasian.cxx b/svx/source/cui/optasian.cxx
deleted file mode 100644
index 82ada7f5a4..0000000000
--- a/svx/source/cui/optasian.cxx
+++ /dev/null
@@ -1,475 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optasian.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <optasian.hxx>
-#include <svx/langitem.hxx>
-#include <unolingu.hxx>
-#include <optasian.hrc>
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-#ifndef _TABLE_HXX //autogen
-#include <tools/table.hxx>
-#endif
-#include <tools/shl.hxx>
-#include <asiancfg.hxx>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/svapp.hxx>
-#include <comphelper/processfactory.hxx>
-#include <unotools/localedatawrapper.hxx>
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::i18n;
-using namespace com::sun::star::frame;
-using namespace com::sun::star::beans;
-using rtl::OUString;
-
-#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
-
-const sal_Char cIsKernAsianPunctuation[] = "IsKernAsianPunctuation";
-const sal_Char cCharacterCompressionType[] = "CharacterCompressionType";
-
-struct SvxForbiddenChars_Impl
-{
- sal_Bool bRemoved;
- ForbiddenCharacters* pCharacters;
-};
-
-DECLARE_TABLE( _SvxForbiddenCharacterTable_Impl, SvxForbiddenChars_Impl* )
-
-class SvxForbiddenCharacterTable_Impl : public _SvxForbiddenCharacterTable_Impl
-{
-public:
- SvxForbiddenCharacterTable_Impl()
- : _SvxForbiddenCharacterTable_Impl( 4, 4 )
- {}
- ~SvxForbiddenCharacterTable_Impl();
-};
-
-struct SvxAsianLayoutPage_Impl
-{
- SvxAsianConfig aConfig;
- SvxAsianLayoutPage_Impl() :
- aConfig(sal_False){}
-
- Reference< XForbiddenCharacters > xForbidden;
- Reference< XPropertySet > xPrSet;
- Reference< XPropertySetInfo > xPrSetInfo;
- SvxForbiddenCharacterTable_Impl aChangedLanguagesTbl;
-
- sal_Bool hasForbiddenCharacters(LanguageType eLang);
- SvxForbiddenChars_Impl* getForbiddenCharacters(LanguageType eLang);
- void addForbiddenCharacters(LanguageType eLang, ForbiddenCharacters* pForbidden);
-};
-/* -----------------------------24.01.01 14:50--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxForbiddenCharacterTable_Impl::~SvxForbiddenCharacterTable_Impl()
-{
- for( SvxForbiddenChars_Impl* pDel = First(); pDel; pDel = Next() )
- {
- delete pDel->pCharacters;
- delete pDel;
- }
-}
-/* -----------------------------24.01.01 14:50--------------------------------
-
- ---------------------------------------------------------------------------*/
-sal_Bool SvxAsianLayoutPage_Impl::hasForbiddenCharacters(LanguageType eLang)
-{
- return 0 != aChangedLanguagesTbl.Get(eLang);
-}
-/* -----------------------------24.01.01 14:50--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxForbiddenChars_Impl* SvxAsianLayoutPage_Impl::getForbiddenCharacters(LanguageType eLang)
-{
- SvxForbiddenChars_Impl* pImp = aChangedLanguagesTbl.Get(eLang);
- DBG_ASSERT(pImp, "language not available");
- if(pImp)
- return pImp;
- return 0;
-}
-/* -----------------------------24.01.01 14:50--------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxAsianLayoutPage_Impl::addForbiddenCharacters(
- LanguageType eLang, ForbiddenCharacters* pForbidden)
-{
- SvxForbiddenChars_Impl* pOld = aChangedLanguagesTbl.Get(eLang);
- if( !pOld )
- {
- pOld = new SvxForbiddenChars_Impl;
- pOld->bRemoved = 0 == pForbidden;
- pOld->pCharacters = pForbidden ? new ForbiddenCharacters(*pForbidden) : 0;
- aChangedLanguagesTbl.Insert( eLang, pOld );
- }
- else
- {
- pOld->bRemoved = 0 == pForbidden;
- delete pOld->pCharacters;
- pOld->pCharacters = pForbidden ? new ForbiddenCharacters(*pForbidden) : 0;
- }
-
-}
-/*-- 09.01.01 13:29:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-static LanguageType eLastUsedLanguageTypeForForbiddenCharacters = USHRT_MAX;
-
-SvxAsianLayoutPage::SvxAsianLayoutPage( Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES( RID_SVXPAGE_ASIAN_LAYOUT ), rSet),
- aKerningGB( this, SVX_RES(GB_KERNING )),
- aCharKerningRB( this, SVX_RES(RB_CHAR_KERNING )),
- aCharPunctKerningRB( this, SVX_RES(RB_CHAR_PUNCT )),
- aCharDistGB( this, SVX_RES(GB_CHAR_DIST )),
- aNoCompressionRB( this, SVX_RES(RB_NO_COMP )),
- aPunctCompressionRB( this, SVX_RES(RB_PUNCT_COMP )),
- aPunctKanaCompressionRB(this, SVX_RES(RB_PUNCT_KANA_COMP )),
- aStartEndGB( this, SVX_RES(GB_START_END )),
- aLanguageFT( this, SVX_RES(FT_LANGUAGE )),
- aLanguageLB( this, SVX_RES(LB_LANGUAGE )),
- aStandardCB( this, SVX_RES(CB_STANDARD )),
- aStartFT( this, SVX_RES(FT_START )),
- aStartED( this, SVX_RES(ED_START )),
- aEndFT( this, SVX_RES(FT_END )),
- aEndED( this, SVX_RES(ED_END )),
- aHintFT( this, SVX_RES(FT_HINT )),
- pImpl(new SvxAsianLayoutPage_Impl)
-{
- FreeResource();
- LanguageHdl(&aLanguageLB);
- aLanguageLB.SetSelectHdl(LINK(this, SvxAsianLayoutPage, LanguageHdl));
- aStandardCB.SetClickHdl(LINK(this, SvxAsianLayoutPage, ChangeStandardHdl));
- Link aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl));
- aStartED.SetModifyHdl(aLk);
- aEndED.SetModifyHdl(aLk);
-
- aLanguageLB.SetLanguageList( LANG_LIST_FBD_CHARS, FALSE, FALSE );
-}
-/*-- 09.01.01 13:29:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SvxAsianLayoutPage::~SvxAsianLayoutPage()
-{
- delete pImpl;
-}
-/*-- 09.01.01 13:29:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SfxTabPage* SvxAsianLayoutPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxAsianLayoutPage(pParent, rAttrSet);
-}
-/*-- 09.01.01 13:29:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-BOOL SvxAsianLayoutPage::FillItemSet( SfxItemSet& )
-{
- if(aCharKerningRB.IsChecked() != aCharKerningRB.GetSavedValue())
- {
- pImpl->aConfig.SetKerningWesternTextOnly(aCharKerningRB.IsChecked());
- OUString sPunct(C2U(cIsKernAsianPunctuation));
- if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sPunct))
- {
- Any aVal;
- BOOL bVal = !aCharKerningRB.IsChecked();
- aVal.setValue(&bVal, ::getBooleanCppuType());
- pImpl->xPrSet->setPropertyValue(sPunct, aVal);
- }
- }
-
- if(aNoCompressionRB.IsChecked() != aNoCompressionRB.GetSavedValue() ||
- aPunctCompressionRB.IsChecked() != aPunctCompressionRB.GetSavedValue())
- {
- sal_Int16 nSet = aNoCompressionRB.IsChecked() ? 0 :
- aPunctCompressionRB.IsChecked() ? 1 : 2;
- pImpl->aConfig.SetCharDistanceCompression(nSet);
- OUString sCompress(C2U(cCharacterCompressionType));
- if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sCompress))
- {
- Any aVal;
- aVal <<= nSet;
- pImpl->xPrSet->setPropertyValue(sCompress, aVal);
- }
- }
- if(pImpl->aConfig.IsModified())
- pImpl->aConfig.Commit();
- if(pImpl->xForbidden.is())
- {
- try
- {
- for( SvxForbiddenChars_Impl* pElem = pImpl->aChangedLanguagesTbl.First();
- pElem; pElem = pImpl->aChangedLanguagesTbl.Next() )
- {
- ULONG nLang = pImpl->aChangedLanguagesTbl.GetKey( pElem );
- Locale aLocale;
- SvxLanguageToLocale(aLocale, (USHORT)nLang );
- if(pElem->bRemoved)
- pImpl->xForbidden->removeForbiddenCharacters( aLocale );
- else if(pElem->pCharacters)
- pImpl->xForbidden->setForbiddenCharacters( aLocale, *pElem->pCharacters );
- }
- }
- catch(Exception&)
- {
- DBG_ERROR("exception in XForbiddenCharacters");
- }
- }
- eLastUsedLanguageTypeForForbiddenCharacters = aLanguageLB.GetSelectLanguage();
-
- return FALSE;
-}
-/*-- 09.01.01 13:29:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxAsianLayoutPage::Reset( const SfxItemSet& )
-{
- SfxViewFrame* pCurFrm = SfxViewFrame::Current();
- SfxObjectShell* pDocSh = pCurFrm ? pCurFrm->GetObjectShell() : 0;
- Reference< XModel > xModel;
- if(pDocSh)
- xModel = pDocSh->GetModel();
- Reference<XMultiServiceFactory> xFact(xModel, UNO_QUERY);
- if(xFact.is())
- {
- pImpl->xPrSet = Reference<XPropertySet>(
- xFact->createInstance(C2U("com.sun.star.document.Settings")), UNO_QUERY);
- }
- if( pImpl->xPrSet.is() )
- pImpl->xPrSetInfo = pImpl->xPrSet->getPropertySetInfo();
- OUString sForbidden(C2U("ForbiddenCharacters"));
- sal_Bool bKernWesternText = pImpl->aConfig.IsKerningWesternTextOnly();
- sal_Int16 nCompress = pImpl->aConfig.GetCharDistanceCompression();
- if(pImpl->xPrSetInfo.is())
- {
- if(pImpl->xPrSetInfo->hasPropertyByName(sForbidden))
- {
- Any aForbidden = pImpl->xPrSet->getPropertyValue(sForbidden);
- aForbidden >>= pImpl->xForbidden;
- }
- OUString sCompress(C2U(cCharacterCompressionType));
- if(pImpl->xPrSetInfo->hasPropertyByName(sCompress))
- {
- Any aVal = pImpl->xPrSet->getPropertyValue(sCompress);
- aVal >>= nCompress;
- }
- OUString sPunct(C2U(cIsKernAsianPunctuation));
- if(pImpl->xPrSetInfo->hasPropertyByName(sPunct))
- {
- Any aVal = pImpl->xPrSet->getPropertyValue(sPunct);
- bKernWesternText = !*(sal_Bool*)aVal.getValue();
- }
- }
- else
- {
- aStartEndGB.Enable(FALSE);
- aLanguageFT.Enable(FALSE);
- aLanguageLB.Enable(FALSE);
- aStandardCB.Enable(FALSE);
- aStartFT.Enable(FALSE);
- aStartED.Enable(FALSE);
- aEndFT.Enable(FALSE);
- aEndED.Enable(FALSE);
- aHintFT.Enable(FALSE);
- }
- if(bKernWesternText)
- aCharKerningRB.Check(TRUE);
- else
- aCharPunctKerningRB.Check(TRUE);
- switch(nCompress)
- {
- case 0 : aNoCompressionRB.Check(); break;
- case 1 : aPunctCompressionRB.Check(); break;
- default: aPunctKanaCompressionRB.Check();
- }
- aCharKerningRB.SaveValue();
- aNoCompressionRB.SaveValue();
- aPunctCompressionRB.SaveValue();
- aPunctKanaCompressionRB.SaveValue();
-
- aLanguageLB.SelectEntryPos(0);
- //preselect the system language in the box - if available
- if(USHRT_MAX == eLastUsedLanguageTypeForForbiddenCharacters)
- {
- eLastUsedLanguageTypeForForbiddenCharacters = SvxLocaleToLanguage(
- Application::GetSettings().GetLocale() );
- switch(eLastUsedLanguageTypeForForbiddenCharacters)
- {
- case LANGUAGE_CHINESE :
- case LANGUAGE_CHINESE_SINGAPORE :
- eLastUsedLanguageTypeForForbiddenCharacters = LANGUAGE_CHINESE_SIMPLIFIED;
- break;
- case LANGUAGE_CHINESE_HONGKONG :
- case LANGUAGE_CHINESE_MACAU :
- eLastUsedLanguageTypeForForbiddenCharacters = LANGUAGE_CHINESE_TRADITIONAL;
- break;
- }
- }
- aLanguageLB.SelectLanguage( eLastUsedLanguageTypeForForbiddenCharacters );
- LanguageHdl(&aLanguageLB);
-}
-/* -----------------------------17.01.01 11:02--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxAsianLayoutPage, LanguageHdl, SvxLanguageBox*, EMPTYARG )
-{
- //set current value
- Locale aLocale;
- LanguageType eSelectLanguage = aLanguageLB.GetSelectLanguage();
- SvxLanguageToLocale(aLocale, eSelectLanguage );
-
- OUString sStart, sEnd;
- sal_Bool bAvail;
- if(pImpl->xForbidden.is())
- {
- bAvail = pImpl->hasForbiddenCharacters(eSelectLanguage);
- if(bAvail)
- {
- SvxForbiddenChars_Impl* pElement = pImpl->getForbiddenCharacters(eSelectLanguage);
- if(pElement->bRemoved || !pElement->pCharacters)
- {
- bAvail = FALSE;
- }
- else
- {
- sStart = pElement->pCharacters->beginLine;
- sEnd = pElement->pCharacters->endLine;
- }
- }
- else
- {
- try
- {
- bAvail = pImpl->xForbidden->hasForbiddenCharacters(aLocale);
- if(bAvail)
- {
- ForbiddenCharacters aForbidden = pImpl->xForbidden->getForbiddenCharacters( aLocale );
- sStart = aForbidden.beginLine;
- sEnd = aForbidden.endLine;
- }
- }
- catch(Exception&)
- {
- DBG_ERROR("exception in XForbiddenCharacters");
- }
- }
- }
- else
- {
- bAvail = pImpl->aConfig.GetStartEndChars( aLocale, sStart, sEnd );
- }
- if(!bAvail)
- {
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- LocaleDataWrapper aWrap( xMSF, aLocale );
- ForbiddenCharacters aForbidden = aWrap.getForbiddenCharacters();
- sStart = aForbidden.beginLine;
- sEnd = aForbidden.endLine;
- }
- aStandardCB.Check(!bAvail);
- aStartED.Enable(bAvail);
- aEndED.Enable(bAvail);
- aStartFT.Enable(bAvail);
- aEndFT.Enable(bAvail);
- aStartED.SetText(sStart);
- aEndED.SetText(sEnd);
-
- return 0;
-}
-/* -----------------------------17.01.01 11:02--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxAsianLayoutPage, ChangeStandardHdl, CheckBox*, pBox)
-{
- sal_Bool bCheck = pBox->IsChecked();
- aStartED.Enable(!bCheck);
- aEndED.Enable(!bCheck);
- aStartFT.Enable(!bCheck);
- aEndFT.Enable(!bCheck);
-
- ModifyHdl(&aStartED);
- return 0;
-}
-/* -----------------------------17.01.01 12:26--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, Edit*, pEdit)
-{
- Locale aLocale;
- LanguageType eSelectLanguage = aLanguageLB.GetSelectLanguage();
- SvxLanguageToLocale(aLocale, eSelectLanguage );
- OUString sStart = aStartED.GetText();
- OUString sEnd = aEndED.GetText();
- sal_Bool bEnable = pEdit->IsEnabled();
- if(pImpl->xForbidden.is())
- {
- try
- {
- if(bEnable)
- {
- ForbiddenCharacters aSet;
- aSet.beginLine = sStart;
- aSet.endLine = sEnd;
-// pImpl->xForbidden->setForbiddenCharacters( aLocale, aSet );
- pImpl->addForbiddenCharacters(eSelectLanguage, &aSet);
- }
- else
- pImpl->addForbiddenCharacters(eSelectLanguage, 0);
-// pImpl->xForbidden->removeForbiddenCharacters( aLocale );
- }
- catch(Exception&)
- {
- DBG_ERROR("exception in XForbiddenCharacters");
- }
- }
- pImpl->aConfig.SetStartEndChars( aLocale, bEnable ? &sStart : 0, bEnable ? &sEnd : 0);
- return 0;
-}
-/*-- 07.09.2007 12:05:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT* SvxAsianLayoutPage::GetRanges()
-{
- //no items are used
- static USHORT pAsianLayoutRanges[] = { 0 };
- return pAsianLayoutRanges;
-}
diff --git a/svx/source/cui/optasian.hxx b/svx/source/cui/optasian.hxx
deleted file mode 100644
index d3fc760ea0..0000000000
--- a/svx/source/cui/optasian.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optasian.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTASIAN_HXX
-#define _SVX_OPTASIAN_HXX
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/group.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/edit.hxx>
-#include <svx/langbox.hxx>
-struct SvxAsianLayoutPage_Impl;
-class SvxAsianLayoutPage : public SfxTabPage
-{
- FixedLine aKerningGB;
- RadioButton aCharKerningRB;
- RadioButton aCharPunctKerningRB;
-
- FixedLine aCharDistGB;
- RadioButton aNoCompressionRB;
- RadioButton aPunctCompressionRB;
- RadioButton aPunctKanaCompressionRB;
-
- FixedLine aStartEndGB;
-
- FixedText aLanguageFT;
- SvxLanguageBox aLanguageLB;
- CheckBox aStandardCB;
-
- FixedText aStartFT;
- Edit aStartED;
- FixedText aEndFT;
- Edit aEndED;
- FixedText aHintFT;
-
- SvxAsianLayoutPage_Impl* pImpl;
-
- DECL_LINK(LanguageHdl, SvxLanguageBox*);
- DECL_LINK(ChangeStandardHdl, CheckBox*);
- DECL_LINK(ModifyHdl, Edit*);
-
- SvxAsianLayoutPage( Window* pParent, const SfxItemSet& rSet );
-public:
-
- virtual ~SvxAsianLayoutPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- static UINT16* GetRanges();
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-#endif
-
diff --git a/svx/source/cui/optchart.cxx b/svx/source/cui/optchart.cxx
deleted file mode 100644
index 9e6322155a..0000000000
--- a/svx/source/cui/optchart.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optchart.cxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <svtools/pathoptions.hxx>
-
-#include <svx/dialogs.hrc>
-
-#include "optchart.hxx"
-#include "optchart.hrc"
-#include <svx/dialmgr.hxx>
-
-// ====================
-// class ChartColorLB
-// ====================
-void ChartColorLB::FillBox( const SvxChartColorTable & rTab )
-{
- long nCount = rTab.size();
- SetUpdateMode( FALSE );
-
- for( long i = 0; i < nCount; i++ )
- {
- Append( const_cast< XColorEntry * >( & rTab[ i ] ));
- }
- SetUpdateMode( TRUE );
-}
-
-
-// ====================
-// class SvxDefaultColorOptPage
-// ====================
-SvxDefaultColorOptPage::SvxDefaultColorOptPage( Window* pParent, const SfxItemSet& rInAttrs ) :
-
- SfxTabPage( pParent, SVX_RES( RID_OPTPAGE_CHART_DEFCOLORS ), rInAttrs ),
-
- aGbChartColors ( this, SVX_RES( FL_CHART_COLOR_LIST ) ),
- aLbChartColors ( this, SVX_RES( LB_CHART_COLOR_LIST ) ),
- aGbColorBox ( this, SVX_RES( FL_COLOR_BOX ) ),
- aValSetColorBox ( this, SVX_RES( CT_COLOR_BOX ) ),
- aPBDefault ( this, SVX_RES( PB_RESET_TO_DEFAULT ) )
-{
- FreeResource();
-
- aPBDefault.SetClickHdl( LINK( this, SvxDefaultColorOptPage, ResetToDefaults ) );
- aLbChartColors.SetSelectHdl( LINK( this, SvxDefaultColorOptPage, ListClickedHdl ) );
- aValSetColorBox.SetSelectHdl( LINK( this, SvxDefaultColorOptPage, BoxClickedHdl ) );
-
- aValSetColorBox.SetStyle( aValSetColorBox.GetStyle()
- | WB_VSCROLL | WB_ITEMBORDER | WB_NAMEFIELD );
- aValSetColorBox.SetColCount( 8 );
- aValSetColorBox.SetLineCount( 12 );
- aValSetColorBox.SetExtraSpacing( 0 );
- aValSetColorBox.Show();
-
- pChartOptions = new SvxChartOptions;
- pColorTab = new XColorTable( SvtPathOptions().GetPalettePath() );
-
- const SfxPoolItem* pItem = NULL;
- if ( rInAttrs.GetItemState( SID_SCH_EDITOPTIONS, FALSE, &pItem ) == SFX_ITEM_SET )
- {
- pColorConfig = SAL_STATIC_CAST( SvxChartColorTableItem*, pItem->Clone() );
- }
- else
- {
- SvxChartColorTable aTable;
- aTable.useDefault();
- pColorConfig = new SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aTable );
- pColorConfig->SetOptions( pChartOptions );
- }
-
- Construct();
-}
-
-SvxDefaultColorOptPage::~SvxDefaultColorOptPage()
-{
- // save changes
- pChartOptions->SetDefaultColors( pColorConfig->GetColorTable() );
- pChartOptions->Commit();
-
- delete pColorConfig;
- delete pColorTab;
- delete pChartOptions;
-}
-
-void SvxDefaultColorOptPage::Construct()
-{
- if( pColorConfig )
- aLbChartColors.FillBox( pColorConfig->GetColorTable() );
-
- FillColorBox();
-
- aLbChartColors.SelectEntryPos( 0 );
- ListClickedHdl( &aLbChartColors );
-}
-
-
-SfxTabPage* __EXPORT SvxDefaultColorOptPage::Create( Window* pParent, const SfxItemSet& rAttrs )
-{
- return new SvxDefaultColorOptPage( pParent, rAttrs );
-}
-
-BOOL __EXPORT SvxDefaultColorOptPage::FillItemSet( SfxItemSet& rOutAttrs )
-{
- if( pColorConfig )
- rOutAttrs.Put( *SAL_STATIC_CAST( SfxPoolItem*, pColorConfig ));
-
- return TRUE;
-}
-
-void __EXPORT SvxDefaultColorOptPage::Reset( const SfxItemSet& )
-{
- aLbChartColors.SelectEntryPos( 0 );
- ListClickedHdl( &aLbChartColors );
-}
-
-void SvxDefaultColorOptPage::FillColorBox()
-{
- if( !pColorTab ) return;
-
- long nCount = pColorTab->Count();
- XColorEntry* pColorEntry;
-
- for( long i = 0; i < nCount; i++ )
- {
- pColorEntry = pColorTab->GetColor( i );
- aValSetColorBox.InsertItem( (USHORT) i + 1, pColorEntry->GetColor(), pColorEntry->GetName() );
- }
-}
-
-
-long SvxDefaultColorOptPage::GetColorIndex( const Color& rCol )
-{
- if( pColorTab )
- {
- long nCount = pColorTab->Count();
- XColorEntry* pColorEntry;
-
- for( long i = nCount - 1; i >= 0; i-- ) // default chart colors are at the end of the table
- {
- pColorEntry = pColorTab->GetColor( i );
- if( pColorEntry && pColorEntry->GetColor() == rCol )
- return SAL_STATIC_CAST( XPropertyTable*, pColorTab )->Get( pColorEntry->GetName() );
- }
- }
- return -1L;
-}
-
-
-
-// --------------------
-// event handlers
-// --------------------
-
-// ResetToDefaults
-// ---------------
-
-IMPL_LINK( SvxDefaultColorOptPage, ResetToDefaults, void *, EMPTYARG )
-{
- if( pColorConfig )
- {
- pColorConfig->GetColorTable().useDefault();
-
- aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorTable() );
-
- aLbChartColors.GetFocus();
- }
-
- return 0L;
-}
-
-// ListClickedHdl
-// --------------
-
-IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ChartColorLB*, pColorList )
-{
- Color aCol = pColorList->GetSelectEntryColor();
-
- long nIndex = GetColorIndex( aCol );
-
- if( nIndex == -1 ) // not found
- {
- aValSetColorBox.SetNoSelection();
- }
- else
- {
- aValSetColorBox.SelectItem( (USHORT)nIndex + 1 ); // ValueSet is 1-based
- }
-
- return 0L;
-}
-
-// BoxClickedHdl
-// -------------
-
-IMPL_LINK( SvxDefaultColorOptPage, BoxClickedHdl, ValueSet*, EMPTYARG )
-{
- USHORT nIdx = aLbChartColors.GetSelectEntryPos();
- if( nIdx != LISTBOX_ENTRY_NOTFOUND )
- {
- XColorEntry aEntry( aValSetColorBox.GetItemColor( aValSetColorBox.GetSelectItemId() ),
- aLbChartColors.GetSelectEntry() );
-
- aLbChartColors.Modify( & aEntry, nIdx );
- pColorConfig->ReplaceColorByIndex( nIdx, aEntry );
-
- aLbChartColors.SelectEntryPos( nIdx ); // reselect entry
- }
-
- return 0L;
-}
-
diff --git a/svx/source/cui/optchart.hxx b/svx/source/cui/optchart.hxx
deleted file mode 100644
index 16496cdb02..0000000000
--- a/svx/source/cui/optchart.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optchart.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_OPTCHART_HXX
-#define _SVX_OPTCHART_HXX
-
-// header for SfxTabPage
-#include <sfx2/tabdlg.hxx>
-#include <vcl/fixed.hxx>
-// header for ValueSet
-#include <svtools/valueset.hxx>
-// header for ColorLB
-#include <svx/dlgctrl.hxx>
-// header for PushButton
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-// header for XColorTable
-#include <svx/xtable.hxx>
-
-#include "cfgchart.hxx"
-
-class ChartColorLB : public ColorLB
-{
-public:
- ChartColorLB( Window* pParent, ResId Id ) : ColorLB( pParent, Id ) {}
- ChartColorLB( Window* pParent, WinBits aWB ) : ColorLB( pParent, aWB ) {}
-
- void FillBox( const SvxChartColorTable & rTab );
-};
-
-
-class SvxDefaultColorOptPage : public SfxTabPage
-{
-private:
- FixedLine aGbChartColors;
- ChartColorLB aLbChartColors;
- FixedLine aGbColorBox;
- ValueSet aValSetColorBox;
- PushButton aPBDefault;
-
- SvxChartOptions* pChartOptions;
- SvxChartColorTableItem* pColorConfig;
- XColorTable* pColorTab;
-
- DECL_LINK( ResetToDefaults, void * );
- DECL_LINK( ListClickedHdl, ChartColorLB * );
- DECL_LINK( BoxClickedHdl, ValueSet * );
-
- void FillColorBox();
- long GetColorIndex( const Color& rCol );
-
-public:
- SvxDefaultColorOptPage( Window* pParent, const SfxItemSet& rInAttrs );
- virtual ~SvxDefaultColorOptPage();
-
- void Construct();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
- virtual BOOL FillItemSet( SfxItemSet& rOutAttrs );
- virtual void Reset( const SfxItemSet& rInAttrs );
-};
-
-#endif // _SVX_OPTCHART_HXX
-
diff --git a/svx/source/cui/optcolor.cxx b/svx/source/cui/optcolor.cxx
deleted file mode 100644
index 669a4e7f59..0000000000
--- a/svx/source/cui/optcolor.cxx
+++ /dev/null
@@ -1,1642 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optcolor.cxx,v $
- * $Revision: 1.18.256.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <svtools/colorcfg.hxx>
-#include <svtools/extcolorcfg.hxx>
-#include <svtools/headbar.hxx>
-#include <svtools/ctrlbox.hxx>
-#include <vcl/scrbar.hxx>
-#include <svx/xtable.hxx>
-#include <svtools/moduleoptions.hxx>
-#include <svtools/pathoptions.hxx>
-#include <vcl/msgbox.hxx>
-#include <boost/shared_ptr.hpp>
-//CHINA001 #ifndef _SVX_DLG_NAME_HXX
-//CHINA001 #include <dlgname.hxx>
-//CHINA001 #endif
-#include <svx/svxdlg.hxx> //CHINA001
-#ifndef _SVX_HELPID_HRC
-#include <helpid.hrc>
-#endif
-#include <svx/svxids.hrc>
-#include <svx/dialmgr.hxx>
-#include "optcolor.hxx"
-#include <svx/dialogs.hrc>
-#include "optcolor.hrc"
-#include "dlgutil.hxx"
-using namespace ::com::sun::star;
-using namespace ::svtools;
-
-#define GROUP_COUNT 7
-#define GROUP_UNKNOWN -1
-#define GROUP_GENERAL 0
-#define GROUP_WRITER 1
-#define GROUP_HTML 2
-#define GROUP_CALC 3
-#define GROUP_DRAW 4
-#define GROUP_BASIC 5
-#define GROUP_SQL 6
-
-/* -----------------------------2002/06/26 10:48------------------------------
-
- ---------------------------------------------------------------------------*/
-
-class SvxExtFixedText_Impl : public FixedText
-{
-private:
- long m_nGroupHeight;
-
-protected:
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-public:
- SvxExtFixedText_Impl(Window* pParent, const ResId& rResId) :
- FixedText(pParent, rResId), m_nGroupHeight(0) {}
-
- inline long GetGroupHeight() { return m_nGroupHeight; }
- inline void SetGroupHeight( long _nHeight ) { m_nGroupHeight = _nHeight; }
-};
-
-/* -----------------------------25.03.2002 15:48------------------------------
-
- ---------------------------------------------------------------------------*/
-class ColorConfigCtrl_Impl;
-class ColorConfigWindow_Impl : public Window
-{
- friend class ColorConfigCtrl_Impl;
- Window aGeneralBackWN;
- SvxExtFixedText_Impl aGeneralFT;
- FixedText aDocColorFT;
- ColorListBox aDocColorLB;
- Window aDocColorWN;
- CheckBox aDocBoundCB;
- ColorListBox aDocBoundLB;
- Window aDocBoundWN;
- FixedText aAppBackFT;
- ColorListBox aAppBackLB;
- Window aAppBackWN;
- CheckBox aObjBoundCB;
- ColorListBox aObjBoundLB;
- Window aObjBoundWN;
- CheckBox aTableBoundCB;
- ColorListBox aTableBoundLB;
- Window aTableBoundWN;
- FixedText aFontColorFT;
- ColorListBox aFontColorLB;
- Window aFontColorWN;
- CheckBox aLinksCB;
- ColorListBox aLinksLB;
- Window aLinksWN;
- CheckBox aLinksVisitedCB;
- ColorListBox aLinksVisitedLB;
- Window aLinksVisitedWN;
- FixedText aSpellFT;
- ColorListBox aSpellLB;
- Window aSpellWN;
- FixedText aSmarttagsFT;
- ColorListBox aSmarttagsLB;
- Window aSmarttagsWN;
- Window aWriterBackWN;
- SvxExtFixedText_Impl aWriterFT;
- FixedText aWrtTextGridFT;
- ColorListBox aWrtTextGridLB;
- Window aWrtTextGridWN;
- CheckBox aWrtFieldCB;
- ColorListBox aWrtFieldLB;
- Window aWrtFieldWN;
- CheckBox aWrtIdxShadingBackCB;
- ColorListBox aWrtIdxShadingBackLB;
- Window aWrtIdxShadingBackWN;
- FixedText aWrtScriptIndicatorFT;
- ColorListBox aWrtScriptIndicatorLB;
- Window aWrtScriptIndicatorWN;
- CheckBox aWrtSectionBoundCB;
- ColorListBox aWrtSectionBoundLB;
- Window aWrtSectionBoundWN;
- FixedText aWrtPageBreaksFT;
- ColorListBox aWrtPageBreaksLB;
- Window aWrtPageBreaksWN;
- FixedText aWrtDirectCrsrFT;
- ColorListBox aWrtDirectCrsrLB;
- Window aWrtDirectCrsrWN;
- Window aHTMLBackWN;
- SvxExtFixedText_Impl aHTMLFT;
- FixedText aHTMLSGMLFT;
- ColorListBox aHTMLSGMLLB;
- Window aHTMLSGMLWN;
- FixedText aHTMLCommentFT;
- ColorListBox aHTMLCommentLB;
- Window aHTMLCommentWN;
- FixedText aHTMLKeywdFT;
- ColorListBox aHTMLKeywdLB;
- Window aHTMLKeywdWN;
- FixedText aHTMLUnknownFT;
- ColorListBox aHTMLUnknownLB;
- Window aHTMLUnknownWN;
- Window aCalcBackWN;
- SvxExtFixedText_Impl aCalcFT;
- FixedText aCalcGridFT;
- ColorListBox aCalcGridLB;
- Window aCalcGridWN;
- FixedText aCalcPageBreakFT;
- ColorListBox aCalcPageBreakLB;
- Window aCalcPageBreakWN;
- FixedText aCalcPageBreakManualFT;
- ColorListBox aCalcPageBreakManualLB;
- Window aCalcPageBreakManualWN;
- FixedText aCalcPageBreakAutoFT;
- ColorListBox aCalcPageBreakAutoLB;
- Window aCalcPageBreakAutoWN;
- FixedText aCalcDetectiveFT;
- ColorListBox aCalcDetectiveLB;
- Window aCalcDetectiveWN;
- FixedText aCalcDetectiveErrorFT;
- ColorListBox aCalcDetectiveErrorLB;
- Window aCalcDetectiveErrorWN;
- FixedText aCalcReferenceFT;
- ColorListBox aCalcReferenceLB;
- Window aCalcReferenceWN;
- FixedText aCalcNotesBackFT;
- ColorListBox aCalcNotesBackLB;
- Window aCalcNotesBackWN;
- Window aDrawBackWN;
- SvxExtFixedText_Impl aDrawFT;
- FixedText aDrawGridFT;
- ColorListBox aDrawGridLB;
- Window aDrawGridWN;
- Window aBasicBackWN;
- SvxExtFixedText_Impl aBasicFT;
- FixedText aBasicIdentifierFT;
- ColorListBox aBasicIdentifierLB;
- Window aBasicIdentifierWN;
- FixedText aBasicCommentFT;
- ColorListBox aBasicCommentLB;
- Window aBasicCommentWN;
- FixedText aBasicNumberFT;
- ColorListBox aBasicNumberLB;
- Window aBasicNumberWN;
- FixedText aBasicStringFT;
- ColorListBox aBasicStringLB;
- Window aBasicStringWN;
- FixedText aBasicOperatorFT;
- ColorListBox aBasicOperatorLB;
- Window aBasicOperatorWN;
- FixedText aBasicKeywordFT;
- ColorListBox aBasicKeywordLB;
- Window aBasicKeywordWN;
- FixedText aBasicErrorFT;
- ColorListBox aBasicErrorLB;
- Window aBasicErrorWN;
- Window aSQLBackWN;
- SvxExtFixedText_Impl aSQLFT;
- FixedText aSQLIdentifierFT;
- ColorListBox aSQLIdentifierLB;
- Window aSQLIdentifierWN;
- FixedText aSQLNumberFT;
- ColorListBox aSQLNumberLB;
- Window aSQLNumberWN;
- FixedText aSQLStringFT;
- ColorListBox aSQLStringLB;
- Window aSQLStringWN;
- FixedText aSQLOperatorFT;
- ColorListBox aSQLOperatorLB;
- Window aSQLOperatorWN;
- FixedText aSQLKeywordFT;
- ColorListBox aSQLKeywordLB;
- Window aSQLKeywordWN;
- FixedText aSQLParameterFT;
- ColorListBox aSQLParameterLB;
- Window aSQLParameterWN;
- FixedText aSQLCommentFT;
- ColorListBox aSQLCommentLB;
- Window aSQLCommentWN;
-
- ::std::vector< SvxExtFixedText_Impl*> aChapters;
- ::std::vector< Window* > aChapterWins;
- ::std::vector< FixedText* > aFixedTexts;
- ::std::vector< CheckBox* > aCheckBoxes;
- ::std::vector< ColorListBox* > aColorBoxes;
- ::std::vector< Window* > aWindows; // [ColorConfigEntryCount]
- ::std::vector< ::boost::shared_ptr<SvxExtFixedText_Impl> > m_aExtensionTitles;
-
- SvtModuleOptions m_aModuleOptions;
-
- void SetNewPosition( sal_Int32 _nFeature, Window* _pWin );
-
- virtual void Command( const CommandEvent& rCEvt );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-public:
- ColorConfigWindow_Impl(Window* pParent, const ResId& rResId);
- ~ColorConfigWindow_Impl();
-
- inline const SvtModuleOptions& GetModuleOptions() const { return m_aModuleOptions; }
-};
-
-sal_Bool lcl_isGroupVisible( sal_Int32 _nGroup, const SvtModuleOptions& _rModOptions )
-{
- sal_Bool bRet = sal_True;
-
- switch ( _nGroup )
- {
- case GROUP_WRITER :
- case GROUP_HTML :
- {
- bRet = _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SWRITER );
- break;
- }
-
- case GROUP_CALC :
- {
- bRet = _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SCALC );
- break;
- }
-
- case GROUP_DRAW :
- {
- bRet = ( _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ||
- _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) );
- break;
- }
- case GROUP_SQL :
- {
- bRet = _rModOptions.IsModuleInstalled( SvtModuleOptions::E_SDATABASE );
- break;
- }
- }
-
- return bRet;
-}
-
-sal_Int16 lcl_getGroup( sal_Int32 _nFeature )
-{
- if ( _nFeature >= ColorConfigEntryCount )
- return GROUP_COUNT; // feature of an extension
-
- sal_Int16 nRet = GROUP_UNKNOWN;
-
- switch ( _nFeature )
- {
- case DOCCOLOR :
- case DOCBOUNDARIES :
- case APPBACKGROUND :
- case OBJECTBOUNDARIES :
- case TABLEBOUNDARIES :
- case FONTCOLOR :
- case LINKS :
- case LINKSVISITED :
- case ANCHOR :
- case SPELL :
- case SMARTTAGS :
- {
- nRet = GROUP_GENERAL;
- break;
- }
-
- case WRITERTEXTGRID :
- case WRITERFIELDSHADINGS :
- case WRITERIDXSHADINGS :
- case WRITERDIRECTCURSOR :
- case WRITERSCRIPTINDICATOR :
- case WRITERSECTIONBOUNDARIES :
- case WRITERPAGEBREAKS :
- {
- nRet = GROUP_WRITER;
- break;
- }
-
- case HTMLSGML :
- case HTMLCOMMENT :
- case HTMLKEYWORD :
- case HTMLUNKNOWN :
- {
- nRet = GROUP_HTML;
- break;
- }
-
- case CALCGRID :
- case CALCPAGEBREAK :
- case CALCPAGEBREAKMANUAL :
- case CALCPAGEBREAKAUTOMATIC :
- case CALCDETECTIVE :
- case CALCDETECTIVEERROR :
- case CALCREFERENCE :
- case CALCNOTESBACKGROUND :
- {
- nRet = GROUP_CALC;
- break;
- }
-
- case DRAWGRID :
- case DRAWDRAWING :
- case DRAWFILL :
- {
- nRet = GROUP_DRAW;
- break;
- }
-
- case BASICIDENTIFIER :
- case BASICCOMMENT :
- case BASICNUMBER :
- case BASICSTRING :
- case BASICOPERATOR :
- case BASICKEYWORD :
- case BASICERROR :
- {
- nRet = GROUP_BASIC;
- break;
- }
- case SQLIDENTIFIER :
- case SQLNUMBER:
- case SQLSTRING:
- case SQLOPERATOR:
- case SQLKEYWORD:
- case SQLPARAMETER:
- case SQLCOMMENT:
- {
- nRet = GROUP_SQL;
- break;
- }
- }
- return nRet;
-}
-
-/* -----------------------------25.03.2002 17:05------------------------------
-
- ---------------------------------------------------------------------------*/
-ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rResId) :
- Window(pParent, rResId),
- aGeneralBackWN(this),
- aGeneralFT(&aGeneralBackWN, ResId( FT_GENERAL, *rResId.GetResMgr() )),
- aDocColorFT(this, ResId( FT_DOCCOLOR, *rResId.GetResMgr())),
- aDocColorLB(this, ResId( LB_DOCCOLOR, *rResId.GetResMgr())),
- aDocColorWN(this, ResId( WN_DOCCOLOR, *rResId.GetResMgr())),
- aDocBoundCB(this, ResId( CB_DOCBOUND, *rResId.GetResMgr())),
- aDocBoundLB(this, ResId( LB_DOCBOUND, *rResId.GetResMgr())),
- aDocBoundWN(this, ResId( WN_DOCBOUND, *rResId.GetResMgr())),
- aAppBackFT(this, ResId( FT_APPBACKGROUND, *rResId.GetResMgr())),
- aAppBackLB(this, ResId( LB_APPBACKGROUND, *rResId.GetResMgr())),
- aAppBackWN(this, ResId( WN_APPBACKGROUND, *rResId.GetResMgr())),
- aObjBoundCB(this, ResId( CB_OBJECTBOUNDARIES, *rResId.GetResMgr())),
- aObjBoundLB(this, ResId( LB_OBJECTBOUNDARIES, *rResId.GetResMgr())),
- aObjBoundWN(this, ResId( WN_OBJECTBOUNDARIES, *rResId.GetResMgr())),
- aTableBoundCB(this, ResId( CB_TABLEBOUNDARIES, *rResId.GetResMgr())),
- aTableBoundLB(this, ResId( LB_TABLEBOUNDARIES, *rResId.GetResMgr())),
- aTableBoundWN(this, ResId( WN_TABLEBOUNDARIES, *rResId.GetResMgr())),
- aFontColorFT(this, ResId( FT_FONTCOLOR, *rResId.GetResMgr())),
- aFontColorLB(this, ResId( LB_FONTCOLOR, *rResId.GetResMgr())),
- aFontColorWN(this, ResId( WN_FONTCOLOR, *rResId.GetResMgr())),
- aLinksCB(this, ResId( CB_LINKS, *rResId.GetResMgr())),
- aLinksLB(this, ResId( LB_LINKS, *rResId.GetResMgr())),
- aLinksWN(this, ResId( WN_LINKS, *rResId.GetResMgr())),
- aLinksVisitedCB(this, ResId( CB_LINKSVISITED, *rResId.GetResMgr())),
- aLinksVisitedLB(this, ResId( LB_LINKSVISITED, *rResId.GetResMgr())),
- aLinksVisitedWN(this, ResId( WN_LINKSVISITED, *rResId.GetResMgr())),
- aSpellFT(this, ResId( FT_SPELL, *rResId.GetResMgr())),
- aSpellLB(this, ResId( LB_SPELL, *rResId.GetResMgr())),
- aSpellWN(this, ResId( WN_SPELL, *rResId.GetResMgr())),
- aSmarttagsFT(this, ResId( FT_SMARTTAGS, *rResId.GetResMgr() )),
- aSmarttagsLB(this, ResId( LB_SMARTTAGS, *rResId.GetResMgr() )),
- aSmarttagsWN(this, ResId( WN_SMARTTAGS, *rResId.GetResMgr() )),
- aWriterBackWN(this),
- aWriterFT(this, ResId(FT_WRITER, *rResId.GetResMgr())),
- aWrtTextGridFT(this, ResId( FT_WRITERTEXTGRID, *rResId.GetResMgr())),
- aWrtTextGridLB(this, ResId( LB_WRITERTEXTGRID, *rResId.GetResMgr())),
- aWrtTextGridWN(this, ResId( WN_WRITERTEXTGRID, *rResId.GetResMgr())),
- aWrtFieldCB(this, ResId( CB_WRITERFIELDSHADINGS, *rResId.GetResMgr())),
- aWrtFieldLB(this, ResId( LB_WRITERFIELDSHADINGS, *rResId.GetResMgr())),
- aWrtFieldWN(this, ResId( WN_WRITERFIELDSHADINGS, *rResId.GetResMgr())),
- aWrtIdxShadingBackCB(this, ResId( CB_WRITERIDXSHADINGS, *rResId.GetResMgr())),
- aWrtIdxShadingBackLB(this, ResId( LB_WRITERIDXSHADINGS, *rResId.GetResMgr())),
- aWrtIdxShadingBackWN(this, ResId( WN_WRITERIDXSHADINGS, *rResId.GetResMgr())),
- aWrtScriptIndicatorFT(this, ResId( FT_WRITERSCRIPTINDICATOR, *rResId.GetResMgr())),
- aWrtScriptIndicatorLB(this, ResId( LB_WRITERSCRIPTINDICATOR, *rResId.GetResMgr())),
- aWrtScriptIndicatorWN(this, ResId( WN_WRITERSCRIPTINDICATOR, *rResId.GetResMgr())),
- aWrtSectionBoundCB(this, ResId( CB_WRITERSECTIONBOUNDARIES, *rResId.GetResMgr())),
- aWrtSectionBoundLB(this, ResId( LB_WRITERSECTIONBOUNDARIES, *rResId.GetResMgr())),
- aWrtSectionBoundWN(this, ResId( WN_WRITERSECTIONBOUNDARIES, *rResId.GetResMgr())),
- aWrtPageBreaksFT(this, ResId( FT_WRITERPAGEBREAKS, *rResId.GetResMgr())),
- aWrtPageBreaksLB(this, ResId( LB_WRITERPAGEBREAKS, *rResId.GetResMgr())),
- aWrtPageBreaksWN(this, ResId( WN_WRITERPAGEBREAKS, *rResId.GetResMgr())),
- aWrtDirectCrsrFT(this, ResId( FT_WRITERDIRECTCURSOR, *rResId.GetResMgr())),
- aWrtDirectCrsrLB(this, ResId( LB_WRITERDIRECTCURSOR, *rResId.GetResMgr())),
- aWrtDirectCrsrWN(this, ResId( WN_WRITERDIRECTCURSOR, *rResId.GetResMgr())),
- aHTMLBackWN(this),
- aHTMLFT(this, ResId( FT_HTML, *rResId.GetResMgr())),
- aHTMLSGMLFT(this, ResId( FT_HTMLSGML, *rResId.GetResMgr())),
- aHTMLSGMLLB(this, ResId( LB_HTMLSGML, *rResId.GetResMgr())),
- aHTMLSGMLWN(this, ResId( WN_HTMLSGML, *rResId.GetResMgr())),
- aHTMLCommentFT(this, ResId( FT_HTMLCOMMENT, *rResId.GetResMgr())),
- aHTMLCommentLB(this, ResId( LB_HTMLCOMMENT, *rResId.GetResMgr())),
- aHTMLCommentWN(this, ResId( WN_HTMLCOMMENT, *rResId.GetResMgr())),
- aHTMLKeywdFT(this, ResId( FT_HTMLKEYWORD, *rResId.GetResMgr())),
- aHTMLKeywdLB(this, ResId( LB_HTMLKEYWORD, *rResId.GetResMgr())),
- aHTMLKeywdWN(this, ResId( WN_HTMLKEYWORD, *rResId.GetResMgr())),
- aHTMLUnknownFT(this, ResId( FT_HTMLUNKNOWN, *rResId.GetResMgr())),
- aHTMLUnknownLB(this, ResId( LB_HTMLUNKNOWN, *rResId.GetResMgr())),
- aHTMLUnknownWN(this, ResId( WN_HTMLUNKNOWN, *rResId.GetResMgr())),
- aCalcBackWN(this),
- aCalcFT(this, ResId( FT_CALC, *rResId.GetResMgr())),
- aCalcGridFT(this, ResId( FT_CALCGRID, *rResId.GetResMgr())),
- aCalcGridLB(this, ResId( LB_CALCGRID, *rResId.GetResMgr())),
- aCalcGridWN(this, ResId( WN_CALCGRID, *rResId.GetResMgr())),
- aCalcPageBreakFT(this, ResId( FT_CALCPAGEBREAK, *rResId.GetResMgr())),
- aCalcPageBreakLB(this, ResId( LB_CALCPAGEBREAK, *rResId.GetResMgr())),
- aCalcPageBreakWN(this, ResId( WN_CALCPAGEBREAK, *rResId.GetResMgr())),
- aCalcPageBreakManualFT(this, ResId( FT_CALCPAGEBREAKMANUAL, *rResId.GetResMgr())),
- aCalcPageBreakManualLB(this, ResId( LB_CALCPAGEBREAKMANUAL, *rResId.GetResMgr())),
- aCalcPageBreakManualWN(this, ResId( WN_CALCPAGEBREAKMANUAL, *rResId.GetResMgr())),
- aCalcPageBreakAutoFT(this, ResId( FT_CALCPAGEBREAKAUTO, *rResId.GetResMgr())),
- aCalcPageBreakAutoLB(this, ResId( LB_CALCPAGEBREAKAUTO, *rResId.GetResMgr())),
- aCalcPageBreakAutoWN(this, ResId( WN_CALCPAGEBREAKAUTO, *rResId.GetResMgr())),
- aCalcDetectiveFT(this, ResId( FT_CALCDETECTIVE, *rResId.GetResMgr())),
- aCalcDetectiveLB(this, ResId( LB_CALCDETECTIVE, *rResId.GetResMgr())),
- aCalcDetectiveWN(this, ResId( WN_CALCDETECTIVE, *rResId.GetResMgr())),
- aCalcDetectiveErrorFT(this, ResId( FT_CALCDETECTIVEERROR, *rResId.GetResMgr())),
- aCalcDetectiveErrorLB(this, ResId( LB_CALCDETECTIVEERROR, *rResId.GetResMgr())),
- aCalcDetectiveErrorWN(this, ResId( WN_CALCDETECTIVEERROR, *rResId.GetResMgr())),
- aCalcReferenceFT(this, ResId( FT_CALCREFERENCE, *rResId.GetResMgr())),
- aCalcReferenceLB(this, ResId( LB_CALCREFERENCE, *rResId.GetResMgr())),
- aCalcReferenceWN(this, ResId( WN_CALCREFERENCE, *rResId.GetResMgr())),
- aCalcNotesBackFT(this, ResId( FT_CALCNOTESBACKGROUND, *rResId.GetResMgr())),
- aCalcNotesBackLB(this, ResId( LB_CALCNOTESBACKGROUND, *rResId.GetResMgr())),
- aCalcNotesBackWN(this, ResId( WN_CALCNOTESBACKGROUND, *rResId.GetResMgr())),
- aDrawBackWN(this),
- aDrawFT(this, ResId( FT_DRAW, *rResId.GetResMgr())),
- aDrawGridFT(this, ResId( FT_DRAWGRID, *rResId.GetResMgr())),
- aDrawGridLB(this, ResId( LB_DRAWGRID, *rResId.GetResMgr())),
- aDrawGridWN(this, ResId( WN_DRAWGRID, *rResId.GetResMgr())),
- aBasicBackWN(this),
- aBasicFT(this, ResId( FT_BASIC, *rResId.GetResMgr())),
- aBasicIdentifierFT(this, ResId( FT_BASICIDENTIFIER, *rResId.GetResMgr())),
- aBasicIdentifierLB(this, ResId( LB_BASICIDENTIFIER, *rResId.GetResMgr())),
- aBasicIdentifierWN(this, ResId( WN_BASICIDENTIFIER, *rResId.GetResMgr())),
- aBasicCommentFT(this, ResId( FT_BASICCOMMENT, *rResId.GetResMgr())),
- aBasicCommentLB(this, ResId( LB_BASICCOMMENT, *rResId.GetResMgr())),
- aBasicCommentWN(this, ResId( WN_BASICCOMMENT, *rResId.GetResMgr())),
- aBasicNumberFT(this, ResId( FT_BASICNUMBER, *rResId.GetResMgr())),
- aBasicNumberLB(this, ResId( LB_BASICNUMBER, *rResId.GetResMgr())),
- aBasicNumberWN(this, ResId( WN_BASICNUMBER, *rResId.GetResMgr())),
- aBasicStringFT(this, ResId( FT_BASICSTRING, *rResId.GetResMgr())),
- aBasicStringLB(this, ResId( LB_BASICSTRING, *rResId.GetResMgr())),
- aBasicStringWN(this, ResId( WN_BASICSTRING, *rResId.GetResMgr())),
- aBasicOperatorFT(this, ResId( FT_BASICOPERATOR, *rResId.GetResMgr())),
- aBasicOperatorLB(this, ResId( LB_BASICOPERATOR, *rResId.GetResMgr())),
- aBasicOperatorWN(this, ResId( WN_BASICOPERATOR, *rResId.GetResMgr())),
- aBasicKeywordFT(this, ResId( FT_BASICKEYWORD, *rResId.GetResMgr())),
- aBasicKeywordLB(this, ResId( LB_BASICKEYWORD, *rResId.GetResMgr())),
- aBasicKeywordWN(this, ResId( WN_BASICKEYWORD, *rResId.GetResMgr())),
- aBasicErrorFT(this, ResId( FT_BASICERROR, *rResId.GetResMgr())),
- aBasicErrorLB(this, ResId( LB_BASICERROR, *rResId.GetResMgr())),
- aBasicErrorWN(this, ResId( WN_BASICERROR, *rResId.GetResMgr())),
-
- aSQLBackWN(this),
- aSQLFT(this, ResId( FT_SQL_COMMAND, *rResId.GetResMgr())),
- aSQLIdentifierFT(this, ResId( FT_SQLIDENTIFIER, *rResId.GetResMgr())),
- aSQLIdentifierLB(this, ResId( LB_SQLIDENTIFIER, *rResId.GetResMgr())),
- aSQLIdentifierWN(this, ResId( WN_SQLIDENTIFIER, *rResId.GetResMgr())),
-
- aSQLNumberFT(this, ResId( FT_SQLNUMBER, *rResId.GetResMgr())),
- aSQLNumberLB(this, ResId( LB_SQLNUMBER, *rResId.GetResMgr())),
- aSQLNumberWN(this, ResId( WN_SQLNUMBER, *rResId.GetResMgr())),
-
- aSQLStringFT(this, ResId( FT_SQLSTRING, *rResId.GetResMgr())),
- aSQLStringLB(this, ResId( LB_SQLSTRING, *rResId.GetResMgr())),
- aSQLStringWN(this, ResId( WN_SQLSTRING, *rResId.GetResMgr())),
-
- aSQLOperatorFT(this, ResId( FT_SQLOPERATOR, *rResId.GetResMgr())),
- aSQLOperatorLB(this, ResId( LB_SQLOPERATOR, *rResId.GetResMgr())),
- aSQLOperatorWN(this, ResId( WN_SQLOPERATOR, *rResId.GetResMgr())),
-
- aSQLKeywordFT(this, ResId( FT_SQLKEYWORD, *rResId.GetResMgr())),
- aSQLKeywordLB(this, ResId( LB_SQLKEYWORD, *rResId.GetResMgr())),
- aSQLKeywordWN(this, ResId( WN_SQLKEYWORD, *rResId.GetResMgr())),
-
- aSQLParameterFT(this, ResId( FT_SQLPARAMETER, *rResId.GetResMgr())),
- aSQLParameterLB(this, ResId( LB_SQLPARAMETER, *rResId.GetResMgr())),
- aSQLParameterWN(this, ResId( WN_SQLPARAMETER, *rResId.GetResMgr())),
-
- aSQLCommentFT(this, ResId( FT_SQLCOMMENT, *rResId.GetResMgr())),
- aSQLCommentLB(this, ResId( LB_SQLCOMMENT, *rResId.GetResMgr())),
- aSQLCommentWN(this, ResId( WN_SQLCOMMENT, *rResId.GetResMgr()))
-{
- aFixedTexts.resize(ColorConfigEntryCount);
- aCheckBoxes.resize(ColorConfigEntryCount);
- aColorBoxes.resize(ColorConfigEntryCount);
- aWindows.resize(ColorConfigEntryCount);
-
- aFixedTexts[DOCCOLOR ] = &aDocColorFT;
- aCheckBoxes[DOCBOUNDARIES ] = &aDocBoundCB ;
- aFixedTexts[APPBACKGROUND ] = &aAppBackFT;
- aCheckBoxes[OBJECTBOUNDARIES ] = &aObjBoundCB ;
- aCheckBoxes[TABLEBOUNDARIES ] = &aTableBoundCB ;
- aFixedTexts[FONTCOLOR ] = &aFontColorFT ;
- aCheckBoxes[LINKS ] = &aLinksCB ;
- aCheckBoxes[LINKSVISITED ] = &aLinksVisitedCB ;
- aFixedTexts[SPELL ]=& aSpellFT;
- aFixedTexts[SMARTTAGS ]=& aSmarttagsFT;
- aFixedTexts[WRITERTEXTGRID ]=& aWrtTextGridFT;
- aCheckBoxes[WRITERFIELDSHADINGS ] = &aWrtFieldCB ;
- aCheckBoxes[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackCB ;
- aFixedTexts[WRITERDIRECTCURSOR ]=& aWrtDirectCrsrFT;
- aFixedTexts[WRITERSCRIPTINDICATOR ]=& aWrtScriptIndicatorFT;
- aCheckBoxes[WRITERSECTIONBOUNDARIES ]=& aWrtSectionBoundCB;
- aFixedTexts[HTMLSGML ]=& aHTMLSGMLFT;
- aFixedTexts[HTMLCOMMENT ]=& aHTMLCommentFT;
- aFixedTexts[HTMLKEYWORD ]=& aHTMLKeywdFT;
- aFixedTexts[HTMLUNKNOWN ]=& aHTMLUnknownFT;
- aFixedTexts[CALCGRID ] = &aCalcGridFT ;
- aFixedTexts[CALCPAGEBREAK ] = &aCalcPageBreakFT;
- aFixedTexts[CALCPAGEBREAKMANUAL ] = &aCalcPageBreakManualFT;
- aFixedTexts[CALCPAGEBREAKAUTOMATIC ] = &aCalcPageBreakAutoFT;
- aFixedTexts[CALCDETECTIVE ]=& aCalcDetectiveFT;
- aFixedTexts[CALCDETECTIVEERROR ]=& aCalcDetectiveErrorFT;
- aFixedTexts[CALCREFERENCE ]=& aCalcReferenceFT;
- aFixedTexts[CALCNOTESBACKGROUND ]=& aCalcNotesBackFT;
- aFixedTexts[WRITERPAGEBREAKS] = &aWrtPageBreaksFT;
- aFixedTexts[DRAWGRID ] = &aDrawGridFT ;
- aFixedTexts[BASICIDENTIFIER ] = &aBasicIdentifierFT;
- aFixedTexts[BASICCOMMENT ] = &aBasicCommentFT;
- aFixedTexts[BASICNUMBER ] = &aBasicNumberFT;
- aFixedTexts[BASICSTRING ] = &aBasicStringFT;
- aFixedTexts[BASICOPERATOR ] = &aBasicOperatorFT;
- aFixedTexts[BASICKEYWORD ] = &aBasicKeywordFT;
- aFixedTexts[BASICERROR ] = &aBasicErrorFT;
- aFixedTexts[SQLIDENTIFIER ] = &aSQLIdentifierFT;
- aFixedTexts[SQLNUMBER ] = &aSQLNumberFT;
- aFixedTexts[SQLSTRING ] = &aSQLStringFT;
- aFixedTexts[SQLOPERATOR ] = &aSQLOperatorFT;
- aFixedTexts[SQLKEYWORD ] = &aSQLKeywordFT;
- aFixedTexts[SQLPARAMETER ] = &aSQLParameterFT;
- aFixedTexts[SQLCOMMENT ] = &aSQLCommentFT;
-
- aColorBoxes[DOCCOLOR ] = &aDocColorLB ;
- aColorBoxes[DOCBOUNDARIES ] = &aDocBoundLB ;
- aColorBoxes[APPBACKGROUND ] = &aAppBackLB ;
- aColorBoxes[OBJECTBOUNDARIES ] = &aObjBoundLB ;
- aColorBoxes[TABLEBOUNDARIES ] = &aTableBoundLB ;
- aColorBoxes[FONTCOLOR ] = &aFontColorLB ;
- aColorBoxes[LINKS ] = &aLinksLB ;
- aColorBoxes[LINKSVISITED ] = &aLinksVisitedLB ;
- aColorBoxes[SPELL ] = &aSpellLB ;
- aColorBoxes[SMARTTAGS ] = &aSmarttagsLB ;
- aColorBoxes[WRITERTEXTGRID ] = &aWrtTextGridLB ;
- aColorBoxes[WRITERFIELDSHADINGS ] = &aWrtFieldLB ;
- aColorBoxes[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackLB ;
- aColorBoxes[WRITERDIRECTCURSOR ] = &aWrtDirectCrsrLB ;
- aColorBoxes[WRITERSCRIPTINDICATOR ] = &aWrtScriptIndicatorLB ;
- aColorBoxes[WRITERSECTIONBOUNDARIES ] = &aWrtSectionBoundLB ;
- aColorBoxes[WRITERPAGEBREAKS] = &aWrtPageBreaksLB;
- aColorBoxes[HTMLSGML ] = &aHTMLSGMLLB ;
- aColorBoxes[HTMLCOMMENT ] = &aHTMLCommentLB ;
- aColorBoxes[HTMLKEYWORD ] = &aHTMLKeywdLB ;
- aColorBoxes[HTMLUNKNOWN ] = &aHTMLUnknownLB ;
- aColorBoxes[CALCGRID ] = &aCalcGridLB ;
- aColorBoxes[CALCPAGEBREAK ] = &aCalcPageBreakLB ;
- aColorBoxes[CALCPAGEBREAKMANUAL ] = &aCalcPageBreakManualLB ;
- aColorBoxes[CALCPAGEBREAKAUTOMATIC]= &aCalcPageBreakAutoLB ;
- aColorBoxes[CALCDETECTIVE ] = &aCalcDetectiveLB ;
- aColorBoxes[CALCDETECTIVEERROR ] = &aCalcDetectiveErrorLB ;
- aColorBoxes[CALCREFERENCE ] = &aCalcReferenceLB ;
- aColorBoxes[CALCNOTESBACKGROUND ] = &aCalcNotesBackLB ;
- aColorBoxes[DRAWGRID ] = &aDrawGridLB ;
- aColorBoxes[BASICIDENTIFIER ] = &aBasicIdentifierLB;
- aColorBoxes[BASICCOMMENT ] = &aBasicCommentLB;
- aColorBoxes[BASICNUMBER ] = &aBasicNumberLB;
- aColorBoxes[BASICSTRING ] = &aBasicStringLB;
- aColorBoxes[BASICOPERATOR ] = &aBasicOperatorLB;
- aColorBoxes[BASICKEYWORD ] = &aBasicKeywordLB;
- aColorBoxes[BASICERROR ] = &aBasicErrorLB;
- aColorBoxes[SQLIDENTIFIER ] = &aSQLIdentifierLB;
- aColorBoxes[SQLNUMBER ] = &aSQLNumberLB;
- aColorBoxes[SQLSTRING ] = &aSQLStringLB;
- aColorBoxes[SQLOPERATOR ] = &aSQLOperatorLB;
- aColorBoxes[SQLKEYWORD ] = &aSQLKeywordLB;
- aColorBoxes[SQLPARAMETER ] = &aSQLParameterLB;
- aColorBoxes[SQLCOMMENT ] = &aSQLCommentLB;
-
- aWindows[DOCCOLOR ] = &aDocColorWN ;
- aWindows[DOCBOUNDARIES ] = &aDocBoundWN ;
- aWindows[APPBACKGROUND ] = &aAppBackWN ;
- aWindows[OBJECTBOUNDARIES ] = &aObjBoundWN ;
- aWindows[TABLEBOUNDARIES ] = &aTableBoundWN ;
- aWindows[FONTCOLOR ] = &aFontColorWN ;
- aWindows[LINKS ] = &aLinksWN ;
- aWindows[LINKSVISITED ] = &aLinksVisitedWN ;
- aWindows[SPELL ] = &aSpellWN ;
- aWindows[SMARTTAGS ] = &aSmarttagsWN ;
- aWindows[WRITERTEXTGRID ] = &aWrtTextGridWN ;
- aWindows[WRITERFIELDSHADINGS ] = &aWrtFieldWN ;
- aWindows[WRITERIDXSHADINGS ] = &aWrtIdxShadingBackWN ;
- aWindows[WRITERDIRECTCURSOR ] = &aWrtDirectCrsrWN ;
- aWindows[WRITERSCRIPTINDICATOR ] = &aWrtScriptIndicatorWN ;
- aWindows[WRITERSECTIONBOUNDARIES ] = &aWrtSectionBoundWN ;
- aWindows[WRITERPAGEBREAKS] = &aWrtPageBreaksWN;
- aWindows[HTMLSGML ] = &aHTMLSGMLWN ;
- aWindows[HTMLCOMMENT ] = &aHTMLCommentWN ;
- aWindows[HTMLKEYWORD ] = &aHTMLKeywdWN ;
- aWindows[HTMLUNKNOWN ] = &aHTMLUnknownWN ;
- aWindows[CALCGRID ] = &aCalcGridWN ;
- aWindows[CALCPAGEBREAK ] = &aCalcPageBreakWN ;
- aWindows[CALCPAGEBREAKMANUAL ] = &aCalcPageBreakManualWN ;
- aWindows[CALCPAGEBREAKAUTOMATIC] = &aCalcPageBreakAutoWN ;
- aWindows[CALCDETECTIVE ] = &aCalcDetectiveWN ;
- aWindows[CALCDETECTIVEERROR ] = &aCalcDetectiveErrorWN ;
- aWindows[CALCREFERENCE ] = &aCalcReferenceWN ;
- aWindows[CALCNOTESBACKGROUND ] = &aCalcNotesBackWN ;
- aWindows[DRAWGRID ] = &aDrawGridWN ;
- aWindows[BASICIDENTIFIER ] = &aBasicIdentifierWN;
- aWindows[BASICCOMMENT ] = &aBasicCommentWN;
- aWindows[BASICNUMBER ] = &aBasicNumberWN;
- aWindows[BASICSTRING ] = &aBasicStringWN;
- aWindows[BASICOPERATOR ] = &aBasicOperatorWN;
- aWindows[BASICKEYWORD ] = &aBasicKeywordWN;
- aWindows[BASICERROR ] = &aBasicErrorWN;
- aWindows[SQLIDENTIFIER ] = &aSQLIdentifierWN;
- aWindows[SQLNUMBER ] = &aSQLNumberWN;
- aWindows[SQLSTRING ] = &aSQLStringWN;
- aWindows[SQLOPERATOR ] = &aSQLOperatorWN;
- aWindows[SQLKEYWORD ] = &aSQLKeywordWN;
- aWindows[SQLPARAMETER ] = &aSQLParameterWN;
- aWindows[SQLCOMMENT ] = &aSQLCommentWN;
-
- aChapters.push_back(&aGeneralFT); aChapterWins.push_back(&aGeneralBackWN);
- aChapters.push_back(&aWriterFT); aChapterWins.push_back(&aWriterBackWN);
- aChapters.push_back(&aHTMLFT); aChapterWins.push_back(&aHTMLBackWN);
- aChapters.push_back(&aCalcFT); aChapterWins.push_back(&aCalcBackWN);
- aChapters.push_back(&aDrawFT); aChapterWins.push_back(&aDrawBackWN);
- aChapters.push_back(&aBasicFT); aChapterWins.push_back(&aBasicBackWN);
- aChapters.push_back(&aSQLFT); aChapterWins.push_back(&aSQLBackWN);
-
- // calculate heights of groups which can be hidden
- aChapters[GROUP_WRITER ]->SetGroupHeight( aChapters[GROUP_HTML]->GetPosPixel().Y() - aChapters[GROUP_WRITER]->GetPosPixel().Y() );
- aChapters[GROUP_HTML ]->SetGroupHeight( aChapters[GROUP_CALC]->GetPosPixel().Y() - aChapters[GROUP_HTML]->GetPosPixel().Y() );
- aChapters[GROUP_CALC ]->SetGroupHeight( aChapters[GROUP_DRAW]->GetPosPixel().Y() - aChapters[GROUP_CALC]->GetPosPixel().Y() );
- aChapters[GROUP_DRAW ]->SetGroupHeight( aChapters[GROUP_BASIC]->GetPosPixel().Y() - aChapters[GROUP_DRAW]->GetPosPixel().Y() );
- aChapters[GROUP_BASIC ]->SetGroupHeight( aChapters[GROUP_SQL]->GetPosPixel().Y() - aChapters[GROUP_BASIC]->GetPosPixel().Y() );
-
- ExtendedColorConfig aExtConfig;
- sal_Int32 nExtCount = aExtConfig.GetComponentCount();
- if ( nExtCount )
- {
- // calculate position behind last chapter
- sal_Int32 nLastY = aSQLCommentWN.GetPosPixel().Y() + aSQLCommentWN.GetSizePixel().Height();
- nLastY = nLastY + LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
- // to calculate the number of lines
- sal_Int32 nHeight = LogicToPixel( Size( 0, _LINE_HEIGHT ), MAP_APPFONT ).Height();
- sal_Int32 nLineNum = nLastY / nHeight;
-
- Point aFixedPos = LogicToPixel( Point( _FT_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT );
- Point aLBPos = LogicToPixel( Point( _LB_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT );
- Size aFixedSize = LogicToPixel( Size( _FT_WIDTH , _FT_HEIGHT ), MAP_APPFONT );
- Size aLBSize = LogicToPixel( Size( _LB_WIDTH , _LB_HEIGHT ), MAP_APPFONT );
- Size aWinSize = LogicToPixel( Size( _WN_WIDTH , _WN_HEIGHT ), MAP_APPFONT );
-
- for (sal_Int32 j = 0; j < nExtCount; ++j)
- {
- ::rtl::OUString sComponentName = aExtConfig.GetComponentName(j);
- aChapterWins.push_back(new Window(this));
- ::boost::shared_ptr<SvxExtFixedText_Impl> pTitle(new SvxExtFixedText_Impl(this,ResId(FT_SQL_COMMAND, *rResId.GetResMgr())));
- m_aExtensionTitles.push_back(pTitle);
- pTitle->SetPosSizePixel(LogicToPixel( Point( _FT_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aFixedSize);
- pTitle->SetText(aExtConfig.GetComponentDisplayName(sComponentName));
- aChapters.push_back(pTitle.get());
- ++nLineNum;
- sal_Int32 nColorCount = aExtConfig.GetComponentColorCount(sComponentName);
- for (sal_Int32 i = 0; i < nColorCount; ++i,++nLineNum)
- {
- ExtendedColorConfigValue aColorEntry = aExtConfig.GetComponentColorConfigValue(sComponentName,i);
- FixedText* pFixedText = new FixedText(this,ResId(FT_BASICERROR, *rResId.GetResMgr()));
- pFixedText->SetPosSizePixel(LogicToPixel( Point( _FT_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aFixedSize);
- pFixedText->SetText(aColorEntry.getDisplayName());
- aFixedTexts.push_back(pFixedText);
- aCheckBoxes.push_back(NULL); // no checkboxes
- ColorListBox* pColorBox = new ColorListBox(this,ResId(LB_BASICERROR, *rResId.GetResMgr()));
- pColorBox->SetPosSizePixel(LogicToPixel( Point( _LB_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aLBSize);
- aColorBoxes.push_back(pColorBox);
- Window* pWin = new Window(this,ResId(WN_BASICERROR, *rResId.GetResMgr()));
- pWin->SetPosSizePixel(LogicToPixel( Point( _WN_XPOS, nLineNum * _LINE_HEIGHT ), MAP_APPFONT ),aWinSize);
- aWindows.push_back(pWin);
- } // for (sal_Int32 i = 0; i < nExtCount; ++i,++nLineNum)
- }
- }
-
- FreeResource();
-
- Color TempColor(COL_TRANSPARENT);
- Wallpaper aTransparentWall(TempColor);
- sal_Int32 nWinWidth = GetSizePixel().Width();
- sal_Int32 nFTHeight = aChapters[0]->GetSizePixel().Height();
- Color aBackColor;
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
- if ( bHighContrast )
- aBackColor = rStyleSettings.GetShadowColor();
- else
- aBackColor = Color( COL_LIGHTGRAY);
- sal_Int32 nCount = aChapterWins.size();
- for(sal_Int32 i = 0; i < nCount; ++i)
- {
- if ( lcl_isGroupVisible( i, m_aModuleOptions ) )
- {
- Font aFont = aChapters[i]->GetFont();
- aFont.SetWeight(WEIGHT_BOLD);
- aChapters[i]->SetFont(aFont);
- aChapters[i]->SetBackground(aTransparentWall);
- aChapterWins[i]->SetPosSizePixel( Point(0, aChapters[i]->GetPosPixel().Y()),
- Size(nWinWidth, nFTHeight));
- aChapterWins[i]->SetBackground(Wallpaper(aBackColor));
- aChapterWins[i]->Show();
- }
- else
- {
- aChapters[i]->Hide();
- aChapterWins[i]->Hide();
- }
- }
- Color aTextColor;
- BOOL bSetTextColor = FALSE;
- //#104195# when the window color is the same as the text color it has to be changed
- Color aWinCol = rStyleSettings.GetWindowColor();
- Color aRCheckCol = rStyleSettings.GetRadioCheckTextColor();
- if(aWinCol == aRCheckCol )
- {
- bSetTextColor = TRUE;
- aRCheckCol.Invert();
- //if inversion didn't work (gray) then it's set to black
- if(aRCheckCol == aWinCol)
- aRCheckCol = Color(COL_BLACK);
- } // if(aWinCol == aRCheckCol )
- nCount = aFixedTexts.size();
- sal_Int16 nGroup = GROUP_UNKNOWN;
- for( sal_Int32 i = 0; i < nCount; i++ )
- {
- if(ANCHOR == i)
- continue;
- sal_Int16 nNewGroup = lcl_getGroup(i);
- sal_Bool bShow = lcl_isGroupVisible( nNewGroup, m_aModuleOptions );
-
- if ( nNewGroup > nGroup )
- {
- nGroup = nNewGroup;
- if ( bShow && nGroup >= GROUP_CALC )
- {
- SetNewPosition( i, aChapters[nGroup] );
- SetNewPosition( i, aChapterWins[nGroup] );
- }
- }
- if(aCheckBoxes[i])
- {
- if ( bShow )
- SetNewPosition( i, aCheckBoxes[i] );
- else
- aCheckBoxes[i]->Hide();
- aCheckBoxes[i]->SetBackground(aTransparentWall);
- aCheckBoxes[i]->SetHelpId(HID_COLORPAGE_CHECKBOX_START + i);
- if(bSetTextColor)
- aCheckBoxes[i]->SetTextColor(aRCheckCol);
- }
- if(aFixedTexts[i])
- {
- if ( bShow )
- SetNewPosition( i, aFixedTexts[i] );
- else
- aFixedTexts[i]->Hide();
- aFixedTexts[i]->SetBackground(aTransparentWall);
- if(bSetTextColor)
- aFixedTexts[i]->SetTextColor(aRCheckCol);
- }
- if(aWindows[i])
- {
- if ( bShow )
- SetNewPosition( i, aWindows[i] );
- else
- aWindows[i]->Hide();
- aWindows[i]->SetBorderStyle(WINDOW_BORDER_MONO);
- }
-
- if ( aColorBoxes[i] )
- {
- if ( bShow )
- SetNewPosition( i, aColorBoxes[i] );
- else
- aColorBoxes[i]->Hide();
- }
- }
-
- XColorTable aColorTable( SvtPathOptions().GetPalettePath() );
- aColorBoxes[0]->InsertAutomaticEntry();
- for( sal_Int32 i = 0; i < aColorTable.Count(); i++ )
- {
- XColorEntry* pEntry = aColorTable.GetColor(i);
- aColorBoxes[0]->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
- aColorBoxes[0]->SetHelpId(HID_COLORPAGE_LISTBOX_START);
- for( sal_Int32 i = 1; i < nCount; i++ )
- {
- if(aColorBoxes[i])
- {
- aColorBoxes[i]->CopyEntries( *aColorBoxes[0] );
- aColorBoxes[i]->SetHelpId(HID_COLORPAGE_LISTBOX_START + i);
- }
- }
-}
-/* -----------------------------27.03.2002 11:04------------------------------
-
- ---------------------------------------------------------------------------*/
-ColorConfigWindow_Impl::~ColorConfigWindow_Impl()
-{
- aChapters.clear();
- ::std::vector< SvxExtFixedText_Impl*>().swap(aChapters);
-
-
- sal_Int32 nCount = aFixedTexts.size();
- for (sal_Int32 i = ColorConfigEntryCount; i < nCount; ++i)
- {
- delete aFixedTexts[i];
- delete aCheckBoxes[i];
- delete aColorBoxes[i];
- delete aWindows[i];
- }
- for (sal_uInt32 i = GROUP_COUNT; i < aChapterWins.size(); ++i)
- delete aChapterWins[i];
- aChapterWins.clear();
- ::std::vector< Window*>().swap(aChapterWins);
-}
-/* -----------------------------2002/06/20 12:48------------------------------
-
- ---------------------------------------------------------------------------*/
-void ColorConfigWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Window::DataChanged( rDCEvt );
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
- Color aBackColor( bHighContrast ? COL_TRANSPARENT : COL_LIGHTGRAY);
- ::std::vector< Window* >::iterator aIter = aChapterWins.begin();
- ::std::vector< Window* >::iterator aEnd = aChapterWins.end();
- for(;aIter != aEnd; ++aIter )
- (*aIter)->SetBackground(Wallpaper(aBackColor));
- SetBackground(Wallpaper(rStyleSettings.GetWindowColor()));
- }
-}
-/* -----------------------------2002/06/26 10:49------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxExtFixedText_Impl::DataChanged(const DataChangedEvent& rDCEvt)
-{
- FixedText::DataChanged(rDCEvt);
- Color TempColor(COL_TRANSPARENT);
- Wallpaper aTransparentWall(TempColor);
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- Font aFont = GetFont();
- aFont.SetWeight(WEIGHT_BOLD);
- SetFont(aFont);
- SetBackground(aTransparentWall);
- }
-}
-
-void ColorConfigWindow_Impl::SetNewPosition( sal_Int32 _nFeature, Window* _pWin )
-{
- DBG_ASSERT( _pWin, "ColorConfigWindow_Impl::SetNewPosition(): no window" );
-
- // calculate the overall height of the invisible groups
- long nDelta = 0;
- sal_Int16 nGroup = lcl_getGroup( _nFeature ) - 1;
- while ( nGroup > 0 ) // GROUP_GENERAL (0) is always visible
- {
- if ( !lcl_isGroupVisible( nGroup, m_aModuleOptions ) )
- nDelta += aChapters[nGroup]->GetGroupHeight();
- nGroup--;
- }
-
- // move this window to its new position
- if ( nDelta > 0 )
- {
- Point aPos = _pWin->GetPosPixel();
- aPos.Y() -= nDelta;
- _pWin->SetPosPixel( aPos );
- }
-}
-
-/* -----------------------------08.04.2002 17:10------------------------------
-
- ---------------------------------------------------------------------------*/
-void ColorConfigWindow_Impl::Command( const CommandEvent& rCEvt )
-{
- GetParent()->Command(rCEvt);
-}
-/* -----------------------------25.03.2002 10:44------------------------------
-
- ---------------------------------------------------------------------------*/
-class ColorConfigCtrl_Impl : public Control
-{
- HeaderBar aHeaderHB;
- ScrollBar aVScroll;
-
- String sOn;
- String sUIElem;
- String sColSetting;
- String sPreview;
- ColorConfigWindow_Impl aScrollWindow;
-
- EditableColorConfig* pColorConfig;
- EditableExtendedColorConfig* pExtColorConfig;
-
- long nScrollPos;
-
- DECL_LINK(ScrollHdl, ScrollBar*);
- DECL_LINK(ClickHdl, CheckBox*);
- DECL_LINK(ColorHdl, ColorListBox*);
- DECL_LINK(ControlFocusHdl, Control*);
-
- virtual long PreNotify( NotifyEvent& rNEvt );
- virtual void Command( const CommandEvent& rCEvt );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
-public:
- ColorConfigCtrl_Impl(Window* pParent, const ResId& rResId );
- ~ColorConfigCtrl_Impl();
-
- void SetConfig(EditableColorConfig& rConfig) {pColorConfig = &rConfig;}
- void SetExtendedConfig(EditableExtendedColorConfig& rConfig) {pExtColorConfig = &rConfig;}
- void Update();
- sal_Int32 GetScrollPosition() {return aVScroll.GetThumbPos();}
- void SetScrollPosition(sal_Int32 nSet)
- {
- aVScroll.SetThumbPos(nSet);
- ScrollHdl(&aVScroll);
- }
-};
-/* -----------------------------25.03.2002 17:09------------------------------
-
- ---------------------------------------------------------------------------*/
-ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(
- Window* pParent, const ResId& rResId) :
- Control(pParent, rResId),
-
-
- aHeaderHB(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER),
- aVScroll(this, ResId(VB_VSCROLL, *rResId.GetResMgr())),
- sOn( ResId(ST_ON, *rResId.GetResMgr())),
- sUIElem( ResId(ST_UIELEM, *rResId.GetResMgr())),
- sColSetting( ResId(ST_COLSET, *rResId.GetResMgr())),
- sPreview( ResId(ST_PREVIEW, *rResId.GetResMgr())),
- aScrollWindow(this, ResId(WN_SCROLL, *rResId.GetResMgr())),
-
- pColorConfig(0),
- pExtColorConfig(0),
- nScrollPos(0)
-{
- FreeResource();
-
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- aScrollWindow.SetBackground(Wallpaper(rStyleSettings.GetFieldColor()));
- aScrollWindow.SetHelpId( HID_OPTIONS_COLORCONFIG_COLORLIST_WIN );
- aVScroll.EnableDrag();
- aVScroll.Show();
- aHeaderHB.SetPosSizePixel(
- Point(0,0),
- Size(GetOutputSizePixel().Width(), aVScroll.GetPosPixel().Y()));
- sal_Int32 nFirstWidth = aScrollWindow.aGeneralFT.GetPosPixel().X();
- sal_Int32 nSecondWidth = aScrollWindow.aColorBoxes[0]->GetPosPixel().X() - nFirstWidth;
- sal_Int32 nThirdWidth = aScrollWindow.aWindows[0]->GetPosPixel().X() - nFirstWidth - nSecondWidth;
-
- const WinBits nHeadBits = HIB_VCENTER | HIB_FIXED| HIB_FIXEDPOS;
- aHeaderHB.InsertItem( 1, sOn, nFirstWidth, (USHORT)nHeadBits|HIB_CENTER);
- aHeaderHB.InsertItem( 2, sUIElem, nSecondWidth, (USHORT)nHeadBits|HIB_LEFT);
- aHeaderHB.InsertItem( 3, sColSetting, nThirdWidth, (USHORT)nHeadBits|HIB_LEFT);
- aHeaderHB.InsertItem( 4, sPreview,
- aHeaderHB.GetSizePixel().Width() - nFirstWidth - nSecondWidth - nThirdWidth, (USHORT)nHeadBits|HIB_LEFT);
- aHeaderHB.Show();
-
- aVScroll.SetRangeMin(0);
- sal_Int32 nScrollOffset = aScrollWindow.aColorBoxes[1]->GetPosPixel().Y() - aScrollWindow.aColorBoxes[0]->GetPosPixel().Y();
- sal_Int32 nVisibleEntries = aScrollWindow.GetSizePixel().Height() / nScrollOffset;
-
- aVScroll.SetRangeMax(aScrollWindow.aCheckBoxes.size() + aScrollWindow.aChapters.size() );
- // static: minus three for ANCHOR, DRAWFILL and DRAWDRAWING
- aVScroll.SetRangeMax( aVScroll.GetRangeMax() - 3 );
- // dynamic: calculate the hidden lines
- long nInvisibleLines = 0;
- sal_Int16 nGroup = GROUP_UNKNOWN;
- sal_Int32 nCount = aScrollWindow.aCheckBoxes.size();
- for ( sal_Int32 i = 0; i < nCount; i++ )
- {
- if ( ANCHOR == i || DRAWFILL == i || DRAWDRAWING == i ) // not used at the moment
- continue;
- sal_Int16 nNewGroup = lcl_getGroup(i);
- sal_Bool bVisible = lcl_isGroupVisible( nNewGroup, aScrollWindow.GetModuleOptions() );
- if ( !bVisible )
- nInvisibleLines++;
- if ( nNewGroup > nGroup )
- {
- nGroup = nNewGroup;
- if ( !bVisible )
- nInvisibleLines++;
- }
- }
- aVScroll.SetRangeMax( aVScroll.GetRangeMax() - nInvisibleLines );
-
- aVScroll.SetPageSize( nVisibleEntries - 1 );
- aVScroll.SetVisibleSize(nVisibleEntries);
- Link aScrollLink = LINK(this, ColorConfigCtrl_Impl, ScrollHdl);
- aVScroll.SetScrollHdl(aScrollLink);
- aVScroll.SetEndScrollHdl(aScrollLink);
-
- Link aCheckLink = LINK(this, ColorConfigCtrl_Impl, ClickHdl);
- Link aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl);
- Link aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl);
- for( sal_Int16 i = 0; i < nCount; i++ )
- {
- if(aScrollWindow.aColorBoxes[i])
- {
- aScrollWindow.aColorBoxes[i]->SetSelectHdl(aColorLink);
- aScrollWindow.aColorBoxes[i]->SetGetFocusHdl(aGetFocusLink);
- }
- if(aScrollWindow.aCheckBoxes[i])
- {
- aScrollWindow.aCheckBoxes[i]->SetClickHdl(aCheckLink);
- aScrollWindow.aCheckBoxes[i]->SetGetFocusHdl(aGetFocusLink);
- }
- }
-}
-/* -----------------------------27.03.2002 10:46------------------------------
-
- ---------------------------------------------------------------------------*/
-ColorConfigCtrl_Impl::~ColorConfigCtrl_Impl()
-{
-}
-/* -----------------------------25.03.2002 17:19------------------------------
-
- ---------------------------------------------------------------------------*/
-void ColorConfigCtrl_Impl::Update()
-{
- DBG_ASSERT(pColorConfig, "Configuration not set" );
- sal_Int32 i;
- for( i = 0; i < ColorConfigEntryCount; i++ )
- {
- if(ANCHOR == i)
- continue;
- const ColorConfigValue& rColorEntry = pColorConfig->GetColorValue(ColorConfigEntry(i));
- if(COL_AUTO == (UINT32)rColorEntry.nColor)
- {
- if(aScrollWindow.aColorBoxes[i])
- aScrollWindow.aColorBoxes[i]->SelectEntryPos(0);
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->SetBackground(
- Wallpaper(ColorConfig::GetDefaultColor((ColorConfigEntry) i)));
- }
- else
- {
- Color aColor(rColorEntry.nColor);
- if(aScrollWindow.aColorBoxes[i])
- aScrollWindow.aColorBoxes[i]->SelectEntry( aColor );
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
- }
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->Invalidate();
- if(aScrollWindow.aCheckBoxes[i])
- aScrollWindow.aCheckBoxes[i]->Check(rColorEntry.bIsVisible);
- } // for( i = 0; i < ColorConfigEntryCount; i++ )
-
-
- sal_Int32 nExtCount = pExtColorConfig->GetComponentCount();
- sal_Int32 nCount = aScrollWindow.aCheckBoxes.size();
- sal_Int32 nPos = 0;
- i = ColorConfigEntryCount;
- for (sal_Int32 j = 0; j < nExtCount; ++j)
- {
- ::rtl::OUString sComponentName = pExtColorConfig->GetComponentName(j);
- sal_Int32 nColorCount = pExtColorConfig->GetComponentColorCount(sComponentName);
-
- for( sal_Int32 k = 0; i < nCount && k < nColorCount; ++i ,++nPos,++k)
- {
- if(aScrollWindow.aColorBoxes[i])
- {
- ExtendedColorConfigValue aColorEntry = pExtColorConfig->GetComponentColorConfigValue(sComponentName,k);
- Color aColor(aColorEntry.getColor());
- if(aColorEntry.getDefaultColor() == aColorEntry.getColor() )
- {
- aScrollWindow.aColorBoxes[i]->SelectEntryPos(0);
- }
- else
- {
- aScrollWindow.aColorBoxes[i]->SelectEntry( aColor );
- }
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
-
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->Invalidate();
- }
- }
- }
-}
-/* -----------------------------26.03.2002 12:55------------------------------
-
- ---------------------------------------------------------------------------*/
-sal_Bool lcl_MoveAndShow(Window* pWindow, long nOffset, long nMaxVisible, bool _bShow)
-{
- BOOL bHide = TRUE;
- if(pWindow)
- {
- Point aPos = pWindow->GetPosPixel();
- aPos.Y() += nOffset;
- pWindow->SetPosPixel(aPos);
- if ( _bShow )
- bHide = aPos.Y() > nMaxVisible || (aPos.Y() + pWindow->GetSizePixel().Height()) < 0;
- pWindow->Show(!bHide);
- }
- return !bHide;
-}
-IMPL_LINK(ColorConfigCtrl_Impl, ScrollHdl, ScrollBar*, pScrollBar)
-{
- aScrollWindow.SetUpdateMode(TRUE);
- sal_Int16 i;
- long nOffset = aScrollWindow.aColorBoxes[1]->GetPosPixel().Y() - aScrollWindow.aColorBoxes[0]->GetPosPixel().Y();
- nOffset *= (nScrollPos - pScrollBar->GetThumbPos());
- nScrollPos = pScrollBar->GetThumbPos();
- const long nWindowHeight = aScrollWindow.GetSizePixel().Height();
- sal_Int16 nFirstVisible = -1;
- sal_Int16 nLastVisible = -1;
- sal_Int32 nCount = aScrollWindow.aFixedTexts.size();
- for( i = 0; i < nCount; i++ )
- {
- if(ANCHOR == i)
- continue;
- Point aPos;
- //controls outside of the view need to be hidden to speed up accessibility tools
- bool bShowCtrl = ( lcl_isGroupVisible(
- lcl_getGroup(i), aScrollWindow.GetModuleOptions() ) != sal_False );
- lcl_MoveAndShow(aScrollWindow.aCheckBoxes[i], nOffset, nWindowHeight, bShowCtrl);
- lcl_MoveAndShow(aScrollWindow.aFixedTexts[i], nOffset, nWindowHeight, bShowCtrl);
- lcl_MoveAndShow(aScrollWindow.aWindows[i] , nOffset, nWindowHeight, bShowCtrl);
- BOOL bShow = lcl_MoveAndShow(aScrollWindow.aColorBoxes[i], nOffset, nWindowHeight, bShowCtrl);
- if(bShow)
- {
- if(nFirstVisible == -1)
- nFirstVisible = i;
- else
- nLastVisible = i;
- }
- }
- //show the one prior to the first visible and the first after the last visble control
- //to enable KEY_TAB travelling
-
- if(nFirstVisible)
- {
- //skip gaps where no controls exist for the related ColorConfigEntry
- do
- --nFirstVisible;
- while(!aScrollWindow.aCheckBoxes[nFirstVisible] && !aScrollWindow.aColorBoxes[nFirstVisible] && nFirstVisible >= 0);
-
- if ( lcl_isGroupVisible(
- lcl_getGroup( nFirstVisible ), aScrollWindow.GetModuleOptions() ) != sal_False )
- {
- if(aScrollWindow.aCheckBoxes[nFirstVisible])
- aScrollWindow.aCheckBoxes[nFirstVisible]->Show();
- if(aScrollWindow.aColorBoxes[nFirstVisible])
- aScrollWindow.aColorBoxes[nFirstVisible]->Show();
- }
- }
-
- if(nLastVisible < nCount - 1)
- {
- nLastVisible++;
- //skip gaps where no controls exist for the related ColorConfigEntry
- while(!aScrollWindow.aCheckBoxes[nLastVisible] && !aScrollWindow.aColorBoxes[nLastVisible] &&
- nLastVisible < nCount - 1 )
- nLastVisible++;
- if ( nLastVisible < nCount )
- {
- if ( lcl_isGroupVisible(
- lcl_getGroup( nLastVisible ), aScrollWindow.GetModuleOptions() ) != sal_False )
- {
- if(aScrollWindow.aCheckBoxes[nLastVisible])
- aScrollWindow.aCheckBoxes[nLastVisible]->Show();
- if(aScrollWindow.aColorBoxes[nLastVisible])
- aScrollWindow.aColorBoxes[nLastVisible]->Show();
- }
- }
- } // if(nLastVisible < nCount - 1)
- sal_Int32 nChapterCount = aScrollWindow.aChapters.size();
- for( i = 0; i < nChapterCount; i++ )
- {
- Point aPos = aScrollWindow.aChapters[i]->GetPosPixel(); aPos.Y() += nOffset; aScrollWindow.aChapters[i]->SetPosPixel(aPos);
- aPos = aScrollWindow.aChapterWins[i]->GetPosPixel(); aPos.Y() += nOffset; aScrollWindow.aChapterWins[i]->SetPosPixel(aPos);
- }
- aScrollWindow.SetUpdateMode(TRUE);
- return 0;
-}
-/* -----------------------------29.04.2002 17:02------------------------------
-
- ---------------------------------------------------------------------------*/
-long ColorConfigCtrl_Impl::PreNotify( NotifyEvent& rNEvt )
-{
- if(rNEvt.GetType() == EVENT_COMMAND)
- {
- const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
- USHORT nCmd = pCEvt->GetCommand();
- if( COMMAND_WHEEL == nCmd )
- {
- Command(*pCEvt);
- return 1;
- }
- }
- return Control::PreNotify(rNEvt);
-}
-/* -----------------------------08.04.2002 16:37------------------------------
-
- ---------------------------------------------------------------------------*/
-void ColorConfigCtrl_Impl::Command( const CommandEvent& rCEvt )
-{
- switch ( rCEvt.GetCommand() )
- {
-
- case COMMAND_WHEEL:
- case COMMAND_STARTAUTOSCROLL:
- case COMMAND_AUTOSCROLL:
- {
- const CommandWheelData* pWheelData = rCEvt.GetWheelData();
- if(pWheelData && !pWheelData->IsHorz() && COMMAND_WHEEL_ZOOM != pWheelData->GetMode())
- {
- HandleScrollCommand( rCEvt, 0, &aVScroll );
- }
- }
- break;
- default:
- Control::Command(rCEvt);
- }
-}
-
-/* -----------------------------14.12.2005 12:37------------------------------
-
- ---------------------------------------------------------------------------*/
-void ColorConfigCtrl_Impl::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Window::DataChanged( rDCEvt );
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- SetBackground(Wallpaper(rStyleSettings.GetFieldColor()));
- }
-}
-
-
-/* -----------------------------27.03.2002 11:43------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(ColorConfigCtrl_Impl, ClickHdl, CheckBox*, pBox)
-{
- DBG_ASSERT(pColorConfig, "Configuration not set" );
-
- for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
- {
- if(ANCHOR == i)
- continue;
- if(aScrollWindow.aCheckBoxes[i] == pBox )
- {
- ColorConfigValue aBoundCol = pColorConfig->GetColorValue(ColorConfigEntry(i));
- aBoundCol.bIsVisible = pBox->IsChecked();
- pColorConfig->SetColorValue(ColorConfigEntry(i), aBoundCol);
- break;
- }
- } // for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
- return 0;
-}
-/* -----------------------------27.03.2002 11:43------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(ColorConfigCtrl_Impl, ColorHdl, ColorListBox*, pBox)
-{
- DBG_ASSERT(pColorConfig, "Configuration not set" );
- sal_Int32 i = 0;
- for( ; i < ColorConfigEntryCount; i++ )
- {
- if(pBox && aScrollWindow.aColorBoxes[i] == pBox)
- {
- ColorConfigValue aColorEntry = pColorConfig->GetColorValue(ColorConfigEntry(i));
- if(!pBox->GetSelectEntryPos())
- {
- aColorEntry.nColor = COL_AUTO;
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->SetBackground(
- Wallpaper(ColorConfig::GetDefaultColor((ColorConfigEntry) i)));
- }
- else
- {
- Color aColor = pBox->GetSelectEntryColor(); // #i14869# no Color&, 'cause it's a ref to a temp object on the stack!
- aColorEntry.nColor = aColor.GetColor();
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
- }
- if(aScrollWindow.aWindows[i])
- aScrollWindow.aWindows[i]->Invalidate();
- pColorConfig->SetColorValue(ColorConfigEntry(i), aColorEntry);
- break;
- }
- } // for( sal_Int32 i = 0; i < ColorConfigEntryCount; i++ )
- sal_Int32 nExtCount = pExtColorConfig->GetComponentCount();
- sal_Int32 nCount = aScrollWindow.aCheckBoxes.size();
- sal_Int32 nPos = 0;
- i = ColorConfigEntryCount;
- for (sal_Int32 j = 0; j < nExtCount; ++j)
- {
- ::rtl::OUString sComponentName = pExtColorConfig->GetComponentName(j);
- sal_Int32 nColorCount = pExtColorConfig->GetComponentColorCount(sComponentName);
-
- for( sal_Int32 k = 0; i < nCount && k < nColorCount; ++i ,++nPos,++k)
- {
- if(pBox && aScrollWindow.aColorBoxes[i] == pBox)
- {
- ExtendedColorConfigValue aColorEntry = pExtColorConfig->GetComponentColorConfigValue(sComponentName,k);
- Color aColor = pBox->GetSelectEntryColor(); // #i14869# no Color&, 'cause it's a ref to a temp object on the stack!
- aColorEntry.setColor(aColor.GetColor());
- if( !pBox->GetSelectEntryPos() ) // auto color
- {
- aColorEntry.setColor(aColorEntry.getDefaultColor());
- aColor.SetColor(aColorEntry.getColor());
- }
- if ( aScrollWindow.aWindows[i] )
- {
- aScrollWindow.aWindows[i]->SetBackground(Wallpaper(aColor));
- aScrollWindow.aWindows[i]->Invalidate();
- }
- pExtColorConfig->SetColorValue(sComponentName,aColorEntry);
- break;
- }
- }
- }
- return 0;
-}
-IMPL_LINK(ColorConfigCtrl_Impl, ControlFocusHdl, Control*, pCtrl)
-{
- //determine whether a control is completely visible
- //and make it visible
- Point aCtrlPos(pCtrl->GetPosPixel());
- sal_Int32 nWinHeight = aScrollWindow.GetSizePixel().Height();
- if(0 != (GETFOCUS_TAB & pCtrl->GetGetFocusFlags() &&
- (aCtrlPos.Y() < 0 ||
- nWinHeight < aCtrlPos.Y() + aScrollWindow.aColorBoxes[0]->GetSizePixel().Height())))
- {
- long nThumbPos = aVScroll.GetThumbPos();
- if(nWinHeight < aCtrlPos.Y() + aScrollWindow.aColorBoxes[0]->GetSizePixel().Height())
- {
- //scroll down
- nThumbPos +=2;
- }
- else
- {
- //scroll up
- nThumbPos -= 2;
- if(nThumbPos < 0)
- nThumbPos = 0;
- }
- aVScroll.SetThumbPos(nThumbPos);
- ScrollHdl(&aVScroll);
- }
- return 0;
-};
-/* -----------------------------25.03.2002 10:47------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxColorOptionsTabPage::SvxColorOptionsTabPage(
- Window* pParent, const SfxItemSet& rCoreSet) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_COLORCONFIG ), rCoreSet ),
- aColorSchemeFL( this, SVX_RES( FL_COLORSCHEME ) ),
- aColorSchemeFT( this, SVX_RES( FT_COLORSCHEME ) ),
- aColorSchemeLB( this, SVX_RES( LB_COLORSCHEME ) ),
- aSaveSchemePB( this, SVX_RES( PB_SAVESCHEME) ),
- aDeleteSchemePB( this, SVX_RES( PB_DELETESCHEME ) ),
- aCustomColorsFL( this, SVX_RES( FL_CUSTOMCOLORS ) ),
- bFillItemSetCalled(FALSE),
- pColorConfig(0),
- pExtColorConfig(0),
- pColorConfigCT( new ColorConfigCtrl_Impl(this, SVX_RES( CT_COLORCONFIG ) ))
-{
- FreeResource();
- aColorSchemeLB.SetSelectHdl(LINK(this, SvxColorOptionsTabPage, SchemeChangedHdl_Impl));
- Link aLk = LINK(this, SvxColorOptionsTabPage, SaveDeleteHdl_Impl );
- aSaveSchemePB.SetClickHdl(aLk);
- aDeleteSchemePB.SetClickHdl(aLk);
-}
-/* -----------------------------25.03.2002 10:47------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxColorOptionsTabPage::~SvxColorOptionsTabPage()
-{
- //when the dialog is cancelled but the color scheme ListBox has been changed these
- //changes need to be undone
- if(!bFillItemSetCalled && aColorSchemeLB.GetSavedValue() != aColorSchemeLB.GetSelectEntryPos())
- {
- rtl::OUString sOldScheme = aColorSchemeLB.GetEntry(aColorSchemeLB.GetSavedValue());
- if(sOldScheme.getLength())
- {
- pColorConfig->SetCurrentSchemeName(sOldScheme);
- pExtColorConfig->SetCurrentSchemeName(sOldScheme);
- }
- }
- delete pColorConfigCT;
- pColorConfig->ClearModified();
- pColorConfig->EnableBroadcast();
- delete pColorConfig;
- pExtColorConfig->ClearModified();
- pExtColorConfig->EnableBroadcast();
- delete pExtColorConfig;
-}
-/* -----------------------------25.03.2002 10:47------------------------------
-
- ---------------------------------------------------------------------------*/
-SfxTabPage* SvxColorOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return ( new SvxColorOptionsTabPage( pParent, rAttrSet ) );
-}
-/* -----------------------------25.03.2002 10:47------------------------------
-
- ---------------------------------------------------------------------------*/
-BOOL SvxColorOptionsTabPage::FillItemSet( SfxItemSet& )
-{
- bFillItemSetCalled = TRUE;
- if(aColorSchemeLB.GetSavedValue() != aColorSchemeLB.GetSelectEntryPos())
- {
- pColorConfig->SetModified();
- pExtColorConfig->SetModified();
- }
- if(pColorConfig->IsModified())
- pColorConfig->Commit();
- if(pExtColorConfig->IsModified())
- pExtColorConfig->Commit();
- return TRUE;
-}
-/* -----------------------------25.03.2002 10:47------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxColorOptionsTabPage::Reset( const SfxItemSet& )
-{
- if(pColorConfig)
- {
- pColorConfig->ClearModified();
- pColorConfig->DisableBroadcast();
- delete pColorConfig;
- }
- pColorConfig = new EditableColorConfig;
- pColorConfigCT->SetConfig(*pColorConfig);
-
- if(pExtColorConfig)
- {
- pExtColorConfig->ClearModified();
- pExtColorConfig->DisableBroadcast();
- delete pExtColorConfig;
- }
- pExtColorConfig = new EditableExtendedColorConfig;
- pColorConfigCT->SetExtendedConfig(*pExtColorConfig);
-
- String sUser = GetUserData();
- //has to be called always to speed up accessibility tools
- pColorConfigCT->SetScrollPosition(sUser.ToInt32());
- aColorSchemeLB.Clear();
- uno::Sequence< ::rtl::OUString > aSchemes = pColorConfig->GetSchemeNames();
- const rtl::OUString* pSchemes = aSchemes.getConstArray();
- for(sal_Int32 i = 0; i < aSchemes.getLength(); i++)
- aColorSchemeLB.InsertEntry(pSchemes[i]);
- aColorSchemeLB.SelectEntry(pColorConfig->GetCurrentSchemeName());
- aColorSchemeLB.SaveValue();
- aDeleteSchemePB.Enable( aSchemes.getLength() > 1 );
- UpdateColorConfig();
-}
-/* -----------------------------25.03.2002 10:47------------------------------
-
- ---------------------------------------------------------------------------*/
-int SvxColorOptionsTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return( LEAVE_PAGE );
-}
-/* -----------------------------25.03.2002 15:32------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxColorOptionsTabPage::UpdateColorConfig()
-{
- //update the color config control
- pColorConfigCT->Update();
-}
-/* -----------------------------25.03.2002 15:30------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxColorOptionsTabPage, SchemeChangedHdl_Impl, ListBox*, pBox)
-{
- pColorConfig->LoadScheme(pBox->GetSelectEntry());
- pExtColorConfig->LoadScheme(pBox->GetSelectEntry());
- UpdateColorConfig();
- return 0;
-}
-/* -----------------------------09.04.2002 15:21------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
-{
- if(&aSaveSchemePB == pButton)
- {
- String sName;
- //CHINA001 SvxNameDialog aNameDlg(pButton,
- //CHINA001 sName,
- //CHINA001 String(SVX_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2)));
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( pButton,
- sName, String(SVX_RES(RID_SVXSTR_COLOR_CONFIG_SAVE2)), RID_SVXDLG_NAME );
- DBG_ASSERT(aNameDlg, "Dialogdiet fail!");//CHINA001
- aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
- aNameDlg->SetText(String(SVX_RES(RID_SVXSTR_COLOR_CONFIG_SAVE1)));
- aNameDlg->SetHelpId(HID_OPTIONS_COLORCONFIG_SAVE_SCHEME);
- aNameDlg->SetEditHelpId(HID_OPTIONS_COLORCONFIG_NAME_SCHEME);
- aNameDlg->SetCheckNameHdl( LINK(this, SvxColorOptionsTabPage, CheckNameHdl_Impl));
- if(RET_OK == aNameDlg->Execute()) //CHINA001 if(RET_OK == aNameDlg.Execute())
- {
- aNameDlg->GetName(sName); //CHINA001 aNameDlg.GetName(sName);
- pColorConfig->AddScheme(sName);
- pExtColorConfig->AddScheme(sName);
- aColorSchemeLB.InsertEntry(sName);
- aColorSchemeLB.SelectEntry(sName);
- aColorSchemeLB.GetSelectHdl().Call(&aColorSchemeLB);
- }
- delete aNameDlg; //add by CHINA001
- }
- else
- {
- DBG_ASSERT(aColorSchemeLB.GetEntryCount() > 1, "don't delete the last scheme");
- QueryBox aQuery(pButton, SVX_RES(RID_SVXQB_DELETE_COLOR_CONFIG));
- aQuery.SetText(String(SVX_RES(RID_SVXSTR_COLOR_CONFIG_DELETE)));
- if(RET_YES == aQuery.Execute())
- {
- rtl::OUString sDeleteScheme(aColorSchemeLB.GetSelectEntry());
- aColorSchemeLB.RemoveEntry(aColorSchemeLB.GetSelectEntryPos());
- aColorSchemeLB.SelectEntryPos(0);
- aColorSchemeLB.GetSelectHdl().Call(&aColorSchemeLB);
- //first select the new scheme and then delete the old one
- pColorConfig->DeleteScheme(sDeleteScheme);
- pExtColorConfig->DeleteScheme(sDeleteScheme);
- }
- }
- aDeleteSchemePB.Enable( aColorSchemeLB.GetEntryCount() > 1 );
- return 0;
-}
-/* -----------------------------09.04.2002 15:47------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK(SvxColorOptionsTabPage, CheckNameHdl_Impl, AbstractSvxNameDialog*, pDialog )
-{
- String sName;
- pDialog->GetName(sName);
- return sName.Len() && LISTBOX_ENTRY_NOTFOUND == aColorSchemeLB.GetEntryPos( sName );
-}
-/* -----------------------------25.04.2002 15:12------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxColorOptionsTabPage::FillUserData()
-{
- SetUserData(String::CreateFromInt32(pColorConfigCT->GetScrollPosition()));
-}
-
diff --git a/svx/source/cui/optcolor.hxx b/svx/source/cui/optcolor.hxx
deleted file mode 100644
index f30a163533..0000000000
--- a/svx/source/cui/optcolor.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optcolor.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTCOLOR_HXX
-#define _SVX_OPTCOLOR_HXX
-
-// include ---------------------------------------------------------------
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/group.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-
-/* -----------------------------25.03.2002 10:40------------------------------
-
- ---------------------------------------------------------------------------*/
-namespace svtools {class EditableColorConfig;class EditableExtendedColorConfig;}
-class ColorConfigCtrl_Impl;
-class AbstractSvxNameDialog; //CHINA001 class SvxNameDialog;
-class SvxColorOptionsTabPage : public SfxTabPage
-{
- using SfxTabPage::DeactivatePage;
-
- FixedLine aColorSchemeFL;
- FixedText aColorSchemeFT;
- ListBox aColorSchemeLB;
- PushButton aSaveSchemePB;
- PushButton aDeleteSchemePB;
-
- FixedLine aCustomColorsFL;
-
- BOOL bFillItemSetCalled;
-
- svtools::EditableColorConfig* pColorConfig;
- svtools::EditableExtendedColorConfig* pExtColorConfig;
- ColorConfigCtrl_Impl* pColorConfigCT;
-
- DECL_LINK(SchemeChangedHdl_Impl, ListBox*);
- DECL_LINK(SaveDeleteHdl_Impl, PushButton*);
- DECL_LINK(CheckNameHdl_Impl, AbstractSvxNameDialog*);
- void UpdateColorConfig();
-
-public:
- SvxColorOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxColorOptionsTabPage( );
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- virtual int DeactivatePage( SfxItemSet* pSet );
- virtual void FillUserData();
-
-};
-
-#endif
-
diff --git a/svx/source/cui/optctl.cxx b/svx/source/cui/optctl.cxx
deleted file mode 100644
index 26d775cab7..0000000000
--- a/svx/source/cui/optctl.cxx
+++ /dev/null
@@ -1,182 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optctl.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "optctl.hxx"
-#include <svx/dialmgr.hxx>
-
-#ifndef _SVX_OPTCTL_HRC
-#include "optctl.hrc"
-#endif
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include <svtools/ctloptions.hxx>
-
-// class SvxCTLOptionsPage -----------------------------------------------------
-
-IMPL_LINK( SvxCTLOptionsPage, SequenceCheckingCB_Hdl, void*, EMPTYARG )
-{
- sal_Bool bIsSequenceChecking = m_aSequenceCheckingCB.IsChecked();
- m_aRestrictedCB.Enable( bIsSequenceChecking );
- m_aTypeReplaceCB.Enable( bIsSequenceChecking );
- // #i48117#: by default restricted and type&replace have to be switched on
- if(bIsSequenceChecking)
- {
- m_aTypeReplaceCB.Check( sal_True );
- m_aRestrictedCB.Check( sal_True );
- }
- return 0;
-}
-
-SvxCTLOptionsPage::SvxCTLOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_OPTIONS_CTL ), rSet ),
-
- m_aSequenceCheckingFL ( this, SVX_RES( FL_SEQUENCECHECKING ) ),
- m_aSequenceCheckingCB ( this, SVX_RES( CB_SEQUENCECHECKING ) ),
- m_aRestrictedCB ( this, SVX_RES( CB_RESTRICTED ) ),
- m_aTypeReplaceCB ( this, SVX_RES( CB_TYPE_REPLACE ) ),
- m_aCursorControlFL ( this, SVX_RES( FL_CURSORCONTROL ) ),
- m_aMovementFT ( this, SVX_RES( FT_MOVEMENT ) ),
- m_aMovementLogicalRB ( this, SVX_RES( RB_MOVEMENT_LOGICAL ) ),
- m_aMovementVisualRB ( this, SVX_RES( RB_MOVEMENT_VISUAL ) ),
- m_aGeneralFL ( this, SVX_RES( FL_GENERAL ) ),
- m_aNumeralsFT ( this, SVX_RES( FT_NUMERALS ) ),
- m_aNumeralsLB ( this, SVX_RES( LB_NUMERALS ) )
-
-{
- FreeResource();
-
- m_aSequenceCheckingCB.SetClickHdl( LINK( this, SvxCTLOptionsPage, SequenceCheckingCB_Hdl ) );
-
- m_aNumeralsLB.SetDropDownLineCount( m_aNumeralsLB.GetEntryCount() );
-}
-// -----------------------------------------------------------------------------
-SvxCTLOptionsPage::~SvxCTLOptionsPage()
-{
-}
-// -----------------------------------------------------------------------------
-SfxTabPage* SvxCTLOptionsPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxCTLOptionsPage( pParent, rAttrSet );
-}
-// -----------------------------------------------------------------------------
-BOOL SvxCTLOptionsPage::FillItemSet( SfxItemSet& )
-{
- BOOL bModified = FALSE;
- SvtCTLOptions aCTLOptions;
-
- // Sequence checking
- BOOL bChecked = m_aSequenceCheckingCB.IsChecked();
- if ( bChecked != m_aSequenceCheckingCB.GetSavedValue() )
- {
- aCTLOptions.SetCTLSequenceChecking( bChecked );
- bModified = TRUE;
- }
-
- bChecked = m_aRestrictedCB.IsChecked();
- if( bChecked != m_aRestrictedCB.GetSavedValue() )
- {
- aCTLOptions.SetCTLSequenceCheckingRestricted( bChecked );
- bModified = TRUE;
- }
- bChecked = m_aTypeReplaceCB.IsChecked();
- if( bChecked != m_aTypeReplaceCB.GetSavedValue())
- {
- aCTLOptions.SetCTLSequenceCheckingTypeAndReplace(bChecked);
- bModified = TRUE;
- }
-
- BOOL bLogicalChecked = m_aMovementLogicalRB.IsChecked();
- BOOL bVisualChecked = m_aMovementVisualRB.IsChecked();
- if ( bLogicalChecked != m_aMovementLogicalRB.GetSavedValue() ||
- bVisualChecked != m_aMovementVisualRB.GetSavedValue() )
- {
- SvtCTLOptions::CursorMovement eMovement =
- bLogicalChecked ? SvtCTLOptions::MOVEMENT_LOGICAL : SvtCTLOptions::MOVEMENT_VISUAL;
- aCTLOptions.SetCTLCursorMovement( eMovement );
- bModified = TRUE;
- }
-
- USHORT nPos = m_aNumeralsLB.GetSelectEntryPos();
- if ( nPos != m_aNumeralsLB.GetSavedValue() )
- {
- aCTLOptions.SetCTLTextNumerals( (SvtCTLOptions::TextNumerals)nPos );
- bModified = TRUE;
- }
-
- return bModified;
-}
-// -----------------------------------------------------------------------------
-void SvxCTLOptionsPage::Reset( const SfxItemSet& )
-{
- SvtCTLOptions aCTLOptions;
-
- m_aSequenceCheckingCB.Check( aCTLOptions.IsCTLSequenceChecking() );
- m_aRestrictedCB.Check( aCTLOptions.IsCTLSequenceCheckingRestricted() );
- m_aTypeReplaceCB.Check( aCTLOptions.IsCTLSequenceCheckingTypeAndReplace() );
-
- SvtCTLOptions::CursorMovement eMovement = aCTLOptions.GetCTLCursorMovement();
- switch ( eMovement )
- {
- case SvtCTLOptions::MOVEMENT_LOGICAL :
- m_aMovementLogicalRB.Check();
- break;
-
- case SvtCTLOptions::MOVEMENT_VISUAL :
- m_aMovementVisualRB.Check();
- break;
-
- default:
- DBG_ERRORFILE( "SvxCTLOptionsPage::Reset(): invalid movement enum" );
- }
-
- USHORT nPos = (USHORT)aCTLOptions.GetCTLTextNumerals();
- DBG_ASSERT( nPos < m_aNumeralsLB.GetEntryCount(), "SvxCTLOptionsPage::Reset(): invalid numerals enum" );
- m_aNumeralsLB.SelectEntryPos( nPos );
-
- m_aSequenceCheckingCB.SaveValue();
- m_aRestrictedCB.SaveValue();
- m_aTypeReplaceCB.SaveValue();
- m_aMovementLogicalRB.SaveValue();
- m_aMovementVisualRB.SaveValue();
- m_aNumeralsLB.SaveValue();
-
- sal_Bool bIsSequenceChecking = m_aSequenceCheckingCB.IsChecked();
- m_aRestrictedCB.Enable( bIsSequenceChecking );
- m_aTypeReplaceCB.Enable( bIsSequenceChecking );
-}
-
diff --git a/svx/source/cui/optctl.hxx b/svx/source/cui/optctl.hxx
deleted file mode 100644
index 4e18b7b8f1..0000000000
--- a/svx/source/cui/optctl.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optctl.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTCTL_HXX
-#define _SVX_OPTCTL_HXX
-
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <sfx2/tabdlg.hxx>
-
-// class SvxCTLOptionsPage -----------------------------------------------------
-
-class SvxCTLOptionsPage : public SfxTabPage
-{
-private:
- FixedLine m_aSequenceCheckingFL;
- CheckBox m_aSequenceCheckingCB;
- CheckBox m_aRestrictedCB;
- CheckBox m_aTypeReplaceCB;
-
- FixedLine m_aCursorControlFL;
- FixedText m_aMovementFT;
- RadioButton m_aMovementLogicalRB;
- RadioButton m_aMovementVisualRB;
-
- FixedLine m_aGeneralFL;
- FixedText m_aNumeralsFT;
- ListBox m_aNumeralsLB;
-
- DECL_LINK( SequenceCheckingCB_Hdl, void* );
-
- SvxCTLOptionsPage( Window* pParent, const SfxItemSet& rSet );
-
-public:
-
- virtual ~SvxCTLOptionsPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-#endif // #ifndef _SVX_OPTCTL_HXX
-
diff --git a/svx/source/cui/optdict.cxx b/svx/source/cui/optdict.cxx
deleted file mode 100644
index 166d17fb18..0000000000
--- a/svx/source/cui/optdict.cxx
+++ /dev/null
@@ -1,817 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optdict.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-
-
-#include <unolingu.hxx>
-#include <dlgutil.hxx>
-#include <sfx2/sfxuno.hxx>
-#include <svtools/eitem.hxx>
-#include <com/sun/star/frame/XStorable.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-#include <unotools/intlwrapper.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
-
-#define _SVX_OPTDICT_CXX
-
-#ifndef _LINGUISTIC_MISC_HHX_
-#include <linguistic/misc.hxx>
-#endif
-#include <svx/dialogs.hrc>
-#include "optdict.hrc"
-
-
-
-#include "optdict.hxx"
-#include <svx/dialmgr.hxx>
-#include "svxerr.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::linguistic2;
-
-// static ----------------------------------------------------------------
-
-static const sal_uInt16 nNameLen = 8;
-static const short NOACTDICT = -1;
-
-static long nStaticTabs[]=
-{
- 2,10,71,120
-};
-
-// static function -------------------------------------------------------
-
-static String getNormDicEntry_Impl( const String &rText )
-{
- String aTmp( rText );
- aTmp.EraseTrailingChars( '.' );
- aTmp.EraseAllChars( '=' );
- return aTmp;
-}
-
-
-// Compare Dictionary Entry result
-enum CDE_RESULT { CDE_EQUAL, CDE_SIMILAR, CDE_DIFFERENT };
-
-static CDE_RESULT cmpDicEntry_Impl( const String &rText1, const String &rText2 )
-{
- CDE_RESULT eRes = CDE_DIFFERENT;
-
- if (rText1 == rText2)
- eRes = CDE_EQUAL;
- else
- { // similar = equal up to trailing '.' and hyphenation positions
- // marked with '='
- if (getNormDicEntry_Impl( rText1 ) == getNormDicEntry_Impl( rText2 ))
- eRes = CDE_SIMILAR;
- }
-
- return eRes;
-}
-
-// class SvxNewDictionaryDialog -------------------------------------------
-
-SvxNewDictionaryDialog::SvxNewDictionaryDialog( Window* pParent,
- Reference< XSpellChecker1 > &xSpl ) :
-
- ModalDialog( pParent, SVX_RES( RID_SFXDLG_NEWDICT ) ),
-
- aNameText ( this, SVX_RES( FT_DICTNAME ) ),
- aNameEdit ( this, SVX_RES( ED_DICTNAME ) ),
- aLanguageText ( this, SVX_RES( FT_DICTLANG ) ),
- aLanguageLB ( this, SVX_RES( LB_DICTLANG ) ),
- aExceptBtn ( this, SVX_RES( BTN_EXCEPT ) ),
- aNewDictBox ( this, SVX_RES( GB_NEWDICT ) ),
- aOKBtn ( this, SVX_RES( BTN_NEWDICT_OK ) ),
- aCancelBtn ( this, SVX_RES( BTN_NEWDICT_ESC ) ),
- aHelpBtn ( this, SVX_RES( BTN_NEWDICT_HLP ) ),
- xSpell( xSpl )
-{
- // Handler installieren
- aNameEdit.SetModifyHdl(
- LINK( this, SvxNewDictionaryDialog, ModifyHdl_Impl ) );
- aOKBtn.SetClickHdl( LINK( this, SvxNewDictionaryDialog, OKHdl_Impl ) );
-
- // Sprachen anzeigen
- aLanguageLB.SetLanguageList( LANG_LIST_ALL, TRUE, TRUE );
- aLanguageLB.SelectEntryPos(0);
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxNewDictionaryDialog, OKHdl_Impl, Button *, EMPTYARG )
-{
- String sDict = aNameEdit.GetText();
- sDict.EraseTrailingChars();
- // add extension for personal dictionaries
- sDict.AppendAscii(".dic");
-
- Reference< XDictionaryList > xDicList( SvxGetDictionaryList() );
-
- Sequence< Reference< XDictionary > > aDics;
- if (xDicList.is())
- aDics = xDicList->getDictionaries();
- const Reference< XDictionary > *pDic = aDics.getConstArray();
- sal_Int32 nCount = (sal_uInt16) aDics.getLength();
-
- sal_Bool bFound = sal_False;
- sal_uInt16 i;
- for (i = 0; !bFound && i < nCount; ++i )
- if ( sDict.EqualsIgnoreCaseAscii( String(pDic[i]->getName()) ))
- bFound = sal_True;
-
- if ( bFound )
- {
- // Doppelte Namen?
- InfoBox( this, SVX_RESSTR( RID_SVXSTR_OPT_DOUBLE_DICTS ) ).Execute();
- aNameEdit.GrabFocus();
- return 0;
- }
-
- // Erzeugen und hinzufuegen
- sal_uInt16 nLang = aLanguageLB.GetSelectLanguage();
- try
- {
- // create new dictionary
- DictionaryType eType = aExceptBtn.IsChecked() ?
- DictionaryType_NEGATIVE : DictionaryType_POSITIVE;
- if (xDicList.is())
- {
- lang::Locale aLocale( SvxCreateLocale(nLang) );
- String aURL( linguistic::GetWritableDictionaryURL( sDict ) );
- xNewDic = Reference< XDictionary > (
- xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY );
- }
- DBG_ASSERT(xNewDic.is(), "NULL pointer");
- }
- catch(...)
- {
- xNewDic = NULL;
-
- // Fehler: konnte neues W"orterbuch nicht anlegen
- SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, String(),
- this, RID_SVXERRCTX, &DIALOG_MGR() );
- ErrorHandler::HandleError( *new StringErrorInfo(
- ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
-
- EndDialog( RET_CANCEL );
- }
-
- if (xDicList.is() && xNewDic.is())
- {
- xDicList->addDictionary( Reference< XDictionary > ( xNewDic, UNO_QUERY ) );
-
- // refresh list of dictionaries
- //! dictionaries may have been added/removed elsewhere too.
- aDics = xDicList->getDictionaries();
- }
- pDic = aDics.getConstArray();
- nCount = (sal_uInt16) aDics.getLength();
-
-
- EndDialog( RET_OK );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxNewDictionaryDialog, ModifyHdl_Impl, Edit *, EMPTYARG )
-{
- if ( aNameEdit.GetText().Len() )
- aOKBtn.Enable();
- else
- aOKBtn.Disable();
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxNewDictionaryDialog, ModifyHdl_Impl, Edit *, EMPTYARG )
-
-//==========================================================================
-//
-// class SvxEditDictionaryDialog -------------------------------------------
-//
-//==========================================================================
-
-SvxEditDictionaryDialog::SvxEditDictionaryDialog(
- Window* pParent,
- const String& rName,
- Reference< XSpellChecker1 > &xSpl ) :
-
- ModalDialog( pParent, SVX_RES( RID_SFXDLG_EDITDICT ) ),
-
- aBookFT ( this, SVX_RES( FT_BOOK ) ),
- aAllDictsLB ( this, SVX_RES( LB_ALLDICTS ) ),
- aLangFT ( this, SVX_RES( FT_DICTLANG ) ),
- aLangLB ( this, SVX_RES( LB_DICTLANG ) ),
- aWordFT ( this, SVX_RES( FT_WORD ) ),
- aWordED ( this, SVX_RES( ED_WORD ) ),
- aReplaceFT ( this, SVX_RES( FT_REPLACE ) ),
- aReplaceED ( this, SVX_RES( ED_REPLACE ) ),
- aWordsLB ( this, SVX_RES( TLB_REPLACE ) ),
- aNewReplacePB ( this, SVX_RES( PB_NEW_REPLACE ) ),
- aDeletePB ( this, SVX_RES( PB_DELETE_REPLACE ) ),
- aEditDictsBox ( this, SVX_RES( GB_EDITDICTS ) ),
- aCloseBtn ( this, SVX_RES( BTN_EDITCLOSE ) ),
- aHelpBtn ( this, SVX_RES( BTN_EDITHELP ) ),
- sModify (SVX_RES(STR_MODIFY)),
- sNew (aNewReplacePB.GetText()),
- aDecoView ( this),
- xSpell ( xSpl ),
- nOld ( NOACTDICT ),
- bFirstSelect (sal_True),
- bDoNothing (sal_False)
-
-{
- if (SvxGetDictionaryList().is())
- aDics = SvxGetDictionaryList()->getDictionaries();
-
- aWordsLB.SetSelectHdl(LINK(this, SvxEditDictionaryDialog, SelectHdl));
- aWordsLB.SetTabs(nStaticTabs);
-
- //! we use an algorithm of our own to insert elements sorted
- aWordsLB.SetWindowBits(/*WB_SORT|*/WB_HSCROLL|WB_CLIPCHILDREN);
-
-
- nWidth=aWordED.GetSizePixel().Width();
- // Handler installieren
- aNewReplacePB.SetClickHdl(
- LINK( this, SvxEditDictionaryDialog, NewDelHdl));
- aDeletePB.SetClickHdl(
- LINK( this, SvxEditDictionaryDialog, NewDelHdl));
-
- aLangLB.SetSelectHdl(
- LINK( this, SvxEditDictionaryDialog, SelectLangHdl_Impl ) );
- aAllDictsLB.SetSelectHdl(
- LINK( this, SvxEditDictionaryDialog, SelectBookHdl_Impl ) );
-
- aWordED.SetModifyHdl(LINK(this, SvxEditDictionaryDialog, ModifyHdl));
- aReplaceED.SetModifyHdl(LINK(this, SvxEditDictionaryDialog, ModifyHdl));
- aWordED.SetActionHdl(LINK(this, SvxEditDictionaryDialog, NewDelHdl));
- aReplaceED.SetActionHdl(LINK(this, SvxEditDictionaryDialog, NewDelHdl));
-
- // Listbox mit allen verfuegbaren WB's fuellen
- const Reference< XDictionary > *pDic = aDics.getConstArray();
- sal_Int32 nCount = aDics.getLength();
-
- String aLookUpEntry;
- for ( sal_Int32 i = 0; i < nCount; ++i )
- {
- Reference< XDictionary > xDic( pDic[i], UNO_QUERY );
- if (xDic.is())
- {
- sal_Bool bNegative = xDic->getDictionaryType() == DictionaryType_NEGATIVE ?
- sal_True : sal_False;
- String aDicName( xDic->getName() );
- const String aTxt( ::GetDicInfoStr( aDicName, SvxLocaleToLanguage( xDic->getLocale() ),
- bNegative ) );
- aAllDictsLB.InsertEntry( aTxt );
-
- if (rName == aDicName)
- aLookUpEntry = aTxt;
- }
- }
-
- aLangLB.SetLanguageList( LANG_LIST_ALL, TRUE, TRUE );
-
- aReplaceED.SetSpaces(sal_True);
- aWordED.SetSpaces(sal_True);
-
- if ( nCount > 0 )
- {
- aAllDictsLB.SelectEntry( aLookUpEntry );
- sal_uInt16 nPos = aAllDictsLB.GetSelectEntryPos();
-
- if ( nPos == LISTBOX_ENTRY_NOTFOUND )
- {
- nPos = 0;
- aAllDictsLB.SelectEntryPos( nPos );
- }
- Reference< XDictionary > xDic;
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- xDic = Reference< XDictionary > ( aDics.getConstArray()[ nPos ], UNO_QUERY );
- if (xDic.is())
- SetLanguage_Impl( SvxLocaleToLanguage( xDic->getLocale() ) );
-
- // check if dictionary is read-only
- SetDicReadonly_Impl(xDic);
- sal_Bool bEnable = !IsDicReadonly_Impl();
- aNewReplacePB .Enable( sal_False );
- aDeletePB .Enable( sal_False );
- aLangFT.Enable( bEnable );
- aLangLB.Enable( bEnable );
- ShowWords_Impl( nPos );
-
- }
- else
- {
- aNewReplacePB.Disable();
- aDeletePB .Disable();
- }
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxEditDictionaryDialog::~SvxEditDictionaryDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void SvxEditDictionaryDialog::Paint( const Rectangle& rRect )
-{
- ModalDialog::Paint(rRect );
-
- Rectangle aRect(aEditDictsBox.GetPosPixel(),aEditDictsBox.GetSizePixel());
-
- sal_uInt16 nStyle=BUTTON_DRAW_NOFILL;
- aDecoView.DrawButton( aRect, nStyle);
-}
-
-// -----------------------------------------------------------------------
-
-void SvxEditDictionaryDialog::SetDicReadonly_Impl(
- Reference< XDictionary > &xDic )
-{
- // enable or disable new and delete button according to file attributes
- bDicIsReadonly = sal_True;
- if (xDic.is())
- {
- Reference< frame::XStorable > xStor( xDic, UNO_QUERY );
- if ( !xStor.is() // non persistent dictionary
- || !xStor->hasLocation() // not yet persistent
- || !xStor->isReadonly() )
- {
- bDicIsReadonly = sal_False;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxEditDictionaryDialog::SetLanguage_Impl( util::Language nLanguage )
-{
- // select language
- aLangLB.SelectLanguage( nLanguage );
-}
-
-USHORT SvxEditDictionaryDialog::GetLBInsertPos(const String &rDicWord)
-{
- USHORT nPos = USHRT_MAX;
-
- IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- const CollatorWrapper* pCollator = aIntlWrapper.getCollator();
- USHORT j;
- for( j = 0; j < aWordsLB.GetEntryCount(); j++ )
- {
- SvLBoxEntry* pEntry = aWordsLB.GetEntry(j);
- DBG_ASSERT( pEntry, "NULL pointer");
- String aNormEntry( getNormDicEntry_Impl( rDicWord ) );
- StringCompare eCmpRes = (StringCompare)pCollator->
- compareString( aNormEntry, getNormDicEntry_Impl( aWordsLB.GetEntryText(pEntry, 0) ) );
- if( COMPARE_LESS == eCmpRes )
- break;
- }
- if (j < aWordsLB.GetEntryCount()) // entry found?
- nPos = j;
-
- return nPos;
-}
-
-void SvxEditDictionaryDialog::RemoveDictEntry(SvLBoxEntry* pEntry)
-{
- sal_uInt16 nLBPos = aAllDictsLB.GetSelectEntryPos();
-
- if ( pEntry != NULL && nLBPos != LISTBOX_ENTRY_NOTFOUND )
- {
- String sTmpShort(aWordsLB.GetEntryText(pEntry, 0));
-
- Reference< XDictionary > xDic = aDics.getConstArray()[ nLBPos ];
- if (xDic->remove( sTmpShort )) // sal_True on success
- {
- aWordsLB.GetModel()->Remove(pEntry);
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxEditDictionaryDialog, SelectBookHdl_Impl, ListBox *, EMPTYARG )
-{
- sal_uInt16 nPos = aAllDictsLB.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aNewReplacePB.Enable( sal_False );
- aDeletePB .Enable( sal_False );
- // Dictionary anzeigen
- ShowWords_Impl( nPos );
- // enable or disable new and delete button according to file attributes
- Reference< XDictionary > xDic( aDics.getConstArray()[ nPos ], UNO_QUERY );
- if (xDic.is())
- SetLanguage_Impl( SvxLocaleToLanguage( xDic->getLocale() ) );
-
- SetDicReadonly_Impl(xDic);
- sal_Bool bEnable = !IsDicReadonly_Impl();
- aLangFT.Enable( bEnable );
- aLangLB.Enable( bEnable );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxEditDictionaryDialog, SelectLangHdl_Impl, ListBox *, EMPTYARG )
-{
- sal_uInt16 nDicPos = aAllDictsLB.GetSelectEntryPos();
- sal_uInt16 nLang = aLangLB.GetSelectLanguage();
- Reference< XDictionary > xDic( aDics.getConstArray()[ nDicPos ], UNO_QUERY );
- INT16 nOldLang = SvxLocaleToLanguage( xDic->getLocale() );
-
- if ( nLang != nOldLang )
- {
- QueryBox aBox( this, SVX_RES( RID_SFXQB_SET_LANGUAGE ) );
- String sTxt( aBox.GetMessText() );
- sTxt.SearchAndReplaceAscii( "%1", aAllDictsLB.GetSelectEntry() );
- aBox.SetMessText( sTxt );
-
- if ( aBox.Execute() == RET_YES )
- {
- xDic->setLocale( SvxCreateLocale( nLang ) );
- sal_Bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
-
- const String sName(
- ::GetDicInfoStr( xDic->getName(),
- SvxLocaleToLanguage( xDic->getLocale() ),
- bNegativ ) );
- aAllDictsLB.RemoveEntry( nDicPos );
- aAllDictsLB.InsertEntry( sName, nDicPos );
- aAllDictsLB.SelectEntryPos( nDicPos );
- }
- else
- SetLanguage_Impl( nOldLang );
- }
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxEditDictionaryDialog::ShowWords_Impl( sal_uInt16 nId )
-{
- Reference< XDictionary > xDic = aDics.getConstArray()[ nId ];
-
- nOld = nId;
- EnterWait();
-
- String aStr;
-
- aWordED.SetText(aStr);
- aReplaceED.SetText(aStr);
-
- if(xDic->getDictionaryType() != DictionaryType_POSITIVE)
- {
- nStaticTabs[0]=2;
-
- // make controls for replacement text active
- if(!aReplaceFT.IsVisible())
- {
- Size aSize=aWordED.GetSizePixel();
- aSize.Width()=nWidth;
- aWordED.SetSizePixel(aSize);
- aReplaceFT.Show();
- aReplaceED.Show();
- }
- }
- else
- {
- nStaticTabs[0]=1;
-
- // deactivate controls for replacement text
- if(aReplaceFT.IsVisible())
- {
- Size aSize=aWordED.GetSizePixel();
- aSize.Width()=aWordsLB.GetSizePixel().Width();
- aWordED.SetSizePixel(aSize);
- aReplaceFT.Hide();
- aReplaceED.Hide();
- }
-
- }
-
- aWordsLB.SetTabs(nStaticTabs);
- aWordsLB.Clear();
-
- Sequence< Reference< XDictionaryEntry > > aEntries( xDic->getEntries() );
- const Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray();
- sal_Int32 nCount = aEntries.getLength();
-
- for (sal_Int32 i = 0; i < nCount; i++)
- {
- aStr = String(pEntry[i]->getDictionaryWord());
- USHORT nPos = GetLBInsertPos( aStr );
- if(pEntry[i]->isNegative())
- {
- aStr += '\t';
- aStr += String(pEntry[i]->getReplacementText());
- }
- aWordsLB.InsertEntry(aStr, 0, sal_False, nPos == USHRT_MAX ? LIST_APPEND : nPos);
- }
-
- if (aWordsLB.GetEntryCount())
- {
- aWordED .SetText( aWordsLB.GetEntryText(0LU, 0) );
- aReplaceED.SetText( aWordsLB.GetEntryText(0LU, 1) );
- }
-
- LeaveWait();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK(SvxEditDictionaryDialog, SelectHdl, SvTabListBox*, pBox)
-{
- if(!bDoNothing)
- {
- if(!bFirstSelect)
- {
- SvLBoxEntry* pEntry = pBox->FirstSelected();
- String sTmpShort(pBox->GetEntryText(pEntry, 0));
- // wird der Text ueber den ModifyHdl gesetzt, dann steht der Cursor
- //sonst immer am Wortanfang, obwohl man gerade hier editiert
- if(aWordED.GetText() != sTmpShort)
- aWordED.SetText(sTmpShort);
- aReplaceED.SetText(pBox->GetEntryText(pEntry, 1));
- }
- else
- bFirstSelect = sal_False;
-
- // entries in the list box should exactly correspond to those from the
- // dictionary. Thus:
- aNewReplacePB.Enable(sal_False);
- aDeletePB .Enable( sal_True && !IsDicReadonly_Impl() );
- }
- return 0;
-};
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn)
-{
- SvLBoxEntry* pEntry = aWordsLB.FirstSelected();
-
- if(pBtn == &aDeletePB)
- {
- DBG_ASSERT(pEntry, "keine Eintrag selektiert");
- String aStr;
-
- aWordED.SetText(aStr);
- aReplaceED.SetText(aStr);
- aDeletePB.Disable();
-
- RemoveDictEntry(pEntry); // remove entry from dic and list-box
- }
- if(pBtn == &aNewReplacePB || aNewReplacePB.IsEnabled())
- {
- SvLBoxEntry* _pEntry = aWordsLB.FirstSelected();
- XubString aNewWord(aWordED.GetText());
- String sEntry(aNewWord);
- XubString aReplaceStr(aReplaceED.GetText());
-
- sal_Int16 nAddRes = DIC_ERR_UNKNOWN;
- sal_uInt16 nPos = aAllDictsLB.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND && aNewWord.Len() > 0)
- {
- DBG_ASSERT(nPos < aDics.getLength(), "invalid dictionary index");
- Reference< XDictionary > xDic( aDics.getConstArray()[ nPos ], UNO_QUERY );
- if (xDic.is())
- {
- // make changes in dic
-
- //! ...IsVisible should reflect wether the dictionary is a negativ
- //! or not (hopefully...)
- sal_Bool bIsNegEntry = aReplaceFT.IsVisible();
- ::rtl::OUString aRplcText;
- if(bIsNegEntry)
- aRplcText = aReplaceStr;
-
- if (_pEntry) // entry selected in aWordsLB ie action = modify entry
- xDic->remove( aWordsLB.GetEntryText( _pEntry, 0 ) );
- // if remove has failed the following add should fail too
- // and thus a warning message should be triggered...
-
- Reference<XDictionary> aXDictionary(xDic, UNO_QUERY);
- nAddRes = linguistic::AddEntryToDic( aXDictionary,
- aNewWord, bIsNegEntry,
- aRplcText, SvxLocaleToLanguage( xDic->getLocale() ), sal_False );
- }
- }
- if (DIC_ERR_NONE != nAddRes)
- SvxDicError( this, nAddRes );
-
- if(DIC_ERR_NONE == nAddRes && sEntry.Len())
- {
- // insert new entry in list-box etc...
-
- aWordsLB.SetUpdateMode(sal_False);
- sal_uInt16 _nPos = USHRT_MAX;
-
- if(aReplaceFT.IsVisible())
- {
- sEntry += '\t';
- sEntry += aReplaceStr;
- }
-
- SvLBoxEntry* pNewEntry = NULL;
- if(_pEntry) // entry selected in aWordsLB ie action = modify entry
- {
- aWordsLB.SetEntryText( sEntry, _pEntry );
- pNewEntry = _pEntry;
- }
- else
- {
- _nPos = GetLBInsertPos( aNewWord );
- SvLBoxEntry* pInsEntry = aWordsLB.InsertEntry(sEntry, 0, sal_False,
- _nPos == USHRT_MAX ? LIST_APPEND : (sal_uInt32)_nPos);
- pNewEntry = pInsEntry;
- }
-
- aWordsLB.MakeVisible( pNewEntry );
- aWordsLB.SetUpdateMode(sal_True);
- // falls der Request aus dem ReplaceEdit kam, dann Focus in das ShortEdit setzen
- if(aReplaceED.HasFocus())
- aWordED.GrabFocus();
- }
- }
- else
- {
- // das kann nur ein Enter in einem der beiden Edit-Felder sein und das
- // bedeutet EndDialog() - muss im KeyInput ausgewertet werden
- return 0;
- }
- ModifyHdl(&aWordED);
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
-{
- SvLBoxEntry* pFirstSel = aWordsLB.FirstSelected();
- String rEntry = pEdt->GetText();
-
- xub_StrLen nWordLen=rEntry.Len();
- const String& rRepString = aReplaceED.GetText();
-
- BOOL bEnableNewReplace = FALSE;
- BOOL bEnableDelete = FALSE;
- String aNewReplaceText = sNew;
-
- if(pEdt == &aWordED)
- {
- if(nWordLen>0)
- {
- sal_Bool bFound = sal_False;
- sal_Bool bTmpSelEntry=sal_False;
- CDE_RESULT eCmpRes = CDE_DIFFERENT;
-
- for(sal_uInt16 i = 0; i < aWordsLB.GetEntryCount(); i++)
- {
- SvLBoxEntry* pEntry = aWordsLB.GetEntry( i );
- String aTestStr( aWordsLB.GetEntryText(pEntry, 0) );
- eCmpRes = cmpDicEntry_Impl( rEntry, aTestStr );
- if(CDE_DIFFERENT != eCmpRes)
- {
- if(rRepString.Len())
- bFirstSelect = sal_True;
- bDoNothing=sal_True;
- aWordsLB.SetCurEntry(pEntry);
- bDoNothing=sal_False;
- pFirstSel = pEntry;
- aReplaceED.SetText(aWordsLB.GetEntryText(pEntry, 1));
-
- if (CDE_SIMILAR == eCmpRes)
- {
- aNewReplaceText = sModify;
- bEnableNewReplace = TRUE;
- }
- bFound= sal_True;
- break;
- }
- else if(getNormDicEntry_Impl(aTestStr).Search(
- getNormDicEntry_Impl( rEntry ) ) == 0
- && !bTmpSelEntry)
- {
- bDoNothing=sal_True;
- aWordsLB.MakeVisible(pEntry);
- bDoNothing=sal_False;
- bTmpSelEntry=sal_True;
-
- aNewReplaceText = sNew;
- bEnableNewReplace = TRUE;
- }
- }
-
- if(!bFound)
- {
- aWordsLB.SelectAll(sal_False);
- pFirstSel = 0;
-
- aNewReplaceText = sNew;
- bEnableNewReplace = TRUE;
- }
- bEnableDelete = CDE_DIFFERENT != eCmpRes;
- }
- else if(aWordsLB.GetEntryCount()>0)
- {
- SvLBoxEntry* pEntry = aWordsLB.GetEntry( 0 );
- bDoNothing=sal_True;
- aWordsLB.MakeVisible(pEntry);
- bDoNothing=sal_False;
- }
- }
- else if(pEdt == &aReplaceED)
- {
- String aReplaceText;
- String aWordText;
- if (pFirstSel) // a aWordsLB entry is selected
- {
- aWordText = aWordsLB.GetEntryText( pFirstSel, 0 );
- aReplaceText = aWordsLB.GetEntryText( pFirstSel, 1 );
-
- aNewReplaceText = sModify;
- bEnableDelete = TRUE;
- }
- BOOL bIsChange =
- CDE_EQUAL != cmpDicEntry_Impl(aWordED.GetText(), aWordText)
- || CDE_EQUAL != cmpDicEntry_Impl(aReplaceED.GetText(), aReplaceText);
- if (aWordED.GetText().Len() && bIsChange)
- bEnableNewReplace = TRUE;
- }
-
- aNewReplacePB.SetText( aNewReplaceText );
- aNewReplacePB.Enable( bEnableNewReplace && !IsDicReadonly_Impl() );
- aDeletePB .Enable( bEnableDelete && !IsDicReadonly_Impl() );
-
- return 0;
-}
-
-//=========================================================
-//SvxDictEdit
-//=========================================================
-void SvxDictEdit::KeyInput( const KeyEvent& rKEvt )
-{
- const KeyCode aKeyCode = rKEvt.GetKeyCode();
- const sal_uInt16 nModifier = aKeyCode.GetModifier();
- if( aKeyCode.GetCode() == KEY_RETURN )
- {
- //wird bei Enter nichts getan, dann doch die Basisklasse rufen
- // um den Dialog zu schliessen
- if(!nModifier && !aActionLink.Call(this))
- Edit::KeyInput(rKEvt);
- }
- else if(bSpaces || aKeyCode.GetCode() != KEY_SPACE)
- Edit::KeyInput(rKEvt);
-}
-
-
diff --git a/svx/source/cui/optdict.hxx b/svx/source/cui/optdict.hxx
deleted file mode 100644
index 3846a7cf24..0000000000
--- a/svx/source/cui/optdict.hxx
+++ /dev/null
@@ -1,191 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optdict.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTDICT_HXX
-#define _SVX_OPTDICT_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#include <vcl/group.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/timer.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/decoview.hxx>
-#include <com/sun/star/util/Language.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-
-#include <svx/simptabl.hxx>
-#include <svx/langbox.hxx>
-
-namespace com{namespace sun{namespace star{
-namespace linguistic2{
- class XDictionary;
- class XSpellChecker1;
- class XSpellChecker;
-}}}}
-
-// forward ---------------------------------------------------------------
-
-
-// class SvxNewDictionaryDialog ------------------------------------------
-
-class SvxNewDictionaryDialog : public ModalDialog
-{
-private:
- FixedText aNameText;
- Edit aNameEdit;
- FixedText aLanguageText;
- SvxLanguageBox aLanguageLB;
- CheckBox aExceptBtn;
- FixedLine aNewDictBox;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XDictionary > xNewDic;
-
-#ifdef _SVX_OPTDICT_CXX
- DECL_LINK( OKHdl_Impl, Button * );
- DECL_LINK( ModifyHdl_Impl, Edit * );
-#endif
-
-public:
- SvxNewDictionaryDialog( Window* pParent,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl );
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XDictionary >
- GetNewDictionary() { return xNewDic; }
-};
-
-// class SvxDictEdit ----------------------------------------------------
-
-class SvxDictEdit : public Edit
-{
- Link aActionLink;
- sal_Bool bSpaces;
-
- public:
- SvxDictEdit(Window* pParent, const ResId& rResId) :
- Edit(pParent, rResId), bSpaces(sal_False){}
-
- void SetActionHdl( const Link& rLink )
- { aActionLink = rLink;}
-
- void SetSpaces(sal_Bool bSet)
- {bSpaces = bSet;}
-
- virtual void KeyInput( const KeyEvent& rKEvent );
-};
-
-// class SvxEditDictionaryDialog -----------------------------------------
-
-class SvxEditDictionaryDialog : public ModalDialog
-{
-private:
-
- FixedText aBookFT;
- ListBox aAllDictsLB;
- FixedText aLangFT;
- SvxLanguageBox aLangLB;
-
- FixedText aWordFT;
- SvxDictEdit aWordED;
- FixedText aReplaceFT;
- SvxDictEdit aReplaceED;
- SvTabListBox aWordsLB;
- PushButton aNewReplacePB;
- PushButton aDeletePB;
- FixedLine aEditDictsBox;
-
- CancelButton aCloseBtn;
- HelpButton aHelpBtn;
- String sModify;
- String sNew;
- DecorationView aDecoView;
-
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XDictionary > > aDics; //! snapshot copy to work on
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
-
- short nOld;
- long nWidth;
- sal_Bool bFirstSelect;
- sal_Bool bDoNothing;
- BOOL bDicIsReadonly;
-
-#ifdef _SVX_OPTDICT_CXX
- DECL_LINK( SelectBookHdl_Impl, ListBox * );
- DECL_LINK( SelectLangHdl_Impl, ListBox * );
- DECL_LINK(SelectHdl, SvTabListBox*);
- DECL_LINK(NewDelHdl, PushButton*);
- DECL_LINK(ModifyHdl, Edit*);
-
-
- void ShowWords_Impl( sal_uInt16 nId );
- void SetLanguage_Impl( ::com::sun::star::util::Language nLanguage );
- sal_Bool IsDicReadonly_Impl() const { return bDicIsReadonly; }
- void SetDicReadonly_Impl( ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XDictionary > &xDic );
-
- void RemoveDictEntry(SvLBoxEntry* pEntry);
- USHORT GetLBInsertPos(const String &rDicWord);
-
-#endif
-
-protected:
-
- virtual void Paint( const Rectangle& rRect );
-
-public:
- SvxEditDictionaryDialog( Window* pParent,
- const String& rName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSpellChecker1> &xSpl );
- ~SvxEditDictionaryDialog();
-
- sal_uInt16 GetSelectedDict() {return aAllDictsLB.GetSelectEntryPos();}
-};
-
-
-#endif
-
diff --git a/svx/source/cui/optfltr.cxx b/svx/source/cui/optfltr.cxx
deleted file mode 100644
index f8d185f107..0000000000
--- a/svx/source/cui/optfltr.cxx
+++ /dev/null
@@ -1,444 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optfltr.cxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <svtools/moduleoptions.hxx>
-
-#include <svtools/fltrcfg.hxx>
-#include "optfltr.hxx"
-#include "optfltr.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <svx/dialmgr.hxx>
-
-enum MSFltrPg2_CheckBoxEntries {
- Math,
- Writer,
- Calc,
- Impress,
- InvalidCBEntry
-};
-
-#define CBCOL_FIRST 0
-#define CBCOL_SECOND 1
-
-// -----------------------------------------------------------------------
-
-OfaMSFilterTabPage::OfaMSFilterTabPage(Window* pParent, const SfxItemSet& rSet)
- : SfxTabPage( pParent, SVX_RES( RID_OFAPAGE_MSFILTEROPT ), rSet ),
- aMSWordGB ( this, SVX_RES( GB_WORD ) ),
- aWBasicCodeCB ( this, SVX_RES( CB_WBAS_CODE ) ),
- aWBasicStgCB ( this, SVX_RES( CB_WBAS_STG ) ),
- aMSExcelGB ( this, SVX_RES( GB_EXCEL ) ),
- aEBasicCodeCB ( this, SVX_RES( CB_EBAS_CODE ) ),
- aEBasicExectblCB( this, SVX_RES( CB_EBAS_EXECTBL ) ),
- aEBasicStgCB ( this, SVX_RES( CB_EBAS_STG ) ),
- aMSPPointGB ( this, SVX_RES( GB_PPOINT ) ),
- aPBasicCodeCB ( this, SVX_RES( CB_PBAS_CODE ) ),
- aPBasicStgCB ( this, SVX_RES( CB_PBAS_STG ) )
-{
- FreeResource();
-
- aEBasicCodeCB.SetClickHdl( LINK( this, OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl ) );
-}
-
-OfaMSFilterTabPage::~OfaMSFilterTabPage()
-{
-}
-
-IMPL_LINK( OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl, CheckBox*, EMPTYARG )
-{
- aEBasicExectblCB.Enable( aEBasicCodeCB.IsChecked() );
- return 0;
-}
-
-SfxTabPage* OfaMSFilterTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return new OfaMSFilterTabPage( pParent, rAttrSet );
-}
-
-BOOL OfaMSFilterTabPage::FillItemSet( SfxItemSet& )
-{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
-
- BOOL bFlag;
- if( aWBasicCodeCB.GetSavedValue() != (bFlag = aWBasicCodeCB.IsChecked()))
- pOpt->SetLoadWordBasicCode( bFlag );
- if( aWBasicStgCB.GetSavedValue() != (bFlag = aWBasicStgCB.IsChecked()))
- pOpt->SetLoadWordBasicStorage( bFlag );
-
- if( aEBasicCodeCB.GetSavedValue() != (bFlag = aEBasicCodeCB.IsChecked()))
- pOpt->SetLoadExcelBasicCode( bFlag );
- if( aEBasicExectblCB.GetSavedValue() != (bFlag = aEBasicExectblCB.IsChecked()))
- pOpt->SetLoadExcelBasicExecutable( bFlag );
- if( aEBasicStgCB.GetSavedValue() != (bFlag = aEBasicStgCB.IsChecked()))
- pOpt->SetLoadExcelBasicStorage( bFlag );
-
- if( aPBasicCodeCB.GetSavedValue() != (bFlag = aPBasicCodeCB.IsChecked()))
- pOpt->SetLoadPPointBasicCode( bFlag );
- if( aPBasicStgCB.GetSavedValue() != (bFlag = aPBasicStgCB.IsChecked()))
- pOpt->SetLoadPPointBasicStorage( bFlag );
-
- return FALSE;
-}
-
-/*-----------------02.09.96 13.47-------------------
-
---------------------------------------------------*/
-
-void OfaMSFilterTabPage::Reset( const SfxItemSet& )
-{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
-
- aWBasicCodeCB.Check( pOpt->IsLoadWordBasicCode() );
- aWBasicCodeCB.SaveValue();
- aWBasicStgCB.Check( pOpt->IsLoadWordBasicStorage() );
- aWBasicStgCB.SaveValue();
-
- aEBasicCodeCB.Check( pOpt->IsLoadExcelBasicCode() );
- aEBasicCodeCB.SaveValue();
- aEBasicExectblCB.Check( pOpt->IsLoadExcelBasicExecutable() );
- aEBasicExectblCB.SaveValue();
- aEBasicStgCB.Check( pOpt->IsLoadExcelBasicStorage() );
- aEBasicStgCB.SaveValue();
- LoadExcelBasicCheckHdl_Impl( &aEBasicCodeCB );
-
- aPBasicCodeCB.Check( pOpt->IsLoadPPointBasicCode() );
- aPBasicCodeCB.SaveValue();
- aPBasicStgCB.Check( pOpt->IsLoadPPointBasicStorage() );
- aPBasicStgCB.SaveValue();
-
-}
-
-/*-----------------29.06.00 13:22-------------------
- *
- * --------------------------------------------------*/
-OfaMSFilterTabPage2::OfaMSFilterTabPage2( Window* pParent,
- const SfxItemSet& rSet )
- : SfxTabPage( pParent, SVX_RES( RID_OFAPAGE_MSFILTEROPT2 ), rSet ),
- aCheckLB ( this, SVX_RES( CLB_SETTINGS )),
- aHeader1FT ( this, SVX_RES( FT_HEADER1_EXPLANATION )),
- aHeader2FT ( this, SVX_RES( FT_HEADER2_EXPLANATION )),
- sHeader1 ( SVX_RES( ST_HEADER1 )),
- sHeader2 ( SVX_RES( ST_HEADER2 )),
- sChgToFromMath ( SVX_RES( ST_CHG_MATH )),
- sChgToFromWriter ( SVX_RES( ST_CHG_WRITER )),
- sChgToFromCalc ( SVX_RES( ST_CHG_CALC )),
- sChgToFromImpress ( SVX_RES( ST_CHG_IMPRESS )),
- pCheckButtonData(0)
-{
- FreeResource();
-
- static long aStaticTabs[] = { 3, 0, 20, 40 };
- aCheckLB.SvxSimpleTable::SetTabs( aStaticTabs );
-
- String sHeader( sHeader1 );
- (( sHeader += '\t' ) += sHeader2 ) += '\t';
- aCheckLB.InsertHeaderEntry( sHeader, HEADERBAR_APPEND,
- HIB_CENTER | HIB_VCENTER | HIB_FIXEDPOS | HIB_FIXED );
-
- aCheckLB.SetHelpId( HID_OFAPAGE_MSFLTR2_CLB );
- aCheckLB.SetWindowBits( WB_HSCROLL| WB_VSCROLL );
-}
-
-OfaMSFilterTabPage2::~OfaMSFilterTabPage2()
-{
- delete pCheckButtonData;
-}
-
-SfxTabPage* OfaMSFilterTabPage2::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return new OfaMSFilterTabPage2( pParent, rAttrSet );
-}
-
-BOOL OfaMSFilterTabPage2::FillItemSet( SfxItemSet& )
-{
- BOOL bModified = FALSE;
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
-
- static struct ChkCBoxEntries{
- MSFltrPg2_CheckBoxEntries eType;
- BOOL (SvtFilterOptions:: *FnIs)() const;
- void (SvtFilterOptions:: *FnSet)( BOOL bFlag );
- } aChkArr[] = {
- { Math, &SvtFilterOptions::IsMathType2Math,
- &SvtFilterOptions::SetMathType2Math },
- { Math, &SvtFilterOptions::IsMath2MathType,
- &SvtFilterOptions::SetMath2MathType },
- { Writer, &SvtFilterOptions::IsWinWord2Writer,
- &SvtFilterOptions::SetWinWord2Writer },
- { Writer, &SvtFilterOptions::IsWriter2WinWord,
- &SvtFilterOptions::SetWriter2WinWord },
- { Calc, &SvtFilterOptions::IsExcel2Calc,
- &SvtFilterOptions::SetExcel2Calc },
- { Calc, &SvtFilterOptions::IsCalc2Excel,
- &SvtFilterOptions::SetCalc2Excel },
- { Impress, &SvtFilterOptions::IsPowerPoint2Impress,
- &SvtFilterOptions::SetPowerPoint2Impress },
- { Impress, &SvtFilterOptions::IsImpress2PowerPoint,
- &SvtFilterOptions::SetImpress2PowerPoint },
- { InvalidCBEntry, 0, 0 }
- };
-
- BOOL bCheck, bFirst = TRUE;
- for( const ChkCBoxEntries* pArr = aChkArr;
- InvalidCBEntry != pArr->eType; ++pArr, bFirst = !bFirst )
- {
- USHORT nCol = bFirst ? 1 : 2;
- SvLBoxEntry* pEntry = GetEntry4Type( pArr->eType );
- if( pEntry )
- {
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem( nCol ));
- if( pItem && ((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON )
- {
- USHORT nButtonFlags = pItem->GetButtonFlags();
- bCheck = SV_BUTTON_CHECKED ==
- pCheckButtonData->ConvertToButtonState( nButtonFlags );
-
- if( bCheck != (pOpt->*pArr->FnIs)() )
- {
- bModified = TRUE;
- (pOpt->*pArr->FnSet)( bCheck );
- }
- }
- }
- }
-
- return TRUE;
-}
-
-void OfaMSFilterTabPage2::Reset( const SfxItemSet& )
-{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
-
- aCheckLB.SetUpdateMode(FALSE);
- aCheckLB.Clear();
-
- SvtModuleOptions aModuleOpt;
-
- // int the same sequence as the enums of MSFltrPg2_CheckBoxEntries
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
- InsertEntry( sChgToFromMath, static_cast< sal_IntPtr >( Math ) );
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
- InsertEntry( sChgToFromWriter, static_cast< sal_IntPtr >( Writer ) );
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
- InsertEntry( sChgToFromCalc, static_cast< sal_IntPtr >( Calc ) );
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
- InsertEntry( sChgToFromImpress, static_cast< sal_IntPtr >( Impress ) );
-
- static struct ChkCBoxEntries{
- MSFltrPg2_CheckBoxEntries eType;
- BOOL (SvtFilterOptions:: *FnIs)() const;
- } aChkArr[] = {
- { Math, &SvtFilterOptions::IsMathType2Math },
- { Math, &SvtFilterOptions::IsMath2MathType },
- { Writer, &SvtFilterOptions::IsWinWord2Writer },
- { Writer, &SvtFilterOptions::IsWriter2WinWord },
- { Calc, &SvtFilterOptions::IsExcel2Calc },
- { Calc, &SvtFilterOptions::IsCalc2Excel },
- { Impress, &SvtFilterOptions::IsPowerPoint2Impress },
- { Impress, &SvtFilterOptions::IsImpress2PowerPoint },
- { InvalidCBEntry, NULL }
- };
-
- BOOL bFirst = TRUE;
- for( const ChkCBoxEntries* pArr = aChkArr;
- InvalidCBEntry != pArr->eType; ++pArr, bFirst = !bFirst )
- {
- USHORT nCol = bFirst ? 1 : 2;
- SvLBoxEntry* pEntry = GetEntry4Type( static_cast< sal_IntPtr >( pArr->eType ) );
- if( pEntry )
- {
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem( nCol ));
- if( pItem && ((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON )
- {
- if( (pOpt->*pArr->FnIs)() )
- pItem->SetStateChecked();
- else
- pItem->SetStateUnchecked();
- aCheckLB.InvalidateEntry( pEntry );
- }
- }
- }
- aCheckLB.SetUpdateMode( TRUE );
-}
-
-void OfaMSFilterTabPage2::InsertEntry( const String& _rTxt, sal_IntPtr _nType )
-{
- SvLBoxEntry* pEntry = new SvLBoxEntry;
-
- if( !pCheckButtonData )
- pCheckButtonData = new SvLBoxButtonData( &aCheckLB );
-
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0));
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox,
- 0, pCheckButtonData ) );
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox,
- 0, pCheckButtonData ) );
- pEntry->AddItem( new SvLBoxString( pEntry, 0, _rTxt ) );
-
- pEntry->SetUserData( (void*)_nType );
- aCheckLB.Insert( pEntry );
-}
-
-SvLBoxEntry* OfaMSFilterTabPage2::GetEntry4Type( sal_IntPtr _nType ) const
-{
- SvLBoxEntry* pEntry = aCheckLB.First();
- while ( pEntry )
- {
- if ( _nType == sal_IntPtr( pEntry->GetUserData() ) )
- return pEntry;
- pEntry = aCheckLB.Next( pEntry );
- }
- return NULL;
-}
-
-void OfaMSFilterTabPage2::MSFltrSimpleTable::SetTabs()
-{
- SvxSimpleTable::SetTabs();
- USHORT nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
-
- if( aTabs.Count() > 1 )
- {
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(1);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
- }
- if( aTabs.Count() > 2 )
- {
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(2);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
- }
-}
-
-void OfaMSFilterTabPage2::MSFltrSimpleTable::HBarClick()
-{
- // Sortierung durch diese Ueberladung abgeklemmt
-}
-/* -----------------------------2002/06/20 11:51------------------------------
-
- ---------------------------------------------------------------------------*/
-void OfaMSFilterTabPage2::MSFltrSimpleTable::SetCheckButtonState(
- SvLBoxEntry* pEntry, USHORT nCol, SvButtonState eState)
-{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
-
- DBG_ASSERT(pItem,"SetCheckButton:Item not found");
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- switch( eState )
- {
- case SV_BUTTON_CHECKED:
- pItem->SetStateChecked();
- break;
-
- case SV_BUTTON_UNCHECKED:
- pItem->SetStateUnchecked();
- break;
-
- case SV_BUTTON_TRISTATE:
- pItem->SetStateTristate();
- break;
- }
- InvalidateEntry( pEntry );
- }
-}
-/* -----------------------------2002/06/20 11:56------------------------------
-
- ---------------------------------------------------------------------------*/
-SvButtonState OfaMSFilterTabPage2::MSFltrSimpleTable::GetCheckButtonState(
- SvLBoxEntry* pEntry, USHORT nCol ) const
-{
- SvButtonState eState = SV_BUTTON_UNCHECKED;
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1));
- DBG_ASSERT(pItem,"GetChButnState:Item not found");
-
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- USHORT nButtonFlags = pItem->GetButtonFlags();
- eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
- }
-
- return eState;
-}
-/* -----------------------------2002/06/20 11:57------------------------------
-
- ---------------------------------------------------------------------------*/
-void OfaMSFilterTabPage2::MSFltrSimpleTable::CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked)
-{
- if ( nPos < GetEntryCount() )
- SetCheckButtonState(
- GetEntry(nPos),
- nCol,
- bChecked ? SvButtonState( SV_BUTTON_CHECKED ) :
- SvButtonState( SV_BUTTON_UNCHECKED ) );
-}
-/* -----------------------------2002/06/20 11:51------------------------------
-
- ---------------------------------------------------------------------------*/
-void OfaMSFilterTabPage2::MSFltrSimpleTable::KeyInput( const KeyEvent& rKEvt )
-{
- if(!rKEvt.GetKeyCode().GetModifier() &&
- KEY_SPACE == rKEvt.GetKeyCode().GetCode())
- {
- ULONG nSelPos = GetModel()->GetAbsPos(GetCurEntry());
- USHORT nCol = GetCurrentTabPos() - 1;
- if ( nCol < 2 )
- {
- SvLBoxEntry* pEntry = GetEntry( nSelPos );
- sal_Bool bIsChecked = ( GetCheckButtonState( pEntry, nCol ) == SV_BUTTON_CHECKED );
- CheckEntryPos( nSelPos, nCol, !bIsChecked );
- CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)pEntry );
- }
- else
- {
- USHORT nCheck = GetCheckButtonState( GetEntry(nSelPos), 1 ) == SV_BUTTON_CHECKED ? 1 : 0;
- if(GetCheckButtonState( GetEntry(nSelPos), 0 ))
- nCheck += 2;
- nCheck--;
- nCheck &= 3;
- CheckEntryPos(nSelPos, 1, 0 != (nCheck & 1));
- CheckEntryPos(nSelPos, 0, 0 != (nCheck & 2));
- }
- }
- else
- SvxSimpleTable::KeyInput(rKEvt);
-}
-
diff --git a/svx/source/cui/optfltr.hrc b/svx/source/cui/optfltr.hrc
deleted file mode 100644
index e53179ebca..0000000000
--- a/svx/source/cui/optfltr.hrc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optfltr.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTFLTR_HRC
-#define _SVX_OPTFLTR_HRC
-
-// defines ------------------------------------------------------------------
-
-#define GB_WORD 1
-#define GB_EXCEL 2
-#define GB_PPOINT 3
-
-#define CB_WBAS_CODE 1
-#define CB_WBAS_STG 2
-#define CB_EBAS_CODE 3
-#define CB_EBAS_EXECTBL 4
-#define CB_EBAS_STG 5
-#define CB_PBAS_CODE 6
-#define CB_PBAS_STG 7
-
-#define CLB_SETTINGS 1
-#define ST_CHG_MATH 1
-#define ST_CHG_WRITER 2
-#define ST_CHG_CALC 3
-#define ST_CHG_IMPRESS 4
-#define ST_HEADER1 5
-#define ST_HEADER2 6
-#define FT_HEADER1_EXPLANATION 1
-#define FT_HEADER2_EXPLANATION 2
-
-#endif
-
diff --git a/svx/source/cui/optfltr.hxx b/svx/source/cui/optfltr.hxx
deleted file mode 100644
index e8acba8e74..0000000000
--- a/svx/source/cui/optfltr.hxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optfltr.hxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _OFA_OPTFLTR_HXX
-#define _OFA_OPTFLTR_HXX
-
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-#include <vcl/fixed.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/simptabl.hxx>
-
-
-
-class OfaMSFilterTabPage : public SfxTabPage
-{
- FixedLine aMSWordGB;
- CheckBox aWBasicCodeCB;
- CheckBox aWBasicStgCB;
- FixedLine aMSExcelGB;
- CheckBox aEBasicCodeCB;
- CheckBox aEBasicExectblCB;
- CheckBox aEBasicStgCB;
- FixedLine aMSPPointGB;
- CheckBox aPBasicCodeCB;
- CheckBox aPBasicStgCB;
-
- OfaMSFilterTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~OfaMSFilterTabPage();
-
- DECL_LINK( LoadExcelBasicCheckHdl_Impl, CheckBox* );
-public:
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-class OfaMSFilterTabPage2 : public SfxTabPage
-{
- class MSFltrSimpleTable : public SvxSimpleTable
- {
- using SvTreeListBox::GetCheckButtonState;
- using SvTreeListBox::SetCheckButtonState;
- using SvxSimpleTable::SetTabs;
-
- void CheckEntryPos(ULONG nPos, USHORT nCol, BOOL bChecked);
- SvButtonState GetCheckButtonState( SvLBoxEntry*, USHORT nCol ) const;
- void SetCheckButtonState( SvLBoxEntry*, USHORT nCol, SvButtonState );
- protected:
- virtual void SetTabs();
- virtual void HBarClick();
- virtual void KeyInput( const KeyEvent& rKEvt );
-
- public:
- MSFltrSimpleTable(Window* pParent, const ResId& rResId ) :
- SvxSimpleTable( pParent, rResId ){}
- };
-
- MSFltrSimpleTable aCheckLB;
- FixedText aHeader1FT, aHeader2FT;
- String sHeader1, sHeader2;
- String sChgToFromMath,
- sChgToFromWriter,
- sChgToFromCalc,
- sChgToFromImpress;
- SvLBoxButtonData* pCheckButtonData;
-
- OfaMSFilterTabPage2( Window* pParent, const SfxItemSet& rSet );
- virtual ~OfaMSFilterTabPage2();
-
- void InsertEntry( const String& _rTxt, sal_IntPtr _nType );
- SvLBoxEntry* GetEntry4Type( sal_IntPtr _nType ) const;
-
-public:
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-
-#endif //
-
-
diff --git a/svx/source/cui/optfltr.src b/svx/source/cui/optfltr.src
deleted file mode 100644
index 9dd3dd2cdf..0000000000
--- a/svx/source/cui/optfltr.src
+++ /dev/null
@@ -1,204 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optfltr.src,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include -----------------------------------------------------------------
-#include "optfltr.hrc"
-#include <svx/dialogs.hrc>
- // pragma ------------------------------------------------------------------
-
-// RID_OFAPAGE_MSFILTEROPT -----------------------------------------------------
-TabPage RID_OFAPAGE_MSFILTEROPT
-{
- // HelpId = ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
-
- FixedLine GB_WORD
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Microsoft Word 97/2000/XP";
- };
- CheckBox CB_WBAS_CODE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Load Basic ~code";
- };
- CheckBox CB_WBAS_STG
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Save ~original Basic code";
- };
-
- FixedLine GB_EXCEL
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Microsoft Excel 97/2000/XP";
- };
- CheckBox CB_EBAS_CODE
- {
- Pos = MAP_APPFONT ( 12 , 55 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Lo~ad Basic code";
- };
- CheckBox CB_EBAS_EXECTBL
- {
- Pos = MAP_APPFONT ( 22 , 69 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "E~xecutable code";
- };
- CheckBox CB_EBAS_STG
- {
- Pos = MAP_APPFONT ( 12 , 83 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Sa~ve original Basic code";
- };
-
- FixedLine GB_PPOINT
- {
- Pos = MAP_APPFONT ( 6 , 99 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Microsoft PowerPoint 97/2000/XP";
- };
- CheckBox CB_PBAS_CODE
- {
- Pos = MAP_APPFONT ( 12 , 110 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Load Ba~sic code";
- };
- CheckBox CB_PBAS_STG
- {
- Pos = MAP_APPFONT ( 12 , 124 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Sav~e original Basic code";
- };
-};
-
-// RID_OFAPAGE_MSFILTEROPT2 -----------------------------------------------------
-TabPage RID_OFAPAGE_MSFILTEROPT2
-{
- // HelpId = ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
-
- Control CLB_SETTINGS
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 248 , 147 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- String ST_HEADER1
- {
- Text [ en-US ] = "[L]";
- };
- String ST_HEADER2
- {
- Text [ en-US ] = "[S]";
- };
- FixedText FT_HEADER1_EXPLANATION
- {
- Pos = MAP_APPFONT ( 6 , 160 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "[L]: Load and convert the object";
- };
- FixedText FT_HEADER2_EXPLANATION
- {
- Pos = MAP_APPFONT ( 6 , 171 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "[S]: Convert and save the object";
- };
- String ST_CHG_MATH
- {
- Text [ en-US ] = "MathType to %PRODUCTNAME Math / %PRODUCTNAME Math to MathType";
- };
- String ST_CHG_WRITER
- {
- Text [ en-US ] = "WinWord to %PRODUCTNAME Writer / %PRODUCTNAME Writer to WinWord";
- };
- String ST_CHG_CALC
- {
- Text [ en-US ] = "Excel to %PRODUCTNAME Calc / %PRODUCTNAME Calc to Excel";
- };
- String ST_CHG_IMPRESS
- {
- Text [ en-US ] = "PowerPoint to %PRODUCTNAME Impress / %PRODUCTNAME Impress to PowerPoint";
- };
-};
-
- // ******************************************************************* EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/optgdlg.cxx b/svx/source/cui/optgdlg.cxx
deleted file mode 100644
index 12910c0302..0000000000
--- a/svx/source/cui/optgdlg.cxx
+++ /dev/null
@@ -1,1926 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optgdlg.cxx,v $
- * $Revision: 1.53.20.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <svtools/zforlist.hxx>
-#include <goodies/grfmgr.hxx>
-#include <svtools/flagitem.hxx>
-#include <sfx2/dispatch.hxx>
-#include <svtools/lingucfg.hxx>
-#include <svtools/szitem.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/imgmgr.hxx>
-#include <vcl/configsettings.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/mnemonic.hxx>
-#include <i18npool/mslangid.hxx>
-#include <svtools/useroptions.hxx>
-#include <svtools/cacheoptions.hxx>
-#include <svtools/fontoptions.hxx>
-#include <svtools/menuoptions.hxx>
-#include <svtools/startoptions.hxx>
-#include <svtools/languageoptions.hxx>
-#include <svtools/miscopt.hxx>
-#include <svtools/printwarningoptions.hxx>
-#include <svtools/syslocaleoptions.hxx>
-#include <svtools/helpopt.hxx>
-#include <svtools/accessibilityoptions.hxx>
-#include <unotools/configitem.hxx>
-#include <sfx2/objsh.hxx>
-#include <comphelper/types.hxx>
-#include <svtools/ctloptions.hxx>
-#include <svtools/langtab.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <unotools/configmgr.hxx>
-#include "cuioptgenrl.hxx"
-#include "optpath.hxx"
-#include "optsave.hxx"
-#include <svx/optlingu.hxx>
-#include <svx/xpool.hxx>
-#include "dlgutil.hxx"
-#ifndef _SVX_TAB_AREA_HXX
-#include "cuitabarea.hxx"
-#endif
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include "unolingu.hxx"
-#ifndef _SVX_SVXIDS_HRC
-#include <svx/svxids.hrc>
-#endif
-#include <svx/langitem.hxx>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-#include <rtl/ustrbuf.hxx>
-
-
-#include <svx/dialmgr.hxx>
-#include <svtools/helpopt.hxx>
-#include <svtools/saveopt.hxx>
-
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/XSet.hpp>
-#include <com/sun/star/i18n/ScriptType.hpp>
-
-#include <vcl/svapp.hxx>
-
-#include "optgdlg.hrc"
-#include "optgdlg.hxx"
-#include "ofaitem.hxx"
-#include <svtools/apearcfg.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
-
-#define CONFIG_LANGUAGES "OfficeLanguages"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-using namespace ::utl;
-using ::rtl::OString;
-using ::rtl::OUString;
-
-#define C2U(cChar) OUString::createFromAscii(cChar)
-
-#define MAX_PROGRAM_ENTRIES 3
-
-// class OfaMiscTabPage --------------------------------------------------
-
-int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
-{
- if ( pSet_ )
- FillItemSet( *pSet_ );
- return LEAVE_PAGE;
-}
-
-namespace
-{
- ::rtl::OUString impl_SystemFileOpenServiceName()
- {
- const ::rtl::OUString &rDesktopEnvironment =
- Application::GetDesktopEnvironment();
-
- if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) )
- {
- #ifdef ENABLE_GTK
- return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFilePicker" );
- #else
- return rtl::OUString();
- #endif
- }
- else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) )
- {
- #ifdef ENABLE_KDE4
- return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDE4FilePicker" );
- #else
- return rtl::OUString();
- #endif
- }
- else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
- {
- #ifdef ENABLE_KDE
- return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.KDEFilePicker" );
- #else
- return rtl::OUString();
- #endif
- }
- #if defined WNT
- return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
- #elif (defined MACOSX && defined QUARTZ)
- return ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFilePicker" );
- #else
- return rtl::OUString();
- #endif
- }
-
- sal_Bool lcl_HasSystemFilePicker()
- {
- Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
- sal_Bool bRet = sal_False;
-
- Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY );
- Reference< XSet > xSet( xFactory, UNO_QUERY );
-
- if ( ! xEnumAccess.is() || ! xSet.is() )
- return bRet;
-
- try
- {
- ::rtl::OUString aFileService = impl_SystemFileOpenServiceName();
- Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService );
- if ( xEnum.is() && xEnum->hasMoreElements() )
- bRet = sal_True;
- }
-
- catch( IllegalArgumentException ) {}
- catch( ElementExistException ) {}
- return bRet;
- }
-}
-
-// -----------------------------------------------------------------------
-
-OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( OFA_TP_MISC ), rSet ),
-
- aHelpFL ( this, SVX_RES( FL_HELP ) ),
- aToolTipsCB ( this, SVX_RES( CB_TOOLTIP ) ),
- aExtHelpCB ( this, SVX_RES( CB_EXTHELP ) ),
- aHelpAgentCB ( this, SVX_RES( CB_HELPAGENT ) ),
- aHelpAgentResetBtn ( this, SVX_RES( PB_HELPAGENT_RESET ) ),
- aHelpFormatFT ( this, SVX_RES( FT_HELPFORMAT ) ),
- aHelpFormatLB ( this, SVX_RES( LB_HELPFORMAT ) ),
- aFileDlgFL ( this, SVX_RES( FL_FILEDLG ) ),
- aFileDlgROImage ( this, SVX_RES( FI_FILEDLG_RO ) ),
- aFileDlgCB ( this, SVX_RES( CB_FILEDLG ) ),
- aPrintDlgFL ( this, SVX_RES( FL_PRINTDLG ) ),
- aPrintDlgCB ( this, SVX_RES( CB_PRINTDLG ) ),
- aDocStatusFL ( this, SVX_RES( FL_DOCSTATUS ) ),
- aDocStatusCB ( this, SVX_RES( CB_DOCSTATUS ) ),
- aTwoFigureFL ( this, SVX_RES( FL_TWOFIGURE ) ),
- aInterpretFT ( this, SVX_RES( FT_INTERPRET ) ),
- aYearValueField ( this, SVX_RES( NF_YEARVALUE ) ),
- aToYearFT ( this, SVX_RES( FT_TOYEAR ) )
-
-{
- FreeResource();
-
- if (!lcl_HasSystemFilePicker())
- {
- aFileDlgFL.Hide();
- aFileDlgCB.Hide();
- }
-
- #if ! defined(QUARTZ)
- aPrintDlgFL.Hide();
- aPrintDlgCB.Hide();
- #endif
-
- if ( !aFileDlgCB.IsVisible() )
- {
- // rearrange the following controls
- Point aNewPos = aDocStatusFL.GetPosPixel();
- long nDelta = aNewPos.Y() - aFileDlgFL.GetPosPixel().Y();
-
- Window* pWins[] =
- {
- &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
- &aInterpretFT, &aYearValueField, &aToYearFT
- };
- Window** pCurrent = pWins;
- const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
- for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
- {
- aNewPos = (*pCurrent)->GetPosPixel();
- aNewPos.Y() -= nDelta;
- (*pCurrent)->SetPosPixel( aNewPos );
- }
- }
- else if ( SvtMiscOptions().IsUseSystemFileDialogReadOnly() )
- {
- aFileDlgROImage.Show();
- aFileDlgCB.Disable();
- }
-
- if ( aPrintDlgCB.IsVisible() )
- {
- // rearrange the following controls
- Point aNewPos = aDocStatusFL.GetPosPixel();
- long nDelta = aNewPos.Y() - aFileDlgFL.GetPosPixel().Y();
-
- Window* pWins[] =
- {
- &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
- &aInterpretFT, &aYearValueField, &aToYearFT
- };
- Window** pCurrent = pWins;
- const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
- for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
- {
- aNewPos = (*pCurrent)->GetPosPixel();
- aNewPos.Y() += nDelta;
- (*pCurrent)->SetPosPixel( aNewPos );
- }
- }
-
- // at least the button is as wide as its text
- long nTxtWidth = aHelpAgentResetBtn.GetTextWidth( aHelpAgentResetBtn.GetText() );
- Size aBtnSz = aHelpAgentResetBtn.GetSizePixel();
- if ( aBtnSz.Width() < nTxtWidth )
- {
- aBtnSz.Width() = nTxtWidth;
- aHelpAgentResetBtn.SetSizePixel( aBtnSz );
- }
-
- aStrDateInfo = aToYearFT.GetText();
- aYearValueField.SetModifyHdl( LINK( this, OfaMiscTabPage, TwoFigureHdl ) );
- Link aLink = LINK( this, OfaMiscTabPage, TwoFigureConfigHdl );
- aYearValueField.SetDownHdl( aLink );
- aYearValueField.SetUpHdl( aLink );
- aYearValueField.SetLoseFocusHdl( aLink );
- aYearValueField.SetFirstHdl( aLink );
- TwoFigureConfigHdl( &aYearValueField );
-
- SetExchangeSupport();
-
- aLink = LINK( this, OfaMiscTabPage, HelpCheckHdl_Impl );
- aToolTipsCB.SetClickHdl( aLink );
- aHelpAgentCB.SetClickHdl( aLink );
- aHelpAgentResetBtn.SetClickHdl( LINK( this, OfaMiscTabPage, HelpAgentResetHdl_Impl ) );
-
- //fill default names as user data
- static const char* aHelpFormatNames[] =
- {
- "Default",
- "HighContrast1",
- "HighContrast2",
- "HighContrastBlack",
- "HighContrastWhite"
- };
-
- for ( USHORT i = 0; i < aHelpFormatLB.GetEntryCount(); i++ )
- {
- String* pData = new String( String::CreateFromAscii( aHelpFormatNames[i] ) );
- aHelpFormatLB.SetEntryData( i, pData );
- }
-}
-
-// -----------------------------------------------------------------------
-
-OfaMiscTabPage::~OfaMiscTabPage()
-{
- for(USHORT i = 0; i < aHelpFormatLB.GetEntryCount(); i++)
- {
- delete static_cast< String* >( aHelpFormatLB.GetEntryData(i) );
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* OfaMiscTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new OfaMiscTabPage( pParent, rAttrSet );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL OfaMiscTabPage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bModified = FALSE;
-
- SvtHelpOptions aHelpOptions;
- BOOL bChecked = aToolTipsCB.IsChecked();
- if ( bChecked != aToolTipsCB.GetSavedValue() )
- aHelpOptions.SetHelpTips( bChecked );
- bChecked = ( aExtHelpCB.IsChecked() && aToolTipsCB.IsChecked() );
- if ( bChecked != aExtHelpCB.GetSavedValue() )
- aHelpOptions.SetExtendedHelp( bChecked );
- bChecked = aHelpAgentCB.IsChecked();
- if ( bChecked != aHelpAgentCB.GetSavedValue() )
- aHelpOptions.SetHelpAgentAutoStartMode( bChecked );
- USHORT nHelpFormatPos = aHelpFormatLB.GetSelectEntryPos();
- if ( nHelpFormatPos != LISTBOX_ENTRY_NOTFOUND &&
- nHelpFormatPos != aHelpFormatLB.GetSavedValue() )
- {
- aHelpOptions.SetHelpStyleSheet( *static_cast< String* >( aHelpFormatLB.GetEntryData( nHelpFormatPos ) ) );
- }
-
- if ( aFileDlgCB.IsChecked() != aFileDlgCB.GetSavedValue() )
- {
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetUseSystemFileDialog( !aFileDlgCB.IsChecked() );
- bModified = TRUE;
- }
-
- if ( aPrintDlgCB.IsChecked() != aPrintDlgCB.GetSavedValue() )
- {
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetUseSystemPrintDialog( !aPrintDlgCB.IsChecked() );
- bModified = TRUE;
- }
-
- if ( aDocStatusCB.IsChecked() != aDocStatusCB.GetSavedValue() )
- {
- SvtPrintWarningOptions aPrintOptions;
- aPrintOptions.SetModifyDocumentOnPrintingAllowed( aDocStatusCB.IsChecked() );
- bModified = TRUE;
- }
-
- const SfxUInt16Item* pUInt16Item =
- PTR_CAST( SfxUInt16Item, GetOldItem( rSet, SID_ATTR_YEAR2000 ) );
- USHORT nNum = (USHORT)aYearValueField.GetText().ToInt32();
- if ( pUInt16Item && pUInt16Item->GetValue() != nNum )
- {
- bModified = TRUE;
- rSet.Put( SfxUInt16Item( SID_ATTR_YEAR2000, nNum ) );
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void OfaMiscTabPage::Reset( const SfxItemSet& rSet )
-{
- SvtHelpOptions aHelpOptions;
- aToolTipsCB.Check( aHelpOptions.IsHelpTips() );
- aExtHelpCB.Check( aHelpOptions.IsHelpTips() && aHelpOptions.IsExtendedHelp() );
- aHelpAgentCB.Check( aHelpOptions.IsHelpAgentAutoStartMode() );
- String sStyleSheet = aHelpOptions.GetHelpStyleSheet();
- for ( USHORT i = 0; i < aHelpFormatLB.GetEntryCount(); ++i )
- {
- if ( *static_cast< String* >( aHelpFormatLB.GetEntryData(i) ) == sStyleSheet )
- {
- aHelpFormatLB.SelectEntryPos(i);
- break;
- }
- }
-
- aToolTipsCB.SaveValue();
- aExtHelpCB.SaveValue();
- aHelpAgentCB.SaveValue();
- aHelpFormatLB.SaveValue();
- HelpCheckHdl_Impl( &aHelpAgentCB );
-
- SvtMiscOptions aMiscOpt;
- aFileDlgCB.Check( !aMiscOpt.UseSystemFileDialog() );
- aFileDlgCB.SaveValue();
- aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
- aPrintDlgCB.SaveValue();
-
- SvtPrintWarningOptions aPrintOptions;
- aDocStatusCB.Check(aPrintOptions.IsModifyDocumentOnPrintingAllowed());
- aDocStatusCB.SaveValue();
-
- const SfxPoolItem* pItem = NULL;
- if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_YEAR2000, FALSE, &pItem ) )
- {
- aYearValueField.SetValue( ((SfxUInt16Item*)pItem)->GetValue() );
- TwoFigureConfigHdl( &aYearValueField );
- }
- else
- {
- aYearValueField.Enable(FALSE);
- aTwoFigureFL.Enable(FALSE);
- aInterpretFT.Enable(FALSE);
- aToYearFT.Enable(FALSE);
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd )
-{
- (void)pEd;
-
- String aOutput( aStrDateInfo );
- String aStr( aYearValueField.GetText() );
- String sSep( SvtSysLocale().GetLocaleData().getNumThousandSep() );
- xub_StrLen nIndex = 0;
- while ((nIndex = aStr.Search( sSep, nIndex)) != STRING_NOTFOUND)
- aStr.Erase( nIndex, sSep.Len());
- long nNum = aStr.ToInt32();
- if ( aStr.Len() != 4 || nNum < aYearValueField.GetMin() || nNum > aYearValueField.GetMax() )
- aOutput.AppendAscii("????");
- else
- {
- nNum += 99;
- aOutput += String::CreateFromInt32( nNum );
- }
- aToYearFT.SetText( aOutput );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( OfaMiscTabPage, TwoFigureConfigHdl, NumericField*, pEd )
-{
- sal_Int64 nNum = aYearValueField.GetValue();
- String aOutput( String::CreateFromInt64( nNum ) );
- aYearValueField.SetText( aOutput );
- aYearValueField.SetSelection( Selection( 0, aOutput.Len() ) );
- TwoFigureHdl( pEd );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( OfaMiscTabPage, HelpCheckHdl_Impl, CheckBox*, EMPTYARG )
-{
- aExtHelpCB.Enable( aToolTipsCB.IsChecked() );
- aHelpAgentResetBtn.Enable( aHelpAgentCB.IsChecked() );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( OfaMiscTabPage, HelpAgentResetHdl_Impl, PushButton*, EMPTYARG )
-{
- SvtHelpOptions().resetAgentIgnoreURLCounter();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-// -------------------------------------------------------------------
-class CanvasSettings
-{
-public:
- CanvasSettings();
-
- BOOL IsHardwareAccelerationEnabled() const;
- BOOL IsHardwareAccelerationAvailable() const;
- void EnabledHardwareAcceleration( BOOL _bEnabled ) const;
-
-private:
- typedef std::vector< std::pair<OUString,Sequence<OUString> > > ServiceVector;
-
- Reference<XNameAccess> mxForceFlagNameAccess;
- ServiceVector maAvailableImplementations;
- mutable BOOL mbHWAccelAvailable;
- mutable BOOL mbHWAccelChecked;
-};
-
-// -------------------------------------------------------------------
-CanvasSettings::CanvasSettings() :
- mxForceFlagNameAccess(),
- mbHWAccelAvailable(FALSE),
- mbHWAccelChecked(FALSE)
-{
- try
- {
- Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
- Reference<XMultiServiceFactory> xConfigProvider(
- xFactory->createInstance(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")),
- UNO_QUERY_THROW );
-
- Any propValue(
- makeAny( PropertyValue(
- OUString::createFromAscii("nodepath"), -1,
- makeAny( OUString::createFromAscii("/org.openoffice.Office.Canvas") ),
- PropertyState_DIRECT_VALUE ) ) );
-
- mxForceFlagNameAccess.set(
- xConfigProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- Sequence<Any>( &propValue, 1 ) ),
- UNO_QUERY_THROW );
-
- propValue = makeAny(
- PropertyValue(
- OUString::createFromAscii("nodepath"), -1,
- makeAny( OUString::createFromAscii("/org.openoffice.Office.Canvas/CanvasServiceList") ),
- PropertyState_DIRECT_VALUE ) );
-
- Reference<XNameAccess> xNameAccess(
- xConfigProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"),
- Sequence<Any>( &propValue, 1 ) ), UNO_QUERY_THROW );
- Reference<XHierarchicalNameAccess> xHierarchicalNameAccess(
- xNameAccess, UNO_QUERY_THROW);
-
- Sequence<OUString> serviceNames = xNameAccess->getElementNames();
- const OUString* pCurr = serviceNames.getConstArray();
- const OUString* const pEnd = pCurr + serviceNames.getLength();
- while( pCurr != pEnd )
- {
- Reference<XNameAccess> xEntryNameAccess(
- xHierarchicalNameAccess->getByHierarchicalName(*pCurr),
- UNO_QUERY );
-
- if( xEntryNameAccess.is() )
- {
- Sequence<OUString> preferredImplementations;
- if( (xEntryNameAccess->getByName( OUString::createFromAscii("PreferredImplementations") ) >>= preferredImplementations) )
- maAvailableImplementations.push_back( std::make_pair(*pCurr,preferredImplementations) );
- }
-
- ++pCurr;
- }
- }
- catch( Exception& )
- {
- }
-}
-
-// -------------------------------------------------------------------
-BOOL CanvasSettings::IsHardwareAccelerationAvailable() const
-{
- if( !mbHWAccelChecked )
- {
- mbHWAccelChecked = true;
-
- Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
-
- // check whether any of the service lists has an
- // implementation that presents the "HardwareAcceleration" property
- ServiceVector::const_iterator aCurr=maAvailableImplementations.begin();
- const ServiceVector::const_iterator aEnd=maAvailableImplementations.end();
- while( aCurr != aEnd )
- {
- const OUString* pCurrImpl = aCurr->second.getConstArray();
- const OUString* const pEndImpl = pCurrImpl + aCurr->second.getLength();
-
- while( pCurrImpl != pEndImpl )
- {
- try
- {
- Reference<XPropertySet> xPropSet( xFactory->createInstance(
- pCurrImpl->trim() ),
- UNO_QUERY_THROW );
- bool bHasAccel(false);
- if( (xPropSet->getPropertyValue(OUString::createFromAscii("HardwareAcceleration")) >>= bHasAccel) )
- if( bHasAccel )
- {
- mbHWAccelAvailable = true;
- return mbHWAccelAvailable;
- }
- }
- catch (Exception &)
- {}
-
- ++pCurrImpl;
- }
-
- ++aCurr;
- }
- }
-
- return mbHWAccelAvailable;
-}
-
-// -------------------------------------------------------------------
-BOOL CanvasSettings::IsHardwareAccelerationEnabled() const
-{
- bool bForceLastEntry(false);
- if( !mxForceFlagNameAccess.is() )
- return true;
-
- if( !(mxForceFlagNameAccess->getByName( OUString::createFromAscii("ForceSafeServiceImpl") ) >>= bForceLastEntry) )
- return true;
-
- return !bForceLastEntry;
-}
-
-// -------------------------------------------------------------------
-void CanvasSettings::EnabledHardwareAcceleration( BOOL _bEnabled ) const
-{
- Reference< XNameReplace > xNameReplace(
- mxForceFlagNameAccess, UNO_QUERY );
-
- if( !xNameReplace.is() )
- return;
-
- xNameReplace->replaceByName( OUString::createFromAscii("ForceSafeServiceImpl"),
- makeAny(!_bEnabled) );
-
- Reference< XChangesBatch > xChangesBatch(
- mxForceFlagNameAccess, UNO_QUERY );
-
- if( !xChangesBatch.is() )
- return;
-
- xChangesBatch->commitChanges();
-}
-
-// class OfaViewTabPage --------------------------------------------------
-
-OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( OFA_TP_VIEW ), rSet ),
-
- aUserInterfaceFL ( this, SVX_RES( FL_USERINTERFACE ) ),
- aWindowSizeFT ( this, SVX_RES( FT_WINDOWSIZE ) ),
- aWindowSizeMF ( this, SVX_RES( MF_WINDOWSIZE ) ),
- aIconSizeStyleFT ( this, SVX_RES( FT_ICONSIZESTYLE ) ),
- aIconSizeLB ( this, SVX_RES( LB_ICONSIZE ) ),
- aIconStyleLB ( this, SVX_RES( LB_ICONSTYLE ) ),
- m_aSystemFont (this, SVX_RES( CB_SYSTEM_FONT ) ),
-#if defined( UNX )
- aFontAntiAliasing ( this, SVX_RES( CB_FONTANTIALIASING )),
- aAAPointLimitLabel ( this, SVX_RES( FT_POINTLIMIT_LABEL )),
- aAAPointLimit ( this, SVX_RES( NF_AA_POINTLIMIT )),
- aAAPointLimitUnits ( this, SVX_RES( FT_POINTLIMIT_UNIT )),
-#endif
- aMenuFL ( this, SVX_RES( FL_MENU ) ),
- aMenuIconsFT ( this, SVX_RES( FT_MENU_ICONS )),
- aMenuIconsLB ( this, SVX_RES( LB_MENU_ICONS )),
- aFontListsFL ( this, SVX_RES( FL_FONTLISTS) ),
- aFontShowCB ( this, SVX_RES( CB_FONT_SHOW ) ),
- aFontHistoryCB ( this, SVX_RES( CB_FONT_HISTORY ) ),
- aRenderingFL ( this, SVX_RES( FL_RENDERING ) ),
- aUseHardwareAccell ( this, SVX_RES( CB_USE_HARDACCELL ) ),
- aUseAntiAliase ( this, SVX_RES( CB_USE_ANTIALIASE ) ),
- aMouseFL ( this, SVX_RES( FL_MOUSE ) ),
- aMousePosFT ( this, SVX_RES( FT_MOUSEPOS ) ),
- aMousePosLB ( this, SVX_RES( LB_MOUSEPOS ) ),
- aMouseMiddleFT ( this, SVX_RES( FT_MOUSEMIDDLE ) ),
- aMouseMiddleLB ( this, SVX_RES( LB_MOUSEMIDDLE ) ),
-
- // #i97672#
- maSelectionFL(this, SVX_RES(FL_SELECTION)),
- maSelectionCB(this, SVX_RES(CB_SELECTION)),
- maSelectionMF(this, SVX_RES(MF_SELECTION)),
-
- nSizeLB_InitialSelection(0),
- nStyleLB_InitialSelection(0),
- pAppearanceCfg(new SvtTabAppearanceCfg),
- pCanvasSettings(new CanvasSettings),
- mpDrawinglayerOpt(new SvtOptionsDrawinglayer)
-{
-#if defined( UNX )
- aFontAntiAliasing.SetToggleHdl( LINK( this, OfaViewTabPage, OnAntialiasingToggled ) );
-
- // depending on the size of the text in aAAPointLimitLabel, we slightly re-arrange aAAPointLimit and aAAPointLimitUnits
- //#110391# if the label has no mnemonic and we are in a CJK version the mnemonic "(X)" will be added which
- // influences the width calculation
- MnemonicGenerator aMnemonicGenerator;
- String sLabel(aAAPointLimitLabel.GetText());
- aMnemonicGenerator.RegisterMnemonic( sLabel );
- aMnemonicGenerator.CreateMnemonic( sLabel );
- sLabel.EraseAllChars('~');
-
- sal_Int32 nLabelWidth = aAAPointLimitLabel.GetTextWidth( sLabel );
- nLabelWidth += 3; // small gap
- // pixels to move both controls to the left
- Size aSize = aAAPointLimitLabel.GetSizePixel();
- sal_Int32 nMoveLeft = aSize.Width() - nLabelWidth;
- // resize the first label
- aSize.Width() = nLabelWidth;
- aAAPointLimitLabel.SetSizePixel( aSize );
-
- // move the numeric field
- Point aPos( aAAPointLimit.GetPosPixel() );
- aPos.X() -= nMoveLeft;
- aAAPointLimit.SetPosPixel( aPos );
-
- // move (and resize) the units FixedText
- aPos = ( aAAPointLimitUnits.GetPosPixel() );
- aPos.X() -= nMoveLeft;
- aSize = aAAPointLimitUnits.GetSizePixel();
- aSize.Width() += nMoveLeft;
- aAAPointLimitUnits.SetPosSizePixel( aPos, aSize );
-#else
- // on this platform, we do not have the anti aliasing options - move the other checkboxes accordingly
- // (in the resource, the coordinates are calculated for the AA options beeing present)
- Control* pMiscOptions[] =
- {
- &aMenuFL, &aMenuIconsFT, &aMenuIconsLB,
- &aFontListsFL, &aFontShowCB, &aFontHistoryCB
- };
-
- // temporaryly create the checkbox for the anti aliasing (we need to to determine it's pos)
- CheckBox* pFontAntiAliasing = new CheckBox( this, SVX_RES( CB_FONTANTIALIASING ) );
- sal_Int32 nMoveUp = aMenuFL.GetPosPixel().Y() - pFontAntiAliasing->GetPosPixel().Y();
- DELETEZ( pFontAntiAliasing );
-
- Point aPos;
- for ( sal_Int32 i = 0; i < sizeof( pMiscOptions ) / sizeof( pMiscOptions[0] ); ++i )
- {
- aPos = pMiscOptions[i]->GetPosPixel( );
- aPos.Y() -= nMoveUp;
- pMiscOptions[i]->SetPosPixel( aPos );
- }
-
-#endif
-
- // #i97672#
- maSelectionCB.SetToggleHdl( LINK( this, OfaViewTabPage, OnSelectionToggled ) );
-
- FreeResource();
-
- if( ! Application::ValidateSystemFont() )
- {
- m_aSystemFont.Check( FALSE );
- m_aSystemFont.Enable( FALSE );
- }
-
- // add real theme name to 'auto' theme, e.g. 'auto' => 'auto (classic)'
- if( aIconStyleLB.GetEntryCount() > 1 )
- {
- ::rtl::OUString aAutoStr( aIconStyleLB.GetEntry( 0 ) );
-
- aAutoStr += ::rtl::OUString::createFromAscii( " (" );
-
- switch( Application::GetSettings().GetStyleSettings().GetAutoSymbolsStyle() )
- {
- case STYLE_SYMBOLS_DEFAULT: aAutoStr += aIconStyleLB.GetEntry( 1 ); break;
- case STYLE_SYMBOLS_INDUSTRIAL: aAutoStr += aIconStyleLB.GetEntry( 2 ); break;
- case STYLE_SYMBOLS_CRYSTAL: aAutoStr += aIconStyleLB.GetEntry( 3 ); break;
- case STYLE_SYMBOLS_TANGO: aAutoStr += aIconStyleLB.GetEntry( 4 ); break;
- case STYLE_SYMBOLS_CLASSIC: aAutoStr += aIconStyleLB.GetEntry( 5 ); break;
- case STYLE_SYMBOLS_HICONTRAST: aAutoStr += aIconStyleLB.GetEntry( 6 ); break;
- }
-
- aIconStyleLB.RemoveEntry( 0 );
- aIconStyleLB.InsertEntry( aAutoStr += ::rtl::OUString::createFromAscii( ")" ), 0 );
- aIconStyleLB.SetSeparatorPos( aIconStyleLB.GetEntryCount() - 2 );
- }
-}
-
-OfaViewTabPage::~OfaViewTabPage()
-{
- delete mpDrawinglayerOpt;
- delete pCanvasSettings;
- delete pAppearanceCfg;
-}
-
-#if defined( UNX )
-//--- 20.08.01 10:16:12 ---------------------------------------------------
-IMPL_LINK( OfaViewTabPage, OnAntialiasingToggled, void*, NOTINTERESTEDIN )
-{
- (void)NOTINTERESTEDIN;
-
- sal_Bool bAAEnabled = aFontAntiAliasing.IsChecked();
-
- aAAPointLimitLabel.Enable( bAAEnabled );
- aAAPointLimit.Enable( bAAEnabled );
- aAAPointLimitUnits.Enable( bAAEnabled );
-
- return 0L;
-}
-#endif
-
-// #i97672#
-IMPL_LINK( OfaViewTabPage, OnSelectionToggled, void*, NOTINTERESTEDIN )
-{
- (void)NOTINTERESTEDIN;
- const bool bSelectionEnabled(maSelectionCB.IsChecked());
- maSelectionMF.Enable(bSelectionEnabled);
- return 0;
-}
-
-/*-----------------06.12.96 11.50-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* OfaViewTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new OfaViewTabPage(pParent, rAttrSet);
-}
-
-/*-----------------06.12.96 11.50-------------------
-
---------------------------------------------------*/
-
-BOOL OfaViewTabPage::FillItemSet( SfxItemSet& )
-{
- SvtFontOptions aFontOpt;
- SvtMenuOptions aMenuOpt;
- SvtStartOptions aStartOpt;
-
- BOOL bModified = FALSE;
- BOOL bMenuOptModified = FALSE;
- bool bRepaintWindows(false);
-
- SvtMiscOptions aMiscOptions;
- UINT16 nSizeLB_NewSelection = aIconSizeLB.GetSelectEntryPos();
- if( nSizeLB_InitialSelection != nSizeLB_NewSelection )
- {
- // from now on it's modified, even if via auto setting the same size was set as now selected in the LB
- sal_Int16 eSet = SFX_SYMBOLS_SIZE_AUTO;
- switch( nSizeLB_NewSelection )
- {
- case 0: eSet = SFX_SYMBOLS_SIZE_AUTO; break;
- case 1: eSet = SFX_SYMBOLS_SIZE_SMALL; break;
- case 2: eSet = SFX_SYMBOLS_SIZE_LARGE; break;
- default:
- DBG_ERROR( "OfaViewTabPage::FillItemSet(): This state of aIconSizeLB should not be possible!" );
- }
- aMiscOptions.SetSymbolsSize( eSet );
- }
-
- UINT16 nStyleLB_NewSelection = aIconStyleLB.GetSelectEntryPos();
- if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
- {
- sal_Int16 eSet = SFX_SYMBOLS_STYLE_AUTO;
- switch( nStyleLB_NewSelection )
- {
- case 0: eSet = SFX_SYMBOLS_STYLE_AUTO; break;
- case 1: eSet = SFX_SYMBOLS_STYLE_DEFAULT; break;
- case 2: eSet = SFX_SYMBOLS_STYLE_HICONTRAST; break;
- case 3: eSet = SFX_SYMBOLS_STYLE_INDUSTRIAL; break;
- case 4: eSet = SFX_SYMBOLS_STYLE_CRYSTAL; break;
- case 5: eSet = SFX_SYMBOLS_STYLE_TANGO; break;
- case 6: eSet = SFX_SYMBOLS_STYLE_CLASSIC; break;
- default:
- DBG_ERROR( "OfaViewTabPage::FillItemSet(): This state of aIconStyleLB should not be possible!" );
- }
- aMiscOptions.SetSymbolsStyle( eSet );
- }
-
- BOOL bAppearanceChanged = FALSE;
-
-
- // Screen Scaling
- UINT16 nOldScale = pAppearanceCfg->GetScaleFactor();
- UINT16 nNewScale = (UINT16)aWindowSizeMF.GetValue();
-
- if ( nNewScale != nOldScale )
- {
- pAppearanceCfg->SetScaleFactor(nNewScale);
- bAppearanceChanged = TRUE;
- }
-
- // Mouse Snap Mode
- short eOldSnap = pAppearanceCfg->GetSnapMode();
- short eNewSnap = aMousePosLB.GetSelectEntryPos();
- if(eNewSnap > 2)
- eNewSnap = 2;
-
- if ( eNewSnap != eOldSnap )
- {
- pAppearanceCfg->SetSnapMode(eNewSnap );
- bAppearanceChanged = TRUE;
- }
-
- // Middle Mouse Button
- short eOldMiddleMouse = pAppearanceCfg->GetMiddleMouseButton();
- short eNewMiddleMouse = aMouseMiddleLB.GetSelectEntryPos();
- if(eNewMiddleMouse > 2)
- eNewMiddleMouse = 2;
-
- if ( eNewMiddleMouse != eOldMiddleMouse )
- {
- pAppearanceCfg->SetMiddleMouseButton( eNewMiddleMouse );
- bAppearanceChanged = TRUE;
- }
-
-#if defined( UNX )
- if ( aFontAntiAliasing.IsChecked() != aFontAntiAliasing.GetSavedValue() )
- {
- pAppearanceCfg->SetFontAntiAliasing( aFontAntiAliasing.IsChecked() );
- bAppearanceChanged = TRUE;
- }
-
- if ( aAAPointLimit.GetValue() != aAAPointLimit.GetSavedValue().ToInt32() )
- {
- pAppearanceCfg->SetFontAntialiasingMinPixelHeight( aAAPointLimit.GetValue() );
- bAppearanceChanged = TRUE;
- }
-#endif
-
- if ( aFontShowCB.IsChecked() != aFontShowCB.GetSavedValue() )
- {
- aFontOpt.EnableFontWYSIWYG( aFontShowCB.IsChecked() );
- bModified = TRUE;
- }
-
- if(aMenuIconsLB.GetSelectEntryPos() != aMenuIconsLB.GetSavedValue())
- {
- aMenuOpt.SetMenuIconsState( aMenuIconsLB.GetSelectEntryPos() == 0 ? 2 : aMenuIconsLB.GetSelectEntryPos() - 1);
- bModified = TRUE;
- bMenuOptModified = TRUE;
- bAppearanceChanged = TRUE;
- }
-
- if ( aFontHistoryCB.IsChecked() != aFontHistoryCB.GetSavedValue() )
- {
- aFontOpt.EnableFontHistory( aFontHistoryCB.IsChecked() );
- bModified = TRUE;
- }
-
- // #i95644# if disabled, do not use value, see in ::Reset()
- if(aUseHardwareAccell.IsEnabled())
- {
- if(aUseHardwareAccell.IsChecked() != aUseHardwareAccell.GetSavedValue())
- {
- pCanvasSettings->EnabledHardwareAcceleration(aUseHardwareAccell.IsChecked());
- bModified = TRUE;
- }
- }
-
- // #i95644# if disabled, do not use value, see in ::Reset()
- if(aUseAntiAliase.IsEnabled())
- {
- if(aUseAntiAliase.IsChecked() != mpDrawinglayerOpt->IsAntiAliasing())
- {
- mpDrawinglayerOpt->SetAntiAliasing(aUseAntiAliase.IsChecked());
- bModified = TRUE;
- bRepaintWindows = true;
- }
- }
-
- // #i97672#
- if(maSelectionCB.IsEnabled())
- {
- const bool bNewSelection(maSelectionCB.IsChecked());
- const sal_uInt16 nNewTransparence((sal_uInt16)maSelectionMF.GetValue());
-
- if(bNewSelection != (bool)mpDrawinglayerOpt->IsTransparentSelection())
- {
- mpDrawinglayerOpt->SetTransparentSelection(maSelectionCB.IsChecked());
- bModified = TRUE;
- bRepaintWindows = true;
- }
-
- // #i104150# even read the value when maSelectionMF is disabled; it may have been
- // modified by enabling-modify-disabling by the user
- if(nNewTransparence != mpDrawinglayerOpt->GetTransparentSelectionPercent())
- {
- mpDrawinglayerOpt->SetTransparentSelectionPercent(nNewTransparence);
- bModified = TRUE;
- bRepaintWindows = true;
- }
- }
-
- SvtAccessibilityOptions aAccessibilityOptions;
- if( aAccessibilityOptions.GetIsSystemFont() != m_aSystemFont.IsChecked() &&
- m_aSystemFont.IsEnabled() )
- {
- aAccessibilityOptions.SetIsSystemFont( m_aSystemFont.IsChecked() );
- bModified = TRUE;
- bMenuOptModified = TRUE;
- }
-
- if( bMenuOptModified )
- {
- // Set changed settings to the application instance
- AllSettings aAllSettings = Application::GetSettings();
- StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
- if( m_aSystemFont.IsEnabled() )
- aStyleSettings.SetUseSystemUIFonts( m_aSystemFont.IsChecked() );
- aAllSettings.SetStyleSettings(aStyleSettings);
- Application::MergeSystemSettings( aAllSettings );
- Application::SetSettings(aAllSettings);
- }
-
- if ( bAppearanceChanged )
- {
- pAppearanceCfg->Commit();
- pAppearanceCfg->SetApplicationDefaults ( GetpApp() );
- }
-
- if(bRepaintWindows)
- {
- Window* pAppWindow = Application::GetFirstTopLevelWindow();
-
- while(pAppWindow)
- {
- pAppWindow->Invalidate();
- pAppWindow = Application::GetNextTopLevelWindow(pAppWindow);
- }
- }
-
- return bModified;
-}
-
-/*-----------------06.12.96 11.50-------------------
-
---------------------------------------------------*/
-void OfaViewTabPage::Reset( const SfxItemSet& )
-{
- SvtMiscOptions aMiscOptions;
-
- if( aMiscOptions.GetSymbolsSize() != SFX_SYMBOLS_SIZE_AUTO )
- nSizeLB_InitialSelection = ( aMiscOptions.AreCurrentSymbolsLarge() )? 2 : 1;
- aIconSizeLB.SelectEntryPos( nSizeLB_InitialSelection );
- aIconSizeLB.SaveValue();
-
- if( aMiscOptions.GetSymbolsStyle() != SFX_SYMBOLS_STYLE_AUTO )
- {
- switch ( aMiscOptions.GetCurrentSymbolsStyle() )
- {
- case SFX_SYMBOLS_STYLE_DEFAULT: nStyleLB_InitialSelection = 1; break;
- case SFX_SYMBOLS_STYLE_HICONTRAST: nStyleLB_InitialSelection = 2; break;
- case SFX_SYMBOLS_STYLE_INDUSTRIAL: nStyleLB_InitialSelection = 3; break;
- case SFX_SYMBOLS_STYLE_CRYSTAL: nStyleLB_InitialSelection = 4; break;
- case SFX_SYMBOLS_STYLE_TANGO: nStyleLB_InitialSelection = 5; break;
- case SFX_SYMBOLS_STYLE_CLASSIC: nStyleLB_InitialSelection = 6; break;
- default: nStyleLB_InitialSelection = 0; break;
- }
- }
-
- aIconStyleLB.SelectEntryPos( nStyleLB_InitialSelection );
- aIconStyleLB.SaveValue();
-
- if( m_aSystemFont.IsEnabled() )
- {
- SvtAccessibilityOptions aAccessibilityOptions;
- m_aSystemFont.Check( aAccessibilityOptions.GetIsSystemFont() );
- }
-
- // Screen Scaling
- aWindowSizeMF.SetValue ( pAppearanceCfg->GetScaleFactor() );
- // Mouse Snap
- aMousePosLB.SelectEntryPos(pAppearanceCfg->GetSnapMode());
- aMousePosLB.SaveValue();
-
- // Mouse Snap
- aMouseMiddleLB.SelectEntryPos(pAppearanceCfg->GetMiddleMouseButton());
- aMouseMiddleLB.SaveValue();
-
-#if defined( UNX )
- aFontAntiAliasing.Check( pAppearanceCfg->IsFontAntiAliasing() );
- aAAPointLimit.SetValue( pAppearanceCfg->GetFontAntialiasingMinPixelHeight() );
-#endif
-
- // WorkingSet
- SvtFontOptions aFontOpt;
- aFontShowCB.Check( aFontOpt.IsFontWYSIWYGEnabled() );
- SvtMenuOptions aMenuOpt;
- aMenuIconsLB.SelectEntryPos(aMenuOpt.GetMenuIconsState() == 2 ? 0 : aMenuOpt.GetMenuIconsState() + 1);
- aMenuIconsLB.SaveValue();
- aFontHistoryCB.Check( aFontOpt.IsFontHistoryEnabled() );
-
- { // #i95644# HW accel (unified to disable mechanism)
- if(pCanvasSettings->IsHardwareAccelerationAvailable())
- {
- aUseHardwareAccell.Check(pCanvasSettings->IsHardwareAccelerationEnabled());
- }
- else
- {
- aUseHardwareAccell.Check(false);
- aUseHardwareAccell.Disable();
- }
-
- aUseHardwareAccell.SaveValue();
- }
-
- { // #i95644# AntiAliasing
- if(mpDrawinglayerOpt->IsAAPossibleOnThisSystem())
- {
- aUseAntiAliase.Check(mpDrawinglayerOpt->IsAntiAliasing());
- }
- else
- {
- aUseAntiAliase.Check(false);
- aUseAntiAliase.Disable();
- }
-
- aUseAntiAliase.SaveValue();
- }
-
- {
- // #i97672# Selection
- // check if transparent selection is possible on this system
- const bool bTransparentSelectionPossible(
- !GetSettings().GetStyleSettings().GetHighContrastMode()
- && supportsOperation(OutDevSupport_TransparentRect));
-
- // enter values
- if(bTransparentSelectionPossible)
- {
- maSelectionCB.Check(mpDrawinglayerOpt->IsTransparentSelection());
- }
- else
- {
- maSelectionCB.Enable(false);
- }
-
- maSelectionMF.SetValue(mpDrawinglayerOpt->GetTransparentSelectionPercent());
- maSelectionMF.Enable(mpDrawinglayerOpt->IsTransparentSelection() && bTransparentSelectionPossible);
- }
-
-#if defined( UNX )
- aFontAntiAliasing.SaveValue();
- aAAPointLimit.SaveValue();
-#endif
- aFontShowCB.SaveValue();
- aFontHistoryCB.SaveValue();
-
-#if defined( UNX )
- LINK( this, OfaViewTabPage, OnAntialiasingToggled ).Call( NULL );
-#endif
-}
-/* -----------------------------23.11.00 14:55--------------------------------
-
- ---------------------------------------------------------------------------*/
-class LangConfigItem_Impl : public ConfigItem
-{
- Any aValue;
- OUString aPropertyName;
-public:
- LangConfigItem_Impl(const OUString& rTree, const OUString& rProperty);
- ~LangConfigItem_Impl();
-
- virtual void Commit();
-
- const Any& GetValue() const {return aValue;}
- void SetValue(Any& rValue) {aValue = rValue; SetModified();}
-};
-/* -----------------------------23.11.00 15:06--------------------------------
-
- ---------------------------------------------------------------------------*/
-LangConfigItem_Impl::LangConfigItem_Impl(
- const OUString& rTree, const OUString& rProperty) :
- ConfigItem(rTree),
- aPropertyName(rProperty)
-{
- Sequence<OUString> aNames(1);
- aNames.getArray()[0] = aPropertyName;
- Sequence<Any> aValues = GetProperties(aNames);
- aValue = aValues.getConstArray()[0];
-}
-/* -----------------------------23.11.00 15:06--------------------------------
-
- ---------------------------------------------------------------------------*/
-LangConfigItem_Impl::~LangConfigItem_Impl()
-{}
-/* -----------------------------23.11.00 15:10--------------------------------
-
- ---------------------------------------------------------------------------*/
-void LangConfigItem_Impl::Commit()
-{
- Sequence<OUString> aNames(1);
- aNames.getArray()[0] = aPropertyName;
- Sequence<Any> aValues(1);
- aValues.getArray()[0] = aValue;
- PutProperties(aNames, aValues);
-}
-/* -----------------22.07.2003 10:33-----------------
-
- --------------------------------------------------*/
-struct LanguageConfig_Impl
-{
- SvtLanguageOptions aLanguageOptions;
- SvtSysLocaleOptions aSysLocaleOptions;
- SvtLinguConfig aLinguConfig;
-};
-/* -----------------------------23.11.00 13:06--------------------------------
-
- ---------------------------------------------------------------------------*/
-static sal_Bool bLanguageCurrentDoc_Impl = sal_False;
-
-// some things we'll need...
-static const OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
-static const OUString sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess");
-static const OUString sAccessUpdSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess");
-static const OUString sInstalledLocalesPath = OUString::createFromAscii("org.openoffice.Setup/Office/InstalledLocales");
-static OUString sUserLocalePath = OUString::createFromAscii("org.openoffice.Office.Linguistic/General");
-//static const OUString sUserLocalePath = OUString::createFromAscii("org.openoffice.Office/Linguistic");
-static const OUString sUserLocaleKey = OUString::createFromAscii("UILocale");
-static const OUString sSystemLocalePath = OUString::createFromAscii("org.openoffice.System/L10N");
-static const OUString sSystemLocaleKey = OUString::createFromAscii("UILocale");
-static const OUString sOfficeLocalePath = OUString::createFromAscii("org.openoffice.Office/L10N");
-static const OUString sOfficeLocaleKey = OUString::createFromAscii("ooLocale");
-static Sequence< OUString > seqInstalledLanguages;
-
-OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage( pParent, SVX_RES( OFA_TP_LANGUAGES ), rSet ),
- aUILanguageGB(this, SVX_RES(FL_UI_LANG )),
- aLocaleSettingFI(this, SVX_RES(FI_LOCALESETTING)),
- aUserInterfaceFT(this, SVX_RES(FT_USERINTERFACE)),
- aUserInterfaceLB(this, SVX_RES(LB_USERINTERFACE)),
- aLocaleSettingFT(this, SVX_RES(FT_LOCALESETTING)),
- aLocaleSettingLB(this, SVX_RES(LB_LOCALESETTING)),
- aCurrencyFI( this, SVX_RES(FI_CURRENCY )),
- aDecimalSeparatorFT(this, SVX_RES(FT_DECIMALSEPARATOR)),
- aDecimalSeparatorCB(this, SVX_RES(CB_DECIMALSEPARATOR)),
- aCurrencyFT( this, SVX_RES(FT_CURRENCY )),
- aCurrencyLB( this, SVX_RES(LB_CURRENCY )),
- aLinguLanguageGB(this, SVX_RES(FL_LINGU_LANG )),
- aWesternLanguageFI(this, SVX_RES(FI_WEST_LANG )),
- aWesternLanguageFT(this, SVX_RES(FT_WEST_LANG )),
- aWesternLanguageLB(this, SVX_RES(LB_WEST_LANG )),
- aAsianLanguageFI(this, SVX_RES(FI_ASIAN_LANG )),
- aAsianLanguageFT(this, SVX_RES(FT_ASIAN_LANG )),
- aAsianLanguageLB(this, SVX_RES(LB_ASIAN_LANG )),
- aComplexLanguageFI(this, SVX_RES(FI_COMPLEX_LANG )),
- aComplexLanguageFT(this, SVX_RES(FT_COMPLEX_LANG )),
- aComplexLanguageLB(this, SVX_RES(LB_COMPLEX_LANG )),
- aCurrentDocCB(this, SVX_RES(CB_CURRENT_DOC )),
- aEnhancedFL(this, SVX_RES(FL_ENHANCED )),
- aAsianSupportFI(this, SVX_RES(FI_ASIANSUPPORT )),
- aAsianSupportCB(this, SVX_RES(CB_ASIANSUPPORT )),
- aCTLSupportFI(this, SVX_RES(FI_CTLSUPPORT )),
- aCTLSupportCB(this, SVX_RES(CB_CTLSUPPORT )),
- sDecimalSeparatorLabel(aDecimalSeparatorCB.GetText()),
- pLangConfig(new LanguageConfig_Impl)
-{
- FreeResource();
-
- // initialize user interface language selection
- SvtLanguageTable* pLanguageTable = new SvtLanguageTable;
- const String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) );
-
- String aUILang(aStr);
- aUILang += String::CreateFromAscii(" - ");
- aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage() );
-
- aUserInterfaceLB.InsertEntry(aUILang);
- aUserInterfaceLB.SetEntryData(0, 0);
- aUserInterfaceLB.SelectEntryPos(0);
- try
- {
- OUString sOfficeLocaleValue;
- OUString sSystemLocaleValue;
-
- Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
- Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > (
- theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW);
- Sequence< Any > theArgs(2);
- Reference< XNameAccess > theNameAccess;
-
- // find out which locales are currently installed and add them to the listbox
- theArgs[0] = makeAny(NamedValue(OUString::createFromAscii("NodePath"), makeAny(sInstalledLocalesPath)));
- theArgs[1] = makeAny(NamedValue(OUString::createFromAscii("reload"), makeAny(sal_True)));
- theNameAccess = Reference< XNameAccess > (
- theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW );
- seqInstalledLanguages = theNameAccess->getElementNames();
- LanguageType aLang = LANGUAGE_DONTKNOW;
- for (sal_Int32 i=0; i<seqInstalledLanguages.getLength(); i++)
- {
- aLang = MsLangId::convertIsoStringToLanguage(seqInstalledLanguages[i]);
- if (aLang != LANGUAGE_DONTKNOW)
- {
- //USHORT p = aUserInterfaceLB.InsertLanguage(aLang);
- String aLangStr( pLanguageTable->GetString( aLang ) );
- USHORT p = aUserInterfaceLB.InsertEntry(aLangStr);
- aUserInterfaceLB.SetEntryData(p, (void*)(i+1));
- }
- }
-
- // find out whether the user has a specific locale specified
- Sequence< Any > theArgs2(1);
- theArgs2[0] = makeAny(NamedValue(OUString::createFromAscii("NodePath"), makeAny(sUserLocalePath)));
- theNameAccess = Reference< XNameAccess > (
- theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
- if (theNameAccess->hasByName(sUserLocaleKey))
- theNameAccess->getByName(sUserLocaleKey) >>= m_sUserLocaleValue;
- // select the user specified locale in the listbox
- if (m_sUserLocaleValue.getLength() > 0)
- {
- sal_Int32 d = 0;
- for (USHORT i=0; i < aUserInterfaceLB.GetEntryCount(); i++)
- {
- d = (sal_Int32)(sal_IntPtr)aUserInterfaceLB.GetEntryData(i);
- if ( d > 0 && seqInstalledLanguages.getLength() > d-1 && seqInstalledLanguages[d-1].equals(m_sUserLocaleValue))
- aUserInterfaceLB.SelectEntryPos(i);
- }
- }
-
- }
- catch (Exception &e)
- {
- // we'll just leave the box in it's default setting and won't
- // even give it event handler...
- OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, aMsg.getStr());
- }
-
- aWesternLanguageLB.SetLanguageList( LANG_LIST_WESTERN | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aWesternLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::LATIN );
- aAsianLanguageLB.SetLanguageList( LANG_LIST_CJK | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aAsianLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::ASIAN );
- aComplexLanguageLB.SetLanguageList( LANG_LIST_CTL | LANG_LIST_ONLY_KNOWN, TRUE, FALSE, TRUE );
- aComplexLanguageLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::COMPLEX );
-
- aLocaleSettingLB.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE, FALSE, FALSE);
- aLocaleSettingLB.InsertDefaultLanguage( ::com::sun::star::i18n::ScriptType::WEAK );
-
- const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable();
- const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM );
- // insert SYSTEM entry
- String aDefaultCurr(aStr);
- aDefaultCurr += String::CreateFromAscii(" - ");
- aDefaultCurr += rCurr.GetBankSymbol();
- aCurrencyLB.InsertEntry( aDefaultCurr );
- // all currencies
- String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " " ) );
- USHORT nCurrCount = rCurrTab.Count();
- // first entry is SYSTEM, skip it
- for ( USHORT j=1; j < nCurrCount; ++j )
- {
- const NfCurrencyEntry* pCurr = rCurrTab[j];
- String aStr_( pCurr->GetBankSymbol() );
- aStr_ += aTwoSpace;
- aStr_ += pCurr->GetSymbol();
- aStr_ = ApplyLreOrRleEmbedding( aStr_ );
- aStr_ += aTwoSpace;
- aStr_ += ApplyLreOrRleEmbedding( pLanguageTable->GetString( pCurr->GetLanguage() ) );
- USHORT nPos = aCurrencyLB.InsertEntry( aStr_ );
- aCurrencyLB.SetEntryData( nPos, (void*) pCurr );
- }
- delete pLanguageTable;
-
- aLocaleSettingLB.SetSelectHdl( LINK( this, OfaLanguagesTabPage, LocaleSettingHdl ) );
- Link aLink( LINK( this, OfaLanguagesTabPage, SupportHdl ) );
- aAsianSupportCB.SetClickHdl( aLink );
- aCTLSupportCB.SetClickHdl( aLink );
-
- aAsianSupportCB.Check( m_bOldAsian = pLangConfig->aLanguageOptions.IsAnyEnabled() );
- aAsianSupportCB.SaveValue();
- sal_Bool bReadonly = pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_ALLCJK);
- aAsianSupportCB.Enable(!bReadonly);
- aAsianSupportFI.Show(bReadonly);
- SupportHdl( &aAsianSupportCB );
-
- aCTLSupportCB.Check( m_bOldCtl = pLangConfig->aLanguageOptions.IsCTLFontEnabled() );
- aCTLSupportCB.SaveValue();
- bReadonly = pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_CTLFONT);
- aCTLSupportCB.Enable(!bReadonly);
- aCTLSupportFI.Show(bReadonly);
- SupportHdl( &aCTLSupportCB );
-}
-/*-- 23.11.00 13:06:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-OfaLanguagesTabPage::~OfaLanguagesTabPage()
-{
- delete pLangConfig;
-}
-/*-- 23.11.00 13:06:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SfxTabPage* OfaLanguagesTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new OfaLanguagesTabPage(pParent, rAttrSet);
-}
-/*-- 23.11.00 13:06:41---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-LanguageType lcl_LangStringToLangType(const OUString& rLang)
-{
- Locale aLocale;
- sal_Int32 nSep = rLang.indexOf('-');
- if (nSep < 0)
- aLocale.Language = rLang;
- else
- {
- aLocale.Language = rLang.copy(0, nSep);
- if (nSep < rLang.getLength())
- aLocale.Country = rLang.copy(nSep+1, rLang.getLength() - (nSep+1));
- }
- LanguageType eLangType = SvxLocaleToLanguage( aLocale );
- return eLangType;
-}
-
-/*-- 23.11.00 13:06:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void lcl_UpdateAndDelete(SfxVoidItem* pInvalidItems[], SfxBoolItem* pBoolItems[], sal_uInt16 nCount)
-{
- SfxViewFrame* pCurrentFrm = SfxViewFrame::Current();
- SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst();
- while(pViewFrm)
- {
- SfxBindings& rBind = pViewFrm->GetBindings();
- for(sal_Int16 i = 0; i < nCount; i++)
- {
- if(pCurrentFrm == pViewFrm)
- rBind.InvalidateAll(sal_False);
- rBind.SetState( *pInvalidItems[i] );
- rBind.SetState( *pBoolItems[i] );
- }
- pViewFrm = SfxViewFrame::GetNext(*pViewFrm);
- }
- for(sal_Int16 i = 0; i < nCount; i++)
- {
- delete pInvalidItems[i];
- delete pBoolItems[i] ;
- }
-}
-
-BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if(aCTLSupportCB.IsChecked() &&
- (aCTLSupportCB.GetSavedValue() != aCTLSupportCB.IsChecked()) ||
- (aComplexLanguageLB.GetSavedValue() != aComplexLanguageLB.GetSelectEntryPos()))
- {
- //sequence checking has to be switched on depending on the selected CTL language
- LanguageType eCTLLang = aComplexLanguageLB.GetSelectLanguage();
- sal_Bool bOn = MsLangId::needsSequenceChecking( eCTLLang);
- pLangConfig->aLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
- pLangConfig->aLanguageOptions.SetCTLSequenceChecking(bOn);
- pLangConfig->aLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
- }
- try
- {
- // handle settings for UI Language
- // a change of setting needs to bring up a warning message
- OUString aLangString;
- sal_Int32 d = (sal_Int32)(sal_IntPtr)aUserInterfaceLB.GetEntryData(aUserInterfaceLB.GetSelectEntryPos());
- if( d > 0 && seqInstalledLanguages.getLength() > d-1)
- aLangString = seqInstalledLanguages[d-1];
-
- /*
- if( aUserInterfaceLB.GetSelectEntryPos() > 0)
- aLangString = ConvertLanguageToIsoString(aUserInterfaceLB.GetSelectLanguage());
- */
- Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
- Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > (
- theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW);
- Sequence< Any > theArgs(1);
- theArgs[0] = makeAny(sUserLocalePath);
- Reference< XPropertySet >xProp(
- theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
- if ( !m_sUserLocaleValue.equals(aLangString))
- {
- // OSL_ENSURE(sal_False, "UserInterface language was changed, restart.");
- // write new value
- xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
- Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
- // display info
- InfoBox aBox(this, SVX_RES(RID_SVX_MSGBOX_LANGUAGE_RESTART));
- aBox.Execute();
-
- // tell quickstarter to stop being a veto listener
-
- Reference< XInitialization > xInit(theMSF->createInstance(
- OUString::createFromAscii("com.sun.star.office.Quickstart")), UNO_QUERY);
- if (xInit.is())
- {
- Sequence< Any > args(3);
- args[0] = makeAny(sal_False); // will be ignored
- args[1] = makeAny(sal_False); // will be ignored
- args[2] = makeAny(sal_False); // disable veto
- xInit->initialize(args);
- }
- }
- }
- catch (Exception& e)
- {
- // we'll just leave the box in it's default setting and won't
- // even give it event handler...
- OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, aMsg.getStr());
- }
-
- pLangConfig->aSysLocaleOptions.BlockBroadcasts( TRUE );
-
- OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString();
- LanguageType eOldLocale = (sLang.getLength() ?
- lcl_LangStringToLangType( sLang ) : LANGUAGE_SYSTEM);
- LanguageType eNewLocale = aLocaleSettingLB.GetSelectLanguage();
- if ( eOldLocale != eNewLocale )
- {
- // an empty string denotes SYSTEM locale
- OUString sNewLang;
- if ( eNewLocale != LANGUAGE_SYSTEM )
- {
- Locale aLocale;
- SvxLanguageToLocale( aLocale, eNewLocale );
- sNewLang = aLocale.Language;
- if ( aLocale.Country.getLength() > 0 )
- {
- sNewLang += C2U("-");
- sNewLang += aLocale.Country;
- }
- }
- // Set application settings before options, so listeners at the
- // options will access the new locale.
- AllSettings aSettings( Application::GetSettings() );
- aSettings.SetLanguage( eNewLocale );
- Application::SetSettings( aSettings );
- pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
- rSet.Put( SfxBoolItem( SID_OPT_LOCALE_CHANGED, TRUE ) );
- }
-
- //
- if(aDecimalSeparatorCB.GetSavedValue() != aDecimalSeparatorCB.IsChecked())
- pLangConfig->aSysLocaleOptions.SetDecimalSeparatorAsLocale(aDecimalSeparatorCB.IsChecked());
-
- // Configured currency, for example, USD-en-US or EUR-de-DE, or empty for
- // locale default. This must be set _after_ the locale above in order to
- // have a valid locale for broadcasting the currency change.
- OUString sOldCurr = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
- USHORT nCurrPos = aCurrencyLB.GetSelectEntryPos();
- const NfCurrencyEntry* pCurr = (const NfCurrencyEntry*)
- aCurrencyLB.GetEntryData( nCurrPos );
- OUString sNewCurr;
- if ( pCurr )
- sNewCurr = SvtSysLocaleOptions::CreateCurrencyConfigString(
- pCurr->GetBankSymbol(), pCurr->GetLanguage() );
- if ( sOldCurr != sNewCurr )
- pLangConfig->aSysLocaleOptions.SetCurrencyConfigString( sNewCurr );
-
- BOOL bRet = FALSE;
- SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
- Reference< XPropertySet > xLinguProp( LinguMgr::GetLinguPropertySet(), UNO_QUERY );
- BOOL bCurrentDocCBChecked = aCurrentDocCB.IsChecked();
- if(aCurrentDocCB.IsEnabled())
- bLanguageCurrentDoc_Impl = bCurrentDocCBChecked;
- BOOL bCurrentDocCBChanged = bCurrentDocCBChecked != aCurrentDocCB.GetSavedValue();
-
- BOOL bValChanged = aWesternLanguageLB.GetSavedValue() != aWesternLanguageLB.GetSelectEntryPos();
- if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
- {
- LanguageType eSelectLang = aWesternLanguageLB.GetSelectLanguage();
- if(!bCurrentDocCBChecked)
- {
- Any aValue;
- Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
- aValue <<= aLocale;
- OUString aPropName( C2U("DefaultLocale") );
- pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
- if (xLinguProp.is())
- xLinguProp->setPropertyValue( aPropName, aValue );
- }
- if(pCurrentDocShell)
- {
- rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::LATIN),
- SID_ATTR_LANGUAGE));
- bRet = TRUE;
- }
- }
- bValChanged = aAsianLanguageLB.GetSavedValue() != aAsianLanguageLB.GetSelectEntryPos();
- if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
- {
- LanguageType eSelectLang = aAsianLanguageLB.GetSelectLanguage();
- if(!bCurrentDocCBChecked)
- {
- Any aValue;
- Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
- aValue <<= aLocale;
- OUString aPropName( C2U("DefaultLocale_CJK") );
- pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
- if (xLinguProp.is())
- xLinguProp->setPropertyValue( aPropName, aValue );
- }
- if(pCurrentDocShell)
- {
- rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::ASIAN),
- SID_ATTR_CHAR_CJK_LANGUAGE));
- bRet = TRUE;
- }
- }
- bValChanged = aComplexLanguageLB.GetSavedValue() != aComplexLanguageLB.GetSelectEntryPos();
- if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
- {
- LanguageType eSelectLang = aComplexLanguageLB.GetSelectLanguage();
- if(!bCurrentDocCBChecked)
- {
- Any aValue;
- Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
- aValue <<= aLocale;
- OUString aPropName( C2U("DefaultLocale_CTL") );
- pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
- if (xLinguProp.is())
- xLinguProp->setPropertyValue( aPropName, aValue );
- }
- if(pCurrentDocShell)
- {
- rSet.Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, ::com::sun::star::i18n::ScriptType::COMPLEX),
- SID_ATTR_CHAR_CTL_LANGUAGE));
- bRet = TRUE;
- }
- }
-
- if(aAsianSupportCB.GetSavedValue() != aAsianSupportCB.IsChecked() )
- {
- sal_Bool bChecked = aAsianSupportCB.IsChecked();
- pLangConfig->aLanguageOptions.SetAll(bChecked);
- //iterate over all bindings to invalidate vertical text direction
-
- const sal_uInt16 STATE_COUNT = 2;
-
- SfxBoolItem* pBoolItems[STATE_COUNT];
- pBoolItems[0] = new SfxBoolItem(SID_VERTICALTEXT_STATE, FALSE);
- pBoolItems[1] = new SfxBoolItem(SID_TEXT_FITTOSIZE_VERTICAL, FALSE);
-
- SfxVoidItem* pInvalidItems[STATE_COUNT];
- pInvalidItems[0] = new SfxVoidItem(SID_VERTICALTEXT_STATE);
- pInvalidItems[1] = new SfxVoidItem(SID_TEXT_FITTOSIZE_VERTICAL);
-
- lcl_UpdateAndDelete(pInvalidItems, pBoolItems, STATE_COUNT);
- }
-
- if ( aCTLSupportCB.GetSavedValue() != aCTLSupportCB.IsChecked() )
- {
- pLangConfig->aLanguageOptions.SetCTLFontEnabled( aCTLSupportCB.IsChecked() );
-
- const sal_uInt16 STATE_COUNT = 1;
- SfxBoolItem* pBoolItems[STATE_COUNT];
- pBoolItems[0] = new SfxBoolItem(SID_CTLFONT_STATE, FALSE);
- SfxVoidItem* pInvalidItems[STATE_COUNT];
- pInvalidItems[0] = new SfxVoidItem(SID_CTLFONT_STATE);
- lcl_UpdateAndDelete(pInvalidItems, pBoolItems, STATE_COUNT);
- }
-
-
-
- if ( pLangConfig->aSysLocaleOptions.IsModified() )
- pLangConfig->aSysLocaleOptions.Commit();
- pLangConfig->aSysLocaleOptions.BlockBroadcasts( FALSE );
-
- return FALSE;
-}
-//-----------------------------------------------------------------------------
-void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
-{
- OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString();
- if ( sLang.getLength() )
- aLocaleSettingLB.SelectLanguage(lcl_LangStringToLangType(sLang));
- else
- aLocaleSettingLB.SelectLanguage( LANGUAGE_SYSTEM );
- sal_Bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_LOCALE);
- aLocaleSettingLB.Enable(!bReadonly);
- aLocaleSettingFT.Enable(!bReadonly);
- aLocaleSettingFI.Show(bReadonly);
-
- //
- aDecimalSeparatorCB.Check( pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale());
- aDecimalSeparatorCB.SaveValue();
-
- // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support
- // #i15812# must be done *before* the configured currency is set
- // and update the decimal separator used for the given locale
- LocaleSettingHdl(&aLocaleSettingLB);
-
- // configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default
- String aAbbrev;
- LanguageType eLang;
- const NfCurrencyEntry* pCurr = NULL;
- sLang = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
- if ( sLang.getLength() )
- {
- SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( aAbbrev, eLang, sLang );
- pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang );
- }
- // if pCurr==NULL the SYSTEM entry is selected
- USHORT nPos = aCurrencyLB.GetEntryPos( (void*) pCurr );
- aCurrencyLB.SelectEntryPos( nPos );
- bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_CURRENCY);
- aCurrencyLB.Enable(!bReadonly);
- aCurrencyFT.Enable(!bReadonly);
- aCurrencyFI.Show(bReadonly);
-
- //western/CJK/CLK language
- LanguageType eCurLang = LANGUAGE_NONE;
- LanguageType eCurLangCJK = LANGUAGE_NONE;
- LanguageType eCurLangCTL = LANGUAGE_NONE;
- SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
- //collect the configuration values first
- aCurrentDocCB.Enable(FALSE);
- //
- Any aWestLang;
- Any aCJKLang;
- Any aCTLLang;
- try
- {
- aWestLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale"));
- Locale aLocale;
- aWestLang >>= aLocale;
-
- eCurLang = MsLangId::convertLocaleToLanguage( aLocale );
-
- aCJKLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CJK"));
- aLocale = Locale();
- aCJKLang >>= aLocale;
- eCurLangCJK = MsLangId::convertLocaleToLanguage( aLocale );
-
- aCTLLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CTL"));
- aLocale = Locale();
- aCTLLang >>= aLocale;
- eCurLangCTL = MsLangId::convertLocaleToLanguage( aLocale );
- }
- catch(Exception&)
- {
- }
- //overwrite them by the values provided by the DocShell
- if(pCurrentDocShell)
- {
- aCurrentDocCB.Enable(TRUE);
- aCurrentDocCB.Check(bLanguageCurrentDoc_Impl);
- const SfxPoolItem* pLang;
- if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_LANGUAGE, FALSE, &pLang))
- {
- LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
- if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, ::com::sun::star::i18n::ScriptType::LATIN) != eTempCurLang)
- eCurLang = eTempCurLang;
- }
-
- if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pLang))
- {
- LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
- if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, ::com::sun::star::i18n::ScriptType::ASIAN) != eTempCurLang)
- eCurLangCJK = eTempCurLang;
- }
-
- if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pLang))
- {
- LanguageType eTempCurLang = ((const SvxLanguageItem*)pLang)->GetValue();
- if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, ::com::sun::star::i18n::ScriptType::COMPLEX) != eTempCurLang)
- eCurLangCTL = eTempCurLang;
- }
- }
- if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang)
- aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE);
- else
- aWesternLanguageLB.SelectLanguage(eCurLang);
-
- if(LANGUAGE_NONE == eCurLangCJK || LANGUAGE_DONTKNOW == eCurLangCJK)
- aAsianLanguageLB.SelectLanguage(LANGUAGE_NONE);
- else
- aAsianLanguageLB.SelectLanguage(eCurLangCJK);
-
- if(LANGUAGE_NONE == eCurLangCTL || LANGUAGE_DONTKNOW == eCurLangCTL)
- aComplexLanguageLB.SelectLanguage(LANGUAGE_NONE);
- else
- aComplexLanguageLB.SelectLanguage(eCurLangCTL);
-
- aWesternLanguageLB.SaveValue();
- aAsianLanguageLB.SaveValue();
- aComplexLanguageLB.SaveValue();
- aCurrentDocCB.SaveValue();
-
- sal_Bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale") );
- aWesternLanguageFT.Enable( bEnable );
- aWesternLanguageLB.Enable( bEnable );
-
-
- aWesternLanguageFI.Show(!bEnable);
-
- // #i15812# controls for CJK/CTL already enabled/disabled from LocaleSettingHdl
-#if 0
- bEnable = ( !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CJK") ) && aAsianSupportCB.IsChecked() );
- aAsianLanguageFT.Enable( bEnable );
- aAsianLanguageLB.Enable( bEnable );
-
- bEnable = ( !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CTL") ) && aCTLSupportCB.IsChecked() );
- aComplexLanguageFT.Enable( bEnable );
- aComplexLanguageLB.Enable( bEnable );
-#endif
- /*---------------------07-05-07--------------------------
- check the box "For the current document only"
- set the focus to the Western Language box
- --------------------------------------------------------*/
- const SfxPoolItem* pLang = 0;
- if ( SFX_ITEM_SET == rSet.GetItemState(SID_SET_DOCUMENT_LANGUAGE, FALSE, &pLang ) &&( (const SfxBoolItem*)pLang)->GetValue() == TRUE )
- {
- aWesternLanguageLB.GrabFocus();
- aCurrentDocCB.Enable(TRUE);
- aCurrentDocCB.Check(TRUE);
- }
-}
-/* -----------------------------20.04.01 15:09--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( OfaLanguagesTabPage, SupportHdl, CheckBox*, pBox )
-{
- DBG_ASSERT( pBox, "OfaLanguagesTabPage::SupportHdl(): pBox invalid" );
-
- sal_Bool bCheck = pBox->IsChecked();
- if ( &aAsianSupportCB == pBox )
- {
- sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CJK"));
- bCheck = ( bCheck && !bReadonly );
- aAsianLanguageFT.Enable( bCheck );
- aAsianLanguageLB.Enable( bCheck );
- aAsianLanguageFI.Show(bReadonly);
- if( pBox->IsEnabled() )
- m_bOldAsian = bCheck;
- }
- else if ( &aCTLSupportCB == pBox )
- {
- sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CTL"));
- bCheck = ( bCheck && !bReadonly );
- aComplexLanguageFT.Enable( bCheck );
- aComplexLanguageLB.Enable( bCheck );
- aComplexLanguageFI.Show(bReadonly);
- if( pBox->IsEnabled() )
- m_bOldCtl = bCheck;
- }
- else
- {
- DBG_ERRORFILE( "OfaLanguagesTabPage::SupportHdl(): wrong pBox" );
- }
-
- return 0;
-}
-
-namespace
-{
- void lcl_checkLanguageCheckBox(CheckBox& _rCB,sal_Bool _bNewValue,sal_Bool _bOldValue)
- {
- if ( _bNewValue )
- _rCB.Check(TRUE);
- else
- _rCB.Check( _bOldValue );
-// #i15082# do not call SaveValue() in running dialog...
-// _rCB.SaveValue();
- _rCB.Enable( !_bNewValue );
- }
-}
-/* -----------------08.06.01 17:56-------------------
-
- --------------------------------------------------*/
-IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox )
-{
- LanguageType eLang = pBox->GetSelectLanguage();
- sal_uInt16 nType = SvtLanguageOptions::GetScriptTypeOfLanguage(eLang);
- // first check if CTL must be enabled
- // #103299# - if CTL font setting is not readonly
- if(!pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_CTLFONT))
- {
- bool bIsCTLFixed = (nType & SCRIPTTYPE_COMPLEX) != 0;
- lcl_checkLanguageCheckBox(aCTLSupportCB, bIsCTLFixed, m_bOldCtl);
- SupportHdl( &aCTLSupportCB );
- }
- // second check if CJK must be enabled
- // #103299# - if CJK support is not readonly
- if(!pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_ALLCJK))
- {
- bool bIsCJKFixed = (nType & SCRIPTTYPE_ASIAN) != 0;
- lcl_checkLanguageCheckBox(aAsianSupportCB, bIsCJKFixed, m_bOldAsian);
- SupportHdl( &aAsianSupportCB );
- }
-
- USHORT nPos;
- if ( eLang == LANGUAGE_SYSTEM )
- nPos = aCurrencyLB.GetEntryPos( (void*) NULL );
- else
- {
- const NfCurrencyEntry* pCurr = &SvNumberFormatter::GetCurrencyEntry( eLang );
- nPos = aCurrencyLB.GetEntryPos( (void*) pCurr );
- }
- aCurrencyLB.SelectEntryPos( nPos );
-
- //update the decimal separator key of the related CheckBox
- Locale aTempLocale;
- SvxLanguageToLocale( aTempLocale, eLang );
- LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), aTempLocale );
- String sTempLabel(sDecimalSeparatorLabel);
- sTempLabel.SearchAndReplaceAscii("%1", aLocaleWrapper.getNumDecimalSep() );
- aDecimalSeparatorCB.SetText(sTempLabel);
-
- return 0;
-}
-
diff --git a/svx/source/cui/optgdlg.hrc b/svx/source/cui/optgdlg.hrc
deleted file mode 100644
index 4001d2056a..0000000000
--- a/svx/source/cui/optgdlg.hrc
+++ /dev/null
@@ -1,208 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optgdlg.hrc,v $
- * $Revision: 1.22 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTGDLG_HRC
-#define _SVX_OPTGDLG_HRC
-#include <svtools/controldims.hrc>
-
-// defines for positions and sizes ---------------------------------------
-
-#define WHOLE_WIDTH 248
-#define EDIT_WIDTH 30
-#define UNIT_WIDTH 40
-
-#define COLSPACE RSC_SP_CTRL_DESC_X
-#define COL0 6
-#define COL1 (COL0+6)
-#define COL2 (COL1+10)
-#define COL3 (COL2+100)
-#define COL4 (COL3+COLSPACE)
-#define COL5 (COL4+EDIT_WIDTH)
-#define COL6 (COL5+COLSPACE)
-
-#define ROWSPACE RSC_SP_CTRL_DESC_Y
-#define ROW0 3
-#define ROW1 (ROW0+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
-#define ROW2 (ROW1+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
-#define ROW3 (ROW2+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
-#define ROW4 (ROW3+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
-#define ROW5 (ROW4+RSC_CD_PUSHBUTTON_HEIGHT+ROWSPACE)
-#define ROW6 (ROW5+RSC_CD_DROPDOWN_HEIGHT+ROWSPACE)
-#define ROW7 (ROW6+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
-#define ROW8 (ROW7+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
-#define ROW9 (ROW8+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
-#define ROW10 (ROW9+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
-#define ROW11 (ROW10+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
-
-#define DIFF(v1,v2) (v2-v1)
-#define OFFS_TEXTBOX_FIXEDTEXT(base) (base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
-//#define OFFS_PUSHBUTTON_FIXEDTEXT(base) (base+(RSC_CD_PUSHBUTTON_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
-
-#define ROW_MF_SCALING (13)
-#define ROW_FT_ICONSIZESTYLE (ROW_MF_SCALING+RSC_CD_DROPDOWN_HEIGHT+ROWSPACE)
-#define ROW_LB_ICONSIZESTYLE (ROW_FT_ICONSIZESTYLE+RSC_CD_FIXEDTEXT_HEIGHT+ROWSPACE)
-#define ROW_CB_SYSTEM_FONT (ROW_LB_ICONSIZESTYLE+RSC_CD_DROPDOWN_HEIGHT+ROWSPACE)
-#define ROW_CB_FONTANTIALIASING (ROW_CB_SYSTEM_FONT+ (2 * RSC_CD_FIXEDLINE_HEIGHT) +ROWSPACE)
-#define ROW_NF_AA_POINTLIMIT (ROW_CB_FONTANTIALIASING+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
-
-#define ROW_FL_MENU (ROW_NF_AA_POINTLIMIT+RSC_CD_DROPDOWN_HEIGHT+RSC_SP_FLGR_SPACE_X)
-#define ROW_FT_MENU_ICONS (ROW_FL_MENU + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-#define ROW_LB_MENU_ICONS (ROW_FT_MENU_ICONS + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-
-#define ROW_FL_FONTLISTS (ROW_LB_MENU_ICONS + RSC_CD_CHECKBOX_HEIGHT + RSC_SP_FLGR_SPACE_X)
-#define ROW_CB_FONT_SHOW (ROW_FL_FONTLISTS + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-#define ROW_CB_FONT_HISTORY (ROW_CB_FONT_SHOW + RSC_CD_CHECKBOX_HEIGHT + ROWSPACE)
-
-// #i95644# start on top with rendering section
-#define ROW_FL_RENDERING (3)
-#define ROW_CB_USE_HARDACCELL (ROW_FL_RENDERING + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-#define ROW_CB_USE_ANTIALIASE (ROW_CB_USE_HARDACCELL + RSC_CD_CHECKBOX_HEIGHT + ROWSPACE)
-
-// #i95644# set Menu to follow vertically (was (ROW_FL_MENU)) previously)
-#define ROW_FL_MOUSE (ROW_CB_USE_ANTIALIASE + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_SPACE_X)
-#define ROW_FT_MOUSEPOS (ROW_FL_MOUSE + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-#define ROW_LB_MOUSEPOS (ROW_FT_MOUSEPOS + RSC_CD_FIXEDTEXT_HEIGHT + ROWSPACE)
-#define ROW_FT_MOUSEMIDDLE (ROW_LB_MOUSEPOS + RSC_CD_DROPDOWN_HEIGHT + ROWSPACE)
-#define ROW_LB_MOUSEMIDDLE (ROW_FT_MOUSEMIDDLE + RSC_CD_FIXEDTEXT_HEIGHT + ROWSPACE)
-
-// #i97672#
-#define ROW_FL_SELECTION (ROW_LB_MOUSEMIDDLE + RSC_CD_DROPDOWN_HEIGHT + RSC_SP_FLGR_SPACE_X)
-#define ROW_CB_SELECTION (ROW_FL_SELECTION + RSC_CD_FIXEDLINE_HEIGHT + ROWSPACE)
-
-// tabpage general -------------------------------------------------------
-
-#define FL_HELP 10
-#define CB_TOOLTIP 11
-#define CB_EXTHELP 12
-#define CB_HELPAGENT 13
-#define PB_HELPAGENT_RESET 14
-#define FT_HELPFORMAT 15
-#define LB_HELPFORMAT 16
-
-//#define FL_FILEDLG 20
-//#define CB_FILEDLG 21
-
-//#define FL_DOCSTATUS 30
-//#define CB_DOCSTATUS 31
-
-#define FL_TWOFIGURE 40
-#define FT_INTERPRET 41
-#define NF_YEARVALUE 42
-#define FT_TOYEAR 43
-#define FL_PRINTDLG 44
-#define CB_PRINTDLG 45
-
-// tabpage view ----------------------------------------------------------
-// #i95644# 10 .. 14 freed, may be reused
-
-#define FL_USERINTERFACE 20
-#define FT_WINDOWSIZE 21
-#define MF_WINDOWSIZE 22
-
-#define FL_MOUSE 30
-#define LB_MOUSEPOS 31
-#define FT_MOUSEPOS 32
-#define FT_MOUSEMIDDLE 33
-#define LB_MOUSEMIDDLE 34
-
-#define FT_MENU_ICONS 40
-#define LB_MENU_ICONS 41
-#define FL_MENU 42
-#define FL_FONTLISTS 43
-
-#define LB_ICONSIZE 54
-#define FT_ICONSIZESTYLE 55
-#define LB_ICONSTYLE 56
-#define CB_SYSTEM_FONT 57
-#define STR_ICONSIZE 58
-
-#define CB_FONT_SHOW 60
-#define CB_FONT_HISTORY 62
-
-#define CB_FONTANTIALIASING 63
-#define NF_AA_POINTLIMIT 64
-#define FT_POINTLIMIT_LABEL 65
-#define FT_POINTLIMIT_UNIT 66
-
-#define FL_RENDERING 67
-#define CB_USE_HARDACCELL 68
-#define CB_USE_ANTIALIASE 69
-
-// #i97672#
-#define FL_SELECTION 70
-#define CB_SELECTION 71
-#define MF_SELECTION 72
-
-// tabpage languages -----------------------------------------------------
-
-#define FL_UI_LANG 1
-#define FT_UI_LANG 2
-#define LB_UI_LANG 3
-#define FL_LINGU_LANG 4
-#define FT_WEST_LANG 5
-#define LB_WEST_LANG 6
-#define FT_ASIAN_LANG 7
-#define LB_ASIAN_LANG 8
-#define FT_COMPLEX_LANG 9
-#define LB_COMPLEX_LANG 10
-#define CB_CURRENT_DOC 11
-#define FL_ENHANCED 12
-#define CB_ASIANSUPPORT 13
-#define CB_CTLSUPPORT 15
-#define FT_LOCALESETTING 16
-#define LB_LOCALESETTING 17
-#define FT_CURRENCY 18
-#define LB_CURRENCY 19
-#define FI_WEST_LANG 20
-#define FI_ASIAN_LANG 21
-#define FI_COMPLEX_LANG 22
-#define FI_ASIANSUPPORT 23
-#define FI_CTLSUPPORT 24
-#define FI_LOCALESETTING 25
-#define FI_CURRENCY 26
-#define FT_DECIMALSEPARATOR 27
-#define CB_DECIMALSEPARATOR 28
-#define FI_USERINTERFACE 29
-#define FT_USERINTERFACE 30
-#define LB_USERINTERFACE 31
-#define STR_IB_LANGCHANGE_TITLE 32
-
-#define FL_FILEDLG 53
-#define FI_FILEDLG_RO 54
-#define CB_FILEDLG 55
-#define FT_GRAPHICCACHE_UNIT 56
-#define FT_GRAPHICOBJECTCACHE_UNIT 57
-#define FT_GRAPHICOBJECTTIME_UNIT 58
-#define FT_HELPAGENT_TIME_UNIT 59
-#define FL_DOCSTATUS 60
-#define CB_DOCSTATUS 61
-#endif // #ifndef _SVX_OPTGDLG_HRC
-
-// ******************************************************************* EOF
-
diff --git a/svx/source/cui/optgdlg.hxx b/svx/source/cui/optgdlg.hxx
deleted file mode 100644
index 52fe207310..0000000000
--- a/svx/source/cui/optgdlg.hxx
+++ /dev/null
@@ -1,217 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optgdlg.hxx,v $
- * $Revision: 1.23 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _OFA_OPTGDLG_HXX
-#define _OFA_OPTGDLG_HXX
-#include <vcl/lstbox.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/langbox.hxx>
-#include <readonlyimage.hxx>
-#define FOLDERWEBVIEW_DEFAULTFILE "folder.so"
-
-// predeclarations
-class CanvasSettings;
-class SvtOptionsDrawinglayer;
-
-// class OfaMiscTabPage --------------------------------------------------
-
-class OfaMiscTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-private:
- FixedLine aHelpFL;
- CheckBox aToolTipsCB;
- CheckBox aExtHelpCB;
- CheckBox aHelpAgentCB;
- PushButton aHelpAgentResetBtn;
- FixedText aHelpFormatFT;
- ListBox aHelpFormatLB;
-
- FixedLine aFileDlgFL;
- ReadOnlyImage aFileDlgROImage;
- CheckBox aFileDlgCB;
-
- FixedLine aPrintDlgFL;
- CheckBox aPrintDlgCB;
-
- FixedLine aDocStatusFL;
- CheckBox aDocStatusCB;
-
- FixedLine aTwoFigureFL;
- FixedText aInterpretFT;
- NumericField aYearValueField;
- FixedText aToYearFT;
-
- String aStrDateInfo;
-
- DECL_LINK( TwoFigureHdl, NumericField* );
- DECL_LINK( TwoFigureConfigHdl, NumericField* );
- DECL_LINK( HelpCheckHdl_Impl, CheckBox* );
- DECL_LINK( HelpAgentResetHdl_Impl, PushButton* );
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = NULL );
-
-public:
- OfaMiscTabPage( Window* pParent, const SfxItemSet& rSet );
- ~OfaMiscTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-// class OfaViewTabPage --------------------------------------------------
-class SvtTabAppearanceCfg;
-
-class OfaViewTabPage : public SfxTabPage
-{
-private:
- FixedLine aUserInterfaceFL;
- FixedText aWindowSizeFT;
- MetricField aWindowSizeMF;
- FixedText aIconSizeStyleFT;
- ListBox aIconSizeLB;
- ListBox aIconStyleLB;
- CheckBox m_aSystemFont;
-
-#if defined( UNX )
- CheckBox aFontAntiAliasing;
- FixedText aAAPointLimitLabel;
- NumericField aAAPointLimit;
- FixedText aAAPointLimitUnits;
-#endif
-
- FixedLine aMenuFL;
- FixedText aMenuIconsFT;
- ListBox aMenuIconsLB;
-
- FixedLine aFontListsFL;
- CheckBox aFontShowCB;
- CheckBox aFontHistoryCB;
-
- FixedLine aRenderingFL;
- CheckBox aUseHardwareAccell;
- CheckBox aUseAntiAliase;
-
- FixedLine aMouseFL;
- FixedText aMousePosFT;
- ListBox aMousePosLB;
- FixedText aMouseMiddleFT;
- ListBox aMouseMiddleLB;
-
- // #i97672#
- FixedLine maSelectionFL;
- CheckBox maSelectionCB;
- MetricField maSelectionMF;
-
- UINT16 nSizeLB_InitialSelection;
- UINT16 nStyleLB_InitialSelection;
- BOOL bSfxSymbolsAuto;
-
- SvtTabAppearanceCfg* pAppearanceCfg;
- CanvasSettings* pCanvasSettings;
- SvtOptionsDrawinglayer* mpDrawinglayerOpt;
-
-#if defined( UNX )
- DECL_LINK( OnAntialiasingToggled, void* );
-#endif
- // #i97672#
- DECL_LINK( OnSelectionToggled, void* );
-
-public:
- OfaViewTabPage( Window* pParent, const SfxItemSet& rSet );
- ~OfaViewTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-/* -----------------------------23.11.00 13:04--------------------------------
-
- ---------------------------------------------------------------------------*/
-struct LanguageConfig_Impl;
-class OfaLanguagesTabPage : public SfxTabPage
-{
- FixedLine aUILanguageGB;
- ReadOnlyImage aLocaleSettingFI;
- FixedText aUserInterfaceFT;
- ListBox aUserInterfaceLB;
- FixedText aLocaleSettingFT;
- SvxLanguageBox aLocaleSettingLB;
- ReadOnlyImage aCurrencyFI;
- FixedText aDecimalSeparatorFT;
- CheckBox aDecimalSeparatorCB;
- FixedText aCurrencyFT;
- ListBox aCurrencyLB;
-
- FixedLine aLinguLanguageGB;
- ReadOnlyImage aWesternLanguageFI;
- FixedText aWesternLanguageFT;
- SvxLanguageBox aWesternLanguageLB;
- ReadOnlyImage aAsianLanguageFI;
- FixedText aAsianLanguageFT;
- SvxLanguageBox aAsianLanguageLB;
- ReadOnlyImage aComplexLanguageFI;
- FixedText aComplexLanguageFT;
- SvxLanguageBox aComplexLanguageLB;
- CheckBox aCurrentDocCB;
- FixedLine aEnhancedFL;
- ReadOnlyImage aAsianSupportFI;
- CheckBox aAsianSupportCB;
- ReadOnlyImage aCTLSupportFI;
- CheckBox aCTLSupportCB;
-
- const String sDecimalSeparatorLabel;
-
- sal_Bool m_bOldAsian;
- sal_Bool m_bOldCtl;
- LanguageConfig_Impl* pLangConfig;
-
- rtl::OUString m_sUserLocaleValue;
-
- DECL_LINK( SupportHdl, CheckBox* ) ;
- DECL_LINK( LocaleSettingHdl, SvxLanguageBox* ) ;
-
-public:
- OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSet );
- ~OfaLanguagesTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-#endif // #ifndef _OFA_OPTGDLG_HXX
-
-
diff --git a/svx/source/cui/optgdlg.src b/svx/source/cui/optgdlg.src
deleted file mode 100644
index f663a7ed44..0000000000
--- a/svx/source/cui/optgdlg.src
+++ /dev/null
@@ -1,642 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optgdlg.src,v $
- * $Revision: 1.32 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-
-#include <svx/dialogs.hrc>
-#include "optgdlg.hrc"
-#include "helpid.hrc"
-
- //****************************************************************************
- //
- // TabPage Sonstiges
- //
- //****************************************************************************
-
-TabPage OFA_TP_MISC
-{
- HelpID = HID_OFA_TP_MISC ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine FL_HELP
- {
- Pos = MAP_APPFONT( COL0, ROW0 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Help";
- };
- CheckBox CB_TOOLTIP
- {
- Pos = MAP_APPFONT( COL1, ROW1 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Tips";
- };
- CheckBox CB_EXTHELP
- {
- Pos = MAP_APPFONT( COL2, ROW2 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL2, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Extended tips";
- };
- CheckBox CB_HELPAGENT
- {
- Pos = MAP_APPFONT( COL1, ROW3 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Help Agent";
- };
- PushButton PB_HELPAGENT_RESET
- {
- Pos = MAP_APPFONT( COL2, ROW4 );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- Text [ en-US ] = "~Reset Help Agent";
- };
- FixedText FT_HELPFORMAT
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW5) );
- Size = MAP_APPFONT( DIFF( COL1, COL3 ), RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Help ~formatting";
- };
- ListBox LB_HELPFORMAT
- {
- Pos = MAP_APPFONT( COL4, ROW5 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL4, 50 );
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Default" ; > ;
- < "High Contrast #1" ; > ;
- < "High Contrast #2" ; > ;
- < "High Contrast Black" ; > ;
- < "High Contrast White" ; > ;
- };
- };
- FixedLine FL_FILEDLG
- {
- Pos = MAP_APPFONT( COL0, ROW6 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Open/Save dialogs";
- };
- FixedImage FI_FILEDLG_RO
- {
- Pos = MAP_APPFONT( COL1 - 7, ROW7 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- Hide = TRUE;
- };
- CheckBox CB_FILEDLG
- {
- Pos = MAP_APPFONT( COL1, ROW7 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Use %PRODUCTNAME dialogs";
- };
- FixedLine FL_DOCSTATUS
- {
- Pos = MAP_APPFONT( COL0, ROW8 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Document status";
- };
- CheckBox CB_DOCSTATUS
- {
- Pos = MAP_APPFONT( COL1, ROW9 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Printing sets \"document modified\" status";
- };
- FixedLine FL_TWOFIGURE
- {
- Pos = MAP_APPFONT( COL0, ROW10 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Year (two digits)" ;
- };
- FixedText FT_INTERPRET
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
- Size = MAP_APPFONT( DIFF( COL1, COL3), RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Interpret as years between";
- };
- NumericField NF_YEARVALUE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( COL4, ROW11 );
- Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
- Minimum = 1583 ;
- Maximum = 9857 ;
- Spin = TRUE ;
- Repeat = TRUE ;
- };
- FixedText FT_TOYEAR
- {
- Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL6, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "and " ;
- };
- FixedLine FL_PRINTDLG
- {
- Pos = MAP_APPFONT( COL0, ROW8 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Print dialogs";
- };
- CheckBox CB_PRINTDLG
- {
- Pos = MAP_APPFONT( COL1, ROW9 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Use %PRODUCTNAME ~dialogs";
- };
-};
-
- //****************************************************************************
- //
- // TabPage Ansicht
- //
- //****************************************************************************
-
-TabPage OFA_TP_VIEW
-{
- HelpID = HID_OFA_TP_VIEW ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine FL_USERINTERFACE
- {
- Pos = MAP_APPFONT ( 6 , ROW0 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "User Interface" ;
- };
- FixedText FT_WINDOWSIZE
- {
- Pos = MAP_APPFONT ( 12 , OFFS_TEXTBOX_FIXEDTEXT( ROW_MF_SCALING ) ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Sc~aling" ;
- };
- MetricField MF_WINDOWSIZE
- {
- Pos = MAP_APPFONT ( 95 , ROW_MF_SCALING ) ;
- Size = MAP_APPFONT ( 31 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 80 ;
- Maximum = 130 ;
- DecimalDigits = 0 ;
- First = 80 ;
- Last = 130 ;
- SpinSize = 1 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- };
- FixedText FT_ICONSIZESTYLE
- {
- Pos = MAP_APPFONT ( 12 , ROW_FT_ICONSIZESTYLE ) ;
- Size = MAP_APPFONT ( 114 , 8 ) ;
- Text [ en-US ] = "Icon size and style" ;
- };
- String STR_ICONSIZE
- {
- Text [ en-US ] = "Icon size" ;
- };
- ListBox LB_ICONSIZE
- {
- Pos = MAP_APPFONT ( 12 , ROW_LB_ICONSIZESTYLE ) ;
- Size = MAP_APPFONT ( 45 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Automatic" ; > ;
- < "Small" ; > ;
- < "Large" ; > ;
- };
- };
- ListBox LB_ICONSTYLE
- {
- Pos = MAP_APPFONT ( 61 , ROW_LB_ICONSIZESTYLE ) ;
- Size = MAP_APPFONT ( 65 , 70 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Automatic" ; > ;
- < "Galaxy (default)" ; > ;
- < "High Contrast" ; > ;
- < "Industrial" ; > ;
- < "Crystal" ; > ;
- < "Tango" ; > ;
- < "Classic" ; > ;
- };
- };
- CheckBox CB_SYSTEM_FONT
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( 12, ROW_CB_SYSTEM_FONT );
- Size = MAP_APPFONT( 114, 16 );
- WordBreak = TRUE;
- Text[ en-US ] = "Use system ~font for user interface";
- };
-
- CheckBox CB_FONTANTIALIASING
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , ROW_CB_FONTANTIALIASING ) ;
- Size = MAP_APPFONT ( 110 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Screen font antialiasing" ;
- };
- FixedText FT_POINTLIMIT_LABEL
- {
- Pos = MAP_APPFONT ( 23 , OFFS_TEXTBOX_FIXEDTEXT( ROW_NF_AA_POINTLIMIT ) ) ;
- Size = MAP_APPFONT ( 20 , 8 ) ;
- Text [ en-US ] = "from";
- };
- NumericField NF_AA_POINTLIMIT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 46, ROW_NF_AA_POINTLIMIT ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Minimum = 1;
- Maximum = 10000;
- SpinSize = 1;
- Spin = TRUE ;
- Repeat = TRUE ;
- };
- FixedText FT_POINTLIMIT_UNIT
- {
- Pos = MAP_APPFONT ( 79 , OFFS_TEXTBOX_FIXEDTEXT( ROW_NF_AA_POINTLIMIT ) ) ;
- Size = MAP_APPFONT ( 47 , 8 ) ;
- Text [ en-US ] = "Pixels";
- };
- FixedLine FL_MENU
- {
- Pos = MAP_APPFONT ( 6, ROW_FL_MENU ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Menu" ;
- };
- FixedText FT_MENU_ICONS
- {
- Pos = MAP_APPFONT ( 12 , ROW_FT_MENU_ICONS ) ;
- Size = MAP_APPFONT ( 114 , 8 ) ;
- Text [ en-US ] = "Icons in menus" ;
- };
- ListBox LB_MENU_ICONS
- {
- Pos = MAP_APPFONT ( 12 , ROW_LB_MENU_ICONS ) ;
- Size = MAP_APPFONT ( 114 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Automatic" ; > ;
- < "Hide" ; > ;
- < "Show" ; > ;
- };
- };
- FixedLine FL_FONTLISTS
- {
- Pos = MAP_APPFONT ( 6, ROW_FL_FONTLISTS ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Font Lists" ;
- };
- CheckBox CB_FONT_SHOW
- {
- Pos = MAP_APPFONT ( 12, ROW_CB_FONT_SHOW ) ;
- Size = MAP_APPFONT ( 118 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Show p~review of fonts" ;
- };
- CheckBox CB_FONT_HISTORY
- {
- Pos = MAP_APPFONT ( 12, ROW_CB_FONT_HISTORY ) ;
- Size = MAP_APPFONT ( 118 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Show font h~istory" ;
- };
- FixedLine FL_RENDERING
- {
- Pos = MAP_APPFONT ( 133 , ROW_FL_RENDERING ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Graphics output";
- };
-
- CheckBox CB_USE_HARDACCELL
- {
- Pos = MAP_APPFONT ( 139, ROW_CB_USE_HARDACCELL ) ;
- Size = MAP_APPFONT ( 118 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Use hardware acceleration" ;
- };
-
- CheckBox CB_USE_ANTIALIASE
- {
- Pos = MAP_APPFONT ( 139, ROW_CB_USE_ANTIALIASE ) ;
- Size = MAP_APPFONT ( 118 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Use Anti-Aliasing" ;
- };
-
- FixedLine FL_MOUSE
- {
- Pos = MAP_APPFONT ( 133 , ROW_FL_MOUSE ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Mouse";
- };
- FixedText FT_MOUSEPOS
- {
- Pos = MAP_APPFONT ( 139, ROW_FT_MOUSEPOS ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Mouse positioning" ;
- };
- ListBox LB_MOUSEPOS
- {
- Pos = MAP_APPFONT ( 139, ROW_LB_MOUSEPOS ) ;
- Size = MAP_APPFONT ( 114 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Default button" ; > ;
- < "Dialog center" ; > ;
- < "No automatic positioning" ; > ;
- };
- };
- FixedText FT_MOUSEMIDDLE
- {
- Pos = MAP_APPFONT ( 139, ROW_FT_MOUSEMIDDLE ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Middle mouse button";
- };
- ListBox LB_MOUSEMIDDLE
- {
- Pos = MAP_APPFONT ( 139, ROW_LB_MOUSEMIDDLE ) ;
- Size = MAP_APPFONT ( 114 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "No function" ; > ;
- < "Automatic scrolling" ; > ;
- < "Paste clipboard" ; > ;
- };
- };
-
- // #i97672#
- FixedLine FL_SELECTION
- {
- Pos = MAP_APPFONT ( 133 , ROW_FL_SELECTION ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Selection";
- };
-
- CheckBox CB_SELECTION
- {
- Pos = MAP_APPFONT ( 139, ROW_CB_SELECTION + (((12 - RSC_CD_CHECKBOX_HEIGHT) / 2) + 1)) ;
- Size = MAP_APPFONT ( 118 - 34 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Transparency" ;
- };
-
- MetricField MF_SELECTION
- {
- Pos = MAP_APPFONT ( 139 + (95 - 12), ROW_CB_SELECTION ) ;
- Size = MAP_APPFONT ( 31 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 10 ;
- Maximum = 90 ;
- DecimalDigits = 0 ;
- First = 10 ;
- Last = 90 ;
- SpinSize = 5 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText [ en-US ] = "%" ;
- };
-};
-// *******************************************************************
-
-TabPage OFA_TP_LANGUAGES
-{
- HelpID = HID_OFA_TP_LANGUAGES ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine FL_UI_LANG
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Language of";
- };
- FixedImage FI_USERINTERFACE
- {
- Pos = MAP_APPFONT ( 5 , 17 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- FixedText FT_USERINTERFACE
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "~User interface";
- };
- ListBox LB_USERINTERFACE
- {
- Pos = MAP_APPFONT ( 123 , 14 ) ;
- Size = MAP_APPFONT ( 125 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Sort = TRUE;
- };
- FixedImage FI_LOCALESETTING
- {
- Pos = MAP_APPFONT ( 5 , 32 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- FixedText FT_LOCALESETTING
- {
- Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "Locale setting";
- };
- ListBox LB_LOCALESETTING
- {
- Pos = MAP_APPFONT ( 123 , 30 ) ;
- Size = MAP_APPFONT ( 125 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Sort = TRUE;
- };
- FixedText FT_DECIMALSEPARATOR
- {
- Pos = MAP_APPFONT ( 12 , 46 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "Decimal separator key";
- };
- CheckBox CB_DECIMALSEPARATOR
- {
- Pos = MAP_APPFONT ( 123 , 46) ;
- Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "~Same as locale setting ( %1 )";
- };
- FixedImage FI_CURRENCY
- {
- Pos = MAP_APPFONT ( 5 , 63 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- FixedText FT_CURRENCY
- {
- Pos = MAP_APPFONT ( 12 , 61 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "~Default currency";
- };
- ListBox LB_CURRENCY
- {
- Pos = MAP_APPFONT ( 123 , 59 ) ;
- Size = MAP_APPFONT ( 125 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Sort = TRUE;
- };
- FixedLine FL_LINGU_LANG
- {
- Pos = MAP_APPFONT ( 6 , 77 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Default languages for documents";
- };
- FixedImage FI_WEST_LANG
- {
- Pos = MAP_APPFONT ( 5 , 92 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- FixedText FT_WEST_LANG
- {
- Pos = MAP_APPFONT ( 12 , 90 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "Western";
- };
-
- ListBox LB_WEST_LANG
- {
- Pos = MAP_APPFONT ( 123 , 88 ) ;
- Size = MAP_APPFONT ( 125 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Sort = TRUE;
- };
- FixedImage FI_ASIAN_LANG
- {
- Pos = MAP_APPFONT ( 5 , 108 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- FixedText FT_ASIAN_LANG
- {
- Pos = MAP_APPFONT ( 12 , 106 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "Asian";
- };
- ListBox LB_ASIAN_LANG
- {
- Pos = MAP_APPFONT ( 123 , 104 ) ;
- Size = MAP_APPFONT ( 125 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Sort = TRUE;
- };
- FixedImage FI_COMPLEX_LANG
- {
- Pos = MAP_APPFONT ( 5 , 124 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- FixedText FT_COMPLEX_LANG
- {
- Pos = MAP_APPFONT ( 12 , 122 ) ;
- Size = MAP_APPFONT ( 108 , 8 ) ;
- Text [ en-US ] = "C~TL";
- };
- ListBox LB_COMPLEX_LANG
- {
- Pos = MAP_APPFONT ( 123 , 120 ) ;
- Size = MAP_APPFONT ( 125 , 60 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Sort = TRUE;
- };
- CheckBox CB_CURRENT_DOC
- {
- Pos = MAP_APPFONT ( 123 , 135 ) ;
- Size = MAP_APPFONT ( 125 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "For the current document only";
- };
- FixedLine FL_ENHANCED
- {
- Pos = MAP_APPFONT ( 6 , 145 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Enhanced language support";
- };
- FixedImage FI_ASIANSUPPORT
- {
- Pos = MAP_APPFONT ( 5 , 160 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- CheckBox CB_ASIANSUPPORT
- {
- Pos = MAP_APPFONT ( 12 , 158 ) ;
- Size = MAP_APPFONT ( 236 ,RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "E~nabled for Asian languages";
- };
- FixedImage FI_CTLSUPPORT
- {
- Pos = MAP_APPFONT ( 5 , 175 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- CheckBox CB_CTLSUPPORT
- {
- Pos = MAP_APPFONT ( 12 , 173 ) ;
- Size = MAP_APPFONT ( 236 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Ena~bled for complex text layout (CTL)";
- };
-};
-
-InfoBox RID_SVX_MSGBOX_LANGUAGE_RESTART
-{
- Message [ en-US ] = "The language setting of the user interface has been updated and will take effect the next time you start %PRODUCTNAME %PRODUCTVERSION";
-};
-
-
diff --git a/svx/source/cui/optgenrl.cxx b/svx/source/cui/optgenrl.cxx
deleted file mode 100644
index dd30e74da2..0000000000
--- a/svx/source/cui/optgenrl.cxx
+++ /dev/null
@@ -1,587 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optgenrl.cxx,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/saveopt.hxx>
-
-#define _SVX_OPTGENRL_CXX
-
-#include <svx/dialogs.hrc>
-#include "optgenrl.hrc"
-#include <svtools/useroptions.hxx>
-#include "cuioptgenrl.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <svx/strarray.hxx>
-
-#define TRIM(s) s.EraseLeadingChars().EraseTrailingChars()
-
-// struct GeneralTabPage_Impl --------------------------------------------
-
-struct GeneralTabPage_Impl
-{
- BOOL mbStreetEnabled;
- BOOL mbPLZEnabled;
- BOOL mbCityEnabled;
- BOOL mbUsCityEnabled;
- BOOL mbUsZipEnabled;
-
- String maQueryStr;
-
- GeneralTabPage_Impl() :
- mbStreetEnabled ( FALSE ),
- mbPLZEnabled ( FALSE ),
- mbCityEnabled ( FALSE ),
- mbUsCityEnabled ( FALSE ),
- mbUsZipEnabled ( FALSE ) {}
-};
-
-// -----------------------------------------------------------------------
-
-// kommt aus adritem.cxx
-//CHINA001 extern String ConvertToStore_Impl( const String& );
-//copy from adritem.cxx, since it will leave in svx.
-String ConvertToStore_Impl( const String& rText )
-{
- String sRet;
- USHORT i = 0;
-
- while ( i < rText.Len() )
- {
- if ( rText.GetChar(i) == '\\' || rText.GetChar(i) == '#' )
- sRet += '\\';
- sRet += rText.GetChar(i++);
- }
- return sRet;
-}
-
-
-// -----------------------------------------------------------------------
-
-SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSet ) :
-
- SfxTabPage( pParent, SVX_RES(RID_SFXPAGE_GENERAL), rCoreSet ),
-
- aCompanyLbl ( this, SVX_RES( FT_COMPANY ), true ),
- aCompanyEdit ( this, SVX_RES( ED_COMPANY ), INDEX_NOTSET, &aCompanyLbl ),
- aNameLbl ( this, SVX_RES( FT_NAME ), true ),
- aNameLblRuss ( this, SVX_RES( FT_NAME_RUSS ), true ),
- aNameLblEastern ( this, SVX_RES( FT_NAME_EASTERN ), true ),
- aFirstName ( this, SVX_RES( ED_FIRSTNAME ), 0, &aNameLbl ),
- aFatherName ( this, SVX_RES( ED_FATHERNAME ) ),
- aName ( this, SVX_RES( ED_NAME ), 1, &aNameLbl ),
- aShortName ( this, SVX_RES( ED_SHORTNAME ), 2, &aNameLbl ),
- aStreetLbl ( this, SVX_RES( FT_STREET ), true ),
- aStreetLblRuss ( this, SVX_RES( FT_STREET_RUSS ), true ),
- aStreetEdit ( this, SVX_RES( ED_STREET ), 0, &aStreetLbl ),
- aApartmentNrEdit( this, SVX_RES( ED_APARTMENTNR ), 1, &aStreetLblRuss ),
- aCityLbl ( this, SVX_RES( FT_CITY ), true ),
- aPLZEdit ( this, SVX_RES( ED_PLZ ), 0, &aCityLbl ),
- aCityEdit ( this, SVX_RES( ED_CITY ), 1, &aCityLbl ),
- aUsCityEdit ( this, SVX_RES( ED_US_CITY ), 0, &aCityLbl ),
- aUsStateEdit ( this, SVX_RES( ED_US_STATE ), 1, &aCityLbl ),
- aUsZipEdit ( this, SVX_RES( ED_US_ZIPCODE ), 2, &aCityLbl ),
- aCountryLbl ( this, SVX_RES( FT_COUNTRY ), true ),
- aCountryEdit ( this, SVX_RES( ED_COUNTRY ), INDEX_NOTSET, &aCountryLbl ),
- aTitlePosLbl ( this, SVX_RES( FT_TITLEPOS ), true ),
- aTitleEdit ( this, SVX_RES( ED_TITLE ), 0, &aTitlePosLbl ),
- aPositionEdit ( this, SVX_RES( ED_POSITION ), 1, &aTitlePosLbl ),
- aPhoneLbl ( this, SVX_RES( FT_PHONE ), true ),
- aTelPrivEdit ( this, SVX_RES( ED_TELPRIVAT ), 0, &aPhoneLbl ),
- aTelCompanyEdit ( this, SVX_RES( ED_TELCOMPANY ), 1, &aPhoneLbl ),
- aFaxMailLbl ( this, SVX_RES( FT_FAXMAIL ), true ),
- aFaxEdit ( this, SVX_RES( ED_FAX ), 0, &aFaxMailLbl ),
- aEmailEdit ( this, SVX_RES( ED_EMAIL ), 1, &aFaxMailLbl ),
- aAddrFrm ( this, SVX_RES( GB_ADDRESS ) ),
- aUseDataCB ( this, SVX_RES( CB_USEDATA ) ),
-
- pImpl ( new GeneralTabPage_Impl )
-
-{
- LanguageType eLang = Application::GetSettings().GetUILanguage();
- pImpl->maQueryStr = String( SVX_RES( STR_QUERY_REG ) );
-
- if ( LANGUAGE_ENGLISH_US == eLang )
- {
- // amerikanische Postadresse aufbauen
- aPLZEdit.Hide();
- aCityEdit.Hide();
- aCityLbl.SetText( SVX_RES( STR_US_STATE ) );
- }
- else if ( LANGUAGE_RUSSIAN == eLang )
- {
- aUsCityEdit.Hide();
- aUsStateEdit.Hide();
- aUsZipEdit.Hide();
- aNameLbl.Hide();
- aNameLblRuss.Show();
- aStreetLbl.Hide();
- aStreetLblRuss.Show();
- aFatherName.Show();
- aName.SetIndex( 0 );
- aName.SetLabel( &aNameLblRuss );
- aFirstName.SetIndex( 1 );
- aFirstName.SetLabel( &aNameLblRuss );
- aFatherName.SetIndex( 2 );
- aFatherName.SetLabel( &aNameLblRuss );
- aShortName.SetIndex( 3 );
- aShortName.SetLabel( &aNameLblRuss );
-
- Point aEditPoint = LogicToPixel( Point( MID, LINE(1) ), MAP_APPFONT );
- Point aRightPoint = LogicToPixel( Point( RIGHT, LINE(1) ), MAP_APPFONT );
- Size aEditSize = LogicToPixel( Size( 42, 12 ), MAP_APPFONT );
- Size a2Size = LogicToPixel( Size( 2, 2 ), MAP_APPFONT );
- long nDelta = aEditSize.Width() + a2Size.Width();
- aName.SetPosSizePixel( aEditPoint, aEditSize );
- aEditPoint.X() = aEditPoint.X() + nDelta;
- aFirstName.SetPosSizePixel( aEditPoint, aEditSize );
- aEditPoint.X() = aEditPoint.X() + nDelta;
- aFatherName.SetPosSizePixel( aEditPoint, aEditSize );
- aEditPoint.X() = aEditPoint.X() + nDelta;
- aEditSize.Width() = aRightPoint.X() - aEditPoint.X();
- aShortName.SetPosSizePixel( aEditPoint, aEditSize );
-
- Size aStreetSize = aStreetEdit.GetSizePixel();
- aStreetSize.Width() = aStreetSize.Width() - aEditSize.Width() - a2Size.Width();
- aStreetEdit.SetSizePixel( aStreetSize );
- aApartmentNrEdit.Show();
- Point aApartmentPoint = LogicToPixel( Point( MID, LINE(2) ), MAP_APPFONT );
- aApartmentPoint.X() = aEditPoint.X();
- aApartmentNrEdit.SetPosSizePixel( aApartmentPoint, aEditSize );
-
- aName.SetZOrder( &aNameLblRuss, WINDOW_ZORDER_BEHIND );
- aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND );
- aFatherName.SetZOrder( &aFirstName, WINDOW_ZORDER_BEHIND );
- }
- else if ( LANGUAGE_JAPANESE == eLang ||
- LANGUAGE_KOREAN == eLang ||
- LANGUAGE_CHINESE_TRADITIONAL == eLang ||
- LANGUAGE_CHINESE_SIMPLIFIED == eLang)
- {
- aUsCityEdit.Hide();
- aUsStateEdit.Hide();
- aUsZipEdit.Hide();
- aNameLbl.Hide();
- aNameLblEastern.Show();
-
- // swap "first name" field and "last name" field
- Point aPosTmp = aFirstName.GetPosPixel();
- aFirstName.SetPosPixel( aName.GetPosPixel() );
- aName.SetPosPixel( aPosTmp );
- aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND );
- }
- else
- {
- aUsCityEdit.Hide();
- aUsStateEdit.Hide();
- aUsZipEdit.Hide();
- }
-
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- Link aLink = LINK( this, SvxGeneralTabPage, ModifyHdl_Impl );
- aFirstName.SetModifyHdl( aLink );
- aName.SetModifyHdl( aLink );
-
- // because some labels have text for more than one edit field we have to split these texts
- // and set these texts as accessible name of the corresponding edit fields
- SvxUserEdit* pEdits[] =
- {
- &aCompanyEdit, &aFirstName, &aFatherName, &aName, &aShortName, &aStreetEdit,
- &aApartmentNrEdit, &aPLZEdit, &aCityEdit, &aUsCityEdit, &aUsStateEdit, &aUsZipEdit,
- &aCountryEdit, &aTitleEdit, &aPositionEdit, &aTelPrivEdit, &aTelCompanyEdit,
- &aFaxEdit, &aEmailEdit, NULL
- };
- SvxUserEdit** pCurrent = pEdits;
- while ( *pCurrent )
- {
- Window* pLabel = (*pCurrent)->GetLabel();
- if ( pLabel )
- {
- String sName, sText = pLabel->GetDisplayText();
- sal_Int16 nIndex = (*pCurrent)->GetIndex();
- if ( INDEX_NOTSET == nIndex )
- sName = sText;
- else
- sName = sText.GetToken( nIndex, '/' );
- sName.EraseAllChars( '(' );
- sName.EraseAllChars( ')' );
- if ( sName.Len() > 0 )
- (*pCurrent)->SetAccessibleName( sName );
- }
- pCurrent++;
- }
-}
-
-//------------------------------------------------------------------------
-
-SvxGeneralTabPage::~SvxGeneralTabPage()
-{
- delete pImpl;
-}
-
-//------------------------------------------------------------------------
-
-SfxTabPage* SvxGeneralTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return ( new SvxGeneralTabPage( pParent, rAttrSet ) );
-}
-
-//------------------------------------------------------------------------
-
-BOOL SvxGeneralTabPage::FillItemSet( SfxItemSet& )
-{
- // Eingaben trimmen (f"uhrende und nachfolgende Leerzeichen entfernen)
- aCompanyEdit.SetText( TRIM(aCompanyEdit.GetText()) );
- aFirstName.SetText( TRIM(aFirstName.GetText()) );
- aName.SetText( TRIM(aName.GetText()) );
- aShortName.SetText( TRIM(aShortName.GetText()) );
- aStreetEdit.SetText( TRIM(aStreetEdit.GetText()) );
- aCountryEdit.SetText( TRIM(aCountryEdit.GetText()) );
- aPLZEdit.SetText( TRIM(aPLZEdit.GetText()) );
- aCityEdit.SetText( TRIM(aCityEdit.GetText()) );
- aUsCityEdit.SetText( TRIM(aUsCityEdit.GetText()) );
- aUsStateEdit.SetText( TRIM(aUsStateEdit.GetText()) );
- aUsZipEdit.SetText( TRIM(aUsZipEdit.GetText()) );
- aTitleEdit.SetText( TRIM(aTitleEdit.GetText()) );
- aPositionEdit.SetText( TRIM(aPositionEdit.GetText()) );
- aTelPrivEdit.SetText( TRIM(aTelPrivEdit.GetText()) );
- aTelCompanyEdit.SetText( TRIM(aTelCompanyEdit.GetText()) );
- aFaxEdit.SetText( TRIM(aFaxEdit.GetText()) );
- aEmailEdit.SetText( TRIM(aEmailEdit.GetText()) );
-
- BOOL bModified = FALSE;
- bModified |= GetAddress_Impl();
- SvtSaveOptions aSaveOpt;
- if ( aUseDataCB.IsChecked() != aSaveOpt.IsUseUserData() )
- {
- aSaveOpt.SetUseUserData( aUseDataCB.IsChecked() );
- bModified |= TRUE;
- }
- return bModified;
-}
-
-//------------------------------------------------------------------------
-
-void SvxGeneralTabPage::Reset( const SfxItemSet& rSet )
-{
- SetAddress_Impl();
-
- USHORT nWhich = GetWhich( SID_FIELD_GRABFOCUS );
- if ( rSet.GetItemState( nWhich ) == SFX_ITEM_SET )
- {
- USHORT nField = ( (SfxUInt16Item&)rSet.Get( nWhich ) ).GetValue();
-
- switch ( nField )
- {
- case COMPANY_EDIT: aCompanyEdit.GrabFocus(); break;
- case FIRSTNAME_EDIT: aFirstName.GrabFocus(); break;
- case LASTNAME_EDIT: aName.GrabFocus(); break;
- case STREET_EDIT: aStreetEdit.GrabFocus(); break;
- case COUNTRY_EDIT: aCountryEdit.GrabFocus(); break;
- case PLZ_EDIT:
- if ( aPLZEdit.IsVisible() )
- aPLZEdit.GrabFocus();
- else
- aUsZipEdit.GrabFocus();
- break;
- case CITY_EDIT:
- if ( aCityEdit.IsVisible() )
- aCityEdit.GrabFocus();
- else
- aUsCityEdit.GrabFocus();
- break;
- case STATE_EDIT:
- if ( aUsStateEdit.IsVisible() )
- aUsStateEdit.GrabFocus();
- else
- aCityEdit.GrabFocus();
- break;
- case TITLE_EDIT: aTitleEdit.GrabFocus(); break;
- case POSITION_EDIT: aPositionEdit.GrabFocus(); break;
- case SHORTNAME_EDIT: aShortName.GrabFocus(); break;
- case TELPRIV_EDIT: aTelPrivEdit.GrabFocus(); break;
- case TELCOMPANY_EDIT: aTelCompanyEdit.GrabFocus(); break;
- case FAX_EDIT: aFaxEdit.GrabFocus(); break;
- case EMAIL_EDIT: aEmailEdit.GrabFocus(); break;
- default: aCompanyEdit.GrabFocus();
- }
- }
-
- aUseDataCB.Check( SvtSaveOptions().IsUseUserData() );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit )
-{
- if ( aShortName.IsEnabled() )
- {
- String aShortStr( aShortName.GetText() );
- switch ( aShortStr.Len() )
- {
- case 0:
- aShortStr = String( RTL_CONSTASCII_STRINGPARAM(" ") );
- break;
-
- case 1:
- aShortStr += ' ';
- break;
- }
-
- USHORT nPos = ( pEdit == &aFirstName ) ? 0 : 1;
- String aTxt = pEdit->GetText();
- sal_Unicode cChar = ( aTxt.Len() > 0 ) ? aTxt.GetChar(0) : ' ';
- aShortStr.SetChar( nPos, cChar );
- aShortStr.EraseTrailingChars();
- aShortName.SetText( aShortStr );
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool SvxGeneralTabPage::GetAddress_Impl()
-{
- BOOL bRet =
- ( aCompanyEdit.GetSavedValue() != aCompanyEdit.GetText() ||
- aFirstName.GetSavedValue() != aFirstName.GetText() ||
- aFatherName.GetSavedValue() != aFatherName.GetText() ||
- aName.GetSavedValue() != aName.GetText() ||
- aShortName.GetSavedValue() != aShortName.GetText() ||
- aStreetEdit.GetSavedValue() != aStreetEdit.GetText() ||
- aApartmentNrEdit.GetSavedValue() != aApartmentNrEdit.GetText() ||
- aPLZEdit.GetSavedValue() != aPLZEdit.GetText() ||
- aCityEdit.GetSavedValue() != aCityEdit.GetText() ||
- aUsCityEdit.GetSavedValue() != aUsCityEdit.GetText() ||
- aUsStateEdit.GetSavedValue() != aUsStateEdit.GetText() ||
- aUsZipEdit.GetSavedValue() != aUsZipEdit.GetText() ||
- aCountryEdit.GetSavedValue() != aCountryEdit.GetText() ||
- aTitleEdit.GetSavedValue() != aTitleEdit.GetText() ||
- aPositionEdit.GetSavedValue() != aPositionEdit.GetText() ||
- aTelPrivEdit.GetSavedValue() != aTelPrivEdit.GetText() ||
- aTelCompanyEdit.GetSavedValue() != aTelCompanyEdit.GetText() ||
- aFaxEdit.GetSavedValue() != aFaxEdit.GetText() ||
- aEmailEdit.GetSavedValue() != aEmailEdit.GetText() );
-
- LanguageType eLang = Application::GetSettings().GetUILanguage();
- BOOL bUS = ( LANGUAGE_ENGLISH_US == eLang );
-
- SvtUserOptions aUserOpt;
- aUserOpt.SetCompany(aCompanyEdit.GetText());
- aUserOpt.SetFirstName(aFirstName.GetText());
- aUserOpt.SetLastName(aName.GetText());
- aUserOpt.SetID( aShortName.GetText());
-
- aUserOpt.SetStreet(aStreetEdit.GetText() );
-
- aUserOpt.SetCountry(aCountryEdit.GetText() );
-
- aUserOpt.SetZip(bUS ? aUsZipEdit.GetText() : aPLZEdit.GetText() );
- aUserOpt.SetCity(bUS ? aUsCityEdit.GetText() : aCityEdit.GetText() );
-
- aUserOpt.SetTitle( aTitleEdit.GetText() );
- aUserOpt.SetPosition(aPositionEdit.GetText() );
- aUserOpt.SetTelephoneHome( aTelPrivEdit.GetText() );
- aUserOpt.SetTelephoneWork( aTelCompanyEdit.GetText() );
- aUserOpt.SetFax( aFaxEdit.GetText() );
- aUserOpt.SetEmail( aEmailEdit.GetText() );
- aUserOpt.SetState( bUS ? aUsStateEdit.GetText() : String() );
-
- if ( LANGUAGE_RUSSIAN == eLang )
- {
- aUserOpt.SetFathersName( aFatherName.GetText() );
- aUserOpt.SetApartment( aApartmentNrEdit.GetText() );
- }
- return bRet;
-}
-
-//------------------------------------------------------------------------
-
-void SvxGeneralTabPage::SetAddress_Impl()
-{
- LanguageType eLang = Application::GetSettings().GetUILanguage();
- BOOL bUS = ( LANGUAGE_ENGLISH_US == eLang );
- SvtUserOptions aUserOpt;
- aCompanyEdit.SetText( aUserOpt.GetCompany() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_COMPANY ) )
- {
- aCompanyLbl.Disable();
- aCompanyEdit.Disable();
- }
- sal_Int16 nEditCount = 0;
- aFirstName.SetText( aUserOpt.GetFirstName() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_FIRSTNAME ) )
- {
- aFirstName.Disable();
- nEditCount++;
- }
- aName.SetText( aUserOpt.GetLastName() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_LASTNAME ) )
- {
- aName.Disable();
- nEditCount++;
- }
- aShortName.SetText( aUserOpt.GetID() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_ID ) )
- {
- aShortName.Disable();
- nEditCount++;
- }
- aNameLbl.Enable( ( nEditCount != 3 ) );
- aStreetEdit.SetText( aUserOpt.GetStreet() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_STREET ) )
- {
- aStreetLbl.Disable();
- aStreetEdit.Disable();
- }
- Edit* pPLZEdit = bUS ? &aUsZipEdit : &aPLZEdit;
- Edit* pCityEdit = bUS ? &aUsCityEdit : &aCityEdit;
- pPLZEdit->SetText( aUserOpt.GetZip() );
- pCityEdit->SetText( aUserOpt.GetCity() );
- nEditCount = 0;
- if ( aUserOpt.IsTokenReadonly( USER_OPT_ZIP ) )
- {
- pPLZEdit->Disable();
- nEditCount++;
- }
- if ( aUserOpt.IsTokenReadonly( USER_OPT_CITY ) )
- {
- pCityEdit->Disable();
- nEditCount++;
- }
- if ( bUS )
- {
- aUsStateEdit.SetText( aUserOpt.GetState() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_STATE ) )
- {
- aUsStateEdit.Disable();
- nEditCount++;
- }
- }
- aCityLbl.Enable( ( nEditCount != ( bUS ? 3 : 2 ) ) );
- aCountryEdit.SetText( aUserOpt.GetCountry() );
- if ( aUserOpt.IsTokenReadonly( USER_OPT_COUNTRY ) )
- {
- aCountryLbl.Disable();
- aCountryEdit.Disable();
- }
- aTitleEdit.SetText( aUserOpt.GetTitle() );
- aPositionEdit.SetText( aUserOpt.GetPosition() );
- nEditCount = 0;
- if ( aUserOpt.IsTokenReadonly( USER_OPT_TITLE ) )
- {
- aTitleEdit.Disable();
- nEditCount++;
- }
- if ( aUserOpt.IsTokenReadonly( USER_OPT_POSITION ) )
- {
- aPositionEdit.Disable();
- nEditCount++;
- }
- aTitlePosLbl.Enable( ( nEditCount != 2 ) );
- aTelPrivEdit.SetText( aUserOpt.GetTelephoneHome() );
- aTelCompanyEdit.SetText( aUserOpt.GetTelephoneWork() );
- nEditCount = 0;
- if ( aUserOpt.IsTokenReadonly( USER_OPT_TELEPHONEHOME ) )
- {
- aTelPrivEdit.Disable();
- nEditCount++;
- }
- if ( aUserOpt.IsTokenReadonly( USER_OPT_TELEPHONEWORK ) )
- {
- aTelCompanyEdit.Disable();
- nEditCount++;
- }
- aPhoneLbl.Enable( ( nEditCount != 2 ) );
- aFaxEdit.SetText( aUserOpt.GetFax() );
- aEmailEdit.SetText( aUserOpt.GetEmail() );
- nEditCount = 0;
- if ( aUserOpt.IsTokenReadonly( USER_OPT_FAX ) )
- {
- aFaxEdit.Disable();
- nEditCount++;
- }
- if ( aUserOpt.IsTokenReadonly( USER_OPT_EMAIL ) )
- {
- aEmailEdit.Disable();
- nEditCount++;
- }
- aFaxMailLbl.Enable( ( nEditCount != 2 ) );
-
- if ( LANGUAGE_RUSSIAN == eLang )
- {
- aFatherName.SetText( aUserOpt.GetFathersName() );
- aApartmentNrEdit.SetText( aUserOpt.GetApartment() );
- }
-
- aCompanyEdit.SaveValue();
- aFirstName.SaveValue();
- aFatherName.SaveValue();
- aName.SaveValue();
- aShortName.SaveValue();
- aStreetEdit.SaveValue();
- aApartmentNrEdit.SaveValue();
- aPLZEdit.SaveValue();
- aCityEdit.SaveValue();
- aUsCityEdit.SaveValue();
- aUsStateEdit.SaveValue();
- aUsZipEdit.SaveValue();
- aCountryEdit.SaveValue();
- aTitleEdit.SaveValue();
- aPositionEdit.SaveValue();
- aTelPrivEdit.SaveValue();
- aTelCompanyEdit.SaveValue();
- aFaxEdit.SaveValue();
- aEmailEdit.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-int SvxGeneralTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
diff --git a/svx/source/cui/opthtml.cxx b/svx/source/cui/opthtml.cxx
deleted file mode 100644
index b7ba5a3f3c..0000000000
--- a/svx/source/cui/opthtml.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: opthtml.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <svtools/langtab.hxx>
-
-#include "htmlcfg.hxx"
-#include "opthtml.hxx"
-#include "opthtml.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <svx/dialmgr.hxx>
-
-// Umwandlung der Modi zu den Positionen in der Listbox
-const USHORT aPosToExportArr[] =
-{
- HTML_CFG_HTML32,
- HTML_CFG_MSIE_40,
- HTML_CFG_NS40,
- HTML_CFG_WRITER
-};
-
-//#define DEPRECATED_ENTRY 0xFFFF
-
-const USHORT aExportToPosArr[] =
-{
- 0, //HTML 3.2
- 1, //MS Internet Explorer 4.0
- 3, //StarWriter
- 2 //Netscape Navigator 4.0
-};
-// -----------------------------------------------------------------------
-
-OfaHtmlTabPage::OfaHtmlTabPage(Window* pParent, const SfxItemSet& rSet) :
- SfxTabPage( pParent, SVX_RES( RID_OFAPAGE_HTMLOPT ), rSet ),
- aFontSizeGB ( this, SVX_RES( GB_FONTSIZE ) ),
- aSize1FT ( this, SVX_RES( FT_SIZE1 ) ),
- aSize1NF ( this, SVX_RES( NF_SIZE1 ) ),
- aSize2FT ( this, SVX_RES( FT_SIZE2 ) ),
- aSize2NF ( this, SVX_RES( NF_SIZE2 ) ),
- aSize3FT ( this, SVX_RES( FT_SIZE3 ) ),
- aSize3NF ( this, SVX_RES( NF_SIZE3 ) ),
- aSize4FT ( this, SVX_RES( FT_SIZE4 ) ),
- aSize4NF ( this, SVX_RES( NF_SIZE4 ) ),
- aSize5FT ( this, SVX_RES( FT_SIZE5 ) ),
- aSize5NF ( this, SVX_RES( NF_SIZE5 ) ),
- aSize6FT ( this, SVX_RES( FT_SIZE6 ) ),
- aSize6NF ( this, SVX_RES( NF_SIZE6 ) ),
- aSize7FT ( this, SVX_RES( FT_SIZE7 ) ),
- aSize7NF ( this, SVX_RES( NF_SIZE7 ) ),
- aImportGB ( this, SVX_RES( GB_IMPORT ) ),
- aNumbersEnglishUSCB ( this, SVX_RES( CB_NUMBERS_ENGLISH_US ) ),
- aUnknownTagCB ( this, SVX_RES( CB_UNKNOWN_TAGS ) ),
- aIgnoreFontNamesCB( this, SVX_RES( CB_IGNORE_FONTNAMES ) ),
- aExportGB ( this, SVX_RES( GB_EXPORT ) ),
- aExportLB ( this, SVX_RES( LB_EXPORT ) ),
- aStarBasicCB ( this, SVX_RES( CB_STARBASIC ) ),
- aStarBasicWarningCB(this, SVX_RES( CB_STARBASIC_WARNING ) ),
- aPrintExtensionCB( this,SVX_RES(CB_PRINT_EXTENSION )),
- aSaveGrfLocalCB ( this, SVX_RES( CB_LOCAL_GRF ) ),
- aCharSetFT ( this, SVX_RES( FT_CHARSET ) ),
- aCharSetLB ( this, SVX_RES( LB_CHARSET ) )
-
-{
- FreeResource();
-
- // replace placeholder with UI string from language list
- String aText( aNumbersEnglishUSCB.GetText());
- String aPlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%ENGLISHUSLOCALE"));
- xub_StrLen nPos;
- if ((nPos = aText.Search( aPlaceholder)) != STRING_NOTFOUND)
- {
- SvtLanguageTable aLangTab;
- const String& rStr = aLangTab.GetString( LANGUAGE_ENGLISH_US);
- if (rStr.Len())
- {
- aText.Replace( nPos, aPlaceholder.Len(), rStr);
- aNumbersEnglishUSCB.SetText( aText);
- }
- }
-
- aExportLB.SetSelectHdl(LINK(this, OfaHtmlTabPage, ExportHdl_Impl));
- aStarBasicCB.SetClickHdl(LINK(this, OfaHtmlTabPage, CheckBoxHdl_Impl));
-
- // initialize the characterset listbox
- aCharSetLB.FillWithMimeAndSelectBest();
-}
-
-/*-----------------02.09.96 13.47-------------------
-
---------------------------------------------------*/
-
-OfaHtmlTabPage::~OfaHtmlTabPage()
-{
-}
-
-/*-----------------02.09.96 13.47-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* OfaHtmlTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return new OfaHtmlTabPage(pParent, rAttrSet);
-}
-
-/*-----------------02.09.96 13.47-------------------
-
---------------------------------------------------*/
-
-BOOL OfaHtmlTabPage::FillItemSet( SfxItemSet& )
-{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if(aSize1NF.GetSavedValue() != aSize1NF.GetText())
- pHtmlOpt->SetFontSize(0, (USHORT)aSize1NF.GetValue());
- if(aSize2NF.GetSavedValue() != aSize2NF.GetText())
- pHtmlOpt->SetFontSize(1, (USHORT)aSize2NF.GetValue());
- if(aSize3NF.GetSavedValue() != aSize3NF.GetText())
- pHtmlOpt->SetFontSize(2, (USHORT)aSize3NF.GetValue());
- if(aSize4NF.GetSavedValue() != aSize4NF.GetText())
- pHtmlOpt->SetFontSize(3, (USHORT)aSize4NF.GetValue());
- if(aSize5NF.GetSavedValue() != aSize5NF.GetText())
- pHtmlOpt->SetFontSize(4, (USHORT)aSize5NF.GetValue());
- if(aSize6NF.GetSavedValue() != aSize6NF.GetText())
- pHtmlOpt->SetFontSize(5, (USHORT)aSize6NF.GetValue());
- if(aSize7NF.GetSavedValue() != aSize7NF.GetText())
- pHtmlOpt->SetFontSize(6, (USHORT)aSize7NF.GetValue());
-
- if(aNumbersEnglishUSCB.IsChecked() != aNumbersEnglishUSCB.GetSavedValue())
- pHtmlOpt->SetNumbersEnglishUS(aNumbersEnglishUSCB.IsChecked());
-
- if(aUnknownTagCB.IsChecked() != aUnknownTagCB.GetSavedValue())
- pHtmlOpt->SetImportUnknown(aUnknownTagCB.IsChecked());
-
- if(aIgnoreFontNamesCB.IsChecked() != aIgnoreFontNamesCB.GetSavedValue())
- pHtmlOpt->SetIgnoreFontFamily(aIgnoreFontNamesCB.IsChecked());
-
- if(aExportLB.GetSelectEntryPos() != aExportLB.GetSavedValue())
- pHtmlOpt->SetExportMode(aPosToExportArr[aExportLB.GetSelectEntryPos()]);
-
- if(aStarBasicCB.IsChecked() != aStarBasicCB.GetSavedValue())
- pHtmlOpt->SetStarBasic(aStarBasicCB.IsChecked());
-
- if(aStarBasicWarningCB.IsChecked() != aStarBasicWarningCB.GetSavedValue())
- pHtmlOpt->SetStarBasicWarning(aStarBasicWarningCB.IsChecked());
-
- if(aSaveGrfLocalCB.IsChecked() != aSaveGrfLocalCB.GetSavedValue())
- pHtmlOpt->SetSaveGraphicsLocal(aSaveGrfLocalCB.IsChecked());
-
- if(aPrintExtensionCB.IsChecked() != aPrintExtensionCB.GetSavedValue())
- pHtmlOpt->SetPrintLayoutExtension(aPrintExtensionCB.IsChecked());
-
- if( aCharSetLB.GetSelectTextEncoding() != pHtmlOpt->GetTextEncoding() )
- pHtmlOpt->SetTextEncoding( aCharSetLB.GetSelectTextEncoding() );
-
- return FALSE;
-}
-
-/*-----------------02.09.96 13.47-------------------
-
---------------------------------------------------*/
-
-void OfaHtmlTabPage::Reset( const SfxItemSet& )
-{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- aSize1NF.SetValue(pHtmlOpt->GetFontSize(0));
- aSize2NF.SetValue(pHtmlOpt->GetFontSize(1));
- aSize3NF.SetValue(pHtmlOpt->GetFontSize(2));
- aSize4NF.SetValue(pHtmlOpt->GetFontSize(3));
- aSize5NF.SetValue(pHtmlOpt->GetFontSize(4));
- aSize6NF.SetValue(pHtmlOpt->GetFontSize(5));
- aSize7NF.SetValue(pHtmlOpt->GetFontSize(6));
- aNumbersEnglishUSCB.Check(pHtmlOpt->IsNumbersEnglishUS());
- aUnknownTagCB.Check(pHtmlOpt->IsImportUnknown());
- aIgnoreFontNamesCB.Check(pHtmlOpt->IsIgnoreFontFamily());
- USHORT nExport = pHtmlOpt->GetExportMode();
- if( nExport >= ( sizeof( aExportToPosArr ) / sizeof( USHORT ) ) )
- nExport = 4; // default for bad config entry is NS 4.0
- USHORT nPosArr = aExportToPosArr[ nExport ];
-// if( nPosArr == DEPRECATED_ENTRY )
-// nPosArr = aExportToPosArr[ 4 ]; // again: NS 4.0 is default
- aExportLB.SelectEntryPos( nPosArr );
- aExportLB.SaveValue();
-
- ExportHdl_Impl(&aExportLB);
-
- aStarBasicCB .Check(pHtmlOpt->IsStarBasic());
- aStarBasicWarningCB .Check(pHtmlOpt->IsStarBasicWarning());
- aStarBasicWarningCB.Enable(!aStarBasicCB.IsChecked());
- aSaveGrfLocalCB.Check(pHtmlOpt->IsSaveGraphicsLocal());
- aPrintExtensionCB.Check(pHtmlOpt->IsPrintLayoutExtension());
-
- aPrintExtensionCB.SaveValue();
- aStarBasicCB .SaveValue();
- aStarBasicWarningCB .SaveValue();
- aSaveGrfLocalCB.SaveValue();
- aSize1NF.SaveValue();
- aSize2NF.SaveValue();
- aSize3NF.SaveValue();
- aSize4NF.SaveValue();
- aSize5NF.SaveValue();
- aSize6NF.SaveValue();
- aSize7NF.SaveValue();
- aNumbersEnglishUSCB.SaveValue();
- aUnknownTagCB.SaveValue();
- aIgnoreFontNamesCB.SaveValue();
-
- if( !pHtmlOpt->IsDefaultTextEncoding() &&
- aCharSetLB.GetSelectTextEncoding() != pHtmlOpt->GetTextEncoding() )
- aCharSetLB.SelectTextEncoding( pHtmlOpt->GetTextEncoding() );
-}
-
-/*-----------------16.04.98 16:03-------------------
-
---------------------------------------------------*/
-IMPL_LINK(OfaHtmlTabPage, ExportHdl_Impl, ListBox*, pBox)
-{
- USHORT nExport = aPosToExportArr[ pBox->GetSelectEntryPos() ];
- switch( nExport )
- {
- case HTML_CFG_MSIE_40:
- case HTML_CFG_NS40 :
- case HTML_CFG_WRITER :
- aPrintExtensionCB.Enable(TRUE);
- break;
- default: aPrintExtensionCB.Enable(FALSE);
- }
-
- return 0;
-}
-/* -----------------05.02.99 09:17-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK(OfaHtmlTabPage, CheckBoxHdl_Impl, CheckBox*, pBox)
-{
- aStarBasicWarningCB.Enable(!pBox->IsChecked());
- return 0;
-}
-
-
diff --git a/svx/source/cui/opthtml.hrc b/svx/source/cui/opthtml.hrc
deleted file mode 100644
index d017a099fa..0000000000
--- a/svx/source/cui/opthtml.hrc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: opthtml.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTHTML_HRC
-#define _SVX_OPTHTML_HRC
-
-// defines ------------------------------------------------------------------
-
-#define GB_FONTSIZE 1
-#define FT_SIZE1 2
-#define NF_SIZE1 3
-#define FT_SIZE2 4
-#define NF_SIZE2 5
-#define FT_SIZE3 6
-#define NF_SIZE3 7
-#define FT_SIZE4 8
-#define NF_SIZE4 9
-#define FT_SIZE5 10
-#define NF_SIZE5 11
-#define FT_SIZE6 12
-#define NF_SIZE6 13
-#define FT_SIZE7 14
-#define NF_SIZE7 15
-#define GB_IMPORT 20
-#define CB_UNKNOWN_TAGS 21
-#define CB_IGNORE_FONTNAMES 22
-#define CB_NUMBERS_ENGLISH_US 23
-
-#define GB_EXPORT 30
-#define CB_STARBASIC 31
-#define CB_STARBASIC_WARNING 32
-
-#define CB_LOCAL_GRF 37
-#define CB_PRINT_EXTENSION 38
-#define LB_EXPORT 39
-#define FT_CHARSET 40
-#define LB_CHARSET 41
-
-#endif
-
diff --git a/svx/source/cui/opthtml.hxx b/svx/source/cui/opthtml.hxx
deleted file mode 100644
index a6e131cef8..0000000000
--- a/svx/source/cui/opthtml.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: opthtml.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _OFA_OPTHTML_HXX
-#define _OFA_OPTHTML_HXX
-
-
-#ifndef _BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#ifndef _FIELD_HXX
-#include <vcl/field.hxx>
-#endif
-#ifndef _FIXED_HXX
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _VCL_LSTBOX_HXX
-#include <vcl/lstbox.hxx>
-#endif
-#ifndef _GROUP_HXX
-#include <vcl/group.hxx>
-#endif
-#include <sfx2/tabdlg.hxx>
-#include "txencbox.hxx"
-
-
-class OfaHtmlTabPage : public SfxTabPage
-{
- FixedLine aFontSizeGB;
- FixedText aSize1FT;
- NumericField aSize1NF;
- FixedText aSize2FT;
- NumericField aSize2NF;
- FixedText aSize3FT;
- NumericField aSize3NF;
- FixedText aSize4FT;
- NumericField aSize4NF;
- FixedText aSize5FT;
- NumericField aSize5NF;
- FixedText aSize6FT;
- NumericField aSize6NF;
- FixedText aSize7FT;
- NumericField aSize7NF;
-
- FixedLine aImportGB;
- CheckBox aNumbersEnglishUSCB;
- CheckBox aUnknownTagCB;
- CheckBox aIgnoreFontNamesCB;
-
- FixedLine aExportGB;
- ListBox aExportLB;
- CheckBox aStarBasicCB;
- CheckBox aStarBasicWarningCB;
- CheckBox aPrintExtensionCB;
- CheckBox aSaveGrfLocalCB;
- FixedText aCharSetFT;
- SvxTextEncodingBox aCharSetLB;
-
- DECL_LINK(ExportHdl_Impl, ListBox*);
- DECL_LINK(CheckBoxHdl_Impl, CheckBox*);
-
- OfaHtmlTabPage(Window* pParent, const SfxItemSet& rSet);
- virtual ~OfaHtmlTabPage();
-public:
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
-};
-
-
-#endif //
-
-
-
diff --git a/svx/source/cui/opthtml.src b/svx/source/cui/opthtml.src
deleted file mode 100644
index f5b872fd51..0000000000
--- a/svx/source/cui/opthtml.src
+++ /dev/null
@@ -1,290 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: opthtml.src,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include -----------------------------------------------------------------
-#include "opthtml.hrc"
-#include <svx/dialogs.hrc>
-
- // RID_OFAPAGE_HTMLOPT -----------------------------------------------------
-TabPage RID_OFAPAGE_HTMLOPT
-{
- // HelpId = ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- FixedText FT_SIZE1
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~1" ;
- };
- NumericField NF_SIZE1
- {
- Pos = MAP_APPFONT ( 45 , 14 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedText FT_SIZE2
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~2" ;
- };
- NumericField NF_SIZE2
- {
- Pos = MAP_APPFONT ( 45 , 30 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedText FT_SIZE3
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~3" ;
- };
- NumericField NF_SIZE3
- {
- Pos = MAP_APPFONT ( 45 , 46 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedText FT_SIZE4
- {
- Pos = MAP_APPFONT ( 12 , 64 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~4" ;
- };
- NumericField NF_SIZE4
- {
- Pos = MAP_APPFONT ( 45 , 62 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedText FT_SIZE5
- {
- Pos = MAP_APPFONT ( 12 , 80 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~5" ;
- };
- NumericField NF_SIZE5
- {
- Pos = MAP_APPFONT ( 45 , 78 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedText FT_SIZE6
- {
- Pos = MAP_APPFONT ( 12 , 96 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~6" ;
- };
- NumericField NF_SIZE6
- {
- Pos = MAP_APPFONT ( 45 , 94 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedText FT_SIZE7
- {
- Pos = MAP_APPFONT ( 12 , 112 ) ;
- Size = MAP_APPFONT ( 30 , 8 ) ;
- Text [ en-US ] = "Size ~7" ;
- };
- NumericField NF_SIZE7
- {
- Pos = MAP_APPFONT ( 45 , 110 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 50 ;
- Value = 1 ;
- First = 1 ;
- Last = 50 ;
- SpinSize = 1 ;
- };
- FixedLine GB_FONTSIZE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 75 , 8 ) ;
- Text [ en-US ] = "Font sizes" ;
- };
- FixedLine GB_IMPORT
- {
- Pos = MAP_APPFONT ( 87 , 3 ) ;
- Size = MAP_APPFONT ( 167 , 8 ) ;
- Text [ en-US ] = "Import" ;
- };
- CheckBox CB_NUMBERS_ENGLISH_US
- {
- Pos = MAP_APPFONT ( 93 , 14 ) ;
- Size = MAP_APPFONT ( 161 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Use '%ENGLISHUSLOCALE' locale for numbers" ;
- };
- CheckBox CB_UNKNOWN_TAGS
- {
- Pos = MAP_APPFONT ( 93 , 28 ) ;
- Size = MAP_APPFONT ( 155 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Import unknown HTML tags as fields" ;
- };
- CheckBox CB_IGNORE_FONTNAMES
- {
- Pos = MAP_APPFONT ( 93 , 42 ) ;
- Size = MAP_APPFONT ( 155 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Ignore ~font settings" ;
- };
- FixedLine GB_EXPORT
- {
- Pos = MAP_APPFONT ( 87 , 58 ) ;
- Size = MAP_APPFONT ( 167 , 8 ) ;
- Text [ en-US ] = "Export" ;
- };
- ListBox LB_EXPORT
- {
- Pos = MAP_APPFONT ( 93 , 69 ) ;
- Size = MAP_APPFONT ( 155 , 50 ) ;
- Border = TRUE ;
- DropDown = TRUE ;
- StringList =
- {
- < "HTML 3.2" ; > ;
- < "Microsoft Internet Explorer" ; > ;
- < "Netscape Navigator"; > ;
- < "%PRODUCTNAME Writer" ; > ;
- };
- };
- CheckBox CB_STARBASIC
- {
- Pos = MAP_APPFONT ( 93 , 88 ) ;
- Size = MAP_APPFONT ( 155 , 10 ) ;
- Text = "%PRODUCTNAME ~Basic" ;
- };
- CheckBox CB_STARBASIC_WARNING
- {
- Pos = MAP_APPFONT ( 99 , 102 ) ;
- Size = MAP_APPFONT ( 149 , 10 ) ;
- Text [ en-US ] = "Display ~warning";
- };
- CheckBox CB_PRINT_EXTENSION
- {
- Pos = MAP_APPFONT ( 93 , 116 ) ;
- Size = MAP_APPFONT ( 155 , 10 ) ;
- Text [ en-US ] = "~Print layout" ;
- };
- CheckBox CB_LOCAL_GRF
- {
- Pos = MAP_APPFONT ( 93 , 130 ) ;
- Size = MAP_APPFONT ( 155 , 10 ) ;
- Text [ en-US ] = "~Copy local graphics to Internet" ;
- };
-
- FixedText FT_CHARSET
- {
- Pos = MAP_APPFONT ( 93 , 144 ) ;
- Size = MAP_APPFONT ( 65 , 8 ) ;
- Text [ en-US ] = "Character set";
- };
- ListBox LB_CHARSET
- {
- Pos = MAP_APPFONT ( 162 , 143 ) ;
- Size = MAP_APPFONT ( 86 , 61 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
-};
- // ******************************************************************* EOF
diff --git a/svx/source/cui/optimprove.cxx b/svx/source/cui/optimprove.cxx
deleted file mode 100644
index e644cc58d7..0000000000
--- a/svx/source/cui/optimprove.cxx
+++ /dev/null
@@ -1,233 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optimprove.cxx,v $
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-// include ---------------------------------------------------------------
-
-#define _SVX_OPTIMPROVE_CXX
-
-#include <svx/optimprove.hxx>
-#include <svx/dialmgr.hxx>
-#include <vcl/msgbox.hxx>
-
-#include "optimprove.hrc"
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <com/sun/star/oooimprovement/XCoreController.hpp>
-#include <comphelper/configurationhelper.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/uieventslogger.hxx>
-#include <tools/testtoolloader.hxx>
-
-namespace lang = ::com::sun::star::lang;
-namespace uno = ::com::sun::star::uno;
-using namespace com::sun::star::system;
-
-// class SvxImprovementPage ----------------------------------------------
-
-SvxImprovementPage::SvxImprovementPage( Window* pParent ) :
-
- TabPage( pParent, SVX_RES( RID_SVXPAGE_IMPROVEMENT ) ),
-
- m_aImproveFL ( this, SVX_RES( FL_IMPROVE ) ),
- m_aInvitationFT ( this, SVX_RES( FT_INVITATION ) ),
- m_aYesRB ( this, SVX_RES( RB_YES ) ),
- m_aNoRB ( this, SVX_RES( RB_NO ) ),
- m_aDataFL ( this, SVX_RES( FL_DATA ) ),
- m_aNumberOfReportsFT ( this, SVX_RES( FT_NR_REPORTS ) ),
- m_aNumberOfReportsValueFT ( this, SVX_RES( FT_NR_REPORTS_VALUE ) ),
- m_aNumberOfActionsFT ( this, SVX_RES( FT_NR_ACTIONS ) ),
- m_aNumberOfActionsValueFT ( this, SVX_RES( FT_NR_ACTIONS_VALUE ) ),
- m_aShowDataPB ( this, SVX_RES( PB_SHOWDATA ) ),
-
- m_sInfo ( SVX_RES( STR_INFO ) ),
- m_sMoreInfo ( SVX_RES( STR_MOREINFO ) )
-
-{
- FreeResource();
-
- m_aInvitationFT.Show();
- m_aDataFL.Hide();
- m_aNumberOfReportsFT.Hide();
- m_aNumberOfReportsValueFT.Hide();
- m_aNumberOfActionsFT.Hide();
- m_aNumberOfActionsValueFT.Hide();
- m_aShowDataPB.Hide();
-
- Size aNewSize = m_aInvitationFT.GetSizePixel();
- const long nMinWidth = m_aYesRB.CalcMinimumSize().Width();
- const long nNewWidth = std::max( aNewSize.Width() * 4 / 5, nMinWidth );
- const long nWDelta = aNewSize.Width() - nNewWidth;
- aNewSize.Width() = nNewWidth;
- const Size aCalcSize = m_aInvitationFT.CalcMinimumSize( nNewWidth );
- const long nHDelta = aCalcSize.Height() - aNewSize.Height();
- aNewSize.Height() = aCalcSize.Height();
- m_aInvitationFT.SetSizePixel( aNewSize );
-
- aNewSize = m_aYesRB.GetSizePixel();
- aNewSize.Width() = nNewWidth;
- Point aNewPos = m_aYesRB.GetPosPixel();
- aNewPos.Y() += nHDelta;
- m_aYesRB.SetPosSizePixel( aNewPos, aNewSize );
- aNewSize = m_aNoRB.GetSizePixel();
- aNewSize.Width() = nNewWidth;
- aNewPos = m_aNoRB.GetPosPixel();
- aNewPos.Y() += nHDelta;
- m_aNoRB.SetPosSizePixel( aNewPos, aNewSize );
- aNewSize = m_aImproveFL.GetSizePixel();
- aNewSize.Width() -= nWDelta;
- m_aImproveFL.SetSizePixel( aNewSize );
-
- Size aSize = GetOutputSizePixel();
- aSize.Width() -= nWDelta;
- aSize.Height() = m_aDataFL.GetPosPixel().Y();
- aSize.Height() += nHDelta;
- SetSizePixel( aSize );
-}
-
-// -----------------------------------------------------------------------
-
-SvxImprovementPage::~SvxImprovementPage()
-{
-}
-
-// class SvxImprovementDialog --------------------------------------------
-
-SvxImprovementDialog::SvxImprovementDialog( Window* pParent, const String& rInfoURL ) :
-
- SfxSingleTabDialog( pParent, RID_SVXPAGE_IMPROVEMENT, rInfoURL ),
-
- m_pPage( NULL )
-
-{
- m_pPage = new SvxImprovementPage( this );
- SetInfoLink( LINK( this, SvxImprovementDialog, HandleHyperlink ) );
- SetPage( m_pPage );
- if ( GetOKButton() )
- GetOKButton()->SetClickHdl( LINK( this, SvxImprovementDialog, HandleOK ) );
-}
-
-IMPL_LINK( SvxImprovementDialog, HandleHyperlink, svt::FixedHyperlinkImage*, pHyperlinkImage )
-{
- ::rtl::OUString sURL( pHyperlinkImage->GetURL() );
-
- if ( sURL.getLength() > 0 )
- {
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xSMGR =
- ::comphelper::getProcessServiceFactory();
- uno::Reference< XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- {
- xSystemShell->execute(
- sURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
- }
- catch( const uno::Exception& e )
- {
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxImprovementDialog, HandleOK, OKButton*, EMPTYARG )
-{
- uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- uno::Reference< com::sun::star::oooimprovement::XCoreController > core_c(
- xSMGR->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.oooimprovement.CoreController")),
- uno::UNO_QUERY);
- if(core_c.is())
- {
- ::comphelper::ConfigurationHelper::writeDirectKey(
- xSMGR,
- ::rtl::OUString::createFromAscii("/org.openoffice.Office.OOoImprovement.Settings"),
- ::rtl::OUString::createFromAscii("Participation"),
- ::rtl::OUString::createFromAscii("ShowedInvitation"),
- uno::makeAny( true ),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- ::comphelper::ConfigurationHelper::writeDirectKey(
- xSMGR,
- ::rtl::OUString::createFromAscii("/org.openoffice.Office.OOoImprovement.Settings"),
- ::rtl::OUString::createFromAscii("Participation"),
- ::rtl::OUString::createFromAscii("InvitationAccepted"),
- uno::makeAny( m_pPage->IsYesChecked() ),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- // TODO: refactor
- ::comphelper::UiEventsLogger::reinit();
- ::tools::InitTestToolLib();
- }
- EndDialog( RET_OK );
- return 0;
-}
-
-// class SvxInfoWindow ---------------------------------------------------
-
-SvxInfoWindow::SvxInfoWindow( Window* pParent, const ResId& rResId ) :
- Window( pParent, rResId ),
- m_aInfoText( this )
-{
- m_aInfoText.SetPosSizePixel( Point( 10, 10 ), Size( 150, 10 ) );
-
- const StyleSettings& rSettings = GetSettings().GetStyleSettings();
- Wallpaper aWall( rSettings.GetWindowColor() );
- SetBackground( aWall );
- Font aNewFont( m_aInfoText.GetFont() );
- aNewFont.SetTransparent( TRUE );
- m_aInfoText.SetFont( aNewFont );
- m_aInfoText.SetBackground( aWall );
- m_aInfoText.SetControlForeground( rSettings.GetWindowTextColor() );
-}
-
-void SvxInfoWindow::SetInfoText( const String& rText )
-{
- m_aInfoText.SetText( rText );
- Size aSize = m_aInfoText.CalcMinimumSize();
- Size aWinSize = GetSizePixel();
- Point aPos( ( aWinSize.Width() - aSize.Width() ) / 2, ( aWinSize.Height() - aSize.Height() ) / 2 );
- m_aInfoText.SetPosSizePixel( aPos, aSize );
-}
-
diff --git a/svx/source/cui/optimprove2.cxx b/svx/source/cui/optimprove2.cxx
deleted file mode 100644
index b988c7b75b..0000000000
--- a/svx/source/cui/optimprove2.cxx
+++ /dev/null
@@ -1,276 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optimprove2.cxx,v $
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#define _SVX_OPTIMPROVE_CXX
-
-#include <svx/optimprove.hxx>
-#include <svx/dialmgr.hxx>
-#include <vcl/msgbox.hxx>
-
-#include "optimprove.hrc"
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/oooimprovement/XCore.hpp>
-#include <com/sun/star/oooimprovement/XCoreController.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <com/sun/star/util/XStringSubstitution.hpp>
-#include <comphelper/configurationhelper.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/synchronousdispatch.hxx>
-#include <comphelper/uieventslogger.hxx>
-#include <tools/testtoolloader.hxx>
-
-#define C2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
-namespace beans = ::com::sun::star::beans;
-namespace lang = ::com::sun::star::lang;
-namespace uno = ::com::sun::star::uno;
-namespace util = ::com::sun::star::util;
-using namespace com::sun::star::system;
-
-// class SvxEmptyPage ----------------------------------------------------
-
-SvxEmptyPage::SvxEmptyPage( Window* pParent ) :
-
- TabPage( pParent, SVX_RES( RID_SVXPAGE_IMPROVEMENT ) )
-
-{
- FreeResource();
-}
-
-// class SvxImprovementOptionsPage ---------------------------------------
-
-SvxImprovementOptionsPage::SvxImprovementOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_IMPROVEMENT ), rSet ),
-
- m_aImproveFL ( this, SVX_RES( FL_IMPROVE ) ),
- m_aInvitationFT ( this, SVX_RES( FT_INVITATION ) ),
- m_aYesRB ( this, SVX_RES( RB_YES ) ),
- m_aNoRB ( this, SVX_RES( RB_NO ) ),
- m_aInfoFI ( this, SVX_RES( FI_INFO ) ),
- m_aDataFL ( this, SVX_RES( FL_DATA ) ),
- m_aNumberOfReportsFT ( this, SVX_RES( FT_NR_REPORTS ) ),
- m_aNumberOfReportsValueFT ( this, SVX_RES( FT_NR_REPORTS_VALUE ) ),
- m_aNumberOfActionsFT ( this, SVX_RES( FT_NR_ACTIONS ) ),
- m_aNumberOfActionsValueFT ( this, SVX_RES( FT_NR_ACTIONS_VALUE ) ),
- m_aShowDataPB ( this, SVX_RES( PB_SHOWDATA ) ),
-
- m_sInfo ( SVX_RES( STR_INFO ) ),
- m_sMoreInfo ( SVX_RES( STR_MOREINFO ) )
-
-{
- FreeResource();
-
- m_aInfoFI.SetURL( C2S( "www.sun.com/privacy/" ) );
- m_aInfoFI.SetClickHdl( LINK( this, SvxImprovementOptionsPage, HandleHyperlink ) );
- m_aShowDataPB.SetClickHdl( LINK( this, SvxImprovementOptionsPage, HandleShowData ) );
-}
-
-SvxImprovementOptionsPage::~SvxImprovementOptionsPage()
-{
-}
-
-IMPL_LINK( SvxImprovementOptionsPage, HandleHyperlink, svt::FixedHyperlinkImage*, EMPTYARG )
-{
- ::rtl::OUString sURL( m_aInfoFI.GetURL() );
-
- if ( sURL.getLength() > 0 )
- {
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xSMGR =
- ::comphelper::getProcessServiceFactory();
- uno::Reference< XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- {
- xSystemShell->execute(
- sURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
- }
- catch( const uno::Exception& e )
- {
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
-{
- uno::Reference < uno::XInterface > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
- C2S("com.sun.star.frame.Desktop") ), uno::UNO_QUERY );
- if ( xDesktop.is() )
- {
- ::rtl::OUString sLogFile( m_sLogPath );
- sLogFile += C2S("/Current.csv");
- uno::Sequence< beans::PropertyValue > aArgs(3);
- aArgs[0].Name = ::rtl::OUString::createFromAscii("FilterName");
- aArgs[0].Value = uno::makeAny(::rtl::OUString::createFromAscii("Text - txt - csv (StarCalc)"));
- aArgs[1].Name = ::rtl::OUString::createFromAscii("FilterOptions");
- aArgs[1].Value = uno::makeAny(::rtl::OUString::createFromAscii("44,34,12,1,"));
- aArgs[2].Name = ::rtl::OUString::createFromAscii("ReadOnly");
- aArgs[2].Value = uno::makeAny(true);
-
- uno::Reference< lang::XComponent > xDoc = ::comphelper::SynchronousDispatch::dispatch(
- xDesktop, sLogFile, C2S("_default"), 0, aArgs );
- if ( xDoc.is() )
- return 1;
- }
-
- return 0;
-}
-
-SfxTabPage* SvxImprovementOptionsPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxImprovementOptionsPage( pParent, rSet );
-}
-
-sal_uInt16* SvxImprovementOptionsPage::GetRanges()
-{
- return NULL;
-}
-
-sal_Bool SvxImprovementOptionsPage::FillItemSet( SfxItemSet& /*rSet*/ )
-{
- uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- uno::Reference< uno::XInterface > xConfig;
-
- try
- {
- xConfig = ::comphelper::ConfigurationHelper::openConfig(
- xSMGR, C2S("/org.openoffice.Office.OOoImprovement.Settings"),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xConfig, C2S("Participation"), C2S("ShowedInvitation"), uno::makeAny( true ) );
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xConfig, C2S("Participation"), C2S("InvitationAccepted"), uno::makeAny( m_aYesRB.IsChecked() != FALSE ) );
- ::comphelper::ConfigurationHelper::flush( xConfig );
- // TODO: refactor
- ::comphelper::UiEventsLogger::reinit();
- ::tools::InitTestToolLib();
- }
- catch( uno::Exception& )
- {
- }
-
- return sal_False;
-}
-
-void SvxImprovementOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
-{
- uno::Reference< lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- uno::Reference< com::sun::star::oooimprovement::XCore > xCore(
- xSMGR->createInstance( C2S("com.sun.star.oooimprovement.Core") ),
- uno::UNO_QUERY );
- uno::Reference< uno::XInterface > xConfig;
-
- try
- {
- m_aNoRB.Check();
- xConfig = ::comphelper::ConfigurationHelper::openConfig(
- xSMGR, C2S("/org.openoffice.Office.OOoImprovement.Settings"),
- ::comphelper::ConfigurationHelper::E_READONLY );
- if ( xConfig.is() )
- {
- bool bYesChecked = false;
- uno::Any aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Participation"), C2S("ShowedInvitation") );
- if ( ( aAny >>= bYesChecked ) && bYesChecked )
- {
- bool bTemp = false;
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Participation"), C2S("InvitationAccepted") );
- if ( aAny >>= bTemp )
- {
- bYesChecked &= bTemp;
- if ( bYesChecked )
- m_aYesRB.Check();
- }
- }
-
- ::rtl::OUString sURL;
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Participation"), C2S("HelpUrl") );
- if ( aAny >>= sURL )
- m_aInfoFI.SetURL( sURL );
-
- sal_Int32 nCount = 0;
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Counters"), C2S("UploadedReports") );
- if ( aAny >>= nCount )
- m_aNumberOfReportsValueFT.SetText( String::CreateFromInt32( nCount ) );
- aAny = ::comphelper::ConfigurationHelper::
- readRelativeKey( xConfig, C2S("Counters"), C2S("LoggedEvents") );
- if ( aAny >>= nCount )
- {
- if ( xCore.is() )
- nCount += xCore->getSessionLogEventCount();
- m_aNumberOfActionsValueFT.SetText( String::CreateFromInt32( nCount ) );
- }
-
- ::rtl::OUString sPath;
- aAny = ::comphelper::ConfigurationHelper::readDirectKey(
- xSMGR, C2S("/org.openoffice.Office.Logging"), C2S("OOoImprovement"),
- C2S("LogPath"), ::comphelper::ConfigurationHelper::E_READONLY );
- if ( aAny >>= sPath )
- {
- uno::Reference< util::XStringSubstitution > xSubst(
- xSMGR->createInstance( C2S("com.sun.star.util.PathSubstitution") ),
- uno::UNO_QUERY );
- if ( xSubst.is() )
- sPath = xSubst->substituteVariables( sPath, sal_False );
- m_sLogPath = sPath;
- }
- }
- }
- catch( uno::Exception& )
- {
- }
-}
-
diff --git a/svx/source/cui/optinet2.cxx b/svx/source/cui/optinet2.cxx
deleted file mode 100644
index 2a74cc6761..0000000000
--- a/svx/source/cui/optinet2.cxx
+++ /dev/null
@@ -1,2356 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optinet2.cxx,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/config.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/slstitm.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/docfilt.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/filedlghelper.hxx>
-#include <tools/inetdef.hxx>
-#include <svtools/urihelper.hxx>
-
-#ifndef _CNTWIDS_HRC
-#include <svtools/cntwids.hrc>
-#endif
-#include <svtools/inetoptions.hxx>
-#ifndef _SV_SVAPP_HXX
-#include <sfx2/app.hxx>
-#endif
-#include <sfx2/objsh.hxx>
-#include <unotools/bootstrap.hxx>
-#include <vcl/help.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/pathoptions.hxx>
-#ifndef INCLUDED_SVTOOLS_SECURITIYOPTIONS_HXX
-#include <svtools/securityoptions.hxx>
-#endif
-#ifndef _SVTOOLS_JAVAPTIONS_HXX
-#include <svtools/javaoptions.hxx>
-#endif
-#include <unotools/localfilehelper.hxx>
-#include <svtools/extendedsecurityoptions.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#define _SVX_OPTINET2_CXX
-#include <svx/dialmgr.hxx>
-#include "optinet2.hxx"
-//CHINA001 #ifndef _SVX_MULTIFIL_HXX
-//CHINA001 #include "multifil.hxx"
-//CHINA001 #endif
-#include <svx/svxdlg.hxx> //CHINA001
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#ifndef _SVX_OPTINET_HRC
-#include "optinet2.hrc"
-#endif
-#ifndef _SVX_HELPID_HRC
-#include "helpid.hrc"
-#endif
-#include "ofaitem.hxx"
-#include "htmlmode.hxx"
-
-// for security TP
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
-
-#ifdef UNX
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <string.h>
-#include <rtl/textenc.h>
-#include <rtl/locale.h>
-#include <osl/nlsupport.h>
-#endif
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <comphelper/processfactory.hxx>
-
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-#include "com/sun/star/task/XMasterPasswordHandling2.hpp"
-#include "com/sun/star/task/XPasswordContainer.hpp"
-#include "securityoptions.hxx"
-#include "webconninfo.hxx"
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::sfx2;
-using ::rtl::OUString;
-
-//CHINA001 copy from multipat.hxx begin
-// define ----------------------------------------------------------------
-
-// different delimiter for Unix (:) and Windows (;)
-
-#ifdef UNX
-#define CLASSPATH_DELIMITER ':'
-#else
-#define CLASSPATH_DELIMITER ';'
-#endif
-//CHINA001 copy from multipat.hxx end
-// static ----------------------------------------------------------------
-
-#define C2U(cChar) OUString::createFromAscii(cChar)
-
-#define INET_SEARCH_TOKEN '"'
-#define RET_ALL ((short)200)
-#define CFG_READONLY_DEFAULT FALSE
-
-#include <sal/config.h>
-
-SV_IMPL_PTRARR( SfxFilterPtrArr, SfxFilterPtr )
-
-const char* SEARCHENGINE_INI = "srcheng.ini";
-const char* SEARCHENGINE_GROUP = "SearchEngines-$(vlang)";
-
-// -----------------------------------------------------------------------
-
-String lcl_MakeTabEntry(const SfxFilter* pFilter)
-{
- String sEntry(pFilter->GetMimeType());
- sEntry += '\t';
- sEntry += pFilter->GetWildcard().GetWildCard();
- sEntry += '\t';
- sEntry += pFilter->GetName();
-#if defined(OS2)
- sEntry += '\t';
- sEntry += pFilter->GetTypeName();
-#endif
- return sEntry;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL IsJavaInstalled_Impl( /*!!!SfxIniManager* pIniMgr*/ )
-{
- BOOL bRet = FALSE;
-/*!!! (pb) needs new implementation
- String aIniEntry;
- String aFullName = Config::GetConfigName( pIniMgr->Get( SFX_KEY_USERCONFIG_PATH ),
- String::CreateFromAscii("java") );
- INetURLObject aIniFileObj( aFullName, INET_PROT_FILE );
- String aIniPath = aIniFileObj.getName();
- if ( pIniMgr->SearchFile( aIniPath ) )
- {
- Config aJavaCfg( aIniPath );
- aJavaCfg.SetGroup( "Java" );
- ByteString sTemp = aJavaCfg.ReadKey( ByteString(::rtl::OUStringToOString(pIniMgr->GetKeyName( SFX_KEY_JAVA_SYSTEMCLASSPATH ),RTL_TEXTENCODING_UTF8)) );
- String aJavaSystemClassPath = ::rtl::OStringToOUString(sTemp,RTL_TEXTENCODING_UTF8);
- String aJavaRuntimeLib = ::rtl::OStringToOUString(aJavaCfg.ReadKey( "RuntimeLib" ),RTL_TEXTENCODING_UTF8);
- if ( aJavaSystemClassPath.Len() && aJavaRuntimeLib.Len() )
- bRet = TRUE;
- }
-*/
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxNoSpaceEdit::KeyInput( const KeyEvent& rKEvent )
-{
- if ( bOnlyNumeric )
- {
- const KeyCode& rKeyCode = rKEvent.GetKeyCode();
- USHORT nGroup = rKeyCode.GetGroup();
- USHORT nKey = rKeyCode.GetCode();
- BOOL bValid = ( KEYGROUP_NUM == nGroup || KEYGROUP_CURSOR == nGroup ||
- ( KEYGROUP_MISC == nGroup && ( nKey < KEY_ADD || nKey > KEY_EQUAL ) ) );
- if ( !bValid && ( rKeyCode.IsMod1() && (
- KEY_A == nKey || KEY_C == nKey || KEY_V == nKey || KEY_X == nKey || KEY_Z == nKey ) ) )
- // Erase, Copy, Paste, Select All und Undo soll funktionieren
- bValid = TRUE;
-
- if ( bValid )
- Edit::KeyInput(rKEvent);
- }
- else if( rKEvent.GetKeyCode().GetCode() != KEY_SPACE )
- Edit::KeyInput(rKEvent);
-}
-
-// -----------------------------------------------------------------------
-
-void SvxNoSpaceEdit::Modify()
-{
- Edit::Modify();
-
- if ( bOnlyNumeric )
- {
- XubString aValue = GetText();
-
- if ( !ByteString(::rtl::OUStringToOString(aValue,RTL_TEXTENCODING_UTF8)).IsNumericAscii() || (long)aValue.ToInt32() > USHRT_MAX )
- // der H�chstwert einer Portnummer ist USHRT_MAX
- ErrorBox( this, SVX_RES( RID_SVXERR_OPT_PROXYPORTS ) ).Execute();
- }
-}
-
-/********************************************************************/
-/********************************************************************/
-/* */
-/* SvxProxyTabPage */
-/* */
-/* */
-/********************************************************************/
-/********************************************************************/
-
-SvxProxyTabPage::SvxProxyTabPage(Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_INET_PROXY ), rSet ),
- aOptionGB (this, SVX_RES(GB_SETTINGS)),
-
- aProxyModeFT (this, SVX_RES(FT_PROXYMODE)),
- aProxyModeLB (this, SVX_RES(LB_PROXYMODE)),
-
- aHttpProxyFT (this, SVX_RES( FT_HTTP_PROXY )),
- aHttpProxyED (this, SVX_RES( ED_HTTP_PROXY )),
- aHttpPortFT (this, SVX_RES( FT_HTTP_PORT )),
- aHttpPortED (this, SVX_RES( ED_HTTP_PORT ), TRUE),
-
- aHttpsProxyFT (this, SVX_RES( FT_HTTPS_PROXY )),
- aHttpsProxyED (this, SVX_RES( ED_HTTPS_PROXY )),
- aHttpsPortFT (this, SVX_RES( FT_HTTPS_PORT )),
- aHttpsPortED (this, SVX_RES( ED_HTTPS_PORT ), TRUE),
-
- aFtpProxyFT (this, SVX_RES( FT_FTP_PROXY )),
- aFtpProxyED (this, SVX_RES( ED_FTP_PROXY )),
- aFtpPortFT (this, SVX_RES( FT_FTP_PORT )),
- aFtpPortED (this, SVX_RES( ED_FTP_PORT ), TRUE),
-
- aNoProxyForFT (this, SVX_RES( FT_NOPROXYFOR )),
- aNoProxyForED (this, SVX_RES( ED_NOPROXYFOR )),
- aNoProxyDescFT (this, SVX_RES( ED_NOPROXYDESC )),
- sFromBrowser ( SVX_RES( ST_PROXY_FROM_BROWSER ) ),
- aProxyModePN(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")),
- aHttpProxyPN(RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")),
- aHttpPortPN(RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")),
- aHttpsProxyPN(RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")),
- aHttpsPortPN(RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")),
- aFtpProxyPN(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")),
- aFtpPortPN(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")),
- aNoProxyDescPN(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy"))
-{
- FreeResource();
-
- aHttpPortED.SetMaxTextLen(5);
- aHttpsPortED.SetMaxTextLen(5);
- aFtpPortED.SetMaxTextLen(5);
- Link aLink = LINK( this, SvxProxyTabPage, LoseFocusHdl_Impl );
- aHttpPortED.SetLoseFocusHdl( aLink );
- aHttpsPortED.SetLoseFocusHdl( aLink );
- aFtpPortED.SetLoseFocusHdl( aLink );
-
- aProxyModeLB.SetSelectHdl(LINK( this, SvxProxyTabPage, ProxyHdl_Impl ));
-
- Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory());
-
- if( xServiceManager.is() )
- {
- try
- {
- Reference< com::sun::star::lang::XMultiServiceFactory > xConfigurationProvider =
- Reference< com::sun::star::lang::XMultiServiceFactory > ( xServiceManager->createInstance( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ) ),
- UNO_QUERY_THROW);
-
- OUString aConfigRoot(RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings" ) );
-
- beans::PropertyValue aProperty;
- aProperty.Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
- aProperty.Value = makeAny( aConfigRoot );
-
- Sequence< Any > aArgumentList( 1 );
- aArgumentList[0] = makeAny( aProperty );
-
- m_xConfigurationUpdateAccess = xConfigurationProvider->createInstanceWithArguments( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ),
- aArgumentList );
- }
- catch ( RuntimeException& )
- {
- }
- }
-
- ArrangeControls_Impl();
-}
-
-/*-----------------12.08.96 14.55-------------------
-
---------------------------------------------------*/
-
-SvxProxyTabPage::~SvxProxyTabPage()
-{
-}
-
-/*-----------------12.08.96 14.55-------------------
-
---------------------------------------------------*/
-
-SfxTabPage* SvxProxyTabPage::Create(Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxProxyTabPage(pParent, rAttrSet);
-}
-
-/*-----------------02.09.04 14.55-------------------
-
---------------------------------------------------*/
-
-void SvxProxyTabPage::ReadConfigData_Impl()
-{
- try {
- Reference< container::XNameAccess > xNameAccess(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
-
- sal_Int32 nIntValue = 0;
- OUString aStringValue;
-
- if( xNameAccess->getByName(aProxyModePN) >>= nIntValue )
- {
- aProxyModeLB.SelectEntryPos( (USHORT) nIntValue );
- }
-
- if( xNameAccess->getByName(aHttpProxyPN) >>= aStringValue )
- {
- aHttpProxyED.SetText( aStringValue );
- }
-
- if( xNameAccess->getByName(aHttpPortPN) >>= nIntValue )
- {
- aHttpPortED.SetText( String::CreateFromInt32( nIntValue ));
- }
-
- if( xNameAccess->getByName(aHttpsProxyPN) >>= aStringValue )
- {
- aHttpsProxyED.SetText( aStringValue );
- }
-
- if( xNameAccess->getByName(aHttpsPortPN) >>= nIntValue )
- {
- aHttpsPortED.SetText( String::CreateFromInt32( nIntValue ));
- }
-
- if( xNameAccess->getByName(aFtpProxyPN) >>= aStringValue )
- {
- aFtpProxyED.SetText( aStringValue );
- }
-
- if( xNameAccess->getByName(aFtpPortPN) >>= nIntValue )
- {
- aFtpPortED.SetText( String::CreateFromInt32( nIntValue ));
- }
-
- if( xNameAccess->getByName(aNoProxyDescPN) >>= aStringValue )
- {
- aNoProxyForED.SetText( aStringValue );
- }
- }
-
- catch(container::NoSuchElementException e) {
- OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: NoSuchElementException caught" );
- }
-
- catch(com::sun::star::lang::WrappedTargetException e) {
- OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: WrappedTargetException caught" );
- }
-
- catch(RuntimeException e) {
- OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: RuntimeException caught" );
- }
-
-}
-
-/*-----------------02.09.04 14.55-------------------
-
---------------------------------------------------*/
-
-void SvxProxyTabPage::ReadConfigDefaults_Impl()
-{
- try
- {
- Reference< beans::XPropertyState > xPropertyState(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
-
- sal_Int32 nIntValue = 0;
- OUString aStringValue;
-
- if( xPropertyState->getPropertyDefault(aHttpProxyPN) >>= aStringValue )
- {
- aHttpProxyED.SetText( aStringValue );
- }
-
- if( xPropertyState->getPropertyDefault(aHttpPortPN) >>= nIntValue )
- {
- aHttpPortED.SetText( String::CreateFromInt32( nIntValue ));
- }
-
- if( xPropertyState->getPropertyDefault(aHttpsProxyPN) >>= aStringValue )
- {
- aHttpsProxyED.SetText( aStringValue );
- }
-
- if( xPropertyState->getPropertyDefault(aHttpsPortPN) >>= nIntValue )
- {
- aHttpsPortED.SetText( String::CreateFromInt32( nIntValue ));
- }
-
- if( xPropertyState->getPropertyDefault(aFtpProxyPN) >>= aStringValue )
- {
- aFtpProxyED.SetText( aStringValue );
- }
-
- if( xPropertyState->getPropertyDefault(aFtpPortPN) >>= nIntValue )
- {
- aFtpPortED.SetText( String::CreateFromInt32( nIntValue ));
- }
-
- if( xPropertyState->getPropertyDefault(aNoProxyDescPN) >>= aStringValue )
- {
- aNoProxyForED.SetText( aStringValue );
- }
- }
- catch(beans::UnknownPropertyException e)
- {
- OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" );
- }
-
- catch(com::sun::star::lang::WrappedTargetException e) {
- OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" );
- }
-
- catch(RuntimeException e)
- {
- OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" );
- }
-}
-
-/*-----------------02.09.04 14.55-------------------
-
---------------------------------------------------*/
-
-void SvxProxyTabPage::RestoreConfigDefaults_Impl()
-{
- try
- {
- Reference< beans::XPropertyState > xPropertyState(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
-
- xPropertyState->setPropertyToDefault(aProxyModePN);
- xPropertyState->setPropertyToDefault(aHttpProxyPN);
- xPropertyState->setPropertyToDefault(aHttpPortPN);
- xPropertyState->setPropertyToDefault(aHttpsProxyPN);
- xPropertyState->setPropertyToDefault(aHttpsPortPN);
- xPropertyState->setPropertyToDefault(aFtpProxyPN);
- xPropertyState->setPropertyToDefault(aFtpPortPN);
- xPropertyState->setPropertyToDefault(aNoProxyDescPN);
-
- Reference< util::XChangesBatch > xChangesBatch(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
- xChangesBatch->commitChanges();
- }
-
- catch(beans::UnknownPropertyException e)
- {
- OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" );
- }
-
- catch(com::sun::star::lang::WrappedTargetException e) {
- OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" );
- }
-
- catch(RuntimeException e)
- {
- OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" );
- }
-}
-
-/*-----------------12.08.96 14.55-------------------
-
---------------------------------------------------*/
-
-void SvxProxyTabPage::Reset(const SfxItemSet&)
-{
- ReadConfigData_Impl();
-
- aProxyModeLB.SaveValue();
- aHttpProxyED.SaveValue();
- aHttpPortED.SaveValue();
- aHttpsProxyED.SaveValue();
- aHttpsPortED.SaveValue();
- aFtpProxyED.SaveValue();
- aFtpPortED.SaveValue();
- aNoProxyForED.SaveValue();
-
- EnableControls_Impl( aProxyModeLB.GetSelectEntryPos() == 2 );
-}
-
-/*-----------------12.08.96 16.34-------------------
-
---------------------------------------------------*/
-
-BOOL SvxProxyTabPage::FillItemSet(SfxItemSet& )
-{
- BOOL bModified=FALSE;
-
- try {
- Reference< beans::XPropertySet > xPropertySet(m_xConfigurationUpdateAccess, UNO_QUERY_THROW );
-
- USHORT nSelPos = aProxyModeLB.GetSelectEntryPos();
- if(aProxyModeLB.GetSavedValue() != nSelPos)
- {
- if( nSelPos == 1 )
- {
- RestoreConfigDefaults_Impl();
- return TRUE;
- }
-
- xPropertySet->setPropertyValue(aProxyModePN,
- makeAny((sal_Int32) nSelPos));
- bModified = TRUE;
- }
-
- if(aHttpProxyED.GetSavedValue() != aHttpProxyED.GetText())
- {
- xPropertySet->setPropertyValue( aHttpProxyPN,
- makeAny(rtl::OUString(aHttpProxyED.GetText())));
- bModified = TRUE;
- }
-
- if ( aHttpPortED.GetSavedValue() != aHttpPortED.GetText() )
- {
- xPropertySet->setPropertyValue( aHttpPortPN,
- makeAny(aHttpPortED.GetText().ToInt32()));
- bModified = TRUE;
- }
-
- if(aHttpsProxyED.GetSavedValue() != aHttpsProxyED.GetText())
- {
- xPropertySet->setPropertyValue( aHttpsProxyPN,
- makeAny(rtl::OUString(aHttpsProxyED.GetText())));
- bModified = TRUE;
- }
-
- if ( aHttpsPortED.GetSavedValue() != aHttpsPortED.GetText() )
- {
- xPropertySet->setPropertyValue( aHttpsPortPN,
- makeAny(aHttpsPortED.GetText().ToInt32()));
- bModified = TRUE;
- }
-
- if(aFtpProxyED.GetSavedValue() != aFtpProxyED.GetText())
- {
- xPropertySet->setPropertyValue( aFtpProxyPN,
- makeAny( rtl::OUString(aFtpProxyED.GetText())));
- bModified = TRUE;
- }
-
- if ( aFtpPortED.GetSavedValue() != aFtpPortED.GetText() )
- {
- xPropertySet->setPropertyValue( aFtpPortPN,
- makeAny(aFtpPortED.GetText().ToInt32()));
- bModified = TRUE;
- }
-
- if ( aNoProxyForED.GetSavedValue() != aNoProxyForED.GetText() )
- {
- xPropertySet->setPropertyValue( aNoProxyDescPN,
- makeAny( rtl::OUString(aNoProxyForED.GetText())));
- bModified = TRUE;
- }
-
- Reference< util::XChangesBatch > xChangesBatch(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
- xChangesBatch->commitChanges();
- }
-
- catch(com::sun::star::lang::IllegalArgumentException e) {
- OSL_TRACE( "SvxProxyTabPage::FillItemSet: IllegalArgumentException caught" );
- }
-
- catch(beans::UnknownPropertyException e) {
- OSL_TRACE( "SvxProxyTabPage::FillItemSet: UnknownPropertyException caught" );
- }
-
- catch(beans::PropertyVetoException e) {
- OSL_TRACE( "SvxProxyTabPage::FillItemSet: PropertyVetoException caught" );
- }
-
- catch(com::sun::star::lang::WrappedTargetException e) {
- OSL_TRACE( "SvxProxyTabPage::FillItemSet: WrappedTargetException caught" );
- }
-
- catch(RuntimeException e) {
- OSL_TRACE( "SvxProxyTabPage::FillItemSet: RuntimeException caught" );
- }
-
- return bModified;
-}
-
-void SvxProxyTabPage::ArrangeControls_Impl()
-{
- //-->Calculate dynamical width of controls, add buy wuy for i71445 Time: 2007.02.27
- long nWidth = aProxyModeFT.GetCtrlTextWidth( aProxyModeFT.GetText() );
- long nTemp = aHttpProxyFT.GetCtrlTextWidth( aHttpProxyFT.GetText() );
- if ( nTemp > nWidth )
- nWidth = nTemp;
- nTemp = aHttpsProxyFT.GetCtrlTextWidth( aHttpsProxyFT.GetText() );
- if ( nTemp > nWidth )
- nWidth = nTemp;
- nTemp = aFtpProxyFT.GetCtrlTextWidth( aFtpProxyFT.GetText() );
- if ( nTemp > nWidth )
- nWidth = nTemp;
- nTemp = aNoProxyForFT.GetCtrlTextWidth( aNoProxyForFT.GetText() );
- if ( nTemp > nWidth )
- nWidth = nTemp;
-
- nWidth += 10; // To be sure the length of the FixedText is enough on all platforms
- const long nFTWidth = aProxyModeFT.GetSizePixel().Width();
- if ( nWidth > nFTWidth )
- {
- Size aNewSize = aProxyModeFT.GetSizePixel();
- aNewSize.Width() = nWidth;
-
- aProxyModeFT.SetSizePixel( aNewSize );
- aHttpProxyFT.SetSizePixel( aNewSize );
- aHttpsProxyFT.SetSizePixel( aNewSize );
- aFtpProxyFT.SetSizePixel( aNewSize );
- aNoProxyForFT.SetSizePixel( aNewSize );
-
- const long nDelta = nWidth - nFTWidth;
- Point aNewPos = aProxyModeLB.GetPosPixel();
- aNewPos.X() += nDelta;
-
- aProxyModeLB.SetPosPixel( aNewPos );
-
- aNewSize = aHttpProxyED.GetSizePixel();
- aNewSize.Width() -= nDelta;
-
- aNewPos.Y() = aHttpProxyED.GetPosPixel().Y();
- aHttpProxyED.SetPosSizePixel( aNewPos, aNewSize );
- aNewPos.Y() = aHttpsProxyED.GetPosPixel().Y();
- aHttpsProxyED.SetPosSizePixel( aNewPos, aNewSize );
- aNewPos.Y() = aFtpProxyED.GetPosPixel().Y();
- aFtpProxyED.SetPosSizePixel( aNewPos, aNewSize );
- aNewPos.Y() = aNoProxyForED.GetPosPixel().Y();
- aNoProxyForED.SetPosSizePixel( aNewPos, aNewSize );
- }
- //<--End buy wuy for i71445 Time: 2007.02.27
-}
-
-/*-----------------12.08.96 13.38-------------------
-
---------------------------------------------------*/
-void SvxProxyTabPage::EnableControls_Impl(BOOL bEnable)
-{
- aHttpProxyFT.Enable(bEnable);
- aHttpProxyED.Enable(bEnable);
- aHttpPortFT.Enable(bEnable);
- aHttpPortED.Enable(bEnable);
-
- aHttpsProxyFT.Enable(bEnable);
- aHttpsProxyED.Enable(bEnable);
- aHttpsPortFT.Enable(bEnable);
- aHttpsPortED.Enable(bEnable);
-
- aFtpProxyFT.Enable(bEnable);
- aFtpProxyED.Enable(bEnable);
- aFtpPortFT.Enable(bEnable);
- aFtpPortED.Enable(bEnable);
-
- aNoProxyForFT.Enable(bEnable);
- aNoProxyForED.Enable(bEnable);
- aNoProxyDescFT.Enable(bEnable);
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox )
-{
- USHORT nPos = pBox->GetSelectEntryPos();
-
- // Restore original system values
- if( nPos == 1 )
- {
- ReadConfigDefaults_Impl();
- }
-
- EnableControls_Impl(nPos == 2);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit *, pEdit )
-{
- XubString aValue = pEdit->GetText();
-
- if ( !ByteString(::rtl::OUStringToOString(aValue,RTL_TEXTENCODING_UTF8)).IsNumericAscii() || (long)aValue.ToInt32() > USHRT_MAX )
- pEdit->SetText( '0' );
- return 0;
-}
-
-
-/********************************************************************/
-/********************************************************************/
-/* */
-/* SvxSearchTabPage */
-/* */
-/* */
-/********************************************************************/
-/********************************************************************/
-
-SvxSearchTabPage::SvxSearchTabPage(Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_INET_SEARCH ), rSet ),
-
- aSearchGB ( this, SVX_RES( GB_SEARCH ) ),
- aSearchLB ( this, SVX_RES( LB_SEARCH ) ),
- aSearchNameFT ( this, SVX_RES( FT_SEARCH_NAME ) ),
- aSearchNameED ( this, SVX_RES( ED_SEARCH_NAME ) ),
- aSearchFT ( this, SVX_RES( FT_SEARCH ) ),
- aAndRB ( this, SVX_RES( RB_AND ) ),
- aOrRB ( this, SVX_RES( RB_OR ) ),
- aExactRB ( this, SVX_RES( RB_EXACT ) ),
-
- aURLFT ( this, SVX_RES( FT_URL ) ),
- aURLED ( this, SVX_RES( ED_URL ) ),
-
- aPostFixFT ( this, SVX_RES( FT_POSTFIX ) ),
- aPostFixED ( this, SVX_RES( ED_POSTFIX ) ),
- aSeparatorFT ( this, SVX_RES( FT_SEPARATOR ) ),
- aSeparatorED ( this, SVX_RES( ED_SEPARATOR ) ),
- aCaseFT ( this, SVX_RES( FT_CASE ) ),
- aCaseED ( this, SVX_RES( ED_CASE ) ),
-
- aNewPB ( this, SVX_RES( PB_NEW ) ),
- aAddPB ( this, SVX_RES( PB_ADD ) ),
- aChangePB ( this, SVX_RES( PB_CHANGE ) ),
- aDeletePB ( this, SVX_RES( PB_DELETE ) ),
-
- sModifyMsg(SVX_RES(MSG_MODIFY))
-{
- FreeResource();
-
- SetExchangeSupport();
- aCaseED.SelectEntryPos(0); // falls kein Eintrag vorhanden ist, kann es sonst "Arger geben
-
- aNewPB.SetClickHdl(LINK( this, SvxSearchTabPage, NewSearchHdl_Impl ) );
- aAddPB.SetClickHdl(LINK( this, SvxSearchTabPage, AddSearchHdl_Impl ) );
- aChangePB.SetClickHdl(LINK( this, SvxSearchTabPage, ChangeSearchHdl_Impl ) );
- aDeletePB.SetClickHdl(LINK( this, SvxSearchTabPage, DeleteSearchHdl_Impl ) );
- aSearchLB.SetSelectHdl(LINK( this, SvxSearchTabPage, SearchEntryHdl_Impl ) );
-
- Link aLink = LINK( this, SvxSearchTabPage, SearchModifyHdl_Impl );
- aSearchNameED.SetModifyHdl( aLink );
- aURLED.SetModifyHdl( aLink );
- aSeparatorED.SetModifyHdl( aLink );
- aPostFixED.SetModifyHdl( aLink );
- aCaseED.SetSelectHdl( aLink );
-
- aLink = LINK( this, SvxSearchTabPage, SearchPartHdl_Impl );
- aAndRB.SetClickHdl( aLink );
- aOrRB.SetClickHdl( aLink );
- aExactRB.SetClickHdl( aLink );
-
- InitControls_Impl();
-}
-
-// -----------------------------------------------------------------------
-SvxSearchTabPage::~SvxSearchTabPage()
-{
-}
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxSearchTabPage::Create(Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxSearchTabPage(pParent, rAttrSet);
-}
-
-// -----------------------------------------------------------------------
-
-void SvxSearchTabPage::Reset( const SfxItemSet& )
-{
- //The two lines below are moved here from the last part of this method by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- aChangePB.Disable();
- aAddPB.Disable();
-
- sal_uInt16 nCount = aSearchConfig.Count();
- aSearchLB.Clear(); //add by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- for(sal_uInt16 i = 0; i < nCount; i++)
- {
- const SvxSearchEngineData& rData = aSearchConfig.GetData(i);
- aSearchLB.InsertEntry(rData.sEngineName);
- }
-
- if ( nCount )
- {
- aSearchLB.SelectEntryPos(0);
- SearchEntryHdl_Impl( &aSearchLB );
- }
- else
- aDeletePB.Disable();
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxSearchTabPage::FillItemSet( SfxItemSet& )
-{
- if(aSearchConfig.IsModified())
- aSearchConfig.Commit();
- return TRUE;
-}
-/*--------------------------------------------------------------------*/
-
-void SvxSearchTabPage::ActivatePage( const SfxItemSet& )
-{
-}
-
-/*--------------------------------------------------------------------*/
-
-int SvxSearchTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- //Modified by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- if(!ConfirmLeave(String()))
- return KEEP_PAGE;
-
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-//add by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
-BOOL SvxSearchTabPage::ConfirmLeave( const String& rStringSelection)
-{
- if(aChangePB.IsEnabled())
- {
- QueryBox aQuery(this, WB_YES_NO_CANCEL|WB_DEF_YES, sModifyMsg);
- USHORT nRet = aQuery.Execute();
- if(RET_CANCEL == nRet)
- {
- if(rStringSelection.Len())
- aSearchLB.SelectEntry(sLastSelectedEntry);
- return FALSE;
- }
- else if(RET_YES == nRet)
- {
- USHORT nEntryPos = aSearchLB.GetEntryPos( aSearchNameED.GetText() );
- if ( nEntryPos != LISTBOX_ENTRY_NOTFOUND )
- aSearchLB.SelectEntryPos(nEntryPos);
- else
- aSearchLB.SetNoSelection();
- ChangeSearchHdl_Impl(0);
- if(rStringSelection.Len())
- aSearchLB.SelectEntry(rStringSelection);
- }
- else if(RET_NO == nRet)
- {
- aChangePB.Enable(FALSE);
- aAddPB.Enable(FALSE);
- SearchEntryHdl_Impl(&aSearchLB);
- }
- }
- if(aAddPB.IsEnabled())
- {
- QueryBox aQuery(this, WB_YES_NO_CANCEL|WB_DEF_YES, sModifyMsg);
- USHORT nRet = aQuery.Execute();
- if(RET_CANCEL == nRet)
- {
- aSearchLB.SetNoSelection();
- return FALSE;
- }
- else if(RET_YES == nRet)
- {
- aSearchLB.SetNoSelection();
- AddSearchHdl_Impl(0);
- if(rStringSelection.Len())
- aSearchLB.SelectEntry(rStringSelection);
- }
- else if(RET_NO == nRet)
- {
- aAddPB.Enable(FALSE);
- aChangePB.Enable(FALSE);
- NewSearchHdl_Impl(0);
- }
-
- }
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxSearchTabPage::InitControls_Impl()
-{
- // detect longest label text
- sal_Int32 i = 0;
- long nLabelTextWidth = 0;
- Window* pLabels[] = { &aSearchNameFT, &aSearchFT, &aURLFT, &aPostFixFT, &aSeparatorFT, &aCaseFT };
- Window** pLabel = pLabels;
- const sal_Int32 nLabelCount = sizeof( pLabels ) / sizeof( pLabels[0] );
- for ( ; i < nLabelCount; ++i, ++pLabel )
- {
- long nTemp = (*pLabel)->GetCtrlTextWidth( (*pLabel)->GetText() );
- if ( nTemp > nLabelTextWidth )
- nLabelTextWidth = nTemp;
- }
-
- // resize all labels
- nLabelTextWidth = nLabelTextWidth * 120 / 100; // additional space looks better
- const long nLabelWidth = aSearchNameFT.GetSizePixel().Width();
- const long nDelta = nLabelWidth - nLabelTextWidth;
- pLabel = pLabels;
- for ( i = 0; i < nLabelCount; ++i, ++pLabel )
- {
- Size aNewSize = (*pLabel)->GetSizePixel();
- aNewSize.Width() += nDelta;
- (*pLabel)->SetSizePixel( aNewSize );
- }
-
- // resize and move the edits
- Window* pEdits[] = { &aSearchNameED, &aAndRB, &aOrRB,
- &aExactRB, &aURLED, &aPostFixED, &aSeparatorED, &aCaseED };
- Window** pEdit = pEdits;
- const sal_Int32 nCCount = sizeof( pEdits ) / sizeof( pEdits[ 0 ] );
- for ( i = 0; i < nCCount; ++i, ++pEdit )
- {
- Point aNewPos = (*pEdit)->GetPosPixel();
- aNewPos.X() -= nDelta;
- Size aNewSize = (*pEdit)->GetSizePixel();
- if ( (*pEdit) != &aSeparatorED && (*pEdit) != &aCaseED )
- aNewSize.Width() += nDelta;
- (*pEdit)->SetPosSizePixel( aNewPos, aNewSize );
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, NewSearchHdl_Impl, PushButton *, EMPTYARG )
-{
- //The 3 lines below is modified by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- SearchEntryHdl_Impl(&aSearchLB);
- if(aChangePB.IsEnabled() || aAddPB.IsEnabled())
- return 0;
- aSearchNameED.SetText( String() );
- aSearchLB.SetNoSelection();
- aCurrentSrchData = SvxSearchEngineData();
- aAndRB.Check( TRUE );
- SearchEntryHdl_Impl( &aSearchLB );
- SearchPartHdl_Impl( &aAndRB );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, AddSearchHdl_Impl, PushButton *, EMPTYARG )
-{
- //The following two lines is added by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- aAddPB.Enable(FALSE);
- aChangePB.Enable(FALSE);
- aCurrentSrchData.sEngineName = aSearchNameED.GetText();
- aSearchConfig.SetData(aCurrentSrchData);
- aSearchLB.InsertEntry( aCurrentSrchData.sEngineName );
- aSearchLB.SelectEntry( aCurrentSrchData.sEngineName );
- SearchEntryHdl_Impl( &aSearchLB );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, ChangeSearchHdl_Impl, PushButton *, EMPTYARG )
-{
- //The following two lines is added by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- aChangePB.Enable(FALSE);
- aAddPB.Enable(FALSE);
- USHORT nPos = aSearchLB.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- String sEngine = aSearchLB.GetSelectEntry();
- aCurrentSrchData.sEngineName = sEngine;
- aSearchConfig.SetData(aCurrentSrchData);
- aSearchLB.SelectEntry(sEngine);
- SearchEntryHdl_Impl(&aSearchLB);
- }
- else
- {
- SetUpdateMode(FALSE);
- String sEntry = aSearchNameED.GetText();
- // im AddHdl wird sLastSelectedEntry umgesetzt
- String sTemp(sLastSelectedEntry);
- AddSearchHdl_Impl(0);
- aSearchLB.SelectEntry(sTemp);
- DeleteSearchHdl_Impl(0);
- aSearchLB.SelectEntry(sEntry);
- SearchEntryHdl_Impl(&aSearchLB);
- SetUpdateMode(TRUE);
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, DeleteSearchHdl_Impl, PushButton *, EMPTYARG)
-{
- aChangePB.Enable(FALSE); //add by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- USHORT nPos = aSearchLB.GetSelectEntryPos();
- DBG_ASSERT(nPos != LISTBOX_ENTRY_NOTFOUND, "kein Eintrag selektiert!");
- aSearchConfig.RemoveData(aSearchLB.GetSelectEntry());
- aSearchLB.RemoveEntry(nPos);
- aSearchLB.SelectEntryPos(0);
- SearchEntryHdl_Impl(&aSearchLB);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, SearchEntryHdl_Impl, ListBox*, pBox )
-{
- USHORT nEntryPos = pBox->GetSelectEntryPos();
- if ( nEntryPos != LISTBOX_ENTRY_NOTFOUND )
- {
- String sSelection(pBox->GetSelectEntry());
- //Modified by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
- if(!ConfirmLeave(sSelection))
- return 0;
-
- const SvxSearchEngineData* pData = aSearchConfig.GetData(sSelection);
- DBG_ASSERT(pData, "SearchEngine not available");
- if(pData)
- {
- aSearchNameED.SetText(sSelection);
- sLastSelectedEntry = sSelection;
- sal_Bool bAnd = aAndRB.IsChecked();
- sal_Bool bOr = aOrRB.IsChecked();
-
- aURLED.SetText(bAnd ? pData->sAndPrefix : bOr ? pData->sOrPrefix : pData->sExactPrefix);
- aSeparatorED.SetText( bAnd ? pData->sAndSeparator : bOr ? pData->sOrSeparator : pData->sExactSeparator);
- aPostFixED.SetText(bAnd ? pData->sAndSuffix : bOr ? pData->sOrSuffix : pData->sExactSuffix );
- sal_Int32 nCase = bAnd ? pData->nAndCaseMatch : bOr ? pData->nOrCaseMatch : pData->nExactCaseMatch;
- aCaseED.SelectEntryPos( (USHORT)nCase );
- aCurrentSrchData = *pData;
- }
- aDeletePB.Enable();
- }
- else
- {
- aDeletePB.Enable(FALSE);
- sLastSelectedEntry.Erase();
- }
- aChangePB.Enable(FALSE);
- aAddPB.Enable(FALSE);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, SearchModifyHdl_Impl, SvxNoSpaceEdit*, pEdit )
-{
- if ( pEdit == &aSearchNameED )
- {
- BOOL bTextLen = ( 0 != pEdit->GetText().Len() );
- BOOL bFound = FALSE;
- if ( bTextLen )
- {
- USHORT nEntryPos = aSearchLB.GetEntryPos( pEdit->GetText() );
- bFound = ( nEntryPos != LISTBOX_ENTRY_NOTFOUND );
- if ( bFound )
- aSearchLB.SelectEntryPos(nEntryPos);
- else
- aSearchLB.SetNoSelection();
- }
- aChangePB.Enable( sLastSelectedEntry.Len() > 0 );
- aDeletePB.Enable(bFound);
- aAddPB.Enable(bTextLen && !bFound);
- }
- else
- {
- if ( aSearchLB.GetSelectEntryCount() && sLastSelectedEntry.Len() > 0 )
- aChangePB.Enable();
-
- if(aAndRB.IsChecked())
- {
- aCurrentSrchData.sAndPrefix = aURLED.GetText();
- aCurrentSrchData.sAndSeparator = aSeparatorED.GetText();
- aCurrentSrchData.sAndSuffix = aPostFixED.GetText();
- aCurrentSrchData.nAndCaseMatch = aCaseED.GetSelectEntryPos();
- }
- else if(aOrRB.IsChecked())
- {
- aCurrentSrchData.sOrPrefix = aURLED.GetText();
- aCurrentSrchData.sOrSeparator = aSeparatorED.GetText();
- aCurrentSrchData.sOrSuffix = aPostFixED.GetText();
- aCurrentSrchData.nOrCaseMatch = aCaseED.GetSelectEntryPos();
- }
- else
- {
- aCurrentSrchData.sExactPrefix = aURLED.GetText();
- aCurrentSrchData.sExactSeparator = aSeparatorED.GetText();
- aCurrentSrchData.sExactSuffix = aPostFixED.GetText();
- aCurrentSrchData.nExactCaseMatch = aCaseED.GetSelectEntryPos();
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchTabPage, SearchPartHdl_Impl, RadioButton *, EMPTYARG )
-{
- sal_Bool bAnd = aAndRB.IsChecked();
- sal_Bool bOr = aOrRB.IsChecked();
-
- aURLED.SetText(bAnd ? aCurrentSrchData.sAndPrefix : bOr ? aCurrentSrchData.sOrPrefix : aCurrentSrchData.sExactPrefix);
- aSeparatorED.SetText( bAnd ? aCurrentSrchData.sAndSeparator : bOr ? aCurrentSrchData.sOrSeparator : aCurrentSrchData.sExactSeparator);
- aPostFixED.SetText(bAnd ? aCurrentSrchData.sAndSuffix : bOr ? aCurrentSrchData.sOrSuffix : aCurrentSrchData.sExactSuffix );
- sal_Int32 nCase = bAnd ? aCurrentSrchData.nAndCaseMatch : bOr ? aCurrentSrchData.nOrCaseMatch : aCurrentSrchData.nExactCaseMatch;
- aCaseED.SelectEntryPos( (USHORT)nCase );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-/********************************************************************/
-/********************************************************************/
-/* */
-/* SvxOtherTabPage */
-/* */
-/********************************************************************/
-/********************************************************************/
-
-/*-----------------15.05.97 09:51-------------------
-
---------------------------------------------------*/
-/*
-SvxPatternField::SvxPatternField( Window* pParent, const ResId& rResId ) :
-
- PatternField( pParent, rResId ),
-
- sMsg233 ( ResId( ST_MSG_233 ) ),
- sMsg255 ( ResId( ST_MSG_255 ) )
-
-{
- FreeResource();
- SelectFixedFont();
-} */
-
-/*-----------------15.05.97 09:51-------------------
-
---------------------------------------------------*/
-
-/*void SvxPatternField::KeyInput( const KeyEvent& rKEvt )
-{
- PatternField::KeyInput( rKEvt );
- BOOL bDelete = ( rKEvt.GetKeyCode().GetCode() == KEY_DELETE );
- String sEntry( GetText() );
- sEntry[(USHORT)3] = '.';
- sEntry[(USHORT)7] = '.';
- sEntry[(USHORT)11] = '.';
- Selection aSelection( GetSelection() );
- String sPart( sEntry.GetToken( 0, '.' ) );
- USHORT i, nPart( sPart.EraseLeadingChars() );
- BOOL bSet = FALSE;
-
- if ( sPart.Len() && ( !nPart || nPart > 255 ) )
- {
- // der erste Part darf nicht 0 und nicht gr"osser 255 sein
- String sMsg( sPart );
- sMsg += ' ';
- sMsg += sMsg233;
- InfoBox( this, sMsg ).Execute();
-
- if ( nPart == 0 )
- sPart = " 1";
- else
- sPart = "255";
- sEntry.SetToken( 0, '.', sPart );
- bSet = TRUE;
- };
-
- for ( i = 1; i < 4; i++ )
- {
- // die anderen Parts d"urfen nicht gr"osser 255 sein
- sPart = sEntry.GetToken( i, '.' );
- nPart = sPart.EraseLeadingChars();
-
- if ( nPart > 255 )
- {
- String sMsg( sPart );
- sMsg += ' ';
- sMsg += sMsg255;
- InfoBox( this, sMsg ).Execute();
-
- if ( nPart == 0 )
- sPart = " 1";
- else
- sPart = "255";
- sEntry.SetToken( i, '.', sPart );
- bSet = TRUE;
- };
- }
-
- if ( bSet )
- {
- SetText( sEntry );
- SetSelection( aSelection );
- }
-}
-*/
-// -----------------------------------------------------------------------
-#if 0
-long SvxPatternField::Notify( NotifyEvent& rNEvt )
-{
- return PatternField::Notify( rNEvt );
-/*! long nHandled = 0;
-
- if ( rNEvt.GetType() == EVENT_KEYUP )
- {
- const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- KeyInput( *pKEvt );
- nHandled = 1;
- }
- return nHandled;*/
-}
-#endif
-
-// class JavaScriptDisableQueryBox_Impl --------------------------------------
-
-class JavaScriptDisableQueryBox_Impl : public ModalDialog
-{
-private:
- FixedImage aImage;
- FixedText aWarningFT;
- CheckBox aDisableCB;
- OKButton aYesBtn;
- CancelButton aNoBtn;
-
-public:
- JavaScriptDisableQueryBox_Impl( Window* pParent );
-
- BOOL IsWarningDisabled() const { return aDisableCB.IsChecked(); }
-};
-
-JavaScriptDisableQueryBox_Impl::JavaScriptDisableQueryBox_Impl( Window* pParent ) :
-
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_OPT_JAVASCRIPT_DISABLE ) ),
-
- aImage ( this, SVX_RES( IMG_JSCPT_WARNING ) ),
- aWarningFT ( this, SVX_RES( FT_JSCPT_WARNING ) ),
- aDisableCB ( this, SVX_RES( CB_JSCPT_DISABLE ) ),
- aYesBtn ( this, SVX_RES( BTN_JSCPT_YES ) ),
- aNoBtn ( this, SVX_RES( BTN_JSCPT_NO ) )
-
-{
- FreeResource();
-
- aYesBtn.SetText( Button::GetStandardText( BUTTON_YES ) );
- aNoBtn.SetText( Button::GetStandardText( BUTTON_NO ) );
- aImage.SetImage( WarningBox::GetStandardImage() );
-}
-
-//#98647#----------------------------------------------
-void SvxScriptExecListBox::RequestHelp( const HelpEvent& rHEvt )
-{ // try to show tips just like as on toolbars
- USHORT nPos=LISTBOX_ENTRY_NOTFOUND;
- USHORT nTop = GetTopEntry();
- USHORT nCount = GetDisplayLineCount(); // Attention: Not GetLineCount()
- Point aPt = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
- Rectangle aItemRect;
- if( nCount > 0 ) // if there're some entries, find it.
- for( nPos = nTop ; nPos <= nTop+nCount-1 ; nPos++ ) {
- aItemRect = GetBoundingRectangle(nPos);
- if( aPt.Y() < aItemRect.Top() || aPt.Y() > aItemRect.Bottom() )
- continue;
- else
- break;
- }
- else // if not, nothing happens.
- return;
- String aHelpText;
- if( nPos <= nTop+nCount-1 ) // if find the matching entry, get its content.
- aHelpText = GetEntry(nPos);
- if( aHelpText.Len() && GetTextWidth(aHelpText)<GetOutputSizePixel().Width() )
- aHelpText.Erase(); // if the entry is quite short, clear the helping tip content.
- aItemRect = Rectangle(Point(0,0),GetSizePixel());
- aPt = Point(OutputToScreenPixel( aItemRect.TopLeft() ));
- aItemRect.Left() = aPt.X();
- aItemRect.Top() = aPt.Y();
- aPt = OutputToScreenPixel( aItemRect.BottomRight() );
- aItemRect.Right() = aPt.X();
- aItemRect.Bottom() = aPt.Y();
- if( rHEvt.GetMode() == HELPMODE_BALLOON )
- Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aHelpText);
- else
- Help::ShowQuickHelp( this, aItemRect, aHelpText );
-}
-
-/********************************************************************/
-/* */
-/* SvxSecurityTabPage */
-/* */
-/********************************************************************/
-
-SvxSecurityTabPage::SvxSecurityTabPage( Window* pParent, const SfxItemSet& rSet )
- :SfxTabPage ( pParent, SVX_RES( RID_SVXPAGE_INET_SECURITY ), rSet )
-
- ,maSecurityOptionsFL( this, SVX_RES( FL_SEC_SECURITYOPTIONS ) )
- ,maSecurityOptionsFI( this, SVX_RES( FI_SEC_SECURITYOPTIONS ) )
- ,maSecurityOptionsPB( this, SVX_RES( PB_SEC_SECURITYOPTIONS ) )
-
- ,maPasswordsFL ( this, SVX_RES( FL_SEC_PASSWORDS ) )
- ,maSavePasswordsCB ( this, SVX_RES( CB_SEC_SAVEPASSWORDS ) )
- ,maShowConnectionsPB( this, SVX_RES( PB_SEC_CONNECTIONS ) )
- ,maMasterPasswordCB ( this, SVX_RES( CB_SEC_MASTERPASSWORD ) )
- ,maMasterPasswordFI ( this, SVX_RES( FI_SEC_MASTERPASSWORD ) )
- ,maMasterPasswordPB ( this, SVX_RES( PB_SEC_MASTERPASSWORD ) )
-
- ,maMacroSecFL ( this, SVX_RES( FL_SEC_MACROSEC ) )
- ,maMacroSecFI ( this, SVX_RES( FI_SEC_MACROSEC ) )
- ,maMacroSecPB ( this, SVX_RES( PB_SEC_MACROSEC ) )
- ,maFilesharingFL ( this, SVX_RES( FL_SEC_FILESHARING ) )
- ,maRecommReadOnlyCB ( this, SVX_RES( CB_SEC_RECOMMREADONLY ) )
- ,maRecordChangesCB ( this, SVX_RES( CB_SEC_RECORDCHANGES ) )
- ,maProtectRecordsPB ( this, SVX_RES( PB_SEC_PROTRECORDS ) )
-
- ,mpSecOptions ( new SvtSecurityOptions )
- ,mpSecOptDlg ( NULL )
- ,meRedlingMode ( RL_NONE )
-
- ,msProtectRecordsStr( SVX_RES( STR_SEC_PROTRECORDS ) )
- ,msUnprotectRecordsStr( SVX_RES( STR_SEC_UNPROTRECORDS ) )
- ,msPasswordStoringDeactivateStr( SVX_RES( STR_SEC_NOPASSWDSAVE ) )
-
-{
- FreeResource();
-
- InitControls();
-
- maSecurityOptionsPB.SetClickHdl( LINK( this, SvxSecurityTabPage, SecurityOptionsHdl ) );
- maSavePasswordsCB.SetClickHdl( LINK( this, SvxSecurityTabPage, SavePasswordHdl ) );
- maMasterPasswordPB.SetClickHdl( LINK( this, SvxSecurityTabPage, MasterPasswordHdl ) );
- maMasterPasswordCB.SetClickHdl( LINK( this, SvxSecurityTabPage, MasterPasswordCBHdl ) );
- maShowConnectionsPB.SetClickHdl( LINK( this, SvxSecurityTabPage, ShowPasswordsHdl ) );
- maMacroSecPB.SetClickHdl( LINK( this, SvxSecurityTabPage, MacroSecPBHdl ) );
- maProtectRecordsPB.SetClickHdl( LINK( this, SvxSecurityTabPage, ProtectRecordsPBHdl ) );
- maRecordChangesCB.SetClickHdl( LINK( this, SvxSecurityTabPage, RecordChangesCBHdl ) );
-
- ActivatePage( rSet );
-}
-
-SvxSecurityTabPage::~SvxSecurityTabPage()
-{
- delete mpSecOptions;
- delete mpSecOptDlg;
-}
-
-IMPL_LINK( SvxSecurityTabPage, SecurityOptionsHdl, PushButton*, EMPTYARG )
-{
- if ( !mpSecOptDlg )
- mpSecOptDlg = new svx::SecurityOptionsDialog( this, mpSecOptions );
- mpSecOptDlg->Execute();
- return 0;
-}
-
-IMPL_LINK( SvxSecurityTabPage, SavePasswordHdl, void*, EMPTYARG )
-{
- try
- {
- Reference< task::XMasterPasswordHandling > xMasterPasswd(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- UNO_QUERY_THROW );
-
- if ( maSavePasswordsCB.IsChecked() )
- {
- sal_Bool bOldValue = xMasterPasswd->allowPersistentStoring( sal_True );
- xMasterPasswd->removeMasterPassword();
- if ( xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() ) )
- {
- maMasterPasswordPB.Enable( TRUE );
- maMasterPasswordCB.Check( TRUE );
- maMasterPasswordCB.Enable( TRUE );
- maMasterPasswordFI.Enable( TRUE );
- maShowConnectionsPB.Enable( TRUE );
- }
- else
- {
- xMasterPasswd->allowPersistentStoring( bOldValue );
- maSavePasswordsCB.Check( FALSE );
- }
- }
- else
- {
- QueryBox aQuery( this, WB_YES_NO|WB_DEF_NO, msPasswordStoringDeactivateStr );
- USHORT nRet = aQuery.Execute();
-
- if( RET_YES == nRet )
- {
- xMasterPasswd->allowPersistentStoring( sal_False );
- maMasterPasswordCB.Check( TRUE );
- maMasterPasswordPB.Enable( FALSE );
- maMasterPasswordCB.Enable( FALSE );
- maMasterPasswordFI.Enable( FALSE );
- maShowConnectionsPB.Enable( FALSE );
- }
- else
- {
- maSavePasswordsCB.Check( TRUE );
- maMasterPasswordPB.Enable( TRUE );
- maShowConnectionsPB.Enable( TRUE );
- }
- }
- }
- catch( Exception& )
- {
- maSavePasswordsCB.Check( !maSavePasswordsCB.IsChecked() );
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxSecurityTabPage, MasterPasswordHdl, PushButton*, EMPTYARG )
-{
- try
- {
- Reference< task::XMasterPasswordHandling > xMasterPasswd(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- UNO_QUERY );
-
- if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() )
- xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() );
- }
- catch( Exception& )
- {}
-
- return 0;
-}
-
-IMPL_LINK( SvxSecurityTabPage, MasterPasswordCBHdl, void*, EMPTYARG )
-{
- try
- {
- Reference< task::XMasterPasswordHandling2 > xMasterPasswd(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- UNO_QUERY_THROW );
-
- if ( maMasterPasswordCB.IsChecked() )
- {
- if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() ) )
- {
- maMasterPasswordPB.Enable( TRUE );
- maMasterPasswordFI.Enable( TRUE );
- }
- else
- {
- maMasterPasswordCB.Check( FALSE );
- maMasterPasswordPB.Enable( TRUE );
- maMasterPasswordFI.Enable( TRUE );
- }
- }
- else
- {
- if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->useDefaultMasterPassword( Reference< task::XInteractionHandler >() ) )
- {
- maMasterPasswordPB.Enable( FALSE );
- maMasterPasswordFI.Enable( FALSE );
- }
- else
- {
- maMasterPasswordCB.Check( TRUE );
- maMasterPasswordPB.Enable( TRUE );
- maShowConnectionsPB.Enable( TRUE );
- }
- }
- }
- catch( Exception& )
- {
- maSavePasswordsCB.Check( !maSavePasswordsCB.IsChecked() );
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxSecurityTabPage, ShowPasswordsHdl, PushButton*, EMPTYARG )
-{
- try
- {
- Reference< task::XMasterPasswordHandling > xMasterPasswd(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- UNO_QUERY );
-
- if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) )
- {
- svx::WebConnectionInfoDialog aDlg( this );
- aDlg.Execute();
- }
- }
- catch( Exception& )
- {}
- return 0;
-}
-
-IMPL_LINK( SvxSecurityTabPage, MacroSecPBHdl, void*, EMPTYARG )
-{
- Reference< security::XDocumentDigitalSignatures > xD(
- comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), UNO_QUERY );
- if ( xD.is() )
- xD->manageTrustedSources();
-
- return 0;
-}
-
-namespace
-{
- enum RedlineFunc { RF_ON, RF_PROTECT };
-
- const SfxBoolItem* ExecuteRecordChangesFunc( SvxSecurityTabPage::RedliningMode _eMode, RedlineFunc _eFunc, BOOL _bVal, Window* _pParent = NULL )
- {
- const SfxBoolItem* pRet = NULL;
-
- if( _eMode != SvxSecurityTabPage::RL_NONE )
- {
- USHORT nSlot;
- if ( _eMode == SvxSecurityTabPage::RL_WRITER )
- nSlot = ( _eFunc == RF_ON )? FN_REDLINE_ON : FN_REDLINE_PROTECT;
- else
- nSlot = ( _eFunc == RF_ON )? FID_CHG_RECORD : SID_CHG_PROTECT;
-
- // execute
- SfxViewShell* pViewSh = SfxViewShell::Current();
- if( pViewSh )
- {
- bool bNeedItem = ( _eMode == SvxSecurityTabPage::RL_WRITER || _eFunc != RF_ON );
- SfxBoolItem* pItem = bNeedItem ? new SfxBoolItem( nSlot, _bVal ) : NULL;
- SfxDispatcher* pDisp = pViewSh->GetDispatcher();
- if ( _pParent )
- {
- OfaPtrItem aParentItem( SID_ATTR_PARENTWINDOW, _pParent );
- pRet = static_cast< const SfxBoolItem* >(
- pDisp->Execute( nSlot, SFX_CALLMODE_SYNCHRON, &aParentItem, pItem, 0L ) );
- }
- else
- pRet = static_cast< const SfxBoolItem* >(
- pDisp->Execute( nSlot, SFX_CALLMODE_SYNCHRON, pItem, 0L ) );
- delete pItem;
- }
- }
-
- return pRet;
- }
-
- bool QueryState( USHORT _nSlot, bool& _rValue )
- {
- bool bRet = false;
-
- SfxViewShell* pViewSh = SfxViewShell::Current();
- if( pViewSh )
- {
- const SfxPoolItem* pItem;
- SfxDispatcher* pDisp = pViewSh->GetDispatcher();
- bRet = SFX_ITEM_AVAILABLE <= pDisp->QueryState( _nSlot, pItem );
- if( bRet )
- _rValue = ( static_cast< const SfxBoolItem* >( pItem ) )->GetValue();
- }
-
- return bRet;
- }
-
- bool QueryRecordChangesProtectionState( SvxSecurityTabPage::RedliningMode _eMode, bool& _rValue )
- {
- bool bRet = false;
-
- if( _eMode != SvxSecurityTabPage::RL_NONE )
- {
- USHORT nSlot = ( _eMode == SvxSecurityTabPage::RL_WRITER )? FN_REDLINE_PROTECT : SID_CHG_PROTECT;
- bRet = QueryState( nSlot, _rValue );
- }
-
- return bRet;
- }
-
- bool QueryRecordChangesState( SvxSecurityTabPage::RedliningMode _eMode, bool& _rValue )
- {
- bool bRet = false;
-
- if( _eMode != SvxSecurityTabPage::RL_NONE )
- {
- USHORT nSlot = ( _eMode == SvxSecurityTabPage::RL_WRITER )? FN_REDLINE_ON : FID_CHG_RECORD;
- bRet = QueryState( nSlot, _rValue );
- }
-
- return bRet;
- }
-}
-
-IMPL_LINK( SvxSecurityTabPage, RecordChangesCBHdl, void*, EMPTYARG )
-{
- ExecuteRecordChangesFunc( meRedlingMode, RF_ON, maRecordChangesCB.IsChecked(), this );
- CheckRecordChangesState();
- return 0;
-}
-
-IMPL_LINK( SvxSecurityTabPage, ProtectRecordsPBHdl, void*, EMPTYARG )
-{
- bool bProt;
- QueryRecordChangesProtectionState( meRedlingMode, bProt );
- ExecuteRecordChangesFunc( meRedlingMode, RF_PROTECT, !bProt, this );
- CheckRecordChangesState();
-
- if ( QueryRecordChangesProtectionState( meRedlingMode, bProt ) )
- {
- // RecordChangesCB is enabled if protection is off
- maRecordChangesCB.Enable( !bProt );
- // toggle text of button "Protect" <-> "Unprotect"
- String sNewText = bProt ? msUnprotectRecordsStr : msProtectRecordsStr;
- maProtectRecordsPB.SetText( sNewText );
- }
- return 0;
-}
-
-void SvxSecurityTabPage::CheckRecordChangesState( void )
-{
- bool bVal;
- if( QueryRecordChangesState( meRedlingMode, bVal ) )
- {
- maRecordChangesCB.Enable();
- maRecordChangesCB.Check( bVal );
- }
- else
- maRecordChangesCB.Disable(); // because now we don't know the state!
-
- maProtectRecordsPB.Enable( QueryRecordChangesProtectionState( meRedlingMode, bVal ) );
-}
-
-void SvxSecurityTabPage::InitControls()
-{
- // Hide all controls which belong to the macro security button in case the macro
- // security settings managed by the macro security dialog opened via the button
- // are all readonly or if the macros are disabled in general.
- // @@@ Better would be to query the dialog whether it is 'useful' or not. Exposing
- // macro security dialog implementations here, which is bad.
- if ( mpSecOptions->IsMacroDisabled()
- || ( mpSecOptions->IsReadOnly( SvtSecurityOptions::E_MACRO_SECLEVEL )
- && mpSecOptions->IsReadOnly( SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS )
- && mpSecOptions->IsReadOnly( SvtSecurityOptions::E_SECUREURLS ) ) )
- {
- maMacroSecFL.Hide();
- maMacroSecFI.Hide();
- maMacroSecPB.Hide();
-
- // rearrange the following controls
- Point aNewPos = maFilesharingFL.GetPosPixel();
- long nDelta = aNewPos.Y() - maMacroSecFL.GetPosPixel().Y();
-
- Window* pWins[] =
- {
- &maFilesharingFL, &maRecommReadOnlyCB, &maRecordChangesCB, &maProtectRecordsPB
- };
- Window** pCurrent = pWins;
- const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
- for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
- {
- aNewPos = (*pCurrent)->GetPosPixel();
- aNewPos.Y() -= nDelta;
- (*pCurrent)->SetPosPixel( aNewPos );
- }
- }
-
- // one button too small for its text?
- sal_Int32 i = 0;
- long nBtnTextWidth = 0;
- Window* pButtons[] = { &maSecurityOptionsPB, &maMasterPasswordPB,
- &maShowConnectionsPB, &maMacroSecPB, &maProtectRecordsPB };
- Window** pButton = pButtons;
- const sal_Int32 nBCount = sizeof( pButtons ) / sizeof( pButtons[ 0 ] );
- for ( ; i < nBCount; ++i, ++pButton )
- {
- long nTemp = (*pButton)->GetCtrlTextWidth( (*pButton)->GetText() );
- if ( nTemp > nBtnTextWidth )
- nBtnTextWidth = nTemp;
- }
-
- nBtnTextWidth = nBtnTextWidth * 115 / 100; // a little offset
- const long nButtonWidth = maSecurityOptionsPB.GetSizePixel().Width();
- const long nMaxWidth = nButtonWidth * 140 / 100;
- long nExtra = ( nBtnTextWidth > nMaxWidth ) ? nBtnTextWidth - nMaxWidth : 0;
- nBtnTextWidth = std::min( nBtnTextWidth, nMaxWidth );
-
- if ( nBtnTextWidth > nButtonWidth )
- {
- // so make the buttons broader and its control in front of it smaller
- long nDelta = nBtnTextWidth - nButtonWidth;
- pButton = pButtons;
-
- if ( nExtra > 0 )
- {
- long nPos = (*pButton)->GetPosPixel().X() - nDelta;
- long nWidth = (*pButton)->GetSizePixel().Width() + nDelta;
- long nMaxExtra = GetOutputSizePixel().Width() - ( nPos + nWidth ) - 2;
- nExtra = ( nExtra < nMaxExtra ) ? nExtra : nMaxExtra;
- }
-
- for ( i = 0; i < nBCount; ++i, ++pButton )
- {
- Point aNewPos = (*pButton)->GetPosPixel();
- aNewPos.X() -= nDelta;
- Size aNewSize = (*pButton)->GetSizePixel();
- aNewSize.Width() += ( nDelta + nExtra );
- (*pButton)->SetPosSizePixel( aNewPos, aNewSize );
- }
-
- Window* pControls[] = { &maSecurityOptionsFI, &maSavePasswordsCB,
- &maMasterPasswordFI, &maMacroSecFI,
- &maRecommReadOnlyCB, &maRecordChangesCB };
- Window** pControl = pControls;
- const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[ 0 ] );
- for ( i = 0; i < nCCount; ++i, ++pControl )
- {
- Size aNewSize = (*pControl)->GetSizePixel();
- aNewSize.Width() -= nDelta;
- (*pControl)->SetSizePixel( aNewSize );
- }
- }
-
- maMasterPasswordPB.Enable( FALSE );
- maMasterPasswordCB.Enable( FALSE );
- maMasterPasswordCB.Check( TRUE );
- maMasterPasswordFI.Enable( FALSE );
- maShowConnectionsPB.Enable( FALSE );
-
- // initialize the password saving checkbox
- try
- {
- Reference< task::XMasterPasswordHandling > xMasterPasswd(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- UNO_QUERY_THROW );
-
- if ( xMasterPasswd->isPersistentStoringAllowed() )
- {
- maMasterPasswordCB.Enable( TRUE );
- maShowConnectionsPB.Enable( TRUE );
- maSavePasswordsCB.Check( TRUE );
-
- Reference< task::XMasterPasswordHandling2 > xMasterPasswd2( xMasterPasswd, UNO_QUERY );
- if ( xMasterPasswd2.is() && xMasterPasswd2->isDefaultMasterPasswordUsed() )
- maMasterPasswordCB.Check( FALSE );
- else
- {
- maMasterPasswordPB.Enable( TRUE );
- maMasterPasswordCB.Check( TRUE );
- maMasterPasswordFI.Enable( TRUE );
- }
- }
- }
- catch( Exception& )
- {
- maSavePasswordsCB.Enable( FALSE );
- }
-
-
-}
-
-SfxTabPage* SvxSecurityTabPage::Create(Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxSecurityTabPage(pParent, rAttrSet);
-}
-
-void SvxSecurityTabPage::ActivatePage( const SfxItemSet& )
-{
-}
-
-int SvxSecurityTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-namespace
-{
-/* bool Enable( const SvtSecurityOptions& _rOpt, SvtSecurityOptions::EOption _eOpt, Control& _rCtrl, FixedImage& _rImg )
- {
- bool b = _rOpt.IsOptionEnabled( _eOpt );
- _rCtrl.Enable( b );
- _Img.Show( !b );
- return b;
- }
-*/
- bool EnableAndSet( const SvtSecurityOptions& _rOpt, SvtSecurityOptions::EOption _eOpt,
- CheckBox& _rCtrl, FixedImage& _rImg )
- {
-// bool b = Enable( _rOpt, _eOpt, _rCtrl, _rImg );
- bool b = _rOpt.IsOptionEnabled( _eOpt );
- _rCtrl.Enable( b );
- _rImg.Show( !b );
- _rCtrl.Check( _rOpt.IsOptionSet( _eOpt ) );
- return b;
- }
-
- bool CheckAndSave( SvtSecurityOptions& _rOpt, SvtSecurityOptions::EOption _eOpt, const bool _bIsChecked, bool& _rModfied )
- {
- bool bModified = false;
- if ( _rOpt.IsOptionEnabled( _eOpt ) )
- {
- bModified = _rOpt.IsOptionSet( _eOpt ) != _bIsChecked;
- if ( bModified )
- {
- _rOpt.SetOption( _eOpt, _bIsChecked );
- _rModfied = true;
- }
- }
-
- return bModified;
- }
-}
-
-BOOL SvxSecurityTabPage::FillItemSet( SfxItemSet& )
-{
- bool bModified = false;
-
- if ( mpSecOptDlg )
- {
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, mpSecOptDlg->IsSaveOrSendDocsChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, mpSecOptDlg->IsSignDocsChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_PRINT, mpSecOptDlg->IsPrintDocsChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, mpSecOptDlg->IsCreatePdfChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, mpSecOptDlg->IsRemovePersInfoChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, mpSecOptDlg->IsRecommPasswdChecked(), bModified );
- CheckAndSave( *mpSecOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, mpSecOptDlg->IsCtrlHyperlinkChecked(), bModified );
- }
-
- // document options
- SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
- if( pCurDocShell )
- {
- if( pCurDocShell->HasSecurityOptOpenReadOnly() )
- pCurDocShell->SetSecurityOptOpenReadOnly( maRecommReadOnlyCB.IsChecked() );
-
- }
-
- return bModified;
-}
-
-/*--------------------------------------------------------------------*/
-
-void SvxSecurityTabPage::Reset( const SfxItemSet& )
-{
- String sNewText = msProtectRecordsStr;
- SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
- if( pCurDocShell )
- {
- bool bIsHTMLDoc = false;
- SfxViewShell* pViewSh = SfxViewShell::Current();
- if( pViewSh )
- {
- const SfxPoolItem* pItem;
- SfxDispatcher* pDisp = pViewSh->GetDispatcher();
- if ( SFX_ITEM_AVAILABLE <= pDisp->QueryState( SID_HTML_MODE, pItem ) )
- {
- USHORT nMode = static_cast< const SfxUInt16Item* >( pItem )->GetValue();
- bIsHTMLDoc = ( ( nMode & HTMLMODE_ON ) != 0 );
- }
- }
-
- sal_Bool bIsReadonly = pCurDocShell->IsReadOnly();
- if( pCurDocShell->HasSecurityOptOpenReadOnly() && !bIsHTMLDoc )
- {
- maRecommReadOnlyCB.Check( pCurDocShell->IsSecurityOptOpenReadOnly() );
- maRecommReadOnlyCB.Enable( !bIsReadonly );
- }
- else
- maRecommReadOnlyCB.Disable();
-
- bool bVal;
- if ( QueryRecordChangesState( RL_WRITER, bVal ) && !bIsHTMLDoc )
- meRedlingMode = RL_WRITER;
- else if( QueryRecordChangesState( RL_CALC, bVal ) )
- meRedlingMode = RL_CALC;
- else
- meRedlingMode = RL_NONE;
-
- if ( meRedlingMode != RL_NONE )
- {
- maRecordChangesCB.Check( bVal );
- maRecordChangesCB.Enable( !bVal && !bIsReadonly );
- maProtectRecordsPB.Enable(
- QueryRecordChangesProtectionState( meRedlingMode, bVal ) && !bIsReadonly );
- // set the right text
- if ( bVal )
- sNewText = msUnprotectRecordsStr;
- }
- else
- {
- // only Writer and Calc support redlining
- maRecordChangesCB.Disable();
- maProtectRecordsPB.Disable();
- }
- }
- else
- { // no doc -> hide document settings
- maRecommReadOnlyCB.Disable();
- maRecordChangesCB.Disable();
- maProtectRecordsPB.Disable();
- }
-
- maProtectRecordsPB.SetText( sNewText );
-}
-
-//added by jmeng begin
-MozPluginTabPage::MozPluginTabPage(Window* pParent, const SfxItemSet& rSet)
- : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_INET_MOZPLUGIN ), rSet ),
- aMSWordGB ( this, SVX_RES( GB_MOZPLUGIN ) ),
- aWBasicCodeCB ( this, SVX_RES( CB_MOZPLUGIN_CODE ) )
-{
- FreeResource();
-}
-
-MozPluginTabPage::~MozPluginTabPage()
-{
-}
-
-SfxTabPage* MozPluginTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return new MozPluginTabPage( pParent, rAttrSet );
-}
-BOOL MozPluginTabPage::FillItemSet( SfxItemSet& )
-{
- BOOL hasInstall = isInstalled();
- BOOL hasChecked = aWBasicCodeCB.IsChecked();
- if(hasInstall && (!hasChecked)){
- //try to uninstall
- uninstallPlugin();
- }
- else if((!hasInstall) && hasChecked){
- //try to install
- installPlugin();
- }
- else{
- // do nothing
- }
- return TRUE;
-}
-void MozPluginTabPage::Reset( const SfxItemSet& )
-{
- aWBasicCodeCB.Check( isInstalled());
- aWBasicCodeCB.SaveValue();
-}
-
-#ifdef WNT
-extern "C" {
- int lc_isInstalled(const char* realFilePath);
- int lc_installPlugin(const char* realFilePath);
- int lc_uninstallPlugin(const char* realFilePath);
-}
-#endif
-
-#define NPP_PATH_MAX 2048
-inline bool getDllURL(rtl::OString * path)
-{
- OSL_ASSERT(path != NULL);
- ::rtl::OUString dirPath/*dllPath, */;
- if (osl_getExecutableFile(&dirPath.pData) != osl_Process_E_None) {
- return false;
- }
- dirPath = dirPath.copy(0, dirPath.lastIndexOf('/'));
-// osl::FileBase::getAbsoluteFileURL(dirPath, libPath, dllPath);
- ::rtl::OUString sysDirPath;
- osl::FileBase::getSystemPathFromFileURL(dirPath, sysDirPath);
- *path = OUStringToOString(sysDirPath, RTL_TEXTENCODING_ASCII_US);
- return true;
-}
-
-BOOL MozPluginTabPage::isInstalled()
-{
-#ifdef UNIX
- // get the real file referred by .so lnk file
- char lnkFilePath[NPP_PATH_MAX] = {0};
- char lnkReferFilePath[NPP_PATH_MAX] = {0};
- char* pHome = getpwuid(getuid())->pw_dir;
- strcat(lnkFilePath, pHome);
- strcat(lnkFilePath, "/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION);
-
- struct stat sBuf;
- if (0 > lstat(lnkFilePath, &sBuf))
- return false;
- if (!S_ISLNK(sBuf.st_mode))
- return false;
- if (0 >= readlink(lnkFilePath, lnkReferFilePath, NPP_PATH_MAX))
- return false;
- // If the link is relative, then we regard it as non-standard
- if (lnkReferFilePath[0] != '/')
- return false;
-
- // get the real file path
- char realFilePath[NPP_PATH_MAX] = {0};
- ::rtl::OString tempString;
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- strcat(realFilePath, "/libnpsoplugin" SAL_DLLEXTENSION);
-
- if (0 != strcmp(lnkReferFilePath, realFilePath))
- return false;
- return true;
-#endif
-#ifdef WNT
- // get the value from registry
- BOOL ret = true;
- ::rtl::OString tempString;
- char realFilePath[NPP_PATH_MAX] = {0};
- if (!getDllURL(&tempString)){
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- if(! lc_isInstalled(realFilePath))
- ret =true;
- else
- ret = false;
- return ret;
-#endif
-}
-
-BOOL MozPluginTabPage::installPlugin()
-{
-#ifdef UNIX
- // get the real file referred by .so lnk file
- char lnkFilePath[NPP_PATH_MAX] = {0};
- char* pHome = getpwuid(getuid())->pw_dir;
- strcat(lnkFilePath, pHome);
- strcat(lnkFilePath, "/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION);
- remove(lnkFilePath);
-
- // create the dirs if necessary
- struct stat buf;
- char tmpDir[NPP_PATH_MAX] = {0};
- sprintf(tmpDir, "%s/.mozilla", pHome);
- if (0 > stat(lnkFilePath, &buf))
- {
- mkdir(tmpDir, 0755);
- strcat(tmpDir, "/plugins");
- mkdir(tmpDir, 0755);
- }
-
- // get the real file path
- char realFilePath[NPP_PATH_MAX] = {0};
- ::rtl::OString tempString;
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- strcat(realFilePath, "/libnpsoplugin" SAL_DLLEXTENSION);
-
- // create the link
- if (0 != symlink(realFilePath, lnkFilePath))
- return false;
- return true;
-#endif
-#ifdef WNT
- ::rtl::OString tempString;
- char realFilePath[NPP_PATH_MAX] = {0};
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- if( !lc_installPlugin(realFilePath))
- return true;
- else
- return false;
-#endif
-}
-
-BOOL MozPluginTabPage::uninstallPlugin()
-{
-#ifdef UNIX
- // get the real file referred by .so lnk file
- char lnkFilePath[NPP_PATH_MAX] = {0};
- char* pHome = getpwuid(getuid())->pw_dir;
- strcat(lnkFilePath, pHome);
- strcat(lnkFilePath, "/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION);
-
- if(0 > remove(lnkFilePath))
- return false;
- return true;
-#endif
-#ifdef WNT
- ::rtl::OString tempString;
- char realFilePath[NPP_PATH_MAX] = {0};
- if (!getDllURL(&tempString)) {
- return false;
- }
- strncpy(realFilePath, tempString.getStr(), NPP_PATH_MAX);
- if(!lc_uninstallPlugin(realFilePath))
- return true;
- else
- return false;
-#endif
-}
-//added by jmeng end
-
-/* -------------------------------------------------------------------------*/
-
-class MailerProgramCfg_Impl : public utl::ConfigItem
-{
- friend class SvxEMailTabPage;
- // variables
- OUString sProgram;
- // readonly states
- sal_Bool bROProgram;
-
- const Sequence<OUString> GetPropertyNames();
-public:
- MailerProgramCfg_Impl();
- virtual ~MailerProgramCfg_Impl();
-
- virtual void Commit();
-
-};
-
-/* -------------------------------------------------------------------------*/
-
-MailerProgramCfg_Impl::MailerProgramCfg_Impl() :
- utl::ConfigItem(C2U("Office.Common/ExternalMailer")),
- bROProgram(sal_False)
-{
- const Sequence< OUString > aNames = GetPropertyNames();
- const Sequence< Any > aValues = GetProperties(aNames);
- const Sequence< sal_Bool > aROStates = GetReadOnlyStates(aNames);
- const Any* pValues = aValues.getConstArray();
- const sal_Bool* pROStates = aROStates.getConstArray();
- for(sal_Int32 nProp = 0; nProp < aValues.getLength(); nProp++)
- {
- if(pValues[nProp].hasValue())
- {
- switch(nProp)
- {
- case 0 :
- {
- pValues[nProp] >>= sProgram;
- bROProgram = pROStates[nProp];
- }
- break;
- }
- }
- }
-}
-
-/* -------------------------------------------------------------------------*/
-
-MailerProgramCfg_Impl::~MailerProgramCfg_Impl()
-{
-}
-
-/* -------------------------------------------------------------------------*/
-
-const Sequence<OUString> MailerProgramCfg_Impl::GetPropertyNames()
-{
- Sequence<OUString> aRet(1);
- OUString* pRet = aRet.getArray();
- pRet[0] = C2U("Program");
- return aRet;
-}
-
-/* -------------------------------------------------------------------------*/
-
-void MailerProgramCfg_Impl::Commit()
-{
- const Sequence< OUString > aOrgNames = GetPropertyNames();
- sal_Int32 nOrgCount = aOrgNames.getLength();
-
- Sequence< OUString > aNames(nOrgCount);
- Sequence< Any > aValues(nOrgCount);
- sal_Int32 nRealCount = 0;
-
- for(int nProp = 0; nProp < nOrgCount; nProp++)
- {
- switch(nProp)
- {
- case 0:
- {
- if (!bROProgram)
- {
- aNames[nRealCount] = aOrgNames[nProp];
- aValues[nRealCount] <<= sProgram;
- ++nRealCount;
- }
- }
- break;
- }
- }
-
- aNames.realloc(nRealCount);
- aValues.realloc(nRealCount);
- PutProperties(aNames, aValues);
-}
-
-/* -------------------------------------------------------------------------*/
-
-struct SvxEMailTabPage_Impl
-{
- MailerProgramCfg_Impl aMailConfig;
-};
-
-SvxEMailTabPage::SvxEMailTabPage(Window* pParent, const SfxItemSet& rSet) :
- SfxTabPage(pParent, SVX_RES( RID_SVXPAGE_INET_MAIL ), rSet),
- aMailFL(this, SVX_RES(FL_MAIL )),
- aMailerURLFI(this, SVX_RES(FI_MAILERURL )),
- aMailerURLFT(this, SVX_RES(FT_MAILERURL )),
- aMailerURLED(this, SVX_RES(ED_MAILERURL )),
- aMailerURLPB(this, SVX_RES(PB_MAILERURL )),
- m_sDefaultFilterName( SVX_RES(STR_DEFAULT_FILENAME )),
- pImpl(new SvxEMailTabPage_Impl)
-{
- FreeResource();
-
- aMailerURLPB.SetClickHdl( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) );
-
- // FixedText not wide enough?
- long nTxtW = aMailerURLFT.GetCtrlTextWidth( aMailerURLFT.GetText() );
- long nCtrlW = aMailerURLFT.GetSizePixel().Width();
- if ( nTxtW >= nCtrlW )
- {
- long nDelta = Max( (long)10, nTxtW - nCtrlW );
- // so FixedText wider
- Size aNewSz = aMailerURLFT.GetSizePixel();
- aNewSz.Width() += nDelta;
- aMailerURLFT.SetSizePixel( aNewSz );
- // and Edit smaller
- aNewSz = aMailerURLED.GetSizePixel();
- aNewSz.Width() -= nDelta;
- Point aNewPt = aMailerURLED.GetPosPixel();
- aNewPt.X() += nDelta;
- aMailerURLED.SetPosSizePixel( aNewPt, aNewSz );
- }
-}
-
-/* -------------------------------------------------------------------------*/
-
-SvxEMailTabPage::~SvxEMailTabPage()
-{
- delete pImpl;
-}
-
-/* -------------------------------------------------------------------------*/
-
-SfxTabPage* SvxEMailTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxEMailTabPage(pParent, rAttrSet);
-}
-
-/* -------------------------------------------------------------------------*/
-
-BOOL SvxEMailTabPage::FillItemSet( SfxItemSet& )
-{
- BOOL bMailModified = FALSE;
- if(!pImpl->aMailConfig.bROProgram && aMailerURLED.GetSavedValue() != aMailerURLED.GetText())
- {
- pImpl->aMailConfig.sProgram = aMailerURLED.GetText();
- bMailModified = TRUE;
- }
- if ( bMailModified )
- pImpl->aMailConfig.Commit();
-
- return FALSE;
-}
-
-/* -------------------------------------------------------------------------*/
-
-void SvxEMailTabPage::Reset( const SfxItemSet& )
-{
- aMailerURLED.Enable(TRUE );
- aMailerURLPB.Enable(TRUE );
-
- if(pImpl->aMailConfig.bROProgram)
- aMailerURLFI.Show();
-
- aMailerURLED.SetText(pImpl->aMailConfig.sProgram);
- aMailerURLED.SaveValue();
- aMailerURLED.Enable(!pImpl->aMailConfig.bROProgram);
- aMailerURLPB.Enable(!pImpl->aMailConfig.bROProgram);
- aMailerURLFT.Enable(!pImpl->aMailConfig.bROProgram);
-
- aMailFL.Enable(aMailerURLFT.IsEnabled() ||
- aMailerURLED.IsEnabled() ||
- aMailerURLPB.IsEnabled());
-}
-
-/* -------------------------------------------------------------------------*/
-
-IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton )
-{
- if ( &aMailerURLPB == pButton && !pImpl->aMailConfig.bROProgram )
- {
- FileDialogHelper aHelper(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- WB_OPEN );
- String sPath = aMailerURLED.GetText();
- if ( !sPath.Len() )
- sPath.AppendAscii("/usr/bin");
-
- String sUrl;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL(sPath,sUrl);
- aHelper.SetDisplayDirectory(sUrl);
- aHelper.AddFilter( m_sDefaultFilterName, String::CreateFromAscii("*"));
-
- if ( ERRCODE_NONE == aHelper.Execute() )
- {
- sUrl = aHelper.GetPath();
- ::utl::LocalFileHelper::ConvertURLToPhysicalName(sUrl,sPath);
- aMailerURLED.SetText(sPath);
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
diff --git a/svx/source/cui/optinet2.hxx b/svx/source/cui/optinet2.hxx
deleted file mode 100644
index 53f9cc695c..0000000000
--- a/svx/source/cui/optinet2.hxx
+++ /dev/null
@@ -1,357 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optinet2.hxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTINET_HXX
-#define _SVX_OPTINET_HXX
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <vcl/lstbox.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <svtools/svarray.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svtools/svtabbx.hxx>
-#include <sfx2/tabdlg.hxx>
-#ifndef _SVX_SRCHNCFG_HXX
-#include "srchcfg.hxx"
-#endif
-
-#ifdef _SVX_OPTINET2_CXX
-#include <svtools/headbar.hxx>
-#else
-class HeaderBar;
-#endif
-#include <readonlyimage.hxx>
-
-class SfxFilter;
-class SvtInetOptions;
-
-#ifndef SV_NODIALOG
-#define PROXY_CONTROLS 23
-#define CACHE_CONTROLS 20
-#define INET_SEARCH 19
-
-#if defined(OS2)
-#define TYPE_CONTROLS 20
-#else
-#define TYPE_CONTROLS 18
-#endif
-
-namespace svx {
- class SecurityOptionsDialog;
-}
-
-namespace lang = ::com::sun::star::lang;
-namespace uno = ::com::sun::star::uno;
-
-// class SvxNoSpaceEdit --------------------------------------------------
-
-class SvxNoSpaceEdit : public Edit
-{
-private:
- BOOL bOnlyNumeric;
-
-public:
- SvxNoSpaceEdit(Window* pParent, ResId rResId, BOOL bNum = FALSE ) :
- Edit( pParent, rResId ), bOnlyNumeric( bNum ) {}
-
- virtual void KeyInput( const KeyEvent& rKEvent );
- virtual void Modify();
-};
-
-typedef SfxFilter* SfxFilterPtr;
-SV_DECL_PTRARR( SfxFilterPtrArr, SfxFilterPtr, 0, 4 )
-
-// class SvxProxyTabPage -------------------------------------------------
-
-class SvxProxyTabPage : public SfxTabPage
-{
-private:
- FixedLine aOptionGB;
-
- FixedText aProxyModeFT;
- ListBox aProxyModeLB;
-
- FixedText aHttpProxyFT;
- SvxNoSpaceEdit aHttpProxyED;
- FixedText aHttpPortFT;
- SvxNoSpaceEdit aHttpPortED;
-
- FixedText aHttpsProxyFT;
- SvxNoSpaceEdit aHttpsProxyED;
- FixedText aHttpsPortFT;
- SvxNoSpaceEdit aHttpsPortED;
-
-
- FixedText aFtpProxyFT;
- SvxNoSpaceEdit aFtpProxyED;
- FixedText aFtpPortFT;
- SvxNoSpaceEdit aFtpPortED;
-
- FixedText aNoProxyForFT;
- Edit aNoProxyForED;
- FixedText aNoProxyDescFT;
-
- String sFromBrowser;
-
- const rtl::OUString aProxyModePN;
- const rtl::OUString aHttpProxyPN;
- const rtl::OUString aHttpPortPN;
- const rtl::OUString aHttpsProxyPN;
- const rtl::OUString aHttpsPortPN;
- const rtl::OUString aFtpProxyPN;
- const rtl::OUString aFtpPortPN;
- const rtl::OUString aNoProxyDescPN;
-
- uno::Reference< uno::XInterface > m_xConfigurationUpdateAccess;
-
-#ifdef _SVX_OPTINET2_CXX
- void ArrangeControls_Impl();
- void EnableControls_Impl(BOOL bEnable);
- void ReadConfigData_Impl();
- void ReadConfigDefaults_Impl();
- void RestoreConfigDefaults_Impl();
-
- DECL_LINK( ProxyHdl_Impl, ListBox * );
- DECL_LINK( LoseFocusHdl_Impl, Edit * );
-#endif
-
- SvxProxyTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxProxyTabPage();
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-// class SvxSearchTabPage ------------------------------------------------
-class SvxSearchConfig;
-class SvxSearchTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aSearchGB;
- ListBox aSearchLB;
- FixedText aSearchNameFT;
- SvxNoSpaceEdit aSearchNameED;
-
- FixedText aSearchFT;
- RadioButton aAndRB;
- RadioButton aOrRB;
- RadioButton aExactRB;
-
- FixedText aURLFT;
- SvxNoSpaceEdit aURLED;
-
- FixedText aPostFixFT;
- SvxNoSpaceEdit aPostFixED;
- FixedText aSeparatorFT;
- SvxNoSpaceEdit aSeparatorED;
- FixedText aCaseFT;
- ListBox aCaseED;
-
- PushButton aNewPB;
- PushButton aAddPB;
- PushButton aChangePB;
- PushButton aDeletePB;
-
- String sLastSelectedEntry;
- String sModifyMsg;
-
- SvxSearchConfig aSearchConfig;
- SvxSearchEngineData aCurrentSrchData;
-
-#ifdef _SVX_OPTINET2_CXX
- void InitControls_Impl();
-
- DECL_LINK( NewSearchHdl_Impl, PushButton * );
- DECL_LINK( AddSearchHdl_Impl, PushButton * );
- DECL_LINK( ChangeSearchHdl_Impl, PushButton * );
- DECL_LINK( DeleteSearchHdl_Impl, PushButton * );
- DECL_LINK( SearchEntryHdl_Impl, ListBox * );
- DECL_LINK( SearchModifyHdl_Impl, SvxNoSpaceEdit * );
- DECL_LINK( SearchPartHdl_Impl, RadioButton * );
-#endif
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
- BOOL ConfirmLeave( const String& rStringSelection ); //add by BerryJia for fixing Bug102610 Time:2002-8-29 11:00 (China Standard Time GMT+08:00)
-
- SvxSearchTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxSearchTabPage();
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-// #98647# class SvxScriptExecListBox ------------------------------------
-class SvxScriptExecListBox : public ListBox
-{ // for adding tooltips to ListBox
-public:
- SvxScriptExecListBox( Window* pParent, WinBits nStyle = WB_BORDER )
- :ListBox(pParent, nStyle) {}
- SvxScriptExecListBox( Window* pParent, const ResId& rResId )
- :ListBox(pParent, rResId) {}
-
-protected:
- virtual void RequestHelp( const HelpEvent& rHEvt );
-};
-
-// class SvxSecurityTabPage ---------------------------------------------
-
-class SvtJavaOptions;
-class SvtSecurityOptions;
-
-class SvxSecurityTabPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-public:
- enum RedliningMode { RL_NONE, RL_WRITER, RL_CALC };
-
-private:
- FixedLine maSecurityOptionsFL;
- FixedInfo maSecurityOptionsFI;
- PushButton maSecurityOptionsPB;
-
- FixedLine maPasswordsFL;
- CheckBox maSavePasswordsCB;
- PushButton maShowConnectionsPB;
- CheckBox maMasterPasswordCB;
- FixedInfo maMasterPasswordFI;
- PushButton maMasterPasswordPB;
-
- FixedLine maMacroSecFL;
- FixedInfo maMacroSecFI;
- PushButton maMacroSecPB;
-
- FixedLine maFilesharingFL;
- CheckBox maRecommReadOnlyCB;
- CheckBox maRecordChangesCB;
- PushButton maProtectRecordsPB;
-
- SvtSecurityOptions* mpSecOptions;
- svx::SecurityOptionsDialog* mpSecOptDlg;
-
- RedliningMode meRedlingMode;
- String msProtectRecordsStr;
- String msUnprotectRecordsStr;
- String msPasswordStoringDeactivateStr;
-
- DECL_LINK( SecurityOptionsHdl, PushButton* );
- DECL_LINK( SavePasswordHdl, void* );
- DECL_LINK( MasterPasswordHdl, PushButton* );
- DECL_LINK( MasterPasswordCBHdl, void* );
- DECL_LINK( ShowPasswordsHdl, PushButton* );
- DECL_LINK( MacroSecPBHdl, void* );
- DECL_LINK( RecordChangesCBHdl, void* );
- DECL_LINK( ProtectRecordsPBHdl, void* );
-
- void CheckRecordChangesState( void );
- void InitControls();
-
- SvxSecurityTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxSecurityTabPage();
-
-protected:
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-//added by jmeng begin
-class MozPluginTabPage : public SfxTabPage
-{
- FixedLine aMSWordGB;
- CheckBox aWBasicCodeCB;
-
- BOOL isInstalled(void);
- BOOL installPlugin(void);
- BOOL uninstallPlugin(void);
-
- MozPluginTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~MozPluginTabPage();
-
-public:
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
-};
-//added by jmeng end
-#endif
-
-/* -----------------------------20.06.01 16:32--------------------------------
-
- ---------------------------------------------------------------------------*/
-#ifdef WNT
-#else
-#define HELPER_PAGE_COMPLETE
-#endif
-
-struct SvxEMailTabPage_Impl;
-class SvxEMailTabPage : public SfxTabPage
-{
- FixedLine aMailFL;
- ReadOnlyImage aMailerURLFI;
- FixedText aMailerURLFT;
- Edit aMailerURLED;
- PushButton aMailerURLPB;
-
- String m_sDefaultFilterName;
-
- SvxEMailTabPage_Impl* pImpl;
-
- DECL_LINK( FileDialogHdl_Impl, PushButton* ) ;
-
-public:
- SvxEMailTabPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxEMailTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-#endif // #ifndef _SVX_OPTINET_HXX
-
-
diff --git a/svx/source/cui/optjava.cxx b/svx/source/cui/optjava.cxx
deleted file mode 100644
index d9b2acc3f0..0000000000
--- a/svx/source/cui/optjava.cxx
+++ /dev/null
@@ -1,1142 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjava.cxx,v $
- * $Revision: 1.21 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include "optjava.hxx"
-#include <svx/dialmgr.hxx>
-
-#include "optjava.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <vcl/svapp.hxx>
-#include <vcl/help.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/waitobj.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/imagemgr.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <comphelper/processfactory.hxx>
-#include <ucbhelper/contentbroker.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ucb/XContentProvider.hpp>
-#include <jvmfwk/framework.h>
-
-// define ----------------------------------------------------------------
-
-#define CLASSPATH_DELIMITER SAL_PATHSEPARATOR
-#define STRIM( s ) s.EraseLeadingChars().EraseTrailingChars()
-#define BUTTON_BORDER 2
-#define RESET_TIMEOUT 300
-
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::uno;
-
-// class SvxJavaTable ----------------------------------------------------
-
-SvxJavaTable::SvxJavaTable( Window* _pParent, const ResId& _rId ) :
-
- SvxSimpleTable( _pParent, _rId )
-
-{
-}
-
-SvxJavaTable::~SvxJavaTable()
-{
-}
-
-void SvxJavaTable::SetTabs()
-{
- SvxSimpleTable::SetTabs();
-/*
- USHORT nAdjust = SV_LBOXTAB_ADJUST_RIGHT | SV_LBOXTAB_ADJUST_LEFT |
- SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_NUMERIC | SV_LBOXTAB_FORCE;
- if ( aTabs.Count() > 0 )
- {
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_FORCE;
- }
-*/
-}
-
-void SvxJavaTable::MouseButtonUp( const MouseEvent& _rMEvt )
-{
- m_aCurMousePoint = _rMEvt.GetPosPixel();
- SvxSimpleTable::MouseButtonUp( _rMEvt );
-}
-
-void SvxJavaTable::KeyInput( const KeyEvent& rKEvt )
-{
- if ( !rKEvt.GetKeyCode().GetModifier() && KEY_SPACE == rKEvt.GetKeyCode().GetCode() )
- {
- SvLBoxEntry* pEntry = FirstSelected();
- if ( GetCheckButtonState( pEntry ) == SV_BUTTON_UNCHECKED )
- {
- SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
- GetCheckButtonHdl().Call( NULL );
- return ;
- }
- }
-
- SvxSimpleTable::KeyInput( rKEvt );
-}
-
-// -----------------------------------------------------------------------
-
-bool areListsEqual( const Sequence< ::rtl::OUString >& rListA, const Sequence< ::rtl::OUString >& rListB )
-{
- bool bRet = true;
- const sal_Int32 nLen = rListA.getLength();
-
- if ( rListB.getLength() != nLen )
- bRet = false;
- else
- {
- const ::rtl::OUString* pStringA = rListA.getConstArray();
- const ::rtl::OUString* pStringB = rListB.getConstArray();
-
- for ( sal_Int32 i = 0; i < nLen; ++i )
- {
- if ( *pStringA++ != *pStringB++ )
- {
- bRet = false;
- break;
- }
- }
- }
-
- return bRet;
-}
-
-// class SvxJavaOptionsPage ----------------------------------------------
-
-SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_OPTIONS_JAVA ), rSet ),
-
- m_aJavaLine ( this, SVX_RES( FL_JAVA ) ),
- m_aJavaEnableCB ( this, SVX_RES( CB_JAVA_ENABLE ) ),
- m_aJavaFoundLabel ( this, SVX_RES( FT_JAVA_FOUND ) ),
- m_aJavaList ( this, SVX_RES( LB_JAVA ) ),
- m_aJavaPathText ( this, SVX_RES( FT_JAVA_PATH ) ),
- m_aAddBtn ( this, SVX_RES( PB_ADD ) ),
- m_aParameterBtn ( this, SVX_RES( PB_PARAMETER ) ),
- m_aClassPathBtn ( this, SVX_RES( PB_CLASSPATH ) ),
-
- m_pParamDlg ( NULL ),
- m_pPathDlg ( NULL ),
- m_parJavaInfo ( NULL ),
- m_parParameters ( NULL ),
- m_pClassPath ( NULL ),
- m_nInfoSize ( 0 ),
- m_nParamSize ( 0 ),
- m_sInstallText ( SVX_RES( STR_INSTALLED_IN ) ),
- m_sAccessibilityText( SVX_RES( STR_ACCESSIBILITY ) ),
- m_sAddDialogText ( SVX_RES( STR_ADDDLGTEXT ) ),
-
- xDialogListener ( new ::svt::DialogClosedListener() )
-
-{
- m_aJavaEnableCB.SetClickHdl( LINK( this, SvxJavaOptionsPage, EnableHdl_Impl ) );
- m_aJavaList.SetCheckButtonHdl( LINK( this, SvxJavaOptionsPage, CheckHdl_Impl ) );
- m_aJavaList.SetSelectHdl( LINK( this, SvxJavaOptionsPage, SelectHdl_Impl ) );
- m_aAddBtn.SetClickHdl( LINK( this, SvxJavaOptionsPage, AddHdl_Impl ) );
- m_aParameterBtn.SetClickHdl( LINK( this, SvxJavaOptionsPage, ParameterHdl_Impl ) );
- m_aClassPathBtn.SetClickHdl( LINK( this, SvxJavaOptionsPage, ClassPathHdl_Impl ) );
- m_aResetTimer.SetTimeoutHdl( LINK( this, SvxJavaOptionsPage, ResetHdl_Impl ) );
- m_aResetTimer.SetTimeout( RESET_TIMEOUT );
-
-//! m_aJavaList.EnableCheckButton( new SvLBoxButtonData( &m_aJavaList, true ) );
-
- static long aStaticTabs[]=
- {
- 5, 0, 15, 90, 130, 300
- };
-
- m_aJavaList.SvxSimpleTable::SetTabs( aStaticTabs );
- String sHeader( '\t' );
- sHeader += String( SVX_RES( STR_HEADER_VENDOR ) );
- sHeader += '\t';
- sHeader += String( SVX_RES( STR_HEADER_VERSION ) );
- sHeader += '\t';
- sHeader += String( SVX_RES( STR_HEADER_FEATURES ) );
- sHeader += '\t';
- m_aJavaList.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT );
-
- m_aJavaList.SetHelpId( HID_OPTIONS_JAVA_LIST );
-
- FreeResource();
-
- xDialogListener->SetDialogClosedLink( LINK( this, SvxJavaOptionsPage, DialogClosedHdl ) );
-
- EnableHdl_Impl( &m_aJavaEnableCB );
- jfw_lock();
-
- //check if the text fits into the class path button
- Size aButtonSize = m_aClassPathBtn.GetOutputSizePixel();
- sal_Int32 nTextWidth = m_aClassPathBtn.GetTextWidth(m_aClassPathBtn.GetText());
- //add some additional space
- sal_Int32 nDiff = nTextWidth + 4 - aButtonSize.Width();
- if( nDiff > 0)
- {
- Point aPos(m_aClassPathBtn.GetPosPixel());
- aPos.X() -= nDiff;
- aButtonSize.Width() += nDiff;
- m_aClassPathBtn.SetPosSizePixel(aPos, aButtonSize);
- aPos = m_aAddBtn.GetPosPixel();
- aPos.X() -= nDiff;
- m_aAddBtn.SetPosSizePixel(aPos, aButtonSize);
- aPos = m_aParameterBtn.GetPosPixel();
- aPos.X() -= nDiff;
- m_aParameterBtn.SetPosSizePixel(aPos, aButtonSize);
- Size aSize = m_aJavaList.GetSizePixel();
- aSize.Width() -= nDiff;
- m_aJavaList.SetSizePixel(aSize);
- }
-}
-
-// -----------------------------------------------------------------------
-
-SvxJavaOptionsPage::~SvxJavaOptionsPage()
-{
- delete m_pParamDlg;
- delete m_pPathDlg;
- ClearJavaInfo();
- std::vector< JavaInfo* >::iterator pIter;
- for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter )
- {
- JavaInfo* pInfo = *pIter;
- jfw_freeJavaInfo( pInfo );
- }
-/*
- rtl_uString** pParamArr = m_parParameters;
- for ( sal_Int32 i = 0; i < m_nParamSize; ++i )
- rtl_uString_release( *pParamArr++ );
- rtl_freeMemory( m_parParameters );
- rtl_uString_release( m_pClassPath );
-*/
- jfw_unlock();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, EnableHdl_Impl, CheckBox *, EMPTYARG )
-{
- BOOL bEnable = m_aJavaEnableCB.IsChecked();
- m_aJavaFoundLabel.Enable( bEnable );
- m_aJavaPathText.Enable( bEnable );
- m_aAddBtn.Enable( bEnable );
- m_aParameterBtn.Enable( bEnable );
- m_aClassPathBtn.Enable( bEnable );
-
- bEnable ? m_aJavaList.EnableTable() : m_aJavaList.DisableTable();
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, CheckHdl_Impl, SvxSimpleTable *, pList )
-{
- SvLBoxEntry* pEntry = pList ? m_aJavaList.GetEntry( m_aJavaList.GetCurMousePoint() )
- : m_aJavaList.FirstSelected();
- if ( pEntry )
- m_aJavaList.HandleEntryChecked( pEntry );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, SelectHdl_Impl, SvxSimpleTable *, EMPTYARG )
-{
- // set installation directory info
- SvLBoxEntry* pEntry = m_aJavaList.FirstSelected();
- DBG_ASSERT( pEntry, "SvxJavaOptionsPage::SelectHdl_Impl(): no entry" );
- String* pLocation = static_cast< String* >( pEntry->GetUserData() );
- DBG_ASSERT( pLocation, "invalid location string" );
- String sInfo = m_sInstallText;
- if ( pLocation )
- sInfo += *pLocation;
- m_aJavaPathText.SetText( sInfo );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, AddHdl_Impl, PushButton *, EMPTYARG )
-{
- try
- {
- Reference < XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- xFolderPicker = Reference< XFolderPicker >(
- xMgr->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FolderPicker" ) ), UNO_QUERY );
-
- String sWorkFolder = SvtPathOptions().GetWorkPath();
- xFolderPicker->setDisplayDirectory( sWorkFolder );
- xFolderPicker->setDescription( m_sAddDialogText );
-
- Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY );
- if ( xAsyncDlg.is() )
- xAsyncDlg->startExecuteModal( xDialogListener.get() );
- else if ( xFolderPicker.is() && xFolderPicker->execute() == ExecutableDialogResults::OK )
- AddFolder( xFolderPicker->getDirectory() );
- }
- catch ( Exception& )
- {
-#ifdef DBG_UTIL
- DBG_ERRORFILE( "SvxJavaOptionsPage::AddHdl_Impl(): caught exception" );
-#endif
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, ParameterHdl_Impl, PushButton *, EMPTYARG )
-{
- Sequence< ::rtl::OUString > aParameterList;
- if ( !m_pParamDlg )
- {
- m_pParamDlg = new SvxJavaParameterDlg( this );
- javaFrameworkError eErr = jfw_getVMParameters( &m_parParameters, &m_nParamSize );
- if ( JFW_E_NONE == eErr && m_parParameters && m_nParamSize > 0 )
- {
- rtl_uString** pParamArr = m_parParameters;
- aParameterList.realloc( m_nParamSize );
- ::rtl::OUString* pParams = aParameterList.getArray();
- for ( sal_Int32 i = 0; i < m_nParamSize; ++i )
- {
- rtl_uString* pParam = *pParamArr++;
- pParams[i] = ::rtl::OUString( pParam );
- }
- m_pParamDlg->SetParameters( aParameterList );
- }
- }
- else
- aParameterList = m_pParamDlg->GetParameters();
-
- if ( m_pParamDlg->Execute() == RET_OK )
- {
- if ( !areListsEqual( aParameterList, m_pParamDlg->GetParameters() ) )
- {
- aParameterList = m_pParamDlg->GetParameters();
- sal_Bool bRunning = sal_False;
- javaFrameworkError eErr = jfw_isVMRunning( &bRunning );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::ParameterHdl_Impl(): error in jfw_isVMRunning" );
- (void)eErr;
- if ( bRunning )
- {
- WarningBox aWarnBox( this, SVX_RES( RID_SVX_MSGBOX_JAVA_RESTART2 ) );
- aWarnBox.Execute();
- }
- }
- }
- else
- m_pParamDlg->SetParameters( aParameterList );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, ClassPathHdl_Impl, PushButton *, EMPTYARG )
-{
- String sClassPath;
-
- if ( !m_pPathDlg )
- {
- m_pPathDlg = new SvxJavaClassPathDlg( this );
- javaFrameworkError eErr = jfw_getUserClassPath( &m_pClassPath );
- if ( JFW_E_NONE == eErr && m_pClassPath )
- {
- sClassPath = String( ::rtl::OUString( m_pClassPath ) );
- m_pPathDlg->SetClassPath( sClassPath );
- }
- }
- else
- sClassPath = m_pPathDlg->GetClassPath();
-
- m_pPathDlg->SetFocus();
- if ( m_pPathDlg->Execute() == RET_OK )
- {
-
- if ( m_pPathDlg->GetClassPath() != sClassPath )
- {
- sClassPath = m_pPathDlg->GetClassPath();
- sal_Bool bRunning = sal_False;
- javaFrameworkError eErr = jfw_isVMRunning( &bRunning );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::ParameterHdl_Impl(): error in jfw_isVMRunning" );
- (void)eErr;
- if ( bRunning )
- {
- WarningBox aWarnBox( this, SVX_RES( RID_SVX_MSGBOX_JAVA_RESTART2 ) );
- aWarnBox.Execute();
- }
- }
- }
- else
- m_pPathDlg->SetClassPath( sClassPath );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, ResetHdl_Impl, Timer *, EMPTYARG )
-{
- LoadJREs();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, StartFolderPickerHdl, void*, EMPTYARG )
-{
- try
- {
- Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY );
- if ( xAsyncDlg.is() )
- xAsyncDlg->startExecuteModal( xDialogListener.get() );
- else if ( xFolderPicker.is() && xFolderPicker->execute() == ExecutableDialogResults::OK )
- AddFolder( xFolderPicker->getDirectory() );
- }
- catch ( Exception& )
- {
-#ifdef DBG_UTIL
- DBG_ERRORFILE( "SvxJavaOptionsPage::StartFolderPickerHdl(): caught exception" );
-#endif
- }
-
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
-{
- if ( RET_OK == pEvt->DialogResult )
- {
- DBG_ASSERT( xFolderPicker.is() == sal_True, "SvxJavaOptionsPage::DialogClosedHdl(): no folder picker" );
-
- AddFolder( xFolderPicker->getDirectory() );
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::ClearJavaInfo()
-{
- if ( m_parJavaInfo )
- {
- JavaInfo** parInfo = m_parJavaInfo;
- for ( sal_Int32 i = 0; i < m_nInfoSize; ++i )
- {
- JavaInfo* pInfo = *parInfo++;
- jfw_freeJavaInfo( pInfo );
- }
-
- rtl_freeMemory( m_parJavaInfo );
- m_parJavaInfo = NULL;
- m_nInfoSize = 0;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::ClearJavaList()
-{
- SvLBoxEntry* pEntry = m_aJavaList.First();
- while ( pEntry )
- {
- String* pLocation = static_cast< String* >( pEntry->GetUserData() );
- delete pLocation;
- pEntry = m_aJavaList.Next( pEntry );
- }
- m_aJavaList.Clear();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::LoadJREs()
-{
- WaitObject aWaitObj( &m_aJavaList );
- javaFrameworkError eErr = jfw_findAllJREs( &m_parJavaInfo, &m_nInfoSize );
- if ( JFW_E_NONE == eErr && m_parJavaInfo )
- {
- JavaInfo** parInfo = m_parJavaInfo;
- for ( sal_Int32 i = 0; i < m_nInfoSize; ++i )
- {
- JavaInfo* pInfo = *parInfo++;
- AddJRE( pInfo );
- }
- }
-
- std::vector< JavaInfo* >::iterator pIter;
- for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter )
- {
- JavaInfo* pInfo = *pIter;
- AddJRE( pInfo );
- }
-
- JavaInfo* pSelectedJava = NULL;
- eErr = jfw_getSelectedJRE( &pSelectedJava );
- if ( JFW_E_NONE == eErr && pSelectedJava )
- {
- JavaInfo** parInfo = m_parJavaInfo;
- for ( sal_Int32 i = 0; i < m_nInfoSize; ++i )
- {
- JavaInfo* pCmpInfo = *parInfo++;
- if ( jfw_areEqualJavaInfo( pCmpInfo, pSelectedJava ) )
- {
- SvLBoxEntry* pEntry = m_aJavaList.GetEntry(i);
- if ( pEntry )
- m_aJavaList.HandleEntryChecked( pEntry );
- break;
- }
- }
- }
-
- jfw_freeJavaInfo( pSelectedJava );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo )
-{
- String sEntry( '\t' );
- sEntry += String( ::rtl::OUString( _pInfo->sVendor ) );
- sEntry += '\t';
- sEntry += String( ::rtl::OUString( _pInfo->sVersion ) );
- sEntry += '\t';
- if ( ( _pInfo->nFeatures & JFW_FEATURE_ACCESSBRIDGE ) == JFW_FEATURE_ACCESSBRIDGE )
- sEntry += m_sAccessibilityText;
- SvLBoxEntry* pEntry = m_aJavaList.InsertEntry( sEntry );
- INetURLObject aLocObj( ::rtl::OUString( _pInfo->sLocation ) );
- String* pLocation = new String( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) );
- pEntry->SetUserData( pLocation );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::HandleCheckEntry( SvLBoxEntry* _pEntry )
-{
- m_aJavaList.Select( _pEntry, TRUE );
- SvButtonState eState = m_aJavaList.GetCheckButtonState( _pEntry );
-
- if ( SV_BUTTON_CHECKED == eState )
- {
- // we have radio button behavior -> so uncheck the other entries
- SvLBoxEntry* pEntry = m_aJavaList.First();
- while ( pEntry )
- {
- if ( pEntry != _pEntry )
- m_aJavaList.SetCheckButtonState( pEntry, SV_BUTTON_UNCHECKED );
- pEntry = m_aJavaList.Next( pEntry );
- }
- }
- else
- m_aJavaList.SetCheckButtonState( _pEntry, SV_BUTTON_CHECKED );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::AddFolder( const ::rtl::OUString& _rFolder )
-{
- bool bStartAgain = true;
- sal_Int32 nPos = 0;
- JavaInfo* pInfo = NULL;
- javaFrameworkError eErr = jfw_getJavaInfoByPath( _rFolder.pData, &pInfo );
- if ( JFW_E_NONE == eErr && pInfo )
- {
- bool bFound = false;
- JavaInfo** parInfo = m_parJavaInfo;
- for ( sal_Int32 i = 0; i < m_nInfoSize; ++i )
- {
- JavaInfo* pCmpInfo = *parInfo++;
- if ( jfw_areEqualJavaInfo( pCmpInfo, pInfo ) )
- {
- bFound = true;
- nPos = i;
- break;
- }
- }
-
- if ( !bFound )
- {
- std::vector< JavaInfo* >::iterator pIter;
- for ( pIter = m_aAddedInfos.begin(); pIter != m_aAddedInfos.end(); ++pIter )
- {
- JavaInfo* pCmpInfo = *pIter;
- if ( jfw_areEqualJavaInfo( pCmpInfo, pInfo ) )
- {
- bFound = true;
- break;
- }
- }
- }
-
- if ( !bFound )
- {
- jfw_addJRELocation( pInfo->sLocation );
- AddJRE( pInfo );
- m_aAddedInfos.push_back( pInfo );
- nPos = m_aJavaList.GetEntryCount() - 1;
- }
- else
- jfw_freeJavaInfo( pInfo );
-
- SvLBoxEntry* pEntry = m_aJavaList.GetEntry( nPos );
- m_aJavaList.Select( pEntry );
- m_aJavaList.SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
- HandleCheckEntry( pEntry );
- bStartAgain = false;
- }
- else if ( JFW_E_NOT_RECOGNIZED == eErr )
- {
- ErrorBox aErrBox( this, SVX_RES( RID_SVXERR_JRE_NOT_RECOGNIZED ) );
- aErrBox.Execute();
- }
- else if ( JFW_E_FAILED_VERSION == eErr )
- {
- ErrorBox aErrBox( this, SVX_RES( RID_SVXERR_JRE_FAILED_VERSION ) );
- aErrBox.Execute();
- }
-
- if ( bStartAgain )
- {
- xFolderPicker->setDisplayDirectory( _rFolder );
- Application::PostUserEvent( LINK( this, SvxJavaOptionsPage, StartFolderPickerHdl ) );
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxJavaOptionsPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return ( new SvxJavaOptionsPage( pParent, rAttrSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxJavaOptionsPage::FillItemSet( SfxItemSet& /*rCoreSet*/ )
-{
- BOOL bModified = FALSE;
- javaFrameworkError eErr = JFW_E_NONE;
- if ( m_pParamDlg )
- {
- Sequence< ::rtl::OUString > aParamList = m_pParamDlg->GetParameters();
- sal_Int32 i, nSize = aParamList.getLength();
- rtl_uString** pParamArr = (rtl_uString**)rtl_allocateMemory( sizeof(rtl_uString*) * nSize );
- rtl_uString** pParamArrIter = pParamArr;
- const ::rtl::OUString* pList = aParamList.getConstArray();
- for ( i = 0; i < nSize; ++i )
- pParamArr[i] = pList[i].pData;
- eErr = jfw_setVMParameters( pParamArrIter, nSize );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::FillItemSet(): error in jfw_setVMParameters" );
- pParamArrIter = pParamArr;
- rtl_freeMemory( pParamArr );
- bModified = TRUE;
- }
-
- if ( m_pPathDlg )
- {
- ::rtl::OUString sPath( m_pPathDlg->GetClassPath() );
- if ( m_pPathDlg->GetOldPath() != String( sPath ) )
- {
- eErr = jfw_setUserClassPath( sPath.pData );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::FillItemSet(): error in jfw_setUserClassPath" );
- bModified = TRUE;
- }
- }
-
- ULONG nCount = m_aJavaList.GetEntryCount();
- for ( ULONG i = 0; i < nCount; ++i )
- {
- if ( m_aJavaList.GetCheckButtonState( m_aJavaList.GetEntry(i) ) == SV_BUTTON_CHECKED )
- {
- JavaInfo* pInfo = NULL;
- if ( i < static_cast< ULONG >( m_nInfoSize ) )
- pInfo = m_parJavaInfo[i];
- else
- pInfo = m_aAddedInfos[ i - m_nInfoSize ];
-
- JavaInfo* pSelectedJava = NULL;
- eErr = jfw_getSelectedJRE( &pSelectedJava );
- if ( JFW_E_NONE == eErr || JFW_E_INVALID_SETTINGS == eErr )
- {
- if (pSelectedJava == NULL || !jfw_areEqualJavaInfo( pInfo, pSelectedJava ) )
- {
- sal_Bool bRunning = sal_False;
- eErr = jfw_isVMRunning( &bRunning );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::FillItemSet(): error in jfw_isVMRunning" );
- if ( bRunning ||
- ( ( pInfo->nRequirements & JFW_REQUIRE_NEEDRESTART ) == JFW_REQUIRE_NEEDRESTART ) )
- {
- WarningBox aWarnBox( this, SVX_RES( RID_SVX_MSGBOX_JAVA_RESTART ) );
- aWarnBox.Execute();
- }
-
- eErr = jfw_setSelectedJRE( pInfo );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::FillItemSet(): error in jfw_setSelectedJRE" );
- bModified = TRUE;
- }
- }
- jfw_freeJavaInfo( pSelectedJava );
- break;
- }
- }
-
- sal_Bool bEnabled = sal_False;
- eErr = jfw_getEnabled( &bEnabled );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::FillItemSet(): error in jfw_getEnabled" );
- if ( bEnabled != m_aJavaEnableCB.IsChecked() )
- {
- eErr = jfw_setEnabled( m_aJavaEnableCB.IsChecked() );
- DBG_ASSERT( JFW_E_NONE == eErr,
- "SvxJavaOptionsPage::FillItemSet(): error in jfw_setEnabled" );
- bModified = TRUE;
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
-{
- ClearJavaInfo();
- ClearJavaList();
-
- sal_Bool bEnabled = sal_False;
- javaFrameworkError eErr = jfw_getEnabled( &bEnabled );
- if ( eErr != JFW_E_NONE )
- bEnabled = sal_False;
- m_aJavaEnableCB.Check( bEnabled );
- EnableHdl_Impl( &m_aJavaEnableCB );
-
- m_aResetTimer.Start();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaOptionsPage::FillUserData()
-{
- String aUserData;
- SetUserData( aUserData );
-}
-
-// class SvxJavaParameterDlg ---------------------------------------------
-
-SvxJavaParameterDlg::SvxJavaParameterDlg( Window* pParent ) :
-
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_JAVA_PARAMETER ) ),
-
- m_aParameterLabel ( this, SVX_RES( FT_PARAMETER ) ),
- m_aParameterEdit ( this, SVX_RES( ED_PARAMETER ) ),
- m_aAssignBtn ( this, SVX_RES( PB_ASSIGN ) ),
- m_aAssignedLabel ( this, SVX_RES( FT_ASSIGNED ) ),
- m_aAssignedList ( this, SVX_RES( LB_ASSIGNED ) ),
- m_aExampleText ( this, SVX_RES( FT_EXAMPLE ) ),
- m_aRemoveBtn ( this, SVX_RES( PB_REMOVE ) ),
- m_aButtonsLine ( this, SVX_RES( FL_BUTTONS ) ),
- m_aOKBtn ( this, SVX_RES( PB_PARAMETER_OK ) ),
- m_aCancelBtn ( this, SVX_RES( PB_PARAMETER_ESC ) ),
- m_aHelpBtn ( this, SVX_RES( PB_PARAMETER_HLP ) )
-
-{
- FreeResource();
-
- m_aParameterEdit.SetModifyHdl( LINK( this, SvxJavaParameterDlg, ModifyHdl_Impl ) );
- m_aAssignBtn.SetClickHdl( LINK( this, SvxJavaParameterDlg, AssignHdl_Impl ) );
- m_aRemoveBtn.SetClickHdl( LINK( this, SvxJavaParameterDlg, RemoveHdl_Impl ) );
- m_aAssignedList.SetSelectHdl( LINK( this, SvxJavaParameterDlg, SelectHdl_Impl ) );
- m_aAssignedList.SetDoubleClickHdl( LINK( this, SvxJavaParameterDlg, DblClickHdl_Impl ) );
-
- ModifyHdl_Impl( &m_aParameterEdit );
- EnableRemoveButton();
-}
-
-// -----------------------------------------------------------------------
-
-SvxJavaParameterDlg::~SvxJavaParameterDlg()
-{
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaParameterDlg, ModifyHdl_Impl, Edit *, EMPTYARG )
-{
- String sParam = STRIM( m_aParameterEdit.GetText() );
- m_aAssignBtn.Enable( sParam.Len() > 0 );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaParameterDlg, AssignHdl_Impl, PushButton *, EMPTYARG )
-{
- String sParam = STRIM( m_aParameterEdit.GetText() );
- if ( sParam.Len() > 0 )
- {
- USHORT nPos = m_aAssignedList.GetEntryPos( sParam );
- if ( LISTBOX_ENTRY_NOTFOUND == nPos )
- nPos = m_aAssignedList.InsertEntry( sParam );
- m_aAssignedList.SelectEntryPos( nPos );
- m_aParameterEdit.SetText( String() );
- ModifyHdl_Impl( &m_aParameterEdit );
- EnableRemoveButton();
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaParameterDlg, SelectHdl_Impl, ListBox *, EMPTYARG )
-{
- EnableRemoveButton();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaParameterDlg, DblClickHdl_Impl, ListBox *, EMPTYARG )
-{
- USHORT nPos = m_aAssignedList.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- m_aParameterEdit.SetText( m_aAssignedList.GetEntry( nPos ) );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaParameterDlg, RemoveHdl_Impl, PushButton *, EMPTYARG )
-{
- USHORT nPos = m_aAssignedList.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- m_aAssignedList.RemoveEntry( nPos );
- USHORT nCount = m_aAssignedList.GetEntryCount();
- if ( nCount )
- {
- if ( nPos >= nCount )
- nPos = ( nCount - 1 );
- m_aAssignedList.SelectEntryPos( nPos );
- }
- }
- EnableRemoveButton();
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-short SvxJavaParameterDlg::Execute()
-{
- m_aParameterEdit.GrabFocus();
- m_aAssignedList.SetNoSelection();
- return ModalDialog::Execute();
-}
-
-// -----------------------------------------------------------------------
-
-Sequence< ::rtl::OUString > SvxJavaParameterDlg::GetParameters() const
-{
- USHORT nCount = m_aAssignedList.GetEntryCount();
- Sequence< ::rtl::OUString > aParamList( nCount );
- ::rtl::OUString* pArray = aParamList.getArray();
- for ( USHORT i = 0; i < nCount; ++i )
- pArray[i] = ::rtl::OUString( m_aAssignedList.GetEntry(i) );
- return aParamList;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaParameterDlg::SetParameters( Sequence< ::rtl::OUString >& rParams )
-{
- m_aAssignedList.Clear();
- ULONG i, nCount = rParams.getLength();
- const ::rtl::OUString* pArray = rParams.getConstArray();
- for ( i = 0; i < nCount; ++i )
- {
- String sParam = String( *pArray++ );
- m_aAssignedList.InsertEntry( sParam );
- }
-}
-
-// class SvxJavaClassPathDlg ---------------------------------------------
-
-SvxJavaClassPathDlg::SvxJavaClassPathDlg( Window* pParent ) :
-
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_JAVA_CLASSPATH ) ),
-
- m_aPathLabel ( this, SVX_RES( FT_PATH ) ),
- m_aPathList ( this, SVX_RES( LB_PATH ) ),
- m_aAddArchiveBtn ( this, SVX_RES( PB_ADDARCHIVE ) ),
- m_aAddPathBtn ( this, SVX_RES( PB_ADDPATH ) ),
- m_aRemoveBtn ( this, SVX_RES( PB_REMOVE_PATH ) ),
- m_aButtonsLine ( this, SVX_RES( FL_PATH_BUTTONS ) ),
- m_aOKBtn ( this, SVX_RES( PB_PATH_OK ) ),
- m_aCancelBtn ( this, SVX_RES( PB_PATH_ESC ) ),
- m_aHelpBtn ( this, SVX_RES( PB_PATH_HLP ) )
-
-{
- FreeResource();
-
- m_aAddArchiveBtn.SetClickHdl( LINK( this, SvxJavaClassPathDlg, AddArchiveHdl_Impl ) );
- m_aAddPathBtn.SetClickHdl( LINK( this, SvxJavaClassPathDlg, AddPathHdl_Impl ) );
- m_aRemoveBtn.SetClickHdl( LINK( this, SvxJavaClassPathDlg, RemoveHdl_Impl ) );
- m_aPathList.SetSelectHdl( LINK( this, SvxJavaClassPathDlg, SelectHdl_Impl ) );
-
- // check if the buttons text are not too wide otherwise we have to stretch the buttons
- // and shrink the listbox
- long nTxtWidth1 = m_aAddArchiveBtn.GetTextWidth( m_aAddArchiveBtn.GetText() );
- long nTxtWidth2 = m_aAddPathBtn.GetTextWidth( m_aAddPathBtn.GetText() );
- Size aBtnSz = m_aAddArchiveBtn.GetSizePixel();
- if ( nTxtWidth1 > aBtnSz.Width() || nTxtWidth2 > aBtnSz.Width() )
- {
- long nW = ( nTxtWidth1 > aBtnSz.Width() ) ? nTxtWidth1 : nTxtWidth2;
- long nDelta = nW - aBtnSz.Width() + 2 * BUTTON_BORDER;
- aBtnSz.Width() += nDelta;
- Point aBtnPnt = m_aAddArchiveBtn.GetPosPixel();
- aBtnPnt.X() -= nDelta;
- m_aAddArchiveBtn.SetPosSizePixel( aBtnPnt, aBtnSz );
- aBtnPnt = m_aAddPathBtn.GetPosPixel();
- aBtnPnt.X() -= nDelta;
- m_aAddPathBtn.SetPosSizePixel( aBtnPnt, aBtnSz );
- aBtnPnt = m_aRemoveBtn.GetPosPixel();
- aBtnPnt.X() -= nDelta;
- m_aRemoveBtn.SetPosSizePixel( aBtnPnt, aBtnSz );
- Size aBoxSz = m_aPathList.GetSizePixel();
- aBoxSz.Width() -= nDelta;
- m_aPathList.SetSizePixel( aBoxSz );
- }
-
- // set initial focus to path list
- m_aPathList.GrabFocus();
-}
-
-// -----------------------------------------------------------------------
-
-SvxJavaClassPathDlg::~SvxJavaClassPathDlg()
-{
- USHORT i, nCount = m_aPathList.GetEntryCount();
- for ( i = 0; i < nCount; ++i )
- delete static_cast< String* >( m_aPathList.GetEntryData(i) );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaClassPathDlg, AddArchiveHdl_Impl, PushButton *, EMPTYARG )
-{
- sfx2::FileDialogHelper aDlg( TemplateDescription::FILEOPEN_SIMPLE, 0 );
- aDlg.SetTitle( SVX_RES( RID_SVXSTR_ARCHIVE_TITLE ) );
- aDlg.AddFilter( SVX_RES( RID_SVXSTR_ARCHIVE_HEADLINE ), String::CreateFromAscii("*.jar;*.zip") );
- String sFolder;
- if ( m_aPathList.GetSelectEntryCount() > 0 )
- {
- INetURLObject aObj( m_aPathList.GetSelectEntry(), INetURLObject::FSYS_DETECT );
- sFolder = aObj.GetMainURL( INetURLObject::NO_DECODE );
- }
- else
- sFolder = SvtPathOptions().GetWorkPath();
- aDlg.SetDisplayDirectory( sFolder );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- String sURL = aDlg.GetPath();
- INetURLObject aURL( sURL );
- String sFile = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
- if ( !IsPathDuplicate( sURL ) )
- {
- USHORT nPos = m_aPathList.InsertEntry( sFile, SvFileInformationManager::GetImage( aURL ) );
- m_aPathList.SelectEntryPos( nPos );
- }
- else
- {
- String sMsg( SVX_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sFile );
- ErrorBox( this, WB_OK, sMsg ).Execute();
- }
- }
- EnableRemoveButton();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaClassPathDlg, AddPathHdl_Impl, PushButton *, EMPTYARG )
-{
- rtl::OUString sService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ) );
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( sService ), UNO_QUERY );
-
- String sOldFolder;
- if ( m_aPathList.GetSelectEntryCount() > 0 )
- {
- INetURLObject aObj( m_aPathList.GetSelectEntry(), INetURLObject::FSYS_DETECT );
- sOldFolder = aObj.GetMainURL( INetURLObject::NO_DECODE );
- }
- else
- sOldFolder = SvtPathOptions().GetWorkPath();
- xFolderPicker->setDisplayDirectory( sOldFolder );
- if ( xFolderPicker->execute() == ExecutableDialogResults::OK )
- {
- String sFolderURL( xFolderPicker->getDirectory() );
- INetURLObject aURL( sFolderURL );
- String sNewFolder = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
- if ( !IsPathDuplicate( sFolderURL ) )
- {
- USHORT nPos = m_aPathList.InsertEntry( sNewFolder, SvFileInformationManager::GetImage( aURL ) );
- m_aPathList.SelectEntryPos( nPos );
- }
- else
- {
- String sMsg( SVX_RES( RID_SVXSTR_MULTIFILE_DBL_ERR ) );
- sMsg.SearchAndReplaceAscii( "%1", sNewFolder );
- ErrorBox( this, WB_OK, sMsg ).Execute();
- }
- }
- EnableRemoveButton();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaClassPathDlg, RemoveHdl_Impl, PushButton *, EMPTYARG )
-{
- USHORT nPos = m_aPathList.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- m_aPathList.RemoveEntry( nPos );
- USHORT nCount = m_aPathList.GetEntryCount();
- if ( nCount )
- {
- if ( nPos >= nCount )
- nPos = ( nCount - 1 );
- m_aPathList.SelectEntryPos( nPos );
- }
- }
-
- EnableRemoveButton();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxJavaClassPathDlg, SelectHdl_Impl, ListBox *, EMPTYARG )
-{
- EnableRemoveButton();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-bool SvxJavaClassPathDlg::IsPathDuplicate( const String& _rPath )
-{
- bool bRet = false;
- INetURLObject aFileObj( _rPath );
- USHORT nCount = m_aPathList.GetEntryCount();
- for ( USHORT i = 0; i < nCount; ++i )
- {
- INetURLObject aOtherObj( m_aPathList.GetEntry(i), INetURLObject::FSYS_DETECT );
- if ( aOtherObj == aFileObj )
- {
- bRet = true;
- break;
- }
- }
-
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-String SvxJavaClassPathDlg::GetClassPath() const
-{
- String sPath;
- USHORT nCount = m_aPathList.GetEntryCount();
- for ( USHORT i = 0; i < nCount; ++i )
- {
- if ( sPath.Len() > 0 )
- sPath += CLASSPATH_DELIMITER;
- String* pFullPath = static_cast< String* >( m_aPathList.GetEntryData(i) );
- if ( pFullPath )
- sPath += *pFullPath;
- else
- sPath += m_aPathList.GetEntry(i);
- }
- return sPath;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxJavaClassPathDlg::SetClassPath( const String& _rPath )
-{
- if ( m_sOldPath.Len() == 0 )
- m_sOldPath = _rPath;
- m_aPathList.Clear();
- xub_StrLen i, nIdx = 0;
- xub_StrLen nCount = _rPath.GetTokenCount( CLASSPATH_DELIMITER );
- for ( i = 0; i < nCount; ++i )
- {
- String sToken = _rPath.GetToken( 0, CLASSPATH_DELIMITER, nIdx );
- INetURLObject aURL( sToken, INetURLObject::FSYS_DETECT );
- String sPath = aURL.getFSysPath( INetURLObject::FSYS_DETECT );
- m_aPathList.InsertEntry( sPath, SvFileInformationManager::GetImage( aURL ) );
- }
- // select first entry
- m_aPathList.SelectEntryPos(0);
- SelectHdl_Impl( NULL );
-}
-
diff --git a/svx/source/cui/optjava.hrc b/svx/source/cui/optjava.hrc
deleted file mode 100644
index c51016c695..0000000000
--- a/svx/source/cui/optjava.hrc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjava.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTJAVA_HRC
-#define _SVX_OPTJAVA_HRC
-
-// defines ---------------------------------------------------------------
-
-// class SvxJavaOptionsPage ----------------------------------------------
-
-#define FL_JAVA 10
-#define CB_JAVA_ENABLE 11
-#define FT_JAVA_FOUND 12
-#define LB_JAVA 13
-#define FT_JAVA_PATH 14
-
-#define PB_ADD 20
-#define PB_PARAMETER 21
-#define PB_CLASSPATH 22
-
-#define STR_INSTALLED_IN 30
-#define STR_ACCESSIBILITY 31
-#define STR_ADDDLGTEXT 32
-
-#define STR_HEADER_VENDOR 40
-#define STR_HEADER_VERSION 41
-#define STR_HEADER_FEATURES 42
-
-// class SvxJavaParameterDlg ---------------------------------------------
-
-#define FT_PARAMETER 10
-#define ED_PARAMETER 11
-#define PB_ASSIGN 12
-
-#define FT_ASSIGNED 20
-#define LB_ASSIGNED 21
-#define FT_EXAMPLE 22
-#define PB_REMOVE 23
-
-#define FL_BUTTONS 30
-#define PB_PARAMETER_OK 31
-#define PB_PARAMETER_ESC 32
-#define PB_PARAMETER_HLP 33
-
-// class SvxJavaClassPathDlg ---------------------------------------------
-
-#define FT_PATH 10
-#define LB_PATH 11
-
-#define PB_ADDARCHIVE 20
-#define PB_ADDPATH 21
-#define PB_REMOVE_PATH 22
-
-#define FL_PATH_BUTTONS 30
-#define PB_PATH_OK 31
-#define PB_PATH_ESC 32
-#define PB_PATH_HLP 33
-
-#endif // #ifndef _SVX_OPTJAVA_HRC
-
diff --git a/svx/source/cui/optjava.hxx b/svx/source/cui/optjava.hxx
deleted file mode 100644
index ea8a8c6251..0000000000
--- a/svx/source/cui/optjava.hxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjava.hxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTJAVA_HXX
-#define _SVX_OPTJAVA_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vector>
-#include <ucbhelper/content.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <vcl/fixed.hxx>
-#include <vcl/timer.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/simptabl.hxx>
-#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
-#include <svtools/dialogclosedlistener.hxx>
-#include "radiobtnbox.hxx"
-
-// forward ---------------------------------------------------------------
-
-typedef struct _JavaInfo JavaInfo;
-
-class SvxJavaParameterDlg;
-class SvxJavaClassPathDlg;
-
-// class SvxJavaTable ----------------------------------------------------
-
-class SvxJavaTable : public SvxSimpleTable
-{
- using SvxSimpleTable::SetTabs;
-private:
- Point m_aCurMousePoint;
-
-protected:
- virtual void SetTabs();
- virtual void MouseButtonUp( const MouseEvent& _rMEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
-
-public:
- SvxJavaTable( Window* _pParent, const ResId& _rId );
- ~SvxJavaTable();
-
-
- inline Point GetCurMousePoint() { return m_aCurMousePoint; }
-};
-
-// class SvxJavaOptionsPage ----------------------------------------------
-
-class SvxJavaOptionsPage : public SfxTabPage
-{
-private:
- FixedLine m_aJavaLine;
- CheckBox m_aJavaEnableCB;
- FixedText m_aJavaFoundLabel;
- svx::SvxRadioButtonListBox m_aJavaList;
- FixedText m_aJavaPathText;
- PushButton m_aAddBtn;
- PushButton m_aParameterBtn;
- PushButton m_aClassPathBtn;
-
- SvxJavaParameterDlg* m_pParamDlg;
- SvxJavaClassPathDlg* m_pPathDlg;
-
- JavaInfo** m_parJavaInfo;
- rtl_uString** m_parParameters;
- rtl_uString* m_pClassPath;
- sal_Int32 m_nInfoSize;
- sal_Int32 m_nParamSize;
- String m_sInstallText;
- String m_sAccessibilityText;
- String m_sAddDialogText;
- Timer m_aResetTimer;
-
- ::std::vector< JavaInfo* >
- m_aAddedInfos;
-
- ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
- ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker;
-
- DECL_LINK( EnableHdl_Impl, CheckBox * );
- DECL_LINK( CheckHdl_Impl, SvxSimpleTable * );
- DECL_LINK( SelectHdl_Impl, SvxSimpleTable * );
- DECL_LINK( AddHdl_Impl, PushButton * );
- DECL_LINK( ParameterHdl_Impl, PushButton * );
- DECL_LINK( ClassPathHdl_Impl, PushButton * );
- DECL_LINK( ResetHdl_Impl, Timer * );
-
- DECL_LINK( StartFolderPickerHdl, void * );
- DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
-
- void ClearJavaInfo();
- void ClearJavaList();
- void LoadJREs();
- void AddJRE( JavaInfo* _pInfo );
- void HandleCheckEntry( SvLBoxEntry* _pEntry );
- void AddFolder( const ::rtl::OUString& _rFolder );
-
-public:
- SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxJavaOptionsPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void FillUserData();
-};
-
-// class SvxJavaParameterDlg ---------------------------------------------
-
-class SvxJavaParameterDlg : public ModalDialog
-{
-private:
- FixedText m_aParameterLabel;
- Edit m_aParameterEdit;
- PushButton m_aAssignBtn;
-
- FixedText m_aAssignedLabel;
- ListBox m_aAssignedList;
- FixedText m_aExampleText;
- PushButton m_aRemoveBtn;
-
- FixedLine m_aButtonsLine;
- OKButton m_aOKBtn;
- CancelButton m_aCancelBtn;
- HelpButton m_aHelpBtn;
-
- DECL_LINK( ModifyHdl_Impl, Edit * );
- DECL_LINK( AssignHdl_Impl, PushButton * );
- DECL_LINK( SelectHdl_Impl, ListBox * );
- DECL_LINK( DblClickHdl_Impl, ListBox * );
- DECL_LINK( RemoveHdl_Impl, PushButton * );
-
- inline void EnableRemoveButton()
- { m_aRemoveBtn.Enable(
- m_aAssignedList.GetSelectEntryPos()
- != LISTBOX_ENTRY_NOTFOUND ); }
-
-
-public:
- SvxJavaParameterDlg( Window* pParent );
- ~SvxJavaParameterDlg();
-
- virtual short Execute();
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > GetParameters() const;
- void SetParameters( ::com::sun::star::uno::Sequence< ::rtl::OUString >& rParams );
-};
-
-// class SvxJavaClassPathDlg ---------------------------------------------
-
-class SvxJavaClassPathDlg : public ModalDialog
-{
-private:
- FixedText m_aPathLabel;
- ListBox m_aPathList;
- PushButton m_aAddArchiveBtn;
- PushButton m_aAddPathBtn;
- PushButton m_aRemoveBtn;
-
- FixedLine m_aButtonsLine;
- OKButton m_aOKBtn;
- CancelButton m_aCancelBtn;
- HelpButton m_aHelpBtn;
-
- String m_sOldPath;
-
- DECL_LINK( AddArchiveHdl_Impl, PushButton * );
- DECL_LINK( AddPathHdl_Impl, PushButton * );
- DECL_LINK( RemoveHdl_Impl, PushButton * );
- DECL_LINK( SelectHdl_Impl, ListBox * );
-
- bool IsPathDuplicate( const String& _rPath );
- inline void EnableRemoveButton()
- { m_aRemoveBtn.Enable(
- m_aPathList.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
-
-public:
- SvxJavaClassPathDlg( Window* pParent );
- ~SvxJavaClassPathDlg();
-
- inline const String& GetOldPath() const { return m_sOldPath; }
- inline void SetFocus() { m_aPathList.GrabFocus(); }
-
- String GetClassPath() const;
- void SetClassPath( const String& _rPath );
-};
-
-#endif // #ifndef _SVX_OPTJAVA_HXX
-
diff --git a/svx/source/cui/optjava.src b/svx/source/cui/optjava.src
deleted file mode 100644
index a5c69644dc..0000000000
--- a/svx/source/cui/optjava.src
+++ /dev/null
@@ -1,290 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjava.src,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include --------------------------------------------------------------
-
-#include "optjava.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-// RID_SVXPAGE_OPTIONS_JAVA ----------------------------------------------
-
-TabPage RID_SVXPAGE_OPTIONS_JAVA
-{
- HelpId = HID_OPTIONS_JAVA ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Java" ;
-
- FixedLine FL_JAVA
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Java options" ;
- };
- CheckBox CB_JAVA_ENABLE
- {
- Pos = MAP_APPFONT ( 12, 14 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "~Use a Java runtime environment" ;
- };
- FixedText FT_JAVA_FOUND
- {
- Pos = MAP_APPFONT ( 21 , 27 ) ;
- Size = MAP_APPFONT ( 233 , 8 ) ;
- Text [ en-US ] = "~Java runtime environments (JRE) already installed:" ;
- };
- Control LB_JAVA
- {
- Pos = MAP_APPFONT ( 21 , 38 ) ;
- Size = MAP_APPFONT ( 177 , 130 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_JAVA_PATH
- {
- Pos = MAP_APPFONT ( 21 , 171 ) ;
- Size = MAP_APPFONT ( 233 , 8 ) ;
- NoLabel = TRUE ;
- };
- PushButton PB_ADD
- {
- Pos = MAP_APPFONT ( 204 , 38 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- };
- PushButton PB_PARAMETER
- {
- Pos = MAP_APPFONT ( 204 , 55 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Parameters..." ;
- };
- PushButton PB_CLASSPATH
- {
- Pos = MAP_APPFONT ( 204 , 72 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Class Path..." ;
- };
- String STR_INSTALLED_IN
- {
- Text [ en-US ] = "Location: " ;
- };
- String STR_ACCESSIBILITY
- {
- Text [ en-US ] = "with accessibility support" ;
- };
- String STR_ADDDLGTEXT
- {
- Text [ en-US ] = "Select a Java Runtime Environment" ;
- };
- String STR_HEADER_VENDOR
- {
- Text [ en-US ] = "Vendor" ;
- };
- String STR_HEADER_VERSION
- {
- Text [ en-US ] = "Version" ;
- };
- String STR_HEADER_FEATURES
- {
- Text [ en-US ] = "Features" ;
- };
-};
-
-// RID_SVXDLG_JAVA_PARAMETER ---------------------------------------------
-
-ModalDialog RID_SVXDLG_JAVA_PARAMETER
-{
- HelpId = HID_OPTIONS_JAVA_PARAMETER ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Text [ en-US ] = "Java Start Parameters" ;
- Moveable = TRUE ;
- FixedText FT_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "Java start ~parameter" ;
- };
- Edit ED_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 15 ) ;
- Size = MAP_APPFONT ( 202 , 12 ) ;
- Border = TRUE ;
- };
- PushButton PB_ASSIGN
- {
- Pos = MAP_APPFONT ( 214 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Assign" ;
- };
- FixedText FT_ASSIGNED
- {
- Pos = MAP_APPFONT ( 6 , 31 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "Assig~ned start parameters" ;
- };
- ListBox LB_ASSIGNED
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 42 ) ;
- Size = MAP_APPFONT ( 202 , 53 ) ;
- AutoHScroll = TRUE ;
- };
- FixedText FT_EXAMPLE
- {
- Pos = MAP_APPFONT ( 6 , 98 ) ;
- Size = MAP_APPFONT ( 202 , 8 ) ;
- Text [ en-US ] = "For example: -Dmyprop=c:\\program files\\java" ;
- };
- PushButton PB_REMOVE
- {
- Pos = MAP_APPFONT ( 214 , 42 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Remove" ;
- };
- FixedLine FL_BUTTONS
- {
- Pos = MAP_APPFONT ( 3 , 109 ) ;
- Size = MAP_APPFONT ( 264 , 8 ) ;
- };
- OKButton PB_PARAMETER_OK
- {
- Pos = MAP_APPFONT ( 105 , 120 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton PB_PARAMETER_ESC
- {
- Pos = MAP_APPFONT ( 158 , 120 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton PB_PARAMETER_HLP
- {
- Pos = MAP_APPFONT ( 214 , 120 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
-// RID_SVXDLG_JAVA_CLASSPATH ---------------------------------------------
-
-ModalDialog RID_SVXDLG_JAVA_CLASSPATH
-{
- HelpId = HID_OPTIONS_JAVA_CLASSPATH ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 240 , 120 ) ;
- Text [ en-US ] = "Class Path" ;
- Moveable = TRUE ;
- FixedText FT_PATH
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 172 , 8 ) ;
- Text [ en-US ] = "A~ssigned folders and archives" ;
- };
- ListBox LB_PATH
- {
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 172 , 72 ) ;
- Border = TRUE ;
- AutoHScroll = TRUE ;
- };
- PushButton PB_ADDARCHIVE
- {
- Pos = MAP_APPFONT ( 184 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add Archive..." ;
- };
- PushButton PB_ADDPATH
- {
- Pos = MAP_APPFONT ( 184 , 31 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "Add ~Folder" ;
- };
- PushButton PB_REMOVE_PATH
- {
- Pos = MAP_APPFONT ( 184 , 48 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Remove" ;
- };
- FixedLine FL_PATH_BUTTONS
- {
- Pos = MAP_APPFONT ( 3 , 89 ) ;
- Size = MAP_APPFONT ( 236 , 8 ) ;
- };
- OKButton PB_PATH_OK
- {
- Pos = MAP_APPFONT ( 75 , 100 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton PB_PATH_ESC
- {
- Pos = MAP_APPFONT ( 128 , 100 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton PB_PATH_HLP
- {
- Pos = MAP_APPFONT ( 186 , 100 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
-ErrorBox RID_SVXERR_JRE_NOT_RECOGNIZED
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "The folder you selected does not contain a Java runtime environment.\nPlease select a different folder." ;
-};
-
-ErrorBox RID_SVXERR_JRE_FAILED_VERSION
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "The Java runtime environment you selected is not the required version.\nPlease select a different folder." ;
-};
-
-WarningBox RID_SVX_MSGBOX_JAVA_RESTART
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "For the selected Java runtime environment to work properly, %PRODUCTNAME must be restarted.\nPlease restart %PRODUCTNAME now." ;
-};
-
-WarningBox RID_SVX_MSGBOX_JAVA_RESTART2
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "You have to restart %PRODUCTNAME so the new or modified values can take effect.\nPlease restart %PRODUCTNAME now." ;
-};
-
diff --git a/svx/source/cui/optjsearch.cxx b/svx/source/cui/optjsearch.cxx
deleted file mode 100644
index 720fa6eec5..0000000000
--- a/svx/source/cui/optjsearch.cxx
+++ /dev/null
@@ -1,393 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjsearch.cxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-
-#include <tools/shl.hxx>
-#include <svtools/searchopt.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#include <svx/dialmgr.hxx>
-#include <optjsearch.hxx>
-#include "optjsearch.hrc"
-
-using namespace com::sun::star::i18n;
-
-//////////////////////////////////////////////////////////////////////
-
-SvxJSearchOptionsPage::SvxJSearchOptionsPage( Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_JSEARCH_OPTIONS ), rSet ),
-
- aTreatAsEqual ( this, SVX_RES( FL_TREAT_AS_EQUAL ) ),
- aMatchCase ( this, SVX_RES( CB_MATCH_CASE ) ),
- aMatchFullHalfWidth ( this, SVX_RES( CB_MATCH_FULL_HALF_WIDTH ) ),
- aMatchHiraganaKatakana ( this, SVX_RES( CB_MATCH_HIRAGANA_KATAKANA ) ),
- aMatchContractions ( this, SVX_RES( CB_MATCH_CONTRACTIONS ) ),
- aMatchMinusDashChoon ( this, SVX_RES( CB_MATCH_MINUS_DASH_CHOON ) ),
- aMatchRepeatCharMarks ( this, SVX_RES( CB_MATCH_REPEAT_CHAR_MARKS ) ),
- aMatchVariantFormKanji ( this, SVX_RES( CB_MATCH_VARIANT_FORM_KANJI ) ),
- aMatchOldKanaForms ( this, SVX_RES( CB_MATCH_OLD_KANA_FORMS ) ),
- aMatchDiziDuzu ( this, SVX_RES( CB_MATCH_DIZI_DUZU ) ),
- aMatchBavaHafa ( this, SVX_RES( CB_MATCH_BAVA_HAFA ) ),
- aMatchTsithichiDhizi ( this, SVX_RES( CB_MATCH_TSITHICHI_DHIZI ) ),
- aMatchHyuiyuByuvyu ( this, SVX_RES( CB_MATCH_HYUFYU_BYUVYU ) ),
- aMatchSesheZeje ( this, SVX_RES( CB_MATCH_SESHE_ZEJE ) ),
- aMatchIaiya ( this, SVX_RES( CB_MATCH_IAIYA ) ),
- aMatchKiku ( this, SVX_RES( CB_MATCH_KIKU ) ),
- aMatchProlongedSoundMark ( this, SVX_RES( CB_MATCH_PROLONGED_SOUNDMARK ) ),
- aIgnore ( this, SVX_RES( FL_IGNORE ) ),
- aIgnorePunctuation ( this, SVX_RES( CB_IGNORE_PUNCTUATION ) ),
- aIgnoreWhitespace ( this, SVX_RES( CB_IGNORE_WHITESPACES ) ),
- aIgnoreMiddleDot ( this, SVX_RES( CB_IGNORE_MIDDLE_DOT ) )
-{
- FreeResource();
- bSaveOptions = TRUE;
- nTransliterationFlags = 0x00000000;
-}
-
-
-SvxJSearchOptionsPage::~SvxJSearchOptionsPage()
-{
-}
-
-
-SfxTabPage* SvxJSearchOptionsPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxJSearchOptionsPage( pParent, rSet );
-}
-
-
-void SvxJSearchOptionsPage::SetTransliterationFlags( INT32 nSettings )
-{
- BOOL bVal = 0 != (nSettings & TransliterationModules_IGNORE_CASE);
- aMatchCase .Check( bVal ); //! treat as equal uppercase/lowercase
- bVal = 0 != (nSettings & TransliterationModules_IGNORE_WIDTH);
- aMatchFullHalfWidth .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_IGNORE_KANA);
- aMatchHiraganaKatakana .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSize_ja_JP);
- aMatchContractions .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreMinusSign_ja_JP);
- aMatchMinusDashChoon .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreIterationMark_ja_JP);
- aMatchRepeatCharMarks .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreTraditionalKanji_ja_JP);
- aMatchVariantFormKanji .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreTraditionalKana_ja_JP);
- aMatchOldKanaForms .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreZiZu_ja_JP);
- aMatchDiziDuzu .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreBaFa_ja_JP);
- aMatchBavaHafa .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreTiJi_ja_JP);
- aMatchTsithichiDhizi .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreHyuByu_ja_JP);
- aMatchHyuiyuByuvyu .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSeZe_ja_JP);
- aMatchSesheZeje .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreIandEfollowedByYa_ja_JP);
- aMatchIaiya .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreKiKuFollowedBySa_ja_JP);
- aMatchKiku .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSeparator_ja_JP);
- aIgnorePunctuation .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSpace_ja_JP);
- aIgnoreWhitespace .Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreProlongedSoundMark_ja_JP);
- aMatchProlongedSoundMark.Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreMiddleDot_ja_JP);
- aIgnoreMiddleDot .Check( bVal );
-
- nTransliterationFlags = nSettings;
-}
-
-
-INT32 SvxJSearchOptionsPage::GetTransliterationFlags_Impl()
-{
- INT32 nTmp = 0;
- if (aMatchCase.IsChecked()) //! treat as equal uppercase/lowercase
- nTmp |= TransliterationModules_IGNORE_CASE;
- if (aMatchFullHalfWidth.IsChecked())
- nTmp |= TransliterationModules_IGNORE_WIDTH;
- if (aMatchHiraganaKatakana.IsChecked())
- nTmp |= TransliterationModules_IGNORE_KANA;
- if (aMatchContractions.IsChecked())
- nTmp |= TransliterationModules_ignoreSize_ja_JP;
- if (aMatchMinusDashChoon.IsChecked())
- nTmp |= TransliterationModules_ignoreMinusSign_ja_JP;
- if (aMatchRepeatCharMarks.IsChecked())
- nTmp |= TransliterationModules_ignoreIterationMark_ja_JP;
- if (aMatchVariantFormKanji.IsChecked())
- nTmp |= TransliterationModules_ignoreTraditionalKanji_ja_JP;
- if (aMatchOldKanaForms.IsChecked())
- nTmp |= TransliterationModules_ignoreTraditionalKana_ja_JP;
- if (aMatchDiziDuzu.IsChecked())
- nTmp |= TransliterationModules_ignoreZiZu_ja_JP;
- if (aMatchBavaHafa.IsChecked())
- nTmp |= TransliterationModules_ignoreBaFa_ja_JP;
- if (aMatchTsithichiDhizi.IsChecked())
- nTmp |= TransliterationModules_ignoreTiJi_ja_JP;
- if (aMatchHyuiyuByuvyu.IsChecked())
- nTmp |= TransliterationModules_ignoreHyuByu_ja_JP;
- if (aMatchSesheZeje.IsChecked())
- nTmp |= TransliterationModules_ignoreSeZe_ja_JP;
- if (aMatchIaiya.IsChecked())
- nTmp |= TransliterationModules_ignoreIandEfollowedByYa_ja_JP;
- if (aMatchKiku.IsChecked())
- nTmp |= TransliterationModules_ignoreKiKuFollowedBySa_ja_JP;
- if (aIgnorePunctuation.IsChecked())
- nTmp |= TransliterationModules_ignoreSeparator_ja_JP;
- if (aIgnoreWhitespace.IsChecked())
- nTmp |= TransliterationModules_ignoreSpace_ja_JP;
- if (aMatchProlongedSoundMark.IsChecked())
- nTmp |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
- if (aIgnoreMiddleDot.IsChecked())
- nTmp |= TransliterationModules_ignoreMiddleDot_ja_JP;
-
- nTransliterationFlags = nTmp;
- return nTransliterationFlags;
-}
-
-
-void SvxJSearchOptionsPage::Reset( const SfxItemSet& )
-{
- SvtSearchOptions aOpt;
-
- // read settings from configuration
- aMatchCase .Check(!aOpt.IsMatchCase() ); //! treat as equal uppercase/lowercase
- aMatchFullHalfWidth .Check( aOpt.IsMatchFullHalfWidthForms() );
- aMatchHiraganaKatakana .Check( aOpt.IsMatchHiraganaKatakana() );
- aMatchContractions .Check( aOpt.IsMatchContractions() );
- aMatchMinusDashChoon .Check( aOpt.IsMatchMinusDashChoon() );
- aMatchRepeatCharMarks .Check( aOpt.IsMatchRepeatCharMarks() );
- aMatchVariantFormKanji .Check( aOpt.IsMatchVariantFormKanji() );
- aMatchOldKanaForms .Check( aOpt.IsMatchOldKanaForms() );
- aMatchDiziDuzu .Check( aOpt.IsMatchDiziDuzu() );
- aMatchBavaHafa .Check( aOpt.IsMatchBavaHafa() );
- aMatchTsithichiDhizi .Check( aOpt.IsMatchTsithichiDhizi() );
- aMatchHyuiyuByuvyu .Check( aOpt.IsMatchHyuiyuByuvyu() );
- aMatchSesheZeje .Check( aOpt.IsMatchSesheZeje() );
- aMatchIaiya .Check( aOpt.IsMatchIaiya() );
- aMatchKiku .Check( aOpt.IsMatchKiku() );
- aIgnorePunctuation .Check( aOpt.IsIgnorePunctuation() );
- aIgnoreWhitespace .Check( aOpt.IsIgnoreWhitespace() );
- aMatchProlongedSoundMark .Check( aOpt.IsIgnoreProlongedSoundMark() );
- aIgnoreMiddleDot .Check( aOpt.IsIgnoreMiddleDot() );
-
- nTransliterationFlags = GetTransliterationFlags_Impl();
- DBG_ASSERT( nTransliterationFlags == aOpt.GetTransliterationFlags(),
- "Transliteration settings different" );
-
- aMatchCase .SaveValue();
- aMatchFullHalfWidth .SaveValue();
- aMatchHiraganaKatakana .SaveValue();
- aMatchContractions .SaveValue();
- aMatchMinusDashChoon .SaveValue();
- aMatchRepeatCharMarks .SaveValue();
- aMatchVariantFormKanji .SaveValue();
- aMatchOldKanaForms .SaveValue();
- aMatchDiziDuzu .SaveValue();
- aMatchBavaHafa .SaveValue();
- aMatchTsithichiDhizi .SaveValue();
- aMatchHyuiyuByuvyu .SaveValue();
- aMatchSesheZeje .SaveValue();
- aMatchIaiya .SaveValue();
- aMatchKiku .SaveValue();
- aIgnorePunctuation .SaveValue();
- aIgnoreWhitespace .SaveValue();
- aMatchProlongedSoundMark .SaveValue();
- aIgnoreMiddleDot .SaveValue();
-}
-
-
-BOOL SvxJSearchOptionsPage::FillItemSet( SfxItemSet& )
-{
- BOOL bModified = FALSE;
-
- INT32 nOldVal = nTransliterationFlags;
- nTransliterationFlags = GetTransliterationFlags_Impl();
- bModified = nOldVal != nTransliterationFlags;
-
- if (!IsSaveOptions())
- return bModified;
-
- bModified = FALSE;
- SvtSearchOptions aOpt;
- BOOL bNewVal, bChanged;
-
- bNewVal = aMatchCase.IsChecked(); //! treat as equal uppercase/lowercase
- bChanged = bNewVal != aMatchCase.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchCase(!bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchFullHalfWidth.IsChecked();
- bChanged = bNewVal != aMatchFullHalfWidth.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchFullHalfWidthForms( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchHiraganaKatakana.IsChecked();
- bChanged = bNewVal != aMatchHiraganaKatakana.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchHiraganaKatakana( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchContractions.IsChecked();
- bChanged = bNewVal != aMatchContractions.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchContractions( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchMinusDashChoon.IsChecked();
- bChanged = bNewVal != aMatchMinusDashChoon.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchMinusDashChoon( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchRepeatCharMarks.IsChecked();
- bChanged = bNewVal != aMatchRepeatCharMarks.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchRepeatCharMarks( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchVariantFormKanji.IsChecked();
- bChanged = bNewVal != aMatchVariantFormKanji.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchVariantFormKanji( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchOldKanaForms.IsChecked();
- bChanged = bNewVal != aMatchOldKanaForms.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchOldKanaForms( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchDiziDuzu.IsChecked();
- bChanged = bNewVal != aMatchDiziDuzu.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchDiziDuzu( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchBavaHafa.IsChecked();
- bChanged = bNewVal != aMatchBavaHafa.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchBavaHafa( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchTsithichiDhizi.IsChecked();
- bChanged = bNewVal != aMatchTsithichiDhizi.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchTsithichiDhizi( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchHyuiyuByuvyu.IsChecked();
- bChanged = bNewVal != aMatchHyuiyuByuvyu.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchHyuiyuByuvyu( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchSesheZeje.IsChecked();
- bChanged = bNewVal != aMatchSesheZeje.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchSesheZeje( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchIaiya.IsChecked();
- bChanged = bNewVal != aMatchIaiya.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchIaiya( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchKiku.IsChecked();
- bChanged = bNewVal != aMatchKiku.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetMatchKiku( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aIgnorePunctuation.IsChecked();
- bChanged = bNewVal != aIgnorePunctuation.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetIgnorePunctuation( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aIgnoreWhitespace.IsChecked();
- bChanged = bNewVal != aIgnoreWhitespace.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetIgnoreWhitespace( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aMatchProlongedSoundMark.IsChecked();
- bChanged = bNewVal != aMatchProlongedSoundMark.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetIgnoreProlongedSoundMark( bNewVal );
- bModified = TRUE;
- }
- bNewVal = aIgnoreMiddleDot.IsChecked();
- bChanged = bNewVal != aIgnoreMiddleDot.GetSavedValue();
- if (bChanged)
- {
- aOpt.SetIgnoreMiddleDot( bNewVal );
- bModified = TRUE;
- }
-
- return bModified;
-}
-
-
-//////////////////////////////////////////////////////////////////////
-
diff --git a/svx/source/cui/optjsearch.hxx b/svx/source/cui/optjsearch.hxx
deleted file mode 100644
index f7b628692d..0000000000
--- a/svx/source/cui/optjsearch.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjsearch.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_OPTJSEARCH_HXX_
-#define _SVX_OPTJSEARCH_HXX_
-
-#include <vcl/fixed.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <sfx2/tabdlg.hxx>
-
-class Window;
-class SfxItemSet;
-
-//////////////////////////////////////////////////////////////////////
-
-class SvxJSearchOptionsPage : public SfxTabPage
-{
-private:
- FixedLine aTreatAsEqual;
- CheckBox aMatchCase;
- CheckBox aMatchFullHalfWidth;
- CheckBox aMatchHiraganaKatakana;
- CheckBox aMatchContractions;
- CheckBox aMatchMinusDashChoon;
- CheckBox aMatchRepeatCharMarks;
- CheckBox aMatchVariantFormKanji;
- CheckBox aMatchOldKanaForms;
- CheckBox aMatchDiziDuzu;
- CheckBox aMatchBavaHafa;
- CheckBox aMatchTsithichiDhizi;
- CheckBox aMatchHyuiyuByuvyu;
- CheckBox aMatchSesheZeje;
- CheckBox aMatchIaiya;
- CheckBox aMatchKiku;
- CheckBox aMatchProlongedSoundMark;
- FixedLine aIgnore;
- CheckBox aIgnorePunctuation;
- CheckBox aIgnoreWhitespace;
- CheckBox aIgnoreMiddleDot;
-
- INT32 nTransliterationFlags;
- BOOL bSaveOptions;
-
- INT32 GetTransliterationFlags_Impl();
-
-protected:
- SvxJSearchOptionsPage( Window* pParent, const SfxItemSet& rSet );
-
-public:
- ~SvxJSearchOptionsPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
-
- virtual void Reset( const SfxItemSet& rSet );
- virtual BOOL FillItemSet( SfxItemSet& rSet );
-
- BOOL IsSaveOptions() const { return bSaveOptions; }
- void EnableSaveOptions( BOOL bVal ) { bSaveOptions = bVal; }
-
- INT32 GetTransliterationFlags() const { return nTransliterationFlags; }
- void SetTransliterationFlags( INT32 nSettings );
-};
-
-//////////////////////////////////////////////////////////////////////
-
-#endif
-
diff --git a/svx/source/cui/optmemory.cxx b/svx/source/cui/optmemory.cxx
deleted file mode 100644
index e3befab80e..0000000000
--- a/svx/source/cui/optmemory.cxx
+++ /dev/null
@@ -1,287 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optmemory.cxx,v $
- * $Revision: 1.21 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <svtools/langtab.hxx>
-#include <svtools/zforlist.hxx>
-#include <goodies/grfmgr.hxx>
-#include <svtools/flagitem.hxx>
-#include <sfx2/dispatch.hxx>
-#include <svtools/lingucfg.hxx>
-#include <svtools/szitem.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <vcl/msgbox.hxx>
-#include <rtl/math.hxx>
-#include <svtools/undoopt.hxx>
-#include <svtools/useroptions.hxx>
-#include <svtools/cacheoptions.hxx>
-#include <svtools/fontoptions.hxx>
-#include <svtools/menuoptions.hxx>
-#include <svtools/startoptions.hxx>
-#include <svtools/cjkoptions.hxx>
-#ifndef INCLUDED_SVTOOLS_MISCPOPT_HXX
-#include <svtools/miscopt.hxx>
-#endif
-#include <svtools/syslocaleoptions.hxx>
-#include <svtools/helpopt.hxx>
-#include <unotools/configitem.hxx>
-#include <sfx2/objsh.hxx>
-#include <comphelper/types.hxx>
-#include "unolingu.hxx"
-#include <svx/langitem.hxx>
-#include "cuioptgenrl.hxx"
-#include "optpath.hxx"
-#include "optsave.hxx"
-#include <svx/optlingu.hxx>
-#include <svx/xpool.hxx>
-#include "dlgutil.hxx"
-#ifndef _SVX_TAB_AREA_HXX
-#include "cuitabarea.hxx"
-#endif
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-
-
-#include "optmemory.hrc"
-#include "optmemory.hxx"
-#include "ofaitem.hxx"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <svx/dialmgr.hxx>
-
-#define CONFIG_LANGUAGES "OfficeLanguages"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::utl;
-using namespace ::rtl;
-using namespace ::sfx2;
-
-
-#define NF2BYTES 104857.6 // 2^20/10, used for aNfGraphicObjectCache-unit -> Byte
-#define BYTES2NF (1.0/NF2BYTES) // 10/2^20
-
-
-inline long OfaMemoryOptionsPage::GetNfGraphicCacheVal( void ) const
-{
- return static_cast<long>(aNfGraphicCache.GetValue() << 20);
-}
-
-inline void OfaMemoryOptionsPage::SetNfGraphicCacheVal( long nSizeInBytes )
-{
- aNfGraphicCache.SetValue( nSizeInBytes >> 20 );
-}
-
-long OfaMemoryOptionsPage::GetNfGraphicObjectCacheVal( void ) const
-{
- return long( ::rtl::math::round( double( aNfGraphicObjectCache.GetValue() ) * NF2BYTES ) );
-}
-
-void OfaMemoryOptionsPage::SetNfGraphicObjectCacheVal( long nSizeInBytes )
-{
- aNfGraphicObjectCache.SetValue( long( ::rtl::math::round( double( nSizeInBytes ) * BYTES2NF ) ) );
-}
-
-inline void OfaMemoryOptionsPage::SetNfGraphicObjectCacheMax( long nSizeInBytes )
-{
- aNfGraphicObjectCache.SetMax( long( double( nSizeInBytes ) * BYTES2NF ) );
-}
-
-inline void OfaMemoryOptionsPage::SetNfGraphicObjectCacheLast( long nSizeInBytes )
-{
- aNfGraphicObjectCache.SetLast( long( double( nSizeInBytes ) * BYTES2NF ) );
-}
-
-int OfaMemoryOptionsPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-OfaMemoryOptionsPage::OfaMemoryOptionsPage(Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( OFA_TP_MEMORY ), rSet ),
-
- aUndoBox ( this, SVX_RES( GB_UNDO ) ),
- aUndoText ( this, SVX_RES( FT_UNDO ) ),
- aUndoEdit ( this, SVX_RES( ED_UNDO ) ),
- aGbGraphicCache ( this, SVX_RES( GB_GRAPHICCACHE ) ),
- aFtGraphicCache ( this, SVX_RES( FT_GRAPHICCACHE ) ),
- aNfGraphicCache ( this, SVX_RES( NF_GRAPHICCACHE ) ),
- aFtGraphicCacheUnit ( this, SVX_RES( FT_GRAPHICCACHE_UNIT ) ),
- aFtGraphicObjectCache ( this, SVX_RES( FT_GRAPHICOBJECTCACHE ) ),
- aNfGraphicObjectCache ( this, SVX_RES( NF_GRAPHICOBJECTCACHE ) ),
- aFtGraphicObjectCacheUnit(this, SVX_RES( FT_GRAPHICOBJECTCACHE_UNIT ) ),
- aFtGraphicObjectTime ( this, SVX_RES( FT_GRAPHICOBJECTTIME ) ),
- aTfGraphicObjectTime ( this, SVX_RES( TF_GRAPHICOBJECTTIME ) ),
- aFtGraphicObjectTimeUnit( this, SVX_RES( FT_GRAPHICOBJECTTIME_UNIT ) ),
-
- aGbOLECache ( this, SVX_RES( GB_OLECACHE ) ),
- aFtOLECache ( this, SVX_RES( FT_OLECACHE ) ),
- aNfOLECache ( this, SVX_RES( NF_OLECACHE ) ),
- aQuickLaunchFL ( this, SVX_RES( FL_QUICKLAUNCH ) ),
- aQuickLaunchCB ( this, SVX_RES( CB_QUICKLAUNCH ) )//,
-{
-#if defined(UNX)
- aQuickLaunchCB.SetText( SVX_RES( STR_QUICKLAUNCH_UNX ) );
-#endif
- FreeResource();
-
- //quick launch only available in Win and OS/2
-#if !defined(WNT) && !defined(OS2) && !defined(ENABLE_GTK)
- aQuickLaunchFL.Hide();
- aQuickLaunchCB.Hide();
-#endif
-
- aTfGraphicObjectTime.SetExtFormat( EXTTIMEF_24H_SHORT );
-
- SetExchangeSupport();
-
- aNfGraphicCache.SetModifyHdl( LINK( this, OfaMemoryOptionsPage, GraphicCacheConfigHdl ) );
-}
-
-// -----------------------------------------------------------------------
-
-OfaMemoryOptionsPage::~OfaMemoryOptionsPage()
-{
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* OfaMemoryOptionsPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new OfaMemoryOptionsPage( pParent, rAttrSet );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL OfaMemoryOptionsPage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bModified = FALSE;
-
- SvtCacheOptions aCacheOptions;
-
- // Undo-Schritte
- if ( aUndoEdit.GetText() != aUndoEdit.GetSavedValue() )
- SvtUndoOptions().SetUndoCount((UINT16)aUndoEdit.GetValue());
-
- // GraphicCache
- aCacheOptions.SetGraphicManagerTotalCacheSize( GetNfGraphicCacheVal() );
- aCacheOptions.SetGraphicManagerObjectCacheSize( GetNfGraphicObjectCacheVal() );
-
- const Time aTime( aTfGraphicObjectTime.GetTime() );
- aCacheOptions.SetGraphicManagerObjectReleaseTime( aTime.GetSec() + aTime.GetMin() * 60 + aTime.GetHour() * 3600 );
-
- // create a dummy graphic object to get access to the common GraphicManager
- GraphicObject aDummyObject;
- GraphicManager& rGrfMgr = aDummyObject.GetGraphicManager();
-
- rGrfMgr.SetMaxCacheSize( aCacheOptions.GetGraphicManagerTotalCacheSize() );
- rGrfMgr.SetMaxObjCacheSize( aCacheOptions.GetGraphicManagerObjectCacheSize(), TRUE );
- rGrfMgr.SetCacheTimeout( aCacheOptions.GetGraphicManagerObjectReleaseTime() );
-
- // OLECache
- aCacheOptions.SetWriterOLE_Objects( static_cast<long>(aNfOLECache.GetValue()) );
- aCacheOptions.SetDrawingEngineOLE_Objects( static_cast<long>(aNfOLECache.GetValue()) );
-
- if( aQuickLaunchCB.IsChecked() != aQuickLaunchCB.GetSavedValue())
- {
- rSet.Put(SfxBoolItem(SID_ATTR_QUICKLAUNCHER, aQuickLaunchCB.IsChecked()));
- bModified = TRUE;
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void OfaMemoryOptionsPage::Reset( const SfxItemSet& rSet )
-{
- SvtCacheOptions aCacheOptions;
- const SfxPoolItem* pItem;
-
- // Undo-Schritte
- aUndoEdit.SetValue( SvtUndoOptions().GetUndoCount() );
- aUndoEdit.SaveValue();
-
- // GraphicCache
- long n = aCacheOptions.GetGraphicManagerTotalCacheSize();
- SetNfGraphicCacheVal( n );
- SetNfGraphicObjectCacheVal( Min( static_cast<sal_Int32>(GetNfGraphicCacheVal()), aCacheOptions.GetGraphicManagerObjectCacheSize() ) );
-
- sal_Int32 nTime = aCacheOptions.GetGraphicManagerObjectReleaseTime();
- Time aTime( (USHORT)( nTime / 3600 ), (USHORT)( ( nTime % 3600 ) / 60 ), (USHORT)( ( nTime % 3600 ) % 60 ) );
- aTfGraphicObjectTime.SetTime( aTime );
-
- GraphicCacheConfigHdl( &aNfGraphicCache );
-
- // OLECache
- aNfOLECache.SetValue( Max( aCacheOptions.GetWriterOLE_Objects(), aCacheOptions.GetDrawingEngineOLE_Objects() ) );
-
- SfxItemState eState = rSet.GetItemState( SID_ATTR_QUICKLAUNCHER, FALSE, &pItem );
- if ( SFX_ITEM_SET == eState )
- aQuickLaunchCB.Check( ( (SfxBoolItem*)pItem )->GetValue() );
- else if ( SFX_ITEM_DISABLED == eState )
- {
- // quickstart not installed
- aQuickLaunchFL.Hide();
- aQuickLaunchCB.Hide();
- }
-
- aQuickLaunchCB.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( OfaMemoryOptionsPage, GraphicCacheConfigHdl, NumericField*, EMPTYARG )
-{
- long n = GetNfGraphicCacheVal();
- SetNfGraphicObjectCacheMax( n );
- SetNfGraphicObjectCacheLast( n );
-
- if( GetNfGraphicObjectCacheVal() > n )
- SetNfGraphicObjectCacheVal( n );
-
- return 0;
-}
-
diff --git a/svx/source/cui/optmemory.hrc b/svx/source/cui/optmemory.hrc
deleted file mode 100644
index b5527a3396..0000000000
--- a/svx/source/cui/optmemory.hrc
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optmemory.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _OFA_OPTMEMORY_HRC
-#define _OFA_OPTMEMORY_HRC
-
-#include <svtools/controldims.hrc>
-
-// defines for positions and sizes ---------------------------------------
-
-#define WHOLE_WIDTH 248
-
-#define COLSPACE RSC_SP_CTRL_DESC_X
-#define COL0 6
-#define COL1 (COL0+6)
-#define COL2 (COL1+140) // width text before control
-#define COL3 (COL2+COLSPACE)
-#define COL4 (COL3+30) // width control
-#define COL5 (COL4+COLSPACE)
-#define COL6 (WHOLE_WIDTH) // width text after control (unit)
-
-#define ROWSPACE RSC_SP_CTRL_DESC_Y
-#define ROW0 3
-#define ROW1 ( ROW0+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE )
-#define ROW2 ( ROW1+RSC_CD_TEXTBOX_HEIGHT+ROWSPACE )
-#define ROW3 ( ROW2+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE )
-#define ROW4 ( ROW3+RSC_CD_TEXTBOX_HEIGHT+ROWSPACE )
-#define ROW5 ( ROW4+RSC_CD_TEXTBOX_HEIGHT+ROWSPACE )
-#define ROW6 ( ROW5+RSC_CD_TEXTBOX_HEIGHT+ROWSPACE )
-#define ROW7 ( ROW6+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE )
-#define ROW8 ( ROW7+RSC_CD_TEXTBOX_HEIGHT+ROWSPACE )
-#define ROW9 ( ROW8+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE )
-
-#define DIFF(v1,v2) (v2-v1)
-#define OFFS_TEXTBOX_FIXEDTEXT(base) (base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
-
-#define WIDTH1 DIFF( COL1, COL2 )
-#define WIDTH2 DIFF( COL3, COL4 )
-#define WIDTH3 DIFF( COL5, COL6 )
-// tabpage memory --------------------------------------------------------
-
-#define GB_UNDO 10
-#define FT_UNDO 11
-#define ED_UNDO 12
-#define GB_GRAPHICCACHE 13
-#define FT_GRAPHICCACHE 14
-#define FT_GRAPHICCACHE_UNIT 15
-#define FT_GRAPHICOBJECTCACHE_UNIT 16
-#define FT_GRAPHICOBJECTTIME_UNIT 17
-#define NF_GRAPHICCACHE 18
-#define FT_GRAPHICOBJECTCACHE 19
-#define NF_GRAPHICOBJECTCACHE 20
-#define FT_GRAPHICOBJECTTIME 21
-#define TF_GRAPHICOBJECTTIME 22
-#define GB_OLECACHE 23
-#define FT_OLECACHE 24
-#define NF_OLECACHE 25
-#define FL_QUICKLAUNCH 26
-#define CB_QUICKLAUNCH 27
-#define STR_QUICKLAUNCH_UNX 28
-
-#endif // #ifndef _OFA_OPTMEMORY_HRC
-
diff --git a/svx/source/cui/optmemory.hxx b/svx/source/cui/optmemory.hxx
deleted file mode 100644
index 75ca43f25a..0000000000
--- a/svx/source/cui/optmemory.hxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optmemory.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _OFA_OPTMEMORY_HXX
-#define _OFA_OPTMEMORY_HXX
-
-#include <vcl/lstbox.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/langbox.hxx>
-#define FOLDERWEBVIEW_DEFAULTFILE "folder.so"
-
-// class OfaMiscTabPage --------------------------------------------------
-
-class OfaMemoryOptionsPage : public SfxTabPage
-{
- using SfxTabPage::DeactivatePage;
-private:
- FixedLine aUndoBox;
- FixedText aUndoText;
- NumericField aUndoEdit;
-
- FixedLine aGbGraphicCache;
- FixedText aFtGraphicCache;
- NumericField aNfGraphicCache;
- FixedText aFtGraphicCacheUnit;
- FixedText aFtGraphicObjectCache;
- NumericField aNfGraphicObjectCache;
- FixedText aFtGraphicObjectCacheUnit;
- FixedText aFtGraphicObjectTime;
- TimeField aTfGraphicObjectTime;
- FixedText aFtGraphicObjectTimeUnit;
-
- FixedLine aGbOLECache;
- FixedText aFtOLECache;
- NumericField aNfOLECache;
-
- FixedLine aQuickLaunchFL;
- CheckBox aQuickLaunchCB;
-
- DECL_LINK( GraphicCacheConfigHdl, NumericField* );
-
- inline long GetNfGraphicCacheVal( void ) const; // returns # of Bytes
- inline void SetNfGraphicCacheVal( long nSizeInBytes );
-
- long GetNfGraphicObjectCacheVal( void ) const; // returns # of Bytes
- void SetNfGraphicObjectCacheVal( long nSizeInBytes );
- inline void SetNfGraphicObjectCacheMax( long nSizeInBytes );
- inline void SetNfGraphicObjectCacheLast( long nSizeInBytes );
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = NULL );
-
-public:
- OfaMemoryOptionsPage( Window* pParent, const SfxItemSet& rSet );
- ~OfaMemoryOptionsPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-
-#endif
diff --git a/svx/source/cui/optmemory.src b/svx/source/cui/optmemory.src
deleted file mode 100644
index 01d23d42be..0000000000
--- a/svx/source/cui/optmemory.src
+++ /dev/null
@@ -1,210 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optmemory.src,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include ---------------------------------------------------------------
-
-#include <svx/dialogs.hrc>
-#include "optmemory.hrc"
-#include "helpid.hrc"
-
-TabPage OFA_TP_MEMORY
-{
- HelpID = HID_OFA_TP_MEMORY ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
- FixedLine GB_UNDO
- {
- Pos = MAP_APPFONT( COL0, ROW0 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Undo" ;
- };
- FixedText FT_UNDO
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT( ROW1 ) );
- Size = MAP_APPFONT( WIDTH1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Number of steps";
- };
- NumericField ED_UNDO
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( COL3, ROW1 );
- Size = MAP_APPFONT( WIDTH2, RSC_CD_TEXTBOX_HEIGHT );
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- First = 1 ;
- Maximum = 1000 ;
- Value = 100 ;
- Last = 100 ;
- SpinSize = 1 ;
- MaxTextLength = 4;
- };
- FixedLine GB_GRAPHICCACHE
- {
- Pos = MAP_APPFONT( COL0, ROW2 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Graphics cache";
- };
- FixedText FT_GRAPHICCACHE
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT( ROW3 ) );
- Size = MAP_APPFONT( WIDTH1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Use for %PRODUCTNAME";
- };
- NumericField NF_GRAPHICCACHE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( COL3, ROW3 );
- Size = MAP_APPFONT( WIDTH2, RSC_CD_TEXTBOX_HEIGHT );
- Minimum = 1;
- Maximum = 256;
- SpinSize = 1;
- Spin = TRUE ;
- Repeat = TRUE ;
- };
- FixedText FT_GRAPHICCACHE_UNIT
- {
- Pos = MAP_APPFONT( COL5, OFFS_TEXTBOX_FIXEDTEXT( ROW3 ) );
- Size = MAP_APPFONT( WIDTH3, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "MB";
- };
- FixedText FT_GRAPHICOBJECTCACHE
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT( ROW4 ) );
- Size = MAP_APPFONT( WIDTH1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Memory per object" ;
- };
- NumericField NF_GRAPHICOBJECTCACHE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( COL3, ROW4 );
- Size = MAP_APPFONT( WIDTH2, RSC_CD_TEXTBOX_HEIGHT );
- Minimum = 10;
- Maximum = 2560;
- SpinSize = 1;
- Spin = TRUE ;
- Repeat = TRUE ;
- DecimalDigits = 1;
- };
- FixedText FT_GRAPHICOBJECTCACHE_UNIT
- {
- Pos = MAP_APPFONT( COL5, OFFS_TEXTBOX_FIXEDTEXT( ROW4 ) );
- Size = MAP_APPFONT( WIDTH3, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "MB";
- };
- FixedText FT_GRAPHICOBJECTTIME
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT( ROW5 ) );
- Size = MAP_APPFONT( WIDTH1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Remove from memory after";
- };
- TimeField TF_GRAPHICOBJECTTIME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( COL3, ROW5 );
- Size = MAP_APPFONT( WIDTH2, RSC_CD_TEXTBOX_HEIGHT );
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Value = Time
- {
- Minute = 10;
- };
- Minimum = Time
- {
- Minute = 1;
- };
- Maximum = Time
- {
- Hour = 23 ;
- Minute = 59 ;
- };
- First = Time
- {
- Minute = 10;
- };
- Last = Time
- {
- Hour = 23 ;
- Minute = 59 ;
- };
- Format = TIMEF_NONE ;
- Duration = TRUE ;
- StrictFormat = TRUE ;
- };
- FixedText FT_GRAPHICOBJECTTIME_UNIT
- {
- Pos = MAP_APPFONT( COL5, OFFS_TEXTBOX_FIXEDTEXT( ROW5 ) );
- Size = MAP_APPFONT( WIDTH3, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "hh:mm";
- };
- FixedLine GB_OLECACHE
- {
- Pos = MAP_APPFONT( COL0, ROW6 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Cache for inserted objects";
- };
- FixedText FT_OLECACHE
- {
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT( ROW7 ) );
- Size = MAP_APPFONT( WIDTH1, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Number of objects";
- };
- NumericField NF_OLECACHE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( COL3, ROW7 );
- Size = MAP_APPFONT( WIDTH2, RSC_CD_TEXTBOX_HEIGHT );
- Minimum = 1;
- Maximum = 1024;
- Spin = TRUE ;
- Repeat = TRUE ;
- };
- FixedLine FL_QUICKLAUNCH
- {
- Pos = MAP_APPFONT( COL0, ROW8 );
- Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "%PRODUCTNAME Quickstarter";
- };
- CheckBox CB_QUICKLAUNCH
- {
- Pos = MAP_APPFONT( COL1, ROW9 );
- Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Load %PRODUCTNAME during system start-up";
- };
- String STR_QUICKLAUNCH_UNX
- {
- Text[ en-US ] = "Enable systray Quickstarter";
- };
-};
-
diff --git a/svx/source/cui/optpath.cxx b/svx/source/cui/optpath.cxx
deleted file mode 100644
index ec589678b2..0000000000
--- a/svx/source/cui/optpath.cxx
+++ /dev/null
@@ -1,871 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optpath.cxx,v $
- * $Revision: 1.25 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <svx/svxdlg.hxx> //CHINA001
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <sfx2/app.hxx>
-#include <svtools/pickerhelper.hxx>
-#include <svtools/aeitem.hxx>
-#include <svtools/svtabbx.hxx>
-#include <svtools/filedlg.hxx>
-#include <tools/config.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/svapp.hxx>
-#include <svtools/defaultoptions.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/moduleoptions.hxx>
-#include <svtools/viewoptions.hxx>
-
-#define _SVX_OPTPATH_CXX
-
-#include "optpath.hxx"
-#include <svx/dialmgr.hxx>
-//CHINA001 #include "multipat.hxx"
-#include "optpath.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <comphelper/processfactory.hxx>
-#include <comphelper/configurationhelper.hxx>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
-#include "optHeaderTabListbox.hxx"
-#include <readonlyimage.hxx>
-#include <vcl/help.hxx>
-
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ui::dialogs;
-using namespace ::com::sun::star::uno;
-using namespace svx;
-
-// define ----------------------------------------------------------------
-
-#define TAB_WIDTH1 80
-#define TAB_WIDTH_MIN 10
-#define TAB_WIDTH2 1000
-#define ITEMID_TYPE 1
-#define ITEMID_PATH 2
-
-#define POSTFIX_INTERNAL String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_internal" ) )
-#define POSTFIX_USER String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_user" ) )
-#define POSTFIX_WRITABLE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_writable" ) )
-#define POSTFIX_READONLY String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_readonly" ) )
-#define VAR_ONE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "%1" ) )
-#define IODLG_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Save"))
-
-// struct OptPath_Impl ---------------------------------------------------
-
-struct OptPath_Impl
-{
- SvtDefaultOptions m_aDefOpt;
- Image m_aLockImage;
- Image m_aLockImageHC;
- String m_sMultiPathDlg;
- Reference< XPropertySet > m_xPathSettings;
-
- OptPath_Impl(const ResId& rLockRes, const ResId& rLockResHC) :
- m_aLockImage(rLockRes),
- m_aLockImageHC(rLockResHC){}
-};
-
-// struct PathUserData_Impl ----------------------------------------------
-
-struct PathUserData_Impl
-{
- USHORT nRealId;
- SfxItemState eState;
- String sUserPath;
- String sWritablePath;
-
- PathUserData_Impl( USHORT nId ) :
- nRealId( nId ), eState( SFX_ITEM_UNKNOWN ) {}
-};
-
-struct Handle2CfgNameMapping_Impl
-{
- USHORT m_nHandle;
- const char* m_pCfgName;
-};
-
-static Handle2CfgNameMapping_Impl __READONLY_DATA Hdl2CfgMap_Impl[] =
-{
- { SvtPathOptions::PATH_AUTOCORRECT, "AutoCorrect" },
- { SvtPathOptions::PATH_AUTOTEXT, "AutoText" },
- { SvtPathOptions::PATH_BACKUP, "Backup" },
- { SvtPathOptions::PATH_GALLERY, "Gallery" },
- { SvtPathOptions::PATH_GRAPHIC, "Graphic" },
- { SvtPathOptions::PATH_TEMP, "Temp" },
- { SvtPathOptions::PATH_TEMPLATE, "Template" },
- { SvtPathOptions::PATH_WORK, "Work" },
-#if OSL_DEBUG_LEVEL > 1
- { SvtPathOptions::PATH_LINGUISTIC, "Linguistic" },
- { SvtPathOptions::PATH_DICTIONARY, "Dictionary" },
-#endif
- { USHRT_MAX, NULL }
-};
-
-static String getCfgName_Impl( USHORT _nHandle )
-{
- String sCfgName;
- USHORT nIndex = 0;
- while ( Hdl2CfgMap_Impl[ nIndex ].m_nHandle != USHRT_MAX )
- {
- if ( Hdl2CfgMap_Impl[ nIndex ].m_nHandle == _nHandle )
- {
- // config name found
- sCfgName = String::CreateFromAscii( Hdl2CfgMap_Impl[ nIndex ].m_pCfgName );
- break;
- }
- ++nIndex;
- }
-
- return sCfgName;
-}
-
-#define MULTIPATH_DELIMITER ';'
-
-String Convert_Impl( const String& rValue )
-{
- char cDelim = MULTIPATH_DELIMITER;
- USHORT nCount = rValue.GetTokenCount( cDelim );
- String aReturn;
- for ( USHORT i=0; i<nCount ; ++i )
- {
- String aValue = rValue.GetToken( i, cDelim );
- INetURLObject aObj( aValue );
- if ( aObj.GetProtocol() == INET_PROT_FILE )
- aReturn += String(aObj.PathToFileName());
- else if ( ::utl::LocalFileHelper::IsFileContent( aValue ) )
- aReturn += String(aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ));
- if ( i+1 < nCount)
- aReturn += MULTIPATH_DELIMITER;
- }
-
- return aReturn;
-}
-
-// class SvxControlFocusHelper ---------------------------------------------
-
-long SvxControlFocusHelper::Notify( NotifyEvent& rNEvt )
-{
- long nRet = Control::Notify( rNEvt );
-
- if ( m_pFocusCtrl && rNEvt.GetWindow() != m_pFocusCtrl && rNEvt.GetType() == EVENT_GETFOCUS )
- m_pFocusCtrl->GrabFocus();
- return nRet;
-}
-
-// functions -------------------------------------------------------------
-
-BOOL IsMultiPath_Impl( const USHORT nIndex )
-{
-#if OSL_DEBUG_LEVEL > 1
- return ( SvtPathOptions::PATH_AUTOCORRECT == nIndex ||
- SvtPathOptions::PATH_AUTOTEXT == nIndex ||
- SvtPathOptions::PATH_BASIC == nIndex ||
- SvtPathOptions::PATH_GALLERY == nIndex ||
- SvtPathOptions::PATH_TEMPLATE == nIndex );
-#else
- return ( SvtPathOptions::PATH_AUTOCORRECT == nIndex ||
- SvtPathOptions::PATH_AUTOTEXT == nIndex ||
- SvtPathOptions::PATH_BASIC == nIndex ||
- SvtPathOptions::PATH_GALLERY == nIndex ||
- SvtPathOptions::PATH_TEMPLATE == nIndex ||
- SvtPathOptions::PATH_LINGUISTIC == nIndex ||
- SvtPathOptions::PATH_DICTIONARY == nIndex );
-#endif
-}
-
-// class SvxPathTabPage --------------------------------------------------
-
-SvxPathTabPage::SvxPathTabPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SFXPAGE_PATH ), rSet ),
-
- aTypeText ( this, SVX_RES( FT_TYPE ) ),
- aPathText ( this, SVX_RES( FT_PATH ) ),
- aPathCtrl ( this, SVX_RES( LB_PATH ) ),
- aStandardBtn ( this, SVX_RES( BTN_STANDARD ) ),
- aPathBtn ( this, SVX_RES( BTN_PATH ) ),
- aStdBox ( this, SVX_RES( GB_STD ) ),
-
- pHeaderBar ( NULL ),
- pPathBox ( NULL ),
- pImpl ( new OptPath_Impl( SVX_RES(IMG_LOCK), SVX_RES(IMG_LOCK_HC) ) ),
- xDialogListener ( new ::svt::DialogClosedListener() )
-
-{
- pImpl->m_sMultiPathDlg = String( SVX_RES( STR_MULTIPATHDLG ) );
- aStandardBtn.SetClickHdl( LINK( this, SvxPathTabPage, StandardHdl_Impl ) );
- Link aLink = LINK( this, SvxPathTabPage, PathHdl_Impl );
- aPathBtn.SetClickHdl( aLink );
- Size aBoxSize = aPathCtrl.GetOutputSizePixel();
- pHeaderBar = new HeaderBar( &aPathCtrl, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
- pHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( aBoxSize.Width(), 16 ) );
- pHeaderBar->SetSelectHdl( LINK( this, SvxPathTabPage, HeaderSelect_Impl ) );
- pHeaderBar->SetEndDragHdl( LINK( this, SvxPathTabPage, HeaderEndDrag_Impl ) );
- Size aSz;
- aSz.Width() = TAB_WIDTH1;
- pHeaderBar->InsertItem( ITEMID_TYPE, aTypeText.GetText(),
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
- HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
- aSz.Width() = TAB_WIDTH2;
- pHeaderBar->InsertItem( ITEMID_PATH, aPathText.GetText(),
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
- HIB_LEFT | HIB_VCENTER );
-
- static long nTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
- Size aHeadSize = pHeaderBar->GetSizePixel();
-
- WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new OptHeaderTabListBox( &aPathCtrl, nBits );
- aPathCtrl.SetFocusControl( pPathBox );
- pPathBox->SetWindowBits( nBits );
- pPathBox->SetDoubleClickHdl( aLink );
- pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
- pPathBox->SetSelectionMode( MULTIPLE_SELECTION );
- pPathBox->SetPosSizePixel( Point( 0, aHeadSize.Height() ),
- Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
- pPathBox->SetTabs( &nTabs[0], MAP_APPFONT );
- pPathBox->InitHeaderBar( pHeaderBar );
- pPathBox->SetHighlightRange();
- pPathBox->SetHelpId( HID_OPTPATH_CTL_PATH );
- pHeaderBar->SetHelpId( HID_OPTPATH_HEADERBAR );
- pPathBox->Show();
- pHeaderBar->Show();
-
- FreeResource();
-
- xDialogListener->SetDialogClosedLink( LINK( this, SvxPathTabPage, DialogClosedHdl ) );
-}
-
-// -----------------------------------------------------------------------
-
-SvxPathTabPage::~SvxPathTabPage()
-{
- // #110603# do not grab focus to a destroyed window !!!
- aPathCtrl.SetFocusControl( NULL );
-
- pHeaderBar->Hide();
- for ( USHORT i = 0; i < pPathBox->GetEntryCount(); ++i )
- delete (PathUserData_Impl*)pPathBox->GetEntry(i)->GetUserData();
- delete pPathBox;
- delete pHeaderBar;
- delete pImpl;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxPathTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return ( new SvxPathTabPage( pParent, rAttrSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxPathTabPage::FillItemSet( SfxItemSet& )
-{
- SvtPathOptions aPathOpt;
- for ( USHORT i = 0; i < pPathBox->GetEntryCount(); ++i )
- {
- PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pPathBox->GetEntry(i)->GetUserData();
- USHORT nRealId = pPathImpl->nRealId;
- if ( pPathImpl->eState == SFX_ITEM_SET )
- SetPathList( nRealId, pPathImpl->sUserPath, pPathImpl->sWritablePath );
- }
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPathTabPage::Reset( const SfxItemSet& )
-{
- pPathBox->Clear();
- SvtPathOptions aPathOpt; //! deprecated
-
- for( USHORT i = 0; i <= (USHORT)SvtPathOptions::PATH_WORK; ++i )
- {
- // only writer uses autotext
- if ( i == SvtPathOptions::PATH_AUTOTEXT
- && !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
- continue;
-
- switch (i)
- {
- case SvtPathOptions::PATH_AUTOCORRECT:
- case SvtPathOptions::PATH_AUTOTEXT:
- case SvtPathOptions::PATH_BACKUP:
- case SvtPathOptions::PATH_GALLERY:
- case SvtPathOptions::PATH_GRAPHIC:
- case SvtPathOptions::PATH_TEMP:
- case SvtPathOptions::PATH_TEMPLATE:
-#if OSL_DEBUG_LEVEL > 1
- case SvtPathOptions::PATH_LINGUISTIC:
- case SvtPathOptions::PATH_DICTIONARY:
-#endif
- case SvtPathOptions::PATH_WORK:
- {
- String aStr( SVX_RES( RID_SVXSTR_PATH_NAME_START + i ) );
- String sInternal, sUser, sWritable;
- sal_Bool bReadOnly = sal_False;
- GetPathList( i, sInternal, sUser, sWritable, bReadOnly );
- String sTmpPath = sUser;
- if ( sTmpPath.Len() > 0 && sWritable.Len() > 0 )
- sTmpPath += MULTIPATH_DELIMITER;
- sTmpPath += sWritable;
- String aValue( sTmpPath );
- aStr += '\t';
- aStr += Convert_Impl( aValue );
- SvLBoxEntry* pEntry = pPathBox->InsertEntry( aStr );
- if ( bReadOnly )
- {
- pPathBox->SetCollapsedEntryBmp( pEntry, pImpl->m_aLockImage, BMP_COLOR_NORMAL );
- pPathBox->SetCollapsedEntryBmp( pEntry, pImpl->m_aLockImageHC, BMP_COLOR_HIGHCONTRAST );
- }
- PathUserData_Impl* pPathImpl = new PathUserData_Impl(i);
- pPathImpl->sUserPath = sUser;
- pPathImpl->sWritablePath = sWritable;
- pEntry->SetUserData( pPathImpl );
- }
- }
- }
-
- String aUserData = GetUserData();
- if ( aUserData.Len() )
- {
- // Spaltenbreite restaurieren
- pHeaderBar->SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
- HeaderEndDrag_Impl( NULL );
- // Sortierrichtung restaurieren
- BOOL bUp = (BOOL)(USHORT)aUserData.GetToken(1).ToInt32();
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
-
- if ( bUp )
- {
- nBits &= ~HIB_UPARROW;
- nBits |= HIB_DOWNARROW;
- }
- else
- {
- nBits &= ~HIB_DOWNARROW;
- nBits |= HIB_UPARROW;
- }
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
- HeaderSelect_Impl( NULL );
- }
- PathSelect_Impl( NULL );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPathTabPage::FillUserData()
-{
- String aUserData = String::CreateFromInt32( pHeaderBar->GetItemSize( ITEMID_TYPE ) );
- aUserData += ';';
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE );
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- aUserData += bUp ? '1' : '0';
- SetUserData( aUserData );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPathTabPage, PathSelect_Impl, OptHeaderTabListBox *, EMPTYARG )
-
-/* [Beschreibung]
-
-*/
-
-{
- USHORT nSelCount = 0;
- SvLBoxEntry* pEntry = pPathBox->FirstSelected();
-
- //the entry image indicates whether the path is write protected
- Image aEntryImage;
- if(pEntry)
- aEntryImage = pPathBox->GetCollapsedEntryBmp( pEntry );
- BOOL bEnable = !aEntryImage;
- while ( pEntry && ( nSelCount < 2 ) )
- {
- nSelCount++;
- pEntry = pPathBox->NextSelected( pEntry );
- }
-
- aPathBtn.Enable( 1 == nSelCount && bEnable);
- aStandardBtn.Enable( nSelCount > 0 && bEnable);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPathTabPage, StandardHdl_Impl, PushButton *, EMPTYARG )
-{
- SvLBoxEntry* pEntry = pPathBox->FirstSelected();
- while ( pEntry )
- {
- PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
- String aOldPath = pImpl->m_aDefOpt.GetDefaultPath( pPathImpl->nRealId );
-
- if ( aOldPath.Len() )
- {
- String sInternal, sUser, sWritable, sTemp;
- sal_Bool bReadOnly = sal_False;
- GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
-
- USHORT i;
- USHORT nOldCount = aOldPath.GetTokenCount( MULTIPATH_DELIMITER );
- USHORT nIntCount = sInternal.GetTokenCount( MULTIPATH_DELIMITER );
- for ( i = 0; i < nOldCount; ++i )
- {
- bool bFound = false;
- String sOnePath = aOldPath.GetToken( i, MULTIPATH_DELIMITER );
- for ( USHORT j = 0; !bFound && j < nIntCount; ++j )
- {
- if ( sInternal.GetToken( i, MULTIPATH_DELIMITER ) == sOnePath )
- bFound = true;
- }
- if ( !bFound )
- {
- if ( sTemp.Len() > 0 )
- sTemp += MULTIPATH_DELIMITER;
- sTemp += sOnePath;
- }
- }
-
- String sUserPath, sWritablePath;
- nOldCount = sTemp.GetTokenCount( MULTIPATH_DELIMITER );
- for ( i = 0; nOldCount > 0 && i < nOldCount - 1; ++i )
- {
- if ( sUserPath.Len() > 0 )
- sUserPath += MULTIPATH_DELIMITER;
- sUserPath += sTemp.GetToken( i, MULTIPATH_DELIMITER );
- }
- sWritablePath = sTemp.GetToken( nOldCount - 1, MULTIPATH_DELIMITER );
-
- pPathBox->SetEntryText( Convert_Impl( sTemp ), pEntry, 1 );
- pPathImpl->eState = SFX_ITEM_SET;
- pPathImpl->sUserPath = sUserPath;
- pPathImpl->sWritablePath = sWritablePath;
- }
- pEntry = pPathBox->NextSelected( pEntry );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
-{
- SvLBoxEntry* pEntry = pPathBox->GetCurEntry();
- if ( !pEntry )
- {
- DBG_ERRORFILE( "SvxPathTabPage::ChangeCurrentEntry(): no entry" );
- return;
- }
-
- String sInternal, sUser, sWritable;
- PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
- sal_Bool bReadOnly = sal_False;
- GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
- sUser = pPathImpl->sUserPath;
- sWritable = pPathImpl->sWritablePath;
- USHORT nPos = pPathImpl->nRealId;
-
- // old path is an URL?
- INetURLObject aObj( sWritable );
- FASTBOOL bURL = ( aObj.GetProtocol() != INET_PROT_NOT_VALID );
- rtl::OUString aPathStr( _rFolder );
- INetURLObject aNewObj( aPathStr );
- aNewObj.removeFinalSlash();
-
- // then the new path also an URL else system path
- String sNewPathStr = bURL ? aPathStr : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT );
-
- FASTBOOL bChanged =
-#ifdef UNX
-// Unix is case sensitive
- ( sNewPathStr != sWritable );
-#else
- ( sNewPathStr.CompareIgnoreCaseToAscii( sWritable ) != COMPARE_EQUAL );
-#endif
-
- if ( bChanged )
- {
- pPathBox->SetEntryText( Convert_Impl( sNewPathStr ), pEntry, 1 );
- nPos = (USHORT)pPathBox->GetModel()->GetAbsPos( pEntry );
- pPathImpl = (PathUserData_Impl*)pPathBox->GetEntry(nPos)->GetUserData();
- pPathImpl->eState = SFX_ITEM_SET;
- pPathImpl->sWritablePath = sNewPathStr;
- if ( SvtPathOptions::PATH_WORK == pPathImpl->nRealId )
- {
- // Remove view options entry so the new work path
- // will be used for the next open dialog.
- SvtViewOptions aDlgOpt( E_DIALOG, IODLG_CONFIGNAME );
- aDlgOpt.Delete();
- // Reset also last used dir in the sfx application instance
- SfxApplication *pSfxApp = SFX_APP();
- pSfxApp->ResetLastDir();
-
- // Set configuration flag to notify file picker that it's necessary
- // to take over the path provided.
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- ::comphelper::ConfigurationHelper::writeDirectKey(xFactory,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Path/Info")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPathChanged")),
- ::com::sun::star::uno::makeAny(true),
- ::comphelper::ConfigurationHelper::E_STANDARD);
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPathTabPage, PathHdl_Impl, PushButton *, EMPTYARG )
-{
- SvLBoxEntry* pEntry = pPathBox->GetCurEntry();
- USHORT nPos = ( pEntry != NULL ) ? ( (PathUserData_Impl*)pEntry->GetUserData() )->nRealId : 0;
- String sInternal, sUser, sWritable;
- if ( pEntry )
- {
- PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
- sal_Bool bReadOnly = sal_False;
- GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
- sUser = pPathImpl->sUserPath;
- sWritable = pPathImpl->sWritablePath;
- }
-
- if(pEntry && !(!((OptHeaderTabListBox*)pPathBox)->GetCollapsedEntryBmp(pEntry)))
- return 0;
-
- if ( IsMultiPath_Impl( nPos ) )
- {
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- AbstractSvxMultiPathDialog* pMultiDlg =
- pFact->CreateSvxMultiPathDialog( this, RID_SVXDLG_MULTIPATH );
- DBG_ASSERT( pMultiDlg, "Dialogdiet fail!" );
- pMultiDlg->EnableRadioButtonMode();
-
- String sPath( sUser );
- if ( sPath.Len() > 0 )
- sPath += MULTIPATH_DELIMITER;
- sPath += sWritable;
- pMultiDlg->SetPath( sPath );
-
- String sPathName = pPathBox->GetEntryText( pEntry, 0 );
- String sNewTitle( pImpl->m_sMultiPathDlg );
- sNewTitle.SearchAndReplace( VAR_ONE, sPathName );
- pMultiDlg->SetTitle( sNewTitle );
-
- if ( pMultiDlg->Execute() == RET_OK && pEntry )
- {
- sUser.Erase();
- sWritable.Erase();
- String sFullPath;
- String sNewPath = pMultiDlg->GetPath();
- char cDelim = MULTIPATH_DELIMITER;
- USHORT nCount = sNewPath.GetTokenCount( cDelim );
- if ( nCount > 0 )
- {
- USHORT i = 0;
- for ( ; i < nCount - 1; ++i )
- {
- if ( sUser.Len() > 0 )
- sUser += cDelim;
- sUser += sNewPath.GetToken( i, cDelim );
- }
- if ( sFullPath.Len() > 0 )
- sFullPath += cDelim;
- sFullPath += sUser;
- sWritable += sNewPath.GetToken( i, cDelim );
- if ( sFullPath.Len() > 0 )
- sFullPath += cDelim;
- sFullPath += sWritable;
- }
-
- pPathBox->SetEntryText( Convert_Impl( sFullPath ), pEntry, 1 );
- // save modified flag
- PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
- pPathImpl->eState = SFX_ITEM_SET;
- pPathImpl->sUserPath = sUser;
- pPathImpl->sWritablePath = sWritable;
- }
- delete pMultiDlg;
- }
- }
- else if ( pEntry )
- {
- try
- {
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- xFolderPicker = ::com::sun::star::uno::Reference< XFolderPicker >(
- xFactory->createInstance( aService ), UNO_QUERY );
-
-// svt::SetDialogHelpId( xFolderPicker, HID_OPTIONS_PATHS_SELECTFOLDER );
-
- INetURLObject aURL( sWritable, INET_PROT_FILE );
- xFolderPicker->setDisplayDirectory( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY );
- if ( xAsyncDlg.is() )
- xAsyncDlg->startExecuteModal( xDialogListener.get() );
- else
- {
- short nRet = xFolderPicker->execute();
- if ( ExecutableDialogResults::OK != nRet )
- return 0;
-
- String sFolder( xFolderPicker->getDirectory() );
- ChangeCurrentEntry( sFolder );
- }
- }
- catch( Exception& )
- {
- DBG_ERRORFILE( "SvxPathTabPage::PathHdl_Impl: exception from folder picker" );
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPathTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
-{
- if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
- return 0;
-
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- SvSortMode eMode = SortAscending;
-
- if ( bUp )
- {
- nBits &= ~HIB_UPARROW;
- nBits |= HIB_DOWNARROW;
- eMode = SortDescending;
- }
- else
- {
- nBits &= ~HIB_DOWNARROW;
- nBits |= HIB_UPARROW;
- }
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
- SvTreeList* pModel = pPathBox->GetModel();
- pModel->SetSortMode( eMode );
- pModel->Resort();
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
-{
- if ( pBar && !pBar->GetCurItemId() )
- return 0;
-
- if ( !pHeaderBar->IsItemMode() )
- {
- Size aSz;
- USHORT nTabs = pHeaderBar->GetItemCount();
- long nTmpSz = 0;
- long nWidth = pHeaderBar->GetItemSize(ITEMID_TYPE);
- long nBarWidth = pHeaderBar->GetSizePixel().Width();
-
- if(nWidth < TAB_WIDTH_MIN)
- pHeaderBar->SetItemSize( ITEMID_TYPE, TAB_WIDTH_MIN);
- else if ( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- pHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
-
- for ( USHORT i = 1; i <= nTabs; ++i )
- {
- long _nWidth = pHeaderBar->GetItemSize(i);
- aSz.Width() = _nWidth + nTmpSz;
- nTmpSz += _nWidth;
- pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT );
- }
- }
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPathTabPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
-{
- if ( RET_OK == pEvt->DialogResult )
- {
- DBG_ASSERT( xFolderPicker.is() == sal_True, "SvxPathTabPage::DialogClosedHdl(): no folder picker" );
-
- String sURL = String( xFolderPicker->getDirectory() );
- ChangeCurrentEntry( sURL );
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPathTabPage::GetPathList(
- USHORT _nPathHandle, String& _rInternalPath,
- String& _rUserPath, String& _rWritablePath, sal_Bool& _rReadOnly )
-{
- String sCfgName = getCfgName_Impl( _nPathHandle );
-
- // load PathSettings service if necessary
- if ( !pImpl->m_xPathSettings.is() )
- {
- Reference< XMultiServiceFactory > xSMgr = comphelper::getProcessServiceFactory();
- pImpl->m_xPathSettings = Reference< XPropertySet >( xSMgr->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.PathSettings") ) ), UNO_QUERY );
- }
-
- try
- {
- if ( pImpl->m_xPathSettings.is() )
- {
- // load internal paths
- String sProp( sCfgName );
- sProp = sCfgName;
- sProp += POSTFIX_INTERNAL;
- Any aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
- Sequence< ::rtl::OUString > aPathSeq;
- if ( aAny >>= aPathSeq )
- {
- long i, nCount = aPathSeq.getLength();
- const ::rtl::OUString* pPaths = aPathSeq.getConstArray();
-
- for ( i = 0; i < nCount; ++i )
- {
- if ( _rInternalPath.Len() > 0 )
- _rInternalPath += ';';
- _rInternalPath += String( pPaths[i] );
- }
- }
- // load user paths
- sProp = sCfgName;
- sProp += POSTFIX_USER;
- aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
- if ( aAny >>= aPathSeq )
- {
- long i, nCount = aPathSeq.getLength();
- const ::rtl::OUString* pPaths = aPathSeq.getConstArray();
-
- for ( i = 0; i < nCount; ++i )
- {
- if ( _rUserPath.Len() > 0 )
- _rUserPath += ';';
- _rUserPath += String( pPaths[i] );
- }
- }
- // then the writable path
- sProp = sCfgName;
- sProp += POSTFIX_WRITABLE;
- aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
- ::rtl::OUString sWritablePath;
- if ( aAny >>= sWritablePath )
- _rWritablePath = String( sWritablePath );
-
- // and the readonly flag
- sProp = sCfgName;
- Reference< XPropertySetInfo > xInfo = pImpl->m_xPathSettings->getPropertySetInfo();
- Property aProp = xInfo->getPropertyByName( sProp );
- _rReadOnly = ( ( aProp.Attributes & PropertyAttribute::READONLY ) == PropertyAttribute::READONLY );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "SvxPathTabPage::GetPathList(): caught an exception!" );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPathTabPage::SetPathList(
- USHORT _nPathHandle, const String& _rUserPath, const String& _rWritablePath )
-{
- String sCfgName = getCfgName_Impl( _nPathHandle );
-
- // load PathSettings service if necessary
- if ( !pImpl->m_xPathSettings.is() )
- {
- Reference< XMultiServiceFactory > xSMgr = comphelper::getProcessServiceFactory();
- pImpl->m_xPathSettings = Reference< XPropertySet >( xSMgr->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.PathSettings") ) ), UNO_QUERY );
- }
-
- try
- {
- if ( pImpl->m_xPathSettings.is() )
- {
- // save user paths
- char cDelim = MULTIPATH_DELIMITER;
- USHORT nCount = _rUserPath.GetTokenCount( cDelim );
- Sequence< ::rtl::OUString > aPathSeq( nCount );
- ::rtl::OUString* pArray = aPathSeq.getArray();
- for ( USHORT i = 0; i < nCount; ++i )
- pArray[i] = ::rtl::OUString( _rUserPath.GetToken( i, cDelim ) );
- String sProp( sCfgName );
- sProp += POSTFIX_USER;
- Any aValue = makeAny( aPathSeq );
- pImpl->m_xPathSettings->setPropertyValue( sProp, aValue );
-
- // then the writable path
- aValue = makeAny( ::rtl::OUString( _rWritablePath ) );
- sProp = sCfgName;
- sProp += POSTFIX_WRITABLE;
- pImpl->m_xPathSettings->setPropertyValue( sProp, aValue );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "SvxPathTabPage::SetPathList(): caught an exception!" );
- }
-}
-
diff --git a/svx/source/cui/optpath.hxx b/svx/source/cui/optpath.hxx
deleted file mode 100644
index 5c51e2f214..0000000000
--- a/svx/source/cui/optpath.hxx
+++ /dev/null
@@ -1,119 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optpath.hxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTPATH_HXX
-#define _SVX_OPTPATH_HXX
-
-// include ---------------------------------------------------------------
-
-#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-
-#ifdef _SVX_OPTPATH_CXX
-#include <svtools/headbar.hxx>
-#else
-class HeaderBar;
-#endif
-#include "ControlFocusHelper.hxx"
-
-#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
-#include <svtools/dialogclosedlistener.hxx>
-
-// forward ---------------------------------------------------------------
-
-class SvTabListBox;
-namespace svx
-{
- class OptHeaderTabListBox;
-}
-struct OptPath_Impl;
-class SvxPathTabPage;
-
-// define ----------------------------------------------------------------
-
-#define SfxPathTabPage SvxPathTabPage
-
-// class SvxPathTabPage --------------------------------------------------
-
-class SvxPathTabPage : public SfxTabPage
-{
-private:
- FixedText aTypeText;
- FixedText aPathText;
- SvxControlFocusHelper aPathCtrl;
- PushButton aStandardBtn;
- PushButton aPathBtn;
- FixedLine aStdBox;
-
- HeaderBar* pHeaderBar;
- ::svx::OptHeaderTabListBox* pPathBox;
- OptPath_Impl* pImpl;
-
- ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
- ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker;
-
-#ifdef _SVX_OPTPATH_CXX
- void ChangeCurrentEntry( const String& _rFolder );
-
- DECL_LINK( PathHdl_Impl, PushButton * );
- DECL_LINK( StandardHdl_Impl, PushButton * );
-
- DECL_LINK( PathSelect_Impl, OptHeaderTabListBox * );
- DECL_LINK( HeaderSelect_Impl, HeaderBar * );
- DECL_LINK( HeaderEndDrag_Impl, HeaderBar * );
-
- DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
-
- void GetPathList( USHORT _nPathHandle, String& _rInternalPath,
- String& _rUserPath, String& _rWritablePath, sal_Bool& _rReadOnly );
- void SetPathList( USHORT _nPathHandle,
- const String& _rUserPath, const String& _rWritablePath );
-#endif
-
-public:
- SvxPathTabPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxPathTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void FillUserData();
-};
-
-#endif
-
diff --git a/svx/source/cui/optsave.cxx b/svx/source/cui/optsave.cxx
deleted file mode 100644
index e076c66e1d..0000000000
--- a/svx/source/cui/optsave.cxx
+++ /dev/null
@@ -1,826 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optsave.cxx,v $
- * $Revision: 1.21 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#define _SVX_OPTSAVE_CXX
-
-#include "optsave.hrc"
-#include <svx/dialogs.hrc>
-
-#include "optsave.hxx"
-#include <svx/dialmgr.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/sequenceasvector.hxx>
-#include <comphelper/sequenceashashmap.hxx>
-#include <svtools/moduleoptions.hxx>
-#include <svtools/saveopt.hxx>
-#include <comphelper/sequenceasvector.hxx>
-#include <comphelper/sequenceashashmap.hxx>
-#include <com/sun/star/container/XContainerQuery.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XContainerQuery.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <sfx2/docfilt.hxx>
-#include <svtools/stdctrl.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/msgbox.hxx>
-#include <unotools/configitem.hxx>
-#include <svtools/optionsdlg.hxx>
-
-#include <vcl/msgbox.hxx>
-
-using namespace com::sun::star::uno;
-using namespace com::sun::star::util;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::container;
-using namespace comphelper;
-using rtl::OUString;
-
-#define C2U(cChar) OUString::createFromAscii(cChar)
-#define C2S(cChar) String( RTL_CONSTASCII_STRINGPARAM(cChar) )
-#define CFG_PAGE_AND_GROUP C2S("General"), C2S("LoadSave")
-// !! you have to update these index, if you changed the list of the child windows !!
-#define WININDEX_AUTOSAVE ((USHORT)6)
-#define WININDEX_SAVEURL_RELFSYS ((USHORT)9)
-
-// -------------------- --------------------------------------------------
-class FilterWarningDialog_Impl : public ModalDialog
-{
- OKButton aOk;
- CancelButton aCancel;
- FixedImage aImage;
- FixedInfo aFilterWarningFT;
-
- public:
- FilterWarningDialog_Impl(Window* pParent);
-
- void SetFilterName(const String& rFilterUIName);
-};
-// ----------------------------------------------------------------------
-FilterWarningDialog_Impl::FilterWarningDialog_Impl(Window* pParent) :
- ModalDialog(pParent, SVX_RES( RID_SVXDLG_FILTER_WARNING ) ),
- aOk( this, SVX_RES(PB_OK )),
- aCancel( this, SVX_RES(PB_CANCEL )),
- aImage( this, SVX_RES(IMG_WARNING )),
- aFilterWarningFT( this, SVX_RES(FT_FILTER_WARNING ))
-{
- FreeResource();
- aImage.SetImage(WarningBox::GetStandardImage());
-}
-// ----------------------------------------------------------------------
-void FilterWarningDialog_Impl::SetFilterName(const String& rFilterUIName)
-{
- String sTmp(aFilterWarningFT.GetText());
- sTmp.SearchAndReplaceAscii("%1", rFilterUIName);
- aFilterWarningFT.SetText(sTmp);
-}
-// ----------------------------------------------------------------------
-#ifdef FILTER_WARNING_ENABLED
-class SvxAlienFilterWarningConfig_Impl : public utl::ConfigItem
-{
- sal_Bool bWarning;
- com::sun::star::uno::Sequence< OUString > aPropNames;
-
- public:
- SvxAlienFilterWarningConfig_Impl();
- ~SvxAlienFilterWarningConfig_Impl();
-
- virtual void Commit();
-
- void ResetWarning()
- {
- if(bWarning)
- {
- bWarning = sal_False;
- ConfigItem::SetModified();
- }
-
- }
- sal_Bool IsWarning()const{return bWarning;}
-};
-// ----------------------------------------------------------------------
-SvxAlienFilterWarningConfig_Impl::SvxAlienFilterWarningConfig_Impl() :
- ConfigItem(C2U("TypeDetection.Misc/Defaults"),
- CONFIG_MODE_IMMEDIATE_UPDATE),
- aPropNames(1),
- bWarning(sal_True)
-{
- aPropNames.getArray()[0] = C2U("ShowAlienFilterWarning");
- Sequence<Any> aValues = GetProperties(aPropNames);
- const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aPropNames.getLength(), "GetProperties failed");
- if(aValues.getLength() == aPropNames.getLength() &&
- pValues[0].hasValue() &&
- pValues[0].getValueType() == ::getBooleanCppuType())
- bWarning = *(sal_Bool*)pValues[0].getValue();
-}
-// ----------------------------------------------------------------------
-SvxAlienFilterWarningConfig_Impl::~SvxAlienFilterWarningConfig_Impl()
-{
- if(IsModified())
- Commit();
-}
-// ----------------------------------------------------------------------
-void SvxAlienFilterWarningConfig_Impl::Commit()
-{
- Sequence<Any> aValues(aPropNames.getLength());
- Any* pValues = aValues.getArray();
- pValues[0].setValue(&bWarning, ::getBooleanCppuType());
- PutProperties(aPropNames, aValues);
-}
-#endif // FILTER_WARNING_ENABLED
-// ----------------------------------------------------------------------
-// ----------------------------------------------------------------------
-
-struct SvxSaveTabPage_Impl
-{
- Reference< XNameContainer > xFact;
- Sequence< OUString > aFilterArr[APP_COUNT];
- Sequence< sal_Bool > aAlienArr[APP_COUNT];
- Sequence< sal_Bool > aODFArr[APP_COUNT];
- Sequence< OUString > aUIFilterArr[APP_COUNT];
- OUString aDefaultArr[APP_COUNT];
- sal_Bool aDefaultReadonlyArr[APP_COUNT];
- sal_Bool bInitialized;
-
- SvxSaveTabPage_Impl();
- ~SvxSaveTabPage_Impl();
-};
-
-SvxSaveTabPage_Impl::SvxSaveTabPage_Impl() : bInitialized( sal_False )
-{
-}
-
-SvxSaveTabPage_Impl::~SvxSaveTabPage_Impl()
-{
-}
-
-// class SvxSaveTabPage --------------------------------------------------
-
-SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SFXPAGE_SAVE ), rCoreSet ),
-
- aLoadFL ( this, SVX_RES( LB_LOAD ) ),
- aLoadUserSettingsCB ( this, SVX_RES( CB_LOAD_SETTINGS ) ),
- aLoadDocPrinterCB ( this, SVX_RES( CB_LOAD_DOCPRINTER ) ),
-
- aSaveFL ( this, SVX_RES( GB_SAVE ) ),
- aDocInfoCB ( this, SVX_RES( BTN_DOCINFO ) ),
- aBackupFI ( this, SVX_RES( FI_BACKUP ) ),
- aBackupCB ( this, SVX_RES( BTN_BACKUP ) ),
- aAutoSaveCB ( this, SVX_RES( BTN_AUTOSAVE ) ),
- aAutoSaveEdit ( this, SVX_RES( ED_AUTOSAVE ) ),
- aMinuteFT ( this, SVX_RES( FT_MINUTE ) ),
- aRelativeFsysCB ( this, SVX_RES( BTN_RELATIVE_FSYS ) ),
- aRelativeInetCB ( this, SVX_RES( BTN_RELATIVE_INET ) ),
-
- aDefaultFormatFL ( this, SVX_RES( FL_FILTER ) ),
- aODFVersionFT ( this, SVX_RES( FT_ODF_VERSION ) ),
- aODFVersionLB ( this, SVX_RES( LB_ODF_VERSION ) ),
- aSizeOptimizationCB ( this, SVX_RES( BTN_NOPRETTYPRINTING ) ),
- aWarnAlienFormatCB ( this, SVX_RES( BTN_WARNALIENFORMAT ) ),
- aDocTypeFT ( this, SVX_RES( FT_APP ) ),
- aDocTypeLB ( this, SVX_RES( LB_APP ) ),
- aSaveAsFT ( this, SVX_RES( FT_FILTER ) ),
- aSaveAsFI ( this, SVX_RES( FI_FILTER ) ),
- aSaveAsLB ( this, SVX_RES( LB_FILTER ) ),
- aODFWarningFI ( this, SVX_RES( FI_ODF_WARNING ) ),
- aODFWarningFT ( this, SVX_RES( FT_WARN ) ),
-
- pImpl ( new SvxSaveTabPage_Impl )
-
-{
- sal_Bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- aODFWarningFI.SetImage(
- Image( SVX_RES( bHighContrast ? IMG_ODF_WARNING_HC : IMG_ODF_WARNING ) ) );
-
- FreeResource();
-
- Link aLink = LINK( this, SfxSaveTabPage, AutoClickHdl_Impl );
- aAutoSaveCB.SetClickHdl( aLink );
- aAutoSaveEdit.SetMaxTextLen( 2 );
-
- SvtModuleOptions aModuleOpt;
- if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
- {
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_MATH ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_MATH ));
- }
- else
- {
- pImpl->aDefaultArr[APP_MATH] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_MATH);
- pImpl->aDefaultReadonlyArr[APP_MATH] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_MATH);
- }
-
- if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
- {
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_DRAW ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_DRAW ));
- }
- else
- {
- pImpl->aDefaultArr[APP_DRAW] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_DRAW);
- pImpl->aDefaultReadonlyArr[APP_DRAW] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_DRAW);
- }
-
- if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
- {
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_IMPRESS ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_IMPRESS ));
- }
- else
- {
- pImpl->aDefaultArr[APP_IMPRESS] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_IMPRESS);
- pImpl->aDefaultReadonlyArr[APP_IMPRESS] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_IMPRESS);
- }
-
- if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
- {
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_CALC ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_CALC ));
- }
- else
- {
- pImpl->aDefaultArr[APP_CALC] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_CALC);
- pImpl->aDefaultReadonlyArr[APP_CALC] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_CALC);
- }
-
- if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
- {
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER ));
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER_WEB ));
- aSaveAsLB.RemoveEntry(aSaveAsLB.GetEntryPos( (void*) APP_WRITER_GLOBAL ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER_WEB ));
- aDocTypeLB.RemoveEntry(aDocTypeLB.GetEntryPos( (void*) APP_WRITER_GLOBAL ));
- }
- else
- {
- pImpl->aDefaultArr[APP_WRITER] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_WRITER);
- pImpl->aDefaultArr[APP_WRITER_WEB] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_WRITERWEB);
- pImpl->aDefaultArr[APP_WRITER_GLOBAL] = aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_WRITERGLOBAL);
- pImpl->aDefaultReadonlyArr[APP_WRITER] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_WRITER);
- pImpl->aDefaultReadonlyArr[APP_WRITER_WEB] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_WRITERWEB);
- pImpl->aDefaultReadonlyArr[APP_WRITER_GLOBAL] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::E_WRITERGLOBAL);
- }
-
- aLink = LINK( this, SfxSaveTabPage, ODFVersionHdl_Impl );
- aODFVersionLB.SetSelectHdl( aLink );
- aLink = LINK( this, SfxSaveTabPage, FilterHdl_Impl );
- aDocTypeLB.SetSelectHdl( aLink );
- aSaveAsLB.SetSelectHdl( aLink );
-
- DetectHiddenControls();
-}
-
-// -----------------------------------------------------------------------
-
-SfxSaveTabPage::~SfxSaveTabPage()
-{
- delete pImpl;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SfxSaveTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return ( new SfxSaveTabPage( pParent, rAttrSet ) );
-}
-
-/* -----------------------------05.04.01 13:10--------------------------------
-
- ---------------------------------------------------------------------------*/
-OUString lcl_ExtractUIName(const Sequence<PropertyValue> rProperties)
-{
- OUString sRet;
- const PropertyValue* pProperties = rProperties.getConstArray();
- for(int nProp = 0; nProp < rProperties.getLength(); nProp++)
- {
- if(!pProperties[nProp].Name.compareToAscii("UIName"))
- {
- pProperties[nProp].Value >>= sRet;
- break;
- }
- }
- return sRet;
-}
-// -----------------------------------------------------------------------
-bool SfxSaveTabPage::AcceptFilter( USHORT nPos )
-{
- const OUString* pFilters = pImpl->aFilterArr[nPos].getConstArray();
- sal_Bool bAlien = sal_False, bODF = sal_False;
- OUString* pUIFilters = pImpl->aUIFilterArr[nPos].getArray();
- OUString sUIName;
- for(int nFilter = 0; nFilter < pImpl->aFilterArr[nPos].getLength(); nFilter++)
- {
- if( pImpl->aDefaultArr[nPos] == pFilters[nFilter] )
- {
- bAlien = pImpl->aAlienArr[nPos][nFilter];
- bODF = pImpl->aODFArr[nPos][nFilter];
- sUIName = pUIFilters[nFilter];;
- break;
- }
- }
- bool bSet = true;
- return bSet;
-}
-// -----------------------------------------------------------------------
-void SfxSaveTabPage::DetectHiddenControls()
-{
- long nDelta = 0;
- // the index of the first child window which perhaps have to move upwards
- USHORT nWinIndex = WININDEX_SAVEURL_RELFSYS;
- SvtOptionsDialogOptions aOptionsDlgOpt;
-
- if ( aOptionsDlgOpt.IsOptionHidden( C2S("Backup"), CFG_PAGE_AND_GROUP ) )
- {
- // hide controls of "Backup"
- aBackupFI.Hide();
- aBackupCB.Hide();
- // the other controls have to move upwards the height of checkbox + space
- nDelta = aAutoSaveCB.GetPosPixel().Y() - aBackupCB.GetPosPixel().Y();
- }
-
- if ( aOptionsDlgOpt.IsOptionHidden( C2S("AutoSave"), CFG_PAGE_AND_GROUP ) )
- {
- // hide controls of "AutoSave"
- aAutoSaveCB.Hide();
- aAutoSaveEdit.Hide();
- aMinuteFT.Hide();
- // the other controls have to move upwards the height of checkbox + space
- nDelta += aRelativeFsysCB.GetPosPixel().Y() - aAutoSaveCB.GetPosPixel().Y();
- }
- else if ( nDelta > 0 )
- // the "AutoSave" controls have to move upwards too
- nWinIndex = WININDEX_AUTOSAVE;
-
- if ( nDelta > 0 )
- {
- USHORT i, nChildCount = GetChildCount();
- for ( i = nWinIndex; i < nChildCount; ++i )
- {
- Window* pWin = GetChild(i);
- Point aPos = pWin->GetPosPixel();
- aPos.Y() -= nDelta;
- pWin->SetPosPixel( aPos );
- }
- }
-}
-// -----------------------------------------------------------------------
-BOOL SfxSaveTabPage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bModified = FALSE;
- SvtSaveOptions aSaveOpt;
- if(aLoadUserSettingsCB.IsChecked() != aLoadUserSettingsCB.GetSavedValue())
- {
- aSaveOpt.SetLoadUserSettings(aLoadUserSettingsCB.IsChecked());
- }
-
- if ( aLoadDocPrinterCB.IsChecked() != aLoadDocPrinterCB.GetSavedValue() )
- aSaveOpt.SetLoadDocumentPrinter( aLoadDocPrinterCB.IsChecked() );
-
- if ( aODFVersionLB.GetSelectEntryPos() != aODFVersionLB.GetSavedValue() )
- {
- long nVersion = long( aODFVersionLB.GetEntryData( aODFVersionLB.GetSelectEntryPos() ) );
- aSaveOpt.SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion( nVersion ) );
- }
-
- if ( aDocInfoCB.IsChecked() != aDocInfoCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_DOCINFO ),
- aDocInfoCB.IsChecked() ) );
- bModified |= TRUE;
- }
-
- if ( aBackupCB.IsEnabled() && aBackupCB.IsChecked() != aBackupCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_BACKUP ),
- aBackupCB.IsChecked() ) );
- bModified |= TRUE;
- }
-
- if ( aSizeOptimizationCB.IsChecked() != aSizeOptimizationCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_PRETTYPRINTING ), !aSizeOptimizationCB.IsChecked() ) );
- bModified |= TRUE;
- }
-
- if ( aAutoSaveCB.IsChecked() != aAutoSaveCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_AUTOSAVE ),
- aAutoSaveCB.IsChecked() ) );
- bModified |= TRUE;
- }
- if ( aWarnAlienFormatCB.IsChecked() != aWarnAlienFormatCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_WARNALIENFORMAT ),
- aWarnAlienFormatCB.IsChecked() ) );
- bModified |= TRUE;
- }
-
- if ( aAutoSaveEdit.GetText() != aAutoSaveEdit.GetSavedValue() )
- {
- rSet.Put( SfxUInt16Item( GetWhich( SID_ATTR_AUTOSAVEMINUTE ),
- (UINT16)aAutoSaveEdit.GetValue() ) );
- bModified |= TRUE;
- }
- // relativ speichern
- if ( aRelativeFsysCB.IsChecked() != aRelativeFsysCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_SAVEREL_FSYS ),
- aRelativeFsysCB.IsChecked() ) );
- bModified |= TRUE;
- }
-
- if ( aRelativeInetCB.IsChecked() != aRelativeInetCB.GetSavedValue() )
- {
- rSet.Put( SfxBoolItem( GetWhich( SID_SAVEREL_INET ),
- aRelativeInetCB.IsChecked() ) );
- bModified |= TRUE;
- }
-
- SvtModuleOptions aModuleOpt;
- if(pImpl->aDefaultArr[APP_MATH].getLength() &&
- pImpl->aDefaultArr[APP_MATH] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_MATH) &&
- AcceptFilter( APP_MATH ))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_MATH, pImpl->aDefaultArr[APP_MATH]);
-
- if( pImpl->aDefaultArr[APP_DRAW].getLength() &&
- pImpl->aDefaultArr[APP_DRAW] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_DRAW) &&
- AcceptFilter( APP_DRAW ))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_DRAW, pImpl->aDefaultArr[APP_DRAW]);
-
- if(pImpl->aDefaultArr[APP_IMPRESS].getLength() &&
- pImpl->aDefaultArr[APP_IMPRESS] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_IMPRESS)&&
- AcceptFilter( APP_IMPRESS ))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_IMPRESS, pImpl->aDefaultArr[APP_IMPRESS]);
-
- if(pImpl->aDefaultArr[APP_CALC].getLength() &&
- pImpl->aDefaultArr[APP_CALC] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_CALC)&&
- AcceptFilter( APP_CALC ))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_CALC, pImpl->aDefaultArr[APP_CALC]);
-
- if(pImpl->aDefaultArr[APP_WRITER].getLength() &&
- pImpl->aDefaultArr[APP_WRITER] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_WRITER)&&
- AcceptFilter( APP_WRITER))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_WRITER, pImpl->aDefaultArr[APP_WRITER]);
-
- if(pImpl->aDefaultArr[APP_WRITER_WEB].getLength() &&
- pImpl->aDefaultArr[APP_WRITER_WEB] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_WRITERWEB)&&
- AcceptFilter( APP_WRITER_WEB ))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_WRITERWEB, pImpl->aDefaultArr[APP_WRITER_WEB]);
-
- if(pImpl->aDefaultArr[APP_WRITER_GLOBAL].getLength() &&
- pImpl->aDefaultArr[APP_WRITER_GLOBAL] != aModuleOpt.GetFactoryDefaultFilter(SvtModuleOptions::E_WRITERGLOBAL)&&
- AcceptFilter( APP_WRITER_GLOBAL ))
- aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::E_WRITERGLOBAL, pImpl->aDefaultArr[APP_WRITER_GLOBAL]);
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool isODFFormat( OUString sFilter )
-{
- static const char* aODFFormats[] =
- {
- "writer8",
- "writer8_template",
- "writerglobal8",
- "writerglobal8_writer",
- "calc8",
- "calc8_template",
- "draw8",
- "draw8_template",
- "impress8",
- "impress8_template",
- "impress8_draw",
- "chart8",
- "math8",
- NULL
- };
-
- sal_Bool bRet = sal_False;
- int i = 0;
- while ( aODFFormats[i] != NULL )
- {
- if ( sFilter.equalsAscii( aODFFormats[i++] ) )
- {
- bRet = sal_True;
- break;
- }
- }
-
- return bRet;
-}
-
-void SfxSaveTabPage::Reset( const SfxItemSet& )
-{
- SvtSaveOptions aSaveOpt;
- aLoadUserSettingsCB.Check(aSaveOpt.IsLoadUserSettings());
- aLoadUserSettingsCB.SaveValue();
- aLoadDocPrinterCB.Check( aSaveOpt.IsLoadDocumentPrinter() );
- aLoadDocPrinterCB.SaveValue();
-
- if ( !pImpl->bInitialized )
- {
- try
- {
- Reference< XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
- pImpl->xFact = Reference<XNameContainer>(
- xMSF->createInstance(C2U("com.sun.star.document.FilterFactory")), UNO_QUERY);
-
- DBG_ASSERT(pImpl->xFact.is(), "service com.sun.star.document.FilterFactory unavailable");
- Reference< XContainerQuery > xQuery(pImpl->xFact, UNO_QUERY);
- if(xQuery.is())
- {
- for(USHORT n = 0; n < aDocTypeLB.GetEntryCount(); n++)
- {
- long nData = (long) aDocTypeLB.GetEntryData(n);
- OUString sCommand;
- sCommand = C2U("matchByDocumentService=%1:iflags=");
- sCommand += String::CreateFromInt32(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT);
- sCommand += C2U(":eflags=");
- sCommand += String::CreateFromInt32(SFX_FILTER_NOTINFILEDLG);
- sCommand += C2U(":default_first");
- String sReplace;
- switch(nData)
- {
- case APP_WRITER : sReplace = C2U("com.sun.star.text.TextDocument"); break;
- case APP_WRITER_WEB : sReplace = C2U("com.sun.star.text.WebDocument"); break;
- case APP_WRITER_GLOBAL : sReplace = C2U("com.sun.star.text.GlobalDocument"); break;
- case APP_CALC : sReplace = C2U("com.sun.star.sheet.SpreadsheetDocument");break;
- case APP_IMPRESS : sReplace = C2U("com.sun.star.presentation.PresentationDocument");break;
- case APP_DRAW : sReplace = C2U("com.sun.star.drawing.DrawingDocument");break;
- case APP_MATH : sReplace = C2U("com.sun.star.formula.FormulaProperties");break;
- default: DBG_ERROR("illegal user data");
- }
- String sTmp(sCommand);
- sTmp.SearchAndReplaceAscii("%1", sReplace);
- sCommand = sTmp;
- Reference< XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
- SequenceAsVector< OUString > lList;
- SequenceAsVector< sal_Bool > lAlienList;
- SequenceAsVector< sal_Bool > lODFList;
- while(xList->hasMoreElements())
- {
- SequenceAsHashMap aFilter(xList->nextElement());
- OUString sFilter = aFilter.getUnpackedValueOrDefault(OUString::createFromAscii("Name"),OUString());
- if (sFilter.getLength())
- {
- sal_Int32 nFlags = aFilter.getUnpackedValueOrDefault(OUString::createFromAscii("Flags"),sal_Int32());
- lList.push_back(sFilter);
- lAlienList.push_back(0 != (nFlags & SFX_FILTER_ALIEN));
- lODFList.push_back( isODFFormat( sFilter ) );
- }
- }
- pImpl->aFilterArr[nData] = lList.getAsConstList();
- pImpl->aAlienArr[nData] = lAlienList.getAsConstList();
- pImpl->aODFArr[nData] = lODFList.getAsConstList();
- }
- }
- aDocTypeLB.SelectEntryPos(0);
- FilterHdl_Impl(&aDocTypeLB);
- }
- catch(Exception& )
- {
- DBG_ERROR("exception in FilterFactory access");
- }
-
- pImpl->bInitialized = sal_True;
- }
-
- aDocInfoCB.Check(aSaveOpt.IsDocInfoSave());
-// aDocInfoCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE));
-
- aBackupCB.Check(aSaveOpt.IsBackup());
- BOOL bBackupRO = aSaveOpt.IsReadOnly(SvtSaveOptions::E_BACKUP);
- aBackupCB.Enable(!bBackupRO);
- aBackupFI.Show(bBackupRO);
-
- aAutoSaveCB.Check(aSaveOpt.IsAutoSave());
- aWarnAlienFormatCB.Check(aSaveOpt.IsWarnAlienFormat());
- aWarnAlienFormatCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT));
-// aAutoSaveCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVE));
-
- // the pretty printing
- aSizeOptimizationCB.Check( !aSaveOpt.IsPrettyPrinting());
-// aSizeOptimizationCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING ));
-
-
- aAutoSaveEdit.SetValue( aSaveOpt.GetAutoSaveTime() );
-// aAutoSaveEdit.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME));
-
- // relativ speichern
- aRelativeFsysCB.Check( aSaveOpt.IsSaveRelFSys() );
-// aRelativeFsysCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS));
-
- aRelativeInetCB.Check( aSaveOpt.IsSaveRelINet() );
-// aRelativeInetCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_SAVERELINET));
-
- void* pDefaultVersion = (void*)long( aSaveOpt.GetODFDefaultVersion() );
- aODFVersionLB.SelectEntryPos( aODFVersionLB.GetEntryPos( pDefaultVersion ) );
-
- AutoClickHdl_Impl( &aAutoSaveCB );
- ODFVersionHdl_Impl( &aODFVersionLB );
-
- aDocInfoCB.SaveValue();
- aBackupCB.SaveValue();
- aWarnAlienFormatCB.SaveValue();
- aSizeOptimizationCB.SaveValue();
- aAutoSaveCB.SaveValue();
- aAutoSaveEdit.SaveValue();
-// aAutoSavePromptBtn.SaveValue();
-
- aRelativeFsysCB.SaveValue();
- aRelativeInetCB.SaveValue();
- aODFVersionLB.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SfxSaveTabPage, AutoClickHdl_Impl, CheckBox *, pBox )
-{
- if ( pBox == &aAutoSaveCB )
- {
- if ( aAutoSaveCB.IsChecked() )
- {
- aAutoSaveEdit.Enable();
- aMinuteFT.Enable();
-// aAutoSavePromptBtn.Enable();
- aAutoSaveEdit.GrabFocus();
- }
- else
- {
- aAutoSaveEdit.Disable();
- aMinuteFT.Disable();
-// aAutoSavePromptBtn.Disable();
- }
- }
- return 0;
-}
-/* -----------------------------05.04.01 13:10--------------------------------
-
- ---------------------------------------------------------------------------*/
-OUString lcl_ExtracUIName(const Sequence<PropertyValue> rProperties)
-{
- OUString sRet;
- sal_Int32 nFlags;
- const PropertyValue* pProperties = rProperties.getConstArray();
- for(int nProp = 0; nProp < rProperties.getLength(); nProp++)
- {
- if(!pProperties[nProp].Name.compareToAscii("UIName"))
- {
- pProperties[nProp].Value >>= sRet;
-//! break;
- }
- else if(!pProperties[nProp].Name.compareToAscii("Flags"))
- {
- if ( pProperties[nProp].Value >>= nFlags )
- {
- nFlags &= 0x100;
- }
- }
- else if(!pProperties[nProp].Name.compareToAscii("Name"))
- {
- pProperties[nProp].Value >>= sRet;
- }
- }
- return sRet;
-}
-/* -----------------------------05.04.01 13:37--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
-{
- USHORT nCurPos = aDocTypeLB.GetSelectEntryPos();
-
- long nData = -1;
- if(nCurPos < APP_COUNT)
- nData = (long) aDocTypeLB.GetEntryData(nCurPos);
-
- if ( nData >= 0 && nData < APP_COUNT )
- {
- if(&aDocTypeLB == pBox)
- {
- aSaveAsLB.Clear();
- const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray();
- if(!pImpl->aUIFilterArr[nData].getLength())
- {
- pImpl->aUIFilterArr[nData].realloc(pImpl->aFilterArr[nData].getLength());
- OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray();
- for(int nFilter = 0; nFilter < pImpl->aFilterArr[nData].getLength(); nFilter++)
- {
- Any aProps = pImpl->xFact->getByName(pFilters[nFilter]);
- Sequence<PropertyValue> aProperties;
- aProps >>= aProperties;
- pUIFilters[nFilter] = lcl_ExtracUIName(aProperties);
- }
- }
- const OUString* pUIFilters = pImpl->aUIFilterArr[nData].getConstArray();
- OUString sSelect;
- for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++)
- {
- USHORT nEntryPos = aSaveAsLB.InsertEntry(pUIFilters[i]);
- if ( pImpl->aODFArr[nData][i] )
- aSaveAsLB.SetEntryData( nEntryPos, (void*)pImpl );
- if(pFilters[i] == pImpl->aDefaultArr[nData])
- sSelect = pUIFilters[i];
- }
- if(sSelect.getLength())
- aSaveAsLB.SelectEntry(sSelect);
- aSaveAsFI.Show(pImpl->aDefaultReadonlyArr[nData]);
- aSaveAsFT.Enable(!pImpl->aDefaultReadonlyArr[nData]);
- aSaveAsLB.Enable(!pImpl->aDefaultReadonlyArr[nData]);
- }
- else
- {
- OUString sSelect = pBox->GetSelectEntry();
- const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray();
- OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray();
- for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++)
- if(pUIFilters[i] == sSelect)
- {
- sSelect = pFilters[i];
- break;
- }
-
- pImpl->aDefaultArr[nData] = sSelect;
- }
- }
-
- ODFVersionHdl_Impl( &aSaveAsLB );
- return 0;
-};
-
-IMPL_LINK( SfxSaveTabPage, ODFVersionHdl_Impl, ListBox *, EMPTYARG )
-{
- long nVersion = long( aODFVersionLB.GetEntryData( aODFVersionLB.GetSelectEntryPos() ) );
- bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST;
- if ( bShown )
- {
- bool bHasODFFormat = false;
- USHORT i = 0, nCount = aSaveAsLB.GetEntryCount();
- for ( ; i < nCount; ++ i )
- {
- if ( aSaveAsLB.GetEntryData(i) != NULL )
- {
- bHasODFFormat = true;
- break;
- }
- }
-
- bShown = !bHasODFFormat
- || ( aSaveAsLB.GetEntryData( aSaveAsLB.GetSelectEntryPos() ) != NULL );
- }
-
- aODFWarningFI.Show( bShown );
- aODFWarningFT.Show( bShown );
-
- return 0;
-}
-
diff --git a/svx/source/cui/optsave.hxx b/svx/source/cui/optsave.hxx
deleted file mode 100644
index 4971ccc68a..0000000000
--- a/svx/source/cui/optsave.hxx
+++ /dev/null
@@ -1,108 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optsave.hxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTSAVE_HXX
-#define _SVX_OPTSAVE_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <com/sun/star/uno/Reference.h>
-#include <readonlyimage.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace beans {
- struct PropertyValue;
-}}}}
-
-// define ----------------------------------------------------------------
-
-#define SfxSaveTabPage SvxSaveTabPage
-
-// class SvxSaveTabPage --------------------------------------------------
-
-struct SvxSaveTabPage_Impl;
-
-class SvxSaveTabPage : public SfxTabPage
-{
-private:
- FixedLine aLoadFL;
- CheckBox aLoadUserSettingsCB;
- CheckBox aLoadDocPrinterCB;
-
- FixedLine aSaveFL;
- CheckBox aDocInfoCB;
- ReadOnlyImage aBackupFI;
- CheckBox aBackupCB;
- CheckBox aAutoSaveCB;
- NumericField aAutoSaveEdit;
- FixedText aMinuteFT;
- CheckBox aRelativeFsysCB;
- CheckBox aRelativeInetCB;
-
- FixedLine aDefaultFormatFL;
- FixedText aODFVersionFT;
- ListBox aODFVersionLB;
- CheckBox aSizeOptimizationCB;
- CheckBox aWarnAlienFormatCB;
- FixedText aDocTypeFT;
- ListBox aDocTypeLB;
- FixedText aSaveAsFT;
- ReadOnlyImage aSaveAsFI;
- ListBox aSaveAsLB;
- FixedImage aODFWarningFI;
- FixedText aODFWarningFT;
-
- SvxSaveTabPage_Impl* pImpl;
-
-#ifdef _SVX_OPTSAVE_CXX
- DECL_LINK( AutoClickHdl_Impl, CheckBox * );
- DECL_LINK( FilterHdl_Impl, ListBox * );
- DECL_LINK( ODFVersionHdl_Impl, ListBox * );
-
- bool AcceptFilter( USHORT nPos );
- void DetectHiddenControls();
-#endif
-
-public:
- SvxSaveTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxSaveTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-};
-
-#endif // #ifndef _SVX_OPTSAVE_HXX
-
diff --git a/svx/source/cui/optupdt.cxx b/svx/source/cui/optupdt.cxx
deleted file mode 100644
index 25668f4149..0000000000
--- a/svx/source/cui/optupdt.cxx
+++ /dev/null
@@ -1,424 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optupdt.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <vcl/svapp.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <svtools/zforlist.hxx>
-
-#include "optupdt.hxx"
-#include "optupdt.hrc"
-
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-
-
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-
-#include <osl/file.hxx>
-#include <osl/security.hxx>
-
-namespace beans = ::com::sun::star::beans;
-namespace container = ::com::sun::star::container;
-namespace dialogs = ::com::sun::star::ui::dialogs;
-namespace frame = ::com::sun::star::frame;
-namespace lang = ::com::sun::star::lang;
-namespace uno = ::com::sun::star::uno;
-namespace util = ::com::sun::star::util;
-
-// define ----------------------------------------------------------------
-
-#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
-
-// class SvxOnlineUpdateTabPage --------------------------------------------------
-
-SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_ONLINEUPDATE ), rSet ),
- m_aOptionsLine( this, SVX_RES( FL_OPTIONS ) ),
- m_aAutoCheckCheckBox( this, SVX_RES( CB_AUTOCHECK ) ),
- m_aEveryDayButton( this, SVX_RES( RB_EVERYDAY ) ),
- m_aEveryWeekButton( this, SVX_RES( RB_EVERYWEEK ) ),
- m_aEveryMonthButton( this, SVX_RES( RB_EVERYMONTH ) ),
- m_aCheckNowButton( this, SVX_RES( PB_CHECKNOW ) ),
- m_aAutoDownloadCheckBox( this, SVX_RES( CB_AUTODOWNLOAD ) ),
- m_aDestPathLabel( this, SVX_RES( FT_DESTPATHLABEL ) ),
- m_aDestPath( this, SVX_RES( FT_DESTPATH ) ),
- m_aChangePathButton( this, SVX_RES( PB_CHANGEPATH ) ),
- m_aLastChecked( this, SVX_RES( FT_LASTCHECKED ) )
-{
- m_aNeverChecked = String( SVX_RES( STR_NEVERCHECKED ) );
- FreeResource();
-
- m_aAutoCheckCheckBox.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, AutoCheckHdl_Impl ) );
- m_aCheckNowButton.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, CheckNowHdl_Impl ) );
- m_aChangePathButton.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, FileDialogHdl_Impl ) );
-
- uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-
- m_xUpdateAccess = uno::Reference < container::XNameReplace >(
- xFactory->createInstance( UNISTRING( "com.sun.star.setup.UpdateCheckConfig" ) ),
- uno::UNO_QUERY_THROW );
-
- sal_Bool bDownloadSupported = sal_False;
- m_xUpdateAccess->getByName( UNISTRING( "DownloadSupported") ) >>= bDownloadSupported;
-
- WinBits nStyle = m_aDestPath.GetStyle();
- nStyle |= WB_PATHELLIPSIS;
- m_aDestPath.SetStyle(nStyle);
-
- m_aAutoDownloadCheckBox.Show(bDownloadSupported);
- m_aDestPathLabel.Show(bDownloadSupported);
- m_aDestPath.Show(bDownloadSupported);
- m_aChangePathButton.Show(bDownloadSupported);
-
- // dynamical length of the PushButtons
- CalcButtonWidth();
-
- m_aLastCheckedTemplate = m_aLastChecked.GetText();
-
- UpdateLastCheckedText();
-}
-
-// -----------------------------------------------------------------------
-
-SvxOnlineUpdateTabPage::~SvxOnlineUpdateTabPage()
-{
-}
-
-// -----------------------------------------------------------------------
-void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
-{
- rtl::OUString aDateStr;
- rtl::OUString aTimeStr;
- rtl::OUString aText;
- sal_Int64 lastChecked = 0;
-
- m_xUpdateAccess->getByName( UNISTRING( "LastCheck") ) >>= lastChecked;
-
- if( lastChecked == 0 ) // never checked
- {
- aText = m_aNeverChecked;
- }
- else
- {
- TimeValue lastCheckedTV;
- oslDateTime lastCheckedDT;
-
- Date aDate;
- Time aTime;
-
- lastCheckedTV.Seconds = (sal_uInt32) lastChecked;
- osl_getLocalTimeFromSystemTime( &lastCheckedTV, &lastCheckedTV );
-
- if ( osl_getDateTimeFromTimeValue( &lastCheckedTV, &lastCheckedDT ) )
- {
- aDate = Date( lastCheckedDT.Day, lastCheckedDT.Month, lastCheckedDT.Year );
- aTime = Time( lastCheckedDT.Hours, lastCheckedDT.Minutes );
- }
-
- LanguageType eUILang = Application::GetSettings().GetUILanguage();
- SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), eUILang );
- String aTmpStr;
- Color* pColor = NULL;
- Date* pNullDate = pNumberFormatter->GetNullDate();
- sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang );
-
- pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aTmpStr, &pColor );
- aDateStr = aTmpStr;
-
- nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang );
- pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor );
- aTimeStr = aTmpStr;
-
- delete pColor;
- delete pNumberFormatter;
-
- aText = m_aLastCheckedTemplate;
- sal_Int32 nIndex = aText.indexOf( UNISTRING( "%DATE%" ) );
- if ( nIndex != -1 )
- aText = aText.replaceAt( nIndex, 6, aDateStr );
-
- nIndex = aText.indexOf( UNISTRING( "%TIME%" ) );
- if ( nIndex != -1 )
- aText = aText.replaceAt( nIndex, 6, aTimeStr );
- }
-
- m_aLastChecked.SetText( aText );
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage*
-SvxOnlineUpdateTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
-{
- return new SvxOnlineUpdateTabPage( pParent, rAttrSet );
-}
-
-// -----------------------------------------------------------------------
-
-
-BOOL SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet& )
-{
- BOOL bModified = FALSE;
-
- sal_Bool bValue;
- sal_Int64 nValue;
-
- if( m_aAutoCheckCheckBox.GetSavedValue() != m_aAutoCheckCheckBox.IsChecked() )
- {
- bValue = (TRUE == m_aAutoCheckCheckBox.IsChecked());
- m_xUpdateAccess->replaceByName( UNISTRING("AutoCheckEnabled"), uno::makeAny( bValue ) );
- bModified = TRUE;
- }
-
- nValue = 0;
- if( TRUE == m_aEveryDayButton.IsChecked() )
- {
- if( FALSE == m_aEveryDayButton.GetSavedValue() )
- nValue = 86400;
- }
- else if( TRUE == m_aEveryWeekButton.IsChecked() )
- {
- if( FALSE == m_aEveryWeekButton.GetSavedValue() )
- nValue = 604800;
- }
- else if( TRUE == m_aEveryMonthButton.IsChecked() )
- {
- if( FALSE == m_aEveryMonthButton.GetSavedValue() )
- nValue = 2592000;
- }
-
- if( nValue > 0 )
- {
- m_xUpdateAccess->replaceByName( UNISTRING("CheckInterval"), uno::makeAny( nValue ) );
- bModified = TRUE;
- }
-
- if( m_aAutoDownloadCheckBox.GetSavedValue() != m_aAutoDownloadCheckBox.IsChecked() )
- {
- bValue = (TRUE == m_aAutoDownloadCheckBox.IsChecked());
- m_xUpdateAccess->replaceByName( UNISTRING("AutoDownloadEnabled"), uno::makeAny( bValue ) );
- bModified = TRUE;
- }
-
- rtl::OUString sValue, aURL;
- m_xUpdateAccess->getByName( UNISTRING("DownloadDestination") ) >>= sValue;
-
- if( ( osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(m_aDestPath.GetText(), aURL) ) &&
- ( ! aURL.equals( sValue ) ) )
- {
- m_xUpdateAccess->replaceByName( UNISTRING("DownloadDestination"), uno::makeAny( aURL ) );
- bModified = TRUE;
- }
-
- uno::Reference< util::XChangesBatch > xChangesBatch(m_xUpdateAccess, uno::UNO_QUERY);
- if( xChangesBatch.is() && xChangesBatch->hasPendingChanges() )
- xChangesBatch->commitChanges();
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxOnlineUpdateTabPage::Reset( const SfxItemSet& )
-{
- sal_Bool bValue = sal_Bool();
- m_xUpdateAccess->getByName( UNISTRING("AutoCheckEnabled") ) >>= bValue;
-
- m_aAutoCheckCheckBox.Check(bValue);
- m_aEveryDayButton.Enable(bValue);
- m_aEveryWeekButton.Enable(bValue);
- m_aEveryMonthButton.Enable(bValue);
-
- sal_Int64 nValue = 0;
- m_xUpdateAccess->getByName( UNISTRING("CheckInterval") ) >>= nValue;
-
- if( nValue == 86400 )
- m_aEveryDayButton.Check();
- else if( nValue == 604800 )
- m_aEveryWeekButton.Check();
- else
- m_aEveryMonthButton.Check();
-
- m_aAutoCheckCheckBox.SaveValue();
- m_aEveryDayButton.SaveValue();
- m_aEveryWeekButton.SaveValue();
- m_aEveryMonthButton.SaveValue();
-
- m_xUpdateAccess->getByName( UNISTRING("AutoDownloadEnabled") ) >>= bValue;
- m_aAutoDownloadCheckBox.Check(bValue);
- m_aDestPathLabel.Enable(TRUE);
- m_aDestPath.Enable(TRUE);
- m_aChangePathButton.Enable(TRUE);
-
- rtl::OUString sValue, aPath;
- m_xUpdateAccess->getByName( UNISTRING("DownloadDestination") ) >>= sValue;
-
- if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(sValue, aPath) )
- m_aDestPath.SetText(aPath);
-
- m_aAutoDownloadCheckBox.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxOnlineUpdateTabPage::FillUserData()
-{
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, CheckBox *, pBox )
-{
- BOOL bEnabled = pBox->IsChecked();
-
- m_aEveryDayButton.Enable(bEnabled);
- m_aEveryWeekButton.Enable(bEnabled);
- m_aEveryMonthButton.Enable(bEnabled);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxOnlineUpdateTabPage, FileDialogHdl_Impl, PushButton *, EMPTYARG )
-{
- uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- uno::Reference < dialogs::XFolderPicker > xFolderPicker(
- xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) ) ),
- uno::UNO_QUERY );
-
- rtl::OUString aURL;
- if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_aDestPath.GetText(), aURL) )
- osl::Security().getHomeDir(aURL);
-
- xFolderPicker->setDisplayDirectory( aURL );
- sal_Int16 nRet = xFolderPicker->execute();
-
- if ( dialogs::ExecutableDialogResults::OK == nRet )
- {
- rtl::OUString aFolder;
- if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(xFolderPicker->getDirectory(), aFolder))
- m_aDestPath.SetText( aFolder );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxOnlineUpdateTabPage, CheckNowHdl_Impl, PushButton *, EMPTYARG )
-{
- uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
- xFactory->createInstance( UNISTRING( "com.sun.star.configuration.ConfigurationProvider" )),
- uno::UNO_QUERY_THROW);
-
- beans::PropertyValue aProperty;
- aProperty.Name = UNISTRING( "nodepath" );
- aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
-
- uno::Sequence< uno::Any > aArgumentList( 1 );
- aArgumentList[0] = uno::makeAny( aProperty );
-
- uno::Reference< container::XNameAccess > xNameAccess(
- xConfigProvider->createInstanceWithArguments(
- UNISTRING("com.sun.star.configuration.ConfigurationAccess"), aArgumentList ),
- uno::UNO_QUERY_THROW );
-
- util::URL aURL;
- xNameAccess->getByName(UNISTRING("URL")) >>= aURL.Complete;
-
- uno::Reference < util::XURLTransformer > xTransformer(
- xFactory->createInstance( UNISTRING( "com.sun.star.util.URLTransformer" ) ),
- uno::UNO_QUERY_THROW );
-
- xTransformer->parseStrict(aURL);
-
- uno::Reference < frame::XDesktop > xDesktop(
- xFactory->createInstance( UNISTRING( "com.sun.star.frame.Desktop" ) ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< frame::XDispatchProvider > xDispatchProvider(
- xDesktop->getCurrentFrame(), uno::UNO_QUERY );
-
- uno::Reference< frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch(aURL, rtl::OUString(), 0);
-
- if( xDispatch.is() )
- {
- xDispatch->dispatch(aURL, uno::Sequence< beans::PropertyValue > ());
- UpdateLastCheckedText();
- }
- }
- catch( const uno::Exception& e )
- {
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
- }
-
- return 0;
-}
-
-void SvxOnlineUpdateTabPage::CalcButtonWidth()
-{
- // detect the longest button text
- long nTxtWidth = ::std::max( m_aCheckNowButton.GetCtrlTextWidth( m_aCheckNowButton.GetText() ),
- m_aCheckNowButton.GetCtrlTextWidth( m_aChangePathButton.GetText() ) );
- // add a little offset
- nTxtWidth = nTxtWidth + 12;
- // compare with the button width
- Size aSize = m_aCheckNowButton.GetSizePixel();
- // and change it if it's necessary
- if ( nTxtWidth > aSize.Width() )
- {
- aSize.Width() = nTxtWidth;
- m_aCheckNowButton.SetSizePixel( aSize );
- m_aChangePathButton.SetSizePixel( aSize );
- }
-}
-
diff --git a/svx/source/cui/optupdt.hrc b/svx/source/cui/optupdt.hrc
deleted file mode 100644
index 11c956e8c3..0000000000
--- a/svx/source/cui/optupdt.hrc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optupdt.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTUPDT_HRC
-#define _SVX_OPTUPDT_HRC
-
-// defines ---------------------------------------------------------------
-
-// class SvxOnlineUpdateTabPage ----------------------------------------------
-
-#define FL_OPTIONS 10
-#define CB_AUTOCHECK 11
-#define RB_EVERYDAY 12
-#define RB_EVERYWEEK 13
-#define RB_EVERYMONTH 14
-#define PB_CHECKNOW 15
-#define CB_AUTODOWNLOAD 16
-#define FT_DESTPATHLABEL 17
-#define FT_DESTPATH 18
-#define PB_CHANGEPATH 19
-#define FT_LASTCHECKED 20
-#define STR_NEVERCHECKED 21
-
-
-#endif // #ifndef _SVX_OPTUPDT_HRC
-
diff --git a/svx/source/cui/optupdt.hxx b/svx/source/cui/optupdt.hxx
deleted file mode 100644
index eeb8203bcf..0000000000
--- a/svx/source/cui/optupdt.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optupdt.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_OPTUPDT_HXX
-#define _SVX_OPTUPDT_HXX
-
-// include ---------------------------------------------------------------
-
-#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#include <com/sun/star/container/XNameReplace.hpp>
-
-// class SvxPathTabPage --------------------------------------------------
-
-class SvxOnlineUpdateTabPage : public SfxTabPage
-{
-private:
- FixedLine m_aOptionsLine;
- CheckBox m_aAutoCheckCheckBox;
- RadioButton m_aEveryDayButton;
- RadioButton m_aEveryWeekButton;
- RadioButton m_aEveryMonthButton;
- PushButton m_aCheckNowButton;
- CheckBox m_aAutoDownloadCheckBox;
- FixedText m_aDestPathLabel;
- FixedText m_aDestPath;
- PushButton m_aChangePathButton;
- FixedText m_aLastChecked;
- rtl::OUString m_aNeverChecked;
- rtl::OUString m_aLastCheckedTemplate;
-
- DECL_LINK( FileDialogHdl_Impl, PushButton* ) ;
- DECL_LINK( CheckNowHdl_Impl, PushButton* ) ;
- DECL_LINK( AutoCheckHdl_Impl, CheckBox* ) ;
-
- void CalcButtonWidth();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xUpdateAccess;
-
- void UpdateLastCheckedText();
-
-public:
- SvxOnlineUpdateTabPage( Window* pParent, const SfxItemSet& rSet );
- ~SvxOnlineUpdateTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void FillUserData();
-};
-
-
-#endif
-
diff --git a/svx/source/cui/optupdt.src b/svx/source/cui/optupdt.src
deleted file mode 100644
index b6512a83a0..0000000000
--- a/svx/source/cui/optupdt.src
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optupdt.src,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include --------------------------------------------------------------
-#include "optupdt.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
- // RID_SVXPAGE_ONLINEUPDATE --------------------------------------------
-TabPage RID_SVXPAGE_ONLINEUPDATE
-{
- HelpId = HID_SVX_OPTIONS_ONLINEUPDATE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "OnlineUpdate" ;
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Online Update Options" ;
- };
- CheckBox CB_AUTOCHECK
- {
- Pos = MAP_APPFONT ( 12, 14 ) ;
- Size = MAP_APPFONT ( 210, 10 ) ;
- Text [ en-US ] = "~Check for updates automatically" ;
- };
- RadioButton RB_EVERYDAY
- {
- Pos = MAP_APPFONT ( 18, 27 ) ;
- Size = MAP_APPFONT ( 160, 10 ) ;
- Text [ en-US ] = "Every Da~y" ;
- };
- RadioButton RB_EVERYWEEK
- {
- Pos = MAP_APPFONT ( 18, 40 ) ;
- Size = MAP_APPFONT ( 160, 10 ) ;
- Text [ en-US ] = "Every ~Week" ;
- };
- RadioButton RB_EVERYMONTH
- {
- Pos = MAP_APPFONT ( 18, 53 ) ;
- Size = MAP_APPFONT ( 160, 10 ) ;
- Text [ en-US ] = "Every ~Month" ;
- };
- FixedText FT_LASTCHECKED
- {
- Pos = MAP_APPFONT ( 12, 69 ) ;
- Size = MAP_APPFONT ( 160, 10 ) ;
- Text [ en-US ] = "Last checked: %DATE%, %TIME%" ;
- };
- PushButton PB_CHECKNOW
- {
- Pos = MAP_APPFONT ( 12, 82 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- Text [ en-US ] = "Check ~now" ;
- };
- CheckBox CB_AUTODOWNLOAD
- {
- Pos = MAP_APPFONT ( 12, 130 ) ;
- Size = MAP_APPFONT ( 160, 10 ) ;
- Text [ en-US ] = "~Download updates automatically" ;
- };
- FixedText FT_DESTPATHLABEL
- {
- Pos = MAP_APPFONT ( 22, 143 ) ;
- Size = MAP_APPFONT ( 150, 8 ) ;
- Text [ en-US ] = "Download destination:" ;
- };
- FixedText FT_DESTPATH
- {
- Pos = MAP_APPFONT ( 22, 154 ) ;
- Size = MAP_APPFONT ( 138, 8 ) ;
- };
- PushButton PB_CHANGEPATH
- {
- Pos = MAP_APPFONT ( 162, 151 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- Text [ en-US ] = "Ch~ange..." ;
- };
- String STR_NEVERCHECKED
- {
- Text [ en-US ] = "Last checked: Not yet" ;
- };
-};
diff --git a/svx/source/cui/page.cxx b/svx/source/cui/page.cxx
deleted file mode 100644
index 2ebbf8bcde..0000000000
--- a/svx/source/cui/page.cxx
+++ /dev/null
@@ -1,1788 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: page.cxx,v $
- * $Revision: 1.42 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#ifndef _RESARY_HXX //autogen
-#include <tools/resary.hxx>
-#endif
-#ifndef _GRAPH_HXX //autogen
-#include <vcl/graph.hxx>
-#endif
-#include <sfx2/viewsh.hxx>
-#include <svtools/itemiter.hxx>
-#include <svtools/languageoptions.hxx>
-#include <vcl/msgbox.hxx>
-#include <unotools/configitem.hxx>
-#include "htmlmode.hxx"
-
-#define _SVX_PAGE_CXX
-
-#include <svx/dialogs.hrc>
-#include "page.hrc"
-#include "helpid.hrc"
-
-
-
-
-
-#include "page.hxx"
-#include <svx/pageitem.hxx>
-#include <svx/brshitem.hxx>
-#include <svx/boxitem.hxx>
-#include <svx/shaditem.hxx>
-#include <svx/pbinitem.hxx>
-#include <svx/lrspitem.hxx>
-#include <svx/ulspitem.hxx>
-#include <svx/sizeitem.hxx>
-#include <svx/frmdiritem.hxx>
-//CHINA001 #include "bbdlg.hxx"
-#include "dlgutil.hxx"
-#include <svx/dialmgr.hxx>
-#include <svx/paperinf.hxx>
-#include <svx/dialmgr.hxx>
-#include <sfx2/module.hxx>
-
-
-#include <svtools/stritem.hxx>
-
-#include <svx/svxids.hrc> //CHINA001
-
-// #i4219#
-#include <svtools/optionsdrawinglayer.hxx>
-#include <svtools/slstitm.hxx> //CHINA001
-#include <svtools/aeitem.hxx> //CHINA001
-#include <sfx2/request.hxx> //CHINA001
-// configuration helper =======================================================
-
-/** Helper to get a configuration setting.
- @descr This is a HACK to get a configuration item directly. Normally the
- OfaHtmlOptions class from 'offmgr' project would do the job, but we cannot
- use it here. On the other hand, the OfaHtmlOptions cannot be moved to
- 'svtools', because it uses 'svx' itself...
- The correct way would be to move OfaHtmlOptions to 'svtools' anyway, and to
- remove the dependency from 'svx' (a call to the static function
- SvxTextEncodingBox::GetBestMimeEncoding(), which contains low level
- operations that can be moved to lower projects, i.e. 'rtl'). Then this
- class can be removed, and the OfaHtmlOptions can be used instead. */
-class SvxHtmlExportModeConfigItem_Impl : public utl::ConfigItem
-{
-public:
- explicit SvxHtmlExportModeConfigItem_Impl();
-
- /** Returns the HTML export mode, as read from the configuration. */
- inline sal_Int32 GetExportMode() const { return mnExpMode; }
-
- /** Returns true, if the current HTML export mode is set to HTML 3.2. */
- inline bool IsExportModeHTML32() const { return mnExpMode == 0; } // 0 == HTML_CFG_HTML32, see offmgr/htmlcfg.hxx
-
-private:
- sal_Int32 mnExpMode;
-};
-
-SvxHtmlExportModeConfigItem_Impl::SvxHtmlExportModeConfigItem_Impl() :
- utl::ConfigItem( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/HTML/Export" ) ) ),
- mnExpMode( 3 ) // default to 3 == HTML_CFG_NS40, see offmgr/htmlcfg.hxx
-{
- using com::sun::star::uno::Sequence;
- using com::sun::star::uno::Any;
-
- Sequence< rtl::OUString > aPropNames( 1 );
- aPropNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Browser" ) );
- Sequence< Any > aPropValues( GetProperties( aPropNames ) );
- if( aPropValues.getLength() == 1 )
- aPropValues[ 0 ] >>= mnExpMode;
-}
-
-
-// static ----------------------------------------------------------------
-
-static const long MINBODY = 284; // 0,5cm in twips aufgerundet
-//static const long PRINT_OFFSET = 17; // 0,03cm in twips abgerundet
-static const long PRINT_OFFSET = 0; // why was this ever set to 17 ? it led to wrong right and bottom margins.
-
-static USHORT pRanges[] =
-{
- SID_ATTR_BORDER_OUTER,
- SID_ATTR_BORDER_SHADOW,
- SID_ATTR_LRSPACE,
- SID_ATTR_PAGE_SHARED,
- SID_SWREGISTER_COLLECTION,
- SID_SWREGISTER_MODE,
- 0
-};
-
-// ------- Mapping Seitenlayout ------------------------------------------
-
-USHORT aArr[] =
-{
- SVX_PAGE_ALL,
- SVX_PAGE_MIRROR,
- SVX_PAGE_RIGHT,
- SVX_PAGE_LEFT
-};
-
-// -----------------------------------------------------------------------
-
-USHORT PageUsageToPos_Impl( USHORT nUsage )
-{
- const USHORT nCount = sizeof(aArr) / sizeof(USHORT);
-
- for ( USHORT i = 0; i < nCount; ++i )
- if ( aArr[i] == ( nUsage & 0x000f ) )
- return i;
- return SVX_PAGE_ALL;
-}
-
-// -----------------------------------------------------------------------
-
-USHORT PosToPageUsage_Impl( USHORT nPos )
-{
- const USHORT nCount = sizeof(aArr) / sizeof(USHORT);
-
- if ( nPos >= nCount )
- return 0;
- return aArr[nPos];
-}
-
-// -----------------------------------------------------------------------
-
-Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBox )
-{
- Size aSz;
- aSz.Height() = rShadow.CalcShadowSpace( SHADOW_BOTTOM ) + rBox.CalcLineSpace( BOX_LINE_BOTTOM );
- aSz.Height() += rShadow.CalcShadowSpace( SHADOW_TOP ) + rBox.CalcLineSpace( BOX_LINE_TOP );
- aSz.Width() = rShadow.CalcShadowSpace( SHADOW_LEFT ) + rBox.CalcLineSpace( BOX_LINE_LEFT );
- aSz.Width() += rShadow.CalcShadowSpace( SHADOW_RIGHT ) + rBox.CalcLineSpace( BOX_LINE_RIGHT );
- return aSz;
-}
-
-// -----------------------------------------------------------------------
-
-long ConvertLong_Impl( const long nIn, SfxMapUnit eUnit )
-{
- return OutputDevice::LogicToLogic( nIn, (MapUnit)eUnit, MAP_TWIP );
-}
-
-BOOL IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
-{
- if ( pSize )
- {
- Size aSize = pSize->GetSize();
- long nDiffW = Abs( rSize.Width () - aSize.Width () );
- long nDiffH = Abs( rSize.Height() - aSize.Height() );
- return ( nDiffW < 10 && nDiffH < 10 );
- }
- else
- return FALSE;
-}
-
-// -----------------------------------------------------------------------
-
-#define MARGIN_LEFT ( (MarginPosition)0x0001 )
-#define MARGIN_RIGHT ( (MarginPosition)0x0002 )
-#define MARGIN_TOP ( (MarginPosition)0x0004 )
-#define MARGIN_BOTTOM ( (MarginPosition)0x0008 )
-
-struct SvxPage_Impl
-{
- MarginPosition m_nPos;
- Printer* mpDefPrinter;
- bool mbDelPrinter;
-
- SvxPage_Impl() :
- m_nPos( 0 ),
- mpDefPrinter( 0 ),
- mbDelPrinter( false ) {}
-
- ~SvxPage_Impl() { if ( mbDelPrinter ) delete mpDefPrinter; }
-};
-
-// class SvxPageDescPage --------------------------------------------------
-
-// gibt den Bereich der Which-Werte zur"uck
-
-USHORT* SvxPageDescPage::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxPageDescPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxPageDescPage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_PAGE ), rAttr ),
-
- aPaperSizeFl ( this, SVX_RES( FL_PAPER_SIZE ) ),
- aPaperFormatText ( this, SVX_RES( FT_PAPER_FORMAT ) ),
- aPaperSizeBox ( this, SVX_RES( LB_PAPER_SIZE ) ),
- aPaperWidthText ( this, SVX_RES( FT_PAPER_WIDTH ) ),
- aPaperWidthEdit ( this, SVX_RES( ED_PAPER_WIDTH ) ),
- aPaperHeightText ( this, SVX_RES( FT_PAPER_HEIGHT ) ),
- aPaperHeightEdit ( this, SVX_RES( ED_PAPER_HEIGHT ) ),
- aOrientationFT ( this, SVX_RES( FT_ORIENTATION ) ),
- aPortraitBtn ( this, SVX_RES( RB_PORTRAIT ) ),
- aLandscapeBtn ( this, SVX_RES( RB_LANDSCAPE ) ),
- aBspWin ( this, SVX_RES( WN_BSP ) ),
- aTextFlowLbl ( this, SVX_RES( FT_TEXT_FLOW ) ),
- aTextFlowBox ( this, SVX_RES( LB_TEXT_FLOW ) ),
- aPaperTrayLbl ( this, SVX_RES( FT_PAPER_TRAY ) ),
- aPaperTrayBox ( this, SVX_RES( LB_PAPER_TRAY ) ),
- aMarginFl ( this, SVX_RES( FL_MARGIN ) ),
- aLeftMarginLbl ( this, SVX_RES( FT_LEFT_MARGIN ) ),
- aLeftMarginEdit ( this, SVX_RES( ED_LEFT_MARGIN ) ),
- aRightMarginLbl ( this, SVX_RES( FT_RIGHT_MARGIN ) ),
- aRightMarginEdit ( this, SVX_RES( ED_RIGHT_MARGIN ) ),
- aTopMarginLbl ( this, SVX_RES( FT_TOP_MARGIN ) ),
- aTopMarginEdit ( this, SVX_RES( ED_TOP_MARGIN ) ),
- aBottomMarginLbl ( this, SVX_RES( FT_BOTTOM_MARGIN ) ),
- aBottomMarginEdit ( this, SVX_RES( ED_BOTTOM_MARGIN ) ),
-
- aLayoutFL ( this, SVX_RES( FL_LAYOUT ) ),
- aPageText ( this, SVX_RES( FT_PAGELAYOUT ) ),
- aLayoutBox ( this, SVX_RES( LB_LAYOUT ) ),
- aNumberFormatText ( this, SVX_RES( FT_NUMBER_FORMAT ) ),
- aNumberFormatBox ( this, SVX_RES( LB_NUMBER_FORMAT ) ),
- aBottomSeparatorFl ( this, SVX_RES( FL_BOTTOM_SEP ) ),
- aTblAlignFT ( this, SVX_RES( FT_TBL_ALIGN ) ),
- aHorzBox ( this, SVX_RES( CB_HORZ ) ),
- aVertBox ( this, SVX_RES( CB_VERT ) ),
- aAdaptBox ( this, SVX_RES( CB_ADAPT ) ),
- aRegisterCB ( this, SVX_RES( CB_REGISTER ) ),
- aRegisterFT ( this, SVX_RES( FT_REGISTER ) ),
- aRegisterLB ( this, SVX_RES( LB_REGISTER ) ),
-
- aInsideText ( SVX_RES( STR_INSIDE ) ),
- aOutsideText ( SVX_RES( STR_OUTSIDE ) ),
- aPrintRangeQueryText( SVX_RES( STR_QUERY_PRINTRANGE ) ),
-
- bLandscape ( FALSE ),
- eMode ( SVX_PAGE_MODE_STANDARD ),
- ePaperStart ( PAPER_A3 ),
- ePaperEnd ( PAPER_ENV_DL ),
- pImpl ( new SvxPage_Impl )
-
-{
- bBorderModified = FALSE;
- FreeResource();
- aBspWin.EnableRTL( FALSE );
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- SvtLanguageOptions aLangOptions;
- sal_Bool bCJK = aLangOptions.IsAsianTypographyEnabled();
- sal_Bool bCTL = aLangOptions.IsCTLFontEnabled();
- sal_Bool bWeb = sal_False;
- const SfxPoolItem* pItem;
-
- SfxObjectShell* pShell;
- if(SFX_ITEM_SET == rAttr.GetItemState(SID_HTML_MODE, FALSE, &pItem) ||
- ( 0 != (pShell = SfxObjectShell::Current()) &&
- 0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
- bWeb = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
-
- // #109989# get the HTML export setting from configuration.
- // !! This is a hack, see comments in SvxHtmlExportModeConfigItem_Impl class above.
- bool bHTML32 = SvxHtmlExportModeConfigItem_Impl().IsExportModeHTML32();
-
- // fill text flow listbox with valid entries
- aTextFlowBox.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_PAGEDIR_LTR_HORI ), FRMDIR_HORI_LEFT_TOP );
- if( bCTL )
- aTextFlowBox.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_PAGEDIR_RTL_HORI ), FRMDIR_HORI_RIGHT_TOP );
- // #109989# do not show vertical directions in Writer/Web
- if( !bWeb )
- {
- if( bCJK )
- aTextFlowBox.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_PAGEDIR_RTL_VERT ), FRMDIR_VERT_TOP_RIGHT );
-// if( ... )
-// aTextFlowBox.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_PAGEDIR_LTR_VERT ), FRMDIR_VERT_TOP_LEFT );
- }
-
- // #109989# show the text direction box in Writer/Web too, but only, if HTML export mode is not HTML3.2.
- if( !(bWeb && bHTML32) && (bCJK || bCTL) &&
- SFX_ITEM_UNKNOWN < rAttr.GetItemState(GetWhich( SID_ATTR_FRAMEDIRECTION )))
- {
- aTextFlowLbl.Show();
- aTextFlowBox.Show();
- aTextFlowBox.SetSelectHdl(LINK(this, SvxPageDescPage, FrameDirectionModify_Impl ));
-
- aBspWin.EnableFrameDirection(sal_True);
- }
- Init_Impl();
-
- FieldUnit eFUnit = GetModuleFieldUnit( &rAttr );
- SetFieldUnit( aLeftMarginEdit, eFUnit );
- SetFieldUnit( aRightMarginEdit, eFUnit );
- SetFieldUnit( aTopMarginEdit, eFUnit );
- SetFieldUnit( aBottomMarginEdit, eFUnit );
- SetFieldUnit( aPaperWidthEdit, eFUnit );
- SetFieldUnit( aPaperHeightEdit, eFUnit );
-
- if ( SfxViewShell::Current() && SfxViewShell::Current()->GetPrinter() )
- pImpl->mpDefPrinter = (Printer*)SfxViewShell::Current()->GetPrinter();
- else
- {
- pImpl->mpDefPrinter = new Printer;
- pImpl->mbDelPrinter = true;
- }
-
- MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode();
- pImpl->mpDefPrinter->SetMapMode( MAP_TWIP );
-
- // First- und Last-Werte f"ur die R"ander setzen
- Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize();
- Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize();
- /*
- * einen Punkt ( 0,0 ) in logische Koordinaten zu konvertieren,
- * sieht aus wie Unsinn; ist aber sinnvoll, wenn der Ursprung des
- * Koordinatensystems verschoben ist.
- */
- Point aPrintOffset = pImpl->mpDefPrinter->GetPageOffset() -
- pImpl->mpDefPrinter->PixelToLogic( Point() );
- pImpl->mpDefPrinter->SetMapMode( aOldMode );
-
- long nOffset = !aPrintOffset.X() && !aPrintOffset.Y() ? 0 : PRINT_OFFSET;
- aLeftMarginEdit.SetFirst( aLeftMarginEdit.Normalize( aPrintOffset.X() ), FUNIT_TWIP );
- nFirstLeftMargin = static_cast<long>(aLeftMarginEdit.GetFirst());
- aRightMarginEdit.SetFirst( aRightMarginEdit.Normalize(
- aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X() + nOffset ), FUNIT_TWIP);
- nFirstRightMargin = static_cast<long>(aRightMarginEdit.GetFirst());
- aTopMarginEdit.SetFirst( aTopMarginEdit.Normalize( aPrintOffset.Y() ), FUNIT_TWIP );
- nFirstTopMargin = static_cast<long>(aTopMarginEdit.GetFirst());
- aBottomMarginEdit.SetFirst( aBottomMarginEdit.Normalize(
- aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y() + nOffset ), FUNIT_TWIP );
- nFirstBottomMargin = static_cast<long>(aBottomMarginEdit.GetFirst());
- aLeftMarginEdit.SetLast( aLeftMarginEdit.Normalize(
- aPrintOffset.X() + aPrintSize.Width() ), FUNIT_TWIP );
- nLastLeftMargin = static_cast<long>(aLeftMarginEdit.GetLast());
- aRightMarginEdit.SetLast( aRightMarginEdit.Normalize(
- aPrintOffset.X() + aPrintSize.Width() ), FUNIT_TWIP );
- nLastRightMargin = static_cast<long>(aRightMarginEdit.GetLast());
- aTopMarginEdit.SetLast( aTopMarginEdit.Normalize(
- aPrintOffset.Y() + aPrintSize.Height() ), FUNIT_TWIP );
- nLastTopMargin = static_cast<long>(aTopMarginEdit.GetLast());
- aBottomMarginEdit.SetLast( aBottomMarginEdit.Normalize(
- aPrintOffset.Y() + aPrintSize.Height() ), FUNIT_TWIP );
- nLastBottomMargin = static_cast<long>(aBottomMarginEdit.GetLast());
-
- // #i4219# get DrawingLayer options
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
-
- // #i4219# take Maximum now from configuration (1/100th cm)
- // was: 11900 -> 119 cm ;new value 3 meters -> 300 cm -> 30000
- aPaperWidthEdit.SetMax(aPaperWidthEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM);
- aPaperWidthEdit.SetLast(aPaperWidthEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM);
- aPaperHeightEdit.SetMax(aPaperHeightEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM);
- aPaperHeightEdit.SetLast(aPaperHeightEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM);
-
- // #i4219# also for margins (1/100th cm). Was: 9999, keeping.
- aLeftMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperLeftMargin());
- aLeftMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperLeftMargin());
- aRightMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperRightMargin());
- aRightMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperRightMargin());
- aTopMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperTopMargin());
- aTopMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperTopMargin());
- aBottomMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperBottomMargin());
- aBottomMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperBottomMargin());
-}
-
-// -----------------------------------------------------------------------
-
-SvxPageDescPage::~SvxPageDescPage()
-{
- delete pImpl;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::Init_Impl()
-{
- aLeftText = aLeftMarginLbl.GetText();
- aRightText = aRightMarginLbl.GetText();
-
- // Handler einstellen
- aLayoutBox.SetSelectHdl( LINK( this, SvxPageDescPage, LayoutHdl_Impl ) );
- aPaperSizeBox.SetDropDownLineCount(10);
-
- aPaperTrayBox.SetGetFocusHdl(
- LINK( this, SvxPageDescPage, PaperBinHdl_Impl ) );
- aPaperSizeBox.SetSelectHdl(
- LINK( this, SvxPageDescPage, PaperSizeSelect_Impl ) );
- aPaperWidthEdit.SetModifyHdl(
- LINK( this, SvxPageDescPage, PaperSizeModify_Impl ) );
- aPaperHeightEdit.SetModifyHdl(
- LINK( this, SvxPageDescPage, PaperSizeModify_Impl ) );
- aLandscapeBtn.SetClickHdl(
- LINK( this, SvxPageDescPage, SwapOrientation_Impl ) );
- aPortraitBtn.SetClickHdl(
- LINK( this, SvxPageDescPage, SwapOrientation_Impl ) );
-
- Link aLink = LINK( this, SvxPageDescPage, BorderModify_Impl );
- aLeftMarginEdit.SetModifyHdl( aLink );
- aRightMarginEdit.SetModifyHdl( aLink );
- aTopMarginEdit.SetModifyHdl( aLink );
- aBottomMarginEdit.SetModifyHdl( aLink );
-
- aLink = LINK( this, SvxPageDescPage, RangeHdl_Impl );
- aPaperWidthEdit.SetLoseFocusHdl( aLink );
- aPaperHeightEdit.SetLoseFocusHdl( aLink );
- aLeftMarginEdit.SetLoseFocusHdl( aLink );
- aRightMarginEdit.SetLoseFocusHdl( aLink );
- aTopMarginEdit.SetLoseFocusHdl( aLink );
- aBottomMarginEdit.SetLoseFocusHdl( aLink );
-
- aHorzBox.SetClickHdl( LINK( this, SvxPageDescPage, CenterHdl_Impl ) );
- aVertBox.SetClickHdl( LINK( this, SvxPageDescPage, CenterHdl_Impl ) );
-
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::Reset( const SfxItemSet& rSet )
-{
- SfxItemPool* pPool = rSet.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) );
-
- // R"ander (Links/Rechts) einstellen
- const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE );
-
- if ( pItem )
- {
- const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)*pItem;
- SetMetricValue( aLeftMarginEdit, rLRSpace.GetLeft(), eUnit );
- aBspWin.SetLeft(
- (USHORT)ConvertLong_Impl( (long)rLRSpace.GetLeft(), eUnit ) );
- SetMetricValue( aRightMarginEdit, rLRSpace.GetRight(), eUnit );
- aBspWin.SetRight(
- (USHORT)ConvertLong_Impl( (long)rLRSpace.GetRight(), eUnit ) );
- }
-
- // R"ander (Oben/Unten) einstellen
- pItem = GetItem( rSet, SID_ATTR_ULSPACE );
-
- if ( pItem )
- {
- const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)*pItem;
- SetMetricValue( aTopMarginEdit, rULSpace.GetUpper(), eUnit );
- aBspWin.SetTop(
- (USHORT)ConvertLong_Impl( (long)rULSpace.GetUpper(), eUnit ) );
- SetMetricValue( aBottomMarginEdit, rULSpace.GetLower(), eUnit );
- aBspWin.SetBottom(
- (USHORT)ConvertLong_Impl( (long)rULSpace.GetLower(), eUnit ) );
- }
-
- // allgemeine Seitendaten
- SvxNumType eNumType = SVX_ARABIC;
- bLandscape = ( pImpl->mpDefPrinter->GetOrientation() == ORIENTATION_LANDSCAPE );
- USHORT nUse = (USHORT)SVX_PAGE_ALL;
- pItem = GetItem( rSet, SID_ATTR_PAGE );
-
- if ( pItem )
- {
- const SvxPageItem& rItem = (const SvxPageItem&)*pItem;
- eNumType = rItem.GetNumType();
- nUse = rItem.GetPageUsage();
- bLandscape = rItem.IsLandscape();
- }
-
- // Ausrichtung
- aLayoutBox.SelectEntryPos( ::PageUsageToPos_Impl( nUse ) );
- aBspWin.SetUsage( nUse );
- LayoutHdl_Impl( 0 );
-
- // Numerierungsart der Seitenvorlage einstellen
- aNumberFormatBox.SelectEntryPos( sal::static_int_cast< USHORT >(eNumType) );
-
- // Aktueller Papierschacht
- aPaperTrayBox.Clear();
- BYTE nPaperBin = PAPERBIN_PRINTER_SETTINGS;
- pItem = GetItem( rSet, SID_ATTR_PAGE_PAPERBIN );
-
- if ( pItem )
- {
- nPaperBin = ( (const SvxPaperBinItem*)pItem )->GetValue();
-
- if ( nPaperBin >= pImpl->mpDefPrinter->GetPaperBinCount() )
- nPaperBin = PAPERBIN_PRINTER_SETTINGS;
- }
-
- String aBinName;
-
- if ( PAPERBIN_PRINTER_SETTINGS == nPaperBin )
- aBinName = SVX_RESSTR( RID_SVXSTR_PAPERBIN_SETTINGS );
- else
- aBinName = pImpl->mpDefPrinter->GetPaperBinName( (USHORT)nPaperBin );
-
- USHORT nEntryPos = aPaperTrayBox.InsertEntry( aBinName );
- aPaperTrayBox.SetEntryData( nEntryPos, (void*)(ULONG)nPaperBin );
- aPaperTrayBox.SelectEntry( aBinName );
-
- // Size rausholen
- Size aPaperSize = SvxPaperInfo::GetPaperSize( pImpl->mpDefPrinter );
- pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
-
- if ( pItem )
- aPaperSize = ( (const SvxSizeItem*)pItem )->GetSize();
-
- FASTBOOL bOrientationSupport =
- pImpl->mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION );
-#ifdef OS2
- // unter OS/2 wird bei HasSupport() immer TRUE returned
- // aber nur als Dummy, deshalb FALSE
- bOrientationSupport = FALSE;
-#endif
-
- if ( !bOrientationSupport &&
- aPaperSize.Width() > aPaperSize.Height() )
- bLandscape = TRUE;
-
- aLandscapeBtn.Check( bLandscape );
- aPortraitBtn.Check( !bLandscape );
-
- aBspWin.SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ),
- ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) );
-
- aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MAP_100TH_MM);
- if ( bLandscape )
- Swap( aPaperSize );
-
- // Actual Paper Format
- Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MAP_100TH_MM, TRUE );
-
- if ( PAPER_USER != ePaper )
- aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM );
-
- if ( bLandscape )
- Swap( aPaperSize );
-
- // Werte in die Edits eintragen
- SetMetricValue( aPaperHeightEdit, aPaperSize.Height(), SFX_MAPUNIT_100TH_MM );
- SetMetricValue( aPaperWidthEdit, aPaperSize.Width(), SFX_MAPUNIT_100TH_MM );
- aPaperSizeBox.Clear();
-
- USHORT nActPos = LISTBOX_ENTRY_NOTFOUND;
- USHORT nAryId = RID_SVXSTRARY_PAPERSIZE_STD;
-
- if ( ePaperStart != PAPER_A3 )
- nAryId = RID_SVXSTRARY_PAPERSIZE_DRAW;
- ResStringArray aPaperAry( SVX_RES( nAryId ) );
- sal_uInt32 nCnt = aPaperAry.Count();
-
- for ( sal_uInt32 i = 0; i < nCnt; ++i )
- {
- String aStr = aPaperAry.GetString(i);
- Paper eSize = (Paper)aPaperAry.GetValue(i);
- USHORT nPos = aPaperSizeBox.InsertEntry( aStr );
- aPaperSizeBox.SetEntryData( nPos, (void*)(ULONG)eSize );
-
- if ( eSize == ePaper )
- nActPos = nPos;
- }
- // aktuelles Papierformat selektieren
- aPaperSizeBox.SelectEntryPos( nActPos );
-
- // Applikationsspezifisch
-
- switch ( eMode )
- {
- case SVX_PAGE_MODE_CENTER:
- {
- aTblAlignFT.Show();
- aHorzBox.Show();
- aVertBox.Show();
- DisableVerticalPageDir();
-
- // Horizontale Ausrichtung
- pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
- aHorzBox.Check( pItem ? ( (const SfxBoolItem*)pItem )->GetValue()
- : FALSE );
-
- // Vertikale Ausrichtung
- pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
- aVertBox.Check( pItem ? ( (const SfxBoolItem*)pItem )->GetValue()
- : FALSE );
-
- // Beispiel-Fenster auf Tabelle setzen
- aBspWin.SetTable( TRUE );
- aBspWin.SetHorz( aHorzBox.IsChecked() );
- aBspWin.SetVert( aVertBox.IsChecked() );
-
- break;
- }
-
- case SVX_PAGE_MODE_PRESENTATION:
- {
- DisableVerticalPageDir();
- aAdaptBox.Show();
- pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
- aAdaptBox.Check( pItem ?
- ( (const SfxBoolItem*)pItem )->GetValue() : FALSE );
-
- //!!! hidden, weil von StarDraw nicht implementiert
- aLayoutBox.Hide();
- aPageText.Hide();
-
- break;
- }
- default: ;//prevent warning
- }
-
-
- // im Beispiel Hintergrund und Umrandung anzeigen
- ResetBackground_Impl( rSet );
-//! UpdateExample_Impl();
- RangeHdl_Impl( 0 );
-
- // Header Footer anzeigen
- InitHeadFoot_Impl( rSet );
-
- // R"ander auf Hoch/Quer updaten, dann Beispiel updaten
- bBorderModified = FALSE;
- SwapFirstValues_Impl( FALSE );
- UpdateExample_Impl();
-
- // Alte Werte sichern
- aLeftMarginEdit.SaveValue();
- aRightMarginEdit.SaveValue();
- aTopMarginEdit.SaveValue();
- aBottomMarginEdit.SaveValue();
- aLayoutBox.SaveValue();
- aNumberFormatBox.SaveValue();
- aPaperSizeBox.SaveValue();
- aPaperWidthEdit.SaveValue();
- aPaperHeightEdit.SaveValue();
- aPortraitBtn.SaveValue();
- aLandscapeBtn.SaveValue();
- aPaperTrayBox.SaveValue();
- aVertBox.SaveValue();
- aHorzBox.SaveValue();
- aAdaptBox.SaveValue();
-
- CheckMarginEdits( true );
-
- // Registerhaltigkeit
- if(SFX_ITEM_SET == rSet.GetItemState(SID_SWREGISTER_MODE))
- {
- aRegisterCB.Check(((const SfxBoolItem&)rSet.Get(
- SID_SWREGISTER_MODE)).GetValue());
- aRegisterCB.SaveValue();
- RegisterModify(&aRegisterCB);
- }
- if(SFX_ITEM_SET == rSet.GetItemState(SID_SWREGISTER_COLLECTION))
- {
- aRegisterLB.SelectEntry(
- ((const SfxStringItem&)rSet.Get(SID_SWREGISTER_COLLECTION)).GetValue());
- aRegisterLB.SaveValue();
- }
-
- SfxItemState eState = rSet.GetItemState( GetWhich( SID_ATTR_FRAMEDIRECTION ),
- TRUE, &pItem );
- if( SFX_ITEM_UNKNOWN != eState )
- {
- sal_uInt32 nVal = SFX_ITEM_SET == eState
- ? ((SvxFrameDirectionItem*)pItem)->GetValue()
- : 0;
- aTextFlowBox.SelectEntryValue( static_cast< SvxFrameDirection >( nVal ) );
- aTextFlowBox.SaveValue();
- aBspWin.SetFrameDirection(nVal);
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::FillUserData()
-{
- if ( SVX_PAGE_MODE_PRESENTATION == eMode )
- SetUserData( UniString::CreateFromInt32( (sal_Int32)aAdaptBox.IsChecked() ) );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxPageDescPage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bModified = FALSE;
- const SfxItemSet& rOldSet = GetItemSet();
- SfxItemPool* pPool = rOldSet.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- USHORT nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
- const SfxPoolItem* pOld = 0;
-
- // alten linken und rechten Rand kopieren
- SvxLRSpaceItem aMargin( (const SvxLRSpaceItem&)rOldSet.Get( nWhich ) );
-
- // alten oberen und unteren Rand kopieren
- nWhich = GetWhich( SID_ATTR_ULSPACE );
- SvxULSpaceItem aTopMargin( (const SvxULSpaceItem&)rOldSet.Get( nWhich ) );
-
- if ( aLeftMarginEdit.GetText() != aLeftMarginEdit.GetSavedValue() )
- {
- aMargin.SetLeft( (USHORT)GetCoreValue( aLeftMarginEdit, eUnit ) );
- bModified |= TRUE;
- }
-
- if ( aRightMarginEdit.GetText() != aRightMarginEdit.GetSavedValue() )
- {
- aMargin.SetRight( (USHORT)GetCoreValue( aRightMarginEdit, eUnit ) );
- bModified |= TRUE;
- }
-
- // Linken und rechten Rand setzen
- if ( bModified )
- {
- pOld = GetOldItem( rSet, SID_ATTR_LRSPACE );
-
- if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) )
- rSet.Put( aMargin );
- else
- bModified = FALSE;
- }
-
- BOOL bMod = FALSE;
-
- if ( aTopMarginEdit.GetText() != aTopMarginEdit.GetSavedValue() )
- {
- aTopMargin.SetUpper( (USHORT)GetCoreValue( aTopMarginEdit, eUnit ) );
- bMod |= TRUE;
- }
-
- if ( aBottomMarginEdit.GetText() != aBottomMarginEdit.GetSavedValue() )
- {
- aTopMargin.SetLower( (USHORT)GetCoreValue( aBottomMarginEdit, eUnit ) );
- bMod |= TRUE;
- }
-
- // unteren oberen Rand setzen
- //
- if ( bMod )
- {
- pOld = GetOldItem( rSet, SID_ATTR_ULSPACE );
-
- if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aTopMargin ) )
- {
- bModified |= TRUE;
- rSet.Put( aTopMargin );
- }
- }
-
- // Druckerschacht
- nWhich = GetWhich( SID_ATTR_PAGE_PAPERBIN );
- USHORT nPos = aPaperTrayBox.GetSelectEntryPos();
- USHORT nBin = (USHORT)(ULONG)aPaperTrayBox.GetEntryData( nPos );
- pOld = GetOldItem( rSet, SID_ATTR_PAGE_PAPERBIN );
-
- if ( !pOld || ( (const SvxPaperBinItem*)pOld )->GetValue() != nBin )
- {
- rSet.Put( SvxPaperBinItem( nWhich, (BYTE)nBin ) );
- bModified |= TRUE;
- }
-
- nPos = aPaperSizeBox.GetSelectEntryPos();
- Paper ePaper = (Paper)(ULONG)aPaperSizeBox.GetEntryData( nPos );
- const USHORT nOld = aPaperSizeBox.GetSavedValue();
- BOOL bChecked = aLandscapeBtn.IsChecked();
-
- if ( PAPER_USER == ePaper )
- {
- if ( nOld != nPos ||
- aPaperWidthEdit.IsValueModified() ||
- aPaperHeightEdit.IsValueModified() ||
- bChecked != aLandscapeBtn.GetSavedValue() )
- {
- Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ),
- GetCoreValue( aPaperHeightEdit, eUnit ) );
- pOld = GetOldItem( rSet, SID_ATTR_PAGE_SIZE );
-
- if ( !pOld || ( (const SvxSizeItem*)pOld )->GetSize() != aSize )
- {
- rSet.Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) );
- bModified |= TRUE;
- }
- }
- }
- else
- {
- if ( nOld != nPos || bChecked != aLandscapeBtn.GetSavedValue() )
- {
- Size aSize( SvxPaperInfo::GetPaperSize( ePaper, (MapUnit)eUnit ) );
-
- if ( bChecked )
- Swap( aSize );
-
- pOld = GetOldItem( rSet, SID_ATTR_PAGE_SIZE );
-
- if ( !pOld || ( (const SvxSizeItem*)pOld )->GetSize() != aSize )
- {
- rSet.Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) );
- bModified |= TRUE;
- }
- }
- }
-
- // sonstiges Zeug der Page
- nWhich = GetWhich( SID_ATTR_PAGE );
- SvxPageItem aPage( (const SvxPageItem&)rOldSet.Get( nWhich ) );
- bMod = aLayoutBox.GetSelectEntryPos() != aLayoutBox.GetSavedValue();
-
- if ( bMod )
- aPage.SetPageUsage(
- ::PosToPageUsage_Impl( aLayoutBox.GetSelectEntryPos() ) );
-
- if ( bChecked != aLandscapeBtn.GetSavedValue() )
- {
- aPage.SetLandscape(bChecked);
- bMod |= TRUE;
- }
-
- // Einstellen der Numerierungsart der Seite
- nPos = aNumberFormatBox.GetSelectEntryPos();
-
- if ( nPos != aNumberFormatBox.GetSavedValue() )
- {
- aPage.SetNumType( (SvxNumType)nPos );
- bMod |= TRUE;
- }
-
- if ( bMod )
- {
- pOld = GetOldItem( rSet, SID_ATTR_PAGE );
-
- if ( !pOld || !( *(const SvxPageItem*)pOld == aPage ) )
- {
- rSet.Put( aPage );
- bModified |= TRUE;
- }
- }
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich ) )
- rSet.ClearItem( nWhich );
- else
- rSet.Put( rOldSet.Get( nWhich ) );
-
- // Modispezifische Controls auswerten
-
- switch ( eMode )
- {
- case SVX_PAGE_MODE_CENTER:
- {
- if ( aHorzBox.IsChecked() != aHorzBox.GetSavedValue() )
- {
- SfxBoolItem aHorz( GetWhich( SID_ATTR_PAGE_EXT1 ),
- aHorzBox.IsChecked() );
- rSet.Put( aHorz );
- bModified |= TRUE;
- }
-
- if ( aVertBox.IsChecked() != aVertBox.GetSavedValue() )
- {
- SfxBoolItem aVert( GetWhich( SID_ATTR_PAGE_EXT2 ),
- aVertBox.IsChecked() );
- rSet.Put( aVert );
- bModified |= TRUE;
- }
- break;
- }
-
- case SVX_PAGE_MODE_PRESENTATION:
- {
- // immer putten, damit Draw das auswerten kann
- rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_PAGE_EXT1 ),
- aAdaptBox.IsChecked() ) );
- bModified |= TRUE;
- break;
- }
- default: ;//prevent warning
-
- }
-
- if(aRegisterCB.IsVisible() &&
- (aRegisterCB.IsChecked() || aRegisterCB.GetSavedValue() != aRegisterCB.IsChecked()))
- {
- const SfxBoolItem& rRegItem = (const SfxBoolItem&)rOldSet.Get(SID_SWREGISTER_MODE);
- SfxBoolItem* pRegItem = (SfxBoolItem*)rRegItem.Clone();
- BOOL bCheck = aRegisterCB.IsChecked();
- pRegItem->SetValue(bCheck);
- rSet.Put(*pRegItem);
- bModified |= TRUE;
- if(bCheck)
- {
- bModified |= TRUE;
- rSet.Put(SfxStringItem(SID_SWREGISTER_COLLECTION,
- aRegisterLB.GetSelectEntry()));
- }
- delete pRegItem;
- }
-
- SvxFrameDirection eDirection = aTextFlowBox.GetSelectEntryValue();
- if( aTextFlowBox.IsVisible() && (eDirection != aTextFlowBox.GetSavedValue()) )
- {
- rSet.Put( SvxFrameDirectionItem( eDirection, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) );
- bModified = TRUE;
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, LayoutHdl_Impl, ListBox *, EMPTYARG )
-{
- // innen au\sen umschalten
- const USHORT nPos = PosToPageUsage_Impl( aLayoutBox.GetSelectEntryPos() );
-
- if ( nPos == SVX_PAGE_MIRROR )
- {
- if ( aLeftMarginLbl.GetText() != aInsideText )
- aLeftMarginLbl.SetText( aInsideText );
-
- if ( aRightMarginLbl.GetText() != aOutsideText )
- aRightMarginLbl.SetText( aOutsideText );
- }
- else
- {
- if ( aLeftMarginLbl.GetText() != aLeftText )
- aLeftMarginLbl.SetText( aLeftText );
-
- if ( aRightMarginLbl.GetText() != aRightText )
- aRightMarginLbl.SetText( aRightText );
- }
- UpdateExample_Impl( true );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, PaperBinHdl_Impl, ListBox *, EMPTYARG )
-{
- if ( aPaperTrayBox.GetEntryCount() > 1 )
- // schon gef"ullt
- return 0;
-
- // Schacht-Box initialisieren
- String aOldName = aPaperTrayBox.GetSelectEntry();
- aPaperTrayBox.SetUpdateMode( FALSE );
- aPaperTrayBox.Clear();
- USHORT nEntryPos = aPaperTrayBox.InsertEntry(
- SVX_RESSTR( RID_SVXSTR_PAPERBIN_SETTINGS ) );
- aPaperTrayBox.SetEntryData( nEntryPos,
- (void*)(ULONG)PAPERBIN_PRINTER_SETTINGS );
- String aPaperBin( SVX_RES( RID_SVXSTR_PAPERBIN ) );
- USHORT nBinCount = pImpl->mpDefPrinter->GetPaperBinCount();
-
- for ( USHORT i = 0; i < nBinCount; ++i )
- {
- String aName = pImpl->mpDefPrinter->GetPaperBinName(i);
-
- if ( !aName.Len() )
- {
- aName = aPaperBin;
- aName.Append( sal_Unicode(' ') );
- aName.Append( UniString::CreateFromInt32( i+1 ) );
- }
- nEntryPos = aPaperTrayBox.InsertEntry( aName );
- aPaperTrayBox.SetEntryData( nEntryPos, (void*)(ULONG)i );
- }
- aPaperTrayBox.SelectEntry( aOldName );
- aPaperTrayBox.SetUpdateMode( TRUE );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox )
-{
- const USHORT nPos = pBox->GetSelectEntryPos();
- Paper ePaper = (Paper)(ULONG)aPaperSizeBox.GetEntryData( nPos );
-
- if ( ePaper != PAPER_USER )
- {
- Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ) );
-
- if ( aLandscapeBtn.IsChecked() )
- Swap( aSize );
-
- if ( aSize.Height() < aPaperHeightEdit.GetMin( FUNIT_100TH_MM ) )
- aPaperHeightEdit.SetMin(
- aPaperHeightEdit.Normalize( aSize.Height() ), FUNIT_100TH_MM );
- if ( aSize.Width() < aPaperWidthEdit.GetMin( FUNIT_100TH_MM ) )
- aPaperWidthEdit.SetMin(
- aPaperWidthEdit.Normalize( aSize.Width() ), FUNIT_100TH_MM );
- SetMetricValue( aPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_100TH_MM );
- SetMetricValue( aPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_100TH_MM );
-
- // R"ander ggf. neu berechnen
- CalcMargin_Impl();
-
- RangeHdl_Impl( 0 );
- UpdateExample_Impl( true );
-
- if ( eMode == SVX_PAGE_MODE_PRESENTATION )
- {
- // Draw: bei Papierformat soll der Rand 1cm betragen
- long nTmp = 0;
- BOOL bScreen = ( PAPER_SCREEN == ePaper );
-
- if ( !bScreen )
- // bei Bildschirm keinen Rand
- nTmp = 1; // entspr. 1cm
-
- // Abfragen, ob fuer Raender 0 gesetzt ist:
- if ( bScreen || aRightMarginEdit.GetValue() == 0 )
- {
- SetMetricValue( aRightMarginEdit, nTmp, SFX_MAPUNIT_CM );
- if ( !bScreen &&
- aRightMarginEdit.GetFirst() > aRightMarginEdit.GetValue() )
- aRightMarginEdit.SetValue( aRightMarginEdit.GetFirst() );
- }
- if ( bScreen || aLeftMarginEdit.GetValue() == 0 )
- {
- SetMetricValue( aLeftMarginEdit, nTmp, SFX_MAPUNIT_CM );
- if ( !bScreen &&
- aLeftMarginEdit.GetFirst() > aLeftMarginEdit.GetValue() )
- aLeftMarginEdit.SetValue( aLeftMarginEdit.GetFirst() );
- }
- if ( bScreen || aBottomMarginEdit.GetValue() == 0 )
- {
- SetMetricValue( aBottomMarginEdit, nTmp, SFX_MAPUNIT_CM );
- if ( !bScreen &&
- aBottomMarginEdit.GetFirst() > aBottomMarginEdit.GetValue() )
- aBottomMarginEdit.SetValue( aBottomMarginEdit.GetFirst() );
- }
- if ( bScreen || aTopMarginEdit.GetValue() == 0 )
- {
- SetMetricValue( aTopMarginEdit, nTmp, SFX_MAPUNIT_CM );
- if ( !bScreen &&
- aTopMarginEdit.GetFirst() > aTopMarginEdit.GetValue() )
- aTopMarginEdit.SetValue( aTopMarginEdit.GetFirst() );
- }
- UpdateExample_Impl( true );
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, PaperSizeModify_Impl, Edit *, EMPTYARG )
-{
- USHORT nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich );
- Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ),
- GetCoreValue( aPaperHeightEdit, eUnit ) );
- Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, (MapUnit)eUnit, TRUE );
- USHORT nEntryCount = aPaperSizeBox.GetEntryCount();
-
- for ( USHORT i = 0; i < nEntryCount; ++i )
- {
- Paper eTmp = (Paper)(ULONG)aPaperSizeBox.GetEntryData(i);
-
- if ( eTmp == ePaper )
- {
- aPaperSizeBox.SelectEntryPos(i);
- break;
- }
- }
- UpdateExample_Impl( true );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn )
-{
- if (
- (!bLandscape && pBtn == &aLandscapeBtn) ||
- (bLandscape && pBtn == &aPortraitBtn)
- )
- {
- bLandscape = aLandscapeBtn.IsChecked();
-
- const long lWidth = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_100TH_MM );
- const long lHeight = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_100TH_MM );
-
- // swap with and height
- SetMetricValue( aPaperWidthEdit, lHeight, SFX_MAPUNIT_100TH_MM );
- SetMetricValue( aPaperHeightEdit, lWidth, SFX_MAPUNIT_100TH_MM );
-
- // recalculate margins if necessary
- CalcMargin_Impl();
-
- PaperSizeSelect_Impl( &aPaperSizeBox );
- RangeHdl_Impl( 0 );
- SwapFirstValues_Impl( bBorderModified );
- UpdateExample_Impl( true );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::SwapFirstValues_Impl( FASTBOOL bSet )
-{
- MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode();
- Orientation eOri = ORIENTATION_PORTRAIT;
-
- if ( bLandscape )
- eOri = ORIENTATION_LANDSCAPE;
- Orientation eOldOri = pImpl->mpDefPrinter->GetOrientation();
- pImpl->mpDefPrinter->SetOrientation( eOri );
- pImpl->mpDefPrinter->SetMapMode( MAP_TWIP );
-
- // First- und Last-Werte f"ur die R"ander setzen
- Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize();
- Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize();
- /*
- * einen Punkt ( 0,0 ) in logische Koordinaten zu konvertieren,
- * sieht aus wie Unsinn; ist aber sinnvoll, wenn der Ursprung des
- * Koordinatensystems verschoben ist.
- */
- Point aPrintOffset = pImpl->mpDefPrinter->GetPageOffset() -
- pImpl->mpDefPrinter->PixelToLogic( Point() );
- pImpl->mpDefPrinter->SetMapMode( aOldMode );
- pImpl->mpDefPrinter->SetOrientation( eOldOri );
-
- sal_Int64 nSetL = aLeftMarginEdit.Denormalize(
- aLeftMarginEdit.GetValue( FUNIT_TWIP ) );
- sal_Int64 nSetR = aRightMarginEdit.Denormalize(
- aRightMarginEdit.GetValue( FUNIT_TWIP ) );
- sal_Int64 nSetT = aTopMarginEdit.Denormalize(
- aTopMarginEdit.GetValue( FUNIT_TWIP ) );
- sal_Int64 nSetB = aBottomMarginEdit.Denormalize(
- aBottomMarginEdit.GetValue( FUNIT_TWIP ) );
-
- long nOffset = !aPrintOffset.X() && !aPrintOffset.Y() ? 0 : PRINT_OFFSET;
- long nNewL = aPrintOffset.X();
- long nNewR =
- aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X() + nOffset;
- long nNewT = aPrintOffset.Y();
- long nNewB =
- aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y() + nOffset;
-
- aLeftMarginEdit.SetFirst( aLeftMarginEdit.Normalize( nNewL ), FUNIT_TWIP );
- nFirstLeftMargin = static_cast<long>(aLeftMarginEdit.GetFirst());
- aRightMarginEdit.SetFirst( aRightMarginEdit.Normalize( nNewR ), FUNIT_TWIP );
- nFirstRightMargin = static_cast<long>(aRightMarginEdit.GetFirst());
- aTopMarginEdit.SetFirst( aTopMarginEdit.Normalize( nNewT ), FUNIT_TWIP );
- nFirstTopMargin = static_cast<long>(aTopMarginEdit.GetFirst());
- aBottomMarginEdit.SetFirst( aBottomMarginEdit.Normalize( nNewB ), FUNIT_TWIP );
- nFirstBottomMargin = static_cast<long>(aBottomMarginEdit.GetFirst());
-
- if ( bSet )
- {
- // ggf. auch die Werte umsetzen,
- if ( nSetL < nNewL )
- aLeftMarginEdit.SetValue( aLeftMarginEdit.Normalize( nNewL ),
- FUNIT_TWIP );
- if ( nSetR < nNewR )
- aRightMarginEdit.SetValue( aRightMarginEdit.Normalize( nNewR ),
- FUNIT_TWIP );
- if ( nSetT < nNewT )
- aTopMarginEdit.SetValue( aTopMarginEdit.Normalize( nNewT ),
- FUNIT_TWIP );
- if ( nSetB < nNewB )
- aBottomMarginEdit.SetValue( aBottomMarginEdit.Normalize( nNewB ),
- FUNIT_TWIP );
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxPageDescPage, BorderModify_Impl, MetricField *, EMPTYARG )
-{
- if ( !bBorderModified )
- bBorderModified = TRUE;
- UpdateExample_Impl();
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxPageDescPage, BorderModify_Impl, MetricField *, EMPTYARG )
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground )
-{
- // Size
- Size aSize( GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_TWIP ),
- GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_TWIP ) );
-
- aBspWin.SetSize( aSize );
-
- // R"ander
- aBspWin.SetTop( GetCoreValue( aTopMarginEdit, SFX_MAPUNIT_TWIP ) );
- aBspWin.SetBottom( GetCoreValue( aBottomMarginEdit, SFX_MAPUNIT_TWIP ) );
- aBspWin.SetLeft( GetCoreValue( aLeftMarginEdit, SFX_MAPUNIT_TWIP ) );
- aBspWin.SetRight( GetCoreValue( aRightMarginEdit, SFX_MAPUNIT_TWIP ) );
-
- // Layout
- aBspWin.SetUsage( PosToPageUsage_Impl( aLayoutBox.GetSelectEntryPos() ) );
- if ( bResetbackground )
- aBspWin.ResetBackground();
- aBspWin.Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::ResetBackground_Impl( const SfxItemSet& rSet )
-{
- USHORT nWhich = GetWhich( SID_ATTR_PAGE_HEADERSET );
-
- if ( rSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_SET )
- {
- const SvxSetItem& rSetItem =
- (const SvxSetItem&)rSet.Get( nWhich, FALSE );
- const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
- const SfxBoolItem& rOn =
- (const SfxBoolItem&)rTmpSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
-
- if ( rOn.GetValue() )
- {
- nWhich = GetWhich( SID_ATTR_BRUSH );
-
- if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET )
- {
- const SvxBrushItem& rItem =
- (const SvxBrushItem&)rTmpSet.Get( nWhich );
- aBspWin.SetHdColor( rItem.GetColor() );
- }
- nWhich = GetWhich( SID_ATTR_BORDER_OUTER );
-
- if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET )
- {
- const SvxBoxItem& rItem =
- (const SvxBoxItem&)rTmpSet.Get( nWhich );
- aBspWin.SetHdBorder( rItem );
- }
- }
- }
-
- nWhich = GetWhich( SID_ATTR_PAGE_FOOTERSET );
-
- if ( rSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_SET )
- {
- const SvxSetItem& rSetItem =
- (const SvxSetItem&)rSet.Get( nWhich, FALSE );
- const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
- const SfxBoolItem& rOn =
- (const SfxBoolItem&)rTmpSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
-
- if ( rOn.GetValue() )
- {
- nWhich = GetWhich( SID_ATTR_BRUSH );
-
- if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET )
- {
- const SvxBrushItem& rItem =
- (const SvxBrushItem&)rTmpSet.Get( nWhich );
- aBspWin.SetFtColor( rItem.GetColor() );
- }
- nWhich = GetWhich( SID_ATTR_BORDER_OUTER );
-
- if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET )
- {
- const SvxBoxItem& rItem =
- (const SvxBoxItem&)rTmpSet.Get( nWhich );
- aBspWin.SetFtBorder( rItem );
- }
- }
- }
-
- const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_BRUSH );
-
- if ( pItem )
- {
- aBspWin.SetColor( ( (const SvxBrushItem*)pItem )->GetColor() );
- const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic();
-
- if ( pGrf )
- {
- Bitmap aBitmap = pGrf->GetBitmap();
- aBspWin.SetBitmap( &aBitmap );
- }
- else
- aBspWin.SetBitmap( NULL );
- }
-
- pItem = GetItem( rSet, SID_ATTR_BORDER_OUTER );
-
- if ( pItem )
- aBspWin.SetBorder( (SvxBoxItem&)*pItem );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
-{
- bLandscape = aLandscapeBtn.IsChecked();
- const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
-
- if ( pItem )
- aBspWin.SetSize( ( (const SvxSizeItem*)pItem )->GetSize() );
-
- const SvxSetItem* pSetItem = 0;
-
- // Kopfzeilen-Attribute auswerten
-
- if ( SFX_ITEM_SET ==
- rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
- FALSE, (const SfxPoolItem**)&pSetItem ) )
- {
- const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
- const SfxBoolItem& rHeaderOn =
- (const SfxBoolItem&)rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
-
- if ( rHeaderOn.GetValue() )
- {
- const SvxSizeItem& rSize = (const SvxSizeItem&)
- rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
- const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)
- rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) );
- long nDist = rUL.GetLower();
- aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist );
- aBspWin.SetHdDist( nDist );
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)
- rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
- aBspWin.SetHdLeft( rLR.GetLeft() );
- aBspWin.SetHdRight( rLR.GetRight() );
- aBspWin.SetHeader( TRUE );
- }
- else
- aBspWin.SetHeader( FALSE );
-
- // im Beispiel Hintergrund und Umrandung anzeigen
- USHORT nWhich = GetWhich( SID_ATTR_BRUSH );
-
- if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxBrushItem& rItem =
- (const SvxBrushItem&)rHeaderSet.Get( nWhich );
- aBspWin.SetHdColor( rItem.GetColor() );
- }
- nWhich = GetWhich( SID_ATTR_BORDER_OUTER );
-
- if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxBoxItem& rItem =
- (const SvxBoxItem&)rHeaderSet.Get( nWhich );
- aBspWin.SetHdBorder( rItem );
- }
- }
-
- // Fusszeilen-Attribute auswerten
-
- if ( SFX_ITEM_SET ==
- rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ),
- FALSE, (const SfxPoolItem**)&pSetItem ) )
- {
- const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
- const SfxBoolItem& rFooterOn =
- (const SfxBoolItem&)rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
-
- if ( rFooterOn.GetValue() )
- {
- const SvxSizeItem& rSize = (const SvxSizeItem&)
- rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
- const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)
- rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) );
- long nDist = rUL.GetUpper();
- aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist );
- aBspWin.SetFtDist( nDist );
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)
- rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
- aBspWin.SetFtLeft( rLR.GetLeft() );
- aBspWin.SetFtRight( rLR.GetRight() );
- aBspWin.SetFooter( TRUE );
- }
- else
- aBspWin.SetFooter( FALSE );
-
- // im Beispiel Hintergrund und Umrandung anzeigen
- USHORT nWhich = GetWhich( SID_ATTR_BRUSH );
-
- if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxBrushItem& rItem =
- (const SvxBrushItem&)rFooterSet.Get( nWhich );
- aBspWin.SetFtColor( rItem.GetColor() );
- }
- nWhich = GetWhich( SID_ATTR_BORDER_OUTER );
-
- if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxBoxItem& rItem =
- (const SvxBoxItem&)rFooterSet.Get( nWhich );
- aBspWin.SetFtBorder( rItem );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::ActivatePage( const SfxItemSet& rSet )
-{
- InitHeadFoot_Impl( rSet );
- ResetBackground_Impl( rSet );
- RangeHdl_Impl( 0 );
-}
-
-// -----------------------------------------------------------------------
-
-int SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
-{
- // Abfrage, ob die Seitenr"ander ausserhalb des Druckbereichs liegen
- // Wenn nicht, dann den Anwender fragen, ob sie "ubernommen werden sollen.
- // Wenn nicht, dann auf der TabPage bleiben.
- USHORT nPos = aPaperSizeBox.GetSelectEntryPos();
- Paper ePaper = (Paper)(ULONG)aPaperSizeBox.GetEntryData( nPos );
-
- if ( ePaper != PAPER_SCREEN && IsMarginOutOfRange() )
- {
- if ( QueryBox( this, WB_YES_NO | WB_DEF_NO, aPrintRangeQueryText ).Execute() == RET_NO )
- {
- MetricField* pField = NULL;
- if ( IsPrinterRangeOverflow( aLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) )
- pField = &aLeftMarginEdit;
- if ( IsPrinterRangeOverflow( aRightMarginEdit, nFirstRightMargin, nLastRightMargin, MARGIN_RIGHT )
- && !pField )
- pField = &aRightMarginEdit;
- if ( IsPrinterRangeOverflow( aTopMarginEdit, nFirstTopMargin, nLastTopMargin, MARGIN_TOP )
- && !pField )
- pField = &aTopMarginEdit;
- if ( IsPrinterRangeOverflow( aBottomMarginEdit, nFirstBottomMargin, nLastBottomMargin, MARGIN_BOTTOM )
- && !pField )
- pField = &aBottomMarginEdit;
- if ( pField )
- pField->GrabFocus();
- UpdateExample_Impl();
- return KEEP_PAGE;
- }
- else
- CheckMarginEdits( false );
- }
-
- if ( _pSet )
- {
- FillItemSet( *_pSet );
-
- // ggf. hoch/quer putten
- USHORT nWh = GetWhich( SID_ATTR_PAGE_SIZE );
- SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWh );
- Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ),
- GetCoreValue( aPaperHeightEdit, eUnit ) );
-
- // putten, wenn aktuelle Gr"o/se unterschiedlich zum Wert in _pSet
- const SvxSizeItem* pSize = (const SvxSizeItem*)GetItem( *_pSet, SID_ATTR_PAGE_SIZE );
- if ( aSize.Width() && ( !pSize || !IsEqualSize_Impl( pSize, aSize ) ) )
- _pSet->Put( SvxSizeItem( nWh, aSize ) );
- }
-
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, RangeHdl_Impl, Edit *, EMPTYARG )
-{
- // Aktuelle Header-Breite/H"ohe aus dem Bsp
- long nHHeight = aBspWin.GetHdHeight();
- long nHDist = aBspWin.GetHdDist();
-
- // Aktuelle Footer-Breite/H"ohe aus dem Bsp
- long nFHeight = aBspWin.GetFtHeight();
- long nFDist = aBspWin.GetFtDist();
-
- // Aktuelle Header/Footer-R"ander aus dem Bsp
- long nHFLeft = Max( aBspWin.GetHdLeft(), aBspWin.GetFtLeft() );
- long nHFRight = Max( aBspWin.GetHdRight(), aBspWin.GetFtRight() );
-
- // Aktuelle Werte der Seitenr"ander
- long nBT = static_cast<long>(aTopMarginEdit.Denormalize(aTopMarginEdit.GetValue(FUNIT_TWIP)));
- long nBB = static_cast<long>(aBottomMarginEdit.Denormalize(aBottomMarginEdit.GetValue(FUNIT_TWIP)));
- long nBL = static_cast<long>(aLeftMarginEdit.Denormalize(aLeftMarginEdit.GetValue(FUNIT_TWIP)));
- long nBR = static_cast<long>(aRightMarginEdit.Denormalize(aRightMarginEdit.GetValue(FUNIT_TWIP)));
-
- // Breite Umrandung der Seite berechnen
- const SfxItemSet* _pSet = &GetItemSet();
- Size aBorder;
-
- if ( _pSet->GetItemState( GetWhich(SID_ATTR_BORDER_SHADOW) ) >=
- SFX_ITEM_AVAILABLE &&
- _pSet->GetItemState( GetWhich(SID_ATTR_BORDER_OUTER) ) >=
- SFX_ITEM_AVAILABLE )
- {
- aBorder = ( GetMinBorderSpace_Impl(
- (const SvxShadowItem&)_pSet->Get(GetWhich(SID_ATTR_BORDER_SHADOW)),
- (const SvxBoxItem&)_pSet->Get(GetWhich(SID_ATTR_BORDER_OUTER))));
- }
-
- long nH = static_cast<long>(aPaperHeightEdit.Denormalize(aPaperHeightEdit.GetValue(FUNIT_TWIP)));
- long nW = static_cast<long>(aPaperWidthEdit.Denormalize(aPaperWidthEdit.GetValue(FUNIT_TWIP)));
-
- // Grenzen Papier
- // Maximum liegt bei 54cm
- //
- long nMin = nHHeight + nHDist + nFDist + nFHeight + nBT + nBB +
- MINBODY + aBorder.Height();
- aPaperHeightEdit.SetMin(aPaperHeightEdit.Normalize(nMin), FUNIT_TWIP);
-
- nMin = MINBODY + nBL + nBR + aBorder.Width();
- aPaperWidthEdit.SetMin(aPaperWidthEdit.Normalize(nMin), FUNIT_TWIP);
-
- // Falls sich die Papiergr"o\se ge"adert hat
- nH = static_cast<long>(aPaperHeightEdit.Denormalize(aPaperHeightEdit.GetValue(FUNIT_TWIP)));
- nW = static_cast<long>(aPaperWidthEdit.Denormalize(aPaperWidthEdit.GetValue(FUNIT_TWIP)));
-
- // Top
- long nMax = nH - nBB - aBorder.Height() - MINBODY -
- nFDist - nFHeight - nHDist - nHHeight;
-
- aTopMarginEdit.SetMax(aTopMarginEdit.Normalize(nMax), FUNIT_TWIP);
-
- // Bottom
- nMax = nH - nBT - aBorder.Height() - MINBODY -
- nFDist - nFHeight - nHDist - nHHeight;
-
- aBottomMarginEdit.SetMax(aTopMarginEdit.Normalize(nMax), FUNIT_TWIP);
-
- // Left
- nMax = nW - nBR - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
- aLeftMarginEdit.SetMax(aLeftMarginEdit.Normalize(nMax), FUNIT_TWIP);
-
- // Right
- nMax = nW - nBL - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
- aRightMarginEdit.SetMax(aRightMarginEdit.Normalize(nMax), FUNIT_TWIP);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::CalcMargin_Impl()
-{
- // Aktuelle Werte der Seitenr"ander
- long nBT = GetCoreValue( aTopMarginEdit, SFX_MAPUNIT_TWIP );
- long nBB = GetCoreValue( aBottomMarginEdit, SFX_MAPUNIT_TWIP );
-
- long nBL = GetCoreValue( aLeftMarginEdit, SFX_MAPUNIT_TWIP );
- long nBR = GetCoreValue( aRightMarginEdit, SFX_MAPUNIT_TWIP );
-
- long nH = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_TWIP );
- long nW = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_TWIP );
-
- long nWidth = nBL + nBR + MINBODY;
- long nHeight = nBT + nBB + MINBODY;
-
- if ( nWidth > nW || nHeight > nH )
- {
- if ( nWidth > nW )
- {
- long nTmp = nBL <= nBR ? nBR : nBL;
- nTmp -= nWidth - nW;
-
- if ( nBL <= nBR )
- SetMetricValue( aRightMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
- else
- SetMetricValue( aLeftMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
- }
-
- if ( nHeight > nH )
- {
- long nTmp = nBT <= nBB ? nBB : nBT;
- nTmp -= nHeight - nH;
-
- if ( nBT <= nBB )
- SetMetricValue( aBottomMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
- else
- SetMetricValue( aTopMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxPageDescPage, CenterHdl_Impl, CheckBox *, EMPTYARG )
-{
- aBspWin.SetHorz( aHorzBox.IsChecked() );
- aBspWin.SetVert( aVertBox.IsChecked() );
- UpdateExample_Impl();
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxPageDescPage, CenterHdl_Impl, CheckBox *, EMPTYARG )
-
-// -----------------------------------------------------------------------
-
-void SvxPageDescPage::SetCollectionList(const List* pList)
-{
- sStandardRegister = *(String*)pList->GetObject(0);
- for( USHORT i = 1; i < pList->Count(); i++ )
- {
- aRegisterLB.InsertEntry(*(String*)pList->GetObject(i));
- }
-
- aRegisterCB .Show();
- aRegisterFT .Show();
- aRegisterLB.Show();
- aRegisterCB.SetClickHdl(LINK(this, SvxPageDescPage, RegisterModify));
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPageDescPage, RegisterModify, CheckBox*, pBox )
-{
- BOOL bEnable = FALSE;
- if(pBox->IsChecked())
- {
- bEnable = TRUE;
- if(USHRT_MAX == aRegisterLB.GetSelectEntryPos())
- aRegisterLB.SelectEntry(sStandardRegister);
- }
- aRegisterFT.Enable( bEnable );
- aRegisterLB.Enable( bEnable );
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-
-void SvxPageDescPage::DisableVerticalPageDir()
-{
- aTextFlowBox.RemoveEntryValue( FRMDIR_VERT_TOP_RIGHT );
- aTextFlowBox.RemoveEntryValue( FRMDIR_VERT_TOP_LEFT );
- if( aTextFlowBox.GetEntryCount() < 2 )
- {
- aTextFlowLbl.Hide();
- aTextFlowBox.Hide();
- aBspWin.EnableFrameDirection( sal_False );
- }
-}
-
-IMPL_LINK( SvxPageDescPage, FrameDirectionModify_Impl, ListBox*, EMPTYARG)
-{
- aBspWin.SetFrameDirection( (sal_uInt32) aTextFlowBox.GetSelectEntryValue() );
- aBspWin.Invalidate();
- return 0;
-}
-
-bool SvxPageDescPage::IsPrinterRangeOverflow(
- MetricField& rField, long nFirstMargin, long nLastMargin, MarginPosition nPos )
-{
- bool bRet = false;
- bool bCheck = ( ( pImpl->m_nPos & nPos ) == 0 );
- long nValue = static_cast<long>(rField.GetValue());
- if ( bCheck &&
- ( nValue < nFirstMargin || nValue > nLastMargin ) &&
- rField.GetText() != rField.GetSavedValue() )
- {
- rField.SetValue( nValue < nFirstMargin ? nFirstMargin : nLastMargin );
- bRet = true;
- }
-
- return bRet;
-}
-
-/** Check if a value of a margin edit is outside the printer paper margins
- and save this information.
-*/
-void SvxPageDescPage::CheckMarginEdits( bool _bClear )
-{
- if ( _bClear )
- pImpl->m_nPos = 0;
-
- sal_Int64 nValue = aLeftMarginEdit.GetValue();
- if ( nValue < nFirstLeftMargin || nValue > nLastLeftMargin )
- pImpl->m_nPos |= MARGIN_LEFT;
- nValue = aRightMarginEdit.GetValue();
- if ( nValue < nFirstRightMargin || nValue > nLastRightMargin )
- pImpl->m_nPos |= MARGIN_RIGHT;
- nValue = aTopMarginEdit.GetValue();
- if ( nValue < nFirstTopMargin || nValue > nLastTopMargin )
- pImpl->m_nPos |= MARGIN_TOP;
- nValue = aBottomMarginEdit.GetValue();
- if ( nValue < nFirstBottomMargin || nValue > nLastBottomMargin )
- pImpl->m_nPos |= MARGIN_BOTTOM;
-}
-
-bool SvxPageDescPage::IsMarginOutOfRange()
-{
- bool bRet = ( ( ( !( pImpl->m_nPos & MARGIN_LEFT ) &&
- ( aLeftMarginEdit.GetText() != aLeftMarginEdit.GetSavedValue() ) ) &&
- ( aLeftMarginEdit.GetValue() < nFirstLeftMargin ||
- aLeftMarginEdit.GetValue() > nLastLeftMargin ) ) ||
- ( ( !( pImpl->m_nPos & MARGIN_RIGHT ) &&
- ( aRightMarginEdit.GetText() != aRightMarginEdit.GetSavedValue() ) ) &&
- ( aRightMarginEdit.GetValue() < nFirstRightMargin ||
- aRightMarginEdit.GetValue() > nLastRightMargin ) ) ||
- ( ( !( pImpl->m_nPos & MARGIN_TOP ) &&
- ( aTopMarginEdit.GetText() != aTopMarginEdit.GetSavedValue() ) ) &&
- ( aTopMarginEdit.GetValue() < nFirstTopMargin ||
- aTopMarginEdit.GetValue() > nLastTopMargin ) ) ||
- ( ( !( pImpl->m_nPos & MARGIN_BOTTOM ) &&
- ( aBottomMarginEdit.GetText() != aBottomMarginEdit.GetSavedValue() ) ) &&
- ( aBottomMarginEdit.GetValue() < nFirstBottomMargin ||
- aBottomMarginEdit.GetValue() > nLastBottomMargin ) ) );
- return bRet;
-}
-
-void SvxPageDescPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pModeItem,SfxAllEnumItem,SID_ENUM_PAGE_MODE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END,sal_False);
- SFX_ITEMSET_ARG (&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST,sal_False);
- if (pModeItem)
- SetMode((SvxModeType)pModeItem->GetEnumValue());
- if (pPaperStartItem && pPaperEndItem)
- SetPaperFormatRanges( (Paper)pPaperStartItem->GetEnumValue(), (Paper)pPaperEndItem->GetEnumValue() );
- if (pCollectListItem)
- SetCollectionList(pCollectListItem->GetList());
-}
diff --git a/svx/source/cui/page.h b/svx/source/cui/page.h
deleted file mode 100644
index 1df26b13b2..0000000000
--- a/svx/source/cui/page.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: page.h,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_PAGE_H
-#define _SVX_PAGE_H
-
-// define ----------------------------------------------------------------
-
-#define PAPERSIZE_A0 0
-#define PAPERSIZE_A1 1
-#define PAPERSIZE_A2 2
-#define PAPERSIZE_A3 3
-#define PAPERSIZE_A4 4
-#define PAPERSIZE_A5 5
-#define PAPERSIZE_B4_ISO 6
-#define PAPERSIZE_B5_ISO 7
-#define PAPERSIZE_LETTER 8
-#define PAPERSIZE_LEGAL 9
-#define PAPERSIZE_TABLOID 10
-#define PAPERSIZE_USER 11
-#define PAPERSIZE_B6_ISO 12
-#define PAPERSIZE_C4 13
-#define PAPERSIZE_C5 14
-#define PAPERSIZE_C6 15
-#define PAPERSIZE_C65 16
-#define PAPERSIZE_DL 17
-#define PAPERSIZE_DIA 18
-#define PAPERSIZE_SCREEN 19
-#define PAPERSIZE_C 20
-#define PAPERSIZE_D 21
-#define PAPERSIZE_E 22
-#define PAPERSIZE_EXECUTIVE 23
-#define PAPERSIZE_LEGAL2 24
-#define PAPERSIZE_MONARCH 25
-#define PAPERSIZE_COM675 26
-#define PAPERSIZE_COM9 27
-#define PAPERSIZE_COM10 28
-#define PAPERSIZE_COM11 29
-#define PAPERSIZE_COM12 30
-#define PAPERSIZE_KAI16 31
-#define PAPERSIZE_KAI32 32
-#define PAPERSIZE_KAI32BIG 33
-#define PAPERSIZE_B4_JIS 34
-#define PAPERSIZE_B5_JIS 35
-#define PAPERSIZE_B6_JIS 36
-
-#endif
-
diff --git a/svx/source/cui/page.hrc b/svx/source/cui/page.hrc
deleted file mode 100644
index bee5c13345..0000000000
--- a/svx/source/cui/page.hrc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: page.hrc,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_PAGE_HRC
-#define _SVX_PAGE_HRC
-
-// defines ---------------------------------------------------------------
-
-#define FT_LEFT_MARGIN 10
-#define ED_LEFT_MARGIN 11
-#define FT_RIGHT_MARGIN 12
-#define ED_RIGHT_MARGIN 13
-#define FT_TOP_MARGIN 14
-#define ED_TOP_MARGIN 15
-#define FT_BOTTOM_MARGIN 16
-#define ED_BOTTOM_MARGIN 17
-#define FL_MARGIN 18
-
-#define LB_LAYOUT 20
-#define FT_PAGELAYOUT 21
-
-#define LB_NUMBER_FORMAT 30
-#define FL_LAYOUT 31
-#define FT_NUMBER_FORMAT 32
-
-#define FT_TEXT_FLOW 35
-#define LB_TEXT_FLOW 36
-
-#define WN_BSP 40
-
-#define FT_ORIENTATION 48
-#define FT_PAPER_FORMAT 49
-#define LB_PAPER_SIZE 50
-#define RB_PORTRAIT 51
-#define RB_LANDSCAPE 52
-#define FT_PAPER_WIDTH 53
-#define ED_PAPER_WIDTH 54
-#define FT_PAPER_HEIGHT 55
-#define ED_PAPER_HEIGHT 56
-#define FT_PAPER_TRAY 57
-#define LB_PAPER_TRAY 58
-#define FL_PAPER_SIZE 59
-
-#define CB_REGISTER 60
-#define FT_REGISTER 61
-#define LB_REGISTER 62
-#define FL_BOTTOM_SEP 64
-
-#define CB_HORZ 70
-#define CB_VERT 71
-#define CB_ADAPT 72
-#define FT_TBL_ALIGN 73
-
-#define PB_BACK 80
-
-#define STR_INSIDE 90
-#define STR_OUTSIDE 91
-#define STR_QUERY_PRINTRANGE 92
-
-#endif
-
diff --git a/svx/source/cui/page.hxx b/svx/source/cui/page.hxx
deleted file mode 100644
index 5be2c4d63f..0000000000
--- a/svx/source/cui/page.hxx
+++ /dev/null
@@ -1,256 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: page.hxx,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_PAGE_HXX
-#define _SVX_PAGE_HXX
-
-
-#include <sfx2/tabdlg.hxx>
-
-#ifndef _FIELD_HXX //autogen
-#include <vcl/field.hxx>
-#endif
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#include <svtools/stdctrl.hxx>
-#include <svx/pagectrl.hxx>
-#include <svx/frmdirlbox.hxx>
-
-#include <svx/svxenum.hxx>
-
-#include <i18npool/paper.hxx>
-
-#include "flagsdef.hxx" //CHINA001
-
-// enum ------------------------------------------------------------------
-
-//CHINA001 enum SvxModeType
-//CHINA001 {
-//CHINA001 SVX_PAGE_MODE_STANDARD,
-//CHINA001 SVX_PAGE_MODE_CENTER,
-//CHINA001 SVX_PAGE_MODE_PRESENTATION
-//CHINA001 };
-
-// class SvxPageDescPage -------------------------------------------------
-
-/* {k:\svx\prototyp\dialog\page.bmp}
-
- [Beschreibung]
- TabPage zur Einstellung einer Seite (Groesse, Raender, ...)
-
- [Items]
- <SvxPageItem>: <SID_ATTR_PAGE>
- <SvxSizeItem>: <SID_ATTR_SIZE>
- <SvxSizeItem>: <SID_ATTR_MAXSIZE>
- <SvxULSpaceItem>: <SID_ATTR_LRSPACE>
- <SvxLRSpaceItem>: <SID_ATTR_ULSPACE>
- <SfxAllEnumItem>: <SID_ATTR_PAPERTRAY>
- <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
- <SvxBoolItem>: <SID_ATTR_EXT1>
- <SvxBoolItem>: <SID_ATTR_EXT2>
-
- <SfxSetItem>: <SID_ATTR_HEADERSET>
- <SfxBoolItem>: <SID_ATTR_ON>
- <SfxBoolItem>: <SID_ATTR_DYNAMIC>
- <SfxBoolItem>: <SID_ATTR_SHARED>
- <SvxSizeItem>: <SID_ATTR_SIZE>
- <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
- <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
-
- <SfxSetItem>: <SID_ATTR_FOOTERSET>
- <SfxBoolItem>: <SID_ATTR_ON>
- <SfxBoolItem>: <SID_ATTR_DYNAMIC>
- <SfxBoolItem>: <SID_ATTR_SHARED>
- <SvxSizeItem>: <SID_ATTR_SIZE>
- <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
- <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
-*/
-
-struct SvxPage_Impl;
-typedef USHORT MarginPosition;
-
-class SvxPageDescPage : public SfxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
- // paper format
- FixedLine aPaperSizeFl;
- FixedText aPaperFormatText;
- ListBox aPaperSizeBox;
-
- FixedText aPaperWidthText;
- MetricField aPaperWidthEdit;
- FixedText aPaperHeightText;
- MetricField aPaperHeightEdit;
-
- FixedText aOrientationFT;
- RadioButton aPortraitBtn;
- RadioButton aLandscapeBtn;
-
- SvxPageWindow aBspWin;
-
- FixedText aTextFlowLbl;
- svx::FrameDirectionListBox aTextFlowBox;
-
- FixedText aPaperTrayLbl;
- ListBox aPaperTrayBox;
-
- // Margins
- FixedLine aMarginFl;
- FixedText aLeftMarginLbl;
- MetricField aLeftMarginEdit;
- FixedText aRightMarginLbl;
- MetricField aRightMarginEdit;
- FixedText aTopMarginLbl;
- MetricField aTopMarginEdit;
- FixedText aBottomMarginLbl;
- MetricField aBottomMarginEdit;
-
- // layout settings
- FixedLine aLayoutFL;
- FixedText aPageText;
- ListBox aLayoutBox;
- FixedText aNumberFormatText;
- ListBox aNumberFormatBox;
-
- FixedLine aBottomSeparatorFl;
-
- //Extras Calc
- FixedText aTblAlignFT;
- CheckBox aHorzBox;
- CheckBox aVertBox;
-
- // Impress and Draw
- CheckBox aAdaptBox;
-
- //Register Writer
- CheckBox aRegisterCB;
- FixedText aRegisterFT;
- ListBox aRegisterLB;
-
- String sStandardRegister;
-
- String aInsideText;
- String aOutsideText;
- String aLeftText;
- String aRightText;
- String aPrintRangeQueryText;
-
- long nFirstLeftMargin;
- long nFirstRightMargin;
- long nFirstTopMargin;
- long nFirstBottomMargin;
- long nLastLeftMargin;
- long nLastRightMargin;
- long nLastTopMargin;
- long nLastBottomMargin;
-
- Size aMaxSize;
- BOOL bLandscape;
- FASTBOOL bBorderModified;
- SvxModeType eMode;
- Paper ePaperStart;
- Paper ePaperEnd;
-
- SvxPage_Impl* pImpl;
-
-#ifdef _SVX_PAGE_CXX
- void Init_Impl();
- DECL_LINK( LayoutHdl_Impl, ListBox* );
- DECL_LINK( PaperBinHdl_Impl, ListBox* );
- DECL_LINK( SwapOrientation_Impl, RadioButton* );
- void SwapFirstValues_Impl( FASTBOOL bSet );
- DECL_LINK( BorderModify_Impl, MetricField* );
- void InitHeadFoot_Impl( const SfxItemSet& rSet );
- DECL_LINK( CenterHdl_Impl, CheckBox* );
- void UpdateExample_Impl( bool bResetbackground = false );
-
- // Papiergroesse
- DECL_LINK( PaperSizeSelect_Impl, ListBox* );
- DECL_LINK( PaperSizeModify_Impl, Edit* );
-
- DECL_LINK( FrameDirectionModify_Impl, ListBox* );
-
- // Hintergrund
- void ResetBackground_Impl( const SfxItemSet& rSet );
-
- // Grenzwerte
- DECL_LINK( RangeHdl_Impl, Edit* );
- void CalcMargin_Impl();
-
- // Registerhaltigkeit
- DECL_LINK( RegisterModify, CheckBox * );
-
- // page direction
- /** Disables vertical page direction entries in the text flow listbox. */
- void DisableVerticalPageDir();
-
- bool IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin,
- long nLastMargin, MarginPosition nPos );
- void CheckMarginEdits( bool _bClear );
- bool IsMarginOutOfRange();
-#endif
-
- SvxPageDescPage( Window* pParent, const SfxItemSet& rSet );
-
-protected:
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rOutSet );
- virtual void Reset( const SfxItemSet& rSet );
- virtual void FillUserData();
-
- virtual ~SvxPageDescPage();
-
- void SetMode( SvxModeType eMType ) { eMode = eMType; }
- void SetPaperFormatRanges( Paper eStart, Paper eEnd )
- { ePaperStart = eStart, ePaperEnd = eEnd; }
-
- void SetCollectionList(const List* pList);
- virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
-};
-
-#endif // #ifndef _SVX_PAGE_HXX
-
diff --git a/svx/source/cui/page.src b/svx/source/cui/page.src
deleted file mode 100644
index 2da8922d42..0000000000
--- a/svx/source/cui/page.src
+++ /dev/null
@@ -1,668 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: page.src,v $
- * $Revision: 1.71 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include ---------------------------------------------------------------
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "page.hrc"
-#include "page.h"
-
- // RID_SVXPAGE_PAGE ------------------------------------------------------
-
-TabPage RID_SVXPAGE_PAGE
-{
- HelpId = HID_FORMAT_PAGE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_PAPER_SIZE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 164 , 8 ) ;
- Text [ en-US ] = "Paper format" ;
- };
- FixedText FT_PAPER_FORMAT
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~Format";
- };
- ListBox LB_PAPER_SIZE
- {
- Pos = MAP_APPFONT ( 50 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 64 ) ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedText FT_PAPER_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~Width" ;
- Left = TRUE ;
- };
- MetricField ED_PAPER_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 50, 30 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- // #i4219# taken from congiguration now Maximum = 11900 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- // #i4219# Last = 11900 ;
- SpinSize = 10 ;
- };
- FixedText FT_PAPER_HEIGHT
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "~Height" ;
- Left = TRUE ;
- };
- MetricField ED_PAPER_HEIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 50 , 46 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- // #i4219# taken from congiguration now Maximum = 11900 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- // #i4219# Last = 11900 ;
- SpinSize = 10 ;
- };
- FixedText FT_ORIENTATION
- {
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "Orientation";
- };
- RadioButton RB_PORTRAIT
- {
- Pos = MAP_APPFONT ( 50 , 62 ) ;
- Size = MAP_APPFONT ( 53 , 10 ) ;
- Check = TRUE ;
- Text [ en-US ] = "~Portrait" ;
- };
- RadioButton RB_LANDSCAPE
- {
- Pos = MAP_APPFONT ( 50 , 74 ) ;
- Size = MAP_APPFONT ( 53 , 10 ) ;
- Text [ en-US ] = "L~andscape";
- };
- Window WN_BSP
- {
- Pos = MAP_APPFONT ( 176 , 6 ) ;
- Size = MAP_APPFONT ( 75 , 46 ) ;
- };
-
- FixedText FT_TEXT_FLOW
- {
- Pos = MAP_APPFONT ( 113 , 60 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Left = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "~Text direction";
- };
- ListBox LB_TEXT_FLOW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 165 , 58 ) ;
- Size = MAP_APPFONT ( 83 , 50 ) ;
- DropDown = TRUE ;
- Hide = TRUE ;
- };
-
- FixedText FT_PAPER_TRAY
- {
- Pos = MAP_APPFONT ( 113 , 74 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Paper ~tray";
- };
- ListBox LB_PAPER_TRAY
- {
- Pos = MAP_APPFONT ( 165 , 72 ) ;
- Size = MAP_APPFONT ( 83 , 50 ) ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedLine FL_MARGIN
- {
- Pos = MAP_APPFONT ( 6 , 90 ) ;
- Size = MAP_APPFONT ( 95 , 8 ) ;
- Text [ en-US ] = "Margins";
- };
- FixedText FT_LEFT_MARGIN
- {
- Pos = MAP_APPFONT ( 12 , 103 ) ;
- Size = MAP_APPFONT ( 40 , 8 ) ;
- Text [ en-US ] = "~Left" ;
- Left = TRUE ;
- };
- MetricField ED_LEFT_MARGIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 101 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- // #i4219# taken from congiguration now Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- // #i4219# Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_RIGHT_MARGIN
- {
- Pos = MAP_APPFONT ( 12 , 119 ) ;
- Size = MAP_APPFONT ( 40 , 8 ) ;
- Text [ en-US ] = "~Right" ;
- Left = TRUE ;
- };
- MetricField ED_RIGHT_MARGIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 117 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- // #i4219# taken from congiguration now Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- // #i4219# Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_TOP_MARGIN
- {
- Pos = MAP_APPFONT ( 12 , 135 ) ;
- Size = MAP_APPFONT ( 40 , 8 ) ;
- Text [ en-US ] = "~Top" ;
- Left = TRUE ;
- };
- MetricField ED_TOP_MARGIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 133 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- // #i4219# taken from congiguration now Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- // #i4219# Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_BOTTOM_MARGIN
- {
- Pos = MAP_APPFONT ( 12 , 151 ) ;
- Size = MAP_APPFONT ( 40 , 8 ) ;
- Text [ en-US ] = "~Bottom" ;
- Left = TRUE ;
- };
- MetricField ED_BOTTOM_MARGIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 149 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- // #i4219# taken from congiguration now Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- // #i4219# Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedLine FL_BOTTOM_SEP
- {
- Pos = MAP_APPFONT ( 102 , 101 ) ;
- Size = MAP_APPFONT ( 4 , 68 ) ;
- Vert = TRUE;
- };
- FixedLine FL_LAYOUT
- {
- Pos = MAP_APPFONT ( 107, 90 ) ;
- Size = MAP_APPFONT ( 147 , 8 ) ;
- Text [ en-US ] = "Layout settings";
- };
- FixedText FT_PAGELAYOUT
- {
- Pos = MAP_APPFONT ( 113 , 103 ) ;
- Size = MAP_APPFONT ( 54 , 8 ) ;
- Text [ en-US ] = "Page layout" ;
- };
- ListBox LB_LAYOUT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 170, 101 ) ;
- Size = MAP_APPFONT ( 78 , 44 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Right and left" ; Default ; > ;
- < "Mirrored" ; Default ; > ;
- < "Only right" ; Default ; > ;
- < "Only left" ; Default ; > ;
- };
- };
- FixedText FT_NUMBER_FORMAT
- {
- Pos = MAP_APPFONT ( 113 , 119 ) ;
- Size = MAP_APPFONT ( 54 , 8 ) ;
- Text [ en-US ] = "For~mat";
- };
- ListBox LB_NUMBER_FORMAT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 170 , 117 ) ;
- Size = MAP_APPFONT ( 78 , 64 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "A, B, C, ..." ; Default ; > ;
- < "a, b, c, ..." ; Default ; > ;
- < "I, II, III, ..." ; Default ; > ;
- < "i, ii, iii, ..." ; Default ; > ;
- < "1, 2, 3, ..." ; Default ; > ;
- < "None" ; Default ; > ;
- };
- };
- FixedText FT_TBL_ALIGN
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 113 , 133 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "Table alignment";
- };
- CheckBox CB_HORZ
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 175 , 133 ) ;
- Size = MAP_APPFONT ( 73 , 10 ) ;
- Text [ en-US ] = "Hori~zontal" ;
- };
- CheckBox CB_VERT
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 175 , 147 ) ;
- Size = MAP_APPFONT ( 73 , 10 ) ;
- Text [ en-US ] = "~Vertical" ;
- };
- CheckBox CB_ADAPT
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 113 , 133 ) ;
- Size = MAP_APPFONT ( 135 , 10 ) ;
- Text [ en-US ] = "~Fit object to paper format";
- };
- /* Registerhaltigkeit (fuer SW) */
- CheckBox CB_REGISTER
- {
- Pos = MAP_APPFONT ( 113 , 133 ) ;
- Size = MAP_APPFONT ( 135 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Register-true" ;
- };
- FixedText FT_REGISTER
- {
- Pos = MAP_APPFONT ( 122 , 147 ) ;
- Size = MAP_APPFONT ( 126 , 8 ) ;
- Text [ en-US ] = "Reference ~Style" ;
- Hide = TRUE ;
- };
- ListBox LB_REGISTER
- {
- Pos = MAP_APPFONT ( 122 , 157 ) ;
- Size = MAP_APPFONT ( 126 , 50 ) ;
- DropDown = TRUE ;
- Hide = TRUE ;
- Sort = TRUE ;
- HScroll = TRUE ;
- DDExtraWidth = TRUE ;
- };
- String STR_INSIDE
- {
- Text [ en-US ] = "I~nner" ;
- };
- String STR_OUTSIDE
- {
- Text [ en-US ] = "O~uter" ;
- };
- String STR_QUERY_PRINTRANGE
- {
- Text [ en-US ] = "The margin settings are out of print range.\n\nDo you still want to apply these settings?";
- };
-};
- // App-spezifische Res
-String RID_SVXSTR_WRITER_PAGE
-{
- Text [ en-US ] = "Continuation page" ;
-};
- // Papierformate
-String RID_SVXSTR_PAPER_A0
-{
- Text = "A0" ;
-};
-String RID_SVXSTR_PAPER_A1
-{
- Text = "A1" ;
-};
-String RID_SVXSTR_PAPER_A2
-{
- Text = "A2" ;
-};
-String RID_SVXSTR_PAPER_A3
-{
- Text = "A3" ;
-};
-String RID_SVXSTR_PAPER_A4
-{
- Text = "A4" ;
-};
-String RID_SVXSTR_PAPER_A5
-{
- Text = "A5" ;
-};
-String RID_SVXSTR_PAPER_B4_ISO
-{
- Text = "B4 (ISO)" ;
-};
-String RID_SVXSTR_PAPER_B5_ISO
-{
- Text = "B5 (ISO)" ;
-};
-String RID_SVXSTR_PAPER_LETTER
-{
- Text = "Letter" ;
-};
-String RID_SVXSTR_PAPER_LEGAL
-{
- Text = "Legal" ;
-};
-String RID_SVXSTR_PAPER_TABLOID
-{
- Text = "Tabloid" ;
-};
-String RID_SVXSTR_PAPER_USER
-{
- Text [ en-US ] = "User Defined" ;
-};
-String RID_SVXSTR_PAPER_B6_ISO
-{
- Text = "B6 (ISO)" ;
-};
-String RID_SVXSTR_PAPER_C4
-{
- Text = "C4 Envelope" ;
-};
-String RID_SVXSTR_PAPER_C5
-{
- Text = "C5 Envelope" ;
-};
-String RID_SVXSTR_PAPER_C6
-{
- Text = "C6 Envelope" ;
-};
-String RID_SVXSTR_PAPER_C65
-{
- Text = "C6/5 Envelope" ;
-};
-String RID_SVXSTR_PAPER_DL
-{
- Text = "DL Envelope" ;
-};
-String RID_SVXSTR_PAPER_DIA
-{
- Text = "Dia Slide" ;
-};
-String RID_SVXSTR_PAPER_SCREEN
-{
- Text [ en-US ] = "Screen" ;
-};
-String RID_SVXSTR_PAPER_C
-{
- Text = "C" ;
-};
-String RID_SVXSTR_PAPER_D
-{
- Text = "D" ;
-};
-String RID_SVXSTR_PAPER_E
-{
- Text = "E" ;
-};
-String RID_SVXSTR_PAPER_EXECUTIVE
-{
- Text = "Executive" ;
-};
-String RID_SVXSTR_PAPER_LEGAL2
-{
- Text = "Long Bond" ;
-};
-String RID_SVXSTR_PAPER_MONARCH
-{
- Text = "#8 (Monarch) Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM675
-{
- Text = "#6 3/4 (Personal) Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM9
-{
- Text = "#9 Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM10
-{
- Text = "#10 Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM11
-{
- Text = "#11 Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM12
-{
- Text = "#12 Envelope" ;
-};
-String RID_SVXSTR_PAPER_KAI16
-{
- Text = "16 Kai" ;
-};
-String RID_SVXSTR_PAPER_KAI32
-{
- Text = "32 Kai" ;
-};
-String RID_SVXSTR_PAPER_KAI32BIG
-{
- Text = "Big 32 Kai" ;
-};
-String RID_SVXSTR_PAPER_B4_JIS
-{
- Text = "B4 (JIS)" ;
-};
-String RID_SVXSTR_PAPER_B5_JIS
-{
- Text = "B5 (JIS)" ;
-};
-String RID_SVXSTR_PAPER_B6_JIS
-{
- Text = "B6 (JIS)" ;
-};
-StringArray RID_SVXSTRARY_PAPERSIZE_STD
-{
- ItemList [ en-US ] =
- {
- < "A5" ; PAPERSIZE_A5 ; > ;
- < "A4" ; PAPERSIZE_A4 ; > ;
- < "A3" ; PAPERSIZE_A3 ; > ;
- < "B6 (ISO)" ; PAPERSIZE_B6_ISO ; > ;
- < "B5 (ISO)" ; PAPERSIZE_B5_ISO ; > ;
- < "B4 (ISO)" ; PAPERSIZE_B4_ISO ; > ;
- < "Letter" ; PAPERSIZE_LETTER ; > ;
- < "Legal" ; PAPERSIZE_LEGAL ; > ;
- < "Long Bond" ; PAPERSIZE_LEGAL2 ; > ;
- < "Tabloid" ; PAPERSIZE_TABLOID ; > ;
- < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ;
- < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ;
- < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ;
- < "16 Kai" ; PAPERSIZE_KAI16; > ;
- < "32 Kai" ; PAPERSIZE_KAI32; > ;
- < "Big 32 Kai" ; PAPERSIZE_KAI32BIG; > ;
- < "User" ; PAPERSIZE_USER ; > ;
- < "DL Envelope" ; PAPERSIZE_DL ; > ;
- < "C6 Envelope" ; PAPERSIZE_C6 ; > ;
- < "C6/5 Envelope" ; PAPERSIZE_C65 ; > ;
- < "C5 Envelope" ; PAPERSIZE_C5 ; > ;
- < "C4 Envelope" ; PAPERSIZE_C4 ; > ;
- < "#6 3/4 (Personal) Envelope" ; PAPERSIZE_COM675; > ;
- < "#8 (Monarch) Envelope" ; PAPERSIZE_MONARCH; > ;
- < "#9 Envelope" ; PAPERSIZE_COM9; > ;
- < "#10 Envelope" ; PAPERSIZE_COM10; > ;
- < "#11 Envelope" ; PAPERSIZE_COM11; > ;
- < "#12 Envelope" ; PAPERSIZE_COM12; > ;
- };
-};
-StringArray RID_SVXSTRARY_PAPERSIZE_DRAW
-{
- ItemList [ en-US ] =
- {
- < "A5" ; PAPERSIZE_A5 ; > ;
- < "A4" ; PAPERSIZE_A4 ; > ;
- < "A3" ; PAPERSIZE_A3 ; > ;
- < "A2" ; PAPERSIZE_A2 ; > ;
- < "A1" ; PAPERSIZE_A1 ; > ;
- < "A0" ; PAPERSIZE_A0 ; > ;
- < "B6 (ISO)" ; PAPERSIZE_B6_ISO ; > ;
- < "B5 (ISO)" ; PAPERSIZE_B5_ISO ; > ;
- < "B4 (ISO)" ; PAPERSIZE_B4_ISO ; > ;
- < "Letter" ; PAPERSIZE_LETTER ; > ;
- < "Legal" ; PAPERSIZE_LEGAL ; > ;
- < "Long Bond" ; PAPERSIZE_LEGAL2 ; > ;
- < "Tabloid" ; PAPERSIZE_TABLOID ; > ;
- < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ;
- < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ;
- < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ;
- < "16 Kai" ; PAPERSIZE_KAI16; > ;
- < "32 Kai" ; PAPERSIZE_KAI32; > ;
- < "Big 32 Kai" ; PAPERSIZE_KAI32BIG; > ;
- < "User" ; PAPERSIZE_USER ; > ;
- < "DL Envelope" ; PAPERSIZE_DL ; > ;
- < "C6 Envelope" ; PAPERSIZE_C6 ; > ;
- < "C6/5 Envelope" ; PAPERSIZE_C65 ; > ;
- < "C5 Envelope" ; PAPERSIZE_C5 ; > ;
- < "C4 Envelope" ; PAPERSIZE_C4 ; > ;
- < "Dia Slide" ; PAPERSIZE_DIA ; > ;
- < "Screen" ; PAPERSIZE_SCREEN ; > ;
- };
-};
-String RID_SVXSTR_PAPERBIN
-{
- Text [ en-US ] = "Paper tray" ;
-};
-String RID_SVXSTR_PAPERBIN_SETTINGS
-{
- Text [ en-US ] = "[From printer settings]" ;
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/paragrph.cxx b/svx/source/cui/paragrph.cxx
deleted file mode 100644
index 2275e0d8fe..0000000000
--- a/svx/source/cui/paragrph.cxx
+++ /dev/null
@@ -1,2394 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: paragrph.cxx,v $
- * $Revision: 1.54 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <svtools/style.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/module.hxx>
-#include <vcl/mnemonic.hxx>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#define _SVX_PARAGRPH_CXX 0
-
-
-
-
-#include <svtools/languageoptions.hxx>
-#include <pgrditem.hxx>
-#include <svx/dialogs.hrc>
-#include "paragrph.hrc"
-#include "paragrph.hxx"
-#include <svx/frmdiritem.hxx>
-
-#include <svx/lspcitem.hxx>
-#include <svx/adjitem.hxx>
-#include <svx/orphitem.hxx>
-#include <svx/widwitem.hxx>
-#include <svx/tstpitem.hxx>
-#include <svx/pmdlitem.hxx>
-#include <svx/spltitem.hxx>
-#include <svx/hyznitem.hxx>
-#include <svx/ulspitem.hxx>
-#include <svx/lrspitem.hxx>
-#include <svx/brkitem.hxx>
-#include <svx/keepitem.hxx>
-#include "dlgutil.hxx"
-#include <svx/dialmgr.hxx>
-#include "htmlmode.hxx"
-#include <svx/paravertalignitem.hxx>
-#include <svtools/eitem.hxx> //add CHINA001
-#include <sfx2/request.hxx> //add CHINA001
-#include <svtools/intitem.hxx> //add CHINA001
-
-// static ----------------------------------------------------------------
-
-static USHORT pStdRanges[] =
-{
- SID_ATTR_PARA_LINESPACE, // 10033
- SID_ATTR_PARA_LINESPACE,
- SID_ATTR_LRSPACE, // 10048 -
- SID_ATTR_ULSPACE, // 10049
- SID_ATTR_PARA_REGISTER, // 10413
- SID_ATTR_PARA_REGISTER,
- 0
-};
-
-static USHORT pAlignRanges[] =
-{
- SID_ATTR_PARA_ADJUST, // 10027
- SID_ATTR_PARA_ADJUST,
- 0
-};
-
-static USHORT pExtRanges[] =
-{
- SID_ATTR_PARA_PAGEBREAK, // 10037 -
- SID_ATTR_PARA_WIDOWS, // 10041
- SID_ATTR_PARA_MODEL, // 10065 -
- SID_ATTR_PARA_KEEP, // 10066
- 0
-};
-
-// define ----------------------------------------------------------------
-
-#define MAX_DURCH 5670 // 10 cm ist sinnvoll als maximaler Durchschuss
- // laut BP
-#define FIX_DIST_DEF 283 // Standard-Fix-Abstand 0,5cm
-
-// enum ------------------------------------------------------------------
-
-enum LineSpaceList
-{
- LLINESPACE_1 = 0,
- LLINESPACE_15 = 1,
- LLINESPACE_2 = 2,
- LLINESPACE_PROP = 3,
- LLINESPACE_MIN = 4,
- LLINESPACE_DURCH= 5,
- LLINESPACE_FIX = 6,
- LLINESPACE_END
-};
-
-// C-Funktion ------------------------------------------------------------
-
-void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 );
-
-void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace,
- int eSpace, long lValue )
-{
- switch ( eSpace )
- {
- case LLINESPACE_1:
- rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
- break;
-
- case LLINESPACE_15:
- rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- rLineSpace.SetPropLineSpace( 150 );
- break;
-
- case LLINESPACE_2:
- rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- rLineSpace.SetPropLineSpace( 200 );
- break;
-
- case LLINESPACE_PROP:
- rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- rLineSpace.SetPropLineSpace( (BYTE)lValue );
- break;
-
- case LLINESPACE_MIN:
- rLineSpace.SetLineHeight( (USHORT)lValue );
- rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
- break;
-
- case LLINESPACE_DURCH:
- rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- rLineSpace.SetInterLineSpace( (USHORT)lValue );
- break;
-
- case LLINESPACE_FIX:
- rLineSpace.SetLineHeight((USHORT)lValue);
- rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_FIX;
- rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
- break;
- }
-}
-
-
-USHORT GetHtmlMode_Impl(const SfxItemSet& rSet)
-{
- USHORT nHtmlMode = 0;
- const SfxPoolItem* pItem = 0;
- SfxObjectShell* pShell;
- if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, FALSE, &pItem) ||
- ( 0 != (pShell = SfxObjectShell::Current()) &&
- 0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
- {
- nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
- }
- return nHtmlMode;
-
-}
-
-// class SvxStdParagraphTabPage ------------------------------------------
-
-IMPL_LINK( SvxStdParagraphTabPage, ELRLoseFocusHdl, Edit *, EMPTYARG )
-{
-//! if ( aLeftIndent.IsRelativeMode() )
-//! return 0; //!!!
-
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit =
- MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) );
-
- sal_Int64 nL = aLeftIndent.Denormalize( aLeftIndent.GetValue( eUnit ) );
- sal_Int64 nR = aRightIndent.Denormalize( aRightIndent.GetValue( eUnit ) );
- String aTmp = aFLineIndent.GetText();
-
- // Erstzeilen Einzug
- if( aLeftIndent.GetMin() < 0 )
- aFLineIndent.SetMin( -99999, FUNIT_MM );
- else
- aFLineIndent.SetMin( aFLineIndent.Normalize( -nL ), eUnit );
-
- // Check nur fuer konkrete Breite (Shell)
- sal_Int64 nTmp = nWidth - nL - nR - MM50;
- aFLineIndent.SetMax( aFLineIndent.Normalize( nTmp ), eUnit );
-
- if ( !aTmp.Len() )
- aFLineIndent.SetEmptyFieldValue();
- // Maximum Links Rechts
- aTmp = aLeftIndent.GetText();
- nTmp = nWidth - nR - MM50;
- aLeftIndent.SetMax( aLeftIndent.Normalize( nTmp ), eUnit );
-
- if ( !aTmp.Len() )
- aLeftIndent.SetEmptyFieldValue();
- aTmp = aRightIndent.GetText();
- nTmp = nWidth - nL - MM50;
- aRightIndent.SetMax( aRightIndent.Normalize( nTmp ), eUnit );
-
- if ( !aTmp.Len() )
- aRightIndent.SetEmptyFieldValue();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxStdParagraphTabPage::Create( Window* pParent,
- const SfxItemSet& rSet)
-{
- return new SvxStdParagraphTabPage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
-{
- SfxItemState eState = SFX_ITEM_UNKNOWN;
- const SfxPoolItem* pOld = 0;
- SfxItemPool* pPool = rOutSet.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
-
- BOOL bModified = FALSE;
- USHORT nWhich;
- USHORT nPos = aLineDist.GetSelectEntryPos();
-
- if ( LISTBOX_ENTRY_NOTFOUND != nPos &&
- ( nPos != aLineDist.GetSavedValue() ||
- aLineDistAtPercentBox.IsValueModified() ||
- aLineDistAtMetricBox.IsValueModified() ) )
- {
- nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
- SvxLineSpacingItem aSpacing(
- (const SvxLineSpacingItem&)GetItemSet().Get( nWhich ) );
-
- switch ( nPos )
- {
- case LLINESPACE_1:
- case LLINESPACE_15:
- case LLINESPACE_2:
- SetLineSpace_Impl( aSpacing, nPos );
- break;
-
- case LLINESPACE_PROP:
- SetLineSpace_Impl( aSpacing, nPos,
- static_cast<long>(aLineDistAtPercentBox.Denormalize(
- aLineDistAtPercentBox.GetValue() )) );
- break;
-
- case LLINESPACE_MIN:
- case LLINESPACE_DURCH:
- case LLINESPACE_FIX:
- SetLineSpace_Impl( aSpacing, nPos,
- GetCoreValue( aLineDistAtMetricBox, eUnit ) );
- break;
-
- default:
- DBG_ERROR( "unbekannter Type fuer Zeilenabstand." );
- break;
- }
- eState = GetItemSet().GetItemState( nWhich );
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_LINESPACE );
-
- if ( !pOld || !( *(const SvxLineSpacingItem*)pOld == aSpacing ) ||
- SFX_ITEM_DONTCARE == eState )
- {
- rOutSet.Put( aSpacing );
- bModified |= TRUE;
- }
- }
-
- if ( aTopDist.IsValueModified() || aBottomDist.IsValueModified() )
- {
- nWhich = GetWhich( SID_ATTR_ULSPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
- pOld = GetOldItem( rOutSet, SID_ATTR_ULSPACE );
- SvxULSpaceItem aMargin( nWhich );
-
- if ( bRelativeMode )
- {
- DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
-
- const SvxULSpaceItem& rOldItem =
- (const SvxULSpaceItem&)GetItemSet().GetParent()->Get( nWhich );
-
- if ( aTopDist.IsRelative() )
- aMargin.SetUpper( rOldItem.GetUpper(),
- (USHORT)aTopDist.GetValue() );
- else
- aMargin.SetUpper( (USHORT)GetCoreValue( aTopDist, eUnit ) );
-
- if ( aBottomDist.IsRelative() )
- aMargin.SetLower( rOldItem.GetLower(),
- (USHORT)aBottomDist.GetValue() );
- else
- aMargin.SetLower( (USHORT)GetCoreValue( aBottomDist, eUnit ) );
-
- }
- else
- {
- aMargin.SetUpper( (USHORT)GetCoreValue( aTopDist, eUnit ) );
- aMargin.SetLower( (USHORT)GetCoreValue( aBottomDist, eUnit ) );
- }
- eState = GetItemSet().GetItemState( nWhich );
-
- if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aMargin ) ||
- SFX_ITEM_DONTCARE == eState )
- {
- rOutSet.Put( aMargin );
- bModified |= TRUE;
- }
- }
- FASTBOOL bNullTab = FALSE;
-
- if ( aLeftIndent.IsValueModified() ||
- aFLineIndent.IsValueModified() ||
- aRightIndent.IsValueModified()
- || aAutoCB.GetSavedValue() != aAutoCB.IsChecked() )
- {
- nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
- SvxLRSpaceItem aMargin( nWhich );
- pOld = GetOldItem( rOutSet, SID_ATTR_LRSPACE );
-
- if ( bRelativeMode )
- {
- DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
-
- const SvxLRSpaceItem& rOldItem =
- (const SvxLRSpaceItem&)GetItemSet().GetParent()->Get( nWhich );
-
- if ( aLeftIndent.IsRelative() )
- aMargin.SetTxtLeft( rOldItem.GetTxtLeft(),
- (USHORT)aLeftIndent.GetValue() );
- else
- aMargin.SetTxtLeft( GetCoreValue( aLeftIndent, eUnit ) );
-
- if ( aRightIndent.IsRelative() )
- aMargin.SetRight( rOldItem.GetRight(),
- (USHORT)aRightIndent.GetValue() );
- else
- aMargin.SetRight( GetCoreValue( aRightIndent, eUnit ) );
-
- if ( aFLineIndent.IsRelative() )
- aMargin.SetTxtFirstLineOfst( rOldItem.GetTxtFirstLineOfst(),
- (USHORT)aFLineIndent.GetValue() );
- else
- aMargin.SetTxtFirstLineOfst(
- (USHORT)GetCoreValue( aFLineIndent, eUnit ) );
- }
- else
- {
- aMargin.SetTxtLeft( GetCoreValue( aLeftIndent, eUnit ) );
- aMargin.SetRight( GetCoreValue( aRightIndent, eUnit ) );
- aMargin.SetTxtFirstLineOfst(
- (USHORT)GetCoreValue( aFLineIndent, eUnit ) );
- }
- aMargin.SetAutoFirst(aAutoCB.IsChecked());
- if ( aMargin.GetTxtFirstLineOfst() < 0 )
- bNullTab = TRUE;
- eState = GetItemSet().GetItemState( nWhich );
-
- if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) ||
- SFX_ITEM_DONTCARE == eState )
- {
- rOutSet.Put( aMargin );
- bModified |= TRUE;
- }
- }
-
- if ( bNullTab )
- {
- MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
- if ( MAP_100TH_MM != eUnit )
- {
-
- // negativer Erstzeileneinzug -> ggf. Null Default-Tabstop setzen
- USHORT _nWhich = GetWhich( SID_ATTR_TABSTOP );
- const SfxItemSet& rInSet = GetItemSet();
-
- if ( rInSet.GetItemState( _nWhich ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxTabStopItem& rTabItem =
- (const SvxTabStopItem&)rInSet.Get( _nWhich );
- SvxTabStopItem aNullTab( rTabItem );
- SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT );
- aNullTab.Insert( aNull );
- rOutSet.Put( aNullTab );
- }
- }
- }
- if( aRegisterCB.IsVisible())
- {
- const SfxBoolItem* pBoolItem = (SfxBoolItem*)GetOldItem(
- rOutSet, SID_ATTR_PARA_REGISTER);
- SfxBoolItem* pRegItem = (SfxBoolItem*)pBoolItem->Clone();
- USHORT _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
- BOOL bSet = pRegItem->GetValue();
-
- if(aRegisterCB.IsChecked() != bSet )
- {
- pRegItem->SetValue(!bSet);
- rOutSet.Put(*pRegItem);
- bModified |= TRUE;
- }
- else if ( SFX_ITEM_DEFAULT == GetItemSet().GetItemState( _nWhich, FALSE ) )
- rOutSet.ClearItem(_nWhich);
- delete pRegItem;
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
-{
- SfxItemPool* pPool = rSet.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool?" );
- String aEmpty;
-
- // Metrik einstellen
- FieldUnit eFUnit = GetModuleFieldUnit( &rSet );
- SetFieldUnit( aLeftIndent, eFUnit );
- SetFieldUnit( aRightIndent, eFUnit );
- SetFieldUnit( aFLineIndent, eFUnit );
- SetFieldUnit( aTopDist, eFUnit );
- SetFieldUnit( aBottomDist, eFUnit );
- SetFieldUnit( aLineDistAtMetricBox, eFUnit );
-
- USHORT _nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxItemState eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
-
- if ( bRelativeMode )
- {
- const SvxLRSpaceItem& rOldItem =
- (const SvxLRSpaceItem&)rSet.Get( _nWhich );
-
- if ( rOldItem.GetPropLeft() != 100 )
- {
- aLeftIndent.SetRelative( TRUE );
- aLeftIndent.SetValue( rOldItem.GetPropLeft() );
- }
- else
- {
- aLeftIndent.SetRelative();
- SetFieldUnit( aLeftIndent, eFUnit );
- SetMetricValue( aLeftIndent, rOldItem.GetTxtLeft(), eUnit );
- }
-
- if ( rOldItem.GetPropRight() != 100 )
- {
- aRightIndent.SetRelative( TRUE );
- aRightIndent.SetValue( rOldItem.GetPropRight() );
- }
- else
- {
- aRightIndent.SetRelative();
- SetFieldUnit( aRightIndent, eFUnit );
- SetMetricValue( aRightIndent, rOldItem.GetRight(), eUnit );
- }
-
- if ( rOldItem.GetPropTxtFirstLineOfst() != 100 )
- {
- aFLineIndent.SetRelative( TRUE );
- aFLineIndent.SetValue( rOldItem.GetPropTxtFirstLineOfst() );
- }
- else
- {
- aFLineIndent.SetRelative();
- aFLineIndent.SetMin(-9999);
- SetFieldUnit( aFLineIndent, eFUnit );
- SetMetricValue( aFLineIndent, rOldItem.GetTxtFirstLineOfst(),
- eUnit );
- }
- aAutoCB.Check(rOldItem.IsAutoFirst());
- }
- else
- {
- const SvxLRSpaceItem& rSpace =
- (const SvxLRSpaceItem&)rSet.Get( _nWhich );
-
- SetMetricValue( aLeftIndent, rSpace.GetTxtLeft(), eUnit );
- SetMetricValue( aRightIndent, rSpace.GetRight(), eUnit );
- SetMetricValue( aFLineIndent, rSpace.GetTxtFirstLineOfst(), eUnit );
- aAutoCB.Check(rSpace.IsAutoFirst());
- }
- AutoHdl_Impl(&aAutoCB);
- }
- else
- {
- aLeftIndent.SetEmptyFieldValue();
- aRightIndent.SetEmptyFieldValue();
- aFLineIndent.SetEmptyFieldValue();
- }
-
- _nWhich = GetWhich( SID_ATTR_ULSPACE );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
-
- if ( bRelativeMode )
- {
- const SvxULSpaceItem& rOldItem =
- (const SvxULSpaceItem&)rSet.Get( _nWhich );
-
- if ( rOldItem.GetPropUpper() != 100 )
- {
- aTopDist.SetRelative( TRUE );
- aTopDist.SetValue( rOldItem.GetPropUpper() );
- }
- else
- {
- aTopDist.SetRelative();
- SetFieldUnit( aTopDist, eFUnit );
- SetMetricValue( aTopDist, rOldItem.GetUpper(), eUnit );
- }
-
- if ( rOldItem.GetPropLower() != 100 )
- {
- aBottomDist.SetRelative( TRUE );
- aBottomDist.SetValue( rOldItem.GetPropLower() );
- }
- else
- {
- aBottomDist.SetRelative();
- SetFieldUnit( aBottomDist, eFUnit );
- SetMetricValue( aBottomDist, rOldItem.GetLower(), eUnit );
- }
- }
- else
- {
- const SvxULSpaceItem& rTopMargin =
- (const SvxULSpaceItem&)rSet.Get( _nWhich );
- SetMetricValue( aTopDist, rTopMargin.GetUpper(), eUnit );
- SetMetricValue( aBottomDist, rTopMargin.GetLower(), eUnit );
- }
- }
- else
- {
- aTopDist.SetEmptyFieldValue();
- aBottomDist.SetEmptyFieldValue();
- }
-
- _nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- SetLineSpacing_Impl( (const SvxLineSpacingItem &)rSet.Get( _nWhich ) );
- else
- aLineDist.SetNoSelection();
-
-
- _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- aRegisterCB.Check( ((const SfxBoolItem &)rSet.Get( _nWhich )).GetValue());
- aRegisterCB.SaveValue();
- USHORT nHtmlMode = GetHtmlMode_Impl(rSet);
- if(nHtmlMode & HTMLMODE_ON)
- {
- aRegisterCB.Hide();
- aRegisterFL.Hide();
- aAutoCB.Hide();
- if(!(nHtmlMode & HTMLMODE_SOME_STYLES)) // IE oder SW
- {
- aRightLabel.Disable();
- aRightIndent.Disable();
- aTopDist.Disable(); //HTML3.2 und NS 3.0
- aBottomDist.Disable();
- if(!(nHtmlMode & HTMLMODE_FIRSTLINE)) //NS 3.0
- {
- aFLineIndent.Disable();
- aFLineLabel.Disable();
- }
- }
- }
-
- ELRLoseFocusHdl( NULL );
- aAutoCB.SaveValue();
- aLineDist.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::EnableRelativeMode()
-{
- DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no parent-set!" );
-
- aLeftIndent.EnableRelativeMode( 0, 999 );
- aFLineIndent.EnableRelativeMode( 0, 999 );
- aRightIndent.EnableRelativeMode( 0, 999 );
- aTopDist.EnableRelativeMode( 0, 999 );
- aBottomDist.EnableRelativeMode( 0, 999 );
- bRelativeMode = TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-int SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- ELRLoseFocusHdl( NULL );
-
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,
- const SfxItemSet& rAttr ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_STD_PARAGRAPH ), rAttr ),
-
- aLeftLabel ( this, SVX_RES( FT_LEFTINDENT ) ),
- aLeftIndent ( this, SVX_RES( ED_LEFTINDENT ) ),
- aRightLabel ( this, SVX_RES( FT_RIGHTINDENT ) ),
- aRightIndent ( this, SVX_RES( ED_RIGHTINDENT ) ),
-
- aFLineLabel ( this, SVX_RES( FT_FLINEINDENT ) ),
- aFLineIndent ( this, SVX_RES( ED_FLINEINDENT ) ),
- aAutoCB ( this, SVX_RES( CB_AUTO ) ),
- aIndentFrm ( this, SVX_RES( FL_INDENT ) ),
- aTopLabel ( this, SVX_RES( FT_TOPDIST ) ),
- aTopDist ( this, SVX_RES( ED_TOPDIST ) ),
- aBottomLabel ( this, SVX_RES( FT_BOTTOMDIST ) ),
- aBottomDist ( this, SVX_RES( ED_BOTTOMDIST ) ),
- aDistFrm ( this, SVX_RES( FL_DIST ) ),
- aLineDist ( this, SVX_RES( LB_LINEDIST ) ),
- aLineDistAtLabel ( this, SVX_RES( FT_LINEDIST ) ),
- aLineDistAtPercentBox ( this, SVX_RES( ED_LINEDISTPERCENT ) ),
- aLineDistAtMetricBox ( this, SVX_RES( ED_LINEDISTMETRIC ) ),
- aLineDistFrm ( this, SVX_RES( FL_LINEDIST ) ),
- sAbsDist ( SVX_RES(ST_LINEDIST_ABS) ),
- aExampleWin ( this, SVX_RES( WN_EXAMPLE ) ),
- aRegisterCB ( this, SVX_RES( CB_REGISTER ) ),
- aRegisterFL ( this, SVX_RES( FL_REGISTER ) ),
- pActLineDistFld ( &aLineDistAtPercentBox ),
- nAbst ( MAX_DURCH ),
- nWidth ( 11905 /*567 * 50*/ ),
- nMinFixDist(0L),
-
- bRelativeMode ( FALSE ),
- bNegativeIndents(FALSE)
-
-{
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- aLineDistAtMetricBox.Hide();
- FreeResource();
- Init_Impl();
- aFLineIndent.SetMin(-9999); // wird default auf 0 gesetzt
-}
-
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::EnableNegativeMode()
-{
- aLeftIndent.SetMin(-9999);
- aRightIndent.SetMin(-9999);
- aRightIndent.EnableNegativeMode();
- aLeftIndent.EnableNegativeMode();
- bNegativeIndents = TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxStdParagraphTabPage::GetRanges()
-{
- return pStdRanges;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::SetLineSpacing_Impl
-(
- const SvxLineSpacingItem &rAttr
-)
-{
- SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( rAttr.Which() );
-
- switch( rAttr.GetLineSpaceRule() )
- {
- case SVX_LINE_SPACE_AUTO:
- {
- SvxInterLineSpace eInter = rAttr.GetInterLineSpaceRule();
-
- switch( eInter )
- {
- // Default einzeilig
- case SVX_INTER_LINE_SPACE_OFF:
- aLineDist.SelectEntryPos( LLINESPACE_1 );
- break;
-
- // Default einzeilig
- case SVX_INTER_LINE_SPACE_PROP:
- if ( 100 == rAttr.GetPropLineSpace() )
- {
- aLineDist.SelectEntryPos( LLINESPACE_1 );
- break;
- }
- // 1.5zeilig
- if ( 150 == rAttr.GetPropLineSpace() )
- {
- aLineDist.SelectEntryPos( LLINESPACE_15 );
- break;
- }
- // 2zeilig
- if ( 200 == rAttr.GetPropLineSpace() )
- {
- aLineDist.SelectEntryPos( LLINESPACE_2 );
- break;
- }
- // eingestellter Prozentwert
- aLineDistAtPercentBox.
- SetValue( aLineDistAtPercentBox.Normalize(
- rAttr.GetPropLineSpace() ) );
- aLineDist.SelectEntryPos( LLINESPACE_PROP );
- break;
-
- case SVX_INTER_LINE_SPACE_FIX:
- SetMetricValue( aLineDistAtMetricBox,
- rAttr.GetInterLineSpace(), eUnit );
- aLineDist.SelectEntryPos( LLINESPACE_DURCH );
- break;
- default: ;//prevent warning
- }
- }
- break;
- case SVX_LINE_SPACE_FIX:
- SetMetricValue(aLineDistAtMetricBox, rAttr.GetLineHeight(), eUnit);
- aLineDist.SelectEntryPos( LLINESPACE_FIX );
- break;
-
- case SVX_LINE_SPACE_MIN:
- SetMetricValue(aLineDistAtMetricBox, rAttr.GetLineHeight(), eUnit);
- aLineDist.SelectEntryPos( LLINESPACE_MIN );
- break;
- default: ;//prevent warning
- }
- LineDistHdl_Impl( &aLineDist );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox )
-{
- switch( pBox->GetSelectEntryPos() )
- {
- case LLINESPACE_1:
- case LLINESPACE_15:
- case LLINESPACE_2:
- aLineDistAtLabel.Enable(FALSE);
- pActLineDistFld->Enable(FALSE);
- pActLineDistFld->SetText( String() );
- break;
-
- case LLINESPACE_DURCH:
- // Setzen eines sinnvollen Defaults?
- // MS Begrenzen min(10, aPageSize)
- aLineDistAtPercentBox.Hide();
- pActLineDistFld = &aLineDistAtMetricBox;
- aLineDistAtMetricBox.SetMin(0);
-
-
- if ( !aLineDistAtMetricBox.GetText().Len() )
- aLineDistAtMetricBox.SetValue(
- aLineDistAtMetricBox.Normalize( 1 ) );
- aLineDistAtPercentBox.Hide();
- pActLineDistFld->Show();
- pActLineDistFld->Enable();
- aLineDistAtLabel.Enable();
- break;
-
- case LLINESPACE_MIN:
- aLineDistAtPercentBox.Hide();
- pActLineDistFld = &aLineDistAtMetricBox;
- aLineDistAtMetricBox.SetMin(0);
-
- if ( !aLineDistAtMetricBox.GetText().Len() )
- aLineDistAtMetricBox.SetValue(
- aLineDistAtMetricBox.Normalize( 10 ), FUNIT_TWIP );
- aLineDistAtPercentBox.Hide();
- pActLineDistFld->Show();
- pActLineDistFld->Enable();
- aLineDistAtLabel.Enable();
- break;
-
- case LLINESPACE_PROP:
- aLineDistAtMetricBox.Hide();
- pActLineDistFld = &aLineDistAtPercentBox;
-
- if ( !aLineDistAtPercentBox.GetText().Len() )
- aLineDistAtPercentBox.SetValue(
- aLineDistAtPercentBox.Normalize( 100 ), FUNIT_TWIP );
- aLineDistAtMetricBox.Hide();
- pActLineDistFld->Show();
- pActLineDistFld->Enable();
- aLineDistAtLabel.Enable();
- break;
- case LLINESPACE_FIX:
- {
- aLineDistAtPercentBox.Hide();
- pActLineDistFld = &aLineDistAtMetricBox;
- sal_Int64 nTemp = aLineDistAtMetricBox.GetValue();
- aLineDistAtMetricBox.SetMin(aLineDistAtMetricBox.Normalize(nMinFixDist), FUNIT_TWIP);
-
- // wurde der Wert beim SetMin veraendert, dann ist es Zeit
- // fuer den default
- if ( aLineDistAtMetricBox.GetValue() != nTemp )
- SetMetricValue( aLineDistAtMetricBox,
- FIX_DIST_DEF, SFX_MAPUNIT_TWIP ); // fix gibt's nur im Writer
- aLineDistAtPercentBox.Hide();
- pActLineDistFld->Show();
- pActLineDistFld->Enable();
- aLineDistAtLabel.Enable();
- }
- break;
- }
- UpdateExample_Impl( TRUE );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxStdParagraphTabPage, ModifyHdl_Impl, SvxRelativeField *, EMPTYARG )
-{
- UpdateExample_Impl();
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxStdParagraphTabPage, ModifyHdl_Impl, SvxRelativeField *, EMPTYARG )
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::Init_Impl()
-{
- aLineDist.SetSelectHdl(
- LINK( this, SvxStdParagraphTabPage, LineDistHdl_Impl ) );
-
- Link aLink = LINK( this, SvxStdParagraphTabPage, ELRLoseFocusHdl );
- aFLineIndent.SetLoseFocusHdl( aLink );
- aLeftIndent.SetLoseFocusHdl( aLink );
- aRightIndent.SetLoseFocusHdl( aLink );
-
- aLink = LINK( this, SvxStdParagraphTabPage, ModifyHdl_Impl );
- aFLineIndent.SetModifyHdl( aLink );
- aLeftIndent.SetModifyHdl( aLink );
- aRightIndent.SetModifyHdl( aLink );
- aTopDist.SetModifyHdl( aLink );
- aBottomDist.SetModifyHdl( aLink );
-
- aAutoCB.SetClickHdl( LINK( this, SvxStdParagraphTabPage, AutoHdl_Impl ));
- SfxItemPool* pPool = GetItemSet().GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- FieldUnit eUnit =
- MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) );
-
- aTopDist.SetMax( aTopDist.Normalize( nAbst ), eUnit );
- aBottomDist.SetMax( aBottomDist.Normalize( nAbst ), eUnit );
- aLineDistAtMetricBox.SetMax(
- aLineDistAtMetricBox.Normalize( nAbst ), eUnit );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::UpdateExample_Impl( BOOL bAll )
-{
- aExampleWin.SetFirstLineOfst(
- (short)aFLineIndent.Denormalize( aFLineIndent.GetValue( FUNIT_TWIP ) ) );
- aExampleWin.SetLeftMargin(
- static_cast<long>(aLeftIndent.Denormalize( aLeftIndent.GetValue( FUNIT_TWIP ) ) ) );
- aExampleWin.SetRightMargin(
- static_cast<long>(aRightIndent.Denormalize( aRightIndent.GetValue( FUNIT_TWIP ) ) ) );
- aExampleWin.SetUpper(
- (USHORT)aTopDist.Denormalize( aTopDist.GetValue( FUNIT_TWIP ) ) );
- aExampleWin.SetLower(
- (USHORT)aBottomDist.Denormalize( aBottomDist.GetValue( FUNIT_TWIP ) ) );
-
-
-
- USHORT nPos = aLineDist.GetSelectEntryPos();
-
- switch ( nPos )
- {
- case LLINESPACE_1:
- case LLINESPACE_15:
- case LLINESPACE_2:
- aExampleWin.SetLineSpace( (SvxPrevLineSpace)nPos );
- break;
-
- case LLINESPACE_PROP:
- aExampleWin.SetLineSpace( (SvxPrevLineSpace)nPos,
- (USHORT)aLineDistAtPercentBox.Denormalize(
- aLineDistAtPercentBox.GetValue() ) );
- break;
-
- case LLINESPACE_MIN:
- case LLINESPACE_DURCH:
- case LLINESPACE_FIX:
- aExampleWin.SetLineSpace( (SvxPrevLineSpace)nPos,
- (USHORT)GetCoreValue( aLineDistAtMetricBox, SFX_MAPUNIT_TWIP ) );
- break;
- }
- aExampleWin.Draw( bAll );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxStdParagraphTabPage::EnableRegisterMode()
-{
- aRegisterCB.Show();
- aRegisterFL.Show();
-}
-
-/*-----------------16.01.97 19.54-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxStdParagraphTabPage, AutoHdl_Impl, CheckBox*, pBox )
-{
- BOOL bEnable = !pBox->IsChecked();
- aFLineLabel .Enable(bEnable);
- aFLineIndent.Enable(bEnable);
- return 0;
-}
-
-/*-----------------16.01.97 18.00-------------------
-
---------------------------------------------------*/
-void SvxStdParagraphTabPage::SetPageWidth( USHORT nPageWidth )
-{
- nWidth = nPageWidth;
-}
-/*-----------------16.01.97 18.01-------------------
-
---------------------------------------------------*/
-void SvxStdParagraphTabPage::SetMaxDistance( USHORT nMaxDist )
-{
- nAbst = nMaxDist;
-}
-
-/*-----------------17.01.97 08.11-------------------
-
---------------------------------------------------*/
-void SvxStdParagraphTabPage::EnableAutoFirstLine()
-{
- aAutoCB.Show();
-}
-
-/*-----------------11.06.97 11.48-------------------
- absoluter Zeilenabstand
---------------------------------------------------*/
-void SvxStdParagraphTabPage::EnableAbsLineDist(long nMinTwip)
-{
- aLineDist.InsertEntry(sAbsDist);
- nMinFixDist = nMinTwip;
-}
-
-//addd CHINA001 begin
-void SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet)
-{
-
-/* CHINA001 different bit represent call to different method of SvxStdParagraphTabPage
- 0x0001 --->EnableRelativeMode()
- 0x0002 --->EnableRegisterMode()
- 0x0004 --->EnableAutoFirstLine()
- 0x0008 --->EnableNegativeMode()
-
-
- */
- SFX_ITEMSET_ARG (&aSet,pPageWidthItem,SfxUInt16Item,SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagSetItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,sal_False);
- SFX_ITEMSET_ARG (&aSet,pLineDistItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,sal_False);
-
- if (pPageWidthItem)
- SetPageWidth(pPageWidthItem->GetValue());
-
- if (pFlagSetItem )
- if (( 0x0001 & pFlagSetItem->GetValue())== 0x0001 )
- EnableRelativeMode();
-
- if (pFlagSetItem)
- if (( 0x0002 & pFlagSetItem->GetValue())== 0x0002 )
- EnableRegisterMode();
-
- if (pFlagSetItem)
- if ( ( 0x0004 & pFlagSetItem->GetValue())== 0x0004 )
- EnableAutoFirstLine();
-
- if(pLineDistItem)
- EnableAbsLineDist(pLineDistItem->GetValue());
-
- if (pFlagSetItem)
- if (( 0x0008 & pFlagSetItem->GetValue()) == 0x0008 )
- EnableNegativeMode();
-
-}
-//end of CHINA001
-
-#define LASTLINEPOS_DEFAULT 0
-#define LASTLINEPOS_LEFT 1
-
-#define LASTLINECOUNT_OLD 3
-#define LASTLINECOUNT_NEW 4
-
-// class SvxParaAlignTabPage ------------------------------------------------
-
-/*-----------------16.01.97 19.34-------------------
-
---------------------------------------------------*/
-SvxParaAlignTabPage::SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet )
- : SfxTabPage(pParent, SVX_RES( RID_SVXPAGE_ALIGN_PARAGRAPH ),rSet),
- aAlignFrm ( this, SVX_RES( FL_ALIGN ) ),
- aLeft ( this, SVX_RES( BTN_LEFTALIGN ) ),
- aRight ( this, SVX_RES( BTN_RIGHTALIGN ) ),
- aCenter ( this, SVX_RES( BTN_CENTERALIGN ) ),
- aJustify ( this, SVX_RES( BTN_JUSTIFYALIGN ) ),
- aLastLineFT ( this, SVX_RES( FT_LASTLINE ) ),
- aLastLineLB ( this, SVX_RES( LB_LASTLINE ) ),
- aExpandCB ( this, SVX_RES( CB_EXPAND ) ),
- aSnapToGridCB ( this, SVX_RES( CB_SNAP ) ),
- aExampleWin ( this, SVX_RES( WN_EXAMPLE ) ),
-
- aVertAlignFL ( this, SVX_RES( FL_VERTALIGN ) ),
- aVertAlignFT ( this, SVX_RES( FT_VERTALIGN ) ),
- aVertAlignLB ( this, SVX_RES( LB_VERTALIGN ) ),
-
- aPropertiesFL ( this, SVX_RES( FL_PROPERTIES )),
- aTextDirectionFT ( this, SVX_RES( FT_TEXTDIRECTION )),
- aTextDirectionLB ( this, SVX_RES( LB_TEXTDIRECTION ))
-{
- SvtLanguageOptions aLangOptions;
- USHORT nLastLinePos = LASTLINEPOS_DEFAULT;
-
- if ( aLangOptions.IsAsianTypographyEnabled() )
- {
- String sLeft(SVX_RES(ST_LEFTALIGN_ASIAN));
- aLeft.SetText(sLeft);
- aRight.SetText(String(SVX_RES(ST_RIGHTALIGN_ASIAN)));
- sLeft = MnemonicGenerator::EraseAllMnemonicChars( sLeft );
-
- if ( aLastLineLB.GetEntryCount() == LASTLINECOUNT_OLD )
- {
- aLastLineLB.RemoveEntry( 0 );
- aLastLineLB.InsertEntry( sLeft, 0 );
- }
- else
- nLastLinePos = LASTLINEPOS_LEFT;
- }
- // remove "Default" or "Left" entry, depends on CJKOptions
- if ( aLastLineLB.GetEntryCount() == LASTLINECOUNT_NEW )
- aLastLineLB.RemoveEntry( nLastLinePos );
-
- FreeResource();
- Link aLink = LINK( this, SvxParaAlignTabPage, AlignHdl_Impl );
- aLeft.SetClickHdl( aLink );
- aRight.SetClickHdl( aLink );
- aCenter.SetClickHdl( aLink );
- aJustify.SetClickHdl( aLink );
- aLastLineLB.SetSelectHdl( LINK( this, SvxParaAlignTabPage, LastLineHdl_Impl ) );
- aTextDirectionLB.SetSelectHdl( LINK( this, SvxParaAlignTabPage, TextDirectionHdl_Impl ) );
-
- USHORT nHtmlMode = GetHtmlMode_Impl(rSet);
- if(!(nHtmlMode & HTMLMODE_ON) || (0 != (nHtmlMode & HTMLMODE_SOME_STYLES)) )
- {
- if( aLangOptions.IsCTLFontEnabled() )
- {
- aTextDirectionLB.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP );
- aTextDirectionLB.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP );
- aTextDirectionLB.InsertEntryValue( SVX_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT );
-
- aPropertiesFL.Show();
- aTextDirectionFT.Show();
- aTextDirectionLB.Show();
- }
- }
-}
-
-/*-----------------16.01.97 19.33-------------------
-
---------------------------------------------------*/
-SvxParaAlignTabPage::~SvxParaAlignTabPage()
-{
-}
-
-/*-----------------16.01.97 19.33-------------------
-
---------------------------------------------------*/
-int SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-/*-----------------16.01.97 19.33-------------------
-
---------------------------------------------------*/
-SfxTabPage* SvxParaAlignTabPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxParaAlignTabPage(pParent, rSet);
-}
-
-/*-----------------16.01.97 19.33-------------------
-
---------------------------------------------------*/
-USHORT* SvxParaAlignTabPage::GetRanges()
-{
- return pAlignRanges;
-
-}
-
-/*-----------------16.01.97 19.33-------------------
-
---------------------------------------------------*/
-BOOL SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet )
-{
- BOOL bModified = FALSE;
-
- FASTBOOL bAdj = FALSE, bChecked = FALSE;
- SvxAdjust eAdjust = SVX_ADJUST_LEFT;
-
- if ( aLeft.IsChecked() )
- {
- eAdjust = SVX_ADJUST_LEFT;
- bAdj = !aLeft.GetSavedValue();
- bChecked = TRUE;
- }
- else if ( aRight.IsChecked() )
- {
- eAdjust = SVX_ADJUST_RIGHT;
- bAdj = !aRight.GetSavedValue();
- bChecked = TRUE;
- }
- else if ( aCenter.IsChecked() )
- {
- eAdjust = SVX_ADJUST_CENTER;
- bAdj = !aCenter.GetSavedValue();
- bChecked = TRUE;
- }
- else if ( aJustify.IsChecked() )
- {
- eAdjust = SVX_ADJUST_BLOCK;
- bAdj = !aJustify.GetSavedValue() ||
- aExpandCB.IsChecked() != aExpandCB.GetSavedValue() ||
- aLastLineLB.GetSelectEntryPos() != aLastLineLB.GetSavedValue();
- bChecked = TRUE;
- }
- USHORT _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
-
- if ( bAdj )
- {
- const SvxAdjustItem* pOld =
- (const SvxAdjustItem*)GetOldItem( rOutSet, SID_ATTR_PARA_ADJUST );
- SvxAdjust eOneWord = aExpandCB.IsChecked() ? SVX_ADJUST_BLOCK
- : SVX_ADJUST_LEFT;
- USHORT nLBPos = aLastLineLB.GetSelectEntryPos();
- SvxAdjust eLastBlock = SVX_ADJUST_LEFT;
-
- if ( 1 == nLBPos )
- eLastBlock = SVX_ADJUST_CENTER;
- else if ( 2 == nLBPos )
- eLastBlock = SVX_ADJUST_BLOCK;
-
- FASTBOOL bNothingWasChecked =
- !aLeft.GetSavedValue() && !aRight.GetSavedValue() &&
- !aCenter.GetSavedValue() && !aJustify.GetSavedValue();
-
- if ( !pOld || pOld->GetAdjust() != eAdjust ||
- pOld->GetOneWord() != eOneWord ||
- pOld->GetLastBlock() != eLastBlock ||
- ( bChecked && bNothingWasChecked ) )
- {
- bModified |= TRUE;
- SvxAdjustItem aAdj(
- (const SvxAdjustItem&)GetItemSet().Get( _nWhich ) );
- aAdj.SetAdjust( eAdjust );
- aAdj.SetOneWord( eOneWord );
- aAdj.SetLastBlock( eLastBlock );
- rOutSet.Put( aAdj );
- }
- }
- if(aSnapToGridCB.IsChecked() != aSnapToGridCB.GetSavedValue())
- {
- rOutSet.Put(SvxParaGridItem(aSnapToGridCB.IsChecked(), GetWhich( SID_ATTR_PARA_SNAPTOGRID )));
- bModified = TRUE;
- }
- if(aVertAlignLB.GetSavedValue() != aVertAlignLB.GetSelectEntryPos())
- {
- rOutSet.Put(SvxParaVertAlignItem(aVertAlignLB.GetSelectEntryPos(), GetWhich( SID_PARA_VERTALIGN )));
- bModified = TRUE;
- }
-
- if( aTextDirectionLB.IsVisible() )
- {
- SvxFrameDirection eDir = aTextDirectionLB.GetSelectEntryValue();
- if( eDir != aTextDirectionLB.GetSavedValue() )
- {
- rOutSet.Put( SvxFrameDirectionItem( eDir, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) );
- bModified = TRUE;
- }
- }
-
- return bModified;
-}
-
-/*-----------------16.01.97 19.33-------------------
-
---------------------------------------------------*/
-void SvxParaAlignTabPage::Reset( const SfxItemSet& rSet )
-{
- USHORT _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
- SfxItemState eItemState = rSet.GetItemState( _nWhich );
-
- USHORT nLBSelect = 0;
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- const SvxAdjustItem& rAdj = (const SvxAdjustItem&)rSet.Get( _nWhich );
-
- switch ( rAdj.GetAdjust() /*!!! VB fragen rAdj.GetLastBlock()*/ )
- {
- case SVX_ADJUST_LEFT: aLeft.Check(); break;
-
- case SVX_ADJUST_RIGHT: aRight.Check(); break;
-
- case SVX_ADJUST_CENTER: aCenter.Check(); break;
-
- case SVX_ADJUST_BLOCK: aJustify.Check(); break;
- default: ; //prevent warning
- }
- BOOL bEnable = aJustify.IsChecked();
- aLastLineFT.Enable(bEnable);
- aLastLineLB.Enable(bEnable);
- aExpandCB .Enable(bEnable);
-
- aExpandCB.Check(SVX_ADJUST_BLOCK == rAdj.GetOneWord());
- switch(rAdj.GetLastBlock())
- {
- case SVX_ADJUST_LEFT: nLBSelect = 0; break;
-
- case SVX_ADJUST_CENTER: nLBSelect = 1; break;
-
- case SVX_ADJUST_BLOCK: nLBSelect = 2; break;
- default: ; //prevent warning
- }
- }
- else
- {
- aLeft.Check( FALSE );
- aRight.Check( FALSE );
- aCenter.Check( FALSE );
- aJustify.Check( FALSE );
- }
- aLastLineLB.SelectEntryPos(nLBSelect);
-
- USHORT nHtmlMode = GetHtmlMode_Impl(rSet);
- if(nHtmlMode & HTMLMODE_ON)
- {
- aLastLineLB.Hide();
- aLastLineFT.Hide();
- aExpandCB.Hide();
- if(!(nHtmlMode & HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE) )
- aJustify.Disable();
- aSnapToGridCB.Show(FALSE);
- }
- _nWhich = GetWhich(SID_ATTR_PARA_SNAPTOGRID);
- eItemState = rSet.GetItemState( _nWhich );
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- const SvxParaGridItem& rSnap = (const SvxParaGridItem&)rSet.Get( _nWhich );
- aSnapToGridCB.Check(rSnap.GetValue());
- }
-
- _nWhich = GetWhich( SID_PARA_VERTALIGN );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- aVertAlignLB.Show();
- aVertAlignFL.Show();
- aVertAlignFT.Show();
-
- const SvxParaVertAlignItem& rAlign = (const SvxParaVertAlignItem&)rSet.Get( _nWhich );
- aVertAlignLB.SelectEntryPos(rAlign.GetValue());
- }
-
- _nWhich = GetWhich( SID_ATTR_FRAMEDIRECTION );
- //text direction
- if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( _nWhich ) )
- {
- const SvxFrameDirectionItem& rFrameDirItem = ( const SvxFrameDirectionItem& ) rSet.Get( _nWhich );
- aTextDirectionLB.SelectEntryValue( (SvxFrameDirection)rFrameDirItem.GetValue() );
- aTextDirectionLB.SaveValue();
- }
-
- aSnapToGridCB.SaveValue();
- aVertAlignLB.SaveValue();
- aLeft.SaveValue();
- aRight.SaveValue();
- aCenter.SaveValue();
- aJustify.SaveValue();
- aLastLineLB.SaveValue();
- aExpandCB.SaveValue();
-
- UpdateExample_Impl(TRUE);
-}
-
-/*-----------------17.01.97 08.06-------------------
-
---------------------------------------------------*/
-IMPL_LINK( SvxParaAlignTabPage, AlignHdl_Impl, RadioButton*, EMPTYARG )
-{
- BOOL bJustify = aJustify.IsChecked();
- aLastLineFT.Enable(bJustify);
- aLastLineLB.Enable(bJustify);
- aExpandCB.Enable(bJustify);
- UpdateExample_Impl(FALSE);
- return 0;
-}
-
-IMPL_LINK( SvxParaAlignTabPage, LastLineHdl_Impl, ListBox*, EMPTYARG )
-{
- UpdateExample_Impl(FALSE);
- return 0;
-}
-
-IMPL_LINK( SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox*, EMPTYARG )
-{
- SvxFrameDirection eDir = aTextDirectionLB.GetSelectEntryValue();
- switch ( eDir )
- {
- // check the default alignment for this text direction
- case FRMDIR_HORI_LEFT_TOP : aLeft.Check( TRUE ); break;
- case FRMDIR_HORI_RIGHT_TOP : aRight.Check( TRUE ); break;
- case FRMDIR_ENVIRONMENT : /* do nothing */ break;
- default:
- {
- DBG_ERRORFILE( "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" );
- }
- }
-
- return 0;
-}
-
-/*-----------------16.01.97 19.34-------------------
-
---------------------------------------------------*/
-void SvxParaAlignTabPage::UpdateExample_Impl( BOOL bAll )
-{
- if ( aLeft.IsChecked() )
- aExampleWin.SetAdjust( SVX_ADJUST_LEFT );
- else if ( aRight.IsChecked() )
- aExampleWin.SetAdjust( SVX_ADJUST_RIGHT );
- else if ( aCenter.IsChecked() )
- aExampleWin.SetAdjust( SVX_ADJUST_CENTER );
- else if ( aJustify.IsChecked() )
- {
- aExampleWin.SetAdjust( SVX_ADJUST_BLOCK );
- SvxAdjust eLastBlock = SVX_ADJUST_LEFT;
- USHORT nLBPos = aLastLineLB.GetSelectEntryPos();
- if(nLBPos == 1)
- eLastBlock = SVX_ADJUST_CENTER;
- else if(nLBPos == 2)
- eLastBlock = SVX_ADJUST_BLOCK;
- aExampleWin.SetLastLine( eLastBlock );
- }
-
- aExampleWin.Draw( bAll );
-}
-/*-----------------17.01.97 08.04-------------------
- Erweiterungen fuer den Blocksatz einschalten
---------------------------------------------------*/
-void SvxParaAlignTabPage::EnableJustifyExt()
-{
- aLastLineFT.Show();
- aLastLineLB.Show();
- aExpandCB .Show();
- SvtLanguageOptions aCJKOptions;
- if(aCJKOptions.IsAsianTypographyEnabled())
- aSnapToGridCB.Show();
-
-}
-//add CHINA001 begin
-void SvxParaAlignTabPage::PageCreated (SfxAllItemSet aSet)
-{
- SFX_ITEMSET_ARG (&aSet,pBoolItem,SfxBoolItem,SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_False);
- if (pBoolItem)
- if(pBoolItem->GetValue())
- EnableJustifyExt();
-}
-//end of CHINA001
-// class SvxExtParagraphTabPage ------------------------------------------
-
-SfxTabPage* SvxExtParagraphTabPage::Create( Window* pParent,
- const SfxItemSet& rSet )
-{
- return new SvxExtParagraphTabPage( pParent, rSet );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
-{
- BOOL bModified = FALSE;
- USHORT _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
- const TriState eHyphenState = aHyphenBox.GetState();
- const SfxPoolItem* pOld = GetOldItem( rOutSet, SID_ATTR_PARA_HYPHENZONE );
-
- if ( eHyphenState != aHyphenBox.GetSavedValue() ||
- aExtHyphenBeforeBox.IsValueModified() ||
- aExtHyphenAfterBox.IsValueModified() ||
- aMaxHyphenEdit.IsValueModified() )
- {
- SvxHyphenZoneItem aHyphen(
- (const SvxHyphenZoneItem&)GetItemSet().Get( _nWhich ) );
- aHyphen.SetHyphen( eHyphenState == STATE_CHECK );
-
- if ( eHyphenState == STATE_CHECK )
- {
- aHyphen.GetMinLead() = (BYTE)aExtHyphenBeforeBox.GetValue();
- aHyphen.GetMinTrail() = (BYTE)aExtHyphenAfterBox.GetValue();
- }
- aHyphen.GetMaxHyphens() = (BYTE)aMaxHyphenEdit.GetValue();
-
- if ( !pOld ||
- !( *(SvxHyphenZoneItem*)pOld == aHyphen ) ||
- eHyphenState != aHyphenBox.GetSavedValue())
- {
- rOutSet.Put( aHyphen );
- bModified |= TRUE;
- }
- }
-
- if (aPagenumEdit.IsEnabled() && aPagenumEdit.IsValueModified())
- {
- SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM,
- (USHORT)aPagenumEdit.GetValue() );
-
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_PAGENUM );
-
- if ( !pOld || ( (const SfxUInt16Item*)pOld )->GetValue() != aPageNum.GetValue() )
- {
- rOutSet.Put( aPageNum );
- bModified |= TRUE;
- }
- }
-
- // Seitenumbruch
-
- TriState eState = aApplyCollBtn.GetState();
- FASTBOOL bIsPageModel = FALSE;
-
- _nWhich = GetWhich( SID_ATTR_PARA_MODEL );
- String sPage;
- if ( eState != aApplyCollBtn.GetSavedValue() ||
- ( STATE_CHECK == eState &&
- aApplyCollBox.GetSelectEntryPos() != aApplyCollBox.GetSavedValue() ) )
- {
- if ( eState == STATE_CHECK )
- {
- sPage = aApplyCollBox.GetSelectEntry();
- bIsPageModel = 0 != sPage.Len();
- }
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_MODEL );
-
- if ( !pOld || ( (const SvxPageModelItem*)pOld )->GetValue() != sPage )
- {
- rOutSet.Put( SvxPageModelItem( sPage, FALSE, _nWhich ) );
- bModified |= TRUE;
- }
- else
- bIsPageModel = FALSE;
- }
- else if(STATE_CHECK == eState && aApplyCollBtn.IsEnabled())
- bIsPageModel = TRUE;
- else
- rOutSet.Put( SvxPageModelItem( sPage, FALSE, _nWhich ) );
-
- _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
-
- if ( bIsPageModel )
- // wird PageModel eingeschaltet, dann immer PageBreak ausschalten
- rOutSet.Put( SvxFmtBreakItem( SVX_BREAK_NONE, _nWhich ) );
- else
- {
- eState = aPageBreakBox.GetState();
- SfxItemState eModelState = GetItemSet().GetItemState(SID_ATTR_PARA_MODEL, FALSE);
-
- if ( (eModelState == SFX_ITEM_SET && STATE_CHECK == aPageBreakBox.GetState()) ||
- eState != aPageBreakBox.GetSavedValue() ||
- aBreakTypeLB.GetSelectEntryPos() != aBreakTypeLB.GetSavedValue() ||
- aBreakPositionLB.GetSelectEntryPos() != aBreakPositionLB.GetSavedValue() )
- {
- const SvxFmtBreakItem rOldBreak(
- (const SvxFmtBreakItem&)GetItemSet().Get( _nWhich ));
- SvxFmtBreakItem aBreak(rOldBreak.GetBreak(), rOldBreak.Which());
-
- switch ( eState )
- {
- case STATE_CHECK:
- {
- BOOL bBefore = aBreakPositionLB.GetSelectEntryPos() == 0;
-
- if ( aBreakTypeLB.GetSelectEntryPos() == 0 )
- {
- if ( bBefore )
- aBreak.SetValue( SVX_BREAK_PAGE_BEFORE );
- else
- aBreak.SetValue( SVX_BREAK_PAGE_AFTER );
- }
- else
- {
- if ( bBefore )
- aBreak.SetValue( SVX_BREAK_COLUMN_BEFORE );
- else
- aBreak.SetValue( SVX_BREAK_COLUMN_AFTER );
- }
- break;
- }
-
- case STATE_NOCHECK:
- aBreak.SetValue( SVX_BREAK_NONE );
- break;
- default: ; //prevent warning
- }
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_PAGEBREAK );
-
- if ( eState != aPageBreakBox.GetSavedValue() ||
- !pOld || !( *(const SvxFmtBreakItem*)pOld == aBreak ) )
- {
- bModified |= TRUE;
- rOutSet.Put( aBreak );
- }
- }
- }
-
-
- // Absatztrennung
- _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
- eState = aKeepTogetherBox.GetState();
-
- if ( eState != aKeepTogetherBox.GetSavedValue() )
- {
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_SPLIT );
-
- if ( !pOld || ( (const SvxFmtSplitItem*)pOld )->GetValue() !=
- ( eState == STATE_NOCHECK ) )
- {
- rOutSet.Put( SvxFmtSplitItem( eState == STATE_NOCHECK, _nWhich ) );
- bModified |= TRUE;
- }
- }
-
- // Absaetze zusammenhalten
- _nWhich = GetWhich( SID_ATTR_PARA_KEEP );
- eState = aKeepParaBox.GetState();
-
- if ( eState != aKeepParaBox.GetSavedValue() )
- {
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_KEEP );
-
- // hat sich der Status geaendert, muss immer geputtet werden
- rOutSet.Put( SvxFmtKeepItem( eState == STATE_CHECK, _nWhich ) );
- bModified |= TRUE;
- }
-
- // Witwen und Waisen
- _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
- eState = aWidowBox.GetState();
-
- if ( eState != aWidowBox.GetSavedValue() ||
- aWidowRowNo.IsValueModified() )
- {
- SvxWidowsItem rItem( eState == STATE_CHECK ?
- (BYTE)aWidowRowNo.GetValue() : 0, _nWhich );
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_WIDOWS );
-
- if ( eState != aWidowBox.GetSavedValue() || !pOld || !( *(const SvxWidowsItem*)pOld == rItem ) )
- {
- rOutSet.Put( rItem );
- bModified |= TRUE;
- }
- }
-
- _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
- eState = aOrphanBox.GetState();
-
- if ( eState != aOrphanBox.GetSavedValue() ||
- aOrphanRowNo.IsValueModified() )
- {
- SvxOrphansItem rItem( eState == STATE_CHECK ?
- (BYTE)aOrphanRowNo.GetValue() : 0, _nWhich );
- pOld = GetOldItem( rOutSet, SID_ATTR_PARA_ORPHANS );
-
- if ( eState != aOrphanBox.GetSavedValue() ||
- !pOld ||
- !( *(const SvxOrphansItem*)pOld == rItem ) )
- {
- rOutSet.Put( rItem );
- bModified |= TRUE;
- }
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
-{
- USHORT _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
- SfxItemState eItemState = rSet.GetItemState( _nWhich );
-
- BOOL bItemAvailable = eItemState >= SFX_ITEM_AVAILABLE;
- BOOL bIsHyphen = FALSE;
- if( !bHtmlMode && bItemAvailable )
- {
- const SvxHyphenZoneItem& rHyphen =
- (const SvxHyphenZoneItem&)rSet.Get( _nWhich );
- aHyphenBox.EnableTriState( FALSE );
-
- bIsHyphen = rHyphen.IsHyphen();
- aHyphenBox.SetState( bIsHyphen ? STATE_CHECK : STATE_NOCHECK );
-
- aExtHyphenBeforeBox.SetValue( rHyphen.GetMinLead() );
- aExtHyphenAfterBox.SetValue( rHyphen.GetMinTrail() );
- aMaxHyphenEdit.SetValue( rHyphen.GetMaxHyphens() );
- }
- else
- {
- aHyphenBox.SetState( STATE_DONTKNOW );
- }
- BOOL bEnable = bItemAvailable && bIsHyphen;
- aExtHyphenBeforeBox.Enable(bEnable);
- aExtHyphenAfterBox.Enable(bEnable);
- aBeforeText.Enable(bEnable);
- aAfterText.Enable(bEnable);
- aMaxHyphenLabel.Enable(bEnable);
- aMaxHyphenEdit.Enable(bEnable);
-
- _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM );
-
- if ( rSet.GetItemState(_nWhich) >= SFX_ITEM_AVAILABLE )
- {
- const USHORT nPageNum =
- ( (const SfxUInt16Item&)rSet.Get( _nWhich ) ).GetValue();
- aPagenumEdit.SetValue( nPageNum );
- }
-
- if ( bPageBreak )
- {
- // zuerst PageModel behandeln
- _nWhich = GetWhich( SID_ATTR_PARA_MODEL );
- BOOL bIsPageModel = FALSE;
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_SET )
- {
- aApplyCollBtn.EnableTriState( FALSE );
-
- const SvxPageModelItem& rModel =
- (const SvxPageModelItem&)rSet.Get( _nWhich );
- String aStr( rModel.GetValue() );
-
- if ( aStr.Len() &&
- aApplyCollBox.GetEntryPos( aStr ) != LISTBOX_ENTRY_NOTFOUND )
- {
- aApplyCollBox.SelectEntry( aStr );
- aApplyCollBtn.SetState( STATE_CHECK );
- bIsPageModel = TRUE;
-
- aPageBreakBox.Enable();
- aPageBreakBox.EnableTriState( FALSE );
- aBreakTypeFT.Enable();
- aBreakTypeLB.Enable();
- aBreakPositionFT.Enable();
- aBreakPositionLB.Enable();
- aApplyCollBtn.Enable();
- aPageBreakBox.SetState( STATE_CHECK );
-
- //select page break
- aBreakTypeLB.SelectEntryPos(0);
- //select break before
- aBreakPositionLB.SelectEntryPos(0);
- }
- else
- {
- aApplyCollBox.SetNoSelection();
- aApplyCollBtn.SetState( STATE_NOCHECK );
- }
- }
- else if ( SFX_ITEM_DONTCARE == eItemState )
- {
- aApplyCollBtn.EnableTriState( TRUE );
- aApplyCollBtn.SetState( STATE_DONTKNOW );
- aApplyCollBox.SetNoSelection();
- }
- else
- {
- aApplyCollBtn.Enable(FALSE);
- aApplyCollBox.Enable(FALSE);
- aPagenumEdit.Enable(FALSE);
- aPagenumText.Enable(FALSE);
- }
-//!!! ApplyCollClickHdl_Impl( &aApplyCollBtn );
-
- if ( !bIsPageModel )
- {
- _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- const SvxFmtBreakItem& rPageBreak =
- (const SvxFmtBreakItem&)rSet.Get( _nWhich );
-
- SvxBreak eBreak = (SvxBreak)rPageBreak.GetValue();
-
- // PageBreak nicht ueber CTRL-RETURN,
- // dann kann CheckBox frei gegeben werden
- aPageBreakBox.Enable();
- aPageBreakBox.EnableTriState( FALSE );
- aBreakTypeFT.Enable();
- aBreakTypeLB.Enable();
- aBreakPositionFT.Enable();
- aBreakPositionLB.Enable();
-
- aPageBreakBox.SetState( STATE_CHECK );
-
- BOOL _bEnable = eBreak != SVX_BREAK_NONE &&
- eBreak != SVX_BREAK_COLUMN_BEFORE &&
- eBreak != SVX_BREAK_COLUMN_AFTER;
- aApplyCollBtn.Enable(_bEnable);
- if(!_bEnable)
- {
- aApplyCollBox.Enable(_bEnable);
- aPagenumEdit.Enable(_bEnable);
- }
-
- if ( eBreak == SVX_BREAK_NONE )
- aPageBreakBox.SetState( STATE_NOCHECK );
-
- USHORT nType = 0; // selection position in break type ListBox : Page
- USHORT nPosition = 0; // selection position in break position ListBox : Before
- switch ( eBreak )
- {
- case SVX_BREAK_PAGE_BEFORE:
- break;
- case SVX_BREAK_PAGE_AFTER:
- nPosition = 1;
- break;
- case SVX_BREAK_COLUMN_BEFORE:
- nType = 1;
- break;
- case SVX_BREAK_COLUMN_AFTER:
- nType = 1;
- nPosition = 1;
- break;
- default: ;//prevent warning
- }
- aBreakTypeLB.SelectEntryPos(nType);
- aBreakPositionLB.SelectEntryPos(nPosition);
- }
- else if ( SFX_ITEM_DONTCARE == eItemState )
- aPageBreakBox.SetState( STATE_DONTKNOW );
- else
- {
- aPageBreakBox.Enable(FALSE);
- aBreakTypeFT.Enable(FALSE);
- aBreakTypeLB.Enable(FALSE);
- aBreakPositionFT.Enable(FALSE);
- aBreakPositionLB.Enable(FALSE);
- }
- }
-
- PageBreakPosHdl_Impl( &aBreakPositionLB );
- PageBreakHdl_Impl( &aPageBreakBox );
- }
-
- _nWhich = GetWhich( SID_ATTR_PARA_KEEP );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- aKeepParaBox.EnableTriState( FALSE );
- const SvxFmtKeepItem& rKeep =
- (const SvxFmtKeepItem&)rSet.Get( _nWhich );
-
- if ( rKeep.GetValue() )
- aKeepParaBox.SetState( STATE_CHECK );
- else
- aKeepParaBox.SetState( STATE_NOCHECK );
- }
- else if ( SFX_ITEM_DONTCARE == eItemState )
- aKeepParaBox.SetState( STATE_DONTKNOW );
- else
- aKeepParaBox.Enable(FALSE);
-
- _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
- eItemState = rSet.GetItemState( _nWhich );
-
- if ( eItemState >= SFX_ITEM_AVAILABLE )
- {
- const SvxFmtSplitItem& rSplit =
- (const SvxFmtSplitItem&)rSet.Get( _nWhich );
- aKeepTogetherBox.EnableTriState( FALSE );
-
- if ( !rSplit.GetValue() )
- aKeepTogetherBox.SetState( STATE_CHECK );
- else
- {
- aKeepTogetherBox.SetState( STATE_NOCHECK );
-
- // Witwen und Waisen
- aWidowBox.Enable();
- _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
- SfxItemState eTmpState = rSet.GetItemState( _nWhich );
-
- if ( eTmpState >= SFX_ITEM_AVAILABLE )
- {
- const SvxWidowsItem& rWidow =
- (const SvxWidowsItem&)rSet.Get( _nWhich );
- aWidowBox.EnableTriState( FALSE );
- const USHORT nLines = rWidow.GetValue();
-
- BOOL _bEnable = nLines > 0;
- aWidowRowNo.SetValue( aWidowRowNo.Normalize( nLines ) );
- aWidowBox.SetState( _bEnable ? STATE_CHECK : STATE_NOCHECK);
- aWidowRowNo.Enable(_bEnable);
- aWidowRowLabel.Enable(_bEnable);
-
- }
- else if ( SFX_ITEM_DONTCARE == eTmpState )
- aWidowBox.SetState( STATE_DONTKNOW );
- else
- aWidowBox.Enable(FALSE);
-
- aOrphanBox.Enable();
- _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
- eTmpState = rSet.GetItemState( _nWhich );
-
- if ( eTmpState >= SFX_ITEM_AVAILABLE )
- {
- const SvxOrphansItem& rOrphan =
- (const SvxOrphansItem&)rSet.Get( _nWhich );
- const USHORT nLines = rOrphan.GetValue();
- aOrphanBox.EnableTriState( FALSE );
-
- BOOL _bEnable = nLines > 0;
- aOrphanBox.SetState( _bEnable ? STATE_CHECK : STATE_NOCHECK);
- aOrphanRowNo.SetValue( aOrphanRowNo.Normalize( nLines ) );
- aOrphanRowNo.Enable(_bEnable);
- aOrphanRowLabel.Enable(_bEnable);
-
- }
- else if ( SFX_ITEM_DONTCARE == eTmpState )
- aOrphanBox.SetState( STATE_DONTKNOW );
- else
- aOrphanBox.Enable(FALSE);
- }
- }
- else if ( SFX_ITEM_DONTCARE == eItemState )
- aKeepTogetherBox.SetState( STATE_DONTKNOW );
- else
- aKeepTogetherBox.Enable(FALSE);
-
- // damit alles richt enabled wird
- KeepTogetherHdl_Impl( 0 );
- WidowHdl_Impl( 0 );
- OrphanHdl_Impl( 0 );
-
- aHyphenBox.SaveValue();
- aExtHyphenBeforeBox.SaveValue();
- aExtHyphenAfterBox.SaveValue();
- aMaxHyphenEdit.SaveValue();
- aPageBreakBox.SaveValue();
- aBreakPositionLB.SaveValue();
- aBreakTypeLB.SaveValue();
- aApplyCollBtn.SaveValue();
- aApplyCollBox.SaveValue();
- aPagenumEdit.SaveValue();
- aKeepTogetherBox.SaveValue();
- aKeepParaBox.SaveValue();
- aWidowBox.SaveValue();
- aOrphanBox.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-int SvxExtParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxExtParagraphTabPage::DisablePageBreak()
-{
- bPageBreak = FALSE;
- aPageBreakBox.Enable(FALSE);
- aBreakTypeLB.RemoveEntry(0);
- aBreakPositionFT.Enable(FALSE);
- aBreakPositionLB.Enable(FALSE);
- aApplyCollBtn.Enable(FALSE);
- aApplyCollBox.Enable(FALSE);
- aPagenumEdit.Enable(FALSE);
-}
-
-// -----------------------------------------------------------------------
-
-SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rAttr ) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_EXT_PARAGRAPH ), rAttr ),
-
- aHyphenBox ( this, SVX_RES( BTN_HYPHEN ) ),
- aBeforeText ( this, SVX_RES( FT_HYPHENBEFORE ) ),
- aExtHyphenBeforeBox ( this, SVX_RES( ED_HYPHENBEFORE ) ),
- aAfterText ( this, SVX_RES( FT_HYPHENAFTER ) ),
- aExtHyphenAfterBox ( this, SVX_RES( ED_HYPHENAFTER ) ),
- aMaxHyphenLabel ( this, SVX_RES( FT_MAXHYPH ) ),
- aMaxHyphenEdit ( this, SVX_RES( ED_MAXHYPH ) ),
- aExtFL ( this, SVX_RES( FL_HYPHEN ) ),
- aBreaksFL ( this, SVX_RES( FL_BREAKS ) ),
- aPageBreakBox ( this, SVX_RES( BTN_PAGEBREAK ) ),
- aBreakTypeFT ( this, SVX_RES( FT_BREAKTYPE )),
- aBreakTypeLB ( this, SVX_RES( LB_BREAKTYPE )),
- aBreakPositionFT ( this, SVX_RES( FT_BREAKPOSITION )),
- aBreakPositionLB ( this, SVX_RES( LB_BREAKPOSITION )),
-// aPageBox ( this, SVX_RES( BTN_BREAKPAGE ) ),
-// aColumnBox ( this, SVX_RES( BTN_BREAKCOLUMN ) ),
-// aBeforeBox ( this, SVX_RES( BTN_PAGEBREAKBEFORE ) ),
-// aAfterBox ( this, SVX_RES( BTN_PAGEBREAKAFTER ) ),
- aApplyCollBtn ( this, SVX_RES( BTN_PAGECOLL ) ),
- aApplyCollBox ( this, SVX_RES( LB_PAGECOLL ) ),
- aPagenumText ( this, SVX_RES( FT_PAGENUM ) ),
- aPagenumEdit ( this, SVX_RES( ED_PAGENUM ) ),
- aExtendFL ( this, SVX_RES( FL_OPTIONS ) ),
- aKeepTogetherBox ( this, SVX_RES( BTN_KEEPTOGETHER ) ),
- aKeepParaBox ( this, SVX_RES( CB_KEEPTOGETHER ) ),
- aOrphanBox ( this, SVX_RES( BTN_ORPHANS ) ),
- aOrphanRowNo ( this, SVX_RES( ED_ORPHANS ) ),
- aOrphanRowLabel ( this, SVX_RES( FT_ORPHANS ) ),
- aWidowBox ( this, SVX_RES( BTN_WIDOWS ) ),
- aWidowRowNo ( this, SVX_RES( ED_WIDOWS ) ),
- aWidowRowLabel ( this, SVX_RES( FT_WIDOWS ) ),
- bPageBreak ( TRUE ),
- bHtmlMode ( FALSE ),
- nStdPos ( 0 )
-{
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- aHyphenBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, HyphenClickHdl_Impl ) );
- aPageBreakBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, PageBreakHdl_Impl ) );
- aKeepTogetherBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, KeepTogetherHdl_Impl ) );
- aWidowBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, WidowHdl_Impl ) );
- aOrphanBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, OrphanHdl_Impl ) );
- aApplyCollBtn.SetClickHdl( LINK( this, SvxExtParagraphTabPage, ApplyCollClickHdl_Impl ) );
- aBreakTypeLB.SetSelectHdl( LINK( this, SvxExtParagraphTabPage, PageBreakTypeHdl_Impl ) );
- aBreakPositionLB.SetSelectHdl( LINK( this, SvxExtParagraphTabPage, PageBreakPosHdl_Impl ) );
-
- SfxObjectShell* pSh = SfxObjectShell::Current();
- if ( pSh )
- {
- SfxStyleSheetBasePool* pPool = pSh->GetStyleSheetPool();
- pPool->SetSearchMask( SFX_STYLE_FAMILY_PAGE );
- SfxStyleSheetBase* pStyle = pPool->First();
- String aStdName;
-
- while( pStyle )
- {
- if ( aStdName.Len() == 0 )
- // first style == standard style
- aStdName = pStyle->GetName();
- aApplyCollBox.InsertEntry( pStyle->GetName() );
- pStyle = pPool->Next();
- }
- nStdPos = aApplyCollBox.GetEntryPos( aStdName );
- }
-
- USHORT nHtmlMode = GetHtmlMode_Impl( rAttr );
- if ( nHtmlMode & HTMLMODE_ON )
- {
- bHtmlMode = TRUE;
- aHyphenBox .Enable(FALSE);
- aBeforeText .Enable(FALSE);
- aExtHyphenBeforeBox .Enable(FALSE);
- aAfterText .Enable(FALSE);
- aExtHyphenAfterBox .Enable(FALSE);
- aMaxHyphenLabel .Enable(FALSE);
- aMaxHyphenEdit .Enable(FALSE);
- aExtFL .Enable(FALSE);
- aPagenumText .Enable(FALSE);
- aPagenumEdit .Enable(FALSE);
- // no column break in HTML
- aBreakTypeLB.RemoveEntry(1);
- }
-}
-
-// -----------------------------------------------------------------------
-
-__EXPORT SvxExtParagraphTabPage::~SvxExtParagraphTabPage()
-{
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxExtParagraphTabPage::GetRanges()
-{
- return pExtRanges;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, PageBreakHdl_Impl, TriStateBox *, EMPTYARG )
-{
- switch ( aPageBreakBox.GetState() )
- {
- case STATE_CHECK:
- aBreakTypeFT.Enable();
- aBreakTypeLB.Enable();
- aBreakPositionFT.Enable();
- aBreakPositionLB.Enable();
-
- if ( 0 == aBreakTypeLB.GetSelectEntryPos()&&
- 0 == aBreakPositionLB.GetSelectEntryPos() )
- {
- aApplyCollBtn.Enable();
-
- BOOL bEnable = STATE_CHECK == aApplyCollBtn.GetState() &&
- aApplyCollBox.GetEntryCount();
- aApplyCollBox.Enable(bEnable);
- if(!bHtmlMode)
- {
- aPagenumText.Enable(bEnable);
- aPagenumEdit.Enable(bEnable);
- }
- }
- break;
-
- case STATE_NOCHECK:
- case STATE_DONTKNOW:
- aApplyCollBtn.SetState( STATE_NOCHECK );
- aApplyCollBtn.Enable(FALSE);
- aApplyCollBox.Enable(FALSE);
- aPagenumText.Enable(FALSE);
- aPagenumEdit.Enable(FALSE);
- aBreakTypeFT.Enable(FALSE);
- aBreakTypeLB.Enable(FALSE);
- aBreakPositionFT.Enable(FALSE);
- aBreakPositionLB.Enable(FALSE);
- break;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, KeepTogetherHdl_Impl, TriStateBox *, EMPTYARG )
-{
- BOOL bEnable = aKeepTogetherBox.GetState() == STATE_NOCHECK;
- aWidowBox.Enable(bEnable);
- aOrphanBox.Enable(bEnable);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, WidowHdl_Impl, TriStateBox *, EMPTYARG )
-{
- switch ( aWidowBox.GetState() )
- {
- case STATE_CHECK:
- aWidowRowNo.Enable();
- aWidowRowLabel.Enable();
- aKeepTogetherBox.Enable(FALSE);
- break;
-
- case STATE_NOCHECK:
- if ( aOrphanBox.GetState() == STATE_NOCHECK )
- aKeepTogetherBox.Enable();
-
- // kein break
- case STATE_DONTKNOW:
- aWidowRowNo.Enable(FALSE);
- aWidowRowLabel.Enable(FALSE);
- break;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, OrphanHdl_Impl, TriStateBox *, EMPTYARG )
-{
- switch( aOrphanBox.GetState() )
- {
- case STATE_CHECK:
- aOrphanRowNo.Enable();
- aOrphanRowLabel.Enable();
- aKeepTogetherBox.Enable(FALSE);
- break;
-
- case STATE_NOCHECK:
- if ( aWidowBox.GetState() == STATE_NOCHECK )
- aKeepTogetherBox.Enable();
-
- // kein break
- case STATE_DONTKNOW:
- aOrphanRowNo.Enable(FALSE);
- aOrphanRowLabel.Enable(FALSE);
- break;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, HyphenClickHdl_Impl, TriStateBox *, EMPTYARG )
-{
-
- BOOL bEnable = aHyphenBox.GetState() == STATE_CHECK;
- aBeforeText.Enable(bEnable);
- aExtHyphenBeforeBox.Enable(bEnable);
- aAfterText.Enable(bEnable);
- aExtHyphenAfterBox.Enable(bEnable);
- aMaxHyphenLabel.Enable(bEnable);
- aMaxHyphenEdit.Enable(bEnable);
- aHyphenBox.SetState( bEnable ? STATE_CHECK : STATE_NOCHECK);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, ApplyCollClickHdl_Impl, TriStateBox *, EMPTYARG )
-{
- BOOL bEnable = FALSE;
- if ( aApplyCollBtn.GetState() == STATE_CHECK &&
- aApplyCollBox.GetEntryCount() )
- {
- bEnable = TRUE;
- aApplyCollBox.SelectEntryPos( nStdPos );
- }
- else
- {
- aApplyCollBox.SetNoSelection();
- }
- aApplyCollBox.Enable(bEnable);
- if(!bHtmlMode)
- {
- aPagenumText.Enable(bEnable);
- aPagenumEdit.Enable(bEnable);
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox )
-{
- if ( 0 == pListBox->GetSelectEntryPos() )
- {
- aApplyCollBtn.Enable();
-
- BOOL bEnable = aApplyCollBtn.GetState() == STATE_CHECK &&
- aApplyCollBox.GetEntryCount();
-
- aApplyCollBox.Enable(bEnable);
- if(!bHtmlMode)
- {
- aPagenumText.Enable(bEnable);
- aPagenumEdit.Enable(bEnable);
- }
- }
- else if ( 1 == pListBox->GetSelectEntryPos() )
- {
- aApplyCollBtn.SetState( STATE_NOCHECK );
- aApplyCollBtn.Enable(FALSE);
- aApplyCollBox.Enable(FALSE);
- aPagenumText.Enable(FALSE);
- aPagenumEdit.Enable(FALSE);
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox )
-{
- //column break or break break after
- USHORT nBreakPos = aBreakPositionLB.GetSelectEntryPos();
- if ( pListBox->GetSelectEntryPos() == 1 || 1 == nBreakPos)
- {
- aApplyCollBtn.SetState( STATE_NOCHECK );
- aApplyCollBtn.Enable(FALSE);
- aApplyCollBox.Enable(FALSE);
- aPagenumText.Enable(FALSE);
- aPagenumEdit.Enable(FALSE);
- }
- else
- PageBreakPosHdl_Impl( &aBreakPositionLB );
- return 0;
-}
-//Add CHINA001 begin
-void SvxExtParagraphTabPage::PageCreated(SfxAllItemSet aSet)
-{
-
-
- SFX_ITEMSET_ARG (&aSet,pDisablePageBreakItem,SfxBoolItem,SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_False);
-
- if (pDisablePageBreakItem)
- if ( pDisablePageBreakItem->GetValue())
- DisablePageBreak();
-
-
-}
-//end of Add CHINA001
-/*-- 29.11.00 11:36:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SvxAsianTabPage::SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage(pParent, SVX_RES( RID_SVXPAGE_PARA_ASIAN ), rSet),
- aOptionsFL( this, SVX_RES(FL_AS_OPTIONS )),
- aForbiddenRulesCB( this, SVX_RES(CB_AS_FORBIDDEN )),
- aHangingPunctCB( this, SVX_RES(CB_AS_HANG_PUNC )),
- aScriptSpaceCB( this, SVX_RES(CB_AS_SCRIPT_SPACE ))//,
-
-{
- FreeResource();
-
- Link aLink = LINK( this, SvxAsianTabPage, ClickHdl_Impl );
- aHangingPunctCB.SetClickHdl( aLink );
- aScriptSpaceCB.SetClickHdl( aLink );
- aForbiddenRulesCB.SetClickHdl( aLink );
-
-}
-/*-- 29.11.00 11:36:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SvxAsianTabPage::~SvxAsianTabPage()
-{
-}
-/*-- 29.11.00 11:36:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SfxTabPage* SvxAsianTabPage::Create( Window* pParent, const SfxItemSet& rSet )
-{
- return new SvxAsianTabPage(pParent, rSet);
-}
-/*-- 29.11.00 11:36:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT* SvxAsianTabPage::GetRanges()
-{
- static USHORT pRanges[] =
- {
- SID_ATTR_PARA_SCRIPTSPACE, SID_ATTR_PARA_FORBIDDEN_RULES,
- 0
- };
- return pRanges;
-}
-/*-- 29.11.00 11:36:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-BOOL SvxAsianTabPage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bRet = FALSE;
- SfxItemPool* pPool = rSet.GetPool();
- if(aScriptSpaceCB.IsChecked() != aScriptSpaceCB.GetSavedValue())
- {
- SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get(
- pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone();
- pNewItem->SetValue(aScriptSpaceCB.IsChecked());
- rSet.Put(*pNewItem);
- delete pNewItem;
- bRet = TRUE;
- }
- if(aHangingPunctCB.IsChecked() != aHangingPunctCB.GetSavedValue())
- {
- SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get(
- pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone();
- pNewItem->SetValue(aHangingPunctCB.IsChecked());
- rSet.Put(*pNewItem);
- delete pNewItem;
- bRet = TRUE;
- }
- if(aForbiddenRulesCB.IsChecked() != aForbiddenRulesCB.GetSavedValue())
- {
- SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get(
- pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone();
- pNewItem->SetValue(aForbiddenRulesCB.IsChecked());
- rSet.Put(*pNewItem);
- delete pNewItem;
- bRet = TRUE;
- }
- return bRet;
-}
-/*-- 29.11.00 11:36:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void lcl_SetBox(const SfxItemSet& rSet, USHORT nSlotId, TriStateBox& rBox)
-{
- USHORT _nWhich = rSet.GetPool()->GetWhich(nSlotId);
- SfxItemState eState = rSet.GetItemState(_nWhich, TRUE);
- if(!eState || eState == SFX_ITEM_DISABLED )
- rBox.Enable(FALSE);
- else if(eState >= SFX_ITEM_AVAILABLE)
- {
- rBox.EnableTriState( FALSE );
- rBox.Check(((const SfxBoolItem&)rSet.Get(_nWhich)).GetValue());
- }
- else
- rBox.SetState( STATE_DONTKNOW );
- rBox.SaveValue();
-}
-
-
-void SvxAsianTabPage::Reset( const SfxItemSet& rSet )
-{
- lcl_SetBox(rSet, SID_ATTR_PARA_FORBIDDEN_RULES, aForbiddenRulesCB );
-// lcl_SetBox(rSet, , aAllowWordBreakCB );
- lcl_SetBox(rSet, SID_ATTR_PARA_HANGPUNCTUATION, aHangingPunctCB );
-
-
- //character distance not yet available
-// lcl_SetBox(rSet, , aPuntuationCB );
- lcl_SetBox(rSet, SID_ATTR_PARA_SCRIPTSPACE, aScriptSpaceCB );
-// lcl_SetBox(rSet, , aAdjustNumbersCB );
-// aAllowWordBreakCB .Enable(FALSE);
-// aPuntuationCB .Enable(FALSE);
-// aAdjustNumbersCB .Enable(FALSE);
-}
-/* -----------------------------19.12.00 12:59--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxAsianTabPage, ClickHdl_Impl, TriStateBox*, pBox )
-{
- pBox->EnableTriState( FALSE );
- return 0;
-}
diff --git a/svx/source/cui/paragrph.hrc b/svx/source/cui/paragrph.hrc
deleted file mode 100644
index 7314cea6ce..0000000000
--- a/svx/source/cui/paragrph.hrc
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: paragrph.hrc,v $
- * $Revision: 1.19 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_PARAGRPH_HRC
-#define _SVX_PARAGRPH_HRC
-
-// StandardTabPage ----------------------------------------------------------
-
-#define FT_LEFTINDENT 10
-#define ED_LEFTINDENT 11
-#define FT_FLINEINDENT 12
-#define ED_FLINEINDENT 13
-#define FT_RIGHTINDENT 14
-#define ED_RIGHTINDENT 15
-#define FL_INDENT 16
-
-#define FT_TOPDIST 20
-#define ED_TOPDIST 21
-#define FT_BOTTOMDIST 22
-#define ED_BOTTOMDIST 23
-#define FL_DIST 24
-
-#define BTN_LEFTALIGN 30
-#define BTN_RIGHTALIGN 31
-#define BTN_CENTERALIGN 32
-#define BTN_JUSTIFYALIGN 33
-#define FL_ALIGN 34
-#define FL_VERTALIGN 35
-#define LB_VERTALIGN 36
-#define FL_VERTEX 37
-#define CB_SNAP 38
-#define FT_VERTALIGN 39
-
-
-#define LB_LINEDIST 40
-#define FT_LINEDIST 41
-#define ED_LINEDISTPERCENT 42
-#define ED_LINEDISTMETRIC 43
-#define FL_LINEDIST 44
-#define WN_EXAMPLE 46
-
-#define CB_AUTO 48
-#define FT_LASTLINE 49
-#define LB_LASTLINE 50
-#define CB_EXPAND 51
-#define ST_LINEDIST_ABS 52
-#define ST_LEFTALIGN_ASIAN 53
-#define ST_RIGHTALIGN_ASIAN 54
-
-// ExtendedTabPage ----------------------------------------------------------
-
-#define BTN_HYPHEN 50
-#define ED_HYPHENBEFORE 52
-#define FT_HYPHENBEFORE 53
-#define ED_HYPHENAFTER 55
-#define FT_HYPHENAFTER 56
-#define FL_HYPHEN 57
-
-#define BTN_PAGEBREAK 60
-#define FT_BREAKTYPE 61
-#define LB_BREAKTYPE 62
-#define FT_BREAKPOSITION 63
-#define LB_BREAKPOSITION 64
-#define BTN_PAGECOLL 65
-#define LB_PAGECOLL 66
-#define BTN_KEEPTOGETHER 67
-#define BTN_WIDOWS 68
-#define ED_WIDOWS 69
-#define FT_WIDOWS 70
-#define BTN_ORPHANS 71
-#define ED_ORPHANS 72
-#define FT_ORPHANS 73
-#define FL_OPTIONS 74
-#define FT_PAGENUM 75
-#define ED_PAGENUM 76
-#define FL_BREAKS 77
-
-#define CB_KEEPTOGETHER 80
-#define FT_MAXHYPH 81
-#define ED_MAXHYPH 83
-
-#define CB_REGISTER 84
-#define FL_REGISTER 85
-#define FL_PROPERTIES 90
-#define FT_TEXTDIRECTION 91
-#define LB_TEXTDIRECTION 92
-
-
-//asian typography
-#define FL_AS_OPTIONS 1
-#define CB_AS_HANG_PUNC 2
-
-#define CB_AS_FORBIDDEN 4
-
-#define CB_AS_SCRIPT_SPACE 7
-
-#endif
-
diff --git a/svx/source/cui/paragrph.hxx b/svx/source/cui/paragrph.hxx
deleted file mode 100644
index 438a741100..0000000000
--- a/svx/source/cui/paragrph.hxx
+++ /dev/null
@@ -1,336 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: paragrph.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_PARAGRPH_HXX
-#define _SVX_PARAGRPH_HXX
-
-// include ---------------------------------------------------------------
-
-#ifndef _BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#include <sfx2/tabdlg.hxx>
-#include "relfld.hxx" // SvxRelativeField
-#include <svx/paraprev.hxx> // Preview
-#include <svx/frmdirlbox.hxx>
-
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#include "flagsdef.hxx"
-// define ----------------------------------------------------------------
-
-// 1/2 cm in TWIPS
-// wird auch fuer Minimalgrosse der LayFrms aller Arten benutzt
-//CHINA001 #define MM50 283
-
-// forward ---------------------------------------------------------------
-
-class SvxLineSpacingItem;
-class SvxParagraphControllerItem;
-
-// class SvxStdParagraphTabPage ------------------------------------------
-
-/* {k:\svx\prototyp\dialog\parastd.bmp}
-
- [Beschreibung]
- Mit dieser TabPage koennen Standard-Attribute eines Absatzes eingestellt
- werden (Einzug, Abstand, Ausrichtung, Zeilenabstand).
-
- [Items]
- <SvxAdjustItem><SID_ATTR_PARA_ADJUST>
- <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE>
- <SvxULSpaceItem><SID_ATTR_ULSPACE>
- <SvxLRSpaceItem><SID_ATTR_LRSPACE>
-*/
-
-class SvxStdParagraphTabPage: public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
-private:
- SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
-
- // Einzug
- FixedText aLeftLabel;
- SvxRelativeField aLeftIndent;
-
- FixedText aRightLabel;
- SvxRelativeField aRightIndent;
-
- FixedText aFLineLabel;
- SvxRelativeField aFLineIndent;
- CheckBox aAutoCB;
-
- FixedLine aIndentFrm;
-
- // Abstaende
- FixedText aTopLabel;
- SvxRelativeField aTopDist;
- FixedText aBottomLabel;
- SvxRelativeField aBottomDist;
- FixedLine aDistFrm;
-
- // Zeilenabstand
- ListBox aLineDist;
- FixedText aLineDistAtLabel;
- MetricField aLineDistAtPercentBox;
- MetricField aLineDistAtMetricBox;
- FixedLine aLineDistFrm;
- String sAbsDist;
- SvxParaPrevWindow aExampleWin;
-
- //Registerhaltigkeit - nur Writer
- CheckBox aRegisterCB;
- FixedLine aRegisterFL;
-
- Edit* pActLineDistFld;
- long nAbst;
- long nWidth;
- long nMinFixDist;
- BOOL bRelativeMode;
- BOOL bNegativeIndents;
-
-#ifdef _SVX_PARAGRPH_CXX
- void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr );
- void Init_Impl();
- void UpdateExample_Impl( BOOL bAll = FALSE );
-
- DECL_LINK( LineDistHdl_Impl, ListBox* );
- DECL_LINK( ModifyHdl_Impl, SvxRelativeField* );
- DECL_LINK( AutoHdl_Impl, CheckBox* );
-#endif
-
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- DECL_LINK( ELRLoseFocusHdl, Edit* );
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
-
- void SetPageWidth( USHORT nPageWidth );
- void SetMaxDistance( USHORT nMaxDist );
- void EnableRelativeMode();
- void EnableRegisterMode();
- void EnableAutoFirstLine();
- void EnableAbsLineDist(long nMinTwip);
- void EnableNegativeMode();
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-// class SvxParaAlignTabPage ------------------------------------------------
-
-class SvxParaAlignTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
- // Ausrichtung
- FixedLine aAlignFrm;
- RadioButton aLeft;
- RadioButton aRight;
- RadioButton aCenter;
- RadioButton aJustify;
- FixedText aLastLineFT;
- ListBox aLastLineLB;
- CheckBox aExpandCB;
-
- CheckBox aSnapToGridCB;
-
- //preview
- SvxParaPrevWindow aExampleWin;
- //vertical alignment
- FixedLine aVertAlignFL;
-
- FixedText aVertAlignFT;
- ListBox aVertAlignLB;
-
- FixedLine aPropertiesFL;
- FixedText aTextDirectionFT;
- svx::FrameDirectionListBox aTextDirectionLB;
-
-#ifdef _SVX_PARAGRPH_CXX
- DECL_LINK( AlignHdl_Impl, RadioButton* );
- DECL_LINK( LastLineHdl_Impl, ListBox* );
- DECL_LINK( TextDirectionHdl_Impl, ListBox* );
-
- void UpdateExample_Impl( BOOL bAll = FALSE );
-#endif
-
- SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxParaAlignTabPage();
-
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void EnableJustifyExt();
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-// class SvxExtParagraphTabPage ------------------------------------------
-
-/* {k:\svx\prototyp\dialog\paraext.bmp}
-
- [Beschreibung]
- Mit dieser TabPage koennen Spezial-Attribute eines Absatzes eingestellt
- werden (Silbentrennung, Seitenumbruch, Schusterjungen, Hurenkinder, ...).
-
- [Items]
- <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE>
- <SvxFmtBreakItem><SID_ATTR_PARA_PAGEBREAK>
- <SvxFmtSplitItem><SID_ATTR_PARA_SPLIT>
- <SvxWidowsItem><SID_ATTR_PARA_WIDOWS>
- <SvxOrphansItem><SID_ATTR_PARA_ORPHANS>
-*/
-
-class SvxExtParagraphTabPage: public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
-public:
- virtual ~SvxExtParagraphTabPage();
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void DisablePageBreak();
-
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-private:
- SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
-
- // Silbentrennung
- TriStateBox aHyphenBox;
- FixedText aBeforeText;
- NumericField aExtHyphenBeforeBox;
-// FixedText aHyphenBeforeLabel;
- FixedText aAfterText;
- NumericField aExtHyphenAfterBox;
-// FixedText aHyphenAfterLabel;
- FixedText aMaxHyphenLabel;
- NumericField aMaxHyphenEdit;
- FixedLine aExtFL;
-
- // Seitenumbruch
- FixedLine aBreaksFL;
- TriStateBox aPageBreakBox;
- FixedText aBreakTypeFT;
- ListBox aBreakTypeLB;
- FixedText aBreakPositionFT;
- ListBox aBreakPositionLB;
- TriStateBox aApplyCollBtn;
- ListBox aApplyCollBox;
- FixedText aPagenumText;
- NumericField aPagenumEdit;
-
- FixedLine aExtendFL;
-
- // Absatzteilung
- TriStateBox aKeepTogetherBox;
- TriStateBox aKeepParaBox;
-
- // Witwen/Waisen
- TriStateBox aOrphanBox;
- NumericField aOrphanRowNo;
- FixedText aOrphanRowLabel;
-
- TriStateBox aWidowBox;
- NumericField aWidowRowNo;
- FixedText aWidowRowLabel;
-
- BOOL bPageBreak;
- BOOL bHtmlMode;
- USHORT nStdPos;
-
-#ifdef _SVX_PARAGRPH_CXX
- DECL_LINK( PageBreakHdl_Impl, TriStateBox* );
- DECL_LINK( KeepTogetherHdl_Impl, TriStateBox* );
- DECL_LINK( WidowHdl_Impl, TriStateBox* );
- DECL_LINK( OrphanHdl_Impl, TriStateBox* );
- DECL_LINK( HyphenClickHdl_Impl, TriStateBox* );
- DECL_LINK( ApplyCollClickHdl_Impl, TriStateBox* );
- DECL_LINK( PageBreakPosHdl_Impl, ListBox* );
- DECL_LINK( PageBreakTypeHdl_Impl, ListBox* );
-#endif
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-/* -----------------------------29.11.00 11:33--------------------------------
-
- ---------------------------------------------------------------------------*/
-class SvxAsianTabPage : public SfxTabPage
-{
- FixedLine aOptionsFL;
-
- TriStateBox aForbiddenRulesCB;
- TriStateBox aHangingPunctCB;
-
- TriStateBox aScriptSpaceCB;
-
- SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet );
-
-#ifdef _SVX_PARAGRPH_CXX
- DECL_LINK( ClickHdl_Impl, TriStateBox* );
-#endif
-public:
- ~SvxAsianTabPage();
-
-
- static SfxTabPage* Create( Window* pParent,
- const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
-};
-
-#endif // #ifndef _SVX_PARAGRPH_HXX
-
-
diff --git a/svx/source/cui/paragrph.src b/svx/source/cui/paragrph.src
deleted file mode 100644
index 51320cb820..0000000000
--- a/svx/source/cui/paragrph.src
+++ /dev/null
@@ -1,734 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: paragrph.src,v $
- * $Revision: 1.85 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "paragrph.hrc"
-
- // RID_SVXPAGE_STD_PARAGRAPH ---------------------------------------------
-TabPage RID_SVXPAGE_STD_PARAGRAPH
-{
- HelpId = HID_FORMAT_PARAGRAPH_STD ;
- Hide = TRUE ;
- Text [ en-US ] = "Indents and Spacing" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedText FT_LEFTINDENT
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Before text" ;
- };
- MetricField ED_LEFTINDENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 135 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_RIGHTINDENT
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "After text" ;
- };
- MetricField ED_RIGHTINDENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 135 , 30 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_FLINEINDENT
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "~First line" ;
- Left = TRUE ;
- };
- MetricField ED_FLINEINDENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 135 , 46 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = -9999 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- CheckBox CB_AUTO
- {
- Pos = MAP_APPFONT ( 12 , 61 ) ;
- Size = MAP_APPFONT ( 120 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "~Automatic" ;
- };
- FixedLine FL_INDENT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Text [ en-US ] = "Indent" ;
- };
- FixedText FT_TOPDIST
- {
- Pos = MAP_APPFONT ( 12 , 90 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Ab~ove paragraph" ;
- };
- MetricField ED_TOPDIST
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 135 , 88 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_BOTTOMDIST
- {
- Pos = MAP_APPFONT ( 12 , 104 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Below paragraph" ;
- };
- MetricField ED_BOTTOMDIST
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 135 , 104 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedLine FL_DIST
- {
- Pos = MAP_APPFONT ( 6 , 77 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Text [ en-US ] = "Spacing" ;
- };
- ListBox LB_LINEDIST
- {
- Pos = MAP_APPFONT ( 12 , 133 ) ;
- Size = MAP_APPFONT ( 55 , 72 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Single" ; Default ; > ;
- < "1.5 lines" ; Default ; > ;
- < "Double" ; Default ; > ;
- < "Proportional" ; Default ; > ;
- < "At least" ; Default ; > ;
- < "Leading" ; Default ; > ;
- };
- };
- String ST_LINEDIST_ABS
- {
- Text [ en-US ] = "Fixed" ;
- };
- FixedText FT_LINEDIST
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 70 , 135 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "of" ;
- Left = TRUE ;
- };
- MetricField ED_LINEDISTPERCENT
- {
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 135 , 133 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 50 ;
- Maximum = 200 ;
- Value = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- First = 50 ;
- Last = 200 ;
- SpinSize = 1 ;
- };
- MetricField ED_LINEDISTMETRIC
- {
- Disable = TRUE ;
- Border = TRUE ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 135 , 133 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedLine FL_LINEDIST
- {
- Pos = MAP_APPFONT ( 6 , 122 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Text [ en-US ] = "Line spacing" ;
- };
- Window WN_EXAMPLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 185 , 7 ) ;
- Size = MAP_APPFONT ( 68 , 112 ) ;
- };
- CheckBox CB_REGISTER
- {
- Pos = MAP_APPFONT ( 12 , 162 ) ;
- Size = MAP_APPFONT ( 120 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "A~ctivate" ;
- };
- FixedLine FL_REGISTER
- {
- Pos = MAP_APPFONT ( 6 , 151 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Register-true" ;
- };
-
-};
- // RID_SVXPAGE_ALIGN_PARAGRAPH ---------------------------------------------
-TabPage RID_SVXPAGE_ALIGN_PARAGRAPH
-{
- HelpId = HID_FORMAT_PARAGRAPH_ALIGN ;
- Hide = TRUE ;
- Text [ en-US ] = "Alignment" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_ALIGN
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Text [ en-US ] = "Options" ;
- Group = TRUE ;
- };
- RadioButton BTN_LEFTALIGN
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 161 , 10 ) ;
- Text [ en-US ] = "~Left" ;
- Group = TRUE ;
- };
- RadioButton BTN_RIGHTALIGN
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 161 , 10 ) ;
- Text [ en-US ] = "Righ~t" ;
- };
- RadioButton BTN_CENTERALIGN
- {
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 161 , 10 ) ;
- Text [ en-US ] = "~Center" ;
- };
- RadioButton BTN_JUSTIFYALIGN
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 161 , 10 ) ;
- Text [ en-US ] = "Justified" ;
- };
- String ST_LEFTALIGN_ASIAN
- {
- Text [ en-US ] = "~Left/Top" ;
- };
- String ST_RIGHTALIGN_ASIAN
- {
- Text [ en-US ] = "Righ~t/Bottom" ;
- };
- FixedText FT_LASTLINE
- {
- Pos = MAP_APPFONT ( 20 , 72 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "~Last line" ;
- };
- ListBox LB_LASTLINE
- {
- Pos = MAP_APPFONT ( 105 , 70 ) ;
- Size = MAP_APPFONT ( 70 , 50 ) ;
- DropDown = TRUE ;
- Hide = TRUE ;
- StringList [ en-US ] =
- {
- < "Default" ; Default ; > ;
- < "Left" ; Default ; > ;
- < "Centered" ; Default ; > ;
- < "Justified"; Default; > ;
- };
- };
- CheckBox CB_EXPAND
- {
- Pos = MAP_APPFONT ( 20 , 86 ) ;
- Size = MAP_APPFONT ( 153 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "~Expand single word" ;
- };
- CheckBox CB_SNAP
- {
- Pos = MAP_APPFONT ( 20 , 100 ) ;
- Size = MAP_APPFONT ( 153 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Snap to text grid (if active)";
- };
- Window WN_EXAMPLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 185 , 7 ) ;
- Size = MAP_APPFONT ( 68 , 112 ) ;
- };
- FixedLine FL_VERTALIGN
- {
- Pos = MAP_APPFONT ( 6 , 122 ) ;
- Size = MAP_APPFONT ( 173 , 8 ) ;
- Hide = TRUE;
- Text [ en-US ] = "Text-to-text";
- };
- FixedText FT_VERTALIGN
- {
- Pos = MAP_APPFONT ( 12 , 135 ) ;
- Size = MAP_APPFONT ( 90 , 8 ) ;
- Hide = TRUE;
- Text [ en-US ] = "~Alignment";
- };
- ListBox LB_VERTALIGN
- {
- Pos = MAP_APPFONT ( 105 , 133 ) ;
- Size = MAP_APPFONT ( 70 , 50 ) ;
- DropDown = TRUE ;
- Hide = TRUE ;
- StringList [ en-US ] =
- {
- < "Automatic" ; > ;
- < "Base line" ; > ;
- < "Top" ; > ;
- < "Middle" ; > ;
- < "Bottom" ; > ;
- };
- };
- FixedLine FL_PROPERTIES
- {
- Pos = MAP_APPFONT ( 6 , 154 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Properties";
- };
- FixedText FT_TEXTDIRECTION
- {
- Pos = MAP_APPFONT ( 12 , 167 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Text ~direction";
- };
- ListBox LB_TEXTDIRECTION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 105 , 165 ) ;
- Size = MAP_APPFONT ( 146 , 50 ) ;
- DropDown = TRUE ;
- Hide = TRUE ;
- };
-};
- // RID_SVXPAGE_EXT_PARAGRAPH ---------------------------------------------
-TabPage RID_SVXPAGE_EXT_PARAGRAPH
-{
- HelpId = HID_FORMAT_PARAGRAPH_EXT ;
- Hide = TRUE ;
- Text [ en-US ] = "Text Flow" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- TriStateBox BTN_HYPHEN
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "A~utomatically" ;
- };
- NumericField ED_HYPHENBEFORE
- {
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 21 , 26 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 2 ;
- Maximum = 9 ;
- Value = 2 ;
- First = 2 ;
- Last = 9 ;
- };
- FixedText FT_HYPHENBEFORE
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 48 , 29 ) ;
- Size = MAP_APPFONT ( 200 , 8 ) ;
- Text [ en-US ] = "C~haracters at line end" ;
- Left = TRUE ;
- };
- NumericField ED_HYPHENAFTER
- {
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 21 , 41 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 2 ;
- Maximum = 9 ;
- Value = 2 ;
- First = 2 ;
- Last = 9 ;
- };
- FixedText FT_HYPHENAFTER
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 48 , 43 ) ;
- Size = MAP_APPFONT ( 200 , 8 ) ;
- Text [ en-US ] = "Cha~racters at line begin" ;
- Left = TRUE ;
- };
- FixedText FT_MAXHYPH
- {
- Pos = MAP_APPFONT ( 48 , 57 ) ;
- Size = MAP_APPFONT ( 200 , 8 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "~Maximum number of consecutive hyphens" ;
- };
- NumericField ED_MAXHYPH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 21 , 55 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 99 ;
- Last = 99 ;
- };
- FixedLine FL_HYPHEN
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Hyphenation" ;
- };
- FixedLine FL_OPTIONS
- { // is moved one section deeper to not raise unnecessary translations
- Pos = MAP_APPFONT ( 6 , 116 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Options" ;
- Group = TRUE ;
- };
- FixedLine FL_BREAKS
- {
- Pos = MAP_APPFONT ( 6 , 73 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Breaks" ;
- Group = TRUE ;
- };
- TriStateBox BTN_PAGEBREAK
- {
- // Disable = TRUE;
- Pos = MAP_APPFONT ( 12 , 86 ) ;
- Size = MAP_APPFONT ( 61 , 10 ) ;
- Text [ en-US ] = "Insert" ;
- Group = TRUE ;
- };
- FixedText FT_BREAKTYPE
- {
- Pos = MAP_APPFONT ( 75 , 86 ) ;
- Size = MAP_APPFONT ( 21 , 10 ) ;
- Text [ en-US ] = "~Type";
- };
- ListBox LB_BREAKTYPE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 98 , 84 ) ;
- Size = MAP_APPFONT ( 61 , 50 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Page" ; 0; > ;
- < "Column" ; 1; > ;
- };
- };
- FixedText FT_BREAKPOSITION
- {
- Pos = MAP_APPFONT ( 163 , 86 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Right = TRUE;
- Text [ en-US ] = "Position";
- };
- ListBox LB_BREAKPOSITION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 211 , 84 ) ;
- Size = MAP_APPFONT ( 40 , 50 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Before" ; 0; > ;
- < "After" ; 1; > ;
- };
- };
- TriStateBox BTN_PAGECOLL
- {
- // Disable = TRUE;
- Pos = MAP_APPFONT (21 , 100 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "With Page St~yle" ;
- Group = TRUE ;
- };
- ListBox LB_PAGECOLL
- {
- // Disable = TRUE;
- Pos = MAP_APPFONT ( 98 , 98 ) ;
- Size = MAP_APPFONT ( 61 , 50 ) ;
- DropDown = TRUE ;
- Sort = TRUE;
- };
- FixedText FT_PAGENUM
- {
- Pos = MAP_APPFONT ( 163 , 100 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Right = TRUE ;
- Text [ en-US ] = "Page ~number" ;
- };
- NumericField ED_PAGENUM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 211 , 98 ) ;
- Size = MAP_APPFONT ( 26 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 9999 ;
- Value = 0 ;
- First = 0 ;
- Last = 9999 ;
- };
- TriStateBox BTN_KEEPTOGETHER
- {
- Pos = MAP_APPFONT ( 12 , 127 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "~Do not split paragraph" ;
- Group = TRUE ;
- };
- TriStateBox CB_KEEPTOGETHER
- {
- Pos = MAP_APPFONT ( 12, 141 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "~Keep with next paragraph" ;
- };
- TriStateBox BTN_ORPHANS
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 12 , 155 ) ;
- Size = MAP_APPFONT ( 120 , 10 ) ;
- Group = TRUE ;
- Text [ en-US ] = "~Orphan control";
- };
- NumericField ED_ORPHANS
- {
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 134 , 153 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 2 ;
- Maximum = 9 ;
- Value = 2 ;
- First = 2 ;
- Last = 9 ;
- };
- FixedText FT_ORPHANS
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 161 , 155 ) ;
- Size = MAP_APPFONT ( 86 , 8 ) ;
- Text [ en-US ] = "Lines" ;
- Left = TRUE ;
- };
- TriStateBox BTN_WIDOWS
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 12 , 169 ) ;
- Size = MAP_APPFONT ( 120 , 10 ) ;
- Group = TRUE ;
- Text [ en-US ] = "~Widow control";
- };
- NumericField ED_WIDOWS
- {
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 134 , 167 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 2 ;
- Maximum = 9 ;
- Value = 2 ;
- First = 2 ;
- Last = 9 ;
- };
- FixedText FT_WIDOWS
- {
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 161 , 169 ) ;
- Size = MAP_APPFONT ( 86 , 8 ) ;
- Text [ en-US ] = "Lines" ;
- Left = TRUE ;
- };
-};
-/*-- 29.11.00 11:36:24---------------------------------------------------
- Asian typography
- -----------------------------------------------------------------------*/
-TabPage RID_SVXPAGE_PARA_ASIAN
-{
- HelpId = HID_SVXPAGE_PARA_ASIAN ;
- Hide = TRUE ;
- Text [ en-US ] = "Asian Typography";
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_AS_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Line change";
- };
- TriStateBox CB_AS_FORBIDDEN
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "Apply list of forbidden characters to the beginning and end of lines";
- };
- TriStateBox CB_AS_HANG_PUNC
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "Allow hanging punctuation";
- };
- TriStateBox CB_AS_SCRIPT_SPACE
- {
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "Apply spacing between Asian, Latin and Complex text";
- };
-};
-
-// ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/pastedlg.cxx b/svx/source/cui/pastedlg.cxx
deleted file mode 100644
index f664f2024f..0000000000
--- a/svx/source/cui/pastedlg.cxx
+++ /dev/null
@@ -1,314 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: pastedlg.cxx,v $
- * $Revision: 1.11 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <com/sun/star/embed/Aspects.hpp>
-
-#include <pastedlg.hxx>
-#include <svtools/svmedit.hxx>
-#include <svtools/insdlg.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include "svuidlg.hrc"
-#include <sot/formats.hxx>
-#include <sot/stg.hxx>
-#include <svtools/sores.hxx>
-#include <vcl/svapp.hxx>
-
-#include <svx/dialmgr.hxx>
-
-SvPasteObjectDialog::SvPasteObjectDialog( Window* pParent )
-
- : ModalDialog( pParent, SVX_RES( MD_PASTE_OBJECT ) ),
- aFtSource( this, SVX_RES( FT_SOURCE ) ),
- aFtObjectSource( this, SVX_RES( FT_OBJECT_SOURCE ) ),
- aRbPaste( this, SVX_RES( RB_PASTE ) ),
- aRbPasteLink( this, SVX_RES( RB_PASTE_LINK ) ),
- aLbInsertList( this, SVX_RES( LB_INSERT_LIST ) ),
- aCbDisplayAsIcon( this, SVX_RES( CB_DISPLAY_AS_ICON ) ),
- aPbChangeIcon( this, SVX_RES( PB_CHANGE_ICON ) ),
- aFlChoice( this, SVX_RES( FL_CHOICE ) ),
- aOKButton1( this, SVX_RES( 1 ) ),
- aCancelButton1( this, SVX_RES( 1 ) ),
- aHelpButton1( this, SVX_RES( 1 ) ),
- aSObject( SVX_RES( S_OBJECT ) )
-{
- FreeResource();
- SetHelpId( HID_PASTE_DLG );
- SetUniqueId( HID_PASTE_DLG );
-
- Font aFont = aFtObjectSource.GetFont();
- aFont.SetWeight( WEIGHT_LIGHT );
- aFtObjectSource.SetFont( aFont );
- aOKButton1.Disable();
-
- ObjectLB().SetSelectHdl( LINK( this, SvPasteObjectDialog, SelectHdl ) );
- ObjectLB().SetDoubleClickHdl( LINK( this, SvPasteObjectDialog, DoubleClickHdl ) );
- SetDefault();
-}
-
-void SvPasteObjectDialog::SelectObject()
-{
- if ( aLbInsertList.GetEntryCount() &&
- !aRbPaste.IsVisible() && !aRbPasteLink.IsVisible() )
- {
- aLbInsertList.SelectEntryPos(0);
- SelectHdl( &aLbInsertList );
- }
-}
-
-IMPL_LINK( SvPasteObjectDialog, SelectHdl, ListBox *, pListBox )
-{
- (void)pListBox;
-
- if ( !aOKButton1.IsEnabled() )
- aOKButton1.Enable();
- return 0;
-}
-
-IMPL_LINK_INLINE_START( SvPasteObjectDialog, DoubleClickHdl, ListBox *, pListBox )
-{
- (void)pListBox;
-
- EndDialog( RET_OK );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvPasteObjectDialog, DoubleClickHdl, ListBox *, pListBox )
-
-void SvPasteObjectDialog::SetDefault()
-{
- bLink = FALSE;
- nAspect = (USHORT)::com::sun::star::embed::Aspects::MSOLE_CONTENT;
-}
-
-SvPasteObjectDialog::~SvPasteObjectDialog()
-{
- void * pStr = aSupplementTable.First();
- while( pStr )
- {
- delete (String *)pStr;
- pStr = aSupplementTable.Next();
- }
-}
-
-/*************************************************************************
-|* SvPasteObjectDialog::Insert()
-|*
-|* Beschreibung
-|* Ersterstellung MM 14.06.94
-|* Letzte Aenderung KA 16.03.2001
-*************************************************************************/
-void SvPasteObjectDialog::Insert( SotFormatStringId nFormat, const String& rFormatName )
-{
- String * pStr = new String( rFormatName );
- if( !aSupplementTable.Insert( nFormat, pStr ) )
- delete pStr;
-}
-
-ULONG SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
- const DataFlavorExVector* pFormats,
- const TransferableObjectDescriptor* )
-{
- //TODO/LATER: why is the Descriptor never used?!
- TransferableObjectDescriptor aDesc;
- if( rHelper.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) )
- ((TransferableDataHelper&)rHelper).GetTransferableObjectDescriptor(
- SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aDesc );
- if ( !pFormats )
- pFormats = &rHelper.GetDataFlavorExVector();
-
- //Dialogbox erzeugen und fuellen
- String aSourceName, aTypeName;
- ULONG nSelFormat = 0;
- SvGlobalName aEmptyNm;
-
- ObjectLB().SetUpdateMode( FALSE );
-
- DataFlavorExVector::iterator aIter( ((DataFlavorExVector&)*pFormats).begin() ),
- aEnd( ((DataFlavorExVector&)*pFormats).end() );
- while( aIter != aEnd )
- {
- ::com::sun::star::datatransfer::DataFlavor aFlavor( *aIter );
- SotFormatStringId nFormat = (*aIter++).mnSotId;
-
- String* pName = (String*) aSupplementTable.Get( nFormat );
- String aName;
-
-#ifdef WNT
-/*
- if( !pName &&
- ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE_OLE || nFormat == SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ) )
- {
- BOOL IsClipboardObject_Impl( SotDataObject * );
- if( IsClipboardObject_Impl( pDataObj ) )
- {
- IDataObject * pDO = NULL;
- OleGetClipboard( &pDO );
- if( pDO )
- {
- FORMATETC fe;
- STGMEDIUM stm;
- (fe).cfFormat=RegisterClipboardFormat( "Object Descriptor" );
- (fe).dwAspect=DVASPECT_CONTENT;
- (fe).ptd=NULL;
- (fe).tymed=TYMED_HGLOBAL;
- (fe).lindex=-1;
-
- if (SUCCEEDED(pDO->GetData(&fe, &stm)))
- {
- LPOBJECTDESCRIPTOR pOD=(LPOBJECTDESCRIPTOR)GlobalLock(stm.hGlobal);
- if( pOD->dwFullUserTypeName )
- {
- OLECHAR * pN = (OLECHAR *)(((BYTE *)pOD) + pOD->dwFullUserTypeName);
- aName.Append( pN );
- pName = &aName;
- // set format to ole object
- nFormat = SOT_FORMATSTR_ID_EMBED_SOURCE_OLE;
- }
- if( pOD->dwSrcOfCopy )
- {
- OLECHAR * pN = (OLECHAR *)(((BYTE *)pOD) + pOD->dwSrcOfCopy);
- aSourceName.Append( *pN++ );
- }
- else
- aSourceName = String( ResId( STR_UNKNOWN_SOURCE, SOAPP->GetResMgr() ) );
- GlobalUnlock(stm.hGlobal);
- ReleaseStgMedium(&stm);
- }
- }
- }
- }
-*/
-#endif
-
- // if there is an "Embed Source" or and "Embedded Object" on the
- // Clipboard we read the Description and the Source of this object
- // from an accompanied "Object Descriptor" format on the clipboard
- // Remember: these formats mostly appear together on the clipboard
- if ( !pName )
- {
- SvPasteObjectHelper::GetEmbeddedName(rHelper,aName,aSourceName,nFormat);
- if ( aName.Len() )
- pName = &aName;
- }
-
-
- if( pName )
- {
- aName = *pName;
-
- if( SOT_FORMATSTR_ID_EMBED_SOURCE == nFormat )
- {
- if( aDesc.maClassName != aEmptyNm ) {
- aSourceName = aDesc.maDisplayName;
-
- if( aDesc.maClassName == aObjClassName )
- aName = aObjName;
- else
- aName = aTypeName = aDesc.maTypeName;
- }
- }
- else if( SOT_FORMATSTR_ID_LINK_SOURCE == nFormat )
- {
- PasteLink().Enable();
- continue;
- }
- else if( !aName.Len() )
- aName = SvPasteObjectHelper::GetSotFormatUIName( nFormat );
-
- if( LISTBOX_ENTRY_NOTFOUND == ObjectLB().GetEntryPos( aName ) )
- ObjectLB().SetEntryData(
- ObjectLB().InsertEntry( aName ), (void*) nFormat );
- }
- }
-
- if( !aTypeName.Len() && !aSourceName.Len() )
- {
- if( aDesc.maClassName != aEmptyNm )
- {
- aSourceName = aDesc.maDisplayName;
- aTypeName = aDesc.maTypeName;
- }
-
- if( !aTypeName.Len() && !aSourceName.Len() )
- {
- com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- ResMgr* pMgr = ResMgr::CreateResMgr( "svt", aLocale );
- // global resource from svtools (former so3 resource)
- if( pMgr )
- aSourceName = String( ResId( STR_UNKNOWN_SOURCE, *pMgr ) );
- delete pMgr;
- }
- }
-
- ObjectLB().SetUpdateMode( TRUE );
- SelectObject();
-
- if( aSourceName.Len() )
- {
- if( aTypeName.Len() )
- aTypeName += '\n';
-
- aTypeName += aSourceName;
- aTypeName.ConvertLineEnd();
- }
-
- ObjectSource().SetText( aTypeName );
-
- SetDefault();
-
- if( Dialog::Execute() == RET_OK )
- {
- bLink = PasteLink().IsChecked();
-
- if( AsIconBox().IsChecked() )
- nAspect = (USHORT)com::sun::star::embed::Aspects::MSOLE_ICON;
-
- nSelFormat = (ULONG)ObjectLB().GetEntryData( ObjectLB().GetSelectEntryPos() );
- }
-
- return nSelFormat;
-}
-
-void SvPasteObjectDialog::SetObjName( const SvGlobalName & rClass, const String & rObjName )
-{
- aObjClassName = rClass;
- aObjName = rObjName;
-}
-
diff --git a/svx/source/cui/pastedlg.hxx b/svx/source/cui/pastedlg.hxx
deleted file mode 100644
index 443807d86e..0000000000
--- a/svx/source/cui/pastedlg.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: pastedlg.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _PASTEDLG_HXX
-#define _PASTEDLG_HXX
-
-#ifndef _TABLE_HXX //autogen
-#include <tools/table.hxx>
-#endif
-#include <sot/formats.hxx>
-#include <tools/globname.hxx>
-#include <svtools/transfer.hxx>
-
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
-
-/********************** SvPasteObjectDialog ******************************
-*************************************************************************/
-
-struct TransferableObjectDescriptor;
-class DataFlavorExVecor;
-class TransferableDataHelper;
-
-class SvPasteObjectDialog : public ModalDialog
-{
- FixedText aFtSource;
- FixedText aFtObjectSource;
- RadioButton aRbPaste;
- RadioButton aRbPasteLink;
- ListBox aLbInsertList;
- CheckBox aCbDisplayAsIcon;
- PushButton aPbChangeIcon;
- FixedLine aFlChoice;
- OKButton aOKButton1;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- String aSObject;
- Table aSupplementTable;
- SvGlobalName aObjClassName;
- String aObjName;
- USHORT nAspect;
- BOOL bLink;
-
- ListBox& ObjectLB() { return aLbInsertList; }
- FixedText& ObjectSource() { return aFtObjectSource; }
- RadioButton& PasteLink() { return aRbPasteLink; }
- CheckBox& AsIconBox() { return aCbDisplayAsIcon; }
-
- const String& GetObjString() { return aSObject; }
- void SelectObject();
- DECL_LINK( SelectHdl, ListBox * );
- DECL_LINK( DoubleClickHdl, ListBox * );
- void SetDefault();
- USHORT GetAspect() const { return nAspect; }
- BOOL ShouldLink() const { return bLink; }
-
-public:
- SvPasteObjectDialog( Window* pParent );
- ~SvPasteObjectDialog();
-
- void Insert( SotFormatStringId nFormat, const String & rFormatName );
- void SetObjName( const SvGlobalName & rClass, const String & rObjName );
- ULONG GetFormat( const TransferableDataHelper& aHelper,
- const DataFlavorExVector* pFormats=0,
- const TransferableObjectDescriptor* pDesc=0 );
-};
-
-#endif // _PASTEDLG_HXX
diff --git a/svx/source/cui/plfilter.cxx b/svx/source/cui/plfilter.cxx
deleted file mode 100644
index 2c8b4c86bf..0000000000
--- a/svx/source/cui/plfilter.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: plfilter.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <set>
-#include <map>
-#include <unotools/processfactory.hxx>
-
-#include <tools/debug.hxx>
-#include <vcl/stdtext.hxx>
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/plugin/PluginDescription.hpp>
-#include <com/sun/star/plugin/XPluginManager.hpp>
-
-using namespace std;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::plugin;
-
-struct ltstr
-{
- bool operator()( const String& s1, const String& s2 ) const
- {
- return ( s1.CompareTo( s2 ) == COMPARE_LESS );
- }
-};
-
-typedef set< String, ltstr > StrSet;
-typedef map< String, StrSet, ltstr > FilterMap;
-
-
-//==================================================================================================
-void fillNetscapePluginFilters( Sequence< rtl::OUString >& rPluginNames, Sequence< rtl::OUString >& rPluginTypes )
-{
- Reference< XMultiServiceFactory > xMan( ::utl::getProcessServiceFactory() );
- Reference< XPluginManager > xPMgr( xMan->createInstance(
- rtl::OUString::createFromAscii("com.sun.star.plugin.PluginManager") ), UNO_QUERY );
-
- if ( xPMgr.is() )
- {
- FilterMap aMap;
-
- // mimetypes zusammenfassen: eine description, mehrere extensions
-
- Sequence<PluginDescription > aDescriptions( xPMgr->getPluginDescriptions() );
- const PluginDescription * pDescriptions = aDescriptions.getConstArray();
- for ( UINT32 nPos = aDescriptions.getLength(); nPos--; )
- {
- const PluginDescription & rDescr = pDescriptions[nPos];
-
- StrSet& rTypes = aMap[ rDescr.Description ];
- String aExtension( rDescr.Extension );
-
- for ( USHORT nCnt = aExtension.GetTokenCount( ';' ); nCnt--; )
- {
- // no default plugins anymore
- String aExt( aExtension.GetToken( nCnt, ';' ) );
- if ( aExt.CompareToAscii( "*.*" ) != COMPARE_EQUAL )
- rTypes.insert( aExt );
- }
- }
-
- rPluginNames = Sequence< rtl::OUString >( aMap.size() );
- rPluginTypes = Sequence< rtl::OUString >( aMap.size() );
- rtl::OUString* pPluginNames = rPluginNames.getArray();
- rtl::OUString* pPluginTypes = rPluginTypes.getArray();
- int nIndex = 0;
- for ( FilterMap::iterator iPos = aMap.begin(); iPos != aMap.end(); ++iPos )
- {
- String aText( (*iPos).first );
- String aType;
- StrSet& rTypes = (*iPos).second;
- StrSet::iterator i = rTypes.begin();
- while ( i != rTypes.end() )
- {
- aType += (*i);
- ++i;
- if ( i != rTypes.end() )
- aType += ';';
- }
-
- if ( aType.Len() )
- {
- aText += String::CreateFromAscii( " (" );
- aText += aType;
- aText += ')';
- pPluginNames[nIndex] = aText;
- pPluginTypes[nIndex] = aType;
- nIndex++;
- }
- }
- rPluginNames.realloc( nIndex );
- rPluginTypes.realloc( nIndex );
- }
- else
- ShowServiceNotAvailableError( NULL,
- String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.plugin.PluginManager" ) ), TRUE );
-}
-
diff --git a/svx/source/cui/postdlg.cxx b/svx/source/cui/postdlg.cxx
deleted file mode 100644
index 24545df391..0000000000
--- a/svx/source/cui/postdlg.cxx
+++ /dev/null
@@ -1,273 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: postdlg.cxx,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/date.hxx>
-#include <tools/time.hxx>
-#include <vcl/svapp.hxx>
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/useroptions.hxx>
-#include <unotools/localedatawrapper.hxx>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-
-#define _SVX_POSTDLG_CXX
-
-#include <svx/dialogs.hrc>
-#include "postdlg.hrc"
-
-
-
-
-
-#include "postattr.hxx"
-#include "postdlg.hxx"
-#include <svx/dialmgr.hxx>
-
-#include "helpid.hrc"
-
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_ATTR_POSTIT_AUTHOR,
- SID_ATTR_POSTIT_TEXT,
- 0
-};
-
-// class SvxPostItDialog -------------------------------------------------
-
-SvxPostItDialog::SvxPostItDialog( Window* pParent,
- const SfxItemSet& rCoreSet,
- BOOL bPrevNext,
- BOOL bRedline ) :
-
- SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_POSTIT ) ),
-
- aPostItFL ( this, SVX_RES( FL_POSTIT ) ),
- aLastEditLabelFT( this, SVX_RES( FT_LASTEDITLABEL ) ),
- aLastEditFT ( this, SVX_RES( FT_LASTEDIT ) ),
- aEditFT ( this, SVX_RES( FT_EDIT ) ),
- aEditED ( this, SVX_RES( ED_EDIT ) ),
- aAuthorFT ( this, SVX_RES( FT_AUTHOR) ),
- aAuthorBtn ( this, SVX_RES( BTN_AUTHOR ) ),
- aOKBtn ( this, SVX_RES( BTN_POST_OK ) ),
- aCancelBtn ( this, SVX_RES( BTN_POST_CANCEL ) ),
- aHelpBtn ( this, SVX_RES( BTN_POST_HELP ) ),
- aPrevBtn ( this, SVX_RES( BTN_PREV ) ),
- aNextBtn ( this, SVX_RES( BTN_NEXT ) ),
-
- rSet ( rCoreSet ),
- pOutSet ( 0 )
-
-{
- if (bRedline) // HelpIDs fuer Redlining
- {
- SetHelpId(HID_REDLINING_DLG);
- aEditED.SetHelpId(HID_REDLINING_EDIT);
- aPrevBtn.SetHelpId(HID_REDLINING_PREV);
- aNextBtn.SetHelpId(HID_REDLINING_NEXT);
- }
-
- aPrevBtn.SetClickHdl( LINK( this, SvxPostItDialog, PrevHdl ) );
- aNextBtn.SetClickHdl( LINK( this, SvxPostItDialog, NextHdl ) );
- aAuthorBtn.SetClickHdl( LINK( this, SvxPostItDialog, Stamp ) );
- aOKBtn.SetClickHdl( LINK( this, SvxPostItDialog, OKHdl ) );
-
- Font aFont( aEditED.GetFont() );
- aFont.SetWeight( WEIGHT_LIGHT );
- aEditED.SetFont( aFont );
-
- BOOL bNew = TRUE;
- USHORT nWhich = 0;
-
- if ( !bPrevNext )
- {
- aPrevBtn.Hide();
- aNextBtn.Hide();
- }
-
- nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR );
- String aAuthorStr, aDateStr, aTextStr;
-
- if ( rSet.GetItemState( nWhich, TRUE ) >= SFX_ITEM_AVAILABLE )
- {
- bNew = FALSE;
- const SvxPostItAuthorItem& rAuthor =
- (const SvxPostItAuthorItem&)rSet.Get( nWhich );
- aAuthorStr = rAuthor.GetValue();
- }
- else
- aAuthorStr = SvtUserOptions().GetID();
-
- nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_DATE );
-
- if ( rSet.GetItemState( nWhich, TRUE ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxPostItDateItem& rDate =
- (const SvxPostItDateItem&)rSet.Get( nWhich );
- aDateStr = rDate.GetValue();
- }
- else
- {
- LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- aDateStr = aLocaleWrapper.getDate( Date() );
- }
-
- nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT );
-
- if ( rSet.GetItemState( nWhich, TRUE ) >= SFX_ITEM_AVAILABLE )
- {
- const SvxPostItTextItem& rText =
- (const SvxPostItTextItem&)rSet.Get( nWhich );
- aTextStr = rText.GetValue();
- }
-
- ShowLastAuthor(aAuthorStr, aDateStr);
- aEditED.SetText( aTextStr.ConvertLineEnd() );
-
- if ( !bNew )
- SetText( SVX_RESSTR( STR_NOTIZ_EDIT ) );
- else
- // neu anlegen
- SetText( SVX_RESSTR( STR_NOTIZ_INSERT ) );
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxPostItDialog::~SvxPostItDialog()
-{
- delete pOutSet;
- pOutSet = 0;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPostItDialog::ShowLastAuthor(const String& rAuthor, const String& rDate)
-{
- String sTxt( rAuthor );
- sTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
- sTxt += rDate;
- aLastEditFT.SetText( sTxt );
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxPostItDialog::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPostItDialog::EnableTravel(BOOL bNext, BOOL bPrev)
-{
- aPrevBtn.Enable(bPrev);
- aNextBtn.Enable(bNext);
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxPostItDialog, PrevHdl, Button *, EMPTYARG )
-{
- aPrevHdlLink.Call( this );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxPostItDialog, PrevHdl, Button *, EMPTYARG )
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxPostItDialog, NextHdl, Button *, EMPTYARG )
-{
- aNextHdlLink.Call( this );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxPostItDialog, NextHdl, Button *, EMPTYARG )
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPostItDialog, Stamp, Button *, EMPTYARG )
-{
- Date aDate;
- Time aTime;
- String aTmp( SvtUserOptions().GetID() );
- LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- String aStr( aEditED.GetText() );
- aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\n---- " ) );
-
- if ( aTmp.Len() > 0 )
- {
- aStr += aTmp;
- aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
- }
- aStr += aLocaleWrapper.getDate(aDate);
- aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
- aStr += aLocaleWrapper.getTime(aTime, FALSE, FALSE);
- aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " ----\n" ) );
-
-
- aEditED.SetText( aStr.ConvertLineEnd() );
- xub_StrLen nLen = aStr.Len();
- aEditED.GrabFocus();
- aEditED.SetSelection( Selection( nLen, nLen ) );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxPostItDialog, OKHdl, Button *, EMPTYARG )
-{
- LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- pOutSet = new SfxItemSet( rSet );
- pOutSet->Put( SvxPostItAuthorItem( SvtUserOptions().GetID(),
- rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR ) ) );
- pOutSet->Put( SvxPostItDateItem( aLocaleWrapper.getDate( Date() ),
- rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_DATE ) ) );
- pOutSet->Put( SvxPostItTextItem( aEditED.GetText(),
- rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT ) ) );
- EndDialog( RET_OK );
- return 0;
-}
-
diff --git a/svx/source/cui/postdlg.hrc b/svx/source/cui/postdlg.hrc
deleted file mode 100644
index 3036fe1870..0000000000
--- a/svx/source/cui/postdlg.hrc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: postdlg.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_POSTDLG_HRC
-#define _SVX_POSTDLG_HRC
-
-// defines ------------------------------------------------------------------
-
-#define FT_LASTEDITLABEL 10
-#define FT_LASTEDIT 11
-#define FT_EDIT 12
-#define ED_EDIT 13
-#define FL_POSTIT 14
-#define BTN_PREV 15
-#define BTN_NEXT 16
-#define BTN_AUTHOR 17
-#define FT_AUTHOR 18
-
-#define STR_NOTIZ_EDIT 20
-#define STR_NOTIZ_INSERT 21
-
-#define BTN_POST_OK 30
-#define BTN_POST_CANCEL 31
-#define BTN_POST_HELP 32
-
-
-#endif
-
diff --git a/svx/source/cui/postdlg.hxx b/svx/source/cui/postdlg.hxx
deleted file mode 100644
index 85e71d255c..0000000000
--- a/svx/source/cui/postdlg.hxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: postdlg.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_POSTDLG_HXX
-#define _SVX_POSTDLG_HXX
-
-// include ---------------------------------------------------------------
-
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-#ifndef _IMAGEBTN_HXX //autogen
-#include <vcl/imagebtn.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
-#include <svtools/stdctrl.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <svtools/svmedit.hxx>
-
-// class SvxPostItDialog -------------------------------------------------
-/*
- {k:\svx\prototyp\dialog\memo.bmp}
-
- [Beschreibung]
- In diesem Dialog kann eine Notiz erstellt oder bearbeitet werden. Wenn die
- Applikation eine Liste von Notizen haelt, kann mit Hilfe von Links, ueber
- diese Liste iteriert werden.
-
- [Items]
- <SvxPostitAuthorItem><SID_ATTR_POSTIT_AUTHOR>
- <SvxPostitDateItem><SID_ATTR_POSTIT_DATE>
- <SvxPostitTextItem><SID_ATTR_POSTIT_TEXT>
-*/
-
-class SvxPostItDialog : public SfxModalDialog
-{
-public:
- SvxPostItDialog( Window* pParent, const SfxItemSet& rCoreSet,
- BOOL bPrevNext = FALSE, BOOL bRedline = FALSE );
- ~SvxPostItDialog();
-
- static USHORT* GetRanges();
- const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
-
- Link GetPrevHdl() const { return aPrevHdlLink; }
- void SetPrevHdl( const Link& rLink )
- { aPrevHdlLink = rLink; }
- Link GetNextHdl() const { return aNextHdlLink; }
- void SetNextHdl( const Link& rLink )
- { aNextHdlLink = rLink; }
-
- void EnableTravel(BOOL bNext, BOOL bPrev);
- inline String GetNote() { return aEditED.GetText(); }
- inline void SetNote(const String& rTxt) { aEditED.SetText(rTxt); }
-
- void ShowLastAuthor(const String& rAuthor, const String& rDate);
- inline void DontChangeAuthor() { aAuthorBtn.Enable(FALSE); }
- inline void HideAuthor() { aAuthorBtn.Hide(); }
- inline void SetReadonlyPostIt(BOOL bDisable)
- {
- aOKBtn.Enable( !bDisable );
- aEditED.SetReadOnly( bDisable );
- aAuthorBtn.Enable( !bDisable );
- }
- inline BOOL IsOkEnabled() const { return aOKBtn.IsEnabled(); }
-
-private:
- FixedLine aPostItFL;
- FixedText aLastEditLabelFT;
- FixedInfo aLastEditFT;
-
- FixedText aEditFT;
- MultiLineEdit aEditED;
-
- FixedText aAuthorFT;
- PushButton aAuthorBtn;
-
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
- ImageButton aPrevBtn;
- ImageButton aNextBtn;
-
- const SfxItemSet& rSet;
- SfxItemSet* pOutSet;
-
- Link aPrevHdlLink;
- Link aNextHdlLink;
-
-#ifdef _SVX_POSTDLG_CXX
- DECL_LINK( Stamp, Button* );
- DECL_LINK( OKHdl, Button* );
- DECL_LINK( PrevHdl, Button* );
- DECL_LINK( NextHdl, Button* );
-#endif
-};
-
-
-#endif
-
diff --git a/svx/source/cui/postdlg.src b/svx/source/cui/postdlg.src
deleted file mode 100644
index 50536b34ec..0000000000
--- a/svx/source/cui/postdlg.src
+++ /dev/null
@@ -1,161 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: postdlg.src,v $
- * $Revision: 1.27 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/svxids.hrc>
-#include <svx/dialogs.hrc>
-#include "postdlg.hrc"
- // pragma ----------------------------------------------------------------
-
- // RID_SVXDLG_POSTIT -----------------------------------------------------
-ModalDialog RID_SVXDLG_POSTIT
-{
- HelpId = SID_POSTIT ;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 198 , 134 ) ;
- Text [ en-US ] = "Note" ;
- Moveable = TRUE ;
- FixedText FT_LASTEDITLABEL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 34 , 8 ) ;
- Text [ en-US ] = "Author" ;
- Left = TRUE ;
- };
- FixedText FT_LASTEDIT
- {
- Pos = MAP_APPFONT ( 48 , 14 ) ;
- Size = MAP_APPFONT ( 83 , 8 ) ;
- Left = TRUE ;
- };
- FixedText FT_EDIT
- {
- Pos = MAP_APPFONT ( 12 , 27 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "~Text" ;
- Left = TRUE ;
- };
- MultiLineEdit ED_EDIT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 38 ) ;
- Size = MAP_APPFONT ( 123 , 72 ) ;
- Left = TRUE ;
- VScroll = TRUE ;
- HScroll = TRUE ;
- IgnoreTab = TRUE ;
- };
- FixedLine FL_POSTIT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 129 , 8 ) ;
- Text [ en-US ] = "Contents" ;
- };
- OKButton BTN_POST_OK
- {
- Pos = MAP_APPFONT ( 141 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_POST_CANCEL
- {
- Pos = MAP_APPFONT ( 141 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- };
- HelpButton BTN_POST_HELP
- {
- Pos = MAP_APPFONT ( 141 , 40 ) ;
- Size = MAP_APPFONT ( 50 , 15 ) ;
- };
- ImageButton BTN_PREV
- {
- Pos = MAP_APPFONT ( 141 , 60 ) ;
- Size = MAP_APPFONT ( 24 , 14 ) ;
- Symbol = IMAGEBUTTON_ARROW_LEFT ;
- };
- ImageButton BTN_NEXT
- {
- Pos = MAP_APPFONT ( 167 , 60 ) ;
- Size = MAP_APPFONT ( 24 , 14 ) ;
- Symbol = IMAGEBUTTON_ARROW_RIGHT ;
- };
- FixedText FT_AUTHOR
- {
- Pos = MAP_APPFONT ( 12 , 116 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "~Insert";
- };
- PushButton BTN_AUTHOR
- {
- Pos = MAP_APPFONT ( 75 , 114 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Author" ;
- };
- // lokale Strings
- String STR_NOTIZ_EDIT
- {
- Text [ en-US ] = "Edit Note" ;
- };
- String STR_NOTIZ_INSERT
- {
- /* ### ACHTUNG: Neuer Text in Resource? Notiz einfügen : Notiz einf³gen */
- /* ### ACHTUNG: Neuer Text in Resource? Notiz einfügen : Notiz einf³gen */
- Text [ en-US ] = "Insert note" ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/readonlyimage.cxx b/svx/source/cui/readonlyimage.cxx
deleted file mode 100644
index dd273ce511..0000000000
--- a/svx/source/cui/readonlyimage.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: readonlyimage.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <readonlyimage.hxx>
-#include <vcl/help.hxx>
-#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-/*-- 26.02.2004 13:31:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) :
- FixedImage(pParent, rResId)
-{
- sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode();
- SetImage( Image(SVX_RES(bHighContrast ? RID_SVXBMP_LOCK_HC : RID_SVXBMP_LOCK )));
-}
-
-/*-- 26.02.2004 13:31:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-ReadOnlyImage::~ReadOnlyImage()
-{
-}
-/*-- 26.02.2004 13:31:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void ReadOnlyImage::RequestHelp( const HelpEvent& rHEvt )
-{
- if( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() )
- {
- Rectangle aLogicPix( LogicToPixel( Rectangle( Point(), GetOutputSize() ) ) );
- Rectangle aScreenRect( OutputToScreenPixel( aLogicPix.TopLeft() ),
- OutputToScreenPixel( aLogicPix.BottomRight() ) );
-
- String aStr(ReadOnlyImage::GetHelpTip());
- if ( Help::IsBalloonHelpEnabled() )
- Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aScreenRect,
- aStr );
- else if ( Help::IsQuickHelpEnabled() )
- Help::ShowQuickHelp( this, aScreenRect, aStr );
- }
- else
- Window::RequestHelp( rHEvt );
-}
-
-/*-- 26.02.2004 14:20:21---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-const String& ReadOnlyImage::GetHelpTip()
-{
- static String aStr(SVX_RES(RID_SVXSTR_READONLY_CONFIG_TIP));
- return aStr;
-}
diff --git a/svx/source/cui/readonlyimage.hxx b/svx/source/cui/readonlyimage.hxx
deleted file mode 100644
index ec509b5f00..0000000000
--- a/svx/source/cui/readonlyimage.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: readonlyimage.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_READONLYIMAGE_HXX
-#define _SVX_READONLYIMAGE_HXX
-
-#include <vcl/fixed.hxx>
-
-class ReadOnlyImage : public FixedImage
-{
-public:
- ReadOnlyImage(Window* pParent, const ResId rResId);
- ~ReadOnlyImage();
-
- virtual void RequestHelp( const HelpEvent& rHEvt );
- static const String& GetHelpTip();
-
-};
-#endif //
-
diff --git a/svx/source/cui/readonlyimage.src b/svx/source/cui/readonlyimage.src
deleted file mode 100644
index 306e4f6ed9..0000000000
--- a/svx/source/cui/readonlyimage.src
+++ /dev/null
@@ -1,55 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: readonlyimage.src,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include ---------------------------------------------------------------
-
-#include <svx/dialogs.hrc>
-
-String RID_SVXSTR_READONLY_CONFIG_TIP
-{
- Text [ en-US ] = "This setting is protected by the Administrator";
-};
-Image RID_SVXBMP_LOCK
-{
- ImageBitmap = Bitmap
- {
- File = "lock.bmp";
- };
- MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; };
-};
-Image RID_SVXBMP_LOCK_HC
-{
- ImageBitmap = Bitmap
- {
- File = "lock_hc.bmp";
- };
- MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; };
-};
-
diff --git a/svx/source/cui/scriptdlg.cxx b/svx/source/cui/scriptdlg.cxx
deleted file mode 100644
index 09b00a1cb8..0000000000
--- a/svx/source/cui/scriptdlg.cxx
+++ /dev/null
@@ -1,1695 +0,0 @@
-/**********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: scriptdlg.cxx,v $
- * $Revision: 1.26 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include <memory>
-
-#include <sfx2/objsh.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
-#include <vos/mutex.hxx>
-
-#include <svx/dialogs.hrc>
-#include "scriptdlg.hrc"
-#include "fmresids.hrc"
-#include "scriptdlg.hxx"
-#include <svx/dialmgr.hxx>
-#include "selector.hxx"
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
-#include <com/sun/star/script/provider/XScriptProvider.hpp>
-#include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
-#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
-#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
-#include <com/sun/star/script/provider/ScriptErrorRaisedException.hpp>
-#include <com/sun/star/script/provider/ScriptExceptionRaisedException.hpp>
-#include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/script/XInvocation.hpp>
-#include <com/sun/star/document/XEmbeddedScripts.hpp>
-
-#include <cppuhelper/implbase1.hxx>
-#include <comphelper/documentinfo.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/broadcasthelper.hxx>
-#include <comphelper/propertycontainer.hxx>
-#include <comphelper/proparrhlp.hxx>
-
-#include <basic/sbx.hxx>
-#include <svtools/imagemgr.hxx>
-#include <tools/urlobj.hxx>
-#include <vector>
-#include <algorithm>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::document;
-
-void ShowErrorDialog( const Any& aException )
-{
- SvxScriptErrorDialog* pDlg = new SvxScriptErrorDialog( NULL, aException );
- pDlg->Execute();
- delete pDlg;
-}
-
-SFTreeListBox::SFTreeListBox( Window* pParent, const ResId& rResId ) :
- SvTreeListBox( pParent, ResId( rResId.GetId(),*rResId.GetResMgr() ) ),
- m_hdImage(ResId(IMG_HARDDISK,*rResId.GetResMgr())),
- m_hdImage_hc(ResId(IMG_HARDDISK_HC,*rResId.GetResMgr())),
- m_libImage(ResId(IMG_LIB,*rResId.GetResMgr())),
- m_libImage_hc(ResId(IMG_LIB_HC,*rResId.GetResMgr())),
- m_macImage(ResId(IMG_MACRO,*rResId.GetResMgr())),
- m_macImage_hc(ResId(IMG_MACRO_HC,*rResId.GetResMgr())),
- m_docImage(ResId(IMG_DOCUMENT,*rResId.GetResMgr())),
- m_docImage_hc(ResId(IMG_DOCUMENT_HC,*rResId.GetResMgr())),
- m_sMyMacros(String(ResId(STR_MYMACROS,*rResId.GetResMgr()))),
- m_sProdMacros(String(ResId(STR_PRODMACROS,*rResId.GetResMgr())))
-{
- FreeResource();
- SetSelectionMode( SINGLE_SELECTION );
-
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL |
- WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HIDESELECTION |
- WB_HASLINES | WB_HASLINESATROOT );
- SetNodeDefaultImages();
-
- nMode = 0xFF; // Alles
-}
-
-SFTreeListBox::~SFTreeListBox()
-{
- deleteAllTree();
-}
-
-void SFTreeListBox::delUserData( SvLBoxEntry* pEntry )
-{
- if ( pEntry )
- {
-
- String text = GetEntryText( pEntry );
- SFEntry* pUserData = (SFEntry*)pEntry->GetUserData();
- if ( pUserData )
- {
- delete pUserData;
- // TBD seem to get a Select event on node that is remove ( below )
- // so need to be able to detect that this node is not to be
- // processed in order to do this, setting userData to NULL ( must
- // be a better way to do this )
- pUserData = 0;
- pEntry->SetUserData( pUserData );
- }
- }
-}
-
-void SFTreeListBox::deleteTree( SvLBoxEntry* pEntry )
-{
-
- delUserData( pEntry );
- pEntry = FirstChild( pEntry );
- while ( pEntry )
- {
- SvLBoxEntry* pNextEntry = NextSibling( pEntry );
- deleteTree( pEntry );
- GetModel()->Remove( pEntry );
- pEntry = pNextEntry;
- }
-}
-
-void SFTreeListBox::deleteAllTree()
-{
- SvLBoxEntry* pEntry = GetEntry( 0 );
-
- // TBD - below is a candidate for a destroyAllTrees method
- if ( pEntry )
- {
- while ( pEntry )
- {
- String text = GetEntryText( pEntry );
- SvLBoxEntry* pNextEntry = NextSibling( pEntry ) ;
- deleteTree( pEntry );
- GetModel()->Remove( pEntry );
- pEntry = pNextEntry;
- }
- }
-}
-
-void SFTreeListBox::Init( const ::rtl::OUString& language )
-{
- SetUpdateMode( FALSE );
-
- deleteAllTree();
-
- Reference< browse::XBrowseNode > rootNode;
- Reference< XComponentContext > xCtx;
-
- Sequence< Reference< browse::XBrowseNode > > children;
-
- ::rtl::OUString userStr = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString shareStr = ::rtl::OUString::createFromAscii("share");
-
- ::rtl::OUString singleton = ::rtl::OUString::createFromAscii(
- "/singletons/com.sun.star.script.browse.theBrowseNodeFactory" );
-
- try
- {
- Reference < beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
-
- xCtx.set( xProps->getPropertyValue( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("DefaultContext" ))), UNO_QUERY_THROW );
-
- Reference< browse::XBrowseNodeFactory > xFac(
- xCtx->getValueByName( singleton ), UNO_QUERY_THROW );
-
- rootNode.set( xFac->createView(
- browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) );
-
- if ( rootNode.is() && rootNode->hasChildNodes() == sal_True )
- {
- children = rootNode->getChildNodes();
- }
- }
- catch( Exception& e )
- {
- OSL_TRACE("Exception getting root browse node from factory: %s",
- ::rtl::OUStringToOString(
- e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- // TODO exception handling
- }
-
- Reference<XModel> xDocumentModel;
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
- {
- bool app = false;
- ::rtl::OUString uiName = children[ n ]->getName();
- ::rtl::OUString factoryURL;
- if ( uiName.equals( userStr ) || uiName.equals( shareStr ) )
- {
- app = true;
- if ( uiName.equals( userStr ) )
- {
- uiName = m_sMyMacros;
- }
- else
- {
- uiName = m_sProdMacros;
- }
- }
- else
- {
- xDocumentModel.set(getDocumentModel(xCtx, uiName ), UNO_QUERY);
-
- if ( xDocumentModel.is() )
- {
- Reference< ::com::sun::star::frame::XModuleManager >
- xModuleManager( xCtx->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"), xCtx ),
- UNO_QUERY_THROW );
-
- Reference<container::XNameAccess> xModuleConfig(
- xModuleManager, UNO_QUERY_THROW );
- // get the long name of the document:
- Sequence<beans::PropertyValue> moduleDescr;
- try{
- ::rtl::OUString appModule = xModuleManager->identify( xDocumentModel );
- xModuleConfig->getByName(appModule) >>= moduleDescr;
- } catch(const uno::Exception&)
- {}
-
- beans::PropertyValue const * pmoduleDescr =
- moduleDescr.getConstArray();
- for ( sal_Int32 pos = moduleDescr.getLength(); pos--; )
- {
- if (pmoduleDescr[ pos ].Name.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM(
- "ooSetupFactoryEmptyDocumentURL") ))
- {
- pmoduleDescr[ pos ].Value >>= factoryURL;
- break;
- }
- }
- }
- }
-
- ::rtl::OUString lang( language );
- Reference< browse::XBrowseNode > langEntries =
- getLangNodeFromRootNode( children[ n ], lang );
-
- /*SvLBoxEntry* pBasicManagerRootEntry =*/
- insertEntry( uiName, app ? IMG_HARDDISK : IMG_DOCUMENT,
- 0, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL );
- }
-
- SetUpdateMode( TRUE );
-}
-
-Reference< XInterface >
-SFTreeListBox::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName )
-{
- Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ),
- UNO_QUERY );
-
- Reference< container::XEnumerationAccess > componentsAccess =
- desktop->getComponents();
- Reference< container::XEnumeration > components =
- componentsAccess->createEnumeration();
- while (components->hasMoreElements())
- {
- Reference< frame::XModel > model(
- components->nextElement(), UNO_QUERY );
- if ( model.is() )
- {
- ::rtl::OUString sTdocUrl = ::comphelper::DocumentInfo::getDocumentTitle( model );
- if( sTdocUrl.equals( docName ) )
- {
- xModel = model;
- break;
- }
- }
- }
- return xModel;
-}
-
-Reference< browse::XBrowseNode >
-SFTreeListBox::getLangNodeFromRootNode( Reference< browse::XBrowseNode >& rootNode, ::rtl::OUString& language )
-{
- Reference< browse::XBrowseNode > langNode;
-
- try
- {
- Sequence < Reference< browse::XBrowseNode > > children = rootNode->getChildNodes();
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
- {
- if ( children[ n ]->getName().equals( language ) )
- {
- langNode = children[ n ];
- break;
- }
- }
- }
- catch ( Exception& )
- {
- // if getChildNodes() throws an exception we just return
- // the empty Reference
- }
- return langNode;
-}
-
-void SFTreeListBox:: RequestSubEntries( SvLBoxEntry* pRootEntry, Reference< ::com::sun::star::script::browse::XBrowseNode >& node,
- Reference< XModel >& model )
-{
- if (! node.is() )
- {
- return;
- }
-
- Sequence< Reference< browse::XBrowseNode > > children;
- try
- {
- children = node->getChildNodes();
- }
- catch ( Exception& )
- {
- // if we catch an exception in getChildNodes then no entries are added
- }
-
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
- {
- ::rtl::OUString name( children[ n ]->getName() );
- if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT)
- {
- insertEntry( name, IMG_LIB, pRootEntry, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )));
- }
- else
- {
- if ( children[ n ]->getType() == browse::BrowseNodeTypes::SCRIPT )
- {
- insertEntry( name, IMG_MACRO, pRootEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model )));
-
- }
- }
- }
-}
-
-void SFTreeListBox::UpdateEntries()
-{
-}
-
-SvLBoxEntry* SFTreeListBox::FindEntry( SvLBoxEntry* , const String& , BYTE )
-{
- return 0;
-}
-
-long SFTreeListBox::ExpandingHdl()
-{
- return TRUE;
-}
-
-void SFTreeListBox::ExpandAllTrees()
-{
-}
-
-SvLBoxEntry * SFTreeListBox::insertEntry(
- String const & rText, USHORT nBitmap, SvLBoxEntry * pParent,
- bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData, ::rtl::OUString factoryURL )
-{
- SvLBoxEntry * p;
- if( nBitmap == IMG_DOCUMENT && factoryURL.getLength() > 0 )
- {
- Image aImage = SvFileInformationManager::GetFileImage(
- INetURLObject(factoryURL), false,
- BMP_COLOR_NORMAL );
- Image aHCImage = SvFileInformationManager::GetFileImage(
- INetURLObject(factoryURL), false,
- BMP_COLOR_HIGHCONTRAST );
- p = InsertEntry(
- rText, aImage, aImage, pParent, bChildrenOnDemand, LIST_APPEND,
- aUserData.release()); // XXX possible leak
- SetExpandedEntryBmp(p, aHCImage, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(p, aHCImage, BMP_COLOR_HIGHCONTRAST);
- }
- else
- {
- p = insertEntry( rText, nBitmap, pParent, bChildrenOnDemand, aUserData );
- }
- return p;
-}
-
-SvLBoxEntry * SFTreeListBox::insertEntry(
- String const & rText, USHORT nBitmap, SvLBoxEntry * pParent,
- bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData )
-{
- Image aHCImage, aImage;
- if( nBitmap == IMG_HARDDISK )
- {
- aImage = m_hdImage;
- aHCImage = m_hdImage_hc;
- }
- else if( nBitmap == IMG_LIB )
- {
- aImage = m_libImage;
- aHCImage = m_libImage_hc;
- }
- else if( nBitmap == IMG_MACRO )
- {
- aImage = m_macImage;
- aHCImage = m_macImage_hc;
- }
- else if( nBitmap == IMG_DOCUMENT )
- {
- aImage = m_docImage;
- aHCImage = m_docImage_hc;
- }
- SvLBoxEntry * p = InsertEntry(
- rText, aImage, aImage, pParent, bChildrenOnDemand, LIST_APPEND,
- aUserData.release()); // XXX possible leak
- SetExpandedEntryBmp(p, aHCImage, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(p, aHCImage, BMP_COLOR_HIGHCONTRAST);
- return p;
-}
-
-void __EXPORT SFTreeListBox::RequestingChilds( SvLBoxEntry* pEntry )
-{
- SFEntry* userData = 0;
- if ( !pEntry )
- {
- return;
- }
- userData = (SFEntry*)pEntry->GetUserData();
-
- Reference< browse::XBrowseNode > node;
- Reference< XModel > model;
- if ( userData && !userData->isLoaded() )
- {
- node = userData->GetNode();
- model = userData->GetModel();
- RequestSubEntries( pEntry, node, model );
- userData->setLoaded();
- }
-}
-
-void __EXPORT SFTreeListBox::ExpandedHdl()
-{
-/* SvLBoxEntry* pEntry = GetHdlEntry();
- DBG_ASSERT( pEntry, "Was wurde zugeklappt?" );
-
- if ( !IsExpanded( pEntry ) && pEntry->HasChildsOnDemand() )
- {
- SvLBoxEntry* pChild = FirstChild( pEntry );
- while ( pChild )
- {
- GetModel()->Remove( pChild ); // Ruft auch den DTOR
- pChild = FirstChild( pEntry );
- }
- }*/
-}
-
-// ----------------------------------------------------------------------------
-// InputDialog ------------------------------------------------------------
-// ----------------------------------------------------------------------------
-InputDialog::InputDialog(Window * pParent, USHORT nMode )
- : ModalDialog( pParent, SVX_RES( RID_DLG_NEWLIB ) ),
- aText( this, SVX_RES( FT_NEWLIB ) ),
- aEdit( this, SVX_RES( ED_LIBNAME ) ),
- aOKButton( this, SVX_RES( PB_OK ) ),
- aCancelButton( this, SVX_RES( PB_CANCEL ) )
-{
- aEdit.GrabFocus();
- if ( nMode == INPUTMODE_NEWLIB )
- {
- SetText( String( SVX_RES( STR_NEWLIB ) ) );
- }
- else if ( nMode == INPUTMODE_NEWMACRO )
- {
- SetText( String( SVX_RES( STR_NEWMACRO ) ) );
- aText.SetText( String( SVX_RES( STR_FT_NEWMACRO ) ) );
- }
- else if ( nMode == INPUTMODE_RENAME )
- {
- SetText( String( SVX_RES( STR_RENAME ) ) );
- aText.SetText( String( SVX_RES( STR_FT_RENAME ) ) );
- }
- FreeResource();
-
- // some resizing so that the text fits
- Point point, newPoint;
- Size siz, newSiz;
- long gap;
-
- USHORT style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP |
- TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK;
-
- // get dimensions of dialog instructions control
- point = aText.GetPosPixel();
- siz = aText.GetSizePixel();
-
- // get dimensions occupied by text in the control
- Rectangle rect =
- GetTextRect( Rectangle( point, siz ), aText.GetText(), style );
- newSiz = rect.GetSize();
-
- // the gap is the difference between the text width and its control width
- gap = siz.Height() - newSiz.Height();
-
- //resize the text field
- newSiz = Size( siz.Width(), siz.Height() - gap );
- aText.SetSizePixel( newSiz );
-
- //move the OK & cancel buttons
- point = aEdit.GetPosPixel();
- newPoint = Point( point.X(), point.Y() - gap );
- aEdit.SetPosPixel( newPoint );
-
-}
-
-InputDialog::~InputDialog()
-{
-}
-// ----------------------------------------------------------------------------
-// ScriptOrgDialog ------------------------------------------------------------
-// ----------------------------------------------------------------------------
-SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, ::rtl::OUString language )
- : SfxModalDialog( pParent, SVX_RES( RID_DLG_SCRIPTORGANIZER ) ),
- aScriptsTxt( this, SVX_RES( SF_TXT_SCRIPTS ) ),
- aScriptsBox( this, SVX_RES( SF_CTRL_SCRIPTSBOX ) ),
- aRunButton( this, SVX_RES( SF_PB_RUN ) ),
- aCloseButton( this, SVX_RES( SF_PB_CLOSE ) ),
- aCreateButton( this, SVX_RES( SF_PB_CREATE ) ),
- aEditButton( this, SVX_RES( SF_PB_EDIT ) ),
- aRenameButton(this, SVX_RES( SF_PB_RENAME ) ),
- aDelButton( this, SVX_RES( SF_PB_DEL ) ),
- aHelpButton( this, SVX_RES( SF_PB_HELP ) ),
- m_sLanguage( language ),
- m_delErrStr( SVX_RES( RID_SVXSTR_DELFAILED ) ),
- m_delErrTitleStr( SVX_RES( RID_SVXSTR_DELFAILED_TITLE ) ),
- m_delQueryStr( SVX_RES( RID_SVXSTR_DELQUERY ) ),
- m_delQueryTitleStr( SVX_RES( RID_SVXSTR_DELQUERY_TITLE ) ) ,
- m_createErrStr( SVX_RES ( RID_SVXSTR_CREATEFAILED ) ),
- m_createDupStr( SVX_RES ( RID_SVXSTR_CREATEFAILEDDUP ) ),
- m_createErrTitleStr( SVX_RES( RID_SVXSTR_CREATEFAILED_TITLE ) ),
- m_renameErrStr( SVX_RES ( RID_SVXSTR_RENAMEFAILED ) ),
- m_renameErrTitleStr( SVX_RES( RID_SVXSTR_RENAMEFAILED_TITLE ) )
-{
-
- // must be a neater way to deal with the strings than as above
- // append the language to the dialog title
- String winTitle( GetText() );
- winTitle.SearchAndReplace( String::CreateFromAscii( "%MACROLANG" ), language.pData->buffer );
- SetText( winTitle );
-
- aScriptsBox.SetSelectHdl( LINK( this, SvxScriptOrgDialog, ScriptSelectHdl ) );
- aRunButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aCloseButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aRenameButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aEditButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aDelButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
- aCreateButton.SetClickHdl( LINK( this, SvxScriptOrgDialog, ButtonHdl ) );
-
- aRunButton.Disable();
- aRenameButton.Disable();
- aEditButton.Disable();
- aDelButton.Disable();
- aCreateButton.Disable();
-
- aScriptsBox.Init( m_sLanguage );
- RestorePreviousSelection();
- FreeResource();
-}
-
-__EXPORT SvxScriptOrgDialog::~SvxScriptOrgDialog()
-{
- // clear the SelectHdl so that it isn't called during the dtor
- aScriptsBox.SetSelectHdl( Link() );
-};
-
-short SvxScriptOrgDialog::Execute()
-{
-
- SfxObjectShell *pDoc = SfxObjectShell::GetFirst();
-
- // force load of MSPs for all documents
- while ( pDoc )
- {
- Reference< provider::XScriptProviderSupplier > xSPS =
- Reference< provider::XScriptProviderSupplier >
- ( pDoc->GetModel(), UNO_QUERY );
- if ( xSPS.is() )
- {
- Reference< provider::XScriptProvider > ScriptProvider =
- xSPS->getScriptProvider();
- }
-
- pDoc = SfxObjectShell::GetNext(*pDoc);
- }
- aScriptsBox.ExpandAllTrees();
-
- Window* pPrevDlgParent = Application::GetDefDialogParent();
- Application::SetDefDialogParent( this );
- short nRet = ModalDialog::Execute();
- Application::SetDefDialogParent( pPrevDlgParent );
- return nRet;
-}
-
-void SvxScriptOrgDialog::EnableButton( Button& , BOOL )
-{
-}
-
-void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node )
-{
- if ( node.is() )
- {
- if ( node->getType() == browse::BrowseNodeTypes::SCRIPT)
- {
- aRunButton.Enable();
- }
- else
- {
- aRunButton.Disable();
- }
- Reference< beans::XPropertySet > xProps( node, UNO_QUERY );
-
- if ( !xProps.is() )
- {
- aEditButton.Disable();
- aDelButton.Disable();
- aCreateButton.Disable();
- aRunButton.Disable();
- return;
- }
-
- ::rtl::OUString sName;
- sName = String::CreateFromAscii("Editable") ;
-
- if ( getBoolProperty( xProps, sName ) )
- {
- aEditButton.Enable();
- }
- else
- {
- aEditButton.Disable();
- }
-
- sName = String::CreateFromAscii("Deletable") ;
-
- if ( getBoolProperty( xProps, sName ) )
- {
- aDelButton.Enable();
- }
- else
- {
- aDelButton.Disable();
- }
-
- sName = String::CreateFromAscii("Creatable") ;
-
- if ( getBoolProperty( xProps, sName ) )
- {
- aCreateButton.Enable();
- }
- else
- {
- aCreateButton.Disable();
- }
-
- sName = String::CreateFromAscii("Renamable") ;
-
- if ( getBoolProperty( xProps, sName ) )
- {
- aRenameButton.Enable();
- }
- else
- {
- aRenameButton.Disable();
- }
- }
- else
- {
- // no node info available, disable all configurable actions
- aDelButton.Disable();
- aCreateButton.Disable();
- aEditButton.Disable();
- aRunButton.Disable();
- aRenameButton.Disable();
- }
-}
-
-IMPL_LINK_INLINE_START( SvxScriptOrgDialog, MacroDoubleClickHdl, SvTreeListBox *, EMPTYARG )
-{
- return 0;
-}
-
-IMPL_LINK_INLINE_END( SvxScriptOrgDialog, MacroDoubleClickHdl, SvTreeListBox *, EMPTYARG )
-
-IMPL_LINK( SvxScriptOrgDialog, ScriptSelectHdl, SvTreeListBox *, pBox )
-{
- if ( !pBox->IsSelected( pBox->GetHdlEntry() ) )
- {
- return 0;
- }
-
- SvLBoxEntry* pEntry = pBox->GetHdlEntry();
-
- SFEntry* userData = 0;
- if ( !pEntry )
- {
- return 0;
- }
- userData = (SFEntry*)pEntry->GetUserData();
-
- Reference< browse::XBrowseNode > node;
- if ( userData )
- {
- node = userData->GetNode();
- CheckButtons( node );
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton )
-{
- if ( pButton == &aCloseButton )
- {
- StoreCurrentSelection();
- EndDialog( 0 );
- }
- if ( pButton == &aEditButton ||
- pButton == &aCreateButton ||
- pButton == &aDelButton ||
- pButton == &aRunButton ||
- pButton == &aRenameButton )
-
- {
- if ( aScriptsBox.IsSelected( aScriptsBox.GetHdlEntry() ) )
- {
- SvLBoxEntry* pEntry = aScriptsBox.GetHdlEntry();
- SFEntry* userData = 0;
- if ( !pEntry )
- {
- return 0;
- }
- userData = (SFEntry*)pEntry->GetUserData();
- if ( userData )
- {
- Reference< browse::XBrowseNode > node;
- Reference< XModel > xModel;
-
- node = userData->GetNode();
- xModel = userData->GetModel();
-
- if ( !node.is() )
- {
- return 0;
- }
-
- if ( pButton == &aRunButton )
- {
- ::rtl::OUString tmpString;
- Reference< beans::XPropertySet > xProp( node, UNO_QUERY );
- Reference< provider::XScriptProvider > mspNode;
- if( !xProp.is() )
- {
- return 0;
- }
-
- if ( xModel.is() )
- {
- Reference< XEmbeddedScripts > xEmbeddedScripts( xModel, UNO_QUERY);
- if( !xEmbeddedScripts.is() )
- {
- return 0;
- }
-
- if (!xEmbeddedScripts->getAllowMacroExecution())
- {
- // Please FIXME: Show a message box if AllowMacroExecution is false
- return 0;
- }
- }
-
-
- SvLBoxEntry* pParent = aScriptsBox.GetParent( pEntry );
- while ( pParent && !mspNode.is() )
- {
- SFEntry* mspUserData = (SFEntry*)pParent->GetUserData();
- mspNode.set( mspUserData->GetNode() , UNO_QUERY );
- pParent = aScriptsBox.GetParent( pParent );
- }
- xProp->getPropertyValue( String::CreateFromAscii("URI" ) ) >>= tmpString;
- const String scriptURL( tmpString );
-
- if ( mspNode.is() )
- {
- try
- {
- Reference< provider::XScript > xScript(
- mspNode->getScript( scriptURL ), UNO_QUERY_THROW );
-
- const Sequence< Any > args(0);
- Any aRet;
- Sequence< sal_Int16 > outIndex;
- Sequence< Any > outArgs( 0 );
- aRet = xScript->invoke( args, outIndex, outArgs );
- }
- catch ( reflection::InvocationTargetException& ite )
- {
- ::com::sun::star::uno::Any a = makeAny(ite);
- ShowErrorDialog(a);
- }
- catch ( provider::ScriptFrameworkErrorException& ite )
- {
- ::com::sun::star::uno::Any a = makeAny(ite);
- ShowErrorDialog(a);
- }
- catch ( RuntimeException& re )
- {
- ::com::sun::star::uno::Any a = makeAny(re);
- ShowErrorDialog(a);
- }
- catch ( Exception& e )
- {
- ::com::sun::star::uno::Any a = makeAny(e);
- ShowErrorDialog(a);
- }
- }
- StoreCurrentSelection();
- EndDialog( 0 );
- }
- else if ( pButton == &aEditButton )
- {
- Reference< script::XInvocation > xInv( node, UNO_QUERY );
- if ( xInv.is() )
- {
- StoreCurrentSelection();
- EndDialog( 0 );
- Sequence< Any > args(0);
- Sequence< Any > outArgs( 0 );
- Sequence< sal_Int16 > outIndex;
- try
- {
- // ISSUE need code to run script here
- xInv->invoke( ::rtl::OUString::createFromAscii( "Editable" ), args, outIndex, outArgs );
- }
- catch( Exception& e )
- {
- OSL_TRACE("Caught exception trying to invoke %s", ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
-
- }
- }
- }
- else if ( pButton == &aCreateButton )
- {
- createEntry( pEntry );
- }
- else if ( pButton == &aDelButton )
- {
- deleteEntry( pEntry );
- }
- else if ( pButton == &aRenameButton )
- {
- renameEntry( pEntry );
- }
- }
- }
- }
- return 0;
-}
-
-Reference< browse::XBrowseNode > SvxScriptOrgDialog::getBrowseNode( SvLBoxEntry* pEntry )
-{
- Reference< browse::XBrowseNode > node;
- if ( pEntry )
- {
- SFEntry* userData = (SFEntry*)pEntry->GetUserData();
- if ( userData )
- {
- node = userData->GetNode();
- }
- }
-
- return node;
-}
-
-Reference< XModel > SvxScriptOrgDialog::getModel( SvLBoxEntry* pEntry )
-{
- Reference< XModel > model;
- if ( pEntry )
- {
- SFEntry* userData = (SFEntry*)pEntry->GetUserData();
- if ( userData )
- {
- model = userData->GetModel();
- }
- }
-
- return model;
-}
-
-Reference< XInterface >
-SvxScriptOrgDialog::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName )
-{
- Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ),
- UNO_QUERY );
-
- Reference< container::XEnumerationAccess > componentsAccess =
- desktop->getComponents();
- Reference< container::XEnumeration > components =
- componentsAccess->createEnumeration();
- while (components->hasMoreElements())
- {
- Reference< frame::XModel > model(
- components->nextElement(), UNO_QUERY );
- if ( model.is() )
- {
- ::rtl::OUString sTdocUrl = ::comphelper::DocumentInfo::getDocumentTitle( model );
- if( sTdocUrl.equals( docName ) )
- {
- xModel = model;
- break;
- }
- }
- }
- return xModel;
-}
-
-void SvxScriptOrgDialog::createEntry( SvLBoxEntry* pEntry )
-{
-
- Reference< browse::XBrowseNode > aChildNode;
- Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
- Reference< script::XInvocation > xInv( node, UNO_QUERY );
-
- if ( xInv.is() )
- {
- ::rtl::OUString aNewName;
- ::rtl::OUString aNewStdName;
- USHORT nMode = INPUTMODE_NEWLIB;
- if( aScriptsBox.GetModel()->GetDepth( pEntry ) == 0 )
- {
- aNewStdName = ::rtl::OUString::createFromAscii( "Library" ) ;
- }
- else
- {
- aNewStdName = ::rtl::OUString::createFromAscii( "Macro" ) ;
- nMode = INPUTMODE_NEWMACRO;
- }
- //do we need L10N for this? ie somethng like:
- //String aNewStdName( ResId( STR_STDMODULENAME ) );
- BOOL bValid = FALSE;
- USHORT i = 1;
-
- Sequence< Reference< browse::XBrowseNode > > childNodes;
- // no children => ok to create Parcel1 or Script1 without checking
- try
- {
- if( node->hasChildNodes() == sal_False )
- {
- aNewName = aNewStdName;
- aNewName += String::CreateFromInt32( i );
- bValid = TRUE;
- }
- else
- {
- childNodes = node->getChildNodes();
- }
- }
- catch ( Exception& )
- {
- // ignore, will continue on with empty sequence
- }
-
- ::rtl::OUString extn;
- while ( !bValid )
- {
- aNewName = aNewStdName;
- aNewName += String::CreateFromInt32( i );
- BOOL bFound = FALSE;
- if(childNodes.getLength() > 0 )
- {
- ::rtl::OUString nodeName = childNodes[0]->getName();
- sal_Int32 extnPos = nodeName.lastIndexOf( '.' );
- if(extnPos>0)
- extn = nodeName.copy(extnPos);
- }
- for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
- {
- if ( (aNewName+extn).equals( childNodes[index]->getName() ) )
- {
- bFound = TRUE;
- break;
- }
- }
- if( bFound )
- {
- i++;
- }
- else
- {
- bValid = TRUE;
- }
- }
-
- std::auto_ptr< InputDialog > xNewDlg( new InputDialog( static_cast<Window*>(this), nMode ) );
- xNewDlg->SetObjectName( aNewName );
-
- do
- {
- if ( xNewDlg->Execute() && xNewDlg->GetObjectName().Len() )
- {
- ::rtl::OUString aUserSuppliedName = xNewDlg->GetObjectName();
- bValid = TRUE;
- for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
- {
- if ( (aUserSuppliedName+extn).equals( childNodes[index]->getName() ) )
- {
- bValid = FALSE;
- String aError( m_createErrStr );
- aError.Append( m_createDupStr );
- ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
- xNewDlg->SetObjectName( aNewName );
- break;
- }
- }
- if( bValid )
- aNewName = aUserSuppliedName;
- }
- else
- {
- // user hit cancel or hit OK with nothing in the editbox
-
- return;
- }
- }
- while ( !bValid );
-
- // open up parent node (which ensures it's loaded)
- aScriptsBox.RequestingChilds( pEntry );
-
- Sequence< Any > args( 1 );
- args[ 0 ] <<= aNewName;
- Sequence< Any > outArgs( 0 );
- Sequence< sal_Int16 > outIndex;
- try
- {
- Any aResult;
- aResult = xInv->invoke( ::rtl::OUString::createFromAscii( "Creatable" ), args, outIndex, outArgs );
- Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY );
- aChildNode = newNode;
-
- }
- catch( Exception& e )
- {
- OSL_TRACE("Caught exception trying to Create %s",
- ::rtl::OUStringToOString(
- e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- }
- if ( aChildNode.is() )
- {
- String aChildName = aChildNode->getName();
- SvLBoxEntry* pNewEntry = NULL;
-
-
- ::rtl::OUString name( aChildName );
- Reference<XModel> xDocumentModel = getModel( pEntry );
-
- // ISSUE do we need to remove all entries for parent
- // to achieve sort? Just need to determine position
- // SvTreeListBox::InsertEntry can take position arg
- // -- Basic doesn't do this on create.
- // Suppose we could avoid this too. -> created nodes are
- // not in alphabetical order
- if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT )
- {
- pNewEntry = aScriptsBox.insertEntry( aChildName,
- IMG_MACRO, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) );
-
- }
- else
- {
- pNewEntry = aScriptsBox.insertEntry( aChildName,
- IMG_LIB, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) );
- // If the Parent is not loaded then set to
- // loaded, this will prevent RequestingChilds ( called
- // from vcl via RequestingChilds ) from
- // creating new ( duplicate ) children
- SFEntry* userData = (SFEntry*)pEntry->GetUserData();
- if ( userData && !userData->isLoaded() )
- {
- userData->setLoaded();
- }
- }
- aScriptsBox.SetCurEntry( pNewEntry );
- aScriptsBox.Select( aScriptsBox.GetCurEntry() );
-
- }
- else
- {
- //ISSUE L10N & message from exception?
- String aError( m_createErrStr );
- ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
- }
-}
-
-void SvxScriptOrgDialog::renameEntry( SvLBoxEntry* pEntry )
-{
-
- Reference< browse::XBrowseNode > aChildNode;
- Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
- Reference< script::XInvocation > xInv( node, UNO_QUERY );
-
- if ( xInv.is() )
- {
- ::rtl::OUString aNewName = node->getName();
- sal_Int32 extnPos = aNewName.lastIndexOf( '.' );
- ::rtl::OUString extn;
- if(extnPos>0)
- {
- extn = aNewName.copy(extnPos);
- aNewName = aNewName.copy(0,extnPos);
- }
- USHORT nMode = INPUTMODE_RENAME;
-
- std::auto_ptr< InputDialog > xNewDlg( new InputDialog( static_cast<Window*>(this), nMode ) );
- xNewDlg->SetObjectName( aNewName );
-
- BOOL bValid;
- do
- {
- if ( xNewDlg->Execute() && xNewDlg->GetObjectName().Len() )
- {
- ::rtl::OUString aUserSuppliedName = xNewDlg->GetObjectName();
- bValid = TRUE;
- /*
- for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
- {
- if ( (aUserSuppliedName+extn).equals( childNodes[index]->getName() ) )
- {
- bValid = FALSE;
- String aError( m_createErrStr );
- aError.Append( m_createDupStr );
- ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
- xNewDlg->SetObjectName( aNewName );
- break;
- }
- } */
- if( bValid )
- aNewName = aUserSuppliedName;
- }
- else
- {
- // user hit cancel or hit OK with nothing in the editbox
- return;
- }
- }
- while ( !bValid );
-
- Sequence< Any > args( 1 );
- args[ 0 ] <<= aNewName;
- Sequence< Any > outArgs( 0 );
- Sequence< sal_Int16 > outIndex;
- try
- {
- Any aResult;
- aResult = xInv->invoke( ::rtl::OUString::createFromAscii( "Renamable" ), args, outIndex, outArgs );
- Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY );
- aChildNode = newNode;
-
- }
- catch( Exception& e )
- {
- OSL_TRACE("Caught exception trying to Rename %s",
- ::rtl::OUStringToOString(
- e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- }
- if ( aChildNode.is() )
- {
- aScriptsBox.SetEntryText( pEntry, aChildNode->getName() );
- aScriptsBox.SetCurEntry( pEntry );
- aScriptsBox.Select( aScriptsBox.GetCurEntry() );
-
- }
- else
- {
- //ISSUE L10N & message from exception?
- String aError( m_renameErrStr );
- ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, aError );
- aErrorBox.SetText( m_renameErrTitleStr );
- aErrorBox.Execute();
- }
-}
-void SvxScriptOrgDialog::deleteEntry( SvLBoxEntry* pEntry )
-{
- sal_Bool result = sal_False;
- Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
- // ISSUE L10N string & can we centre list?
- String aQuery( m_delQueryStr );
- aQuery.Append( getListOfChildren( node, 0 ) );
- QueryBox aQueryBox( static_cast<Window*>(this), WB_YES_NO | WB_DEF_YES, aQuery );
- aQueryBox.SetText( m_delQueryTitleStr );
- if ( aQueryBox.Execute() == RET_NO )
- {
- return;
- }
-
- Reference< script::XInvocation > xInv( node, UNO_QUERY );
- if ( xInv.is() )
- {
- Sequence< Any > args( 0 );
- Sequence< Any > outArgs( 0 );
- Sequence< sal_Int16 > outIndex;
- try
- {
- Any aResult;
- aResult = xInv->invoke( ::rtl::OUString::createFromAscii( "Deletable" ), args, outIndex, outArgs );
- aResult >>= result; // or do we just assume true if no exception ?
- }
- catch( Exception& e )
- {
- OSL_TRACE("Caught exception trying to delete %s",
- ::rtl::OUStringToOString(
- e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- }
-
- if ( result == sal_True )
- {
- aScriptsBox.deleteTree( pEntry );
- aScriptsBox.GetModel()->Remove( pEntry );
- }
- else
- {
- //ISSUE L10N & message from exception?
- ErrorBox aErrorBox( static_cast<Window*>(this), WB_OK | RET_OK, m_delErrStr );
- aErrorBox.SetText( m_delErrTitleStr );
- aErrorBox.Execute();
- }
-
-}
-
-BOOL SvxScriptOrgDialog::getBoolProperty( Reference< beans::XPropertySet >& xProps,
- ::rtl::OUString& propName )
-{
- BOOL result = false;
- try
- {
- sal_Bool bTemp = sal_False;
- xProps->getPropertyValue( propName ) >>= bTemp;
- result = ( bTemp == sal_True );
- }
- catch ( Exception& )
- {
- return result;
- }
- return result;
-}
-
-String SvxScriptOrgDialog::getListOfChildren( Reference< browse::XBrowseNode > node, int depth )
-{
- String result;
- result.Append( String::CreateFromAscii( "\n" ) );
- for( int i=0;i<=depth;i++ )
- {
- result.Append( String::CreateFromAscii( "\t" ) );
- }
- result.Append( String( node->getName() ) );
-
- try
- {
- if ( node->hasChildNodes() == sal_True )
- {
- Sequence< Reference< browse::XBrowseNode > > children
- = node->getChildNodes();
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
- {
- result.Append( getListOfChildren( children[ n ] , depth+1 ) );
- }
- }
- }
- catch ( Exception& )
- {
- // ignore, will return an empty string
- }
-
- return result;
-}
-
-Selection_hash SvxScriptOrgDialog::m_lastSelection;
-
-void SvxScriptOrgDialog::StoreCurrentSelection()
-{
- String aDescription;
- if ( aScriptsBox.IsSelected( aScriptsBox.GetHdlEntry() ) )
- {
- SvLBoxEntry* pEntry = aScriptsBox.GetHdlEntry();
- while( pEntry )
- {
- aDescription.Insert( aScriptsBox.GetEntryText( pEntry ), 0 );
- pEntry = aScriptsBox.GetParent( pEntry );
- if ( pEntry )
- aDescription.Insert( ';', 0 );
- }
- ::rtl::OUString sDesc( aDescription );
- m_lastSelection[ m_sLanguage ] = sDesc;
- }
-}
-
-void SvxScriptOrgDialog::RestorePreviousSelection()
-{
- String aStoredEntry = String( m_lastSelection[ m_sLanguage ] );
- if( aStoredEntry.Len() <= 0 )
- return;
- SvLBoxEntry* pEntry = 0;
- USHORT nIndex = 0;
- while ( nIndex != STRING_NOTFOUND )
- {
- String aTmp( aStoredEntry.GetToken( 0, ';', nIndex ) );
- SvLBoxEntry* pTmpEntry = aScriptsBox.FirstChild( pEntry );
- ::rtl::OUString debugStr(aTmp);
- while ( pTmpEntry )
- {
- debugStr = ::rtl::OUString(aScriptsBox.GetEntryText( pTmpEntry ));
- if ( aScriptsBox.GetEntryText( pTmpEntry ) == aTmp )
- {
- pEntry = pTmpEntry;
- break;
- }
- pTmpEntry = aScriptsBox.NextSibling( pTmpEntry );
- }
- if ( !pTmpEntry )
- break;
- aScriptsBox.RequestingChilds( pEntry );
- }
- aScriptsBox.SetCurEntry( pEntry );
-}
-
-BOOL SFTreeListBox::dialogSort1( Reference< browse::XBrowseNode > node1,
- Reference< browse::XBrowseNode > node2 )
-{
- ::rtl::OUString userStr = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString shareStr = ::rtl::OUString::createFromAscii("share");
- if( node1->getName().equals( userStr ) )
- return true;
- if( node2->getName().equals( userStr ) )
- return false;
- if( node1->getName().equals( shareStr ) )
- return true;
- if( node2->getName().equals( shareStr ) )
- return false;
- return dialogSort2( node1, node2 );
-}
-
-BOOL SFTreeListBox::dialogSort2( Reference< browse::XBrowseNode > node1,
- Reference< browse::XBrowseNode > node2 )
-{
- return ( node1->getName().compareTo( node2->getName() ) < 0 );
-}
-
-::rtl::OUString ReplaceString(
- const ::rtl::OUString& source,
- const ::rtl::OUString& token,
- const ::rtl::OUString& value )
-{
- sal_Int32 pos = source.indexOf( token );
-
- if ( pos != -1 && value.getLength() != 0 )
- {
- return source.replaceAt( pos, token.getLength(), value );
- }
- else
- {
- return source;
- }
-}
-
-::rtl::OUString FormatErrorString(
- const ::rtl::OUString& unformatted,
- const ::rtl::OUString& language,
- const ::rtl::OUString& script,
- const ::rtl::OUString& line,
- const ::rtl::OUString& type,
- const ::rtl::OUString& message )
-{
- ::rtl::OUString result = unformatted.copy( 0 );
-
- result = ReplaceString(
- result, ::rtl::OUString::createFromAscii( "%LANGUAGENAME" ), language );
- result = ReplaceString(
- result, ::rtl::OUString::createFromAscii( "%SCRIPTNAME" ), script );
- result = ReplaceString(
- result, ::rtl::OUString::createFromAscii( "%LINENUMBER" ), line );
-
- if ( type.getLength() != 0 )
- {
- result += ::rtl::OUString::createFromAscii( "\n\n" );
- result += ::rtl::OUString(String(SVX_RES(RID_SVXSTR_ERROR_TYPE_LABEL)));
- result += ::rtl::OUString::createFromAscii( " " );
- result += type;
- }
-
- if ( message.getLength() != 0 )
- {
- result += ::rtl::OUString::createFromAscii( "\n\n" );
- result += ::rtl::OUString(String(SVX_RES(RID_SVXSTR_ERROR_MESSAGE_LABEL)));
- result += ::rtl::OUString::createFromAscii( " " );
- result += message;
- }
-
- return result;
-}
-
-::rtl::OUString GetErrorMessage(
- const provider::ScriptErrorRaisedException& eScriptError )
-{
- ::rtl::OUString unformatted = String( SVX_RES( RID_SVXSTR_ERROR_AT_LINE ) );
-
- ::rtl::OUString unknown = ::rtl::OUString::createFromAscii( "UNKNOWN" );
- ::rtl::OUString language = unknown;
- ::rtl::OUString script = unknown;
- ::rtl::OUString line = unknown;
- ::rtl::OUString type = ::rtl::OUString();
- ::rtl::OUString message = eScriptError.Message;
-
- if ( eScriptError.language.getLength() != 0 )
- {
- language = eScriptError.language;
- }
-
- if ( eScriptError.scriptName.getLength() != 0 )
- {
- script = eScriptError.scriptName;
- }
-
- if ( eScriptError.Message.getLength() != 0 )
- {
- message = eScriptError.Message;
- }
- if ( eScriptError.lineNum != -1 )
- {
- line = ::rtl::OUString::valueOf( eScriptError.lineNum );
- unformatted = String(
- SVX_RES( RID_SVXSTR_ERROR_AT_LINE ) );
- }
- else
- {
- unformatted = String(
- SVX_RES( RID_SVXSTR_ERROR_RUNNING ) );
- }
-
- return FormatErrorString(
- unformatted, language, script, line, type, message );
-}
-
-::rtl::OUString GetErrorMessage(
- const provider::ScriptExceptionRaisedException& eScriptException )
-{
- ::rtl::OUString unformatted =
- String( SVX_RES( RID_SVXSTR_EXCEPTION_AT_LINE ) );
-
- ::rtl::OUString unknown = ::rtl::OUString::createFromAscii( "UNKNOWN" );
- ::rtl::OUString language = unknown;
- ::rtl::OUString script = unknown;
- ::rtl::OUString line = unknown;
- ::rtl::OUString type = unknown;
- ::rtl::OUString message = eScriptException.Message;
-
- if ( eScriptException.language.getLength() != 0 )
- {
- language = eScriptException.language;
- }
- if ( eScriptException.scriptName.getLength() != 0 )
- {
- script = eScriptException.scriptName;
- }
-
- if ( eScriptException.Message.getLength() != 0 )
- {
- message = eScriptException.Message;
- }
-
- if ( eScriptException.lineNum != -1 )
- {
- line = ::rtl::OUString::valueOf( eScriptException.lineNum );
- unformatted = String(
- SVX_RES( RID_SVXSTR_EXCEPTION_AT_LINE ) );
- }
- else
- {
- unformatted = String(
- SVX_RES( RID_SVXSTR_EXCEPTION_RUNNING ) );
- }
-
- if ( eScriptException.exceptionType.getLength() != 0 )
- {
- type = eScriptException.exceptionType;
- }
-
- return FormatErrorString(
- unformatted, language, script, line, type, message );
-
-}
-::rtl::OUString GetErrorMessage(
- const provider::ScriptFrameworkErrorException& sError )
-{
- ::rtl::OUString unformatted = String(
- SVX_RES( RID_SVXSTR_FRAMEWORK_ERROR_RUNNING ) );
-
- ::rtl::OUString language =
- ::rtl::OUString::createFromAscii( "UNKNOWN" );
-
- ::rtl::OUString script =
- ::rtl::OUString::createFromAscii( "UNKNOWN" );
-
- ::rtl::OUString message;
-
- if ( sError.scriptName.getLength() > 0 )
- {
- script = sError.scriptName;
- }
- if ( sError.language.getLength() > 0 )
- {
- language = sError.language;
- }
- if ( sError.errorType == provider::ScriptFrameworkErrorType::NOTSUPPORTED )
- {
- message = String(
- SVX_RES( RID_SVXSTR_ERROR_LANG_NOT_SUPPORTED ) );
- message = ReplaceString(
- message, ::rtl::OUString::createFromAscii( "%LANGUAGENAME" ), language );
-
- }
- else
- {
- message = sError.Message;
- }
- return FormatErrorString(
- unformatted, language, script, ::rtl::OUString(), ::rtl::OUString(), message );
-}
-
-::rtl::OUString GetErrorMessage( const RuntimeException& re )
-{
- Type t = ::getCppuType( &re );
- ::rtl::OUString message = t.getTypeName();
- message += re.Message;
-
- return message;
-}
-
-::rtl::OUString GetErrorMessage( const Exception& e )
-{
- Type t = ::getCppuType( &e );
- ::rtl::OUString message = t.getTypeName();
- message += e.Message;
-
- return message;
-}
-
-::rtl::OUString GetErrorMessage( const com::sun::star::uno::Any& aException )
-{
- ::rtl::OUString exType;
- if ( aException.getValueType() ==
- ::getCppuType( (const reflection::InvocationTargetException* ) NULL ) )
- {
- reflection::InvocationTargetException ite;
- aException >>= ite;
- if ( ite.TargetException.getValueType() == ::getCppuType( ( const provider::ScriptErrorRaisedException* ) NULL ) )
- {
- // Error raised by script
- provider::ScriptErrorRaisedException scriptError;
- ite.TargetException >>= scriptError;
- return GetErrorMessage( scriptError );
- }
- else if ( ite.TargetException.getValueType() == ::getCppuType( ( const provider::ScriptExceptionRaisedException* ) NULL ) )
- {
- // Exception raised by script
- provider::ScriptExceptionRaisedException scriptException;
- ite.TargetException >>= scriptException;
- return GetErrorMessage( scriptException );
- }
- else
- {
- // Unknown error, shouldn't happen
- // OSL_ASSERT(...)
- }
-
- }
- else if ( aException.getValueType() == ::getCppuType( ( const provider::ScriptFrameworkErrorException* ) NULL ) )
- {
- // A Script Framework error has occured
- provider::ScriptFrameworkErrorException sfe;
- aException >>= sfe;
- return GetErrorMessage( sfe );
-
- }
- // unknown exception
- Exception e;
- RuntimeException rte;
- if ( aException >>= rte )
- {
- return GetErrorMessage( rte );
- }
-
- aException >>= e;
- return GetErrorMessage( e );
-
-}
-
-SvxScriptErrorDialog::SvxScriptErrorDialog(
- Window* , ::com::sun::star::uno::Any aException )
- : m_sMessage()
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- m_sMessage = GetErrorMessage( aException );
-}
-
-SvxScriptErrorDialog::~SvxScriptErrorDialog()
-{
-}
-
-short SvxScriptErrorDialog::Execute()
-{
- // Show Error dialog asynchronously
- //
- // Pass a copy of the message to the ShowDialog method as the
- // SvxScriptErrorDialog may be deleted before ShowDialog is called
- Application::PostUserEvent(
- LINK( this, SvxScriptErrorDialog, ShowDialog ),
- new rtl::OUString( m_sMessage ) );
-
- return 0;
-}
-
-IMPL_LINK( SvxScriptErrorDialog, ShowDialog, ::rtl::OUString*, pMessage )
-{
- ::rtl::OUString message;
-
- if ( pMessage && pMessage->getLength() != 0 )
- {
- message = *pMessage;
- }
- else
- {
- message = String( SVX_RES( RID_SVXSTR_ERROR_TITLE ) );
- }
-
- MessBox* pBox = new WarningBox( NULL, WB_OK, message );
- pBox->SetText( SVX_RES( RID_SVXSTR_ERROR_TITLE ) );
- pBox->Execute();
-
- if ( pBox ) delete pBox;
- if ( pMessage ) delete pMessage;
-
- return 0;
-}
diff --git a/svx/source/cui/scriptdlg.hrc b/svx/source/cui/scriptdlg.hrc
deleted file mode 100644
index af327d5705..0000000000
--- a/svx/source/cui/scriptdlg.hrc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: scriptdlg.hrc,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SCRIPTDLG_HRC
-#define _SCRIPTDLG_HRC
-
-#include <svtools/solar.hrc>
-
-#define SCRIPTDLG_OFFSET 400
-
-// ScriptOrgDialog
-#define SF_TXT_SCRIPTS 1
-#define SF_CTRL_SCRIPTSBOX 2
-#define SF_PB_RUN 3
-#define SF_PB_CLOSE 4
-#define SF_PB_CREATE 5
-#define SF_PB_EDIT 6
-#define SF_PB_RENAME 7
-#define SF_PB_DEL 8
-#define SF_PB_HELP 9
-
-#define IMG_HARDDISK 1
-#define IMG_HARDDISK_HC 2
-#define IMG_LIB 3
-#define IMG_LIB_HC 4
-#define IMG_MACRO 5
-#define IMG_MACRO_HC 6
-#define IMG_DOCUMENT 7
-#define IMG_DOCUMENT_HC 8
-
-#define RID_IMGLST_OBJECTS ( RID_BASICIDE_START + 7 )
-#define RID_IMGLST_OBJECTS_HC (RID_BASICIDE_START + 13)
-
-// NewObjectDialog
-#define FT_NEWLIB 10
-#define STR_FT_NEWMACRO 11
-#define STR_NEWLIB 12
-#define STR_NEWMACRO 13
-#define ED_LIBNAME 14
-#define PB_OK 15
-#define PB_CANCEL 16
-#define DLG_NEWLIB 17
-#define STR_FT_RENAME 18
-#define STR_RENAME 19
-
-// Others
-/*
-Please be aware that these strings are global resources, don't use self-defined values!
-You have to use the RID_SVXSTART macro do avoid ID clashes with other resource files. Sfx2 delivers
-some of its own resource files to svx - where they are added to svx resource file!!
-*/
-
-#define STR_MYMACROS 32
-#define STR_PRODMACROS 33
-
-
-#endif // _SCRIPTDLG_HRC
diff --git a/svx/source/cui/scriptdlg.hxx b/svx/source/cui/scriptdlg.hxx
deleted file mode 100644
index a3dde1787b..0000000000
--- a/svx/source/cui/scriptdlg.hxx
+++ /dev/null
@@ -1,251 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: scriptdlg.hxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SCRIPTDLG_HXX
-#define _SCRIPTDLG_HXX
-
-#include <memory>
-
-#include "tools/solar.h"
-
-#include <svtools/svtreebx.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/abstdlg.hxx>
-#include <sfx2/basedlgs.hxx>
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/script/browse/XBrowseNode.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-
-#include <hash_map>
-
-#define OBJTYPE_BASICMANAGER 1L
-//#define OBJTYPE_LIB 2L
-//#define OBJTYPE_MODULE 3L
-#define OBJTYPE_METHOD 2L
-//#define OBJTYPE_METHODINOBJ 5L
-//#define OBJTYPE_OBJECT 6L
-//#define OBJTYPE_SUBOBJ 7L
-//#define OBJTYPE_PROPERTY 8L
-#define OBJTYPE_SCRIPTCONTAINER 3L
-#define OBJTYPE_SFROOT 4L
-
-#define BROWSEMODE_MODULES 0x01
-#define BROWSEMODE_SUBS 0x02
-#define BROWSEMODE_OBJS 0x04
-#define BROWSEMODE_PROPS 0x08
-#define BROWSEMODE_SUBOBJS 0x10
-
-#define INPUTMODE_NEWLIB 1
-#define INPUTMODE_NEWMACRO 2
-#define INPUTMODE_RENAME 3
-
-typedef ::std::hash_map < ::rtl::OUString, ::rtl::OUString ,
- ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > Selection_hash;
-
-class SFEntry;
-
-class SFTreeListBox : public SvTreeListBox
-{
- friend class SvxScriptOrgDialog;
-private:
- USHORT nMode;
- Image m_hdImage;
- Image m_hdImage_hc;
- Image m_libImage;
- Image m_libImage_hc;
- Image m_macImage;
- Image m_macImage_hc;
- Image m_docImage;
- Image m_docImage_hc;
- ::rtl::OUString m_sMyMacros;
- ::rtl::OUString m_sProdMacros;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >
- getLangNodeFromRootNode( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& root, ::rtl::OUString& language );
- void delUserData( SvLBoxEntry* pEntry );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, ::rtl::OUString& docName );
-
-protected:
- void ExpandTree( SvLBoxEntry* pRootEntry );
- virtual void RequestingChilds( SvLBoxEntry* pParent );
- virtual void ExpandedHdl();
- SvLBoxEntry* FindEntry( SvLBoxEntry* pParent, const String& rText, BYTE nType );
- virtual long ExpandingHdl();
- static BOOL dialogSort1( com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node1,
- com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node2 );
- static BOOL dialogSort2( com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node1,
- com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node2 );
-
-public:
- void Init( const ::rtl::OUString& language );
- void RequestSubEntries( SvLBoxEntry* pRootEntry, ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& node,
- ::com::sun::star::uno::Reference< com::sun::star::frame::XModel>& model );
- SFTreeListBox( Window* pParent, const ResId& rRes );
- ~SFTreeListBox();
-
- void UpdateEntries();
-
- void ExpandAllTrees();
-
-
-
- SvLBoxEntry * insertEntry(String const & rText, USHORT nBitmap,
- SvLBoxEntry * pParent,
- bool bChildrenOnDemand,
- std::auto_ptr< SFEntry > aUserData,
- ::rtl::OUString factoryURL );
- SvLBoxEntry * insertEntry(String const & rText, USHORT nBitmap,
- SvLBoxEntry * pParent,
- bool bChildrenOnDemand,
- std::auto_ptr< SFEntry > aUserData );
- void deleteTree( SvLBoxEntry * pEntry );
- void deleteAllTree( );
-};
-
-class InputDialog : public ModalDialog
-{
-private:
- FixedText aText;
- Edit aEdit;
- OKButton aOKButton;
- CancelButton aCancelButton;
-
-public:
- InputDialog( Window * pParent, USHORT nMode );
- ~InputDialog();
-
- String GetObjectName() const { return aEdit.GetText(); }
- void SetObjectName( const String& rName ) { aEdit.SetText( rName ); aEdit.SetSelection( Selection( 0, rName.Len() ) );}
-};
-
-class SFEntry
-{
-private:
- BYTE nType;
- bool loaded;
- ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > nodes;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > model;
- SFEntry(){}
-public:
- SFEntry( BYTE nT ) { nType = nT; loaded=false; }
- SFEntry( BYTE nT,
- const ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& entryNodes ,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& entryModel) { nType = nT; nodes = entryNodes; loaded=false; model = entryModel; }
- SFEntry( const SFEntry& r ) { nType = r.nType; nodes = r.nodes; loaded = r.loaded; }
- virtual ~SFEntry() {}
- ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > GetNode() { return nodes ;}
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModel() { return model ;};
- BYTE GetType() const { return nType; }
- bool isLoaded() const { return loaded; }
- void setLoaded() { loaded=true; }
-};
-
-class SvxScriptOrgDialog : public SfxModalDialog
-{
-protected:
- FixedText aScriptsTxt;
- SFTreeListBox aScriptsBox;
-
- PushButton aRunButton;
- CancelButton aCloseButton;
- PushButton aCreateButton;
- PushButton aEditButton;
- PushButton aRenameButton;
- PushButton aDelButton;
- HelpButton aHelpButton;
-
- ::rtl::OUString m_sLanguage;
- static Selection_hash m_lastSelection;
- const String m_delErrStr;
- const String m_delErrTitleStr;
- const String m_delQueryStr;
- const String m_delQueryTitleStr;
- const String m_createErrStr;
- const String m_createDupStr;
- const String m_createErrTitleStr;
- const String m_renameErrStr;
- const String m_renameDupStr;
- const String m_renameErrTitleStr;
-
- DECL_LINK( MacroSelectHdl, SvTreeListBox * );
- DECL_LINK( MacroDoubleClickHdl, SvTreeListBox * );
- DECL_LINK( ScriptSelectHdl, SvTreeListBox * );
- DECL_LINK( ButtonHdl, Button * );
- BOOL getBoolProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xProps, ::rtl::OUString& propName );
- void CheckButtons( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& node );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, ::rtl::OUString& docName );
-
- void createEntry( SvLBoxEntry* pEntry );
- void renameEntry( SvLBoxEntry* pEntry );
- void deleteEntry( SvLBoxEntry* pEntry );
- ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >
- getBrowseNode( SvLBoxEntry* pEntry );
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getModel( SvLBoxEntry* pEntry );
- void EnableButton( Button& rButton, BOOL bEnable );
- String getListOfChildren( ::com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node, int depth );
- void StoreCurrentSelection();
- void RestorePreviousSelection();
- //String GetInfo( SbxVariable* pVar );
-
-public:
- // prob need another arg in the ctor
- // to specify the language or provider
- SvxScriptOrgDialog( Window* pParent, ::rtl::OUString language );
- ~SvxScriptOrgDialog();
-
- virtual short Execute();
-
- //DECL_LINK( ActivatePageHdl, TabControl * );
-};
-
-class SvxScriptErrorDialog : public VclAbstractDialog
-{
-private:
-
- ::rtl::OUString m_sMessage;
-
- DECL_LINK( ShowDialog, ::rtl::OUString* );
-
-public:
-
- SvxScriptErrorDialog(
- Window* parent, ::com::sun::star::uno::Any aException );
-
- ~SvxScriptErrorDialog();
-
- short Execute();
-};
-
-#endif // _SCRIPTDLG_HXX
diff --git a/svx/source/cui/scriptdlg.src b/svx/source/cui/scriptdlg.src
deleted file mode 100644
index 112d5861c3..0000000000
--- a/svx/source/cui/scriptdlg.src
+++ /dev/null
@@ -1,310 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: scriptdlg.src,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-#include "scriptdlg.hrc"
-#include "helpid.hrc"
-
-#define MASKCOLOR MaskColor = \
- Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
-ModalDialog RID_DLG_SCRIPTORGANIZER
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 210 , 165 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "%MACROLANG Macros";
- Closeable = TRUE ;
- HelpId = HID_SCRIPTORG_DIALOG;
- FixedText SF_TXT_SCRIPTS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- Text [ en-US ] = "~Macros" ;
- };
-
- Control SF_CTRL_SCRIPTSBOX
- {
- HelpId = HID_SCRIPTSBOX ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 16 ) ;
- Size = MAP_APPFONT ( 130 , 144 ) ;
- TabStop = TRUE ;
- Image IMG_HARDDISK
- {
- ImageBitmap = Bitmap { File = "harddisk_16.bmp" ; };
- MASKCOLOR
- };
- Image IMG_HARDDISK_HC
- {
- ImageBitmap = Bitmap { File = "harddisk_16_h.bmp" ; };
- MASKCOLOR
- };
- Image IMG_LIB
- {
- ImageBitmap = Bitmap { File = "im30820.png"; };
- MASKCOLOR
- };
- Image IMG_LIB_HC
- {
- ImageBitmap = Bitmap { File = "imh30820.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "im30821.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO_HC
- {
- ImageBitmap = Bitmap { File = "imh30821.png"; };
- MASKCOLOR
- };
- Image IMG_DOCUMENT
- {
- ImageBitmap = Bitmap { File = "im30826.png"; };
- MASKCOLOR
- };
- Image IMG_DOCUMENT_HC
- {
- ImageBitmap = Bitmap { File = "imh30826.png"; };
- MASKCOLOR
- };
- String STR_MYMACROS
- {
- Text [ en-US ] = "My Macros";
- };
- String STR_PRODMACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros";
- };
- };
-
- PushButton SF_PB_RUN
- {
- Pos = MAP_APPFONT ( 144 , 6 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- DefButton = TRUE;
- Text [ en-US ] = "R~un" ;
- };
- CancelButton SF_PB_CLOSE
- {
- Pos = MAP_APPFONT ( 144 , 23 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Close" ;
- };
-
- PushButton SF_PB_CREATE
- {
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Pos = MAP_APPFONT ( 144 , 60 ) ;
- Text [ en-US ] = "~Create..." ;
- TabStop = TRUE ;
- };
- PushButton SF_PB_EDIT
- {
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Pos = MAP_APPFONT ( 144 , 77 ) ;
- Text [ en-US ] = "~Edit" ;
- TabStop = TRUE ;
- };
- PushButton SF_PB_RENAME
- {
- Pos = MAP_APPFONT ( 144 , 94 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "Rename..." ;
- };
- PushButton SF_PB_DEL
- {
- Pos = MAP_APPFONT ( 144 , 114 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- HelpButton SF_PB_HELP
- {
- Pos = MAP_APPFONT ( 144 , 131 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- TabStop = TRUE ;
- };
-
-};
-ModalDialog RID_DLG_NEWLIB
-{
- Text [ en-US ] = "Create Library" ;
- Size = MAP_APPFONT ( 160 , 50 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton PB_OK
- {
- Pos = MAP_APPFONT ( 104 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT ( 104 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_NEWLIB
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 100 , 50 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "Enter the name for the new library." ;
- };
- Edit ED_LIBNAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 59 ) ;
- Size = MAP_APPFONT ( 92 , 12 ) ;
- TabStop = TRUE ;
- };
- String STR_NEWLIB
- {
- Text [ en-US ] = "Create Library" ;
- };
- String STR_NEWMACRO
- {
- Text [ en-US ] = "Create Macro" ;
- };
- String STR_FT_NEWMACRO
- {
- Text [ en-US ] = "Enter the name for the new macro." ;
- };
- String STR_RENAME
- {
- Text [ en-US ] = "Rename" ;
- };
- String STR_FT_RENAME
- {
- Text [ en-US ] = "Enter the new name for the selected object." ;
- };
-};
-String RID_SVXSTR_DELQUERY
-{
- Text [ en-US ] = "Do you want to delete the following object?";
-};
-String RID_SVXSTR_DELQUERY_TITLE
-{
- Text [ en-US ] = "Confirm Deletion";
-};
-String RID_SVXSTR_DELFAILED
-{
- Text [ en-US ] = "The selected object could not be deleted.";
-};
-String RID_SVXSTR_DELFAILEDPERM
-{
- Text [ en-US ] = " You do not have permission to delete this object.";
-};
-String RID_SVXSTR_DELFAILED_TITLE
-{
- Text [ en-US ] = "Error Deleting Object";
-};
-String RID_SVXSTR_CREATEFAILED
-{
- Text [ en-US ] = "The object could not be created.";
-};
-String RID_SVXSTR_CREATEFAILEDDUP
-{
- Text [ en-US ] = " Object with the same name already exists.";
-};
-String RID_SVXSTR_CREATEFAILEDPERM
-{
- Text [ en-US ] = " You do not have permission to create this object.";
-};
-String RID_SVXSTR_CREATEFAILED_TITLE
-{
- Text [ en-US ] = "Error Creating Object";
-};
-String RID_SVXSTR_RENAMEFAILED
-{
- Text [ en-US ] = "The object could not be renamed.";
-};
-String RID_SVXSTR_RENAMEFAILEDPERM
-{
- Text [ en-US ] = " You do not have permission to rename this object.";
-};
-String RID_SVXSTR_RENAMEFAILED_TITLE
-{
- Text [ en-US ] = "Error Renaming Object";
-};
-
-String RID_SVXSTR_ERROR_TITLE
-{
- Text [ en-US ] = "%PRODUCTNAME Error";
-};
-
-String RID_SVXSTR_ERROR_LANG_NOT_SUPPORTED
-{
- Text [ en-US ] = "The scripting language %LANGUAGENAME is not supported.";
-};
-String RID_SVXSTR_ERROR_RUNNING
-{
- Text [ en-US ] = "An error occurred while running the %LANGUAGENAME script %SCRIPTNAME.";
-};
-
-String RID_SVXSTR_EXCEPTION_RUNNING
-{
- Text [ en-US ] = "An exception occurred while running the %LANGUAGENAME script %SCRIPTNAME.";
-};
-
-String RID_SVXSTR_ERROR_AT_LINE
-{
- Text [ en-US ] = "An error occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.";
-};
-
-String RID_SVXSTR_EXCEPTION_AT_LINE
-{
- Text [ en-US ] = "An exception occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.";
-};
-
-String RID_SVXSTR_FRAMEWORK_ERROR_RUNNING
-{
- Text [ en-US ] = "A Scripting Framework error occurred while running the %LANGUAGENAME script %SCRIPTNAME.";
-};
-
-String RID_SVXSTR_FRAMEWORK_ERROR_AT_LINE
-{
- Text [ en-US ] = "A Scripting Framework error occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.";
-};
-
-String RID_SVXSTR_ERROR_TYPE_LABEL
-{
- Text [ en-US ] = "Type:";
-};
-
-String RID_SVXSTR_ERROR_MESSAGE_LABEL
-{
- Text [ en-US ] = "Message:";
-};
diff --git a/svx/source/cui/sdbcdriverenum.cxx b/svx/source/cui/sdbcdriverenum.cxx
deleted file mode 100644
index 1fc0335ed3..0000000000
--- a/svx/source/cui/sdbcdriverenum.cxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdbcdriverenum.cxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "sdbcdriverenum.hxx"
-#include <comphelper/stl_types.hxx>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
-
- //====================================================================
- //= ODriverEnumerationImpl
- //====================================================================
- class ODriverEnumerationImpl
- {
- protected:
- ::std::vector< ::rtl::OUString > m_aImplNames;
-
- public:
- ODriverEnumerationImpl();
-
- const ::std::vector< ::rtl::OUString >& getDriverImplNames() const { return m_aImplNames; }
- };
-
- //--------------------------------------------------------------------
- ODriverEnumerationImpl::ODriverEnumerationImpl()
- {
- try
- {
- Reference< XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory();
- Reference< XInterface > xDM = xORB->createInstance(::rtl::OUString::createFromAscii("com.sun.star.sdbc.DriverManager"));
- OSL_ENSURE(xDM.is(), "ODriverEnumerationImpl::ODriverEnumerationImpl: no access to the SDBC driver manager!");
-
- Reference< XEnumerationAccess > xEnumAccess(xDM, UNO_QUERY);
- OSL_ENSURE(xEnumAccess.is() || !xDM.is(), "ODriverEnumerationImpl::ODriverEnumerationImpl: can't enumerate SDBC drivers (missing the interface)!");
- if (xEnumAccess.is())
- {
- Reference< XEnumeration > xEnumDrivers = xEnumAccess->createEnumeration();
- OSL_ENSURE(xEnumDrivers.is(), "ODriverEnumerationImpl::ODriverEnumerationImpl: invalid enumeration object!");
-
- Reference< XServiceInfo > xDriverSI;
- while (xEnumDrivers->hasMoreElements())
- {
- xEnumDrivers->nextElement() >>= xDriverSI;
- OSL_ENSURE(xDriverSI.is(), "ODriverEnumerationImpl::ODriverEnumerationImpl: driver without service info!");
- if (xDriverSI.is())
- m_aImplNames.push_back(xDriverSI->getImplementationName());
- }
- }
- }
- catch(const Exception&)
- {
- OSL_ENSURE(sal_False, "ODriverEnumerationImpl::ODriverEnumerationImpl: caught an exception while enumerating the drivers!");
- }
- }
-
- //====================================================================
- //= ODriverEnumeration
- //====================================================================
- //--------------------------------------------------------------------
- ODriverEnumeration::ODriverEnumeration() throw()
- :m_pImpl(new ODriverEnumerationImpl)
- {
- }
-
- //--------------------------------------------------------------------
- ODriverEnumeration::~ODriverEnumeration() throw()
- {
- delete m_pImpl;
- }
-
- //--------------------------------------------------------------------
- ODriverEnumeration::const_iterator ODriverEnumeration::begin() const throw()
- {
- return m_pImpl->getDriverImplNames().begin();
- }
-
- //--------------------------------------------------------------------
- ODriverEnumeration::const_iterator ODriverEnumeration::end() const throw()
- {
- return m_pImpl->getDriverImplNames().end();
- }
-
- //--------------------------------------------------------------------
- sal_Int32 ODriverEnumeration::size() const throw()
- {
- return m_pImpl->getDriverImplNames().size();
- }
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-
diff --git a/svx/source/cui/sdbcdriverenum.hxx b/svx/source/cui/sdbcdriverenum.hxx
deleted file mode 100644
index 447fa70051..0000000000
--- a/svx/source/cui/sdbcdriverenum.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdbcdriverenum.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _OFFMGR_SDBCDRIVERENUMERATION_HXX_
-#define _OFFMGR_SDBCDRIVERENUMERATION_HXX_
-
-
-#include <sal/types.h>
-
-#include <vector>
-
-namespace rtl
-{
- class OUString;
-}
-
-//........................................................................
-namespace offapp
-{
-//........................................................................
-
- //====================================================================
- //= ODriverEnumeration
- //====================================================================
- class ODriverEnumerationImpl;
- /** simple class for accessing SDBC drivers registered within the office
- <p>Rather small, introduced to not contaminate other instances with the
- exception handling (code-size-bloating) implementations here.
- </p>
- */
- class ODriverEnumeration
- {
- private:
- ODriverEnumerationImpl* m_pImpl;
-
- public:
- ODriverEnumeration() throw();
- ~ODriverEnumeration() throw();
- typedef ::std::vector< ::rtl::OUString >::const_iterator const_iterator;
-
- const_iterator begin() const throw();
- const_iterator end() const throw();
- sal_Int32 size() const throw();
- };
-
-//........................................................................
-} // namespace offapp
-//........................................................................
-
-#endif // _OFFMGR_SDBCDRIVERENUMERATION_HXX_
-
-
diff --git a/svx/source/cui/sdrcelldlg.cxx b/svx/source/cui/sdrcelldlg.cxx
deleted file mode 100644
index f5e9f719ce..0000000000
--- a/svx/source/cui/sdrcelldlg.cxx
+++ /dev/null
@@ -1,106 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrcelldlg.cxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <svtools/cjkoptions.hxx>
-#include "flagsdef.hxx"
-#include "svx/dialogs.hrc"
-#include "sdrcelldlg.hxx"
-#include "svx/dialmgr.hxx"
-#include "cuitabarea.hxx"
-#include "svx/svdmodel.hxx"
-#include "border.hxx"
-
-SvxFormatCellsDialog::SvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel )
-: SfxTabDialog ( pParent, SVX_RES( RID_SVX_FORMAT_CELLS_DLG ), pAttr )
-, mrOutAttrs ( *pAttr )
-, mpColorTab ( pModel->GetColorTable() )
-, mpGradientList ( pModel->GetGradientList() )
-, mpHatchingList ( pModel->GetHatchList() )
-, mpBitmapList ( pModel->GetBitmapList() )
-
-{
- FreeResource();
-
- AddTabPage( RID_SVXPAGE_CHAR_NAME );
- AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
- AddTabPage( RID_SVXPAGE_BORDER );
- AddTabPage( RID_SVXPAGE_AREA );
-
-/*
- SvtCJKOptions aCJKOptions;
- if( aCJKOptions.IsAsianTypographyEnabled() )
- AddTabPage( RID_SVXPAGE_PARA_ASIAN);
- else
- RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
-*/
-}
-
-SvxFormatCellsDialog::~SvxFormatCellsDialog()
-{
-}
-
-void SvxFormatCellsDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
-{
- switch( nId )
- {
- case RID_SVXPAGE_AREA:
- ( (SvxAreaTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxAreaTabPage&) rPage ).SetGradientList( mpGradientList );
- ( (SvxAreaTabPage&) rPage ).SetHatchingList( mpHatchingList );
- ( (SvxAreaTabPage&) rPage ).SetBitmapList( mpBitmapList );
- ( (SvxAreaTabPage&) rPage ).SetPageType( PT_AREA );
- ( (SvxAreaTabPage&) rPage ).SetDlgType( 1 );
- ( (SvxAreaTabPage&) rPage ).SetPos( 0 );
-// ( (SvxAreaTabPage&) rPage ).SetAreaTP( &mbAreaTP );
-// ( (SvxAreaTabPage&) rPage ).SetGrdChgd( &mnGradientListState );
-// ( (SvxAreaTabPage&) rPage ).SetHtchChgd( &mnHatchingListState );
-// ( (SvxAreaTabPage&) rPage ).SetBmpChgd( &mnBitmapListState );
-// ( (SvxAreaTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxAreaTabPage&) rPage ).Construct();
- // ActivatePage() wird das erste mal nicht gerufen
- ( (SvxAreaTabPage&) rPage ).ActivatePage( mrOutAttrs );
-
- break;
-
- default:
- SfxTabDialog::PageCreated( nId, rPage );
- break;
- }
-}
-
-void SvxFormatCellsDialog::Apply()
-{
-}
diff --git a/svx/source/cui/sdrcelldlg.hxx b/svx/source/cui/sdrcelldlg.hxx
deleted file mode 100644
index 6633066585..0000000000
--- a/svx/source/cui/sdrcelldlg.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrcelldlg.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_FORMAT_CELLS_DLG_HXX
-#define _SVX_FORMAT_CELLS_DLG_HXX
-
-
-#include <sfx2/tabdlg.hxx>
-
-class XColorTable;
-class XGradientList;
-class XHatchList;
-class XBitmapList;
-class SdrModel;
-
-class SvxFormatCellsDialog : public SfxTabDialog
-{
-private:
- const SfxItemSet& mrOutAttrs;
-
- XColorTable* mpColorTab;
- XGradientList* mpGradientList;
- XHatchList* mpHatchingList;
- XBitmapList* mpBitmapList;
-
-protected:
- virtual void Apply();
-
-public:
- SvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel );
- ~SvxFormatCellsDialog();
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-};
-
-#endif // _SVX_FORMAT_CELLS_DLG_HXX
-
-
diff --git a/svx/source/cui/sdrcelldlg.src b/svx/source/cui/sdrcelldlg.src
deleted file mode 100644
index f657697bd4..0000000000
--- a/svx/source/cui/sdrcelldlg.src
+++ /dev/null
@@ -1,142 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sdrcelldlg.src,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-TabDialog RID_SVX_FORMAT_CELLS_DLG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 289 , 176 ) ;
- Text [ de ] = "Zellen formatieren" ;
- Text [ en-US ] = "Format Cells" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_CHAR_NAME ;
- PageResID = RID_SVXPAGE_CHAR_NAME ;
- Text [ de ] = "Schrift" ;
- Text [ en-US ] = "Font" ;
- Text [ x-comment ] = " ";
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_CHAR_EFFECTS ;
- PageResID = RID_SVXPAGE_CHAR_EFFECTS ;
- Text [ de ] = "Schrifteffekt" ;
- Text [ en-US ] = "Font Effects" ;
- Text [ x-comment ] = " ";
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_BORDER;
- PageResID = RID_SVXPAGE_BORDER;
- Text [ de ] = "Umrandung" ;
- Text [ en-US ] = "Borders" ;
- Text [ x-comment ] = " ";
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_AREA;
- PageResID = RID_SVXPAGE_AREA;
- Text [ de ] = "Hintergrund";
- Text [ en-US ] = "Background";
- Text [ x-comment ] = " ";
- };
- };
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 6 , 151 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 60 , 151 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 114 , 151 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- PushButton 1
- {
- Pos = MAP_APPFONT ( 169 , 151 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */
- Text [ de ] = "Zurück" ;
- Text [ en-US ] = "Return" ;
- TabStop = TRUE ;
- Text [ x-comment ] = " ";
- };
- Text [ x-comment ] = " ";
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/securityoptions.cxx b/svx/source/cui/securityoptions.cxx
deleted file mode 100644
index 8689d911ec..0000000000
--- a/svx/source/cui/securityoptions.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: securityoptions.cxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#ifndef INCLUDED_SVTOOLS_SECURITIYOPTIONS_HXX
-#include <svtools/securityoptions.hxx>
-#endif
-#include <svtools/stdctrl.hxx>
-#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-
-#include "securityoptions.hxx"
-#include "securityoptions.hrc"
-
-namespace
-{
- bool enableAndSet( const SvtSecurityOptions& rOptions,
- SvtSecurityOptions::EOption eOption,
- CheckBox& rCheckBox, FixedImage& rFixedImage )
- {
- bool bEnable = rOptions.IsOptionEnabled( eOption );
- rCheckBox.Enable( bEnable );
- rFixedImage.Show( !bEnable );
- rCheckBox.Check( rOptions.IsOptionSet( eOption ) );
- return bEnable;
- }
-}
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
-SecurityOptionsDialog::SecurityOptionsDialog( Window* pParent, SvtSecurityOptions* pOptions ) :
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_SECURITY_OPTIONS ) )
- ,m_aWarningsFL ( this, SVX_RES( FL_WARNINGS ) )
- ,m_aWarningsFI ( this, SVX_RES( FI_WARNINGS ) )
- ,m_aSaveOrSendDocsFI( this, SVX_RES( FI_SAVESENDDOCS ) )
- ,m_aSaveOrSendDocsCB( this, SVX_RES( CB_SAVESENDDOCS ) )
- ,m_aSignDocsFI ( this, SVX_RES( FI_SIGNDOCS ) )
- ,m_aSignDocsCB ( this, SVX_RES( CB_SIGNDOCS ) )
- ,m_aPrintDocsFI ( this, SVX_RES( FI_PRINTDOCS ) )
- ,m_aPrintDocsCB ( this, SVX_RES( CB_PRINTDOCS ) )
- ,m_aCreatePdfFI ( this, SVX_RES( FI_CREATEPDF ) )
- ,m_aCreatePdfCB ( this, SVX_RES( CB_CREATEPDF ) )
- ,m_aOptionsFL ( this, SVX_RES( FL_OPTIONS ) )
- ,m_aRemovePersInfoFI( this, SVX_RES( FI_REMOVEINFO ) )
- ,m_aRemovePersInfoCB( this, SVX_RES( CB_REMOVEINFO ) )
- ,m_aRecommPasswdFI ( this, SVX_RES( FI_RECOMMENDPWD ) )
- ,m_aRecommPasswdCB ( this, SVX_RES( CB_RECOMMENDPWD ) )
- ,m_aCtrlHyperlinkFI ( this, SVX_RES( FI_CTRLHYPERLINK ) )
- ,m_aCtrlHyperlinkCB ( this, SVX_RES( CB_CTRLHYPERLINK ) )
-
- ,m_aButtonsFL ( this, SVX_RES( FL_BUTTONS ) )
- ,m_aOKBtn ( this, SVX_RES( PB_OK ) )
- ,m_aCancelBtn ( this, SVX_RES( PB_CANCEL ) )
- ,m_aHelpBtn ( this, SVX_RES( PB_HELP ) )
-
-{
- FreeResource();
-
- DBG_ASSERT( pOptions, "SecurityOptionsDialog::SecurityOptionsDialog(): invalid SvtSecurityOptions" );
- enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_SAVEORSEND, m_aSaveOrSendDocsCB, m_aSaveOrSendDocsFI );
- enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_SIGNING, m_aSignDocsCB, m_aSignDocsFI );
- enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_PRINT, m_aPrintDocsCB, m_aPrintDocsFI );
- enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_CREATEPDF, m_aCreatePdfCB, m_aCreatePdfFI );
- enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_REMOVEPERSONALINFO, m_aRemovePersInfoCB, m_aRemovePersInfoFI );
- enableAndSet( *pOptions, SvtSecurityOptions::E_DOCWARN_RECOMMENDPASSWORD, m_aRecommPasswdCB, m_aRecommPasswdFI );
- enableAndSet( *pOptions, SvtSecurityOptions::E_CTRLCLICK_HYPERLINK, m_aCtrlHyperlinkCB, m_aCtrlHyperlinkFI );
-}
-
-SecurityOptionsDialog::~SecurityOptionsDialog()
-{
-}
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
diff --git a/svx/source/cui/securityoptions.hrc b/svx/source/cui/securityoptions.hrc
deleted file mode 100644
index 50133cc9b9..0000000000
--- a/svx/source/cui/securityoptions.hrc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: securityoptions.hrc,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_SECURITYOPTIONS_HRC
-#define _SVX_SECURITYOPTIONS_HRC
-
-#define FL_WARNINGS 10
-#define FI_WARNINGS 11
-#define FI_SAVESENDDOCS 12
-#define CB_SAVESENDDOCS 13
-#define FI_SIGNDOCS 14
-#define CB_SIGNDOCS 15
-#define FI_PRINTDOCS 16
-#define CB_PRINTDOCS 17
-#define FI_CREATEPDF 18
-#define CB_CREATEPDF 19
-#define FL_OPTIONS 20
-#define FI_REMOVEINFO 21
-#define CB_REMOVEINFO 22
-#define FI_RECOMMENDPWD 23
-#define CB_RECOMMENDPWD 24
-#define FI_CTRLHYPERLINK 25
-#define CB_CTRLHYPERLINK 26
-#define FL_BUTTONS 27
-#define PB_OK 28
-#define PB_CANCEL 29
-#define PB_HELP 30
-
-#define DLG_WIDTH 260
-
-#define COL_0 (RSC_SP_DLG_INNERBORDER_LEFT)
-#define COL_1 (COL_0+RSC_SP_FLGR_SPACE_X)
-#define COL_2 (COL_1+RSC_SP_CHK_TEXTINDENT)
-#define COL_4 (DLG_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT)
-#define COL_3 (COL_4-RSC_SP_FLGR_SPACE_X)
-
-#define COL_C (COL_4-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_B (COL_C-RSC_SP_CTRL_X-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_A (COL_B-RSC_SP_CTRL_GROUP_X-RSC_CD_PUSHBUTTON_WIDTH)
-
-#define CHECKBOX_WIDTH ((COL_3-COL_2-RSC_SP_CTRL_X)/2)
-
-#define ROW_0 (RSC_SP_DLG_INNERBORDER_TOP)
-#define ROW_1 (ROW_0+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_2 (ROW_1+2*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_3 (ROW_2+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_4 (ROW_3+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_5 (ROW_4+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_6 (ROW_5+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_7 (ROW_6+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_8 (ROW_7+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_9 (ROW_8+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_10 (ROW_9+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_DLG_INNERBORDER_BOTTOM)
-
-#endif // #ifndef _SVX_SECURITYOPTIONS_HRC
-
diff --git a/svx/source/cui/securityoptions.hxx b/svx/source/cui/securityoptions.hxx
deleted file mode 100644
index d93bf33352..0000000000
--- a/svx/source/cui/securityoptions.hxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: securityoptions.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SECURITYOPTIONS_HXX
-#define _SVX_SECURITYOPTIONS_HXX
-
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-
-#include "readonlyimage.hxx"
-
-class SvtSecurityOptions;
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- //====================================================================
- //= class SecurityOptionsDialog
- //====================================================================
- class SecurityOptionsDialog : public ModalDialog
- {
- private:
- FixedLine m_aWarningsFL;
- FixedInfo m_aWarningsFI;
- ReadOnlyImage m_aSaveOrSendDocsFI;
- CheckBox m_aSaveOrSendDocsCB;
- ReadOnlyImage m_aSignDocsFI;
- CheckBox m_aSignDocsCB;
- ReadOnlyImage m_aPrintDocsFI;
- CheckBox m_aPrintDocsCB;
- ReadOnlyImage m_aCreatePdfFI;
- CheckBox m_aCreatePdfCB;
-
- FixedLine m_aOptionsFL;
- ReadOnlyImage m_aRemovePersInfoFI;
- CheckBox m_aRemovePersInfoCB;
- ReadOnlyImage m_aRecommPasswdFI;
- CheckBox m_aRecommPasswdCB;
- ReadOnlyImage m_aCtrlHyperlinkFI;
- CheckBox m_aCtrlHyperlinkCB;
-
- FixedLine m_aButtonsFL;
- OKButton m_aOKBtn;
- CancelButton m_aCancelBtn;
- HelpButton m_aHelpBtn;
-
- public:
- SecurityOptionsDialog( Window* pParent, SvtSecurityOptions* pOptions );
- ~SecurityOptionsDialog();
-
- inline bool IsSaveOrSendDocsChecked() const { return m_aSaveOrSendDocsCB.IsChecked() != FALSE; }
- inline bool IsSignDocsChecked() const { return m_aSignDocsCB.IsChecked() != FALSE; }
- inline bool IsPrintDocsChecked() const { return m_aPrintDocsCB.IsChecked() != FALSE; }
- inline bool IsCreatePdfChecked() const { return m_aCreatePdfCB.IsChecked() != FALSE; }
- inline bool IsRemovePersInfoChecked() const { return m_aRemovePersInfoCB.IsChecked() != FALSE; }
- inline bool IsRecommPasswdChecked() const { return m_aRecommPasswdCB.IsChecked() != FALSE; }
- inline bool IsCtrlHyperlinkChecked() const { return m_aCtrlHyperlinkCB.IsChecked() != FALSE; }
- };
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
-#endif // #ifndef _SVX_SECURITYOPTIONS_HXX
-
diff --git a/svx/source/cui/securityoptions.src b/svx/source/cui/securityoptions.src
deleted file mode 100644
index bb74567f2f..0000000000
--- a/svx/source/cui/securityoptions.src
+++ /dev/null
@@ -1,168 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: securityoptions.src,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include --------------------------------------------------------------
-
-#include <svtools/controldims.hrc>
-#include "securityoptions.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-ModalDialog RID_SVXDLG_SECURITY_OPTIONS
-{
- HelpID = HID_DLG_SECURITY_OPTIONS ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( DLG_WIDTH , ROW_10 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "Security options and warnings" ;
- FixedLine FL_WARNINGS
- {
- Pos = MAP_APPFONT( COL_0, ROW_0 );
- Size = MAP_APPFONT( COL_4-COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Security warnings";
- };
- FixedText FI_WARNINGS
- {
- Pos = MAP_APPFONT( COL_1, ROW_1 );
- Size = MAP_APPFONT( COL_3-COL_1, 2*RSC_CD_FIXEDLINE_HEIGHT );
- Wordbreak = TRUE;
- Text [ en-US ] = "Warn if document contains recorded changes, versions, hidden information or notes:";
- };
- FixedImage FI_SAVESENDDOCS
- {
- Pos = MAP_APPFONT( COL_2 - 7, ROW_2 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_SAVESENDDOCS
- {
- Pos = MAP_APPFONT( COL_2, ROW_2 );
- Size = MAP_APPFONT( CHECKBOX_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "When saving or sending";
- };
- FixedImage FI_SIGNDOCS
- {
- Pos = MAP_APPFONT( COL_2 + CHECKBOX_WIDTH + RSC_SP_CTRL_X - 7, ROW_2 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_SIGNDOCS
- {
- Pos = MAP_APPFONT( COL_2 + CHECKBOX_WIDTH + RSC_SP_CTRL_X, ROW_2 );
- Size = MAP_APPFONT( CHECKBOX_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "When signing";
- };
- FixedImage FI_PRINTDOCS
- {
- Pos = MAP_APPFONT( COL_2 - 7, ROW_3 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_PRINTDOCS
- {
- Pos = MAP_APPFONT( COL_2, ROW_3 );
- Size = MAP_APPFONT( CHECKBOX_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "When printing";
- };
- FixedImage FI_CREATEPDF
- {
- Pos = MAP_APPFONT( COL_2 + CHECKBOX_WIDTH + RSC_SP_CTRL_X - 7, ROW_3 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_CREATEPDF
- {
- Pos = MAP_APPFONT( COL_2 + CHECKBOX_WIDTH + RSC_SP_CTRL_X, ROW_3 );
- Size = MAP_APPFONT( CHECKBOX_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "When creating PDF files";
- };
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT( COL_0, ROW_4 );
- Size = MAP_APPFONT( COL_4-COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Security options";
- };
- FixedImage FI_REMOVEINFO
- {
- Pos = MAP_APPFONT( COL_1 - 7, ROW_5 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_REMOVEINFO
- {
- Pos = MAP_APPFONT( COL_1, ROW_5 );
- Size = MAP_APPFONT( COL_3-COL_1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Remove personal information on saving";
- };
- FixedImage FI_RECOMMENDPWD
- {
- Pos = MAP_APPFONT( COL_1 - 7, ROW_6 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_RECOMMENDPWD
- {
- Pos = MAP_APPFONT( COL_1, ROW_6 );
- Size = MAP_APPFONT( COL_3-COL_1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Recommend password protection on saving";
- };
- FixedImage FI_CTRLHYPERLINK
- {
- Pos = MAP_APPFONT( COL_1 - 7, ROW_6 + 2 );
- Size = MAP_APPFONT( 6, 6 );
- };
- CheckBox CB_CTRLHYPERLINK
- {
- Pos = MAP_APPFONT( COL_1, ROW_7 );
- Size = MAP_APPFONT( COL_3-COL_1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Ctrl-click required to follow hyperlinks";
- };
- FixedLine FL_BUTTONS
- {
- Pos = MAP_APPFONT( 0, ROW_8 );
- Size = MAP_APPFONT( DLG_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- };
- OKButton PB_OK
- {
- Pos = MAP_APPFONT ( COL_A , ROW_9 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT ( COL_B , ROW_9 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT ( COL_C , ROW_9 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
-};
-
diff --git a/svx/source/cui/selector.cxx b/svx/source/cui/selector.cxx
deleted file mode 100644
index 83e0e33bd8..0000000000
--- a/svx/source/cui/selector.cxx
+++ /dev/null
@@ -1,1262 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: selector.cxx,v $
- * $Revision: 1.28 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <vcl/help.hxx>
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
-#include <vcl/metric.hxx>
-
-#include "selector.hxx"
-#include <svx/dialmgr.hxx>
-
-#include "selector.hrc"
-#include "fmresids.hrc"
-#include <svx/dialogs.hrc>
-
-#include <sfx2/app.hxx>
-#include <sfx2/msg.hxx>
-#include <sfx2/msgpool.hxx>
-#include <sfx2/macrconf.hxx>
-#include <sfx2/minfitem.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/dispatch.hxx>
-
-#include <comphelper/documentinfo.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/componentcontext.hxx>
-
-/** === begin UNO includes === **/
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
-#include <com/sun/star/script/provider/XScriptProvider.hpp>
-#include <com/sun/star/script/browse/XBrowseNode.hpp>
-#include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
-#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
-#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/document/XEmbeddedScripts.hpp>
-#include <com/sun/star/document/XScriptInvocationContext.hpp>
-#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
-#include <com/sun/star/frame/DispatchInformation.hpp>
-#include <com/sun/star/container/XChild.hpp>
-/** === end UNO includes === **/
-
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::container;
-
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
-#include <svtools/imagemgr.hxx>
-#include <tools/urlobj.hxx>
-#include <tools/diagnose_ex.h>
-
-SV_IMPL_PTRARR(SvxGroupInfoArr_Impl, SvxGroupInfoPtr);
-
-/*
- * The implementations of SvxConfigFunctionListBox_Impl and
- * SvxConfigGroupListBox_Impl are copied from sfx2/source/dialog/cfg.cxx
- */
-SvxConfigFunctionListBox_Impl::SvxConfigFunctionListBox_Impl( Window* pParent, const ResId& rResId)
- : SvTreeListBox( pParent, rResId )
- , pCurEntry( 0 )
- , m_pDraggingEntry( 0 )
-{
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
- GetModel()->SetSortMode( SortAscending );
-
- // Timer f"ur die BallonHelp
- aTimer.SetTimeout( 200 );
- aTimer.SetTimeoutHdl(
- LINK( this, SvxConfigFunctionListBox_Impl, TimerHdl ) );
-}
-
-SvxConfigFunctionListBox_Impl::~SvxConfigFunctionListBox_Impl()
-{
- ClearAll();
-}
-
-SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetLastSelectedEntry()
-{
- if ( m_pDraggingEntry != NULL )
- {
- return m_pDraggingEntry;
- }
- else
- {
- return FirstSelected();
- }
-}
-
-void SvxConfigFunctionListBox_Impl::MouseMove( const MouseEvent& rMEvt )
-{
- Point aMousePos = rMEvt.GetPosPixel();
- pCurEntry = GetCurEntry();
-
- if ( pCurEntry && GetEntry( aMousePos ) == pCurEntry )
- aTimer.Start();
- else
- {
- Help::ShowBalloon( this, aMousePos, String() );
- aTimer.Stop();
- }
-}
-
-
-IMPL_LINK( SvxConfigFunctionListBox_Impl, TimerHdl, Timer*, EMPTYARG)
-{
- aTimer.Stop();
- Point aMousePos = GetPointerPosPixel();
- SvLBoxEntry *pEntry = GetCurEntry();
- if ( pEntry && GetEntry( aMousePos ) == pEntry && pCurEntry == pEntry )
- Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), GetHelpText( pEntry ) );
- return 0L;
-}
-
-void SvxConfigFunctionListBox_Impl::ClearAll()
-{
- USHORT nCount = aArr.Count();
- for ( USHORT i=0; i<nCount; i++ )
- {
- SvxGroupInfo_Impl *pData = aArr[i];
- delete pData;
- }
-
- aArr.Remove( 0, nCount );
- Clear();
-}
-
-SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName )
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- if ( GetEntryText( pEntry ) == rName )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId )
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- SvxGroupInfo_Impl *pData = (SvxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pData && pData->nOrd == nId )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-USHORT SvxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry )
-{
- SvxGroupInfo_Impl *pData = pEntry ?
- (SvxGroupInfo_Impl*) pEntry->GetUserData() : 0;
- if ( pData )
- return pData->nOrd;
- return 0;
-}
-
-String SvxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry )
-{
- // Information zum selektierten Entry aus den Userdaten holen
- SvxGroupInfo_Impl *pInfo =
- pEntry ? (SvxGroupInfo_Impl*) pEntry->GetUserData(): 0;
-
- if ( pInfo )
- {
- if ( pInfo->nKind == SVX_CFGFUNCTION_SLOT )
- {
- OUString aCmdURL( pInfo->sURL );
-
- OUString aHelpText = Application::GetHelp()->GetHelpText( aCmdURL, this );
-
- return aHelpText;
- }
- else if ( pInfo->nKind == SVX_CFGFUNCTION_SCRIPT )
- {
- return pInfo->sHelpText;
- }
- }
-
- return String();
-}
-
-void SvxConfigFunctionListBox_Impl::FunctionSelected()
-{
- Help::ShowBalloon( this, Point(), String() );
-}
-
-// drag and drop support
-DragDropMode SvxConfigFunctionListBox_Impl::NotifyStartDrag(
- TransferDataContainer& /*aTransferDataContainer*/, SvLBoxEntry* pEntry )
-{
- m_pDraggingEntry = pEntry;
- return GetDragDropMode();
-}
-
-void SvxConfigFunctionListBox_Impl::DragFinished( sal_Int8 /*nDropAction*/ )
-{
- m_pDraggingEntry = NULL;
-}
-
-sal_Int8
-SvxConfigFunctionListBox_Impl::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
-{
- return DND_ACTION_NONE;
-}
-
-SvxConfigGroupListBox_Impl::SvxConfigGroupListBox_Impl(
- Window* pParent, const ResId& rResId,
- bool _bShowSlots, const Reference< frame::XFrame >& xFrame )
- : SvTreeListBox( pParent, rResId )
- , m_bShowSlots( _bShowSlots ),
- m_hdImage(ResId(IMG_HARDDISK,*rResId.GetResMgr())),
- m_hdImage_hc(ResId(IMG_HARDDISK_HC,*rResId.GetResMgr())),
- m_libImage(ResId(IMG_LIB,*rResId.GetResMgr())),
- m_libImage_hc(ResId(IMG_LIB_HC,*rResId.GetResMgr())),
- m_macImage(ResId(IMG_MACRO,*rResId.GetResMgr())),
- m_macImage_hc(ResId(IMG_MACRO_HC,*rResId.GetResMgr())),
- m_docImage(ResId(IMG_DOC,*rResId.GetResMgr())),
- m_docImage_hc(ResId(IMG_DOC_HC,*rResId.GetResMgr())),
- m_sMyMacros(String(ResId(STR_MYMACROS,*rResId.GetResMgr()))),
- m_sProdMacros(String(ResId(STR_PRODMACROS,*rResId.GetResMgr())))
-{
- FreeResource();
-
- if ( xFrame != NULL )
- {
- m_xFrame.set( xFrame );
- }
-
- SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
-
- ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) );
-
- SetNodeBitmaps(
- aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ),
- aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ),
- BMP_COLOR_NORMAL );
-
- SetNodeBitmaps(
- aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ),
- aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ),
- BMP_COLOR_HIGHCONTRAST );
-}
-
-
-SvxConfigGroupListBox_Impl::~SvxConfigGroupListBox_Impl()
-{
- ClearAll();
-}
-
-void SvxConfigGroupListBox_Impl::ClearAll()
-{
- USHORT nCount = aArr.Count();
- for ( USHORT i=0; i<nCount; i++ )
- {
- SvxGroupInfo_Impl *pData = aArr[i];
- delete pData;
- }
-
- aArr.Remove( 0, nCount );
- Clear();
-}
-
-//-----------------------------------------------
-namespace
-{
- //...........................................
- /** examines a component whether it supports XEmbeddedScripts, or provides access to such a
- component by implementing XScriptInvocationContext.
- @return
- the model which supports the embedded scripts, or <NULL/> if it cannot find such a
- model
- */
- static Reference< XModel > lcl_getDocumentWithScripts_throw( const Reference< XInterface >& _rxComponent )
- {
- Reference< XEmbeddedScripts > xScripts( _rxComponent, UNO_QUERY );
- if ( !xScripts.is() )
- {
- Reference< XScriptInvocationContext > xContext( _rxComponent, UNO_QUERY );
- if ( xContext.is() )
- xScripts.set( xContext->getScriptContainer(), UNO_QUERY );
- }
-
- return Reference< XModel >( xScripts, UNO_QUERY );
- }
-
- //...........................................
- static Reference< XModel > lcl_getScriptableDocument_nothrow( const Reference< XFrame >& _rxFrame )
- {
- Reference< XModel > xDocument;
-
- // examine our associated frame
- try
- {
- OSL_ENSURE( _rxFrame.is(), "lcl_getScriptableDocument_nothrow: you need to pass a frame to this dialog/tab page!" );
- if ( _rxFrame.is() )
- {
- // first try the model in the frame
- Reference< XController > xController( _rxFrame->getController(), UNO_SET_THROW );
- xDocument = lcl_getDocumentWithScripts_throw( xController->getModel() );
-
- if ( !xDocument.is() )
- {
- // if there is no suitable document in the frame, try the controller
- xDocument = lcl_getDocumentWithScripts_throw( _rxFrame->getController() );
- }
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return xDocument;
- }
-}
-
-void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrowseNode >& _rxRootNode, SvLBoxEntry* _pParentEntry, bool _bCheapChildsOnDemand )
-{
- OSL_PRECOND( _rxRootNode.is(), "SvxConfigGroupListBox_Impl::fillScriptList: invalid root node!" );
- if ( !_rxRootNode.is() )
- return;
-
- try
- {
- if ( _rxRootNode->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > children =
- _rxRootNode->getChildNodes();
-
- BOOL bIsRootNode = _rxRootNode->getName().equalsAscii("Root");
-
- /* To mimic current starbasic behaviour we
- need to make sure that only the current document
- is displayed in the config tree. Tests below
- set the bDisplay flag to FALSE if the current
- node is a first level child of the Root and is NOT
- either the current document, user or share */
- OUString sCurrentDocTitle;
- Reference< XModel > xWorkingDocument = lcl_getScriptableDocument_nothrow( m_xFrame );
- if ( xWorkingDocument.is() )
- {
- sCurrentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xWorkingDocument );
- }
-
- for ( long n = 0; n < children.getLength(); n++ )
- {
- Reference< browse::XBrowseNode >& theChild = children[n];
- //#139111# some crash reports show that it might be unset
- if ( !theChild.is() )
- continue;
- ::rtl::OUString sUIName = theChild->getName();
- BOOL bDisplay = TRUE;
-
- if ( bIsRootNode
- || ( m_bShowSlots && _pParentEntry && ( GetModel()->GetDepth( _pParentEntry ) == 0 ) )
- // if we show slots (as in the customize dialog)
- // then the user & share are added at depth=1
- )
- {
- if ( sUIName.equalsAscii( "user" ) )
- {
- sUIName = m_sMyMacros;
- bIsRootNode = sal_True;
- }
- else if ( sUIName.equalsAscii( "share" ) )
- {
- sUIName = m_sProdMacros;
- bIsRootNode = sal_True;
- }
- else if ( !sUIName.equals( sCurrentDocTitle ) )
- {
- bDisplay = FALSE;
- }
- }
-
- if ( !bDisplay )
- continue;
-
- if ( children[n]->getType() == browse::BrowseNodeTypes::SCRIPT )
- continue;
-
- SvLBoxEntry* pNewEntry = InsertEntry( sUIName, _pParentEntry );
-
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Image aImage = GetImage( theChild, aContext.getUNOContext(), bIsRootNode, BMP_COLOR_NORMAL );
- SetExpandedEntryBmp( pNewEntry, aImage, BMP_COLOR_NORMAL );
- SetCollapsedEntryBmp( pNewEntry, aImage, BMP_COLOR_NORMAL );
-
- aImage = GetImage( theChild, aContext.getUNOContext(), bIsRootNode, BMP_COLOR_HIGHCONTRAST );
- SetExpandedEntryBmp( pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp( pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST );
-
- SvxGroupInfo_Impl* pInfo =
- new SvxGroupInfo_Impl( SVX_CFGGROUP_SCRIPTCONTAINER, 0, theChild );
- pNewEntry->SetUserData( pInfo );
- aArr.Insert( pInfo, aArr.Count() );
-
- if ( _bCheapChildsOnDemand )
- {
- /* i30923 - Would be nice if there was a better
- * way to determine if a basic lib had children
- * without having to ask for them (which forces
- * the library to be loaded */
- pNewEntry->EnableChildsOnDemand( TRUE );
- }
- else
- {
- // if there are granchildren we're interested in, display the '+' before
- // the entry, but do not yet expand
- Sequence< Reference< browse::XBrowseNode > > grandchildren =
- children[n]->getChildNodes();
-
- for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ )
- {
- if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER )
- {
- pNewEntry->EnableChildsOnDemand( TRUE );
- break;
- }
- }
- }
- }
- }
- }
- catch (const Exception&)
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-}
-
-void SvxConfigGroupListBox_Impl::Init()
-{
- SetUpdateMode(FALSE);
- ClearAll();
-
- Reference< XComponentContext > xContext;
- Reference < beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
-
- xContext.set( xProps->getPropertyValue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))),
- UNO_QUERY );
-
- // are we showing builtin commands?
- if ( m_bShowSlots && xContext.is() && m_xFrame.is() )
- {
- Reference< lang::XMultiComponentFactory > xMCF =
- xContext->getServiceManager();
-
- Reference< frame::XDispatchInformationProvider > xDIP(
- m_xFrame, UNO_QUERY );
-
- Reference< ::com::sun::star::frame::XModuleManager >
- xModuleManager( xMCF->createInstanceWithContext(
- OUString::createFromAscii(
- "com.sun.star.frame.ModuleManager" ),
- xContext ),
- UNO_QUERY );
-
- OUString aModuleId;
- try{
- aModuleId = xModuleManager->identify( m_xFrame );
- }catch(const uno::Exception&)
- { aModuleId = ::rtl::OUString(); }
-
- Reference< container::XNameAccess > xNameAccess(
- xMCF->createInstanceWithContext(
- OUString::createFromAscii(
- "com.sun.star.frame.UICommandDescription" ),
- xContext ),
- UNO_QUERY );
-
- if ( xNameAccess.is() )
- {
- xNameAccess->getByName( aModuleId ) >>= m_xModuleCommands;
- }
-
- Reference< container::XNameAccess > xAllCategories(
- xMCF->createInstanceWithContext(
- OUString::createFromAscii(
- "com.sun.star.ui.UICategoryDescription" ),
- xContext ),
- UNO_QUERY );
-
- Reference< container::XNameAccess > xModuleCategories;
- if ( xAllCategories.is() )
- {
- if ( aModuleId.getLength() != 0 )
- {
- try
- {
- xModuleCategories = Reference< container::XNameAccess >(
- xAllCategories->getByName( aModuleId ), UNO_QUERY );
- }
- catch ( container::NoSuchElementException& )
- {
- }
- }
-
- if ( !xModuleCategories.is() )
- {
- xModuleCategories = xAllCategories;
- }
- }
-
- if ( xModuleCategories.is() )
- {
- Sequence< sal_Int16 > gids =
- xDIP->getSupportedCommandGroups();
-
- for ( sal_Int32 i = 0; i < gids.getLength(); i++ )
- {
- Sequence< frame::DispatchInformation > commands;
- try
- {
- commands =
- xDIP->getConfigurableDispatchInformation( gids[i] );
- }
- catch ( container::NoSuchElementException& )
- {
- continue;
- }
-
- if ( commands.getLength() == 0 )
- {
- continue;
- }
-
- sal_Int32 gid = gids[i];
- OUString idx = OUString::valueOf( gid );
- OUString group = idx;
- try
- {
- xModuleCategories->getByName( idx ) >>= group;
- }
- catch ( container::NoSuchElementException& )
- {
- }
-
- SvLBoxEntry *pEntry = InsertEntry( group, NULL );
-
- SvxGroupInfo_Impl *pInfo =
- new SvxGroupInfo_Impl( SVX_CFGGROUP_FUNCTION, gids[i] );
- aArr.Insert( pInfo, aArr.Count() );
-
- pEntry->SetUserData( pInfo );
- }
- }
- }
-
- if ( xContext.is() )
- {
- // Add Scripting Framework entries
- Reference< browse::XBrowseNode > rootNode;
- Reference< XComponentContext> xCtx;
-
- try
- {
- Reference < beans::XPropertySet > _xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- xCtx.set( _xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
- Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName(
- OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW );
- rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- if ( rootNode.is() )
- {
- if ( m_bShowSlots )
- {
- SvxGroupInfo_Impl *pInfo =
- new SvxGroupInfo_Impl( SVX_CFGGROUP_SCRIPTCONTAINER, 0, rootNode );
-
- String aTitle =
- String( SVX_RES( STR_SELECTOR_MACROS ) );
-
- SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL );
- pNewEntry->SetUserData( pInfo );
- pNewEntry->EnableChildsOnDemand( TRUE );
- aArr.Insert( pInfo, aArr.Count() );
- }
- else
- {
- fillScriptList( rootNode, NULL, false );
- }
- }
- }
- MakeVisible( GetEntry( 0,0 ) );
- SetUpdateMode( TRUE );
-}
-
-Image SvxConfigGroupListBox_Impl::GetImage( Reference< browse::XBrowseNode > node, Reference< XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast )
-{
- Image aImage;
- if ( bIsRootNode )
- {
- if ( node->getName().equalsAscii( "user" ) || node->getName().equalsAscii( "share" ) )
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = m_hdImage;
- else
- aImage = m_hdImage_hc;
- }
- else
- {
- OUString factoryURL;
- OUString nodeName = node->getName();
- Reference<XInterface> xDocumentModel = getDocumentModel(xCtx, nodeName );
- if ( xDocumentModel.is() )
- {
- Reference< ::com::sun::star::frame::XModuleManager >
- xModuleManager(
- xCtx->getServiceManager()
- ->createInstanceWithContext(
- OUString::createFromAscii("com.sun.star.frame.ModuleManager"),
- xCtx ),
- UNO_QUERY_THROW );
- Reference<container::XNameAccess> xModuleConfig(
- xModuleManager, UNO_QUERY_THROW );
- // get the long name of the document:
- OUString appModule( xModuleManager->identify(
- xDocumentModel ) );
- Sequence<beans::PropertyValue> moduleDescr;
- Any aAny = xModuleConfig->getByName(appModule);
- if( sal_True != ( aAny >>= moduleDescr ) )
- {
- throw RuntimeException(OUString::createFromAscii("SFTreeListBox::Init: failed to get PropertyValue"), Reference< XInterface >());
- }
- beans::PropertyValue const * pmoduleDescr =
- moduleDescr.getConstArray();
- for ( sal_Int32 pos = moduleDescr.getLength(); pos--; )
- {
- if (pmoduleDescr[ pos ].Name.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM(
- "ooSetupFactoryEmptyDocumentURL") ))
- {
- pmoduleDescr[ pos ].Value >>= factoryURL;
- break;
- }
- }
- }
- if( factoryURL.getLength() > 0 )
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = SvFileInformationManager::GetFileImage(
- INetURLObject(factoryURL), false,
- BMP_COLOR_NORMAL );
- else
- aImage = SvFileInformationManager::GetFileImage(
- INetURLObject(factoryURL), false,
- BMP_COLOR_HIGHCONTRAST );
- }
- else
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = m_docImage;
- else
- aImage = m_docImage_hc;
- }
- }
- }
- else
- {
- if( node->getType() == browse::BrowseNodeTypes::SCRIPT )
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = m_macImage;
- else
- aImage = m_macImage_hc;
- }
- else
- {
- if( bHighContrast == BMP_COLOR_NORMAL )
- aImage = m_libImage;
- else
- aImage = m_libImage_hc;
- }
- }
- return aImage;
-}
-
-Reference< XInterface >
-SvxConfigGroupListBox_Impl::getDocumentModel(
- Reference< XComponentContext >& xCtx, OUString& docName )
-{
- Reference< XInterface > xModel;
- Reference< lang::XMultiComponentFactory > mcf =
- xCtx->getServiceManager();
- Reference< frame::XDesktop > desktop (
- mcf->createInstanceWithContext(
- OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ),
- UNO_QUERY );
-
- Reference< container::XEnumerationAccess > componentsAccess =
- desktop->getComponents();
- Reference< container::XEnumeration > components =
- componentsAccess->createEnumeration();
- while (components->hasMoreElements())
- {
- Reference< frame::XModel > model(
- components->nextElement(), UNO_QUERY );
- if ( model.is() )
- {
- OUString sTdocUrl = ::comphelper::DocumentInfo::getDocumentTitle( model );
- if( sTdocUrl.equals( docName ) )
- {
- xModel = model;
- break;
- }
- }
- }
- return xModel;
-}
-
-void SvxConfigGroupListBox_Impl::GroupSelected()
-{
- SvLBoxEntry *pEntry = FirstSelected();
- SvxGroupInfo_Impl *pInfo = (SvxGroupInfo_Impl*) pEntry->GetUserData();
- pFunctionListBox->SetUpdateMode(FALSE);
- pFunctionListBox->ClearAll();
- if ( pInfo->nKind != SVX_CFGGROUP_FUNCTION &&
- pInfo->nKind != SVX_CFGGROUP_SCRIPTCONTAINER )
- {
- pFunctionListBox->SetUpdateMode(TRUE);
- return;
- }
-
- switch ( pInfo->nKind )
- {
- case SVX_CFGGROUP_FUNCTION :
- {
- SvLBoxEntry *_pEntry = FirstSelected();
- if ( _pEntry != NULL )
- {
- SvxGroupInfo_Impl *_pInfo =
- (SvxGroupInfo_Impl*) _pEntry->GetUserData();
-
- Reference< frame::XDispatchInformationProvider > xDIP(
- m_xFrame, UNO_QUERY );
-
- Sequence< frame::DispatchInformation > commands;
- try
- {
- commands = xDIP->getConfigurableDispatchInformation(
- _pInfo->nOrd );
- }
- catch ( container::NoSuchElementException& )
- {
- }
-
- for ( sal_Int32 i = 0; i < commands.getLength(); i++ )
- {
- if ( commands[i].Command.getLength() == 0 )
- {
- continue;
- }
-
- Image aImage;
-
- OUString aCmdURL( commands[i].Command );
-
- if ( m_pImageProvider )
- {
- aImage = m_pImageProvider->GetImage( aCmdURL );
- }
-
- OUString aLabel;
- try
- {
- Any a = m_xModuleCommands->getByName( aCmdURL );
- Sequence< beans::PropertyValue > aPropSeq;
-
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 k = 0; k < aPropSeq.getLength(); k++ )
- {
- if ( aPropSeq[k].Name.equalsAscii( "Name" ) )
- {
- aPropSeq[k].Value >>= aLabel;
- break;
- }
- }
- }
- }
- catch ( container::NoSuchElementException& )
- {
- }
-
- if ( aLabel.getLength() == 0 )
- {
- aLabel = commands[i].Command;
- }
-
- SvLBoxEntry* pFuncEntry = NULL;
- if ( !!aImage )
- {
- pFuncEntry = pFunctionListBox->InsertEntry(
- aLabel, aImage, aImage );
- }
- else
- {
- pFuncEntry = pFunctionListBox->InsertEntry(
- aLabel, NULL );
- }
-
- SvxGroupInfo_Impl *_pGroupInfo = new SvxGroupInfo_Impl(
- SVX_CFGFUNCTION_SLOT, 123, aCmdURL, ::rtl::OUString() );
-
- pFunctionListBox->aArr.Insert(
- _pGroupInfo, pFunctionListBox->aArr.Count() );
-
- pFuncEntry->SetUserData( _pGroupInfo );
- }
- }
- break;
- }
-
- case SVX_CFGGROUP_SCRIPTCONTAINER:
- {
- Reference< browse::XBrowseNode > rootNode( pInfo->xBrowseNode );
-
- try {
- if ( rootNode->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > children =
- rootNode->getChildNodes();
-
- for ( long n = 0; n < children.getLength(); n++ )
- {
- if (!children[n].is())
- continue;
- if (children[n]->getType() == browse::BrowseNodeTypes::SCRIPT)
- {
- OUString uri;
- OUString description;
-
- Reference < beans::XPropertySet >xPropSet( children[n], UNO_QUERY );
- if (!xPropSet.is())
- {
- continue;
- }
-
- Any value =
- xPropSet->getPropertyValue( String::CreateFromAscii( "URI" ) );
- value >>= uri;
-
- try
- {
- value = xPropSet->getPropertyValue(
- String::CreateFromAscii( "Description" ) );
- value >>= description;
- }
- catch (Exception &) {
- // do nothing, the description will be empty
- }
-
- SvxGroupInfo_Impl* _pGroupInfo =
- new SvxGroupInfo_Impl(
- SVX_CFGFUNCTION_SCRIPT, 123, uri, description );
-
- Image aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL );
- SvLBoxEntry* pNewEntry =
- pFunctionListBox->InsertEntry( children[n]->getName(), NULL );
- pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST );
- pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
- pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
-
- pNewEntry->SetUserData( _pGroupInfo );
-
- pFunctionListBox->aArr.Insert(
- _pGroupInfo, pFunctionListBox->aArr.Count() );
-
- }
- }
- }
- }
- catch (const Exception&)
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- break;
- }
-
- default:
- {
- return;
- }
- }
-
- if ( pFunctionListBox->GetEntryCount() )
- pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) );
-
- pFunctionListBox->SetUpdateMode(TRUE);
-}
-
-BOOL SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent )
-{
- BOOL bRet = SvTreeListBox::Expand( pParent );
- if ( bRet )
- {
- // Wieviele Entries k"onnen angezeigt werden ?
- ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight();
-
- // Wieviele Kinder sollen angezeigt werden ?
- ULONG nChildCount = GetVisibleChildCount( pParent );
-
- // Passen alle Kinder und der parent gleichzeitig in die View ?
- if ( nChildCount+1 > nEntries )
- {
- // Wenn nicht, wenigstens parent ganz nach oben schieben
- MakeVisible( pParent, TRUE );
- }
- else
- {
- // An welcher relativen ViewPosition steht der aufzuklappende parent
- SvLBoxEntry *pEntry = GetFirstEntryInView();
- ULONG nParentPos = 0;
- while ( pEntry && pEntry != pParent )
- {
- nParentPos++;
- pEntry = GetNextEntryInView( pEntry );
- }
-
- // Ist unter dem parent noch genug Platz f"ur alle Kinder ?
- if ( nParentPos + nChildCount + 1 > nEntries )
- ScrollOutputArea( (short)( nEntries - ( nParentPos + nChildCount + 1 ) ) );
- }
- }
-
- return bRet;
-}
-
-void SvxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry )
-{
- SvxGroupInfo_Impl *pInfo = (SvxGroupInfo_Impl*) pEntry->GetUserData();
- pInfo->bWasOpened = TRUE;
- switch ( pInfo->nKind )
- {
- case SVX_CFGGROUP_SCRIPTCONTAINER:
- {
- if ( !GetChildCount( pEntry ) )
- {
- Reference< browse::XBrowseNode > rootNode( pInfo->xBrowseNode ) ;
- fillScriptList( rootNode, pEntry, true /* i30923 */ );
- }
- break;
- }
-
- default:
- DBG_ERROR( "Falscher Gruppentyp!" );
- break;
- }
-}
-
-/*
- * Implementation of SvxScriptSelectorDialog
- *
- * This dialog is used for selecting Slot API commands
- * and Scripting Framework Scripts.
- */
-
-SvxScriptSelectorDialog::SvxScriptSelectorDialog(
- Window* pParent, BOOL bShowSlots, const Reference< frame::XFrame >& xFrame )
- :
- ModelessDialog( pParent, SVX_RES( RID_DLG_SCRIPTSELECTOR ) ),
- aDialogDescription( this, SVX_RES( TXT_SELECTOR_DIALOG_DESCRIPTION ) ),
- aGroupText( this, SVX_RES( TXT_SELECTOR_CATEGORIES ) ),
- aCategories( this, SVX_RES( BOX_SELECTOR_CATEGORIES ), bShowSlots, xFrame ),
- aFunctionText( this, SVX_RES( TXT_SELECTOR_COMMANDS ) ),
- aCommands( this, SVX_RES( BOX_SELECTOR_COMMANDS ) ),
- aOKButton( this, SVX_RES( BTN_SELECTOR_OK ) ),
- aCancelButton( this, SVX_RES( BTN_SELECTOR_CANCEL ) ),
- aHelpButton( this, SVX_RES( BTN_SELECTOR_HELP ) ),
- aDescription( this, SVX_RES( GRP_SELECTOR_DESCRIPTION ) ),
- aDescriptionText( this, SVX_RES( TXT_SELECTOR_DESCRIPTION ) ),
- m_bShowSlots( bShowSlots )
-{
-
- ResMgr& rMgr = DIALOG_MGR();
-
- // If we are showing Slot API commands update labels in the UI, and
- // enable drag'n'drop
- if ( m_bShowSlots )
- {
- aGroupText.SetText( String( ResId( STR_SELECTOR_CATEGORIES, rMgr ) ) );
- aOKButton.SetText( String( ResId( STR_SELECTOR_ADD, rMgr ) ) );
- aCancelButton.SetText( String( ResId( STR_SELECTOR_CLOSE, rMgr ) ) );
- aFunctionText.SetText( String( ResId( STR_SELECTOR_COMMANDS, rMgr ) ) );
- SetDialogDescription(
- String( ResId( STR_SELECTOR_ADD_COMMANDS_DESCRIPTION, rMgr ) ) );
- SetText( String( ResId( STR_SELECTOR_ADD_COMMANDS, rMgr ) ) );
-
- aCommands.SetDragDropMode( SV_DRAGDROP_APP_COPY );
- }
-
- ResizeControls();
-
- aCategories.SetFunctionListBox( &aCommands );
- aCategories.Init();
- // aCategories.Select( aCategories.GetEntry( 0, 0 ) );
-
- aCategories.SetSelectHdl(
- LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
- aCommands.SetSelectHdl( LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
- aCommands.SetDoubleClickHdl( LINK( this, SvxScriptSelectorDialog, FunctionDoubleClickHdl ) );
-
- aOKButton.SetClickHdl( LINK( this, SvxScriptSelectorDialog, ClickHdl ) );
- aCancelButton.SetClickHdl( LINK( this, SvxScriptSelectorDialog, ClickHdl ) );
-
- UpdateUI();
- FreeResource();
-}
-
-void SvxScriptSelectorDialog::ResizeControls()
-{
- Point p, newp;
- Size s, news;
- long gap;
-
- USHORT style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP |
- TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK;
-
- // get dimensions of dialog instructions control
- p = aDialogDescription.GetPosPixel();
- s = aDialogDescription.GetSizePixel();
-
- // get dimensions occupied by text in the control
- Rectangle rect =
- GetTextRect( Rectangle( p, s ), aDialogDescription.GetText(), style );
- news = rect.GetSize();
-
- // the gap is the difference between the control height and its text height
- gap = s.Height() - news.Height();
-
- // resize the dialog instructions control
- news = Size( s.Width(), s.Height() - gap );
- aDialogDescription.SetSizePixel( news );
-
- // resize other controls to fill the gap
- p = aGroupText.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aGroupText.SetPosPixel( newp );
-
- p = aCategories.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aCategories.SetPosPixel( newp );
- s = aCategories.GetSizePixel();
- news = Size( s.Width(), s.Height() + gap );
- aCategories.SetSizePixel( news );
-
- p = aFunctionText.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aFunctionText.SetPosPixel( newp );
-
- p = aCommands.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aCommands.SetPosPixel( newp );
- s = aCommands.GetSizePixel();
- news = Size( s.Width(), s.Height() + gap );
- aCommands.SetSizePixel( news );
-
- p = aOKButton.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aOKButton.SetPosPixel( newp );
-
- p = aCancelButton.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aCancelButton.SetPosPixel( newp );
-
- p = aHelpButton.GetPosPixel();
- newp = Point( p.X(), p.Y() - gap );
- aHelpButton.SetPosPixel( newp );
-}
-
-SvxScriptSelectorDialog::~SvxScriptSelectorDialog()
-{
-}
-
-IMPL_LINK( SvxScriptSelectorDialog, SelectHdl, Control*, pCtrl )
-{
- if ( pCtrl == &aCategories )
- {
- aCategories.GroupSelected();
- }
- else if ( pCtrl == &aCommands )
- {
- aCommands.FunctionSelected();
- }
- UpdateUI();
- return 0;
-}
-
-IMPL_LINK( SvxScriptSelectorDialog, FunctionDoubleClickHdl, Control*, pCtrl )
-{
- (void)pCtrl;
- if ( aOKButton.IsEnabled() )
- return ClickHdl( &aOKButton );
- return 0;
-}
-
-// Check if command is selected and enable the OK button accordingly
-// Grab the help text for this id if available and update the description field
-void
-SvxScriptSelectorDialog::UpdateUI()
-{
- OUString url = GetScriptURL();
- if ( url != NULL && url.getLength() != 0 )
- {
- String rMessage =
- aCommands.GetHelpText( aCommands.FirstSelected() );
- aDescriptionText.SetText( rMessage );
-
- aOKButton.Enable( TRUE );
- }
- else
- {
- aDescriptionText.SetText( String() );
- aOKButton.Enable( FALSE );
- }
-}
-
-IMPL_LINK( SvxScriptSelectorDialog, ClickHdl, Button *, pButton )
-{
- if ( pButton == &aCancelButton )
- {
- // If we are displaying Slot API commands then the dialog is being
- // run from Tools/Configure and we should not close it, just hide it
- if ( m_bShowSlots == FALSE )
- {
- EndDialog( RET_CANCEL );
- }
- else
- {
- Hide();
- }
- }
- else if ( pButton == &aOKButton )
- {
- GetAddHdl().Call( this );
-
- // If we are displaying Slot API commands then this the dialog is being
- // run from Tools/Configure and we should not close it
- if ( m_bShowSlots == FALSE )
- {
- EndDialog( RET_OK );
- }
- else
- {
- // Select the next entry in the list if possible
- SvLBoxEntry* current = aCommands.FirstSelected();
- SvLBoxEntry* next = aCommands.NextSibling( current );
-
- if ( next != NULL )
- {
- aCommands.Select( next );
- }
- }
- }
-
- return 0;
-}
-
-void
-SvxScriptSelectorDialog::SetRunLabel()
-{
- aOKButton.SetText( String( SVX_RES( STR_SELECTOR_RUN ) ) );
-}
-
-void
-SvxScriptSelectorDialog::SetDialogDescription( const String& rDescription )
-{
- aDialogDescription.SetText( rDescription );
-}
-
-USHORT
-SvxScriptSelectorDialog::GetSelectedId()
-{
- return aCommands.GetId( aCommands.GetLastSelectedEntry() );
-}
-
-String
-SvxScriptSelectorDialog::GetScriptURL() const
-{
- OUString result;
-
- SvLBoxEntry *pEntry = const_cast< SvxScriptSelectorDialog* >( this )->aCommands.GetLastSelectedEntry();
- if ( pEntry )
- {
- SvxGroupInfo_Impl *pData = (SvxGroupInfo_Impl*) pEntry->GetUserData();
- if ( ( pData->nKind == SVX_CFGFUNCTION_SLOT )
- || ( pData->nKind == SVX_CFGFUNCTION_SCRIPT )
- )
- {
- result = pData->sURL;
- }
- }
-
- return result;
-}
-
-String
-SvxScriptSelectorDialog::GetSelectedDisplayName()
-{
- return aCommands.GetEntryText( aCommands.GetLastSelectedEntry() );
-}
-
-String
-SvxScriptSelectorDialog::GetSelectedHelpText()
-{
- return aCommands.GetHelpText( aCommands.GetLastSelectedEntry() );
-}
diff --git a/svx/source/cui/selector.hrc b/svx/source/cui/selector.hrc
deleted file mode 100644
index 4a15588796..0000000000
--- a/svx/source/cui/selector.hrc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: selector.hrc,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define TXT_SELECTOR_DIALOG_DESCRIPTION 1
-#define TXT_SELECTOR_CATEGORIES 2
-#define BOX_SELECTOR_CATEGORIES 3
-#define TXT_SELECTOR_COMMANDS 4
-#define BOX_SELECTOR_COMMANDS 5
-#define BTN_SELECTOR_OK 6
-#define BTN_SELECTOR_CANCEL 7
-#define BTN_SELECTOR_HELP 8
-#define GRP_SELECTOR_DESCRIPTION 9
-#define TXT_SELECTOR_DESCRIPTION 10
-#define IMG_HARDDISK 1
-#define IMG_HARDDISK_HC 2
-#define IMG_LIB 3
-#define IMG_LIB_HC 4
-#define IMG_MACRO 5
-#define IMG_MACRO_HC 6
-#define IMG_DOC 7
-#define IMG_DOC_HC 8
-
-#define STR_SELECTOR_ADD 310
-#define STR_SELECTOR_CLOSE 311
-#define STR_SELECTOR_COMMANDS 312
-#define STR_SELECTOR_ADD_COMMANDS 313
-#define STR_SELECTOR_ADD_COMMANDS_DESCRIPTION 314
-#define STR_SELECTOR_MACROS 315
-#define STR_SELECTOR_CATEGORIES 316
-#define STR_BASICMACROS 317
-#define STR_SELECTOR_RUN 318
-#define STR_MYMACROS 319
-#define STR_PRODMACROS 320
diff --git a/svx/source/cui/selector.hxx b/svx/source/cui/selector.hxx
deleted file mode 100644
index b649a8e306..0000000000
--- a/svx/source/cui/selector.hxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: selector.hxx,v $
- * $Revision: 1.15 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVXSELECTOR_HXX
-#define _SVXSELECTOR_HXX
-
-#include <vcl/lstbox.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/menubtn.hxx>
-#include <svtools/svtreebx.hxx>
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/script/browse/XBrowseNode.hpp>
-
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx> // SvUShorts
-#include <sfx2/minarray.hxx>
-
-#define SVX_CFGGROUP_FUNCTION 1
-#define SVX_CFGFUNCTION_SLOT 2
-#define SVX_CFGGROUP_SCRIPTCONTAINER 3
-#define SVX_CFGFUNCTION_SCRIPT 4
-
-struct SvxGroupInfo_Impl
-{
- USHORT nKind;
- USHORT nOrd;
- ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >
- xBrowseNode;
- ::rtl::OUString sURL;
- ::rtl::OUString sHelpText;
- BOOL bWasOpened;
-
- SvxGroupInfo_Impl( USHORT n, USHORT nr )
- :nKind( n )
- ,nOrd( nr )
- ,xBrowseNode()
- ,sURL()
- ,sHelpText()
- ,bWasOpened(FALSE)
- {
- }
-
- SvxGroupInfo_Impl( USHORT n, USHORT nr, const ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& _rxNode )
- :nKind( n )
- ,nOrd( nr )
- ,xBrowseNode( _rxNode )
- ,sURL()
- ,sHelpText()
- ,bWasOpened(FALSE)
- {
- }
-
- SvxGroupInfo_Impl( USHORT n, USHORT nr, const ::rtl::OUString& _rURL, const ::rtl::OUString& _rHelpText )
- :nKind( n )
- ,nOrd( nr )
- ,xBrowseNode()
- ,sURL( _rURL )
- ,sHelpText( _rHelpText )
- ,bWasOpened(FALSE)
- {
- }
-};
-
-typedef SvxGroupInfo_Impl* SvxGroupInfoPtr;
-SV_DECL_PTRARR_DEL(SvxGroupInfoArr_Impl, SvxGroupInfoPtr, 5, 5)
-
-class ImageProvider
-{
-public:
- virtual ~ImageProvider() {}
-
- virtual Image GetImage( const rtl::OUString& rCommandURL ) = 0;
-};
-
-class SvxConfigFunctionListBox_Impl : public SvTreeListBox
-{
-friend class SvxConfigGroupListBox_Impl;
- Timer aTimer;
- SvLBoxEntry* pCurEntry;
- SvxGroupInfoArr_Impl aArr;
- SvLBoxEntry* m_pDraggingEntry;
-
- DECL_LINK( TimerHdl, Timer* );
- virtual void MouseMove( const MouseEvent& rMEvt );
-
-public:
- SvxConfigFunctionListBox_Impl( Window*, const ResId& );
- ~SvxConfigFunctionListBox_Impl();
- void ClearAll();
- SvLBoxEntry* GetEntry_Impl( USHORT nId );
- SvLBoxEntry* GetEntry_Impl( const String& );
- USHORT GetId( SvLBoxEntry *pEntry );
- String GetHelpText( SvLBoxEntry *pEntry );
- using Window::GetHelpText;
- USHORT GetCurId()
- { return GetId( FirstSelected() ); }
- SvLBoxEntry* GetLastSelectedEntry();
- void FunctionSelected();
-
- // drag n drop methods
- virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
-
- virtual DragDropMode NotifyStartDrag(
- TransferDataContainer&, SvLBoxEntry* );
-
- virtual void DragFinished( sal_Int8 );
-};
-
-class SvxConfigGroupListBox_Impl : public SvTreeListBox
-{
- SvxGroupInfoArr_Impl aArr;
- bool m_bShowSlots;
-
- SvxConfigFunctionListBox_Impl* pFunctionListBox;
- ImageProvider* m_pImageProvider;
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::frame::XFrame > m_xFrame;
-
- ::com::sun::star::uno::Reference
- < ::com::sun::star::container::XNameAccess > m_xModuleCommands;
-
- Image m_hdImage;
- Image m_hdImage_hc;
- Image m_libImage;
- Image m_libImage_hc;
- Image m_macImage;
- Image m_macImage_hc;
- Image m_docImage;
- Image m_docImage_hc;
- ::rtl::OUString m_sMyMacros;
- ::rtl::OUString m_sProdMacros;
- Image GetImage( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > node, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast );
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, ::rtl::OUString& docName );
-
-private:
- void fillScriptList(
- const ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode >& _rxRootNode,
- SvLBoxEntry* _pParentEntry,
- bool _bCheapChildsOnDemand
- );
-
-protected:
- virtual void RequestingChilds( SvLBoxEntry *pEntry);
- virtual BOOL Expand( SvLBoxEntry* pParent );
- using SvListView::Expand;
-
-public:
- SvxConfigGroupListBox_Impl (
- Window* pParent, const ResId&,
- bool _bShowSlots,
- const ::com::sun::star::uno::Reference
- < ::com::sun::star::frame::XFrame >& xFrame
- );
-
- ~SvxConfigGroupListBox_Impl();
-
- void Init();
- void Open( SvLBoxEntry*, BOOL );
- void ClearAll();
- void GroupSelected();
-
- void SetFunctionListBox( SvxConfigFunctionListBox_Impl *pBox )
- { pFunctionListBox = pBox; }
-
- void SetImageProvider( ImageProvider* provider )
- { m_pImageProvider = provider; }
-};
-
-class SvxScriptSelectorDialog : public ModelessDialog
-{
- FixedText aDialogDescription;
- FixedText aGroupText;
- SvxConfigGroupListBox_Impl aCategories;
- FixedText aFunctionText;
- SvxConfigFunctionListBox_Impl aCommands;
- OKButton aOKButton;
- CancelButton aCancelButton;
- HelpButton aHelpButton;
- FixedLine aDescription;
- FixedText aDescriptionText;
-
- BOOL m_bShowSlots;
- Link m_aAddHdl;
-
- DECL_LINK( ClickHdl, Button * );
- DECL_LINK( SelectHdl, Control* );
- DECL_LINK( FunctionDoubleClickHdl, Control* );
-
- void UpdateUI();
- void ResizeControls();
-
-public:
-
- SvxScriptSelectorDialog (
- Window* pParent = NULL,
- BOOL bShowSlots = FALSE,
- const ::com::sun::star::uno::Reference
- < ::com::sun::star::frame::XFrame >& xFrame = 0
- );
-
- ~SvxScriptSelectorDialog ( );
-
- void SetAddHdl( const Link& rLink ) { m_aAddHdl = rLink; }
- const Link& GetAddHdl() const { return m_aAddHdl; }
-
- void SetImageProvider( ImageProvider* provider )
- { aCategories.SetImageProvider( provider ); }
-
- USHORT GetSelectedId();
- String GetScriptURL() const;
- String GetSelectedDisplayName();
- String GetSelectedHelpText();
- void SetRunLabel();
- void SetDialogDescription(const String& rDescription);
-};
-
-#endif
diff --git a/svx/source/cui/selector.src b/svx/source/cui/selector.src
deleted file mode 100644
index 1a08f8cb3e..0000000000
--- a/svx/source/cui/selector.src
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: selector.src,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "selector.hrc"
-
-#define MASKCOLOR MaskColor = \
- Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
-#define FIXEDTEXT_DIALOG_DESCRIPTION \
-Text [ en-US ] = "Select the library that contains the macro you want. Then select the macro under 'Macro name'." ;\
-
-String STR_SELECTOR_ADD_COMMANDS
-{
- TEXT [ en-US ] = "Add Commands" ;
-};
-
-String STR_SELECTOR_MACROS
-{
- Text [ en-US ] = "%PRODUCTNAME Macros" ;
-};
-
-String STR_SELECTOR_CATEGORIES
-{
- Text [ en-US ] = "~Category" ;
-};
-
-String STR_SELECTOR_COMMANDS
-{
- Text [ en-US ] = "Commands" ;
-};
-
-String STR_SELECTOR_ADD
-{
- TEXT [ en-US ] = "Add" ;
-};
-
-String STR_SELECTOR_RUN
-{
- TEXT [ en-US ] = "Run" ;
-
-};
-
-String STR_SELECTOR_CLOSE
-{
- TEXT [ en-US ] = "Close" ;
-
-};
-
-String STR_SELECTOR_ADD_COMMANDS_DESCRIPTION
-{
- TEXT [ en-US ] = "To add a command to a toolbar, select the category and then the command. Then drag the command to the Commands list of the Toolbars tab page in the Customize dialog.";
-};
-
-String STR_BASICMACROS
-{
- Text [ en-US ] = "BASIC Macros" ;
-};
-
-
-ModelessDialog RID_DLG_SCRIPTSELECTOR
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 256 , 233 ) ;
- Text [ en-US ] = "Macro Selector" ;
- HelpId = HID_SELECTOR_DIALOG;
- SvLook = TRUE ;
- Moveable = TRUE ;
- Hide = TRUE;
- FixedText TXT_SELECTOR_DIALOG_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 190 , 48 ) ;
- Group = TRUE ;
- Left = TRUE ;
- WordBreak = TRUE ;
- FIXEDTEXT_DIALOG_DESCRIPTION
- };
- FixedText TXT_SELECTOR_CATEGORIES
- {
- Pos = MAP_APPFONT ( 6 , 62 ) ;
- Size = MAP_APPFONT ( 83 , 8 ) ;
- Group = TRUE ;
- Left = TRUE ;
- Text [ en-US ] = "Library" ;
- };
- Control BOX_SELECTOR_CATEGORIES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 73 ) ;
- Size = MAP_APPFONT ( 83 , 89 ) ;
- TabStop = TRUE;
- HelpId = HID_SELECTOR_CATEGORIES;
- String STR_MYMACROS
- {
- Text [ en-US ] = "My Macros";
- };
- String STR_PRODMACROS
- {
- Text [ en-US ] = "%PRODUCTNAME Macros";
- };
- Image IMG_HARDDISK
- {
- ImageBitmap = Bitmap { File = "harddisk_16.bmp" ; };
- MASKCOLOR
- };
- Image IMG_HARDDISK_HC
- {
- ImageBitmap = Bitmap { File = "harddisk_16_h.bmp" ; };
- MASKCOLOR
- };
- Image IMG_LIB
- {
- ImageBitmap = Bitmap { File = "im30820.png"; };
- MASKCOLOR
- };
- Image IMG_LIB_HC
- {
- ImageBitmap = Bitmap { File = "imh30820.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO
- {
- ImageBitmap = Bitmap { File = "im30821.png"; };
- MASKCOLOR
- };
- Image IMG_MACRO_HC
- {
- ImageBitmap = Bitmap { File = "imh30821.png"; };
- MASKCOLOR
- };
- Image IMG_DOC
- {
- ImageBitmap = Bitmap { File = "im30826.png"; };
- MASKCOLOR
- };
- Image IMG_DOC_HC
- {
- ImageBitmap = Bitmap { File = "imh30826.png"; };
- MASKCOLOR
- };
- };
- FixedText TXT_SELECTOR_COMMANDS
- {
- Pos = MAP_APPFONT ( 101 , 62 ) ;
- Size = MAP_APPFONT ( 93 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Macro name" ;
- };
- Control BOX_SELECTOR_COMMANDS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 101 , 73 ) ;
- Size = MAP_APPFONT ( 93 , 89 ) ;
- TabStop = TRUE;
- HelpId = HID_SELECTOR_COMMANDS;
- };
- OKButton BTN_SELECTOR_OK
- {
- Pos = MAP_APPFONT ( 200 , 73 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE;
- };
- CancelButton BTN_SELECTOR_CANCEL
- {
- Pos = MAP_APPFONT ( 200 , 90 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_SELECTOR_HELP
- {
- Pos = MAP_APPFONT ( 200 , 107 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- FixedLine GRP_SELECTOR_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 168 ) ;
- Size = MAP_APPFONT ( 224 , 8 ) ;
- Group = TRUE ;
- Text [ en-US ] = "Description" ;
- };
- FixedText TXT_SELECTOR_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 12 , 179 ) ;
- Size = MAP_APPFONT ( 224 , 48 ) ;
- WordBreak = TRUE ;
- };
-};
- // ********************************************************************** EOF
diff --git a/svx/source/cui/showcols.cxx b/svx/source/cui/showcols.cxx
deleted file mode 100644
index af6f4a54ea..0000000000
--- a/svx/source/cui/showcols.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: showcols.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include "showcols.hxx"
-
-#include "fmresids.hrc"
-#include <tools/shl.hxx>
-#include <svx/dialmgr.hxx>
-#include <vcl/msgbox.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-
-#define CUIFM_PROP_HIDDEN rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) )
-#define CUIFM_PROP_LABEL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) )
-
-//==========================================================================
-// FmShowColsDialog
-//==========================================================================
-DBG_NAME(FmShowColsDialog)
-//--------------------------------------------------------------------------
-FmShowColsDialog::FmShowColsDialog(Window* pParent)
- :ModalDialog(pParent, SVX_RES(RID_SVX_DLG_SHOWGRIDCOLUMNS))
- ,m_aList(this, SVX_RES(1))
- ,m_aLabel(this, SVX_RES(1))
- ,m_aOK(this, SVX_RES(1))
- ,m_aCancel(this, SVX_RES(1))
-{
- DBG_CTOR(FmShowColsDialog,NULL);
- m_aList.EnableMultiSelection(sal_True);
- m_aOK.SetClickHdl( LINK( this, FmShowColsDialog, OnClickedOk ) );
-
- FreeResource();
-}
-
-//--------------------------------------------------------------------------
-FmShowColsDialog::~FmShowColsDialog()
-{
- DBG_DTOR(FmShowColsDialog,NULL);
-}
-
-//--------------------------------------------------------------------------
-IMPL_LINK( FmShowColsDialog, OnClickedOk, Button*, EMPTYARG )
-{
- DBG_ASSERT(m_xColumns.is(), "FmShowColsDialog::OnClickedOk : you should call SetColumns before executing the dialog !");
- if (m_xColumns.is())
- {
- ::com::sun::star::uno::Any aCol;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xCol;
- for (sal_uInt16 i=0; i<m_aList.GetSelectEntryCount(); ++i)
- {
- m_xColumns->getByIndex(sal::static_int_cast<sal_Int32>(reinterpret_cast<sal_uIntPtr>(m_aList.GetEntryData(m_aList.GetSelectEntryPos(i))))) >>= xCol;
- if (xCol.is())
- {
- try
- {
- //CHINA001 xCol->setPropertyValue(::svxform::FM_PROP_HIDDEN, ::cppu::bool2any(sal_False));
- xCol->setPropertyValue(CUIFM_PROP_HIDDEN, ::cppu::bool2any(sal_False));
- }
- catch(...)
- {
- DBG_ERROR("FmShowColsDialog::OnClickedOk Exception occured!");
- }
- }
- }
- }
-
- EndDialog(RET_OK);
- return 0L;
-}
-
-//--------------------------------------------------------------------------
-void FmShowColsDialog::SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols)
-{
- DBG_ASSERT(xCols.is(), "FmShowColsDialog::SetColumns : invalid columns !");
- if (!xCols.is())
- return;
- m_xColumns = xCols.get();
-
- m_aList.Clear();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xCurCol;
- String sCurName;
- for (sal_uInt16 i=0; i<xCols->getCount(); ++i)
- {
- sCurName.Erase();
- ::cppu::extractInterface(xCurCol, xCols->getByIndex(i));
- sal_Bool bIsHidden = sal_False;
- try
- {
- //CHINA001 ::com::sun::star::uno::Any aHidden = xCurCol->getPropertyValue(::svxform::FM_PROP_HIDDEN);
- ::com::sun::star::uno::Any aHidden = xCurCol->getPropertyValue(CUIFM_PROP_HIDDEN);
- bIsHidden = ::comphelper::getBOOL(aHidden);
-
- ::rtl::OUString sName;
- //CHINA001 xCurCol->getPropertyValue(::svxform::FM_PROP_LABEL) >>= sName;
-
- xCurCol->getPropertyValue(CUIFM_PROP_LABEL) >>= sName;
- sCurName = (const sal_Unicode*)sName;
- }
- catch(...)
- {
- DBG_ERROR("FmShowColsDialog::SetColumns Exception occured!");
- }
-
- // if the col is hidden, put it into the list
- if (bIsHidden)
- m_aList.SetEntryData( m_aList.InsertEntry(sCurName), reinterpret_cast<void*>((sal_Int64)i) );
- }
-}
-
diff --git a/svx/source/cui/showcols.hxx b/svx/source/cui/showcols.hxx
deleted file mode 100644
index 0d21863cba..0000000000
--- a/svx/source/cui/showcols.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: showcols.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_SHOWCOLS_HXX
-#define _SVX_SHOWCOLS_HXX
-
-#include <vcl/dialog.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/fixed.hxx>
-
-#ifndef _SV_BUTTON_HXX //autogen
-#include <vcl/button.hxx>
-#endif
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-
-//==========================================================================
-// FmShowColsDialog
-//==========================================================================
-
-class FmShowColsDialog : public ModalDialog
-{
- ListBox m_aList;
- FixedText m_aLabel;
- OKButton m_aOK;
- CancelButton m_aCancel;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xColumns;
-
-public:
- FmShowColsDialog( Window* pParent );
- virtual ~FmShowColsDialog();
-
- void SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols);
-
-protected:
- DECL_LINK( OnClickedOk, Button* );
-};
-
-#endif // _SVX_SHOWCOLS_HXX
-
diff --git a/svx/source/cui/splitcelldlg.cxx b/svx/source/cui/splitcelldlg.cxx
deleted file mode 100644
index b746b7d650..0000000000
--- a/svx/source/cui/splitcelldlg.cxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: splitcelldlg.cxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <sfx2/dispatch.hxx>
-
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
-
-#include "svx/dialmgr.hxx"
-#include "splitcelldlg.hxx"
-#include "svx/dialogs.hrc"
-#include "splitcelldlg.hrc"
-
-SvxSplitTableDlg::SvxSplitTableDlg( Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
-: SvxStandardDialog(pParent, SVX_RES(RID_SVX_SPLITCELLDLG))
-, maCountLbl(this, SVX_RES(FT_COUNT))
-, maCountEdit(this, SVX_RES(ED_COUNT))
-, maCountFL(this, SVX_RES(FL_COUNT))
-, maHorzBox(this, SVX_RES(RB_HORZ))
-, maVertBox(this, SVX_RES(RB_VERT))
-, maPropCB(this, SVX_RES(CB_PROP))
-, maDirFL(this, SVX_RES(FL_DIR))
-, maOKBtn(this, SVX_RES(BT_OK))
-, maCancelBtn(this, SVX_RES(BT_CANCEL))
-, maHelpBtn( this, SVX_RES( BT_HELP ) )
-, mnMaxVertical( nMaxVertical )
-, mnMaxHorizontal( nMaxHorizontal )
-{
- maVertBox.SetModeRadioImage(Image(SVX_RES(BMP_SPLIT_VERT)), BMP_COLOR_HIGHCONTRAST);
- maHorzBox.SetModeRadioImage(Image(SVX_RES(BMP_SPLIT_HORZ)), BMP_COLOR_HIGHCONTRAST);
- FreeResource();
- maHorzBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
- maPropCB.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
- maVertBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
-
- if( mnMaxVertical < 2 )
- maVertBox.Enable(FALSE);
-
- //exchange the meaning of horizontal and vertical for vertical text
- if(bIsTableVertical)
- {
- Image aTmpImg(maHorzBox.GetModeRadioImage());
- String sTmp(maHorzBox.GetText());
- maHorzBox.SetText(maVertBox.GetText());
- maHorzBox.SetModeRadioImage(maVertBox.GetModeRadioImage());
- maVertBox.SetText(sTmp);
- maVertBox.SetModeRadioImage(aTmpImg);
- }
-}
-
-SvxSplitTableDlg::~SvxSplitTableDlg()
-{
-}
-
-IMPL_LINK( SvxSplitTableDlg, ClickHdl, Button *, pButton )
-{
- const bool bIsVert = pButton == &maVertBox ;
- long nMax = bIsVert ? mnMaxVertical : mnMaxHorizontal;
- maPropCB.Enable(!bIsVert);
- maCountEdit.SetMax( nMax );
- return 0;
-}
-
-bool SvxSplitTableDlg::IsHorizontal() const
-{
- return maHorzBox.IsChecked();
-}
-
-bool SvxSplitTableDlg::IsProportional() const
-{
- return maPropCB.IsChecked() && maHorzBox.IsChecked();
-}
-
-long SvxSplitTableDlg::GetCount() const
-{
- return sal::static_int_cast<long>( maCountEdit.GetValue() );
-}
-
-short SvxSplitTableDlg::Execute()
-{
- return SvxStandardDialog::Execute();
-}
-
-void SvxSplitTableDlg::Apply()
-{
-}
diff --git a/svx/source/cui/splitcelldlg.hrc b/svx/source/cui/splitcelldlg.hrc
deleted file mode 100644
index 7a0c7929b7..0000000000
--- a/svx/source/cui/splitcelldlg.hrc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: splitcelldlg.hrc,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define FT_COUNT 1
-#define ED_COUNT 2
-#define FL_COUNT 3
-
-#define RB_HORZ 10
-#define CB_PROP 11
-#define RB_VERT 12
-#define FL_DIR 12
-
-#define BMP_SPLIT_VERT 13
-#define BMP_SPLIT_HORZ 14
-
-#define BT_OK 100
-#define BT_CANCEL 101
-#define BT_HELP 102
-
diff --git a/svx/source/cui/splitcelldlg.hxx b/svx/source/cui/splitcelldlg.hxx
deleted file mode 100644
index d5b9e64ab3..0000000000
--- a/svx/source/cui/splitcelldlg.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: splitcelldlg.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SPLITCELLDLG_HXX
-#define _SVX_SPLITCELLDLG_HXX
-
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/imagebtn.hxx>
-#include <vcl/button.hxx>
-
-#include <svx/stddlg.hxx>
-#include <svx/svxdlg.hxx>
-
-class SvxSplitTableDlg : public SvxAbstractSplittTableDialog, public SvxStandardDialog
-{
- FixedText maCountLbl;
- NumericField maCountEdit;
- FixedLine maCountFL;
- ImageRadioButton maHorzBox;
- ImageRadioButton maVertBox;
- CheckBox maPropCB;
- FixedLine maDirFL;
- OKButton maOKBtn;
- CancelButton maCancelBtn;
- HelpButton maHelpBtn;
-
- long mnMaxVertical;
- long mnMaxHorizontal;
-protected:
- virtual void Apply();
-
-public:
- SvxSplitTableDlg(Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal );
- virtual ~SvxSplitTableDlg();
-
- DECL_LINK( ClickHdl, Button * );
-
- virtual bool IsHorizontal() const;
- virtual bool IsProportional() const;
- virtual long GetCount() const;
-
- virtual short Execute();
-};
-
-#endif
diff --git a/svx/source/cui/splitcelldlg.src b/svx/source/cui/splitcelldlg.src
deleted file mode 100644
index 6d6660564b..0000000000
--- a/svx/source/cui/splitcelldlg.src
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: splitcelldlg.src,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-#include "splitcelldlg.hrc"
-
-ModalDialog RID_SVX_SPLITCELLDLG
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 169 , 108 ) ;
- Text [ en-US ] = "Split Cells" ;
- Moveable = TRUE ;
-
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 115 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 115 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 115 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_COUNT
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 67 , 8 ) ;
- Text [ en-US ] = "~Split cell into" ;
- Left = TRUE ;
- };
- NumericField ED_COUNT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 82 , 14 ) ;
- Size = MAP_APPFONT ( 21 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 2 ;
- Maximum = 20 ;
- First = 2 ;
- Last = 5 ;
- };
- FixedLine FL_COUNT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 103 , 8 ) ;
- Text [ en-US ] = "Split" ;
- };
- ImageRadioButton RB_HORZ
- {
- Pos = MAP_APPFONT ( 12 , 47 ) ;
- Size = MAP_APPFONT ( 90 , 18 ) ;
- Group = TRUE;
- Text [ en-US ] = "H~orizontally" ;
- RadioButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "zetlhor2.bmp" ; };
- };
- TabStop = TRUE ;
- Check = TRUE ;
- };
- CheckBox CB_PROP
- {
- Pos = MAP_APPFONT ( 18 , 68 ) ;
- Size = MAP_APPFONT ( 91 , 12 ) ;
- Text [ en-US ] = "~Into equal proportions";
- };
- Image BMP_SPLIT_VERT
- {
- ImageBitmap = Bitmap { File = "zetlver2_h.bmp" ; };
- };
- Image BMP_SPLIT_HORZ
- {
- ImageBitmap = Bitmap { File = "zetlhor2_h.bmp" ; };
- };
- ImageRadioButton RB_VERT
- {
- Pos = MAP_APPFONT ( 12 , 84 ) ;
- Size = MAP_APPFONT ( 90 , 18 ) ;
- Text [ en-US ] = "~Vertically" ;
- RadioButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "zetlver2.bmp" ; };
- };
- TabStop = TRUE ;
- };
- FixedLine FL_DIR
- {
- Pos = MAP_APPFONT ( 6 , 36 ) ;
- Size = MAP_APPFONT ( 103 , 8 ) ;
- Text [ en-US ] = "Direction" ;
- };
-};
-
-
diff --git a/svx/source/cui/srchxtra.cxx b/svx/source/cui/srchxtra.cxx
deleted file mode 100644
index ae5f2d7365..0000000000
--- a/svx/source/cui/srchxtra.cxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: srchxtra.cxx,v $
- * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include "srchxtra.hxx"
-#include <tools/rcid.h>
-#include <vcl/msgbox.hxx>
-#include <svtools/cjkoptions.hxx>
-#include <svtools/whiter.hxx>
-#include <sfx2/objsh.hxx>
-
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-#ifndef _SVX_SRCHXTRA_HRC
-#include "srchxtra.hrc"
-#endif
-#ifndef _SVXITEMS_HRC
-#include <svx/svxitems.hrc>
-#endif
-
-#ifndef _SVX_FLSTITEM_HXX
-
-#include "flstitem.hxx"
-#endif
-#include "chardlg.hxx"
-#include "paragrph.hxx"
-#include <svx/dialmgr.hxx>
-#include "backgrnd.hxx"
-
-// class SvxSearchFormatDialog -------------------------------------------
-
-SvxSearchFormatDialog::SvxSearchFormatDialog( Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_SEARCHFORMAT ), &rSet ),
-
- pFontList( NULL )
-
-{
- FreeResource();
-
- AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0 );
- AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_CHAR_TWOLINES, SvxCharTwoLinesPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 );
-
- // remove asian tabpages if necessary
- SvtCJKOptions aCJKOptions;
- if ( !aCJKOptions.IsDoubleLinesEnabled() )
- RemoveTabPage( RID_SVXPAGE_CHAR_TWOLINES );
- if ( !aCJKOptions.IsAsianTypographyEnabled() )
- RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
-}
-
-// -----------------------------------------------------------------------
-
-SvxSearchFormatDialog::~SvxSearchFormatDialog()
-{
- delete pFontList;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxSearchFormatDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
-{
- switch ( nId )
- {
- case RID_SVXPAGE_CHAR_NAME:
- {
- const FontList* pAppFontList = 0;
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- if ( pSh )
- {
- const SvxFontListItem* pFLItem = (const SvxFontListItem*)
- pSh->GetItem( SID_ATTR_CHAR_FONTLIST );
- if ( pFLItem )
- pAppFontList = pFLItem->GetFontList();
- }
-
- const FontList* pList = pAppFontList;
-
- if ( !pList )
- {
- if ( !pFontList )
- pFontList = new FontList( this );
- pList = pFontList;
- }
-
- if ( pList )
- ( (SvxCharNamePage&)rPage ).
- SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) );
- ( (SvxCharNamePage&)rPage ).EnableSearchMode();
- break;
- }
-
- case RID_SVXPAGE_STD_PARAGRAPH:
- ( (SvxStdParagraphTabPage&)rPage ).EnableAutoFirstLine();
- break;
-
- case RID_SVXPAGE_ALIGN_PARAGRAPH:
- ( (SvxParaAlignTabPage&)rPage ).EnableJustifyExt();
- break;
- case RID_SVXPAGE_BACKGROUND :
- ( (SvxBackgroundTabPage&)rPage ).ShowParaControl(TRUE);
- break;
- }
-}
-
-// class SvxSearchFormatDialog -------------------------------------------
-
-SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent,
- SearchAttrItemList& rLst,
- const USHORT* pWhRanges ) :
-
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_SEARCHATTR ) ),
-
- aAttrFL ( this, SVX_RES( FL_ATTR ) ),
- aAttrLB ( this, SVX_RES( LB_ATTR ) ),
- aOKBtn ( this, SVX_RES( BTN_ATTR_OK ) ),
- aEscBtn ( this, SVX_RES( BTN_ATTR_CANCEL ) ),
- aHelpBtn( this, SVX_RES( BTN_ATTR_HELP ) ),
-
- rList( rLst )
-
-{
- FreeResource();
-
- aAttrLB.SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
- aAttrLB.GetModel()->SetSortMode( SortAscending );
-
- aOKBtn.SetClickHdl( LINK( this, SvxSearchAttributeDialog, OKHdl ) );
-
- SfxObjectShell* pSh = SfxObjectShell::Current();
- DBG_ASSERT( pSh, "No DocShell" );
-
- SfxItemPool& rPool = pSh->GetPool();
- SfxItemSet aSet( rPool, pWhRanges );
- SfxWhichIter aIter( aSet );
- USHORT nWhich = aIter.FirstWhich();
-
- while ( nWhich )
- {
- USHORT nSlot = rPool.GetSlotId( nWhich );
- if ( nSlot >= SID_SVX_START )
- {
- BOOL bChecked = FALSE, bFound = FALSE;
- for ( USHORT i = 0; !bFound && i < rList.Count(); ++i )
- {
- if ( nSlot == rList[i].nSlot )
- {
- bFound = TRUE;
- if ( IsInvalidItem( rList[i].pItem ) )
- bChecked = TRUE;
- }
- }
-
- USHORT nResId = nSlot - SID_SVX_START + RID_ATTR_BEGIN;
- SvLBoxEntry* pEntry = NULL;
- ResId aId( nResId, DIALOG_MGR() );
- aId.SetRT( RSC_STRING );
- if ( DIALOG_MGR().IsAvailable( aId ) )
- pEntry = aAttrLB.SvTreeListBox::InsertEntry( SVX_RESSTR( nResId ) );
- else
- {
- ByteString sError( "no resource for slot id\nslot = " );
- sError += ByteString::CreateFromInt32( nSlot );
- sError += ByteString( "\nresid = " );
- sError += ByteString::CreateFromInt32( nResId );
- DBG_ERRORFILE( sError.GetBuffer() );
- }
-
- if ( pEntry )
- {
- aAttrLB.SetCheckButtonState( pEntry, bChecked ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
- pEntry->SetUserData( (void*)(ULONG)nSlot );
- }
- }
- nWhich = aIter.NextWhich();
- }
-
- aAttrLB.SetHighlightRange();
- aAttrLB.SelectEntryPos( 0 );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxSearchAttributeDialog, OKHdl, Button *, EMPTYARG )
-{
- SearchAttrItem aInvalidItem;
- aInvalidItem.pItem = (SfxPoolItem*)-1;
-
- for ( USHORT i = 0; i < aAttrLB.GetEntryCount(); ++i )
- {
- USHORT nSlot = (USHORT)(ULONG)aAttrLB.GetEntryData(i);
- BOOL bChecked = aAttrLB.IsChecked(i);
-
- USHORT j;
- for ( j = rList.Count(); j; )
- {
- SearchAttrItem& rItem = rList[ --j ];
- if( rItem.nSlot == nSlot )
- {
- if( bChecked )
- {
- if( !IsInvalidItem( rItem.pItem ) )
- delete rItem.pItem;
- rItem.pItem = (SfxPoolItem*)-1;
- }
- else if( IsInvalidItem( rItem.pItem ) )
- rItem.pItem = 0;
- j = 1;
- break;
- }
- }
-
- if ( !j && bChecked )
- {
- aInvalidItem.nSlot = nSlot;
- rList.Insert( aInvalidItem );
- }
- }
-
- // remove invalid items (pItem == NULL)
- for ( USHORT n = rList.Count(); n; )
- if ( !rList[ --n ].pItem )
- rList.Remove( n );
-
- EndDialog( RET_OK );
- return 0;
-}
-
-// class SvxSearchSimilarityDialog ---------------------------------------
-
-SvxSearchSimilarityDialog::SvxSearchSimilarityDialog
-(
- Window* pParent,
- BOOL bRelax,
- USHORT nOther,
- USHORT nShorter,
- USHORT nLonger
-) :
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_SEARCHSIMILARITY ) ),
-
- aFixedLine ( this, SVX_RES( FL_SIMILARITY ) ),
- aOtherTxt ( this, SVX_RES( FT_OTHER ) ),
- aOtherFld ( this, SVX_RES( NF_OTHER ) ),
- aLongerTxt ( this, SVX_RES( FT_LONGER ) ),
- aLongerFld ( this, SVX_RES( NF_LONGER ) ),
- aShorterTxt ( this, SVX_RES( FT_SHORTER ) ),
- aShorterFld ( this, SVX_RES( NF_SHORTER ) ),
- aRelaxBox ( this, SVX_RES( CB_RELAX ) ),
-
- aOKBtn ( this, SVX_RES( BTN_ATTR_OK ) ),
- aEscBtn ( this, SVX_RES( BTN_ATTR_CANCEL ) ),
- aHelpBtn ( this, SVX_RES( BTN_ATTR_HELP ) )
-
-{
- FreeResource();
-
- aOtherFld.SetValue( nOther );
- aShorterFld.SetValue( nShorter );
- aLongerFld.SetValue( nLonger );
- aRelaxBox.Check( bRelax );
-}
-
diff --git a/svx/source/cui/srchxtra.hrc b/svx/source/cui/srchxtra.hrc
deleted file mode 100644
index c3e7ad5b58..0000000000
--- a/svx/source/cui/srchxtra.hrc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: srchxtra.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SRCHXTRA_HRC
-#define _SVX_SRCHXTRA_HRC
-
-// defines ------------------------------------------------------------------
-
-#define BTN_ATTR_OK 10
-#define BTN_ATTR_CANCEL 11
-#define BTN_ATTR_HELP 12
-#define LB_ATTR 13
-#define FL_ATTR 14
-
-#define CB_RELAX 15
-#define FT_OTHER 16
-#define NF_OTHER 17
-#define FT_SHORTER 18
-#define NF_SHORTER 19
-#define FT_LONGER 20
-#define NF_LONGER 21
-#define FL_SIMILARITY 22
-
-
-
-
-#endif
-
diff --git a/svx/source/cui/srchxtra.hxx b/svx/source/cui/srchxtra.hxx
deleted file mode 100644
index ce6a500d68..0000000000
--- a/svx/source/cui/srchxtra.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: srchxtra.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SRCHXTRA_HXX
-#define _SVX_SRCHXTRA_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/field.hxx>
-#include <svtools/ctrltool.hxx>
-#include <sfx2/tabdlg.hxx>
-
-#include <svx/checklbx.hxx>
-#include "srchdlg.hxx"
-
-// class SvxSearchFormatDialog -------------------------------------------
-
-class SvxSearchFormatDialog : public SfxTabDialog
-{
-public:
- SvxSearchFormatDialog( Window* pParent, const SfxItemSet& rSet );
- ~SvxSearchFormatDialog();
-
-protected:
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-private:
- FontList* pFontList;
-};
-
-// class SvxSearchFormatDialog -------------------------------------------
-
-class SvxSearchAttributeDialog : public ModalDialog
-{
-public:
- SvxSearchAttributeDialog( Window* pParent, SearchAttrItemList& rLst,
- const USHORT* pWhRanges );
-
-private:
- FixedText aAttrFL;
- SvxCheckListBox aAttrLB;
-
- OKButton aOKBtn;
- CancelButton aEscBtn;
- HelpButton aHelpBtn;
-
- SearchAttrItemList& rList;
-
- DECL_LINK( OKHdl, Button * );
-};
-
-// class SvxSearchSimilarityDialog ---------------------------------------
-
-class SvxSearchSimilarityDialog : public ModalDialog
-{
-private:
- FixedLine aFixedLine;
- FixedText aOtherTxt;
- NumericField aOtherFld;
- FixedText aLongerTxt;
- NumericField aLongerFld;
- FixedText aShorterTxt;
- NumericField aShorterFld;
- CheckBox aRelaxBox;
-
- OKButton aOKBtn;
- CancelButton aEscBtn;
- HelpButton aHelpBtn;
-
-public:
- SvxSearchSimilarityDialog( Window* pParent,
- BOOL bRelax,
- USHORT nOther,
- USHORT nShorter,
- USHORT nLonger );
-
- USHORT GetOther() { return (USHORT)aOtherFld.GetValue(); }
- USHORT GetShorter() { return (USHORT)aShorterFld.GetValue(); }
- USHORT GetLonger() { return (USHORT)aLongerFld.GetValue(); }
- BOOL IsRelaxed() { return aRelaxBox.IsChecked(); }
-};
-
-
-#endif
-
diff --git a/svx/source/cui/srchxtra.src b/svx/source/cui/srchxtra.src
deleted file mode 100644
index 2faf01b302..0000000000
--- a/svx/source/cui/srchxtra.src
+++ /dev/null
@@ -1,281 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: srchxtra.src,v $
- * $Revision: 1.52 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "srchxtra.hrc"
-
- // RID_SVXDLG_SEARCHFORMAT -----------------------------------------------
-TabDialog RID_SVXDLG_SEARCHFORMAT
-{
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Text [ en-US ] = "Text Format" ;
- Moveable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_CHAR_NAME ;
- Text [ en-US ] = "Font" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_CHAR_EFFECTS ;
- Text [ en-US ] = "Font Effects" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_CHAR_POSITION ;
- Text [ en-US ] = "Position" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_CHAR_TWOLINES ;
- Text [ en-US ] = "Asian Layout" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_STD_PARAGRAPH ;
- Text [ en-US ] = "Indents & Spacing" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
- Text [ en-US ] = "Alignment" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_EXT_PARAGRAPH ;
- Text [ en-US ] = "Text Flow" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_PARA_ASIAN;
- Text [ en-US ] = "Asian Typography";
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_BACKGROUND;
- Text [ en-US ] = "Background" ;
- };
- };
- };
-};
- // RID_SVXDLG_SEARCHATTRIBUTE --------------------------------------------
-ModalDialog RID_SVXDLG_SEARCHATTR
-{
- HelpId = HID_SEARCHATTR ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 194 , 128 ) ;
- Text [ en-US ] = "Attributes" ;
- Moveable = TRUE ;
- Control LB_ATTR
- {
- HelpId = HID_SEARCHATTR_CTL_ATTR ;
- ClipChildren = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 120 , 108 ) ;
- };
- FixedText FL_ATTR
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 124 , 8 ) ;
- Text [ en-US ] = "~Options" ;
- };
- OKButton BTN_ATTR_OK
- {
- Pos = MAP_APPFONT ( 136 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_ATTR_CANCEL
- {
- Pos = MAP_APPFONT ( 136 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_ATTR_HELP
- {
- Pos = MAP_APPFONT ( 136 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
- // RID_SVXDLG_SEARCHSIMILARITY -------------------------------------------
-ModalDialog RID_SVXDLG_SEARCHSIMILARITY
-{
- HelpId = HID_SEARCHSIMILARITY ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 76 ) ;
- Text [ en-US ] = "Similarity Search" ;
- Moveable = TRUE ;
- FixedText FT_OTHER
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "~Exchange characters" ;
- };
- NumericField NF_OTHER
- {
- Pos = MAP_APPFONT ( 86 , 14 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Border = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- First = 1 ;
- Maximum = 30 ;
- Last = 30 ;
- Value = 1 ;
- TabStop = TRUE ;
- };
- FixedText FT_LONGER
- {
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "~Add characters" ;
- };
- NumericField NF_LONGER
- {
- Pos = MAP_APPFONT ( 86 , 28 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Border = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- First = 1 ;
- Maximum = 30 ;
- Last = 30 ;
- Value = 1 ;
- TabStop = TRUE ;
- };
- FixedText FT_SHORTER
- {
- Pos = MAP_APPFONT ( 12 , 46 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "~Remove characters" ;
- };
- NumericField NF_SHORTER
- {
- Pos = MAP_APPFONT ( 86 , 44 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Border = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- First = 1 ;
- Maximum = 30 ;
- Last = 30 ;
- Value = 1 ;
- TabStop = TRUE ;
- };
- CheckBox CB_RELAX
- {
- Pos = MAP_APPFONT ( 12 , 60 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- Text [ en-US ] = "~Combine" ;
- TabStop = TRUE ;
- };
- FixedLine FL_SIMILARITY
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Settings" ;
- };
- OKButton BTN_ATTR_OK
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_ATTR_CANCEL
- {
- Pos = MAP_APPFONT ( 122 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_ATTR_HELP
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/svuidlg.hrc b/svx/source/cui/svuidlg.hrc
deleted file mode 100644
index b4f40e15ab..0000000000
--- a/svx/source/cui/svuidlg.hrc
+++ /dev/null
@@ -1,139 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: svuidlg.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/solar.hrc>
-
-#define HID_PASTE_DLG (HID_SO2_START + 0)
-#define HID_LINKDLG_TABLB (HID_SO2_START + 1)
-
-#define TB_LINKS 32014
-
-// gemeinsame Id's
-#define CB_DISPLAY_AS_ICON 12
-#define FI_DISPLAY 13
-#define PB_CHANGE_ICON 14
-
-#define STR_AUTOLINK 32006
-#define STR_MANUALLINK 32007
-#define STR_BROKENLINK 32008
-#define STR_GRAPHICLINK 32009
-#define STR_BUTTONCLOSE 32010
-#define STR_CLOSELINKMSG 32011
-#define STR_CLOSELINKMSG_MULTI 32024
-#define STR_WAITINGLINK 32028
-#define STR_EDIT_APPLET 32029
-
-
-#define FL_CHOICE 15
-#define LB_INSERT_LIST 7
-
-#define MD_PASTE_OBJECT 32001
-#define S_OBJECT 1
-#define RB_PASTE 20
-#define RB_PASTE_LINK 21
-#define FT_OBJECT_SOURCE 22
-#define FT_SOURCE 23
-
-#define MD_UPDATE_BASELINKS 32002
-#define LB_LINKS 30
-#define FT_FILES 31
-#define FT_LINKS 32
-#define FT_TYPE 33
-#define FT_STATUS 34
-#define PB_UPDATE_NOW 35
-#define PB_OPEN_SOURCE 36
-#define PB_CHANGE_SOURCE 37
-#define PB_BREAK_LINK 38
-#define FT_SOURCE2 39
-#define FT_TYPE2 40
-#define FT_UPDATE 41
-#define RB_AUTOMATIC 42
-#define RB_MANUAL 43
-#define FT_FULL_SOURCE_NAME 44
-#define FT_FULL_TYPE_NAME 45
-#define GB_LINK 46
-#define FT_FILES2 47
-#define FT_FULL_FILE_NAME 48
-
-#define MD_LINKEDIT 32004
-#define ED_FULL_SOURCE_NAME 1
-
-#define ED_FILEPATH 10
-#define BTN_FILEPATH 11
-#define CB_FILELINK 12
-
-#define MD_INSERT_OBJECT_PLUGIN 32008
-#define ED_FILEURL 10
-#define BTN_FILEURL 11
-#define GB_FILEURL 12
-#define ED_PLUGINS_OPTIONS 20
-#define GB_PLUGINS_OPTIONS 21
-
-#define MD_INSERT_OBJECT_APPLET 32009
-#define FT_CLASSFILE 10
-#define ED_CLASSFILE 11
-#define FT_CLASSLOCATION 12
-#define ED_CLASSLOCATION 12
-#define BTN_CLASS 13
-#define GB_CLASS 14
-#define ED_APPLET_OPTIONS 20
-#define GB_APPLET_OPTIONS 21
-
-#define MD_INSERT_OLEOBJECT 32010
-#define RB_NEW_OBJECT 10
-#define RB_OBJECT_FROMFILE 11
-#define LB_OBJECTTYPE 12
-#define GB_OBJECT 13
-#define STR_FILE 14
-
-#define MD_INSERT_OBJECT_IFRAME 32011
-#define FT_FRAMENAME 3
-#define ED_FRAMENAME 4
-#define FT_URL 5
-#define ED_URL 6
-#define BT_FILEOPEN 7
-#define NM_MARGINHEIGHT 8
-#define FT_MARGINHEIGHT 9
-#define NM_MARGINWIDTH 10
-#define FT_MARGINWIDTH 11
-#define GB_MARGIN 12
-#define RB_SCROLLINGON 13
-#define RB_SCROLLINGOFF 14
-#define RB_SCROLLINGAUTO 15
-#define GB_SCROLLING 16
-#define GB_BORDER 17
-#define RB_FRMBORDER_ON 18
-#define RB_FRMBORDER_INHERIT 19
-#define RB_FRMBORDER_OFF 20
-#define CB_MARGINWIDTHDEFAULT 21
-#define CB_MARGINHEIGHTDEFAULT 22
-#define FL_SEP_LEFT 46
-#define FL_SEP_RIGHT 47
-
diff --git a/svx/source/cui/svuidlg.src b/svx/source/cui/svuidlg.src
deleted file mode 100644
index eeff7e33d0..0000000000
--- a/svx/source/cui/svuidlg.src
+++ /dev/null
@@ -1,711 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: svuidlg.src,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/controldims.hrc>
-#include "svuidlg.hrc"
-
-ModalDialog MD_PASTE_OBJECT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 282 , 135 ) ; // 12 under listbox
- Text [ en-US ] = "Paste Special" ;
- FixedText FT_SOURCE
- {
- Pos = MAP_APPFONT ( 6 , 11 ) ;
- Size = MAP_APPFONT ( 30 , 10 ) ;
- Text [ en-US ] = "Source:" ;
- };
- FixedText FT_OBJECT_SOURCE
- {
- Pos = MAP_APPFONT ( 42 , 11 ) ;
- Size = MAP_APPFONT ( 166 , 20 ) ;
- WordBreak = TRUE ;
- };
- RadioButton RB_PASTE
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 63 , 10 ) ;
- Text [ en-US ] = "~Insert as" ;
- Check = TRUE ;
- };
- RadioButton RB_PASTE_LINK
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 78 , 48 ) ;
- Size = MAP_APPFONT ( 63 , 10 ) ;
- Text [ en-US ] = "Link to" ;
- };
- ListBox LB_INSERT_LIST
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 49 ) ;
- Size = MAP_APPFONT ( 202 , 74 ) ;
- };
- CheckBox CB_DISPLAY_AS_ICON
- {
- Hide = TRUE ;
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 150 , 62 ) ;
- Size = MAP_APPFONT ( 64 , 10 ) ;
- Text [ en-US ] = "~As icon" ;
- };
- /*
- FixedIcon FI_DISPLAY
- {
- Border = TRUE ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 167 , 75 ) ;
- Size = MAP_APPFONT ( 30 , 30 ) ;
- };
-*/
- PushButton PB_CHANGE_ICON
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 150 , 111 ) ;
- Size = MAP_APPFONT ( 64 , 14 ) ;
- Text [ en-US ] = "~Other Icon..." ;
- };
- FixedLine FL_CHOICE
- {
- Pos = MAP_APPFONT ( 6 , 38 ) ;
- Size = MAP_APPFONT ( 214 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Selection" ;
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 226 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 226 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 226 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- String S_OBJECT
- {
- Text [ en-US ] = "Object" ;
- };
-};
-ModalDialog MD_UPDATE_BASELINKS
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 337 , 166 ) ;
- Text [ en-US ] = "Edit Links" ;
- Moveable = TRUE ;
- FixedText FT_FILES
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 74 , 10 ) ;
- Text [ en-US ] = "Source file" ;
- };
- FixedText FT_LINKS
- {
- Pos = MAP_APPFONT ( 83 , 6 ) ;
- Size = MAP_APPFONT ( 63 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Element: : Verknüpfungen */
- Text [ en-US ] = "Element:" ;
- };
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 150 , 6 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- Text [ en-US ] = "Type" ;
- };
- FixedText FT_STATUS
- {
- Pos = MAP_APPFONT ( 215 , 6 ) ;
- Size = MAP_APPFONT ( 55 , 10 ) ;
- Text [ en-US ] = "Status" ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 270 , 6 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Close" ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 270 , 26 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- };
- PushButton PB_UPDATE_NOW
- {
- Pos = MAP_APPFONT ( 270 , 43 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Update" ;
- };
- PushButton PB_OPEN_SOURCE
- {
- Pos = MAP_APPFONT ( 270 , 60 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Open" ;
- };
- PushButton PB_CHANGE_SOURCE
- {
- Pos = MAP_APPFONT ( 270 , 77 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Modify..." ;
- };
- PushButton PB_BREAK_LINK
- {
- Pos = MAP_APPFONT ( 270 , 94 ) ;
- Size = MAP_APPFONT ( 60 , 14 ) ;
- Text [ en-US ] = "~Break Link" ;
- };
- FixedText FT_FILES2
- {
- Pos = MAP_APPFONT ( 6 , 111 ) ;
- Size = MAP_APPFONT ( 61 , 10 ) ;
- Text [ en-US ] = "Source file" ;
- };
- FixedText FT_SOURCE2
- {
- Pos = MAP_APPFONT ( 6 , 124 ) ;
- Size = MAP_APPFONT ( 61 , 10 ) ;
- Text [ en-US ] = "Element:" ;
- };
- FixedText FT_TYPE2
- {
- Pos = MAP_APPFONT ( 6 , 137 ) ;
- Size = MAP_APPFONT ( 61 , 10 ) ;
- Text [ en-US ] = "Type:" ;
- };
- FixedText FT_UPDATE
- {
- Pos = MAP_APPFONT ( 6 , 150 ) ;
- Size = MAP_APPFONT ( 61 , 10 ) ;
- Text [ en-US ] = "Update:" ;
- };
- RadioButton RB_AUTOMATIC
- {
- Pos = MAP_APPFONT ( 70 , 150 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- Text [ en-US ] = "~Automatic" ;
- };
- RadioButton RB_MANUAL
- {
- Pos = MAP_APPFONT ( 133 , 150 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Manuell : Ma~nuell */
- Text [ en-US ] = "Ma~nual" ;
- };
- FixedText FT_FULL_FILE_NAME
- {
- Pos = MAP_APPFONT ( 70 , 111 ) ;
- Size = MAP_APPFONT ( 225 , 10 ) ;
- };
- FixedText FT_FULL_SOURCE_NAME
- {
- Pos = MAP_APPFONT ( 70 , 124 ) ;
- Size = MAP_APPFONT ( 225 , 10 ) ;
- };
- FixedText FT_FULL_TYPE_NAME
- {
- Pos = MAP_APPFONT ( 70 , 137 ) ;
- Size = MAP_APPFONT ( 225 , 10 ) ;
- };
- String STR_AUTOLINK
- {
- Text [ en-US ] = "Automatic" ;
- };
- String STR_MANUALLINK
- {
- Text [ en-US ] = "Manual" ;
- };
- String STR_BROKENLINK
- {
- Text [ en-US ] = "Not available" ;
- };
- String STR_GRAPHICLINK
- {
- Text [ en-US ] = "Graphic" ;
- };
- String STR_BUTTONCLOSE
- {
- Text [ en-US ] = "~Close" ;
- };
- String STR_CLOSELINKMSG
- {
- Text [ en-US ] = "Are you sure you want to remove the selected link?" ;
- };
- String STR_CLOSELINKMSG_MULTI
- {
- Text [ en-US ] = "Are you sure you want to remove the selected link?" ;
- };
- String STR_WAITINGLINK
- {
- Text [ en-US ] = "Waiting";
- };
-};
-ModalDialog MD_LINKEDIT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 222 , 58 ) ;
- Text [ en-US ] = "Modify Link" ;
- Moveable = TRUE ;
- OKButton 1
- {
- Pos = MAP_APPFONT ( 165 , 5 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 165 , 25 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- FixedText FT_FULL_TYPE_NAME
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 5 , 5 ) ;
- Size = MAP_APPFONT ( 155 , 10 ) ;
- };
- FixedText 2
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 5 , 20 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Exchange source:" ;
- };
- Edit ED_FULL_SOURCE_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 5 , 35 ) ;
- Size = MAP_APPFONT ( 155 , 12 ) ;
- Text [ en-US ] = "Edit" ;
- };
-};
-ModalDialog MD_INSERT_OLEOBJECT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 284 , 105 ) ;
- Moveable = TRUE ;
- RadioButton RB_NEW_OBJECT
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- Text [ en-US ] = "~Create new" ;
- };
- RadioButton RB_OBJECT_FROMFILE
- {
- Pos = MAP_APPFONT ( 90 , 6 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- Text [ en-US ] = "Create from ~file" ;
- };
- ListBox LB_OBJECTTYPE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 204 , 60 ) ;
- };
- Edit ED_FILEPATH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 204 , 12 ) ;
- };
- PushButton BTN_FILEPATH
- {
- Pos = MAP_APPFONT ( 166 , 48 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Search..." ;
- };
- CheckBox CB_FILELINK
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 138 , 10 ) ;
- Text [ en-US ] = "~Link to file" ;
- };
- FixedLine GB_OBJECT
- {
- Pos = MAP_APPFONT ( 6 , 22 ) ;
- Size = MAP_APPFONT ( 216 , 8 ) ;
- Text [ en-US ] = "Object type" ;
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 228 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- TabStop = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 228 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 228 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- String STR_FILE
- {
- Text [ en-US ] = "File" ;
- };
- Text [ en-US ] = "Insert OLE Object" ;
-};
-ModalDialog MD_INSERT_OBJECT_PLUGIN
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 284 , 123 ) ;
- Moveable = TRUE ;
- Edit ED_FILEURL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 204 , 12 ) ;
- };
- PushButton BTN_FILEURL
- {
- Pos = MAP_APPFONT ( 166 , 29 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Browse..." ;
- };
- FixedLine GB_FILEURL
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 216 , 8 ) ;
- Text [ en-US ] = "File / URL" ;
- };
- MultiLineEdit ED_PLUGINS_OPTIONS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 66 ) ;
- Size = MAP_APPFONT ( 204 , 45 ) ;
- VScroll = TRUE ;
- IgnoreTab = TRUE;
- };
- FixedLine GB_PLUGINS_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 55 ) ;
- Size = MAP_APPFONT ( 216 , 8 ) ;
- Text [ en-US ] = "Options" ;
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 228 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 228 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 228 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- Text [ en-US ] = "Insert Plug-in" ;
-};
-ModalDialog MD_INSERT_OBJECT_APPLET
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 284 , 164 ) ;
- Moveable = TRUE ;
- FixedText FT_CLASSFILE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 204 , 10 ) ;
- Text [ en-US ] = "~Class" ;
- };
- Edit ED_CLASSFILE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 27 ) ;
- Size = MAP_APPFONT ( 204 , 12 ) ;
- };
- FixedText FT_CLASSLOCATION
- {
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 204 , 10 ) ;
- Text [ en-US ] = "Class ~Location" ;
- };
- Edit ED_CLASSLOCATION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 55 ) ;
- Size = MAP_APPFONT ( 204 , 12 ) ;
- };
- PushButton BTN_CLASS
- {
- Pos = MAP_APPFONT ( 166 , 70 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Search..." ;
- };
- FixedLine GB_CLASS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 216 , 8 ) ;
- Text [ en-US ] = "File" ;
- };
- MultiLineEdit ED_APPLET_OPTIONS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 107 ) ;
- Size = MAP_APPFONT ( 204 , 45 ) ;
- VScroll = TRUE ;
- IgnoreTab = TRUE;
- };
- FixedLine GB_APPLET_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 96 ) ;
- Size = MAP_APPFONT ( 216 , 8 ) ;
- Text [ en-US ] = "Options" ;
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 228 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 228 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 228 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- Text [ en-US ] = "Insert Applet" ;
-};
-Control TB_LINKS
-{
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 21 ) ;
- Size = MAP_APPFONT ( 257 , 87 ) ;
- TabStop = TRUE ;
- ClipChildren = TRUE ;
-};
-
-ModalDialog MD_INSERT_OBJECT_IFRAME
-{
- Size = MAP_APPFONT ( 302 , 98 ) ;
- Hide = TRUE ;
- Moveable = TRUE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Text [ en-US ] = "Floating Frame Properties" ;
- OKButton 1
- {
- Pos = MAP_APPFONT ( 246 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 246 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 246 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- FixedText FT_FRAMENAME
- {
- Pos = MAP_APPFONT ( 6 , 7 ) ;
- Size = MAP_APPFONT ( 36 , 10 ) ;
- Text [ en-US ] = "~Name" ;
- };
- Edit ED_FRAMENAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 45 , 6 ) ;
- Size = MAP_APPFONT ( 178 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_URL
- {
- Pos = MAP_APPFONT ( 6 , 25 ) ;
- Size = MAP_APPFONT ( 36 , 10 ) ;
- Text [ en-US ] = "~Contents" ;
- };
- Edit ED_URL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 45 , 24 ) ;
- Size = MAP_APPFONT ( 178 , 12 ) ;
- TabStop = TRUE ;
- };
- PushButton BT_FILEOPEN
- {
- Pos = MAP_APPFONT ( 226 , 24 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "~..." ;
- TabStop = TRUE ;
- };
- RadioButton RB_SCROLLINGON
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 54 , 10 ) ;
- Text [ en-US ] = "~On" ;
- };
- RadioButton RB_SCROLLINGOFF
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 66 ) ;
- Size = MAP_APPFONT ( 54 , 10 ) ;
- Text [ en-US ] = "O~ff" ;
- };
- RadioButton RB_SCROLLINGAUTO
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 79 ) ;
- Size = MAP_APPFONT ( 54 , 10 ) ;
- Text [ en-US ] = "Au~tomatic" ;
- };
- FixedLine GB_SCROLLING
- {
- Pos = MAP_APPFONT ( 6 , 42 ) ;
- Size = MAP_APPFONT ( 63 , 8 ) ;
- Text [ en-US ] = "Scroll bar" ;
- };
- RadioButton RB_FRMBORDER_ON
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 81 , 53 ) ;
- Size = MAP_APPFONT ( 42 , 10 ) ;
- Text [ en-US ] = "On" ;
- };
- RadioButton RB_FRMBORDER_OFF
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 81 , 66 ) ;
- Size = MAP_APPFONT ( 42 , 10 ) ;
- Text [ en-US ] = "Off" ;
- };
- FixedLine FL_SEP_LEFT
- {
- Pos = MAP_APPFONT ( 70 , 51 ) ;
- Size = MAP_APPFONT ( 4 , 38 ) ;
- };
- FixedLine GB_BORDER
- {
- Pos = MAP_APPFONT ( 75 , 42 ) ;
- Size = MAP_APPFONT ( 49 , 8 ) ;
- Text [ en-US ] = "Border" ;
- };
- FixedText FT_MARGINWIDTH
- {
- Pos = MAP_APPFONT ( 136 , 56 ) ;
- Size = MAP_APPFONT ( 28 , 10 ) ;
- Text [ en-US ] = "~Width" ;
- };
- NumericField NM_MARGINWIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 167 , 54 ) ;
- Size = MAP_APPFONT ( 20 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 99 ;
- Last = 10 ;
- SpinSize = 1 ;
- };
- CheckBox CB_MARGINWIDTHDEFAULT
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 190 , 56 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "~Default" ;
- };
- FixedText FT_MARGINHEIGHT
- {
- Pos = MAP_APPFONT ( 136 , 74 ) ;
- Size = MAP_APPFONT ( 28 , 10 ) ;
- Text [ en-US ] = "H~eight" ;
- };
- NumericField NM_MARGINHEIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 167 , 72 ) ;
- Size = MAP_APPFONT ( 20 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 99 ;
- Last = 10 ;
- SpinSize = 1 ;
- };
- CheckBox CB_MARGINHEIGHTDEFAULT
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 190 , 74 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "Defa~ult" ;
- };
- FixedLine FL_SEP_RIGHT
- {
- Pos = MAP_APPFONT ( 125 , 51 ) ;
- Size = MAP_APPFONT ( 4 , 38 ) ;
- };
- FixedLine GB_MARGIN
- {
- Pos = MAP_APPFONT ( 130 , 42 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Spacing to contents" ;
- };
-};
-
-String MD_INSERT_OBJECT_IFRAME
-{
- Text [ en-US ] = "Select File for Floating Frame" ;
-};
-
-String STR_EDIT_APPLET
-{
- Text [ en-US ] = "Edit Applet" ;
-};
-
diff --git a/svx/source/cui/swpossizetabpage.cxx b/svx/source/cui/swpossizetabpage.cxx
deleted file mode 100644
index b3aecc4405..0000000000
--- a/svx/source/cui/swpossizetabpage.cxx
+++ /dev/null
@@ -1,1977 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: swpossizetabpage.cxx,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <cstddef>
-#include <swpossizetabpage.hxx>
-#include <svx/dialmgr.hxx>
-#include <dlgutil.hxx>
-#include <anchorid.hxx>
-#include <svtools/aeitem.hxx>
-#include <swframevalidation.hxx>
-#include <tools/debug.hxx>
-#include <svx/dialogs.hrc>
-#include <swpossizetabpage.hrc>
-#include <htmlmode.hxx>
-#include <svx/svdview.hxx>
-#include <svx/svdpagv.hxx>
-#include <svx/rectenum.hxx>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/RelOrientation.hpp>
-
-using namespace ::com::sun::star::text;
-#define SwFPos SvxSwFramePosString
-
-struct FrmMap
-{
- SvxSwFramePosString::StringId eStrId;
- SvxSwFramePosString::StringId eMirrorStrId;
- short nAlign;
- ULONG nLBRelations;
-};
-
-struct RelationMap
-{
- SvxSwFramePosString::StringId eStrId;
- SvxSwFramePosString::StringId eMirrorStrId;
- ULONG nLBRelation;
- short nRelation;
-};
-struct StringIdPair_Impl
-{
- SvxSwFramePosString::StringId eHori;
- SvxSwFramePosString::StringId eVert;
-};
-
-#define LB_FRAME 0x00000001L // paragraph text area
-#define LB_PRTAREA 0x00000002L // paragraph text area + indents
-#define LB_VERT_FRAME 0x00000004L // vertical paragraph text area
-#define LB_VERT_PRTAREA 0x00000008L // vertical paragraph text area + indents
-#define LB_REL_FRM_LEFT 0x00000010L // left paragraph margin
-#define LB_REL_FRM_RIGHT 0x00000020L // right paragraph margin
-
-#define LB_REL_PG_LEFT 0x00000040L // left page margin
-#define LB_REL_PG_RIGHT 0x00000080L // right page margin
-#define LB_REL_PG_FRAME 0x00000100L // complete page
-#define LB_REL_PG_PRTAREA 0x00000200L // text area of page
-
-#define LB_FLY_REL_PG_LEFT 0x00000400L // left frame margin
-#define LB_FLY_REL_PG_RIGHT 0x00000800L // right frame margin
-#define LB_FLY_REL_PG_FRAME 0x00001000L // complete frame
-#define LB_FLY_REL_PG_PRTAREA 0x00002000L // frame interior
-
-#define LB_REL_BASE 0x00010000L // as char, relative to baseline
-#define LB_REL_CHAR 0x00020000L // as char, relative to character
-#define LB_REL_ROW 0x00040000L // as char, relative to line
-
-// OD 10.11.2003 #i22305#
-#define LB_FLY_VERT_FRAME 0x00100000L // vertical entire frame
-#define LB_FLY_VERT_PRTAREA 0x00200000L // vertical frame text area
-
-// OD 11.11.2003 #i22341#
-#define LB_VERT_LINE 0x00400000L // vertical text line
-
-static RelationMap __FAR_DATA aRelationMap[] =
-{
- {SwFPos::FRAME, SwFPos::FRAME, LB_FRAME, RelOrientation::FRAME},
- {SwFPos::PRTAREA, SwFPos::PRTAREA, LB_PRTAREA, RelOrientation::PRINT_AREA},
- {SwFPos::REL_PG_LEFT, SwFPos::MIR_REL_PG_LEFT, LB_REL_PG_LEFT, RelOrientation::PAGE_LEFT},
- {SwFPos::REL_PG_RIGHT, SwFPos::MIR_REL_PG_RIGHT, LB_REL_PG_RIGHT, RelOrientation::PAGE_RIGHT},
- {SwFPos::REL_FRM_LEFT, SwFPos::MIR_REL_FRM_LEFT, LB_REL_FRM_LEFT, RelOrientation::FRAME_LEFT},
- {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB_REL_FRM_RIGHT, RelOrientation::FRAME_RIGHT},
- {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB_REL_PG_FRAME, RelOrientation::PAGE_FRAME},
- {SwFPos::REL_PG_PRTAREA,SwFPos::REL_PG_PRTAREA, LB_REL_PG_PRTAREA, RelOrientation::PAGE_PRINT_AREA},
- {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, RelOrientation::CHAR},
-
- {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB_FLY_REL_PG_LEFT, RelOrientation::PAGE_LEFT},
- {SwFPos::FLY_REL_PG_RIGHT, SwFPos::FLY_MIR_REL_PG_RIGHT, LB_FLY_REL_PG_RIGHT, RelOrientation::PAGE_RIGHT},
- {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_REL_PG_FRAME, RelOrientation::PAGE_FRAME},
- {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_REL_PG_PRTAREA, RelOrientation::PAGE_PRINT_AREA},
-
- {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB_VERT_FRAME, RelOrientation::FRAME},
- {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB_VERT_PRTAREA, RelOrientation::PRINT_AREA},
-
- // OD 10.11.2003 #i22305#
- {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_VERT_FRAME, RelOrientation::FRAME},
- {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_VERT_PRTAREA, RelOrientation::PRINT_AREA},
-
- // OD 11.11.2003 #i22341#
- {SwFPos::REL_LINE, SwFPos::REL_LINE, LB_VERT_LINE, RelOrientation::TEXT_LINE}
-};
-
-static RelationMap __FAR_DATA aAsCharRelationMap[] =
-{
- {SwFPos::REL_BASE, SwFPos::REL_BASE, LB_REL_BASE, RelOrientation::FRAME},
- {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, RelOrientation::FRAME},
- {SwFPos::REL_ROW, SwFPos::REL_ROW, LB_REL_ROW, RelOrientation::FRAME}
-};
-
-/*--------------------------------------------------------------------
- Anchored at page
- --------------------------------------------------------------------*/
-
-#define HORI_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_PG_LEFT| \
- LB_REL_PG_RIGHT)
-
-static FrmMap __FAR_DATA aHPageMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_PAGE_REL},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_PAGE_REL},
- {SwFPos::CENTER_HORI,SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_PAGE_REL},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_PAGE_REL}
-};
-
-static FrmMap __FAR_DATA aHPageHtmlMap[] =
-{
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB_REL_PG_FRAME}
-};
-
-#define VERT_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
-
-static FrmMap __FAR_DATA aVPageMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PAGE_REL},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PAGE_REL},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PAGE_REL},
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PAGE_REL}
-};
-
-static FrmMap __FAR_DATA aVPageHtmlMap[] =
-{
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB_REL_PG_FRAME}
-};
-
-/*--------------------------------------------------------------------
- Anchored at frame
- --------------------------------------------------------------------*/
-
-#define HORI_FRAME_REL (LB_FLY_REL_PG_FRAME|LB_FLY_REL_PG_PRTAREA| \
- LB_FLY_REL_PG_LEFT|LB_FLY_REL_PG_RIGHT)
-
-static FrmMap __FAR_DATA aHFrameMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_FRAME_REL},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_FRAME_REL},
- {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_FRAME_REL},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_FRAME_REL}
-};
-
-static FrmMap __FAR_DATA aHFlyHtmlMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, LB_FLY_REL_PG_FRAME},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB_FLY_REL_PG_FRAME}
-};
-
-// OD 19.09.2003 #i18732# - own vertical alignment map for to frame anchored objects
-// OD 10.11.2003 #i22305#
-#define VERT_FRAME_REL (LB_VERT_FRAME|LB_FLY_VERT_PRTAREA)
-
-static FrmMap __FAR_DATA aVFrameMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_FRAME_REL},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_FRAME_REL},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_FRAME_REL},
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_FRAME_REL}
-};
-
-static FrmMap __FAR_DATA aVFlyHtmlMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_FLY_VERT_FRAME},
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB_FLY_VERT_FRAME}
-};
-
-static FrmMap __FAR_DATA aVMultiSelectionMap[] =
-{
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, 0}
-};
-static FrmMap __FAR_DATA aHMultiSelectionMap[] =
-{
- {SwFPos::FROMLEFT, SwFPos::FROMLEFT, HoriOrientation::NONE, 0}
-};
-
-/*--------------------------------------------------------------------
- Anchored at paragraph
- --------------------------------------------------------------------*/
-
-#define HORI_PARA_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \
- LB_REL_FRM_RIGHT)
-
-static FrmMap __FAR_DATA aHParaMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_PARA_REL},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_PARA_REL},
- {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_PARA_REL},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_PARA_REL}
-};
-
-#define HTML_HORI_PARA_REL (LB_FRAME|LB_PRTAREA)
-
-static FrmMap __FAR_DATA aHParaHtmlMap[] =
-{
- {SwFPos::LEFT, SwFPos::LEFT, HoriOrientation::LEFT, HTML_HORI_PARA_REL},
- {SwFPos::RIGHT, SwFPos::RIGHT, HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
-};
-
-static FrmMap __FAR_DATA aHParaHtmlAbsMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HTML_HORI_PARA_REL},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HTML_HORI_PARA_REL}
-};
-
-
-#define VERT_PARA_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
-
-static FrmMap __FAR_DATA aVParaMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PARA_REL},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PARA_REL},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PARA_REL},
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PARA_REL}
-};
-
-static FrmMap __FAR_DATA aVParaHtmlMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_VERT_PRTAREA}
-};
-
-/*--------------------------------------------------------------------
- Anchored at character
- --------------------------------------------------------------------*/
-
-#define HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \
- LB_REL_FRM_RIGHT|LB_REL_CHAR)
-
-static FrmMap __FAR_DATA aHCharMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_CHAR_REL},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_CHAR_REL},
- {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_CHAR_REL},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_CHAR_REL}
-};
-
-#define HTML_HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_CHAR)
-
-static FrmMap __FAR_DATA aHCharHtmlMap[] =
-{
- {SwFPos::LEFT, SwFPos::LEFT, HoriOrientation::LEFT, HTML_HORI_CHAR_REL},
- {SwFPos::RIGHT, SwFPos::RIGHT, HoriOrientation::RIGHT, HTML_HORI_CHAR_REL}
-};
-
-static FrmMap __FAR_DATA aHCharHtmlAbsMap[] =
-{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, LB_PRTAREA|LB_REL_CHAR},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, LB_PRTAREA},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB_REL_PG_FRAME}
-};
-
-// OD 19.09.2003 #i18732# - allow vertical alignment at page areas
-// OD 12.11.2003 #i22341# - handle <LB_REL_CHAR> on its own
-#define VERT_CHAR_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
-
-static FrmMap __FAR_DATA aVCharMap[] =
-{
- // OD 11.11.2003 #i22341#
- // introduce mappings for new vertical alignment at top of line <LB_VERT_LINE>
- // and correct mapping for vertical alignment at character for position <FROM_BOTTOM>
- // Note: Because of these adjustments the map becomes ambigous in its values
- // <eStrId>/<eMirrorStrId> and <nAlign>. These ambiguities are considered
- // in the methods <SwFrmPage::FillRelLB(..)>, <SwFrmPage::GetAlignment(..)>
- // and <SwFrmPage::FillPosLB(..)>
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_CHAR_REL|LB_REL_CHAR},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_CHAR_REL|LB_REL_CHAR},
- {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_CHAR_REL|LB_REL_CHAR},
- {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_CHAR_REL},
- {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB_REL_CHAR|LB_VERT_LINE},
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB_VERT_LINE},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB_VERT_LINE},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB_VERT_LINE}
-};
-
-
-static FrmMap __FAR_DATA aVCharHtmlMap[] =
-{
- {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}
-};
-
-static FrmMap __FAR_DATA aVCharHtmlAbsMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_REL_CHAR},
- {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}
-};
-/*--------------------------------------------------------------------
- anchored as character
- --------------------------------------------------------------------*/
-
-static FrmMap __FAR_DATA aVAsCharMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_REL_BASE},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, LB_REL_BASE},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, LB_REL_BASE},
-
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::CHAR_TOP, LB_REL_CHAR},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CHAR_CENTER, LB_REL_CHAR},
-
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB_REL_ROW},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB_REL_ROW},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB_REL_ROW},
-
- {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB_REL_BASE}
-};
-
-static FrmMap __FAR_DATA aVAsCharHtmlMap[] =
-{
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_REL_BASE},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, LB_REL_BASE},
-
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::CHAR_TOP, LB_REL_CHAR},
-
- {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB_REL_ROW},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB_REL_ROW},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB_REL_ROW}
-};
-/*-- 05.03.2004 15:52:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-std::size_t lcl_GetFrmMapCount(const FrmMap* pMap)
-{
- if ( pMap )
- {
- std::size_t aSizeOf = sizeof(FrmMap);
- if( pMap == aVParaHtmlMap)
- return sizeof(aVParaHtmlMap) / aSizeOf;
- if( pMap == aVAsCharHtmlMap)
- return sizeof(aVAsCharHtmlMap) / aSizeOf;
- if( pMap == aHParaHtmlMap)
- return sizeof(aHParaHtmlMap) / aSizeOf;
- if( pMap == aHParaHtmlAbsMap)
- return sizeof(aHParaHtmlAbsMap) / aSizeOf;
- if ( pMap == aVPageMap )
- return sizeof(aVPageMap) / aSizeOf;
- if ( pMap == aVPageHtmlMap )
- return sizeof(aVPageHtmlMap) / aSizeOf;
- if ( pMap == aVAsCharMap )
- return sizeof(aVAsCharMap) / aSizeOf;
- if ( pMap == aVParaMap )
- return sizeof(aVParaMap) / aSizeOf;
- if ( pMap == aHParaMap )
- return sizeof(aHParaMap) / aSizeOf;
- if ( pMap == aHFrameMap )
- return sizeof(aHFrameMap) / aSizeOf;
- // OD 19.09.2003 #i18732# - own vertical alignment map for to frame anchored objects
- if ( pMap == aVFrameMap )
- return sizeof(aVFrameMap) / aSizeOf;
- if ( pMap == aHCharMap )
- return sizeof(aHCharMap) / aSizeOf;
- if ( pMap == aHCharHtmlMap )
- return sizeof(aHCharHtmlMap) / aSizeOf;
- if ( pMap == aHCharHtmlAbsMap )
- return sizeof(aHCharHtmlAbsMap) / aSizeOf;
- if ( pMap == aVCharMap )
- return sizeof(aVCharMap) / aSizeOf;
- if ( pMap == aVCharHtmlMap )
- return sizeof(aVCharHtmlMap) / aSizeOf;
- if ( pMap == aVCharHtmlAbsMap )
- return sizeof(aVCharHtmlAbsMap) / aSizeOf;
- if ( pMap == aHPageHtmlMap )
- return sizeof(aHPageHtmlMap) / aSizeOf;
- if ( pMap == aHFlyHtmlMap )
- return sizeof(aHFlyHtmlMap) / aSizeOf;
- if ( pMap == aVFlyHtmlMap )
- return sizeof(aVFlyHtmlMap) / aSizeOf;
- if( pMap == aVMultiSelectionMap)
- return sizeof(aVMultiSelectionMap) / aSizeOf;
- if( pMap == aHMultiSelectionMap)
- return sizeof(aHMultiSelectionMap) / aSizeOf;
- return sizeof(aHPageMap) / aSizeOf;
- }
- return 0;
-}
-/*-- 03.03.2004 12:21:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(
- SvxSwFramePosString::StringId eStringId, BOOL bVertical, BOOL bRTL)
-{
- //special handling of STR_FROMLEFT
- if(SwFPos::FROMLEFT == eStringId)
- {
- eStringId = bVertical ?
- bRTL ? SwFPos::FROMBOTTOM : SwFPos::FROMTOP :
- bRTL ? SwFPos::FROMRIGHT : SwFPos::FROMLEFT;
- return eStringId;
- }
- if(bVertical)
- {
- //exchange horizontal strings with vertical strings and vice versa
- static const StringIdPair_Impl aHoriIds[] =
- {
- {SwFPos::LEFT, SwFPos::TOP},
- {SwFPos::RIGHT, SwFPos::BOTTOM},
- {SwFPos::CENTER_HORI, SwFPos::CENTER_VERT},
- {SwFPos::FROMTOP, SwFPos::FROMRIGHT},
- {SwFPos::REL_PG_LEFT, SwFPos::REL_PG_TOP},
- {SwFPos::REL_PG_RIGHT, SwFPos::REL_PG_BOTTOM} ,
- {SwFPos::REL_FRM_LEFT, SwFPos::REL_FRM_TOP},
- {SwFPos::REL_FRM_RIGHT, SwFPos::REL_FRM_BOTTOM}
- };
- static const StringIdPair_Impl aVertIds[] =
- {
- {SwFPos::TOP, SwFPos::RIGHT},
- {SwFPos::BOTTOM, SwFPos::LEFT },
- {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI},
- {SwFPos::FROMTOP, SwFPos::FROMRIGHT },
- {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT },
- {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } ,
- {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
- {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
- };
- USHORT nIndex;
- for(nIndex = 0; nIndex < sizeof(aHoriIds) / sizeof(StringIdPair_Impl); ++nIndex)
- {
- if(aHoriIds[nIndex].eHori == eStringId)
- {
- eStringId = aHoriIds[nIndex].eVert;
- return eStringId;
- }
- }
- nIndex = 0;
- for(nIndex = 0; nIndex < sizeof(aVertIds) / sizeof(StringIdPair_Impl); ++nIndex)
- {
- if(aVertIds[nIndex].eHori == eStringId)
- {
- eStringId = aVertIds[nIndex].eVert;
- break;
- }
- }
- }
- return eStringId;
-}
-// OD 12.11.2003 #i22341# - helper method in order to determine all possible
-// listbox relations in a relation map for a given relation
-ULONG lcl_GetLBRelationsForRelations( const USHORT _nRel )
-{
- ULONG nLBRelations = 0L;
-
- sal_uInt16 nRelMapSize = sizeof(aRelationMap) / sizeof(RelationMap);
- for ( sal_uInt16 nRelMapPos = 0; nRelMapPos < nRelMapSize; ++nRelMapPos )
- {
- if ( aRelationMap[nRelMapPos].nRelation == _nRel )
- {
- nLBRelations |= aRelationMap[nRelMapPos].nLBRelation;
- }
- }
-
- return nLBRelations;
-}
-
-// OD 14.11.2003 #i22341# - helper method on order to determine all possible
-// listbox relations in a relation map for a given string ID
-ULONG lcl_GetLBRelationsForStrID( const FrmMap* _pMap,
- const SvxSwFramePosString::StringId _eStrId,
- const bool _bUseMirrorStr )
-{
- ULONG nLBRelations = 0L;
-
- std::size_t nRelMapSize = lcl_GetFrmMapCount( _pMap );
- for ( std::size_t nRelMapPos = 0; nRelMapPos < nRelMapSize; ++nRelMapPos )
- {
- if ( ( !_bUseMirrorStr && _pMap[nRelMapPos].eStrId == _eStrId ) ||
- ( _bUseMirrorStr && _pMap[nRelMapPos].eMirrorStrId == _eStrId ) )
- {
- nLBRelations |= _pMap[nRelMapPos].nLBRelations;
- }
- }
-
- return nLBRelations;
-}
-/*-- 03.03.2004 12:21:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SvxSwPosSizeTabPage::SvxSwPosSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_SWPOSSIZE ), rInAttrs ),
-#ifdef _MSC_VER
-#pragma warning (disable : 4355)
-#endif
- m_aSizeFL( this, SVX_RES( FL_SIZE ) ),
- m_aWidthFT( this, SVX_RES( FT_WIDTH ) ),
- m_aWidthMF( this, SVX_RES( MF_WIDTH ) ),
- m_aHeightFT( this, SVX_RES( FT_HEIGHT ) ),
- m_aHeightMF( this, SVX_RES( MF_HEIGHT ) ),
- m_aKeepRatioCB(this,SVX_RES( CB_KEEPRATIO) ),
- m_aSeparatorFL(this,SVX_RES( FL_SEPARATOR) ),
-
- m_aAnchorFL( this, SVX_RES( FL_ANCHOR ) ),
- m_aToPageRB( this, SVX_RES( RB_TOPAGE ) ),
- m_aToParaRB( this, SVX_RES( RB_TOPARA ) ),
- m_aToCharRB( this, SVX_RES( RB_TOCHAR ) ),
- m_aAsCharRB( this, SVX_RES( RB_ASCHAR ) ),
- m_aToFrameRB( this, SVX_RES( RB_TOFRAME) ),
-
- m_aProtectionFL( this, SVX_RES( FL_PROTECTION ) ),
- m_aPositionCB( this, SVX_RES( CB_POSITION ) ),
- m_aSizeCB( this, SVX_RES( CB_SIZE ) ),
-
- m_aPositionFL( this, SVX_RES( FL_POSITION ) ),
- m_aHoriFT( this, SVX_RES( FT_HORI ) ),
- m_aHoriLB( this, SVX_RES( LB_HORI ) ),
- m_aHoriByFT( this, SVX_RES( FT_HORIBY ) ),
- m_aHoriByMF( this, SVX_RES( MF_HORIBY ) ),
- m_aHoriToFT( this, SVX_RES( FT_HORITO ) ),
- m_aHoriToLB( this, SVX_RES( LB_HORITO ) ),
-
- m_aHoriMirrorCB( this, SVX_RES( CB_HORIMIRROR ) ),
-
- m_aVertFT( this, SVX_RES( FT_VERT ) ),
- m_aVertLB( this, SVX_RES( LB_VERT ) ),
- m_aVertByFT( this, SVX_RES( FT_VERTBY ) ),
- m_aVertByMF( this, SVX_RES( MF_VERTBY ) ),
- m_aVertToFT( this, SVX_RES( FT_VERTTO ) ),
- m_aVertToLB( this, SVX_RES( LB_VERTTO ) ),
-
- m_aFollowCB( this, SVX_RES( CB_FOLLOW ) ),
- m_aExampleWN( this, SVX_RES( WN_EXAMPLE ) ),
-#ifdef _MSC_VER
-#pragma warning (default : 4355)
-#endif
- m_pVMap( 0 ),
- m_pHMap( 0 ),
- m_pSdrView( 0 ),
- m_nOldH(HoriOrientation::CENTER),
- m_nOldHRel(RelOrientation::FRAME),
- m_nOldV(VertOrientation::TOP),
- m_nOldVRel(RelOrientation::PRINT_AREA),
- m_fWidthHeightRatio(1.0),
- m_nHtmlMode(0),
- m_bHtmlMode(false),
- m_bAtHoriPosModified(false),
- m_bAtVertPosModified(false),
- m_bIsVerticalFrame(false),
- m_bPositioningDisabled(false),
- m_bIsMultiSelection(false),
- m_bIsInRightToLeft(false)
-{
- FreeResource();
- FieldUnit eDlgUnit = GetModuleFieldUnit( &rInAttrs );
- SetFieldUnit( m_aHoriByMF, eDlgUnit, TRUE );
- SetFieldUnit( m_aVertByMF, eDlgUnit, TRUE );
- SetFieldUnit( m_aWidthMF , eDlgUnit, TRUE );
- SetFieldUnit( m_aHeightMF, eDlgUnit, TRUE );
-
- SetExchangeSupport();
-
- Link aLk = LINK(this, SvxSwPosSizeTabPage, RangeModifyHdl);
- m_aWidthMF. SetLoseFocusHdl( aLk );
- m_aHeightMF. SetLoseFocusHdl( aLk );
- m_aHoriByMF.SetLoseFocusHdl( aLk );
- m_aVertByMF.SetLoseFocusHdl( aLk );
- m_aFollowCB.SetClickHdl( aLk );
-
- aLk = LINK(this, SvxSwPosSizeTabPage, ModifyHdl);
- m_aWidthMF. SetModifyHdl( aLk );
- m_aHeightMF. SetModifyHdl( aLk );
- m_aHoriByMF.SetModifyHdl( aLk );
- m_aVertByMF.SetModifyHdl( aLk );
-
- aLk = LINK(this, SvxSwPosSizeTabPage, AnchorTypeHdl);
- m_aToPageRB.SetClickHdl( aLk );
- m_aToParaRB.SetClickHdl( aLk );
- m_aToCharRB.SetClickHdl( aLk );
- m_aAsCharRB.SetClickHdl( aLk );
- m_aToFrameRB.SetClickHdl( aLk );
-
- m_aHoriLB.SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, PosHdl));
- m_aVertLB. SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, PosHdl));
-
- m_aHoriToLB.SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, RelHdl));
- m_aVertToLB.SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, RelHdl));
-
- m_aHoriMirrorCB.SetClickHdl(LINK(this, SvxSwPosSizeTabPage, MirrorHdl));
- m_aPositionCB.SetClickHdl(LINK(this, SvxSwPosSizeTabPage, ProtectHdl));
-}
-/*-- 03.03.2004 12:21:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage()
-{
-}
-/*-- 03.03.2004 12:21:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-SfxTabPage* SvxSwPosSizeTabPage::Create( Window* pParent, const SfxItemSet& rSet)
-{
- return new SvxSwPosSizeTabPage(pParent, rSet);
-}
-/*-- 05.03.2004 17:27:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT* SvxSwPosSizeTabPage::GetRanges()
-{
- static USHORT pSwPosRanges[] =
- {
- SID_ATTR_TRANSFORM_POS_X,
- SID_ATTR_TRANSFORM_POS_Y,
- SID_ATTR_TRANSFORM_PROTECT_POS,
- SID_ATTR_TRANSFORM_PROTECT_POS,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_ANCHOR,
- SID_ATTR_TRANSFORM_VERT_ORIENT,
- SID_ATTR_TRANSFORM_WIDTH,
- SID_ATTR_TRANSFORM_SIZE_POINT,
- SID_ATTR_TRANSFORM_PROTECT_POS,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_AUTOWIDTH,
- SID_ATTR_TRANSFORM_VERT_ORIENT,
- SID_HTML_MODE,
- SID_HTML_MODE,
- SID_SW_FOLLOW_TEXT_FLOW,
- SID_SW_FOLLOW_TEXT_FLOW,
- SID_ATTR_TRANSFORM_HORI_POSITION,
- SID_ATTR_TRANSFORM_VERT_POSITION,
- 0
- };
- return pSwPosRanges;
-}
-/*-- 03.03.2004 12:21:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-BOOL SvxSwPosSizeTabPage::FillItemSet( SfxItemSet& rSet)
-{
- bool bAnchorChanged = false;
- short nAnchor = GetAnchorType(&bAnchorChanged);
- BOOL bModified = FALSE;
- if(bAnchorChanged)
- {
- rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor));
- bModified |= TRUE;
- }
- if ( m_aPositionCB.GetState() != m_aPositionCB.GetSavedValue() )
- {
- if( m_aPositionCB.GetState() == STATE_DONTKNOW )
- rSet.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS );
- else
- rSet.Put(
- SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
- m_aPositionCB.GetState() == STATE_CHECK ? TRUE : FALSE ) );
- bModified |= TRUE;
- }
-
- if ( m_aSizeCB.GetState() != m_aSizeCB.GetSavedValue() )
- {
- if ( m_aSizeCB.GetState() == STATE_DONTKNOW )
- rSet.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE );
- else
- rSet.Put(
- SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
- m_aSizeCB.GetState() == STATE_CHECK ? TRUE : FALSE ) );
- bModified |= TRUE;
- }
-
- const SfxItemSet& rOldSet = GetItemSet();
-
- if(!m_bPositioningDisabled)
- {
- //on multiple selections the positioning is set via SdrView
- if(m_bIsMultiSelection)
- {
- if( m_aHoriByMF.IsValueModified() || m_aVertByMF.IsValueModified() )
- {
- long nHoriByPos =
- static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP)));
- long nVertByPos =
- static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP)));
-
- // Altes Rechteck mit CoreUnit
- m_aRect = m_pSdrView->GetAllMarkedRect();
- m_pSdrView->GetSdrPageView()->LogicToPagePos( m_aRect );
-
- nHoriByPos += m_aAnchorPos.X();
- nVertByPos += m_aAnchorPos.Y();
-
- rSet.Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_X ), nHoriByPos ) );
- rSet.Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_Y ), nVertByPos ) );
-
- bModified |= TRUE;
- }
- }
- else
- {
- if ( m_pHMap )
- {
- const SfxInt16Item& rHoriOrient =
- static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_ORIENT));
- const SfxInt16Item& rHoriRelation =
- static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_RELATION));
- const SfxInt32Item& rHoriPosition =
- static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_POSITION)) ;
-
- USHORT nMapPos = GetMapPos(m_pHMap, m_aHoriLB);
- short nAlign = GetAlignment(m_pHMap, nMapPos, m_aHoriLB, m_aHoriToLB);
- short nRel = GetRelation(m_pHMap, m_aHoriToLB);
- const long nHoriByPos =
- static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP)));
- if (
- nAlign != rHoriOrient.GetValue() ||
- nRel != rHoriRelation.GetValue() ||
- (m_aHoriByMF.IsEnabled() && nHoriByPos != rHoriPosition.GetValue())
- )
- {
- rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_ORIENT, nAlign));
- rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_RELATION, nRel));
- if(m_aHoriByMF.IsEnabled())
- rSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_HORI_POSITION, nHoriByPos));
- bModified |= TRUE;
- }
- }
- if(m_aHoriMirrorCB.IsEnabled() && m_aHoriMirrorCB.IsChecked() != m_aHoriMirrorCB.GetSavedValue())
- bModified |= 0 != rSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_HORI_MIRROR, m_aHoriMirrorCB.IsChecked()));
-
- if ( m_pVMap )
- {
- const SfxInt16Item& rVertOrient =
- static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_ORIENT));
- const SfxInt16Item& rVertRelation =
- static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_RELATION));
- const SfxInt32Item& rVertPosition =
- static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_POSITION));
-
- USHORT nMapPos = GetMapPos(m_pVMap, m_aVertLB);
- short nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB);
- short nRel = GetRelation(m_pVMap, m_aVertToLB);
- // --> OD 2004-10-21 #i34055# - convert vertical position for
- // as-character anchored objects
- long nVertByPos =
- static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP)));
- if ( GetAnchorType() == TextContentAnchorType_AS_CHARACTER )
- {
- nVertByPos *= -1;
- }
- // <--
- if ( nAlign != rVertOrient.GetValue() ||
- nRel != rVertRelation.GetValue() ||
- ( m_aVertByMF.IsEnabled() &&
- nVertByPos != rVertPosition.GetValue() ) )
- {
- rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_ORIENT, nAlign));
- rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_RELATION, nRel));
- if(m_aVertByMF.IsEnabled())
- rSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_VERT_POSITION, nVertByPos));
- bModified |= TRUE;
- }
- }
-
- // OD 19.09.2003 #i18732#
- if(m_aFollowCB.IsChecked() != m_aFollowCB.GetSavedValue())
- {
- //Writer internal type - based on SfxBoolItem
- const SfxPoolItem* pItem = GetItem( rOldSet, SID_SW_FOLLOW_TEXT_FLOW);
- if(pItem)
- {
- SfxBoolItem* pFollow = static_cast<SfxBoolItem*>(pItem->Clone());
- pFollow->SetValue(m_aFollowCB.IsChecked());
- bModified |= 0 != rSet.Put(*pFollow);
- delete pFollow;
- }
- }
- }
- }
- if ( m_aWidthMF.IsValueModified() || m_aHeightMF.IsValueModified() )
- {
- sal_uInt32 nWidth = static_cast<sal_uInt32>(m_aWidthMF.Denormalize(m_aWidthMF.GetValue(FUNIT_TWIP)));
- sal_uInt32 nHeight = static_cast<sal_uInt32>(m_aHeightMF.Denormalize(m_aHeightMF.GetValue(FUNIT_TWIP)));
- rSet.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ),
- (UINT32) nWidth ) );
- rSet.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ),
- (UINT32) nHeight ) );
- //this item is required by SdrEditView::SetGeoAttrToMarked()
- rSet.Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), RP_LT ) );
-
- bModified |= TRUE;
- }
-
- return bModified;
-}
-/*-- 03.03.2004 12:21:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxSwPosSizeTabPage::Reset( const SfxItemSet& rSet)
-{
- const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_TRANSFORM_ANCHOR );
- bool bInvalidateAnchor = false;
- short nAnchorType = TextContentAnchorType_AT_PARAGRAPH;
- if(pItem)
- {
- nAnchorType = static_cast<const SfxInt16Item*>(pItem)->GetValue();
- switch(nAnchorType)
- {
- case TextContentAnchorType_AT_PAGE: m_aToPageRB.Check(); break;
- case TextContentAnchorType_AT_PARAGRAPH: m_aToParaRB.Check(); break;
- case TextContentAnchorType_AT_CHARACTER: m_aToCharRB.Check(); break;
- case TextContentAnchorType_AS_CHARACTER: m_aAsCharRB.Check(); break;
- case TextContentAnchorType_AT_FRAME: m_aToFrameRB.Check(); break;
- default : bInvalidateAnchor = true;
- }
- m_aToPageRB.SaveValue();
- m_aToParaRB.SaveValue();
- m_aToCharRB.SaveValue();
- m_aAsCharRB.SaveValue();
- m_aToFrameRB.SaveValue();
- }
- if(bInvalidateAnchor)
- {
- m_aToPageRB.Enable( FALSE );
- m_aToParaRB.Enable( FALSE );
- m_aToCharRB.Enable( FALSE );
- m_aAsCharRB.Enable( FALSE );
- m_aToFrameRB.Enable( FALSE );
- }
-
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_PROTECT_POS );
- if ( pItem )
- {
- sal_Bool bProtected = ( ( const SfxBoolItem* )pItem )->GetValue();
- m_aPositionCB.SetState( bProtected ? STATE_CHECK : STATE_NOCHECK );
- m_aPositionCB.EnableTriState( FALSE );
- m_aSizeCB.Enable( !bProtected );
- }
- else
- {
- m_aPositionCB.SetState( STATE_DONTKNOW );
- }
-
- m_aPositionCB.SaveValue();
-
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_PROTECT_SIZE );
-
- if ( pItem )
- {
- m_aSizeCB.SetState( ( (const SfxBoolItem*)pItem )->GetValue()
- ? STATE_CHECK : STATE_NOCHECK );
- m_aSizeCB.EnableTriState( FALSE );
- }
- else
- m_aSizeCB.SetState( STATE_DONTKNOW );
- m_aSizeCB.SaveValue();
-
- pItem = GetItem( rSet, SID_HTML_MODE );
- if(pItem)
- m_nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
- m_bHtmlMode = 0 != (m_bHtmlMode & HTMLMODE_ON);
-
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT );
- if(pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue())
- {
- String sHLabel = m_aHoriFT.GetText();
- m_aHoriFT.SetText(m_aVertFT.GetText());
- m_aVertFT.SetText(sHLabel);
- m_bIsVerticalFrame = true;
- }
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_IN_RTL_TEXT);
- if(pItem)
- m_bIsInRightToLeft = static_cast<const SfxBoolItem*>(pItem)->GetValue();
-
- pItem = GetItem( rSet, SID_SW_FOLLOW_TEXT_FLOW);
- if(pItem)
- {
- const bool bFollowTextFlow =
- static_cast<const SfxBoolItem*>(pItem)->GetValue();
- m_aFollowCB.Check( bFollowTextFlow );
- }
- m_aFollowCB.SaveValue();
-
- if(m_bHtmlMode)
- {
- if( 0 == (m_nHtmlMode & HTMLMODE_FULL_ABS_POS))
- {
- m_aHeightFT .Enable( FALSE );
- m_aHeightMF .Enable( FALSE );
- }
- if( 0 == (m_nHtmlMode & HTMLMODE_SOME_ABS_POS))
- {
- if(GetAnchorType() == TextContentAnchorType_AT_PAGE)
- {
- m_aToParaRB.Check();
- }
- m_aToPageRB.Enable(FALSE);
- }
- m_aHoriMirrorCB.Show(FALSE);
- m_aKeepRatioCB.Enable(FALSE);
- // OD 19.09.2003 #i18732# - hide checkbox in HTML mode
- m_aFollowCB.Show(FALSE);
- }
- else
- {
- // OD 06.11.2003 #i18732# correct enable/disable of check box 'Mirror on..'
- m_aHoriMirrorCB.Enable(!m_aAsCharRB.IsChecked() && !m_bIsMultiSelection);
-
- // OD 06.11.2003 #i18732# - enable/disable check box 'Follow text flow'.
- m_aFollowCB.Enable( m_aToParaRB.IsChecked() ||
- m_aToCharRB.IsChecked() );
- }
-
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_WIDTH );
- sal_Int32 nWidth = Max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (UINT32)1 );
-
- m_aWidthMF.SetValue(m_aWidthMF.Normalize(nWidth), FUNIT_TWIP);
-
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HEIGHT );
- sal_Int32 nHeight = Max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (UINT32)1 );
- m_aHeightMF.SetValue(m_aHeightMF.Normalize(nHeight), FUNIT_TWIP);
- m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
-
- if(!m_bPositioningDisabled)
- {
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_ORIENT);
- if(pItem)
- {
- short nHoriOrientation = static_cast< const SfxInt16Item*>(pItem)->GetValue();
- m_nOldH = nHoriOrientation;
- }
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_VERT_ORIENT);
- if(pItem)
- {
- short nVertOrientation = static_cast< const SfxInt16Item*>(pItem)->GetValue();
- m_nOldV = nVertOrientation;
- }
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_RELATION);
- if(pItem)
- {
- m_nOldHRel = static_cast< const SfxInt16Item*>(pItem)->GetValue();
- }
-
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_VERT_RELATION);
- if(pItem)
- {
- m_nOldVRel = static_cast< const SfxInt16Item*>(pItem)->GetValue();
- }
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_MIRROR);
- if(pItem)
- m_aHoriMirrorCB.Check(static_cast<const SfxBoolItem*>(pItem)->GetValue());
- m_aHoriMirrorCB.SaveValue();
-
- sal_Int32 nHoriPos = 0;
- sal_Int32 nVertPos = 0;
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_POSITION);
- if(pItem)
- nHoriPos = static_cast<const SfxInt32Item*>(pItem)->GetValue();
- pItem = GetItem( rSet, SID_ATTR_TRANSFORM_VERT_POSITION);
- if(pItem)
- nVertPos = static_cast<const SfxInt32Item*>(pItem)->GetValue();
-
- InitPos(nAnchorType, m_nOldH, m_nOldHRel, m_nOldV, m_nOldVRel, nHoriPos, nVertPos);
-
- m_aVertByMF.SaveValue();
- m_aHoriByMF.SaveValue();
- // OD 19.09.2003 #i18732#
- m_aFollowCB.SaveValue();
-
- RangeModifyHdl(&m_aWidthMF); // initially set maximum values
- }
-}
-/*-- 03.03.2004 12:21:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-int SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( _pSet )
- FillItemSet( *_pSet );
- return( LEAVE_PAGE );
-}
-/*-- 04.03.2004 09:14:41---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxSwPosSizeTabPage::EnableAnchorTypes(USHORT nAnchorEnable)
-{
- if((nAnchorEnable & SVX_OBJ_AT_FLY))
- m_aToFrameRB.Show();
- if(!(nAnchorEnable & SVX_OBJ_PAGE))
- m_aToPageRB.Enable(FALSE);
-}
-/*-- 04.03.2004 09:33:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-short SvxSwPosSizeTabPage::GetAnchorType(bool* pbHasChanged)
-{
- short nRet = -1;
- RadioButton* pCheckedButton = 0;
- if(m_aToParaRB.IsEnabled())
- {
- if(m_aToPageRB.IsChecked())
- {
- nRet = TextContentAnchorType_AT_PAGE;
- pCheckedButton = &m_aToPageRB;
- }
- else if(m_aToParaRB.IsChecked())
- {
- nRet = TextContentAnchorType_AT_PARAGRAPH;
- pCheckedButton = &m_aToParaRB;
- }
- else if(m_aToCharRB.IsChecked())
- {
- nRet = TextContentAnchorType_AT_CHARACTER;
- pCheckedButton = &m_aToCharRB;
- }
- else if(m_aAsCharRB.IsChecked())
- {
- nRet = TextContentAnchorType_AS_CHARACTER;
- pCheckedButton = &m_aAsCharRB;
- }
- else if(m_aToFrameRB.IsChecked())
- {
- nRet = TextContentAnchorType_AT_FRAME;
- pCheckedButton = &m_aToFrameRB;
- }
- }
- if(pbHasChanged)
- {
- if(pCheckedButton)
- *pbHasChanged = pCheckedButton->IsChecked() != pCheckedButton->GetSavedValue();
- else
- *pbHasChanged = false;
- }
- return nRet;
-}
-/*-- 05.03.2004 10:43:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, RangeModifyHdl, Edit *, EMPTYARG )
-{
- if(m_bPositioningDisabled)
- return 0;
- SvxSwFrameValidation aVal;
-
- aVal.nAnchorType = GetAnchorType();
- aVal.bAutoHeight = false;
- aVal.bAutoWidth = false;
- aVal.bMirror = m_aHoriMirrorCB.IsChecked();
- // OD 18.09.2003 #i18732#
- aVal.bFollowTextFlow = m_aFollowCB.IsChecked();
-
- if ( m_pHMap )
- {
- // Ausrichtung Horizontal
- USHORT nMapPos = GetMapPos(m_pHMap, m_aHoriToLB);
- USHORT nAlign = GetAlignment(m_pHMap, nMapPos, m_aHoriLB, m_aHoriToLB);
- USHORT nRel = GetRelation(m_pHMap, m_aHoriToLB);
-
- aVal.nHoriOrient = (short)nAlign;
- aVal.nHRelOrient = (short)nRel;
- }
- else
- aVal.nHoriOrient = HoriOrientation::NONE;
-
- if ( m_pVMap )
- {
- // Ausrichtung Vertikal
- USHORT nMapPos = GetMapPos(m_pVMap, m_aVertLB);
- USHORT nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB);
- USHORT nRel = GetRelation(m_pVMap, m_aVertToLB);
-
- aVal.nVertOrient = (short)nAlign;
- aVal.nVRelOrient = (short)nRel;
- }
- else
- aVal.nVertOrient = VertOrientation::NONE;
-
- const long nAtHorzPosVal =
- static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP)));
- const long nAtVertPosVal =
- static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP)));
-
- aVal.nHPos = nAtHorzPosVal;
- aVal.nVPos = nAtVertPosVal;
-
- sal_Int32 nWidth = static_cast<sal_uInt32>(m_aWidthMF. Denormalize(m_aWidthMF.GetValue(FUNIT_TWIP)));
- sal_Int32 nHeight = static_cast<sal_uInt32>(m_aHeightMF.Denormalize(m_aHeightMF.GetValue(FUNIT_TWIP)));
- aVal.nWidth = nWidth;
- aVal.nHeight = nHeight;
-
- if(m_aValidateLink.IsSet())
- m_aValidateLink.Call(&aVal);
-
- nWidth = aVal.nWidth;
- nHeight = aVal.nHeight;
-
- // Mindestbreite auch fuer Vorlage
- m_aHeightMF.SetMin(m_aHeightMF.Normalize(aVal.nMinHeight), FUNIT_TWIP);
- m_aWidthMF. SetMin(m_aWidthMF.Normalize(aVal.nMinWidth), FUNIT_TWIP);
-
- sal_Int32 nMaxWidth(aVal.nMaxWidth);
- sal_Int32 nMaxHeight(aVal.nMaxHeight);
-
- sal_Int64 nTmp = m_aHeightMF.Normalize(nMaxHeight);
- m_aHeightMF.SetMax(nTmp, FUNIT_TWIP);
-
- nTmp = m_aWidthMF.Normalize(nMaxWidth);
- m_aWidthMF.SetMax(nTmp, FUNIT_TWIP);
-
- m_aHoriByMF.SetMin(m_aHoriByMF.Normalize(aVal.nMinHPos), FUNIT_TWIP);
- m_aHoriByMF.SetMax(m_aHoriByMF.Normalize(aVal.nMaxHPos), FUNIT_TWIP);
- if ( aVal.nHPos != nAtHorzPosVal )
- m_aHoriByMF.SetValue(m_aHoriByMF.Normalize(aVal.nHPos), FUNIT_TWIP);
-
- m_aVertByMF.SetMin(m_aVertByMF.Normalize(aVal.nMinVPos ), FUNIT_TWIP);
- m_aVertByMF.SetMax(m_aVertByMF.Normalize(aVal.nMaxVPos), FUNIT_TWIP);
- if ( aVal.nVPos != nAtVertPosVal )
- m_aVertByMF.SetValue(m_aVertByMF.Normalize(aVal.nVPos), FUNIT_TWIP);
-
- return 0;
-}
-/*-- 05.03.2004 11:12:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, AnchorTypeHdl, RadioButton *, EMPTYARG )
-{
- m_aHoriMirrorCB.Enable(!m_aAsCharRB.IsChecked() && !m_bIsMultiSelection);
-
- // OD 06.11.2003 #i18732# - enable check box 'Follow text flow' for anchor
- // type to-paragraph' and to-character
- m_aFollowCB.Enable( m_aToParaRB.IsChecked() || m_aToCharRB.IsChecked() );
-
- short nId = GetAnchorType();
-
- InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
- RangeModifyHdl(0);
-
- if(m_bHtmlMode)
- {
- PosHdl(&m_aHoriLB);
- PosHdl(&m_aVertLB);
- }
- return 0;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, MirrorHdl, CheckBox *, EMPTYARG )
-{
- short nId = GetAnchorType();
- InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
-
- return 0;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB )
-{
- BOOL bHori = pLB == &m_aHoriToLB;
-
- UpdateExample();
-
- if (bHori)
- m_bAtHoriPosModified = TRUE;
- else
- m_bAtVertPosModified = TRUE;
-
- // OD 12.11.2003 #i22341# - following special handling no longer needed
- /*
- if (!bHori && m_pVMap == aVCharMap)
- {
- // Ausrichtung Vertikal
- String sEntry;
- USHORT nMapPos = GetMapPos(m_pVMap, m_aVertLB);
- USHORT nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB);
- USHORT nRel = GetRelation(m_pVMap, m_aVertToLB);
-
- if (nRel == SwFPos::REL_CHAR)
- sEntry = m_aFramePosString.GetString(SwFPos::FROMBOTTOM);
- else
- sEntry = m_aFramePosString.GetString(SwFPos::FROMTOP);
-
- USHORT nOldPos = m_aVertLB.GetSelectEntryPos();
-
- String sName = m_aVertLB.GetEntry(m_aVertLB.GetEntryCount() - 1);
- if (sName != sEntry)
- {
- m_aVertLB.RemoveEntry(m_aVertLB.GetEntryCount() - 1);
- m_aVertLB.InsertEntry(sEntry);
- m_aVertLB.SelectEntryPos(nOldPos);
- }
- }
- */
- if(m_bHtmlMode && TextContentAnchorType_AT_CHARACTER == GetAnchorType()) // wieder Sonderbehandlung
- {
- if(bHori)
- {
- USHORT nRel = GetRelation(m_pHMap, m_aHoriToLB);
- if(RelOrientation::PRINT_AREA == nRel && 0 == m_aVertLB.GetSelectEntryPos())
- {
- m_aVertLB.SelectEntryPos(1);
- }
- else if(RelOrientation::CHAR == nRel && 1 == m_aVertLB.GetSelectEntryPos())
- {
- m_aVertLB.SelectEntryPos(0);
- }
- }
- }
- if (pLB) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde
- RangeModifyHdl(0);
-
- return 0;
-
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB )
-{
- BOOL bHori = pLB == &m_aHoriLB;
- ListBox *pRelLB = bHori ? &m_aHoriToLB : &m_aVertToLB;
- FixedText *pRelFT = bHori ? &m_aHoriToFT : &m_aVertToFT;
- FrmMap *pMap = bHori ? m_pHMap : m_pVMap;
-
-
- USHORT nMapPos = GetMapPos(pMap, *pLB);
- USHORT nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB);
-
- if (bHori)
- {
- BOOL bEnable = HoriOrientation::NONE == nAlign;
- m_aHoriByMF.Enable( bEnable );
- m_aHoriByFT.Enable( bEnable );
- }
- else
- {
- BOOL bEnable = VertOrientation::NONE == nAlign;
- m_aVertByMF.Enable( bEnable );
- m_aVertByFT.Enable( bEnable );
- }
-
- if (pLB) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde
- RangeModifyHdl( 0 );
-
- short nRel = 0;
- if (pLB->GetSelectEntryCount())
- {
-
- if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
- nRel = ((RelationMap *)pRelLB->GetEntryData(pRelLB->GetSelectEntryPos()))->nRelation;
-
- FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT);
- }
- else
- pRelLB->Clear();
-
- UpdateExample();
-
- if (bHori)
- m_bAtHoriPosModified = TRUE;
- else
- m_bAtVertPosModified = TRUE;
-
- // Sonderbehandlung fuer HTML-Mode mit horz-vert-Abhaengigkeiten
- if(m_bHtmlMode && m_nHtmlMode & HTMLMODE_SOME_ABS_POS &&
- TextContentAnchorType_AT_CHARACTER == GetAnchorType())
- {
- BOOL bSet = FALSE;
- if(bHori)
- {
- // rechts ist nur unterhalb erlaubt - von links nur oben
- // von links am Zeichen -> unterhalb
- if((HoriOrientation::LEFT == nAlign || HoriOrientation::RIGHT == nAlign) &&
- 0 == m_aVertLB.GetSelectEntryPos())
- {
- if(RelOrientation::FRAME == nRel)
- m_aVertLB.SelectEntryPos(1);
- else
- m_aVertLB.SelectEntryPos(0);
- bSet = TRUE;
- }
- else if(HoriOrientation::LEFT == nAlign && 1 == m_aVertLB.GetSelectEntryPos())
- {
- m_aVertLB.SelectEntryPos(0);
- bSet = TRUE;
- }
- else if(HoriOrientation::NONE == nAlign && 1 == m_aVertLB.GetSelectEntryPos())
- {
- m_aVertLB.SelectEntryPos(0);
- bSet = TRUE;
- }
- if(bSet)
- PosHdl(&m_aVertLB);
- }
- else
- {
- if(VertOrientation::TOP == nAlign)
- {
- if(1 == m_aHoriLB.GetSelectEntryPos())
- {
- m_aHoriLB.SelectEntryPos(0);
- bSet = TRUE;
- }
- m_aHoriToLB.SelectEntryPos(1);
- }
- else if(VertOrientation::CHAR_BOTTOM == nAlign)
- {
- if(2 == m_aHoriLB.GetSelectEntryPos())
- {
- m_aHoriLB.SelectEntryPos(0);
- bSet = TRUE;
- }
- m_aHoriToLB.SelectEntryPos(0) ;
- }
- if(bSet)
- PosHdl(&m_aHoriLB);
- }
-
- }
- return 0;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit *, pEdit )
-{
- sal_Int64 nWidth = m_aWidthMF.Denormalize(m_aWidthMF.GetValue(FUNIT_TWIP));
- sal_Int64 nHeight = m_aHeightMF.Denormalize(m_aHeightMF.GetValue(FUNIT_TWIP));
- if ( m_aKeepRatioCB.IsChecked() )
- {
- if ( pEdit == &m_aWidthMF )
- {
- nHeight = sal_Int64((double)nWidth / m_fWidthHeightRatio);
- m_aHeightMF.SetValue(m_aHeightMF.Normalize(nHeight), FUNIT_TWIP);
- }
- else if(pEdit == &m_aHeightMF)
- {
- nWidth = sal_Int64((double)nHeight * m_fWidthHeightRatio);
- m_aWidthMF.SetValue(m_aWidthMF.Normalize(nWidth), FUNIT_TWIP);
- }
- }
- m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0;
- UpdateExample();
- return 0;
-}
-/*-- 11.03.2004 15:40:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-IMPL_LINK( SvxSwPosSizeTabPage, ProtectHdl, TriStateBox *, EMPTYARG)
-{
- m_aSizeCB.Enable(m_aPositionCB.IsEnabled() && !m_aPositionCB.IsChecked());
- return 0;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-short SvxSwPosSizeTabPage::GetRelation(FrmMap *, ListBox &rRelationLB)
-{
- short nRel = 0;
- USHORT nPos = rRelationLB.GetSelectEntryPos();
-
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- RelationMap *pEntry = (RelationMap *)rRelationLB.GetEntryData(nPos);
- nRel = pEntry->nRelation;
- }
-
- return nRel;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-short SvxSwPosSizeTabPage::GetAlignment(FrmMap *pMap, USHORT nMapPos, ListBox &/*rAlignLB*/, ListBox &rRelationLB)
-{
- short nAlign = 0;
-
- // OD 14.11.2003 #i22341# - special handling also for map <aVCharMap>,
- // because it contains ambigous items for alignment
- if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap ||
- pMap == aVCharMap )
- {
- if (rRelationLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
- {
- ULONG nRel = ((RelationMap *)rRelationLB.GetEntryData(rRelationLB.GetSelectEntryPos()))->nLBRelation;
- std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap);
- SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
-
- for (std::size_t i = 0; i < nMapCount; i++)
- {
- if (pMap[i].eStrId == eStrId)
- {
- ULONG nLBRelations = pMap[i].nLBRelations;
- if (nLBRelations & nRel)
- {
- nAlign = pMap[i].nAlign;
- break;
- }
- }
- }
- }
- }
- else if (pMap)
- nAlign = pMap[nMapPos].nAlign;
-
- return nAlign;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT SvxSwPosSizeTabPage::GetMapPos(FrmMap *pMap, ListBox &rAlignLB)
-{
- USHORT nMapPos = 0;
- USHORT nLBSelPos = rAlignLB.GetSelectEntryPos();
-
- if (nLBSelPos != LISTBOX_ENTRY_NOTFOUND)
- {
- if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
- {
- std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap);
- String sSelEntry(rAlignLB.GetSelectEntry());
-
- for (std::size_t i = 0; i < nMapCount; i++)
- {
- SvxSwFramePosString::StringId eResId = pMap[i].eStrId;
-
- String sEntry = m_aFramePosString.GetString(eResId);
-
- if (sEntry == sSelEntry)
- {
- nMapPos = sal::static_int_cast< USHORT >(i);
- break;
- }
- }
- }
- else
- nMapPos = nLBSelPos;
- }
-
- return nMapPos;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxSwPosSizeTabPage::InitPos(short nAnchor,
- USHORT nH,
- USHORT nHRel,
- USHORT nV,
- USHORT nVRel,
- long nX,
- long nY)
-{
- USHORT nPos = m_aVertLB.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND && m_pVMap )
- {
- m_nOldV = m_pVMap[nPos].nAlign;
- nPos = m_aVertToLB.GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- m_nOldVRel = ((RelationMap *)m_aVertToLB.GetEntryData(nPos))->nRelation;
- }
-
- nPos = m_aHoriLB.GetSelectEntryPos();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND && m_pHMap )
- {
- m_nOldH = m_pHMap[nPos].nAlign;
-
- nPos = m_aHoriToLB.GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- m_nOldHRel = ((RelationMap *)m_aHoriToLB.GetEntryData(nPos))->nRelation;
- }
-
- BOOL bEnable = TRUE;
- if( m_bIsMultiSelection )
- {
- m_pVMap = aVMultiSelectionMap;
- m_pHMap = aHMultiSelectionMap;
- }
- else if( nAnchor == TextContentAnchorType_AT_PAGE )
- {
- m_pVMap = m_bHtmlMode ? aVPageHtmlMap : aVPageMap;
- m_pHMap = m_bHtmlMode ? aHPageHtmlMap : aHPageMap;
- }
- else if ( nAnchor == TextContentAnchorType_AT_FRAME )
- {
- // OD 19.09.2003 #i18732# - own vertical alignment map for to frame
- // anchored objects.
- m_pVMap = m_bHtmlMode ? aVFlyHtmlMap : aVFrameMap;
- m_pHMap = m_bHtmlMode ? aHFlyHtmlMap : aHFrameMap;
- }
- else if ( nAnchor == TextContentAnchorType_AT_PARAGRAPH )
- {
- if(m_bHtmlMode)
- {
- m_pVMap = aVParaHtmlMap;
- m_pHMap = m_nHtmlMode & HTMLMODE_SOME_ABS_POS ? aHParaHtmlAbsMap : aHParaHtmlMap;
- }
- else
- {
- m_pVMap = aVParaMap;
- m_pHMap = aHParaMap;
- }
- }
- else if ( nAnchor == TextContentAnchorType_AT_CHARACTER )
- {
- if(m_bHtmlMode)
- {
- m_pVMap = m_nHtmlMode & HTMLMODE_SOME_ABS_POS ? aVCharHtmlAbsMap : aVCharHtmlMap;
- m_pHMap = m_nHtmlMode & HTMLMODE_SOME_ABS_POS ? aHCharHtmlAbsMap : aHCharHtmlMap;
- }
- else
- {
- m_pVMap = aVCharMap;
- m_pHMap = aHCharMap;
- }
- }
- else if ( nAnchor == TextContentAnchorType_AS_CHARACTER )
- {
- m_pVMap = m_bHtmlMode ? aVAsCharHtmlMap : aVAsCharMap;
- m_pHMap = 0;
- bEnable = FALSE;
- }
- m_aHoriLB.Enable( bEnable );
- m_aHoriFT.Enable( bEnable );
-
- // aktuelle Pos selektieren
- // Horizontal
- if ( nH == USHRT_MAX )
- {
- nH = m_nOldH;
- nHRel = m_nOldHRel;
- }
- // OD 12.11.2003 #i22341# - pass <nHRel> as 3rd parameter to method <FillPosLB>
- USHORT nMapPos = FillPosLB(m_pHMap, nH, nHRel, m_aHoriLB);
- FillRelLB(m_pHMap, nMapPos, nH, nHRel, m_aHoriToLB, m_aHoriToFT);
-
- // Vertikal
- if ( nV == USHRT_MAX )
- {
- nV = m_nOldV;
- nVRel = m_nOldVRel;
- }
- // OD 12.11.2003 #i22341# - pass <nVRel> as 3rd parameter to method <FillPosLB>
- nMapPos = FillPosLB(m_pVMap, nV, nVRel, m_aVertLB);
- FillRelLB(m_pVMap, nMapPos, nV, nVRel, m_aVertToLB, m_aVertToFT);
-
- // Edits init
- bEnable = nH == HoriOrientation::NONE &&
- nAnchor != TextContentAnchorType_AS_CHARACTER;//#61359# warum nicht in Formaten&& !bFormat;
- if (!bEnable)
- {
- m_aHoriByMF.SetValue( 0, FUNIT_TWIP );
- if (nX != LONG_MAX && m_bHtmlMode)
- m_aHoriByMF.SetModifyFlag();
- }
- else if(m_bIsMultiSelection)
- {
- m_aHoriByMF.SetValue( m_aHoriByMF.Normalize(m_aRect.Left()), FUNIT_TWIP );
- }
- else
- {
- if (nX != LONG_MAX)
- m_aHoriByMF.SetValue( m_aHoriByMF.Normalize(nX), FUNIT_TWIP );
- }
- m_aHoriByFT.Enable( bEnable );
- m_aHoriByMF.Enable( bEnable );
-
- bEnable = nV == VertOrientation::NONE;
- if ( !bEnable )
- {
- m_aVertByMF.SetValue( 0, FUNIT_TWIP );
- if(nY != LONG_MAX && m_bHtmlMode)
- m_aVertByMF.SetModifyFlag();
- }
- else if(m_bIsMultiSelection)
- {
- m_aVertByMF.SetValue( m_aVertByMF.Normalize(m_aRect.Top()), FUNIT_TWIP );
- }
- else
- {
- if ( nAnchor == TextContentAnchorType_AS_CHARACTER )
- {
- if ( nY == LONG_MAX )
- nY = 0;
- else
- nY *= -1;
- }
- if ( nY != LONG_MAX )
- m_aVertByMF.SetValue( m_aVertByMF.Normalize(nY), FUNIT_TWIP );
- }
- m_aVertByFT.Enable( bEnable );
- m_aVertByMF.Enable( bEnable );
- UpdateExample();
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxSwPosSizeTabPage::UpdateExample()
-{
- USHORT nPos = m_aHoriLB.GetSelectEntryPos();
- if ( m_pHMap && nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- USHORT nMapPos = GetMapPos(m_pHMap, m_aHoriLB);
- short nAlign = GetAlignment(m_pHMap, nMapPos, m_aHoriLB, m_aHoriToLB);
- short nRel = GetRelation(m_pHMap, m_aHoriToLB);
-
- m_aExampleWN.SetHAlign(nAlign);
- m_aExampleWN.SetHoriRel(nRel);
- }
-
- nPos = m_aVertLB.GetSelectEntryPos();
- if ( m_pVMap && nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- USHORT nMapPos = GetMapPos(m_pVMap, m_aVertLB);
- USHORT nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB);
- USHORT nRel = GetRelation(m_pVMap, m_aVertToLB);
-
- m_aExampleWN.SetVAlign(nAlign);
- m_aExampleWN.SetVertRel(nRel);
- }
-
- // Size
- long nXPos = static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP)));
- long nYPos = static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP)));
- m_aExampleWN.SetRelPos(Point(nXPos, nYPos));
-
- m_aExampleWN.SetAnchor( GetAnchorType() );
- m_aExampleWN.Invalidate();
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-ULONG SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, USHORT nMapPos, USHORT nAlign,
- USHORT nRel, ListBox &rLB, FixedText &rFT)
-{
- String sSelEntry;
- ULONG nLBRelations = 0;
- std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap);
-
- rLB.Clear();
-
- if (nMapPos < nMapCount)
- {
- if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap)
- {
- String sOldEntry(rLB.GetSelectEntry());
- USHORT nRelCount = sizeof(aAsCharRelationMap) / sizeof(RelationMap);
- SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
-
- for (std::size_t _nMapPos = 0; _nMapPos < nMapCount; _nMapPos++)
- {
- if (pMap[_nMapPos].eStrId == eStrId)
- {
- nLBRelations = pMap[_nMapPos].nLBRelations;
- for (USHORT nRelPos = 0; nRelPos < nRelCount; nRelPos++)
- {
- if (nLBRelations & aAsCharRelationMap[nRelPos].nLBRelation)
- {
- SvxSwFramePosString::StringId sStrId1 = aAsCharRelationMap[nRelPos].eStrId;
-
- sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, m_bIsVerticalFrame, m_bIsInRightToLeft);
- String sEntry = m_aFramePosString.GetString(sStrId1);
- USHORT nPos = rLB.InsertEntry(sEntry);
- rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]);
- if (pMap[_nMapPos].nAlign == nAlign)
- sSelEntry = sEntry;
- break;
- }
- }
- }
- }
- if (sSelEntry.Len())
- rLB.SelectEntry(sSelEntry);
- else
- {
- rLB.SelectEntry(sOldEntry);
-
- if (!rLB.GetSelectEntryCount())
- {
- for (USHORT i = 0; i < rLB.GetEntryCount(); i++)
- {
- RelationMap *pEntry = (RelationMap *)rLB.GetEntryData(i);
- if (pEntry->nLBRelation == LB_REL_CHAR) // Default
- {
- rLB.SelectEntryPos(i);
- break;
- }
- }
- }
- }
- }
- else
- {
- USHORT nRelCount = sizeof(aRelationMap) / sizeof(RelationMap);
-
- // OD 14.11.2003 #i22341# - special handling for map <aVCharMap>,
- // because its ambigous in its <eStrId>/<eMirrorStrId>.
- if ( pMap == aVCharMap )
- {
- nLBRelations = ::lcl_GetLBRelationsForStrID( pMap,
- ( m_aHoriMirrorCB.IsChecked()
- ? pMap[nMapPos].eMirrorStrId
- : pMap[nMapPos].eStrId ),
- m_aHoriMirrorCB.IsChecked() );
- }
- else
- {
- nLBRelations = pMap[nMapPos].nLBRelations;
- }
-
- for (ULONG nBit = 1; nBit < 0x80000000; nBit <<= 1)
- {
- if (nLBRelations & nBit)
- {
- for (USHORT nRelPos = 0; nRelPos < nRelCount; nRelPos++)
- {
- if (aRelationMap[nRelPos].nLBRelation == nBit)
- {
- SvxSwFramePosString::StringId sStrId1 = m_aHoriMirrorCB.IsChecked() ? aRelationMap[nRelPos].eMirrorStrId : aRelationMap[nRelPos].eStrId;
- sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, m_bIsVerticalFrame, m_bIsInRightToLeft);
- String sEntry = m_aFramePosString.GetString(sStrId1);
- USHORT nPos = rLB.InsertEntry(sEntry);
- rLB.SetEntryData(nPos, &aRelationMap[nRelPos]);
- if (!sSelEntry.Len() && aRelationMap[nRelPos].nRelation == nRel)
- sSelEntry = sEntry;
- }
- }
- }
- }
- if (sSelEntry.Len())
- rLB.SelectEntry(sSelEntry);
- else
- {
- // Warscheinlich Ankerwechsel. Daher aehnliche Relation suchen
- switch (nRel)
- {
- case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break;
- case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break;
- case RelOrientation::PAGE_LEFT: nRel = RelOrientation::FRAME_LEFT; break;
- case RelOrientation::PAGE_RIGHT: nRel = RelOrientation::FRAME_RIGHT; break;
- case RelOrientation::FRAME_LEFT: nRel = RelOrientation::PAGE_LEFT; break;
- case RelOrientation::FRAME_RIGHT: nRel = RelOrientation::PAGE_RIGHT; break;
- case RelOrientation::PAGE_FRAME: nRel = RelOrientation::FRAME; break;
- case RelOrientation::PAGE_PRINT_AREA: nRel = RelOrientation::PRINT_AREA; break;
-
- default:
- if (rLB.GetEntryCount())
- {
- RelationMap *pEntry = (RelationMap *)rLB.GetEntryData(rLB.GetEntryCount() - 1);
- nRel = pEntry->nRelation;
- }
- break;
- }
-
- for (USHORT i = 0; i < rLB.GetEntryCount(); i++)
- {
- RelationMap *pEntry = (RelationMap *)rLB.GetEntryData(i);
- if (pEntry->nRelation == nRel)
- {
- rLB.SelectEntryPos(i);
- break;
- }
- }
-
- if (!rLB.GetSelectEntryCount())
- rLB.SelectEntryPos(0);
- }
- }
- }
-
- rLB.Enable(rLB.GetEntryCount() != 0);
- rFT.Enable(rLB.GetEntryCount() != 0);
-
- RelHdl(&rLB);
-
- return nLBRelations;
-}
-/*-- 05.03.2004 14:20:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-USHORT SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap,
- USHORT _nAlign,
- const USHORT _nRel,
- ListBox &_rLB)
-{
- String sSelEntry, sOldEntry;
- sOldEntry = _rLB.GetSelectEntry();
-
- _rLB.Clear();
-
- // OD 12.11.2003 #i22341# - determine all possible listbox relations for
- // given relation for map <aVCharMap>
- const ULONG nLBRelations = (_pMap != aVCharMap)
- ? 0L
- : ::lcl_GetLBRelationsForRelations( _nRel );
-
- // Listbox fuellen
- std::size_t nCount = ::lcl_GetFrmMapCount(_pMap);
- for (std::size_t i = 0; _pMap && i < nCount; ++i)
- {
-// #61359# Warum nicht von links/von innen bzw. von oben?
-// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP))
- {
- SvxSwFramePosString::StringId eStrId = m_aHoriMirrorCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
- eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, m_bIsVerticalFrame, m_bIsInRightToLeft);
- String sEntry(m_aFramePosString.GetString(eStrId));
- if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
- {
- // bei zeichengebundenen Rahmen keine doppelten Eintraege einfuegen
- _rLB.InsertEntry(sEntry);
- }
- // OD 12.11.2003 #i22341# - add condition to handle map <aVCharMap>
- // that is ambigous in the alignment.
- if ( _pMap[i].nAlign == _nAlign &&
- ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
- {
- sSelEntry = sEntry;
- }
- }
- }
-
- _rLB.SelectEntry(sSelEntry);
- if (!_rLB.GetSelectEntryCount())
- _rLB.SelectEntry(sOldEntry);
-
- if (!_rLB.GetSelectEntryCount())
- _rLB.SelectEntryPos(0);
-
- PosHdl(&_rLB);
-
- return GetMapPos(_pMap, _rLB);
-}
-/*-- 09.03.2004 15:37:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
-{
- m_pSdrView = pSdrView;
- if(!m_pSdrView)
- {
- DBG_ERROR("No SdrView* set");
- return;
- }
-
- // Setzen des Rechtecks und der Workingarea
- m_aRect = m_pSdrView->GetAllMarkedRect();
- m_pSdrView->GetSdrPageView()->LogicToPagePos( m_aRect );
-
- // get WorkArea
- m_aWorkArea = m_pSdrView->GetWorkArea();
-
- // Beruecksichtigung Ankerposition (bei Writer)
- const SdrMarkList& rMarkList = m_pSdrView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() >= 1 )
- {
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- m_aAnchorPos = pObj->GetAnchorPos();
-
- if( m_aAnchorPos != Point(0,0) ) // -> Writer
- {
- for( USHORT i = 1; i < rMarkList.GetMarkCount(); i++ )
- {
- pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( m_aAnchorPos != pObj->GetAnchorPos() )
- {
- // different anchor positions -> disable positioning
- m_aPositionFL.Enable(FALSE);
- m_aHoriFT.Enable(FALSE);
- m_aHoriLB.Enable(FALSE);
- m_aHoriByFT.Enable(FALSE);
- m_aHoriByMF.Enable(FALSE);
- m_aHoriToFT.Enable(FALSE);
- m_aHoriToLB.Enable(FALSE);
- m_aHoriMirrorCB.Enable(FALSE);
- m_aVertFT.Enable(FALSE);
- m_aVertLB.Enable(FALSE);
- m_aVertByFT.Enable(FALSE);
- m_aVertByMF.Enable(FALSE);
- m_aVertToFT.Enable(FALSE);
- m_aVertToLB.Enable(FALSE);
- m_aFollowCB.Enable(FALSE);
- m_aHoriByMF.SetText(String());
- m_aVertByMF.SetText(String());
-
- m_bPositioningDisabled = true;
- return;
- }
- }
- }
- Point aPt = m_aAnchorPos * -1;
- Point aPt2 = aPt;
-
- aPt += m_aWorkArea.TopLeft();
- m_aWorkArea.SetPos( aPt );
-
- aPt2 += m_aRect.TopLeft();
- m_aRect.SetPos( aPt2 );
- }
-
- // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
- if( rMarkList.GetMarkCount() == 1 )
- {
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
- if( ( pObj->GetObjInventor() == SdrInventor ) &&
- ( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) &&
- ( (SdrTextObj*) pObj )->HasText() )
- {
- DBG_ERROR("AutoWidth/AutoHeight should be enabled");
- }
- }
- else
- m_bIsMultiSelection = true;
-
- // use page offset and recalculate
- Point aPt( m_pSdrView->GetSdrPageView()->GetPageOrigin() );
-
- // Massstab
- Fraction aUIScale = m_pSdrView->GetModel()->GetUIScale();
-
-// lcl_ScaleRect( m_aWorkArea, aUIScale );
-// lcl_ScaleRect( m_aRect, aUIScale );
-// lcl_ScalePoint( aPt, aUIScale );
-
- // Metrik konvertieren
-// int nDigits = maMtrPosX.GetDecimalDigits();
-
-// aPt = lcl_ConvertPoint( aPt, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
-// m_aWorkArea = lcl_ConvertRect( m_aWorkArea, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
-// m_aRect = lcl_ConvertRect( m_aRect, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
-
- // use page offset
-// aPt *= -1;
-// aPt += m_aWorkArea.TopLeft();
-// m_aWorkArea.SetPos( aPt );
-
- //SetMinMaxPosition();
-}
-
diff --git a/svx/source/cui/swpossizetabpage.hrc b/svx/source/cui/swpossizetabpage.hrc
deleted file mode 100644
index 1d82fd778c..0000000000
--- a/svx/source/cui/swpossizetabpage.hrc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: swpossizetabpage.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define FL_SIZE 1
-#define FT_WIDTH 2
-#define MF_WIDTH 3
-#define FT_HEIGHT 4
-#define MF_HEIGHT 5
-#define CB_KEEPRATIO 6
-#define FL_SEPARATOR 7
-#define FL_ANCHOR 8
-#define RB_TOPAGE 9
-#define RB_TOPARA 10
-#define RB_TOCHAR 11
-#define RB_ASCHAR 12
-#define RB_TOFRAME 13
-#define FL_PROTECTION 14
-#define CB_POSITION 15
-#define CB_SIZE 16
-#define FL_POSITION 17
-#define FT_HORI 18
-#define LB_HORI 19
-#define FT_HORIBY 20
-#define MF_HORIBY 21
-#define FT_HORITO 22
-#define LB_HORITO 23
-#define CB_HORIMIRROR 24
-#define FT_VERT 25
-#define LB_VERT 26
-#define FT_VERTBY 27
-#define MF_VERTBY 28
-#define FT_VERTTO 29
-#define LB_VERTTO 30
-#define CB_FOLLOW 31
-#define WN_EXAMPLE 32
diff --git a/svx/source/cui/swpossizetabpage.hxx b/svx/source/cui/swpossizetabpage.hxx
deleted file mode 100644
index 34aff3b988..0000000000
--- a/svx/source/cui/swpossizetabpage.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: swpossizetabpage.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SWPOSSIZETABPAGE_HXX
-#define _SVX_SWPOSSIZETABPAGE_HXX
-
-#include <sfx2/tabdlg.hxx>
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-#include <swframeposstrings.hxx>
-#include <swframeexample.hxx>
-
-/*-- 01.03.2004 15:45:01---------------------------------------------------
- SvxSwPosSizeTabPage - position and size page for Writer drawing objects
- -----------------------------------------------------------------------*/
-struct FrmMap;
-class SdrView;
-class SvxSwPosSizeTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
- FixedLine m_aSizeFL;
- FixedText m_aWidthFT;
- MetricField m_aWidthMF;
- FixedText m_aHeightFT;
- MetricField m_aHeightMF;
- CheckBox m_aKeepRatioCB;
-
- FixedLine m_aSeparatorFL;
-
- FixedLine m_aAnchorFL;
- RadioButton m_aToPageRB;
- RadioButton m_aToParaRB;
- RadioButton m_aToCharRB;
- RadioButton m_aAsCharRB;
- RadioButton m_aToFrameRB;
-
- FixedLine m_aProtectionFL;
- TriStateBox m_aPositionCB;
- TriStateBox m_aSizeCB;
-
- FixedLine m_aPositionFL;
- FixedText m_aHoriFT;
- ListBox m_aHoriLB;
- FixedText m_aHoriByFT;
- MetricField m_aHoriByMF;
- FixedText m_aHoriToFT;
- ListBox m_aHoriToLB;
-
- CheckBox m_aHoriMirrorCB;
-
- FixedText m_aVertFT;
- ListBox m_aVertLB;
- FixedText m_aVertByFT;
- MetricField m_aVertByMF;
- FixedText m_aVertToFT;
- ListBox m_aVertToLB;
-
- CheckBox m_aFollowCB;
-
- SvxSwFrameExample m_aExampleWN;
-
- Link m_aValidateLink;
-
- //'string provider'
- SvxSwFramePosString m_aFramePosString;
-
- Rectangle m_aRect; //size of all selected objects
- Rectangle m_aWorkArea;
- Point m_aAnchorPos;
-
- FrmMap* m_pVMap;
- FrmMap* m_pHMap;
- const SdrView* m_pSdrView;
-
- // initial values
- short m_nOldH;
- short m_nOldHRel;
- short m_nOldV;
- short m_nOldVRel;
-
- double m_fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
- USHORT m_nHtmlMode;
- bool m_bHtmlMode;
- bool m_bAtHoriPosModified;
- bool m_bAtVertPosModified;
- bool m_bIsVerticalFrame;
- bool m_bPositioningDisabled;
- bool m_bIsMultiSelection;
- bool m_bIsInRightToLeft;
-
-
-
- DECL_LINK( RangeModifyHdl, Edit * );
- DECL_LINK( AnchorTypeHdl, RadioButton * );
- DECL_LINK( PosHdl, ListBox * );
- DECL_LINK( RelHdl, ListBox * );
- DECL_LINK( MirrorHdl, CheckBox * );
- DECL_LINK( ModifyHdl, Edit * );
- DECL_LINK( ProtectHdl, TriStateBox *);
-
- void InitPos(short nAnchorType, USHORT nH, USHORT nHRel,
- USHORT nV, USHORT nVRel,
- long nX, long nY);
- USHORT GetMapPos(FrmMap *pMap, ListBox &rAlignLB);
- short GetAlignment(FrmMap *pMap, USHORT nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
- short GetRelation(FrmMap *pMap, ListBox &rRelationLB);
- short GetAnchorType(bool* pbHasChanged = 0);
- ULONG FillRelLB(FrmMap *pMap, USHORT nLBSelPos, USHORT nAlign, USHORT nRel, ListBox &rLB, FixedText &rFT);
- USHORT FillPosLB(FrmMap *pMap, USHORT nAlign, const USHORT _nRel, ListBox &rLB);
-
- void UpdateExample();
-
-public:
- SvxSwPosSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs );
- ~SvxSwPosSizeTabPage();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- void EnableAnchorTypes(USHORT nAnchorEnable);
-
- void SetValidateFramePosLink( const Link& rLink )
- {m_aValidateLink = rLink;}
-
- void SetView( const SdrView* pSdrView );
-};
-
-#endif
diff --git a/svx/source/cui/swpossizetabpage.src b/svx/source/cui/swpossizetabpage.src
deleted file mode 100644
index fad98467ce..0000000000
--- a/svx/source/cui/swpossizetabpage.src
+++ /dev/null
@@ -1,299 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: swpossizetabpage.src,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ------------------------------------------------------------------
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "swpossizetabpage.hrc"
- // pragma -------------------------------------------------------------------
-
-
- // RID_SVXPAGE_POSITION_SIZE ------------------------------------------------
-TabPage RID_SVXPAGE_SWPOSSIZE
-{
- HelpId = HID_SVXPAGE_SWPOSSIZE;
- Hide = TRUE ;
- Text[ en-US ] = "Position and Size" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_SIZE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 104 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 43 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "~Width" ;
- };
- MetricField MF_WIDTH
- {
- Pos = MAP_APPFONT ( 59 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- Border = TRUE ;
- Text = "12,99" ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 5 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 5 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_HEIGHT
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 43 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "H~eight" ;
- };
- MetricField MF_HEIGHT
- {
- Pos = MAP_APPFONT ( 59 , 30 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- Border = TRUE ;
- Text = "12,99" ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 5 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = 5 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- CheckBox CB_KEEPRATIO
- {
- Pos = MAP_APPFONT ( 12 , 45 ) ;
- Size = MAP_APPFONT ( 95 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Keep ratio" ;
- };
- FixedLine FL_SEPARATOR
- {
- Pos = MAP_APPFONT ( 111 , 14 ) ;
- Size = MAP_APPFONT ( 4 , 66 ) ;
- Vert = TRUE;
- };
- FixedLine FL_ANCHOR
- {
- Pos = MAP_APPFONT ( 116 , 3 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Anchor" ;
- };
- RadioButton RB_TOPAGE
- {
- Pos = MAP_APPFONT ( 122 , 14 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "To ~page";
- };
- RadioButton RB_TOPARA
- {
- Pos = MAP_APPFONT ( 122 , 28 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "To paragrap~h";
- };
- RadioButton RB_TOCHAR
- {
- Pos = MAP_APPFONT ( 122 , 42 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "To cha~racter";
- };
- RadioButton RB_ASCHAR
- {
- Pos = MAP_APPFONT ( 122 , 56 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "~As character" ;
- };
- RadioButton RB_TOFRAME
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 122 , 70 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "To ~frame";
- };
- Window WN_EXAMPLE
- {
- Pos = MAP_APPFONT ( 202 , 14 ) ;
- Size = MAP_APPFONT ( 52 , 66 ) ;
- };
- FixedLine FL_PROTECTION
- {
- Pos = MAP_APPFONT ( 6 , 86 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Protect" ;
- };
- TriStateBox CB_POSITION
- {
- Pos = MAP_APPFONT ( 12 , 97 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Position" ;
- };
- TriStateBox CB_SIZE
- {
- Pos = MAP_APPFONT ( 122 , 97 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 6 , 113 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Position" ;
- };
- FixedText FT_HORI
- {
- Pos = MAP_APPFONT ( 12 , 126 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "Hori~zontal" ;
- };
- ListBox LB_HORI
- {
- Pos = MAP_APPFONT ( 49 , 124 ) ;
- Size = MAP_APPFONT ( 50 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_HORIBY
- {
- Pos = MAP_APPFONT ( 101 , 126 ) ;
- Size = MAP_APPFONT ( 20 , 8 ) ;
- Center = TRUE ;
- Text [ en-US ] = "b~y" ;
- };
- MetricField MF_HORIBY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 123 , 124 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = -9999 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_HORITO
- {
- Pos = MAP_APPFONT ( 160 , 126 ) ;
- Size = MAP_APPFONT ( 21 , 8 ) ;
- Center = TRUE ;
- Text [ en-US ] = "~to" ;
- };
- ListBox LB_HORITO
- {
- Pos = MAP_APPFONT ( 183 , 124 ) ;
- Size = MAP_APPFONT ( 65 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- CheckBox CB_HORIMIRROR
- {
- Pos = MAP_APPFONT ( 12 , 139 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Mirror on even pages" ;
- };
- FixedText FT_VERT
- {
- Pos = MAP_APPFONT ( 12 , 155 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "~Vertical" ;
- };
- ListBox LB_VERT
- {
- Pos = MAP_APPFONT ( 49 , 153 ) ;
- Size = MAP_APPFONT ( 50 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_VERTBY
- {
- Pos = MAP_APPFONT ( 101 , 155 ) ;
- Size = MAP_APPFONT ( 20 , 8 ) ;
- Center = TRUE ;
- Text [ en-US ] = "by" ;
- };
- MetricField MF_VERTBY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 123 , 153 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- First = -9999 ;
- Last = 9999 ;
- SpinSize = 10 ;
- };
- FixedText FT_VERTTO
- {
- Pos = MAP_APPFONT ( 160 , 155 ) ;
- Size = MAP_APPFONT ( 21 , 8 ) ;
- Center = TRUE ;
- Text [ en-US ] = "t~o" ;
- };
- ListBox LB_VERTTO
- {
- Pos = MAP_APPFONT ( 183 , 153 ) ;
- Size = MAP_APPFONT ( 65 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- CheckBox CB_FOLLOW
- {
- Pos = MAP_APPFONT ( 12 , 168 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Follow text flow" ;
- };
-};
diff --git a/svx/source/cui/tabarea.cxx b/svx/source/cui/tabarea.cxx
deleted file mode 100644
index 721154a9a9..0000000000
--- a/svx/source/cui/tabarea.cxx
+++ /dev/null
@@ -1,382 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabarea.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <tools/ref.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
-#include <svtools/pathoptions.hxx>
-#include <svx/svdmark.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdview.hxx>
-
-#define _SVX_TABAREA_CXX
-
-#include <svx/dialogs.hrc>
-
-
-
-
-
-
-#include <svx/xtable.hxx>
-#include "globl3d.hxx"
-#include <svx/svdmodel.hxx>
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include "tabarea.hrc"
-#include "dlgname.hxx"
-#include "dlgname.hrc"
-#include <svx/dialmgr.hxx>
-
-#define DLGWIN this->GetParent()->GetParent()
-
-/*************************************************************************
-|*
-|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
-|*
-|************************************************************************/
-
-SvxAreaTabDialog::SvxAreaTabDialog
-(
- Window* pParent,
- const SfxItemSet* pAttr,
- SdrModel* pModel,
- const SdrView* /* pSdrView */
-) :
-
- SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_AREA ), pAttr ),
-
- mpDrawModel ( pModel ),
-// mpView ( pSdrView ),
- mpColorTab ( pModel->GetColorTable() ),
- mpNewColorTab ( pModel->GetColorTable() ),
- mpGradientList ( pModel->GetGradientList() ),
- mpNewGradientList ( pModel->GetGradientList() ),
- mpHatchingList ( pModel->GetHatchList() ),
- mpNewHatchingList ( pModel->GetHatchList() ),
- mpBitmapList ( pModel->GetBitmapList() ),
- mpNewBitmapList ( pModel->GetBitmapList() ),
- mrOutAttrs ( *pAttr ),
- mnColorTableState ( CT_NONE ),
- mnBitmapListState ( CT_NONE ),
- mnGradientListState ( CT_NONE ),
- mnHatchingListState ( CT_NONE ),
- mnPageType( PT_AREA ),
- mnDlgType( 0 ),
- mnPos( 0 ),
- mbAreaTP( sal_False ),
- mbDeleteColorTable( TRUE )
-{
- FreeResource();
-
- AddTabPage( RID_SVXPAGE_AREA, SvxAreaTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, 0);
- AddTabPage( RID_SVXPAGE_COLOR, SvxColorTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_GRADIENT, SvxGradientTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_HATCH, SvxHatchTabPage::Create, 0 );
- AddTabPage( RID_SVXPAGE_BITMAP, SvxBitmapTabPage::Create, 0);
-
- SetCurPageId( RID_SVXPAGE_AREA );
-
- CancelButton& rBtnCancel = GetCancelButton();
- rBtnCancel.SetClickHdl( LINK( this, SvxAreaTabDialog, CancelHdlImpl ) );
-//! rBtnCancel.SetText( SVX_RESSTR( RID_SVXSTR_CLOSE ) );
-}
-
-// -----------------------------------------------------------------------
-
-SvxAreaTabDialog::~SvxAreaTabDialog()
-{
-}
-
-
-// -----------------------------------------------------------------------
-
-void SvxAreaTabDialog::SavePalettes()
-{
- SfxObjectShell* pShell = SfxObjectShell::Current();
- /*uno::Reference< frame::XDispatchProvider > xDispatchProvider;
- if ( !pShell )
- {
- uno::Reference< frame::XModel> xModel = mpDrawModel->getUnoModel();
- if ( xModel.is() )
- xDispatchProvider.set(xModel->getCurrentController(),uno::UNO_QUERY);
- }*/
- if( mpNewColorTab != mpDrawModel->GetColorTable() )
- {
- if(mbDeleteColorTable)
- delete mpDrawModel->GetColorTable();
- mpDrawModel->SetColorTable( mpNewColorTab );
- SvxColorTableItem aColorTableItem( mpNewColorTab, SID_COLOR_TABLE );
- if ( pShell )
- pShell->PutItem( aColorTableItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aColorTableItem,SID_COLOR_TABLE);
- }
- mpColorTab = mpDrawModel->GetColorTable();
- }
- if( mpNewGradientList != mpDrawModel->GetGradientList() )
- {
- delete mpDrawModel->GetGradientList();
- mpDrawModel->SetGradientList( mpNewGradientList );
- SvxGradientListItem aItem( mpNewGradientList, SID_GRADIENT_LIST );
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem,SID_GRADIENT_LIST);
- }
- mpGradientList = mpDrawModel->GetGradientList();
- }
- if( mpNewHatchingList != mpDrawModel->GetHatchList() )
- {
- delete mpDrawModel->GetHatchList();
- mpDrawModel->SetHatchList( mpNewHatchingList );
- SvxHatchListItem aItem( mpNewHatchingList, SID_HATCH_LIST );
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem,SID_HATCH_LIST);
- }
- mpHatchingList = mpDrawModel->GetHatchList();
- }
- if( mpNewBitmapList != mpDrawModel->GetBitmapList() )
- {
- delete mpDrawModel->GetBitmapList();
- mpDrawModel->SetBitmapList( mpNewBitmapList );
- SvxBitmapListItem aItem( mpNewBitmapList, SID_BITMAP_LIST );
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem,SID_BITMAP_LIST);
- }
- mpBitmapList = mpDrawModel->GetBitmapList();
- }
-
- // Speichern der Tabellen, wenn sie geaendert wurden.
-
- const String aPath( SvtPathOptions().GetPalettePath() );
-
- if( mnHatchingListState & CT_MODIFIED )
- {
- mpHatchingList->SetPath( aPath );
- mpHatchingList->Save();
-
- SvxHatchListItem aItem( mpHatchingList, SID_HATCH_LIST );
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem);
- }
- }
-
- if( mnBitmapListState & CT_MODIFIED )
- {
- mpBitmapList->SetPath( aPath );
- mpBitmapList->Save();
-
- SvxBitmapListItem aItem( mpBitmapList, SID_BITMAP_LIST );
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem);
- }
- }
-
- if( mnGradientListState & CT_MODIFIED )
- {
- mpGradientList->SetPath( aPath );
- mpGradientList->Save();
-
- SvxGradientListItem aItem( mpGradientList, SID_GRADIENT_LIST );
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem);
- }
- }
-
- if( mnColorTableState & CT_MODIFIED )
- {
- mpColorTab->SetPath( aPath );
- mpColorTab->Save();
-
- SvxColorTableItem aItem( mpColorTab, SID_COLOR_TABLE );
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( aItem );
- else
- {
- mpDrawModel->GetItemPool().Put(aItem);
- }
- }
-}
-// -----------------------------------------------------------------------
-
-short SvxAreaTabDialog::Ok()
-{
- SavePalettes();
-
- // Es wird RET_OK zurueckgeliefert, wenn wenigstens eine
- // TabPage in FillItemSet() TRUE zurueckliefert. Dieses
- // geschieht z.Z. standardmaessig.
- return( SfxTabDialog::Ok() );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxAreaTabDialog, CancelHdlImpl, void *, EMPTYARG)
-{
- SavePalettes();
-
- EndDialog( RET_CANCEL );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxAreaTabDialog, CancelHdlImpl, void *, p )
-
-// -----------------------------------------------------------------------
-
-void SvxAreaTabDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
-{
- switch( nId )
- {
- case RID_SVXPAGE_AREA:
- ( (SvxAreaTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxAreaTabPage&) rPage ).SetGradientList( mpGradientList );
- ( (SvxAreaTabPage&) rPage ).SetHatchingList( mpHatchingList );
- ( (SvxAreaTabPage&) rPage ).SetBitmapList( mpBitmapList );
- //CHINA001 ( (SvxAreaTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxAreaTabPage&) rPage ).SetPageType( mnPageType ); //add CHINA001
- //CHINA001 ( (SvxAreaTabPage&) rPage ).SetDlgType( &mnDlgType );
- ( (SvxAreaTabPage&) rPage ).SetDlgType( mnDlgType );//add CHINA001
- //CHINA001 ( (SvxAreaTabPage&) rPage ).SetPos( &nPos );
- ( (SvxAreaTabPage&) rPage ).SetPos( mnPos );//add CHINA001
- ( (SvxAreaTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxAreaTabPage&) rPage ).SetGrdChgd( &mnGradientListState );
- ( (SvxAreaTabPage&) rPage ).SetHtchChgd( &mnHatchingListState );
- ( (SvxAreaTabPage&) rPage ).SetBmpChgd( &mnBitmapListState );
- ( (SvxAreaTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxAreaTabPage&) rPage ).Construct();
- // ActivatePage() wird das erste mal nicht gerufen
- ( (SvxAreaTabPage&) rPage ).ActivatePage( mrOutAttrs );
-
- break;
-
- case RID_SVXPAGE_SHADOW:
- {
- ( (SvxShadowTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxShadowTabPage&) rPage ).SetPageType( mnPageType );//CHINA001 ( (SvxShadowTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxShadowTabPage&) rPage ).SetDlgType( mnDlgType );//CHINA001 ( (SvxShadowTabPage&) rPage ).SetDlgType( &mnDlgType );
- //( (SvxShadowTabPage&) rPage ).SetPos( &nPos );
- ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxShadowTabPage&) rPage ).Construct();
- }
- break;
-
- case RID_SVXPAGE_GRADIENT:
- ( (SvxGradientTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxGradientTabPage&) rPage ).SetGradientList( mpGradientList );
- ( (SvxGradientTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxGradientTabPage&) rPage ).SetDlgType( &mnDlgType );
- ( (SvxGradientTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxGradientTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxGradientTabPage&) rPage ).SetGrdChgd( &mnGradientListState );
- ( (SvxGradientTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxGradientTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_HATCH:
- ( (SvxHatchTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxHatchTabPage&) rPage ).SetHatchingList( mpHatchingList );
- ( (SvxHatchTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxHatchTabPage&) rPage ).SetDlgType( &mnDlgType );
- ( (SvxHatchTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxHatchTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxHatchTabPage&) rPage ).SetHtchChgd( &mnHatchingListState );
- ( (SvxHatchTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxHatchTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_BITMAP:
- ( (SvxBitmapTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxBitmapTabPage&) rPage ).SetBitmapList( mpBitmapList );
- ( (SvxBitmapTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxBitmapTabPage&) rPage ).SetDlgType( &mnDlgType );
- ( (SvxBitmapTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxBitmapTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxBitmapTabPage&) rPage ).SetBmpChgd( &mnBitmapListState );
- ( (SvxBitmapTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxBitmapTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_COLOR:
- ( (SvxColorTabPage&) rPage ).SetColorTable( mpColorTab );
- ( (SvxColorTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxColorTabPage&) rPage ).SetDlgType( &mnDlgType );
- ( (SvxColorTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxColorTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxColorTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxColorTabPage&) rPage ).SetDeleteColorTable( mbDeleteColorTable );
- ( (SvxColorTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_TRANSPARENCE:
- ( (SvxTransparenceTabPage&) rPage ).SetPageType( mnPageType );//CHINA001 ( (SvxTransparenceTabPage&) rPage ).SetPageType( &mnPageType );
- ( (SvxTransparenceTabPage&) rPage ).SetDlgType( mnDlgType );//CHINA001 ( (SvxTransparenceTabPage&) rPage ).SetDlgType( &mnDlgType );
- ( (SvxTransparenceTabPage&) rPage ).Construct();
- break;
-
- }
-}
-
-
diff --git a/svx/source/cui/tabarea.hrc b/svx/source/cui/tabarea.hrc
deleted file mode 100644
index a5afbd8b29..0000000000
--- a/svx/source/cui/tabarea.hrc
+++ /dev/null
@@ -1,190 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabarea.hrc,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define BTN_LOAD 5
-#define BTN_SAVE 6
-#define GRP_FILL 1
-#define GRP_SHADOW 2
-#define GRP_PREVIEW 3
-#define GRP_TRANSPARENT 4
-#define GRP_STEPCOUNT 5
-#define CTL_PREVIEW 1
-#define CTL_POSITION 2
-//#define CTL_GRADIENT_PREVIEW 3
-//#define CTL_HATCHING_PREVIEW 4
-#define CTL_COLOR_PREVIEW 5
-#define CTL_BITMAP_PREVIEW 6
-#define MTR_FLD_DISTANCE 1
-#define TSB_INVISIBLE 1
-#define TSB_SHOW_SHADOW 2
-#define TSB_STEPCOUNT 3
-#define TSB_TILE 4
-#define TSB_STRETCH 5
-#define TSB_ORIGINAL 6
-#define AREADLG_INVISIBLE 0
-#define AREADLG_COLOR 1
-#define AREADLG_GRADIENT 2
-#define AREADLG_HATCH 3
-#define AREADLG_BITMAP 4
-
-#define LB_COLOR 1
-#define LB_GRADIENT 2
-#define LB_HATCHING 3
-#define LB_BITMAP 4
-//#define LB_TRANSPARENT 5
-#define LB_BITMAPS 4
-#define LB_BACKGROUND_COLOR 3
-#define LB_DLG_TYPE 99
-#define GRP_COLOR 1
-#define BTN_ADD 1
-#define BTN_IMPORT 2
-#define BTN_MODIFY 3
-#define BTN_DELETE 4
-#define FT_COLOR 1
-#define FT_BACKGROUND_COLOR 2
-#define FT_POSITION 2
-#define FT_DISTANCE 1
-#define FT_LINE_COLOR 2
-#define FT_LINE_TYPE 1
-#define FT_LINE_DISTANCE 3
-#define FT_LINE_ANGLE 4
-#define GRP_LINE 1
-#define GRP_HATCHINGS 5
-#define MTR_FLD_ANGLE 3
-#define CTL_ANGLE 2
-#define LB_HATCHINGS 4
-#define LB_LINE_TYPE 1
-#define LB_LINE_COLOR 3
-#define GRP_GRADIENTS 4
-#define GRP_GRADIENT_TYPE 5
-#define LB_GRADIENTS 3
-#define LB_GRADIENT_TYPES 4
-#define LB_COLOR_FROM 1
-#define LB_COLOR_TO 2
-#define FT_COLOR_FROM 1
-#define FT_COLOR_TO 2
-#define FT_CENTER_X 3
-#define FT_CENTER_Y 5
-#define FT_ANGLE 4
-#define FT_BORDER 6
-#define MTR_COLOR_FROM 4
-#define MTR_COLOR_TO 5
-#define MTR_CENTER_X 2
-#define MTR_CENTER_Y 3
-#define MTR_BORDER 6
-#define MTR_ANGLE 1
-#define NUM_FLD_STEPCOUNT 1
-#define FT_PIXEL_EDIT 4
-#define CTL_PIXEL 2
-#define FT_TYPE 7
-#define FT_SHADOW_COLOR 10
-#define LB_SHADOW_COLOR 10
-#define FL_PROP 2
-#define FL_SIZE 3
-#define FL_POSITION 4
-#define FL_OFFSET 5
-#define FL_STEPCOUNT 7
-
-// Farben definieren TabPage
-// nur temporaer !!!
-// #define RID_SVXPAGE_COLOR 999
-
-//#define GRP_COLORTABLE 1
-//#define GRP_COLORMODEL 2
-
-#define BTN_WORK_ON 2
-#define CTL_COLORTABLE 3
-#define CTL_PREVIEW_OLD 1
-#define CTL_PREVIEW_NEW 2
-#define FT_NAME 2
-#define EDT_NAME 1
-// #define LB_COLOR 1
-#define LB_COLORMODEL 2
-#define FT_1 3
-#define FT_2 4
-#define FT_3 5
-#define FT_4 6
-#define MTR_FLD_1 1
-#define MTR_FLD_2 2
-#define MTR_FLD_3 3
-#define MTR_FLD_4 4
-#define FT_TABLE_NAME 7
-#define MTR_FLD_X_SIZE 4
-#define MTR_FLD_Y_SIZE 5
-#define GRP_SIZE 6
-#define TSB_SCALE 1
-#define GRP_POSITION 7
-#define FT_X_OFFSET 1
-#define FT_Y_OFFSET 2
-#define MTR_FLD_X_OFFSET 1
-#define MTR_FLD_Y_OFFSET 2
-#define LB_AREA_TYPE 19
-#define RBT_ROW 6
-#define RBT_COLUMN 7
-#define MTR_FLD_OFFSET 3
-#define GRP_OFFSET 8
-
-#define FT_TRANSPARENT 9
-#define FT_X_SIZE 10
-#define FT_Y_SIZE 11
-#define FT_BITMAPS_HIDDEN 12
-
-#define RBT_TRANS_OFF 8
-#define RBT_TRANS_LINEAR 9
-#define RBT_TRANS_GRADIENT 10
-#define GRP_TRANS_MODE 9
-#define GRP_TRANS_GRADIENT 10
-#define CTL_TRANS_PREVIEW 19
-
-#define FT_TRGR_TYPE 12
-#define LB_TRGR_GRADIENT_TYPES 3
-#define FT_TRGR_CENTER_X 13
-#define MTR_TRGR_CENTER_X 4
-#define FT_TRGR_CENTER_Y 14
-#define MTR_TRGR_CENTER_Y 5
-#define FT_TRGR_ANGLE 15
-#define MTR_TRGR_ANGLE 6
-#define FT_TRGR_BORDER 16
-#define MTR_TRGR_BORDER 7
-#define FT_TRGR_START_VALUE 17
-#define MTR_TRGR_START_VALUE 8
-#define FT_TRGR_END_VALUE 18
-#define MTR_TRGR_END_VALUE 9
-#define MTR_TRANSPARENT 10
-
-#define MTR_SHADOW_TRANSPARENT 11
-
-// Hatch-Background on Area-TabPage
-#define GRP_HATCHBCKGRD 20
-#define CB_HATCHBCKGRD 21
-#define LB_HATCHBCKGRDCOLOR 22
-
-
-#define IMG_LOAD_H 23
-#define IMG_SAVE_H 24
diff --git a/svx/source/cui/tabarea.src b/svx/source/cui/tabarea.src
deleted file mode 100644
index 16d46fd896..0000000000
--- a/svx/source/cui/tabarea.src
+++ /dev/null
@@ -1,1541 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabarea.src,v $
- * $Revision: 1.65 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "tabarea.hrc"
-
-#define MASKCOLOR MaskColor = Color{ Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; };
-
-
- // RID_SVXPAGE_AREA ------------------------------------------------------
-#define TRANS_GRAD_OFFSET_X 6
-#define TRANS_GRAD_OFFSET_Y 64
-#define TRANS_GRAD_FIELD_SEPARATION 24
-
-TabPage RID_SVXPAGE_TRANSPARENCE
-{
- HelpID = HID_AREA_TRANSPARENCE;
- Hide = TRUE;
- Size = MAP_APPFONT ( 260 , 185 );
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248, 8 ) ;
- Text [ en-US ] = "Transparency mode";
- };
- RadioButton RBT_TRANS_OFF
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 10 ) ;
- Text [ en-US ] = "~No transparency";
- };
- RadioButton RBT_TRANS_LINEAR
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 60 , 10 ) ;
- Text [ en-US ] = "~Transparency";
- };
- MetricField MTR_TRANSPARENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 26 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- RadioButton RBT_TRANS_GRADIENT
- {
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 110 , 10 ) ;
- Text [ en-US ] = "Gradient";
- };
- FixedText FT_TRGR_TYPE
- {
- Pos = MAP_APPFONT ( 21 , 56 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Ty~pe";
- };
- ListBox LB_TRGR_GRADIENT_TYPES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 54 ) ;
- Size = MAP_APPFONT ( 53 , 63 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Linear" ; Default ; > ;
- < "Axial" ; Default ; > ;
- < "Radial" ; Default ; > ;
- < "Ellipsoid" ; Default ; > ;
- < "Quadratic" ; Default ; > ;
- < "Square" ; Default ; > ;
- };
- };
- FixedText FT_TRGR_CENTER_X
- {
- Pos = MAP_APPFONT ( 21 , 72 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Center ~X";
- };
- MetricField MTR_TRGR_CENTER_X
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 70 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_CENTER_Y
- {
- Pos = MAP_APPFONT ( 21 , 88 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Center ~Y";
- };
- MetricField MTR_TRGR_CENTER_Y
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 86 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_ANGLE
- {
- Pos = MAP_APPFONT ( 21 , 104 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "~Angle";
- };
- MetricField MTR_TRGR_ANGLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 102 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 359 ;
- Unit = FUNIT_CUSTOM ;
- Last = 359 ;
- SpinSize = 15 ;
- CustomUnitText [ en-US ] = " degrees";
- };
- FixedText FT_TRGR_BORDER
- {
- Pos = MAP_APPFONT ( 15 + TRANS_GRAD_OFFSET_X, 56 + TRANS_GRAD_OFFSET_Y) ;
- Size = MAP_APPFONT ( 41, 8 ) ;
- Text [ en-US ] = "~Border";
- };
- MetricField MTR_TRGR_BORDER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 66 + TRANS_GRAD_OFFSET_X, 54 + TRANS_GRAD_OFFSET_Y) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_START_VALUE
- {
- Pos = MAP_APPFONT ( 21 , 136 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "~Start value";
- };
- MetricField MTR_TRGR_START_VALUE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 134 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_END_VALUE
- {
- Pos = MAP_APPFONT ( 21 , 152 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "~End value";
- };
- MetricField MTR_TRGR_END_VALUE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 72 , 150 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- Control CTL_BITMAP_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 138 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 42 ) ;
- };
- Control CTL_TRANS_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 138 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 42 ) ;
- };
- Text [ en-US ] = "Transparency";
-};
-
- // RID_SVXPAGE_AREA ------------------------------------------------------
-TabPage RID_SVXPAGE_AREA
-{
- Size = MAP_APPFONT ( 260 , 185 ) ;
- HelpID = HID_AREA_AREA ;
- Hide = TRUE ;
- Text [ en-US ] = "Area" ;
-
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 120, 8 ) ;
- Text [ en-US ] = "Fill";
- };
- ListBox LB_AREA_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 108 , 60 ) ;
- DropDown = TRUE;
- Border = TRUE;
- StringList [ en-US ] =
- {
- < "None" ; Default ; > ;
- < "Color" ; Default ; > ;
- < "Gradient" ; Default ; > ;
- < "Hatching" ; Default ; > ;
- < "Bitmap" ; Default ; > ;
- };
- };
-
-
- ListBox LB_COLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 108 , 103 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_GRADIENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 108 , 103 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_HATCHING
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 108 , 103 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_BITMAP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 108 , 103 ) ;
- TabStop = TRUE ;
- };
-
- // ---------- preview ----------
-
- Control CTL_COLOR_PREVIEW
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 137 ) ;
- Size = MAP_APPFONT ( 110 , 42 ) ;
- };
- Control CTL_BITMAP_PREVIEW
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 137 ) ;
- Size = MAP_APPFONT ( 110 , 42 ) ;
- Hide = TRUE ;
- };
-
- // ---------- for gradients ----------
-
- FixedLine FL_STEPCOUNT
- {
- Pos = MAP_APPFONT ( 132 , 3 ) ;
- Size = MAP_APPFONT ( 122 , 8 ) ;
- Text [ en-US ] = "Increments" ;
- };
- TriStateBox TSB_STEPCOUNT
- {
- Pos = MAP_APPFONT ( 138 , 15 ) ;
- Size = MAP_APPFONT ( 68 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "A~utomatic" ;
- };
- NumericField NUM_FLD_STEPCOUNT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 208 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 3 ;
- First = 3 ;
- Maximum = 256 ;
- Last = 256 ;
- StrictFormat = TRUE ;
- };
-
- // ---------- for hatches ----------
-
- CheckBox CB_HATCHBCKGRD
- {
- Pos = MAP_APPFONT ( 132 , 3 ) ;
- Size = MAP_APPFONT ( 122 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Background color" ;
- };
- ListBox LB_HATCHBCKGRDCOLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 141 , 16 ) ;
- Size = MAP_APPFONT ( 70 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
-
- // ---------- for bitmaps ----------
-
- FixedLine FL_SIZE
- {
- Pos = MAP_APPFONT ( 132 , 3 ) ;
- Size = MAP_APPFONT ( 122 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- TriStateBox TSB_ORIGINAL
- {
- Pos = MAP_APPFONT ( 138 , 15 ) ;
- Size = MAP_APPFONT ( 48 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- TriStateBox TSB_SCALE
- {
- Pos = MAP_APPFONT ( 138 , 30 ) ;
- Size = MAP_APPFONT ( 48 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Re~lative" ;
- };
- FixedText FT_X_SIZE
- {
- Pos = MAP_APPFONT ( 187 , 15 ) ;
- Size = MAP_APPFONT ( 24 , 8 ) ;
- Text [ en-US ] = "Wi~dth" ;
- };
- MetricField MTR_FLD_X_SIZE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 212 , 14 ) ;
- Size = MAP_APPFONT ( 36 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- CustomUnitText = "%" ;
- Minimum = 5 ;
- Maximum = 100 ;
- First = 5 ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_Y_SIZE
- {
- Pos = MAP_APPFONT ( 187 , 31 ) ;
- Size = MAP_APPFONT ( 24 , 8 ) ;
- Text [ en-US ] = "H~eight" ;
- };
- MetricField MTR_FLD_Y_SIZE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 212 , 29 ) ;
- Size = MAP_APPFONT ( 36 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- CustomUnitText = "%" ;
- Minimum = 5 ;
- Maximum = 100 ;
- First = 5 ;
- Last = 100 ;
- SpinSize = 5 ;
- SpinSize = 5 ;
- };
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 132 , 47 ) ;
- Size = MAP_APPFONT ( 122 , 8 ) ;
- Text [ en-US ] = "Position" ;
- };
-
- Control CTL_POSITION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 138 , 57 ) ;
- Size = MAP_APPFONT ( 40 , 27 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_X_OFFSET
- {
- Pos = MAP_APPFONT ( 138 , 89 ) ;
- Size = MAP_APPFONT ( 39 , 8 ) ;
- Text [ en-US ] = "~X Offset" ;
- };
- FixedText FT_Y_OFFSET
- {
- Pos = MAP_APPFONT ( 139 , 104 ) ;
- Size = MAP_APPFONT ( 78 , 8 ) ;
- Text [ en-US ] = "~Y Offset" ;
- };
- MetricField MTR_FLD_X_OFFSET
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 219 , 87 ) ;
- Size = MAP_APPFONT ( 29 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Maximum = 100 ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- MetricField MTR_FLD_Y_OFFSET
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 219 , 102 ) ;
- Size = MAP_APPFONT ( 29 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- TriStateBox TSB_TILE
- {
- Pos = MAP_APPFONT ( 138 , 117 ) ;
- Size = MAP_APPFONT ( 54 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Tile" ;
- };
- TriStateBox TSB_STRETCH
- {
- Pos = MAP_APPFONT ( 194 , 117 ) ;
- Size = MAP_APPFONT ( 54 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Auto~Fit" ;
- };
- FixedLine FL_OFFSET
- {
- Pos = MAP_APPFONT ( 132 , 133 ) ;
- Size = MAP_APPFONT ( 122 , 8 ) ;
- Text [ en-US ] = "Offset" ;
- };
- RadioButton RBT_ROW
- {
- Pos = MAP_APPFONT ( 138 , 144 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Ro~w" ;
- };
- RadioButton RBT_COLUMN
- {
- Pos = MAP_APPFONT ( 138 , 158 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Colu~mn" ;
- };
- MetricField MTR_FLD_OFFSET
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 219 , 157 ) ;
- Size = MAP_APPFONT ( 29 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
-};
- // RID_SVXPAGE_SHADOW ------------------------------------------------------
-TabPage RID_SVXPAGE_SHADOW
-{
- HelpID = HID_AREA_SHADOW ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Shadow" ;
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248, 8 ) ;
- Text [ en-US ] = "Properties";
- };
- TriStateBox TSB_SHOW_SHADOW
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Use shadow";
- };
- FixedText FT_POSITION
- {
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "~Position";
- };
- Control CTL_POSITION
- {
- HelpId = HID_TPSHADOW_CTRL ;
- Pos = MAP_APPFONT ( 65 , 31 ) ;
- Size = MAP_APPFONT ( 57 , 29 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_DISTANCE
- {
- Pos = MAP_APPFONT ( 12 , 69 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Distance";
- };
- MetricField MTR_FLD_DISTANCE
- {
- Pos = MAP_APPFONT ( 65 , 67 ) ;
- Size = MAP_APPFONT ( 47 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 99999 ;
- Minimum = 0 ; // #i33700#
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- Last = 99999 ;
- /*SpinSize = 100 ; */
- SpinSize = 1 ;
- };
- ListBox LB_SHADOW_COLOR
- {
- Pos = MAP_APPFONT ( 65 , 86 ) ;
- Size = MAP_APPFONT ( 57 , 100 ) ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_SHADOW_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 88 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Color" ;
- };
- FixedText FT_TRANSPARENT
- {
- Pos = MAP_APPFONT ( 12 , 107 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Transparency";
- };
- MetricField MTR_SHADOW_TRANSPARENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 65 , 105 ) ;
- Size = MAP_APPFONT ( 47 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- Control CTL_COLOR_PREVIEW
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 138 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 42 ) ;
- TabStop = FALSE ;
- };
-};
- // RID_SVXPAGE_HATCH --------------------------------------------------------
-TabPage RID_SVXPAGE_HATCH
-{
- HelpID = HID_AREA_HATCH ;
- Hide = TRUE ;
- Text [ en-US ] = "Hatching" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248, 8 ) ;
- Text [ en-US ] = "Properties";
- };
- FixedText FT_LINE_DISTANCE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 78 , 8 ) ;
- Text [ en-US ] = "~Spacing" ;
- };
- MetricField MTR_FLD_DISTANCE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 30 ;
- Maximum = 9999 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 30 ;
- Last = 9999 ;
- SpinSize = 100 ;
- };
- FixedText FT_LINE_ANGLE
- {
- Pos = MAP_APPFONT ( 12 , 41 ) ;
- Size = MAP_APPFONT ( 78 , 8 ) ;
- Text [ en-US ] = "A~ngle" ;
- };
- MetricField MTR_FLD_ANGLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 52 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 359 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText [ en-US ] = " degrees" ;
- Last = 359 ;
- SpinSize = 15 ;
- };
- Control CTL_ANGLE
- {
- HelpId = HID_TPHATCH_CTRL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 72 ) ;
- Size = MAP_APPFONT ( 39 , 39 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_LINE_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 123 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Line type" ;
- };
- ListBox LB_LINE_TYPE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 134 ) ;
- Size = MAP_APPFONT ( 62 , 62 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Single" ; Default ; > ;
- < "Crossed" ; Default ; > ;
- < "Triple" ; Default ; > ;
- };
- };
- FixedText FT_LINE_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 150 ) ;
- Size = MAP_APPFONT ( 49 , 8 ) ;
- Text [ en-US ] = "Line ~color" ;
- };
- ListBox LB_LINE_COLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 161 ) ;
- Size = MAP_APPFONT ( 62 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- ListBox LB_HATCHINGS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 14 ) ;
- Size = MAP_APPFONT ( 88 , 110 ) ;
- TabStop = TRUE ;
- };
- Control CTL_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 131 ) ;
- Size = MAP_APPFONT ( 88 , 42 ) ;
- };
- PushButton BTN_ADD
- {
- Pos = MAP_APPFONT ( 197 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_MODIFY
- {
- Pos = MAP_APPFONT ( 197 , 32 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 197 , 68 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- ImageButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 197 , 104 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Load Hatches List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05501.bmp" ;
- };
- MASKCOLOR
- };
- };
- ImageButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 197 , 124 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Save Hatches List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05502.bmp" ;
- };
- MASKCOLOR
- };
- };
-};
- // RID_SVXPAGE_BITMAP -------------------------------------------------------
-TabPage RID_SVXPAGE_BITMAP
-{
- HelpID = HID_AREA_BITMAP ;
- Hide = TRUE ;
- Text [ en-US ] = "Bitmap Patterns" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248, 8 ) ;
- Text [ en-US ] = "Properties";
- };
- FixedText FT_PIXEL_EDIT
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 85 , 8 ) ;
- Text [ en-US ] = "Pattern Editor";
- };
- Control CTL_PIXEL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 72 , 72 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 104 ) ;
- Size = MAP_APPFONT ( 85 , 8 ) ;
- Text [ en-US ] = "~Foreground color";
- };
- ListBox LB_COLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 115 ) ;
- Size = MAP_APPFONT ( 62 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedText FT_BACKGROUND_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 131 ) ;
- Size = MAP_APPFONT ( 85 , 8 ) ;
- Text [ en-US ] = "~Background color";
- };
- ListBox LB_BACKGROUND_COLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 142 ) ;
- Size = MAP_APPFONT ( 62 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedText FT_BITMAPS_HIDDEN
- {
- // Hidden label that provides the name for the bitmaps list box.
- Text [ en-US ] = "Bitmap";
- };
- ListBox LB_BITMAPS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 14 ) ;
- Size = MAP_APPFONT ( 88 , 110 ) ;
- TabStop = TRUE ;
- };
- Control CTL_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 131 ) ;
- Size = MAP_APPFONT ( 88 , 42 ) ;
- };
- PushButton BTN_ADD
- {
- Pos = MAP_APPFONT ( 197 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_MODIFY
- {
- Pos = MAP_APPFONT ( 197 , 32 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_IMPORT
- {
- Pos = MAP_APPFONT ( 197 , 50 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Import..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 197 , 68 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- ImageButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 197 , 104 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Load Bitmap List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05501.bmp" ;
- };
- MASKCOLOR
- };
- };
- ImageButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 197 , 124 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Save Bitmap List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05502.bmp" ;
- };
- MASKCOLOR
- };
- };
-};
- // RID_SVXPAGE_GRADIENT -----------------------------------------------------
-TabPage RID_SVXPAGE_GRADIENT
-{
- HelpID = HID_AREA_GRADIENT ;
- Hide = TRUE ;
- Text [ en-US ] = "Gradients" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248, 8 ) ;
- Text [ en-US ] = "Properties";
- };
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 26 , 8 ) ;
- Text [ en-US ] = "Ty~pe" ;
- };
- ListBox LB_GRADIENT_TYPES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 14 ) ;
- Size = MAP_APPFONT ( 48, 63 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Linear" ; Default ; > ;
- < "Axial" ; Default ; > ;
- < "Radial" ; Default ; > ;
- < "Ellipsoid" ; Default ; > ;
- < "Square" ; Default ; > ;
- < "Rectangular" ; Default ; > ;
- };
- };
- FixedText FT_CENTER_X
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 37 , 8 ) ;
- Text [ en-US ] = "Center ~X" ;
- };
- MetricField MTR_CENTER_X
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 30 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_CENTER_Y
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 37 , 8 ) ;
- Text [ en-US ] = "Center ~Y" ;
- };
- MetricField MTR_CENTER_Y
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 46 ) ;
- Size = MAP_APPFONT ( 40, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_ANGLE
- {
- Pos = MAP_APPFONT ( 12 , 64 ) ;
- Size = MAP_APPFONT ( 37 , 8 ) ;
- Text [ en-US ] = "A~ngle" ;
- };
- MetricField MTR_ANGLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 62 ) ;
- Size = MAP_APPFONT ( 40, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 359 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText [ en-US ] = " degrees" ;
- Last = 359 ;
- SpinSize = 15 ;
- };
- FixedText FT_BORDER
- {
- Pos = MAP_APPFONT ( 12 , 80 ) ;
- Size = MAP_APPFONT ( 32 , 8 ) ;
- Text [ en-US ] = "~Border" ;
- };
- MetricField MTR_BORDER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 78 ) ;
- Size = MAP_APPFONT ( 40, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_COLOR_FROM
- {
- Pos = MAP_APPFONT ( 12 , 99 ) ;
- Size = MAP_APPFONT ( 32 , 8 ) ;
- Text [ en-US ] = "~From" ;
- };
- ListBox LB_COLOR_FROM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 97 ) ;
- Size = MAP_APPFONT ( 48, 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- MetricField MTR_COLOR_FROM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 113 ) ;
- Size = MAP_APPFONT ( 40, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_COLOR_TO
- {
- Pos = MAP_APPFONT ( 12 , 133 ) ;
- Size = MAP_APPFONT ( 32 , 8 ) ;
- Text [ en-US ] = "~To" ;
- };
- ListBox LB_COLOR_TO
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 131 ) ;
- Size = MAP_APPFONT ( 48, 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- MetricField MTR_COLOR_TO
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 49 , 147 ) ;
- Size = MAP_APPFONT ( 40, 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- ListBox LB_GRADIENTS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 103 , 14 ) ;
- Size = MAP_APPFONT ( 88 , 110 ) ;
- TabStop = TRUE ;
- };
- Control CTL_PREVIEW
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 103 , 131 ) ;
- Size = MAP_APPFONT ( 88 , 42 ) ;
- };
- PushButton BTN_ADD
- {
- Pos = MAP_APPFONT ( 197 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_MODIFY
- {
- Pos = MAP_APPFONT ( 197 , 32 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 197 , 68 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- ImageButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 197 , 104 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Load Gradients List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05501.bmp" ;
- };
- MASKCOLOR
- };
- };
- ImageButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 197 , 124 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Save Gradients List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05502.bmp" ;
- };
- MASKCOLOR
- };
- };
-};
- // RID_SVXPAGE_COLOR --------------------------------------------------------
-TabPage RID_SVXPAGE_COLOR
-{
- HelpId = HID_OPTIONS_COLOR ;
- Hide = TRUE ;
- Text [ en-US ] = "Colors" ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_PROP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248, 8 ) ;
- Text [ en-US ] = "Properties";
- };
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Text [ en-US ] = "~Name" ;
- };
- Edit EDT_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 14 ) ;
- Size = MAP_APPFONT ( 76 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 28 , 8 ) ;
- Text [ en-US ] = "C~olor" ;
- };
- ListBox LB_COLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 42 , 30 ) ;
- Size = MAP_APPFONT ( 76 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
-
- FixedText FT_TABLE_NAME
- {
- Pos = MAP_APPFONT ( 42 , 48 ) ;
- Size = MAP_APPFONT ( 94 , 8 ) ;
- Text [ en-US ] = "Color table" ;
- };
- Control CTL_COLORTABLE
- {
- Border = TRUE ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 42 , 59 ) ;
- Size = MAP_APPFONT ( 94 , 117 ) ;
- TabStop = TRUE ;
- };
-
- Control CTL_PREVIEW_OLD
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 157 , 14 ) ;
- Size = MAP_APPFONT ( 34 , 25 ) ;
- };
- Control CTL_PREVIEW_NEW
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 157, 39 ) ;
- Size = MAP_APPFONT ( 34 , 25 ) ;
- };
- ListBox LB_COLORMODEL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 157 , 71 ) ;
- Size = MAP_APPFONT ( 34 , 12 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "RGB" ; Default ; > ;
- < "CMYK" ; Default ; > ;
- };
- };
- FixedText FT_1
- {
- Pos = MAP_APPFONT ( 142 , 89 ) ;
- Size = MAP_APPFONT ( 15 , 8 ) ;
- Text = "~C" ;
- };
- MetricField MTR_FLD_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 157 , 87 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- };
- FixedText FT_2
- {
- Pos = MAP_APPFONT ( 142 , 105 ) ;
- Size = MAP_APPFONT ( 15 , 8 ) ;
- Text = "~M" ;
- };
- MetricField MTR_FLD_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 157 , 103 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- };
- FixedText FT_3
- {
- Pos = MAP_APPFONT ( 142 , 121 ) ;
- Size = MAP_APPFONT ( 15 , 8 ) ;
- Text = "~Y" ;
- };
- MetricField MTR_FLD_3
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 157 , 119 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- };
- FixedText FT_4
- {
- Pos = MAP_APPFONT ( 142 , 137 ) ;
- Size = MAP_APPFONT ( 15 , 8 ) ;
- Text = "~K" ;
- };
- MetricField MTR_FLD_4
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 157 , 135 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- };
- PushButton BTN_ADD
- {
- Pos = MAP_APPFONT ( 197 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add" ;
- TabStop = TRUE ;
- };
- PushButton BTN_WORK_ON
- {
- Pos = MAP_APPFONT ( 197 , 50 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 197 , 68 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_MODIFY
- {
- Pos = MAP_APPFONT ( 197, 32 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify" ;
- TabStop = TRUE ;
- };
- ImageButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 197 , 104 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Load Color List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05501.bmp" ;
- };
- MASKCOLOR
- };
- };
- ImageButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 197 , 124 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Save Color List" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05502.bmp" ;
- };
- MASKCOLOR
- };
- };
-};
- // RID_SVXDLG_AREA ----------------------------------------------------------
-TabDialog RID_SVXDLG_AREA
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 289 , 176 ) ;
- Text [ en-US ] = "Area" ;
- Moveable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_AREA ;
- Text [ en-US ] = "Area" ;
- PageResID = RID_SVXPAGE_AREA ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_SHADOW ;
- PageResID = RID_SVXPAGE_SHADOW ;
- Text [ en-US ] = "Shadow" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_TRANSPARENCE ;
- Text [ en-US ] = "Transparency";
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_COLOR ;
- Text [ en-US ] = "Colors" ;
- PageResID = RID_SVXPAGE_COLOR ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_GRADIENT ;
- Text [ en-US ] = "Gradients" ;
- PageResID = RID_SVXPAGE_GRADIENT ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_HATCH ;
- Text [ en-US ] = "Hatching" ;
- PageResID = RID_SVXPAGE_HATCH ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_BITMAP ;
- Text [ en-US ] = "Bitmaps" ;
- PageResID = RID_SVXPAGE_BITMAP ;
- };
- };
- };
-};
-
-Image RID_SVXIMG_LOAD_H
-{
- ImageBitmap = Bitmap
- {
- File = "sch05501.bmp" ;
- };
- MASKCOLOR
-};
-
-Image RID_SVXIMG_SAVE_H
-{
- ImageBitmap = Bitmap
- {
- File = "sch05502.bmp" ;
- };
- MASKCOLOR
-};
-
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/tabline.cxx b/svx/source/cui/tabline.cxx
deleted file mode 100644
index 2479a22956..0000000000
--- a/svx/source/cui/tabline.cxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabline.cxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-
-#define _SVX_TABLINE_CXX
-#include <svx/dialogs.hrc>
-#include "tabline.hrc"
-#include "dlgname.hrc"
-
-#include "cuitabarea.hxx"
-#include "cuitabline.hxx"
-#include "dlgname.hxx"
-#include <svx/dialmgr.hxx>
-#include <svx/svdmodel.hxx>
-#include <svx/xtable.hxx>
-#include "drawitem.hxx"
-
-#define DLGWIN this->GetParent()->GetParent()
-
-#define BITMAP_WIDTH 32
-#define BITMAP_HEIGHT 12
-#define XOUT_WIDTH 150
-
-/*************************************************************************
-|*
-|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
-|*
-\************************************************************************/
-
-SvxLineTabDialog::SvxLineTabDialog
-(
- Window* pParent,
- const SfxItemSet* pAttr,
- SdrModel* pModel,
- const SdrObject* pSdrObj,
- BOOL bHasObj
-) :
-
- SfxTabDialog ( pParent, SVX_RES( RID_SVXDLG_LINE ), pAttr ),
- pDrawModel ( pModel ),
- pObj ( pSdrObj ),
- rOutAttrs ( *pAttr ),
- pColorTab ( pModel->GetColorTable() ),
- mpNewColorTab ( pModel->GetColorTable() ),
- pDashList ( pModel->GetDashList() ),
- pNewDashList ( pModel->GetDashList() ),
- pLineEndList ( pModel->GetLineEndList() ),
- pNewLineEndList ( pModel->GetLineEndList() ),
- bObjSelected ( bHasObj ),
- nLineEndListState( CT_NONE ),
- nDashListState( CT_NONE ),
- mnColorTableState( CT_NONE ),
- nPageType( 0 ), // wird hier in erster Linie benutzt, um mit FillItemSet
- // die richtigen Attribute zu erhalten ( noch Fragen? )
- nDlgType( 0 ),
- nPosDashLb( 0 ),
- nPosLineEndLb( 0 ),
- mnPos( 0 ),
- mbAreaTP( sal_False ),
- mbDeleteColorTable( TRUE )
-{
- FreeResource();
-
- bool bLineOnly = false;
- if( pObj && pObj->GetObjInventor() == SdrInventor )
- {
- switch( pObj->GetObjIdentifier() )
- {
- case OBJ_LINE:
- case OBJ_PLIN:
- case OBJ_PATHLINE:
- case OBJ_FREELINE:
- case OBJ_MEASURE:
- case OBJ_EDGE:
- bLineOnly = true;
-
- default:
- break;
- }
-
- }
-
- AddTabPage( RID_SVXPAGE_LINE, SvxLineTabPage::Create, 0);
- if( bLineOnly )
- AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 );
- else
- RemoveTabPage( RID_SVXPAGE_SHADOW );
-
- AddTabPage( RID_SVXPAGE_LINE_DEF, SvxLineDefTabPage::Create, 0);
- AddTabPage( RID_SVXPAGE_LINEEND_DEF, SvxLineEndDefTabPage::Create, 0);
-// AddTabPage( RID_SVXPAGE_COLOR, SvxColorTabPage::Create, 0 );
-
- SetCurPageId( RID_SVXPAGE_LINE );
-
- CancelButton& rBtnCancel = GetCancelButton();
- rBtnCancel.SetClickHdl( LINK( this, SvxLineTabDialog, CancelHdlImpl ) );
-//! rBtnCancel.SetText( SVX_RESSTR( RID_SVXSTR_CLOSE ) );
-}
-
-// -----------------------------------------------------------------------
-
-SvxLineTabDialog::~SvxLineTabDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineTabDialog::SavePalettes()
-{
- SfxObjectShell* pShell = SfxObjectShell::Current();
- if( mpNewColorTab != pDrawModel->GetColorTable() )
- {
- if(mbDeleteColorTable)
- delete pDrawModel->GetColorTable();
- pDrawModel->SetColorTable( mpNewColorTab );
- if ( pShell )
- pShell->PutItem( SvxColorTableItem( mpNewColorTab, SID_COLOR_TABLE ) );
- pColorTab = pDrawModel->GetColorTable();
- }
- if( pNewDashList != pDrawModel->GetDashList() )
- {
- delete pDrawModel->GetDashList();
- pDrawModel->SetDashList( pNewDashList );
- if ( pShell )
- pShell->PutItem( SvxDashListItem( pNewDashList, SID_DASH_LIST ) );
- pDashList = pDrawModel->GetDashList();
- }
- if( pNewLineEndList != pDrawModel->GetLineEndList() )
- {
- delete pDrawModel->GetLineEndList();
- pDrawModel->SetLineEndList( pNewLineEndList );
- if ( pShell )
- pShell->PutItem( SvxLineEndListItem( pNewLineEndList, SID_LINEEND_LIST ) );
- pLineEndList = pDrawModel->GetLineEndList();
- }
-
- // Speichern der Tabellen, wenn sie geaendert wurden.
-
- const String aPath( SvtPathOptions().GetPalettePath() );
-
- if( nDashListState & CT_MODIFIED )
- {
- pDashList->SetPath( aPath );
- pDashList->Save();
-
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( SvxDashListItem( pDashList, SID_DASH_LIST ) );
- }
-
- if( nLineEndListState & CT_MODIFIED )
- {
- pLineEndList->SetPath( aPath );
- pLineEndList->Save();
-
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( SvxLineEndListItem( pLineEndList, SID_LINEEND_LIST ) );
- }
-
- if( mnColorTableState & CT_MODIFIED )
- {
- pColorTab->SetPath( aPath );
- pColorTab->Save();
-
- // ToolBoxControls werden benachrichtigt:
- if ( pShell )
- pShell->PutItem( SvxColorTableItem( pColorTab, SID_COLOR_TABLE ) );
- }
-}
-
-// -----------------------------------------------------------------------
-
-short SvxLineTabDialog::Ok()
-{
- SavePalettes();
-
- // Es wird RET_OK zurueckgeliefert, wenn wenigstens eine
- // TabPage in FillItemSet() TRUE zurueckliefert. Dieses
- // geschieht z.Z. standardmaessig.
- return( SfxTabDialog::Ok() );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxLineTabDialog, CancelHdlImpl, void *, EMPTYARG )
-{
- SavePalettes();
-
- EndDialog( RET_CANCEL );
- return 0;
-}
-IMPL_LINK_INLINE_END( SvxLineTabDialog, CancelHdlImpl, void *, EMPTYARG )
-
-// -----------------------------------------------------------------------
-
-void SvxLineTabDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
-{
- switch( nId )
- {
- case RID_SVXPAGE_LINE:
- ( (SvxLineTabPage&) rPage ).SetColorTable( pColorTab );
- ( (SvxLineTabPage&) rPage ).SetDashList( pDashList );
- ( (SvxLineTabPage&) rPage ).SetLineEndList( pLineEndList );
- ( (SvxLineTabPage&) rPage ).SetDlgType( nDlgType );//CHINA001 ( (SvxLineTabPage&) rPage ).SetDlgType( &nDlgType );
- ( (SvxLineTabPage&) rPage ).SetPageType( nPageType );//CHINA001 ( (SvxLineTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
- ( (SvxLineTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
- ( (SvxLineTabPage&) rPage ).SetDashChgd( &nDashListState );
- ( (SvxLineTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
- ( (SvxLineTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineTabPage&) rPage ).Construct();
- ( (SvxLineTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- // ActivatePage() wird das erste mal nicht gerufen
- ( (SvxLineTabPage&) rPage ).ActivatePage( rOutAttrs );
- break;
-
- case RID_SVXPAGE_LINE_DEF:
- ( (SvxLineDefTabPage&) rPage ).SetDashList( pDashList );
- ( (SvxLineDefTabPage&) rPage ).SetDlgType( &nDlgType );
- ( (SvxLineDefTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineDefTabPage&) rPage ).SetPosDashLb( &nPosDashLb );
- ( (SvxLineDefTabPage&) rPage ).SetDashChgd( &nDashListState );
- ( (SvxLineDefTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineDefTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_LINEEND_DEF:
- ( (SvxLineEndDefTabPage&) rPage ).SetLineEndList( pLineEndList );
- ( (SvxLineEndDefTabPage&) rPage ).SetPolyObj( pObj );
- ( (SvxLineEndDefTabPage&) rPage ).SetDlgType( &nDlgType );
- ( (SvxLineEndDefTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxLineEndDefTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb );
- ( (SvxLineEndDefTabPage&) rPage ).SetLineEndChgd( &nLineEndListState );
- ( (SvxLineEndDefTabPage&) rPage ).SetObjSelected( bObjSelected );
- ( (SvxLineEndDefTabPage&) rPage ).Construct();
- break;
-
- case RID_SVXPAGE_SHADOW:
- {
- ( (SvxShadowTabPage&) rPage ).SetColorTable( pColorTab );
- ( (SvxShadowTabPage&) rPage ).SetPageType( nPageType );
- ( (SvxShadowTabPage&) rPage ).SetDlgType( nDlgType );
- ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxShadowTabPage&) rPage ).Construct();
- }
- break;
-/*
- case RID_SVXPAGE_COLOR:
- ( (SvxColorTabPage&) rPage ).SetColorTable( pColorTab );
- ( (SvxColorTabPage&) rPage ).SetPageType( &nPageType );
- ( (SvxColorTabPage&) rPage ).SetDlgType( &nDlgType );
- ( (SvxColorTabPage&) rPage ).SetPos( &mnPos );
- ( (SvxColorTabPage&) rPage ).SetAreaTP( &mbAreaTP );
- ( (SvxColorTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxColorTabPage&) rPage ).SetDeleteColorTable( mbDeleteColorTable );
- ( (SvxColorTabPage&) rPage ).Construct();
- break;
-*/
- }
-}
-
-
diff --git a/svx/source/cui/tabline.hrc b/svx/source/cui/tabline.hrc
deleted file mode 100644
index 1d35fc6f26..0000000000
--- a/svx/source/cui/tabline.hrc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabline.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define TAB_CONTROL 1
-#define LB_COLOR 1
-#define FT_COLOR 1
-#define LB_LINE_STYLE 2
-#define FT_LINE_STYLE 3
-#define FT_LINE_WIDTH 2
-#define MTR_FLD_LINE_WIDTH 1
-#define TSB_INVISIBLE 1
-#define FL_LINE 1
-#define FL_LINE_ENDS 2
-#define FT_LINE_START 4
-#define FT_LINE_END 8
-#define FT_LINE_ENDS_STYLE 5
-#define FT_LINE_ENDS_WIDTH 6
-#define LB_START_STYLE 3
-#define LB_END_STYLE 4
-#define MTR_FLD_START_WIDTH 3
-#define MTR_FLD_END_WIDTH 2
-#define CBX_SYNCHRONIZE 1
-#define FL_MEASURING 3
-#define CTL_POSITION 2
-#define FT_POSITION 9
-#define TSB_SHOW_MEASURING 2
-#define CTL_PREVIEW 1
-#define FL_DEFINITION 1
-#define FT_NUMBER 3
-#define FT_DISTANCE 2
-#define FT_LENGTH 4
-#define TSB_SYNCHRONIZE 3
-#define LB_TYPE_1 3
-#define FT_TYPE 1
-#define LB_TYPE_2 1
-#define NUM_FLD_1 1
-#define NUM_FLD_2 2
-#define MTR_FLD_DISTANCE 1
-#define MTR_FLD_LENGTH_1 3
-#define MTR_FLD_LENGTH_2 4
-#define FT_LINESTYLE 10
-#define LB_LINESTYLES 2
-#define BTN_ADD 1
-#define BTN_MODIFY 2
-#define BTN_DELETE 3
-#define BTN_LOAD 5
-#define BTN_SAVE 6
-#define EDT_NAME 1
-#define LB_LINEENDS 1
-#define FL_TIP 1
-#define FI_TIP 10
-#define TSB_CENTER_START 4
-#define TSB_CENTER_END 5
-#define FT_TRANSPARENT 10
-#define MTR_LINE_TRANSPARENT 5
-#define FL_SEPARATOR 4
-#define FT_LINE_END_STYLE 11
-#define FT_TITLE 12
-
-// #116827#
-#define FL_EDGE_STYLE 5
-#define FT_EDGE_STYLE 13
-#define LB_EDGE_STYLE 5
-
-//Symbole (fuer StarChart)
-#define FT_SYMBOL_WIDTH 20
-#define FT_SYMBOL_HEIGHT 21
-#define MF_SYMBOL_WIDTH 22
-#define MF_SYMBOL_HEIGHT 23
-#define CB_SYMBOL_RATIO 24
-#define FL_SYMBOL_FORMAT 25
-#define MB_SYMBOL_BITMAP 26
-
-
-#define MN_GRAPHIC_DLG 1
-#define MN_GALLERY 2
-#define MN_SYMBOLS 3
-#define MN_SYMBOLS_NONE 4
-#define MN_SYMBOLS_AUTO 5
-#define MN_GALLERY_ENTRY 100
-
-
diff --git a/svx/source/cui/tabline.src b/svx/source/cui/tabline.src
deleted file mode 100644
index 18275630c9..0000000000
--- a/svx/source/cui/tabline.src
+++ /dev/null
@@ -1,803 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabline.src,v $
- * $Revision: 1.45 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ------------------------------------------------------------------
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "tabline.hrc"
-
-// Selecting LineStyle / Color / Width --------------------
-
-#define MASKCOLOR MaskColor = Color{ Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
-
-
-TabPage RID_SVXPAGE_LINE
-{
- Size = MAP_APPFONT ( 260 , 185 );
- HelpId = HID_LINE_LINE ;
- Hide = TRUE ;
- Text [ en-US ] = "Lines" ;
- FixedLine FL_LINE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Line properties" ;
- };
- FixedText FT_LINE_STYLE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "~Style" ;
- };
- ListBox LB_LINE_STYLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 100 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedText FT_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 41 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "Colo~r" ;
- };
- ListBox LB_COLOR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 52 ) ;
- Size = MAP_APPFONT ( 100 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedText FT_LINE_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 68 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "~Width" ;
- };
- MetricField MTR_FLD_LINE_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 79 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 5000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Value = 1 ;
- Unit = FUNIT_MM ;
- Last = 5000 ;
- SpinSize = 10 ;
- };
- FixedText FT_TRANSPARENT
- {
- Pos = MAP_APPFONT ( 12 , 95 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "~Transparency" ;
- };
- MetricField MTR_LINE_TRANSPARENT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 106 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedLine FL_SEPARATOR
- {
- Pos = MAP_APPFONT ( 118 , 14 ) ;
- Size = MAP_APPFONT ( 6 , 111 ) ;
- Vert = TRUE;
- };
- FixedLine FL_LINE_ENDS
- {
- Pos = MAP_APPFONT ( 124 , 3 ) ;
- Size = MAP_APPFONT ( 130 , 8 ) ;
- Text [ en-US ] = "Arrow styles" ;
- };
- FixedText FT_LINE_ENDS_STYLE
- {
- Pos = MAP_APPFONT ( 130 , 14 ) ;
- Size = MAP_APPFONT ( 118 , 8 ) ;
- Text [ en-US ] = "St~yle" ;
- };
- ListBox LB_START_STYLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 25 ) ;
- Size = MAP_APPFONT ( 57 , 99 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- ListBox LB_END_STYLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 191 , 25 ) ;
- Size = MAP_APPFONT ( 57 , 100 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- FixedText FT_LINE_ENDS_WIDTH
- {
- Pos = MAP_APPFONT ( 130 , 41 ) ;
- Size = MAP_APPFONT ( 118 , 8 ) ;
- Text [ en-US ] = "Wi~dth" ;
- };
- MetricField MTR_FLD_START_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 52 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 5000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Value = 1 ;
- Unit = FUNIT_MM ;
- Last = 5000 ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_END_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 191 , 52 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 5000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Value = 1 ;
- Unit = FUNIT_MM ;
- Last = 5000 ;
- SpinSize = 10 ;
- };
- TriStateBox TSB_CENTER_START
- {
- Pos = MAP_APPFONT ( 130 , 68 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
- Text [ en-US ] = "Ce~nter" ;
- TabStop = TRUE ;
- };
- TriStateBox TSB_CENTER_END
- {
- Pos = MAP_APPFONT ( 191 , 68 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
- Text [ en-US ] = "C~enter" ;
- TabStop = TRUE ;
- };
- CheckBox CBX_SYNCHRONIZE
- {
- // #116827#
- // Pos = MAP_APPFONT ( 130 , 107 ) ;
- Pos = MAP_APPFONT ( 130 , 68 + (16 - 4) ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Synchroni~ze ends" ;
- TabStop = TRUE ;
- };
-
- //////////////////////////////////////////////////////////////////////////////
- // #116827#
-
- FixedLine FL_EDGE_STYLE
- {
- Pos = MAP_APPFONT ( 124 , 3 + (16 * 6) - 4 ) ;
- Size = MAP_APPFONT ( 130 , 8 ) ;
- Text [ en-US ] = "Corner style" ;
- };
- FixedText FT_EDGE_STYLE
- {
- Pos = MAP_APPFONT ( 130 , 14 + (16 * 6) - 4 ) ;
- Size = MAP_APPFONT ( 118 , 8 ) ;
- Text [ en-US ] = "Sty~le" ;
- };
- ListBox LB_EDGE_STYLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 25 + (16 * 6) - 4 ) ;
- Size = MAP_APPFONT ( 57 , 99 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Rounded" ; Default ; > ;
- < "- none -" ; > ;
- < "Mitered" ; > ;
- < "Beveled" ; > ;
- };
- };
-
- //////////////////////////////////////////////////////////////////////////////
-
- Control CTL_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 135 ) ;
- Size = MAP_APPFONT ( 248 , 40 ) ;
- };
-
- //#58425# Symbole auf einer Linie (z.B. StarChart) ->
- FixedLine FL_SYMBOL_FORMAT
- {
- Hide = TRUE ;
-
- Pos = MAP_APPFONT ( 124 , 3 ) ;
- Size = MAP_APPFONT ( 130 , 8 ) ;
- Text [ en-US ] = "Icon";
- };
-
- MenuButton MB_SYMBOL_BITMAP
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 130 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- ButtonMenu = Menu
- {
- ItemList =
- {
- MenuItem
- {
- Identifier = MN_SYMBOLS_NONE;
- Text [ en-US ] = "No Symbol";
- };
- MenuItem
- {
- Identifier = MN_SYMBOLS_AUTO;
- Text [ en-US ] = "Automatic";
- };
- MenuItem
- {
- Identifier = MN_GRAPHIC_DLG ;
- Text [ en-US ] = "From file..." ;
- };
- MenuItem
- {
- Identifier = MN_GALLERY ;
- Text [ en-US ] = "Gallery";
- };
- MenuItem
- {
- Identifier = MN_SYMBOLS;
- Text [ en-US ] = "Symbols";
- };
- };
- };
- Text [ en-US ] = "Select..." ;
- };
- FixedText FT_SYMBOL_WIDTH
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 130 , 32 ) ;
- Size = MAP_APPFONT ( 57 , 8 ) ;
- Text [ en-US ] = "Width" ;
- };
- MetricField MF_SYMBOL_WIDTH
- {
- Pos = MAP_APPFONT ( 191 , 30 );
- Size = MAP_APPFONT ( 57 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Hide = TRUE ;
- };
- FixedText FT_SYMBOL_HEIGHT
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 130 , 48 ) ;
- Size = MAP_APPFONT ( 57 , 8 ) ;
- Text [ en-US ] = "Height" ;
- };
- MetricField MF_SYMBOL_HEIGHT
- {
- Pos = MAP_APPFONT ( 191 , 46 );
- Size = MAP_APPFONT ( 57 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 1999 ;
- DecimalDigits = 2 ;
- Value = 0 ;
- Unit = FUNIT_CM ;
- First = 0 ;
- Last = 1999 ;
- SpinSize = 5 ;
- Hide = TRUE ;
- };
- CheckBox CB_SYMBOL_RATIO
- {
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 130 , 62 );
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Keep ratio" ;
- };
-};
-
-// Defining LineStyles --------------------
-
-TabPage RID_SVXPAGE_LINE_DEF
-{
- Size = MAP_APPFONT ( 260 , 185 ) ;
- HelpId = HID_LINE_DEF ;
- Hide = TRUE ;
- Text [ en-US ] = "Define line styles" ;
-
- FixedLine FL_DEFINITION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Properties" ;
- };
- FixedText FT_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 34 ) ;
- Size = MAP_APPFONT ( 52 , 8 ) ;
- Text [ en-US ] = "~Type" ;
- };
- ListBox LB_TYPE_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 66 , 32 ) ;
- Size = MAP_APPFONT ( 43 , 49 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Dot" ; Default ; > ;
- < "Dash" ; Default ; > ;
- };
- };
- ListBox LB_TYPE_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 113 , 32 ) ;
- Size = MAP_APPFONT ( 43 , 49 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "Dot" ; Default ; > ;
- < "Dash" ; Default ; > ;
- };
- };
- FixedText FT_NUMBER
- {
- Pos = MAP_APPFONT ( 12 , 50 ) ;
- Size = MAP_APPFONT ( 52 , 8 ) ;
- Text [ en-US ] = "~Number" ;
- };
- NumericField NUM_FLD_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 66 , 48 ) ;
- Size = MAP_APPFONT ( 43 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 99 ;
- StrictFormat = TRUE ;
- Last = 99 ;
- SpinSize = 1 ;
- };
- NumericField NUM_FLD_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 113 , 48 ) ;
- Size = MAP_APPFONT ( 43 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 99 ;
- StrictFormat = TRUE ;
- Last = 99 ;
- SpinSize = 1 ;
- };
- FixedText FT_LENGTH
- {
- Pos = MAP_APPFONT ( 12 , 66 ) ;
- Size = MAP_APPFONT ( 52 , 8 ) ;
- Text [ en-US ] = "~Length" ;
- };
- MetricField MTR_FLD_LENGTH_1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 66 , 64 ) ;
- Size = MAP_APPFONT ( 43 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- First = 1 ;
- Maximum = 5000 ;
- Last = 5000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Value = 1 ;
- Unit = FUNIT_MM ;
- CustomUnitText = " %" ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_LENGTH_2
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 113 , 64 ) ;
- Size = MAP_APPFONT ( 43 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- First = 1 ;
- Maximum = 5000 ;
- Last = 5000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Value = 1 ;
- Unit = FUNIT_MM ;
- CustomUnitText = " %" ;
- SpinSize = 10 ;
- };
- FixedText FT_DISTANCE
- {
- Pos = MAP_APPFONT ( 12 , 81 ) ;
- Size = MAP_APPFONT ( 52 , 8 ) ;
- Text [ en-US ] = "~Spacing" ;
- };
- MetricField MTR_FLD_DISTANCE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 66 , 79 ) ;
- Size = MAP_APPFONT ( 43 , 12 ) ;
- TabStop = TRUE ;
- Right = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 5000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Value = 1 ;
- Unit = FUNIT_MM ;
- CustomUnitText = " %" ;
- Last = 5000 ;
- SpinSize = 10 ;
- };
- CheckBox CBX_SYNCHRONIZE
- {
- Pos = MAP_APPFONT ( 12 , 95 ) ;
- Size = MAP_APPFONT ( 174 , 10 ) ;
- Text [ en-US ] = "~Fit to line width" ;
- TabStop = TRUE ;
- };
-
- // ----------------------------------------
-
- FixedText FT_LINESTYLE
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 52 , 8 ) ;
- Text [ en-US ] = "Line style" ;
- };
- ListBox LB_LINESTYLES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 66 , 14 ) ;
- Size = MAP_APPFONT ( 120 , 80 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- PushButton BTN_ADD
- {
- Pos = MAP_APPFONT ( 198 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_MODIFY
- {
- Pos = MAP_APPFONT ( 198 , 34 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 198 , 54 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- ImageButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 198 , 74 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Load Line Styles" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05501.bmp" ;
- };
- MASKCOLOR
- };
- };
- ImageButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 198 , 96 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Save Line Styles" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05502.bmp" ;
- };
- MASKCOLOR
- };
- };
- Control CTL_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 135 ) ;
- Size = MAP_APPFONT ( 248 , 40 ) ;
- };
-
-};
-
-// Defining LineEnds --------------------
-
-TabPage RID_SVXPAGE_LINEEND_DEF
-{
- Size = MAP_APPFONT ( 260 , 185 ) ;
- HelpId = HID_LINE_ENDDEF ;
- Hide = TRUE ;
- Text [ en-US ] = "Arrowheads" ;
-
- FixedLine FL_TIP
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Organize arrow styles" ;
- };
- FixedText FI_TIP
- {
- Pos = MAP_APPFONT ( 6 , 123 ) ;
- Size = MAP_APPFONT ( 252 , 8 ) ;
- Text [ en-US ] = "Add a selected object to create new arrow styles." ;
- WordBreak = TRUE ;
- };
-
- FixedText FT_LINE_END_STYLE
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 84 , 8 ) ;
- Text [ en-US ] = "Arrow style" ;
- };
- Edit EDT_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 98 , 14 ) ;
- Size = MAP_APPFONT ( 87 , 12 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_TITLE
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 84 , 8 ) ;
- Text [ en-US ] = "~Title" ;
- };
- ListBox LB_LINEENDS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 98 , 30 ) ;
- Size = MAP_APPFONT ( 87 , 80 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- PushButton BTN_ADD
- {
- Pos = MAP_APPFONT ( 198 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_MODIFY
- {
- Pos = MAP_APPFONT ( 198 , 34 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify..." ;
- TabStop = TRUE ;
- };
- PushButton BTN_DELETE
- {
- Pos = MAP_APPFONT ( 198 , 54 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete..." ;
- TabStop = TRUE ;
- };
- ImageButton BTN_LOAD
- {
- Pos = MAP_APPFONT ( 198 , 74 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Load Arrow Styles" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05501.bmp" ;
- };
- MASKCOLOR
- };
- };
- ImageButton BTN_SAVE
- {
- Pos = MAP_APPFONT ( 198 , 96 ) ;
- Size = MAP_APPFONT ( 16 , 16 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Save Arrow Styles" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap
- {
- File = "sc05502.bmp" ;
- };
- MASKCOLOR
- };
- };
-
- Control CTL_PREVIEW
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 135 ) ;
- Size = MAP_APPFONT ( 248 , 40 ) ;
- };
-
-};
- // RID_SVXDLG_LINE ----------------------------------------------------------
-TabDialog RID_SVXDLG_LINE
-{
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 289 , 176 ) ;
- Text [ en-US ] = "Line" ;
- Moveable = TRUE ;
- TabControl TAB_CONTROL
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXPAGE_LINE ;
- Text [ en-US ] = "Line" ;
- PageResID = RID_SVXPAGE_LINE ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_SHADOW ;
- PageResID = RID_SVXPAGE_SHADOW ;
- Text [ en-US ] = "Shadow" ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_LINE_DEF ;
- Text [ en-US ] = "Line Styles" ;
- PageResID = RID_SVXPAGE_LINE_DEF ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_LINEEND_DEF ;
- Text [ en-US ] = "Arrow Styles" ;
- PageResID = RID_SVXPAGE_LINEEND_DEF ;
- };
-/*
- PageItem
- {
- Identifier = RID_SVXPAGE_COLOR ;
- Text [ en-US ] = "Colors" ;
- PageResID = RID_SVXPAGE_COLOR ;
- };
-*/
- };
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/tabstpge.cxx b/svx/source/cui/tabstpge.cxx
deleted file mode 100644
index 24a4a1ba90..0000000000
--- a/svx/source/cui/tabstpge.cxx
+++ /dev/null
@@ -1,755 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabstpge.cxx,v $
- * $Revision: 1.27 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-
-#include <sfx2/app.hxx>
-#include <tools/shl.hxx>
-#include <svtools/ruler.hxx>
-
-#define _SVX_TABSTPGE_CXX
-
-#include <svx/dialogs.hrc>
-#include "tabstpge.hrc"
-
-#include <svx/lrspitem.hxx>
-#include "tabstpge.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <sfx2/module.hxx>
-#include <svtools/cjkoptions.hxx>
-#include <unotools/localedatawrapper.hxx>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-#include <sfx2/request.hxx> //CHINA001
-#include <svx/svxids.hrc> //add CHINA001
-#include <svtools/intitem.hxx> //add CHINA001
-
-
-// class TabWin_Impl -----------------------------------------------------
-
-class TabWin_Impl : public Window
-{
-private:
- USHORT nTabStyle;
-
-public:
- TabWin_Impl( Window* pParent, const ResId& rId, USHORT nStyle ) :
- Window( pParent, rId ),
- nTabStyle( nStyle ) {}
-
- virtual void Paint( const Rectangle& rRect );
-};
-
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_ATTR_TABSTOP,
- SID_ATTR_TABSTOP_OFFSET,
- 0
-};
-
-// C-Funktion ------------------------------------------------------------
-
-void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs )
-{
- if( rTabs.Count() )
- return;
- {
- SvxTabStop aSwTabStop( nDefDist, SVX_TAB_ADJUST_DEFAULT );
- rTabs.Insert( aSwTabStop );
- }
-}
-
-// class TabWin_Impl -----------------------------------------------------
-
-void TabWin_Impl::Paint( const Rectangle& )
-{
- // Tabulatoren malen
- Point aPnt;
- Size aSize = GetOutputSizePixel();
- aPnt.X() = aSize.Width() / 2;
- aPnt.Y() = aSize.Height() / 2;
- Ruler::DrawTab( this, aPnt, nTabStyle );
-}
-
-// class SvxTabulatorTabPage ---------------------------------------------
-
-SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
- const SfxItemSet& rAttr ):
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_TABULATOR ), rAttr ),
-
- aTabBox ( this, SVX_RES( ED_TABPOS ) ),
- aTabLabel ( this, SVX_RES( FL_TABPOS ) ),
- aTabLabelVert ( this, SVX_RES( FL_TABPOS_VERT ) ),
- aLeftTab ( this, SVX_RES( BTN_TABTYPE_LEFT ) ),
- aRightTab ( this, SVX_RES( BTN_TABTYPE_RIGHT ) ),
- aCenterTab ( this, SVX_RES( BTN_TABTYPE_CENTER ) ),
- aDezTab ( this, SVX_RES( BTN_TABTYPE_DECIMAL ) ),
- pLeftWin ( new TabWin_Impl( this, SVX_RES( WIN_TABLEFT ), (USHORT)(RULER_TAB_LEFT|WB_HORZ) ) ),
- pRightWin ( new TabWin_Impl( this, SVX_RES( WIN_TABRIGHT ), (USHORT)(RULER_TAB_RIGHT|WB_HORZ) ) ),
- pCenterWin ( new TabWin_Impl( this, SVX_RES( WIN_TABCENTER ), (USHORT)(RULER_TAB_CENTER|WB_HORZ) ) ),
- pDezWin ( new TabWin_Impl( this, SVX_RES( WIN_TABDECIMAL ), (USHORT)(RULER_TAB_DECIMAL|WB_HORZ) ) ),
- aDezCharLabel ( this, SVX_RES( FT_TABTYPE_DECCHAR ) ),
- aDezChar ( this, SVX_RES( ED_TABTYPE_DECCHAR ) ),
- aTabTypeLabel ( this, SVX_RES( FL_TABTYPE ) ),
- aNoFillChar ( this, SVX_RES( BTN_FILLCHAR_NO ) ),
- aFillPoints ( this, SVX_RES( BTN_FILLCHAR_POINTS ) ),
- aFillDashLine ( this, SVX_RES( BTN_FILLCHAR_DASHLINE ) ),
- aFillSolidLine ( this, SVX_RES( BTN_FILLCHAR_UNDERSCORE ) ),
- aFillSpecial ( this, SVX_RES( BTN_FILLCHAR_OTHER ) ),
- aFillChar ( this, SVX_RES( ED_FILLCHAR_OTHER ) ),
- aFillLabel ( this, SVX_RES( FL_FILLCHAR ) ),
- aNewBtn ( this, SVX_RES( BTN_NEW ) ),
- aDelAllBtn ( this, SVX_RES( BTN_DELALL ) ),
- aDelBtn ( this, SVX_RES( BTN_DEL ) ),
-
- aAktTab ( 0 ),
- aNewTabs ( 0, 0, SVX_TAB_ADJUST_LEFT, GetWhich( SID_ATTR_TABSTOP ) ),
- nDefDist ( 0 ),
- eDefUnit( FUNIT_100TH_MM ),
- bCheck ( FALSE )
-
-{
- SvtCJKOptions aCJKOptions;
- if(aCJKOptions.IsAsianTypographyEnabled())
- {
- aLeftTab .SetText(String(SVX_RES( ST_LEFTTAB_ASIAN )));
- aRightTab .SetText(String(SVX_RES( ST_RIGHTTAB_ASIAN )));
- }
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
-
- // Metrik einstellen
- FieldUnit eFUnit = GetModuleFieldUnit( &rAttr );
- SetFieldUnit( aTabBox, eFUnit );
-
- // Buttons initialisieren
- aNewBtn.SetClickHdl( LINK( this,SvxTabulatorTabPage, NewHdl_Impl ) );
- aDelBtn.SetClickHdl( LINK( this,SvxTabulatorTabPage, DelHdl_Impl ) );
- aDelAllBtn.SetClickHdl( LINK( this,SvxTabulatorTabPage, DelAllHdl_Impl ) );
-
- Link aLink = LINK( this, SvxTabulatorTabPage, TabTypeCheckHdl_Impl );
- aLeftTab.SetClickHdl( aLink );
- aRightTab.SetClickHdl( aLink );
- aDezTab.SetClickHdl( aLink );
- aCenterTab.SetClickHdl( aLink );
-
- aDezChar.SetLoseFocusHdl( LINK( this, SvxTabulatorTabPage, GetDezCharHdl_Impl ) );
- aDezChar.SetMaxTextLen(1);
- aDezChar.Disable();
- aDezCharLabel.Disable();
-
- aLink = LINK( this, SvxTabulatorTabPage, FillTypeCheckHdl_Impl );
- aNoFillChar.SetClickHdl( aLink );
- aFillPoints.SetClickHdl( aLink );
- aFillDashLine.SetClickHdl( aLink );
- aFillSolidLine.SetClickHdl( aLink );
- aFillSpecial.SetClickHdl( aLink );
- aFillChar.SetLoseFocusHdl( LINK( this, SvxTabulatorTabPage, GetFillCharHdl_Impl ) );
- aFillChar.SetMaxTextLen(1);
- aFillChar.Disable();
-
- aTabBox.SetDoubleClickHdl( LINK( this, SvxTabulatorTabPage, SelectHdl_Impl ) );
- aTabBox.SetModifyHdl( LINK( this, SvxTabulatorTabPage, ModifyHdl_Impl ) );
-
- // das Default-Dezimalzeichen vom System holen
- LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep().GetChar(0);
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxTabulatorTabPage::~SvxTabulatorTabPage()
-{
- delete pLeftWin;
- delete pRightWin;
- delete pCenterWin;
- delete pDezWin;
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxTabulatorTabPage::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxTabulatorTabPage::FillItemSet( SfxItemSet& rSet )
-{
- BOOL bModified = FALSE;
-
- // Hier die Werte aus den Controls eintueten
- if ( aNewBtn.IsEnabled() )
- NewHdl_Impl( 0 );
-
- // call at first the LoseFocus-Handler
- GetDezCharHdl_Impl( &aDezChar );
- GetFillCharHdl_Impl( &aFillChar );
-
- FillUpWithDefTabs_Impl( nDefDist, aNewTabs );
- SfxItemPool* pPool = rSet.GetPool();
- MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
- const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_TABSTOP );
-
- if ( MAP_100TH_MM != eUnit )
- {
- // Wenn sich im ItemSet ein LRSpaceItem mit negativen Erstzeileneinzug
- // befindet, muss im TabStopItem auf der Position 0 ein DefTab sein.
- const SfxPoolItem* pLRSpace;
- // wenn nicht im neuen Set, dann vielleicht im alten
- if ( SFX_ITEM_SET !=
- rSet.GetItemState( GetWhich( SID_ATTR_LRSPACE ), TRUE, &pLRSpace ) )
- pLRSpace = GetOldItem( rSet, SID_ATTR_LRSPACE );
-
- if ( pLRSpace && ( (SvxLRSpaceItem*)pLRSpace )->GetTxtFirstLineOfst() < 0 )
- {
- SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT );
- aNewTabs.Insert( aNull );
- }
-
- SvxTabStopItem aTmp( aNewTabs );
- aTmp.Remove( 0, aTmp.Count() );
-
- for ( USHORT i = 0; i < aNewTabs.Count(); ++i )
- {
- SvxTabStop aTmpStop = aNewTabs[i];
- aTmpStop.GetTabPos() =
- LogicToLogic( aTmpStop.GetTabPos(), MAP_100TH_MM, eUnit );
- aTmp.Insert( aTmpStop );
- }
-
- if ( !pOld || !( *( (SvxTabStopItem*)pOld ) == aTmp ) )
- {
- rSet.Put( aTmp );
- bModified = TRUE;
- }
- }
- else if ( !pOld || !( *( (SvxTabStopItem*)pOld ) == aNewTabs ) )
- {
- rSet.Put( aNewTabs );
- bModified = TRUE;
- }
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxTabulatorTabPage::Create( Window* pParent,
- const SfxItemSet& rSet)
-{
- return ( new SvxTabulatorTabPage( pParent, rSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxTabulatorTabPage::Reset( const SfxItemSet& rSet )
-{
- SfxItemPool* pPool = rSet.GetPool();
- MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
-
- // Aktuelle Tabs
- const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_TABSTOP );
-
- if ( pItem )
- {
- if ( MAP_100TH_MM != eUnit )
- {
- SvxTabStopItem aTmp( *( (const SvxTabStopItem*)pItem ) );
- aNewTabs.Remove( 0, aNewTabs.Count() );
-
- for ( USHORT i = 0; i < aTmp.Count(); ++i )
- {
- SvxTabStop aTmpStop = aTmp[i];
- aTmpStop.GetTabPos() =
- LogicToLogic( aTmpStop.GetTabPos(), eUnit, MAP_100TH_MM );
- aNewTabs.Insert( aTmpStop );
- }
- }
- else
- aNewTabs = *( (const SvxTabStopItem*)pItem );
- }
- else
- aNewTabs.Remove( 0, aNewTabs.Count() );
-
- // Default-Tab - Abstand
- nDefDist = SVX_TAB_DEFDIST;
- pItem = GetItem( rSet, SID_ATTR_TABSTOP_DEFAULTS );
-
- if ( pItem )
- nDefDist = LogicToLogic(
- (long)((const SfxUInt16Item*)pItem)->GetValue(), eUnit, MAP_100TH_MM );
-
- // Aktuell selektierte Tab-Pos
- USHORT nTabPos = 0;
- pItem = GetItem( rSet, SID_ATTR_TABSTOP_POS );
-
- if ( pItem )
- nTabPos = ( (const SfxUInt16Item*)pItem )->GetValue();
-
- InitTabPos_Impl( nTabPos );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxTabulatorTabPage::DisableControls( const USHORT nFlag )
-{
- if ( ( TABTYPE_LEFT & nFlag ) == TABTYPE_LEFT )
- {
- aLeftTab.Disable();
- pLeftWin->Disable();
- }
- if ( ( TABTYPE_RIGHT & nFlag ) == TABTYPE_RIGHT )
- {
- aRightTab.Disable();
- pRightWin->Disable();
- }
- if ( ( TABTYPE_CENTER & nFlag ) == TABTYPE_CENTER )
- {
- aCenterTab.Disable();
- pCenterWin->Disable();
- }
- if ( ( TABTYPE_DEZIMAL & nFlag ) == TABTYPE_DEZIMAL )
- {
- aDezTab.Disable();
- pDezWin->Disable();
- aDezCharLabel.Disable();
- aDezChar.Disable();
- }
- if ( ( TABTYPE_ALL & nFlag ) == TABTYPE_ALL )
- aTabTypeLabel.Disable();
- if ( ( TABFILL_NONE & nFlag ) == TABFILL_NONE )
- aNoFillChar.Disable();
- if ( ( TABFILL_POINT & nFlag ) == TABFILL_POINT )
- aFillPoints.Disable();
- if ( ( TABFILL_DASHLINE & nFlag ) == TABFILL_DASHLINE )
- aFillDashLine.Disable();
- if ( ( TABFILL_SOLIDLINE & nFlag ) == TABFILL_SOLIDLINE )
- aFillSolidLine.Disable();
- if ( ( TABFILL_SPECIAL & nFlag ) == TABFILL_SPECIAL )
- {
- aFillSpecial.Disable();
- aFillChar.Disable();
- }
- if ( ( TABFILL_ALL & nFlag ) == TABFILL_ALL )
- aFillLabel.Disable();
-}
-
-// -----------------------------------------------------------------------
-
-int SvxTabulatorTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( _pSet )
- FillItemSet( *_pSet );
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxTabulatorTabPage::InitTabPos_Impl( USHORT nTabPos )
-{
- aTabBox.Clear();
-
- long nOffset = 0;
- const SfxPoolItem* pItem = 0;
- if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, TRUE, &pItem )
- == SFX_ITEM_SET )
- {
- nOffset = ( (const SfxInt32Item*)pItem )->GetValue();
- MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
- nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM );
- }
-
- // Aktuelle TabPos korrigieren und Defaults-Tabs
- for ( USHORT i = 0; i < aNewTabs.Count(); i++ )
- {
- if ( aNewTabs[i].GetAdjustment() != SVX_TAB_ADJUST_DEFAULT )
- {
- aTabBox.InsertValue( aTabBox.Normalize(
- aNewTabs[i].GetTabPos() + nOffset ), eDefUnit );
- }
- else
- aNewTabs.Remove( i-- );
- }
-
- // aktuellen Tabulator auswaehlen
- const USHORT nSize = aNewTabs.Count();
-
- if ( nTabPos >= nSize )
- nTabPos = 0;
-
- // alle RadioButtons erstmal ausschalten
- aLeftTab.Check( TRUE );
- aNoFillChar.Check( TRUE );
-
- if( aTabBox.GetEntryCount() > 0 )
- {
- aTabBox.SetText( aTabBox.GetEntry( nTabPos ) );
- aAktTab = aNewTabs[nTabPos];
-
- SetFillAndTabType_Impl();
- aNewBtn.Disable();
- aDelBtn.Enable();
- }
- else
- { // kein Eintrag dann ist 0 der Default-Wert
- aTabBox.SetValue( 0, eDefUnit );
-
- aNewBtn.Enable();
- aDelBtn.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxTabulatorTabPage::SetFillAndTabType_Impl()
-{
- RadioButton* pTypeBtn = 0;
- RadioButton* pFillBtn = 0;
-
- aDezChar.Disable();
- aDezCharLabel.Disable();
-
- if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_LEFT )
- pTypeBtn = &aLeftTab;
- else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_RIGHT )
- pTypeBtn = &aRightTab;
- else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL )
- {
- pTypeBtn = &aDezTab;
- aDezChar.Enable();
- aDezCharLabel.Enable();
- aDezChar.SetText( String( (sal_Unicode)aAktTab.GetDecimal() ) );
- }
- else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_CENTER )
- pTypeBtn = &aCenterTab;
-
- if ( pTypeBtn )
- pTypeBtn->Check();
-
- aFillChar.Disable();
- aFillChar.SetText( String() );
-
- if ( aAktTab.GetFill() == ' ' )
- pFillBtn = &aNoFillChar;
- else if ( aAktTab.GetFill() == '-' )
- pFillBtn = &aFillDashLine;
- else if ( aAktTab.GetFill() == '_' )
- pFillBtn = &aFillSolidLine;
- else if ( aAktTab.GetFill() == '.' )
- pFillBtn = &aFillPoints;
- else
- {
- pFillBtn = &aFillSpecial;
- aFillChar.Enable();
- aFillChar.SetText( String( (sal_Unicode)aAktTab.GetFill() ) );
- }
- pFillBtn->Check();
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, NewHdl_Impl, Button *, pBtn )
-{
- // Einen neuen Hinzufuegen und Selectieren
- // Wert aus der Anzeige holen
- long nVal = static_cast<long>(aTabBox.Denormalize( aTabBox.GetValue( eDefUnit ) ));
-
- // Wenn der pBtn == 0 && der Value == 0 dann keinen Tab Erzeugen
- // weil ueber OK erzeugt
- if ( nVal == 0 && pBtn == 0 )
- return 0;
-
- long nOffset = 0;
- const SfxPoolItem* pItem = 0;
-
- if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, TRUE, &pItem ) ==
- SFX_ITEM_SET )
- {
- nOffset = ( (const SfxInt32Item*)pItem )->GetValue();
- MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
- nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM );
- }
- const long nReal = nVal - nOffset;
- USHORT nSize = aTabBox.GetEntryCount();
-
- USHORT i;
- for( i = 0; i < nSize; i++ )
- {
- if ( nReal < aNewTabs[i].GetTabPos() )
- break;
- }
-
- // ListBox-Eintrag vornehmen
- aTabBox.InsertValue( aTabBox.Normalize( nVal ), eDefUnit, i );
- aAktTab.GetTabPos() = nReal;
- SvxTabAdjust eAdj = SVX_TAB_ADJUST_LEFT;
-
- if ( aRightTab.IsChecked() )
- eAdj = SVX_TAB_ADJUST_RIGHT;
- else if ( aCenterTab.IsChecked() )
- eAdj = SVX_TAB_ADJUST_CENTER;
- else if ( aDezTab.IsChecked() )
- eAdj = SVX_TAB_ADJUST_DECIMAL;
-
- aAktTab.GetAdjustment() = eAdj;
- aNewTabs.Insert( aAktTab );
-
- aNewBtn.Disable();
- aDelBtn.Enable();
- aTabBox.GrabFocus();
-
- // falls kein RadioButton geclickt wurde,
- // muss trotzdem geputtet werden
- bCheck |= TRUE;
- // set the selection into the position Edit
- aTabBox.SetSelection(Selection(0, aTabBox.GetText().Len()));
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, DelHdl_Impl, Button *, EMPTYARG )
-{
- USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue() );
-
- if ( nPos == COMBOBOX_ENTRY_NOTFOUND )
- return 0;
-
- if ( aTabBox.GetEntryCount() == 1 )
- {
- DelAllHdl_Impl( 0 );
- return 0;
- }
-
- // Tab loeschen
- aTabBox.RemoveEntry( nPos );
- aNewTabs.Remove( nPos );
-
- // aAktTab neu setzen
- const USHORT nSize = aNewTabs.Count();
-
- if ( nSize > 0 )
- {
- // Pos korrigieren
- nPos = ( ( nSize - 1 ) >= nPos) ? nPos : nPos - 1;
- aTabBox.SetValue( aTabBox.GetValue( nPos ) );
- aAktTab = aNewTabs[nPos];
- }
-
- // Falls keine Tabs Enable Disable Controls
- if ( aTabBox.GetEntryCount() == 0 )
- {
- aDelBtn.Disable();
- aNewBtn.Enable();
- aTabBox.GrabFocus();
- }
-
- // falls kein RadioButton geclickt wurde,
- // muss trotzdem geputtet werden
- bCheck |= TRUE;
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, DelAllHdl_Impl, Button *, EMPTYARG )
-{
- if ( aNewTabs.Count() )
- {
- aNewTabs = SvxTabStopItem( 0 );
- InitTabPos_Impl();
-
- // damit in FillItemSet() geputtet wird
- bCheck |= TRUE;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, TabTypeCheckHdl_Impl, RadioButton *, pBox )
-{
- bCheck |= TRUE;
- SvxTabAdjust eAdj;
- aDezChar.Disable();
- aDezCharLabel.Disable();
- aDezChar.SetText( String() );
-
- if ( pBox == &aLeftTab )
- eAdj = SVX_TAB_ADJUST_LEFT;
- else if ( pBox == &aRightTab )
- eAdj = SVX_TAB_ADJUST_RIGHT;
- else if ( pBox == &aCenterTab )
- eAdj = SVX_TAB_ADJUST_CENTER;
- else
- {
- eAdj = SVX_TAB_ADJUST_DECIMAL;
- aDezChar.Enable();
- aDezCharLabel.Enable();
- aDezChar.SetText( String( (sal_Unicode)aAktTab.GetDecimal() ) );
- }
-
- aAktTab.GetAdjustment() = eAdj;
- USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit );
-
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- {
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aAktTab );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, FillTypeCheckHdl_Impl, RadioButton *, pBox )
-{
- bCheck |= TRUE;
- BYTE cFill = ' ';
- aFillChar.SetText( String() );
- aFillChar.Disable();
-
- if( pBox == &aFillSpecial )
- aFillChar.Enable();
- else if ( pBox == &aNoFillChar )
- cFill = ' ';
- else if ( pBox == &aFillSolidLine )
- cFill = '_';
- else if ( pBox == &aFillPoints )
- cFill = '.';
- else if ( pBox == &aFillDashLine )
- cFill = '-';
-
- aAktTab.GetFill() = cFill;
- USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit );
-
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- {
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aAktTab );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, GetFillCharHdl_Impl, Edit *, pEdit )
-{
- String aChar( pEdit->GetText() );
-
- if ( aChar.Len() > 0 )
- aAktTab.GetFill() = aChar.GetChar( 0 );
-
- const USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit);
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- {
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aAktTab );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, GetDezCharHdl_Impl, Edit *, pEdit )
-{
- String aChar( pEdit->GetText() );
- if ( aChar.Len() > 0 && ( aChar.GetChar( 0 ) >= ' '))
- aAktTab.GetDecimal() = aChar.GetChar( 0 );
-
- USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit );
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- {
- aNewTabs.Remove( nPos );
- aNewTabs.Insert( aAktTab );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, SelectHdl_Impl, MetricBox *, EMPTYARG )
-{
- USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit );
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- {
- aAktTab = aNewTabs[nPos];
- aNewBtn.Disable();
- SetFillAndTabType_Impl();
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxTabulatorTabPage, ModifyHdl_Impl, MetricBox *, EMPTYARG )
-{
- USHORT nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit );
- if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- {
- aAktTab = aNewTabs[nPos];
- SetFillAndTabType_Impl();
-
- aAktTab.GetTabPos() =
- static_cast<long>(aTabBox.Denormalize( aTabBox.GetValue( eDefUnit ) ));
-
- aNewBtn.Disable();
- aDelBtn.Enable();
- return 0;
- }
- aNewBtn.Enable();
- aDelBtn.Disable();
- return 0;
-}
-//add CHINA001 Begin
-void SvxTabulatorTabPage::PageCreated(SfxAllItemSet aSet)
-{
- SFX_ITEMSET_ARG (&aSet,pControlItem,SfxUInt16Item,SID_SVXTABULATORTABPAGE_CONTROLFLAGS,sal_False);
- if (pControlItem)
- DisableControls(pControlItem->GetValue());
-}
-//end of CHINA001
diff --git a/svx/source/cui/tabstpge.hrc b/svx/source/cui/tabstpge.hrc
deleted file mode 100644
index eb75e2cc41..0000000000
--- a/svx/source/cui/tabstpge.hrc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabstpge.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABSTPGE_HRC
-#define _SVX_TABSTPGE_HRC
-
-// defines ------------------------------------------------------------------
-
-#define ED_TABPOS 10
-#define FL_TABPOS 11
-#define FL_TABPOS_VERT 12
-
-#define BTN_TABTYPE_LEFT 20
-#define WIN_TABLEFT 21
-#define BTN_TABTYPE_RIGHT 22
-#define WIN_TABRIGHT 23
-#define BTN_TABTYPE_CENTER 24
-#define WIN_TABCENTER 25
-#define BTN_TABTYPE_DECIMAL 26
-#define WIN_TABDECIMAL 27
-#define ED_TABTYPE_DECCHAR 28
-#define FT_TABTYPE_DECCHAR 29
-#define FL_TABTYPE 30
-
-
-#define BTN_FILLCHAR_NO 40
-#define BTN_FILLCHAR_POINTS 41
-#define BTN_FILLCHAR_DASHLINE 42
-#define BTN_FILLCHAR_UNDERSCORE 43
-#define BTN_FILLCHAR_OTHER 44
-#define ED_FILLCHAR_OTHER 45
-#define FL_FILLCHAR 46
-
-#define BTN_NEW 50
-#define BTN_DEL 51
-#define BTN_DELALL 52
-#define ST_LEFTTAB_ASIAN 53
-#define ST_RIGHTTAB_ASIAN 54
-#endif
-
diff --git a/svx/source/cui/tabstpge.hxx b/svx/source/cui/tabstpge.hxx
deleted file mode 100644
index 0ab6265c67..0000000000
--- a/svx/source/cui/tabstpge.hxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabstpge.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TABSTPGE_HXX
-#define _SVX_TABSTPGE_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/group.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <sfx2/tabdlg.hxx>
-
-#include <svx/tstpitem.hxx>
-#include "flagsdef.hxx"
-// forward ---------------------------------------------------------------
-
-class TabWin_Impl;
-
-// define ----------------------------------------------------------------
-
-// Bitfelder f"ur DisableControls()
-//CHINA001 #define TABTYPE_LEFT 0x0001
-//CHINA001 #define TABTYPE_RIGHT 0x0002
-//CHINA001 #define TABTYPE_CENTER 0x0004
-//CHINA001 #define TABTYPE_DEZIMAL 0x0008
-//CHINA001 #define TABTYPE_ALL 0x000F
-//CHINA001
-//CHINA001 #define TABFILL_NONE 0x0010
-//CHINA001 #define TABFILL_POINT 0x0020
-//CHINA001 #define TABFILL_DASHLINE 0x0040
-//CHINA001 #define TABFILL_SOLIDLINE 0x0080
-//CHINA001 #define TABFILL_SPECIAL 0x0100
-//CHINA001 #define TABFILL_ALL 0x01F0
-
-// class SvxTabulatorTabPage ---------------------------------------------
-/*
- {k:\svx\prototyp\dialog\tabstop.bmp}
-
- [Beschreibung]
- In dieser TabPage werden Tabulatoren verwaltet.
-
- [Items]
- <SvxTabStopItem><SID_ATTR_TABSTOP>
- <SfxUInt16Item><SID_ATTR_TABSTOP_DEFAULTS>
- <SfxUInt16Item><SID_ATTR_TABSTOP_POS>
- <SfxInt32Item><SID_ATTR_TABSTOP_OFFSET>
-*/
-
-class SvxTabulatorTabPage : public SfxTabPage
-{
- using TabPage::DeactivatePage;
-
-public:
- ~SvxTabulatorTabPage();
-
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& rSet );
- virtual void Reset( const SfxItemSet& rSet );
-
- void DisableControls( const USHORT nFlag );
-
-protected:
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-private:
- SvxTabulatorTabPage( Window* pParent, const SfxItemSet& rSet );
-
- // Tabulatoren und Positionen
- MetricBox aTabBox;
- FixedLine aTabLabel;
- FixedLine aTabLabelVert;
-
- // TabType
- RadioButton aLeftTab;
- RadioButton aRightTab;
- RadioButton aCenterTab;
- RadioButton aDezTab;
-
- TabWin_Impl* pLeftWin;
- TabWin_Impl* pRightWin;
- TabWin_Impl* pCenterWin;
- TabWin_Impl* pDezWin;
-
- FixedText aDezCharLabel;
- Edit aDezChar;
- FixedLine aTabTypeLabel;
-
- // Fuellzeichen
- RadioButton aNoFillChar;
- RadioButton aFillPoints;
- RadioButton aFillDashLine ;
- RadioButton aFillSolidLine;
- RadioButton aFillSpecial;
- Edit aFillChar;
- FixedLine aFillLabel;
-
- // Buttons
- PushButton aNewBtn;
- PushButton aDelAllBtn;
- PushButton aDelBtn;
-
- // lokale Variablen, interne Funktionen
- SvxTabStop aAktTab;
- SvxTabStopItem aNewTabs;
- long nDefDist;
- FieldUnit eDefUnit;
- BOOL bCheck;
-
-#ifdef _SVX_TABSTPGE_CXX
- void InitTabPos_Impl( USHORT nPos = 0 );
- void SetFillAndTabType_Impl();
-
- // Handler
- DECL_LINK( NewHdl_Impl, Button* );
- DECL_LINK( DelHdl_Impl, Button* );
- DECL_LINK( DelAllHdl_Impl, Button* );
-
- DECL_LINK( FillTypeCheckHdl_Impl, RadioButton* );
- DECL_LINK( TabTypeCheckHdl_Impl, RadioButton* );
-
- DECL_LINK( SelectHdl_Impl, MetricBox* );
- DECL_LINK( ModifyHdl_Impl, MetricBox* );
- DECL_LINK( GetFillCharHdl_Impl, Edit* );
- DECL_LINK( GetDezCharHdl_Impl, Edit* );
-#endif
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-#endif // #ifndef _SVX_TABSTPGE_HXX
-
-
diff --git a/svx/source/cui/tabstpge.src b/svx/source/cui/tabstpge.src
deleted file mode 100644
index 4cb09d5bf1..0000000000
--- a/svx/source/cui/tabstpge.src
+++ /dev/null
@@ -1,234 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tabstpge.src,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "tabstpge.hrc"
- // pragma ----------------------------------------------------------------
-
- // RID_SVXPAGE_TABULATOR -------------------------------------------------
-TabPage RID_SVXPAGE_TABULATOR
-{
- HelpId = HID_TABULATOR ;
- Hide = TRUE ;
- Text [ en-US ] = "Tabs" ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_TABPOS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 48 , 8 ) ;
- Text [ en-US ] = "Position" ;
- };
- MetricBox ED_TABPOS
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 39 , 165 ) ;
- Minimum = -5600 ;
- Maximum = 5600 ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CM ;
- };
- FixedLine FL_TABPOS_VERT
- {
- Pos = MAP_APPFONT ( 55 , 14 ) ;
- Size = MAP_APPFONT ( 4 , 165 ) ;
- Vert = TRUE;
- };
- FixedLine FL_TABTYPE
- {
- Pos = MAP_APPFONT ( 60 , 3 ) ;
- Size = MAP_APPFONT ( 138 , 8 ) ;
- Text [ en-US ] = "Type" ;
- };
- RadioButton BTN_TABTYPE_LEFT
- {
- Pos = MAP_APPFONT ( 66 , 14 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text [ en-US ] = "~Left" ;
- Check = TRUE ;
- };
- Window WIN_TABLEFT
- {
- Pos = MAP_APPFONT ( 157 , 14 ) ;
- Size = MAP_APPFONT ( 7 , 10 ) ;
- };
- RadioButton BTN_TABTYPE_RIGHT
- {
- Pos = MAP_APPFONT ( 66 , 28 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text [ en-US ] = "Righ~t" ;
- };
- Window WIN_TABRIGHT
- {
- Pos = MAP_APPFONT ( 157 , 28 ) ;
- Size = MAP_APPFONT ( 7 , 10 ) ;
- };
- RadioButton BTN_TABTYPE_CENTER
- {
- Pos = MAP_APPFONT ( 66 , 42 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text [ en-US ] = "C~entered" ;
- };
- Window WIN_TABCENTER
- {
- Pos = MAP_APPFONT ( 157 , 42 ) ;
- Size = MAP_APPFONT ( 7 , 10 ) ;
- };
- RadioButton BTN_TABTYPE_DECIMAL
- {
- Pos = MAP_APPFONT ( 66 , 56 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text [ en-US ] = "Deci~mal" ;
- };
- Window WIN_TABDECIMAL
- {
- Pos = MAP_APPFONT ( 157 , 56 ) ;
- Size = MAP_APPFONT ( 7 , 10 ) ;
- };
- FixedText FT_TABTYPE_DECCHAR
- {
- Pos = MAP_APPFONT ( 75 , 70 ) ;
- Size = MAP_APPFONT ( 79 , 8 ) ;
- Text [ en-US ] = "~Character" ;
- };
- Edit ED_TABTYPE_DECCHAR
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 156 , 68 ) ;
- Size = MAP_APPFONT ( 9 , 12 ) ;
- Left = TRUE ;
- };
- FixedLine FL_FILLCHAR
- {
- Pos = MAP_APPFONT ( 60 , 86 ) ;
- Size = MAP_APPFONT ( 138 , 8 ) ;
- Text [ en-US ] = "Fill character" ;
- };
- RadioButton BTN_FILLCHAR_NO
- {
- Pos = MAP_APPFONT ( 66 , 97 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text [ en-US ] = "N~one" ;
- Check = TRUE ;
- };
- RadioButton BTN_FILLCHAR_POINTS
- {
- Pos = MAP_APPFONT ( 66 , 111 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text = "~........" ;
- };
- RadioButton BTN_FILLCHAR_DASHLINE
- {
- Pos = MAP_APPFONT ( 66 , 125 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text = "~--------" ;
- };
- RadioButton BTN_FILLCHAR_UNDERSCORE
- {
- Pos = MAP_APPFONT ( 66 , 139 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text = "~_____" ;
- };
- RadioButton BTN_FILLCHAR_OTHER
- {
- Pos = MAP_APPFONT ( 66 , 153 ) ;
- Size = MAP_APPFONT ( 89 , 10 ) ;
- Text [ en-US ] = "Character" ;
- };
- Edit ED_FILLCHAR_OTHER
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 156 , 151 ) ;
- Size = MAP_APPFONT ( 9 , 12 ) ;
- Left = TRUE ;
- };
- PushButton BTN_NEW
- {
- Pos = MAP_APPFONT ( 204 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~New" ;
- };
- PushButton BTN_DELALL
- {
- Pos = MAP_APPFONT ( 204 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "Delete ~All" ;
- };
- PushButton BTN_DEL
- {
- Pos = MAP_APPFONT ( 204 , 40 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete" ;
- };
- String ST_LEFTTAB_ASIAN
- {
- Text [ en-US ] = "~Left/Top" ;
- };
- String ST_RIGHTTAB_ASIAN
- {
- Text [ en-US ] = "Righ~t/Bottom" ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/textanim.cxx b/svx/source/cui/textanim.cxx
deleted file mode 100644
index 89157236b4..0000000000
--- a/svx/source/cui/textanim.cxx
+++ /dev/null
@@ -1,763 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textanim.cxx,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <tools/shl.hxx>
-
-#include <svx/dialogs.hrc>
-
-#ifndef _SVX_TEXTANIM_CXX
-#define _SVX_TEXTANIM_CXX
-#endif
-#include "textanim.hxx"
-#include "textanim.hrc"
-#include "textattr.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-
-static USHORT pRanges[] =
-{
- SDRATTR_TEXT_ANIKIND,
- SDRATTR_TEXT_ANIAMOUNT,
- 0
-};
-
-/*************************************************************************
-|*
-|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
-|*
-\************************************************************************/
-
-__EXPORT SvxTextTabDialog::SvxTextTabDialog( Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pSdrView ) :
- SfxTabDialog ( pParent, SVX_RES( RID_SVXDLG_TEXT ), pAttr ),
- rOutAttrs ( *pAttr ),
- pView ( pSdrView )
-{
- FreeResource();
-
- AddTabPage( RID_SVXPAGE_TEXTATTR, SvxTextAttrPage::Create, 0);
- AddTabPage( RID_SVXPAGE_TEXTANIMATION, SvxTextAnimationPage::Create, 0);
-}
-
-/*************************************************************************
-|*
-|* PageCreated()
-|*
-\************************************************************************/
-
-void __EXPORT SvxTextTabDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
-{
- switch( nId )
- {
- case RID_SVXPAGE_TEXTATTR:
- {
- ( (SvxTextAttrPage&) rPage ).SetView( pView );
- ( (SvxTextAttrPage&) rPage ).Construct();
- }
- break;
-
- case RID_SVXPAGE_TEXTANIMATION:
- break;
-
- default:
- break;
- }
-}
-
-
-/*************************************************************************
-|*
-|* Page
-|*
-\************************************************************************/
-
-SvxTextAnimationPage::SvxTextAnimationPage( Window* pWindow, const SfxItemSet& rInAttrs ) :
- SfxTabPage ( pWindow, SVX_RES( RID_SVXPAGE_TEXTANIMATION ),
- rInAttrs ),
- aFlEffect ( this, SVX_RES(FL_EFFECT)),
- aFtEffects ( this, SVX_RES(FT_EFFECTS)),
- aLbEffect ( this, SVX_RES( LB_EFFECT ) ),
- //aCtlEffect ( this, SVX_RES( CTL_EFFECT ) ),
- aFtDirection ( this, SVX_RES(FT_DIRECTION) ),
- aBtnUp ( this, SVX_RES( BTN_UP ) ),
- aBtnLeft ( this, SVX_RES( BTN_LEFT ) ),
- aBtnRight ( this, SVX_RES( BTN_RIGHT ) ),
- aBtnDown ( this, SVX_RES( BTN_DOWN ) ),
-
- aFlProperties ( this, SVX_RES(FL_PROPERTIES)),
- aTsbStartInside ( this, SVX_RES( TSB_START_INSIDE ) ),
- aTsbStopInside ( this, SVX_RES( TSB_STOP_INSIDE ) ),
-
- aFtCount ( this, SVX_RES(FT_COUNT)),
- aTsbEndless ( this, SVX_RES( TSB_ENDLESS ) ),
- aNumFldCount ( this, SVX_RES( NUM_FLD_COUNT ) ),
-
- aFtAmount ( this, SVX_RES(FT_AMOUNT)),
- aTsbPixel ( this, SVX_RES( TSB_PIXEL ) ),
- aMtrFldAmount ( this, SVX_RES( MTR_FLD_AMOUNT ) ),
-
- aFtDelay ( this, SVX_RES(FT_DELAY)),
- aTsbAuto ( this, SVX_RES( TSB_AUTO ) ),
- aMtrFldDelay ( this, SVX_RES( MTR_FLD_DELAY ) ),
-
- rOutAttrs ( rInAttrs ),
- eAniKind ( SDRTEXTANI_NONE )
-{
- FreeResource();
-
- eFUnit = GetModuleFieldUnit( &rInAttrs );
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
-
- Construct();
-
- aLbEffect.SetSelectHdl(
- LINK( this, SvxTextAnimationPage, SelectEffectHdl_Impl ) );
- aTsbEndless.SetClickHdl(
- LINK( this, SvxTextAnimationPage, ClickEndlessHdl_Impl ) );
- aTsbAuto.SetClickHdl(
- LINK( this, SvxTextAnimationPage, ClickAutoHdl_Impl ) );
- aTsbPixel.SetClickHdl(
- LINK( this, SvxTextAnimationPage, ClickPixelHdl_Impl ) );
-
- Link aLink( LINK( this, SvxTextAnimationPage, ClickDirectionHdl_Impl ) );
- aBtnUp.SetClickHdl( aLink );
- aBtnLeft.SetClickHdl( aLink );
- aBtnRight.SetClickHdl( aLink );
- aBtnDown.SetClickHdl( aLink );
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxTextAnimationPage::~SvxTextAnimationPage()
-{
-}
-
-/*************************************************************************
-|*
-|* Liest uebergebenen Item-Set
-|*
-\************************************************************************/
-
-void __EXPORT SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
-{
- const SfxItemPool* pPool = rAttrs.GetPool();
-
- // Animationstyp
- const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIKIND );
-
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND );
- if( pItem )
- {
- eAniKind = ( ( const SdrTextAniKindItem* )pItem )->GetValue();
- aLbEffect.SelectEntryPos( sal::static_int_cast< USHORT >(eAniKind) );
- }
- else
- aLbEffect.SetNoSelection();
- aLbEffect.SaveValue();
-
- // Animationsrichtung
- pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDIRECTION );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION );
- if( pItem )
- {
- SdrTextAniDirection eValue = ( ( const SdrTextAniDirectionItem* )pItem )->GetValue();
- SelectDirection( eValue );
- }
- else
- {
- aBtnUp.Check( FALSE );
- aBtnLeft.Check( FALSE );
- aBtnRight.Check( FALSE );
- aBtnDown.Check( FALSE );
- }
- aBtnUp.SaveValue();
- aBtnLeft.SaveValue();
- aBtnRight.SaveValue();
- aBtnDown.SaveValue();
-
- // Start inside
- pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE );
- if( pItem )
- {
- aTsbStartInside.EnableTriState( FALSE );
- BOOL bValue = ( ( const SdrTextAniStartInsideItem* )pItem )->GetValue();
- if( bValue )
- aTsbStartInside.SetState( STATE_CHECK );
- else
- aTsbStartInside.SetState( STATE_NOCHECK );
- }
- else
- aTsbStartInside.SetState( STATE_DONTKNOW );
- aTsbStartInside.SaveValue();
-
- // Stop inside
- pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTOPINSIDE );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE );
- if( pItem )
- {
- aTsbStopInside.EnableTriState( FALSE );
- BOOL bValue = ( ( const SdrTextAniStopInsideItem* )pItem )->GetValue();
- if( bValue )
- aTsbStopInside.SetState( STATE_CHECK );
- else
- aTsbStopInside.SetState( STATE_NOCHECK );
- }
- else
- aTsbStopInside.SetState( STATE_DONTKNOW );
- aTsbStopInside.SaveValue();
-
- // Anzahl
- pItem = GetItem( rAttrs, SDRATTR_TEXT_ANICOUNT );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT );
- if( pItem )
- {
- aTsbEndless.EnableTriState( FALSE );
- long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue();
- aNumFldCount.SetValue( nValue );
- if( nValue == 0 )
- {
- if( eAniKind == SDRTEXTANI_SLIDE )
- {
- aTsbEndless.SetState( STATE_NOCHECK );
- aTsbEndless.Enable( FALSE );
- }
- else
- {
- aTsbEndless.SetState( STATE_CHECK );
- aNumFldCount.SetEmptyFieldValue();
- }
- }
- else
- aTsbEndless.SetState( STATE_NOCHECK );
- }
- else
- {
- aNumFldCount.SetEmptyFieldValue();
- aTsbEndless.SetState( STATE_DONTKNOW );
- }
- aTsbEndless.SaveValue();
- aNumFldCount.SaveValue();
-
- // Verzoegerung
- pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDELAY );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY );
- if( pItem )
- {
- aTsbAuto.EnableTriState( FALSE );
- long nValue = (long) ( ( const SdrTextAniDelayItem* )pItem )->GetValue();
- aMtrFldDelay.SetValue( nValue );
- if( nValue == 0 )
- {
- aTsbAuto.SetState( STATE_CHECK );
- aMtrFldDelay.SetEmptyFieldValue();
- }
- else
- aTsbAuto.SetState( STATE_NOCHECK );
- }
- else
- {
- aMtrFldDelay.SetEmptyFieldValue();
- aTsbAuto.SetState( STATE_DONTKNOW );
- }
- aTsbAuto.SaveValue();
- aMtrFldDelay.SaveValue();
-
- // Schrittweite
- pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIAMOUNT );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT );
- if( pItem )
- {
- aTsbPixel.EnableTriState( FALSE );
- long nValue = (long) ( ( const SdrTextAniAmountItem* )pItem )->GetValue();
- if( nValue <= 0 )
- {
- aTsbPixel.SetState( STATE_CHECK );
- nValue = -nValue;
- if( nValue == 0 )
- nValue++;
- aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
- aMtrFldAmount.SetDecimalDigits( 0 );
-
- aMtrFldAmount.SetSpinSize( 1 );
- aMtrFldAmount.SetMin( 1 );
- aMtrFldAmount.SetFirst( 1 );
- aMtrFldAmount.SetMax( 100 );
- aMtrFldAmount.SetLast( 100 );
-
- aMtrFldAmount.SetValue( nValue );
- }
- else
- {
- aTsbPixel.SetState( STATE_NOCHECK );
- aMtrFldAmount.SetUnit( eFUnit );
- aMtrFldAmount.SetDecimalDigits( 2 );
-
- aMtrFldAmount.SetSpinSize( 10 );
- aMtrFldAmount.SetMin( 1 );
- aMtrFldAmount.SetFirst( 1 );
- aMtrFldAmount.SetMax( 10000 );
- aMtrFldAmount.SetLast( 10000 );
-
- SetMetricValue( aMtrFldAmount, nValue, eUnit );
- }
- }
- else
- {
- aMtrFldAmount.Disable();
- aMtrFldAmount.SetEmptyFieldValue();
- aTsbPixel.SetState( STATE_DONTKNOW );
- }
- aTsbPixel.SaveValue();
- aMtrFldAmount.SaveValue();
-
-
- SelectEffectHdl_Impl( NULL );
- ClickEndlessHdl_Impl( NULL );
- ClickAutoHdl_Impl( NULL );
- //ClickPixelHdl_Impl( NULL );
-}
-
-/*************************************************************************
-|*
-|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
-|*
-\************************************************************************/
-
-BOOL SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
-{
- BOOL bModified = FALSE;
- USHORT nPos;
- TriState eState;
-
- // Animationstyp
- nPos = aLbEffect.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbEffect.GetSavedValue() )
- {
- rAttrs.Put( SdrTextAniKindItem( (SdrTextAniKind) nPos ) );
- bModified = TRUE;
- }
-
- // Animationsrichtung
- if( aBtnUp.GetSavedValue() != aBtnUp.IsChecked() ||
- aBtnLeft.GetSavedValue() != aBtnLeft.IsChecked() ||
- aBtnRight.GetSavedValue() != aBtnRight.IsChecked() ||
- aBtnDown.GetSavedValue() != aBtnDown.IsChecked() )
- {
- SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection();
- rAttrs.Put( SdrTextAniDirectionItem( eValue ) );
- bModified = TRUE;
- }
-
- // Start inside
- eState = aTsbStartInside.GetState();
- if( eState != aTsbStartInside.GetSavedValue() )
- {
- rAttrs.Put( SdrTextAniStartInsideItem( (BOOL) STATE_CHECK == eState ) );
- bModified = TRUE;
- }
-
- // Stop inside
- eState = aTsbStopInside.GetState();
- if( eState != aTsbStopInside.GetSavedValue() )
- {
- rAttrs.Put( SdrTextAniStopInsideItem( (BOOL) STATE_CHECK == eState ) );
- bModified = TRUE;
- }
-
- // Anzahl
- eState = aTsbEndless.GetState();
- String aStr = aNumFldCount.GetText();
- if( eState != aTsbEndless.GetSavedValue() ||
- aStr != aNumFldCount.GetSavedValue() )
- {
- sal_Int64 nValue = 0;
- if( eState == STATE_CHECK /*#89844#*/ && aTsbEndless.IsEnabled())
- bModified = TRUE;
- else
- {
- if( aStr != aNumFldCount.GetSavedValue() )
- {
- nValue = aNumFldCount.GetValue();
- bModified = TRUE;
- }
- }
- if( bModified )
- rAttrs.Put( SdrTextAniCountItem( (UINT16) nValue ) );
- }
-
- // Verzoegerung
- eState = aTsbAuto.GetState();
- aStr = aMtrFldDelay.GetText();
- if( eState != aTsbAuto.GetSavedValue() ||
- aStr != aMtrFldDelay.GetSavedValue() )
- {
- sal_Int64 nValue = 0;
- if( eState == STATE_CHECK )
- bModified = TRUE;
- else
- {
- if( aStr != aMtrFldDelay.GetSavedValue() )
- {
- nValue = aMtrFldDelay.GetValue();
- bModified = TRUE;
- }
- }
- if( bModified )
- rAttrs.Put( SdrTextAniDelayItem( (UINT16) nValue ) );
- }
-
- // Schrittweite
- eState = aTsbPixel.GetState();
- aStr = aMtrFldAmount.GetText();
- if( eState != aTsbPixel.GetSavedValue() ||
- aStr != aMtrFldAmount.GetSavedValue() )
- {
- sal_Int64 nValue = 0;
- if( eState == STATE_CHECK )
- {
- nValue = aMtrFldAmount.GetValue();
- nValue = -nValue;
- }
- else
- {
- nValue = GetCoreValue( aMtrFldAmount, eUnit );
- }
- rAttrs.Put( SdrTextAniAmountItem( (INT16) nValue ) );
-
- bModified = TRUE;
- }
-
- return( bModified );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxTextAnimationPage::Construct()
-{
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-USHORT* SvxTextAnimationPage::GetRanges()
-{
- return( pRanges );
-}
-
-/*************************************************************************
-|*
-|* Erzeugt die Seite
-|*
-\************************************************************************/
-
-SfxTabPage* SvxTextAnimationPage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxTextAnimationPage( pWindow, rAttrs ) );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxTextAnimationPage, SelectEffectHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbEffect.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- eAniKind = (SdrTextAniKind) nPos;
- switch( eAniKind )
- {
- case SDRTEXTANI_NONE:
- {
- aFtDirection.Disable();
- aBtnUp.Disable();
- aBtnLeft.Disable();
- aBtnRight.Disable();
- aBtnDown.Disable();
- aTsbStartInside.Disable();
- aTsbStopInside.Disable();
-
- aTsbEndless.Disable();
- aNumFldCount.Disable();
- aFtCount.Disable();
-
- aTsbAuto.Disable();
- aMtrFldDelay.Disable();
- aFtDelay.Disable();
-
- aTsbPixel.Disable();
- aMtrFldAmount.Disable();
- aFtAmount.Disable();
- }
- break;
-
- case SDRTEXTANI_BLINK:
- case SDRTEXTANI_SCROLL:
- case SDRTEXTANI_ALTERNATE:
- case SDRTEXTANI_SLIDE:
- {
- if( eAniKind == SDRTEXTANI_SLIDE )
- {
- aTsbStartInside.Disable();
- aTsbStopInside.Disable();
-
- aTsbEndless.Disable();
- aNumFldCount.Enable();
- aNumFldCount.SetValue( aNumFldCount.GetValue() );
- }
- else
- {
- aTsbStartInside.Enable();
- aTsbStopInside.Enable();
-
- aTsbEndless.Enable();
- ClickEndlessHdl_Impl( NULL );
- }
- aFtCount.Enable();
-
- aTsbAuto.Enable();
- aFtDelay.Enable();
- ClickAutoHdl_Impl( NULL );
-
- if( eAniKind == SDRTEXTANI_BLINK )
- {
- aFtDirection.Disable();
- aBtnUp.Disable();
- aBtnLeft.Disable();
- aBtnRight.Disable();
- aBtnDown.Disable();
-
- aTsbPixel.Disable();
- aMtrFldAmount.Disable();
- aFtAmount.Disable();
- }
- else
- {
- aFtDirection.Enable();
- aBtnUp.Enable();
- aBtnLeft.Enable();
- aBtnRight.Enable();
- aBtnDown.Enable();
-
- aTsbPixel.Enable();
- aMtrFldAmount.Enable();
- aFtAmount.Enable();
- }
- }
- break;
- }
-
- }
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxTextAnimationPage, ClickEndlessHdl_Impl, void *, EMPTYARG )
-{
-
- if( eAniKind != SDRTEXTANI_SLIDE )
- {
- TriState eState = aTsbEndless.GetState();
- if( eState != STATE_NOCHECK )
- {
- aNumFldCount.Disable();
- aNumFldCount.SetEmptyFieldValue();
- }
- else
- {
- aNumFldCount.Enable();
- aNumFldCount.SetValue( aNumFldCount.GetValue() );
- }
- }
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxTextAnimationPage, ClickAutoHdl_Impl, void *, EMPTYARG )
-{
- TriState eState = aTsbAuto.GetState();
- if( eState != STATE_NOCHECK )
- {
- aMtrFldDelay.Disable();
- aMtrFldDelay.SetEmptyFieldValue();
- }
- else
- {
- aMtrFldDelay.Enable();
- aMtrFldDelay.SetValue( aMtrFldDelay.GetValue() );
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxTextAnimationPage, ClickPixelHdl_Impl, void *, EMPTYARG )
-{
- TriState eState = aTsbPixel.GetState();
- if( eState == STATE_CHECK )
- {
- sal_Int64 nValue = aMtrFldAmount.GetValue() / 10;
- aMtrFldAmount.Enable();
- aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
- //SetFieldUnit( aMtrFldAmount, FUNIT_CUSTOM );
- aMtrFldAmount.SetDecimalDigits( 0 );
-
- aMtrFldAmount.SetSpinSize( 1 );
- aMtrFldAmount.SetMin( 1 );
- aMtrFldAmount.SetFirst( 1 );
- aMtrFldAmount.SetMax( 100 );
- aMtrFldAmount.SetLast( 100 );
-
- aMtrFldAmount.SetValue( nValue );
- }
- else if( eState == STATE_NOCHECK )
- {
- sal_Int64 nValue = aMtrFldAmount.GetValue() * 10;
- aMtrFldAmount.Enable();
- aMtrFldAmount.SetUnit( eFUnit );
- //SetFieldUnit( aMtrFldAmount, eFUnit );
- aMtrFldAmount.SetDecimalDigits( 2 );
-
- aMtrFldAmount.SetSpinSize( 10 );
- aMtrFldAmount.SetMin( 1 );
- aMtrFldAmount.SetFirst( 1 );
- aMtrFldAmount.SetMax( 10000 );
- aMtrFldAmount.SetLast( 10000 );
-
- aMtrFldAmount.SetValue( nValue );
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxTextAnimationPage, ClickDirectionHdl_Impl, ImageButton *, pBtn )
-{
- aBtnUp.Check( pBtn == &aBtnUp );
- aBtnLeft.Check( pBtn == &aBtnLeft );
- aBtnRight.Check( pBtn == &aBtnRight );
- aBtnDown.Check( pBtn == &aBtnDown );
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxTextAnimationPage::SelectDirection( SdrTextAniDirection nValue )
-{
- aBtnUp.Check( nValue == SDRTEXTANI_UP );
- aBtnLeft.Check( nValue == SDRTEXTANI_LEFT );
- aBtnRight.Check( nValue == SDRTEXTANI_RIGHT );
- aBtnDown.Check( nValue == SDRTEXTANI_DOWN );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-USHORT SvxTextAnimationPage::GetSelectedDirection()
-{
- USHORT nValue = 0;
-
- if( aBtnUp.IsChecked() )
- nValue = SDRTEXTANI_UP;
- else if( aBtnLeft.IsChecked() )
- nValue = SDRTEXTANI_LEFT;
- else if( aBtnRight.IsChecked() )
- nValue = SDRTEXTANI_RIGHT;
- else if( aBtnDown.IsChecked() )
- nValue = SDRTEXTANI_DOWN;
-
- return( nValue );
-}
-
-
diff --git a/svx/source/cui/textanim.hrc b/svx/source/cui/textanim.hrc
deleted file mode 100644
index bcbecf8e03..0000000000
--- a/svx/source/cui/textanim.hrc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textanim.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define LB_EFFECT 1
-#define CTL_EFFECT 1
-#define TSB_START_INSIDE 1
-#define TSB_STOP_INSIDE 2
-#define FL_EFFECT 1
-#define FT_EFFECTS 1
-#define FT_DIRECTION 2
-#define FL_PROPERTIES 2
-#define FT_COUNT 3
-#define TSB_ENDLESS 3
-#define NUM_FLD_COUNT 1
-#define FT_AMOUNT 4
-#define MTR_FLD_AMOUNT 1
-#define FT_DELAY 5
-#define MTR_FLD_DELAY 2
-#define TSB_PIXEL 4
-#define TSB_AUTO 5
-#define BTN_UP 1
-#define BTN_LEFT 2
-#define BTN_RIGHT 3
-#define BTN_DOWN 4
diff --git a/svx/source/cui/textanim.hxx b/svx/source/cui/textanim.hxx
deleted file mode 100644
index f72d474c76..0000000000
--- a/svx/source/cui/textanim.hxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textanim.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TEXTANIM_HXX
-#define _SVX_TEXTANIM_HXX
-
-// include ---------------------------------------------------------------
-
-#include <vcl/field.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svx/svdattr.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/group.hxx>
-
-class SdrView;
-
-/*************************************************************************
-|*
-|* Page zum "Andern von TextAnimationen (Lauftext etc.)
-|*
-\************************************************************************/
-
-class SvxTextAnimationPage : public SfxTabPage
-{
-private:
- FixedLine aFlEffect;
- FixedText aFtEffects;
- ListBox aLbEffect;
- //ValueSet aCtlEffect;
- FixedText aFtDirection;
- ImageButton aBtnUp;
- ImageButton aBtnLeft;
- ImageButton aBtnRight;
- ImageButton aBtnDown;
-
- FixedLine aFlProperties;
- TriStateBox aTsbStartInside;
- TriStateBox aTsbStopInside;
-
- FixedText aFtCount;
- TriStateBox aTsbEndless;
- NumericField aNumFldCount;
-
- FixedText aFtAmount;
- TriStateBox aTsbPixel;
- MetricField aMtrFldAmount;
-
- FixedText aFtDelay;
- TriStateBox aTsbAuto;
- MetricField aMtrFldDelay;
-
- const SfxItemSet& rOutAttrs;
- SdrTextAniKind eAniKind;
- FieldUnit eFUnit;
- SfxMapUnit eUnit;
-
-#ifdef _SVX_TEXTANIM_CXX
- DECL_LINK( SelectEffectHdl_Impl, void * );
- DECL_LINK( ClickEndlessHdl_Impl, void * );
- DECL_LINK( ClickAutoHdl_Impl, void * );
- DECL_LINK( ClickPixelHdl_Impl, void * );
- DECL_LINK( ClickDirectionHdl_Impl, ImageButton * );
-
- void SelectDirection( SdrTextAniDirection nValue );
- USHORT GetSelectedDirection();
-#endif
-
-public:
-
- SvxTextAnimationPage( Window* pWindow, const SfxItemSet& rInAttrs );
- ~SvxTextAnimationPage();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- void Construct();
-};
-
-/*************************************************************************
-|*
-|* Text-Tab-Dialog
-|*
-\************************************************************************/
-class SvxTextTabDialog : public SfxTabDialog
-{
-private:
- const SfxItemSet& rOutAttrs;
- const SdrView* pView;
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-public:
-
- SvxTextTabDialog( Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pView );
- ~SvxTextTabDialog() {};
-};
-
-
-#endif // _SVX_TEXTANIM_HXX
-
diff --git a/svx/source/cui/textanim.src b/svx/source/cui/textanim.src
deleted file mode 100644
index fb29d9c60d..0000000000
--- a/svx/source/cui/textanim.src
+++ /dev/null
@@ -1,322 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textanim.src,v $
- * $Revision: 1.38 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // pragma ----------------------------------------------------------------
-
-#include <svtools/controldims.hrc>
-#include <svx/dialogs.hrc>
-#include "textanim.hrc"
-
-// direction image buttons
-#define MA_HALFBUTTON_WIDTH 7
-#define MA_BUTTON_WIDTH (2 * MA_HALFBUTTON_WIDTH)
-#define MA_BUTTON_HEIGHT (2 * MA_HALFBUTTON_WIDTH)
-#define BUTTON_SIZE MAP_APPFONT( MA_BUTTON_WIDTH, MA_BUTTON_WIDTH )
-#define MA_MOVEBUT_GRACE_X 6
-
-// height of first group Text effects
-#define MA_EFFECTSGROUP_HEIGHT (RSC_CD_FIXEDLINE_HEIGHT + \
- RSC_SP_FLGR_INNERBORDER_LEFT + \
-/* direction buttons */ 3*MA_BUTTON_HEIGHT + \
- RSC_SP_FLGR_INNERBORDER_BOTTOM + RSC_SP_FLGR_SPACE_Y)
-
-// height of second group height of FIXEDTEXT
-#define MA_PROPERTIESGROUP_HEIGHT (RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_LEFT + \
-/* text initially visible */ RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* text finally visible */ RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* animation runs */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* number of runs */ RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* step size */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* number of pixel */ RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* step delay */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \
-/* delay time */ RSC_CD_TEXTBOX_HEIGHT)
-
-
-// left space for real controls
-#define MA_LEFT_SPACE (RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT)
-
-// tabpage total size
-#define MA_TOTAL_WIDTH 260
-#define MA_TOTAL_HEIGHT RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT + MA_PROPERTIESGROUP_HEIGHT + RSC_SP_TBPG_INNERBORDER_BOTTOM
-
-// X position and width of effects drop down
-#define MA_EFFECTLIST_X 50
-#define MA_EFFECTLIST_WIDTH 95
-
-
- // RID_SVXPAGE_TEXTANIMATION ---------------------------------------------
-TabPage RID_SVXPAGE_TEXTANIMATION
-{
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH , 185 ) ;
- Text [ en-US ] = "Animation" ;
- FixedLine FL_EFFECT
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT, RSC_SP_TBPG_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Text animation effects" ;
- };
-#define MA_CURR_Y RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + MA_BUTTON_HEIGHT
- FixedText FT_EFFECTS
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y + 3 ) ;
- Size = MAP_APPFONT ( MA_EFFECTLIST_X - RSC_SP_CTRL_DESC_X - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_FLGR_INNERBORDER_LEFT,
- RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "E~ffect" ;
- };
- ListBox LB_EFFECT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MA_EFFECTLIST_X, MA_CURR_Y + 1 ) ;
- Size = MAP_APPFONT ( MA_EFFECTLIST_WIDTH , 57 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "No Effect" ; Default ; > ;
- < "Blink" ; Default ; > ;
- < "Scroll Through" ; Default ; > ;
- < "Scroll Back and Forth" ; Default ; > ;
- < "Scroll In" ; Default ; > ;
- };
- };
- FixedText FT_DIRECTION
- {
- Pos = MAP_APPFONT ( MA_EFFECTLIST_X + MA_EFFECTLIST_WIDTH + RSC_SP_CTRL_X, MA_CURR_Y + 3 ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH -
- (MA_MOVEBUT_GRACE_X + 3*MA_BUTTON_WIDTH + RSC_SP_TBPG_INNERBORDER_RIGHT + RSC_SP_FLGR_INNERBORDER_RIGHT) -
- (MA_EFFECTLIST_X + MA_EFFECTLIST_WIDTH + RSC_SP_CTRL_X + RSC_SP_CTRL_DESC_X + 6),
- RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Right = TRUE;
- Text [ en-US ] = "Direction" ;
- };
- ImageButton BTN_UP
- {
- Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - 2*MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT,
- RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP );
- Size = BUTTON_SIZE ;
- Symbol = IMAGEBUTTON_ARROW_UP ;
- QuickHelpText [ en-US ] = "To Top" ;
- };
- ImageButton BTN_LEFT
- {
- Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - 3*MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT,
- RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + MA_BUTTON_HEIGHT);
- Size = BUTTON_SIZE ;
- Symbol = IMAGEBUTTON_ARROW_LEFT ;
- QuickHelpText [ en-US ] = "To Left" ;
- };
- ImageButton BTN_RIGHT
- {
- Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT,
- RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + MA_BUTTON_HEIGHT ) ;
- Size = BUTTON_SIZE ;
- Symbol = IMAGEBUTTON_ARROW_RIGHT ;
- QuickHelpText [ en-US ] = "To Right" ;
- };
- ImageButton BTN_DOWN
- {
- Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - 2*MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT,
- RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + 2*MA_BUTTON_HEIGHT ) ;
- Size = BUTTON_SIZE ;
- Symbol = IMAGEBUTTON_ARROW_DOWN ;
- QuickHelpText [ en-US ] = "To Bottom" ;
- };
-
- FixedLine FL_PROPERTIES
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT , RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Properties" ;
- };
-#define MA_CURR_Y2 RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- TriStateBox TSB_START_INSIDE
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y2 ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "S~tart inside" ;
- };
-#define MA_CURR_Y3 MA_CURR_Y2 + RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- TriStateBox TSB_STOP_INSIDE
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y3 ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Text visible when exiting" ;
- };
-#define MA_CURR_Y4 MA_CURR_Y3 + RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- FixedText FT_COUNT
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y4 ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12,
- RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Animation cycles" ;
- };
-#define MA_CURR_Y5 MA_CURR_Y4 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- TriStateBox TSB_ENDLESS
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 9 , MA_CURR_Y5 + 2 ) ;
- Size = MAP_APPFONT ( 71 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "~Continuous" ;
- };
- NumericField NUM_FLD_COUNT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 80 + RSC_SP_CTRL_GROUP_X,
- MA_CURR_Y5 ) ;
- Size = MAP_APPFONT ( 50 , RSC_CD_TEXTBOX_HEIGHT ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- First = 1 ;
- };
-#define MA_CURR_Y6 MA_CURR_Y5 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- FixedText FT_AMOUNT
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y6 ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12,
- RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Increment" ;
- };
-#define MA_CURR_Y7 MA_CURR_Y6 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- TriStateBox TSB_PIXEL
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 9 , MA_CURR_Y7 + 2 ) ;
- Size = MAP_APPFONT ( 71 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "~Pixels" ;
- };
- MetricField MTR_FLD_AMOUNT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 80 + RSC_SP_CTRL_GROUP_X,
- MA_CURR_Y7 ) ;
- Size = MAP_APPFONT ( 50 , RSC_CD_TEXTBOX_HEIGHT ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = " Pixel" ;
- Minimum = 1 ;
- First = 1 ;
- Maximum = 10000 ;
- Last = 10000 ;
- };
-#define MA_CURR_Y8 MA_CURR_Y7 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- FixedText FT_DELAY
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y8 ) ;
- Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12,
- RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Delay" ;
- };
-#define MA_CURR_Y9 MA_CURR_Y8 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- TriStateBox TSB_AUTO
- {
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 9 , MA_CURR_Y9 + 2 ) ;
- Size = MAP_APPFONT ( 71 , RSC_CD_CHECKBOX_HEIGHT ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Automatic" ;
- };
- MetricField MTR_FLD_DELAY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 80 + RSC_SP_CTRL_GROUP_X,
- MA_CURR_Y9 ) ;
- Size = MAP_APPFONT ( 50 , RSC_CD_TEXTBOX_HEIGHT ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Spinsize = 50 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = " ms" ;
- Maximum = 30000 ;
- Last = 30000 ;
- };
-};
- // RID_SVXDLG_TEXT -------------------------------------------------------
-TabDialog RID_SVXDLG_TEXT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 289 , 185 + 46 ) ;
- Text [ en-US ] = "Text" ;
- Moveable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- PageList =
- {
- PageItem
- {
- PageResID = RID_SVXPAGE_TEXTATTR ;
- Identifier = RID_SVXPAGE_TEXTATTR ;
- Text [ en-US ] = "Text" ;
- };
- PageItem
- {
- PageResID = RID_SVXPAGE_TEXTANIMATION ;
- Identifier = RID_SVXPAGE_TEXTANIMATION ;
- Text [ en-US ] = "Text Animation" ;
- };
- };
- };
-};
- // ******************************************************************* EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/textattr.cxx b/svx/source/cui/textattr.cxx
deleted file mode 100644
index a0e9d2b585..0000000000
--- a/svx/source/cui/textattr.cxx
+++ /dev/null
@@ -1,807 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textattr.cxx,v $
- * $Revision: 1.28 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <tools/shl.hxx>
-
-#include <svx/dialogs.hrc>
-#include <svx/svddef.hxx>
-#include <svx/sdtditm.hxx>
-#include <svx/sdtagitm.hxx>
-#include <svx/sdtaitm.hxx>
-#include <svx/sdtfsitm.hxx>
-#include <svx/sdtcfitm.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdmark.hxx>
-#include <svx/svdview.hxx>
-#include <svx/svdotext.hxx>
-
-
-#ifndef _SVX_TEXTATTR_CXX
-#define _SVX_TEXTATTR_CXX
-#endif
-#include "textattr.hxx"
-#include "textattr.hrc"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <sfx2/request.hxx> //add CHINA001
-#include <ofaitem.hxx> //add CHINA001
-#include <svx/svxids.hrc> //add CHINA001
-#include <svx/writingmodeitem.hxx>
-
-static USHORT pRanges[] =
-{
- SDRATTR_MISC_FIRST, SDRATTR_TEXT_HORZADJUST,
- SDRATTR_TEXT_WORDWRAP, SDRATTR_TEXT_AUTOGROWSIZE,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog zum Kopieren von Objekten
-|*
-\************************************************************************/
-
-//CHINA001 SvxTextAttrDialog::SvxTextAttrDialog( Window* pParent, const SfxItemSet& rInAttrs,
-//CHINA001 const SdrView* pSdrView ) :
-//CHINA001 SfxSingleTabDialog( pParent, rInAttrs, RID_SVXPAGE_TEXTATTR )
-//CHINA001 {
-//CHINA001 SvxTextAttrPage* pPage = new SvxTextAttrPage( this, rInAttrs );
-//CHINA001
-//CHINA001 pPage->SetView( pSdrView );
-//CHINA001 pPage->Construct();
-//CHINA001
-//CHINA001 SetTabPage( pPage );
-//CHINA001 SetText( pPage->GetText() );
-//CHINA001 }
-//CHINA001
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-//CHINA001 SvxTextAttrDialog::~SvxTextAttrDialog()
-//CHINA001 {
-//CHINA001 }
-
-/*************************************************************************
-|*
-|* Dialog (Seite) zum Kopieren von Objekten
-|*
-\************************************************************************/
-
-SvxTextAttrPage::SvxTextAttrPage( Window* pWindow, const SfxItemSet& rInAttrs ) :
- SvxTabPage ( pWindow, SVX_RES( RID_SVXPAGE_TEXTATTR ),
- rInAttrs ),
-
- aFlText ( this, SVX_RES( FL_TEXT ) ),
- aTsbAutoGrowWidth ( this, SVX_RES( TSB_AUTOGROW_WIDTH ) ),
- aTsbAutoGrowHeight ( this, SVX_RES( TSB_AUTOGROW_HEIGHT ) ),
- aTsbFitToSize ( this, SVX_RES( TSB_FIT_TO_SIZE ) ),
- aTsbContour ( this, SVX_RES( TSB_CONTOUR ) ),
- aTsbWordWrapText( this, SVX_RES( TSB_WORDWRAP_TEXT ) ),
- aTsbAutoGrowSize( this, SVX_RES( TSB_AUTOGROW_SIZE ) ),
- aFlDistance ( this, SVX_RES( FL_DISTANCE ) ),
- aFtLeft ( this, SVX_RES( FT_LEFT ) ),
- aMtrFldLeft ( this, SVX_RES( MTR_FLD_LEFT ) ),
- aFtRight ( this, SVX_RES( FT_RIGHT ) ),
- aMtrFldRight ( this, SVX_RES( MTR_FLD_RIGHT ) ),
- aFtTop ( this, SVX_RES( FT_TOP ) ),
- aMtrFldTop ( this, SVX_RES( MTR_FLD_TOP ) ),
- aFtBottom ( this, SVX_RES( FT_BOTTOM ) ),
- aMtrFldBottom ( this, SVX_RES( MTR_FLD_BOTTOM ) ),
-
- aFlSeparator ( this, SVX_RES( FL_SEPARATOR ) ),
-
- aFlPosition ( this, SVX_RES( FL_POSITION ) ),
- aCtlPosition ( this, SVX_RES( CTL_POSITION ),
- RP_MM, 240, 100 ),
- aTsbFullWidth ( this, SVX_RES( TSB_FULL_WIDTH ) ),
-
- rOutAttrs ( rInAttrs )
-{
- FreeResource();
-
- FieldUnit eFUnit = GetModuleFieldUnit( &rInAttrs );
- SetFieldUnit( aMtrFldLeft, eFUnit );
- SetFieldUnit( aMtrFldRight, eFUnit );
- SetFieldUnit( aMtrFldTop, eFUnit );
- SetFieldUnit( aMtrFldBottom, eFUnit );
-
- Link aLink( LINK( this, SvxTextAttrPage, ClickHdl_Impl ) );
- aTsbAutoGrowWidth.SetClickHdl( aLink );
- aTsbAutoGrowHeight.SetClickHdl( aLink );
- aTsbFitToSize.SetClickHdl( aLink );
- aTsbContour.SetClickHdl( aLink );
-
- aTsbFullWidth.SetClickHdl(
- LINK( this, SvxTextAttrPage, ClickFullWidthHdl_Impl ) );
-}
-
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxTextAttrPage::~SvxTextAttrPage()
-{
-}
-
-/*************************************************************************
-|*
-|* Liest uebergebenen Item-Set
-|*
-\************************************************************************/
-
-void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
-{
- SfxItemPool* pPool = rAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
-
- // Linker Abstand vom Rahmen
- const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_LEFTDIST );
-
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LEFTDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrTextLeftDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldLeft, nValue, eUnit );
- }
- else
- aMtrFldLeft.SetText( String() );
- aMtrFldLeft.SaveValue();
-
- // Rechter Abstand vom Rahmen
- pItem = GetItem( rAttrs, SDRATTR_TEXT_RIGHTDIST );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_RIGHTDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrTextRightDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldRight, nValue, eUnit );
- }
- else
- aMtrFldRight.SetText( String() );
- aMtrFldRight.SaveValue();
-
- // Oberer Abstand vom Rahmen
- pItem = GetItem( rAttrs, SDRATTR_TEXT_UPPERDIST );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_UPPERDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrTextUpperDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldTop, nValue, eUnit );
- }
- else
- aMtrFldTop.SetText( String() );
- aMtrFldTop.SaveValue();
-
- // Unterer Abstand vom Rahmen
- pItem = GetItem( rAttrs, SDRATTR_TEXT_LOWERDIST );
- if( !pItem )
- pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LOWERDIST );
- if( pItem )
- {
- long nValue = ( ( const SdrTextLowerDistItem* )pItem )->GetValue();
- SetMetricValue( aMtrFldBottom, nValue, eUnit );
- }
- else
- aMtrFldBottom.SetText( String() );
- aMtrFldBottom.SaveValue();
-
- // An Hoehe anpassen
- if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) != SFX_ITEM_DONTCARE )
- {
- aTsbAutoGrowHeight.SetState( ( ( const SdrTextAutoGrowHeightItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
- GetValue() ? STATE_CHECK : STATE_NOCHECK );
- aTsbAutoGrowHeight.EnableTriState( FALSE );
- }
- else
- aTsbAutoGrowHeight.SetState( STATE_DONTKNOW );
- aTsbAutoGrowHeight.SaveValue();
-
- // An Breite anpassen
- if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWWIDTH ) != SFX_ITEM_DONTCARE )
- {
- aTsbAutoGrowWidth.SetState( ( ( const SdrTextAutoGrowWidthItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWWIDTH ) ).
- GetValue() ? STATE_CHECK : STATE_NOCHECK );
- aTsbAutoGrowWidth.EnableTriState( FALSE );
- }
- else
- aTsbAutoGrowWidth.SetState( STATE_DONTKNOW );
- aTsbAutoGrowWidth.SaveValue();
-
- // autogrowsize
- if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWSIZE ) != SFX_ITEM_DONTCARE )
- {
- aTsbAutoGrowSize.SetState( ( ( const SdrTextAutoGrowHeightItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
- GetValue() ? STATE_CHECK : STATE_NOCHECK );
- aTsbAutoGrowSize.EnableTriState( FALSE );
- }
- else
- aTsbAutoGrowSize.SetState( STATE_DONTKNOW );
- aTsbAutoGrowSize.SaveValue();
-
- // wordwrap text
- if ( rAttrs.GetItemState( SDRATTR_TEXT_WORDWRAP ) != SFX_ITEM_DONTCARE )
- {
- aTsbWordWrapText.SetState( ( ( const SdrTextWordWrapItem& )rAttrs.Get( SDRATTR_TEXT_WORDWRAP ) ).
- GetValue() ? STATE_CHECK : STATE_NOCHECK );
- aTsbWordWrapText.EnableTriState( FALSE );
- }
- else
- aTsbWordWrapText.SetState( STATE_DONTKNOW );
- aTsbWordWrapText.SaveValue();
-
-
- // #103516# Do the setup based on states of hor/ver adjust
- // Setup center field and FullWidth
- SfxItemState eVState = rAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST );
- SfxItemState eHState = rAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
-
- if(SFX_ITEM_DONTCARE != eVState && SFX_ITEM_DONTCARE != eHState)
- {
- // VertAdjust and HorAdjust are unequivocal, thus
- SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)rAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
- SdrTextHorzAdjust eTHA = (SdrTextHorzAdjust)((const SdrTextHorzAdjustItem&)rAttrs.Get(SDRATTR_TEXT_HORZADJUST)).GetValue();
- RECT_POINT eRP = RP_LB;
-
- aTsbFullWidth.EnableTriState( FALSE );
-
- // Translate item values into local anchor position.
- switch (eTVA)
- {
- case SDRTEXTVERTADJUST_TOP:
- {
- switch (eTHA)
- {
- case SDRTEXTHORZADJUST_LEFT: eRP = RP_LT; break;
- case SDRTEXTHORZADJUST_BLOCK:
- case SDRTEXTHORZADJUST_CENTER: eRP = RP_MT; break;
- case SDRTEXTHORZADJUST_RIGHT: eRP = RP_RT; break;
- }
- break;
- }
- case SDRTEXTVERTADJUST_BLOCK:
- case SDRTEXTVERTADJUST_CENTER:
- {
- switch (eTHA)
- {
- case SDRTEXTHORZADJUST_LEFT: eRP = RP_LM; break;
- case SDRTEXTHORZADJUST_BLOCK:
- case SDRTEXTHORZADJUST_CENTER: eRP = RP_MM; break;
- case SDRTEXTHORZADJUST_RIGHT: eRP = RP_RM; break;
- }
- break;
- }
- case SDRTEXTVERTADJUST_BOTTOM:
- {
- switch (eTHA)
- {
- case SDRTEXTHORZADJUST_LEFT: eRP = RP_LB; break;
- case SDRTEXTHORZADJUST_BLOCK:
- case SDRTEXTHORZADJUST_CENTER: eRP = RP_MB; break;
- case SDRTEXTHORZADJUST_RIGHT: eRP = RP_RB; break;
- }
- break;
- }
- default:
- break;
- }
-
- // See if we have to check the "full width" check button.
- sal_Bool bLeftToRight(IsTextDirectionLeftToRight());
-
- if((bLeftToRight && (SDRTEXTHORZADJUST_BLOCK == eTHA)) || (!bLeftToRight && (SDRTEXTVERTADJUST_BLOCK == eTVA)))
- {
- // Move anchor to valid position.
- ClickFullWidthHdl_Impl(NULL);
- aTsbFullWidth.SetState(STATE_CHECK);
- }
-
- aCtlPosition.SetActualRP( eRP );
- }
- else
- {
- // VertAdjust or HorAdjust is not unequivocal
- aCtlPosition.Reset();
-
- aCtlPosition.SetState(STATE_DONTKNOW);
- aCtlPosition.DoCompletelyDisable(sal_True);
-
- aTsbFullWidth.SetState(STATE_DONTKNOW);
- aTsbFullWidth.Enable( sal_False );
- aFlPosition.Enable( sal_False );
- }
-
- // Am Rahmen anpassen
- if ( rAttrs.GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SFX_ITEM_DONTCARE )
- {
- SdrFitToSizeType eFTS = (SdrFitToSizeType)
- ( ( const SdrTextFitToSizeTypeItem& )rAttrs.Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue();
- aTsbFitToSize.SetState( eFTS == SDRTEXTFIT_NONE ? STATE_NOCHECK : STATE_CHECK );
- aTsbFitToSize.EnableTriState( FALSE );
- }
- else
- aTsbFitToSize.SetState( STATE_DONTKNOW );
- aTsbFitToSize.SaveValue();
-
- // Konturfluss
- if( rAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME ) != SFX_ITEM_DONTCARE )
- {
- BOOL bContour = ( ( const SdrTextContourFrameItem& )rAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
- aTsbContour.SetState( bContour ? STATE_CHECK : STATE_NOCHECK );
- aTsbContour.EnableTriState( FALSE );
- }
- else
- aTsbContour.SetState( STATE_DONTKNOW );
- aTsbContour.SaveValue();
-
- ClickHdl_Impl( NULL );
-}
-
-/*************************************************************************
-|*
-|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
-|*
-\************************************************************************/
-
-BOOL SvxTextAttrPage::FillItemSet( SfxItemSet& rAttrs)
-{
- SfxItemPool* pPool = rAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
-
- INT32 nValue;
- TriState eState;
-
- if( aMtrFldLeft.GetText() != aMtrFldLeft.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldLeft, eUnit );
- rAttrs.Put( SdrTextLeftDistItem( nValue ) );
- }
-
- if( aMtrFldRight.GetText() != aMtrFldRight.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldRight, eUnit );
- rAttrs.Put( SdrTextRightDistItem( nValue ) );
- }
-
- if( aMtrFldTop.GetText() != aMtrFldTop.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldTop, eUnit );
- rAttrs.Put( SdrTextUpperDistItem( nValue ) );
- }
-
- if( aMtrFldBottom.GetText() != aMtrFldBottom.GetSavedValue() )
- {
- nValue = GetCoreValue( aMtrFldBottom, eUnit );
- rAttrs.Put( SdrTextLowerDistItem( nValue ) );
- }
-
- eState = aTsbAutoGrowHeight.GetState();
- if( eState != aTsbAutoGrowHeight.GetSavedValue() )
- {
- rAttrs.Put( SdrTextAutoGrowHeightItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- eState = aTsbAutoGrowWidth.GetState();
- if( eState != aTsbAutoGrowWidth.GetSavedValue() )
- {
- rAttrs.Put( SdrTextAutoGrowWidthItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- eState = aTsbAutoGrowSize.GetState();
- if( eState != aTsbAutoGrowSize.GetSavedValue() )
- {
- rAttrs.Put( SdrTextAutoGrowHeightItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- eState = aTsbWordWrapText.GetState();
- if( eState != aTsbWordWrapText.GetSavedValue() )
- {
- rAttrs.Put( SdrTextWordWrapItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- // Konturfluss
- eState = aTsbContour.GetState();
- if( eState != aTsbContour.GetSavedValue() )
- {
- rAttrs.Put( SdrTextContourFrameItem( (BOOL) STATE_CHECK == eState ) );
- }
-
- eState = aTsbFitToSize.GetState();
- if( eState != aTsbFitToSize.GetSavedValue() )
- {
- SdrFitToSizeType eFTS;
- switch( eState )
- {
- default: ; //prevent warning
- DBG_ERROR( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" );
- case STATE_NOCHECK: eFTS = SDRTEXTFIT_NONE; break;
- //case STATE_CHECK: eFTS = SDRTEXTFIT_RESIZEATTR; break;
- case STATE_CHECK: eFTS = SDRTEXTFIT_PROPORTIONAL; break;
- }
- rAttrs.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- }
-
- // zentriert
- RECT_POINT eRP = aCtlPosition.GetActualRP();
- SdrTextVertAdjust eTVA, eOldTVA;
- SdrTextHorzAdjust eTHA, eOldTHA;
-
- switch( eRP )
- {
- default:
- case RP_LT: eTVA = SDRTEXTVERTADJUST_TOP;
- eTHA = SDRTEXTHORZADJUST_LEFT; break;
- case RP_LM: eTVA = SDRTEXTVERTADJUST_CENTER;
- eTHA = SDRTEXTHORZADJUST_LEFT; break;
- case RP_LB: eTVA = SDRTEXTVERTADJUST_BOTTOM;
- eTHA = SDRTEXTHORZADJUST_LEFT; break;
- case RP_MT: eTVA = SDRTEXTVERTADJUST_TOP;
- eTHA = SDRTEXTHORZADJUST_CENTER; break;
- case RP_MM: eTVA = SDRTEXTVERTADJUST_CENTER;
- eTHA = SDRTEXTHORZADJUST_CENTER; break;
- case RP_MB: eTVA = SDRTEXTVERTADJUST_BOTTOM;
- eTHA = SDRTEXTHORZADJUST_CENTER; break;
- case RP_RT: eTVA = SDRTEXTVERTADJUST_TOP;
- eTHA = SDRTEXTHORZADJUST_RIGHT; break;
- case RP_RM: eTVA = SDRTEXTVERTADJUST_CENTER;
- eTHA = SDRTEXTHORZADJUST_RIGHT; break;
- case RP_RB: eTVA = SDRTEXTVERTADJUST_BOTTOM;
- eTHA = SDRTEXTHORZADJUST_RIGHT; break;
- }
-
- // #103516# Do not change values if adjust controls were disabled.
- sal_Bool bIsDisabled(aCtlPosition.IsCompletelyDisabled());
-
- if(!bIsDisabled)
- {
- if( aTsbFullWidth.GetState() == STATE_CHECK )
- {
- if (IsTextDirectionLeftToRight())
- eTHA = SDRTEXTHORZADJUST_BLOCK;
- else
- eTVA = SDRTEXTVERTADJUST_BLOCK;
- }
-
- if ( rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ) != SFX_ITEM_DONTCARE )
- {
- eOldTVA = (SdrTextVertAdjust)
- ( ( const SdrTextVertAdjustItem& )rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
- if( eOldTVA != eTVA )
- rAttrs.Put( SdrTextVertAdjustItem( eTVA ) );
- }
- else
- rAttrs.Put( SdrTextVertAdjustItem( eTVA ) );
-
- if ( rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ) != SFX_ITEM_DONTCARE )
- {
- eOldTHA = (SdrTextHorzAdjust)
- ( ( const SdrTextHorzAdjustItem& )rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
- if( eOldTHA != eTHA )
- rAttrs.Put( SdrTextHorzAdjustItem( eTHA ) );
- }
- else
- rAttrs.Put( SdrTextHorzAdjustItem( eTHA ) );
- }
-
- return( TRUE );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SvxTextAttrPage::Construct()
-{
- DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
-
- bFitToSizeEnabled = bContourEnabled = TRUE;
- bWordWrapTextEnabled = bAutoGrowSizeEnabled = bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = FALSE;
-
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
- {
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
- if( pObj->GetObjInventor() == SdrInventor )
- {
- switch( eKind )
- {
- case OBJ_TEXT :
- case OBJ_TITLETEXT :
- case OBJ_OUTLINETEXT :
- case OBJ_CAPTION :
- {
- if ( ((SdrTextObj*)pObj)->HasText() )
- {
- // Konturfluss ist NICHT bei reinen Textobjekten m�glich
- bContourEnabled = FALSE;
-
- // Breite und Hoehe anpassen ist NUR bei reinen Textobjekten m�glich
- bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = TRUE;
- }
- }
- break;
- case OBJ_CUSTOMSHAPE :
- {
- bFitToSizeEnabled = bContourEnabled = FALSE;
- bAutoGrowSizeEnabled = TRUE;
- bWordWrapTextEnabled = TRUE;
- }
- break;
- default: ;//prevent warning
- }
- }
- }
- aTsbAutoGrowHeight.Enable( bAutoGrowHeightEnabled );
- aTsbAutoGrowWidth.Enable( bAutoGrowWidthEnabled );
- aTsbFitToSize.Enable( bFitToSizeEnabled );
- aTsbContour.Enable( bContourEnabled );
- aTsbAutoGrowSize.Enable( bAutoGrowSizeEnabled );
- aTsbWordWrapText.Enable( bWordWrapTextEnabled );
-}
-
-/*************************************************************************
-|*
-|* Erzeugt die Seite
-|*
-\************************************************************************/
-
-SfxTabPage* SvxTextAttrPage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxTextAttrPage( pWindow, rAttrs ) );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-USHORT* SvxTextAttrPage::GetRanges()
-{
- return( pRanges );
-}
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-/** Check whether we have to uncheck the "Full width" check box.
-*/
-void SvxTextAttrPage::PointChanged( Window*, RECT_POINT eRP )
-{
- if (aTsbFullWidth.GetState() == STATE_CHECK)
- {
- // Depending on write direction and currently checked anchor we have
- // to uncheck the "full width" button.
- if (IsTextDirectionLeftToRight())
- switch( eRP )
- {
- case RP_LT:
- case RP_LM:
- case RP_LB:
- case RP_RT:
- case RP_RM:
- case RP_RB:
- aTsbFullWidth.SetState( STATE_NOCHECK );
- break;
- default: ;//prevent warning
- }
- else
- switch (eRP)
- {
- case RP_LT:
- case RP_MT:
- case RP_RT:
- case RP_LB:
- case RP_MB:
- case RP_RB:
- aTsbFullWidth.SetState( STATE_NOCHECK );
- break;
- default: ;//prevent warning
- }
- }
-}
-
-/*************************************************************************
-|*
-|* Aendert evtl. die Position des Positions-Controls
-|*
-\************************************************************************/
-
-/** When switching the "full width" check button on the text anchor may have
- to be moved to a valid and adjacent position. This position depends on
- the current anchor position and the text writing direction.
-*/
-IMPL_LINK( SvxTextAttrPage, ClickFullWidthHdl_Impl, void *, EMPTYARG )
-{
- if( aTsbFullWidth.GetState() == STATE_CHECK )
- {
- if (IsTextDirectionLeftToRight())
- {
- // Move text anchor to horizontal middle axis.
- switch( aCtlPosition.GetActualRP() )
- {
- case RP_LT:
- case RP_RT:
- aCtlPosition.SetActualRP( RP_MT );
- break;
-
- case RP_LM:
- case RP_RM:
- aCtlPosition.SetActualRP( RP_MM );
- break;
-
- case RP_LB:
- case RP_RB:
- aCtlPosition.SetActualRP( RP_MB );
- break;
- default: ;//prevent warning
- }
- }
- else
- {
- // Move text anchor to vertical middle axis.
- switch( aCtlPosition.GetActualRP() )
- {
- case RP_LT:
- case RP_LB:
- aCtlPosition.SetActualRP( RP_LM );
- break;
-
- case RP_MT:
- case RP_MB:
- aCtlPosition.SetActualRP( RP_MM );
- break;
-
- case RP_RT:
- case RP_RB:
- aCtlPosition.SetActualRP( RP_RM );
- break;
- default: ;//prevent warning
- }
- }
- }
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled "Groesse an Text" oder "Am Rahmen Anpassen"
-|*
-\************************************************************************/
-
-IMPL_LINK( SvxTextAttrPage, ClickHdl_Impl, void *, EMPTYARG )
-{
- BOOL bAutoGrowWidth = aTsbAutoGrowWidth.GetState() == STATE_CHECK;
- BOOL bAutoGrowHeight = aTsbAutoGrowHeight.GetState() == STATE_CHECK;
- BOOL bFitToSize = aTsbFitToSize.GetState() == STATE_CHECK;
- BOOL bContour = aTsbContour.GetState() == STATE_CHECK;
-
- aTsbContour.Enable( !bFitToSize &&
- !( ( bAutoGrowWidth && bAutoGrowWidthEnabled ) || ( bAutoGrowHeight && bAutoGrowHeightEnabled ) ) &&
- bContourEnabled );
-
- aTsbAutoGrowWidth.Enable( !bFitToSize &&
- !( bContour && bContourEnabled ) &&
- bAutoGrowWidthEnabled );
-
- aTsbAutoGrowHeight.Enable( !bFitToSize &&
- !( bContour && bContourEnabled ) &&
- bAutoGrowHeightEnabled );
-
- aTsbFitToSize.Enable( !( ( bAutoGrowWidth && bAutoGrowWidthEnabled ) || ( bAutoGrowHeight && bAutoGrowHeightEnabled ) ) &&
- !( bContour && bContourEnabled ) &&
- bFitToSizeEnabled );
-
- // #101901# enable/disable metric fields and decorations dependent of contour
- aMtrFldLeft.Enable(!bContour);
- aMtrFldRight.Enable(!bContour);
- aMtrFldTop.Enable(!bContour);
- aMtrFldBottom.Enable(!bContour);
- aFlDistance.Enable(!bContour);
- aFtLeft.Enable(!bContour);
- aFtRight.Enable(!bContour);
- aFtTop.Enable(!bContour);
- aFtBottom.Enable(!bContour);
-
- if( bContour && bContourEnabled )
- {
- aMtrFldLeft.SetValue( 0 );
- aMtrFldRight.SetValue( 0 );
- aMtrFldTop.SetValue( 0 );
- aMtrFldBottom.SetValue( 0 );
- }
-
- // #103516# Do the setup based on states of hor/ver adjust
- SfxItemState eVState = rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST );
- SfxItemState eHState = rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
- sal_Bool bHorAndVer(SFX_ITEM_DONTCARE == eVState || SFX_ITEM_DONTCARE == eHState);
-
- // #83698# enable/disable text anchoring dependent of contour
- aCtlPosition.Enable(!bContour && !bHorAndVer);
- aTsbFullWidth.Enable(!bContour && !bHorAndVer);
- aFlPosition.Enable(!bContour && !bHorAndVer);
-
- return( 0L );
-}
-
-
-bool SvxTextAttrPage::IsTextDirectionLeftToRight (void) const
-{
- // Determine the text writing direction with left to right as default.
- bool bLeftToRightDirection = true;
- SfxItemState eState = rOutAttrs.GetItemState(SDRATTR_TEXTDIRECTION);
-
- if(SFX_ITEM_DONTCARE != eState)
- {
- const SvxWritingModeItem& rItem = static_cast<const SvxWritingModeItem&> (
- rOutAttrs.Get (SDRATTR_TEXTDIRECTION));
- if (rItem.GetValue() == com::sun::star::text::WritingMode_TB_RL)
- bLeftToRightDirection = false;
- }
- return bLeftToRightDirection;
-}
-
-//add CHINA001 begin
-void SvxTextAttrPage::PageCreated(SfxAllItemSet aSet)
-{
- SFX_ITEMSET_ARG (&aSet,pViewItem,OfaPtrItem,SID_SVXTEXTATTRPAGE_VIEW,sal_False);
-
- if (pViewItem)
- SetView( static_cast<SdrView *>(pViewItem->GetValue()));
-
- Construct();
-}
-
-//end of CHINA001
diff --git a/svx/source/cui/textattr.hrc b/svx/source/cui/textattr.hrc
deleted file mode 100644
index a288f2befd..0000000000
--- a/svx/source/cui/textattr.hrc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textattr.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define FL_TEXT 2
-#define FL_DISTANCE 1
-#define FL_POSITION 3
-#define FL_SEPARATOR 4
-#define TSB_AUTOGROW_HEIGHT 1
-#define TSB_AUTOGROW_WIDTH 2
-#define TSB_FIT_TO_SIZE 3
-#define TSB_FULL_WIDTH 4
-#define TSB_CONTOUR 5
-#define TSB_WORDWRAP_TEXT 6
-#define TSB_AUTOGROW_SIZE 7
-#define CTL_POSITION 1
-#define FT_LEFT 1
-#define MTR_FLD_LEFT 1
-#define FT_RIGHT 2
-#define MTR_FLD_RIGHT 2
-#define FT_TOP 3
-#define MTR_FLD_TOP 3
-#define FT_BOTTOM 4
-#define MTR_FLD_BOTTOM 4
diff --git a/svx/source/cui/textattr.hxx b/svx/source/cui/textattr.hxx
deleted file mode 100644
index 63ef963b81..0000000000
--- a/svx/source/cui/textattr.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textattr.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TEXTATTR_HXX
-#define _SVX_TEXTATTR_HXX
-
-// include ---------------------------------------------------------------
-
-#include <svx/dlgctrl.hxx>
-
-#ifndef _GROUP_HXX //autogen
-#include <vcl/group.hxx>
-#endif
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-#include <sfx2/basedlgs.hxx>
-
-class SdrView;
-
-/*************************************************************************
-|*
-|* Dialog zum "Andern von TextAttributen
-|*
-\************************************************************************/
-
-class SvxTextAttrPage : public SvxTabPage
-{
-private:
- FixedLine aFlText;
- TriStateBox aTsbAutoGrowWidth;
- TriStateBox aTsbAutoGrowHeight;
- TriStateBox aTsbFitToSize;
- TriStateBox aTsbContour;
- TriStateBox aTsbWordWrapText;
- TriStateBox aTsbAutoGrowSize;
-
-
- FixedLine aFlDistance;
- FixedText aFtLeft;
- MetricField aMtrFldLeft;
- FixedText aFtRight;
- MetricField aMtrFldRight;
- FixedText aFtTop;
- MetricField aMtrFldTop;
- FixedText aFtBottom;
- MetricField aMtrFldBottom;
-
- FixedLine aFlSeparator;
-
- FixedLine aFlPosition;
- SvxRectCtl aCtlPosition;
- TriStateBox aTsbFullWidth;
-
- const SfxItemSet& rOutAttrs;
- const SdrView* pView;
-
- BOOL bAutoGrowSizeEnabled;
- BOOL bContourEnabled;
- BOOL bAutoGrowWidthEnabled;
- BOOL bAutoGrowHeightEnabled;
- BOOL bWordWrapTextEnabled;
- BOOL bFitToSizeEnabled;
-
-
-#ifdef _SVX_TEXTATTR_CXX
- DECL_LINK( ClickFullWidthHdl_Impl, void * );
- DECL_LINK( ClickHdl_Impl, void * );
-#endif
-
- /** Return whether the text direction is from left to right (</TRUE>) or
- top to bottom (</FALSE>).
- */
- bool IsTextDirectionLeftToRight (void) const;
-
-public:
-
- SvxTextAttrPage( Window* pWindow, const SfxItemSet& rInAttrs );
- ~SvxTextAttrPage();
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void Construct();
- void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
- virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
-};
-
-/*************************************************************************
-|*
-|* Von SfxSingleTabDialog abgeleitet, um vom Control "uber virtuelle Methode
-|* benachrichtigt werden zu k"onnen.
-|*
-\************************************************************************/
-
-//CHINA001 class SvxTextAttrDialog : public SfxSingleTabDialog
-//CHINA001 {
-//CHINA001 public:
-//CHINA001 SvxTextAttrDialog( Window* pParent, const SfxItemSet& rAttr,
-//CHINA001 const SdrView* pView );
-//CHINA001 ~SvxTextAttrDialog();
-//CHINA001 };
-
-
-#endif // _SVX_TEXTATTR_HXX
-
diff --git a/svx/source/cui/textattr.src b/svx/source/cui/textattr.src
deleted file mode 100644
index 293dad2462..0000000000
--- a/svx/source/cui/textattr.src
+++ /dev/null
@@ -1,247 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: textattr.src,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svtools/controldims.hrc>
-#include <svx/dialogs.hrc>
-#include "textattr.hrc"
-#include "helpid.hrc"
- // pragma ----------------------------------------------------------------
-
- // RID_SVXPAGE_TEXTATTR --------------------------------------------------
-TabPage RID_SVXPAGE_TEXTATTR
-{
- HelpId = HID_PAGE_TEXTATTR ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Text" ;
- FixedLine FL_TEXT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Text" ;
- };
- TriStateBox TSB_AUTOGROW_WIDTH
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 102 , 10 ) ;
- Text [ en-US ] = "Fit wi~dth to text" ;
- };
- TriStateBox TSB_AUTOGROW_HEIGHT
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 102 , 10 ) ;
- Text [ en-US ] = "Fit h~eight to text" ;
- };
- TriStateBox TSB_FIT_TO_SIZE
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 102 , 10 ) ;
- Text [ en-US ] = "~Fit to frame" ;
- };
- TriStateBox TSB_CONTOUR
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 102 , 10 ) ;
- Text [ en-US ] = "~Adjust to contour" ;
- };
- TriStateBox TSB_WORDWRAP_TEXT
- {
- TabStop = TRUE;
- Pos = MAP_APPFONT( 132, 14 ) ;
- Size = MAP_APPFONT( 127 , 10 ) ;
- Text [ en-US ] = "~Word wrap text in shape";
- };
- TriStateBox TSB_AUTOGROW_SIZE
- {
- TabStop = TRUE;
- Pos = MAP_APPFONT( 132, 28 );
- Size = MAP_APPFONT( 127 , 10 );
- Text [ en-US ] = "~Resize shape to fit text";
- };
- FixedLine FL_DISTANCE
- {
- Pos = MAP_APPFONT ( 6 , 72 ) ;
- Size = MAP_APPFONT ( 114 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Spacing to borders" ;
- };
- FixedText FT_LEFT
- {
- Pos = MAP_APPFONT ( 12 , 85 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Left" ;
- };
- FixedText FT_RIGHT
- {
- Pos = MAP_APPFONT ( 12 , 101 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Right" ;
- };
- FixedText FT_TOP
- {
- Pos = MAP_APPFONT ( 12 , 117 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Top" ;
- };
- FixedText FT_BOTTOM
- {
- Pos = MAP_APPFONT ( 12 , 133 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~Bottom" ;
- };
- MetricField MTR_FLD_LEFT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 69 , 83 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_RIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 69 , 99 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_TOP
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 69 , 115 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_BOTTOM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 69 , 131 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- Minimum = -10000 ;
- First = -10000 ;
- Maximum = 10000 ;
- Last = 10000 ;
- SpinSize = 10 ;
- };
- FixedLine FL_SEPARATOR
- {
- Pos = MAP_APPFONT ( 121 , 83 ) ;
- Size = MAP_APPFONT ( RSC_CD_FIXEDLINE_WIDTH , 66 ) ;
- Vert = TRUE;
- };
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 126 , 72 ) ;
- Size = MAP_APPFONT ( 128 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Text anchor" ;
- };
- Control CTL_POSITION
- {
- HelpId = HID_TEXTATTR_CTL_POSITION ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 132 , 83 ) ;
- Size = MAP_APPFONT ( 116 , 52 ) ;
- TabStop = TRUE ;
- };
- TriStateBox TSB_FULL_WIDTH
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT ( 132 , 139 ) ;
- Size = MAP_APPFONT ( 116 , 10 ) ;
- Text [ en-US ] = "Full ~width" ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/tparea.cxx b/svx/source/cui/tparea.cxx
deleted file mode 100644
index 961c878df2..0000000000
--- a/svx/source/cui/tparea.cxx
+++ /dev/null
@@ -1,2586 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tparea.cxx,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-
-#define _SVX_TPAREA_CXX
-
-#if defined (UNX) || defined (WTC) || defined (ICC) || defined(WNT)
-#include <stdlib.h>
-#endif
-
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/dialogs.hrc>
-#include "tabarea.hrc"
-#include "dlgname.hrc"
-#include <svx/xflbckit.hxx>
-#include <svx/svdattr.hxx>
-#include <svx/xtable.hxx>
-#include <svx/xlineit0.hxx>
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include "dlgname.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <svtools/intitem.hxx> //add CHINA001
-#include <sfx2/request.hxx>//add CHINA001
-
-#define DLGWIN this->GetParent()->GetParent()
-
-// static ----------------------------------------------------------------
-
-static USHORT pAreaRanges[] =
-{
- XATTR_GRADIENTSTEPCOUNT,
- XATTR_GRADIENTSTEPCOUNT,
- SID_ATTR_FILL_STYLE,
- SID_ATTR_FILL_BITMAP,
- 0
-};
-
-static USHORT pTransparenceRanges[] =
-{
- XATTR_FILLTRANSPARENCE,
- XATTR_FILLTRANSPARENCE,
- SDRATTR_SHADOWTRANSPARENCE,
- SDRATTR_SHADOWTRANSPARENCE,
- XATTR_FILLFLOATTRANSPARENCE,
- XATTR_FILLFLOATTRANSPARENCE,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog for transparence
-|*
-\************************************************************************/
-
-IMPL_LINK(SvxTransparenceTabPage, ClickTransOffHdl_Impl, void *, EMPTYARG)
-{
- // disable all other controls
- ActivateLinear(FALSE);
- ActivateGradient(FALSE);
-
- // Preview
- rXFSet.ClearItem (XATTR_FILLTRANSPARENCE);
- rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE);
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- InvalidatePreview( FALSE );
-
- return( 0L );
-}
-
-IMPL_LINK(SvxTransparenceTabPage, ClickTransLinearHdl_Impl, void *, EMPTYARG)
-{
- // enable linear, disable other
- ActivateLinear(TRUE);
- ActivateGradient(FALSE);
-
- // preview
- rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE);
- ModifyTransparentHdl_Impl (NULL);
-
- return( 0L );
-}
-
-IMPL_LINK(SvxTransparenceTabPage, ClickTransGradientHdl_Impl, void *, EMPTYARG)
-{
- // enable gradient, disable other
- ActivateLinear(FALSE);
- ActivateGradient(TRUE);
-
- // preview
- rXFSet.ClearItem (XATTR_FILLTRANSPARENCE);
- ModifiedTrgrHdl_Impl (NULL);
-
- return( 0L );
-}
-
-void SvxTransparenceTabPage::ActivateLinear(BOOL bActivate)
-{
- aMtrTransparent.Enable(bActivate);
-}
-
-IMPL_LINK(SvxTransparenceTabPage, ModifyTransparentHdl_Impl, void*, EMPTYARG)
-{
- UINT16 nPos = (UINT16)aMtrTransparent.GetValue();
- XFillTransparenceItem aItem(nPos);
- rXFSet.Put(XFillTransparenceItem(aItem));
-
- // preview
- InvalidatePreview();
-
- return 0L;
-}
-
-IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrHdl_Impl, void *, pControl)
-{
- if(pControl == &aLbTrgrGradientType || pControl == this)
- {
- XGradientStyle eXGS = (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos();
- SetControlState_Impl( eXGS );
- }
-
- // preview
- UINT8 nStartCol = (UINT8)(((UINT16)aMtrTrgrStartValue.GetValue() * 255) / 100);
- UINT8 nEndCol = (UINT8)(((UINT16)aMtrTrgrEndValue.GetValue() * 255) / 100);
- XGradient aTmpGradient(
- Color(nStartCol, nStartCol, nStartCol),
- Color(nEndCol, nEndCol, nEndCol),
- (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos(),
- (UINT16)aMtrTrgrAngle.GetValue() * 10,
- (UINT16)aMtrTrgrCenterX.GetValue(),
- (UINT16)aMtrTrgrCenterY.GetValue(),
- (UINT16)aMtrTrgrBorder.GetValue(),
- 100, 100);
-
- String aString;
- XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aTmpGradient);
- rXFSet.Put ( aItem );
-
- InvalidatePreview();
-
- return( 0L );
-}
-
-void SvxTransparenceTabPage::ActivateGradient(BOOL bActivate)
-{
- aFtTrgrType.Enable(bActivate);
- aLbTrgrGradientType.Enable(bActivate);
- aFtTrgrCenterX.Enable(bActivate);
- aMtrTrgrCenterX.Enable(bActivate);
- aFtTrgrCenterY.Enable(bActivate);
- aMtrTrgrCenterY.Enable(bActivate);
- aFtTrgrAngle.Enable(bActivate);
- aMtrTrgrAngle.Enable(bActivate);
- aFtTrgrBorder.Enable(bActivate);
- aMtrTrgrBorder.Enable(bActivate);
- aFtTrgrStartValue.Enable(bActivate);
- aMtrTrgrStartValue.Enable(bActivate);
- aFtTrgrEndValue.Enable(bActivate);
- aMtrTrgrEndValue.Enable(bActivate);
-
- if(bActivate)
- {
- XGradientStyle eXGS = (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos();
- SetControlState_Impl( eXGS );
- }
-}
-
-IMPL_LINK(SvxTransparenceTabPage, ChangeTrgrTypeHdl_Impl, void *, EMPTYARG)
-{
- return( 0L );
-}
-
-void SvxTransparenceTabPage::SetControlState_Impl(XGradientStyle eXGS)
-{
- switch(eXGS)
- {
- case XGRAD_LINEAR:
- case XGRAD_AXIAL:
- aFtTrgrCenterX.Disable();
- aMtrTrgrCenterX.Disable();
- aFtTrgrCenterY.Disable();
- aMtrTrgrCenterY.Disable();
- aFtTrgrAngle.Enable();
- aMtrTrgrAngle.Enable();
- break;
-
- case XGRAD_RADIAL:
- aFtTrgrCenterX.Enable();
- aMtrTrgrCenterX.Enable();
- aFtTrgrCenterY.Enable();
- aMtrTrgrCenterY.Enable();
- aFtTrgrAngle.Disable();
- aMtrTrgrAngle.Disable();
- break;
-
- case XGRAD_ELLIPTICAL:
- aFtTrgrCenterX.Enable();
- aMtrTrgrCenterX.Enable();
- aFtTrgrCenterY.Enable();
- aMtrTrgrCenterY.Enable();
- aFtTrgrAngle.Enable();
- aMtrTrgrAngle.Enable();
- break;
-
- case XGRAD_SQUARE:
- case XGRAD_RECT:
- aFtTrgrCenterX.Enable();
- aMtrTrgrCenterX.Enable();
- aFtTrgrCenterY.Enable();
- aMtrTrgrCenterY.Enable();
- aFtTrgrAngle.Enable();
- aMtrTrgrAngle.Enable();
- break;
- }
-}
-
-SvxTransparenceTabPage::SvxTransparenceTabPage(Window* pParent, const SfxItemSet& rInAttrs)
-: SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_TRANSPARENCE ), rInAttrs),
- rOutAttrs ( rInAttrs ),
- nPageType(0),
- nDlgType(0),
-
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aRbtTransOff ( this, SVX_RES( RBT_TRANS_OFF ) ),
- aRbtTransLinear ( this, SVX_RES( RBT_TRANS_LINEAR ) ),
- aRbtTransGradient ( this, SVX_RES( RBT_TRANS_GRADIENT ) ),
-
- aMtrTransparent ( this, SVX_RES( MTR_TRANSPARENT ) ),
-
- aFtTrgrType ( this, SVX_RES( FT_TRGR_TYPE ) ),
- aLbTrgrGradientType ( this, SVX_RES( LB_TRGR_GRADIENT_TYPES ) ),
- aFtTrgrCenterX ( this, SVX_RES( FT_TRGR_CENTER_X ) ),
- aMtrTrgrCenterX ( this, SVX_RES( MTR_TRGR_CENTER_X ) ),
- aFtTrgrCenterY ( this, SVX_RES( FT_TRGR_CENTER_Y ) ),
- aMtrTrgrCenterY ( this, SVX_RES( MTR_TRGR_CENTER_Y ) ),
- aFtTrgrAngle ( this, SVX_RES( FT_TRGR_ANGLE ) ),
- aMtrTrgrAngle ( this, SVX_RES( MTR_TRGR_ANGLE ) ),
- aFtTrgrBorder ( this, SVX_RES( FT_TRGR_BORDER ) ),
- aMtrTrgrBorder ( this, SVX_RES( MTR_TRGR_BORDER ) ),
- aFtTrgrStartValue ( this, SVX_RES( FT_TRGR_START_VALUE ) ),
- aMtrTrgrStartValue ( this, SVX_RES( MTR_TRGR_START_VALUE ) ),
- aFtTrgrEndValue ( this, SVX_RES( FT_TRGR_END_VALUE ) ),
- aMtrTrgrEndValue ( this, SVX_RES( MTR_TRGR_END_VALUE ) ),
-
- aCtlBitmapPreview ( this, SVX_RES( CTL_BITMAP_PREVIEW ) ),
- aCtlXRectPreview ( this, SVX_RES( CTL_TRANS_PREVIEW ) ),
- bBitmap ( FALSE ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() )
-{
- FreeResource();
-
- // main selection
- aRbtTransOff.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransOffHdl_Impl));
- aRbtTransLinear.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransLinearHdl_Impl));
- aRbtTransGradient.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransGradientHdl_Impl));
-
- // linear transparency
- aMtrTransparent.SetValue( 50 );
- aMtrTransparent.SetModifyHdl(LINK(this, SvxTransparenceTabPage, ModifyTransparentHdl_Impl));
-
- // gradient transparency
- aMtrTrgrEndValue.SetValue( 100 );
- aMtrTrgrStartValue.SetValue( 0 );
- aLbTrgrGradientType.SetSelectHdl(LINK(this, SvxTransparenceTabPage, ChangeTrgrTypeHdl_Impl));
- Link aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrHdl_Impl);
- aLbTrgrGradientType.SetSelectHdl( aLink );
- aMtrTrgrCenterX.SetModifyHdl( aLink );
- aMtrTrgrCenterY.SetModifyHdl( aLink );
- aMtrTrgrAngle.SetModifyHdl( aLink );
- aMtrTrgrBorder.SetModifyHdl( aLink );
- aMtrTrgrStartValue.SetModifyHdl( aLink );
- aMtrTrgrEndValue.SetModifyHdl( aLink );
-
- // this page needs ExchangeSupport
- SetExchangeSupport();
-}
-
-void SvxTransparenceTabPage::Construct()
-{
-}
-
-SfxTabPage* SvxTransparenceTabPage::Create(Window* pWindow, const SfxItemSet& rAttrs)
-{
- return(new SvxTransparenceTabPage(pWindow, rAttrs));
-}
-
-UINT16* SvxTransparenceTabPage::GetRanges()
-{
- return(pTransparenceRanges);
-}
-
-BOOL SvxTransparenceTabPage::FillItemSet(SfxItemSet& rAttrs)
-{
- const SfxPoolItem* pGradientItem = NULL;
- const SfxPoolItem* pLinearItem = NULL;
- SfxItemState eStateGradient(rOutAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem));
- SfxItemState eStateLinear(rOutAttrs.GetItemState(XATTR_FILLTRANSPARENCE, TRUE, &pLinearItem));
- BOOL bGradActive = (eStateGradient == SFX_ITEM_SET && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled());
- BOOL bLinearActive = (eStateLinear == SFX_ITEM_SET && ((XFillTransparenceItem*)pLinearItem)->GetValue() != 0);
-
- // #103765#
- BOOL bGradUsed = (eStateGradient == SFX_ITEM_DONTCARE);
- BOOL bLinearUsed = (eStateLinear == SFX_ITEM_DONTCARE);
-
- BOOL bModified(FALSE);
- BOOL bSwitchOffLinear(FALSE);
- BOOL bSwitchOffGradient(FALSE);
-
- if(aMtrTransparent.IsEnabled())
- {
- // linear transparence
- UINT16 nPos = (UINT16)aMtrTransparent.GetValue();
- if(nPos != (UINT16)aMtrTransparent.GetSavedValue().ToInt32() || !bLinearActive)
- {
- XFillTransparenceItem aItem(nPos);
- SdrShadowTransparenceItem aShadowItem(nPos);
- const SfxPoolItem* pOld = GetOldItem(rAttrs, XATTR_FILLTRANSPARENCE);
- if(!pOld || !(*(const XFillTransparenceItem*)pOld == aItem) || !bLinearActive)
- {
- rAttrs.Put(aItem);
- rAttrs.Put(aShadowItem);
- bModified = TRUE;
- bSwitchOffGradient = TRUE;
- }
- }
- }
- else if(aLbTrgrGradientType.IsEnabled())
- {
- // transparence gradient, fill ItemSet from values
- if(!bGradActive
- || (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos() != (XGradientStyle)aLbTrgrGradientType.GetSavedValue()
- || (UINT16)aMtrTrgrAngle.GetValue() != (UINT16)aMtrTrgrAngle.GetSavedValue().ToInt32()
- || (UINT16)aMtrTrgrCenterX.GetValue() != (UINT16)aMtrTrgrCenterX.GetSavedValue().ToInt32()
- || (UINT16)aMtrTrgrCenterY.GetValue() != (UINT16)aMtrTrgrCenterY.GetSavedValue().ToInt32()
- || (UINT16)aMtrTrgrBorder.GetValue() != (UINT16)aMtrTrgrBorder.GetSavedValue().ToInt32()
- || (UINT16)aMtrTrgrStartValue.GetValue() != (UINT16)aMtrTrgrStartValue.GetSavedValue().ToInt32()
- || (UINT16)aMtrTrgrEndValue.GetValue() != (UINT16)aMtrTrgrEndValue.GetSavedValue().ToInt32() )
- {
- UINT8 nStartCol = (UINT8)(((UINT16)aMtrTrgrStartValue.GetValue() * 255) / 100);
- UINT8 nEndCol = (UINT8)(((UINT16)aMtrTrgrEndValue.GetValue() * 255) / 100);
- XGradient aTmpGradient(
- Color(nStartCol, nStartCol, nStartCol),
- Color(nEndCol, nEndCol, nEndCol),
- (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos(),
- (UINT16)aMtrTrgrAngle.GetValue() * 10,
- (UINT16)aMtrTrgrCenterX.GetValue(),
- (UINT16)aMtrTrgrCenterY.GetValue(),
- (UINT16)aMtrTrgrBorder.GetValue(),
- 100, 100);
-
- String aString;
- XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aTmpGradient);
- const SfxPoolItem* pOld = GetOldItem(rAttrs, XATTR_FILLFLOATTRANSPARENCE);
-
- if(!pOld || !(*(const XFillFloatTransparenceItem*)pOld == aItem) || !bGradActive)
- {
- rAttrs.Put(aItem);
- bModified = TRUE;
- bSwitchOffLinear = TRUE;
- }
- }
- }
- else
- {
- // no transparence
- bSwitchOffGradient = TRUE;
- bSwitchOffLinear = TRUE;
- }
-
- // disable unused XFillFloatTransparenceItem
- if(bSwitchOffGradient && (bGradActive || bGradUsed))
- {
- Color aColor(COL_BLACK);
- XGradient aGrad(aColor, Color(COL_WHITE));
- aGrad.SetStartIntens(100);
- aGrad.SetEndIntens(100);
- String aString;
- XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aGrad);
- aItem.SetEnabled(FALSE);
- rAttrs.Put(aItem);
- bModified = TRUE;
- }
-
- // disable unused XFillFloatTransparenceItem
- if(bSwitchOffLinear && (bLinearActive || bLinearUsed))
- {
- XFillTransparenceItem aItem(0);
- SdrShadowTransparenceItem aShadowItem(0);
- rAttrs.Put(aItem);
- rAttrs.Put(aShadowItem);
- bModified = TRUE;
- }
- //add CHINA001 begin
- rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType));
- //add CHINA001 end
- return bModified;
-}
-
-void SvxTransparenceTabPage::Reset(const SfxItemSet& rAttrs)
-{
- const SfxPoolItem* pGradientItem = NULL;
- SfxItemState eStateGradient(rAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem));
- if(!pGradientItem)
- pGradientItem = &rAttrs.Get(XATTR_FILLFLOATTRANSPARENCE);
- BOOL bGradActive = (eStateGradient == SFX_ITEM_SET && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled());
-
- const SfxPoolItem* pLinearItem = NULL;
- SfxItemState eStateLinear(rAttrs.GetItemState(XATTR_FILLTRANSPARENCE, TRUE, &pLinearItem));
- if(!pLinearItem)
- pLinearItem = &rAttrs.Get(XATTR_FILLTRANSPARENCE);
- BOOL bLinearActive = (eStateLinear == SFX_ITEM_SET && ((XFillTransparenceItem*)pLinearItem)->GetValue() != 0);
-
- // transparence gradient
- const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
- XGradientStyle eXGS(rGradient.GetGradientStyle());
- aLbTrgrGradientType.SelectEntryPos(sal::static_int_cast< USHORT >(eXGS));
- aMtrTrgrAngle.SetValue(rGradient.GetAngle() / 10);
- aMtrTrgrBorder.SetValue(rGradient.GetBorder());
- aMtrTrgrCenterX.SetValue(rGradient.GetXOffset());
- aMtrTrgrCenterY.SetValue(rGradient.GetYOffset());
- aMtrTrgrStartValue.SetValue((UINT16)((((UINT16)rGradient.GetStartColor().GetRed() + 1) * 100) / 255));
- aMtrTrgrEndValue.SetValue((UINT16)((((UINT16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255));
-
- // linear transparence
- UINT16 nTransp = ((XFillTransparenceItem*)pLinearItem)->GetValue();
- aMtrTransparent.SetValue(bLinearActive ? nTransp : 50);
- ModifyTransparentHdl_Impl(NULL);
-
- // select the correct radio button
- if(bGradActive)
- {
- // transparence gradient, set controls appropriate to item
- aRbtTransGradient.Check();
- ClickTransGradientHdl_Impl(NULL);
- }
- else if(bLinearActive)
- {
- // linear transparence
- aRbtTransLinear.Check();
- ClickTransLinearHdl_Impl(NULL);
- }
- else
- {
- // no transparence
- aRbtTransOff.Check();
- ClickTransOffHdl_Impl(NULL);
- ModifiedTrgrHdl_Impl(NULL);
- }
-
- // save values
- aMtrTransparent.SaveValue();
- aLbTrgrGradientType.SaveValue();
- aMtrTrgrCenterX.SaveValue();
- aMtrTrgrCenterY.SaveValue();
- aMtrTrgrAngle.SaveValue();
- aMtrTrgrBorder.SaveValue();
- aMtrTrgrStartValue.SaveValue();
- aMtrTrgrEndValue.SaveValue();
-
- BOOL bActive = InitPreview ( rAttrs );
- InvalidatePreview ( bActive );
-}
-
-void SvxTransparenceTabPage::ActivatePage(const SfxItemSet& rSet)
-{
- //add CHINA001 Begin
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False);
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- //add CHINA001 end
- //CHINA001 if(*pDlgType == 0) // Flaechen-Dialog
- //CHINA001 *pPageType = PT_TRANSPARENCE;
- if(nDlgType == 0) //add CHINA001 // Flaechen-Dialog
- nPageType = PT_TRANSPARENCE; //add CHINA001
-
- InitPreview ( rSet );
-}
-
-int SvxTransparenceTabPage::DeactivatePage(SfxItemSet* _pSet)
-{
- if( _pSet )
- FillItemSet( *_pSet );
- return(LEAVE_PAGE);
-}
-
-void SvxTransparenceTabPage::PointChanged(Window* , RECT_POINT eRcPt)
-{
- eRP = eRcPt;
-}
-
-//
-// Preview-Methods
-//
-BOOL SvxTransparenceTabPage::InitPreview ( const SfxItemSet& rSet )
-{
- // set transparencetyp for preview
- if ( aRbtTransOff.IsChecked() )
- {
- ClickTransOffHdl_Impl(NULL);
- } else if ( aRbtTransLinear.IsChecked() )
- {
- ClickTransLinearHdl_Impl(NULL);
- } else if ( aRbtTransGradient.IsChecked() )
- {
- ClickTransGradientHdl_Impl(NULL);
- }
-
- // Get fillstyle for preview
- rXFSet.Put ( ( XFillStyleItem& ) rSet.Get(XATTR_FILLSTYLE) );
- rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) );
- rXFSet.Put ( ( XFillGradientItem& ) rSet.Get(XATTR_FILLGRADIENT) );
- rXFSet.Put ( ( XFillHatchItem& ) rSet.Get(XATTR_FILLHATCH) );
- rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) );
- rXFSet.Put ( ( XFillBitmapItem& ) rSet.Get(XATTR_FILLBITMAP) );
-
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- bBitmap = ( ( ( XFillStyleItem& )rSet.Get(XATTR_FILLSTYLE) ).GetValue() == XFILL_BITMAP );
-
- // show the right preview window
- if ( bBitmap )
- {
- aCtlBitmapPreview.Show();
- aCtlXRectPreview.Hide();
- }
- else
- {
- aCtlBitmapPreview.Hide();
- aCtlXRectPreview.Show();
- }
-
- return !aRbtTransOff.IsChecked();
-}
-
-void SvxTransparenceTabPage::InvalidatePreview (BOOL bEnable)
-{
- if ( bBitmap )
- {
- if ( bEnable )
- {
- aCtlBitmapPreview.Enable();
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
- }
- else
- aCtlBitmapPreview.Disable();
- aCtlBitmapPreview.Invalidate();
- }
- else
- {
- if ( bEnable )
- {
- aCtlXRectPreview.Enable();
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- }
- else
- aCtlXRectPreview.Disable();
- aCtlXRectPreview.Invalidate();
- }
-}
-
-void SvxTransparenceTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
-
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- if (pDlgTypeItem)
- SetDlgType(pDlgTypeItem->GetValue());
- Construct();
-}
-/*************************************************************************
-|*
-|* Dialog to modify fill-attributes
-|*
-\************************************************************************/
-
-SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
-
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_AREA ), rInAttrs ),
-
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aTypeLB ( this, SVX_RES( LB_AREA_TYPE ) ),
-
- aLbColor ( this, SVX_RES( LB_COLOR ) ),
- aLbGradient ( this, SVX_RES( LB_GRADIENT ) ),
- aLbHatching ( this, SVX_RES( LB_HATCHING ) ),
- aLbBitmap ( this, SVX_RES( LB_BITMAP ) ),
- aCtlBitmapPreview ( this, SVX_RES( CTL_BITMAP_PREVIEW ) ),
-
- aTsbStepCount ( this, SVX_RES( TSB_STEPCOUNT ) ),
- aFlStepCount ( this, SVX_RES( FL_STEPCOUNT ) ),
- aNumFldStepCount ( this, SVX_RES( NUM_FLD_STEPCOUNT ) ),
-
- aCbxHatchBckgrd ( this, SVX_RES( CB_HATCHBCKGRD ) ),
- aLbHatchBckgrdColor ( this, SVX_RES( LB_HATCHBCKGRDCOLOR ) ),
-
- aFlSize ( this, SVX_RES( FL_SIZE ) ),
- aTsbOriginal ( this, SVX_RES( TSB_ORIGINAL ) ),
- aTsbScale ( this, SVX_RES( TSB_SCALE ) ),
- aFtXSize ( this, SVX_RES( FT_X_SIZE ) ),
- aMtrFldXSize ( this, SVX_RES( MTR_FLD_X_SIZE ) ),
- aFtYSize ( this, SVX_RES( FT_Y_SIZE ) ),
- aMtrFldYSize ( this, SVX_RES( MTR_FLD_Y_SIZE ) ),
- aFlPosition ( this, SVX_RES( FL_POSITION ) ),
- aCtlPosition ( this, SVX_RES( CTL_POSITION ), RP_RM, 110, 80, CS_RECT ),
- aFtXOffset ( this, SVX_RES( FT_X_OFFSET ) ),
- aMtrFldXOffset ( this, SVX_RES( MTR_FLD_X_OFFSET ) ),
- aFtYOffset ( this, SVX_RES( FT_Y_OFFSET ) ),
- aMtrFldYOffset ( this, SVX_RES( MTR_FLD_Y_OFFSET ) ),
- aTsbTile ( this, SVX_RES( TSB_TILE ) ),
- aTsbStretch ( this, SVX_RES( TSB_STRETCH ) ),
- aFlOffset ( this, SVX_RES( FL_OFFSET ) ),
- aRbtRow ( this, SVX_RES( RBT_ROW ) ),
- aRbtColumn ( this, SVX_RES( RBT_COLUMN ) ),
- aMtrFldOffset ( this, SVX_RES( MTR_FLD_OFFSET ) ),
-
- aCtlXRectPreview ( this, SVX_RES( CTL_COLOR_PREVIEW ) ),
-
- rOutAttrs ( rInAttrs ),
-
- pColorTab( NULL ),
- pGradientList( NULL ),
- pHatchingList( NULL ),
- pBitmapList( NULL ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() )
-{
- FreeResource();
-
- // Gruppen, die sich ueberlagern
- aLbBitmap.Hide();
- aCtlBitmapPreview.Hide();
-
- aFlStepCount.Hide();
- aTsbStepCount.Hide();
- aNumFldStepCount.Hide();
-
- aTsbTile.Hide();
- aTsbStretch.Hide();
- aTsbScale.Hide();
- aTsbOriginal.Hide();
- aFtXSize.Hide();
- aMtrFldXSize.Hide();
- aFtYSize.Hide();
- aMtrFldYSize.Hide();
- aFlSize.Hide();
- aRbtRow.Hide();
- aRbtColumn.Hide();
- aMtrFldOffset.Hide();
- aFlOffset.Hide();
- aCtlPosition.Hide();
- aFtXOffset.Hide();
- aMtrFldXOffset.Hide();
- aFtYOffset.Hide();
- aMtrFldYOffset.Hide();
- aFlPosition.Hide();
- // Controls for Hatch-Background
- aCbxHatchBckgrd.Hide();
- aLbHatchBckgrdColor.Hide();
-
-
- aTsbOriginal.EnableTriState( FALSE );
-
-
- // this page needs ExchangeSupport
- SetExchangeSupport();
-
- // set Metrics
- eFUnit = GetModuleFieldUnit( &rInAttrs );
-
- switch ( eFUnit )
- {
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ;//prevent warning
- }
- SetFieldUnit( aMtrFldXSize, eFUnit, TRUE );
- SetFieldUnit( aMtrFldYSize, eFUnit, TRUE );
-
- // get PoolUnit
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool?" );
- ePoolUnit = pPool->GetMetric( XATTR_FILLBMP_SIZEX );
-
- // Setzen Output-Devices
- rXFSet.Put( XFillStyleItem( XFILL_SOLID ) );
- rXFSet.Put( XFillColorItem( String(), COL_BLACK ) );
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aLbColor.SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyColorHdl_Impl ) );
- aLbHatchBckgrdColor.SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl ) );
- aCbxHatchBckgrd.SetToggleHdl( LINK( this, SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl ) );
-
- aLbGradient.SetSelectHdl(
- LINK( this, SvxAreaTabPage, ModifyGradientHdl_Impl ) );
- aLbHatching.SetSelectHdl(
- LINK( this, SvxAreaTabPage, ModifyHatchingHdl_Impl ) );
- aLbBitmap.SetSelectHdl(
- LINK( this, SvxAreaTabPage, ModifyBitmapHdl_Impl ) );
-
- aTsbStepCount.SetClickHdl(
- LINK( this, SvxAreaTabPage, ModifyStepCountHdl_Impl ) );
- aNumFldStepCount.SetModifyHdl(
- LINK( this, SvxAreaTabPage, ModifyStepCountHdl_Impl ) );
-
- Link aLink( LINK( this, SvxAreaTabPage, ModifyTileHdl_Impl ) );
- aTsbTile.SetClickHdl( aLink );
- aTsbStretch.SetClickHdl( aLink );
- aTsbOriginal.SetClickHdl( aLink );
- aMtrFldXSize.SetModifyHdl( aLink );
- aMtrFldYSize.SetModifyHdl( aLink );
- aRbtRow.SetClickHdl( aLink );
- aRbtColumn.SetClickHdl( aLink );
- aMtrFldOffset.SetModifyHdl( aLink );
- aMtrFldXOffset.SetModifyHdl( aLink );
- aMtrFldYOffset.SetModifyHdl( aLink );
- aTsbScale.SetClickHdl( LINK( this, SvxAreaTabPage, ClickScaleHdl_Impl ) );
-
- aTypeLB.SetSelectHdl( LINK( this, SvxAreaTabPage, SelectDialogTypeHdl_Impl ) );
-
- // #i76307# always paint the preview in LTR, because this is what the document does
- aCtlXRectPreview.EnableRTL(FALSE);
-}
-
-// -----------------------------------------------------------------------
-
-void SvxAreaTabPage::Construct()
-{
- // fill colortables / lists
- aLbColor.Fill( pColorTab );
- aLbHatchBckgrdColor.Fill ( pColorTab );
-
- aLbGradient.Fill( pGradientList );
- aLbHatching.Fill( pHatchingList );
- aLbBitmap.Fill( pBitmapList );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
-{
- USHORT _nPos = 0;
- USHORT nCount;
- //add CHINA001 Begin
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&rSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False);
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- if (pPosItem)
- SetPos(pPosItem->GetValue());
- //add CHINA001 end
- if( nDlgType == 0 )//CHINA001 if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- *pbAreaTP = TRUE;
-
- if( pColorTab )
- {
- // Bitmapliste
- if( *pnBitmapListState )
- {
- if( *pnBitmapListState & CT_CHANGED )
- pBitmapList = ( (SvxAreaTabDialog*) DLGWIN )->
- GetNewBitmapList();
-
- _nPos = aLbBitmap.GetSelectEntryPos();
-
- aLbBitmap.Clear();
- aLbBitmap.Fill( pBitmapList );
- nCount = aLbBitmap.GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= _nPos )
- aLbBitmap.SelectEntryPos( 0 );
- else
- aLbBitmap.SelectEntryPos( _nPos );
- ModifyBitmapHdl_Impl( this );
- }
- // hatch-liste
- if( *pnHatchingListState )
- {
- if( *pnHatchingListState & CT_CHANGED )
- pHatchingList = ( (SvxAreaTabDialog*) DLGWIN )->
- GetNewHatchingList();
-
- _nPos = aLbHatching.GetSelectEntryPos();
-
- aLbHatching.Clear();
- aLbHatching.Fill( pHatchingList );
- nCount = aLbHatching.GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= _nPos )
- aLbHatching.SelectEntryPos( 0 );
- else
- aLbHatching.SelectEntryPos( _nPos );
- ModifyHatchingHdl_Impl( this );
-
- ModifyHatchBckgrdColorHdl_Impl( this );
- }
- // gradient-liste
- if( *pnGradientListState )
- {
- if( *pnGradientListState & CT_CHANGED )
- pGradientList = ( (SvxAreaTabDialog*) DLGWIN )->
- GetNewGradientList();
-
- _nPos = aLbGradient.GetSelectEntryPos();
-
- aLbGradient.Clear();
- aLbGradient.Fill( pGradientList );
- nCount = aLbGradient.GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= _nPos )
- aLbGradient.SelectEntryPos( 0 );
- else
- aLbGradient.SelectEntryPos( _nPos );
- ModifyGradientHdl_Impl( this );
- }
- // ColorTable
- if( *pnColorTableState )
- {
- if( *pnColorTableState & CT_CHANGED )
- pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->
- GetNewColorTable();
- // aLbColor
- _nPos = aLbColor.GetSelectEntryPos();
- aLbColor.Clear();
- aLbColor.Fill( pColorTab );
- nCount = aLbColor.GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= _nPos )
- aLbColor.SelectEntryPos( 0 );
- else
- aLbColor.SelectEntryPos( _nPos );
-
- ModifyColorHdl_Impl( this );
-
- // Backgroundcolor of hatch
- _nPos = aLbHatchBckgrdColor.GetSelectEntryPos();
- aLbHatchBckgrdColor.Clear();
- aLbHatchBckgrdColor.Fill( pColorTab );
- nCount = aLbHatchBckgrdColor.GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= _nPos )
- aLbHatchBckgrdColor.SelectEntryPos( 0 );
- else
- aLbHatchBckgrdColor.SelectEntryPos( _nPos );
-
- ModifyHatchBckgrdColorHdl_Impl( this );
- }
-
- // evaluate if any other Tabpage set another filltype
- if( aTypeLB.GetSelectEntryPos() > XFILL_NONE)
- {
- switch( nPageType )//CHINA001 switch( *pPageType )
- {
- case PT_GRADIENT:
- aTypeLB.SelectEntryPos( XFILL_GRADIENT );
- aLbGradient.SelectEntryPos( _nPos );//CHINA001 aLbGradient.SelectEntryPos( *pPos );
- ClickGradientHdl_Impl( this );
- break;
-
- case PT_HATCH:
- aTypeLB.SelectEntryPos( XFILL_HATCH );
- aLbHatching.SelectEntryPos( _nPos );//CHINA001 aLbHatching.SelectEntryPos( *pPos );
- ClickHatchingHdl_Impl( this );
- break;
-
- case PT_BITMAP:
- aTypeLB.SelectEntryPos( XFILL_BITMAP );
- aLbBitmap.SelectEntryPos( _nPos );//CHINA001 aLbBitmap.SelectEntryPos( *pPos );
- ClickBitmapHdl_Impl( this );
- break;
-
- case PT_COLOR:
- aTypeLB.SelectEntryPos( XFILL_SOLID );
- aLbColor.SelectEntryPos( _nPos );//CHINA001 aLbColor.SelectEntryPos( *pPos );
- aLbHatchBckgrdColor.SelectEntryPos( _nPos ); //CHINA001 aLbHatchBckgrdColor.SelectEntryPos( *pPos );
- ClickColorHdl_Impl( this );
- break;
- }
- }
- nPageType = PT_AREA;//CHINA001 *pPageType = PT_AREA;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( nDlgType == 0 ) // Flaechen-Dialog//CHINA001 if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- XFillStyle eStyle = (XFillStyle) aTypeLB.GetSelectEntryPos();
- switch( eStyle )
- {
- case XFILL_GRADIENT:
- {
- nPageType = PT_GRADIENT;//CHINA001 *pPageType = PT_GRADIENT;
- nPos = aLbGradient.GetSelectEntryPos();//CHINA001 *pPos = aLbGradient.GetSelectEntryPos();
- }
- break;
- case XFILL_HATCH:
- {
- nPageType = PT_HATCH;//CHINA001 *pPageType = PT_HATCH;
- nPos = aLbHatching.GetSelectEntryPos();//CHINA001 *pPos = aLbHatching.GetSelectEntryPos();
- }
- break;
- case XFILL_BITMAP:
- {
- nPageType = PT_BITMAP;//CHINA001 *pPageType = PT_BITMAP;
- nPos = aLbBitmap.GetSelectEntryPos();//CHINA001 *pPos = aLbBitmap.GetSelectEntryPos();
- }
- break;
- case XFILL_SOLID:
- {
- nPageType = PT_COLOR;//CHINA001 *pPageType = PT_COLOR;
- nPos = aLbColor.GetSelectEntryPos();//CHINA001 *pPos = aLbColor.GetSelectEntryPos();
- }
- break;
- default: ;//prevent warning
- }
- }
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return( LEAVE_PAGE );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxAreaTabPage::FillItemSet( SfxItemSet& rAttrs )
-{
- const SfxPoolItem* pOld = NULL;
- USHORT _nPos;
- BOOL bModified = FALSE;
-
- if( nDlgType != 0 || *pbAreaTP )//CHINA001 if( *pDlgType != 0 || *pbAreaTP )
- {
- XFillStyle eStyle = (XFillStyle) aTypeLB.GetSelectEntryPos();
- XFillStyle eSavedStyle = (XFillStyle) aTypeLB.GetSavedValue();
- switch( eStyle )
- {
- case XFILL_NONE:
- {
- if( eSavedStyle != eStyle )
- {
- XFillStyleItem aStyleItem( XFILL_NONE );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = TRUE;
- }
- }
- }
- break;
- case XFILL_SOLID:
- {
- _nPos = aLbColor.GetSelectEntryPos();
- if( _nPos != LISTBOX_ENTRY_NOTFOUND &&
- _nPos != aLbColor.GetSavedValue() )
- {
- XFillColorItem aItem( aLbColor.GetSelectEntry(),
- aLbColor.GetSelectEntryColor() );
- pOld = GetOldItem( rAttrs, XATTR_FILLCOLOR );
- if ( !pOld || !( *(const XFillColorItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- // NEU
- if( (eSavedStyle != eStyle) &&
- ( bModified ||
- SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), TRUE ) ) )
- {
- XFillStyleItem aStyleItem( XFILL_SOLID );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = TRUE;
- }
- }
- }
- break;
- case XFILL_GRADIENT:
- {
- _nPos = aLbGradient.GetSelectEntryPos();
- if( _nPos != LISTBOX_ENTRY_NOTFOUND &&
- _nPos != aLbGradient.GetSavedValue() )
- {
- XGradient aGradient = pGradientList->GetGradient( _nPos )->GetGradient();
- String aString = aLbGradient.GetSelectEntry();
- XFillGradientItem aItem( aString, aGradient );
- pOld = GetOldItem( rAttrs, XATTR_FILLGRADIENT );
- if ( !pOld || !( *(const XFillGradientItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- // NEU
- if( (eSavedStyle != eStyle) &&
- ( bModified ||
- SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), TRUE ) ) )
- {
- XFillStyleItem aStyleItem( XFILL_GRADIENT );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = TRUE;
- }
- }
- }
- break;
- case XFILL_HATCH:
- {
- _nPos = aLbHatching.GetSelectEntryPos();
- if( _nPos != LISTBOX_ENTRY_NOTFOUND &&
- _nPos != aLbHatching.GetSavedValue() )
- {
- XHatch aHatching = pHatchingList->GetHatch( _nPos )->GetHatch();
- String aString = aLbHatching.GetSelectEntry();
- XFillHatchItem aItem( aString, aHatching );
- pOld = GetOldItem( rAttrs, XATTR_FILLHATCH );
- if ( !pOld || !( *(const XFillHatchItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- XFillBackgroundItem aItem ( aCbxHatchBckgrd.IsChecked() );
- rAttrs.Put( aItem );
- nPos = aLbHatchBckgrdColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbHatchBckgrdColor.GetSavedValue() )
- {
- XFillColorItem aFillColorItem( aLbHatchBckgrdColor.GetSelectEntry(),
- aLbHatchBckgrdColor.GetSelectEntryColor() );
- pOld = GetOldItem( rAttrs, XATTR_FILLCOLOR );
- if ( !pOld || !( *(const XFillColorItem*)pOld == aFillColorItem ) )
- {
- rAttrs.Put( aFillColorItem );
- bModified = TRUE;
- }
- }
- // NEU
- if( (eSavedStyle != eStyle) &&
- ( bModified ||
- SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), TRUE ) ) )
- {
- XFillStyleItem aStyleItem( XFILL_HATCH );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = TRUE;
- }
- }
- }
- break;
- case XFILL_BITMAP:
- {
- nPos = aLbBitmap.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbBitmap.GetSavedValue() )
- {
- XOBitmap aXOBitmap = pBitmapList->GetBitmap( nPos )->GetXBitmap();
- String aString = aLbBitmap.GetSelectEntry();
- XFillBitmapItem aFillBitmapItem( aString, aXOBitmap );
- pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP );
- if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) )
- {
- rAttrs.Put( aFillBitmapItem );
- bModified = TRUE;
- }
- }
- // NEU
- if( (eSavedStyle != eStyle) &&
- ( bModified ||
- SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), TRUE ) ) )
- {
- XFillStyleItem aStyleItem( XFILL_BITMAP );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = TRUE;
- }
- }
- }
- break;
- }
-
- // Schrittweite
- if( aTsbStepCount.IsEnabled() )
- {
- UINT16 nValue = 0;
- BOOL bValueModified = FALSE;
- TriState eState = aTsbStepCount.GetState();
- if( eState == STATE_CHECK )
- {
- if( eState != aTsbStepCount.GetSavedValue() )
- bValueModified = TRUE;
- }
- else
- {
- // Zustand != Disabled ?
- if( aNumFldStepCount.GetText().Len() > 0 )
- {
- nValue = (UINT16) aNumFldStepCount.GetValue();
- if( nValue != (UINT16) aNumFldStepCount.GetSavedValue().ToInt32() )
- bValueModified = TRUE;
- }
- }
- if( bValueModified )
- {
- XGradientStepCountItem aFillBitmapItem( nValue );
- pOld = GetOldItem( rAttrs, XATTR_GRADIENTSTEPCOUNT );
- if ( !pOld || !( *(const XGradientStepCountItem*)pOld == aFillBitmapItem ) )
- {
- rAttrs.Put( aFillBitmapItem );
- bModified = TRUE;
- }
- }
- }
-
- // Kacheln
- if( aTsbTile.IsEnabled() )
- {
- TriState eState = aTsbTile.GetState();
- if( eState != aTsbTile.GetSavedValue() )
- {
- XFillBmpTileItem aFillBmpTileItem(
- sal::static_int_cast< BOOL >( eState ) );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_TILE );
- if ( !pOld || !( *(const XFillBmpTileItem*)pOld == aFillBmpTileItem ) )
- {
- rAttrs.Put( aFillBmpTileItem );
- bModified = TRUE;
- }
- }
- }
- // Stretchen
- if( aTsbStretch.IsEnabled() )
- {
- TriState eState = aTsbStretch.GetState();
- if( eState != aTsbStretch.GetSavedValue() )
- {
- XFillBmpStretchItem aFillBmpStretchItem(
- sal::static_int_cast< BOOL >( eState ) );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_STRETCH );
- if ( !pOld || !( *(const XFillBmpStretchItem*)pOld == aFillBmpStretchItem ) )
- {
- rAttrs.Put( aFillBmpStretchItem );
- bModified = TRUE;
- }
- }
- }
-
- // Originalgroesse (im UI) wird wie folgt benutzt:
- // Controls sind disabled, muessen aber gesetzt werden.
- // SizeX = 0; SizeY = 0; Log = TRUE
-
- //aTsbScale
- TriState eState = aTsbScale.GetState();
- if( eState != aTsbScale.GetSavedValue() ||
- ( !aTsbScale.IsEnabled() &&
- aTsbOriginal.IsEnabled() &&
- aTsbScale.GetSavedValue() != STATE_CHECK ) )
- {
- XFillBmpSizeLogItem* pItem = NULL;
- if( aTsbScale.IsEnabled() )
- pItem = new XFillBmpSizeLogItem( eState == STATE_NOCHECK );
- else if( aTsbOriginal.IsEnabled() && aTsbOriginal.GetState() == STATE_CHECK )
- pItem = new XFillBmpSizeLogItem( TRUE );
-
- if( pItem )
- {
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_SIZELOG );
- if ( !pOld || !( *(const XFillBmpSizeLogItem*)pOld == *pItem ) )
- {
- rAttrs.Put( *pItem );
- bModified = TRUE;
- }
- delete pItem;
- }
- }
-
- //aMtrFldXSize
- String aStr = aMtrFldXSize.GetText();
- {
- XFillBmpSizeXItem* pItem = NULL;
- TriState eScaleState = aTsbScale.GetState();
-
- if( aMtrFldXSize.IsEnabled() &&
- aStr.Len() > 0 &&
- aStr != aMtrFldXSize.GetSavedValue() )
- {
- if( eScaleState == STATE_NOCHECK )
- pItem = new XFillBmpSizeXItem( GetCoreValue( aMtrFldXSize, ePoolUnit ) );
- else
- {
- // Prozentwerte werden negativ gesetzt, damit
- // diese nicht skaliert werden; dieses wird
- // im Item beruecksichtigt ( KA05.11.96 )
- pItem = new XFillBmpSizeXItem( -labs( static_cast<long>(aMtrFldXSize.GetValue()) ) );
- }
- }
- else if( aTsbOriginal.IsEnabled() &&
- aTsbOriginal.GetState() == STATE_CHECK &&
- aMtrFldXSize.GetSavedValue().Len() > 0 )
- pItem = new XFillBmpSizeXItem( 0 );
-
- if( pItem )
- {
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_SIZEX );
- if ( !pOld || !( *(const XFillBmpSizeXItem*)pOld == *pItem ) )
- {
- rAttrs.Put( *pItem );
- bModified = TRUE;
- }
- delete pItem;
- }
- }
-
- //aMtrFldYSize
- aStr = aMtrFldYSize.GetText();
- {
- XFillBmpSizeYItem* pItem = NULL;
- TriState eScaleState = aTsbScale.GetState();
-
- if( aMtrFldYSize.IsEnabled() &&
- aStr.Len() > 0 &&
- aStr != aMtrFldYSize.GetSavedValue() )
- {
- if( eScaleState == STATE_NOCHECK )
- pItem = new XFillBmpSizeYItem( GetCoreValue( aMtrFldYSize, ePoolUnit ) );
- else
- {
- // Prozentwerte werden negativ gesetzt, damit
- // diese vom MetricItem nicht skaliert werden;
- // dieses wird im Item beruecksichtigt ( KA05.11.96 )
- pItem = new XFillBmpSizeYItem( -labs( static_cast<long>(aMtrFldYSize.GetValue()) ) );
- }
- }
- else if( aTsbOriginal.IsEnabled() &&
- aTsbOriginal.GetState() == STATE_CHECK &&
- aMtrFldYSize.GetSavedValue().Len() > 0 )
- pItem = new XFillBmpSizeYItem( 0 );
-
- if( pItem )
- {
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_SIZEY );
- if ( !pOld || !( *(const XFillBmpSizeYItem*)pOld == *pItem ) )
- {
- rAttrs.Put( *pItem );
- bModified = TRUE;
- }
- delete pItem;
- }
- }
-
- //aRbtRow
- //aRbtColumn
- //aMtrFldOffset
- if( aMtrFldOffset.IsEnabled() )
- {
- String aMtrString = aMtrFldOffset.GetText();
- if( ( aMtrString.Len() > 0 &&
- aMtrString != aMtrFldOffset.GetSavedValue() ) ||
- aRbtRow.GetSavedValue() != aRbtRow.IsChecked() ||
- aRbtColumn.GetSavedValue() != aRbtColumn.IsChecked() )
- {
- if( aRbtRow.IsChecked() )
- {
- XFillBmpTileOffsetXItem aFillBmpTileOffsetXItem( (UINT16) aMtrFldOffset.GetValue() );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_TILEOFFSETX );
- if ( !pOld || !( *(const XFillBmpTileOffsetXItem*)pOld == aFillBmpTileOffsetXItem ) )
- {
- rAttrs.Put( aFillBmpTileOffsetXItem );
- rAttrs.Put( XFillBmpTileOffsetYItem( 0 ) );
- bModified = TRUE;
- }
- }
- else if( aRbtColumn.IsChecked() )
- {
- XFillBmpTileOffsetYItem aFillBmpTileOffsetYItem( (UINT16) aMtrFldOffset.GetValue() );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_TILEOFFSETY );
- if ( !pOld || !( *(const XFillBmpTileOffsetYItem*)pOld == aFillBmpTileOffsetYItem ) )
- {
- rAttrs.Put( aFillBmpTileOffsetYItem );
- rAttrs.Put( XFillBmpTileOffsetXItem( 0 ) );
- bModified = TRUE;
- }
- }
- }
- }
-
- //aCtlPosition
- if( aCtlPosition.IsEnabled() )
- {
- BOOL bPut = FALSE;
- RECT_POINT _eRP = aCtlPosition.GetActualRP();
-
- if( SFX_ITEM_DONTCARE == rOutAttrs.GetItemState( XATTR_FILLBMP_POS ) )
- bPut = TRUE;
- else
- {
- RECT_POINT eValue = ( ( const XFillBmpPosItem& ) rOutAttrs.Get( XATTR_FILLBMP_POS ) ).GetValue();
- if( eValue != _eRP )
- bPut = TRUE;
- }
- if( bPut )
- {
- XFillBmpPosItem aFillBmpPosItem( _eRP );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_POS );
- if ( !pOld || !( *(const XFillBmpPosItem*)pOld == aFillBmpPosItem ) )
- {
- rAttrs.Put( aFillBmpPosItem );
- bModified = TRUE;
- }
- }
- }
-
- //aMtrFldXOffset
- if( aMtrFldXOffset.IsEnabled() )
- {
- String sMtrXOffset = aMtrFldXOffset.GetText();
- if( sMtrXOffset.Len() > 0 &&
- sMtrXOffset != aMtrFldXOffset.GetSavedValue() )
- {
- XFillBmpPosOffsetXItem aFillBmpPosOffsetXItem( (UINT16) aMtrFldXOffset.GetValue() );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_POSOFFSETX );
- if ( !pOld || !( *(const XFillBmpPosOffsetXItem*)pOld == aFillBmpPosOffsetXItem ) )
- {
- rAttrs.Put( aFillBmpPosOffsetXItem );
- bModified = TRUE;
- }
- }
- }
-
- //aMtrFldYOffset
- if( aMtrFldYOffset.IsEnabled() )
- {
- String sMtrYOffset = aMtrFldYOffset.GetText();
- if( sMtrYOffset.Len() > 0 &&
- sMtrYOffset != aMtrFldYOffset.GetSavedValue() )
- {
- XFillBmpPosOffsetYItem aFillBmpPosOffsetYItem( (UINT16) aMtrFldYOffset.GetValue() );
- pOld = GetOldItem( rAttrs, XATTR_FILLBMP_POSOFFSETY );
- if ( !pOld || !( *(const XFillBmpPosOffsetYItem*)pOld == aFillBmpPosOffsetYItem ) )
- {
- rAttrs.Put( aFillBmpPosOffsetYItem );
- bModified = TRUE;
- }
- }
- }
- //add CHINA001 begin
- rAttrs.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
- rAttrs.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos));
- //add CHINA001 end
- }
-
- return( bModified );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxAreaTabPage::Reset( const SfxItemSet& rAttrs )
-{
- //const SfxPoolItem *pPoolItem = NULL;
-
- XFillStyle eXFS;
- if( rAttrs.GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DONTCARE )
- {
- eXFS = (XFillStyle) ( ( ( const XFillStyleItem& ) rAttrs.
- Get( GetWhich( XATTR_FILLSTYLE ) ) ).GetValue() );
- aTypeLB.SelectEntryPos( sal::static_int_cast< USHORT >( eXFS ) );
- switch( eXFS )
- {
- case XFILL_NONE:
- ClickInvisibleHdl_Impl( this );
- break;
-
- case XFILL_SOLID:
- //if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), TRUE, &pPoolItem ) )
- if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLCOLOR ) )
- {
- XFillColorItem aColorItem( ( const XFillColorItem& )
- rAttrs.Get( XATTR_FILLCOLOR ) );
-
- aLbColor.SelectEntry( aColorItem.GetColorValue() );
- aLbHatchBckgrdColor.SelectEntry( aColorItem.GetColorValue() );
- }
- ClickColorHdl_Impl( this );
-
- break;
-
- case XFILL_GRADIENT:
- //if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), TRUE, &pPoolItem ) )
- if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLGRADIENT ) )
- {
- XFillGradientItem aGradientItem( ( ( const XFillGradientItem& )
- rAttrs.Get( XATTR_FILLGRADIENT ) ) );
- String aString( aGradientItem.GetName() );
- XGradient aGradient( aGradientItem.GetGradientValue() );
-
- aLbGradient.SelectEntryByList( pGradientList, aString, aGradient );
- }
- ClickGradientHdl_Impl( this );
- break;
-
- case XFILL_HATCH:
- //if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), TRUE, &pPoolItem ) )
- if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLHATCH ) )
- {
- aLbHatching.SelectEntry( ( ( const XFillHatchItem& )
- rAttrs.Get( XATTR_FILLHATCH ) ).GetName() );
- }
- ClickHatchingHdl_Impl( this );
-
- if ( SFX_ITEM_DONTCARE != rAttrs.GetItemState ( XATTR_FILLBACKGROUND ) )
- {
- aCbxHatchBckgrd.Check ( ( ( const XFillBackgroundItem& ) rAttrs.Get ( XATTR_FILLBACKGROUND ) ).GetValue() );
- }
- ToggleHatchBckgrdColorHdl_Impl( this );
- if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLCOLOR ) )
- {
- XFillColorItem aColorItem( ( const XFillColorItem& )
- rAttrs.Get( XATTR_FILLCOLOR ) );
-
- aLbColor.SelectEntry( aColorItem.GetColorValue() );
- aLbHatchBckgrdColor.SelectEntry( aColorItem.GetColorValue() );
- }
- break;
-
- case XFILL_BITMAP:
- {
- if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLBITMAP ) )
- {
- XFillBitmapItem aBitmapItem( ( const XFillBitmapItem& )
- rAttrs.Get( XATTR_FILLBITMAP ) );
-
- String aString( aBitmapItem.GetName() );
- aLbBitmap.SelectEntry( aString );
- }
- ClickBitmapHdl_Impl( this );
- }
- break;
-
- default:
- //aLbColor.SelectEntryPos(0);
- //aRbtColor.Check();
- break;
- }
- }
- else
- {
- // Alle LBs nicht zug"anglich machen
- aLbColor.Hide();
- aLbGradient.Hide();
- aLbHatching.Hide();
- aLbBitmap.Hide();
- aCtlBitmapPreview.Hide();
- aLbColor.Disable();
- aLbColor.Show();
-
- // Damit Reset() auch mit Zurueck richtig funktioniert
- aTypeLB.SetNoSelection();
- }
-
- // Schrittweite
- if( ( rAttrs.GetItemState( XATTR_GRADIENTSTEPCOUNT ) != SFX_ITEM_DONTCARE ) ||
- ( rAttrs.GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DONTCARE ) )
- {
- aTsbStepCount.EnableTriState( FALSE );
- UINT16 nValue = ( ( const XGradientStepCountItem& ) rAttrs.Get( XATTR_GRADIENTSTEPCOUNT ) ).GetValue();
- if( nValue == 0 )
- {
- aTsbStepCount.SetState( STATE_CHECK );
- aNumFldStepCount.SetText( String() );
- }
- else
- {
- aTsbStepCount.SetState( STATE_NOCHECK );
- aNumFldStepCount.SetValue( nValue );
- }
- ModifyStepCountHdl_Impl( &aTsbStepCount );
- }
- else
- {
- aTsbStepCount.SetState( STATE_DONTKNOW );
- aNumFldStepCount.SetText( String() );
- }
-
- // Attribute fuer die Bitmap-Fuellung
-
- // Ist Kacheln gesetzt?
- if( rAttrs.GetItemState( XATTR_FILLBMP_TILE ) != SFX_ITEM_DONTCARE )
- {
- aTsbTile.EnableTriState( FALSE );
-
- if( ( ( const XFillBmpTileItem& ) rAttrs.Get( XATTR_FILLBMP_TILE ) ).GetValue() )
- aTsbTile.SetState( STATE_CHECK );
- else
- aTsbTile.SetState( STATE_NOCHECK );
- }
- else
- aTsbTile.SetState( STATE_DONTKNOW );
-
- // Ist Stretchen gesetzt?
- if( rAttrs.GetItemState( XATTR_FILLBMP_STRETCH ) != SFX_ITEM_DONTCARE )
- {
- aTsbStretch.EnableTriState( FALSE );
-
- if( ( ( const XFillBmpStretchItem& ) rAttrs.Get( XATTR_FILLBMP_STRETCH ) ).GetValue() )
- aTsbStretch.SetState( STATE_CHECK );
- else
- aTsbStretch.SetState( STATE_NOCHECK );
- }
- else
- aTsbStretch.SetState( STATE_DONTKNOW );
-
-
- //aTsbScale
- if( rAttrs.GetItemState( XATTR_FILLBMP_SIZELOG ) != SFX_ITEM_DONTCARE )
- {
- aTsbScale.EnableTriState( FALSE );
-
- if( ( ( const XFillBmpSizeLogItem& ) rAttrs.Get( XATTR_FILLBMP_SIZELOG ) ).GetValue() )
- aTsbScale.SetState( STATE_NOCHECK );
- else
- aTsbScale.SetState( STATE_CHECK );
-
- ClickScaleHdl_Impl( NULL );
- }
- else
- aTsbScale.SetState( STATE_DONTKNOW );
-
-
- // Status fuer Originalgroesse ermitteln
- TriState eOriginal = STATE_NOCHECK;
-
- //aMtrFldXSize
- if( rAttrs.GetItemState( XATTR_FILLBMP_SIZEX ) != SFX_ITEM_DONTCARE )
- {
- INT32 nValue = ( ( const XFillBmpSizeXItem& ) rAttrs.Get( XATTR_FILLBMP_SIZEX ) ).GetValue();
- if( aTsbScale.GetState() == STATE_CHECK )
- {
- // Wenn im Item eine Prozentangabe steckt,
- // so ist diese wegen des MetricItems negativ
- aMtrFldXSize.SetValue( labs( nValue ) );
- }
- else
- SetMetricValue( aMtrFldXSize, nValue, ePoolUnit );
- aMtrFldXSize.SaveValue();
-
- if( nValue == 0 )
- {
- eOriginal = STATE_CHECK;
- // Wert ist beim Ausschalten von Originalgroesse sonst zu klein
- // (Performance-Problem)
- aMtrFldXSize.SetValue( 100 );
- }
- }
- else
- {
- aMtrFldXSize.SetText( String() );
- aMtrFldXSize.SaveValue();
- }
-
- //aMtrFldYSize
- if( rAttrs.GetItemState( XATTR_FILLBMP_SIZEY ) != SFX_ITEM_DONTCARE )
- {
- INT32 nValue = ( ( const XFillBmpSizeYItem& ) rAttrs.Get( XATTR_FILLBMP_SIZEY ) ).GetValue();
- if( aTsbScale.GetState() == STATE_CHECK )
- {
- // Wenn im Item eine Prozentangabe steckt,
- // so ist diese wegen des MetricItems negativ
- aMtrFldYSize.SetValue( labs( nValue ) );
- }
- else
- SetMetricValue( aMtrFldYSize, nValue, ePoolUnit );
- aMtrFldYSize.SaveValue();
-
- if( nValue == 0 )
- aMtrFldYSize.SetValue( 100 ); //s.o.
- else
- eOriginal = STATE_NOCHECK;
- }
- else
- {
- aMtrFldYSize.SetText( String() );
- aMtrFldYSize.SaveValue();
- eOriginal = STATE_NOCHECK;
- }
-
- // aTsbOriginal
- aTsbOriginal.SetState( eOriginal );
-
- // #93372# Setting proper state after changing button
- ModifyTileHdl_Impl( NULL );
-
- //aRbtRow
- //aRbtColumn
- //aMtrFldOffset
- if( rAttrs.GetItemState( XATTR_FILLBMP_TILEOFFSETX ) != SFX_ITEM_DONTCARE )
- {
- UINT16 nValue = ( ( const XFillBmpTileOffsetXItem& ) rAttrs.Get( XATTR_FILLBMP_TILEOFFSETX ) ).GetValue();
- if( nValue > 0 )
- {
- aMtrFldOffset.SetValue( nValue );
- aRbtRow.Check();
- }
- else if( rAttrs.GetItemState( XATTR_FILLBMP_TILEOFFSETY ) != SFX_ITEM_DONTCARE )
- {
- nValue = ( ( const XFillBmpTileOffsetYItem& ) rAttrs.Get( XATTR_FILLBMP_TILEOFFSETY ) ).GetValue();
- if( nValue > 0 )
- {
- aMtrFldOffset.SetValue( nValue );
- aRbtColumn.Check();
- }
- }
- else
- aMtrFldOffset.SetValue( 0 );
- }
- else
- aMtrFldOffset.SetText( String() );
-
-
- //aCtlPosition
- if( rAttrs.GetItemState( XATTR_FILLBMP_POS ) != SFX_ITEM_DONTCARE )
- {
- RECT_POINT eValue = ( ( const XFillBmpPosItem& ) rAttrs.Get( XATTR_FILLBMP_POS ) ).GetValue();
- aCtlPosition.SetActualRP( eValue );
- }
- else
- aCtlPosition.Reset();
-
- //aMtrFldXOffset
- if( rAttrs.GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SFX_ITEM_DONTCARE )
- {
- INT32 nValue = ( ( const XFillBmpPosOffsetXItem& ) rAttrs.Get( XATTR_FILLBMP_POSOFFSETX ) ).GetValue();
- aMtrFldXOffset.SetValue( nValue );
- }
- else
- aMtrFldXOffset.SetText( String() );
-
- //aMtrFldYOffset
- if( rAttrs.GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SFX_ITEM_DONTCARE )
- {
- INT32 nValue = ( ( const XFillBmpPosOffsetYItem& ) rAttrs.Get( XATTR_FILLBMP_POSOFFSETY ) ).GetValue();
- aMtrFldYOffset.SetValue( nValue );
- }
- else
- aMtrFldYOffset.SetText( String() );
-
- // Erst hier, damit Tile und Stretch mit beruecksichtigt wird
- if( aTypeLB.GetSelectEntryPos() == XFILL_BITMAP )
- ClickBitmapHdl_Impl( NULL );
-
- // Werte sichern
- aTypeLB.SaveValue();
- aLbColor.SaveValue();
- aLbGradient.SaveValue();
- aLbHatching.SaveValue();
- //aCbxHatchBckgrd.SaveValue();
- aLbHatchBckgrdColor.SaveValue();
- aLbBitmap.SaveValue();
-// aLbTransparent.SaveValue();
- aTsbStepCount.SaveValue();
- aNumFldStepCount.SaveValue();
- aTsbTile.SaveValue();
- aTsbStretch.SaveValue();
- aTsbScale.SaveValue();
- aRbtRow.SaveValue();
- aRbtColumn.SaveValue();
- aMtrFldOffset.SaveValue();
- aMtrFldXOffset.SaveValue();
- aMtrFldYOffset.SaveValue();
- //aMtrFldXSize.SaveValue(); <- wird oben behandelt
- //aMtrFldYSize.SaveValue(); <- wird oben behandelt
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxAreaTabPage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxAreaTabPage( pWindow, rAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxAreaTabPage::GetRanges()
-{
- return( pAreaRanges );
-}
-
-//------------------------------------------------------------------------
-IMPL_LINK( SvxAreaTabPage, SelectDialogTypeHdl_Impl, ListBox *, EMPTYARG )
-{
- switch( (XFillStyle)aTypeLB.GetSelectEntryPos() )
- {
- case XFILL_NONE: ClickInvisibleHdl_Impl( this ); break;
- case XFILL_SOLID: ClickColorHdl_Impl( this ); break;
- case XFILL_GRADIENT: ClickGradientHdl_Impl( this ); break;
- case XFILL_HATCH: ClickHatchingHdl_Impl( this ); break;
- case XFILL_BITMAP: ClickBitmapHdl_Impl( this ); break;
- }
-
- return 0;
-}
-
-IMPL_LINK( SvxAreaTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG )
-{
- aTsbTile.Hide();
- aTsbStretch.Hide();
- aTsbScale.Hide();
- aTsbOriginal.Hide();
- aFtXSize.Hide();
- aMtrFldXSize.Hide();
- aFtYSize.Hide();
- aMtrFldYSize.Hide();
- aFlSize.Hide();
- aRbtRow.Hide();
- aRbtColumn.Hide();
- aMtrFldOffset.Hide();
- aFlOffset.Hide();
- aCtlPosition.Hide();
- aFtXOffset.Hide();
- aMtrFldXOffset.Hide();
- aFtYOffset.Hide();
- aMtrFldYOffset.Hide();
- aFlPosition.Hide();
-
- aLbColor.Hide();
- aLbGradient.Hide();
- aLbHatching.Hide();
- aLbBitmap.Hide();
- aCtlXRectPreview.Hide();
- aCtlBitmapPreview.Hide();
-
- aFlStepCount.Hide();
- aTsbStepCount.Hide();
- aNumFldStepCount.Hide();
-
- // Controls for Hatch-Background
- aCbxHatchBckgrd.Hide();
- aLbHatchBckgrdColor.Hide();
-
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlXRectPreview.Invalidate();
- aCtlBitmapPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ClickColorHdl_Impl, void *, EMPTYARG )
-{
- aTsbTile.Hide();
- aTsbStretch.Hide();
- aTsbScale.Hide();
- aTsbOriginal.Hide();
- aFtXSize.Hide();
- aMtrFldXSize.Hide();
- aFtYSize.Hide();
- aMtrFldYSize.Hide();
- aFlSize.Hide();
- aRbtRow.Hide();
- aRbtColumn.Hide();
- aMtrFldOffset.Hide();
- aFlOffset.Hide();
- aCtlPosition.Hide();
- aFtXOffset.Hide();
- aMtrFldXOffset.Hide();
- aFtYOffset.Hide();
- aMtrFldYOffset.Hide();
- aFlPosition.Hide();
-
- aLbColor.Enable();
- aLbColor.Show();
- aLbGradient.Hide();
- aLbHatching.Hide();
- aLbBitmap.Hide();
- aCtlXRectPreview.Enable();
- aCtlXRectPreview.Show();
- aCtlBitmapPreview.Hide();
-
- aFlStepCount.Hide();
- aTsbStepCount.Hide();
- aNumFldStepCount.Hide();
-
- // Controls for Hatch-Background
- aCbxHatchBckgrd.Hide();
- aLbHatchBckgrdColor.Hide();
-
- // Text der Tabelle setzen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pColorTab->GetPath() );
-
- aURL.Append( pColorTab->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- ModifyColorHdl_Impl( this );
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyColorHdl_Impl, void *, EMPTYARG )
-{
- const SfxPoolItem* pPoolItem = NULL;
- USHORT _nPos = aLbColor.GetSelectEntryPos();
- aLbHatchBckgrdColor.SelectEntryPos( _nPos );
- if( _nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rXFSet.Put( XFillStyleItem( XFILL_SOLID ) );
- rXFSet.Put( XFillColorItem( String(),
- aLbColor.GetSelectEntryColor() ) );
- }
- // NEU
- else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), TRUE, &pPoolItem ) )
- {
- rXFSet.Put( XFillStyleItem( XFILL_SOLID ) );
- Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue() );
- rXFSet.Put( XFillColorItem( String(), aColor ) );
- }
- else
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
-
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlXRectPreview.Invalidate();
-
- return( 0L );
-}
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ClickGradientHdl_Impl, void *, EMPTYARG )
-{
- aTsbTile.Hide();
- aTsbStretch.Hide();
- aTsbScale.Hide();
- aTsbOriginal.Hide();
- aFtXSize.Hide();
- aMtrFldXSize.Hide();
- aFtYSize.Hide();
- aMtrFldYSize.Hide();
- aFlSize.Hide();
- aRbtRow.Hide();
- aRbtColumn.Hide();
- aMtrFldOffset.Hide();
- aFlOffset.Hide();
- aCtlPosition.Hide();
- aFtXOffset.Hide();
- aMtrFldXOffset.Hide();
- aFtYOffset.Hide();
- aMtrFldYOffset.Hide();
- aFlPosition.Hide();
-
- aLbColor.Hide();
- aLbGradient.Enable();
- aLbGradient.Show();
- aLbHatching.Hide();
- aLbBitmap.Hide();
- aCtlXRectPreview.Enable();
- aCtlXRectPreview.Show();
- aCtlBitmapPreview.Hide();
-
- aFlStepCount.Enable();
- aFlStepCount.Show();
- aTsbStepCount.Enable();
- aTsbStepCount.Show();
- aNumFldStepCount.Show();
-
- // Controls for Hatch-Background
- aCbxHatchBckgrd.Hide();
- aLbHatchBckgrdColor.Hide();
-
- // Text der Tabelle setzen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pGradientList->GetPath() );
-
- aURL.Append( pGradientList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- ModifyGradientHdl_Impl( this );
- ModifyStepCountHdl_Impl( &aTsbStepCount );
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyGradientHdl_Impl, void *, EMPTYARG )
-{
- const SfxPoolItem* pPoolItem = NULL;
- USHORT _nPos = aLbGradient.GetSelectEntryPos();
- if( _nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- // ItemSet fuellen und an aCtlXRectPreview weiterleiten
- XGradientEntry* pEntry = pGradientList->GetGradient( _nPos );
-
- rXFSet.Put( XFillStyleItem( XFILL_GRADIENT ) );
- rXFSet.Put( XFillGradientItem( String(),
- pEntry->GetGradient() ) );
- }
- // NEU
- else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), TRUE, &pPoolItem ) )
- {
- rXFSet.Put( XFillStyleItem( XFILL_GRADIENT ) );
- rXFSet.Put( XFillGradientItem( String(), ( ( const XFillGradientItem* ) pPoolItem )->GetGradientValue() ) );
- }
- else
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
-
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlXRectPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ClickHatchingHdl_Impl, void *, EMPTYARG )
-{
- aLbColor.Hide();
- aLbGradient.Hide();
- aLbHatching.Enable();
- aLbHatching.Show();
- aLbBitmap.Hide();
- aCtlXRectPreview.Enable();
- aCtlXRectPreview.Show();
- aCtlBitmapPreview.Hide();
-
-// aGrpTransparent.Hide();
-// aLbTransparent.Hide();
- aFlStepCount.Hide();
- aTsbStepCount.Hide();
- aNumFldStepCount.Hide();
-
- aTsbTile.Hide();
- aTsbStretch.Hide();
- aTsbScale.Hide();
- aTsbOriginal.Hide();
- aFtXSize.Hide();
- aMtrFldXSize.Hide();
- aFtYSize.Hide();
- aMtrFldYSize.Hide();
- aFlSize.Hide();
- aRbtRow.Hide();
- aRbtColumn.Hide();
- aMtrFldOffset.Hide();
- aFlOffset.Hide();
- aCtlPosition.Hide();
- aFtXOffset.Hide();
- aMtrFldXOffset.Hide();
- aFtYOffset.Hide();
- aMtrFldYOffset.Hide();
- aFlPosition.Hide();
-
- // Controls for Hatch-Background
- aCbxHatchBckgrd.Show();
- aLbHatchBckgrdColor.Show();
- aCbxHatchBckgrd.Enable();
- aLbHatchBckgrdColor.Enable();
-
- // Text der Tabelle setzen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pHatchingList->GetPath() );
-
- aURL.Append( pHatchingList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( aURL.getBase().getLength() > 18 )
- {
- aString += String(String(aURL.getBase()).Copy( 0, 15 ));
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- ModifyHatchingHdl_Impl( this );
- ModifyHatchBckgrdColorHdl_Impl( this );
- ToggleHatchBckgrdColorHdl_Impl( this );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyHatchingHdl_Impl, void *, EMPTYARG )
-{
- const SfxPoolItem* pPoolItem = NULL;
- USHORT _nPos = aLbHatching.GetSelectEntryPos();
- if( _nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- // ItemSet fuellen und an aCtlXRectPreview weiterleiten
- XHatchEntry* pEntry = pHatchingList->GetHatch( _nPos );
-
- rXFSet.Put( XFillStyleItem( XFILL_HATCH ) );
- rXFSet.Put( XFillHatchItem( String(), pEntry->GetHatch() ) );
- }
- // NEU
- else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), TRUE, &pPoolItem ) )
- {
- rXFSet.Put( XFillStyleItem( XFILL_HATCH ) );
- rXFSet.Put( XFillHatchItem( String(), ( ( const XFillHatchItem* ) pPoolItem )->GetHatchValue() ) );
- }
- else
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
-
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlXRectPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl, void *, EMPTYARG )
-{
- const SfxPoolItem* pPoolItem = NULL;
- USHORT _nPos = aLbHatchBckgrdColor.GetSelectEntryPos();
- aLbColor.SelectEntryPos( _nPos );
- if( _nPos != LISTBOX_ENTRY_NOTFOUND )
- {
-// rXFSet.Put( XFillStyleItem( XFILL_SOLID ) );
- rXFSet.Put( XFillColorItem( String(),
- aLbHatchBckgrdColor.GetSelectEntryColor() ) );
- }
- // NEU
- else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), TRUE, &pPoolItem ) )
- {
-// rXFSet.Put( XFillStyleItem( XFILL_SOLID ) );
- Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue() );
- rXFSet.Put( XFillColorItem( String(), aColor ) );
- }
- else
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
-
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlXRectPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl, void *, EMPTYARG )
-{
- // switch on/off backgroundcolor for hatches
- aLbHatchBckgrdColor.Enable( aCbxHatchBckgrd.IsChecked() );
-
- XFillBackgroundItem aItem( aCbxHatchBckgrd.IsChecked() );
- rXFSet.Put ( aItem, XATTR_FILLBACKGROUND );
-
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlXRectPreview.Invalidate();
-
- if( aLbHatchBckgrdColor.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
- {
- if ( SFX_ITEM_SET == rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )//>= SFX_ITEM_DEFAULT )
- {
- XFillColorItem aColorItem( (const XFillColorItem&)rOutAttrs.Get( XATTR_FILLCOLOR ) );
- aLbHatchBckgrdColor.SelectEntry( aColorItem.GetColorValue() );
- }
- }
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ClickBitmapHdl_Impl, void *, EMPTYARG )
-{
- aLbColor.Hide();
- aLbGradient.Hide();
- aLbHatching.Hide();
- aLbBitmap.Enable();
- aLbBitmap.Show();
- aCtlBitmapPreview.Enable();
- aCtlBitmapPreview.Show();
- aCtlXRectPreview.Hide();
-// aGrpPreview.Hide();
-// aGrpTransparent.Hide();
-// aLbTransparent.Hide();
- aFlStepCount.Hide();
- aTsbStepCount.Hide();
- aNumFldStepCount.Hide();
-
- aTsbTile.Enable();
- aTsbStretch.Enable();
- aTsbScale.Enable();
- aTsbOriginal.Enable();
- aFtXSize.Enable();
- aMtrFldXSize.Enable();
- aFtYSize.Enable();
- aMtrFldYSize.Enable();
- aFlSize.Enable();
- aCtlPosition.Enable();
- aFtXOffset.Enable();
- aMtrFldXOffset.Enable();
- aFtYOffset.Enable();
- aMtrFldYOffset.Enable();
- aFlPosition.Enable();
- aRbtRow.Enable();
- aRbtColumn.Enable();
- aMtrFldOffset.Enable();
- aFlOffset.Enable();
-
- // Controls for Hatch-Background
- aCbxHatchBckgrd.Hide();
- aLbHatchBckgrdColor.Hide();
-
- aTsbTile.Show();
- aTsbStretch.Show();
- aTsbScale.Show();
- aTsbOriginal.Show();
- aFtXSize.Show();
- aMtrFldXSize.Show();
- aFtYSize.Show();
- aMtrFldYSize.Show();
- aFlSize.Show();
- aCtlPosition.Show();
- aFtXOffset.Show();
- aMtrFldXOffset.Show();
- aFtYOffset.Show();
- aMtrFldYOffset.Show();
- aFlPosition.Show();
- aRbtRow.Show();
- aRbtColumn.Show();
- aMtrFldOffset.Show();
- aFlOffset.Show();
-
- // Text der Tabelle setzen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pBitmapList->GetPath() );
-
- aURL.Append( pBitmapList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- ModifyBitmapHdl_Impl( this );
- ModifyTileHdl_Impl( &aTsbOriginal );
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyBitmapHdl_Impl, void *, EMPTYARG )
-{
- const SfxPoolItem* pPoolItem = NULL;
- USHORT _nPos = aLbBitmap.GetSelectEntryPos();
- if( _nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- // ItemSet fuellen und an aCtlXRectPreview weiterleiten
- XBitmapEntry* pEntry = pBitmapList->GetBitmap( _nPos );
-
- rXFSet.Put( XFillStyleItem( XFILL_BITMAP ) );
- rXFSet.Put( XFillBitmapItem( String(), pEntry->GetXBitmap() ) );
- }
- // NEU
- else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), TRUE, &pPoolItem ) )
- {
- rXFSet.Put( XFillStyleItem( XFILL_BITMAP ) );
- rXFSet.Put( XFillBitmapItem( String(), ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() ) );
- }
- else
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
-
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlBitmapPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-//IMPL_LINK( SvxAreaTabPage, ModifyTransparentHdl_Impl, void *, EMPTYARG )
-//{
-// USHORT nPos = aLbTransparent.GetSelectEntryPos();
-// if( nPos != LISTBOX_ENTRY_NOTFOUND )
-// {
-// XFillTransparenceItem aItem( nPos * 25 );
-//
-// rXFSet.Put( XFillTransparenceItem( aItem ) );
-// aCtlXRectPreview.SetAttributes( aXFillAttr );
-//
-// aCtlXRectPreview.Invalidate();
-// }
-//
-// return( 0L );
-//}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p )
-{
- if( p == &aTsbStepCount )
- {
- if( aTsbStepCount.GetState() == STATE_NOCHECK )
- {
- if( aNumFldStepCount.GetText().Len() == 0 )
- aNumFldStepCount.SetText( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "64") ));
-
- aNumFldStepCount.Enable();
- }
- else
- aNumFldStepCount.Disable();
- }
-
- UINT16 nValue = 0;
- if( aTsbStepCount.GetState() != STATE_CHECK )
- {
- // Zustand != Disabled ?
- if( aNumFldStepCount.GetText().Len() > 0 )
- nValue = (UINT16) aNumFldStepCount.GetValue();
- }
- rXFSet.Put( XGradientStepCountItem( nValue ) );
- aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlXRectPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ModifyTileHdl_Impl, void *, EMPTYARG )
-{
- TriState eState = aTsbTile.GetState();
- if( eState == STATE_CHECK )
- {
- aTsbStretch.Disable();
- aRbtRow.Enable();
- aRbtColumn.Enable();
- aMtrFldOffset.Enable();
- aFlOffset.Enable();
-
- aCtlPosition.Enable();
- aCtlPosition.Invalidate();
- aFtXOffset.Enable();
- aMtrFldXOffset.Enable();
- aFtYOffset.Enable();
- aMtrFldYOffset.Enable();
- aFlPosition.Enable();
-
- aTsbScale.Enable();
- aTsbOriginal.Enable();
- aFtXSize.Enable();
- aMtrFldXSize.Enable();
- aFtYSize.Enable();
- aMtrFldYSize.Enable();
- aFlSize.Enable();
- }
- else if( eState == STATE_NOCHECK )
- {
- aTsbStretch.Enable();
- aRbtRow.Disable();
- aRbtColumn.Disable();
- aMtrFldOffset.Disable();
- aFlOffset.Disable();
-
- aCtlPosition.Disable();
- aCtlPosition.Invalidate();
- aFtXOffset.Disable();
- aMtrFldXOffset.Disable();
- aFtYOffset.Disable();
- aMtrFldYOffset.Disable();
- aFlPosition.Disable();
-
- if( aTsbStretch.GetState() != STATE_NOCHECK )
- {
- aTsbScale.Disable();
- aTsbOriginal.Disable();
- aFtXSize.Disable();
- aMtrFldXSize.Disable();
- aFtYSize.Disable();
- aMtrFldYSize.Disable();
- aFlSize.Disable();
- }
- else
- {
- aTsbScale.Enable();
- aTsbOriginal.Enable();
- aFtXSize.Enable();
- aMtrFldXSize.Enable();
- aFtYSize.Enable();
- aMtrFldYSize.Enable();
- aFlSize.Enable();
- }
- }
- else
- {
- aTsbStretch.Disable();
- aRbtRow.Disable();
- aRbtColumn.Disable();
- aMtrFldOffset.Disable();
- aFlOffset.Disable();
-
- aCtlPosition.Disable();
- aCtlPosition.Invalidate();
- aFtXOffset.Disable();
- aMtrFldXOffset.Disable();
- aFtYOffset.Disable();
- aMtrFldYOffset.Disable();
- aFlPosition.Disable();
-
- aTsbScale.Disable();
- aTsbOriginal.Disable();
- aFtXSize.Disable();
- aMtrFldXSize.Disable();
- aFtYSize.Disable();
- aMtrFldYSize.Disable();
- aFlSize.Disable();
- }
-
- if( aTsbOriginal.GetState() == STATE_CHECK )
- {
- aMtrFldXSize.SetText( String() );
- aMtrFldYSize.SetText( String() );
- aFtXSize.Disable();
- aFtYSize.Disable();
- aMtrFldXSize.Disable();
- aMtrFldYSize.Disable();
- aTsbScale.Disable();
- }
- else
- {
- aMtrFldXSize.SetValue( aMtrFldXSize.GetValue() );
- aMtrFldYSize.SetValue( aMtrFldYSize.GetValue() );
- /*
- if( eState == STATE_CHECK )
- {
- aFtXSize.Enable();
- aFtYSize.Enable();
- aMtrFldXSize.Enable();
- aMtrFldYSize.Enable();
- }
- */
- }
-
- rXFSet.Put( XFillBmpTileItem( sal::static_int_cast< BOOL >( eState ) ) );
-
- if( aTsbStretch.IsEnabled() )
- rXFSet.Put(
- XFillBmpStretchItem(
- sal::static_int_cast< BOOL >( aTsbStretch.GetState() ) ) );
-
- if( aTsbScale.IsEnabled() )
- rXFSet.Put( XFillBmpSizeLogItem( aTsbScale.GetState() == STATE_NOCHECK ) );
-
- if( aMtrFldXSize.IsEnabled() )
- {
- XFillBmpSizeXItem* pItem = NULL;
- TriState eScaleState = aTsbScale.GetState();
-
- if( eScaleState == STATE_NOCHECK )
- pItem = new XFillBmpSizeXItem( GetCoreValue( aMtrFldXSize, ePoolUnit ) );
- else
- pItem = new XFillBmpSizeXItem( -labs( static_cast<long>(aMtrFldXSize.GetValue()) ) );
-
- rXFSet.Put( *pItem );
-
- delete pItem;
- }
- else if( aTsbOriginal.IsEnabled() && aTsbOriginal.GetState() == STATE_CHECK )
- {
- // Originalgroesse -> Size == 0
- rXFSet.Put( XFillBmpSizeXItem( 0 ) );
- rXFSet.Put( XFillBmpSizeLogItem( TRUE ) );
- }
-
- if( aMtrFldYSize.IsEnabled() )
- {
- XFillBmpSizeYItem* pItem = NULL;
- TriState eScaleState = aTsbScale.GetState();
-
- if( eScaleState == STATE_NOCHECK )
- pItem = new XFillBmpSizeYItem( GetCoreValue( aMtrFldYSize, ePoolUnit ) );
- else
- pItem = new XFillBmpSizeYItem( -labs( static_cast<long>(aMtrFldYSize.GetValue()) ) );
-
- rXFSet.Put( *pItem );
-
- delete pItem;
- }
- else if( aTsbOriginal.IsEnabled() && aTsbOriginal.GetState() == STATE_CHECK )
- {
- // Originalgroesse -> Size == 0
- rXFSet.Put( XFillBmpSizeYItem( 0 ) );
- rXFSet.Put( XFillBmpSizeLogItem( TRUE ) );
- }
-
- if( aMtrFldOffset.IsEnabled() )
- {
- if( aRbtRow.IsChecked() )
- {
- rXFSet.Put( XFillBmpTileOffsetXItem( (UINT16) aMtrFldOffset.GetValue() ) );
- rXFSet.Put( XFillBmpTileOffsetYItem( (UINT16) 0 ) );
- }
- else if( aRbtColumn.IsChecked() )
- {
- rXFSet.Put( XFillBmpTileOffsetXItem( (UINT16) 0 ) );
- rXFSet.Put( XFillBmpTileOffsetYItem( (UINT16) aMtrFldOffset.GetValue() ) );
- }
- }
-
- if( aCtlPosition.IsEnabled() )
- rXFSet.Put( XFillBmpPosItem( aCtlPosition.GetActualRP() ) );
-
- if( aMtrFldXOffset.IsEnabled() )
- rXFSet.Put( XFillBmpPosOffsetXItem( (UINT16) aMtrFldXOffset.GetValue() ) );
-
- if( aMtrFldYOffset.IsEnabled() )
- rXFSet.Put( XFillBmpPosOffsetYItem( (UINT16) aMtrFldYOffset.GetValue() ) );
-
-
- aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlBitmapPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAreaTabPage, ClickScaleHdl_Impl, void *, EMPTYARG )
-{
- if( aTsbScale.GetState() == STATE_CHECK )
- {
- aMtrFldXSize.SetDecimalDigits( 0 );
- aMtrFldXSize.SetUnit( FUNIT_CUSTOM );
- aMtrFldXSize.SetValue( 100 );
- aMtrFldXSize.SetMax( 100 );
- aMtrFldXSize.SetLast( 100 );
-
- aMtrFldYSize.SetDecimalDigits( 0 );
- aMtrFldYSize.SetUnit( FUNIT_CUSTOM );
- aMtrFldYSize.SetValue( 100 );
- aMtrFldYSize.SetMax( 100 );
- aMtrFldYSize.SetLast( 100 );
- }
- else
- {
- aMtrFldXSize.SetDecimalDigits( 2 );
- aMtrFldXSize.SetUnit( eFUnit );
- aMtrFldXSize.SetValue( 100 );
- aMtrFldXSize.SetMax( 999900 );
- aMtrFldXSize.SetLast( 100000 );
-
- aMtrFldYSize.SetDecimalDigits( 2 );
- aMtrFldYSize.SetUnit( eFUnit );
- aMtrFldYSize.SetValue( 100 );
- aMtrFldYSize.SetMax( 999900 );
- aMtrFldYSize.SetLast( 100000 );
- }
-
- ModifyTileHdl_Impl( NULL );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxAreaTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
-{
- eRP = eRcPt;
-
- // Ausrichtung der Bitmapfuellung
- ModifyTileHdl_Impl( pWindow );
-}
-
-void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pHatchingListItem,SvxHatchListItem,SID_HATCH_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pBitmapListItem,SvxBitmapListItem,SID_BITMAP_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False);
-
- if (pColorTabItem)
- SetColorTable(pColorTabItem->GetColorTable());
- if (pGradientListItem)
- SetGradientList(pGradientListItem->GetGradientList());
- if (pHatchingListItem)
- SetHatchingList(pHatchingListItem->GetHatchList());
- if (pBitmapListItem)
- SetBitmapList(pBitmapListItem->GetBitmapList());
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- if (pDlgTypeItem)
- SetDlgType(pDlgTypeItem->GetValue());
- if (pPosItem)
- SetPos(pPosItem->GetValue());
- Construct();
-}
-
diff --git a/svx/source/cui/tpbitmap.cxx b/svx/source/cui/tpbitmap.cxx
deleted file mode 100644
index febfa18e90..0000000000
--- a/svx/source/cui/tpbitmap.cxx
+++ /dev/null
@@ -1,1179 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tpbitmap.cxx,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-//svdraw.hxx
-#define _SVDRAW_HXX
-#define _SDR_NOITEMS
-#define _SDR_NOTOUCH
-#define _SDR_NOTRANSFORM
-#define _SDR_NOOBJECTS
-#define _SDR_NOVIEWS
-#define _SDR_NOVIEWMARKER
-#define _SDR_NODRAGMETHODS
-#define _SDR_NOUNDO
-#define _SDR_NOXOUTDEV
-#include <vcl/wrkwin.hxx>
-#include <tools/shl.hxx>
-#include <vcl/msgbox.hxx>
-#include <tools/urlobj.hxx>
-#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
-#include <unotools/ucbstreamhelper.hxx>
-#endif
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include <unotools/localfilehelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-#include <vcl/bmpacc.hxx>
-
-#define _SVX_TPBITMAP_CXX
-
-
-
-#include <svx/dialogs.hrc>
-
-#include "helpid.hrc"
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/xtable.hxx>
-#include "xoutbmp.hxx"
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include "tabarea.hrc"
-#include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
-#include "dlgname.hrc"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialmgr.hxx>
-#include "opengrf.hxx"
-
-#define DLGWIN this->GetParent()->GetParent()
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern und Definieren der Bitmaps
-|*
-\************************************************************************/
-
-SvxBitmapTabPage::SvxBitmapTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
-
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_BITMAP ), rInAttrs ),
-
- aCtlPixel ( this, SVX_RES( CTL_PIXEL ) ),
- aFtPixelEdit ( this, SVX_RES( FT_PIXEL_EDIT ) ),
- aFtColor ( this, SVX_RES( FT_COLOR ) ),
- aLbColor ( this, SVX_RES( LB_COLOR ) ),
- aFtBackgroundColor ( this, SVX_RES( FT_BACKGROUND_COLOR ) ),
- aLbBackgroundColor ( this, SVX_RES( LB_BACKGROUND_COLOR ) ),
- // This fix text is used only to provide the name for the following
- // bitmap list box. The fixed text is not displayed.
- aLbBitmapsHidden ( this, SVX_RES( FT_BITMAPS_HIDDEN ) ),
- aLbBitmaps ( this, SVX_RES( LB_BITMAPS ) ),
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- aBtnAdd ( this, SVX_RES( BTN_ADD ) ),
- aBtnModify ( this, SVX_RES( BTN_MODIFY ) ),
- aBtnImport ( this, SVX_RES( BTN_IMPORT ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aBtnLoad ( this, SVX_RES( BTN_LOAD ) ),
- aBtnSave ( this, SVX_RES( BTN_SAVE ) ),
-
- aBitmapCtl ( this, aCtlPreview.GetSizePixel() ),
- rOutAttrs ( rInAttrs ),
-
- pColorTab( NULL ),
- pBitmapList( NULL ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFStyleItem ( XFILL_BITMAP ),
- aXBitmapItem ( String(), XOBitmap() ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() )
-{
- aBtnLoad.SetModeImage( Image( SVX_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnSave.SetModeImage( Image( SVX_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Setzen des Output-Devices
- rXFSet.Put( aXFStyleItem );
- rXFSet.Put( aXBitmapItem );
- //aCtlPreview.SetAttributes( aXFillAttr );
-
- aBtnAdd.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickAddHdl_Impl ) );
- aBtnImport.SetClickHdl(
- LINK( this, SvxBitmapTabPage, ClickImportHdl_Impl ) );
- aBtnModify.SetClickHdl(
- LINK( this, SvxBitmapTabPage, ClickModifyHdl_Impl ) );
- aBtnDelete.SetClickHdl(
- LINK( this, SvxBitmapTabPage, ClickDeleteHdl_Impl ) );
- aBtnLoad.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickLoadHdl_Impl ) );
- aBtnSave.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickSaveHdl_Impl ) );
-
- aLbBitmaps.SetSelectHdl(
- LINK( this, SvxBitmapTabPage, ChangeBitmapHdl_Impl ) );
- aLbColor.SetSelectHdl(
- LINK( this, SvxBitmapTabPage, ChangePixelColorHdl_Impl ) );
- aLbBackgroundColor.SetSelectHdl(
- LINK( this, SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl ) );
-
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBitmapTabPage::Construct()
-{
- // Farbtabellen
- aLbColor.Fill( pColorTab );
- aLbBackgroundColor.CopyEntries( aLbColor );
-
- // Bitmaptabelle
- aLbBitmaps.Fill( pBitmapList );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBitmapTabPage::ActivatePage( const SfxItemSet& )
-{
- USHORT nPos;
- USHORT nCount;
-
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- *pbAreaTP = FALSE;
-
- if( pColorTab )
- {
- // ColorTable
- if( *pnColorTableState & CT_CHANGED ||
- *pnColorTableState & CT_MODIFIED )
- {
- if( *pnColorTableState & CT_CHANGED )
- pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable();
-
- // LbColor
- nPos = aLbColor.GetSelectEntryPos();
- aLbColor.Clear();
- aLbColor.Fill( pColorTab );
- nCount = aLbColor.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbColor.SelectEntryPos( 0 );
- else
- aLbColor.SelectEntryPos( nPos );
-
- // LbColorBackground
- nPos = aLbBackgroundColor.GetSelectEntryPos();
- aLbBackgroundColor.Clear();
- aLbBackgroundColor.CopyEntries( aLbColor );
- nCount = aLbBackgroundColor.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbBackgroundColor.SelectEntryPos( 0 );
- else
- aLbBackgroundColor.SelectEntryPos( nPos );
-
- ChangePixelColorHdl_Impl( this );
- ChangeBackgrndColorHdl_Impl( this );
- }
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pBitmapList->GetPath() );
-
- aURL.Append( pBitmapList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- if( *pPageType == PT_BITMAP && *pPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbBitmaps.SelectEntryPos( *pPos );
- }
- // Farben koennten geloescht worden sein
- ChangeBitmapHdl_Impl( this );
-
- *pPageType = PT_BITMAP;
- *pPos = LISTBOX_ENTRY_NOTFOUND;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet)
-{
- if ( CheckChanges_Impl() == -1L )
- return KEEP_PAGE;
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs )
-{
- if( *pDlgType == 0 && *pbAreaTP == FALSE ) // Flaechen-Dialog
- {
- if( *pPageType == PT_BITMAP )
- {
- // CheckChanges_Impl(); <-- doppelte Abfrage ?
-
- XOBitmap aXOBitmap;
- String aString;
- USHORT nPos = aLbBitmaps.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aXOBitmap = pBitmapList->GetBitmap( nPos )->GetXBitmap();
- aString = aLbBitmaps.GetSelectEntry();
-
- }
- else
- {
- aXOBitmap = aBitmapCtl.GetXBitmap();
-
- // #85339# if it's an array, force conversion to bitmap before using it.
- if(aXOBitmap.GetBitmapType() == XBITMAP_8X8)
- aXOBitmap.GetBitmap();
-
- }
- _rOutAttrs.Put( XFillStyleItem( XFILL_BITMAP ) );
- _rOutAttrs.Put( XFillBitmapItem( aString, aXOBitmap ) );
- }
- }
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxBitmapTabPage::Reset( const SfxItemSet& )
-{
- // aLbBitmaps.SelectEntryPos( 0 );
-
- aBitmapCtl.SetLines( aCtlPixel.GetLineCount() );
- aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
- aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
- aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
-
- // Bitmap holen und darstellen
- XFillBitmapItem aBmpItem( (const String &) String(), aBitmapCtl.GetXBitmap() );
- rXFSet.Put( aBmpItem );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-
- ChangeBitmapHdl_Impl( this );
-
- // Status der Buttons ermitteln
- if( pBitmapList->Count() )
- {
- aBtnAdd.Enable();
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxBitmapTabPage::Create( Window* pWindow,
- const SfxItemSet& rSet )
-{
- return new SvxBitmapTabPage( pWindow, rSet );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ChangeBitmapHdl_Impl, void *, EMPTYARG )
-{
- XOBitmap* pXOBitmap = NULL;
- int nPos = aLbBitmaps.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- pXOBitmap = new XOBitmap( ( (XBitmapEntry*) pBitmapList->GetBitmap( nPos ) )->GetXBitmap() );
- else
- {
- const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), TRUE, &pPoolItem ) )
- {
- XFillStyle eXFS = (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue();
- if( ( XFILL_BITMAP == eXFS ) &&
- ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), TRUE, &pPoolItem ) ) )
- {
- pXOBitmap = new XOBitmap( ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() );
- }
- }
- if( !pXOBitmap )
- {
- aLbBitmaps.SelectEntryPos( 0 );
- nPos = aLbBitmaps.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- pXOBitmap = new XOBitmap( ( (XBitmapEntry*) pBitmapList->GetBitmap( nPos ) )->GetXBitmap() );
- }
- }
- if( pXOBitmap )
- {
- //WorkWindow aTmpWW( DLGWIN );
- //VirtualDevice aVD( aTmpWW );
- //USHORT nLines = aCtlPixel.GetLineCount();
- //Color aPixelColor, aBackColor;
- //BOOL bPixelColor = FALSE;
- //USHORT nWidth = pBitmap->GetSizePixel().Width();
- //USHORT nHeight = pBitmap->GetSizePixel().Height();
-
- // #85339# try to convert bitmapped item to array item.
- if(pXOBitmap->GetBitmapType() == XBITMAP_IMPORT)
- {
- Bitmap aBitmap(pXOBitmap->GetBitmap());
- Size aSizePixel(aBitmap.GetSizePixel());
-
- if(8 == aSizePixel.Width() && 8 == aSizePixel.Height())
- {
- sal_uInt16* pPixelArray = new sal_uInt16[64];
- sal_uInt32 nCol1(0xffffffff); // background
- sal_uInt32 nCol2(0xffffffff); // pixel
- BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess();
- sal_Bool bValid(TRUE);
-
- if(pAccess)
- {
- for(sal_uInt32 a(0); bValid && a < 64; a++)
- {
- const BitmapColor aBmCol = pAccess->GetColor(a>>3, a%8);
- Color aRgbCol(aBmCol.GetRed(), aBmCol.GetGreen(), aBmCol.GetBlue());
- sal_uInt32 nColVal = aRgbCol.GetRGBColor();
-
- // test with nCol1
- if(nCol1 != nColVal)
- {
- if(0xffffffff == nCol1)
- {
- // nCol1 is used first time
- nCol1 = nColVal;
- pPixelArray[a] = 0;
- }
- else
- {
- // test with nCol2
- if(nCol2 != nColVal)
- {
- if(0xffffffff == nCol2)
- {
- // nCol2 used first time
- nCol2 = nColVal;
- pPixelArray[a] = 1;
- }
- else
- {
- // Third color detected
- bValid = FALSE;
- }
- }
- else
- {
- // color is pixel color
- pPixelArray[a] = 1;
- }
- }
- }
- else
- {
- // color is background color
- pPixelArray[a] = 0;
- }
- }
-
- // release ReadAccess
- aBitmap.ReleaseAccess(pAccess);
- }
- else
- {
- // no access -> no success
- bValid = FALSE;
- }
-
- if(bValid)
- {
- Color aCol1(nCol1);
- Color aCol2(nCol2);
-
- // no pixel color found? Use opposite od background color.
- if(0xffffffff == nCol2)
- {
- aCol2 = Color(
- 0xff - aCol1.GetRed(),
- 0xff - aCol1.GetGreen(),
- 0xff - aCol1.GetBlue());
- }
-
- // transformation did work, create a new Item
- delete pXOBitmap;
- pXOBitmap = new XOBitmap(pPixelArray, aCol2, aCol1);
- }
-
- // cleanup
- delete[] pPixelArray;
- }
- }
-
- aLbColor.SetNoSelection();
- aLbBackgroundColor.SetNoSelection();
-
- if( pXOBitmap->GetBitmapType() == XBITMAP_IMPORT )
- {
- aCtlPixel.Reset();
- aCtlPixel.SetPaintable( FALSE );
- aCtlPixel.Disable();
- aFtPixelEdit.Disable();
- aFtColor.Disable();
- aLbColor.Disable();
- aFtBackgroundColor.Disable();
- aLbBackgroundColor.Disable();
- aBtnModify.Disable();
- aBtnAdd.Disable();
- }
- else if( pXOBitmap->GetBitmapType() == XBITMAP_8X8 )
- {
- aCtlPixel.SetPaintable( TRUE );
- aCtlPixel.Enable();
- aFtPixelEdit.Enable();
- aFtColor.Enable();
- aLbColor.Enable();
- aFtBackgroundColor.Enable();
- aLbBackgroundColor.Enable();
- aBtnModify.Enable();
- aBtnAdd.Enable();
-
- // Setzen des PixelControls
- aCtlPixel.SetXBitmap( *pXOBitmap );
-
- Color aPixelColor = pXOBitmap->GetPixelColor();
- Color aBackColor = pXOBitmap->GetBackgroundColor();
-
- aBitmapCtl.SetPixelColor( aPixelColor );
- aBitmapCtl.SetBackgroundColor( aBackColor );
-
- // Wenn der Eintrag nicht in der Listbox ist, wird die Farbe
- // temporaer hinzugenommen
- if( 0 == aLbBitmaps.GetSelectEntryPos() )
- {
- aLbColor.SelectEntry( Color( COL_BLACK ) );
- ChangePixelColorHdl_Impl( this );
- }
- else
- aLbColor.SelectEntry( aPixelColor );
- if( aLbColor.GetSelectEntryCount() == 0 )
- {
- aLbColor.InsertEntry( aPixelColor, String() );
- aLbColor.SelectEntry( aPixelColor );
- }
- aLbBackgroundColor.SelectEntry( aBackColor );
- if( aLbBackgroundColor.GetSelectEntryCount() == 0 )
- {
- aLbBackgroundColor.InsertEntry( aBackColor, String() );
- aLbBackgroundColor.SelectEntry( aBackColor );
- }
- }
- aCtlPixel.Invalidate();
-
- // Bitmap darstellen
- XFillBitmapItem aXBmpItem( (const String &) String(), *pXOBitmap );
- rXFSet.Put( aXBmpItem );
-
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-
- bBmpChanged = FALSE;
- delete pXOBitmap;
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-long SvxBitmapTabPage::CheckChanges_Impl()
-{
- USHORT nPos = aLbBitmaps.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- String aString = aLbBitmaps.GetSelectEntry();
-
- if( bBmpChanged )
- {
- ResMgr& rMgr = DIALOG_MGR();
- Image aWarningBoxImage = WarningBox::GetStandardImage();
- //CHINA001 SvxMessDialog aMessDlg( DLGWIN,
- //CHINA001 String( SVX_RES( RID_SVXSTR_BITMAP, rMgr ) ),
- //CHINA001 String( SVX_RES( RID_SVXSTR_ASK_CHANGE_BITMAP, rMgr ) ),
- //CHINA001 &aWarningBoxImage );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX,
- String( ResId( RID_SVXSTR_BITMAP, rMgr ) ),
- String( ResId( RID_SVXSTR_ASK_CHANGE_BITMAP, rMgr ) ),
- &aWarningBoxImage );
- DBG_ASSERT(aMessDlg, "Dialogdiet fail!");//CHINA001
- aMessDlg->SetButtonText( MESS_BTN_1, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
- String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
- String( ResId( RID_SVXSTR_ADD, rMgr ) ) );
-
- short nRet = aMessDlg->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
-
- switch( nRet )
- {
- case RET_BTN_1: // Aendern
- {
- ClickModifyHdl_Impl( this );
- }
- break;
-
- case RET_BTN_2: // Hinzufuegen
- {
- ClickAddHdl_Impl( this );
- nPos = aLbBitmaps.GetSelectEntryPos();
- }
- break;
-
- case RET_CANCEL:
- // return( -1L );
- break;
- // return( TRUE ); // Abbruch
- }
- delete aMessDlg; //add by CHINA001
- }
- }
- nPos = aLbBitmaps.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- *pPos = nPos;
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_BITMAP, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_NEW_BITMAP, rMgr ) );
- String aName;
-
- long nCount = pBitmapList->Count();
- long j = 1;
- BOOL bDifferent = FALSE;
-
- while( !bDifferent )
- {
- aName = aNewName;
- aName += sal_Unicode(' ');
- aName += UniString::CreateFromInt32( j++ );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pBitmapList->GetBitmap( i )->GetName() )
- bDifferent = FALSE;
- }
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- WarningBox* pWarnBox = NULL;
- USHORT nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
-
- while( pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
-
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pBitmapList->GetBitmap( i )->GetName() )
- bDifferent = FALSE;
-
- if( bDifferent ) {
- nError = 0;
- break;
- }
-
- if( !pWarnBox )
- {
- pWarnBox = new WarningBox( DLGWIN,
- WinBits( WB_OK_CANCEL ),
- String( ResId( nError, rMgr ) ) );
- pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
- }
-
- if( pWarnBox->Execute() != RET_OK )
- break;
- }
- //Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
- delete pDlg;
- delete pWarnBox;
-
- if( !nError )
- {
- XBitmapEntry* pEntry = 0;
- if( aCtlPixel.IsEnabled() )
- {
- XOBitmap aXOBitmap = aBitmapCtl.GetXBitmap();
-
- // #85339# if it's an array, force conversion to bitmap before using it.
- if(aXOBitmap.GetBitmapType() == XBITMAP_8X8)
- aXOBitmap.GetBitmap();
-
- pEntry = new XBitmapEntry( aXOBitmap, aName );
- }
- else // Es muss sich um eine nicht vorhandene importierte Bitmap handeln
- {
- const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( XATTR_FILLBITMAP, TRUE, &pPoolItem ) )
- {
- XOBitmap aXOBitmap( ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() );
- pEntry = new XBitmapEntry( aXOBitmap, aName );
- }
- }
-
- DBG_ASSERT( pEntry, "SvxBitmapTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" );
-
- if( pEntry )
- {
- pBitmapList->Insert( pEntry );
-
- aLbBitmaps.Append( pEntry );
- aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
-
-#ifdef WNT
- // hack: #31355# W.P.
- Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() );
- if( TRUE ) { // ??? overlapped with pDlg
- // and srolling
- Invalidate( aRect );
- //aLbBitmaps.Invalidate();
- }
-#endif
-
- // Flag fuer modifiziert setzen
- *pnBitmapListState |= CT_MODIFIED;
-
- ChangeBitmapHdl_Impl( this );
- }
- }
-
- // Status der Buttons ermitteln
- if( pBitmapList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- return 0L;
-}
-
-
-/******************************************************************************/
-/******************************************************************************/
-
-
-//------------------------------------------------------------------------
-
-#ifdef _MSC_VER
-#pragma optimize ( "", off )
-#endif
-
-IMPL_LINK( SvxBitmapTabPage, ClickImportHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- SvxOpenGraphicDialog aDlg( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Import" ) ) );
- aDlg.EnableLink(sal_False);
-
- if( !aDlg.Execute() )
- {
- Graphic aGraphic;
- int nError = 1;
-
- EnterWait();
- nError = aDlg.GetGraphic( aGraphic );
- LeaveWait();
-
- if( !nError )
- {
- String aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) );
- WarningBox* pWarnBox = NULL;
-
- // convert file URL to UI name
- String aName;
- INetURLObject aURL( aDlg.GetPath() );
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aURL.GetName().GetToken( 0, '.' ), aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, String(aURL.GetName()).GetToken( 0, '.' ), aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
-
- while( pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
-
- BOOL bDifferent = TRUE;
- long nCount = pBitmapList->Count();
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pBitmapList->GetBitmap( i )->GetName() )
- bDifferent = FALSE;
-
- if( bDifferent ) {
- nError = 0;
- break;
- }
-
- if( !pWarnBox )
- {
- pWarnBox = new WarningBox( DLGWIN,
- WinBits( WB_OK_CANCEL ),
- String( ResId( nError, rMgr ) ) );
- pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
- }
-
-
- if( pWarnBox->Execute() != RET_OK )
- break;
- }
- //Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
- delete pDlg;
- delete pWarnBox;
-
- if( !nError )
- {
- Bitmap aBmp( aGraphic.GetBitmap() );
- XBitmapEntry* pEntry =
- new XBitmapEntry( XOBitmap( aBmp ), aName );
- pBitmapList->Insert( pEntry );
-
- aLbBitmaps.Append( pEntry );
- aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 );
-
-#ifdef WNT
- // hack: #31355# W.P.
- Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() );
- if( TRUE ) { // ??? overlapped with pDlg
- // and srolling
- Invalidate( aRect );
- //aLbBitmaps.Invalidate();
- }
-#endif
-
- // Flag fuer modifiziert setzen
- *pnBitmapListState |= CT_MODIFIED;
-
- ChangeBitmapHdl_Impl( this );
- }
- }
- else
- // Graphik konnte nicht geladen werden
- ErrorBox( DLGWIN,
- WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
- }
-
- return 0L;
-}
-
-#ifdef _MSC_VER
-#pragma optimize ( "", on )
-#endif
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbBitmaps.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_BITMAP, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_NEW_BITMAP, rMgr ) );
- String aName( pBitmapList->GetBitmap( nPos )->GetName() );
- String aOldName = aName;
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
-
- long nCount = pBitmapList->Count();
- BOOL bDifferent = FALSE;
- BOOL bLoop = TRUE;
-
- while( bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pBitmapList->GetBitmap( i )->GetName() &&
- aName != aOldName )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- {
- bLoop = FALSE;
- XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
-
- pEntry->SetName( aName );
-
- XOBitmap aXOBitmap = aBitmapCtl.GetXBitmap();
-
- // #85339# if it's an array, force conversion to bitmap before using it.
- if(aXOBitmap.GetBitmapType() == XBITMAP_8X8)
- aXOBitmap.GetBitmap();
-
- pEntry->SetXBitmap( aXOBitmap );
-
- aLbBitmaps.Modify( pEntry, nPos );
- aLbBitmaps.SelectEntryPos( nPos );
-
- // Flag fuer modifiziert setzen
- *pnBitmapListState |= CT_MODIFIED;
-
- bBmpChanged = FALSE;
- }
- else
- {
- WarningBox aBox( DLGWIN, WinBits( WB_OK ), String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aBox.Execute();
- }
- }
- delete pDlg;
- }
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbBitmaps.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
-//! SVX_RES( RID_SVXSTR_DEL_BITMAP ),
- String( SVX_RES( RID_SVXSTR_ASK_DEL_BITMAP ) ) );
-
- if( aQueryBox.Execute() == RET_YES )
- {
- delete pBitmapList->Remove( nPos );
- aLbBitmaps.RemoveEntry( nPos );
- aLbBitmaps.SelectEntryPos( 0 );
-
- aCtlPreview.Invalidate();
- aCtlPixel.Invalidate();
-
- ChangeBitmapHdl_Impl( this );
-
- // Flag fuer modifiziert setzen
- *pnBitmapListState |= CT_MODIFIED;
- }
- }
- // Status der Buttons ermitteln
- if( !pBitmapList->Count() )
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
-{
- USHORT nReturn = RET_YES;
- ResMgr& rMgr = DIALOG_MGR();
-
- if ( *pnBitmapListState & CT_MODIFIED )
- {
- nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
- String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
-
- if ( nReturn == RET_YES )
- pBitmapList->Save();
- }
-
- if ( nReturn != RET_CANCEL )
- {
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sob" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- EnterWait();
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- // Tabelle speichern
- XBitmapList* pBmpList = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pBmpList->SetName( aURL.getName() );
- if( pBmpList->Load() )
- {
- if( pBmpList )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pBitmapList != ( (SvxAreaTabDialog*) DLGWIN )->GetBitmapList() )
- delete pBitmapList;
-
- pBitmapList = pBmpList;
- ( (SvxAreaTabDialog*) DLGWIN )->SetNewBitmapList( pBitmapList );
-
- aLbBitmaps.Clear();
- aLbBitmaps.Fill( pBitmapList );
- Reset( rOutAttrs );
-
- pBitmapList->SetName( aURL.getName() );
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gewechselt setzen
- *pnBitmapListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnBitmapListState &= ~CT_MODIFIED;
- }
- LeaveWait();
- }
- else
- {
- LeaveWait();
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
- }
- }
- }
-
- // Status der Buttons ermitteln
- if( pBitmapList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
-{
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sob" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
-
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( pBitmapList->GetName().Len() )
- {
- aFile.Append( pBitmapList->GetName() );
-
- if( !aFile.getExtension().getLength() )
- aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sob" ) ) );
- }
-
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- pBitmapList->SetName( aURL.getName() );
- pBitmapList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( pBitmapList->Save() )
- {
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gespeichert setzen
- *pnBitmapListState |= CT_SAVED;
- // Flag fuer modifiziert entfernen
- *pnBitmapListState &= ~CT_MODIFIED;
- }
- else
- {
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( SVX_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute();
- }
- }
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ChangePixelColorHdl_Impl, void *, EMPTYARG )
-{
- aCtlPixel.SetPixelColor( aLbColor.GetSelectEntryColor() );
- aCtlPixel.Invalidate();
-
- aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() );
-
- // Bitmap holen und darstellen
- rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-
- bBmpChanged = TRUE;
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, void *, EMPTYARG )
-{
- aCtlPixel.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
- aCtlPixel.Invalidate();
-
- aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() );
-
- // Bitmap holen und darstellen
- rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-
- bBmpChanged = TRUE;
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-void SvxBitmapTabPage::PointChanged( Window* pWindow, RECT_POINT )
-{
- if( pWindow == &aCtlPixel )
- {
- aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() );
-
- // Bitmap holen und darstellen
- rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-
- bBmpChanged = TRUE;
- }
-}
-
-
-
-
-Window* SvxBitmapTabPage::GetParentLabeledBy( const Window* pLabeled ) const
-{
- if (pLabeled == &aLbBitmaps)
- return const_cast<FixedText*>(&aLbBitmapsHidden);
- else
- return SvxTabPage::GetParentLabeledBy (pLabeled);
-}
diff --git a/svx/source/cui/tpcolor.cxx b/svx/source/cui/tpcolor.cxx
deleted file mode 100644
index a373c985f3..0000000000
--- a/svx/source/cui/tpcolor.cxx
+++ /dev/null
@@ -1,1286 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tpcolor.cxx,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <svtools/colrdlg.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-#define _SVX_TPCOLOR_CXX
-
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/xtable.hxx>
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include "tabarea.hrc"
-#include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
-#include "dlgname.hrc"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialmgr.hxx>
-#include <cuitabline.hxx>
-
-#define DLGWIN GetParentDialog( this )
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern und Definieren der Farben
-|*
-\************************************************************************/
-
-static Window* GetParentDialog( Window* pWindow )
-{
- while( pWindow )
- {
- if( pWindow->IsDialog() )
- break;
-
- pWindow = pWindow->GetParent();
- }
-
- return pWindow;
-}
-
-SvxColorTabPage::SvxColorTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
-
- SfxTabPage ( pParent, SVX_RES( RID_SVXPAGE_COLOR ), rInAttrs ),
-
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aFtName ( this, SVX_RES( FT_NAME ) ),
- aEdtName ( this, SVX_RES( EDT_NAME ) ),
- aFtColor ( this, SVX_RES( FT_COLOR ) ),
- aLbColor ( this, SVX_RES( LB_COLOR ) ),
-
- aTableNameFT ( this, SVX_RES( FT_TABLE_NAME ) ),
- aValSetColorTable ( this, SVX_RES( CTL_COLORTABLE ) ),
-
- aCtlPreviewOld ( this, SVX_RES( CTL_PREVIEW_OLD ) ),
- aCtlPreviewNew ( this, SVX_RES( CTL_PREVIEW_NEW ) ),
-
- aLbColorModel ( this, SVX_RES( LB_COLORMODEL ) ),
- aFtColorModel1 ( this, SVX_RES( FT_1 ) ),
- aMtrFldColorModel1 ( this, SVX_RES( MTR_FLD_1 ) ),
- aFtColorModel2 ( this, SVX_RES( FT_2 ) ),
- aMtrFldColorModel2 ( this, SVX_RES( MTR_FLD_2 ) ),
- aFtColorModel3 ( this, SVX_RES( FT_3 ) ),
- aMtrFldColorModel3 ( this, SVX_RES( MTR_FLD_3 ) ),
- aFtColorModel4 ( this, SVX_RES( FT_4 ) ),
- aMtrFldColorModel4 ( this, SVX_RES( MTR_FLD_4 ) ),
- aBtnAdd ( this, SVX_RES( BTN_ADD ) ),
- aBtnModify ( this, SVX_RES( BTN_MODIFY ) ),
- aBtnWorkOn ( this, SVX_RES( BTN_WORK_ON ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aBtnLoad ( this, SVX_RES( BTN_LOAD ) ),
- aBtnSave ( this, SVX_RES( BTN_SAVE ) ),
-
- rOutAttrs ( rInAttrs ),
- pColorTab( NULL ),
-
- bDeleteColorTable ( TRUE ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFStyleItem ( XFILL_SOLID ),
- aXFillColorItem ( String(), Color( COL_BLACK ) ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() ),
-
- eCM ( CM_RGB )
-
-{
- aBtnLoad.SetModeImage( Image( SVX_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnSave.SetModeImage( Image( SVX_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
-
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Setzen des Output-Devices
- rXFSet.Put( aXFStyleItem );
- rXFSet.Put( aXFillColorItem );
- aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- // Handler ueberladen
- aLbColor.SetSelectHdl(
- LINK( this, SvxColorTabPage, SelectColorLBHdl_Impl ) );
- aValSetColorTable.SetSelectHdl(
- LINK( this, SvxColorTabPage, SelectValSetHdl_Impl ) );
- aLbColorModel.SetSelectHdl(
- LINK( this, SvxColorTabPage, SelectColorModelHdl_Impl ) );
-
- Link aLink = LINK( this, SvxColorTabPage, ModifiedHdl_Impl );
- aMtrFldColorModel1.SetModifyHdl( aLink );
- aMtrFldColorModel2.SetModifyHdl( aLink );
- aMtrFldColorModel3.SetModifyHdl( aLink );
- aMtrFldColorModel4.SetModifyHdl( aLink );
-
- aBtnAdd.SetClickHdl( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) );
- aBtnModify.SetClickHdl(
- LINK( this, SvxColorTabPage, ClickModifyHdl_Impl ) );
- aBtnWorkOn.SetClickHdl(
- LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) );
- aBtnDelete.SetClickHdl(
- LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) );
- aBtnLoad.SetClickHdl( LINK( this, SvxColorTabPage, ClickLoadHdl_Impl ) );
- aBtnSave.SetClickHdl( LINK( this, SvxColorTabPage, ClickSaveHdl_Impl ) );
-
- // ValueSet
- aValSetColorTable.SetStyle( aValSetColorTable.GetStyle() | WB_VSCROLL | WB_ITEMBORDER );
- aValSetColorTable.SetColCount( 8 );
- aValSetColorTable.SetLineCount( 10 );
- aValSetColorTable.SetExtraSpacing( 0 );
- aValSetColorTable.Show();
-
-}
-
-// -----------------------------------------------------------------------
-
-void SvxColorTabPage::Construct()
-{
- aLbColor.Fill( pColorTab );
- FillValueSet_Impl( aValSetColorTable );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxColorTabPage::ActivatePage( const SfxItemSet& )
-{
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- *pbAreaTP = FALSE;
-
- if( pColorTab )
- {
- if( *pPageType == PT_COLOR && *pPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbColor.SelectEntryPos( *pPos );
- aValSetColorTable.SelectItem( aLbColor.GetSelectEntryPos() + 1 );
- aEdtName.SetText( aLbColor.GetSelectEntry() );
-
- ChangeColorHdl_Impl( this );
- }
- else if( *pPageType == PT_COLOR && *pPos == LISTBOX_ENTRY_NOTFOUND )
- {
- const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), TRUE, &pPoolItem ) )
- {
- aLbColorModel.SelectEntryPos( CM_RGB );
-
- aAktuellColor.SetColor ( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue().GetColor() );
-
- aEdtName.SetText( ( ( const XFillColorItem* ) pPoolItem )->GetName() );
-
- aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) );
- aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) );
- aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) );
-
- // ItemSet fuellen und an XOut weiterleiten
- rXFSet.Put( XFillColorItem( String(), aAktuellColor ) );
- aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreviewNew.Invalidate();
- aCtlPreviewOld.Invalidate();
- }
- }
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pColorTab->GetPath() );
-
- aURL.Append( pColorTab->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- aTableNameFT.SetText( aString );
-
- // Damit evtl. geaenderte Farbe verworfen wird
- SelectColorLBHdl_Impl( this );
-
- *pPageType = PT_COLOR;
- *pPos = LISTBOX_ENTRY_NOTFOUND;
- }
- }
- else
- {
- // Buttons werden gehided, weil Paletten z.Z. nur
- // ueber den AreaDlg funktionieren!!!
- // ActivatePage() muss von anderen Dialogen explizit
- // gerufen werden, da ActivatePage() nicht gerufen wird,
- // wenn Seite als Erste im Dialog angezeigt wird
- aBtnLoad.Hide();
- aBtnSave.Hide();
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxColorTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( CheckChanges_Impl() == -1L )
- return( KEEP_PAGE );
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return( LEAVE_PAGE );
-}
-
-// -----------------------------------------------------------------------
-
-long SvxColorTabPage::CheckChanges_Impl()
-{
- // wird hier benutzt, um Aenderungen NICHT zu verlieren
-
- Color aTmpColor (aAktuellColor);
- if (eCM != CM_RGB)
- ConvertColorValues (aTmpColor, CM_RGB);
-
- USHORT nPos = aLbColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- Color aColor = pColorTab->GetColor( nPos )->GetColor();
- String aString = aLbColor.GetSelectEntry();
-
- // aNewColor, da COL_USER != COL_irgendwas, auch wenn RGB-Werte gleich
- // Color aNewColor( aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue() );
-
- if( ColorToPercent_Impl( aTmpColor.GetRed() ) != ColorToPercent_Impl( aColor.GetRed() ) ||
- ColorToPercent_Impl( aTmpColor.GetGreen() ) != ColorToPercent_Impl( aColor.GetGreen() ) ||
- ColorToPercent_Impl( aTmpColor.GetBlue() ) != ColorToPercent_Impl( aColor.GetBlue() ) ||
- aString != aEdtName.GetText() )
- {
- ResMgr& rMgr = DIALOG_MGR();
- Image aWarningBoxImage = WarningBox::GetStandardImage();
- //CHINA001 SvxMessDialog aMessDlg( DLGWIN,
- //CHINA001 String( SVX_RES( RID_SVXSTR_COLOR, pMgr ) ),
- //CHINA001 String( ResId( RID_SVXSTR_ASK_CHANGE_COLOR, pMgr ) ),
- //CHINA001 &aWarningBoxImage );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX,
- String( ResId( RID_SVXSTR_COLOR, rMgr ) ),
- String( ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ) ),
- &aWarningBoxImage );
- DBG_ASSERT(aMessDlg, "Dialogdiet fail!");//CHINA001
- aMessDlg->SetButtonText( MESS_BTN_1, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
- String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
- String( ResId( RID_SVXSTR_ADD, rMgr ) ) );
-
- short nRet = aMessDlg->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
-
- switch( nRet )
- {
- case RET_BTN_1: // Aendern
- {
- ClickModifyHdl_Impl( this );
- aColor = pColorTab->GetColor( nPos )->GetColor();
- }
- break;
-
- case RET_BTN_2: // Hinzufuegen
- {
- ClickAddHdl_Impl( this );
- nPos = aLbColor.GetSelectEntryPos();
- aColor = pColorTab->GetColor( nPos )->GetColor();
- }
- break;
-
- case RET_CANCEL:
- // return( -1L ); <-- wuerde die Seite nicht verlassen
- break;
- // return( TRUE ); // Abbruch
- }
- delete aMessDlg; //add by CHINA001
- }
- }
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- nPos = aLbColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- *pPos = nPos;
- }
- }
- return( 0L );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxColorTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if( ( *pDlgType != 0 ) ||
- ( *pPageType == PT_COLOR && *pbAreaTP == FALSE ) )
- {
- String aString;
- Color aColor;
-
- // CheckChanges_Impl(); <-- doppelte Abfrage ?
-
- USHORT nPos = aLbColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aColor = pColorTab->GetColor( nPos )->GetColor();
- aString = aLbColor.GetSelectEntry();
- }
- else
- {
- aColor.SetColor (aAktuellColor.GetColor());
- if (eCM != CM_RGB)
- ConvertColorValues (aColor, CM_RGB);
- }
- rSet.Put( XFillColorItem( aString, aColor ) );
- rSet.Put( XFillStyleItem( XFILL_SOLID ) );
- }
-
- return( TRUE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxColorTabPage::Reset( const SfxItemSet& rSet )
-{
- USHORT nState = rSet.GetItemState( XATTR_FILLCOLOR );
-
- if ( nState >= SFX_ITEM_DEFAULT )
- {
- XFillColorItem aColorItem( (const XFillColorItem&)rSet.Get( XATTR_FILLCOLOR ) );
- aLbColor.SelectEntry( aColorItem.GetColorValue() );
- aValSetColorTable.SelectItem( aLbColor.GetSelectEntryPos() + 1 );
- aEdtName.SetText( aLbColor.GetSelectEntry() );
- }
-
- // Farbmodell setzen
- String aStr = GetUserData();
- aLbColorModel.SelectEntryPos( (USHORT) aStr.ToInt32() );
-
- ChangeColorHdl_Impl( this );
- SelectColorModelHdl_Impl( this );
-
- aCtlPreviewOld.Invalidate();
-
- // Status der Buttons ermitteln
- if( pColorTab->Count() )
- {
- aBtnModify.Enable();
- aBtnWorkOn.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnWorkOn.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxColorTabPage::Create( Window* pWindow,
- const SfxItemSet& rOutAttrs )
-{
- return( new SvxColorTabPage( pWindow, rOutAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-//
-// Wird aufgerufen, wenn Inhalt der MtrFileds f�r Farbwerte ver�ndert wird
-//
-IMPL_LINK( SvxColorTabPage, ModifiedHdl_Impl, void *, EMPTYARG )
-{
- // lese aktuelle MtrFields aus, wenn cmyk, dann k-Wert als Trans.-Farbe
- aAktuellColor.SetColor ( Color( (UINT8)PercentToColor_Impl( (USHORT) aMtrFldColorModel4.GetValue() ),
- (UINT8)PercentToColor_Impl( (USHORT) aMtrFldColorModel1.GetValue() ),
- (UINT8)PercentToColor_Impl( (USHORT) aMtrFldColorModel2.GetValue() ),
- (UINT8)PercentToColor_Impl( (USHORT) aMtrFldColorModel3.GetValue() ) ).GetColor() );
-
- Color aTmpColor(aAktuellColor);
- if (eCM != CM_RGB)
- ConvertColorValues (aTmpColor, CM_RGB);
-
- rXFSet.Put( XFillColorItem( String(), aTmpColor ) );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreviewNew.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-//
-// Button 'Hinzuf�gen'
-//
-IMPL_LINK( SvxColorTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-{
- Window *pWindow = this;
- bool bEnabled;
- while( pWindow )
- {
- bEnabled = pWindow->IsEnabled();
- pWindow = pWindow->GetParent();
- }
-
- ResMgr& rMgr = DIALOG_MGR();
- String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) );
- String aName( aEdtName.GetText() );
- XColorEntry* pEntry;
- long nCount = pColorTab->Count();
- BOOL bDifferent = TRUE;
-
- // Pruefen, ob Name schon vorhanden ist
- for ( long i = 0; i < nCount && bDifferent; i++ )
- if ( aName == pColorTab->GetColor( i )->GetName() )
- bDifferent = FALSE;
-
- // Wenn ja, wird wiederholt ein neuer Name angefordert
- if ( !bDifferent )
- {
- WarningBox aWarningBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aWarningBox.Execute();
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- BOOL bLoop = TRUE;
-
- while ( !bDifferent && bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pColorTab->GetColor( i )->GetName() )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- bLoop = FALSE;
- else
- aWarningBox.Execute();
- }
- delete( pDlg );
- }
-
- // Wenn nicht vorhanden, wird Eintrag aufgenommen
- if( bDifferent )
- {
- if (eCM != CM_RGB)
- ConvertColorValues (aAktuellColor, CM_RGB);
- pEntry = new XColorEntry( aAktuellColor, aName );
-
- pColorTab->Insert( pColorTab->Count(), pEntry );
-
- aLbColor.Append( pEntry );
- aValSetColorTable.InsertItem( aValSetColorTable.GetItemCount() + 1,
- pEntry->GetColor(), pEntry->GetName() );
-
- aLbColor.SelectEntryPos( aLbColor.GetEntryCount() - 1 );
-
- // Flag fuer modifiziert setzen
- *pnColorTableState |= CT_MODIFIED;
-
- SelectColorLBHdl_Impl( this );
- }
- // Status der Buttons ermitteln
- if( pColorTab->Count() )
- {
- aBtnModify.Enable();
- aBtnWorkOn.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-//
-// Button '�ndern'
-//
-IMPL_LINK( SvxColorTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbColor.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- ResMgr& rMgr = DIALOG_MGR();
- String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) );
- String aName( aEdtName.GetText() );
- long nCount = pColorTab->Count();
- BOOL bDifferent = TRUE;
-
- // Pruefen, ob Name schon vorhanden ist
- for ( long i = 0; i < nCount && bDifferent; i++ )
- if ( aName == pColorTab->GetColor( i )->GetName() && nPos != i )
- bDifferent = FALSE;
-
- // Wenn ja, wird wiederholt ein neuer Name angefordert
- if ( !bDifferent )
- {
- WarningBox aWarningBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aWarningBox.Execute();
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- BOOL bLoop = TRUE;
-
- while ( !bDifferent && bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for ( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pColorTab->GetColor( i )->GetName() && nPos != i )
- bDifferent = FALSE;
-
- if( bDifferent )
- bLoop = FALSE;
- else
- aWarningBox.Execute();
- }
- delete( pDlg );
- }
-
- // Wenn nicht vorhanden, wird Eintrag aufgenommen
- if( bDifferent )
- {
- XColorEntry* pEntry = pColorTab->GetColor( nPos );
-
- Color aTmpColor (aAktuellColor);
- if (eCM != CM_RGB)
- ConvertColorValues (aTmpColor, CM_RGB);
-
- pEntry->SetColor( aTmpColor );
- pEntry->SetName( aName );
-
- aLbColor.Modify( pEntry, nPos );
- aLbColor.SelectEntryPos( nPos );
- /////
- aValSetColorTable.SetItemColor( nPos + 1, pEntry->GetColor() );
- aValSetColorTable.SetItemText( nPos + 1, pEntry->GetName() );
- aEdtName.SetText( aName );
-
- aCtlPreviewOld.Invalidate();
-
- // Flag fuer modifiziert setzen
- *pnColorTableState |= CT_MODIFIED;
- }
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-//
-// Button 'Bearbeiten'
-//
-IMPL_LINK( SvxColorTabPage, ClickWorkOnHdl_Impl, void *, EMPTYARG )
-{
- SvColorDialog* pColorDlg = new SvColorDialog( DLGWIN );
-
- Color aTmpColor (aAktuellColor);
- if (eCM != CM_RGB)
- ConvertColorValues (aTmpColor, CM_RGB);
-
- pColorDlg->SetColor (aTmpColor);
-
- if( pColorDlg->Execute() == RET_OK )
- {
- USHORT nK = 0;
- Color aPreviewColor = pColorDlg->GetColor();
- aAktuellColor = aPreviewColor;
- if (eCM != CM_RGB)
- ConvertColorValues (aAktuellColor, eCM);
-
- aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) );
- aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) );
- aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) );
- aMtrFldColorModel4.SetValue( ColorToPercent_Impl( nK ) );
-
- // ItemSet fuellen und an XOut weiterleiten
- rXFSet.Put( XFillColorItem( String(), aPreviewColor ) );
- //aCtlPreviewOld.SetAttributes( aXFillAttr );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreviewNew.Invalidate();
- }
- delete( pColorDlg );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-//
-// Button 'Loeschen'
-//
-IMPL_LINK( SvxColorTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbColor.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
- String( SVX_RES( RID_SVXSTR_ASK_DEL_COLOR ) ) );
-
- if( aQueryBox.Execute() == RET_YES )
- {
- // Jetzt wird richtig geloescht
- ULONG nCount = pColorTab->Count() - 1;
- XColorEntry* pEntry;
-
- pEntry = pColorTab->Remove( nPos );
- DBG_ASSERT( pEntry, "ColorEntry nicht vorhanden (1) !" );
- delete pEntry;
-
- for( ULONG i = nPos; i < nCount; i++ )
- {
- pEntry = pColorTab->Remove( i + 1 );
- DBG_ASSERT( pEntry, "ColorEntry nicht vorhanden (2) !" );
- pColorTab->Insert( i, pEntry );
- }
-
- // Listbox und ValueSet aktualisieren
- aLbColor.RemoveEntry( nPos );
- aValSetColorTable.Clear();
- FillValueSet_Impl( aValSetColorTable );
-
- // Positionieren
- aLbColor.SelectEntryPos( nPos );
- SelectColorLBHdl_Impl( this );
-
- aCtlPreviewOld.Invalidate();
-
- // Flag fuer modifiziert setzen
- *pnColorTableState |= CT_MODIFIED;
- }
- }
- // Status der Buttons ermitteln
- if( !pColorTab->Count() )
- {
- aBtnModify.Disable();
- aBtnWorkOn.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return( 0L );
-}
-
-// -----------------------------------------------------------------------
-
-//
-// Button 'Farbtabelle laden'
-//
-IMPL_LINK( SvxColorTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- USHORT nReturn = RET_YES;
-
- if( *pnColorTableState & CT_MODIFIED )
- {
- nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
- String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
-
- if ( nReturn == RET_YES )
- pColorTab->Save();
- }
-
- if ( nReturn != RET_CANCEL )
- {
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soc" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- // Tabelle speichern
- XColorTable* pColTab = new XColorTable( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pColTab->SetName( aURL.getName() ); // XXX
- if( pColTab->Load() )
- {
- if( pColTab )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- const XColorTable *pTempTable = 0;
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN );
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN );
- if( pArea )
- {
- pTempTable = pArea->GetColorTable();
- }
- else if( pLine )
- {
- pTempTable = pLine->GetColorTable();
- }
-
- if( pColorTab != pTempTable )
- {
- if( bDeleteColorTable )
- delete pColorTab;
- else
- bDeleteColorTable = TRUE;
- }
-
- pColorTab = pColTab;
- if( pArea )
- {
- pArea->SetNewColorTable( pColorTab );
- }
- else if( pLine )
- {
- pLine->SetNewColorTable( pColorTab );
- }
-
- aLbColor.Clear();
- aValSetColorTable.Clear();
- Construct();
- Reset( rOutAttrs );
-
- pColorTab->SetName( aURL.getName() );
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- aTableNameFT.SetText( aString );
-
- // Flag fuer gewechselt setzen
- *pnColorTableState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnColorTableState &= ~CT_MODIFIED;
-
- if( aLbColor.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
- aLbColor.SelectEntryPos( 0 );
- else
- aLbColor.SelectEntryPos( aLbColor.GetSelectEntryPos() );
-
- ChangeColorHdl_Impl( this );
- SelectColorLBHdl_Impl( this );
- }
- }
- else
- {
- //aIStream.Close();
- ErrorBox aErrorBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) );
- aErrorBox.Execute();
- }
- }
- }
-
- // Status der Buttons ermitteln
- if ( pColorTab->Count() )
- {
- aBtnModify.Enable();
- aBtnWorkOn.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnWorkOn.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return( 0L );
-}
-
-// -----------------------------------------------------------------------
-
-//
-// Button 'Farbtabelle speichern'
-//
-IMPL_LINK( SvxColorTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
-{
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soc" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
-
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( pColorTab->GetName().Len() )
- {
- aFile.Append( pColorTab->GetName() );
-
- if( !aFile.getExtension().getLength() )
- aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soc" ) ) );
- }
-
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- pColorTab->SetName( aURL.getName() );
- pColorTab->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( pColorTab->Save() )
- {
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
- aTableNameFT.SetText( aString );
-
- // Flag fuer gespeichert setzen
- *pnColorTableState |= CT_SAVED;
- // Flag fuer modifiziert entfernen
- *pnColorTableState &= ~CT_MODIFIED;
- }
- else
- {
- ErrorBox aErrorBox( DLGWIN, WinBits( WB_OK ),
- String( SVX_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) );
- aErrorBox.Execute();
- }
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxColorTabPage, SelectColorLBHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aValSetColorTable.SelectItem( nPos + 1 );
- aEdtName.SetText( aLbColor.GetSelectEntry() );
-
- rXFSet.Put( XFillColorItem( String(),
- aLbColor.GetSelectEntryColor() ) );
- aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreviewOld.Invalidate();
- aCtlPreviewNew.Invalidate();
-
- ChangeColorHdl_Impl( this );
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxColorTabPage, SelectValSetHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aValSetColorTable.GetSelectItemId();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbColor.SelectEntryPos( nPos - 1 );
- aEdtName.SetText( aLbColor.GetSelectEntry() );
-
- rXFSet.Put( XFillColorItem( String(),
- aLbColor.GetSelectEntryColor() ) );
- aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreviewOld.Invalidate();
- aCtlPreviewNew.Invalidate();
-
- ChangeColorHdl_Impl( this );
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-//
-// Farbwerte je nach �bergebenes Farbmodell umrechnen
-//
-void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
-{
- switch (eModell)
- {
- case CM_RGB:
- {
- CmykToRgb_Impl (rColor, (USHORT)rColor.GetTransparency() );
- rColor.SetTransparency ((UINT8) 0);
- }
- break;
-
- case CM_CMYK:
- {
- USHORT nK;
- RgbToCmyk_Impl (rColor, nK );
- rColor.SetTransparency ((UINT8) nK);
- }
- break;
- }
-}
-
-//
-// Auswahl Listbox 'Farbmodell' (RGB/CMY)
-//
-IMPL_LINK( SvxColorTabPage, SelectColorModelHdl_Impl, void *, EMPTYARG )
-{
- int nPos = aLbColorModel.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- if (eCM != (ColorModel) nPos)
- {
- // wenn Farbmodell geaendert wurde, dann Werte umrechnen
- ConvertColorValues (aAktuellColor, (ColorModel) nPos);
- }
-
- eCM = (ColorModel) nPos;
-
- switch( eCM )
- {
- case CM_RGB:
- {
- String aStr( aLbColorModel.GetSelectEntry() );
- String aColorStr( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "~X" ) ) );
- xub_StrLen nIdx = 1;
- aColorStr.SetChar( nIdx, aStr.GetChar( 0 ) );
- aFtColorModel1.SetText( aColorStr );
- aColorStr.SetChar( nIdx, aStr.GetChar( 1 ) );
- aFtColorModel2.SetText( aColorStr );
- aColorStr.SetChar( nIdx, aStr.GetChar( 2 ) );
- aFtColorModel3.SetText( aColorStr );
-
- aFtColorModel4.Hide();
- aMtrFldColorModel4.Hide();
- aMtrFldColorModel4.SetValue( 0L );
-
- aMtrFldColorModel1.SetHelpId( HID_TPCOLOR_RGB_1 );
- aMtrFldColorModel2.SetHelpId( HID_TPCOLOR_RGB_2 );
- aMtrFldColorModel3.SetHelpId( HID_TPCOLOR_RGB_3 );
-
- // Da der alte HelpText noch am Control steht wuerde
- // ein Umsetzen der HelpID alleine nichts bewirken
- aMtrFldColorModel1.SetHelpText( String() );
- aMtrFldColorModel2.SetHelpText( String() );
- aMtrFldColorModel3.SetHelpText( String() );
-
- // RGB-Werte im Bereich 0..255 verarbeiten (nicht in %),
- // dazu MetricField's entsprechend einstellen
- aMtrFldColorModel1.SetUnit(FUNIT_NONE);
- aMtrFldColorModel1.SetMin(0);
- aMtrFldColorModel1.SetMax(255);
- aMtrFldColorModel1.SetLast(255);
-
- aMtrFldColorModel2.SetUnit(FUNIT_NONE);
- aMtrFldColorModel2.SetMin(0);
- aMtrFldColorModel2.SetMax(255);
- aMtrFldColorModel2.SetLast(255);
-
- aMtrFldColorModel3.SetUnit(FUNIT_NONE);
- aMtrFldColorModel3.SetMin(0);
- aMtrFldColorModel3.SetMax(255);
- aMtrFldColorModel3.SetLast(255);
- }
- break;
-
- case CM_CMYK:
- {
- String aStr( aLbColorModel.GetSelectEntry() );
- String aColorStr( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "~X" ) ) );
- xub_StrLen nIdx = 1;
- aColorStr.SetChar( nIdx, aStr.GetChar( 0 ) );
- aFtColorModel1.SetText( aColorStr );
- aColorStr.SetChar( nIdx, aStr.GetChar( 1 ) );
- aFtColorModel2.SetText( aColorStr );
- aColorStr.SetChar( nIdx,aStr.GetChar( 2 ) );
- aFtColorModel3.SetText( aColorStr );
- aColorStr.SetChar( nIdx,aStr.GetChar( 3 ) );
- aFtColorModel4.SetText( aColorStr );
-
- aFtColorModel4.Show();
- aMtrFldColorModel4.Show();
-
- aMtrFldColorModel1.SetHelpId( HID_TPCOLOR_CMYK_1 );
- aMtrFldColorModel2.SetHelpId( HID_TPCOLOR_CMYK_2 );
- aMtrFldColorModel3.SetHelpId( HID_TPCOLOR_CMYK_3 );
-
- // s.o.
- aMtrFldColorModel1.SetHelpText( String() );
- aMtrFldColorModel2.SetHelpText( String() );
- aMtrFldColorModel3.SetHelpText( String() );
-
- // CMYK-Werte im Bereich 0..100% verarbeiten,
- // dazu MetricField's entsprechend einstellen
- String aStrUnit( RTL_CONSTASCII_USTRINGPARAM( " %" ) );
-
- aMtrFldColorModel1.SetUnit(FUNIT_CUSTOM);
- aMtrFldColorModel1.SetCustomUnitText( aStrUnit );
- aMtrFldColorModel1.SetMin(0);
- aMtrFldColorModel1.SetMax(100);
- aMtrFldColorModel1.SetLast(100);
-
- aMtrFldColorModel2.SetUnit(FUNIT_CUSTOM);
- aMtrFldColorModel2.SetCustomUnitText( aStrUnit );
- aMtrFldColorModel2.SetMin(0);
- aMtrFldColorModel2.SetMax(100);
- aMtrFldColorModel2.SetLast(100);
-
- aMtrFldColorModel3.SetUnit(FUNIT_CUSTOM);
- aMtrFldColorModel3.SetCustomUnitText( aStrUnit );
- aMtrFldColorModel3.SetMin(0);
- aMtrFldColorModel3.SetMax(100);
- aMtrFldColorModel3.SetLast(100);
- }
- break;
- }
-
- aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) );
- aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) );
- aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) );
- aMtrFldColorModel4.SetValue( ColorToPercent_Impl( aAktuellColor.GetTransparency() ) );
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-long SvxColorTabPage::ChangeColorHdl_Impl( void* )
-{
- int nPos = aLbColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- XColorEntry* pEntry = pColorTab->GetColor( nPos );
-
- aAktuellColor.SetColor ( pEntry->GetColor().GetColor() );
- if (eCM != CM_RGB)
- ConvertColorValues (aAktuellColor, eCM);
-
- aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) );
- aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) );
- aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) );
- aMtrFldColorModel4.SetValue( ColorToPercent_Impl( aAktuellColor.GetTransparency() ) );
-
- // ItemSet fuellen und an XOut weiterleiten
- rXFSet.Put( XFillColorItem( String(), pEntry->GetColor() ) );
- aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreviewNew.Invalidate();
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxColorTabPage::FillValueSet_Impl( ValueSet& rVs )
-{
- long nCount = pColorTab->Count();
- XColorEntry* pColorEntry;
-
- for( long i = 0; i < nCount; i++ )
- {
- pColorEntry = pColorTab->GetColor( i );
- rVs.InsertItem( (USHORT) i + 1, pColorEntry->GetColor(), pColorEntry->GetName() );
- }
-}
-
-//------------------------------------------------------------------------
-
-// Ein RGB-Wert wird in einen CMYK-Wert konvertiert, wobei die Color-
-// Klasse vergewaltigt wird, da R in C, G in M und B in Y umgewandelt
-// wird. Der Wert K wird in einer Extra-Variablen gehalten.
-// Bei weiteren Farbmodellen sollte man hierfuer eigene Klassen entwickeln,
-// die dann auch entsprechende Casts enthalten.
-
-void SvxColorTabPage::RgbToCmyk_Impl( Color& rColor, USHORT& rK )
-{
- USHORT nColor1, nColor2, nColor3;
- USHORT nProzent; // nur temporaer !!!
-
- nColor1 = 255 - rColor.GetRed();
- nProzent = ColorToPercent_Impl( nColor1 );
-
- nColor2 = 255 - rColor.GetGreen();
- nProzent = ColorToPercent_Impl( nColor2 );
-
- nColor3 = 255 - rColor.GetBlue();
- nProzent = ColorToPercent_Impl( nColor3 );
-
- rK = Min( Min( nColor1, nColor2 ), nColor3 );
-
- rColor.SetRed( sal::static_int_cast< UINT8 >( nColor1 - rK ) );
- rColor.SetGreen( sal::static_int_cast< UINT8 >( nColor2 - rK ) );
- rColor.SetBlue( sal::static_int_cast< UINT8 >( nColor3 - rK ) );
-}
-
-//------------------------------------------------------------------------
-
-// Umgekehrter Fall zu RgbToCmyk_Impl (s.o.)
-
-void SvxColorTabPage::CmykToRgb_Impl( Color& rColor, const USHORT nK )
-{
- long lTemp;
-
- lTemp = 255 - ( rColor.GetRed() + nK );
-
- if( lTemp < 0L )
- lTemp = 0L;
- rColor.SetRed( (BYTE)lTemp );
-
- lTemp = 255 - ( rColor.GetGreen() + nK );
-
- if( lTemp < 0L )
- lTemp = 0L;
- rColor.SetGreen( (BYTE)lTemp );
-
- lTemp = 255 - ( rColor.GetBlue() + nK );
-
- if( lTemp < 0L )
- lTemp = 0L;
- rColor.SetBlue( (BYTE)lTemp );
-}
-
-//------------------------------------------------------------------------
-
-USHORT SvxColorTabPage::ColorToPercent_Impl( USHORT nColor )
-{
- USHORT nWert = 0;
-
- switch (eCM)
- {
- case CM_RGB :
- nWert = nColor;
- break;
-
- case CM_CMYK:
- nWert = (USHORT) ( (double) nColor * 100.0 / 255.0 + 0.5 );
- break;
- }
-
- return ( nWert );
-}
-
-//------------------------------------------------------------------------
-
-USHORT SvxColorTabPage::PercentToColor_Impl( USHORT nPercent )
-{
- USHORT nWert = 0;
-
- switch (eCM)
- {
- case CM_RGB :
- nWert = nPercent;
- break;
-
- case CM_CMYK:
- nWert = (USHORT) ( (double) nPercent * 255.0 / 100.0 + 0.5 );
- break;
- }
-
- return ( nWert );
-}
-
-//------------------------------------------------------------------------
-
-void SvxColorTabPage::FillUserData()
-{
- // Das Farbmodell wird in der Ini-Datei festgehalten
- SetUserData( UniString::CreateFromInt32( eCM ) );
-}
-
-
diff --git a/svx/source/cui/tpgradnt.cxx b/svx/source/cui/tpgradnt.cxx
deleted file mode 100644
index 99f8b357b8..0000000000
--- a/svx/source/cui/tpgradnt.cxx
+++ /dev/null
@@ -1,948 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tpgradnt.cxx,v $
- * $Revision: 1.26 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <vcl/wrkwin.hxx>
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-#define _SVX_TPGRADNT_CXX
-
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#include "xattr.hxx"
-#include <svx/xtable.hxx>
-#include <svx/xpool.hxx>
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include "tabarea.hrc"
-#include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
-#include "dlgname.hrc"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialmgr.hxx>
-
-#define DLGWIN this->GetParent()->GetParent()
-
-#define BITMAP_WIDTH 32
-#define BITMAP_HEIGHT 12
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern und Definieren der Farbverlaeufe
-|*
-\************************************************************************/
-
-SvxGradientTabPage::SvxGradientTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
- SfxTabPage ( pParent, SVX_RES( RID_SVXPAGE_GRADIENT ), rInAttrs ),
-
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aFtType ( this, SVX_RES( FT_TYPE ) ),
- aLbGradientType ( this, SVX_RES( LB_GRADIENT_TYPES ) ),
- aFtCenterX ( this, SVX_RES( FT_CENTER_X ) ),
- aMtrCenterX ( this, SVX_RES( MTR_CENTER_X ) ),
- aFtCenterY ( this, SVX_RES( FT_CENTER_Y ) ),
- aMtrCenterY ( this, SVX_RES( MTR_CENTER_Y ) ),
- aFtAngle ( this, SVX_RES( FT_ANGLE ) ),
- aMtrAngle ( this, SVX_RES( MTR_ANGLE ) ),
- aFtBorder ( this, SVX_RES( FT_BORDER ) ),
- aMtrBorder ( this, SVX_RES( MTR_BORDER ) ),
- aFtColorFrom ( this, SVX_RES( FT_COLOR_FROM ) ),
- aLbColorFrom ( this, SVX_RES( LB_COLOR_FROM ) ),
- aMtrColorFrom ( this, SVX_RES( MTR_COLOR_FROM ) ),
- aFtColorTo ( this, SVX_RES( FT_COLOR_TO ) ),
- aLbColorTo ( this, SVX_RES( LB_COLOR_TO ) ),
- aMtrColorTo ( this, SVX_RES( MTR_COLOR_TO ) ),
- aLbGradients ( this, SVX_RES( LB_GRADIENTS ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- aBtnAdd ( this, SVX_RES( BTN_ADD ) ),
- aBtnModify ( this, SVX_RES( BTN_MODIFY ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aBtnLoad ( this, SVX_RES( BTN_LOAD ) ),
- aBtnSave ( this, SVX_RES( BTN_SAVE ) ),
-
- rOutAttrs ( rInAttrs ),
-
- pColorTab( NULL ),
- pGradientList( NULL ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFStyleItem ( XFILL_GRADIENT ),
- aXGradientItem ( String(), XGradient( COL_BLACK, COL_WHITE ) ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() )
-{
- aBtnLoad.SetModeImage( Image( SVX_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnSave.SetModeImage( Image( SVX_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
-
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Solange NICHT vom Item unterstuetzt
-
- //aMtrColorTo.Disable();
- aMtrColorTo.SetValue( 100 );
- //aMtrColorFrom.Disable();
- aMtrColorFrom.SetValue( 100 );
-
- // Setzen des Output-Devices
- rXFSet.Put( aXFStyleItem );
- rXFSet.Put( aXGradientItem );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- // Handler ueberladen
- aLbGradients.SetSelectHdl(
- LINK( this, SvxGradientTabPage, ChangeGradientHdl_Impl ) );
- aBtnAdd.SetClickHdl( LINK( this, SvxGradientTabPage, ClickAddHdl_Impl ) );
- aBtnModify.SetClickHdl(
- LINK( this, SvxGradientTabPage, ClickModifyHdl_Impl ) );
- aBtnDelete.SetClickHdl(
- LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) );
-
- Link aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl );
- aLbGradientType.SetSelectHdl( aLink );
- aMtrCenterX.SetModifyHdl( aLink );
- aMtrCenterY.SetModifyHdl( aLink );
- aMtrAngle.SetModifyHdl( aLink );
- aMtrBorder.SetModifyHdl( aLink );
- aMtrColorFrom.SetModifyHdl( aLink );
- aLbColorFrom.SetSelectHdl( aLink );
- aMtrColorTo.SetModifyHdl( aLink );
- aLbColorTo.SetSelectHdl( aLink );
-
- aBtnLoad.SetClickHdl(
- LINK( this, SvxGradientTabPage, ClickLoadHdl_Impl ) );
- aBtnSave.SetClickHdl(
- LINK( this, SvxGradientTabPage, ClickSaveHdl_Impl ) );
-
- // #i76307# always paint the preview in LTR, because this is what the document does
- aCtlPreview.EnableRTL( FALSE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxGradientTabPage::Construct()
-{
- // Farbtabelle
- aLbColorFrom.Fill( pColorTab );
- aLbColorTo.CopyEntries( aLbColorFrom );
-
- // Farbverlauftabelle
- aLbGradients.Fill( pGradientList );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
-{
- USHORT nPos;
- USHORT nCount;
-
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- *pbAreaTP = FALSE;
-
- if( pColorTab )
- {
- // ColorTable
- if( *pnColorTableState & CT_CHANGED ||
- *pnColorTableState & CT_MODIFIED )
- {
- if( *pnColorTableState & CT_CHANGED )
- pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable();
-
- // LbColorFrom
- nPos = aLbColorFrom.GetSelectEntryPos();
- aLbColorFrom.Clear();
- aLbColorFrom.Fill( pColorTab );
- nCount = aLbColorFrom.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbColorFrom.SelectEntryPos( 0 );
- else
- aLbColorFrom.SelectEntryPos( nPos );
-
- // LbColorTo
- nPos = aLbColorTo.GetSelectEntryPos();
- aLbColorTo.Clear();
- aLbColorTo.CopyEntries( aLbColorFrom );
- nCount = aLbColorTo.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbColorTo.SelectEntryPos( 0 );
- else
- aLbColorTo.SelectEntryPos( nPos );
-
- ModifiedHdl_Impl( this );
- }
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pGradientList->GetPath() );
-
- aURL.Append( pGradientList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- if ( *pPageType == PT_GRADIENT && *pPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbGradients.SelectEntryPos( *pPos );
- }
- // Farben koennten geloescht worden sein
- ChangeGradientHdl_Impl( this );
-
- *pPageType = PT_GRADIENT;
- *pPos = LISTBOX_ENTRY_NOTFOUND;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxGradientTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( CheckChanges_Impl() == -1L )
- return KEEP_PAGE;
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-long SvxGradientTabPage::CheckChanges_Impl()
-{
- // wird hier benutzt, um Aenderungen NICHT zu verlieren
- XGradient aTmpGradient( aLbColorFrom.GetSelectEntryColor(),
- aLbColorTo.GetSelectEntryColor(),
- (XGradientStyle) aLbGradientType.GetSelectEntryPos(),
- static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden
- (USHORT) aMtrCenterX.GetValue(),
- (USHORT) aMtrCenterY.GetValue(),
- (USHORT) aMtrBorder.GetValue(),
- (USHORT) aMtrColorFrom.GetValue(),
- (USHORT) aMtrColorTo.GetValue() );
-
- USHORT nPos = aLbGradients.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- XGradient aGradient = pGradientList->GetGradient( nPos )->GetGradient();
- String aString = aLbGradients.GetSelectEntry();
-
- if( !( aTmpGradient == aGradient ) )
- {
- ResMgr& rMgr = DIALOG_MGR();
- Image aWarningBoxImage = WarningBox::GetStandardImage();
- //CHINA001 SvxMessDialog aMessDlg( DLGWIN,
- //CHINA001 String( ResId( RID_SVXSTR_GRADIENT, rMgr ) ),
- //CHINA001 String( ResId( RID_SVXSTR_ASK_CHANGE_GRADIENT, rMgr ) ),
- //CHINA001 &aWarningBoxImage );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX,
- String( ResId( RID_SVXSTR_GRADIENT, rMgr ) ),
- String( ResId( RID_SVXSTR_ASK_CHANGE_GRADIENT, rMgr ) ),
- &aWarningBoxImage );
- DBG_ASSERT(aMessDlg, "Dialogdiet fail!");//CHINA001
- aMessDlg->SetButtonText( MESS_BTN_1, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
- String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
- String( ResId( RID_SVXSTR_ADD, rMgr ) ) );
-
- short nRet = aMessDlg->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
-
- switch( nRet )
- {
- case RET_BTN_1: // Aendern
- {
- ClickModifyHdl_Impl( this );
- aGradient = pGradientList->GetGradient( nPos )->GetGradient();
- }
- break;
-
- case RET_BTN_2: // Hinzufuegen
- {
- ClickAddHdl_Impl( this );
- nPos = aLbGradients.GetSelectEntryPos();
- aGradient = pGradientList->GetGradient( nPos )->GetGradient();
- }
- break;
-
- case RET_CANCEL:
- // return( -1L ); <-- wuerde die Seite nicht verlassen
- break;
- // return( TRUE ); // Abbruch
- }
- delete aMessDlg; //add by CHINA001
- }
- }
- nPos = aLbGradients.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- *pPos = nPos;
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxGradientTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if( *pDlgType == 0 && *pPageType == PT_GRADIENT && *pbAreaTP == FALSE )
- {
- // CheckChanges(); <-- doppelte Abfrage ?
-
- XGradient* pXGradient = NULL;
- String aString;
- USHORT nPos = aLbGradients.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- pXGradient = new XGradient( pGradientList->GetGradient( nPos )->GetGradient() );
- aString = aLbGradients.GetSelectEntry();
-
- }
- else
- // Farbverlauf wurde (unbekannt) uebergeben
- {
- pXGradient = new XGradient( aLbColorFrom.GetSelectEntryColor(),
- aLbColorTo.GetSelectEntryColor(),
- (XGradientStyle) aLbGradientType.GetSelectEntryPos(),
- static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden
- (USHORT) aMtrCenterX.GetValue(),
- (USHORT) aMtrCenterY.GetValue(),
- (USHORT) aMtrBorder.GetValue(),
- (USHORT) aMtrColorFrom.GetValue(),
- (USHORT) aMtrColorTo.GetValue() );
- }
- DBG_ASSERT( pXGradient, "XGradient konnte nicht erzeugt werden" );
- rSet.Put( XFillStyleItem( XFILL_GRADIENT ) );
- rSet.Put( XFillGradientItem( aString, *pXGradient ) );
-
- delete pXGradient;
- }
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxGradientTabPage::Reset( const SfxItemSet& )
-{
- // aLbGradients.SelectEntryPos( 0 );
- ChangeGradientHdl_Impl( this );
-
- // Status der Buttons ermitteln
- if( pGradientList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxGradientTabPage::Create( Window* pWindow,
- const SfxItemSet& rOutAttrs )
-{
- return new SvxGradientTabPage( pWindow, rOutAttrs );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl )
-{
- XGradientStyle eXGS = (XGradientStyle) aLbGradientType.GetSelectEntryPos();
-
- XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(),
- aLbColorTo.GetSelectEntryColor(),
- eXGS,
- static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden
- (USHORT) aMtrCenterX.GetValue(),
- (USHORT) aMtrCenterY.GetValue(),
- (USHORT) aMtrBorder.GetValue(),
- (USHORT) aMtrColorFrom.GetValue(),
- (USHORT) aMtrColorTo.GetValue() );
-
- // Enablen/Disablen von Controls
- if( pControl == &aLbGradientType || pControl == this )
- SetControlState_Impl( eXGS );
-
- // Anzeigen im XOutDev
- rXFSet.Put( XFillGradientItem( String(), aXGradient ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreview.Invalidate();
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_GRADIENT, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_GRADIENT, rMgr ) );
- String aName;
-
- long nCount = pGradientList->Count();
- long j = 1;
- BOOL bDifferent = FALSE;
-
- while( !bDifferent )
- {
- aName = aNewName;
- aName += sal_Unicode(' ');
- aName += UniString::CreateFromInt32( j++ );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pGradientList->GetGradient( i )->GetName() )
- bDifferent = FALSE;
- }
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- WarningBox* pWarnBox = NULL;
- USHORT nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
-
- while( pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
-
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pGradientList->GetGradient( i )->GetName() )
- bDifferent = FALSE;
-
- if( bDifferent )
- {
- nError = 0;
- break;
- }
-
- if( !pWarnBox )
- {
- pWarnBox = new WarningBox( DLGWIN,
- WinBits( WB_OK_CANCEL ),
- String( ResId( nError, rMgr ) ) );
- pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
- }
-
- if( pWarnBox->Execute() != RET_OK )
- break;
- }
- //Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
- delete pDlg;
- delete pWarnBox;
-
- if( !nError )
- {
- XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(),
- aLbColorTo.GetSelectEntryColor(),
- (XGradientStyle) aLbGradientType.GetSelectEntryPos(),
- static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden
- (USHORT) aMtrCenterX.GetValue(),
- (USHORT) aMtrCenterY.GetValue(),
- (USHORT) aMtrBorder.GetValue(),
- (USHORT) aMtrColorFrom.GetValue(),
- (USHORT) aMtrColorTo.GetValue() );
- XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName );
-
- pGradientList->Insert( pEntry, nCount );
-
- aLbGradients.Append( pEntry );
-
- aLbGradients.SelectEntryPos( aLbGradients.GetEntryCount() - 1 );
-
-#ifdef WNT
- // hack: #31355# W.P.
- Rectangle aRect( aLbGradients.GetPosPixel(), aLbGradients.GetSizePixel() );
- if( TRUE ) { // ??? overlapped with pDlg
- // and srolling
- Invalidate( aRect );
- //aLbGradients.Invalidate();
- }
-#endif
-
- // Flag fuer modifiziert setzen
- *pnGradientListState |= CT_MODIFIED;
-
- ChangeGradientHdl_Impl( this );
- }
-
- // Status der Buttons ermitteln
- if( pGradientList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbGradients.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_GRADIENT, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_GRADIENT, rMgr ) );
- String aName( pGradientList->GetGradient( nPos )->GetName() );
- String aOldName = aName;
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
-
- long nCount = pGradientList->Count();
- BOOL bDifferent = FALSE;
- BOOL bLoop = TRUE;
-
- while( bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pGradientList->GetGradient( i )->GetName() &&
- aName != aOldName )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- {
- bLoop = FALSE;
- XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(),
- aLbColorTo.GetSelectEntryColor(),
- (XGradientStyle) aLbGradientType.GetSelectEntryPos(),
- static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden
- (USHORT) aMtrCenterX.GetValue(),
- (USHORT) aMtrCenterY.GetValue(),
- (USHORT) aMtrBorder.GetValue(),
- (USHORT) aMtrColorFrom.GetValue(),
- (USHORT) aMtrColorTo.GetValue() );
-
- XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName );
-
- delete pGradientList->Replace( pEntry, nPos );
-
- aLbGradients.Modify( pEntry, nPos );
-
- aLbGradients.SelectEntryPos( nPos );
-
- // Flag fuer modifiziert setzen
- *pnGradientListState |= CT_MODIFIED;
- }
- else
- {
- WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aBox.Execute();
- }
-
- }
- delete pDlg;
- }
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbGradients.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
-//! SVX_RES( RID_SVXSTR_DEL_GRADIENT ),
- String( SVX_RES( RID_SVXSTR_ASK_DEL_GRADIENT ) ) );
-
- if ( aQueryBox.Execute() == RET_YES )
- {
- delete pGradientList->Remove( nPos );
- aLbGradients.RemoveEntry( nPos );
- aLbGradients.SelectEntryPos( 0 );
-
- aCtlPreview.Invalidate();
-
- ChangeGradientHdl_Impl( this );
-
- // Flag fuer modifiziert setzen
- *pnGradientListState |= CT_MODIFIED;
- }
- }
- // Status der Buttons ermitteln
- if( !pGradientList->Count() )
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- USHORT nReturn = RET_YES;
-
- if ( *pnGradientListState & CT_MODIFIED )
- {
- nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
- String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
-
- if ( nReturn == RET_YES )
- pGradientList->Save();
- }
-
- if ( nReturn != RET_CANCEL )
- {
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sog" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( aDlg.Execute() == ERRCODE_NONE )
- {
- EnterWait();
-
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- // Liste speichern
- XGradientList* pGrdList = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pGrdList->SetName( aURL.getName() );
-
- if ( pGrdList->Load() )
- {
- if ( pGrdList )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if ( pGradientList !=
- ( (SvxAreaTabDialog*) DLGWIN )->GetGradientList() )
- delete pGradientList;
-
- pGradientList = pGrdList;
- ( (SvxAreaTabDialog*) DLGWIN )->
- SetNewGradientList( pGradientList );
-
- aLbGradients.Clear();
- aLbGradients.Fill( pGradientList );
- Reset( rOutAttrs );
-
- pGradientList->SetName( aURL.getName() );
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gewechselt setzen
- *pnGradientListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnGradientListState &= ~CT_MODIFIED;
- }
- LeaveWait();
- }
- else
- {
- LeaveWait();
- //aIStream.Close();
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
- }
- }
- }
-
- // Status der Buttons ermitteln
- if( pGradientList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
-{
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sog" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
-
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( pGradientList->GetName().Len() )
- {
- aFile.Append( pGradientList->GetName() );
-
- if( !aFile.getExtension().getLength() )
- aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sog" ) ) );
- }
-
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- pGradientList->SetName( aURL.getName() );
- pGradientList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( pGradientList->Save() )
- {
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gespeichert setzen
- *pnGradientListState |= CT_SAVED;
- // Flag fuer modifiziert entfernen
- *pnGradientListState &= ~CT_MODIFIED;
- }
- else
- {
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( SVX_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute();
- }
- }
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxGradientTabPage, ChangeGradientHdl_Impl, void *, EMPTYARG )
-{
- XGradient* pGradient = NULL;
- int nPos = aLbGradients.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() );
- else
- {
- const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), TRUE, &pPoolItem ) )
- {
- if( ( XFILL_GRADIENT == (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue() ) &&
- ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), TRUE, &pPoolItem ) ) )
- {
- pGradient = new XGradient( ( ( const XFillGradientItem* ) pPoolItem )->GetGradientValue() );
- }
- }
- if( !pGradient )
- {
- aLbGradients.SelectEntryPos( 0 );
- nPos = aLbGradients.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() );
- }
- }
-
- if( pGradient )
- {
- XGradientStyle eXGS = pGradient->GetGradientStyle();
-
- aLbGradientType.SelectEntryPos(
- sal::static_int_cast< USHORT >( eXGS ) );
- // Wenn der EIntrag nicht in der Listbox ist, werden die Farben
- // temporaer hinzugenommen
- aLbColorFrom.SetNoSelection();
- aLbColorFrom.SelectEntry( pGradient->GetStartColor() );
-
- if ( aLbColorFrom.GetSelectEntryCount() == 0 )
- {
- aLbColorFrom.InsertEntry( pGradient->GetStartColor(),
- String() );
- aLbColorFrom.SelectEntry( pGradient->GetStartColor() );
- }
- aLbColorTo.SetNoSelection();
- aLbColorTo.SelectEntry( pGradient->GetEndColor() );
-
- if ( aLbColorTo.GetSelectEntryCount() == 0 )
- {
- aLbColorTo.InsertEntry( pGradient->GetEndColor(), String() );
- aLbColorTo.SelectEntry( pGradient->GetEndColor() );
- }
-
- aMtrAngle.SetValue( pGradient->GetAngle() / 10 ); // sollte in Resource geaendert werden
- aMtrBorder.SetValue( pGradient->GetBorder() );
- aMtrCenterX.SetValue( pGradient->GetXOffset() );
- aMtrCenterY.SetValue( pGradient->GetYOffset() );
- aMtrColorFrom.SetValue( pGradient->GetStartIntens() );
- aMtrColorTo.SetValue( pGradient->GetEndIntens() );
-
- // Controls Disablen/Enablen
- SetControlState_Impl( eXGS );
-
- // ItemSet fuellen und an aCtlPreview weiterleiten
- rXFSet.Put( XFillGradientItem( String(), *pGradient ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreview.Invalidate();
- delete pGradient;
- }
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-void SvxGradientTabPage::SetControlState_Impl( XGradientStyle eXGS )
-{
- switch( eXGS )
- {
- case XGRAD_LINEAR:
- case XGRAD_AXIAL:
- aFtCenterX.Disable();
- aMtrCenterX.Disable();
- aFtCenterY.Disable();
- aMtrCenterY.Disable();
- aFtAngle.Enable();
- aMtrAngle.Enable();
- break;
-
- case XGRAD_RADIAL:
- aFtCenterX.Enable();
- aMtrCenterX.Enable();
- aFtCenterY.Enable();
- aMtrCenterY.Enable();
- aFtAngle.Disable();
- aMtrAngle.Disable();
- break;
-
- case XGRAD_ELLIPTICAL:
- aFtCenterX.Enable();
- aMtrCenterX.Enable();
- aFtCenterY.Enable();
- aMtrCenterY.Enable();
- aFtAngle.Enable();
- aMtrAngle.Enable();
- break;
-
- case XGRAD_SQUARE:
- case XGRAD_RECT:
- aFtCenterX.Enable();
- aMtrCenterX.Enable();
- aFtCenterY.Enable();
- aMtrCenterY.Enable();
- aFtAngle.Enable();
- aMtrAngle.Enable();
- break;
- }
-}
-
-
diff --git a/svx/source/cui/tphatch.cxx b/svx/source/cui/tphatch.cxx
deleted file mode 100644
index b17345aee9..0000000000
--- a/svx/source/cui/tphatch.cxx
+++ /dev/null
@@ -1,912 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tphatch.cxx,v $
- * $Revision: 1.29 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#ifndef _MSGBOX_HXX //autogen
-#include <vcl/msgbox.hxx>
-#endif
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-#define _SVX_TPHATCH_CXX
-
-#include <svx/dialogs.hrc>
-#include "tabarea.hrc"
-#include "dlgname.hrc"
-#include "helpid.hrc"
-
-
-
-
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/xtable.hxx>
-
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-
-#define DLGWIN this->GetParent()->GetParent()
-
-#define BITMAP_WIDTH 32
-#define BITMAP_HEIGHT 12
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern und Definieren der Schraffuren
-|*
-\************************************************************************/
-
-SvxHatchTabPage::SvxHatchTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
-
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_HATCH ), rInAttrs ),
-
- aFtDistance ( this, SVX_RES( FT_LINE_DISTANCE ) ),
- aMtrDistance ( this, SVX_RES( MTR_FLD_DISTANCE ) ),
- aFtAngle ( this, SVX_RES( FT_LINE_ANGLE ) ),
- aMtrAngle ( this, SVX_RES( MTR_FLD_ANGLE ) ),
- aCtlAngle ( this, SVX_RES( CTL_ANGLE ),
- RP_RB, 200, 80, CS_ANGLE ),
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aFtLineType ( this, SVX_RES( FT_LINE_TYPE ) ),
- aLbLineType ( this, SVX_RES( LB_LINE_TYPE ) ),
- aFtLineColor ( this, SVX_RES( FT_LINE_COLOR ) ),
- aLbLineColor ( this, SVX_RES( LB_LINE_COLOR ) ),
- aLbHatchings ( this, SVX_RES( LB_HATCHINGS ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- aBtnAdd ( this, SVX_RES( BTN_ADD ) ),
- aBtnModify ( this, SVX_RES( BTN_MODIFY ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aBtnLoad ( this, SVX_RES( BTN_LOAD ) ),
- aBtnSave ( this, SVX_RES( BTN_SAVE ) ),
-
- rOutAttrs ( rInAttrs ),
- pColorTab( NULL ),
- pHatchingList( NULL ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFStyleItem ( XFILL_HATCH ),
- aXHatchItem ( String(), XHatch() ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() )
-
-{
- aBtnLoad.SetModeImage( Image( SVX_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnSave.SetModeImage( Image( SVX_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
-
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Metrik einstellen
- FieldUnit eFUnit = GetModuleFieldUnit( &rInAttrs );
-
- switch ( eFUnit )
- {
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ;//prevent warning
- }
- SetFieldUnit( aMtrDistance, eFUnit );
-
- // PoolUnit ermitteln
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool?" );
- ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH );
-
- // Setzen des Output-Devices
- rXFSet.Put( aXFStyleItem );
- rXFSet.Put( aXHatchItem );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aLbHatchings.SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl_Impl ) );
-
- Link aLink = LINK( this, SvxHatchTabPage, ModifiedHdl_Impl );
- aMtrDistance.SetModifyHdl( aLink );
- aMtrAngle.SetModifyHdl( aLink );
- aLbLineType.SetSelectHdl( aLink );
- aLbLineColor.SetSelectHdl( aLink );
-
- aBtnAdd.SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) );
- aBtnModify.SetClickHdl(
- LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) );
- aBtnDelete.SetClickHdl(
- LINK( this, SvxHatchTabPage, ClickDeleteHdl_Impl ) );
- aBtnLoad.SetClickHdl( LINK( this, SvxHatchTabPage, ClickLoadHdl_Impl ) );
- aBtnSave.SetClickHdl( LINK( this, SvxHatchTabPage, ClickSaveHdl_Impl ) );
-
- aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxHatchTabPage::Construct()
-{
- // Farbtabelle
- aLbLineColor.Fill( pColorTab );
-
- // Schraffurentabelle
- aLbHatchings.Fill( pHatchingList );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
-{
- USHORT nPos;
- USHORT nCount;
-
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- *pbAreaTP = FALSE;
-
- if( pColorTab )
- {
- // ColorTable
- if( *pnColorTableState & CT_CHANGED ||
- *pnColorTableState & CT_MODIFIED )
- {
- if( *pnColorTableState & CT_CHANGED )
- pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable();
-
- // LbLineColor
- nPos = aLbLineColor.GetSelectEntryPos();
- aLbLineColor.Clear();
- aLbLineColor.Fill( pColorTab );
- nCount = aLbLineColor.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbLineColor.SelectEntryPos( 0 );
- else
- aLbLineColor.SelectEntryPos( nPos );
-
- ModifiedHdl_Impl( this );
- }
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pHatchingList->GetPath() );
-
- aURL.Append( pHatchingList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- if( *pPageType == PT_HATCH && *pPos != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbHatchings.SelectEntryPos( *pPos );
- }
- // Farben koennten geloescht worden sein
- ChangeHatchHdl_Impl( this );
-
- *pPageType = PT_HATCH;
- *pPos = LISTBOX_ENTRY_NOTFOUND;
- }
- }
-
- rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) );
- rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-int SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if ( CheckChanges_Impl() == -1L )
- return KEEP_PAGE;
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-long SvxHatchTabPage::CheckChanges_Impl()
-{
- if( aMtrDistance.GetText() != aMtrDistance.GetSavedValue() ||
- aMtrAngle.GetText() != aMtrAngle.GetSavedValue() ||
- aLbLineType.GetSelectEntryPos() != aLbLineType.GetSavedValue() ||
- aLbLineColor.GetSelectEntryPos() != aLbLineColor.GetSavedValue() ||
- aLbHatchings.GetSelectEntryPos() != aLbHatchings.GetSavedValue() )
- {
- ResMgr& rMgr = DIALOG_MGR();
- Image aWarningBoxImage = WarningBox::GetStandardImage();
- //CHINA001 SvxMessDialog aMessDlg( DLGWIN,
- //CHINA001 String( ResId( RID_SVXSTR_HATCH, rMgr ) ),
- //CHINA001 String( ResId( RID_SVXSTR_ASK_CHANGE_HATCH, rMgr ) ),
- //CHINA001 &aWarningBoxImage );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX,
- String( ResId( RID_SVXSTR_HATCH, rMgr ) ),
- String( ResId( RID_SVXSTR_ASK_CHANGE_HATCH, rMgr ) ),
- &aWarningBoxImage );
- DBG_ASSERT(aMessDlg, "Dialogdiet fail!");//CHINA001
- aMessDlg->SetButtonText( MESS_BTN_1, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
- String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
- String( ResId( RID_SVXSTR_ADD, rMgr ) ) );
-
- short nRet = aMessDlg->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
-
- switch( nRet )
- {
- case RET_BTN_1: // Aendern
- {
- ClickModifyHdl_Impl( this );
- }
- break;
-
- case RET_BTN_2: // Hinzufuegen
- {
- ClickAddHdl_Impl( this );
- }
- break;
-
- case RET_CANCEL:
- // return( -1L ); <-- wuerde die Seite nicht verlassen
- break;
- // return( TRUE ); // Abbruch
- }
- delete aMessDlg; //add by CHINA001
- }
-
- USHORT nPos = aLbHatchings.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- *pPos = nPos;
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxHatchTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if( *pDlgType == 0 && *pbAreaTP == FALSE ) // Flaechen-Dialog
- {
- if( *pPageType == PT_HATCH )
- {
- // CheckChanges(); <-- doppelte Abfrage ?
-
- XHatch* pXHatch = NULL;
- String aString;
- USHORT nPos = aLbHatchings.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- pXHatch = new XHatch( pHatchingList->GetHatch( nPos )->GetHatch() );
- aString = aLbHatchings.GetSelectEntry();
- }
- // Farbverlauf wurde (unbekannt) uebergeben
- else
- {
- pXHatch = new XHatch( aLbLineColor.GetSelectEntryColor(),
- (XHatchStyle) aLbLineType.GetSelectEntryPos(),
- GetCoreValue( aMtrDistance, ePoolUnit ),
- static_cast<long>(aMtrAngle.GetValue() * 10) );
- }
- DBG_ASSERT( pXHatch, "XHatch konnte nicht erzeugt werden" );
- rSet.Put( XFillStyleItem( XFILL_HATCH ) );
- rSet.Put( XFillHatchItem( aString, *pXHatch ) );
-
- delete pXHatch;
- }
- }
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxHatchTabPage::Reset( const SfxItemSet& rSet )
-{
- // aLbHatchings.SelectEntryPos( 0 );
- ChangeHatchHdl_Impl( this );
-
- // Status der Buttons ermitteln
- if( pHatchingList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
-
- rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) );
- rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
- aCtlPreview.Invalidate();
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxHatchTabPage::Create( Window* pWindow,
- const SfxItemSet& rSet )
-{
- return new SvxHatchTabPage( pWindow, rSet );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p )
-{
- if( p == &aMtrAngle )
- {
- // Setzen des Winkels im AngleControl
- switch( aMtrAngle.GetValue() )
- {
- case 135: aCtlAngle.SetActualRP( RP_LT ); break;
- case 90: aCtlAngle.SetActualRP( RP_MT ); break;
- case 45: aCtlAngle.SetActualRP( RP_RT ); break;
- case 180: aCtlAngle.SetActualRP( RP_LM ); break;
- case 0: aCtlAngle.SetActualRP( RP_RM ); break;
- case 225: aCtlAngle.SetActualRP( RP_LB ); break;
- case 270: aCtlAngle.SetActualRP( RP_MB ); break;
- case 315: aCtlAngle.SetActualRP( RP_RB ); break;
- default: aCtlAngle.SetActualRP( RP_MM ); break;
- }
- }
-
- XHatch aXHatch( aLbLineColor.GetSelectEntryColor(),
- (XHatchStyle) aLbLineType.GetSelectEntryPos(),
- GetCoreValue( aMtrDistance, ePoolUnit ),
- static_cast<long>(aMtrAngle.GetValue() * 10) );
-
- rXFSet.Put( XFillHatchItem( String(), aXHatch ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreview.Invalidate();
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ChangeHatchHdl_Impl, void *, EMPTYARG )
-{
- XHatch* pHatch = NULL;
- int nPos = aLbHatchings.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- pHatch = new XHatch( ( (XHatchEntry*) pHatchingList->GetHatch( nPos ) )->GetHatch() );
- else
- {
- const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), TRUE, &pPoolItem ) )
- {
- if( ( XFILL_HATCH == (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue() ) &&
- ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), TRUE, &pPoolItem ) ) )
- {
- pHatch = new XHatch( ( ( const XFillHatchItem* ) pPoolItem )->GetHatchValue() );
- }
- }
- if( !pHatch )
- {
- aLbHatchings.SelectEntryPos( 0 );
- nPos = aLbHatchings.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- pHatch = new XHatch( ( (XHatchEntry*) pHatchingList->GetHatch( nPos ) )->GetHatch() );
- }
- }
- if( pHatch )
- {
- aLbLineType.SelectEntryPos(
- sal::static_int_cast< USHORT >( pHatch->GetHatchStyle() ) );
- // Wenn der Eintrag nicht in der Listbox ist, wird die Farbe
- // temporaer hinzugenommen
- aLbLineColor.SetNoSelection();
- aLbLineColor.SelectEntry( pHatch->GetColor() );
- if( aLbLineColor.GetSelectEntryCount() == 0 )
- {
- aLbLineColor.InsertEntry( pHatch->GetColor(), String() );
- aLbLineColor.SelectEntry( pHatch->GetColor() );
- }
- SetMetricValue( aMtrDistance, pHatch->GetDistance(), ePoolUnit );
- aMtrAngle.SetValue( pHatch->GetAngle() / 10 );
-
- // Setzen des Winkels im AngleControl
- switch( aMtrAngle.GetValue() )
- {
- case 135: aCtlAngle.SetActualRP( RP_LT ); break;
- case 90: aCtlAngle.SetActualRP( RP_MT ); break;
- case 45: aCtlAngle.SetActualRP( RP_RT ); break;
- case 180: aCtlAngle.SetActualRP( RP_LM ); break;
- case 0: aCtlAngle.SetActualRP( RP_RM ); break;
- case 225: aCtlAngle.SetActualRP( RP_LB ); break;
- case 270: aCtlAngle.SetActualRP( RP_MB ); break;
- case 315: aCtlAngle.SetActualRP( RP_RB ); break;
- default: aCtlAngle.SetActualRP( RP_MM ); break;
- }
-
- // Backgroundcolor
- /*
- const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBACKGROUND ), TRUE, &pPoolItem ) )
- {
- rXFSet.Put ( XFillBackgroundItem( ( ( XFillBackgroundItem* )pPoolItem)->GetValue() ) );
- if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), TRUE, &pPoolItem ) )
- {
- Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetValue() );
- rXFSet.Put( XFillColorItem( String(), aColor ) );
- }
- }
- */
- // ItemSet fuellen und an aCtlPreview weiterleiten
- rXFSet.Put( XFillHatchItem( String(), *pHatch ) );
- aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() );
-
- aCtlPreview.Invalidate();
- delete pHatch;
- }
- aMtrDistance.SaveValue();
- aMtrAngle.SaveValue();
- aLbLineType.SaveValue();
- aLbLineColor.SaveValue();
- aLbHatchings.SaveValue();
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_HATCH, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_HATCH, rMgr ) );
- String aName;
-
- long nCount = pHatchingList->Count();
- long j = 1;
- BOOL bDifferent = FALSE;
-
- while( !bDifferent )
- {
- aName = aNewName;
- aName += sal_Unicode(' ');
- aName += UniString::CreateFromInt32( j++ );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pHatchingList->GetHatch( i )->GetName() )
- bDifferent = FALSE;
- }
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- WarningBox* pWarnBox = NULL;
- USHORT nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
-
- while( pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
-
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if( aName == pHatchingList->GetHatch( i )->GetName() )
- bDifferent = FALSE;
-
- if( bDifferent ) {
- nError = 0;
- break;
- }
-
- if( !pWarnBox )
- {
- pWarnBox = new WarningBox( DLGWIN,
- WinBits( WB_OK_CANCEL ),
- String( ResId( nError, rMgr ) ) );
- pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
- }
-
- if( pWarnBox->Execute() != RET_OK )
- break;
- }
- //Rectangle aDlgRect( pDlg->GetPosPixel(), pDlg->GetSizePixel() );
- delete pDlg;
- delete pWarnBox;
-
- if( !nError )
- {
- XHatch aXHatch( aLbLineColor.GetSelectEntryColor(),
- (XHatchStyle) aLbLineType.GetSelectEntryPos(),
- GetCoreValue( aMtrDistance, ePoolUnit ),
- static_cast<long>(aMtrAngle.GetValue() * 10) );
- XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName );
-
- pHatchingList->Insert( pEntry, nCount );
-
- aLbHatchings.Append( pEntry );
-
- aLbHatchings.SelectEntryPos( aLbHatchings.GetEntryCount() - 1 );
-
-#ifdef WNT
- // hack: #31355# W.P.
- Rectangle aRect( aLbHatchings.GetPosPixel(), aLbHatchings.GetSizePixel() );
- if( TRUE ) { // ??? overlapped with pDlg
- // and srolling
- Invalidate( aRect );
- //aLbHatchings.Invalidate();
- }
-#endif
-
- // Flag fuer modifiziert setzen
- *pnHatchingListState |= CT_MODIFIED;
-
- ChangeHatchHdl_Impl( this );
- }
-
- // Status der Buttons ermitteln
- if( pHatchingList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbHatchings.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_HATCH, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_HATCH, rMgr ) );
- String aName( pHatchingList->GetHatch( nPos )->GetName() );
- String aOldName = aName;
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
-
- long nCount = pHatchingList->Count();
- BOOL bDifferent = FALSE;
- BOOL bLoop = TRUE;
- while( bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pHatchingList->GetHatch( i )->GetName() &&
- aName != aOldName )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- {
- bLoop = FALSE;
- XHatch aXHatch( aLbLineColor.GetSelectEntryColor(),
- (XHatchStyle) aLbLineType.GetSelectEntryPos(),
- GetCoreValue( aMtrDistance, ePoolUnit ),
- static_cast<long>(aMtrAngle.GetValue() * 10) );
-
- XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName );
-
- delete pHatchingList->Replace( pEntry, nPos );
-
- aLbHatchings.Modify( pEntry, nPos );
-
- aLbHatchings.SelectEntryPos( nPos );
-
- // Werte sichern fuer Changes-Erkennung ( -> Methode )
- aMtrDistance.SaveValue();
- aMtrAngle.SaveValue();
- aLbLineType.SaveValue();
- aLbLineColor.SaveValue();
- aLbHatchings.SaveValue();
-
- // Flag fuer modifiziert setzen
- *pnHatchingListState |= CT_MODIFIED;
- }
- else
- {
- WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aBox.Execute();
- }
- }
- delete( pDlg );
- }
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbHatchings.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
-//! SVX_RES( RID_SVXSTR_DEL_HATCH ),
- String( SVX_RES( RID_SVXSTR_ASK_DEL_HATCH ) ) );
-
- if( aQueryBox.Execute() == RET_YES )
- {
- delete pHatchingList->Remove( nPos );
- aLbHatchings.RemoveEntry( nPos );
- aLbHatchings.SelectEntryPos( 0 );
-
- aCtlPreview.Invalidate();
-
- ChangeHatchHdl_Impl( this );
-
- // Flag fuer modifiziert setzen
- *pnHatchingListState |= CT_MODIFIED;
- }
- }
- // Status der Buttons ermitteln
- if( !pHatchingList->Count() )
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- USHORT nReturn = RET_YES;
-
- if ( *pnHatchingListState & CT_MODIFIED )
- {
- nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
- String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
-
- if ( nReturn == RET_YES )
- pHatchingList->Save();
- }
-
- if ( nReturn != RET_CANCEL )
- {
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soh" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- // Liste speichern
- XHatchList* pHatchList = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pHatchList->SetName( aURL.getName() );
- if( pHatchList->Load() )
- {
- if( pHatchList )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pHatchingList != ( (SvxAreaTabDialog*) DLGWIN )->GetHatchingList() )
- delete pHatchingList;
-
- pHatchingList = pHatchList;
- ( (SvxAreaTabDialog*) DLGWIN )->SetNewHatchingList( pHatchingList );
-
- aLbHatchings.Clear();
- aLbHatchings.Fill( pHatchingList );
- Reset( rOutAttrs );
-
- pHatchingList->SetName( aURL.getName() );
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gewechselt setzen
- *pnHatchingListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnHatchingListState &= ~CT_MODIFIED;
- }
- }
- else
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
- }
- }
-
- // Status der Buttons ermitteln
- if ( pHatchingList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return 0L;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxHatchTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
-{
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soh" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
-
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( pHatchingList->GetName().Len() )
- {
- aFile.Append( pHatchingList->GetName() );
-
- if( !aFile.getExtension().getLength() )
- aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soh" ) ) );
- }
-
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- pHatchingList->SetName( aURL.getName() );
- pHatchingList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( pHatchingList->Save() )
- {
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gespeichert setzen
- *pnHatchingListState |= CT_SAVED;
- // Flag fuer modifiziert entfernen
- *pnHatchingListState &= ~CT_MODIFIED;
- }
- else
- {
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( SVX_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute();
- }
- }
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
-
-void SvxHatchTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
-{
- if( pWindow == &aCtlAngle )
- {
- switch( eRcPt )
- {
- case RP_LT: aMtrAngle.SetValue( 135 ); break;
- case RP_MT: aMtrAngle.SetValue( 90 ); break;
- case RP_RT: aMtrAngle.SetValue( 45 ); break;
- case RP_LM: aMtrAngle.SetValue( 180 ); break;
- case RP_RM: aMtrAngle.SetValue( 0 ); break;
- case RP_LB: aMtrAngle.SetValue( 225 ); break;
- case RP_MB: aMtrAngle.SetValue( 270 ); break;
- case RP_RB: aMtrAngle.SetValue( 315 ); break;
- case RP_MM: break;
- }
- ModifiedHdl_Impl( this );
- }
-}
-
-
-void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
- aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
-
- SvxTabPage::DataChanged( rDCEvt );
-}
-
diff --git a/svx/source/cui/tpline.cxx b/svx/source/cui/tpline.cxx
deleted file mode 100644
index 36984b8f31..0000000000
--- a/svx/source/cui/tpline.cxx
+++ /dev/null
@@ -1,1959 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tpline.cxx,v $
- * $Revision: 1.45 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#ifndef _SVX_SIZEITEM_HXX //autogen
-
-#include <svx/sizeitem.hxx>
-#endif
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-
-#define _SVX_TPLINE_CXX
-
-#include <svx/dialogs.hrc>
-#include "tabline.hrc"
-#include "dlgname.hrc"
-
-
-
-
-
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/xtable.hxx>
-
-#include "drawitem.hxx"
-#include "cuitabline.hxx"
-#include "dlgname.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <svx/svdmodel.hxx>
-#include "svxgrahicitem.hxx"
-#include "linectrl.hrc"
-#include <sfx2/request.hxx> //add CHINA001
-#include "ofaitem.hxx" //add CHINA001
-//#58425# Symbole auf einer Linie (z.B. StarChart) Includes:
-#include <svx/svdobj.hxx>
-#include <svx/svdview.hxx>
-#include <svx/svdmodel.hxx>
-#include <numvset.hxx>
-#include <vcl/msgbox.hxx>
-#include <svx/numitem.hxx>
-#include <svx/svxenum.hxx>
-#include <sfx2/objsh.hxx>
-#include <svx/brshitem.hxx>
-#include <gallery.hxx>
-#include <svx/xbitmap.hxx>
-#include <unotools/localfilehelper.hxx>
-
-#include "opengrf.hxx"
-
-#define MAX_BMP_WIDTH 16
-#define MAX_BMP_HEIGHT 16
-// define ----------------------------------------------------------------
-
-#define DLGWIN this->GetParent()->GetParent()
-
-#define BITMAP_WIDTH 32
-#define BITMAP_HEIGHT 12
-#define XOUT_WIDTH 150
-
-// static ----------------------------------------------------------------
-
-static USHORT pLineRanges[] =
-{
- XATTR_LINETRANSPARENCE,
- XATTR_LINETRANSPARENCE,
- SID_ATTR_LINE_STYLE,
- SID_ATTR_LINE_ENDCENTER,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern der Linien
-|*
-\************************************************************************/
-
-SvxLineTabPage::SvxLineTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_LINE ), rInAttrs ),
- aFtLineStyle ( this, SVX_RES( FT_LINE_STYLE ) ),
- aLbLineStyle ( this, SVX_RES( LB_LINE_STYLE ) ),
- aFtColor ( this, SVX_RES( FT_COLOR ) ),
- aLbColor ( this, SVX_RES( LB_COLOR ) ),
- aFtLineWidth ( this, SVX_RES( FT_LINE_WIDTH ) ),
- aMtrLineWidth ( this, SVX_RES( MTR_FLD_LINE_WIDTH ) ),
- aFtTransparent ( this, SVX_RES( FT_TRANSPARENT ) ),
- aMtrTransparent ( this, SVX_RES( MTR_LINE_TRANSPARENT ) ),
- aFlLine ( this, SVX_RES( FL_LINE ) ),
- aFtLineEndsStyle ( this, SVX_RES( FT_LINE_ENDS_STYLE ) ),
- aLbStartStyle ( this, SVX_RES( LB_START_STYLE ) ),
- aFtLineEndsWidth ( this, SVX_RES( FT_LINE_ENDS_WIDTH ) ),
- aMtrStartWidth ( this, SVX_RES( MTR_FLD_START_WIDTH ) ),
- aTsbCenterStart ( this, SVX_RES( TSB_CENTER_START ) ),
- aLbEndStyle ( this, SVX_RES( LB_END_STYLE ) ),
- aMtrEndWidth ( this, SVX_RES( MTR_FLD_END_WIDTH ) ),
- aTsbCenterEnd ( this, SVX_RES( TSB_CENTER_END ) ),
- aCbxSynchronize ( this, SVX_RES( CBX_SYNCHRONIZE ) ),
- aFlLineEnds ( this, SVX_RES( FL_LINE_ENDS ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- aFLSeparator ( this, SVX_RES( FL_SEPARATOR ) ),
-
- // #116827#
- maFLEdgeStyle ( this, SVX_RES( FL_EDGE_STYLE ) ),
- maFTEdgeStyle ( this, SVX_RES( FT_EDGE_STYLE ) ),
- maLBEdgeStyle ( this, SVX_RES( LB_EDGE_STYLE ) ),
-
- pSymbolList(NULL),
- bNewSize(false),
- nNumMenuGalleryItems(0),
- nSymbolType(SVX_SYMBOLTYPE_UNKNOWN), //unbekannt bzw. unchanged
- pSymbolAttr(NULL),
- //#58425# Symbole auf einer Linie (z.B. StarChart)
- aFlSymbol ( this, SVX_RES(FL_SYMBOL_FORMAT)),
- aSymbolMB ( this, SVX_RES(MB_SYMBOL_BITMAP)),
- aSymbolWidthFT ( this, SVX_RES(FT_SYMBOL_WIDTH)),
- aSymbolWidthMF ( this, SVX_RES(MF_SYMBOL_WIDTH)),
- aSymbolHeightFT ( this, SVX_RES(FT_SYMBOL_HEIGHT)),
- aSymbolHeightMF ( this, SVX_RES(MF_SYMBOL_HEIGHT)),
- aSymbolRatioCB ( this, SVX_RES(CB_SYMBOL_RATIO)),
-
- bLastWidthModified(FALSE),
- aSymbolLastSize(Size(0,0)),
- bSymbols(FALSE),
-
- rOutAttrs ( rInAttrs ),
- bObjSelected( sal_False ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXLStyle ( XLINE_DASH ),
- aXWidth ( 1 ),
- aXDash ( String(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ),
- aXColor ( String(), COL_LIGHTRED ),
- aXLineAttr ( pXPool ),
- rXLSet ( aXLineAttr.GetItemSet() ),
- pnLineEndListState( 0 ),
- pnDashListState( 0 ),
- pnColorTableState( 0 ),
- nPageType ( 0 )//CHINA001 pPageType ( NULL ),
-{
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Metrik einstellen
- FieldUnit eFUnit = GetModuleFieldUnit( &rInAttrs );
-
- switch ( eFUnit )
- {
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- // no break -> we now have mm
- case FUNIT_MM:
- aMtrLineWidth.SetSpinSize( 50 );
- aMtrStartWidth.SetSpinSize( 50 );
- aMtrEndWidth.SetSpinSize( 50 );
- break;
-
- case FUNIT_INCH:
- aMtrLineWidth.SetSpinSize( 2 );
- aMtrStartWidth.SetSpinSize( 2 );
- aMtrEndWidth.SetSpinSize( 2 );
- break;
- default: ;//prevent warning
- }
- SetFieldUnit( aMtrLineWidth, eFUnit );
- SetFieldUnit( aMtrStartWidth, eFUnit );
- SetFieldUnit( aMtrEndWidth, eFUnit );
-
- // PoolUnit ermitteln
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool?" );
- ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH );
-
- aLbLineStyle.SetSelectHdl(
- LINK( this, SvxLineTabPage, ClickInvisibleHdl_Impl ) );
- aLbColor.SetSelectHdl(
- LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) );
- aMtrLineWidth.SetModifyHdl(
- LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) );
- aMtrTransparent.SetModifyHdl(
- LINK( this, SvxLineTabPage, ChangeTransparentHdl_Impl ) );
-
- Link aStart = LINK( this, SvxLineTabPage, ChangeStartHdl_Impl );
- Link aEnd = LINK( this, SvxLineTabPage, ChangeEndHdl_Impl );
- aLbStartStyle.SetSelectHdl( aStart );
- aLbEndStyle.SetSelectHdl( aEnd );
- aMtrStartWidth.SetModifyHdl( aStart );
- aMtrEndWidth.SetModifyHdl( aEnd );
- aTsbCenterStart.SetClickHdl( aStart );
- aTsbCenterEnd.SetClickHdl( aEnd );
-
- pColorTab = NULL;
- pDashList = NULL;
- pLineEndList = NULL;
-
- // #116827#
- Link aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl );
- maLBEdgeStyle.SetSelectHdl( aEdgeStyle );
-
- //#58425# Symbole auf einer Linie (z.B. StarChart) , MB-Handler setzen
- aSymbolMB.SetSelectHdl(LINK(this, SvxLineTabPage, GraphicHdl_Impl));
- aSymbolMB.SetActivateHdl(LINK(this, SvxLineTabPage, MenuCreateHdl_Impl));
- aSymbolWidthMF.SetModifyHdl(LINK(this, SvxLineTabPage, SizeHdl_Impl));
- aSymbolHeightMF.SetModifyHdl(LINK(this, SvxLineTabPage, SizeHdl_Impl));
- aSymbolRatioCB.SetClickHdl(LINK(this, SvxLineTabPage, RatioHdl_Impl));
-
- aSymbolRatioCB.Check(TRUE);
- ShowSymbolControls(FALSE);
-
- // #63083#
- nActLineWidth = -1;
-}
-//#58425# Symbole auf einer Linie (z.B. StarChart) , Symbol-Controls aktivieren
-void SvxLineTabPage::ShowSymbolControls(BOOL bOn)
-{
- bSymbols=bOn;
- aSymbolWidthFT.Show(bOn);
- aSymbolWidthMF.Show(bOn);
- aSymbolHeightFT.Show(bOn);
- aSymbolHeightMF.Show(bOn);
- aFlSymbol.Show(bOn);
- aSymbolRatioCB.Show(bOn);
- aSymbolMB.Show(bOn);
- aCtlPreview.ShowSymbol(bOn);
-}
-// -----------------------------------------------------------------------
-//#58425# Symbole auf einer Linie (z.B. StarChart) , dtor neu!
-SvxLineTabPage::~SvxLineTabPage()
-{
- delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY );
-
- if(pSymbolList)
- delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
-
- String* pStr = (String*)aGrfNames.First();
- while( pStr )
- {
- delete pStr;
- pStr = (String*)aGrfNames.Next();
- }
- SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)aGrfBrushItems.First();
- while( pInfo )
- {
- delete pInfo->pBrushItem;
- delete pInfo;
- pInfo = (SvxBmpItemInfo*)aGrfBrushItems.Next();
- }
-}
-void SvxLineTabPage::Construct()
-{
- // Farbtabelle
- aLbColor.Fill( pColorTab );
- FillListboxes();
-}
-
-void SvxLineTabPage::FillListboxes()
-{
-// aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
-
- ResMgr& rMgr = DIALOG_MGR();
-
- // Linienstile
- USHORT nOldSelect = aLbLineStyle.GetSelectEntryPos();
- aLbLineStyle.Clear();
- aLbLineStyle.InsertEntry( String( ResId( RID_SVXSTR_INVISIBLE, rMgr ) ) );
-
- const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
- Bitmap aBitmap ( SVX_RES ( RID_SVXCTRL_LINECTRL ) );
- Color aSourceColors[2];
- Color aDestColors[2];
-
- aSourceColors[0] = Color( COL_WHITE );
- aSourceColors[1] = Color( COL_BLACK );
-
- aDestColors[0] = rStyles.GetFieldColor();
- aDestColors[1] = rStyles.GetFieldTextColor();
-
- aBitmap.Replace ( aSourceColors, aDestColors, 2 );
- Image aSolidLine ( aBitmap );
- aLbLineStyle.InsertEntry( String( ResId( RID_SVXSTR_SOLID, rMgr ) ), aSolidLine );
- aLbLineStyle.Fill( pDashList );
- aLbLineStyle.SelectEntryPos( nOldSelect );
-
- // LinienEndenStile
- String sNone( ResId( RID_SVXSTR_NONE, rMgr ) );
- nOldSelect = aLbStartStyle.GetSelectEntryPos();
- aLbStartStyle.Clear();
- aLbStartStyle.InsertEntry( sNone );
- aLbStartStyle.Fill( pLineEndList );
- aLbStartStyle.SelectEntryPos( nOldSelect );
- nOldSelect = aLbEndStyle.GetSelectEntryPos();
- aLbEndStyle.Clear();
- aLbEndStyle.InsertEntry( sNone );
- aLbEndStyle.Fill( pLineEndList, FALSE );
- aLbEndStyle.SelectEntryPos( nOldSelect );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
-{
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False); //add CHINA001 begin
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue()); //add CHINA001 end
- if( nDlgType == 0 && pDashList ) //CHINA001 if( *pDlgType == 0 && pDashList ) // Linien-Dialog
- {
- ResMgr& rMgr = DIALOG_MGR();
- USHORT nPos;
- USHORT nCount;
-
- // Dashliste
- if( ( *pnDashListState & CT_MODIFIED ) ||
- ( *pnDashListState & CT_CHANGED ) )
- {
- if( *pnDashListState & CT_CHANGED )
- pDashList = ( (SvxLineTabDialog*) DLGWIN )->
- GetNewDashList();
- *pnDashListState = CT_NONE;
-
- // Styleliste
- nPos = aLbLineStyle.GetSelectEntryPos();
-
- aLbLineStyle.Clear();
- aLbLineStyle.InsertEntry(
- String( ResId( RID_SVXSTR_INVISIBLE, rMgr ) ) );
- aLbLineStyle.InsertEntry(
- String( ResId( RID_SVXSTR_SOLID, rMgr ) ) );
- aLbLineStyle.Fill( pDashList );
- nCount = aLbLineStyle.GetEntryCount();
-
- if ( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbLineStyle.SelectEntryPos( 0 );
- else
- aLbLineStyle.SelectEntryPos( nPos );
- // SelectStyleHdl_Impl( this );
- }
-
- INetURLObject aDashURL( pDashList->GetPath() );
-
- aDashURL.Append( pDashList->GetName() );
- DBG_ASSERT( aDashURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, pMgr ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aDashURL.getBase().Len() > 18 )
- {
- aString += aDashURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aDashURL.getBase();
-
- aGrpLine.SetText( aString );
-*/
- // LineEndliste
- if( ( *pnLineEndListState & CT_MODIFIED ) ||
- ( *pnLineEndListState & CT_CHANGED ) )
- {
- if( *pnLineEndListState & CT_CHANGED )
- pLineEndList = ( (SvxLineTabDialog*) DLGWIN )->
- GetNewLineEndList();
- *pnLineEndListState = CT_NONE;
-
- nPos = aLbLineStyle.GetSelectEntryPos();
- String sNone( ResId( RID_SVXSTR_NONE, rMgr ) );
- aLbStartStyle.Clear();
- aLbStartStyle.InsertEntry( sNone );
-
- aLbStartStyle.Fill( pLineEndList );
- nCount = aLbStartStyle.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbStartStyle.SelectEntryPos( 0 );
- else
- aLbStartStyle.SelectEntryPos( nPos );
-
- aLbEndStyle.Clear();
- aLbEndStyle.InsertEntry( sNone );
-
- aLbEndStyle.Fill( pLineEndList, FALSE );
- nCount = aLbEndStyle.GetEntryCount();
-
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbEndStyle.SelectEntryPos( 0 );
- else
- aLbEndStyle.SelectEntryPos( nPos );
- }
- INetURLObject aLineURL( pLineEndList->GetPath() );
-
- aLineURL.Append( pLineEndList->GetName() );
- DBG_ASSERT( aLineURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- aString = String( ResId( RID_SVXSTR_TABLE, pMgr ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aLineURL.getBase().Len() > 18 )
- {
- aString += aLineURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aLineURL.getBase();
-
- aGrpLineEnds.SetText( aString );
-*/
- // Auswertung, ob von einer anderen TabPage ein anderer Fuelltyp gesetzt wurde
- if( aLbLineStyle.GetSelectEntryPos() != 0 )
- {
- if( nPageType == 2 ) // 1//CHINA001 if( *pPageType == 2 ) // 1
- {
- aLbLineStyle.SelectEntryPos( *pPosDashLb + 2 ); // +2 wegen SOLID und INVLISIBLE
- ChangePreviewHdl_Impl( this );
- }
- if( nPageType == 3 )//CHINA001 if( *pPageType == 3 )
- {
- aLbStartStyle.SelectEntryPos( *pPosLineEndLb + 1 );// +1 wegen SOLID
- aLbEndStyle.SelectEntryPos( *pPosLineEndLb + 1 );// +1 wegen SOLID
- ChangePreviewHdl_Impl( this );
- }
- }
-
- // ColorTable
- if( *pnColorTableState )
- {
- if( *pnColorTableState & CT_CHANGED )
- pColorTab = ( (SvxLineTabDialog*) DLGWIN )->
- GetNewColorTable();
- // aLbColor
- sal_uInt16 nColorPos = aLbColor.GetSelectEntryPos();
- aLbColor.Clear();
- aLbColor.Fill( pColorTab );
- nCount = aLbColor.GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= nColorPos )
- aLbColor.SelectEntryPos( 0 );
- else
- aLbColor.SelectEntryPos( nColorPos );
-
- ChangePreviewHdl_Impl( this );
- }
-
- nPageType = 0;//CHINA001 *pPageType = 0;
- }
- // Seite existiert im Ctor noch nicht, deswegen hier!
-
- else if ( nDlgType == 1100 || // Chart-Dialog//CHINA001 else if ( *pDlgType == 1100 || // Chart-Dialog
- nDlgType == 1101 )//CHINA001 *pDlgType == 1101 )
- {
- aFtLineEndsStyle.Hide();
- aFtLineEndsWidth.Hide();
- aLbStartStyle.Hide();
- aMtrStartWidth.Hide();
- aTsbCenterStart.Hide();
- aLbEndStyle.Hide();
- aMtrEndWidth.Hide();
- aTsbCenterEnd.Hide();
- aCbxSynchronize.Hide();
- aFlLineEnds.Hide();
-
- // #116827#
- maFLEdgeStyle.Hide();
- maFTEdgeStyle.Hide();
- maLBEdgeStyle.Hide();
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxLineTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( nDlgType == 0 ) // Linien-Dialog//CHINA001 if( *pDlgType == 0 ) // Linien-Dialog
- {
- nPageType = 1; // evtl. fuer Erweiterungen//CHINA001 *pPageType = 1; // evtl. fuer Erweiterungen
- *pPosDashLb = aLbLineStyle.GetSelectEntryPos() - 2;// erster Eintrag SOLID !!!
- USHORT nPos = aLbStartStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- nPos--;
- *pPosLineEndLb = nPos;
- }
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return( LEAVE_PAGE );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxLineTabPage::FillItemSet( SfxItemSet& rAttrs )
-{
- const SfxPoolItem* pOld = NULL;
- USHORT nPos;
- BOOL bModified = FALSE;
-
- // Um evtl. Modifikationen der Liste vorzubeugen
- // werden Items anderer Seiten nicht gesetzt
- if( nDlgType != 0 || nPageType != 2 )//CHINA001 if( *pDlgType != 0 || *pPageType != 2 )
- {
- nPos = aLbLineStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbLineStyle.GetSavedValue() )
- {
- XLineStyleItem* pStyleItem = NULL;
-
- if( nPos == 0 )
- pStyleItem = new XLineStyleItem( XLINE_NONE );
- else if( nPos == 1 )
- pStyleItem = new XLineStyleItem( XLINE_SOLID );
- else
- {
- pStyleItem = new XLineStyleItem( XLINE_DASH );
-
- // Zusaetzliche Sicherheit
- if( pDashList->Count() > (long) ( nPos - 2 ) )
- {
- XLineDashItem aDashItem( aLbLineStyle.GetSelectEntry(),
- pDashList->GetDash( nPos - 2 )->GetDash() );
- pOld = GetOldItem( rAttrs, XATTR_LINEDASH );
- if ( !pOld || !( *(const XLineDashItem*)pOld == aDashItem ) )
- {
- rAttrs.Put( aDashItem );
- bModified = TRUE;
- }
- }
- }
- pOld = GetOldItem( rAttrs, XATTR_LINESTYLE );
- if ( !pOld || !( *(const XLineStyleItem*)pOld == *pStyleItem ) )
- {
- rAttrs.Put( *pStyleItem );
- bModified = TRUE;
- }
- delete pStyleItem;
- }
- }
- // Linienbreite
- // GetSavedValue() liefert String!
- if( aMtrLineWidth.GetText() != aMtrLineWidth.GetSavedValue() )
- {
- XLineWidthItem aItem( GetCoreValue( aMtrLineWidth, ePoolUnit ) );
- pOld = GetOldItem( rAttrs, XATTR_LINEWIDTH );
- if ( !pOld || !( *(const XLineWidthItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- //Breite Linienanfang
- if( aMtrStartWidth.GetText() != aMtrStartWidth.GetSavedValue() )
- {
- XLineStartWidthItem aItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) );
- pOld = GetOldItem( rAttrs, XATTR_LINESTARTWIDTH );
- if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- //Breite Linienende
- if( aMtrEndWidth.GetText() != aMtrEndWidth.GetSavedValue() )
- {
- XLineEndWidthItem aItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) );
- pOld = GetOldItem( rAttrs, XATTR_LINEENDWIDTH );
- if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- // Linienfarbe
- if( aLbColor.GetSelectEntryPos() != aLbColor.GetSavedValue() )
- {
- XLineColorItem aItem( aLbColor.GetSelectEntry(),
- aLbColor.GetSelectEntryColor() );
- pOld = GetOldItem( rAttrs, XATTR_LINECOLOR );
- if ( !pOld || !( *(const XLineColorItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- if( nDlgType != 0 || nPageType != 3 )//CHINA001 if( *pDlgType != 0 || *pPageType != 3 )
- {
- // Linienanfang
- nPos = aLbStartStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbStartStyle.GetSavedValue() )
- {
- XLineStartItem* pItem = NULL;
- if( nPos == 0 )
- pItem = new XLineStartItem();
- else if( pLineEndList->Count() > (long) ( nPos - 1 ) )
- pItem = new XLineStartItem( aLbStartStyle.GetSelectEntry(),
- pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() );
- pOld = GetOldItem( rAttrs, XATTR_LINESTART );
- if( pItem &&
- ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) )
- {
- rAttrs.Put( *pItem );
- bModified = TRUE;
- }
- delete pItem;
- }
- // Linienende
- nPos = aLbEndStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbEndStyle.GetSavedValue() )
- {
- XLineEndItem* pItem = NULL;
- if( nPos == 0 )
- pItem = new XLineEndItem();
- else if( pLineEndList->Count() > (long) ( nPos - 1 ) )
- pItem = new XLineEndItem( aLbEndStyle.GetSelectEntry(),
- pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() );
- pOld = GetOldItem( rAttrs, XATTR_LINEEND );
- if( pItem &&
- ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) )
- {
- rAttrs.Put( *pItem );
- bModified = TRUE;
- }
- delete pItem;
- }
- }
-
- // Linienenden zentriert
- TriState eState = aTsbCenterStart.GetState();
- if( eState != aTsbCenterStart.GetSavedValue() )
- {
- XLineStartCenterItem aItem( sal::static_int_cast< BOOL >( eState ) );
- pOld = GetOldItem( rAttrs, XATTR_LINESTARTCENTER );
- if ( !pOld || !( *(const XLineStartCenterItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- eState = aTsbCenterEnd.GetState();
- if( eState != aTsbCenterEnd.GetSavedValue() )
- {
- XLineEndCenterItem aItem( sal::static_int_cast< BOOL >( eState ) );
- pOld = GetOldItem( rAttrs, XATTR_LINEENDCENTER );
- if ( !pOld || !( *(const XLineEndCenterItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- //Breite Linienanfang
- if( aMtrStartWidth.GetText() != aMtrStartWidth.GetSavedValue() )
- {
- XLineStartWidthItem aItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) );
- pOld = GetOldItem( rAttrs, XATTR_LINESTARTWIDTH );
- if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- //Breite Linienende
- if( aMtrEndWidth.GetText() != aMtrEndWidth.GetSavedValue() )
- {
- XLineEndWidthItem aItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) );
- pOld = GetOldItem( rAttrs, XATTR_LINEENDWIDTH );
- if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- // Transparenz
- UINT16 nVal = (UINT16)aMtrTransparent.GetValue();
- if( nVal != (UINT16)aMtrTransparent.GetSavedValue().ToInt32() )
- {
- XLineTransparenceItem aItem( nVal );
- pOld = GetOldItem( rAttrs, XATTR_LINETRANSPARENCE );
- if ( !pOld || !( *(const XLineTransparenceItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- // #116827#
- nPos = maLBEdgeStyle.GetSelectEntryPos();
- if( LISTBOX_ENTRY_NOTFOUND != nPos && nPos != maLBEdgeStyle.GetSavedValue() )
- {
- XLineJointItem* pNew = 0L;
-
- switch(nPos)
- {
- case 0: // Rounded, default
- {
- pNew = new XLineJointItem(XLINEJOINT_ROUND);
- break;
- }
- case 1: // - none -
- {
- pNew = new XLineJointItem(XLINEJOINT_NONE);
- break;
- }
- case 2: // Miter
- {
- pNew = new XLineJointItem(XLINEJOINT_MITER);
- break;
- }
- case 3: // Bevel
- {
- pNew = new XLineJointItem(XLINEJOINT_BEVEL);
- break;
- }
- }
-
- if(pNew)
- {
- pOld = GetOldItem( rAttrs, XATTR_LINEJOINT );
-
- if(!pOld || !(*(const XLineJointItem*)pOld == *pNew))
- {
- rAttrs.Put( *pNew );
- bModified = TRUE;
- }
-
- delete pNew;
- }
- }
-
- if(nSymbolType!=SVX_SYMBOLTYPE_UNKNOWN || bNewSize)
- {
- //wurde also per Auswahl gesetzt oder Gr��e ist anders
- SvxSizeItem aSItem(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),aSymbolSize);
- const SfxPoolItem* pSOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE) );
- bNewSize = pSOld ? *(const SvxSizeItem *)pSOld != aSItem : bNewSize ;
- if(bNewSize)
- {
- rAttrs.Put(aSItem);
- bModified=TRUE;
- }
-
- SfxInt32Item aTItem(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),nSymbolType);
- const SfxPoolItem* pTOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE) );
- bool bNewType = pTOld == NULL || *(const SfxInt32Item*)pTOld != aTItem;
- if(bNewType && nSymbolType==SVX_SYMBOLTYPE_UNKNOWN)
- bNewType=false;//kleine Korrektur, Typ wurde garnicht gesetzt -> kein Type-Item erzeugen!
- if(bNewType)
- {
- rAttrs.Put(aTItem);
- bModified=TRUE;
- }
-
- if(nSymbolType!=SVX_SYMBOLTYPE_NONE)
- {
- SvxBrushItem aBItem(aSymbolGraphic,GPOS_MM,rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH));
- const SfxPoolItem* pBOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH) );
- bool bNewBrush =
- pBOld == NULL || *(const SvxBrushItem*)pBOld != aBItem;
- if(bNewBrush)
- {
- rAttrs.Put(aBItem);
- bModified=TRUE;
- }
- }
- }
- rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType));//add CHINA001
- return( bModified );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxLineTabPage::FillXLSet_Impl()
-{
- USHORT nPos;
-
- if( aLbLineStyle.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
- {
- //rXLSet.Put( XLineDashItem ( rOutAttrs.Get( GetWhich( XATTR_LINEDASH ) ) ) );
- rXLSet.Put( XLineStyleItem( XLINE_NONE ) );
- }
- else if( aLbLineStyle.IsEntryPosSelected( 0 ) )
- rXLSet.Put( XLineStyleItem( XLINE_NONE ) );
- else if( aLbLineStyle.IsEntryPosSelected( 1 ) )
- rXLSet.Put( XLineStyleItem( XLINE_SOLID ) );
- else
- {
- rXLSet.Put( XLineStyleItem( XLINE_DASH ) );
-
- nPos = aLbLineStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rXLSet.Put( XLineDashItem( aLbLineStyle.GetSelectEntry(),
- pDashList->GetDash( nPos - 2 )->GetDash() ) );
- }
- }
-
- nPos = aLbStartStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- if( nPos == 0 )
- rXLSet.Put( XLineStartItem() );
- else
- rXLSet.Put( XLineStartItem( aLbStartStyle.GetSelectEntry(),
- pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) );
- }
- nPos = aLbEndStyle.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- if( nPos == 0 )
- rXLSet.Put( XLineEndItem() );
- else
- rXLSet.Put( XLineEndItem( aLbEndStyle.GetSelectEntry(),
- pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) );
- }
-
- // #116827#
- nPos = maLBEdgeStyle.GetSelectEntryPos();
- if(LISTBOX_ENTRY_NOTFOUND != nPos)
- {
- switch(nPos)
- {
- case 0: // Rounded, default
- {
- rXLSet.Put(XLineJointItem(XLINEJOINT_ROUND));
- break;
- }
- case 1: // - none -
- {
- rXLSet.Put(XLineJointItem(XLINEJOINT_NONE));
- break;
- }
- case 2: // Miter
- {
- rXLSet.Put(XLineJointItem(XLINEJOINT_MITER));
- break;
- }
- case 3: // Bevel
- {
- rXLSet.Put(XLineJointItem(XLINEJOINT_BEVEL));
- break;
- }
- }
- }
-
- rXLSet.Put( XLineStartWidthItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ) );
- rXLSet.Put( XLineEndWidthItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ) );
-
- rXLSet.Put( XLineWidthItem( GetCoreValue( aMtrLineWidth, ePoolUnit ) ) );
- rXLSet.Put( XLineColorItem( aLbColor.GetSelectEntry(),
- aLbColor.GetSelectEntryColor() ) );
-
- // Linienenden zentriert
- if( aTsbCenterStart.GetState() == STATE_CHECK )
- rXLSet.Put( XLineStartCenterItem( TRUE ) );
- else if( aTsbCenterStart.GetState() == STATE_NOCHECK )
- rXLSet.Put( XLineStartCenterItem( FALSE ) );
-
- if( aTsbCenterEnd.GetState() == STATE_CHECK )
- rXLSet.Put( XLineEndCenterItem( TRUE ) );
- else if( aTsbCenterEnd.GetState() == STATE_NOCHECK )
- rXLSet.Put( XLineEndCenterItem( FALSE ) );
-
- // Transparenz
- UINT16 nVal = (UINT16)aMtrTransparent.GetValue();
- rXLSet.Put( XLineTransparenceItem( nVal ) );
-
- // #116827#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-
- return( TRUE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
-{
- String aString;
- XLineStyle eXLS; // XLINE_NONE, XLINE_SOLID, XLINE_DASH
-
- // Linienstil
-/*
- if( bObjSelected &&
- rAttrs.GetItemState( GetWhich( XATTR_LINESTYLE ) ) == SFX_ITEM_DEFAULT )
- {
- aLbLineStyle.Disable();
- }
-*/
- const SfxPoolItem *pPoolItem;
- long nSymType=SVX_SYMBOLTYPE_UNKNOWN;
- BOOL bPrevSym=FALSE;
- BOOL bEnable=TRUE;
- BOOL bIgnoreGraphic=FALSE;
- BOOL bIgnoreSize=FALSE;
- if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),TRUE,&pPoolItem) == SFX_ITEM_SET)
- {
- nSymType=((const SfxInt32Item *)pPoolItem)->GetValue();
- }
-
- if(nSymType == SVX_SYMBOLTYPE_AUTO)
- {
- aSymbolGraphic=aAutoSymbolGraphic;
- aSymbolSize=aSymbolLastSize=aAutoSymbolGraphic.GetPrefSize();
- bPrevSym=TRUE;
- }
- else if(nSymType == SVX_SYMBOLTYPE_NONE)
- {
- bEnable=FALSE;
- bIgnoreGraphic=TRUE;
- bIgnoreSize=TRUE;
- }
- else if(nSymType >= 0)
- {
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
-
- SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS);
- pModel->GetItemPool().FreezeIdRanges();
- SdrPage* pPage = new SdrPage( *pModel, FALSE );
- pPage->SetSize(Size(1000,1000));
- pModel->InsertPage( pPage, 0 );
- SdrView* pView = new SdrView( pModel, &aVDev );
- pView->hideMarkHandles();
- SdrPageView* pPageView = pView->ShowSdrPage(pPage);
-// SdrPageView* pPageView = pView->ShowSdrPage(pPage, Point());
- SdrObject *pObj=NULL;
- long nSymTmp=nSymType;
- if(pSymbolList)
- {
- if(pSymbolList->GetObjCount())
- {
- nSymTmp=nSymTmp%pSymbolList->GetObjCount(); //Liste wird als cyclisch betrachtet!!!
- pObj=pSymbolList->GetObj(nSymTmp);
- if(pObj)
- {
- pObj=pObj->Clone();
- pPage->NbcInsertObject(pObj);
- pView->MarkObj(pObj,pPageView);
- if(pSymbolAttr)
- {
- pObj->SetMergedItemSet(*pSymbolAttr);
- }
- else
- {
- pObj->SetMergedItemSet(rOutAttrs);
- }
- GDIMetaFile aMeta(pView->GetAllMarkedMetaFile());
-
- aSymbolGraphic=Graphic(aMeta);
- aSymbolSize=pObj->GetSnapRect().GetSize();
- aSymbolGraphic.SetPrefSize(aSymbolSize);
- aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM);
- bPrevSym=TRUE;
- bEnable=TRUE;
- bIgnoreGraphic=TRUE;
-
- pView->UnmarkAll();
- pObj=pPage->RemoveObject(0);
- SdrObject::Free( pObj );
- }
- }
- }
- delete pView;
- delete pModel;
- }
- if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH),TRUE,&pPoolItem) == SFX_ITEM_SET)
- {
- const Graphic* pGraphic = ((const SvxBrushItem *)pPoolItem)->GetGraphic();
- if( pGraphic )
- {
- if(!bIgnoreGraphic)
- {
- aSymbolGraphic=*pGraphic;
- }
- if(!bIgnoreSize)
- {
- aSymbolSize=OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
- pGraphic->GetPrefMapMode(),
- MAP_100TH_MM );
- }
- bPrevSym=TRUE;
- }
- }
- if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),TRUE,&pPoolItem) == SFX_ITEM_SET)
- {
- aSymbolSize = ((const SvxSizeItem *)pPoolItem)->GetSize();
- }
-
-
- aSymbolRatioCB.Enable(bEnable);
- aSymbolHeightFT.Enable(bEnable);
- aSymbolWidthFT.Enable(bEnable);
- aSymbolWidthMF.Enable(bEnable);
- aSymbolHeightMF.Enable(bEnable);
- if(bPrevSym)
- {
- SetMetricValue(aSymbolWidthMF, aSymbolSize.Width(), ePoolUnit);
- SetMetricValue(aSymbolHeightMF, aSymbolSize.Height(),ePoolUnit);
- aCtlPreview.SetSymbol(&aSymbolGraphic,aSymbolSize);
- aSymbolLastSize=aSymbolSize;
- }
-
- if( rAttrs.GetItemState( XATTR_LINESTYLE ) != SFX_ITEM_DONTCARE )
- {
- eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs.Get( XATTR_LINESTYLE ) ).GetValue();
-
- switch( eXLS )
- {
- case XLINE_NONE:
- aLbLineStyle.SelectEntryPos( 0 );
- break;
- case XLINE_SOLID:
- aLbLineStyle.SelectEntryPos( 1 );
- break;
-
- case XLINE_DASH:
- aLbLineStyle.SetNoSelection();
- aLbLineStyle.SelectEntry( ( ( const XLineDashItem& ) rAttrs.
- Get( XATTR_LINEDASH ) ).GetName() );
- break;
-
- default:
- break;
- }
- }
- else
- {
- aLbLineStyle.SetNoSelection();
- }
-
- // Linienstaerke
-/*
- if( bObjSelected &&
- rAttrs.GetItemState( GetWhich( XATTR_LINEWIDTH ) ) == SFX_ITEM_DEFAULT )
- {
- aMtrLineWidth.Disable();
- }
-*/
- if( rAttrs.GetItemState( XATTR_LINEWIDTH ) != SFX_ITEM_DONTCARE )
- {
- SetMetricValue( aMtrLineWidth, ( ( const XLineWidthItem& ) rAttrs.
- Get( XATTR_LINEWIDTH ) ).GetValue(), ePoolUnit );
- }
- else
- aMtrLineWidth.SetText( String() );
-
- // Linienfarbe
-/*
- if( bObjSelected &&
- rAttrs.GetItemState( GetWhich( XATTR_LINECOLOR ) ) == SFX_ITEM_DEFAULT )
- {
- aLbColor.Disable();
- }
-*/
- aLbColor.SetNoSelection();
-
- if ( rAttrs.GetItemState( XATTR_LINECOLOR ) != SFX_ITEM_DONTCARE )
- {
- Color aCol = ( ( const XLineColorItem& ) rAttrs.Get( XATTR_LINECOLOR ) ).GetColorValue();
- aLbColor.SelectEntry( aCol );
- if( aLbColor.GetSelectEntryCount() == 0 )
- {
- aLbColor.InsertEntry( aCol, String() );
- aLbColor.SelectEntry( aCol );
- }
- }
-
- // LinienAnfang
- if( bObjSelected &&
- rAttrs.GetItemState( XATTR_LINESTART ) == SFX_ITEM_DEFAULT )
- {
- aLbStartStyle.Disable();
- }
- else if( rAttrs.GetItemState( XATTR_LINESTART ) != SFX_ITEM_DONTCARE )
- {
- // #86265# select entry using list and polygon, not string
- sal_Bool bSelected(FALSE);
- const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineStartItem&)rAttrs.Get(XATTR_LINESTART)).GetLineStartValue();
-
- for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++)
- {
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd(a);
- const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
-
- if(rItemPolygon == rEntryPolygon)
- {
- // select this entry
- aLbStartStyle.SelectEntryPos((sal_uInt16)a + 1);
- bSelected = TRUE;
- }
- }
-
- if(!bSelected)
- aLbStartStyle.SelectEntryPos( 0 );
- }
- else
- {
- aLbStartStyle.SetNoSelection();
- }
-
- // LinienEnde
- if( bObjSelected &&
- rAttrs.GetItemState( XATTR_LINEEND ) == SFX_ITEM_DEFAULT )
- {
- aLbEndStyle.Disable();
- }
- else if( rAttrs.GetItemState( XATTR_LINEEND ) != SFX_ITEM_DONTCARE )
- {
- // #86265# select entry using list and polygon, not string
- sal_Bool bSelected(FALSE);
- const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineEndItem&)rAttrs.Get(XATTR_LINEEND)).GetLineEndValue();
-
- for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++)
- {
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd(a);
- const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
-
- if(rItemPolygon == rEntryPolygon)
- {
- // select this entry
- aLbEndStyle.SelectEntryPos((sal_uInt16)a + 1);
- bSelected = TRUE;
- }
- }
-
- if(!bSelected)
- aLbEndStyle.SelectEntryPos( 0 );
- }
- else
- {
- aLbEndStyle.SetNoSelection();
- }
-
- // LinienAnfang St"arke
- if( bObjSelected &&
- rAttrs.GetItemState( XATTR_LINESTARTWIDTH ) == SFX_ITEM_DEFAULT )
- {
- aMtrStartWidth.Disable();
- }
- else if( rAttrs.GetItemState( XATTR_LINESTARTWIDTH ) != SFX_ITEM_DONTCARE )
- {
- SetMetricValue( aMtrStartWidth, ( ( const XLineStartWidthItem& ) rAttrs.
- Get( XATTR_LINESTARTWIDTH ) ).GetValue(), ePoolUnit );
- }
- else
- aMtrStartWidth.SetText( String() );
-
- // LinienEnde St"arke
- if( bObjSelected &&
- rAttrs.GetItemState( XATTR_LINEENDWIDTH ) == SFX_ITEM_DEFAULT )
- {
- aMtrEndWidth.Disable();
- }
- else if( rAttrs.GetItemState( XATTR_LINEENDWIDTH ) != SFX_ITEM_DONTCARE )
- {
- SetMetricValue( aMtrEndWidth, ( ( const XLineEndWidthItem& ) rAttrs.
- Get( XATTR_LINEENDWIDTH ) ).GetValue(), ePoolUnit );
- }
- else
- aMtrEndWidth.SetText( String() );
-
- // Linienenden zentriert (Start)
- if( bObjSelected &&
- rAttrs.GetItemState( XATTR_LINESTARTCENTER ) == SFX_ITEM_DEFAULT )
- {
- aTsbCenterStart.Disable();
- }
- else if( rAttrs.GetItemState( XATTR_LINESTARTCENTER ) != SFX_ITEM_DONTCARE )
- {
- aTsbCenterStart.EnableTriState( FALSE );
-
- if( ( ( const XLineStartCenterItem& ) rAttrs.Get( XATTR_LINESTARTCENTER ) ).GetValue() )
- aTsbCenterStart.SetState( STATE_CHECK );
- else
- aTsbCenterStart.SetState( STATE_NOCHECK );
- }
- else
- {
- aTsbCenterStart.SetState( STATE_DONTKNOW );
- }
-
- // Linienenden zentriert (Ende)
- if( bObjSelected &&
- rAttrs.GetItemState( XATTR_LINEENDCENTER ) == SFX_ITEM_DEFAULT )
- {
- aTsbCenterEnd.Disable();
- }
- else if( rAttrs.GetItemState( XATTR_LINEENDCENTER ) != SFX_ITEM_DONTCARE )
- {
- aTsbCenterEnd.EnableTriState( FALSE );
-
- if( ( ( const XLineEndCenterItem& ) rAttrs.Get( XATTR_LINEENDCENTER ) ).GetValue() )
- aTsbCenterEnd.SetState( STATE_CHECK );
- else
- aTsbCenterEnd.SetState( STATE_NOCHECK );
- }
- else
- {
- aTsbCenterEnd.SetState( STATE_DONTKNOW );
- }
-
- // Transparenz
- if( rAttrs.GetItemState( XATTR_LINETRANSPARENCE ) != SFX_ITEM_DONTCARE )
- {
- USHORT nTransp = ( ( const XLineTransparenceItem& ) rAttrs.
- Get( XATTR_LINETRANSPARENCE ) ).GetValue();
- aMtrTransparent.SetValue( nTransp );
- ChangeTransparentHdl_Impl( NULL );
- }
- else
- aMtrTransparent.SetText( String() );
-
- if( !aLbStartStyle.IsEnabled() &&
- !aLbEndStyle.IsEnabled() &&
- !aMtrStartWidth.IsEnabled() &&
- !aMtrEndWidth.IsEnabled() &&
- !aTsbCenterStart.IsEnabled()&&
- !aTsbCenterEnd.IsEnabled() )
- {
- aCbxSynchronize.Disable();
- aFtLineEndsStyle.Disable();
- aFtLineEndsWidth.Disable();
- aFlLineEnds.Disable();
- }
-
- // Synchronisieren
- // Jetzt wird der Wert aus der INI-Datei geholt (#42258#)
- String aStr = GetUserData();
- aCbxSynchronize.Check( (BOOL)aStr.ToInt32() );
-
- // #116827#
- if(bObjSelected && SFX_ITEM_DEFAULT == rAttrs.GetItemState(XATTR_LINEJOINT))
- {
- maFTEdgeStyle.Disable();
- maLBEdgeStyle.Disable();
- }
- else if(SFX_ITEM_DONTCARE != rAttrs.GetItemState(XATTR_LINEJOINT))
- {
- XLineJoint eLineJoint = ((const XLineJointItem&)(rAttrs.Get(XATTR_LINEJOINT))).GetValue();
-
- switch(eLineJoint)
- {
- case XLINEJOINT_ROUND : maLBEdgeStyle.SelectEntryPos(0); break;
- case XLINEJOINT_NONE : maLBEdgeStyle.SelectEntryPos(1); break;
- case XLINEJOINT_MITER : maLBEdgeStyle.SelectEntryPos(2); break;
- case XLINEJOINT_BEVEL : maLBEdgeStyle.SelectEntryPos(3); break;
- case XLINEJOINT_MIDDLE : break;
- }
- }
- else
- {
- maLBEdgeStyle.SetNoSelection();
- }
-
- /*
- if( aLbStartStyle.GetSelectEntryPos() == aLbEndStyle.GetSelectEntryPos() &&
- aMtrStartWidth.GetValue() == aMtrEndWidth.GetValue() &&
- aTsbCenterStart.GetState() == aTsbCenterEnd.GetState() )
- {
- aCbxSynchronize.Check();
- }
- */
-
- // Werte sichern
- aLbLineStyle.SaveValue();
- aMtrLineWidth.SaveValue();
- aLbColor.SaveValue();
- aLbStartStyle.SaveValue();
- aLbEndStyle.SaveValue();
- aMtrStartWidth.SaveValue();
- aMtrEndWidth.SaveValue();
- aTsbCenterStart.SaveValue();
- aTsbCenterEnd.SaveValue();
- aMtrTransparent.SaveValue();
-
- // #116827#
- maLBEdgeStyle.SaveValue();
-
- ClickInvisibleHdl_Impl( this );
- //ClickMeasuringHdl_Impl( this );
- //aCtlPosition.Reset();
-
- ChangePreviewHdl_Impl( NULL );
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxLineTabPage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxLineTabPage( pWindow, rAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxLineTabPage::GetRanges()
-{
- return( pLineRanges );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl )
-{
- if(pCntrl == &aMtrLineWidth)
- {
- // Linienbreite und Start/EndBreite
- INT32 nNewLineWidth = GetCoreValue( aMtrLineWidth, ePoolUnit );
- if(nActLineWidth == -1)
- {
- // Noch nicht initialisiert, hole den Startwert
- const SfxPoolItem* pOld = GetOldItem( rXLSet, XATTR_LINEWIDTH );
- INT32 nStartLineWidth = 0;
- if(pOld)
- nStartLineWidth = (( const XLineWidthItem *)pOld)->GetValue();
- nActLineWidth = nStartLineWidth;
- }
-
- if(nActLineWidth != nNewLineWidth)
- {
- // Anpassungen Start/EndWidth #63083#
- INT32 nValAct = GetCoreValue( aMtrStartWidth, ePoolUnit );
- INT32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
- if(nValNew < 0)
- nValNew = 0;
- SetMetricValue( aMtrStartWidth, nValNew, ePoolUnit );
-
- nValAct = GetCoreValue( aMtrEndWidth, ePoolUnit );
- nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
- if(nValNew < 0)
- nValNew = 0;
- SetMetricValue( aMtrEndWidth, nValNew, ePoolUnit );
- }
-
- // Aktuellen Wert merken
- nActLineWidth = nNewLineWidth;
- }
-
- FillXLSet_Impl();
- aCtlPreview.Invalidate();
-
- // Transparenz entspr. zugaenglich machen
- if( aLbLineStyle.GetSelectEntryPos() == 0 ) // unsichtbar
- {
- aFtTransparent.Disable();
- aMtrTransparent.Disable();
- }
- else
- {
- aFtTransparent.Enable();
- aMtrTransparent.Enable();
- }
-
- const bool bHasLineStart = aLbStartStyle.GetSelectEntryPos() != 0;
- const bool bHasLineEnd = aLbEndStyle.GetSelectEntryPos() != 0;
-
- aFtLineEndsWidth.Enable( bHasLineStart || bHasLineEnd );
- aMtrStartWidth.Enable( bHasLineStart );
- aTsbCenterStart.Enable( bHasLineStart );
- aMtrEndWidth.Enable( bHasLineEnd );
- aTsbCenterEnd.Enable( bHasLineEnd );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p )
-{
- if( aCbxSynchronize.IsChecked() )
- {
- if( p == &aMtrStartWidth )
- aMtrEndWidth.SetValue( aMtrStartWidth.GetValue() );
- if( p == &aLbStartStyle )
- aLbEndStyle.SelectEntryPos( aLbStartStyle.GetSelectEntryPos() );
- if( p == &aTsbCenterStart )
- aTsbCenterEnd.SetState( aTsbCenterStart.GetState() );
- }
-
- ChangePreviewHdl_Impl( this );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-// #116827#
-
-IMPL_LINK( SvxLineTabPage, ChangeEdgeStyleHdl_Impl, void *, EMPTYARG )
-{
- ChangePreviewHdl_Impl( this );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG )
-{
- if( aLbLineStyle.GetSelectEntryPos() == 0 ) // unsichtbar
- {
- aFtColor.Disable();
- if(!bSymbols)
- aLbColor.Disable();
- aFtLineWidth.Disable();
- aMtrLineWidth.Disable();
-
- if( aFlLineEnds.IsEnabled() )
- {
- aFtLineEndsStyle.Disable();
- aFtLineEndsWidth.Disable();
- aLbStartStyle.Disable();
- aMtrStartWidth.Disable();
- aTsbCenterStart.Disable();
- aLbEndStyle.Disable();
- aMtrEndWidth.Disable();
- aTsbCenterEnd.Disable();
- aCbxSynchronize.Disable();
-
- // #116827#
- maFTEdgeStyle.Disable();
- maLBEdgeStyle.Disable();
- }
- }
- else
- {
- aFtColor.Enable();
- aLbColor.Enable();
- aFtLineWidth.Enable();
- aMtrLineWidth.Enable();
-
- if( aFlLineEnds.IsEnabled() )
- {
- aFtLineEndsStyle.Enable();
- aFtLineEndsWidth.Enable();
- aLbStartStyle.Enable();
- aMtrStartWidth.Enable();
- aTsbCenterStart.Enable();
- aLbEndStyle.Enable();
- aMtrEndWidth.Enable();
- aTsbCenterEnd.Enable();
- aCbxSynchronize.Enable();
-
- // #116827#
- maFTEdgeStyle.Enable();
- maLBEdgeStyle.Enable();
- }
- }
- ChangePreviewHdl_Impl( NULL );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p )
-{
- if( aCbxSynchronize.IsChecked() )
- {
- if( p == &aMtrEndWidth )
- aMtrStartWidth.SetValue( aMtrEndWidth.GetValue() );
- if( p == &aLbEndStyle )
- aLbStartStyle.SelectEntryPos( aLbEndStyle.GetSelectEntryPos() );
- if( p == &aTsbCenterEnd )
- aTsbCenterStart.SetState( aTsbCenterEnd.GetState() );
- }
-
- ChangePreviewHdl_Impl( this );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-/*
-
-long SvxLineTabPage::ClickMeasuringHdl_Impl( void* )
-{
- if( aTsbShowMeasuring.GetState() == STATE_NOCHECK )
- {
- aFtPosition.Disable();
- aCtlPosition.Disable();
- }
- else
- {
- aFtPosition.Enable();
- aCtlPosition.Enable();
- }
- aCtlPosition.Invalidate();
-
- return( 0L );
-}
-*/
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineTabPage, ChangeTransparentHdl_Impl, void *, EMPTYARG )
-{
- UINT16 nVal = (UINT16)aMtrTransparent.GetValue();
- XLineTransparenceItem aItem( nVal );
-
- rXLSet.Put( XLineTransparenceItem( aItem ) );
-
- // #116827#
- FillXLSet_Impl();
-
- aCtlPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxLineTabPage::PointChanged( Window*, RECT_POINT eRcPt )
-{
- eRP = eRcPt;
-}
-
-//------------------------------------------------------------------------
-
-void SvxLineTabPage::FillUserData()
-{
- // Abgleich wird in der Ini-Datei festgehalten
- UniString aStrUserData = UniString::CreateFromInt32( (sal_Int32) aCbxSynchronize.IsChecked() );
- SetUserData( aStrUserData );
-}
-
-
-//#58425# Symbole auf einer Linie (z.B. StarChart)
-//Handler f�r Popup-Menue der Symbolauswahl (NumMenueButton)
-//der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage
-IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
-{
- //Popup initialisieren
- if(!pButton->GetPopupMenu()->GetPopupMenu( MN_GALLERY ))
- {
- // Gallery-Eintraege besorgen
- GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
-
- PopupMenu* pPopup = new PopupMenu;
- String aEmptyStr;
- SfxObjectShell *pDocSh = SfxObjectShell::Current();
-
- nNumMenuGalleryItems=aGrfNames.Count();
- for(long i = 0; i < nNumMenuGalleryItems; i++)
- {
- const String* pGrfName = (const String*)aGrfNames.GetObject(i);
- const String* pUIName = pGrfName;
-
- // convert URL encodings to UI characters (eg %20 for spaces)
- String aPhysicalName;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *pGrfName, aPhysicalName ))
- pUIName = &aPhysicalName;
-
- SvxBrushItem* pBrushItem = new SvxBrushItem(*pGrfName, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH);
- pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl));
-
- SvxBmpItemInfo* pInfo = new SvxBmpItemInfo();
- pInfo->pBrushItem = pBrushItem;
- pInfo->nItemId = (UINT16)(MN_GALLERY_ENTRY + i);
- aGrfBrushItems.Insert(pInfo, i);
- const Graphic* pGraphic = pBrushItem->GetGraphic(pDocSh);
-
- if(pGraphic)
- {
- Bitmap aBitmap(pGraphic->GetBitmap());
- Size aSize(aBitmap.GetSizePixel());
- if(aSize.Width() > MAX_BMP_WIDTH ||
- aSize.Height() > MAX_BMP_HEIGHT)
- {
- BOOL bWidth = aSize.Width() > aSize.Height();
- double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
- aBitmap.Scale(nScale, nScale);
-
- }
- Image aImage(aBitmap);
- pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage );
- }
- else
- {
- Image aImage;
- pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage );
- }
- }
- aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup );
- if(!aGrfNames.Count())
- aSymbolMB.GetPopupMenu()->EnableItem(MN_GALLERY, FALSE);
- }
-
- if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList)
- {
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
- SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS);
- pModel->GetItemPool().FreezeIdRanges();
- // Page
- SdrPage* pPage = new SdrPage( *pModel, FALSE );
- pPage->SetSize(Size(1000,1000));
- pModel->InsertPage( pPage, 0 );
- // 3D View
- SdrView* pView = new SdrView( pModel, &aVDev );
- pView->hideMarkHandles();
-// SdrPageView* pPageView = pView->ShowSdrPage(pPage, Point());
- SdrPageView* pPageView = pView->ShowSdrPage(pPage);
-
- PopupMenu* pPopup = new PopupMenu;
- String aEmptyStr;
- for(long i=0;; ++i)
- {
- SdrObject *pObj=pSymbolList->GetObj(i);
- if(pObj==NULL)
- break;
- pObj=pObj->Clone();
- //const String* pGrfName = (const String*)aGrfNames.GetObject(i);
- String *pStr=new String();//String(i));
- aGrfNames.Insert(pStr,LIST_APPEND);
- //Rectangle aRect(pObj->GetLogicRect());
- pPage->NbcInsertObject(pObj);
- pView->MarkObj(pObj,pPageView);
- if(pSymbolAttr)
- {
- pObj->SetMergedItemSet(*pSymbolAttr);
- }
- else
- {
- pObj->SetMergedItemSet(rOutAttrs);
- }
-
- Bitmap aBitmap(pView->GetAllMarkedBitmap());
- GDIMetaFile aMeta(pView->GetAllMarkedMetaFile());
- pView->UnmarkAll();
- pObj=pPage->RemoveObject(0);
- SdrObject::Free(pObj);
-
- SvxBrushItem* pBrushItem = new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH);
- pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl));
-
- SvxBmpItemInfo* pInfo = new SvxBmpItemInfo();
- pInfo->pBrushItem = pBrushItem;
- pInfo->nItemId = (UINT16)(MN_GALLERY_ENTRY + i + nNumMenuGalleryItems);
- aGrfBrushItems.Insert(pInfo, nNumMenuGalleryItems + i);
-
- Size aSize(aBitmap.GetSizePixel());
- if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
- {
- BOOL bWidth = aSize.Width() > aSize.Height();
- double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
- aBitmap.Scale(nScale, nScale);
- }
- Image aImage(aBitmap);
- pPopup->InsertItem(pInfo->nItemId,*pStr,aImage);
- }
- aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS, pPopup );
- if(!aGrfNames.Count())
- aSymbolMB.GetPopupMenu()->EnableItem(MN_SYMBOLS, FALSE);
-
- delete pView;
- delete pModel;
- }
- return 0;
-}
-//#58425# Symbole auf einer Linie (z.B. StarChart)
-//Handler f�r Popup-Menue der Symbolauswahl (NumMenueButton)
-//der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage:
-IMPL_STATIC_LINK(SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem*, pItem)
-{
- PopupMenu* pPopup = pThis->aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY );
-
- SvxBmpItemInfo* pBmpInfo = 0;
- for ( USHORT i = 0; i < pThis->aGrfBrushItems.Count(); i++ )
- {
- SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)pThis->aGrfBrushItems.GetObject(i);
- if( pInfo->pBrushItem == pItem )
- {
- pBmpInfo = pInfo; break;
- }
- }
- if( pBmpInfo )
- {
- if( pItem->GetGraphic() )
- {
- Bitmap aBitmap(pItem->GetGraphic()->GetBitmap());
- Size aSize(aBitmap.GetSizePixel());
- if(aSize.Width() > MAX_BMP_WIDTH ||
- aSize.Height() > MAX_BMP_HEIGHT)
- {
- BOOL bWidth = aSize.Width() > aSize.Height();
- double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
- aBitmap.Scale(nScale, nScale);
- }
- Image aImage(aBitmap);
- pPopup->SetItemImage( pBmpInfo->nItemId, aImage );
- }
- }
-
- return 0;
-}
-
-//#58425# Symbole auf einer Linie (z.B. StarChart)
-//Handler f�r Menuebutton
-IMPL_LINK( SvxLineTabPage, GraphicHdl_Impl, MenuButton *, pButton )
-{
- USHORT nItemId = pButton->GetCurItemId();
- const Graphic* pGraphic = 0;
- Graphic aGraphic;
- String aGrfName;
- BOOL bResetSize = FALSE;
- BOOL bEnable=TRUE;
- long nPreviousSymbolType = nSymbolType;
-
- if(nItemId >= MN_GALLERY_ENTRY)
- {
- if( (nItemId-MN_GALLERY_ENTRY) >= nNumMenuGalleryItems)
- {
- nSymbolType=nItemId-MN_GALLERY_ENTRY-nNumMenuGalleryItems; //Index der Liste
- }
- else
- {
- nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM;
- bResetSize = TRUE;
- }
- SvxBmpItemInfo* pInfo = (SvxBmpItemInfo*)aGrfBrushItems.GetObject(nItemId - MN_GALLERY_ENTRY);
- pGraphic = pInfo->pBrushItem->GetGraphic();
- }
- else switch(nItemId)
- {
- case MN_SYMBOLS_AUTO:
- {
- pGraphic=&aAutoSymbolGraphic;
- aAutoSymbolGraphic.SetPrefSize( Size(253,253) );
- nSymbolType=SVX_SYMBOLTYPE_AUTO;
- }
- break;
-
- case MN_SYMBOLS_NONE:
- {
- nSymbolType=SVX_SYMBOLTYPE_NONE;
- pGraphic=NULL;
- bEnable=FALSE;
- }
- break;
- default:
- {
- SvxOpenGraphicDialog aGrfDlg(SVX_RES(RID_STR_EDIT_GRAPHIC));
- aGrfDlg.EnableLink(sal_False);
- aGrfDlg.AsLink(sal_False);
- if( !aGrfDlg.Execute() )
- {
- // ausgewaehlten Filter merken
- aGrfName = aGrfDlg.GetPath();
- if( !aGrfDlg.GetGraphic(aGraphic) )
- {
- nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM;
- pGraphic = &aGraphic;
- bResetSize = TRUE;
- }
- }
- if( !pGraphic )
- return 0;
- }
- break;
- }
-
- if(pGraphic)
- {
- Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic);
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)ePoolUnit);
- aSymbolGraphic=*pGraphic;
- if( bResetSize )
- {
- aSymbolSize=aSize;
- }
- else if( nPreviousSymbolType == SVX_SYMBOLTYPE_BRUSHITEM )
- { //#i31097# Data Point Symbol size changes when a different symbol is choosen(maoyg)
- if( aSymbolSize.Width() != aSymbolSize.Height() )
- {
- aSize.setWidth( (long)( aSymbolSize.Width() + aSymbolSize.Height() )/2 );
- aSize.setHeight( (long)( aSymbolSize.Width() + aSymbolSize.Height() )/2 );
- aSymbolSize = aSize;
- }
- }
- aCtlPreview.SetSymbol(&aSymbolGraphic,aSymbolSize);
- }
- else
- {
- aSymbolGraphic=Graphic();
- aCtlPreview.SetSymbol(NULL,aSymbolSize);
- bEnable=FALSE;
- }
- aSymbolLastSize=aSymbolSize;
- SetMetricValue(aSymbolWidthMF, aSymbolSize.Width(), ePoolUnit);
- SetMetricValue(aSymbolHeightMF, aSymbolSize.Height(), ePoolUnit);
- aSymbolRatioCB.Enable(bEnable);
- aSymbolHeightFT.Enable(bEnable);
- aSymbolWidthFT.Enable(bEnable);
- aSymbolWidthMF.Enable(bEnable);
- aSymbolHeightMF.Enable(bEnable);
- aCtlPreview.Invalidate();
-
- return 0;
-}
-IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, MetricField *, pField)
-{
- bNewSize=true;
- BOOL bWidth = (BOOL)(pField == &aSymbolWidthMF);
- bLastWidthModified = bWidth;
- BOOL bRatio = aSymbolRatioCB.IsChecked();
- long nWidthVal = static_cast<long>(aSymbolWidthMF.Denormalize(aSymbolWidthMF.GetValue(FUNIT_100TH_MM)));
- long nHeightVal= static_cast<long>(aSymbolHeightMF.Denormalize(aSymbolHeightMF.GetValue(FUNIT_100TH_MM)));
- nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MAP_100TH_MM,(MapUnit)ePoolUnit );
- nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MAP_100TH_MM,(MapUnit)ePoolUnit);
- aSymbolSize=Size(nWidthVal,nHeightVal);
- double fSizeRatio = (double)1;
-
- if(bRatio)
- {
- if (aSymbolLastSize.Height() && aSymbolLastSize.Width())
- fSizeRatio = (double)aSymbolLastSize.Width() / aSymbolLastSize.Height();
- }
-
- //Size aSymbolSize(aSymbolLastSize);
-
- if(bWidth)
- {
- long nDelta = nWidthVal - aSymbolLastSize.Width();
- aSymbolSize.Width() = nWidthVal;
- if (bRatio)
- {
- aSymbolSize.Height() = aSymbolLastSize.Height() + (long)((double)nDelta / fSizeRatio);
- aSymbolSize.Height() = OutputDevice::LogicToLogic( aSymbolSize.Height(),(MapUnit)ePoolUnit, MAP_100TH_MM );
- aSymbolHeightMF.SetUserValue(aSymbolHeightMF.Normalize(aSymbolSize.Height()), FUNIT_100TH_MM);
- }
- }
- else
- {
- long nDelta = nHeightVal - aSymbolLastSize.Height();
- aSymbolSize.Height() = nHeightVal;
- if (bRatio)
- {
- aSymbolSize.Width() = aSymbolLastSize.Width() + (long)((double)nDelta * fSizeRatio);
- aSymbolSize.Width() = OutputDevice::LogicToLogic( aSymbolSize.Width(),
- (MapUnit)ePoolUnit, MAP_100TH_MM );
- aSymbolWidthMF.SetUserValue(aSymbolWidthMF.Normalize(aSymbolSize.Width()), FUNIT_100TH_MM);
- }
- }
- aCtlPreview.ResizeSymbol(aSymbolSize);
- aSymbolLastSize=aSymbolSize;
- return 0;
-}
-IMPL_LINK( SvxLineTabPage, RatioHdl_Impl, CheckBox *, pBox )
-{
- if (pBox->IsChecked())
- {
- if (bLastWidthModified)
- SizeHdl_Impl(&aSymbolWidthMF);
- else
- SizeHdl_Impl(&aSymbolHeightMF);
- }
- return 0;
-}
-
-
-void SvxLineTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SvxTabPage::DataChanged( rDCEvt );
-
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- FillListboxes();
- }
-}
-
-void SvxLineTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDashListItem,SvxDashListItem,SID_DASH_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pLineEndListItem,SvxLineEndListItem,SID_LINEEND_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pSdrObjListItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pSymbolAttrItem,SfxTabDialogItem,SID_ATTR_SET,sal_False);
- SFX_ITEMSET_ARG (&aSet,pGraphicItem,SvxGraphicItem,SID_GRAPHIC,sal_False);
-
- if (pColorTabItem)
- SetColorTable(pColorTabItem->GetColorTable());
- if (pDashListItem)
- SetDashList(pDashListItem->GetDashList());
- if (pLineEndListItem)
- SetLineEndList(pLineEndListItem->GetLineEndList());
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- if (pDlgTypeItem)
- SetDlgType(pDlgTypeItem->GetValue());
- Construct();
-
- if(pSdrObjListItem) //symbols
- {
- ShowSymbolControls(TRUE);
- pSymbolList = static_cast<SdrObjList*>(pSdrObjListItem->GetValue());
- if (pSymbolAttrItem)
- pSymbolAttr = new SfxItemSet(pSymbolAttrItem->GetItemSet());
- if(pGraphicItem)
- aAutoSymbolGraphic = pGraphicItem->GetGraphic();
- }
-}
diff --git a/svx/source/cui/tplnedef.cxx b/svx/source/cui/tplnedef.cxx
deleted file mode 100644
index e370b4a8c8..0000000000
--- a/svx/source/cui/tplnedef.cxx
+++ /dev/null
@@ -1,1027 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tplnedef.cxx,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-#define _SVX_TPLNEDEF_CXX
-
-#include <svx/dialogs.hrc>
-#include "tabline.hrc"
-#include "dlgname.hrc"
-#include "helpid.hrc"
-
-
-
-
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/xtable.hxx>
-
-#include "drawitem.hxx"
-#include "cuitabline.hxx"
-#include "defdlgname.hxx" //CHINA001 #include "dlgname.hxx"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-
-#define DLGWIN this->GetParent()->GetParent()
-
-#define BITMAP_WIDTH 32
-#define BITMAP_HEIGHT 12
-#define XOUT_WIDTH 150
-
-/*************************************************************************
-|*
-|* Dialog zum Definieren von Linienstilen
-|*
-\************************************************************************/
-
-SvxLineDefTabPage::SvxLineDefTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_LINE_DEF ), rInAttrs ),
-
- aFlDefinition ( this, SVX_RES( FL_DEFINITION ) ),
- aFTLinestyle ( this, SVX_RES( FT_LINESTYLE ) ),
- aLbLineStyles ( this, SVX_RES( LB_LINESTYLES ) ),
- aFtType ( this, SVX_RES( FT_TYPE ) ),
- aLbType1 ( this, SVX_RES( LB_TYPE_1 ) ),
- aLbType2 ( this, SVX_RES( LB_TYPE_2 ) ),
- aFtNumber ( this, SVX_RES( FT_NUMBER ) ),
- aNumFldNumber1 ( this, SVX_RES( NUM_FLD_1 ) ),
- aNumFldNumber2 ( this, SVX_RES( NUM_FLD_2 ) ),
- aFtLength ( this, SVX_RES( FT_LENGTH ) ),
- aMtrLength1 ( this, SVX_RES( MTR_FLD_LENGTH_1 ) ),
- aMtrLength2 ( this, SVX_RES( MTR_FLD_LENGTH_2 ) ),
- aFtDistance ( this, SVX_RES( FT_DISTANCE ) ),
- aMtrDistance ( this, SVX_RES( MTR_FLD_DISTANCE ) ),
- aCbxSynchronize ( this, SVX_RES( CBX_SYNCHRONIZE ) ),
- aBtnAdd ( this, SVX_RES( BTN_ADD ) ),
- aBtnModify ( this, SVX_RES( BTN_MODIFY ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aBtnLoad ( this, SVX_RES( BTN_LOAD ) ),
- aBtnSave ( this, SVX_RES( BTN_SAVE ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
-
- rOutAttrs ( rInAttrs ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXLStyle ( XLINE_DASH ),
- aXWidth ( XOUT_WIDTH ),
- aXDash ( String(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ),
- aXColor ( String(), COL_BLACK ),
- aXLineAttr ( pXPool ),
- rXLSet ( aXLineAttr.GetItemSet() )
-{
- aBtnLoad.SetModeImage( Image( SVX_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnSave.SetModeImage( Image( SVX_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
-
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Metrik einstellen
- eFUnit = GetModuleFieldUnit( &rInAttrs );
-
- switch ( eFUnit )
- {
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ; //prevent warning
- }
- SetFieldUnit( aMtrDistance, eFUnit );
- SetFieldUnit( aMtrLength1, eFUnit );
- SetFieldUnit( aMtrLength2, eFUnit );
-
- // PoolUnit ermitteln
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool?" );
- ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH );
-
- rXLSet.Put( aXLStyle );
- rXLSet.Put( aXWidth );
- rXLSet.Put( aXDash );
- rXLSet.Put( aXColor );
-
- // #i34740#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-
- aBtnAdd.SetClickHdl( LINK( this, SvxLineDefTabPage, ClickAddHdl_Impl ) );
- aBtnModify.SetClickHdl(
- LINK( this, SvxLineDefTabPage, ClickModifyHdl_Impl ) );
- aBtnDelete.SetClickHdl(
- LINK( this, SvxLineDefTabPage, ClickDeleteHdl_Impl ) );
- aBtnLoad.SetClickHdl( LINK( this, SvxLineDefTabPage, ClickLoadHdl_Impl ) );
- aBtnSave.SetClickHdl( LINK( this, SvxLineDefTabPage, ClickSaveHdl_Impl ) );
-
- aNumFldNumber1.SetModifyHdl(
- LINK( this, SvxLineDefTabPage, ChangeNumber1Hdl_Impl ) );
- aNumFldNumber2.SetModifyHdl(
- LINK( this, SvxLineDefTabPage, ChangeNumber2Hdl_Impl ) );
- aLbLineStyles.SetSelectHdl(
- LINK( this, SvxLineDefTabPage, SelectLinestyleHdl_Impl ) );
-
- // Absolut (in mm) oder Relativ (in %)
- aCbxSynchronize.SetClickHdl(
- LINK( this, SvxLineDefTabPage, ChangeMetricHdl_Impl ) );
-
- // Wenn sich etwas aendert, muss Preview upgedatet werden werden
- Link aLink = LINK( this, SvxLineDefTabPage, SelectTypeHdl_Impl );
- aLbType1.SetSelectHdl( aLink );
- aLbType2.SetSelectHdl( aLink );
- aLink = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl );
- aMtrLength1.SetModifyHdl( aLink );
- aMtrLength2.SetModifyHdl( aLink );
- aMtrDistance.SetModifyHdl( aLink );
-
- pDashList = NULL;
-}
-
-
-// -----------------------------------------------------------------------
-
-void SvxLineDefTabPage::Construct()
-{
- // Linienstile
- aLbLineStyles.Fill( pDashList );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineDefTabPage::ActivatePage( const SfxItemSet& )
-{
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- // ActivatePage() wird aufgerufen bevor der Dialog PageCreated() erhaelt !!!
- if( pDashList )
- {
- if( *pPageType == 1 &&
- *pPosDashLb != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbLineStyles.SelectEntryPos( *pPosDashLb );
- }
- // Damit evtl. vorhandener Linestyle verworfen wird
- SelectLinestyleHdl_Impl( this );
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- INetURLObject aURL( pDashList->GetPath() );
-
- aURL.Append( pDashList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
-/* if ( aURL.getBase().Len() > 18 )
- {
- aString += aURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aURL.getBase();
-
- aFTLinestyle.SetText( aString );
-*/
- *pPageType = 0; // 2
- *pPosDashLb = LISTBOX_ENTRY_NOTFOUND;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxLineDefTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- CheckChanges_Impl();
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return( LEAVE_PAGE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineDefTabPage::CheckChanges_Impl()
-{
- // wird hier benutzt, um Aenderungen NICHT zu verlieren
- //XDashStyle eXDS;
-
- if( aNumFldNumber1.GetText() != aNumFldNumber1.GetSavedValue() ||
- aMtrLength1.GetText() != aMtrLength1.GetSavedValue() ||
- aLbType1.GetSelectEntryPos() != aLbType1.GetSavedValue() ||
- aNumFldNumber2.GetText() != aNumFldNumber2.GetSavedValue() ||
- aMtrLength2.GetText() != aMtrLength2.GetSavedValue() ||
- aLbType2.GetSelectEntryPos() != aLbType2.GetSavedValue() ||
- aMtrDistance.GetText() != aMtrDistance.GetSavedValue() )
- {
- ResMgr& rMgr = DIALOG_MGR();
- Image aWarningBoxImage = WarningBox::GetStandardImage();
- //CHINA001 SvxMessDialog aMessDlg( DLGWIN,
- //CHINA001 String( ResId( RID_SVXSTR_LINESTYLE, rMgr ) ),
- //CHINA001 String( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
- //CHINA001 &aWarningBoxImage );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX,
- String( ResId( RID_SVXSTR_LINESTYLE, rMgr ) ),
- String( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
- &aWarningBoxImage );
- DBG_ASSERT(aMessDlg, "Dialogdiet fail!");//CHINA001
- aMessDlg->SetButtonText( MESS_BTN_1, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_1,
- String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( MESS_BTN_2, //CHINA001 aMessDlg.SetButtonText( MESS_BTN_2,
- String( ResId( RID_SVXSTR_ADD, rMgr ) ) );
-
- short nRet = aMessDlg->Execute(); //CHINA001 short nRet = aMessDlg.Execute();
-
- switch( nRet )
- {
- case RET_BTN_1: // Aendern
- {
- ClickModifyHdl_Impl( this );
- //aXDash = pDashList->Get( nPos )->GetDash();
- }
- break;
-
- case RET_BTN_2: // Hinzufuegen
- {
- ClickAddHdl_Impl( this );
- //nPos = aLbLineStyles.GetSelectEntryPos();
- //aXDash = pDashList->Get( nPos )->GetDash();
- }
- break;
-
- case RET_CANCEL:
- break;
- // return( TRUE ); // Abbruch
- }
- delete aMessDlg; //add by CHINA001
- }
-
-
-
- USHORT nPos = aLbLineStyles.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- *pPosDashLb = nPos;
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxLineDefTabPage::FillItemSet( SfxItemSet& rAttrs )
-{
- if( *pDlgType == 0 ) // Linien-Dialog
- {
- if( *pPageType == 2 )
- {
- //CheckChanges_Impl();
-
- FillDash_Impl();
-
- String aString( aLbLineStyles.GetSelectEntry() );
- rAttrs.Put( XLineStyleItem( XLINE_DASH ) );
- rAttrs.Put( XLineDashItem( aString, aDash ) );
- }
- }
- return( TRUE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineDefTabPage::Reset( const SfxItemSet& rAttrs )
-{
- if( rAttrs.GetItemState( GetWhich( XATTR_LINESTYLE ) ) != SFX_ITEM_DONTCARE )
- {
- XLineStyle eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs.Get( GetWhich( XATTR_LINESTYLE ) ) ).GetValue();
-
- switch( eXLS )
- {
- case XLINE_NONE:
- case XLINE_SOLID:
- aLbLineStyles.SelectEntryPos( 0 );
- break;
-
- case XLINE_DASH:
- {
- const XLineDashItem& rDashItem = ( const XLineDashItem& ) rAttrs.Get( XATTR_LINEDASH );
- aDash = rDashItem.GetDashValue();
-
- aLbLineStyles.SetNoSelection();
- aLbLineStyles.SelectEntry( rDashItem.GetName() );
- }
- break;
-
- default:
- break;
- }
- }
- SelectLinestyleHdl_Impl( NULL );
-
- // Status der Buttons ermitteln
- if( pDashList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxLineDefTabPage::Create( Window* pWindow,
- const SfxItemSet& rOutAttrs )
-{
- return( new SvxLineDefTabPage( pWindow, rOutAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p )
-{
- if( pDashList->Count() > 0 )
- {
- int nTmp = aLbLineStyles.GetSelectEntryPos();
- if( nTmp == LISTBOX_ENTRY_NOTFOUND )
- {
- }
- else
- aDash = pDashList->GetDash( nTmp )->GetDash();
-
- FillDialog_Impl();
-
- rXLSet.Put( XLineDashItem( String(), aDash ) );
-
- // #i34740#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-
- aCtlPreview.Invalidate();
-
- // Wird erst hier gesetzt, um den Style nur dann zu uebernehmen,
- // wenn in der ListBox ein Eintrag ausgewaehlt wurde
- // Wenn ueber Reset() gerufen wurde ist p == NULL
- if( p )
- *pPageType = 2;
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxLineDefTabPage, ChangePreviewHdl_Impl, void *, EMPTYARG )
-{
- FillDash_Impl();
- aCtlPreview.Invalidate();
-
- return( 0L );
-}
-IMPL_LINK_INLINE_END( SvxLineDefTabPage, ChangePreviewHdl_Impl, void *, EMPTYARG )
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ChangeNumber1Hdl_Impl, void *, EMPTYARG )
-{
- if( aNumFldNumber1.GetValue() == 0L )
- {
- aNumFldNumber2.SetMin( 1L );
- aNumFldNumber2.SetFirst( 1L );
- }
- else
- {
- aNumFldNumber2.SetMin( 0L );
- aNumFldNumber2.SetFirst( 0L );
- }
-
- ChangePreviewHdl_Impl( this );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ChangeNumber2Hdl_Impl, void *, EMPTYARG )
-{
- if( aNumFldNumber2.GetValue() == 0L )
- {
- aNumFldNumber1.SetMin( 1L );
- aNumFldNumber1.SetFirst( 1L );
- }
- else
- {
- aNumFldNumber1.SetMin( 0L );
- aNumFldNumber1.SetFirst( 0L );
- }
-
- ChangePreviewHdl_Impl( this );
-
- return( 0L );
-}
-
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ChangeMetricHdl_Impl, void *, p )
-{
- if( !aCbxSynchronize.IsChecked() && aMtrLength1.GetUnit() != eFUnit )
- {
- long nTmp1, nTmp2, nTmp3;
-
- // Wurde ueber Control geaendert
- if( p )
- {
- nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit ) * XOUT_WIDTH / 100;
- nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit ) * XOUT_WIDTH / 100;
- nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit ) * XOUT_WIDTH / 100;
- }
- else
- {
- nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit );
- nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit );
- nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit );
- }
- aMtrLength1.SetDecimalDigits( 2 );
- aMtrLength2.SetDecimalDigits( 2 );
- aMtrDistance.SetDecimalDigits( 2 );
-
- // Metrik einstellen
- aMtrLength1.SetUnit( eFUnit );
- aMtrLength2.SetUnit( eFUnit );
- aMtrDistance.SetUnit( eFUnit );
-
- SetMetricValue( aMtrLength1, nTmp1, ePoolUnit );
- SetMetricValue( aMtrLength2, nTmp2, ePoolUnit );
- SetMetricValue( aMtrDistance, nTmp3, ePoolUnit );
- }
- else if( aCbxSynchronize.IsChecked() && aMtrLength1.GetUnit() != FUNIT_CUSTOM )
- {
- long nTmp1, nTmp2, nTmp3;
-
- // Wurde ueber Control geaendert
- if( p )
- {
- nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit ) * 100 / XOUT_WIDTH;
- nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit ) * 100 / XOUT_WIDTH;
- nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit ) * 100 / XOUT_WIDTH;
- }
- else
- {
- nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit );
- nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit );
- nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit );
- }
-
- aMtrLength1.SetDecimalDigits( 0 );
- aMtrLength2.SetDecimalDigits( 0 );
- aMtrDistance.SetDecimalDigits( 0 );
-
- aMtrLength1.SetUnit( FUNIT_CUSTOM );
- aMtrLength2.SetUnit( FUNIT_CUSTOM );
- aMtrDistance.SetUnit( FUNIT_CUSTOM );
-
-
- SetMetricValue( aMtrLength1, nTmp1, ePoolUnit );
- SetMetricValue( aMtrLength2, nTmp2, ePoolUnit );
- SetMetricValue( aMtrDistance, nTmp3, ePoolUnit );
- }
- SelectTypeHdl_Impl( NULL );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, SelectTypeHdl_Impl, void *, p )
-{
- if ( p == &aLbType1 || !p )
- {
- if ( aLbType1.GetSelectEntryPos() == 0 )
- {
- aMtrLength1.Disable();
- aMtrLength1.SetText( String() );
- }
- else if ( !aMtrLength1.IsEnabled() )
- {
- aMtrLength1.Enable();
- aMtrLength1.Reformat();
- }
- }
-
- if ( p == &aLbType2 || !p )
- {
- if ( aLbType2.GetSelectEntryPos() == 0 )
- {
- aMtrLength2.Disable();
- aMtrLength2.SetText( String() );
- }
- else if ( !aMtrLength2.IsEnabled() )
- {
- aMtrLength2.Enable();
- aMtrLength2.Reformat();
- }
- }
- ChangePreviewHdl_Impl( p );
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_LINESTYLE, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_LINESTYLE, rMgr ) );
- String aName;
- XDashEntry* pEntry;
-
- long nCount = pDashList->Count();
- long j = 1;
- BOOL bDifferent = FALSE;
-
- while ( !bDifferent )
- {
- aName = aNewName;
- aName += sal_Unicode(' ');
- aName += UniString::CreateFromInt32( j++ );
- bDifferent = TRUE;
-
- for ( long i = 0; i < nCount && bDifferent; i++ )
- if ( aName == pDashList->GetDash( i )->GetName() )
- bDifferent = FALSE;
- }
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- BOOL bLoop = TRUE;
-
- while ( bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pDashList->GetDash( i )->GetName() )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- {
- bLoop = FALSE;
- FillDash_Impl();
-
- pEntry = new XDashEntry( aDash, aName );
-
- long nDashCount = pDashList->Count();
- pDashList->Insert( pEntry, nDashCount );
- Bitmap* pBitmap = pDashList->GetBitmap( nDashCount );
- aLbLineStyles.Append( pEntry, pBitmap );
-
- aLbLineStyles.SelectEntryPos( aLbLineStyles.GetEntryCount() - 1 );
-
- // Flag fuer modifiziert setzen
- *pnDashListState |= CT_MODIFIED;
-
- *pPageType = 2;
-
- // Werte sichern fuer Changes-Erkennung ( -> Methode )
- aNumFldNumber1.SaveValue();
- aMtrLength1.SaveValue();
- aLbType1.SaveValue();
- aNumFldNumber2.SaveValue();
- aMtrLength2.SaveValue();
- aLbType2.SaveValue();
- aMtrDistance.SaveValue();
- }
- else
- {
- WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aBox.Execute();
- }
- }
- delete( pDlg );
-
- // Status der Buttons ermitteln
- if ( pDashList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbLineStyles.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_LINESTYLE, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_LINESTYLE, rMgr ) );
- String aName( pDashList->GetDash( nPos )->GetName() );
- String aOldName = aName;
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
-
- long nCount = pDashList->Count();
- BOOL bDifferent = FALSE;
- BOOL bLoop = TRUE;
-
- while ( bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pDashList->GetDash( i )->GetName() &&
- aName != aOldName )
- bDifferent = FALSE;
- }
-
- if ( bDifferent )
- {
- bLoop = FALSE;
- FillDash_Impl();
-
- XDashEntry* pEntry = new XDashEntry( aDash, aName );
-
- delete pDashList->Replace( pEntry, nPos );
- Bitmap* pBitmap = pDashList->GetBitmap( nPos );
- aLbLineStyles.Modify( pEntry, nPos, pBitmap );
-
- aLbLineStyles.SelectEntryPos( nPos );
-
- // Flag fuer modifiziert setzen
- *pnDashListState |= CT_MODIFIED;
-
- *pPageType = 2;
-
- // Werte sichern fuer Changes-Erkennung ( -> Methode )
- aNumFldNumber1.SaveValue();
- aMtrLength1.SaveValue();
- aLbType1.SaveValue();
- aNumFldNumber2.SaveValue();
- aMtrLength2.SaveValue();
- aLbType2.SaveValue();
- aMtrDistance.SaveValue();
- }
- else
- {
- WarningBox aBox( DLGWIN, WinBits( WB_OK ), String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aBox.Execute();
- }
- }
- delete( pDlg );
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbLineStyles.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
-//! SVX_RES( RID_SVXSTR_DEL_LINESTYLE ),
- String( SVX_RES( RID_SVXSTR_ASK_DEL_LINESTYLE ) ) );
-
- if ( aQueryBox.Execute() == RET_YES )
- {
- delete pDashList->Remove( nPos );
- aLbLineStyles.RemoveEntry( nPos );
- aLbLineStyles.SelectEntryPos( 0 );
-
- SelectLinestyleHdl_Impl( this );
- *pPageType = 0; // Style soll nicht uebernommen werden
-
- // Flag fuer modifiziert setzen
- *pnDashListState |= CT_MODIFIED;
-
- ChangePreviewHdl_Impl( this );
- }
- }
-
- // Status der Buttons ermitteln
- if ( !pDashList->Count() )
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return( 0L );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- USHORT nReturn = RET_YES;
-
- if ( *pnDashListState & CT_MODIFIED )
- {
- nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
- String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
-
- if ( nReturn == RET_YES )
- pDashList->Save();
- }
-
- if ( nReturn != RET_CANCEL )
- {
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sod" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- // Liste speichern
- XDashList* pDshLst = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pDshLst->SetName( aURL.getName() );
-
- if( pDshLst->Load() )
- {
- if( pDshLst )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pDashList != ( (SvxLineTabDialog*) DLGWIN )->GetDashList() )
- delete pDashList;
-
- pDashList = pDshLst;
- ( (SvxLineTabDialog*) DLGWIN )->SetNewDashList( pDashList );
-
- aLbLineStyles.Clear();
- aLbLineStyles.Fill( pDashList );
- Reset( rOutAttrs );
-
- pDashList->SetName( aURL.getName() );
-
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().Len() > 18 )
- {
- aString += aURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aURL.getBase();
-
- aGrpLinestyles.SetText( aString );
-*/
- // Flag fuer gewechselt setzen
- *pnDashListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnDashListState &= ~CT_MODIFIED;
- }
- }
- else
- //aIStream.Close();
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
- }
- }
-
- // Status der Buttons ermitteln
- if ( pDashList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return( 0L );
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLineDefTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
-{
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sod" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
-
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( pDashList->GetName().Len() )
- {
- aFile.Append( pDashList->GetName() );
-
- if( !aFile.getExtension().getLength() )
- aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sod" ) ) );
- }
-
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- pDashList->SetName( aURL.getName() );
- pDashList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( pDashList->Save() )
- {
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().Len() > 18 )
- {
- aString += aURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aURL.getBase();
-
- aGrpLinestyles.SetText( aString );
-*/
- // Flag fuer gespeichert setzen
- *pnDashListState |= CT_SAVED;
- // Flag fuer modifiziert entfernen
- *pnDashListState &= ~CT_MODIFIED;
- }
- else
- {
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( SVX_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute();
- }
- }
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxLineDefTabPage::FillDash_Impl()
-{
- XDashStyle eXDS;
-
-/* Alle Stile werden z.Z. nicht benutzt
- if( aRbtEnds1.IsChecked() )
- eXDS = XDASH_ROUND;
- else if( aRbtEnds2.IsChecked() )
- eXDS = XDASH_RECT;
- else
- eXDS = XDASH_RECT;
-*/
- if( aCbxSynchronize.IsChecked() )
- eXDS = XDASH_RECTRELATIVE;
- else
- eXDS = XDASH_RECT;
-
- aDash.SetDashStyle( eXDS );
- aDash.SetDots( (BYTE) aNumFldNumber1.GetValue() );
- aDash.SetDotLen( aLbType1.GetSelectEntryPos() == 0 ? 0 :
- GetCoreValue( aMtrLength1, ePoolUnit ) );
- aDash.SetDashes( (BYTE) aNumFldNumber2.GetValue() );
- aDash.SetDashLen( aLbType2.GetSelectEntryPos() == 0 ? 0 :
- GetCoreValue( aMtrLength2, ePoolUnit ) );
- aDash.SetDistance( GetCoreValue( aMtrDistance, ePoolUnit ) );
-
- rXLSet.Put( XLineDashItem( String(), aDash ) );
-
- // #i34740#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-}
-
-//------------------------------------------------------------------------
-
-void SvxLineDefTabPage::FillDialog_Impl()
-{
- XDashStyle eXDS = aDash.GetDashStyle(); // XDASH_RECT, XDASH_ROUND
- if( eXDS == XDASH_RECTRELATIVE )
- aCbxSynchronize.Check();
- else
- aCbxSynchronize.Check( FALSE );
-
- aNumFldNumber1.SetValue( aDash.GetDots() );
- //aMtrLength1.SetValue( aDash.GetDotLen() );
- SetMetricValue( aMtrLength1, aDash.GetDotLen(), ePoolUnit );
- aLbType1.SelectEntryPos( aDash.GetDotLen() == 0 ? 0 : 1 );
- aNumFldNumber2.SetValue( aDash.GetDashes() );
- //aMtrLength2.SetValue( aDash.GetDashLen() );
- SetMetricValue( aMtrLength2, aDash.GetDashLen(), ePoolUnit );
- aLbType2.SelectEntryPos( aDash.GetDashLen() == 0 ? 0 : 1 );
- //aMtrDistance.SetValue( aDash.GetDistance() );
- SetMetricValue( aMtrDistance, aDash.GetDistance(), ePoolUnit );
-
- ChangeMetricHdl_Impl( NULL );
-
- // Werte sichern fuer Changes-Erkennung ( -> Methode )
- aNumFldNumber1.SaveValue();
- aMtrLength1.SaveValue();
- aLbType1.SaveValue();
- aNumFldNumber2.SaveValue();
- aMtrLength2.SaveValue();
- aLbType2.SaveValue();
- aMtrDistance.SaveValue();
-}
-
-
-void SvxLineDefTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxTabPage::DataChanged( rDCEvt );
-
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- USHORT nOldSelect = aLbLineStyles.GetSelectEntryPos();
- aLbLineStyles.Clear();
- aLbLineStyles.Fill( pDashList );
- aLbLineStyles.SelectEntryPos( nOldSelect );
- }
-}
-
diff --git a/svx/source/cui/tplneend.cxx b/svx/source/cui/tplneend.cxx
deleted file mode 100644
index e30e5b9e8d..0000000000
--- a/svx/source/cui/tplneend.cxx
+++ /dev/null
@@ -1,762 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tplneend.cxx,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <tools/urlobj.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/pathoptions.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/filedlghelper.hxx>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-
-#define _SVX_TPLNEEND_CXX
-
-#include <svx/dialogs.hrc>
-#include "dlgname.hrc"
-#include "tabline.hrc"
-#include "helpid.hrc"
-
-
-
-
-#include <svx/svdobj.hxx>
-#include <svx/svdopath.hxx>
-#include "drawitem.hxx"
-#include <svx/xpool.hxx>
-#include <svx/xtable.hxx>
-#include "cuitabline.hxx"
-//CHINA001 #include "dlgname.hxx"
-#include <svx/svxdlg.hxx> //CHINA001
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <basegfx/range/b2drange.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolypolygontools.hxx>
-
-#define DLGWIN this->GetParent()->GetParent()
-
-#define BITMAP_WIDTH 32
-#define BITMAP_HEIGHT 12
-#define XOUT_WIDTH 150
-
-/*************************************************************************
-|*
-|* Dialog zum Definieren von Linienenden-Stilen
-|*
-\************************************************************************/
-
-SvxLineEndDefTabPage::SvxLineEndDefTabPage
-(
- Window* pParent,
- const SfxItemSet& rInAttrs
-) :
-
- SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_LINEEND_DEF ), rInAttrs ),
-
- aFlTip ( this, SVX_RES( FL_TIP ) ),
- aFTTitle ( this, SVX_RES( FT_TITLE ) ),
- aEdtName ( this, SVX_RES( EDT_NAME ) ),
- aFTLineEndStyle ( this, SVX_RES( FT_LINE_END_STYLE ) ),
- aLbLineEnds ( this, SVX_RES( LB_LINEENDS ) ),
- aBtnAdd ( this, SVX_RES( BTN_ADD ) ),
- aBtnModify ( this, SVX_RES( BTN_MODIFY ) ),
- aBtnDelete ( this, SVX_RES( BTN_DELETE ) ),
- aBtnLoad ( this, SVX_RES( BTN_LOAD ) ),
- aBtnSave ( this, SVX_RES( BTN_SAVE ) ),
- aFiTip ( this, SVX_RES( FI_TIP ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
-
- rOutAttrs ( rInAttrs ),
- pPolyObj( NULL ),
-
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXLStyle ( XLINE_SOLID ),
- aXWidth ( XOUT_WIDTH ),
- aXColor ( String(), COL_BLACK ),
- aXLineAttr ( pXPool ),
- rXLSet ( aXLineAttr.GetItemSet() ),
- pLineEndList( NULL )
-{
- aBtnLoad.SetModeImage( Image( SVX_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
- aBtnSave.SetModeImage( Image( SVX_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
-
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- rXLSet.Put( aXLStyle );
- rXLSet.Put( aXWidth );
- rXLSet.Put( aXColor );
- rXLSet.Put( XLineStartWidthItem( aCtlPreview.GetOutputSize().Height() / 2 ) );
- rXLSet.Put( XLineEndWidthItem( aCtlPreview.GetOutputSize().Height() / 2 ) );
-
- // #i34740#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-
- aBtnAdd.SetClickHdl(
- LINK( this, SvxLineEndDefTabPage, ClickAddHdl_Impl ) );
- aBtnModify.SetClickHdl(
- LINK( this, SvxLineEndDefTabPage, ClickModifyHdl_Impl ) );
- aBtnDelete.SetClickHdl(
- LINK( this, SvxLineEndDefTabPage, ClickDeleteHdl_Impl ) );
- aBtnLoad.SetClickHdl(
- LINK( this, SvxLineEndDefTabPage, ClickLoadHdl_Impl ) );
- aBtnSave.SetClickHdl(
- LINK( this, SvxLineEndDefTabPage, ClickSaveHdl_Impl ) );
-
- aLbLineEnds.SetSelectHdl(
- LINK( this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl ) );
-
-}
-
-//------------------------------------------------------------------------
-
-SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineEndDefTabPage::Construct()
-{
- aLbLineEnds.Fill( pLineEndList );
-
- bool bCreateArrowPossible = true;
-
- if( !pPolyObj )
- {
- bCreateArrowPossible = false;
- }
- else if( !pPolyObj->ISA( SdrPathObj ) )
- {
- SdrObjTransformInfoRec aInfoRec;
- pPolyObj->TakeObjInfo( aInfoRec );
- SdrObject* pNewObj = 0;
- if( aInfoRec.bCanConvToPath )
- pNewObj = pPolyObj->ConvertToPolyObj( TRUE, FALSE );
-
- bCreateArrowPossible = pNewObj && pNewObj->ISA( SdrPathObj );
- SdrObject::Free( pNewObj );
- }
-
- if( !bCreateArrowPossible )
- aBtnAdd.Disable();
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& )
-{
- if( *pDlgType == 0 ) // Flaechen-Dialog
- {
- // ActivatePage() wird aufgerufen bevor der Dialog PageCreated() erhaelt !!!
- if( pLineEndList )
- {
- if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND )
- {
- aLbLineEnds.SelectEntryPos( *pPosLineEndLb );
- SelectLineEndHdl_Impl( this );
- }
- INetURLObject aURL( pLineEndList->GetPath() );
-
- aURL.Append( pLineEndList->GetName() );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().Len() > 18 )
- {
- aString += aURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aURL.getBase();
-
- aGrpLineEnds.SetText( aString );
-*/
- *pPageType = 0; // 3
- *pPosLineEndLb = LISTBOX_ENTRY_NOTFOUND;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxLineEndDefTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- CheckChanges_Impl();
-
- if( _pSet )
- FillItemSet( *_pSet );
-
- return( LEAVE_PAGE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineEndDefTabPage::CheckChanges_Impl()
-{
- USHORT nPos = aLbLineEnds.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- String aString = aEdtName.GetText();
-
- if( aString != aLbLineEnds.GetSelectEntry() )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
-//! SVX_RES( RID_SVXSTR_LINEEND ),
- String( SVX_RES( RID_SVXSTR_ASK_CHANGE_LINEEND ) ) );
-
- if ( aQueryBox.Execute() == RET_YES )
- ClickModifyHdl_Impl( this );
- }
- }
- nPos = aLbLineEnds.GetSelectEntryPos();
-
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- *pPosLineEndLb = nPos;
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxLineEndDefTabPage::FillItemSet( SfxItemSet& rSet )
-{
- if( *pDlgType == 0 ) // Linien-Dialog
- {
- if( *pPageType == 3 )
- {
- CheckChanges_Impl();
-
- long nPos = aLbLineEnds.GetSelectEntryPos();
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
-
- rSet.Put( XLineStartItem( pEntry->GetName(), pEntry->GetLineEnd() ) );
- rSet.Put( XLineEndItem( pEntry->GetName(), pEntry->GetLineEnd() ) );
- }
- }
- return( TRUE );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLineEndDefTabPage::Reset( const SfxItemSet& )
-{
- aLbLineEnds.SelectEntryPos( 0 );
-
- // Update lineend
- if( pLineEndList->Count() > 0 )
- {
- int nPos = aLbLineEnds.GetSelectEntryPos();
-
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
-
- aEdtName.SetText( aLbLineEnds.GetSelectEntry() );
-
- rXLSet.Put( XLineStartItem( String(), pEntry->GetLineEnd() ) );
- rXLSet.Put( XLineEndItem( String(), pEntry->GetLineEnd() ) );
-
- // #i34740#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-
- aCtlPreview.Invalidate();
- }
-
- // Status der Buttons ermitteln
- if( pLineEndList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxLineEndDefTabPage::Create( Window* pWindow,
- const SfxItemSet& rSet )
-{
- return( new SvxLineEndDefTabPage( pWindow, rSet ) );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineEndDefTabPage, SelectLineEndHdl_Impl, void *, EMPTYARG )
-{
- if( pLineEndList->Count() > 0 )
- {
- int nPos = aLbLineEnds.GetSelectEntryPos();
-
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
-
- aEdtName.SetText( aLbLineEnds.GetSelectEntry() );
-
- rXLSet.Put( XLineStartItem( String(), pEntry->GetLineEnd() ) );
- rXLSet.Put( XLineEndItem( String(), pEntry->GetLineEnd() ) );
-
- // #i34740#
- aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
-
- aCtlPreview.Invalidate();
-
- // Wird erst hier gesetzt, um den Style nur dann zu uebernehmen,
- // wenn in der ListBox ein Eintrag ausgewaehlt wurde
- *pPageType = 3;
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-long SvxLineEndDefTabPage::ChangePreviewHdl_Impl( void* )
-{
- aCtlPreview.Invalidate();
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineEndDefTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbLineEnds.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- ResMgr& rMgr = DIALOG_MGR();
- String aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) );
- String aName( aEdtName.GetText() );
- long nCount = pLineEndList->Count();
- BOOL bDifferent = TRUE;
-
- // Pruefen, ob Name schon vorhanden ist
- for ( long i = 0; i < nCount && bDifferent; i++ )
- if ( aName == pLineEndList->GetLineEnd( i )->GetName() )
- bDifferent = FALSE;
-
- // Wenn ja, wird wiederholt ein neuer Name angefordert
- if ( !bDifferent )
- {
- WarningBox aWarningBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aWarningBox.Execute();
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- BOOL bLoop = TRUE;
-
- while( !bDifferent && bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pLineEndList->GetLineEnd( i )->GetName() )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- bLoop = FALSE;
- else
- aWarningBox.Execute();
- }
- delete( pDlg );
- }
-
- // Wenn nicht vorhanden, wird Eintrag aufgenommen
- if( bDifferent )
- {
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
-
- pEntry->SetName( aName );
- aEdtName.SetText( aName );
-
- aLbLineEnds.Modify( pEntry, nPos, pLineEndList->GetBitmap( nPos ) );
- aLbLineEnds.SelectEntryPos( nPos );
-
- // Flag fuer modifiziert setzen
- *pnLineEndListState |= CT_MODIFIED;
-
- *pPageType = 3;
- }
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineEndDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-{
- if( pPolyObj )
- {
- const SdrObject* pNewObj;
- SdrObject* pConvPolyObj = NULL;
-
- if( pPolyObj->ISA( SdrPathObj ) )
- {
- pNewObj = pPolyObj;
- }
- else
- {
- SdrObjTransformInfoRec aInfoRec;
- pPolyObj->TakeObjInfo( aInfoRec );
-
- if( aInfoRec.bCanConvToPath )
- {
- pNewObj = pConvPolyObj = pPolyObj->ConvertToPolyObj( TRUE, FALSE );
-
- if( !pNewObj || !pNewObj->ISA( SdrPathObj ) )
- return( 0L ); // Abbruch, zusaetzliche Sicherheit, die bei
- // Gruppenobjekten aber nichts bringt.
- }
- else return( 0L ); // Abbruch
- }
-
- basegfx::B2DPolyPolygon aNewPolyPolygon(((SdrPathObj*)pNewObj)->GetPathPoly());
- basegfx::B2DRange aNewRange(basegfx::tools::getRange(aNewPolyPolygon));
-
- // Normalisieren
- basegfx::B2DHomMatrix aMatrix;
- aMatrix.translate(-aNewRange.getMinX(), -aNewRange.getMinY());
- aNewPolyPolygon.transform(aMatrix);
-
- // Loeschen des angelegten PolyObjektes
- SdrObject::Free( pConvPolyObj );
-
- XLineEndEntry* pEntry;
-
- ResMgr& rMgr = DIALOG_MGR();
- String aNewName( ResId( RID_SVXSTR_LINEEND, rMgr ) );
- String aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) );
- String aName;
-
- long nCount = pLineEndList->Count();
- long j = 1;
- BOOL bDifferent = FALSE;
-
- while ( !bDifferent )
- {
- aName = aNewName;
- aName += sal_Unicode(' ');
- aName += UniString::CreateFromInt32( j++ );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- if ( aName == pLineEndList->GetLineEnd( i )->GetName() )
- bDifferent = FALSE;
- }
-
- //CHINA001 SvxNameDialog* pDlg = new SvxNameDialog( DLGWIN, aName, aDesc );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc, RID_SVXDLG_NAME );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- BOOL bLoop = TRUE;
-
- while ( bLoop && pDlg->Execute() == RET_OK )
- {
- pDlg->GetName( aName );
- bDifferent = TRUE;
-
- for( long i = 0; i < nCount && bDifferent; i++ )
- {
- if( aName == pLineEndList->GetLineEnd( i )->GetName() )
- bDifferent = FALSE;
- }
-
- if( bDifferent )
- {
- bLoop = FALSE;
- pEntry = new XLineEndEntry( aNewPolyPolygon, aName );
-
- long nLineEndCount = pLineEndList->Count();
- pLineEndList->Insert( pEntry, nLineEndCount );
- Bitmap* pBitmap = pLineEndList->GetBitmap( nLineEndCount );
-
- // Zur ListBox hinzufuegen
- aLbLineEnds.Append( pEntry, pBitmap );
- aLbLineEnds.SelectEntryPos( aLbLineEnds.GetEntryCount() - 1 );
-
- // Flag fuer modifiziert setzen
- *pnLineEndListState |= CT_MODIFIED;
-
- SelectLineEndHdl_Impl( this );
- }
- else
- {
- WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
- aBox.Execute();
- }
- }
- delete pDlg;
- }
- else
- aBtnAdd.Disable();
-
- // Status der Buttons ermitteln
- if ( pLineEndList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineEndDefTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
-{
- USHORT nPos = aLbLineEnds.GetSelectEntryPos();
-
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ),
-//! SVX_RES( RID_SVXSTR_DEL_LINEEND ),
- String( SVX_RES( RID_SVXSTR_ASK_DEL_LINEEND ) ) );
-
- if ( aQueryBox.Execute() == RET_YES )
- {
- delete pLineEndList->Remove( nPos );
- aLbLineEnds.RemoveEntry( nPos );
- aLbLineEnds.SelectEntryPos( 0 );
-
- SelectLineEndHdl_Impl( this );
- *pPageType = 0; // LineEnd soll nicht uebernommen werden
-
- // Flag fuer modifiziert setzen
- *pnLineEndListState |= CT_MODIFIED;
-
- ChangePreviewHdl_Impl( this );
- }
- }
- // Status der Buttons ermitteln
- if( !pLineEndList->Count() )
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineEndDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
-{
- ResMgr& rMgr = DIALOG_MGR();
- USHORT nReturn = RET_YES;
-
- if ( *pnLineEndListState & CT_MODIFIED )
- {
- nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ),
- String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute();
-
- if ( nReturn == RET_YES )
- pLineEndList->Save();
- }
-
- if ( nReturn != RET_CANCEL )
- {
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soe" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- // Liste speichern
- XLineEndList* pLeList = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pLeList->SetName( aURL.getName() );
- if( pLeList->Load() )
- {
- if( pLeList )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pLineEndList != ( (SvxLineTabDialog*) DLGWIN )->GetLineEndList() )
- delete pLineEndList;
-
- pLineEndList = pLeList;
- ( (SvxLineTabDialog*) DLGWIN )->SetNewLineEndList( pLineEndList );
- aLbLineEnds.Clear();
- aLbLineEnds.Fill( pLineEndList );
- Reset( rOutAttrs );
-
- pLineEndList->SetName( aURL.getName() );
-
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- if( aURL.getBase().Len() > 18 )
- {
- aString += aURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aURL.getBase();
-
- aGrpLineEnds.SetText( aString );
-*/
- // Flag fuer gewechselt setzen
- *pnLineEndListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnLineEndListState &= ~CT_MODIFIED;
- }
- }
- else
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute();
- }
- }
-
- // Status der Buttons ermitteln
- if ( pLineEndList->Count() )
- {
- aBtnModify.Enable();
- aBtnDelete.Enable();
- aBtnSave.Enable();
- }
- else
- {
- aBtnModify.Disable();
- aBtnDelete.Disable();
- aBtnSave.Disable();
- }
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxLineEndDefTabPage, ClickSaveHdl_Impl, void *, EMPTYARG )
-{
- ::sfx2::FileDialogHelper aDlg(
- com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 );
- String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soe" ) );
- aDlg.AddFilter( aStrFilterType, aStrFilterType );
-
- INetURLObject aFile( SvtPathOptions().GetPalettePath() );
- DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- if( pLineEndList->GetName().Len() )
- {
- aFile.Append( pLineEndList->GetName() );
-
- if( !aFile.getExtension().getLength() )
- aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soe" ) ) );
- }
-
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
- if ( aDlg.Execute() == ERRCODE_NONE )
- {
- INetURLObject aURL( aDlg.GetPath() );
- INetURLObject aPathURL( aURL );
-
- aPathURL.removeSegment();
- aPathURL.removeFinalSlash();
-
- pLineEndList->SetName( aURL.getName() );
- pLineEndList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if( pLineEndList->Save() )
- {
-/* // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( SVX_RES( RID_SVXSTR_TABLE ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().Len() > 18 )
- {
- aString += aURL.getBase().Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += aURL.getBase();
- aGrpLineEnds.SetText( aString );
-*/
- // Flag fuer gespeichert setzen
- *pnLineEndListState |= CT_SAVED;
- // Flag fuer modifiziert entfernen
- *pnLineEndListState &= ~CT_MODIFIED;
- }
- else
- {
- ErrorBox( DLGWIN, WinBits( WB_OK ),
- String( SVX_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute();
- }
- }
- return( 0L );
-}
-
-void SvxLineEndDefTabPage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxTabPage::DataChanged( rDCEvt );
-
- if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- {
- USHORT nOldSelect = aLbLineEnds.GetSelectEntryPos();
- aLbLineEnds.Clear();
- aLbLineEnds.Fill( pLineEndList );
- aLbLineEnds.SelectEntryPos( nOldSelect );
- }
-}
-
diff --git a/svx/source/cui/tpshadow.cxx b/svx/source/cui/tpshadow.cxx
deleted file mode 100644
index 2ff6d10fb3..0000000000
--- a/svx/source/cui/tpshadow.cxx
+++ /dev/null
@@ -1,620 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tpshadow.cxx,v $
- * $Revision: 1.20 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <tools/shl.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/module.hxx>
-
-#define _SVX_TPSHADOW_CXX
-
-#include "xattr.hxx"
-#include <svx/xpool.hxx>
-#include <svx/dialogs.hrc>
-#include "tabarea.hrc"
-
-
-
-#include <svx/svdattr.hxx>
-
-#include "drawitem.hxx"
-#include "cuitabarea.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <cuitabline.hxx>
-
-#include <svx/xlineit0.hxx>
-#include <sfx2/request.hxx> //add CHINA001
-
-#define DLGWIN this->GetParent()->GetParent()
-
-// static ----------------------------------------------------------------
-
-static USHORT pShadowRanges[] =
-{
- SDRATTR_SHADOWCOLOR,
- SDRATTR_SHADOWTRANSPARENCE,
- SID_ATTR_FILL_SHADOW,
- SID_ATTR_FILL_SHADOW,
- 0
-};
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern des Schattens
-|*
-\************************************************************************/
-
-SvxShadowTabPage::SvxShadowTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
-
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_SHADOW ), rInAttrs ),
-
- aFlProp ( this, SVX_RES( FL_PROP ) ),
- aTsbShowShadow ( this, SVX_RES( TSB_SHOW_SHADOW ) ),
- aFtPosition ( this, SVX_RES( FT_POSITION ) ),
- aCtlPosition ( this, SVX_RES( CTL_POSITION ) ),
- aFtDistance ( this, SVX_RES( FT_DISTANCE ) ),
- aMtrDistance ( this, SVX_RES( MTR_FLD_DISTANCE ) ),
- aFtShadowColor ( this, SVX_RES( FT_SHADOW_COLOR ) ),
- aLbShadowColor ( this, SVX_RES( LB_SHADOW_COLOR ) ),
- aFtTransparent ( this, SVX_RES( FT_TRANSPARENT ) ),
- aMtrTransparent ( this, SVX_RES( MTR_SHADOW_TRANSPARENT ) ),
- aCtlXRectPreview ( this, SVX_RES( CTL_COLOR_PREVIEW ) ),
- rOutAttrs ( rInAttrs ),
- pColorTab( NULL ),
- bDisable ( FALSE ),
- pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
- aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() )
-{
- FreeResource();
-
- // diese Page braucht ExchangeSupport
- SetExchangeSupport();
-
- // Metrik einstellen
- FieldUnit eFUnit = GetModuleFieldUnit( &rInAttrs );
-
- switch ( eFUnit )
- {
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
- break;
- default: ;//prevent warning
- }
- SetFieldUnit( aMtrDistance, eFUnit );
-
- // PoolUnit ermitteln
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "Wo ist der Pool?" );
- ePoolUnit = pPool->GetMetric( SDRATTR_SHADOWXDIST );
-
- // Setzen des Output-Devices
- XFillStyle eXFS = XFILL_SOLID;
- if( rOutAttrs.GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DONTCARE )
- {
- eXFS = (XFillStyle) ( ( ( const XFillStyleItem& ) rOutAttrs.
- Get( GetWhich( XATTR_FILLSTYLE ) ) ).GetValue() );
- switch( eXFS )
- {
- //case XFILL_NONE: --> NICHTS
-
- case XFILL_SOLID:
- if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )
- {
- XFillColorItem aColorItem( ( const XFillColorItem& )
- rOutAttrs.Get( XATTR_FILLCOLOR ) );
- rXFSet.Put( aColorItem );
- }
- break;
-
- case XFILL_GRADIENT:
- if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLGRADIENT ) )
- {
- XFillGradientItem aGradientItem( ( ( const XFillGradientItem& )
- rOutAttrs.Get( XATTR_FILLGRADIENT ) ) );
- rXFSet.Put( aGradientItem );
- }
- break;
-
- case XFILL_HATCH:
- if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLHATCH ) )
- {
- XFillHatchItem aHatchItem( ( ( const XFillHatchItem& )
- rOutAttrs.Get( XATTR_FILLHATCH ) ) );
- rXFSet.Put( aHatchItem );
- }
- break;
-
- case XFILL_BITMAP:
- {
- if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLBITMAP ) )
- {
- XFillBitmapItem aBitmapItem( ( const XFillBitmapItem& )
- rOutAttrs.Get( XATTR_FILLBITMAP ) );
- rXFSet.Put( aBitmapItem );
- }
- }
- break;
- case XFILL_NONE : break;
- }
- }
- else
- {
- rXFSet.Put( XFillColorItem( String(), COL_LIGHTRED ) );
- }
-
- if(XFILL_NONE == eXFS)
- {
- // #i96350#
- // fallback to solid fillmode when no fill mode is provided to have
- // a reasonable shadow preview. The used color will be a set one or
- // the default (currently blue8)
- eXFS = XFILL_SOLID;
- }
-
- rXFSet.Put( XFillStyleItem( eXFS ) );
- aCtlXRectPreview.SetRectangleAttributes(aXFillAttr.GetItemSet());
- //aCtlXRectPreview.SetFillAttr( aXFillAttr );
-
- aTsbShowShadow.SetClickHdl( LINK( this, SvxShadowTabPage, ClickShadowHdl_Impl ) );
- Link aLink = LINK( this, SvxShadowTabPage, ModifyShadowHdl_Impl );
- aLbShadowColor.SetSelectHdl( aLink );
- aMtrTransparent.SetModifyHdl( aLink );
- aMtrDistance.SetModifyHdl( aLink );
-
-}
-
-// -----------------------------------------------------------------------
-
-void SvxShadowTabPage::Construct()
-{
- // Farbtabelle fuellen
- aLbShadowColor.Fill( pColorTab );
-
- if( bDisable )
- {
- aTsbShowShadow.Disable();
- aFtPosition.Disable();
- aCtlPosition.Disable();
- aFtDistance.Disable();
- aMtrDistance.Disable();
- aFtShadowColor.Disable();
- aLbShadowColor.Disable();
- aFtTransparent.Disable();
- aMtrTransparent.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet )
-{
- USHORT nPos;
- USHORT nCount;
- //add CHINA001 Begin
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- //add CHINA001 end
- if( nDlgType == 0 ) //CHINA001 // Flaechen-Dialogif( *pDlgType == 0 ) // Flaechen-Dialog
- {
- if( pColorTab )
- {
- // ColorTable
- if( *pnColorTableState & CT_CHANGED ||
- *pnColorTableState & CT_MODIFIED )
- {
- if( *pnColorTableState & CT_CHANGED )
- {
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN );
- if( pArea )
- {
- pColorTab = pArea->GetNewColorTable();
- }
- else
- {
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN );
- if( pLine )
- pColorTab = pLine->GetNewColorTable();
- }
- }
-
- // aLbShadowColor
- nPos = aLbShadowColor.GetSelectEntryPos();
- aLbShadowColor.Clear();
- aLbShadowColor.Fill( pColorTab );
- nCount = aLbShadowColor.GetEntryCount();
- if( nCount == 0 )
- ; // Dieser Fall sollte nicht auftreten
- else if( nCount <= nPos )
- aLbShadowColor.SelectEntryPos( 0 );
- else
- aLbShadowColor.SelectEntryPos( nPos );
-
- ModifyShadowHdl_Impl( this );
- }
- nPageType = PT_SHADOW;//CHINA001 *pPageType = PT_SHADOW;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxShadowTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( _pSet )
- FillItemSet( *_pSet );
-
- return( LEAVE_PAGE );
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs )
-{
- const SfxPoolItem* pOld = NULL;
- BOOL bModified = FALSE;
-
- if( !bDisable )
- {
- // Schatten
- TriState eState = aTsbShowShadow.GetState();
- if( eState != aTsbShowShadow.GetSavedValue() )
- {
- SdrShadowItem aItem( sal::static_int_cast< BOOL >( eState ) );
- pOld = GetOldItem( rAttrs, SDRATTR_SHADOW );
- if ( !pOld || !( *(const SdrShadowItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- // Schatten-Entfernung
- // Etwas umstaendliche Abfrage, ob etwas geaendert wurde,
- // da Items nicht direkt auf Controls abbildbar sind
- INT32 nX = 0L, nY = 0L;
- INT32 nXY = GetCoreValue( aMtrDistance, ePoolUnit );
-
- switch( aCtlPosition.GetActualRP() )
- {
- case RP_LT: nX = nY = -nXY; break;
- case RP_MT: nY = -nXY; break;
- case RP_RT: nX = nXY; nY = -nXY; break;
- case RP_LM: nX = -nXY; break;
- case RP_RM: nX = nXY; break;
- case RP_LB: nX = -nXY; nY = nXY; break;
- case RP_MB: nY = nXY; break;
- case RP_RB: nX = nY = nXY; break;
- case RP_MM: break;
- }
-
- // Wenn die Werte des Schattenabstanden==SFX_ITEM_DONTCARE und der angezeigte
- // String im entspr. MetricField=="", dann w�rde der Vergleich zw. alten und
- // neuen Distance-Werte ein falsches Ergebnis liefern, da in so einem Fall die
- // neuen Distance-Werte den Default-Werten des MetricField entspr�chen !!!!
- if ( !aMtrDistance.IsEmptyFieldValue() ||
- rOutAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE ||
- rOutAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE )
- {
- INT32 nOldX = 9876543; // Unmoeglicher Wert, entspr. DontCare
- INT32 nOldY = 9876543;
- if( rOutAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE &&
- rOutAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE )
- {
- nOldX = ( ( const SdrShadowXDistItem& ) rOutAttrs.
- Get( SDRATTR_SHADOWXDIST ) ).GetValue();
- nOldY = ( ( const SdrShadowYDistItem& ) rOutAttrs.
- Get( SDRATTR_SHADOWYDIST ) ).GetValue();
- }
- SdrShadowXDistItem aXItem( nX );
- pOld = GetOldItem( rAttrs, SDRATTR_SHADOWXDIST );
- if ( nX != nOldX &&
- ( !pOld || !( *(const SdrShadowXDistItem*)pOld == aXItem ) ) )
- {
- rAttrs.Put( aXItem );
- bModified = TRUE;
- }
- SdrShadowYDistItem aYItem( nY );
- pOld = GetOldItem( rAttrs, SDRATTR_SHADOWYDIST );
- if ( nY != nOldY &&
- ( !pOld || !( *(const SdrShadowYDistItem*)pOld == aYItem ) ) )
- {
- rAttrs.Put( aYItem );
- bModified = TRUE;
- }
- }
-
- // ShadowColor
- USHORT nPos = aLbShadowColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- nPos != aLbShadowColor.GetSavedValue() )
- {
- SdrShadowColorItem aItem( aLbShadowColor.GetSelectEntry(),
- aLbShadowColor.GetSelectEntryColor() );
- pOld = GetOldItem( rAttrs, SDRATTR_SHADOWCOLOR );
- if ( !pOld || !( *(const SdrShadowColorItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
-
- // Transparenz
- UINT16 nVal = (UINT16)aMtrTransparent.GetValue();
- if( nVal != (UINT16)aMtrTransparent.GetSavedValue().ToInt32() )
- {
- SdrShadowTransparenceItem aItem( nVal );
- pOld = GetOldItem( rAttrs, SDRATTR_SHADOWTRANSPARENCE );
- if ( !pOld || !( *(const SdrShadowTransparenceItem*)pOld == aItem ) )
- {
- rAttrs.Put( aItem );
- bModified = TRUE;
- }
- }
- }
- //add CHINA001 begin
- rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType));
- //add CHINA001 end
- return( bModified );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs )
-{
- if( !bDisable )
- {
- // Alle Objekte koennen einen Schatten besitzen
- // z.Z. gibt es nur 8 m�gliche Positionen den Schatten zu setzen
-
- // Ist Schatten gesetzt?
- if( rAttrs.GetItemState( SDRATTR_SHADOW ) != SFX_ITEM_DONTCARE )
- {
- aTsbShowShadow.EnableTriState( FALSE );
-
- if( ( ( const SdrShadowItem& ) rAttrs.Get( SDRATTR_SHADOW ) ).GetValue() )
- aTsbShowShadow.SetState( STATE_CHECK );
- else
- {
- aTsbShowShadow.SetState( STATE_NOCHECK );
- }
- }
- else
- aTsbShowShadow.SetState( STATE_DONTKNOW );
-
- // Entfernung (nur 8 moegliche Positionen), deshalb
- // wird nur ein Item ausgewertet
-
- if( rAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE &&
- rAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE )
- {
- INT32 nX = ( ( const SdrShadowXDistItem& ) rAttrs.Get( SDRATTR_SHADOWXDIST ) ).GetValue();
- INT32 nY = ( ( const SdrShadowYDistItem& ) rAttrs.Get( SDRATTR_SHADOWYDIST ) ).GetValue();
-
- if( nX != 0 )
- SetMetricValue( aMtrDistance, nX < 0L ? -nX : nX, ePoolUnit );
- else
- SetMetricValue( aMtrDistance, nY < 0L ? -nY : nY, ePoolUnit );
-
- // Setzen des Schatten-Controls
- if ( nX < 0L && nY < 0L ) aCtlPosition.SetActualRP( RP_LT );
- else if( nX == 0L && nY < 0L ) aCtlPosition.SetActualRP( RP_MT );
- else if( nX > 0L && nY < 0L ) aCtlPosition.SetActualRP( RP_RT );
- else if( nX < 0L && nY == 0L ) aCtlPosition.SetActualRP( RP_LM );
- // Mittelpunkt gibt es nicht mehr
- else if( nX == 0L && nY == 0L ) aCtlPosition.SetActualRP( RP_RB );
- else if( nX > 0L && nY == 0L ) aCtlPosition.SetActualRP( RP_RM );
- else if( nX < 0L && nY > 0L ) aCtlPosition.SetActualRP( RP_LB );
- else if( nX == 0L && nY > 0L ) aCtlPosition.SetActualRP( RP_MB );
- else if( nX > 0L && nY > 0L ) aCtlPosition.SetActualRP( RP_RB );
- }
- else
- {
- // determine default-distance
- SfxItemPool* pPool = rOutAttrs.GetPool();
- SdrShadowXDistItem* pXDistItem = (SdrShadowXDistItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWXDIST);
- SdrShadowYDistItem* pYDistItem = (SdrShadowYDistItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWYDIST);
- if (pXDistItem && pYDistItem)
- {
- INT32 nX = pXDistItem->GetValue();
- INT32 nY = pYDistItem->GetValue();
- if( nX != 0 )
- SetMetricValue( aMtrDistance, nX < 0L ? -nX : nX, ePoolUnit );
- else
- SetMetricValue( aMtrDistance, nY < 0L ? -nY : nY, ePoolUnit );
- }
-
- // Tristate, z.B. mehrer Objekte wurden markiert, wovon einige einen Schatten besitzen, einige nicht.
- // Der anzuzeigende Text des MetricFields wird auf "" gesetzt und dient in der Methode FillItemSet
- // als Erkennungszeichen daf�r, das der Distance-Wert NICHT ver�ndert wurde !!!!
- aMtrDistance.SetText( String() );
- aCtlPosition.SetActualRP( RP_MM );
- }
-
- // SchattenFarbe:
- if( rAttrs.GetItemState( SDRATTR_SHADOWCOLOR ) != SFX_ITEM_DONTCARE )
- {
- aLbShadowColor.SelectEntry( ( ( const SdrShadowColorItem& ) rAttrs.Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
- }
- else
- aLbShadowColor.SetNoSelection();
-
- // Transparenz
- if( rAttrs.GetItemState( SDRATTR_SHADOWTRANSPARENCE ) != SFX_ITEM_DONTCARE )
- {
- USHORT nTransp = ( ( const SdrShadowTransparenceItem& ) rAttrs.Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
- aMtrTransparent.SetValue( nTransp );
- }
- else
- aMtrTransparent.SetText( String() );
-
- // Werte sichern
- //aCtlPosition
- aMtrDistance.SaveValue();
- aLbShadowColor.SaveValue();
- aTsbShowShadow.SaveValue();
-
- // #66832# This field was not saved, but used to determine changes.
- // Why? Seems to be the error.
- // It IS the error.
- aMtrTransparent.SaveValue();
-
- ClickShadowHdl_Impl( NULL );
- ModifyShadowHdl_Impl( NULL );
- }
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxShadowTabPage::Create( Window* pWindow,
- const SfxItemSet& rAttrs )
-{
- return( new SvxShadowTabPage( pWindow, rAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxShadowTabPage::GetRanges()
-{
- return( pShadowRanges );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxShadowTabPage, ClickShadowHdl_Impl, void *, EMPTYARG )
-{
- if( aTsbShowShadow.GetState() == STATE_NOCHECK )
- {
- aFtPosition.Disable();
- aCtlPosition.Disable();
- aFtDistance.Disable();
- aMtrDistance.Disable();
- aFtShadowColor.Disable();
- aLbShadowColor.Disable();
- aFtTransparent.Disable();
- aMtrTransparent.Disable();
- }
- else
- {
- aFtPosition.Enable();
- aCtlPosition.Enable();
- aFtDistance.Enable();
- aMtrDistance.Enable();
- aFtShadowColor.Enable();
- aLbShadowColor.Enable();
- aFtTransparent.Enable();
- aMtrTransparent.Enable();
- }
- aCtlPosition.Invalidate();
-
- ModifyShadowHdl_Impl( NULL );
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxShadowTabPage, ModifyShadowHdl_Impl, void *, EMPTYARG )
-{
- if( aTsbShowShadow.GetState() == STATE_CHECK )
- rXFSet.Put( XFillStyleItem( XFILL_SOLID ) );
- else
- rXFSet.Put( XFillStyleItem( XFILL_NONE ) );
-
- USHORT nPos = aLbShadowColor.GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- {
- rXFSet.Put( XFillColorItem( String(),
- aLbShadowColor.GetSelectEntryColor() ) );
- }
- UINT16 nVal = (UINT16)aMtrTransparent.GetValue();
- XFillTransparenceItem aItem( nVal );
- rXFSet.Put( XFillTransparenceItem( aItem ) );
-
- // Schatten-Entfernung
- INT32 nX = 0L, nY = 0L;
- INT32 nXY = GetCoreValue( aMtrDistance, ePoolUnit );
- switch( aCtlPosition.GetActualRP() )
- {
- case RP_LT: nX = nY = -nXY; break;
- case RP_MT: nY = -nXY; break;
- case RP_RT: nX = nXY; nY = -nXY; break;
- case RP_LM: nX = -nXY; break;
- case RP_RM: nX = nXY; break;
- case RP_LB: nX = -nXY; nY = nXY; break;
- case RP_MB: nY = nXY; break;
- case RP_RB: nX = nY = nXY; break;
- case RP_MM: break;
- }
-
- aCtlXRectPreview.SetShadowPosition(Point(nX, nY));
-
- aCtlXRectPreview.SetShadowAttributes(aXFillAttr.GetItemSet());
- //aCtlXRectPreview.SetFillAttr( aXFillAttr );
- aCtlXRectPreview.Invalidate();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxShadowTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
-{
- eRP = eRcPt;
-
- // Schatten neu zeichnen
- ModifyShadowHdl_Impl( pWindow );
-}
-
-void SvxShadowTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
-{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
-
-
- if (pColorTabItem)
- SetColorTable(pColorTabItem->GetColorTable());
- if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
- if (pDlgTypeItem)
- SetDlgType(pDlgTypeItem->GetValue());
- Construct();
-}
diff --git a/svx/source/cui/transfrm.cxx b/svx/source/cui/transfrm.cxx
deleted file mode 100644
index 538e8eb523..0000000000
--- a/svx/source/cui/transfrm.cxx
+++ /dev/null
@@ -1,1706 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: transfrm.cxx,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-
-#include <tools/shl.hxx>
-#include <sfx2/app.hxx>
-#include <svx/svdview.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdpagv.hxx>
-#include <svx/svdotext.hxx>
-#include <svx/sderitm.hxx>
-
-#include <svx/svxids.hrc>
-#include <svx/dialogs.hrc>
-#include "transfrm.hrc"
-#include <svx/sizeitem.hxx>
-
-#include "transfrm.hxx"
-#include <svx/dialmgr.hxx>
-#include "dlgutil.hxx"
-#include <svx/svxenum.hxx>
-#include "anchorid.hxx"
-#include <sfx2/module.hxx>
-#include <svtools/rectitem.hxx>
-#include <svtools/aeitem.hxx>
-#include <swpossizetabpage.hxx>
-
-// Toleranz fuer WorkingArea
-#define DIFF 1000
-
-// static ----------------------------------------------------------------
-
-static USHORT pPosSizeRanges[] =
-{
- SID_ATTR_TRANSFORM_POS_X,
- SID_ATTR_TRANSFORM_POS_Y,
- SID_ATTR_TRANSFORM_PROTECT_POS,
- SID_ATTR_TRANSFORM_PROTECT_POS,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_ANCHOR,
- SID_ATTR_TRANSFORM_VERT_ORIENT,
- SID_ATTR_TRANSFORM_WIDTH,
- SID_ATTR_TRANSFORM_SIZE_POINT,
- SID_ATTR_TRANSFORM_PROTECT_POS,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_AUTOWIDTH,
- SID_ATTR_TRANSFORM_AUTOHEIGHT,
- 0
-};
-
-static USHORT pAngleRanges[] =
-{
- SID_ATTR_TRANSFORM_ROT_X,
- SID_ATTR_TRANSFORM_ANGLE,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_INTERN,
- 0
-};
-
-static USHORT pSlantRanges[] =
-{
- SDRATTR_ECKENRADIUS,
- SDRATTR_ECKENRADIUS,
- SID_ATTR_TRANSFORM_SHEAR,
- SID_ATTR_TRANSFORM_SHEAR_VERTICAL,
- SID_ATTR_TRANSFORM_INTERN,
- SID_ATTR_TRANSFORM_INTERN,
- 0
-};
-
-void lcl_ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit)
-{
- const basegfx::B2DPoint aTopLeft(
- (double)MetricField::ConvertValue(basegfx::fround(rRange.getMinX()), nDigits, ePoolUnit, eDlgUnit),
- (double)MetricField::ConvertValue(basegfx::fround(rRange.getMinY()), nDigits, ePoolUnit, eDlgUnit));
- const basegfx::B2DPoint aBottomRight(
- (double)MetricField::ConvertValue(basegfx::fround(rRange.getMaxX()), nDigits, ePoolUnit, eDlgUnit),
- (double)MetricField::ConvertValue(basegfx::fround(rRange.getMaxY()), nDigits, ePoolUnit, eDlgUnit));
-
- rRange = basegfx::B2DRange(aTopLeft, aBottomRight);
-}
-
-void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale)
-{
- const double fFactor(1.0 / double(aUIScale));
- rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor);
-}
-
-/*************************************************************************
-|*
-|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
-|*
-\************************************************************************/
-
-SvxTransformTabDialog::SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pSdrView, USHORT nAnchorTypes ) :
- SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_TRANSFORM ), pAttr ),
- pView ( pSdrView ),
- nAnchorCtrls(nAnchorTypes)
-{
- DBG_ASSERT(pView, "no valid view (!)");
- FreeResource();
-
- //different positioning page in Writer
- if(nAnchorCtrls & 0x00ff)
- {
- AddTabPage(RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges);
- RemoveTabPage(RID_SVXPAGE_POSITION_SIZE);
- }
- else
- {
- AddTabPage(RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges);
- RemoveTabPage(RID_SVXPAGE_SWPOSSIZE);
- }
-
- AddTabPage(RID_SVXPAGE_ANGLE, SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges);
- AddTabPage(RID_SVXPAGE_SLANT, SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges);
-}
-
-// -----------------------------------------------------------------------
-
-SvxTransformTabDialog::~SvxTransformTabDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void SvxTransformTabDialog::PageCreated(USHORT nId, SfxTabPage &rPage)
-{
- switch(nId)
- {
- case RID_SVXPAGE_POSITION_SIZE:
- {
- SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage);
- rSvxPos.SetView(pView);
- rSvxPos.Construct();
-
- if(nAnchorCtrls & SVX_OBJ_NORESIZE)
- {
- rSvxPos.DisableResize();
- }
-
- if(nAnchorCtrls & SVX_OBJ_NOPROTECT)
- {
- rSvxPos.DisableProtect();
- rSvxPos.UpdateControlStates();
- }
-
- break;
- }
- case RID_SVXPAGE_SWPOSSIZE :
- {
- SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage);
-
- rSwPos.EnableAnchorTypes(nAnchorCtrls);
- rSwPos.SetValidateFramePosLink(aValidateLink);
- rSwPos.SetView(pView);
-
- break;
- }
-
- case RID_SVXPAGE_ANGLE:
- {
- SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage);
-
- rSvxAng.SetView( pView );
- rSvxAng.Construct();
-
- break;
- }
-
- case RID_SVXPAGE_SLANT:
- {
- SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage);
-
- rSvxSlnt.SetView( pView );
- rSvxSlnt.Construct();
-
- break;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxTransformTabDialog::SetValidateFramePosLink(const Link& rLink)
-{
- aValidateLink = rLink;
-}
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern der Position des Drehwinkels und des Drehwinkels
-|* der Grafikobjekte
-|*
-\************************************************************************/
-
-SvxAngleTabPage::SvxAngleTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_ANGLE ), rInAttrs ),
- aFlPosition ( this, SVX_RES( FL_POSITION ) ),
- aFtPosX ( this, SVX_RES( FT_POS_X ) ),
- aMtrPosX ( this, SVX_RES( MTR_FLD_POS_X ) ),
- aFtPosY ( this, SVX_RES( FT_POS_Y ) ),
- aMtrPosY ( this, SVX_RES( MTR_FLD_POS_Y ) ),
- aFtPosPresets ( this, SVX_RES(FT_POSPRESETS) ),
- aCtlRect ( this, SVX_RES( CTL_RECT ) ),
-
- aFlAngle ( this, SVX_RES( FL_ANGLE ) ),
- aFtAngle ( this, SVX_RES( FT_ANGLE ) ),
- aMtrAngle ( this, SVX_RES( MTR_FLD_ANGLE ) ),
- aFtAnglePresets ( this, SVX_RES(FT_ANGLEPRESETS) ),
- aCtlAngle ( this, SVX_RES( CTL_ANGLE ),
- RP_RB, 200, 80, CS_ANGLE ),
- rOutAttrs ( rInAttrs )
-{
- FreeResource();
-
- // calculate PoolUnit
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "no pool (!)" );
- ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X);
-
- aMtrAngle.SetModifyHdl(LINK( this, SvxAngleTabPage, ModifiedHdl));
-}
-
-// -----------------------------------------------------------------------
-
-void SvxAngleTabPage::Construct()
-{
- DBG_ASSERT(pView, "No valid view (!)");
- eDlgUnit = GetModuleFieldUnit(&GetItemSet());
- SetFieldUnit(aMtrPosX, eDlgUnit, TRUE);
- SetFieldUnit(aMtrPosY, eDlgUnit, TRUE);
-
- if(FUNIT_MILE == eDlgUnit || FUNIT_KM == eDlgUnit)
- {
- aMtrPosX.SetDecimalDigits( 3 );
- aMtrPosY.SetDecimalDigits( 3 );
- }
-
- { // #i75273#
- Rectangle aTempRect(pView->GetAllMarkedRect());
- pView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-
- // Take anchor into account (Writer)
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-
- if(rMarkList.GetMarkCount())
- {
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
-
- if(!maAnchor.equalZero()) // -> Writer
- {
- maRange = basegfx::B2DRange(maRange.getMinimum() - maAnchor, maRange.getMaximum() - maAnchor);
- }
- }
-
- // take scale into account
- const Fraction aUIScale(pView->GetModel()->GetUIScale());
- lcl_ScaleRect(maRange, aUIScale);
-
- // take UI units into account
- sal_uInt16 nDigits(aMtrPosX.GetDecimalDigits());
- lcl_ConvertRect(maRange, nDigits, (MapUnit)ePoolUnit, eDlgUnit);
-
- if(!pView->IsRotateAllowed())
- {
- aFlPosition.Disable();
- aFtPosX.Disable();
- aMtrPosX.Disable();
- aFtPosY.Disable();
- aMtrPosY.Disable();
- aFtPosPresets.Disable();
- aCtlRect.Disable();
- aFlAngle.Disable();
- aFtAngle.Disable();
- aMtrAngle.Disable();
- aFtAnglePresets.Disable();
- aCtlAngle.Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxAngleTabPage::FillItemSet(SfxItemSet& rSet)
-{
- BOOL bModified = FALSE;
-
- if(aMtrAngle.IsValueModified() || aMtrPosX.IsValueModified() || aMtrPosY.IsValueModified())
- {
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
- const double fTmpX((GetCoreValue(aMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
- const double fTmpY((GetCoreValue(aMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
-
- rSet.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), static_cast<sal_Int32>(aMtrAngle.GetValue())));
- rSet.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX)));
- rSet.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY)));
-
- bModified |= TRUE;
- }
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxAngleTabPage::Reset(const SfxItemSet& rAttrs)
-{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
-
- const SfxPoolItem* pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_ROT_X );
- if(pItem)
- {
- const double fTmp(((double)((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getX()) / fUIScale);
- SetMetricValue(aMtrPosX, basegfx::fround(fTmp), ePoolUnit);
- }
- else
- {
- aMtrPosX.SetText( String() );
- }
-
- pItem = GetItem(rAttrs, SID_ATTR_TRANSFORM_ROT_Y);
- if(pItem)
- {
- const double fTmp(((double)((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getY()) / fUIScale);
- SetMetricValue(aMtrPosY, basegfx::fround(fTmp), ePoolUnit);
- }
- else
- {
- aMtrPosX.SetText( String() );
- }
-
- pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_ANGLE );
- if(pItem)
- {
- aMtrAngle.SetValue(((const SfxInt32Item*)pItem)->GetValue());
- }
- else
- {
- aMtrAngle.SetText( String() );
- }
-
- aMtrAngle.SaveValue();
- ModifiedHdl(this);
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxAngleTabPage::Create( Window* pWindow, const SfxItemSet& rSet)
-{
- return(new SvxAngleTabPage(pWindow, rSet));
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxAngleTabPage::GetRanges()
-{
- return(pAngleRanges);
-}
-
-// -----------------------------------------------------------------------
-
-void SvxAngleTabPage::ActivatePage(const SfxItemSet& /*rSet*/)
-{
-}
-
-// -----------------------------------------------------------------------
-
-int SvxAngleTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if(_pSet)
- {
- FillItemSet(*_pSet);
- }
-
- return LEAVE_PAGE;
-}
-
-//------------------------------------------------------------------------
-
-void SvxAngleTabPage::PointChanged(Window* pWindow, RECT_POINT eRP)
-{
- if(pWindow == &aCtlRect)
- {
- switch(eRP)
- {
- case RP_LT:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMinX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMinY()), FUNIT_NONE );
- break;
- }
- case RP_MT:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMinY()), FUNIT_NONE );
- break;
- }
- case RP_RT:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMinY()), FUNIT_NONE );
- break;
- }
- case RP_LM:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMinX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE );
- break;
- }
- case RP_MM:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE );
- break;
- }
- case RP_RM:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE );
- break;
- }
- case RP_LB:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMinX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE );
- break;
- }
- case RP_MB:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE );
- break;
- }
- case RP_RB:
- {
- aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE );
- aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE );
- break;
- }
- }
- }
- else if(pWindow == &aCtlAngle)
- {
- switch( eRP )
- {
- case RP_LT: aMtrAngle.SetUserValue( 13500, FUNIT_NONE ); break;
- case RP_MT: aMtrAngle.SetUserValue( 9000, FUNIT_NONE ); break;
- case RP_RT: aMtrAngle.SetUserValue( 4500, FUNIT_NONE ); break;
- case RP_LM: aMtrAngle.SetUserValue( 18000, FUNIT_NONE ); break;
- case RP_RM: aMtrAngle.SetUserValue( 0, FUNIT_NONE ); break;
- case RP_LB: aMtrAngle.SetUserValue( 22500, FUNIT_NONE ); break;
- case RP_MB: aMtrAngle.SetUserValue( 27000, FUNIT_NONE ); break;
- case RP_RB: aMtrAngle.SetUserValue( 31500, FUNIT_NONE ); break;
- case RP_MM: break;
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxAngleTabPage, ModifiedHdl, void *, EMPTYARG )
-{
- switch(aMtrAngle.GetValue())
- {
- case 13500: aCtlAngle.SetActualRP( RP_LT ); break;
- case 9000: aCtlAngle.SetActualRP( RP_MT ); break;
- case 4500: aCtlAngle.SetActualRP( RP_RT ); break;
- case 18000: aCtlAngle.SetActualRP( RP_LM ); break;
- case 0: aCtlAngle.SetActualRP( RP_RM ); break;
- case 22500: aCtlAngle.SetActualRP( RP_LB ); break;
- case 27000: aCtlAngle.SetActualRP( RP_MB ); break;
- case 31500: aCtlAngle.SetActualRP( RP_RB ); break;
- default: aCtlAngle.SetActualRP( RP_MM ); break;
- }
-
- return( 0L );
-}
-
-/*************************************************************************
-|*
-|* Dialog zum Aendern des Eckenradius und zum Schraegstellen
-|*
-\************************************************************************/
-
-SvxSlantTabPage::SvxSlantTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_SLANT ), rInAttrs ),
-
- aFlRadius ( this, SVX_RES( FL_RADIUS ) ),
- aFtRadius ( this, SVX_RES( FT_RADIUS ) ),
- aMtrRadius ( this, SVX_RES( MTR_FLD_RADIUS ) ),
- aFlAngle ( this, SVX_RES( FL_SLANT ) ),
- aFtAngle ( this, SVX_RES( FT_ANGLE ) ),
- aMtrAngle ( this, SVX_RES( MTR_FLD_ANGLE ) ),
- rOutAttrs ( rInAttrs )
-{
- FreeResource();
-
- // this page needs ExchangeSupport
- SetExchangeSupport();
-
- // evaluate PoolUnit
- SfxItemPool* pPool = rOutAttrs.GetPool();
- DBG_ASSERT( pPool, "no pool (!)" );
- ePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxSlantTabPage::Construct()
-{
- // get the range
- DBG_ASSERT(pView, "no valid view (!)");
- eDlgUnit = GetModuleFieldUnit(&GetItemSet());
- SetFieldUnit(aMtrRadius, eDlgUnit, TRUE);
-
- { // #i75273#
- Rectangle aTempRect(pView->GetAllMarkedRect());
- pView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs)
-{
- BOOL bModified = FALSE;
- INT32 nValue = 0L;
- String aStr = aMtrRadius.GetText();
-
- if( aStr != aMtrRadius.GetSavedValue() )
- {
- Fraction aUIScale = pView->GetModel()->GetUIScale();
- long nTmp = GetCoreValue( aMtrRadius, ePoolUnit );
- nTmp = Fraction( nTmp ) * aUIScale;
-
- rAttrs.Put( SdrEckenradiusItem( nTmp ) );
- bModified = TRUE;
- }
-
- aStr = aMtrAngle.GetText();
-
- if( aStr != aMtrAngle.GetSavedValue() )
- {
- nValue = static_cast<INT32>(aMtrAngle.GetValue());
- rAttrs.Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) );
- bModified = TRUE;
- }
-
- if( bModified )
- {
- // Referenzpunkt setzen
- // #75897#
- Rectangle aObjectRect(pView->GetAllMarkedRect());
- pView->GetSdrPageView()->LogicToPagePos(aObjectRect);
- Point aPt = aObjectRect.Center();
-
- rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X, aPt.X()));
- rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y, aPt.Y()));
- rAttrs.Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, FALSE ) );
- }
-
- return( bModified );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxSlantTabPage::Reset(const SfxItemSet& rAttrs)
-{
- // if the view has selected objects, items with SFX_ITEM_DEFAULT need to be disabled
- const SfxPoolItem* pItem;
-
- // Eckenradius
- if(!pView->IsEdgeRadiusAllowed())
- {
- aFlRadius.Disable();
- aFtRadius.Disable();
- aMtrRadius.Disable();
- aMtrRadius.SetText( String() );
- }
- else
- {
- pItem = GetItem( rAttrs, SDRATTR_ECKENRADIUS );
-
- if( pItem )
- {
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
- const double fTmp((double)((const SdrEckenradiusItem*)pItem)->GetValue() / fUIScale);
- SetMetricValue(aMtrRadius, basegfx::fround(fTmp), ePoolUnit);
- }
- else
- {
- aMtrRadius.SetText( String() );
- }
- }
-
- aMtrRadius.SaveValue();
-
- // Schraegstellen: Winkel
- if( !pView->IsShearAllowed() )
- {
- aFlAngle.Disable();
- aFtAngle.Disable();
- aMtrAngle.Disable();
- aMtrAngle.SetText( String() );
- }
- else
- {
- pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_SHEAR );
-
- if( pItem )
- {
- aMtrAngle.SetValue( ( (const SfxInt32Item*)pItem )->GetValue() );
- }
- else
- {
- aMtrAngle.SetText( String() );
- }
- }
-
- aMtrAngle.SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxSlantTabPage::Create( Window* pWindow, const SfxItemSet& rOutAttrs )
-{
- return( new SvxSlantTabPage( pWindow, rOutAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxSlantTabPage::GetRanges()
-{
- return( pSlantRanges );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet )
-{
- SfxRectangleItem* pRectItem = NULL;
-
- if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , FALSE, (const SfxPoolItem**) &pRectItem ) )
- {
- const Rectangle aTempRect(pRectItem->GetValue());
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxSlantTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if(_pSet)
- {
- FillItemSet(*_pSet);
- }
-
- return LEAVE_PAGE;
-}
-
-//------------------------------------------------------------------------
-
-void SvxSlantTabPage::PointChanged( Window* , RECT_POINT )
-{
-}
-
-/*************************************************************************
-|*
-|* Dialog for changing position and size of graphic objects
-|*
-\************************************************************************/
-
-SvxPositionSizeTabPage::SvxPositionSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
- SvxTabPage ( pParent, SVX_RES( RID_SVXPAGE_POSITION_SIZE ), rInAttrs ),
- maFlPosition ( this, SVX_RES( FL_POSITION ) ),
- maFtPosX ( this, SVX_RES( FT_POS_X ) ),
- maMtrPosX ( this, SVX_RES( MTR_FLD_POS_X ) ),
- maFtPosY ( this, SVX_RES( FT_POS_Y ) ),
- maMtrPosY ( this, SVX_RES( MTR_FLD_POS_Y ) ),
- maFtPosReference ( this, SVX_RES( FT_POSREFERENCE ) ),
- maCtlPos ( this, SVX_RES( CTL_POSRECT ), RP_LT ),
-
- maFlSize ( this, SVX_RES( FL_SIZE ) ),
- maFtWidth ( this, SVX_RES( FT_WIDTH ) ),
- maMtrWidth ( this, SVX_RES( MTR_FLD_WIDTH ) ),
- maFtHeight ( this, SVX_RES( FT_HEIGHT ) ),
- maMtrHeight ( this, SVX_RES( MTR_FLD_HEIGHT ) ),
- maCbxScale ( this, SVX_RES( CBX_SCALE ) ),
- maFtSizeReference ( this, SVX_RES( FT_SIZEREFERENCE) ),
- maCtlSize ( this, SVX_RES( CTL_SIZERECT ), RP_LT ),
-
- maFlProtect ( this, SVX_RES( FL_PROTECT) ),
- maTsbPosProtect ( this, SVX_RES( TSB_POSPROTECT ) ),
- maTsbSizeProtect ( this, SVX_RES( TSB_SIZEPROTECT ) ),
-
-
- maFlAdjust ( this, SVX_RES( FL_ADJUST ) ),
- maTsbAutoGrowWidth ( this, SVX_RES( TSB_AUTOGROW_WIDTH ) ),
- maTsbAutoGrowHeight ( this, SVX_RES( TSB_AUTOGROW_HEIGHT ) ),
-
- maFlDivider (this, SVX_RES( FL_DIVIDER ) ),
-
- mrOutAttrs ( rInAttrs ),
- mnProtectSizeState( STATE_NOCHECK ),
- mbPageDisabled ( FALSE ),
- mbProtectDisabled( false ),
- mbSizeDisabled( false ),
- mbAdjustDisabled( true )
-{
- FreeResource();
-
- // this pege needs ExchangeSupport
- SetExchangeSupport();
-
- // evaluate PoolUnit
- SfxItemPool* pPool = mrOutAttrs.GetPool();
- DBG_ASSERT( pPool, "no pool (!)" );
- mePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
-
- meRP = RP_LT; // s.o.
-
- maMtrWidth.SetModifyHdl( LINK( this, SvxPositionSizeTabPage, ChangeWidthHdl ) );
- maMtrHeight.SetModifyHdl( LINK( this, SvxPositionSizeTabPage, ChangeHeightHdl ) );
- maCbxScale.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ClickAutoHdl ) );
-
- maTsbAutoGrowWidth.Disable();
- maTsbAutoGrowHeight.Disable();
- maFlAdjust.Disable();
-
- // #i2379# disable controls when protected
- maTsbPosProtect.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ChangePosProtectHdl ) );
- maTsbSizeProtect.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ChangeSizeProtectHdl ) );
-
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::Construct()
-{
- // get range and work area
- DBG_ASSERT( mpView, "no valid view (!)" );
- meDlgUnit = GetModuleFieldUnit( &GetItemSet() );
- SetFieldUnit( maMtrPosX, meDlgUnit, TRUE );
- SetFieldUnit( maMtrPosY, meDlgUnit, TRUE );
- SetFieldUnit( maMtrWidth, meDlgUnit, TRUE );
- SetFieldUnit( maMtrHeight, meDlgUnit, TRUE );
-
- if(FUNIT_MILE == meDlgUnit || FUNIT_KM == meDlgUnit)
- {
- maMtrPosX.SetDecimalDigits( 3 );
- maMtrPosY.SetDecimalDigits( 3 );
- maMtrWidth.SetDecimalDigits( 3 );
- maMtrHeight.SetDecimalDigits( 3 );
- }
-
- { // #i75273#
- Rectangle aTempRect(mpView->GetAllMarkedRect());
- mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-
- { // #i75273#
- Rectangle aTempRect(mpView->GetWorkArea());
- mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maWorkRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-
- // take anchor into account (Writer)
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if(rMarkList.GetMarkCount())
- {
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
-
- if(!maAnchor.equalZero()) // -> Writer
- {
- for(sal_uInt16 i(1); i < rMarkList.GetMarkCount(); i++)
- {
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
-
- if(maAnchor != basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y()))
- {
- // diferent anchor positions
- maMtrPosX.SetText( String() );
- maMtrPosY.SetText( String() );
- mbPageDisabled = TRUE;
- return;
- }
- }
-
- // translate ranges about anchor
- maRange = basegfx::B2DRange(maRange.getMinimum() - maAnchor, maRange.getMaximum() - maAnchor);
- maWorkRange = basegfx::B2DRange(maWorkRange.getMinimum() - maAnchor, maWorkRange.getMaximum() - maAnchor);
- }
- }
-
- // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
- if(1 == rMarkList.GetMarkCount())
- {
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
-
- if((pObj->GetObjInventor() == SdrInventor) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && ((SdrTextObj*)pObj)->HasText())
- {
- mbAdjustDisabled = false;
- maFlAdjust.Enable();
- maTsbAutoGrowWidth.Enable();
- maTsbAutoGrowHeight.Enable();
- maTsbAutoGrowWidth.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
- maTsbAutoGrowHeight.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) );
-
- // is used as flag to evaluate if its selectable
- maTsbAutoGrowWidth.EnableTriState( FALSE );
- maTsbAutoGrowHeight.EnableTriState( FALSE );
- }
- }
-
- // take scale into account
- const Fraction aUIScale(mpView->GetModel()->GetUIScale());
- lcl_ScaleRect( maWorkRange, aUIScale );
- lcl_ScaleRect( maRange, aUIScale );
-
- // take UI units into account
- const sal_uInt16 nDigits(maMtrPosX.GetDecimalDigits());
- lcl_ConvertRect( maWorkRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
- lcl_ConvertRect( maRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
-
- SetMinMaxPosition();
-}
-
-// -----------------------------------------------------------------------
-
-BOOL SvxPositionSizeTabPage::FillItemSet( SfxItemSet& rOutAttrs )
-{
- BOOL bModified(FALSE);
-
- if ( maMtrWidth.HasFocus() )
- {
- ChangeWidthHdl( this );
- }
-
- if ( maMtrHeight.HasFocus() )
- {
- ChangeHeightHdl( this );
- }
-
- if( !mbPageDisabled )
- {
- if ( maMtrPosX.IsValueModified() || maMtrPosY.IsValueModified() )
- {
- const double fUIScale(double(mpView->GetModel()->GetUIScale()));
- double fX((GetCoreValue( maMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
- double fY((GetCoreValue( maMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
-
- { // #i75273#
- Rectangle aTempRect(mpView->GetAllMarkedRect());
- mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-
- // #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
- GetTopLeftPosition(fX, fY, maRange);
-
- rOutAttrs.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_X), basegfx::fround(fX)));
- rOutAttrs.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY)));
-
- bModified |= TRUE;
- }
-
- if ( maTsbPosProtect.GetState() != maTsbPosProtect.GetSavedValue() )
- {
- if( maTsbPosProtect.GetState() == STATE_DONTKNOW )
- {
- rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS );
- }
- else
- {
- rOutAttrs.Put(
- SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
- maTsbPosProtect.GetState() == STATE_CHECK ? TRUE : FALSE ) );
- }
-
- bModified |= TRUE;
- }
- }
-
- if ( maMtrWidth.IsValueModified() || maMtrHeight.IsValueModified() )
- {
- Fraction aUIScale = mpView->GetModel()->GetUIScale();
-
- // get Width
- double nWidth = static_cast<double>(maMtrWidth.GetValue( meDlgUnit ));
- nWidth = MetricField::ConvertDoubleValue( nWidth, maMtrWidth.GetBaseValue(), maMtrWidth.GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
- long lWidth = long(nWidth * (double)aUIScale);
- lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
- lWidth = static_cast<long>(maMtrWidth.Denormalize( lWidth ));
-
- // get Height
- double nHeight = static_cast<double>(maMtrHeight.GetValue( meDlgUnit ));
- nHeight = MetricField::ConvertDoubleValue( nHeight, maMtrHeight.GetBaseValue(), maMtrHeight.GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
- long lHeight = long(nHeight * (double)aUIScale);
- lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
- lHeight = static_cast<long>(maMtrWidth.Denormalize( lHeight ));
-
- // put Width & Height to itemset
- rOutAttrs.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ),
- (UINT32) lWidth ) );
- rOutAttrs.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ),
- (UINT32) lHeight ) );
- rOutAttrs.Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< USHORT >( meRP ) ) );
- bModified |= TRUE;
- }
-
- if ( maTsbSizeProtect.GetState() != maTsbSizeProtect.GetSavedValue() )
- {
- if ( maTsbSizeProtect.GetState() == STATE_DONTKNOW )
- rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE );
- else
- rOutAttrs.Put(
- SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
- maTsbSizeProtect.GetState() == STATE_CHECK ? TRUE : FALSE ) );
- bModified |= TRUE;
- }
-
- if ( maTsbAutoGrowWidth.GetState() != maTsbAutoGrowWidth.GetSavedValue() )
- {
- if ( !maTsbAutoGrowWidth.IsTriStateEnabled() )
- {
- if( maTsbAutoGrowWidth.GetState() == STATE_DONTKNOW )
- rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH );
- else
- rOutAttrs.Put(
- SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ),
- maTsbAutoGrowWidth.GetState() == STATE_CHECK ? TRUE : FALSE ) );
- }
- bModified |= TRUE;
- }
-
- if ( maTsbAutoGrowHeight.GetState() != maTsbAutoGrowHeight.GetSavedValue() )
- {
- if ( !maTsbAutoGrowHeight.IsTriStateEnabled() )
- {
- if( maTsbAutoGrowHeight.GetState() == STATE_DONTKNOW )
- rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_AUTOHEIGHT );
- else
- rOutAttrs.Put(
- SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ),
- maTsbAutoGrowHeight.GetState() == STATE_CHECK ? TRUE : FALSE ) );
- }
- bModified |= TRUE;
- }
-
-
- return bModified;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::Reset( const SfxItemSet& )
-{
- const SfxPoolItem* pItem;
- const double fUIScale(double(mpView->GetModel()->GetUIScale()));
-
- if ( !mbPageDisabled )
- {
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X );
- if ( pItem )
- {
- const double fTmp((((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getX()) / fUIScale);
- SetMetricValue(maMtrPosX, basegfx::fround(fTmp), mePoolUnit);
- }
-
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y );
- if ( pItem )
- {
- const double fTmp((((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getY()) / fUIScale);
- SetMetricValue(maMtrPosY, basegfx::fround(fTmp), mePoolUnit);
- }
-
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_POS );
- if ( pItem )
- {
- sal_Bool bProtected = ( ( const SfxBoolItem* )pItem )->GetValue();
- maTsbPosProtect.SetState( bProtected ? STATE_CHECK : STATE_NOCHECK );
- maTsbPosProtect.EnableTriState( FALSE );
- }
- else
- {
- maTsbPosProtect.SetState( STATE_DONTKNOW );
- }
-
- maTsbPosProtect.SaveValue();
- maCtlPos.Reset();
-
- // #i2379# Disable controls for protected objects
- ChangePosProtectHdl( this );
- }
-
- { // #i75273# set width
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
- mfOldWidth = std::max( pItem ? (double)((const SfxUInt32Item*)pItem)->GetValue() : 0.0, 1.0 );
- double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
-
- if(maMtrWidth.GetDecimalDigits())
- fTmpWidth *= pow(10.0, maMtrWidth.GetDecimalDigits());
-
- fTmpWidth = MetricField::ConvertDoubleValue(fTmpWidth, maMtrWidth.GetBaseValue(), maMtrWidth.GetDecimalDigits(), FUNIT_100TH_MM, meDlgUnit);
- maMtrWidth.SetValue(static_cast<sal_Int64>(fTmpWidth), meDlgUnit);
- }
-
- { // #i75273# set height
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
- mfOldHeight = std::max( pItem ? (double)((const SfxUInt32Item*)pItem)->GetValue() : 0.0, 1.0 );
- double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
-
- if(maMtrHeight.GetDecimalDigits())
- fTmpHeight *= pow(10.0, maMtrHeight.GetDecimalDigits());
-
- fTmpHeight = MetricField::ConvertDoubleValue(fTmpHeight, maMtrHeight.GetBaseValue(), maMtrHeight.GetDecimalDigits(), FUNIT_100TH_MM, meDlgUnit);
- maMtrHeight.SetValue(static_cast<sal_Int64>(fTmpHeight), meDlgUnit);
- }
-
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE );
- if ( pItem )
- {
- maTsbSizeProtect.SetState( ( (const SfxBoolItem*)pItem )->GetValue()
- ? STATE_CHECK : STATE_NOCHECK );
- maTsbSizeProtect.EnableTriState( FALSE );
- }
- else
- maTsbSizeProtect.SetState( STATE_DONTKNOW );
-
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOWIDTH );
- if ( pItem )
- {
- maTsbAutoGrowWidth.SetState( ( ( const SfxBoolItem* )pItem )->GetValue()
- ? STATE_CHECK : STATE_NOCHECK );
- }
- else
- maTsbAutoGrowWidth.SetState( STATE_DONTKNOW );
-
- pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOHEIGHT );
- if ( pItem )
- {
- maTsbAutoGrowHeight.SetState( ( ( const SfxBoolItem* )pItem )->GetValue()
- ? STATE_CHECK : STATE_NOCHECK );
- }
- else
- maTsbAutoGrowHeight.SetState( STATE_DONTKNOW );
-
- // Ist Abgleich gesetzt?
- String aStr = GetUserData();
- maCbxScale.Check( (BOOL)aStr.ToInt32() );
-
- maTsbSizeProtect.SaveValue();
- maTsbAutoGrowWidth.SaveValue();
- maTsbAutoGrowHeight.SaveValue();
- ClickSizeProtectHdl( NULL );
-
- // #i2379# Disable controls for protected objects
- ChangeSizeProtectHdl( this );
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* SvxPositionSizeTabPage::Create( Window* pWindow, const SfxItemSet& rOutAttrs )
-{
- return( new SvxPositionSizeTabPage( pWindow, rOutAttrs ) );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* SvxPositionSizeTabPage::GetRanges()
-{
- return( pPosSizeRanges );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::ActivatePage( const SfxItemSet& rSet )
-{
- SfxRectangleItem* pRectItem = NULL;
-
- if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , FALSE, (const SfxPoolItem**) &pRectItem ) )
- {
- { // #i75273#
- const Rectangle aTempRect(pRectItem->GetValue());
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
- }
-
- SetMinMaxPosition();
- }
-}
-
-// -----------------------------------------------------------------------
-
-int SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
-{
- if( _pSet )
- {
- double fX((double)maMtrPosX.GetValue());
- double fY((double)maMtrPosY.GetValue());
-
- GetTopLeftPosition(fX, fY, maRange);
- const Rectangle aOutRectangle(
- basegfx::fround(fX), basegfx::fround(fY),
- basegfx::fround(fX + maRange.getWidth()), basegfx::fround(fY + maRange.getHeight()));
- _pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle));
-
- FillItemSet(*_pSet);
- }
-
- return LEAVE_PAGE;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxPositionSizeTabPage, ChangePosProtectHdl, void *, EMPTYARG )
-{
- // #106572# Remember user's last choice
- maTsbSizeProtect.SetState( maTsbPosProtect.GetState() == STATE_CHECK ? STATE_CHECK : mnProtectSizeState );
- UpdateControlStates();
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::UpdateControlStates()
-{
- const bool bPosProtect = maTsbPosProtect.GetState() == STATE_CHECK;
- const bool bSizeProtect = maTsbSizeProtect.GetState() == STATE_CHECK;
- const bool bHeightChecked = !maTsbAutoGrowHeight.IsTriStateEnabled() && (maTsbAutoGrowHeight.GetState() == STATE_CHECK);
- const bool bWidthChecked = !maTsbAutoGrowWidth.IsTriStateEnabled() && (maTsbAutoGrowWidth.GetState() == STATE_CHECK);
-
- maFlPosition.Enable( !bPosProtect && !mbPageDisabled );
- maFtPosX.Enable( !bPosProtect && !mbPageDisabled );
- maMtrPosX.Enable( !bPosProtect && !mbPageDisabled );
- maFtPosY.Enable( !bPosProtect && !mbPageDisabled );
- maMtrPosY.Enable( !bPosProtect && !mbPageDisabled );
- maFtPosReference.Enable( !bPosProtect && !mbPageDisabled );
- maCtlPos.Enable( !bPosProtect );
- maTsbPosProtect.Enable( !mbProtectDisabled && !mbPageDisabled );
-
- maFlSize.Enable( !mbSizeDisabled && !bSizeProtect );
- maCtlSize.Enable( !mbSizeDisabled && !bSizeProtect && (!bHeightChecked || !bWidthChecked) );
- maFtWidth.Enable( !mbSizeDisabled && !bSizeProtect && !bWidthChecked );
- maMtrWidth.Enable( !mbSizeDisabled && !bSizeProtect && !bWidthChecked );
- maFtHeight.Enable( !mbSizeDisabled && !bSizeProtect && !bHeightChecked );
- maMtrHeight.Enable( !mbSizeDisabled && !bSizeProtect && !bHeightChecked );
- maCbxScale.Enable( !mbSizeDisabled && !bSizeProtect && !bHeightChecked && !bWidthChecked );
- maFtSizeReference.Enable( !mbSizeDisabled && !bSizeProtect );
- maFlProtect.Enable( !mbProtectDisabled );
- maTsbSizeProtect.Enable( !mbProtectDisabled && !bPosProtect );
-
- maFlAdjust.Enable( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled );
- maTsbAutoGrowWidth.Enable( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled );
- maTsbAutoGrowHeight.Enable( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled );
-
- maCtlSize.Invalidate();
- maCtlPos.Invalidate();
-
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxPositionSizeTabPage, ChangeSizeProtectHdl, void *, EMPTYARG )
-{
- if( maTsbSizeProtect.IsEnabled() )
- {
- // #106572# Remember user's last choice
-
- // Note: this works only as long as the dialog is open. When
- // the user closes the dialog, there is no way to remember
- // whether size was enabled or disabled befor pos protect was
- // clicked. Thus, if pos protect is selected, the dialog is
- // closed and reopened again, unchecking pos protect will
- // always uncheck size protect, too. That's life.
- mnProtectSizeState = maTsbSizeProtect.GetState();
- }
-
- UpdateControlStates();
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxPositionSizeTabPage, ChangePosXHdl, void *, EMPTYARG )
-{
- return( 0L );
-}
-IMPL_LINK_INLINE_END( SvxPositionSizeTabPage, ChangePosXHdl, void *, EMPTYARG )
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_INLINE_START( SvxPositionSizeTabPage, ChangePosYHdl, void *, EMPTYARG )
-{
- return( 0L );
-}
-IMPL_LINK_INLINE_END( SvxPositionSizeTabPage, ChangePosYHdl, void *, EMPTYARG )
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::SetMinMaxPosition()
-{
- // position
- double fLeft(maWorkRange.getMinX());
- double fTop(maWorkRange.getMinY());
- double fRight(maWorkRange.getMaxX());
- double fBottom(maWorkRange.getMaxY());
-
- switch ( maCtlPos.GetActualRP() )
- {
- case RP_LT:
- {
- fRight -= maRange.getWidth();
- fBottom -= maRange.getHeight();
- break;
- }
- case RP_MT:
- {
- fLeft += maRange.getWidth() / 2.0;
- fRight -= maRange.getWidth() / 2.0;
- fBottom -= maRange.getHeight();
- break;
- }
- case RP_RT:
- {
- fLeft += maRange.getWidth();
- fBottom -= maRange.getHeight();
- break;
- }
- case RP_LM:
- {
- fRight -= maRange.getWidth();
- fTop += maRange.getHeight() / 2.0;
- fBottom -= maRange.getHeight() / 2.0;
- break;
- }
- case RP_MM:
- {
- fLeft += maRange.getWidth() / 2.0;
- fRight -= maRange.getWidth() / 2.0;
- fTop += maRange.getHeight() / 2.0;
- fBottom -= maRange.getHeight() / 2.0;
- break;
- }
- case RP_RM:
- {
- fLeft += maRange.getWidth();
- fTop += maRange.getHeight() / 2.0;
- fBottom -= maRange.getHeight() / 2.0;
- break;
- }
- case RP_LB:
- {
- fRight -= maRange.getWidth();
- fTop += maRange.getHeight();
- break;
- }
- case RP_MB:
- {
- fLeft += maRange.getWidth() / 2.0;
- fRight -= maRange.getWidth() / 2.0;
- fTop += maRange.getHeight();
- break;
- }
- case RP_RB:
- {
- fLeft += maRange.getWidth();
- fTop += maRange.getHeight();
- break;
- }
- }
-
- const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MAP_100TH_MM, meDlgUnit ) - 1L));
- fLeft = (fLeft > fMaxLong) ? fMaxLong : (fLeft < -fMaxLong) ? -fMaxLong : fLeft;
- fRight = (fRight > fMaxLong) ? fMaxLong : (fRight < -fMaxLong) ? -fMaxLong : fRight;
- fTop = (fTop > fMaxLong) ? fMaxLong : (fTop < -fMaxLong) ? -fMaxLong : fTop;
- fBottom = (fBottom > fMaxLong) ? fMaxLong : (fBottom < -fMaxLong) ? -fMaxLong : fBottom;
-
- // #i75273# normalizing when setting the min/max values was wrong, removed
- maMtrPosX.SetMin(basegfx::fround64(fLeft));
- maMtrPosX.SetFirst(basegfx::fround64(fLeft));
- maMtrPosX.SetMax(basegfx::fround64(fRight));
- maMtrPosX.SetLast(basegfx::fround64(fRight));
- maMtrPosY.SetMin(basegfx::fround64(fTop));
- maMtrPosY.SetFirst(basegfx::fround64(fTop));
- maMtrPosY.SetMax(basegfx::fround64(fBottom));
- maMtrPosY.SetLast(basegfx::fround64(fBottom));
-
- // size
- fLeft = maWorkRange.getMinX();
- fTop = maWorkRange.getMinY();
- fRight = maWorkRange.getMaxX();
- fBottom = maWorkRange.getMaxY();
- double fNewX(0);
- double fNewY(0);
-
- switch ( maCtlSize.GetActualRP() )
- {
- case RP_LT:
- {
- fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
- fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
- break;
- }
- case RP_MT:
- {
- fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0;
- fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
- break;
- }
- case RP_RT:
- {
- fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
- fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop );
- break;
- }
- case RP_LM:
- {
- fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
- fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0;
- break;
- }
- case RP_MM:
- {
- const double f1(maRange.getCenter().getX() - fLeft);
- const double f2(fRight - maRange.getCenter().getX());
- const double f3(std::min(f1, f2));
- const double f4(maRange.getCenter().getY() - fTop);
- const double f5(fBottom - maRange.getCenter().getY());
- const double f6(std::min(f4, f5));
-
- fNewX = f3 * 2.0;
- fNewY = f6 * 3.0;
-
- break;
- }
- case RP_RM:
- {
- fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
- fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0;
- break;
- }
- case RP_LB:
- {
- fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft );
- fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() );
- break;
- }
- case RP_MB:
- {
- fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0;
- fNewY = maWorkRange.getHeight() - ( maRange.getMaxY() - fBottom );
- break;
- }
- case RP_RB:
- {
- fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() );
- fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() );
- break;
- }
- }
-
- // #i75273# normalizing when setting the min/max values was wrong, removed
- maMtrWidth.SetMax(basegfx::fround64(fNewX));
- maMtrWidth.SetLast(basegfx::fround64(fNewX));
- maMtrHeight.SetMax(basegfx::fround64(fNewY));
- maMtrHeight.SetLast(basegfx::fround64(fNewY));
-}
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange)
-{
- switch (maCtlPos.GetActualRP())
- {
- case RP_LT:
- {
- break;
- }
- case RP_MT:
- {
- rfX -= rRange.getCenter().getX() - rRange.getMinX();
- break;
- }
- case RP_RT:
- {
- rfX -= rRange.getWidth();
- break;
- }
- case RP_LM:
- {
- rfY -= rRange.getCenter().getY() - rRange.getMinY();
- break;
- }
- case RP_MM:
- {
- rfX -= rRange.getCenter().getX() - rRange.getMinX();
- rfY -= rRange.getCenter().getY() - rRange.getMinY();
- break;
- }
- case RP_RM:
- {
- rfX -= rRange.getWidth();
- rfY -= rRange.getCenter().getY() - rRange.getMinY();
- break;
- }
- case RP_LB:
- {
- rfY -= rRange.getHeight();
- break;
- }
- case RP_MB:
- {
- rfX -= rRange.getCenter().getX() - rRange.getMinX();
- rfY -= rRange.getHeight();
- break;
- }
- case RP_RB:
- {
- rfX -= rRange.getWidth();
- rfY -= rRange.getHeight();
- break;
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::PointChanged( Window* pWindow, RECT_POINT eRP )
-{
- if( pWindow == &maCtlPos )
- {
- SetMinMaxPosition();
- switch( eRP )
- {
- case RP_LT:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getMinX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getMinY()) );
- break;
- }
- case RP_MT:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getCenter().getX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getMinY()) );
- break;
- }
- case RP_RT:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getMaxX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getMinY()) );
- break;
- }
- case RP_LM:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getMinX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getCenter().getY()) );
- break;
- }
- case RP_MM:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getCenter().getX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getCenter().getY()) );
- break;
- }
- case RP_RM:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getMaxX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getCenter().getY()) );
- break;
- }
- case RP_LB:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getMinX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getMaxY()) );
- break;
- }
- case RP_MB:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getCenter().getX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getMaxY()) );
- break;
- }
- case RP_RB:
- {
- maMtrPosX.SetValue( basegfx::fround64(maRange.getMaxX()) );
- maMtrPosY.SetValue( basegfx::fround64(maRange.getMaxY()) );
- break;
- }
- }
- }
- else
- {
- meRP = eRP;
-
- Rectangle aTmpRect( GetRect() );
- SetMinMaxPosition();
- }
-}
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::DisableResize()
-{
- mbSizeDisabled = true;
-}
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::DisableProtect()
-{
- mbProtectDisabled = true;
-}
-
-//------------------------------------------------------------------------
-
-Rectangle SvxPositionSizeTabPage::GetRect()
-{
- double fLeft(maRange.getMinX());
- double fTop(maRange.getMinY());
- double fRight(fLeft + (double)maMtrWidth.GetValue());
- double fBottom(fTop + (double)maMtrHeight.GetValue());
-
- switch ( maCtlSize.GetActualRP() )
- {
- case RP_LT:
- {
- break;
- }
- case RP_MT:
- {
- fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ) / 2.0;
- break;
- }
- case RP_RT:
- {
- fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() );
- break;
- }
- case RP_LM:
- {
- fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ) / 2.0;
- break;
- }
- case RP_MM:
- {
- fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ) / 2.0;
- fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ) / 2.0;
- break;
- }
- case RP_RM:
- {
- fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() );
- fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ) / 2.0;
- break;
- }
- case RP_LB:
- {
- fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() );
- break;
- }
- case RP_MB:
- {
- fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ) / 2.0;
- fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() );
- break;
- }
- case RP_RB:
- {
- fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() );
- fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() );
- break;
- }
- }
-
- return Rectangle(basegfx::fround(fLeft), basegfx::fround(fTop), basegfx::fround(fRight), basegfx::fround(fBottom));
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxPositionSizeTabPage, ChangeWidthHdl, void *, EMPTYARG )
-{
- if( maCbxScale.IsChecked() && maCbxScale.IsEnabled() )
- {
- sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)maMtrWidth.GetValue()) / mfOldWidth));
-
- if(nHeight <= maMtrHeight.GetMax(FUNIT_NONE))
- {
- maMtrHeight.SetUserValue(nHeight, FUNIT_NONE);
- }
- else
- {
- nHeight = maMtrHeight.GetMax(FUNIT_NONE);
- maMtrHeight.SetUserValue(nHeight);
-
- const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)nHeight) / mfOldHeight));
- maMtrWidth.SetUserValue(nWidth, FUNIT_NONE);
- }
- }
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxPositionSizeTabPage, ChangeHeightHdl, void *, EMPTYARG )
-{
- if( maCbxScale.IsChecked() && maCbxScale.IsEnabled() )
- {
- sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)maMtrHeight.GetValue()) / mfOldHeight));
-
- if(nWidth <= maMtrWidth.GetMax(FUNIT_NONE))
- {
- maMtrWidth.SetUserValue(nWidth, FUNIT_NONE);
- }
- else
- {
- nWidth = maMtrWidth.GetMax(FUNIT_NONE);
- maMtrWidth.SetUserValue(nWidth);
-
- const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)nWidth) / mfOldWidth));
- maMtrHeight.SetUserValue(nHeight, FUNIT_NONE);
- }
- }
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxPositionSizeTabPage, ClickSizeProtectHdl, void *, EMPTYARG )
-{
- UpdateControlStates();
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SvxPositionSizeTabPage, ClickAutoHdl, void *, EMPTYARG )
-{
- if( maCbxScale.IsChecked() )
- {
- mfOldWidth = std::max( (double)GetCoreValue( maMtrWidth, mePoolUnit ), 1.0 );
- mfOldHeight = std::max( (double)GetCoreValue( maMtrHeight, mePoolUnit ), 1.0 );
- }
-
- return( 0L );
-}
-
-//------------------------------------------------------------------------
-
-void SvxPositionSizeTabPage::FillUserData()
-{
- // Abgleich wird in der Ini-Datei festgehalten
- UniString aStr = UniString::CreateFromInt32( (sal_Int32) maCbxScale.IsChecked() );
- SetUserData( aStr );
-}
-
-// eof
diff --git a/svx/source/cui/transfrm.hrc b/svx/source/cui/transfrm.hrc
deleted file mode 100644
index a76cdb9cba..0000000000
--- a/svx/source/cui/transfrm.hrc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: transfrm.hrc,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#define TAB_CONTROL 1
-#define BTN_OK 2
-#define BTN_CANCEL 3
-#define BTN_HELP 4
-#define FT_POS_X 5
-#define FT_POS_Y 6
-#define MTR_FLD_POS_X 7
-#define MTR_FLD_POS_Y 8
-#define CBX_COPY 9
-#define TSB_PROTECT 10
-#define TSB_AUTO 11
-#define TSB_AUTOGROW_HEIGHT 12
-#define TSB_AUTOGROW_WIDTH 13
-#define BTN_RESET 14
-#define FT_WIDTH 15
-#define FT_HEIGHT 16
-#define MTR_FLD_WIDTH 17
-#define MTR_FLD_HEIGHT 18
-#define MTR_FLD_ANGLE 19
-#define CTL_RECT 20
-#define CTL_ANGLE 21
-#define CBX_SCALE 22
-#define FL_ADJUST 23
-#define FL_POSITION 24
-#define FL_SIZE 25
-#define FL_SLANT 26
-#define FL_RADIUS 27
-#define FT_RADIUS 28
-#define MTR_FLD_RADIUS 29
-#define FL_ANGLE 30
-#define FT_ANGLE 31
-#define TSB_VERTICAL 32
-#define FL_ANCHOR 33
-#define FT_ANCHOR 34
-#define LB_ANCHOR 35
-#define FT_ORIENT 36
-#define FT_REFERENCE 37
-#define FT_POSPRESETS 38
-#define FT_ANGLEPRESETS 39
-#define LB_ORIENT 40
-#define FT_SIZEREFERENCE 41
-#define CTL_SIZERECT 42
-#define FT_POSREFERENCE 43
-#define CTL_POSRECT 44
-#define TSB_POSPROTECT 45
-#define TSB_SIZEPROTECT 46
-#define FL_PROTECT 47
-#define FL_DIVIDER 48
-
-//
diff --git a/svx/source/cui/transfrm.hxx b/svx/source/cui/transfrm.hxx
deleted file mode 100644
index 8b25e2cee0..0000000000
--- a/svx/source/cui/transfrm.hxx
+++ /dev/null
@@ -1,308 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: transfrm.hxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_TRANSFRM_HXX
-#define _SVX_TRANSFRM_HXX
-
-// include ---------------------------------------------------------------
-
-#include <svx/dlgctrl.hxx>
-
-#ifndef _FIXED_HXX //autogen
-#include <vcl/fixed.hxx>
-#endif
-
-// #i75273#
-#include <basegfx/range/b2drange.hxx>
-
-// predefines
-class SdrView;
-
-/*************************************************************************
-|*
-|* Transform-Tab-Dialog
-|*
-\************************************************************************/
-
-/** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
- to disable the size controls */
-const USHORT SVX_OBJ_NORESIZE = 0x0100;
-
-/** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
- to disable the protect controls */
-const USHORT SVX_OBJ_NOPROTECT = 0x0200;
-
-class SvxTransformTabDialog : public SfxTabDialog
-{
-private:
- const SdrView* pView;
-
- USHORT nAnchorCtrls;
- Link aValidateLink;
-
- virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
-
-public:
-
- SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pView,
- USHORT nAnchorTypes = 0);
- ~SvxTransformTabDialog();
-
- //link for the Writer to validate positions
- void SetValidateFramePosLink( const Link& rLink );
-};
-
-/*************************************************************************
-|*
-|* position and size tab page
-|*
-\************************************************************************/
-
-class SvxPositionSizeTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- // position
- FixedLine maFlPosition;
- FixedText maFtPosX;
- MetricField maMtrPosX;
- FixedText maFtPosY;
- MetricField maMtrPosY;
- FixedText maFtPosReference;
- SvxRectCtl maCtlPos;
-
- // size
- FixedLine maFlSize;
- FixedText maFtWidth;
- MetricField maMtrWidth;
- FixedText maFtHeight;
- MetricField maMtrHeight;
- CheckBox maCbxScale;
- FixedText maFtSizeReference;
- SvxRectCtl maCtlSize;
-
- // protect
- FixedLine maFlProtect;
- TriStateBox maTsbPosProtect;
- TriStateBox maTsbSizeProtect;
-
- // adjust
- FixedLine maFlAdjust;
- TriStateBox maTsbAutoGrowWidth;
- TriStateBox maTsbAutoGrowHeight;
-
- FixedLine maFlDivider;
-
-private:
- const SfxItemSet& mrOutAttrs;
-
- const SdrView* mpView;
-
- // #i75273#
- basegfx::B2DRange maRange;
- basegfx::B2DRange maWorkRange;
- basegfx::B2DPoint maAnchor;
-
- SfxMapUnit mePoolUnit;
- FieldUnit meDlgUnit;
- MapUnit meMapUnit;
- TriState mnProtectSizeState;
- bool mbPageDisabled;
- bool mbProtectDisabled;
- bool mbSizeDisabled;
- bool mbAdjustDisabled;
-
- // frome size
- // #i75273#
- double mfOldWidth;
- double mfOldHeight;
- RECT_POINT meRP;
-
- //------------------------------------
-#if _SOLAR__PRIVATE
- DECL_LINK( ChangePosProtectHdl, void * );
- DECL_LINK( ChangeSizeProtectHdl, void * );
- DECL_LINK( ChangePosXHdl, void * );
- DECL_LINK( ChangePosYHdl, void * );
-// DECL_LINK( SetAnchorHdl, ListBox * );
-// DECL_LINK( SetOrientHdl, ListBox * );
-
- void SetMinMaxPosition();
- void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
-#endif
-
-#if _SOLAR__PRIVATE
- DECL_LINK( ChangeWidthHdl, void * );
- DECL_LINK( ChangeHeightHdl, void * );
- DECL_LINK( ClickSizeProtectHdl, void * );
- DECL_LINK( ClickAutoHdl, void * );
-
- void SetMaxSize( Rectangle aRect );
- Rectangle GetRect();
-#endif
-
-public:
- SvxPositionSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void Construct();
- void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
-
-// void ShowAnchorCtrls(USHORT nAnchorCtrls); // Writer-spezifische Controls anzeigen
- virtual void FillUserData();
-
- void DisableResize();
- void DisableProtect();
-
- void UpdateControlStates();
-};
-
-/*************************************************************************
-|*
-|* Drehwinkel-Tab-Page
-|*
-\************************************************************************/
-class SvxAngleTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlPosition;
- FixedText aFtPosX;
- MetricField aMtrPosX;
- FixedText aFtPosY;
- MetricField aMtrPosY;
- FixedText aFtPosPresets;
- SvxRectCtl aCtlRect;
-
- FixedLine aFlAngle;
- FixedText aFtAngle;
- MetricField aMtrAngle;
- FixedText aFtAnglePresets;
- SvxRectCtl aCtlAngle;
-
- const SfxItemSet& rOutAttrs;
- const SdrView* pView;
-
- // #i75273#
- basegfx::B2DRange maRange;
- basegfx::B2DPoint maAnchor;
-
- SfxMapUnit ePoolUnit;
- FieldUnit eDlgUnit;
- MapUnit eMapUnit;
- //------------------------------------
-#if _SOLAR__PRIVATE
- DECL_LINK( ModifiedHdl, void * );
-#endif
-public:
- SvxAngleTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void Construct();
- void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
-};
-
-/*************************************************************************
-|*
-|* Schraegstellen/Eckenradius-Tab-Page
-|*
-\************************************************************************/
-class SvxSlantTabPage : public SvxTabPage
-{
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
-
-private:
- FixedLine aFlRadius;
- FixedText aFtRadius;
- MetricField aMtrRadius;
- //TriStateBox aTsbVertical;
- FixedLine aFlAngle;
- FixedText aFtAngle;
- MetricField aMtrAngle;
- //SvxRectCtl aCtlAngle;
-
- const SfxItemSet& rOutAttrs;
-
- const SdrView* pView;
-
- // #i75273#
- basegfx::B2DRange maRange;
-
- SfxMapUnit ePoolUnit;
- FieldUnit eDlgUnit;
- MapUnit eMapUnit;
- //------------------------------------
-public:
- SvxSlantTabPage( Window* pParent, const SfxItemSet& rInAttrs );
-
- static SfxTabPage* Create( Window*, const SfxItemSet& );
- static USHORT* GetRanges();
-
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet & );
-
- virtual void ActivatePage( const SfxItemSet& rSet );
- virtual int DeactivatePage( SfxItemSet* pSet );
-
- virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
-
- void Construct();
- void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
-};
-
-
-
-#endif // _SVX_TRANSFRM_HXX
-
diff --git a/svx/source/cui/transfrm.src b/svx/source/cui/transfrm.src
deleted file mode 100644
index 4fd301d219..0000000000
--- a/svx/source/cui/transfrm.src
+++ /dev/null
@@ -1,612 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: transfrm.src,v $
- * $Revision: 1.57 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ------------------------------------------------------------------
-#include <svtools/controldims.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "transfrm.hrc"
- // pragma -------------------------------------------------------------------
-
-#define MA_TABPAGE_HEIGHT 185
-
- // RID_SVXPAGE_POSITION_SIZE ------------------------------------------------
-TabPage RID_SVXPAGE_POSITION_SIZE
-{
- HelpId = HID_TRANS_POSITION_SIZE ;
- Hide = TRUE ;
- Text [ en-US ] = "Position and Size" ;
- Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ;
-
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Position" ;
- };
- FixedText FT_POS_X
- {
- Pos = MAP_APPFONT ( 12 , 16 + 8 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Position ~X" ;
- };
- FixedText FT_POS_Y
- {
- Pos = MAP_APPFONT ( 12 , 32 + 8 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Position ~Y" ;
- };
- MetricField MTR_FLD_POS_X
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 14 + 8 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -120000 ;
- Maximum = 240000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_POS_Y
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 30 + 8 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -120000 ;
- Maximum = 240000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- FixedText FT_POSREFERENCE
- {
- Pos = MAP_APPFONT ( 178 , 2 + 8 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "Base point";
- };
- Control CTL_POSRECT
- {
- HelpId = HID_TPPOSITION_CTRL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 178 , 12 + 8 ) ;
- Size = MAP_APPFONT ( 48 , 34 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Base point" ;
- };
-
- // size
-
- FixedLine FL_SIZE
- {
- Pos = MAP_APPFONT ( 6 , 56 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 16 + 61 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Wi~dth" ;
- };
- FixedText FT_HEIGHT
- {
- Pos = MAP_APPFONT ( 12 , 32 + 61 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "H~eight" ;
- };
- MetricField MTR_FLD_WIDTH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 14 + 61 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 120000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_HEIGHT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 30 + 61 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 120000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- FixedText FT_SIZEREFERENCE
- {
- Pos = MAP_APPFONT ( 178 , 2 + 61 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "Base point";
- };
- Control CTL_SIZERECT
- {
- HelpId = HID_TPSIZE_CTRL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 178 , 12 + 61 ) ;
- Size = MAP_APPFONT ( 48 , 34 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Base point" ;
- };
- CheckBox CBX_SCALE
- {
- Pos = MAP_APPFONT ( 12 , 47 + 61 ) ;
- Size = MAP_APPFONT ( 162 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Keep ratio" ;
- };
-
- // Protect
-
- FixedLine FL_PROTECT
- {
- Pos = MAP_APPFONT ( 6 , 120 ) ;
- Size = MAP_APPFONT ( 119 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Protect" ;
- };
-
- TriStateBox TSB_POSPROTECT
- {
- Pos = MAP_APPFONT ( 12 , 10 + 120 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- Text [ en-US ] = "Position" ;
- TabStop = TRUE ;
- };
-
- TriStateBox TSB_SIZEPROTECT
- {
- Pos = MAP_APPFONT ( 12 , 24 + 120 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- Text [ en-US ] = "~Size" ;
- TabStop = TRUE ;
- };
-
- // Adjust
-
- FixedLine FL_ADJUST
- {
- Pos = MAP_APPFONT ( 6 + 123 + 6 , 120 ) ;
- Size = MAP_APPFONT ( 119 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Adapt" ;
- };
- TriStateBox TSB_AUTOGROW_WIDTH
- {
- Pos = MAP_APPFONT ( 12 + 121 + 8, 10 + 120 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- Text [ en-US ] = "~Fit width to text" ;
- TabStop = TRUE ;
- };
- TriStateBox TSB_AUTOGROW_HEIGHT
- {
- Pos = MAP_APPFONT ( 12 + 121 + 8, 24 + 120 ) ;
- Size = MAP_APPFONT ( 113 , 10 ) ;
- Text [ en-US ] = "Fit ~height to text" ;
- TabStop = TRUE ;
- };
-
- FixedLine FL_DIVIDER
- {
- Pos = MAP_APPFONT( 6 + 119 + 5, 128 );
- Size = MAP_APPFONT( RSC_CD_FIXEDLINE_WIDTH, 26 );
- Vert = True;
- };
-
- // Anchor
-
- FixedLine FL_ANCHOR
- {
- Pos = MAP_APPFONT ( 6 + 123 + 6 , 120 ) ;
- Size = MAP_APPFONT ( 119 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Hide = TRUE ;
- Text [ en-US ] = "Anchor" ;
- };
- FixedText FT_ANCHOR
- {
- Pos = MAP_APPFONT ( 12 + 121 + 8, 10 + 120 ) ;
- Size = MAP_APPFONT ( 37 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "~Anchor" ;
- };
- ListBox LB_ANCHOR
- {
- Pos = MAP_APPFONT ( 46 + 121 + 16 , 8 + 120 ) ;
- Size = MAP_APPFONT ( 54 , 60 ) ;
- Hide = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "To paragraph" ; > ;
- < "As character" ; > ;
- < "To page" ; > ;
- < "To frame" ; > ;
- };
- };
- FixedText FT_ORIENT
- {
- Pos = MAP_APPFONT ( 12 + 121 + 8, 24 + 120 ) ;
- Size = MAP_APPFONT ( 37 , 10 ) ;
- Hide = TRUE ;
- Text [ en-US ] = "P~osition";
- };
- ListBox LB_ORIENT
- {
- Pos = MAP_APPFONT ( 46 + 121 + 16 , 22 + 120 );
- Size = MAP_APPFONT ( 54 , 60 ) ;
- Hide = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "From top" ; > ;
- < "Above" ; > ;
- < "Centered" ; > ;
- < "Below" ; > ;
- < "Top of character" ; > ;
- < "Center of character" ; > ;
- < "Bottom of character" ; > ;
- < "Top of line" ; > ;
- < "Center of line" ; > ;
- < "Bottom of line" ; > ;
- };
- };
-};
-
- // RID_SVXPAGE_ANGLE --------------------------------------------------------
-TabPage RID_SVXPAGE_ANGLE
-{
- HelpId = HID_TRANS_ANGLE ;
- Hide = TRUE ;
- Text [ en-US ] = "Angle" ;
- Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ;
- FixedLine FL_POSITION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Pivot point" ;
- };
- FixedText FT_POS_X
- {
- Pos = MAP_APPFONT ( 12 , 16 + 11 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Position ~X" ;
- };
- FixedText FT_POS_Y
- {
- Pos = MAP_APPFONT ( 12 , 32 + 11 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Position ~Y" ;
- };
- MetricField MTR_FLD_POS_X
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 14 + 11 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -500000 ;
- Maximum = 500000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- MetricField MTR_FLD_POS_Y
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 30 + 11 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -500000 ;
- Maximum = 500000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- FixedText FT_POSPRESETS
- {
- Pos = MAP_APPFONT ( 178 , 14 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "Default settings";
- };
- Control CTL_RECT
- {
- HelpId = HID_TPROTATION_CTRL1 ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 178 , 14 + 11 ) ;
- Size = MAP_APPFONT ( 70 , 48 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Rotation point" ;
- };
- FixedLine FL_ANGLE
- {
- Pos = MAP_APPFONT ( 6 , 71 + 11 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Rotation angle" ;
- };
- FixedText FT_ANGLE
- {
- Pos = MAP_APPFONT ( 12 , 84 + 22 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Angle" ;
- };
- MetricField MTR_FLD_ANGLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 82 + 22 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -500000 ;
- Maximum = 500000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText [ en-US ] = " degrees" ;
- SpinSize = 500 ;
- };
- FixedText FT_ANGLEPRESETS
- {
- Pos = MAP_APPFONT ( 178 , 82 + 11 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
- Text [ en-US ] = "Default settings";
- };
- Control CTL_ANGLE
- {
- HelpId = HID_TPROTATION_CTRL2 ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 178 , 82 + 22 ) ;
- Size = MAP_APPFONT ( 70 , 48 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Rotation Angle";
- };
-};
- // RID_SVXPAGE_SLANT -----------------------------------------------------
-TabPage RID_SVXPAGE_SLANT
-{
- HelpId = HID_TRANS_SLANT ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ;
- Text [ en-US ] = "Slant & Corner Radius" ;
- FixedLine FL_RADIUS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Corner radius" ;
- };
- FixedText FT_RADIUS
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Radius" ;
- };
- MetricField MTR_FLD_RADIUS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 14 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 500000 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- SpinSize = 10 ;
- };
- FixedLine FL_SLANT
- {
- Pos = MAP_APPFONT ( 6 , 35 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Slant" ;
- };
- FixedText FT_ANGLE
- {
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Angle" ;
- };
- MetricField MTR_FLD_ANGLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 46 ) ;
- Size = MAP_APPFONT ( 54 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -8900 ;
- First = -8900 ;
- Maximum = 8900 ;
- Last = 8900 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_CUSTOM ;
- SpinSize = 500 ;
- CustomUnitText [ en-US ] = " degrees" ;
- };
-};
- // RID_SVXDLG_TRANSFORM -----------------------------------------------------
-
-#define _POS_SIZE_TEXT \
- Text [ en-US ] = "Position and Size" ; \
-
-
-TabDialog RID_SVXDLG_TRANSFORM\
-{
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 289 , MA_TABPAGE_HEIGHT + 41 ) ;
- Text [ en-US ] = "Position and Size" ;\
- Moveable = TRUE ;
- TabControl TAB_CONTROL\
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ;
- PageList =
- {
- PageItem\
- {
- Identifier = RID_SVXPAGE_POSITION_SIZE ;
- PageResID = RID_SVXPAGE_POSITION_SIZE ;
- _POS_SIZE_TEXT
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_SWPOSSIZE;
- PageResID = RID_SVXPAGE_SWPOSSIZE;
- _POS_SIZE_TEXT
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_ANGLE ;
- Text [ en-US ] = "Rotation" ;
- PageResID = RID_SVXPAGE_ANGLE ;
- };
- PageItem
- {
- Identifier = RID_SVXPAGE_SLANT ;
- PageResID = RID_SVXPAGE_SLANT ;
- Text [ en-US ] = "Slant & Corner Radius" ;
- };
- };
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/treeopt.cxx b/svx/source/cui/treeopt.cxx
deleted file mode 100644
index 01049d3c10..0000000000
--- a/svx/source/cui/treeopt.cxx
+++ /dev/null
@@ -1,2861 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: treeopt.cxx,v $
- * $Revision: 1.58 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
-#include <com/sun/star/linguistic2/XDictionaryList.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/util/XMacroExpander.hpp>
-#include <osl/module.hxx>
-
-#include <com/sun/star/util/XCloseable.hpp>
-#include <com/sun/star/frame/XLoadable.hpp>
-#include <tools/rcid.h>
-
-#include <tools/shl.hxx>
-
-#include <comphelper/processfactory.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/oooimprovement/XCoreController.hpp>
-#include <comphelper/configurationhelper.hxx>
-#include <com/sun/star/awt/XDialogProvider.hpp>
-#include <com/sun/star/awt/XDialogProvider2.hpp>
-#include <com/sun/star/awt/XContainerWindowProvider.hpp>
-#include <com/sun/star/awt/XDialogEventHandler.hpp>
-#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
-#include <com/sun/star/awt/PosSize.hpp>
-#include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/awt/XTabController.hpp>
-#include <vcl/help.hxx>
-#ifndef _LINGUISTIC_MISC_HHX_
-#include <linguistic/misc.hxx>
-#endif
-#include <svtools/helpopt.hxx>
-#include <svtools/moduleoptions.hxx>
-#include <svtools/languageoptions.hxx>
-#include <svtools/optionsdlg.hxx>
-#include <sfx2/module.hxx>
-#include <vcl/msgbox.hxx>
-#include <sfx2/dispatch.hxx>
-#include <vcl/waitobj.hxx>
-#include <svtools/slstitm.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <svtools/viewoptions.hxx>
-#include <sfx2/printopt.hxx>
-#include <osl/module.h>
-#include <osl/process.h>
-#include <rtl/bootstrap.hxx>
-
-#include <svtools/misccfg.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/tplpitem.hxx>
-#include <svtools/apearcfg.hxx>
-#include <svtools/linguprops.hxx>
-#include <sfx2/app.hxx>
-#include <svx/xdef.hxx>
-#include <svx/xflclit.hxx>
-#include <svx/xpool.hxx>
-#ifndef _SVX_TAB_AREA_HXX //autogen
-#include "cuitabarea.hxx"
-#endif
-#include "ofaitem.hxx"
-#include "opthtml.hxx"
-#include "optcolor.hxx"
-#include "optctl.hxx"
-#include "optjava.hxx"
-#include "optsave.hxx"
-#include "optpath.hxx"
-#include "cuioptgenrl.hxx"
-#include <svx/optlingu.hxx>
-#ifndef _SVX_TAB_AREA_HXX //autogen
-#include "cuitabarea.hxx"
-#endif
-#include "optinet2.hxx"
-#include "optasian.hxx"
-#include "optaccessibility.hxx"
-#include "optjsearch.hxx"
-#include "connpooloptions.hxx"
-#include "optupdt.hxx"
-#include "svx/optimprove.hxx"
-#include "optchart.hxx"
-
-#include "optgdlg.hxx"
-#include "optmemory.hxx"
-#include "optfltr.hxx"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include <svx/dialmgr.hxx>
-#include "treeopt.hxx"
-#include "treeopt.hrc"
-#include "fontsubs.hxx"
-#include "unolingu.hxx"
-#include <svx/xtable.hxx>
-#include "connpoolconfig.hxx"
-#include "dbregister.hxx"
-#include "dbregisterednamesconfig.hxx"
-#include "cfgchart.hxx"
-
-#ifndef _SVX_LANGITEM_HXX
-#define ITEMID_LANGUAGE SID_ATTR_CHAR_LANGUAGE
-#include <svx/langitem.hxx>
-#endif
-#ifndef _SVX_OPTITEMS_HXX
-
-
-#include <optitems.hxx>
-#endif
-#include <drawitem.hxx>
-#include <rtl/uri.hxx>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::linguistic2;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-
-#ifdef C2U
- #error "Who define C2U before! I use it to create const ascii strings ..."
-#else
- #define C2U(cChar) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( cChar ) )
-#endif
-
-#define HINT_TIMEOUT 200
-#define SELECT_FIRST_TIMEOUT 0
-#define SELECT_TIMEOUT 300
-#define COLORPAGE_UNKNOWN ((sal_uInt16)0xFFFF)
-#define EXPAND_PROTOCOL "vnd.sun.star.expand:"
-
-LastPageSaver* OfaTreeOptionsDialog::pLastPageSaver = NULL;
-
-// some stuff for easier changes for SvtViewOptions
-static const sal_Char* pViewOptDataName = "page data";
-#define VIEWOPT_DATANAME rtl::OUString::createFromAscii( pViewOptDataName )
-
-static XOutdevItemPool* mpStaticXOutdevItemPool = 0L;
-
-static inline void SetViewOptUserItem( SvtViewOptions& rOpt, const String& rData )
-{
- rOpt.SetUserItem( VIEWOPT_DATANAME, makeAny( rtl::OUString( rData ) ) );
-}
-
-static inline String GetViewOptUserItem( const SvtViewOptions& rOpt )
-{
- Any aAny( rOpt.GetUserItem( VIEWOPT_DATANAME ) );
- rtl::OUString aUserData;
- aAny >>= aUserData;
-
- return String( aUserData );
-}
-
-struct ModuleToGroupNameMap_Impl
-{
- const char* m_pModule;
- String m_sGroupName;
- USHORT m_nNodeId;
-};
-
-static OfaPageResource* pPageRes = NULL;
-
-static ModuleToGroupNameMap_Impl ModuleMap[] =
-{
- { "ProductName", String::EmptyString(), SID_GENERAL_OPTIONS },
- { "LanguageSettings", String::EmptyString(), SID_LANGUAGE_OPTIONS },
- { "Internet", String::EmptyString(), SID_INET_DLG },
- { "LoadSave", String::EmptyString(), SID_FILTER_DLG },
- { "Writer", String::EmptyString(), SID_SW_EDITOPTIONS },
- { "WriterWeb", String::EmptyString(), SID_SW_ONLINEOPTIONS },
- { "Math", String::EmptyString(), SID_SM_EDITOPTIONS },
- { "Calc", String::EmptyString(), SID_SC_EDITOPTIONS },
- { "Impress", String::EmptyString(), SID_SD_EDITOPTIONS },
- { "Draw", String::EmptyString(), SID_SD_GRAPHIC_OPTIONS },
- { "Charts", String::EmptyString(), SID_SCH_EDITOPTIONS },
- { "Base", String::EmptyString(), SID_SB_STARBASEOPTIONS },
-
- { NULL, String::EmptyString(), 0xFFFF }
-};
-
-static void setGroupName( const rtl::OUString& rModule, const String& rGroupName )
-{
- USHORT nIndex = 0;
- while ( ModuleMap[ nIndex ].m_pModule )
- {
- rtl::OUString sTemp =
- rtl::OUString::createFromAscii( ModuleMap[ nIndex ].m_pModule );
- if ( sTemp == rModule )
- {
- ModuleMap[ nIndex ].m_sGroupName = rGroupName;
- break;
- }
- ++nIndex;
- }
-}
-
-static String getGroupName( const rtl::OUString& rModule, bool bForced )
-{
- String sGroupName;
- USHORT nIndex = 0;
- while ( ModuleMap[ nIndex ].m_pModule )
- {
- rtl::OUString sTemp =
- rtl::OUString::createFromAscii( ModuleMap[ nIndex ].m_pModule );
- if ( sTemp == rModule )
- {
- sGroupName = ModuleMap[ nIndex ].m_sGroupName;
- break;
- }
- ++nIndex;
- }
-
- if ( sGroupName.Len() == 0 && bForced )
- {
- if ( !pPageRes )
- pPageRes = new OfaPageResource;
-
- if ( rModule == C2U("Writer") )
- sGroupName = pPageRes->GetTextArray().GetString(0);
- else if ( rModule == C2U("WriterWeb") )
- sGroupName = pPageRes->GetHTMLArray().GetString(0);
- else if ( rModule == C2U("Calc") )
- sGroupName = pPageRes->GetCalcArray().GetString(0);
- else if ( rModule == C2U("Impress") )
- sGroupName = pPageRes->GetImpressArray().GetString(0);
- else if ( rModule == C2U("Draw") )
- sGroupName = pPageRes->GetDrawArray().GetString(0);
- else if ( rModule == C2U("Math") )
- sGroupName = pPageRes->GetStarMathArray().GetString(0);
- else if ( rModule == C2U("Base") )
- sGroupName = pPageRes->GetDatasourcesArray().GetString(0);
- }
- return sGroupName;
-}
-
-static void deleteGroupNames()
-{
- USHORT nIndex = 0;
- while ( ModuleMap[ nIndex ].m_pModule )
- ModuleMap[ nIndex++ ].m_sGroupName = String::EmptyString();
-}
-
-static USHORT getGroupNodeId( const rtl::OUString& rModule )
-{
- USHORT nNodeId = 0xFFFF, nIndex = 0;
- while ( ModuleMap[ nIndex ].m_pModule )
- {
- rtl::OUString sTemp =
- rtl::OUString::createFromAscii( ModuleMap[ nIndex ].m_pModule );
- if ( sTemp == rModule )
- {
- nNodeId = ModuleMap[ nIndex ].m_nNodeId;
- break;
- }
- ++nIndex;
- }
-
- return nNodeId;
-}
-
-/*-- 29.10.2004 13:57:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-class MailMergeCfg_Impl : public utl::ConfigItem
-{
- friend class SvxEMailTabPage;
- // variables
- sal_Bool bIsEmailSupported;
-
-public:
- MailMergeCfg_Impl();
- virtual ~MailMergeCfg_Impl();
-
- virtual void Commit();
-
- sal_Bool IsEmailSupported() const {return bIsEmailSupported;}
-
-};
-/*-- 29.10.2004 13:57:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-MailMergeCfg_Impl::MailMergeCfg_Impl() :
- utl::ConfigItem(C2U("Office.Writer/MailMergeWizard")),
- bIsEmailSupported(sal_False)
-{
- Sequence<rtl::OUString> aNames(1);
- aNames.getArray()[0] = C2U("EMailSupported");
- const Sequence< Any > aValues = GetProperties(aNames);
- const Any* pValues = aValues.getConstArray();
- if(aValues.getLength() && pValues[0].hasValue())
- pValues[0] >>= bIsEmailSupported;
-}
-/*-- 29.10.2004 13:57:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-MailMergeCfg_Impl::~MailMergeCfg_Impl()
-{
-}
-/* -------------------------------------------------------------------------*/
-void MailMergeCfg_Impl::Commit()
-{
-}
-
-//typedef SfxTabPage* (*FNCreateTabPage)( Window *pParent, const SfxItemSet &rAttrSet );
-SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet )
-{
- CreateTabPage fnCreate = 0;
- switch(nId)
- {
- case RID_SFXPAGE_SAVE: fnCreate = &SvxSaveTabPage::Create; break;
- case RID_SFXPAGE_PATH: fnCreate = &SvxPathTabPage::Create; break;
- case RID_SFXPAGE_GENERAL: fnCreate = &SvxGeneralTabPage::Create; break;
- case RID_SFXPAGE_PRINTOPTIONS: fnCreate = &SfxCommonPrintOptionsTabPage::Create; break;
- case OFA_TP_LANGUAGES: fnCreate = &OfaLanguagesTabPage::Create; break;
- case RID_SFXPAGE_LINGU: fnCreate = &SvxLinguTabPage::Create; break;
- case RID_SVXPAGE_COLOR: fnCreate = &SvxColorTabPage::Create; break;
- case OFA_TP_VIEW: fnCreate = &OfaViewTabPage::Create; break;
- case OFA_TP_MISC: fnCreate = &OfaMiscTabPage::Create; break;
- case OFA_TP_MEMORY: fnCreate = &OfaMemoryOptionsPage::Create; break;
- case RID_SVXPAGE_ASIAN_LAYOUT: fnCreate = &SvxAsianLayoutPage::Create; break;
- case RID_SVX_FONT_SUBSTITUTION: fnCreate = &SvxFontSubstTabPage::Create; break;
- case RID_SVXPAGE_INET_PROXY: fnCreate = &SvxProxyTabPage::Create; break;
- case RID_SVXPAGE_INET_SEARCH: fnCreate = &SvxSearchTabPage::Create; break;
- case RID_SVXPAGE_INET_SECURITY: fnCreate = &SvxSecurityTabPage::Create; break;
- case RID_SVXPAGE_INET_MAIL: fnCreate = &SvxEMailTabPage::Create; break;
- case RID_SVXPAGE_COLORCONFIG: fnCreate = &SvxColorOptionsTabPage::Create; break;
- case RID_OFAPAGE_HTMLOPT: fnCreate = &OfaHtmlTabPage::Create; break;
- case SID_OPTFILTER_MSOFFICE: fnCreate = &OfaMSFilterTabPage::Create; break;
- case RID_OFAPAGE_MSFILTEROPT2: fnCreate = &OfaMSFilterTabPage2::Create; break;
- case RID_SVXPAGE_JSEARCH_OPTIONS: fnCreate = &SvxJSearchOptionsPage::Create ; break;
- case SID_SB_CONNECTIONPOOLING: fnCreate = &::offapp::ConnectionPoolOptionsPage::Create; break;
- case SID_SB_DBREGISTEROPTIONS: fnCreate = &::svx::DbRegistrationOptionsPage::Create; break;
- case RID_SVXPAGE_ACCESSIBILITYCONFIG: fnCreate = &SvxAccessibilityOptionsTabPage::Create; break;
- case RID_SVXPAGE_SSO: fnCreate = GetSSOCreator(); break;
- case RID_SVXPAGE_OPTIONS_CTL: fnCreate = &SvxCTLOptionsPage::Create ; break;
- //added by jmeng begin
- case RID_SVXPAGE_INET_MOZPLUGIN: fnCreate = &MozPluginTabPage::Create; break;
- //added by jmeng end
- case RID_SVXPAGE_OPTIONS_JAVA: fnCreate = &SvxJavaOptionsPage::Create ; break;
- case RID_SVXPAGE_ONLINEUPDATE: fnCreate = &SvxOnlineUpdateTabPage::Create; break;
- case RID_OPTPAGE_CHART_DEFCOLORS: fnCreate = &SvxDefaultColorOptPage::Create; break;
- case RID_SVXPAGE_IMPROVEMENT: fnCreate = &SvxImprovementOptionsPage::Create; break;
- }
-
- SfxTabPage* pRet = fnCreate ? (*fnCreate)( pParent, rSet ) : NULL;
- return pRet;
-}
-
-
-struct OptionsMapping_Impl
-{
- const char* m_pGroupName;
- const char* m_pPageName;
- USHORT m_nPageId;
-};
-
-static OptionsMapping_Impl __READONLY_DATA OptionsMap_Impl[] =
-{
-// GROUP PAGE PAGE-ID
- { "ProductName", NULL, SID_GENERAL_OPTIONS },
- { "ProductName", "UserData", RID_SFXPAGE_GENERAL },
- { "ProductName", "General", OFA_TP_MISC },
- { "ProductName", "Memory", OFA_TP_MEMORY },
- { "ProductName", "View", OFA_TP_VIEW },
- { "ProductName", "Print", RID_SFXPAGE_PRINTOPTIONS },
- { "ProductName", "Paths", RID_SFXPAGE_PATH },
- { "ProductName", "Colors", RID_SVXPAGE_COLOR },
- { "ProductName", "Fonts", RID_SVX_FONT_SUBSTITUTION },
- { "ProductName", "Security", RID_SVXPAGE_INET_SECURITY },
- { "ProductName", "Appearance", RID_SVXPAGE_COLORCONFIG },
- { "ProductName", "Accessibility", RID_SVXPAGE_ACCESSIBILITYCONFIG },
- { "ProductName", "Java", RID_SVXPAGE_OPTIONS_JAVA },
- { "ProductName", "NetworkIdentity", RID_SVXPAGE_SSO },
- { "ProductName", "OnlineUpdate", RID_SVXPAGE_ONLINEUPDATE },
- { "ProductName", "ImprovementProgram", RID_SVXPAGE_IMPROVEMENT },
- { "LanguageSettings", NULL, SID_LANGUAGE_OPTIONS },
- { "LanguageSettings", "Languages", OFA_TP_LANGUAGES },
- { "LanguageSettings", "WritingAids", RID_SFXPAGE_LINGU },
- { "LanguageSettings", "SearchingInJapanese", RID_SVXPAGE_JSEARCH_OPTIONS },
- { "LanguageSettings", "AsianLayout", RID_SVXPAGE_ASIAN_LAYOUT },
- { "LanguageSettings", "ComplexTextLayout", RID_SVXPAGE_OPTIONS_CTL },
- { "Internet", NULL, SID_INET_DLG },
- { "Internet", "Proxy", RID_SVXPAGE_INET_PROXY },
- { "Internet", "Search", RID_SVXPAGE_INET_SEARCH },
- { "Internet", "Email", RID_SVXPAGE_INET_MAIL },
- { "Internet", "MozillaPlugin", RID_SVXPAGE_INET_MOZPLUGIN },
- { "LoadSave", NULL, SID_FILTER_DLG },
- { "LoadSave", "General", RID_SFXPAGE_SAVE },
- { "LoadSave", "VBAProperties", SID_OPTFILTER_MSOFFICE },
- { "LoadSave", "MicrosoftOffice", RID_OFAPAGE_MSFILTEROPT2 },
- { "LoadSave", "HTMLCompatibility", RID_OFAPAGE_HTMLOPT },
- { "Writer", NULL, SID_SW_EDITOPTIONS },
- { "Writer", "General", RID_SW_TP_OPTLOAD_PAGE },
- { "Writer", "View", RID_SW_TP_CONTENT_OPT },
- { "Writer", "FormattingAids", RID_SW_TP_OPTSHDWCRSR },
- { "Writer", "Grid", RID_SVXPAGE_GRID },
- { "Writer", "BasicFontsWestern", RID_SW_TP_STD_FONT },
- { "Writer", "BasicFontsAsian", RID_SW_TP_STD_FONT_CJK },
- { "Writer", "BasicFontsCTL", RID_SW_TP_STD_FONT_CTL },
- { "Writer", "Print", RID_SW_TP_OPTPRINT_PAGE },
- { "Writer", "Table", RID_SW_TP_OPTTABLE_PAGE },
- { "Writer", "Changes", RID_SW_TP_REDLINE_OPT },
- { "Writer", "Compatibility", RID_SW_TP_OPTCOMPATIBILITY_PAGE },
- { "Writer", "AutoCaption", RID_SW_TP_OPTCAPTION_PAGE },
- { "Writer", "MailMerge", RID_SW_TP_MAILCONFIG },
- { "WriterWeb", NULL, SID_SW_ONLINEOPTIONS },
- { "WriterWeb", "View", RID_SW_TP_HTML_CONTENT_OPT },
- { "WriterWeb", "FormattingAids", RID_SW_TP_HTML_OPTSHDWCRSR },
- { "WriterWeb", "Grid", RID_SW_TP_HTML_OPTGRID_PAGE },
- { "WriterWeb", "Print", RID_SW_TP_HTML_OPTPRINT_PAGE },
- { "WriterWeb", "Table", RID_SW_TP_HTML_OPTTABLE_PAGE },
- { "WriterWeb", "Background", RID_SW_TP_BACKGROUND },
- { "Math", NULL, SID_SM_EDITOPTIONS },
- { "Math", "Settings", SID_SM_TP_PRINTOPTIONS },
- { "Calc", NULL, SID_SC_EDITOPTIONS },
- { "Calc", "General", SID_SC_TP_LAYOUT },
- { "Calc", "View", SID_SC_TP_CONTENT },
- { "Calc", "International", RID_OFA_TP_INTERNATIONAL },
- { "Calc", "Calculate", SID_SC_TP_CALC },
- { "Calc", "SortLists", SID_SC_TP_USERLISTS },
- { "Calc", "Changes", SID_SC_TP_CHANGES },
- { "Calc", "Grid", SID_SC_TP_GRID },
- { "Calc", "Print", RID_SC_TP_PRINT },
- { "Impress", NULL, SID_SD_EDITOPTIONS },
- { "Impress", "General", SID_SI_TP_MISC },
- { "Impress", "View", SID_SI_TP_CONTENTS },
- { "Impress", "Grid", SID_SI_TP_SNAP },
- { "Impress", "Print", SID_SI_TP_PRINT },
- { "Draw", NULL, SID_SD_GRAPHIC_OPTIONS },
- { "Draw", "General", SID_SD_TP_MISC },
- { "Draw", "View", SID_SD_TP_CONTENTS },
- { "Draw", "Grid", SID_SD_TP_SNAP },
- { "Draw", "Print", SID_SD_TP_PRINT },
- { "Charts", NULL, SID_SCH_EDITOPTIONS },
- { "Charts", "DefaultColors", RID_OPTPAGE_CHART_DEFCOLORS },
- { "Base", NULL, SID_SB_STARBASEOPTIONS },
- { "Base", "Connections", SID_SB_CONNECTIONPOOLING },
- { "Base", "Databases", SID_SB_DBREGISTEROPTIONS },
- { NULL, NULL, 0 }
-};
-
-static sal_Bool lcl_getStringFromID( USHORT _nPageId, String& _rGroupName, String& _rPageName )
-{
- sal_Bool bRet = sal_False;
-
- USHORT nIdx = 0;
- while ( OptionsMap_Impl[nIdx].m_pGroupName != NULL )
- {
- if ( _nPageId == OptionsMap_Impl[nIdx].m_nPageId )
- {
- bRet = sal_True;
- _rGroupName = String( OptionsMap_Impl[nIdx].m_pGroupName, RTL_TEXTENCODING_ASCII_US );
- if ( OptionsMap_Impl[nIdx].m_pPageName != NULL )
- _rPageName = String( OptionsMap_Impl[nIdx].m_pPageName, RTL_TEXTENCODING_ASCII_US );
- break;
- }
- ++nIdx;
- }
-
- return bRet;
-}
-
-static sal_Bool lcl_isOptionHidden( USHORT _nPageId, const SvtOptionsDialogOptions& _rOptOptions )
-{
- sal_Bool bIsHidden = sal_False;
- String sGroupName, sPageName;
- if ( lcl_getStringFromID( _nPageId, sGroupName, sPageName ) )
- {
- if ( sPageName.Len() == 0 )
- bIsHidden = _rOptOptions.IsGroupHidden( sGroupName );
- else
- bIsHidden = _rOptOptions.IsPageHidden( sPageName, sGroupName );
- }
- return bIsHidden;
-}
-
-/* -----------------11.02.99 09:56-------------------
- *
- * --------------------------------------------------*/
-struct OptionsPageInfo
-{
- SfxTabPage* m_pPage;
- sal_uInt16 m_nPageId;
- rtl::OUString m_sPageURL;
- rtl::OUString m_sEventHdl;
- ExtensionsTabPage* m_pExtPage;
-
- OptionsPageInfo( sal_uInt16 nId ) : m_pPage( NULL ), m_nPageId( nId ), m_pExtPage( NULL ) {}
-};
-
-struct OptionsGroupInfo
-{
- SfxItemSet* m_pInItemSet;
- SfxItemSet* m_pOutItemSet;
- SfxShell* m_pShell; // used to create the page
- SfxModule* m_pModule; // used to create the ItemSet
- sal_uInt16 m_nDialogId; // Id of the former dialog
- sal_Bool m_bLoadError; // load fails?
- rtl::OUString m_sPageURL;
- ExtensionsTabPage* m_pExtPage;
-
- OptionsGroupInfo( SfxShell* pSh, SfxModule* pMod, sal_uInt16 nId ) :
- m_pInItemSet( NULL ), m_pOutItemSet( NULL ), m_pShell( pSh ),
- m_pModule( pMod ), m_nDialogId( nId ), m_bLoadError( sal_False ),
- m_sPageURL( rtl::OUString() ), m_pExtPage( NULL ) {}
- ~OptionsGroupInfo() { delete m_pInItemSet; delete m_pOutItemSet; }
-};
-
-/* -----------------04.05.99 15:51-------------------
- *
- * --------------------------------------------------*/
-sal_Bool OfaOptionsTreeListBox::Collapse( SvLBoxEntry* pParent )
-{
- bInCollapse = sal_True;
- sal_Bool bRet = SvTreeListBox::Collapse(pParent);
- bInCollapse = sal_False;
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-#define INI_LIST() \
- aOkPB ( this, SVX_RES( PB_OK ) ),\
- aCancelPB ( this, SVX_RES( PB_CANCEL ) ),\
- aHelpPB ( this, SVX_RES( PB_HELP ) ),\
- aBackPB ( this, SVX_RES( PB_BACK ) ),\
- aHiddenGB ( this, SVX_RES( FB_BORDER ) ),\
- aPageTitleFT ( this, SVX_RES( FT_PAGE_TITLE ) ),\
- aLine1FL ( this, SVX_RES( FL_LINE_1 ) ),\
- aHelpFT ( this, SVX_RES( FT_HELPTEXT ) ),\
- aHelpImg ( this, SVX_RES( IMG_HELP ) ),\
- aHelpTextsArr ( SVX_RES( STR_HELPTEXTS ) ),\
- aTreeLB ( this, SVX_RES( TLB_PAGES ) ),\
- sTitle ( GetText() ),\
- sNotLoadedError ( SVX_RES( ST_LOAD_ERROR ) ),\
- pCurrentPageEntry ( NULL ),\
- pColorPageItemSet ( NULL ),\
- pColorTab ( NULL ),\
- nChangeType ( CT_NONE ),\
- nUnknownType ( COLORPAGE_UNKNOWN ),\
- nUnknownPos ( COLORPAGE_UNKNOWN ),\
- bIsAreaTP ( sal_False ),\
- bForgetSelection ( sal_False ),\
- bImageResized ( sal_False ),\
- bInSelectHdl_Impl ( false ),\
- bIsFromExtensionManager( false ), \
- bIsForSetDocumentLanguage( false )
-
-// Ctor() with Frame -----------------------------------------------------
-using namespace ::com::sun::star;
-OfaTreeOptionsDialog::OfaTreeOptionsDialog(
- Window* pParent,
- const Reference< XFrame >& _xFrame,
- bool bActivateLastSelection ) :
-
- SfxModalDialog( pParent, SVX_RES( RID_OFADLG_OPTIONS_TREE ) ),
- INI_LIST()
-{
- FreeResource();
-
- InitTreeAndHandler();
- Initialize( _xFrame );
- LoadExtensionOptions( rtl::OUString() );
- ResizeTreeLB();
- if (bActivateLastSelection)
- ActivateLastSelection();
-}
-
-// Ctor() with ExtensionId -----------------------------------------------
-
-OfaTreeOptionsDialog::OfaTreeOptionsDialog( Window* pParent, const rtl::OUString& rExtensionId ) :
-
- SfxModalDialog( pParent, SVX_RES( RID_OFADLG_OPTIONS_TREE ) ),
-
- INI_LIST()
-
-{
- FreeResource();
-
- bIsFromExtensionManager = ( rExtensionId.getLength() > 0 );
- InitTreeAndHandler();
- LoadExtensionOptions( rExtensionId );
- ResizeTreeLB();
- ActivateLastSelection();
-}
-
-/* -----------------11.02.99 07:58-------------------
- *
- * --------------------------------------------------*/
-
-OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
-{
- SvLBoxEntry* pEntry = aTreeLB.First();
- // first children
- while(pEntry)
- {
- // if Child (has parent), then OptionsPageInfo
- if(aTreeLB.GetParent(pEntry))
- {
- OptionsPageInfo *pPageInfo = (OptionsPageInfo *)pEntry->GetUserData();
- if(pPageInfo->m_pPage)
- {
- pPageInfo->m_pPage->FillUserData();
- String aPageData(pPageInfo->m_pPage->GetUserData());
- if ( aPageData.Len() )
- {
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pPageInfo->m_nPageId ) );
- SetViewOptUserItem( aTabPageOpt, aPageData );
- }
- delete pPageInfo->m_pPage;
- }
-
- if (pPageInfo->m_nPageId == RID_SFXPAGE_LINGU)
- {
- // write personal dictionaries
- Reference< XDictionaryList > xDicList( SvxGetDictionaryList() );
- if (xDicList.is())
- {
- linguistic::SaveDictionaries( xDicList );
- }
- }
-
- if( pPageInfo->m_pExtPage )
- delete pPageInfo->m_pExtPage;
-
- delete pPageInfo;
- }
- pEntry = aTreeLB.Next(pEntry);
- }
-
- // and parents
- pEntry = aTreeLB.First();
- while(pEntry)
- {
- if(!aTreeLB.GetParent(pEntry))
- {
- OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo*)pEntry->GetUserData();
- if ( pGroupInfo && pGroupInfo->m_pExtPage )
- delete pGroupInfo->m_pExtPage;
- delete pGroupInfo;
- }
- pEntry = aTreeLB.Next(pEntry);
- }
- delete pColorPageItemSet;
- deleteGroupNames();
-}
-
-/* -----------------11.02.99 08:21-------------------
- *
- * --------------------------------------------------*/
-OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage(
- sal_uInt16 nId, const String& rPageName, sal_uInt16 nGroup )
-{
- OptionsPageInfo* pPageInfo = new OptionsPageInfo( nId );
- SvLBoxEntry* pParent = aTreeLB.GetEntry( 0, nGroup );
- DBG_ASSERT( pParent, "OfaTreeOptionsDialog::AddTabPage(): no group found" );
- SvLBoxEntry* pEntry = aTreeLB.InsertEntry( rPageName, pParent );
- pEntry->SetUserData( pPageInfo );
- return pPageInfo;
-}
-
-/* -----------------11.02.99 10:02-------------------
- * der ItemSet* geht in den Besitz des Dialogs
- * --------------------------------------------------*/
-sal_uInt16 OfaTreeOptionsDialog::AddGroup(const String& rGroupName,
- SfxShell* pCreateShell,
- SfxModule* pCreateModule,
- sal_uInt16 nDialogId )
-{
- SvLBoxEntry* pEntry = aTreeLB.InsertEntry(rGroupName);
- OptionsGroupInfo* pInfo =
- new OptionsGroupInfo( pCreateShell, pCreateModule, nDialogId );
- pEntry->SetUserData(pInfo);
- sal_uInt16 nRet = 0;
- pEntry = aTreeLB.First();
- while(pEntry)
- {
- if(!aTreeLB.GetParent(pEntry))
- nRet++;
- pEntry = aTreeLB.Next(pEntry);
- }
- return nRet - 1;
-}
-
-/* -----------------11.02.99 10:31-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK(OfaTreeOptionsDialog, ShowPageHdl_Impl, SvTreeListBox*, EMPTYARG)
-{
- if ( aSelectTimer.GetTimeout() == SELECT_FIRST_TIMEOUT )
- {
- aSelectTimer.SetTimeout( SELECT_TIMEOUT );
- SelectHdl_Impl( NULL );
- }
- else if ( aSelectTimer.GetTimeout() == SELECT_TIMEOUT )
- aSelectTimer.Start();
-
- return 0;
-}
-/* -----------------11.02.99 10:49-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK( OfaTreeOptionsDialog, BackHdl_Impl, PushButton*, EMPTYARG )
-{
- if ( pCurrentPageEntry && aTreeLB.GetParent( pCurrentPageEntry ) )
- {
- OptionsPageInfo* pPageInfo = (OptionsPageInfo*)pCurrentPageEntry->GetUserData();
- if ( pPageInfo->m_pPage )
- {
- OptionsGroupInfo* pGroupInfo =
- (OptionsGroupInfo*)aTreeLB.GetParent( pCurrentPageEntry )->GetUserData();
- if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
- pPageInfo->m_pPage->Reset( *pColorPageItemSet );
- else
- pPageInfo->m_pPage->Reset( *pGroupInfo->m_pInItemSet );
- }
- else if ( pPageInfo->m_pExtPage )
- pPageInfo->m_pExtPage->ResetPage();
- }
- return 0;
-}
-/* -----------------11.02.99 16:45-------------------
- *
- * --------------------------------------------------*/
-IMPL_LINK( OfaTreeOptionsDialog, OKHdl_Impl, Button *, EMPTYARG )
-{
- aTreeLB.EndSelection();
- if ( pCurrentPageEntry && aTreeLB.GetParent( pCurrentPageEntry ) )
- {
- OptionsPageInfo* pPageInfo = (OptionsPageInfo *)pCurrentPageEntry->GetUserData();
- if ( pPageInfo->m_pPage )
- {
- OptionsGroupInfo* pGroupInfo =
- (OptionsGroupInfo *)aTreeLB.GetParent(pCurrentPageEntry)->GetUserData();
- if ( RID_SVXPAGE_COLOR != pPageInfo->m_nPageId
- && pPageInfo->m_pPage->HasExchangeSupport() )
- {
- int nLeave = pPageInfo->m_pPage->DeactivatePage(pGroupInfo->m_pOutItemSet);
- if ( nLeave == SfxTabPage::KEEP_PAGE )
- {
- //die Seite darf nicht verlassen werden!
- aTreeLB.Select(pCurrentPageEntry);
- return 0;
- }
- }
- pPageInfo->m_pPage->Hide();
- }
- }
-
- SvLBoxEntry* pEntry = aTreeLB.First();
- while ( pEntry )
- {
- if ( aTreeLB.GetParent( pEntry ) )
- {
- OptionsPageInfo* pPageInfo = (OptionsPageInfo *)pEntry->GetUserData();
- if ( pPageInfo->m_pPage && !pPageInfo->m_pPage->HasExchangeSupport() )
- {
- OptionsGroupInfo* pGroupInfo =
- (OptionsGroupInfo*)aTreeLB.GetParent(pEntry)->GetUserData();
- pPageInfo->m_pPage->FillItemSet(*pGroupInfo->m_pOutItemSet);
- }
-
- if ( pPageInfo->m_pExtPage )
- {
- pPageInfo->m_pExtPage->DeactivatePage();
- pPageInfo->m_pExtPage->SavePage();
- }
- }
- pEntry = aTreeLB.Next(pEntry);
- }
- EndDialog(RET_OK);
- return 0;
-}
-
-/* -----------------17.02.99 09:15-------------------
- * Eine aufgeklappte Gruppe soll vollstaendig sichtbar sein
- * --------------------------------------------------*/
-IMPL_LINK(OfaTreeOptionsDialog, ExpandedHdl_Impl, SvTreeListBox*, pBox )
-{
- pBox->Update();
- pBox->InitStartEntry();
- SvLBoxEntry* pEntry = pBox->GetHdlEntry();
- if(pEntry && pBox->IsExpanded(pEntry))
- {
- sal_uInt32 nChildCount = pBox->GetChildCount( pEntry );
-
- SvLBoxEntry* pNext = pEntry;
- for(sal_uInt32 i = 0; i < nChildCount;i++)
- {
- pNext = pBox->GetNextEntryInView(pNext);
- if(!pNext)
- {
- pBox->ScrollOutputArea( -(short)(nChildCount - i + 1) );
- break;
- }
- else
- {
- Size aSz(pBox->GetOutputSizePixel());
- int nHeight = pBox->GetEntryHeight();
- Point aPos(pBox->GetEntryPosition(pNext));
- if(aPos.Y()+nHeight > aSz.Height())
- {
- pBox->ScrollOutputArea( -(short)(nChildCount - i + 1) );
- break;
- }
- }
- }
- }
- return 0;
-}
-
-/* -----------------11.02.99 10:49-------------------
- *
- * --------------------------------------------------*/
-void OfaTreeOptionsDialog::ApplyItemSets()
-{
- SvLBoxEntry* pEntry = aTreeLB.First();
- while(pEntry)
- {
- if(!aTreeLB.GetParent(pEntry))
- {
- OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo *)pEntry->GetUserData();
- if(pGroupInfo->m_pOutItemSet)
- {
- if(pGroupInfo->m_pShell)
- pGroupInfo->m_pShell->ApplyItemSet( pGroupInfo->m_nDialogId, *pGroupInfo->m_pOutItemSet);
- else
- ApplyItemSet( pGroupInfo->m_nDialogId, *pGroupInfo->m_pOutItemSet);
- }
- }
- pEntry = aTreeLB.Next(pEntry);
- }
-}
-
-void OfaTreeOptionsDialog::InitTreeAndHandler()
-{
- aTreeLB.SetNodeDefaultImages();
-
- String sResName = String::CreateFromAscii( "iso" );
- ResMgr* pIsoRes = ResMgr::CreateResMgr( ::rtl::OUStringToOString( sResName, RTL_TEXTENCODING_UTF8 ) );
- if ( !pIsoRes )
- {
- // Fallback: Use ooo resource file
- String sOOoName = String::CreateFromAscii( "ooo" );
- pIsoRes = ResMgr::CreateResMgr( ::rtl::OUStringToOString( sOOoName, RTL_TEXTENCODING_UTF8 ) );
- }
-
- //! ResMgr* pIsoRes = SFX_APP()->GetLabelResManager();
- ResId aImgLstRes( RID_IMGLIST_TREEOPT, *pIsoRes );
- aImgLstRes.SetRT( RSC_IMAGELIST );
- if ( pIsoRes->IsAvailable( aImgLstRes ) )
- aPageImages = ImageList( ResId( RID_IMGLIST_TREEOPT, *pIsoRes ) );
- ResId aImgLstHCRes( RID_IMGLIST_TREEOPT_HC, *pIsoRes );
- aImgLstHCRes.SetRT( RSC_IMAGELIST );
- if ( pIsoRes->IsAvailable( aImgLstHCRes ) )
- aPageImagesHC = ImageList( ResId( RID_IMGLIST_TREEOPT_HC, *pIsoRes ) );
- delete pIsoRes;
-
- aTreeLB.SetHelpId( HID_OFADLG_TREELISTBOX );
- aTreeLB.SetWindowBits( WB_HASBUTTONS | WB_HASBUTTONSATROOT |
- WB_HASLINES | WB_HASLINESATROOT |
- WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
- aTreeLB.SetSpaceBetweenEntries( 0 );
- aTreeLB.SetSelectionMode( SINGLE_SELECTION );
- aTreeLB.SetSublistOpenWithLeftRight( TRUE );
- aTreeLB.SetExpandedHdl( LINK( this, OfaTreeOptionsDialog, ExpandedHdl_Impl ) );
- aTreeLB.SetSelectHdl( LINK( this, OfaTreeOptionsDialog, ShowPageHdl_Impl ) );
- aBackPB.SetClickHdl( LINK( this, OfaTreeOptionsDialog, BackHdl_Impl ) );
- aOkPB.SetClickHdl( LINK( this, OfaTreeOptionsDialog, OKHdl_Impl ) );
-
- aHiddenGB.Show();
- aSelectTimer.SetTimeout( SELECT_FIRST_TIMEOUT );
- aSelectTimer.SetTimeoutHdl( LINK( this, OfaTreeOptionsDialog, SelectHdl_Impl ) );
-}
-
-/* -----------------17.02.99 09:51-------------------
- *
- * --------------------------------------------------*/
-void OfaTreeOptionsDialog::ActivatePage( sal_uInt16 nResId )
-{
- bIsForSetDocumentLanguage = false;
- if ( nResId == OFA_TP_LANGUAGES_FOR_SET_DOCUMENT_LANGUAGE )
- {
- bIsForSetDocumentLanguage = true;
- nResId = OFA_TP_LANGUAGES;
- }
-
- DBG_ASSERT( !bIsFromExtensionManager, "OfaTreeOptionsDialog::ActivatePage(): call from extension manager" );
- if ( !pLastPageSaver )
- pLastPageSaver = new LastPageSaver;
- bForgetSelection = sal_True;
- sal_uInt16 nTemp = pLastPageSaver->m_nLastPageId;
- pLastPageSaver->m_nLastPageId = nResId;
- ActivateLastSelection();
- pLastPageSaver->m_nLastPageId = nTemp;
-}
-
-void OfaTreeOptionsDialog::ActivatePage( const String& rPageURL )
-{
- DBG_ASSERT( !bIsFromExtensionManager, "OfaTreeOptionsDialog::ActivatePage(): call from extension manager" );
- if ( !pLastPageSaver )
- pLastPageSaver = new LastPageSaver;
- bForgetSelection = sal_True;
- pLastPageSaver->m_nLastPageId = 0;
- pLastPageSaver->m_sLastPageURL_Tools = rPageURL;
- ActivateLastSelection();
-}
-
-/* -----------------16.02.99 13:17-------------------
- *
- * --------------------------------------------------*/
-void OfaTreeOptionsDialog::ActivateLastSelection()
-{
- SvLBoxEntry* pEntry = NULL;
- if ( pLastPageSaver )
- {
- String sExpand( RTL_CONSTASCII_STRINGPARAM( EXPAND_PROTOCOL ) );
- String sLastURL = bIsFromExtensionManager ? pLastPageSaver->m_sLastPageURL_ExtMgr
- : pLastPageSaver->m_sLastPageURL_Tools;
- if ( sLastURL.Len() == 0 )
- {
- sLastURL = !bIsFromExtensionManager ? pLastPageSaver->m_sLastPageURL_ExtMgr
- : pLastPageSaver->m_sLastPageURL_Tools;
- }
-
- // MacroExpander to convert "expand"-URL to "file"-URL
- Reference< XMacroExpander > m_xMacroExpander;
- bool bMustExpand = ( INetURLObject( sLastURL ).GetProtocol() == INET_PROT_FILE );
-
- if ( bMustExpand )
- {
- Reference< XComponentContext > xContext;
- Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- xProps->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) >>= xContext;
- if ( xContext.is() )
- m_xMacroExpander = Reference< com::sun::star::util::XMacroExpander >(
- xContext->getValueByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/com.sun.star.util.theMacroExpander" ) ) ), UNO_QUERY );
- }
-
- SvLBoxEntry* pTemp = aTreeLB.First();
- while( !pEntry && pTemp )
- {
- // restore only selection of a leaf
- if ( aTreeLB.GetParent( pTemp ) && pTemp->GetUserData() )
- {
- OptionsPageInfo* pPageInfo = (OptionsPageInfo*)pTemp->GetUserData();
- String sPageURL = pPageInfo->m_sPageURL;
- if ( bMustExpand
- && sPageURL.Len() > 0
- && sExpand.Match( sPageURL ) == STRING_MATCH )
- {
- // cut protocol
- ::rtl::OUString sTemp( sPageURL.Copy( sizeof( EXPAND_PROTOCOL ) -1 ) );
- // decode uri class chars
- sTemp = ::rtl::Uri::decode(
- sTemp, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- // expand string
- sPageURL = m_xMacroExpander->expandMacros( sTemp );
- }
-
- if ( ( !bIsFromExtensionManager
- && pPageInfo->m_nPageId && pPageInfo->m_nPageId == pLastPageSaver->m_nLastPageId )
- || ( !pPageInfo->m_nPageId && sLastURL == sPageURL ) )
- pEntry = pTemp;
- }
- pTemp = aTreeLB.Next(pTemp);
- }
- }
-
- if ( !pEntry )
- {
- pEntry = aTreeLB.First();
- pEntry = aTreeLB.Next(pEntry);
- }
-
- SvLBoxEntry* pParent = aTreeLB.GetParent(pEntry);
- aTreeLB.Expand(pParent);
- aTreeLB.MakeVisible(pParent);
- aTreeLB.MakeVisible(pEntry);
- aTreeLB.Select(pEntry);
- aTreeLB.GrabFocus();
-}
-
-/* -----------------22.02.99 08:52-------------------
- *
- * --------------------------------------------------*/
-long OfaTreeOptionsDialog::Notify( NotifyEvent& rNEvt )
-{
- if ( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- const KeyCode aKeyCode = pKEvt->GetKeyCode();
-
- if( aKeyCode.GetCode() == KEY_PAGEUP ||
- aKeyCode.GetCode() == KEY_PAGEDOWN)
- {
- SvLBoxEntry* pCurEntry = aTreeLB.FirstSelected();
- SvLBoxEntry* pTemp = 0;
- if(aKeyCode.GetCode() == KEY_PAGEDOWN)
- {
- pTemp = aTreeLB.Next( pCurEntry ) ;
- if(pTemp && !aTreeLB.GetParent(pTemp))
- {
- pTemp = aTreeLB.Next( pTemp ) ;
- aTreeLB.Select(pTemp);
- }
- }
- else
- {
- pTemp = aTreeLB.Prev( pCurEntry ) ;
- if(pTemp && !aTreeLB.GetParent(pTemp))
- {
- pTemp = aTreeLB.Prev( pTemp ) ;
- }
- }
- if(pTemp)
- {
- if(!aTreeLB.IsExpanded(aTreeLB.GetParent(pTemp)))
- aTreeLB.Expand(aTreeLB.GetParent(pTemp));
- aTreeLB.MakeVisible(pTemp);
- aTreeLB.Select(pTemp);
- }
- }
- }
- return SfxModalDialog::Notify(rNEvt);
-}
-
-// --------------------------------------------------------------------
-
-void OfaTreeOptionsDialog::DataChanged( const DataChangedEvent& rDCEvt )
-{
- SfxModalDialog::DataChanged( rDCEvt );
-
- SvLBoxEntry* pEntry = aTreeLB.GetCurEntry();
- if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) &&
- !aTreeLB.GetParent(pEntry))
- {
- OptionsGroupInfo* pInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
- bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList* pImgLst = bHighContrast ? &aPageImagesHC : &aPageImages;
- for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i )
- {
- if ( aHelpTextsArr.GetValue(i) == pInfo->m_nDialogId )
- {
- aHelpImg.SetImage( pImgLst->GetImage( pInfo->m_nDialogId ) );
- break;
- }
- }
- }
-}
-class FlagSet_Impl
-{
- bool & rFlag;
- public:
- FlagSet_Impl(bool& bFlag) : rFlag(bFlag){rFlag = true;}
- ~FlagSet_Impl(){rFlag = false;}
-};
-
-IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
-{
- SvTreeListBox* pBox = &aTreeLB;
- SvLBoxEntry* pEntry = pBox->GetCurEntry();
- SvLBoxEntry* pParent = pBox->GetParent(pEntry);
- pBox->EndSelection();
-
- DBG_ASSERT(!bInSelectHdl_Impl, "Timeout handler called twice");
- if(bInSelectHdl_Impl || pCurrentPageEntry == pEntry)
- return 0;
- //#111938# lock the SelectHdl_Impl to prevent multiple executes
- FlagSet_Impl aFlag(bInSelectHdl_Impl);
- TabPage* pOldPage = NULL;
- TabPage* pNewPage = NULL;
- OptionsPageInfo* pOptPageInfo = ( pCurrentPageEntry && aTreeLB.GetParent( pCurrentPageEntry ) )
- ? (OptionsPageInfo*)pCurrentPageEntry->GetUserData() : NULL;
-
- if ( pOptPageInfo && pOptPageInfo->m_pPage && pOptPageInfo->m_pPage->IsVisible() )
- {
- pOldPage = pOptPageInfo->m_pPage;
- OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo*)aTreeLB.GetParent(pCurrentPageEntry)->GetUserData();
- int nLeave = SfxTabPage::LEAVE_PAGE;
- if ( RID_SVXPAGE_COLOR != pOptPageInfo->m_nPageId && pOptPageInfo->m_pPage->HasExchangeSupport() )
- nLeave = pOptPageInfo->m_pPage->DeactivatePage( pGroupInfo->m_pOutItemSet );
-
- if ( nLeave == SfxTabPage::KEEP_PAGE )
- {
- // we cannot leave this page
- pBox->Select( pCurrentPageEntry );
- return 0;
- }
- else
- pOptPageInfo->m_pPage->Hide();
- }
- else if ( pOptPageInfo && pOptPageInfo->m_pExtPage )
- {
- pOptPageInfo->m_pExtPage->Hide();
- pOptPageInfo->m_pExtPage->DeactivatePage();
- }
- else if ( pCurrentPageEntry && !aTreeLB.GetParent( pCurrentPageEntry ) )
- {
- OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo*)pCurrentPageEntry->GetUserData();
- if ( pGroupInfo && pGroupInfo->m_pExtPage )
- {
- pGroupInfo->m_pExtPage->Hide();
- pGroupInfo->m_pExtPage->DeactivatePage();
- }
- }
- if ( pParent )
- {
- aPageTitleFT.Hide();
- aLine1FL.Hide();
- aHelpFT.Hide();
- aHelpImg.Hide();
- OptionsPageInfo *pPageInfo = (OptionsPageInfo *)pEntry->GetUserData();
- OptionsGroupInfo* pGroupInfo = (OptionsGroupInfo *)pParent->GetUserData();
- if(!pPageInfo->m_pPage && pPageInfo->m_nPageId > 0)
- {
- if(pGroupInfo->m_bLoadError)
- return 0;
- if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
- {
- if(!pColorPageItemSet)
- {
- // Move usage of a static XOutdevItemPool instance here
- if(!mpStaticXOutdevItemPool)
- {
- mpStaticXOutdevItemPool = new XOutdevItemPool();
- }
- pColorPageItemSet = new SfxItemSet( *mpStaticXOutdevItemPool, XATTR_FILLSTYLE, XATTR_FILLCOLOR);
- pColorPageItemSet->Put( XFillColorItem() );
- }
- }
- else
- {
- if(pGroupInfo->m_pModule /*&& !pGroupInfo->pModule->IsLoaded()*/)
- {
- SfxModule* pOldModule = pGroupInfo->m_pModule;
- sal_Bool bIdentical = pGroupInfo->m_pModule == pGroupInfo->m_pShell;
-
- WaitObject aWait(this);
- //pGroupInfo->pModule = pGroupInfo->pModule->Load();
- if(!pGroupInfo->m_pModule)
- {
- pGroupInfo->m_bLoadError = sal_True;
- InfoBox(pBox, sNotLoadedError).Execute();
- return 0;
- }
- if(bIdentical)
- pGroupInfo->m_pShell = pGroupInfo->m_pModule;
- //jetzt noch testen, ob es auch in anderen Gruppen das gleiche Module gab (z.B. Text+HTML)
- SvLBoxEntry* pTemp = aTreeLB.First();
- while(pTemp)
- {
- if(!aTreeLB.GetParent(pTemp) && pTemp != pEntry)
- {
- OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pTemp->GetUserData();
- if(pTGInfo->m_pModule == pOldModule)
- {
- pTGInfo->m_pModule = pGroupInfo->m_pModule;
- if(bIdentical)
- pTGInfo->m_pShell = pGroupInfo->m_pModule;
- }
- }
- pTemp = aTreeLB.Next(pTemp);
- }
- }
-
-// if ( pPageInfo->nPageId != RID_OPTPAGE_CHART_DEFCOLORS )
- {
- if(!pGroupInfo->m_pInItemSet)
- pGroupInfo->m_pInItemSet = pGroupInfo->m_pShell
- ? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId )
- : CreateItemSet( pGroupInfo->m_nDialogId );
- if(!pGroupInfo->m_pOutItemSet)
- pGroupInfo->m_pOutItemSet = new SfxItemSet(
- *pGroupInfo->m_pInItemSet->GetPool(),
- pGroupInfo->m_pInItemSet->GetRanges());
- }
- }
-
- if(pGroupInfo->m_pModule)
- {
- pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(
- pPageInfo->m_nPageId, this, *pGroupInfo->m_pInItemSet );
- }
- else if(RID_SVXPAGE_COLOR != pPageInfo->m_nPageId)
- pPageInfo->m_pPage = ::CreateGeneralTabPage( pPageInfo->m_nPageId, this, *pGroupInfo->m_pInItemSet );
- else
- {
- pPageInfo->m_pPage = ::CreateGeneralTabPage(
- pPageInfo->m_nPageId, this, *pColorPageItemSet );
- SvxColorTabPage& rColPage = *(SvxColorTabPage*)pPageInfo->m_pPage;
- const OfaPtrItem* pPtr = NULL;
- if ( SfxViewFrame::Current() && SfxViewFrame::Current()->GetDispatcher() )
- pPtr = (const OfaPtrItem*)SfxViewFrame::Current()->
- GetDispatcher()->Execute( SID_GET_COLORTABLE, SFX_CALLMODE_SYNCHRON );
- pColorTab = pPtr ? (XColorTable*)pPtr->GetValue() : XColorTable::GetStdColorTable();
-
- rColPage.SetColorTable( pColorTab );
- rColPage.SetPageType( &nUnknownType );
- rColPage.SetDlgType( &nUnknownType );
- rColPage.SetPos( &nUnknownPos );
- rColPage.SetAreaTP( &bIsAreaTP );
- rColPage.SetColorChgd( (ChangeType*)&nChangeType );
- rColPage.Construct();
- }
-
- DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created");
- if ( pPageInfo->m_pPage )
- {
- SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pPageInfo->m_nPageId ) );
- pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) );
-
- Point aTreePos(aTreeLB.GetPosPixel());
- Size aTreeSize(aTreeLB.GetSizePixel());
- Point aGBPos(aHiddenGB.GetPosPixel());
- Size aPageSize(pPageInfo->m_pPage->GetSizePixel());
- Size aGBSize(aHiddenGB.GetSizePixel());
- Point aPagePos( aGBPos.X() + ( aGBSize.Width() - aPageSize.Width() ) / 2,
- aGBPos.Y() + ( aGBSize.Height() - aPageSize.Height() ) / 2 );
- pPageInfo->m_pPage->SetPosPixel( aPagePos );
- if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
- {
- pPageInfo->m_pPage->Reset( *pColorPageItemSet );
- pPageInfo->m_pPage->ActivatePage( *pColorPageItemSet );
- }
- else
- {
- pPageInfo->m_pPage->Reset( *pGroupInfo->m_pInItemSet );
- }
- }
- }
- else if ( 0 == pPageInfo->m_nPageId && !pPageInfo->m_pExtPage )
- {
- if ( !m_xContainerWinProvider.is() )
- {
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- m_xContainerWinProvider = Reference < awt::XContainerWindowProvider >(
- xFactory->createInstance(
- C2U("com.sun.star.awt.ContainerWindowProvider") ), UNO_QUERY );
- DBG_ASSERT( m_xContainerWinProvider.is(), "service com.sun.star.awt.ContainerWindowProvider could not be loaded" );
- }
-
- pPageInfo->m_pExtPage = new ExtensionsTabPage(
- this, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
- Size aSize = aHiddenGB.GetSizePixel();
- aSize.Width() = aSize.Width() - 4;
- aSize.Height() = aSize.Height() - 4;
- Point aPos = aHiddenGB.GetPosPixel();
- aPos.X() = aPos.X() + 2;
- aPos.Y() = aPos.Y() + 2;
- pPageInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
- }
-
- if ( pPageInfo->m_pPage )
- {
- if ( RID_SVXPAGE_COLOR != pPageInfo->m_nPageId &&
- pPageInfo->m_pPage->HasExchangeSupport())
- {
- pPageInfo->m_pPage->ActivatePage(*pGroupInfo->m_pOutItemSet);
- }
- pPageInfo->m_pPage->Show();
- }
- else if ( pPageInfo->m_pExtPage )
- {
- pPageInfo->m_pExtPage->Show();
- pPageInfo->m_pExtPage->ActivatePage();
- }
-
- String sTmpTitle = sTitle;
- sTmpTitle += String::CreateFromAscii(" - ");
- sTmpTitle += aTreeLB.GetEntryText(pParent);
- sTmpTitle += String::CreateFromAscii(" - ");
- sTmpTitle += aTreeLB.GetEntryText(pEntry);
- SetText(sTmpTitle);
- pCurrentPageEntry = pEntry;
- if ( !bForgetSelection )
- {
- if ( !pLastPageSaver )
- pLastPageSaver = new LastPageSaver;
- if ( !bIsFromExtensionManager )
- pLastPageSaver->m_nLastPageId = pPageInfo->m_nPageId;
- if ( pPageInfo->m_pExtPage )
- {
- if ( bIsFromExtensionManager )
- pLastPageSaver->m_sLastPageURL_ExtMgr = pPageInfo->m_sPageURL;
- else
- pLastPageSaver->m_sLastPageURL_Tools = pPageInfo->m_sPageURL;
- }
- }
- pNewPage = pPageInfo->m_pPage;
- }
- else
- {
- OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pEntry->GetUserData();
- if ( pTGInfo->m_sPageURL.getLength() == 0 )
- {
- bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList* pImgLst = bHighContrast ? &aPageImagesHC : &aPageImages;
- //hier den Hilfetext anzeigen
- for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i )
- {
- if ( aHelpTextsArr.GetValue(i) == pTGInfo->m_nDialogId )
- {
- aHelpFT.SetText(aHelpTextsArr.GetString(i));
- aHelpImg.SetImage(pImgLst->GetImage(pTGInfo->m_nDialogId));
- break;
- }
- }
-
- aPageTitleFT.Show();
- aLine1FL.Show();
- aHelpFT.Show();
- aHelpImg.Show();
-
- //auf die Groesse der Bitmap anpassen
- if(!bImageResized)
- {
- const long nCtrlDist = 2;
- bImageResized = sal_True;
- Point aImgPos(aHelpImg.GetPosPixel());
- Size aImgSize(aHelpImg.GetSizePixel());
- Point aTitlePos(aPageTitleFT.GetPosPixel());
- Point aLinePos(aLine1FL.GetPosPixel());
- Point aHelpPos(aHelpFT.GetPosPixel());
- Size aHelpSize(aHelpFT.GetSizePixel());
- long nXDiff = 0;
- long nYDiff = 0;
- if(aTitlePos.X() <= (aImgPos.X() + aImgSize.Width() + nCtrlDist))
- {
- nXDiff = aImgPos.X() + aImgSize.Width() + nCtrlDist - aTitlePos.X();
- }
- if(aLinePos.Y() <= (aImgPos.Y() + aImgSize.Height() + nCtrlDist))
- {
- nYDiff = aImgPos.Y() + aImgSize.Height() + nCtrlDist - aLinePos.Y();
- }
- aLinePos.Y() += nYDiff;
- aLine1FL.SetPosPixel(aLinePos);
-
- aTitlePos.X() += nXDiff;
- aPageTitleFT.SetPosPixel(aTitlePos);
-
- aHelpPos.X() += nXDiff;
- aHelpPos.Y() += nYDiff;
- aHelpSize.Width() -= nXDiff;
- aHelpSize.Height() -= nYDiff;
- aHelpFT.SetPosSizePixel(aHelpPos, aHelpSize);
-
- Font aFont = aHelpFT.GetFont();
- Size aSz = aFont.GetSize();
- aSz.Height() = (aSz.Height() * 14 ) / 10;
- aFont.SetSize(aSz);
- aPageTitleFT.SetFont(aFont);
- }
-
- String sTmpTitle = sTitle;
- sTmpTitle += String::CreateFromAscii(" - ");
- aPageTitleFT.SetText(aTreeLB.GetEntryText(pEntry));
- sTmpTitle += aPageTitleFT.GetText();
- SetText(sTmpTitle);
- pCurrentPageEntry = NULL;
- }
- else
- {
- if ( !pTGInfo->m_pExtPage )
- {
- if ( !m_xContainerWinProvider.is() )
- {
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- m_xContainerWinProvider = Reference < awt::XContainerWindowProvider >(
- xFactory->createInstance(
- C2U("com.sun.star.awt.ContainerWindowProvider") ), UNO_QUERY );
- DBG_ASSERT( m_xContainerWinProvider.is(), "service com.sun.star.awt.ContainerWindowProvider could not be loaded" );
- }
-
- pTGInfo->m_pExtPage =
- new ExtensionsTabPage( this, 0, pTGInfo->m_sPageURL, rtl::OUString(), m_xContainerWinProvider );
- Size aSize = aHiddenGB.GetSizePixel();
- aSize.Width() = aSize.Width() - 4;
- aSize.Height() = aSize.Height() - 4;
- Point aPos = aHiddenGB.GetPosPixel();
- aPos.X() = aPos.X() + 2;
- aPos.Y() = aPos.Y() + 2;
- pTGInfo->m_pExtPage->SetPosSizePixel( aPos, aSize );
- }
-
- if ( pTGInfo->m_pExtPage )
- {
- pTGInfo->m_pExtPage->Show();
- pTGInfo->m_pExtPage->ActivatePage();
- }
-
- pCurrentPageEntry = pEntry;
- }
- }
-
- // restore lost focus, if necessary
- Window* pFocusWin = Application::GetFocusWindow();
- // if the focused window is not the options treebox and the old page has the focus
- if ( pFocusWin && pFocusWin != pBox && pOldPage && pOldPage->HasChildPathFocus() )
- // then set the focus to the new page or if we are on a group set the focus to the options treebox
- pNewPage ? pNewPage->GrabFocus() : pBox->GrabFocus();
-
- return 0;
-}
-
-/* -----------------11.02.99 15:51-------------------
- *
- * --------------------------------------------------*/
-
-OfaPageResource::OfaPageResource() :
- Resource(SVX_RES(RID_OFADLG_OPTIONS_TREE_PAGES)),
- aGeneralDlgAry(SVX_RES(SID_GENERAL_OPTIONS)),
- aInetDlgAry(SVX_RES(SID_INET_DLG)),
- aLangDlgAry(SVX_RES(SID_LANGUAGE_OPTIONS)),
- aTextDlgAry(SVX_RES(SID_SW_EDITOPTIONS)),
- aHTMLDlgAry(SVX_RES(SID_SW_ONLINEOPTIONS)),
- aCalcDlgAry(SVX_RES(SID_SC_EDITOPTIONS)),
- aStarMathDlgAry(SVX_RES(SID_SM_EDITOPTIONS)),
- aImpressDlgAry(SVX_RES(SID_SD_EDITOPTIONS)),
- aDrawDlgAry(SVX_RES(SID_SD_GRAPHIC_OPTIONS)),
- aChartDlgAry(SVX_RES(SID_SCH_EDITOPTIONS)),
- aFilterDlgAry(SVX_RES(SID_FILTER_DLG)),
- aDatasourcesDlgAry(SVX_RES(SID_SB_STARBASEOPTIONS))
-{
- FreeResource();
-}
-
-BOOL EnableSSO( void )
-{
- // SSO must be enabled if the configuration manager bootstrap settings
- // are configured as follows ...
- // CFG_Offline=false
- // CFG_ServerType=uno ( or unspecified )
- // CFG_BackendService=
- // com.sun.star.comp.configuration.backend.LdapSingleBackend
-
- rtl::OUString theIniFile;
- osl_getExecutableFile( &theIniFile.pData );
- theIniFile = theIniFile.copy( 0, theIniFile.lastIndexOf( '/' ) + 1 ) +
- rtl::OUString::createFromAscii( SAL_CONFIGFILE( "configmgr" ) );
- ::rtl::Bootstrap theBootstrap( theIniFile );
-
- rtl::OUString theOfflineValue;
- rtl::OUString theDefaultOfflineValue = rtl::OUString::createFromAscii( "false" );
- theBootstrap.getFrom( rtl::OUString::createFromAscii( "CFG_Offline" ),
- theOfflineValue,
- theDefaultOfflineValue );
-
- rtl::OUString theServerTypeValue;
- theBootstrap.getFrom( rtl::OUString::createFromAscii( "CFG_ServerType" ),
- theServerTypeValue );
-
- rtl::OUString theBackendServiceTypeValue;
- theBootstrap.getFrom( rtl::OUString::createFromAscii( "CFG_BackendService" ),
- theBackendServiceTypeValue );
-
- BOOL bSSOEnabled =
- ( theOfflineValue == theDefaultOfflineValue &&
- ( theServerTypeValue.getLength() == 0 ||
- theServerTypeValue == rtl::OUString::createFromAscii( "uno" ) ) &&
- theBackendServiceTypeValue ==
- rtl::OUString::createFromAscii(
- "com.sun.star.comp.configuration.backend.LdapSingleBackend" ) );
- if ( bSSOEnabled && GetSSOCreator() == 0 )
- {
- bSSOEnabled = FALSE;
- }
- return bSSOEnabled;
-}
-
-extern "C" { static void SAL_CALL thisModule() {} }
-
-CreateTabPage GetSSOCreator( void )
-{
- static CreateTabPage theSymbol = 0;
- if ( theSymbol == 0 )
- {
- osl::Module aModule;
- rtl::OUString theModuleName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "ssoopt" ) ) );
- if( aModule.loadRelative(
- &thisModule, theModuleName, SAL_LOADMODULE_DEFAULT ) )
- {
- rtl::OUString theSymbolName( rtl::OUString::createFromAscii( "CreateSSOTabPage" ) );
- theSymbol = reinterpret_cast<CreateTabPage>(aModule.getFunctionSymbol( theSymbolName ));
- }
- }
-
- return theSymbol;
-}
-
-SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
-{
- Reference< XPropertySet > xProp( SvxGetLinguPropertySet() );
- SfxItemSet* pRet = 0;
- switch(nId)
- {
- case SID_GENERAL_OPTIONS:
- {
- pRet = new SfxItemSet(
- SFX_APP()->GetPool(),
- SID_ATTR_METRIC, SID_ATTR_SPELL,
- SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
- SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER,
- SID_ATTR_YEAR2000, SID_ATTR_YEAR2000,
- SID_HTML_MODE, SID_HTML_MODE,
- 0 );
-
- SfxItemSet aOptSet( SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
- SFX_APP()->GetOptions(aOptSet);
- pRet->Put(aOptSet);
-
- SfxMiscCfg* pMisc = SFX_APP()->GetMiscConfig();
- const SfxPoolItem* pItem;
- SfxViewFrame* pViewFrame = SfxViewFrame::Current();
- if ( pViewFrame )
- {
- SfxDispatcher* pDispatch = pViewFrame->GetDispatcher();
-
- // Sonstiges - Year2000
- if( SFX_ITEM_AVAILABLE <= pDispatch->QueryState( SID_ATTR_YEAR2000, pItem ) )
- pRet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, ((const SfxUInt16Item*)pItem)->GetValue() ) );
- else
- pRet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, (USHORT)pMisc->GetYear2000() ) );
- }
- else
- pRet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, (USHORT)pMisc->GetYear2000() ) );
-
-
- // Sonstiges - Tabulator
- pRet->Put(SfxBoolItem(SID_PRINTER_NOTFOUND_WARN, pMisc->IsNotFoundWarning()));
-
- sal_uInt16 nFlag = pMisc->IsPaperSizeWarning() ? SFX_PRINTER_CHG_SIZE : 0;
- nFlag |= pMisc->IsPaperOrientationWarning() ? SFX_PRINTER_CHG_ORIENTATION : 0;
- pRet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlag ));
-
- }
- break;
- case SID_LANGUAGE_OPTIONS :
- {
- pRet = new SfxItemSet(SFX_APP()->GetPool(),
- SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK,
- SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
- SID_OPT_LOCALE_CHANGED, SID_OPT_LOCALE_CHANGED,
- SID_SET_DOCUMENT_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE,
- 0 );
-
- // fuer die Linguistik
-
- Reference< XSpellChecker1 > xSpell = SvxGetSpellChecker();
- pRet->Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL ));
- SfxHyphenRegionItem aHyphen( SID_ATTR_HYPHENREGION );
-
- sal_Int16 nMinLead = 2,
- nMinTrail = 2;
- if (xProp.is())
- {
- xProp->getPropertyValue( String::CreateFromAscii(
- UPN_HYPH_MIN_LEADING) ) >>= nMinLead;
- xProp->getPropertyValue( String::CreateFromAscii(
- UPN_HYPH_MIN_TRAILING) ) >>= nMinTrail;
- }
- aHyphen.GetMinLead() = (sal_uInt8)nMinLead;
- aHyphen.GetMinTrail() = (sal_uInt8)nMinTrail;
-
- const SfxPoolItem* pItem;
- SfxPoolItem* pClone;
- SfxViewFrame* pViewFrame = SfxViewFrame::Current();
- if ( pViewFrame )
- {
- SfxDispatcher* pDispatch = pViewFrame->GetDispatcher();
- if(SFX_ITEM_AVAILABLE <= pDispatch->QueryState(SID_ATTR_LANGUAGE, pItem))
- pRet->Put(SfxUInt16Item(SID_ATTR_LANGUAGE, ((const SvxLanguageItem*)pItem)->GetLanguage()));
- if(SFX_ITEM_AVAILABLE <= pDispatch->QueryState(SID_ATTR_CHAR_CJK_LANGUAGE, pItem))
- pRet->Put(SfxUInt16Item(SID_ATTR_CHAR_CJK_LANGUAGE, ((const SvxLanguageItem*)pItem)->GetLanguage()));
- if(SFX_ITEM_AVAILABLE <= pDispatch->QueryState(SID_ATTR_CHAR_CTL_LANGUAGE, pItem))
- pRet->Put(SfxUInt16Item(SID_ATTR_CHAR_CTL_LANGUAGE, ((const SvxLanguageItem*)pItem)->GetLanguage()));
-
- pRet->Put(aHyphen);
- if(SFX_ITEM_AVAILABLE <= pDispatch->QueryState(SID_AUTOSPELL_CHECK, pItem))
- {
- pClone = pItem->Clone();
- pRet->Put(*pClone);
- delete pClone;
- }
- else
- {
- sal_Bool bVal = sal_False;
- if (xProp.is())
- {
- xProp->getPropertyValue( String::CreateFromAscii( UPN_IS_SPELL_AUTO) ) >>= bVal;
- }
-
- pRet->Put(SfxBoolItem(SID_AUTOSPELL_CHECK, bVal));
- }
- }
- pRet->Put( SfxBoolItem( SID_SET_DOCUMENT_LANGUAGE, bIsForSetDocumentLanguage ) );
- }
- break;
- case SID_INET_DLG :
- pRet = new SfxItemSet( SFX_APP()->GetPool(),
- SID_BASIC_ENABLED, SID_BASIC_ENABLED,
- //SID_OPTIONS_START - ..END
- SID_OPTIONS_START, SID_INET_PROXY_PORT,
- SID_SAVEREL_INET, SID_SAVEREL_FSYS,
- SID_INET_SMTPSERVER, SID_INET_SMTPSERVER,
- SID_INET_NOPROXY, SID_INET_SOCKS_PROXY_PORT,
- SID_INET_DNS_AUTO, SID_INET_DNS_SERVER,
- SID_SECURE_URL, SID_SECURE_URL,
- 0L );
- SFX_APP()->GetOptions(*pRet);
- break;
- case SID_FILTER_DLG:
- pRet = new SfxItemSet( SFX_APP()->GetPool(),
- SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE,
- SID_SAVEREL_INET, SID_SAVEREL_FSYS,
- SID_ATTR_PRETTYPRINTING, SID_ATTR_PRETTYPRINTING,
- SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT,
- 0 );
- SFX_APP()->GetOptions(*pRet);
- break;
-
- case SID_SB_STARBASEOPTIONS:
- pRet = new SfxItemSet( SFX_APP()->GetPool(),
- SID_SB_POOLING_ENABLED, SID_SB_DB_REGISTER,
- 0 );
- ::offapp::ConnectionPoolConfig::GetOptions(*pRet);
- ::svx::DbRegisteredNamesConfig::GetOptions(*pRet);
- break;
-
- case SID_SCH_EDITOPTIONS:
- {
- SvxChartOptions aChartOpt;
- pRet = new SfxItemSet( SFX_APP()->GetPool(), SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS );
- pRet->Put( SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aChartOpt.GetDefaultColors() ) );
- break;
- }
- }
- return pRet;
-}
-
-void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
-{
- switch(nId)
- {
- case SID_GENERAL_OPTIONS:
- {
- SfxMiscCfg* pMisc = SFX_APP()->GetMiscConfig();
- const SfxPoolItem* pItem;
- SfxItemSet aOptSet(SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
- aOptSet.Put(rSet);
- if(aOptSet.Count())
- SFX_APP()->SetOptions( aOptSet );
- // Dispatcher neu holen, weil SetOptions() ggf. den Dispatcher zerst"ort hat
- SfxViewFrame *pViewFrame = SfxViewFrame::Current();
-// -------------------------------------------------------------------------
-// Year2000 auswerten
-// -------------------------------------------------------------------------
- USHORT nY2K = USHRT_MAX;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_YEAR2000, sal_False, &pItem ) )
- nY2K = ((const SfxUInt16Item*)pItem)->GetValue();
- if( USHRT_MAX != nY2K )
- {
- if ( pViewFrame )
- {
- SfxDispatcher* pDispatch = pViewFrame->GetDispatcher();
- pDispatch->Execute( SID_ATTR_YEAR2000, SFX_CALLMODE_ASYNCHRON, pItem, 0L);
- }
- pMisc->SetYear2000(nY2K);
- }
-
-// -------------------------------------------------------------------------
-// Drucken auswerten
-// -------------------------------------------------------------------------
- if(SFX_ITEM_SET == rSet.GetItemState(SID_PRINTER_NOTFOUND_WARN, sal_False, &pItem))
- pMisc->SetNotFoundWarning(((const SfxBoolItem*)pItem)->GetValue());
-
- if(SFX_ITEM_SET == rSet.GetItemState(SID_PRINTER_CHANGESTODOC, sal_False, &pItem))
- {
- const SfxFlagItem* pFlag = (const SfxFlagItem*)pItem;
- pMisc->SetPaperSizeWarning(0 != (pFlag->GetValue() & SFX_PRINTER_CHG_SIZE ));
- pMisc->SetPaperOrientationWarning(0 != (pFlag->GetValue() & SFX_PRINTER_CHG_ORIENTATION ));
- }
-// -------------------------------------------------------------------------
-// evaluate help options
-// -------------------------------------------------------------------------
- if ( SvtHelpOptions().IsHelpTips() != Help::IsQuickHelpEnabled() )
- SvtHelpOptions().IsHelpTips() ? Help::EnableQuickHelp() : Help::DisableQuickHelp();
- if ( SvtHelpOptions().IsExtendedHelp() != Help::IsBalloonHelpEnabled() )
- SvtHelpOptions().IsExtendedHelp() ? Help::EnableBalloonHelp() : Help::DisableBalloonHelp();
- }
- break;
- case SID_LANGUAGE_OPTIONS :
- {
- OfaTreeOptionsDialog::ApplyLanguageOptions(rSet);
- }
- break;
- case SID_INET_DLG :
- case SID_FILTER_DLG:
- SFX_APP()->SetOptions( rSet );
- break;
-
- case SID_SB_STARBASEOPTIONS:
- ::offapp::ConnectionPoolConfig::SetOptions( rSet );
- ::svx::DbRegisteredNamesConfig::SetOptions(rSet);
- break;
-
- case SID_SCH_EDITOPTIONS:
- // nothing to do. Chart options only apply to newly created charts
- break;
-
- default:
- {
- DBG_ERROR( "Unhandled option in ApplyItemSet" );
- }
- break;
- }
-
-}
-void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
-{
- sal_Bool bSaveSpellCheck = sal_False;
- const SfxPoolItem* pItem;
-
- if ( SFX_ITEM_SET == rSet.GetItemState( SID_SPELL_MODIFIED, sal_False, &pItem ) )
- {
- bSaveSpellCheck = ( (const SfxBoolItem*)pItem )->GetValue();
- }
- Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- Reference< XPropertySet > xProp(
- xMgr->createInstance( ::rtl::OUString::createFromAscii(
- "com.sun.star.linguistic2.LinguProperties") ),
- UNO_QUERY );
- if ( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_HYPHENREGION, sal_False, &pItem ) )
- {
- const SfxHyphenRegionItem* pHyphenItem = (const SfxHyphenRegionItem*)pItem;
-
- if (xProp.is())
- {
- xProp->setPropertyValue(
- String::CreateFromAscii(UPN_HYPH_MIN_LEADING),
- makeAny((sal_Int16) pHyphenItem->GetMinLead()) );
- xProp->setPropertyValue(
- String::CreateFromAscii(UPN_HYPH_MIN_TRAILING),
- makeAny((sal_Int16) pHyphenItem->GetMinTrail()) );
- }
- bSaveSpellCheck = sal_True;
- }
-
- SfxViewFrame *pViewFrame = SfxViewFrame::Current();
- if ( pViewFrame )
- {
- SfxDispatcher* pDispatch = pViewFrame->GetDispatcher();
- pItem = 0;
- if(SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_LANGUAGE, sal_False, &pItem ))
- {
- pDispatch->Execute(pItem->Which(), SFX_CALLMODE_ASYNCHRON, pItem, 0L);
- bSaveSpellCheck = sal_True;
- }
- if(SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_CHAR_CTL_LANGUAGE, sal_False, &pItem ))
- {
- pDispatch->Execute(pItem->Which(), SFX_CALLMODE_ASYNCHRON, pItem, 0L);
- bSaveSpellCheck = sal_True;
- }
- if(SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_CHAR_CJK_LANGUAGE, sal_False, &pItem ))
- {
- pDispatch->Execute(pItem->Which(), SFX_CALLMODE_ASYNCHRON, pItem, 0L);
- bSaveSpellCheck = sal_True;
- }
-
- if( SFX_ITEM_SET == rSet.GetItemState(SID_AUTOSPELL_CHECK, sal_False, &pItem ))
- {
- sal_Bool bOnlineSpelling = ((const SfxBoolItem*)pItem)->GetValue();
- pDispatch->Execute(SID_AUTOSPELL_CHECK,
- SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD, pItem, 0L);
-
- if (xProp.is())
- {
- xProp->setPropertyValue(
- String::CreateFromAscii(UPN_IS_SPELL_AUTO),
- makeAny(bOnlineSpelling) );
- }
- }
-
- if( bSaveSpellCheck )
- {
- //! the config item has changed since we modified the
- //! property set it uses
- pDispatch->Execute(SID_SPELLCHECKER_CHANGED, SFX_CALLMODE_ASYNCHRON);
- }
- }
-
- if( SFX_ITEM_SET == rSet.GetItemState(SID_OPT_LOCALE_CHANGED, sal_False, &pItem ))
- {
- SfxViewFrame* _pViewFrame = SfxViewFrame::GetFirst();
- while ( _pViewFrame )
- {
- _pViewFrame->GetDispatcher()->Execute(pItem->Which(), SFX_CALLMODE_ASYNCHRON, pItem, 0L);
- _pViewFrame = SfxViewFrame::GetNext( *pViewFrame );
- }
- }
-}
-
-rtl::OUString getCurrentFactory_Impl( const Reference< XFrame >& _xFrame )
-{
- rtl::OUString sIdentifier;
- Reference < XFrame > xCurrentFrame( _xFrame );
- Reference < XModuleManager > xModuleManager( ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY );
- if ( !xCurrentFrame.is() )
- {
- Reference< XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
- if ( xDesktop.is() )
- xCurrentFrame = xDesktop->getCurrentFrame();
- }
-
- if ( xCurrentFrame.is() && xModuleManager.is() )
- {
- try
- {
- sIdentifier = xModuleManager->identify( xCurrentFrame );
- }
- catch ( ::com::sun::star::frame::UnknownModuleException& )
- {
- DBG_WARNING( "getActiveModule_Impl(): unknown module" );
- }
- catch ( Exception& )
- {
- DBG_ERRORFILE( "getActiveModule_Impl(): exception of XModuleManager::identify()" );
- }
- }
-
- return sIdentifier;
-}
-
-void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
-{
- OfaPageResource aDlgResource;
- sal_uInt16 nGroup = 0;
-
- SvtOptionsDialogOptions aOptionsDlgOpt;
- sal_uInt16 i, nPageId;
-
- // %PRODUCTNAME options
- BOOL isSSOEnabled = EnableSSO();
- if ( !lcl_isOptionHidden( SID_GENERAL_OPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rGeneralArray = aDlgResource.GetGeneralArray();
- setGroupName( C2U("ProductName"), rGeneralArray.GetString(0) );
- nGroup = AddGroup( rGeneralArray.GetString(0), 0, 0, SID_GENERAL_OPTIONS );
- sal_uInt16 nEnd = static_cast< sal_uInt16 >( rGeneralArray.Count() );
- String sPageTitle;
-
- for ( i = 1; i < nEnd; ++i )
- {
- String sNewTitle = rGeneralArray.GetString(i);
- nPageId = (sal_uInt16)rGeneralArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
-
- // Disable Online Update page if service not installed
- if( RID_SVXPAGE_ONLINEUPDATE == nPageId )
- {
- const ::rtl::OUString sService = C2U("com.sun.star.setup.UpdateCheck");
-
- try
- {
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XInterface > xService( xFactory->createInstance( sService ) );
-
- if( ! xService.is() )
- continue;
- }
- catch ( ::com::sun::star::loader::CannotActivateFactoryException& )
- {
- continue;
- }
- }
- // Disable OOoImprovement page if not enabled
- if( RID_SVXPAGE_IMPROVEMENT == nPageId )
- {
- continue;
- }
- if ( nPageId != RID_SVXPAGE_SSO || isSSOEnabled )
- {
- AddTabPage( nPageId, sNewTitle, nGroup );
- }
- }
- // private iteration hack for Improvement Program
- // hack for OOo 3.1
- // should not be in found in any later release
- for(bool bOnce = false; bOnce==false; bOnce=true)
- {
- String sNewTitle = C2U("Improvement Program");
- {
- SvxImprovementPage aTempTabPage(this);
- sNewTitle = aTempTabPage.GetTitleText();
- }
- nPageId = RID_SVXPAGE_IMPROVEMENT;
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
- // Disable OOoImprovement page if not enabled
- {
- const ::rtl::OUString sService = C2U("com.sun.star.oooimprovement.CoreController");
- try
- {
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < ::com::sun::star::oooimprovement::XCoreController > xService( xFactory->createInstance( sService ), UNO_QUERY );
-
- if( ! xService.is() )
- continue;
- if( ! xService->showBuiltinOptionsPage(1))
- continue;
- }
- catch ( ::com::sun::star::loader::CannotActivateFactoryException& )
- {
- continue;
- }
- }
- if ( nPageId != RID_SVXPAGE_SSO || isSSOEnabled )
- {
- AddTabPage( nPageId, sNewTitle, nGroup );
- }
- }
- }
-
- // Load and Save options
- if ( !lcl_isOptionHidden( SID_FILTER_DLG, aOptionsDlgOpt ) )
- {
- ResStringArray& rFilterArray = aDlgResource.GetFilterArray();
- setGroupName( C2U("LoadSave"), rFilterArray.GetString(0) );
- nGroup = AddGroup( rFilterArray.GetString(0), 0, 0, SID_FILTER_DLG );
- for ( i = 1; i < rFilterArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rFilterArray.GetValue(i);
- if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- AddTabPage( nPageId, rFilterArray.GetString(i), nGroup );
- }
- }
-
- // Language options
- SvtLanguageOptions aLanguageOptions;
- if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rLangArray = aDlgResource.GetLangArray();
- setGroupName( C2U("LanguageSettings"), rLangArray.GetString(0) );
- nGroup = AddGroup( rLangArray.GetString(0), 0, 0, SID_LANGUAGE_OPTIONS );
- for ( i = 1; i < rLangArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rLangArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
- if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || aLanguageOptions.IsJapaneseFindEnabled() ) &&
- ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || aLanguageOptions.IsAsianTypographyEnabled() ) &&
- ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aLanguageOptions.IsCTLFontEnabled() ) )
- AddTabPage( nPageId, rLangArray.GetString(i), nGroup );
- }
- }
-
-
- rtl::OUString aFactory = getCurrentFactory_Impl( _xFrame );
- rtl::OUString sTemp = GetModuleIdentifier( comphelper::getProcessServiceFactory(), _xFrame );
- DBG_ASSERT( sTemp == aFactory, "S H I T!!!" );
-
- // Writer and Writer/Web options
- sal_Bool bHasAnyFilter = sal_False;
- SvtModuleOptions aModuleOpt;
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
- {
- // Textdokument
- bHasAnyFilter = sal_True;
- ResStringArray& rTextArray = aDlgResource.GetTextArray();
- if ( aFactory.equalsAscii( "com.sun.star.text.TextDocument" )
- || aFactory.equalsAscii( "com.sun.star.text.WebDocument" )
- || aFactory.equalsAscii( "com.sun.star.text.GlobalDocument" ) )
- {
- SfxModule* pSwMod = (*(SfxModule**) GetAppData(SHL_WRITER));
- if ( !lcl_isOptionHidden( SID_SW_EDITOPTIONS, aOptionsDlgOpt ) )
- {
- if ( aFactory.equalsAscii( "com.sun.star.text.WebDocument" ) )
- setGroupName( C2U("WriterWeb"), rTextArray.GetString(0) );
- else
- setGroupName( C2U("Writer"), rTextArray.GetString(0) );
- nGroup = AddGroup(rTextArray.GetString(0), pSwMod, pSwMod, SID_SW_EDITOPTIONS );
- for ( i = 1; i < rTextArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rTextArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
- if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || aLanguageOptions.IsCJKFontEnabled() ) &&
- ( RID_SW_TP_STD_FONT_CTL != nPageId || aLanguageOptions.IsCTLFontEnabled() ) &&
- ( RID_SW_TP_MAILCONFIG != nPageId || MailMergeCfg_Impl().IsEmailSupported() ) )
- AddTabPage( nPageId, rTextArray.GetString(i), nGroup );
- }
-#ifndef PRODUCT
- AddTabPage( RID_SW_TP_OPTTEST_PAGE, String::CreateFromAscii("Interner Test"), nGroup );
-#endif
- }
-
- // HTML-Dokument
- if ( !lcl_isOptionHidden( SID_SW_ONLINEOPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rHTMLArray = aDlgResource.GetHTMLArray();
- nGroup = AddGroup(rHTMLArray.GetString(0), pSwMod, pSwMod, SID_SW_ONLINEOPTIONS );
- for( i = 1; i < rHTMLArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rHTMLArray.GetValue(i);
- if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- AddTabPage( nPageId, rHTMLArray.GetString(i), nGroup );
- }
-#ifndef PRODUCT
- AddTabPage( RID_SW_TP_OPTTEST_PAGE, String::CreateFromAscii("Interner Test"), nGroup );
-#endif
- }
- }
- }
-
- // Calc options
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
- {
- bHasAnyFilter = sal_True;
- if ( aFactory.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" ))
- {
- if ( !lcl_isOptionHidden( SID_SC_EDITOPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rCalcArray = aDlgResource.GetCalcArray();
- SfxModule* pScMod = ( *( SfxModule** ) GetAppData( SHL_CALC ) );
- setGroupName( C2U("Calc"), rCalcArray.GetString(0) );
- nGroup = AddGroup( rCalcArray.GetString( 0 ), pScMod, pScMod, SID_SC_EDITOPTIONS );
- const USHORT nCount = static_cast< const USHORT >( rCalcArray.Count() );
- for ( i = 1; i < nCount; ++i )
- {
- nPageId = (sal_uInt16)rCalcArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
-// if( bCTL || nId != RID_OFA_TP_INTERNATIONAL )
-// #103755# if an international tabpage is need one day, this should be used again... ;-)
- if ( nPageId != RID_OFA_TP_INTERNATIONAL )
- AddTabPage( nPageId, rCalcArray.GetString( i ), nGroup );
- }
- }
- }
- }
-
- // Impress options
- SfxModule* pSdMod = ( *( SfxModule** ) GetAppData( SHL_DRAW ) );
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
- {
- bHasAnyFilter = sal_True;
- if ( aFactory.equalsAscii( "com.sun.star.presentation.PresentationDocument" ))
- {
- if ( !lcl_isOptionHidden( SID_SD_EDITOPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rImpressArray = aDlgResource.GetImpressArray();
- setGroupName( C2U("Impress"), rImpressArray.GetString(0) );
- nGroup = AddGroup( rImpressArray.GetString( 0 ), pSdMod, pSdMod, SID_SD_EDITOPTIONS );
- const sal_Bool bCTL = aLanguageOptions.IsCTLFontEnabled();
- const USHORT nCount = static_cast< const USHORT >( rImpressArray.Count() );
- for ( i = 1; i < nCount; ++i )
- {
- nPageId = (sal_uInt16)rImpressArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
- if ( bCTL || nPageId != RID_OFA_TP_INTERNATIONAL_IMPR )
- AddTabPage( nPageId, rImpressArray.GetString(i), nGroup );
- }
- }
- }
- }
-
- // Draw options
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
- {
- if ( aFactory.equalsAscii( "com.sun.star.drawing.DrawingDocument" ))
- {
- if ( !lcl_isOptionHidden( SID_SD_GRAPHIC_OPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rDrawArray = aDlgResource.GetDrawArray();
- setGroupName( C2U("Draw"), rDrawArray.GetString(0) );
- nGroup = AddGroup( rDrawArray.GetString( 0 ), pSdMod, pSdMod, SID_SD_GRAPHIC_OPTIONS );
- const sal_Bool bCTL = aLanguageOptions.IsCTLFontEnabled();
- const USHORT nCount = static_cast< const USHORT >( rDrawArray.Count() );
- for ( i = 1; i < nCount; ++i )
- {
- nPageId = (sal_uInt16)rDrawArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
- if ( bCTL || nPageId != RID_OFA_TP_INTERNATIONAL_SD )
- AddTabPage( nPageId, rDrawArray.GetString(i), nGroup );
- }
- }
- }
- }
-
- // Math options
- if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) )
- {
- if ( aFactory.equalsAscii( "com.sun.star.formula.FormulaProperties" ))
- {
- if ( !lcl_isOptionHidden( SID_SM_EDITOPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rStarMathArray = aDlgResource.GetStarMathArray();
- SfxModule* pSmMod = (*(SfxModule**) GetAppData(SHL_SM));
- setGroupName( C2U("Math"), rStarMathArray.GetString(0) );
- nGroup = AddGroup(rStarMathArray.GetString(0), pSmMod, pSmMod, SID_SM_EDITOPTIONS );
- for ( i = 1; i < rStarMathArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rStarMathArray.GetValue(i);
- if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- AddTabPage( nPageId, rStarMathArray.GetString(i), nGroup );
- }
- }
- }
- }
-
- // Database - needed only if there is an application which integrates with databases
- if ( !lcl_isOptionHidden( SID_SB_STARBASEOPTIONS, aOptionsDlgOpt ) &&
- ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDATABASE )
- || aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER )
- || aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC )
- ) )
- {
- ResStringArray& rDSArray = aDlgResource.GetDatasourcesArray();
- setGroupName( C2U("Base"), rDSArray.GetString(0) );
- nGroup = AddGroup( rDSArray.GetString(0), 0, NULL, SID_SB_STARBASEOPTIONS );
- for ( i = 1; i < rDSArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rDSArray.GetValue(i);
- if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- AddTabPage( nPageId, rDSArray.GetString(i), nGroup );
- }
- }
-
- // Chart options (always installed and active)
- if ( !lcl_isOptionHidden( SID_SCH_EDITOPTIONS, aOptionsDlgOpt ) )
- {
- ResStringArray& rChartArray = aDlgResource.GetChartArray();
- setGroupName( C2U("Charts"), rChartArray.GetString(0) );
- nGroup = AddGroup( rChartArray.GetString(0), 0, 0, SID_SCH_EDITOPTIONS );
- for ( i = 1; i < rChartArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rChartArray.GetValue(i);
- if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- AddTabPage( nPageId, rChartArray.GetString(i), nGroup );
- }
- }
-
- // Internet options
- if ( !lcl_isOptionHidden( SID_INET_DLG, aOptionsDlgOpt ) )
- {
- ResStringArray& rInetArray = aDlgResource.GetInetArray();
- setGroupName( C2U("Internet"), rInetArray.GetString(0) );
- nGroup = AddGroup(rInetArray.GetString(0), 0, 0, SID_INET_DLG );
-
- for ( i = 1; i < rInetArray.Count(); ++i )
- {
- nPageId = (sal_uInt16)rInetArray.GetValue(i);
- if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
- continue;
-#if defined WNT
- // Disable E-mail tab-page on Windows
- if ( nPageId == RID_SVXPAGE_INET_MAIL )
- continue;
-#endif
-#if defined MACOSX
- // Disable Mozilla Plug-in tab-page on Mac
- if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN )
- continue;
-#endif
- AddTabPage( nPageId, rInetArray.GetString(i), nGroup );
- }
- }
-
-/*!!!
- ResizeTreeLB();
- ActivateLastSelection();
- */
-}
-
-namespace
-{
- void MoveControl( Control& _rCtrl, long _nDeltaPixel )
- {
- Point aPt( _rCtrl.GetPosPixel() );
- aPt.X() += _nDeltaPixel;
- _rCtrl.SetPosPixel( aPt );
- }
-}
-
-void OfaTreeOptionsDialog::ResizeTreeLB( void )
-{
- const long nMax = aHiddenGB.GetSizePixel().Width() * 42 / 100;
- // don't ask where 42 comes from... but it looks / feels ok ;-)
- long nDelta = 50; // min.
- USHORT nDepth = 0;
- const long nIndent0 = PixelToLogic( Size( 28, 0 ) ).Width();
- const long nIndent1 = PixelToLogic( Size( 52, 0 ) ).Width();
-
- SvTreeList* pTreeList = aTreeLB.GetModel();
- DBG_ASSERT( pTreeList, "-OfaTreeOptionsDialog::ResizeTreeLB(): no model, no cookies!" );
-
- SvListEntry* pEntry = pTreeList->First();
- while( pEntry )
- {
- long n = aTreeLB.GetTextWidth( aTreeLB.GetEntryText( static_cast< SvLBoxEntry* >( pEntry ) ) );
- n += ( nDepth == 0 )? nIndent0 : nIndent1;
-
- if( n > nDelta )
- nDelta = n;
-
- pEntry = pTreeList->Next( pEntry, &nDepth );
- }
-
- nDelta = LogicToPixel( Size( nDelta + 3, 0 ) ).Width(); // + extra space [logic]
- nDelta += GetSettings().GetStyleSettings().GetScrollBarSize(); // + scroll bar, in case it's needed
-
- if( nDelta > nMax )
- nDelta = nMax;
-
- // starting resizing with this
- Size aSize( GetSizePixel() );
- aSize.Width() += nDelta;
- SetSizePixel( aSize );
-
- // resize treelistbox
- aSize = aTreeLB.GetSizePixel();
- aSize.Width() += nDelta;
- aTreeLB.SetSizePixel( aSize );
-
- // ... and move depending controls
- MoveControl( aOkPB, nDelta );
- MoveControl( aCancelPB, nDelta );
- MoveControl( aHelpPB, nDelta );
- MoveControl( aBackPB, nDelta );
- MoveControl( aHiddenGB, nDelta );
- MoveControl( aPageTitleFT, nDelta );
- MoveControl( aLine1FL, nDelta );
- MoveControl( aHelpFT, nDelta );
- MoveControl( aHelpImg, nDelta );
-}
-
-bool isNodeActive( OptionsNode* pNode, Module* pModule )
-{
- if ( pNode )
- {
- // Node for all modules actine?
- if ( pNode->m_bAllModules )
- return true;
-
- // OOo-Nodes (Writer, Calc, Impress...) are active if node is already inserted
- if ( getGroupName( pNode->m_sId, false ).Len() > 0 )
- return true;
-
- // no module -> not active
- if ( !pModule )
- return false;
-
- // search node in active module
- if ( pModule->m_bActive )
- {
- for ( sal_uInt32 j = 0; j < pModule->m_aNodeList.size(); ++j )
- if ( pModule->m_aNodeList[j]->m_sId == pNode->m_sId )
- return true;
- }
- }
- return false;
-}
-
-void OfaTreeOptionsDialog::LoadExtensionOptions( const rtl::OUString& rExtensionId )
-{
- Module* pModule = NULL;
- Reference< XMultiServiceFactory > xMSFac = comphelper::getProcessServiceFactory();
- // open optionsdialog.xcu
- Reference< XNameAccess > xRoot(
- ::comphelper::ConfigurationHelper::openConfig(
- xMSFac, C2U("org.openoffice.Office.OptionsDialog"),
- ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY );
- DBG_ASSERT( xRoot.is(), "OfaTreeOptionsDialog::LoadExtensionOptions(): no config" );
- // when called by Tools - Options then load nodes of active module
- if ( rExtensionId.getLength() == 0 )
- pModule = LoadModule( GetModuleIdentifier( xMSFac, Reference< XFrame >() ), xRoot );
-
- VectorOfNodes aNodeList;
- LoadNodes( xRoot, pModule, rExtensionId, aNodeList );
- InsertNodes( aNodeList );
-}
-
-rtl::OUString OfaTreeOptionsDialog::GetModuleIdentifier(
- const Reference< XMultiServiceFactory >& xMFac, const Reference< XFrame >& rFrame )
-{
- rtl::OUString sModule;
- Reference < XFrame > xCurrentFrame( rFrame );
- Reference < XModuleManager > xModuleManager( xMFac->createInstance(
- C2U("com.sun.star.frame.ModuleManager") ), UNO_QUERY );
-
- if ( !xCurrentFrame.is() )
- {
- Reference < XDesktop > xDesktop( xMFac->createInstance(
- C2U("com.sun.star.frame.Desktop") ), UNO_QUERY );
- if ( xDesktop.is() )
- xCurrentFrame = xDesktop->getCurrentFrame();
- }
-
- if ( xCurrentFrame.is() && xModuleManager.is() )
- {
- try
- {
- sModule = xModuleManager->identify( xCurrentFrame );
- }
- catch ( ::com::sun::star::frame::UnknownModuleException& )
- {
- DBG_WARNING( "OfaTreeOptionsDialog::GetModuleIdentifier(): unknown module" );
- }
- catch ( Exception& )
- {
- DBG_ERRORFILE( "OfaTreeOptionsDialog::GetModuleIdentifier(): exception of XModuleManager::identify()" );
- }
- }
- return sModule;
-}
-
-Module* OfaTreeOptionsDialog::LoadModule(
- const rtl::OUString& rModuleIdentifier, const Reference< XNameAccess >& xRoot )
-{
- Module* pModule = NULL;
- Reference< XNameAccess > xSet;
-
- if ( xRoot->hasByName( C2U("Modules") ) )
- {
- xRoot->getByName( C2U("Modules") ) >>= xSet;
- if ( xSet.is() )
- {
- Sequence< rtl::OUString > seqNames = xSet->getElementNames();
- for ( int i = 0; i < seqNames.getLength(); ++i )
- {
- rtl::OUString sModule( seqNames[i] );
- if ( rModuleIdentifier == sModule )
- {
- // current active module found
- pModule = new Module( sModule );
- pModule->m_bActive = true;
-
- Reference< XNameAccess > xModAccess;
- xSet->getByName( seqNames[i] ) >>= xModAccess;
- if ( xModAccess.is() )
- {
- // load the nodes of this module
- Reference< XNameAccess > xNodeAccess;
- xModAccess->getByName( C2U("Nodes") ) >>= xNodeAccess;
- if ( xNodeAccess.is() )
- {
- Sequence< rtl::OUString > xTemp = xNodeAccess->getElementNames();
- Reference< XNameAccess > xAccess;
- sal_Int32 nIndex = -1;
- for ( int x = 0; x < xTemp.getLength(); ++x )
- {
- xNodeAccess->getByName( xTemp[x] ) >>= xAccess;
- if ( xAccess.is() )
- {
- xAccess->getByName( C2U("Index") ) >>= nIndex;
- if ( nIndex < 0 )
- // append nodes with index < 0
- pModule->m_aNodeList.push_back(
- new OrderedEntry( nIndex, xTemp[x] ) );
- else
- {
- // search position of the node
- sal_uInt32 y = 0;
- for ( ; y < pModule->m_aNodeList.size(); ++y )
- {
- sal_Int32 nNodeIdx = pModule->m_aNodeList[y]->m_nIndex;
- if ( nNodeIdx < 0 || nNodeIdx > nIndex )
- break;
- }
- // and insert the node on this position
- pModule->m_aNodeList.insert(
- pModule->m_aNodeList.begin() + y,
- new OrderedEntry( nIndex, xTemp[x] ) );
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return pModule;
-}
-
-void OfaTreeOptionsDialog::LoadNodes(
- const Reference< XNameAccess >& xRoot, Module* pModule,
- const rtl::OUString& rExtensionId, VectorOfNodes& rOutNodeList )
-{
- Reference< XNameAccess > xSet;
- if ( xRoot->hasByName( C2U("Nodes") ) )
- {
- xRoot->getByName( C2U("Nodes") ) >>= xSet;
- if ( xSet.is() )
- {
- VectorOfNodes aNodeList;
- Sequence< rtl::OUString > seqNames = xSet->getElementNames();
-
- for ( int i = 0; i < seqNames.getLength(); ++i )
- {
- String sGroupName( seqNames[i] );
- Reference< XNameAccess > xNodeAccess;
- xSet->getByName( seqNames[i] ) >>= xNodeAccess;
-
- if ( xNodeAccess.is() )
- {
- rtl::OUString sNodeId, sLabel, sPageURL, sGroupId;
- bool bAllModules = false;
- sal_Int32 nGroupIndex = 0;
-
- sNodeId = seqNames[i];
- xNodeAccess->getByName( C2U("Label") ) >>= sLabel;
- xNodeAccess->getByName( C2U("OptionsPage") ) >>= sPageURL;
- xNodeAccess->getByName( C2U("AllModules") ) >>= bAllModules;
- xNodeAccess->getByName( C2U("GroupId") ) >>= sGroupId;
- xNodeAccess->getByName( C2U("GroupIndex") ) >>= nGroupIndex;
-
- if ( sLabel.getLength() == 0 )
- sLabel = sGroupName;
- String sTemp = getGroupName( sLabel, rExtensionId.getLength() > 0 );
- if ( sTemp.Len() > 0 )
- sLabel = sTemp;
- OptionsNode* pNode =
- new OptionsNode( sNodeId, sLabel, sPageURL, bAllModules, sGroupId, nGroupIndex );
-
- if ( !rExtensionId.getLength() && !isNodeActive( pNode, pModule ) )
- {
- delete pNode;
- continue;
- }
-
- Reference< XNameAccess > xLeavesSet;
- xNodeAccess->getByName( C2U( "Leaves" ) ) >>= xLeavesSet;
- if ( xLeavesSet.is() )
- {
- Sequence< rtl::OUString > seqLeaves = xLeavesSet->getElementNames();
- for ( int j = 0; j < seqLeaves.getLength(); ++j )
- {
- Reference< XNameAccess > xLeaveAccess;
- xLeavesSet->getByName( seqLeaves[j] ) >>= xLeaveAccess;
-
- if ( xLeaveAccess.is() )
- {
- rtl::OUString sId, sLeafLabel, sEventHdl, sLeafURL, sLeafGrpId;
- sal_Int32 nLeafGrpIdx = 0;
-
- xLeaveAccess->getByName( C2U("Id") ) >>= sId;
- xLeaveAccess->getByName( C2U("Label") ) >>= sLeafLabel;
- xLeaveAccess->getByName( C2U("OptionsPage") ) >>= sLeafURL;
- xLeaveAccess->getByName( C2U("EventHandlerService") ) >>= sEventHdl;
- xLeaveAccess->getByName( C2U("GroupId") ) >>= sLeafGrpId;
- xLeaveAccess->getByName( C2U("GroupIndex") ) >>= nLeafGrpIdx;
-
- if ( !rExtensionId.getLength() || sId == rExtensionId )
- {
- OptionsLeaf* pLeaf = new OptionsLeaf(
- sId, sLeafLabel, sLeafURL, sEventHdl, sLeafGrpId, nLeafGrpIdx );
-
- if ( sLeafGrpId.getLength() > 0 )
- {
- bool bAlreadyOpened = false;
- if ( pNode->m_aGroupedLeaves.size() > 0 )
- {
- for ( sal_uInt32 k = 0;
- k < pNode->m_aGroupedLeaves.size(); ++k )
- {
- if ( pNode->m_aGroupedLeaves[k].size() > 0 &&
- pNode->m_aGroupedLeaves[k][0]->m_sGroupId
- == sLeafGrpId )
- {
- sal_uInt32 l = 0;
- for ( ; l < pNode->m_aGroupedLeaves[k].size(); ++l )
- {
- if ( pNode->m_aGroupedLeaves[k][l]->
- m_nGroupIndex >= nLeafGrpIdx )
- break;
- }
- pNode->m_aGroupedLeaves[k].insert(
- pNode->m_aGroupedLeaves[k].begin() + l, pLeaf );
- bAlreadyOpened = true;
- break;
- }
- }
- }
- if ( !bAlreadyOpened )
- {
- VectorOfLeaves aGroupedLeaves;
- aGroupedLeaves.push_back( pLeaf );
- pNode->m_aGroupedLeaves.push_back( aGroupedLeaves );
- }
- }
- else
- pNode->m_aLeaves.push_back(
- new OptionsLeaf(
- sId, sLeafLabel, sLeafURL,
- sEventHdl, sLeafGrpId, nLeafGrpIdx ) );
- }
- }
- }
- }
-
- // do not insert nodes without leaves
- if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 )
- {
- pModule ? aNodeList.push_back( pNode ) : rOutNodeList.push_back( pNode );
- }
- }
- }
-
- if ( pModule && aNodeList.size() > 0 )
- {
- sal_uInt32 i = 0, j = 0;
- for ( ; i < pModule->m_aNodeList.size(); ++i )
- {
- rtl::OUString sNodeId = pModule->m_aNodeList[i]->m_sId;
- for ( j = 0; j < aNodeList.size(); ++j )
- {
- OptionsNode* pNode = aNodeList[j];
- if ( pNode->m_sId == sNodeId )
- {
- rOutNodeList.push_back( pNode );
- aNodeList.erase( aNodeList.begin() + j );
- break;
- }
- }
- }
-
- for ( i = 0; i < aNodeList.size(); ++i )
- rOutNodeList.push_back( aNodeList[i] );
- }
- }
- }
-}
-
-USHORT lcl_getGroupId( const rtl::OUString& rGroupName, const SvTreeListBox& rTreeLB )
-{
- String sGroupName( rGroupName );
- USHORT nRet = 0;
- SvLBoxEntry* pEntry = rTreeLB.First();
- while( pEntry )
- {
- if ( !rTreeLB.GetParent( pEntry ) )
- {
- String sTemp( rTreeLB.GetEntryText( pEntry ) );
- if ( sTemp == sGroupName )
- return nRet;
- nRet++;
- }
- pEntry = rTreeLB.Next( pEntry );
- }
-
- return USHRT_MAX;
-}
-
-void lcl_insertLeaf(
- OfaTreeOptionsDialog* pDlg, OptionsNode* pNode, OptionsLeaf* pLeaf, const SvTreeListBox& rTreeLB )
-{
- USHORT nGrpId = lcl_getGroupId( pNode->m_sLabel, rTreeLB );
- if ( USHRT_MAX == nGrpId )
- {
- USHORT nNodeGrpId = getGroupNodeId( pNode->m_sId );
- nGrpId = pDlg->AddGroup( pNode->m_sLabel, NULL, NULL, nNodeGrpId );
- if ( pNode->m_sPageURL.getLength() > 0 )
- {
- SvLBoxEntry* pGrpEntry = rTreeLB.GetEntry( 0, nGrpId );
- DBG_ASSERT( pGrpEntry, "OfaTreeOptionsDialog::InsertNodes(): no group" );
- if ( pGrpEntry )
- {
- OptionsGroupInfo* pGrpInfo =
- static_cast<OptionsGroupInfo*>(pGrpEntry->GetUserData());
- pGrpInfo->m_sPageURL = pNode->m_sPageURL;
- }
- }
- }
- OptionsPageInfo* pInfo = pDlg->AddTabPage( 0, pLeaf->m_sLabel, nGrpId );
- pInfo->m_sPageURL = pLeaf->m_sPageURL;
- pInfo->m_sEventHdl = pLeaf->m_sEventHdl;
-}
-
-void OfaTreeOptionsDialog::InsertNodes( const VectorOfNodes& rNodeList )
-{
- for ( sal_uInt32 i = 0; i < rNodeList.size(); ++i )
- {
- OptionsNode* pNode = rNodeList[i];
-
- if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 )
- {
- sal_uInt32 j = 0;
- for ( ; j < pNode->m_aGroupedLeaves.size(); ++j )
- {
- for ( sal_uInt32 k = 0; k < pNode->m_aGroupedLeaves[j].size(); ++k )
- {
- OptionsLeaf* pLeaf = pNode->m_aGroupedLeaves[j][k];
- lcl_insertLeaf( this, pNode, pLeaf, aTreeLB );
- }
- }
-
- for ( j = 0; j < pNode->m_aLeaves.size(); ++j )
- {
- OptionsLeaf* pLeaf = pNode->m_aLeaves[j];
- lcl_insertLeaf( this, pNode, pLeaf, aTreeLB );
- }
- }
- }
-}
-
-short OfaTreeOptionsDialog::Execute()
-{
- ::std::auto_ptr< SvxDicListChgClamp > pClamp;
- if ( !bIsFromExtensionManager )
- {
- // collect all DictionaryList Events while the dialog is executed
- Reference<com::sun::star::linguistic2::XDictionaryList> xDictionaryList(SvxGetDictionaryList());
- pClamp = ::std::auto_ptr< SvxDicListChgClamp >( new SvxDicListChgClamp( xDictionaryList ) );
- }
- short nRet = SfxModalDialog::Execute();
-
- if( RET_OK == nRet )
- {
- ApplyItemSets();
- if( GetColorTable() )
- {
- GetColorTable()->Save();
-
- // notify current viewframe it it uses the same color table
- if ( SfxViewFrame::Current() && SfxViewFrame::Current()->GetDispatcher() )
- {
- const OfaPtrItem* pPtr = (const OfaPtrItem*)SfxViewFrame::Current()->GetDispatcher()->Execute( SID_GET_COLORTABLE, SFX_CALLMODE_SYNCHRON );
- if( pPtr )
- {
- XColorTable* _pColorTab = (XColorTable*)pPtr->GetValue();
-
- if( _pColorTab &&
- _pColorTab->GetPath() == GetColorTable()->GetPath() &&
- _pColorTab->GetName() == GetColorTable()->GetName() )
- SfxObjectShell::Current()->PutItem( SvxColorTableItem( GetColorTable(), SID_COLOR_TABLE ) );
- }
- }
- }
-
- utl::ConfigManager::GetConfigManager()->StoreConfigItems();
- }
-
- return nRet;
-}
-
-// class ExtensionsTabPage -----------------------------------------------
-
-ExtensionsTabPage::ExtensionsTabPage(
- Window* pParent, const ResId& rResId, const rtl::OUString& rPageURL,
- const rtl::OUString& rEvtHdl, const Reference< awt::XContainerWindowProvider >& rProvider ) :
-
- TabPage( pParent, rResId ),
-
- m_sPageURL ( rPageURL ),
- m_sEventHdl ( rEvtHdl ),
- m_xWinProvider ( rProvider ),
- m_bIsWindowHidden ( false )
-
-{
-}
-
-// -----------------------------------------------------------------------
-
-ExtensionsTabPage::ExtensionsTabPage(
- Window* pParent, WinBits nStyle, const rtl::OUString& rPageURL,
- const rtl::OUString& rEvtHdl, const Reference< awt::XContainerWindowProvider >& rProvider ) :
-
- TabPage( pParent, nStyle ),
-
- m_sPageURL ( rPageURL ),
- m_sEventHdl ( rEvtHdl ),
- m_xWinProvider ( rProvider ),
- m_bIsWindowHidden ( false )
-
-{
-}
-
-// -----------------------------------------------------------------------
-
-ExtensionsTabPage::~ExtensionsTabPage()
-{
- Hide();
- DeactivatePage();
-}
-
-// -----------------------------------------------------------------------
-
-void ExtensionsTabPage::CreateDialogWithHandler()
-{
- try
- {
- bool bWithHandler = ( m_sEventHdl.getLength() > 0 );
- if ( bWithHandler )
- {
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- m_xEventHdl = Reference< awt::XContainerWindowEventHandler >(
- xFactory->createInstance( m_sEventHdl ), UNO_QUERY );
- }
-
- if ( !bWithHandler || m_xEventHdl.is() )
- {
- SetStyle( GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
- Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), UNO_QUERY );
- m_xPage = Reference < awt::XWindow >(
- m_xWinProvider->createContainerWindow(
- m_sPageURL, rtl::OUString(), xParent, m_xEventHdl ), UNO_QUERY );
-
- Reference< awt::XControl > xPageControl( m_xPage, UNO_QUERY );
- if ( xPageControl.is() )
- {
- Reference< awt::XWindowPeer > xWinPeer( xPageControl->getPeer() );
- if ( xWinPeer.is() )
- {
- Window* pWindow = VCLUnoHelper::GetWindow( xWinPeer );
- if ( pWindow )
- pWindow->SetStyle( pWindow->GetStyle() | WB_DIALOGCONTROL | WB_CHILDDLGCTRL );
- }
- }
- }
- }
- catch ( ::com::sun::star::lang::IllegalArgumentException& )
- {
- DBG_ERRORFILE( "ExtensionsTabPage::CreateDialogWithHandler(): illegal argument" );
- }
- catch ( Exception& )
- {
- DBG_ERRORFILE( "ExtensionsTabPage::CreateDialogWithHandler(): exception of XDialogProvider2::createDialogWithHandler()" );
- }
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool ExtensionsTabPage::DispatchAction( const rtl::OUString& rAction )
-{
- sal_Bool bRet = sal_False;
- if ( m_xEventHdl.is() )
- {
- try
- {
- bRet = m_xEventHdl->callHandlerMethod( m_xPage, makeAny( rAction ), C2U("external_event") );
- }
- catch ( Exception& )
- {
- DBG_ERRORFILE( "ExtensionsTabPage::DispatchAction(): exception of XDialogEventHandler::callHandlerMethod()" );
- }
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
-
-void ExtensionsTabPage::ActivatePage()
-{
- TabPage::ActivatePage();
-
- if ( !m_xPage.is() )
- {
- CreateDialogWithHandler();
-
- if ( m_xPage.is() )
- {
- Point aPos = Point();
- Size aSize = GetSizePixel();
- m_xPage->setPosSize( aPos.X() + 1, aPos.Y() + 1,
- aSize.Width() - 2, aSize.Height() - 2, awt::PosSize::POSSIZE );
- if ( m_sEventHdl.getLength() > 0 )
- DispatchAction( C2U("initialize") );
- }
- }
-
- if ( m_xPage.is() )
- {
- m_xPage->setVisible( sal_True );
- m_bIsWindowHidden = false;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ExtensionsTabPage::DeactivatePage()
-{
- TabPage::DeactivatePage();
-
- if ( m_xPage.is() )
- m_xPage->setVisible( sal_False );
-}
-
-// -----------------------------------------------------------------------
-
-void ExtensionsTabPage::ResetPage()
-{
- DispatchAction( C2U("back") );
- ActivatePage();
-}
-
-// -----------------------------------------------------------------------
-
-void ExtensionsTabPage::SavePage()
-{
- DispatchAction( C2U("ok") );
-}
-
-// -----------------------------------------------------------------------
-
-void ExtensionsTabPage::HideWindow()
-{
- if ( !m_bIsWindowHidden && m_xPage.is() )
- {
- m_xPage->setVisible( sal_False );
- m_bIsWindowHidden = true;
- }
-}
-
diff --git a/svx/source/cui/treeopt.hrc b/svx/source/cui/treeopt.hrc
deleted file mode 100644
index 8fe50334ba..0000000000
--- a/svx/source/cui/treeopt.hrc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: treeopt.hrc,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/controldims.hrc>
-
-#define PB_OK 1
-#define PB_CANCEL 2
-#define PB_HELP 3
-#define PB_BACK 4
-#define TLB_PAGES 5
-#define FT_HELPTEXT 6
-#define STR_HELPTEXTS 7
-#define IMG_LIST 8
-#define IMG_HELP 9
-#define FT_PAGE_TITLE 10
-#define FL_LINE_1 11
-
-#define BMP_ROOT_CLOSED 17
-#define BMP_ROOT_OPENED 18
-#define FB_BORDER 19
-
-#define IMG_HINT 20
-#define FT_HINT 21
-#define CB_DISABLE 22
-#define BTN_HINT 23
-#define ST_LOAD_ERROR 24
-
-#define STR_GENERAL_PAGES_START 1
-#define STR_GENERAL (STR_GENERAL_PAGES_START)
-#define STR_MISC_PAGE (STR_GENERAL_PAGES_START + 1)
-#define STR_DESKTOP_PAGE (STR_GENERAL_PAGES_START + 2)
-#define STR_VIEW_PAGE (STR_GENERAL_PAGES_START + 3)
-#define STR_FONT_PAGE (STR_GENERAL_PAGES_START + 4)
-#define STR_PRINT_PAGE (STR_GENERAL_PAGES_START + 5)
-#define STR_COLOR_PAGE (STR_GENERAL_PAGES_START + 6)
-#define STR_LING_PAGE (STR_GENERAL_PAGES_START + 7)
-#define STR_PATH_PAGE (STR_GENERAL_PAGES_START + 8)
-#define STR_SAVE_PAGE (STR_GENERAL_PAGES_START + 9)
-#define STR_USERDATA_PAGE (STR_GENERAL_PAGES_START + 10)
-
-#define FB_IMAGE 43
-
-
-// metrics
-
-#define WIDTH_PAGEFRAME 263
-#define HEIGHT_PAGEFRAME 191
-#define WIDTH_IMG_HELP 25
-#define HEIGHT_IMG_HELP 30
-
-#define COL_1 (RSC_SP_DLG_INNERBORDER_LEFT)
-#define COL_2 (COL_1+0)
-#define COL_3 (COL_2+RSC_SP_GRP_SPACE_X)
-#define COL_11 (COL_3+WIDTH_PAGEFRAME)
-#define COL_12 (COL_11+RSC_SP_DLG_INNERBORDER_RIGHT)
-#define COL_10 (COL_11-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_9 (COL_10-RSC_SP_CTRL_GROUP_X)
-#define COL_8 (COL_9-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_7 (COL_8-RSC_SP_CTRL_GROUP_X)
-#define COL_6 (COL_7-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_5 (COL_6-RSC_SP_CTRL_GROUP_X)
-#define COL_4 (COL_5-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_3_1 (COL_3+RSC_SP_TBPG_INNERBORDER_LEFT)
-#define COL_3_3 (COL_3_1+WIDTH_IMG_HELP)
-#define COL_3_5 (COL_11-RSC_SP_TBPG_INNERBORDER_RIGHT)
-
-#define ROW_1 (RSC_SP_DLG_INNERBORDER_TOP)
-#define ROW_2 (ROW_1+HEIGHT_PAGEFRAME)
-#define ROW_3 (ROW_2+RSC_SP_CTRL_GROUP_Y)
-#define ROW_4 (ROW_3+RSC_CD_PUSHBUTTON_HEIGHT)
-#define ROW_5 (ROW_4+RSC_SP_DLG_INNERBORDER_BOTTOM)
-#define ROW_1_1 (ROW_1+2)
-#define ROW_1_2 (ROW_1+12)
-#define ROW_1_3 (ROW_1_1+HEIGHT_IMG_HELP+2)
-#define ROW_1_4 (ROW_1_3+8)
-
diff --git a/svx/source/cui/treeopt.hxx b/svx/source/cui/treeopt.hxx
deleted file mode 100644
index 014cb6e22b..0000000000
--- a/svx/source/cui/treeopt.hxx
+++ /dev/null
@@ -1,362 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: treeopt.hxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <com/sun/star/uno/Reference.h>
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svtools/svtreebx.hxx>
-#include <tools/resary.hxx>
-#include <vcl/image.hxx>
-#include <vcl/fixbrd.hxx>
-#include <vcl/fixed.hxx>
-
-#include <vector>
-
-// static ----------------------------------------------------------------
-
-BOOL EnableSSO();
-CreateTabPage GetSSOCreator( void );
-
-// class OfaOptionsTreeListBox -------------------------------------------
-
-//!#define NUMBER_OF_OPTION_PAGES 12
-class SfxModule;
-class SfxShell;
-class SfxItemSet;
-class XColorTable;
-class OfaOptionsTreeListBox : public SvTreeListBox
-{
- using SvListView::Collapse;
-
-private:
- BOOL bInCollapse;
-
-public:
- OfaOptionsTreeListBox(Window* pParent, const ResId& rResId) :
- SvTreeListBox( pParent, rResId ), bInCollapse(FALSE) {}
-
- virtual BOOL Collapse( SvLBoxEntry* pParent );
- BOOL IsInCollapse()const {return bInCollapse;}
-};
-
-// struct OrderedEntry ---------------------------------------------------
-
-struct OrderedEntry
-{
- sal_Int32 m_nIndex;
- rtl::OUString m_sId;
-
- OrderedEntry( sal_Int32 nIndex, const rtl::OUString& rId ) :
- m_nIndex( nIndex ), m_sId( rId ) {}
-};
-
-typedef std::vector< OrderedEntry* > VectorOfOrderedEntries;
-
-// struct Module ---------------------------------------------------------
-
-struct Module
-{
- rtl::OUString m_sName;
- bool m_bActive;
- VectorOfOrderedEntries m_aNodeList;
-
- Module( const rtl::OUString& rName ) : m_sName( rName ), m_bActive( false ) {}
-};
-
-// struct OptionsLeaf ----------------------------------------------------
-
-struct OptionsLeaf
-{
- rtl::OUString m_sId;
- rtl::OUString m_sLabel;
- rtl::OUString m_sPageURL;
- rtl::OUString m_sEventHdl;
- rtl::OUString m_sGroupId;
- sal_Int32 m_nGroupIndex;
-
- OptionsLeaf( const rtl::OUString& rId,
- const rtl::OUString& rLabel,
- const rtl::OUString& rPageURL,
- const rtl::OUString& rEventHdl,
- const rtl::OUString& rGroupId,
- sal_Int32 nGroupIndex ) :
- m_sId( rId ),
- m_sLabel( rLabel ),
- m_sPageURL( rPageURL ),
- m_sEventHdl( rEventHdl ),
- m_sGroupId( rGroupId ),
- m_nGroupIndex( nGroupIndex ) {}
-};
-
-typedef ::std::vector< OptionsLeaf* > VectorOfLeaves;
-typedef ::std::vector< VectorOfLeaves > VectorOfGroupedLeaves;
-
-// struct OptionsNode ----------------------------------------------------
-
-struct OptionsNode
-{
- rtl::OUString m_sId;
- rtl::OUString m_sLabel;
- rtl::OUString m_sPageURL;
- bool m_bAllModules;
- rtl::OUString m_sGroupId;
- sal_Int32 m_nGroupIndex;
- VectorOfLeaves m_aLeaves;
- VectorOfGroupedLeaves m_aGroupedLeaves;
-
- OptionsNode( const rtl::OUString& rId,
- const rtl::OUString& rLabel,
- const rtl::OUString& rPageURL,
- bool bAllModules,
- const rtl::OUString& rGroupId,
- sal_Int32 nGroupIndex ) :
- m_sId( rId ),
- m_sLabel( rLabel ),
- m_sPageURL( rPageURL ),
- m_bAllModules( bAllModules ),
- m_sGroupId( rGroupId ),
- m_nGroupIndex( nGroupIndex ) {}
-
- ~OptionsNode()
- {
- for ( sal_uInt32 i = 0; i < m_aLeaves.size(); ++i )
- delete m_aLeaves[i];
- m_aLeaves.clear();
- m_aGroupedLeaves.clear();
- }
-};
-
-typedef ::std::vector< OptionsNode* > VectorOfNodes;
-
-struct LastPageSaver
-{
- USHORT m_nLastPageId;
- rtl::OUString m_sLastPageURL_Tools;
- rtl::OUString m_sLastPageURL_ExtMgr;
-
- LastPageSaver() : m_nLastPageId( USHRT_MAX ) {}
-};
-
-// class OfaTreeOptionsDialog --------------------------------------------
-
-namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } }
-namespace com { namespace sun { namespace star { namespace container { class XNameAccess; } } } }
-namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } }
-namespace com { namespace sun { namespace star { namespace awt { class XContainerWindowProvider; } } } }
-
-struct OptionsPageInfo;
-struct Module;
-class ExtensionsTabPage;
-typedef std::vector< ExtensionsTabPage* > VectorOfPages;
-
-class OfaTreeOptionsDialog : public SfxModalDialog
-{
-private:
- OKButton aOkPB;
- CancelButton aCancelPB;
- HelpButton aHelpPB;
- PushButton aBackPB;
-
- FixedBorder aHiddenGB;
- FixedText aPageTitleFT;
- FixedLine aLine1FL;
- FixedText aHelpFT;
- FixedImage aHelpImg;
-
- ImageList aPageImages;
- ImageList aPageImagesHC;
-
- ResStringArray aHelpTextsArr;
-
- OfaOptionsTreeListBox aTreeLB;
-
- String sTitle;
- String sNotLoadedError;
-
- SvLBoxEntry* pCurrentPageEntry;
-
- // for the ColorTabPage
- SfxItemSet* pColorPageItemSet;
- XColorTable* pColorTab;
- USHORT nChangeType;
- USHORT nUnknownType;
- USHORT nUnknownPos;
- BOOL bIsAreaTP;
-
- BOOL bForgetSelection;
- BOOL bExternBrowserActive;
- BOOL bImageResized;
- bool bInSelectHdl_Impl;
- bool bIsFromExtensionManager;
-
- // check "for the current document only" and set focus to "Western" languages box
- bool bIsForSetDocumentLanguage;
-
- Timer aSelectTimer;
-
- com::sun::star::uno::Reference < com::sun::star::awt::XContainerWindowProvider >
- m_xContainerWinProvider;
-
- static LastPageSaver* pLastPageSaver;
-
- SfxItemSet* CreateItemSet( USHORT nId );
- void ApplyItemSet( USHORT nId, const SfxItemSet& rSet );
- void InitTreeAndHandler();
- void Initialize( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& _xFrame );
- void ResizeTreeLB( void ); // resizes dialog so that treelistbox has no horizontal scroll bar
-
- void LoadExtensionOptions( const rtl::OUString& rExtensionId );
- rtl::OUString GetModuleIdentifier( const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& xMFac,
- const com::sun::star::uno::Reference<
- com::sun::star::frame::XFrame >& xFrame );
- Module* LoadModule( const rtl::OUString& rModuleIdentifier,
- const com::sun::star::uno::Reference<
- com::sun::star::container::XNameAccess >& xRoot );
- void LoadNodes( const com::sun::star::uno::Reference<
- com::sun::star::container::XNameAccess >& xRoot,
- Module* pModule,
- const rtl::OUString& rExtensionId,
- VectorOfNodes& rOutNodeList );
- void InsertNodes( const VectorOfNodes& rNodeList );
-
-protected:
- DECL_LINK(ExpandedHdl_Impl, SvTreeListBox* );
- DECL_LINK(ShowPageHdl_Impl, SvTreeListBox* );
- DECL_LINK(BackHdl_Impl, PushButton* );
- DECL_LINK( OKHdl_Impl, Button * );
- DECL_LINK( HintHdl_Impl, Timer * );
- DECL_LINK( SelectHdl_Impl, Timer * );
-
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual short Execute();
-
-public:
- OfaTreeOptionsDialog( Window* pParent,
- const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& _xFrame,
- bool bActivateLastSelection = true );
- OfaTreeOptionsDialog( Window* pParent, const rtl::OUString& rExtensionId );
- ~OfaTreeOptionsDialog();
-
- OptionsPageInfo* AddTabPage( USHORT nId, const String& rPageName, USHORT nGroup );
- USHORT AddGroup( const String& rGroupName, SfxShell* pCreateShell,
- SfxModule* pCreateModule, USHORT nDialogId );
-
- void ActivateLastSelection();
- void ActivatePage( USHORT nResId );
- void ActivatePage( const String& rPageURL );
- void ApplyItemSets();
-
- USHORT GetColorChanged() const { return nChangeType; }
- XColorTable* GetColorTable() { return pColorTab; }
-
- // helper functions to call the language settings TabPage from the SpellDialog
- static void ApplyLanguageOptions(const SfxItemSet& rSet);
-};
-
-// class OfaPageResource -------------------------------------------------
-
-class OfaPageResource : public Resource
-{
- ResStringArray aGeneralDlgAry;
- ResStringArray aInetDlgAry;
- ResStringArray aLangDlgAry;
- ResStringArray aTextDlgAry;
- ResStringArray aHTMLDlgAry;
- ResStringArray aCalcDlgAry;
- ResStringArray aStarMathDlgAry;
- ResStringArray aImpressDlgAry;
- ResStringArray aDrawDlgAry;
- ResStringArray aChartDlgAry;
- ResStringArray aFilterDlgAry;
- ResStringArray aDatasourcesDlgAry;
-
-public:
- OfaPageResource();
-
- ResStringArray& GetGeneralArray() {return aGeneralDlgAry;}
- ResStringArray& GetInetArray() {return aInetDlgAry;}
- ResStringArray& GetLangArray() {return aLangDlgAry;}
- ResStringArray& GetTextArray() {return aTextDlgAry;}
- ResStringArray& GetHTMLArray() {return aHTMLDlgAry;}
- ResStringArray& GetCalcArray() {return aCalcDlgAry;}
- ResStringArray& GetStarMathArray() {return aStarMathDlgAry;}
- ResStringArray& GetImpressArray() {return aImpressDlgAry;}
- ResStringArray& GetDrawArray() {return aDrawDlgAry;}
- ResStringArray& GetChartArray() {return aChartDlgAry;}
- ResStringArray& GetFilterArray() {return aFilterDlgAry;}
- ResStringArray& GetDatasourcesArray() {return aDatasourcesDlgAry;}
-};
-
-// class ExtensionsTabPage -----------------------------------------------
-
-namespace com { namespace sun { namespace star { namespace awt { class XWindow; } } } }
-namespace com { namespace sun { namespace star { namespace awt { class XContainerWindowEventHandler; } } } }
-
-class ExtensionsTabPage : public TabPage
-{
-private:
- rtl::OUString m_sPageURL;
- com::sun::star::uno::Reference< com::sun::star::awt::XWindow >
- m_xPage;
- rtl::OUString m_sEventHdl;
- com::sun::star::uno::Reference< com::sun::star::awt::XContainerWindowEventHandler >
- m_xEventHdl;
- com::sun::star::uno::Reference< com::sun::star::awt::XContainerWindowProvider >
- m_xWinProvider;
- bool m_bIsWindowHidden;
-
- void CreateDialogWithHandler();
- sal_Bool DispatchAction( const rtl::OUString& rAction );
-
-public:
- ExtensionsTabPage(
- Window* pParent, const ResId&,
- const rtl::OUString& rPageURL, const rtl::OUString& rEvtHdl,
- const com::sun::star::uno::Reference<
- com::sun::star::awt::XContainerWindowProvider >& rProvider );
-
- ExtensionsTabPage(
- Window* pParent, WinBits nStyle,
- const rtl::OUString& rPageURL, const rtl::OUString& rEvtHdl,
- const com::sun::star::uno::Reference<
- com::sun::star::awt::XContainerWindowProvider >& rProvider );
-
- virtual ~ExtensionsTabPage();
-
- virtual void ActivatePage();
- virtual void DeactivatePage();
-
- void ResetPage();
- void SavePage();
- void HideWindow();
-};
-
diff --git a/svx/source/cui/treeopt.src b/svx/source/cui/treeopt.src
deleted file mode 100644
index be5398f5f5..0000000000
--- a/svx/source/cui/treeopt.src
+++ /dev/null
@@ -1,386 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: treeopt.src,v $
- * $Revision: 1.22 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "treeopt.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#define IMAGE_STDBTN_COLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; }
-
-ModalDialog RID_OFADLG_OPTIONS_TREE
-{
- HelpID = HID_OFADLG_OPTIONS_TREE;
- Moveable = TRUE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
-
- Size = MAP_APPFONT ( COL_12 , ROW_5 ) ;
- Text [ en-US ] = "Options";
-
- OKButton PB_OK
- {
- Pos = MAP_APPFONT ( COL_4, ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- DefButton = TRUE;
- };
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT ( COL_6, ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT ( COL_8, ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
- PushButton PB_BACK
- {
- Pos = MAP_APPFONT ( COL_10, ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Back" ;
- };
- //TreeListBox
- Control TLB_PAGES
- {
- Pos = MAP_APPFONT ( COL_1, ROW_1 ) ;
- Size = MAP_APPFONT ( (COL_2-COL_1), (ROW_4-ROW_1) );
- TabStop = TRUE ;
- Border = TRUE;
- };
- Control FB_BORDER
- {
- Pos = MAP_APPFONT ( COL_3, ROW_1 ) ;
- Size = MAP_APPFONT ( WIDTH_PAGEFRAME, HEIGHT_PAGEFRAME ) ;
- Hide = TRUE;
- };
- FixedImage IMG_HELP
- {
- Pos = MAP_APPFONT ( COL_3_1, ROW_1_1 ) ;
- Size = MAP_APPFONT ( WIDTH_IMG_HELP, HEIGHT_IMG_HELP ) ;
- Hide = TRUE;
- };
- FixedText FT_PAGE_TITLE
- {
- Pos = MAP_APPFONT ( COL_3_3, ROW_1_2 ) ;
- Size = MAP_APPFONT ( (COL_3_5-COL_3_3), 15 ) ;
- Hide = TRUE;
- };
- FixedLine FL_LINE_1
- {
- Pos = MAP_APPFONT ( COL_3_1 , ROW_1_3 ) ;
- Size = MAP_APPFONT ( (COL_3_5-COL_3_1), 1 ) ;
- Comment = "Trennlinie" ;
- Hide = TRUE;
- };
- FixedText FT_HELPTEXT
- {
- Pos = MAP_APPFONT ( COL_3_3, ROW_1_4 ) ;
- Size = MAP_APPFONT ( (COL_3_5-COL_3_3), (HEIGHT_PAGEFRAME-ROW_1_4-1) ) ;
- WordBreak = TRUE;
- Hide = TRUE;
- };
- String ST_LOAD_ERROR
- {
- Text [ en-US ] = "The selected module could not be loaded.";
- };
- StringArray STR_HELPTEXTS
- {
- ItemList [ en-US ] =
- {
- < "This dialog is used to define general settings when working with %PRODUCTNAME. Enter your personal data, the defaults to be used when saving documents, and paths to important files. These settings will be saved automatically and used in later sessions as well."; SID_GENERAL_OPTIONS; > ;
- < "This is where you make settings concerning language and writing aids for your work with %PRODUCTNAME."; SID_LANGUAGE_OPTIONS; > ;
- < "This is where you configure %PRODUCTNAME for the Internet. You can define search engines or save your proxy settings." ; SID_INET_DLG; > ;
- < "This is where you specify various settings for text documents. These settings determine how your text documents are handled in %PRODUCTNAME and are valid for all new %PRODUCTNAME Writer documents. You can also define a few settings for the active text document if you save it afterwards." ; SID_SW_EDITOPTIONS; > ;
- < "This is where you define the basic settings for %PRODUCTNAME documents in HTML format. For example, you decide which contents should be displayed on the screen or printed, how the pages are scrolled on the screen, in which color keywords are highlighted in the source text and much more." ; SID_SW_ONLINEOPTIONS; > ;
- < "This is where you define various global settings for spreadsheets. For example, you can define which contents should be displayed and in which direction the cursor will move after you enter data in a cell. You also define sort lists, the number of the decimal places displayed, etc." ; SID_SC_EDITOPTIONS; > ;
- < "This is where you define the settings that apply to all newly saved presentations. Among other things, you decide which contents are displayed on the slides, which default unit of measure is used, if and how grid alignment is used, and if notes and handouts are always printed." ; SID_SD_EDITOPTIONS; > ;
- < "This is where you define the settings for drawing documents. Among other things, you determine which contents are displayed on the pages, which scale is used, if and how grid alignment is used, and which contents are printed by default." ; SID_SD_GRAPHIC_OPTIONS; > ;
- < "This is where you select the print format and print options for all newly saved formula documents. These options take effect when you want to print a formula directly from %PRODUCTNAME Math." ; SID_SM_EDITOPTIONS; > ;
- < "This is where you specify general default settings for your %PRODUCTNAME Charts. Set the colors you want for all new charts." ; SID_SCH_EDITOPTIONS; > ;
- < "This is where you define general settings for accessing external data sources."; SID_SB_STARBASEOPTIONS; > ;
- < "This is where you define general settings for opening and saving documents in external formats. You can control the behavior of macros or OLE objects in Microsoft Office documents or define settings for HTML documents." ; SID_FILTER_DLG; > ;
- };
- };
- Bitmap BMP_ROOT_CLOSED
- {
- File = "plus.bmp" ;
- };
- Bitmap BMP_ROOT_OPENED
- {
- File = "minus.bmp" ;
- };
-};
-
-Resource RID_OFADLG_OPTIONS_TREE_PAGES
-{
- StringArray SID_GENERAL_OPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME" ; 0; > ;
- < "User Data" ; RID_SFXPAGE_GENERAL; > ;
- < "General" ; OFA_TP_MISC; > ;
- < "Memory" ; OFA_TP_MEMORY; > ;
- < "View" ; OFA_TP_VIEW ; > ;
- < "Print" ; RID_SFXPAGE_PRINTOPTIONS; > ;
- < "Paths" ; RID_SFXPAGE_PATH; > ;
- < "Colors" ; RID_SVXPAGE_COLOR; > ;
- < "Fonts" ; RID_SVX_FONT_SUBSTITUTION ; > ;
- < "Security" ; RID_SVXPAGE_INET_SECURITY ; > ;
- < "Appearance" ; RID_SVXPAGE_COLORCONFIG ; > ;
- < "Accessibility" ; RID_SVXPAGE_ACCESSIBILITYCONFIG ; > ;
- < "Java" ; RID_SVXPAGE_OPTIONS_JAVA ; > ;
- < "Network Identity" ; RID_SVXPAGE_SSO ; > ;
- < "Online Update" ; RID_SVXPAGE_ONLINEUPDATE ; > ;
- < "" ; RID_SVXPAGE_IMPROVEMENT ; > ;
- };
- };
- StringArray SID_LANGUAGE_OPTIONS
- {
- ItemList [ en-US ] =
- {
- < "Language Settings" ; 0; > ;
- < "Languages"; OFA_TP_LANGUAGES; > ;
- < "Writing Aids" ; RID_SFXPAGE_LINGU; > ;
- < "Searching in Japanese" ; RID_SVXPAGE_JSEARCH_OPTIONS; > ;
- < "Asian Layout" ; RID_SVXPAGE_ASIAN_LAYOUT; > ;
- < "Complex Text Layout" ; RID_SVXPAGE_OPTIONS_CTL; >;
- };
- };
- StringArray SID_INET_DLG
- {
- //modified by jmeng begin
- ItemList [ en-US ] =
- {
- < "Internet" ; 0; > ;
- < "Proxy" ; RID_SVXPAGE_INET_PROXY; > ;
- < "Search" ; RID_SVXPAGE_INET_SEARCH; > ;
- < "E-mail" ; RID_SVXPAGE_INET_MAIL; > ;
- < "Browser Plug-in" ; RID_SVXPAGE_INET_MOZPLUGIN; > ;
- };
- //modified by jmeng end
- };
- StringArray SID_SW_EDITOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Writer" ; 0; > ;
- < "General" ; RID_SW_TP_OPTLOAD_PAGE ; > ;
- < "View" ; RID_SW_TP_CONTENT_OPT ;> ;
- < "Formatting Aids" ; RID_SW_TP_OPTSHDWCRSR ; > ;
- < "Grid" ; RID_SVXPAGE_GRID ; > ;
- < "Basic Fonts (Western)" ;RID_SW_TP_STD_FONT ; > ;
- < "Basic Fonts (Asian)" ;RID_SW_TP_STD_FONT_CJK ; > ;
- < "Basic Fonts (CTL)" ; RID_SW_TP_STD_FONT_CTL ; > ;
- < "Print" ; RID_SW_TP_OPTPRINT_PAGE ; > ;
- < "Table" ; RID_SW_TP_OPTTABLE_PAGE ; > ;
- < "Changes" ; RID_SW_TP_REDLINE_OPT ; > ;
- < "Compatibility" ; RID_SW_TP_OPTCOMPATIBILITY_PAGE ; > ;
- < "AutoCaption" ; RID_SW_TP_OPTCAPTION_PAGE ; > ;
- < "Mail Merge E-mail" ; RID_SW_TP_MAILCONFIG ; >;
- };
- };
- StringArray SID_SW_ONLINEOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Writer/Web" ; 0; > ;
- < "View" ; RID_SW_TP_HTML_CONTENT_OPT ;> ;
- < "Formatting Aids" ; RID_SW_TP_HTML_OPTSHDWCRSR ; > ;
- < "Grid" ; RID_SW_TP_HTML_OPTGRID_PAGE ; > ;
- < "Print" ; RID_SW_TP_HTML_OPTPRINT_PAGE ; > ;
- < "Table" ; RID_SW_TP_HTML_OPTTABLE_PAGE ; > ;
- < "Background" ; RID_SW_TP_BACKGROUND ; > ;
- };
- };
- StringArray SID_SM_EDITOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Math" ; 0; > ;
- < "Settings" ; SID_SM_TP_PRINTOPTIONS;> ;
- };
- };
- StringArray SID_SC_EDITOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Calc" ; 0; > ;
- < "General" ; SID_SC_TP_LAYOUT ;> ;
- < "View" ; SID_SC_TP_CONTENT ;> ;
- < "International" ; RID_OFA_TP_INTERNATIONAL ;> ;
- < "Calculate" ; SID_SC_TP_CALC ;> ;
- < "Sort Lists" ; SID_SC_TP_USERLISTS ;> ;
- < "Changes" ; SID_SC_TP_CHANGES ;> ;
- < "Grid" ; SID_SC_TP_GRID ;> ;
- < "Print" ; RID_SC_TP_PRINT ;> ;
- };
- };
- StringArray SID_SD_EDITOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Impress" ; 0; > ;
- < "General"; SID_SI_TP_MISC ; > ;
- < "View" ; SID_SI_TP_CONTENTS ; > ;
- < "Grid" ; SID_SI_TP_SNAP ; > ;
- < "Print" ; SID_SI_TP_PRINT ; > ;
- };
- };
- StringArray SID_SD_GRAPHIC_OPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Draw" ; 0; > ;
- < "General" ; SID_SD_TP_MISC ; > ;
- < "View" ; SID_SD_TP_CONTENTS ; > ;
- < "Grid" ; SID_SD_TP_SNAP ; > ;
- < "Print" ; SID_SD_TP_PRINT ; > ;
- };
- };
- StringArray SID_SCH_EDITOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "Charts" ; 0; > ;
- < "Default Colors" ; RID_OPTPAGE_CHART_DEFCOLORS ; > ;
- };
- };
- StringArray SID_FILTER_DLG
- {
- ItemList [ en-US ] =
- {
- < "Load/Save" ; 0; > ;
- < "General" ; RID_SFXPAGE_SAVE; > ;
- < "VBA Properties" ; SID_OPTFILTER_MSOFFICE; > ;
- < "Microsoft Office" ; RID_OFAPAGE_MSFILTEROPT2; > ;
- < "HTML Compatibility" ; RID_OFAPAGE_HTMLOPT ; > ;
- };
- };
- StringArray SID_SB_STARBASEOPTIONS
- {
- ItemList [ en-US ] =
- {
- < "%PRODUCTNAME Base" ; 0; > ;
- < "Connections" ; SID_SB_CONNECTIONPOOLING; > ;
- < "Databases" ; SID_SB_DBREGISTEROPTIONS; > ;
- };
- };
-};
-String RID_RIDER_SLL_SITE
-{
- Text [ en-US ] = "Site certificates" ;
-};
-String RID_RIDER_SLL_PERSONAL
-{
- Text [ en-US ] = "Personal certificates" ;
-};
-
-// RID_OFADLG_OPTIONS_TREE_WARNING ---------------------------------------
-
-ModalDialog RID_OFADLG_OPTIONS_TREE_HINT
-{
- OutputSize = TRUE;
- Size = MAP_APPFONT( 240, 105 );
- Moveable = TRUE;
- Closeable = TRUE;
- FixedImage IMG_HINT
- {
- Pos = MAP_APPFONT( 6, 6 );
- Size = MAP_APPFONT( 30, 30 );
- };
- FixedText FT_HINT
- {
- Pos = MAP_APPFONT( 39, 6 );
- Size = MAP_APPFONT( 195, 60 );
- WordBreak = TRUE;
- Text [ en-US ] = "Please note: the settings displayed refer to the internal browser of %PRODUCTNAME (%PRODUCTNAME Writer/Web). In \"Tools - Options - Browser - External Browser\" the use of a different browser has been activated. In order to be able to use the same settings in other browsers you need to define these in the external browser settings.";
- };
- CheckBox CB_DISABLE
- {
- Pos = MAP_APPFONT( 39, 69 );
- Size = MAP_APPFONT( 195, 12 );
- Text [ en-US ] = "~Do not show information again";
- };
- OKButton BTN_HINT
- {
- Pos = MAP_APPFONT( 95, 85 );
- Size = MAP_APPFONT( 50, 14 );
- };
-};
-
-// ******************************************************************* EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/cui/webconninfo.cxx b/svx/source/cui/webconninfo.cxx
deleted file mode 100644
index 33bd7f8925..0000000000
--- a/svx/source/cui/webconninfo.cxx
+++ /dev/null
@@ -1,386 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: webconninfo.cxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
-#include <svx/dialogs.hrc>
-#endif
-
-#include <com/sun/star/task/UrlRecord.hpp>
-#include <com/sun/star/task/XPasswordContainer.hpp>
-#include <com/sun/star/task/XMasterPasswordHandling.hpp>
-#include "com/sun/star/task/XUrlContainer.hpp"
-
-#include <comphelper/processfactory.hxx>
-#include <comphelper/docpasswordrequest.hxx>
-
-#include "webconninfo.hxx"
-#include "webconninfo.hrc"
-
-using namespace ::com::sun::star;
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
-// class PasswordTable ---------------------------------------------------
-
-PasswordTable::PasswordTable( Window* pParent, const ResId& rResId ) :
- SvxSimpleTable( pParent, rResId )
-{
- SetWindowBits( GetStyle() | WB_NOINITIALSELECTION );
-}
-
-void PasswordTable::InsertHeaderItem( USHORT nColumn, const String& rText, HeaderBarItemBits nBits )
-{
- GetTheHeaderBar()->InsertItem( nColumn, rText, 0, nBits );
-}
-
-void PasswordTable::ResetTabs()
-{
- SetTabs();
-}
-
-void PasswordTable::Resort( bool bForced )
-{
- USHORT nColumn = GetSelectedCol();
- if ( 0 == nColumn || bForced ) // only the first column is sorted
- {
- HeaderBarItemBits nBits = GetTheHeaderBar()->GetItemBits(1);
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- SvSortMode eMode = SortAscending;
-
- if ( bUp )
- {
- nBits &= ~HIB_UPARROW;
- nBits |= HIB_DOWNARROW;
- eMode = SortDescending;
- }
- else
- {
- nBits &= ~HIB_DOWNARROW;
- nBits |= HIB_UPARROW;
- }
- GetTheHeaderBar()->SetItemBits( 1, nBits );
- SvTreeList* pListModel = GetModel();
- pListModel->SetSortMode( eMode );
- pListModel->Resort();
- }
-}
-
-// class WebConnectionInfoDialog -----------------------------------------
-
-// -----------------------------------------------------------------------
-WebConnectionInfoDialog::WebConnectionInfoDialog( Window* pParent ) :
- ModalDialog( pParent, SVX_RES( RID_SVXDLG_WEBCONNECTION_INFO ) )
- ,m_aNeverShownFI ( this, SVX_RES( FI_NEVERSHOWN ) )
- ,m_aPasswordsLB ( this, SVX_RES( LB_PASSWORDS ) )
- ,m_aRemoveBtn ( this, SVX_RES( PB_REMOVE ) )
- ,m_aRemoveAllBtn ( this, SVX_RES( PB_REMOVEALL ) )
- ,m_aChangeBtn ( this, SVX_RES( PB_CHANGE ) )
- ,m_aButtonsFL ( this, SVX_RES( FL_BUTTONS ) )
- ,m_aCloseBtn ( this, SVX_RES( PB_CLOSE ) )
- ,m_aHelpBtn ( this, SVX_RES( PB_HELP ) )
- ,m_nPos ( -1 )
-{
- static long aStaticTabs[]= { 3, 0, 150, 250 };
- m_aPasswordsLB.SetTabs( aStaticTabs );
- m_aPasswordsLB.InsertHeaderItem( 1, SVX_RESSTR( STR_WEBSITE ),
- HIB_LEFT | HIB_VCENTER | HIB_FIXEDPOS | HIB_CLICKABLE | HIB_UPARROW );
- m_aPasswordsLB.InsertHeaderItem( 2, SVX_RESSTR( STR_USERNAME ),
- HIB_LEFT | HIB_VCENTER | HIB_FIXEDPOS );
- m_aPasswordsLB.ResetTabs();
-
- FreeResource();
-
- m_aPasswordsLB.SetHeaderBarClickHdl( LINK( this, WebConnectionInfoDialog, HeaderBarClickedHdl ) );
- m_aRemoveBtn.SetClickHdl( LINK( this, WebConnectionInfoDialog, RemovePasswordHdl ) );
- m_aRemoveAllBtn.SetClickHdl( LINK( this, WebConnectionInfoDialog, RemoveAllPasswordsHdl ) );
- m_aChangeBtn.SetClickHdl( LINK( this, WebConnectionInfoDialog, ChangePasswordHdl ) );
-
- // one button too small for its text?
- sal_Int32 i = 0;
- long nBtnTextWidth = 0;
- Window* pButtons[] = { &m_aRemoveBtn, &m_aRemoveAllBtn, &m_aChangeBtn };
- Window** pButton = pButtons;
- const sal_Int32 nBCount = sizeof( pButtons ) / sizeof( pButtons[ 0 ] );
- for ( ; i < nBCount; ++i, ++pButton )
- {
- long nTemp = (*pButton)->GetCtrlTextWidth( (*pButton)->GetText() );
- if ( nTemp > nBtnTextWidth )
- nBtnTextWidth = nTemp;
- }
- nBtnTextWidth = nBtnTextWidth * 115 / 100; // a little offset
- long nButtonWidth = m_aRemoveBtn.GetSizePixel().Width();
- if ( nBtnTextWidth > nButtonWidth )
- {
- // so make the buttons broader and its control in front of it smaller
- long nDelta = nBtnTextWidth - nButtonWidth;
- pButton = pButtons;
- for ( i = 0; i < nBCount; ++i, ++pButton )
- {
- Point aNewPos = (*pButton)->GetPosPixel();
- if ( &m_aRemoveAllBtn == (*pButton) )
- aNewPos.X() += nDelta;
- else if ( &m_aChangeBtn == (*pButton) )
- aNewPos.X() -= nDelta;
- Size aNewSize = (*pButton)->GetSizePixel();
- aNewSize.Width() += nDelta;
- (*pButton)->SetPosSizePixel( aNewPos, aNewSize );
- }
- }
-
- FillPasswordList();
-
- m_aRemoveBtn.SetClickHdl( LINK( this, WebConnectionInfoDialog, RemovePasswordHdl ) );
- m_aRemoveAllBtn.SetClickHdl( LINK( this, WebConnectionInfoDialog, RemoveAllPasswordsHdl ) );
- m_aChangeBtn.SetClickHdl( LINK( this, WebConnectionInfoDialog, ChangePasswordHdl ) );
- m_aPasswordsLB.SetSelectHdl( LINK( this, WebConnectionInfoDialog, EntrySelectedHdl ) );
-
- m_aRemoveBtn.Enable( FALSE );
- m_aChangeBtn.Enable( FALSE );
-
- HeaderBarClickedHdl( NULL );
-}
-
-// -----------------------------------------------------------------------
-WebConnectionInfoDialog::~WebConnectionInfoDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-IMPL_LINK( WebConnectionInfoDialog, HeaderBarClickedHdl, SvxSimpleTable*, pTable )
-{
- m_aPasswordsLB.Resort( NULL == pTable );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-void WebConnectionInfoDialog::FillPasswordList()
-{
- try
- {
- uno::Reference< task::XMasterPasswordHandling > xMasterPasswd(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ),
- uno::UNO_QUERY );
-
- if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() )
- {
- uno::Reference< task::XPasswordContainer > xPasswdContainer( xMasterPasswd, uno::UNO_QUERY_THROW );
- uno::Reference< task::XInteractionHandler > xInteractionHandler(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ),
- uno::UNO_QUERY_THROW );
-
- uno::Sequence< task::UrlRecord > aURLEntries = xPasswdContainer->getAllPersistent( xInteractionHandler );
- sal_Int32 nCount = 0;
- for ( sal_Int32 nURLInd = 0; nURLInd < aURLEntries.getLength(); nURLInd++ )
- {
- for ( sal_Int32 nUserInd = 0; nUserInd < aURLEntries[nURLInd].UserList.getLength(); nUserInd++ )
- {
- ::rtl::OUString aUIEntry( aURLEntries[nURLInd].Url );
- aUIEntry += ::rtl::OUString::valueOf( (sal_Unicode)'\t' );
- aUIEntry += aURLEntries[nURLInd].UserList[nUserInd].UserName;
- SvLBoxEntry* pEntry = m_aPasswordsLB.InsertEntry( aUIEntry );
- pEntry->SetUserData( (void*)(nCount++) );
- }
- }
-
- // remember pos of first url container entry.
- m_nPos = nCount;
-
- uno::Reference< task::XUrlContainer > xUrlContainer(
- xPasswdContainer, uno::UNO_QUERY_THROW );
-
- uno::Sequence< rtl::OUString > aUrls
- = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ );
-
- for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
- {
- ::rtl::OUString aUIEntry( aUrls[ nURLIdx ] );
- aUIEntry += ::rtl::OUString::valueOf( (sal_Unicode)'\t' );
- aUIEntry += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*" ) );
- SvLBoxEntry* pEntry = m_aPasswordsLB.InsertEntry( aUIEntry );
- pEntry->SetUserData( (void*)(nCount++) );
- }
- }
- }
- catch( uno::Exception& )
- {}
-}
-
-// -----------------------------------------------------------------------
-IMPL_LINK( WebConnectionInfoDialog, RemovePasswordHdl, PushButton*, EMPTYARG )
-{
- try
- {
- SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry();
- if ( pEntry )
- {
- ::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
- ::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
-
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.task.PasswordContainer" ) ) ),
- uno::UNO_QUERY_THROW );
-
- sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
- if ( nPos < m_nPos )
- {
- xPasswdContainer->removePersistent( aURL, aUserName );
- }
- else
- {
- uno::Reference< task::XUrlContainer > xUrlContainer(
- xPasswdContainer, uno::UNO_QUERY_THROW );
- xUrlContainer->removeUrl( aURL );
- }
- m_aPasswordsLB.RemoveEntry( pEntry );
- }
- }
- catch( uno::Exception& )
- {}
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-IMPL_LINK( WebConnectionInfoDialog, RemoveAllPasswordsHdl, PushButton*, EMPTYARG )
-{
- try
- {
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.task.PasswordContainer" ) ) ),
- uno::UNO_QUERY_THROW );
-
- // should the master password be requested before?
- xPasswdContainer->removeAllPersistent();
-
- uno::Reference< task::XUrlContainer > xUrlContainer(
- xPasswdContainer, uno::UNO_QUERY_THROW );
- uno::Sequence< rtl::OUString > aUrls
- = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ );
- for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
- xUrlContainer->removeUrl( aUrls[ nURLIdx ] );
-
- m_aPasswordsLB.Clear();
- }
- catch( uno::Exception& )
- {}
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-IMPL_LINK( WebConnectionInfoDialog, ChangePasswordHdl, PushButton*, EMPTYARG )
-{
- try
- {
- SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry();
- if ( pEntry )
- {
- ::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
- ::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
-
- ::comphelper::DocPasswordRequest* pPasswordRequest
- = new ::comphelper::DocPasswordRequest(
- ::comphelper::DocPasswordRequestType_STANDARD,
- task::PasswordRequestMode_PASSWORD_CREATE, aURL );
- uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest );
-
- uno::Reference< task::XInteractionHandler > xInteractionHandler(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.task.InteractionHandler" ) ) ),
- uno::UNO_QUERY_THROW );
- xInteractionHandler->handle( rRequest );
-
- if ( pPasswordRequest->isPassword() )
- {
- String aNewPass = pPasswordRequest->getPassword();
- uno::Sequence< ::rtl::OUString > aPasswd( 1 );
- aPasswd[0] = aNewPass;
-
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.task.PasswordContainer" ) ) ),
- uno::UNO_QUERY_THROW );
- xPasswdContainer->addPersistent(
- aURL, aUserName, aPasswd, xInteractionHandler );
- }
- }
- }
- catch( uno::Exception& )
- {}
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-IMPL_LINK( WebConnectionInfoDialog, EntrySelectedHdl, void*, EMPTYARG )
-{
- SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry();
- if ( !pEntry )
- {
- m_aRemoveBtn.Enable( FALSE );
- m_aChangeBtn.Enable( FALSE );
- }
- else
- {
- m_aRemoveBtn.Enable( TRUE );
-
- // url container entries (-> use system credentials) have
- // no password
- sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
- m_aChangeBtn.Enable( nPos < m_nPos );
- }
-
- return 0;
-}
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
diff --git a/svx/source/cui/webconninfo.hrc b/svx/source/cui/webconninfo.hrc
deleted file mode 100644
index d4be1e151b..0000000000
--- a/svx/source/cui/webconninfo.hrc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: webconninfo.hrc,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_WEBCONNINFO_HRC
-#define _SVX_WEBCONNINFO_HRC
-
-#define FI_NEVERSHOWN 10
-#define LB_PASSWORDS 11
-#define PB_REMOVE 12
-#define PB_REMOVEALL 13
-#define PB_CHANGE 14
-#define FL_BUTTONS 15
-// #define PB_OK 16
-#define PB_CLOSE 17
-#define PB_HELP 18
-
-#define STR_WEBSITE 10
-#define STR_USERNAME 11
-
-#define DLG_WIDTH 260
-#define DLG_HEIGHT 150
-
-#define COL_0 (RSC_SP_DLG_INNERBORDER_LEFT)
-#define COL_1 (COL_0+RSC_CD_PUSHBUTTON_WIDTH+RSC_SP_CTRL_GROUP_X)
-#define COL_2 (DLG_WIDTH-RSC_SP_DLG_INNERBORDER_LEFT)
-#define COL_C (COL_2-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_B (COL_C-RSC_SP_CTRL_X-RSC_CD_PUSHBUTTON_WIDTH)
-#define COL_A (COL_B-RSC_SP_CTRL_GROUP_X-RSC_CD_PUSHBUTTON_WIDTH)
-
-#define ROW_0 (RSC_SP_DLG_INNERBORDER_TOP)
-#define ROW_1 (ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_FLGR_SPACE_Y)
-#define ROW_5 (DLG_HEIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM-RSC_CD_PUSHBUTTON_HEIGHT)
-#define ROW_4 (ROW_5-RSC_SP_FLGR_SPACE_Y-RSC_CD_FIXEDLINE_HEIGHT)
-#define ROW_3 (ROW_4-RSC_SP_FLGR_SPACE_Y-RSC_CD_PUSHBUTTON_HEIGHT)
-#define ROW_2 (ROW_3-RSC_SP_GRP_SPACE_Y)
-
-#endif // #ifndef _SVX_WEBCONNINFO_HRC
-
diff --git a/svx/source/cui/webconninfo.hxx b/svx/source/cui/webconninfo.hxx
deleted file mode 100644
index 3ee7e50458..0000000000
--- a/svx/source/cui/webconninfo.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: webconninfo.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_WEBCONNINFO_HXX
-#define _SVX_WEBCONNINFO_HXX
-
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svx/simptabl.hxx>
-
-//........................................................................
-namespace svx
-{
-//........................................................................
-
- class PasswordTable : public SvxSimpleTable
- {
- public:
- PasswordTable( Window* pParent, const ResId& rResId );
-
- void InsertHeaderItem( USHORT nColumn, const String& rText, HeaderBarItemBits nBits );
- void ResetTabs();
- void Resort( bool bForced );
- };
-
- //====================================================================
- //= class WebConnectionIfoDialog
- //====================================================================
- class WebConnectionInfoDialog : public ModalDialog
- {
- private:
- FixedInfo m_aNeverShownFI;
- PasswordTable m_aPasswordsLB;
- PushButton m_aRemoveBtn;
- PushButton m_aRemoveAllBtn;
- PushButton m_aChangeBtn;
- FixedLine m_aButtonsFL;
- CancelButton m_aCloseBtn;
- HelpButton m_aHelpBtn;
- sal_Int32 m_nPos;
-
- DECL_LINK( HeaderBarClickedHdl, SvxSimpleTable* );
- DECL_LINK( RemovePasswordHdl, PushButton* );
- DECL_LINK( RemoveAllPasswordsHdl, PushButton* );
- DECL_LINK( ChangePasswordHdl, PushButton* );
- DECL_LINK( EntrySelectedHdl, void* );
-
- void FillPasswordList();
-
- public:
- WebConnectionInfoDialog( Window* pParent );
- ~WebConnectionInfoDialog();
- };
-
-//........................................................................
-} // namespace svx
-//........................................................................
-
-#endif // #ifndef _SVX_WEBCONNINFO_HXX
-
diff --git a/svx/source/cui/webconninfo.src b/svx/source/cui/webconninfo.src
deleted file mode 100644
index e5411d4542..0000000000
--- a/svx/source/cui/webconninfo.src
+++ /dev/null
@@ -1,106 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: webconninfo.src,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include --------------------------------------------------------------
-
-#include <svtools/controldims.hrc>
-#include "webconninfo.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-ModalDialog RID_SVXDLG_WEBCONNECTION_INFO
-{
- HelpID = HID_DLG_WEBCONNECTION_INFO ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "Stored Web Connection Information" ;
- FixedText FI_NEVERSHOWN
- {
- Pos = MAP_APPFONT( COL_0, ROW_0 );
- Size = MAP_APPFONT( COL_2-COL_0, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "Web login information (passwords are never shown)";
- };
- Control LB_PASSWORDS
- {
- Pos = MAP_APPFONT ( COL_0 , ROW_1 ) ;
- Size = MAP_APPFONT ( COL_2-COL_0 , ROW_2-ROW_1 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_REMOVE
- {
- Pos = MAP_APPFONT ( COL_0 , ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Remove";
- };
- PushButton PB_REMOVEALL
- {
- Pos = MAP_APPFONT ( COL_1 , ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Remove All";
- };
- PushButton PB_CHANGE
- {
- Pos = MAP_APPFONT ( COL_C , ROW_3 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Change Password...";
- };
- FixedLine FL_BUTTONS
- {
- Pos = MAP_APPFONT( 0, ROW_4 );
- Size = MAP_APPFONT( DLG_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- };
- CancelButton PB_CLOSE
- {
- Pos = MAP_APPFONT ( COL_B , ROW_5 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- Text [ en-US ] = "Close";
- };
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT ( COL_C , ROW_5 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- };
- String STR_WEBSITE
- {
- Text [ en-US ] = "Website";
- };
- String STR_USERNAME
- {
- Text [ en-US ] = "User name";
- };
-};
-
diff --git a/svx/source/cui/winpluginlib.cpp b/svx/source/cui/winpluginlib.cpp
deleted file mode 100644
index 17928c161b..0000000000
--- a/svx/source/cui/winpluginlib.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: winpluginlib.cpp,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
-#include <windows.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-#include <Winreg.h>
-#include <Shlwapi.h>
-#include <stdio.h>
-
-
-#define SO_PATH_SIZE 4096
-#define MOZ_PLUGIN_DLL_NAME "npsopluginmi.dll"
-extern "C" {
-int lc_isInstalled(const char* realFilePath)
-{
- HKEY hKeySoftware;
- HKEY hMozillaPlugins;
- HKEY hStarOffice;
- char sSoPath[SO_PATH_SIZE];
- char sPluginPath[SO_PATH_SIZE];
-
- LONG ret;
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ, &hKeySoftware);
- if(ret != ERROR_SUCCESS){
- ret = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE", 0, KEY_READ, &hKeySoftware);
- if(ret != ERROR_SUCCESS){
- return -1;
- }
- }
- ret = RegOpenKeyEx(hKeySoftware, "MozillaPlugins", 0, KEY_READ, &hMozillaPlugins);
- if(ret != ERROR_SUCCESS){
- RegCloseKey(hKeySoftware);
- if( ret == ERROR_FILE_NOT_FOUND)
- return 1;
- else
- return -1;
- }
- ret = RegOpenKeyEx(hMozillaPlugins, "@sun.com/npsopluginmi;version=1.0", 0, KEY_READ, &hStarOffice);
- if(ret != ERROR_SUCCESS){
- RegCloseKey(hKeySoftware);
- RegCloseKey(hMozillaPlugins);
- if( ret == ERROR_FILE_NOT_FOUND)
- return 1;
- else
- return -1;
- }
-
- if((realFilePath == NULL) || (strlen(realFilePath) == 0) || (strlen(realFilePath) >= SO_PATH_SIZE))
- ret = -1;
- else{
- sprintf(sSoPath,"%s", realFilePath);
- ret = 0;
- }
- //ret = GetCurrentDirectory( SO_PATH_SIZE, sSoPath);
- //ret = GetEnvironmentVariable("prog", sSoPath, SO_PATH_SIZE);
- // GetCurrentDirectory return the char number of the string
- if(ret == 0){
- DWORD dType = REG_SZ;
- DWORD dSize = SO_PATH_SIZE;
- ret = RegQueryValueEx (hStarOffice, "Path", NULL, &dType , (LPBYTE) sPluginPath, &dSize);
- if(ret == ERROR_SUCCESS){
- if(strcmp(sPluginPath, sSoPath) == 0)
- ret = 0;
- else
- ret = 1;
- }
- else
- ret = -1;
- }
- else
- ret = -1;
- RegCloseKey(hStarOffice);
- RegCloseKey(hMozillaPlugins);
- RegCloseKey(hKeySoftware);
- return ret;
-}
-
-int lc_uninstallPlugin(const char*)
-{
- HKEY hKeySoftware;
- HKEY hMozillaPlugins;
- HKEY hStarOffice;
-
- LONG ret;
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ|KEY_WRITE, &hKeySoftware);
- if(ret != ERROR_SUCCESS){
- ret = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE", 0, KEY_READ|KEY_WRITE, &hKeySoftware);
- if(ret != ERROR_SUCCESS){
- return -1;
- }
- }
- ret = RegOpenKeyEx(hKeySoftware, "MozillaPlugins", 0, KEY_READ|KEY_WRITE, &hMozillaPlugins);
- if(ret != ERROR_SUCCESS){
- RegCloseKey(hKeySoftware);
- if( ret == ERROR_FILE_NOT_FOUND)
- return 0;
- else
- return -1;
- }
-
- ret = RegOpenKeyEx(hMozillaPlugins, "@sun.com/npsopluginmi;version=1.0", 0, KEY_READ|KEY_WRITE, &hStarOffice);
- if(ret != ERROR_SUCCESS){
- RegCloseKey(hKeySoftware);
- RegCloseKey(hMozillaPlugins);
- if( ret == ERROR_FILE_NOT_FOUND)
- return 0;
- else
- return -1;
- }
- RegCloseKey(hStarOffice);
- ret = SHDeleteKey(hMozillaPlugins, "@sun.com/npsopluginmi;version=1.0");
- if(ret != ERROR_SUCCESS){
- ret = -1;
- }
- RegFlushKey(hMozillaPlugins);
- RegCloseKey(hMozillaPlugins);
- RegCloseKey(hKeySoftware);
- return ret;
-}
-
-int lc_installPlugin(const char* realFilePath)
-{
- HKEY hKeySoftware;
- HKEY hMozillaPlugins;
- HKEY hStarOffice;
- char sSoPath[SO_PATH_SIZE];
- DWORD sState;
-
-
- LONG ret;
- ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ|KEY_WRITE, &hKeySoftware);
- if(ret != ERROR_SUCCESS){
- ret = RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE", 0, KEY_READ|KEY_WRITE, &hKeySoftware);
- if(ret != ERROR_SUCCESS){
- return -1;
- }
- }
- ret = RegOpenKeyEx(hKeySoftware, "MozillaPlugins", 0, KEY_READ|KEY_WRITE, &hMozillaPlugins);
- if(ret != ERROR_SUCCESS){
- RegCreateKeyEx(hKeySoftware,
- "MozillaPlugins",
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_READ|KEY_WRITE,
- NULL,
- &hMozillaPlugins,
- &sState);
- }
-
- ret = RegCreateKeyEx(hMozillaPlugins,
- "@sun.com/npsopluginmi;version=1.0",
- 0,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_READ|KEY_WRITE,
- NULL,
- &hStarOffice,
- &sState);
- if(ret != ERROR_SUCCESS){
- RegCloseKey(hKeySoftware);
- RegCloseKey(hMozillaPlugins);
- return -1;
- }
-
- RegFlushKey(hStarOffice);
- RegFlushKey(hMozillaPlugins);
-
-
- if((realFilePath == NULL) || (strlen(realFilePath) == 0) || (strlen(realFilePath) >= SO_PATH_SIZE))
- ret = -1;
- else{
- sprintf(sSoPath,"%s", realFilePath);
- ret = 0;
- }
-
- //ret = GetCurrentDirectory( SO_PATH_SIZE, sSoPath);
- // GetCurrentDirectory return the char number of the string
- if(ret == 0){
- ret = RegSetValueEx( hStarOffice, "Path", 0, REG_SZ, (LPBYTE) sSoPath, strlen(sSoPath) + 1);
- if(ret == ERROR_SUCCESS)
- ret = 0;
- else
- ret = -1;
- }
- else
- ret = -1;
- RegFlushKey(hStarOffice);
- RegFlushKey(hMozillaPlugins);
- RegCloseKey(hStarOffice);
- RegCloseKey(hMozillaPlugins);
- RegCloseKey(hKeySoftware);
- RegFlushKey(HKEY_LOCAL_MACHINE);
-
- return ret;
-}
-}
diff --git a/svx/source/cui/zoom.cxx b/svx/source/cui/zoom.cxx
deleted file mode 100644
index 78fc77a336..0000000000
--- a/svx/source/cui/zoom.cxx
+++ /dev/null
@@ -1,541 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: zoom.cxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#include <tools/shl.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/itempool.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-
-#define _SVX_ZOOM_CXX
-
-#include <svx/dialogs.hrc>
-#include "zoom.hrc"
-
-#include "zoom.hxx"
-#include <svx/zoomitem.hxx>
-#include <svx/viewlayoutitem.hxx>
-#include <svx/dialmgr.hxx>
-#include "zoom_def.hxx"
-
-#include <layout/layout-pre.hxx>
-
-#if ENABLE_LAYOUT
-#undef SVX_RES
-#define SVX_RES(x) #x
-#undef SfxModalDialog
-#define SfxModalDialog( parent, id ) Dialog( parent, "zoom.xml", id )
-#endif /* ENABLE_LAYOUT */
-
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_ATTR_ZOOM,
- SID_ATTR_ZOOM,
- 0
-};
-
-#define SPECIAL_FACTOR ((USHORT)0xFFFF)
-
-// class SvxZoomDialog ---------------------------------------------------
-
-USHORT SvxZoomDialog::GetFactor() const
-{
- if ( a100Btn.IsChecked() )
- return 100;
- if ( aUserBtn.IsChecked() )
- return (USHORT)aUserEdit.GetValue();
- else
- return SPECIAL_FACTOR;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId )
-{
- aUserEdit.Disable();
-
- if ( !nBtnId )
- {
- if ( nNewFactor == 100 )
- {
- a100Btn.Check();
- a100Btn.GrabFocus();
- }
- else
- {
- aUserBtn.Check();
- aUserEdit.Enable();
- aUserEdit.SetValue( (long)nNewFactor );
- aUserEdit.GrabFocus();
- }
- }
- else
- {
- aUserEdit.SetValue( (long)nNewFactor );
-
- if ( ZOOMBTN_OPTIMAL == nBtnId )
- {
- aOptimalBtn.Check();
- aOptimalBtn.GrabFocus();
- }
- else if ( ZOOMBTN_PAGEWIDTH == nBtnId )
- {
- aPageWidthBtn.Check();
- aPageWidthBtn.GrabFocus();
- }
- else if ( ZOOMBTN_WHOLEPAGE == nBtnId )
- {
- aWholePageBtn.Check();
- aWholePageBtn.GrabFocus();
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetButtonText( USHORT nBtnId, const String& rNewTxt )
-{
- switch ( nBtnId )
- {
- case ZOOMBTN_OPTIMAL: // Optimal-Button
- aOptimalBtn.SetText( rNewTxt );
- break;
-
- case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button
- aPageWidthBtn.SetText( rNewTxt );
- break;
-
- case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button
- aWholePageBtn.SetText( rNewTxt );
- break;
-
- default:
- DBG_ERROR( "wrong button number" );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::HideButton( USHORT nBtnId )
-{
- switch ( nBtnId )
- {
- case ZOOMBTN_OPTIMAL: // Optimal-Button
- aOptimalBtn.Hide();
- break;
-
- case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button
- aPageWidthBtn.Hide();
- break;
-
- case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button
- aWholePageBtn.Hide();
- break;
-
- default:
- DBG_ERROR( "Falsche Button-Nummer!!!" );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetLimits( USHORT nMin, USHORT nMax )
-{
- DBG_ASSERT( nMin < nMax, "invalid limits" );
- aUserEdit.SetMin( nMin );
- aUserEdit.SetFirst( nMin );
- aUserEdit.SetMax( nMax );
- aUserEdit.SetLast( nMax );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetSpinSize( USHORT nNewSpin )
-{
- aUserEdit.SetSpinSize( nNewSpin );
-}
-
-// -----------------------------------------------------------------------
-
-SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
-
- SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_ZOOM ) ),
-
- aZoomFl ( this, SVX_RES( FL_ZOOM ) ),
- aOptimalBtn ( this, SVX_RES( BTN_OPTIMAL ) ),
- aWholePageBtn ( this, SVX_RES( BTN_WHOLE_PAGE ) ),
- aPageWidthBtn ( this, SVX_RES( BTN_PAGE_WIDTH ) ),
- a100Btn ( this, SVX_RES( BTN_100 ) ),
- aUserBtn ( this, SVX_RES( BTN_USER ) ),
- aUserEdit ( this, SVX_RES( ED_USER ) ),
-
- aViewLayoutFl ( this, SVX_RES( FL_VIEWLAYOUT ) ),
- aAutomaticBtn ( this, SVX_RES( BTN_AUTOMATIC ) ),
- aSingleBtn ( this, SVX_RES( BTN_SINGLE ) ),
- aColumnsBtn ( this, SVX_RES( BTN_COLUMNS ) ),
- aColumnsEdit ( this, SVX_RES( ED_COLUMNS ) ),
- aBookModeChk ( this, SVX_RES( CHK_BOOK ) ),
-
- aBottomFl ( this, SVX_RES( FL_BOTTOM ) ),
- aOKBtn ( this, SVX_RES( BTN_ZOOM_OK ) ),
- aCancelBtn ( this, SVX_RES( BTN_ZOOM_CANCEL ) ),
- aHelpBtn ( this, SVX_RES( BTN_ZOOM_HELP ) ),
-
- rSet ( rCoreSet ),
- pOutSet ( NULL ),
- bModified ( FALSE )
-
-{
-#if ENABLE_LAYOUT
- SetHelpId (SID_ATTR_ZOOM);
-#endif /* ENABLE_LAYOUT */
- Link aLink = LINK( this, SvxZoomDialog, UserHdl );
- a100Btn.SetClickHdl( aLink );
- aOptimalBtn.SetClickHdl( aLink );
- aPageWidthBtn.SetClickHdl( aLink );
- aWholePageBtn.SetClickHdl( aLink );
- aUserBtn.SetClickHdl( aLink );
-
- Link aViewLayoutLink = LINK( this, SvxZoomDialog, ViewLayoutUserHdl );
- aAutomaticBtn.SetClickHdl( aViewLayoutLink );
- aSingleBtn.SetClickHdl( aViewLayoutLink );
- aColumnsBtn.SetClickHdl( aViewLayoutLink );
-
- Link aViewLayoutSpinLink = LINK( this, SvxZoomDialog, ViewLayoutSpinHdl );
- aColumnsEdit.SetModifyHdl( aViewLayoutSpinLink );
-
- Link aViewLayoutCheckLink = LINK( this, SvxZoomDialog, ViewLayoutCheckHdl );
- aBookModeChk.SetClickHdl( aViewLayoutCheckLink );
-
- aOKBtn.SetClickHdl( LINK( this, SvxZoomDialog, OKHdl ) );
- aUserEdit.SetModifyHdl( LINK( this, SvxZoomDialog, SpinHdl ) );
-
- // Default-Werte
- USHORT nValue = 100;
- USHORT nMin = 10;
- USHORT nMax = 1000;
-
- // ggf. erst den alten Wert besorgen
- const SfxUInt16Item* pOldUserItem = 0;
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- if ( pSh )
- pOldUserItem = (const SfxUInt16Item*)pSh->GetItem( SID_ATTR_ZOOM_USER );
-
- if ( pOldUserItem )
- nValue = pOldUserItem->GetValue();
-
- // UserEdit initialisieren
- if ( nMin > nValue )
- nMin = nValue;
- if ( nMax < nValue )
- nMax = nValue;
- aUserEdit.SetMin( nMin );
- aUserEdit.SetFirst( nMin );
- aUserEdit.SetMax( nMax );
- aUserEdit.SetLast( nMax );
- aUserEdit.SetValue( nValue );
-
- const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
-
- if ( rItem.ISA(SvxZoomItem) )
- {
- const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem;
- const USHORT nZoom = rZoomItem.GetValue();
- const SvxZoomType eType = rZoomItem.GetType();
- const USHORT nValSet = rZoomItem.GetValueSet();
- USHORT nBtnId = 0;
-
- switch ( eType )
- {
- case SVX_ZOOM_OPTIMAL:
- nBtnId = ZOOMBTN_OPTIMAL;
- break;
- case SVX_ZOOM_PAGEWIDTH:
- nBtnId = ZOOMBTN_PAGEWIDTH;
- break;
- case SVX_ZOOM_WHOLEPAGE:
- nBtnId = ZOOMBTN_WHOLEPAGE;
- break;
- case SVX_ZOOM_PERCENT:
- break;
- case SVX_ZOOM_PAGEWIDTH_NOBORDER:
- break;
- }
-
- if ( !(SVX_ZOOM_ENABLE_100 & nValSet) )
- a100Btn.Disable();
- if ( !(SVX_ZOOM_ENABLE_OPTIMAL & nValSet) )
- aOptimalBtn.Disable();
- if ( !(SVX_ZOOM_ENABLE_PAGEWIDTH & nValSet) )
- aPageWidthBtn.Disable();
- if ( !(SVX_ZOOM_ENABLE_WHOLEPAGE & nValSet) )
- aWholePageBtn.Disable();
- SetFactor( nZoom, nBtnId );
- }
- else
- {
- const USHORT nZoom = ( (const SfxUInt16Item&)rItem ).GetValue();
- SetFactor( nZoom );
- }
-
- const SfxPoolItem* pViewLayoutItem = 0;
- if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_VIEWLAYOUT, FALSE, &pViewLayoutItem ) )
- {
- const USHORT nColumns = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->GetValue();
- const bool bBookMode = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->IsBookMode();
-
- if ( 0 == nColumns )
- {
- aAutomaticBtn.Check();
- aColumnsEdit.SetValue( 2 );
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else if ( 1 == nColumns)
- {
- aSingleBtn.Check();
- aColumnsEdit.SetValue( 2 );
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else
- {
- aColumnsBtn.Check();
- if ( !bBookMode )
- {
- aColumnsEdit.SetValue( nColumns );
- if ( 0 != nColumns % 2 )
- aBookModeChk.Disable();
- }
- else
- {
- aColumnsEdit.SetValue( nColumns );
- aBookModeChk.Check();
- }
- }
- }
- else
- {
- // hide view layout related controls:
- aViewLayoutFl.Disable();
- aAutomaticBtn.Disable();
- aSingleBtn.Disable();
- aColumnsBtn.Disable();
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxZoomDialog::~SvxZoomDialog()
-{
- delete pOutSet;
- pOutSet = 0;
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxZoomDialog::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn )
-{
- bModified |= TRUE;
-
- if ( pBtn == &aUserBtn )
- {
- aUserEdit.Enable();
- aUserEdit.GrabFocus();
- }
- else
- aUserEdit.Disable();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, SpinHdl, MetricField *, EMPTYARG )
-{
- if ( !aUserBtn.IsChecked() )
- return 0;
- bModified |= TRUE;
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn )
-{
- bModified |= TRUE;
-
- if ( pBtn == &aAutomaticBtn )
- {
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else if ( pBtn == &aSingleBtn )
- {
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else if ( pBtn == &aColumnsBtn )
- {
- aColumnsEdit.Enable();
- aColumnsEdit.GrabFocus();
- if ( 0 == aColumnsEdit.GetValue() % 2 )
- aBookModeChk.Enable();
- }
- else
- {
- DBG_ERROR( "Wrong Button" );
- return 0;
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, MetricField *, pEdt )
-{
- if ( pEdt == &aColumnsEdit && !aColumnsBtn.IsChecked() )
- return 0;
-
- if ( 0 == aColumnsEdit.GetValue() % 2 )
- aBookModeChk.Enable();
- else
- {
- aBookModeChk.Check( sal_False );
- aBookModeChk.Disable();
- }
-
- bModified |= TRUE;
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk )
-{
- if ( pChk == &aBookModeChk && !aColumnsBtn.IsChecked() )
- return 0;
-
- bModified |= TRUE;
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
-{
- if ( bModified || &aOKBtn != pBtn )
- {
- SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, 0, rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
- SvxViewLayoutItem aViewLayoutItem( 0, false, rSet.GetPool()->GetWhich( SID_ATTR_VIEWLAYOUT ) );
-
- if ( &aOKBtn == pBtn )
- {
- USHORT nFactor = GetFactor();
-
- if ( SPECIAL_FACTOR == nFactor )
- {
- if ( aOptimalBtn.IsChecked() )
- aZoomItem.SetType( SVX_ZOOM_OPTIMAL );
- else if ( aPageWidthBtn.IsChecked() )
- aZoomItem.SetType( SVX_ZOOM_PAGEWIDTH );
- else if ( aWholePageBtn.IsChecked() )
- aZoomItem.SetType( SVX_ZOOM_WHOLEPAGE );
- }
- else
- aZoomItem.SetValue( nFactor );
-
- if ( aAutomaticBtn.IsChecked() )
- {
- aViewLayoutItem.SetValue( 0 );
- aViewLayoutItem.SetBookMode( false );
- }
- if ( aSingleBtn.IsChecked() )
- {
- aViewLayoutItem.SetValue( 1 );
- aViewLayoutItem.SetBookMode( false );
- }
- else if ( aColumnsBtn.IsChecked() )
- {
- aViewLayoutItem.SetValue( static_cast<USHORT>(aColumnsEdit.GetValue()) );
- aViewLayoutItem.SetBookMode( aBookModeChk.IsChecked() );
- }
- }
- else
- {
- DBG_ERROR( "Wrong Button" );
- return 0;
- }
- pOutSet = new SfxItemSet( rSet );
- pOutSet->Put( aZoomItem );
-
- // don't set attribute in case the whole viewlayout stuff is disabled:
- if ( aViewLayoutFl.IsEnabled() )
- pOutSet->Put( aViewLayoutItem );
-
- // Wert aus dem UserEdit "uber den Dialog hinaus merken
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- if ( pSh )
- pSh->PutItem( SfxUInt16Item( SID_ATTR_ZOOM_USER,
- (UINT16)aUserEdit.GetValue() ) );
- EndDialog( RET_OK );
- }
- else
- EndDialog( RET_CANCEL );
- return 0;
-}
-
-
diff --git a/svx/source/cui/zoom.hrc b/svx/source/cui/zoom.hrc
deleted file mode 100644
index 6e3cf49d7c..0000000000
--- a/svx/source/cui/zoom.hrc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: zoom.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_ZOOM_HRC
-#define _SVX_ZOOM_HRC
-
-// defines ------------------------------------------------------------------
-
-#define FL_ZOOM 14
-#define BTN_OPTIMAL 15
-#define BTN_WHOLE_PAGE 16
-#define BTN_PAGE_WIDTH 17
-#define BTN_100 18
-#define BTN_USER 19
-#define ED_USER 20
-
-#define FL_VIEWLAYOUT 21
-#define BTN_AUTOMATIC 22
-#define BTN_SINGLE 23
-#define BTN_COLUMNS 24
-#define ED_COLUMNS 25
-#define CHK_BOOK 26
-
-#define FL_BOTTOM 27
-#define BTN_ZOOM_OK 28
-#define BTN_ZOOM_CANCEL 29
-#define BTN_ZOOM_HELP 30
-
-#endif
-
diff --git a/svx/source/cui/zoom.hxx b/svx/source/cui/zoom.hxx
deleted file mode 100644
index 6565214e54..0000000000
--- a/svx/source/cui/zoom.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: zoom.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_ZOOM_HXX
-#define _SVX_ZOOM_HXX
-
-// include ---------------------------------------------------------------
-
-#include <layout/layout.hxx>
-#include <sfx2/basedlgs.hxx>
-#ifndef _SV_BUTTON_HXX //autogen wg. Radio-/OK-/Cancel-/HelpButton
-#include <vcl/button.hxx>
-#endif
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-
-// define ----------------------------------------------------------------
-/* CHINA001
-#define ZOOMBTN_OPTIMAL ((USHORT)0x0001)
-#define ZOOMBTN_PAGEWIDTH ((USHORT)0x0002)
-#define ZOOMBTN_WHOLEPAGE ((USHORT)0x0004)
-*/
-#ifndef _SVX_ZOOM_HXX
-#include "zoom_def.hxx"
-#endif
-// class SvxZoomDialog ---------------------------------------------------
-/*
- {k:\svx\prototyp\dialog\zoom.bmp}
-
- [Beschreibung]
- Mit diesem Dialog wird ein Zoom-Faktor eingestellt.
-
- [Items]
- SvxZoomItem <SID_ATTR_ZOOM>
-*/
-
-#include <layout/layout-pre.hxx>
-
-class SvxZoomDialog : public SfxModalDialog
-{
-private:
- FixedLine aZoomFl;
- RadioButton aOptimalBtn;
- RadioButton aWholePageBtn;
- RadioButton aPageWidthBtn;
- RadioButton a100Btn;
- RadioButton aUserBtn;
- MetricField aUserEdit;
-
- FixedLine aViewLayoutFl;
- RadioButton aAutomaticBtn;
- RadioButton aSingleBtn;
- RadioButton aColumnsBtn;
- MetricField aColumnsEdit;
- CheckBox aBookModeChk;
-
- FixedLine aBottomFl;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
- const SfxItemSet& rSet;
- SfxItemSet* pOutSet;
- BOOL bModified;
-
-#ifdef _SVX_ZOOM_CXX
- DECL_LINK( UserHdl, RadioButton* );
- DECL_LINK( SpinHdl, MetricField* );
- DECL_LINK( ViewLayoutUserHdl, RadioButton* );
- DECL_LINK( ViewLayoutSpinHdl, MetricField* );
- DECL_LINK( ViewLayoutCheckHdl, CheckBox* );
- DECL_LINK( OKHdl, Button* );
-#endif
-
-public:
- SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet );
- ~SvxZoomDialog();
-
- static USHORT* GetRanges();
- const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
-
- USHORT GetFactor() const;
- void SetFactor( USHORT nNewFactor, USHORT nBtnId = 0 );
-
- void SetButtonText( USHORT nBtnId, const String& aNewTxt );
- void HideButton( USHORT nBtnId );
- void SetLimits( USHORT nMin, USHORT nMax );
- void SetSpinSize( USHORT nNewSpin );
-};
-
-#include <layout/layout-post.hxx>
-
-#endif
-
diff --git a/svx/source/cui/zoom.src b/svx/source/cui/zoom.src
deleted file mode 100644
index 197d1e2f29..0000000000
--- a/svx/source/cui/zoom.src
+++ /dev/null
@@ -1,159 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: zoom.src,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <svx/svxids.hrc>
-#include <svx/dialogs.hrc>
-#include "zoom.hrc"
- // RID_SVXDLG_ZOOM -------------------------------------------------------
-ModalDialog RID_SVXDLG_ZOOM
-{
- HelpId = SID_ATTR_ZOOM ;
- OutputSize = TRUE ;
- SvLook = TRUE ;
- Size = MAP_APPFONT ( 242 , 112 ) ;
- Moveable = TRUE ;
- Text [ en-US ] = "Zoom & View Layout";
- FixedLine FL_ZOOM
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Zoom factor";
- };
- RadioButton BTN_OPTIMAL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "~Optimal" ;
- };
- RadioButton BTN_WHOLE_PAGE
- {
- Pos = MAP_APPFONT ( 12 , 27 ) ;
- Size = MAP_APPFONT ( 105 , 10 ) ;
- Text [ en-US ] = "~Fit width and height" ;
- };
- RadioButton BTN_PAGE_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 40 ) ;
- Size = MAP_APPFONT ( 105, 10 ) ;
- Text [ en-US ] = "Fit ~width" ;
- };
- RadioButton BTN_100
- {
- Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 105, 10 ) ;
- Text = "~100 %" ;
- };
- RadioButton BTN_USER
- {
- Pos = MAP_APPFONT ( 12 , 67 ) ;
- Size = MAP_APPFONT ( 72 , 10 ) ;
- Text [ en-US ] = "~Variable" ;
- };
- MetricField ED_USER
- {
- Pos = MAP_APPFONT ( 86 , 66 ) ;
- Size = MAP_APPFONT ( 32 , 12 ) ;
- Border = TRUE ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- SpinSize = 1 ;
- };
- FixedLine FL_VIEWLAYOUT
- {
- Pos = MAP_APPFONT ( 124 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "View layout";
- };
- RadioButton BTN_AUTOMATIC
- {
- Pos = MAP_APPFONT ( 130 , 14 ) ;
- Size = MAP_APPFONT ( 106 , 10 ) ;
- Text [ en-US ] = "~Automatic" ;
- };
- RadioButton BTN_SINGLE
- {
- Pos = MAP_APPFONT ( 130, 27 ) ;
- Size = MAP_APPFONT ( 106, 10 ) ;
- Text [ en-US ] = "~Single page" ;
- };
- RadioButton BTN_COLUMNS
- {
- Pos = MAP_APPFONT ( 130, 41 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "~Columns" ;
- };
- MetricField ED_COLUMNS
- {
- Pos = MAP_APPFONT ( 209 , 40 ) ;
- Size = MAP_APPFONT ( 24 , 12 ) ;
- Border = TRUE ;
- Group = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- SpinSize = 1 ;
- Minimum = 1;
- Maximum = 999;
- };
- CheckBox CHK_BOOK
- {
- Pos = MAP_APPFONT ( 136 , 55 ) ;
- Size = MAP_APPFONT ( 85 , 10 ) ;
- Text [ en-US ] = "~Book mode" ;
- };
- FixedLine FL_BOTTOM
- {
- Pos = MAP_APPFONT ( 6 , 81 ) ;
- Size = MAP_APPFONT ( 230 , 8 ) ;
- };
- OKButton BTN_ZOOM_OK
- {
- Pos = MAP_APPFONT ( 77 , 92 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_ZOOM_CANCEL
- {
- Pos = MAP_APPFONT ( 130 , 92 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_ZOOM_HELP
- {
- Pos = MAP_APPFONT ( 186 , 92 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
-// ********************************************************************** EOF
-
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 04cdd9e041..eba03cd9ea 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -33,7 +33,6 @@
#include "EnhancedCustomShape2d.hxx"
#include "EnhancedCustomShapeGeometry.hxx"
#include "EnhancedCustomShapeTypeNames.hxx"
-#include "EnhancedCustomShapeFunctionParser.hxx"
#include <svx/svdoashp.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdocirc.hxx>
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx
index e8f40b49dd..ffacbfa59c 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.hxx
@@ -36,13 +36,13 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/awt/Point.hpp>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameter.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
-#include <EnhancedCustomShapeFunctionParser.hxx>
+#include <svx/EnhancedCustomShapeFunctionParser.hxx>
#include <boost/shared_ptr.hpp>
#include <vector>
@@ -52,6 +52,7 @@
#define DFF_CUSTOMSHAPE_EXCH 4
class SdrModel;
+class SdrObject;
class SfxItemSet;
struct SvxMSDffVertPair;
struct SvxMSDffCalculationData;
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 4fec059147..fcce0b5a0e 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -37,8 +37,8 @@
#include <svditer.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdoashp.hxx>
-#include <svtools/poolitem.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/itemset.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xsflclit.hxx>
#include <svx/xit.hxx>
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 2fad91e12e..1ce09428f0 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -48,7 +48,7 @@
#include <svx/outlobj.hxx>
#include <svx/outliner.hxx>
#include <svx/svdoutl.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx>
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
index d9db4812e8..9c408f7746 100644..100755
--- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,15 +30,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "EnhancedCustomShapeFunctionParser.hxx"
#include "EnhancedCustomShape2d.hxx"
#include <rtl/ustring.hxx>
#include <tools/fract.hxx>
-// Makes parser a static resource,
+// Makes parser a static resource,
// we're synchronized externally.
// But watch out, the parser might have
// state not visible to this code!
+
#define BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
#if defined(VERBOSE) && defined(DBG_UTIL)
#include <typeinfo>
@@ -160,7 +160,7 @@ public:
AdjustmentExpression( const EnhancedCustomShape2d& rCustoShape, sal_Int32 nIndex )
: mnIndex ( nIndex )
, mrCustoShape( rCustoShape )
-
+
{
}
virtual double operator()() const
@@ -336,7 +336,7 @@ public:
virtual double operator()() const
{
return getValue( meFunct, mpArg );
- }
+ }
virtual bool isConstant() const
{
return mpArg->isConstant();
@@ -507,7 +507,7 @@ public:
virtual double operator()() const
{
return getValue( meFunct, mpFirstArg, mpSecondArg );
- }
+ }
virtual bool isConstant() const
{
return mpFirstArg->isConstant() && mpSecondArg->isConstant();
@@ -559,7 +559,7 @@ public:
FillEquationParameter( mpSecondArg->fillNode( rEquations, NULL, nFlags &~EXPRESSION_FLAG_SUMANGLE_MODE ), 1, aSumangle2 );
aRet.Type = EnhancedCustomShapeParameterType::EQUATION;
aRet.Value <<= (sal_Int32)rEquations.size();
- rEquations.push_back( aSumangle2 );
+ rEquations.push_back( aSumangle2 );
EnhancedCustomShapeEquation aEquation;
aEquation.nOperation |= 0;
@@ -592,7 +592,7 @@ public:
}
}
break;
- case BINARY_FUNC_MINUS:
+ case BINARY_FUNC_MINUS:
{
EnhancedCustomShapeEquation aEquation;
aEquation.nOperation |= 0;
@@ -655,7 +655,7 @@ public:
rEquations.push_back( aEquation );
}
break;
- case BINARY_FUNC_MIN :
+ case BINARY_FUNC_MIN :
{
EnhancedCustomShapeEquation aEquation;
aEquation.nOperation |= 4;
@@ -713,9 +713,9 @@ public:
}
virtual bool isConstant() const
{
- return
- mpFirstArg->isConstant() &&
- mpSecondArg->isConstant() &&
+ return
+ mpFirstArg->isConstant() &&
+ mpSecondArg->isConstant() &&
mpThirdArg->isConstant();
}
virtual double operator()() const
@@ -849,7 +849,7 @@ class UnaryFunctionFunctor
ParserContextSharedPtr mpContext;
public :
-
+
UnaryFunctionFunctor( const ExpressionFunct eFunct, const ParserContextSharedPtr& rContext ) :
meFunct( eFunct ),
mpContext( rContext )
@@ -878,7 +878,7 @@ public :
@tpl Generator
Generator functor, to generate an ExpressionNode of
appropriate type
-
+
*/
class BinaryFunctionFunctor
{
@@ -953,13 +953,13 @@ public :
// Workaround for MSVC compiler anomaly (stack trashing)
//
-// The default ureal_parser_policies implementation of parse_exp
-// triggers a really weird error in MSVC7 (Version 13.00.9466), in
-// that the real_parser_impl::parse_main() call of parse_exp()
+// The default ureal_parser_policies implementation of parse_exp
+// triggers a really weird error in MSVC7 (Version 13.00.9466), in
+// that the real_parser_impl::parse_main() call of parse_exp()
// overwrites the frame pointer _on the stack_ (EBP of the calling
-// function gets overwritten while lying on the stack).
+// function gets overwritten while lying on the stack).
//
-// For the time being, our parser thus can only read the 1.0E10
+// For the time being, our parser thus can only read the 1.0E10
// notation, not the 1.0e10 one.
//
// TODO(F1): Also handle the 1.0e10 case here.
@@ -968,9 +968,9 @@ template< typename T > struct custom_real_parser_policies : public ::boost::spir
template< typename ScannerT >
static typename ::boost::spirit::parser_result< ::boost::spirit::chlit<>, ScannerT >::type
parse_exp(ScannerT& scan)
- {
+ {
// as_lower_d somehow breaks MSVC7
- return ::boost::spirit::ch_p('E').parse(scan);
+ return ::boost::spirit::ch_p('E').parse(scan);
}
};
@@ -978,29 +978,30 @@ template< typename T > struct custom_real_parser_policies : public ::boost::spir
less literally written down below, only slightly
obfuscated by the parser actions):
- identifier = '$'|'pi'|'e'|'X'|'Y'|'Width'|'Height'
-
+ identifier = '$'|'pi'|'e'|'X'|'Y'|'Width'|'Height'
+
function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log'
- basic_expression =
- number |
- identifier |
- function '(' additive_expression ')' |
- '(' additive_expression ')'
-
- unary_expression =
+ basic_expression =
+ number |
+ identifier |
+ function '(' additive_expression ')' |
+ '(' additive_expression ')'
+
+ unary_expression =
'-' basic_expression |
basic_expression
-
- multiplicative_expression =
- unary_expression ( ( '*' unary_expression )* |
+
+ multiplicative_expression =
+ unary_expression ( ( '*' unary_expression )* |
( '/' unary_expression )* )
-
- additive_expression =
- multiplicative_expression ( ( '+' multiplicative_expression )* |
- ( '-' multiplicative_expression )* )
+
+ additive_expression =
+ multiplicative_expression ( ( '+' multiplicative_expression )* |
+ ( '-' multiplicative_expression )* )
*/
+
class ExpressionGrammar : public ::boost::spirit::grammar< ExpressionGrammar >
{
public:
@@ -1042,7 +1043,7 @@ public:
| str_p( "logheight" )[ EnumFunctor(ENUM_FUNC_LOGHEIGHT, self.getContext() ) ]
;
- unaryFunction =
+ unaryFunction =
(str_p( "abs" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( UNARY_FUNC_ABS, self.getContext()) ]
| (str_p( "sqrt" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( UNARY_FUNC_SQRT, self.getContext()) ]
| (str_p( "sin" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( UNARY_FUNC_SIN, self.getContext()) ]
@@ -1051,17 +1052,17 @@ public:
| (str_p( "atan" ) >> '(' >> additiveExpression >> ')' )[ UnaryFunctionFunctor( UNARY_FUNC_ATAN, self.getContext()) ]
;
- binaryFunction =
+ binaryFunction =
(str_p( "min" ) >> '(' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ BinaryFunctionFunctor( BINARY_FUNC_MIN, self.getContext()) ]
| (str_p( "max" ) >> '(' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ BinaryFunctionFunctor( BINARY_FUNC_MAX, self.getContext()) ]
| (str_p( "atan2") >> '(' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ BinaryFunctionFunctor( BINARY_FUNC_ATAN2,self.getContext()) ]
;
- ternaryFunction =
+ ternaryFunction =
(str_p( "if" ) >> '(' >> additiveExpression >> ',' >> additiveExpression >> ',' >> additiveExpression >> ')' )[ IfFunctor( self.getContext() ) ]
;
- funcRef_decl =
+ funcRef_decl =
lexeme_d[ +( range_p('a','z') | range_p('A','Z') | range_p('0','9') ) ];
functionReference =
@@ -1073,7 +1074,7 @@ public:
modifierReference =
(str_p( "$" ) >> modRef_decl )[ EnumFunctor( ENUM_FUNC_ADJUSTMENT, self.getContext() ) ];
- basicExpression =
+ basicExpression =
real_parser<double, custom_real_parser_policies<double> >()[ DoubleConstantFunctor(self.getContext()) ]
| identifier
| functionReference
@@ -1084,19 +1085,19 @@ public:
| '(' >> additiveExpression >> ')'
;
- unaryExpression =
+ unaryExpression =
('-' >> basicExpression)[ UnaryFunctionFunctor( UNARY_FUNC_NEG, self.getContext()) ]
| basicExpression
;
- multiplicativeExpression =
+ multiplicativeExpression =
unaryExpression
>> *( ('*' >> unaryExpression)[ BinaryFunctionFunctor( BINARY_FUNC_MUL, self.getContext()) ]
| ('/' >> unaryExpression)[ BinaryFunctionFunctor( BINARY_FUNC_DIV, self.getContext()) ]
)
;
- additiveExpression =
+ additiveExpression =
multiplicativeExpression
>> *( ('+' >> multiplicativeExpression)[ BinaryFunctionFunctor( BINARY_FUNC_PLUS, self.getContext()) ]
| ('-' >> multiplicativeExpression)[ BinaryFunctionFunctor( BINARY_FUNC_MINUS, self.getContext()) ]
@@ -1117,9 +1118,9 @@ public:
{
return additiveExpression;
}
-
+
private:
- // the constituents of the Spirit arithmetic expression grammar.
+ // the constituents of the Spirit arithmetic expression grammar.
// For the sake of readability, without 'ma' prefix.
::boost::spirit::rule< ScannerT > additiveExpression;
::boost::spirit::rule< ScannerT > multiplicativeExpression;
@@ -1133,7 +1134,7 @@ public:
::boost::spirit::rule< ScannerT > modRef_decl;
::boost::spirit::rule< ScannerT > modifierReference;
::boost::spirit::rule< ScannerT > identifier;
- };
+ };
const ParserContextSharedPtr& getContext() const
{
@@ -1143,13 +1144,13 @@ public:
private:
ParserContextSharedPtr mpParserContext; // might get modified during parsing
};
-
+
#ifdef BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
const ParserContextSharedPtr& getParserContext()
{
static ParserContextSharedPtr lcl_parserContext( new ParserContext() );
- // clear node stack (since we reuse the static object, that's
+ // clear node stack (since we reuse the static object, that's
// the whole point here)
while( !lcl_parserContext->maOperandStack.empty() )
lcl_parserContext->maOperandStack.pop();
@@ -1162,12 +1163,14 @@ const ParserContextSharedPtr& getParserContext()
namespace EnhancedCustomShape {
+
+
ExpressionNodeSharedPtr FunctionParser::parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape )
{
- // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_*
- // gives better conversion robustness here (we might want to map space
+ // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_*
+ // gives better conversion robustness here (we might want to map space
// etc. to ASCII space here)
- const ::rtl::OString& rAsciiFunction(
+ const ::rtl::OString& rAsciiFunction(
rtl::OUStringToOString( rFunction, RTL_TEXTENCODING_ASCII_US ) );
StringIteratorT aStart( rAsciiFunction.getStr() );
@@ -1185,23 +1188,28 @@ ExpressionNodeSharedPtr FunctionParser::parseFunction( const ::rtl::OUString& rF
pContext->mpCustoShape = &rCustoShape;
ExpressionGrammar aExpressionGrammer( pContext );
- const ::boost::spirit::parse_info<StringIteratorT> aParseInfo(
+ const ::boost::spirit::parse_info<StringIteratorT> aParseInfo(
::boost::spirit::parse( aStart,
aEnd,
aExpressionGrammer >> ::boost::spirit::end_p,
::boost::spirit::space_p ) );
OSL_DEBUG_ONLY(::std::cout.flush()); // needed to keep stdout and cout in sync
+
+
// input fully congested by the parser?
if( !aParseInfo.full )
throw ParseError( "EnhancedCustomShapeFunctionParser::parseFunction(): string not fully parseable" );
- // parser's state stack now must contain exactly _one_ ExpressionNode,
+ // parser's state stack now must contain exactly _one_ ExpressionNode,
// which represents our formula.
if( pContext->maOperandStack.size() != 1 )
throw ParseError( "EnhancedCustomShapeFunctionParser::parseFunction(): incomplete or empty expression" );
+
return pContext->maOperandStack.top();
}
+
}
+
diff --git a/svx/source/customshapes/tbxcustomshapes.cxx b/svx/source/customshapes/tbxcustomshapes.cxx
index a663bc6fcf..c1561822cf 100644
--- a/svx/source/customshapes/tbxcustomshapes.cxx
+++ b/svx/source/customshapes/tbxcustomshapes.cxx
@@ -37,7 +37,7 @@
#include <svx/svxids.hrc>
#endif
#include <tools/shl.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/viewfrm.hxx>
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 581c12712c..20e59b4d3d 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -34,7 +34,7 @@
#include <tools/shl.hxx>
#include <vcl/metaact.hxx>
#include <svtools/valueset.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/dispatch.hxx>
#include <svtools/colrdlg.hxx>
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 92c03de1d6..157d7e8053 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -35,7 +35,7 @@
#include <tools/shl.hxx>
#include <vcl/salbtype.hxx> // FRound
#include <vcl/msgbox.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <svtools/miscopt.hxx>
@@ -421,7 +421,7 @@ SvxSuperContourDlg::SvxSuperContourDlg( SfxBindings *_pBindings, SfxChildWindow
Point aPos( aTbx1.GetPosPixel() );
SvtMiscOptions aMiscOptions;
- aMiscOptions.AddListener( LINK( this, SvxSuperContourDlg, MiscHdl ) );
+ aMiscOptions.AddListenerLink( LINK( this, SvxSuperContourDlg, MiscHdl ) );
aTbx1.SetOutStyle( aMiscOptions.GetToolboxStyle() );
aTbx1.SetSizePixel( aTbxSize );
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 7258c2ca4a..f0827a25e7 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -53,7 +53,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <comphelper/types.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include "rtl/ustrbuf.hxx"
diff --git a/svx/source/dialog/databaseregistrationui.cxx b/svx/source/dialog/databaseregistrationui.cxx
index 84f5debf8c..9406c09672 100644
--- a/svx/source/dialog/databaseregistrationui.cxx
+++ b/svx/source/dialog/databaseregistrationui.cxx
@@ -47,7 +47,7 @@
// === includes (global) =================================================
#include <sfx2/app.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <vcl/msgbox.hxx>
// === /includes (global) ================================================
diff --git a/svx/source/dialog/dialmgr.cxx b/svx/source/dialog/dialmgr.cxx
index becd5ad806..0a05a75b3d 100644
--- a/svx/source/dialog/dialmgr.cxx
+++ b/svx/source/dialog/dialmgr.cxx
@@ -39,7 +39,7 @@
#include <svx/dialmgr.hxx>
#include <tools/rc.hxx>
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#include <vcl/svapp.hxx>
static ResMgr* pResMgr=0;
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index fe75592b6e..79d0490720 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -35,7 +35,7 @@
#include <svx/dialogs.hrc>
#include <svx/view3d.hxx>
#include <svx/fmmodel.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svx/fmpage.hxx>
#include <svx/polysc3d.hxx>
#include <svx/sphere3d.hxx>
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index a0d401eb4f..21941e26fa 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -60,6 +60,7 @@
#include <svx/svdopath.hxx>
#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include "linectrl.hrc"
#define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT)
#define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)
@@ -1774,6 +1775,30 @@ void LineLB::Fill( const XDashList* pList )
SetUpdateMode( TRUE );
}
+void LineLB::FillStyles()
+{
+ ResMgr& rMgr = DIALOG_MGR();
+
+ // Linienstile
+ Clear();
+ InsertEntry( String( ResId( RID_SVXSTR_INVISIBLE, rMgr ) ) );
+
+ const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
+ Bitmap aBitmap ( SVX_RES ( RID_SVXCTRL_LINECTRL ) );
+ Color aSourceColors[2];
+ Color aDestColors[2];
+
+ aSourceColors[0] = Color( COL_WHITE );
+ aSourceColors[1] = Color( COL_BLACK );
+
+ aDestColors[0] = rStyles.GetFieldColor();
+ aDestColors[1] = rStyles.GetFieldTextColor();
+
+ aBitmap.Replace ( aSourceColors, aDestColors, 2 );
+ Image aSolidLine ( aBitmap );
+ InsertEntry( String( ResId( RID_SVXSTR_SOLID, rMgr ) ), aSolidLine );
+}
+
/************************************************************************/
void LineLB::Append( XDashEntry* pEntry, Bitmap* pBmp )
diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx
index 57e9296dbe..a1fd1e8bbd 100644
--- a/svx/source/dialog/dlgutil.cxx
+++ b/svx/source/dialog/dlgutil.cxx
@@ -39,7 +39,7 @@
#include <unolingu.hxx>
#include <svtools/langtab.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index ea7ff7479a..5533100319 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -65,7 +65,7 @@
#include <osl/file.hxx>
#include <osl/security.hxx>
#include <rtl/bootstrap.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <unotools/localfilehelper.hxx>
#define RET_BACK 100
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index d76dd9a4a2..8e016995a0 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -50,7 +50,7 @@
#define _SVSTDARR_USHORTS
#define _SVSTDARR_ULONGS
#define _SVSTDARR_XUB_STRLEN
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
#include <svtools/colorcfg.hxx>
diff --git a/svx/source/dialog/frmdirlbox.src b/svx/source/dialog/frmdirlbox.src
deleted file mode 100644
index f9d5d4bedf..0000000000
--- a/svx/source/dialog/frmdirlbox.src
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: frmdirlbox.src,v $
- * $Revision: 1.14 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svx/dialogs.hrc>
-
-// frame direction ------------------------------------------------------------
-
-String RID_SVXSTR_FRAMEDIR_LTR
-{
- Text [ en-US ] = "Left-to-right";
-};
-
-String RID_SVXSTR_FRAMEDIR_RTL
-{
- Text [ en-US ] = "Right-to-left";
-};
-
-String RID_SVXSTR_FRAMEDIR_SUPER
-{
- Text [ en-US ] = "Use superordinate object settings";
-};
-
-// page direction -------------------------------------------------------------
-
-String RID_SVXSTR_PAGEDIR_LTR_HORI
-{
- Text [ en-US ] = "Left-to-right (horizontal)";
-};
-
-String RID_SVXSTR_PAGEDIR_RTL_HORI
-{
- Text [ en-US ] = "Right-to-left (horizontal)";
-};
-
-String RID_SVXSTR_PAGEDIR_RTL_VERT
-{
- Text [ en-US ] = "Right-to-left (vertical)";
-};
-
-String RID_SVXSTR_PAGEDIR_LTR_VERT
-{
- Text [ en-US ] = "Left-to-right (vertical)";
-};
-
-// ----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index f83c7608ac..f1174bde5c 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -30,10 +30,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vcl/dialog.hxx>
#include <vcl/wrkwin.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <rtl/math.hxx>
#include <unotools/localedatawrapper.hxx>
#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 583de9a93e..f2b0a18439 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -194,7 +194,7 @@ ULONG SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObject& r
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterMosaic( pWindow, rGraphic, 4, 4, FALSE, RID_SVX_GRFFILTER_DLG_MOSAIC );
+ AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterMosaic( pWindow, rGraphic, 4, 4, FALSE, RID_SVX_GRFFILTER_DLG_MOSAIC);
DBG_ASSERT(aDlg, "Dialogdiet fail!");//CHINA001
if( aDlg->Execute() == RET_OK ) //CHINA001 if( aDlg.Execute() == RET_OK )
aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); //CHINA001 aGraphic = aDlg.GetFilteredGraphic( rGraphic, 1.0, 1.0 );
diff --git a/svx/source/dialog/hangulhanja.cxx b/svx/source/dialog/hangulhanja.cxx
index cb7ef22f73..9f56848d8e 100644
--- a/svx/source/dialog/hangulhanja.cxx
+++ b/svx/source/dialog/hangulhanja.cxx
@@ -34,8 +34,8 @@
#include <vcl/msgbox.hxx> //add CHINA001
#include <vcl/button.hxx>
// header for class SvtLinguConfig
-#include <svtools/lingucfg.hxx>
-#include <svtools/linguprops.hxx>
+#include <unotools/lingucfg.hxx>
+#include <unotools/linguprops.hxx>
#include <set>
#include <map>
@@ -347,7 +347,7 @@ namespace svx
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- m_pConversionDialog = pFact->CreateHangulHanjaConversionDialog(m_pUIParent, m_ePrimaryConversionDirection, RID_SVX_MDLG_HANGULHANJA);
+ m_pConversionDialog = pFact->CreateHangulHanjaConversionDialog(m_pUIParent, m_ePrimaryConversionDirection );
DBG_ASSERT(m_pConversionDialog, "Dialogdiet fail!");//CHINA001
m_pConversionDialog->EnableRubySupport( m_pAntiImpl->HasRubySupport() );
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 9ba5238dea..85db5fca3e 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -33,7 +33,7 @@
// include ---------------------------------------------------------------
#include <tools/shl.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/itemiter.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/module.hxx>
@@ -560,7 +560,7 @@ IMPL_LINK( SvxHFPage, BackgroundHdl, Button *, EMPTYARG )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- SfxAbstractTabDialog* pDlg = pFact->CreateSvxBorderBackgroundDlg( this, *pBBSet, RID_SVXDLG_BBDLG,bEnableBackgroundSelector );
+ SfxAbstractTabDialog* pDlg = pFact->CreateSvxBorderBackgroundDlg( this, *pBBSet, bEnableBackgroundSelector );
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() )
{
diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx
index efbe2e850b..edb6d73b95 100644
--- a/svx/source/dialog/hyperdlg.cxx
+++ b/svx/source/dialog/hyperdlg.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,13 +33,11 @@
// include ---------------------------------------------------------------
#include <vcl/settings.hxx>
-#include <svtools/viewoptions.hxx>
+#include <unotools/viewoptions.hxx>
#include "hyperdlg.hxx"
#include <svx/svxdlg.hxx> //CHINA001
#include <sfx2/app.hxx>
#include <sfx2/sfxsids.hrc>
-#include "hyperdlg.hrc"
-
//########################################################################
//# #
diff --git a/svx/source/dialog/hyperdlg.src b/svx/source/dialog/hyperdlg.src
deleted file mode 100644
index 780488347c..0000000000
--- a/svx/source/dialog/hyperdlg.src
+++ /dev/null
@@ -1,971 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hyperdlg.src,v $
- * $Revision: 1.78 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <svtools/controldims.hrc>
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "hyperdlg.hrc"
-
-#define MASKCOLOR MaskColor = Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; };
-#define HYPERDLG_IMGBUTTON_HEIGHT RSC_CD_PUSHBUTTON_HEIGHT+2
-
-/*************************************************************************
-|
-| Tabpage : Internet
-|
-*************************************************************************/
-
-TabPage RID_SVXPAGE_HYPERLINK_INTERNET
-{
- Hide = TRUE ;
- HelpID = HID_HYPERLINK_INTERNET;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 162 ) ;
- Text [ en-US ] = "Hyperlink" ;
-
- FixedLine GRP_LINKTYPE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Hyperlink type" ;
- };
- RadioButton RB_LINKTYP_INTERNET
- {
- Pos = MAP_APPFONT( COL_2, 13 );
- Size = MAP_APPFONT( 57, 10 );
- Text [ en-US ] = "~Web";
- };
- RadioButton RB_LINKTYP_FTP
- {
- Pos = MAP_APPFONT( 114 + COL_DIFF, 13 );
- Size = MAP_APPFONT( 56 - COL_DIFF, 10 );
- Text [ en-US ] = "~FTP";
- };
- RadioButton RB_LINKTYP_TELNET
- {
- Pos = MAP_APPFONT( 173, 13 );
- Size = MAP_APPFONT( 56, 10 );
- Text [ en-US ] = "~Telnet";
- };
- FixedText FT_TARGET_HTML
- {
- Pos = MAP_APPFONT ( 12 , 26 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF, 8 ) ;
- Text [ en-US ] = "Tar~get" ;
- };
- FixedText FT_LOGIN
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "~Login name" ;
- };
- Edit ED_LOGIN
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 42 ) ;
- Size = MAP_APPFONT ( 80 - COL_DIFF , 12 ) ;
- };
- FixedText FT_PASSWD
- {
- Pos = MAP_APPFONT ( 12 , 60 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "~Password" ;
- };
- Edit ED_PASSWD
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 59 ) ;
- Size = MAP_APPFONT ( 80 - COL_DIFF , 12 ) ;
- PassWord = TRUE ;
- };
- CheckBox CBX_ANONYMOUS
- {
- Pos = MAP_APPFONT ( COL_2 , 75 ) ;
- Size = MAP_APPFONT ( 89 - COL_DIFF , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Anonymous ~user" ;
- };
- ImageButton BTN_BROWSE
- {
- Pos = MAP_APPFONT ( 235, 24 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- Text [ en-US ] = "WWW Browser";
-
- QuickHelpText [ en-US ] = "WWW Browser" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "browse.bmp" ; };
- MASKCOLOR
- };
- };
- Image IMG_BROWSE_HC
- {
- ImageBitmap = Bitmap { File = "browse_hc.bmp" ; };
- MASKCOLOR
- };
- ImageButton BTN_TARGET
- {
- Pos = MAP_APPFONT ( 235, 40+2 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- Text [ en-US ] = "Target in Document";
-
- QuickHelpText [ en-US ] = "Target in Document" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "target.bmp" ; };
- MASKCOLOR
- };
- };
- Image IMG_TARGET_HC
- {
- ImageBitmap = Bitmap { File = "target_hc.bmp" ; };
- MASKCOLOR
- };
- FixedLine GRP_MORE
- {
- Pos = MAP_APPFONT ( 6 , 92 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Further settings" ;
- };
- FixedText FT_FRAME
- {
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "F~rame" ;
- };
- ComboBox CB_FRAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 104 ) ;
- Size = MAP_APPFONT ( 66 - COL_DIFF , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- FixedText FT_FORM
- {
- Pos = MAP_APPFONT ( 126 , 105 ) ;
- Size = MAP_APPFONT ( 33 , 8 ) ;
- Text [ en-US ] = "F~orm" ;
- };
- ListBox LB_FORM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 160 , 104 ) ;
- Size = MAP_APPFONT ( 70 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- DDExtraWidth = TRUE ;
- StringList [ en-US ] =
- {
- < "Text" ; Default ; > ;
- < "Button" ; Default ; > ;
- };
- };
- FixedText FT_INDICATION
- {
- Pos = MAP_APPFONT ( 12 , 123 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "Te~xt" ;
- };
- Edit ED_INDICATION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 122 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 12 , 140 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "N~ame" ;
- };
- Edit ED_TEXT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 139 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- ImageButton BTN_SCRIPT
- {
- Pos = MAP_APPFONT ( 235, 103-1 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
-
- QuickHelpText [ en-US ] = "Events" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "script.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Events";
- };
- Image IMG_SCRIPT_HC
- {
- ImageBitmap = Bitmap { File = "script_hc.bmp" ; };
- MASKCOLOR
- };
-};
-
-/*************************************************************************
-|
-| Tabpage : Mail & News
-|
-*************************************************************************/
-
-TabPage RID_SVXPAGE_HYPERLINK_MAIL
-{
- Hide = TRUE ;
- HelpID = HID_HYPERLINK_MAIL;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 162 ) ;
- Text [ en-US ] = "Hyperlink" ;
-
- FixedLine GRP_MAILNEWS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Mail & news" ;
- };
- RadioButton RB_LINKTYP_MAIL
- {
- Pos = MAP_APPFONT( COL_2, 13 );
- Size = MAP_APPFONT( 56 - COL_DIFF, 10 );
- Text [ en-US ] = "~E-mail";
- };
- RadioButton RB_LINKTYP_NEWS
- {
- Pos = MAP_APPFONT( 113, 13 );
- Size = MAP_APPFONT( 56, 10 );
- Text [ en-US ] = "~News";
- };
- FixedText FT_RECEIVER
- {
- Pos = MAP_APPFONT ( 12 , 26 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "Re~ceiver" ;
- };
- FixedText FT_SUBJECT
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "~Subject" ;
- };
- Edit ED_SUBJECT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 42 ) ;
- Size = MAP_APPFONT ( 176 - COL_DIFF , 12 ) ;
- };
- ImageButton BTN_ADRESSBOOK
- {
- Pos = MAP_APPFONT ( 235, 24 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
-
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "adrbook.bmp" ; };
- MASKCOLOR
- };
-
- Text [ en-US ] = "Data Sources...";
- QuickHelpText [ en-US ] = "Data Sources..." ;
- };
- Image IMG_ADRESSBOOK_HC
- {
- ImageBitmap = Bitmap { File = "adrbook_hc.bmp" ; };
- MASKCOLOR
- };
-
- FixedLine GRP_MORE
- {
- Pos = MAP_APPFONT ( 6 , 92 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Further settings" ;
- };
- FixedText FT_FRAME
- {
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "F~rame" ;
- };
- ComboBox CB_FRAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 104 ) ;
- Size = MAP_APPFONT ( 66 - COL_DIFF , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- FixedText FT_FORM
- {
- Pos = MAP_APPFONT ( 126 , 105 ) ;
- Size = MAP_APPFONT ( 33 , 10 ) ;
- Text [ en-US ] = "F~orm" ;
- };
- ListBox LB_FORM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 160 , 104 ) ;
- Size = MAP_APPFONT ( 70 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- DDExtraWidth = TRUE ;
- StringList [ en-US ] =
- {
- < "Text" ; Default ; > ;
- < "Button" ; Default ; > ;
- };
- };
- FixedText FT_INDICATION
- {
- Pos = MAP_APPFONT ( 12 , 123 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "Te~xt" ;
- };
- Edit ED_INDICATION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 122 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 12 , 140 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "N~ame" ;
- };
- Edit ED_TEXT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 139 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- ImageButton BTN_SCRIPT
- {
- Pos = MAP_APPFONT ( 235, 103-1 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Events" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "script.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Events";
- };
- Image IMG_SCRIPT_HC
- {
- ImageBitmap = Bitmap { File = "script_hc.bmp" ; };
- MASKCOLOR
- };
-};
-
-/*************************************************************************
-|
-| Tabpage : Documents
-|
-*************************************************************************/
-
-TabPage RID_SVXPAGE_HYPERLINK_DOCUMENT
-{
- Hide = TRUE ;
- HelpID = HID_HYPERLINK_DOCUMENT;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 162 ) ;
- Text [ en-US ] = "Hyperlink" ;
-
- FixedLine GRP_DOCUMENT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Document" ;
- };
- FixedText FT_PATH_DOC
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "~Path" ;
- };
- ImageButton BTN_FILEOPEN
- {
- Pos = MAP_APPFONT ( 235, 14 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Open File" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "fileopen.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Open File";
- };
- Image IMG_FILEOPEN_HC
- {
- ImageBitmap = Bitmap { File = "fileopen_hc.bmp" ; };
- MASKCOLOR
- };
-
- FixedLine GRP_TARGET
- {
- Pos = MAP_APPFONT ( 6 , 38 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Target in document" ;
- };
- FixedText FT_TARGET_DOC
- {
- Pos = MAP_APPFONT ( 12 , 53 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "Targ~et" ;
- };
- Edit ED_TARGET_DOC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 52 ) ;
- Size = MAP_APPFONT ( 176 - COL_DIFF , 12 ) ;
- };
- FixedText FT_URL
- {
- Pos = MAP_APPFONT ( 12 , 70 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "URL" ;
- };
- FixedText FT_FULL_URL
- {
- Pos = MAP_APPFONT ( COL_2 , 70 ) ;
- Size = MAP_APPFONT ( 176 - COL_DIFF , 12 ) ;
- Text [ en-US ] = "Test text" ;
- };
- ImageButton BTN_BROWSE
- {
- Pos = MAP_APPFONT ( 235, 51 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Target in Document" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "target.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Target in Document";
- };
- Image IMG_BROWSE_HC
- {
- ImageBitmap = Bitmap { File = "target_hc.bmp" ; };
- MASKCOLOR
- };
-
- FixedLine GRP_MORE
- {
- Pos = MAP_APPFONT ( 6 , 92 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Further settings" ;
- };
- FixedText FT_FRAME
- {
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "F~rame" ;
- };
- ComboBox CB_FRAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 104 ) ;
- Size = MAP_APPFONT ( 66 - COL_DIFF , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- FixedText FT_FORM
- {
- Pos = MAP_APPFONT ( 126 , 105 ) ;
- Size = MAP_APPFONT ( 33 , 10 ) ;
- Text [ en-US ] = "F~orm" ;
- };
- ListBox LB_FORM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 160 , 104 ) ;
- Size = MAP_APPFONT ( 70 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- DDExtraWidth = TRUE ;
- StringList [ en-US ] =
- {
- < "Text" ; Default ; > ;
- < "Button" ; Default ; > ;
- };
- };
- FixedText FT_INDICATION
- {
- Pos = MAP_APPFONT ( 12 , 123 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "Te~xt" ;
- };
- Edit ED_INDICATION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 122 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 12 , 140 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "N~ame" ;
- };
- Edit ED_TEXT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 139 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- ImageButton BTN_SCRIPT
- {
- Pos = MAP_APPFONT ( 235, 103-1 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Events" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "script.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Events";
- };
- Image IMG_SCRIPT_HC
- {
- ImageBitmap = Bitmap { File = "script_hc.bmp" ; };
- MASKCOLOR
- };
-};
-
-/*************************************************************************
-|
-| Tabpage : New Documents
-|
-*************************************************************************/
-
-TabPage RID_SVXPAGE_HYPERLINK_NEWDOCUMENT
-{
- Hide = TRUE ;
- HelpID = HID_HYPERLINK_NEWDOCUMENT;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 162 ) ;
- Text [ en-US ] = "Hyperlink" ;
-
- FixedLine GRP_NEWDOCUMENT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "New document" ;
- };
- RadioButton RB_EDITNOW
- {
- Pos = MAP_APPFONT( COL_2, 13 );
- Size = MAP_APPFONT( 85 - COL_DIFF, 10 );
- Text [ en-US ] = "Edit ~now";
- };
- RadioButton RB_EDITLATER
- {
- Pos = MAP_APPFONT( 142, 13 );
- Size = MAP_APPFONT( 84, 10 );
- Text [ en-US ] = "Edit ~later";
- };
- FixedText FT_PATH_NEWDOC
- {
- Pos = MAP_APPFONT ( 12 , 26 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "~File" ;
- };
- Edit ED_PATH_NEWDOC
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 25 ) ;
- Size = MAP_APPFONT ( 176 - COL_DIFF , 12 ) ;
- };
- FixedText FT_DOCUMENT_TYPES
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "File ~type" ;
- };
- ListBox LB_DOCUMENT_TYPES
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 42 ) ;
- Size = MAP_APPFONT ( 176 - COL_DIFF , 40 ) ;
- TabStop = TRUE ;
- DropDown = FALSE ;
- };
- ImageButton BTN_CREATE
- {
- Pos = MAP_APPFONT ( 235, 24 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
-
- QuickHelpText [ en-US ] = "Select Path" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "newdoc.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Select Path";
- };
- Image IMG_CREATE_HC
- {
- ImageBitmap = Bitmap { File = "newdoc_hc.bmp" ; };
- MASKCOLOR
- };
-
- FixedLine GRP_MORE
- {
- Pos = MAP_APPFONT ( 6 , 92 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Further settings" ;
- };
- FixedText FT_FRAME
- {
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "F~rame" ;
- };
- ComboBox CB_FRAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 104 ) ;
- Size = MAP_APPFONT ( 66 - COL_DIFF , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- FixedText FT_FORM
- {
- Pos = MAP_APPFONT ( 126 , 105 ) ;
- Size = MAP_APPFONT ( 33 , 10 ) ;
- Text [ en-US ] = "F~orm" ;
- };
- ListBox LB_FORM
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 160 , 104 ) ;
- Size = MAP_APPFONT ( 70 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- DDExtraWidth = TRUE ;
- StringList [ en-US ] =
- {
- < "Text" ; Default ; > ;
- < "Button" ; Default ; > ;
- };
- };
- FixedText FT_INDICATION
- {
- Pos = MAP_APPFONT ( 12 , 123 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "Te~xt" ;
- };
- Edit ED_INDICATION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 122 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 12 , 140 ) ;
- Size = MAP_APPFONT ( 39 + COL_DIFF , 8 ) ;
- Text [ en-US ] = "N~ame" ;
- };
- Edit ED_TEXT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( COL_2 , 139 ) ;
- Size = MAP_APPFONT ( 194 - COL_DIFF , 12 ) ;
- };
- ImageButton BTN_SCRIPT
- {
- Pos = MAP_APPFONT ( 235, 103-1 ) ;
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_HEIGHT, HYPERDLG_IMGBUTTON_HEIGHT );
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Events" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "script.bmp" ; };
- MASKCOLOR
- };
- Text [ en-US ] = "Events";
- };
- Image IMG_SCRIPT_HC
- {
- ImageBitmap = Bitmap { File = "script_hc.bmp" ; };
- MASKCOLOR
- };
-};
-
-/*************************************************************************
-|
-| Tabpage-Dialog : Hyperlinks
-|
-*************************************************************************/
-ModalDialog RID_SVXDLG_NEWHYPERLINK
-{
- HelpID = SID_HYPERLINK_DIALOG;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 325 , 185 ) ;
- Text [ en-US ] = "Hyperlink" ;
- Moveable = TRUE ;
-};
-
-/*************************************************************************
-|
-| Tabpage-Dialog : Hyperlinks
-|
-*************************************************************************/
-
-String RID_SVXSTR_HYPDLG_APPLYBUT
-{
- Text [ en-US ] = "Apply" ;
-};
-String RID_SVXSTR_HYPDLG_CLOSEBUT
-{
- Text [ en-US ] = "Close" ;
-};
-String RID_SVXSTR_HYPDLG_MACROACT1
-{
- Text [ en-US ] = "Mouse over object" ;
-};
-String RID_SVXSTR_HYPDLG_MACROACT2
-{
- Text [ en-US ] = "Trigger hyperlink" ;
-};
-String RID_SVXSTR_HYPDLG_MACROACT3
-{
- Text [ en-US ] = "Mouse leaves object" ;
-};
-
-String RID_SVXSTR_HYPDLG_NOVALIDFILENAME
-{
- Text [ en-US ] = "Please type in a valid file name." ;
-};
-
-String RID_SVXSTR_HYPERDLG_HLINETTP
-{
- Text [ en-US ] = "Internet" ;
-};
-String RID_SVXSTR_HYPERDLG_HLINETTP_HELP
-{
- Text [ en-US ] = "This is where you create a hyperlink to a Web page, FTP server or Telnet connection." ;
-};
-
-String RID_SVXSTR_HYPERDLG_HLMAILTP
-{
- Text [ en-US ] = "Mail & News" ;
-};
-String RID_SVXSTR_HYPERDLG_HLMAILTP_HELP
-{
- Text [ en-US ] = "This is where you create a hyperlink to an e-mail address or newsgroup." ;
-};
-
-String RID_SVXSTR_HYPERDLG_HLDOCTP
-{
- Text [ en-US ] = "Document" ;
-};
-String RID_SVXSTR_HYPERDLG_HLDOCTP_HELP
-{
- Text [ en-US ] = "This is where you create a hyperlink to an existing document or a target within a document." ;
-};
-
-String RID_SVXSTR_HYPERDLG_HLDOCNTP
-{
- Text [ en-US ] = "New Document" ;
-};
-String RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP
-{
- Text [ en-US ] = "This is where you create a new document to which the new link points." ;
-};
-
-String RID_SVXSTR_HYPERDLG_FORM_BUTTON
-{
- Text [ en-US ] = "Button" ;
-};
-
-String RID_SVXSTR_HYPERDLG_FROM_TEXT
-{
- Text [ en-US ] = "Text" ;
-};
-
-String RID_SVXSTR_HYPERDLG_QUERYOVERWRITE
-{
- Text [ en-US ] = "The file already exists. Overwrite?" ;
-};
-
-Image RID_SVXBMP_HLINETTP
-{
- ImageBitmap = Bitmap { File = "hlinettp.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLMAILTP
-{
- ImageBitmap = Bitmap { File = "hlmailtp.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLDOCTP
-{
- ImageBitmap = Bitmap { File = "hldoctp.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLDOCNTP
-{
- ImageBitmap = Bitmap { File = "hldocntp.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLINETTP_H
-{
- ImageBitmap = Bitmap { File = "hlinettp_h.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLMAILTP_H
-{
- ImageBitmap = Bitmap { File = "hlmailtp_h.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLDOCTP_H
-{
- ImageBitmap = Bitmap { File = "hldoctp_h.bmp" ; };
- MASKCOLOR
-};
-
-Image RID_SVXBMP_HLDOCNTP_H
-{
- ImageBitmap = Bitmap { File = "hldocntp_h.bmp" ; };
- MASKCOLOR
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx
index c1be60ebe3..211b2edb22 100644
--- a/svx/source/dialog/hyprlink.cxx
+++ b/svx/source/dialog/hyprlink.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,16 +33,16 @@
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <unotools/configitem.hxx>
-#include <svtools/cmdoptions.hxx>
+#include <unotools/cmdoptions.hxx>
#include <svtools/inetimg.hxx>
-#include <svtools/urlbmk.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/urlbmk.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/imgmgr.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <sfx2/objsh.hxx>
#include <comphelper/processfactory.hxx>
@@ -66,13 +66,15 @@ public:
~SearchDefaultConfigItem_Impl();
const OUString& GetDefaultSearchEngine(){ return sDefaultEngine;}
+ virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
+ virtual void Commit();
};
/*-- 11.11.2003 14:20:59---------------------------------------------------
-----------------------------------------------------------------------*/
SearchDefaultConfigItem_Impl::SearchDefaultConfigItem_Impl() :
- ConfigItem(OUString::createFromAscii("Inet/DefaultSearchEngine"))
+ ConfigItem(OUString::createFromAscii("Inet/DefaultSearchEngine"))
{
uno::Sequence<OUString> aNames(1);
aNames.getArray()[0] = OUString::createFromAscii("Name");
@@ -86,6 +88,14 @@ SearchDefaultConfigItem_Impl::~SearchDefaultConfigItem_Impl()
{
}
+void SearchDefaultConfigItem_Impl::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
+{
+}
+
+void SearchDefaultConfigItem_Impl::Commit()
+{
+}
+
/*************************************************************************
|*
|* Dialog zum Einf"ugen/"Andern eines Hyperlink
@@ -119,10 +129,10 @@ SvxHyperlinkDlg::SvxHyperlinkDlg( SfxBindings *_pBindings, Window* pParent) :
FreeResource();
mpManager = SfxImageManager::GetImageManager( 0 );
- mpManager->RegisterToolBox( this );
-
+ mpManager->RegisterToolBox( this );
+
SetImages();
-
+
// save initial size
nMaxWidth = GetSizePixel().Width();
nMaxHeight = GetSizePixel().Height();
@@ -188,9 +198,9 @@ SvxHyperlinkDlg::SvxHyperlinkDlg( SfxBindings *_pBindings, Window* pParent) :
// Hide button according to config item.
SvtCommandOptions aCmdOpts;
- if ( aCmdOpts.Lookup( SvtCommandOptions::CMDOPTION_DISABLED,
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
+ if ( aCmdOpts.Lookup( SvtCommandOptions::CMDOPTION_DISABLED,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
"InternetSearch" ) ) ) )
HideItem( BTN_INET_SEARCH );
}
@@ -202,7 +212,7 @@ SvxHyperlinkDlg::SvxHyperlinkDlg( SfxBindings *_pBindings, Window* pParent) :
SvxHyperlinkDlg::~SvxHyperlinkDlg()
{
SfxImageManager::GetImageManager( 0 )->ReleaseToolBox(this);
-
+
if (pTargetMenu != NULL)
delete pTargetMenu;
}
@@ -419,14 +429,14 @@ IMPL_LINK( SvxHyperlinkDlg, DropdownClick, ToolBox *, pBox )
String sTest(rData.sEngineName);
sTest.ToLowerAscii();
bool bIsDefaultEngine = bHasDefault && STRING_NOTFOUND != sTest.Search( sDefault );
- //then put it at the top
+ //then put it at the top
if(i && bIsDefaultEngine)
{
pMenu->InsertItem( i + 1, rData.sEngineName, 0, 0);
pMenu->InsertSeparator(1);
- }
+ }
else
- {
+ {
if (i)
pMenu->InsertSeparator();
pMenu->InsertItem( i + 1, rData.sEngineName);
@@ -439,7 +449,7 @@ IMPL_LINK( SvxHyperlinkDlg, DropdownClick, ToolBox *, pBox )
delete pMenu;
}
break;
-
+
case BTN_TARGET:
{
// Target Frame einstellen
@@ -834,7 +844,7 @@ void SvxHyperlinkDlg::SetImages()
SetItemImage( BTN_INSERT_BOOKMARK, mpManager->GetImage( BTN_INSERT_BOOKMARK, bHighContrast ) );
SetItemImage( BTN_INET_SEARCH, mpManager->GetImage( BTN_INET_SEARCH, bHighContrast ) );
SetItemImage( BTN_TARGET, mpManager->GetImage( BTN_TARGET, bHighContrast ) );
- SetItemImage( BTN_OPENDIALOG, mpManager->GetImage( BTN_OPENDIALOG, bHighContrast ) );
+ SetItemImage( BTN_OPENDIALOG, mpManager->GetImage( BTN_OPENDIALOG, bHighContrast ) );
}
/*--------------------------------------------------------------------
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 23dbaa60ea..db5f21f383 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,13 +52,13 @@
#include <vcl/msgbox.hxx>
#include <vcl/group.hxx>
#include <vcl/lstbox.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/pathoptions.hxx>
+#include <svl/eitem.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/module.hxx>
#include <sfx2/filedlghelper.hxx>
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
@@ -196,7 +196,7 @@ void SvxIMapDlgChildWindow::UpdateIMapDlg( const Graphic& rGraphic, const ImageM
SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW,
Window* _pParent, const ResId& rResId ) :
SfxModelessDialog ( _pBindings, pCW, _pParent, rResId ),
-
+
aTbxIMapDlg1 ( this, SVX_RES( TBX_IMAPDLG1 ) ),
aFtURL ( this, SVX_RES( FT_URL ) ),
maURLBox ( this, SVX_RES( CBB_URL ) ),
@@ -230,7 +230,7 @@ SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW,
maCbbTarget.SetLoseFocusHdl( LINK( this, SvxIMapDlg, URLLoseFocusHdl ) );
SvtMiscOptions aMiscOptions;
- aMiscOptions.AddListener( LINK( this, SvxIMapDlg, MiscHdl ) );
+ aMiscOptions.AddListenerLink( LINK( this, SvxIMapDlg, MiscHdl ) );
aTbxIMapDlg1.SetOutStyle( aMiscOptions.GetToolboxStyle() );
aTbxIMapDlg1.SetSizePixel( aTbxIMapDlg1.CalcWindowSizePixel() );
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 85fe1b9057..f57679299c 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -38,7 +38,7 @@
#include <svtools/imaprect.hxx>
#include <svtools/imapcirc.hxx>
#include <svtools/imappoly.hxx>
-#include <svtools/urlbmk.hxx>
+#include <svl/urlbmk.hxx>
#include <xoutbmp.hxx>
#include <svx/dialmgr.hxx>
@@ -52,7 +52,7 @@
#include <svx/svdopath.hxx>
#include <svx/xfltrit.hxx>
#include <svx/svdpagv.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <svx/xfillit.hxx>
#include <svx/xlineit.hxx>
#include <sfx2/evntconf.hxx>
diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx
index 31d108dfe0..507b03d30d 100644
--- a/svx/source/dialog/imapwnd.hxx
+++ b/svx/source/dialog/imapwnd.hxx
@@ -34,7 +34,7 @@
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/menu.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svtools/imapobj.hxx>
#include <svtools/transfer.hxx>
#include <svtools/imap.hxx>
diff --git a/svx/source/dialog/impgrf.cxx b/svx/source/dialog/impgrf.cxx
index b60c391f00..be32ba5778 100644
--- a/svx/source/dialog/impgrf.cxx
+++ b/svx/source/dialog/impgrf.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,14 +35,14 @@
#include <limits.h> // USHRT_MAX
#include <tools/urlobj.hxx>
#include <tools/bigint.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/dispatch.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/waitobj.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/viewoptions.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/viewoptions.hxx>
#include <unotools/localfilehelper.hxx>
#include <ucbhelper/content.hxx>
#include <osl/file.hxx>
@@ -55,7 +55,7 @@ using namespace com::sun::star::uno;
#include "impgrf.hrc"
#define _SVX_IMPGRF_CXX
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <svx/dialmgr.hxx>
#include "svxerr.hxx"
@@ -111,7 +111,7 @@ int LoadGraphic( const String &rPath, const String &rFilterName,
nRes = pFilter->ImportGraphic( rGraphic, rPath, *pStream,
nFilter, pDeterminedFormat );
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( nRes )
{
if( pMed )
diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk
index c54081365a..7bcdcf4a4c 100644
--- a/svx/source/dialog/makefile.mk
+++ b/svx/source/dialog/makefile.mk
@@ -54,10 +54,8 @@ SRC1FILES = \
dlgctrl.src \
docrecovery.src \
fontwork.src \
- frmdirlbox.src \
frmsel.src \
hdft.src \
- hyperdlg.src \
hyphen.src \
hyprlink.src \
imapdlg.src \
@@ -70,6 +68,7 @@ SRC1FILES = \
rubydialog.src\
ruler.src \
srchdlg.src \
+ svxbmpnumvalueset.src \
swframeposstrings.src \
thesdlg.src \
txenctab.src \
@@ -129,7 +128,6 @@ LIB2OBJFILES= \
$(SLO)$/passwd.obj \
$(SLO)$/pfiledlg.obj \
$(SLO)$/prtqry.obj \
- $(SLO)$/radiobtnbox.obj \
$(SLO)$/relfld.obj \
$(SLO)$/rlrcitem.obj \
$(SLO)$/rubydialog.obj \
@@ -166,12 +164,3 @@ SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
.INCLUDE : target.mk
-$(INCCOM)$/cuilib.hxx: makefile.mk
-.IF "$(GUI)"=="UNX"
- $(RM) $@
- echo \#define DLL_NAME \"libcui$(DLLPOSTFIX)$(DLLPOST)\" >$@
-.ELSE
- echo $(EMQ)#define DLL_NAME $(EMQ)"cui$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@
-.ENDIF
-
-$(SLO)$/svxdlg.obj : $(INCCOM)$/cuilib.hxx
diff --git a/svx/source/dialog/opengrf.cxx b/svx/source/dialog/opengrf.cxx
index f6564449ae..6ca40f2486 100644
--- a/svx/source/dialog/opengrf.cxx
+++ b/svx/source/dialog/opengrf.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@
#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
#endif
@@ -58,7 +58,7 @@
#endif
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfile.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <svx/dialmgr.hxx>
#include "opengrf.hxx"
diff --git a/svx/source/dialog/radiobtnbox.cxx b/svx/source/dialog/radiobtnbox.cxx
deleted file mode 100644
index dd10431109..0000000000
--- a/svx/source/dialog/radiobtnbox.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: radiobtnbox.cxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-/*
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-*/
-
-// include ---------------------------------------------------------------
-
-#include "radiobtnbox.hxx"
-#include <svx/dialmgr.hxx>
-
-namespace svx {
-
-// class SvxRadioButtonListBox ----------------------------------------------------
-
-SvxRadioButtonListBox::SvxRadioButtonListBox( Window* _pParent, const ResId& _rId ) :
-
- SvxSimpleTable( _pParent, _rId )
-
-{
- EnableCheckButton( new SvLBoxButtonData( this, true ) );
-}
-
-SvxRadioButtonListBox::~SvxRadioButtonListBox()
-{
-}
-
-void SvxRadioButtonListBox::SetTabs()
-{
- SvxSimpleTable::SetTabs();
-/*
- USHORT nAdjust = SV_LBOXTAB_ADJUST_RIGHT | SV_LBOXTAB_ADJUST_LEFT |
- SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_NUMERIC | SV_LBOXTAB_FORCE;
- if ( aTabs.Count() > 0 )
- {
- SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
- pTab->nFlags &= ~nAdjust;
- pTab->nFlags |= SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_FORCE;
- }
-*/
-}
-
-void SvxRadioButtonListBox::MouseButtonUp( const MouseEvent& _rMEvt )
-{
- m_aCurMousePoint = _rMEvt.GetPosPixel();
- SvxSimpleTable::MouseButtonUp( _rMEvt );
-}
-
-void SvxRadioButtonListBox::KeyInput( const KeyEvent& rKEvt )
-{
- if ( !rKEvt.GetKeyCode().GetModifier() && KEY_SPACE == rKEvt.GetKeyCode().GetCode() )
- {
- SvLBoxEntry* pEntry = FirstSelected();
- if ( GetCheckButtonState( pEntry ) == SV_BUTTON_UNCHECKED )
- {
- SetCheckButtonState( pEntry, SV_BUTTON_CHECKED );
- GetCheckButtonHdl().Call( NULL );
- return ;
- }
- }
-
- SvxSimpleTable::KeyInput( rKEvt );
-}
-
-void SvxRadioButtonListBox::HandleEntryChecked( SvLBoxEntry* _pEntry )
-{
- Select( _pEntry, TRUE );
- SvButtonState eState = GetCheckButtonState( _pEntry );
-
- if ( SV_BUTTON_CHECKED == eState )
- {
- // we have radio button behavior -> so uncheck the other entries
- SvLBoxEntry* pEntry = First();
- while ( pEntry )
- {
- if ( pEntry != _pEntry )
- SetCheckButtonState( pEntry, SV_BUTTON_UNCHECKED );
- pEntry = Next( pEntry );
- }
- }
- else
- SetCheckButtonState( _pEntry, SV_BUTTON_CHECKED );
-}
-
-const Point& SvxRadioButtonListBox::GetCurMousePoint() const
-{
- return m_aCurMousePoint;
-}
-
-} // end of namespace ::svx
-
diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx
index 552d2e862b..d81ec83ceb 100644
--- a/svx/source/dialog/rlrcitem.cxx
+++ b/svx/source/dialog/rlrcitem.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
// INCLUDE ---------------------------------------------------------------
-#include <svtools/rectitem.hxx>
+#include <svl/rectitem.hxx>
@@ -48,7 +48,7 @@
#include "protitem.hxx"
#include "rlrcitem.hxx"
#include "rulritem.hxx"
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
// class SvxRulerItem ----------------------------------------------------
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index 5e67d87e28..74257dec75 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -38,7 +38,7 @@
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/XRubySelection.hpp>
diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src
index 9bf4160b78..853d9f3137 100644
--- a/svx/source/dialog/sdstring.src
+++ b/svx/source/dialog/sdstring.src
@@ -42,92 +42,14 @@ String RID_SVXSTR_GRADIENT
{
Text [ en-US ] = "Gradient" ;
};
-String RID_SVXSTR_DESC_GRADIENT
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für den Farbverlauf ein: : Geben Sie hier bitte den Namen f³r den Farbverlauf ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für den Farbverlauf ein: : Geben Sie hier bitte den Namen f³r den Farbverlauf ein: */
- Text [ en-US ] = "Please enter a name for the gradient:" ;
-};
-String RID_SVXSTR_DEL_GRADIENT
-{
- /* ### ACHTUNG: Neuer Text in Resource? Farbverlauf löschen : Farbverlauf l÷schen */
- /* ### ACHTUNG: Neuer Text in Resource? Farbverlauf löschen : Farbverlauf l÷schen */
- Text [ en-US ] = "Delete gradient" ;
-};
-String RID_SVXSTR_ASK_DEL_GRADIENT
-{
- /* ### ACHTUNG: Neuer Text in Resource? Soll der Farbverlauf wirklich gelöscht werden? : Soll der Farbverlauf wirklich gel÷scht werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Soll der Farbverlauf wirklich gelöscht werden? : Soll der Farbverlauf wirklich gel÷scht werden? */
- Text [ en-US ] = "Do you want to delete the gradient?" ;
-};
-String RID_SVXSTR_ASK_CHANGE_GRADIENT
-{
- /* ### ACHTUNG: Neuer Text in Resource? Der Farbverlauf wurde geändert und nicht gesichert. \nSie können den selektierten Farbverlauf ändern \noder einen neuen Farbverlauf hinzufügen. : Der Farbverlauf wurde geõndert und nicht gesichert. \nSie k÷nnen den selektierten Farbverlauf õndern \noder einen neuen Farbverlauf hinzuf³gen. */
- /* ### ACHTUNG: Neuer Text in Resource? Der Farbverlauf wurde geändert und nicht gesichert. \nSie können den selektierten Farbverlauf ändern \noder einen neuen Farbverlauf hinzufügen. : Der Farbverlauf wurde geõndert und nicht gesichert. \nSie k÷nnen den selektierten Farbverlauf õndern \noder einen neuen Farbverlauf hinzuf³gen. */
- Text [ en-US ] = "The gradient was modified without saving. \nModify the selected gradient or add a new gradient." ;
-};
String RID_SVXSTR_BITMAP
{
Text [ en-US ] = "Bitmap" ;
};
-String RID_SVXSTR_DESC_NEW_BITMAP
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die Bitmap ein: : Geben Sie hier bitte den Namen f³r die Bitmap ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die Bitmap ein: : Geben Sie hier bitte den Namen f³r die Bitmap ein: */
- Text [ en-US ] = "Please enter a name for the bitmap:" ;
-};
-String RID_SVXSTR_DESC_EXT_BITMAP
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die externe Bitmap ein: : Geben Sie hier bitte den Namen f³r die externe Bitmap ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die externe Bitmap ein: : Geben Sie hier bitte den Namen f³r die externe Bitmap ein: */
- Text [ en-US ] = "Please enter a name for the external bitmap:" ;
-};
-String RID_SVXSTR_DEL_BITMAP
-{
- /* ### ACHTUNG: Neuer Text in Resource? Bitmap löschen : Bitmap l÷schen */
- /* ### ACHTUNG: Neuer Text in Resource? Bitmap löschen : Bitmap l÷schen */
- Text [ en-US ] = "Delete bitmap" ;
-};
-String RID_SVXSTR_ASK_DEL_BITMAP
-{
- /* ### ACHTUNG: Neuer Text in Resource? Soll die Bitmap wirklich gelöscht werden? : Soll die Bitmap wirklich gel÷scht werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Soll die Bitmap wirklich gelöscht werden? : Soll die Bitmap wirklich gel÷scht werden? */
- Text [ en-US ] = "Are you sure you want to delete the bitmap?" ;
-};
-String RID_SVXSTR_ASK_CHANGE_BITMAP
-{
- /* ### ACHTUNG: Neuer Text in Resource? Die Bitmap wurde geändert und nicht gesichert. \nSie können die selektierte Bitmap ändern \noder eine neue Bitmap hinzufügen. : Die Bitmap wurde geõndert und nicht gesichert. \nSie k÷nnen die selektierte Bitmap õndern \noder eine neue Bitmap hinzuf³gen. */
- /* ### ACHTUNG: Neuer Text in Resource? Die Bitmap wurde geändert und nicht gesichert. \nSie können die selektierte Bitmap ändern \noder eine neue Bitmap hinzufügen. : Die Bitmap wurde geõndert und nicht gesichert. \nSie k÷nnen die selektierte Bitmap õndern \noder eine neue Bitmap hinzuf³gen. */
- Text [ en-US ] = "The bitmap was modified without saving. \nModify the selected bitmap or add a new bitmap." ;
-};
String RID_SVXSTR_LINESTYLE
{
Text [ en-US ] = "Line Style" ;
};
-String RID_SVXSTR_DESC_LINESTYLE
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für den Linienstil ein: : Geben Sie hier bitte den Namen f³r den Linienstil ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für den Linienstil ein: : Geben Sie hier bitte den Namen f³r den Linienstil ein: */
- Text [ en-US ] = "Please enter a name for the line style:" ;
-};
-String RID_SVXSTR_DEL_LINESTYLE
-{
- /* ### ACHTUNG: Neuer Text in Resource? Linienstil löschen : Linienstil l÷schen */
- /* ### ACHTUNG: Neuer Text in Resource? Linienstil löschen : Linienstil l÷schen */
- Text [ en-US ] = "Delete line style" ;
-};
-String RID_SVXSTR_ASK_DEL_LINESTYLE
-{
- /* ### ACHTUNG: Neuer Text in Resource? Soll der Linienstil wirklich gelöscht werden? : Soll der Linienstil wirklich gel÷scht werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Soll der Linienstil wirklich gelöscht werden? : Soll der Linienstil wirklich gel÷scht werden? */
- Text [ en-US ] = "Do you want to delete the line style?" ;
-};
-String RID_SVXSTR_ASK_CHANGE_LINESTYLE
-{
- /* ### ACHTUNG: Neuer Text in Resource? Der Linienstil wurde geändert und nicht gesichert. \nSie können den selektierten Linienstil ändern \noder einen neuen Linienstil hinzufügen. : Der Linienstil wurde geõndert und nicht gesichert. \nSie k÷nnen den selektierten Linienstil õndern \noder einen neuen Linienstil hinzuf³gen. */
- /* ### ACHTUNG: Neuer Text in Resource? Der Linienstil wurde geändert und nicht gesichert. \nSie können den selektierten Linienstil ändern \noder einen neuen Linienstil hinzufügen. : Der Linienstil wurde geõndert und nicht gesichert. \nSie k÷nnen den selektierten Linienstil õndern \noder einen neuen Linienstil hinzuf³gen. */
- Text [ en-US ] = "The line style was modified without saving. \nModify the selected line style or add a new line style." ;
-};
String RID_SVXSTR_INVISIBLE
{
Text [ en-US ] = "Invisible" ;
@@ -140,116 +62,11 @@ String RID_SVXSTR_HATCH
{
Text [ en-US ] = "Hatching" ;
};
-String RID_SVXSTR_DESC_HATCH
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die Schraffur ein: : Geben Sie hier bitte den Namen f³r die Schraffur ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die Schraffur ein: : Geben Sie hier bitte den Namen f³r die Schraffur ein: */
- Text [ en-US ] = "Please enter a name for the hatching:" ;
-};
-String RID_SVXSTR_DEL_HATCH
-{
- /* ### ACHTUNG: Neuer Text in Resource? Schraffur löschen : Schraffur l÷schen */
- /* ### ACHTUNG: Neuer Text in Resource? Schraffur löschen : Schraffur l÷schen */
- Text [ en-US ] = "Delete hatching" ;
-};
-String RID_SVXSTR_ASK_DEL_HATCH
-{
- /* ### ACHTUNG: Neuer Text in Resource? Soll die Schraffur wirklich gelöscht werden? : Soll die Schraffur wirklich gel÷scht werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Soll die Schraffur wirklich gelöscht werden? : Soll die Schraffur wirklich gel÷scht werden? */
- Text [ en-US ] = "Do you want to delete the hatching?" ;
-};
-String RID_SVXSTR_ASK_CHANGE_HATCH
-{
- /* ### ACHTUNG: Neuer Text in Resource? Die Schraffur wurde geändert und nicht gesichert. \nSie können die selektierte Schraffur ändern \noder eine neue Schraffur hinzufügen. : Die Schraffur wurde geõndert und nicht gesichert. \nSie k÷nnen die selektierte Schraffur õndern \noder eine neue Schraffur hinzuf³gen. */
- /* ### ACHTUNG: Neuer Text in Resource? Die Schraffur wurde geändert und nicht gesichert. \nSie können die selektierte Schraffur ändern \noder eine neue Schraffur hinzufügen. : Die Schraffur wurde geõndert und nicht gesichert. \nSie k÷nnen die selektierte Schraffur õndern \noder eine neue Schraffur hinzuf³gen. */
- Text [ en-US ] = "The hatching type was modified but not saved. \nModify the selected hatching type or add a new hatching type." ;
-};
-String RID_SVXSTR_CHANGE
-{
- /* ### ACHTUNG: Neuer Text in Resource? Ändern : Žndern */
- /* ### ACHTUNG: Neuer Text in Resource? Ändern : Žndern */
- Text [ en-US ] = "Modify" ;
-};
-String RID_SVXSTR_ADD
-{
- /* ### ACHTUNG: Neuer Text in Resource? Hinzufügen : Hinzuf³gen */
- /* ### ACHTUNG: Neuer Text in Resource? Hinzufügen : Hinzuf³gen */
- Text [ en-US ] = "Add" ;
-};
-String RID_SVXSTR_DESC_COLOR
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die neue Farbe ein: : Geben Sie hier bitte den Namen f³r die neue Farbe ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für die neue Farbe ein: : Geben Sie hier bitte den Namen f³r die neue Farbe ein: */
- Text [ en-US ] = "Please enter a name for the new color:" ;
-};
-String RID_SVXSTR_DEL_COLOR
-{
- /* ### ACHTUNG: Neuer Text in Resource? Farbe löschen : Farbe l÷schen */
- /* ### ACHTUNG: Neuer Text in Resource? Farbe löschen : Farbe l÷schen */
- Text [ en-US ] = "Delete color" ;
-};
-String RID_SVXSTR_ASK_DEL_COLOR
-{
- /* ### ACHTUNG: Neuer Text in Resource? Soll die Farbe wirklich gelöscht werden? : Soll die Farbe wirklich gel÷scht werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Soll die Farbe wirklich gelöscht werden? : Soll die Farbe wirklich gel÷scht werden? */
- Text [ en-US ] = "Do you want to delete the color?" ;
-};
-String RID_SVXSTR_ASK_CHANGE_COLOR
-{
- /* ### ACHTUNG: Neuer Text in Resource? Die Farbe wurde geändert und nicht gesichert. \nSie können die selektierte Farbe ändern \noder eine neue Farbe hinzufügen. : Die Farbe wurde geõndert und nicht gesichert. \nSie k÷nnen die selektierte Farbe õndern \noder eine neue Farbe hinzuf³gen. */
- /* ### ACHTUNG: Neuer Text in Resource? Die Farbe wurde geändert und nicht gesichert. \nSie können die selektierte Farbe ändern \noder eine neue Farbe hinzufügen. : Die Farbe wurde geõndert und nicht gesichert. \nSie k÷nnen die selektierte Farbe õndern \noder eine neue Farbe hinzuf³gen. */
- Text [ en-US ] = "The color was modified without saving.\nModify the selected color or add a new color." ;
-};
-String RID_SVXSTR_TABLE
-{
- Text [ en-US ] = "Table" ;
-};
-String RID_SVXSTR_WRITE_DATA_ERROR
-{
- Text [ en-US ] = "The file could not be saved!" ;
-};
-String RID_SVXSTR_READ_DATA_ERROR
-{
- Text [ en-US ] = "The file could not be loaded!" ;
-};
-String RID_SVXSTR_WARN_TABLE_OVERWRITE
-{
- /* ### ACHTUNG: Neuer Text in Resource? Die Tabelle wurde geändert und nicht gespeichert. \nSoll die Tabelle gespeichert werden? : Die Tabelle wurde geõndert und nicht gespeichert. \nSoll die Tabelle gespeichert werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Die Tabelle wurde geändert und nicht gespeichert. \nSoll die Tabelle gespeichert werden? : Die Tabelle wurde geõndert und nicht gespeichert. \nSoll die Tabelle gespeichert werden? */
- Text [ en-US ] = "The list was modified without saving. Would you like to save the list now?" ;
-};
-String RID_SVXSTR_WARN_NAME_DUPLICATE
-{
- Text [ en-US ] = "The name you have entered already exists. \nPlease choose another name." ;
-};
String RID_SVXSTR_LINEEND
{
Text [ en-US ] = "Arrowheads" ;
};
-String RID_SVXSTR_DESC_LINEEND
-{
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für das neue Linienende ein: : Geben Sie hier bitte den Namen f³r das neue Linienende ein: */
- /* ### ACHTUNG: Neuer Text in Resource? Geben Sie hier bitte den Namen für das neue Linienende ein: : Geben Sie hier bitte den Namen f³r das neue Linienende ein: */
- Text [ en-US ] = "Please enter a name for the new arrowhead:" ;
-};
-String RID_SVXSTR_DEL_LINEEND
-{
- /* ### ACHTUNG: Neuer Text in Resource? Linienende löschen : Linienende l÷schen */
- /* ### ACHTUNG: Neuer Text in Resource? Linienende löschen : Linienende l÷schen */
- Text [ en-US ] = "Delete line ends" ;
-};
-String RID_SVXSTR_ASK_DEL_LINEEND
-{
- /* ### ACHTUNG: Neuer Text in Resource? Soll das Linienende wirklich gelöscht werden? : Soll das Linienende wirklich gel÷scht werden? */
- /* ### ACHTUNG: Neuer Text in Resource? Soll das Linienende wirklich gelöscht werden? : Soll das Linienende wirklich gel÷scht werden? */
- Text [ en-US ] = "Do you want to delete the arrowhead?" ;
-};
-String RID_SVXSTR_ASK_CHANGE_LINEEND
-{
- /* ### ACHTUNG: Neuer Text in Resource? Das Linienende wurde geändert und nicht gesichert. \nMöchten Sie das Linienende jetzt sichern? : Das Linienende wurde geõndert und nicht gesichert. \nM÷chten Sie das Linienende jetzt sichern? */
- /* ### ACHTUNG: Neuer Text in Resource? Das Linienende wurde geändert und nicht gesichert. \nMöchten Sie das Linienende jetzt sichern? : Das Linienende wurde geõndert und nicht gesichert. \nM÷chten Sie das Linienende jetzt sichern? */
- Text [ en-US ] = "The arrowhead was modified without saving.\nWould you like to save the arrowhead now?" ;
-};
+
String RID_SVXSTR_CLOSE
{
/* ### ACHTUNG: Neuer Text in Resource? Schließen : Schlie˜en */
@@ -1375,6 +1192,30 @@ String RID_SVXSTR_TRASNGR0
// ********************************************************************** EOF
+ // RID_SVXSTR_FIELDUNIT_TABLE --------------------------------------------
+
+StringArray RID_SVXSTR_FIELDUNIT_TABLE
+{
+ ItemList [ en-US ] =
+ {
+ < "Millimeter" ; FUNIT_MM ; > ;
+ < "Centimeter" ; FUNIT_CM ; > ;
+ < "Meter" ; FUNIT_M ; > ;
+ < "Kilometer" ; FUNIT_KM ; > ;
+ < "Inch" ; FUNIT_INCH ; > ;
+ < "Foot" ; FUNIT_FOOT ; > ;
+ < "Miles" ; FUNIT_MILE ; > ;
+ < "Pica" ; FUNIT_PICA ; > ;
+ < "Point" ; FUNIT_POINT ; > ;
+ };
+ };
+
+// unbekannte Zeichenfarbe
+String RID_SVXSTR_COLOR_USER
+{
+ Text [ en-US ] = "User" ;
+};
+
diff --git a/svx/source/dialog/srchctrl.cxx b/svx/source/dialog/srchctrl.cxx
index 515959fb03..3f117045b2 100644
--- a/svx/source/dialog/srchctrl.cxx
+++ b/svx/source/dialog/srchctrl.cxx
@@ -33,7 +33,7 @@
// include ---------------------------------------------------------------
#include <tools/pstm.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <sfx2/objsh.hxx>
#include <svx/svxids.hrc>
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 670264aae4..7526313900 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -35,16 +35,16 @@
#include <vcl/wrkwin.hxx>
#include <vcl/morebtn.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/slstitm.hxx>
-#include <svtools/itemiter.hxx>
-#include <svtools/style.hxx>
-#include <svtools/searchopt.hxx>
+#include <svl/slstitm.hxx>
+#include <svl/itemiter.hxx>
+#include <svl/style.hxx>
+#include <unotools/searchopt.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/module.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/basedlgs.hxx>
-#include <svtools/cjkoptions.hxx>
+#include <svl/cjkoptions.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -52,7 +52,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <comphelper/processfactory.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <sfx2/app.hxx>
#include <toolkit/unohlp.hxx>
@@ -286,47 +286,6 @@ void SearchAttrItemList::Remove( USHORT nPos, USHORT nLen )
SrchAttrItemList::Remove( nPos, nLen );
}
-/* //CHINA001
-// class SvxJSearchOptionsDialog -----------------------------------------
-
-SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(
- Window *pParent,
- const SfxItemSet& rOptionsSet, USHORT nUniqueId, INT32 nInitialFlags ) :
- SfxSingleTabDialog ( pParent, rOptionsSet, RID_SVXPAGE_JSEARCH_OPTIONS ),
- nInitialTlFlags( nInitialFlags )
-{
- pPage = (SvxJSearchOptionsPage *)
- SvxJSearchOptionsPage::Create( this, rOptionsSet );
- SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
- pPage->EnableSaveOptions( FALSE );
-}
-
-
-SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog()
-{
- // pPage will be implicitly destroyed by the
- // SfxSingleTabDialog destructor
-}
-
-
-void SvxJSearchOptionsDialog::Activate()
-{
- pPage->SetTransliterationFlags( nInitialTlFlags );
-}
-
-
-INT32 SvxJSearchOptionsDialog::GetTransliterationFlags() const
-{
- return pPage->GetTransliterationFlags();
-}
-
-
-void SvxJSearchOptionsDialog::SetTransliterationFlags( INT32 nSettings )
-{
- pPage->SetTransliterationFlags( nSettings );
-}
-*/ //CHINA001
-
#if ENABLE_LAYOUT
#undef SfxModelessDialog
#define SfxModelessDialog(bindings, child, parent, id) SfxDialog (parent, "find-and-replace.xml", id, bindings, child)
@@ -1589,12 +1548,11 @@ IMPL_LINK( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn )
{
SfxItemSet aSet( SFX_APP()->GetPool() );
pSearchItem->SetTransliterationFlags( GetTransliterationFlags() );
- //CHINA001 SvxJSearchOptionsDialog aDlg( this, aSet, RID_SVXPAGE_JSEARCH_OPTIONS,
- //CHINA001 pSearchItem->GetTransliterationFlags() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractSvxJSearchOptionsDialog* aDlg = pFact->CreateSvxJSearchOptionsDialog( LAYOUT_THIS_WINDOW (this), aSet, RID_SVXPAGE_JSEARCH_OPTIONS, pSearchItem->GetTransliterationFlags(), RID_SVXPAGE_JSEARCH_OPTIONS );
+ AbstractSvxJSearchOptionsDialog* aDlg = pFact->CreateSvxJSearchOptionsDialog( LAYOUT_THIS_WINDOW (this), aSet,
+ pSearchItem->GetTransliterationFlags() );
DBG_ASSERT(aDlg, "Dialogdiet fail!");//CHINA001
int nRet = aDlg->Execute(); //CHINA001 int nRet = aDlg.Execute();
if (RET_OK == nRet) //! true only if FillItemSet of SvxJSearchOptionsPage returns true
@@ -2280,7 +2238,7 @@ IMPL_LINK( SvxSearchDialog, AttributeHdl_Impl, Button *, EMPTYARG )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- VclAbstractDialog* pDlg = pFact->CreateSvxSearchAttributeDialog( LAYOUT_THIS_WINDOW (this), *pSearchList, pImpl->pRanges, RID_SVXDLG_SEARCHATTR );
+ VclAbstractDialog* pDlg = pFact->CreateSvxSearchAttributeDialog( LAYOUT_THIS_WINDOW (this), *pSearchList, pImpl->pRanges );
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
pDlg->Execute();
delete pDlg;
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx
index 5f89bbda4e..10a572d43a 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,17 +37,17 @@
#include <tools/shl.hxx>
#include <i18npool/mslangid.hxx>
#include <svtools/valueset.hxx>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
#ifndef _SVX_HELPID_HRC
#include <helpid.hrc>
#endif
#include <svx/numitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <vcl/svapp.hxx>
#include <gallery.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <svx/brshitem.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <sfx2/objsh.hxx>
#include <vcl/graph.hxx>
#include <vcl/msgbox.hxx>
@@ -60,7 +60,7 @@
#include <drawitem.hxx>
#include <numvset.hxx>
#include <htmlmode.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <svtools/ctrltool.hxx>
#include <unolingu.hxx>
#include <com/sun/star/style/NumberingType.hpp>
@@ -355,8 +355,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
sPrefixes[i].getStr()[0] != 0)
{
pVDev->SetFont(aFont);
- pVDev->DrawText(aLeft, sPrefixes[i]);
- aLeft.X() += pDev->GetTextWidth(sPrefixes[i]);
+ pVDev->DrawText(aLeft, sPrefixes[i]);
+ aLeft.X() += pDev->GetTextWidth(sPrefixes[i]);
}
if(aParentNumberings[i])
{
diff --git a/svx/source/dialog/svxbmpnumvalueset.src b/svx/source/dialog/svxbmpnumvalueset.src
new file mode 100644
index 0000000000..3b3bd90d25
--- /dev/null
+++ b/svx/source/dialog/svxbmpnumvalueset.src
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: numpages.src,v $
+ * $Revision: 1.64.242.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <svx/dialogs.hrc>
+
+String RID_SVXSTR_BULLET_DESCRIPTION_0
+{
+ Text [en-US] = "Solid small circular bullets";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_1
+{
+ Text [en-US] = "Solid large circular bullets";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_2
+{
+ Text [en-US] = "Solid diamond bullets";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_3
+{
+ Text [en-US] = "Solid large square bullets";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_4
+{
+ Text [en-US] = "Right pointing arrow bullets filled out";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_5
+{
+ Text [en-US] = "Right pointing arrow bullets";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_6
+{
+ Text [en-US] = "Check mark bullets";
+};
+String RID_SVXSTR_BULLET_DESCRIPTION_7
+{
+ Text [en-US] = "Tick mark bullets";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_0
+{
+ Text [en-US] = "Number 1) 2) 3)";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_1
+{
+ Text [en-US] = "Number 1. 2. 3.";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_2
+{
+ Text [en-US] = "Number (1) (2) (3)";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_3
+{
+ Text [en-US] = "Uppercase Roman number I. II. III.";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_4
+{
+ Text [en-US] = "Uppercase letter A) B) C)";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_5
+{
+ Text [en-US] = "Lowercase letter a) b) c)";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_6
+{
+ Text [en-US] = "Lowercase letter (a) (b) (c)";
+};
+String RID_SVXSTR_SINGLENUM_DESCRIPTION_7
+{
+ Text [en-US] = "Lowercase Roman number i. ii. iii.";
+};
+
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_0
+{
+ Text [en-US] = "Numeric, numeric, lowercase letters, solid small circular bullet";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_1
+{
+ Text [en-US] = "Numeric, lowercase letters, solid small circular bullet";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_2
+{
+ Text [en-US] = "Numeric, lowercase letters, lowercase Roman, uppercase letters, solid small circular bullet";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_3
+{
+ Text [en-US] = "Numeric";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_4
+{
+ Text [en-US] = "Uppercase Roman, uppercase letters, lowercase Roman, lowercase letters, solid small circular bullet";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_5
+{
+ Text [en-US] = "Uppercase letters, uppercase Roman, lowercase letters, lowercase Roman, solid small circular bullet";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_6
+{
+ Text [en-US] = "Numeric with all sublevels";
+};
+String RID_SVXSTR_OUTLINENUM_DESCRIPTION_7
+{
+ Text [en-US] = "Right pointing bullet, right pointing arrow bullet, solid diamond bullet, solid small circular bullet";
+};
+
diff --git a/svx/source/dialog/svxdlg.cxx b/svx/source/dialog/svxdlg.cxx
index dce467dc94..35271fed21 100644
--- a/svx/source/dialog/svxdlg.cxx
+++ b/svx/source/dialog/svxdlg.cxx
@@ -32,12 +32,13 @@
#include "precompiled_svx.hxx"
#include <svx/svxdlg.hxx>
-#include "cuilib.hxx"
-
-#include <osl/module.hxx>
-#include <tools/string.hxx>
SvxAbstractDialogFactory* SvxAbstractDialogFactory::Create()
{
return (SvxAbstractDialogFactory*) VclAbstractDialogFactory::Create();
}
+
+SvxAbstractDialogFactory::~SvxAbstractDialogFactory()
+{
+}
+
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 13d479b294..66c437c7ad 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -37,11 +37,11 @@
#include <limits.h>
#include <tools/shl.hxx>
#include <vcl/image.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/rectitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/rectitem.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
diff --git a/svx/source/dialog/thesdlg.cxx b/svx/source/dialog/thesdlg.cxx
index 78fb5fc85a..8e5170b6d6 100644
--- a/svx/source/dialog/thesdlg.cxx
+++ b/svx/source/dialog/thesdlg.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <tools/shl.hxx>
-#include <svtools/lngmisc.hxx>
+#include <svl/lngmisc.hxx>
#include <vcl/wrkwin.hxx>
#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
diff --git a/svx/source/editeng/SvXMLAutoCorrectExport.cxx b/svx/source/editeng/SvXMLAutoCorrectExport.cxx
index 460212a112..71bc790664 100644
--- a/svx/source/editeng/SvXMLAutoCorrectExport.cxx
+++ b/svx/source/editeng/SvXMLAutoCorrectExport.cxx
@@ -33,7 +33,7 @@
#include <SvXMLAutoCorrectExport.hxx>
#define _SVSTDARR_STRINGSISORTDTOR
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <xmloff/xmltoken.hxx>
using namespace ::com::sun::star::uno;
diff --git a/svx/source/editeng/SvXMLAutoCorrectImport.cxx b/svx/source/editeng/SvXMLAutoCorrectImport.cxx
index 692557307d..28b8f493dc 100644
--- a/svx/source/editeng/SvXMLAutoCorrectImport.cxx
+++ b/svx/source/editeng/SvXMLAutoCorrectImport.cxx
@@ -37,7 +37,7 @@
#define _SVSTDARR_STRINGSISORTDTOR
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <xmloff/xmltoken.hxx>
using namespace ::com::sun::star;
diff --git a/svx/source/editeng/acorrcfg.cxx b/svx/source/editeng/acorrcfg.cxx
index 0745a5e259..439691d4ca 100644
--- a/svx/source/editeng/acorrcfg.cxx
+++ b/svx/source/editeng/acorrcfg.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,8 +35,8 @@
#include <sfx2/app.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/urihelper.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svl/urihelper.hxx>
#include <svx/svxacorr.hxx>
#include <com/sun/star/uno/Any.hxx>
@@ -369,7 +369,7 @@ Sequence<OUString> SvxSwAutoCorrCfg::GetPropertyNames()
"Format/Option/ChangeToBullets/Enable", //15
"Format/Option/ChangeToBullets/SpecialCharacter/Char", //16
"Format/Option/ChangeToBullets/SpecialCharacter/Font", //17
- "Format/Option/ChangeToBullets/SpecialCharacter/FontFamily", //18
+ "Format/Option/ChangeToBullets/SpecialCharacter/FontFamily", //18
"Format/Option/ChangeToBullets/SpecialCharacter/FontCharset", //19
"Format/Option/ChangeToBullets/SpecialCharacter/FontPitch", //20
"Format/Option/ReplaceQuote", //21
diff --git a/svx/source/editeng/editattr.hxx b/svx/source/editeng/editattr.hxx
index a24b1697c3..818ae1f710 100644
--- a/svx/source/editeng/editattr.hxx
+++ b/svx/source/editeng/editattr.hxx
@@ -54,7 +54,7 @@ class SvxFieldItem;
class SvxLanguageItem;
class SvxEmphasisMarkItem;
class SvxCharReliefItem;
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
class SfxVoidItem;
diff --git a/svx/source/editeng/editdbg.hxx b/svx/source/editeng/editdbg.hxx
index eb4e7caf8b..78764a0c9a 100644
--- a/svx/source/editeng/editdbg.hxx
+++ b/svx/source/editeng/editdbg.hxx
@@ -31,7 +31,7 @@
#ifndef _EDITDBG_HXX
#define _EDITDBG_HXX
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#include <tools/string.hxx>
#include <stdio.h>
diff --git a/svx/source/editeng/editdoc.hxx b/svx/source/editeng/editdoc.hxx
index 90efe213b6..0828f9dc4e 100644
--- a/svx/source/editeng/editdoc.hxx
+++ b/svx/source/editeng/editdoc.hxx
@@ -38,9 +38,9 @@
#include <editattr.hxx>
#include <edtspell.hxx>
#include <svx/svxfont.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
+#include <svl/itempool.hxx>
#include <tools/table.hxx>
class ImpEditEngine;
diff --git a/svx/source/editeng/editdoc2.cxx b/svx/source/editeng/editdoc2.cxx
index e0d5fc27e9..4aba92347e 100644
--- a/svx/source/editeng/editdoc2.cxx
+++ b/svx/source/editeng/editdoc2.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <eeng_pch.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <tools/rtti.hxx>
#include <svx/lspcitem.hxx>
#include <svx/adjitem.hxx>
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index 77ae82fde0..67f8cb69ad 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -36,8 +36,8 @@
#define USE_SVXFONT
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
-#include <svtools/ctloptions.hxx>
+#include <svl/svstdarr.hxx>
+#include <svl/ctloptions.hxx>
#include <svtools/ctrltool.hxx>
#include <svx/svxfont.hxx>
@@ -1128,7 +1128,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
break;
default:
{
- #if (OSL_DEBUG_LEVEL > 1) && !defined( PRODUCT )
+ #if (OSL_DEBUG_LEVEL > 1) && defined(DBG_UTIL)
if ( ( nCode == KEY_W ) && rKeyEvent.GetKeyCode().IsMod1() && rKeyEvent.GetKeyCode().IsMod2() )
{
SfxItemSet aAttribs = pEditView->GetAttribs();
diff --git a/svx/source/editeng/editeng.hrc b/svx/source/editeng/editeng.hrc
index fa1fa19db7..f023ad546d 100644
--- a/svx/source/editeng/editeng.hrc
+++ b/svx/source/editeng/editeng.hrc
@@ -31,7 +31,7 @@
#define _EDITENG_HRC
#ifndef _SOLAR_HRC
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#endif
#define RID_EDITUNDO_DEL ( RID_EDIT_START + 0 )
diff --git a/svx/source/editeng/editobj.cxx b/svx/source/editeng/editobj.cxx
index d8f0a332b9..496106efb0 100644
--- a/svx/source/editeng/editobj.cxx
+++ b/svx/source/editeng/editobj.cxx
@@ -50,8 +50,8 @@
#include <svx/numitem.hxx>
#include <svx/brshitem.hxx>
#include <vcl/graph.hxx>
-#include <svtools/intitem.hxx>
-#include <vcl/fontcvt.hxx>
+#include <svl/intitem.hxx>
+#include <unotools/fontcvt.hxx>
#include <tools/tenccvt.hxx>
DBG_NAME( EE_EditTextObject )
diff --git a/svx/source/editeng/editobj2.hxx b/svx/source/editeng/editobj2.hxx
index b37ceabbd7..ab8d1c9347 100644
--- a/svx/source/editeng/editobj2.hxx
+++ b/svx/source/editeng/editobj2.hxx
@@ -34,7 +34,7 @@
#include <svx/editobj.hxx>
#include <editdoc.hxx>
-#include <vcl/fontcvt.hxx>
+#include <unotools/fontcvt.hxx>
class SfxStyleSheetPool;
diff --git a/svx/source/editeng/editview.cxx b/svx/source/editeng/editview.cxx
index 39cc8debaa..ff0928954e 100644
--- a/svx/source/editeng/editview.cxx
+++ b/svx/source/editeng/editview.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,13 +38,13 @@
#define _SOLAR__PRIVATE 1
#include <i18npool/mslangid.hxx>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
#include <svtools/ctrltool.hxx>
#include <sfx2/srchitem.hxx>
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <impedit.hxx>
#include <svx/editeng.hxx>
@@ -72,7 +72,7 @@
#include <linguistic/lngprops.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-#include <svtools/lingucfg.hxx>
+#include <unotools/lingucfg.hxx>
using ::rtl::OUString;
@@ -521,10 +521,10 @@ void EditView::RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs )
pImpEditView->DrawSelection();
PIMPEE->UndoActionStart( EDITUNDO_RESETATTRIBS );
EditSelection aSelection( pImpEditView->GetEditSelection() );
-
+
for (sal_uInt16 nWID = EE_ITEMS_START; nWID <= EE_ITEMS_END; ++nWID)
{
- bool bIsLang = EE_CHAR_LANGUAGE == nWID ||
+ bool bIsLang = EE_CHAR_LANGUAGE == nWID ||
EE_CHAR_LANGUAGE_CJK == nWID ||
EE_CHAR_LANGUAGE_CTL == nWID;
if (!bIsLang)
@@ -533,7 +533,7 @@ void EditView::RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs )
PIMPEE->UndoActionEnd( EDITUNDO_RESETATTRIBS );
PIMPEE->FormatAndUpdate( this );
-}
+}
void EditView::RemoveAttribs( sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich )
{
@@ -1439,7 +1439,7 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList )
{
USHORT nPortionEnd = aPortions.GetObject( nPos );
USHORT nPortionStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0;
-
+
if( (nPortionEnd < nBeginPos) || (nPortionStart > nEndPos) )
continue;
@@ -1494,7 +1494,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
nHeight = *pAry;
break;
}
- pAry++;
+ pAry++;
}
if( *pAry == 0 )
diff --git a/svx/source/editeng/edtspell.cxx b/svx/source/editeng/edtspell.cxx
index 2fb92641ef..09768f67bf 100644
--- a/svx/source/editeng/edtspell.cxx
+++ b/svx/source/editeng/edtspell.cxx
@@ -39,8 +39,8 @@
#include <edtspell.hxx>
#include <svx/flditem.hxx>
#include <fontitem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
#include <unolingu.hxx>
#include <linguistic/lngprops.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/svx/source/editeng/eehtml.hxx b/svx/source/editeng/eehtml.hxx
index 1396a89307..0399553998 100644
--- a/svx/source/editeng/eehtml.hxx
+++ b/svx/source/editeng/eehtml.hxx
@@ -31,7 +31,7 @@
#ifndef _EEHTML_HXX
#define _EEHTML_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <editdoc.hxx>
#include <sfx2/sfxhtml.hxx>
diff --git a/svx/source/editeng/eeobj.cxx b/svx/source/editeng/eeobj.cxx
index 4079f53348..8ab5389ee1 100644
--- a/svx/source/editeng/eeobj.cxx
+++ b/svx/source/editeng/eeobj.cxx
@@ -38,7 +38,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <svx/editeng.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
diff --git a/svx/source/editeng/eerdll.cxx b/svx/source/editeng/eerdll.cxx
index ce23a1e00e..0951d2c6e4 100644
--- a/svx/source/editeng/eerdll.cxx
+++ b/svx/source/editeng/eerdll.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#include <eerdll.hxx>
#include <eerdll2.hxx>
#include <svx/lspcitem.hxx>
@@ -46,7 +46,7 @@
#include <svx/flditem.hxx>
#include <svx/emphitem.hxx>
#include <svx/scriptspaceitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
diff --git a/svx/source/editeng/eertfpar.cxx b/svx/source/editeng/eertfpar.cxx
index 65c1b6c516..39100e88ab 100644
--- a/svx/source/editeng/eertfpar.cxx
+++ b/svx/source/editeng/eertfpar.cxx
@@ -35,7 +35,7 @@
#include <eertfpar.hxx>
#include <impedit.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <svx/escpitem.hxx>
#include <svx/fhgtitem.hxx>
#include "fontitem.hxx"
diff --git a/svx/source/editeng/impedit.cxx b/svx/source/editeng/impedit.cxx
index 51dff075be..cc5e08e5f7 100644
--- a/svx/source/editeng/impedit.cxx
+++ b/svx/source/editeng/impedit.cxx
@@ -57,7 +57,7 @@
#include <vos/mutex.hxx>
#include <svx/flditem.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <svtools/transfer.hxx>
#include <sot/exchange.hxx>
diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx
index adf6afb7c2..39cbb85a8e 100644
--- a/svx/source/editeng/impedit.hxx
+++ b/svx/source/editeng/impedit.hxx
@@ -42,7 +42,7 @@
#include <vcl/cursor.hxx>
#include <vcl/dndhelp.hxx>
-#include <svtools/ondemand.hxx>
+#include <svl/ondemand.hxx>
#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
#include <com/sun/star/linguistic2/SpellFailure.hpp>
#include <com/sun/star/linguistic2/XSpellChecker.hpp>
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 6be5fc0ef0..769a5c7ca0 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -44,9 +44,9 @@
#include <edtspell.hxx>
#include <eeobj.hxx>
#include <txtrange.hxx>
-#include <svtools/urlbmk.hxx>
+#include <svl/urlbmk.hxx>
#include <svtools/colorcfg.hxx>
-#include <svtools/ctloptions.hxx>
+#include <svl/ctloptions.hxx>
#include <acorrcfg.hxx>
#include <svx/fhgtitem.hxx>
diff --git a/svx/source/editeng/impedit3.cxx b/svx/source/editeng/impedit3.cxx
index 8316d9a94f..a51824ec34 100644
--- a/svx/source/editeng/impedit3.cxx
+++ b/svx/source/editeng/impedit3.cxx
@@ -36,7 +36,7 @@
#include <vcl/gdimtf.hxx>
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#ifndef _WRKWIN_HXX //autogen
#include <vcl/wrkwin.hxx>
@@ -68,7 +68,7 @@
#include <svx/numitem.hxx>
#include <svtools/colorcfg.hxx>
-#include <svtools/ctloptions.hxx>
+#include <svl/ctloptions.hxx>
#include <forbiddencharacterstable.hxx>
diff --git a/svx/source/editeng/impedit5.cxx b/svx/source/editeng/impedit5.cxx
index fde4e22e8c..02535744fe 100644
--- a/svx/source/editeng/impedit5.cxx
+++ b/svx/source/editeng/impedit5.cxx
@@ -37,7 +37,7 @@
#include <svx/editeng.hxx>
#include <editdbg.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <svx/lrspitem.hxx>
diff --git a/svx/source/editeng/svxacorr.cxx b/svx/source/editeng/svxacorr.cxx
index b7861e9154..3169b34cb2 100644
--- a/svx/source/editeng/svxacorr.cxx
+++ b/svx/source/editeng/svxacorr.cxx
@@ -50,13 +50,13 @@
// fuer die Sort-String-Arrays aus dem SVMEM.HXX
#define _SVSTDARR_STRINGSISORTDTOR
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#ifndef SVTOOLS_FSTATHELPER_HXX
-#include <svtools/fstathelper.hxx>
+#include <svl/fstathelper.hxx>
#endif
#include <svtools/helpopt.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <unotools/charclass.hxx>
#ifndef _COM_SUN_STAR_I18N_UNICODETYPE_HDL_
#include <com/sun/star/i18n/UnicodeType.hdl>
@@ -1354,10 +1354,6 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
else if( nRet & ChgOrdinalNumber) nHelpId = 22;
}
- DBG_ASSERT( nHelpId && nHelpId < (HID_AUTOCORR_HELP_END -
- HID_AUTOCORR_HELP_START + 1),
- "wrong HelpId Range" );
-
if( nHelpId )
{
nHelpId += HID_AUTOCORR_HELP_START - 1;
@@ -1385,7 +1381,7 @@ void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang )
if( pLists )
pLists->SaveCplSttExceptList();
}
-#ifndef PRODUCT
+#ifdef DBG_UTIL
else
{
DBG_ERROR("speichern einer leeren Liste?");
@@ -1401,7 +1397,7 @@ void SvxAutoCorrect::SaveWrdSttExceptList(LanguageType eLang)
if(pLists)
pLists->SaveWrdSttExceptList();
}
-#ifndef PRODUCT
+#ifdef DBG_UTIL
else
{
DBG_ERROR("speichern einer leeren Liste?");
diff --git a/svx/source/editeng/txtrange.cxx b/svx/source/editeng/txtrange.cxx
index f79c3530f6..6ddbda37d2 100644
--- a/svx/source/editeng/txtrange.cxx
+++ b/svx/source/editeng/txtrange.cxx
@@ -67,7 +67,7 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const baseg
bInner( bInnr ),
bVertical( bVert )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bFlag3 = bFlag4 = bFlag5 = bFlag6 = bFlag7 = FALSE;
#endif
pRangeArr = new Range[ nCacheSize ];
diff --git a/svx/source/editeng/unolingu.cxx b/svx/source/editeng/unolingu.cxx
index d6a2d2d96e..65d5c3b0c2 100644
--- a/svx/source/editeng/unolingu.cxx
+++ b/svx/source/editeng/unolingu.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,7 +40,7 @@
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <rtl/logfile.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -57,7 +57,7 @@
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx> // helper for implementations
#include <i18npool/mslangid.hxx>
-#include <svtools/lingucfg.hxx>
+#include <unotools/lingucfg.hxx>
#include <unotools/ucbhelper.hxx>
#include <unotools/localfilehelper.hxx>
#include <ucbhelper/commandenvironment.hxx>
@@ -422,7 +422,7 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck )
// In OOo 3.0 we will not need the respective code anymore at all.
// aAny <<= nCurrentDataFilesChangedCheckValue;
aAny <<= (INT32) -1; // keep the value set to 'need to check'
-
+
aCfg.SetProperty( A2OU( "DataFilesChangedCheckValue" ), aAny );
//! Note 1: the new values are commited when the 'aCfg' object
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 02a0cf267b..fd3028493d 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -33,7 +33,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/module.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <svtools/colrdlg.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/viewsh.hxx>
@@ -50,7 +50,7 @@
#include <svx/fmpage.hxx>
#include <svx/polysc3d.hxx>
#include <svx/eeitem.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <dlgutil.hxx>
@@ -65,7 +65,7 @@
#include <gallery.hxx>
#define GALLERY_THEME "3D"
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svx/float3d.hxx>
#include "float3d.hrc"
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 85c35f03cb..d7274e3cb0 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -52,7 +52,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <svx/xlnclit.hxx>
-#include <svtools/metitem.hxx>
+#include <svl/metitem.hxx>
#include <svx/xtable.hxx>
#include <svx/xfillit.hxx>
#include <svx/xlnwtit.hxx>
@@ -68,7 +68,7 @@
#include <vcl/gradient.hxx>
#include <vcl/metaact.hxx>
#include <svx/svx3ditems.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svtools/colorcfg.hxx>
#include <svx/eeitem.hxx>
#include <svx/xgrscit.hxx>
diff --git a/svx/source/engine3d/polysc3d.cxx b/svx/source/engine3d/polysc3d.cxx
index f43e372e34..cd6ee50e8d 100644
--- a/svx/source/engine3d/polysc3d.cxx
+++ b/svx/source/engine3d/polysc3d.cxx
@@ -39,11 +39,11 @@
#include <vcl/svapp.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpool.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include "globl3d.hxx"
#include <svx/polysc3d.hxx>
#include <svx/xlnclit.hxx>
-#include <svtools/metitem.hxx>
+#include <svl/metitem.hxx>
#include <svx/xtable.hxx>
#include <svx/xlnwtit.hxx>
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 5079f527bc..05de87c705 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -40,7 +40,7 @@
#endif
#include "globl3d.hxx"
#include <svx/svdpage.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svx/scene3d.hxx>
#include <svx/e3dundo.hxx>
#include <svx/svdtrans.hxx>
@@ -50,7 +50,7 @@
#include <svx/xlntrit.hxx>
#include <svx/xfltrit.hxx>
#include <svx/svx3ditems.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svx/xflftrit.hxx>
#include <svx/sdr/properties/e3dsceneproperties.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index aee39a7f10..fc05f258ab 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -70,7 +70,7 @@
#ifndef _SVSTDARR_STRINGSDTOR
#define _SVSTDARR_STRINGSDTOR
#define _SVSTDARR_ULONGS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
#include <comphelper/extract.hxx>
@@ -80,9 +80,9 @@
#include <connectivity/dbtools.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <svtools/fmtfield.hxx>
-#include <svtools/numuno.hxx>
+#include <svl/numuno.hxx>
#include <tools/multisel.hxx>
#include <tools/shl.hxx>
#include <tools/diagnose_ex.h>
@@ -892,7 +892,7 @@ void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMe
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractFmShowColsDialog* pDlg = pFact->CreateFmShowColsDialog(NULL, RID_SVX_DLG_SHOWGRIDCOLUMNS);
+ AbstractFmShowColsDialog* pDlg = pFact->CreateFmShowColsDialog(NULL);
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
pDlg->SetColumns(xCols);
pDlg->Execute();
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 649a9f4fa1..713ec5d5d5 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -34,7 +34,7 @@
#include "fmgridif.hxx"
#include "fmprop.hrc"
#include "fmservs.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmurl.hxx"
#include "formcontrolfactory.hxx"
#include "gridcell.hxx"
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 9d8bbdd0fc..61ca01628c 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -34,7 +34,7 @@
#include "fmprop.hrc"
#include "fmresids.hrc"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "gridcell.hxx"
#include "gridcols.hxx"
#include "sdbdatacolumn.hxx"
@@ -66,7 +66,7 @@
#include <rtl/math.hxx>
#include <svtools/calendar.hxx>
#include <svtools/fmtfield.hxx>
-#include <svtools/numuno.hxx>
+#include <svl/numuno.hxx>
#include <svtools/svmedit.hxx>
#include <svx/dialmgr.hxx>
#include <toolkit/helper/vclunohelper.hxx>
diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx
index 561be8ab69..f954068d4d 100644
--- a/svx/source/fmcomp/gridcols.cxx
+++ b/svx/source/fmcomp/gridcols.cxx
@@ -34,7 +34,7 @@
#include <tools/debug.hxx>
#include <comphelper/types.hxx>
#include "fmservs.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
//------------------------------------------------------------------------------
const ::comphelper::StringSequence& getColumnTypes()
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index bbd3358d58..14b1ce554c 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -37,7 +37,7 @@
#include <svx/gridctrl.hxx>
#include "gridcell.hxx"
#include "svx/dbtoolsclient.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include <svtools/stringtransfer.hxx>
#ifndef _SVX_FMPROP_HRC
diff --git a/svx/source/fmcomp/makefile.mk b/svx/source/fmcomp/makefile.mk
index 1e86308f9c..1f3afe2427 100644
--- a/svx/source/fmcomp/makefile.mk
+++ b/svx/source/fmcomp/makefile.mk
@@ -46,8 +46,7 @@ ENABLE_EXCEPTIONS=TRUE
SRS1NAME=fmcomp
SRC1FILES= \
- gridctrl.src \
- showcols.src
+ gridctrl.src
LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
LIB1OBJFILES= \
diff --git a/svx/source/fmcomp/showcols.src b/svx/source/fmcomp/showcols.src
deleted file mode 100644
index 7f2be7ac3e..0000000000
--- a/svx/source/fmcomp/showcols.src
+++ /dev/null
@@ -1,106 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: showcols.src,v $
- * $Revision: 1.28 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "fmresids.hrc"
-#include <svx/svxids.hrc>
-#include "globlmn.hrc"
-
-ModalDialog RID_SVX_DLG_SHOWGRIDCOLUMNS
-{
- OutputSize = TRUE;
- SVLook = TRUE ;
- Size = MAP_APPFONT( 200, 117 );
- Moveable = TRUE;
- Closeable = TRUE;
-
- FixedText 1
- {
- Pos = MAP_APPFONT( 6, 6 );
- Size = MAP_APPFONT( 188, 30 );
- WordBreak = TRUE;
- Text [ en-US ] = "The following columns are currently hidden. Please mark the fields you want to show and choose OK.";
- };
-
- ListBox 1
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 6, 39 );
- Size = MAP_APPFONT( 188, 55 );
- TabStop = TRUE;
- DropDown = FALSE;
- AutoHScroll = TRUE;
- VScroll = TRUE;
- };
-
- OKButton 1
- {
- Pos = MAP_APPFONT( 6, 97 );
- Size = MAP_APPFONT( 50, 14 );
- TabStop = TRUE;
- DefButton = TRUE ;
- };
-
- CancelButton 1
- {
- Pos = MAP_APPFONT( 144, 97 );
- Size = MAP_APPFONT( 50, 14 );
- TabStop = TRUE;
- };
- Text [ en-US ] = "Show columns";
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 2723e11ddc..f38c341847 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -37,7 +37,7 @@
#include <svx/dialmgr.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <vcl/svapp.hxx>
#include <tools/debug.hxx>
#include <vos/mutex.hxx>
diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx
index b7d117b3de..215e74d72f 100644
--- a/svx/source/form/databaselocationinput.cxx
+++ b/svx/source/form/databaselocationinput.cxx
@@ -45,7 +45,7 @@
#include <rtl/ustrbuf.hxx>
#include <sfx2/filedlghelper.hxx>
#include <svtools/urlcontrol.hxx>
-#include <svtools/filenotation.hxx>
+#include <svl/filenotation.hxx>
#include <tools/diagnose_ex.h>
#include <unotools/confignode.hxx>
#include <unotools/ucbhelper.hxx>
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index c56b4b77f6..c54c9f8e65 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -44,9 +44,9 @@
#include <svx/dialmgr.hxx>
#include <svx/fmshell.hxx>
#include <svtools/miscopt.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/viewoptions.hxx>
-#include <svtools/svtools.hrc>
+#include <unotools/pathoptions.hxx>
+#include <unotools/viewoptions.hxx>
+#include <svl/svtools.hrc>
#include <sfx2/app.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/objitem.hxx>
@@ -816,8 +816,8 @@ namespace svxform
// create a resource manager, for the svx resource file
// and the UI locale
ByteString aResourceFile( "svx" );
- ResMgr* pResMgr = ResMgr::CreateResMgr(
- aResourceFile.GetBuffer(),
+ ResMgr* pResMgr = ResMgr::CreateResMgr(
+ aResourceFile.GetBuffer(),
Application::GetSettings().GetUILocale() );
// load the resources for the AddSubmission modal dialog.
@@ -833,7 +833,7 @@ namespace svxform
// clean up: remove context, and delete the resource manager
// ( Increment(..) is needed since PopContext() requires that
// the file pointer is at the end. )
- pResMgr->Increment( pResMgr->GetRemainSize() );
+ pResMgr->Increment( pResMgr->GetRemainSize() );
pResMgr->PopContext();
delete pResMgr;
}
@@ -1608,10 +1608,10 @@ namespace svxform
ActivatePageHdl( &m_aTabCtrl );
// get our frame
- DBG_ASSERT( pBindings != NULL,
+ DBG_ASSERT( pBindings != NULL,
"DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" );
- m_xFrame = Reference<XFrame>(
- pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(),
+ m_xFrame = Reference<XFrame>(
+ pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(),
UNO_QUERY );
DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" );
// add frameaction listener
@@ -3566,13 +3566,13 @@ namespace svxform
}
}
- // #i36342# we need a temporary binding; create one if no existing binding
+ // #i36342# we need a temporary binding; create one if no existing binding
// is found
if( !m_xTempBinding.is() )
{
- m_xCreatedBinding = m_xUIHelper->getBindingForNode(
- Reference<css::xml::dom::XNode>(
- xModel->getDefaultInstance()->getDocumentElement(),
+ m_xCreatedBinding = m_xUIHelper->getBindingForNode(
+ Reference<css::xml::dom::XNode>(
+ xModel->getDefaultInstance()->getDocumentElement(),
UNO_QUERY_THROW ),
sal_True );
m_xTempBinding = m_xCreatedBinding;
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 9c5ddf8280..c37eb0d5c4 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -64,7 +64,7 @@
#include <svx/fmshell.hxx>
#include <fmshimp.hxx>
#include <fmservs.hxx>
-#include <fmtools.hxx>
+#include <svx/fmtools.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/property.hxx>
#include <comphelper/uno3.hxx>
diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx
index 081540aa1b..bc11294a31 100644
--- a/svx/source/form/fmcontrollayout.cxx
+++ b/svx/source/form/fmcontrollayout.cxx
@@ -47,7 +47,8 @@
#include <comphelper/processfactory.hxx>
#include <i18npool/mslangid.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
+
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
diff --git a/svx/source/form/fmctrler.cxx b/svx/source/form/fmctrler.cxx
index 5f6c07ce7c..21b905566d 100644
--- a/svx/source/form/fmctrler.cxx
+++ b/svx/source/form/fmctrler.cxx
@@ -41,7 +41,7 @@
#include "fmresids.hrc"
#include "fmservs.hxx"
#include "fmshimp.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmurl.hxx"
#include "svx/dialmgr.hxx"
#include "svx/fmshell.hxx"
diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx
index 55d92e07a0..e511a2e0ba 100644
--- a/svx/source/form/fmexch.cxx
+++ b/svx/source/form/fmexch.cxx
@@ -33,7 +33,7 @@
#include "fmexch.hxx"
#include <sot/storage.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#ifndef _SVX_DBEXCH_HRC
#include <dbexch.hrc>
@@ -43,7 +43,7 @@
#include <tools/diagnose_ex.h>
#define _SVSTDARR_ULONGS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
//........................................................................
namespace svxform
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 558f23b2a8..106f081418 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -45,7 +45,7 @@
#include <com/sun/star/awt/XControlContainer.hpp>
/** === end UNO includes === **/
#include <svx/fmmodel.hxx>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include <tools/shl.hxx>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx
index cbbeaae4c5..dac0daaf8f 100644
--- a/svx/source/form/fmobjfac.cxx
+++ b/svx/source/form/fmobjfac.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <comphelper/stl_types.hxx>
#include <svx/svdobj.hxx>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmservs.hxx"
#ifndef _FM_FMOBJFAC_HXX
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 6062e99859..691b141c40 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -78,7 +78,7 @@
#include "fmprop.hrc"
#endif
#include "fmundo.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
using namespace ::svxform;
#endif
#include <comphelper/property.hxx>
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index 9da374d24d..d0b5a295de 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -34,7 +34,7 @@
#include "svxerr.hxx"
#include "fmpgeimp.hxx"
#include "fmundo.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmprop.hrc"
#include "fmservs.hxx"
#include "fmobj.hxx"
diff --git a/svx/source/form/fmsearch.src b/svx/source/form/fmsearch.src
deleted file mode 100644
index 63a175e04b..0000000000
--- a/svx/source/form/fmsearch.src
+++ /dev/null
@@ -1,333 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fmsearch.src,v $
- * $Revision: 1.59 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "fmresids.hrc"
-#include "fmsearch.hrc"
-#include "fmhelp.hrc"
-
-ModalDialog RID_SVXDLG_SEARCHFORM
-{
- OutputSize = TRUE;
- SVLook = TRUE;
- Size = MAP_APPFONT( 300, 253 );
- Text [ en-US ] = "Record Search";
- Moveable = TRUE;
- HelpId = HID_FM_DLG_SEARCH;
-
- FixedLine FL_SEARCHFOR
- {
- Pos = MAP_APPFONT( 6, 8 );
- Size = MAP_APPFONT( 232, 8 );
- Text [ en-US ] = "Search for";
- };
- RadioButton RB_SEARCHFORTEXT
- {
- Pos = MAP_APPFONT( 12, 23 );
- Size = MAP_APPFONT( 50, 10 );
- Group = TRUE;
- Text [ en-US ] = "~Text";
- };
- RadioButton RB_SEARCHFORNULL
- {
- Pos = MAP_APPFONT( 12, 36 );
- Size = MAP_APPFONT( 207, 10 );
- Text [ en-US ] = "Field content is ~NULL";
- };
- RadioButton RB_SEARCHFORNOTNULL
- {
- Pos = MAP_APPFONT( 12, 49 );
- Size = MAP_APPFONT( 207, 10 );
- Text [ en-US ] = "Field content is not NU~LL";
- };
- ComboBox CMB_SEARCHTEXT
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 65, 20 );
- Size = MAP_APPFONT( 154, 80 );
- DropDown = TRUE;
- TabStop = TRUE;
- HelpId = HID_SEARCH_TEXT;
- };
-
- FixedLine FL_WHERE
- {
- Pos = MAP_APPFONT( 6, 65 );
- Size = MAP_APPFONT( 232, 8 );
- Text [ en-US ] = "Where to search";
- };
- FixedText FT_FORM
- {
- Pos = MAP_APPFONT( 12, 77 );
- Size = MAP_APPFONT( 87, 10 );
- Text [ en-US ] = "Form";
- };
- ListBox LB_FORM
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 110, 76 );
- Size = MAP_APPFONT( 109, 60 );
- TabStop = TRUE;
- DropDown = TRUE;
- };
- RadioButton RB_ALLFIELDS
- {
- Pos = MAP_APPFONT( 24, 91 );
- Size = MAP_APPFONT( 75, 10 );
- TabStop = TRUE;
- HelpId = HID_SEARCH_ALLFIELDS;
- Text [ en-US ] = "All Fields";
- };
- RadioButton RB_SINGLEFIELD
- {
- Pos = MAP_APPFONT( 24, 106 );
- Size = MAP_APPFONT( 75, 10 );
- Text [ en-US ] = "Single field";
- };
- ListBox LB_FIELD
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 110, 105 );
- Size = MAP_APPFONT( 109, 60 );
- TabStop = TRUE;
- DropDown = TRUE;
- HelpId = HID_SEARCH_FIELDSELECTION;
- };
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT( 6, 126 );
- Size = MAP_APPFONT( 288, 8 );
- Text [ en-US ] = "Settings";
- };
- FixedText FT_POSITION
- {
- Pos = MAP_APPFONT( 12, 138 );
- Size = MAP_APPFONT( 87, 8 );
- Text [ en-US ] = "Position";
- };
- ListBox LB_POSITION
- {
- Border = TRUE;
- Pos = MAP_APPFONT( 110, 136 );
- Size = MAP_APPFONT( 109, 60 );
- TabStop = TRUE;
- DropDown = TRUE;
- HelpId = HID_SEARCH_POSITION;
- };
- CheckBox CB_USEFORMATTER
- {
- Pos = MAP_APPFONT( 12, 158 );
- Size = MAP_APPFONT( 90, 10 );
- TabStop = TRUE;
- HelpId = HID_SEARCH_FORMATTER;
- Text [ en-US ] = "Apply field format";
- };
- CheckBox CB_CASE
- {
- Pos = MAP_APPFONT( 12, 171 );
- Size = MAP_APPFONT( 90, 20 );
- TabStop = TRUE;
- WordBreak = TRUE;
- HelpId = HID_SEARCH_CASE;
- Text [ en-US ] = "Match case";
- };
- CheckBox CB_BACKWARD
- {
- Pos = MAP_APPFONT( 105, 158 );
- Size = MAP_APPFONT( 85, 10 );
- TabStop = TRUE;
- HelpId = HID_SEARCH_BACKWARD;
- Text [ en-US ] = "Search backwards";
- };
- CheckBox CB_STARTOVER
- {
- Pos = MAP_APPFONT( 105, 171 );
- Size = MAP_APPFONT( 85, 10 );
- TabStop = TRUE;
- HelpId = HID_SEARCH_STARTOVER;
- Text [ en-US ] = "From Beginning";
- };
- CheckBox CB_WILDCARD
- {
- Pos = MAP_APPFONT( 190, 158 );
- Size = MAP_APPFONT( 100, 10 );
- TabStop = TRUE;
- HelpId = HID_SEARCH_WILDCARD;
- Text [ en-US ] = "Wildcard expression";
- };
- CheckBox CB_REGULAR
- {
- Pos = MAP_APPFONT( 190, 171 );
- Size = MAP_APPFONT( 100, 10 );
- TabStop = TRUE;
- HelpId = HID_SEARCH_REGULAR;
- Text [ en-US ] = "Regular expression";
- };
- CheckBox CB_APPROX
- {
- Pos = MAP_APPFONT( 190, 184 );
- Size = MAP_APPFONT( 84, 20 );
- TabStop = TRUE;
- WordBreak = TRUE;
- HelpId = HID_SEARCH_APPROX;
- Text [ en-US ] = "Similarity Search";
- };
- PushButton PB_APPROXSETTINGS
- {
- Pos = MAP_APPFONT( 275, 182 );
- Size = MAP_APPFONT( 14, 14 );
- TabStop = TRUE ;
- HelpId = HID_SEARCH_APPROXSETTINGS;
- Text [ en-US ] = "...";
- };
- CheckBox CB_HALFFULLFORMS
- {
- Pos = MAP_APPFONT( 105, 209 );
- Size = MAP_APPFONT( 85, 10 );
- TabStop = TRUE ;
- Text [ en-US ] = "Match character width" ;
- };
- CheckBox CB_SOUNDSLIKECJK
- {
- Pos = MAP_APPFONT( 190, 209 );
- Size = MAP_APPFONT( 84, 10 );
- TabStop = TRUE ;
- Text [ en-US ] = "Sounds like (Japanese)";
- };
- PushButton PB_SOUNDSLIKESETTINGS
- {
- Pos = MAP_APPFONT( 275, 207 );
- Size = MAP_APPFONT( 14, 14 );
- TabStop = TRUE ;
- Text [ en-US ] = "..." ;
- };
- FixedLine FL_STATE
- {
- Pos = MAP_APPFONT( 6, 222 );
- Size = MAP_APPFONT( 288, 8 );
- Text [ en-US ] = "State";
- };
- FixedText FT_RECORDLABEL
- {
- Pos = MAP_APPFONT( 12, 232 );
- Size = MAP_APPFONT( 45, 10 );
- Text [ en-US ] = "Record :";
- };
- FixedText FT_RECORD
- {
- Pos = MAP_APPFONT( 60, 232 );
- Size = MAP_APPFONT( 30, 10 );
- UniqueId = UID_SEARCH_RECORDSTATUS;
- };
- FixedText FT_HINT
- {
- Pos = MAP_APPFONT( 99, 232 );
- Size = MAP_APPFONT( 190, 10 );
- };
- PushButton PB_SEARCH
- {
- Pos = MAP_APPFONT( 244, 6 );
- Size = MAP_APPFONT( 50, 14 );
- TabStop = TRUE;
- DefButton = TRUE;
- HelpId = HID_SEARCH_BTN_SEARCH;
- Text [ en-US ] = "Search";
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT( 244, 26 );
- Size = MAP_APPFONT( 50, 14 );
- HelpId = HID_SEARCH_BTN_CLOSE;
- TabStop = TRUE;
- Text [ en-US ] = "~Close";
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT( 244, 46 );
- Size = MAP_APPFONT( 50, 14 );
- TabStop = TRUE;
- Text [ en-US ] = "~Help";
- };
-};
-
-String RID_STR_SEARCH_ANYWHERE
-{
- Text [ en-US ] = "anywhere in the field";
-};
-
-String RID_STR_SEARCH_BEGINNING
-{
- Text [ en-US ] = "beginning of field";
-};
-
-String RID_STR_SEARCH_END
-{
- Text [ en-US ] = "end of field";
-};
-
-String RID_STR_SEARCH_WHOLE
-{
- Text [ en-US ] = "entire field";
-};
-
-String RID_STR_FROM_TOP
-{
- Text [ en-US ] = "From top";
-};
-String RID_STR_FROM_BOTTOM
-{
- Text [ en-US ] = "From bottom";
-};
-
-ErrorBox RID_SVXERR_SEARCH_NORECORD
-{
- Buttons = WB_OK;
- Message [ en-US ] = "No records corresponding to your data found.";
-};
-
-ErrorBox RID_SVXERR_SEARCH_GENERAL_ERROR
-{
- Buttons = WB_OK;
- Message [ en-US ] = "An unknown error occurred. The search could not be finished.";
-};
-
-String RID_STR_OVERFLOW_FORWARD
-{
- Text [ en-US ] = "Overflow, search continued at the beginning";
-};
-
-String RID_STR_OVERFLOW_BACKWARD
-{
- Text [ en-US ] = "Overflow, search continued at the end";
-};
-
-String RID_STR_SEARCH_COUNTING
-{
- Text [ en-US ] = "counting records";
-};
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index 7ae8d6a811..00ffaeef47 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include "fmvwimp.hxx"
#include <svx/fmshell.hxx>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmservs.hxx"
#ifndef _SVX_FMPROP_HRC
#include "fmprop.hrc"
@@ -56,11 +56,11 @@
#include <sfx2/viewfrm.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <sfx2/app.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/visitem.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <svl/intitem.hxx>
+#include <svl/visitem.hxx>
+#include <unotools/moduleoptions.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
@@ -79,7 +79,7 @@
#endif
#include "fmexch.hxx"
#include <svx/fmglob.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <tools/shl.hxx>
#include <svx/svdpage.hxx>
#include <svx/fmmodel.hxx>
@@ -91,7 +91,7 @@
#include <vcl/sound.hxx>
#include "fmexpl.hxx"
#include "formcontrolling.hxx"
-#include <svtools/numuno.hxx>
+#include <svl/numuno.hxx>
#include <connectivity/dbtools.hxx>
#include <comphelper/types.hxx>
#include <comphelper/processfactory.hxx>
@@ -795,7 +795,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
DBG_ASSERT( pFact, "no dialog factory!" );
if ( pFact )
{
- ::std::auto_ptr< AbstractFmInputRecordNoDialog > dlg( pFact->CreateFmInputRecordNoDialog( NULL, RID_SVX_DLG_INPUTRECORDNO ) );
+ ::std::auto_ptr< AbstractFmInputRecordNoDialog > dlg( pFact->CreateFmInputRecordNoDialog( NULL ) );
DBG_ASSERT( dlg.get(), "Dialogdiet fail!" );
dlg->SetValue( rController->getCursor()->getRow() );
if ( dlg->Execute() == RET_OK )
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 801e3f613f..4b0c10e81d 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -48,7 +48,7 @@
#include "svditer.hxx"
#include "fmservs.hxx"
#include "fmpgeimp.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#ifndef _SVX_FMPROP_HRC
#include "fmprop.hrc"
#endif
@@ -3919,6 +3919,10 @@ void FmXFormShell::Notify( const com::sun::star::uno::Sequence< rtl::OUString >&
}
}
+void FmXFormShell::Commit()
+{
+}
+
//------------------------------------------------------------------------
void FmXFormShell::SetWizardUsing(sal_Bool _bUseThem)
{
diff --git a/svx/source/form/fmsrccfg.cxx b/svx/source/form/fmsrccfg.cxx
index 58ad4d641e..c986ba991c 100644
--- a/svx/source/form/fmsrccfg.cxx
+++ b/svx/source/form/fmsrccfg.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include "fmsrccfg.hxx"
-#include <svtools/filerec.hxx>
+#include <svl/filerec.hxx>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <comphelper/processfactory.hxx>
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 66acca4748..56e55cc127 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -34,7 +34,7 @@
#ifndef _SVX_FMRESIDS_HRC
#include "fmresids.hrc"
#endif
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmsrccfg.hxx"
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
@@ -69,11 +69,8 @@
#include "fmsrcimp.hxx"
#include <svx/fmsearch.hxx>
-#ifndef _FMSEARCH_HRC
-#include "fmsearch.hrc"
-#endif
#include <comphelper/numbers.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#define EQUAL_BOOKMARKS(a, b) a == b
diff --git a/svx/source/form/fmtextcontroldialogs.cxx b/svx/source/form/fmtextcontroldialogs.cxx
index 15a843ee88..32a245120f 100644
--- a/svx/source/form/fmtextcontroldialogs.cxx
+++ b/svx/source/form/fmtextcontroldialogs.cxx
@@ -48,10 +48,10 @@
#endif
#include "flagsdef.hxx"
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#include <svtools/cjkoptions.hxx>
+#include <svl/cjkoptions.hxx>
//........................................................................
namespace svx
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 0c7a416c4b..2506e05cca 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -66,12 +66,12 @@
#include <sfx2/request.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/languageoptions.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itempool.hxx>
+#include <svl/languageoptions.hxx>
#include <svtools/stringtransfer.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 6f3c9f5a75..84ebf215b1 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/sdb/XCompletedConnection.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/lang/Locale.hpp>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "svx/dbtoolsclient.hxx"
#include "fmservs.hxx"
#include <svx/fmglob.hxx>
@@ -91,8 +91,8 @@
#include "fmprop.hrc"
#endif
#include <sfx2/bindings.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <cppuhelper/servicefactory.hxx>
#include <comphelper/types.hxx>
#include <comphelper/property.hxx>
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 2fc7022f73..67fcd479e4 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -47,7 +47,7 @@
#ifndef _FM_FMMODEL_HXX
#include <svx/fmmodel.hxx>
#endif
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include <svx/fmpage.hxx>
#ifndef _SVX_FMRESIDS_HRC
#include "fmresids.hrc"
@@ -56,7 +56,7 @@
#include <svx/dialmgr.hxx>
#include "fmpgeimp.hxx"
#include "svx/dbtoolsclient.hxx"
-#include <svtools/macitem.hxx>
+#include <svl/macitem.hxx>
#include <tools/shl.hxx>
#include <tools/diagnose_ex.h>
#include <sfx2/objsh.hxx>
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 26a5ecd7dd..fe907447e2 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,7 +35,7 @@
#undef REFERENCE
#endif
#include <svtools/ehdl.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <com/sun/star/sdb/SQLContext.hpp>
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
@@ -61,7 +61,7 @@
#include <svx/fmpage.hxx>
#include <svx/fmshell.hxx>
#include "fmpgeimp.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmshimp.hxx"
#include "fmservs.hxx"
#include "fmprop.hrc"
@@ -477,7 +477,7 @@ void FmFormView::InsertControlContainer(const Reference< ::com::sun::star::awt::
for( sal_uInt32 i = 0L; i < pPageView->PageWindowCount(); i++ )
{
const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(i);
-
+
if( rPageWindow.GetControlContainer( false ) == xCC )
{
pImpl->addWindow(rPageWindow);
@@ -517,15 +517,15 @@ BOOL FmFormView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
{
BOOL bDone = FALSE;
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
- if ( IsDesignMode()
+ if ( IsDesignMode()
&& rKeyCode.GetCode() == KEY_RETURN
)
{
// RETURN alone enters grid controls, for keyboard accessibility
- if ( pWin
- && !rKeyCode.IsShift()
- && !rKeyCode.IsMod1()
- && !rKeyCode.IsMod2()
+ if ( pWin
+ && !rKeyCode.IsShift()
+ && !rKeyCode.IsMod1()
+ && !rKeyCode.IsMod2()
)
{
FmFormObj* pObj = getMarkedGrid();
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 4f088e4263..3f08ba47e0 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,7 +39,7 @@
#include "fmresids.hrc"
#include "fmservs.hxx"
#include "fmshimp.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmundo.hxx"
#include "fmvwimp.hxx"
#include "formcontrolfactory.hxx"
@@ -90,7 +90,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/numbers.hxx>
#include <comphelper/property.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
#include <vcl/stdtext.hxx>
@@ -1006,7 +1006,7 @@ void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject )
// it is valid that the form shell's forms collection is not initialized, yet
pShellImpl->UpdateForms( sal_True );
-
+
m_xLastCreatedControlModel.set( _rFormObject.GetUnoControlModel(), UNO_QUERY );
if ( !m_xLastCreatedControlModel.is() )
return;
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index d3dba436b4..451354e905 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -56,7 +56,7 @@
#include <comphelper/componentcontext.hxx>
#include <comphelper/numbers.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <tools/gen.hxx>
#include <tools/diagnose_ex.h>
diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx
index 69a2fb308e..63c42d4e9d 100644
--- a/svx/source/form/formcontrolling.cxx
+++ b/svx/source/form/formcontrolling.cxx
@@ -35,7 +35,7 @@
#include "fmurl.hxx"
#include <svx/svxids.hrc>
#include "fmprop.hrc"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/form/runtime/FormOperations.hpp>
diff --git a/svx/source/form/makefile.mk b/svx/source/form/makefile.mk
index b649be94d1..e5d8e15903 100644
--- a/svx/source/form/makefile.mk
+++ b/svx/source/form/makefile.mk
@@ -49,8 +49,6 @@ SRC1FILES= \
fmexpl.src \
filtnav.src \
fmstring.src \
- tbxform.src \
- fmsearch.src \
formshell.src \
datanavi.src
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 232a075ec3..678ca0f6b4 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -47,6 +47,7 @@
#include "fmpgeimp.hxx"
#include "fmitems.hxx"
#include "fmobj.hxx"
+#include "fmprop.hrc"
#include <vcl/wrkwin.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/dispatch.hxx>
diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx
index d19e75f923..15f580a799 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -39,6 +39,7 @@
#include <svx/svdogrp.hxx>
#include <svx/svdpagv.hxx>
+#include "fmprop.hrc"
#include "fmundo.hxx"
#include "fmhelp.hrc"
diff --git a/svx/source/form/sdbdatacolumn.cxx b/svx/source/form/sdbdatacolumn.cxx
index 5c443c7437..ed43578cb9 100644
--- a/svx/source/form/sdbdatacolumn.cxx
+++ b/svx/source/form/sdbdatacolumn.cxx
@@ -149,17 +149,17 @@ namespace svxform
return m_xColumn->getBytes();
}
- Date DataColumn::getDate() throw( SQLException, RuntimeException )
+ com::sun::star::util::Date DataColumn::getDate() throw( SQLException, RuntimeException )
{
return m_xColumn->getDate();
}
- Time DataColumn::getTime() throw( SQLException, RuntimeException )
+ com::sun::star::util::Time DataColumn::getTime() throw( SQLException, RuntimeException )
{
return m_xColumn->getTime();
}
- DateTime DataColumn::getTimestamp() throw( SQLException, RuntimeException )
+ com::sun::star::util::DateTime DataColumn::getTimestamp() throw( SQLException, RuntimeException )
{
return m_xColumn->getTimestamp();
}
@@ -255,12 +255,12 @@ namespace svxform
m_xColumnUpdate->updateDate(x);
}
- void DataColumn::updateTime(const Time& x) throw( SQLException, RuntimeException )
+ void DataColumn::updateTime(const com::sun::star::util::Time& x) throw( SQLException, RuntimeException )
{
m_xColumnUpdate->updateTime(x);
}
- void DataColumn::updateTimestamp(const DateTime& x) throw( SQLException, RuntimeException )
+ void DataColumn::updateTimestamp(const com::sun::star::util::DateTime& x) throw( SQLException, RuntimeException )
{
m_xColumnUpdate->updateTimestamp(x);
}
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index 0ad9062461..e280619a1a 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include "tabwin.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmservs.hxx"
#include "stringlistresource.hxx"
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 5025337118..dea9ec53e4 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -33,9 +33,9 @@
#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
#include <tools/ref.hxx>
#include <tools/shl.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <sfx2/dispatch.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/fixed.hxx>
diff --git a/svx/source/form/tbxform.src b/svx/source/form/tbxform.src
deleted file mode 100644
index 0d52e8c4cb..0000000000
--- a/svx/source/form/tbxform.src
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: tbxform.src,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <svx/svxids.hrc>
-#include "fmresids.hrc"
-#include "helpid.hrc"
-
-ModalDialog RID_SVX_DLG_INPUTRECORDNO
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 130 , 45 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "Record Number";
-
- FixedText 1
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 70 , 12 ) ;
- Text [ en-US ] = "go to record";
- };
- NumericField 1
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 79 , 6 ) ;
- Size = MAP_APPFONT ( 45 , 12 ) ;
- TabStop = TRUE ;
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 6 , 25 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 74 , 25 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
diff --git a/svx/source/form/typemap.cxx b/svx/source/form/typemap.cxx
index 0898dcdb2b..5a8baa8086 100644
--- a/svx/source/form/typemap.cxx
+++ b/svx/source/form/typemap.cxx
@@ -32,8 +32,8 @@
#include "precompiled_svx.hxx"
#include <sfx2/objitem.hxx>
#include <sfx2/msg.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
#include <svx/wghtitem.hxx>
#include <svx/udlnitem.hxx>
#include <svx/crsditem.hxx>
diff --git a/svx/source/gallery2/galbrws.cxx b/svx/source/gallery2/galbrws.cxx
index 4260aec4b8..2082198547 100644
--- a/svx/source/gallery2/galbrws.cxx
+++ b/svx/source/gallery2/galbrws.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,12 +33,12 @@
#include <vcl/split.hxx>
#include <vcl/ctrl.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <sfx2/sfxsids.hrc>
#include "gallery.hrc"
-#include "galmisc.hxx"
-#include "gallery1.hxx"
+#include "svx/galmisc.hxx"
+#include "svx/gallery1.hxx"
#include "galbrws1.hxx"
#include "galbrws2.hxx"
#include "galbrws.hxx"
@@ -52,7 +52,7 @@ class GallerySplitter : public Splitter
protected:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
+
public:
GallerySplitter( Window* pParent, const ResId& rResId );
@@ -117,7 +117,7 @@ GalleryBrowser::GalleryBrowser( SfxBindings* _pBindings, SfxChildWindow* pCW,
FreeResource();
SetMinOutputSizePixel( maLastSize = GetOutputSizePixel() );
-
+
mpBrowser1->SelectTheme( 0 );
mpBrowser1->Show( TRUE );
mpBrowser2->Show( TRUE );
@@ -129,7 +129,7 @@ GalleryBrowser::GalleryBrowser( SfxBindings* _pBindings, SfxChildWindow* pCW,
}
// -----------------------------------------------------------------------------
-
+
GalleryBrowser::~GalleryBrowser()
{
delete mpBrowser2;
@@ -171,12 +171,12 @@ void GalleryBrowser::Resize()
Point aSplitPos( mpSplitter->GetPosPixel() );
const Size aSplitSize( mpSplitter->GetOutputSizePixel() );
- mpBrowser1->SetPosSizePixel( Point( nFrameWidth, nFrameWidth ),
+ mpBrowser1->SetPosSizePixel( Point( nFrameWidth, nFrameWidth ),
Size( aSplitPos.X() - nFrameWidth, aNewSize.Height() - nFrameWidth2 ) );
-
+
mpSplitter->SetPosSizePixel( aSplitPos, Size( aSplitSize.Width(), aNewSize.Height() ) );
mpSplitter->SetDragRectPixel( Rectangle( Point( nFrameWidth2, 0 ), Size( aNewSize.Width() - ( nFrameWidth2 << 1 ) - aSplitSize.Width(), aNewSize.Height() ) ) );
-
+
mpBrowser2->SetPosSizePixel( Point( aSplitPos.X() + aSplitSize.Width(), nFrameWidth ),
Size( aNewSize.Width() - aSplitSize.Width() - aSplitPos.X() - nFrameWidth, aNewSize.Height() - nFrameWidth2 ) );
@@ -204,7 +204,7 @@ BOOL GalleryBrowser::KeyInput( const KeyEvent& rKEvt, Window* )
else
mpBrowser1->mpThemes->GrabFocus();
}
- else
+ else
{
if( mpBrowser1->mpThemes->HasChildPathFocus( TRUE ) )
mpBrowser1->maNewTheme.GrabFocus();
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index ff3a01ae6d..dc775caf2b 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -37,13 +37,12 @@
#include <ucbhelper/content.hxx>
#include <sfx2/app.hxx>
#include "helpid.hrc"
-#include "gallery1.hxx"
+#include "svx/gallery1.hxx"
#include "galtheme.hxx"
-#include "galmisc.hxx"
-#include "galdlg.hxx"
+#include "svx/galmisc.hxx"
#include "galbrws1.hxx"
#include <com/sun/star/util/DateTime.hpp>
-
+#include "gallery.hrc"
#include <algorithm>
#include <svx/svxdlg.hxx> //CHINA001
@@ -316,7 +315,7 @@ void GalleryBrowser1::ImplGalleryThemeProperties( const String & rThemeName, boo
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Got no AbstractDialogFactory!");
- VclAbstractDialog2* pThemeProps = pFact->CreateGalleryThemePropertiesDialog( NULL, mpExchangeData, mpThemePropsDlgItemSet, RID_SVXTABDLG_GALLERYTHEME );
+ VclAbstractDialog2* pThemeProps = pFact->CreateGalleryThemePropertiesDialog( NULL, mpExchangeData, mpThemePropsDlgItemSet );
DBG_ASSERT(pThemeProps, "Got no GalleryThemePropertiesDialog!");
if ( bCreateNew )
@@ -415,7 +414,7 @@ void GalleryBrowser1::ImplExecute( USHORT nId )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- VclAbstractRefreshableDialog* aActualizeProgress = pFact->CreateActualizeProgressDialog( this, pTheme, RID_SVXDLG_GALLERY_ACTUALIZE_PROGRESS );
+ VclAbstractRefreshableDialog* aActualizeProgress = pFact->CreateActualizeProgressDialog( this, pTheme );
DBG_ASSERT(aActualizeProgress, "Dialogdiet fail!");//CHINA001
aActualizeProgress->Update(); //CHINA001 aActualizeProgress.Update();
@@ -440,7 +439,7 @@ void GalleryBrowser1::ImplExecute( USHORT nId )
//CHINA001 TitleDialog aDlg( this, aOldName );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractTitleDialog* aDlg = pFact->CreateTitleDialog( this, aOldName, RID_SVXDLG_GALLERY_TITLE );
+ AbstractTitleDialog* aDlg = pFact->CreateTitleDialog( this, aOldName );
DBG_ASSERT(aDlg, "Dialogdiet fail!");//CHINA001
if( aDlg->Execute() == RET_OK ) //CHINA001 if( aDlg.Execute() == RET_OK )
@@ -477,7 +476,7 @@ void GalleryBrowser1::ImplExecute( USHORT nId )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractGalleryIdDialog* aDlg = pFact->CreateGalleryIdDialog( this, pTheme, RID_SVXDLG_GALLERY_THEMEID );
+ AbstractGalleryIdDialog* aDlg = pFact->CreateGalleryIdDialog( this, pTheme );
DBG_ASSERT(aDlg, "Dialogdiet fail!");//CHINA001
if( aDlg->Execute() == RET_OK ) //CHINA001 if( aDlg.Execute() == RET_OK )
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index 289ff4379c..e0ae02dde3 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -31,7 +31,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/button.hxx>
#include <vcl/menu.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <vector>
#include "galbrws.hxx"
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 2c2d4d6900..8d4a38aa14 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -35,23 +35,26 @@
#include <sot/formats.hxx>
#include <vcl/msgbox.hxx>
#include <svtools/valueset.hxx>
-#include <svtools/urlbmk.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/urlbmk.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
#include <svtools/transfer.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/sfxsids.hrc>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <svx/brshitem.hxx>
#include "helpid.hrc"
-#include "gallery1.hxx"
+#include "gallery.hxx"
+#include "galobj.hxx"
+#include "svx/gallery1.hxx"
#include "galtheme.hxx"
-#include "galmisc.hxx"
-#include "galdlg.hxx"
+#include "galctrl.hxx"
+#include "svx/galmisc.hxx"
#include "galbrws2.hxx"
+#include "gallery.hrc"
#include <vcl/svapp.hxx>
#include <svx/fmmodel.hxx>
#include <svx/svxdlg.hxx> //CHINA001
@@ -321,7 +324,7 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId,
const Link aSelectHdl( LINK( this, GalleryBrowser2, SelectObjectHdl ) );
Font aInfoFont( maInfoBar.GetControlFont() );
- maMiscOptions.AddListener( LINK( this, GalleryBrowser2, MiscHdl ) );
+ maMiscOptions.AddListenerLink( LINK( this, GalleryBrowser2, MiscHdl ) );
maViewBox.InsertItem( TBX_ID_ICON, aDummyImage );
maViewBox.SetItemBits( TBX_ID_ICON, TIB_RADIOCHECK | TIB_AUTOCHECK );
@@ -353,7 +356,7 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId,
GalleryBrowser2::~GalleryBrowser2()
{
- maMiscOptions.RemoveListener( LINK( this, GalleryBrowser2, MiscHdl ) );
+ maMiscOptions.RemoveListenerLink( LINK( this, GalleryBrowser2, MiscHdl ) );
delete mpPreview;
delete mpListView;
@@ -1014,7 +1017,7 @@ void GalleryBrowser2::ImplExecute( USHORT nId )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractTitleDialog* aDlg = pFact->CreateTitleDialog( this, aOldTitle, RID_SVXDLG_GALLERY_TITLE );
+ AbstractTitleDialog* aDlg = pFact->CreateTitleDialog( this, aOldTitle );
DBG_ASSERT(aDlg, "Dialogdiet fail!");//CHINA001
if( aDlg->Execute() == RET_OK )//CHINA001 if( aDlg.Execute() == RET_OK )
{
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index abe2e2fd02..9f751c98fa 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -38,10 +38,14 @@
#include "helpid.hrc"
#include "galbrws2.hxx"
#include "galtheme.hxx"
-#include "galmisc.hxx"
+#include "svx/galmisc.hxx"
#include "galctrl.hxx"
#include "AccessibleStringWrap.hxx"
#include <svx/svxfont.hxx>
+#include "galobj.hxx"
+#include <avmedia/mediawindow.hxx>
+#include "gallery.hrc"
+#include <svx/impgrf.hxx>
// -----------
// - Defines -
@@ -82,6 +86,28 @@ GalleryPreview::~GalleryPreview()
{
}
+
+bool GalleryPreview::SetGraphic( const INetURLObject& _aURL )
+{
+ bool bRet = true;
+ Graphic aGraphic;
+ if( ::avmedia::MediaWindow::isMediaURL( _aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) )
+ {
+ aGraphic = BitmapEx( GAL_RESID( RID_SVXBMP_GALLERY_MEDIA ) );
+ }
+ else
+ {
+ GraphicFilter* pFilter = GetGrfFilter();
+ GalleryProgress aProgress( pFilter );
+ if( pFilter->ImportGraphic( aGraphic, _aURL, GRFILTER_FORMAT_DONTKNOW ) )
+ bRet = false;
+ }
+
+ SetGraphic( aGraphic );
+ Invalidate();
+ return bRet;
+}
+
// ------------------------------------------------------------------------
void GalleryPreview::InitSettings()
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index 4facb96b8a..7e505245e9 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,12 +31,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/viewfrm.hxx>
-#include "gallery1.hxx"
-#include "galtheme.hxx"
+#include "svx/gallery1.hxx"
+#include "galtheme.hxx"
#include "galbrws.hxx"
#include "gallery.hxx"
+#include "galobj.hxx"
// -----------
// - Statics -
@@ -51,7 +52,7 @@ static SfxListener aLockListener;
Gallery* GalleryExplorer::ImplGetGallery()
{
static Gallery* pGallery = NULL;
-
+
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( !pGallery )
@@ -140,10 +141,10 @@ BOOL GalleryExplorer::FillObjList( const String& rThemeName, List& rObjList )
GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, aListener );
if( pTheme )
- {
+ {
for( ULONG i = 0, nCount = pTheme->GetObjectCount(); i < nCount; i++ )
rObjList.Insert( new String( pTheme->GetObjectURL( i ).GetMainURL( INetURLObject::NO_DECODE ) ), LIST_APPEND );
-
+
pGal->ReleaseTheme( pTheme, aListener );
}
}
@@ -168,9 +169,9 @@ sal_Bool GalleryExplorer::FillObjListTitle( const sal_uInt32 nThemeId, std::vect
{
SfxListener aListener;
GalleryTheme* pTheme = pGal->AcquireTheme( pGal->GetThemeName( nThemeId ), aListener );
-
+
if( pTheme )
- {
+ {
for( ULONG i = 0, nCount = pTheme->GetObjectCount(); i < nCount; i++ )
{
SgaObject* pObj = pTheme->AcquireObject( i );
@@ -214,7 +215,7 @@ BOOL GalleryExplorer::InsertURL( const String& rThemeName, const String& rURL, c
GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, aListener );
if( pTheme )
- {
+ {
INetURLObject aURL( rURL );
DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
bRet = pTheme->InsertURL( aURL );
@@ -281,7 +282,7 @@ BOOL GalleryExplorer::GetGraphicObj( const String& rThemeName, ULONG nPos,
{
if( pGraphic )
bRet = bRet || pTheme->GetGraphic( nPos, *pGraphic, bProgress );
-
+
if( pThumb )
bRet = bRet || pTheme->GetThumb( nPos, *pThumb, bProgress );
@@ -349,7 +350,7 @@ ULONG GalleryExplorer::GetSdrObjCount( const String& rThemeName )
for( ULONG i = 0, nCount = pTheme->GetObjectCount(); i < nCount; i++ )
if( SGA_OBJ_SVDRAW == pTheme->GetObjectKind( i ) )
nRet++;
-
+
pGal->ReleaseTheme( pTheme, aListener );
}
}
@@ -394,7 +395,7 @@ BOOL GalleryExplorer::GetSdrObj( const String& rThemeName, ULONG nSdrModelPos,
}
}
}
-
+
pGal->ReleaseTheme( pTheme, aListener );
}
}
@@ -453,10 +454,10 @@ BOOL GalleryExplorer::BeginLocking( const String& rThemeName )
GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, aLockListener );
if( pTheme )
- {
+ {
pTheme->LockTheme();
bRet = TRUE;
- }
+ }
}
return bRet;
@@ -485,10 +486,10 @@ BOOL GalleryExplorer::EndLocking( const String& rThemeName )
if( pTheme )
{
const BOOL bReleaseLockedTheme = pTheme->UnlockTheme();
-
+
// release acquired theme
pGal->ReleaseTheme( pTheme, aListener );
-
+
if( bReleaseLockedTheme )
{
// release locked theme
diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src
index 422acb973b..84d763fae6 100644
--- a/svx/source/gallery2/gallery.src
+++ b/svx/source/gallery2/gallery.src
@@ -74,412 +74,8 @@ DockingWindow RID_SVXDLG_GALLERYBROWSER
};
};
-
-/******************************************************************************/
-
-TabDialog RID_SVXTABDLG_GALLERY
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Text [ en-US ] = "Properties of " ;
- Moveable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXTABPAGE_GALLERY_GENERAL ;
- Text [ en-US ] = "General" ;
- };
- };
- };
-};
-
-/******************************************************************************/
-
-TabDialog RID_SVXTABDLG_GALLERYTHEME
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Text [ en-US ] = "Properties of " ;
- Moveable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SVXTABPAGE_GALLERY_GENERAL ;
- Text [ en-US ] = "General" ;
- };
- PageItem
- {
- Identifier = RID_SVXTABPAGE_GALLERYTHEME_FILES ;
- Text [ en-US ] = "Files" ;
- };
- };
- };
-};
-
-/******************************************************************************/
-
-TabPage RID_SVXTABPAGE_GALLERY_GENERAL
-{
- HelpId = HID_GALLERY_PROPERTIES_GENERAL;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedImage FI_MS_IMAGE
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 20 , 20 ) ;
- };
- Edit EDT_MS_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 10 ) ;
- Size = MAP_APPFONT ( 194 , 12 ) ;
- };
- FixedLine FL_MS_GENERAL_FIRST
- {
- Pos = MAP_APPFONT ( 6 , 36 ) ;
- Size = MAP_APPFONT ( 248 , 1 ) ;
- };
- FixedText FT_MS_TYPE
- {
- Pos = MAP_APPFONT ( 6 , 43 ) ;
- Size = MAP_APPFONT ( 51 , 10 ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Type:" ;
- };
- FixedText FT_MS_SHOW_TYPE
- {
- Pos = MAP_APPFONT ( 60 , 43 ) ;
- Size = MAP_APPFONT ( 194 , 10 ) ;
- };
- FixedText FT_MS_PATH
- {
- Pos = MAP_APPFONT ( 6 , 57 ) ;
- Size = MAP_APPFONT ( 51 , 10 ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Location:" ;
- };
- FixedText FT_MS_SHOW_PATH
- {
- Pos = MAP_APPFONT ( 60 , 57 ) ;
- Size = MAP_APPFONT ( 194 , 10 ) ;
- };
- FixedText FT_MS_CONTENT
- {
- Pos = MAP_APPFONT ( 6 , 71 ) ;
- Size = MAP_APPFONT ( 51 , 10 ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Contents:" ;
- };
- FixedText FT_MS_SHOW_CONTENT
- {
- Pos = MAP_APPFONT ( 60 , 71 ) ;
- Size = MAP_APPFONT ( 194 , 10 ) ;
- };
- FixedLine FL_MS_GENERAL_SECOND
- {
- Pos = MAP_APPFONT ( 6 , 91 ) ;
- Size = MAP_APPFONT ( 248 , 1 ) ;
- };
- FixedText FT_MS_CHANGEDATE
- {
- Pos = MAP_APPFONT ( 6 , 98 ) ;
- Size = MAP_APPFONT ( 51 , 10 ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Modified:" ;
- };
- FixedText FT_MS_SHOW_CHANGEDATE
- {
- Pos = MAP_APPFONT ( 60 , 98 ) ;
- Size = MAP_APPFONT ( 194 , 10 ) ;
- };
-};
-
-/******************************************************************************/
-
-TabPage RID_SVXTABPAGE_GALLERYTHEME_FILES
-{
- HelpId = HID_GALLERY_BROWSER ;
- Hide = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedText FT_FILETYPE
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 48 , 10 ) ;
- Text [ en-US ] = "~File type" ;
- };
- ComboBox CBB_FILETYPE
- {
- Pos = MAP_APPFONT ( 57 , 6 ) ;
- Size = MAP_APPFONT ( 121 , 69 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoSize = TRUE;
- AutoHScroll = TRUE ;
- };
- MultiListBox LBX_FOUND
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 23 ) ;
- Size = MAP_APPFONT ( 172 , 156 ) ;
- TabStop = TRUE ;
- SimpleMode = TRUE ;
- };
- PushButton BTN_SEARCH
- {
- Pos = MAP_APPFONT ( 184 , 6 ) ;
- Size = MAP_APPFONT ( 70 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Find Files..." ;
- };
- PushButton BTN_TAKE
- {
- Pos = MAP_APPFONT ( 184 , 24 ) ;
- Size = MAP_APPFONT ( 70 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Add" ;
- };
- PushButton BTN_TAKEALL
- {
- Pos = MAP_APPFONT ( 184 , 42 ) ;
- Size = MAP_APPFONT ( 70 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "A~dd All" ;
- };
- CheckBox CBX_PREVIEW
- {
- Pos = MAP_APPFONT ( 184 , 76 ) ;
- Size = MAP_APPFONT ( 70 , 12 ) ;
- Text [ en-US ] = "Pr~eview" ;
- };
- Window WND_BRSPRV
- {
- HelpId = HID_GALLERY_PREVIEW;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 184 , 91 ) ;
- Size = MAP_APPFONT ( 70 , 88 ) ;
- };
- PushButton BTN_MADDIN1
- {
- Pos = MAP_APPFONT ( 220 , 63 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Maddin1" ;
- };
- PushButton BTN_MADDIN2
- {
- Pos = MAP_APPFONT ( 220 , 80 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Maddin2" ;
- };
-};
-
-/******************************************************************************/
-
-ModalDialog RID_SVXDLG_GALLERY_TITLE
-{
- HelpId = HID_GALLERY_TITLE;
- OutputSize = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 168 , 63 ) ;
- Text [ en-US ] = "Enter Title" ;
- Moveable = TRUE ;
-
- OkButton BTN_OK
- {
- DefButton = TRUE ;
- Pos = MAP_APPFONT ( 112 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 112 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 112 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-
- FixedLine FL_TITLE
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "Title" ;
- };
- Edit EDT_TITLE
- {
- HelpId = HID_GALLERY_TITLE_EDIT;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 18 ) ;
- Size = MAP_APPFONT ( 88, 12 ) ;
- };
-};
-
-/******************************************************************************/
-
-ModalDialog RID_SVXDLG_GALLERY_SEARCH_PROGRESS
-{
- HelpId = HID_GALLERY_SEARCH ;
- OutputSize = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 124 , 86 ) ;
- Text [ en-US ] = "Find" ;
- Moveable = TRUE ;
- FixedLine FL_SEARCH_DIR
- {
- Pos = MAP_APPFONT ( 6 , 33 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Directory" ;
- };
- FixedText FT_SEARCH_DIR
- {
- Pos = MAP_APPFONT ( 12 , 44 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 37 , 66 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine FL_SEARCH_TYPE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "File type" ;
- };
- FixedText FT_SEARCH_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
-};
-
-/******************************************************************************/
-
-ModalDialog RID_SVXDLG_GALLERY_TAKE_PROGRESS
-{
- HelpId = HID_GALLERY_APPLY ;
- OutputSize = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 124 , 56 ) ;
- Text [ en-US ] = "Apply" ;
- Moveable = TRUE ;
- FixedLine FL_TAKE_PROGRESS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "File" ;
- };
- FixedText FT_TAKE_FILE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 37 , 36 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-/******************************************************************************/
-
-ModalDialog RID_SVXDLG_GALLERY_ACTUALIZE_PROGRESS
-{
- HelpId = HID_GALLERY_ACTUALIZE ;
- OutputSize = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 124 , 56 ) ;
- Text [ en-US ] = "Update" ;
- Moveable = TRUE ;
- FixedLine FL_ACTUALIZE_PROGRESS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "File" ;
- };
- FixedText FT_ACTUALIZE_FILE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 37 , 36 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-ModalDialog RID_SVXDLG_GALLERY_THEMEID
-{
- OutputSize = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 180 , 63 ) ;
- Text [ en-US ] = "Theme ID" ;
- Moveable = TRUE ;
- OkButton BTN_OK
- {
- Pos = MAP_APPFONT ( 124 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 124 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine FL_ID
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "ID";
- };
- ListBox LB_RESNAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 60 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- HScroll = TRUE ;
- VScroll = TRUE ;
- };
-};
-
/******************************************************************************/
-CheckBox RID_SVXDLG_GALLERY_CBX
-{
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 120 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "S~ubdirectories" ;
-};
String RID_SVXSTR_GALLERY_ACTUALIZE_PROGRESS
{
Text [ en-US ] = "Update";
@@ -488,10 +84,6 @@ String RID_SVXSTR_GALLERY_FOPENERROR
{
Text [ en-US ] = "This file cannot be opened" ;
};
-String RID_SVXSTR_GALLERY_NOFILES
-{
- Text [ en-US ] = "<No Files>" ;
-};
String RID_SVXSTR_GALLERY_NOTHEME
{
Text [ en-US ] = "Invalid Theme Name!" ;
@@ -544,10 +136,6 @@ String RID_SVXSTR_GALLERY_DELETEDD
{
Text [ en-US ] = "Do you want to delete the linked file?" ;
};
-String RID_SVXSTR_GALLERY_SEARCH
-{
- Text [ en-US ] = "Do you want to update the file list?" ;
-};
String RID_SVXSTR_GALLERY_SGIERROR
{
Text [ en-US ] = "This file cannot be opened.\nDo you want to enter a different search path? " ;
@@ -564,18 +152,6 @@ String RID_SVXSTR_GALLERY_THEMEERR
{
Text [ en-US ] = "This theme name already exists.\nPlease choose a different one." ;
};
-String RID_SVXSTR_GALLERYPROPS_THEME
-{
- Text [ en-US ] = "Theme;Themes" ;
-};
-String RID_SVXSTR_GALLERYPROPS_OBJECT
-{
- Text [ en-US ] = "Object;Objects" ;
-};
-String RID_SVXSTR_GALLERYPROPS_GALTHEME
-{
- Text [ en-US ] = "Gallery Theme" ;
-};
String RID_SVXSTR_GALLERY_IMPORTTHEME
{
Text [ en-US ] = "I~mport..." ;
@@ -584,22 +160,10 @@ String RID_SVXSTR_GALLERY_CREATETHEME
{
Text [ en-US ] = "New Theme..." ;
};
-String RID_SVXSTR_GALLERY_READONLY
-{
- Text [ en-US ] = " (read-only)" ;
-};
-String RID_SVXSTR_GALLERY_ALLFILES
-{
- Text [ en-US ] = "<All Files>" ;
-};
String RID_SVXSTR_GALLERY_DIALOGID
{
Text [ en-US ] = "Assign ID" ;
};
-String RID_SVXSTR_GALLERY_ID_EXISTS
-{
- Text [ en-US ] = "This ID already exists..." ;
-};
String RID_SVXSTR_GALLERY_TITLE
{
Text [ en-US ] = "Title" ;
@@ -629,41 +193,21 @@ Bitmap RID_SVXBMP_THEME_NORMAL
File = "galnors.bmp" ;
};
-Bitmap RID_SVXBMP_THEME_NORMAL_BIG
-{
- File = "galnorl.bmp" ;
-};
-
Bitmap RID_SVXBMP_THEME_IMPORTED
{
File = "galimps.bmp" ;
};
-Bitmap RID_SVXBMP_THEME_IMPORTED_BIG
-{
- File = "galimpl.bmp" ;
-};
-
Bitmap RID_SVXBMP_THEME_READONLY
{
File = "galrdos.bmp" ;
};
-Bitmap RID_SVXBMP_THEME_READONLY_BIG
-{
- File = "galrdol.bmp" ;
-};
-
Bitmap RID_SVXBMP_THEME_DEFAULT
{
File = "galdefs.bmp" ;
};
-Bitmap RID_SVXBMP_THEME_DEFAULT_BIG
-{
- File = "galdefl.bmp" ;
-};
-
Bitmap RID_SVXBMP_GALLERY_MEDIA
{
File = "galmedia.bmp";
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 4751c8107f..14ac81ebe9 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,12 +36,13 @@
#include <tools/vcompat.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/docfile.hxx>
#include "gallery.hxx"
-#include "galmisc.hxx"
+#include "gallery.hrc"
+#include "svx/galmisc.hxx"
#include "galtheme.hxx"
-#include "gallery1.hxx"
+#include "svx/gallery1.hxx"
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
@@ -245,10 +246,10 @@ void Gallery::ImplLoad( const String& rMultiPath )
sal_Bool bIsReadOnlyDir;
bMultiPath = ( nTokenCount > 0 );
-
+
INetURLObject aCurURL(SvtPathOptions().GetConfigPath());
ImplLoadSubDirs( aCurURL, bIsReadOnlyDir );
-
+
if( !bIsReadOnlyDir )
aUserURL = aCurURL;
@@ -259,9 +260,9 @@ void Gallery::ImplLoad( const String& rMultiPath )
for( USHORT i = 0UL; i < nTokenCount; i++ )
{
aCurURL = INetURLObject(rMultiPath.GetToken( i, ';' ));
-
+
ImplLoadSubDirs( aCurURL, bIsReadOnlyDir );
-
+
if( !bIsReadOnlyDir )
aUserURL = aCurURL;
}
@@ -290,7 +291,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
aProps.getArray()[ 0 ] = OUString::createFromAscii( "Url" );
uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
-
+
try
{
// check readonlyness the very hard way
@@ -299,14 +300,14 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
aTestURL.Append( aTestFile );
SvStream* pTestStm = ::utl::UcbStreamHelper::CreateStream( aTestURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE );
-
+
if( pTestStm )
{
*pTestStm << 1;
-
+
if( pTestStm->GetError() )
rbDirIsReadOnly = sal_True;
-
+
delete pTestStm;
KillFile( aTestURL );
}
@@ -332,7 +333,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
while( xResultSet->next() )
{
INetURLObject aThmURL( xContentAccess->queryContentIdentifierString() );
-
+
if(aThmURL.GetExtension().equalsIgnoreAsciiCaseAscii("thm"))
{
INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( OUString::createFromAscii( "sdg" ) );
@@ -341,7 +342,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
const OUString aReadOnlyProp( OUString::createFromAscii( "IsReadOnly" ) );
OUString aTitle;
sal_Bool bReadOnly = sal_False;
-
+
try
{
::ucbhelper::Content aThmCnt( aThmURL.GetMainURL( INetURLObject::NO_DECODE ), xEnv );
@@ -524,7 +525,7 @@ void Gallery::ImplLoadImports()
void Gallery::ImplWriteImportList()
{
- INetURLObject aURL( GetUserURL() );
+ INetURLObject aURL( GetUserURL() );
aURL.Append( ( String( "gallery.sdi", RTL_TEXTENCODING_UTF8 ) ) );
SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC );
@@ -786,15 +787,15 @@ BOOL Gallery::RemoveTheme( const String& rThemeName )
{
SfxListener aListener;
GalleryTheme* pThm = AcquireTheme( rThemeName, aListener );
-
+
if( pThm )
{
INetURLObject aThmURL( pThm->GetThmURL() );
INetURLObject aSdgURL( pThm->GetSdgURL() );
INetURLObject aSdvURL( pThm->GetSdvURL() );
-
+
ReleaseTheme( pThm, aListener );
-
+
KillFile( aThmURL );
KillFile( aSdgURL );
KillFile( aSdvURL );
@@ -919,3 +920,7 @@ void Gallery::ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener )
ImplDeleteCachedTheme( pTheme );
}
}
+
+BOOL GalleryThemeEntry::IsDefault() const
+{ return( ( nId > 0 ) && ( nId != ( RID_GALLERYSTR_THEME_MYTHEME - RID_GALLERYSTR_THEME_START ) ) ); }
+
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index c7f058ca80..0353af86ef 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -37,15 +37,15 @@
#include <ucbhelper/content.hxx>
#include <tools/resmgr.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/solar.hrc>
-#include <svtools/urihelper.hxx>
+#include <svl/solar.hrc>
+#include <svl/urihelper.hxx>
#include <svtools/filter.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <sfx2/docfile.hxx>
#include <avmedia/mediawindow.hxx>
#include <vcl/svapp.hxx>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <svx/svdpage.hxx>
#include <svx/svdograf.hxx>
#include <svx/fmmodel.hxx>
@@ -53,9 +53,9 @@
#include <svx/unomodel.hxx>
#include "codec.hxx"
#include "gallery.hrc"
-#include "gallery1.hxx"
+#include "svx/gallery1.hxx"
#include "galtheme.hxx"
-#include "galmisc.hxx"
+#include "svx/galmisc.hxx"
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index a4b9cc0d39..a62a530ccb 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -38,17 +38,17 @@
#include <sfx2/docfac.hxx>
#include <comphelper/classids.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <tools/rcid.h>
#include <tools/vcompat.hxx>
#include <vcl/virdev.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svx/fmmodel.hxx>
#include <svx/fmview.hxx>
#include <svx/fmpage.hxx>
#include "gallery.hrc"
-#include "galmisc.hxx"
+#include "svx/galmisc.hxx"
#include "galobj.hxx"
#include <vcl/salbtype.hxx> // FRound
#include <vcl/svapp.hxx>
@@ -82,22 +82,22 @@ BOOL SgaObject::CreateThumb( const Graphic& rGraphic )
{
const Color aWhite( COL_WHITE );
- if( aBmpEx.GetPrefMapMode().GetMapUnit() != MAP_PIXEL &&
- aBmpEx.GetPrefSize().Width() > 0 &&
+ if( aBmpEx.GetPrefMapMode().GetMapUnit() != MAP_PIXEL &&
+ aBmpEx.GetPrefSize().Width() > 0 &&
aBmpEx.GetPrefSize().Height() > 0 )
{
Size aLogSize( OutputDevice::LogicToLogic( aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MAP_100TH_MM ) );
-
+
if( aLogSize.Width() > 0 && aLogSize.Height() > 0 )
{
double fFactorLog = static_cast< double >( aLogSize.Width() ) / aLogSize.Height();
double fFactorPix = static_cast< double >( aBmpSize.Width() ) / aBmpSize.Height();
-
+
if( fFactorPix > fFactorLog )
aBmpSize.Width() = FRound( aBmpSize.Height() * fFactorLog );
else
aBmpSize.Height() = FRound( aBmpSize.Width() / fFactorLog );
-
+
aBmpEx.SetSizePixel( aBmpSize );
}
}
@@ -371,7 +371,7 @@ Bitmap SgaObjectSound::GetThumbBmp() const
nId = RID_SVXBMP_GALLERY_MEDIA;
break;
}
-
+
const BitmapEx aBmpEx( GAL_RESID( nId ) );
const Color aTransColor( COL_WHITE );
@@ -416,8 +416,8 @@ SgaObjectAnim::SgaObjectAnim()
// ------------------------------------------------------------------------
-SgaObjectAnim::SgaObjectAnim( const Graphic& rGraphic,
- const INetURLObject& rURL,
+SgaObjectAnim::SgaObjectAnim( const Graphic& rGraphic,
+ const INetURLObject& rURL,
const String& )
{
aURL = rURL;
@@ -492,7 +492,7 @@ SvxGalleryDrawModel::~SvxGalleryDrawModel()
// ------------------------------------------------------------------------
SgaObjectSvDraw::SgaObjectSvDraw( SvStream& rIStm, const INetURLObject& rURL )
-{
+{
SvxGalleryDrawModel aModel;
if( aModel.GetModel() )
@@ -556,7 +556,7 @@ BOOL SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& rMode
MapMode aMap( rModel.GetScaleUnit() );
Rectangle aDrawRectPix( Point( 1, 1 ), Size( aOutSizePix.Width() - 2, aOutSizePix.Height() - 2 ) );
const double fFactor = (double) aObjRect.GetWidth() / aObjRect.GetHeight();
- Fraction aFrac( FRound( fFactor < 1. ? aDrawRectPix.GetWidth() * fFactor : aDrawRectPix.GetWidth() ),
+ Fraction aFrac( FRound( fFactor < 1. ? aDrawRectPix.GetWidth() * fFactor : aDrawRectPix.GetWidth() ),
pOut->LogicToPixel( aObjRect.GetSize(), aMap ).Width() );
aMap.SetScaleX( aFrac );
@@ -568,7 +568,7 @@ BOOL SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& rMode
aOrigin.X() += ( ( aDrawSize.Width() - aObjRect.GetWidth() ) >> 1 ) - aObjRect.Left();
aOrigin.Y() += ( ( aDrawSize.Height() - aObjRect.GetHeight() ) >> 1 ) - aObjRect.Top();
aMap.SetOrigin( aOrigin );
-
+
aView.SetPageVisible( FALSE );
aView.SetBordVisible( FALSE );
aView.SetGridVisible( FALSE );
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index c76cdce576..b79af995b2 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -45,7 +45,7 @@
#include <sot/filelist.hxx>
#include <vcl/virdev.hxx>
#include <vcl/cvtgrf.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <sfx2/docfile.hxx>
#include <avmedia/mediawindow.hxx>
#include <svx/svdograf.hxx>
@@ -54,12 +54,15 @@
#include <svx/unomodel.hxx>
#include <svx/fmmodel.hxx>
#include <svx/fmview.hxx>
-#include "galmisc.hxx"
+#include "svx/galmisc.hxx"
#include "galtheme.hxx"
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
-
+#include "galobj.hxx"
+#include <svx/gallery1.hxx>
+#include "galtheme.hrc"
+#include <vcl/lstbox.hxx>
#include "gallerydrawmodel.hxx"
// --------------
@@ -1574,3 +1577,26 @@ SvStream& operator>>( SvStream& rIn, GalleryTheme& rTheme )
{
return rTheme.ReadData( rIn );
}
+
+void GalleryTheme::ImplSetModified( BOOL bModified )
+{ pThm->SetModified( bModified ); }
+
+const String& GalleryTheme::GetRealName() const { return pThm->GetThemeName(); }
+const INetURLObject& GalleryTheme::GetThmURL() const { return pThm->GetThmURL(); }
+const INetURLObject& GalleryTheme::GetSdgURL() const { return pThm->GetSdgURL(); }
+const INetURLObject& GalleryTheme::GetSdvURL() const { return pThm->GetSdvURL(); }
+UINT32 GalleryTheme::GetId() const { return pThm->GetId(); }
+void GalleryTheme::SetId( UINT32 nNewId, BOOL bResetThemeName ) { pThm->SetId( nNewId, bResetThemeName ); }
+BOOL GalleryTheme::IsThemeNameFromResource() const { return pThm->IsNameFromResource(); }
+BOOL GalleryTheme::IsImported() const { return pThm->IsImported(); }
+BOOL GalleryTheme::IsReadOnly() const { return pThm->IsReadOnly(); }
+BOOL GalleryTheme::IsDefault() const { return pThm->IsDefault(); }
+BOOL GalleryTheme::IsModified() const { return pThm->IsModified(); }
+const String& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); }
+
+void GalleryTheme::InsertAllThemes( ListBox& rListBox )
+{
+ for( USHORT i = RID_GALLERYSTR_THEME_FIRST; i <= RID_GALLERYSTR_THEME_LAST; i++ )
+ rListBox.InsertEntry( String( GAL_RESID( i ) ) );
+}
+
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index a12dc65597..8f9ae215c4 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -43,6 +43,7 @@
#include <comphelper/regpathhelper.hxx>
#include <cppuhelper/servicefactory.hxx>
#include <cppuhelper/bootstrap.hxx>
+#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
@@ -70,10 +71,9 @@
#include <rtl/bootstrap.hxx>
#include <galtheme.hxx>
-#include <gallery1.hxx>
+#include <svx/gallery1.hxx>
using namespace ::vos;
-using namespace ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::lang;
@@ -221,7 +221,7 @@ static void PrintHelp()
fprintf( stdout, "\t\t\tare required.\n");
}
-static OUString Smartify( const OUString &rPath )
+static rtl::OUString Smartify( const rtl::OUString &rPath )
{
INetURLObject aURL;
aURL.SetSmartURL( rPath );
@@ -234,7 +234,7 @@ static OUString Smartify( const OUString &rPath )
void GalApp::Init()
{
if( getenv( "OOO_INSTALL_PREFIX" ) == NULL ) {
- OUString fileName = GetAppFileName();
+ rtl::OUString fileName = GetAppFileName();
int lastSlash = fileName.lastIndexOf( '/' );
#ifdef WNT
// Don't know which directory separators GetAppFileName() returns on Windows.
@@ -242,9 +242,9 @@ void GalApp::Init()
if( fileName.lastIndexOf( '\\' ) > lastSlash )
lastSlash = fileName.lastIndexOf( '\\' );
#endif
- OUString baseBinDir = fileName.copy( 0, lastSlash );
- OUString installPrefix = baseBinDir + OUString::createFromAscii( "/../.." );
- OUString assignment = OUString::createFromAscii( "OOO_INSTALL_PREFIX=" ) + installPrefix;
+ rtl::OUString baseBinDir = fileName.copy( 0, lastSlash );
+ rtl::OUString installPrefix = baseBinDir + rtl::OUString::createFromAscii( "/../.." );
+ rtl::OUString assignment = rtl::OUString::createFromAscii( "OOO_INSTALL_PREFIX=" ) + installPrefix;
putenv( strdup( OUSTRING_CSTR( assignment )));
}
OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) );
@@ -262,7 +262,7 @@ void GalApp::Init()
void GalApp::InitUCB()
{
- OUString aEmpty;
+ rtl::OUString aEmpty;
Sequence< Any > aArgs(6);
aArgs[0]
<<= rtl::OUString::createFromAscii(UCB_CONFIGURATION_KEY1_LOCAL);
@@ -287,7 +287,7 @@ void GalApp::Main()
for( USHORT i = 0; i < GetCommandLineParamCount(); i++ )
{
- OUString aParam = GetCommandLineParam( i );
+ rtl::OUString aParam = GetCommandLineParam( i );
if( aParam.equalsAscii( "--help" ) ||
aParam.equalsAscii( "-h" ) )
diff --git a/svx/source/inc/GraphCtlAccessibleContext.hxx b/svx/source/inc/GraphCtlAccessibleContext.hxx
index 85923590f3..db97446f93 100644
--- a/svx/source/inc/GraphCtlAccessibleContext.hxx
+++ b/svx/source/inc/GraphCtlAccessibleContext.hxx
@@ -52,7 +52,7 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <vos/mutex.hxx>
#include <comphelper/broadcasthelper.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <set>
#include <map>
diff --git a/svx/source/inc/SpellDialog.hxx b/svx/source/inc/SpellDialog.hxx
deleted file mode 100644
index 351ff3d77e..0000000000
--- a/svx/source/inc/SpellDialog.hxx
+++ /dev/null
@@ -1,261 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpellDialog.hxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_SPELLDDIALOG_HXX
-#define _SVX_SPELLDDIALOG_HXX
-
-// include ---------------------------------------------------------------
-
-#include <sfx2/basedlgs.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/lstbox.hxx>
-#include <svtools/stdctrl.hxx>
-#include <vcl/button.hxx>
-#include <vcl/menubtn.hxx>
-#include <vcl/group.hxx>
-#include <vcl/decoview.hxx>
-#include <vcl/image.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-
-
-#include <svx/svxbox.hxx>
-#include <svx/langbox.hxx>
-#include <memory>
-#include <svtools/svmedit.hxx>
-#include <svtools/lstner.hxx>
-#include <svtools/xtextedt.hxx>
-#include <svx/SpellPortions.hxx>
-
-class ScrollBar;
-class TextEngine;
-class ExtTextView;
-namespace svx{ class SpellUndoAction_Impl;}
-
-// forward ---------------------------------------------------------------
-
-struct SpellDialog_Impl;
-
-namespace com{namespace sun{namespace star{
-namespace linguistic2{
- class XSpellChecker1;
-}}}}
-namespace svx{
-class SpellDialog;
-struct SpellErrorDescription;
-// ------------------------------------------------------------------
-class SentenceEditWindow_Impl : public MultiLineEdit/*, public SfxListener*/
-{
- using MultiLineEdit::SetText;
-
-private:
- USHORT m_nErrorStart;
- USHORT m_nErrorEnd;
- bool m_bIsUndoEditMode;
-
- Link m_aModifyLink;
-
- void CallModifyLink() {m_aModifyLink.Call(this);}
-
- SpellDialog* GetSpellDialog() const {return (SpellDialog*)GetParent();}
-protected:
- virtual long PreNotify( NotifyEvent& rNEvt );
-
-public:
- SentenceEditWindow_Impl( SpellDialog* pParent, const ResId& rResId );
- ~SentenceEditWindow_Impl();
-
- void SetModifyHdl(const Link& rLink) { m_aModifyLink = rLink;}
-
- void SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd );
- void SetText( const String& rStr );
-
- bool MarkNextError();
- void ChangeMarkedWord(const String& rNewWord, LanguageType eLanguage);
- void MoveErrorMarkTo(USHORT nErrorStart, USHORT nErrorEnd, bool bGrammar);
- String GetErrorText() const;
- void RestoreCurrentError();
-
- void SetAlternatives(
- com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellAlternatives> );
-
- const SpellErrorDescription* GetAlternatives();
-
-
- void ResetModified() { GetTextEngine()->SetModified(FALSE); m_bIsUndoEditMode = false;}
- BOOL IsModified() const { return GetTextEngine()->IsModified(); }
-
- bool IsUndoEditMode() const { return m_bIsUndoEditMode;}
- void SetUndoEditMode(bool bSet);
-
- svx::SpellPortions CreateSpellPortions( bool bSetIgnoreFlag ) const;
-
- void ResetUndo();
- void Undo();
- void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE );
- USHORT GetUndoActionCount();
- void UndoActionStart( USHORT nId );
- void UndoActionEnd( USHORT nId );
-
- void MoveErrorEnd(long nOffset);
-};
-
-
-// class SvxSpellDialog ---------------------------------------------
-class SpellDialogChildWindow;
-class ExplainButton : public PushButton
-{
- String m_sExplanation;
-
- virtual void RequestHelp( const HelpEvent& rHEvt );
- virtual void Click();
-public:
- ExplainButton( Window* pParent, const ResId& rResId ) : PushButton( pParent, rResId ){}
- ~ExplainButton();
- void SetExplanation( const String& rText ) {m_sExplanation = rText;}
- bool HasExplanation() { return m_sExplanation.Len() > 0;}
-
-};
-
-class SpellDialog : public SfxModelessDialog
-{
- using Window::Invalidate;
-
- friend class SentenceEditWindow_Impl;
-private:
-
- FixedImage aVendorImageFI;
-
- FixedText aLanguageFT;
- SvxLanguageBox aLanguageLB;
-
- FixedText aNotInDictFT;
- SentenceEditWindow_Impl aSentenceED;
-
- FixedText aSuggestionFT;
- ListBox aSuggestionLB;
-
- PushButton aIgnorePB;
- PushButton aIgnoreAllPB;
- PushButton aIgnoreRulePB;
- MenuButton aAddToDictMB;
-
- PushButton aChangePB;
- PushButton aChangeAllPB;
- ExplainButton aExplainPB;
- PushButton aAutoCorrPB;
-
- CheckBox aCheckGrammarCB;
-
- HelpButton aHelpPB;
- PushButton aOptionsPB;
- PushButton aUndoPB;
- PushButton aClosePB;
-
- GroupBox aBackgroundGB;
-
- Image aVendorImage;
- Image aVendorImageHC;
-
- String aResumeST;
- String aIgnoreOnceST;
- String aNoSuggestionsST;
-
- const String m_sTitleSpelling;
- const String m_sTitleSpellingGrammar;
- const String m_sTitleSpellingGrammarVendor;
-
- Size aOldWordEDSize;
- Link aDialogUndoLink;
-
- bool bModified;
- bool bFocusLocked;
-
- svx::SpellDialogChildWindow& rParent;
- svx::SpellPortions m_aSavedSentence;
-
- SpellDialog_Impl* pImpl;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
- LanguageType nOldLang;
-
- DECL_LINK( ChangeHdl, Button * );
- DECL_LINK( ChangeAllHdl, Button * );
- DECL_LINK( IgnoreAllHdl, Button * );
- DECL_LINK( IgnoreHdl, Button * );
- DECL_LINK( CheckGrammarHdl, CheckBox* );
- DECL_LINK( ExtClickHdl, Button * );
- DECL_LINK( CancelHdl, Button * );
- DECL_LINK( ModifyHdl, SentenceEditWindow_Impl *);
- DECL_LINK( UndoHdl, Button * );
- DECL_LINK( AddToDictionaryHdl, MenuButton* );
- DECL_LINK( LanguageSelectHdl, SvxLanguageBox* );
- DECL_LINK( DialogUndoHdl, SpellUndoAction_Impl* );
-
- DECL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog * );
-
- void StartSpellOptDlg_Impl();
- void InitUserDicts();
- void UpdateBoxes_Impl();
- void Init_Impl();
- void SpellContinue_Impl(bool UseSavedSentence = false);
- void LockFocusChanges( bool bLock ) {bFocusLocked = bLock;}
- void Impl_Restore();
-
- void SetSelectedLang_Impl( LanguageType nLang );
- LanguageType GetSelectedLang_Impl() const;
-
- /** Retrieves the next sentence.
- */
- bool GetNextSentence_Impl(bool bUseSavedSentence);
- /** Corrects all errors that have been selected to be changed always
- */
- bool ApplyChangeAllList_Impl(SpellPortions& rSentence, bool& bHasReplaced);
- void SetTitle_Impl(LanguageType nLang);
-
-protected:
- virtual void Paint( const Rectangle& rRect );
- virtual long Notify( NotifyEvent& rNEvt );
-
-public:
- SpellDialog(
- svx::SpellDialogChildWindow* pChildWindow,
- Window * pParent,
- SfxBindings* pBindings);
- ~SpellDialog();
-
- void SetLanguage( sal_uInt16 nLang );
- virtual sal_Bool Close();
-
- void InvalidateDialog();
-};
-} //namespace svx
-
-#endif
-
diff --git a/svx/source/inc/eventdlg.hxx b/svx/source/inc/eventdlg.hxx
deleted file mode 100644
index 7c827be07a..0000000000
--- a/svx/source/inc/eventdlg.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: eventdlg.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _EVENTDLG_HXX
-#define _EVENTDLG_HXX
-
-#include <vcl/menubtn.hxx>
-
-#include <vcl/fixed.hxx>
-#include <sfx2/evntconf.hxx>
-#include "macropg.hxx"
-
-#include <com/sun/star/frame/XFrame.hpp>
-
-class Menu;
-class SfxMacroInfoItem;
-class SvxMacroItem;
-
-class SvxEventConfigPage : public _SvxMacroTabPage
-{
- FixedText aSaveInText;
- ListBox aSaveInListBox;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xAppEvents;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xDocumentEvents;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > m_xDocumentModifiable;
-
- BOOL bAppConfig;
-
- DECL_LINK( SelectHdl_Impl, ListBox* );
-
- // Forbidden and not implemented.
- SvxEventConfigPage (const SvxEventConfigPage &);
- SvxEventConfigPage & operator= (const SvxEventConfigPage &);
-
-public:
- /// this is only to let callers know that there is a LateInit which *must* be called
- struct EarlyInit { };
- SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet, EarlyInit );
- ~SvxEventConfigPage();
-
- void LateInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
-
-protected:
- virtual BOOL FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet& );
- using _SvxMacroTabPage::Reset;
-
-private:
- void ImplInitDocument();
-};
-
-
-#endif
-
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index c84d8d5ae5..4ace0ac295 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -32,11 +32,11 @@
#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/form/XForm.hpp>
-#include <svtools/lstner.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <svl/brdcst.hxx>
#include <vcl/window.hxx>
#include <sfx2/childwin.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dockwin.hxx>
#include <sfx2/ctrlitem.hxx>
@@ -46,7 +46,7 @@
#include <vcl/dialog.hxx>
#include <vcl/group.hxx>
#include <vcl/dockwin.hxx>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmexch.hxx"
#include <connectivity/sqlparse.hxx>
#include "fmexch.hxx"
diff --git a/svx/source/inc/fmPropBrw.hxx b/svx/source/inc/fmPropBrw.hxx
index 78ee4f2e01..6208cecd1d 100644
--- a/svx/source/inc/fmPropBrw.hxx
+++ b/svx/source/inc/fmPropBrw.hxx
@@ -40,7 +40,7 @@
#include <sfx2/basedlgs.hxx>
#include <sfx2/ctrlitem.hxx>
#include <sfx2/childwin.hxx>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
//========================================================================
class FmPropBrwMgr : public SfxChildWindow
diff --git a/svx/source/inc/fmctrler.hxx b/svx/source/inc/fmctrler.hxx
index 7c127a2adf..2c266ff2d0 100644
--- a/svx/source/inc/fmctrler.hxx
+++ b/svx/source/inc/fmctrler.hxx
@@ -30,7 +30,7 @@
#ifndef _SVX_FMCTRLER_HXX
#define _SVX_FMCTRLER_HXX
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "formcontrolling.hxx"
#include "sqlparserclient.hxx"
#include "delayedevent.hxx"
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index bb008a0727..029b519049 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -30,11 +30,11 @@
#ifndef _SVX_FMEXPL_HXX
#define _SVX_FMEXPL_HXX
-#include <svtools/lstner.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <svl/brdcst.hxx>
#include <vcl/window.hxx>
#include <sfx2/childwin.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dockwin.hxx>
#include <sfx2/ctrlitem.hxx>
@@ -57,7 +57,7 @@
#include <svx/fmview.hxx>
#include "fmexch.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
class SdrObjListIter;
class FmFormShell;
diff --git a/svx/source/inc/fmitems.hxx b/svx/source/inc/fmitems.hxx
index 2cbbcb2fe4..03fe48776f 100644
--- a/svx/source/inc/fmitems.hxx
+++ b/svx/source/inc/fmitems.hxx
@@ -31,7 +31,7 @@
#define _SVX_FMITEMS_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <comphelper/uno3.hxx>
// FORWARD_DECLARE_INTERFACE(awt,XControlContainer)
FORWARD_DECLARE_INTERFACE(uno,Any)
diff --git a/svx/source/inc/fmresids.hrc b/svx/source/inc/fmresids.hrc
index 867d82dd7c..0eb47b4108 100644
--- a/svx/source/inc/fmresids.hrc
+++ b/svx/source/inc/fmresids.hrc
@@ -31,7 +31,7 @@
#define _SVX_FMRESIDS_HRC
// include -----------------------------------------------------------
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
// unnamed ressources -------------------------------------------------------
// sub ressources .....................
@@ -80,11 +80,6 @@
#define RID_SVXDLG_TAB_ORDER (RID_FORMS_START + 4)
#define RID_SVXDLG_SETFORM (RID_FORMS_START + 5)
#define RID_SVX_FMEXPLORER (RID_FORMS_START + 6)
-#define RID_SVXDLG_SEARCHFORM (RID_FORMS_START + 7)
-#define RID_SVXERR_SEARCH_NORECORD (RID_FORMS_START + 8)
-#define RID_SVXERR_SEARCH_GENERAL_ERROR (RID_FORMS_START + 9)
-#define RID_SVX_DLG_INPUTRECORDNO (RID_FORMS_START + 10)
-#define RID_SVX_DLG_SHOWGRIDCOLUMNS (RID_FORMS_START + 11)
#define RID_SVXDLG_ADD_DATAITEM (RID_FORMS_START + 12)
#define RID_SVXDLG_ADD_CONDITION (RID_FORMS_START + 13)
#define RID_SVXDLG_NAMESPACE_ITEM (RID_FORMS_START + 14)
@@ -147,8 +142,6 @@
#define RID_STR_UNDO_MODEL_REPLACE (RID_FORMS_START + 31)
#define RID_STR_NAVIGATIONBAR (RID_FORMS_START + 32)
#define RID_STR_DEFAULT_CONTROL (RID_FORMS_START + 33)
-#define RID_STR_OVERFLOW_FORWARD (RID_FORMS_START + 34)
-#define RID_STR_OVERFLOW_BACKWARD (RID_FORMS_START + 35)
#define RID_STR_FORM (RID_FORMS_START + 36)
#define RID_STR_FIELDSELECTION (RID_FORMS_START + 37)
#define RID_STR_NO_PROPERTIES (RID_FORMS_START + 38)
@@ -187,9 +180,6 @@
#define RID_STR_CONTROL (RID_FORMS_START + 71)
#define RID_STR_POSTFIX_DATE (RID_FORMS_START + 72)
#define RID_STR_POSTFIX_TIME (RID_FORMS_START + 73)
-#define RID_STR_FROM_TOP (RID_FORMS_START + 74)
-#define RID_STR_FROM_BOTTOM (RID_FORMS_START + 75)
-#define RID_STR_SEARCH_COUNTING (RID_FORMS_START + 76)
#define RID_STR_NODATACONTROLS (RID_FORMS_START + 77)
#define RID_STR_FILTER_NAVIGATOR (RID_FORMS_START + 78)
#define RID_STR_FILTER_FILTER_FOR (RID_FORMS_START + 79)
@@ -198,10 +188,6 @@
#define RID_STR_SYNTAXERROR (RID_FORMS_START + 82)
#define RID_STR_MOVING_CURSOR (RID_FORMS_START + 83)
#define RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY (RID_FORMS_START + 84)
-#define RID_STR_SEARCH_ANYWHERE (RID_FORMS_START + 85)
-#define RID_STR_SEARCH_BEGINNING (RID_FORMS_START + 86)
-#define RID_STR_SEARCH_END (RID_FORMS_START + 87)
-#define RID_STR_SEARCH_WHOLE (RID_FORMS_START + 88)
#define RID_STR_AUTOFIELD (RID_FORMS_START + 89)
#define RID_STR_SVT_SQL_SYNTAX_ERROR (RID_FORMS_START + 90)
#define RID_STR_SVT_SQL_SYNTAX_VALUE_NO_LIKE (RID_FORMS_START + 91)
diff --git a/svx/source/inc/fmsearch.hrc b/svx/source/inc/fmsearch.hrc
deleted file mode 100644
index 97704081ed..0000000000
--- a/svx/source/inc/fmsearch.hrc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fmsearch.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _FMSEARCH_HRC
-#define _FMSEARCH_HRC
-
-#define FT_SEARCHTEXT 1
-#define FT_FORM 2
-#define FT_POSITION 3
-#define FT_RECORDLABEL 4
-#define FT_RECORD 5
-#define FT_HINT 6
-
-
-#define CMB_SEARCHTEXT 1
-
-#define RB_ALLFIELDS 1
-#define RB_SINGLEFIELD 2
-#define RB_SEARCHFORTEXT 3
-#define RB_SEARCHFORNULL 4
-#define RB_SEARCHFORNOTNULL 5
-
-#define LB_FORM 1
-#define LB_FIELD 2
-#define LB_POSITION 3
-
-#define PB_APPROXSETTINGS 1
-#define PB_SEARCH 2
-#define PB_SOUNDSLIKESETTINGS 3
-
-#define FL_SEARCHFOR 1
-#define FL_WHERE 2
-#define FL_OPTIONS 3
-#define FL_STATE 4
-
-#define CB_USEFORMATTER 1
-#define CB_BACKWARD 2
-#define CB_STARTOVER 3
-#define CB_CASE 4
-#define CB_WILDCARD 5
-#define CB_REGULAR 6
-#define CB_APPROX 7
-#define CB_HALFFULLFORMS 8
-#define CB_SOUNDSLIKECJK 9
-
-#endif // _FMSEARCH_HRC
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index 0e13eedb31..5ca209bbff 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -57,21 +57,21 @@
#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
#endif
-#include <svtools/svarray.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/svarray.hxx>
+#include <svl/lstner.hxx>
#define _SVSTDARR_BOOLS
#define _SVSTDARR_BYTES
#define _SVSTDARR_LONGS
#define _SVSTDARR_ULONGS
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <sfx2/mnuitem.hxx>
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
#include "fmsrccfg.hxx"
#include <osl/mutex.hxx>
#include <vos/thread.hxx>
-#include <svtools/cancel.hxx>
+#include <svl/cancel.hxx>
#include <tools/debug.hxx>
#include <cppuhelper/component.hxx>
#include <comphelper/stl_types.hxx>
@@ -534,6 +534,7 @@ private:
// ConfigItem related stuff
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames);
+ virtual void Commit();
void implAdjustConfigCache();
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
diff --git a/svx/source/inc/fmsrcimp.hxx b/svx/source/inc/fmsrcimp.hxx
index 50cac2fe22..10ff63fd28 100644
--- a/svx/source/inc/fmsrcimp.hxx
+++ b/svx/source/inc/fmsrcimp.hxx
@@ -31,7 +31,7 @@
#ifndef _FMSRCIMP_HXX
#define _FMSRCIMP_HXX
-#include "fmtools.hxx"
+#include <svx/fmtools.hxx>
#include <vos/thread.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/awt/XTextComponent.hpp>
diff --git a/svx/source/inc/fmtools.hxx b/svx/source/inc/fmtools.hxx
deleted file mode 100644
index 3c71698f06..0000000000
--- a/svx/source/inc/fmtools.hxx
+++ /dev/null
@@ -1,383 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fmtools.hxx,v $
- * $Revision: 1.27 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_FMTOOLS_HXX
-#define _SVX_FMTOOLS_HXX
-
-#include <com/sun/star/sdb/SQLContext.hpp>
-#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
-#include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
-#include <com/sun/star/sdbc/XRowSet.hpp>
-#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
-#include <com/sun/star/sdb/XColumn.hpp>
-#include <com/sun/star/sdb/XColumnUpdate.hpp>
-#include <com/sun/star/sdb/SQLErrorEvent.hpp>
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-#include <com/sun/star/sdbc/XDataSource.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
-#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
-#include <com/sun/star/frame/XInterceptorInfo.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XStatusListener.hpp>
-#include <com/sun/star/frame/FeatureStateEvent.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/script/ScriptEventDescriptor.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/awt/XControlModel.hpp>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/awt/FontSlant.hpp>
-#include <com/sun/star/awt/FontDescriptor.hpp>
-#include <com/sun/star/awt/FontUnderline.hpp>
-#include <com/sun/star/awt/FontStrikeout.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <vcl/wintypes.hxx>
-#include <vos/mutex.hxx>
-
-#ifndef _SVSTDARR_ULONGS
-#define _SVSTDARR_ULONGS
-#include <svtools/svstdarr.hxx>
-#endif
-#include <sfx2/ctrlitem.hxx>
-#include <tools/link.hxx>
-#include <tools/date.hxx>
-#include <tools/time.hxx>
-#include <tools/datetime.hxx>
-
-#include "fmprop.hrc"
-#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/io/XObjectInputStream.hpp>
-#include <com/sun/star/io/XObjectOutputStream.hpp>
-#include <com/sun/star/io/XPersistObject.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
-#include <com/sun/star/util/XNumberFormats.hpp>
-#include <cppuhelper/interfacecontainer.h>
-#include <cppuhelper/compbase2.hxx>
-#include <cppuhelper/compbase3.hxx>
-#include <cppuhelper/weakref.hxx>
-#include <comphelper/uno3.hxx>
-#include <comphelper/stl_types.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/component.hxx>
-
-#include <svx/svxdllapi.h>
-
-#include <set>
-
-class Window;
-
-//==================================================================
-// allgemeine Typen
-//==================================================================
-// displaying a database exception for the user
-// display info about a simple ::com::sun::star::sdbc::SQLException
-void displayException(const ::com::sun::star::sdbc::SQLException&, Window* _pParent = NULL);
-void displayException(const ::com::sun::star::sdbc::SQLWarning&, Window* _pParent = NULL);
-SVX_DLLPUBLIC void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL);
-void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL);
-void displayException(const ::com::sun::star::uno::Any&, Window* _pParent = NULL);
-
-#define DATA_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) )
-#define FILTER_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterMode" ) )
-
-// Kopieren von Persistenten Objecten
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> cloneUsingProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>& _xObj);
-
-sal_Int32 findPos(const ::rtl::OUString& aStr, const ::com::sun::star::uno::Sequence< ::rtl::OUString>& rList);
-
-// Suchen in einer Indexliste nach einem Element
-sal_Bool searchElement(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& xCont, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElement);
-
-sal_Int32 getElementPos(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& xCont, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElement);
-String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xElement);
-String getFormComponentAccessPath(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xElement, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rTopLevelElement);
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> getElementFromAccessPath(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xParent, const String& _rRelativePath);
-
-
-::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> getXModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xIface);
-
-SVX_DLLPUBLIC ::rtl::OUString getLabelName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xControlModel);
-
-// ===================================================================================================
-// = class CursorWrapper - eine Hilfsklasse, die parallel mit je einem ::com::sun::star::uno::Reference<XDatabaseUpdateCursor>,
-// XDatabaseBookmarkCursor und XDatabaseDirectCursor arbeitet
-// ===================================================================================================
-
-class CursorWrapper
-{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xGeneric;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xMoveOperations;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate> m_xBookmarkOperations;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> m_xColumnsSupplier;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xPropertyAccess;
-
-public:
- // Construction/Destruction
- CursorWrapper() { }
- CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
- SVX_DLLPUBLIC CursorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned = sal_False);
- // bei bUseCloned == sal_True wird der Cursor ueber das XCloneable-Interface (dass er besitzen muss) gedoubled und
- // erst dann benutzt
-
- friend bool operator==(const CursorWrapper& lhs, const CursorWrapper& rhs)
- {
- return lhs.m_xGeneric.get() == rhs.m_xGeneric.get();
- }
-
- sal_Bool is() const { return m_xMoveOperations.is(); }
- sal_Bool Is() const { return m_xMoveOperations.is(); }
-
- CursorWrapper* operator ->() { return this; }
- operator const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& () const{ return m_xGeneric; }
-
- // 'Konvertierungen'
- const CursorWrapper& operator=(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet>& xCursor);
- operator const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& () const { return m_xMoveOperations; }
- operator const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate>& () const { return m_xBookmarkOperations; }
- operator const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier>& () const { return m_xColumnsSupplier; }
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& getPropertySet() const { return m_xPropertyAccess; }
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& getResultSet() const { return m_xMoveOperations; }
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate >& getRowLocate() const { return m_xBookmarkOperations; }
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier >& getColumnsSupplier() const { return m_xColumnsSupplier; }
-
- // das normale queryInterface
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& type) throw ( ::com::sun::star::uno::RuntimeException )
- { return m_xMoveOperations->queryInterface(type); }
-
- // ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XRowLocate>
- ::com::sun::star::uno::Any getBookmark(void)
- throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
- { return m_xBookmarkOperations->getBookmark(); }
- sal_Bool moveToBookmark(const ::com::sun::star::uno::Any& bookmark) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->moveToBookmark(bookmark); }
- sal_Bool moveRelativeToBookmark(const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows) throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->moveRelativeToBookmark(bookmark, rows); }
- sal_Int32 compareBookmarks(const ::com::sun::star::uno::Any& lhs, const ::com::sun::star::uno::Any& rhs) const throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->compareBookmarks(lhs, rhs); }
- sal_Int32 hasOrderedBookmarks(void) const throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->hasOrderedBookmarks(); }
- sal_Int32 hashBookmark(const ::com::sun::star::uno::Any& bookmark) const throw( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException ) { return m_xBookmarkOperations->hashBookmark(bookmark); }
-
- // ::com::sun::star::sdbc::XResultSet
- sal_Bool isBeforeFirst() const { return m_xMoveOperations->isBeforeFirst(); }
- sal_Bool isAfterLast() const { return m_xMoveOperations->isAfterLast(); }
- sal_Bool isFirst() const { return m_xMoveOperations->isFirst(); }
- sal_Bool isLast() const { return m_xMoveOperations->isLast(); }
- void beforeFirst() { m_xMoveOperations->beforeFirst(); }
- sal_Bool first() { return m_xMoveOperations->first(); }
- sal_Bool last() { return m_xMoveOperations->last(); }
- sal_Int32 getRow() const { return m_xMoveOperations->getRow(); }
- sal_Bool absolute(sal_Int32 nPosition) { return m_xMoveOperations->absolute(nPosition); }
- sal_Bool relative(sal_Int32 nCount) { return m_xMoveOperations->relative(nCount); }
- sal_Bool previous() { return m_xMoveOperations->previous(); }
- sal_Bool next() { return m_xMoveOperations->next(); }
- void refreshRow() { m_xMoveOperations->refreshRow(); }
- sal_Bool rowUpdated() { return m_xMoveOperations->rowUpdated(); }
- sal_Bool rowInserted() { return m_xMoveOperations->rowInserted(); }
- sal_Bool rowDeleted() { return m_xMoveOperations->rowDeleted(); }
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> getStatement() { return m_xMoveOperations->getStatement(); }
- // ::com::sun::star::sdbcx::XColumnsSupplier
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getColumns() const throw( ::com::sun::star::uno::RuntimeException ) { return m_xColumnsSupplier->getColumns(); }
-private:
- void ImplConstruct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _rxCursor, sal_Bool bUseCloned);
-};
-
-
-class FmXDisposeMultiplexer;
-class FmXDisposeListener
-{
- friend class FmXDisposeMultiplexer;
-
- FmXDisposeMultiplexer* m_pAdapter;
- ::osl::Mutex& m_rMutex;
-
-public:
- FmXDisposeListener(::osl::Mutex& _rMutex) : m_pAdapter(NULL), m_rMutex(_rMutex) { }
- virtual ~FmXDisposeListener();
-
- virtual void disposing(const ::com::sun::star::lang::EventObject& _rEvent, sal_Int16 _nId) throw( ::com::sun::star::uno::RuntimeException ) = 0;
-
-protected:
- void setAdapter(FmXDisposeMultiplexer* pAdapter);
-};
-
-typedef ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener> FmXDisposeMultiplexer_x;
-//==============================================================================
-
-
-class FmXDisposeMultiplexer :public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener>
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xObject;
- FmXDisposeListener* m_pListener;
- sal_Int16 m_nId;
-
- virtual ~FmXDisposeMultiplexer();
-public:
- FmXDisposeMultiplexer(FmXDisposeListener* _pListener, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _rxObject, sal_Int16 _nId = -1);
-
-// ::com::sun::star::lang::XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
-
- void dispose();
-};
-
-// ==================================================================
-
-//========================================================================
-//= dispatch interception helper classes
-//========================================================================
-
-//------------------------------------------------------------------------
-//- FmDispatchInterceptor
-//------------------------------------------------------------------------
-class FmDispatchInterceptor
-{
-public:
- FmDispatchInterceptor() { }
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch> interceptedQueryDispatch(sal_uInt16 _nId,
- const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( ::com::sun::star::uno::RuntimeException ) = 0;
-
- virtual ::osl::Mutex* getInterceptorMutex() = 0;
-};
-
-//------------------------------------------------------------------------
-//- FmXDispatchInterceptorImpl
-//------------------------------------------------------------------------
-typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::frame::XDispatchProviderInterceptor
- , ::com::sun::star::lang::XEventListener
- , ::com::sun::star::frame::XInterceptorInfo
- > FmXDispatchInterceptorImpl_BASE;
-
-class FmXDispatchInterceptorImpl : public FmXDispatchInterceptorImpl_BASE
-{
- ::osl::Mutex m_aFallback;
-
- // the component which's dispatches we're intercepting
- ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XDispatchProviderInterception>
- m_xIntercepted;
- sal_Bool m_bListening;
-
- // the real interceptor
- FmDispatchInterceptor* m_pMaster;
-
- // chaining
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider> m_xSlaveDispatcher;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider> m_xMasterDispatcher;
-
- // our id
- sal_Int16 m_nId;
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString >
- m_aInterceptedURLSchemes;
-
- virtual ~FmXDispatchInterceptorImpl();
-
-public:
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterception> getIntercepted() const { return m_xIntercepted; }
-
-public:
- FmXDispatchInterceptorImpl(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterception>& _rToIntercept,
- FmDispatchInterceptor* _pMaster,
- sal_Int16 _nId,
- ::com::sun::star::uno::Sequence< ::rtl::OUString > _rInterceptedSchemes /// if not empty, this will be used for getInterceptedURLs
- );
-
- // StarOne
- DECLARE_UNO3_DEFAULTS(FmXDispatchInterceptorImpl, FmXDispatchInterceptorImpl_BASE);
- // virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& type) throw ( ::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
-
-
- // ::com::sun::star::frame::XDispatchProvider
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::frame::XDispatchProviderInterceptor
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setSlaveDispatchProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xNewDispatchProvider ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setMasterDispatchProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xNewSupplier ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::frame::XInterceptorInfo
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getInterceptedURLs( ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::lang::XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
-
- // OComponentHelper
- virtual void SAL_CALL disposing();
-
-protected:
- void ImplDetach();
-
- ::osl::Mutex& getAccessSafety()
- {
- if (m_pMaster && m_pMaster->getInterceptorMutex())
- return *m_pMaster->getInterceptorMutex();
- return m_aFallback;
- }
-};
-
-//==================================================================
-// ...
-//==================================================================
-::rtl::OUString getServiceNameByControlType(sal_Int16 nType);
- // get a service name to create a model of the given type (OBJ_FM_...)
-sal_Int16 getControlTypeByObject(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo>& _rxObject);
- // get the object type (OBJ_FM_...) from the services the object supports
-
-void TransferEventScripts(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor>& rTransferIfAvailable);
-
-sal_Int16 GridView2ModelPos(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& rColumns, sal_Int16 nViewPos);
-
-//==================================================================
-sal_Bool isLoadable(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xLoad);
-sal_Bool isRowSetAlive(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rxRowSet);
- // checks if the ::com::sun::star::sdbcx::XColumnsSupplier provided by _rxRowSet supllies any columns
-
-//==================================================================
-typedef ::std::set < ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- , ::comphelper::OInterfaceCompare< ::com::sun::star::uno::XInterface >
- > InterfaceBag;
-
-#endif // _SVX_FMTOOLS_HXX
-
diff --git a/svx/source/inc/fmundo.hxx b/svx/source/inc/fmundo.hxx
index fab29dbba6..e7ae4fd9c5 100644
--- a/svx/source/inc/fmundo.hxx
+++ b/svx/source/inc/fmundo.hxx
@@ -51,7 +51,7 @@
#include <cppuhelper/implbase3.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <comphelper/uno3.hxx>
class FmFormModel;
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 2167079da1..d708ffa737 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -35,7 +35,7 @@
#include "sqlparserclient.hxx"
#include "typeconversionclient.hxx"
-#include "fmtools.hxx"
+#include "svx/fmtools.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/sdb/XColumn.hpp>
diff --git a/svx/source/inc/hlmarkwn.hrc b/svx/source/inc/hlmarkwn.hrc
deleted file mode 100644
index 911d4bdd34..0000000000
--- a/svx/source/inc/hlmarkwn.hrc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlmarkwn.hrc,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define BT_APPLY 1
-#define BT_CLOSE 2
-#define TLB_MARK 3
-
-//#define HYPERLINK_BMP_EXPAND 301
-//#define HYPERLINK_BMP_COLLAPSE 302
-
diff --git a/svx/source/inc/hlmarkwn.hxx b/svx/source/inc/hlmarkwn.hxx
deleted file mode 100644
index 1f861c6781..0000000000
--- a/svx/source/inc/hlmarkwn.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hlmarkwn.hxx,v $
- * $Revision: 1.7.216.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_BKWND_HYPERLINK_HXX
-#define _SVX_BKWND_HYPERLINK_HXX
-
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <vcl/dialog.hxx>
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
-#include <svtools/svtreebx.hxx>
-
-#include "hlmarkwn_def.hxx" //ADD CHINA001
-class SvxHyperlinkTabPageBase;
-
-//########################################################################
-//# #
-//# Tree-Window #
-//# #
-//########################################################################
-
-class SvxHlinkDlgMarkWnd;
-
-class SvxHlmarkTreeLBox : public SvTreeListBox
-{
-private:
- SvxHlinkDlgMarkWnd* mpParentWnd;
-
-public:
- SvxHlmarkTreeLBox( Window* pParent, const ResId& rResId );
-
- virtual void Paint( const Rectangle& rRect );
-};
-
-//########################################################################
-//# #
-//# Window-Class #
-//# #
-//########################################################################
-
-class SvxHlinkDlgMarkWnd : public ModalDialog //FloatingWindow
-{
-private:
- friend class SvxHlmarkTreeLBox;
-
- PushButton maBtApply;
- PushButton maBtClose;
- //SvTreeListBox maLbTree;
- SvxHlmarkTreeLBox maLbTree;
-
- BOOL mbUserMoved;
- BOOL mbFirst;
-
- SvxHyperlinkTabPageBase* mpParent;
-
- String maStrLastURL;
-
- USHORT mnError;
-
-protected:
- BOOL RefreshFromDoc( ::rtl::OUString aURL );
-
- SvLBoxEntry* FindEntry ( String aStrName );
- void ClearTree();
- int FillTree( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xLinks, SvLBoxEntry* pParentEntry =NULL );
-
- virtual void Move ();
-
- DECL_LINK (ClickApplyHdl_Impl, void * );
- DECL_LINK (ClickCloseHdl_Impl, void * );
-
-public:
- SvxHlinkDlgMarkWnd (SvxHyperlinkTabPageBase *pParent);
- ~SvxHlinkDlgMarkWnd();
-
- BOOL MoveTo ( Point aNewPos );
- void RefreshTree ( String aStrURL );
- void SelectEntry ( String aStrMark );
-
- BOOL ConnectToDialog( BOOL bDoit = TRUE );
-
- USHORT SetError( USHORT nError);
-};
-
-
-#endif // _SVX_BKWND_HYPERLINK_HXX
diff --git a/svx/source/inc/hyperdlg.hrc b/svx/source/inc/hyperdlg.hrc
deleted file mode 100644
index d6725cd74c..0000000000
--- a/svx/source/inc/hyperdlg.hrc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: hyperdlg.hrc,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* Tabpage : Hyperlink - Internet */
-
-#define GRP_LINKTYPE 1
-#define RB_LINKTYP_INTERNET 2
-#define RB_LINKTYP_FTP 3
-#define RB_LINKTYP_TELNET 4
-#define FT_TARGET_HTML 5
-#define CB_TARGET_HTML 6
-#define FT_LOGIN 7
-#define ED_LOGIN 8
-#define FT_PASSWD 9
-#define ED_PASSWD 10
-#define CBX_ANONYMOUS 11
-#define BTN_BROWSE 12
-#define BTN_TARGET 13
-#define IMG_BROWSE_HC 14
-#define IMG_TARGET_HC 15
-
-/* Tabpage : Hyperlink - Mail & News */
-
-#define GRP_MAILNEWS 1
-#define RB_LINKTYP_MAIL 2
-#define RB_LINKTYP_NEWS 3
-#define FT_RECEIVER 4
-#define CB_RECEIVER 5
-#define FT_SUBJECT 6
-#define ED_SUBJECT 7
-#define BTN_ADRESSBOOK 8
-#define IMG_ADRESSBOOK_HC 9
-
-/* Tabpage : Hyperlink - Document */
-
-#define GRP_DOCUMENT 1
-#define FT_PATH_DOC 2
-#define CB_PATH_DOC 3
-#define BTN_FILEOPEN 4
-#define GRP_TARGET 5
-#define FT_TARGET_DOC 6
-#define ED_TARGET_DOC 7
-#define FT_URL 8
-#define FT_FULL_URL 9
-#define IMG_FILEOPEN_HC 10
-
-/* Tabpage : Hyperlink - New document */
-
-#define GRP_NEWDOCUMENT 1
-#define RB_EDITNOW 2
-#define RB_EDITLATER 3
-#define FT_PATH_NEWDOC 4
-#define ED_PATH_NEWDOC 5
-#define FT_DOCUMENT_TYPES 6
-#define LB_DOCUMENT_TYPES 7
-#define BTN_CREATE 8
-#define IMG_CREATE_HC 9
-
-/* Tabpage-section : Hyperlink - more justifications */
-
-#define GRP_MORE 30
-#define FT_FRAME 31
-#define CB_FRAME 32
-#define FT_FORM 33
-#define LB_FORM 34
-#define FT_INDICATION 35
-#define ED_INDICATION 36
-#define FT_TEXT 37
-#define ED_TEXT 38
-#define BTN_SCRIPT 39
-#define IMG_SCRIPT_HC 40
-
-#define COL_OLD 54
-#define COL_2 63
-#define COL_DIFF (COL_2 - COL_OLD)
-
diff --git a/svx/source/inc/macropg_impl.hxx b/svx/source/inc/macropg_impl.hxx
deleted file mode 100644
index 31cfed0726..0000000000
--- a/svx/source/inc/macropg_impl.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: macropg_impl.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MACROPG_IMPL_HXX
-#define _MACROPG_IMPL_HXX
-
-class _SvxMacroTabPage_Impl
-{
-public:
- _SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
- ~_SvxMacroTabPage_Impl();
-
- FixedText* pAssignFT;
- PushButton* pAssignPB;
- PushButton* pAssignComponentPB;
- PushButton* pDeletePB;
- Image* pMacroImg;
- Image* pComponentImg;
- Image* pMacroImg_h;
- Image* pComponentImg_h;
- String* pStrEvent;
- String* pAssignedMacro;
- _HeaderTabListBox* pEventLB;
- BOOL bReadOnly;
- BOOL bIDEDialogMode;
-};
-
-class AssignComponentDialog : public ModalDialog
-{
-private:
- FixedText maMethodLabel;
- Edit maMethodEdit;
- OKButton maOKButton;
- CancelButton maCancelButton;
- HelpButton maHelpButton;
-
- ::rtl::OUString maURL;
-
- DECL_LINK(ButtonHandler, Button *);
-
-public:
- AssignComponentDialog( Window * pParent, const ::rtl::OUString& rURL );
- ~AssignComponentDialog();
-
- ::rtl::OUString getURL( void ) const
- { return maURL; }
-};
-
-#endif
diff --git a/svx/source/inc/optchart.hrc b/svx/source/inc/optchart.hrc
deleted file mode 100644
index d22735ea64..0000000000
--- a/svx/source/inc/optchart.hrc
+++ /dev/null
@@ -1,40 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optchart.hrc,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// tab page for setting the default colors used for new charts
-
-#define FL_CHART_COLOR_LIST 1
-#define LB_CHART_COLOR_LIST 2
-
-#define FL_COLOR_BOX 3
-#define CT_COLOR_BOX 4
-
-#define PB_RESET_TO_DEFAULT 5
-
diff --git a/svx/source/inc/optdict.hrc b/svx/source/inc/optdict.hrc
deleted file mode 100644
index d11ce46407..0000000000
--- a/svx/source/inc/optdict.hrc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optdict.hrc,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_OPTDICT_HRC
-#define _SVX_OPTDICT_HRC
-
-// defines ------------------------------------------------------------------
-
-#define FT_DICTNAME 10
-#define ED_DICTNAME 11
-#define FT_DICTLANG 12
-#define LB_DICTLANG 13
-#define BTN_EXCEPT 14
-#define GB_NEWDICT 15
-
-#define BTN_NEWDICT_OK 20
-#define BTN_NEWDICT_ESC 21
-#define BTN_NEWDICT_HLP 22
-
-#define FT_BOOK 30
-#define FT_CONTENT 31
-#define LB_ALLDICTS 32
-#define GB_EDITDICTS 34
-#define FT_WORD 35
-#define ED_WORD 36
-#define FT_REPLACE 37
-#define ED_REPLACE 38
-#define PB_NEW_REPLACE 39
-#define PB_DELETE_REPLACE 40
-#define TLB_REPLACE 41
-#define STR_MODIFY 42
-
-#define BTN_EDITCLOSE 50
-#define BTN_EDITNEW 51
-#define BTN_EDITCHANGE 52
-#define BTN_EDITREMOVE 53
-#define BTN_EDITHELP 54
-
-
-
-#endif
-
diff --git a/svx/source/inc/svdoimp.hxx b/svx/source/inc/svdoimp.hxx
index 5f093b375e..33b84ce08e 100644
--- a/svx/source/inc/svdoimp.hxx
+++ b/svx/source/inc/svdoimp.hxx
@@ -33,7 +33,7 @@
#include <vcl/mapmod.hxx>
-//#include <svtools/lstner.hxx>
+//#include <svl/lstner.hxx>
//#include <vcl/timer.hxx>
//#include <svx/svdsob.hxx>
//#include <svx/svdtypes.hxx> // fuer SdrLayerID
diff --git a/svx/source/inc/tabwin.hxx b/svx/source/inc/tabwin.hxx
index f4a4ecb0b0..6316799a57 100644
--- a/svx/source/inc/tabwin.hxx
+++ b/svx/source/inc/tabwin.hxx
@@ -38,7 +38,7 @@
#include <com/sun/star/form/XForm.hpp>
//#ifndef _SVX_FMTOOLS_HXX
-//#include "fmtools.hxx"
+//#include "svx/fmtools.hxx"
//#endif
#include <comphelper/propmultiplex.hxx>
#include <svtools/transfer.hxx>
diff --git a/svx/source/inc/unoedprx.hxx b/svx/source/inc/unoedprx.hxx
index 8edb9c773d..9235e212ba 100644
--- a/svx/source/inc/unoedprx.hxx
+++ b/svx/source/inc/unoedprx.hxx
@@ -32,7 +32,7 @@
#define _SVX_UNOEDPRX_HXX
#include <memory>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <svx/unoedsrc.hxx>
#include <svx/editdata.hxx>
diff --git a/svx/source/intro/iso.src b/svx/source/intro/iso.src
index 66cac43b3b..5731087c48 100644
--- a/svx/source/intro/iso.src
+++ b/svx/source/intro/iso.src
@@ -33,7 +33,7 @@
#endif
#ifndef _SVTOOLS_HRC
-#include <svtools/svtools.hrc>
+#include <svl/svtools.hrc>
#endif
#include "intro.hrc"
diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src
index a29ea00665..fbe7d9b09f 100644
--- a/svx/source/intro/ooo.src
+++ b/svx/source/intro/ooo.src
@@ -29,7 +29,7 @@
************************************************************************/
#ifndef _SVTOOLS_HRC
-#include <svtools/svtools.hrc>
+#include <svl/svtools.hrc>
#endif
#ifndef _SVTOOLS_IMAGEMGR_HRC
diff --git a/svx/source/items/SmartTagItem.cxx b/svx/source/items/SmartTagItem.cxx
index b2fae878a7..9155d5049e 100644
--- a/svx/source/items/SmartTagItem.cxx
+++ b/svx/source/items/SmartTagItem.cxx
@@ -40,7 +40,7 @@
#endif
-//#include <svtools/memberid.hrc>
+//#include <svl/memberid.hrc>
//#include "svxids.hrc"
//#include "svxitems.hrc"
diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx
index f588a7035a..26b4a4cfb8 100644
--- a/svx/source/items/clipfmtitem.cxx
+++ b/svx/source/items/clipfmtitem.cxx
@@ -34,7 +34,7 @@
#define _SVSTDARR_ULONGS
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <clipfmtitem.hxx>
#include <com/sun/star/frame/status/ClipboardFormats.hpp>
diff --git a/svx/source/items/flditem.cxx b/svx/source/items/flditem.cxx
index 361b8d1750..486debf4b2 100644
--- a/svx/source/items/flditem.cxx
+++ b/svx/source/items/flditem.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <vcl/metaact.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <tools/urlobj.hxx>
#define _SVX_FLDITEM_CXX
diff --git a/svx/source/items/frmitems.cxx b/svx/source/items/frmitems.cxx
index 5b1bef3c9c..2ef2ff6f57 100644
--- a/svx/source/items/frmitems.cxx
+++ b/svx/source/items/frmitems.cxx
@@ -52,14 +52,14 @@
#define _SVX_FRMITEMS_CXX
-#include <svtools/memberid.hrc>
+#include <svl/memberid.hrc>
#include <svtools/wallitem.hxx>
-#include <svtools/cntwall.hxx>
+#include <svl/cntwall.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
-#include <impgrf.hxx>
+#include <svx/impgrf.hxx>
#include <svx/svxids.hrc>
#include <svx/svxitems.hrc>
#include <svx/dialogs.hrc>
diff --git a/svx/source/items/makefile.mk b/svx/source/items/makefile.mk
index ef4bf0b001..d99f1705f5 100644
--- a/svx/source/items/makefile.mk
+++ b/svx/source/items/makefile.mk
@@ -50,6 +50,7 @@ LIBTARGET=NO
SRS1NAME=svxitems
SRC1FILES = \
svxerr.src \
+ page.src \
svxitems.src
LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 96ce38d50b..1e90d7699b 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -40,8 +40,8 @@
#include <i18npool/mslangid.hxx>
#define _ZFORLIST_DECLARE_TABLE
-#include <svtools/zforlist.hxx>
-#include <svtools/zformat.hxx>
+#include <svl/zforlist.hxx>
+#include <svl/zformat.hxx>
#include <svtools/langtab.hxx>
#include <vcl/svapp.hxx>
diff --git a/svx/source/items/page.src b/svx/source/items/page.src
new file mode 100644
index 0000000000..966d5e66e3
--- /dev/null
+++ b/svx/source/items/page.src
@@ -0,0 +1,258 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: page.src,v $
+ * $Revision: 1.71 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+ // include ---------------------------------------------------------------
+
+#include <svx/dialogs.hrc>
+
+String RID_SVXSTR_PAPER_A0
+{
+ Text = "A0" ;
+};
+String RID_SVXSTR_PAPER_A1
+{
+ Text = "A1" ;
+};
+String RID_SVXSTR_PAPER_A2
+{
+ Text = "A2" ;
+};
+String RID_SVXSTR_PAPER_A3
+{
+ Text = "A3" ;
+};
+String RID_SVXSTR_PAPER_A4
+{
+ Text = "A4" ;
+};
+String RID_SVXSTR_PAPER_A5
+{
+ Text = "A5" ;
+};
+String RID_SVXSTR_PAPER_B4_ISO
+{
+ Text = "B4 (ISO)" ;
+};
+String RID_SVXSTR_PAPER_B5_ISO
+{
+ Text = "B5 (ISO)" ;
+};
+String RID_SVXSTR_PAPER_LETTER
+{
+ Text = "Letter" ;
+};
+String RID_SVXSTR_PAPER_LEGAL
+{
+ Text = "Legal" ;
+};
+String RID_SVXSTR_PAPER_TABLOID
+{
+ Text = "Tabloid" ;
+};
+String RID_SVXSTR_PAPER_USER
+{
+ Text [ en-US ] = "User Defined" ;
+};
+String RID_SVXSTR_PAPER_B6_ISO
+{
+ Text = "B6 (ISO)" ;
+};
+String RID_SVXSTR_PAPER_C4
+{
+ Text = "C4 Envelope" ;
+};
+String RID_SVXSTR_PAPER_C5
+{
+ Text = "C5 Envelope" ;
+};
+String RID_SVXSTR_PAPER_C6
+{
+ Text = "C6 Envelope" ;
+};
+String RID_SVXSTR_PAPER_C65
+{
+ Text = "C6/5 Envelope" ;
+};
+String RID_SVXSTR_PAPER_DL
+{
+ Text = "DL Envelope" ;
+};
+String RID_SVXSTR_PAPER_DIA
+{
+ Text = "Dia Slide" ;
+};
+String RID_SVXSTR_PAPER_SCREEN
+{
+ Text [ en-US ] = "Screen" ;
+};
+String RID_SVXSTR_PAPER_C
+{
+ Text = "C" ;
+};
+String RID_SVXSTR_PAPER_D
+{
+ Text = "D" ;
+};
+String RID_SVXSTR_PAPER_E
+{
+ Text = "E" ;
+};
+String RID_SVXSTR_PAPER_EXECUTIVE
+{
+ Text = "Executive" ;
+};
+String RID_SVXSTR_PAPER_LEGAL2
+{
+ Text = "Long Bond" ;
+};
+String RID_SVXSTR_PAPER_MONARCH
+{
+ Text = "#8 (Monarch) Envelope" ;
+};
+String RID_SVXSTR_PAPER_COM675
+{
+ Text = "#6 3/4 (Personal) Envelope" ;
+};
+String RID_SVXSTR_PAPER_COM9
+{
+ Text = "#9 Envelope" ;
+};
+String RID_SVXSTR_PAPER_COM10
+{
+ Text = "#10 Envelope" ;
+};
+String RID_SVXSTR_PAPER_COM11
+{
+ Text = "#11 Envelope" ;
+};
+String RID_SVXSTR_PAPER_COM12
+{
+ Text = "#12 Envelope" ;
+};
+String RID_SVXSTR_PAPER_KAI16
+{
+ Text = "16 Kai" ;
+};
+String RID_SVXSTR_PAPER_KAI32
+{
+ Text = "32 Kai" ;
+};
+String RID_SVXSTR_PAPER_KAI32BIG
+{
+ Text = "Big 32 Kai" ;
+};
+String RID_SVXSTR_PAPER_B4_JIS
+{
+ Text = "B4 (JIS)" ;
+};
+String RID_SVXSTR_PAPER_B5_JIS
+{
+ Text = "B5 (JIS)" ;
+};
+String RID_SVXSTR_PAPER_B6_JIS
+{
+ Text = "B6 (JIS)" ;
+};
+String RID_SVXSTR_PAPERBIN
+{
+ Text [ en-US ] = "Paper tray" ;
+};
+String RID_SVXSTR_PAPERBIN_SETTINGS
+{
+ Text [ en-US ] = "[From printer settings]" ;
+};
+ // ********************************************************************** EOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index e01db0cffb..5268071f9c 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -40,7 +40,7 @@
#include <svx/unomid.hxx>
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/style/BreakType.hpp>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
using namespace ::rtl;
using namespace ::com::sun::star;
diff --git a/svx/source/items/paraitem.cxx b/svx/source/items/paraitem.cxx
index 56436448d7..5fc1e51908 100644
--- a/svx/source/items/paraitem.cxx
+++ b/svx/source/items/paraitem.cxx
@@ -39,7 +39,7 @@
#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
#endif
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <comphelper/types.hxx>
@@ -51,9 +51,9 @@ using namespace ::com::sun::star;
#define GLOBALOVERFLOW3
#define _SVX_PARAITEM_CXX
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
-#include <svtools/memberid.hrc>
+#include <svl/memberid.hrc>
#include <svx/svxitems.hrc>
#include <svx/lspcitem.hxx>
@@ -283,7 +283,7 @@ SfxItemPresentation SvxLineSpacingItem::GetPresentation
XubString& rText, const IntlWrapper *
) const
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
rText.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "SvxLineSpacingItem" ));
#else
rText.Erase();
diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx
index 8460558e67..b241e08996 100644
--- a/svx/source/items/textitem.cxx
+++ b/svx/source/items/textitem.cxx
@@ -47,7 +47,7 @@
#define GLOBALOVERFLOW3
-#include <svtools/memberid.hrc>
+#include <svl/memberid.hrc>
#include <svx/svxids.hrc>
#include <svx/svxitems.hrc>
#include <vcl/vclenum.hxx>
@@ -56,10 +56,10 @@
#include <rtl/ustring.hxx>
#include <i18npool/mslangid.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svtools/langtab.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svtools/ctrltool.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
diff --git a/svx/source/mnuctrls/SmartTagCtl.cxx b/svx/source/mnuctrls/SmartTagCtl.cxx
index c3cd979955..221bd147fc 100644
--- a/svx/source/mnuctrls/SmartTagCtl.cxx
+++ b/svx/source/mnuctrls/SmartTagCtl.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/container/XStringKeyMap.hpp>
#endif
#include <svtools/stdmenu.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/dispatch.hxx>
#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx
index ddb8671064..0e93d05e90 100644
--- a/svx/source/mnuctrls/clipboardctl.cxx
+++ b/svx/source/mnuctrls/clipboardctl.cxx
@@ -35,9 +35,9 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <tools/gen.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <sot/exchange.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <vcl/toolbox.hxx>
#include <clipboardctl.hxx>
#include <clipfmtitem.hxx>
diff --git a/svx/source/mnuctrls/fntszctl.cxx b/svx/source/mnuctrls/fntszctl.cxx
index 5b478be7b0..c279e75633 100644
--- a/svx/source/mnuctrls/fntszctl.cxx
+++ b/svx/source/mnuctrls/fntszctl.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <string> // HACK: prevent conflict between STLPORT and Workshop headern
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svtools/stdmenu.hxx>
#include <svtools/ctrltool.hxx>
#include <sfx2/app.hxx>
diff --git a/svx/source/msfilter/countryid.cxx b/svx/source/msfilter/countryid.cxx
deleted file mode 100644
index a6fcd73d0a..0000000000
--- a/svx/source/msfilter/countryid.cxx
+++ /dev/null
@@ -1,345 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: countryid.cxx,v $
- * $Revision: 1.8.242.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-// ============================================================================
-#include "countryid.hxx"
-
-#include <algorithm>
-
-// ----------------------------------------------------------------------------
-
-namespace svx {
-
-// Mapping table ==============================================================
-
-namespace {
-
-// ----------------------------------------------------------------------------
-
-/** Table entry for Windows country ID <-> language type conversion.
-
- The first member is the Windows country ID, as defined in the header.
-
- The second member contains the corresponding language type for each country
- ID. This must be a full language, not only the primary language type.
-
- The last bool flag defines, if the sub language type should be evaluated to
- find the country ID from a language. If not set, all languages map to the
- country which contain the given primary language type.
-
- Example: The language entry (COUNTRY_USA,LANGUAGE_ENGLISH_US,false) maps
- the country ID for USA to the language LANGUAGE_ENGLISH_US. The clear sub
- language flag causes all english languages LANGUAGE_ENGLISH_*** to map to
- this country ID by default. To map the special case LANGUAGE_ENGLISH_EIRE
- to the country ID COUNTRY_IRELAND, the sub language flag must be set in the
- respective table entry, here (COUNTRY_IRELAND,LANGUAGE_ENGLISH_EIRE,true).
- */
-struct CountryEntry
-{
- CountryId meCountry; /// Windows country ID.
- LanguageType meLanguage; /// Corresponding language type.
- bool mbUseSubLang; /// false = Primary only, true = Primary and sub language.
-};
-
-// ----------------------------------------------------------------------------
-
-/** Table for Windows country ID <-> language type conversion.
-
- To map the same language to different country IDs, some of the entries
- should contain a set sub language flag (see description of CountryEntry).
- All table entries with a set flag take priority over the entry with the
- same primary language, but cleared sub language flag, regardless of the
- position in the table.
-
- To map different languages to the same country ID, several entries with the
- same country ID may be inserted. In this case the conversion to a language
- is done with the first found entry (starting from top) containing the given
- country ID.
-
- For now all entries are sorted by country ID, but this is not required.
- */
-static const CountryEntry pTable[] =
-{
- { COUNTRY_USA, LANGUAGE_ENGLISH_US, false },
- { COUNTRY_DOMINICAN_REPUBLIC, LANGUAGE_SPANISH_DOMINICAN_REPUBLIC, true },
- { COUNTRY_JAMAICA, LANGUAGE_ENGLISH_JAMAICA, true },
- { COUNTRY_PUERTO_RICO, LANGUAGE_SPANISH_PUERTO_RICO, true },
- { COUNTRY_TRINIDAD_Y_TOBAGO, LANGUAGE_ENGLISH_TRINIDAD, true },
- { COUNTRY_CANADA, LANGUAGE_ENGLISH_CAN, true },
- { COUNTRY_CANADA, LANGUAGE_FRENCH_CANADIAN, true },
- { COUNTRY_RUSSIA, LANGUAGE_RUSSIAN, false },
- { COUNTRY_KAZAKHSTAN, LANGUAGE_KAZAK, false },
- { COUNTRY_TATARSTAN, LANGUAGE_TATAR, false },
- { COUNTRY_EGYPT, LANGUAGE_ARABIC_EGYPT, true },
- { COUNTRY_SOUTH_AFRICA, LANGUAGE_AFRIKAANS, false },
- { COUNTRY_SOUTH_AFRICA, LANGUAGE_ENGLISH_SAFRICA, true },
- { COUNTRY_SOUTH_AFRICA, LANGUAGE_TSONGA, false },
- { COUNTRY_SOUTH_AFRICA, LANGUAGE_VENDA, false },
- { COUNTRY_SOUTH_AFRICA, LANGUAGE_XHOSA, false },
- { COUNTRY_SOUTH_AFRICA, LANGUAGE_ZULU, false },
- { COUNTRY_GREECE, LANGUAGE_GREEK, false },
- { COUNTRY_NETHERLANDS, LANGUAGE_DUTCH, false },
- { COUNTRY_NETHERLANDS, LANGUAGE_FRISIAN_NETHERLANDS, false },
- { COUNTRY_BELGIUM, LANGUAGE_DUTCH_BELGIAN, true },
- { COUNTRY_BELGIUM, LANGUAGE_FRENCH_BELGIAN, true },
- { COUNTRY_FRANCE, LANGUAGE_FRENCH, false },
- { COUNTRY_SPAIN, LANGUAGE_SPANISH_MODERN, false },
- { COUNTRY_SPAIN, LANGUAGE_SPANISH_DATED, false },
- { COUNTRY_SPAIN, LANGUAGE_CATALAN, false },
- { COUNTRY_SPAIN, LANGUAGE_BASQUE, false },
- { COUNTRY_SPAIN, LANGUAGE_GALICIAN, false },
- { COUNTRY_HUNGARY, LANGUAGE_HUNGARIAN, false },
- { COUNTRY_ITALY, LANGUAGE_ITALIAN, false },
- { COUNTRY_ROMANIA, LANGUAGE_ROMANIAN, false },
- { COUNTRY_SWITZERLAND, LANGUAGE_GERMAN_SWISS, true },
- { COUNTRY_SWITZERLAND, LANGUAGE_FRENCH_SWISS, true },
- { COUNTRY_SWITZERLAND, LANGUAGE_ITALIAN_SWISS, true },
- { COUNTRY_SWITZERLAND, LANGUAGE_RHAETO_ROMAN, false },
- { COUNTRY_AUSTRIA, LANGUAGE_GERMAN_AUSTRIAN, true },
- { COUNTRY_UNITED_KINGDOM, LANGUAGE_ENGLISH_UK, true },
- { COUNTRY_UNITED_KINGDOM, LANGUAGE_GAELIC_SCOTLAND, true },
- { COUNTRY_UNITED_KINGDOM, LANGUAGE_WELSH, false },
- { COUNTRY_DENMARK, LANGUAGE_DANISH, false },
- { COUNTRY_SWEDEN, LANGUAGE_SWEDISH, false },
- { COUNTRY_SWEDEN, LANGUAGE_SAMI_LAPPISH, false },
- { COUNTRY_NORWAY, LANGUAGE_NORWEGIAN_BOKMAL, false },
- { COUNTRY_POLAND, LANGUAGE_POLISH, false },
- { COUNTRY_GERMANY, LANGUAGE_GERMAN, false },
- { COUNTRY_GERMANY, LANGUAGE_SORBIAN, false },
- { COUNTRY_PERU, LANGUAGE_SPANISH_PERU, true },
- { COUNTRY_MEXICO, LANGUAGE_SPANISH_MEXICAN, true },
- { COUNTRY_ARGENTINIA, LANGUAGE_SPANISH_ARGENTINA, true },
- { COUNTRY_BRAZIL, LANGUAGE_PORTUGUESE_BRAZILIAN, true },
- { COUNTRY_CHILE, LANGUAGE_SPANISH_CHILE, true },
- { COUNTRY_COLOMBIA, LANGUAGE_SPANISH_COLOMBIA, true },
- { COUNTRY_VENEZUELA, LANGUAGE_SPANISH_VENEZUELA, true },
- { COUNTRY_MALAYSIA, LANGUAGE_MALAY_MALAYSIA, false },
- { COUNTRY_AUSTRALIA, LANGUAGE_ENGLISH_AUS, true },
- { COUNTRY_INDONESIA, LANGUAGE_INDONESIAN, false },
- { COUNTRY_PHILIPPINES, LANGUAGE_ENGLISH_PHILIPPINES, true },
- { COUNTRY_NEW_ZEALAND, LANGUAGE_MAORI_NEW_ZEALAND, false },
- { COUNTRY_NEW_ZEALAND, LANGUAGE_ENGLISH_NZ, true },
- { COUNTRY_SINGAPORE, LANGUAGE_CHINESE_SINGAPORE, true },
- { COUNTRY_THAILAND, LANGUAGE_THAI, false },
- { COUNTRY_JAPAN, LANGUAGE_JAPANESE, false },
- { COUNTRY_SOUTH_KOREA, LANGUAGE_KOREAN, false },
- { COUNTRY_VIET_NAM, LANGUAGE_VIETNAMESE, false },
- { COUNTRY_PR_CHINA, LANGUAGE_CHINESE_SIMPLIFIED, false },
- { COUNTRY_TIBET, LANGUAGE_TIBETAN, false },
- { COUNTRY_TURKEY, LANGUAGE_TURKISH, false },
- { COUNTRY_INDIA, LANGUAGE_HINDI, false },
- { COUNTRY_INDIA, LANGUAGE_URDU_INDIA, true },
- { COUNTRY_INDIA, LANGUAGE_PUNJABI, false },
- { COUNTRY_INDIA, LANGUAGE_GUJARATI, false },
- { COUNTRY_INDIA, LANGUAGE_ORIYA, false },
- { COUNTRY_INDIA, LANGUAGE_TAMIL, false },
- { COUNTRY_INDIA, LANGUAGE_TELUGU, false },
- { COUNTRY_INDIA, LANGUAGE_KANNADA, false },
- { COUNTRY_INDIA, LANGUAGE_MALAYALAM, false },
- { COUNTRY_INDIA, LANGUAGE_ASSAMESE, false },
- { COUNTRY_INDIA, LANGUAGE_MARATHI, false },
- { COUNTRY_INDIA, LANGUAGE_SANSKRIT, false },
- { COUNTRY_INDIA, LANGUAGE_KONKANI, false },
- { COUNTRY_INDIA, LANGUAGE_MANIPURI, false },
- { COUNTRY_INDIA, LANGUAGE_SINDHI, false },
- { COUNTRY_INDIA, LANGUAGE_KASHMIRI, false },
- { COUNTRY_PAKISTAN, LANGUAGE_URDU_PAKISTAN, false },
- { COUNTRY_MYANMAR, LANGUAGE_BURMESE, false },
- { COUNTRY_MOROCCO, LANGUAGE_ARABIC_MOROCCO, true },
- { COUNTRY_ALGERIA, LANGUAGE_ARABIC_ALGERIA, true },
- { COUNTRY_TUNISIA, LANGUAGE_ARABIC_TUNISIA, true },
- { COUNTRY_LIBYA, LANGUAGE_ARABIC_LIBYA, true },
- { COUNTRY_SENEGAL, LANGUAGE_FRENCH_SENEGAL, true },
- { COUNTRY_MALI, LANGUAGE_FRENCH_MALI, true },
- { COUNTRY_COTE_D_IVOIRE, LANGUAGE_FRENCH_COTE_D_IVOIRE, true },
- { COUNTRY_CAMEROON, LANGUAGE_FRENCH_CAMEROON, true },
- { COUNTRY_ZAIRE, LANGUAGE_FRENCH_ZAIRE, true },
- { COUNTRY_RWANDA, LANGUAGE_KINYARWANDA_RWANDA, false },
- { COUNTRY_KENYA, LANGUAGE_SWAHILI, false },
- { COUNTRY_REUNION, LANGUAGE_FRENCH_REUNION, true },
- { COUNTRY_ZIMBABWE, LANGUAGE_ENGLISH_ZIMBABWE, true },
- { COUNTRY_LESOTHO, LANGUAGE_SESOTHO, false },
- { COUNTRY_BOTSWANA, LANGUAGE_TSWANA, false },
- { COUNTRY_FAEROE_ISLANDS, LANGUAGE_FAEROESE, false },
- { COUNTRY_PORTUGAL, LANGUAGE_PORTUGUESE, false },
- { COUNTRY_LUXEMBOURG, LANGUAGE_GERMAN_LUXEMBOURG, true },
- { COUNTRY_LUXEMBOURG, LANGUAGE_FRENCH_LUXEMBOURG, true },
- { COUNTRY_IRELAND, LANGUAGE_ENGLISH_EIRE, true },
- { COUNTRY_IRELAND, LANGUAGE_GAELIC_IRELAND, true },
- { COUNTRY_ICELAND, LANGUAGE_ICELANDIC, false },
- { COUNTRY_ALBANIA, LANGUAGE_ALBANIAN, false },
- { COUNTRY_MALTA, LANGUAGE_MALTESE, false },
- { COUNTRY_FINLAND, LANGUAGE_FINNISH, false },
- { COUNTRY_FINLAND, LANGUAGE_SWEDISH_FINLAND, true },
- { COUNTRY_BULGARIA, LANGUAGE_BULGARIAN, false },
- { COUNTRY_LITHUANIA, LANGUAGE_LITHUANIAN, false },
- { COUNTRY_LATVIA, LANGUAGE_LATVIAN, false },
- { COUNTRY_ESTONIA, LANGUAGE_ESTONIAN, false },
- { COUNTRY_MOLDOVA, LANGUAGE_ROMANIAN_MOLDOVA, true },
- { COUNTRY_MOLDOVA, LANGUAGE_RUSSIAN_MOLDOVA, true },
- { COUNTRY_ARMENIA, LANGUAGE_ARMENIAN, false },
- { COUNTRY_BELARUS, LANGUAGE_BELARUSIAN, false },
- { COUNTRY_MONACO, LANGUAGE_FRENCH_MONACO, true },
- { COUNTRY_UKRAINE, LANGUAGE_UKRAINIAN, false },
- { COUNTRY_SERBIA, LANGUAGE_SERBIAN_LATIN, false },
- { COUNTRY_CROATIA, LANGUAGE_CROATIAN, true }, // sub type of LANGUAGE_SERBIAN
- { COUNTRY_SLOVENIA, LANGUAGE_SLOVENIAN, false },
- { COUNTRY_MACEDONIA, LANGUAGE_MACEDONIAN, false },
- { COUNTRY_CZECH, LANGUAGE_CZECH, false },
- { COUNTRY_SLOVAK, LANGUAGE_SLOVAK, false },
- { COUNTRY_LIECHTENSTEIN, LANGUAGE_GERMAN_LIECHTENSTEIN, true },
- { COUNTRY_BELIZE, LANGUAGE_ENGLISH_BELIZE, true },
- { COUNTRY_GUATEMALA, LANGUAGE_SPANISH_GUATEMALA, true },
- { COUNTRY_EL_SALVADOR, LANGUAGE_SPANISH_EL_SALVADOR, true },
- { COUNTRY_HONDURAS, LANGUAGE_SPANISH_HONDURAS, true },
- { COUNTRY_NICARAGUA, LANGUAGE_SPANISH_NICARAGUA, true },
- { COUNTRY_COSTA_RICA, LANGUAGE_SPANISH_COSTARICA, true },
- { COUNTRY_PANAMA, LANGUAGE_SPANISH_PANAMA, true },
- { COUNTRY_BOLIVIA, LANGUAGE_SPANISH_BOLIVIA, true },
- { COUNTRY_ECUADOR, LANGUAGE_SPANISH_ECUADOR, true },
- { COUNTRY_PARAGUAY, LANGUAGE_SPANISH_PARAGUAY, true },
- { COUNTRY_URUGUAY, LANGUAGE_SPANISH_URUGUAY, true },
- { COUNTRY_BRUNEI_DARUSSALAM, LANGUAGE_MALAY_BRUNEI_DARUSSALAM, true },
- { COUNTRY_HONG_KONG, LANGUAGE_CHINESE_HONGKONG, true },
- { COUNTRY_MACAU, LANGUAGE_CHINESE_MACAU, true },
- { COUNTRY_CAMBODIA, LANGUAGE_KHMER, false },
- { COUNTRY_LAOS, LANGUAGE_LAO, false },
- { COUNTRY_BANGLADESH, LANGUAGE_BENGALI, false },
- { COUNTRY_TAIWAN, LANGUAGE_CHINESE_TRADITIONAL, true },
- { COUNTRY_MALDIVES, LANGUAGE_DHIVEHI, false },
- { COUNTRY_LEBANON, LANGUAGE_ARABIC_LEBANON, true },
- { COUNTRY_JORDAN, LANGUAGE_ARABIC_JORDAN, true },
- { COUNTRY_SYRIA, LANGUAGE_ARABIC_SYRIA, true },
- { COUNTRY_IRAQ, LANGUAGE_ARABIC_IRAQ, true },
- { COUNTRY_KUWAIT, LANGUAGE_ARABIC_KUWAIT, true },
- { COUNTRY_SAUDI_ARABIA, LANGUAGE_ARABIC_SAUDI_ARABIA, true },
- { COUNTRY_YEMEN, LANGUAGE_ARABIC_YEMEN, true },
- { COUNTRY_OMAN, LANGUAGE_ARABIC_OMAN, true },
- { COUNTRY_UAE, LANGUAGE_ARABIC_UAE, true },
- { COUNTRY_ISRAEL, LANGUAGE_HEBREW, false },
- { COUNTRY_BAHRAIN, LANGUAGE_ARABIC_BAHRAIN, true },
- { COUNTRY_QATAR, LANGUAGE_ARABIC_QATAR, true },
- { COUNTRY_MONGOLIA, LANGUAGE_MONGOLIAN, false },
- { COUNTRY_NEPAL, LANGUAGE_NEPALI, false },
- { COUNTRY_IRAN, LANGUAGE_FARSI, false },
- { COUNTRY_TAJIKISTAN, LANGUAGE_TAJIK, false },
- { COUNTRY_TURKMENISTAN, LANGUAGE_TURKMEN, false },
- { COUNTRY_AZERBAIJAN, LANGUAGE_AZERI_LATIN, false },
- { COUNTRY_GEORGIA, LANGUAGE_GEORGIAN, false },
- { COUNTRY_KYRGYZSTAN, LANGUAGE_KIRGHIZ, false },
- { COUNTRY_UZBEKISTAN, LANGUAGE_UZBEK_LATIN, false }
-};
-
-const CountryEntry * const pEnd = pTable + sizeof( pTable ) / sizeof( pTable[ 0 ] );
-
-// ----------------------------------------------------------------------------
-
-/** Predicate comparing a country ID with the member of a CountryEntry. */
-struct CountryEntryPred_Country
-{
- CountryId meCountry;
-
- inline explicit CountryEntryPred_Country( CountryId eCountry ) :
- meCountry( eCountry ) {}
-
- inline bool operator()( const CountryEntry& rCmp ) const
- { return rCmp.meCountry == meCountry; }
-};
-
-// ----------------------------------------------------------------------------
-
-/** Predicate comparing a language type with the member of a CountryEntry.
-
- Compares by primary language only, if the passed CountryEntry allows it
- (the member mbUseSubLang is cleared), otherwise by full language type. */
-struct CountryEntryPred_Language
-{
- LanguageType meLanguage;
-
- inline explicit CountryEntryPred_Language( LanguageType eLanguage ) :
- meLanguage( eLanguage ) {}
-
- inline bool operator()( const CountryEntry& rCmp ) const;
-};
-
-inline bool CountryEntryPred_Language::operator()( const CountryEntry& rCmp ) const
-{
- // rCmp.mbUseSubLang==true -> compare full language type
- // rCmp.mbUseSubLang==false -> compare primary language only
- return rCmp.mbUseSubLang ? (meLanguage == rCmp.meLanguage) :
- ((meLanguage & 0x03FF) == (rCmp.meLanguage & 0x03FF));
-}
-
-// ----------------------------------------------------------------------------
-
-} // namespace
-
-// Country ID <-> Language type conversion ====================================
-
-CountryId ConvertLanguageToCountry( LanguageType eLanguage )
-{
- // country of a found primary language type
- CountryId ePrimCountry = COUNTRY_DONTKNOW;
-
- // find an exact match and a primary-language-only match, in one pass
- const CountryEntry* pEntry = pTable;
- do
- {
- pEntry = std::find_if( pEntry, pEnd, CountryEntryPred_Language( eLanguage ) );
- if( pEntry != pEnd )
- {
- if( pEntry->mbUseSubLang )
- return pEntry->meCountry; // exact match found -> return
- if( ePrimCountry == COUNTRY_DONTKNOW )
- ePrimCountry = pEntry->meCountry;
- ++pEntry; // one entry forward for next find_if() call
- }
- }
- while( pEntry != pEnd );
-
- return ePrimCountry;
-}
-
-LanguageType ConvertCountryToLanguage( CountryId eCountry )
-{
- // just find the first occurance of eCountry and return the language type
- const CountryEntry* pEntry = std::find_if( pTable, pEnd, CountryEntryPred_Country( eCountry ) );
- return (pEntry != pEnd) ? pEntry->meLanguage : LANGUAGE_DONTKNOW;
-}
-
-// ============================================================================
-
-} // namespace svx
-
-// ============================================================================
-
diff --git a/svx/source/msfilter/escherex.cxx b/svx/source/msfilter/escherex.cxx
deleted file mode 100644
index d21aa84a2d..0000000000
--- a/svx/source/msfilter/escherex.cxx
+++ /dev/null
@@ -1,4848 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: escherex.cxx,v $
- * $Revision: 1.77.64.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include "impgrf.hxx"
-#include "eschesdo.hxx"
-#include <svx/escherex.hxx>
-#include <unoapi.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdoashp.hxx>
-#include <svx/svdoole2.hxx>
-#include <svx/svdmodel.hxx>
-#include <vcl/gradient.hxx>
-#include <vcl/graph.hxx>
-#include <vcl/cvtgrf.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <tools/stream.hxx>
-#include <tools/zcodec.hxx>
-#include <svx/svdopath.hxx>
-#include <stdlib.h>
-#include <svtools/filter.hxx>
-#include "../customshapes/EnhancedCustomShapeTypeNames.hxx"
-#include "../customshapes/EnhancedCustomShapeGeometry.hxx"
-#include <EnhancedCustomShapeFunctionParser.hxx>
-#include "../customshapes/EnhancedCustomShape2d.hxx"
-#include <com/sun/star/beans/PropertyValues.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/awt/GradientStyle.hpp>
-#include <com/sun/star/awt/RasterOperation.hpp>
-#include <com/sun/star/awt/Gradient.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/drawing/LineJoint.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/LineDash.hpp>
-#include <com/sun/star/drawing/BezierPoint.hpp>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include <com/sun/star/drawing/ConnectorType.hpp>
-#include <com/sun/star/drawing/ConnectionType.hpp>
-#include <com/sun/star/drawing/CircleKind.hpp>
-#include <com/sun/star/drawing/PointSequence.hpp>
-#include <com/sun/star/drawing/FlagSequence.hpp>
-#include <com/sun/star/drawing/PolygonFlags.hpp>
-#include <com/sun/star/text/WritingMode.hpp>
-#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
-#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <com/sun/star/text/XSimpleText.hpp>
-#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <vcl/hatch.hxx>
-#include <com/sun/star/awt/XGraphics.hpp>
-#include <com/sun/star/awt/FontSlant.hpp>
-#include <com/sun/star/awt/FontWeight.hpp>
-#include <com/sun/star/drawing/ColorMode.hpp>
-#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/text/GraphicCrop.hpp>
-#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <comphelper/extract.hxx>
-#include <toolkit/unohlp.hxx>
-#include <vcl/virdev.hxx>
-#include <rtl/crc.h>
-#include <vos/xception.hxx>
-#ifndef _VOS_NO_NAMESPACE
-using namespace vos;
-#endif
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-
-
-// ---------------------------------------------------------------------------------------------
-
-EscherExContainer::EscherExContainer( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance ) :
- rStrm ( rSt )
-{
- rStrm << (sal_uInt32)( ( 0xf | ( nInstance << 4 ) ) | ( nRecType << 16 ) ) << (sal_uInt32)0;
- nContPos = rStrm.Tell();
-}
-EscherExContainer::~EscherExContainer()
-{
- sal_uInt32 nPos = rStrm.Tell();
- sal_uInt32 nSize= nPos - nContPos;
- if ( nSize )
- {
- rStrm.Seek( nContPos - 4 );
- rStrm << nSize;
- rStrm.Seek( nPos );
- }
-}
-
-EscherExAtom::EscherExAtom( SvStream& rSt, const sal_uInt16 nRecType, const sal_uInt16 nInstance, const sal_uInt8 nVersion ) :
- rStrm ( rSt )
-{
- rStrm << (sal_uInt32)( ( nVersion | ( nInstance << 4 ) ) | ( nRecType << 16 ) ) << (sal_uInt32)0;
- nContPos = rStrm.Tell();
-}
-EscherExAtom::~EscherExAtom()
-{
- sal_uInt32 nPos = rStrm.Tell();
- sal_uInt32 nSize= nPos - nContPos;
- if ( nSize )
- {
- rStrm.Seek( nContPos - 4 );
- rStrm << nSize;
- rStrm.Seek( nPos );
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-
-EscherExClientRecord_Base::~EscherExClientRecord_Base()
-{
-}
-
-EscherExClientAnchor_Base::~EscherExClientAnchor_Base()
-{
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherPropertyContainer::ImplInit()
-{
- nSortCount = 0;
- nCountCount = 0;
- nCountSize = 0;
- nSortBufSize = 64;
- bHasComplexData = sal_False;
- bSuppressRotation = sal_False;
- pSortStruct = new EscherPropSortStruct[ nSortBufSize ];
-}
-
-EscherPropertyContainer::EscherPropertyContainer() :
- pGraphicProvider ( NULL ),
- pPicOutStrm ( NULL )
-{
- ImplInit();
-};
-
-EscherPropertyContainer::EscherPropertyContainer(
- EscherGraphicProvider& rGraphProv,
- SvStream* pPiOutStrm,
- Rectangle& rBoundRect ) :
-
- pGraphicProvider ( &rGraphProv ),
- pPicOutStrm ( pPiOutStrm ),
- pShapeBoundRect ( &rBoundRect )
-{
- ImplInit();
-}
-
-EscherPropertyContainer::~EscherPropertyContainer()
-{
- if ( bHasComplexData )
- {
- while ( nSortCount-- )
- delete[] pSortStruct[ nSortCount ].pBuf;
- }
- delete[] pSortStruct;
-};
-
-void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_uInt32 nPropValue, sal_Bool bBlib )
-{
- AddOpt( nPropID, bBlib, nPropValue, NULL, 0 );
-}
-
-void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, const rtl::OUString& rString )
-{
- sal_Int32 j, i, nLen = rString.getLength() * 2 + 2;
- sal_uInt8* pBuf = new sal_uInt8[ nLen ];
- for ( j = i = 0; i < rString.getLength(); i++ )
- {
- sal_uInt16 nChar = (sal_uInt16)rString[ i ];
- pBuf[ j++ ] = (sal_uInt8)nChar;
- pBuf[ j++ ] = (sal_uInt8)( nChar >> 8 );
- }
- pBuf[ j++ ] = 0;
- pBuf[ j++ ] = 0;
- AddOpt( nPropID, sal_True, nLen, pBuf, nLen );
-}
-
-void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uInt32 nPropValue, sal_uInt8* pProp, sal_uInt32 nPropSize )
-{
- if ( bBlib ) // bBlib is only valid when fComplex = 0
- nPropID |= 0x4000;
- if ( pProp )
- nPropID |= 0x8000; // fComplex = TRUE;
-
- sal_uInt32 i;
- for( i = 0; i < nSortCount; i++ )
- {
- if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropID &~0xc000 ) ) // pruefen, ob Property nur ersetzt wird
- {
- pSortStruct[ i ].nPropId = nPropID;
- if ( pSortStruct[ i ].pBuf )
- {
- nCountSize -= pSortStruct[ i ].nPropSize;
- delete[] pSortStruct[ i ].pBuf;
- }
- pSortStruct[ i ].pBuf = pProp;
- pSortStruct[ i ].nPropSize = nPropSize;
- pSortStruct[ i ].nPropValue = nPropValue;
- if ( pProp )
- nCountSize += nPropSize;
- return;
- }
- }
- nCountCount++;
- nCountSize += 6;
- if ( nSortCount == nSortBufSize ) // buffer vergroessern
- {
- nSortBufSize <<= 1;
- EscherPropSortStruct* pTemp = new EscherPropSortStruct[ nSortBufSize ];
- for( i = 0; i < nSortCount; i++ )
- {
- pTemp[ i ] = pSortStruct[ i ];
- }
- delete pSortStruct;
- pSortStruct = pTemp;
- }
- pSortStruct[ nSortCount ].nPropId = nPropID; // property einfuegen
- pSortStruct[ nSortCount ].pBuf = pProp;
- pSortStruct[ nSortCount ].nPropSize = nPropSize;
- pSortStruct[ nSortCount++ ].nPropValue = nPropValue;
-
- if ( pProp )
- {
- nCountSize += nPropSize;
- bHasComplexData = sal_True;
- }
-}
-
-sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const
-{
- EscherPropSortStruct aPropStruct;
-
- if ( GetOpt( nPropId, aPropStruct ) )
- {
- rPropValue = aPropStruct.nPropValue;
- return sal_True;
- }
- return sal_False;
-}
-
-sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct& rPropValue ) const
-{
- for( sal_uInt32 i = 0; i < nSortCount; i++ )
- {
- if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropId &~0xc000 ) )
- {
- rPropValue = pSortStruct[ i ];
- return sal_True;
- }
- }
- return sal_False;
-}
-
-EscherProperties EscherPropertyContainer::GetOpts() const
-{
- EscherProperties aVector;
-
- for ( sal_uInt32 i = 0; i < nSortCount; ++i )
- aVector.push_back( pSortStruct[ i ] );
-
- return aVector;
-}
-
-extern "C" int __LOADONCALLAPI EscherPropSortFunc( const void* p1, const void* p2 )
-{
- INT16 nID1 = ((EscherPropSortStruct*)p1)->nPropId &~0xc000;
- INT16 nID2 = ((EscherPropSortStruct*)p2)->nPropId &~0xc000;
-
- if( nID1 < nID2 )
- return -1;
- else if( nID1 > nID2 )
- return 1;
- else
- return 0;
-}
-
-void EscherPropertyContainer::Commit( SvStream& rSt, sal_uInt16 nVersion, sal_uInt16 nRecType )
-{
- rSt << (sal_uInt16)( ( nCountCount << 4 ) | ( nVersion & 0xf ) ) << nRecType << nCountSize;
- if ( nSortCount )
- {
- qsort( pSortStruct, nSortCount, sizeof( EscherPropSortStruct ), EscherPropSortFunc );
- sal_uInt32 i;
-
- for ( i = 0; i < nSortCount; i++ )
- {
- sal_uInt32 nPropValue = pSortStruct[ i ].nPropValue;
- sal_uInt16 nPropId = pSortStruct[ i ].nPropId;
-
- if ( bSuppressRotation && ( nPropId == ESCHER_Prop_Rotation ) )
- nPropValue = 0;
-
- rSt << nPropId
- << nPropValue;
- }
- if ( bHasComplexData )
- {
- for ( i = 0; i < nSortCount; i++ )
- {
- if ( pSortStruct[ i ].pBuf )
- rSt.Write( pSortStruct[ i ].pBuf, pSortStruct[ i ].nPropSize );
- }
- }
- }
-}
-
-sal_Bool EscherPropertyContainer::IsFontWork() const
-{
- sal_uInt32 nTextPathFlags = 0;
- GetOpt( DFF_Prop_gtextFStrikethrough, nTextPathFlags );
- return ( nTextPathFlags & 0x4000 ) != 0;
-}
-
-sal_uInt32 EscherPropertyContainer::ImplGetColor( const sal_uInt32 nSOColor, sal_Bool bSwap )
-{
- if ( bSwap )
- {
- sal_uInt32 nColor = nSOColor & 0xff00; // GRUEN
- nColor |= (sal_uInt8)( nSOColor ) << 16; // ROT
- nColor |= (sal_uInt8)( nSOColor >> 16 ); // BLAU
- return nColor;
- }
- else
- return nSOColor & 0xffffff;
-}
-
-sal_uInt32 EscherPropertyContainer::GetGradientColor(
- const ::com::sun::star::awt::Gradient* pGradient,
- sal_uInt32 nStartColor )
-{
- sal_uInt32 nIntensity = 100;
- Color aColor;
-
- if ( pGradient )
- {
- if ( nStartColor & 1 )
- {
- nIntensity = pGradient->StartIntensity;
- aColor = pGradient->StartColor;
- }
- else
- {
- nIntensity = pGradient->EndIntensity;
- aColor = pGradient->EndColor;
- }
- }
- sal_uInt32 nRed = ( ( aColor.GetRed() * nIntensity ) / 100 );
- sal_uInt32 nGreen = ( ( aColor.GetGreen() * nIntensity ) / 100 ) << 8;
- sal_uInt32 nBlue = ( ( aColor.GetBlue() * nIntensity ) / 100 ) << 16;
- return nRed | nGreen | nBlue;
-}
-
-void EscherPropertyContainer::CreateGradientProperties(
- const ::com::sun::star::awt::Gradient & rGradient )
-{
- sal_uInt32 nFillType = ESCHER_FillShadeScale;
- sal_uInt32 nAngle = 0;
- sal_uInt32 nFillFocus = 0;
- sal_uInt32 nFillLR = 0;
- sal_uInt32 nFillTB = 0;
- sal_uInt32 nFirstColor = 0;
- bool bWriteFillTo = false;
-
- switch ( rGradient.Style )
- {
- case ::com::sun::star::awt::GradientStyle_LINEAR :
- case ::com::sun::star::awt::GradientStyle_AXIAL :
- {
- nFillType = ESCHER_FillShadeScale;
- nAngle = (rGradient.Angle * 0x10000) / 10;
- nFillFocus = (sal::static_int_cast<int>(rGradient.Style) ==
- sal::static_int_cast<int>(GradientStyle_LINEAR)) ? 0 : 50;
- }
- break;
- case ::com::sun::star::awt::GradientStyle_RADIAL :
- case ::com::sun::star::awt::GradientStyle_ELLIPTICAL :
- case ::com::sun::star::awt::GradientStyle_SQUARE :
- case ::com::sun::star::awt::GradientStyle_RECT :
- {
- nFillLR = (rGradient.XOffset * 0x10000) / 100;
- nFillTB = (rGradient.YOffset * 0x10000) / 100;
- if ( ((nFillLR > 0) && (nFillLR < 0x10000)) || ((nFillTB > 0) && (nFillTB < 0x10000)) )
- nFillType = ESCHER_FillShadeShape;
- else
- nFillType = ESCHER_FillShadeCenter;
- nFirstColor = 1;
- bWriteFillTo = true;
- }
- break;
- case ::com::sun::star::awt::GradientStyle_MAKE_FIXED_SIZE : break;
- }
- AddOpt( ESCHER_Prop_fillType, nFillType );
- AddOpt( ESCHER_Prop_fillAngle, nAngle );
- AddOpt( ESCHER_Prop_fillColor, GetGradientColor( &rGradient, nFirstColor ) );
- AddOpt( ESCHER_Prop_fillBackColor, GetGradientColor( &rGradient, nFirstColor ^ 1 ) );
- AddOpt( ESCHER_Prop_fillFocus, nFillFocus );
- if ( bWriteFillTo )
- {
- AddOpt( ESCHER_Prop_fillToLeft, nFillLR );
- AddOpt( ESCHER_Prop_fillToTop, nFillTB );
- AddOpt( ESCHER_Prop_fillToRight, nFillLR );
- AddOpt( ESCHER_Prop_fillToBottom, nFillTB );
- }
-}
-
-void EscherPropertyContainer::CreateGradientProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet )
-{
- ::com::sun::star::uno::Any aAny;
- ::com::sun::star::awt::Gradient aGradient;
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ), sal_False ) )
- {
- aGradient = *static_cast< const ::com::sun::star::awt::Gradient* >( aAny.getValue() );
- }
- CreateGradientProperties( aGradient );
-};
-
-void EscherPropertyContainer::CreateFillProperties(
- const uno::Reference< beans::XPropertySet > & rXPropSet,
- sal_Bool bEdge )
-{
- ::com::sun::star::uno::Any aAny;
- AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapNone );
- AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
-
- sal_uInt32 nFillBackColor = 0;
-
- const rtl::OUString aPropName( String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) );
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, aPropName, sal_False ) )
- {
- ::com::sun::star::drawing::FillStyle eFS;
- if ( ! ( aAny >>= eFS ) )
- eFS = ::com::sun::star::drawing::FillStyle_SOLID;
- switch( eFS )
- {
- case ::com::sun::star::drawing::FillStyle_GRADIENT :
- {
- CreateGradientProperties( rXPropSet );
- AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
- }
- break;
-
- case ::com::sun::star::drawing::FillStyle_BITMAP :
- {
- CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ), sal_True );
- AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
- AddOpt( ESCHER_Prop_fillBackColor, nFillBackColor );
- }
- break;
- case ::com::sun::star::drawing::FillStyle_HATCH :
- {
- CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ), sal_True );
- }
- break;
- case ::com::sun::star::drawing::FillStyle_SOLID :
- default:
- {
- ::com::sun::star::beans::PropertyState ePropState = EscherPropertyValueHelper::GetPropertyState(
- rXPropSet, aPropName );
- if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
- AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
-
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), sal_False ) )
- {
- sal_uInt32 nFillColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()) );
- nFillBackColor = nFillColor ^ 0xffffff;
- AddOpt( ESCHER_Prop_fillColor, nFillColor );
- }
- AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100010 );
- AddOpt( ESCHER_Prop_fillBackColor, nFillBackColor );
- break;
- }
- case ::com::sun::star::drawing::FillStyle_NONE :
- AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
- break;
- }
- if ( eFS != ::com::sun::star::drawing::FillStyle_NONE )
- {
- sal_uInt16 nTransparency = ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparence" ) ), sal_True ) )
- ? *((sal_Int16*)aAny.getValue() )
- : 0;
- if ( nTransparency )
- AddOpt( ESCHER_Prop_fillOpacity, ( ( 100 - nTransparency ) << 16 ) / 100 );
- }
- }
- CreateLineProperties( rXPropSet, bEdge );
-}
-
-void EscherPropertyContainer::CreateTextProperties(
- const uno::Reference< beans::XPropertySet > & rXPropSet, sal_uInt32 nTextId,
- const sal_Bool bIsCustomShape, const sal_Bool bIsTextFrame )
-{
- uno::Any aAny;
- text::WritingMode eWM( text::WritingMode_LR_TB );
- drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
- drawing::TextHorizontalAdjust eHA( drawing::TextHorizontalAdjust_LEFT );
-
- sal_Int32 nLeft ( 0 );
- sal_Int32 nTop ( 0 );
- sal_Int32 nRight ( 0 );
- sal_Int32 nBottom ( 0 );
-
- // used with normal shapes:
- sal_Bool bAutoGrowWidth ( sal_False );
- sal_Bool bAutoGrowHeight ( sal_False );
- // used with ashapes:
- sal_Bool bWordWrap ( sal_False );
- sal_Bool bAutoGrowSize ( sal_False );
-
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextWritingMode" ) ), sal_True ) )
- aAny >>= eWM;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) ), sal_True ) )
- aAny >>= eVA;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextHorizontalAdjust" ) ), sal_True ) )
- aAny >>= eHA;
- if ( bIsCustomShape )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextWordWrap" ) ), sal_False ) )
- aAny >>= bWordWrap;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowHeight" ) ), sal_True ) )
- aAny >>= bAutoGrowSize;
- }
- else if ( bIsTextFrame )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowWidth" ) ), sal_True ) )
- aAny >>= bAutoGrowWidth;
-
-// i63936 not setting autogrowheight, because otherwise
-// the minframeheight of the text will be ignored
-//
-// if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowHeight" ) ), sal_True ) )
-// aAny >>= bAutoGrowHeight;
- }
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextLeftDistance" ) ) ) )
- aAny >>= nLeft;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextUpperDistance" ) ) ) )
- aAny >>= nTop;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextRightDistance" ) ) ) )
- aAny >>= nRight;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextLowerDistance" ) ) ) )
- aAny >>= nBottom;
-
-/*
- if ( rObj.ImplGetPropertyValue(
- ::rtl::OUString::createFromAscii("TextWritingMode") ) )
- {
- ::com::sun::star::text::WritingMode eMode;
- rObj.GetUsrAny() >>= eMode;
- switch (eMode)
- {
- case ::com::sun::star::text::WritingMode_TB_RL:
- //Well if it so happens that we are fliped 180 we can use
- //this instead.
- if (rObj.GetAngle() == 18000)
- eFlow = ESCHER_txflBtoT;
- else
- eFlow = ESCHER_txflTtoBA;
- break;
- case ::com::sun::star::text::WritingMode_RL_TB:
- eDir = ESCHER_txdirRTL;
- break;
- }
- }
-*/
-
- ESCHER_AnchorText eAnchor = ESCHER_AnchorTop;
- ESCHER_WrapMode eWrapMode = ESCHER_WrapSquare;
- sal_uInt32 nTextAttr = 0x40004; // rotate text with shape
-
- if ( eWM == text::WritingMode_TB_RL )
- { // verical writing
- switch ( eHA )
- {
- case drawing::TextHorizontalAdjust_LEFT :
- eAnchor = ESCHER_AnchorBottom;
- break;
- case drawing::TextHorizontalAdjust_CENTER :
- eAnchor = ESCHER_AnchorMiddle;
- break;
- default :
- case drawing::TextHorizontalAdjust_BLOCK :
- case drawing::TextHorizontalAdjust_RIGHT :
- eAnchor = ESCHER_AnchorTop;
- break;
- }
- if ( eVA == drawing::TextVerticalAdjust_CENTER )
- {
- switch ( eAnchor )
- {
- case ESCHER_AnchorMiddle :
- eAnchor = ESCHER_AnchorMiddleCentered;
- break;
- case ESCHER_AnchorBottom :
- eAnchor = ESCHER_AnchorBottomCentered;
- break;
- default :
- case ESCHER_AnchorTop :
- eAnchor = ESCHER_AnchorTopCentered;
- break;
- }
- }
- if ( bIsCustomShape )
- {
- if ( bWordWrap )
- eWrapMode = ESCHER_WrapSquare;
- else
- eWrapMode = ESCHER_WrapNone;
- if ( bAutoGrowSize )
- nTextAttr |= 0x20002;
- }
- else
- {
- if ( bAutoGrowHeight )
- eWrapMode = ESCHER_WrapNone;
- if ( bAutoGrowWidth )
- nTextAttr |= 0x20002;
- }
-
- AddOpt( ESCHER_Prop_txflTextFlow, ESCHER_txflTtoBA ); // rotate text within shape by 90
- }
- else
- { // normal from left to right
- switch ( eVA )
- {
- case drawing::TextVerticalAdjust_CENTER :
- eAnchor = ESCHER_AnchorMiddle;
- break;
-
- case drawing::TextVerticalAdjust_BOTTOM :
- eAnchor = ESCHER_AnchorBottom;
- break;
-
- default :
- case drawing::TextVerticalAdjust_TOP :
- eAnchor = ESCHER_AnchorTop;
- break;
- }
- if ( eHA == drawing::TextHorizontalAdjust_CENTER )
- {
- switch( eAnchor )
- {
- case ESCHER_AnchorMiddle :
- eAnchor = ESCHER_AnchorMiddleCentered;
- break;
- case ESCHER_AnchorBottom :
- eAnchor = ESCHER_AnchorBottomCentered;
- break;
- case ESCHER_AnchorTop :
- eAnchor = ESCHER_AnchorTopCentered;
- break;
- default: break;
- }
- }
- if ( bIsCustomShape )
- {
- if ( bWordWrap )
- eWrapMode = ESCHER_WrapSquare;
- else
- eWrapMode = ESCHER_WrapNone;
- if ( bAutoGrowSize )
- nTextAttr |= 0x20002;
- }
- else
- {
- if ( bAutoGrowWidth )
- eWrapMode = ESCHER_WrapNone;
- if ( bAutoGrowHeight )
- nTextAttr |= 0x20002;
- }
- }
- AddOpt( ESCHER_Prop_dxTextLeft, nLeft * 360 );
- AddOpt( ESCHER_Prop_dxTextRight, nRight * 360 );
- AddOpt( ESCHER_Prop_dyTextTop, nTop * 360 );
- AddOpt( ESCHER_Prop_dyTextBottom, nBottom * 360 );
-
- AddOpt( ESCHER_Prop_WrapText, eWrapMode );
- AddOpt( ESCHER_Prop_AnchorText, eAnchor );
- AddOpt( ESCHER_Prop_FitTextToShape, nTextAttr );
-
- if ( nTextId )
- AddOpt( ESCHER_Prop_lTxid, nTextId );
-}
-
-sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth )
-{
- static String sLineStart ( RTL_CONSTASCII_USTRINGPARAM( "LineStart" ) );
- static String sLineStartName( RTL_CONSTASCII_USTRINGPARAM( "LineStartName" ) );
- static String sLineEnd ( RTL_CONSTASCII_USTRINGPARAM( "LineEnd" ) );
- static String sLineEndName ( RTL_CONSTASCII_USTRINGPARAM( "LineEndName" ) );
-
- const String sLine ( bLineStart ? sLineStart : sLineEnd );
- const String sLineName ( bLineStart ? sLineStartName : sLineEndName );
-
- sal_Bool bIsArrow = sal_False;
-
- ::com::sun::star::uno::Any aAny;
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, sLine, sal_False ) )
- {
- PolyPolygon aPolyPoly( EscherPropertyContainer::GetPolyPolygon( aAny ) );
- if ( aPolyPoly.Count() && aPolyPoly[ 0 ].GetSize() )
- {
- bIsArrow = sal_True;
-
- reLineEnd = ESCHER_LineArrowEnd;
- rnArrowLength = 1;
- rnArrowWidth = 1;
-
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, sLineName, sal_False ) )
- {
- String aArrowStartName = *(::rtl::OUString*)aAny.getValue();
- rtl::OUString aApiName;
- sal_Int16 nWhich = bLineStart ? XATTR_LINESTART : XATTR_LINEEND;
-
- SvxUnogetApiNameForItem( nWhich, aArrowStartName, aApiName );
- if ( aApiName.getLength() )
- {
-
- /* todo:
- calculate the best option for ArrowLenght and ArrowWidth
- */
- if ( aApiName.equalsAscii( "Arrow concave" ) )
- reLineEnd = ESCHER_LineArrowStealthEnd;
- else if ( aApiName.equalsAscii( "Square 45" ) )
- reLineEnd = ESCHER_LineArrowDiamondEnd;
- else if ( aApiName.equalsAscii( "Small Arrow" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- else if ( aApiName.equalsAscii( "Dimension Lines" ) )
- {
- rnArrowLength = 0;
- rnArrowWidth = 2;
- reLineEnd = ESCHER_LineArrowOvalEnd;
- }
- else if ( aApiName.equalsAscii( "Double Arrow" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- else if ( aApiName.equalsAscii( "Rounded short Arrow" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- else if ( aApiName.equalsAscii( "Symmetric Arrow" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- else if ( aApiName.equalsAscii( "Line Arrow" ) )
- reLineEnd = ESCHER_LineArrowOpenEnd;
- else if ( aApiName.equalsAscii( "Rounded large Arrow" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- else if ( aApiName.equalsAscii( "Circle" ) )
- reLineEnd = ESCHER_LineArrowOvalEnd;
- else if ( aApiName.equalsAscii( "Square" ) )
- reLineEnd = ESCHER_LineArrowDiamondEnd;
- else if ( aApiName.equalsAscii( "Arrow" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- }
- else if ( aArrowStartName.GetTokenCount( ' ' ) == 2 )
- {
- sal_Bool b = sal_True;
- String aArrowName( aArrowStartName.GetToken( 0, ' ' ) );
- if ( aArrowName.EqualsAscii( "msArrowEnd" ) )
- reLineEnd = ESCHER_LineArrowEnd;
- else if ( aArrowName.EqualsAscii( "msArrowOpenEnd" ) )
- reLineEnd = ESCHER_LineArrowOpenEnd;
- else if ( aArrowName.EqualsAscii( "msArrowStealthEnd" ) )
- reLineEnd = ESCHER_LineArrowStealthEnd;
- else if ( aArrowName.EqualsAscii( "msArrowDiamondEnd" ) )
- reLineEnd = ESCHER_LineArrowDiamondEnd;
- else if ( aArrowName.EqualsAscii( "msArrowOvalEnd" ) )
- reLineEnd = ESCHER_LineArrowOvalEnd;
- else
- b = sal_False;
-
- // now we have the arrow, and try to determine the arrow size;
- if ( b )
- {
- String aArrowSize( aArrowStartName.GetToken( 1, ' ' ) );
- sal_Int32 nArrowSize = aArrowSize.ToInt32();
- rnArrowWidth = ( nArrowSize - 1 ) / 3;
- rnArrowLength = nArrowSize - ( rnArrowWidth * 3 ) - 1;
- }
- }
- }
- }
- }
- return bIsArrow;
-}
-
-void EscherPropertyContainer::CreateLineProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_Bool bEdge )
-{
- ::com::sun::star::uno::Any aAny;
- sal_uInt32 nLineFlags = 0x80008;
-
- ESCHER_LineEnd eLineEnd;
- sal_Int32 nArrowLength;
- sal_Int32 nArrowWidth;
-
- sal_Bool bSwapLineEnds = sal_False;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CircleKind" ) ), sal_True ) )
- {
- ::com::sun::star::drawing::CircleKind eCircleKind;
- if ( aAny >>= eCircleKind )
- {
- if ( eCircleKind == ::com::sun::star::drawing::CircleKind_ARC )
- bSwapLineEnds = sal_True;
- }
- }
- if ( GetLineArrow( bSwapLineEnds ? sal_False : sal_True, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
- {
- AddOpt( ESCHER_Prop_lineStartArrowLength, nArrowLength );
- AddOpt( ESCHER_Prop_lineStartArrowWidth, nArrowWidth );
- AddOpt( ESCHER_Prop_lineStartArrowhead, eLineEnd );
- nLineFlags |= 0x100010;
- }
- if ( GetLineArrow( bSwapLineEnds ? sal_True : sal_False, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
- {
- AddOpt( ESCHER_Prop_lineEndArrowLength, nArrowLength );
- AddOpt( ESCHER_Prop_lineEndArrowWidth, nArrowWidth );
- AddOpt( ESCHER_Prop_lineEndArrowhead, eLineEnd );
- nLineFlags |= 0x100010;
- }
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineStyle" ) ), sal_False ) )
- {
- ::com::sun::star::drawing::LineStyle eLS;
- if ( aAny >>= eLS )
- {
- switch ( eLS )
- {
- case ::com::sun::star::drawing::LineStyle_NONE :
- AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 ); // 80000
- break;
-
- case ::com::sun::star::drawing::LineStyle_DASH :
- {
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineDash" ) ), sal_False ) )
- {
- ESCHER_LineDashing eDash = ESCHER_LineSolid;
- ::com::sun::star::drawing::LineDash* pLineDash = (::com::sun::star::drawing::LineDash*)aAny.getValue();
- sal_Int32 nDistance = pLineDash->Distance << 1;
- switch ( pLineDash->Style )
- {
- case ::com::sun::star::drawing::DashStyle_ROUND :
- case ::com::sun::star::drawing::DashStyle_ROUNDRELATIVE :
- AddOpt( ESCHER_Prop_lineEndCapStyle, 0 ); // Style Round setzen
- break;
- default : break;
- }
- if ( ((!(pLineDash->Dots )) || (!(pLineDash->Dashes )) ) || ( pLineDash->DotLen == pLineDash->DashLen ) )
- {
- sal_Int32 nLen = pLineDash->DotLen;
- if ( pLineDash->Dashes )
- nLen = pLineDash->DashLen;
-
- if ( nLen >= nDistance )
- eDash = ESCHER_LineLongDashGEL;
- else if ( pLineDash->Dots )
- eDash = ESCHER_LineDotSys;
- else
- eDash = ESCHER_LineDashGEL;
- }
- else // X Y
- {
- if ( pLineDash->Dots != pLineDash->Dashes )
- {
- if ( ( pLineDash->DashLen > nDistance ) || ( pLineDash->DotLen > nDistance ) )
- eDash = ESCHER_LineLongDashDotDotGEL;
- else
- eDash = ESCHER_LineDashDotDotSys;
- }
- else // X Y Y
- {
- if ( ( pLineDash->DashLen > nDistance ) || ( pLineDash->DotLen > nDistance ) )
- eDash = ESCHER_LineLongDashDotGEL;
- else
- eDash = ESCHER_LineDashDotGEL;
-
- }
- }
- AddOpt( ESCHER_Prop_lineDashing, eDash );
- }
- }
- case ::com::sun::star::drawing::LineStyle_SOLID :
- default:
- {
- AddOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
- }
- break;
- }
- }
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineColor" ) ), sal_False ) )
- {
- sal_uInt32 nLineColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()) );
- AddOpt( ESCHER_Prop_lineColor, nLineColor );
- AddOpt( ESCHER_Prop_lineBackColor, nLineColor ^ 0xffffff );
- }
- }
-
- sal_uInt32 nLineSize = ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineWidth" ) ), sal_False ) )
- ? *((sal_uInt32*)aAny.getValue())
- : 0;
- if ( nLineSize > 1 )
- AddOpt( ESCHER_Prop_lineWidth, nLineSize * 360 ); // 100TH MM -> PT , 1PT = 12700 EMU
-
- ESCHER_LineJoin eLineJoin = ESCHER_LineJoinMiter;
- if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineJoint" ) ), sal_True ) )
- {
- ::com::sun::star::drawing::LineJoint eLJ;
- if ( aAny >>= eLJ )
- {
- switch ( eLJ )
- {
- case com::sun::star::drawing::LineJoint_NONE :
- case com::sun::star::drawing::LineJoint_MIDDLE :
- case com::sun::star::drawing::LineJoint_BEVEL :
- eLineJoin = ESCHER_LineJoinBevel;
- break;
- default:
- case com::sun::star::drawing::LineJoint_MITER :
- eLineJoin = ESCHER_LineJoinMiter;
- break;
- case com::sun::star::drawing::LineJoint_ROUND :
- eLineJoin = ESCHER_LineJoinRound;
- break;
- }
- }
- }
- AddOpt( ESCHER_Prop_lineJoinStyle, eLineJoin );
-
- if ( bEdge == sal_False )
- {
- AddOpt( ESCHER_Prop_fFillOK, 0x1001 );
- AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
- }
-}
-
-static Size lcl_SizeToEmu(Size aPrefSize, MapMode aPrefMapMode)
-{
- Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
- aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
- else
- aRetSize = Application::GetDefaultDevice()->LogicToLogic( aPrefSize, aPrefMapMode, MAP_100TH_MM );
- return aRetSize;
-}
-
-void EscherPropertyContainer::ImplCreateGraphicAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nBlibId, sal_Bool bCreateCroppingAttributes )
-{
- ::com::sun::star::uno::Any aAny;
-
- sal_uInt32 nPicFlags = 0;
- ::com::sun::star::drawing::ColorMode eColorMode( ::com::sun::star::drawing::ColorMode_STANDARD );
- sal_Int16 nLuminance = 0;
- sal_Int32 nContrast = 0;
- sal_Int16 nRed = 0;
- sal_Int16 nGreen = 0;
- sal_Int16 nBlue = 0;
- double fGamma = 1.0;
- sal_Int16 nTransparency = 0;
-
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicColorMode" ) ) ) )
- aAny >>= eColorMode;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "AdjustLuminance" ) ) ) )
- aAny >>= nLuminance;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "AdjustContrast" ) ) ) )
- {
- sal_Int16 nC = sal_Int16();
- aAny >>= nC;
- nContrast = nC;
- }
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "AdjustRed" ) ) ) )
- aAny >>= nRed;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "AdjustGreen" ) ) ) )
- aAny >>= nGreen;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "AdjustBlue" ) ) ) )
- aAny >>= nBlue;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Gamma" ) ) ) )
- aAny >>= fGamma;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Transparency" ) ) ) )
- aAny >>= nTransparency;
-
- if ( eColorMode == ::com::sun::star::drawing::ColorMode_WATERMARK )
- {
- eColorMode = ::com::sun::star::drawing::ColorMode_STANDARD;
- nLuminance += 70;
- if ( nLuminance > 100 )
- nLuminance = 100;
- nContrast -= 70;
- if ( nContrast < -100 )
- nContrast = -100;
- }
- if ( eColorMode == ::com::sun::star::drawing::ColorMode_GREYS )
- nPicFlags |= 0x40004;
- else if ( eColorMode == ::com::sun::star::drawing::ColorMode_MONO )
- nPicFlags |= 0x60006;
-
- if ( nContrast )
- {
- nContrast += 100;
- if ( nContrast == 100)
- nContrast = 0x10000;
- else if ( nContrast < 100 )
- {
- nContrast *= 0x10000;
- nContrast /= 100;
- }
- else if ( nContrast < 200 )
- nContrast = ( 100 * 0x10000 ) / ( 200 - nContrast );
- else
- nContrast = 0x7fffffff;
- AddOpt( ESCHER_Prop_pictureContrast, nContrast );
- }
- if ( nLuminance )
- AddOpt( ESCHER_Prop_pictureBrightness, nLuminance * 327 );
- if ( nPicFlags )
- AddOpt( ESCHER_Prop_pictureActive, nPicFlags );
-
- if ( bCreateCroppingAttributes && pGraphicProvider )
- {
- Size aPrefSize;
- MapMode aPrefMapMode;
- if ( pGraphicProvider->GetPrefSize( nBlibId, aPrefSize, aPrefMapMode ) )
- {
- Size aCropSize(lcl_SizeToEmu(aPrefSize, aPrefMapMode));
- if ( aCropSize.Width() && aCropSize.Height() )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicCrop" ) ) ) )
- {
- ::com::sun::star::text::GraphicCrop aGraphCrop;
- if ( aAny >>= aGraphCrop )
- {
- if ( aGraphCrop.Left )
- {
- sal_uInt32 nLeft = ( aGraphCrop.Left * 65536 ) / aCropSize.Width();
- AddOpt( ESCHER_Prop_cropFromLeft, nLeft );
- }
- if ( aGraphCrop.Top )
- {
- sal_uInt32 nTop = ( aGraphCrop.Top * 65536 ) / aCropSize.Height();
- AddOpt( ESCHER_Prop_cropFromTop, nTop );
- }
- if ( aGraphCrop.Right )
- {
- sal_uInt32 nRight = ( aGraphCrop.Right * 65536 ) / aCropSize.Width();
- AddOpt( ESCHER_Prop_cropFromRight, nRight );
- }
- if ( aGraphCrop.Bottom )
- {
- sal_uInt32 nBottom = ( aGraphCrop.Bottom * 65536 ) / aCropSize.Height();
- AddOpt( ESCHER_Prop_cropFromBottom, nBottom );
- }
- }
- }
- }
- }
- }
-}
-
-sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
-{
- sal_Bool bRetValue = sal_False;
-
- if ( rXShape.is() )
- {
- SdrObject* pSdrOLE2( GetSdrObjectFromXShape( rXShape ) ); // SJ: leaving unoapi, because currently there is
- if ( pSdrOLE2 && pSdrOLE2->ISA( SdrOle2Obj ) ) // no access to the native graphic object
- {
- Graphic* pGraphic = ((SdrOle2Obj*)pSdrOLE2)->GetGraphic();
- if ( pGraphic )
- {
- GraphicObject aGraphicObject( *pGraphic );
- ByteString aUniqueId( aGraphicObject.GetUniqueID() );
- if ( aUniqueId.Len() )
- {
- AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
- uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
-
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect && aXPropSet.is() )
- {
- ::com::sun::star::uno::Any aAny;
- ::com::sun::star::awt::Rectangle* pVisArea = NULL;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) )
- {
- pVisArea = new ::com::sun::star::awt::Rectangle;
- aAny >>= (*pVisArea);
- }
- Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
- sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, pVisArea, NULL );
- if ( nBlibId )
- {
- AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
- ImplCreateGraphicAttributes( aXPropSet, nBlibId, sal_False );
- bRetValue = sal_True;
- }
- delete pVisArea;
- }
- }
- }
- }
- }
- return bRetValue;
-}
-
-
-sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniqueId )
-{
- if( rUniqueId.Len() > 0 )
- {
- EscherGraphicProvider aProvider;
- SvMemoryStream aMemStrm;
- Rectangle aRect;
- if ( aProvider.GetBlibID( aMemStrm, rUniqueId, aRect ) )
- {
- // grab BLIP from stream and insert directly as complex property
- // ownership of stream memory goes to complex property
- aMemStrm.ObjectOwnsMemory( FALSE );
- sal_uInt8* pBuf = (sal_uInt8*) aMemStrm.GetData();
- sal_uInt32 nSize = aMemStrm.Seek( STREAM_SEEK_TO_END );
- AddOpt( ESCHER_Prop_fillBlip, sal_True, nSize, pBuf, nSize );
- return sal_True;
- }
- }
- return sal_False;
-}
-
-sal_Bool EscherPropertyContainer::CreateEmbeddedBitmapProperties(
- const ::rtl::OUString& rBitmapUrl, ::com::sun::star::drawing::BitmapMode eBitmapMode )
-{
- sal_Bool bRetValue = sal_False;
- String aVndUrl( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
- String aBmpUrl( rBitmapUrl );
- xub_StrLen nIndex = aBmpUrl.Search( aVndUrl, 0 );
- if( nIndex != STRING_NOTFOUND )
- {
- // note: += ist not defined for xub_StrLen -> conversion to int and back to xub_StrLen
- nIndex = nIndex + aVndUrl.Len();
- if( aBmpUrl.Len() > nIndex )
- {
- ByteString aUniqueId( aBmpUrl, nIndex, aBmpUrl.Len() - nIndex, RTL_TEXTENCODING_UTF8 );
- bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
- if( bRetValue )
- {
- // bitmap mode property
- bool bRepeat = eBitmapMode == ::com::sun::star::drawing::BitmapMode_REPEAT;
- AddOpt( ESCHER_Prop_fillType, bRepeat ? ESCHER_FillTexture : ESCHER_FillPicture );
- }
- }
- }
- return bRetValue;
-}
-
-
-namespace {
-
-GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground )
-{
- const MapMode aMap100( MAP_100TH_MM );
- VirtualDevice aVDev( *Application::GetDefaultDevice(), 0, 1 );
- aVDev.SetMapMode( aMap100 );
-
- const Size aOutSize = aVDev.PixelToLogic( Size( 28, 28 ) );
- aVDev.SetOutputSize( aOutSize );
-
- Rectangle aRectangle( Point( 0, 0 ), aOutSize );
- const PolyPolygon aPolyPoly( aRectangle );
-
- aVDev.SetLineColor();
- aVDev.SetFillColor( bFillBackground ? rBackColor : Color( COL_TRANSPARENT ) );
- aVDev.DrawRect( Rectangle( Point(), aOutSize ) );
-
- Hatch aVclHatch( (HatchStyle) rHatch.Style, Color( rHatch.Color ), rHatch.Distance, (sal_uInt16)rHatch.Angle );
- aVDev.DrawHatch( aPolyPoly, aVclHatch );
-
- return GraphicObject( Graphic( aVDev.GetBitmapEx( Point(), aOutSize ) ) );
-}
-
-} // namespace
-
-
-sal_Bool EscherPropertyContainer::CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground )
-{
- GraphicObject aGraphicObject = lclDrawHatch( rHatch, rBackColor, bFillBackground );
- ByteString aUniqueId = aGraphicObject.GetUniqueID();
- sal_Bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
- if ( bRetValue )
- AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture );
- return bRetValue;
-}
-
-
-sal_Bool EscherPropertyContainer::CreateGraphicProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes,
- const sal_Bool bFillBitmapModeAllowed )
-{
- sal_Bool bRetValue = sal_False;
- sal_Bool bCreateFillStyles = sal_False;
-
- sal_Bool bMirrored = sal_False;
- sal_Bool bRotate = sal_True;
- sal_uInt16 nAngle = 0;
- GraphicAttr* pGraphicAttr = NULL;
- GraphicObject aGraphicObject;
- String aGraphicUrl;
- ByteString aUniqueId;
- bool bIsGraphicMtf(false);
-
- ::com::sun::star::drawing::BitmapMode eBitmapMode( ::com::sun::star::drawing::BitmapMode_NO_REPEAT );
- ::com::sun::star::uno::Any aAny;
-
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, rSource ) )
- {
- if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ) )
- {
- ::com::sun::star::uno::Sequence<sal_uInt8> aSeq = *(::com::sun::star::uno::Sequence<sal_uInt8>*)aAny.getValue();
- const sal_uInt8* pAry = aSeq.getArray();
- sal_uInt32 nAryLen = aSeq.getLength();
-
- // the metafile is already rotated
- bRotate = sal_False;
-
- if ( pAry && nAryLen )
- {
- Graphic aGraphic;
- SvMemoryStream aTemp( (void*)pAry, nAryLen, STREAM_READ );
- sal_uInt32 nErrCode = GraphicConverter::Import( aTemp, aGraphic, CVT_WMF );
- if ( nErrCode == ERRCODE_NONE )
- {
- aGraphicObject = aGraphic;
- aUniqueId = aGraphicObject.GetUniqueID();
- bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
- }
- }
- }
- else if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ) )
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >xBitmap;
- if ( ::cppu::extractInterface( xBitmap, aAny ) )
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > xBmp;
- if ( aAny >>= xBmp )
- {
- BitmapEx aBitmapEx( VCLUnoHelper::GetBitmap( xBmp ) );
- Graphic aGraphic( aBitmapEx );
- aGraphicObject = aGraphic;
- aUniqueId = aGraphicObject.GetUniqueID();
- bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
- }
- }
- }
- else if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ) )
- {
- aGraphicUrl = *(::rtl::OUString*)aAny.getValue();
- }
- else if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ) )
- {
- aGraphicUrl = *(::rtl::OUString*)aAny.getValue();
- bCreateFillStyles = sal_True;
- }
- else if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ) )
- {
- ::com::sun::star::drawing::Hatch aHatch;
- if ( aAny >>= aHatch )
- {
- Color aBackColor;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), sal_False ) )
- {
- aBackColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()), sal_False );
- }
- bool bFillBackground = false;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBackground" ) ), sal_True ) )
- {
- aAny >>= bFillBackground;
- }
- aGraphicObject = lclDrawHatch( aHatch, aBackColor, bFillBackground );
- aUniqueId = aGraphicObject.GetUniqueID();
- eBitmapMode = ::com::sun::star::drawing::BitmapMode_REPEAT;
- bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
- }
- }
-
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsMirrored" ) ), sal_True ) )
- aAny >>= bMirrored;
-
- if ( bCreateFillBitmap && bFillBitmapModeAllowed )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapMode" ) ), sal_True ) )
- aAny >>= eBitmapMode;
- }
- else
- {
- nAngle = bRotate && EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True )
- ? (sal_uInt16)( ( *((sal_Int32*)aAny.getValue() ) ) + 5 ) / 10
- : 0;
- }
-
- if ( aGraphicUrl.Len() )
- {
- String aVndUrl( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
- xub_StrLen nIndex = aGraphicUrl.Search( aVndUrl, 0 );
- if ( nIndex != STRING_NOTFOUND )
- {
- nIndex = nIndex + aVndUrl.Len();
- if ( aGraphicUrl.Len() > nIndex )
- aUniqueId = ByteString( aGraphicUrl, nIndex, aGraphicUrl.Len() - nIndex, RTL_TEXTENCODING_UTF8 );
- }
- else
- {
- // externally, linked graphic? convert to embedded
- // one, if transformations are needed. this is because
- // everything < msoxp cannot even handle rotated
- // bitmaps.
- // And check whether the graphic link target is
- // actually supported by mso.
- INetURLObject aTmp( aGraphicUrl );
- GraphicDescriptor aDescriptor(aTmp);
- aDescriptor.Detect();
- const USHORT nFormat = aDescriptor.GetFileFormat();
-
- // can MSO handle it?
- if ( bMirrored || nAngle ||
- (nFormat != GFF_BMP &&
- nFormat != GFF_GIF &&
- nFormat != GFF_JPG &&
- nFormat != GFF_PNG &&
- nFormat != GFF_TIF &&
- nFormat != GFF_PCT &&
- nFormat != GFF_WMF &&
- nFormat != GFF_EMF) )
- {
- SvStream* pIn = ::utl::UcbStreamHelper::CreateStream(
- aTmp.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
- if ( pIn )
- {
- Graphic aGraphic;
- sal_uInt32 nErrCode = GraphicConverter::Import( *pIn, aGraphic );
-
- if ( nErrCode == ERRCODE_NONE )
- {
- // no.
- aGraphicObject = aGraphic;
- aUniqueId = aGraphicObject.GetUniqueID();
- }
- // else: simply keep the graphic link
- delete pIn;
- }
- }
- }
- }
-
- if ( aGraphicUrl.Len() || aUniqueId.Len() )
- {
- if ( bMirrored || nAngle )
- {
- pGraphicAttr = new GraphicAttr;
- if ( bMirrored )
- pGraphicAttr->SetMirrorFlags( BMP_MIRROR_HORZ );
- if ( bIsGraphicMtf )
- AddOpt( ESCHER_Prop_Rotation, ( ( ((sal_Int32)nAngle << 16 ) / 10 ) + 0x8000 ) &~ 0xffff );
- else
- {
- pGraphicAttr->SetRotation( nAngle );
- if ( nAngle && pShapeBoundRect ) // up to xp ppoint does not rotate bitmaps !
- {
- Polygon aPoly( *pShapeBoundRect );
- aPoly.Rotate( pShapeBoundRect->TopLeft(), nAngle );
- *pShapeBoundRect = aPoly.GetBoundRect();
- bSuppressRotation = sal_True;
- }
- }
- }
-
- if ( eBitmapMode == ::com::sun::star::drawing::BitmapMode_REPEAT )
- AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture );
- else
- AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
-
- if ( aUniqueId.Len() )
- {
- // write out embedded graphic
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
- {
- Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
-
- sal_uInt32 nBlibId = 0;
- nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, NULL, pGraphicAttr );
- if ( nBlibId )
- {
- if ( bCreateFillBitmap )
- AddOpt( ESCHER_Prop_fillBlip, nBlibId, sal_True );
- else
- {
- AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
- ImplCreateGraphicAttributes( rXPropSet, nBlibId, bCreateCroppingAttributes );
- }
- bRetValue = sal_True;
- }
- }
- else
- {
- EscherGraphicProvider aProvider;
- SvMemoryStream aMemStrm;
- Rectangle aRect;
-
- if ( aProvider.GetBlibID( aMemStrm, aUniqueId, aRect, NULL, pGraphicAttr ) )
- {
- // grab BLIP from stream and insert directly as complex property
- // ownership of stream memory goes to complex property
- aMemStrm.ObjectOwnsMemory( FALSE );
- sal_uInt8* pBuf = (sal_uInt8*) aMemStrm.GetData();
- sal_uInt32 nSize = aMemStrm.Seek( STREAM_SEEK_TO_END );
- AddOpt( ESCHER_Prop_fillBlip, sal_True, nSize, pBuf, nSize );
- bRetValue = sal_True;
- }
- }
- }
- // write out link to graphic
- else
- {
- OSL_ASSERT(aGraphicUrl.Len());
-
- AddOpt( ESCHER_Prop_pibName, aGraphicUrl );
- sal_uInt32 nPibFlags=0;
- GetOpt( ESCHER_Prop_pibFlags, nPibFlags );
- AddOpt( ESCHER_Prop_pibFlags,
- ESCHER_BlipFlagLinkToFile|ESCHER_BlipFlagFile|ESCHER_BlipFlagDoNotSave | nPibFlags );
- }
- }
- }
- delete pGraphicAttr;
- if ( bCreateFillStyles )
- CreateFillProperties( rXPropSet, sal_True );
-
- return bRetValue;
-}
-
-PolyPolygon EscherPropertyContainer::GetPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
-{
- PolyPolygon aRetPolyPoly;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXPropSet;
- ::com::sun::star::uno::Any aAny( rXShape->queryInterface(
- ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >*) 0 ) ));
-
- String sPolyPolygonBezier( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygonBezier" ) );
- String sPolyPolygon ( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygon" ) );
- String sPolygon ( RTL_CONSTASCII_USTRINGPARAM( "Polygon" ) );
-
- if ( aAny >>= aXPropSet )
- {
- sal_Bool bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygonBezier, sal_True );
- if ( !bHasProperty )
- bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygon, sal_True );
- if ( !bHasProperty )
- bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolygon, sal_True );
- if ( bHasProperty )
- aRetPolyPoly = GetPolyPolygon( aAny );
- }
- return aRetPolyPoly;
-}
-
-PolyPolygon EscherPropertyContainer::GetPolyPolygon( const ::com::sun::star::uno::Any& rAny )
-{
- sal_Bool bNoError = sal_True;
-
- Polygon aPolygon;
- PolyPolygon aPolyPolygon;
-
- if ( rAny.getValueType() == ::getCppuType( ( const ::com::sun::star::drawing::PolyPolygonBezierCoords* ) 0 ) )
- {
- ::com::sun::star::drawing::PolyPolygonBezierCoords* pSourcePolyPolygon
- = (::com::sun::star::drawing::PolyPolygonBezierCoords*)rAny.getValue();
- sal_uInt16 nOuterSequenceCount = (sal_uInt16)pSourcePolyPolygon->Coordinates.getLength();
-
- // Zeiger auf innere sequences holen
- ::com::sun::star::drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->Coordinates.getArray();
- ::com::sun::star::drawing::FlagSequence* pOuterFlags = pSourcePolyPolygon->Flags.getArray();
-
- bNoError = pOuterSequence && pOuterFlags;
- if ( bNoError )
- {
- sal_uInt16 a, b, nInnerSequenceCount;
- ::com::sun::star::awt::Point* pArray;
-
- // dies wird ein Polygon set
- for ( a = 0; a < nOuterSequenceCount; a++ )
- {
- ::com::sun::star::drawing::PointSequence* pInnerSequence = pOuterSequence++;
- ::com::sun::star::drawing::FlagSequence* pInnerFlags = pOuterFlags++;
-
- bNoError = pInnerSequence && pInnerFlags;
- if ( bNoError )
- {
- // Zeiger auf Arrays holen
- pArray = pInnerSequence->getArray();
- ::com::sun::star::drawing::PolygonFlags* pFlags = pInnerFlags->getArray();
-
- if ( pArray && pFlags )
- {
- nInnerSequenceCount = (sal_uInt16)pInnerSequence->getLength();
- aPolygon = Polygon( nInnerSequenceCount );
- for( b = 0; b < nInnerSequenceCount; b++)
- {
- PolyFlags ePolyFlags( *( (PolyFlags*)pFlags++ ) );
- ::com::sun::star::awt::Point aPoint( (::com::sun::star::awt::Point)*(pArray++) );
- aPolygon[ b ] = Point( aPoint.X, aPoint.Y );
- aPolygon.SetFlags( b, ePolyFlags );
-
- if ( ePolyFlags == POLY_CONTROL )
- continue;
- }
- aPolyPolygon.Insert( aPolygon, POLYPOLY_APPEND );
- }
- }
- }
- }
- }
- else if ( rAny.getValueType() == ::getCppuType( ( const ::com::sun::star::drawing::PointSequenceSequence* ) 0 ) )
- {
- ::com::sun::star::drawing::PointSequenceSequence* pSourcePolyPolygon
- = (::com::sun::star::drawing::PointSequenceSequence*)rAny.getValue();
- sal_uInt16 nOuterSequenceCount = (sal_uInt16)pSourcePolyPolygon->getLength();
-
- // Zeiger auf innere sequences holen
- ::com::sun::star::drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->getArray();
- bNoError = pOuterSequence != NULL;
- if ( bNoError )
- {
- sal_uInt16 a, b, nInnerSequenceCount;
-
- // dies wird ein Polygon set
- for( a = 0; a < nOuterSequenceCount; a++ )
- {
- ::com::sun::star::drawing::PointSequence* pInnerSequence = pOuterSequence++;
- bNoError = pInnerSequence != NULL;
- if ( bNoError )
- {
- // Zeiger auf Arrays holen
- ::com::sun::star::awt::Point* pArray =
- pInnerSequence->getArray();
- if ( pArray != NULL )
- {
- nInnerSequenceCount = (sal_uInt16)pInnerSequence->getLength();
- aPolygon = Polygon( nInnerSequenceCount );
- for( b = 0; b < nInnerSequenceCount; b++)
- {
- aPolygon[ b ] = Point( pArray->X, pArray->Y );
- pArray++;
- }
- aPolyPolygon.Insert( aPolygon, POLYPOLY_APPEND );
- }
- }
- }
- }
- }
- else if ( rAny.getValueType() == ::getCppuType( ( const ::com::sun::star::drawing::PointSequence* ) 0 ) )
- {
- ::com::sun::star::drawing::PointSequence* pInnerSequence =
- (::com::sun::star::drawing::PointSequence*)rAny.getValue();
-
- bNoError = pInnerSequence != NULL;
- if ( bNoError )
- {
- sal_uInt16 a, nInnerSequenceCount;
-
- // Zeiger auf Arrays holen
- ::com::sun::star::awt::Point* pArray = pInnerSequence->getArray();
- if ( pArray != NULL )
- {
- nInnerSequenceCount = (sal_uInt16)pInnerSequence->getLength();
- aPolygon = Polygon( nInnerSequenceCount );
- for( a = 0; a < nInnerSequenceCount; a++)
- {
- aPolygon[ a ] = Point( pArray->X, pArray->Y );
- pArray++;
- }
- aPolyPolygon.Insert( aPolygon, POLYPOLY_APPEND );
- }
- }
- }
- return aPolyPolygon;
-}
-
-sal_Bool EscherPropertyContainer::CreatePolygonProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nFlags,
- sal_Bool bBezier,
- ::com::sun::star::awt::Rectangle& rGeoRect,
- Polygon* pPolygon )
-{
- static String sPolyPolygonBezier( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygonBezier" ) );
- static String sPolyPolygon ( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygon" ) );
-
- sal_Bool bRetValue = sal_True;
- sal_Bool bLine = ( nFlags & ESCHER_CREATEPOLYGON_LINE ) != 0;
-
- PolyPolygon aPolyPolygon;
-
- if ( pPolygon )
- aPolyPolygon.Insert( *pPolygon, POLYPOLY_APPEND );
- else
- {
- ::com::sun::star::uno::Any aAny;
- bRetValue = EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- ( bBezier ) ? sPolyPolygonBezier : sPolyPolygon, sal_True );
- if ( bRetValue )
- {
- aPolyPolygon = GetPolyPolygon( aAny );
- bRetValue = aPolyPolygon.Count() != 0;
- }
- }
- if ( bRetValue )
- {
- if ( bLine )
- {
- if ( ( aPolyPolygon.Count() == 1 ) && ( aPolyPolygon[ 0 ].GetSize() == 2 ) )
- {
- const Polygon& rPoly = aPolyPolygon[ 0 ];
- rGeoRect = ::com::sun::star::awt::Rectangle(
- rPoly[ 0 ].X(),
- rPoly[ 0 ].Y(),
- rPoly[ 1 ].X() - rPoly[ 0 ].X(),
- rPoly[ 1 ].Y() - rPoly[ 0 ].Y() );
- }
- else
- bRetValue = sal_False;
- }
- else
- {
- Polygon aPolygon;
-
- sal_uInt16 i, j, k, nPoints, nBezPoints, nPolyCount = aPolyPolygon.Count();
- Rectangle aRect( aPolyPolygon.GetBoundRect() );
- rGeoRect = ::com::sun::star::awt::Rectangle( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight() );
-
- for ( nBezPoints = nPoints = i = 0; i < nPolyCount; i++ )
- {
- k = aPolyPolygon[ i ].GetSize();
- nPoints = nPoints + k;
- for ( j = 0; j < k; j++ )
- {
- if ( aPolyPolygon[ i ].GetFlags( j ) != POLY_CONTROL )
- nBezPoints++;
- }
- }
- sal_uInt32 nVerticesBufSize = ( nPoints << 2 ) + 6;
- sal_uInt8* pVerticesBuf = new sal_uInt8[ nVerticesBufSize ];
-
-
- sal_uInt32 nSegmentBufSize = ( ( nBezPoints << 2 ) + 8 );
- if ( nPolyCount > 1 )
- nSegmentBufSize += ( nPolyCount << 1 );
- sal_uInt8* pSegmentBuf = new sal_uInt8[ nSegmentBufSize ];
-
- sal_uInt8* pPtr = pVerticesBuf;
- *pPtr++ = (sal_uInt8)( nPoints ); // Little endian
- *pPtr++ = (sal_uInt8)( nPoints >> 8 );
- *pPtr++ = (sal_uInt8)( nPoints );
- *pPtr++ = (sal_uInt8)( nPoints >> 8 );
- *pPtr++ = (sal_uInt8)0xf0;
- *pPtr++ = (sal_uInt8)0xff;
-
- for ( j = 0; j < nPolyCount; j++ )
- {
- aPolygon = aPolyPolygon[ j ];
- nPoints = aPolygon.GetSize();
- for ( i = 0; i < nPoints; i++ ) // Punkte aus Polygon in Buffer schreiben
- {
- Point aPoint = aPolygon[ i ];
- aPoint.X() -= rGeoRect.X;
- aPoint.Y() -= rGeoRect.Y;
-
- *pPtr++ = (sal_uInt8)( aPoint.X() );
- *pPtr++ = (sal_uInt8)( aPoint.X() >> 8 );
- *pPtr++ = (sal_uInt8)( aPoint.Y() );
- *pPtr++ = (sal_uInt8)( aPoint.Y() >> 8 );
- }
- }
-
- pPtr = pSegmentBuf;
- *pPtr++ = (sal_uInt8)( ( nSegmentBufSize - 6 ) >> 1 );
- *pPtr++ = (sal_uInt8)( ( nSegmentBufSize - 6 ) >> 9 );
- *pPtr++ = (sal_uInt8)( ( nSegmentBufSize - 6 ) >> 1 );
- *pPtr++ = (sal_uInt8)( ( nSegmentBufSize - 6 ) >> 9 );
- *pPtr++ = (sal_uInt8)2;
- *pPtr++ = (sal_uInt8)0;
-
- for ( j = 0; j < nPolyCount; j++ )
- {
- *pPtr++ = 0x0; // Polygon start
- *pPtr++ = 0x40;
- aPolygon = aPolyPolygon[ j ];
- nPoints = aPolygon.GetSize();
- for ( i = 0; i < nPoints; i++ ) // Polyflags in Buffer schreiben
- {
- *pPtr++ = 0;
- if ( bBezier )
- *pPtr++ = 0xb3;
- else
- *pPtr++ = 0xac;
- if ( ( i + 1 ) != nPoints )
- {
- *pPtr++ = 1;
- if ( aPolygon.GetFlags( i + 1 ) == POLY_CONTROL )
- {
- *pPtr++ = 0x20;
- i += 2;
- }
- else
- *pPtr++ = 0;
- }
- }
- if ( nPolyCount > 1 )
- {
- *pPtr++ = 1; // end of polygon
- *pPtr++ = 0x60;
- }
- }
- *pPtr++ = 0;
- *pPtr++ = 0x80;
-
- AddOpt( ESCHER_Prop_geoRight, rGeoRect.Width );
- AddOpt( ESCHER_Prop_geoBottom, rGeoRect.Height );
-
- AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- AddOpt( ESCHER_Prop_pVertices, TRUE, nVerticesBufSize - 6, (sal_uInt8*)pVerticesBuf, nVerticesBufSize );
- AddOpt( ESCHER_Prop_pSegmentInfo, TRUE, nSegmentBufSize, (sal_uInt8*)pSegmentBuf, nSegmentBufSize );
- }
- }
- return bRetValue;
-}
-
-sal_Bool EscherPropertyContainer::CreateConnectorProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
- EscherSolverContainer& rSolverContainer, ::com::sun::star::awt::Rectangle& rGeoRect,
- sal_uInt16& rShapeType, sal_uInt16& rShapeFlags )
-{
- static String sEdgeKind ( RTL_CONSTASCII_USTRINGPARAM( "EdgeKind" ) );
- static String sEdgeStartPoint ( RTL_CONSTASCII_USTRINGPARAM( "EdgeStartPoint" ) );
- static String sEdgeEndPoint ( RTL_CONSTASCII_USTRINGPARAM( "EdgeEndPoint" ) );
- static String sEdgeStartConnection ( RTL_CONSTASCII_USTRINGPARAM( "EdgeStartConnection" ) );
- static String sEdgeEndConnection ( RTL_CONSTASCII_USTRINGPARAM( "EdgeEndConnection" ) );
-
- sal_Bool bRetValue = sal_False;
- rShapeType = rShapeFlags = 0;
-
- if ( rXShape.is() )
- {
- ::com::sun::star::awt::Point aStartPoint, aEndPoint;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXPropSet;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > aShapeA, aShapeB;
- ::com::sun::star::uno::Any aAny( rXShape->queryInterface( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >*) 0 ) ));
- if ( aAny >>= aXPropSet )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeKind, sal_True ) )
- {
- ::com::sun::star::drawing::ConnectorType eCt;
- aAny >>= eCt;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeStartPoint ) )
- {
- aStartPoint = *(::com::sun::star::awt::Point*)aAny.getValue();
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeEndPoint ) )
- {
- aEndPoint = *(::com::sun::star::awt::Point*)aAny.getValue();
-
- rShapeFlags = SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT | SHAPEFLAG_CONNECTOR;
- rGeoRect = ::com::sun::star::awt::Rectangle( aStartPoint.X, aStartPoint.Y,
- ( aEndPoint.X - aStartPoint.X ) + 1, ( aEndPoint.Y - aStartPoint.Y ) + 1 );
- if ( rGeoRect.Height < 0 ) // justify
- {
- rShapeFlags |= SHAPEFLAG_FLIPV;
- rGeoRect.Y = aEndPoint.Y;
- rGeoRect.Height = -rGeoRect.Height;
- }
- if ( rGeoRect.Width < 0 )
- {
- rShapeFlags |= SHAPEFLAG_FLIPH;
- rGeoRect.X = aEndPoint.X;
- rGeoRect.Width = -rGeoRect.Width;
- }
- sal_uInt32 nAdjustValue1, nAdjustValue2, nAdjustValue3;
- nAdjustValue1 = nAdjustValue2 = nAdjustValue3 = 0x2a30;
-
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeStartConnection ) )
- aAny >>= aShapeA;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeEndConnection ) )
- aAny >>= aShapeB;
-/*
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeLine1Delta" ) ) ) )
- {
- }
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeLine2Delta" ) ) ) )
- {
- }
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeLine3Delta" ) ) ) )
- {
- }
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeNode1HorzDist" ) ) ) )
- {
- }
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeNode1VertDist" ) ) ) )
- {
- }
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeNode2HorzDist" ) ) ) )
- {
- }
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "EdgeNode2VertDist" ) ) ) )
- {
- }
-*/
- rSolverContainer.AddConnector( rXShape, aStartPoint, aShapeA, aEndPoint, aShapeB );
- switch ( eCt )
- {
- case ::com::sun::star::drawing::ConnectorType_CURVE :
- {
- rShapeType = ESCHER_ShpInst_CurvedConnector3;
- AddOpt( ESCHER_Prop_cxstyle, ESCHER_cxstyleCurved );
- AddOpt( ESCHER_Prop_adjustValue, nAdjustValue1 );
- AddOpt( ESCHER_Prop_adjust2Value, -(sal_Int32)nAdjustValue2 );
- }
- break;
-
- case ::com::sun::star::drawing::ConnectorType_STANDARD :// Connector 2->5
- {
- rShapeType = ESCHER_ShpInst_BentConnector3;
- AddOpt( ESCHER_Prop_cxstyle, ESCHER_cxstyleBent );
- }
- break;
-
- default:
- case ::com::sun::star::drawing::ConnectorType_LINE :
- case ::com::sun::star::drawing::ConnectorType_LINES : // Connector 2->5
- {
- rShapeType = ESCHER_ShpInst_StraightConnector1;
- AddOpt( ESCHER_Prop_cxstyle, ESCHER_cxstyleStraight );
- }
- break;
- }
- CreateLineProperties( aXPropSet, sal_False );
- bRetValue = bSuppressRotation = sal_True;
- }
- }
- }
- }
- }
- return bRetValue;
-}
-
-sal_Bool EscherPropertyContainer::CreateShadowProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet )
-{
- ::com::sun::star::uno::Any aAny;
-
- sal_Bool bHasShadow = sal_False; // shadow is possible only if at least a fillcolor, linecolor or graphic is set
- sal_uInt32 nLineFlags = 0; // default : shape has no line
- sal_uInt32 nFillFlags = 0x10; // shape is filled
-
- GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
- GetOpt( ESCHER_Prop_fNoFillHitTest, nFillFlags );
-
- sal_uInt32 nDummy;
- sal_Bool bGraphic = GetOpt( DFF_Prop_pib, nDummy ) || GetOpt( DFF_Prop_pibName, nDummy ) || GetOpt( DFF_Prop_pibFlags, nDummy );
-
- sal_uInt32 nShadowFlags = 0x20000;
- if ( ( nLineFlags & 8 ) || ( nFillFlags & 0x10 ) || bGraphic )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "Shadow" ) ), sal_True ) )
- {
- if ( aAny >>= bHasShadow )
- {
- if ( bHasShadow )
- {
- nShadowFlags |= 2;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowColor" ) ), sal_False ) )
- AddOpt( ESCHER_Prop_shadowColor, ImplGetColor( *((sal_uInt32*)aAny.getValue()) ) );
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowXDistance" ) ), sal_False ) )
- AddOpt( ESCHER_Prop_shadowOffsetX, *((sal_Int32*)aAny.getValue()) * 360 );
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowYDistance" ) ), sal_False ) )
- AddOpt( ESCHER_Prop_shadowOffsetY, *((sal_Int32*)aAny.getValue()) * 360 );
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowTransparence" ) ), sal_False ) )
- AddOpt( ESCHER_Prop_shadowOpacity, 0x10000 - (((sal_uInt32)*((sal_uInt16*)aAny.getValue())) * 655 ) );
- }
- }
- }
- }
- AddOpt( ESCHER_Prop_fshadowObscured, nShadowFlags );
- return bHasShadow;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-sal_Int32 GetValueForEnhancedCustomShapeParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, const std::vector< sal_Int32 >& rEquationOrder )
-{
- sal_Int32 nValue = 0;
- if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
- {
- double fValue;
- if ( rParameter.Value >>= fValue )
- nValue = (sal_Int32)fValue;
- }
- else
- rParameter.Value >>= nValue;
-
- switch( rParameter.Type )
- {
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION :
- {
- nValue = (sal_uInt16)rEquationOrder[ nValue ];
- nValue |= (sal_uInt32)0x80000000;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL :
- {
-
- }
- break;
-/* not sure if it is allowed to set following values
-(but they are not yet used)
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT :
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::BOTTOM :
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::RIGHT :
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::TOP :
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::LEFT :
-*/
- }
- return nValue;
-}
-
-sal_Bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter )
-{
- sal_Bool bSpecial = sal_False;
- nRetValue = 0;
- if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
- {
- double fValue;
- if ( rParameter.Value >>= fValue )
- nRetValue = (sal_Int32)fValue;
- }
- else
- rParameter.Value >>= nRetValue;
-
- switch( rParameter.Type )
- {
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION :
- {
- nRetValue += 3;
- bSpecial = sal_True;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT :
- {
- nRetValue += 0x100;
- bSpecial = sal_True;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::TOP :
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::LEFT :
- {
- nRetValue = 0;
- bSpecial = sal_True;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::RIGHT :
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::BOTTOM :
- {
- nRetValue = 1;
- bSpecial = sal_True;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL :
- {
-
- }
- break;
- }
- return bSpecial;
-}
-
-void ConvertEnhancedCustomShapeEquation( SdrObjCustomShape* pCustoShape,
- std::vector< EnhancedCustomShapeEquation >& rEquations, std::vector< sal_Int32 >& rEquationOrder )
-{
- if ( pCustoShape )
- {
- uno::Sequence< rtl::OUString > sEquationSource;
- const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM( "Equations" ) );
- SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)
- pCustoShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sEquations );
- if ( pAny )
- *pAny >>= sEquationSource;
- sal_Int32 nEquationSourceCount = sEquationSource.getLength();
- if ( nEquationSourceCount )
- {
- sal_Int32 i;
- for ( i = 0; i < nEquationSourceCount; i++ )
- {
- EnhancedCustomShape2d aCustoShape2d( pCustoShape );
- try
- {
- ::boost::shared_ptr< EnhancedCustomShape::ExpressionNode > aExpressNode(
- EnhancedCustomShape::FunctionParser::parseFunction( sEquationSource[ i ], aCustoShape2d ) );
- com::sun::star::drawing::EnhancedCustomShapeParameter aPara( aExpressNode->fillNode( rEquations, NULL, 0 ) );
- if ( aPara.Type != com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION )
- {
- EnhancedCustomShapeEquation aEquation;
- aEquation.nOperation = 0;
- EnhancedCustomShape::FillEquationParameter( aPara, 0, aEquation );
- rEquations.push_back( aEquation );
- }
- }
- catch ( EnhancedCustomShape::ParseError& )
- {
- EnhancedCustomShapeEquation aEquation; // ups, we should not be here,
- aEquation.nOperation = 0; // creating a default equation with value 1
- aEquation.nPara[ 0 ] = 1; // hoping that this will not break anything
- rEquations.push_back( aEquation );
- }
- rEquationOrder.push_back( rEquations.size() - 1 );
- }
- // now updating our old equation indices, they are marked with a bit in the hiword of nOperation
- std::vector< EnhancedCustomShapeEquation >::iterator aIter( rEquations.begin() );
- std::vector< EnhancedCustomShapeEquation >::iterator aEnd ( rEquations.end() );
- while( aIter != aEnd )
- {
- sal_Int32 nMask = 0x20000000;
- for( i = 0; i < 3; i++ )
- {
- if ( aIter->nOperation & nMask )
- {
- aIter->nOperation ^= nMask;
- aIter->nPara[ i ] = rEquationOrder[ aIter->nPara[ i ] & 0x3ff ] | 0x400;
- }
- nMask <<= 1;
- }
- aIter++;
- }
- }
- }
-}
-
-sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape )
-{
- sal_Bool bIsDefaultObject = sal_False;
- if ( pCustoShape )
- {
- if ( pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_EQUATIONS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_VIEWBOX )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_PATH )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_GLUEPOINTS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_SEGMENTS )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHX )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY )
-// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES )
- && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) )
- bIsDefaultObject = sal_True;
- }
-
- return bIsDefaultObject;
-}
-
-void EscherPropertyContainer::LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted )
-{
- const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eShapeType );
- if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
- {
- sal_Int32 k, nkCount = pDefCustomShape->nHandles;
- const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
- for ( k = 0; k < nkCount; k++, pData++ )
- {
- if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << k );
- }
- }
- }
-}
-
-sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue )
-{
- if ( rkProp.State != beans::PropertyState_DIRECT_VALUE )
- return FALSE;
-
- sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << nIndex ) ) != 0;
- if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
- {
- double fValue;
- rkProp.Value >>= fValue;
- if ( bUseFixedFloat )
- fValue *= 65536.0;
- nValue = (sal_Int32)fValue;
- }
- else
- {
- rkProp.Value >>= nValue;
- if ( bUseFixedFloat )
- nValue <<= 16;
- }
-
- return TRUE;
-}
-
-void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeType, const uno::Reference< drawing::XShape > & rXShape )
-{
- uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
- if ( aXPropSet.is() )
- {
- SdrObjCustomShape* pCustoShape = (SdrObjCustomShape*)GetSdrObjectFromXShape( rXShape );
- const rtl::OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) );
- uno::Any aGeoPropSet = aXPropSet->getPropertyValue( sCustomShapeGeometry );
- uno::Sequence< beans::PropertyValue > aGeoPropSeq;
- if ( aGeoPropSet >>= aGeoPropSeq )
- {
- const rtl::OUString sViewBox ( RTL_CONSTASCII_USTRINGPARAM( "ViewBox" ) );
- const rtl::OUString sTextRotateAngle ( RTL_CONSTASCII_USTRINGPARAM( "TextRotateAngle" ) );
- const rtl::OUString sExtrusion ( RTL_CONSTASCII_USTRINGPARAM( "Extrusion" ) );
- const rtl::OUString sEquations ( RTL_CONSTASCII_USTRINGPARAM( "Equations" ) );
- const rtl::OUString sPath ( RTL_CONSTASCII_USTRINGPARAM( "Path" ) );
- const rtl::OUString sTextPath ( RTL_CONSTASCII_USTRINGPARAM( "TextPath" ) );
- const rtl::OUString sHandles ( RTL_CONSTASCII_USTRINGPARAM( "Handles" ) );
- const rtl::OUString sAdjustmentValues ( RTL_CONSTASCII_USTRINGPARAM( "AdjustmentValues" ) );
-
- const beans::PropertyValue* pAdjustmentValuesProp = NULL;
- sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
- uno::Sequence< beans::PropertyValues > aHandlesPropSeq;
- sal_Bool bPredefinedHandlesUsed = sal_True;
- sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape );
-
- // convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation >
- std::vector< EnhancedCustomShapeEquation > aEquations;
- std::vector< sal_Int32 > aEquationOrder;
- ConvertEnhancedCustomShapeEquation( pCustoShape, aEquations, aEquationOrder );
-
- sal_Int32 i, nCount = aGeoPropSeq.getLength();
- for ( i = 0; i < nCount; i++ )
- {
- const beans::PropertyValue& rProp = aGeoPropSeq[ i ];
- if ( rProp.Name.equals( sViewBox ) )
- {
- if ( !bIsDefaultObject )
- {
- awt::Rectangle aViewBox;
- if ( rProp.Value >>= aViewBox )
- {
- AddOpt( DFF_Prop_geoLeft, aViewBox.X );
- AddOpt( DFF_Prop_geoTop, aViewBox.Y );
- AddOpt( DFF_Prop_geoRight, aViewBox.X + aViewBox.Width );
- AddOpt( DFF_Prop_geoBottom,aViewBox.Y + aViewBox.Height );
- }
- }
- }
- else if ( rProp.Name.equals( sTextRotateAngle ) )
- {
- double f = 0, fTextRotateAngle;
- if ( rProp.Value >>= f )
- {
- fTextRotateAngle = fmod( f, 360.0 );
- if ( fTextRotateAngle < 0 )
- fTextRotateAngle = 360 + fTextRotateAngle;
- if ( ( fTextRotateAngle < 271.0 ) && ( fTextRotateAngle > 269.0 ) )
- AddOpt( DFF_Prop_cdirFont, mso_cdir90 );
- else if ( ( fTextRotateAngle < 181.0 ) && ( fTextRotateAngle > 179.0 ) )
- AddOpt( DFF_Prop_cdirFont, mso_cdir180 );
- else if ( ( fTextRotateAngle < 91.0 ) && ( fTextRotateAngle > 79.0 ) )
- AddOpt( DFF_Prop_cdirFont, mso_cdir270 );
- }
- }
- else if ( rProp.Name.equals( sExtrusion ) )
- {
- uno::Sequence< beans::PropertyValue > aExtrusionPropSeq;
- if ( rProp.Value >>= aExtrusionPropSeq )
- {
- sal_uInt32 nLightFaceFlagsOrg, nLightFaceFlags;
- sal_uInt32 nFillHarshFlagsOrg, nFillHarshFlags;
- nLightFaceFlagsOrg = nLightFaceFlags = 0x000001;
- nFillHarshFlagsOrg = nFillHarshFlags = 0x00001e;
- if ( GetOpt( DFF_Prop_fc3DLightFace, nLightFaceFlags ) )
- nLightFaceFlagsOrg = nLightFaceFlags;
- if ( GetOpt( DFF_Prop_fc3DFillHarsh, nFillHarshFlags ) )
- nFillHarshFlagsOrg = nFillHarshFlags;
-
- sal_Int32 r, nrCount = aExtrusionPropSeq.getLength();
- for ( r = 0; r < nrCount; r++ )
- {
- const beans::PropertyValue& rrProp = aExtrusionPropSeq[ r ];
- const rtl::OUString sExtrusionBrightness ( RTL_CONSTASCII_USTRINGPARAM( "Brightness" ) );
- const rtl::OUString sExtrusionDepth ( RTL_CONSTASCII_USTRINGPARAM( "Depth" ) );
- const rtl::OUString sExtrusionDiffusion ( RTL_CONSTASCII_USTRINGPARAM( "Diffusion" ) );
- const rtl::OUString sExtrusionNumberOfLineSegments ( RTL_CONSTASCII_USTRINGPARAM( "NumberOfLineSegments" ) );
- const rtl::OUString sExtrusionLightFace ( RTL_CONSTASCII_USTRINGPARAM( "LightFace" ) );
- const rtl::OUString sExtrusionFirstLightHarsh ( RTL_CONSTASCII_USTRINGPARAM( "FirstLightHarsh" ) );
- const rtl::OUString sExtrusionSecondLightHarsh ( RTL_CONSTASCII_USTRINGPARAM( "SecondLightHarsh" ) );
- const rtl::OUString sExtrusionFirstLightLevel ( RTL_CONSTASCII_USTRINGPARAM( "FirstLightLevel" ) );
- const rtl::OUString sExtrusionSecondLightLevel ( RTL_CONSTASCII_USTRINGPARAM( "SecondLightLevel" ) );
- const rtl::OUString sExtrusionFirstLightDirection ( RTL_CONSTASCII_USTRINGPARAM( "FirstLightDirection" ) );
- const rtl::OUString sExtrusionSecondLightDirection ( RTL_CONSTASCII_USTRINGPARAM( "SecondLightDirection" ) );
- const rtl::OUString sExtrusionMetal ( RTL_CONSTASCII_USTRINGPARAM( "Metal" ) );
- const rtl::OUString sExtrusionShadeMode ( RTL_CONSTASCII_USTRINGPARAM( "ShadeMode" ) );
- const rtl::OUString sExtrusionRotateAngle ( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) );
- const rtl::OUString sExtrusionRotationCenter ( RTL_CONSTASCII_USTRINGPARAM( "RotationCenter" ) );
- const rtl::OUString sExtrusionShininess ( RTL_CONSTASCII_USTRINGPARAM( "Shininess" ) );
- const rtl::OUString sExtrusionSkew ( RTL_CONSTASCII_USTRINGPARAM( "Skew" ) );
- const rtl::OUString sExtrusionSpecularity ( RTL_CONSTASCII_USTRINGPARAM( "Specularity" ) );
- const rtl::OUString sExtrusionProjectionMode ( RTL_CONSTASCII_USTRINGPARAM( "ProjectionMode" ) );
- const rtl::OUString sExtrusionViewPoint ( RTL_CONSTASCII_USTRINGPARAM( "ViewPoint" ) );
- const rtl::OUString sExtrusionOrigin ( RTL_CONSTASCII_USTRINGPARAM( "Origin" ) );
- const rtl::OUString sExtrusionColor ( RTL_CONSTASCII_USTRINGPARAM( "Color" ) );
-
- if ( rrProp.Name.equals( sExtrusion ) )
- {
- sal_Bool bExtrusionOn = sal_Bool();
- if ( rrProp.Value >>= bExtrusionOn )
- {
- nLightFaceFlags |= 0x80000;
- if ( bExtrusionOn )
- nLightFaceFlags |= 8;
- else
- nLightFaceFlags &=~8;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionBrightness ) )
- {
- double fExtrusionBrightness = 0;
- if ( rrProp.Value >>= fExtrusionBrightness )
- AddOpt( DFF_Prop_c3DAmbientIntensity, (sal_Int32)( fExtrusionBrightness * 655.36 ) );
- }
- else if ( rrProp.Name.equals( sExtrusionDepth ) )
- {
- double fDepth = 0;
- double fFraction = 0;
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepthParaPair;
- if ( ( rrProp.Value >>= aDepthParaPair ) && ( aDepthParaPair.First.Value >>= fDepth ) && ( aDepthParaPair.Second.Value >>= fFraction ) )
- {
- double fForeDepth = fDepth * fFraction;
- double fBackDepth = fDepth - fForeDepth;
-
- fBackDepth *= 360.0;
- AddOpt( DFF_Prop_c3DExtrudeBackward, (sal_Int32)fBackDepth );
-
- if ( fForeDepth != 0.0 )
- {
- fForeDepth *= 360.0;
- AddOpt( DFF_Prop_c3DExtrudeForward, (sal_Int32)fForeDepth );
- }
- }
- }
- else if ( rrProp.Name.equals( sExtrusionDiffusion ) )
- {
- double fExtrusionDiffusion = 0;
- if ( rrProp.Value >>= fExtrusionDiffusion )
- AddOpt( DFF_Prop_c3DDiffuseAmt, (sal_Int32)( fExtrusionDiffusion * 655.36 ) );
- }
- else if ( rrProp.Name.equals( sExtrusionNumberOfLineSegments ) )
- {
- sal_Int32 nExtrusionNumberOfLineSegments = 0;
- if ( rrProp.Value >>= nExtrusionNumberOfLineSegments )
- AddOpt( DFF_Prop_c3DTolerance, nExtrusionNumberOfLineSegments );
- }
- else if ( rrProp.Name.equals( sExtrusionLightFace ) )
- {
- sal_Bool bExtrusionLightFace = sal_Bool();
- if ( rrProp.Value >>= bExtrusionLightFace )
- {
- nLightFaceFlags |= 0x10000;
- if ( bExtrusionLightFace )
- nLightFaceFlags |= 1;
- else
- nLightFaceFlags &=~1;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionFirstLightHarsh ) )
- {
- sal_Bool bExtrusionFirstLightHarsh = sal_Bool();
- if ( rrProp.Value >>= bExtrusionFirstLightHarsh )
- {
- nFillHarshFlags |= 0x20000;
- if ( bExtrusionFirstLightHarsh )
- nFillHarshFlags |= 2;
- else
- nFillHarshFlags &=~2;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionSecondLightHarsh ) )
- {
- sal_Bool bExtrusionSecondLightHarsh = sal_Bool();
- if ( rrProp.Value >>= bExtrusionSecondLightHarsh )
- {
- nFillHarshFlags |= 0x10000;
- if ( bExtrusionSecondLightHarsh )
- nFillHarshFlags |= 1;
- else
- nFillHarshFlags &=~1;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionFirstLightLevel ) )
- {
- double fExtrusionFirstLightLevel = 0;
- if ( rrProp.Value >>= fExtrusionFirstLightLevel )
- AddOpt( DFF_Prop_c3DKeyIntensity, (sal_Int32)( fExtrusionFirstLightLevel * 655.36 ) );
- }
- else if ( rrProp.Name.equals( sExtrusionSecondLightLevel ) )
- {
- double fExtrusionSecondLightLevel = 0;
- if ( rrProp.Value >>= fExtrusionSecondLightLevel )
- AddOpt( DFF_Prop_c3DFillIntensity, (sal_Int32)( fExtrusionSecondLightLevel * 655.36 ) );
- }
- else if ( rrProp.Name.equals( sExtrusionFirstLightDirection ) )
- {
- drawing::Direction3D aExtrusionFirstLightDirection;
- if ( rrProp.Value >>= aExtrusionFirstLightDirection )
- {
- AddOpt( DFF_Prop_c3DKeyX, (sal_Int32)aExtrusionFirstLightDirection.DirectionX );
- AddOpt( DFF_Prop_c3DKeyY, (sal_Int32)aExtrusionFirstLightDirection.DirectionY );
- AddOpt( DFF_Prop_c3DKeyZ, (sal_Int32)aExtrusionFirstLightDirection.DirectionZ );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionSecondLightDirection ) )
- {
- drawing::Direction3D aExtrusionSecondLightPosition;
- if ( rrProp.Value >>= aExtrusionSecondLightPosition )
- {
- AddOpt( DFF_Prop_c3DFillX, (sal_Int32)aExtrusionSecondLightPosition.DirectionX );
- AddOpt( DFF_Prop_c3DFillY, (sal_Int32)aExtrusionSecondLightPosition.DirectionY );
- AddOpt( DFF_Prop_c3DFillZ, (sal_Int32)aExtrusionSecondLightPosition.DirectionZ );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionMetal ) )
- {
- sal_Bool bExtrusionMetal = sal_Bool();
- if ( rrProp.Value >>= bExtrusionMetal )
- {
- nLightFaceFlags |= 0x40000;
- if ( bExtrusionMetal )
- nLightFaceFlags |= 4;
- else
- nLightFaceFlags &=~4;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionShadeMode ) )
- {
- drawing::ShadeMode eExtrusionShadeMode;
- if ( rrProp.Value >>= eExtrusionShadeMode )
- {
- sal_uInt32 nRenderMode;
- switch( eExtrusionShadeMode )
- {
- default:
- case drawing::ShadeMode_FLAT :
- case drawing::ShadeMode_PHONG :
- case drawing::ShadeMode_SMOOTH :
- nRenderMode = mso_FullRender;
- break;
- case drawing::ShadeMode_DRAFT :
- {
- nRenderMode = mso_Wireframe;
- }
- break;
- }
- AddOpt( DFF_Prop_c3DRenderMode, nRenderMode );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionRotateAngle ) )
- {
- double fExtrusionAngleX = 0;
- double fExtrusionAngleY = 0;
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAnglePair;
- if ( ( rrProp.Value >>= aRotateAnglePair ) && ( aRotateAnglePair.First.Value >>= fExtrusionAngleX ) && ( aRotateAnglePair.Second.Value >>= fExtrusionAngleY ) )
- {
- fExtrusionAngleX *= 65536;
- fExtrusionAngleY *= 65536;
- AddOpt( DFF_Prop_c3DXRotationAngle, (sal_Int32)fExtrusionAngleX );
- AddOpt( DFF_Prop_c3DYRotationAngle, (sal_Int32)fExtrusionAngleY );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionRotationCenter ) )
- {
- drawing::Direction3D aExtrusionRotationCenter;
- if ( rrProp.Value >>= aExtrusionRotationCenter )
- {
- AddOpt( DFF_Prop_c3DRotationCenterX, (sal_Int32)( aExtrusionRotationCenter.DirectionX * 360.0 ) );
- AddOpt( DFF_Prop_c3DRotationCenterY, (sal_Int32)( aExtrusionRotationCenter.DirectionY * 360.0 ) );
- AddOpt( DFF_Prop_c3DRotationCenterZ, (sal_Int32)( aExtrusionRotationCenter.DirectionZ * 360.0 ) );
- nFillHarshFlags &=~8; // don't use AutoRotationCenter;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionShininess ) )
- {
- double fExtrusionShininess = 0;
- if ( rrProp.Value >>= fExtrusionShininess )
- AddOpt( DFF_Prop_c3DShininess, (sal_Int32)( fExtrusionShininess * 655.36 ) );
- }
- else if ( rrProp.Name.equals( sExtrusionSkew ) )
- {
- double fSkewAmount = 0;
- double fSkewAngle = 0;
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkewParaPair;
- if ( ( rrProp.Value >>= aSkewParaPair ) && ( aSkewParaPair.First.Value >>= fSkewAmount ) && ( aSkewParaPair.Second.Value >>= fSkewAngle ) )
- {
- AddOpt( DFF_Prop_c3DSkewAmount, (sal_Int32)fSkewAmount );
- AddOpt( DFF_Prop_c3DSkewAngle, (sal_Int32)( fSkewAngle * 65536 ) );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionSpecularity ) )
- {
- double fExtrusionSpecularity = 0;
- if ( rrProp.Value >>= fExtrusionSpecularity )
- AddOpt( DFF_Prop_c3DSpecularAmt, (sal_Int32)( fExtrusionSpecularity * 1333 ) );
- }
- else if ( rrProp.Name.equals( sExtrusionProjectionMode ) )
- {
- drawing::ProjectionMode eExtrusionProjectionMode;
- if ( rrProp.Value >>= eExtrusionProjectionMode )
- {
- nFillHarshFlags |= 0x40000;
- if ( eExtrusionProjectionMode == drawing::ProjectionMode_PARALLEL )
- nFillHarshFlags |= 4;
- else
- nFillHarshFlags &=~4;
- }
- }
- else if ( rrProp.Name.equals( sExtrusionViewPoint ) )
- {
- drawing::Position3D aExtrusionViewPoint;
- if ( rrProp.Value >>= aExtrusionViewPoint )
- {
- aExtrusionViewPoint.PositionX *= 360.0;
- aExtrusionViewPoint.PositionY *= 360.0;
- aExtrusionViewPoint.PositionZ *= 360.0;
- AddOpt( DFF_Prop_c3DXViewpoint, (sal_Int32)aExtrusionViewPoint.PositionX );
- AddOpt( DFF_Prop_c3DYViewpoint, (sal_Int32)aExtrusionViewPoint.PositionY );
- AddOpt( DFF_Prop_c3DZViewpoint, (sal_Int32)aExtrusionViewPoint.PositionZ );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionOrigin ) )
- {
- double fExtrusionOriginX = 0;
- double fExtrusionOriginY = 0;
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aOriginPair;
- if ( ( rrProp.Value >>= aOriginPair ) && ( aOriginPair.First.Value >>= fExtrusionOriginX ) && ( aOriginPair.Second.Value >>= fExtrusionOriginY ) )
- {
- AddOpt( DFF_Prop_c3DOriginX, (sal_Int32)( fExtrusionOriginX * 65536 ) );
- AddOpt( DFF_Prop_c3DOriginY, (sal_Int32)( fExtrusionOriginY * 65536 ) );
- }
- }
- else if ( rrProp.Name.equals( sExtrusionColor ) )
- {
- sal_Bool bExtrusionColor = sal_Bool();
- if ( rrProp.Value >>= bExtrusionColor )
- {
- nLightFaceFlags |= 0x20000;
- if ( bExtrusionColor )
- {
- nLightFaceFlags |= 2;
- uno::Any aFillColor2;
- if ( EscherPropertyValueHelper::GetPropertyValue( aFillColor2, aXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillColor2" ) ), sal_True ) )
- {
- sal_uInt32 nFillColor = ImplGetColor( *((sal_uInt32*)aFillColor2.getValue()) );
- AddOpt( DFF_Prop_c3DExtrusionColor, nFillColor );
- }
- }
- else
- nLightFaceFlags &=~2;
- }
- }
- }
- if ( nLightFaceFlags != nLightFaceFlagsOrg )
- AddOpt( DFF_Prop_fc3DLightFace, nLightFaceFlags );
- if ( nFillHarshFlags != nFillHarshFlagsOrg )
- AddOpt( DFF_Prop_fc3DFillHarsh, nFillHarshFlags );
- }
- }
- else if ( rProp.Name.equals( sEquations ) )
- {
- if ( !bIsDefaultObject )
- {
- sal_uInt16 nElements = (sal_uInt16)aEquations.size();
- if ( nElements )
- {
- sal_uInt16 nElementSize = 8;
- sal_uInt32 nStreamSize = nElementSize * nElements + 6;
- SvMemoryStream aOut( nStreamSize );
- aOut << nElements
- << nElements
- << nElementSize;
-
- std::vector< EnhancedCustomShapeEquation >::const_iterator aIter( aEquations.begin() );
- std::vector< EnhancedCustomShapeEquation >::const_iterator aEnd ( aEquations.end() );
- while( aIter != aEnd )
- {
- aOut << (sal_uInt16)aIter->nOperation
- << (sal_Int16)aIter->nPara[ 0 ]
- << (sal_Int16)aIter->nPara[ 1 ]
- << (sal_Int16)aIter->nPara[ 2 ];
- aIter++;
- }
- sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
- memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_pFormulas, sal_True, nStreamSize - 6, pBuf, nStreamSize );
- }
- else
- {
- sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_pFormulas, sal_True, 0, pBuf, 0 );
- }
- }
- }
- else if ( rProp.Name.equals( sPath ) )
- {
- uno::Sequence< beans::PropertyValue > aPathPropSeq;
- if ( rProp.Value >>= aPathPropSeq )
- {
- sal_uInt32 nPathFlags, nPathFlagsOrg;
- nPathFlagsOrg = nPathFlags = 0x39;
- if ( GetOpt( DFF_Prop_fFillOK, nPathFlags ) )
- nPathFlagsOrg = nPathFlags;
-
- sal_Int32 r, nrCount = aPathPropSeq.getLength();
- for ( r = 0; r < nrCount; r++ )
- {
- const beans::PropertyValue& rrProp = aPathPropSeq[ r ];
- const rtl::OUString sPathExtrusionAllowed ( RTL_CONSTASCII_USTRINGPARAM( "ExtrusionAllowed" ) );
- const rtl::OUString sPathConcentricGradientFillAllowed ( RTL_CONSTASCII_USTRINGPARAM( "ConcentricGradientFillAllowed" ) );
- const rtl::OUString sPathTextPathAllowed ( RTL_CONSTASCII_USTRINGPARAM( "TextPathAllowed" ) );
- const rtl::OUString sPathCoordinates ( RTL_CONSTASCII_USTRINGPARAM( "Coordinates" ) );
- const rtl::OUString sPathGluePoints ( RTL_CONSTASCII_USTRINGPARAM( "GluePoints" ) );
- const rtl::OUString sPathGluePointType ( RTL_CONSTASCII_USTRINGPARAM( "GluePointType" ) );
- const rtl::OUString sPathSegments ( RTL_CONSTASCII_USTRINGPARAM( "Segments" ) );
- const rtl::OUString sPathStretchX ( RTL_CONSTASCII_USTRINGPARAM( "StretchX" ) );
- const rtl::OUString sPathStretchY ( RTL_CONSTASCII_USTRINGPARAM( "StretchY" ) );
- const rtl::OUString sPathTextFrames ( RTL_CONSTASCII_USTRINGPARAM( "TextFrames" ) );
-
- if ( rrProp.Name.equals( sPathExtrusionAllowed ) )
- {
- sal_Bool bExtrusionAllowed = sal_Bool();
- if ( rrProp.Value >>= bExtrusionAllowed )
- {
- nPathFlags |= 0x100000;
- if ( bExtrusionAllowed )
- nPathFlags |= 16;
- else
- nPathFlags &=~16;
- }
- }
- else if ( rrProp.Name.equals( sPathConcentricGradientFillAllowed ) )
- {
- sal_Bool bConcentricGradientFillAllowed = sal_Bool();
- if ( rrProp.Value >>= bConcentricGradientFillAllowed )
- {
- nPathFlags |= 0x20000;
- if ( bConcentricGradientFillAllowed )
- nPathFlags |= 2;
- else
- nPathFlags &=~2;
- }
- }
- else if ( rrProp.Name.equals( sPathTextPathAllowed ) )
- {
- sal_Bool bTextPathAllowed = sal_Bool();
- if ( rrProp.Value >>= bTextPathAllowed )
- {
- nPathFlags |= 0x40000;
- if ( bTextPathAllowed )
- nPathFlags |= 4;
- else
- nPathFlags &=~4;
- }
- }
- else if ( rrProp.Name.equals( sPathCoordinates ) )
- {
- if ( !bIsDefaultObject )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
- if ( rrProp.Value >>= aCoordinates )
- {
- // creating the vertices
- if ( (sal_uInt16)aCoordinates.getLength() )
- {
- sal_uInt16 j, nElements = (sal_uInt16)aCoordinates.getLength();
- sal_uInt16 nElementSize = 8;
- sal_uInt32 nStreamSize = nElementSize * nElements + 6;
- SvMemoryStream aOut( nStreamSize );
- aOut << nElements
- << nElements
- << nElementSize;
- for( j = 0; j < nElements; j++ )
- {
- sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].First, aEquationOrder );
- sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].Second, aEquationOrder );
- aOut << X
- << Y;
- }
- sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
- memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_pVertices, sal_True, nStreamSize - 6, pBuf, nStreamSize ); // -6
- }
- else
- {
- sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_pVertices, sal_True, 0, pBuf, 0 );
- }
- }
- }
- }
- else if ( rrProp.Name.equals( sPathGluePoints ) )
- {
- if ( !bIsDefaultObject )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> aGluePoints;
- if ( rrProp.Value >>= aGluePoints )
- {
- // creating the vertices
- sal_uInt16 nElements = (sal_uInt16)aGluePoints.getLength();
- if ( nElements )
- {
- sal_uInt16 j, nElementSize = 8;
- sal_uInt32 nStreamSize = nElementSize * nElements + 6;
- SvMemoryStream aOut( nStreamSize );
- aOut << nElements
- << nElements
- << nElementSize;
- for( j = 0; j < nElements; j++ )
- {
- sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aGluePoints[ j ].First, aEquationOrder );
- sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aGluePoints[ j ].Second, aEquationOrder );
- aOut << X
- << Y;
- }
- sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
- memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_connectorPoints, sal_True, nStreamSize - 6, pBuf, nStreamSize ); // -6
- }
- else
- {
- sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_connectorPoints, sal_True, 0, pBuf, 0 );
- }
- }
- }
- }
- else if ( rrProp.Name.equals( sPathGluePointType ) )
- {
- sal_Int16 nGluePointType = sal_Int16();
- if ( rrProp.Value >>= nGluePointType )
- AddOpt( DFF_Prop_connectorType, (sal_uInt16)nGluePointType );
- }
- else if ( rrProp.Name.equals( sPathSegments ) )
- {
- if ( !bIsDefaultObject )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
- if ( rrProp.Value >>= aSegments )
- {
- // creating seginfo
- if ( (sal_uInt16)aSegments.getLength() )
- {
- sal_uInt16 j, nElements = (sal_uInt16)aSegments.getLength();
- sal_uInt16 nElementSize = 2;
- sal_uInt32 nStreamSize = nElementSize * nElements + 6;
- SvMemoryStream aOut( nStreamSize );
- aOut << nElements
- << nElements
- << nElementSize;
- for ( j = 0; j < nElements; j++ )
- {
- sal_uInt16 nVal = (sal_uInt16)aSegments[ j ].Count;
- switch( aSegments[ j ].Command )
- {
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::UNKNOWN :
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::LINETO : break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::MOVETO :
- {
- nVal = 0x4000;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::CURVETO :
- {
- nVal |= 0x2000;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
- {
- nVal = 0x6001;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
- {
- nVal = 0x8000;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::NOFILL :
- {
- nVal = 0xaa00;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::NOSTROKE :
- {
- nVal = 0xab00;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
- {
- nVal *= 3;
- nVal |= 0xa100;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
- {
- nVal *= 3;
- nVal |= 0xa200;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ARCTO :
- {
- nVal <<= 2;
- nVal |= 0xa300;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ARC :
- {
- nVal <<= 2;
- nVal |= 0xa400;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
- {
- nVal <<= 2;
- nVal |= 0xa500;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
- {
- nVal <<= 2;
- nVal |= 0xa600;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
- {
- nVal |= 0xa700;
- }
- break;
- case com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
- {
- nVal |= 0xa800;
- }
- break;
- }
- aOut << nVal;
- }
- sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
- memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_pSegmentInfo, sal_False, nStreamSize - 6, pBuf, nStreamSize );
- }
- else
- {
- sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_pSegmentInfo, sal_True, 0, pBuf, 0 );
- }
- }
- }
- }
- else if ( rrProp.Name.equals( sPathStretchX ) )
- {
- if ( !bIsDefaultObject )
- {
- sal_Int32 nStretchX = 0;
- if ( rrProp.Value >>= nStretchX )
- AddOpt( DFF_Prop_stretchPointX, nStretchX );
- }
- }
- else if ( rrProp.Name.equals( sPathStretchY ) )
- {
- if ( !bIsDefaultObject )
- {
- sal_Int32 nStretchY = 0;
- if ( rrProp.Value >>= nStretchY )
- AddOpt( DFF_Prop_stretchPointY, nStretchY );
- }
- }
- else if ( rrProp.Name.equals( sPathTextFrames ) )
- {
- if ( !bIsDefaultObject )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aPathTextFrames;
- if ( rrProp.Value >>= aPathTextFrames )
- {
- if ( (sal_uInt16)aPathTextFrames.getLength() )
- {
- sal_uInt16 j, nElements = (sal_uInt16)aPathTextFrames.getLength();
- sal_uInt16 nElementSize = 16;
- sal_uInt32 nStreamSize = nElementSize * nElements + 6;
- SvMemoryStream aOut( nStreamSize );
- aOut << nElements
- << nElements
- << nElementSize;
- for ( j = 0; j < nElements; j++ )
- {
- sal_Int32 nLeft = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].TopLeft.First, aEquationOrder );
- sal_Int32 nTop = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].TopLeft.Second, aEquationOrder );
- sal_Int32 nRight = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].BottomRight.First, aEquationOrder );
- sal_Int32 nBottom = GetValueForEnhancedCustomShapeParameter( aPathTextFrames[ j ].BottomRight.Second, aEquationOrder );
-
- aOut << nLeft
- << nTop
- << nRight
- << nBottom;
- }
- sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
- memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_textRectangles, sal_True, nStreamSize - 6, pBuf, nStreamSize );
- }
- else
- {
- sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_textRectangles, sal_True, 0, pBuf, 0 );
- }
- }
- }
- }
- }
- if ( nPathFlags != nPathFlagsOrg )
- AddOpt( DFF_Prop_fFillOK, nPathFlags );
- }
- }
- else if ( rProp.Name.equals( sTextPath ) )
- {
- uno::Sequence< beans::PropertyValue > aTextPathPropSeq;
- if ( rProp.Value >>= aTextPathPropSeq )
- {
- sal_uInt32 nTextPathFlagsOrg, nTextPathFlags;
- nTextPathFlagsOrg = nTextPathFlags = 0xffff1000; // default
- if ( GetOpt( DFF_Prop_gtextFStrikethrough, nTextPathFlags ) )
- nTextPathFlagsOrg = nTextPathFlags;
-
- sal_Int32 r, nrCount = aTextPathPropSeq.getLength();
- for ( r = 0; r < nrCount; r++ )
- {
- const beans::PropertyValue& rrProp = aTextPathPropSeq[ r ];
- const rtl::OUString sTextPathMode ( RTL_CONSTASCII_USTRINGPARAM( "TextPathMode" ) );
- const rtl::OUString sTextPathScaleX ( RTL_CONSTASCII_USTRINGPARAM( "ScaleX" ) );
- const rtl::OUString sSameLetterHeights ( RTL_CONSTASCII_USTRINGPARAM( "SameLetterHeights" ) );
-
- if ( rrProp.Name.equals( sTextPath ) )
- {
- sal_Bool bTextPathOn = sal_Bool();
- if ( rrProp.Value >>= bTextPathOn )
- {
- nTextPathFlags |= 0x40000000;
- if ( bTextPathOn )
- {
- nTextPathFlags |= 0x4000;
-
- sal_uInt32 nPathFlags = 0x39;
- GetOpt( DFF_Prop_fFillOK, nPathFlags ); // SJ: can be removed if we are supporting the TextPathAllowed property in XML
- nPathFlags |= 0x40004;
- AddOpt( DFF_Prop_fFillOK, nPathFlags );
- }
- else
- nTextPathFlags &=~0x4000;
- }
- }
- else if ( rrProp.Name.equals( sTextPathMode ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeTextPathMode eTextPathMode;
- if ( rrProp.Value >>= eTextPathMode )
- {
- nTextPathFlags |= 0x05000000;
- nTextPathFlags &=~0x500; // TextPathMode_NORMAL
- if ( eTextPathMode == com::sun::star::drawing::EnhancedCustomShapeTextPathMode_PATH )
- nTextPathFlags |= 0x100;
- else if ( eTextPathMode == com::sun::star::drawing::EnhancedCustomShapeTextPathMode_SHAPE )
- nTextPathFlags |= 0x500;
- }
- }
- else if ( rrProp.Name.equals( sTextPathScaleX ) )
- {
- sal_Bool bTextPathScaleX = sal_Bool();
- if ( rrProp.Value >>= bTextPathScaleX )
- {
- nTextPathFlags |= 0x00400000;
- if ( bTextPathScaleX )
- nTextPathFlags |= 0x40;
- else
- nTextPathFlags &=~0x40;
- }
- }
- else if ( rrProp.Name.equals( sSameLetterHeights ) )
- {
- sal_Bool bSameLetterHeights = sal_Bool();
- if ( rrProp.Value >>= bSameLetterHeights )
- {
- nTextPathFlags |= 0x00800000;
- if ( bSameLetterHeights )
- nTextPathFlags |= 0x80;
- else
- nTextPathFlags &=~0x80;
- }
- }
- }
- if ( nTextPathFlags & 0x4000 ) // Is FontWork ?
- {
- // FontWork Text
- rtl::OUString aText;
- uno::Reference< text::XSimpleText > xText( rXShape, uno::UNO_QUERY );
- if ( xText.is() )
- aText = xText->getString();
- if ( !aText.getLength() )
- aText = ::rtl::OUString::createFromAscii( "your text" ); // todo: moving into a resource
- AddOpt( DFF_Prop_gtextUNICODE, aText );
-
- // FontWork Font
- rtl::OUString aFontName;
- const rtl::OUString sCharFontName ( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) );
- uno::Any aAny = aXPropSet->getPropertyValue( sCharFontName );
- aAny >>= aFontName;
- if ( !aFontName.getLength() )
- aFontName = ::rtl::OUString::createFromAscii( "Arial Black" );
- AddOpt( DFF_Prop_gtextFont, aFontName );
-
- sal_Int16 nCharScaleWidth = 100;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharScaleWidth" ) ), sal_True ) )
- {
- if ( aAny >>= nCharScaleWidth )
- {
- if ( nCharScaleWidth != 100 )
- {
- sal_Int32 nVal = nCharScaleWidth * 655;
- AddOpt( DFF_Prop_gtextSpacing, nVal );
- }
- }
- }
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharKerning" ) ), sal_True ) )
- {
- sal_Int16 nCharKerning = sal_Int16();
- if ( aAny >>= nCharKerning )
- {
- nTextPathFlags |= 0x10000000;
- if ( nCharKerning )
- nTextPathFlags |= 0x1000;
- else
- nTextPathFlags &=~0x1000;
- }
- }
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), sal_True ) )
- {
- awt::FontSlant eFontSlant;
- if ( aAny >>= eFontSlant )
- {
- nTextPathFlags |= 0x100010;
- if ( eFontSlant != awt::FontSlant_NONE )
- nTextPathFlags |= 0x10;
- else
- nTextPathFlags &=~0x10;
- }
- }
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), sal_True ) )
- {
- float fFontWidth = 0;
- if ( aAny >>= fFontWidth )
- {
- nTextPathFlags |= 0x200020;
- if ( fFontWidth > awt::FontWeight::NORMAL )
- nTextPathFlags |= 0x20;
- else
- nTextPathFlags &=~0x20;
- }
- }
- }
- if ( nTextPathFlags != nTextPathFlagsOrg )
- AddOpt( DFF_Prop_gtextFStrikethrough, nTextPathFlags );
- }
- }
- else if ( rProp.Name.equals( sHandles ) )
- {
- if ( !bIsDefaultObject )
- {
- bPredefinedHandlesUsed = sal_False;
- if ( rProp.Value >>= aHandlesPropSeq )
- {
- sal_uInt16 nElements = (sal_uInt16)aHandlesPropSeq.getLength();
- if ( nElements )
- {
- const rtl::OUString sHandle ( RTL_CONSTASCII_USTRINGPARAM( "Handle" ) );
-
- sal_uInt16 k, j, nElementSize = 36;
- sal_uInt32 nStreamSize = nElementSize * nElements + 6;
- SvMemoryStream aOut( nStreamSize );
- aOut << nElements
- << nElements
- << nElementSize;
-
- for ( k = 0; k < nElements; k++ )
- {
- sal_uInt32 nFlags = 0;
- sal_Int32 nXPosition = 0;
- sal_Int32 nYPosition = 0;
- sal_Int32 nXMap = 0;
- sal_Int32 nYMap = 0;
- sal_Int32 nXRangeMin = 0x80000000;
- sal_Int32 nXRangeMax = 0x7fffffff;
- sal_Int32 nYRangeMin = 0x80000000;
- sal_Int32 nYRangeMax = 0x7fffffff;
-
- const uno::Sequence< beans::PropertyValue >& rPropSeq = aHandlesPropSeq[ k ];
- for ( j = 0; j < rPropSeq.getLength(); j++ )
- {
- const beans::PropertyValue& rPropVal = rPropSeq[ j ];
-
- const rtl::OUString sPosition ( RTL_CONSTASCII_USTRINGPARAM( "Position" ) );
- const rtl::OUString sMirroredX ( RTL_CONSTASCII_USTRINGPARAM( "MirroredX" ) );
- const rtl::OUString sMirroredY ( RTL_CONSTASCII_USTRINGPARAM( "MirroredY" ) );
- const rtl::OUString sSwitched ( RTL_CONSTASCII_USTRINGPARAM( "Switched" ) );
- const rtl::OUString sPolar ( RTL_CONSTASCII_USTRINGPARAM( "Polar" ) );
- // const rtl::OUString sMap ( RTL_CONSTASCII_USTRINGPARAM( "Map" ) );
- const rtl::OUString sRadiusRangeMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RadiusRangeMinimum" ) );
- const rtl::OUString sRadiusRangeMaximum ( RTL_CONSTASCII_USTRINGPARAM( "RadiusRangeMaximum" ) );
- const rtl::OUString sRangeXMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RangeXMinimum" ) );
- const rtl::OUString sRangeXMaximum ( RTL_CONSTASCII_USTRINGPARAM( "RangeXMaximum" ) );
- const rtl::OUString sRangeYMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RangeYMinimum" ) );
- const rtl::OUString sRangeYMaximum ( RTL_CONSTASCII_USTRINGPARAM( "RangeYMaximum" ) );
-
- if ( rPropVal.Name.equals( sPosition ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition;
- if ( rPropVal.Value >>= aPosition )
- {
- GetValueForEnhancedCustomShapeHandleParameter( nXPosition, aPosition.First );
- GetValueForEnhancedCustomShapeHandleParameter( nYPosition, aPosition.Second );
- }
- }
- else if ( rPropVal.Name.equals( sMirroredX ) )
- {
- sal_Bool bMirroredX = sal_Bool();
- if ( rPropVal.Value >>= bMirroredX )
- {
- if ( bMirroredX )
- nFlags |= 1;
- }
- }
- else if ( rPropVal.Name.equals( sMirroredY ) )
- {
- sal_Bool bMirroredY = sal_Bool();
- if ( rPropVal.Value >>= bMirroredY )
- {
- if ( bMirroredY )
- nFlags |= 2;
- }
- }
- else if ( rPropVal.Name.equals( sSwitched ) )
- {
- sal_Bool bSwitched = sal_Bool();
- if ( rPropVal.Value >>= bSwitched )
- {
- if ( bSwitched )
- nFlags |= 4;
- }
- }
- else if ( rPropVal.Name.equals( sPolar ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aPolar;
- if ( rPropVal.Value >>= aPolar )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nXMap, aPolar.First ) )
- nFlags |= 0x800;
- if ( GetValueForEnhancedCustomShapeHandleParameter( nYMap, aPolar.Second ) )
- nFlags |= 0x1000;
- nFlags |= 8;
- }
- }
- /* seems not to be used.
- else if ( rPropVal.Name.equals( sMap ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameterPair aMap;
- if ( rPropVal.Value >>= aMap )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nXMap, aMap.First ) )
- nFlags |= 0x800;
- if ( GetValueForEnhancedCustomShapeHandleParameter( nYMap, aMap.Second ) )
- nFlags |= 0x1000;
- nFlags |= 0x10;
- }
- }
- */
- else if ( rPropVal.Name.equals( sRadiusRangeMinimum ) )
- {
- nYRangeMin = (sal_Int32)0xff4c0000; // the range of angles seems to be a not
- nYRangeMax = (sal_Int32)0x00b40000; // used feature, so we are defaulting this
-
- com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
- if ( rPropVal.Value >>= aRadiusRangeMinimum )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nXRangeMin, aRadiusRangeMinimum ) )
- nFlags |= 0x80;
- nFlags |= 0x2000;
- }
- }
- else if ( rPropVal.Name.equals( sRadiusRangeMaximum ) )
- {
- nYRangeMin = (sal_Int32)0xff4c0000; // the range of angles seems to be a not
- nYRangeMax = (sal_Int32)0x00b40000; // used feature, so we are defaulting this
-
- com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
- if ( rPropVal.Value >>= aRadiusRangeMaximum )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nXRangeMax, aRadiusRangeMaximum ) )
- nFlags |= 0x100;
- nFlags |= 0x2000;
- }
- }
- else if ( rPropVal.Name.equals( sRangeXMinimum ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameter aXRangeMinimum;
- if ( rPropVal.Value >>= aXRangeMinimum )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nXRangeMin, aXRangeMinimum ) )
- nFlags |= 0x80;
- nFlags |= 0x20;
- }
- }
- else if ( rPropVal.Name.equals( sRangeXMaximum ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameter aXRangeMaximum;
- if ( rPropVal.Value >>= aXRangeMaximum )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nXRangeMax, aXRangeMaximum ) )
- nFlags |= 0x100;
- nFlags |= 0x20;
- }
- }
- else if ( rPropVal.Name.equals( sRangeYMinimum ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameter aYRangeMinimum;
- if ( rPropVal.Value >>= aYRangeMinimum )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nYRangeMin, aYRangeMinimum ) )
- nFlags |= 0x200;
- nFlags |= 0x20;
- }
- }
- else if ( rPropVal.Name.equals( sRangeYMaximum ) )
- {
- com::sun::star::drawing::EnhancedCustomShapeParameter aYRangeMaximum;
- if ( rPropVal.Value >>= aYRangeMaximum )
- {
- if ( GetValueForEnhancedCustomShapeHandleParameter( nYRangeMax, aYRangeMaximum ) )
- nFlags |= 0x400;
- nFlags |= 0x20;
- }
- }
- }
- aOut << nFlags
- << nXPosition
- << nYPosition
- << nXMap
- << nYMap
- << nXRangeMin
- << nXRangeMax
- << nYRangeMin
- << nYRangeMax;
-
- if ( nFlags & 8 )
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << ( nYPosition - 0x100 ) );
- }
- sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
- memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_Handles, sal_True, nStreamSize - 6, pBuf, nStreamSize );
- }
- else
- {
- sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_Handles, sal_True, 0, pBuf, 0 );
- }
- }
- }
- }
- else if ( rProp.Name.equals( sAdjustmentValues ) )
- {
- // it is required, that the information which handle is polar has already be read,
- // so we are able to change the polar value to a fixed float
- pAdjustmentValuesProp = &rProp;
- }
- }
- if ( pAdjustmentValuesProp )
- {
- uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq;
- if ( pAdjustmentValuesProp->Value >>= aAdjustmentSeq )
- {
- if ( bPredefinedHandlesUsed )
- LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted );
-
- sal_Int32 k, nValue = 0, nAdjustmentValues = aAdjustmentSeq.getLength();
- for ( k = 0; k < nAdjustmentValues; k++ )
- if( GetAdjustmentValue( aAdjustmentSeq[ k ], k, nAdjustmentsWhichNeedsToBeConverted, nValue ) )
- AddOpt( (sal_uInt16)( DFF_Prop_adjustValue + k ), (sal_uInt32)nValue );
- }
- }
- }
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-
-MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType )
-{
- MSO_SPT eShapeType = mso_sptNil;
- nMirrorFlags = 0;
- uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
- if ( aXPropSet.is() )
- {
- try
- {
- const OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM ( "CustomShapeGeometry" ) );
- uno::Any aGeoPropSet = aXPropSet->getPropertyValue( sCustomShapeGeometry );
- uno::Sequence< beans::PropertyValue > aGeoPropSeq;
- if ( aGeoPropSet >>= aGeoPropSeq )
- {
- sal_Int32 i, nCount = aGeoPropSeq.getLength();
- for ( i = 0; i < nCount; i++ )
- {
- const beans::PropertyValue& rProp = aGeoPropSeq[ i ];
- if ( rProp.Name.equalsAscii( "Type" ) )
- {
- if ( rProp.Value >>= rShapeType )
- eShapeType = EnhancedCustomShapeTypeNames::Get( rShapeType );
- }
- else if ( rProp.Name.equalsAscii( "MirroredX" ) )
- {
- sal_Bool bMirroredX = sal_Bool();
- if ( ( rProp.Value >>= bMirroredX ) && bMirroredX )
- nMirrorFlags |= SHAPEFLAG_FLIPH;
- }
- else if ( rProp.Name.equalsAscii( "MirroredY" ) )
- {
- sal_Bool bMirroredY = sal_Bool();
- if ( ( rProp.Value >>= bMirroredY ) && bMirroredY )
- nMirrorFlags |= SHAPEFLAG_FLIPV;
- }
- }
- }
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- }
- }
- return eShapeType;
-}
-
-MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags )
-{
- rtl::OUString aShapeType;
- return GetCustomShapeType( rXShape, nMirrorFlags, aShapeType );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-EscherPersistTable::EscherPersistTable()
-{
-}
-
-// ---------------------------------------------------------------------------------------------
-
-EscherPersistTable::~EscherPersistTable()
-{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- delete (EscherPersistEntry*)pPtr;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherPersistTable::PtIsID( UINT32 nID )
-{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- return TRUE;
- }
- return FALSE;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherPersistTable::PtInsert( UINT32 nID, UINT32 nOfs )
-{
- maPersistTable.Insert( new EscherPersistEntry( nID, nOfs ) );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherPersistTable::PtDelete( UINT32 nID )
-{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- {
-// UINT32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
- delete (EscherPersistEntry*) maPersistTable.Remove();
- }
- }
- return 0;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherPersistTable::PtGetOffsetByID( UINT32 nID )
-{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- return ((EscherPersistEntry*)pPtr)->mnOffset;
- }
- return 0;
-};
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherPersistTable::PtReplace( UINT32 nID, UINT32 nOfs )
-{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- {
- UINT32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
- ((EscherPersistEntry*)pPtr)->mnOffset = nOfs;
- return nRetValue;
- }
- }
- return 0;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherPersistTable::PtReplaceOrInsert( UINT32 nID, UINT32 nOfs )
-{
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- {
- UINT32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
- ((EscherPersistEntry*)pPtr)->mnOffset = nOfs;
- return nRetValue;
- }
- }
- PtInsert( nID, nOfs );
- return 0;
-}
-
-sal_Bool EscherPropertyValueHelper::GetPropertyValue(
- ::com::sun::star::uno::Any& rAny,
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rString,
- sal_Bool bTestPropertyAvailability )
-{
- sal_Bool bRetValue = sal_True;
- if ( bTestPropertyAvailability )
- {
- bRetValue = sal_False;
- try
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
- aXPropSetInfo( rXPropSet->getPropertySetInfo() );
- if ( aXPropSetInfo.is() )
- bRetValue = aXPropSetInfo->hasPropertyByName( rString );
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- bRetValue = sal_False;
- }
- }
- if ( bRetValue )
- {
- try
- {
- rAny = rXPropSet->getPropertyValue( rString );
- if ( !rAny.hasValue() )
- bRetValue = sal_False;
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- bRetValue = sal_False;
- }
- }
- return bRetValue;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-::com::sun::star::beans::PropertyState EscherPropertyValueHelper::GetPropertyState(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rPropertyName )
-{
- ::com::sun::star::beans::PropertyState eRetValue = ::com::sun::star::beans::PropertyState_AMBIGUOUS_VALUE;
- try
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > aXPropState
- ( rXPropSet, ::com::sun::star::uno::UNO_QUERY );
- if ( aXPropState.is() )
- eRetValue = aXPropState->getPropertyState( rPropertyName );
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- //...
- }
- return eRetValue;
-}
-
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-
-EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject& rObject, const ByteString& rId,
- const GraphicAttr* pGraphicAttr ) :
- mnPictureOffset ( nPictureOffset ),
- mnRefCount ( 1 ),
- mnSizeExtra ( 0 ),
- maPrefSize ( rObject.GetPrefSize() ),
- maPrefMapMode ( rObject.GetPrefMapMode() ),
- mbIsEmpty ( TRUE )
-{
- mbIsNativeGraphicPossible = ( pGraphicAttr == NULL );
- meBlibType = UNKNOWN;
- mnSize = 0;
-
- sal_uInt32 nLen = rId.Len();
- const sal_Char* pData = rId.GetBuffer();
- GraphicType eType( rObject.GetType() );
- if ( nLen && pData && ( eType != GRAPHIC_NONE ) )
- {
- mnIdentifier[ 0 ] = rtl_crc32( 0,pData, nLen );
- mnIdentifier[ 1 ] = 0;
-
- if ( pGraphicAttr )
- {
- if ( pGraphicAttr->IsSpecialDrawMode()
- || pGraphicAttr->IsMirrored()
- || pGraphicAttr->IsCropped()
- || pGraphicAttr->IsRotated()
- || pGraphicAttr->IsTransparent()
- || pGraphicAttr->IsAdjusted() )
- {
- SvMemoryStream aSt( sizeof( GraphicAttr ) );
- aSt << static_cast<sal_uInt16>(pGraphicAttr->GetDrawMode())
- << static_cast<sal_uInt32>(pGraphicAttr->GetMirrorFlags())
- << pGraphicAttr->GetLeftCrop()
- << pGraphicAttr->GetTopCrop()
- << pGraphicAttr->GetRightCrop()
- << pGraphicAttr->GetBottomCrop()
- << pGraphicAttr->GetRotation()
- << pGraphicAttr->GetLuminance()
- << pGraphicAttr->GetContrast()
- << pGraphicAttr->GetChannelR()
- << pGraphicAttr->GetChannelG()
- << pGraphicAttr->GetChannelB()
- << pGraphicAttr->GetGamma()
- << (BOOL)( pGraphicAttr->IsInvert() == TRUE )
- << pGraphicAttr->GetTransparency();
- mnIdentifier[ 1 ] = rtl_crc32( 0, aSt.GetData(), aSt.Tell() );
- }
- else
- mbIsNativeGraphicPossible = TRUE;
- }
- sal_uInt32 i, nTmp, n1, n2;
- n1 = n2 = 0;
- for ( i = 0; i < nLen; i++ )
- {
- nTmp = n2 >> 28; // rotating 4 bit
- n2 <<= 4;
- n2 |= n1 >> 28;
- n1 <<= 4;
- n1 |= nTmp;
- n1 ^= *pData++ - '0';
- }
- mnIdentifier[ 2 ] = n1;
- mnIdentifier[ 3 ] = n2;
- mbIsEmpty = FALSE;
- }
-};
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherBlibEntry::WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize )
-{
- sal_uInt32 nPictureOffset = ( bWritePictureOffset ) ? mnPictureOffset : 0;
-
- rSt << (sal_uInt32)( ( ESCHER_BSE << 16 ) | ( ( (sal_uInt16)meBlibType << 4 ) | 2 ) )
- << (sal_uInt32)( 36 + nResize )
- << (sal_uInt8)meBlibType;
-
- switch ( meBlibType )
- {
- case EMF :
- case WMF : // EMF/WMF auf OS2 zu Pict Konvertieren
- rSt << (sal_uInt8)PICT;
- break;
- default:
- rSt << (sal_uInt8)meBlibType;
- };
-
- rSt.Write( &mnIdentifier[ 0 ], 16 );
- rSt << (sal_uInt16)0
- << (sal_uInt32)( mnSize + mnSizeExtra )
- << mnRefCount
- << nPictureOffset
- << (sal_uInt32)0;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-EscherBlibEntry::~EscherBlibEntry()
-{
-};
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherBlibEntry::operator==( const EscherBlibEntry& rEscherBlibEntry ) const
-{
- for ( int i = 0; i < 3; i++ )
- {
- if ( mnIdentifier[ i ] != rEscherBlibEntry.mnIdentifier[ i ] )
- return FALSE;
- }
- return TRUE;
-}
-
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-
-EscherGraphicProvider::EscherGraphicProvider( sal_uInt32 nFlags ) :
- mnFlags ( nFlags ),
- mpBlibEntrys ( NULL ),
- mnBlibBufSize ( 0 ),
- mnBlibEntrys ( 0 )
-{
-}
-
-EscherGraphicProvider::~EscherGraphicProvider()
-{
- for ( UINT32 i = 0; i < mnBlibEntrys; delete mpBlibEntrys[ i++ ] ) ;
- delete[] mpBlibEntrys;
-}
-
-void EscherGraphicProvider::SetNewBlipStreamOffset( sal_Int32 nOffset )
-{
- for( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
- {
- EscherBlibEntry* pBlibEntry = mpBlibEntrys[ i ];
- pBlibEntry->mnPictureOffset += nOffset;
- }
-}
-
-UINT32 EscherGraphicProvider::ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry )
-{
- if ( mnBlibBufSize == mnBlibEntrys )
- {
- mnBlibBufSize += 64;
- EscherBlibEntry** pTemp = new EscherBlibEntry*[ mnBlibBufSize ];
- for ( UINT32 i = 0; i < mnBlibEntrys; i++ )
- {
- pTemp[ i ] = mpBlibEntrys[ i ];
- }
- delete[] mpBlibEntrys;
- mpBlibEntrys = pTemp;
- }
- mpBlibEntrys[ mnBlibEntrys++ ] = p_EscherBlibEntry;
- return mnBlibEntrys;
-}
-
-sal_uInt32 EscherGraphicProvider::GetBlibStoreContainerSize( SvStream* pMergePicStreamBSE ) const
-{
- sal_uInt32 nSize = 44 * mnBlibEntrys + 8;
- if ( pMergePicStreamBSE )
- {
- for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
- nSize += mpBlibEntrys[ i ]->mnSize + mpBlibEntrys[ i ]->mnSizeExtra;
- }
- return nSize;
-}
-
-sal_Bool EscherGraphicProvider::WriteBlibStoreEntry(SvStream& rSt,
- sal_uInt32 nBlipId, sal_Bool bWritePictureOffSet, sal_uInt32 nResize)
-{
- if (nBlipId > mnBlibEntrys || nBlipId == 0)
- return sal_False;
- mpBlibEntrys[nBlipId-1]->WriteBlibEntry(rSt, bWritePictureOffSet, nResize);
- return sal_True;
-}
-
-void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pMergePicStreamBSE )
-{
- sal_uInt32 nSize = GetBlibStoreContainerSize( pMergePicStreamBSE );
- if ( nSize )
- {
- rSt << (sal_uInt32)( ( ESCHER_BstoreContainer << 16 ) | 0x1f )
- << (sal_uInt32)( nSize - 8 );
-
- if ( pMergePicStreamBSE )
- {
- sal_uInt32 i, nBlipSize, nOldPos = pMergePicStreamBSE->Tell();
- const sal_uInt32 nBuf = 0x40000; // 256KB buffer
- sal_uInt8* pBuf = new sal_uInt8[ nBuf ];
-
- for ( i = 0; i < mnBlibEntrys; i++ )
- {
- EscherBlibEntry* pBlibEntry = mpBlibEntrys[ i ];
-
- ESCHER_BlibType nBlibType = pBlibEntry->meBlibType;
- nBlipSize = pBlibEntry->mnSize + pBlibEntry->mnSizeExtra;
- pBlibEntry->WriteBlibEntry( rSt, sal_False, nBlipSize );
-
- // BLIP
- pMergePicStreamBSE->Seek( pBlibEntry->mnPictureOffset );
- UINT16 n16;
- // record version and instance
- *pMergePicStreamBSE >> n16;
- rSt << n16;
- // record type
- *pMergePicStreamBSE >> n16;
- rSt << UINT16( ESCHER_BlipFirst + nBlibType );
- DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherEx::Flush: BLIP record types differ" );
- UINT32 n32;
- // record size
- *pMergePicStreamBSE >> n32;
- nBlipSize -= 8;
- rSt << nBlipSize;
- DBG_ASSERT( nBlipSize == n32, "EscherEx::Flush: BLIP sizes differ" );
- // record
- while ( nBlipSize )
- {
- UINT32 nBytes = ( nBlipSize > nBuf ? nBuf : nBlipSize );
- pMergePicStreamBSE->Read( pBuf, nBytes );
- rSt.Write( pBuf, nBytes );
- nBlipSize -= nBytes;
- }
- }
- delete[] pBuf;
- pMergePicStreamBSE->Seek( nOldPos );
- }
- else
- {
- for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
- mpBlibEntrys[ i ]->WriteBlibEntry( rSt, sal_True );
- }
- }
-}
-
-sal_Bool EscherGraphicProvider::GetPrefSize( const sal_uInt32 nBlibId, Size& rPrefSize, MapMode& rPrefMapMode )
-{
- sal_Bool bInRange = nBlibId && ( ( nBlibId - 1 ) < mnBlibEntrys );
- if ( bInRange )
- {
- EscherBlibEntry* pEntry = mpBlibEntrys[ nBlibId - 1 ];
- rPrefSize = pEntry->maPrefSize;
- rPrefMapMode = pEntry->maPrefMapMode;
- }
- return bInRange;
-}
-
-sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteString& rId,
- const Rectangle& /* rBoundRect */, const com::sun::star::awt::Rectangle* pVisArea, const GraphicAttr* pGraphicAttr )
-{
- sal_uInt32 nBlibId = 0;
- GraphicObject aGraphicObject( rId );
-
- EscherBlibEntry* p_EscherBlibEntry = new EscherBlibEntry( rPicOutStrm.Tell(), aGraphicObject, rId, pGraphicAttr );
- if ( !p_EscherBlibEntry->IsEmpty() )
- {
- for ( UINT32 i = 0; i < mnBlibEntrys; i++ )
- {
- if ( *( mpBlibEntrys[ i ] ) == *p_EscherBlibEntry )
- {
- mpBlibEntrys[ i ]->mnRefCount++;
- delete p_EscherBlibEntry;
- return i + 1;
- }
- }
-
- sal_Bool bUseNativeGraphic( FALSE );
-
- Graphic aGraphic( aGraphicObject.GetTransformedGraphic( pGraphicAttr ) );
- GfxLink aGraphicLink;
- SvMemoryStream aStream;
-
- const sal_uInt8* pGraphicAry = NULL;
-
- if ( p_EscherBlibEntry->mbIsNativeGraphicPossible && aGraphic.IsLink() )
- {
- aGraphicLink = aGraphic.GetLink();
-
- p_EscherBlibEntry->mnSize = aGraphicLink.GetDataSize();
- pGraphicAry = aGraphicLink.GetData();
-
- if ( p_EscherBlibEntry->mnSize && pGraphicAry )
- {
- switch ( aGraphicLink.GetType() )
- {
- case GFX_LINK_TYPE_NATIVE_JPG : p_EscherBlibEntry->meBlibType = PEG; break;
- case GFX_LINK_TYPE_NATIVE_PNG : p_EscherBlibEntry->meBlibType = PNG; break;
- case GFX_LINK_TYPE_NATIVE_WMF :
- {
- if ( pGraphicAry && ( p_EscherBlibEntry->mnSize > 0x2c ) )
- {
- if ( ( pGraphicAry[ 0x28 ] == 0x20 ) && ( pGraphicAry[ 0x29 ] == 0x45 ) // check the magic
- && ( pGraphicAry[ 0x2a ] == 0x4d ) && ( pGraphicAry[ 0x2b ] == 0x46 ) ) // number ( emf detection )
- {
- p_EscherBlibEntry->meBlibType = EMF;
- }
- else
- {
- p_EscherBlibEntry->meBlibType = WMF;
- if ( ( pGraphicAry[ 0 ] == 0xd7 ) && ( pGraphicAry[ 1 ] == 0xcd )
- && ( pGraphicAry[ 2 ] == 0xc6 ) && ( pGraphicAry[ 3 ] == 0x9a ) )
- { // we have to get rid of the metafileheader
- pGraphicAry += 22;
- p_EscherBlibEntry->mnSize -= 22;
- }
- }
- }
- }
- break;
- default: break;
- }
- if ( p_EscherBlibEntry->meBlibType != UNKNOWN )
- bUseNativeGraphic = TRUE;
- }
- }
- if ( !bUseNativeGraphic )
- {
- GraphicType eGraphicType = aGraphic.GetType();
- if ( ( eGraphicType == GRAPHIC_BITMAP ) || ( eGraphicType == GRAPHIC_GDIMETAFILE ) )
- {
- sal_uInt32 nErrCode;
- if ( !aGraphic.IsAnimated() )
-// !EMF nErrCode = GraphicConverter::Export( aStream, aGraphic, ( eGraphicType == GRAPHIC_BITMAP ) ? CVT_PNG : CVT_WMF );
- nErrCode = GraphicConverter::Export( aStream, aGraphic, ( eGraphicType == GRAPHIC_BITMAP ) ? CVT_PNG : CVT_EMF );
- else
- { // to store a animation, a gif has to be included into the msOG chunk of a png #I5583#
- GraphicFilter* pFilter = GetGrfFilter();
- SvMemoryStream aGIFStream;
- ByteString aVersion( "MSOFFICE9.0" );
- aGIFStream.Write( aVersion.GetBuffer(), aVersion.Len() );
- nErrCode = pFilter->ExportGraphic( aGraphic, String(), aGIFStream,
- pFilter->GetExportFormatNumberForShortName( String( RTL_CONSTASCII_USTRINGPARAM( "GIF" ) ) ), NULL );
- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aFilterData( 1 );
- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aAdditionalChunkSequence( 1 );
- sal_uInt32 nGIFSreamLen = aGIFStream.Tell();
- com::sun::star::uno::Sequence< sal_Int8 > aGIFSeq( nGIFSreamLen );
- sal_Int8* pSeq = aGIFSeq.getArray();
- aGIFStream.Seek( STREAM_SEEK_TO_BEGIN );
- aGIFStream.Read( pSeq, nGIFSreamLen );
- com::sun::star::beans::PropertyValue aChunkProp, aFilterProp;
- aChunkProp.Name = String( RTL_CONSTASCII_USTRINGPARAM( "msOG" ) );
- aChunkProp.Value <<= aGIFSeq;
- aAdditionalChunkSequence[ 0 ] = aChunkProp;
- aFilterProp.Name = String( RTL_CONSTASCII_USTRINGPARAM( "AdditionalChunks" ) );
- aFilterProp.Value <<= aAdditionalChunkSequence;
- aFilterData[ 0 ] = aFilterProp;
- nErrCode = pFilter->ExportGraphic( aGraphic, String(), aStream,
- pFilter->GetExportFormatNumberForShortName( String( RTL_CONSTASCII_USTRINGPARAM( "PNG" ) ) ), &aFilterData );
- }
- if ( nErrCode == ERRCODE_NONE )
- {
-// !EMF p_EscherBlibEntry->meBlibType = ( eGraphicType == GRAPHIC_BITMAP ) ? PNG : WMF;
- p_EscherBlibEntry->meBlibType = ( eGraphicType == GRAPHIC_BITMAP ) ? PNG : EMF;
- aStream.Seek( STREAM_SEEK_TO_END );
- p_EscherBlibEntry->mnSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
-
- if ( p_EscherBlibEntry->meBlibType == WMF ) // the fileheader is not used
- {
- p_EscherBlibEntry->mnSize -= 22;
- pGraphicAry += 22;
- }
- }
- }
- }
-
- ESCHER_BlibType eBlibType = p_EscherBlibEntry->meBlibType;
- if ( p_EscherBlibEntry->mnSize && pGraphicAry && ( eBlibType != UNKNOWN ) )
- {
- sal_uInt32 nExtra, nAtomSize = 0;
- sal_uInt32 nInstance, nUncompressedSize = p_EscherBlibEntry->mnSize;
-
- if ( mnFlags & _E_GRAPH_PROV_USE_INSTANCES )
- {
- rPicOutStrm << (UINT32)( 0x7f90000 | (UINT16)( mnBlibEntrys << 4 ) )
- << (UINT32)0;
- nAtomSize = rPicOutStrm.Tell();
- if ( eBlibType == PNG )
- rPicOutStrm << (sal_uInt16)0x0606;
- else if ( eBlibType == WMF )
- rPicOutStrm << (sal_uInt16)0x0403;
- else if ( eBlibType == EMF )
- rPicOutStrm << (sal_uInt16)0x0402;
- else if ( eBlibType == PEG )
- rPicOutStrm << (sal_uInt16)0x0505;
- }
- if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) )
- {
- nExtra = 17;
- p_EscherBlibEntry->mnSizeExtra = nExtra + 8;
- nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0;
- rPicOutStrm << nInstance << (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra );
- rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 );
- rPicOutStrm << (sal_uInt8)0xff;
- rPicOutStrm.Write( pGraphicAry, p_EscherBlibEntry->mnSize );
- }
- else
- {
- ZCodec aZCodec( 0x8000, 0x8000 );
- aZCodec.BeginCompression();
- SvMemoryStream aDestStrm;
- aZCodec.Write( aDestStrm, pGraphicAry, p_EscherBlibEntry->mnSize );
- aZCodec.EndCompression();
- aDestStrm.Seek( STREAM_SEEK_TO_END );
- p_EscherBlibEntry->mnSize = aDestStrm.Tell();
- pGraphicAry = (sal_uInt8*)aDestStrm.GetData();
- if ( p_EscherBlibEntry->mnSize && pGraphicAry )
- {
- nExtra = eBlibType == WMF ? 0x42 : 0x32; // !EMF -> no change
- p_EscherBlibEntry->mnSizeExtra = nExtra + 8;
- nInstance = ( eBlibType == WMF ) ? 0xf01b2170 : 0xf01a3d40; // !EMF -> no change
- rPicOutStrm << nInstance << (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra );
- if ( eBlibType == WMF ) // !EMF -> no change
- rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 );
- rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 );
-
- /*
- ##913##
- For Word the stored size of the graphic is critical the
- metafile boundaries must match the actual graphics
- boundaries, and the width and height must be in EMU's
-
- If you don't do it this way then objects edited in the
- msoffice app may show strange behaviour as the size jumps
- around, and the original size and scaling factor in word
- will be a very strange figure
- */
- UINT32 nPrefWidth = p_EscherBlibEntry->maPrefSize.Width();
- UINT32 nPrefHeight = p_EscherBlibEntry->maPrefSize.Height();
- UINT32 nWidth, nHeight;
- if ( pVisArea )
- {
- nWidth = pVisArea->Width * 360;
- nHeight = pVisArea->Height * 360;
- }
- else
- {
- Size aPrefSize(lcl_SizeToEmu(p_EscherBlibEntry->maPrefSize, p_EscherBlibEntry->maPrefMapMode));
- nWidth = aPrefSize.Width() * 360;
- nHeight = aPrefSize.Height() * 360;
- }
- rPicOutStrm << nUncompressedSize // WMFSize without FileHeader
- << (sal_Int32)0 // da die Originalgroesse des WMF's (ohne FileHeader)
- << (sal_Int32)0 // nicht mehr feststellbar ist, schreiben wir 10cm / x
- << nPrefWidth
- << nPrefHeight
- << nWidth
- << nHeight
- << p_EscherBlibEntry->mnSize
- << (sal_uInt16)0xfe00; // compression Flags
- rPicOutStrm.Write( pGraphicAry, p_EscherBlibEntry->mnSize );
- }
- }
- if ( nAtomSize )
- {
- sal_uInt32 nPos = rPicOutStrm.Tell();
- rPicOutStrm.Seek( nAtomSize - 4 );
- rPicOutStrm << (sal_uInt32)( nPos - nAtomSize );
- rPicOutStrm.Seek( nPos );
- }
- nBlibId = ImplInsertBlib( p_EscherBlibEntry ), p_EscherBlibEntry = NULL;
- }
- }
- if ( p_EscherBlibEntry )
- delete p_EscherBlibEntry;
- return nBlibId;
-}
-
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-
-struct EscherConnectorRule
-{
- sal_uInt32 nRuleId;
- sal_uInt32 nShapeA; // SPID of shape A
- sal_uInt32 nShapeB; // SPID of shape B
- sal_uInt32 nShapeC; // SPID of connector shape
- sal_uInt32 ncptiA; // Connection site Index of shape A
- sal_uInt32 ncptiB; // Connection site Index of shape B
-};
-
-struct EscherShapeListEntry
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > aXShape;
- sal_uInt32 n_EscherId;
-
- EscherShapeListEntry( const ::com::sun::star::uno::Reference
- < ::com::sun::star::drawing::XShape > & rShape, sal_uInt32 nId ) :
- aXShape ( rShape ),
- n_EscherId ( nId ) {}
-};
-
-sal_uInt32 EscherConnectorListEntry::GetClosestPoint( const Polygon& rPoly, const ::com::sun::star::awt::Point& rPoint )
-{
- sal_uInt16 nCount = rPoly.GetSize();
- sal_uInt16 nClosest = nCount;
- double fDist = (sal_uInt32)0xffffffff;
- while( nCount-- )
- {
- double fDistance = hypot( rPoint.X - rPoly[ nCount ].X(), rPoint.Y - rPoly[ nCount ].Y() );
- if ( fDistance < fDist )
- {
- nClosest = nCount;
- fDist = fDistance;
- }
- }
- return nClosest;
-};
-
-// ---------------------------------------------------------------------------------------------
-// bei Rechtecken bei Ellipsen bei Polygonen
-//
-// nRule = 0 ->Top 0 ->Top nRule = Index auf ein (Poly)Polygon Punkt
-// 1 ->Left 2 ->Left
-// 2 ->Bottom 4 ->Bottom
-// 3 ->Right 6 ->Right
-
-sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
-{
- sal_uInt32 nRule = 0;
-
- ::com::sun::star::uno::Any aAny;
- ::com::sun::star::awt::Point aRefPoint( ( bFirst ) ? maPointA : maPointB );
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
- aXShape( ( bFirst ) ? mXConnectToA : mXConnectToB );
-
- String aString( (::rtl::OUString)aXShape->getShapeType() );
- ByteString aType( aString, RTL_TEXTENCODING_UTF8 );
- aType.Erase( 0, 13 ); // removing "com.sun.star."
- sal_uInt16 nPos = aType.Search( "Shape" );
- aType.Erase( nPos, 5 );
-
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- aPropertySet( aXShape, ::com::sun::star::uno::UNO_QUERY );
-
- if ( aType == "drawing.PolyPolygon" || aType == "drawing.PolyLine" )
- {
- if ( aPropertySet.is() )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny,
- aPropertySet, String( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygon" ) ) ) )
- {
- ::com::sun::star::drawing::PointSequenceSequence* pSourcePolyPolygon =
- (::com::sun::star::drawing::PointSequenceSequence*)aAny.getValue();
- sal_Int32 nOuterSequenceCount = pSourcePolyPolygon->getLength();
- ::com::sun::star::drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->getArray();
-
- if ( pOuterSequence )
- {
- sal_Int32 a, b, nIndex = 0;
- sal_uInt32 nDistance = 0xffffffff;
- for( a = 0; a < nOuterSequenceCount; a++ )
- {
- ::com::sun::star::drawing::PointSequence* pInnerSequence = pOuterSequence++;
- if ( pInnerSequence )
- {
- ::com::sun::star::awt::Point* pArray = pInnerSequence->getArray();
- if ( pArray )
- {
- for ( b = 0; b < pInnerSequence->getLength(); b++, nIndex++, pArray++ )
- {
- sal_uInt32 nDist = (sal_uInt32)hypot( aRefPoint.X - pArray->X, aRefPoint.Y - pArray->Y );
- if ( nDist < nDistance )
- {
- nRule = nIndex;
- nDistance = nDist;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- else if ( ( aType == "drawing.OpenBezier" ) || ( aType == "drawing.OpenFreeHand" ) || ( aType == "drawing.PolyLinePath" )
- || ( aType == "drawing.ClosedBezier" ) || ( aType == "drawing.ClosedFreeHand" ) || ( aType == "drawing.PolyPolygonPath" ) )
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- aPropertySet2( aXShape, ::com::sun::star::uno::UNO_QUERY );
- if ( aPropertySet2.is() )
- {
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny,
- aPropertySet2, String( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygonBezier" ) ) ) )
- {
- ::com::sun::star::drawing::PolyPolygonBezierCoords* pSourcePolyPolygon =
- (::com::sun::star::drawing::PolyPolygonBezierCoords*)aAny.getValue();
- sal_Int32 nOuterSequenceCount = pSourcePolyPolygon->Coordinates.getLength();
-
- // Zeiger auf innere sequences holen
- ::com::sun::star::drawing::PointSequence* pOuterSequence =
- pSourcePolyPolygon->Coordinates.getArray();
- ::com::sun::star::drawing::FlagSequence* pOuterFlags =
- pSourcePolyPolygon->Flags.getArray();
-
- if ( pOuterSequence && pOuterFlags )
- {
- sal_Int32 a, b, nIndex = 0;
- sal_uInt32 nDistance = 0xffffffff;
-
- for ( a = 0; a < nOuterSequenceCount; a++ )
- {
- ::com::sun::star::drawing::PointSequence* pInnerSequence = pOuterSequence++;
- ::com::sun::star::drawing::FlagSequence* pInnerFlags = pOuterFlags++;
- if ( pInnerSequence && pInnerFlags )
- {
- ::com::sun::star::awt::Point* pArray = pInnerSequence->getArray();
- ::com::sun::star::drawing::PolygonFlags* pFlags = pInnerFlags->getArray();
- if ( pArray && pFlags )
- {
- for ( b = 0; b < pInnerSequence->getLength(); b++, pArray++ )
- {
- PolyFlags ePolyFlags = *( (PolyFlags*)pFlags++ );
- if ( ePolyFlags == POLY_CONTROL )
- continue;
- sal_uInt32 nDist = (sal_uInt32)hypot( aRefPoint.X - pArray->X, aRefPoint.Y - pArray->Y );
- if ( nDist < nDistance )
- {
- nRule = nIndex;
- nDistance = nDist;
- }
- nIndex++;
- }
- }
- }
- }
- }
- }
- }
- }
- else
- {
- bool bRectangularConnection = true;
-
- if ( aType == "drawing.Custom" )
- {
- SdrObject* pCustoShape( GetSdrObjectFromXShape( aXShape ) );
- if ( pCustoShape && pCustoShape->ISA( SdrObjCustomShape ) )
- {
- SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)
- pCustoShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
-
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM( "Path" ) );
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM( "GluePointType" ) );
-
- rtl::OUString sShapeType;
- uno::Any* pType = rGeometryItem.GetPropertyValueByName( sType );
- if ( pType )
- *pType >>= sShapeType;
- MSO_SPT eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
-
- uno::Any* pGluePointType = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sGluePointType );
-
- sal_Int16 nGluePointType = sal_Int16();
- if ( !( pGluePointType &&
- ( *pGluePointType >>= nGluePointType ) ) )
- nGluePointType = GetCustomShapeConnectionTypeDefault( eSpType );
-
- if ( nGluePointType == com::sun::star::drawing::EnhancedCustomShapeGluePointType::CUSTOM )
- {
- const SdrGluePointList* pList = pCustoShape->GetGluePointList();
- if ( pList )
- {
- Polygon aPoly;
- USHORT nNum, nAnz = pList->GetCount();
- if ( nAnz )
- {
- for ( nNum = 0; nNum < nAnz; nNum++ )
- {
- const SdrGluePoint& rGP = (*pList)[ nNum ];
- Point aPt( rGP.GetAbsolutePos( *pCustoShape ) );
- aPoly.Insert( POLY_APPEND, aPt );
- }
- nRule = GetClosestPoint( aPoly, aRefPoint );
- bRectangularConnection = false;
- }
- }
- }
- else if ( nGluePointType == com::sun::star::drawing::EnhancedCustomShapeGluePointType::SEGMENTS )
- {
- SdrObject* pPoly = pCustoShape->DoConvertToPolyObj( TRUE );
- if ( pPoly && pPoly->ISA( SdrPathObj ) )
- {
- sal_Int16 a, b, nIndex = 0;
- sal_uInt32 nDistance = 0xffffffff;
-
- // #i74631# use explicit constructor here. Also XPolyPolygon is not necessary,
- // reducing to PolyPolygon
- const PolyPolygon aPolyPoly(((SdrPathObj*)pPoly)->GetPathPoly());
-
- for ( a = 0; a < aPolyPoly.Count(); a++ )
- {
- const Polygon& rPoly = aPolyPoly.GetObject( a );
- for ( b = 0; b < rPoly.GetSize(); b++ )
- {
- if ( rPoly.GetFlags( b ) != POLY_NORMAL )
- continue;
- const Point& rPt = rPoly[ b ];
- sal_uInt32 nDist = (sal_uInt32)hypot( aRefPoint.X - rPt.X(), aRefPoint.Y - rPt.Y() );
- if ( nDist < nDistance )
- {
- nRule = nIndex;
- nDistance = nDist;
- }
- nIndex++;
- }
- }
- if ( nDistance != 0xffffffff )
- bRectangularConnection = false;
- }
- }
- }
- }
- if ( bRectangularConnection )
- {
- ::com::sun::star::awt::Point aPoint( aXShape->getPosition() );
- ::com::sun::star::awt::Size aSize( aXShape->getSize() );
-
- Rectangle aRect( Point( aPoint.X, aPoint.Y ), Size( aSize.Width, aSize.Height ) );
- Point aCenter( aRect.Center() );
- Polygon aPoly( 4 );
-
- aPoly[ 0 ] = Point( aCenter.X(), aRect.Top() );
- aPoly[ 1 ] = Point( aRect.Left(), aCenter.Y() );
- aPoly[ 2 ] = Point( aCenter.X(), aRect.Bottom() );
- aPoly[ 3 ] = Point( aRect.Right(), aCenter.Y() );
-
- sal_Int32 nAngle = ( EscherPropertyValueHelper::GetPropertyValue( aAny,
- aPropertySet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True ) )
- ? *((sal_Int32*)aAny.getValue() )
- : 0;
- if ( nAngle )
- aPoly.Rotate( aRect.TopLeft(), (sal_uInt16)( ( nAngle + 5 ) / 10 ) );
- nRule = GetClosestPoint( aPoly, aRefPoint );
-
- if ( aType == "drawing.Ellipse" )
- nRule <<= 1; // In PPT hat eine Ellipse 8 Möglichkeiten sich zu connecten
- }
- }
- return nRule;
-}
-
-EscherSolverContainer::~EscherSolverContainer()
-{
- void* pP;
-
- for( pP = maShapeList.First(); pP; pP = maShapeList.Next() )
- delete (EscherShapeListEntry*)pP;
- for( pP = maConnectorList.First(); pP; pP = maConnectorList.Next() )
- delete (EscherConnectorListEntry*)pP;
-}
-
-void EscherSolverContainer::AddShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32 nId )
-{
- maShapeList.Insert( new EscherShapeListEntry( rXShape, nId ), LIST_APPEND );
-}
-
-void EscherSolverContainer::AddConnector( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConnector,
- const ::com::sun::star::awt::Point& rPA,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConA,
- const ::com::sun::star::awt::Point& rPB,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rConB )
-{
- maConnectorList.Insert( new EscherConnectorListEntry( rConnector, rPA, rConA, rPB, rConB ), LIST_APPEND );
-}
-
-sal_uInt32 EscherSolverContainer::GetShapeId( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ) const
-{
- for ( EscherShapeListEntry* pPtr = (EscherShapeListEntry*)((List&)maShapeList).First();
- pPtr; pPtr = (EscherShapeListEntry*)((List&)maShapeList).Next() )
- {
- if ( rXShape == pPtr->aXShape )
- return ( pPtr->n_EscherId );
- }
- return 0;
-}
-
-void EscherSolverContainer::WriteSolver( SvStream& rStrm )
-{
- sal_uInt32 nCount = maConnectorList.Count();
- if ( nCount )
- {
- sal_uInt32 nRecHdPos, nCurrentPos, nSize;
- rStrm << (sal_uInt16)( ( nCount << 4 ) | 0xf ) // open an ESCHER_SolverContainer
- << (sal_uInt16)ESCHER_SolverContainer //
- << (sal_uInt32)0; //
-
- nRecHdPos = rStrm.Tell() - 4;
-
- EscherConnectorRule aConnectorRule;
- aConnectorRule.nRuleId = 2;
- for ( EscherConnectorListEntry* pPtr = (EscherConnectorListEntry*)maConnectorList.First();
- pPtr; pPtr = (EscherConnectorListEntry*)maConnectorList.Next() )
- {
- aConnectorRule.ncptiA = aConnectorRule.ncptiB = 0xffffffff;
- aConnectorRule.nShapeC = GetShapeId( pPtr->mXConnector );
- aConnectorRule.nShapeA = GetShapeId( pPtr->mXConnectToA );
- aConnectorRule.nShapeB = GetShapeId( pPtr->mXConnectToB );
-
- if ( aConnectorRule.nShapeC )
- {
- if ( aConnectorRule.nShapeA )
- aConnectorRule.ncptiA = pPtr->GetConnectorRule( sal_True );
- if ( aConnectorRule.nShapeB )
- aConnectorRule.ncptiB = pPtr->GetConnectorRule( sal_False );
- }
- rStrm << (sal_uInt32)( ( ESCHER_ConnectorRule << 16 ) | 1 ) // atom hd
- << (sal_uInt32)24 //
- << aConnectorRule.nRuleId
- << aConnectorRule.nShapeA
- << aConnectorRule.nShapeB
- << aConnectorRule.nShapeC
- << aConnectorRule.ncptiA
- << aConnectorRule.ncptiB;
-
- aConnectorRule.nRuleId += 2;
- }
-
- nCurrentPos = rStrm.Tell(); // close the ESCHER_SolverContainer
- nSize = ( nCurrentPos - nRecHdPos ) - 4;//
- rStrm.Seek( nRecHdPos ); //
- rStrm << nSize; //
- rStrm.Seek( nCurrentPos ); //
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------
-
-EscherEx::EscherEx( SvStream& rOutStrm, UINT32 nDrawings ) :
- EscherGraphicProvider ( 0 ),
- mpOutStrm ( &rOutStrm ),
- mnDrawings ( nDrawings ),
-
- mnGroupLevel ( 0 ),
- mnHellLayerId ( USHRT_MAX ),
-
- mbEscherSpgr ( FALSE ),
- mbEscherDgg ( FALSE ), // TRUE, wenn jemals ein ESCHER_Dgg angelegt wurde, dieser wird dann im Dest. aktualisiert
- mbEscherDg ( FALSE ),
- mbOleEmf ( FALSE )
-{
- mnStrmStartOfs = mpOutStrm->Tell();
- mpImplEscherExSdr = new ImplEscherExSdr( *this );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::Flush( SvStream* pPicStreamMergeBSE /* = NULL */ )
-{
- if ( mbEscherDgg ) // ESCHER_Dgg anpassen
- {
- PtReplaceOrInsert( ESCHER_Persist_CurrentPosition, mpOutStrm->Tell() );
- if ( DoSeek( ESCHER_Persist_Dgg ) )
- {
- *mpOutStrm << mnCurrentShapeID << (UINT32)( mnFIDCLs + 1 ) << mnTotalShapesDgg << mnDrawings;
- }
- if ( HasGraphics() )
- {
- if ( DoSeek( ESCHER_Persist_BlibStoreContainer ) ) // ESCHER_BlibStoreContainer schreiben
- {
- sal_uInt32 nAddBytes = GetBlibStoreContainerSize( pPicStreamMergeBSE );
- if ( nAddBytes )
- {
- InsertAtCurrentPos( nAddBytes, TRUE ); // platz schaffen fuer Blib Container samt seinen Blib Atomen
- WriteBlibStoreContainer( *mpOutStrm, pPicStreamMergeBSE );
- }
- }
- }
- mpOutStrm->Seek( PtGetOffsetByID( ESCHER_Persist_CurrentPosition ) );
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-
-EscherEx::~EscherEx()
-{
- delete mpImplEscherExSdr;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::InsertAtCurrentPos( UINT32 nBytes, BOOL bContainer )
-{
- UINT32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
- BYTE* pBuf;
-
- // Persist table anpassen
- for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
- {
- UINT32 nOfs = ((EscherPersistEntry*)pPtr)->mnOffset;
- if ( nOfs >= nCurPos )
- ((EscherPersistEntry*)pPtr)->mnOffset += nBytes;
- }
-
- // container und atom sizes anpassen
- mpOutStrm->Seek( mnStrmStartOfs );
- while ( mpOutStrm->Tell() < nCurPos )
- {
- *mpOutStrm >> nType >> nSize;
- if ( ( mpOutStrm->Tell() + nSize ) >= ( ( bContainer ) ? nCurPos + 1 : nCurPos ) )
- {
- mpOutStrm->SeekRel( -4 );
- *mpOutStrm << (UINT32)( nSize + nBytes );
- if ( ( nType & 0xf ) != 0xf )
- mpOutStrm->SeekRel( nSize );
- }
- else
- mpOutStrm->SeekRel( nSize );
- }
- std::vector< sal_uInt32 >::iterator aIter( mOffsets.begin() );
- std::vector< sal_uInt32 >::iterator aEnd( mOffsets.end() );
- while( aIter != aEnd )
- {
- if ( *aIter > nCurPos )
- *aIter += nBytes;
- aIter++;
- }
- mpOutStrm->Seek( STREAM_SEEK_TO_END );
- nSource = mpOutStrm->Tell();
- nToCopy = nSource - nCurPos; // Stream um nBytes vergroessern
- pBuf = new BYTE[ 0x40000 ]; // 256KB Buffer
- while ( nToCopy )
- {
- nBufSize = ( nToCopy >= 0x40000 ) ? 0x40000 : nToCopy;
- nToCopy -= nBufSize;
- nSource -= nBufSize;
- mpOutStrm->Seek( nSource );
- mpOutStrm->Read( pBuf, nBufSize );
- mpOutStrm->Seek( nSource + nBytes );
- mpOutStrm->Write( pBuf, nBufSize );
- }
- delete[] pBuf;
- mpOutStrm->Seek( nCurPos );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherEx::SeekBehindRecHeader( UINT16 nRecType )
-{
- UINT32 nOldPos, nStreamEnd, nType, nSize;
-
- nOldPos = mpOutStrm->Tell();
- nStreamEnd = mpOutStrm->Seek( STREAM_SEEK_TO_END );
- mpOutStrm->Seek( nOldPos );
- while ( mpOutStrm->Tell() < nStreamEnd )
- {
- *mpOutStrm >> nType >> nSize;
- if ( ( nType >> 16 ) == nRecType )
- return TRUE;
- if ( ( nType & 0xf ) != 0xf )
- mpOutStrm->SeekRel( nSize );
- }
- mpOutStrm->Seek( nOldPos );
- return FALSE;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::InsertPersistOffset( UINT32 nKey, UINT32 nOffset )
-{
- PtInsert( ESCHER_Persist_PrivateEntry | nKey, nOffset );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherEx::DoSeek( UINT32 nKey )
-{
- UINT32 nPos = PtGetOffsetByID( nKey );
- if ( nPos )
- mpOutStrm->Seek( nPos );
- else
- {
- if (! PtIsID( nKey ) )
- return FALSE;
- mpOutStrm->Seek( 0 );
- }
- return TRUE;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherEx::SeekToPersistOffset( UINT32 nKey )
-{
- return DoSeek( ESCHER_Persist_PrivateEntry | nKey );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherEx::InsertAtPersistOffset( UINT32 nKey, UINT32 nValue )
-{
- UINT32 nOldPos = mpOutStrm->Tell();
- BOOL bRetValue = SeekToPersistOffset( nKey );
- if ( bRetValue )
- {
- *mpOutStrm << nValue;
- mpOutStrm->Seek( nOldPos );
- }
- return bRetValue;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
-{
- *mpOutStrm << (UINT16)( ( nRecInstance << 4 ) | 0xf ) << nEscherContainer << (UINT32)0;
- mOffsets.push_back( mpOutStrm->Tell() - 4 );
- mRecTypes.push_back( nEscherContainer );
- switch( nEscherContainer )
- {
- case ESCHER_DggContainer :
- {
- mbEscherDgg = TRUE;
- mnFIDCLs = mnDrawings;
- mnCurrentDg = 0;
- mnCurrentShapeID = 0;
- mnTotalShapesDgg = 0;
- mnCurrentShapeMaximumID = 0;
- AddAtom( 16 + ( mnDrawings << 3 ), ESCHER_Dgg ); // an FDGG and several FIDCLs
- PtReplaceOrInsert( ESCHER_Persist_Dgg, mpOutStrm->Tell() );
- *mpOutStrm << (UINT32)0 // the current maximum shape ID
- << (UINT32)0 // the number of ID clusters + 1
- << (UINT32)0 // the number of total shapes saved
- << (UINT32)0; // the total number of drawings saved
- PtReplaceOrInsert( ESCHER_Persist_Dgg_FIDCL, mpOutStrm->Tell() );
- for ( UINT32 i = 0; i < mnFIDCLs; i++ ) // Dummy FIDCLs einfuegen
- {
- *mpOutStrm << (UINT32)0 << (UINT32)0; // Drawing Nummer, Anzahl der Shapes in diesem IDCL
- }
- PtReplaceOrInsert( ESCHER_Persist_BlibStoreContainer, mpOutStrm->Tell() );
- }
- break;
-
- case ESCHER_DgContainer :
- {
- if ( mbEscherDgg )
- {
- if ( !mbEscherDg )
- {
- mbEscherDg = TRUE;
- mnCurrentDg++;
- mnTotalShapesDg = 0;
- mnTotalShapeIdUsedDg = 0;
- mnCurrentShapeID = ( mnCurrentShapeMaximumID &~0x3ff ) + 0x400; // eine neue Seite bekommt immer eine neue ShapeId die ein vielfaches von 1024 ist,
- // damit ist erste aktuelle Shape ID 0x400
- AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
- PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
- *mpOutStrm << (UINT32)0 // The number of shapes in this drawing
- << (UINT32)0; // The last MSOSPID given to an SP in this DG
- }
- }
- }
- break;
-
- case ESCHER_SpgrContainer :
- {
- if ( mbEscherDg )
- {
- mbEscherSpgr = TRUE;
- }
- }
- break;
-
- case ESCHER_SpContainer :
- {
- }
- break;
-
- default:
- break;
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::CloseContainer()
-{
- sal_uInt32 nSize, nPos = mpOutStrm->Tell();
- nSize = ( nPos - mOffsets.back() ) - 4;
- mpOutStrm->Seek( mOffsets.back() );
- *mpOutStrm << nSize;
-
- switch( mRecTypes.back() )
- {
- case ESCHER_DgContainer :
- {
- if ( mbEscherDg )
- {
- mbEscherDg = FALSE;
- if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
- {
- // shapeanzahl des drawings setzen
- mnTotalShapesDgg += mnTotalShapesDg;
- *mpOutStrm << mnTotalShapesDg << mnCurrentShapeMaximumID;
- if ( DoSeek( ESCHER_Persist_Dgg_FIDCL ) )
- {
- if ( mnTotalShapesDg == 0 )
- {
- mpOutStrm->SeekRel( 8 );
- }
- else
- {
- if ( mnTotalShapeIdUsedDg )
- {
- // die benutzten Shape Ids des drawings in die fidcls setzen
- UINT32 i, nFIDCL = ( ( mnTotalShapeIdUsedDg - 1 ) / 0x400 );
- if ( nFIDCL )
- {
- if ( nPos > mpOutStrm->Tell() )
- nPos += ( nFIDCL << 3 );
-
- mnFIDCLs += nFIDCL;
- InsertAtCurrentPos( nFIDCL << 3 ); // platz schaffen fuer weitere FIDCL's
- }
- for ( i = 0; i <= nFIDCL; i++ )
- {
- *mpOutStrm << mnCurrentDg;
- if ( i < nFIDCL )
- *mpOutStrm << (UINT32)0x400;
- else
- {
- UINT32 nShapesLeft = mnTotalShapeIdUsedDg % 0x400;
- if ( !nShapesLeft )
- nShapesLeft = 0x400;
- *mpOutStrm << (UINT32)nShapesLeft;
- }
- }
- }
- }
- PtReplaceOrInsert( ESCHER_Persist_Dgg_FIDCL, mpOutStrm->Tell() ); // neuen FIDCL Offset fuer naechste Seite
- }
- }
- }
- }
- break;
-
- case ESCHER_SpgrContainer :
- {
- if ( mbEscherSpgr )
- {
- mbEscherSpgr = FALSE;
-
- }
- }
- break;
-
- default:
- break;
- }
- mOffsets.pop_back();
- mRecTypes.pop_back();
- mpOutStrm->Seek( nPos );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::BeginAtom()
-{
- mnCountOfs = mpOutStrm->Tell();
- *mpOutStrm << (UINT32)0 << (UINT32)0; // record header wird spaeter geschrieben
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::EndAtom( UINT16 nRecType, int nRecVersion, int nRecInstance )
-{
- UINT32 nOldPos = mpOutStrm->Tell();
- mpOutStrm->Seek( mnCountOfs );
- sal_uInt32 nSize = nOldPos - mnCountOfs;
- *mpOutStrm << (UINT16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << (UINT32)( nSize - 8 );
- mpOutStrm->Seek( nOldPos );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int nRecInstance )
-{
- *mpOutStrm << (UINT16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << nAtomSize;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::AddChildAnchor( const Rectangle& rRect )
-{
- AddAtom( 16, ESCHER_ChildAnchor );
- GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::AddClientAnchor( const Rectangle& rRect )
-{
- AddAtom( 8, ESCHER_ClientAnchor );
- *mpOutStrm << (sal_Int16)rRect.Top()
- << (sal_Int16)rRect.Left()
- << (sal_Int16)( rRect.GetWidth() + rRect.Left() )
- << (sal_Int16)( rRect.GetHeight() + rRect.Top() );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-EscherExHostAppData* EscherEx::EnterAdditionalTextGroup()
-{
- return NULL;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRect )
-{
- Rectangle aRect;
- if( pBoundRect )
- aRect = *pBoundRect;
-
- OpenContainer( ESCHER_SpgrContainer );
- OpenContainer( ESCHER_SpContainer );
- AddAtom( 16, ESCHER_Spgr, 1 );
- PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel,
- mpOutStrm->Tell() );
- *mpOutStrm << (INT32)aRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (INT32)aRect.Top()
- << (INT32)aRect.Right()
- << (INT32)aRect.Bottom();
-
- UINT32 nShapeId = GetShapeID();
- if ( !mnGroupLevel )
- AddShape( ESCHER_ShpInst_Min, 5, nShapeId ); // Flags: Group | Patriarch
- else
- {
- AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | HaveAnchor
- EscherPropertyContainer aPropOpt;
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x00040004 );
- aPropOpt.AddOpt( ESCHER_Prop_dxWrapDistLeft, 0 );
- aPropOpt.AddOpt( ESCHER_Prop_dxWrapDistRight, 0 );
-
- // #i51348# shape name
- if( rShapeName.Len() > 0 )
- aPropOpt.AddOpt( ESCHER_Prop_wzName, rShapeName );
-
- Commit( aPropOpt, aRect );
- if ( mnGroupLevel > 1 )
- AddChildAnchor( aRect );
-
- EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
- if( pAppData )
- {
- if ( mnGroupLevel <= 1 )
- pAppData->WriteClientAnchor( *this, aRect );
- pAppData->WriteClientData( *this );
- }
- }
- CloseContainer(); // ESCHER_SpContainer
- mnGroupLevel++;
- return nShapeId;
-}
-
-UINT32 EscherEx::EnterGroup( const Rectangle* pBoundRect )
-{
- return EnterGroup( String::EmptyString(), pBoundRect );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherEx::SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect )
-{
- BOOL bRetValue = FALSE;
- if ( nGroupLevel )
- {
- UINT32 nCurrentPos = mpOutStrm->Tell();
- if ( DoSeek( ESCHER_Persist_Grouping_Snap | ( nGroupLevel - 1 ) ) )
- {
- *mpOutStrm << (INT32)rRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
- mpOutStrm->Seek( nCurrentPos );
- }
- }
- return bRetValue;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-BOOL EscherEx::SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect )
-{
- BOOL bRetValue = FALSE;
- if ( nGroupLevel )
- {
- UINT32 nCurrentPos = mpOutStrm->Tell();
- if ( DoSeek( ESCHER_Persist_Grouping_Logic | ( nGroupLevel - 1 ) ) )
- {
- *mpOutStrm << (INT16)rRect.Top() << (INT16)rRect.Left() << (INT16)rRect.Right() << (INT16)rRect.Bottom();
- mpOutStrm->Seek( nCurrentPos );
- }
- }
- return bRetValue;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::LeaveGroup()
-{
- --mnGroupLevel;
- PtDelete( ESCHER_Persist_Grouping_Snap | mnGroupLevel );
- PtDelete( ESCHER_Persist_Grouping_Logic | mnGroupLevel );
- CloseContainer();
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::AddShape( UINT32 nShpInstance, UINT32 nFlags, UINT32 nShapeID )
-{
- AddAtom( 8, ESCHER_Sp, 2, nShpInstance );
-
- if ( !nShapeID )
- nShapeID = GetShapeID();
-
- if ( nFlags ^ 1 ) // is this a group shape ?
- { // if not
- if ( mnGroupLevel > 1 )
- nFlags |= 2; // this not a topmost shape
- }
- *mpOutStrm << nShapeID << nFlags;
-
- if ( mbEscherSpgr )
- mnTotalShapesDg++;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherEx::GetShapeID()
-{
- mnCurrentShapeMaximumID = mnCurrentShapeID; // maximum setzen
- mnCurrentShapeID++; // mnCurrentShape ID auf nachste freie ID
- mnTotalShapeIdUsedDg++;
- return mnCurrentShapeMaximumID;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& )
-{
- rProps.Commit( GetStream() );
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherEx::GetColor( const UINT32 nSOColor, BOOL bSwap )
-{
- if ( bSwap )
- {
- UINT32 nColor = nSOColor & 0xff00; // GRUEN
- nColor |= (BYTE)( nSOColor ) << 16; // ROT
- nColor |= (BYTE)( nSOColor >> 16 ); // BLAU
- return nColor;
- }
- else
- return nSOColor & 0xffffff;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherEx::GetColor( const Color& rSOColor, BOOL bSwap )
-{
- UINT32 nColor = ( rSOColor.GetRed() << 16 );
- nColor |= ( rSOColor.GetGreen() << 8 );
- nColor |= rSOColor.GetBlue();
-
- if ( !bSwap )
- nColor = GetColor( nColor, TRUE );
-
- return nColor;
-}
-
-// ---------------------------------------------------------------------------------------------
diff --git a/svx/source/msfilter/eschesdo.cxx b/svx/source/msfilter/eschesdo.cxx
deleted file mode 100644
index 86a1bd131b..0000000000
--- a/svx/source/msfilter/eschesdo.cxx
+++ /dev/null
@@ -1,1244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: eschesdo.cxx,v $
- * $Revision: 1.39 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include "eschesdo.hxx"
-#include <svx/svdobj.hxx>
-#include <unoapi.hxx>
-#include <svx/svdoashp.hxx>
-#include <svx/unoshape.hxx>
-#include <vcl/outdev.hxx>
-#include <tools/poly.hxx>
-#include <vcl/bitmapex.hxx>
-#include <vcl/graph.hxx>
-#include <tools/debug.hxx>
-#include <svx/fmdpage.hxx>
-
-#ifndef _TOOLKIT_UNOHLP_HXX //autogen wg. VCLXBitmap
-#include <toolkit/unohlp.hxx>
-#endif
-#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <com/sun/star/awt/Gradient.hpp>
-#include <com/sun/star/drawing/PointSequence.hpp>
-#include <com/sun/star/drawing/PointSequenceSequence.hpp>
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include <com/sun/star/drawing/FlagSequence.hpp>
-#include <com/sun/star/drawing/TextAdjust.hpp>
-#include <com/sun/star/drawing/LineDash.hpp>
-#include <com/sun/star/text/XText.hpp>
-#include <com/sun/star/drawing/CircleKind.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/task/XStatusIndicator.hpp>
-#include <comphelper/extract.hxx>
-#include <svtools/fltcall.hxx>
-#include <vcl/cvtgrf.hxx>
-
-using ::rtl::OUString;
-using namespace ::vos;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::task;
-using namespace ::com::sun::star::style;
-
-#define EES_MAP_FRACTION 1440 // 1440 dpi
-
-// ===================================================================
-
-ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
- :
- mpEscherEx ( &rEx ),
- maMapModeSrc ( MAP_100TH_MM ),
- // PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
- maMapModeDest( MAP_INCH, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) ),
-// mXStatusIndicator ( rXStatInd ),
- mpPicStrm ( NULL ),
- mpHostAppData ( NULL ),
- mnPagesWritten ( 0 ),
- mnShapeMasterTitle ( 0 ),
- mnShapeMasterBody ( 0 ),
- mbStatusIndicator ( FALSE ),
- mbStatus ( FALSE )
-{
-}
-
-
-// -------------------------------------------------------------------
-
-Point ImplEESdrWriter::ImplMapPoint( const Point& rPoint )
-{
- return OutputDevice::LogicToLogic( rPoint, maMapModeSrc, maMapModeDest );
-}
-
-
-// -------------------------------------------------------------------
-
-Size ImplEESdrWriter::ImplMapSize( const Size& rSize )
-{
- Size aRetSize( OutputDevice::LogicToLogic( rSize, maMapModeSrc, maMapModeDest ) );
-
- if ( !aRetSize.Width() )
- aRetSize.Width()++;
- if ( !aRetSize.Height() )
- aRetSize.Height()++;
- return aRetSize;
-}
-
-// -------------------------------------------------------------------
-
-void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt )
-{
- INT32 nAngle = rObj.GetAngle();
- Rectangle aRect( rObj.GetRect() );
-
- if ( nAngle < 0 )
- nAngle = ( 36000 + nAngle ) % 36000;
- else
- nAngle = ( 36000 - ( nAngle % 36000 ) );
-
- double fVal = (double)nAngle * F_PI18000;
- double fCos = cos( fVal );
- double fSin = sin( fVal );
-
- double nWidthHalf = (double) aRect.GetWidth() / 2;
- double nHeightHalf = (double) aRect.GetHeight() / 2;
-
- double nXDiff = fCos * nWidthHalf + fSin * (-nHeightHalf);
- double nYDiff = - ( fSin * nWidthHalf - fCos * ( -nHeightHalf ) );
-
- aRect.Move( (sal_Int32)( -( nWidthHalf - nXDiff ) ), (sal_Int32)( - ( nHeightHalf + nYDiff ) ) );
-
- nAngle *= 655;
- nAngle += 0x8000;
- nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
- rPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
-
- rObj.SetAngle( nAngle );
- rObj.SetRect( aRect );
-}
-
-// -----------------------------------------------------------------------
-
-#define ADD_SHAPE( nType, nFlags ) \
-{ \
- nShapeType = nType; \
- nShapeID = mpEscherEx->GetShapeID(); \
- rObj.SetShapeId( nShapeID ); \
- mpEscherEx->AddShape( (UINT32)nType, (UINT32)nFlags, nShapeID ); \
- rSolverContainer.AddShape( rObj.GetShapeRef(), nShapeID ); \
-}
-
-#define SHAPE_TEXT( bFill ) \
-{ \
- mpEscherEx->OpenContainer( ESCHER_SpContainer ); \
- ADD_SHAPE( ESCHER_ShpInst_TextBox, 0xa00 ); \
- if ( bFill ) \
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True ); \
- if( rObj.ImplGetText() ) \
- aPropOpt.CreateTextProperties( rObj.mXPropSet, \
- mpEscherEx->QueryTextID( rObj.GetShapeRef(), \
- rObj.GetShapeId() ) ); \
-}
-
-//Map from twips to export units, generally twips as well, only excel and word
-//export is happening here, so native units are export units, leave as
-//placeholder if required in future
-void ImplEESdrWriter::MapRect(ImplEESdrObject& /* rObj */ )
-{
-}
-
-UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
- EscherSolverContainer& rSolverContainer,
- ImplEESdrPageType ePageType )
-{
- UINT32 nShapeID = 0;
- UINT16 nShapeType = 0;
- BOOL bDontWriteText = FALSE; // if a metafile is written as shape replacement, then the text is already part of the metafile
- BOOL bAdditionalText = FALSE;
- UINT32 nGrpShapeID = 0;
-
- do {
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef() );
- if ( mpHostAppData && mpHostAppData->DontWriteShape() )
- break;
-
- // #i51348# get shape name
- String aShapeName;
- if( const SdrObject* pSdrObj = rObj.GetSdrObject() )
- if( pSdrObj->GetName().Len() > 0 )
- aShapeName = pSdrObj->GetName();
-
- Point aTextRefPoint;
-
- if( rObj.GetType().EqualsAscii( "drawing.Group" ))
- {
- Reference< XIndexAccess > xXIndexAccess( rObj.GetShapeRef(), UNO_QUERY );
-
- if( xXIndexAccess.is() && 0 != xXIndexAccess->getCount() )
- {
- nShapeID = mpEscherEx->EnterGroup( aShapeName, &rObj.GetRect() );
- nShapeType = ESCHER_ShpInst_Min;
-
- for( UINT32 n = 0, nCnt = xXIndexAccess->getCount();
- n < nCnt; ++n )
- {
- ImplEESdrObject aObj( *this, *(Reference< XShape >*)
- xXIndexAccess->getByIndex( n ).getValue() );
- if( aObj.IsValid() )
- ImplWriteShape( aObj, rSolverContainer, ePageType );
- }
- mpEscherEx->LeaveGroup();
- }
- break;
- }
- rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle") ));
-
- if( ( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("IsFontwork") ) &&
- ::cppu::any2bool( rObj.GetUsrAny() ) ) ||
- rObj.GetType().EqualsAscii( "drawing.Measure" ) || rObj.GetType().EqualsAscii( "drawing.Caption" ) )
- {
-/*
- if( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("BoundRect") ) )
- {
- ::com::sun::star::awt::Rectangle aRect( *(::com::sun::star::awt::Rectangle*)rObj.GetUsrAny().getValue() );
- rObj.SetRect( ImplMapPoint( Point( aRect.X, aRect.Y ) ),
- ImplMapSize( Size( aRect.Width, aRect.Height ) ) );
- }
-*/
- rObj.SetType( String( RTL_CONSTASCII_STRINGPARAM(
- "drawing.dontknow" ),
- RTL_TEXTENCODING_MS_1252 ));
- }
-
- const ::com::sun::star::awt::Size aSize100thmm( rObj.GetShapeRef()->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
- Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
- if ( !mpPicStrm )
- mpPicStrm = mpEscherEx->QueryPicStream();
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpEscherEx, mpPicStrm, aRect100thmm );
-
- // #i51348# shape name
- if( aShapeName.Len() > 0 )
- aPropOpt.AddOpt( ESCHER_Prop_wzName, aShapeName );
-
- if ( rObj.GetType().EqualsAscii( "drawing.Custom" ) )
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- sal_uInt32 nMirrorFlags;
-
- rtl::OUString sCustomShapeType;
- MSO_SPT eShapeType = aPropOpt.GetCustomShapeType( rObj.GetShapeRef(), nMirrorFlags, sCustomShapeType );
- if ( sCustomShapeType.equalsAscii( "col-502ad400" ) || sCustomShapeType.equalsAscii( "col-60da8460" ) )
- {
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
- {
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 ); // no fill
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 ); // no linestyle
- SdrObject* pObj = GetSdrObjectFromXShape( rObj.GetShapeRef() );
- if ( pObj )
- {
- Rectangle aBound = pObj->GetCurrentBoundRect();
- Point aPosition( ImplMapPoint( aBound.TopLeft() ) );
- Size aSize( ImplMapSize( aBound.GetSize() ) );
- rObj.SetRect( Rectangle( aPosition, aSize ) );
- rObj.SetAngle( 0 );
- bDontWriteText = sal_True;
- }
- }
- }
- else
- {
- ADD_SHAPE(
- sal::static_int_cast< UINT16 >(eShapeType),
- nMirrorFlags | 0xa00 );
- aPropOpt.CreateCustomShapeProperties( eShapeType, rObj.GetShapeRef() );
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- if ( rObj.ImplGetText() )
- {
- if ( !aPropOpt.IsFontWork() )
- aPropOpt.CreateTextProperties( rObj.mXPropSet, mpEscherEx->QueryTextID(
- rObj.GetShapeRef(), rObj.GetShapeId() ), sal_True, sal_False );
- }
- }
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Rectangle" ))
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- sal_Int32 nRadius = (sal_Int32)rObj.ImplGetInt32PropertyValue(
- ::rtl::OUString::createFromAscii("CornerRadius"));
- if( nRadius )
- {
- nRadius = ImplMapSize( Size( nRadius, 0 )).Width();
- ADD_SHAPE( ESCHER_ShpInst_RoundRectangle, 0xa00 ); // Flags: Connector | HasSpt
- INT32 nLenght = rObj.GetRect().GetWidth();
- if ( nLenght > rObj.GetRect().GetHeight() )
- nLenght = rObj.GetRect().GetHeight();
- nLenght >>= 1;
- if ( nRadius >= nLenght )
- nRadius = 0x2a30; // 0x2a30 ist PPTs maximum radius
- else
- nRadius = ( 0x2a30 * nRadius ) / nLenght;
- aPropOpt.AddOpt( ESCHER_Prop_adjustValue, nRadius );
- }
- else
- {
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0xa00 ); // Flags: Connector | HasSpt
- }
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- if( rObj.ImplGetText() )
- aPropOpt.CreateTextProperties( rObj.mXPropSet,
- mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ), sal_False, sal_False );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Ellipse" ))
- {
- CircleKind eCircleKind = CircleKind_FULL;
- PolyStyle ePolyKind = PolyStyle();
- if ( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleKind") ) )
- {
- eCircleKind = *( (CircleKind*)rObj.GetUsrAny().getValue() );
- switch ( eCircleKind )
- {
- case CircleKind_SECTION :
- {
- ePolyKind = POLY_PIE;
- }
- break;
- case CircleKind_ARC :
- {
- ePolyKind = POLY_ARC;
- }
- break;
-
- case CircleKind_CUT :
- {
- ePolyKind = POLY_CHORD;
- }
- break;
-
- default:
- eCircleKind = CircleKind_FULL;
- }
- }
- if ( eCircleKind == CircleKind_FULL )
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_Ellipse, 0xa00 ); // Flags: Connector | HasSpt
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );;
- }
- else
- {
- INT32 nStartAngle, nEndAngle;
- if ( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleStartAngle") ) )
- break;
- nStartAngle = *( (INT32*)rObj.GetUsrAny().getValue() );
- if( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleEndAngle") ) )
- break;
- nEndAngle = *( (INT32*)rObj.GetUsrAny().getValue() );
-
- Point aStart, aEnd, aCenter;
- aStart.X() = (INT32)( ( cos( (double)( nStartAngle *
- F_PI18000 ) ) * 100.0 ) );
- aStart.Y() = - (INT32)( ( sin( (double)( nStartAngle *
- F_PI18000 ) ) * 100.0 ) );
- aEnd.X() = (INT32)( ( cos( (double)( nEndAngle *
- F_PI18000 ) ) * 100.0 ) );
- aEnd.Y() = - (INT32)( ( sin( (double)( nEndAngle *
- F_PI18000 ) ) * 100.0 ) );
- const Rectangle& rRect = aRect100thmm;
- aCenter.X() = rRect.Left() + ( rRect.GetWidth() / 2 );
- aCenter.Y() = rRect.Top() + ( rRect.GetHeight() / 2 );
- aStart.X() += aCenter.X();
- aStart.Y() += aCenter.Y();
- aEnd.X() += aCenter.X();
- aEnd.Y() += aCenter.Y();
- Polygon aPolygon( rRect, aStart, aEnd, ePolyKind );
- if( rObj.GetAngle() )
- {
- aPolygon.Rotate( rRect.TopLeft(), (sal_uInt16)( rObj.GetAngle() / 10 ) );
- rObj.SetAngle( 0 );
- }
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
- ::com::sun::star::awt::Rectangle aNewRect;
- switch ( ePolyKind )
- {
- case POLY_PIE :
- case POLY_CHORD :
- {
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon );
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- }
- break;
-
- case POLY_ARC :
- {
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, &aPolygon );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- }
- break;
- }
- rObj.SetRect( Rectangle( ImplMapPoint( Point( aNewRect.X, aNewRect.Y ) ),
- ImplMapSize( Size( aNewRect.Width, aNewRect.Height ) ) ) );
- }
- if ( rObj.ImplGetText() )
- aPropOpt.CreateTextProperties( rObj.mXPropSet,
- mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ), sal_False, sal_False );
-
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Control" ))
- {
- break;
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Connector" ))
- {
- sal_uInt16 nSpType, nSpFlags;
- ::com::sun::star::awt::Rectangle aNewRect;
- if ( aPropOpt.CreateConnectorProperties( rObj.GetShapeRef(),
- rSolverContainer, aNewRect, nSpType, nSpFlags ) == sal_False )
- break;
- rObj.SetRect( Rectangle( ImplMapPoint( Point( aNewRect.X, aNewRect.Y ) ),
- ImplMapSize( Size( aNewRect.Width, aNewRect.Height ) ) ) );
-
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( nSpType, nSpFlags );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Measure" ))
- {
-/*
- if ( ImplGetPropertyValue( L"MeasureKind" ) )
- {
- mpEscherEx->EnterGroup( &maRect );
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ImplWriteAny( ANY_FLAGS_LINE, FALSE );
- UINT32 nFlags = 0xa00; // Flags: Connector | HasSpt
- if ( maRect.Top() > maRect.Bottom() )
- nFlags |= 0x80; // Flags: VertMirror
- if ( maRect.Left() > maRect.Right() )
- nFlags |= 0x40; // Flags: HorzMirror
-
- ADD_SHAPE( ESCHER_ShpInst_Line, nFlags );
- aPropOpt.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- mpEscherEx->EndCount( ESCHER_OPT, 3 );
- maRect.Justify();
- mpEscherEx->AddClientAnchor( maRect );
- mpEscherEx->CloseContainer(); // ESCHER_SpContainer
-
- if ( ImplGetPropertyValue( L"MeasureTextHorizontalPosition" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextVerticalPosition" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureLineDistance" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureHelpLineOverhang" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureHelpLineDistance" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureHelpLine1Length" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureHelpLine2Length" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureBelowReferenceEdge" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextRotate90" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextUpsideDown" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureOverhang" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureUnit" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureScale" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureShowUnit" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureFormatString" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextAutoAngle" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextAutoAngleView" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextIsFixedAngle" ) )
- {
- }
- if ( ImplGetPropertyValue( L"MeasureTextFixedAngle" ) )
- {
- }
- mpEscherEx->LeaveGroup();
- }
-*/
- break;
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Line" ))
- {
- ::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_LINE, sal_False, aNewRect, NULL );
- MapRect(rObj);
- //i27942: Poly/Lines/Bezier do not support text.
-
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- UINT32 nFlags = 0xa00; // Flags: Connector | HasSpt
- if( aNewRect.Height < 0 )
- nFlags |= 0x80; // Flags: VertMirror
- if( aNewRect.Width < 0 )
- nFlags |= 0x40; // Flags: HorzMirror
-
- ADD_SHAPE( ESCHER_ShpInst_Line, nFlags );
- aPropOpt.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- rObj.SetAngle( 0 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.PolyPolygon" ))
- {
- if( rObj.ImplHasText() )
- {
- nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRect() );
- bAdditionalText = TRUE;
- }
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
- ::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, NULL );
- MapRect(rObj);
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- rObj.SetAngle( 0 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.PolyLine" ))
- {
- //i27942: Poly/Lines/Bezier do not support text.
-
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
- ::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, NULL );
- MapRect(rObj);
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- rObj.SetAngle( 0 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.OpenBezier" ) )
- {
- //i27942: Poly/Lines/Bezier do not support text.
-
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
- ::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_True, aNewRect, NULL );
- MapRect(rObj);
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- rObj.SetAngle( 0 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.ClosedBezier" ) )
- {
- if ( rObj.ImplHasText() )
- {
- nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRect() );
- bAdditionalText = TRUE;
- }
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
- ::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_True, aNewRect, NULL );
- MapRect(rObj);
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- rObj.SetAngle( 0 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.GraphicObject" ))
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
-
- // ein GraphicObject kann auch ein ClickMe Element sein
- if( rObj.IsEmptyPresObj() && ( ePageType == NORMAL ) )
- {
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0x220 ); // Flags: HaveAnchor | HaveMaster
- UINT32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() );
- aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x10001 );
- aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
- }
- else
- {
- if( rObj.ImplGetText() )
- {
- /* SJ #i34951#: because M. documents are not allowing GraphicObjects containing text, we
- have to create a simpe Rectangle with fill bitmap instead (while not allowing BitmapMode_Repeat).
- */
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0xa00 ); // Flags: Connector | HasSpt
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_True, sal_True, sal_False ) )
- {
- aPropOpt.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapNone );
- aPropOpt.AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
- aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x8000000 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
- if ( rObj.ImplGetText() )
- aPropOpt.CreateTextProperties( rObj.mXPropSet,
- mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ), sal_False, sal_False );
- }
- }
- else
- {
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_False, sal_True ) )
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
- }
- }
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Text" ))
- {
- SHAPE_TEXT( TRUE );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Page" ))
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0xa00 );
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x40004 );
- aPropOpt.AddOpt( ESCHER_Prop_fFillOK, 0x100001 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110011 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90008 );
- aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x10001 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.Frame" ))
- {
- break;
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.OLE2" ))
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- if( rObj.IsEmptyPresObj() && ( ePageType == NORMAL ) )
- {
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0x220 ); // Flags: HaveAnchor | HaveMaster
- UINT32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() );
- aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x10001 );
- aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
- }
- else
- {
- //2do: could be made an option in HostAppData whether OLE object should be written or not
- BOOL bAppOLE = TRUE;
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame,
- 0xa00 | (bAppOLE ? SHAPEFLAG_OLESHAPE : 0) );
- if ( aPropOpt.CreateOLEGraphicProperties( rObj.GetShapeRef() ) )
- {
- if ( bAppOLE )
- { // snooped from Xcl hex dump, nobody knows the trouble I have seen
- aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 );
- aPropOpt.AddOpt( ESCHER_Prop_pictureId, 0x00000001 );
- aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000041 );
- aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000041 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 );
- aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x08000040 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash,0x00080008 );
-// aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured,0x00020000 );
- aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x00080000 );
- }
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
- }
- }
- }
- else if( '3' == rObj.GetType().GetChar(8 ) &&
- 'D' == rObj.GetType().GetChar( 9 ) ) // drawing.3D
- {
- // SceneObject, CubeObject, SphereObject, LatheObject, ExtrudeObject, PolygonObject
- if ( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("Bitmap") ) )
- break;
-
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
-
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ), sal_False ) )
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
- }
- else if ( rObj.GetType().EqualsAscii( "drawing.dontknow" ))
- {
- rObj.SetAngle( 0 );
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
- aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
- }
- else
- {
- break;
- }
- aPropOpt.CreateShadowProperties( rObj.mXPropSet );
-
- if( USHRT_MAX != mpEscherEx->GetHellLayerId() &&
- rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("LayerID") ) &&
- (*((UINT16*)rObj.GetUsrAny().getValue()) ) == mpEscherEx->GetHellLayerId() )
- {
- aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 );
- }
-
- {
- Rectangle aRect( rObj.GetRect() );
- aRect.Justify();
- rObj.SetRect( aRect );
- }
-
- if( rObj.GetAngle() )
- ImplFlipBoundingBox( rObj, aPropOpt );
-
- mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
- if( mpEscherEx->GetGroupLevel() > 1 )
- mpEscherEx->AddChildAnchor( rObj.GetRect() );
-
- if ( mpHostAppData )
- { //! with AdditionalText the App has to control whether these are written or not
- mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() );
- mpHostAppData->WriteClientData( *mpEscherEx );
- if ( !bDontWriteText )
- mpHostAppData->WriteClientTextbox( *mpEscherEx );
- }
- mpEscherEx->CloseContainer(); // ESCHER_SpContainer
-
- if( bAdditionalText )
- {
- mpEscherEx->EndShape( nShapeType, nShapeID );
- ImplWriteAdditionalText( rObj, aTextRefPoint );
- }
-
- } while ( 0 );
-
- if ( bAdditionalText )
- mpEscherEx->EndShape( ESCHER_ShpInst_Min, nGrpShapeID );
- else
- mpEscherEx->EndShape( nShapeType, nShapeID );
- return nShapeID;
-}
-
-void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
- const Point& rTextRefPoint )
-{
- UINT32 nShapeID = 0;
- UINT16 nShapeType = 0;
- do
- {
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef() );
- if ( mpHostAppData && mpHostAppData->DontWriteShape() )
- break;
-
- const ::com::sun::star::awt::Size aSize100thmm( rObj.GetShapeRef()->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
- Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
- if ( !mpPicStrm )
- mpPicStrm = mpEscherEx->QueryPicStream();
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpEscherEx, mpPicStrm, aRect100thmm );
- rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
- INT32 nAngle = rObj.GetAngle();
- if( rObj.GetType().EqualsAscii( "drawing.Line" ))
- {
-//2do: this does not work right
- double fDist = hypot( rObj.GetRect().GetWidth(),
- rObj.GetRect().GetHeight() );
- rObj.SetRect( Rectangle( rTextRefPoint,
- Point( (sal_Int32)( rTextRefPoint.X() + fDist ), rTextRefPoint.Y() - 1 ) ) );
-
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- mpEscherEx->AddShape( ESCHER_ShpInst_TextBox, 0xa00 );
- if ( rObj.ImplGetText() )
- aPropOpt.CreateTextProperties( rObj.mXPropSet,
- mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ) );
-
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
- aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x60006 ); // Size Shape To Fit Text
- if ( nAngle < 0 )
- nAngle = ( 36000 + nAngle ) % 36000;
- if ( nAngle )
- ImplFlipBoundingBox( rObj, aPropOpt );
- }
- else
- {
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
- nShapeID = mpEscherEx->GetShapeID();
- mpEscherEx->AddShape( nShapeType = ESCHER_ShpInst_TextBox, 0xa00, nShapeID );
- if ( rObj.ImplGetText() )
- aPropOpt.CreateTextProperties( rObj.mXPropSet,
- mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ) );
- aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
- aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
-
- if( nAngle < 0 )
- nAngle = ( 36000 + nAngle ) % 36000;
- else
- nAngle = ( 36000 - ( nAngle % 36000 ) );
-
- nAngle *= 655;
- nAngle += 0x8000;
- nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
- aPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
- mpEscherEx->SetGroupSnapRect( mpEscherEx->GetGroupLevel(),
- rObj.GetRect() );
- mpEscherEx->SetGroupLogicRect( mpEscherEx->GetGroupLevel(),
- rObj.GetRect() );
- }
- rObj.SetAngle( nAngle );
- mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
-
- // write the childanchor
- mpEscherEx->AddChildAnchor( rObj.GetRect() );
-
-#if defined EES_WRITE_EPP
- // ClientAnchor
- mpEscherEx->AddClientAnchor( maRect );
- // ClientTextbox
- mpEscherEx->OpenContainer( ESCHER_ClientTextbox );
- mpEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
- *mpStrm << (UINT32)EPP_TEXTTYPE_Other; // Text in a Shape
- ImplWriteTextStyleAtom();
- mpEscherEx->CloseContainer(); // ESCHER_ClientTextBox
-#else // !EES_WRITE_EPP
- if ( mpHostAppData )
- { //! the App has to control whether these are written or not
- mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() );
- mpHostAppData->WriteClientData( *mpEscherEx );
- mpHostAppData->WriteClientTextbox( *mpEscherEx );
- }
-#endif // EES_WRITE_EPP
- mpEscherEx->CloseContainer(); // ESCHER_SpContainer
- } while ( 0 );
- mpEscherEx->LeaveGroup();
- mpEscherEx->EndShape( nShapeType, nShapeID );
-}
-
-
-// -------------------------------------------------------------------
-
-UINT32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >& rShape,
- const Rectangle* pBoundRect )
-{
- mpHostAppData = mpEscherEx->EnterAdditionalTextGroup();
- UINT32 nGrpId = mpEscherEx->EnterGroup( pBoundRect );
- mpHostAppData = mpEscherEx->StartShape( rShape );
- return nGrpId;
-}
-
-
-// -------------------------------------------------------------------
-
-BOOL ImplEESdrWriter::ImplInitPageValues()
-{
- mnIndices = 0;
- mnOutlinerCount = 0; // die gliederungsobjekte muessen dem layout entsprechen,
- mnEffectCount = 0;
- mbIsTitlePossible = TRUE; // bei mehr als einem title geht powerpoint in die knie
-
- return TRUE;
-}
-
-
-// -------------------------------------------------------------------
-
-void ImplEESdrWriter::ImplWritePage(
- EscherSolverContainer& rSolverContainer,
- ImplEESdrPageType ePageType, BOOL /* bBackGround */ )
-{
- ImplInitPageValues();
-
- UINT32 nLastPer = 0, nShapes = mXShapes->getCount();
- for( UINT32 n = 0; n < nShapes; ++n )
- {
- UINT32 nPer = ( 5 * n ) / nShapes;
- if( nPer != nLastPer )
- {
- nLastPer = nPer;
- UINT32 nValue = mnPagesWritten * 5 + nPer;
- if( nValue > mnStatMaxValue )
- nValue = mnStatMaxValue;
- if( mbStatusIndicator )
- mXStatusIndicator->setValue( nValue );
- }
-
- ImplEESdrObject aObj( *this, *(Reference< XShape >*)
- mXShapes->getByIndex( n ).getValue() );
- if( aObj.IsValid() )
- {
- ImplWriteShape( aObj, rSolverContainer, ePageType );
- }
- }
- mnPagesWritten++;
-}
-
-// ===================================================================
-
-ImplEscherExSdr::ImplEscherExSdr( EscherEx& rEx )
- :
- ImplEESdrWriter( rEx ),
- mpSdrPage( NULL ),
- mpSolverContainer( NULL )
-{
-}
-
-
-// -------------------------------------------------------------------
-
-ImplEscherExSdr::~ImplEscherExSdr()
-{
- DBG_ASSERT( !mpSolverContainer, "ImplEscherExSdr::~ImplEscherExSdr: unwritten SolverContainer" );
- delete mpSolverContainer;
-}
-
-
-// -------------------------------------------------------------------
-
-SvxDrawPage* ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
-{
- do
- {
- SvxDrawPage* pSvxDrawPage;
- if ( mpSdrPage != &rPage || !mXDrawPage.is() )
- {
- // eventually write SolverContainer of current page, deletes the Solver
- ImplFlushSolverContainer();
-
- mpSdrPage = NULL;
- // why not declare a const parameter if the object will not be modified?
-// mXDrawPage = pSvxDrawPage = new SvxDrawPage( (SdrPage*) &rPage );
- mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( (SdrPage*) &rPage );
- mXShapes = Reference< XShapes >::query( mXDrawPage );
- if ( !mXShapes.is() )
- break;
- if ( !ImplInitPageValues() ) // ImplEESdrWriter
- break;
- mpSdrPage = &rPage;
-
- mpSolverContainer = new EscherSolverContainer;
- }
- else
- pSvxDrawPage = SvxDrawPage::getImplementation(mXDrawPage);
-
- return pSvxDrawPage;
- } while ( 0 );
-
- return NULL;
-}
-
-
-// -------------------------------------------------------------------
-
-void ImplEscherExSdr::ImplExitPage()
-{
- // close all groups before the solver container is written
- while( mpEscherEx->GetGroupLevel() )
- mpEscherEx->LeaveGroup();
-
- ImplFlushSolverContainer();
- mpSdrPage = NULL; // reset page for next init
-}
-
-
-// -------------------------------------------------------------------
-
-void ImplEscherExSdr::ImplFlushSolverContainer()
-{
- if ( mpSolverContainer )
- {
- mpSolverContainer->WriteSolver( mpEscherEx->GetStream() );
- delete mpSolverContainer;
- mpSolverContainer = NULL;
- }
-}
-
-
-// -------------------------------------------------------------------
-
-void ImplEscherExSdr::ImplWriteCurrentPage()
-{
- DBG_ASSERT( mpSolverContainer, "ImplEscherExSdr::ImplWriteCurrentPage: no SolverContainer" );
- ImplWritePage( *mpSolverContainer, NORMAL );
- ImplExitPage();
-}
-
-
-// -------------------------------------------------------------------
-
-UINT32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj )
-{
- DBG_ASSERT( mpSolverContainer, "ImplEscherExSdr::ImplWriteShape: no SolverContainer" );
- return ImplWriteShape( rObj, *mpSolverContainer, NORMAL );
-}
-
-
-// ===================================================================
-
-void EscherEx::AddSdrPage( const SdrPage& rPage )
-{
- if ( mpImplEscherExSdr->ImplInitPage( rPage ) )
- mpImplEscherExSdr->ImplWriteCurrentPage();
-}
-
-
-// -------------------------------------------------------------------
-
-UINT32 EscherEx::AddSdrObject( const SdrObject& rObj )
-{
- ImplEESdrObject aObj( *mpImplEscherExSdr, rObj );
- if( aObj.IsValid() )
- return mpImplEscherExSdr->ImplWriteTheShape( aObj );
- return 0;
-}
-
-
-// -------------------------------------------------------------------
-
-void EscherEx::EndSdrObjectPage()
-{
- mpImplEscherExSdr->ImplExitPage();
-}
-
-// -------------------------------------------------------------------
-
-EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */ )
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------
-
-void EscherEx::EndShape( UINT16 /* nShapeType */, UINT32 /* nShapeID */ )
-{
-}
-
-// -------------------------------------------------------------------
-
-SvStream* EscherEx::QueryPicStream()
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------
-
-UINT32 EscherEx::QueryTextID( const Reference< XShape >&, UINT32 )
-{
- return 0;
-}
-
-// -------------------------------------------------------------------
-// add an dummy rectangle shape into the escher stream
-UINT32 EscherEx::AddDummyShape()
-{
- OpenContainer( ESCHER_SpContainer );
- UINT32 nShapeID = GetShapeID();
- AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nShapeID );
-//?? aSolverContainer.AddShape( mXShape, nShapeID );
- CloseContainer();
-
- return nShapeID;
-}
-
-// -------------------------------------------------------------------
-
-// static
-const SdrObject* EscherEx::GetSdrObject( const Reference< XShape >& rShape )
-{
- const SdrObject* pRet = 0;
- const SvxShape* pSvxShape = SvxShape::getImplementation( rShape );
- DBG_ASSERT( pSvxShape, "EscherEx::GetSdrObject: no SvxShape" );
- if( pSvxShape )
- {
- pRet = pSvxShape->GetSdrObject();
- DBG_ASSERT( pRet, "EscherEx::GetSdrObject: no SdrObj" );
- }
- return pRet;
-}
-
-
-// -------------------------------------------------------------------
-
-ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
- const SdrObject& rObj ) :
- mnShapeId( 0 ),
- mnTextSize( 0 ),
- mnAngle( 0 ),
- mbValid( FALSE ),
- mbPresObj( FALSE ),
- mbEmptyPresObj( FALSE )
-{
- SdrPage* pPage = rObj.GetPage();
- DBG_ASSERT( pPage, "ImplEESdrObject::ImplEESdrObject: no SdrPage" );
- if( pPage )
- {
- SvxDrawPage* pSvxDrawPage = rEx.ImplInitPage( *pPage );
- if( pSvxDrawPage )
- {
- // why not declare a const parameter if the object will
- // not be modified?
- mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );;
- Init( rEx );
- }
- }
-}
-
-ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx,
- const Reference< XShape >& rShape ) :
- mXShape( rShape ),
- mnShapeId( 0 ),
- mnTextSize( 0 ),
- mnAngle( 0 ),
- mbValid( FALSE ),
- mbPresObj( FALSE ),
- mbEmptyPresObj( FALSE )
-{
- Init( rEx );
-}
-
-
-ImplEESdrObject::~ImplEESdrObject()
-{
-}
-
-void ImplEESdrObject::Init( ImplEESdrWriter& rEx )
-{
- mXPropSet = Reference< XPropertySet >::query( mXShape );
- if( mXPropSet.is() )
- {
- static const sal_Char aPrefix[] = "com.sun.star.";
- static const xub_StrLen nPrefix = sizeof(aPrefix)-1;
- SetRect( rEx.ImplMapPoint( Point( mXShape->getPosition().X, mXShape->getPosition().Y ) ),
- rEx.ImplMapSize( Size( mXShape->getSize().Width, mXShape->getSize().Height ) ) );
- mType = String( mXShape->getShapeType() );
- mType.Erase( 0, nPrefix ); // strip "com.sun.star."
- xub_StrLen nPos = mType.SearchAscii( "Shape" );
- mType.Erase( nPos, 5 );
-
- static const OUString sPresStr(rtl::OUString::createFromAscii("IsPresentationObject"));
- static const OUString sEmptyPresStr(rtl::OUString::createFromAscii("IsEmptyPresentationObject"));
-
- if( ImplGetPropertyValue( sPresStr ) )
- mbPresObj = ::cppu::any2bool( mAny );
-
- if( mbPresObj && ImplGetPropertyValue( sEmptyPresStr ) )
- mbEmptyPresObj = ::cppu::any2bool( mAny );
-
- mbValid = TRUE;
- }
-}
-
-//BOOL ImplEESdrObject::ImplGetPropertyValue( const OUString& rString )
-BOOL ImplEESdrObject::ImplGetPropertyValue( const sal_Unicode* rString )
-{
- BOOL bRetValue = FALSE;
- if( mbValid )
- {
- try
- {
- mAny = mXPropSet->getPropertyValue( rString );
- if( mAny.hasValue() )
- bRetValue = TRUE;
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- bRetValue = FALSE;
- }
- }
- return bRetValue;
-}
-
-#ifdef USED
-BOOL ImplEESdrObject::ImplGetPropertyValue( const Reference< XPropertySet >& rXPropSet,
- const OUString& rString )
-{
- BOOL bRetValue = FALSE;
- if( mbValid )
- {
- try
- {
- mAny = rXPropSet->getPropertyValue( rString );
- if( 0 != mAny.get() )
- bRetValue = TRUE;
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- bRetValue = FALSE;
- }
- }
- return bRetValue;
-}
-#endif
-
-void ImplEESdrObject::SetRect( const Point& rPos, const Size& rSz )
-{
- maRect = Rectangle( rPos, rSz );
-}
-
-const SdrObject* ImplEESdrObject::GetSdrObject() const
-{
- return EscherEx::GetSdrObject( mXShape );
-}
-
-// laedt und konvertiert text aus shape, ergebnis ist mnTextSize gespeichert
-UINT32 ImplEESdrObject::ImplGetText()
-{
- Reference< XText > xXText( mXShape, UNO_QUERY );
- mnTextSize = 0;
- if( xXText.is() )
- mnTextSize = xXText->getString().getLength();
- return mnTextSize;
-}
-
-BOOL ImplEESdrObject::ImplHasText() const
-{
- Reference< XText > xXText( mXShape, UNO_QUERY );
- return xXText.is() && xXText->getString().getLength();
-}
-
diff --git a/svx/source/msfilter/eschesdo.hxx b/svx/source/msfilter/eschesdo.hxx
deleted file mode 100644
index 9e74e1be4d..0000000000
--- a/svx/source/msfilter/eschesdo.hxx
+++ /dev/null
@@ -1,208 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: eschesdo.hxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _ESCHESDO_HXX
-#define _ESCHESDO_HXX
-#include <svx/escherex.hxx>
-#include <svx/unopage.hxx>
-#include <vcl/mapmod.hxx>
-
-// ===================================================================
-// fractions of Draw PPTWriter etc.
-
-enum ImplEESdrPageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
-
-class ImplEESdrWriter;
-class ImplEscherExSdr;
-
-class ImplEESdrObject
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXShape;
-// XTextRef mXText; // TextRef des globalen Text
- ::com::sun::star::uno::Any mAny;
- Rectangle maRect;
- String mType;
- UINT32 mnShapeId;
- UINT32 mnTextSize;
- INT32 mnAngle;
- BOOL mbValid : 1;
- BOOL mbPresObj : 1;
- BOOL mbEmptyPresObj : 1;
-
- void Init( ImplEESdrWriter& rEx );
-public:
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXPropSet;
-
- ImplEESdrObject( ImplEscherExSdr& rEx, const SdrObject& rObj );
- ImplEESdrObject( ImplEESdrWriter& rEx, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape );
- ~ImplEESdrObject();
-
- BOOL ImplGetPropertyValue( const sal_Unicode* pString );
-
- INT32 ImplGetInt32PropertyValue( const sal_Unicode* pStr, UINT32 nDef = 0 )
- { return ImplGetPropertyValue( pStr ) ? *(INT32*)mAny.getValue() : nDef; }
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& GetShapeRef() const { return mXShape; }
- const ::com::sun::star::uno::Any& GetUsrAny() const { return mAny; }
- const String& GetType() const { return mType; }
- void SetType( const String& rS ) { mType = rS; }
-
- const Rectangle& GetRect() const { return maRect; }
- void SetRect( const Point& rPos, const Size& rSz );
- void SetRect( const Rectangle& rRect )
- { maRect = rRect; }
-
- INT32 GetAngle() const { return mnAngle; }
- void SetAngle( INT32 nVal ) { mnAngle = nVal; }
-
- UINT32 GetTextSize() const { return mnTextSize; }
-
- BOOL IsValid() const { return mbValid; }
- BOOL IsPresObj() const { return mbPresObj; }
- BOOL IsEmptyPresObj() const { return mbEmptyPresObj; }
- UINT32 GetShapeId() const { return mnShapeId; }
- void SetShapeId( UINT32 nVal ) { mnShapeId = nVal; }
-
- const SdrObject* GetSdrObject() const;
-
- UINT32 ImplGetText();
- BOOL ImplHasText() const;
-};
-
-
-
-// -------------------------------------------------------------------
-// fractions of the Draw PPTWriter
-
-class EscherEx;
-namespace com { namespace sun { namespace star {
- namespace drawing {
- class XDrawPage;
- class XShape;
- }
- namespace task {
- class XStatusIndicator;
- }
-}}}
-class EscherExHostAppData;
-class Polygon;
-
-class ImplEESdrWriter
-{
-protected:
- EscherEx* mpEscherEx;
- MapMode maMapModeSrc;
- MapMode maMapModeDest;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mXDrawPage;
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mXShapes;
-
- SvStream* mpPicStrm;
-
- // own extensions
-
- EscherExHostAppData* mpHostAppData;
-
- UINT32 mnPagesWritten;
-
- UINT32 mnShapeMasterTitle;
- UINT32 mnShapeMasterBody;
-
- // per page values
- UINT32 mnIndices;
- UINT32 mnOutlinerCount;
- UINT32 mnPrevTextStyle;
- UINT32 mnStatMaxValue;
-
- UINT16 mnEffectCount;
-
- BOOL mbIsTitlePossible;
- BOOL mbStatusIndicator;
- BOOL mbStatus;
-
-
- ImplEESdrWriter( EscherEx& rEx );
-
- BOOL ImplInitPageValues();
-
- void ImplWritePage(
- EscherSolverContainer& rSolver,
- ImplEESdrPageType ePageType,
- BOOL bBackGround = FALSE );
-
- UINT32 ImplWriteShape( ImplEESdrObject& rObj,
- EscherSolverContainer& rSolver,
- ImplEESdrPageType ePageType ); // returns ShapeID
-
- void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
- BOOL ImplGetText( ImplEESdrObject& rObj );
- void ImplWriteAdditionalText(
- ImplEESdrObject& rObj,
- const Point& rTextRefPoint );
- UINT32 ImplEnterAdditionalTextGroup(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
- const Rectangle* pBoundRect = NULL );
-
-
-public:
- Point ImplMapPoint( const Point& rPoint );
- Size ImplMapSize( const Size& rSize );
- EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
- void MapRect(ImplEESdrObject& rObj);
-};
-
-
-// ===================================================================
-
-class SdrObject;
-class SdrPage;
-
-class ImplEscherExSdr : public ImplEESdrWriter
-{
-private:
- const SdrPage* mpSdrPage;
- EscherSolverContainer* mpSolverContainer;
-
-public:
- ImplEscherExSdr( EscherEx& rEx );
- virtual ~ImplEscherExSdr();
-
- SvxDrawPage* ImplInitPage( const SdrPage& rPage );
- void ImplWriteCurrentPage();
-
- UINT32 ImplWriteTheShape( ImplEESdrObject& rObj );
-
- void ImplExitPage();
- void ImplFlushSolverContainer();
-};
-
-
-
-#endif // _ESCHESDO_HXX
diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk
deleted file mode 100644
index 53eab95a5b..0000000000
--- a/svx/source/msfilter/makefile.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.17 $
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svx
-TARGET=msfilter
-LIBTARGET=NO
-AUTOSEG=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-LIB1TARGET= $(SLB)$/$(TARGET)-msfilter.lib
-LIB1OBJFILES= \
- $(SLO)$/countryid.obj \
- $(SLO)$/escherex.obj \
- $(SLO)$/eschesdo.obj \
- $(SLO)$/msdffimp.obj \
- $(SLO)$/msoleexp.obj \
- $(SLO)$/msvbasic.obj \
- $(SLO)$/svxmsbas.obj \
- $(SLO)$/msocximex.obj \
- $(SLO)$/mscodec.obj \
- $(SLO)$/msfiltertracer.obj \
- $(SLO)$/msvbahelper.obj\
-
-LIB2TARGET= $(SLB)$/$(TARGET)-core.lib
-LIB2OBJFILES= \
- $(SLO)$/svxmsbas2.obj
-
-SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
-
-EXCEPTIONSFILES= \
- $(SLO)$/eschesdo.obj \
- $(SLO)$/escherex.obj \
- $(SLO)$/msdffimp.obj \
- $(SLO)$/msvbasic.obj \
- $(SLO)$/msocximex.obj \
- $(SLO)$/msoleexp.obj \
- $(SLO)$/svxmsbas.obj \
- $(SLO)$/msfiltertracer.obj \
- $(SLO)$/msvbahelper.obj\
-
-.INCLUDE : target.mk
-
diff --git a/svx/source/msfilter/mscodec.cxx b/svx/source/msfilter/mscodec.cxx
deleted file mode 100644
index 54da76c546..0000000000
--- a/svx/source/msfilter/mscodec.cxx
+++ /dev/null
@@ -1,537 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: mscodec.cxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include "mscodec.hxx"
-
-#include <osl/diagnose.h>
-#include <algorithm>
-#include <string.h>
-#include <tools/solar.h>
-
-#define DEBUG_MSO_ENCRYPTION_STD97 0
-
-#if DEBUG_MSO_ENCRYPTION_STD97
-#include <stdio.h>
-#endif
-
-
-namespace svx {
-
-// ============================================================================
-
-namespace {
-
-/** Rotates rnValue left by nBits bits. */
-template< typename Type >
-inline void lclRotateLeft( Type& rnValue, int nBits )
-{
- OSL_ASSERT(
- nBits >= 0 &&
- sal::static_int_cast< unsigned int >(nBits) < sizeof( Type ) * 8 );
- rnValue = static_cast< Type >( (rnValue << nBits) | (rnValue >> (sizeof( Type ) * 8 - nBits)) );
-}
-
-/** Rotates the lower nWidth bits of rnValue left by nBits bits. */
-template< typename Type >
-inline void lclRotateLeft( Type& rnValue, sal_uInt8 nBits, sal_uInt8 nWidth )
-{
- OSL_ASSERT( (nBits < nWidth) && (nWidth < sizeof( Type ) * 8) );
- Type nMask = static_cast< Type >( (1UL << nWidth) - 1 );
- rnValue = static_cast< Type >(
- ((rnValue << nBits) | ((rnValue & nMask) >> (nWidth - nBits))) & nMask );
-}
-
-sal_Size lclGetLen( const sal_uInt8* pnPassData, sal_Size nBufferSize )
-{
- sal_Size nLen = 0;
- while( (nLen < nBufferSize) && pnPassData[ nLen ] ) ++nLen;
- return nLen;
-}
-
-sal_uInt16 lclGetKey( const sal_uInt8* pnPassData, sal_Size nBufferSize )
-{
- sal_Size nLen = lclGetLen( pnPassData, nBufferSize );
- if( !nLen ) return 0;
-
- sal_uInt16 nKey = 0;
- sal_uInt16 nKeyBase = 0x8000;
- sal_uInt16 nKeyEnd = 0xFFFF;
- const sal_uInt8* pnChar = pnPassData + nLen - 1;
- for( sal_Size nIndex = 0; nIndex < nLen; ++nIndex, --pnChar )
- {
- sal_uInt8 cChar = *pnChar & 0x7F;
- for( sal_uInt8 nBit = 0; nBit < 8; ++nBit )
- {
- lclRotateLeft( nKeyBase, 1 );
- if( nKeyBase & 1 ) nKeyBase ^= 0x1020;
- if( cChar & 1 ) nKey ^= nKeyBase;
- cChar >>= 1;
- lclRotateLeft( nKeyEnd, 1 );
- if( nKeyEnd & 1 ) nKeyEnd ^= 0x1020;
- }
- }
- return nKey ^ nKeyEnd;
-}
-
-sal_uInt16 lclGetHash( const sal_uInt8* pnPassData, sal_Size nBufferSize )
-{
- sal_Size nLen = lclGetLen( pnPassData, nBufferSize );
-
- sal_uInt16 nHash = static_cast< sal_uInt16 >( nLen );
- if( nLen )
- nHash ^= 0xCE4B;
-
- const sal_uInt8* pnChar = pnPassData;
- for( sal_Size nIndex = 0; nIndex < nLen; ++nIndex, ++pnChar )
- {
- sal_uInt16 cChar = *pnChar;
- sal_uInt8 nRot = static_cast< sal_uInt8 >( (nIndex + 1) % 15 );
- lclRotateLeft( cChar, nRot, 15 );
- nHash ^= cChar;
- }
- return nHash;
-}
-
-
-} // namespace
-
-// ============================================================================
-
-MSCodec_Xor95::MSCodec_Xor95(int nRotateDistance) :
- mnOffset( 0 ),
- mnKey( 0 ),
- mnHash( 0 ),
- mnRotateDistance( nRotateDistance )
-{
- (void)memset( mpnKey, 0, sizeof( mpnKey ) );
-}
-
-MSCodec_Xor95::~MSCodec_Xor95()
-{
- (void)memset( mpnKey, 0, sizeof( mpnKey ) );
- mnKey = mnHash = 0;
-}
-
-void MSCodec_Xor95::InitKey( const sal_uInt8 pnPassData[ 16 ] )
-{
- mnKey = lclGetKey( pnPassData, 16 );
- mnHash = lclGetHash( pnPassData, 16 );
-
- (void)memcpy( mpnKey, pnPassData, 16 );
-
- static const sal_uInt8 spnFillChars[] =
- {
- 0xBB, 0xFF, 0xFF, 0xBA,
- 0xFF, 0xFF, 0xB9, 0x80,
- 0x00, 0xBE, 0x0F, 0x00,
- 0xBF, 0x0F, 0x00
- };
-
- sal_Size nIndex;
- sal_Size nLen = lclGetLen( pnPassData, 16 );
- const sal_uInt8* pnFillChar = spnFillChars;
- for( nIndex = nLen; nIndex < sizeof( mpnKey ); ++nIndex, ++pnFillChar )
- mpnKey[ nIndex ] = *pnFillChar;
-
- SVBT16 pnOrigKey;
- ShortToSVBT16( mnKey, pnOrigKey );
- sal_uInt8* pnKeyChar = mpnKey;
- for( nIndex = 0; nIndex < sizeof( mpnKey ); ++nIndex, ++pnKeyChar )
- {
- *pnKeyChar ^= pnOrigKey[ nIndex & 0x01 ];
- lclRotateLeft( *pnKeyChar, mnRotateDistance );
- }
-}
-
-bool MSCodec_Xor95::VerifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const
-{
- return (nKey == mnKey) && (nHash == mnHash);
-}
-
-void MSCodec_Xor95::InitCipher()
-{
- mnOffset = 0;
-}
-
-void MSCodec_XorXLS95::Decode( sal_uInt8* pnData, sal_Size nBytes )
-{
- const sal_uInt8* pnCurrKey = mpnKey + mnOffset;
- const sal_uInt8* pnKeyLast = mpnKey + 0x0F;
-
- for( const sal_uInt8* pnDataEnd = pnData + nBytes; pnData < pnDataEnd; ++pnData )
- {
- lclRotateLeft( *pnData, 3 );
- *pnData ^= *pnCurrKey;
- if( pnCurrKey < pnKeyLast ) ++pnCurrKey; else pnCurrKey = mpnKey;
- }
-
- // update mnOffset
- Skip( nBytes );
-}
-
-void MSCodec_XorWord95::Decode( sal_uInt8* pnData, sal_Size nBytes )
-{
- const sal_uInt8* pnCurrKey = mpnKey + mnOffset;
- const sal_uInt8* pnKeyLast = mpnKey + 0x0F;
-
- for( const sal_uInt8* pnDataEnd = pnData + nBytes; pnData < pnDataEnd; ++pnData )
- {
- const sal_uInt8 cChar = *pnData ^ *pnCurrKey;
- if (*pnData && cChar)
- *pnData = cChar;
- if( pnCurrKey < pnKeyLast ) ++pnCurrKey; else pnCurrKey = mpnKey;
- }
-
- // update mnOffset
- Skip( nBytes );
-}
-
-
-void MSCodec_Xor95::Skip( sal_Size nBytes )
-{
- mnOffset = (mnOffset + nBytes) & 0x0F;
-}
-
-sal_uInt16 MSCodec_Xor95::GetHash( const sal_uInt8* pnPassData, sal_Size nSize )
-{
- return lclGetHash( pnPassData, nSize );
-}
-
-// ============================================================================
-
-MSCodec_Std97::MSCodec_Std97 ()
-{
- m_hCipher = rtl_cipher_create (
- rtl_Cipher_AlgorithmARCFOUR, rtl_Cipher_ModeStream);
- OSL_ASSERT(m_hCipher != 0);
-
- m_hDigest = rtl_digest_create (
- rtl_Digest_AlgorithmMD5);
- OSL_ASSERT(m_hDigest != 0);
-
- (void)memset (m_pDigestValue, 0, sizeof(m_pDigestValue));
-}
-
-MSCodec_Std97::~MSCodec_Std97 ()
-{
- (void)memset (m_pDigestValue, 0, sizeof(m_pDigestValue));
- rtl_digest_destroy (m_hDigest);
- rtl_cipher_destroy (m_hCipher);
-}
-
-#if DEBUG_MSO_ENCRYPTION_STD97
-static void lcl_PrintKeyData(const sal_uInt8* pKeyData, const char* msg)
-{
- printf("pKeyData: (%s)\n", msg);
- for (int j = 0; j < 4; ++j)
- {
- for (int i = 0; i < 16; ++i)
- printf("%2.2x ", pKeyData[j*16+i]);
- printf("\n");
- }
-}
-#else
-static void lcl_PrintKeyData(const sal_uInt8* /*pKeyData*/, const char* /*msg*/)
-{
-}
-#endif
-
-#if DEBUG_MSO_ENCRYPTION_STD97
-static void lcl_PrintDigest(const sal_uInt8* pDigest, const char* msg)
-{
- printf("digest: (%s)\n", msg);
- for (int i = 0; i < 16; ++i)
- printf("%2.2x ", pDigest[i]);
- printf("\n");
-}
-#else
-static void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/)
-{
-}
-#endif
-
-void MSCodec_Std97::InitKey (
- const sal_uInt16 pPassData[16],
- const sal_uInt8 pUnique[16])
-{
-#if DEBUG_MSO_ENCRYPTION_STD97
- fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout);
-#endif
- sal_uInt8 pKeyData[64];
- int i, n;
-
- // Fill PassData into KeyData.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
- lcl_PrintKeyData(pKeyData, "initial");
- for (i = 0, n = 16; (i < n) && pPassData[i]; i++)
- {
- pKeyData[2*i ] = sal::static_int_cast< sal_uInt8 >(
- (pPassData[i] >> 0) & 0xff);
- pKeyData[2*i + 1] = sal::static_int_cast< sal_uInt8 >(
- (pPassData[i] >> 8) & 0xff);
- }
- pKeyData[2*i] = 0x80;
- pKeyData[ 56] = sal::static_int_cast< sal_uInt8 >(i << 4);
-
- lcl_PrintKeyData(pKeyData, "password data");
-
- // Fill raw digest of KeyData into KeyData.
- (void)rtl_digest_updateMD5 (
- m_hDigest, pKeyData, sizeof(pKeyData));
- (void)rtl_digest_rawMD5 (
- m_hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
-
- lcl_PrintKeyData(pKeyData, "raw digest of key data");
-
- // Update digest with KeyData and Unique.
- for (i = 0; i < 16; i++)
- {
- rtl_digest_updateMD5 (m_hDigest, pKeyData, 5);
- rtl_digest_updateMD5 (m_hDigest, pUnique, 16);
- }
-
- // Update digest with padding.
- pKeyData[16] = 0x80;
- (void)memset (pKeyData + 17, 0, sizeof(pKeyData) - 17);
- pKeyData[56] = 0x80;
- pKeyData[57] = 0x0a;
-
- lcl_PrintKeyData(pKeyData, "update digest with padding");
-
- rtl_digest_updateMD5 (
- m_hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16);
-
- // Fill raw digest of above updates into DigestValue.
- rtl_digest_rawMD5 (
- m_hDigest, m_pDigestValue, sizeof(m_pDigestValue));
-
- lcl_PrintDigest(m_pDigestValue, "digest value");
-
- // Erase KeyData array and leave.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
-}
-
-bool MSCodec_Std97::VerifyKey (
- const sal_uInt8 pSaltData[16],
- const sal_uInt8 pSaltDigest[16])
-{
- // both the salt data and salt digest (hash) come from the document being imported.
-
-#if DEBUG_MSO_ENCRYPTION_STD97
- fprintf(stdout, "MSCodec_Std97::VerifyKey: \n");
- lcl_PrintDigest(pSaltData, "salt data");
- lcl_PrintDigest(pSaltDigest, "salt hash");
-#endif
- bool result = false;
-
- if (InitCipher(0))
- {
- sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5];
- GetDigestFromSalt(pSaltData, pDigest);
-
- sal_uInt8 pBuffer[16];
- // Decode original SaltDigest into Buffer.
- rtl_cipher_decode (
- m_hCipher, pSaltDigest, 16, pBuffer, sizeof(pBuffer));
-
- // Compare Buffer with computed Digest.
- result = (memcmp (pBuffer, pDigest, sizeof(pDigest)) == 0);
-
- // Erase Buffer and Digest arrays.
- (void)memset (pBuffer, 0, sizeof(pBuffer));
- (void)memset (pDigest, 0, sizeof(pDigest));
- }
-
- return (result);
-}
-
-bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter)
-{
- rtlCipherError result;
- sal_uInt8 pKeyData[64]; // 512-bit message block
-
- // Initialize KeyData array.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
-
- // Fill 40 bit of DigestValue into [0..4].
- (void)memcpy (pKeyData, m_pDigestValue, 5);
-
- // Fill counter into [5..8].
- pKeyData[ 5] = sal_uInt8((nCounter >> 0) & 0xff);
- pKeyData[ 6] = sal_uInt8((nCounter >> 8) & 0xff);
- pKeyData[ 7] = sal_uInt8((nCounter >> 16) & 0xff);
- pKeyData[ 8] = sal_uInt8((nCounter >> 24) & 0xff);
-
- pKeyData[ 9] = 0x80;
- pKeyData[56] = 0x48;
-
- // Fill raw digest of KeyData into KeyData.
- (void)rtl_digest_updateMD5 (
- m_hDigest, pKeyData, sizeof(pKeyData));
- (void)rtl_digest_rawMD5 (
- m_hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
-
- // Initialize Cipher with KeyData (for decoding).
- result = rtl_cipher_init (
- m_hCipher, rtl_Cipher_DirectionBoth,
- pKeyData, RTL_DIGEST_LENGTH_MD5, 0, 0);
-
- // Erase KeyData array and leave.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
-
- return (result == rtl_Cipher_E_None);
-}
-
-bool MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] )
-{
-#if DEBUG_MSO_ENCRYPTION_STD97
- lcl_PrintDigest(pSaltData, "salt data");
-#endif
- bool result = false;
-
- if (InitCipher(0))
- {
- sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5];
- GetDigestFromSalt(nSaltData, pDigest);
-
- rtl_cipher_decode (
- m_hCipher, pDigest, 16, pDigest, sizeof(pDigest));
-
- (void)memcpy(nSaltDigest, pDigest, 16);
- }
-
- return (result);
-}
-
-bool MSCodec_Std97::Encode (
- const void *pData, sal_Size nDatLen,
- sal_uInt8 *pBuffer, sal_Size nBufLen)
-{
- rtlCipherError result;
-
- result = rtl_cipher_encode (
- m_hCipher, pData, nDatLen, pBuffer, nBufLen);
-
- return (result == rtl_Cipher_E_None);
-}
-
-bool MSCodec_Std97::Decode (
- const void *pData, sal_Size nDatLen,
- sal_uInt8 *pBuffer, sal_Size nBufLen)
-{
- rtlCipherError result;
-
- result = rtl_cipher_decode (
- m_hCipher, pData, nDatLen, pBuffer, nBufLen);
-
- return (result == rtl_Cipher_E_None);
-}
-
-bool MSCodec_Std97::Skip( sal_Size nDatLen )
-{
- sal_uInt8 pnDummy[ 1024 ];
- sal_Size nDatLeft = nDatLen;
- bool bResult = true;
-
- while (bResult && nDatLeft)
- {
- sal_Size nBlockLen = ::std::min< sal_Size >( nDatLeft, sizeof(pnDummy) );
- bResult = Decode( pnDummy, nBlockLen, pnDummy, nBlockLen );
- nDatLeft -= nBlockLen;
- }
-
- return bResult;
-}
-
-void MSCodec_Std97::GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] )
-{
- sal_uInt8 pBuffer[64];
- sal_uInt8 pDigestLocal[16];
-
- // Decode SaltData into Buffer.
- rtl_cipher_decode (
- m_hCipher, pSaltData, 16, pBuffer, sizeof(pBuffer));
-
- // set the 129th bit to make the buffer 128-bit in length.
- pBuffer[16] = 0x80;
-
- // erase the rest of the buffer with zeros.
- (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17);
-
- // set the 441st bit.
- pBuffer[56] = 0x80;
-
- // Fill raw digest of Buffer into Digest.
- rtl_digest_updateMD5 (
- m_hDigest, pBuffer, sizeof(pBuffer));
- rtl_digest_rawMD5 (
- m_hDigest, pDigestLocal, sizeof(pDigestLocal));
-
- memcpy(pDigest, pDigestLocal, 16);
-}
-
-void MSCodec_Std97::GetEncryptKey (
- const sal_uInt8 pSalt[16],
- sal_uInt8 pSaltData[16],
- sal_uInt8 pSaltDigest[16])
-{
- if (InitCipher(0))
- {
- sal_uInt8 pDigest[RTL_DIGEST_LENGTH_MD5];
- sal_uInt8 pBuffer[64];
-
- rtl_cipher_encode (
- m_hCipher, pSalt, 16, pSaltData, sizeof(pBuffer));
-
- (void)memcpy( pBuffer, pSalt, 16 );
-
- pBuffer[16] = 0x80;
- (void)memset (pBuffer + 17, 0, sizeof(pBuffer) - 17);
- pBuffer[56] = 0x80;
-
- rtl_digest_updateMD5 (
- m_hDigest, pBuffer, sizeof(pBuffer));
- rtl_digest_rawMD5 (
- m_hDigest, pDigest, sizeof(pDigest));
-
- rtl_cipher_encode (
- m_hCipher, pDigest, 16, pSaltDigest, 16);
-
- (void)memset (pBuffer, 0, sizeof(pBuffer));
- (void)memset (pDigest, 0, sizeof(pDigest));
- }
-}
-
-// ============================================================================
-
-} // namespace svx
-
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
deleted file mode 100644
index ffea507995..0000000000
--- a/svx/source/msfilter/msdffimp.cxx
+++ /dev/null
@@ -1,8197 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msdffimp.cxx,v $
- * $Revision: 1.157 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-#include <com/sun/star/embed/Aspects.hpp>
-
-#include <math.h>
-#include <limits.h>
-#include <vector>
-#include <osl/endian.h>
-#include <tools/solar.h> // UINTXX
-#include <rtl/math.hxx>
-
-#include <sot/clsids.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <unotools/streamwrap.hxx>
-#include <comphelper/processfactory.hxx>
-#include <sot/exchange.hxx>
-#include <sot/storinfo.hxx>
-#include <vcl/cvtgrf.hxx>
-
-#include "viscache.hxx"
-
-// SvxItem-Mapping. Wird benoetigt um die SvxItem-Header erfolgreich zu includen
-#include <svx/eeitem.hxx>
-#ifndef _EDITDATA_HXX
-#include <svx/editdata.hxx>
-#endif
-
-#include <svtools/urihelper.hxx>
-
-// textitem.hxx editdata.hxx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// paraitem.hxx editdata.hxx
-
-
-#include <tools/stream.hxx>
-#include <tools/debug.hxx>
-#ifndef _TOOLS_ZCODEC_HXX
-#include <tools/zcodec.hxx>
-#endif
-#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
-#include <unotools/ucbstreamhelper.hxx>
-#endif
-#include <unotools/localfilehelper.hxx>
-#include <svx/escherex.hxx>
-#include <basegfx/range/b2drange.hxx>
-#include <com/sun/star/container/XIdentifierContainer.hpp>
-#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
-#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/drawing/GluePoint2.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <svx/charscaleitem.hxx>
-#include <svx/kernitem.hxx>
-#include <svtools/filter.hxx>
-#include <tools/string.hxx>
-#ifndef _TOOLS_URLOBJ_HXX
-#include <tools/urlobj.hxx>
-#endif
-#include <vcl/virdev.hxx>
-#include <vcl/bmpacc.hxx>
-#ifndef _SVSTOR_HXX //autogen
-#include <sot/storage.hxx>
-#endif
-#include <sfx2/docfac.hxx>
-#include <sfx2/docfilt.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <sfx2/module.hxx>
-//#ifndef _SFX_INTERNO_HXX
-//#include <sfx2/interno.hxx>
-//#endif
-
-#ifndef _SDGCPITM_HXX
-
-//#endif
-#include <svx/sdgcpitm.hxx>
-#endif
-#include <svx/sdgmoitm.hxx>
-#include <svx/tstpitem.hxx>
-#include <svx/fmmodel.hxx>
-#include <svx/svdmodel.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svdogrp.hxx>
-#include <svx/svdograf.hxx>
-#include <svx/svdotext.hxx>
-#include <svx/svdorect.hxx>
-#ifndef _SVDOCAPT_HXX
-#include <svx/svdocapt.hxx>
-#endif
-#include <svx/svdoedge.hxx>
-#include <svx/svdocirc.hxx>
-#include <svx/svdoutl.hxx>
-#include <svx/svdoole2.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/frmdir.hxx>
-#include <svx/frmdiritem.hxx>
-#include <svx/svdtrans.hxx>
-#include <svx/sxenditm.hxx>
-#include <svx/sdgluitm.hxx>
-#include <svx/fhgtitem.hxx>
-#include <svx/wghtitem.hxx>
-#include <svx/postitem.hxx>
-#include <svx/udlnitem.hxx>
-#include <svx/crsditem.hxx>
-#include <svx/shdditem.hxx>
-#include <fontitem.hxx>
-#include <svx/colritem.hxx>
-#include <svx/sxekitm.hxx>
-#include <bulitem.hxx>
-#include <svx/polysc3d.hxx>
-#include <svx/extrud3d.hxx>
-#include "svditer.hxx"
-#include <svx/xpoly.hxx>
-#include "xattr.hxx"
-
-#ifndef _IMPGRF_HXX //autogen
-#include "impgrf.hxx"
-#endif
-#include <svx/msdffimp.hxx> // extern sichtbare Header-Datei
-#include <svx/outliner.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/editobj.hxx>
-#include <svx/editeng.hxx>
-#include "gallery.hxx"
-#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <svtools/itempool.hxx>
-#include <vcl/svapp.hxx>
-#include <svx/svx3ditems.hxx>
-#include <svx/svdoashp.hxx>
-#include <svx/sdasaitm.hxx>
-#ifndef _UCBHELPER_CONTENT_HXX_
-#include <ucbhelper/content.hxx>
-#endif
-#ifndef _UCBHELPER_CONTENTBROKER_HXX_
-#include <ucbhelper/contentbroker.hxx>
-#endif
-#include <vos/xception.hxx>
-#ifndef _VOS_NO_NAMESPACE
-using namespace vos;
-#endif
-#include "../customshapes/EnhancedCustomShapeTypeNames.hxx"
-#include "../customshapes/EnhancedCustomShapeGeometry.hxx"
-#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
-#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
-#ifndef __com_sun_star_beans_PropertyValues_hpp__
-#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include "../customshapes/EnhancedCustomShape2d.hxx"
-
-using namespace ::com::sun::star ;
-using namespace ::com::sun::star::drawing;
-using namespace uno ;
-using namespace beans ;
-using namespace drawing ;
-using namespace container ;
-
-#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
-
-// static counter for OLE-Objects
-static sal_uInt32 nMSOleObjCntr = 0;
-#define MSO_OLE_Obj "MSO_OLE_Obj"
-
-
-/*************************************************************************/
-BOOL Impl_OlePres::Read( SvStream & rStm )
-{
- ULONG nBeginPos = rStm.Tell();
- INT32 n;
- rStm >> n;
- if( n != -1 )
- {
- pBmp = new Bitmap;
- rStm >> *pBmp;
- if( rStm.GetError() == SVSTREAM_OK )
- {
- nFormat = FORMAT_BITMAP;
- aSize = pBmp->GetPrefSize();
- MapMode aMMSrc;
- if( !aSize.Width() || !aSize.Height() )
- {
- // letzte Chance
- aSize = pBmp->GetSizePixel();
- aMMSrc = MAP_PIXEL;
- }
- else
- aMMSrc = pBmp->GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
- aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- return TRUE;
- }
- else
- {
- delete pBmp;
- pBmp = NULL;
-
- pMtf = new GDIMetaFile();
- rStm.ResetError();
- rStm >> *pMtf;
- if( rStm.GetError() == SVSTREAM_OK )
- {
- nFormat = FORMAT_GDIMETAFILE;
- aSize = pMtf->GetPrefSize();
- MapMode aMMSrc = pMtf->GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
- aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- return TRUE;
- }
- else
- {
- delete pMtf;
- pMtf = NULL;
- }
- }
-
- }
-
- rStm.ResetError();
- rStm.Seek( nBeginPos );
- nFormat = ReadClipboardFormat( rStm );
- // JobSetup, bzw. TargetDevice ueberlesen
- // Information aufnehmen, um sie beim Schreiben nicht zu verlieren
- nJobLen = 0;
- rStm >> nJobLen;
- if( nJobLen >= 4 )
- {
- nJobLen -= 4;
- if( nJobLen )
- {
- pJob = new BYTE[ nJobLen ];
- rStm.Read( pJob, nJobLen );
- }
- }
- else
- {
- rStm.SetError( SVSTREAM_GENERALERROR );
- return FALSE;
- }
- UINT32 nAsp;
- rStm >> nAsp;
- USHORT nSvAsp = USHORT( nAsp );
- SetAspect( nSvAsp );
- rStm.SeekRel( 4 ); //L-Index ueberlesen
- rStm >> nAdvFlags;
- rStm.SeekRel( 4 ); //Compression
- UINT32 nWidth = 0;
- UINT32 nHeight = 0;
- UINT32 nSize = 0;
- rStm >> nWidth >> nHeight >> nSize;
- aSize.Width() = nWidth;
- aSize.Height() = nHeight;
-
- if( nFormat == FORMAT_GDIMETAFILE )
- {
- pMtf = new GDIMetaFile();
- ReadWindowMetafile( rStm, *pMtf, NULL );
- }
- else if( nFormat == FORMAT_BITMAP )
- {
- pBmp = new Bitmap();
- rStm >> *pBmp;
- }
- else
- {
- BYTE * p = new BYTE[ nSize ];
- rStm.Read( p, nSize );
- delete [] p;
- return FALSE;
- }
- return TRUE;
-}
-
-/************************************************************************/
-void Impl_OlePres::Write( SvStream & rStm )
-{
- WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE );
- rStm << (INT32)(nJobLen +4); // immer leeres TargetDevice
- if( nJobLen )
- rStm.Write( pJob, nJobLen );
- rStm << (UINT32)nAspect;
- rStm << (INT32)-1; //L-Index immer -1
- rStm << (INT32)nAdvFlags;
- rStm << (INT32)0; //Compression
- rStm << (INT32)aSize.Width();
- rStm << (INT32)aSize.Height();
- ULONG nPos = rStm.Tell();
- rStm << (INT32)0;
-
- if( GetFormat() == FORMAT_GDIMETAFILE && pMtf )
- {
- // Immer auf 1/100 mm, bis Mtf-Loesung gefunden
- // Annahme (keine Skalierung, keine Org-Verschiebung)
- DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == Fraction( 1, 1 ),
- "X-Skalierung im Mtf" );
- DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == Fraction( 1, 1 ),
- "Y-Skalierung im Mtf" );
- DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
- "Origin-Verschiebung im Mtf" );
- MapUnit nMU = pMtf->GetPrefMapMode().GetMapUnit();
- if( MAP_100TH_MM != nMU )
- {
- Size aPrefS( pMtf->GetPrefSize() );
- Size aS( aPrefS );
- aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
-
- pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
- Fraction( aS.Height(), aPrefS.Height() ) );
- pMtf->SetPrefMapMode( MAP_100TH_MM );
- pMtf->SetPrefSize( aS );
- }
- WriteWindowMetafileBits( rStm, *pMtf );
- }
- else
- {
- DBG_ERROR( "unknown format" );
- }
- ULONG nEndPos = rStm.Tell();
- rStm.Seek( nPos );
- rStm << (UINT32)(nEndPos - nPos - 4);
- rStm.Seek( nEndPos );
-}
-
-Impl_OlePres * CreateCache_Impl( SotStorage * pStor )
-{
- SotStorageStreamRef xOleObjStm =pStor->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Ole-Object" ) ),
- STREAM_READ | STREAM_NOCREATE );
- if( xOleObjStm->GetError() )
- return NULL;
- SotStorageRef xOleObjStor = new SotStorage( *xOleObjStm );
- if( xOleObjStor->GetError() )
- return NULL;
-
- String aStreamName;
- if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) ) ) )
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) );
- else if( xOleObjStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ) ) )
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) );
-
- if( aStreamName.Len() == 0 )
- return NULL;
-
-
- for( USHORT i = 1; i < 10; i++ )
- {
- SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( aStreamName,
- STREAM_READ | STREAM_NOCREATE );
- if( xStm->GetError() )
- break;
-
- xStm->SetBufferSize( 8192 );
- Impl_OlePres * pEle = new Impl_OlePres( 0 );
- if( pEle->Read( *xStm ) && !xStm->GetError() )
- {
- if( pEle->GetFormat() == FORMAT_GDIMETAFILE || pEle->GetFormat() == FORMAT_BITMAP )
- return pEle;
- }
- delete pEle;
- aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres00" ) );
- aStreamName += String( i );
- };
- return NULL;
-}
-
-
-
-//---------------------------------------------------------------------------
-// Hilfs Klassen aus MSDFFDEF.HXX
-//---------------------------------------------------------------------------
-
-SvStream& operator>>( SvStream& rIn, DffRecordHeader& rRec )
-{
- rRec.nFilePos = rIn.Tell();
- UINT16 nTmp(0);
- rIn >> nTmp;
- rRec.nImpVerInst = nTmp;
- rRec.nRecVer = sal::static_int_cast< BYTE >(nTmp & 0x000F);
- rRec.nRecInstance = nTmp >> 4;
- rIn >> rRec.nRecType;
- rIn >> rRec.nRecLen;
- return rIn;
-}
-
-// Masse fuer dashed lines
-#define LLEN_MIDDLE (450)
-#define LLEN_SPACE_MIDDLE (360)
-#define LLEN_LONG (LLEN_MIDDLE * 2)
-#define LLEN_SPACE_LONG (LLEN_SPACE_MIDDLE + 20)
-#define LLEN_POINT (LLEN_MIDDLE / 4)
-#define LLEN_SPACE_POINT (LLEN_SPACE_MIDDLE / 4)
-
-SvStream& operator>>( SvStream& rIn, DffPropSet& rRec )
-{
- rRec.InitializePropSet();
-
- DffRecordHeader aHd;
- rIn >> aHd;
- UINT32 nPropCount = aHd.nRecInstance;
-
- // FilePos der ComplexData merken
- UINT32 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
-
- for( UINT32 nPropNum = 0; nPropNum < nPropCount; nPropNum++ )
- {
- sal_uInt16 nTmp;
- sal_uInt32 nRecType, nContent, nContentEx = 0xffff0000;
- rIn >> nTmp
- >> nContent;
-
- nRecType = nTmp & 0x3fff;
-
- if ( nRecType > 0x3ff )
- break;
- if ( ( nRecType & 0x3f ) == 0x3f )
- { // clear flags that have to be cleared
- rRec.mpContents[ nRecType ] &= ( ( nContent >> 16 ) ^ 0xffffffff );
- // set flags that have to be set
- rRec.mpContents[ nRecType ] |= nContent;
- nContentEx |= ( nContent >> 16 );
- rRec.Replace( nRecType, (void*)nContentEx );
- }
- else
- {
- DffPropFlags aPropFlag = { 1, 0, 0, 0 };
- if ( nTmp & 0x4000 )
- aPropFlag.bBlip = sal_True;
- if ( nTmp & 0x8000 )
- aPropFlag.bComplex = sal_True;
- if ( aPropFlag.bComplex && nContent && ( nComplexDataFilePos < aHd.GetRecEndFilePos() ) )
- {
- // normally nContent is the complete size of the complex property,
- // but this is not always true for IMsoArrays ( what the hell is a IMsoArray ? )
-
- // I love special threatments :-(
- if ( ( nRecType == DFF_Prop_pVertices ) || ( nRecType == DFF_Prop_pSegmentInfo )
- || ( nRecType == DFF_Prop_fillShadeColors ) || ( nRecType == DFF_Prop_lineDashStyle )
- || ( nRecType == DFF_Prop_pWrapPolygonVertices ) || ( nRecType == DFF_Prop_connectorPoints )
- || ( nRecType == DFF_Prop_Handles ) || ( nRecType == DFF_Prop_pFormulas )
- || ( nRecType == DFF_Prop_textRectangles ) )
- {
- // now check if the current content size is possible, or 6 bytes too small
- sal_uInt32 nOldPos = rIn.Tell();
- sal_Int16 nNumElem, nNumElemReserved, nSize;
-
- rIn.Seek( nComplexDataFilePos );
- rIn >> nNumElem >> nNumElemReserved >> nSize;
- if ( nNumElemReserved >= nNumElem )
- {
- // the size of these array elements is nowhere defined,
- // what if the size is negative ?
- // ok, we will make it positive and shift it.
- // for -16 this works
- if ( nSize < 0 )
- nSize = ( -nSize ) >> 2;
- sal_uInt32 nDataSize = (sal_uInt32)( nSize * nNumElem );
-
- // sometimes the content size is 6 bytes too small (array header information is missing )
- if ( nDataSize == nContent )
- nContent += 6;
-
- // check if array fits into the PropertyContainer
- if ( ( nComplexDataFilePos + nContent ) > aHd.GetRecEndFilePos() )
- nContent = 0;
- }
- else
- nContent = 0;
- rIn.Seek( nOldPos );
- }
- if ( nContent )
- {
- nContentEx = nComplexDataFilePos; // insert the filepos of this property;
- nComplexDataFilePos += nContent; // store filepos, that is used for the next complex property
- }
- else // a complex property needs content
- aPropFlag.bSet = sal_False; // otherwise something is wrong
- }
- rRec.mpContents[ nRecType ] = nContent;
- rRec.mpFlags[ nRecType ] = aPropFlag;
- rRec.Insert( nRecType, (void*)nContentEx );
- }
- }
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-void DffPropSet::InitializePropSet() const
-{
- /*
- cmc:
- " Boolean properties are grouped in bitfields by property set; note that
- the Boolean properties in each property set are contiguous. They are saved
- under the property ID of the last Boolean property in the set, and are
- placed in the value field in reverse order starting with the last property
- in the low bit. "
-
- e.g.
-
- fEditedWrap
- fBehindDocument
- fOnDblClickNotify
- fIsButton
- fOneD
- fHidden
- fPrint
-
- are all part of a group and all are by default false except for fPrint,
- which equates to a default bit sequence for the group of 0000001 -> 0x1
-
- If at a later stage word sets fBehindDocument away from the default it
- will be done by having a property named fPrint whose bitsequence will have
- the fBehindDocument bit set. e.g. a DFF_Prop_fPrint with value 0x200020
- has set bit 6 on so as to enable fBehindDocument (as well as disabling
- everything else)
- */
-
- memset( ( (DffPropSet*) this )->mpFlags, 0, 0x400 * sizeof(DffPropFlags) );
- ( (DffPropSet*) this )->Clear();
-
- DffPropFlags nFlags = { 1, 0, 0, 1 };
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_LockAgainstGrouping ] = 0x0000; //0x01ff0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_LockAgainstGrouping ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_LockAgainstGrouping, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_FitTextToShape ] = 0x0010; //0x001f0010;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_FitTextToShape ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_FitTextToShape, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_gtextFStrikethrough ] = 0x0000; //0xffff0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_gtextFStrikethrough ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_gtextFStrikethrough, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_pictureActive ] = 0x0000; //0x000f0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_pictureActive ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_pictureActive, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fFillOK ] = 0x0039; //0x003f0039;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fFillOK ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fFillOK, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fNoFillHitTest ] = 0x001c; //0x001f001c;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fNoFillHitTest ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fNoFillHitTest, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fNoLineDrawDash ] = 0x001e; //0x001f000e;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fNoLineDrawDash ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fNoLineDrawDash, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fshadowObscured ] = 0x0000; //0x00030000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fshadowObscured ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fshadowObscured, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fPerspective ] = 0x0000; //0x00010000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fPerspective ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fPerspective, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fc3DLightFace ] = 0x0001; //0x000f0001;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fc3DLightFace ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fc3DLightFace, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fc3DFillHarsh ] = 0x0016; //0x001f0016;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fc3DFillHarsh ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fc3DFillHarsh, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fBackground ] = 0x0000; //0x001f0000;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fBackground ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fBackground, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fCalloutLengthSpecified ] = 0x0010; //0x00ef0010;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fCalloutLengthSpecified ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fCalloutLengthSpecified, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fPrint ] = 0x0001; //0x00ef0001;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fPrint ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fPrint, (void*)0xffff0000 );
-
- ( (DffPropSet*) this )->mpContents[ DFF_Prop_fillColor ] = 0xffffff;
- ( (DffPropSet*) this )->mpFlags[ DFF_Prop_fillColor ] = nFlags;
- ( (DffPropSet*) this )->Insert( DFF_Prop_fillColor, (void*)0xffff0000 );
-}
-
-void DffPropSet::Merge( DffPropSet& rMaster ) const
-{
- for ( void* pDummy = rMaster.First(); pDummy; pDummy = rMaster.Next() )
- {
- UINT32 nRecType = rMaster.GetCurKey();
- if ( ( nRecType & 0x3f ) == 0x3f ) // this is something called FLAGS
- {
- UINT32 nCurrentFlags = mpContents[ nRecType ];
- UINT32 nMergeFlags = rMaster.mpContents[ nRecType ];
- nMergeFlags &= ( nMergeFlags >> 16 ) | 0xffff0000; // clearing low word
- nMergeFlags &= ( ( nCurrentFlags & 0xffff0000 ) // remove allready hard set
- | ( nCurrentFlags >> 16 ) ) ^ 0xffffffff; // attributes from mergeflags
- nCurrentFlags &= ( ( nMergeFlags & 0xffff0000 ) // apply zero master bits
- | ( nMergeFlags >> 16 ) ) ^ 0xffffffff;
- nCurrentFlags |= (UINT16)nMergeFlags; // apply filled master bits
- ( (DffPropSet*) this )->mpContents[ nRecType ] = nCurrentFlags;
-
-
- sal_uInt32 nNewContentEx = (sal_uInt32)(sal_uIntPtr)rMaster.GetCurObject();
- if ( ((DffPropSet*)this)->Seek( nRecType ) )
- nNewContentEx |= (sal_uInt32)(sal_uIntPtr)GetCurObject();
- ( (DffPropSet*) this )->Replace( nRecType, (void*)nNewContentEx );
- }
- else
- {
- if ( !IsProperty( nRecType ) || !IsHardAttribute( nRecType ) )
- {
- ( (DffPropSet*) this )->mpContents[ nRecType ] = rMaster.mpContents[ nRecType ];
- DffPropFlags nFlags( rMaster.mpFlags[ nRecType ] );
- nFlags.bSoftAttr = TRUE;
- ( (DffPropSet*) this )->mpFlags[ nRecType ] = nFlags;
- ( (DffPropSet*) this )->Insert( nRecType, pDummy );
- }
- }
- }
-}
-
-BOOL DffPropSet::IsHardAttribute( UINT32 nId ) const
-{
- BOOL bRetValue = TRUE;
- nId &= 0x3ff;
- if ( ( nId & 0x3f ) >= 48 ) // is this a flag id
- {
- if ( ((DffPropSet*)this)->Seek( nId | 0x3f ) )
- {
- sal_uInt32 nContentEx = (sal_uInt32)(sal_uIntPtr)GetCurObject();
- bRetValue = ( nContentEx & ( 1 << ( 0xf - ( nId & 0xf ) ) ) ) != 0;
- }
- }
- else
- bRetValue = ( mpFlags[ nId ].bSoftAttr == 0 );
- return bRetValue;
-};
-
-UINT32 DffPropSet::GetPropertyValue( UINT32 nId, UINT32 nDefault ) const
-{
- nId &= 0x3ff;
- return ( mpFlags[ nId ].bSet ) ? mpContents[ nId ] : nDefault;
-};
-
-bool DffPropSet::GetPropertyBool( UINT32 nId, bool bDefault ) const
-{
- UINT32 nBaseId = nId | 31; // base ID to get the UINT32 property value
- UINT32 nMask = 1 << (nBaseId - nId); // bit mask of the boolean property
-
- UINT32 nPropValue = GetPropertyValue( nBaseId, bDefault ? nMask : 0 );
- return (nPropValue & nMask) != 0;
-}
-
-::rtl::OUString DffPropSet::GetPropertyString( UINT32 nId, SvStream& rStrm ) const
-{
- sal_Size nOldPos = rStrm.Tell();
- ::rtl::OUStringBuffer aBuffer;
- sal_uInt32 nBufferSize = GetPropertyValue( nId );
- if( (nBufferSize > 0) && SeekToContent( nId, rStrm ) )
- {
- sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufferSize / 2 );
- aBuffer.ensureCapacity( nStrLen );
- for( sal_Int32 nCharIdx = 0; nCharIdx < nStrLen; ++nCharIdx )
- {
- sal_uInt16 nChar = 0;
- rStrm >> nChar;
- if( nChar > 0 )
- aBuffer.append( static_cast< sal_Unicode >( nChar ) );
- else
- break;
- }
- }
- rStrm.Seek( nOldPos );
- return aBuffer.makeStringAndClear();
-}
-
-void DffPropSet::SetPropertyValue( UINT32 nId, UINT32 nValue ) const
-{
- if ( !mpFlags[ nId ].bSet )
- {
- ( (DffPropSet*) this )->Insert( nId, (void*)nValue );
- ( (DffPropSet*) this )->mpFlags[ nId ].bSet = TRUE;
- }
- ( (DffPropSet*) this )->mpContents[ nId ] = nValue;
-};
-
-BOOL DffPropSet::SeekToContent( UINT32 nRecType, SvStream& rStrm ) const
-{
- nRecType &= 0x3ff;
- if ( mpFlags[ nRecType ].bSet )
- {
- if ( mpFlags[ nRecType ].bComplex )
- {
- if ( ((DffPropSet*)this)->Seek( nRecType ) )
- {
- sal_uInt32 nOffset = (sal_uInt32)(sal_uIntPtr)GetCurObject();
- if ( nOffset && ( ( nOffset & 0xffff0000 ) != 0xffff0000 ) )
- {
- rStrm.Seek( nOffset );
- return TRUE;
- }
- }
- }
- }
- return FALSE;
-}
-
-DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan ) :
- rManager( rMan ),
- pDefaultPropSet( NULL )
-{
- InitializePropSet();
-}
-
-void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, UINT32 nOffsDgg ) const
-{
- delete pDefaultPropSet;
- UINT32 nMerk = rStCtrl.Tell();
- rStCtrl.Seek( nOffsDgg );
- DffRecordHeader aRecHd;
- rStCtrl >> aRecHd;
- if ( aRecHd.nRecType == DFF_msofbtDggContainer )
- {
- if ( rManager.SeekToRec( rStCtrl, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
- {
- ( (DffPropertyReader*) this )->pDefaultPropSet = new DffPropSet;
- rStCtrl >> *pDefaultPropSet;
- }
- }
- rStCtrl.Seek( nMerk );
-}
-
-#ifdef DBG_CUSTOMSHAPE
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData, UINT32 nShapeId ) const
-#else
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
-#endif
-{
- ULONG nFilePos = rIn.Tell();
- rIn >> (DffPropertyReader&)*this;
-
- if ( IsProperty( DFF_Prop_hspMaster ) )
- {
- if ( rManager.SeekToShape( rIn, pClientData, GetPropertyValue( DFF_Prop_hspMaster ) ) )
- {
- DffRecordHeader aRecHd;
- rIn >> aRecHd;
- if ( rManager.SeekToRec( rIn, DFF_msofbtOPT, aRecHd.GetRecEndFilePos() ) )
- {
- DffPropSet aMasterPropSet;
- rIn >> aMasterPropSet;
- Merge( aMasterPropSet );
- }
- }
- }
-// if ( pDefaultPropSet )
-// Merge( *( pDefaultPropSet ) );
-
- ( (DffPropertyReader*) this )->mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
-
-#ifdef DBG_CUSTOMSHAPE
-
- String aURLStr;
-
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( String( RTL_CONSTASCII_STRINGPARAM( "d:\\ashape.dbg" ) ), aURLStr ) )
- {
- SvStream* pOut = ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_WRITE );
-
- if( pOut )
- {
- pOut->Seek( STREAM_SEEK_TO_END );
-
- if ( IsProperty( DFF_Prop_adjustValue ) || IsProperty( DFF_Prop_pVertices ) )
- {
- pOut->WriteLine( "" );
- ByteString aString( "ShapeId: " );
- aString.Append( ByteString::CreateFromInt32( nShapeId ) );
- pOut->WriteLine( aString );
- }
- for ( sal_uInt32 i = DFF_Prop_adjustValue; i <= DFF_Prop_adjust10Value; i++ )
- {
- if ( IsProperty( i ) )
- {
- ByteString aString( "Prop_adjustValue" );
- aString.Append( ByteString::CreateFromInt32( ( i - DFF_Prop_adjustValue ) + 1 ) );
- aString.Append( ":" );
- aString.Append( ByteString::CreateFromInt32( GetPropertyValue( i ) ) );
- pOut->WriteLine( aString );
- }
- }
- sal_Int32 i;
- for ( i = 320; i < 383; i++ )
- {
- if ( ( i >= DFF_Prop_adjustValue ) && ( i <= DFF_Prop_adjust10Value ) )
- continue;
- if ( IsProperty( i ) )
- {
- if ( SeekToContent( i, rIn ) )
- {
- INT32 nLen = (INT32)GetPropertyValue( i );
- if ( nLen )
- {
- pOut->WriteLine( "" );
- ByteString aDesc( "Property:" );
- aDesc.Append( ByteString::CreateFromInt32( i ) );
- aDesc.Append( ByteString( " Size:" ) );
- aDesc.Append( ByteString::CreateFromInt32( nLen ) );
- pOut->WriteLine( aDesc );
- INT16 nNumElem, nNumElemMem, nNumSize;
- rIn >> nNumElem >> nNumElemMem >> nNumSize;
- aDesc = ByteString( "Entries: " );
- aDesc.Append( ByteString::CreateFromInt32( nNumElem ) );
- aDesc.Append( ByteString( " Size:" ) );
- aDesc.Append( ByteString::CreateFromInt32( nNumSize ) );
- pOut->WriteLine( aDesc );
- if ( nNumSize < 0 )
- nNumSize = ( ( -nNumSize ) >> 2 );
- if ( !nNumSize )
- nNumSize = 16;
- nLen -= 6;
- while ( nLen > 0 )
- {
- ByteString aString;
- for ( UINT32 j = 0; nLen && ( j < ( nNumSize >> 1 ) ); j++ )
- {
- for ( UINT32 k = 0; k < 2; k++ )
- {
- if ( nLen )
- {
- BYTE nVal;
- rIn >> nVal;
- if ( ( nVal >> 4 ) > 9 )
- *pOut << (BYTE)( ( nVal >> 4 ) + 'A' - 10 );
- else
- *pOut << (BYTE)( ( nVal >> 4 ) + '0' );
-
- if ( ( nVal & 0xf ) > 9 )
- *pOut << (BYTE)( ( nVal & 0xf ) + 'A' - 10 );
- else
- *pOut << (BYTE)( ( nVal & 0xf ) + '0' );
-
- nLen--;
- }
- }
- *pOut << (char)( ' ' );
- }
- pOut->WriteLine( aString );
- }
- }
- }
- else
- {
- ByteString aString( "Property" );
- aString.Append( ByteString::CreateFromInt32( i ) );
- aString.Append( ":" );
- aString.Append( ByteString::CreateFromInt32( GetPropertyValue( i ) ) );
- pOut->WriteLine( aString );
- }
- }
- }
-
- delete pOut;
- }
- }
-
-#endif
-
- rIn.Seek( nFilePos );
-}
-
-
-INT32 DffPropertyReader::Fix16ToAngle( INT32 nContent ) const
-{
- INT32 nAngle = 0;
- if ( nContent )
- {
- nAngle = ( (INT16)( nContent >> 16) * 100L ) + ( ( ( nContent & 0x0000ffff) * 100L ) >> 16 );
- nAngle = NormAngle360( -nAngle );
- }
- return nAngle;
-}
-
-DffPropertyReader::~DffPropertyReader()
-{
- delete pDefaultPropSet;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule )
-{
- rIn >> rRule.nRuleId
- >> rRule.nShapeA
- >> rRule.nShapeB
- >> rRule.nShapeC
- >> rRule.ncptiA
- >> rRule.ncptiB;
-
- return rIn;
-}
-
-SvxMSDffSolverContainer::SvxMSDffSolverContainer()
-{
-}
-
-SvxMSDffSolverContainer::~SvxMSDffSolverContainer()
-{
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)aCList.Next() )
- delete pPtr;
-}
-
-SvStream& operator>>( SvStream& rIn, SvxMSDffSolverContainer& rContainer )
-{
- DffRecordHeader aHd;
- rIn >> aHd;
- if ( aHd.nRecType == DFF_msofbtSolverContainer )
- {
- DffRecordHeader aCRule;
- while ( ( rIn.GetError() == 0 ) && ( rIn.Tell() < aHd.GetRecEndFilePos() ) )
- {
- rIn >> aCRule;
- if ( aCRule.nRecType == DFF_msofbtConnectorRule )
- {
- SvxMSDffConnectorRule* pRule = new SvxMSDffConnectorRule;
- rIn >> *pRule;
- rContainer.aCList.Insert( pRule, LIST_APPEND );
- }
- aCRule.SeekToEndOfRecord( rIn );
- }
- }
- return rIn;
-}
-
-void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
-{
- sal_Int32 i, nCnt;
- for ( i = 0, nCnt = rSolver.aCList.Count(); i < nCnt; i++ )
- {
- SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rSolver.aCList.GetObject( i );
- if ( pPtr->pCObj )
- {
- for ( int nN = 0; nN < 2; nN++ )
- {
- SdrObject* pO;
- sal_uInt32 nC, nSpFlags;
- sal_Bool bTail;
- if ( !nN )
- {
- bTail = sal_True;
- pO = pPtr->pAObj;
- nC = pPtr->ncptiA;
- nSpFlags = pPtr->nSpFlagsA;
- }
- else
- {
- bTail = sal_False;
- pO = pPtr->pBObj;
- nC = pPtr->ncptiB;
- nSpFlags = pPtr->nSpFlagsB;
- }
- if ( pO )
- {
- Any aAny;
- SdrGluePoint aGluePoint;
- Reference< XShape > aXShape( pO->getUnoShape(), UNO_QUERY );
- Reference< XShape > aXConnector( pPtr->pCObj->getUnoShape(), UNO_QUERY );
- SdrGluePointList* pList = pO->ForceGluePointList();
-
- sal_Bool bValidGluePoint = sal_False;
- sal_Int32 nId = nC;
- sal_uInt32 nInventor = pO->GetObjInventor();
-
- if( nInventor == SdrInventor )
- {
- sal_uInt32 nObjId = pO->GetObjIdentifier();
- switch( nObjId )
- {
- case OBJ_GRUP :
- case OBJ_GRAF :
- case OBJ_RECT :
- case OBJ_TEXT :
- case OBJ_PAGE :
- case OBJ_TEXTEXT :
- case OBJ_wegFITTEXT :
- case OBJ_wegFITALLTEXT :
- case OBJ_TITLETEXT :
- case OBJ_OUTLINETEXT :
- {
- if ( nC & 1 )
- {
- if ( nSpFlags & SP_FFLIPH )
- nC ^= 2; // 1 <-> 3
- }
- else
- {
- if ( nSpFlags & SP_FFLIPV )
- nC ^= 1; // 0 <-> 2
- }
- switch( nC )
- {
- case 0 :
- nId = 0; // SDRVERTALIGN_TOP;
- break;
- case 1 :
- nId = 3; // SDRHORZALIGN_RIGHT;
- break;
- case 2 :
- nId = 2; // SDRVERTALIGN_BOTTOM;
- break;
- case 3 :
- nId = 1; // SDRHORZALIGN_LEFT;
- break;
- }
- if ( nId <= 3 )
- bValidGluePoint = sal_True;
- }
- break;
- case OBJ_POLY :
- case OBJ_PLIN :
- case OBJ_LINE :
- case OBJ_PATHLINE :
- case OBJ_PATHFILL :
- case OBJ_FREELINE :
- case OBJ_FREEFILL :
- case OBJ_SPLNLINE :
- case OBJ_SPLNFILL :
- case OBJ_PATHPOLY :
- case OBJ_PATHPLIN :
- {
- if ( pList && ( pList->GetCount() > nC ) )
- {
- bValidGluePoint = sal_True;
- nId = (sal_Int32)((*pList)[ (sal_uInt16)nC].GetId() + 3 );
- }
- else
- {
- sal_Bool bNotFound = sal_True;
-
- PolyPolygon aPolyPoly( EscherPropertyContainer::GetPolyPolygon( aXShape ) );
- sal_uInt16 k, j, nPolySize = aPolyPoly.Count();
- if ( nPolySize )
- {
- sal_uInt32 nPointCount = 0;
- Rectangle aBoundRect( aPolyPoly.GetBoundRect() );
- if ( aBoundRect.GetWidth() && aBoundRect.GetHeight() )
- {
- for ( k = 0; bNotFound && ( k < nPolySize ); k++ )
- {
- const Polygon& rPolygon = aPolyPoly.GetObject( k );
- for ( j = 0; bNotFound && ( j < rPolygon.GetSize() ); j++ )
- {
- PolyFlags eFlags = rPolygon.GetFlags( j );
- if ( eFlags == POLY_NORMAL )
- {
- if ( nC == nPointCount )
- {
- const Point& rPoint = rPolygon.GetPoint( j );
- double fXRel = rPoint.X() - aBoundRect.Left();
- double fYRel = rPoint.Y() - aBoundRect.Top();
- sal_Int32 nWidth = aBoundRect.GetWidth();
- if ( !nWidth )
- nWidth = 1;
- sal_Int32 nHeight= aBoundRect.GetHeight();
- if ( !nHeight )
- nHeight = 1;
- fXRel /= (double)nWidth;
- fXRel *= 10000;
- fYRel /= (double)nHeight;
- fYRel *= 10000;
- aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
- aGluePoint.SetPercent( sal_True );
- aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
- aGluePoint.SetEscDir( SDRESC_SMART );
- nId = (sal_Int32)((*pList)[ pList->Insert( aGluePoint ) ].GetId() + 3 );
- bNotFound = sal_False;
- }
- nPointCount++;
- }
- }
- }
- }
- }
- if ( !bNotFound )
- {
- bValidGluePoint = sal_True;
- }
- }
- }
- break;
-
- case OBJ_CUSTOMSHAPE :
- {
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pO)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
- const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM ( "GluePointType" ) );
- sal_Int16 nGluePointType = EnhancedCustomShapeGluePointType::SEGMENTS;
- com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePointType );
- if ( pAny )
- *pAny >>= nGluePointType;
- else
- {
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- rtl::OUString sShapeType;
- pAny = aGeometryItem.GetPropertyValueByName( sType );
- if ( pAny )
- *pAny >>= sShapeType;
- MSO_SPT eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
- nGluePointType = GetCustomShapeConnectionTypeDefault( eSpType );
- }
- if ( nGluePointType == EnhancedCustomShapeGluePointType::CUSTOM )
- {
- if ( pList && ( pList->GetCount() > nC ) )
- {
- bValidGluePoint = sal_True;
- nId = (sal_Int32)((*pList)[ (sal_uInt16)nC].GetId() + 3 );
- }
- }
- else if ( nGluePointType == EnhancedCustomShapeGluePointType::RECT )
- {
- if ( nC & 1 )
- {
- if ( nSpFlags & SP_FFLIPH )
- nC ^= 2; // 1 <-> 3
- }
- else
- {
- if ( nSpFlags & SP_FFLIPV )
- nC ^= 1; // 0 <-> 2
- }
- switch( nC )
- {
- case 0 :
- nId = 0; // SDRVERTALIGN_TOP;
- break;
- case 1 :
- nId = 3; // SDRHORZALIGN_RIGHT;
- break;
- case 2 :
- nId = 2; // SDRVERTALIGN_BOTTOM;
- break;
- case 3 :
- nId = 1; // SDRHORZALIGN_LEFT;
- break;
- }
- if ( nId <= 3 )
- bValidGluePoint = sal_True;
- }
- else if ( nGluePointType == EnhancedCustomShapeGluePointType::SEGMENTS )
- {
- const rtl::OUString sSegments( RTL_CONSTASCII_USTRINGPARAM ( "Segments" ) );
- const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
-
- sal_uInt32 k, nPt = nC;
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
- pAny = aGeometryItem.GetPropertyValueByName( sPath, sSegments );
- if ( pAny )
- {
- if ( *pAny >>= aSegments )
- {
- for ( nPt = 0, k = 1; nC && ( k < (sal_uInt32)aSegments.getLength() ); k++ )
- {
- sal_Int16 j, nCnt2 = aSegments[ k ].Count;
- if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN )
- {
- for ( j = 0; nC && ( j < nCnt2 ); j++ )
- {
- switch( aSegments[ k ].Command )
- {
- case EnhancedCustomShapeSegmentCommand::ENDSUBPATH :
- case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH :
- case EnhancedCustomShapeSegmentCommand::LINETO :
- case EnhancedCustomShapeSegmentCommand::MOVETO :
- {
- nC--;
- nPt++;
- }
- break;
- case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX :
- case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY :
- break;
-
- case EnhancedCustomShapeSegmentCommand::CURVETO :
- {
- nC--;
- nPt += 3;
- }
- break;
-
- case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO :
- case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE :
- {
- nC--;
- nPt += 3;
- }
- break;
- case EnhancedCustomShapeSegmentCommand::ARCTO :
- case EnhancedCustomShapeSegmentCommand::ARC :
- case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO :
- case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC :
- {
- nC--;
- nPt += 4;
- }
- break;
- }
- }
- }
- }
- }
- }
- pAny = aGeometryItem.GetPropertyValueByName( sPath, sCoordinates );
- if ( pAny )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
- *pAny >>= aCoordinates;
- if ( nPt < (sal_uInt32)aCoordinates.getLength() )
- {
- nId = 4;
- com::sun::star::drawing::EnhancedCustomShapeParameterPair& rPara = aCoordinates[ nPt ];
- sal_Int32 nX = 0, nY = 0;
- if ( ( rPara.First.Value >>= nX ) && ( rPara.Second.Value >>= nY ) )
- {
- const rtl::OUString sGluePoints( RTL_CONSTASCII_USTRINGPARAM ( "GluePoints" ) );
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
- pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePoints );
- if ( pAny )
- *pAny >>= aGluePoints;
- sal_Int32 nGluePoints = aGluePoints.getLength();
- aGluePoints.realloc( nGluePoints + 1 );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ nGluePoints ].First, nX );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ nGluePoints ].Second, nY );
- PropertyValue aProp;
- aProp.Name = sGluePoints;
- aProp.Value <<= aGluePoints;
- aGeometryItem.SetPropertyValue( sPath, aProp );
- bValidGluePoint = sal_True;
- ((SdrObjCustomShape*)pO)->SetMergedItem( aGeometryItem );
- SdrGluePointList* pLst = pO->ForceGluePointList();
- if ( pLst->GetCount() > nGluePoints )
- nId = (sal_Int32)((*pLst)[ (sal_uInt16)nGluePoints ].GetId() + 3 );
- }
- }
- }
- }
- }
- break;
- }
- if ( bValidGluePoint )
- {
- Reference< XPropertySet > xPropSet( aXConnector, UNO_QUERY );
- if ( xPropSet.is() )
- {
- if ( nN )
- {
- String aPropName( RTL_CONSTASCII_USTRINGPARAM( "EndShape" ) );
- aAny <<= aXShape;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- aPropName = String( RTL_CONSTASCII_USTRINGPARAM( "EndGluePointIndex" ) );
- aAny <<= nId;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- }
- else
- {
- String aPropName( RTL_CONSTASCII_USTRINGPARAM( "StartShape" ) );
- aAny <<= aXShape;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- aPropName = String( RTL_CONSTASCII_USTRINGPARAM( "StartGluePointIndex" ) );
- aAny <<= nId;
- SetPropValue( aAny, xPropSet, aPropName, sal_True );
- }
-
- // Not sure what this is good for, repaint or broadcast of object change.
- //( Thus i am adding repaint here
- pO->SetChanged();
- pO->BroadcastObjectChange();
- }
- }
- }
- }
- }
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd,
- const MSO_LineEndWidth eLineWidth, const MSO_LineEndLength eLineLenght,
- sal_Int32& rnArrowWidth, sal_Bool& rbArrowCenter,
- String& rsArrowName, sal_Bool bScaleArrow )
-{
- basegfx::B2DPolygon aRetval;
- double fLineWidth = nLineWidth < 70 ? 70.0 : nLineWidth;
- double fLenghtMul, fWidthMul;
- sal_Int32 nLineNumber;
- switch( eLineLenght )
- {
- default :
- case mso_lineMediumLenArrow : fLenghtMul = 3.0; nLineNumber = 2; break;
- case mso_lineShortArrow : fLenghtMul = 2.0; nLineNumber = 1; break;
- case mso_lineLongArrow : fLenghtMul = 5.0; nLineNumber = 3; break;
- }
- switch( eLineWidth )
- {
- default :
- case mso_lineMediumWidthArrow : fWidthMul = 3.0; nLineNumber += 3; break;
- case mso_lineNarrowArrow : fWidthMul = 2.0; break;
- case mso_lineWideArrow : fWidthMul = 5.0; nLineNumber += 6; break;
- }
-
- if ( bScaleArrow ) // #i33630 arrows imported from Word are too big
- {
- fWidthMul /= 1.75;
- fLenghtMul/= 1.75;
- }
-
- rbArrowCenter = sal_False;
- switch ( eLineEnd )
- {
- case mso_lineArrowEnd :
- {
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
-
- case mso_lineArrowOpenEnd :
- {
- switch( eLineLenght )
- {
- default :
- case mso_lineMediumLenArrow : fLenghtMul = 4.5; break;
- case mso_lineShortArrow : fLenghtMul = 3.5; break;
- case mso_lineLongArrow : fLenghtMul = 6.0; break;
- }
- switch( eLineWidth )
- {
- default :
- case mso_lineMediumWidthArrow : fWidthMul = 4.5; break;
- case mso_lineNarrowArrow : fWidthMul = 3.5; break;
- case mso_lineWideArrow : fWidthMul = 6.0; break;
- }
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth * 0.91 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.85, fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, fLenghtMul * fLineWidth * 0.36 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.15, fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.91 ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOpenEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- case mso_lineArrowStealthEnd :
- {
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth * 0.60 ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowStealthEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- case mso_lineArrowDiamondEnd :
- {
- basegfx::B2DPolygon aTriangle;
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth * 0.50 ));
- aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth ));
- aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.50 ));
- aTriangle.setClosed(true);
- aRetval = aTriangle;
- rbArrowCenter = sal_True;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowDiamondEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- case mso_lineArrowOvalEnd :
- {
- aRetval = XPolygon( Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 ),
- (sal_Int32)( fWidthMul * fLineWidth * 0.50 ),
- (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ), 0, 3600 ).getB2DPolygon();
- rbArrowCenter = sal_True;
- rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOvalEnd " ), RTL_TEXTENCODING_UTF8 );
- }
- break;
- default: break;
- }
- rsArrowName.Append( String::CreateFromInt32( nLineNumber ) );
- rnArrowWidth = (sal_Int32)( fLineWidth * fWidthMul );
-
- return aRetval;
-}
-
-void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const // #i28269#
-{
- UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
-
- if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( eShapeType ))
- {
- nLineFlags &= ~0x08;
- }
-
- if ( nLineFlags & 8 )
- {
- // Linienattribute
- sal_Int32 nLineWidth = (INT32)GetPropertyValue( DFF_Prop_lineWidth, 9525 );
-
- MSO_LineDashing eLineDashing = (MSO_LineDashing)GetPropertyValue( DFF_Prop_lineDashing, mso_lineSolid );
- if ( eLineDashing == mso_lineSolid )
- rSet.Put(XLineStyleItem( XLINE_SOLID ) );
- else
- {
-// MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle, mso_lineEndCapSquare );
-
- XDashStyle eDash = XDASH_RECT;
- sal_uInt16 nDots = 1;
- sal_uInt32 nDotLen = nLineWidth / 360;
- sal_uInt16 nDashes = 0;
- sal_uInt32 nDashLen = ( 8 * nLineWidth ) / 360;
- sal_uInt32 nDistance = ( 3 * nLineWidth ) / 360;;
-
- switch ( eLineDashing )
- {
- default:
- case mso_lineDotSys :
- {
- nDots = 1;
- nDashes = 0;
- nDistance = nDotLen;
- }
- break;
-
- case mso_lineDashGEL :
- {
- nDots = 0;
- nDashes = 1;
- nDashLen = ( 4 * nLineWidth ) / 360;
- }
- break;
-
- case mso_lineDashDotGEL :
- {
- nDots = 1;
- nDashes = 1;
- nDashLen = ( 4 * nLineWidth ) / 360;
- }
- break;
-
- case mso_lineLongDashGEL :
- {
- nDots = 0;
- nDashes = 1;
- }
- break;
-
- case mso_lineLongDashDotGEL :
- {
- nDots = 1;
- nDashes = 1;
- }
- break;
-
- case mso_lineLongDashDotDotGEL:
- {
- nDots = 2;
- nDashes = 1;
- }
- break;
- }
-
- rSet.Put( XLineDashItem( String(), XDash( eDash, nDots, nDotLen, nDashes, nDashLen, nDistance ) ) );
- rSet.Put( XLineStyleItem( XLINE_DASH ) );
- }
- rSet.Put( XLineColorItem( String(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_lineColor ), DFF_Prop_lineColor ) ) );
- if ( IsProperty( DFF_Prop_lineOpacity ) )
- {
- double nTrans = GetPropertyValue(DFF_Prop_lineOpacity, 0x10000);
- nTrans = (nTrans * 100) / 65536;
- rSet.Put(XLineTransparenceItem(
- sal_uInt16(100 - ::rtl::math::round(nTrans))));
- }
-
- rManager.ScaleEmu( nLineWidth );
- rSet.Put( XLineWidthItem( nLineWidth ) );
-
- // SJ: LineJoint (setting each time a line is set, because our internal joint type has another default)
- MSO_LineJoin eLineJointDefault = mso_lineJoinMiter;
- if ( eShapeType == mso_sptMin )
- eLineJointDefault = mso_lineJoinRound;
- MSO_LineJoin eLineJoint = (MSO_LineJoin)GetPropertyValue( DFF_Prop_lineJoinStyle, eLineJointDefault );
- XLineJoint eXLineJoint( XLINEJOINT_MITER );
- if ( eLineJoint == mso_lineJoinBevel )
- eXLineJoint = XLINEJOINT_BEVEL;
- else if ( eLineJoint == mso_lineJoinRound )
- eXLineJoint = XLINEJOINT_ROUND;
- rSet.Put( XLineJointItem( eXLineJoint ) );
-
- if ( nLineFlags & 0x10 )
- {
- sal_Bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
- ///////////////
- // LineStart //
- ///////////////
- if ( IsProperty( DFF_Prop_lineStartArrowhead ) )
- {
- MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineStartArrowhead );
- MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineStartArrowWidth, mso_lineMediumWidthArrow );
- MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineStartArrowLength, mso_lineMediumLenArrow );
-
- sal_Int32 nArrowWidth;
- sal_Bool bArrowCenter;
- String aArrowName;
- basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
-
- rSet.Put( XLineStartWidthItem( nArrowWidth ) );
- rSet.Put( XLineStartItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
- rSet.Put( XLineStartCenterItem( bArrowCenter ) );
- }
- /////////////
- // LineEnd //
- /////////////
- if ( IsProperty( DFF_Prop_lineEndArrowhead ) )
- {
- MSO_LineEnd eLineEnd = (MSO_LineEnd)GetPropertyValue( DFF_Prop_lineEndArrowhead );
- MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineEndArrowWidth, mso_lineMediumWidthArrow );
- MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineEndArrowLength, mso_lineMediumLenArrow );
-
- sal_Int32 nArrowWidth;
- sal_Bool bArrowCenter;
- String aArrowName;
- basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName, bScaleArrows ));
-
- rSet.Put( XLineEndWidthItem( nArrowWidth ) );
- rSet.Put( XLineEndItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
- rSet.Put( XLineEndCenterItem( bArrowCenter ) );
- }
- if ( IsProperty( DFF_Prop_lineEndCapStyle ) )
- {
- MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle );
- const SfxPoolItem* pPoolItem = NULL;
- if ( rSet.GetItemState( XATTR_LINEDASH, FALSE, &pPoolItem ) == SFX_ITEM_SET )
- {
- XDashStyle eNewStyle = XDASH_RECT;
- if ( eLineCap == mso_lineEndCapRound )
- eNewStyle = XDASH_ROUND;
- const XDash& rOldDash = ( (const XLineDashItem*)pPoolItem )->GetDashValue();
- if ( rOldDash.GetDashStyle() != eNewStyle )
- {
- XDash aNew( rOldDash );
- aNew.SetDashStyle( eNewStyle );
- rSet.Put( XLineDashItem( XubString(), aNew ) );
- }
- }
- }
- }
- }
- else
- rSet.Put( XLineStyleItem( XLINE_NONE ) );
-}
-
-struct ShadeColor
-{
- Color aColor;
- double fDist;
-
- ShadeColor( const Color& rC, double fR ) : aColor( rC ), fDist( fR ) {};
-};
-
-void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& rProperties, SvStream& rIn, std::vector< ShadeColor >& rShadeColors )
-{
- sal_uInt32 nPos = rIn.Tell();
- if ( rProperties.IsProperty( DFF_Prop_fillShadeColors ) )
- {
- if ( rProperties.SeekToContent( DFF_Prop_fillShadeColors, rIn ) )
- {
- sal_uInt16 i = 0, nNumElem = 0, nNumElemReserved = 0, nSize = 0;
- rIn >> nNumElem >> nNumElemReserved >> nSize;
- for ( ; i < nNumElem; i++ )
- {
- sal_Int32 nColor;
- sal_Int32 nDist;
-
- rIn >> nColor >> nDist;
- rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( nColor, DFF_Prop_fillColor ), 1.0 - ( nDist / 65536.0 ) ) );
- }
- }
- }
- if ( !rShadeColors.size() )
- {
- rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ), 0 ) );
- rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ), 1 ) );
- }
- rIn.Seek( nPos );
-}
-
-struct QuantErr
-{
- double fRed;
- double fGreen;
- double fBlue;
-
- QuantErr() : fRed( 0.0 ), fGreen( 0.0 ), fBlue( 0.0 ){};
-};
-
-void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream& rIn, SfxItemSet& rSet, const std::vector< ShadeColor >& rShadeColors, const DffObjData& rObjData, sal_Int32 nFix16Angle )
-{
- Size aBitmapSizePixel( static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetWidth() / 2540.0 ) * 90.0 ), // we will create a bitmap with 90 dpi
- static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetHeight() / 2540.0 ) * 90.0 ) );
- if ( aBitmapSizePixel.Width() && aBitmapSizePixel.Height() && ( aBitmapSizePixel.Width() <= 1024 ) && ( aBitmapSizePixel.Height() <= 1024 ) )
- {
-// std::vector< QuantErr > aQuantErrCurrScan( aBitmapSizePixel.Width() + 1 );
-// std::vector< QuantErr > aQuantErrNextScan( aBitmapSizePixel.Width() + 1 );
-
- double fFocusX = rManager.GetPropertyValue( DFF_Prop_fillToRight, 0 ) / 65536.0;
- double fFocusY = rManager.GetPropertyValue( DFF_Prop_fillToBottom, 0 ) / 65536.0;
-
- Bitmap aBitmap( aBitmapSizePixel, 24 );
- BitmapWriteAccess* pAcc = aBitmap.AcquireWriteAccess();
- if ( pAcc )
- {
- sal_Int32 nX, nY;
- for ( nY = 0; nY < aBitmapSizePixel.Height(); nY++ )
- {
- for ( nX = 0; nX < aBitmapSizePixel.Width(); nX++ )
- {
- double fX = static_cast< double >( nX ) / aBitmapSizePixel.Width();
- double fY = static_cast< double >( nY ) / aBitmapSizePixel.Height();
-
- double fD, fDist;
- if ( fX < fFocusX )
- {
- if ( fY < fFocusY )
- {
- if ( fX > fY )
- fDist = fY, fD = fFocusY;
- else
- fDist = fX, fD = fFocusX;
- }
- else
- {
- if ( fX > ( 1 - fY ) )
- fDist = ( 1 - fY ), fD = 1 - fFocusY;
- else
- fDist = fX, fD = fFocusX;
- }
- }
- else
- {
- if ( fY < fFocusY )
- {
- if ( ( 1 - fX ) > fY )
- fDist = fY, fD = fFocusY;
- else
- fDist = ( 1 - fX ), fD = 1 - fFocusX;
- }
- else
- {
- if ( ( 1 - fX ) > ( 1 - fY ) )
- fDist = ( 1 - fY ), fD = 1 - fFocusY;
- else
- fDist = ( 1 - fX ), fD = 1 - fFocusX;
- }
- }
- if ( fD != 0.0 )
- fDist /= fD;
-
- std::vector< ShadeColor >::const_iterator aIter( rShadeColors.begin() );
- double fA = 0.0;
- Color aColorA = aIter->aColor;
- double fB = 1.0;
- Color aColorB( aColorA );
- while ( aIter != rShadeColors.end() )
- {
- if ( aIter->fDist <= fDist )
- {
- if ( aIter->fDist >= fA )
- {
- fA = aIter->fDist;
- aColorA = aIter->aColor;
- }
- }
- if ( aIter->fDist > fDist )
- {
- if ( aIter->fDist <= fB )
- {
- fB = aIter->fDist;
- aColorB = aIter->aColor;
- }
- }
- aIter++;
- }
- double fRed = aColorA.GetRed(), fGreen = aColorA.GetGreen(), fBlue = aColorA.GetBlue();
- double fD1 = fB - fA;
- if ( fD1 != 0.0 )
- {
- fRed += ( ( ( fDist - fA ) * ( aColorB.GetRed() - aColorA.GetRed() ) ) / fD1 ); // + aQuantErrCurrScan[ nX ].fRed;
- fGreen += ( ( ( fDist - fA ) * ( aColorB.GetGreen() - aColorA.GetGreen() ) ) / fD1 ); // + aQuantErrCurrScan[ nX ].fGreen;
- fBlue += ( ( ( fDist - fA ) * ( aColorB.GetBlue() - aColorA.GetBlue() ) ) / fD1 ); // + aQuantErrCurrScan[ nX ].fBlue;
- }
- sal_Int16 nRed = static_cast< sal_Int16 >( fRed + 0.5 );
- sal_Int16 nGreen = static_cast< sal_Int16 >( fGreen + 0.5 );
- sal_Int16 nBlue = static_cast< sal_Int16 >( fBlue + 0.5 );
-/*
- double fErr = fRed - nRed;
- aQuantErrCurrScan[ nX + 1 ].fRed += 7.0 * fErr / 16.0;
- if ( nX )
- aQuantErrNextScan[ nX - 1 ].fRed += 3.0 * fErr / 16.0;
- aQuantErrNextScan[ nX ].fRed += 5.0 * fErr / 16.0;
- aQuantErrNextScan[ nX + 1 ].fRed += 1.0 * fErr / 16.0;
-
- fErr = fGreen - nGreen;
- aQuantErrCurrScan[ nX + 1 ].fGreen += 7.0 * fErr / 16.0;
- if ( nX )
- aQuantErrNextScan[ nX - 1 ].fGreen += 3.0 * fErr / 16.0;
- aQuantErrNextScan[ nX ].fGreen += 5.0 * fErr / 16.0;
- aQuantErrNextScan[ nX + 1 ].fGreen += 1.0 * fErr / 16.0;
-
- fErr = fBlue - nBlue;
- aQuantErrCurrScan[ nX + 1 ].fBlue += 7.0 * fErr / 16.0;
- if ( nX )
- aQuantErrNextScan[ nX - 1 ].fBlue += 3.0 * fErr / 16.0;
- aQuantErrNextScan[ nX ].fBlue += 5.0 * fErr / 16.0;
- aQuantErrNextScan[ nX + 1 ].fBlue += 1.0 * fErr / 16.0;
-*/
- if ( nRed < 0 )
- nRed = 0;
- if ( nRed > 255 )
- nRed = 255;
- if ( nGreen < 0 )
- nGreen = 0;
- if ( nGreen > 255 )
- nGreen = 255;
- if ( nBlue < 0 )
- nBlue = 0;
- if ( nBlue > 255 )
- nBlue = 255;
-
- pAcc->SetPixel( nY, nX, BitmapColor( static_cast< sal_Int8 >( nRed ), static_cast< sal_Int8 >( nGreen ), static_cast< sal_Int8 >( nBlue ) ) );
- }
-/*
- aQuantErrCurrScan.swap( aQuantErrNextScan );
- std::vector< QuantErr >::iterator aIter( aQuantErrNextScan.begin() );
- while( aIter != aQuantErrNextScan.end() )
- {
- *aIter = QuantErr();
- aIter++;
- }
-*/
- }
- aBitmap.ReleaseAccess( pAcc );
-
- if ( nFix16Angle )
- {
- sal_Bool bRotateWithShape = sal_True; // TRUE seems to be default
- sal_uInt32 nPos = rIn.Tell();
- if ( const_cast< SvxMSDffManager& >( rManager ).maShapeRecords.SeekToContent( rIn, DFF_msofbtUDefProp, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- const_cast< SvxMSDffManager& >( rManager ).maShapeRecords.Current()->SeekToBegOfRecord( rIn );
- DffPropertyReader aSecPropSet( rManager );
- aSecPropSet.ReadPropSet( rIn, NULL );
- sal_Int32 nSecFillProperties = aSecPropSet.GetPropertyValue( DFF_Prop_fNoFillHitTest, 0x200020 );
- bRotateWithShape = ( nSecFillProperties & 0x0020 );
- }
- rIn.Seek( nPos );
- if ( bRotateWithShape )
- {
- aBitmap.Rotate( nFix16Angle / 10, rShadeColors[ 0 ].aColor );
-
- ULONG nMirrorFlags = BMP_MIRROR_NONE;
- if ( rObjData.nSpFlags & SP_FFLIPV )
- nMirrorFlags |= BMP_MIRROR_VERT;
- if ( rObjData.nSpFlags & SP_FFLIPH )
- nMirrorFlags |= BMP_MIRROR_HORZ;
- if ( nMirrorFlags != BMP_MIRROR_NONE )
- aBitmap.Mirror( nMirrorFlags );
- }
- }
-
- XOBitmap aXBmp( aBitmap, XBITMAP_STRETCH );
- rSet.Put( XFillBmpTileItem( sal_False ) );
- rSet.Put( XFillBitmapItem( String(), aXBmp ) );
- }
- }
-}
-
-void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
-{
- UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
-
- std::vector< ShadeColor > aShadeColors;
- GetShadeColors( rManager, *this, rIn, aShadeColors );
-
- if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType ))
- {
- nFillFlags &= ~0x10;
- }
-
- if ( nFillFlags & 0x10 )
- {
- MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
- XFillStyle eXFill = XFILL_NONE;
- switch( eMSO_FillType )
- {
- case mso_fillSolid : // Fill with a solid color
- eXFill = XFILL_SOLID;
- break;
- case mso_fillPattern : // Fill with a pattern (bitmap)
- case mso_fillTexture : // A texture (pattern with its own color map)
- case mso_fillPicture : // Center a picture in the shape
- eXFill = XFILL_BITMAP;
- break;
- case mso_fillShadeCenter : // Shade from bounding rectangle to end point
- {
- if ( rObjData.aBoundRect.IsEmpty() )// size of object needed to be able
- eXFill = XFILL_GRADIENT; // to create a bitmap substitution
- else
- eXFill = XFILL_BITMAP;
- }
- break;
- case mso_fillShade : // Shade from start to end points
- case mso_fillShadeShape : // Shade from shape outline to end point
- case mso_fillShadeScale : // Similar to mso_fillShade, but the fillAngle
- case mso_fillShadeTitle : // special type - shade to title --- for PP
- eXFill = XFILL_GRADIENT;
- break;
-// case mso_fillBackground : // Use the background fill color/pattern
- default: break;
- }
- rSet.Put( XFillStyleItem( eXFill ) );
-
- if (IsProperty(DFF_Prop_fillOpacity))
- {
- double nTrans = GetPropertyValue(DFF_Prop_fillOpacity);
- nTrans = (nTrans * 100) / 65536;
- rSet.Put(XFillTransparenceItem(
- sal_uInt16(100 - ::rtl::math::round(nTrans))));
- }
-
- if ( ( eMSO_FillType == mso_fillShadeCenter ) && ( eXFill == XFILL_BITMAP ) )
- {
- ApplyRectangularGradientAsBitmap( rManager, rIn, rSet, aShadeColors, rObjData, mnFix16Angle );
- }
- else if ( eXFill == XFILL_GRADIENT )
- {
- sal_Int32 nAngle = 3600 - ( ( Fix16ToAngle( GetPropertyValue( DFF_Prop_fillAngle, 0 ) ) + 5 ) / 10 );
-
- // Rotationswinkel in Bereich zwingen
- while ( nAngle >= 3600 )
- nAngle -= 3600;
- while ( nAngle < 0 )
- nAngle += 3600;
-
- sal_Int32 nFocus = GetPropertyValue( DFF_Prop_fillFocus, 0 );
- XGradientStyle eGrad = XGRAD_LINEAR;
- sal_Int32 nChgColors = 0;
-
- if ( nFocus < 0 ) // Bei negativem Focus sind die Farben zu tauschen
- {
- nFocus =- nFocus;
- nChgColors ^= 1;
- }
- if( nFocus > 40 && nFocus < 60 )
- {
- eGrad = XGRAD_AXIAL; // Besser gehts leider nicht
- }
-
- USHORT nFocusX = (USHORT)nFocus;
- USHORT nFocusY = (USHORT)nFocus;
-
- switch( eMSO_FillType )
- {
- case mso_fillShadeShape :
- {
- eGrad = XGRAD_RECT;
- nFocusY = nFocusX = 50;
- nChgColors ^= 1;
- }
- break;
- case mso_fillShadeCenter :
- {
- eGrad = XGRAD_RECT;
- nFocusX = ( IsProperty( DFF_Prop_fillToRight ) ) ? 100 : 0;
- nFocusY = ( IsProperty( DFF_Prop_fillToBottom ) ) ? 100 : 0;
- nChgColors ^= 1;
- }
- break;
- default: break;
- }
- Color aCol1( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ) );
- Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ) );
-
- if ( nChgColors )
- {
- Color aZwi( aCol1 );
- aCol1 = aCol2;
- aCol2 = aZwi;
- }
- XGradient aGrad( aCol2, aCol1, eGrad, nAngle, nFocusX, nFocusY );
- aGrad.SetStartIntens( 100 );
- aGrad.SetEndIntens( 100 );
- rSet.Put( XFillGradientItem( String(), aGrad ) );
- }
- else if ( eXFill == XFILL_BITMAP )
- {
- if( IsProperty( DFF_Prop_fillBlip ) )
- {
- Graphic aGraf;
- // first try to get BLIP from cache
- BOOL bOK = rManager.GetBLIP( GetPropertyValue( DFF_Prop_fillBlip ), aGraf, NULL );
- // then try directly from stream (i.e. Excel chart hatches/bitmaps)
- if ( !bOK )
- bOK = SeekToContent( DFF_Prop_fillBlip, rIn ) && rManager.GetBLIPDirect( rIn, aGraf, NULL );
- if ( bOK )
- {
- Bitmap aBmp( aGraf.GetBitmap() );
-
- if ( eMSO_FillType == mso_fillPattern )
- {
- Color aCol1( COL_WHITE ), aCol2( COL_WHITE );
- if ( IsProperty( DFF_Prop_fillColor ) )
- aCol1 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor );
- if ( IsProperty( DFF_Prop_fillBackColor ) )
- aCol2 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor ), DFF_Prop_fillBackColor );
-
- XOBitmap aXOBitmap;
-
- // Bitmap einsetzen
- aXOBitmap.SetBitmap( aBmp );
- aXOBitmap.SetBitmapType( XBITMAP_IMPORT );
-
- if( aBmp.GetSizePixel().Width() == 8 && aBmp.GetSizePixel().Height() == 8 && aBmp.GetColorCount() == 2)
- {
- aXOBitmap.Bitmap2Array();
- aXOBitmap.SetBitmapType( XBITMAP_8X8 );
- aXOBitmap.SetPixelSize( aBmp.GetSizePixel() );
-
- if( aXOBitmap.GetBackgroundColor() == COL_BLACK )
- {
- aXOBitmap.SetPixelColor( aCol1 );
- aXOBitmap.SetBackgroundColor( aCol2 );
- }
- else
- {
- aXOBitmap.SetPixelColor( aCol2 );
- aXOBitmap.SetBackgroundColor( aCol1 );
- }
- }
- rSet.Put( XFillBitmapItem( String(), aXOBitmap ) );
- }
- else if ( eMSO_FillType == mso_fillTexture )
- {
- XOBitmap aXBmp( aBmp, XBITMAP_STRETCH );
- rSet.Put( XFillBmpTileItem( sal_True ) );
- rSet.Put( XFillBitmapItem( String(), aXBmp ) );
- rSet.Put( XFillBmpSizeXItem( GetPropertyValue( DFF_Prop_fillWidth, 0 ) / 360 ) );
- rSet.Put( XFillBmpSizeYItem( GetPropertyValue( DFF_Prop_fillHeight, 0 ) / 360 ) );
- rSet.Put( XFillBmpSizeLogItem( sal_True ) );
- }
- else
- {
- XOBitmap aXBmp( aBmp, XBITMAP_STRETCH );
- rSet.Put( XFillBitmapItem( String(), aXBmp ) );
- rSet.Put( XFillBmpTileItem( sal_False ) );
- }
- }
- }
- }
- }
- else
- rSet.Put( XFillStyleItem( XFILL_NONE ) );
-}
-
-void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
-{
-// sal_uInt32 nTextFlags = aTextObj.GetTextFlags();
- sal_Bool bVerticalText = sal_False;
- sal_Int32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 25 * 3600 ) / 360; // 0.25 cm (emu)
- sal_Int32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 25 * 3600 ) / 360; // 0.25 cm (emu)
- sal_Int32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 13 * 3600 ) / 360; // 0.13 cm (emu)
- sal_Int32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 13 * 3600 ) /360; // 0.13 cm (emu)
-
- SdrTextVertAdjust eTVA;
- SdrTextHorzAdjust eTHA;
-
- if ( IsProperty( DFF_Prop_txflTextFlow ) )
- {
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
- switch( eTextFlow )
- {
- case mso_txflTtoBA : /* #68110# */ // Top to Bottom @-font, oben -> unten
- case mso_txflTtoBN : // Top to Bottom non-@, oben -> unten
- case mso_txflVertN : // Vertical, non-@, oben -> unten
- bVerticalText = sal_True; // nTextRotationAngle += 27000;
- break;
- default: break;
- }
- }
- sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 );
- if ( ( nFontDirection == 1 ) || ( nFontDirection == 3 ) )
- bVerticalText = !bVerticalText;
-
- if ( bVerticalText )
- {
- eTVA = SDRTEXTVERTADJUST_BLOCK;
- eTHA = SDRTEXTHORZADJUST_CENTER;
-
- // Textverankerung lesen
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- case mso_anchorTopCentered:
- case mso_anchorTopBaseline:
- case mso_anchorTopCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_RIGHT;
- break;
-
- case mso_anchorMiddle :
- case mso_anchorMiddleCentered:
- eTHA = SDRTEXTHORZADJUST_CENTER;
- break;
-
- case mso_anchorBottom:
- case mso_anchorBottomCentered:
- case mso_anchorBottomBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_LEFT;
- break;
- }
- // if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
- switch ( eTextAnchor )
- {
- case mso_anchorTopCentered :
- case mso_anchorMiddleCentered :
- case mso_anchorBottomCentered :
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_CENTER;
- break;
-
- default :
- eTVA = SDRTEXTVERTADJUST_TOP;
- break;
- }
- }
- else
- {
- eTVA = SDRTEXTVERTADJUST_CENTER;
- eTHA = SDRTEXTHORZADJUST_BLOCK;
-
- // Textverankerung lesen
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- case mso_anchorTopCentered:
- case mso_anchorTopBaseline:
- case mso_anchorTopCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_TOP;
- break;
-
- case mso_anchorMiddle :
- case mso_anchorMiddleCentered:
- eTVA = SDRTEXTVERTADJUST_CENTER;
- break;
-
- case mso_anchorBottom:
- case mso_anchorBottomCentered:
- case mso_anchorBottomBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- break;
- }
- // if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
- switch ( eTextAnchor )
- {
- case mso_anchorTopCentered :
- case mso_anchorMiddleCentered :
- case mso_anchorBottomCentered :
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
- break;
-
- default :
- eTHA = SDRTEXTHORZADJUST_LEFT;
- break;
- }
- }
- rSet.Put( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
-
- rSet.Put( SdrTextVertAdjustItem( eTVA ) );
- rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
-
- rSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- rSet.Put( SdrTextRightDistItem( nTextRight ) );
- rSet.Put( SdrTextUpperDistItem( nTextTop ) );
- rSet.Put( SdrTextLowerDistItem( nTextBottom ) );
-
- rSet.Put( SdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
- rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
-
-// rSet.Put( SdrTextAutoGrowWidthItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_False : sal_True ) );
-// rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
-}
-
-void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
-{
-
- sal_uInt32 nAdjustmentsWhichNeedsToBeConverted = 0;
-
- ///////////////////////////////////////
- // creating SdrCustomShapeGeometryItem //
- ///////////////////////////////////////
- typedef uno::Sequence< beans::PropertyValue > PropSeq;
- typedef std::vector< beans::PropertyValue > PropVec;
- typedef PropVec::iterator PropVecIter;
- PropVecIter aIter;
- PropVecIter aEnd;
-
-
- // aPropVec will be filled with all PropertyValues
- PropVec aPropVec;
- PropertyValue aProp;
-
- /////////////////////////////////////////////////////////////////////
- // "Type" property, including the predefined CustomShape type name //
- /////////////////////////////////////////////////////////////////////
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- aProp.Name = sType;
- aProp.Value <<= EnhancedCustomShapeTypeNames::Get( rObjData.eShapeType );
- aPropVec.push_back( aProp );
-
-/*
- /////////////////
- // "MirroredX" //
- /////////////////
- if ( nShapeFlags & SP_FFLIPH )
- {
- const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- sal_Bool bMirroredX = sal_True;
- aProp.Name = sMirroredX;
- aProp.Value <<= bMirroredX;
- aPropVec.push_back( aProp );
- }
- /////////////////
- // "MirroredY" //
- /////////////////
- if ( nShapeFlags & SP_FFLIPV )
- {
- const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- sal_Bool bMirroredY = sal_True;
- aProp.Name = sMirroredY;
- aProp.Value <<= bMirroredY;
- aPropVec.push_back( aProp );
- }
-*/
- ///////////////
- // "ViewBox" //
- ///////////////
-
- sal_Int32 nCoordWidth = 21600; // needed to replace handle type center with absolute value
- sal_Int32 nCoordHeight= 21600;
- if ( IsProperty( DFF_Prop_geoLeft ) || IsProperty( DFF_Prop_geoTop ) || IsProperty( DFF_Prop_geoRight ) || IsProperty( DFF_Prop_geoBottom ) )
- {
- com::sun::star::awt::Rectangle aViewBox;
- const rtl::OUString sViewBox( RTL_CONSTASCII_USTRINGPARAM ( "ViewBox" ) );
- aViewBox.X = GetPropertyValue( DFF_Prop_geoLeft, 0 );
- aViewBox.Y = GetPropertyValue( DFF_Prop_geoTop, 0 );
- aViewBox.Width = nCoordWidth = ((sal_Int32)GetPropertyValue( DFF_Prop_geoRight, 21600 ) ) - aViewBox.X;
- aViewBox.Height = nCoordHeight = ((sal_Int32)GetPropertyValue( DFF_Prop_geoBottom, 21600 ) ) - aViewBox.Y;
- aProp.Name = sViewBox;
- aProp.Value <<= aViewBox;
- aPropVec.push_back( aProp );
- }
- /////////////////////
- // TextRotateAngle //
- /////////////////////
- if ( IsProperty( DFF_Prop_txflTextFlow ) || IsProperty( DFF_Prop_cdirFont ) )
- {
- sal_Int32 nTextRotateAngle = 0;
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
-/* sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ); */
-
- if ( eTextFlow == mso_txflBtoT ) // Bottom to Top non-@, unten -> oben
- nTextRotateAngle += 90;
- switch( GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ) ) // SJ: mso_cdir90 and mso_cdir270 will be simulated by
- { // activating vertical writing for the text objects
- case mso_cdir90 :
- {
- if ( eTextFlow == mso_txflTtoBA )
- nTextRotateAngle -= 180;
- }
- break;
- case mso_cdir180: nTextRotateAngle -= 180; break;
- case mso_cdir270:
- {
- if ( eTextFlow != mso_txflTtoBA )
- nTextRotateAngle -= 180;
- }
- break;
- default: break;
- }
- if ( nTextRotateAngle )
- {
- double fTextRotateAngle = nTextRotateAngle;
- const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
- aProp.Name = sTextRotateAngle;
- aProp.Value <<= fTextRotateAngle;
- aPropVec.push_back( aProp );
- }
- }
- //////////////////////////////////////////
- // "Extrusion" PropertySequence element //
- //////////////////////////////////////////
- sal_Bool bExtrusionOn = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 8 ) != 0;
- if ( bExtrusionOn )
- {
- PropVec aExtrusionPropVec;
-
- // "Extrusion"
- const rtl::OUString sExtrusionOn( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- aProp.Name = sExtrusionOn;
- aProp.Value <<= bExtrusionOn;
- aExtrusionPropVec.push_back( aProp );
-
- // "Brightness"
- if ( IsProperty( DFF_Prop_c3DAmbientIntensity ) )
- {
- const rtl::OUString sExtrusionBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
- double fBrightness = (sal_Int32)GetPropertyValue( DFF_Prop_c3DAmbientIntensity );
- fBrightness /= 655.36;
- aProp.Name = sExtrusionBrightness;
- aProp.Value <<= fBrightness;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Depth" in 1/100mm
- if ( IsProperty( DFF_Prop_c3DExtrudeBackward ) || IsProperty( DFF_Prop_c3DExtrudeForward ) )
- {
- const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
- double fBackDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeBackward, 1270 * 360 )) / 360.0;
- double fForeDepth = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DExtrudeForward ), 0 ) / 360.0;
- double fDepth = fBackDepth + fForeDepth;
- double fFraction = fDepth != 0.0 ? fForeDepth / fDepth : 0;
- EnhancedCustomShapeParameterPair aDepthParaPair;
- aDepthParaPair.First.Value <<= fDepth;
- aDepthParaPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aDepthParaPair.Second.Value <<= fFraction;
- aDepthParaPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sDepth;
- aProp.Value <<= aDepthParaPair;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Diffusion"
- if ( IsProperty( DFF_Prop_c3DDiffuseAmt ) )
- {
- const rtl::OUString sExtrusionDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
- double fDiffusion = (sal_Int32)GetPropertyValue( DFF_Prop_c3DDiffuseAmt );
- fDiffusion /= 655.36;
- aProp.Name = sExtrusionDiffusion;
- aProp.Value <<= fDiffusion;
- aExtrusionPropVec.push_back( aProp );
- }
- // "NumberOfLineSegments"
- if ( IsProperty( DFF_Prop_c3DTolerance ) )
- {
- const rtl::OUString sExtrusionNumberOfLineSegments( RTL_CONSTASCII_USTRINGPARAM ( "NumberOfLineSegments" ) );
- aProp.Name = sExtrusionNumberOfLineSegments;
- aProp.Value <<= (sal_Int32)GetPropertyValue( DFF_Prop_c3DTolerance );
- aExtrusionPropVec.push_back( aProp );
- }
- // "LightFace"
- const rtl::OUString sExtrusionLightFace( RTL_CONSTASCII_USTRINGPARAM ( "LightFace" ) );
- sal_Bool bExtrusionLightFace = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 1 ) != 0;
- aProp.Name = sExtrusionLightFace;
- aProp.Value <<= bExtrusionLightFace;
- aExtrusionPropVec.push_back( aProp );
- // "FirstLightHarsh"
- const rtl::OUString sExtrusionFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) );
- sal_Bool bExtrusionFirstLightHarsh = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 2 ) != 0;
- aProp.Name = sExtrusionFirstLightHarsh;
- aProp.Value <<= bExtrusionFirstLightHarsh;
- aExtrusionPropVec.push_back( aProp );
- // "SecondLightHarsh"
- const rtl::OUString sExtrusionSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) );
- sal_Bool bExtrusionSecondLightHarsh = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 1 ) != 0;
- aProp.Name = sExtrusionSecondLightHarsh;
- aProp.Value <<= bExtrusionSecondLightHarsh;
- aExtrusionPropVec.push_back( aProp );
- // "FirstLightLevel"
- if ( IsProperty( DFF_Prop_c3DKeyIntensity ) )
- {
- const rtl::OUString sExtrusionFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) );
- double fFirstLightLevel = (sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyIntensity );
- fFirstLightLevel /= 655.36;
- aProp.Name = sExtrusionFirstLightLevel;
- aProp.Value <<= fFirstLightLevel;
- aExtrusionPropVec.push_back( aProp );
- }
- // "SecondLightLevel"
- if ( IsProperty( DFF_Prop_c3DFillIntensity ) )
- {
- const rtl::OUString sExtrusionSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) );
- double fSecondLightLevel = (sal_Int32)GetPropertyValue( DFF_Prop_c3DFillIntensity );
- fSecondLightLevel /= 655.36;
- aProp.Name = sExtrusionSecondLightLevel;
- aProp.Value <<= fSecondLightLevel;
- aExtrusionPropVec.push_back( aProp );
- }
- // "FirtstLightDirection"
- if ( IsProperty( DFF_Prop_c3DKeyX ) || IsProperty( DFF_Prop_c3DKeyY ) || IsProperty( DFF_Prop_c3DKeyZ ) )
- {
- double fLightX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyX, 50000 ));
- double fLightY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyY, 0 ));
- double fLightZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DKeyZ, 10000 ));
- ::com::sun::star::drawing::Direction3D aExtrusionFirstLightDirection( fLightX, fLightY, fLightZ );
- const rtl::OUString sExtrusionFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
- aProp.Name = sExtrusionFirstLightDirection;
- aProp.Value <<= aExtrusionFirstLightDirection;
- aExtrusionPropVec.push_back( aProp );
- }
- // "SecondLightDirection"
- if ( IsProperty( DFF_Prop_c3DFillX ) || IsProperty( DFF_Prop_c3DFillY ) || IsProperty( DFF_Prop_c3DFillZ ) )
- {
- double fLight2X = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillX, (sal_uInt32)-50000 ));
- double fLight2Y = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillY, 0 ));
- double fLight2Z = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DFillZ, 10000 ));
- ::com::sun::star::drawing::Direction3D aExtrusionSecondLightDirection( fLight2X, fLight2Y, fLight2Z );
- const rtl::OUString sExtrusionSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
- aProp.Name = sExtrusionSecondLightDirection;
- aProp.Value <<= aExtrusionSecondLightDirection;
- aExtrusionPropVec.push_back( aProp );
- }
-
-/* LockRotationCenter, OrientationAngle and Orientation needs to be converted to use the properties AngleX, AngleY and RotationAngle instead.
- // "LockRotationCenter"
- const rtl::OUString sExtrusionLockRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "LockRotationCenter" ) );
- sal_Bool bExtrusionLockRotationCenter = ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 16 ) != 0;
- aProp.Name = sExtrusionLockRotationCenter;
- aProp.Value <<= bExtrusionLockRotationCenter;
- aExtrusionPropVec.push_back( aProp );
-
- // "Orientation"
- if ( IsProperty( DFF_Prop_c3DRotationAxisX ) || IsProperty( DFF_Prop_c3DRotationAxisY ) || IsProperty( DFF_Prop_c3DRotationAxisZ ) )
- {
- double fRotX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisX, 100 ));
- double fRotY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisY, 0 ));
- double fRotZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAxisZ, 0 ));
- ::com::sun::star::drawing::Direction3D aExtrusionDirection( fRotX, fRotY, fRotZ );
- const rtl::OUString sExtrusionDirection( RTL_CONSTASCII_USTRINGPARAM ( "Orientation" ) );
- aProp.Name = sExtrusionDirection;
- aProp.Value <<= aExtrusionDirection;
- aExtrusionPropVec.push_back( aProp );
- }
- // "OrientationAngle" in Grad
- if ( IsProperty( DFF_Prop_c3DRotationAngle ) )
- {
- const rtl::OUString sExtrusionOrientationAngle( RTL_CONSTASCII_USTRINGPARAM ( "OrientationAngle" ) );
- double fOrientationAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationAngle )) / 65536.0;
- aProp.Name = sExtrusionOrientationAngle;
- aProp.Value <<= fOrientationAngle;
- aExtrusionPropVec.push_back( aProp );
- }
-*/
-
- // "Metal"
- const rtl::OUString sExtrusionMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
- sal_Bool bExtrusionMetal = ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 4 ) != 0;
- aProp.Name = sExtrusionMetal;
- aProp.Value <<= bExtrusionMetal;
- aExtrusionPropVec.push_back( aProp );
-// if ( IsProperty( DFF_Prop_c3DExtrudePlane ) )
-// {
-// UPS
-// }
- // "ShadeMode"
- if ( IsProperty( DFF_Prop_c3DRenderMode ) )
- {
- const rtl::OUString sExtrusionShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
- sal_uInt32 nExtrusionRenderMode = GetPropertyValue( DFF_Prop_c3DRenderMode );
- com::sun::star::drawing::ShadeMode eExtrusionShadeMode( com::sun::star::drawing::ShadeMode_FLAT );
- if ( nExtrusionRenderMode == mso_Wireframe )
- eExtrusionShadeMode = com::sun::star::drawing::ShadeMode_DRAFT;
-
- aProp.Name = sExtrusionShadeMode;
- aProp.Value <<= eExtrusionShadeMode;
- aExtrusionPropVec.push_back( aProp );
- }
- // "RotateAngle" in Grad
- if ( IsProperty( DFF_Prop_c3DXRotationAngle ) || IsProperty( DFF_Prop_c3DYRotationAngle ) )
- {
- const rtl::OUString sExtrusionAngle( RTL_CONSTASCII_USTRINGPARAM ( "RotateAngle" ) );
- double fAngleX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DXRotationAngle, 0 )) / 65536.0;
- double fAngleY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DYRotationAngle, 0 )) / 65536.0;
- EnhancedCustomShapeParameterPair aRotateAnglePair;
- aRotateAnglePair.First.Value <<= fAngleX;
- aRotateAnglePair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aRotateAnglePair.Second.Value <<= fAngleY;
- aRotateAnglePair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sExtrusionAngle;
- aProp.Value <<= aRotateAnglePair;
- aExtrusionPropVec.push_back( aProp );
- }
-
- // "AutoRotationCenter"
- if ( ( GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 8 ) == 0 )
- {
- // "RotationCenter"
- if ( IsProperty( DFF_Prop_c3DRotationCenterX ) || IsProperty( DFF_Prop_c3DRotationCenterY ) || IsProperty( DFF_Prop_c3DRotationCenterZ ) )
- {
- ::com::sun::star::drawing::Direction3D aRotationCenter(
- (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterX, 0 )) / 360.0,
- (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterY, 0 )) / 360.0,
- (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DRotationCenterZ, 0 )) / 360.0 );
-
- const rtl::OUString sExtrusionRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "RotationCenter" ) );
- aProp.Name = sExtrusionRotationCenter;
- aProp.Value <<= aRotationCenter;
- aExtrusionPropVec.push_back( aProp );
- }
- }
- // "Shininess"
- if ( IsProperty( DFF_Prop_c3DShininess ) )
- {
- const rtl::OUString sExtrusionShininess( RTL_CONSTASCII_USTRINGPARAM ( "Shininess" ) );
- double fShininess = (sal_Int32)GetPropertyValue( DFF_Prop_c3DShininess );
- fShininess /= 655.36;
- aProp.Name = sExtrusionShininess;
- aProp.Value <<= fShininess;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Skew"
- if ( IsProperty( DFF_Prop_c3DSkewAmount ) || IsProperty( DFF_Prop_c3DSkewAngle ) )
- {
- const rtl::OUString sExtrusionSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
- double fSkewAmount = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAmount, 50 );
- double fSkewAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< UINT32 >(-135 * 65536) )) / 65536.0;
-
- EnhancedCustomShapeParameterPair aSkewPair;
- aSkewPair.First.Value <<= fSkewAmount;
- aSkewPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aSkewPair.Second.Value <<= fSkewAngle;
- aSkewPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sExtrusionSkew;
- aProp.Value <<= aSkewPair;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Specularity"
- if ( IsProperty( DFF_Prop_c3DSpecularAmt ) )
- {
- const rtl::OUString sExtrusionSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
- double fSpecularity = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSpecularAmt );
- fSpecularity /= 1333;
- aProp.Name = sExtrusionSpecularity;
- aProp.Value <<= fSpecularity;
- aExtrusionPropVec.push_back( aProp );
- }
- // "ProjectionMode"
- const rtl::OUString sExtrusionProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
- ProjectionMode eProjectionMode = GetPropertyValue( DFF_Prop_fc3DFillHarsh ) & 4 ? ProjectionMode_PARALLEL : ProjectionMode_PERSPECTIVE;
- aProp.Name = sExtrusionProjectionMode;
- aProp.Value <<= eProjectionMode;
- aExtrusionPropVec.push_back( aProp );
-
- // "ViewPoint" in 1/100mm
- if ( IsProperty( DFF_Prop_c3DXViewpoint ) || IsProperty( DFF_Prop_c3DYViewpoint ) || IsProperty( DFF_Prop_c3DZViewpoint ) )
- {
- double fViewX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DXViewpoint, 1249920 )) / 360.0;
- double fViewY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DYViewpoint, (sal_uInt32)-1249920 ))/ 360.0;
- double fViewZ = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DZViewpoint, 9000000 )) / 360.0;
- ::com::sun::star::drawing::Position3D aExtrusionViewPoint( fViewX, fViewY, fViewZ );
- const rtl::OUString sExtrusionViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
- aProp.Name = sExtrusionViewPoint;
- aProp.Value <<= aExtrusionViewPoint;
- aExtrusionPropVec.push_back( aProp );
- }
- // "Origin"
- if ( IsProperty( DFF_Prop_c3DOriginX ) || IsProperty( DFF_Prop_c3DOriginY ) )
- {
- const rtl::OUString sExtrusionOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) );
- double fOriginX = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DOriginX, 0 ));
- double fOriginY = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DOriginY, 0 ));
- fOriginX /= 65536;
- fOriginY /= 65536;
- EnhancedCustomShapeParameterPair aOriginPair;
- aOriginPair.First.Value <<= fOriginX;
- aOriginPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
- aOriginPair.Second.Value <<= fOriginY;
- aOriginPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
- aProp.Name = sExtrusionOrigin;
- aProp.Value <<= aOriginPair;
- aExtrusionPropVec.push_back( aProp );
- }
- // "ExtrusionColor"
- const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
- sal_Bool bExtrusionColor = IsProperty( DFF_Prop_c3DExtrusionColor ); // ( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 2 ) != 0;
- aProp.Name = sExtrusionColor;
- aProp.Value <<= bExtrusionColor;
- aExtrusionPropVec.push_back( aProp );
- if ( IsProperty( DFF_Prop_c3DExtrusionColor ) )
- rSet.Put( XSecondaryFillColorItem( String(), rManager.MSO_CLR_ToColor(
- GetPropertyValue( DFF_Prop_c3DExtrusionColor ), DFF_Prop_c3DExtrusionColor ) ) );
- // pushing the whole Extrusion element
- const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- PropSeq aExtrusionPropSeq( aExtrusionPropVec.size() );
- aIter = aExtrusionPropVec.begin();
- aEnd = aExtrusionPropVec.end();
- beans::PropertyValue* pExtrusionValues = aExtrusionPropSeq.getArray();
- while ( aIter != aEnd )
- *pExtrusionValues++ = *aIter++;
- aProp.Name = sExtrusion;
- aProp.Value <<= aExtrusionPropSeq;
- aPropVec.push_back( aProp );
- }
-
- /////////////////////////////////////////
- // "Equations" PropertySequence element //
- /////////////////////////////////////////
- if ( IsProperty( DFF_Prop_pFormulas ) )
- {
- sal_uInt16 i;
- sal_uInt16 nNumElem = 0;
- sal_uInt16 nNumElemMem = 0;
- sal_uInt16 nElemSize = 8;
-
- if ( SeekToContent( DFF_Prop_pFormulas, rIn ) )
- rIn >> nNumElem >> nNumElemMem >> nElemSize;
-
- sal_Int16 nP1, nP2, nP3;
- sal_uInt16 nFlags;
-
- uno::Sequence< rtl::OUString > aEquations( nNumElem );
- for ( i = 0; i < nNumElem; i++ )
- {
- rIn >> nFlags >> nP1 >> nP2 >> nP3;
- aEquations[ i ] = EnhancedCustomShape2d::GetEquation( nFlags, nP1, nP2, nP3 );
- }
- // pushing the whole Equations element
- const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM ( "Equations" ) );
- aProp.Name = sEquations;
- aProp.Value <<= aEquations;
- aPropVec.push_back( aProp );
- }
-
- ////////////////////////////////////////
- // "Handles" PropertySequence element //
- ////////////////////////////////////////
- if ( IsProperty( DFF_Prop_Handles ) )
- {
- sal_uInt16 i;
- sal_uInt16 nNumElem = 0;
- sal_uInt16 nNumElemMem = 0;
- sal_uInt16 nElemSize = 36;
-
- if ( SeekToContent( DFF_Prop_Handles, rIn ) )
- rIn >> nNumElem >> nNumElemMem >> nElemSize;
- if ( nElemSize == 36 )
- {
- uno::Sequence< beans::PropertyValues > aHandles( nNumElem );
- for ( i = 0; i < nNumElem; i++ )
- {
- PropVec aHandlePropVec;
- sal_uInt32 nFlags;
- sal_Int32 nPositionX, nPositionY, nCenterX, nCenterY, nRangeXMin, nRangeXMax, nRangeYMin, nRangeYMax;
- rIn >> nFlags
- >> nPositionX
- >> nPositionY
- >> nCenterX
- >> nCenterY
- >> nRangeXMin
- >> nRangeXMax
- >> nRangeYMin
- >> nRangeYMax;
-
- if ( nPositionX == 2 ) // replacing center position with absolute value
- nPositionX = nCoordWidth / 2;
- if ( nPositionY == 2 )
- nPositionY = nCoordHeight / 2;
- EnhancedCustomShapeParameterPair aPosition;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, nPositionX, sal_True, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, nPositionY, sal_True, sal_False );
- const rtl::OUString sHandlePosition( RTL_CONSTASCII_USTRINGPARAM ( "Position" ) );
- aProp.Name = sHandlePosition;
- aProp.Value <<= aPosition;
- aHandlePropVec.push_back( aProp );
-
- if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_X )
- {
- sal_Bool bMirroredX = sal_True;
- const rtl::OUString sHandleMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- aProp.Name = sHandleMirroredX;
- aProp.Value <<= bMirroredX;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_Y )
- {
- sal_Bool bMirroredY = sal_True;
- const rtl::OUString sHandleMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- aProp.Name = sHandleMirroredY;
- aProp.Value <<= bMirroredY;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_SWITCHED )
- {
- sal_Bool bSwitched = sal_True;
- const rtl::OUString sHandleSwitched( RTL_CONSTASCII_USTRINGPARAM ( "Switched" ) );
- aProp.Name = sHandleSwitched;
- aProp.Value <<= bSwitched;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( nCenterX == 2 )
- nCenterX = nCoordWidth / 2;
- if ( nCenterY == 2 )
- nCenterY = nCoordHeight / 2;
- if ( ( nPositionY >= 0x256 ) || ( nPositionY <= 0x107 ) ) // position y
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << i );
- EnhancedCustomShapeParameterPair aPolar;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPolar.First, nCenterX, ( nFlags & 0x800 ) != 0, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPolar.Second, nCenterY, ( nFlags & 0x1000 ) != 0, sal_False );
- const rtl::OUString sHandlePolar( RTL_CONSTASCII_USTRINGPARAM ( "Polar" ) );
- aProp.Name = sHandlePolar;
- aProp.Value <<= aPolar;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_MAP )
- {
- if ( nCenterX == 2 )
- nCenterX = nCoordWidth / 2;
- if ( nCenterY == 2 )
- nCenterY = nCoordHeight / 2;
- EnhancedCustomShapeParameterPair aMap;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aMap.First, nCenterX, ( nFlags & 0x800 ) != 0, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aMap.Second, nCenterY, ( nFlags & 0x1000 ) != 0, sal_False );
- const rtl::OUString sHandleMap( RTL_CONSTASCII_USTRINGPARAM ( "Map" ) );
- aProp.Name = sHandleMap;
- aProp.Value <<= aMap;
- aHandlePropVec.push_back( aProp );
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_RANGE )
- {
- if ( (sal_uInt32)nRangeXMin != 0x80000000 )
- {
- if ( nRangeXMin == 2 )
- nRangeXMin = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRangeXMinimum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMinimum, nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
- const rtl::OUString sHandleRangeXMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMinimum" ) );
- aProp.Name = sHandleRangeXMinimum;
- aProp.Value <<= aRangeXMinimum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeXMax != 0x7fffffff )
- {
- if ( nRangeXMax == 2 )
- nRangeXMax = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRangeXMaximum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMaximum, nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
- const rtl::OUString sHandleRangeXMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMaximum" ) );
- aProp.Name = sHandleRangeXMaximum;
- aProp.Value <<= aRangeXMaximum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeYMin != 0x80000000 )
- {
- if ( nRangeYMin == 2 )
- nRangeYMin = nCoordHeight / 2;
- EnhancedCustomShapeParameter aRangeYMinimum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMinimum, nRangeYMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, sal_True );
- const rtl::OUString sHandleRangeYMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMinimum" ) );
- aProp.Name = sHandleRangeYMinimum;
- aProp.Value <<= aRangeYMinimum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeYMax != 0x7fffffff )
- {
- if ( nRangeYMax == 2 )
- nRangeYMax = nCoordHeight / 2;
- EnhancedCustomShapeParameter aRangeYMaximum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMaximum, nRangeYMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, sal_False );
- const rtl::OUString sHandleRangeYMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMaximum" ) );
- aProp.Name = sHandleRangeYMaximum;
- aProp.Value <<= aRangeYMaximum;
- aHandlePropVec.push_back( aProp );
- }
- }
- if ( nFlags & MSDFF_HANDLE_FLAGS_RADIUS_RANGE )
- {
- if ( (sal_uInt32)nRangeXMin != 0x7fffffff )
- {
- if ( nRangeXMin == 2 )
- nRangeXMin = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRadiusRangeMinimum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMinimum, nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
- const rtl::OUString sHandleRadiusRangeMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMinimum" ) );
- aProp.Name = sHandleRadiusRangeMinimum;
- aProp.Value <<= aRadiusRangeMinimum;
- aHandlePropVec.push_back( aProp );
- }
- if ( (sal_uInt32)nRangeXMax != 0x80000000 )
- {
- if ( nRangeXMax == 2 )
- nRangeXMax = nCoordWidth / 2;
- EnhancedCustomShapeParameter aRadiusRangeMaximum;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMaximum, nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
- const rtl::OUString sHandleRadiusRangeMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMaximum" ) );
- aProp.Name = sHandleRadiusRangeMaximum;
- aProp.Value <<= aRadiusRangeMaximum;
- aHandlePropVec.push_back( aProp );
- }
- }
- if ( aHandlePropVec.size() )
- {
- PropSeq aHandlePropSeq( aHandlePropVec.size() );
- aIter = aHandlePropVec.begin();
- aEnd = aHandlePropVec.end();
- beans::PropertyValue* pHandleValues = aHandlePropSeq.getArray();
- while ( aIter != aEnd )
- *pHandleValues++ = *aIter++;
- aHandles[ i ] = aHandlePropSeq;
- }
- }
- // pushing the whole Handles element
- const rtl::OUString sHandles( RTL_CONSTASCII_USTRINGPARAM ( "Handles" ) );
- aProp.Name = sHandles;
- aProp.Value <<= aHandles;
- aPropVec.push_back( aProp );
- }
- }
- else
- {
- const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( rObjData.eShapeType );
- if ( pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles )
- {
- sal_Int32 i, nCnt = pDefCustomShape->nHandles;
- const SvxMSDffHandle* pData = pDefCustomShape->pHandles;
- for ( i = 0; i < nCnt; i++, pData++ )
- {
- if ( pData->nFlags & MSDFF_HANDLE_FLAGS_POLAR )
- {
- if ( ( pData->nPositionY >= 0x256 ) || ( pData->nPositionY <= 0x107 ) )
- nAdjustmentsWhichNeedsToBeConverted |= ( 1 << i );
- }
- }
- }
- }
- /////////////////////////////////////
- // "Path" PropertySequence element //
- /////////////////////////////////////
- {
- PropVec aPathPropVec;
-
- // "Path/ExtrusionAllowed"
- if ( IsHardAttribute( DFF_Prop_f3DOK ) )
- {
- const rtl::OUString sExtrusionAllowed( RTL_CONSTASCII_USTRINGPARAM ( "ExtrusionAllowed" ) );
- sal_Bool bExtrusionAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 16 ) != 0;
- aProp.Name = sExtrusionAllowed;
- aProp.Value <<= bExtrusionAllowed;
- aPathPropVec.push_back( aProp );
- }
- // "Path/ConcentricGradientFillAllowed"
- if ( IsHardAttribute( DFF_Prop_fFillShadeShapeOK ) )
- {
- const rtl::OUString sConcentricGradientFillAllowed( RTL_CONSTASCII_USTRINGPARAM ( "ConcentricGradientFillAllowed" ) );
- sal_Bool bConcentricGradientFillAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 2 ) != 0;
- aProp.Name = sConcentricGradientFillAllowed;
- aProp.Value <<= bConcentricGradientFillAllowed;
- aPathPropVec.push_back( aProp );
- }
- // "Path/TextPathAllowed"
- if ( IsHardAttribute( DFF_Prop_fGtextOK ) || ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) )
- {
- const rtl::OUString sTextPathAllowed( RTL_CONSTASCII_USTRINGPARAM ( "TextPathAllowed" ) );
- sal_Bool bTextPathAllowed = ( GetPropertyValue( DFF_Prop_fFillOK ) & 4 ) != 0;
- aProp.Name = sTextPathAllowed;
- aProp.Value <<= bTextPathAllowed;
- aPathPropVec.push_back( aProp );
- }
- // Path/Coordinates
- if ( IsProperty( DFF_Prop_pVertices ) )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates;
-
- sal_uInt16 i;
- sal_uInt16 nNumElemVert = 0;
- sal_uInt16 nNumElemMemVert = 0;
- sal_uInt16 nElemSizeVert = 8;
-
- if ( SeekToContent( DFF_Prop_pVertices, rIn ) )
- rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
- if ( nNumElemVert )
- {
- sal_Int32 nX, nY;
- sal_Int16 nTmpA, nTmpB;
- aCoordinates.realloc( nNumElemVert );
- for ( i = 0; i < nNumElemVert; i++ )
- {
- if ( nElemSizeVert == 8 )
- {
- rIn >> nX
- >> nY;
- }
- else
- {
- rIn >> nTmpA
- >> nTmpB;
-
- nX = nTmpA;
- nY = nTmpB;
- }
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].First, nX );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].Second, nY );
- }
- }
- const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
- aProp.Name = sCoordinates;
- aProp.Value <<= aCoordinates;
- aPathPropVec.push_back( aProp );
- }
- // Path/Segments
- if ( IsProperty( DFF_Prop_pSegmentInfo ) )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeSegment > aSegments;
-
- sal_uInt16 i, nTmp;
- sal_uInt16 nNumElemSeg = 0;
- sal_uInt16 nNumElemMemSeg = 0;
- sal_uInt16 nElemSizeSeg = 2;
-
- if ( SeekToContent( DFF_Prop_pSegmentInfo, rIn ) )
- rIn >> nNumElemSeg >> nNumElemMemSeg >> nElemSizeSeg;
- if ( nNumElemSeg )
- {
- sal_Int16 nCommand;
- sal_Int16 nCnt;
- aSegments.realloc( nNumElemSeg );
- for ( i = 0; i < nNumElemSeg; i++ )
- {
- rIn >> nTmp;
- nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN;
- nCnt = (sal_Int16)( nTmp & 0xfff );
- switch( nTmp >> 12 )
- {
- case 0x0: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break;
- case 0x1: nCommand = EnhancedCustomShapeSegmentCommand::LINETO; if ( !nCnt ) nCnt = 1; break; // seems to the relative lineto
- case 0x4: nCommand = EnhancedCustomShapeSegmentCommand::MOVETO; if ( !nCnt ) nCnt = 1; break;
- case 0x2: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break;
- case 0x3: nCommand = EnhancedCustomShapeSegmentCommand::CURVETO; if ( !nCnt ) nCnt = 1; break; // seems to be the relative curveto
- case 0x8: nCommand = EnhancedCustomShapeSegmentCommand::ENDSUBPATH; nCnt = 0; break;
- case 0x6: nCommand = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; nCnt = 0; break;
- case 0xa:
- case 0xb:
- {
- switch ( ( nTmp >> 8 ) & 0xf )
- {
- case 0x0:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::LINETO;
- if ( !nCnt )
- nCnt = 1;
- }
- break;
- case 0x1:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO;
- nCnt = ( nTmp & 0xff ) / 3;
- }
- break;
- case 0x2:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE;
- nCnt = ( nTmp & 0xff ) / 3;
- }
- break;
- case 0x3:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ARCTO;
- nCnt = ( nTmp & 0xff ) >> 2;
- };
- break;
- case 0x4:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ARC;
- nCnt = ( nTmp & 0xff ) >> 2;
- }
- break;
- case 0x5:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO;
- nCnt = ( nTmp & 0xff ) >> 2;
- }
- break;
- case 0x6:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::CLOCKWISEARC;
- nCnt = ( nTmp & 0xff ) >> 2;
- }
- break;
- case 0x7:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX;
- nCnt = nTmp & 0xff;
- }
- break;
- case 0x8:
- {
- nCommand = EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY;
- nCnt = nTmp & 0xff;
- }
- break;
- case 0xa: nCommand = EnhancedCustomShapeSegmentCommand::NOFILL; nCnt = 0; break;
- case 0xb: nCommand = EnhancedCustomShapeSegmentCommand::NOSTROKE; nCnt = 0; break;
- }
- }
- break;
- }
- // if the command is unknown, we will store all the data in nCnt, so it will be possible to export without loss
- if ( nCommand == EnhancedCustomShapeSegmentCommand::UNKNOWN )
- nCnt = (sal_Int16)nTmp;
- aSegments[ i ].Command = nCommand;
- aSegments[ i ].Count = nCnt;
- }
- }
- const rtl::OUString sSegments( RTL_CONSTASCII_USTRINGPARAM ( "Segments" ) );
- aProp.Name = sSegments;
- aProp.Value <<= aSegments;
- aPathPropVec.push_back( aProp );
- }
- // Path/StretchX
- if ( IsProperty( DFF_Prop_stretchPointX ) )
- {
- const rtl::OUString sStretchX( RTL_CONSTASCII_USTRINGPARAM ( "StretchX" ) );
- sal_Int32 nStretchX = GetPropertyValue( DFF_Prop_stretchPointX, 0 );
- aProp.Name = sStretchX;
- aProp.Value <<= nStretchX;
- aPathPropVec.push_back( aProp );
- }
- // Path/StretchX
- if ( IsProperty( DFF_Prop_stretchPointY ) )
- {
- const rtl::OUString sStretchY( RTL_CONSTASCII_USTRINGPARAM ( "StretchY" ) );
- sal_Int32 nStretchY = GetPropertyValue( DFF_Prop_stretchPointY, 0 );
- aProp.Name = sStretchY;
- aProp.Value <<= nStretchY;
- aPathPropVec.push_back( aProp );
- }
- // Path/TextFrames
- if ( IsProperty( DFF_Prop_textRectangles ) )
- {
- sal_uInt16 i;
- sal_uInt16 nNumElem = 0;
- sal_uInt16 nNumElemMem = 0;
- sal_uInt16 nElemSize = 16;
-
- if ( SeekToContent( DFF_Prop_textRectangles, rIn ) )
- rIn >> nNumElem >> nNumElemMem >> nElemSize;
- if ( nElemSize == 16 )
- {
- sal_Int32 nLeft, nTop, nRight, nBottom;
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames( nNumElem );
- for ( i = 0; i < nNumElem; i++ )
- {
- rIn >> nLeft
- >> nTop
- >> nRight
- >> nBottom;
-
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.First, nLeft );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.Second, nTop );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].BottomRight.First, nRight );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].BottomRight.Second, nBottom);
- }
- const rtl::OUString sTextFrames( RTL_CONSTASCII_USTRINGPARAM ( "TextFrames" ) );
- aProp.Name = sTextFrames;
- aProp.Value <<= aTextFrames;
- aPathPropVec.push_back( aProp );
- }
- }
- //Path/GluePoints
- if ( IsProperty( DFF_Prop_connectorPoints ) )
- {
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
-
- sal_uInt16 i;
- sal_uInt16 nNumElemVert = 0;
- sal_uInt16 nNumElemMemVert = 0;
- sal_uInt16 nElemSizeVert = 8;
-
- if ( SeekToContent( DFF_Prop_connectorPoints, rIn ) )
- rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
-
- sal_Int32 nX, nY;
- sal_Int16 nTmpA, nTmpB;
- aGluePoints.realloc( nNumElemVert );
- for ( i = 0; i < nNumElemVert; i++ )
- {
- if ( nElemSizeVert == 8 )
- {
- rIn >> nX
- >> nY;
- }
- else
- {
- rIn >> nTmpA
- >> nTmpB;
-
- nX = nTmpA;
- nY = nTmpB;
- }
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ i ].First, nX );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aGluePoints[ i ].Second, nY );
- }
- const rtl::OUString sGluePoints( RTL_CONSTASCII_USTRINGPARAM ( "GluePoints" ) );
- aProp.Name = sGluePoints;
- aProp.Value <<= aGluePoints;
- aPathPropVec.push_back( aProp );
- }
- if ( IsProperty( DFF_Prop_connectorType ) )
- {
- sal_Int16 nGluePointType = (sal_uInt16)GetPropertyValue( DFF_Prop_connectorType );
- const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM ( "GluePointType" ) );
- aProp.Name = sGluePointType;
- aProp.Value <<= nGluePointType;
- aPathPropVec.push_back( aProp );
- }
- // pushing the whole Path element
- if ( aPathPropVec.size() )
- {
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
- PropSeq aPathPropSeq( aPathPropVec.size() );
- aIter = aPathPropVec.begin();
- aEnd = aPathPropVec.end();
- beans::PropertyValue* pPathValues = aPathPropSeq.getArray();
- while ( aIter != aEnd )
- *pPathValues++ = *aIter++;
- aProp.Name = sPath;
- aProp.Value <<= aPathPropSeq;
- aPropVec.push_back( aProp );
- }
- }
- /////////////////////////////////////////
- // "TextPath" PropertySequence element //
- /////////////////////////////////////////
- sal_Bool bTextPathOn = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x4000 ) != 0;
- if ( bTextPathOn )
- {
- PropVec aTextPathPropVec;
-
- // TextPath
- const rtl::OUString sTextPathOn( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
- aProp.Name = sTextPathOn;
- aProp.Value <<= bTextPathOn;
- aTextPathPropVec.push_back( aProp );
-
- // TextPathMode
- const rtl::OUString sTextPathMode( RTL_CONSTASCII_USTRINGPARAM ( "TextPathMode" ) );
- sal_Bool bTextPathFitPath = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x100 ) != 0;
-
- sal_Bool bTextPathFitShape;
- if ( IsHardAttribute( DFF_Prop_gtextFStretch ) )
- bTextPathFitShape = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x400 ) != 0;
- else
- {
- bTextPathFitShape = true;
- switch( rObjData.eShapeType )
- {
- case mso_sptTextArchUpCurve :
- case mso_sptTextArchDownCurve :
- case mso_sptTextCircleCurve :
- case mso_sptTextButtonCurve :
- bTextPathFitShape = false;
- default : break;
- }
- }
- EnhancedCustomShapeTextPathMode eTextPathMode( EnhancedCustomShapeTextPathMode_NORMAL );
- if ( bTextPathFitShape )
- eTextPathMode = EnhancedCustomShapeTextPathMode_SHAPE;
- else if ( bTextPathFitPath )
- eTextPathMode = EnhancedCustomShapeTextPathMode_PATH;
- aProp.Name = sTextPathMode;
- aProp.Value <<= eTextPathMode;
- aTextPathPropVec.push_back( aProp );
-
- // ScaleX
- const rtl::OUString sTextPathScaleX( RTL_CONSTASCII_USTRINGPARAM ( "ScaleX" ) );
- sal_Bool bTextPathScaleX = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x40 ) != 0;
- aProp.Name = sTextPathScaleX;
- aProp.Value <<= bTextPathScaleX;
- aTextPathPropVec.push_back( aProp );
- // SameLetterHeights
- const rtl::OUString sSameLetterHeight( RTL_CONSTASCII_USTRINGPARAM ( "SameLetterHeights" ) );
- sal_Bool bSameLetterHeight = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough ) & 0x80 ) != 0;
- aProp.Name = sSameLetterHeight;
- aProp.Value <<= bSameLetterHeight;
- aTextPathPropVec.push_back( aProp );
-
- // pushing the whole TextPath element
- const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
- PropSeq aTextPathPropSeq( aTextPathPropVec.size() );
- aIter = aTextPathPropVec.begin();
- aEnd = aTextPathPropVec.end();
- beans::PropertyValue* pTextPathValues = aTextPathPropSeq.getArray();
- while ( aIter != aEnd )
- *pTextPathValues++ = *aIter++;
- aProp.Name = sTextPath;
- aProp.Value <<= aTextPathPropSeq;
- aPropVec.push_back( aProp );
- }
- ////////////////////////
- // "AdjustmentValues" // The AdjustmentValues are imported at last, because depending to the type of the
- //////////////////////// handle (POLAR) we will convert the adjustment value from a fixed float to double
-
- // checking the last used adjustment handle, so we can determine how many handles are to allocate
- sal_Int32 i = DFF_Prop_adjust10Value;
- while ( ( i >= DFF_Prop_adjustValue ) && !IsProperty( i ) )
- i--;
- sal_Int32 nAdjustmentValues = ( i - DFF_Prop_adjustValue ) + 1;
- if ( nAdjustmentValues )
- {
- uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq( nAdjustmentValues );
- while( --nAdjustmentValues >= 0 )
- {
- sal_Int32 nValue = 0;
- beans::PropertyState ePropertyState = beans::PropertyState_DEFAULT_VALUE;
- if ( IsProperty( i ) )
- {
- nValue = GetPropertyValue( i );
- ePropertyState = beans::PropertyState_DIRECT_VALUE;
- }
- if ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << ( i - DFF_Prop_adjustValue ) ) )
- {
- double fValue = nValue;
- fValue /= 65536;
- aAdjustmentSeq[ nAdjustmentValues ].Value <<= fValue;
- }
- else
- aAdjustmentSeq[ nAdjustmentValues ].Value <<= nValue;
- aAdjustmentSeq[ nAdjustmentValues ].State = ePropertyState;
- i--;
- }
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- aProp.Name = sAdjustmentValues;
- aProp.Value <<= aAdjustmentSeq;
- aPropVec.push_back( aProp );
- }
-
- // creating the whole property set
- PropSeq aSeq( aPropVec.size() );
- beans::PropertyValue* pValues = aSeq.getArray();
- aIter = aPropVec.begin();
- aEnd = aPropVec.end();
- while ( aIter != aEnd )
- *pValues++ = *aIter++;
- rSet.Put( SdrCustomShapeGeometryItem( aSeq ) );
-}
-
-void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const
-{
- Rectangle aEmptyRect;
- DffRecordHeader aHdTemp;
- DffObjData aDffObjTemp( aHdTemp, aEmptyRect, 0 );
- ApplyAttributes( rIn, rSet, aDffObjTemp );
-}
-
-void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
-{
-// MapUnit eMap( rManager.GetModel()->GetScaleUnit() );
-
- sal_Bool bHasShadow = sal_False;
-
- for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() )
- {
- UINT32 nRecType = GetCurKey();
- UINT32 nContent = mpContents[ nRecType ];
- switch ( nRecType )
- {
- case DFF_Prop_gtextSize :
- rSet.Put( SvxFontHeightItem( rManager.ScalePt( nContent ), 100, EE_CHAR_FONTHEIGHT ) );
- break;
- // GeoText
- case DFF_Prop_gtextFStrikethrough :
- {
- if ( nContent & 0x20 )
- rSet.Put( SvxWeightItem( nContent ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
- if ( nContent & 0x10 )
- rSet.Put( SvxPostureItem( nContent ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
- if ( nContent & 0x08 )
- rSet.Put( SvxUnderlineItem( nContent ? UNDERLINE_SINGLE : UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
- if ( nContent & 0x40 )
- rSet.Put(SvxShadowedItem( nContent != 0, EE_CHAR_SHADOW ) );
-// if ( nContent & 0x02 )
-// rSet.Put( SvxCaseMapItem( nContent ? SVX_CASEMAP_KAPITAELCHEN : SVX_CASEMAP_NOT_MAPPED ) );
- if ( nContent & 0x01 )
- rSet.Put( SvxCrossedOutItem( nContent ? STRIKEOUT_SINGLE : STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
- }
- break;
-
- case DFF_Prop_fillColor :
- rSet.Put( XFillColorItem( String(), rManager.MSO_CLR_ToColor( nContent, DFF_Prop_fillColor ) ) );
- break;
-
- // ShadowStyle
- case DFF_Prop_shadowType :
- {
- MSO_ShadowType eShadowType = (MSO_ShadowType)nContent;
- if( eShadowType != mso_shadowOffset )
- {
- // mso_shadowDouble
- // mso_shadowRich
- // mso_shadowEmbossOrEngrave
- // koennen wir nicht, kreiere Default-Schatten mit default-
- // Abstand
- rSet.Put( SdrShadowXDistItem( 35 ) ); // 0,35 mm Schattendistanz
- rSet.Put( SdrShadowYDistItem( 35 ) );
- }
- }
- break;
- case DFF_Prop_shadowColor :
- rSet.Put( SdrShadowColorItem( String(), rManager.MSO_CLR_ToColor( nContent, DFF_Prop_shadowColor ) ) );
- break;
- case DFF_Prop_shadowOpacity :
- rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - nContent ) / 655 ) ) );
- break;
- case DFF_Prop_shadowOffsetX :
- {
- INT32 nVal = (INT32)nContent;
- rManager.ScaleEmu( nVal );
- if ( nVal )
- rSet.Put( SdrShadowXDistItem( nVal ) );
- }
- break;
- case DFF_Prop_shadowOffsetY :
- {
- INT32 nVal = (INT32)nContent;
- rManager.ScaleEmu( nVal );
- if ( nVal )
- rSet.Put( SdrShadowYDistItem( nVal ) );
- }
- break;
- case DFF_Prop_fshadowObscured :
- {
- bHasShadow = ( nContent & 2 ) != 0;
- if ( bHasShadow )
- {
- if ( !IsProperty( DFF_Prop_shadowOffsetX ) )
- rSet.Put( SdrShadowXDistItem( 35 ) );
- if ( !IsProperty( DFF_Prop_shadowOffsetY ) )
- rSet.Put( SdrShadowYDistItem( 35 ) );
- }
- }
- break;
- }
- }
-
- if ( bHasShadow )
- {
- // #160376# sj: activating shadow only if fill and or linestyle is used
- // this is required because of the latest drawing layer core changes.
- // Issue i104085 is related to this.
- UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
- if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType ))
- nLineFlags &= ~0x08;
- UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
- if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType ))
- nFillFlags &= ~0x10;
- if ( nFillFlags & 0x10 )
- {
- MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
- switch( eMSO_FillType )
- {
- case mso_fillSolid :
- case mso_fillPattern :
- case mso_fillTexture :
- case mso_fillPicture :
- case mso_fillShade :
- case mso_fillShadeCenter :
- case mso_fillShadeShape :
- case mso_fillShadeScale :
- case mso_fillShadeTitle :
- break;
- // case mso_fillBackground :
- default:
- nFillFlags &=~0x10; // no fillstyle used
- break;
- }
- }
- if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) ) // if there is no fillstyle and linestyle
- bHasShadow = sal_False; // we are turning shadow off.
-
- if ( bHasShadow )
- rSet.Put( SdrShadowItem( bHasShadow ) );
- }
- ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269#
- ApplyFillAttributes( rIn, rSet, rObjData );
- if ( rObjData.eShapeType != mso_sptNil )
- {
- ApplyCustomShapeGeometryAttributes( rIn, rSet, rObjData );
- ApplyCustomShapeTextAttributes( rSet );
- }
-}
-
-//---------------------------------------------------------------------------
-//- Record Manager ----------------------------------------------------------
-//---------------------------------------------------------------------------
-
-DffRecordList::DffRecordList( DffRecordList* pList ) :
- nCount ( 0 ),
- nCurrent ( 0 ),
- pPrev ( pList ),
- pNext ( NULL )
-{
- if ( pList )
- pList->pNext = this;
-}
-
-DffRecordList::~DffRecordList()
-{
- delete pNext;
-}
-
-DffRecordManager::DffRecordManager() :
- DffRecordList ( NULL ),
- pCList ( (DffRecordList*)this )
-{
-}
-
-DffRecordManager::DffRecordManager( SvStream& rIn ) :
- DffRecordList ( NULL ),
- pCList ( (DffRecordList*)this )
-{
- Consume( rIn );
-}
-
-DffRecordManager::~DffRecordManager()
-{
-};
-
-
-void DffRecordManager::Consume( SvStream& rIn, BOOL bAppend, UINT32 nStOfs )
-{
- if ( !bAppend )
- Clear();
- UINT32 nOldPos = rIn.Tell();
- if ( !nStOfs )
- {
- DffRecordHeader aHd;
- rIn >> aHd;
- if ( aHd.nRecVer == DFF_PSFLAG_CONTAINER )
- nStOfs = aHd.GetRecEndFilePos();
- }
- if ( nStOfs )
- {
- pCList = (DffRecordList*)this;
- while ( pCList->pNext )
- pCList = pCList->pNext;
- while ( ( rIn.GetError() == 0 ) && ( ( rIn.Tell() + 8 ) <= nStOfs ) )
- {
- if ( pCList->nCount == DFF_RECORD_MANAGER_BUF_SIZE )
- pCList = new DffRecordList( pCList );
- rIn >> pCList->mHd[ pCList->nCount ];
- pCList->mHd[ pCList->nCount++ ].SeekToEndOfRecord( rIn );
- }
- rIn.Seek( nOldPos );
- }
-}
-
-void DffRecordManager::Clear()
-{
- pCList = (DffRecordList*)this;
- delete pNext, pNext = NULL;
- nCurrent = 0;
- nCount = 0;
-}
-
-DffRecordHeader* DffRecordManager::Current()
-{
- DffRecordHeader* pRet = NULL;
- if ( pCList->nCurrent < pCList->nCount )
- pRet = &pCList->mHd[ pCList->nCurrent ];
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::First()
-{
- DffRecordHeader* pRet = NULL;
- pCList = (DffRecordList*)this;
- if ( pCList->nCount )
- {
- pCList->nCurrent = 0;
- pRet = &pCList->mHd[ 0 ];
- }
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::Next()
-{
- DffRecordHeader* pRet = NULL;
- UINT32 nC = pCList->nCurrent + 1;
- if ( nC < pCList->nCount )
- {
- pCList->nCurrent++;
- pRet = &pCList->mHd[ nC ];
- }
- else if ( pCList->pNext )
- {
- pCList = pCList->pNext;
- pCList->nCurrent = 0;
- pRet = &pCList->mHd[ 0 ];
- }
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::Prev()
-{
- DffRecordHeader* pRet = NULL;
- UINT32 nCur = pCList->nCurrent;
- if ( !nCur && pCList->pPrev )
- {
- pCList = pCList->pPrev;
- nCur = pCList->nCount;
- }
- if ( nCur-- )
- {
- pCList->nCurrent = nCur;
- pRet = &pCList->mHd[ nCur ];
- }
- return pRet;
-}
-
-DffRecordHeader* DffRecordManager::Last()
-{
- DffRecordHeader* pRet = NULL;
- while ( pCList->pNext )
- pCList = pCList->pNext;
- UINT32 nCnt = pCList->nCount;
- if ( nCnt-- )
- {
- pCList->nCurrent = nCnt;
- pRet = &pCList->mHd[ nCnt ];
- }
- return pRet;
-}
-
-BOOL DffRecordManager::SeekToContent( SvStream& rIn, UINT16 nRecId, DffSeekToContentMode eMode )
-{
- DffRecordHeader* pHd = GetRecordHeader( nRecId, eMode );
- if ( pHd )
- {
- pHd->SeekToContent( rIn );
- return TRUE;
- }
- else
- return FALSE;
-}
-
-DffRecordHeader* DffRecordManager::GetRecordHeader( UINT16 nRecId, DffSeekToContentMode eMode )
-{
- UINT32 nOldCurrent = pCList->nCurrent;
- DffRecordList* pOldList = pCList;
- DffRecordHeader* pHd;
-
- if ( eMode == SEEK_FROM_BEGINNING )
- pHd = First();
- else
- pHd = Next();
-
- while ( pHd )
- {
- if ( pHd->nRecType == nRecId )
- break;
- pHd = Next();
- }
- if ( !pHd && eMode == SEEK_FROM_CURRENT_AND_RESTART )
- {
- DffRecordHeader* pBreak = &pOldList->mHd[ nOldCurrent ];
- pHd = First();
- if ( pHd )
- {
- while ( pHd != pBreak )
- {
- if ( pHd->nRecType == nRecId )
- break;
- pHd = Next();
- }
- if ( pHd->nRecType != nRecId )
- pHd = NULL;
- }
- }
- if ( !pHd )
- {
- pCList = pOldList;
- pOldList->nCurrent = nOldCurrent;
- }
- return pHd;
-}
-
-//---------------------------------------------------------------------------
-// private Methoden
-//---------------------------------------------------------------------------
-
-struct EscherBlipCacheEntry
-{
- ByteString aUniqueID;
- sal_uInt32 nBlip;
-
- EscherBlipCacheEntry( sal_uInt32 nBlipId, const ByteString& rUniqueID ) :
- aUniqueID( rUniqueID ),
- nBlip( nBlipId ) {}
-};
-
-void SvxMSDffManager::Scale( sal_Int32& rVal ) const
-{
- if ( bNeedMap )
- rVal = BigMulDiv( rVal, nMapMul, nMapDiv );
-}
-
-void SvxMSDffManager::Scale( Point& rPos ) const
-{
- rPos.X() += nMapXOfs;
- rPos.Y() += nMapYOfs;
- if ( bNeedMap )
- {
- rPos.X() = BigMulDiv( rPos.X(), nMapMul, nMapDiv );
- rPos.Y() = BigMulDiv( rPos.Y(), nMapMul, nMapDiv );
- }
-}
-
-void SvxMSDffManager::Scale( Size& rSiz ) const
-{
- if ( bNeedMap )
- {
- rSiz.Width() = BigMulDiv( rSiz.Width(), nMapMul, nMapDiv );
- rSiz.Height() = BigMulDiv( rSiz.Height(), nMapMul, nMapDiv );
- }
-}
-
-void SvxMSDffManager::Scale( Rectangle& rRect ) const
-{
- rRect.Move( nMapXOfs, nMapYOfs );
- if ( bNeedMap )
- {
- rRect.Left() =BigMulDiv( rRect.Left() , nMapMul, nMapDiv );
- rRect.Top() =BigMulDiv( rRect.Top() , nMapMul, nMapDiv );
- rRect.Right() =BigMulDiv( rRect.Right() , nMapMul, nMapDiv );
- rRect.Bottom()=BigMulDiv( rRect.Bottom(), nMapMul, nMapDiv );
- }
-}
-
-void SvxMSDffManager::Scale( Polygon& rPoly ) const
-{
- if ( !bNeedMap )
- return;
- USHORT nPointAnz = rPoly.GetSize();
- for ( USHORT nPointNum = 0; nPointNum < nPointAnz; nPointNum++ )
- Scale( rPoly[ nPointNum ] );
-}
-
-void SvxMSDffManager::Scale( PolyPolygon& rPoly ) const
-{
- if ( !bNeedMap )
- return;
- USHORT nPolyAnz = rPoly.Count();
- for ( USHORT nPolyNum = 0; nPolyNum < nPolyAnz; nPolyNum++ )
- Scale( rPoly[ nPolyNum ] );
-}
-
-void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
-{
- rVal = BigMulDiv( rVal, nEmuMul, nEmuDiv );
-}
-
-UINT32 SvxMSDffManager::ScalePt( UINT32 nVal ) const
-{
- MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
- long aMul = aFact.GetNumerator();
- long aDiv = aFact.GetDenominator() * 65536;
- aFact = Fraction( aMul, aDiv ); // nochmal versuchen zu kuerzen
- return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() );
-}
-
-INT32 SvxMSDffManager::ScalePoint( INT32 nVal ) const
-{
- return BigMulDiv( nVal, nPntMul, nPntDiv );
-};
-
-void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
-{
- pSdrModel = pModel;
- if( pModel && (0 < nApplicationScale) )
- {
- // PPT arbeitet nur mit Einheiten zu 576DPI
- // WW hingegen verwendet twips, dh. 1440DPI.
- MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
- long nMul=aFact.GetNumerator();
- long nDiv=aFact.GetDenominator()*nApplicationScale;
- aFact=Fraction(nMul,nDiv); // nochmal versuchen zu kuerzen
- // Bei 100TH_MM -> 2540/576=635/144
- // Bei Twip -> 1440/576=5/2
- nMapMul = aFact.GetNumerator();
- nMapDiv = aFact.GetDenominator();
- bNeedMap = nMapMul!=nMapDiv;
-
- // MS-DFF-Properties sind grossteils in EMU (English Metric Units) angegeben
- // 1mm=36000emu, 1twip=635emu
- aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
- nMul=aFact.GetNumerator();
- nDiv=aFact.GetDenominator()*360;
- aFact=Fraction(nMul,nDiv); // nochmal versuchen zu kuerzen
- // Bei 100TH_MM -> 1/360
- // Bei Twip -> 14,40/(25,4*360)=144/91440=1/635
- nEmuMul=aFact.GetNumerator();
- nEmuDiv=aFact.GetDenominator();
-
- // Und noch was fuer typografische Points
- aFact=GetMapFactor(MAP_POINT,eMap).X();
- nPntMul=aFact.GetNumerator();
- nPntDiv=aFact.GetDenominator();
- }
- else
- {
- pModel = 0;
- nMapMul = nMapDiv = nMapXOfs = nMapYOfs = nEmuMul = nEmuDiv = nPntMul = nPntDiv = 0;
- bNeedMap = FALSE;
- }
-}
-
-BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT32 nId ) const
-{
- BOOL bRet = FALSE;
- if ( mpFidcls )
- {
- UINT32 nMerk = rSt.Tell();
- UINT32 nShapeId, nSec = ( nId >> 10 ) - 1;
- if ( nSec < mnIdClusters )
- {
- sal_IntPtr nOfs = (sal_IntPtr)maDgOffsetTable.Get( mpFidcls[ nSec ].dgid );
- if ( nOfs )
- {
- rSt.Seek( nOfs );
- DffRecordHeader aEscherF002Hd;
- rSt >> aEscherF002Hd;
- ULONG nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
- DffRecordHeader aEscherObjListHd;
- while ( rSt.Tell() < nEscherF002End )
- {
- rSt >> aEscherObjListHd;
- if ( aEscherObjListHd.nRecVer != 0xf )
- aEscherObjListHd.SeekToEndOfRecord( rSt );
- else if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
- {
- DffRecordHeader aShapeHd;
- if ( SeekToRec( rSt, DFF_msofbtSp, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) )
- {
- rSt >> nShapeId;
- if ( nId == nShapeId )
- {
- aEscherObjListHd.SeekToBegOfRecord( rSt );
- bRet = TRUE;
- break;
- }
- }
- aEscherObjListHd.SeekToEndOfRecord( rSt );
- }
- }
- }
- }
- if ( !bRet )
- rSt.Seek( nMerk );
- }
- return bRet;
-}
-
-FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
-{
- FASTBOOL bRet = FALSE;
- ULONG nFPosMerk = rSt.Tell(); // FilePos merken fuer ggf. spaetere Restauration
- DffRecordHeader aHd;
- do
- {
- rSt >> aHd;
- if ( aHd.nRecType == nRecId )
- {
- if ( nSkipCount )
- nSkipCount--;
- else
- {
- bRet = TRUE;
- if ( pRecHd != NULL )
- *pRecHd = aHd;
- else
- aHd.SeekToBegOfRecord( rSt );
- }
- }
- if ( !bRet )
- aHd.SeekToEndOfRecord( rSt );
- }
- while ( rSt.GetError() == 0 && rSt.Tell() < nMaxFilePos && !bRet );
- if ( !bRet )
- rSt.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
-}
-
-FASTBOOL SvxMSDffManager::SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
-{
- FASTBOOL bRet = FALSE;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
- DffRecordHeader aHd;
- do
- {
- rStCtrl >> aHd;
- if ( aHd.nRecType == nRecId1 || aHd.nRecType == nRecId2 )
- {
- if ( nSkipCount )
- nSkipCount--;
- else
- {
- bRet = TRUE;
- if ( pRecHd )
- *pRecHd = aHd;
- else
- aHd.SeekToBegOfRecord( rStCtrl );
- }
- }
- if ( !bRet )
- aHd.SeekToEndOfRecord( rStCtrl );
- }
- while ( rStCtrl.GetError() == 0 && rStCtrl.Tell() < nMaxFilePos && !bRet );
- if ( !bRet )
- rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
-}
-
-
-FASTBOOL SvxMSDffManager::GetColorFromPalette( USHORT /* nNum */, Color& rColor ) const
-{
- // diese Methode ist in der zum Excel-Import
- // abgeleiteten Klasse zu ueberschreiben...
- rColor.SetColor( COL_WHITE );
- return TRUE;
-}
-
-// sj: the documentation is not complete, especially in ppt the normal rgb for text
-// color is written as 0xfeRRGGBB, this can't be explained by the documentation, nearly
-// every bit in the upper code is set -> so there seems to be a special handling for
-// ppt text colors, i decided not to fix this in MSO_CLR_ToColor because of possible
-// side effects, instead MSO_TEXT_CLR_ToColor is called for PPT text colors, to map
-// the color code to something that behaves like the other standard color codes used by
-// fill and line color
-Color SvxMSDffManager::MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const
-{
- // Fuer Textfarben: Header ist 0xfeRRGGBB
- if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 )
- nColorCode &= 0x00ffffff;
- else
- {
- // for colorscheme colors the color index are the lower three bits of the upper byte
- if ( ( nColorCode & 0xf8000000 ) == 0 ) // this must be a colorscheme index
- {
- nColorCode >>= 24;
- nColorCode |= 0x8000000;
- }
- }
- return MSO_CLR_ToColor( nColorCode );
-}
-
-Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContentProperty ) const
-{
- Color aColor( mnDefaultColor );
-
- // Fuer Textfarben: Header ist 0xfeRRGGBB
- if ( ( nColorCode & 0xfe000000 ) == 0xfe000000 ) // sj: it needs to be checked if 0xfe is used in
- nColorCode &= 0x00ffffff; // other cases than ppt text -> if not this code can be removed
-
- sal_uInt8 nUpper = (sal_uInt8)( nColorCode >> 24 );
-
- // sj: below change from 0x1b to 0x19 was done because of i84812 (0x02 -> rgb color),
- // now I have some problems to fix i104685 (there the color value is 0x02000000 whichs requires
- // a 0x2 scheme color to be displayed properly), the color docu seems to be incomplete
- if( nUpper & 0x19 ) // if( nUpper & 0x1f )
- {
- if( ( nUpper & 0x08 ) || ( ( nUpper & 0x10 ) == 0 ) )
- {
- // SCHEMECOLOR
- if ( !GetColorFromPalette( ( nUpper & 8 ) ? (sal_uInt16)nColorCode : nUpper, aColor ) )
- {
- switch( nContentProperty )
- {
- case DFF_Prop_pictureTransparent :
- case DFF_Prop_shadowColor :
- case DFF_Prop_fillBackColor :
- case DFF_Prop_fillColor :
- aColor = Color( COL_WHITE );
- break;
- case DFF_Prop_lineColor :
- {
- aColor = Color( COL_BLACK );
- }
- break;
- }
- }
- }
- else // SYSCOLOR
- {
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
-// UINT16 nParameter = (BYTE)( nColorCode >> 16); // SJ: nice compiler optimization bug on windows, though downcasting
- UINT16 nParameter = sal_uInt16(( nColorCode >> 16 ) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
- UINT16 nFunctionBits = (UINT16)( ( nColorCode & 0x00000f00 ) >> 8 );
- UINT16 nAdditionalFlags = (UINT16)( ( nColorCode & 0x0000f000) >> 8 );
- UINT16 nColorIndex = sal_uInt16(nColorCode & 0x00ff);
- UINT32 nPropColor = 0;
-
- sal_uInt16 nCProp = 0;
-
- switch ( nColorIndex )
- {
- case mso_syscolorButtonFace : aColor = rStyleSettings.GetFaceColor(); break;
- case mso_syscolorWindowText : aColor = rStyleSettings.GetWindowTextColor(); break;
- case mso_syscolorMenu : aColor = rStyleSettings.GetMenuColor(); break;
- case mso_syscolor3DLight :
- case mso_syscolorButtonHighlight :
- case mso_syscolorHighlight : aColor = rStyleSettings.GetHighlightColor(); break;
- case mso_syscolorHighlightText : aColor = rStyleSettings.GetHighlightTextColor(); break;
- case mso_syscolorCaptionText : aColor = rStyleSettings.GetMenuTextColor(); break;
- case mso_syscolorActiveCaption : aColor = rStyleSettings.GetHighlightColor(); break;
- case mso_syscolorButtonShadow : aColor = rStyleSettings.GetShadowColor(); break;
- case mso_syscolorButtonText : aColor = rStyleSettings.GetButtonTextColor(); break;
- case mso_syscolorGrayText : aColor = rStyleSettings.GetDeactiveColor(); break;
- case mso_syscolorInactiveCaption : aColor = rStyleSettings.GetDeactiveColor(); break;
- case mso_syscolorInactiveCaptionText : aColor = rStyleSettings.GetDeactiveColor(); break;
- case mso_syscolorInfoBackground : aColor = rStyleSettings.GetFaceColor(); break;
- case mso_syscolorInfoText : aColor = rStyleSettings.GetInfoTextColor(); break;
- case mso_syscolorMenuText : aColor = rStyleSettings.GetMenuTextColor(); break;
- case mso_syscolorScrollbar : aColor = rStyleSettings.GetFaceColor(); break;
- case mso_syscolorWindow : aColor = rStyleSettings.GetWindowColor(); break;
- case mso_syscolorWindowFrame : aColor = rStyleSettings.GetWindowColor(); break;
-
- case mso_colorFillColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
- nCProp = DFF_Prop_fillColor;
- }
- break;
- case mso_colorLineOrFillColor : // ( use the line color only if there is a line )
- {
- if ( GetPropertyValue( DFF_Prop_fNoLineDrawDash ) & 8 )
- {
- nPropColor = GetPropertyValue( DFF_Prop_lineColor, 0 );
- nCProp = DFF_Prop_lineColor;
- }
- else
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
- nCProp = DFF_Prop_fillColor;
- }
- }
- break;
- case mso_colorLineColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_lineColor, 0 );
- nCProp = DFF_Prop_lineColor;
- }
- break;
- case mso_colorShadowColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_shadowColor, 0x808080 );
- nCProp = DFF_Prop_shadowColor;
- }
- break;
- case mso_colorThis : // ( use this color ... )
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
- nCProp = DFF_Prop_fillColor;
- }
- break;
- case mso_colorFillBackColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillBackColor, 0xffffff );
- nCProp = DFF_Prop_fillBackColor;
- }
- break;
- case mso_colorLineBackColor :
- {
- nPropColor = GetPropertyValue( DFF_Prop_lineBackColor, 0xffffff );
- nCProp = DFF_Prop_lineBackColor;
- }
- break;
- case mso_colorFillThenLine : // ( use the fillcolor unless no fill and line )
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
- nCProp = DFF_Prop_fillColor;
- }
- break;
- case mso_colorIndexMask : // ( extract the color index ) ?
- {
- nPropColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff ); //?????????????
- nCProp = DFF_Prop_fillColor;
- }
- break;
- }
- if ( nCProp && ( nPropColor & 0x10000000 ) == 0 ) // beware of looping recursive
- aColor = MSO_CLR_ToColor( nPropColor, nCProp );
-
- if( nAdditionalFlags & 0x80 ) // make color gray
- {
- UINT8 nZwi = aColor.GetLuminance();
- aColor = Color( nZwi, nZwi, nZwi );
- }
- switch( nFunctionBits )
- {
- case 0x01 : // darken color by parameter
- {
- aColor.SetRed( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetRed() ) >> 8 ) );
- aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetGreen() ) >> 8 ) );
- aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetBlue() ) >> 8 ) );
- }
- break;
- case 0x02 : // lighten color by parameter
- {
- UINT16 nInvParameter = ( 0x00ff - nParameter ) * 0xff;
- aColor.SetRed( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetRed() ) ) >> 8 ) );
- aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetGreen() ) ) >> 8 ) );
- aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetBlue() ) ) >> 8 ) );
- }
- break;
- case 0x03 : // add grey level RGB(p,p,p)
- {
- INT16 nR = (INT16)aColor.GetRed() + (INT16)nParameter;
- INT16 nG = (INT16)aColor.GetGreen() + (INT16)nParameter;
- INT16 nB = (INT16)aColor.GetBlue() + (INT16)nParameter;
- if ( nR > 0x00ff )
- nR = 0x00ff;
- if ( nG > 0x00ff )
- nG = 0x00ff;
- if ( nB > 0x00ff )
- nB = 0x00ff;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
- }
- break;
- case 0x04 : // substract grey level RGB(p,p,p)
- {
- INT16 nR = (INT16)aColor.GetRed() - (INT16)nParameter;
- INT16 nG = (INT16)aColor.GetGreen() - (INT16)nParameter;
- INT16 nB = (INT16)aColor.GetBlue() - (INT16)nParameter;
- if ( nR < 0 )
- nR = 0;
- if ( nG < 0 )
- nG = 0;
- if ( nB < 0 )
- nB = 0;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
- }
- break;
- case 0x05 : // substract from grey level RGB(p,p,p)
- {
- INT16 nR = (INT16)nParameter - (INT16)aColor.GetRed();
- INT16 nG = (INT16)nParameter - (INT16)aColor.GetGreen();
- INT16 nB = (INT16)nParameter - (INT16)aColor.GetBlue();
- if ( nR < 0 )
- nR = 0;
- if ( nG < 0 )
- nG = 0;
- if ( nB < 0 )
- nB = 0;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
- }
- break;
- case 0x06 : // per component: black if < p, white if >= p
- {
- aColor.SetRed( aColor.GetRed() < nParameter ? 0x00 : 0xff );
- aColor.SetGreen( aColor.GetGreen() < nParameter ? 0x00 : 0xff );
- aColor.SetBlue( aColor.GetBlue() < nParameter ? 0x00 : 0xff );
- }
- break;
- }
- if ( nAdditionalFlags & 0x40 ) // top-bit invert
- aColor = Color( aColor.GetRed() ^ 0x80, aColor.GetGreen() ^ 0x80, aColor.GetBlue() ^ 0x80 );
-
- if ( nAdditionalFlags & 0x20 ) // invert color
- aColor = Color(0xff - aColor.GetRed(), 0xff - aColor.GetGreen(), 0xff - aColor.GetBlue());
- }
- }
- else if ( ( nUpper & 4 ) && ( ( nColorCode & 0xfffff8 ) == 0 ) )
- { // case of nUpper == 4 powerpoint takes this as agrument for a colorschemecolor
- GetColorFromPalette( nUpper, aColor );
- }
- else // hart attributiert, eventuell mit Hinweis auf SYSTEMRGB
- aColor = Color( (BYTE)nColorCode, (BYTE)( nColorCode >> 8 ), (BYTE)( nColorCode >> 16 ) );
- return aColor;
-}
-
-FASTBOOL SvxMSDffManager::ReadDffString(SvStream& rSt, String& rTxt) const
-{
- FASTBOOL bRet=FALSE;
- DffRecordHeader aStrHd;
- if( !ReadCommonRecordHeader(aStrHd, rSt) )
- rSt.Seek( aStrHd.nFilePos );
- else if ( aStrHd.nRecType == DFF_PST_TextBytesAtom || aStrHd.nRecType == DFF_PST_TextCharsAtom )
- {
- FASTBOOL bUniCode=aStrHd.nRecType==DFF_PST_TextCharsAtom;
- bRet=TRUE;
- ULONG nBytes = aStrHd.nRecLen;
- MSDFFReadZString( rSt, rTxt, nBytes, bUniCode );
- if( !bUniCode )
- {
- for ( xub_StrLen n = 0; n < nBytes; n++ )
- {
- if( rTxt.GetChar( n ) == 0x0B )
- rTxt.SetChar( n, ' ' ); // Weicher Umbruch
- // TODO: Zeilenumbruch im Absatz via Outliner setzen.
- }
- }
- aStrHd.SeekToEndOfRecord( rSt );
- }
- else
- aStrHd.SeekToBegOfRecord( rSt );
- return bRet;
-}
-
-// sj: I just want to set a string for a text object that may contain multiple
-// paragraphs. If I now take a look at the follwing code I get the impression that
-// our outliner is too complicate to be used properly,
-void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
-{
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pObj );
- if ( pText )
- {
- SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
- rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
-
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- rOutliner.SetUpdateMode( FALSE );
- rOutliner.SetVertical( pText->IsVerticalWriting() );
-
- sal_uInt16 nParaIndex = 0;
- sal_uInt32 nParaSize;
- const sal_Unicode* pCurrent, *pBuf = rText.GetBuffer();
- const sal_Unicode* pEnd = rText.GetBuffer() + rText.Len();
-
- while( pBuf < pEnd )
- {
- pCurrent = pBuf;
-
- for ( nParaSize = 0; pBuf < pEnd; )
- {
- sal_Unicode nChar = *pBuf++;
- if ( nChar == 0xa )
- {
- if ( ( pBuf < pEnd ) && ( *pBuf == 0xd ) )
- pBuf++;
- break;
- }
- else if ( nChar == 0xd )
- {
- if ( ( pBuf < pEnd ) && ( *pBuf == 0xa ) )
- pBuf++;
- break;
- }
- else
- nParaSize++;
- }
- ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
- String aParagraph( pCurrent, (sal_uInt16)nParaSize );
- if ( !nParaIndex && !aParagraph.Len() ) // SJ: we are crashing if the first paragraph is empty ?
- aParagraph += (sal_Unicode)' '; // otherwise these two lines can be removed.
- rOutliner.Insert( aParagraph, nParaIndex, 0 );
- rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() );
-
- SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
- if ( !aSelection.nStartPos )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
- aSelection.nStartPos = 0;
- rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
- nParaIndex++;
- }
- OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
- rOutliner.Clear();
- rOutliner.SetUpdateMode( bOldUpdateMode );
- pText->SetOutlinerParaObject( pNewText );
- }
-}
-
-FASTBOOL SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
-{
- FASTBOOL bRet=FALSE;
- SdrTextObj* pText = PTR_CAST(SdrTextObj, pObj);
- if( pText )
- {
- DffRecordHeader aTextHd;
- if( !ReadCommonRecordHeader(aTextHd, rSt) )
- rSt.Seek( aTextHd.nFilePos );
- else if ( aTextHd.nRecType==DFF_msofbtClientTextbox )
- {
- bRet=TRUE;
- ULONG nRecEnd=aTextHd.GetRecEndFilePos();
- DffRecordHeader aHd;
- String aText;
-// UINT32 nInvent=pText->GetObjInventor();
-// UINT16 nIdent=pText->GetObjIdentifier();
-
- SdrOutliner& rOutliner=pText->ImpGetDrawOutliner();
-// sal_Int16 nMinDepth = rOutliner.GetMinDepth();
- USHORT nOutlMode = rOutliner.GetMode();
-
- { // Wohl 'nen kleiner Bug der EditEngine, das die
- // Absastzattribute bei Clear() nicht entfernt werden.
- FASTBOOL bClearParaAttribs = TRUE;
- rOutliner.SetStyleSheet( 0, NULL );
- SfxItemSet aSet(rOutliner.GetEmptyItemSet());
- aSet.Put(SvxColorItem( COL_BLACK ));
- rOutliner.SetParaAttribs(0,aSet);
- pText->SetMergedItemSet(aSet);
-
- bClearParaAttribs = FALSE;
- if( bClearParaAttribs )
- {
- // Wohl 'nen kleiner Bug der EditEngine, dass die
- // Absastzattribute bei Clear() nicht entfernt werden.
- rOutliner.SetParaAttribs(0,rOutliner.GetEmptyItemSet());
- }
- }
- rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
-
-// ULONG nFilePosMerker=rSt.Tell();
- ////////////////////////////////////
- // TextString und MetaChars lesen //
- ////////////////////////////////////
- do
- {
- if( !ReadCommonRecordHeader(aHd, rSt) )
- rSt.Seek( aHd.nFilePos );
- else
- {
- switch (aHd.nRecType)
- {
- //case TextHeaderAtom
- //case TextSpecInfoAtom
- case DFF_PST_TextBytesAtom:
- case DFF_PST_TextCharsAtom:
- {
- aHd.SeekToBegOfRecord(rSt);
- ReadDffString(rSt, aText);
- }
- break;
- case DFF_PST_TextRulerAtom :
- {
- UINT16 nLen = (UINT16)aHd.nRecLen;
- if(nLen)
- {
- UINT16 nVal1, nVal2, nVal3;
- UINT16 nDefaultTab = 2540; // PPT def: 1 Inch //rOutliner.GetDefTab();
- UINT16 nMostrightTab = 0;
- SfxItemSet aSet(rOutliner.GetEmptyItemSet());
- SvxTabStopItem aTabItem(0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS);
-
- rSt >> nVal1;
- rSt >> nVal2;
- nLen -= 4;
-
- // Allg. TAB verstellt auf Wert in nVal3
- if(nLen && (nVal1 & 0x0001))
- {
- rSt >> nVal3;
- nLen -= 2;
- nDefaultTab = (UINT16)(((UINT32)nVal3 * 1000) / 240);
- }
-
- // Weitere, frei gesetzte TABs
- if(nLen && (nVal1 & 0x0004))
- {
- rSt >> nVal1;
- nLen -= 2;
-
- // fest gesetzte TABs importieren
- while(nLen && nVal1--)
- {
- rSt >> nVal2;
- rSt >> nVal3;
- nLen -= 4;
-
- UINT16 nNewTabPos = (UINT16)(((UINT32)nVal2 * 1000) / 240);
- if(nNewTabPos > nMostrightTab)
- nMostrightTab = nNewTabPos;
-
- SvxTabStop aTabStop(nNewTabPos);
- aTabItem.Insert(aTabStop);
- }
- }
-
- // evtl. noch default-TABs ergaenzen (immer)
- UINT16 nObjWidth = sal_uInt16(pObj->GetSnapRect().GetWidth() + 1);
- UINT16 nDefaultTabPos = nDefaultTab;
-
- while(nDefaultTabPos <= nObjWidth && nDefaultTabPos <= nMostrightTab)
- nDefaultTabPos =
- nDefaultTabPos + nDefaultTab;
-
- while(nDefaultTabPos <= nObjWidth)
- {
- SvxTabStop aTabStop(nDefaultTabPos);
- aTabItem.Insert(aTabStop);
- nDefaultTabPos =
- nDefaultTabPos + nDefaultTab;
- }
-
- // Falls TABs angelegt wurden, setze diese
- if(aTabItem.Count())
- {
- aSet.Put(aTabItem);
- rOutliner.SetParaAttribs(0, aSet);
- }
- }
- }
- break;
- }
- aHd.SeekToEndOfRecord( rSt );
- }
- }
- while ( rSt.GetError() == 0 && rSt.Tell() < nRecEnd );
-
- ////////////////////////
- // SHIFT-Ret ersetzen //
- ////////////////////////
- if ( aText.Len() )
- {
- aText += ' ';
- aText.SetChar( aText.Len()-1, 0x0D );
- rOutliner.SetText( aText, rOutliner.GetParagraph( 0 ) );
-
- // SHIFT-Ret ersetzen im Outliner
- if(aText.GetTokenCount(0x0B) > 1)
- {
- UINT32 nParaCount = rOutliner.GetParagraphCount();
- for(UINT16 a=0;a<nParaCount;a++)
- {
- Paragraph* pActPara = rOutliner.GetParagraph(a);
- String aParaText = rOutliner.GetText(pActPara);
- for(UINT16 b=0;b<aParaText.Len();b++)
- {
- if( aParaText.GetChar( b ) == 0x0B)
- {
- ESelection aSelection(a, b, a, b+1);
- rOutliner.QuickInsertLineBreak(aSelection);
- }
- }
- }
- }
- }
- OutlinerParaObject* pNewText=rOutliner.CreateParaObject();
- rOutliner.Init( nOutlMode );
- pText->NbcSetOutlinerParaObject(pNewText);
- }
- else
- aTextHd.SeekToBegOfRecord(rSt);
-
- }
- return bRet;
-}
-
-//static
-void SvxMSDffManager::MSDFFReadZString( SvStream& rIn, String& rStr,
- ULONG nRecLen, FASTBOOL bUniCode )
-{
- sal_uInt16 nLen = (sal_uInt16)nRecLen;
- if( nLen )
- {
- if ( bUniCode )
- nLen >>= 1;
-
- String sBuf;
- sal_Unicode* pBuf = sBuf.AllocBuffer( nLen );
-
- if( bUniCode )
- {
- rIn.Read( (sal_Char*)pBuf, nLen << 1 );
-
-#ifdef OSL_BIGENDIAN
- for( sal_uInt16 n = 0; n < nLen; ++n, ++pBuf )
- *pBuf = SWAPSHORT( *pBuf );
-#endif // ifdef OSL_BIGENDIAN
- }
- else
- {
- // use the String-Data as buffer for the 8bit characters and
- // change then all to unicode
- sal_Char* pReadPos = ((sal_Char*)pBuf) + nLen;
- rIn.Read( (sal_Char*)pReadPos, nLen );
- for( sal_uInt16 n = 0; n < nLen; ++n, ++pBuf, ++pReadPos )
- *pBuf = ByteString::ConvertToUnicode( *pReadPos, RTL_TEXTENCODING_MS_1252 );
- }
-
- rStr = sBuf.EraseTrailingChars( 0 );
- }
- else
- rStr.Erase();
-}
-
-SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, Rectangle& rBoundRect ) const
-{
- SdrObject* pRet = NULL;
- String aObjectText;
- String aFontName;
- BOOL bTextRotate = FALSE;
-
- ((SvxMSDffManager*)this)->mnFix16Angle = 0; // we don't want to use this property in future
- if ( SeekToContent( DFF_Prop_gtextUNICODE, rStCt ) )
- MSDFFReadZString( rStCt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
- if ( SeekToContent( DFF_Prop_gtextFont, rStCt ) )
- MSDFFReadZString( rStCt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
- if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 )
- {
- // Text ist senkrecht formatiert, Box Kippen
- INT32 nHalfWidth = ( rBoundRect.GetWidth() + 1) >> 1;
- INT32 nHalfHeight = ( rBoundRect.GetHeight() + 1) >> 1;
- Point aTopLeft( rBoundRect.Left() + nHalfWidth - nHalfHeight,
- rBoundRect.Top() + nHalfHeight - nHalfWidth);
- Size aNewSize( rBoundRect.GetHeight(), rBoundRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- rBoundRect = aNewRect;
-
- String aSrcText( aObjectText );
- aObjectText.Erase();
- for( UINT16 a = 0; a < aSrcText.Len(); a++ )
- {
- aObjectText += aSrcText.GetChar( a );
- aObjectText += '\n';
- }
- rSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
- bTextRotate = TRUE;
- }
- if ( aObjectText.Len() )
- { // FontWork-Objekt Mit dem Text in aObjectText erzeugen
- SdrObject* pNewObj = new SdrRectObj( OBJ_TEXT, rBoundRect );
- if( pNewObj )
- {
- pNewObj->SetModel( pSdrModel );
- ((SdrRectObj*)pNewObj)->SetText( aObjectText );
- SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
- rSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- rSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
- rSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
- rSet.Put( SvxFontItem( FAMILY_DONTKNOW, aFontName, String(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
-
- pNewObj->SetMergedItemSet(rSet);
-
- pRet = pNewObj->ConvertToPolyObj( FALSE, FALSE );
- if( !pRet )
- pRet = pNewObj;
- else
- {
- pRet->NbcSetSnapRect( rBoundRect );
- SdrObject::Free( pNewObj );
- }
- if( bTextRotate )
- {
- double a = 9000 * nPi180;
- pRet->NbcRotate( rBoundRect.Center(), 9000, sin( a ), cos( a ) );
- }
- }
- }
- return pRet;
-}
-
-static Size lcl_GetPrefSize(const Graphic& rGraf, MapMode aWanted)
-{
- MapMode aPrefMapMode(rGraf.GetPrefMapMode());
- if (aPrefMapMode == aWanted)
- return rGraf.GetPrefSize();
- Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
- {
- aRetSize = Application::GetDefaultDevice()->PixelToLogic(
- rGraf.GetPrefSize(), aWanted);
- }
- else
- {
- aRetSize = Application::GetDefaultDevice()->LogicToLogic(
- rGraf.GetPrefSize(), rGraf.GetPrefMapMode(), aWanted);
- }
- return aRetSize;
-}
-
-// sj: if the parameter pSet is null, then the resulting crop bitmap will be stored in rGraf,
-// otherwise rGraf is untouched and pSet is used to store the corresponding SdrGrafCropItem
-static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Graphic& rGraf )
-{
- sal_Int32 nCropTop = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromTop, 0 );
- sal_Int32 nCropBottom = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromBottom, 0 );
- sal_Int32 nCropLeft = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromLeft, 0 );
- sal_Int32 nCropRight = (sal_Int32)rPropSet.GetPropertyValue( DFF_Prop_cropFromRight, 0 );
-
- if( nCropTop || nCropBottom || nCropLeft || nCropRight )
- {
- double fFactor;
- Size aCropSize;
- BitmapEx aCropBitmap;
- sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 );
-
- if ( pSet ) // use crop attributes ?
- aCropSize = lcl_GetPrefSize( rGraf, MAP_100TH_MM );
- else
- {
- aCropBitmap = rGraf.GetBitmapEx();
- aCropSize = aCropBitmap.GetSizePixel();
- }
- if ( nCropTop )
- {
- fFactor = (double)nCropTop / 65536.0;
- nTop = (sal_uInt32)( ( (double)( aCropSize.Height() + 1 ) * fFactor ) + 0.5 );
- }
- if ( nCropBottom )
- {
- fFactor = (double)nCropBottom / 65536.0;
- nBottom = (sal_uInt32)( ( (double)( aCropSize.Height() + 1 ) * fFactor ) + 0.5 );
- }
- if ( nCropLeft )
- {
- fFactor = (double)nCropLeft / 65536.0;
- nLeft = (sal_uInt32)( ( (double)( aCropSize.Width() + 1 ) * fFactor ) + 0.5 );
- }
- if ( nCropRight )
- {
- fFactor = (double)nCropRight / 65536.0;
- nRight = (sal_uInt32)( ( (double)( aCropSize.Width() + 1 ) * fFactor ) + 0.5 );
- }
- if ( pSet ) // use crop attributes ?
- pSet->Put( SdrGrafCropItem( nLeft, nTop, nRight, nBottom ) );
- else
- {
- Rectangle aCropRect( nLeft, nTop, aCropSize.Width() - nRight, aCropSize.Height() - nBottom );
- aCropBitmap.Crop( aCropRect );
- rGraf = aCropBitmap;
- }
- }
-}
-
-SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, const DffObjData& rObjData ) const
-{
- SdrObject* pRet = NULL;
- String aFilename;
- String aLinkFileName, aLinkFilterName;
- Rectangle aVisArea;
-
- MSO_BlipFlags eFlags = (MSO_BlipFlags)GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault );
- sal_uInt32 nBlipId = GetPropertyValue( DFF_Prop_pib, 0 );
- sal_Bool bGrfRead = sal_False,
-
- // Grafik verlinkt
- bLinkGrf = 0 != ( eFlags & mso_blipflagLinkToFile );
- {
- Graphic aGraf; // be sure this graphic is deleted before swapping out
- if( SeekToContent( DFF_Prop_pibName, rSt ) )
- MSDFFReadZString( rSt, aFilename, GetPropertyValue( DFF_Prop_pibName ), TRUE );
-
- // UND, ODER folgendes:
- if( !( eFlags & mso_blipflagDoNotSave ) ) // Grafik embedded
- {
- bGrfRead = GetBLIP( nBlipId, aGraf, &aVisArea );
- if ( !bGrfRead )
- {
- /*
- Still no luck, lets look at the end of this record for a FBSE pool,
- this fallback is a specific case for how word does it sometimes
- */
- rObjData.rSpHd.SeekToEndOfRecord( rSt );
- DffRecordHeader aHd;
- rSt >> aHd;
- if( DFF_msofbtBSE == aHd.nRecType )
- {
- const ULONG nSkipBLIPLen = 20;
- const ULONG nSkipShapePos = 4;
- const ULONG nSkipBLIP = 4;
- const ULONG nSkip =
- nSkipBLIPLen + 4 + nSkipShapePos + 4 + nSkipBLIP;
-
- if (nSkip <= aHd.nRecLen)
- {
- rSt.SeekRel(nSkip);
- if (0 == rSt.GetError())
- bGrfRead = GetBLIPDirect( rSt, aGraf, &aVisArea );
- }
- }
- }
- }
- if ( bGrfRead )
- {
- // the writer is doing it's own cropping, so this part affects only impress and calc
- if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_CROP_BITMAPS )
- lcl_ApplyCropping( *this, ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 ? &rSet : NULL, aGraf );
-
- if ( IsProperty( DFF_Prop_pictureTransparent ) )
- {
- UINT32 nTransColor = GetPropertyValue( DFF_Prop_pictureTransparent, 0 );
-
- if ( aGraf.GetType() == GRAPHIC_BITMAP )
- {
- BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
- Bitmap aBitmap( aBitmapEx.GetBitmap() );
- Bitmap aMask( aBitmap.CreateMask( MSO_CLR_ToColor( nTransColor, DFF_Prop_pictureTransparent ), 9 ) );
- if ( aBitmapEx.IsTransparent() )
- aMask.CombineSimple( aBitmapEx.GetMask(), BMP_COMBINE_OR );
- aGraf = BitmapEx( aBitmap, aMask );
- }
- }
-
- sal_Int32 nContrast = GetPropertyValue( DFF_Prop_pictureContrast, 0x10000 );
- /*
- 0x10000 is msoffice 50%
- < 0x10000 is in units of 1/50th of 0x10000 per 1%
- > 0x10000 is in units where
- a msoffice x% is stored as 50/(100-x) * 0x10000
-
- plus, a (ui) microsoft % ranges from 0 to 100, OOO
- from -100 to 100, so also normalize into that range
- */
- if ( nContrast > 0x10000 )
- {
- double fX = nContrast;
- fX /= 0x10000;
- fX /= 51; // 50 + 1 to round
- fX = 1/fX;
- nContrast = static_cast<sal_Int32>(fX);
- nContrast -= 100;
- nContrast = -nContrast;
- nContrast = (nContrast-50)*2;
- }
- else if ( nContrast == 0x10000 )
- nContrast = 0;
- else
- {
- nContrast *= 101; //100 + 1 to round
- nContrast /= 0x10000;
- nContrast -= 100;
- }
- sal_Int16 nBrightness = (sal_Int16)( (sal_Int32)GetPropertyValue( DFF_Prop_pictureBrightness, 0 ) / 327 );
- sal_Int32 nGamma = GetPropertyValue( DFF_Prop_pictureGamma, 0x10000 );
- GraphicDrawMode eDrawMode = GRAPHICDRAWMODE_STANDARD;
- switch ( GetPropertyValue( DFF_Prop_pictureActive ) & 6 )
- {
- case 4 : eDrawMode = GRAPHICDRAWMODE_GREYS; break;
- case 6 : eDrawMode = GRAPHICDRAWMODE_MONO; break;
- case 0 :
- {
- //office considers the converted values of (in OOo) 70 to be the
- //"watermark" values, which can vary slightly due to rounding from the
- //above values
- if (( nContrast == -70 ) && ( nBrightness == 70 ))
- {
- nContrast = 0;
- nBrightness = 0;
- eDrawMode = GRAPHICDRAWMODE_WATERMARK;
- };
- }
- break;
- }
-
- if ( nContrast || nBrightness || ( nGamma != 0x10000 ) || ( eDrawMode != GRAPHICDRAWMODE_STANDARD ) )
- {
- if ( ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 )
- {
- if ( nBrightness )
- rSet.Put( SdrGrafLuminanceItem( nBrightness ) );
- if ( nContrast )
- rSet.Put( SdrGrafContrastItem( (sal_Int16)nContrast ) );
- if ( nGamma != 0x10000 )
- rSet.Put( SdrGrafGamma100Item( nGamma / 655 ) );
- if ( eDrawMode != GRAPHICDRAWMODE_STANDARD )
- rSet.Put( SdrGrafModeItem( eDrawMode ) );
- }
- else
- {
- if ( eDrawMode == GRAPHICDRAWMODE_WATERMARK )
- {
- nContrast = 60;
- nBrightness = 70;
- eDrawMode = GRAPHICDRAWMODE_STANDARD;
- }
- switch ( aGraf.GetType() )
- {
- case GRAPHIC_BITMAP :
- {
- BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
- if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
- if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
- aBitmapEx.Convert( BMP_CONVERSION_8BIT_GREYS );
- else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
- aBitmapEx.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
- aGraf = aBitmapEx;
-
- }
- break;
-
- case GRAPHIC_GDIMETAFILE :
- {
- GDIMetaFile aGdiMetaFile( aGraf.GetGDIMetaFile() );
- if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
- if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
- aGdiMetaFile.Convert( MTF_CONVERSION_8BIT_GREYS );
- else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
- aGdiMetaFile.Convert( MTF_CONVERSION_1BIT_THRESHOLD );
- aGraf = aGdiMetaFile;
- }
- break;
- default: break;
- }
- }
- }
- }
-
- // sollte es ein OLE-Object sein?
- if( bGrfRead && !bLinkGrf && IsProperty( DFF_Prop_pictureId ) )
- {
- // TODO/LATER: in future probably the correct aspect should be provided here
- sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
- // --> OD 2004-12-14 #i32596# - pass <nCalledByGroup> to method
- pRet = ImportOLE( GetPropertyValue( DFF_Prop_pictureId ), aGraf, rObjData.aBoundRect, aVisArea, rObjData.nCalledByGroup, nAspect );
- // <--
- }
- if( !pRet )
- {
- pRet = new SdrGrafObj;
- if( bGrfRead )
- ((SdrGrafObj*)pRet)->SetGraphic( aGraf );
-
- if( bLinkGrf && !bGrfRead ) // sj: #i55484# if the graphic was embedded ( bGrfRead == true ) then
- { // we do not need to set a link. TODO: not to lose the information where the graphic is linked from
- UniString aName( ::URIHelper::SmartRel2Abs( INetURLObject(maBaseURL), aFilename, URIHelper::GetMaybeFileHdl(), true, false,
- INetURLObject::WAS_ENCODED,
- INetURLObject::DECODE_UNAMBIGUOUS ) );
-
- String aFilterName;
- INetURLObject aURLObj( aName );
-
- if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID )
- {
- String aValidURL;
-
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aValidURL ) )
- aURLObj = INetURLObject( aValidURL );
- }
-
- if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID )
- {
- GraphicFilter* pGrfFilter = GetGrfFilter();
- aFilterName = pGrfFilter->GetImportFormatName(
- pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) );
- }
-
- aLinkFileName = aName;
- aLinkFilterName = aFilterName;
- }
- }
-
- // set the size from BLIP if there is one
- if ( pRet && bGrfRead && !aVisArea.IsEmpty() )
- pRet->SetBLIPSizeRectangle( aVisArea );
-
- if ( !pRet->GetName().Len() ) // SJ 22.02.00 : PPT OLE IMPORT:
- { // name is already set in ImportOLE !!
- // JP 01.12.99: SetName before SetModel - because in the other order the Bug 70098 is active
- if ( ( eFlags & mso_blipflagType ) != mso_blipflagComment )
- {
- INetURLObject aURL;
- aURL.SetSmartURL( aFilename );
- pRet->SetName( aURL.getBase() );
- }
- else
- pRet->SetName( aFilename );
- }
- }
- pRet->SetModel( pSdrModel ); // fuer GraphicLink erforderlich
- pRet->SetLogicRect( rObjData.aBoundRect );
-
- if ( pRet->ISA( SdrGrafObj ) )
- {
- if( aLinkFileName.Len() )
- ((SdrGrafObj*)pRet)->SetGraphicLink( aLinkFileName, aLinkFilterName );
-
- if ( bLinkGrf && !bGrfRead )
- {
- ((SdrGrafObj*)pRet)->ForceSwapIn();
- Graphic aGraf(((SdrGrafObj*)pRet)->GetGraphic());
- lcl_ApplyCropping( *this, &rSet, aGraf );
- }
- ((SdrGrafObj*)pRet)->ForceSwapOut();
- }
-
- return pRet;
-}
-
-// PptSlidePersistEntry& rPersistEntry, SdPage* pPage
-SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId )
-{
- SdrObject* pRet = NULL;
- DffRecordHeader aObjHd;
- rSt >> aObjHd;
- if ( aObjHd.nRecType == DFF_msofbtSpgrContainer )
- {
- pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
- }
- else if ( aObjHd.nRecType == DFF_msofbtSpContainer )
- {
- pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
- }
- aObjHd.SeekToBegOfRecord( rSt ); // FilePos restaurieren
- return pRet;
-}
-
-SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
- int nCalledByGroup, sal_Int32* pShapeId )
-{
- SdrObject* pRet = NULL;
-
- if( pShapeId )
- *pShapeId = 0;
-
- rHd.SeekToContent( rSt );
- DffRecordHeader aRecHd; // the first atom has to be the SpContainer for the GroupObject
- rSt >> aRecHd;
- if ( aRecHd.nRecType == DFF_msofbtSpContainer )
- {
- INT32 nGroupRotateAngle = 0;
- INT32 nSpFlags = 0;
- mnFix16Angle = 0;
- aRecHd.SeekToBegOfRecord( rSt );
- pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
- if ( pRet )
- {
- nSpFlags = nGroupShapeFlags;
- nGroupRotateAngle = mnFix16Angle;
-
- Rectangle aClientRect( rClientRect );
-
- Rectangle aGlobalChildRect;
- if ( !nCalledByGroup || rGlobalChildRect.IsEmpty() )
- aGlobalChildRect = GetGlobalChildAnchor( rHd, rSt, aClientRect );
- else
- aGlobalChildRect = rGlobalChildRect;
-
- if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
- || ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
- {
- sal_Int32 nHalfWidth = ( aClientRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aClientRect.Left() + nHalfWidth - nHalfHeight,
- aClientRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aClientRect.GetHeight(), aClientRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- aClientRect = aNewRect;
- }
-
- // now importing the inner objects of the group
- aRecHd.SeekToEndOfRecord( rSt );
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aRecHd2;
- rSt >> aRecHd2;
- if ( aRecHd2.nRecType == DFF_msofbtSpgrContainer )
- {
- Rectangle aGroupClientAnchor, aGroupChildAnchor;
- GetGroupAnchors( aRecHd2, rSt, aGroupClientAnchor, aGroupChildAnchor, aClientRect, aGlobalChildRect );
- aRecHd2.SeekToBegOfRecord( rSt );
- sal_Int32 nShapeId;
- SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
- {
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
- if( nShapeId )
- insertShapeId( nShapeId, pTmp );
- }
- }
- else if ( aRecHd2.nRecType == DFF_msofbtSpContainer )
- {
- aRecHd2.SeekToBegOfRecord( rSt );
- sal_Int32 nShapeId;
- SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
- {
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
- if( nShapeId )
- insertShapeId( nShapeId, pTmp );
- }
- }
- aRecHd2.SeekToEndOfRecord( rSt );
- }
-
- // pRet->NbcSetSnapRect( aGroupBound );
- if ( nGroupRotateAngle )
- {
- double a = nGroupRotateAngle * nPi180;
- pRet->NbcRotate( aClientRect.Center(), nGroupRotateAngle, sin( a ), cos( a ) );
- }
- if ( nSpFlags & SP_FFLIPV ) // Vertikal gespiegelt?
- { // BoundRect in aBoundRect
- Point aLeft( aClientRect.Left(), ( aClientRect.Top() + aClientRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- if ( nSpFlags & SP_FFLIPH ) // Horizontal gespiegelt?
- { // BoundRect in aBoundRect
- Point aTop( ( aClientRect.Left() + aClientRect.Right() ) >> 1, aClientRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- }
- }
- return pRet;
-}
-
-SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
- int nCalledByGroup, sal_Int32* pShapeId )
-{
- SdrObject* pRet = NULL;
-
- if( pShapeId )
- *pShapeId = 0;
-
- rHd.SeekToBegOfRecord( rSt );
- DffObjData aObjData( rHd, rClientRect, nCalledByGroup );
- maShapeRecords.Consume( rSt, FALSE );
- aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING );
- if ( aObjData.bShapeType )
- {
- rSt >> aObjData.nShapeId
- >> aObjData.nSpFlags;
- aObjData.eShapeType = (MSO_SPT)maShapeRecords.Current()->nRecInstance;
- }
- else
- {
- aObjData.nShapeId = 0;
- aObjData.nSpFlags = 0;
- aObjData.eShapeType = mso_sptNil;
- }
-
- if( pShapeId )
- *pShapeId = aObjData.nShapeId;
-
- if ( mbTracing )
- mpTracer->AddAttribute( aObjData.nSpFlags & SP_FGROUP
- ? rtl::OUString::createFromAscii( "GroupShape" )
- : rtl::OUString::createFromAscii( "Shape" ),
- rtl::OUString::valueOf( (sal_Int32)aObjData.nShapeId ) );
- aObjData.bOpt = maShapeRecords.SeekToContent( rSt, DFF_msofbtOPT, SEEK_FROM_CURRENT_AND_RESTART );
- if ( aObjData.bOpt )
- {
- maShapeRecords.Current()->SeekToBegOfRecord( rSt );
-#ifdef DBG_AUTOSHAPE
- ReadPropSet( rSt, pClientData, (UINT32)aObjData.eShapeType );
-#else
- ReadPropSet( rSt, pClientData );
-#endif
- }
- else
- {
- InitializePropSet(); // get the default PropSet
- ( (DffPropertyReader*) this )->mnFix16Angle = 0;
- }
-
- aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART );
- if ( aObjData.bChildAnchor )
- {
- INT32 l, o, r, u;
- rSt >> l >> o >> r >> u;
- Scale( l );
- Scale( o );
- Scale( r );
- Scale( u );
- aObjData.aChildAnchor = Rectangle( l, o, r, u );
- if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
- {
- double fl = l;
- double fo = o;
- double fWidth = r - l;
- double fHeight= u - o;
- double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
- double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
- fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
- fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
- fWidth *= fXScale;
- fHeight *= fYScale;
- aObjData.aChildAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
- }
- }
-
- aObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtClientAnchor, SEEK_FROM_CURRENT_AND_RESTART );
- if ( aObjData.bClientAnchor )
- ProcessClientAnchor2( rSt, *maShapeRecords.Current(), pClientData, aObjData );
-
- if ( aObjData.bChildAnchor )
- aObjData.aBoundRect = aObjData.aChildAnchor;
-
- if ( aObjData.nSpFlags & SP_FBACKGROUND )
- aObjData.aBoundRect = Rectangle( Point(), Size( 1, 1 ) );
-
- Rectangle aTextRect;
- if ( !aObjData.aBoundRect.IsEmpty() )
- { // Rotation auf BoundingBox anwenden, BEVOR ien Objekt generiert wurde
- if( mnFix16Angle )
- {
- long nAngle = mnFix16Angle;
- if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) )
- {
- INT32 nHalfWidth = ( aObjData.aBoundRect.GetWidth() + 1 ) >> 1;
- INT32 nHalfHeight = ( aObjData.aBoundRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aObjData.aBoundRect.Left() + nHalfWidth - nHalfHeight,
- aObjData.aBoundRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aObjData.aBoundRect.GetHeight(), aObjData.aBoundRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- aObjData.aBoundRect = aNewRect;
- }
- }
- aTextRect = aObjData.aBoundRect;
- FASTBOOL bGraphic = IsProperty( DFF_Prop_pib ) ||
- IsProperty( DFF_Prop_pibName ) ||
- IsProperty( DFF_Prop_pibFlags );
-
- if ( aObjData.nSpFlags & SP_FGROUP )
- {
- pRet = new SdrObjGroup;
- /* After CWS aw033 has been integrated, an empty group object
- cannot store its resulting bounding rectangle anymore. We have
- to return this rectangle via rClientRect now, but only, if
- caller has not passed an own bounding ractangle. */
- if ( rClientRect.IsEmpty() )
- rClientRect = aObjData.aBoundRect;
- nGroupShapeFlags = aObjData.nSpFlags; // #73013#
- }
- else if ( ( aObjData.eShapeType != mso_sptNil ) || IsProperty( DFF_Prop_pVertices ) || bGraphic )
- {
- SfxItemSet aSet( pSdrModel->GetItemPool() );
-
- sal_Bool bIsConnector = ( ( aObjData.eShapeType >= mso_sptStraightConnector1 ) && ( aObjData.eShapeType <= mso_sptCurvedConnector5 ) );
- sal_Bool bIsCustomShape = sal_False;
- sal_Int32 nObjectRotation = mnFix16Angle;
- sal_uInt32 nSpFlags = aObjData.nSpFlags;
-
- if ( bGraphic )
- {
- pRet = ImportGraphic( rSt, aSet, aObjData ); // SJ: #68396# is no longer true (fixed in ppt2000)
- ApplyAttributes( rSt, aSet, aObjData );
- pRet->SetMergedItemSet(aSet);
- }
- else if ( aObjData.eShapeType == mso_sptLine )
- {
- basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
- pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
- pRet->SetModel( pSdrModel );
- ApplyAttributes( rSt, aSet, aObjData );
- pRet->SetMergedItemSet(aSet);
- }
- else
- {
- if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )
- {
-
- ApplyAttributes( rSt, aSet, aObjData );
-
-// the com.sun.star.drawing.EnhancedCustomShapeEngine is default, so we do not need to set a hard attribute
-// aSet.Put( SdrCustomShapeEngineItem( String::CreateFromAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) );
- pRet = new SdrObjCustomShape();
- pRet->SetModel( pSdrModel );
-
- sal_Bool bIsFontwork = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) != 0;
-
- // in case of a FontWork, the text is set by the escher import
- if ( bIsFontwork )
- {
- String aObjectText;
- String aFontName;
- MSO_GeoTextAlign eGeoTextAlign;
-
- if ( SeekToContent( DFF_Prop_gtextFont, rSt ) )
- {
- SvxFontItem aLatin(EE_CHAR_FONTINFO), aAsian(EE_CHAR_FONTINFO_CJK), aComplex(EE_CHAR_FONTINFO_CTL);
- GetDefaultFonts( aLatin, aAsian, aComplex );
-
- MSDFFReadZString( rSt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
- aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
- aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO_CJK ) );
- aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO_CTL ) );
- }
-
- // SJ: applying fontattributes for Fontwork :
- if ( IsHardAttribute( DFF_Prop_gtextFItalic ) )
- aSet.Put( SvxPostureItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0010 ) != 0 ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
-
- if ( IsHardAttribute( DFF_Prop_gtextFBold ) )
- aSet.Put( SvxWeightItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0020 ) != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
-
- // SJ TODO: Vertical Writing is not correct, instead this should be
- // replaced through "CharacterRotation" by 90°, therefore a new Item has to be
- // supported by svx core, api and xml file format
- ((SdrObjCustomShape*)pRet)->SetVerticalWriting( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 ) != 0 );
-
- if ( SeekToContent( DFF_Prop_gtextUNICODE, rSt ) )
- {
- MSDFFReadZString( rSt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
- ReadObjText( aObjectText, pRet );
- }
-
- eGeoTextAlign = ( (MSO_GeoTextAlign)GetPropertyValue( DFF_Prop_gtextAlign, mso_alignTextCenter ) );
- {
- SdrTextHorzAdjust eHorzAdjust;
- switch( eGeoTextAlign )
- {
- case mso_alignTextLetterJust :
- case mso_alignTextWordJust :
- case mso_alignTextStretch : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
- default:
- case mso_alignTextInvalid :
- case mso_alignTextCenter : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
- case mso_alignTextLeft : eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
- case mso_alignTextRight : eHorzAdjust = SDRTEXTHORZADJUST_RIGHT; break;
- }
- aSet.Put( SdrTextHorzAdjustItem( eHorzAdjust ) );
-
- SdrFitToSizeType eFTS = SDRTEXTFIT_NONE;
- if ( eGeoTextAlign == mso_alignTextStretch )
- eFTS = SDRTEXTFIT_ALLLINES;
- aSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- }
- if ( IsProperty( DFF_Prop_gtextSpacing ) )
- {
- sal_Int32 nTextWidth = GetPropertyValue( DFF_Prop_gtextSpacing, 100 < 16 ) / 655;
- if ( nTextWidth != 100 )
- aSet.Put( SvxCharScaleWidthItem( (sal_uInt16)nTextWidth, EE_CHAR_FONTWIDTH ) );
- }
- if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x1000 ) // SJ: Font Kerning On ?
- aSet.Put( SvxKerningItem( 1, EE_CHAR_KERNING ) );
- }
- pRet->SetMergedItemSet( aSet );
-
- // sj: taking care of rtl, ltr. In case of fontwork mso. seems not to be able to set
- // proper text directions, instead the text default is depending to the string.
- // so we have to calculate the a text direction from string:
- if ( bIsFontwork )
- {
- OutlinerParaObject* pParaObj = ((SdrObjCustomShape*)pRet)->GetOutlinerParaObject();
- if ( pParaObj )
- {
- SdrOutliner& rOutliner = ((SdrObjCustomShape*)pRet)->ImpGetDrawOutliner();
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- SdrModel* pModel = pRet->GetModel();
- if ( pModel )
- rOutliner.SetStyleSheetPool( (SfxStyleSheetPool*)pModel->GetStyleSheetPool() );
- rOutliner.SetUpdateMode( FALSE );
- rOutliner.SetText( *pParaObj );
- VirtualDevice aVirDev( 1 );
- aVirDev.SetMapMode( MAP_100TH_MM );
- sal_uInt32 i, nParagraphs = rOutliner.GetParagraphCount();
- if ( nParagraphs )
- {
- sal_Bool bCreateNewParaObject = sal_False;
- for ( i = 0; i < nParagraphs; i++ )
- {
- BOOL bIsRTL = aVirDev.GetTextIsRTL( rOutliner.GetText( rOutliner.GetParagraph( i ) ), 0, STRING_LEN );
- if ( bIsRTL )
- {
- SfxItemSet aSet2( rOutliner.GetParaAttribs( (USHORT)i ) );
- aSet2.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
- rOutliner.SetParaAttribs( (USHORT)i, aSet2 );
- bCreateNewParaObject = sal_True;
- }
- }
- if ( bCreateNewParaObject )
- {
- OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
- rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
- ((SdrObjCustomShape*)pRet)->NbcSetOutlinerParaObject( pNewText );
- }
- }
- rOutliner.Clear();
- rOutliner.SetUpdateMode( bOldUpdateMode );
- }
- }
-
- // mso_sptArc special treating:
- // sj: since we actually can't render the arc because of its weird SnapRect settings,
- // we will create a new CustomShape, that can be saved/loaded without problems.
- // We will change the shape type, so this code applys only if importing arcs from msoffice.
- if ( aObjData.eShapeType == mso_sptArc )
- {
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- const rtl::OUString sCoordinates( RTL_CONSTASCII_USTRINGPARAM ( "Coordinates" ) );
- const rtl::OUString sHandles( RTL_CONSTASCII_USTRINGPARAM ( "Handles" ) );
- const rtl::OUString sEquations( RTL_CONSTASCII_USTRINGPARAM ( "Equations" ) );
- const rtl::OUString sViewBox( RTL_CONSTASCII_USTRINGPARAM ( "ViewBox" ) );
- const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM ( "Path" ) );
- const rtl::OUString sTextFrames( RTL_CONSTASCII_USTRINGPARAM ( "TextFrames" ) );
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pRet)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> seqCoordinates;
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues;
-
- // before clearing the GeometryItem we have to store the current Coordinates
- const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates );
- Rectangle aPolyBoundRect;
- if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) )
- {
- sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength();
- XPolygon aXP( (sal_uInt16)nNumElemVert );
-// const EnhancedCustomShapeParameterPair* pTmp = seqCoordinates.getArray();
- for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
- {
- Point aP;
- sal_Int32 nX = 0, nY = 0;
- seqCoordinates[ nPtNum ].First.Value >>= nX;
- seqCoordinates[ nPtNum ].Second.Value >>= nY;
- aP.X() = nX;
- aP.Y() = nY;
- aXP[ (sal_uInt16)nPtNum ] = aP;
- }
- aPolyBoundRect = Rectangle( aXP.GetBoundRect() );
- }
- else
- aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting
-
- // clearing items, so MergeDefaultAttributes will set the corresponding defaults from EnhancedCustomShapeGeometry
- aGeometryItem.ClearPropertyValue( sHandles );
- aGeometryItem.ClearPropertyValue( sEquations );
- aGeometryItem.ClearPropertyValue( sViewBox );
- aGeometryItem.ClearPropertyValue( sPath );
-
- sal_Int32 nEndAngle = 9000;
- sal_Int32 nStartAngle = 0;
- pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sAdjustmentValues );
- if ( pAny && ( *pAny >>= seqAdjustmentValues ) && seqAdjustmentValues.getLength() > 1 )
- {
- double fNumber;
- if ( seqAdjustmentValues[ 0 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE )
- {
- seqAdjustmentValues[ 0 ].Value >>= fNumber;
- nEndAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
- }
- else
- {
- fNumber = 270.0;
- seqAdjustmentValues[ 0 ].Value <<= fNumber;
- seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored
- }
-
- if ( seqAdjustmentValues[ 1 ].State == com::sun::star::beans::PropertyState_DIRECT_VALUE )
- {
- seqAdjustmentValues[ 1 ].Value >>= fNumber;
- nStartAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
- }
- else
- {
- fNumber = 0.0;
- seqAdjustmentValues[ 0 ].Value <<= fNumber;
- seqAdjustmentValues[ 1 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
- }
-
- PropertyValue aPropVal;
- aPropVal.Name = sAdjustmentValues;
- aPropVal.Value <<= seqAdjustmentValues;
- aGeometryItem.SetPropertyValue( aPropVal ); // storing the angle attribute
- }
- if ( nStartAngle != nEndAngle )
- {
- XPolygon aXPoly( aPolyBoundRect.Center(), aPolyBoundRect.GetWidth() / 2, aPolyBoundRect.GetHeight() / 2,
- (USHORT)nStartAngle / 10, (USHORT)nEndAngle / 10, TRUE );
- Rectangle aPolyPieRect( aXPoly.GetBoundRect() );
-
- double fYScale, fXScale;
- double fYOfs, fXOfs;
-
- Point aP( aObjData.aBoundRect.Center() );
- Size aS( aObjData.aBoundRect.GetSize() );
- aP.X() -= aS.Width() / 2;
- aP.Y() -= aS.Height() / 2;
- Rectangle aLogicRect( aP, aS );
-
- fYOfs = fXOfs = 0.0;
-
- if ( aPolyBoundRect.GetWidth() && aPolyPieRect.GetWidth() )
- {
- fXScale = (double)aLogicRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- if ( nSpFlags & SP_FFLIPH )
- fXOfs = ( (double)aPolyPieRect.Right() - (double)aPolyBoundRect.Right() ) * fXScale;
- else
- fXOfs = ( (double)aPolyBoundRect.Left() - (double)aPolyPieRect.Left() ) * fXScale;
- }
- if ( aPolyBoundRect.GetHeight() && aPolyPieRect.GetHeight() )
- {
- fYScale = (double)aLogicRect.GetHeight() / (double)aPolyPieRect.GetHeight();
- if ( nSpFlags & SP_FFLIPV )
- fYOfs = ( (double)aPolyPieRect.Bottom() - (double)aPolyBoundRect.Bottom() ) * fYScale;
- else
- fYOfs = ((double)aPolyBoundRect.Top() - (double)aPolyPieRect.Top() ) * fYScale;
- }
-
- fXScale = (double)aPolyBoundRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- fYScale = (double)aPolyBoundRect.GetHeight() / (double)aPolyPieRect.GetHeight();
-
- Rectangle aOldBoundRect( aObjData.aBoundRect );
- aObjData.aBoundRect = Rectangle( Point( aLogicRect.Left() + (sal_Int32)fXOfs, aLogicRect.Top() + (sal_Int32)fYOfs ),
- Size( (sal_Int32)( aLogicRect.GetWidth() * fXScale ), (sal_Int32)( aLogicRect.GetHeight() * fYScale ) ) );
-
- // creating the text frame -> scaling into (0,0),(21600,21600) destination coordinate system
- double fTextFrameScaleX = (double)21600 / (double)aPolyBoundRect.GetWidth();
- double fTextFrameScaleY = (double)21600 / (double)aPolyBoundRect.GetHeight();
- sal_Int32 nLeft = (sal_Int32)(( aPolyPieRect.Left() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
- sal_Int32 nTop = (sal_Int32)(( aPolyPieRect.Top() - aPolyBoundRect.Top() ) * fTextFrameScaleY );
- sal_Int32 nRight = (sal_Int32)(( aPolyPieRect.Right() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
- sal_Int32 nBottom= (sal_Int32)(( aPolyPieRect.Bottom()- aPolyBoundRect.Top() ) * fTextFrameScaleY );
- com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrame( 1 );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.First, nLeft );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.Second, nTop );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].BottomRight.First, nRight );
- EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].BottomRight.Second,nBottom );
- PropertyValue aProp;
- aProp.Name = sTextFrames;
- aProp.Value <<= aTextFrame;
- aGeometryItem.SetPropertyValue( sPath, aProp );
-
- // sj: taking care of the different rotation points, since the new arc is having a bigger snaprect
- if ( mnFix16Angle )
- {
- sal_Int32 nAngle = mnFix16Angle;
- if ( nSpFlags & SP_FFLIPH )
- nAngle = 36000 - nAngle;
- if ( nSpFlags & SP_FFLIPV )
- nAngle = -nAngle;
- double a = nAngle * F_PI18000;
- double ss = sin( a );
- double cc = cos( a );
- Point aP1( aOldBoundRect.TopLeft() );
- Point aC1( aObjData.aBoundRect.Center() );
- Point aP2( aOldBoundRect.TopLeft() );
- Point aC2( aOldBoundRect.Center() );
- RotatePoint( aP1, aC1, ss, cc );
- RotatePoint( aP2, aC2, ss, cc );
- aObjData.aBoundRect.Move( aP2.X() - aP1.X(), aP2.Y() - aP1.Y() );
- }
- }
- ((SdrObjCustomShape*)pRet)->SetMergedItem( aGeometryItem );
- ((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
-
- // now setting a new name, so the above correction is only done once when importing from ms
- SdrCustomShapeGeometryItem aGeoName( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pRet)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- const rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM ( "mso-spt100" ) );
- PropertyValue aPropVal;
- aPropVal.Name = sType;
- aPropVal.Value <<= sName;
- aGeoName.SetPropertyValue( aPropVal );
- ((SdrObjCustomShape*)pRet)->SetMergedItem( aGeoName );
- }
- else
- ((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
-
- pRet->SetSnapRect( aObjData.aBoundRect );
- EnhancedCustomShape2d aCustomShape2d( pRet );
- aTextRect = aCustomShape2d.GetTextRect();
-
- bIsCustomShape = TRUE;
-
- if( bIsConnector )
- {
- if( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
- }
- // Horizontal gespiegelt?
- if ( nSpFlags & SP_FFLIPH )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- // Vertikal gespiegelt?
- if ( nSpFlags & SP_FFLIPV )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- basegfx::B2DPolyPolygon aPoly( SdrObjCustomShape::GetLineGeometry( (SdrObjCustomShape*)pRet, sal_True ) );
- SdrObject::Free( pRet );
-
- pRet = new SdrEdgeObj();
- pRet->SetLogicRect( aObjData.aBoundRect );
-
- // Konnektoren
- MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight );
-
- ((SdrEdgeObj*)pRet)->ConnectToNode(TRUE, NULL);
- ((SdrEdgeObj*)pRet)->ConnectToNode(FALSE, NULL);
-
- Point aPoint1( aObjData.aBoundRect.TopLeft() );
- Point aPoint2( aObjData.aBoundRect.BottomRight() );
-
- // Rotationen beachten
- if ( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- Point aCenter( aObjData.aBoundRect.Center() );
- double ss = sin(a);
- double cc = cos(a);
-
- RotatePoint(aPoint1, aCenter, ss, cc);
- RotatePoint(aPoint2, aCenter, ss, cc);
- }
-
- // Linie innerhalb des Bereiches zurechtdrehen/spiegeln
- if ( nSpFlags & SP_FFLIPH )
- {
- INT32 n = aPoint1.X();
- aPoint1.X() = aPoint2.X();
- aPoint2.X() = n;
- }
- if ( nSpFlags & SP_FFLIPV )
- {
- INT32 n = aPoint1.Y();
- aPoint1.Y() = aPoint2.Y();
- aPoint2.Y() = n;
- }
- nSpFlags &= ~( SP_FFLIPV | SP_FFLIPH );
-
- pRet->NbcSetPoint(aPoint1, 0L); // Startpunkt
- pRet->NbcSetPoint(aPoint2, 1L); // Endpunkt
-
- sal_Int32 n1HorzDist, n1VertDist, n2HorzDist, n2VertDist;
- n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 0;
- switch( eConnectorStyle )
- {
- case mso_cxstyleBent:
- {
- aSet.Put( SdrEdgeKindItem( SDREDGE_ORTHOLINES ) );
- n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 630;
- }
- break;
- case mso_cxstyleCurved:
- aSet.Put( SdrEdgeKindItem( SDREDGE_BEZIER ) );
- break;
- default: // mso_cxstyleStraight || mso_cxstyleNone
- aSet.Put( SdrEdgeKindItem( SDREDGE_ONELINE ) );
- break;
- }
- aSet.Put( SdrEdgeNode1HorzDistItem( n1HorzDist ) );
- aSet.Put( SdrEdgeNode1VertDistItem( n1VertDist ) );
- aSet.Put( SdrEdgeNode2HorzDistItem( n2HorzDist ) );
- aSet.Put( SdrEdgeNode2VertDistItem( n2VertDist ) );
-
- ((SdrEdgeObj*)pRet)->SetEdgeTrackPath( aPoly );
- }
- }
- }
-
- if ( pRet )
- {
- if( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
- }
- // Horizontal gespiegelt?
- if ( nSpFlags & SP_FFLIPH )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- // Vertikal gespiegelt?
- if ( nSpFlags & SP_FFLIPV )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- }
- }
- }
-
- // #i51348# #118052# name of the shape
- if( pRet )
- {
- ::rtl::OUString aObjName = GetPropertyString( DFF_Prop_wzName, rSt );
- if( aObjName.getLength() > 0 )
- pRet->SetName( aObjName );
- }
-
- pRet =
- ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
-
- if ( mbTracing )
- mpTracer->RemoveAttribute( aObjData.nSpFlags & SP_FGROUP
- ? rtl::OUString::createFromAscii( "GroupShape" )
- : rtl::OUString::createFromAscii( "Shape" ) );
- return pRet;
-}
-
-Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect )
-{
- Rectangle aChildAnchor;
- rHd.SeekToContent( rSt );
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aShapeHd;
- rSt >> aShapeHd;
- if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
- ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
- {
- DffRecordHeader aShapeHd2( aShapeHd );
- if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
- rSt >> aShapeHd2;
- while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
- {
- DffRecordHeader aShapeAtom;
- rSt >> aShapeAtom;
-
- if ( aShapeAtom.nRecType == DFF_msofbtClientAnchor )
- {
- if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_PPT )
- {
- sal_Int32 l, t, r, b;
- if ( aShapeAtom.nRecLen == 16 )
- {
- rSt >> l >> t >> r >> b;
- }
- else
- {
- INT16 ls, ts, rs, bs;
- rSt >> ts >> ls >> rs >> bs; // etwas seltsame Koordinatenreihenfolge ...
- l = ls, t = ts, r = rs, b = bs;
- }
- Scale( l );
- Scale( t );
- Scale( r );
- Scale( b );
- aClientRect = Rectangle( l, t, r, b );
- }
- break;
- }
- else if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
- {
- sal_Int32 l, o, r, u;
- rSt >> l >> o >> r >> u;
- Scale( l );
- Scale( o );
- Scale( r );
- Scale( u );
- Rectangle aChild( l, o, r, u );
- aChildAnchor.Union( aChild );
- break;
- }
- aShapeAtom.SeekToEndOfRecord( rSt );
- }
- }
- aShapeHd.SeekToEndOfRecord( rSt );
- }
- return aChildAnchor;
-}
-
-void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,
- Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
- const Rectangle& rClientRect, const Rectangle& rGlobalChildRect )
-{
- sal_Bool bFirst = sal_True;
- rHd.SeekToContent( rSt );
- DffRecordHeader aShapeHd;
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
- {
- rSt >> aShapeHd;
- if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) ||
- ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
- {
- DffRecordHeader aShapeHd2( aShapeHd );
- if ( aShapeHd.nRecType == DFF_msofbtSpgrContainer )
- rSt >> aShapeHd2;
- while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aShapeHd2.GetRecEndFilePos() ) )
- {
- DffRecordHeader aShapeAtom;
- rSt >> aShapeAtom;
- if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
- {
- sal_Int32 l, o, r, u;
- rSt >> l >> o >> r >> u;
- Scale( l );
- Scale( o );
- Scale( r );
- Scale( u );
- Rectangle aChild( l, o, r, u );
-
- if ( bFirst )
- {
- if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
- {
- double fl = l;
- double fo = o;
- double fWidth = r - l;
- double fHeight= u - o;
- double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
- double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
- fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
- fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
- fWidth *= fXScale;
- fHeight *= fYScale;
- rGroupClientAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
- }
- bFirst = sal_False;
- }
- else
- rGroupChildAnchor.Union( aChild );
- break;
- }
- aShapeAtom.SeekToEndOfRecord( rSt );
- }
- }
- aShapeHd.SeekToEndOfRecord( rSt );
- }
-}
-
-SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
- DffObjData& rObjData,
- void* pData,
- Rectangle& rTextRect,
- SdrObject* pObj
- )
-{
- if( !rTextRect.IsEmpty() )
- {
- SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
- SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
- SvxMSDffImportRec* pTextImpRec = pImpRec;
-
- // fill Import Record with data
- pImpRec->nShapeId = rObjData.nShapeId;
- pImpRec->eShapeType = rObjData.eShapeType;
-
- MSO_WrapMode eWrapMode( (MSO_WrapMode)GetPropertyValue(
- DFF_Prop_WrapText,
- mso_wrapSquare ) );
- rObjData.bClientAnchor = maShapeRecords.SeekToContent( rSt,
- DFF_msofbtClientAnchor,
- SEEK_FROM_CURRENT_AND_RESTART );
- if( rObjData.bClientAnchor )
- ProcessClientAnchor( rSt,
- maShapeRecords.Current()->nRecLen,
- pImpRec->pClientAnchorBuffer, pImpRec->nClientAnchorLen );
-
- rObjData.bClientData = maShapeRecords.SeekToContent( rSt,
- DFF_msofbtClientData,
- SEEK_FROM_CURRENT_AND_RESTART );
- if( rObjData.bClientData )
- ProcessClientData( rSt,
- maShapeRecords.Current()->nRecLen,
- pImpRec->pClientDataBuffer, pImpRec->nClientDataLen );
-
-
- // process user (== Winword) defined parameters in 0xF122 record
- if( maShapeRecords.SeekToContent( rSt,
- DFF_msofbtUDefProp,
- SEEK_FROM_CURRENT_AND_RESTART )
- && maShapeRecords.Current()->nRecLen )
- {
- UINT32 nBytesLeft = maShapeRecords.Current()->nRecLen;
- UINT32 nUDData;
- UINT16 nPID;
- while( 5 < nBytesLeft )
- {
- rSt >> nPID;
- if ( rSt.GetError() != 0 )
- break;
- rSt >> nUDData;
- switch( nPID )
- {
- case 0x038F: pImpRec->nXAlign = nUDData; break;
- case 0x0390: pImpRec->nXRelTo = nUDData; break;
- case 0x0391: pImpRec->nYAlign = nUDData; break;
- case 0x0392: pImpRec->nYRelTo = nUDData; break;
- case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
- }
- if ( rSt.GetError() != 0 )
- break;
- pImpRec->bHasUDefProp = TRUE;
- nBytesLeft -= 6;
- }
- }
-
- // Textrahmen, auch Title oder Outline
- SdrObject* pOrgObj = pObj;
- SdrRectObj* pTextObj = 0;
- UINT32 nTextId = GetPropertyValue( DFF_Prop_lTxid, 0 );
- if( nTextId )
- {
- SfxItemSet aSet( pSdrModel->GetItemPool() );
-
- //Originally anything that as a mso_sptTextBox was created as a
- //textbox, this was changed for #88277# to be created as a simple
- //rect to keep impress happy. For the rest of us we'd like to turn
- //it back into a textbox again.
- FASTBOOL bTextFrame = (pImpRec->eShapeType == mso_sptTextBox);
- if (!bTextFrame)
- {
- //Either
- //a) its a simple text object or
- //b) its a rectangle with text and square wrapping.
- bTextFrame =
- (
- (pImpRec->eShapeType == mso_sptTextSimple) ||
- (
- (pImpRec->eShapeType == mso_sptRectangle)
- && (eWrapMode == mso_wrapSquare)
- && ShapeHasText(pImpRec->nShapeId, rObjData.rSpHd.GetRecBegFilePos() )
- )
- );
- }
-
- if (bTextFrame)
- {
- SdrObject::Free( pObj );
- pObj = pOrgObj = 0;
- }
-
- // Distance of Textbox to it's surrounding Customshape
- INT32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 91440L);
- INT32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 91440L );
- INT32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 45720L );
- INT32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 45720L );
-
- ScaleEmu( nTextLeft );
- ScaleEmu( nTextRight );
- ScaleEmu( nTextTop );
- ScaleEmu( nTextBottom );
-
- INT32 nTextRotationAngle=0;
- bool bVerticalText = false;
- if ( IsProperty( DFF_Prop_txflTextFlow ) )
- {
- MSO_TextFlow eTextFlow = (MSO_TextFlow)(GetPropertyValue(
- DFF_Prop_txflTextFlow) & 0xFFFF);
- switch( eTextFlow )
- {
- case mso_txflBtoT:
- nTextRotationAngle = 9000;
- break;
- case mso_txflVertN:
- case mso_txflTtoBN:
- nTextRotationAngle = 27000;
- break;
- case mso_txflTtoBA:
- bVerticalText = true;
- break;
- case mso_txflHorzA:
- bVerticalText = true;
- nTextRotationAngle = 9000;
- case mso_txflHorzN:
- default :
- break;
- }
- }
-
- if (nTextRotationAngle)
- {
- while (nTextRotationAngle > 360000)
- nTextRotationAngle-=9000;
- switch (nTextRotationAngle)
- {
- case 9000:
- {
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
-
- INT32 nOldTextLeft = nTextLeft;
- INT32 nOldTextRight = nTextRight;
- INT32 nOldTextTop = nTextTop;
- INT32 nOldTextBottom = nTextBottom;
-
- nTextLeft = nOldTextBottom;
- nTextRight = nOldTextTop;
- nTextTop = nOldTextLeft;
- nTextBottom = nOldTextRight;
- }
- break;
- case 27000:
- {
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
-
- INT32 nOldTextLeft = nTextLeft;
- INT32 nOldTextRight = nTextRight;
- INT32 nOldTextTop = nTextTop;
- INT32 nOldTextBottom = nTextBottom;
-
- nTextLeft = nOldTextTop;
- nTextRight = nOldTextBottom;
- nTextTop = nOldTextRight;
- nTextBottom = nOldTextLeft;
- }
- break;
- default:
- break;
- }
- }
-
- pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
- pTextImpRec = new SvxMSDffImportRec(*pImpRec);
-
- // Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
- // hier rausrechnen
- Rectangle aNewRect(rTextRect);
- aNewRect.Bottom() -= nTextTop + nTextBottom;
- aNewRect.Right() -= nTextLeft + nTextRight;
-
- // Nur falls es eine einfache Textbox ist, darf der Writer
- // das Objekt durch einen Rahmen ersetzen, ansonsten
- if( bTextFrame )
- {
- SvxMSDffShapeInfo aTmpRec( 0, pImpRec->nShapeId );
- aTmpRec.bSortByShapeId = TRUE;
-
- USHORT nFound;
- if( pShapeInfos->Seek_Entry( &aTmpRec, &nFound ) )
- {
- SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject(nFound);
- pTextImpRec->bReplaceByFly = rInfo.bReplaceByFly;
- pTextImpRec->bLastBoxInChain = rInfo.bLastBoxInChain;
- }
- }
-
- if( !pObj )
- ApplyAttributes( rSt, aSet, rObjData );
-
- bool bFitText = false;
- if (GetPropertyValue(DFF_Prop_FitTextToShape) & 2)
- {
- aSet.Put( SdrTextAutoGrowHeightItem( TRUE ) );
- aSet.Put( SdrTextMinFrameHeightItem(
- aNewRect.Bottom() - aNewRect.Top() ) );
- aSet.Put( SdrTextMinFrameWidthItem(
- aNewRect.Right() - aNewRect.Left() ) );
- bFitText = true;
- }
- else
- {
- aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
- aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
- }
-
- switch ( (MSO_WrapMode)
- GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
- {
- case mso_wrapNone :
- aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
- if (bFitText)
- {
- //can't do autowidth in flys #i107184#
- pTextImpRec->bReplaceByFly = false;
- }
- break;
- case mso_wrapByPoints :
- aSet.Put( SdrTextContourFrameItem( TRUE ) );
- break;
- default: break;
- }
-
- // Abstaende an den Raendern der Textbox setzen
- aSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- aSet.Put( SdrTextRightDistItem( nTextRight ) );
- aSet.Put( SdrTextUpperDistItem( nTextTop ) );
- aSet.Put( SdrTextLowerDistItem( nTextBottom ) );
- pTextImpRec->nDxTextLeft = nTextLeft;
- pTextImpRec->nDyTextTop = nTextTop;
- pTextImpRec->nDxTextRight = nTextRight;
- pTextImpRec->nDyTextBottom = nTextBottom;
-
- // Textverankerung lesen
- if ( IsProperty( DFF_Prop_anchorText ) )
- {
- MSO_Anchor eTextAnchor =
- (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText );
-
- SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_CENTER;
- BOOL bTVASet(FALSE);
- SdrTextHorzAdjust eTHA = SDRTEXTHORZADJUST_CENTER;
- BOOL bTHASet(FALSE);
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- {
- eTVA = SDRTEXTVERTADJUST_TOP;
- bTVASet = TRUE;
- }
- break;
- case mso_anchorTopCentered:
- {
- eTVA = SDRTEXTVERTADJUST_TOP;
- bTVASet = TRUE;
- bTHASet = TRUE;
- }
- break;
-
- case mso_anchorMiddle:
- bTVASet = TRUE;
- break;
- case mso_anchorMiddleCentered:
- {
- bTVASet = TRUE;
- bTHASet = TRUE;
- }
- break;
- case mso_anchorBottom:
- {
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- bTVASet = TRUE;
- }
- break;
- case mso_anchorBottomCentered:
- {
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- bTVASet = TRUE;
- bTHASet = TRUE;
- }
- break;
- /*
- case mso_anchorTopBaseline:
- case mso_anchorBottomBaseline:
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- break;
- */
- default : break;
- }
- // Einsetzen
- if ( bTVASet )
- aSet.Put( SdrTextVertAdjustItem( eTVA ) );
- if ( bTHASet )
- aSet.Put( SdrTextHorzAdjustItem( eTHA ) );
- }
-
- pTextObj->SetMergedItemSet(aSet);
- pTextObj->SetModel(pSdrModel);
-
- if (bVerticalText)
- pTextObj->SetVerticalWriting(sal_True);
-
- if (nTextRotationAngle)
- {
- long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
- rTextRect.GetWidth() : rTextRect.GetHeight();
- nMinWH /= 2;
- Point aPivot(rTextRect.TopLeft());
- aPivot.X() += nMinWH;
- aPivot.Y() += nMinWH;
- double a = nTextRotationAngle * nPi180;
- pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
- }
-
- // rotate text with shape ?
- if ( mnFix16Angle )
- {
- double a = mnFix16Angle * nPi180;
- pTextObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
- sin( a ), cos( a ) );
- }
-
- if( !pObj )
- {
- pObj = pTextObj;
- }
- else
- {
- if( pTextObj != pObj )
- {
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->GetSubList()->NbcInsertObject( pObj );
- pGroup->GetSubList()->NbcInsertObject( pTextObj );
- if (pOrgObj == pObj)
- pOrgObj = pGroup;
- else
- pOrgObj = pObj;
- pObj = pGroup;
- }
- }
- }
- else if( !pObj )
- {
- // simple rectangular objects are ignored by ImportObj() :-(
- // this is OK for Draw but not for Calc and Writer
- // cause here these objects have a default border
- pObj = new SdrRectObj(rTextRect);
- pOrgObj = pObj;
- pObj->SetModel( pSdrModel );
- SfxItemSet aSet( pSdrModel->GetItemPool() );
- ApplyAttributes( rSt, aSet, rObjData );
-
- const SfxPoolItem* pPoolItem=NULL;
- SfxItemState eState = aSet.GetItemState( XATTR_FILLCOLOR,
- FALSE, &pPoolItem );
- if( SFX_ITEM_DEFAULT == eState )
- aSet.Put( XFillColorItem( String(),
- Color( mnDefaultColor ) ) );
- pObj->SetMergedItemSet(aSet);
- }
-
- //Means that fBehindDocument is set
- if (GetPropertyValue(DFF_Prop_fPrint) & 0x20)
- pImpRec->bDrawHell = TRUE;
- else
- pImpRec->bDrawHell = FALSE;
- if (GetPropertyValue(DFF_Prop_fPrint) & 0x02)
- pImpRec->bHidden = TRUE;
- pTextImpRec->bDrawHell = pImpRec->bDrawHell;
- pTextImpRec->bHidden = pImpRec->bHidden;
- pImpRec->nNextShapeId = GetPropertyValue( DFF_Prop_hspNext, 0 );
- pTextImpRec->nNextShapeId=pImpRec->nNextShapeId;
-
- if ( nTextId )
- {
- pTextImpRec->aTextId.nTxBxS = (UINT16)( nTextId >> 16 );
- pTextImpRec->aTextId.nSequence = (UINT16)nTextId;
- }
-
- pTextImpRec->nDxWrapDistLeft = GetPropertyValue(
- DFF_Prop_dxWrapDistLeft, 114935L ) / 635L;
- pTextImpRec->nDyWrapDistTop = GetPropertyValue(
- DFF_Prop_dyWrapDistTop, 0 ) / 635L;
- pTextImpRec->nDxWrapDistRight = GetPropertyValue(
- DFF_Prop_dxWrapDistRight, 114935L ) / 635L;
- pTextImpRec->nDyWrapDistBottom = GetPropertyValue(
- DFF_Prop_dyWrapDistBottom, 0 ) / 635L;
- // 16.16 fraction times total image width or height, as appropriate.
-
- if (SeekToContent(DFF_Prop_pWrapPolygonVertices, rSt))
- {
- delete pTextImpRec->pWrapPolygon;
- sal_uInt16 nNumElemVert, nNumElemMemVert, nElemSizeVert;
- rSt >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert;
- if (nNumElemVert && ((nElemSizeVert == 8) || (nElemSizeVert == 4)))
- {
- pTextImpRec->pWrapPolygon = new Polygon(nNumElemVert);
- for (sal_uInt16 i = 0; i < nNumElemVert; ++i)
- {
- sal_Int32 nX, nY;
- if (nElemSizeVert == 8)
- rSt >> nX >> nY;
- else
- {
- sal_Int16 nSmallX, nSmallY;
- rSt >> nSmallX >> nSmallY;
- nX = nSmallX;
- nY = nSmallY;
- }
- (*(pTextImpRec->pWrapPolygon))[i].X() = nX;
- (*(pTextImpRec->pWrapPolygon))[i].Y() = nY;
- }
- }
- }
-
- pImpRec->nCropFromTop = GetPropertyValue(
- DFF_Prop_cropFromTop, 0 );
- pImpRec->nCropFromBottom = GetPropertyValue(
- DFF_Prop_cropFromBottom, 0 );
- pImpRec->nCropFromLeft = GetPropertyValue(
- DFF_Prop_cropFromLeft, 0 );
- pImpRec->nCropFromRight = GetPropertyValue(
- DFF_Prop_cropFromRight, 0 );
-
- pImpRec->bVFlip = (rObjData.nSpFlags & SP_FFLIPV) ? true : false;
- pImpRec->bHFlip = (rObjData.nSpFlags & SP_FFLIPH) ? true : false;
-
- UINT32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash );
- pImpRec->eLineStyle = (nLineFlags & 8)
- ? (MSO_LineStyle)GetPropertyValue(
- DFF_Prop_lineStyle,
- mso_lineSimple )
- : (MSO_LineStyle)USHRT_MAX;
- pTextImpRec->eLineStyle = pImpRec->eLineStyle;
-
- if( pImpRec->nShapeId )
- {
- // Import-Record-Liste ergaenzen
- if( pOrgObj )
- {
- pImpRec->pObj = pOrgObj;
- rImportData.aRecords.Insert( pImpRec );
- }
-
- if( pTextObj && (pOrgObj != pTextObj) )
- {
- // Modify ShapeId (must be unique)
- pImpRec->nShapeId |= 0x8000000;
- pTextImpRec->pObj = pTextObj;
- rImportData.aRecords.Insert( pTextImpRec );
- }
-
- // Eintrag in Z-Order-Liste um Zeiger auf dieses Objekt ergaenzen
- /*Only store objects which are not deep inside the tree*/
- if( ( rObjData.nCalledByGroup == 0 )
- ||
- ( (rObjData.nSpFlags & SP_FGROUP)
- && (rObjData.nCalledByGroup < 2) )
- )
- StoreShapeOrder( pImpRec->nShapeId,
- ( ( (ULONG)pImpRec->aTextId.nTxBxS ) << 16 )
- + pImpRec->aTextId.nSequence, pObj );
- }
- else
- delete pImpRec;
- }
-
- return pObj;
-};
-
-void SvxMSDffManager::StoreShapeOrder(ULONG nId,
- ULONG nTxBx,
- SdrObject* pObject,
- SwFlyFrmFmt* pFly,
- short nHdFtSection) const
-{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
- {
- SvxMSDffShapeOrder& rOrder
- = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
-
- if( rOrder.nShapeId == nId )
- {
- rOrder.nTxBxComp = nTxBx;
- rOrder.pObj = pObject;
- rOrder.pFly = pFly;
- rOrder.nHdFtSection = nHdFtSection;
- }
- }
-}
-
-
-void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject,
- ULONG nTxBx,
- SwFlyFrmFmt* pFly,
- SdrObject* pObject) const
-{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
- {
- SvxMSDffShapeOrder& rOrder
- = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
-
- if( rOrder.pObj == pOldObject )
- {
- rOrder.pFly = pFly;
- rOrder.pObj = pObject;
- rOrder.nTxBxComp = nTxBx;
- }
- }
-}
-
-
-void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const
-{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
- {
- SvxMSDffShapeOrder& rOrder
- = *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
-
- if( rOrder.pObj == pObject )
- {
- rOrder.pObj = 0;
- rOrder.pFly = 0;
- rOrder.nTxBxComp = 0;
- }
- }
-}
-
-
-
-
-//---------------------------------------------------------------------------
-// Hilfs Deklarationen
-//---------------------------------------------------------------------------
-
-/*struct SvxMSDffBLIPInfo -> in's Header-File
-{
- USHORT nBLIPType; // Art des BLIP: z.B. 6 fuer PNG
- ULONG nFilePos; // Offset des BLIP im Daten-Stream
- ULONG nBLIPSize; // Anzahl Bytes, die der BLIP im Stream einnimmt
- SvxMSDffBLIPInfo(USHORT nBType, ULONG nFPos, ULONG nBSize):
- nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){}
-};
-*/
-
-SV_IMPL_PTRARR( SvxMSDffBLIPInfos, SvxMSDffBLIPInfo_Ptr );
-
-SV_IMPL_PTRARR( SvxMSDffShapeOrders, SvxMSDffShapeOrder_Ptr );
-
-SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeInfos, SvxMSDffShapeInfo_Ptr );
-
-SV_IMPL_OP_PTRARR_SORT( SvxMSDffShapeTxBxSort, SvxMSDffShapeOrder_Ptr );
-
-
-// Liste aller SvxMSDffImportRec fuer eine Gruppe
-SV_IMPL_OP_PTRARR_SORT(MSDffImportRecords, MSDffImportRec_Ptr)
-
-//---------------------------------------------------------------------------
-// exportierte Klasse: oeffentliche Methoden
-//---------------------------------------------------------------------------
-
-SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
- const String& rBaseURL,
- long nOffsDgg_,
- SvStream* pStData_,
- SdrModel* pSdrModel_,// s. unten: SetModel()
- long nApplicationScale,
- ColorData mnDefaultColor_,
- ULONG nDefaultFontHeight_,
- SvStream* pStData2_,
- MSFilterTracer* pTracer )
- :DffPropertyReader( *this ),
- pFormModel( NULL ),
- pBLIPInfos( new SvxMSDffBLIPInfos ),
- pShapeInfos( new SvxMSDffShapeInfos ),
- pShapeOrders( new SvxMSDffShapeOrders ),
- nDefaultFontHeight( nDefaultFontHeight_),
- nOffsDgg( nOffsDgg_ ),
- nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
- nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
- maBaseURL( rBaseURL ),
- mpFidcls( NULL ),
- rStCtrl( rStCtrl_ ),
- pStData( pStData_ ),
- pStData2( pStData2_ ),
- nSvxMSDffSettings( 0 ),
- nSvxMSDffOLEConvFlags( 0 ),
- pEscherBlipCache( NULL ),
- mnDefaultColor( mnDefaultColor_),
- mpTracer( pTracer ),
- mbTracing( sal_False )
-{
- if ( mpTracer )
- {
- uno::Any aAny( mpTracer->GetProperty( rtl::OUString::createFromAscii( "On" ) ) );
- aAny >>= mbTracing;
- }
- SetModel( pSdrModel_, nApplicationScale );
-
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
-
- // Falls kein Datenstream angegeben, gehen wir davon aus,
- // dass die BLIPs im Steuerstream stehen.
- if( !pStData )
- pStData = &rStCtrl;
-
- SetDefaultPropSet( rStCtrl, nOffsDgg );
-
- // Steuer Stream auslesen, im Erfolgsfall nBLIPCount setzen
- GetCtrlData( nOffsDgg );
-
- // Text-Box-Story-Ketten-Infos ueberpruefen
- CheckTxBxStoryChain();
-
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
- if( &rStCtrl != pStData )
- pStData->Seek( nOldPosData );
-}
-
-SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const String& rBaseURL, MSFilterTracer* pTracer )
- :DffPropertyReader( *this ),
- pFormModel( NULL ),
- pBLIPInfos( new SvxMSDffBLIPInfos ),
- pShapeInfos( new SvxMSDffShapeInfos ),
- pShapeOrders( new SvxMSDffShapeOrders ),
- nDefaultFontHeight( 24 ),
- nOffsDgg( 0 ),
- nBLIPCount( USHRT_MAX ), // mit Error initialisieren, da wir erst pruefen,
- nShapeCount( USHRT_MAX ), // ob Kontroll-Stream korrekte Daten enthaellt
- maBaseURL( rBaseURL ),
- mpFidcls( NULL ),
- rStCtrl( rStCtrl_ ),
- pStData( 0 ),
- pStData2( 0 ),
- nSvxMSDffSettings( 0 ),
- nSvxMSDffOLEConvFlags( 0 ),
- pEscherBlipCache( NULL ),
- mnDefaultColor( COL_DEFAULT ),
- mpTracer( pTracer ),
- mbTracing( sal_False )
-{
- if ( mpTracer )
- {
- uno::Any aAny( mpTracer->GetProperty( rtl::OUString::createFromAscii( "On" ) ) );
- aAny >>= mbTracing;
- }
- SetModel( NULL, 0 );
-}
-
-SvxMSDffManager::~SvxMSDffManager()
-{
- if ( pEscherBlipCache )
- {
- void* pPtr;
- for ( pPtr = pEscherBlipCache->First(); pPtr; pPtr = pEscherBlipCache->Next() )
- delete (EscherBlipCacheEntry*)pPtr;
- delete pEscherBlipCache;
- }
- delete pBLIPInfos;
- delete pShapeInfos;
- delete pShapeOrders;
- delete pFormModel;
- delete[] mpFidcls;
-}
-
-void SvxMSDffManager::InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
-{
- nOffsDgg = nOffsDgg_;
- pStData = pStData_;
- nSvxMSDffOLEConvFlags = nOleConvFlags;
-
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
-
- SetDefaultPropSet( rStCtrl, nOffsDgg );
-
- // insert fidcl cluster table
- GetFidclData( nOffsDgg );
-
- // Steuer Stream auslesen, im Erfolgsfall nBLIPCount setzen
- GetCtrlData( nOffsDgg );
-
- // Text-Box-Story-Ketten-Infos ueberpruefen
- CheckTxBxStoryChain();
-
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
-}
-
-void SvxMSDffManager::SetDgContainer( SvStream& rSt )
-{
- UINT32 nFilePos = rSt.Tell();
- DffRecordHeader aDgContHd;
- rSt >> aDgContHd;
- // insert this container only if there is also a DgAtom
- if ( SeekToRec( rSt, DFF_msofbtDg, aDgContHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aRecHd;
- rSt >> aRecHd;
- UINT32 nDrawingId = aRecHd.nRecInstance;
- maDgOffsetTable.Insert( nDrawingId, (void*)nFilePos );
- rSt.Seek( nFilePos );
- }
-}
-
-void SvxMSDffManager::GetFidclData( long nOffsDggL )
-{
- if ( nOffsDggL )
- {
- UINT32 nDummy, nMerk = rStCtrl.Tell();
- rStCtrl.Seek( nOffsDggL );
-
- DffRecordHeader aRecHd;
- rStCtrl >> aRecHd;
-
- DffRecordHeader aDggAtomHd;
- if ( SeekToRec( rStCtrl, DFF_msofbtDgg, aRecHd.GetRecEndFilePos(), &aDggAtomHd ) )
- {
- aDggAtomHd.SeekToContent( rStCtrl );
- rStCtrl >> mnCurMaxShapeId
- >> mnIdClusters
- >> nDummy
- >> mnDrawingsSaved;
-
- if ( mnIdClusters-- > 2 )
- {
- if ( aDggAtomHd.nRecLen == ( mnIdClusters * sizeof( FIDCL ) + 16 ) )
- {
- mpFidcls = new FIDCL[ mnIdClusters ];
- for ( UINT32 i = 0; i < mnIdClusters; i++ )
- {
- rStCtrl >> mpFidcls[ i ].dgid
- >> mpFidcls[ i ].cspidCur;
- }
- }
- }
- }
- rStCtrl.Seek( nMerk );
- }
-}
-
-void SvxMSDffManager::CheckTxBxStoryChain()
-{
- SvxMSDffShapeInfos* pOld = pShapeInfos;
- USHORT nCnt = pOld->Count();
- pShapeInfos = new SvxMSDffShapeInfos( (nCnt < 255)
- ? nCnt
- : 255 );
- // altes Info-Array ueberarbeiten
- // (ist sortiert nach nTxBxComp)
- ULONG nChain = ULONG_MAX;
- USHORT nObjMark = 0;
- BOOL bSetReplaceFALSE = FALSE;
- USHORT nObj;
- for( nObj = 0; nObj < nCnt; ++nObj )
- {
- SvxMSDffShapeInfo* pObj = pOld->GetObject( nObj );
- if( pObj->nTxBxComp )
- {
- pObj->bLastBoxInChain = FALSE;
- // Gruppenwechsel ?
- // --> OD 2008-07-28 #156763#
- // the text id also contains an internal drawing container id
- // to distinguish between text id of drawing objects in different
- // drawing containers.
-// if( nChain != (pObj->nTxBxComp & 0xFFFF0000) )
- if( nChain != pObj->nTxBxComp )
- // <--
- {
- // voriger war letzter seiner Gruppe
- if( nObj )
- pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
- // Merker und Hilfs-Flag zuruecksetzen
- nObjMark = nObj;
- // --> OD 2008-07-28 #156763#
-// nChain = pObj->nTxBxComp & 0xFFFF0000;
- nChain = pObj->nTxBxComp;
- // <--
- bSetReplaceFALSE = !pObj->bReplaceByFly;
- }
- else
- if( !pObj->bReplaceByFly )
- {
- // Objekt, das NICHT durch Rahmen ersetzt werden darf ?
- // Hilfs-Flag setzen
- bSetReplaceFALSE = TRUE;
- // ggfs Flag in Anfang der Gruppe austragen
- for( USHORT nObj2 = nObjMark; nObj2 < nObj; ++nObj2 )
- pOld->GetObject( nObj2 )->bReplaceByFly = FALSE;
- }
-
- if( bSetReplaceFALSE )
- {
- pObj->bReplaceByFly = FALSE;
- }
- }
- // alle Shape-Info-Objekte in pShapeInfos umkopieren
- // (aber nach nShapeId sortieren)
- pObj->bSortByShapeId = TRUE;
- // --> OD 2008-07-28 #156763#
- pObj->nTxBxComp = pObj->nTxBxComp & 0xFFFF0000;
- // <--
- pShapeInfos->Insert( pObj );
- }
- // voriger war letzter seiner Gruppe
- if( nObj )
- pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
- // urspruengliches Array freigeben, ohne Objekte zu zerstoeren
- pOld->Remove((USHORT)0, nCnt);
- delete pOld;
-}
-
-
-/*****************************************************************************
-
- Einlesen der Shape-Infos im Ctor:
- ---------------------------------
- merken der Shape-Ids und zugehoerigen Blip-Nummern und TextBox-Infos
- ========= ============ =============
- und merken des File-Offsets fuer jedes Blip
- ============
-******************************************************************************/
-void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
-{
- // Start Offset unbedingt merken, falls wir nochmal aufsetzen muessen
- long nOffsDggL = nOffsDgg_;
-
- // Kontroll Stream positionieren
- rStCtrl.Seek( nOffsDggL );
-
- BYTE nVer;
- USHORT nInst;
- USHORT nFbt;
- UINT32 nLength;
- if( !this->ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) ) return;
-
- BOOL bOk;
- ULONG nPos = nOffsDggL + DFF_COMMON_RECORD_HEADER_SIZE;
-
- // Fall A: erst Drawing Group Container, dann n Mal Drawing Container
- if( DFF_msofbtDggContainer == nFbt )
- {
- GetDrawingGroupContainerData( rStCtrl, nLength );
-
- rStCtrl.Seek( STREAM_SEEK_TO_END );
- UINT32 nMaxStrPos = rStCtrl.Tell();
-
- nPos += nLength;
- // --> OD 2008-07-28 #156763#
- unsigned long nDrawingContainerId = 1;
- // <--
- do
- {
- rStCtrl.Seek( nPos );
-
- bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) && ( DFF_msofbtDgContainer == nFbt );
-
- if( !bOk )
- {
- nPos++;
- rStCtrl.Seek( nPos );
- bOk = ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength )
- && ( DFF_msofbtDgContainer == nFbt );
- }
- if( bOk )
- {
- // --> OD 2008-07-28 #156763#
- GetDrawingContainerData( rStCtrl, nLength, nDrawingContainerId );
- // <--
- }
- nPos += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
- // --> OD 2008-07-28 #156763#
- ++nDrawingContainerId;
- // <--
- }
- while( nPos < nMaxStrPos && bOk );
- }
-}
-
-
-// ab hier: Drawing Group Container d.h. Dokument - weit gueltige Daten
-// ======================= ========
-//
-void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg )
-{
- BYTE nVer;
- USHORT nInst;
- USHORT nFbt;
- UINT32 nLength;
-
- ULONG nLenBStoreCont = 0, nLenFBSE = 0, nRead = 0;
-
- // Nach einem BStore Container suchen
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
- nRead += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
- if( DFF_msofbtBstoreContainer == nFbt )
- {
- nLenBStoreCont = nLength; break;
- }
- rSt.SeekRel( nLength );
- }
- while( nRead < nLenDgg );
-
- if( !nLenBStoreCont ) return;
-
- // Im BStore Container alle Header der Container und Atome auslesen und die
- // relevanten Daten aller enthaltenen FBSEs in unserem Pointer Array ablegen.
- // Dabei zaehlen wir die gefundenen FBSEs im Member nBLIPCount mit.
-
- const ULONG nSkipBLIPLen = 20; // bis zu nBLIPLen zu ueberspringende Bytes
- const ULONG nSkipBLIPPos = 4; // dahinter bis zu nBLIPPos zu skippen
-
- sal_uInt32 nBLIPLen = 0, nBLIPPos = 0;
-
- nRead = 0;
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
- nRead += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
- if( DFF_msofbtBSE == nFbt )
- {
- nLenFBSE = nLength;
- // ist FBSE gross genug fuer unsere Daten
- BOOL bOk = ( nSkipBLIPLen + 4 + nSkipBLIPPos + 4 <= nLenFBSE );
-
- if( bOk )
- {
- rSt.SeekRel( nSkipBLIPLen );
- rSt >> nBLIPLen;
- rSt.SeekRel( nSkipBLIPPos );
- rSt >> nBLIPPos;
- bOk = rSt.GetError() == 0;
-
- nLength -= nSkipBLIPLen+ 4 + nSkipBLIPPos + 4;
- }
-
- if( bOk )
- {
- // Besonderheit:
- // Falls nBLIPLen kleiner ist als nLenFBSE UND nBLIPPos Null ist,
- // nehmen wir an, dass das Bild IM FBSE drin steht!
- if( (!nBLIPPos) && (nBLIPLen < nLenFBSE) )
- nBLIPPos = rSt.Tell() + 4;
-
- // Das hat ja fein geklappt!
- // Wir merken uns, dass wir einen FBSE mehr im Pointer Array haben.
- nBLIPPos = Calc_nBLIPPos(nBLIPPos, rSt.Tell());
-
- if( USHRT_MAX == nBLIPCount )
- nBLIPCount = 1;
- else
- nBLIPCount++;
-
- // Jetzt die Infos fuer spaetere Zugriffe speichern
- pBLIPInfos->Insert( new SvxMSDffBLIPInfo( nInst, nBLIPPos, nBLIPLen ),
- pBLIPInfos->Count() );
- }
- }
- rSt.SeekRel( nLength );
- }
- while( nRead < nLenBStoreCont );
-}
-
-
-// ab hier: Drawing Container d.h. Seiten (Blatt, Dia) - weit gueltige Daten
-// ================= ======
-//
-void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, ULONG nLenDg,
- const unsigned long nDrawingContainerId )
-{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
-
- ULONG nReadDg = 0;
-
- // Wir stehen in einem Drawing Container (je einer pro Seite)
- // und muessen nun
- // alle enthaltenen Shape Group Container abklappern
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return;
- nReadDg += DFF_COMMON_RECORD_HEADER_SIZE;
- // Patriarch gefunden (der oberste Shape Group Container) ?
- if( DFF_msofbtSpgrContainer == nFbt )
- {
- if(!this->GetShapeGroupContainerData( rSt, nLength, TRUE, nDrawingContainerId )) return;
- }
- else
- // blanker Shape Container ? (ausserhalb vom Shape Group Container)
- if( DFF_msofbtSpContainer == nFbt )
- {
- if(!this->GetShapeContainerData( rSt, nLength, ULONG_MAX, nDrawingContainerId )) return;
- }
- else
- rSt.SeekRel( nLength );
- nReadDg += nLength;
- }
- while( nReadDg < nLenDg );
-}
-
-BOOL SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt,
- ULONG nLenShapeGroupCont,
- BOOL bPatriarch,
- const unsigned long nDrawingContainerId )
-{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
- long nStartShapeGroupCont = rSt.Tell();
- // Wir stehen in einem Shape Group Container (ggfs. mehrere pro Seite)
- // und muessen nun
- // alle enthaltenen Shape Container abklappern
- BOOL bFirst = !bPatriarch;
- ULONG nReadSpGrCont = 0;
- do
- {
- if( !this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength ) )
- return FALSE;
- nReadSpGrCont += DFF_COMMON_RECORD_HEADER_SIZE;
- // Shape Container ?
- if( DFF_msofbtSpContainer == nFbt )
- {
- ULONG nGroupOffs = bFirst ? nStartShapeGroupCont - DFF_COMMON_RECORD_HEADER_SIZE : ULONG_MAX;
- if ( !this->GetShapeContainerData( rSt, nLength, nGroupOffs, nDrawingContainerId ) )
- return FALSE;
- bFirst = FALSE;
- }
- else
- // eingeschachtelter Shape Group Container ?
- if( DFF_msofbtSpgrContainer == nFbt )
- {
- if ( !this->GetShapeGroupContainerData( rSt, nLength, FALSE, nDrawingContainerId ) )
- return FALSE;
- }
- else
- rSt.SeekRel( nLength );
- nReadSpGrCont += nLength;
- }
- while( nReadSpGrCont < nLenShapeGroupCont );
- // den Stream wieder korrekt positionieren
- rSt.Seek( nStartShapeGroupCont + nLenShapeGroupCont );
- return TRUE;
-}
-
-BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
- ULONG nLenShapeCont,
- ULONG nPosGroup,
- const unsigned long nDrawingContainerId )
-{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
- long nStartShapeCont = rSt.Tell();
- // Wir stehen in einem Shape Container (ggfs. mehrere pro Sh. Group)
- // und muessen nun
- // die Shape Id und File-Pos (fuer spaetere, erneute Zugriffe)
- // und den ersten BStore Verweis (falls vorhanden) entnehmen
- ULONG nLenShapePropTbl = 0;
- ULONG nReadSpCont = 0;
-
- // File Offset des Shape-Containers bzw. der Gruppe(!) vermerken
- //
- ULONG nStartOffs = (ULONG_MAX > nPosGroup) ?
- nPosGroup : nStartShapeCont - DFF_COMMON_RECORD_HEADER_SIZE;
- SvxMSDffShapeInfo aInfo( nStartOffs );
-
- // duerfte das Shape durch einen Rahmen ersetzt werden ?
- // (vorausgesetzt, es zeigt sich, dass es eine TextBox ist,
- // und der Text nicht gedreht ist)
- BOOL bCanBeReplaced = (ULONG_MAX > nPosGroup) ? FALSE : TRUE;
-
- // wir wissen noch nicht, ob es eine TextBox ist
- MSO_SPT eShapeType = mso_sptNil;
- MSO_WrapMode eWrapMode = mso_wrapSquare;
-// BOOL bIsTextBox = FALSE;
-
- // Shape analysieren
- //
- do
- {
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return FALSE;
- nReadSpCont += DFF_COMMON_RECORD_HEADER_SIZE;
- // FSP ?
- if( ( DFF_msofbtSp == nFbt ) && ( 4 <= nLength ) )
- {
- // Wir haben den FSP gefunden: Shape Typ und Id vermerken!
- eShapeType = (MSO_SPT)nInst;
- rSt >> aInfo.nShapeId;
- rSt.SeekRel( nLength - 4 );
- nReadSpCont += nLength;
- }
- else if( DFF_msofbtOPT == nFbt ) // Shape Property Table ?
- {
- // Wir haben die Property Table gefunden:
- // nach der Blip Property suchen!
- ULONG nPropRead = 0;
- USHORT nPropId;
- sal_uInt32 nPropVal;
- nLenShapePropTbl = nLength;
-// UINT32 nPropCount = nInst;
- long nStartShapePropTbl = rSt.Tell();
-// UINT32 nComplexDataFilePos = nStartShapePropTbl + (nPropCount * 6);
- do
- {
- rSt >> nPropId
- >> nPropVal;
- nPropRead += 6;
-
- switch( nPropId )
- {
- case DFF_Prop_txflTextFlow :
- //Writer can now handle vertical textflows in its
- //native frames, to only need to do this for the
- //other two formats
-
- //Writer will handle all textflow except BtoT
- if (GetSvxMSDffSettings() &
- (SVXMSDFF_SETTINGS_IMPORT_PPT |
- SVXMSDFF_SETTINGS_IMPORT_EXCEL))
- {
- if( 0 != nPropVal )
- bCanBeReplaced = false;
- }
- else if (
- (nPropVal != mso_txflHorzN) &&
- (nPropVal != mso_txflTtoBA)
- )
- {
- bCanBeReplaced = false;
- }
- break;
- case DFF_Prop_cdirFont :
- //Writer can now handle right to left and left
- //to right in its native frames, so only do
- //this for the other two formats.
- if (GetSvxMSDffSettings() &
- (SVXMSDFF_SETTINGS_IMPORT_PPT |
- SVXMSDFF_SETTINGS_IMPORT_EXCEL))
- {
- if( 0 != nPropVal )
- bCanBeReplaced = FALSE;
- }
- break;
- case DFF_Prop_Rotation :
- if( 0 != nPropVal )
- bCanBeReplaced = FALSE;
- break;
-
- case DFF_Prop_gtextFStrikethrough :
- if( ( 0x20002000 & nPropVal ) == 0x20002000 )
- bCanBeReplaced = FALSE;
- break;
-
- case DFF_Prop_fc3DLightFace :
- if( ( 0x00080008 & nPropVal ) == 0x00080008 )
- bCanBeReplaced = FALSE;
- break;
-
- case DFF_Prop_WrapText :
- eWrapMode = (MSO_WrapMode)nPropVal;
- break;
-
- default:
- {
- // Bit gesetzt und gueltig?
- if( 0x4000 == ( nPropId & 0xC000 ) )
- {
- // Blip Property gefunden: BStore Idx vermerken!
- nPropRead = nLenShapePropTbl;
- }
- else if( 0x8000 & nPropId )
- {
- // komplexe Prop gefunden:
- // Laenge ist immer 6, nur die Laenge der nach der
- // eigentlichen Prop-Table anhaengenden Extra-Daten
- // ist unterschiedlich
- nPropVal = 6;
- }
- }
- break;
- }
-
-/*
-//JP 21.04.99: Bug 64510
-// alte Version, die unter OS/2 zu Compilerfehlern fuehrt und damit arge
-// Performance einbussen hat.
-
- if( 0x4000 == ( nPropId & 0xC000 ) )// Bit gesetzt und gueltig?
- {
- // Blip Property gefunden: BStore Idx vermerken!
- aInfo.nBStoreIdx = nPropVal; // Index im BStore Container
- break;
- }
- else
- if( ( ( (DFF_Prop_txflTextFlow == nPropId)
- || (DFF_Prop_Rotation == nPropId)
- || (DFF_Prop_cdirFont == nPropId) )
- && (0 != nPropVal) )
-
- || ( (DFF_Prop_gtextFStrikethrough == nPropId)
- && ( (0x20002000 & nPropVal) == 0x20002000) ) // also DFF_Prop_gtextFVertical
- || ( (DFF_Prop_fc3DLightFace == nPropId)
- && ( (0x00080008 & nPropVal) == 0x00080008) ) // also DFF_Prop_f3D
- )
- {
- bCanBeReplaced = FALSE; // Mist: gedrehter Text oder 3D-Objekt!
- }
- else
- if( DFF_Prop_WrapText == nPropId )
- {
- eWrapMode = (MSO_WrapMode)nPropVal;
- }
- ////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////
- // keine weitere Property-Auswertung: folge beim Shape-Import //
- ////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////
- else
- if( 0x8000 & nPropId )
- {
- // komplexe Prop gefunden: Laenge lesen und ueberspringen
- if(!SkipBytes( rSt, nPropVal )) return FALSE;
- nPropRead += nPropVal;
- }
-*/
- }
- while( nPropRead < nLenShapePropTbl );
- rSt.Seek( nStartShapePropTbl + nLenShapePropTbl );
- nReadSpCont += nLenShapePropTbl;
- }
- else if( ( DFF_msofbtClientTextbox == nFbt ) && ( 4 == nLength ) ) // Text-Box-Story-Eintrag gefunden
- {
- rSt >> aInfo.nTxBxComp;
- // --> OD 2008-07-28 #156763#
- // Add internal drawing container id to text id.
- // Note: The text id uses the first two bytes, while the internal
- // drawing container id used the second two bytes.
- aInfo.nTxBxComp = ( aInfo.nTxBxComp & 0xFFFF0000 ) +
- nDrawingContainerId;
- DBG_ASSERT( (aInfo.nTxBxComp & 0x0000FFFF) == nDrawingContainerId,
- "<SvxMSDffManager::GetShapeContainerData(..)> - internal drawing container Id could not be correctly merged into DFF_msofbtClientTextbox value." );
- // <--
- }
- else
- {
- rSt.SeekRel( nLength );
- nReadSpCont += nLength;
- }
- }
- while( nReadSpCont < nLenShapeCont );
-
- //
- // Jetzt ggfs. die Infos fuer spaetere Zugriffe auf das Shape speichern
- //
- if( aInfo.nShapeId )
- {
- // fuer Textboxen ggfs. ersetzen durch Rahmen erlauben
- if( bCanBeReplaced
- && aInfo.nTxBxComp
- && (
- ( eShapeType == mso_sptTextSimple )
- || ( eShapeType == mso_sptTextBox )
- || ( ( ( eShapeType == mso_sptRectangle )
- || ( eShapeType == mso_sptRoundRectangle )
- )
- ) ) )
- {
- aInfo.bReplaceByFly = TRUE;
- }
- pShapeInfos->Insert( new SvxMSDffShapeInfo( aInfo ) );
- pShapeOrders->Insert( new SvxMSDffShapeOrder( aInfo.nShapeId ),
- pShapeOrders->Count() );
- }
-
- // und den Stream wieder korrekt positionieren
- rSt.Seek( nStartShapeCont + nLenShapeCont );
- return TRUE;
-}
-
-
-
-/*****************************************************************************
-
- Zugriff auf ein Shape zur Laufzeit (ueber die Shape-Id)
- ----------------------------------
-******************************************************************************/
-BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
- SvxMSDffImportData& rData)
-{
- SvxMSDffShapeInfo aTmpRec(0, nId);
- aTmpRec.bSortByShapeId = TRUE;
-
- USHORT nFound;
- if( pShapeInfos->Seek_Entry(&aTmpRec, &nFound) )
- {
- SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject( nFound );
-
- // eventuell altes Errorflag loeschen
- if( rStCtrl.GetError() )
- rStCtrl.ResetError();
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
- // das Shape im Steuer Stream anspringen
- rStCtrl.Seek( rInfo.nFilePos );
-
- // Falls missglueckt, den Fehlerstatus zuruecksetzen und Pech gehabt!
- if( rStCtrl.GetError() )
- rStCtrl.ResetError();
- else
- rpShape = ImportObj( rStCtrl, &rData, rData.aParentRect, rData.aParentRect );
-
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
- if( &rStCtrl != pStData )
- pStData->Seek( nOldPosData );
- return ( 0 != rpShape );
- }
- return FALSE;
-}
-
-
-
-/* Zugriff auf ein BLIP zur Laufzeit (bei bereits bekannter Blip-Nr)
- ---------------------------------
-******************************************************************************/
-BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea ) const
-{
- BOOL bOk = FALSE; // Ergebnisvariable initialisieren
- if ( pStData )
- {
- // check if a graphic for this blipId is already imported
- if ( nIdx_ && pEscherBlipCache )
- {
- EscherBlipCacheEntry* pEntry;
- for ( pEntry = (EscherBlipCacheEntry*)pEscherBlipCache->First(); pEntry;
- pEntry = (EscherBlipCacheEntry*)pEscherBlipCache->Next() )
- {
- if ( pEntry->nBlip == nIdx_ )
- { /* if this entry is available, then it should be possible
- to get the Graphic via GraphicObject */
- GraphicObject aGraphicObject( pEntry->aUniqueID );
- rData = aGraphicObject.GetGraphic();
- if ( rData.GetType() != GRAPHIC_NONE )
- bOk = sal_True;
- else
- delete (EscherBlipCacheEntry*)pEscherBlipCache->Remove();
- break;
- }
- }
- }
- if ( !bOk )
- {
- USHORT nIdx = USHORT( nIdx_ );
- if( !nIdx || (pBLIPInfos->Count() < nIdx) ) return FALSE;
-
- // eventuell alte(s) Errorflag(s) loeschen
- if( rStCtrl.GetError() )
- rStCtrl.ResetError();
- if( ( &rStCtrl != pStData )
- && pStData->GetError() )
- pStData->ResetError();
-
- // FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
-
- // passende Info-Struct aus unserem Pointer Array nehmen
- SvxMSDffBLIPInfo& rInfo = *(*pBLIPInfos)[ nIdx-1 ];
-
- // das BLIP Atom im Daten Stream anspringen
- pStData->Seek( rInfo.nFilePos );
- // ggfs. Fehlerstatus zuruecksetzen
- if( pStData->GetError() )
- pStData->ResetError();
- else
- bOk = GetBLIPDirect( *pStData, rData, pVisArea );
- if( pStData2 && !bOk )
- {
- // Fehler, aber zweite Chance: es gibt noch einen zweiten
- // Datenstream, in dem die Grafik liegen koennte!
- if( pStData2->GetError() )
- pStData2->ResetError();
- ULONG nOldPosData2 = pStData2->Tell();
- // das BLIP Atom im zweiten Daten Stream anspringen
- pStData2->Seek( rInfo.nFilePos );
- // ggfs. Fehlerstatus zuruecksetzen
- if( pStData2->GetError() )
- pStData2->ResetError();
- else
- bOk = GetBLIPDirect( *pStData2, rData, pVisArea );
- // alte FilePos des zweiten Daten-Stream restaurieren
- pStData2->Seek( nOldPosData2 );
- }
- // alte FilePos des/der Stream(s) restaurieren
- rStCtrl.Seek( nOldPosCtrl );
- if( &rStCtrl != pStData )
- pStData->Seek( nOldPosData );
-
- if ( bOk )
- {
- // create new BlipCacheEntry for this graphic
- GraphicObject aGraphicObject( rData );
- if ( !pEscherBlipCache )
- const_cast <SvxMSDffManager*> (this)->pEscherBlipCache = new List();
- EscherBlipCacheEntry* pNewEntry = new EscherBlipCacheEntry( nIdx_, aGraphicObject.GetUniqueID() );
- pEscherBlipCache->Insert( pNewEntry, LIST_APPEND );
- }
- }
- }
- return bOk;
-}
-
-/* Zugriff auf ein BLIP zur Laufzeit (mit korrekt positioniertem Stream)
- ---------------------------------
-******************************************************************************/
-BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea ) const
-{
- ULONG nOldPos = rBLIPStream.Tell();
-
- int nRes = GRFILTER_OPENERROR; // Fehlervariable initialisieren
-
- // nachschauen, ob es sich auch wirklich um ein BLIP handelt
- UINT32 nLength;
- USHORT nInst, nFbt( 0 );
- BYTE nVer;
- if( ReadCommonRecordHeader( rBLIPStream, nVer, nInst, nFbt, nLength) && ( 0xF018 <= nFbt ) && ( 0xF117 >= nFbt ) )
- {
- Size aMtfSize100;
- BOOL bMtfBLIP = FALSE;
- BOOL bZCodecCompression = FALSE;
- // Nun exakt auf den Beginn der eingebetteten Grafik positionieren
- ULONG nSkip = ( nInst & 0x0001 ) ? 32 : 16;
-
- switch( nInst & 0xFFFE )
- {
- case 0x216 : // Metafile header then compressed WMF
- case 0x3D4 : // Metafile header then compressed EMF
- case 0x542 : // Metafile hd. then compressed PICT
- {
- rBLIPStream.SeekRel( nSkip + 20 );
-
- // read in size of metafile in EMUS
- rBLIPStream >> aMtfSize100.Width() >> aMtfSize100.Height();
-
- // scale to 1/100mm
- aMtfSize100.Width() /= 360, aMtfSize100.Height() /= 360;
-
- if ( pVisArea ) // seem that we currently are skipping the visarea position
- *pVisArea = Rectangle( Point(), aMtfSize100 );
-
- // skip rest of header
- nSkip = 6;
- bMtfBLIP = bZCodecCompression = TRUE;
- }
- break;
- case 0x46A : // One byte tag then JPEG (= JFIF) data
- case 0x6E0 : // One byte tag then PNG data
- case 0x7A8 :
- nSkip += 1; // One byte tag then DIB data
- break;
- }
- rBLIPStream.SeekRel( nSkip );
-
- SvStream* pGrStream = &rBLIPStream;
- SvMemoryStream* pOut = NULL;
- if( bZCodecCompression )
- {
- pOut = new SvMemoryStream( 0x8000, 0x4000 );
- ZCodec aZCodec( 0x8000, 0x8000 );
- aZCodec.BeginCompression();
- aZCodec.Decompress( rBLIPStream, *pOut );
- aZCodec.EndCompression();
- pOut->Seek( STREAM_SEEK_TO_BEGIN );
- pOut->SetResizeOffset( 0 ); // sj: #i102257# setting ResizeOffset of 0 prevents from seeking
- // behind the stream end (allocating too much memory)
- pGrStream = pOut;
- }
-
-//#define DBG_EXTRACTGRAPHICS
-#ifdef DBG_EXTRACTGRAPHICS
-
- static sal_Int32 nCount;
-
- String aFileName( String( RTL_CONSTASCII_STRINGPARAM( "dbggfx" ) ) );
- aFileName.Append( String::CreateFromInt32( nCount++ ) );
- switch( nInst &~ 1 )
- {
- case 0x216 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".wmf" ) ) ); break;
- case 0x3d4 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".emf" ) ) ); break;
- case 0x542 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".pct" ) ) ); break;
- case 0x46a : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".jpg" ) ) ); break;
- case 0x6e0 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".png" ) ) ); break;
- case 0x7a8 : aFileName.Append( String( RTL_CONSTASCII_STRINGPARAM( ".bmp" ) ) ); break;
- }
-
- String aURLStr;
-
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aURLStr ) )
- {
- INetURLObject aURL( aURLStr );
-
- aURL.removeSegment();
- aURL.removeFinalSlash();
- aURL.Append( aFileName );
-
- SvStream* pDbgOut = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_TRUNC | STREAM_WRITE );
-
- if( pDbgOut )
- {
- if ( bZCodecCompression )
- {
- pOut->Seek( STREAM_SEEK_TO_END );
- pDbgOut->Write( pOut->GetData(), pOut->Tell() );
- pOut->Seek( STREAM_SEEK_TO_BEGIN );
- }
- else
- {
- sal_Int32 nDbgLen = nLength - nSkip;
- if ( nDbgLen )
- {
- sal_Char* pDat = new sal_Char[ nDbgLen ];
- pGrStream->Read( pDat, nDbgLen );
- pDbgOut->Write( pDat, nDbgLen );
- pGrStream->SeekRel( -nDbgLen );
- delete[] pDat;
- }
- }
-
- delete pDbgOut;
- }
- }
-#endif
-
- if( ( nInst & 0xFFFE ) == 0x7A8 )
- { // DIBs direkt holen
- Bitmap aNew;
- if( aNew.Read( *pGrStream, FALSE ) )
- {
- rData = Graphic( aNew );
- nRes = GRFILTER_OK;
- }
- }
- else
- { // und unsere feinen Filter darauf loslassen
- GraphicFilter* pGF = GetGrfFilter();
- String aEmptyStr;
- nRes = pGF->ImportGraphic( rData, aEmptyStr, *pGrStream, GRFILTER_FORMAT_DONTKNOW );
-
- // SJ: I40472, sometimes the aspect ratio (aMtfSize100) does not match and we get scaling problems,
- // then it is better to use the prefsize that is stored within the metafile. Bug #72846# for what the
- // scaling has been implemented does not happen anymore.
- //
- // For pict graphics we will furthermore scale the metafile, because font scaling leads to error if the
- // dxarray is empty (this has been solved in wmf/emf but not for pict)
- if( bMtfBLIP && ( GRFILTER_OK == nRes ) && ( rData.GetType() == GRAPHIC_GDIMETAFILE ) && ( ( nInst & 0xFFFE ) == 0x542 ) )
- {
- if ( ( aMtfSize100.Width() >= 1000 ) && ( aMtfSize100.Height() >= 1000 ) )
- { // #75956#, scaling does not work properly, if the graphic is less than 1cm
- GDIMetaFile aMtf( rData.GetGDIMetaFile() );
- const Size aOldSize( aMtf.GetPrefSize() );
-
- if( aOldSize.Width() && ( aOldSize.Width() != aMtfSize100.Width() ) &&
- aOldSize.Height() && ( aOldSize.Height() != aMtfSize100.Height() ) )
- {
- aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(),
- (double) aMtfSize100.Height() / aOldSize.Height() );
- aMtf.SetPrefSize( aMtfSize100 );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
- rData = aMtf;
- }
- }
- }
- }
- // ggfs. Fehlerstatus zuruecksetzen
- if ( ERRCODE_IO_PENDING == pGrStream->GetError() )
- pGrStream->ResetError();
- delete pOut;
- }
- rBLIPStream.Seek( nOldPos ); // alte FilePos des Streams restaurieren
-
- return ( GRFILTER_OK == nRes ); // Ergebniss melden
-}
-
-/* static */
-BOOL SvxMSDffManager::ReadCommonRecordHeader(DffRecordHeader& rRec, SvStream& rIn)
-{
- rRec.nFilePos = rIn.Tell();
- return SvxMSDffManager::ReadCommonRecordHeader( rIn,rRec.nRecVer,
- rRec.nRecInstance,
- rRec.nRecType,
- rRec.nRecLen );
-}
-
-
-/* auch static */
-BOOL SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
- BYTE& rVer,
- USHORT& rInst,
- USHORT& rFbt,
- UINT32& rLength )
-{
- sal_uInt16 nTmp;
- rSt >> nTmp >> rFbt >> rLength;
- rVer = sal::static_int_cast< BYTE >(nTmp & 15);
- rInst = nTmp >> 4;
- return rSt.GetError() == 0;
-}
-
-
-
-
-BOOL SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, ULONG nDatLen,
- char*& rpBuff, UINT32& rBuffLen ) const
-{
- if( nDatLen )
- {
- rpBuff = new char[ nDatLen ];
- rBuffLen = nDatLen;
- rStData.Read( rpBuff, nDatLen );
- }
- return TRUE;
-}
-
-BOOL SvxMSDffManager::ProcessClientData(SvStream& rStData, ULONG nDatLen,
- char*& rpBuff, UINT32& rBuffLen ) const
-{
- if( nDatLen )
- {
- rpBuff = new char[ nDatLen ];
- rBuffLen = nDatLen;
- rStData.Read( rpBuff, nDatLen );
- }
- return TRUE;
-}
-
-
-void SvxMSDffManager::ProcessClientAnchor2( SvStream& /* rSt */, DffRecordHeader& /* rHd */ , void* /* pData */, DffObjData& /* rObj */ )
-{
- return; // wird von SJ im Draw ueberladen
-}
-
-ULONG SvxMSDffManager::Calc_nBLIPPos( ULONG nOrgVal, ULONG /* nStreamPos */ ) const
-{
- return nOrgVal;
-}
-
-BOOL SvxMSDffManager::GetOLEStorageName( long /* nOLEId */, String&, SvStorageRef&, uno::Reference < embed::XStorage >& ) const
-{
- return FALSE;
-}
-
-BOOL SvxMSDffManager::ShapeHasText( ULONG /* nShapeId */, ULONG /* nFilePos */ ) const
-{
- return TRUE;
-}
-
-// --> OD 2004-12-14 #i32596# - add new parameter <_nCalledByGroup>
-SdrObject* SvxMSDffManager::ImportOLE( long nOLEId,
- const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
- const int /* _nCalledByGroup */,
- sal_Int64 nAspect ) const
-// <--
-{
- SdrObject* pRet = 0;
- String sStorageName;
- SvStorageRef xSrcStg;
- ErrCode nError = ERRCODE_NONE;
- uno::Reference < embed::XStorage > xDstStg;
- if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg ))
- pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
- rGrf, rBoundRect, rVisArea, pStData, nError,
- nSvxMSDffOLEConvFlags, nAspect );
- return pRet;
-}
-
-const GDIMetaFile* SvxMSDffManager::lcl_GetMetaFileFromGrf_Impl( const Graphic& rGrf,
- GDIMetaFile& rMtf )
-{
- const GDIMetaFile* pMtf;
- if( GRAPHIC_BITMAP == rGrf.GetType() )
- {
- Point aPt;
- const Size aSz(lcl_GetPrefSize(rGrf, MAP_100TH_MM));
-
- VirtualDevice aVirtDev;
- aVirtDev.EnableOutput( FALSE );
- MapMode aMM(MAP_100TH_MM);
- aVirtDev.SetMapMode( aMM );
-
- rMtf.Record( &aVirtDev );
- rGrf.Draw( &aVirtDev, aPt, aSz );
- rMtf.Stop();
- rMtf.SetPrefMapMode(aMM);
- rMtf.SetPrefSize( aSz );
-
- pMtf = &rMtf;
- }
- else
- pMtf = &rGrf.GetGDIMetaFile();
- return pMtf;
-}
-
-BOOL SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & rMtf )
-{
- String aPersistStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SVEXT_PERSIST_STREAM ) ) );
- SotStorageStreamRef xStm = pStor->OpenSotStream( aPersistStream );
- xStm->SetVersion( pStor->GetVersion() );
- xStm->SetBufferSize( 8192 );
-
- USHORT nAspect = ASPECT_CONTENT;
- ULONG nAdviseModes = 2;
-
- Impl_OlePres aEle( FORMAT_GDIMETAFILE );
- // Die Groesse in 1/100 mm umrechnen
- // Falls eine nicht anwendbare MapUnit (Device abhaengig) verwendet wird,
- // versucht SV einen BestMatchden richtigen Wert zu raten.
- Size aSize = rMtf.GetPrefSize();
- MapMode aMMSrc = rMtf.GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
- aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- aEle.SetSize( aSize );
- aEle.SetAspect( nAspect );
- aEle.SetAdviseFlags( nAdviseModes );
- aEle.SetMtf( rMtf );
- aEle.Write( *xStm );
-
- xStm->SetBufferSize( 0 );
- return xStm->GetError() == SVSTREAM_OK;
-}
-
-struct ClsIDs {
- UINT32 nId;
- const sal_Char* pSvrName;
- const sal_Char* pDspName;
-};
-static ClsIDs aClsIDs[] = {
-
- { 0x000212F0, "MSWordArt", "Microsoft Word Art" },
- { 0x000212F0, "MSWordArt.2", "Microsoft Word Art 2.0" },
-
- // MS Apps
- { 0x00030000, "ExcelWorksheet", "Microsoft Excel Worksheet" },
- { 0x00030001, "ExcelChart", "Microsoft Excel Chart" },
- { 0x00030002, "ExcelMacrosheet", "Microsoft Excel Macro" },
- { 0x00030003, "WordDocument", "Microsoft Word Document" },
- { 0x00030004, "MSPowerPoint", "Microsoft PowerPoint" },
- { 0x00030005, "MSPowerPointSho", "Microsoft PowerPoint Slide Show"},
- { 0x00030006, "MSGraph", "Microsoft Graph" },
- { 0x00030007, "MSDraw", "Microsoft Draw" },
- { 0x00030008, "Note-It", "Microsoft Note-It" },
- { 0x00030009, "WordArt", "Microsoft Word Art" },
- { 0x0003000a, "PBrush", "Microsoft PaintBrush Picture" },
- { 0x0003000b, "Equation", "Microsoft Equation Editor" },
- { 0x0003000c, "Package", "Package" },
- { 0x0003000d, "SoundRec", "Sound" },
- { 0x0003000e, "MPlayer", "Media Player" },
- // MS Demos
- { 0x0003000f, "ServerDemo", "OLE 1.0 Server Demo" },
- { 0x00030010, "Srtest", "OLE 1.0 Test Demo" },
- { 0x00030011, "SrtInv", "OLE 1.0 Inv Demo" },
- { 0x00030012, "OleDemo", "OLE 1.0 Demo" },
-
- // Coromandel / Dorai Swamy / 718-793-7963
- { 0x00030013, "CoromandelIntegra", "Coromandel Integra" },
- { 0x00030014, "CoromandelObjServer","Coromandel Object Server" },
-
- // 3-d Visions Corp / Peter Hirsch / 310-325-1339
- { 0x00030015, "StanfordGraphics", "Stanford Graphics" },
-
- // Deltapoint / Nigel Hearne / 408-648-4000
- { 0x00030016, "DGraphCHART", "DeltaPoint Graph Chart" },
- { 0x00030017, "DGraphDATA", "DeltaPoint Graph Data" },
-
- // Corel / Richard V. Woodend / 613-728-8200 x1153
- { 0x00030018, "PhotoPaint", "Corel PhotoPaint" },
- { 0x00030019, "CShow", "Corel Show" },
- { 0x0003001a, "CorelChart", "Corel Chart" },
- { 0x0003001b, "CDraw", "Corel Draw" },
-
- // Inset Systems / Mark Skiba / 203-740-2400
- { 0x0003001c, "HJWIN1.0", "Inset Systems" },
-
- // Mark V Systems / Mark McGraw / 818-995-7671
- { 0x0003001d, "ObjMakerOLE", "MarkV Systems Object Maker" },
-
- // IdentiTech / Mike Gilger / 407-951-9503
- { 0x0003001e, "FYI", "IdentiTech FYI" },
- { 0x0003001f, "FYIView", "IdentiTech FYI Viewer" },
-
- // Inventa Corporation / Balaji Varadarajan / 408-987-0220
- { 0x00030020, "Stickynote", "Inventa Sticky Note" },
-
- // ShapeWare Corp. / Lori Pearce / 206-467-6723
- { 0x00030021, "ShapewareVISIO10", "Shapeware Visio 1.0" },
- { 0x00030022, "ImportServer", "Spaheware Import Server" },
-
- // test app SrTest
- { 0x00030023, "SrvrTest", "OLE 1.0 Server Test" },
-
- // test app ClTest. Doesn't really work as a server but is in reg db
- { 0x00030025, "Cltest", "OLE 1.0 Client Test" },
-
- // Microsoft ClipArt Gallery Sherry Larsen-Holmes
- { 0x00030026, "MS_ClipArt_Gallery", "Microsoft ClipArt Gallery" },
- // Microsoft Project Cory Reina
- { 0x00030027, "MSProject", "Microsoft Project" },
-
- // Microsoft Works Chart
- { 0x00030028, "MSWorksChart", "Microsoft Works Chart" },
-
- // Microsoft Works Spreadsheet
- { 0x00030029, "MSWorksSpreadsheet", "Microsoft Works Spreadsheet" },
-
- // AFX apps - Dean McCrory
- { 0x0003002A, "MinSvr", "AFX Mini Server" },
- { 0x0003002B, "HierarchyList", "AFX Hierarchy List" },
- { 0x0003002C, "BibRef", "AFX BibRef" },
- { 0x0003002D, "MinSvrMI", "AFX Mini Server MI" },
- { 0x0003002E, "TestServ", "AFX Test Server" },
-
- // Ami Pro
- { 0x0003002F, "AmiProDocument", "Ami Pro Document" },
-
- // WordPerfect Presentations For Windows
- { 0x00030030, "WPGraphics", "WordPerfect Presentation" },
- { 0x00030031, "WPCharts", "WordPerfect Chart" },
-
- // MicroGrafx Charisma
- { 0x00030032, "Charisma", "MicroGrafx Charisma" },
- { 0x00030033, "Charisma_30", "MicroGrafx Charisma 3.0" },
- { 0x00030034, "CharPres_30", "MicroGrafx Charisma 3.0 Pres" },
- // MicroGrafx Draw
- { 0x00030035, "Draw", "MicroGrafx Draw" },
- // MicroGrafx Designer
- { 0x00030036, "Designer_40", "MicroGrafx Designer 4.0" },
-
- // STAR DIVISION
-// { 0x000424CA, "StarMath", "StarMath 1.0" },
- { 0x00043AD2, "FontWork", "Star FontWork" },
-// { 0x000456EE, "StarMath2", "StarMath 2.0" },
-
- { 0, "", "" } };
-
-
-BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
- const GDIMetaFile * pMtf, const SotStorageRef& rDest )
-{
- BOOL bMtfRead = FALSE;
- SotStorageStreamRef xOle10Stm = rDest->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ),
- STREAM_WRITE| STREAM_SHARE_DENYALL );
- if( xOle10Stm->GetError() )
- return FALSE;
-
- UINT32 nType;
- UINT32 nRecType;
- UINT32 nStrLen;
- String aSvrName;
- UINT32 nDummy0;
- UINT32 nDummy1;
- UINT32 nDataLen;
- BYTE * pData;
- UINT32 nBytesRead = 0;
- do
- {
- rStm >> nType;
- rStm >> nRecType;
- rStm >> nStrLen;
- if( nStrLen )
- {
- if( 0x10000L > nStrLen )
- {
- sal_Char * pBuf = new sal_Char[ nStrLen ];
- rStm.Read( pBuf, nStrLen );
- aSvrName.Assign( String( pBuf, (USHORT) nStrLen-1, gsl_getSystemTextEncoding() ) );
- delete[] pBuf;
- }
- else
- break;
- }
- rStm >> nDummy0;
- rStm >> nDummy1;
- rStm >> nDataLen;
-
- nBytesRead += 6 * sizeof( UINT32 ) + nStrLen + nDataLen;
-
- if( !rStm.IsEof() && nReadLen > nBytesRead && nDataLen )
- {
- if( xOle10Stm.Is() )
- {
- pData = new BYTE[ nDataLen ];
- if( !pData )
- return FALSE;
-
- rStm.Read( pData, nDataLen );
-
- // write to ole10 stream
- *xOle10Stm << nDataLen;
- xOle10Stm->Write( pData, nDataLen );
- xOle10Stm = SotStorageStreamRef();
-
- // set the compobj stream
- ClsIDs* pIds;
- for( pIds = aClsIDs; pIds->nId; pIds++ )
- {
- if( COMPARE_EQUAL == aSvrName.CompareToAscii( pIds->pSvrName ) )
- break;
- }
-// SvGlobalName* pClsId = NULL;
- String aShort, aFull;
- if( pIds->nId )
- {
- // gefunden!
- ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
- rDest->SetClass( SvGlobalName( pIds->nId, 0, 0, 0xc0,0,0,0,0,0,0,0x46 ), nCbFmt,
- String( pIds->pDspName, RTL_TEXTENCODING_ASCII_US ) );
- }
- else
- {
- ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
- rDest->SetClass( SvGlobalName(), nCbFmt, aSvrName );
- }
-
- delete[] pData;
- }
- else if( nRecType == 5 && !pMtf )
- {
- ULONG nPos = rStm.Tell();
- UINT16 sz[4];
- rStm.Read( sz, 8 );
- //rStm.SeekRel( 8 );
- Graphic aGraphic;
- if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() )
- {
- const GDIMetaFile& rMtf = aGraphic.GetGDIMetaFile();
- MakeContentStream( rDest, rMtf );
- bMtfRead = TRUE;
- }
- // set behind the data
- rStm.Seek( nPos + nDataLen );
- }
- else
- rStm.SeekRel( nDataLen );
- }
- } while( !rStm.IsEof() && nReadLen >= nBytesRead );
-
- if( !bMtfRead && pMtf )
- {
- MakeContentStream( rDest, *pMtf );
- return TRUE;
- }
-
- return FALSE;
-}
-
-const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName )
-{
- if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
- return "swriter";
- else if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
- return "scalc";
- else if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
- return "simpress";
- else if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
- return "sdraw";
- else if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
- return "smath";
- else if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_60 )
- || aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
- return "schart";
- return 0;
-}
-
-::rtl::OUString GetFilterNameFromClassID_Impl( const SvGlobalName& aGlobName )
-{
- if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Writer)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Calc)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Impress)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Draw)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Math)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "math8" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_60 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice XML (Chart)" ) );
-
- if ( aGlobName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "chart8" ) );
-
- return ::rtl::OUString();
-}
-
-com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( UINT32 nConvertFlags,
- SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage,
- const Graphic& rGrf,
- const Rectangle& rVisArea )
-{
- uno::Reference < embed::XEmbeddedObject > xObj;
- SvGlobalName aStgNm = rSrcStg.GetClassName();
- const char* pName = GetInternalServerName_Impl( aStgNm );
- String sStarName;
- if ( pName )
- sStarName = String::CreateFromAscii( pName );
- else if ( nConvertFlags )
- {
- static struct _ObjImpType
- {
- UINT32 nFlag;
- const char* pFactoryNm;
- // GlobalNameId
- UINT32 n1;
- USHORT n2, n3;
- BYTE b8, b9, b10, b11, b12, b13, b14, b15;
- } aArr[] = {
- { OLE_MATHTYPE_2_STARMATH, "smath",
- 0x0002ce02L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_MATHTYPE_2_STARMATH, "smath",
- 0x00021700L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_WINWORD_2_STARWRITER, "swriter",
- 0x00020906L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_EXCEL_2_STARCALC, "scalc", // Excel table
- 0x00020810L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_EXCEL_2_STARCALC, "scalc", // Excel chart
- 0x00020820L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- // 114465: additional Excel OLE chart classId to above.
- { OLE_EXCEL_2_STARCALC, "scalc",
- 0x00020821L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint presentation
- 0x64818d10L, 0x4f9b, 0x11cf,
- 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
- { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint slide
- 0x64818d11L, 0x4f9b, 0x11cf,
- 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
- { 0, 0,
- 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0 }
- };
-
- for( const _ObjImpType* pArr = aArr; pArr->nFlag; ++pArr )
- {
- if( nConvertFlags & pArr->nFlag )
- {
- SvGlobalName aTypeName( pArr->n1, pArr->n2, pArr->n3,
- pArr->b8, pArr->b9, pArr->b10, pArr->b11,
- pArr->b12, pArr->b13, pArr->b14, pArr->b15 );
-
- if ( aStgNm == aTypeName )
- {
- sStarName = String::CreateFromAscii( pArr->pFactoryNm );
- break;
- }
- }
- }
- }
-
- if ( sStarName.Len() )
- {
- //TODO/MBA: check if (and when) storage and stream will be destroyed!
- const SfxFilter* pFilter = 0;
- SvMemoryStream* pStream = new SvMemoryStream;
- if ( pName )
- {
- // TODO/LATER: perhaps we need to retrieve VisArea and Metafile from the storage also
- SotStorageStreamRef xStr = rSrcStg.OpenSotStream( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "package_stream" ) ), STREAM_STD_READ );
- *xStr >> *pStream;
- }
- else
- {
- SfxFilterMatcher aMatch( sStarName );
- SotStorageRef xStorage = new SotStorage( FALSE, *pStream );
- rSrcStg.CopyTo( xStorage );
- xStorage->Commit();
- xStorage.Clear();
- String aType = SfxFilter::GetTypeFromStorage( rSrcStg );
- if ( aType.Len() )
- pFilter = aMatch.GetFilter4EA( aType );
- }
-
- if ( pName || pFilter )
- {
- //Reuse current ole name
- String aDstStgName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
- aDstStgName += String::CreateFromInt32(nMSOleObjCntr);
-
- ::rtl::OUString aFilterName;
- if ( pFilter )
- aFilterName = pFilter->GetName();
- else
- aFilterName = GetFilterNameFromClassID_Impl( aStgNm );
-
- uno::Sequence < beans::PropertyValue > aMedium( aFilterName.getLength() ? 3 : 2);
- aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) );
- uno::Reference < io::XInputStream > xStream = new ::utl::OSeekableInputStreamWrapper( *pStream );
- aMedium[0].Value <<= xStream;
- aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
- aMedium[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) );
-
- if ( aFilterName.getLength() )
- {
- aMedium[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
- aMedium[2].Value <<= aFilterName;
- }
-
- ::rtl::OUString aName( aDstStgName );
- comphelper::EmbeddedObjectContainer aCnt( rDestStorage );
- xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
-
- if ( !xObj.is() )
- {
- if( aFilterName.getLength() )
- {
- // throw the filter parameter away as workaround
- aMedium.realloc( 2 );
- xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
- }
-
- if ( !xObj.is() )
- return xObj;
- }
-
- // TODO/LATER: ViewAspect must be passed from outside!
- sal_Int64 nViewAspect = embed::Aspects::MSOLE_CONTENT;
-
- // JP 26.10.2001: Bug 93374 / 91928 the writer
- // objects need the correct visarea needs the
- // correct visarea, but this is not true for
- // PowerPoint (see bugdoc 94908b)
- // SJ: 19.11.2001 bug 94908, also chart objects
- // needs the correct visarea
-
- // If pName is set this is an own embedded object, it should have the correct size internally
- // TODO/LATER: it might make sence in future to set the size stored in internal object
- if( !pName && ( sStarName.EqualsAscii( "swriter" ) || sStarName.EqualsAscii( "scalc" ) ) )
- {
- MapMode aMapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nViewAspect ) ) );
- Size aSz;
- if ( rVisArea.IsEmpty() )
- aSz = lcl_GetPrefSize(rGrf, aMapMode );
- else
- {
- aSz = rVisArea.GetSize();
- aSz = OutputDevice::LogicToLogic( aSz, MapMode( MAP_100TH_MM ), aMapMode );
- }
-
- // don't modify the object
- //TODO/LATER: remove those hacks, that needs to be done differently!
- //xIPObj->EnableSetModified( FALSE );
- awt::Size aSize;
- aSize.Width = aSz.Width();
- aSize.Height = aSz.Height();
- xObj->setVisualAreaSize( nViewAspect, aSize );
- //xIPObj->EnableSetModified( TRUE );
- }
- else if ( sStarName.EqualsAscii( "smath" ) )
- { // SJ: force the object to recalc its visarea
- //TODO/LATER: wait for PrinterChangeNotification
- //xIPObj->OnDocumentPrinterChanged( NULL );
- }
- }
- }
-
- return xObj;
-}
-
-// TODO/MBA: code review and testing!
-SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
- const String& rStorageName,
- SotStorageRef& rSrcStorage,
- const uno::Reference < embed::XStorage >& xDestStorage,
- const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
- SvStream* pDataStrm,
- ErrCode& rError,
- UINT32 nConvertFlags,
- sal_Int64 nReccomendedAspect )
-{
- sal_Int64 nAspect = nReccomendedAspect;
- SdrOle2Obj* pRet = 0;
- if( rSrcStorage.Is() && xDestStorage.is() && rStorageName.Len() )
- {
- comphelper::EmbeddedObjectContainer aCnt( xDestStorage );
- // Ist der 01Ole-Stream ueberhaupt vorhanden ?
- // ( ist er z.B. bei FontWork nicht )
- // Wenn nicht -> Einbindung als Grafik
- BOOL bValidStorage = FALSE;
- String aDstStgName( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
-
- aDstStgName += String::CreateFromInt32( ++nMSOleObjCntr );
-
- {
- SvStorageRef xObjStg = rSrcStorage->OpenSotStorage( rStorageName,
- STREAM_READWRITE| STREAM_SHARE_DENYALL );
- if( xObjStg.Is() )
- {
- {
- BYTE aTestA[10]; // exist the \1CompObj-Stream ?
- SvStorageStreamRef xSrcTst = xObjStg->OpenSotStream(
- String(RTL_CONSTASCII_STRINGPARAM("\1CompObj"),
- RTL_TEXTENCODING_MS_1252 ));
- bValidStorage = xSrcTst.Is() && sizeof( aTestA ) ==
- xSrcTst->Read( aTestA, sizeof( aTestA ) );
- if( !bValidStorage )
- {
- // or the \1Ole-Stream ?
- xSrcTst = xObjStg->OpenSotStream(
- String(RTL_CONSTASCII_STRINGPARAM("\1Ole"),
- RTL_TEXTENCODING_MS_1252 ));
- bValidStorage = xSrcTst.Is() && sizeof(aTestA) ==
- xSrcTst->Read(aTestA, sizeof(aTestA));
- }
- }
-
- if( bValidStorage )
- {
- if ( nAspect != embed::Aspects::MSOLE_ICON )
- {
- // check whether the object is iconified one
- // usually this information is already known, the only exception
- // is a kind of embedded objects in Word documents
- // TODO/LATER: should the caller be notified if the aspect changes in future?
-
- SvStorageStreamRef xObjInfoSrc = xObjStg->OpenSotStream(
- String( RTL_CONSTASCII_STRINGPARAM( "\3ObjInfo" ) ),
- STREAM_STD_READ | STREAM_NOCREATE );
- if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() )
- {
- BYTE nByte = 0;
- *xObjInfoSrc >> nByte;
- if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON )
- nAspect = embed::Aspects::MSOLE_ICON;
- }
- }
-
- uno::Reference < embed::XEmbeddedObject > xObj( CheckForConvertToSOObj(
- nConvertFlags, *xObjStg, xDestStorage, rGrf, rVisArea ));
- if ( xObj.is() )
- {
- svt::EmbeddedObjectRef aObj( xObj, nAspect );
-
- // TODO/LATER: need MediaType
- aObj.SetGraphic( rGrf, ::rtl::OUString() );
-
- // TODO/MBA: check setting of PersistName
- pRet = new SdrOle2Obj( aObj, String(), rBoundRect, false);
- // we have the Object, don't create another
- bValidStorage = false;
- }
- }
- }
- }
-
- if( bValidStorage )
- {
- // object is not an own object
- SotStorageRef xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName, STREAM_READWRITE );
-
- if ( xObjStor.Is() )
- {
- SotStorageRef xSrcStor = rSrcStorage->OpenSotStorage( rStorageName, STREAM_READ );
- xSrcStor->CopyTo( xObjStor );
-
- if( !xObjStor->GetError() )
- xObjStor->Commit();
-
- if( xObjStor->GetError() )
- {
- rError = xObjStor->GetError();
- bValidStorage = FALSE;
- }
- else if( !xObjStor.Is() )
- bValidStorage = FALSE;
- }
- }
- else if( pDataStrm )
- {
- UINT32 nLen, nDummy;
- *pDataStrm >> nLen >> nDummy;
- if( SVSTREAM_OK != pDataStrm->GetError() ||
- // Id in BugDoc - exist there other Ids?
- // The ConvertToOle2 - does not check for consistent
- 0x30008 != nDummy )
- bValidStorage = FALSE;
- else
- {
- // or is it an OLE-1 Stream in the DataStream?
- SvStorageRef xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName );
- //TODO/MBA: remove metafile conversion from ConvertToOle2
- //when is this code used?!
- GDIMetaFile aMtf;
- bValidStorage = ConvertToOle2( *pDataStrm, nLen, &aMtf, xObjStor );
- xObjStor->Commit();
- }
- }
-
- if( bValidStorage )
- {
- uno::Reference < embed::XEmbeddedObject > xObj = aCnt.GetEmbeddedObject( aDstStgName );
- if( xObj.is() )
- {
- // the visual area must be retrieved from the metafile (object doesn't know it so far)
-
- if ( nAspect != embed::Aspects::MSOLE_ICON )
- {
- // working with visual area can switch the object to running state
- awt::Size aAwtSz;
- try
- {
- // the provided visual area should be used, if there is any
- if ( rVisArea.IsEmpty() )
- {
- MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- Size aSz(lcl_GetPrefSize(rGrf, MapMode(aMapUnit)));
- aAwtSz.Width = aSz.Width();
- aAwtSz.Height = aSz.Height();
- }
- else
- {
- aAwtSz.Width = rVisArea.GetWidth();
- aAwtSz.Height = rVisArea.GetHeight();
- }
- //xInplaceObj->EnableSetModified( FALSE );
- xObj->setVisualAreaSize( nAspect, aAwtSz );
- //xInplaceObj->EnableSetModified( TRUE );*/
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Could not set visual area of the object!\n" );
- }
- }
-
- svt::EmbeddedObjectRef aObj( xObj, nAspect );
-
- // TODO/LATER: need MediaType
- aObj.SetGraphic( rGrf, ::rtl::OUString() );
-
- pRet = new SdrOle2Obj( aObj, aDstStgName, rBoundRect, false);
- }
- }
- }
-
- return pRet;
-}
-
-SdrObject* SvxMSDffManager::GetAutoForm( MSO_SPT eTyp ) const
-{
- SdrObject* pRet = NULL;
-
- if(120 >= UINT16(eTyp))
- {
- pRet = new SdrRectObj();
- }
-
- DBG_ASSERT(pRet, "SvxMSDffManager::GetAutoForm -> UNKNOWN AUTOFORM");
-
- return pRet;
-}
-
-sal_Bool SvxMSDffManager::SetPropValue( const uno::Any& rAny, const uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rPropName, sal_Bool bTestPropertyAvailability )
-{
- sal_Bool bRetValue = sal_True;
- if ( bTestPropertyAvailability )
- {
- bRetValue = sal_False;
- try
- {
- uno::Reference< beans::XPropertySetInfo >
- aXPropSetInfo( rXPropSet->getPropertySetInfo() );
- if ( aXPropSetInfo.is() )
- bRetValue = aXPropSetInfo->hasPropertyByName( rPropName );
- }
- catch( uno::Exception& )
- {
- bRetValue = sal_False;
- }
- }
- if ( bRetValue )
- {
- try
- {
- rXPropSet->setPropertyValue( rPropName, rAny );
- bRetValue = sal_True;
- }
- catch( uno::Exception& )
- {
- bRetValue = sal_False;
- }
- }
- return bRetValue;
-}
-
-SvxMSDffImportRec::SvxMSDffImportRec()
- : pObj( 0 ),
- pWrapPolygon(0),
- pClientAnchorBuffer( 0 ),
- nClientAnchorLen( 0 ),
- pClientDataBuffer( 0 ),
- nClientDataLen( 0 ),
- nXAlign( 0 ), // position n cm from left
- nXRelTo( 2 ), // relative to column
- nYAlign( 0 ), // position n cm below
- nYRelTo( 2 ), // relative to paragraph
- nLayoutInTableCell( 0 ), // element is laid out in table cell
- nTextRotationAngle( 0 ),
- nDxTextLeft( 144 ),
- nDyTextTop( 72 ),
- nDxTextRight( 144 ),
- nDyTextBottom( 72 ),
- nDxWrapDistLeft( 0 ),
- nDyWrapDistTop( 0 ),
- nDxWrapDistRight( 0 ),
- nDyWrapDistBottom(0 ),
- nCropFromTop( 0 ),
- nCropFromBottom( 0 ),
- nCropFromLeft( 0 ),
- nCropFromRight( 0 ),
- aTextId( 0, 0 ),
- nNextShapeId( 0 ),
- nShapeId( 0 ),
- eShapeType( mso_sptNil )
-{
- eLineStyle = mso_lineSimple; // GPF-Bug #66227#
- bDrawHell = FALSE;
- bHidden = FALSE;
-// bInGroup = FALSE;
- bReplaceByFly = FALSE;
- bLastBoxInChain = TRUE;
- bHasUDefProp = FALSE; // was the DFF_msofbtUDefProp record set?
- bVFlip = FALSE;
- bHFlip = FALSE;
- bAutoWidth = FALSE;
-}
-
-SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy)
- : pObj( rCopy.pObj ),
- nXAlign( rCopy.nXAlign ),
- nXRelTo( rCopy.nXRelTo ),
- nYAlign( rCopy.nYAlign ),
- nYRelTo( rCopy.nYRelTo ),
- nLayoutInTableCell( rCopy.nLayoutInTableCell ),
- nTextRotationAngle( rCopy.nTextRotationAngle ),
- nDxTextLeft( rCopy.nDxTextLeft ),
- nDyTextTop( rCopy.nDyTextTop ),
- nDxTextRight( rCopy.nDxTextRight ),
- nDyTextBottom( rCopy.nDyTextBottom ),
- nDxWrapDistLeft( rCopy.nDxWrapDistLeft ),
- nDyWrapDistTop( rCopy.nDyWrapDistTop ),
- nDxWrapDistRight( rCopy.nDxWrapDistRight ),
- nDyWrapDistBottom(rCopy.nDyWrapDistBottom ),
- nCropFromTop( rCopy.nCropFromTop ),
- nCropFromBottom( rCopy.nCropFromBottom ),
- nCropFromLeft( rCopy.nCropFromLeft ),
- nCropFromRight( rCopy.nCropFromRight ),
- aTextId( rCopy.aTextId ),
- nNextShapeId( rCopy.nNextShapeId ),
- nShapeId( rCopy.nShapeId ),
- eShapeType( rCopy.eShapeType )
-{
- eLineStyle = rCopy.eLineStyle; // GPF-Bug #66227#
- bDrawHell = rCopy.bDrawHell;
- bHidden = rCopy.bHidden;
-// bInGroup = rCopy.bInGroup;
- bReplaceByFly = rCopy.bReplaceByFly;
- bAutoWidth = rCopy.bAutoWidth;
- bLastBoxInChain = rCopy.bLastBoxInChain;
- bHasUDefProp = rCopy.bHasUDefProp;
- bVFlip = rCopy.bVFlip;
- bHFlip = rCopy.bHFlip;
- nClientAnchorLen = rCopy.nClientAnchorLen;
- if( rCopy.nClientAnchorLen )
- {
- pClientAnchorBuffer = new char[ nClientAnchorLen ];
- memcpy( pClientAnchorBuffer,
- rCopy.pClientAnchorBuffer,
- nClientAnchorLen );
- }
- else
- pClientAnchorBuffer = 0;
-
- nClientDataLen = rCopy.nClientDataLen;
- if( rCopy.nClientDataLen )
- {
- pClientDataBuffer = new char[ nClientDataLen ];
- memcpy( pClientDataBuffer,
- rCopy.pClientDataBuffer,
- nClientDataLen );
- }
- else
- pClientDataBuffer = 0;
-
- if (rCopy.pWrapPolygon)
- pWrapPolygon = new Polygon(*rCopy.pWrapPolygon);
- else
- pWrapPolygon = 0;
-}
-
-SvxMSDffImportRec::~SvxMSDffImportRec()
-{
- if (pClientAnchorBuffer)
- delete[] pClientAnchorBuffer;
- if (pClientDataBuffer)
- delete[] pClientDataBuffer;
- if (pWrapPolygon)
- delete pWrapPolygon;
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
-
-void SvxMSDffManager::insertShapeId( sal_Int32 nShapeId, SdrObject* pShape )
-{
- maShapeIdContainer[nShapeId] = pShape;
-}
-
-void SvxMSDffManager::removeShapeId( SdrObject* pShape )
-{
- SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.begin() );
- const SvxMSDffShapeIdContainer::iterator aEnd( maShapeIdContainer.end() );
- while( aIter != aEnd )
- {
- if( (*aIter).second == pShape )
- {
- maShapeIdContainer.erase( aIter );
- break;
- }
- aIter++;
- }
-}
-
-SdrObject* SvxMSDffManager::getShapeForId( sal_Int32 nShapeId )
-{
- SvxMSDffShapeIdContainer::iterator aIter( maShapeIdContainer.find(nShapeId) );
- return aIter != maShapeIdContainer.end() ? (*aIter).second : 0;
-}
diff --git a/svx/source/msfilter/msfiltertracer.cxx b/svx/source/msfilter/msfiltertracer.cxx
deleted file mode 100644
index a1505e0664..0000000000
--- a/svx/source/msfilter/msfiltertracer.cxx
+++ /dev/null
@@ -1,254 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msfiltertracer.cxx,v $
- * $Revision: 1.10 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/msfiltertracer.hxx>
-#include <vcl/svapp.hxx>
-#include <tools/urlobj.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/util/logging/LogLevel.hpp>
-#include <com/sun/star/util/SearchAlgorithms.hpp>
-#include <com/sun/star/util/SearchFlags.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <svtools/FilterConfigItem.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <unotools/streamwrap.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-
-
-// --------------
-// - Namespaces -
-// --------------
-
-using namespace ::com::sun::star;
-
-MSFilterTracer::MSFilterTracer( const ::rtl::OUString& rConfigPath, uno::Sequence< beans::PropertyValue >* pConfigData ) :
- mpCfgItem( new FilterConfigItem( rConfigPath, pConfigData ) ),
- mpAttributeList( new SvXMLAttributeList() ),
- mpStream( NULL ),
- mbEnabled( sal_False ) // will be set to true in StartTracing()
-{
- if ( mpCfgItem->ReadBool( rtl::OUString::createFromAscii( "On" ), sal_False ) )
- {
- uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- if ( xMgr.is() )
- {
- /* the following methods try to read a property, if it is not available it will put the second
- parameter as default into the property sequence of the FilterConfigItem. It means we ensure that
- the property is available by trying to read it (the return value of the method is ignored) */
- ::rtl::OUString aEmptyString;
- mpCfgItem->ReadInt32( rtl::OUString::createFromAscii( "LogLevel" ), util::logging::LogLevel::ALL );
- mpCfgItem->ReadString( rtl::OUString::createFromAscii( "ClassFilter" ), aEmptyString );
- mpCfgItem->ReadString( rtl::OUString::createFromAscii( "MethodFilter" ), aEmptyString );
- mpCfgItem->ReadString( rtl::OUString::createFromAscii( "MessageFilter" ), aEmptyString );
- util::SearchAlgorithms eSearchAlgorithm = (util::SearchAlgorithms)
- mpCfgItem->ReadInt32( rtl::OUString::createFromAscii( "SearchAlgorithm" ), util::SearchAlgorithms_ABSOLUTE );
-
- // creating the name of the log file
- rtl::OUString aPath( mpCfgItem->ReadString( rtl::OUString::createFromAscii( "Path" ), aEmptyString ) );
- rtl::OUString aName( mpCfgItem->ReadString( rtl::OUString::createFromAscii( "Name" ), aEmptyString ) );
- rtl::OUString aDocumentURL( mpCfgItem->ReadString( rtl::OUString::createFromAscii( "DocumentURL" ), aEmptyString ) );
- INetURLObject aLogFile( aDocumentURL );
- if ( aLogFile.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
- {
- if ( aPath.getLength() )
- {
- String aOldName( aLogFile.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::NO_DECODE ) );
- aLogFile = INetURLObject( aPath );
- aLogFile.insertName( aOldName );
- }
- if ( aName.getLength() )
- aLogFile.setName( aName );
- }
- else
- {
- if ( aPath.getLength() )
- aLogFile = INetURLObject( aPath );
- else
- {
- String aURLStr;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aURLStr ) )
- {
- aLogFile = INetURLObject(aURLStr);
- aLogFile .removeSegment();
- aLogFile .removeFinalSlash();
- }
- }
- if ( !aName.getLength() )
- aName = rtl::OUString::createFromAscii( "tracer" );
- aLogFile.insertName( aName );
- }
- aLogFile.setExtension( rtl::OUString::createFromAscii( "log" ) );
-
- // creating the file stream
- mpStream = ::utl::UcbStreamHelper::CreateStream( aLogFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC | STREAM_SHARE_DENYNONE );
- if ( mpStream && !mpStream->GetError() )
- {
- // creating a wrapper for our stream
- utl::OOutputStreamWrapper* pHelper = new ::utl::OOutputStreamWrapper( *mpStream );
- uno::Reference< io::XOutputStream > xOutputStream( pHelper );
-
- // instanciating the DocumentHandler, then setting the OutputStream
- mxHandler = uno::Reference< xml::sax::XDocumentHandler >( xMgr->createInstance( rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) ), uno::UNO_QUERY );
- uno::Reference< io::XActiveDataSource > xDocSrc( mxHandler, uno::UNO_QUERY );
- xDocSrc->setOutputStream( xOutputStream );
- mxHandler->startDocument();
- mxHandler->ignorableWhitespace ( rtl::OUString::createFromAscii( " " ) );
-
- // writing the "DocumentHandler" property, so the FilterTracer component
- // will use it for the output
- uno::Any aAny;
- aAny <<= xDocSrc;
- mpCfgItem->WriteAny( rtl::OUString::createFromAscii( "DocumentHandler" ), aAny );
-
- SvXMLAttributeList* pAttrList = new SvXMLAttributeList;
- pAttrList->AddAttribute( rtl::OUString::createFromAscii( "DocumentURL" ), aDocumentURL );
- uno::Reference < xml::sax::XAttributeList > xAttributeList(pAttrList);
- mxHandler->startElement( rtl::OUString::createFromAscii( "Document" ), xAttributeList );
- }
-
- uno::Sequence< uno::Any > aArgument( 1 );
- uno::Sequence< beans::PropertyValue > aPropValues( mpCfgItem->GetFilterData() );
- aArgument[ 0 ] <<= aPropValues;
- mxFilterTracer = xMgr->createInstanceWithArguments( rtl::OUString::createFromAscii( "com.sun.star.util.FilterTracer" ), aArgument );
- if ( mxFilterTracer.is() )
- {
- mxTextSearch = uno::Reference< util::XTextSearch >( mxFilterTracer, uno::UNO_QUERY );
- mxLogger = uno::Reference< util::logging::XLogger >( mxFilterTracer, uno::UNO_QUERY );
- if ( mxTextSearch.is() )
- {
- maSearchOptions.algorithmType = eSearchAlgorithm;
- mxTextSearch->setOptions( maSearchOptions );
- }
- }
- }
- }
-}
-
-MSFilterTracer::~MSFilterTracer()
-{
- mxLogger = NULL;
- mxFilterTracer = NULL;
- if ( mxHandler.is() )
- {
- mxHandler->ignorableWhitespace ( rtl::OUString::createFromAscii( " " ) );
- mxHandler->endElement( rtl::OUString::createFromAscii( "Document" ) );
- mxHandler->ignorableWhitespace ( rtl::OUString::createFromAscii( " " ) );
- mxHandler->endDocument();
- mxHandler = NULL;
- }
- delete mpAttributeList;
- delete mpCfgItem;
- delete mpStream;
-}
-
-void MSFilterTracer::StartTracing()
-{
- mbEnabled = mpCfgItem->ReadBool( rtl::OUString::createFromAscii( "On" ), sal_False );
-}
-
-void MSFilterTracer::EndTracing()
-{
- mbEnabled = sal_False;
-}
-
-void MSFilterTracer::StartElement( const rtl::OUString& rName, uno::Reference< xml::sax::XAttributeList > xAttribs )
-{
- if ( mxHandler.is() )
- mxHandler->startElement( rName, xAttribs );
-}
-
-void MSFilterTracer::EndElement( const rtl::OUString& rName )
-{
- if ( mxHandler.is() )
- mxHandler->endElement( rName );
-}
-
-void MSFilterTracer::Trace( const rtl::OUString& rElement, const rtl::OUString& rMessage )
-{
- if ( mbEnabled && mxLogger.is() )
- {
- sal_Bool bFilter = sal_False;
- if ( rMessage.getLength() && mxTextSearch.is() )
- {
- maSearchOptions.searchString = rMessage;
- mxTextSearch->setOptions( maSearchOptions );
- util::SearchResult aSearchResult = mxTextSearch->searchForward( rMessage, 0, rMessage.getLength() );
- bFilter = aSearchResult.subRegExpressions != 0;
- }
- if ( !bFilter )
- {
- uno::Reference < xml::sax::XAttributeList > xAttrList( new SvXMLAttributeList( *mpAttributeList ) );
- if ( mxHandler.is() )
- mxHandler->startElement( rElement, xAttrList );
- if ( rMessage.getLength() )
- {
- rtl::OUString aEmpty;
- mxLogger->logp( 0, aEmpty, aEmpty, rMessage );
- }
- if ( mxHandler.is() )
- mxHandler->endElement( rElement );
- }
- }
-}
-
-void MSFilterTracer::AddAttribute( const ::rtl::OUString& sName , const ::rtl::OUString& sValue )
-{
- if ( mbEnabled )
- mpAttributeList->AddAttribute( sName, sValue );
-}
-void MSFilterTracer::ClearAttributes()
-{
- if ( mbEnabled )
- mpAttributeList->Clear();
-}
-
-void MSFilterTracer::RemoveAttribute( const ::rtl::OUString& sName )
-{
- if ( mbEnabled )
- mpAttributeList->RemoveAttribute( sName );
-}
-
-uno::Any MSFilterTracer::GetProperty( const rtl::OUString& rPropName, const uno::Any* pDefault ) const
-{
- uno::Any aDefault;
- if ( pDefault )
- aDefault = *pDefault;
- return mpCfgItem->ReadAny( rPropName, aDefault );
-}
-
-void MSFilterTracer::SetProperty( const ::rtl::OUString& rPropName, const uno::Any& rProperty )
-{
- mpCfgItem->WriteAny( rPropName, rProperty );
-}
-
diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx
deleted file mode 100644
index 5abf32ce3d..0000000000
--- a/svx/source/msfilter/msocximex.cxx
+++ /dev/null
@@ -1,5975 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msocximex.cxx,v $
- * $Revision: 1.38 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-#include <com/sun/star/uno/Any.h>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/XText.hpp>
-#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HDL_
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/form/XFormsSupplier.hpp>
-#include <com/sun/star/form/XForm.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/awt/FontWeight.hpp>
-#include <com/sun/star/awt/FontSlant.hpp>
-#include <com/sun/star/awt/FontUnderline.hpp>
-#include <com/sun/star/awt/FontStrikeout.hpp>
-#include <com/sun/star/awt/ScrollBarOrientation.hpp>
-#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/awt/XControlModel.hpp>
-#include <com/sun/star/io/XInputStreamProvider.hpp>
-#include <rtl/ustrbuf.hxx>
-#include <vcl/svapp.hxx>
-#include <sfx2/objsh.hxx>
-#include <xmlscript/xmldlg_imexp.hxx>
-#include <svx/msocximex.hxx>
-
-#include <osl/file.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-//#include <sfx2/docfile.hxx>
-
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-
-#include <comphelper/processfactory.hxx> // shouldn't be needed
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-
-
-#include <algorithm>
-#include <memory>
-
-#ifndef C2S
-#define C2S(cChar) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar))
-#endif
-#ifndef C2U
-#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
-#endif
-
-using namespace ::com::sun::star;
-#if 0
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::drawing;
-using namespace ::com::sun::star::form;
-using namespace ::com::sun::star::text;
-using namespace ::com::sun::star::container;
-#endif
-using namespace ::rtl;
-using namespace cppu;
-
-
-#define WW8_ASCII2STR(s) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(s))
-
-
-static char sWW8_form[] = "WW-Standard";
-
-
-struct SortOrderByTabPos
-{
- bool operator()( const OCX_Control* a, const OCX_Control* b )
- {
- return a->mnTabPos < b->mnTabPos;
- }
-};
-
-
-sal_uInt8 __READONLY_DATA OCX_Control::aObjInfo[4] = { 0x00, 0x12, 0x03, 0x00 };
-
-long ReadAlign(SvStorageStream *pS, long nPos, int nAmount)
-{
- if (long nAlign = nPos % nAmount)
- {
-
- long nLen = nAmount - nAlign;
- pS->SeekRel(nLen);
- return nLen;
- }
- return 0;
-}
-
-
-// NP - Images in controls in OO2.0/SO8 exist as links, e.g. they are not part of the document so are
-// referenced externally. On import from ms document try to save images for controls here.
-// Images are stored in directory called temp in the user installation directory. Next version of OO/SO
-// hopefully will address this issue and allow a choice e.g. images for controls to be stored as links
-// or embeded in the document.
-
-// [out]location path to the stream to where the image is to be stored,
-// if same name exists in folder then this function calcuates a new name
-// [in] data raw bytes of image to be stored.
-// [in] dataLen no. byte to be stored
-//
-// returns, true if successful
-
-bool storePictureInFileSystem( OUString& location, sal_uInt8* data, sal_uInt32 dataLen )
-{
- bool result = true;
- OUString origPath = location;
- try
- {
- uno::Reference<lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(),
- uno::UNO_QUERY_THROW );
- uno::Reference< com::sun::star::ucb::XSimpleFileAccess> xSFA( xMSF->createInstance(
- S2U("com.sun.star.ucb.SimpleFileAccess" ) ),
- uno::UNO_QUERY_THROW );
- OUString ext;
- sal_Int32 index = 0;
- while ( xSFA->exists( location ) )
- {
- ext = OUString::valueOf( ++index );
- location = origPath + ext;
- }
-
- SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( location, STREAM_WRITE | STREAM_TRUNC );
- if ( pStream )
- {
- pStream->Write(data, dataLen);
- delete pStream;
- }
- else
- {
- result = false;
- }
- }
- catch( uno::Exception& )
- {
- result = false;
- }
- return result;
-}
-
-// NP - Images in controls in OO2.0/SO8 exist as links, e.g. they are not part of the document so are
-// referenced externally. On import from ms document try to save images from controls here so this
-// at least a macro programmer has a chance to accessed them manually later. Next version of OO/SO
-// hopefully will address this issue.
-// Images will be stored in a top level folder in the document package, folder is named "MigratedImages"
-
-// [in] pDocSh* the document shell.
-// [in] name name of stream image to stored in.
-// [in] data raw bytes of image to be stored.
-// [in] dataLen no. byte to be stored
-
-bool storePictureInDoc( SfxObjectShell* pDocSh, OUString& name, sal_uInt8* data, sal_uInt32 dataLen )
-{
- uno::Reference < embed::XStorage > xStor;
- if (pDocSh)
- {
- xStor = pDocSh->GetStorage();
- if( xStor.is() )
- {
- try
- {
- uno::Reference< embed::XStorage > xPictures = xStor->openStorageElement(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "MigratedImages" ) ),
- embed::ElementModes::READWRITE );
- uno::Reference< beans::XPropertySet > xPropSet( xPictures, uno::UNO_QUERY );
-
- // Set media type of folder MigratedImages to something ( that is unknown ) so that
- // it will get copied to exported OO/SO format after SaveAs
- if ( xPropSet.is() )
- {
- OUString aMediaType = C2U("MigrationImages");
- uno::Any a;
- a <<= aMediaType;
- xPropSet->setPropertyValue( C2U("MediaType"), a );
- }
-
- uno::Reference< io::XStream > xObjReplStr = xPictures->openStreamElement(
- name,
- embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
- uno::Reference< io::XOutputStream > xOutStream( xObjReplStr->getOutputStream(), uno::UNO_QUERY_THROW );
- uno::Sequence< sal_Int8 > imageBytes( (sal_Int8*)data, dataLen );
- xOutStream->writeBytes( imageBytes );
- xOutStream->closeOutput();
-
- uno::Reference< embed::XTransactedObject > xTransact( xPictures, uno::UNO_QUERY );
- if ( xTransact.is() )
- {
- xTransact->commit();
- }
- }
- catch( uno::Exception& )
- {
- return false;
- }
-
- }
- else
- {
- // no storage something wrong
- return false;
- }
- }
- else
- {
- //No doc shell
- return false;
- }
- return true;
-}
-
-long WriteAlign(SvStorageStream *pS, int nAmount)
-{
- if (long nAlign = pS->Tell() % nAmount)
- {
- long nLen = nAmount - nAlign;
- for (long i=0; i< nLen; ++i)
- *pS << sal_uInt8(0x00);
- return nLen;
- }
- return 0;
-}
-// string import/export =======================================================
-/** #117832# import of form control names
-* control name is located in stream ("\3OCXNAME")
-* a strings in "\3OCXNAME" stream seem to be terminated by 4 trailing bytes of 0's.
-* ====
-* Note: If the string in the stream is overwritten by a shorter string
-* some characters from the original string may remain, the new string however
-* will still be terminated in the same way e.g. by 4 bytes with value 0.
-*/
-
-bool writeOCXNAME( const OUString& sOCXName, SvStorageStream* pStream )
-{
- const sal_Unicode* buffer = sOCXName.getStr();
- for ( sal_Int32 index=0; index < sOCXName.getLength(); index++ )
- {
- sal_uInt16 ch = static_cast< sal_uInt16 >( buffer[ index ] );
- *pStream << ch;
- }
- // write
- *pStream << sal_uInt32(0);
- return ( SVSTREAM_OK == pStream->GetError() );
-
-}
-
-bool readOCXNAME( OUString& sCName, SvStorageStream* pStream )
-{
- /*
- * Read uniCode until no data or 0 encountered
- */
- OUStringBuffer buf(40);
- do
- {
- sal_uInt16 ch = 0;
- *pStream >> ch;
- sal_Unicode uni = static_cast< sal_Unicode >( ch );
- if ( uni == 0 )
- {
- break;
- }
- buf.append( &uni, 1 );
-
- } while ( !pStream->IsEof() );
-
- sCName = buf.makeStringAndClear();
- return ( SVSTREAM_OK == pStream->GetError() );
-}
-
-
-/* #110435# (DR, 2003-11-12) ** Import of Unicode strings in form controls **
-
- Strings may be stored either as compressed or uncompressed Unicode
- character array. There are no encoded byte strings anywhere.
-
- The string length field stores the length of the character array (not the
- character count of the string) in the lower 31 bits, and the compression
- state in the highest bit.
-
- A set bit means the character array is compressed. This means all Unicode
- characters are <=0xFF. Therefore the high bytes of all characters are left
- out, and the character array size is equal to the string length.
-
- A cleared bit means the character array is not compressed. The buffer
- contains Little-Endian Unicode characters, and the resulting string length
- is half the buffer size.
-
- TODO: This implementation of the new string import is a hack to keep
- msocximex.hxx unchanged. A better implementation would replace the char*
- members of all classes by something more reasonable.
- */
-
-namespace {
-
-const sal_uInt32 SVX_MSOCX_SIZEMASK = 0x7FFFFFFF; /// Mask for character buffer size.
-const sal_uInt32 SVX_MSOCX_COMPRESSED = 0x80000000; /// 1 = compressed Unicode array.
-
-
-/** Returns true, if the passed length field specifies a compressed character array.
- */
-inline bool lclIsCompressed( sal_uInt32 nLenFld )
-{
- return (nLenFld & SVX_MSOCX_COMPRESSED) != 0;
-}
-
-
-/** Extracts and returns the memory size of the character buffer.
- @return Character buffer size (may differ from resulting string length!).
- */
-inline sal_uInt32 lclGetBufferSize( sal_uInt32 nLenFld )
-{
- return nLenFld & SVX_MSOCX_SIZEMASK;
-}
-
-
-// import ---------------------------------------------------------------------
-
-/** Reads the character array of a string in a form control.
-
- Creates a new character array containing the character data.
- The length field must be read before and passed to this function.
- Aligns stream position to multiple of 4 before.
-
- @param rStrm
- The input stream.
-
- @param rpcCharArr
- (out-param) Will point to the created character array,
- or will be 0 if string is empty. The array is NOT null-terminated.
- If the passed pointer points to an old existing array, it will be
- deleted before. Caller must delete the returned array.
-
- @param nLenFld
- The corresponding string length field read somewhere before.
- */
-void lclReadCharArray( SvStorageStream& rStrm, char*& rpcCharArr, sal_uInt32 nLenFld, long nPos )
-{
- delete[] rpcCharArr;
- rpcCharArr = 0;
- sal_uInt32 nBufSize = lclGetBufferSize( nLenFld );
- DBG_ASSERT( nBufSize <= 0xFFFF, "lclReadCharArray - possible read error: char array is too big" );
- if( nBufSize && nBufSize <= 0xFFFF )
- {
- rpcCharArr = new char[ nBufSize ];
- if( rpcCharArr )
- {
- ReadAlign( &rStrm, nPos, 4 );
- rStrm.Read( rpcCharArr, nBufSize );
- }
- }
-}
-
-
-/** Creates an OUString from a character array created with lclReadCharArray().
-
- The passed parameters must match, that means the length field must be the
- same used to create the passed character array.
-
- @param pcCharArr
- The character array returned by lclReadCharArray(). May be compressed
- or uncompressed, next parameter nLenFld will specify this.
-
- @param nLenFld
- MUST be the same string length field that has been passed to
- lclReadCharArray() to create the character array in previous parameter
- pcCharArr.
-
- @return
- An OUString containing the decoded string data. Will be empty if
- pcCharArr is 0.
- */
-OUString lclCreateOUString( const char* pcCharArr, sal_uInt32 nLenFld )
-{
- OUStringBuffer aBuffer;
- sal_uInt32 nBufSize = lclGetBufferSize( nLenFld );
- if( lclIsCompressed( nLenFld ) )
- {
- // buffer contains compressed Unicode, not encoded bytestring
- sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize );
- aBuffer.setLength( nStrLen );
- const char* pcCurrChar = pcCharArr;
- for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar, ++pcCurrChar )
- /* *pcCurrChar may contain negative values and therefore MUST be
- casted to unsigned char, before assigned to a sal_Unicode. */
- aBuffer.setCharAt( nChar, static_cast< unsigned char >( *pcCurrChar ) );
- }
- else
- {
- // buffer contains Little-Endian Unicode
- sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize ) / 2;
- aBuffer.setLength( nStrLen );
- const char* pcCurrChar = pcCharArr;
- for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar )
- {
- /* *pcCurrChar may contain negative values and therefore MUST be
- casted to unsigned char, before assigned to a sal_Unicode. */
- sal_Unicode cChar = static_cast< unsigned char >( *pcCurrChar++ );
- cChar |= (static_cast< unsigned char >( *pcCurrChar++ ) << 8);
- aBuffer.setCharAt( nChar, cChar );
- }
- }
- return aBuffer.makeStringAndClear();
-}
-
-// export ---------------------------------------------------------------------
-
-/** This class implements writing a character array from a Unicode string.
-
- Usage:
- 1) Construct an instance, either directly with an OUString, or with an UNO
- Any containing an OUString.
- 2) Check with HasData(), if there is something to write.
- 3) Write the string length field with WriteLenField() at the right place.
- 4) Write the encoded character array with WriteCharArray().
- */
-class SvxOcxString
-{
-public:
- /** Constructs an empty string. String data may be set later by assignment. */
- inline explicit SvxOcxString() : mnLenFld( 0 ) {}
- /** Constructs the string from the passed OUString. */
- inline explicit SvxOcxString( const OUString& rStr ) { Init( rStr ); }
- /** Constructs the string from the passed UNO Any. */
- inline explicit SvxOcxString( const uno::Any& rAny ) { Init( rAny ); }
-
- /** Assigns the passed string to the object. */
- inline SvxOcxString& operator=( const OUString& rStr ) { Init( rStr ); return *this; }
- /** Assigns the string in the passed UNO Any to the object. */
- inline SvxOcxString& operator=( const uno::Any& rAny ) { Init( rAny ); return *this; }
-
- /** Returns true, if the string contains at least one character to write. */
- inline bool HasData() const { return maString.getLength() > 0; }
-
- /** Writes the encoded 32-bit string length field. Aligns stream position to mult. of 4 before. */
- void WriteLenField( SvStorageStream& rStrm ) const;
- /** Writes the encoded character array. Aligns stream position to mult. of 4 before. */
- void WriteCharArray( SvStorageStream& rStrm ) const;
-
-private:
- inline void Init( const OUString& rStr ) { maString = rStr; Init(); }
- void Init( const uno::Any& rAny );
- void Init();
-
- OUString maString; /// The initial string data.
- sal_uInt32 mnLenFld; /// The encoded string length field.
-};
-
-void SvxOcxString::Init( const uno::Any& rAny )
-{
- if( !(rAny >>= maString) )
- maString = OUString();
- Init();
-}
-
-void SvxOcxString::Init()
-{
- mnLenFld = static_cast< sal_uInt32 >( maString.getLength() );
- bool bCompr = true;
- // try to find a character >= 0x100 -> character array will be stored uncompressed then
- if( const sal_Unicode* pChar = maString.getStr() )
- for( const sal_Unicode* pEnd = pChar + maString.getLength(); bCompr && (pChar < pEnd); ++pChar )
- bCompr = (*pChar < 0x100);
- if( bCompr )
- mnLenFld |= SVX_MSOCX_COMPRESSED;
- else
- mnLenFld *= 2;
-}
-
-void SvxOcxString::WriteLenField( SvStorageStream& rStrm ) const
-{
- if( HasData() )
- {
- WriteAlign( &rStrm, 4);
- rStrm << mnLenFld;
- }
-}
-
-void SvxOcxString::WriteCharArray( SvStorageStream& rStrm ) const
-{
- if( HasData() )
- {
- const sal_Unicode* pChar = maString.getStr();
- const sal_Unicode* pEnd = pChar + maString.getLength();
- bool bCompr = lclIsCompressed( mnLenFld );
-
- WriteAlign( &rStrm, 4);
- for( ; pChar < pEnd; ++pChar )
- {
- // write compressed Unicode (not encoded bytestring), or Little-Endian Unicode
- rStrm << static_cast< sal_uInt8 >( *pChar );
- if( !bCompr )
- rStrm << static_cast< sal_uInt8 >( *pChar >> 8 );
- }
- }
-}
-
-const sal_uInt16 USERFORM = (sal_uInt16)0xFF;
-const sal_uInt16 STDCONTAINER = (sal_uInt16)0xFE;
-
-const sal_uInt16 PAGE = (sal_uInt16)0x07;
-
-const sal_uInt16 IMAGE = (sal_uInt16)0x0C;
-const sal_uInt16 FRAME = (sal_uInt16)0x0E;
-
-const sal_uInt16 SPINBUTTON = (sal_uInt16)0x10;
-const sal_uInt16 CMDBUTTON = (sal_uInt16)0x11;
-const sal_uInt16 TABSTRIP = (sal_uInt16)0x12;
-
-const sal_uInt16 LABEL = (sal_uInt16)0x15;
-
-const sal_uInt16 TEXTBOX = (sal_uInt16)0x17;
-const sal_uInt16 LISTBOX = (sal_uInt16)0x18;
-const sal_uInt16 COMBOBOX = (sal_uInt16)0x19;
-const sal_uInt16 CHECKBOX = (sal_uInt16)0x1A;
-
-const sal_uInt16 OPTIONBUTTON = (sal_uInt16)0x1B;
-const sal_uInt16 TOGGLEBUTTON = (sal_uInt16)0x1C;
-
-const sal_uInt16 SCROLLBAR = (sal_uInt16)0x2F;
-
-const sal_uInt16 MULTIPAGE = (sal_uInt16)0x39;
-const sal_uInt16 PROGRESSBAR = (sal_uInt16)0x8000;
-
-typedef std::vector< ContainerRecord > ContainerRecordList;
-
-class ContainerRecReader
-{
- public:
-
- virtual ~ContainerRecReader() {}
-
- virtual bool Read( OCX_ContainerControl* pContainerControl, SvStorageStream *pS)
- {
- *pS >> nNoRecords;
- *pS >> nTotalLen;
-
- if ( isMultiPage )
- {
- if ( !handleMultiPageHdr( pS ) )
- {
- return false;
- }
- }
- else
- {
- if ( !handleStandardHdr( pS ) )
- {
- return false;
- }
- }
-
- records.clear();
- for (sal_uInt32 nRecord = 0; nRecord < nNoRecords; ++nRecord)
- {
- // DR #134146# redo loading of FrameChild data
-
- ContainerRecord rec;
-
- // record header
- sal_uInt16 nId, nSize;
- *pS >> nId >> nSize;
- sal_Size nStartPos = pS->Tell();
-
- // content flags
- sal_uInt32 nContentFlags;
- *pS >> nContentFlags;
-
- // length of control name
- sal_uInt32 nNameLen = 0;
- if( nContentFlags & 0x00000001 )
- *pS >> nNameLen;
- // length of control tag
- sal_uInt32 nTagLen = 0;
- if( nContentFlags & 0x00000002 )
- *pS >> nTagLen;
- // substorage id for frames
- if( nContentFlags & 0x00000004 )
- *pS >> rec.nSubStorageId;
- // help-context id
- if( nContentFlags & 0x00000008 )
- pS->SeekRel( 4 );
- // option flags
- if( nContentFlags & 0x00000010 )
- {
- sal_uInt32 nBitFlags = 0;
- *pS >> nBitFlags;
- rec.bVisible = ( ( nBitFlags & 0x02 ) == 0x02 );
- }
- // substream size
- if( nContentFlags & 0x00000020 )
- *pS >> rec.nSubStreamLen;
- // tabstop position
- if( nContentFlags & 0x00000040 )
- *pS >> rec.nTabPos;
- // control type
- if( nContentFlags & 0x00000080 )
- *pS >> rec.nTypeIdent;
- // length of infotip
- sal_uInt32 nTipLen = 0;
- if( nContentFlags & 0x00000800 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- *pS >> nTipLen;
- }
-
- sal_uInt32 nCntrlIdLen = 0;
- if( nContentFlags & 0x00001000 )
- *pS >> nCntrlIdLen;
-
- // length of control source name
- sal_uInt32 nCtrlSrcLen = 0;
- if( nContentFlags & 0x00002000 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- *pS >> nCtrlSrcLen;
- }
-
- // length of row source name
- sal_uInt32 nRowSrcLen = 0;
- if( nContentFlags & 0x00004000 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- *pS >> nRowSrcLen;
- }
-
- // control name
- sal_Char* pName = 0;
- sal_uInt32 nNameBufSize = lclGetBufferSize( nNameLen );
- if( nNameBufSize > 0 )
- {
- pName = new char[ nNameBufSize ];
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- pS->Read( pName, nNameBufSize );
- }
- // control tag
- sal_uInt32 nTagBufSize = lclGetBufferSize( nTagLen );
- if( nTagBufSize > 0 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- pS->SeekRel( nTagBufSize );
- }
-
- // control position
- if( nContentFlags & 0x00000100 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- *pS >> rec.nLeft >> rec.nTop;
- }
-
- // control infotip
- sal_uInt32 nTipBufSize = lclGetBufferSize( nTipLen );
- if( nTipBufSize > 0 )
- {
- std::auto_ptr< sal_Char > pTipName;
- pTipName.reset( new sal_Char[ nTipBufSize ] );
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- pS->Read( pTipName.get(), nTipBufSize );
- rec.controlTip = lclCreateOUString( pTipName.get(), nTipLen );
- }
- // control id
- sal_uInt32 nCntrlIdSize = lclGetBufferSize( nCntrlIdLen );
- if( nCntrlIdSize > 0 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- pS->SeekRel( nCntrlIdSize );
- }
- // control source name
- sal_uInt32 nCtrlSrcBufSize = lclGetBufferSize( nCtrlSrcLen );
- if( nCtrlSrcBufSize > 0 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- pS->SeekRel( nCtrlSrcBufSize );
- }
- // row source name
- sal_uInt32 nRowSrcBufSize = lclGetBufferSize( nRowSrcLen );
- if( nRowSrcBufSize > 0 )
- {
- ReadAlign( pS, pS->Tell() - nStartPos, 4 );
- pS->SeekRel( nRowSrcBufSize );
- }
-
- // seek to end of data
- pS->Seek( nStartPos + nSize );
-
- rec.cName = lclCreateOUString(pName, nNameLen);
- delete[] pName;
-
- OCX_Control* pControl = NULL;
- if( pContainerControl->createFromContainerRecord( rec, pControl ) &&
- pControl )
- {
- // propagate doc shell from parent
- pControl->pDocSh = pContainerControl->pDocSh;
- pContainerControl->ProcessControl( pControl, pS, rec );
- }
- else
- {
- DBG_ERROR("Terminating import, unexpected error");
- return false;
- }
- }
- return true;
- }
-
- protected:
- ContainerRecReader() : isMultiPage(false){}
- bool isMultiPage;
- sal_uInt32 nNoRecords;
- sal_uInt32 nTotalLen;
-
- private:
- bool handleStandardHdr( SvStorageStream* pS )
- {
- sal_uInt8 aUnknown11[4];
- pS->Read(aUnknown11, sizeof(aUnknown11));
- return true;
- }
-
- bool handleMultiPageHdr( SvStorageStream* pS )
- {
- sal_uInt32 nUnknown_32b; // unknown 32 bit structure, flags ?
- sal_uInt16 nUnknown_16b; // unknown 16 bit structure
- sal_uInt16 nMysteryLen; // lenght of unknown sub record
-
- *pS >> nUnknown_32b;
- *pS >> nUnknown_16b;
- *pS >> nMysteryLen;
-
- pS->SeekRel( nMysteryLen );
- return true;
- }
- ContainerRecordList records;
-};
-
-class StdContainerRecReader : public ContainerRecReader
-{
- public:
- StdContainerRecReader(){}
-};
-
-class MultiPageContainerRecReader : public ContainerRecReader
-{
- public:
- MultiPageContainerRecReader()
- {
- // NP ( 27-01-05 )
- // Strictly speaking this approach shouldn't be necessary.
- // It should be possible to have a common routine read the
- // container record array and by examining the flags present in
- // the record to determine we expect to read or not.
- // In this case for a MultPage control there is no Top or Left
- // values in the control record array, however time contraints
- // and associated risk prevent further investigation of this
- // at the moment.
- // similar situation exists for the start of the container record
- // which in the case of the MultiPage is different from
- // UserForm & Frame ( the other containers )
-
- isMultiPage = true; // tell the base class skip
- }
-};
-
-class ContainerRecordReaderFac
-{
- public:
- static ContainerRecReader* instance( sal_uInt32 containerType )
- {
- switch( containerType )
- {
- case PAGE:
- case FRAME:
- case USERFORM:
- case STDCONTAINER:
- return new StdContainerRecReader();
- case MULTIPAGE:
- return new MultiPageContainerRecReader();
- default:
- DBG_ERROR("Illegal container type for factory");
- return NULL;
- }
- }
- private:
- ContainerRecordReaderFac();
-};
-
-} // namespace
-
-// ============================================================================
-
-void RBGroup::add(OCX_Control* pRB)
-{
- // The tab index for the group is calculated as
- // the lowest tab index found in the list of RadioButtons
- if ( pRB->mnTabPos < mRBGroupPos )
- {
- mRBGroupPos = pRB->mnTabPos;
- CtrlIterator aEnd = mpControls.end();
- for (CtrlIterator aIter = mpControls.begin(); aIter != aEnd; ++ aIter )
- {
- (*aIter)->mnTabPos = mRBGroupPos;
- }
- }
- mpControls.push_back( pRB );
-}
-
-struct SortGroupByTabPos
-{
- bool operator()( const RBGroup* a, const RBGroup* b )
- {
- return a->tabPos() < b->tabPos();
- }
-};
-
-RBGroupManager::RBGroupManager( String& defaultName ):mSDefaultName( defaultName ),
- numRadioButtons(0)
-{
- groupList.reserve( 8 ); // reserve far more than we expect
-}
-
-RBGroupManager::~RBGroupManager()
-{
- for ( GroupIterator gIter=groupList.begin(); gIter!=groupList.end(); ++gIter )
- {
- delete( *gIter );
- }
-}
-
-// Loose description of the method below ( I sure there is a better way to do
-// this )
-// In order to "fake" MS grouping behavior for OptionButtons the OptionButtons
-// in the same group need to have consecutive tab indices ( regardless of the
-// imported tab indices of the RadioButtons ). Additionally if two
-// groups of OptionButtons end up having all consecutive indices they
-// will be treated as a single group by OpenOffice. In this case
-// a dummy seperator control needs to be inserted between the groups.
-//
-// This method returns a new list "destinationList" containing the controls
-// passed in "sourceList" and the OptionButtons contained in the various
-// Groups maintained by this class.
-// Controls are ordered in the destination list by tab index.
-// Each RadioButtonGroup has a tab index associated with it.
-// ( Tab index of a RadioGroup is determined as the tab index of the
-// OptionButton control with the lowest tab index in the group )
-
-
-void RBGroupManager::addRadioButton( OCX_OptionButton* pRButton )
-{
- if ( pRButton )
- {
- OUString groupName = mSDefaultName;
- if ( pRButton->nGroupNameLen )
- {
- groupName =
- lclCreateOUString(pRButton->pGroupName,
- pRButton->nGroupNameLen);
- }
- ++numRadioButtons;
- RBGroupHash::iterator iter = rbGroups.find( groupName );
- if ( iter != rbGroups.end() )
- {
- iter->second->controls().push_back( pRButton );
- }
- else
- {
- RBGroup* newGroup = new RBGroup(pRButton->mnTabPos);
- newGroup->controls().push_back( pRButton );
- rbGroups[ groupName ] = newGroup;
- groupList.push_back( newGroup );
- }
-
- }
-}
-
-CtrlList RBGroupManager::insertGroupsIntoControlList( const CtrlList& sourceList )
-{
- ::std::sort( groupList.begin(), groupList.end(), SortGroupByTabPos() );
- std::vector<OCX_Control*> destinationList;
- if ( groupList.size() )
- {
- destinationList.reserve( sourceList.size() + numRadioButtons );
-
- GroupIterator groupEnd = groupList.end();
- CtrlIteratorConst sourceEnd = sourceList.end();
-
- size_t prevGroupListSize = 0;
-
- CtrlIteratorConst containees = sourceList.begin();
- GroupIterator groupIter=groupList.begin();
- while ( containees != sourceEnd ||
- groupIter != groupEnd )
- {
- bool addGroupSeperator = false;
- if ( containees != sourceEnd )
- {
- if ( groupIter != groupEnd )
- {
- sal_Int16 groupTabPos = (*groupIter)->tabPos();
- if ( (*containees)->mnTabPos >= groupTabPos )
- {
- if ( !(destinationList.size() >= prevGroupListSize ))
- {
- addGroupSeperator = true;
- }
- copyList( (*groupIter)->controls(), destinationList, addGroupSeperator );
- ++groupIter;
-
- prevGroupListSize = destinationList.size();
- }
- }
- destinationList.push_back(*containees);
- ++containees;
- }
- else
- {
- if ( groupIter != groupEnd )
- {
- if ( !(destinationList.size() > prevGroupListSize ))
- {
- addGroupSeperator = true;
- }
- copyList( (*groupIter)->controls(), destinationList, addGroupSeperator );
- ++groupIter;
- prevGroupListSize = destinationList.size();
- }
- }
- }
- }
- else
- {
- destinationList = sourceList;
- }
- return destinationList;
-
-}
-
-
-void RBGroupManager::addSeperator( std::vector< OCX_Control* >& dest )
-{
- OCX_Control* seperator = new OCX_CommandButton;
- seperator->SetInDialog(true);
- seperator->sName = C2S("GroupSeperator");
- dest.push_back( seperator );
-}
-
-void RBGroupManager::copyList( std::vector< OCX_Control* >& src,
- std::vector< OCX_Control* >& dest,
- bool addGroupSeperator )
-{
- if ( addGroupSeperator )
- {
- addSeperator( dest );
- }
-
- for ( CtrlIterator rbIter = src.begin(); rbIter != src.end(); ++rbIter )
- {
- dest.push_back( *rbIter );
- }
-}
-
-class OCX_UserFormLabel : public OCX_Label
-{
-public:
- OCX_UserFormLabel(OCX_Control* pParent ) : OCX_Label( pParent )
- {
- mnForeColor = 0x80000012L;
- mnBackColor = 0x8000000FL;
- }
-};
-
-
-sal_uInt16 OCX_Control::nStandardId(0x0200);
-sal_uInt16 OCX_FontData::nStandardId(0x0200);
-
-sal_uInt32 OCX_Control::pColor[25] = {
-0xC0C0C0, 0x008080, 0x000080, 0x808080, 0xC0C0C0, 0xFFFFFF, 0x000000,
-0x000000, 0x000000, 0xFFFFFF, 0xC0C0C0, 0xC0C0C0, 0x808080, 0x000080,
-0xFFFFFF, 0xC0C0C0, 0x808080, 0x808080, 0x000000, 0xC0C0C0, 0xFFFFFF,
-0x000000, 0xC0C0C0, 0x000000, 0xFFFFC0 };
-
-void OCX_Control::FillSystemColors()
-{
- // overwrite the predefined colors with available system colors
- const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
-
- pColor[ 0x00 ] = rSett.GetFaceColor().GetColor();
- pColor[ 0x01 ] = rSett.GetWorkspaceColor().GetColor();
- pColor[ 0x02 ] = rSett.GetActiveColor().GetColor();
- pColor[ 0x03 ] = rSett.GetDeactiveColor().GetColor();
- pColor[ 0x04 ] = rSett.GetMenuBarColor().GetColor();
- pColor[ 0x05 ] = rSett.GetWindowColor().GetColor();
- pColor[ 0x07 ] = rSett.GetMenuTextColor().GetColor();
- pColor[ 0x08 ] = rSett.GetWindowTextColor().GetColor();
- pColor[ 0x09 ] = rSett.GetActiveTextColor().GetColor();
- pColor[ 0x0A ] = rSett.GetActiveBorderColor().GetColor();
- pColor[ 0x0B ] = rSett.GetDeactiveBorderColor().GetColor();
- pColor[ 0x0C ] = rSett.GetWorkspaceColor().GetColor();
- pColor[ 0x0D ] = rSett.GetHighlightColor().GetColor();
- pColor[ 0x0E ] = rSett.GetHighlightTextColor().GetColor();
- pColor[ 0x0F ] = rSett.GetFaceColor().GetColor();
- pColor[ 0x10 ] = rSett.GetShadowColor().GetColor();
- pColor[ 0x12 ] = rSett.GetButtonTextColor().GetColor();
- pColor[ 0x13 ] = rSett.GetDeactiveTextColor().GetColor();
- pColor[ 0x14 ] = rSett.GetHighlightColor().GetColor();
- pColor[ 0x15 ] = rSett.GetDarkShadowColor().GetColor();
- pColor[ 0x16 ] = rSett.GetShadowColor().GetColor();
- pColor[ 0x17 ] = rSett.GetHelpTextColor().GetColor();
- pColor[ 0x18 ] = rSett.GetHelpColor().GetColor();
-}
-
-sal_uInt32 OCX_Control::ImportColor(sal_uInt32 nColor) const
-{
- sal_uInt8 nUpper = (sal_uInt8)( nColor >> 24 );
- if (nUpper & 0x80) //Palette color, should be switch on bottom 24 bits
- {
- /*Might as well use my systems ones in the absence of any other ideas*/
- nColor = nColor&0x00FFFFFF;
- DBG_ASSERT (nColor <= 24,"Unknown Palette Index");
- if (nColor > 24)
- nColor = 0xFFFFFF;
- else
- nColor = pColor[nColor];
- }
- else
- {
- //Stored in bgr! rather than rgb
- nColor = SwapColor(nColor);
- }
- return nColor;
-}
-
-sal_Int16 OCX_FontData::ImportAlign(sal_uInt8 _nJustification) const
-{
- sal_Int16 nRet;
- switch (_nJustification)
- {
- default:
- case 1:
- nRet = 0;
- break;
- case 2:
- nRet = 2;
- break;
- case 3:
- nRet = 1;
- break;
- }
- return nRet;
-}
-
-sal_uInt8 OCX_FontData::ExportAlign(sal_Int16 nAlign) const
-{
- sal_Int8 nRet;
- switch (nAlign)
- {
- default:
- case 0:
- nRet = 1;
- break;
- case 2:
- nRet = 2;
- break;
- case 1:
- nRet = 3;
- break;
- }
- return nRet;
-}
-
-sal_uInt32 OCX_Control::SwapColor(sal_uInt32 nColor) const
-{
- sal_uInt8
- r(static_cast<sal_uInt8>(nColor&0xFF)),
- g(static_cast<sal_uInt8>(((nColor)>>8)&0xFF)),
- b(static_cast<sal_uInt8>((nColor>>16)&0xFF));
- nColor = (r<<16) + (g<<8) + b;
- return nColor;
-}
-
-sal_uInt32 OCX_Control::ExportColor(sal_uInt32 nColor) const
-{
- sal_uInt8 nUpper = (sal_uInt8)( nColor >> 24 );
- if (nUpper & 0x80) //Palette color, should be switch on bottom 24 bits
- {
- /*Might as well use my systems ones in the absence of any other ideas*/
- nColor = nColor&0x00FFFFFF;
- DBG_ASSERT (nColor <= 24,"Unknown Palette Index");
- if (nColor > 24)
- nColor = 0xFFFFFF;
- else
- nColor = pColor[nColor];
- }
-
- //Stored in bgr! rather than rgb
- nColor = SwapColor(nColor);
- return nColor;
-}
-
-sal_Bool OCX_Control::Import(
- const uno::Reference< lang::XMultiServiceFactory > &rServiceFactory,
- uno::Reference< form::XFormComponent > &rFComp, awt::Size &rSz)
-{
-
- if(msFormType.getLength() == 0)
- return sal_False;
-
- rSz.Width = nWidth;
- rSz.Height = nHeight;
-
- uno::Reference<uno::XInterface> xCreate =
- rServiceFactory->createInstance(msFormType);
- if (!xCreate.is())
- return sal_False;
-
- rFComp = uno::Reference<form::XFormComponent>(xCreate,uno::UNO_QUERY);
- if (!rFComp.is())
- return sal_False;
- uno::Reference<beans::XPropertySet> xPropSet(xCreate,uno::UNO_QUERY);
- if (!xPropSet.is())
- return sal_False;
- return Import(xPropSet);
-}
-
-sal_Bool OCX_Control::Import(uno::Reference<container::XNameContainer> &rDialog
- )
-{
- uno::Reference<lang::XMultiServiceFactory>
- xFactory(rDialog, uno::UNO_QUERY);
-
- uno::Reference<uno::XInterface> xCreate =
- xFactory->createInstance(msDialogType);
- if (!xCreate.is())
- return sal_False;
-
- uno::Reference<awt::XControlModel> xModel(xCreate, uno::UNO_QUERY);
- if (!xModel.is())
- return sal_False;
-
- /* #147900# sometimes insertion of a control fails due to existing name,
- do not break entire form import then... */
- try
- {
- rDialog->insertByName(sName, uno::makeAny(xModel));
- }
- catch( uno::Exception& )
- {
- DBG_ERRORFILE(
- ByteString( "OCX_Control::Import - cannot insert control \"" ).
- Append( ByteString( sName, RTL_TEXTENCODING_UTF8 ) ).
- Append( '"' ).GetBuffer() );
- }
-
- uno::Reference<beans::XPropertySet> xPropSet(xCreate, uno::UNO_QUERY);
- if (!xPropSet.is())
- return sal_False;
-
- if (!Import(xPropSet))
- return sal_False;
-
- uno::Any aTmp;
- aTmp <<= sal_Int32((mnLeft * 2) / 100);
- xPropSet->setPropertyValue(WW8_ASCII2STR("PositionX"), aTmp);
- aTmp <<= sal_Int32((mnTop * 2) / 100);
- xPropSet->setPropertyValue(WW8_ASCII2STR("PositionY"), aTmp);
- aTmp <<= sal_Int32((nWidth * 2) / 100);
- xPropSet->setPropertyValue(WW8_ASCII2STR("Width"), aTmp);
- aTmp <<= sal_Int32((nHeight * 2) / 100);
- xPropSet->setPropertyValue(WW8_ASCII2STR("Height"), aTmp);
- if ( msToolTip.Len() > 0 )
- xPropSet->setPropertyValue(WW8_ASCII2STR("HelpText"), uno::Any(OUString(msToolTip)));
-
- if ( mnStep )
- {
- aTmp <<= mnStep;
- xPropSet->setPropertyValue(WW8_ASCII2STR("Step"), aTmp);
- }
-
- try
- {
- xPropSet->setPropertyValue(WW8_ASCII2STR("EnableVisible"), uno::makeAny( mbVisible ) );
- }
- catch( uno::Exception& )
- {
- }
- return sal_True;
-}
-
-sal_Int16 OCX_Control::ImportBorder(sal_uInt16 nSpecialEffect,
- sal_uInt16 nBorderStyle) const
-{
- if ((nSpecialEffect == 0) && (nBorderStyle == 0))
- return 0; //No Border
- else if ((nSpecialEffect == 0) && (nBorderStyle == 1))
- return 2; //Flat Border
- return 1; //3D Border
-}
-
-sal_uInt8 OCX_Control::ExportBorder(sal_uInt16 nBorder,sal_uInt8 &rBorderStyle)
- const
-{
- sal_uInt8 nRet;
- switch(nBorder)
- {
- case 0:
- nRet = rBorderStyle = 0;
- break;
- default:
- case 1:
- nRet = 2;
- rBorderStyle = 0;
- break;
- case 2:
- nRet = 0;
- rBorderStyle = 1;
- break;
- }
- return nRet;
-}
-
-sal_Int16 OCX_Control::ImportSpecEffect( sal_uInt8 nSpecialEffect ) const
-{
- return (nSpecialEffect == 0) ? 2 : 1;
-}
-
-sal_uInt8 OCX_Control::ExportSpecEffect( sal_Int16 nApiEffect ) const
-{
- return (nApiEffect == 2) ? 0 : 2;
-}
-
-sal_Bool OCX_Control::ReadFontData(SvStorageStream *pS)
-{
- return aFontData.Read(pS);
-}
-
-
-const uno::Reference< drawing::XDrawPage >&
- SvxMSConvertOCXControls::GetDrawPage()
-{
- if( !xDrawPage.is() && pDocSh )
- {
- uno::Reference< drawing::XDrawPageSupplier > xTxtDoc(pDocSh->GetModel(),
- uno::UNO_QUERY);
- DBG_ASSERT(xTxtDoc.is(),"XDrawPageSupplier nicht vom XModel erhalten");
- xDrawPage = xTxtDoc->getDrawPage();
- DBG_ASSERT( xDrawPage.is(), "XDrawPage nicht erhalten" );
- }
-
- return xDrawPage;
-}
-
-
-const uno::Reference< lang::XMultiServiceFactory >&
- SvxMSConvertOCXControls::GetServiceFactory()
-{
- if( !xServiceFactory.is() && pDocSh )
- {
- xServiceFactory = uno::Reference< lang::XMultiServiceFactory >
- (pDocSh->GetBaseModel(), uno::UNO_QUERY);
- DBG_ASSERT( xServiceFactory.is(),
- "XMultiServiceFactory nicht vom Model erhalten" );
- }
-
- return xServiceFactory;
-}
-
-const uno::Reference< drawing::XShapes >& SvxMSConvertOCXControls::GetShapes()
-{
- if( !xShapes.is() )
- {
- GetDrawPage();
- if( xDrawPage.is() )
- {
-
- xShapes = uno::Reference< drawing::XShapes >(xDrawPage,
- uno::UNO_QUERY);
- DBG_ASSERT( xShapes.is(), "XShapes nicht vom XDrawPage erhalten" );
- }
- }
- return xShapes;
-}
-
-const uno::Reference< container::XIndexContainer >&
- SvxMSConvertOCXControls::GetFormComps()
-{
- if( !xFormComps.is() )
- {
- GetDrawPage();
- if( xDrawPage.is() )
- {
- uno::Reference< form::XFormsSupplier > xFormsSupplier( xDrawPage,
- uno::UNO_QUERY );
- DBG_ASSERT( xFormsSupplier.is(),
- "XFormsSupplier nicht vom XDrawPage erhalten" );
-
- uno::Reference< container::XNameContainer > xNameCont =
- xFormsSupplier->getForms();
-
- // Das Formular bekommt einen Namen wie "WW-Standard[n]" und
- // wird in jedem Fall neu angelegt.
- UniString sName( sWW8_form, RTL_TEXTENCODING_MS_1252 );
- sal_uInt16 n = 0;
-
- while( xNameCont->hasByName( sName ) )
- {
- sName.AssignAscii( sWW8_form );
- sName += String::CreateFromInt32( ++n );
- }
-
- const uno::Reference< lang::XMultiServiceFactory > &rServiceFactory
- = GetServiceFactory();
- if( !rServiceFactory.is() )
- return xFormComps;
-
- uno::Reference< uno::XInterface > xCreate =
- rServiceFactory->createInstance(WW8_ASCII2STR(
- "com.sun.star.form.component.Form"));
- if( xCreate.is() )
- {
- uno::Reference< beans::XPropertySet > xFormPropSet( xCreate,
- uno::UNO_QUERY );
-
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- xFormPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- uno::Reference< form::XForm > xForm( xCreate, uno::UNO_QUERY );
- DBG_ASSERT(xForm.is(), "keine Form?");
-
- uno::Reference< container::XIndexContainer > xForms( xNameCont,
- uno::UNO_QUERY );
- DBG_ASSERT( xForms.is(), "XForms nicht erhalten" );
-
- aTmp.setValue( &xForm,
- ::getCppuType((uno::Reference < form::XForm >*)0));
- xForms->insertByIndex( xForms->getCount(), aTmp );
-
- xFormComps = uno::Reference< container::XIndexContainer >
- (xCreate, uno::UNO_QUERY);
- }
- }
- }
-
- return xFormComps;
-}
-
-sal_Bool OCX_CommandButton::Import( com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- // fake transparent push button by setting window background color
- if( !fBackStyle )
- mnBackColor = 0x80000005;
- aTmp <<= ImportColor(mnBackColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- sal_Bool bTemp;
- if ((!(fEnabled)) || (fLocked))
- bTemp = sal_False;
- else
- bTemp = sal_True;
- aTmp = bool2any(bTemp);
-
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- bTemp = fWordWrap != 0;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
-
- if (pCaption)
- {
- aTmp <<= lclCreateOUString( pCaption, nCaptionLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Label"), aTmp);
- }
-
- aTmp = bool2any( mbTakeFocus );
- rPropSet->setPropertyValue( WW8_ASCII2STR( "FocusOnClick" ), aTmp );
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_GroupBox::Export(SvStorageRef& /* rObj */,
- const uno::Reference< beans::XPropertySet >& /* rPropSet */,
- const awt::Size& /* rSize */ )
-{
- sal_Bool bRet=sal_True;
- return bRet;
-}
-
-sal_Bool OCX_GroupBox::WriteContents(SvStorageStreamRef& /* rObj */,
- const uno::Reference< beans::XPropertySet >& /* rPropSet */,
- const awt::Size& /* rSize */)
-{
- sal_Bool bRet=sal_True;
- return bRet;
-}
-
-sal_Bool OCX_CommandButton::WriteContents(SvStorageStreamRef& rContents,
- const uno::Reference< beans::XPropertySet >& rPropSet,
- const awt::Size& rSize )
-{
- sal_Bool bRet=sal_True;
-
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(8);
-
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- sal_uInt8 nTemp=0;//fEnabled;
- if (fEnabled)
- nTemp |= 0x02;
- if (fBackStyle)
- nTemp |= 0x08;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
-
- nTemp = 0;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("MultiLine"));
- fWordWrap = any2bool(aTmp);
- if (fWordWrap)
- nTemp |= 0x80;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
-
- SvxOcxString aCaption( rPropSet->getPropertyValue(WW8_ASCII2STR("Label")) );
- aCaption.WriteLenField( *rContents );
- aCaption.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
-
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- // "take focus on click" is directly in content flags, not in option field...
- mbTakeFocus = any2bool( rPropSet->getPropertyValue( WW8_ASCII2STR( "FocusOnClick" ) ) );
-
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- sal_uInt8 nTmp = 0x27;
- if (aCaption.HasData())
- nTmp |= 0x08;
- *rContents << nTmp;
- nTmp = 0x00;
- if( !mbTakeFocus ) // flag is set, if option is off
- nTmp |= 0x02;
- *rContents << nTmp;
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
-
- DBG_ASSERT((rContents.Is() && (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-
-sal_Bool OCX_CommandButton::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x32, 0x05, 0xD7,
- 0x69, 0xCE, 0xCD, 0x11, 0xA7, 0x77, 0x00, 0xDD,
- 0x01, 0x14, 0x3C, 0x57, 0x22, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6d, 0x73, 0x20,
- 0x32, 0x2e, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
- 0x61, 0x6E, 0x64, 0x42, 0x75, 0x74, 0x74, 0x6F,
- 0x6E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
- 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
- 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x16, 0x00,
- 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
- 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x42,
- 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00,
- 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x43, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x6D, 0x00,
- 0x61, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x42, 0x00,
- 0x75, 0x00, 0x74, 0x00, 0x74, 0x00, 0x6F, 0x00,
- 0x6E, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
-
- return WriteContents(xContents,rPropSet,rSize);
-}
-
-sal_Bool OCX_ImageButton::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
-
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(8);
-
- uno::Any aTmp=rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- sal_uInt8 nTemp=0;//fEnabled;
- if (fEnabled)
- nTemp |= 0x02;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
-
- WriteAlign(rContents,4);
-
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- sal_uInt8 nTmp = 0x26;
- *rContents << nTmp;
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
-
- DBG_ASSERT((rContents.Is() && (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-
-sal_Bool OCX_ImageButton::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x32, 0x05, 0xD7,
- 0x69, 0xCE, 0xCD, 0x11, 0xA7, 0x77, 0x00, 0xDD,
- 0x01, 0x14, 0x3C, 0x57, 0x22, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6d, 0x73, 0x20,
- 0x32, 0x2e, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
- 0x61, 0x6E, 0x64, 0x42, 0x75, 0x74, 0x74, 0x6F,
- 0x6E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
- 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
- 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x16, 0x00,
- 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
- 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x42,
- 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00,
- 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x43, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x6D, 0x00,
- 0x61, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x42, 0x00,
- 0x75, 0x00, 0x74, 0x00, 0x74, 0x00, 0x6F, 0x00,
- 0x6E, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents,rPropSet,rSize);
-}
-
-
-sal_Bool OCX_OptionButton::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- // background color: fBackStyle==0 -> transparent
- if( fBackStyle )
- aTmp <<= ImportColor(mnBackColor);
- else
- aTmp = uno::Any();
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- sal_Bool bTemp;
- if ((!(fEnabled)) || (fLocked))
- bTemp = sal_False;
- else
- bTemp = sal_True;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- bTemp = fWordWrap != 0;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- aTmp <<= ImportSpecEffect( nSpecialEffect );
- rPropSet->setPropertyValue( WW8_ASCII2STR("VisualEffect"), aTmp);
-
- if (pValue && !bSetInDialog)
- {
- INT16 nTmp = pValue[0]-0x30;
- aTmp <<= nTmp;
- rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultState"), aTmp);
- }
-
- if (pCaption)
- {
- aTmp <<= lclCreateOUString( pCaption, nCaptionLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Label"), aTmp);
- }
-
- // #i40279# always centered vertically
- aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
- rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_OptionButton::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
-
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- else
- fBackStyle = 0;
-
- sal_uInt8 nTemp=0;//=fEnabled;
- if (fEnabled)
- nTemp |= 0x02;
- if (fBackStyle)
- nTemp |= 0x08;
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x00);
- nTemp = 0;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("MultiLine"));
- fWordWrap = any2bool(aTmp);
- if (fWordWrap)
- nTemp |= 0x80;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
-
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- nStyle = 5;
- *rContents << nStyle;
- pBlockFlags[0] |= 0x40;
-
- WriteAlign(rContents,4);
- nValueLen = 1|SVX_MSOCX_COMPRESSED;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("DefaultState"));
- sal_Int16 nDefault = sal_Int16();
- aTmp >>= nDefault;
- *rContents << nValueLen;
- pBlockFlags[2] |= 0x40;
-
-
- SvxOcxString aCaption( rPropSet->getPropertyValue(WW8_ASCII2STR("Label")) );
- if (aCaption.HasData())
- pBlockFlags[2] |= 0x80;
- aCaption.WriteLenField( *rContents );
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("VisualEffect"));
- if (aTmp.hasValue())
- {
- sal_Int16 nApiSpecEffect = sal_Int16();
- aTmp >>= nApiSpecEffect;
- nSpecialEffect = ExportSpecEffect( nApiSpecEffect );
- }
- *rContents << nSpecialEffect;
- pBlockFlags[3] |= 0x04;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- nDefault += 0x30;
- *rContents << sal_uInt8(nDefault);
- *rContents << sal_uInt8(0x00);
-
- aCaption.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-
-sal_Bool OCX_OptionButton::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x4F, 0x70, 0x74, 0x69,
- 0x6F, 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62,
- 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62,
- 0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00,
- 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x4F,
- 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x42, 0x75, 0x74,
- 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39,
- 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x4F, 0x00, 0x70, 0x00, 0x74, 0x00, 0x69, 0x00,
- 0x6F, 0x00, 0x6E, 0x00, 0x42, 0x00, 0x75, 0x00,
- 0x74, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x6E, 0x00,
- 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-
-sal_Bool OCX_TextBox::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- aTmp = bool2any( fEnabled != 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- aTmp = bool2any( fLocked != 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp);
-
- aTmp = bool2any( fHideSelection != 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR( "HideInactiveSelection" ), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- aTmp <<= ImportColor(mnBackColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
-
- aTmp <<= ImportColor( nBorderColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
-
- aTmp = bool2any( fMultiLine != 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
-
- sal_uInt16 nTmp = static_cast<sal_uInt16>(nMaxLength);
- aTmp <<= nTmp;
- rPropSet->setPropertyValue( WW8_ASCII2STR("MaxTextLen"), aTmp);
-
-
- sal_Bool bTemp1,bTemp2;
- uno::Any aBarsH,aBarsV;
- switch(nScrollBars)
- {
- case 1:
- bTemp1 = sal_True;
- bTemp2 = sal_False;
- break;
- case 2:
- bTemp1 = sal_False;
- bTemp2 = sal_True;
- break;
- case 3:
- bTemp1 = sal_True;
- bTemp2 = sal_True;
- break;
- case 0:
- default:
- bTemp1 = sal_False;
- bTemp2 = sal_False;
- break;
- }
-
- aBarsH = bool2any(bTemp1);
- aBarsV = bool2any(bTemp2);
- rPropSet->setPropertyValue( WW8_ASCII2STR("HScroll"), aBarsH);
- rPropSet->setPropertyValue( WW8_ASCII2STR("VScroll"), aBarsV);
-
- nTmp = nPasswordChar;
- aTmp <<= nTmp;
- rPropSet->setPropertyValue( WW8_ASCII2STR("EchoChar"), aTmp);
-
- if (pValue)
- {
- aTmp <<= lclCreateOUString( pValue, nValueLen );
- // DefaultText seems to no longer be in UnoEditControlModel
- if ( bSetInDialog )
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("Text"), aTmp);
- }
- else
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultText"), aTmp);
- }
- }
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_TextBox::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0x00;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
-
- sal_uInt8 nTemp=0x19;
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- if (fEnabled)
- nTemp |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("ReadOnly"));
- fLocked = any2bool(aTmp);
- if (fLocked)
- nTemp |= 0x04;
-
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x48);
- *rContents << sal_uInt8(0x80);
-
- fMultiLine = any2bool(rPropSet->getPropertyValue(WW8_ASCII2STR("MultiLine")));
- fHideSelection = any2bool(rPropSet->getPropertyValue(WW8_ASCII2STR("HideInactiveSelection")));
- nTemp = 0x0C;
- if (fMultiLine)
- nTemp |= 0x80;
- if( fHideSelection )
- nTemp |= 0x20;
- *rContents << nTemp;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- aTmp = rPropSet->getPropertyValue( WW8_ASCII2STR("MaxTextLen"));
- aTmp >>= nMaxLength;
- *rContents << nMaxLength;
- pBlockFlags[0] |= 0x08;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Border"));
- sal_Int16 nBorder = sal_Int16();
- aTmp >>= nBorder;
- nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
- *rContents << nBorderStyle;
- pBlockFlags[0] |= 0x10;
-
- aTmp = rPropSet->getPropertyValue( WW8_ASCII2STR("HScroll"));
- sal_Bool bTemp1 = any2bool(aTmp);
- aTmp = rPropSet->getPropertyValue( WW8_ASCII2STR("VScroll"));
- sal_Bool bTemp2 = any2bool(aTmp);
- if (!bTemp1 && !bTemp2)
- nScrollBars =0;
- else if (bTemp1 && bTemp2)
- nScrollBars = 3;
- else if (!bTemp1 && bTemp2)
- nScrollBars = 2;
- else
- nScrollBars = 1;
- *rContents << nScrollBars;
- pBlockFlags[0] |= 0x20;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("EchoChar"));
- sal_uInt16 nTmp = sal_uInt16();
- aTmp >>= nTmp;
- nPasswordChar = static_cast<sal_uInt8>(nTmp);
- *rContents << nPasswordChar;
- pBlockFlags[1] |= 0x02;
-
- SvxOcxString aValue( rPropSet->getPropertyValue(WW8_ASCII2STR("DefaultText")) );
- aValue.WriteLenField( *rContents );
- if (aValue.HasData())
- pBlockFlags[2] |= 0x40;
-
- WriteAlign(rContents,4);
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BorderColor"));
- if (aTmp.hasValue())
- aTmp >>= nBorderColor;
- *rContents << ExportColor(nBorderColor);
- pBlockFlags[3] |= 0x02;
-
- *rContents << nSpecialEffect;
- pBlockFlags[3] |= 0x04;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- aValue.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
-
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK == rContents->GetError())),"damn");
- return bRet;
-}
-
-
-sal_Bool OCX_TextBox::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74,
- 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
- 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
- 0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F,
- 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x54, 0x00, 0x65, 0x00, 0x78, 0x00, 0x74, 0x00,
- 0x42, 0x00, 0x6F, 0x00, 0x78, 0x00, 0x31, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_FieldControl::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0x00;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
-
- sal_uInt8 nTemp=0x19;
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- if (fEnabled)
- nTemp |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("ReadOnly"));
- fLocked = any2bool(aTmp);
- if (fLocked)
- nTemp |= 0x04;
-
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x48);
- *rContents << sal_uInt8(0x80);
-
- nTemp = 0x2C;
- *rContents << nTemp;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Border"));
- sal_Int16 nBorder = sal_Int16();
- aTmp >>= nBorder;
- nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
- *rContents << nBorderStyle;
- pBlockFlags[0] |= 0x10;
-
-#if 0 //Each control has a different Value format, and how to convert each to text has to be found out
- SvxOcxString aValue( rPropSet->getPropertyValue(WW8_ASCII2STR("DefaultText")) );
- aValue.WriteLenField( *rContents );
- if (aValue.HasData())
- pBlockFlags[2] |= 0x40;
-#endif
-
- *rContents << nSpecialEffect;
- pBlockFlags[3] |= 0x04;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
-#if 0
- aValue.WriteCharArray( *rContents );
-#endif
-
- WriteAlign(rContents,4);
-
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-sal_Bool OCX_FieldControl::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74,
- 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
- 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
- 0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F,
- 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x54, 0x00, 0x65, 0x00, 0x78, 0x00, 0x74, 0x00,
- 0x42, 0x00, 0x6F, 0x00, 0x78, 0x00, 0x31, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-
-
-sal_Bool OCX_ToggleButton::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- aTmp = bool2any(true);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Toggle"), aTmp );
-
- sal_Bool bTemp;
- if ((!(fEnabled)) || (fLocked))
- bTemp = sal_False;
- else
- bTemp = sal_True;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- bTemp = fWordWrap != 0;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- // fake transparent toggle button by setting window background color
- if( !fBackStyle )
- mnBackColor = 0x80000005;
- aTmp <<= ImportColor(mnBackColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- if (pValue)
- {
- INT16 nTmp=pValue[0]-0x30;
- aTmp <<= nTmp;
- rPropSet->setPropertyValue( WW8_ASCII2STR("State"), aTmp);
- }
-
- if (pCaption)
- {
- aTmp <<= lclCreateOUString( pCaption, nCaptionLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Label"), aTmp);
- }
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_ToggleButton::Export(
- SvStorageRef &rObj, const uno::Reference< beans::XPropertySet> &rPropSet,
- const awt::Size& rSize )
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x54, 0x6F, 0x67, 0x67,
- 0x6C, 0x65, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62,
- 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62,
- 0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00,
- 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x54,
- 0x6F, 0x67, 0x67, 0x6C, 0x65, 0x42, 0x75, 0x74,
- 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39,
- 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x54, 0x00, 0x6F, 0x00, 0x67, 0x00, 0x67, 0x00,
- 0x6C, 0x00, 0x65, 0x00, 0x42, 0x00, 0x75, 0x00,
- 0x74, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x6E, 0x00,
- 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
-
- return WriteContents(xContents,rPropSet,rSize);
-}
-
-sal_Bool OCX_ToggleButton::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
-
- sal_uInt8 nTemp=fEnabled;
- if (fEnabled)
- nTemp = nTemp << 1;
- if (fBackStyle)
- nTemp |= 0x08;
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x00);
- nTemp = 0;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("MultiLine"));
- fWordWrap = any2bool(aTmp);
- if (fWordWrap)
- nTemp |= 0x80;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- nStyle = 6;
- *rContents << nStyle;
- pBlockFlags[0] |= 0x40;
-
- WriteAlign(rContents,4);
- nValueLen = 1|SVX_MSOCX_COMPRESSED;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("State"));
- sal_Int16 nDefault = sal_Int16();
- aTmp >>= nDefault;
- *rContents << nValueLen;
- pBlockFlags[2] |= 0x40;
-
- SvxOcxString aCaption( rPropSet->getPropertyValue(WW8_ASCII2STR("Label")) );
- aCaption.WriteLenField( *rContents );
- if (aCaption.HasData())
- pBlockFlags[2] |= 0x80;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- nDefault += 0x30;
- *rContents << sal_uInt8(nDefault);
- *rContents << sal_uInt8(0x00);
-
- aCaption.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
- bRet = aFontData.Export(rContents,rPropSet);
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-sal_Bool OCX_Label::Import(uno::Reference< beans::XPropertySet > &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- sal_Bool bTemp;
- if ((!(fEnabled)) || (fLocked))
- bTemp = sal_False;
- else
- bTemp = sal_True;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- // background color: fBackStyle==0 -> transparent
- if( fBackStyle )
- {
- aTmp <<= ImportColor(mnBackColor);
- }
- else
- {
- // try fake transparent by using parents backColor
- if ( bSetInDialog && mpParent != NULL )
- {
- aTmp <<= ImportColor( mpParent->mnBackColor );
- }
- else
- {
- aTmp = uno::Any(); // use SO default
- }
- }
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
-
- aTmp <<= ImportColor( nBorderColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
-
- bTemp=fWordWrap;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
-
- if (pCaption)
- {
- aTmp <<= lclCreateOUString( pCaption, nCaptionLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Label"), aTmp);
- }
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_ComboBox::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
-
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- aTmp = bool2any(fEnabled != 0);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- aTmp = bool2any(fLocked != 0);
- rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp);
-
- aTmp = bool2any( nDropButtonStyle != 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Dropdown"), aTmp);
-
- aTmp = bool2any( fHideSelection != 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR( "HideInactiveSelection" ), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- if (pValue)
- {
- aTmp <<= lclCreateOUString( pValue, nValueLen );
- if ( bSetInDialog )
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("Text"), aTmp);
- }
- else
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultText"), aTmp);
- }
- }
-
- aTmp <<= ImportColor(mnBackColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
-
- aTmp <<= ImportColor( nBorderColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
-
- sal_Int16 nTmp=static_cast<sal_Int16>(nMaxLength);
- aTmp <<= nTmp;
- rPropSet->setPropertyValue( WW8_ASCII2STR("MaxTextLen"), aTmp);
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_ComboBox::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0x00;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
-
- sal_uInt8 nTemp=0x19;//fEnabled;
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- if (fEnabled)
- nTemp |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("ReadOnly"));
- fLocked = any2bool(aTmp);
- if (fLocked)
- nTemp |= 0x04;
-
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x48);
- *rContents << sal_uInt8(0x80);
-
- nTemp = 0x0C;
- fHideSelection = any2bool(rPropSet->getPropertyValue(WW8_ASCII2STR("HideInactiveSelection")));
- if( fHideSelection )
- nTemp |= 0x20;
- *rContents << nTemp;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Border"));
- sal_Int16 nBorder = sal_Int16();
- aTmp >>= nBorder;
- nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
- *rContents << nBorderStyle;
- pBlockFlags[0] |= 0x10;
-
- nStyle = 3;
- *rContents << nStyle;
- pBlockFlags[0] |= 0x40;
-
- WriteAlign(rContents,2);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("LineCount"));
- aTmp >>= nListRows;
- *rContents << nListRows;
- pBlockFlags[1] |= 0x40;
-
- *rContents << sal_uInt8(1); //DefaultSelected One
- pBlockFlags[2] |= 0x01;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Dropdown"));
- nDropButtonStyle = any2bool(aTmp);
- if (nDropButtonStyle)
- nDropButtonStyle=0x02;
- *rContents << nDropButtonStyle;
- pBlockFlags[2] |= 0x04;
-
- SvxOcxString aValue( rPropSet->getPropertyValue(WW8_ASCII2STR("Text")) );
- aValue.WriteLenField( *rContents );
- if (aValue.HasData())
- pBlockFlags[2] |= 0x40;
-
- WriteAlign(rContents,4);
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BorderColor"));
- if (aTmp.hasValue())
- aTmp >>= nBorderColor;
- *rContents << ExportColor(nBorderColor);
- pBlockFlags[3] |= 0x02;
-
- *rContents << nSpecialEffect;
- pBlockFlags[3] |= 0x04;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- aValue.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
-
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-sal_Bool OCX_ComboBox::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x30, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x1D, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x62,
- 0x6F, 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65,
- 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74,
- 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72,
- 0x6D, 0x73, 0x2E, 0x43, 0x6F, 0x6D, 0x62, 0x6F,
- 0x42, 0x6F, 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39,
- 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x43, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x62, 0x00,
- 0x6F, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x78, 0x00,
- 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-
-
-sal_Bool OCX_ListBox::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
-
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- sal_Bool bTmp=fEnabled;
- aTmp = bool2any(bTmp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- bTmp=fLocked;
- aTmp = bool2any(bTmp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- sal_Bool bTemp = nMultiState;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiSelection"), aTmp);
-
-#if 0 //Don't delete this for now until I figure out if I can make this
- if (pValue)
- {
- aTmp <<= lclCreateOUString( pValue, nValueLen );
- xPropSet->setPropertyValue( WW8_ASCII2STR("DefaultText"), aTmp);
- }
-#endif
-
- aTmp <<= ImportColor(mnBackColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
-
- aTmp <<= ImportColor( nBorderColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
-
- aFontData.Import(rPropSet);
- return sal_True;
-}
-
-sal_Bool OCX_ListBox::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0x01;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- sal_uInt8 nTemp=fEnabled;
- if (fEnabled)
- nTemp = nTemp << 1;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("ReadOnly"));
- fLocked = any2bool(aTmp);
- if (fLocked)
- nTemp |= 0x04;
-
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Border"));
- sal_Int16 nBorder = sal_Int16();
- aTmp >>= nBorder;
- nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
- WriteAlign(rContents,2);
- *rContents << nBorderStyle;
- pBlockFlags[0] |= 0x10;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("MultiSelection"));
- nMultiState = any2bool(aTmp);
-
- if (nMultiState)
- {
- *rContents << nMultiState;
- pBlockFlags[0] |= 0x20;
- }
-
- nStyle = 2;
- *rContents << nStyle;
- pBlockFlags[0] |= 0x40;
-
-
- WriteAlign(rContents,4);
-
-#if 0
- SvxOcxString aValue( rPropSet->getPropertyValue(WW8_ASCII2STR("DefaultText")) );
- aValue.WriteLenField( *rContents );
- if (aValue.HasData())
- pBlockFlags[2] |= 0x40;
-
- WriteAlign(rContents,4);
-#endif
-
- WriteAlign(rContents,4);
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BorderColor"));
- if (aTmp.hasValue())
- aTmp >>= nBorderColor;
- *rContents << ExportColor(nBorderColor);
- pBlockFlags[3] |= 0x02;
-
- *rContents << nSpecialEffect;
- pBlockFlags[3] |= 0x04;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
-#if 0
- aValue.WriteCharArray( *rContents );
-#endif
-
- WriteAlign(rContents,4);
-
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-sal_Bool OCX_ListBox::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x4C, 0x69, 0x73, 0x74,
- 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
- 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
- 0x73, 0x2E, 0x4C, 0x69, 0x73, 0x74, 0x42, 0x6F,
- 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x4C, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74, 0x00,
- 0x42, 0x00, 0x6F, 0x00, 0x78, 0x00, 0x31, 0x00,
- 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_Control::Read(SvStorageStream *pS)
-{
- sal_uInt16 nIdentifier, nFixedAreaLen;
- *pS >> nIdentifier;
- DBG_ASSERT(nStandardId==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->SeekRel(nFixedAreaLen);
- return true;
-}
-
-sal_Bool OCX_ModernControl::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(nIdentifier==nStandardId,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,8);
-
- if (pBlockFlags[0] & 0x01)
- {
- sal_uInt8 nTemp;
- *pS >> nTemp;
-
- fEnabled = (nTemp & 0x02) >> 1;
- fLocked = (nTemp & 0x04) >> 2;
- fBackStyle = (nTemp & 0x08) >> 3;
-
- *pS >> nTemp;
-
- fColumnHeads = (nTemp & 0x04) >> 2;
- fIntegralHeight = (nTemp & 0x08) >> 3;
- fMatchRequired = (nTemp & 0x10) >> 4;
- fAlignment = (nTemp & 0x20) >> 5;
-
- *pS >> nTemp;
-
- fDragBehaviour = (nTemp & 0x08) >> 3;
- fEnterKeyBehaviour = (nTemp & 0x10) >> 4;
- fEnterFieldBehaviour = (nTemp & 0x20) >> 5;
- fTabKeyBehaviour = (nTemp & 0x40) >> 6;
- fWordWrap = (nTemp & 0x80) >> 7;
-
- *pS >> nTemp;
- fSelectionMargin = (nTemp & 0x04) >> 2;
- fAutoWordSelect = (nTemp & 0x08) >> 3;
- fAutoSize = (nTemp & 0x10) >> 4;
- fHideSelection = (nTemp & 0x20) >> 5;
- fAutoTab = (nTemp & 0x40) >> 6;
- fMultiLine = (nTemp & 0x80) >> 7;
-
- }
-
- /*If any of these are set they follow eachother in this order one after
- another padded out to the next U32 boundary with 0's
- U8 can abut each other U16 must start on a U16 boundary and are padded to
- that with 0's. A standardish word alignment structure*/
-
- if (pBlockFlags[0] & 0x02)
- *pS >> mnBackColor;
- if (pBlockFlags[0] & 0x04)
- *pS >> mnForeColor;
- if (pBlockFlags[0] & 0x08)
- *pS >> nMaxLength;
-
- if (pBlockFlags[0] & 0x10)
- *pS >> nBorderStyle;
- if (pBlockFlags[0] & 0x20)
- *pS >> nScrollBars;
- if (pBlockFlags[0] & 0x40)
- *pS >> nStyle;// (UI 0 == Data 3, UI 2 = Data 7)
- if (pBlockFlags[0] & 0x80)
- *pS >> nMousePointer;
-
- if (pBlockFlags[1] & 0x02)
- *pS >> nPasswordChar; //HUH ??? always 0 ??? not sure maybe just padding
-
- if (pBlockFlags[1] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nListWidth;
- }
-
- if (pBlockFlags[1] & 0x08)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nBoundColumn;
- }
- if (pBlockFlags[1] & 0x10)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nTextColumn;
- }
- if (pBlockFlags[1] & 0x20)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nColumnCount;
- }
- if (pBlockFlags[1] & 0x40)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nListRows;
- }
- if (pBlockFlags[1] & 0x80)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nUnknown8; //something to do with ColumnWidths
- }
- if (pBlockFlags[2] & 0x01)
- *pS >> nMatchEntry;
- if (pBlockFlags[2] & 0x02)
- *pS >> nListStyle;
- if (pBlockFlags[2] & 0x04)
- *pS >> nShowDropButtonWhen;
- if (pBlockFlags[2] & 0x10)
- *pS >> nDropButtonStyle;
- if (pBlockFlags[2] & 0x20)
- *pS >> nMultiState;
-
- bool bValue = (pBlockFlags[2] & 0x40) != 0;
- if (bValue)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nValueLen;
- }
- bool bCaption = (pBlockFlags[2] & 0x80) != 0;
- if (bCaption)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nCaptionLen;
- }
- if (pBlockFlags[3] & 0x01)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nHorzPos;
- *pS >> nVertPos;
- }
- if (pBlockFlags[3] & 0x02)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nBorderColor;
- }
- if (pBlockFlags[3] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4); // NEW
- *pS >> nSpecialEffect;
- pS->SeekRel( 3 ); // special effect is 32bit, not 8bit
- }
- if (pBlockFlags[3] & 0x08)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nIcon;
- DBG_ASSERT(nIcon == 0xFFFF, "Unexpected nIcon");
- }
- if (pBlockFlags[3] & 0x10)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nPicture;
- DBG_ASSERT(nPicture == 0xFFFF, "Unexpected nIcon");
- }
- if (pBlockFlags[3] & 0x20)
- *pS >> nAccelerator;
- /*
- if (pBlockFlags[3] & 0x80)
- *pS >> nUnknown9;
- */
- bool bGroupName = (pBlockFlags[4] & 0x01) != 0;
- if (bGroupName)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nGroupNameLen;
- }
-
- //End
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nWidth;
- *pS >> nHeight;
-
- if (bValue)
- lclReadCharArray( *pS, pValue, nValueLen, pS->Tell() - nStart);
-
- if (bCaption)
- lclReadCharArray( *pS, pCaption, nCaptionLen, pS->Tell() - nStart);
-
- if (bGroupName)
- lclReadCharArray( *pS, pGroupName, nGroupNameLen, pS->Tell() - nStart);
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- if (nIcon)
- {
- pS->Read(pIconHeader,20);
- *pS >> nIconLen;
- pIcon = new sal_uInt8[nIconLen];
- pS->Read(pIcon,nIconLen);
- }
-
- if (nPicture)
- {
- pS->Read(pPictureHeader,20);
- *pS >> nPictureLen;
- pPicture = new sal_uInt8[nPictureLen];
- pS->Read(pPicture,nPictureLen);
- }
-
- return sal_True;
-}
-
-
-sal_Bool OCX_CommandButton::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(nStandardId==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,4);
-
-
- if (pBlockFlags[0] & 0x01)
- *pS >> mnForeColor;
- if (pBlockFlags[0] & 0x02)
- *pS >> mnBackColor;
-
- if (pBlockFlags[0] & 0x04)
- {
- sal_uInt8 nTemp;
- *pS >> nTemp;
- fEnabled = (nTemp&0x02)>>1;
- fLocked = (nTemp&0x04)>>2;
- fBackStyle = (nTemp&0x08)>>3;
- *pS >> nTemp;
- *pS >> nTemp;
- fWordWrap = (nTemp&0x80)>>7;
- *pS >> nTemp;
- fAutoSize = (nTemp&0x10)>>4;
- }
-
- bool bCaption = (pBlockFlags[0] & 0x08) != 0;
- if (bCaption)
- {
- *pS >> nCaptionLen;
- }
- if (pBlockFlags[0] & 0x10) /*Picture Position, a strange mechanism here*/
- {
- *pS >> nVertPos;
- *pS >> nHorzPos;
- }
-
- if (pBlockFlags[0] & 0x40) /*MousePointer*/
- *pS >> nMousePointer;
-
- if (pBlockFlags[0] & 0x80)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nPicture;
- }
-
- if (pBlockFlags[1] & 0x01)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nAccelerator;
- }
-
- // "take focus on click" is directly in content flags, not in option field...
- mbTakeFocus = (pBlockFlags[1] & 0x02) == 0; // option is on, if flag is not set
-
- if (pBlockFlags[1] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nIcon;
- }
-
- if (bCaption)
- lclReadCharArray( *pS, pCaption, nCaptionLen, pS->Tell() - nStart);
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nWidth;
- *pS >> nHeight;
-
- if (nIcon)
- {
- pS->Read(pIconHeader,20);
- *pS >> nIconLen;
- pIcon = new sal_uInt8[nIconLen];
- pS->Read(pIcon,nIconLen);
- }
-
- if (nPicture)
- {
- pS->Read(pPictureHeader,20);
- *pS >> nPictureLen;
- pPicture = new sal_uInt8[nPictureLen];
- pS->Read(pPicture,nPictureLen);
- }
-
- return sal_True;
-}
-
-sal_Bool OCX_Label::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(nStandardId==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,4);
-
-
- if (pBlockFlags[0] & 0x01)
- *pS >> mnForeColor;
- if (pBlockFlags[0] & 0x02)
- *pS >> mnBackColor;
-
-
- if (pBlockFlags[0] & 0x04)
- {
- sal_uInt8 nTemp;
- *pS >> nTemp;
- fEnabled = (nTemp&0x02)>>1;
- fLocked = (nTemp&0x04)>>2;
- fBackStyle = (nTemp&0x08)>>3;
- *pS >> nTemp;
- *pS >> nTemp;
- fWordWrap = (nTemp&0x80)>>7;
- *pS >> nTemp;
- fAutoSize = (nTemp&0x10)>>4;
- }
- bool bCaption = (pBlockFlags[0] & 0x08) != 0;
- if (bCaption)
- *pS >> nCaptionLen;
-
- if (pBlockFlags[0] & 0x10)
- {
- *pS >> nVertPos;
- *pS >> nHorzPos;
- }
-
- if (pBlockFlags[0] & 0x40)
- *pS >> nMousePointer;
-
- if (pBlockFlags[0] & 0x80)
- {
- ReadAlign(pS,pS->Tell() - nStart, 4);
- *pS >> nBorderColor;
- }
-
- if (pBlockFlags[1] & 0x01)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nBorderStyle;
- }
-
- if (pBlockFlags[1] & 0x02)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nSpecialEffect;
- }
-
- if (pBlockFlags[1] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nPicture;
- }
-
- if (pBlockFlags[1] & 0x08)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nAccelerator;
- }
-
- if (pBlockFlags[1] & 0x10)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nIcon;
- }
-
- if (bCaption)
- lclReadCharArray( *pS, pCaption, nCaptionLen, pS->Tell() - nStart);
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nWidth;
- *pS >> nHeight;
-
- if (nPicture)
- {
- pS->Read(pPictureHeader,20);
- *pS >> nPictureLen;
- pPicture = new sal_uInt8[nPictureLen];
- pS->Read(pPicture,nPictureLen);
- }
- if (nIcon)
- {
- pS->Read(pIconHeader,20);
- *pS >> nIconLen;
- pIcon = new sal_uInt8[nIconLen];
- pS->Read(pIcon,nIconLen);
- }
-
- return sal_True;
-}
-
-TypeName::TypeName(sal_Char *pName, sal_uInt32 nStoreId, sal_uInt32 nLen, sal_uInt16 nType, sal_Int32 nLeft,
- sal_Int32 nTop)
- : msName(lclCreateOUString(pName, nLen)), mnType(nType), mnLeft(nLeft),
- mnTop(nTop),mnStoreId(nStoreId)
-{
-}
-
-OCX_ContainerControl::OCX_ContainerControl( SotStorageRef& parent,
- const ::rtl::OUString& storageName,
- const ::rtl::OUString& sN,
- const uno::Reference< container::XNameContainer > &rParent,
- OCX_Control* pParent ) :
- OCX_Control(sN, pParent), rbGroupMgr( sName ), mxParent(rParent), nNoRecords(0), nTotalLen(0), containerType( STDCONTAINER )
-{
-
- mContainerStorage = parent->OpenSotStorage(storageName,
- STREAM_READWRITE |
- STREAM_NOCREATE |
- STREAM_SHARE_DENYALL);
- mContainerStream = mContainerStorage->OpenSotStream(
- String(RTL_CONSTASCII_STRINGPARAM("f"),
- RTL_TEXTENCODING_MS_1252),
- STREAM_STD_READ | STREAM_NOCREATE);
- mContainedControlsStream = mContainerStorage->OpenSotStream( String(RTL_CONSTASCII_STRINGPARAM("o"),
- RTL_TEXTENCODING_MS_1252),
- STREAM_STD_READ | STREAM_NOCREATE);
-}
-OCX_ContainerControl::~OCX_ContainerControl()
-{
- CtrlIterator aEnd = mpControls.end();
- for (CtrlIterator aIter = mpControls.begin(); aIter != aEnd; ++ aIter )
- {
- delete *aIter;
- }
-}
-
-// Really import should receive the parent e.g. a Userform, Frame or Multi Page
-// and call import on its containees with itself ( up-called from
-// the base class ) but... the reality is we have no containment model
-// so we make sure rPropSet is always the parent Dialog
-
-sal_Bool OCX_ContainerControl::Import(uno::Reference<beans::XPropertySet>& /* rProps */ )
-{
- if ( !mxParent.is() )
- {
- return sal_False;
- }
- CtrlIterator aEnd = mpControls.end();
-// int count = 0;
- for (CtrlIterator aIter = mpControls.begin(); aIter != aEnd; ++ aIter )
- {
- if ( !(*aIter)->Import( mxParent ) )
- {
- return sal_False;
- }
- }
- return sal_True;
-}
-
-OUString OCX_ContainerControl::createSubStreamName( const sal_uInt32& subStorageId )
-{
- static OUString sI = OUString::createFromAscii("i");
- static OUString sZero = OUString::createFromAscii( "0" );
- OUStringBuffer buf( 6 );
- buf.append( sI );
- // for subStorage id < 10 stream name has leading '0'
- // eg "i07"
- if ( subStorageId < 10 )
- {
- buf.append( sZero );
- }
- buf.append( OUString::valueOf( (sal_Int32)subStorageId ) );
- return buf.makeStringAndClear();
-}
-
-bool OCX_ContainerControl::createFromContainerRecord( const ContainerRecord& record, OCX_Control*& pControl )
-{
- pControl = NULL;
- switch ( record.nTypeIdent)
- {
- case CMDBUTTON:
- pControl = new OCX_CommandButton;
- break;
- case LABEL:
- pControl = new OCX_UserFormLabel(this);
- break;
- case TEXTBOX:
- pControl = new OCX_TextBox;
- break;
- case LISTBOX:
- pControl = new OCX_ListBox;
- break;
- case COMBOBOX:
- pControl = new OCX_ComboBox;
- break;
- case CHECKBOX:
- pControl = new OCX_CheckBox;
- break;
- case OPTIONBUTTON:
- pControl = new OCX_OptionButton;
- break;
- case TOGGLEBUTTON:
- pControl = new OCX_ToggleButton;
- break;
- case IMAGE: //Image
- {
- pControl = new OCX_Image;
- break;
- }
- case PAGE: // Page
- {
- OUString sMSStore = createSubStreamName( record.nSubStorageId );
- pControl = new OCX_Page(mContainerStorage, sMSStore,
- record.cName, mxParent, this);
- break;
- }
- case MULTIPAGE: // MultiPage
- {
- OUString sMSStore = createSubStreamName( record.nSubStorageId );
- pControl = new OCX_MultiPage( mContainerStorage, sMSStore,
- record.cName, mxParent, this);
- break;
- }
- case FRAME: //Frame
- {
- OUString sFrameStore = createSubStreamName( record.nSubStorageId );
- pControl = new OCX_Frame(mContainerStorage, sFrameStore,
- record.cName, mxParent, this);
-
- break;
- }
- case SPINBUTTON: //SpinButton
- {
- pControl = new OCX_SpinButton;
- break;
- }
- case TABSTRIP: //TabStrip
- {
- pControl = new OCX_TabStrip;
- break;
- }
- case SCROLLBAR: //ScrollBar
- pControl = new OCX_ScrollBar;
- break;
- case PROGRESSBAR: //ProgressBar Active X control
- pControl = new OCX_ProgressBar;
- break;
- default:
- OSL_TRACE( "**** Unknown control 0x%x", record.nTypeIdent );
- DBG_ERROR( "Unknown control");
- return false;
- }
- pControl->sName = record.cName;
- return true;
-}
-
-
-void addSeperator( std::vector< OCX_Control* >& dest )
-{
- OCX_Control* seperator = new OCX_CommandButton;
- seperator->SetInDialog(true);
- seperator->sName = C2S("GroupSeperator");
- dest.push_back( seperator );
-}
-
-void addRButtons( std::vector< OCX_Control* >& src,
- std::vector< OCX_Control* >& dest,
- bool addGroupSeperator )
-{
- if ( addGroupSeperator )
- {
- addSeperator( dest );
- }
-
- for ( CtrlIterator rbIter = src.begin(); rbIter != src.end(); ++rbIter )
- {
- dest.push_back( *rbIter );
- }
-}
-
-void OCX_ContainerControl::ProcessControl(OCX_Control* pControl,SvStorageStream* /* pS */, ContainerRecord& rec )
-{
- SotStorageStreamRef oStream = mContainedControlsStream;
-
- // can insert into OO Dialog (e.g is this a supported dialog control)??
- if ( rec.nTypeIdent == SPINBUTTON ||
- rec.nTypeIdent == TABSTRIP)
- {
- // skip the record in the stream, discard the control
- oStream->SeekRel( rec.nSubStreamLen );
- delete pControl;
- }
- else
- {
- // A container control needs to read the f stream in
- // the folder ( substorage ) associated with this control
- if ( rec.nTypeIdent == FRAME ||
- rec.nTypeIdent == MULTIPAGE||
- rec.nTypeIdent == PAGE )
- {
- OCX_ContainerControl* pContainer =
- static_cast< OCX_ContainerControl* >( pControl );
- oStream = pContainer->getContainerStream();
- }
-
- pControl->sName = rec.cName;
- pControl->msToolTip = rec.controlTip;
- // Position of controls is relative to the container
- pControl->mnTop = rec.nTop + mnTop;
- pControl->mnLeft = rec.nLeft + mnLeft;
- // MS tabIndex, pretty useless in OpenOffice land
- // as tab indexes in MS are relative to parent container.
- // However we need this value in order to set
- // OpenOffice tab indices in a sensible way to
- // reflect the ms tabbing from orig MS UserForm, see below
- pControl->mnTabPos = rec.nTabPos;
- pControl->SetInDialog(true);
- pControl->mbVisible = rec.bVisible;
- if ( mnStep )
- {
- // If the container has a step then it should be
- // applied to all containees
- pControl->mnStep = mnStep;
- }
-
- // #117490# DR: container records provide size of substream, use it here...
-
- // remember initial position to set correct stream position
- ULONG nStrmPos = oStream->Tell();
- // import control, may return with invalid stream position
- pControl->FullRead(oStream);
- // set stream to position behind substream of this control
- oStream->Seek( nStrmPos + rec.nSubStreamLen );
-
- //need to fake grouping behaviour for radio ( option ) buttons
- if ( rec.nTypeIdent == OPTIONBUTTON )
- {
- OCX_OptionButton* pRButton =
- static_cast< OCX_OptionButton*>(pControl);
- rbGroupMgr.addRadioButton( pRButton );
- }
- else
- {
- mpControls.push_back( pControl );
- }
- }
-}
-
-sal_Bool OCX_ContainerControl::Read(SvStorageStream *pS)
-{
-
- if ( mpParent )
- {
- mnBackColor = mpParent->mnBackColor;
- }
-
- std::auto_ptr< ContainerRecReader > reader (
- ContainerRecordReaderFac::instance( containerType ) );
-
- reader->Read( this, pS );
- // Need to honour the MS Tab Indexes. However MS tab indexes are
- // relative to parent, this hack sorts the controls in each container
- // based on the ms tab indexes. When import is called we create the
- // controls in Open/Star office based on the order of the tab indexes,
- // this ensures that the default tab index created by Star/Open office
- // reflects the "flattened" ms tab order.
- ::std::sort( mpControls.begin(), mpControls.end(), SortOrderByTabPos() );
- mpControls = rbGroupMgr.insertGroupsIntoControlList( mpControls );
- return true;
-}
-
-OCX_MultiPage::OCX_MultiPage( SotStorageRef& parent,
- const ::rtl::OUString& storageName,
- const ::rtl::OUString& sN,
- const uno::Reference< container::XNameContainer > &rDialog,
- OCX_Control* pParent):
- OCX_ContainerControl(parent, storageName, sN, rDialog, pParent ), fUnknown1(0), fEnabled(1),
- fLocked(0), fBackStyle(1), fWordWrap(1), fAutoSize(0), nCaptionLen(0),
- nVertPos(1), nHorzPos(7), nMousePointer(0), nBorderColor(0x80000012),
- nKeepScrollBarsVisible(3), nCycle(0), nBorderStyle(0), nSpecialEffect(0),
- nPicture(0), nPictureAlignment(2), nPictureSizeMode(0),
- bPictureTiling(FALSE), nAccelerator(0), nIcon(0), pCaption(0),
- nScrollWidth(0), nScrollHeight(0), nIconLen(0), pIcon(0), nPictureLen(0),
- pPicture(0)
-{
- msDialogType = C2U("NotSupported");
- mnForeColor = 0x80000012L,
- mnBackColor = 0x8000000FL;
- bSetInDialog = true;// UserForm control only
- aFontData.SetHasAlign(TRUE);
- containerType = MULTIPAGE;
- mnCurrentPageStep = 0;
-}
-
-void OCX_MultiPage::ProcessControl(OCX_Control* pControl, SvStorageStream* /* pS */, ContainerRecord& rec )
-{
- SotStorageStreamRef oStream = mContainedControlsStream;
-
- OCX_Page *pPage = NULL;
- if ( rec.nTypeIdent == PAGE )
- pPage = static_cast< OCX_Page* >( pControl );
- if ( pPage != NULL )
- {
- pPage->mnStep = ++mnCurrentPageStep;
-
- pPage->mnTop = mnTop;// move these to Page::import ?
- pPage->mnLeft = mnLeft;
- pPage->mnBackColor = mnBackColor;
-
- oStream = pPage->getContainerStream();;
- // Position of controls is relative to pos of this MuliPage
- // Control
- pPage->FullRead( oStream );
-
- mpControls.push_back( pPage );
- }
- else
- {
- OSL_TRACE("!!!! Unsupported Control 0x%x ", rec.nTypeIdent);
- DBG_ERROR("MultiPage error expected Page control");
- }
-
-}
-
-sal_Bool OCX_MultiPage::Read(SvStorageStream *pS)
-{
- // Unlike the other containers e.g. UserForm & Frame
- // the o stream is does not contain info for the contained controls
- // ( e.g. the pages themselves ) but seems to be for the MultiPage
- // itself - need to check this in more detail
-
- // For the moment skip read of the MultiPage specific properties
- // not much point reading these as we can't display the multi page
- // control or in fact any sort of tabbed layout, best we can do is
- // import just the contained controls of the individual pages
- // Note: the record skipped below ( does not contain the expected
- // info on this control, that seems to be contained in the o stream,
- // see comment above)
- OCX_Control skip(C2S("Dummy"));
- skip.Read( pS );
- mnCurrentPageStep = mnStep; //( set step of of pages relative to step
- //of this MultiPage ( e.g. emulate containment )
- return OCX_ContainerControl::Read(pS);
-}
-
-
-sal_Bool OCX_MultiPage::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- // Calls import on contained controls
- OCX_ContainerControl::Import( rPropSet );
- return sal_True;
-}
-
-sal_Bool OCX_MultiPage::Import(com::sun::star::uno::Reference<
- com::sun::star::container::XNameContainer>
- &rDialog)
-{
- uno::Reference<beans::XPropertySet> xPropSet( rDialog, uno::UNO_QUERY );
-
- // Although MultiPage is not represeted by a "real" control we still
- // need to propagate the backcolor of this logical parent
- // ( the dialog or Frame or whatever ) to the children of this control.
- // For example the controls contained in the Page of a
- // MultiPage control use the parents backcolor ( e,g,
- // Pages backcolor ) when trying to fake transparency
- mnBackColor = mpParent->mnBackColor;
-
- if ( xPropSet.is() )
- {
- // Calls import on contained pages
- return OCX_ContainerControl::Import( xPropSet );
- }
- OSL_TRACE("*** Major problem, no dialog to add controls to ");
- DBG_ERROR(" Major problem, no dialog to add controls to ");
- return false;
-}
-
-
-
-OCX_Page::OCX_Page( SotStorageRef& parent,
- const ::rtl::OUString& storageName,
- const ::rtl::OUString& sN,
- const uno::Reference< container::XNameContainer > &rDialog,
- OCX_Control* pParent):
- OCX_ContainerControl(parent, storageName, sN, rDialog, pParent ),
- fUnknown1(0), fEnabled(1), fLocked(0),
- fBackStyle(1), fWordWrap(1), fAutoSize(0), nCaptionLen(0), nVertPos(1),
- nHorzPos(7), nMousePointer(0), nBorderColor(0x80000012),
- nKeepScrollBarsVisible(3), nCycle(0), nBorderStyle(0), nSpecialEffect(0),
- nPicture(0), nPictureAlignment(2), nPictureSizeMode(0),
- bPictureTiling(FALSE), nAccelerator(0), nIcon(0), pCaption(0),
- nScrollWidth(0), nScrollHeight(0), nIconLen(0), pIcon(0), nPictureLen(0),
- pPicture(0)
-{
- msDialogType = C2U("NotSupported");
- mnForeColor = 0x80000012,
- mnBackColor = 0x8000000F,
- bSetInDialog = true;// UserForm control only
- aFontData.SetHasAlign(TRUE);
-}
-
-
-sal_Bool OCX_Page::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(0x400==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,4);
-
- pS->SeekRel( nFixedAreaLen - sizeof( pBlockFlags ) );
-
- ReadAlign( pS, pS->Tell() - nStart, 4);
-
- if (pBlockFlags[2] & 0x10)
- {
- //Font Stuff..
- pS->SeekRel(0x1a);
- sal_uInt8 nFontLen;
- *pS >> nFontLen;
- pS->SeekRel(nFontLen);
- }
- return OCX_ContainerControl::Read(pS);
-
-}
-
-sal_Bool OCX_Page::Import(com::sun::star::uno::Reference<
- com::sun::star::container::XNameContainer>
- &rDialog)
-{
-
- uno::Reference<beans::XPropertySet> xPropSet( rDialog, uno::UNO_QUERY );
- if ( xPropSet.is() )
- {
- // apply Step to contained controls
- CtrlIterator aEnd = mpControls.end();
- for (CtrlIterator aIter = mpControls.begin(); aIter != aEnd; ++ aIter )
- {
- (*aIter)->mnStep = mnStep;
- }
- // Calls import on contained pages
- return OCX_ContainerControl::Import( xPropSet );
- }
- OSL_TRACE("*** Major problem, no dialog to add controls to ");
- DBG_ERROR("*** Major problem, no dialog to add controls to ");
- return sal_False;
-}
-
-OCX_Frame::OCX_Frame( SotStorageRef& parent,
- const ::rtl::OUString& storageName,
- const ::rtl::OUString& sN,
- const uno::Reference< container::XNameContainer > &rDialog, OCX_Control* pParent):
- OCX_ContainerControl(parent, storageName, sN, rDialog, pParent ),fUnknown1(0),fEnabled(1), fLocked(0),
- fBackStyle(1), fWordWrap(1), fAutoSize(0), nCaptionLen(0), nVertPos(1),
- nHorzPos(7), nMousePointer(0), nBorderColor(0x80000012),
- nKeepScrollBarsVisible(3), nCycle(0), nBorderStyle(0), nSpecialEffect(0),
- nPicture(0), nPictureAlignment(2), nPictureSizeMode(0),
- bPictureTiling(FALSE), nAccelerator(0), nIcon(0), pCaption(0),
- nScrollWidth(0), nScrollHeight(0), nScrollLeft(0), nScrollTop(0), nIconLen(0), pIcon(0), nPictureLen(0),
- pPicture(0)
-{
- msDialogType = C2U("com.sun.star.awt.UnoControlGroupBoxModel");
- mnForeColor = 0x80000012;
- mnBackColor = 0x8000000F;
- bSetInDialog = true;// UserForm control only
- aFontData.SetHasAlign(TRUE);
-}
-
-
-sal_Bool OCX_Frame::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(0x400==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,4);
-
- if (pBlockFlags[0] & 0x01)
- {
- DBG_ASSERT(!this, "ARSE");
- }
- if (pBlockFlags[0] & 0x02)
- *pS >> mnBackColor;
- if (pBlockFlags[0] & 0x04)
- *pS >> mnForeColor;
- if (pBlockFlags[0] & 0x08)
- *pS >> fUnknown1;
- if (pBlockFlags[0] & 0x40)
- {
- sal_uInt8 nTemp;
- *pS >> nTemp;
- fEnabled = (nTemp&0x04)>>2;
- fBackStyle = (nTemp&0x08)>>3;
- *pS >> nTemp;
- *pS >> nTemp;
- fWordWrap = (nTemp&0x80)>>7;
- *pS >> nTemp;
- fAutoSize = (nTemp&0x10)>>4;
- }
- if (pBlockFlags[0] & 0x80)
- {
- *pS >> nBorderStyle;
- }
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
-
- if (pBlockFlags[1] & 0x01)
- *pS >> nMousePointer;
- if (pBlockFlags[1] & 0x02)
- *pS >> nKeepScrollBarsVisible;
- if (pBlockFlags[1] & 0x20)
- *pS >> fUnknown1; // another unknown 32 bit ( or is 8 or 16 bit with padding ? )
-
- if (pBlockFlags[1] & 0x80)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nIcon;
- DBG_ASSERT(nIcon == 0xFFFF, "Unexpected nIcon");
- }
-
- bool bCaption = false;
-
- if (pBlockFlags[2] & 0x01)
- *pS >> nCycle;
- if (pBlockFlags[2] & 0x02)
- *pS >> nSpecialEffect;
-
- if (pBlockFlags[2] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nBorderColor;
- }
-
- if (pBlockFlags[2] & 0x08)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nCaptionLen;
- bCaption = true;
- }
-
- if (pBlockFlags[2] & 0x10)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- sal_uInt16 nNoIdea;
- *pS >> nNoIdea;
- DBG_ASSERT(nNoIdea == 0xFFFF, "Expected 0xFFFF, (related to font ?)");
- }
-
- if (pBlockFlags[2] & 0x20)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nPicture;
- DBG_ASSERT(nPicture == 0xFFFF, "Unexpected nIcon");
- }
-
- if (pBlockFlags[2] & 0x80)
- *pS >> nPictureAlignment;
-
- if (pBlockFlags[3] & 0x01)
- bPictureTiling = true;
-
- if (pBlockFlags[3] & 0x02)
- *pS >> nPictureSizeMode;
-
- if (pBlockFlags[3] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> fUnknown8;
- }
-
- if (pBlockFlags[3] & 0x08)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> fUnknown9;
- }
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nWidth;
- *pS >> nHeight;
- *pS >> nScrollWidth;
- *pS >> nScrollHeight;
-
- if (pBlockFlags[1] & 0x10)
- {
- *pS >> nScrollLeft;
- *pS >> nScrollTop;
- }
-
- if ( bCaption )
- {
- lclReadCharArray( *pS, pCaption, nCaptionLen, pS->Tell() - nStart);
- }
-
- OUString tempCaption = lclCreateOUString( pCaption, nCaptionLen );
-
- if (nIcon)
- {
- pS->Read(pIconHeader,20);
- *pS >> nIconLen;
- pIcon = new sal_uInt8[nIconLen];
- pS->Read(pIcon,nIconLen);
- }
-
- if (nPicture)
- {
- pS->Read(pPictureHeader,20);
- *pS >> nPictureLen;
- pPicture = new sal_uInt8[nPictureLen];
- pS->Read(pPicture,nPictureLen);
- }
-
- ReadAlign( pS, pS->Tell() - nStart, 4);
-
- if (pBlockFlags[2] & 0x10)
- {
- //Font Stuff..
- pS->SeekRel(0x1a);
- sal_uInt8 nFontLen;
- *pS >> nFontLen;
- pS->SeekRel(nFontLen);
- }
-
- return OCX_ContainerControl::Read( pS );
-}
-
-sal_Bool OCX_Frame::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), aTmp);
- if ( pCaption )
- {
- aTmp <<= lclCreateOUString( pCaption, nCaptionLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Label"), aTmp);
- }
-
- // Calls import on contained controls
- OCX_ContainerControl::Import( rPropSet );
- return sal_True;
-}
-OCX_UserForm::OCX_UserForm( SotStorageRef& parent,
- const OUString& storageName,
- const OUString& sN,
- const ::uno::Reference< container::XNameContainer > &rDialog,
- const ::uno::Reference< lang::XMultiServiceFactory >& rMsf):
- OCX_ContainerControl(parent, storageName, sN, rDialog),
- nChildrenA(0), fEnabled(1), fLocked(0),
- fBackStyle(1), fWordWrap(1), fAutoSize(0), nCaptionLen(0), nVertPos(1),
- nHorzPos(7), nMousePointer(0), nBorderColor(0x80000012), nChildrenB(0),
- nKeepScrollBarsVisible(3), nCycle(0), nBorderStyle(0), nSpecialEffect(0),
- nPicture(0), nPictureAlignment(2), nPictureSizeMode(0),
- bPictureTiling(FALSE), nAccelerator(0), nIcon(0), pCaption(0),
- nScrollWidth(0), nScrollHeight(0), nScrollLeft(0), nScrollTop(0), nIconLen(0), pIcon(0), nPictureLen(0),
- pPicture(0)
- {
- mnForeColor = 0x80000012;
- mnBackColor = 0x8000000F;
- uno::Reference< beans::XPropertySet> xProps( rMsf, uno::UNO_QUERY);
- if ( xProps.is() )
- {
- xProps->getPropertyValue(C2S("DefaultContext")) >>= mxCtx;
- }
- aFontData.SetHasAlign(TRUE);
- }
-sal_Bool OCX_UserForm::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(0x400==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,4);
-
- if (pBlockFlags[0] & 0x01)
- {
- DBG_ASSERT(!this, "ARSE");
- }
- if (pBlockFlags[0] & 0x02)
- *pS >> mnBackColor;
- if (pBlockFlags[0] & 0x04)
- *pS >> mnForeColor;
- if (pBlockFlags[0] & 0x08)
- *pS >> nChildrenA;
- if (pBlockFlags[0] & 0x40)
- {
- sal_uInt8 nTemp;
- *pS >> nTemp;
- fEnabled = (nTemp&0x04)>>2;
- fBackStyle = (nTemp&0x08)>>3;
- *pS >> nTemp;
- *pS >> nTemp;
- fWordWrap = (nTemp&0x80)>>7;
- *pS >> nTemp;
- fAutoSize = (nTemp&0x10)>>4;
- }
- if (pBlockFlags[0] & 0x80)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nBorderStyle;
- }
-#if 0
- sal_uInt16 nFixedOrAlign;
- *pS >> nFixedOrAlign;
-#endif
- if (pBlockFlags[1] & 0x01)
- *pS >> nMousePointer;
- if (pBlockFlags[1] & 0x02)
- *pS >> nKeepScrollBarsVisible;
- if (pBlockFlags[1] & 0x20)
- {
- sal_uInt32 nUnknown32;
- *pS >> nUnknown32;
- }
- if (pBlockFlags[1] & 0x80)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nIcon;
- DBG_ASSERT(nIcon == 0xFFFF, "Unexpected nIcon");
- }
- if (pBlockFlags[2] & 0x01)
- *pS >> nCycle;
- if (pBlockFlags[2] & 0x02)
- *pS >> nSpecialEffect;
-
- if (pBlockFlags[2] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nBorderColor;
- }
-
- if (pBlockFlags[2] & 0x10)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- sal_uInt16 nNoIdea;
- *pS >> nNoIdea;
- DBG_ASSERT(nNoIdea == 0xFFFF, "Expected 0xFFFF, (related to font ?)");
- }
-
- if (pBlockFlags[2] & 0x20)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nPicture;
- DBG_ASSERT(nPicture == 0xFFFF, "Unexpected nIcon");
- }
-
- if (pBlockFlags[2] & 0x80)
- *pS >> nPictureAlignment;
-
- if (pBlockFlags[3] & 0x01)
- bPictureTiling = true;
-
- if (pBlockFlags[3] & 0x02)
- *pS >> nPictureSizeMode;
-
- if (pBlockFlags[3] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nChildrenB;
- }
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nDrawBuffer;
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nWidth;
- *pS >> nHeight;
- *pS >> nScrollWidth;
- *pS >> nScrollHeight;
-
- if (pBlockFlags[1] & 0x10)
- {
- *pS >> nScrollLeft;
- *pS >> nScrollTop;
- }
-
- if (nIcon)
- {
- pS->Read(pIconHeader,20);
- *pS >> nIconLen;
- pIcon = new sal_uInt8[nIconLen];
- pS->Read(pIcon,nIconLen);
- }
-
- if (nPicture)
- {
- pS->Read(pPictureHeader,20);
- *pS >> nPictureLen;
- pPicture = new sal_uInt8[nPictureLen];
- pS->Read(pPicture,nPictureLen);
- }
-
- ReadAlign( pS, pS->Tell() - nStart, 4);
-
- if (pBlockFlags[2] & 0x10)
- {
- //Font Stuff..
- pS->SeekRel(0x1a);
- sal_uInt8 nFontLen;
- *pS >> nFontLen;
- pS->SeekRel(nFontLen);
- }
-
- sal_Int16 numTrailingRecs = 0;
- *pS >> numTrailingRecs;
- // seems to be no. of trailing records,
- // before container record starts proper
- // ( unknown what these trailing records are for)
- if ( numTrailingRecs )
- {
- for ( ; numTrailingRecs ; --numTrailingRecs )
- {
- OCX_Control skip(C2S("dummy")) ;
- skip.Read( pS );
- }
- }
- return OCX_ContainerControl::Read( pS );
-}
-
-sal_Bool OCX_UserForm::Import(
- uno::Reference<container::XNameContainer> &rLib )
-{
- uno::Reference<beans::XPropertySet>
- xDialogPropSet(mxParent, uno::UNO_QUERY);
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- xDialogPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), aTmp);
- xDialogPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Title")), aTmp);
- aTmp <<= ImportColor(mnBackColor);
- xDialogPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp <<= sal_Int32((nWidth * 2) / 100);
- xDialogPropSet->setPropertyValue(WW8_ASCII2STR("Width"), aTmp);
- aTmp <<= sal_Int32((nHeight * 2) / 100);
- xDialogPropSet->setPropertyValue(WW8_ASCII2STR("Height"), aTmp);
-
- uno::Reference<beans::XPropertySet> xPropSet( mxParent, uno::UNO_QUERY );
- OCX_ContainerControl::Import( xPropSet );
-
- uno::Reference<io::XInputStreamProvider> xSource =
- xmlscript::exportDialogModel(mxParent, mxCtx);
- uno::Any aSourceAny(uno::makeAny(xSource));
- if (rLib->hasByName(sName))
- rLib->replaceByName(sName, aSourceAny);
- else
- rLib->insertByName(sName, aSourceAny);
- return sal_True;
-}
-
-sal_Bool OCX_Label::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet = sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(8);
- pBlockFlags[0] = 0x20;
- pBlockFlags[1] = 0;
- pBlockFlags[2] = 0;
- pBlockFlags[3] = 0;
-
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x01;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- sal_uInt8 nTemp=fEnabled;
- if (fEnabled)
- nTemp = nTemp << 1;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("MultiLine"));
- fWordWrap = any2bool(aTmp);
- nTemp=fWordWrap;
- nTemp = nTemp << 7;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
- pBlockFlags[0] |= 0x04;
-
- SvxOcxString aCaption( rPropSet->getPropertyValue(WW8_ASCII2STR("Label")) );
- aCaption.WriteLenField( *rContents );
- if (aCaption.HasData())
- pBlockFlags[0] |= 0x08;
-
- WriteAlign(rContents,4);
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BorderColor"));
- if (aTmp.hasValue())
- aTmp >>= nBorderColor;
- *rContents << ExportColor(nBorderColor);
- pBlockFlags[0] |= 0x80;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Border"));
- sal_Int16 nBorder = sal_Int16();
- aTmp >>= nBorder;
- sal_uInt8 nNewBorder;
- nSpecialEffect = ExportBorder(nBorder,nNewBorder);
- nBorderStyle = nNewBorder;
- *rContents << nBorderStyle;
- pBlockFlags[1] |= 0x01;
- *rContents << nSpecialEffect;
- pBlockFlags[1] |= 0x02;
-
- aCaption.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- bRet = aFontData.Export(rContents,rPropSet);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-
-sal_Bool OCX_Label::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x23, 0x9E, 0x8C, 0x97,
- 0xB0, 0xD4, 0xCE, 0x11, 0xBF, 0x2D, 0x00, 0xAA,
- 0x00, 0x3F, 0x40, 0xD0, 0x1A, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x4C, 0x61, 0x62, 0x65,
- 0x6C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
- 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
- 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x0E, 0x00,
- 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
- 0x4C, 0x61, 0x62, 0x65, 0x6C, 0x2E, 0x31, 0x00,
- 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x4C, 0x00, 0x61, 0x00, 0x62, 0x00, 0x65, 0x00,
- 0x6C, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-/*
- static sal_uInt8 __READONLY_DATA aTest[] = {
- 0x00, 0x02, 0x20, 0x00, 0x2B, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
- 0x06, 0x00, 0x00, 0x80, 0x4C, 0x61, 0x62, 0x65,
- 0x6C, 0x31, 0x18, 0x00, 0xEC, 0x09, 0x00, 0x00,
- 0x7B, 0x02, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00,
- 0x35, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x80,
- 0xC3, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
- 0x54, 0x69, 0x6D, 0x65, 0x73, 0x20, 0x4E, 0x65,
- 0x77, 0x20, 0x52, 0x6F, 0x6D, 0x61, 0x6E, 0x00,
- };
-*/
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-typedef OCX_Control *(*FNCreate)();
-
-
-struct OCX_map
-{
- FNCreate pCreate;
- const char *sId;
- sal_Int16 nId;
- const char *sName;
-};
-
-OCX_map aOCXTab[] =
-{
- // Command button MUST be at index 0
- {&OCX_CommandButton::Create,"D7053240-CE69-11CD-a777-00dd01143c57",
- form::FormComponentType::COMMANDBUTTON,"CommandButton"},
- // Toggle button MUST be at index 1
- {&OCX_ToggleButton::Create,"8BD21D60-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::COMMANDBUTTON,"ToggleButton"},
- {&OCX_Label::Create, "978C9E23-D4B0-11CE-bf2d-00aa003f40d0",
- form::FormComponentType::FIXEDTEXT,"Label"},
- {&OCX_TextBox::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::TEXTFIELD,"TextBox"},
- {&OCX_ListBox::Create,"8BD21D20-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::LISTBOX,"ListBox"},
- {&OCX_ComboBox::Create,"8BD21D30-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::COMBOBOX,"ComboBox"},
- {&OCX_CheckBox::Create,"8BD21D40-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::CHECKBOX,"CheckBox"},
- {&OCX_OptionButton::Create,"8BD21D50-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::RADIOBUTTON,"OptionButton"},
- {&OCX_Image::Create,"4C599241-6926-101B-9992-00000b65c6f9",
- form::FormComponentType::IMAGECONTROL,"Image"},
- {&OCX_FieldControl::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::DATEFIELD,"TextBox"},
- {&OCX_FieldControl::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::TIMEFIELD,"TextBox"},
- {&OCX_FieldControl::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::NUMERICFIELD,"TextBox"},
- {&OCX_FieldControl::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::CURRENCYFIELD,"TextBox"},
- {&OCX_FieldControl::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::PATTERNFIELD,"TextBox"},
-#if 0
- {&OCX_FieldControl::Create,"8BD21D10-EC42-11CE-9e0d-00aa006002f3",
- form::FormComponentType::FORMULAFIELD,"TextBox"},
-#endif
- {&OCX_ImageButton::Create,"D7053240-CE69-11CD-a777-00dd01143c57",
- form::FormComponentType::IMAGEBUTTON,"CommandButton"},
- {&OCX_SpinButton::Create,"79176FB0-B7F2-11CE-97ef-00aa006d2776",
- form::FormComponentType::SPINBUTTON,"SpinButton"},
- {&OCX_ScrollBar::Create,"DFD181E0-5E2F-11CE-a449-00aa004a803d",
- form::FormComponentType::SCROLLBAR,"ScrollBar"},
- {&OCX_GroupBox::Create,"",
- form::FormComponentType::GROUPBOX,""},
- {&OCX_ProgressBar::Create,"",
- form::FormComponentType::CONTROL,""}
-};
-
-const int NO_OCX = sizeof( aOCXTab ) / sizeof( *aOCXTab );
-
-SvxMSConvertOCXControls::SvxMSConvertOCXControls(SfxObjectShell *pDSh, SwPaM *pP) :
- pDocSh(pDSh), pPaM(pP), nEdit(0), nCheckbox(0)
-{
- DBG_ASSERT( pDocSh, "No DocShell, Cannot do Controls" );
- OCX_Control::FillSystemColors();
-}
-
-SvxMSConvertOCXControls::~SvxMSConvertOCXControls()
-{
-}
-
-OCX_Control * SvxMSConvertOCXControls::OCX_Factory(const String &sName)
-{
- for (int i=0;i<NO_OCX;i++)
- {
- if ( sName.EqualsIgnoreCaseAscii( aOCXTab[i].sId ))
- return(aOCXTab[i].pCreate());
- }
- return(NULL);
-}
-
-OCX_Control * SvxMSConvertOCXControls::OCX_Factory(
- const uno::Reference< awt::XControlModel > &rControlModel,
- String &rId, String &rName)
-{
- rName.Erase();
- rId.Erase();
-
- uno::Reference< beans::XPropertySet > xPropSet(
- rControlModel,uno::UNO_QUERY);
-
- uno::Any aTmp = xPropSet->getPropertyValue(
- OUString::createFromAscii("ClassId"));
- sal_Int16 nClassId = *(sal_Int16*) aTmp.getValue();
-
-//Begin nasty hack
- /*
- There is a truly horrible thing with EditControls and FormattedField
- Controls, they both pretend to have an EDITBOX ClassId for compability
- reasons, at some stage in the future hopefully there will be a proper
- FormulaField ClassId rather than this piggybacking two controls onto the
- same ClassId, when this happens uncomment the FORMULAFIELD in the OCX_Tab
- and delete this block, cmc.
-
- And also the nClassId for ImageControls is being reported as "CONTROL"
- rather than IMAGECONTROL
- */
- if (nClassId == form::FormComponentType::TEXTFIELD)
- {
- uno::Reference< lang::XServiceInfo > xInfo(rControlModel,
- uno::UNO_QUERY);
- if (xInfo->
- supportsService(OUString::createFromAscii(
- "com.sun.star.form.component.FormattedField")))
- {
- rId.AppendAscii("8BD21D10-EC42-11CE-9e0d-00aa006002f3");
- rName.AppendAscii("TextBox");
- return new OCX_FieldControl;
- }
- }
- else if (nClassId == form::FormComponentType::CONTROL)
- {
- uno::Reference< lang::XServiceInfo > xInfo(rControlModel,
- uno::UNO_QUERY);
- if (xInfo->
- supportsService(OUString::createFromAscii(
- "com.sun.star.form.component.ImageControl")))
- nClassId = form::FormComponentType::IMAGECONTROL;
- }
-//End nasty hack
-
- const OCX_map* pEntry = 0;
-
- // distinguish between push button and toggle button
- if( nClassId == form::FormComponentType::COMMANDBUTTON )
- {
- pEntry = any2bool(xPropSet->getPropertyValue(WW8_ASCII2STR("Toggle"))) ?
- (aOCXTab + 1) : aOCXTab;
- }
- else
- {
- for( int i = 2; (i < NO_OCX) && !pEntry; ++i )
- if( nClassId == aOCXTab[ i ].nId )
- pEntry = aOCXTab + i;
- }
-
- if( pEntry )
- {
- rId.AppendAscii( pEntry->sId );
- rName.AppendAscii( pEntry->sName );
- return pEntry->pCreate();
- }
-
- return 0;
-}
-
-
-sal_Bool SvxMSConvertOCXControls::ReadOCXStream( SvStorageRef& rSrc1,
- uno::Reference < drawing::XShape > *pShapeRef,BOOL bFloatingCtrl)
-{
-
- SvStorageStreamRef xCrash = rSrc1->OpenSotStream( WW8_ASCII2STR("contents") );
- sal_Bool bRet=sal_False;
-
- SvStorageStreamRef xSrc2 = rSrc1->OpenSotStream( WW8_ASCII2STR("\3OCXNAME") );
- SvStorageStream* pSt = xSrc2;
- pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
- /* #117832# import control name */
- OUString controlName;
- bool hasCName = readOCXNAME( controlName, pSt );
-
- xSrc2 = rSrc1->OpenSotStream( WW8_ASCII2STR("contents") );
- pSt = xSrc2;
- pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
- /*Get Class Id of this object, see if it is one of the types
- *that this importer can handle, call the appropiate handler
- to read that control, and call the appropiate handler to
- insert that control
- */
-
- SvGlobalName aTest = rSrc1->GetClassName();
- OCX_Control *pObj = OCX_Factory(aTest.GetHexName());
- if (pObj)
- {
- pObj->pDocSh = pDocSh;
- /* #117832# set imported control name */
- if ( hasCName )
- {
- pObj->sName = controlName;
- }
- com::sun::star::awt::Size aSz;
- uno::Reference< form::XFormComponent > xFComp;
- const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
- GetServiceFactory();
- if(!rServiceFactory.is())
- return(sal_False);
- bRet = pObj->FullRead(pSt);
- if(bRet)
- if (pObj->Import(rServiceFactory,xFComp,aSz))
- bRet = InsertControl( xFComp, aSz,pShapeRef,bFloatingCtrl);
- delete pObj;
- }
- return bRet;
-}
-
-
-sal_Bool SvxMSConvertOCXControls::ReadOCXExcelKludgeStream(
- SvStorageStreamRef& rSrc1, uno::Reference < drawing::XShape > *
- pShapeRef,BOOL bFloatingCtrl)
-{
- sal_Bool bRet=sal_False;
- /*Get Class Id of this object, see if it is one of the types
- *that this importer can handle, call the appropiate handler
- to read that control, and call the appropiate handler to
- insert that control
- */
- /*The Excel Kludge is to concatenate a class id with a contents
- * stream, and then concatenate all the controls together,
- * This means that you should have the cnts stream wound to the
- * correct location before passing the control stream in here*/
- SvStream *pSt = rSrc1;
- pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- SvGlobalName aTest;
- *pSt >> aTest;
- OCX_Control *pObj = OCX_Factory(aTest.GetHexName());
- if (pObj)
- {
-
- com::sun::star::awt::Size aSz;
- uno::Reference< form::XFormComponent > xFComp;
- const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
- GetServiceFactory();
- if(!rServiceFactory.is())
- return(sal_False);
- bRet = pObj->FullRead(rSrc1);
- if(bRet)
- if (pObj->Import(rServiceFactory,xFComp,aSz))
- bRet = InsertControl( xFComp, aSz,pShapeRef,bFloatingCtrl);
- delete pObj;
- }
- return bRet;
-}
-
-
-sal_Bool SvxMSConvertOCXControls::WriteOCXStream( SvStorageRef& rSrc1,
- const uno::Reference< awt::XControlModel > &rControlModel,
- const awt::Size &rSize, String &rName)
-{
- sal_Bool bRet=sal_False;
-
- DBG_ASSERT( rControlModel.is(), "UNO-Control missing Model, panic!" );
- if( !rControlModel.is() )
- return sal_False;
-
-#if 0
- uno::Any aTmp = xPropSet->getPropertyValue(
- OUString::createFromAscii("ClassId"));
- sal_Int16 nClassId = *(sal_Int16*) aTmp.getValue();
-#endif
-
- String sId;
- OCX_Control *pObj = OCX_Factory(rControlModel,sId,rName);
- if (pObj != NULL)
- {
- uno::Reference<beans::XPropertySet> xPropSet(rControlModel,
- uno::UNO_QUERY);
-
- /* #117832# - also enable export of control name */
- OUString sCName;
- xPropSet->getPropertyValue(C2S("Name")) >>= sCName;
- pObj->sName = sCName;
-
- SvGlobalName aName;
- aName.MakeId(sId);
- String sFullName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(
- "Microsoft Forms 2.0 ")));
- sFullName.Append(rName);
- rSrc1->SetClass(aName,0x5C,sFullName);
- // ^^^^, this pathetic 0x5c is the magic number
- // which the lack of originally blocked the implementation of
- // the controls export
- // cmc
-
- bRet = pObj->Export(rSrc1,xPropSet,rSize);
- SvStorageStreamRef xStor2( rSrc1->OpenSotStream( WW8_ASCII2STR("\3OCXNAME")));
- /* #117832# - also enable export of control name */
- writeOCXNAME( sCName, xStor2 );
- delete pObj;
- }
- return bRet;
-}
-
-
-//I think this should work for excel documents, create the "Ctls" stream
-//and give it here as rContents, we'll append out streams ole id and
-//contents here and that appears to be what Excel is doing
-sal_Bool SvxMSConvertOCXControls::WriteOCXExcelKludgeStream(
- SvStorageStreamRef& rContents,
- const uno::Reference< awt::XControlModel > &rControlModel,
- const awt::Size &rSize, String &rName)
-{
- sal_Bool bRet=sal_False;
-
- DBG_ASSERT( rControlModel.is(), "UNO-Control missing Model, panic!" );
- if( !rControlModel.is() )
- return sal_False;
-
- String sId;
- OCX_Control *pObj = OCX_Factory(rControlModel,sId,rName);
- if (pObj != NULL)
- {
- uno::Reference<beans::XPropertySet> xPropSet(rControlModel,
- uno::UNO_QUERY);
-
- SvGlobalName aName;
- aName.MakeId(sId);
- String sFullName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(
- "Microsoft Forms 2.0 ")));
- sFullName.Append(rName);
- SvStream *pS=rContents;
- *pS << aName;
- bRet = pObj->WriteContents(rContents,xPropSet,rSize);
- delete pObj;
- // export needs correct stream position
- rContents->Seek( STREAM_SEEK_TO_END );
- }
- return bRet;
-}
-
-
-
-
-
-
-
-sal_Bool OCX_CheckBox::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- // background color: fBackStyle==0 -> transparent
- if( fBackStyle )
- aTmp <<= ImportColor(mnBackColor);
- else
- aTmp = uno::Any();
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- sal_Bool bTemp;
- if ((!(fEnabled)) || (fLocked))
- bTemp = sal_False;
- else
- bTemp = sal_True;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- bTemp = fWordWrap != 0;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
-
- aTmp <<= ImportColor(mnForeColor);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
-
- bTemp = nMultiState;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("TriState"), aTmp);
-
- aTmp <<= ImportSpecEffect( nSpecialEffect );
- rPropSet->setPropertyValue( WW8_ASCII2STR("VisualEffect"), aTmp);
-
- if (pValue && !bSetInDialog)
- {
- INT16 nTmp=pValue[0]-0x30;
- aTmp <<= nTmp;
- rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultState"), aTmp);
- }
-
- if (pCaption)
- {
- aTmp <<= lclCreateOUString( pCaption, nCaptionLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Label"), aTmp);
- }
-
- // #i40279# always centered vertically
- aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
- rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
-
- aFontData.Import(rPropSet);
- return(sal_True);
-}
-
-sal_Bool OCX_CheckBox::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(12);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x01;
- pBlockFlags[2] = 0;
- pBlockFlags[3] = 0x80;
- pBlockFlags[4] = 0;
- pBlockFlags[5] = 0;
- pBlockFlags[6] = 0;
- pBlockFlags[7] = 0;
-
- uno::Any aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
- fBackStyle = aTmp.hasValue() ? 1 : 0;
- if (fBackStyle)
- aTmp >>= mnBackColor;
-
- sal_uInt8 nTemp=fEnabled;
- if (fEnabled)
- nTemp = nTemp << 1;
- if (fBackStyle)
- nTemp |= 0x08;
- *rContents << nTemp;
- pBlockFlags[0] |= 0x01;
- *rContents << sal_uInt8(0x00);
- nTemp = 0;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("MultiLine"));
- fWordWrap = any2bool(aTmp);
- if (fWordWrap)
- nTemp |= 0x80;
- *rContents << nTemp;
- *rContents << sal_uInt8(0x00);
-
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x02;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TextColor"));
- if (aTmp.hasValue())
- aTmp >>= mnForeColor;
- *rContents << ExportColor(mnForeColor);
- pBlockFlags[0] |= 0x04;
-
- nStyle = 4;
- *rContents << nStyle;
- pBlockFlags[0] |= 0x40;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("TriState"));
- nMultiState = any2bool(aTmp);
- *rContents << nMultiState;
- pBlockFlags[2] |= 0x20;
-
- WriteAlign(rContents,4);
- nValueLen = 1|SVX_MSOCX_COMPRESSED;
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("DefaultState"));
- sal_Int16 nDefault = sal_Int16();
- aTmp >>= nDefault;
- *rContents << nValueLen;
- pBlockFlags[2] |= 0x40;
-
- SvxOcxString aCaption( rPropSet->getPropertyValue(WW8_ASCII2STR("Label")) );
- aCaption.WriteLenField( *rContents );
- if (aCaption.HasData())
- pBlockFlags[2] |= 0x80;
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("VisualEffect"));
- if (aTmp.hasValue())
- {
- sal_Int16 nApiSpecEffect = sal_Int16();
- aTmp >>= nApiSpecEffect;
- nSpecialEffect = ExportSpecEffect( nApiSpecEffect );
- }
- WriteAlign(rContents,4);
- *rContents << nSpecialEffect;
- pBlockFlags[3] |= 0x04;
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- nDefault += 0x30;
- *rContents << sal_uInt8(nDefault);
- *rContents << sal_uInt8(0x00);
-
- aCaption.WriteCharArray( *rContents );
-
- WriteAlign(rContents,4);
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
- bRet = aFontData.Export(rContents,rPropSet);
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- *rContents << pBlockFlags[4];
- *rContents << pBlockFlags[5];
- *rContents << pBlockFlags[6];
- *rContents << pBlockFlags[7];
-
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-sal_Bool OCX_CheckBox::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x1D, 0xD2, 0x8B,
- 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
- 0x00, 0x60, 0x02, 0xF3, 0x1D, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x43, 0x68, 0x65, 0x63,
- 0x6B, 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65,
- 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74,
- 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72,
- 0x6D, 0x73, 0x2E, 0x43, 0x68, 0x65, 0x63, 0x6B,
- 0x42, 0x6F, 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39,
- 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x43, 0x00, 0x68, 0x00, 0x65, 0x00, 0x63, 0x00,
- 0x6B, 0x00, 0x42, 0x00, 0x6F, 0x00, 0x78, 0x00,
- 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-/*
- static sal_uInt8 __READONLY_DATA aTest[] = {
- 0x00, 0x02, 0x34, 0x00, 0x46, 0x01, 0xC0, 0x80,
- 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, 0x80,
- 0xE2, 0x0E, 0x00, 0x00, 0x95, 0x02, 0x00, 0x00,
- 0x30, 0x69, 0x1D, 0x00, 0x43, 0x68, 0x65, 0x63,
- 0x6B, 0x42, 0x6F, 0x78, 0x31, 0x20, 0x52, 0x6F,
- 0x00, 0x02, 0x20, 0x00, 0x35, 0x00, 0x00, 0x00,
- 0x0F, 0x00, 0x00, 0x80, 0xC3, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x00, 0x00, 0x54, 0x69, 0x6D, 0x65,
- 0x73, 0x20, 0x4E, 0x65, 0x77, 0x20, 0x52, 0x6F,
- 0x6D, 0x61, 0x6E, 0x00,
- };
-*/
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-
-sal_Bool OCX_FontData::Read(SvStorageStream *pS)
-{
- long nStart = pS->Tell();
- *pS >> nIdentifier;
- *pS >> nFixedAreaLen;
- pS->Read(pBlockFlags,4);
-
- bool bFontName = (pBlockFlags[0] & 0x01) != 0;
- if (bFontName)
- *pS >> nFontNameLen;
- if (pBlockFlags[0] & 0x02)
- {
- sal_uInt8 nTmp;
- *pS >> nTmp;
- fBold = nTmp & 0x01;
- fItalic = (nTmp & 0x02) >> 1;
- fUnderline = (nTmp & 0x04) >> 2;
- fStrike = (nTmp & 0x08) >> 3;
- fUnknown1 = (nTmp & 0xF0) >> 4;
- *pS >> nUnknown2;
- *pS >> nUnknown3;
- *pS >> nUnknown4;
- }
- if (pBlockFlags[0] & 0x04)
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nFontSize;
- }
- else
- nFontSize = 240;
- if (pBlockFlags[0] & 0x10)
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nLanguageID;
- }
- if (pBlockFlags[0] & 0x40)
- {
- *pS >> nJustification;
- }
- if (pBlockFlags[0] & 0x80) // font weight before font name
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nFontWeight;
- }
-
- if (bFontName)
- lclReadCharArray( *pS, pFontName, nFontNameLen, pS->Tell() - nStart);
-
- ReadAlign(pS, pS->Tell() - nStart, 4);
- return(TRUE);
-}
-
-void OCX_FontData::Import(uno::Reference< beans::XPropertySet > &rPropSet)
-{
- uno::Any aTmp;
- if (pFontName)
- {
- aTmp <<= lclCreateOUString( pFontName, nFontNameLen );
- rPropSet->setPropertyValue( WW8_ASCII2STR("FontName"), aTmp);
- }
-
- if (bHasAlign)
- {
- sal_Int16 nAlign = ImportAlign(nJustification);
- aTmp <<= nAlign;
- rPropSet->setPropertyValue( WW8_ASCII2STR("Align"), aTmp);
- }
-
- if (fBold)
- {
- aTmp <<= awt::FontWeight::BOLD;
- rPropSet->setPropertyValue( WW8_ASCII2STR("FontWeight"), aTmp);
- }
-
- if (fItalic)
- {
- aTmp <<= (sal_Int16)awt::FontSlant_ITALIC;
- rPropSet->setPropertyValue( WW8_ASCII2STR("FontSlant"), aTmp);
- }
-
- if (fUnderline)
- {
- aTmp <<= awt::FontUnderline::SINGLE;
- rPropSet->setPropertyValue( WW8_ASCII2STR("FontUnderline"), aTmp);
- }
-
- if (fStrike)
- {
- aTmp <<= awt::FontStrikeout::SINGLE;
- rPropSet->setPropertyValue( WW8_ASCII2STR("FontStrikeout"), aTmp);
- }
-
- // 2004-09-17: very strange way of storing font sizes...
- // 1pt->30, 2pt->45, 3pt->60, 4pt->75, 5pt->105, 6pt->120, 7pt->135
- // 8pt->165, 9pt->180, 10pt->195, 11pt->225, ...
- aTmp <<= sal_Int16( (nFontSize <= 30) ? 1 : ((nFontSize + 10) / 20) );
- rPropSet->setPropertyValue( WW8_ASCII2STR("FontHeight"), aTmp);
-}
-
-sal_Bool OCX_FontData::Export(SvStorageStreamRef &rContent,
- const uno::Reference< beans::XPropertySet > &rPropSet)
-{
- sal_uInt8 nFlags=0x00;
- sal_uInt32 nOldPos = rContent->Tell();
- rContent->SeekRel(8);
- SvxOcxString aFontName;
- uno::Any aTmp;
-
- if (bHasFont)
- aFontName = rPropSet->getPropertyValue(WW8_ASCII2STR("FontName"));
- if (!aFontName.HasData())
- aFontName = OUString( RTL_CONSTASCII_USTRINGPARAM( "Times New Roman" ) );
- aFontName.WriteLenField( *rContent );
- nFlags |= 0x01;
-
- if (bHasFont)
- {
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontWeight"));
- float nBold = 0;
- aTmp >>= nBold;
-
- if (nBold >= 150)
- {
- nFlags |= 0x02;
- sal_uInt8 nTmp=0x01;
- *rContent << nTmp;
- nTmp=0x00;
- *rContent << nTmp;
- *rContent << nTmp;
- *rContent << nTmp;
- }
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontHeight"));
- float nFontHeight = 0;
- aTmp >>= nFontHeight;
- if (nFontHeight)
- {
- nFlags |= 0x04;
- // 2004-09-17: very strange way of storing font sizes:
- // 1pt->30, 2pt->45, 3pt->60, 4pt->75, 5pt->105, 6pt->120, 7pt->135
- // 8pt->165, 9pt->180, 10pt->195, 11pt->225, ...
- nFontSize = (nFontHeight == 1) ? 30 : (static_cast<sal_uInt32>((nFontHeight*4+1)/3)*15);
- *rContent << nFontSize;
- }
-
- if (bHasAlign)
- {
- *rContent << sal_uInt16(0x0200);
- nFlags |= 0x10;
-
- nFlags |= 0x20; // ?
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Align"));
- nFlags |= 0x40;
- sal_Int16 nAlign(0);
- if (aTmp.hasValue())
- aTmp >>= nAlign;
- nJustification = ExportAlign(nAlign);
- *rContent << nJustification;
- }
- }
-
- aFontName.WriteCharArray( *rContent );
- WriteAlign(rContent,4);
-
- sal_uInt16 nFixedAreaLn = static_cast<sal_uInt16>(rContent->Tell()-nOldPos-4);
- rContent->Seek(nOldPos);
- *rContent << nStandardId;
- *rContent << nFixedAreaLn;
- *rContent << nFlags;
- *rContent << sal_uInt8(0x00);
- *rContent << sal_uInt8(0x00);
- *rContent << sal_uInt8(0x00);
-
- WriteAlign(rContent,4);
- return sal_True;
-}
-
-// Doesn't really read anything but just skips the
-// record.
-sal_Bool OCX_TabStrip::Read(SotStorageStream *pS)
-{
- const long skipLen = 0x18;
- *pS >> nIdentifier;
- DBG_ASSERT(nStandardId==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
-
- pS->Read(pBlockFlags, sizeof(pBlockFlags));
- pS->SeekRel(skipLen);
- *pS >> nNumTabs;
- // skip to end of control
- pS->SeekRel(nFixedAreaLen - sizeof(pBlockFlags) - sizeof(nNumTabs) - skipLen );
- return sal_True;
-}
-
-sal_Bool OCX_TabStrip::ReadFontData(SotStorageStream *pS)
-{
- // Seems like there is a real font record followed by
- // a number of blank records ( e.g. nFixedAreaLen = 0 )
- // The number of trailing blank records is equal to the number of tabs
- OCX_Control::ReadFontData(pS);
- for ( sal_uInt16 index = 0; index < nNumTabs; index++ )
- {
- OCX_Control::Read(pS); // read trailing records
- }
- return sal_True;
-}
-
-sal_Bool OCX_Image::Read(SotStorageStream *pS)
-{
- if ( !bSetInDialog )
- {
- // preserve the present behavior at the moment.
- // only import image control for UserForms
- return sal_False;
- }
- ULONG nStart = pS->Tell();
- *pS >> nIdentifier;
- DBG_ASSERT(nStandardId==nIdentifier,
- "A control that has a different identifier");
- *pS >> nFixedAreaLen;
-
- pS->Read(pBlockFlags, sizeof(pBlockFlags));
-
- bool hasEmbeddedImage = false;
-
- if ( pBlockFlags[0] & 0x04 )
- {
- bAutoSize = true;
- }
- if ( pBlockFlags[0] & 0x08 )
- {
- *pS >> nBorderColor;
- }
- if ( pBlockFlags[0] & 0x10 )
- {
- *pS >> mnBackColor;
- }
- if ( pBlockFlags[0] & 0x20 )
- {
- *pS >> nBorderStyle;
- }
- if ( pBlockFlags[0] & 0x40 )
- {
- *pS >> nMousePointer;
- }
- if ( pBlockFlags[0] & 0x80 )
- {
- *pS >> nPictureSizeMode;
- }
-
- if ( pBlockFlags[ 1 ] & 0x1 )
- {
- *pS >> nSpecialEffect;
- }
- // investigate if valid also for formcontrols, although for controls
- // images themselves seem to come through from escher ( as shape, think
- // its probably a preview? )
-
- // np a bit of a guess ( until proved incorrect )
- if ( pBlockFlags[ 1 ] & 0x4 )
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- hasEmbeddedImage = true;
- sal_uInt16 unknown;
- *pS >> unknown;
- }
-
-
- if ( pBlockFlags[ 1 ] & 0x8 )
- {
- ReadAlign(pS, pS->Tell() - nStart, 2);
- *pS >> nPictureAlignment;
-
- }
- if ( pBlockFlags[ 1 ] & 0x10 )
- {
- bPictureTiling = true;
- }
- if ( pBlockFlags[1] & 0x20 )
- {
- ReadAlign(pS, pS->Tell() - nStart, 4);
- sal_uInt8 nTemp;
- *pS >> nTemp;
- fEnabled = (nTemp&0x02)>>1;
- fBackStyle = (nTemp&0x08)>>3;
- // padding?
- *pS >> nTemp;
- *pS >> nTemp;
- *pS >> nTemp;
- }
- ReadAlign(pS, pS->Tell() - nStart, 4);
- *pS >> nWidth;
- *pS >> nHeight;
-
- if ( hasEmbeddedImage )
- {
- //image follows this block
- //len of image is 0x14 relative to end of this block
- pS->Seek( pS->Tell() + 0x14 );
-
- sal_uInt32 nImageLen = 0;
- *pS >> nImageLen;
-
- long imagePos = pS->Tell();
-
- pS->Seek( imagePos );
-
- sImageUrl = C2U("vnd.sun.star.expand:${$BRAND_BASE_DIR/program/") + C2U( SAL_CONFIGFILE( "bootstrap" ) ) + C2U("::UserInstallation}/user/temp/") + sName;
-
- sal_uInt8* pImage = new sal_uInt8[ nImageLen ];
- pS->Read(pImage, nImageLen);
- bool result = storePictureInFileSystem( sImageUrl, pImage, nImageLen );
- OUString pictName = sImageUrl.copy( sImageUrl.lastIndexOf('/') + 1 );
- result = storePictureInDoc( pDocSh, pictName, pImage, nImageLen );
- delete [] pImage;
- }
- return sal_True;
-}
-
-sal_Bool OCX_Image::Import( uno::Reference< beans::XPropertySet > &rPropSet )
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
-
- if( fBackStyle )
- aTmp <<= ImportColor(mnBackColor);
- else
- aTmp = uno::Any();
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- sal_Bool bTemp;
- if (fEnabled)
- bTemp = sal_True;
- else
- bTemp = sal_False;
- aTmp = bool2any(bTemp);
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
- if ( sImageUrl.getLength() )
- {
- aTmp <<= sImageUrl;
- rPropSet->setPropertyValue( WW8_ASCII2STR("ImageURL"), aTmp);
- }
- return sal_True;
-}
-
-sal_Bool OCX_Image::WriteContents(SvStorageStreamRef &rContents,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- sal_Bool bRet=sal_True;
- sal_uInt32 nOldPos = rContents->Tell();
- rContents->SeekRel(8);
-
- pBlockFlags[0] = 0;
- pBlockFlags[1] = 0x02;
- pBlockFlags[2] = 0;
- pBlockFlags[3] = 0;
-
- uno::Any aTmp = rPropSet->getPropertyValue(
- WW8_ASCII2STR("BackgroundColor"));
- if (aTmp.hasValue())
- aTmp >>= mnBackColor;
- *rContents << ExportColor(mnBackColor);
- pBlockFlags[0] |= 0x10;
-
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Border"));
- sal_Int16 nBorder = sal_Int16();
- aTmp >>= nBorder;
- nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
- *rContents << nBorderStyle;
- pBlockFlags[0] |= 0x20;
-
- *rContents << nSpecialEffect;
- pBlockFlags[1] |= 0x01;
-
- WriteAlign(rContents,4);
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
- fEnabled = any2bool(aTmp);
- if (fEnabled)
- {
- sal_uInt8 nTemp = 0x19;
- *rContents << nTemp;
- pBlockFlags[1] |= 0x20;
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
- *rContents << sal_uInt8(0x00);
- }
-
- aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("ImageURL"));
-// OUString *pStr = (OUString *)aTmp.getValue();
- /*Magically fetch that image and turn it into something that
- *we can store in ms controls, wmf,png,jpg are almost certainly
- *the options we have for export...*/
-
- WriteAlign(rContents,4);
- *rContents << rSize.Width;
- *rContents << rSize.Height;
-
- WriteAlign(rContents,4);
- nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
- rContents->Seek(nOldPos);
- *rContents << nStandardId;
- *rContents << nFixedAreaLen;
-
- *rContents << pBlockFlags[0];
- *rContents << pBlockFlags[1];
- *rContents << pBlockFlags[2];
- *rContents << pBlockFlags[3];
- DBG_ASSERT((rContents.Is() &&
- (SVSTREAM_OK==rContents->GetError())),"damn");
- return bRet;
-}
-
-
-sal_Bool OCX_Image::Export(SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet > &rPropSet,
- const awt::Size &rSize)
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] = {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x92, 0x59, 0x4C,
- 0x26, 0x69, 0x1B, 0x10, 0x99, 0x92, 0x00, 0x00,
- 0x0B, 0x65, 0xC6, 0xF9, 0x1A, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x49, 0x6D, 0x61, 0x67,
- 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
- 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
- 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x0E, 0x00,
- 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
- 0x49, 0x6D, 0x61, 0x67, 0x65, 0x2E, 0x31, 0x00,
- 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] = {
- 0x49, 0x00, 0x6D, 0x00, 0x61, 0x00, 0x67, 0x00,
- 0x65, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-// ============================================================================
-
-OCX_SpinButton::OCX_SpinButton() :
- OCX_Control( OUString( RTL_CONSTASCII_USTRINGPARAM( "SpinButton" ) ) ),
- mnBlockFlags( 0 ),
- mnValue( 0 ),
- mnMin( 0 ),
- mnMax( 100 ),
- mnSmallStep( 1 ),
- mnPageStep( 1 ),
- mnOrient( -1 ),
- mnDelay( 50 ),
- mbEnabled( true ),
- mbLocked( false ),
- mbPropThumb( true )
-{
- msFormType = C2U("com.sun.star.form.component.SpinButton");
- msDialogType = C2U("com.sun.star.awt.UnoControlSpinButtonModel");
- mnBackColor = 0x8000000F;
- mnForeColor = 0x80000012;
-}
-
-OCX_Control* OCX_SpinButton::Create()
-{
- return new OCX_SpinButton;
-}
-
-sal_Bool OCX_SpinButton::Read( SvStorageStream *pS )
-{
- if( !pS ) return sal_False;
-
- SvStream& rStrm = *pS;
- sal_uInt16 nId, nSize;
- sal_Int32 nIcon = 0;
-
- rStrm >> nId >> nSize >> mnBlockFlags;
-
- DBG_ASSERT( nStandardId == nId, "OCX_SpinButton::Read - unknown identifier" );
-
- if( mnBlockFlags & 0x00000001 ) rStrm >> mnForeColor;
- if( mnBlockFlags & 0x00000002 ) rStrm >> mnBackColor;
- if( mnBlockFlags & 0x00000004 )
- {
- sal_Int32 nFlags;
- rStrm >> nFlags;
- mbEnabled = (nFlags & 0x00000002) != 0;
- mbLocked = (nFlags & 0x00000004) != 0;
- }
- if( mnBlockFlags & 0x00000010 ) rStrm.SeekRel( 4 ); // mouse pointer
- if( mnBlockFlags & 0x00000020 ) rStrm >> mnMin;
- if( mnBlockFlags & 0x00000040 ) rStrm >> mnMax;
- if( mnBlockFlags & 0x00000080 ) rStrm >> mnValue;
- if( mnBlockFlags & 0x00000100 ) rStrm.SeekRel( 4 ); // unknown
- if( mnBlockFlags & 0x00000200 ) rStrm.SeekRel( 4 ); // unknown
- if( mnBlockFlags & 0x00000400 ) rStrm.SeekRel( 4 ); // unknown
- if( mnBlockFlags & 0x00000800 ) rStrm >> mnSmallStep;
- if( mnBlockFlags & 0x00001000 ) rStrm >> mnPageStep;
- if( mnBlockFlags & 0x00002000 ) rStrm >> mnOrient;
- if( mnBlockFlags & 0x00004000 )
- {
- sal_Int32 nThumb;
- *pS >> nThumb;
- mbPropThumb = nThumb != 0;
- }
- if( mnBlockFlags & 0x00008000 ) rStrm >> mnDelay;
- if( mnBlockFlags & 0x00010000 ) rStrm >> nIcon;
- if( mnBlockFlags & 0x00000008 ) rStrm >> nWidth >> nHeight;
-
- if( nIcon )
- {
- sal_Int32 nIconSize;
- pS->SeekRel( 20 );
- *pS >> nIconSize;
- pS->SeekRel( nIconSize );
- }
-
- return sal_True;
-}
-
-sal_Bool OCX_SpinButton::ReadFontData( SvStorageStream* /* pS */ )
-{
- // spin buttons and scroll bars do not support font data
- return sal_True;
-}
-
-sal_Bool OCX_SpinButton::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- if( (nWidth < 1) || (nHeight < 1) )
- return sal_False;
-
- uno::Any aTmp( &sName, getCppuType((OUString *)0) );
- rPropSet->setPropertyValue( WW8_ASCII2STR( "Name" ), aTmp );
-
- aTmp <<= ImportColor( mnForeColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("SymbolColor"), aTmp);
-
- aTmp <<= ImportColor( mnBackColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp = bool2any( mbEnabled && !mbLocked );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- aTmp <<= mnValue;
- if ( bSetInDialog )
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("SpinValue"), aTmp );
- }
- else
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultSpinValue"), aTmp );
- }
-
- aTmp <<= mnMin;
- rPropSet->setPropertyValue( WW8_ASCII2STR("SpinValueMin"), aTmp );
-
- aTmp <<= mnMax;
- rPropSet->setPropertyValue( WW8_ASCII2STR("SpinValueMax"), aTmp );
-
- aTmp <<= mnSmallStep;
- rPropSet->setPropertyValue( WW8_ASCII2STR("SpinIncrement"), aTmp );
-
- namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
- switch( mnOrient )
- {
- case 0: aTmp <<= AwtScrollOrient::VERTICAL; break;
- case 1: aTmp <<= AwtScrollOrient::HORIZONTAL; break;
- default: aTmp <<= (nWidth < nHeight) ? AwtScrollOrient::VERTICAL : AwtScrollOrient::HORIZONTAL;
- }
- rPropSet->setPropertyValue( WW8_ASCII2STR("Orientation"), aTmp );
-
- aTmp = bool2any( true );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Repeat"), aTmp );
-
- aTmp <<= mnDelay;
- rPropSet->setPropertyValue( WW8_ASCII2STR("RepeatDelay"), aTmp );
-
- aTmp <<= sal_Int16( 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
-
- return sal_True;
-}
-
-sal_Bool OCX_SpinButton::Export(
- SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet>& rPropSet,
- const awt::Size& rSize )
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] =
- {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x6F, 0x17, 0x79,
- 0xF2, 0xB7, 0xCE, 0x11, 0x97, 0xEF, 0x00, 0xAA,
- 0x00, 0x6D, 0x27, 0x76, 0x1F, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x53, 0x70, 0x69, 0x6E,
- 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x00, 0x10,
- 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64,
- 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65,
- 0x63, 0x74, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46,
- 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E,
- 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] =
- {
- 0x53, 0x00, 0x70, 0x00, 0x69, 0x00, 0x6E, 0x00,
- 0x42, 0x00, 0x75, 0x00, 0x74, 0x00, 0x74, 0x00,
- 0x6F, 0x00, 0x6E, 0x00, 0x31, 0x00, 0x00, 0x00,
- 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_SpinButton::WriteContents(
- SvStorageStreamRef &rObj,
- const uno::Reference< beans::XPropertySet> &rPropSet,
- const awt::Size& rSize )
-{
- if( !rObj.Is() )
- return sal_False;
-
- mnBlockFlags = 0x00000008;
- nWidth = rSize.Width;
- nHeight = rSize.Height;
-
- GetInt32Property( mnForeColor, rPropSet, WW8_ASCII2STR( "SymbolColor" ), 0x00000001 );
- GetInt32Property( mnBackColor, rPropSet, WW8_ASCII2STR( "BackgroundColor" ), 0x00000002 );
- GetBoolProperty( mbEnabled, rPropSet, WW8_ASCII2STR( "Enabled" ), 0x00000304 );
- GetInt32Property( mnMin, rPropSet, WW8_ASCII2STR( "SpinValueMin" ), 0x00000020 );
- GetInt32Property( mnMax, rPropSet, WW8_ASCII2STR( "SpinValueMax" ), 0x00000040 );
- GetInt32Property( mnValue, rPropSet, WW8_ASCII2STR( "SpinValue" ), 0x00000080 );
- GetInt32Property( mnSmallStep, rPropSet, WW8_ASCII2STR( "SpinIncrement" ), 0x00000800 );
- GetInt32Property( mnDelay, rPropSet, WW8_ASCII2STR( "RepeatDelay" ), 0x00008000 );
-
- namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
- sal_Int16 nApiOrient = sal_Int16();
- if( rPropSet->getPropertyValue( WW8_ASCII2STR( "Orientation" ) ) >>= nApiOrient )
- UpdateInt32Property( mnOrient, (nApiOrient == AwtScrollOrient::VERTICAL) ? 0 : 1, 0x00002000 );
-
- return WriteData( *rObj );
-}
-
-void OCX_SpinButton::UpdateInt32Property(
- sal_Int32& rnCoreValue, sal_Int32 nNewValue, sal_Int32 nBlockFlag )
-{
- if( nNewValue != rnCoreValue )
- {
- rnCoreValue = nNewValue;
- mnBlockFlags |= nBlockFlag;
- }
-}
-
-void OCX_SpinButton::GetInt32Property(
- sal_Int32& rnCoreValue, const uno::Reference< beans::XPropertySet>& rxPropSet,
- const OUString& rPropName, sal_Int32 nBlockFlag )
-{
- sal_Int32 nNewValue = 0;
- if( rxPropSet->getPropertyValue( rPropName ) >>= nNewValue )
- UpdateInt32Property( rnCoreValue, nNewValue, nBlockFlag );
-}
-
-void OCX_SpinButton::UpdateBoolProperty(
- bool& rbCoreValue, bool bNewValue, sal_Int32 nBlockFlag )
-{
- if( bNewValue != rbCoreValue )
- {
- rbCoreValue = bNewValue;
- mnBlockFlags |= nBlockFlag;
- }
-}
-
-void OCX_SpinButton::GetBoolProperty(
- bool& rbCoreValue, const uno::Reference< beans::XPropertySet>& rxPropSet,
- const OUString& rPropName, sal_Int32 nBlockFlag )
-{
- UpdateBoolProperty( rbCoreValue,
- any2bool( rxPropSet->getPropertyValue( rPropName ) ), nBlockFlag );
-}
-
-sal_Bool OCX_SpinButton::WriteData( SvStream& rStrm ) const
-{
- sal_Bool bRet = sal_True;
- ULONG nStartPos = rStrm.Tell();
-
- rStrm << sal_Int32( 0 ) << mnBlockFlags;
-
- if( mnBlockFlags & 0x00000001 ) rStrm << ExportColor( mnForeColor );
- if( mnBlockFlags & 0x00000002 ) rStrm << ExportColor( mnBackColor );
- if( mnBlockFlags & 0x00000004 )
- {
- sal_Int32 nFlags = 0x00000019; // always set
- if( mbEnabled ) nFlags |= 0x00000002;
- if( mbLocked ) nFlags |= 0x00000004;
- rStrm << nFlags;
- }
- if( mnBlockFlags & 0x00000020 ) rStrm << mnMin;
- if( mnBlockFlags & 0x00000040 ) rStrm << mnMax;
- if( mnBlockFlags & 0x00000080 ) rStrm << mnValue;
- if( mnBlockFlags & 0x00000100 ) rStrm << sal_Int32( 0 ); // unknown
- if( mnBlockFlags & 0x00000200 ) rStrm << sal_Int32( 0 ); // unknown
- if( mnBlockFlags & 0x00000400 ) rStrm << sal_Int32( 0 ); // unknown
- if( mnBlockFlags & 0x00000800 ) rStrm << mnSmallStep;
- if( mnBlockFlags & 0x00001000 ) rStrm << mnPageStep;
- if( mnBlockFlags & 0x00002000 ) rStrm << mnOrient;
- if( mnBlockFlags & 0x00004000 ) rStrm << sal_Int32( mbPropThumb ? 1 : 0 );
- if( mnBlockFlags & 0x00008000 ) rStrm << mnDelay;
- if( mnBlockFlags & 0x00000008 ) rStrm << nWidth << nHeight;
-
- sal_uInt16 nSize = static_cast< sal_uInt16 >( rStrm.Tell() - nStartPos - 4 );
- rStrm.Seek( nStartPos );
- rStrm << nStandardId << nSize;
-
- DBG_ASSERT( rStrm.GetError() == SVSTREAM_OK, "OCX_SpinButton::WriteData - error in stream" );
- return bRet;
-}
-
-// ============================================================================
-
-OCX_ScrollBar::OCX_ScrollBar()
-{
- sName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollBar" ) );
- mnMax = 32767;
- msFormType = C2U("com.sun.star.form.component.ScrollBar");
- msDialogType = C2U("com.sun.star.awt.UnoControlScrollBarModel");
-
-}
-
-OCX_Control* OCX_ScrollBar::Create()
-{
- return new OCX_ScrollBar;
-}
-
-sal_Bool OCX_ScrollBar::Import(com::sun::star::uno::Reference<
- com::sun::star::beans::XPropertySet> &rPropSet)
-{
- if( (nWidth < 1) || (nHeight < 1) )
- return sal_False;
-
- uno::Any aTmp( &sName, getCppuType((OUString *)0) );
- rPropSet->setPropertyValue( WW8_ASCII2STR( "Name" ), aTmp );
-
- aTmp <<= ImportColor( mnForeColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("SymbolColor"), aTmp);
-
- aTmp <<= ImportColor( mnBackColor );
- rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
-
- aTmp = bool2any( mbEnabled && !mbLocked );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
-
- aTmp <<= mnValue;
- if ( bSetInDialog )
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("ScrollValue"), aTmp );
- }
- else
- {
- rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultScrollValue"), aTmp );
- }
-
- aTmp <<= mnMin;
- rPropSet->setPropertyValue( WW8_ASCII2STR("ScrollValueMin"), aTmp );
-
- aTmp <<= mnMax;
- rPropSet->setPropertyValue( WW8_ASCII2STR("ScrollValueMax"), aTmp );
-
- aTmp <<= mnSmallStep;
- rPropSet->setPropertyValue( WW8_ASCII2STR("LineIncrement"), aTmp );
-
- aTmp <<= mnPageStep;
- rPropSet->setPropertyValue( WW8_ASCII2STR("BlockIncrement"), aTmp );
- if( mbPropThumb && (mnPageStep > 0) )
- rPropSet->setPropertyValue( WW8_ASCII2STR("VisibleSize"), aTmp );
-
- namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
- switch( mnOrient )
- {
- case 0: aTmp <<= AwtScrollOrient::VERTICAL; break;
- case 1: aTmp <<= AwtScrollOrient::HORIZONTAL; break;
- default: aTmp <<= (nWidth < nHeight) ? AwtScrollOrient::VERTICAL : AwtScrollOrient::HORIZONTAL;
- }
- rPropSet->setPropertyValue( WW8_ASCII2STR("Orientation"), aTmp );
-
- aTmp <<= mnDelay;
- rPropSet->setPropertyValue( WW8_ASCII2STR("RepeatDelay"), aTmp );
-
- aTmp <<= sal_Int16( 0 );
- rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
-
- return sal_True;
-}
-
-sal_Bool OCX_ScrollBar::Export(
- SvStorageRef &rObj,
- const uno::Reference< beans::XPropertySet>& rPropSet,
- const awt::Size& rSize )
-{
- static sal_uInt8 __READONLY_DATA aCompObj[] =
- {
- 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x81, 0xD1, 0xDF,
- 0x2F, 0x5E, 0xCE, 0x11, 0xA4, 0x49, 0x00, 0xAA,
- 0x00, 0x4A, 0x80, 0x3D, 0x1E, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
- 0x32, 0x2E, 0x30, 0x20, 0x53, 0x63, 0x72, 0x6F,
- 0x6C, 0x6C, 0x42, 0x61, 0x72, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64,
- 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63,
- 0x74, 0x00, 0x12, 0x00, 0x00, 0x00, 0x46, 0x6F,
- 0x72, 0x6D, 0x73, 0x2E, 0x53, 0x63, 0x72, 0x6F,
- 0x6C, 0x6C, 0x42, 0x61, 0x72, 0x2E, 0x31, 0x00,
- 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor( rObj->OpenSotStream( C2S("\1CompObj")));
- xStor->Write(aCompObj,sizeof(aCompObj));
- DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
- }
-
- {
- SvStorageStreamRef xStor3( rObj->OpenSotStream( C2S("\3ObjInfo")));
- xStor3->Write(aObjInfo,sizeof(aObjInfo));
- DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
- }
-
- static sal_uInt8 __READONLY_DATA aOCXNAME[] =
- {
- 0x53, 0x00, 0x63, 0x00, 0x72, 0x00, 0x6F, 0x00,
- 0x6C, 0x00, 0x6C, 0x00, 0x42, 0x00, 0x61, 0x00,
- 0x72, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- {
- SvStorageStreamRef xStor2( rObj->OpenSotStream( C2S("\3OCXNAME")));
- xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
- DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
- }
-
- SvStorageStreamRef xContents( rObj->OpenSotStream( C2S("contents")));
- return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_ScrollBar::WriteContents(
- SvStorageStreamRef &rObj,
- const uno::Reference< beans::XPropertySet> &rPropSet,
- const awt::Size& rSize )
-{
- if( !rObj.Is() )
- return sal_False;
-
- mnBlockFlags = 0x00000008;
- nWidth = rSize.Width;
- nHeight = rSize.Height;
-
- GetInt32Property( mnForeColor, rPropSet, WW8_ASCII2STR( "SymbolColor" ), 0x00000001 );
- GetInt32Property( mnBackColor, rPropSet, WW8_ASCII2STR( "BackgroundColor" ), 0x00000002 );
- GetBoolProperty( mbEnabled, rPropSet, WW8_ASCII2STR( "Enabled" ), 0x00000304 );
- GetInt32Property( mnMin, rPropSet, WW8_ASCII2STR( "ScrollValueMin" ), 0x00000020 );
- GetInt32Property( mnMax, rPropSet, WW8_ASCII2STR( "ScrollValueMax" ), 0x00000040 );
- GetInt32Property( mnValue, rPropSet, WW8_ASCII2STR( "ScrollValue" ), 0x00000080 );
- GetInt32Property( mnSmallStep, rPropSet, WW8_ASCII2STR( "LineIncrement" ), 0x00000800 );
- GetInt32Property( mnPageStep, rPropSet, WW8_ASCII2STR( "BlockIncrement" ), 0x00001000 );
- GetInt32Property( mnDelay, rPropSet, WW8_ASCII2STR( "RepeatDelay" ), 0x00008000 );
-
- namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation;
- sal_Int16 nApiOrient = sal_Int16();
- if( rPropSet->getPropertyValue( WW8_ASCII2STR( "Orientation" ) ) >>= nApiOrient )
- UpdateInt32Property( mnOrient, (nApiOrient == AwtScrollOrient::VERTICAL) ? 0 : 1, 0x00002000 );
-
- UpdateBoolProperty( mbPropThumb, true, 0x00004000 );
-
- return WriteData( *rObj );
-}
-
-OCX_ProgressBar::OCX_ProgressBar() :
- OCX_Control( OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressBar" ) ) ),
- nMin( 0 ),
- nMax( 0 ),
- bFixedSingle(true),
- bEnabled( true ),
- b3d( true )
-{
- msDialogType = C2U("com.sun.star.awt.UnoControlProgressBarModel");
- bSetInDialog = true;
-}
-
-sal_Bool OCX_ProgressBar::Read( SvStorageStream *pS )
-{
- pS->SeekRel( 8 );
- *pS >> nWidth >> nHeight;
- pS->SeekRel( 12 );
-
- float fMin, fMax;
- *pS >> fMin >> fMax;
- nMin = static_cast< sal_Int32 >( fMin );
- nMax = static_cast< sal_Int32 >( fMax );
- bool bVisible = true;
- sal_uInt8 pUnknownFlags[4];
- pS->Read(pUnknownFlags,4);
-
- // complete guess, but we don't handle visible anyway
- if ( ( pUnknownFlags[2] & 0x8 ) && ( pUnknownFlags[2] & 0x2 ) )
- bVisible = false;
-
- sal_uInt32 nFlags;
- *pS >> nFlags;
-
- // seems these work out
- bFixedSingle = (nFlags & 0x01) != 0;
- bEnabled = (nFlags & 0x02) != 0;
- b3d = (nFlags & 0x04) != 0;
-
- return true;
-}
-
-OCX_Control* OCX_ProgressBar::Create()
-{
- return new OCX_ProgressBar;
-}
-
-sal_Bool OCX_ProgressBar::Import(uno::Reference< beans::XPropertySet > &rPropSet)
-{
- uno::Any aTmp(&sName,getCppuType((OUString *)0));
- rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
- aTmp <<= nMax;
- rPropSet->setPropertyValue( WW8_ASCII2STR("ProgressValueMax"), aTmp );
- aTmp <<= nMin;
- rPropSet->setPropertyValue( WW8_ASCII2STR("ProgressValueMin"), aTmp );
-
- if ( !bEnabled )
- rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), uno::makeAny( sal_False ) );
- return sal_True;
-}
-// ============================================================================
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/msfilter/msoleexp.cxx b/svx/source/msfilter/msoleexp.cxx
deleted file mode 100644
index b01fe6b0f7..0000000000
--- a/svx/source/msfilter/msoleexp.cxx
+++ /dev/null
@@ -1,376 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msoleexp.cxx,v $
- * $Revision: 1.22 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#ifndef _COM_SUN_STAR_EMBED_XEmbedPersist_HPP_
-#include <com/sun/star/embed/XEmbedPersist.hpp>
-#endif
-#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
-#include <com/sun/star/embed/EmbedStates.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/embed/Aspects.hpp>
-
-#ifndef _SO_CLSIDS_HXX
-#include <sot/clsids.hxx>
-#endif
-#include <sfx2/objsh.hxx>
-//#ifndef _SFX_INTERNO_HXX
-//#include <sfx2/interno.hxx>
-//#endif
-#include <sfx2/docfac.hxx>
-#include <sfx2/docfilt.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <sot/formats.hxx>
-#include <comphelper/processfactory.hxx>
-
-#include <unotools/streamwrap.hxx>
-#include <comphelper/storagehelper.hxx>
-#include <svtools/embedhlp.hxx>
-#include <svx/msdffimp.hxx> // extern sichtbare Header-Datei
-
-#include "msoleexp.hxx"
-
-#define CREATE_CONST_ASC(s) String::CreateFromAscii( \
- RTL_CONSTASCII_STRINGPARAM(s))
-
-using namespace ::com::sun::star;
-
-SvGlobalName GetEmbeddedVersion( const SvGlobalName& aAppName )
-{
- if ( aAppName == SvGlobalName( SO3_SM_CLASSID_60 ) )
- return SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 );
- else if ( aAppName == SvGlobalName( SO3_SW_CLASSID_60 ) )
- return SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 );
- else if ( aAppName == SvGlobalName( SO3_SC_CLASSID_60 ) )
- return SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 );
- else if ( aAppName == SvGlobalName( SO3_SDRAW_CLASSID_60 ) )
- return SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 );
- else if ( aAppName == SvGlobalName( SO3_SIMPRESS_CLASSID_60 ) )
- return SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 );
- else if ( aAppName == SvGlobalName( SO3_SCH_CLASSID_60 ) )
- return SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 );
-
- return SvGlobalName();
-}
-
-String GetStorageType( const SvGlobalName& aEmbName )
-{
- if ( aEmbName == SvGlobalName( SO3_SM_OLE_EMBED_CLASSID_8 ) )
- return String::CreateFromAscii( "opendocument.MathDocument.1" );
- else if ( aEmbName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_8 ) )
- return String::CreateFromAscii( "opendocument.WriterDocument.1" );
- else if ( aEmbName == SvGlobalName( SO3_SC_OLE_EMBED_CLASSID_8 ) )
- return String::CreateFromAscii( "opendocument.CalcDocument.1" );
- else if ( aEmbName == SvGlobalName( SO3_SDRAW_OLE_EMBED_CLASSID_8 ) )
- return String::CreateFromAscii( "opendocument.DrawDocument.1" );
- else if ( aEmbName == SvGlobalName( SO3_SIMPRESS_OLE_EMBED_CLASSID_8 ) )
- return String::CreateFromAscii( "opendocument.ImpressDocument.1" );
- else if ( aEmbName == SvGlobalName( SO3_SCH_OLE_EMBED_CLASSID_8 ) )
- return String::CreateFromAscii( "opendocument.ChartDocument.1" );
-
- return String();
-}
-
-sal_Bool UseOldMSExport()
-{
- uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
-
- if ( xFactory.is() )
- {
- uno::Reference< lang::XMultiServiceFactory > xProvider( xFactory->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider"))),
- uno::UNO_QUERY);
- if ( xProvider.is() )
- {
- try {
- uno::Sequence< uno::Any > aArg( 1 );
- aArg[0] <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/InternalMSExport") );
- uno::Reference< container::XNameAccess > xNameAccess(
- xProvider->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ),
- aArg ),
- uno::UNO_QUERY );
- if ( xNameAccess.is() )
- {
- uno::Any aResult = xNameAccess->getByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseOldExport" ) ) );
-
- sal_Bool bResult = sal_Bool();
- if ( aResult >>= bResult )
- return bResult;
- }
- }
- catch( uno::Exception& )
- {
- }
- }
- }
-
- OSL_ENSURE( sal_False, "Could not get access to configuration entry!\n" );
- return sal_False;
-}
-
-void SvxMSExportOLEObjects::ExportOLEObject( const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject>& rObj, SotStorage& rDestStg )
-{
- svt::EmbeddedObjectRef aObj( rObj, embed::Aspects::MSOLE_CONTENT );
- ExportOLEObject( aObj, rDestStg );
-}
-
-void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SvStorage& rDestStg )
-{
- SvGlobalName aOwnGlobalName;
- SvGlobalName aObjName( rObj->getClassID() );
- const SfxFilter* pExpFilter = NULL;
- {
- static struct _ObjExpType {
- UINT32 nFlag;
- const char* pFilterNm;
- // GlobalNameId
- struct _GlobalNameIds {
- UINT32 n1;
- USHORT n2, n3;
- BYTE b8, b9, b10, b11, b12, b13, b14, b15;
- }
- aGlNmIds[4];
- } aArr[] = {
- { OLE_STARMATH_2_MATHTYPE, "MathType 3.x",
- {{SO3_SM_CLASSID_60}, {SO3_SM_CLASSID_50},
- {SO3_SM_CLASSID_40}, {SO3_SM_CLASSID_30 }}},
- { OLE_STARWRITER_2_WINWORD, "MS Word 97",
- {{SO3_SW_CLASSID_60}, {SO3_SW_CLASSID_50},
- {SO3_SW_CLASSID_40}, {SO3_SW_CLASSID_30 }}},
- { OLE_STARCALC_2_EXCEL, "MS Excel 97",
- {{SO3_SC_CLASSID_60}, {SO3_SC_CLASSID_50},
- {SO3_SC_CLASSID_40}, {SO3_SC_CLASSID_30 }}},
- { OLE_STARIMPRESS_2_POWERPOINT, "MS PowerPoint 97",
- {{SO3_SIMPRESS_CLASSID_60}, {SO3_SIMPRESS_CLASSID_50},
- {SO3_SIMPRESS_CLASSID_40}, {SO3_SIMPRESS_CLASSID_30 }}},
- { 0, "",
- {{SO3_SCH_CLASSID_60}, {SO3_SCH_CLASSID_50},
- {SO3_SCH_CLASSID_40}, {SO3_SCH_CLASSID_30 }}},
- { 0, "",
- {{SO3_SDRAW_CLASSID_60}, {SO3_SDRAW_CLASSID_50}, // SJ: !!!! SO3_SDRAW_CLASSID is only available up from
- {SO3_SDRAW_CLASSID_60}, {SO3_SDRAW_CLASSID_50 }}}, // ver 5.0, it is purpose to have double entrys here.
-
- { 0xffff,0,
- {{SO3_SDRAW_CLASSID_60}, {SO3_SDRAW_CLASSID_50},
- {SO3_SDRAW_CLASSID_60}, {SO3_SDRAW_CLASSID_50}}}
- };
-
- for( const _ObjExpType* pArr = aArr; !pExpFilter && ( pArr->nFlag != 0xffff ); ++pArr )
- {
- for ( int n = 0; n < 4; ++n )
- {
- const _ObjExpType::_GlobalNameIds& rId = pArr->aGlNmIds[ n ];
- SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3,
- rId.b8, rId.b9, rId.b10, rId.b11,
- rId.b12, rId.b13, rId.b14, rId.b15 );
- if( aObjName == aGlbNm )
- {
- aOwnGlobalName = aGlbNm;
-
- // flags for checking if conversion is wanted at all (SaveOptions?!)
- if( GetFlags() & pArr->nFlag )
- {
- pExpFilter = SfxFilterMatcher().GetFilter4FilterName(String::CreateFromAscii(pArr->pFilterNm));
- break;
- }
- }
- }
- }
- }
-
- if( pExpFilter ) // use this filter for the export
- {
- try
- {
- if ( rObj->getCurrentState() == embed::EmbedStates::LOADED )
- rObj->changeState( embed::EmbedStates::RUNNING );
- //TODO/LATER: is stream instead of outputstream a better choice?!
- //TODO/LATER: a "StoreTo" method at embedded object would be nice
- uno::Sequence < beans::PropertyValue > aSeq(2);
- SvStream* pStream = new SvMemoryStream;
- aSeq[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
- ::uno::Reference < io::XOutputStream > xOut = new ::utl::OOutputStreamWrapper( *pStream );
- aSeq[0].Value <<= xOut;
- aSeq[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
- aSeq[1].Value <<= ::rtl::OUString( pExpFilter->GetName() );
- uno::Reference < frame::XStorable > xStor( rObj->getComponent(), uno::UNO_QUERY );
- xStor->storeToURL( ::rtl::OUString::createFromAscii( "private:stream" ), aSeq );
- SotStorageRef xOLEStor = new SotStorage( pStream, TRUE );
- xOLEStor->CopyTo( &rDestStg );
- rDestStg.Commit();
- }
- catch( uno::Exception& )
- {
- // TODO/LATER: Error handling
- DBG_ERROR( "The object could not be exported!" );
- }
- }
- else if( aOwnGlobalName != SvGlobalName() )
- {
- // own format, maybe SO6 format or lower
- SvGlobalName aEmbName = GetEmbeddedVersion( aOwnGlobalName );
- if ( aEmbName != SvGlobalName() && !UseOldMSExport() )
- {
- // this is a SO6 embedded object, save in old binary format
- rDestStg.SetVersion( SOFFICE_FILEFORMAT_31 );
- rDestStg.SetClass( aEmbName,
- SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE,
- GetStorageType( aEmbName ) );
- SotStorageStreamRef xExtStm = rDestStg.OpenSotStream(
- String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "properties_stream" ) ),
- STREAM_STD_READWRITE );
-
- sal_Bool bExtentSuccess = sal_False;
- if( !xExtStm->GetError() )
- {
- // write extent
- //TODO/MBA: check if writing a size is enough
- if( rObj.GetObject().is() )
- {
- // MSOLE objects don't need to be in running state for VisualArea access
- awt::Size aSize;
- try
- {
- // this is an own object, the content size must be stored in the
- // extension stream
- aSize = rObj->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
- }
- catch( embed::NoVisualAreaSizeException& )
- {
- OSL_ENSURE( sal_False, "Could not get visual area size!\n" );
- aSize.Width = 5000;
- aSize.Height = 5000;
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Unexpected exception while getting visual area size!\n" );
- aSize.Width = 5000;
- aSize.Height = 5000;
- }
-
- //Rectangle aVisArea = xSfxIPObj->GetVisArea( ASPECT_CONTENT );
- sal_Int32 pRect[4];
- //pRect[0] = aVisArea.Left();
- //pRect[1] = aVisArea.Right();
- //pRect[2] = aVisArea.Top();
- //pRect[3] = aVisArea.Bottom();
- pRect[0] = 0;
- pRect[1] = aSize.Width;
- pRect[2] = 0;
- pRect[3] = aSize.Height;
-
- sal_Int8 aWriteSet[16];
- for ( int ind = 0; ind < 4; ind++ )
- {
- sal_Int32 nVal = pRect[ind];
- for ( int nByte = 0; nByte < 4; nByte++ )
- {
- aWriteSet[ind*4+nByte] = (sal_Int8) nVal % 0x100;
- nVal /= 0x100;
- }
- }
-
- bExtentSuccess = ( xExtStm->Write( aWriteSet, 16 ) == 16 );
- }
- }
-
- if ( bExtentSuccess )
- {
- SotStorageStreamRef xEmbStm = rDestStg.OpenSotStream(
- String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "package_stream" ) ),
- STREAM_STD_READWRITE );
- if( !xEmbStm->GetError() )
- {
- try
- {
- if ( rObj->getCurrentState() == embed::EmbedStates::LOADED )
- rObj->changeState( embed::EmbedStates::RUNNING );
- //TODO/LATER: is stream instead of outputstream a better choice?!
- //TODO/LATER: a "StoreTo" method at embedded object would be nice
- uno::Sequence < beans::PropertyValue > aSeq(1);
- aSeq[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
- ::uno::Reference < io::XOutputStream > xOut = new ::utl::OOutputStreamWrapper( *xEmbStm );
- aSeq[0].Value <<= xOut;
- uno::Reference < frame::XStorable > xStor( rObj->getComponent(), uno::UNO_QUERY );
- xStor->storeToURL( ::rtl::OUString::createFromAscii( "private:stream" ), aSeq );
- }
- catch( uno::Exception& )
- {
- // TODO/LATER: Error handling
- DBG_ERROR( "The object could not be exported!" );
- }
- }
- }
- }
- else
- {
- DBG_ERROR("Own binary format inside own container document!");
- }
- }
- else
- {
- // alien objects
- //TODO/LATER: a "StoreTo" method at embedded object would be nice
- rDestStg.SetVersion( SOFFICE_FILEFORMAT_31 );
- uno::Reference < embed::XStorage > xStor = ::comphelper::OStorageHelper::GetTemporaryStorage();
- uno::Reference < embed::XEmbedPersist > xPers( rObj.GetObject(), uno::UNO_QUERY );
- if ( xPers.is() )
- {
- uno::Sequence < beans::PropertyValue > aEmptySeq;
- ::rtl::OUString aTempName(::rtl::OUString::createFromAscii("bla"));
- try
- {
- xPers->storeToEntry( xStor, aTempName, aEmptySeq, aEmptySeq );
- }
- catch ( uno::Exception& )
- {}
-
- SotStorageRef xOLEStor = SotStorage::OpenOLEStorage( xStor, aTempName, STREAM_STD_READ );
- xOLEStor->CopyTo( &rDestStg );
- rDestStg.Commit();
- }
- }
-
- //We never need this stream: See #99809# and #i2179#
- rDestStg.Remove(CREATE_CONST_ASC(SVEXT_PERSIST_STREAM));
-}
-
-
-
diff --git a/svx/source/msfilter/msvbahelper.cxx b/svx/source/msfilter/msvbahelper.cxx
deleted file mode 100644
index 2f9c330d91..0000000000
--- a/svx/source/msfilter/msvbahelper.cxx
+++ /dev/null
@@ -1,384 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile:
- * $Revision:
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_svx.hxx"
-#include <svx/msvbahelper.hxx>
-#include <basic/sbx.hxx>
-#include <basic/sbstar.hxx>
-#include <basic/basmgr.hxx>
-#include <basic/sbmod.hxx>
-#include <basic/sbmeth.hxx>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
-#include <tools/urlobj.hxx>
-#include <osl/file.hxx>
-
-using namespace ::com::sun::star;
-
-const static rtl::OUString sUrlPart0 = rtl::OUString::createFromAscii( "vnd.sun.star.script:");
-const static rtl::OUString sUrlPart1 = rtl::OUString::createFromAscii( "?language=Basic&location=document");
-
-namespace ooo { namespace vba {
-
-String makeMacroURL( const String& sMacroName )
-{
- return sUrlPart0.concat( sMacroName ).concat( sUrlPart1 ) ;
-}
-
-SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
-{
- SfxObjectShell* pFoundShell=NULL;
- SfxObjectShell* pShell = SfxObjectShell::GetFirst();
- INetURLObject aObj;
- aObj.SetURL( sMacroURLOrPath );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- rtl::OUString aURL;
- if ( bIsURL )
- aURL = sMacroURLOrPath;
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sMacroURLOrPath, aURL );
- aObj.SetURL( aURL );
- }
- OSL_TRACE("Trying to find shell for url %s", rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr() );
- while ( pShell )
- {
-
- uno::Reference< frame::XModel > xModel = pShell->GetModel();
- // are we searching for a template? if so we have to cater for the
- // fact that in openoffice a document opened from a template is always
- // a new document :/
- if ( xModel.is() )
- {
- OSL_TRACE("shell 0x%x has model with url %s and we look for %s", pShell
- , rtl::OUStringToOString( xModel->getURL(), RTL_TEXTENCODING_UTF8 ).getStr()
- , rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr()
- );
- if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
- {
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( xModel, uno::UNO_QUERY );
- if( xDocInfoSupp.is() )
- {
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- rtl::OUString sCurrName = xDocProps->getTemplateName();
- if( sMacroURLOrPath.lastIndexOf( sCurrName ) >= 0 )
- {
- pFoundShell = pShell;
- break;
- }
- }
- }
- else
- {
- if ( aURL.equals( xModel->getURL() ) )
- {
- pFoundShell = pShell;
- break;
- }
- }
- }
- pShell = SfxObjectShell::GetNext( *pShell );
- }
- return pFoundShell;
-}
-
-// sMod can be empty ( but we really need the library to search in )
-// if sMod is empty and a macro is found then sMod is updated
-bool hasMacro( SfxObjectShell* pShell, const String& sLibrary, String& sMod, const String& sMacro )
-{
- bool bFound = false;
- if ( sLibrary.Len() && sMacro.Len() )
- {
- OSL_TRACE("** Searching for %s.%s in library %s"
- ,rtl::OUStringToOString( sMod, RTL_TEXTENCODING_UTF8 ).getStr()
- ,rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr()
- ,rtl::OUStringToOString( sLibrary, RTL_TEXTENCODING_UTF8 ).getStr() );
- BasicManager* pBasicMgr = pShell-> GetBasicManager();
- if ( pBasicMgr )
- {
- StarBASIC* pBasic = pBasicMgr->GetLib( sLibrary );
- if ( !pBasic )
- {
- USHORT nId = pBasicMgr->GetLibId( sLibrary );
- pBasicMgr->LoadLib( nId );
- pBasic = pBasicMgr->GetLib( sLibrary );
- }
- if ( pBasic )
- {
- if ( sMod.Len() ) // we wish to find the macro is a specific module
- {
- SbModule* pModule = pBasic->FindModule( sMod );
- if ( pModule )
- {
- SbxArray* pMethods = pModule->GetMethods();
- if ( pMethods )
- {
- SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( sMacro, SbxCLASS_METHOD ) );
- if ( pMethod )
- bFound = true;
- }
- }
- }
- else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
- {
- if( SbModule* pModule = pMethod->GetModule() )
- {
- sMod = pModule->GetName();
- bFound = true;
- }
- }
- }
- }
- }
- return bFound;
-}
-void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModule, String& sProcedure )
-{
- sal_Int32 nMacroDot = sMacro.lastIndexOf( '.' );
-
- if ( nMacroDot != -1 )
- {
- sProcedure = sMacro.copy( nMacroDot + 1 );
-
- sal_Int32 nContainerDot = sMacro.lastIndexOf( '.', nMacroDot - 1 );
- if ( nContainerDot != -1 )
- {
- sModule = sMacro.copy( nContainerDot + 1, nMacroDot - nContainerDot - 1 );
- sContainer = sMacro.copy( 0, nContainerDot );
- }
- else
- sModule = sMacro.copy( 0, nMacroDot );
- }
- else
- sProcedure = sMacro;
-}
-
-VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
-{
- VBAMacroResolvedInfo aRes;
- if ( !pShell )
- return aRes;
- aRes.SetMacroDocContext( pShell );
- // parse the macro name
- sal_Int32 nDocSepIndex = MacroName.indexOfAsciiL( "!", 1 );
- String sMacroUrl = MacroName;
-
- String sContainer;
- String sModule;
- String sProcedure;
-
- if( nDocSepIndex > 0 )
- {
- // macro specified by document name
- // find document shell for document name and call ourselves
- // recursively
-
- // assume for now that the document name is *this* document
- String sDocUrlOrPath = MacroName.copy( 0, nDocSepIndex );
- sMacroUrl = MacroName.copy( nDocSepIndex + 1 );
- OSL_TRACE("doc search, current shell is 0x%x", pShell );
- SfxObjectShell* pFoundShell = findShellForUrl( sDocUrlOrPath );
- OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell );
- aRes = resolveVBAMacro( pFoundShell, sMacroUrl );
- }
- else
- {
- // macro is contained in 'this' document ( or code imported from a template
- // where that template is a global template or perhaps the template this
- // document is created from )
-
- // macro format = Container.Module.Procedure
- parseMacro( MacroName, sContainer, sModule, sProcedure );
- uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
- uno::Reference< container::XNameContainer > xPrjNameCache;
- if ( xSF.is() )
- xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
-
- std::vector< rtl::OUString > sSearchList;
-
- if ( sContainer.Len() > 0 )
- {
- // get the Project associated with the Container
- if ( xPrjNameCache.is() )
- {
- if ( xPrjNameCache->hasByName( sContainer ) )
- {
- rtl::OUString sProject;
- xPrjNameCache->getByName( sContainer ) >>= sProject;
- sContainer = sProject;
- }
- }
- sSearchList.push_back( sContainer ); // First Lib to search
- }
- else
- {
- // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
- // get the name of Project/Library for 'this' document
- rtl::OUString sThisProject;
- BasicManager* pBasicMgr = pShell-> GetBasicManager();
- if ( pBasicMgr )
- {
- if ( pBasicMgr->GetName().Len() )
- sThisProject = pBasicMgr->GetName();
- else // cater for the case where VBA is not enabled
- sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
- }
- sSearchList.push_back( sThisProject ); // First Lib to search
- if ( xPrjNameCache.is() )
- {
- // is this document created from a template?
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
-
- rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
- if ( sCreatedFrom.getLength() )
- {
- INetURLObject aObj;
- aObj.SetURL( sCreatedFrom );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- rtl::OUString aURL;
- if ( bIsURL )
- aURL = sCreatedFrom;
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
- aObj.SetURL( aURL );
- }
- sCreatedFrom = aObj.GetLastName();
- }
-
- sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
- if ( nIndex != -1 )
- sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
-
- rtl::OUString sPrj;
- if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
- {
- xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
-
- // get list of global template Names
- uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
- sal_Int32 nLen = sTemplateNames.getLength();
- for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
- {
-
- if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
- {
- if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
- {
- xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
- }
-
- }
- }
- }
- std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
- for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); it != it_end; ++it )
- {
- bool bRes = hasMacro( pShell, *it, sModule, sProcedure );
- if ( bRes )
- {
- aRes.SetResolved( true );
- aRes.SetMacroDocContext( pShell );
- sContainer = *it;
- break;
- }
- }
- }
- aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) );
-
- return aRes;
-}
-
-// Treat the args as possible inouts ( convertion at bottom of method )
-sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& /*aRet*/, const uno::Any& aCaller )
-{
- sal_Bool bRes = sal_False;
- if ( !pShell )
- return bRes;
- rtl::OUString sUrl = makeMacroURL( sMacroName );
-
- uno::Sequence< sal_Int16 > aOutArgsIndex;
- uno::Sequence< uno::Any > aOutArgs;
-
- try
- {
- uno::Reference< script::provider::XScriptProvider > xScriptProvider;
- uno::Reference< script::provider::XScriptProviderSupplier > xSPS( pShell->GetModel(), uno::UNO_QUERY_THROW );
-
- xScriptProvider.set( xSPS->getScriptProvider(), uno::UNO_QUERY_THROW );
-
- uno::Reference< script::provider::XScript > xScript( xScriptProvider->getScript( sUrl ), uno::UNO_QUERY_THROW );
-
- if ( aCaller.hasValue() )
- {
- uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
- if ( xProps.is() )
- {
- uno::Sequence< uno::Any > aCallerHack(1);
- aCallerHack[ 0 ] = aCaller;
- xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
- }
- }
-
-
- xScript->invoke( aArgs, aOutArgsIndex, aOutArgs );
-
- sal_Int32 nLen = aOutArgs.getLength();
- // convert any out params to seem like they were inouts
- if ( nLen )
- {
- for ( sal_Int32 index=0; index < nLen; ++index )
- {
- sal_Int32 nOutIndex = aOutArgsIndex[ index ];
- aArgs[ nOutIndex ] = aOutArgs[ index ];
- }
- }
-
- bRes = sal_True;
- }
- catch ( uno::Exception& e )
- {
- bRes = sal_False;
- }
- return bRes;
-}
-} } // vba // ooo
diff --git a/svx/source/msfilter/msvbasic.cxx b/svx/source/msfilter/msvbasic.cxx
deleted file mode 100644
index b8df285fbe..0000000000
--- a/svx/source/msfilter/msvbasic.cxx
+++ /dev/null
@@ -1,677 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msvbasic.cxx,v $
- * $Revision: 1.22 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-
-#include <string.h> // memset(), ...
-#ifndef UNX
-#include <io.h> // access()
-#endif
-#include <osl/endian.h>
-#include <rtl/tencinfo.h> //rtl_getTextEncodingFromWindowsCodePage
-#include "msvbasic.hxx"
-
-/*
-A few urls which may in the future be of some use
-http://www.virusbtn.com/vb2000/Programme/papers/bontchev.pdf
-*/
-
-/* class VBA_Impl:
- * The VBA class provides a set of methods to handle Visual Basic For
- * Applications streams, the constructor is given the root ole2 stream
- * of the document, Open reads the VBA project file and figures out
- * the number of VBA streams, and the offset of the data within them.
- * Decompress decompresses a particular numbered stream, NoStreams returns
- * this number, and StreamName can give you the streams name. Decompress
- * will call Output when it has a 4096 byte collection of data to output,
- * and also with the final remainder of data if there is still some left
- * at the end of compression. Output is virtual to allow custom handling
- * of each chunk of decompressed data. So inherit from this to do something
- * useful with the data.
- *
- * cmc
- * */
-const int MINVBASTRING = 6;
-
-VBA_Impl::VBA_Impl(SvStorage &rIn, bool bCmmntd)
- : aVBAStrings(0),
- sComment(RTL_CONSTASCII_USTRINGPARAM("Rem ")),
- xStor(&rIn), pOffsets(0), nOffsets(0), meCharSet(RTL_TEXTENCODING_MS_1252),
- bCommented(bCmmntd), mbMac(false), nLines(0)
-{
-}
-
-VBA_Impl::~VBA_Impl()
-{
- delete [] pOffsets;
- for (ULONG i=0;i<aVBAStrings.GetSize();++i)
- delete aVBAStrings.Get(i);
-}
-
-sal_uInt8 VBA_Impl::ReadPString(SvStorageStreamRef &xVBAProject,
- bool bIsUnicode)
-{
- sal_uInt16 nIdLen, nOut16;
- sal_uInt8 nType = 0, nOut8;
- String sReference;
-
- *xVBAProject >> nIdLen;
-
- if (nIdLen < MINVBASTRING) //Error recovery
- xVBAProject->SeekRel(-2); //undo 2 byte len
- else
- {
- for(sal_uInt16 i=0; i < nIdLen / (bIsUnicode ? 2 : 1); i++)
- {
- if (bIsUnicode)
- *xVBAProject >> nOut16;
- else
- {
- *xVBAProject >> nOut8;
- nOut16 = nOut8;
- }
- sReference += nOut16;
- if (i==2)
- {
- if ((nOut16 == 'G') || (nOut16 == 'H') || (nOut16 == 'C') ||
- nOut16 == 'D')
- {
- nType = static_cast<sal_uInt8>(nOut16);
- }
- if (nType == 0)
- {
- //Error recovery, 2byte len + 3 characters of used type
- xVBAProject->SeekRel(-(2 + 3 * (bIsUnicode ? 2 : 1)));
- break;
- }
- }
- }
- maReferences.push_back(sReference);
- }
- return nType;
-}
-
-void VBA_Impl::Output( int nLen, const sal_uInt8*pData )
-{
- /*
- Each StarBasic module is tragically limited to the maximum len of a
- string and WordBasic is not, so each overlarge module must be split
- */
- String sTemp((const sal_Char *)pData, (xub_StrLen)nLen,
- meCharSet);
- int nTmp = sTemp.GetTokenCount('\x0D');
- int nIndex = aVBAStrings.GetSize()-1;
- if (aVBAStrings.Get(nIndex)->Len() +
- nLen + ((nLines+nTmp) * sComment.Len()) >= STRING_MAXLEN)
- {
- //DBG_ASSERT(0,"New Module String\n");
- //we are too large for our boots, break out into another
- //string
- nLines=0;
- nIndex++;
- aVBAStrings.SetSize(nIndex+1);
- aVBAStrings.Put(nIndex,new String);
- }
- *(aVBAStrings.Get(nIndex)) += sTemp;
- nLines+=nTmp;
-}
-
-
-int VBA_Impl::ReadVBAProject(const SvStorageRef &rxVBAStorage)
-{
- SvStorageStreamRef xVBAProject;
- xVBAProject = rxVBAStorage->OpenSotStream(
- String( RTL_CONSTASCII_USTRINGPARAM( "_VBA_PROJECT" ) ),
- STREAM_STD_READ | STREAM_NOCREATE );
-
- if( !xVBAProject.Is() || SVSTREAM_OK != xVBAProject->GetError() )
- {
- DBG_WARNING("Not able to find vba project, cannot find macros");
- return 0;
- }
-
- static const sal_uInt8 aKnownId[] = {0xCC, 0x61};
- sal_uInt8 aId[2];
- xVBAProject->Read( aId, sizeof(aId) );
- if (memcmp( aId, aKnownId, sizeof(aId)))
- {
- DBG_WARNING("unrecognized VBA macro project type");
- return 0;
- }
-
- static const sal_uInt8 aOffice2003LE_2[] =
- {
- 0x79, 0x00, 0x00, 0x01, 0x00, 0xFF
- };
-
- static const sal_uInt8 aOffice2003LE[] =
- {
- 0x76, 0x00, 0x00, 0x01, 0x00, 0xFF
- };
-
- static const sal_uInt8 aOfficeXPLE[] =
- {
- 0x73, 0x00, 0x00, 0x01, 0x00, 0xFF
- };
-
- static const sal_uInt8 aOfficeXPBE[] =
- {
- 0x63, 0x00, 0x00, 0x0E, 0x00, 0xFF
- };
-
- static const sal_uInt8 aOffice2000LE[] =
- {
- 0x6D, 0x00, 0x00, 0x01, 0x00, 0xFF
- };
- static const sal_uInt8 aOffice98BE[] =
- {
- 0x60, 0x00, 0x00, 0x0E, 0x00, 0xFF
- };
- static const sal_uInt8 aOffice97LE[] =
- {
- 0x5E, 0x00, 0x00, 0x01, 0x00, 0xFF
- };
- sal_uInt8 aProduct[6];
- xVBAProject->Read( aProduct, sizeof(aProduct) );
-
- bool bIsUnicode;
- if (!(memcmp(aProduct, aOffice2003LE, sizeof(aProduct))) ||
- !(memcmp(aProduct, aOffice2003LE_2, sizeof(aProduct))) )
- {
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- bIsUnicode = true;
- }
- else if (!(memcmp(aProduct, aOfficeXPLE, sizeof(aProduct))))
- {
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- bIsUnicode = true;
- }
- else if (!(memcmp(aProduct, aOfficeXPBE, sizeof(aProduct))))
- {
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- mbMac = true;
- bIsUnicode = false;
- }
- else if (!(memcmp(aProduct, aOffice2000LE, sizeof(aProduct))))
- {
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- bIsUnicode = true;
- }
- else if (!(memcmp(aProduct, aOffice98BE, sizeof(aProduct))))
- {
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- mbMac = true;
- bIsUnicode = false;
- }
- else if (!(memcmp(aProduct, aOffice97LE, sizeof(aProduct))))
- {
- xVBAProject->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- bIsUnicode = true;
- }
- else
- {
- switch (aProduct[3])
- {
- case 0x1:
- xVBAProject->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- bIsUnicode = true;
- DBG_ASSERT(!this, "unrecognized VBA macro version, report to cmc. Guessing at unicode little endian");
- break;
- case 0xe:
- xVBAProject->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
- mbMac = true;
- bIsUnicode = false;
- DBG_ASSERT(!this, "unrecognized VBA macro version, report to cmc. Guessing at 8bit big endian");
- break;
- default:
- DBG_ASSERT(!this, "totally unrecognized VBA macro version, report to cmc");
- return 0;
- }
- }
-
- sal_uInt32 nLidA; //Language identifiers
- sal_uInt32 nLidB;
- sal_uInt16 nCharSet;
- sal_uInt16 nLenA;
- sal_uInt32 nUnknownB;
- sal_uInt32 nUnknownC;
- sal_uInt16 nLenB;
- sal_uInt16 nLenC;
- sal_uInt16 nLenD;
-
- *xVBAProject >> nLidA >> nLidB >> nCharSet >> nLenA >> nUnknownB;
- *xVBAProject >> nUnknownC >> nLenB >> nLenC >> nLenD;
-
- meCharSet = rtl_getTextEncodingFromWindowsCodePage(nCharSet);
-
- DBG_ASSERT(meCharSet != RTL_TEXTENCODING_DONTKNOW,
- "don't know what vba charset to use");
- if (meCharSet == RTL_TEXTENCODING_DONTKNOW)
- meCharSet = RTL_TEXTENCODING_MS_1252;
-
- if (nLenD != 0x02)
- {
- DBG_WARNING("Warning VBA number is different, please report");
- return 0;
- }
-
- /*
- A sequence of string that are prepended with a len and then begin with G
- or H, there are also those that begin with C or D. If a string begins with
- C or D, it is really two strings, one right after the other. Each string
- then has a 12 bytes suffix
-
- Recognizing the end of the sequence is done by finding a str len of < 6
- which does not appear to be the beginning of an object id. Admittedly this
- isn't a great test, but nothing in the header appears to count the number
- of strings, and nothing else seems to match. So it'll have to do, its
- protected by a number of secondry tests to prove its a valid string, and
- everything gives up if this isn't proven.
- */
- bool bPredictsTrailingTwenty = false;
- while (1)
- {
- sal_uInt8 nType = ReadPString(xVBAProject,bIsUnicode);
- //Type C and D seem to come as pairs, so skip the following one
- if (nType == 'C' || nType == 'D')
- {
- nType = ReadPString(xVBAProject,bIsUnicode);
- DBG_ASSERT( nType == 'C' || nType == 'D',
- "VBA: This must be a 'C' or 'D' string!" );
- if (nType != 'C' && nType != 'D')
- return 0;
- }
- if (!nType)
- break;
- xVBAProject->SeekRel(10);
- sal_uInt16 nPredictsTrailingTwenty;
- *xVBAProject >> nPredictsTrailingTwenty;
- if (nPredictsTrailingTwenty)
- bPredictsTrailingTwenty = true;
- if (bPredictsTrailingTwenty)
- {
- sal_uInt16 nTestIsNotString;
- *xVBAProject >> nTestIsNotString;
- if (nTestIsNotString < MINVBASTRING)
- {
- DBG_ASSERT(nTestIsNotString <= 1,
- "Haven't seen a len like this in VBA, report to CMC");
- xVBAProject->SeekRel(18);
- bPredictsTrailingTwenty = false;
- }
- else
- xVBAProject->SeekRel(-2);
- }
- }
-
- sal_Int16 nInt16s;
- *xVBAProject >> nInt16s;
- DBG_ASSERT( nInt16s >= 0, "VBA: Bad no of records in VBA Project, panic!" );
- if (!nInt16s)
- return 0;
-
- xVBAProject->SeekRel(2*nInt16s);
-
- sal_Int16 nInt32s;
- *xVBAProject >> nInt32s;
- DBG_ASSERT( nInt32s >= 0, "VBA: Bad no of records in VBA Project, panic!" );
- if (!nInt32s)
- return 0;
- xVBAProject->SeekRel(4*nInt32s);
-
- xVBAProject->SeekRel(2);
- for(int k=0;k<3;k++)
- {
- sal_uInt16 nLen;
- *xVBAProject >> nLen;
- if (nLen != 0xFFFF)
- xVBAProject->SeekRel(nLen);
- }
- xVBAProject->SeekRel(100); //Seems fixed len
-
- *xVBAProject >> nOffsets;
- DBG_ASSERT( nOffsets != 0xFFFF, "VBA: Bad nOffsets, panic!!" );
- if ((nOffsets == 0xFFFF) || (nOffsets == 0))
- return 0;
- pOffsets = new VBAOffset_Impl[ nOffsets ];
-
- int i, j;
- for( i=0; i < nOffsets; i++)
- {
- sal_uInt16 nLen;
- *xVBAProject >> nLen;
-
- if (bIsUnicode)
- {
- sal_Unicode* pBuf = pOffsets[i].sName.AllocBuffer( nLen / 2 );
- xVBAProject->Read( (sal_Char*)pBuf, nLen );
-
-#ifdef OSL_BIGENDIAN
- for( j = 0; j < nLen / 2; ++j, ++pBuf )
- *pBuf = SWAPSHORT( *pBuf );
-#endif // ifdef OSL_BIGENDIAN
- }
- else
- {
- ByteString aByteStr;
- sal_Char* pByteData = aByteStr.AllocBuffer( nLen );
- sal_Size nWasRead = xVBAProject->Read( pByteData, nLen );
- if( nWasRead != nLen )
- aByteStr.ReleaseBufferAccess();
- pOffsets[i].sName += String( aByteStr, meCharSet);
- }
-
- *xVBAProject >> nLen;
- xVBAProject->SeekRel( nLen );
-
- //begin section, another problem area
- *xVBAProject >> nLen;
- if ( nLen == 0xFFFF)
- {
- xVBAProject->SeekRel(2);
- *xVBAProject >> nLen;
- xVBAProject->SeekRel( nLen );
- }
- else
- xVBAProject->SeekRel( nLen+2 );
-
- *xVBAProject >> nLen;
- DBG_ASSERT( nLen == 0xFFFF, "VBA: Bad field in VBA Project, panic!!" );
- if ( nLen != 0xFFFF)
- return 0;
-
- xVBAProject->SeekRel(6);
- sal_uInt16 nOctects;
- *xVBAProject >> nOctects;
- for(j=0;j<nOctects;j++)
- xVBAProject->SeekRel(8);
-
- xVBAProject->SeekRel(5);
- //end section
-
- *xVBAProject >> pOffsets[i].nOffset;
- xVBAProject->SeekRel(2);
- }
-
- return nOffsets;
-}
-
-
-/* #117718# For a given Module name return its type,
- * Form, Class, Document, Normal or Unknown
- *
-*/
-
-ModuleType VBA_Impl::GetModuleType( const UniString& rModuleName )
-{
- ModuleTypeHash::iterator iter = mhModHash.find( rModuleName );
- ModuleTypeHash::iterator iterEnd = mhModHash.end();
- if ( iter != iterEnd )
- {
- return iter->second;
- }
- return Unknown;
-}
-
-bool VBA_Impl::Open( const String &rToplevel, const String &rSublevel )
-{
- /* beginning test for vba stuff */
- bool bRet = false;
- SvStorageRef xMacros= xStor->OpenSotStorage( rToplevel,
- STREAM_READWRITE | STREAM_NOCREATE |
- STREAM_SHARE_DENYALL );
- if( !xMacros.Is() || SVSTREAM_OK != xMacros->GetError() )
- {
- DBG_WARNING("No Macros Storage");
- }
- else
- {
- xVBA = xMacros->OpenSotStorage( rSublevel,
- STREAM_READWRITE | STREAM_NOCREATE |
- STREAM_SHARE_DENYALL );
- if( !xVBA.Is() || SVSTREAM_OK != xVBA->GetError() )
- {
- DBG_WARNING("No Visual Basic in Storage");
- }
- else
- {
- if (ReadVBAProject(xVBA))
- bRet = true;
- }
- /* #117718#
- * Information regarding the type of module is contained in the
- * "PROJECT" stream, this stream consists of a number of ascii lines
- * entries are of the form Key=Value, the ones that we are interested
- * in have the keys; Class, BaseClass & Module indicating the module
- * ( value ) is either a Class Module, Form Module or a plain VB Module. */
- SvStorageStreamRef xProject = xMacros->OpenSotStream(
- String( RTL_CONSTASCII_USTRINGPARAM( "PROJECT" ) ) );
- SvStorageStream* pStp = xProject;
- UniString tmp;
- static const String sThisDoc( RTL_CONSTASCII_USTRINGPARAM( "ThisDocument" ) );
- static const String sModule( RTL_CONSTASCII_USTRINGPARAM( "Module" ) );
- static const String sClass( RTL_CONSTASCII_USTRINGPARAM( "Class" ) );
- static const String sBaseClass( RTL_CONSTASCII_USTRINGPARAM( "BaseClass" ) );
- static const String sDocument( RTL_CONSTASCII_USTRINGPARAM( "Document" ) );
- mhModHash[ sThisDoc ] = Class;
- while ( pStp->ReadByteStringLine( tmp, meCharSet ) )
- {
- xub_StrLen index = tmp.Search( '=' );
- if ( index != STRING_NOTFOUND )
- {
- String key = tmp.Copy( 0, index );
- String value = tmp.Copy( index + 1 );
- if ( key == sClass )
- {
- mhModHash[ value ] = Class;
- OSL_TRACE("Module %s is of type Class",
- ::rtl::OUStringToOString( value ,
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- else if ( key == sBaseClass )
- {
- mhModHash[ value ] = Form;
- OSL_TRACE("Module %s is of type Form",
- ::rtl::OUStringToOString( value ,
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- else if ( key == sDocument )
- {
- /* #i37965# DR 2004-12-03: add "Document", used i.e.
- in Excel for macros attached to sheet or document. */
-
- // value is of form <name>/&H<identifier>, strip the identifier
- value.Erase( value.Search( '/' ) );
-
- mhModHash[ value ] = Document;
- OSL_TRACE("Module %s is of type Document VBA",
- ::rtl::OUStringToOString( value ,
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- else if ( key == sModule )
- {
- mhModHash[ value ] = Normal;
- OSL_TRACE("Module %s is of type Normal VBA",
- ::rtl::OUStringToOString( value ,
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- }
- }
- }
- }
- /* end test for vba stuff */
- return bRet;
-}
-
-const StringArray &VBA_Impl::Decompress(sal_uInt16 nIndex, int *pOverflow)
-{
- DBG_ASSERT( nIndex < nOffsets, "Index out of range" );
- SvStorageStreamRef xVBAStream;
- aVBAStrings.SetSize(1);
- aVBAStrings.Put(0,new String);
-
- xVBAStream = xVBA->OpenSotStream( pOffsets[nIndex].sName,
- STREAM_STD_READ | STREAM_NOCREATE );
- if (pOverflow)
- *pOverflow=0;
-
- if( !xVBAStream.Is() || SVSTREAM_OK != xVBAStream->GetError() )
- {
- DBG_WARNING("Not able to open vb module ");
- }
- else
- {
- xVBAStream->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- DecompressVBA( nIndex, xVBAStream );
- /*
- * if len was too big for a single string set that variable ?
- * if ((len > XX) && (pOverflow))
- *pOverflow=1;
- */
- if (bCommented)
- {
- String sTempStringa;
- if (mbMac)
- sTempStringa = String( RTL_CONSTASCII_USTRINGPARAM( "\x0D" ) );
- else
- sTempStringa = String( RTL_CONSTASCII_USTRINGPARAM( "\x0D\x0A" ) );
- String sTempStringb(sTempStringa);
- sTempStringb+=sComment;
- for(ULONG i=0;i<aVBAStrings.GetSize();i++)
- {
- aVBAStrings.Get(i)->SearchAndReplaceAll(
- sTempStringa,sTempStringb);
- aVBAStrings.Get(i)->Insert(sComment,0);
- }
- }
- }
- return aVBAStrings;
-}
-
-
-int VBA_Impl::DecompressVBA( int nIndex, SvStorageStreamRef &xVBAStream )
-{
- sal_uInt8 nLeadbyte;
- sal_uInt16 nToken;
- unsigned int nPos = 0;
- int nLen, nDistance, nShift, nClean=1;
-
- xVBAStream->Seek( pOffsets[ nIndex ].nOffset + 3 );
-
- while(xVBAStream->Read(&nLeadbyte,1))
- {
- for(int nPosition=0x01;nPosition < 0x100;nPosition=nPosition<<1)
- {
- //we see if the leadbyte has flagged this location as a dataunit
- //which is actually a token which must be looked up in the history
- if (nLeadbyte & nPosition)
- {
- *xVBAStream >> nToken;
-
- if (nClean == 0)
- nClean=1;
-
- //For some reason the division of the token into the length
- //field of the data to be inserted, and the distance back into
- //the history differs depending on how full the history is
- int nPos2 = nPos % nWINDOWLEN;
- if (nPos2 <= 0x10)
- nShift = 12;
- else if (nPos2 <= 0x20)
- nShift = 11;
- else if (nPos2 <= 0x40)
- nShift = 10;
- else if (nPos2 <= 0x80)
- nShift = 9;
- else if (nPos2 <= 0x100)
- nShift = 8;
- else if (nPos2 <= 0x200)
- nShift = 7;
- else if (nPos2 <= 0x400)
- nShift = 6;
- else if (nPos2 <= 0x800)
- nShift = 5;
- else
- nShift = 4;
-
- int i;
- nLen=0;
- for(i=0;i<nShift;i++)
- nLen |= nToken & (1<<i);
-
- nLen += 3;
-
- nDistance = nToken >> nShift;
-
- //read the len of data from the history, wrapping around the
- //nWINDOWLEN boundary if necessary data read from the history
- //is also copied into the recent part of the history as well.
- for (i = 0; i < nLen; i++)
- {
- unsigned char c;
- c = aHistory[(nPos-nDistance-1) % nWINDOWLEN];
- aHistory[nPos % nWINDOWLEN] = c;
- nPos++;
- }
- }
- else
- {
- // special boundary case code, not guarantueed to be correct
- // seems to work though, there is something wrong with the
- // compression scheme (or maybe a feature) where when the data
- // ends on a nWINDOWLEN boundary and the excess bytes in the 8
- // dataunit list are discarded, and not interpreted as tokens
- // or normal data.
- if ((nPos != 0) && ((nPos % nWINDOWLEN) == 0) && (nClean))
- {
- xVBAStream->SeekRel(2);
- nClean=0;
- Output(nWINDOWLEN, aHistory);
- break;
- }
- //This is the normal case for when the data unit is not a
- //token to be looked up, but instead some normal data which
- //can be output, and placed in the history.
- if (xVBAStream->Read(&aHistory[nPos % nWINDOWLEN],1))
- nPos++;
-
- if (nClean == 0)
- nClean=1;
- }
- }
- }
- if (nPos % nWINDOWLEN)
- Output(nPos % nWINDOWLEN,aHistory);
- return(nPos);
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/msfilter/msvbasic.hxx b/svx/source/msfilter/msvbasic.hxx
deleted file mode 100644
index 8492062433..0000000000
--- a/svx/source/msfilter/msvbasic.hxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: msvbasic.hxx,v $
- * $Revision: 1.13 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-
-#ifndef _MSVBASIC_HXX
-#define _MSVBASIC_HXX
-
-#ifdef _SOLAR_H
-#include <tools/solar.h>
-#endif
-#include <tools/debug.hxx>
-#ifndef _SVSTOR_HXX //autogen
-#include <sot/storage.hxx>
-#endif
-#include <tools/dynary.hxx>
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-#include<map>
-
-/* class VBA:
- * The VBA class provides a set of methods to handle Visual Basic For
- * Applications streams, the constructor is given the root ole2 stream
- * of the document, Open reads the VBA project file and figures out
- * the number of VBA streams, and the offset of the data within them.
- * Decompress decompresses a particular numbered stream, NoStreams returns
- * this number, and StreamName can give you the streams name. Decompress
- * will return a string with the decompressed data. The optional extra
- * argument will be set if not NULL to 1 in the case of a string overflow,
- * if I can figure out how to do that.
- *
- * Otherwise it is possible to inherit from VBA and implement a Output
- * member which gets called with each 4096 output sized block.
- *
- * cmc
- * */
-
-DECLARE_DYNARRAY(StringArray,String *)
-
-// #117718# define internal types to distinguish between
-// module types, form, class & normal
-// #i37965# DR 2004-12-03: add "Document", used in Excel for macros attached to sheet
-enum ModuleType { Unknown = 0, Normal, Class, Form, Document };
-
-// #117718# define map to hold types of module
-//
-
-typedef ::std::map< UniString,
- ModuleType > ModuleTypeHash;
-
-class VBA_Impl
-{
-public:
- VBA_Impl(SvStorage &rIn, bool bCmmntd = true);
- ~VBA_Impl();
- //0 for failure, 1 for success
- bool Open( const String &rToplevel, const String &rSublevel);
- const StringArray & Decompress(sal_uInt16 nIndex, int *pOverflow=0);
- sal_uInt16 GetNoStreams() const { return nOffsets; }
- const String &GetStreamName(sal_uInt16 nIndex) const
- {
- DBG_ASSERT( nIndex < nOffsets, "Index out of range" );
- return pOffsets[ nIndex ].sName;
- }
- //I'm the method that would be made virtual to make this class
- //useful elsewhere
- void Output(int len, const sal_uInt8 *data);
- //
- // #117718# member map of module names to types of module
- ModuleType GetModuleType( const UniString& rModuleName );
-
- std::vector<String> maReferences;
-private:
- struct VBAOffset_Impl
- {
- String sName;
- sal_uInt32 nOffset;
- };
-
- // #117718# member map of module names to types of module
- ModuleTypeHash mhModHash;
- SvStorageRef xVBA;
- StringArray aVBAStrings;
- String sComment;
- SvStorageRef xStor;
- VBAOffset_Impl *pOffsets;
- sal_uInt16 nOffsets;
- enum Limits {nWINDOWLEN = 4096};
- sal_uInt8 aHistory[nWINDOWLEN];
- rtl_TextEncoding meCharSet;
- bool bCommented;
- bool mbMac;
- int nLines;
-
- //0 for failure, anything else for success
- int ReadVBAProject(const SvStorageRef &rxVBAStorage);
- int DecompressVBA(int index, SvStorageStreamRef &rxVBAStream);
- sal_uInt8 ReadPString(SvStorageStreamRef &xVBAProject, bool bIsUnicode);
-};
-
-#endif
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/msfilter/svxmsbas.cxx b/svx/source/msfilter/svxmsbas.cxx
deleted file mode 100644
index a2448c8727..0000000000
--- a/svx/source/msfilter/svxmsbas.cxx
+++ /dev/null
@@ -1,406 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: svxmsbas.cxx,v $
- * $Revision: 1.24 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-#include <tools/debug.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/app.hxx>
-#include <basic/basmgr.hxx>
-#include <basic/sbmod.hxx>
-#include <svxerr.hxx>
-#include <svxmsbas.hxx>
-#include <msvbasic.hxx>
-#include <svx/msocximex.hxx>
-#include <sot/storinfo.hxx>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/awt/XControlModel.hpp>
-using namespace com::sun::star::beans;
-using namespace com::sun::star::io;
-using namespace com::sun::star::awt;
-#include <comphelper/storagehelper.hxx>
-
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/script/XLibraryContainer.hpp>
-using namespace com::sun::star::container;
-using namespace com::sun::star::script;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star;
-
-using rtl::OUString;
-
-int SvxImportMSVBasic::Import( const String& rStorageName,
- const String &rSubStorageName,
- BOOL bAsComment, BOOL bStripped )
-{
- int nRet = 0;
- if( bImport && ImportCode_Impl( rStorageName, rSubStorageName,
- bAsComment, bStripped ))
- nRet |= 1;
-
- if (bImport)
- ImportForms_Impl(rStorageName, rSubStorageName);
-
- if( bCopy && CopyStorage_Impl( rStorageName, rSubStorageName ))
- nRet |= 2;
-
- return nRet;
-}
-
-bool SvxImportMSVBasic::ImportForms_Impl(const String& rStorageName,
- const String& rSubStorageName)
-{
- SvStorageRef xVBAStg(xRoot->OpenSotStorage(rStorageName,
- STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL));
- if (!xVBAStg.Is() || xVBAStg->GetError())
- return false;
-
- std::vector<String> aUserForms;
- SvStorageInfoList aContents;
- xVBAStg->FillInfoList(&aContents);
- for (USHORT nI = 0; nI < aContents.Count(); ++nI)
- {
- SvStorageInfo& rInfo = aContents.GetObject(nI);
- if (!rInfo.IsStream() && rInfo.GetName() != rSubStorageName)
- aUserForms.push_back(rInfo.GetName());
- }
-
- if (aUserForms.empty())
- return false;
-
- bool bRet = true;
- SFX_APP()->EnterBasicCall();
- try
- {
- Reference<XMultiServiceFactory> xSF(comphelper::getProcessServiceFactory());
-
- Reference<XComponentContext> xContext;
- Reference<XPropertySet> xProps(xSF, UNO_QUERY);
- xProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext;
-
-
- Reference<XLibraryContainer> xLibContainer = rDocSh.GetDialogContainer();
- DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
-
- String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
- Reference<XNameContainer> xLib;
- if (xLibContainer.is())
- {
- if( !xLibContainer->hasByName(aLibName))
- xLibContainer->createLibrary(aLibName);
-
- Any aLibAny = xLibContainer->getByName( aLibName );
- aLibAny >>= xLib;
- }
-
- if(xLib.is())
- {
- typedef std::vector<String>::iterator myIter;
- myIter aEnd = aUserForms.end();
- for (myIter aIter = aUserForms.begin(); aIter != aEnd; ++aIter)
- {
- SvStorageRef xForm (xVBAStg->OpenSotStorage(*aIter,
- STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL));
-
- if (!xForm.Is() || xForm->GetError())
- continue;
-
- SvStorageStreamRef xFrame = xForm->OpenSotStream(
- String( RTL_CONSTASCII_USTRINGPARAM( "\3VBFrame" ) ),
- STREAM_STD_READ | STREAM_NOCREATE);
-
- if (!xFrame.Is() || xFrame->GetError())
- continue;
-
- SvStorageStreamRef xTypes = xForm->OpenSotStream(
- String( 'f' ), STREAM_STD_READ | STREAM_NOCREATE);
-
- if (!xTypes.Is() || xTypes->GetError())
- continue;
-
- //<UserForm Name=""><VBFrame></VBFrame>"
- String sData;
- String sLine;
- while(xFrame->ReadByteStringLine(sLine, RTL_TEXTENCODING_MS_1252))
- {
- sData += sLine;
- sData += '\n';
- }
- sData.ConvertLineEnd();
-
- Reference<container::XNameContainer> xDialog(
- xSF->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.UnoControlDialogModel"))), uno::UNO_QUERY);
-
- OCX_UserForm aForm(xVBAStg, *aIter, *aIter, xDialog, xSF );
- aForm.pDocSh = &rDocSh;
- sal_Bool bOk = aForm.Read(xTypes);
- DBG_ASSERT(bOk, "Had unexpected content, not risking this module");
- if (bOk)
- aForm.Import(xLib);
- }
- }
- }
- catch(...)
- {
- DBG_ERRORFILE( "SvxImportMSVBasic::ImportForms_Impl - any exception caught" );
- //bRet = false;
- }
- SFX_APP()->LeaveBasicCall();
- return bRet;
-}
-
-
-BOOL SvxImportMSVBasic::CopyStorage_Impl( const String& rStorageName,
- const String& rSubStorageName)
-{
- BOOL bValidStg = FALSE;
- {
- SvStorageRef xVBAStg( xRoot->OpenSotStorage( rStorageName,
- STREAM_READWRITE | STREAM_NOCREATE |
- STREAM_SHARE_DENYALL ));
- if( xVBAStg.Is() && !xVBAStg->GetError() )
- {
- SvStorageRef xVBASubStg( xVBAStg->OpenSotStorage( rSubStorageName,
- STREAM_READWRITE | STREAM_NOCREATE |
- STREAM_SHARE_DENYALL ));
- if( xVBASubStg.Is() && !xVBASubStg->GetError() )
- {
- // then we will copy these storages into the (temporary) storage of the document
- bValidStg = TRUE;
- }
- }
- }
-
- if( bValidStg )
- {
- String aDstStgName( GetMSBasicStorageName() );
- SotStorageRef xDst = SotStorage::OpenOLEStorage( rDocSh.GetStorage(), aDstStgName, STREAM_READWRITE | STREAM_TRUNC );
- SotStorageRef xSrc = xRoot->OpenSotStorage( rStorageName, STREAM_STD_READ );
-
- // TODO/LATER: should we commit the storage?
- xSrc->CopyTo( xDst );
- xDst->Commit();
- ErrCode nError = xDst->GetError();
- if ( nError == ERRCODE_NONE )
- nError = xSrc->GetError();
- if ( nError != ERRCODE_NONE )
- xRoot->SetError( nError );
- else
- bValidStg = TRUE;
- }
-
- return bValidStg;
-}
-
-BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
- const String &rSubStorageName,
- BOOL bAsComment, BOOL bStripped )
-{
- BOOL bRet = FALSE;
- VBA_Impl aVBA( *xRoot, bAsComment );
- if( aVBA.Open(rStorageName,rSubStorageName) )
- {
- SFX_APP()->EnterBasicCall();
- Reference<XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
- DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
-
- UINT16 nStreamCount = aVBA.GetNoStreams();
- Reference<XNameContainer> xLib;
- if( xLibContainer.is() && nStreamCount )
- {
- String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
- if( !xLibContainer->hasByName( aLibName ) )
- xLibContainer->createLibrary( aLibName );
-
- Any aLibAny = xLibContainer->getByName( aLibName );
- aLibAny >>= xLib;
- }
- if( xLib.is() )
- {
- for( UINT16 i=0; i<nStreamCount;i++)
- {
- StringArray aDecompressed = aVBA.Decompress(i);
-#if 0
-/* DR 2005-08-11 #124850# Do not filter special characters from module name.
- Just put the original module name and let the Basic interpreter deal with
- it. Needed for roundtrip...
- */
- ByteString sByteBasic(aVBA.GetStreamName(i),
- RTL_TEXTENCODING_ASCII_US,
- (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_UNDERLINE|
- RTL_UNICODETOTEXT_FLAGS_INVALID_UNDERLINE |
- RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0 |
- RTL_UNICODETOTEXT_FLAGS_NOCOMPOSITE)
- );
-
- const String sBasicModule(sByteBasic,
- RTL_TEXTENCODING_ASCII_US);
-#else
- const String &sBasicModule = aVBA.GetStreamName( i);
-#endif
- /* #117718# expose information regarding type of Module
- * Class, Form or plain 'ould VBA module with a REM statment
- * at the top of the module. Mapping of Module Name
- * to type is performed in VBA_Impl::Open() method,
- * ( msvbasic.cxx ) by examining the PROJECT stream.
- */
-
- // using name from aVBA.GetStreamName
- // because the encoding of the same returned
- // is the same as the encoding for the names
- // that are keys in the map used by GetModuleType method
- const String &sOrigVBAModName = aVBA.GetStreamName( i );
- ModuleType mType = aVBA.GetModuleType( sOrigVBAModName );
-
- rtl::OUString sClassRem( RTL_CONSTASCII_USTRINGPARAM( "Rem Attribute VBA_ModuleType=" ) );
-
- rtl::OUString modeTypeComment;
-
- switch( mType )
- {
- case Class:
- modeTypeComment = sClassRem +
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAClassModule\n" ) );
- break;
- case Form:
- modeTypeComment = sClassRem +
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAFormModule\n" ) );
- break;
- case Document:
- modeTypeComment = sClassRem +
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBADocumentModule\n" ) );
- break;
- case Normal:
- modeTypeComment = sClassRem +
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAModule\n" ) );
- break;
- case Unknown:
- modeTypeComment = sClassRem +
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAUnknown\n" ) );
- break;
- default:
- DBG_ERRORFILE( "SvxImportMSVBasic::ImportCode_Impl - unknown module type" );
- break;
- }
- static ::rtl::OUString sVBAOption( RTL_CONSTASCII_USTRINGPARAM( "Option VBASupport 1\n" ) );
- static ::rtl::OUString sClassOption( RTL_CONSTASCII_USTRINGPARAM( "Option ClassModule\n" ) );
- if ( !bAsComment )
- {
- modeTypeComment = modeTypeComment + sVBAOption;
- if ( mType == Class )
- modeTypeComment = modeTypeComment + sClassOption;
-
- }
-
- String sModule(sBasicModule); //#i52606# no need to split Macros in 64KB blocks any more!
- String sTemp;
- if (bAsComment)
- {
- sTemp+=String(RTL_CONSTASCII_USTRINGPARAM( "Sub " ));
- String sMunge(sModule);
- //Streams can have spaces in them, but modulenames
- //cannot !
- sMunge.SearchAndReplaceAll(' ','_');
-
- sTemp += sMunge;
- sTemp.AppendAscii("\n");
- };
- ::rtl::OUString aSource(sTemp);
-
- for(ULONG j=0;j<aDecompressed.GetSize();j++)
- {
- if (bStripped)
- {
- String *pStr = aDecompressed.Get(j);
- bool bMac = true;
- xub_StrLen nBegin = pStr->Search('\x0D');
- if ((STRING_NOTFOUND != nBegin) && (pStr->Len() > 1) && (pStr->GetChar(nBegin+1) == '\x0A'))
- bMac = false;
-
- const char cLineEnd = bMac ? '\x0D' : '\x0A';
- const String sAttribute(String::CreateFromAscii(
- bAsComment ? "Rem Attribute" : "Attribute"));
- nBegin = 0;
- while (STRING_NOTFOUND != (nBegin = pStr->Search(sAttribute, nBegin)))
- {
- if ((nBegin) && pStr->GetChar(nBegin-1) != cLineEnd)
- {
- // npower #i63766# Need to skip instances of Attribute
- // that are NOT Attribute statements
- nBegin = nBegin + sAttribute.Len();
- continue;
- }
- xub_StrLen nEnd = pStr->Search(cLineEnd ,nBegin);
- // DR #i26521# catch STRING_NOTFOUND, will loop endless otherwise
- if( nEnd == STRING_NOTFOUND )
- pStr->Erase();
- else
- pStr->Erase(nBegin, (nEnd-nBegin)+1);
- }
- }
- if( aDecompressed.Get(j)->Len() )
- {
- aSource+=::rtl::OUString( *aDecompressed.Get(j) );
- }
-
- }
- if (bAsComment)
- {
- aSource += rtl::OUString::createFromAscii("\nEnd Sub");
- }
- ::rtl::OUString aModName( sModule );
- if ( aSource.getLength() )
- {
- aSource = modeTypeComment + aSource;
-
- Any aSourceAny;
- aSourceAny <<= aSource;
- if( xLib->hasByName( aModName ) )
- xLib->replaceByName( aModName, aSourceAny );
- else
- xLib->insertByName( aModName, aSourceAny );
- }
-
- bRet = true;
- }
- }
- SFX_APP()->LeaveBasicCall();
- }
- return bRet;
-}
-
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/svx/source/msfilter/svxmsbas2.cxx b/svx/source/msfilter/svxmsbas2.cxx
deleted file mode 100644
index afd772bbd7..0000000000
--- a/svx/source/msfilter/svxmsbas2.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: svxmsbas.cxx,v $
- * $Revision: 1.24 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include <basic/basmgr.hxx>
-#include <sfx2/objsh.hxx>
-#include <svxerr.hxx>
-#include <svxmsbas.hxx>
-
-using namespace com::sun::star;
-
-ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
- const String& rStorageName )
-{
- ULONG nRet = ERRCODE_NONE;
- uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
- String aDstStgName( GetMSBasicStorageName() );
- SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName,
- STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) );
- if( xVBAStg.Is() && !xVBAStg->GetError() )
- {
- xVBAStg = 0;
- if( bSaveInto )
- {
- BasicManager *pBasicMan = rDocSh.GetBasicManager();
- if( pBasicMan && pBasicMan->IsBasicModified() )
- nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE;
-
- SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ );
- SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC );
- xSrc->CopyTo( xDst );
- xDst->Commit();
- ErrCode nError = xDst->GetError();
- if ( nError == ERRCODE_NONE )
- nError = xSrc->GetError();
- if ( nError != ERRCODE_NONE )
- xRoot->SetError( nError );
- }
- }
-
- return nRet;
-}
-
-// check if the MS-VBA-Storage exists in the RootStorage of the DocShell.
-// If it exists, then return the WarningId for losing the information.
-ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
-{
- uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
- SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(),
- STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL ));
- return ( xVBAStg.Is() && !xVBAStg->GetError() )
- ? ERRCODE_SVX_VBASIC_STORAGE_EXIST
- : ERRCODE_NONE;
-}
-
-String SvxImportMSVBasic::GetMSBasicStorageName()
-{
- return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) );
-}
diff --git a/svx/source/msfilter/viscache.hxx b/svx/source/msfilter/viscache.hxx
deleted file mode 100644
index b2dd0e44a2..0000000000
--- a/svx/source/msfilter/viscache.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: viscache.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/stream.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/bitmap.hxx>
-
-/************************************************************************
-|* Impl_CacheElement
-|* Impl_Cache
-|*
-|* Beschreibung
-*************************************************************************/
-class Impl_OlePres
-{
- ULONG nFormat;
- USHORT nAspect;
- Bitmap * pBmp;
- GDIMetaFile * pMtf;
-
- UINT32 nAdvFlags;
- INT32 nJobLen;
- BYTE* pJob;
- Size aSize; // Groesse in 100TH_MM
-public:
- Impl_OlePres( ULONG nF )
- : nFormat( nF )
- , pBmp( NULL )
- , pMtf( NULL )
- , nAdvFlags( 0x2 ) // in Dokument gefunden
- , nJobLen( 0 )
- , pJob( NULL )
- {}
- ~Impl_OlePres()
- {
- delete pJob;
- delete pBmp;
- delete pMtf;
- }
- void SetMtf( const GDIMetaFile & rMtf )
- {
- if( pMtf )
- delete pMtf;
- pMtf = new GDIMetaFile( rMtf );
- }
- Bitmap *GetBitmap() const { return pBmp; }
- GDIMetaFile *GetMetaFile() const { return pMtf; }
- ULONG GetFormat() const { return nFormat; }
- void SetAspect( USHORT nAsp ) { nAspect = nAsp; }
- ULONG GetAdviseFlags() const { return nAdvFlags; }
- void SetAdviseFlags( ULONG nAdv ) { nAdvFlags = nAdv; }
- void SetSize( const Size & rSize ) { aSize = rSize; }
- /// return FALSE => unknown format
- BOOL Read( SvStream & rStm );
- void Write( SvStream & rStm );
-};
-
-
diff --git a/svx/source/options/asiancfg.cxx b/svx/source/options/asiancfg.cxx
index cd1731d23d..8f38b47739 100644
--- a/svx/source/options/asiancfg.cxx
+++ b/svx/source/options/asiancfg.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <asiancfg.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/lang/Locale.hpp>
diff --git a/svx/source/options/htmlcfg.cxx b/svx/source/options/htmlcfg.cxx
index d88542e014..68eddf861c 100644
--- a/svx/source/options/htmlcfg.cxx
+++ b/svx/source/options/htmlcfg.cxx
@@ -265,6 +265,11 @@ void SvxHtmlOptions::Commit()
}
PutProperties(aNames, aValues);
}
+
+void SvxHtmlOptions::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
+{
+}
+
// -----------------------------------------------------------------------
USHORT SvxHtmlOptions::GetFontSize(USHORT nPos) const
{
diff --git a/svx/source/options/makefile.mk b/svx/source/options/makefile.mk
index d68703983e..6f15d41ad0 100644
--- a/svx/source/options/makefile.mk
+++ b/svx/source/options/makefile.mk
@@ -47,24 +47,7 @@ LIBTARGET=NO
SRS1NAME=$(TARGET)
SRC1FILES=\
- optaccessibility.src \
- optasian.src \
- optcolor.src \
- optjsearch.src \
- optgenrl.src \
- optdict.src \
- optsave.src \
- optpath.src \
- optlingu.src \
- optgrid.src \
- optinet2.src \
- multipat.src \
- optctl.src \
- optchart.src \
- optimprove.src
-
-EXCEPTIONSFILES=\
- $(SLO)$/optlingu.obj
+ optgrid.src
LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
LIB1OBJFILES= \
@@ -72,7 +55,6 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/optlingu.obj \
$(SLO)$/htmlcfg.obj \
$(SLO)$/optitems.obj \
$(SLO)$/optgrid.obj \
diff --git a/svx/source/options/multipat.src b/svx/source/options/multipat.src
deleted file mode 100644
index f38183ce2b..0000000000
--- a/svx/source/options/multipat.src
+++ /dev/null
@@ -1,153 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: multipat.src,v $
- * $Revision: 1.42 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "multipat.hrc"
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-// RID_SVXDLG_MULTIPATH --------------------------------------------------
-
-ModalDialog RID_SVXDLG_MULTIPATH
-{
- HelpId = HID_MULTIPATH ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 120 ) ;
- Text [ en-US ] = "Select Paths" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- FixedLine FL_MULTIPATH
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Paths" ;
- };
- ListBox LB_MULTIPATH
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 189 , 80 ) ;
- AutoHScroll = TRUE ;
- };
- Control LB_RADIOBUTTON
- {
- HelpId = HID_OPTIONS_MULTIPATH_LIST ;
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 195 , 77 ) ;
- };
- FixedText FT_RADIOBUTTON
- {
- Hide = TRUE ;
- NoLabel = TRUE ;
- Pos = MAP_APPFONT ( 6 , 86 );
- Size = MAP_APPFONT ( 195 , 8 );
- Text [ en-US ] = "Mark the default path for new files.";
- };
- PushButton BTN_ADD_MULTIPATH
- {
- Pos = MAP_APPFONT ( 204 , 14 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add..." ;
- };
- PushButton BTN_DEL_MULTIPATH
- {
- Pos = MAP_APPFONT ( 204 , 31 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete" ;
- };
- OKButton BTN_MULTIPATH_OK
- {
- Pos = MAP_APPFONT ( 95 , 100 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE;
- };
- CancelButton BTN_MULTIPATH_CANCEL
- {
- Pos = MAP_APPFONT ( 148 , 100 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_MULTIPATH_HELP
- {
- Pos = MAP_APPFONT ( 204 , 100 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- String STR_HEADER_PATHS
- {
- Text [ en-US ] = "Path list" ;
- };
-};
-String RID_MULTIPATH_DBL_ERR
-{
- Text [ en-US ] = "The path %1 already exists." ;
-};
-String RID_SVXSTR_FILE_TITLE
-{
- Text [ en-US ] = "Select files" ;
-};
-String RID_SVXSTR_FILE_HEADLINE
-{
- Text [ en-US ] = "Files" ;
-};
-String RID_SVXSTR_ARCHIVE_TITLE
-{
- Text [ en-US ] = "Select Archives" ;
-};
-String RID_SVXSTR_ARCHIVE_HEADLINE
-{
- Text [ en-US ] = "Archives" ;
-};
-String RID_SVXSTR_MULTIFILE_DBL_ERR
-{
- Text [ en-US ] = "The file %1 already exists." ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optaccessibility.src b/svx/source/options/optaccessibility.src
deleted file mode 100644
index c2ac15db58..0000000000
--- a/svx/source/options/optaccessibility.src
+++ /dev/null
@@ -1,155 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optaccessibility.src,v $
- * $Revision: 1.36 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <optaccessibility.hrc>
-#include <sfx2/sfx.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-TabPage RID_SVXPAGE_ACCESSIBILITYCONFIG
-{
- HelpId = HID_OPTIONS_ACCESSIBILITYCONFIG ;
- Size = MAP_APPFONT ( 260 , WHOLE_HEIGHT ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- FixedLine FL_MISCELLANEOUS
- {
- Pos = MAP_APPFONT ( COL0, ROWA_0 ) ;
- Size = MAP_APPFONT ( GB_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Miscellaneous options";
- };
- CheckBox CB_ACCESSIBILITY_TOOL
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWA_1 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- WordBreak = TRUE;
- Text [ en-US ] = "Support ~assistive technology tools (program restart required)";
- };
- CheckBox CB_TEXTSELECTION
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWA_2 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Use te~xt selection cursor in read-only text documents";
- };
- CheckBox CB_ANIMATED_GRAPHICS
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWA_3 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Allow animated ~graphics";
- };
- CheckBox CB_ANIMATED_TEXTS
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWA_4 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Allow animated ~text";
- };
- CheckBox CB_TIPHELP
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT( ROWA_5 ) );
- Size = MAP_APPFONT( DIFF(COL2,COL3), RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Help tips disappear after ";
- };
- NumericField NF_TIPHELP
- {
- TabStop = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT( COL3, ROWA_5 );
- Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
- Minimum = 1;
- Maximum = 99;
- First = 1 ;
- Last = 99 ;
- Spin = TRUE ;
- Repeat = TRUE ;
- };
- FixedText FT_TIPHELP
- {
- Pos = MAP_APPFONT( COL4, OFFS_TEXTBOX_FIXEDTEXT( ROWA_5 ) );
- Size = MAP_APPFONT( UNIT_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT );
- Text [ en-US ] = "seconds";
- };
- FixedLine FL_HC_OPTIONS
- {
- Pos = MAP_APPFONT ( COL0, ROWB_0 ) ;
- Size = MAP_APPFONT ( GB_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Options for high contrast appearance";
- };
- CheckBox CB_AUTO_DETECT_HC
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWB_1 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Automatically ~detect high contrast mode of operating system";
- };
- CheckBox CB_AUTOMATIC_FONT_COLOR
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWB_2 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Use automatic font ~color for screen display";
- };
- CheckBox CB_PAGE_PREVIEWS
- {
- TabStop = TRUE ;
- Pos = MAP_APPFONT( COL1, ROWB_3 );
- Size = MAP_APPFONT( CB_WIDTH, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "~Use system colors for page previews";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optasian.src b/svx/source/options/optasian.src
deleted file mode 100644
index 83da984639..0000000000
--- a/svx/source/options/optasian.src
+++ /dev/null
@@ -1,177 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optasian.src,v $
- * $Revision: 1.48 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <optasian.hrc>
-#include <sfx2/sfx.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-TabPage RID_SVXPAGE_ASIAN_LAYOUT
-{
- HelpId = HID_OPTIONS_ASIAN_LAYOUT ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- FixedLine GB_KERNING
- {
- Pos = MAP_APPFONT ( 6, 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Kerning";
- };
- RadioButton RB_CHAR_KERNING
- {
- Pos = MAP_APPFONT ( 12, 14 ) ;
- Size = MAP_APPFONT ( 200 , 10 ) ;
- Text [ en-US ] = "~Western characters only";
- };
- RadioButton RB_CHAR_PUNCT
- {
- Pos = MAP_APPFONT ( 12, 27 ) ;
- Size = MAP_APPFONT ( 200 , 10 ) ;
- Text [ en-US ] = "Western ~text and Asian punctuation";
- };
- FixedLine GB_CHAR_DIST
- {
- Pos = MAP_APPFONT ( 6, 43 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Character spacing";
- };
- RadioButton RB_NO_COMP
- {
- Pos = MAP_APPFONT ( 12, 54 ) ;
- Size = MAP_APPFONT ( 200 , 10 ) ;
- Text [ en-US ] = "~No compression";
- };
- RadioButton RB_PUNCT_COMP
- {
- Pos = MAP_APPFONT ( 12, 67) ;
- Size = MAP_APPFONT ( 200 , 10 ) ;
- Text [ en-US ] = "~Compress punctuation only";
- };
- RadioButton RB_PUNCT_KANA_COMP
- {
- Pos = MAP_APPFONT ( 12, 80 ) ;
- Size = MAP_APPFONT ( 200 , 10 ) ;
- Text [ en-US ] = "Compress ~punctuation and Japanese Kana";
- };
- FixedLine GB_START_END
- {
- Pos = MAP_APPFONT ( 6, 96 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "First and last characters";
- };
- FixedText FT_LANGUAGE
- {
- Pos = MAP_APPFONT ( 12 , 109 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "~Language";
- };
- ListBox LB_LANGUAGE
- {
- Pos = MAP_APPFONT ( 95 , 107 ) ;
- Size = MAP_APPFONT ( 80 , 48 ) ;
- Border = TRUE ;
- DropDown = TRUE ;
- };
- CheckBox CB_STANDARD
- {
- Pos = MAP_APPFONT ( 180, 109 ) ;
- Size = MAP_APPFONT ( 74 , 10 ) ;
- Text [ en-US ] = "~Default";
- };
- FixedText FT_START
- {
- Pos = MAP_APPFONT ( 12 , 125 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Not at start of line:";
- };
- Edit ED_START
- {
- Pos = MAP_APPFONT ( 95 , 123 ) ;
- Size = MAP_APPFONT ( 159 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_END
- {
- Pos = MAP_APPFONT ( 12 , 141 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Not at end of line:";
- };
- Edit ED_END
- {
- Pos = MAP_APPFONT ( 95 , 139 ) ;
- Size = MAP_APPFONT ( 159 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_HINT
- {
- Pos = MAP_APPFONT ( 12 , 155 ) ;
- Size = MAP_APPFONT ( 242 , 8 ) ;
- Text [ en-US ] = "Without user-defined line break symbols";
- };
- Text [ en-US ] = "Proxy";
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optchart.src b/svx/source/options/optchart.src
deleted file mode 100644
index baaa6acde7..0000000000
--- a/svx/source/options/optchart.src
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optchart.src,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "optchart.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-// tab page for setting the default colors used for new charts
-
-TabPage RID_OPTPAGE_CHART_DEFCOLORS
-{
- HelpID = HID_OPTIONS_CHART_DEFCOLORS;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE;
- Text [ en-US ] = "Default Colors";
- FixedLine FL_CHART_COLOR_LIST
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Chart colors";
- Text [ x-comment ] = " ";
- };
- ListBox LB_CHART_COLOR_LIST
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 12 , 15 );
- Size = MAP_APPFONT ( 68 , 152 );
- DropDown = FALSE;
- TabStop = TRUE ;
- };
- FixedLine FL_COLOR_BOX
- {
- Pos = MAP_APPFONT ( 92 , 3 ) ;
- Size = MAP_APPFONT ( 106 , 8 ) ;
- Text [ en-US ] = "Color table" ;
- Text [ x-comment ] = " ";
- };
- Control CT_COLOR_BOX
- {
- Border = TRUE;
- Pos = MAP_APPFONT ( 98 , 15 );
- Size = MAP_APPFONT ( 94 , 152 );
- TabStop = TRUE ;
- };
- PushButton PB_RESET_TO_DEFAULT
- {
- Pos = MAP_APPFONT ( 204 , 165 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Default";
- Text [ x-comment ] = " ";
- };
-};
-
-String RID_SVXSTR_DIAGRAM_ROW
-{
- // $(ROW) can be a number or the caption of the row in quotes
-
- Text [ en-US ] = "Data Series $(ROW)" ;
-};
diff --git a/svx/source/options/optcolor.src b/svx/source/options/optcolor.src
deleted file mode 100644
index dbf33e7522..0000000000
--- a/svx/source/options/optcolor.src
+++ /dev/null
@@ -1,552 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optcolor.src,v $
- * $Revision: 1.47.196.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <sfx2/sfx.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "optcolor.hrc"
- // pragma ----------------------------------------------------------------
-
-TabPage RID_SVXPAGE_COLORCONFIG
-{
- HelpId = HID_OPTIONS_COLORCONFIG ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_COLORSCHEME
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Color scheme";
- };
- FixedText FT_COLORSCHEME
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Scheme";
- };
- ListBox LB_COLORSCHEME
- {
- Pos = MAP_APPFONT ( 65 , 14 ) ;
- Size = MAP_APPFONT ( 77 , 58 ) ;
- Border = TRUE;
- Sort = TRUE;
- DropDown = TRUE;
- };
- PushButton PB_SAVESCHEME
- {
- Pos = MAP_APPFONT ( 145, 13 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "Save...";
- };
- PushButton PB_DELETESCHEME
- {
- Pos = MAP_APPFONT ( 198 , 13 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "Delete";
- };
- FixedLine FL_CUSTOMCOLORS
- {
- Pos = MAP_APPFONT ( 6 , 34 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
-
- Text [ en-US ] = "Custom colors";
- };
- Control CT_COLORCONFIG
- {
- Pos = MAP_APPFONT ( 12 , 45 ) ;
- Size = MAP_APPFONT ( 236 , 134 ) ;
- Border = TRUE;
- DialogControl = TRUE;
- OutputSize = TRUE ;
- ScrollBar VB_VSCROLL
- {
- Pos = MAP_APPFONT ( 228 , 10 ) ;
- Size = MAP_APPFONT ( 8 , 124 ) ;
- VScroll = TRUE;
- };
- String ST_ON
- {
- Text [ en-US ] = "On";
- };
- String ST_UIELEM
- {
- Text [ en-US ] = "User interface elements";
- };
- String ST_COLSET
- {
- Text [ en-US ] = "Color setting";
- };
- String ST_PREVIEW
- {
- Text [ en-US ] = "Preview";
- };
- Window WN_SCROLL
- {
-
-// misc defines to shorten defining of standard elements
-// standard sizes
-#define FT_SEP_SIZE Size = MAP_APPFONT ( _FT_WIDTH , 8 )
-#define FT_SIZE Size = MAP_APPFONT ( _FT_WIDTH , _FT_HEIGHT )
-#define LB_SIZE Size = MAP_APPFONT ( _LB_WIDTH , _LB_HEIGHT )
-#define WN_SIZE Size = MAP_APPFONT ( _WN_WIDTH , _WN_HEIGHT )
-#define CB_SIZE Size = MAP_APPFONT ( _CB_WIDTH , _FT_HEIGHT )
-
-// combination of position and size
-#define POS_SIZE( POSX, LINENUM, CONTRL_SIZE ) Pos = MAP_APPFONT ( POSX , LINENUM * _LINE_HEIGHT ) ; CONTRL_SIZE
-
-// ... for special types
-#define FT_SEP_POS_SIZE( LINENUM ) POS_SIZE( 14, LINENUM, FT_SEP_SIZE )
-#define FT_POS_SIZE( LINENUM ) POS_SIZE( _FT_XPOS, LINENUM, FT_SIZE )
-#define LB_POS_SIZE( LINENUM ) POS_SIZE( _LB_XPOS, LINENUM, LB_SIZE )
-#define WN_POS_SIZE( LINENUM ) POS_SIZE( _WN_XPOS, LINENUM, WN_SIZE )
-#define CB_POS_SIZE( LINENUM ) POS_SIZE( _CB_XPOS, LINENUM, CB_SIZE )
-
-// combination of a listbox (color chooser) and window (color preview)
-#define LB_WN( ID_POST, LINENUM ) ListBox LB_#ID_POST{LB_POS_SIZE(LINENUM);DropDown=TRUE;};Window WN_#ID_POST{WN_POS_SIZE(LINENUM);Border=TRUE;};
-
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 0 , 10 ) ;
- Size = MAP_APPFONT ( 228 , 124 ) ;
- DialogControl = TRUE;
-
- FixedText FT_GENERAL
- {
- FT_SEP_POS_SIZE( 0 );
- Text [ en-US ] = "General";
- };
-
- FixedText FT_DOCCOLOR
- {
- FT_POS_SIZE( 1 );
- Text [ en-US ] = "Document background";
- };
- LB_WN( DOCCOLOR, 1 )
-
- CheckBox CB_DOCBOUND
- {
- CB_POS_SIZE( 2 );
- Text [ en-US ] = "Text boundaries";
- };
- LB_WN( DOCBOUND, 2 )
-
- FixedText FT_APPBACKGROUND
- {
- FT_POS_SIZE( 3 );
- Text [ en-US ] = "Application background";
- };
- LB_WN( APPBACKGROUND, 3 )
-
- CheckBox CB_OBJECTBOUNDARIES
- {
- CB_POS_SIZE( 4 );
- Text [ en-US ] = "Object boundaries";
- };
- LB_WN( OBJECTBOUNDARIES, 4 )
-
- CheckBox CB_TABLEBOUNDARIES
- {
- CB_POS_SIZE( 5 );
- Text [ en-US ] = "Table boundaries";
- };
- LB_WN( TABLEBOUNDARIES, 5 )
-
- FixedText FT_FONTCOLOR
- {
- FT_POS_SIZE( 6 );
- Text [ en-US ] = "Font color";
- };
- LB_WN( FONTCOLOR, 6 )
-
- CheckBox CB_LINKS
- {
- CB_POS_SIZE( 7 );
- Text [ en-US ] = "Unvisited links";
- };
- LB_WN( LINKS, 7 )
-
- CheckBox CB_LINKSVISITED
- {
- CB_POS_SIZE( 8 );
- Text [ en-US ] = "Visited links";
- };
- LB_WN( LINKSVISITED, 8 )
-
- FixedText FT_SPELL
- {
- FT_POS_SIZE( 9 );
- Text [ en-US ] = "AutoSpellcheck";
- };
- LB_WN( SPELL, 9 )
-
- FixedText FT_SMARTTAGS
- {
- FT_POS_SIZE( 10 );
- Text [ en-US ] = "Smart Tags";
- };
- LB_WN( SMARTTAGS, 10 )
-
- FixedText FT_WRITER
- {
- FT_SEP_POS_SIZE( 11 );
- Text [ en-US ] = "Text Document";
- };
-
- FixedText FT_WRITERTEXTGRID
- {
- FT_POS_SIZE( 12 );
- Text [ en-US ] = "Grid";
- };
- LB_WN( WRITERTEXTGRID, 12 )
-
- CheckBox CB_WRITERFIELDSHADINGS
- {
- CB_POS_SIZE( 13 );
- Text [ en-US ] = "Field shadings";
- };
- LB_WN( WRITERFIELDSHADINGS, 13 )
-
- CheckBox CB_WRITERIDXSHADINGS
- {
- CB_POS_SIZE( 14 );
- Text [ en-US ] = "Index and table shadings";
- };
- LB_WN( WRITERIDXSHADINGS, 14 )
-
-
- FixedText FT_WRITERSCRIPTINDICATOR
- {
- FT_POS_SIZE( 15 );
- Text [ en-US ] = "Script indicator";
- };
- LB_WN( WRITERSCRIPTINDICATOR, 15 )
-
- CheckBox CB_WRITERSECTIONBOUNDARIES
- {
- CB_POS_SIZE( 16 );
- Text [ en-US ] = "Section boundaries";
- };
- LB_WN( WRITERSECTIONBOUNDARIES, 16 )
-
- FixedText FT_WRITERPAGEBREAKS
- {
- FT_POS_SIZE( 17 );
- Text [ en-US ] = "Page and column breaks";
- };
- LB_WN( WRITERPAGEBREAKS, 17 )
-
- FixedText FT_WRITERDIRECTCURSOR
- {
- FT_POS_SIZE( 18 );
- Text [ en-US ] = "Direct cursor";
- };
- LB_WN( WRITERDIRECTCURSOR, 18 )
-
- FixedText FT_HTML
- {
- FT_SEP_POS_SIZE( 19 );
- Text [ en-US ] = "HTML Document";
- };
-
- FixedText FT_HTMLSGML
- {
- FT_POS_SIZE( 20 );
- Text [ en-US ] = "SGML syntax highlighting";
- };
- LB_WN( HTMLSGML, 20 )
-
- FixedText FT_HTMLCOMMENT
- {
- FT_POS_SIZE( 21 );
- Text [ en-US ] = "Comment highlighting";
- };
- LB_WN( HTMLCOMMENT, 21 )
-
- FixedText FT_HTMLKEYWORD
- {
- FT_POS_SIZE( 22 );
- Text [ en-US ] = "Keyword highlighting";
- };
- LB_WN( HTMLKEYWORD, 22 )
-
- FixedText FT_HTMLUNKNOWN
- {
- FT_POS_SIZE( 23 );
- Text [ en-US ] = "Text";
- };
- LB_WN( HTMLUNKNOWN, 23 )
-
- FixedText FT_CALC
- {
- FT_SEP_POS_SIZE( 24 );
- Text [ en-US ] = "Spreadsheet";
- };
-
- FixedText FT_CALCGRID
- {
- FT_POS_SIZE( 25 );
- Text [ en-US ] = "Grid lines";
- };
- LB_WN( CALCGRID, 25 )
-
- FixedText FT_CALCPAGEBREAK
- {
- FT_POS_SIZE( 26 );
- Text [ en-US ] = "Page breaks";
- };
- LB_WN( CALCPAGEBREAK, 26 )
-
- FixedText FT_CALCPAGEBREAKMANUAL
- {
- FT_POS_SIZE( 27 );
- Text [ en-US ] = "Manual page breaks";
- };
- LB_WN( CALCPAGEBREAKMANUAL, 27 )
-
- FixedText FT_CALCPAGEBREAKAUTO
- {
- FT_POS_SIZE( 28 );
- Text [ en-US ] = "Automatic page breaks";
- };
- LB_WN( CALCPAGEBREAKAUTO, 28)
-
- FixedText FT_CALCDETECTIVE
- {
- FT_POS_SIZE( 29 );
- Text [ en-US ] = "Detective";
- };
- LB_WN( CALCDETECTIVE, 29 )
-
- FixedText FT_CALCDETECTIVEERROR
- {
- FT_POS_SIZE( 30 );
- Text [ en-US ] = "Detective error";
- };
- LB_WN( CALCDETECTIVEERROR, 30 )
-
- FixedText FT_CALCREFERENCE
- {
- FT_POS_SIZE( 31 );
- Text [ en-US ] = "References";
- };
- LB_WN( CALCREFERENCE, 31 )
-
- FixedText FT_CALCNOTESBACKGROUND
- {
- FT_POS_SIZE( 32 );
- Text [ en-US ] = "Notes background";
- };
- LB_WN( CALCNOTESBACKGROUND, 32 )
-
- FixedText FT_DRAW
- {
- FT_SEP_POS_SIZE( 33 );
- Text [ en-US ] = "Drawing / Presentation";
- };
-
- FixedText FT_DRAWGRID
- {
- FT_POS_SIZE( 34 );
- Text [ en-US ] = "Grid";
- };
- LB_WN( DRAWGRID, 34 )
-
- FixedText FT_BASIC
- {
- FT_SEP_POS_SIZE( 35 );
- Text [ en-US ] = "Basic Syntax Highlighting";
- };
-
- FixedText FT_BASICIDENTIFIER
- {
- FT_POS_SIZE( 36 );
- Text [ en-US ] = "Identifier";
- };
- LB_WN( BASICIDENTIFIER, 36 )
-
- FixedText FT_BASICCOMMENT
- {
- FT_POS_SIZE( 37 );
- Text [ en-US ] = "Comment";
- };
- LB_WN( BASICCOMMENT, 37 )
-
- FixedText FT_BASICNUMBER
- {
- FT_POS_SIZE( 38 );
- Text [ en-US ] = "Number";
- };
- LB_WN( BASICNUMBER, 38)
-
- FixedText FT_BASICSTRING
- {
- FT_POS_SIZE( 39 );
- Text [ en-US ] = "String";
- };
- LB_WN( BASICSTRING, 39 )
-
- FixedText FT_BASICOPERATOR
- {
- FT_POS_SIZE( 40 );
- Text [ en-US ] = "Operator";
- };
- LB_WN( BASICOPERATOR, 40 )
-
- FixedText FT_BASICKEYWORD
- {
- FT_POS_SIZE( 41 );
- Text [ en-US ] = "Reserved expression";
- };
- LB_WN( BASICKEYWORD, 41 )
-
- FixedText FT_BASICERROR
- {
- FT_POS_SIZE( 42 );
- Text [ en-US ] = "Error";
- };
- LB_WN( BASICERROR, 42 )
-
- FixedText FT_SQL_COMMAND
- {
- FT_SEP_POS_SIZE( 43 );
- Text [ en-US ] = "SQL Syntax Highlighting";
- };
-
- FixedText FT_SQLIDENTIFIER
- {
- FT_POS_SIZE( 44 );
- Text [ en-US ] = "Identifier";
- };
- LB_WN( SQLIDENTIFIER, 44 )
-
- FixedText FT_SQLNUMBER
- {
- FT_POS_SIZE( 45 );
- Text [ en-US ] = "Number";
- };
- LB_WN( SQLNUMBER, 45 )
-
- FixedText FT_SQLSTRING
- {
- FT_POS_SIZE( 46 );
- Text [ en-US ] = "String";
- };
- LB_WN( SQLSTRING, 46 )
-
- FixedText FT_SQLOPERATOR
- {
- FT_POS_SIZE( 47 );
- Text [ en-US ] = "Operator";
- };
- LB_WN( SQLOPERATOR, 47 )
-
- FixedText FT_SQLKEYWORD
- {
- FT_POS_SIZE( 48 );
- Text [ en-US ] = "Keyword";
- };
- LB_WN( SQLKEYWORD, 48 )
-
- FixedText FT_SQLPARAMETER
- {
- FT_POS_SIZE( 49 );
- Text [ en-US ] = "Parameter";
- };
- LB_WN( SQLPARAMETER, 49 )
-
- FixedText FT_SQLCOMMENT
- {
- FT_POS_SIZE( 50 );
- Text [ en-US ] = "Comment";
- };
- LB_WN( SQLCOMMENT, 50 )
-
- String ST_EXTENSION
- {
- Text [ en-US ] = "Colorsettings of the Extensions";
- };
- String ST_SPELL_CHECK_HIGHLIGHTING
- {
- Text [ en-US ] = "Spell check highlighting";
- };
- String ST_GRAMMAR_CHECK_HIGHLIGHTING
- {
- Text [ en-US ] = "Grammar check highlighting";
- };
- };
- };
-};
-QueryBox RID_SVXQB_DELETE_COLOR_CONFIG
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- Message [ en-US ] = "Do you really want to delete the color scheme?" ;
-};
-String RID_SVXSTR_COLOR_CONFIG_DELETE
-{
- Text [ en-US ] = "Color Scheme Deletion" ;
-};
-String RID_SVXSTR_COLOR_CONFIG_SAVE1
-{
- Text [ en-US ] = "Save scheme" ;
-};
-String RID_SVXSTR_COLOR_CONFIG_SAVE2
-{
- Text [ en-US ] = "Name of color scheme" ;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optctl.src b/svx/source/options/optctl.src
deleted file mode 100644
index 7841b17b16..0000000000
--- a/svx/source/options/optctl.src
+++ /dev/null
@@ -1,119 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optctl.src,v $
- * $Revision: 1.20.254.1 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "optctl.hrc"
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-
-#include <sfx2/sfx.hrc>
-
-TabPage RID_SVXPAGE_OPTIONS_CTL
-{
- HelpId = HID_OPTIONS_CTL ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "Complex Text Layout" ;
- FixedLine FL_SEQUENCECHECKING
- {
- Pos = MAP_APPFONT ( 6, ROW_0 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Sequence checking";
- };
- CheckBox CB_SEQUENCECHECKING
- {
- Pos = MAP_APPFONT ( 12, ROW_1 ) ;
- Size = MAP_APPFONT ( 236 , RSC_CD_CHECKBOX_HEIGHT ) ;
- Text [ en-US ] = "Use se~quence checking";
- };
- CheckBox CB_RESTRICTED
- {
- Pos = MAP_APPFONT ( 18, ROW_2 );
- Size = MAP_APPFONT ( 236, RSC_CD_CHECKBOX_HEIGHT );
- Text[ en-US ] = "Restricted";
- };
- CheckBox CB_TYPE_REPLACE
- {
- Pos = MAP_APPFONT ( 18, ROW_2+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y );
- Size = MAP_APPFONT ( 236, RSC_CD_CHECKBOX_HEIGHT );
- Text[ en-US ] = "~Type and replace";
- };
- FixedLine FL_CURSORCONTROL
- {
- Pos = MAP_APPFONT ( 6, ROW_3 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Cursor control";
- };
- FixedText FT_MOVEMENT
- {
- Pos = MAP_APPFONT ( 12, ROW_5 ) ;
- Size = MAP_APPFONT ( 90 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Movement";
- };
- RadioButton RB_MOVEMENT_LOGICAL
- {
- Pos = MAP_APPFONT ( 105, ROW_4 ) ;
- Size = MAP_APPFONT ( 69 , RSC_CD_RADIOBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Lo~gical";
- };
- RadioButton RB_MOVEMENT_VISUAL
- {
- Pos = MAP_APPFONT ( 177, ROW_4 ) ;
- Size = MAP_APPFONT ( 69 , RSC_CD_RADIOBUTTON_HEIGHT ) ;
- Text [ en-US ] = "~Visual";
- };
- FixedLine FL_GENERAL
- {
- Pos = MAP_APPFONT ( 6, ROW_6 ) ;
- Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "General options";
- };
- FixedText FT_NUMERALS
- {
- Pos = MAP_APPFONT ( 12, ROW_8 ) ;
- Size = MAP_APPFONT ( 90 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "~Numerals";
- };
- ListBox LB_NUMERALS
- {
- Pos = MAP_APPFONT ( 105, ROW_7 ) ;
- Size = MAP_APPFONT ( 69 , 3*RSC_CD_DROPDOWN_HEIGHT ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- StringList [ en-US ]=
- {
- < "Arabic" ; > ;
- < "Hindi" ; > ;
- < "System" ; > ;
- < "Context" ; > ;
- };
- };
-};
diff --git a/svx/source/options/optdict.src b/svx/source/options/optdict.src
deleted file mode 100644
index 0e52166591..0000000000
--- a/svx/source/options/optdict.src
+++ /dev/null
@@ -1,282 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optdict.src,v $
- * $Revision: 1.31 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ---------------------------------------------------------------
-#include <sfx2/sfx.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "optdict.hrc"
- // pragma ----------------------------------------------------------------
-
- // RID_SFXDLG_NEWDICT ----------------------------------------------------
-ModalDialog RID_SFXDLG_NEWDICT
-{
- HelpId = HID_OPTIONS_DICT_NEW ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 213 , 66 ) ;
- Moveable = TRUE ;
- /* ### ACHTUNG: Neuer Text in Resource? Benutzerwörterbuch anlegen : Benutzerw÷rterbuch anlegen */
- /* ### ACHTUNG: Neuer Text in Resource? Benutzerwörterbuch anlegen : Benutzerw÷rterbuch anlegen */
- Text [ en-US ] = "New Dictionary" ;
- FixedText FT_DICTNAME
- {
- Pos = MAP_APPFONT ( 11 , 15 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Name" ;
- LeftLabel = TRUE ;
- };
- Edit ED_DICTNAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 14 ) ;
- Size = MAP_APPFONT ( 90 , 12 ) ;
- MaxTextLength = 32 ;
- };
- FixedText FT_DICTLANG
- {
- Pos = MAP_APPFONT ( 12 , 30 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "~Language" ;
- LeftLabel = TRUE ;
- };
- ListBox LB_DICTLANG
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 55 , 30 ) ;
- Size = MAP_APPFONT ( 90 , 66 ) ;
- DropDown = TRUE ;
- };
- CheckBox BTN_EXCEPT
- {
- Pos = MAP_APPFONT ( 12 , 44 ) ;
- Size = MAP_APPFONT ( 57 , 10 ) ;
- Text [ en-US ] = "~Exception (-)" ;
- };
- FixedLine GB_NEWDICT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 145 , 8 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Wörterbuch : W÷rterbuch */
- /* ### ACHTUNG: Neuer Text in Resource? Wörterbuch : W÷rterbuch */
- Text [ en-US ] = "Dictionary" ;
- };
- OKButton BTN_NEWDICT_OK
- {
- Pos = MAP_APPFONT ( 157 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Disable = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_NEWDICT_ESC
- {
- Pos = MAP_APPFONT ( 157 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_NEWDICT_HLP
- {
- Pos = MAP_APPFONT ( 157 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
- // RID_SFXDLG_EDITDICT ---------------------------------------------------
-ModalDialog RID_SFXDLG_EDITDICT
-{
- HelpId = HID_OPTIONS_DICT_EDIT ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT( 270, 161 );
-
- /* ### ACHTUNG: Neuer Text in Resource? Benutzerwörterbuch bearbeiten : Benutzerw÷rterbuch bearbeiten */
- /* ### ACHTUNG: Neuer Text in Resource? Benutzerwörterbuch bearbeiten : Benutzerw÷rterbuch bearbeiten */
- Text [ en-US ] = "Edit Custom Dictionary" ;
-
- Moveable = TRUE ;
- FixedText FT_BOOK
- {
- Pos = MAP_APPFONT ( 12 , 10 ) ;
- Size = MAP_APPFONT ( 86 , 10 ) ;
- Text [ en-US ] = "~Book" ;
- };
- ListBox LB_ALLDICTS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 82 , 9 ) ;
- Size = MAP_APPFONT ( 121 , 62 ) ;
- DropDown = TRUE ;
- };
- FixedText FT_DICTLANG
- {
- Pos = MAP_APPFONT ( 12 , 26 ) ;
- Size = MAP_APPFONT ( 86 , 10 ) ;
- Text [ en-US ] = "~Language" ;
- };
- ListBox LB_DICTLANG
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 82 , 25 ) ;
- Size = MAP_APPFONT ( 121 , 66 ) ;
- DropDown = TRUE ;
- };
-
- FixedLine GB_EDITDICTS
- {
- Pos = MAP_APPFONT( 1, 1 );
- Size = MAP_APPFONT( 268, 138 );
- Hide=TRUE;
- };
-
- FixedText FT_WORD
- {
- Pos = MAP_APPFONT ( 13 , 46 ) ;
- Size = MAP_APPFONT ( 40 , 8 ) ;
- Text [ en-US ] = "~Word";
- };
- Edit ED_WORD
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 71 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- FixedText FT_REPLACE
- {
- Pos = MAP_APPFONT ( 84 , 46 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "Replace ~By:";
- };
-
- Edit ED_REPLACE
- {
- Pos = MAP_APPFONT ( 83 , 56 ) ;
- Size = MAP_APPFONT ( 120 , 12 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
-
- PushButton PB_NEW_REPLACE
- {
- Pos = MAP_APPFONT ( 209 , 56 ) ;
- Size = MAP_APPFONT ( 55 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~New" ;
- };
- PushButton PB_DELETE_REPLACE
- {
- Pos = MAP_APPFONT ( 209 , 71 ) ;
- Size = MAP_APPFONT ( 55 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Delete" ;
- };
- Control TLB_REPLACE
- {
- HelpId = HID_OPTIONS_DICT_EDIT_ENTRIES_LIST;
- Pos = MAP_APPFONT ( 12 , 71 ) ;
- Size = MAP_APPFONT ( 191 , 58 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- String STR_MODIFY
- {
- Text [ en-US ] = "~Replace" ;
- };
-
-
-
- HelpButton BTN_EDITHELP
- {
- Pos = MAP_APPFONT( 145, 143 );
- Size = MAP_APPFONT( 55, 14 );
- };
-
- CancelButton BTN_EDITCLOSE
- {
- Pos = MAP_APPFONT ( 209 , 143 ) ;
- Size = MAP_APPFONT ( 55 , 14 ) ;
-
- /* ### ACHTUNG: Neuer Text in Resource? ~Schließen : ~Schlie˜en */
- /* ### ACHTUNG: Neuer Text in Resource? ~Schließen : ~Schlie˜en */
- Text [ en-US ] = "~Close" ;
- };
-};
-
- // Strings ---------------------------------------------------------------
-String RID_SVXSTR_OPT_DOUBLE_DICTS
-{
- Text [ en-US ] = "The specified name already exists.\nPlease enter a new name." ;
-};
- // RID_SFXQB_SET_LANGUAGE ------------------------------------------------
-QueryBox RID_SFXQB_SET_LANGUAGE
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- /* ### ACHTUNG: Neuer Text in Resource? Möchten Sie die Sprache des Wörterbuches '%1' ändern? : Möchten Sie die Sprache des Wörterbuches ''%1'' ändern? */
- /* ### ACHTUNG: Neuer Text in Resource? Möchten Sie die Sprache des Wörterbuches '%1' ändern? : Möchten Sie die Sprache des Wörterbuches ''%1'' ändern? */
- /* ### ACHTUNG: Neuer Text in Resource? Möchten Sie die Sprache des Wörterbuches '%1' ändern? : M÷chten Sie die Sprache des W÷rterbuches '%1' õndern? */
- /* ### ACHTUNG: Neuer Text in Resource? Möchten Sie die Sprache des Wörterbuches '%1' ändern? : M÷chten Sie die Sprache des W÷rterbuches '%1' õndern? */
- Message [ en-US ] = "Do you want to change the '%1' dictionary language?" ;
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optgenrl.src b/svx/source/options/optgenrl.src
deleted file mode 100644
index 68e9e8ced7..0000000000
--- a/svx/source/options/optgenrl.src
+++ /dev/null
@@ -1,333 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optgenrl.src,v $
- * $Revision: 1.57 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include ------------------------------------------------------------------
-
-#include <sfx2/sfx.hrc>
-
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "optgenrl.hrc"
-
-// RID_SFXPAGE_GENERAL ------------------------------------------------------
-
-TabPage RID_SFXPAGE_GENERAL
-{
- HelpId = HID_OPTIONS_GENERAL ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "User Data" ;
- FixedText FT_COMPANY
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 0 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "~Company" ;
- };
- Edit ED_COMPANY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 0 ) ) ;
- Size = MAP_APPFONT ( RIGHT-MID , LINEH ) ;
- };
- FixedText FT_NAME
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 1 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "First/Last ~name/Initials" ;
- };
- FixedText FT_NAME_RUSS
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 1 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Hide = TRUE;
- Text [ en-US ] = "Last Name/First name/Father's name/Initials";
- };
- FixedText FT_NAME_EASTERN
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 1 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Hide = TRUE;
- Text [ en-US ] = "Last/First ~name/Initials" ;
- };
- Edit ED_FATHERNAME
- {
- Border = TRUE ;
- Hide = TRUE;
- Pos = MAP_APPFONT ( MID , LINE ( 1 ) ) ;
- Size = MAP_APPFONT ( NAMELEN-8 , LINEH ) ;
- };
- Edit ED_FIRSTNAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 1 ) ) ;
- Size = MAP_APPFONT ( NAMELEN-8 , LINEH ) ;
- };
- Edit ED_NAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID+NAMELEN-8+HSPACE , LINE ( 1 ) ) ;
- Size = MAP_APPFONT ( NAMELEN-8 , LINEH ) ;
- };
- Edit ED_SHORTNAME
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID+2* ( NAMELEN-8+HSPACE ) , LINE ( 1 ) ) ;
- Size = MAP_APPFONT ( RIGHT- ( MID+2* ( NAMELEN-8+HSPACE ) ) , LINEH ) ;
- };
- FixedText FT_STREET
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 2 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "~Street" ;
- };
- FixedText FT_STREET_RUSS
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 2 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Hide = TRUE;
- Text [ en-US ] = "Street/Apartment number";
- };
- Edit ED_STREET
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 2 ) ) ;
- Size = MAP_APPFONT ( RIGHT-MID , LINEH ) ;
- };
- Edit ED_APARTMENTNR
- {
- Border = TRUE ;
- Hide = TRUE;
- Pos = MAP_APPFONT ( MID , LINE ( 2 ) ) ;
- Size = MAP_APPFONT ( RIGHT-MID , LINEH ) ;
- };
- FixedText FT_CITY
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 3 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Zip/City";
- };
- Edit ED_PLZ
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 3 ) ) ;
- Size = MAP_APPFONT ( 24 , LINEH ) ;
- };
- Edit ED_CITY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID + 24 + HSPACE , LINE ( 3 ) ) ;
- Size = MAP_APPFONT ( RIGHT - ( MID + 24 + HSPACE ) , LINEH ) ;
- };
- Edit ED_US_CITY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 3 ) ) ;
- Size = MAP_APPFONT ( 90 , LINEH ) ;
- };
- Edit ED_US_STATE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID + 90 + HSPACE, LINE ( 3 ) ) ;
- Size = MAP_APPFONT ( 30 , LINEH ) ;
- };
- Edit ED_US_ZIPCODE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID + 90 + HSPACE + 30 + HSPACE, LINE ( 3 ) ) ;
- Size = MAP_APPFONT ( RIGHT - ( MID + 90 + HSPACE + 30 + HSPACE ) , LINEH ) ;
- };
- FixedText FT_COUNTRY
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 4 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Country/Region";
- };
- Edit ED_COUNTRY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 4 ) ) ;
- Size = MAP_APPFONT ( RIGHT - MID , LINEH ) ;
- };
- FixedText FT_TITLEPOS
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 5 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "~Title/Position" ;
- };
- Edit ED_TITLE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 5 ) ) ;
- Size = MAP_APPFONT ( NAMELEN-1 , LINEH ) ;
- };
- Edit ED_POSITION
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID+NAMELEN-1+HSPACE , LINE ( 5 ) ) ;
- Size = MAP_APPFONT ( RIGHT- ( MID+NAMELEN-1+HSPACE ) , LINEH ) ;
- };
- FixedText FT_PHONE
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 6 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- Text [ en-US ] = "Tel. (Home/Work)" ;
- LeftLabel = TRUE ;
- };
- Edit ED_TELPRIVAT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 6 ) ) ;
- Size = MAP_APPFONT ( NAMELEN-1 , LINEH ) ;
- };
- Edit ED_TELCOMPANY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID+NAMELEN-1+HSPACE , LINE ( 6 ) ) ;
- Size = MAP_APPFONT ( RIGHT- ( MID+NAMELEN-1+HSPACE ) , LINEH ) ;
- };
- FixedText FT_FAXMAIL
- {
- Pos = MAP_APPFONT ( LEFT , FLINE ( 7 ) ) ;
- Size = MAP_APPFONT ( MID-LEFT-2 , FLINEH ) ;
- LeftLabel = TRUE ;
- Text [ en-US ] = "Fa~x / E-mail" ;
- };
- Edit ED_FAX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID , LINE ( 7 ) ) ;
- Size = MAP_APPFONT ( NAMELEN-1 , LINEH ) ;
- };
- Edit ED_EMAIL
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( MID+NAMELEN-1+HSPACE , LINE ( 7 ) ) ;
- Size = MAP_APPFONT ( RIGHT- ( MID+NAMELEN-1+HSPACE ) , LINEH ) ;
- };
- FixedLine GB_ADDRESS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Address " ;
- };
- CheckBox CB_USEDATA
- {
- Pos = MAP_APPFONT ( 6 , 122 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Hide = TRUE;
- Text [ en-US ] = "Use data for document properties";
- };
-
- // extra Resourcen f"ur die amerikanische Postadresse
- String STR_US_STATE
- {
- Text [ en-US ] = "City/State/Zip";
- };
- String STR_QUERY_REG
- {
- Text [ en-US ] = "Note that street, Zip code and city are used to generate the registration key. You will not be able to change the user data again until the registration has been carried out. Do you want to modify the user data now?";
- };
-};
-
-// RID_SVXQB_CHANGEDATA ---------------------------------------------------
-
-QueryBox RID_SVXQB_CHANGEDATA
-{
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_NO ;
- Message [ en-US ] = "The User Data have been changed.\nNote that, if you continue, the registration key will become invalid.\nTherefore, a new registration key is needed within 30 days.\nYou can find the registration form in the menu Help - Registration...\nDo you really want to change your User Data?";
-};
-
- // RID_SVXSTR_FIELDUNIT_TABLE --------------------------------------------
-
-StringArray RID_SVXSTR_FIELDUNIT_TABLE
-{
- ItemList [ en-US ] =
- {
- < "Millimeter" ; FUNIT_MM ; > ;
- < "Centimeter" ; FUNIT_CM ; > ;
- < "Meter" ; FUNIT_M ; > ;
- < "Kilometer" ; FUNIT_KM ; > ;
- < "Inch" ; FUNIT_INCH ; > ;
- < "Foot" ; FUNIT_FOOT ; > ;
- < "Miles" ; FUNIT_MILE ; > ;
- < "Pica" ; FUNIT_PICA ; > ;
- < "Point" ; FUNIT_POINT ; > ;
- };
- };
-
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optimprove.src b/svx/source/options/optimprove.src
deleted file mode 100644
index 86fc6d1c1a..0000000000
--- a/svx/source/options/optimprove.src
+++ /dev/null
@@ -1,123 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optimprove.src,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include --------------------------------------------------------------
-
-#include "optimprove.hrc"
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-TabPage RID_SVXPAGE_IMPROVEMENT
-{
- //!HelpId = HID_OPTIONS_IMPROVEMENT ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "%PRODUCTNAME Improvement Program" ;
- FixedLine FL_IMPROVE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Improvement Program" ;
- };
- FixedText FT_INVITATION
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 242 , 72 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "We invite you to join our %PRODUCTNAME Improvement Program to help optimize the quality of %PRODUCTNAME.\n\nIf you are willing to participate, we will collect anonymous statistics about how you use %PRODUCTNAME. The data is used to identify usage patterns.\n\nThe %PRODUCTNAME Improvement Program will not collect any personal data, or document content." ;
- };
- RadioButton RB_YES
- {
- Pos = MAP_APPFONT ( 12 , 92 ) ;
- Size = MAP_APPFONT ( 215 , 10 ) ;
- Check = TRUE ;
- Text [ en-US ] = "~Yes, I am willing to participate in the %PRODUCTNAME Improvement Program" ;
- };
- RadioButton RB_NO
- {
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 215 , 10 ) ;
- Text [ en-US ] = "~No, I do not wish to participate" ;
- };
- FixedImage FI_INFO
- {
- Pos = MAP_APPFONT ( 230 , 91 ) ;
- Size = MAP_APPFONT ( 24 , 24 ) ;
- Fixed = Image
- {
- ImageBitmap = Bitmap { File = "info.png"; };
- };
- };
- FixedLine FL_DATA
- {
- Pos = MAP_APPFONT ( 6 , 121 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Tracked Data" ;
- };
- FixedText FT_NR_REPORTS
- {
- Pos = MAP_APPFONT ( 12 , 132 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Number of reports sent:" ;
- };
- FixedText FT_NR_REPORTS_VALUE
- {
- Pos = MAP_APPFONT ( 95 , 132 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- FixedText FT_NR_ACTIONS
- {
- Pos = MAP_APPFONT ( 12 , 145 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Number of tracked actions:" ;
- };
- FixedText FT_NR_ACTIONS_VALUE
- {
- Pos = MAP_APPFONT ( 95 , 145 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- PushButton PB_SHOWDATA
- {
- Pos = MAP_APPFONT ( 12 , 161 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Show Data" ;
- };
- String STR_INFO
- {
- Text [ en-US ] = "Help Optimize the Quality of %PRODUCTNAME" ;
- };
- String STR_MOREINFO
- {
- Text [ en-US ] = "More Information" ;
- };
-};
-
diff --git a/svx/source/options/optinet2.src b/svx/source/options/optinet2.src
deleted file mode 100644
index d2b9ecb1bb..0000000000
--- a/svx/source/options/optinet2.src
+++ /dev/null
@@ -1,647 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optinet2.src,v $
- * $Revision: 1.97 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ------------------------------------------------------------------
-#include <sfx2/sfx.hrc>
-#include "helpid.hrc"
-#include <svx/dialogs.hrc>
-#include "optinet2.hrc"
- // pragma -------------------------------------------------------------------
-
-/************************************************************************/
-/* */
-/* Proxy server */
-/* */
-/************************************************************************/
-
-// added by jmeng begin
-
-TabPage RID_SVXPAGE_INET_MOZPLUGIN
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
-
- FixedLine GB_MOZPLUGIN
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text[ en-US ] = "Browser Plug-in";
- };
- CheckBox CB_MOZPLUGIN_CODE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Display documents in browser" ;
- };
-};
-
-//added by jmeng end
-
-TabPage RID_SVXPAGE_INET_PROXY
-{
- HelpId = HID_OPTIONS_PROXY ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "Proxy" ;
- #define GB_TYPES_TOP 3
- #define GB_TYPES_LEFT 6
- FixedLine GB_SETTINGS
- {
- Pos = MAP_APPFONT ( GB_TYPES_LEFT , GB_TYPES_TOP ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Settings" ;
- };
- FixedText FT_PROXYMODE
- {
- Pos = MAP_APPFONT ( 12 , GB_TYPES_TOP + 13 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "Proxy s~erver" ;
- };
- ListBox LB_PROXYMODE
- {
- Pos = MAP_APPFONT ( 65 , GB_TYPES_TOP + 11 ) ;
- Size = MAP_APPFONT ( 49 , 48 ) ;
- Border = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "None" ; > ;
- < "System" ; > ;
- < "Manual" ; > ;
- };
- };
- String ST_PROXY_FROM_BROWSER
- {
- Text [ en-US ] = "Use browser settings";
- };
- FixedText FT_HTTP_PROXY
- {
- Pos = MAP_APPFONT ( 12 , GB_TYPES_TOP + 29 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "HT~TP proxy" ;
- };
- Edit ED_HTTP_PROXY
- {
- Pos = MAP_APPFONT ( 65 , GB_TYPES_TOP + 27 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- Border = TRUE ;
- };
-
- #define FT_PORT_WIDTH 37
- #define ED_PORT_WIDTH 20
- #define ED_PORT_COL 229
-
- FixedText FT_HTTP_PORT
- {
- Pos = MAP_APPFONT ( 190 , GB_TYPES_TOP + 29 ) ;
- Size = MAP_APPFONT ( FT_PORT_WIDTH , 8 ) ;
- Right = TRUE;
- Text [ en-US ] = "~Port" ;
- };
- Edit ED_HTTP_PORT
- {
- Pos = MAP_APPFONT ( ED_PORT_COL , GB_TYPES_TOP + 27 ) ;
- Size = MAP_APPFONT ( ED_PORT_WIDTH , 12 ) ;
- Border = TRUE ;
- };
-
- FixedText FT_HTTPS_PROXY
- {
- Pos = MAP_APPFONT ( 12 , GB_TYPES_TOP + 45 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "HTTP~S proxy" ;
- };
- Edit ED_HTTPS_PROXY
- {
- Pos = MAP_APPFONT ( 65 , GB_TYPES_TOP + 43 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_HTTPS_PORT
- {
- Pos = MAP_APPFONT ( 190 , GB_TYPES_TOP + 45 ) ;
- Size = MAP_APPFONT ( FT_PORT_WIDTH , 8 ) ;
- Right = TRUE;
- Text [ en-US ] = "P~ort" ;
- };
- Edit ED_HTTPS_PORT
- {
- Pos = MAP_APPFONT ( ED_PORT_COL , GB_TYPES_TOP + 43 ) ;
- Size = MAP_APPFONT ( ED_PORT_WIDTH , 12 ) ;
- Border = TRUE ;
- };
-
- FixedText FT_FTP_PROXY
- {
- Pos = MAP_APPFONT ( 12 , GB_TYPES_TOP + 61 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~FTP proxy" ;
- };
- Edit ED_FTP_PROXY
- {
- Pos = MAP_APPFONT ( 65 , GB_TYPES_TOP + 59 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_FTP_PORT
- {
- Pos = MAP_APPFONT ( 190 , GB_TYPES_TOP + 61 ) ;
- Size = MAP_APPFONT ( FT_PORT_WIDTH , 8 ) ;
- Right = TRUE;
- Text [ en-US ] = "P~ort" ;
- };
- Edit ED_FTP_PORT
- {
- Pos = MAP_APPFONT ( ED_PORT_COL , GB_TYPES_TOP + 59 ) ;
- Size = MAP_APPFONT ( ED_PORT_WIDTH , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_SOCKS_PROXY
- {
- Pos = MAP_APPFONT ( 12 , GB_TYPES_TOP + 77 ) ;
- Size = MAP_APPFONT ( 50 , 10 ) ;
- Text [ en-US ] = "~SOCKS proxy" ;
- };
- Edit ED_SOCKS_PROXY
- {
- Pos = MAP_APPFONT ( 65 , GB_TYPES_TOP + 75 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_SOCKS_PORT
- {
- Pos = MAP_APPFONT ( 190 , GB_TYPES_TOP + 77 ) ;
- Size = MAP_APPFONT ( FT_PORT_WIDTH , 8 ) ;
- Right = TRUE;
- Text [ en-US ] = "Po~rt" ;
- };
- Edit ED_SOCKS_PORT
- {
- Pos = MAP_APPFONT ( ED_PORT_COL , GB_TYPES_TOP + 75 ) ;
- Size = MAP_APPFONT ( ED_PORT_WIDTH , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_NOPROXYFOR
- {
- Pos = MAP_APPFONT ( 12 , GB_TYPES_TOP + 93 ) ;
- Size = MAP_APPFONT ( 50 , 8 ) ;
- Text [ en-US ] = "~No proxy for:" ;
- };
- Edit ED_NOPROXYFOR
- {
- Pos = MAP_APPFONT ( 65 , GB_TYPES_TOP + 91 ) ;
- Size = MAP_APPFONT ( 123 , 12 ) ;
- Border = TRUE ;
- };
- FixedText ED_NOPROXYDESC
- {
- Pos = MAP_APPFONT ( 190 , GB_TYPES_TOP + 93 ) ;
- Size = MAP_APPFONT ( 56 , 8 ) ;
- Text [ en-US ] = "Separator ;" ;
- };
- FixedLine GB_DNS
- {
- Pos = MAP_APPFONT( 6, 100 );
- Size = MAP_APPFONT( 248, 8 );
- Text [ en-US ] = "DNS server" ;
- };
- RadioButton RB_DNS_AUTO
- {
- Pos = MAP_APPFONT( 12, 111 );
- Size = MAP_APPFONT( 236, 10 );
- Text [ en-US ] = "~Automatic" ;
- };
- RadioButton RB_DNS_MANUAL
- {
- Pos = MAP_APPFONT( 12, 124 );
- Size = MAP_APPFONT( 75, 10 );
- Text [ en-US ] = "~Manual" ;
- };
- PatternField ED_DNS
- {
- Pos = MAP_APPFONT( 90, 126 );
- Size = MAP_APPFONT( 66, 12 );
- Border = TRUE ;
- LiteralMask = " . . . " ;
- EditMask = "nnnLnnnLnnnLnnn" ;
- StrictFormat = TRUE ;
- };
- String ST_MSG_255_0
- {
- Text [ en-US ] = "is not a valid entry for this field. Please specify a value between 0 and 255." ;
- };
- String ST_MSG_255_1
- {
- Text [ en-US ] = "is not a valid entry for this field. Please specify a value between 1 and 255." ;
- };
-};
-/************************************************************************/
-/* */
-/* Suche */
-/* */
-/************************************************************************/
-TabPage RID_SVXPAGE_INET_SEARCH
-{
- HelpId = HID_OPTIONS_SEARCH ;
- OutputSize = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Text [ en-US ] = "Search" ;
-
- #define GB_SEARCH_LEFT 6
- #define GB_SEARCH_TOP 3
- FixedLine GB_SEARCH
- {
- Pos = MAP_APPFONT ( GB_SEARCH_LEFT , GB_SEARCH_TOP ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Search in" ;
- };
- ListBox LB_SEARCH
- {
- Pos = MAP_APPFONT ( 12 , GB_SEARCH_TOP + 11 ) ;
- Size = MAP_APPFONT ( 39 , 120 ) ;
- Border = TRUE ;
- AutoHScroll = TRUE;
- };
- #define LABEL_START_XPOS (GB_SEARCH_LEFT + 6 + 39 + 5 )
- #define LABEL_LEN 64
- #define EDIT_START_XPOS (LABEL_START_XPOS + LABEL_LEN + 3)
- FixedText FT_SEARCH_NAME
- {
- Pos = MAP_APPFONT ( LABEL_START_XPOS , GB_SEARCH_TOP + 13 ) ;
- Size = MAP_APPFONT ( LABEL_LEN , 8 ) ;
- Text [ en-US ] = "~Name" ;
- };
- Edit ED_SEARCH_NAME
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 11 ) ;
- Size = MAP_APPFONT ( 125 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_SEARCH
- {
- Pos = MAP_APPFONT ( LABEL_START_XPOS , GB_SEARCH_TOP + 27 ) ;
- Size = MAP_APPFONT ( LABEL_LEN , 8 ) ;
- Text [ en-US ] = "Type" ;
- };
- RadioButton RB_AND
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 26 ) ;
- Size = MAP_APPFONT ( 125 , 10 ) ;
- Check = TRUE ;
- Text [ en-US ] = "And" ;
- };
- RadioButton RB_OR
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 39 ) ;
- Size = MAP_APPFONT ( 125 , 10 ) ;
- Text [ en-US ] = "~Or" ;
- };
- RadioButton RB_EXACT
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 52 ) ;
- Size = MAP_APPFONT ( 125 , 10 ) ;
- Text [ en-US ] = "E~xact" ;
- };
- FixedText FT_URL
- {
- Pos = MAP_APPFONT ( LABEL_START_XPOS , GB_SEARCH_TOP + 67 ) ;
- Size = MAP_APPFONT ( LABEL_LEN , 8 ) ;
- Text [ en-US ] = "~Prefix" ;
- };
- Edit ED_URL
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 65 ) ;
- Size = MAP_APPFONT ( 125 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_POSTFIX
- {
- Pos = MAP_APPFONT ( LABEL_START_XPOS , GB_SEARCH_TOP + 82 ) ;
- Size = MAP_APPFONT ( LABEL_LEN , 8 ) ;
- Text [ en-US ] = "Su~ffix" ;
- };
- Edit ED_POSTFIX
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 80 ) ;
- Size = MAP_APPFONT ( 125 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_SEPARATOR
- {
- Pos = MAP_APPFONT ( LABEL_START_XPOS , GB_SEARCH_TOP + 97 ) ;
- Size = MAP_APPFONT ( LABEL_LEN , 8 ) ;
- Text [ en-US ] = "~Separator" ;
- };
- Edit ED_SEPARATOR
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS , GB_SEARCH_TOP + 95 ) ;
- Size = MAP_APPFONT ( 42 , 12 ) ;
- Border = TRUE ;
- };
- FixedText FT_CASE
- {
- Pos = MAP_APPFONT ( LABEL_START_XPOS, GB_SEARCH_TOP + 112 ) ;
- Size = MAP_APPFONT ( LABEL_LEN , 8 ) ;
- Text [ en-US ] = "~Case match" ;
- };
- ListBox ED_CASE
- {
- Pos = MAP_APPFONT ( EDIT_START_XPOS, GB_SEARCH_TOP + 110 ) ;
- Size = MAP_APPFONT ( 42 , 48 ) ;
- Border = TRUE ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "None" ; > ;
- < "Upper" ; > ;
- < "Lower" ; > ;
- };
- };
- PushButton PB_NEW
- {
- Pos = MAP_APPFONT ( 39 , GB_SEARCH_TOP + 131 + 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "N~ew";
- };
- PushButton PB_ADD
- {
- Pos = MAP_APPFONT ( 92 , GB_SEARCH_TOP + 131 + 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Add" ;
- };
- PushButton PB_CHANGE
- {
- Pos = MAP_APPFONT ( 145 , GB_SEARCH_TOP + 131 + 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Modify" ;
- };
- PushButton PB_DELETE
- {
- Pos = MAP_APPFONT ( 198 , GB_SEARCH_TOP + 131 + 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Delete" ;
- };
- String MSG_MODIFY
- {
- Text [ en-US ] = "Do you want to accept the current modification?";
- };
-};
-
-
-/************************************************************************/
-/* */
-/* Scripting */
-/* */
-/************************************************************************/
-
-TabPage RID_SVXPAGE_INET_SECURITY
-{
- OutputSize = TRUE ;
- Size = MAP_APPFONT( TP_WIDTH , TP_HEIGHT );
- SVLook = TRUE;
- Hide = TRUE;
- Text [ en-US ] = "Security";
- FixedLine FL_SEC_SECURITYOPTIONS
- {
- Pos = MAP_APPFONT( COL_0, ROW_0 );
- Size = MAP_APPFONT( COL_4-COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Security options and warnings";
- };
- FixedText FI_SEC_SECURITYOPTIONS
- {
- Pos = MAP_APPFONT( COL_1, ROW_1 );
- Size = MAP_APPFONT( COL_2-COL_1, 3*RSC_CD_FIXEDLINE_HEIGHT );
- Wordbreak = TRUE;
- Text [ en-US ] = "Adjust security related options and define warnings for hidden information in documents.";
- };
- PushButton PB_SEC_SECURITYOPTIONS
- {
- Pos = MAP_APPFONT( COL_3, ROW_2a );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- Text [ en-US ] = "Options...";
- };
- FixedLine FL_SEC_PASSWORDS
- {
- Pos = MAP_APPFONT( COL_0, ROW_2 - 2 );
- Size = MAP_APPFONT( COL_4-COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Passwords for web connections";
- };
- CheckBox CB_SEC_SAVEPASSWORDS
- {
- Pos = MAP_APPFONT( COL_1, ROW_3 - 4 );
- Size = MAP_APPFONT( COL_2-COL_1, 16 );
- Wordbreak = TRUE;
- Text [ en-US ] = "Persistently save passwords for web connections";
- };
- PushButton PB_SEC_CONNECTIONS
- {
- Pos = MAP_APPFONT( COL_3, ROW_3-1 );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- Text [ en-US ] = "Connections...";
- };
- CheckBox CB_SEC_MASTERPASSWORD
- {
- Pos = MAP_APPFONT( COL_1a, ROW_4 );
- Size = MAP_APPFONT( COL_2-COL_1a, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Protected by a master password (recommended)";
- };
- FixedText FI_SEC_MASTERPASSWORD
- {
- Pos = MAP_APPFONT( COL_1a, ROW_4a );
- Size = MAP_APPFONT( COL_2-COL_1a, 4*RSC_CD_FIXEDLINE_HEIGHT );
- Wordbreak = TRUE;
- Text [ en-US ] = "Passwords are protected by a master password. You will be asked to enter it once per session, if %PRODUCTNAME retrieves a password from the protected password list.";
- };
- PushButton PB_SEC_MASTERPASSWORD
- {
- Pos = MAP_APPFONT( COL_3, ROW_4a );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- Text [ en-US ] = "Master Password...";
- };
- FixedLine FL_SEC_MACROSEC
- {
- Pos = MAP_APPFONT( COL_0, ROW_5 );
- Size = MAP_APPFONT( COL_4-COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "Macro security";
- };
- FixedText FI_SEC_MACROSEC
- {
- Pos = MAP_APPFONT( COL_1, ROW_6 );
- Size = MAP_APPFONT( COL_2-COL_1, 3*RSC_CD_FIXEDLINE_HEIGHT );
- Wordbreak = TRUE;
- Text [ en-US ] = "Adjust the security level for executing macros and specify trusted macro developers.";
- };
- PushButton PB_SEC_MACROSEC
- {
- Pos = MAP_APPFONT( COL_3, ROW_6-2 );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- Text [ en-US ] = "Macro Security...";
- };
- FixedLine FL_SEC_FILESHARING
- {
- Pos = MAP_APPFONT( COL_0, ROW_7 );
- Size = MAP_APPFONT( COL_4-COL_0, RSC_CD_FIXEDLINE_HEIGHT );
- Text [ en-US ] = "File sharing options for this document";
- };
- CheckBox CB_SEC_RECOMMREADONLY
- {
- Pos = MAP_APPFONT( COL_1, ROW_8 );
- Size = MAP_APPFONT( COL_2-COL_1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Open this document in read-only mode";
- };
- CheckBox CB_SEC_RECORDCHANGES
- {
- Pos = MAP_APPFONT( COL_1, ROW_9 );
- Size = MAP_APPFONT( COL_2-COL_1, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Record changes";
- };
- PushButton PB_SEC_PROTRECORDS
- {
- Pos = MAP_APPFONT( COL_3, ROW_9-2 );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
- String STR_SEC_PROTRECORDS
- {
- Text [ en-US ] = "Protect...";
- };
- String STR_SEC_UNPROTRECORDS
- {
- Text [ en-US ] = "Unprotect...";
- };
- String STR_SEC_NOPASSWDSAVE
- {
- Text [ en-US ] = "Disabling the function to persistently store passwords deletes the list of passwords stored and resets the master password.\n\nDo you want to delete password list and reset master password?";
- };
-};
-
-ErrorBox RID_SVXERR_OPT_PROXYPORTS
-{
- BUTTONS = WB_OK ;
- Message [ en-US ] = "Invalid value!\n\nThe maximum value for a port number is 65535.";
-};
-
-// RID_SVXDLG_OPT_JAVASCRIPT_DISABLE -----------------------------------------
-
-ModalDialog RID_SVXDLG_OPT_JAVASCRIPT_DISABLE
-{
- OutputSize = TRUE;
- Size = MAP_APPFONT( 150, 81 );
- Moveable = TRUE;
- Closeable = TRUE;
- FixedImage IMG_JSCPT_WARNING
- {
- Pos = MAP_APPFONT( 6, 6 );
- Size = MAP_APPFONT( 30, 30 );
- };
- FixedText FT_JSCPT_WARNING
- {
- Pos = MAP_APPFONT( 39, 6 );
- Size = MAP_APPFONT( 195, 36 );
- WordBreak = TRUE;
- Text [ en-US ] = "Please note that with Java\nyou disable Javascript as well.\n\nDo you still want to disable Java?";
- };
- CheckBox CB_JSCPT_DISABLE
- {
- Pos = MAP_APPFONT( 39, 45 );
- Size = MAP_APPFONT( 195, 12 );
- Hide = TRUE;
- Text [ en-US ] = "~Don't show warning again";
- };
- OKButton BTN_JSCPT_YES
- {
- Pos = MAP_APPFONT( 41, 61 );
- Size = MAP_APPFONT( 50, 14 );
- };
- CancelButton BTN_JSCPT_NO
- {
- Pos = MAP_APPFONT( 94, 61 );
- Size = MAP_APPFONT( 50, 14 );
- DefButton = TRUE;
- };
-};
-
-// *******************************************************************
-
-TabPage RID_SVXPAGE_INET_MAIL
-{
- HelpID = HID_OPTIONS_MAIL ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Hide = TRUE ;
-
- FixedLine FL_MAIL
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Sending documents as e-mail attachments";
- };
-
- FixedImage FI_MAILERURL
- {
- Pos = MAP_APPFONT ( 5 , 21 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
-
- FixedText FT_MAILERURL
- {
- Pos = MAP_APPFONT ( 14 , 20 ) ;
- Size = MAP_APPFONT ( 43 , 8 ) ;
- Text [ en-US ] = "~E-mail program";
- };
-
- Edit ED_MAILERURL
- {
- Pos = MAP_APPFONT ( 60 , 18 ) ;
- Size = MAP_APPFONT ( 171 , 12 ) ;
- Border = TRUE;
- };
-
- PushButton PB_MAILERURL
- {
- Pos = MAP_APPFONT ( 234 , 17 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "..." ;
- };
-
- String STR_DEFAULT_FILENAME
- {
- Text [ en-US ] = "All files (*.*)" ;
- };
-};
-
- // ******************************************************************* EOF
-
diff --git a/svx/source/options/optjsearch.src b/svx/source/options/optjsearch.src
deleted file mode 100644
index 8c5c6259f6..0000000000
--- a/svx/source/options/optjsearch.src
+++ /dev/null
@@ -1,223 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optjsearch.src,v $
- * $Revision: 1.40 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <helpid.hrc>
-#include <svx/dialogs.hrc>
-
-#include "optjsearch.hrc"
-
-
-TabPage RID_SVXPAGE_JSEARCH_OPTIONS
-{
- HelpId = HID_SVXPAGE_JSEARCH_OPTIONS ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine FL_TREAT_AS_EQUAL
- {
- Pos = MAP_APPFONT( 6, 3 );
- Size = MAP_APPFONT( 248, 8 );
- Text [ en-US ] = "Treat as equal";
- };
- CheckBox CB_MATCH_CASE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~uppercase/lowercase";
- };
- CheckBox CB_MATCH_FULL_HALF_WIDTH
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~full-width/half-width forms";
- };
- CheckBox CB_MATCH_HIRAGANA_KATAKANA
- {
- Pos = MAP_APPFONT ( 12 , 42 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~hiragana/katakana";
- };
- CheckBox CB_MATCH_CONTRACTIONS
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~contractions (yo-on, sokuon)";
- };
- CheckBox CB_MATCH_MINUS_DASH_CHOON
- {
- Pos = MAP_APPFONT ( 12 , 70 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~minus/dash/cho-on";
- };
- CheckBox CB_MATCH_REPEAT_CHAR_MARKS
- {
- Pos = MAP_APPFONT ( 12 , 84 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "'re~peat character' marks";
- };
- CheckBox CB_MATCH_VARIANT_FORM_KANJI
- {
- Pos = MAP_APPFONT ( 12 , 98 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~variant-form kanji (itaiji)";
- };
- CheckBox CB_MATCH_OLD_KANA_FORMS
- {
- Pos = MAP_APPFONT ( 12 , 112) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~old Kana forms";
- };
- CheckBox CB_MATCH_DIZI_DUZU
- {
- Pos = MAP_APPFONT ( 136 , 14 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~di/zi, du/zu";
- };
- CheckBox CB_MATCH_BAVA_HAFA
- {
- Pos = MAP_APPFONT ( 136 , 28 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~ba/va, ha/fa";
- };
- CheckBox CB_MATCH_TSITHICHI_DHIZI
- {
- Pos = MAP_APPFONT ( 136 , 42 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~tsi/thi/chi, dhi/zi";
- };
- CheckBox CB_MATCH_HYUFYU_BYUVYU
- {
- Pos = MAP_APPFONT ( 136 , 56 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "h~yu/fyu, byu/vyu";
- };
- CheckBox CB_MATCH_SESHE_ZEJE
- {
- Pos = MAP_APPFONT ( 136 , 70 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~se/she, ze/je";
- };
- CheckBox CB_MATCH_IAIYA
- {
- Pos = MAP_APPFONT ( 136 , 84 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~ia/iya (piano/piyano)";
- };
- CheckBox CB_MATCH_KIKU
- {
- Pos = MAP_APPFONT ( 136 , 98 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~ki/ku (tekisuto/tekusuto)";
- };
- CheckBox CB_MATCH_PROLONGED_SOUNDMARK
- {
- Pos = MAP_APPFONT ( 136 , 112 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Prolon~ged vowels (ka-/kaa)";
- };
- FixedLine FL_IGNORE
- {
- Pos = MAP_APPFONT( 6, 128 );
- Size = MAP_APPFONT( 248, 8 );
- Text [ en-US ] = "Ignore";
- };
- CheckBox CB_IGNORE_PUNCTUATION
- {
- Pos = MAP_APPFONT ( 12 , 139 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Pu~nctuation characters";
- };
- CheckBox CB_IGNORE_WHITESPACES
- {
- Pos = MAP_APPFONT ( 12 , 153 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "~Whitespace characters";
- };
- CheckBox CB_IGNORE_MIDDLE_DOT
- {
- Pos = MAP_APPFONT ( 136 , 139 ) ;
- Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Midd~le dots";
- };
- Text [ en-US ] = "Searching in Japanese";
-};
-// end TabPage
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optlingu.cxx b/svx/source/options/optlingu.cxx
deleted file mode 100644
index 41eebdbbbb..0000000000
--- a/svx/source/options/optlingu.cxx
+++ /dev/null
@@ -1,2563 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optlingu.cxx,v $
- * $Revision: 1.68 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-// include ---------------------------------------------------------------
-
-#define _SVSTDARR_STRINGSDTOR
-#define _SVSTDARR_USHORTS
-//#ifndef _SVSTDARR_HXX
-//#include <svtools/svstdarr.hxx>
-//#endif
-#include <vcl/msgbox.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <tools/shl.hxx>
-#include <tools/dynary.hxx>
-#include <i18npool/mslangid.hxx>
-//#include <svtools/svarray.hxx>
-#include <svtools/lingucfg.hxx>
-#include <unolingu.hxx>
-#include <dlgutil.hxx>
-#include <linguistic/lngprops.hxx>
-#include <linguistic/misc.hxx>
-#include <unolingu.hxx>
-#include <sfx2/sfxuno.hxx>
-#include <sfx2/dispatch.hxx>
-#include <tools/urlobj.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/linguistic2/XSpellChecker.hpp>
-#include <com/sun/star/linguistic2/XProofreader.hpp>
-#include <com/sun/star/linguistic2/XHyphenator.hpp>
-#include <com/sun/star/linguistic2/XThesaurus.hpp>
-#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
-#include <com/sun/star/lang/XServiceDisplayName.hpp>
-#include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp>
-#include <com/sun/star/linguistic2/DictionaryListEvent.hpp>
-#include <com/sun/star/linguistic2/XDictionaryListEventListener.hpp>
-#include <com/sun/star/linguistic2/XDictionaryList.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/ucb/CommandAbortedException.hpp>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
-#include <svtools/extendedsecurityoptions.hxx>
-#include <svtools/svlbox.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <vcl/svapp.hxx>
-#define _SVX_OPTLINGU_CXX
-
-#include "optlingu.hrc"
-
-#include <svx/svxdlg.hxx>
-#include "optitems.hxx"
-#include <svx/optlingu.hxx>
-#include <svx/dialmgr.hxx>
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-
-#include <ucbhelper/content.hxx>
-
-#include <vector>
-#include <map>
-
-
-using namespace ::ucbhelper;
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::linguistic2;
-using namespace ::com::sun::star::beans;
-namespace css = com::sun::star;
-
-#define C2U(cChar) OUString::createFromAscii(cChar)
-#define SVX_MAX_USERDICTS 20
-#define CBCOL_FIRST 0
-#define CBCOL_SECOND 1
-#define CBCOL_BOTH 2
-
-static const sal_Char cSpell[] = SN_SPELLCHECKER;
-static const sal_Char cGrammar[] = SN_GRAMMARCHECKER;
-static const sal_Char cHyph[] = SN_HYPHENATOR;
-static const sal_Char cThes[] = SN_THESAURUS;
-
-// static ----------------------------------------------------------------
-
-static Sequence< INT16 > lcl_LocaleSeqToLangSeq( const Sequence< Locale > &rSeq )
-{
- INT32 nLen = rSeq.getLength();
- Sequence< INT16 > aRes( nLen );
- INT16 *pRes = aRes.getArray();
- const Locale *pSeq = rSeq.getConstArray();
- for (INT32 i = 0; i < nLen; ++i)
- {
- pRes[i] = SvxLocaleToLanguage( pSeq[i] );
- }
- return aRes;
-}
-
-
-static BOOL lcl_SeqHasLang( const Sequence< INT16 > &rSeq, INT16 nLang )
-{
- INT32 nLen = rSeq.getLength();
- const INT16 *pLang = rSeq.getConstArray();
- INT32 nPos = -1;
- for (INT32 i = 0; i < nLen && nPos < 0; ++i)
- {
- if (nLang == pLang[i])
- nPos = i;
- }
- return nPos < 0 ? FALSE : TRUE;
-}
-
-
-static INT32 lcl_SeqGetEntryPos(
- const Sequence< OUString > &rSeq, const OUString &rEntry )
-{
- INT32 i;
- INT32 nLen = rSeq.getLength();
- const OUString *pItem = rSeq.getConstArray();
- for (i = 0; i < nLen; ++i)
- {
- if (rEntry == pItem[i])
- break;
- }
- return i < nLen ? i : -1;
-}
-
-static void lcl_OpenURL( const ::rtl::OUString& rURL )
-{
- if ( rURL.getLength() > 0 )
- {
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xSMGR =
- ::comphelper::getProcessServiceFactory();
- uno::Reference< css::system::XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- xSystemShell->execute( rURL, ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
- }
- catch( const uno::Exception& e )
- {
- OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
- rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
- }
- }
-}
-
-/*--------------------------------------------------
---------------------------------------------------*/
-
-static const sal_uInt16 nNameLen = 8;
-
-static sal_uInt16 pRanges[] =
-{
- SID_ATTR_SPELL,
- SID_ATTR_SPELL,
- 0
-};
-
-sal_Bool KillFile_Impl( const String& rURL )
-{
- sal_Bool bRet = sal_True;
- try
- {
- Content aCnt( rURL, uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
- aCnt.executeCommand( OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) );
- }
- catch( ::com::sun::star::ucb::CommandAbortedException& )
- {
- DBG_ERRORFILE( "KillFile: CommandAbortedException" );
- bRet = sal_False;
- }
- catch( ... )
- {
- DBG_ERRORFILE( "KillFile: Any other exception" );
- bRet = sal_False;
- }
-
- return bRet;
-}
-/* -----------------------------27.11.00 14:07--------------------------------
-
- ---------------------------------------------------------------------------*/
-// 0x 0p 0t 0c nn
-// p: 1 -> parent
-// t: 1 -> spell, 2 -> hyph, 3 -> thes, 4 -> grammar
-// c: 1 -> checked 0 -> unchecked
-// n: index
-
-#define TYPE_SPELL (BYTE)1
-#define TYPE_GRAMMAR (BYTE)2
-#define TYPE_HYPH (BYTE)3
-#define TYPE_THES (BYTE)4
-
-class ModuleUserData_Impl
-{
- BOOL bParent;
- BOOL bIsChecked;
- BYTE nType;
- BYTE nIndex;
- String sImplName;
-
-public:
- ModuleUserData_Impl( String sImpName, BOOL bIsParent, BOOL bChecked, BYTE nSetType, BYTE nSetIndex ) :
- bParent(bIsParent),
- bIsChecked(bChecked),
- nType(nSetType),
- nIndex(nSetIndex),
- sImplName(sImpName)
- {
- }
- BOOL IsParent() const {return bParent;}
- BYTE GetType() const {return nType;}
- BOOL IsChecked() const {return bIsChecked;}
- BYTE GetIndex() const {return nIndex;}
- void SetIndex(BYTE nSet) {nIndex = nSet;}
- const String& GetImplName() const {return sImplName;}
-
-};
-
-/*--------------------------------------------------
---------------------------------------------------*/
-//
-// User for user-dictionaries (XDictionary interface)
-//
-class DicUserData
-{
- ULONG nVal;
-
-public:
- DicUserData( ULONG nUserData ) : nVal( nUserData ) {}
- DicUserData( USHORT nEID,
- BOOL bChecked, BOOL bEditable, BOOL bDeletable );
-
- ULONG GetUserData() const { return nVal; }
- USHORT GetEntryId() const { return (USHORT)(nVal >> 16); }
- BOOL IsChecked() const { return (BOOL)(nVal >> 8) & 0x01; }
- BOOL IsEditable() const { return (BOOL)(nVal >> 9) & 0x01; }
- BOOL IsDeletable() const { return (BOOL)(nVal >> 10) & 0x01; }
-
- void SetChecked( BOOL bVal );
-};
-
-
-DicUserData::DicUserData(
- USHORT nEID,
- BOOL bChecked, BOOL bEditable, BOOL bDeletable )
-{
- DBG_ASSERT( nEID < 65000, "Entry Id out of range" );
- nVal = ((ULONG)(0xFFFF & nEID) << 16) |
- ((ULONG)(bChecked ? 1 : 0) << 8) |
- ((ULONG)(bEditable ? 1 : 0) << 9) |
- ((ULONG)(bDeletable ? 1 : 0) << 10);
-}
-
-
-void DicUserData::SetChecked( BOOL bVal )
-{
- nVal &= ~(1UL << 8);
- nVal |= (ULONG)(bVal ? 1 : 0) << 8;
-}
-
-
-// class BrwString_Impl -------------------------------------------------
-
-void lcl_SetCheckButton( SvLBoxEntry* pEntry, BOOL bCheck )
-{
- SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
-
- DBG_ASSERT(pItem,"SetCheckButton:Item not found");
- if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON)
- {
- if (bCheck)
- pItem->SetStateChecked();
- else
- pItem->SetStateUnchecked();
- //InvalidateEntry( pEntry );
- }
-}
-
-
-class BrwStringDic_Impl : public SvLBoxString
-{
-public:
-
- BrwStringDic_Impl( SvLBoxEntry* pEntry, USHORT nFlags,
- const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
-
- virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags,
- SvLBoxEntry* pEntry);
-};
-
-void BrwStringDic_Impl::Paint( const Point& rPos, SvLBox& rDev, USHORT,
- SvLBoxEntry* pEntry )
-{
- ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
- Point aPos(rPos);
- Font aOldFont( rDev.GetFont());
- if(pData->IsParent())
- {
- Font aFont( aOldFont );
- aFont.SetWeight( WEIGHT_BOLD );
- rDev.SetFont( aFont );
- aPos.X() = 0;
- }
- else
- aPos.X() += 5;
- rDev.DrawText( aPos, GetText() );
- rDev.SetFont( aOldFont );
-}
-
-
-/*--------------------------------------------------
---------------------------------------------------*/
-
-class OptionsBreakSet : public ModalDialog
-{
- OKButton aOKPB;
- CancelButton aCancelPB;
- FixedLine aValFL;
- NumericField aValNF;
-
-public:
- OptionsBreakSet(Window* pParent, int nRID) :
- ModalDialog(pParent, SVX_RES(RID_SVXDLG_LNG_ED_NUM_PREBREAK )),
- aOKPB (this, SVX_RES(BT_OK_PREBREAK)),
- aCancelPB (this, SVX_RES(BT_CANCEL_PREBREAK)),
- aValFL (this, SVX_RES(FL_NUMVAL_PREBREAK)),
- aValNF (this, SVX_RES(ED_PREBREAK))
- {
- DBG_ASSERT( STR_NUM_PRE_BREAK_DLG == nRID ||
- STR_NUM_POST_BREAK_DLG == nRID ||
- STR_NUM_MIN_WORDLEN_DLG == nRID, "unexpected RID" );
-
- if (nRID != -1)
- aValFL.SetText( String( SVX_RES(nRID) ) );
- FreeResource();
- }
-
- NumericField& GetNumericFld() { return aValNF; }
-};
-
-
-/*--------------------------------------------------
- Entry IDs for options listbox of dialog
---------------------------------------------------*/
-
-enum EID_OPTIONS
-{
- EID_SPELL_AUTO,
- EID_GRAMMAR_AUTO,
- EID_CAPITAL_WORDS,
- EID_WORDS_WITH_DIGITS,
- EID_CAPITALIZATION,
- EID_SPELL_SPECIAL,
- EID_NUM_MIN_WORDLEN,
- EID_NUM_PRE_BREAK,
- EID_NUM_POST_BREAK,
- EID_HYPH_AUTO,
- EID_HYPH_SPECIAL
-};
-
-//! this array must have an entry for every value of EID_OPTIONS.
-// It is used to get the respective property name.
-static const char * aEidToPropName[] =
-{
- UPN_IS_SPELL_AUTO, // EID_SPELL_AUTO
- UPN_IS_GRAMMAR_AUTO, // EID_GRAMMAR_AUTO
- UPN_IS_SPELL_UPPER_CASE, // EID_CAPITAL_WORDS
- UPN_IS_SPELL_WITH_DIGITS, // EID_WORDS_WITH_DIGITS
- UPN_IS_SPELL_CAPITALIZATION, // EID_CAPITALIZATION
- UPN_IS_SPELL_SPECIAL, // EID_SPELL_SPECIAL
- UPN_HYPH_MIN_WORD_LENGTH, // EID_NUM_MIN_WORDLEN,
- UPN_HYPH_MIN_LEADING, // EID_NUM_PRE_BREAK
- UPN_HYPH_MIN_TRAILING, // EID_NUM_POST_BREAK
- UPN_IS_HYPH_AUTO, // EID_HYPH_AUTO
- UPN_IS_HYPH_SPECIAL // EID_HYPH_SPECIAL
-};
-
-
-static inline String lcl_GetPropertyName( EID_OPTIONS eEntryId )
-{
- DBG_ASSERT( (unsigned int) eEntryId < sizeof(aEidToPropName) / sizeof(aEidToPropName[0]), "index out of range" );
- return String::CreateFromAscii( aEidToPropName[ (int) eEntryId ] );
-}
-
-// class OptionsUserData -------------------------------------------------
-
-class OptionsUserData
-{
- ULONG nVal;
-
- void SetModified();
-
-public:
- OptionsUserData( ULONG nUserData ) : nVal( nUserData ) {}
- OptionsUserData( USHORT nEID,
- BOOL bHasNV, USHORT nNumVal,
- BOOL bCheckable, BOOL bChecked );
-
- ULONG GetUserData() const { return nVal; }
- USHORT GetEntryId() const { return (USHORT)(nVal >> 16); }
- BOOL HasNumericValue() const { return (BOOL)(nVal >> 10) & 0x01; }
- USHORT GetNumericValue() const { return (USHORT)(nVal & 0xFF); }
- BOOL IsChecked() const { return (BOOL)(nVal >> 8) & 0x01; }
- BOOL IsCheckable() const { return (BOOL)(nVal >> 9) & 0x01; }
- BOOL IsModified() const { return (BOOL)(nVal >> 11) & 0x01; }
-
- void SetChecked( BOOL bVal );
- void SetNumericValue( BYTE nNumVal );
-};
-
-OptionsUserData::OptionsUserData( USHORT nEID,
- BOOL bHasNV, USHORT nNumVal,
- BOOL bCheckable, BOOL bChecked )
-{
- DBG_ASSERT( nEID < 65000, "Entry Id out of range" );
- DBG_ASSERT( nNumVal < 256, "value out of range" );
- nVal = ((ULONG)(0xFFFF & nEID) << 16) |
- ((ULONG)(bHasNV ? 1 : 0) << 10) |
- ((ULONG)(bCheckable ? 1 : 0) << 9) |
- ((ULONG)(bChecked ? 1 : 0) << 8) |
- ((ULONG)(0xFF & nNumVal));
-}
-
-void OptionsUserData::SetChecked( BOOL bVal )
-{
- if (IsCheckable() && (IsChecked() != bVal))
- {
- nVal &= ~(1UL << 8);
- nVal |= (ULONG)(bVal ? 1 : 0) << 8;
- SetModified();
- }
-}
-
-void OptionsUserData::SetNumericValue( BYTE nNumVal )
-{
-// DBG_ASSERT( nNumVal < 256, "value out of range" );
- if (HasNumericValue() && (GetNumericValue() != nNumVal))
- {
- nVal &= 0xffffff00;
- nVal |= (nNumVal);
- SetModified();
- }
-}
-
-void OptionsUserData::SetModified()
-{
- nVal |= (ULONG)1 << 11;
-}
-
-// class BrwString_Impl -------------------------------------------------
-
-class BrwString_Impl : public SvLBoxString
-{
-public:
-
- BrwString_Impl( SvLBoxEntry* pEntry, USHORT nFlags,
- const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
-
- virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags,
- SvLBoxEntry* pEntry);
-};
-
-void BrwString_Impl::Paint( const Point& rPos, SvLBox& rDev, USHORT,
- SvLBoxEntry* pEntry )
-{
- Point aPos(rPos);
- aPos.X() += 20;
- rDev.DrawText( aPos, GetText() );
- if(pEntry->GetUserData())
- {
- Point aNewPos(aPos);
- aNewPos.X() += rDev.GetTextWidth(GetText());
- Font aOldFont( rDev.GetFont());
- Font aFont( aOldFont );
- aFont.SetWeight( WEIGHT_BOLD );
-
-// BOOL bFett = TRUE;
-// USHORT nPos = 0;
- //??? das untere byte aus dem user data in string wandeln
- OptionsUserData aData( (ULONG) pEntry->GetUserData() );
- if(aData.HasNumericValue())
- {
- String sTxt( ' ' );
- sTxt += String::CreateFromInt32( aData.GetNumericValue() );
- rDev.SetFont( aFont );
- rDev.DrawText( aNewPos, sTxt );
- }
-
-// if( STRING_NOTFOUND != nPos )
-// aNewPos.X() += rDev.GetTextWidth( sTxt );
-
- rDev.SetFont( aOldFont );
- }
-}
-
-// ServiceInfo_Impl ----------------------------------------------------
-
-struct ServiceInfo_Impl
-{
- OUString sDisplayName;
- OUString sSpellImplName;
- OUString sHyphImplName;
- OUString sThesImplName;
- OUString sGrammarImplName;
- uno::Reference< XSpellChecker > xSpell;
- uno::Reference< XHyphenator > xHyph;
- uno::Reference< XThesaurus > xThes;
- uno::Reference< XProofreader > xGrammar;
- BOOL bConfigured;
-
- ServiceInfo_Impl() : bConfigured(sal_False) {}
-};
-
-typedef std::vector< ServiceInfo_Impl > ServiceInfoArr;
-typedef std::map< INT16 /*LanguageType*/, Sequence< OUString > > LangImplNameTable;
-
-
-// SvxLinguData_Impl ----------------------------------------------------
-
-class SvxLinguData_Impl
-{
- //contains services and implementation names sorted by implementation names
- ServiceInfoArr aDisplayServiceArr;
- ULONG nDisplayServices;
-
- Sequence< Locale > aAllServiceLocales;
- LangImplNameTable aCfgSpellTable;
- LangImplNameTable aCfgHyphTable;
- LangImplNameTable aCfgThesTable;
- LangImplNameTable aCfgGrammarTable;
- uno::Reference< XMultiServiceFactory > xMSF;
- uno::Reference< XLinguServiceManager > xLinguSrvcMgr;
-
-
- sal_Bool AddRemove( Sequence< OUString > &rConfigured,
- const OUString &rImplName, BOOL bAdd );
-
-public:
- SvxLinguData_Impl();
- SvxLinguData_Impl( const SvxLinguData_Impl &rData );
- ~SvxLinguData_Impl();
-
- SvxLinguData_Impl & operator = (const SvxLinguData_Impl &rData);
-
- uno::Reference<XLinguServiceManager> & GetManager() { return xLinguSrvcMgr; }
-
- void SetChecked( const Sequence< OUString > &rConfiguredServices );
- void Reconfigure( const OUString &rDisplayName, BOOL bEnable );
-
- const Sequence<Locale> & GetAllSupportedLocales() { return aAllServiceLocales; }
-
- const LangImplNameTable & GetSpellTable() const { return aCfgSpellTable; }
- LangImplNameTable & GetSpellTable() { return aCfgSpellTable; }
- const LangImplNameTable & GetHyphTable() const { return aCfgHyphTable; }
- LangImplNameTable & GetHyphTable() { return aCfgHyphTable; }
- const LangImplNameTable & GetThesTable() const { return aCfgThesTable; }
- LangImplNameTable & GetThesTable() { return aCfgThesTable; }
- const LangImplNameTable & GetGrammarTable() const { return aCfgGrammarTable; }
- LangImplNameTable & GetGrammarTable() { return aCfgGrammarTable; }
-
- const ServiceInfoArr & GetDisplayServiceArray() const { return aDisplayServiceArr; }
- ServiceInfoArr & GetDisplayServiceArray() { return aDisplayServiceArr; }
-
- const ULONG & GetDisplayServiceCount() const { return nDisplayServices; }
- void SetDisplayServiceCount( ULONG nVal ) { nDisplayServices = nVal; }
-
- // returns the list of service implementation names for the specified
- // language and service (TYPE_SPELL, TYPE_HYPH, TYPE_THES) sorted in
- // the proper order for the SvxEditModulesDlg (the ones from the
- // configuration (keeping that order!) first and then the other ones.
- // I.e. the ones available but not configured in arbitrary order).
- // They available ones may contain names that do not(!) support that
- // language.
- Sequence< OUString > GetSortedImplNames( INT16 nLang, BYTE nType );
-
- ServiceInfo_Impl * GetInfoByImplName( const OUString &rSvcImplName );
-};
-
-
-INT32 lcl_SeqGetIndex( const Sequence< OUString > &rSeq, const OUString &rTxt )
-{
- INT32 nRes = -1;
- INT32 nLen = rSeq.getLength();
- const OUString *pString = rSeq.getConstArray();
- for (INT32 i = 0; i < nLen && nRes == -1; ++i)
- {
- if (pString[i] == rTxt)
- nRes = i;
- }
- return nRes;
-}
-
-
-Sequence< OUString > SvxLinguData_Impl::GetSortedImplNames( INT16 nLang, BYTE nType )
-{
- LangImplNameTable *pTable = 0;
- switch (nType)
- {
- case TYPE_SPELL : pTable = &aCfgSpellTable; break;
- case TYPE_HYPH : pTable = &aCfgHyphTable; break;
- case TYPE_THES : pTable = &aCfgThesTable; break;
- case TYPE_GRAMMAR : pTable = &aCfgGrammarTable; break;
- }
- Sequence< OUString > aRes;
- if (pTable->count( nLang ))
- aRes = (*pTable)[ nLang ]; // add configured services
- INT32 nIdx = aRes.getLength();
- DBG_ASSERT( (INT32) nDisplayServices >= nIdx, "size mismatch" );
- aRes.realloc( nDisplayServices );
- OUString *pRes = aRes.getArray();
-
- // add not configured services
- for (INT32 i = 0; i < (INT32) nDisplayServices; ++i)
- {
- const ServiceInfo_Impl &rInfo = aDisplayServiceArr[ i ];
- OUString aImplName;
- switch (nType)
- {
- case TYPE_SPELL : aImplName = rInfo.sSpellImplName; break;
- case TYPE_HYPH : aImplName = rInfo.sHyphImplName; break;
- case TYPE_THES : aImplName = rInfo.sThesImplName; break;
- case TYPE_GRAMMAR : aImplName = rInfo.sGrammarImplName; break;
- }
-
- if (aImplName.getLength() && (lcl_SeqGetIndex( aRes, aImplName) == -1)) // name not yet added
- {
- DBG_ASSERT( nIdx < aRes.getLength(), "index out of range" );
- if (nIdx < aRes.getLength())
- pRes[ nIdx++ ] = aImplName;
- }
- }
- // don't forget to put aRes back to its actual size just in case you allocated too much
- // since all of the names may have already been added
- // otherwise you get duplicate entries in the edit dialog
- aRes.realloc( nIdx );
- return aRes;
-}
-
-
-ServiceInfo_Impl * SvxLinguData_Impl::GetInfoByImplName( const OUString &rSvcImplName )
-{
- ServiceInfo_Impl* pInfo = 0;
- for (ULONG i = 0; i < nDisplayServices && !pInfo; ++i)
- {
- ServiceInfo_Impl &rTmp = aDisplayServiceArr[ i ];
- if (rTmp.sSpellImplName == rSvcImplName ||
- rTmp.sHyphImplName == rSvcImplName ||
- rTmp.sThesImplName == rSvcImplName ||
- rTmp.sGrammarImplName == rSvcImplName)
- pInfo = &rTmp;
- }
- return pInfo;
-}
-
-
-//-----------------------------------------------------------------------------
-
-void lcl_MergeLocales(Sequence< Locale >& aAllLocales, const Sequence< Locale >& rAdd)
-{
- const Locale* pAdd = rAdd.getConstArray();
- Sequence<Locale> aLocToAdd(rAdd.getLength());
- const Locale* pAllLocales = aAllLocales.getConstArray();
- Locale* pLocToAdd = aLocToAdd.getArray();
- sal_Int32 nFound = 0;
- sal_Int32 i;
- for(i = 0; i < rAdd.getLength(); i++)
- {
- sal_Bool bFound = sal_False;
- for(sal_Int32 j = 0; j < aAllLocales.getLength() && !bFound; j++)
- {
- bFound = pAdd[i].Language == pAllLocales[j].Language &&
- pAdd[i].Country == pAllLocales[j].Country;
- }
- if(!bFound)
- {
- pLocToAdd[nFound++] = pAdd[i];
- }
- }
- sal_Int32 nLength = aAllLocales.getLength();
- aAllLocales.realloc( nLength + nFound);
- Locale* pAllLocales2 = aAllLocales.getArray();
- for(i = 0; i < nFound; i++)
- pAllLocales2[nLength++] = pLocToAdd[i];
-}
-/* -----------------------------27.11.00 16:48--------------------------------
-
- ---------------------------------------------------------------------------*/
-void lcl_MergeDisplayArray(
- SvxLinguData_Impl &rData,
- const ServiceInfo_Impl &rToAdd )
-{
- ULONG nCnt = 0;
-
- ServiceInfoArr &rSvcInfoArr = rData.GetDisplayServiceArray();
- ULONG nEntries = rData.GetDisplayServiceCount();
-
- ServiceInfo_Impl* pEntry;
- for (ULONG i = 0; i < nEntries; ++i)
- {
- pEntry = &rSvcInfoArr[i];
- if (pEntry && pEntry->sDisplayName == rToAdd.sDisplayName)
- {
- if(rToAdd.xSpell.is())
- {
- DBG_ASSERT( !pEntry->xSpell.is() &&
- pEntry->sSpellImplName.getLength() == 0,
- "merge conflict" );
- pEntry->sSpellImplName = rToAdd.sSpellImplName;
- pEntry->xSpell = rToAdd.xSpell;
- }
- if(rToAdd.xGrammar.is())
- {
- DBG_ASSERT( !pEntry->xGrammar.is() &&
- pEntry->sGrammarImplName.getLength() == 0,
- "merge conflict" );
- pEntry->sGrammarImplName = rToAdd.sGrammarImplName;
- pEntry->xGrammar = rToAdd.xGrammar;
- }
- if(rToAdd.xHyph.is())
- {
- DBG_ASSERT( !pEntry->xHyph.is() &&
- pEntry->sHyphImplName.getLength() == 0,
- "merge conflict" );
- pEntry->sHyphImplName = rToAdd.sHyphImplName;
- pEntry->xHyph = rToAdd.xHyph;
- }
- if(rToAdd.xThes.is())
- {
- DBG_ASSERT( !pEntry->xThes.is() &&
- pEntry->sThesImplName.getLength() == 0,
- "merge conflict" );
- pEntry->sThesImplName = rToAdd.sThesImplName;
- pEntry->xThes = rToAdd.xThes;
- }
- return ;
- }
- ++nCnt;
- }
- rData.GetDisplayServiceArray().push_back( rToAdd );
- rData.SetDisplayServiceCount( nCnt + 1 );
-}
-/* -----------------------------26.11.00 18:07--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxLinguData_Impl::SvxLinguData_Impl() :
- nDisplayServices (0)
-{
- xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference < XInterface > xI = xMSF->createInstance(
- C2U( "com.sun.star.linguistic2.LinguServiceManager" ) );
- xLinguSrvcMgr = uno::Reference<XLinguServiceManager>(xI, UNO_QUERY);
- DBG_ASSERT(xLinguSrvcMgr.is(), "No linguistic service available!");
- if(xLinguSrvcMgr.is())
- {
- Locale aCurrentLocale;
- LanguageType eLang = Application::GetSettings().GetLanguage();
- SvxLanguageToLocale(aCurrentLocale, eLang);
- Sequence<Any> aArgs(2);//second arguments has to be empty!
- aArgs.getArray()[0] <<= SvxGetLinguPropertySet();
-
- //read spell checker
- Sequence< OUString > aSpellNames = xLinguSrvcMgr->getAvailableServices(
- C2U(cSpell), Locale() );
- const OUString* pSpellNames = aSpellNames.getConstArray();
-
- sal_Int32 nIdx;
- for(nIdx = 0; nIdx < aSpellNames.getLength(); nIdx++)
- {
- ServiceInfo_Impl aInfo;
- aInfo.sSpellImplName = pSpellNames[nIdx];
- aInfo.xSpell = uno::Reference<XSpellChecker>(
- xMSF->createInstanceWithArguments(aInfo.sSpellImplName, aArgs), UNO_QUERY);
-
- uno::Reference<XServiceDisplayName> xDispName(aInfo.xSpell, UNO_QUERY);
- if(xDispName.is())
- aInfo.sDisplayName = xDispName->getServiceDisplayName( aCurrentLocale );
-
- const Sequence< Locale > aLocales( aInfo.xSpell->getLocales() );
- //! suppress display of entries with no supported languages (see feature 110994)
- if (aLocales.getLength())
- {
- lcl_MergeLocales( aAllServiceLocales, aLocales );
- lcl_MergeDisplayArray( *this, aInfo );
- }
- }
-
- //read grammar checker
- Sequence< OUString > aGrammarNames = xLinguSrvcMgr->getAvailableServices(
- C2U(cGrammar), Locale() );
- const OUString* pGrammarNames = aGrammarNames.getConstArray();
- for(nIdx = 0; nIdx < aGrammarNames.getLength(); nIdx++)
- {
- ServiceInfo_Impl aInfo;
- aInfo.sGrammarImplName = pGrammarNames[nIdx];
- aInfo.xGrammar = uno::Reference<XProofreader>(
- xMSF->createInstanceWithArguments(aInfo.sGrammarImplName, aArgs), UNO_QUERY);
-
- uno::Reference<XServiceDisplayName> xDispName(aInfo.xGrammar, UNO_QUERY);
- if(xDispName.is())
- aInfo.sDisplayName = xDispName->getServiceDisplayName( aCurrentLocale );
-
- const Sequence< Locale > aLocales( aInfo.xGrammar->getLocales() );
- //! suppress display of entries with no supported languages (see feature 110994)
- if (aLocales.getLength())
- {
- lcl_MergeLocales( aAllServiceLocales, aLocales );
- lcl_MergeDisplayArray( *this, aInfo );
- }
- }
-
- //read hyphenator
- Sequence< OUString > aHyphNames = xLinguSrvcMgr->getAvailableServices(
- C2U(cHyph), Locale() );
- const OUString* pHyphNames = aHyphNames.getConstArray();
- for(nIdx = 0; nIdx < aHyphNames.getLength(); nIdx++)
- {
- ServiceInfo_Impl aInfo;
- aInfo.sHyphImplName = pHyphNames[nIdx];
- aInfo.xHyph = uno::Reference<XHyphenator>(
- xMSF->createInstanceWithArguments(aInfo.sHyphImplName, aArgs), UNO_QUERY);
-
- uno::Reference<XServiceDisplayName> xDispName(aInfo.xHyph, UNO_QUERY);
- if(xDispName.is())
- aInfo.sDisplayName = xDispName->getServiceDisplayName( aCurrentLocale );
-
- const Sequence< Locale > aLocales( aInfo.xHyph->getLocales() );
- //! suppress display of entries with no supported languages (see feature 110994)
- if (aLocales.getLength())
- {
- lcl_MergeLocales( aAllServiceLocales, aLocales );
- lcl_MergeDisplayArray( *this, aInfo );
- }
- }
-
- //read thesauri
- Sequence< OUString > aThesNames = xLinguSrvcMgr->getAvailableServices(
- C2U(cThes), Locale() );
- const OUString* pThesNames = aThesNames.getConstArray();
- for(nIdx = 0; nIdx < aThesNames.getLength(); nIdx++)
- {
- ServiceInfo_Impl aInfo;
- aInfo.sThesImplName = pThesNames[nIdx];
- aInfo.xThes = uno::Reference<XThesaurus>(
- xMSF->createInstanceWithArguments(aInfo.sThesImplName, aArgs), UNO_QUERY);
-
- uno::Reference<XServiceDisplayName> xDispName(aInfo.xThes, UNO_QUERY);
- if(xDispName.is())
- aInfo.sDisplayName = xDispName->getServiceDisplayName( aCurrentLocale );
-
- const Sequence< Locale > aLocales( aInfo.xThes->getLocales() );
- //! suppress display of entries with no supported languages (see feature 110994)
- if (aLocales.getLength())
- {
- lcl_MergeLocales( aAllServiceLocales, aLocales );
- lcl_MergeDisplayArray( *this, aInfo );
- }
- }
-
- Sequence< OUString > aCfgSvcs;
- const Locale* pAllLocales = aAllServiceLocales.getConstArray();
- for(sal_Int32 nLocale = 0; nLocale < aAllServiceLocales.getLength(); nLocale++)
- {
- INT16 nLang = SvxLocaleToLanguage( pAllLocales[nLocale] );
-
- aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(C2U(cSpell), pAllLocales[nLocale]);
- SetChecked( aCfgSvcs );
- if (aCfgSvcs.getLength())
- aCfgSpellTable[ nLang ] = aCfgSvcs;
-
- aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(C2U(cGrammar), pAllLocales[nLocale]);
- SetChecked( aCfgSvcs );
- if (aCfgSvcs.getLength())
- aCfgGrammarTable[ nLang ] = aCfgSvcs;
-
- aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(C2U(cHyph), pAllLocales[nLocale]);
- SetChecked( aCfgSvcs );
- if (aCfgSvcs.getLength())
- aCfgHyphTable[ nLang ] = aCfgSvcs;
-
- aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(C2U(cThes), pAllLocales[nLocale]);
- SetChecked( aCfgSvcs );
- if (aCfgSvcs.getLength())
- aCfgThesTable[ nLang ] = aCfgSvcs;
- }
- }
-}
-/* -----------------------------22.05.01 10:43--------------------------------
-
----------------------------------------------------------------------------*/
-SvxLinguData_Impl::SvxLinguData_Impl( const SvxLinguData_Impl &rData ) :
- aDisplayServiceArr (rData.aDisplayServiceArr),
- nDisplayServices (rData.nDisplayServices),
- aAllServiceLocales (rData.aAllServiceLocales),
- aCfgSpellTable (rData.aCfgSpellTable),
- aCfgHyphTable (rData.aCfgHyphTable),
- aCfgThesTable (rData.aCfgThesTable),
- aCfgGrammarTable (rData.aCfgGrammarTable),
- xMSF (rData.xMSF),
- xLinguSrvcMgr (rData.xLinguSrvcMgr)
-{
-}
-/* -----------------------------22.05.01 10:43--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxLinguData_Impl & SvxLinguData_Impl::operator = (const SvxLinguData_Impl &rData)
-{
- xMSF = rData.xMSF;
- xLinguSrvcMgr = rData.xLinguSrvcMgr;
- aAllServiceLocales = rData.aAllServiceLocales;
- aCfgSpellTable = rData.aCfgSpellTable;
- aCfgHyphTable = rData.aCfgHyphTable;
- aCfgThesTable = rData.aCfgThesTable;
- aCfgGrammarTable = rData.aCfgGrammarTable;
- aDisplayServiceArr = rData.aDisplayServiceArr;
- nDisplayServices = rData.nDisplayServices;
- return *this;
-}
-/* -----------------------------26.11.00 18:08--------------------------------
-
- ---------------------------------------------------------------------------*/
-SvxLinguData_Impl::~SvxLinguData_Impl()
-{
-}
-/* -----------------------------26.11.00 19:42--------------------------------
-
- ---------------------------------------------------------------------------*/
-void SvxLinguData_Impl::SetChecked(const Sequence<OUString>& rConfiguredServices)
-{
- const OUString* pConfiguredServices = rConfiguredServices.getConstArray();
- for(sal_Int32 n = 0; n < rConfiguredServices.getLength(); n++)
- {
- ServiceInfo_Impl* pEntry;
- for (ULONG i = 0; i < nDisplayServices; ++i)
- {
- pEntry = &aDisplayServiceArr[i];
- if (pEntry && !pEntry->bConfigured)
- {
- const OUString &rSrvcImplName = pConfiguredServices[n];
- if (rSrvcImplName.getLength() &&
- (pEntry->sSpellImplName == rSrvcImplName ||
- pEntry->sGrammarImplName == rSrvcImplName ||
- pEntry->sHyphImplName == rSrvcImplName ||
- pEntry->sThesImplName == rSrvcImplName))
- {
- pEntry->bConfigured = sal_True;
- break;
- }
- }
- }
- }
-}
-/* -----------------------------26.11.00 20:43--------------------------------
-
- ---------------------------------------------------------------------------*/
-
-sal_Bool SvxLinguData_Impl::AddRemove(
- Sequence< OUString > &rConfigured,
- const OUString &rImplName, BOOL bAdd )
-{
- sal_Bool bRet = sal_False; // modified?
-
- INT32 nEntries = rConfigured.getLength();
- INT32 nPos = lcl_SeqGetEntryPos(rConfigured, rImplName);
- if (bAdd && nPos < 0) // add new entry
- {
- rConfigured.realloc( ++nEntries );
- OUString *pConfigured = rConfigured.getArray();
- pConfigured = rConfigured.getArray();
- pConfigured[nEntries - 1] = rImplName;
- bRet = sal_True;
- }
- else if (!bAdd && nPos >= 0) // remove existing entry
- {
- OUString *pConfigured = rConfigured.getArray();
- for (INT32 i = nPos; i < nEntries - 1; ++i)
- pConfigured[i] = pConfigured[i + 1];
- rConfigured.realloc(--nEntries);
- bRet = sal_True;
- }
-
- return bRet;
-}
-
-
-void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, BOOL bEnable )
-{
- DBG_ASSERT( rDisplayName.getLength(), "empty DisplayName" );
-
- ServiceInfo_Impl *pInfo = 0;
- ServiceInfo_Impl *pTmp = 0;
- for (ULONG i = 0; i < nDisplayServices; ++i)
- {
- pTmp = &aDisplayServiceArr[i];
- if (pTmp && pTmp->sDisplayName == rDisplayName)
- {
- pInfo = pTmp;
- break;
- }
- }
- DBG_ASSERT( pInfo, "DisplayName entry not found" );
- if (pInfo)
- {
- pInfo->bConfigured = bEnable;
-
- Sequence< Locale > aLocales;
- const Locale *pLocale = 0;
- INT32 nLocales = 0;
- INT32 i;
-
- // update configured spellchecker entries
- if (pInfo->xSpell.is())
- {
- aLocales = pInfo->xSpell->getLocales();
- pLocale = aLocales.getConstArray();
- nLocales = aLocales.getLength();
- for (i = 0; i < nLocales; ++i)
- {
- INT16 nLang = SvxLocaleToLanguage( pLocale[i] );
- if (!aCfgSpellTable.count( nLang ) && bEnable)
- aCfgSpellTable[ nLang ] = Sequence< OUString >();
- if (aCfgSpellTable.count( nLang ))
- AddRemove( aCfgSpellTable[ nLang ], pInfo->sSpellImplName, bEnable );
- }
- }
-
- // update configured grammar checker entries
- if (pInfo->xGrammar.is())
- {
- aLocales = pInfo->xGrammar->getLocales();
- pLocale = aLocales.getConstArray();
- nLocales = aLocales.getLength();
- for (i = 0; i < nLocales; ++i)
- {
- INT16 nLang = SvxLocaleToLanguage( pLocale[i] );
- if (!aCfgGrammarTable.count( nLang ) && bEnable)
- aCfgGrammarTable[ nLang ] = Sequence< OUString >();
- if (aCfgGrammarTable.count( nLang ))
- AddRemove( aCfgGrammarTable[ nLang ], pInfo->sGrammarImplName, bEnable );
- }
- }
-
- // update configured hyphenator entries
- if (pInfo->xHyph.is())
- {
- aLocales = pInfo->xHyph->getLocales();
- pLocale = aLocales.getConstArray();
- nLocales = aLocales.getLength();
- for (i = 0; i < nLocales; ++i)
- {
- INT16 nLang = SvxLocaleToLanguage( pLocale[i] );
- if (!aCfgHyphTable.count( nLang ) && bEnable)
- aCfgHyphTable[ nLang ] = Sequence< OUString >();
- if (aCfgHyphTable.count( nLang ))
- AddRemove( aCfgHyphTable[ nLang ], pInfo->sHyphImplName, bEnable );
- }
- }
-
- // update configured spellchecker entries
- if (pInfo->xThes.is())
- {
- aLocales = pInfo->xThes->getLocales();
- pLocale = aLocales.getConstArray();
- nLocales = aLocales.getLength();
- for (i = 0; i < nLocales; ++i)
- {
- INT16 nLang = SvxLocaleToLanguage( pLocale[i] );
- if (!aCfgThesTable.count( nLang ) && bEnable)
- aCfgThesTable[ nLang ] = Sequence< OUString >();
- if (aCfgThesTable.count( nLang ))
- AddRemove( aCfgThesTable[ nLang ], pInfo->sThesImplName, bEnable );
- }
- }
- }
-}
-
-
-// class SvxLinguTabPage -------------------------------------------------
-
-#define CBCOL_FIRST 0
-#define CBCOL_SECOND 1
-#define CBCOL_BOTH 2
-
-SvxLinguTabPage::SvxLinguTabPage( Window* pParent,
- const SfxItemSet& rSet ):
-
- SfxTabPage( pParent, SVX_RES( RID_SFXPAGE_LINGU ), rSet ),
-
- aLinguisticFL ( this, SVX_RES( FL_LINGUISTIC ) ),
- aLinguModulesFT ( this, SVX_RES( FT_LINGU_MODULES ) ),
- aLinguModulesCLB ( this, SVX_RES( CLB_LINGU_MODULES ) ),
- aLinguModulesEditPB ( this, SVX_RES( PB_LINGU_MODULES_EDIT ) ),
- aLinguDicsFT ( this, SVX_RES( FT_LINGU_DICS ) ),
- aLinguDicsCLB ( this, SVX_RES( CLB_LINGU_DICS ) ),
- aLinguDicsNewPB ( this, SVX_RES( PB_LINGU_DICS_NEW_DIC ) ),
- aLinguDicsEditPB ( this, SVX_RES( PB_LINGU_DICS_EDIT_DIC ) ),
- aLinguDicsDelPB ( this, SVX_RES( PB_LINGU_DICS_DEL_DIC ) ),
- aLinguOptionsFT ( this, SVX_RES( FT_LINGU_OPTIONS ) ),
- aLinguOptionsCLB ( this, SVX_RES( CLB_LINGU_OPTIONS ) ),
- aLinguOptionsEditPB ( this, SVX_RES( PB_LINGU_OPTIONS_EDIT ) ),
- aMoreDictsLink ( this, SVX_RES( FT_LINGU_OPTIONS_MOREDICTS ) ),
- sCapitalWords ( SVX_RES( STR_CAPITAL_WORDS ) ),
- sWordsWithDigits ( SVX_RES( STR_WORDS_WITH_DIGITS ) ),
- sCapitalization ( SVX_RES( STR_CAPITALIZATION ) ),
- sSpellSpecial ( SVX_RES( STR_SPELL_SPECIAL ) ),
- sSpellAuto ( SVX_RES( STR_SPELL_AUTO ) ),
- sGrammarAuto ( SVX_RES( STR_GRAMMAR_AUTO ) ),
- sNumMinWordlen ( SVX_RES( STR_NUM_MIN_WORDLEN ) ),
- sNumPreBreak ( SVX_RES( STR_NUM_PRE_BREAK ) ),
- sNumPostBreak ( SVX_RES( STR_NUM_POST_BREAK ) ),
- sHyphAuto ( SVX_RES( STR_HYPH_AUTO ) ),
- sHyphSpecial ( SVX_RES( STR_HYPH_SPECIAL ) ),
-
- pLinguData ( NULL )
-{
- pCheckButtonData = NULL;
-
- aLinguModulesCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
- aLinguModulesCLB.SetHelpId(HID_CLB_LINGU_MODULES );
- aLinguModulesCLB.SetHighlightRange();
- aLinguModulesCLB.SetSelectHdl( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
- aLinguModulesCLB.SetDoubleClickHdl(LINK(this, SvxLinguTabPage, BoxDoubleClickHdl_Impl));
- aLinguModulesCLB.SetCheckButtonHdl(LINK(this, SvxLinguTabPage, BoxCheckButtonHdl_Impl));
-
- aLinguModulesEditPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
- aLinguOptionsEditPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
-
- aLinguDicsCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
- aLinguDicsCLB.SetHelpId(HID_CLB_EDIT_MODULES_DICS );
- aLinguDicsCLB.SetHighlightRange();
- aLinguDicsCLB.SetSelectHdl( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
- aLinguDicsCLB.SetCheckButtonHdl(LINK(this, SvxLinguTabPage, BoxCheckButtonHdl_Impl));
-
- aLinguDicsNewPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
- aLinguDicsEditPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
- aLinguDicsDelPB.SetClickHdl( LINK( this, SvxLinguTabPage, ClickHdl_Impl ));
-
- aLinguOptionsCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
- aLinguOptionsCLB.SetHelpId(HID_CLB_LINGU_OPTIONS );
- aLinguOptionsCLB.SetHighlightRange();
- aLinguOptionsCLB.SetSelectHdl( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
- aLinguOptionsCLB.SetDoubleClickHdl(LINK(this, SvxLinguTabPage, BoxDoubleClickHdl_Impl));
-
- if ( SvtExtendedSecurityOptions().GetOpenHyperlinkMode()
- != SvtExtendedSecurityOptions::OPEN_NEVER )
- {
- aMoreDictsLink.SetURL( String(
- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/dictionary?cid=926386" ) ) );
- aMoreDictsLink.SetClickHdl( LINK( this, SvxLinguTabPage, OpenURLHdl_Impl ) );
- }
- else
- aMoreDictsLink.Hide();
-
-
- // force recalculation of hash value used for checking the need of updating
- // because new dictionaries might be installed / downloaded.
- //! Thus it needs to be called now since it may infuence the supported languages
- //! to be reported AND the found user-dictionaries(!) as well.
- SvxLinguConfigUpdate::UpdateAll( sal_True );
-
- xProp = uno::Reference< XPropertySet >( SvxGetLinguPropertySet(), UNO_QUERY );
- xDicList = uno::Reference< XDictionaryList >( SvxGetDictionaryList(), UNO_QUERY );
- if (xDicList.is())
- {
- // keep references to all **currently** available dictionaries,
- // since the diclist may get changed meanwhile (e.g. through the API).
- // We want the dialog to operate on the same set of dictionaries it
- // was started with.
- // Also we have to take care to not loose the last reference when
- // someone else removes a dictionary from the list.
- // removed dics will be replaced by NULL new entries be added to the end
- // Thus we may use indizes as consistent references.
- aDics = xDicList->getDictionaries();
-
- UpdateDicBox_Impl();
- }
- else
- {
- aLinguDicsFT.Disable();
- aLinguDicsCLB.Disable();
- aLinguDicsNewPB.Disable();
- aLinguDicsEditPB.Disable();
- aLinguDicsDelPB.Disable();
- }
-
- const SfxSpellCheckItem* pItem = 0;
- SfxItemState eItemState = SFX_ITEM_UNKNOWN;
-
- eItemState = rSet.GetItemState( GetWhich( SID_ATTR_SPELL ),
- sal_False, (const SfxPoolItem**)&pItem );
-
- // handelt es sich um ein Default-Item?
- if ( eItemState == SFX_ITEM_DEFAULT )
- pItem = (const SfxSpellCheckItem*)&(rSet.Get( GetWhich( SID_ATTR_SPELL ) ) );
- else if ( eItemState == SFX_ITEM_DONTCARE )
- pItem = NULL;
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxLinguTabPage::~SvxLinguTabPage()
-{
- if (pLinguData)
- delete pLinguData;
-}
-
-//------------------------------------------------------------------------
-
-//nicht �berladen wegschmeissen
-sal_uInt16* SvxLinguTabPage::GetRanges()
-{
- //TL???
- return pRanges;
-}
-
-//------------------------------------------------------------------------
-
-SfxTabPage* SvxLinguTabPage::Create( Window* pParent,
- const SfxItemSet& rAttrSet )
-{
- return ( new SvxLinguTabPage( pParent, rAttrSet ) );
-}
-
-//------------------------------------------------------------------------
-
-Any lcl_Bool2Any(BOOL bVal)
-{
- Any aRet(&bVal, ::getBooleanCppuType());
- return aRet;
-}
-
-
-sal_Bool lcl_Bool2Any(Any& rVal)
-{
- return *(sal_Bool*)rVal.getValue();
-}
-
-
-sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet )
-{
- sal_Bool bModified = sal_True; // !!!!
-
- // if not HideGroups was called with GROUP_MODULES...
- if (aLinguModulesCLB.IsVisible())
- {
- DBG_ASSERT( pLinguData, "pLinguData not yet initialized" );
- if (!pLinguData)
- pLinguData = new SvxLinguData_Impl;
-
- LangImplNameTable::const_iterator aIt;
-
- // update spellchecker configuration entries
- const LangImplNameTable *pTable = &pLinguData->GetSpellTable();
- for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
- {
- INT16 nLang = aIt->first;
- const Sequence< OUString > aImplNames( aIt->second );
-#if OSL_DEBUG_LEVEL > 1
- const OUString *pTmpStr;
- pTmpStr = aImplNames.getConstArray();
-#endif
- uno::Reference< XLinguServiceManager > xMgr( pLinguData->GetManager() );
- Locale aLocale( SvxCreateLocale(nLang) );
- if (xMgr.is())
- xMgr->setConfiguredServices( C2U(cSpell), aLocale, aImplNames );
- }
-
- // update grammar checker configuration entries
- pTable = &pLinguData->GetGrammarTable();
- for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
- {
- INT16 nLang = aIt->first;
- const Sequence< OUString > aImplNames( aIt->second );
-#if OSL_DEBUG_LEVEL > 1
- const OUString *pTmpStr;
- pTmpStr = aImplNames.getConstArray();
-#endif
- uno::Reference< XLinguServiceManager > xMgr( pLinguData->GetManager() );
- Locale aLocale( SvxCreateLocale(nLang) );
- if (xMgr.is())
- xMgr->setConfiguredServices( C2U(cGrammar), aLocale, aImplNames );
- }
-
- // update hyphenator configuration entries
- pTable = &pLinguData->GetHyphTable();
- for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
- {
- INT16 nLang = aIt->first;
- const Sequence< OUString > aImplNames( aIt->second );
-#if OSL_DEBUG_LEVEL > 1
- const OUString *pTmpStr;
- pTmpStr = aImplNames.getConstArray();
-#endif
- uno::Reference< XLinguServiceManager > xMgr( pLinguData->GetManager() );
- Locale aLocale( SvxCreateLocale(nLang) );
- if (xMgr.is())
- xMgr->setConfiguredServices( C2U(cHyph), aLocale, aImplNames );
- }
-
- // update thesaurus configuration entries
- pTable = &pLinguData->GetThesTable();
- for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
- {
- INT16 nLang = aIt->first;
- const Sequence< OUString > aImplNames( aIt->second );
-#if OSL_DEBUG_LEVEL > 1
- const OUString *pTmpStr;
- pTmpStr = aImplNames.getConstArray();
-#endif
- uno::Reference< XLinguServiceManager > xMgr( pLinguData->GetManager() );
- Locale aLocale( SvxCreateLocale(nLang) );
- if (xMgr.is())
- xMgr->setConfiguredServices( C2U(cThes), aLocale, aImplNames );
- }
- }
-
-
- //
- // activate dictionaries according to checkbox state
- //
- Sequence< OUString > aActiveDics;
- INT32 nActiveDics = 0;
- ULONG nEntries = aLinguDicsCLB.GetEntryCount();
- for (ULONG i = 0; i < nEntries; ++i)
- {
- INT32 nDics = aDics.getLength();
-// const uno::Reference< XDictionary > *pDic = aDics.getConstArray();
-
- aActiveDics.realloc( nDics );
- OUString *pActiveDic = aActiveDics.getArray();
-
- SvLBoxEntry *pEntry = aLinguDicsCLB.GetEntry( i );
- if (pEntry)
- {
- DicUserData aData( (ULONG)pEntry->GetUserData() );
- if (aData.GetEntryId() < nDics)
- {
- BOOL bChecked = aLinguDicsCLB.IsChecked( (USHORT) i );
- uno::Reference< XDictionary > xDic( aDics.getConstArray()[ i ] );
- if (xDic.is())
- {
- if (SvxGetIgnoreAllList() == xDic)
- bChecked = TRUE;
- xDic->setActive( bChecked );
-
- if (bChecked)
- {
- String aDicName( xDic->getName() );
- pActiveDic[ nActiveDics++ ] = aDicName;
- }
- }
- }
- }
- }
- //
- aActiveDics.realloc( nActiveDics );
- Any aTmp;
- aTmp <<= aActiveDics;
- SvtLinguConfig aLngCfg;
- aLngCfg.SetProperty( UPH_ACTIVE_DICTIONARIES, aTmp );
-
-
- nEntries = aLinguOptionsCLB.GetEntryCount();
- for (USHORT j = 0; j < nEntries; ++j)
- {
- SvLBoxEntry *pEntry = aLinguOptionsCLB.GetEntry( j );
-
- OptionsUserData aData( (ULONG)pEntry->GetUserData() );
- String aPropName( lcl_GetPropertyName( (EID_OPTIONS) aData.GetEntryId() ) );
-
- Any aAny;
- if (aData.IsCheckable())
- {
- BOOL bChecked = aLinguOptionsCLB.IsChecked( j );
- aAny <<= bChecked;
- }
- else if (aData.HasNumericValue())
- {
- INT16 nVal = aData.GetNumericValue();
- aAny <<= nVal;
- }
-
- if (xProp.is())
- xProp->setPropertyValue( aPropName, aAny );
- aLngCfg.SetProperty( aPropName, aAny );
- }
-
- SvLBoxEntry *pPreBreakEntry = aLinguOptionsCLB.GetEntry( (USHORT) EID_NUM_PRE_BREAK );
- SvLBoxEntry *pPostBreakEntry = aLinguOptionsCLB.GetEntry( (USHORT) EID_NUM_POST_BREAK );
- DBG_ASSERT( pPreBreakEntry, "NULL Pointer" );
- DBG_ASSERT( pPostBreakEntry, "NULL Pointer" );
- if (pPreBreakEntry && pPostBreakEntry)
- {
- OptionsUserData aPreBreakData( (ULONG)pPreBreakEntry->GetUserData() );
- OptionsUserData aPostBreakData( (ULONG)pPostBreakEntry->GetUserData() );
- if ( aPreBreakData.IsModified() || aPostBreakData.IsModified() )
- {
- SfxHyphenRegionItem aHyp( GetWhich( SID_ATTR_HYPHENREGION ) );
- aHyp.GetMinLead() = (UINT8) aPreBreakData.GetNumericValue();
- aHyp.GetMinTrail() = (UINT8) aPostBreakData.GetNumericValue();
- rCoreSet.Put( aHyp );
- }
- }
-
-
- // automatic spell checking
- BOOL bNewAutoCheck = aLinguOptionsCLB.IsChecked( (USHORT) EID_SPELL_AUTO );
- const SfxPoolItem* pOld = GetOldItem( rCoreSet, SID_AUTOSPELL_CHECK );
- if ( !pOld || ( (SfxBoolItem*)pOld )->GetValue() != bNewAutoCheck )
- {
- rCoreSet.Put( SfxBoolItem( GetWhich( SID_AUTOSPELL_CHECK ),
- bNewAutoCheck ) );
- bModified |= sal_True;
- }
-
- return bModified;
-}
-
-// ----------------------------------------------------------------------
-
-ULONG SvxLinguTabPage::GetDicUserData( const uno::Reference< XDictionary > &rxDic, USHORT nIdx )
-{
- ULONG nRes = 0;
- DBG_ASSERT( rxDic.is(), "dictionary not supplied" );
- if (rxDic.is())
- {
- uno::Reference< frame::XStorable > xStor( rxDic, UNO_QUERY );
-
-// ULONG nUserData = 0;
- BOOL bChecked = rxDic->isActive();
- BOOL bEditable = !xStor.is() || !xStor->isReadonly();
- BOOL bDeletable = bEditable;
-// BOOL bNegativ = rxDic->getDictionaryType() == DictionaryType_NEGATIVE;
-
- nRes = DicUserData( nIdx,
- bChecked, bEditable, bDeletable ).GetUserData();
- }
- return nRes;
-}
-
-
-void SvxLinguTabPage::AddDicBoxEntry(
- const uno::Reference< XDictionary > &rxDic,
- USHORT nIdx )
-{
- aLinguDicsCLB.SetUpdateMode(FALSE);
-
- String aTxt( ::GetDicInfoStr( rxDic->getName(),
- SvxLocaleToLanguage( rxDic->getLocale() ),
- DictionaryType_NEGATIVE == rxDic->getDictionaryType() ) );
- aLinguDicsCLB.InsertEntry( aTxt, (USHORT)LISTBOX_APPEND ); // append at end
- SvLBoxEntry* pEntry = aLinguDicsCLB.GetEntry( aLinguDicsCLB.GetEntryCount() - 1 );
- DBG_ASSERT( pEntry, "failed to add entry" );
- if (pEntry)
- {
- DicUserData aData( GetDicUserData( rxDic, nIdx ) );
- pEntry->SetUserData( (void *) aData.GetUserData() );
- lcl_SetCheckButton( pEntry, aData.IsChecked() );
- }
-
- aLinguDicsCLB.SetUpdateMode(TRUE);
-}
-
-// ----------------------------------------------------------------------
-
-void SvxLinguTabPage::UpdateDicBox_Impl()
-{
- aLinguDicsCLB.SetUpdateMode(FALSE);
- aLinguDicsCLB.Clear();
-
- INT32 nDics = aDics.getLength();
- const uno::Reference< XDictionary > *pDic = aDics.getConstArray();
- for (INT32 i = 0; i < nDics; ++i)
- {
- const uno::Reference< XDictionary > &rDic = pDic[i];
- if (rDic.is())
- AddDicBoxEntry( rDic, (USHORT)i );
- }
-
- aLinguDicsCLB.SetUpdateMode(TRUE);
-}
-
-// ----------------------------------------------------------------------
-
-void SvxLinguTabPage::UpdateModulesBox_Impl()
-{
- if (pLinguData)
- {
- const ServiceInfoArr &rAllDispSrvcArr = pLinguData->GetDisplayServiceArray();
- const ULONG nDispSrvcCount = pLinguData->GetDisplayServiceCount();
-
- aLinguModulesCLB.Clear();
-
- for (USHORT i = 0; i < nDispSrvcCount; ++i)
- {
- const ServiceInfo_Impl &rInfo = rAllDispSrvcArr[i];
- aLinguModulesCLB.InsertEntry( rInfo.sDisplayName, (USHORT)LISTBOX_APPEND );
- SvLBoxEntry* pEntry = aLinguModulesCLB.GetEntry(i);
- pEntry->SetUserData( (void *) &rInfo );
- aLinguModulesCLB.CheckEntryPos( i, rInfo.bConfigured );
- }
- aLinguModulesEditPB.Enable( nDispSrvcCount > 0 );
- }
-}
-
-//------------------------------------------------------------------------
-
-void SvxLinguTabPage::Reset( const SfxItemSet& rSet )
-{
- // if not HideGroups was called with GROUP_MODULES...
- if (aLinguModulesCLB.IsVisible())
- {
- if (!pLinguData)
- pLinguData = new SvxLinguData_Impl;
- UpdateModulesBox_Impl();
- }
-
-
- //
- // get data from configuration
- //
-
- SvtLinguConfig aLngCfg;
-
- aLinguOptionsCLB.SetUpdateMode(FALSE);
- aLinguOptionsCLB.Clear();
-
- SvLBoxTreeList *pModel = aLinguOptionsCLB.GetModel();
- SvLBoxEntry* pEntry = NULL;
-
- INT16 nVal = 0;
- BOOL bVal = FALSE;
- ULONG nUserData = 0;
-
- pEntry = CreateEntry( sSpellAuto, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_SPELL_AUTO) ) >>= bVal;
- const SfxPoolItem* pItem = GetItem( rSet, SID_AUTOSPELL_CHECK );
- if (pItem)
- bVal = ((SfxBoolItem *) pItem)->GetValue();
- nUserData = OptionsUserData( EID_SPELL_AUTO, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sGrammarAuto, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_GRAMMAR_AUTO) ) >>= bVal;
-// const SfxPoolItem* pItem = GetItem( rSet, SID_AUTOSPELL_CHECK );
-// if (pItem)
-// bVal = ((SfxBoolItem *) pItem)->GetValue();
- nUserData = OptionsUserData( EID_GRAMMAR_AUTO, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sCapitalWords, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_SPELL_UPPER_CASE) ) >>= bVal;
- nUserData = OptionsUserData( EID_CAPITAL_WORDS, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sWordsWithDigits, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_SPELL_WITH_DIGITS) ) >>= bVal;
- nUserData = OptionsUserData( EID_WORDS_WITH_DIGITS, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sCapitalization, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_SPELL_CAPITALIZATION) ) >>= bVal;
- nUserData = OptionsUserData( EID_CAPITALIZATION, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sSpellSpecial, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_SPELL_SPECIAL) ) >>= bVal;
- nUserData = OptionsUserData( EID_SPELL_SPECIAL, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sNumMinWordlen, CBCOL_SECOND );
- aLngCfg.GetProperty( C2U(UPN_HYPH_MIN_WORD_LENGTH) ) >>= nVal;
- nUserData = OptionsUserData( EID_NUM_MIN_WORDLEN, TRUE, (USHORT)nVal, FALSE, FALSE).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
-
- const SfxHyphenRegionItem *pHyp = NULL;
- USHORT nWhich = GetWhich( SID_ATTR_HYPHENREGION );
- if ( rSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_SET )
- pHyp = &( (const SfxHyphenRegionItem &) rSet.Get( nWhich ) );
-
- pEntry = CreateEntry( sNumPreBreak, CBCOL_SECOND );
- aLngCfg.GetProperty( C2U(UPN_HYPH_MIN_LEADING) ) >>= nVal;
- if (pHyp)
- nVal = (INT16) pHyp->GetMinLead();
- nUserData = OptionsUserData( EID_NUM_PRE_BREAK, TRUE, (USHORT)nVal, FALSE, FALSE).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
-
- pEntry = CreateEntry( sNumPostBreak, CBCOL_SECOND );
- aLngCfg.GetProperty( C2U(UPN_HYPH_MIN_TRAILING) ) >>= nVal;
- if (pHyp)
- nVal = (INT16) pHyp->GetMinTrail();
- nUserData = OptionsUserData( EID_NUM_POST_BREAK, TRUE, (USHORT)nVal, FALSE, FALSE).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
-
- pEntry = CreateEntry( sHyphAuto, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_HYPH_AUTO) ) >>= bVal;
- nUserData = OptionsUserData( EID_HYPH_AUTO, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- pEntry = CreateEntry( sHyphSpecial, CBCOL_FIRST );
- aLngCfg.GetProperty( C2U(UPN_IS_HYPH_SPECIAL) ) >>= bVal;
- nUserData = OptionsUserData( EID_HYPH_SPECIAL, FALSE, 0, TRUE, bVal).GetUserData();
- pEntry->SetUserData( (void *)nUserData );
- pModel->Insert( pEntry );
- lcl_SetCheckButton( pEntry, bVal );
-
- aLinguOptionsCLB.SetUpdateMode(TRUE);
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLinguTabPage, BoxDoubleClickHdl_Impl, SvTreeListBox *, pBox )
-{
- if (pBox == &aLinguModulesCLB)
- {
- //! in order to avoid a bug causing a GPF when double clicking
- //! on a module entry and exiting the "Edit Modules" dialog
- //! after that.
- Application::PostUserEvent( LINK(
- this, SvxLinguTabPage, PostDblClickHdl_Impl ) );
- }
- else if (pBox == &aLinguOptionsCLB)
- {
- ClickHdl_Impl(&aLinguOptionsEditPB);
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLinguTabPage, PostDblClickHdl_Impl, SvTreeListBox *, EMPTYARG )
-{
- ClickHdl_Impl(&aLinguModulesEditPB);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLinguTabPage, OpenURLHdl_Impl, svt::FixedHyperlink *, EMPTYARG )
-{
- ::rtl::OUString sURL( aMoreDictsLink.GetURL() );
- lcl_OpenURL( sURL );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLinguTabPage, BoxCheckButtonHdl_Impl, SvTreeListBox *, pBox )
-{
- if (pBox == &aLinguModulesCLB)
- {
- DBG_ASSERT( pLinguData, "NULL pointer, LinguData missing" );
- USHORT nPos = aLinguModulesCLB.GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND && pLinguData)
- {
- pLinguData->Reconfigure( aLinguModulesCLB.GetText( nPos ),
- aLinguModulesCLB.IsChecked( nPos ) );
- }
- }
- else if (pBox == &aLinguDicsCLB)
- {
- USHORT nPos = aLinguDicsCLB.GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- const uno::Reference< XDictionary > &rDic = aDics.getConstArray()[ nPos ];
- if (SvxGetIgnoreAllList() == rDic)
- {
- SvLBoxEntry* pEntry = aLinguDicsCLB.GetEntry( nPos );
- if (pEntry)
- lcl_SetCheckButton( pEntry, TRUE );
- }
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
-{
- if (&aLinguModulesEditPB == pBtn)
- {
- if (!pLinguData)
- pLinguData = new SvxLinguData_Impl;
-
- SvxLinguData_Impl aOldLinguData( *pLinguData );
- SvxEditModulesDlg aDlg( this, *pLinguData );
- if (aDlg.Execute() != RET_OK)
- *pLinguData = aOldLinguData;
-
- // evaluate new status of 'bConfigured' flag
- ULONG nLen = pLinguData->GetDisplayServiceCount();
- for (ULONG i = 0; i < nLen; ++i)
- pLinguData->GetDisplayServiceArray()[i].bConfigured = FALSE;
- const Locale* pAllLocales = pLinguData->GetAllSupportedLocales().getConstArray();
- INT32 nLocales = pLinguData->GetAllSupportedLocales().getLength();
- for (INT32 k = 0; k < nLocales; ++k)
- {
- INT16 nLang = SvxLocaleToLanguage( pAllLocales[k] );
- if (pLinguData->GetSpellTable().count( nLang ))
- pLinguData->SetChecked( pLinguData->GetSpellTable()[ nLang ] );
- if (pLinguData->GetGrammarTable().count( nLang ))
- pLinguData->SetChecked( pLinguData->GetGrammarTable()[ nLang ] );
- if (pLinguData->GetHyphTable().count( nLang ))
- pLinguData->SetChecked( pLinguData->GetHyphTable()[ nLang ] );
- if (pLinguData->GetThesTable().count( nLang ))
- pLinguData->SetChecked( pLinguData->GetThesTable()[ nLang ] );
- }
-
- // show new status of modules
- UpdateModulesBox_Impl();
- }
- else if (&aLinguDicsNewPB == pBtn)
- {
- uno::Reference< XSpellChecker1 > xSpellChecker1;
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if(pFact)
- {
- AbstractSvxNewDictionaryDialog* aDlg = pFact->CreateSvxNewDictionaryDialog( this, xSpellChecker1, RID_SFXDLG_NEWDICT );
- DBG_ASSERT(aDlg, "Dialogdiet fail!");
- uno::Reference< XDictionary > xNewDic;
- if ( aDlg->Execute() == RET_OK )
- xNewDic = uno::Reference< XDictionary >( aDlg->GetNewDictionary(), UNO_QUERY );
- if ( xNewDic.is() )
- {
- // add new dics to the end
- INT32 nLen = aDics.getLength();
- aDics.realloc( nLen + 1 );
-
- aDics.getArray()[ nLen ] = xNewDic;
-
- AddDicBoxEntry( xNewDic, (USHORT) nLen );
- }
- delete aDlg; //add by CHINA001
- }
- }
- else if (&aLinguDicsEditPB == pBtn)
- {
- SvLBoxEntry *pEntry = aLinguDicsCLB.GetCurEntry();
- if (pEntry)
- {
- DicUserData aData( (ULONG) pEntry->GetUserData() );
- USHORT nDicPos = aData.GetEntryId();
- INT32 nDics = aDics.getLength();
- if (nDicPos < nDics)
- {
- uno::Reference< XDictionary > xDic;
- xDic = aDics.getConstArray()[ nDicPos ];
- if (xDic.is())
- {
- uno::Reference< XSpellChecker1 > xSpellChecker1;
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if(pFact)
- {
- VclAbstractDialog* aDlg = pFact->CreateSvxEditDictionaryDialog( this, xDic->getName(), xSpellChecker1, RID_SFXDLG_EDITDICT );
- DBG_ASSERT(aDlg, "Dialogdiet fail!");
- aDlg->Execute();
- delete aDlg;
- }
- }
- }
- }
- }
- else if (&aLinguDicsDelPB == pBtn)
- {
- if ( RET_NO ==
- QueryBox( this, SVX_RES( RID_SFXQB_DELDICT ) ).Execute() )
- return 0;
-
- SvLBoxEntry *pEntry = aLinguDicsCLB.GetCurEntry();
- if (pEntry)
- {
- DicUserData aData( (ULONG) pEntry->GetUserData() );
- USHORT nDicPos = aData.GetEntryId();
- INT32 nDics = aDics.getLength();
- if (nDicPos < nDics)
- {
- uno::Reference< XDictionary > xDic;
- xDic = aDics.getConstArray()[ nDicPos ];
- if (xDic.is())
- {
- if (SvxGetIgnoreAllList() == xDic)
- xDic->clear();
- else
- {
- if (xDicList.is())
- xDicList->removeDictionary( xDic );
-
- uno::Reference< frame::XStorable > xStor( xDic, UNO_QUERY );
- if ( xStor->hasLocation() && !xStor->isReadonly() )
- {
- String sURL = xStor->getLocation();
- INetURLObject aObj(sURL);
- DBG_ASSERT( aObj.GetProtocol() == INET_PROT_FILE,
- "non-file URLs cannot be deleted" );
- if ( aObj.GetProtocol() == INET_PROT_FILE )
- {
- KillFile_Impl( aObj.GetMainURL( INetURLObject::NO_DECODE ) );
- }
- }
-
- aDics.getArray()[ nDicPos ] = 0;
-
- // remove entry from checklistbox
- ULONG nCnt = aLinguDicsCLB.GetEntryCount();
- for (ULONG i = 0; i < nCnt; ++i)
- {
- SvLBoxEntry *pDicEntry = aLinguDicsCLB.GetEntry( i );
- DBG_ASSERT( pDicEntry, "missing entry" );
- if (pDicEntry)
- {
- DicUserData aDicData( (ULONG) pDicEntry->GetUserData() );
- if (aDicData.GetEntryId() == nDicPos )
- {
- aLinguDicsCLB.RemoveEntry( (USHORT) i );
- break;
- }
- }
- }
- DBG_ASSERT( nCnt > aLinguDicsCLB.GetEntryCount(),
- "remove failed ?");
- }
- }
- }
- }
- }
- else if (&aLinguOptionsEditPB == pBtn)
- {
- SvLBoxEntry *pEntry = aLinguOptionsCLB.GetCurEntry();
- DBG_ASSERT( pEntry, "no entry selected" );
- if (pEntry)
- {
- long nVal = -1;
- OptionsUserData aData( (ULONG)pEntry->GetUserData() );
- if(aData.HasNumericValue())
- {
- int nRID = -1;
- switch (aData.GetEntryId())
- {
- case EID_NUM_PRE_BREAK : nRID = STR_NUM_PRE_BREAK_DLG; break;
- case EID_NUM_POST_BREAK : nRID = STR_NUM_POST_BREAK_DLG; break;
- case EID_NUM_MIN_WORDLEN: nRID = STR_NUM_MIN_WORDLEN_DLG; break;
- default:
- DBG_ERROR( "unexpected case" );
- }
-
- OptionsBreakSet aDlg( this, nRID );
- aDlg.GetNumericFld().SetValue( aData.GetNumericValue() );
- if (RET_OK == aDlg.Execute() )
- {
- nVal = static_cast<long>(aDlg.GetNumericFld().GetValue());
- if (-1 != nVal && aData.GetNumericValue() != nVal)
- {
- aData.SetNumericValue( (BYTE)nVal ); //! sets IsModified !
- pEntry->SetUserData( (void *) aData.GetUserData() );
- aLinguOptionsCLB.Invalidate();
- }
- }
- }
- }
- }
- else
- {
- DBG_ERROR( "pBtn unexpected value" );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxLinguTabPage, SelectHdl_Impl, SvxCheckListBox *, pBox )
-{
- if (&aLinguModulesCLB == pBox)
- {
- }
- else if (&aLinguDicsCLB == pBox)
- {
- SvLBoxEntry *pEntry = pBox->GetCurEntry();
- if (pEntry)
- {
- DicUserData aData( (ULONG) pEntry->GetUserData() );
-
- // always allow to edit (i.e. at least view the content of the dictionary)
- aLinguDicsEditPB.Enable( true/*aData.IsEditable()*/ );
- aLinguDicsDelPB .Enable( aData.IsDeletable() );
- }
- }
- else if (&aLinguOptionsCLB == pBox)
- {
- SvLBoxEntry *pEntry = pBox->GetCurEntry();
- if (pEntry)
- {
- OptionsUserData aData( (ULONG) pEntry->GetUserData() );
- aLinguOptionsEditPB.Enable( aData.HasNumericValue() );
- }
- }
- else
- {
- DBG_ERROR( "pBox unexpected value" );
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-SvLBoxEntry* SvxLinguTabPage::CreateEntry( String& rTxt, USHORT nCol )
-{
- SvLBoxEntry* pEntry = new SvLBoxEntry;
-
- if( !pCheckButtonData )
- pCheckButtonData = new SvLBoxButtonData( &aLinguOptionsCLB );
-
- String sEmpty;
- if (CBCOL_FIRST == nCol)
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
- if (CBCOL_SECOND == nCol)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff!
- pEntry->AddItem( new BrwString_Impl( pEntry, 0, rTxt ) );
-
- return pEntry;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxLinguTabPage::HideGroups( sal_uInt16 nGrp )
-{
- if ( 0 != ( GROUP_MODULES & nGrp ) )
- {
- aLinguModulesFT.Hide();
- aLinguModulesCLB.Hide();
- aLinguModulesEditPB.Hide();
-
- // reposition / resize remaining controls
- long nDeltaY = aLinguDicsFT.GetPosPixel().Y() -
- aLinguModulesFT.GetPosPixel().Y();
- DBG_ASSERT( nDeltaY >= 0, "move/resize value is negative" );
- Point aPos;
- //
- aPos = aLinguDicsFT.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguDicsFT.SetPosPixel( aPos );
- aPos = aLinguDicsCLB.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguDicsCLB.SetPosPixel( aPos );
- aPos = aLinguDicsNewPB.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguDicsNewPB.SetPosPixel( aPos );
- aPos = aLinguDicsEditPB.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguDicsEditPB.SetPosPixel( aPos );
- aPos = aLinguDicsDelPB.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguDicsDelPB.SetPosPixel( aPos );
- //
- aPos = aLinguOptionsFT.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguOptionsFT.SetPosPixel( aPos );
- aPos = aLinguOptionsCLB.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguOptionsCLB.SetPosPixel( aPos );
- aPos = aLinguOptionsEditPB.GetPosPixel();
- aPos.Y() -= nDeltaY;
- aLinguOptionsEditPB.SetPosPixel( aPos );
- //
- Size aSize( aLinguOptionsCLB.GetSizePixel() );
- aSize.Height() += nDeltaY;
- aLinguOptionsCLB.SetSizePixel( aSize );
-
- if ( SvtExtendedSecurityOptions().GetOpenHyperlinkMode()
- != SvtExtendedSecurityOptions::OPEN_NEVER )
- {
- aSize = GetOutputSizePixel();
- aSize.Height() += ( aMoreDictsLink.GetSizePixel().Height() * 11 / 8 );
- SetSizePixel( aSize );
- aMoreDictsLink.Show();
- }
- }
-}
-/*--------------------------------------------------
---------------------------------------------------*/
-
-SvxEditModulesDlg::SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData) :
- ModalDialog( pParent, SVX_RES(RID_SVXDLG_EDIT_MODULES ) ),
- aModulesFL ( this, SVX_RES( FL_EDIT_MODULES_OPTIONS ) ),
- aLanguageFT ( this, SVX_RES( FT_EDIT_MODULES_LANGUAGE ) ),
- aLanguageLB ( this, SVX_RES( LB_EDIT_MODULES_LANGUAGE ), FALSE ),
- aModulesCLB ( this, SVX_RES( CLB_EDIT_MODULES_MODULES ) ),
- aPrioUpPB ( this, SVX_RES( PB_EDIT_MODULES_PRIO_UP ) ),
- aPrioDownPB ( this, SVX_RES( PB_EDIT_MODULES_PRIO_DOWN ) ),
- aBackPB ( this, SVX_RES( PB_EDIT_MODULES_PRIO_BACK ) ),
- aMoreDictsLink ( this, SVX_RES( FT_EDIT_MODULES_NEWDICTSLINK ) ),
- aButtonsFL ( this, SVX_RES( FL_EDIT_MODULES_BUTTONS ) ),
- aHelpPB ( this, SVX_RES( PB_HELP ) ),
- aClosePB ( this, SVX_RES( PB_OK ) ),
- sSpell ( SVX_RES( ST_SPELL ) ),
- sHyph ( SVX_RES( ST_HYPH ) ),
- sThes ( SVX_RES( ST_THES ) ),
- sGrammar ( SVX_RES( ST_GRAMMAR ) ),
- rLinguData ( rData )
-{
- pCheckButtonData = NULL;
- FreeResource();
-
- pDefaultLinguData = new SvxLinguData_Impl( rLinguData );
-
- aModulesCLB.SetWindowBits( WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
- aModulesCLB.SetHighlightRange();
- aModulesCLB.SetHelpId(HID_CLB_EDIT_MODULES_MODULES );
- aModulesCLB.SetSelectHdl( LINK( this, SvxEditModulesDlg, SelectHdl_Impl ));
- aModulesCLB.SetCheckButtonHdl( LINK( this, SvxEditModulesDlg, BoxCheckButtonHdl_Impl) );
-
- aClosePB .SetClickHdl( LINK( this, SvxEditModulesDlg, ClickHdl_Impl ));
- aPrioUpPB .SetClickHdl( LINK( this, SvxEditModulesDlg, UpDownHdl_Impl ));
- aPrioDownPB.SetClickHdl( LINK( this, SvxEditModulesDlg, UpDownHdl_Impl ));
- aBackPB .SetClickHdl( LINK( this, SvxEditModulesDlg, BackHdl_Impl ));
- // in case of not installed language modules
- aPrioUpPB .Enable( FALSE );
- aPrioDownPB.Enable( FALSE );
-
- if ( SvtExtendedSecurityOptions().GetOpenHyperlinkMode()
- != SvtExtendedSecurityOptions::OPEN_NEVER )
- {
- aMoreDictsLink.SetURL( String(
- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/dictionary?cid=926386" ) ) );
- aMoreDictsLink.SetClickHdl( LINK( this, SvxEditModulesDlg, OpenURLHdl_Impl ) );
- }
- else
- {
- aMoreDictsLink.Hide();
- long nPos = aMoreDictsLink.GetPosPixel().Y() + aMoreDictsLink.GetSizePixel().Height();
- Size aSize = aModulesCLB.GetSizePixel();
- aSize.Height() += ( nPos - ( aModulesCLB.GetPosPixel().Y() + aSize.Height() ) );
- aModulesCLB.SetSizePixel( aSize );
- }
-
- //
- //fill language box
- //
- Sequence< INT16 > aAvailLang;
- uno::Reference< XAvailableLocales > xAvail( rLinguData.GetManager(), UNO_QUERY );
- if (xAvail.is())
- {
- aAvailLang = lcl_LocaleSeqToLangSeq(
- xAvail->getAvailableLocales( C2U(cSpell) ) );
- }
- const Sequence< Locale >& rLoc = rLinguData.GetAllSupportedLocales();
- const Locale* pLocales = rLoc.getConstArray();
- aLanguageLB.Clear();
- for(long i = 0; i < rLoc.getLength(); i++)
- {
- INT16 nLang = SvxLocaleToLanguage( pLocales[i] );
- aLanguageLB.InsertLanguage( nLang, lcl_SeqHasLang( aAvailLang, nLang ) );
- }
- LanguageType eSysLang = MsLangId::getSystemLanguage();
- aLanguageLB.SelectLanguage( eSysLang );
- if(!aLanguageLB.IsLanguageSelected( eSysLang ) )
- aLanguageLB.SelectEntryPos(0);
-
- aLanguageLB.SetSelectHdl( LINK( this, SvxEditModulesDlg, LangSelectHdl_Impl ));
- LangSelectHdl_Impl(&aLanguageLB);
-}
-
-
-SvxEditModulesDlg::~SvxEditModulesDlg()
-{
- delete pDefaultLinguData;
-}
-
-
-SvLBoxEntry* SvxEditModulesDlg::CreateEntry( String& rTxt, USHORT nCol )
-{
- SvLBoxEntry* pEntry = new SvLBoxEntry;
- if( !pCheckButtonData )
- {
- pCheckButtonData = new SvLBoxButtonData( &aModulesCLB );
- pCheckButtonData->SetLink( aModulesCLB.GetCheckButtonHdl() );
- }
-
- String sEmpty;
- if (CBCOL_FIRST == nCol)
- pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) );
- if (CBCOL_SECOND == nCol)
- pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte
- pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff!
- pEntry->AddItem( new BrwStringDic_Impl( pEntry, 0, rTxt ) );
-
- return pEntry;
-}
-
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxEditModulesDlg, SelectHdl_Impl, SvxCheckListBox *, pBox )
-{
- if (&aModulesCLB == pBox)
- {
- sal_Bool bDisableUp = sal_True;
- sal_Bool bDisableDown = sal_True;
- SvLBoxEntry *pEntry = pBox->GetCurEntry();
- if (pEntry)
- {
- ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
- if(!pData->IsParent() && pData->GetType() != TYPE_HYPH)
- {
- USHORT nCurPos = pBox->GetSelectEntryPos();
- if(nCurPos < pBox->GetEntryCount() - 1)
- {
- bDisableDown = ((ModuleUserData_Impl*)pBox->
- GetEntry(nCurPos + 1)->GetUserData())->IsParent();
- }
- if(nCurPos > 1)
- {
- bDisableUp = ((ModuleUserData_Impl*)pBox->
- GetEntry(nCurPos - 1)->GetUserData())->IsParent();
- }
- }
- aPrioUpPB.Enable(!bDisableUp);
- aPrioDownPB.Enable(!bDisableDown);
- }
- }
- else
- {
- DBG_ERROR( "pBox unexpected value" );
- }
-
- return 0;
-}
-/* -----------------------------28.05.01 11:00--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxEditModulesDlg, BoxCheckButtonHdl_Impl, SvTreeListBox *, pBox )
-{
-// if (pBox == (SvTreeListBox *) &aModulesCLB)
-// {
- pBox = &aModulesCLB;
- SvLBoxEntry *pCurEntry = pBox->GetCurEntry();
- if (pCurEntry)
- {
- ModuleUserData_Impl* pData = (ModuleUserData_Impl *)
- pCurEntry->GetUserData();
- if (!pData->IsParent() && pData->GetType() == TYPE_HYPH)
- {
- // make hyphenator checkboxes function as radio-buttons
- // (at most one box may be checked)
- SvLBoxEntry *pEntry = pBox->First();
- while (pEntry)
- {
- pData = (ModuleUserData_Impl *) pEntry->GetUserData();
- if (!pData->IsParent() &&
- pData->GetType() == TYPE_HYPH &&
- pEntry != pCurEntry)
- {
- lcl_SetCheckButton( pEntry, FALSE );
- pBox->InvalidateEntry( pEntry );
- }
- pEntry = pBox->Next( pEntry );
- }
- }
- }
-// }
- return 0;
-}
-/* -----------------------------27.11.00 14:00--------------------------------
-
- ---------------------------------------------------------------------------*/
-OUString lcl_GetServiceName(BYTE nType)
-{
- switch(nType)
- {
- case TYPE_SPELL : return C2U(cSpell);
- case TYPE_GRAMMAR : return C2U(cGrammar);
- case TYPE_HYPH : return C2U(cHyph);
- case TYPE_THES : return C2U(cThes);
- }
- return OUString();
-}
-
-
-IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
-{
- LanguageType eCurLanguage = aLanguageLB.GetSelectLanguage();
- static Locale aLastLocale;
- Locale aCurLocale;
- SvxLanguageToLocale(aCurLocale, eCurLanguage);
- SvLBoxTreeList *pModel = aModulesCLB.GetModel();
-// uno::Reference<XLinguServiceManager>& xMgr = rLinguData.GetManager();
-
- if (pBox)
- {
- // save old probably changed settings
- // before switching to new language entries
-
- INT16 nLang = SvxLocaleToLanguage( aLastLocale );
-
- sal_Int32 nStart = 0, nLocalIndex = 0;
- Sequence< OUString > aChange;
- sal_Bool bChanged = FALSE;
- for(USHORT i = 0; i < aModulesCLB.GetEntryCount(); i++)
- {
- SvLBoxEntry *pEntry = aModulesCLB.GetEntry(i);
- ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
- if(pData->IsParent())
- {
- if(bChanged)
- {
- LangImplNameTable *pTable = 0;
- BYTE nType = pData->GetType();
- switch (nType - 1)
- {
- case TYPE_SPELL : pTable = &rLinguData.GetSpellTable(); break;
- case TYPE_GRAMMAR : pTable = &rLinguData.GetGrammarTable(); break;
- case TYPE_HYPH : pTable = &rLinguData.GetHyphTable(); break;
- case TYPE_THES : pTable = &rLinguData.GetThesTable(); break;
- }
- if (pTable)
- {
- aChange.realloc(nStart);
- (*pTable)[ nLang ] = aChange;
- }
- }
- nLocalIndex = nStart = 0;
- aChange.realloc(aModulesCLB.GetEntryCount());
- bChanged = FALSE;
- }
- else
- {
- OUString* pChange = aChange.getArray();
- pChange[nStart] = pData->GetImplName();
- bChanged |= pData->GetIndex() != nLocalIndex ||
- pData->IsChecked() != aModulesCLB.IsChecked(i);
- if(aModulesCLB.IsChecked(i))
- nStart++;
- ++nLocalIndex;
- }
- }
- if(bChanged)
- {
- aChange.realloc(nStart);
- rLinguData.GetThesTable()[ nLang ] = aChange;
- }
- }
-
- for(ULONG i = 0; i < aModulesCLB.GetEntryCount(); i++)
- delete (ModuleUserData_Impl*)aModulesCLB.GetEntry(i)->GetUserData();
-
- //
- // display entries for new selected language
- //
- aModulesCLB.Clear();
- if(LANGUAGE_DONTKNOW != eCurLanguage)
- {
-// sal_Int32 nEntryPos = 1;
-
- ULONG n;
- ServiceInfo_Impl* pInfo;
-
- //
- // spellchecker entries
- //
- SvLBoxEntry* pEntry = CreateEntry( sSpell, CBCOL_SECOND );
- ModuleUserData_Impl* pUserData = new ModuleUserData_Impl(
- String(), TRUE, FALSE, TYPE_SPELL, 0 );
- pEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pEntry );
- //
- Sequence< OUString > aNames( rLinguData.GetSortedImplNames( eCurLanguage, TYPE_SPELL ) );
- const OUString *pName = aNames.getConstArray();
- ULONG nNames = (ULONG) aNames.getLength();
- sal_Int32 nLocalIndex = 0; // index relative to parent
- for (n = 0; n < nNames; ++n)
- {
- OUString aImplName;
- BOOL bIsSuppLang = FALSE;
-
- pInfo = rLinguData.GetInfoByImplName( pName[n] );
- if (pInfo)
- {
- bIsSuppLang = pInfo->xSpell.is() &&
- pInfo->xSpell->hasLocale( aCurLocale );
- aImplName = pInfo->sSpellImplName;
- }
- if (aImplName.getLength() && bIsSuppLang)
- {
- String aTxt( pInfo->sDisplayName );
- SvLBoxEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
-
- LangImplNameTable &rTable = rLinguData.GetSpellTable();
- const bool bHasLang = rTable.count( eCurLanguage );
- if (!bHasLang)
- {
- DBG_WARNING( "language entry missing" ); // only relevant if all languages found should be supported
- }
- const bool bCheck = bHasLang && lcl_SeqGetEntryPos( rTable[ eCurLanguage ], aImplName ) >= 0;
- lcl_SetCheckButton( pNewEntry, bCheck );
- pUserData = new ModuleUserData_Impl( aImplName, FALSE,
- bCheck, TYPE_SPELL, (BYTE)nLocalIndex++ );
- pNewEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pNewEntry );
- }
- }
-
- //
- // grammar checker entries
- //
- pEntry = CreateEntry( sGrammar, CBCOL_SECOND );
- pUserData = new ModuleUserData_Impl( String(), TRUE, FALSE, TYPE_GRAMMAR, 0 );
- pEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pEntry );
- //
- aNames = rLinguData.GetSortedImplNames( eCurLanguage, TYPE_GRAMMAR );
- pName = aNames.getConstArray();
- nNames = (ULONG) aNames.getLength();
- nLocalIndex = 0;
- for (n = 0; n < nNames; ++n)
- {
- OUString aImplName;
- BOOL bIsSuppLang = FALSE;
-
- pInfo = rLinguData.GetInfoByImplName( pName[n] );
- if (pInfo)
- {
- bIsSuppLang = pInfo->xGrammar.is() &&
- pInfo->xGrammar->hasLocale( aCurLocale );
- aImplName = pInfo->sGrammarImplName;
- }
- if (aImplName.getLength() && bIsSuppLang)
- {
- String aTxt( pInfo->sDisplayName );
- SvLBoxEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
-
- LangImplNameTable &rTable = rLinguData.GetGrammarTable();
- const bool bHasLang = rTable.count( eCurLanguage );
- if (!bHasLang)
- {
- DBG_WARNING( "language entry missing" ); // only relevant if all languages found should be supported
- }
- const bool bCheck = bHasLang && lcl_SeqGetEntryPos( rTable[ eCurLanguage ], aImplName ) >= 0;
- lcl_SetCheckButton( pNewEntry, bCheck );
- pUserData = new ModuleUserData_Impl( aImplName, FALSE,
- bCheck, TYPE_GRAMMAR, (BYTE)nLocalIndex++ );
- pNewEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pNewEntry );
- }
- }
-
- //
- // hyphenator entries
- //
- pEntry = CreateEntry( sHyph, CBCOL_SECOND );
- pUserData = new ModuleUserData_Impl( String(), TRUE, FALSE, TYPE_HYPH, 0 );
- pEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pEntry );
- //
- aNames = rLinguData.GetSortedImplNames( eCurLanguage, TYPE_HYPH );
- pName = aNames.getConstArray();
- nNames = (ULONG) aNames.getLength();
- nLocalIndex = 0;
- for (n = 0; n < nNames; ++n)
- {
- OUString aImplName;
- BOOL bIsSuppLang = FALSE;
-
- pInfo = rLinguData.GetInfoByImplName( pName[n] );
- if (pInfo)
- {
- bIsSuppLang = pInfo->xHyph.is() &&
- pInfo->xHyph->hasLocale( aCurLocale );
- aImplName = pInfo->sHyphImplName;
- }
- if (aImplName.getLength() && bIsSuppLang)
- {
- String aTxt( pInfo->sDisplayName );
- SvLBoxEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
-
- LangImplNameTable &rTable = rLinguData.GetHyphTable();
- const bool bHasLang = rTable.count( eCurLanguage );
- if (!bHasLang)
- {
- DBG_WARNING( "language entry missing" ); // only relevant if all languages found should be supported
- }
- const bool bCheck = bHasLang && lcl_SeqGetEntryPos( rTable[ eCurLanguage ], aImplName ) >= 0;
- lcl_SetCheckButton( pNewEntry, bCheck );
- pUserData = new ModuleUserData_Impl( aImplName, FALSE,
- bCheck, TYPE_HYPH, (BYTE)nLocalIndex++ );
- pNewEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pNewEntry );
- }
- }
-
- //
- // thesaurus entries
- //
- pEntry = CreateEntry( sThes, CBCOL_SECOND );
- pUserData = new ModuleUserData_Impl( String(), TRUE, FALSE, TYPE_THES, 0 );
- pEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pEntry );
- //
- aNames = rLinguData.GetSortedImplNames( eCurLanguage, TYPE_THES );
- pName = aNames.getConstArray();
- nNames = (ULONG) aNames.getLength();
- nLocalIndex = 0;
- for (n = 0; n < nNames; ++n)
- {
- OUString aImplName;
- BOOL bIsSuppLang = FALSE;
-
- pInfo = rLinguData.GetInfoByImplName( pName[n] );
- if (pInfo)
- {
- bIsSuppLang = pInfo->xThes.is() &&
- pInfo->xThes->hasLocale( aCurLocale );
- aImplName = pInfo->sThesImplName;
- }
- if (aImplName.getLength() && bIsSuppLang)
- {
- String aTxt( pInfo->sDisplayName );
- SvLBoxEntry* pNewEntry = CreateEntry( aTxt, CBCOL_FIRST );
-
- LangImplNameTable &rTable = rLinguData.GetThesTable();
- const bool bHasLang = rTable.count( eCurLanguage );
- if (!bHasLang)
- {
- DBG_WARNING( "language entry missing" ); // only relevant if all languages found should be supported
- }
- const bool bCheck = bHasLang && lcl_SeqGetEntryPos( rTable[ eCurLanguage ], aImplName ) >= 0;
- lcl_SetCheckButton( pNewEntry, bCheck );
- pUserData = new ModuleUserData_Impl( aImplName, FALSE,
- bCheck, TYPE_THES, (BYTE)nLocalIndex++ );
- pNewEntry->SetUserData( (void *)pUserData );
- pModel->Insert( pNewEntry );
- }
- }
- }
- aLastLocale.Language = aCurLocale.Language;
- aLastLocale.Country = aCurLocale.Country;
- return 0;
-}
-/* -----------------------------27.11.00 19:50--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxEditModulesDlg, UpDownHdl_Impl, PushButton *, pBtn )
-{
- sal_Bool bUp = &aPrioUpPB == pBtn;
- USHORT nCurPos = aModulesCLB.GetSelectEntryPos();
- SvLBoxEntry* pEntry;
- if (nCurPos != LISTBOX_ENTRY_NOTFOUND &&
- 0 != (pEntry = aModulesCLB.GetEntry(nCurPos)))
- {
- aModulesCLB.SetUpdateMode(FALSE);
- SvLBoxTreeList *pModel = aModulesCLB.GetModel();
-
- ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
- String aStr(aModulesCLB.GetEntryText(pEntry));
- SvLBoxEntry* pToInsert = CreateEntry( aStr, CBCOL_FIRST );
- pToInsert->SetUserData( (void *)pData);
- BOOL bIsChecked = aModulesCLB.IsChecked(nCurPos);
-
- pModel->Remove(pEntry);
-
- USHORT nDestPos = bUp ? nCurPos - 1 : nCurPos + 1;
- pModel->Insert(pToInsert, nDestPos);
- aModulesCLB.CheckEntryPos(nDestPos, bIsChecked );
- aModulesCLB.SelectEntryPos(nDestPos );
- SelectHdl_Impl(&aModulesCLB);
- aModulesCLB.SetUpdateMode(TRUE);
- }
- return 0;
-}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxEditModulesDlg, ClickHdl_Impl, PushButton *, pBtn )
-{
- if (&aClosePB == pBtn)
- {
- // store language config
- LangSelectHdl_Impl(&aLanguageLB);
- EndDialog( RET_OK );
- }
- else
- {
- DBG_ERROR( "pBtn unexpected value" );
- }
-
- return 0;
-}
-/* -----------------------------27.11.00 20:31--------------------------------
-
- ---------------------------------------------------------------------------*/
-IMPL_LINK( SvxEditModulesDlg, BackHdl_Impl, PushButton *, EMPTYARG )
-{
- rLinguData = *pDefaultLinguData;
- LangSelectHdl_Impl(0);
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxEditModulesDlg, OpenURLHdl_Impl, svt::FixedHyperlink *, EMPTYARG )
-{
- ::rtl::OUString sURL( aMoreDictsLink.GetURL() );
- lcl_OpenURL( sURL );
- return 0;
-}
-
diff --git a/svx/source/options/optlingu.hrc b/svx/source/options/optlingu.hrc
deleted file mode 100644
index e1dcacbcff..0000000000
--- a/svx/source/options/optlingu.hrc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optlingu.hrc,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// defines ---------------------------------------------------------------
-
-#define FL_LINGUISTIC 101
-
-#define FT_LINGU_MODULES 111
-#define CLB_LINGU_MODULES 112
-#define PB_LINGU_MODULES_EDIT 113
-
-#define FT_LINGU_OPTIONS 121
-#define CLB_LINGU_OPTIONS 122
-#define PB_LINGU_OPTIONS_EDIT 123
-#define FT_LINGU_OPTIONS_MOREDICTS 124
-
-#define STR_CAPITAL_WORDS 201
-#define STR_WORDS_WITH_DIGITS 202
-#define STR_CAPITALIZATION 203
-#define STR_SPELL_SPECIAL 204
-#define STR_SPELL_AUTO 206
-#define STR_NUM_PRE_BREAK 209
-#define STR_NUM_POST_BREAK 210
-#define STR_HYPH_AUTO 211
-#define STR_HYPH_SPECIAL 212
-#define STR_NUM_MIN_WORDLEN 213
-
-#define STR_NUM_PRE_BREAK_DLG 214
-#define STR_NUM_POST_BREAK_DLG 215
-#define STR_NUM_MIN_WORDLEN_DLG 216
-
-#define STR_GRAMMAR_AUTO 217
-
-#define STR_WARNING 63
-
-#define PB_OK 70
-#define PB_HELP 72
-
-#define ST_SPELL 82
-#define ST_HYPH 83
-#define ST_THES 84
-#define ST_GRAMMAR 85
-
-#define FL_NUMVAL_PREBREAK 305
-#define BT_OK_PREBREAK 306
-#define BT_CANCEL_PREBREAK 307
-#define ED_PREBREAK 308
-#define PB_EDIT_MODULES_PRIO_UP 309
-#define PB_EDIT_MODULES_PRIO_DOWN 310
-#define PB_EDIT_MODULES_PRIO_BACK 311
-
-#define FT_LINGU_DICS 312
-#define CLB_LINGU_DICS 313
-#define PB_LINGU_DICS_NEW_DIC 314
-#define PB_LINGU_DICS_EDIT_DIC 315
-#define PB_LINGU_DICS_DEL_DIC 316
-
-#define FL_EDIT_MODULES_OPTIONS 317
-#define FT_EDIT_MODULES_LANGUAGE 318
-#define LB_EDIT_MODULES_LANGUAGE 319
-#define CLB_EDIT_MODULES_MODULES 320
-#define FT_EDIT_MODULES_NEWDICTSLINK 321
-#define FL_EDIT_MODULES_BUTTONS 322
-
diff --git a/svx/source/options/optlingu.src b/svx/source/options/optlingu.src
deleted file mode 100644
index a550451193..0000000000
--- a/svx/source/options/optlingu.src
+++ /dev/null
@@ -1,357 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optlingu.src,v $
- * $Revision: 1.51 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// include ------------------------------------------------------------------
-
-#include "optlingu.hrc"
-#include "helpid.hrc"
-
-#include <svtools/controldims.hrc>
-#include <sfx2/sfx.hrc>
-#include <svx/dialogs.hrc>
-
-// RID_SVXDLG_EDIT_MODULES ---------------------------------------------------
-
-ModalDialog RID_SVXDLG_EDIT_MODULES
-{
- HelpID = HID_EDIT_MODULES ;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 240 , 197 ) ;
- Text [ en-US ] = "Edit Modules";
-
- FixedLine FL_EDIT_MODULES_OPTIONS
- {
- Pos = MAP_APPFONT ( RSC_SP_FLGR_INNERBORDER_LEFT , RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 240 - 2*RSC_SP_FLGR_INNERBORDER_LEFT , RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Options";
- };
- FixedText FT_EDIT_MODULES_LANGUAGE
- {
- Left = TRUE ;
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 68 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "Language";
- };
- ListBox LB_EDIT_MODULES_LANGUAGE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 83 , 14 ) ;
- Size = MAP_APPFONT ( 95 , 80 ) ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- Control CLB_EDIT_MODULES_MODULES
- {
- Pos = MAP_APPFONT ( 12 , 32 ) ;
- Size = MAP_APPFONT ( 166 , 120 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_EDIT_MODULES_PRIO_UP
- {
- Pos = MAP_APPFONT ( 184 , 32 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Move Up";
- };
- PushButton PB_EDIT_MODULES_PRIO_DOWN
- {
- Pos = MAP_APPFONT ( 184 , 49 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Move Down";
- };
- PushButton PB_EDIT_MODULES_PRIO_BACK
- {
- Pos = MAP_APPFONT ( 184 , 66 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Back";
- };
- FixedText FT_EDIT_MODULES_NEWDICTSLINK
- {
- Left = TRUE ;
- Pos = MAP_APPFONT ( 12 , 155 ) ;
- Size = MAP_APPFONT ( 169 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "~Get more dictionaries online...";
- };
- FixedLine FL_EDIT_MODULES_BUTTONS
- {
- Pos = MAP_APPFONT ( 0 , 166 ) ;
- Size = MAP_APPFONT ( 240 , RSC_CD_FIXEDLINE_HEIGHT ) ;
- };
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT ( 12, 177 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- };
- OKButton PB_OK
- {
- Pos = MAP_APPFONT ( 184 , 177 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ;
- Text [ en-US ] = "Close";
- };
-
- String ST_SPELL
- {
- Text [ en-US ] = "Spelling";
- };
- String ST_HYPH
- {
- Text [ en-US ] = "Hyphenation";
- };
- String ST_THES
- {
- Text [ en-US ] = "Thesaurus";
- };
- String ST_GRAMMAR
- {
- Text [ en-US ] = "Grammar";
- };
-};
-
-// RID_SVXDLG_LNG_ED_NUM_PREBREAK -------------------------------------------
-
-ModalDialog RID_SVXDLG_LNG_ED_NUM_PREBREAK
-{
- HelpID = HID_LNGDLG_NUM_PREBREAK ;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Size = MAP_APPFONT ( 155 , 43 ) ;
- Text [ en-US ] = "Hyphenation";
- FixedLine FL_NUMVAL_PREBREAK
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 87 , 8 ) ;
- };
- OKButton BT_OK_PREBREAK
- {
- Pos = MAP_APPFONT ( 99 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL_PREBREAK
- {
- Pos = MAP_APPFONT ( 99 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- NumericField ED_PREBREAK
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 56 , 14 ) ;
- Size = MAP_APPFONT ( 31 , 12 ) ;
- Left = TRUE ;
- Minimum = 2 ;
- Maximum = 9 ;
- Last = 9 ;
- Repeat = TRUE ;
- Spin = TRUE ;
- SpinSize = 1;
- };
- String STR_NUM_PRE_BREAK_DLG
- {
- Text [ en-US ] = "Characters before break";
- };
- String STR_NUM_POST_BREAK_DLG
- {
- Text [ en-US ] = "Characters after break";
- };
- String STR_NUM_MIN_WORDLEN_DLG
- {
- Text [ en-US ] = "Minimal word length";
- };
-};
-
-// RID_SFXPAGE_LINGU --------------------------------------------------------
-
-TabPage RID_SFXPAGE_LINGU
-{
- HelpId = HID_OPTIONS_LINGU ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Options";
- FixedLine FL_LINGUISTIC
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Writing aids";
- };
- FixedText FT_LINGU_MODULES
- {
- Left = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 175 , 8 ) ;
- Text [ en-US ] = "Available language modules";
- };
- Control CLB_LINGU_MODULES
- {
- Pos = MAP_APPFONT ( 12 , 25 ) ;
- Size = MAP_APPFONT ( 182 , 30 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_LINGU_MODULES_EDIT
- {
- Pos = MAP_APPFONT ( 198 , 25 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Edit...";
- };
- FixedText FT_LINGU_DICS
- {
- Left = TRUE ;
- Pos = MAP_APPFONT ( 12 , 59 ) ;
- Size = MAP_APPFONT ( 175 , 8 ) ;
- Text [ en-US ] = "User-defined dictionaries";
- };
- Control CLB_LINGU_DICS
- {
- Pos = MAP_APPFONT ( 12 , 70 ) ;
- Size = MAP_APPFONT ( 182 , 48 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_LINGU_DICS_NEW_DIC
- {
- Pos = MAP_APPFONT ( 198 , 70 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~New...";
- };
- PushButton PB_LINGU_DICS_EDIT_DIC
- {
- Pos = MAP_APPFONT ( 198 , 87 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Ed~it...";
- };
- PushButton PB_LINGU_DICS_DEL_DIC
- {
- Pos = MAP_APPFONT ( 198 , 104 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Delete";
- };
- FixedText FT_LINGU_OPTIONS
- {
- Left = TRUE ;
- Pos = MAP_APPFONT ( 12 , 122 ) ;
- Size = MAP_APPFONT ( 175 , 8 ) ;
- Text [ en-US ] = "~Options";
- };
- Control CLB_LINGU_OPTIONS
- {
- Pos = MAP_APPFONT ( 12 , 133 ) ;
- Size = MAP_APPFONT ( 182 , 46 ) ;
- Border = TRUE ;
- TabStop = TRUE ;
- };
- PushButton PB_LINGU_OPTIONS_EDIT
- {
- Pos = MAP_APPFONT ( 198 , 133 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Edi~t...";
- };
- FixedText FT_LINGU_OPTIONS_MOREDICTS
- {
- Left = TRUE ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 12 , 182 ) ;
- Size = MAP_APPFONT ( 182 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
- Text [ en-US ] = "~Get more dictionaries online...";
- };
-
- String STR_CAPITAL_WORDS
- {
- Text [ en-US ] = "Check uppercase words";
- };
- String STR_WORDS_WITH_DIGITS
- {
- Text [ en-US ] = "Check words with numbers ";
- };
- String STR_CAPITALIZATION
- {
- Text [ en-US ] = "Check capitalization";
- };
- String STR_SPELL_SPECIAL
- {
- Text [ en-US ] = "Check special regions";
- };
- String STR_SPELL_AUTO
- {
- Text [ en-US ] = "Check spelling as you type";
- };
- String STR_GRAMMAR_AUTO
- {
- Text [ en-US ] = "Check grammar as you type";
- };
- String STR_NUM_MIN_WORDLEN
- {
- Text [ en-US ] = "Minimal number of characters for hyphenation: ";
- };
- String STR_NUM_PRE_BREAK
- {
- Text [ en-US ] = "Characters before line break: ";
- };
- String STR_NUM_POST_BREAK
- {
- Text [ en-US ] = "Characters after line break: ";
- };
- String STR_HYPH_AUTO
- {
- Text [ en-US ] = "Hyphenate without inquiry";
- };
- String STR_HYPH_SPECIAL
- {
- Text [ en-US ] = "Hyphenate special regions";
- };
-};
-// end: TabPage RID_SFXPAGE_LINGU
-
- // RID_SFXQB_DELDICT --------------------------------------------------------
-QueryBox RID_SFXQB_DELDICT
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- Message [ en-US ] = "Do you want to delete the dictionary?" ;
-};
- // RID_SFXQB_DEL_IGNORELIST ----------------------------------------------
-QueryBox RID_SFXQB_DEL_IGNORELIST
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- Message [ en-US ] = "Do you want to delete the ignore list?" ;
-};
- // ******************************************************************* EOF
diff --git a/svx/source/options/optpath.src b/svx/source/options/optpath.src
deleted file mode 100644
index 82f8aade66..0000000000
--- a/svx/source/options/optpath.src
+++ /dev/null
@@ -1,203 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optpath.src,v $
- * $Revision: 1.35 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include --------------------------------------------------------------
-#include "optpath.hrc"
-#include <svx/dialogs.hrc>
-#ifndef _SFX_HRC
-#include <sfx2/sfx.hrc>
-#endif
-#include "helpid.hrc"
-
- // RID_SFXPAGE_PATH -----------------------------------------------------
-#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; }
-TabPage RID_SFXPAGE_PATH
-{
- HelpId = HID_OPTIONS_PATH ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- Text [ en-US ] = "Paths" ;
- FixedText FT_TYPE
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Type" ;
- };
- FixedText FT_PATH
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 110 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Path" ;
- };
- Control LB_PATH
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 147 ) ;
- Border = TRUE ;
- TabStop = TRUE;
- };
- PushButton BTN_PATH
- {
- Pos = MAP_APPFONT ( 183 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
- };
- PushButton BTN_STANDARD
- {
- Pos = MAP_APPFONT ( 115 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~Default" ;
- };
- FixedLine GB_STD
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Paths used by %PRODUCTNAME" ;
- };
- Image IMG_LOCK
- {
- ImageBitmap = Bitmap { File = "lock.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- Image IMG_LOCK_HC
- {
- ImageBitmap = Bitmap { File = "lock_hc.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- String STR_MULTIPATHDLG
- {
- Text [ en-US ] = "Edit Paths: %1" ;
- };
-};
-ErrorBox RID_SVXERR_OPT_DOUBLEPATHS
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "The configuration and mail directories must be specified as separate directories.\nPlease choose a new path." ;
-};
- // ******************************************************************* EOF
-String RID_SVXSTR_KEY_CONFIG_DIR
-{
- Text [ en-US ] = "Configuration" ;
-};
-String RID_SVXSTR_KEY_WORK_PATH
-{
- Text [ en-US ] = "My Documents" ;
-};
-String RID_SVXSTR_KEY_GRAPHICS_PATH
-{
- Text [ en-US ] = "Graphics" ;
-};
-String RID_SVXSTR_KEY_BITMAP_PATH
-{
- Text [ en-US ] = "Icons" ;
-};
-String RID_SVXSTR_KEY_BASIC_PATH
-{
- Text = "BASIC" ;
-};
-
-String RID_SVXSTR_KEY_PALETTE_PATH
-{
- Text [ en-US ] = "Palettes" ;
-};
-String RID_SVXSTR_KEY_BACKUP_PATH
-{
- Text [ en-US ] = "Backups" ;
-};
-String RID_SVXSTR_KEY_MODULES_PATH
-{
- Text [ en-US ] = "Modules" ;
-};
-String RID_SVXSTR_KEY_TEMPLATE_PATH
-{
- Text [ en-US ] = "Templates" ;
-};
-String RID_SVXSTR_KEY_GLOSSARY_PATH
-{
- Text [ en-US ] = "AutoText";
-};
-String RID_SVXSTR_KEY_DICTIONARY_PATH
-{
- Text [ en-US ] = "Dictionaries" ;
-};
-String RID_SVXSTR_KEY_HELP_DIR
-{
- Text [ en-US ] = "Help" ;
-};
-String RID_SVXSTR_KEY_GALLERY_DIR
-{
- Text [ en-US ] = "Gallery" ;
-};
-
-String RID_SVXSTR_KEY_STORAGE_DIR
-{
- Text [ en-US ] = "Message Storage" ;
-};
-String RID_SVXSTR_KEY_TEMP_PATH
-{
- Text [ en-US ] = "Temporary files";
-};
-String RID_SVXSTR_KEY_PLUGINS_PATH
-{
- Text [ en-US ] = "Plug-ins";
-};
-String RID_SVXSTR_KEY_FAVORITES_DIR
-{
- Text [ en-US ] = "Folder Bookmarks";
-};
-String RID_SVXSTR_KEY_FILTER_PATH
-{
- Text [ en-US ] = "Filters";
-};
-String RID_SVXSTR_KEY_ADDINS_PATH
-{
- Text [ en-US ] = "Add-ins";
-};
-String RID_SVXSTR_KEY_USERCONFIG_PATH
-{
- Text [ en-US ] = "User Configuration";
-};
-String RID_SVXSTR_KEY_USERDICTIONARY_DIR
-{
- Text [ en-US ] = "User-defined dictionaries";
-};
-String RID_SVXSTR_KEY_AUTOCORRECT_DIR
-{
- Text [ en-US ] = "AutoCorrect";
-};
-String RID_SVXSTR_KEY_LINGUISTIC_DIR
-{
- Text [ en-US ] = "Writing aids";
-};
-
diff --git a/svx/source/options/optsave.src b/svx/source/options/optsave.src
deleted file mode 100644
index ee3d21c435..0000000000
--- a/svx/source/options/optsave.src
+++ /dev/null
@@ -1,325 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optsave.src,v $
- * $Revision: 1.82 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
- // include ---------------------------------------------------------------
-#include <sfx2/sfx.hrc>
-#include <svx/dialogs.hrc>
-#include "helpid.hrc"
-#include "optsave.hrc"
-
- // SID_SFXPAGE_SAVE ------------------------------------------------------
-#define TEXT_SAVEPAGE \
- Text [ en-US ] = "Save" ;\
-
-TabPage RID_SFXPAGE_SAVE
-{
- HelpId = HID_OPTIONS_SAVE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- TEXT_SAVEPAGE
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedLine LB_LOAD
- {
- Pos = MAP_APPFONT ( 6 , 2 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Load";
- };
- CheckBox CB_LOAD_SETTINGS
- {
- Pos = MAP_APPFONT ( 12 , 11 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "Load user-specific settings with the document";
- };
- CheckBox CB_LOAD_DOCPRINTER
- {
- Pos = MAP_APPFONT ( 12 , 22 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "Load printer settings with the document";
- };
- FixedLine GB_SAVE
- {
- Pos = MAP_APPFONT ( 6 , 32 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Save" ;
- };
- CheckBox BTN_DOCINFO
- {
- Pos = MAP_APPFONT ( 12 , 41 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "~Edit document properties before saving" ;
- TabStop = TRUE ;
- };
- FixedImage FI_BACKUP
- {
- Pos = MAP_APPFONT ( 5, 53 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- CheckBox BTN_BACKUP
- {
- Pos = MAP_APPFONT ( 12 , 52 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "Al~ways create backup copy" ;
- };
- CheckBox BTN_AUTOSAVE
- {
- Pos = MAP_APPFONT ( 12 , 63 ) ;
- Size = MAP_APPFONT ( 150 , 10 ) ;
- Text [ en-US ] = "Save ~AutoRecovery information every" ;
- };
- NumericField ED_AUTOSAVE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 180 , 62 ) ;
- Size = MAP_APPFONT ( 21 , 12 ) ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 60 ;
- StrictFormat = TRUE ;
- First = 1 ;
- Last = 60 ;
- SpinSize = 1 ;
- TabStop = TRUE ;
- };
- FixedText FT_MINUTE
- {
- Pos = MAP_APPFONT ( 204 , 63 ) ;
- Size = MAP_APPFONT ( 35 , 8 ) ;
- Text [ en-US ] = "Minutes" ;
- };
- CheckBox BTN_RELATIVE_FSYS
- {
- Pos = MAP_APPFONT ( 12 , 74 ) ;
- Size = MAP_APPFONT ( 236 , 10 ) ;
- Text [ en-US ] = "Save URLs relative to file system" ;
- };
- CheckBox BTN_RELATIVE_INET
- {
- Pos = MAP_APPFONT ( 12 , 85 ) ;
- Size = MAP_APPFONT ( 248 , 10 ) ;
- Text [ en-US ] = "Save URLs relative to internet" ;
- };
- FixedLine FL_FILTER
- {
- Pos = MAP_APPFONT ( 6 , 97 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Default file format and ODF settings" ;
- };
- FixedText FT_ODF_VERSION
- {
- Pos = MAP_APPFONT ( 12 , 107 ) ;
- Size = MAP_APPFONT ( 121 , 8 ) ;
- Text [ en-US ] = "ODF format version" ;
- };
- ListBox LB_ODF_VERSION
- {
- Pos = MAP_APPFONT ( 136 , 105 ) ;
- Size = MAP_APPFONT ( 108 , 58 ) ;
- Border = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "1.0/1.1" ; 2 ; > ;
- < "1.2" ; 4 ; > ;
- < "1.2 Extended (recommended)"; 0x7fffffff ; > ;
- };
- };
- CheckBox BTN_NOPRETTYPRINTING
- {
- Pos = MAP_APPFONT ( 12 , 120 ) ;
- Size = MAP_APPFONT ( 248 , 10 ) ;
- Text [ en-US ] = "Size optimization for ODF format" ;
- };
- CheckBox BTN_WARNALIENFORMAT
- {
- Pos = MAP_APPFONT ( 12 , 131 ) ;
- Size = MAP_APPFONT ( 248 , 10 ) ;
- Text [ en-US ] = "Warn when not saving in ODF or default format" ;
- };
- FixedText FT_APP
- {
- Pos = MAP_APPFONT ( 12 , 142 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "D~ocument type";
- };
- FixedText FT_FILTER
- {
- Pos = MAP_APPFONT ( 136 , 142 ) ;
- Size = MAP_APPFONT ( 120 , 8 ) ;
- Text [ en-US ] = "Always sa~ve as";
- };
- ListBox LB_APP
- {
- Pos = MAP_APPFONT ( 12 , 153 ) ;
- Size = MAP_APPFONT ( 108 , 58 ) ;
- Border = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "Text document" ; APP_WRITER ; > ;
- < "HTML document" ; APP_WRITER_WEB; > ;
- < "Master document" ; APP_WRITER_GLOBAL; > ;
- < "Spreadsheet" ; APP_CALC ; > ;
- < "Presentation" ; APP_IMPRESS ; > ;
- < "Drawing" ; APP_DRAW ; > ;
- < "Formula" ; APP_MATH ; > ;
- };
- };
- FixedImage FI_FILTER
- {
- Pos = MAP_APPFONT ( 129, 154 ) ;
- Size = MAP_APPFONT ( 6 , 6 ) ;
- Hide = TRUE;
- };
- ListBox LB_FILTER
- {
- Pos = MAP_APPFONT ( 136 , 153 ) ;
- Size = MAP_APPFONT ( 108 , 58 ) ;
- Border = TRUE;
- Sort = TRUE;
- DropDown = TRUE;
- };
- FixedImage FI_ODF_WARNING
- {
- Pos = MAP_APPFONT ( 12, 169 ) ;
- Size = MAP_APPFONT ( 8 , 8 ) ;
- Hide = TRUE;
- };
- FixedText FT_WARN
- {
- Pos = MAP_APPFONT ( 23 , 169 ) ;
- Size = MAP_APPFONT ( 239 , 8 ) ;
- Hide = TRUE;
- Text [ en-US ] = "Not using ODF 1.2 Extended may cause infomation to be lost.";
- Text [ x-comment ] = "EN-US, the term 'extended' must not be translated.";
- };
- Image IMG_ODF_WARNING
- {
- ImageBitmap = Bitmap
- {
- File = "odfwarning.png";
- };
- MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; };
- };
- Image IMG_ODF_WARNING_HC
- {
- ImageBitmap = Bitmap
- {
- File = "odfwarning_h.png";
- };
- MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; };
- };
-};
-
-ModalDialog RID_SVXDLG_FILTER_WARNING
-{
- HelpID = HID_SVXDLG_FILTER_WARNING;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Sizeable = FALSE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT( 175 + 39 + (3 * 6), (4 * 9)+ 12 + (3 * 12) + 6 - 21 );
- Text = "%PRODUCTNAME %PRODUCTVERSION" ;
- FixedImage IMG_WARNING
- {
- Pos = MAP_APPFONT( 6, 6 );
- Size = MAP_APPFONT( 30, 30 );
- };
- FixedText FT_FILTER_WARNING
- {
- Pos = MAP_APPFONT( 39, 6 );
- Size = MAP_APPFONT( 175, 4 * 9 );
- Wordbreak = TRUE;
- Text [ en-US ] = "Using \"%1\" as default file format may cause information loss.\n";
- };
- OKButton PB_OK
- {
- Pos = MAP_APPFONT( 60, (4 * 9)/*+ 12*/ + 13 );
- Size = MAP_APPFONT( 50, 14 );
- DefButton = TRUE;
- };
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT( 120, (4 * 9)/*+ 12*/ + 13 );
- Size = MAP_APPFONT( 50, 14 );
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/optspell.src b/svx/source/options/optspell.src
deleted file mode 100644
index 511e3befea..0000000000
--- a/svx/source/options/optspell.src
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: optspell.src,v $
- * $Revision: 1.34 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- // include ------------------------------------------------------------------
-#include <sfx2/sfx.hrc>
-#include "helpid.hrc"
-#include "optspell.hrc"
- // pragma -------------------------------------------------------------------
-
- // RID_SFXPAGE_SPELL --------------------------------------------------------
-TabPage RID_SFXPAGE_SPELL
-{
- HelpId = HID_OPTIONS_SPELL ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 221 , 185 ) ;
- Text [ en-US ] = "Spellcheck" ;
- PushButton BTN_BOOK
- {
- Pos = MAP_APPFONT ( 128 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
- TabStop = TRUE ;
- };
- MultiListBox LB_BOOK
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 103 , 47 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- };
- FixedLine GB_BOOK
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 115 , 66 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Wörterbücher : W÷rterb³cher */
- /* ### ACHTUNG: Neuer Text in Resource? Wörterbücher : W÷rterb³cher */
- Text [ en-US ] = "Dictionaries" ;
- };
- CheckBox BTN_CAPS
- {
- Pos = MAP_APPFONT ( 12 , 82 ) ;
- Size = MAP_APPFONT ( 103 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Großgeschriebene Wörter : ~Gro˜geschriebene W÷rter */
- /* ### ACHTUNG: Neuer Text in Resource? ~Großgeschriebene Wörter : ~Gro˜geschriebene W÷rter */
- Text [ en-US ] = "~Capital words" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_NUMS
- {
- Pos = MAP_APPFONT ( 12 , 95 ) ;
- Size = MAP_APPFONT ( 103 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? ~Wörter mit Ziffern : ~W÷rter mit Ziffern */
- /* ### ACHTUNG: Neuer Text in Resource? ~Wörter mit Ziffern : ~W÷rter mit Ziffern */
- Text [ en-US ] = "~Words with numbers " ;
- TabStop = TRUE ;
- };
- CheckBox BTN_UPLOW
- {
- Pos = MAP_APPFONT ( 12 , 108 ) ;
- Size = MAP_APPFONT ( 103 , 10 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Groß- u. ~Kleinschreibung : Gro˜- u. ~Kleinschreibung */
- /* ### ACHTUNG: Neuer Text in Resource? Groß- u. ~Kleinschreibung : Gro˜- u. ~Kleinschreibung */
- Text [ en-US ] = "~Case sensitive " ;
- TabStop = TRUE ;
- };
- FixedLine GB_AUDIT
- {
- Pos = MAP_APPFONT ( 6 , 71 ) ;
- Size = MAP_APPFONT ( 115 , 53 ) ;
- /* ### ACHTUNG: Neuer Text in Resource? Prüfen : Pr³fen */
- /* ### ACHTUNG: Neuer Text in Resource? Prüfen : Pr³fen */
- Text [ en-US ] = "Check" ;
- };
-};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/options/srchcfg.cxx b/svx/source/options/srchcfg.cxx
index 60ef1a1143..f6d3ebd769 100644
--- a/svx/source/options/srchcfg.cxx
+++ b/svx/source/options/srchcfg.cxx
@@ -34,7 +34,7 @@
#ifndef _SVX_SRCHNCFG_HXX
#include <srchcfg.hxx>
#endif
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
diff --git a/svx/source/outliner/outl_pch.hxx b/svx/source/outliner/outl_pch.hxx
index cf72c9cc5d..128abb3936 100644
--- a/svx/source/outliner/outl_pch.hxx
+++ b/svx/source/outliner/outl_pch.hxx
@@ -27,7 +27,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <svx/editeng.hxx>
#include <svx/editview.hxx>
diff --git a/svx/source/outliner/outleeng.cxx b/svx/source/outliner/outleeng.cxx
index 43fea6e316..7812afe440 100644
--- a/svx/source/outliner/outleeng.cxx
+++ b/svx/source/outliner/outleeng.cxx
@@ -37,7 +37,7 @@
#include <outleeng.hxx>
#include <paralist.hxx>
#include <outliner.hrc>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/eeitem.hxx>
#include "editstat.hxx"
#include "outlundo.hxx"
diff --git a/svx/source/outliner/outlin2.cxx b/svx/source/outliner/outlin2.cxx
index 9f41159053..c1ee8fe2a0 100644
--- a/svx/source/outliner/outlin2.cxx
+++ b/svx/source/outliner/outlin2.cxx
@@ -33,7 +33,7 @@
#include <outl_pch.hxx>
#include <tools/list.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <vcl/mapmod.hxx>
#include <forbiddencharacterstable.hxx>
diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx
index 193a5f26eb..3f469a47f4 100644
--- a/svx/source/outliner/outliner.cxx
+++ b/svx/source/outliner/outliner.cxx
@@ -34,7 +34,7 @@
#include <outl_pch.hxx>
#include <math.h>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <vcl/wrkwin.hxx>
#define _OUTLINER_CXX
#include <svx/outliner.hxx>
@@ -46,8 +46,8 @@
#include <editstat.hxx>
#include <svx/scripttypeitem.hxx>
#include <svx/editobj.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/itemset.hxx>
+#include <svl/whiter.hxx>
#include <vcl/metric.hxx>
#include <svx/numitem.hxx>
#include <svx/adjitem.hxx>
@@ -57,7 +57,7 @@
#include <goodies/grfmgr.hxx>
#include <svx/svxfont.hxx>
#include <svx/brshitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
// #101498# calculate if it's RTL or not
#include <unicode/ubidi.h>
diff --git a/svx/source/outliner/outliner.hrc b/svx/source/outliner/outliner.hrc
index 036a7d24e1..1b60bf32f5 100644
--- a/svx/source/outliner/outliner.hrc
+++ b/svx/source/outliner/outliner.hrc
@@ -31,7 +31,7 @@
#define _OUTLINER_HRC
#ifndef _SOLAR_HRC
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#endif
#ifndef RID_OUTL_START
diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx
index 2fdc0074c4..e15d7427c3 100644
--- a/svx/source/outliner/outlvw.cxx
+++ b/svx/source/outliner/outlvw.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <outl_pch.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#define _OUTLINER_CXX
#include <svx/outliner.hxx>
@@ -44,7 +44,7 @@
#include <svx/eeitem.hxx>
#include <svx/numitem.hxx>
#include <vcl/window.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <editstat.hxx>
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index 8bd8c3b6b6..619c08ade9 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/xftdiit.hxx>
#include <svx/xftstit.hxx>
@@ -52,7 +52,7 @@
#include <svx/sdshcitm.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnwtit.hxx>
-#include <xlinjoit.hxx>
+#include <svx/xlinjoit.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xdash.hxx>
#include <svx/xlndsit.hxx>
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 80e6129618..d7dee2ceda 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -35,7 +35,7 @@
#include <svx/svdograf.hxx>
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#ifndef ITEMID_GRF_CROP
#define ITEMID_GRF_CROP 0
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 115493a205..ce545b0315 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -41,7 +41,7 @@
//////////////////////////////////////////////////////////////////////////////
// includes for special text box shadow (SC)
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/xhatch.hxx>
#include <svx/xflhtit.hxx>
#include <svx/xflclit.hxx>
diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
index 789381c3a3..3e19d34a8a 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
@@ -37,7 +37,7 @@
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrellipseprimitive2d.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/sxciaitm.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index cf5dfd3d72..9012768fcb 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -36,7 +36,7 @@
#include <svx/svdomeas.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/attribute/sdrallattribute.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/sxmbritm.hxx>
#include <svx/sxmlhitm.hxx>
#include <svx/sxmtritm.hxx>
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index f9113d7b64..cf78de1646 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -37,7 +37,7 @@
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <svx/svdmodel.hxx>
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 417445b7d7..0e8d85f8ac 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -31,14 +31,14 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/xdef.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xlnwtit.hxx>
-#include <xlinjoit.hxx>
+#include <svx/xlinjoit.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnstwit.hxx>
#include <svx/xlnedwit.hxx>
@@ -67,7 +67,7 @@
#include <svx/sdr/attribute/sdrtextattribute.hxx>
#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/xbtmpit.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
#include <basegfx/range/b2drange.hxx>
#include <svx/svx3ditems.hxx>
diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
index 9538cba1b5..aaa885fb2a 100644
--- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
+++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
@@ -31,7 +31,7 @@
#include <svx/sdr/primitive3d/sdrattributecreator3d.hxx>
#include <svx/svx3ditems.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <com/sun/star/drawing/NormalsKind.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
#include <drawinglayer/attribute/sdrattribute3d.hxx>
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index c7b82b7c11..e3ce0ada1d 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -33,10 +33,10 @@
#include <svx/sdr/properties/attributeproperties.hxx>
#include <svx/sdr/properties/itemsettools.hxx>
#include <tools/debug.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
-#include <svtools/whiter.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
+#include <svl/whiter.hxx>
+#include <svl/poolitem.hxx>
#include <svx/svdobj.hxx>
#include <svx/svddef.hxx>
#include <svx/xit.hxx>
@@ -54,7 +54,7 @@
#include <svx/svdpage.hxx>
// #114265#
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/captionproperties.cxx b/svx/source/sdr/properties/captionproperties.cxx
index 535d48d283..2e7cf36079 100644
--- a/svx/source/sdr/properties/captionproperties.cxx
+++ b/svx/source/sdr/properties/captionproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/captionproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <svx/svddef.hxx>
#include <svx/eeitem.hxx>
#include <svx/svdocapt.hxx>
diff --git a/svx/source/sdr/properties/circleproperties.cxx b/svx/source/sdr/properties/circleproperties.cxx
index f47c2e9793..78f1a865ee 100644
--- a/svx/source/sdr/properties/circleproperties.cxx
+++ b/svx/source/sdr/properties/circleproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/circleproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <svx/svddef.hxx>
#include <svx/eeitem.hxx>
#include <svx/svdocirc.hxx>
diff --git a/svx/source/sdr/properties/connectorproperties.cxx b/svx/source/sdr/properties/connectorproperties.cxx
index 576d9ffed5..7ed8a62e33 100644
--- a/svx/source/sdr/properties/connectorproperties.cxx
+++ b/svx/source/sdr/properties/connectorproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/connectorproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <svx/svddef.hxx>
#include <svx/eeitem.hxx>
#include <svx/svdoedge.hxx>
diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx
index 53bef66057..5d55b764a8 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -31,14 +31,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/customshapeproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <svx/svdoashp.hxx>
#include <svx/eeitem.hxx>
#include <svx/sdtagitm.hxx>
-#include <svtools/whiter.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/whiter.hxx>
+#include <svl/itemset.hxx>
+#include <svl/smplhint.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index de3021062b..bd1f683c5e 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -32,8 +32,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/defaultproperties.hxx>
#include <svx/sdr/properties/itemsettools.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/itemset.hxx>
+#include <svl/whiter.hxx>
#include <vector>
#include <svx/svdobj.hxx>
diff --git a/svx/source/sdr/properties/e3dcompoundproperties.cxx b/svx/source/sdr/properties/e3dcompoundproperties.cxx
index 5726758b72..cf64c99da8 100644
--- a/svx/source/sdr/properties/e3dcompoundproperties.cxx
+++ b/svx/source/sdr/properties/e3dcompoundproperties.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/e3dcompoundproperties.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/obj3d.hxx>
#include <svx/scene3d.hxx>
diff --git a/svx/source/sdr/properties/e3dextrudeproperties.cxx b/svx/source/sdr/properties/e3dextrudeproperties.cxx
index 830a97c4e3..a6c9147c4f 100644
--- a/svx/source/sdr/properties/e3dextrudeproperties.cxx
+++ b/svx/source/sdr/properties/e3dextrudeproperties.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/e3dextrudeproperties.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/extrud3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/e3dlatheproperties.cxx b/svx/source/sdr/properties/e3dlatheproperties.cxx
index 4f3a8d7a5d..4fd21ddc24 100644
--- a/svx/source/sdr/properties/e3dlatheproperties.cxx
+++ b/svx/source/sdr/properties/e3dlatheproperties.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/e3dlatheproperties.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/lathe3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/e3dproperties.cxx b/svx/source/sdr/properties/e3dproperties.cxx
index e0590d5987..a31bfe8697 100644
--- a/svx/source/sdr/properties/e3dproperties.cxx
+++ b/svx/source/sdr/properties/e3dproperties.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/e3dproperties.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/svddef.hxx>
#include <svx/obj3d.hxx>
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx
index 28ebae1b9a..713e62811a 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/e3dsceneproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/itemset.hxx>
+#include <svl/whiter.hxx>
#include <svx/svddef.hxx>
#include <svx/scene3d.hxx>
#include <svditer.hxx>
diff --git a/svx/source/sdr/properties/e3dsphereproperties.cxx b/svx/source/sdr/properties/e3dsphereproperties.cxx
index c2c74b8d16..a706a24af9 100644
--- a/svx/source/sdr/properties/e3dsphereproperties.cxx
+++ b/svx/source/sdr/properties/e3dsphereproperties.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/e3dsphereproperties.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/sphere3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/emptyproperties.cxx b/svx/source/sdr/properties/emptyproperties.cxx
index f0d1af1590..5cd05f714e 100644
--- a/svx/source/sdr/properties/emptyproperties.cxx
+++ b/svx/source/sdr/properties/emptyproperties.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/emptyproperties.hxx>
#include <tools/debug.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/svddef.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdpool.hxx>
diff --git a/svx/source/sdr/properties/graphicproperties.cxx b/svx/source/sdr/properties/graphicproperties.cxx
index 69921e4227..2a180810e0 100644
--- a/svx/source/sdr/properties/graphicproperties.cxx
+++ b/svx/source/sdr/properties/graphicproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/graphicproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <svx/svddef.hxx>
#include <svx/eeitem.hxx>
#include <svx/svdograf.hxx>
diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx
index f04140dfac..e5d01d2c6c 100644
--- a/svx/source/sdr/properties/groupproperties.cxx
+++ b/svx/source/sdr/properties/groupproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/groupproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/itemset.hxx>
+#include <svl/whiter.hxx>
#include <svx/svddef.hxx>
#include <svx/eeitem.hxx>
#include <svx/svdogrp.hxx>
diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx
index 45df3911ed..a721e7fb65 100644
--- a/svx/source/sdr/properties/itemsettools.cxx
+++ b/svx/source/sdr/properties/itemsettools.cxx
@@ -32,8 +32,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/itemsettools.hxx>
#include <tools/debug.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/itemset.hxx>
+#include <svl/whiter.hxx>
#include <vector>
#include <svx/svdogrp.hxx>
diff --git a/svx/source/sdr/properties/measureproperties.cxx b/svx/source/sdr/properties/measureproperties.cxx
index 7bd657ddc5..681bfa8728 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/measureproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <svx/svddef.hxx>
#include <svx/eeitem.hxx>
#include <svx/svdomeas.hxx>
diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx
index baace122db..c60c2008d9 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/pageproperties.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdpool.hxx>
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index fe317a495a..b1e45843ed 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/properties.hxx>
#include <svx/sdr/properties/itemsettools.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/svdogrp.hxx>
#include <svditer.hxx>
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 229ba89db5..f545b24fc2 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -31,10 +31,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/properties/textproperties.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
-#include <svtools/itemiter.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
+#include <svl/itemiter.hxx>
+#include <svl/smplhint.hxx>
#include <svx/svddef.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdoutl.hxx>
diff --git a/svx/source/src/app.hrc b/svx/source/src/app.hrc
index de03c1459e..60b5197257 100644
--- a/svx/source/src/app.hrc
+++ b/svx/source/src/app.hrc
@@ -39,7 +39,7 @@
// include ---------------------------------------------------------------
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#include <sfx2/sfxsids.hrc>
// Ranges ----------------------------------------------------------------
@@ -345,7 +345,7 @@
#define RID_RES_SBACHAOS_ERR_CONTEXTS (OFA_RES_UNNAMED_START + 1)
// HelpIds ---------------------------------------------------------------
-
+/*
#define HID_AUTOCORR_DLG (HID_OFA_START + 0)
#define HID_OFAPAGE_AUTOCORR_OPTIONS (HID_OFA_START + 1)
#define HID_OFAPAGE_AUTOCORR_REPLACE (HID_OFA_START + 2)
@@ -435,7 +435,7 @@
#define UID_OFA_CONNPOOL_DRIVERLIST_BACK (HID_OFA_START + 122)
#define HID_OFA_TP_HELPERPROG (HID_OFA_START + 123)
#define HID_OFA_TP_MEMORY (HID_OFA_START + 124)
-
+*/
// "Uberlaufkontrolle der HID's
#define ACT_HID_END HID_OFA_TP_MEMORY
#if ACT_HID_END > HID_OFA_END
diff --git a/svx/source/src/app.src b/svx/source/src/app.src
index 7001281945..3c2574e095 100644
--- a/svx/source/src/app.src
+++ b/svx/source/src/app.src
@@ -28,16 +28,7 @@
*
************************************************************************/
-#ifndef _GLOBLMN_HRC
-#include "globlmn_tmpl.hrc"
-#endif
-#ifndef _GLOBALACC_SRC
-#include "globlac.hrc"
-#endif
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
-
#include "app.hrc"
//----------------------------------------------------------------------------
@@ -50,8 +41,6 @@ ErrorBox RID_ERRBOX_MODULENOTINSTALLED
Message [ en-US ] = "The action could not be executed. The %PRODUCTNAME program module needed for this action is currently not installed.";
};
- // Image-Listen ----------------------------------------------------------
-
#define IMAGE_ID_LIST\
IdList = {\
SID_HLINKBAR_LINK; \
@@ -110,29 +99,8 @@ ImageList RID_DEFAULTIMAGELIST_LCH
// Strings ---------------------------------------------------------------
-#define MN_EDIT 20
-#define MN_VIEW 21
-#define MN_EXTRA 22
-#define MN_WIN 30
-#define MN_HELP 31
-#define MN_TEMPLATES 11
-
-#define ACC Accelerator
-#define ACCK AcceleratorItem
-
- // die Acceleratoren
-
String RID_DESKTOP
{
Text = "%PRODUCTNAME" ;
};
-String STR_SD_STAROFFICE_XML_DRAW
-{
- Text [ en-US ] = "%PRODUCTNAME XML (Draw)";
-};
-
-String STR_SD_STAROFFICE_XML_IMPRESS
-{
- Text [ en-US ] = "%PRODUCTNAME XML (Impress)";
-};
diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx
index 545ce1d83c..9f4fe8b45f 100644
--- a/svx/source/stbctrls/insctrl.cxx
+++ b/svx/source/stbctrls/insctrl.cxx
@@ -36,7 +36,7 @@
#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
#endif
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 843c845426..92035ffcb7 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -36,7 +36,7 @@
#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
#endif
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/app.hxx>
#define _SVX_MODCTRL_CXX
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index a5376ab390..3292783154 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -42,9 +42,9 @@
#include <vcl/menu.hxx>
#endif
#include <vcl/image.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/ptitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/stritem.hxx>
+#include <svl/ptitem.hxx>
+#include <svl/itempool.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
#include <sfx2/dispatch.hxx>
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index c2f34c9c20..c25dfbf14f 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -36,7 +36,7 @@
#ifndef _STATUS_HXX //autogen
#include <vcl/status.hxx>
#endif
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <sfx2/dispatch.hxx>
#include <tools/urlobj.hxx>
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index 32c930f123..56de9a8e3a 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -41,7 +41,7 @@
#endif
#include <vcl/image.hxx>
//#ifndef _SFXITEMPOOL_HXX
-//#include <svtools/itempool.hxx>
+//#include <svl/itempool.hxx>
//#endif
#include <sfx2/signaturestate.hxx>
#include <sfx2/app.hxx>
@@ -50,9 +50,9 @@
#include <sfx2/objsh.hxx>
#include <sfx2/sfxsids.hrc>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk
index e777ad70d3..6e158341ae 100644
--- a/svx/source/svdraw/makefile.mk
+++ b/svx/source/svdraw/makefile.mk
@@ -122,11 +122,7 @@ LIB2OBJFILES= \
$(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/impgrfll.obj
-LIB3TARGET= $(SLB)$/$(TARGET)-msfilter.lib
-LIB3OBJFILES= \
- $(SLO)$/svdfppt.obj \
-
-SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES) $(LIB3OBJFILES)
+SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
SRS1NAME=svdstr
SRC1FILES= svdstr.src
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 867c0956ca..37366c4f36 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -52,7 +52,7 @@
#include <svx/svdattrx.hxx>
#include <svx/svdpool.hxx>
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#include "xmlcnitm.hxx"
#include <svx/svxids.hrc>
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 76c3c3f3ab..cd35046601 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -38,7 +38,7 @@
#define _MATH_H
#endif
#include <tools/bigint.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/itemiter.hxx>
#include <vcl/msgbox.hxx>
#include <svx/rectenum.hxx>
#include <svx/svxids.hrc> // fuer SID_ATTR_TRANSFORM_...
@@ -56,8 +56,8 @@
#include "svdstr.hrc" // Namen aus der Resource
#include "svdglob.hxx" // StringCache
#include <svx/eeitem.hxx>
-#include <svtools/aeitem.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/aeitem.hxx>
+#include <svl/whiter.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/e3dsceneupdater.hxx>
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 89122decf4..1ddf95ee01 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -816,7 +816,7 @@ void SdrEditView::DistributeMarkedObjects()
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractSvxDistributeDialog *pDlg = pFact->CreateSvxDistributeDialog(NULL, aNewAttr, RID_SVXPAGE_DISTRIBUTE);
+ AbstractSvxDistributeDialog *pDlg = pFact->CreateSvxDistributeDialog(NULL, aNewAttr);
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
UINT16 nResult = pDlg->Execute();
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 2336af2f5f..162d3522e6 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -36,14 +36,14 @@
#include <svtools/accessibilityoptions.hxx>
#include <svx/svdedxv.hxx>
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
//#include <tools/string.h>
-#include <svtools/itemiter.hxx>
+#include <svl/itemiter.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/hatch.hxx>
-#include <svtools/whiter.hxx>
-#include <svtools/style.hxx>
+#include <svl/whiter.hxx>
+#include <svl/style.hxx>
#include <editstat.hxx>
#include <tools/config.hxx>
#include <vcl/cursor.hxx>
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index b01caa73f8..60a96b1722 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -44,10 +44,10 @@
#include <svx/svdoutl.hxx>
#include <vcl/bmpacc.hxx>
#include <svx/eeitem.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <tools/config.hxx>
-#include <svtools/cacheoptions.hxx>
-#include <svtools/whiter.hxx>
+#include <unotools/cacheoptions.hxx>
+#include <svl/whiter.hxx>
#include <tools/bigint.hxx>
#include "fontitem.hxx"
#include <svx/colritem.hxx>
@@ -59,17 +59,17 @@
#include <svx/xbtmpit.hxx>
#include <svx/xflgrit.hxx>
#include <svx/svdoole2.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <unotools/localedatawrapper.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <comphelper/processfactory.hxx>
#include <i18npool/lang.h>
#include <unotools/charclass.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <svx/xflbckit.hxx>
#include <svx/extrusionbar.hxx>
#include <svx/fontworkbar.hxx>
-#include <vcl/svapp.hxx> //add CHINA001
+#include <vcl/svapp.hxx> //add CHINA001
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdotable.hxx>
@@ -238,7 +238,7 @@ BOOL OLEObjCache::UnloadObj(SdrOle2Obj* pObj)
if (pObj)
{
//#i80528# The old mechanism is completely useless, only taking into account if
- // in all views the GrafDraft feature is used. This will nearly never have been the
+ // in all views the GrafDraft feature is used. This will nearly never have been the
// case since no one ever used this option.
//
// A much better (and working) criteria would be the VOC contact count.
@@ -870,41 +870,41 @@ void SvdProgressInfo::ReportError()
namespace
{
bool impGetSdrObjListFillColor(
- const SdrObjList& rList,
- const Point& rPnt,
- const SdrPageView& rTextEditPV,
- const SetOfByte& rVisLayers,
+ const SdrObjList& rList,
+ const Point& rPnt,
+ const SdrPageView& rTextEditPV,
+ const SetOfByte& rVisLayers,
Color& rCol)
{
- if(!rList.GetModel())
+ if(!rList.GetModel())
return false;
bool bRet(false);
bool bMaster(rList.GetPage() ? rList.GetPage()->IsMasterPage() : false);
- for(ULONG no(rList.GetObjCount()); !bRet && no > 0; )
+ for(ULONG no(rList.GetObjCount()); !bRet && no > 0; )
{
no--;
SdrObject* pObj = rList.GetObj(no);
SdrObjList* pOL = pObj->GetSubList();
- if(pOL)
- {
+ if(pOL)
+ {
// group object
bRet = impGetSdrObjListFillColor(*pOL, rPnt, rTextEditPV, rVisLayers, rCol);
- }
- else
+ }
+ else
{
SdrTextObj* pText = dynamic_cast< SdrTextObj * >(pObj);
// #108867# Exclude zero master page object (i.e. background shape) from color query
if(pText
- && pObj->IsClosedObj()
+ && pObj->IsClosedObj()
&& (!bMaster || (!pObj->IsNotVisibleAsMaster() && 0 != no))
- && pObj->GetCurrentBoundRect().IsInside(rPnt)
- && !pText->IsHideContour()
+ && pObj->GetCurrentBoundRect().IsInside(rPnt)
+ && !pText->IsHideContour()
&& SdrObjectPrimitiveHit(*pObj, rPnt, 0, rTextEditPV, &rVisLayers, false))
- {
+ {
bRet = GetDraftFillColor(pObj->GetMergedItemSet(), rCol);
}
}
@@ -914,14 +914,14 @@ namespace
}
bool impGetSdrPageFillColor(
- const SdrPage& rPage,
- const Point& rPnt,
- const SdrPageView& rTextEditPV,
- const SetOfByte& rVisLayers,
- Color& rCol,
+ const SdrPage& rPage,
+ const Point& rPnt,
+ const SdrPageView& rTextEditPV,
+ const SetOfByte& rVisLayers,
+ Color& rCol,
bool bSkipBackgroundShape)
{
- if(!rPage.GetModel())
+ if(!rPage.GetModel())
return false;
bool bRet(impGetSdrObjListFillColor(rPage, rPnt, rTextEditPV, rVisLayers, rCol));
@@ -933,7 +933,7 @@ namespace
SetOfByte aSet(rVisLayers);
aSet &= rPage.TRG_GetMasterPageVisibleLayers();
SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
-
+
// #108867# Don't fall back to background shape on
// master pages. This is later handled by
// GetBackgroundColor, and is necessary to cater for
@@ -955,8 +955,8 @@ namespace
}
Color impCalcBackgroundColor(
- const Rectangle& rArea,
- const SdrPageView& rTextEditPV,
+ const Rectangle& rArea,
+ const SdrPageView& rTextEditPV,
const SdrPage& rPage)
{
svtools::ColorConfig aColorConfig;
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 52bfccdc0c..f9f4ad2070 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -70,7 +70,7 @@
#include <svx/svdograf.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdetc.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <vcl/salbtype.hxx> // FRound
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
deleted file mode 100644
index 0ecf714548..0000000000
--- a/svx/source/svdraw/svdfppt.cxx
+++ /dev/null
@@ -1,7813 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: svdfppt.cxx,v $
- * $Revision: 1.163.6.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <osl/endian.h>
-#include <vcl/svapp.hxx>
-#include <unotools/tempfile.hxx>
-#include <math.h>
-#include <svx/eeitem.hxx>
-#include <sot/storage.hxx>
-#include <sot/storinfo.hxx>
-#include <sot/stg.hxx>
-#include <com/sun/star/embed/Aspects.hpp>
-#include <com/sun/star/office/XAnnotation.hpp>
-#include <com/sun/star/office/XAnnotationAccess.hpp>
-#include <com/sun/star/text/XText.hpp>
-#include <com/sun/star/geometry/RealPoint2D.hpp>
-#include <com/sun/star/util/DateTime.hpp>
-
-#include <unotools/streamwrap.hxx>
-
-#include <svx/svdfppt.hxx>
-#include <svx/xpoly.hxx>
-#include <svx/svdtrans.hxx>
-#include <svx/svdmodel.hxx>
-#include <svx/svdpage.hxx>
-#include <svx/svdobj.hxx>
-#include <svx/svdogrp.hxx>
-#include <svx/svdorect.hxx>
-#include <svx/svdopage.hxx>
-#include <svx/svdograf.hxx>
-#include <svx/svdopath.hxx>
-#include <svx/svdocirc.hxx>
-#include <svx/svdocapt.hxx>
-#include <svx/svdotable.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/svdattr.hxx>
-#include "xattr.hxx"
-#include "svditext.hxx"
-#include <svx/svdetc.hxx>
-#include <bulitem.hxx>
-#include <svx/polysc3d.hxx>
-#include <svx/extrud3d.hxx>
-#include <svx/svdoashp.hxx>
-#include <svx/tstpitem.hxx>
-#include <svx/unoprnms.hxx>
-
-#if defined(JOEENV) && defined(JOEDEBUG)
-#include "impinccv.h" // etwas Testkram
-#endif
-
-#if defined(DBG_EXTRACTOLEOBJECTS) || defined(DBG_EXTRACTFONTMETRICS)
-#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
-#endif
-
-#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
-#include <svx/adjitem.hxx>
-#include <svx/escpitem.hxx>
-#include <svx/colritem.hxx>
-#include <svx/fhgtitem.hxx>
-#include <svx/wghtitem.hxx>
-#include <svx/postitem.hxx>
-#include <svx/udlnitem.hxx>
-#include <svx/crsditem.hxx>
-#include <svx/shdditem.hxx>
-#include <svx/charreliefitem.hxx>
-#include <fontitem.hxx>
-#include <svx/svdoutl.hxx>
-#include <svx/editeng.hxx>
-#include <svx/lspcitem.hxx>
-#include <svx/ulspitem.hxx>
-#include <svx/lrspitem.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/bmpacc.hxx>
-#include <svditer.hxx>
-#include <svx/svdoedge.hxx>
-#include <svx/sxekitm.hxx>
-#include <svx/flditem.hxx>
-#include <svtools/sychconv.hxx>
-#include <tools/zcodec.hxx>
-#include <svxmsbas.hxx>
-#include <sfx2/objsh.hxx>
-#include <svx/brshitem.hxx>
-#include <svx/langitem.hxx>
-#include <svx/svdoole2.hxx>
-#include <unoapi.hxx>
-#include <toolkit/unohlp.hxx>
-#include <com/sun/star/container/XIndexContainer.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
-#include <com/sun/star/form/XFormComponent.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/awt/Point.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
-#include <svx/writingmodeitem.hxx>
-#include <vcl/print.hxx>
-#include <svx/svxfont.hxx>
-#include <svx/frmdiritem.hxx>
-#include <svx/sdtfchim.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include <svx/scripttypeitem.hxx>
-#include "com/sun/star/awt/Gradient.hpp"
-#include <com/sun/star/table/XMergeableCellRange.hpp>
-#include <com/sun/star/table/BorderLine.hpp>
-#include <vcl/virdev.hxx>
-#include <algorithm>
-#include <set>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-// PPT ColorScheme Slots
-#define PPT_COLSCHEME (0x08000000)
-#define PPT_COLSCHEME_HINTERGRUND (0x08000000)
-#define PPT_COLSCHEME_TEXT_UND_ZEILEN (0x08000001)
-#define PPT_COLSCHEME_SCHATTEN (0x08000002)
-#define PPT_COLSCHEME_TITELTEXT (0x08000003)
-#define PPT_COLSCHEME_FUELLBEREICHE (0x08000004)
-#define PPT_COLSCHEME_AKZENT (0x08000005)
-#define PPT_COLSCHEME_A_UND_HYPERLINK (0x08000006)
-#define PPT_COLSCHEME_A_H_GESICHERT (0x08000007)
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-#define ANSI_CHARSET 0
-#define DEFAULT_CHARSET 1
-#define SYMBOL_CHARSET 2
-#define SHIFTJIS_CHARSET 128
-#define HANGEUL_CHARSET 129
-#define CHINESEBIG5_CHARSET 136
-#define OEM_CHARSET 255
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-/* Font Families */
-#define FF_DONTCARE 0x00
-#define FF_ROMAN 0x10
-#define FF_SWISS 0x20
-#define FF_MODERN 0x30
-#define FF_SCRIPT 0x40
-#define FF_DECORATIVE 0x50
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-#define DEFAULT_PITCH 0x00
-#define FIXED_PITCH 0x01
-#define VARIABLE_PITCH 0x02
-
-using namespace ::com::sun::star ;
-using namespace uno ;
-using namespace beans ;
-using namespace drawing ;
-using namespace container ;
-using namespace table ;
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PowerPointImportParam::PowerPointImportParam( SvStream& rDocStrm, sal_uInt32 nFlags, MSFilterTracer* pT ) :
- rDocStream ( rDocStrm ),
- nImportFlags ( nFlags ),
- pTracer ( pT )
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, PptCurrentUserAtom& rAtom )
-{
- DffRecordHeader aHd;
- rIn >> aHd;
- if ( aHd.nRecType == PPT_PST_CurrentUserAtom )
- {
- sal_uInt32 nLen;
- sal_uInt16 nUserNameLen, nPad;
- rIn >> nLen
- >> rAtom.nMagic
- >> rAtom.nCurrentUserEdit
- >> nUserNameLen
- >> rAtom.nDocFileVersion
- >> rAtom.nMajorVersion
- >> rAtom.nMinorVersion
- >> nPad;
- SvxMSDffManager::MSDFFReadZString( rIn, rAtom.aCurrentUser, nUserNameLen, sal_True );
- }
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-void PptSlidePersistAtom::Clear()
-{
- nReserved = nPsrReference = nFlags = nNumberTexts = nSlideId = 0;
-}
-
-SvStream& operator>>( SvStream& rIn, PptSlidePersistAtom& rAtom )
-{
- DffRecordHeader aHd;
- rIn >> aHd
- >> rAtom.nPsrReference
- >> rAtom.nFlags
- >> rAtom.nNumberTexts
- >> rAtom.nSlideId;
-// >> rAtom.nReserved;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-SV_IMPL_PTRARR(_PptSlidePersistList,PptSlidePersistEntry*);
-
-USHORT PptSlidePersistList::FindPage(UINT32 nId) const
-{
- for ( USHORT i=0; i < Count(); i++ )
- {
- if (operator[](i)->GetSlideId()==nId) return i;
- }
- return PPTSLIDEPERSIST_ENTRY_NOTFOUND;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, PptInteractiveInfoAtom& rAtom )
-{
- rIn >> rAtom.nSoundRef
- >> rAtom.nExHyperlinkId
- >> rAtom.nAction
- >> rAtom.nOleVerb
- >> rAtom.nJump
- >> rAtom.nFlags
- >> rAtom.nHyperlinkType
- >> rAtom.nUnknown1
- >> rAtom.nUnknown2
- >> rAtom.nUnknown3;
- return rIn;
-}
-
-SvStream& operator>>( SvStream& rIn, PptExOleObjAtom& rAtom )
-{
- rIn >> rAtom.nAspect
- >> rAtom.nDummy1
- >> rAtom.nId
- >> rAtom.nDummy2
- >> rAtom.nPersistPtr
- >> rAtom.nDummy4;
- return rIn;
-}
-
-Size PptDocumentAtom::GetPageSize(const Size& rSiz) const
-{
- return rSiz;
-/*
- Size aRet;
- switch ( eSlidesPageFormat )
- {
- // Wenn man in Powerpoint als Seitenformat "Bildschirmgroesse"
- // einstellt, dann zeigt dieser Dialog zwar 24x18cm an, die
- // angezeigte Seite ist aber anders. Das sieht man, wenn man
- // ein Rechteck seitenfuellend aufzieht und sich dessen Groesse
- // ansieht. Die importierten Abmessungen sind auf jeden Fall
- // die, die auch im Ppt-File stehen. Ich denke, das es sich
- // hier eher um ein Bug in PowerPoint handelt, das im
- // Seitenformat-Dialog bei "Bildschirmgroesse" falsche Masse
- // angezeigt werden (vielleicht ja auch bildschirmabhaengig?).
-// case PPTPF_SCREEN : aRet.Width()=4082; aRet.Height()=5443; break;
- case PPTPF_USLETTER: aRet.Width()=4896; aRet.Height()=6336; break;
- case PPTPF_A4 : aRet.Width()=4762; aRet.Height()=6735; break;
-// case PPTPF_35MMDIA : aRet.Width()=4082; aRet.Height()=6123; break;
-// case PPTPF_OVERHEAD: aRet.Width()=4082; aRet.Height()=5443; break;
- }
- if ( aRet.Width() )
- {
- if ( rSiz.Width() > rSiz.Height() )
- { // Querformat
- long nMerk = aRet.Width();
- aRet.Width() = aRet.Height();
- aRet.Height() = nMerk;
- }
- }
- else // CustomFormat oder Unbekannt oder Screen,Dia,Overhead
- aRet = rSiz;
- return aRet;
-*/
-}
-
-SvStream& operator>>(SvStream& rIn, PptDocumentAtom& rAtom)
-{
-// Tatsaechliches Format:
-// 00 aSlidePageSizeXY 8
-// 08 aNotesPageSizeXY 8
-// 16 aZoomRatio (OLE) 8
-// 24 nNotesMasterPersist 4
-// 28 nHandoutMasterPersist 4
-// 32 n1stPageNumber 2
-// 34 ePageFormat 2
-// 36 bEmbeddedTrueType 1
-// 37 bOmitTitlePlace 1
-// 38 bRightToLeft 1
-// 39 bShowComments 1
-
- DffRecordHeader aHd;
- INT32 nSlideX,nSlideY, nNoticeX, nNoticeY, nDummy;
- UINT16 nSlidePageFormat;
- INT8 nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments;
-
- rIn >> aHd
- >> nSlideX >> nSlideY
- >> nNoticeX >> nNoticeY
- >> nDummy >> nDummy // ZoomRation ueberspringen
- >> rAtom.nNotesMasterPersist
- >> rAtom.nHandoutMasterPersist
- >> rAtom.n1stPageNumber
- >> nSlidePageFormat
- >> nEmbeddedTrueType
- >> nTitlePlaceHoldersOmitted
- >> nRightToLeft
- >> nShowComments;
- rAtom.aSlidesPageSize.Width() = nSlideX;
- rAtom.aSlidesPageSize.Height() = nSlideY;
- rAtom.aNotesPageSize.Width() = nNoticeX;
- rAtom.aNotesPageSize.Height() = nNoticeY;
- rAtom.eSlidesPageFormat = (PptPageFormat)nSlidePageFormat;
- rAtom.bEmbeddedTrueType = nEmbeddedTrueType;
- rAtom.bTitlePlaceholdersOmitted = nTitlePlaceHoldersOmitted;
- rAtom.bRightToLeft = nRightToLeft;
- rAtom.bShowComments = nShowComments;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void PptSlideLayoutAtom::Clear()
-{
- eLayout = 0;
- for ( USHORT i = 0; i < 8; i++ )
- {
- aPlaceholderId[ i ] = 0;
- aPlacementId[ i ] = 0;
- }
-}
-
-SvStream& operator>>( SvStream& rIn, PptSlideLayoutAtom& rAtom )
-{
- rIn >> rAtom.eLayout;
- rIn.Read( rAtom.aPlaceholderId, 8 );
- return rIn;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, PptSlideAtom& rAtom )
-{
- DffRecordHeader aHd;
- rIn >> aHd
- >> rAtom.aLayout
- >> rAtom.nMasterId
- >> rAtom.nNotesId
- >> rAtom.nFlags;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-void PptSlideAtom::Clear()
-{
- nMasterId = nNotesId = 0;
- nFlags = 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, PptNotesAtom& rAtom )
-{
- DffRecordHeader aHd;
- rIn >> aHd
- >> rAtom.nSlideId
- >> rAtom.nFlags;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-void PptNotesAtom::Clear()
-{
- nSlideId = 0;
- nFlags = 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void PptColorSchemeAtom::Clear()
-{
- memset(&aData[0], 0, 32);
-}
-
-Color PptColorSchemeAtom::GetColor( USHORT nNum ) const
-{
- Color aRetval;
- if ( nNum < 8 )
- {
- nNum <<= 2;
- aRetval.SetRed( aData[ nNum++ ] );
- aRetval.SetGreen( aData[ nNum++ ] );
- aRetval.SetBlue( aData[ nNum++ ] );
- }
- return aRetval;
-}
-
-SvStream& operator>>( SvStream& rIn, PptColorSchemeAtom& rAtom )
-{
- DffRecordHeader aHd;
- rIn >> aHd;
- rIn.Read( rAtom.aData, 32 );
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, PptFontEntityAtom& rAtom )
-{
- DffRecordHeader aHd;
- rIn >> aHd;
- sal_Unicode nTemp, cData[ 32 ];
- rIn.Read( cData, 64 );
-
- sal_uInt8 lfCharset, lfPitchAndFamily;
-
- rIn >> lfCharset
- >> rAtom.lfClipPrecision
- >> rAtom.lfQuality
- >> lfPitchAndFamily;
-
- switch( lfCharset )
- {
- case SYMBOL_CHARSET :
- rAtom.eCharSet = RTL_TEXTENCODING_SYMBOL;
- break;
- case ANSI_CHARSET :
- rAtom.eCharSet = RTL_TEXTENCODING_MS_1252;
- break;
-
-// case DEFAULT_CHARSET :
-// case SHIFTJIS_CHARSET :
-// case HANGEUL_CHARSET :
-// case CHINESEBIG5_CHARSET :
-// case OEM_CHARSET :
- default :
- rAtom.eCharSet = gsl_getSystemTextEncoding();
- }
- switch ( lfPitchAndFamily & 0xf0 )
- {
- case FF_ROMAN:
- rAtom.eFamily = FAMILY_ROMAN;
- break;
-
- case FF_SWISS:
- rAtom.eFamily = FAMILY_SWISS;
- break;
-
- case FF_MODERN:
- rAtom.eFamily = FAMILY_MODERN;
- break;
-
- case FF_SCRIPT:
- rAtom.eFamily = FAMILY_SCRIPT;
- break;
-
- case FF_DECORATIVE:
- rAtom.eFamily = FAMILY_DECORATIVE;
- break;
-
- default:
- rAtom.eFamily = FAMILY_DONTKNOW;
- break;
- }
-
- switch ( lfPitchAndFamily & 0x0f )
- {
- case FIXED_PITCH:
- rAtom.ePitch = PITCH_FIXED;
- break;
-
- case DEFAULT_PITCH:
- case VARIABLE_PITCH:
- default:
- rAtom.ePitch = PITCH_VARIABLE;
- break;
- }
- sal_uInt16 i;
- for ( i = 0; i < 32; i++ )
- {
- nTemp = cData[ i ];
- if ( !nTemp )
- break;
-#ifdef OSL_BIGENDIAN
- cData[ i ] = ( nTemp >> 8 ) | ( nTemp << 8 );
-#endif
- }
- rAtom.aName = String( cData, i );
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- rAtom.bAvailable = pDev->IsFontAvailable( rAtom.aName );
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
-}
-
-SV_DECL_PTRARR_DEL( PptFontEntityAtomList, PptFontEntityAtom*, 16, 16 )
-SV_IMPL_PTRARR( PptFontEntityAtomList, PptFontEntityAtom* );
-
-class PptFontCollection: public PptFontEntityAtomList {
-};
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SvStream& operator>>( SvStream& rIn, PptUserEditAtom& rAtom )
-{
- rIn >> rAtom.aHd
- >> rAtom.nLastSlideID
- >> rAtom.nVersion
- >> rAtom.nOffsetLastEdit
- >> rAtom.nOffsetPersistDirectory
- >> rAtom.nDocumentRef
- >> rAtom.nMaxPersistWritten
- >> rAtom.eLastViewType;
- rAtom.aHd.SeekToEndOfRecord(rIn);
- return rIn;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void PptOEPlaceholderAtom::Clear()
-{
- nPlacementId = 0;
- nPlaceholderSize = nPlaceholderId = 0;
-}
-
-SvStream& operator>>( SvStream& rIn, PptOEPlaceholderAtom& rAtom )
-{
- rIn >> rAtom.nPlacementId
- >> rAtom.nPlaceholderId
- >> rAtom.nPlaceholderSize;
- return rIn;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PptSlidePersistEntry::PptSlidePersistEntry() :
- pStyleSheet ( NULL ),
- pHeaderFooterEntry ( NULL ),
- pSolverContainer ( NULL ),
- nSlidePersistStartOffset( 0 ),
- nSlidePersistEndOffset ( 0 ),
- nBackgroundOffset ( 0 ),
- nDrawingDgId ( 0xffffffff ),
- pPresentationObjects ( NULL ),
- pBObj ( NULL ),
- bBObjIsTemporary ( sal_True ),
- ePageKind ( PPT_MASTERPAGE ),
- bNotesMaster ( FALSE ),
- bHandoutMaster ( FALSE ),
- bStarDrawFiller ( FALSE )
-{
- HeaderFooterOfs[ 0 ] = HeaderFooterOfs[ 1 ] = HeaderFooterOfs[ 2 ] = HeaderFooterOfs[ 3 ] = 0;
-}
-
-
-PptSlidePersistEntry::~PptSlidePersistEntry()
-{
- delete pStyleSheet;
- delete pSolverContainer;
- delete[] pPresentationObjects;
-};
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
- SvxMSDffManager ( rParam.rDocStream, rBaseURL, rParam.pTracer ),
- pFonts ( NULL ),
- nStreamLen ( 0 ),
- nTextStylesIndex ( 0xffff ),
- eCharSetSystem ( gsl_getSystemTextEncoding() ),
- bWingdingsChecked ( FALSE ),
- bWingdingsAvailable ( FALSE ),
- bMonotypeSortsChecked ( FALSE ),
- bMonotypeSortsAvailable ( FALSE ),
- bTimesNewRomanChecked ( FALSE ),
- bTimesNewRomanAvailable ( FALSE ),
- rImportParam ( rParam )
-{
-}
-
-SdrEscherImport::~SdrEscherImport()
-{
- void* pPtr;
- for ( pPtr = aOleObjectList.First(); pPtr; pPtr = aOleObjectList.Next() )
- delete (PPTOleEntry*)pPtr;
- delete pFonts;
-}
-
-const PptSlideLayoutAtom* SdrEscherImport::GetSlideLayoutAtom() const
-{
- return NULL;
-}
-
-sal_Bool SdrEscherImport::ReadString( String& rStr ) const
-{
- sal_Bool bRet = FALSE;
- DffRecordHeader aStrHd;
- rStCtrl >> aStrHd;
- if (aStrHd.nRecType == PPT_PST_TextBytesAtom
- || aStrHd.nRecType == PPT_PST_TextCharsAtom
- || aStrHd.nRecType == PPT_PST_CString)
- {
- sal_Bool bUniCode =
- (aStrHd.nRecType == PPT_PST_TextCharsAtom
- || aStrHd.nRecType == PPT_PST_CString);
- bRet=TRUE;
- ULONG nBytes = aStrHd.nRecLen;
- MSDFFReadZString( rStCtrl, rStr, nBytes, bUniCode );
- aStrHd.SeekToEndOfRecord( rStCtrl );
- }
- else
- aStrHd.SeekToBegOfRecord( rStCtrl );
- return bRet;
-}
-
-FASTBOOL SdrEscherImport::GetColorFromPalette(USHORT /*nNum*/, Color& /*rColor*/) const
-{
- return FALSE;
-}
-
-BOOL SdrEscherImport::SeekToShape( SvStream& /*rSt*/, void* /*pClientData*/, UINT32 /*nId*/) const
-{
- return FALSE;
-}
-
-PptFontEntityAtom* SdrEscherImport::GetFontEnityAtom( UINT32 nNum ) const
-{
- PptFontEntityAtom* pRetValue = NULL;
- if ( pFonts && ( nNum < pFonts->Count() ) )
- pRetValue = (*pFonts)[ (USHORT)nNum ];
- return pRetValue;
-}
-
-CharSet SdrEscherImport::GetCharSet( UINT32 nNum ) const
-{
- CharSet eRetValue( eCharSetSystem );
- if ( pFonts && ( nNum < pFonts->Count() ) )
- eRetValue = (*pFonts)[ (USHORT)nNum ]->eCharSet;
- return eRetValue;
-}
-
-BOOL SdrEscherImport::IsFontAvailable( UINT32 nNum ) const
-{
- BOOL bRetValue = FALSE;
- if ( pFonts && ( nNum < pFonts->Count() ) )
- bRetValue = (*pFonts)[ (USHORT)nNum ]->bAvailable;
- return bRetValue;
-}
-
-SdrObject* SdrEscherImport::ReadObjText( PPTTextObj* /*pTextObj*/, SdrObject* pObj, SdPage* /*pPage*/) const
-{
- return pObj;
-}
-
-void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* /*pData*/, DffObjData& rObj )
-{
- sal_Int32 l, t, r, b;
- if ( rHd.nRecLen == 16 )
- {
- rSt >> l >> t >> r >> b;
- }
- else
- {
- INT16 ls, ts, rs, bs;
- rSt >> ts >> ls >> rs >> bs; // etwas seltsame Koordinatenreihenfolge ...
- l = ls, t = ts, r = rs, b = bs;
- }
- Scale( l );
- Scale( t );
- Scale( r );
- Scale( b );
- rObj.aChildAnchor = Rectangle( l, t, r, b );
- rObj.bChildAnchor = TRUE;
- return;
-};
-
-void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraphic )
-{
- if ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE )
- {
- sal_uInt16 nX, nGlobalColorsCount, nFillColorsCount;
-
- rSt >> nX
- >> nGlobalColorsCount
- >> nFillColorsCount
- >> nX
- >> nX
- >> nX;
-
- if ( ( nGlobalColorsCount <= 64 ) && ( nFillColorsCount <= 64 ) )
- {
- if ( (sal_uInt32)( ( nGlobalColorsCount + nFillColorsCount ) * 44 + 12 ) == nRecLen )
- {
- sal_uInt32 OriginalGlobalColors[ 64 ];
- sal_uInt32 NewGlobalColors[ 64 ];
- sal_uInt32 OriginalFillColors[ 64 ];
- sal_uInt32 NewFillColors[ 64 ];
-
- sal_uInt32 i, j, nGlobalColorsChanged, nFillColorsChanged;
- nGlobalColorsChanged = nFillColorsChanged = 0;
-
- sal_uInt32* pCurrentOriginal = OriginalGlobalColors;
- sal_uInt32* pCurrentNew = NewGlobalColors;
- sal_uInt32* pCount = &nGlobalColorsChanged;
- i = nGlobalColorsCount;
-
- for ( j = 0; j < 2; j++ )
- {
- for ( ; i > 0; i-- )
- {
- sal_uInt32 nIndex, nPos = rSt.Tell();
- sal_uInt8 nDummy, nRed, nGreen, nBlue;
- sal_uInt16 nChanged;
- rSt >> nChanged;
- if ( nChanged & 1 )
- {
- sal_uInt32 nColor = 0;
- rSt >> nDummy
- >> nRed
- >> nDummy
- >> nGreen
- >> nDummy
- >> nBlue
- >> nIndex;
-
- if ( nIndex < 8 )
- {
- Color aColor = MSO_CLR_ToColor( nIndex << 24 );
- nRed = aColor.GetRed();
- nGreen = aColor.GetGreen();
- nBlue = aColor.GetBlue();
- }
- nColor = nRed | ( nGreen << 8 ) | ( nBlue << 16 );
- *pCurrentNew++ = nColor;
- rSt >> nDummy
- >> nRed
- >> nDummy
- >> nGreen
- >> nDummy
- >> nBlue;
- nColor = nRed | ( nGreen << 8 ) | ( nBlue << 16 );
- *pCurrentOriginal++ = nColor;
- (*pCount)++;
- }
- rSt.Seek( nPos + 44 );
- }
- pCurrentOriginal = OriginalFillColors;
- pCurrentNew = NewFillColors;
- pCount = &nFillColorsChanged;
- i = nFillColorsCount;
- }
- if ( nGlobalColorsChanged || nFillColorsChanged )
- {
- Color* pSearchColors = new Color[ nGlobalColorsChanged ];
- Color* pReplaceColors = new Color[ nGlobalColorsChanged ];
-
- for ( j = 0; j < nGlobalColorsChanged; j++ )
- {
- sal_uInt32 nSearch = OriginalGlobalColors[ j ];
- sal_uInt32 nReplace = NewGlobalColors[ j ];
-
- pSearchColors[ j ].SetRed( (BYTE)nSearch );
- pSearchColors[ j ].SetGreen( (BYTE)( nSearch >> 8 ) );
- pSearchColors[ j ].SetBlue( (BYTE)( nSearch >> 16 ) );
-
- pReplaceColors[ j ].SetRed( (BYTE)nReplace );
- pReplaceColors[ j ].SetGreen( (BYTE)( nReplace >> 8 ) );
- pReplaceColors[ j ].SetBlue( (BYTE)( nReplace >> 16 ) );
- }
- GDIMetaFile aGdiMetaFile( rGraphic.GetGDIMetaFile() );
- aGdiMetaFile.ReplaceColors( pSearchColors, pReplaceColors,
- nGlobalColorsChanged, NULL );
- rGraphic = aGdiMetaFile;
-
- delete[] pSearchColors;
- delete[] pReplaceColors;
- }
- }
- }
- }
-}
-
-/* ProcessObject is called from ImplSdPPTImport::ProcessObj to hanlde all application specific things,
- such as the import of text, animation effects, header footer and placeholder.
-
- The parameter pOriginalObj is the object as it was imported by our general escher import, it must either
- be deleted or it can be returned to be inserted into the sdr page.
-*/
-SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pOriginalObj )
-{
- if ( pOriginalObj && pOriginalObj->ISA( SdrObjCustomShape ) )
- pOriginalObj->SetMergedItem( SdrTextFixedCellHeightItem( TRUE ) );
-
- // we are initializing our return value with the object that was imported by our escher import
- SdrObject* pRet = pOriginalObj;
-
- ProcessData& rData = *((ProcessData*)pData);
- PptSlidePersistEntry& rPersistEntry = rData.rPersistEntry;
-
- if ( ! ( rObjData.nSpFlags & SP_FGROUP ) ) // sj: #114758# ...
- {
- PptOEPlaceholderAtom aPlaceholderAtom;
- INT16 nHeaderFooterInstance = -1;
-
- if ( maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- DffRecordHeader aClientDataHd;
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < maShapeRecords.Current()->GetRecEndFilePos() ) )
- {
- rSt >> aClientDataHd;
- switch ( aClientDataHd.nRecType )
- {
- // importing header/footer object from master page
- case PPT_PST_OEPlaceholderAtom :
- {
- rSt >> aPlaceholderAtom;
- if ( nHeaderFooterInstance == -1 )
- {
- switch ( aPlaceholderAtom.nPlaceholderId )
- {
- case PPT_PLACEHOLDER_MASTERSLIDENUMBER : nHeaderFooterInstance++;
- case PPT_PLACEHOLDER_MASTERFOOTER : nHeaderFooterInstance++;
- case PPT_PLACEHOLDER_MASTERHEADER : nHeaderFooterInstance++;
- case PPT_PLACEHOLDER_MASTERDATE : nHeaderFooterInstance++; break;
- }
- if ( ! ( nHeaderFooterInstance & 0xfffc ) ) // is this a valid instance ( 0->3 )
- rPersistEntry.HeaderFooterOfs[ nHeaderFooterInstance ] = rObjData.rSpHd.GetRecBegFilePos();
- }
- }
- break;
-
- case PPT_PST_RecolorInfoAtom :
- {
- if ( pRet && ( pRet->ISA( SdrGrafObj ) && ((SdrGrafObj*)pRet)->HasGDIMetaFile() ) )
- {
- Graphic aGraphic( ((SdrGrafObj*)pRet)->GetGraphic() );
- RecolorGraphic( rSt, aClientDataHd.nRecLen, aGraphic );
- ((SdrGrafObj*)pRet)->SetGraphic( aGraphic );
- }
- }
- break;
- }
- aClientDataHd.SeekToEndOfRecord( rSt );
- }
- }
- if ( ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_NOTESSLIDEIMAGE ) && ( rPersistEntry.bNotesMaster == FALSE ) )
- {
- USHORT nPageNum = pSdrModel->GetPageCount();
- if ( nPageNum > 0 )
- nPageNum--;
-
- // replacing the object which we will return with a SdrPageObj
- SdrObject::Free( pRet );
- pRet = new SdrPageObj( rObjData.aBoundRect, pSdrModel->GetPage( nPageNum - 1 ) );
- }
- else
- {
- // try to load some ppt text
- PPTTextObj aTextObj( rSt, (SdrPowerPointImport&)*this, rPersistEntry, &rObjData );
- if ( ( aTextObj.Count() || aTextObj.GetOEPlaceHolderAtom() ) )
- {
- sal_Bool bVerticalText = sal_False;
- // and if the text object is not empty, it must be applied to pRet, the object we
- // initially got from our escher import
- INT32 nTextRotationAngle = 0;
- if ( IsProperty( DFF_Prop_txflTextFlow ) )
- {
- MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
- switch( eTextFlow )
- {
- case mso_txflBtoT : // Bottom to Top non-@, unten -> oben
- nTextRotationAngle += 9000;
- break;
- case mso_txflTtoBA : /* #68110# */ // Top to Bottom @-font, oben -> unten
- case mso_txflTtoBN : // Top to Bottom non-@, oben -> unten
- case mso_txflVertN : // Vertical, non-@, oben -> unten
- bVerticalText = !bVerticalText; // nTextRotationAngle += 27000;
- break;
- // case mso_txflHorzN : // Horizontal non-@, normal
- // case mso_txflHorzA : // Horizontal @-font, normal
- default: break;
- }
- }
- sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 );
- nTextRotationAngle -= nFontDirection * 9000;
- if ( ( nFontDirection == 1 ) || ( nFontDirection == 3 ) ) // #104546#
- {
- bVerticalText = !bVerticalText;
-/*
- sal_Int32 nHalfWidth = ( rTextRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( rTextRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( rTextRect.Left() + nHalfWidth - nHalfHeight,
- rTextRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( rTextRect.GetHeight(), rTextRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- rTextRect = aNewRect;
-*/
- }
- aTextObj.SetVertical( bVerticalText );
- if ( pRet )
- {
- BOOL bDeleteSource = aTextObj.GetOEPlaceHolderAtom() != 0;
- if ( bDeleteSource && ( pRet->ISA( SdrGrafObj ) == FALSE ) // we are not allowed to get
- && ( pRet->ISA( SdrObjGroup ) == FALSE ) // grouped placeholder objects
- && ( pRet->ISA( SdrOle2Obj ) == FALSE ) )
- SdrObject::Free( pRet );
- }
- sal_uInt32 nTextFlags = aTextObj.GetTextFlags();
- sal_Int32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 25 * 3600 ); // 0.25 cm (emu)
- sal_Int32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 25 * 3600 ); // 0.25 cm (emu)
- sal_Int32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 13 * 3600 ); // 0.13 cm (emu)
- sal_Int32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 13 * 3600 );
- ScaleEmu( nTextLeft );
- ScaleEmu( nTextRight );
- ScaleEmu( nTextTop );
- ScaleEmu( nTextBottom );
-
- sal_Int32 nMinFrameWidth = 0;
- sal_Int32 nMinFrameHeight = 0;
- sal_Bool bAutoGrowWidth, bAutoGrowHeight;
-
- SdrTextVertAdjust eTVA;
- SdrTextHorzAdjust eTHA;
-
- nTextFlags &= PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT
- | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK;
-
- if ( bVerticalText )
- {
- eTVA = SDRTEXTVERTADJUST_BLOCK;
- eTHA = SDRTEXTHORZADJUST_CENTER;
-
- // Textverankerung lesen
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- case mso_anchorTopCentered:
- case mso_anchorTopBaseline:
- case mso_anchorTopCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_RIGHT;
- break;
-
- case mso_anchorMiddle :
- case mso_anchorMiddleCentered:
- eTHA = SDRTEXTHORZADJUST_CENTER;
- break;
-
- case mso_anchorBottom:
- case mso_anchorBottomCentered:
- case mso_anchorBottomBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTHA = SDRTEXTHORZADJUST_LEFT;
- break;
- }
- // if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
- switch ( eTextAnchor )
- {
- case mso_anchorTopCentered :
- case mso_anchorMiddleCentered :
- case mso_anchorBottomCentered :
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- {
- // check if it is sensible to use the centered alignment
- sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned pararagraphs
- eTVA = SDRTEXTVERTADJUST_CENTER; // the text has to be displayed using the full width;
- }
- break;
-
- default :
- {
- if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT )
- eTVA = SDRTEXTVERTADJUST_TOP;
- else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT )
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- }
- break;
- }
- nMinFrameWidth = rTextRect.GetWidth() - ( nTextLeft + nTextRight );
- }
- else
- {
- eTVA = SDRTEXTVERTADJUST_CENTER;
- eTHA = SDRTEXTHORZADJUST_BLOCK;
-
- // Textverankerung lesen
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
-
- switch( eTextAnchor )
- {
- case mso_anchorTop:
- case mso_anchorTopCentered:
- case mso_anchorTopBaseline:
- case mso_anchorTopCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_TOP;
- break;
-
- case mso_anchorMiddle :
- case mso_anchorMiddleCentered:
- eTVA = SDRTEXTVERTADJUST_CENTER;
- break;
-
- case mso_anchorBottom:
- case mso_anchorBottomCentered:
- case mso_anchorBottomBaseline:
- case mso_anchorBottomCenteredBaseline:
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
- break;
- }
- // if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
- switch ( eTextAnchor )
- {
- case mso_anchorTopCentered :
- case mso_anchorMiddleCentered :
- case mso_anchorBottomCentered :
- case mso_anchorTopCenteredBaseline:
- case mso_anchorBottomCenteredBaseline:
- {
- // check if it is sensible to use the centered alignment
- sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned pararagraphs
- eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
- }
- break;
-
- default :
- break;
- }
- nMinFrameHeight = rTextRect.GetHeight() - ( nTextTop + nTextBottom );
- }
-
- SdrObjKind eTextKind = OBJ_RECT;
- if ( ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_NOTESSLIDEIMAGE )
- || ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_MASTERNOTESSLIDEIMAGE ) )
- {
- aTextObj.SetInstance( 2 );
- eTextKind = OBJ_TITLETEXT;
- }
- else if ( ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_MASTERNOTESBODYIMAGE )
- || ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_NOTESBODY ) )
- {
- aTextObj.SetInstance( 2 );
- eTextKind = OBJ_TEXT;
- }
-
- sal_uInt32 nDestinationInstance = aTextObj.GetInstance();
- if ( ( rPersistEntry.ePageKind == PPT_MASTERPAGE ) )
- {
- if ( !rPersistEntry.pPresentationObjects )
- {
- rPersistEntry.pPresentationObjects = new UINT32[ PPT_STYLESHEETENTRYS ];
- memset( rPersistEntry.pPresentationObjects, 0, PPT_STYLESHEETENTRYS * 4 );
- }
- if ( !rPersistEntry.pPresentationObjects[ nDestinationInstance ] )
- rPersistEntry.pPresentationObjects[ nDestinationInstance ] = rObjData.rSpHd.GetRecBegFilePos();
- }
- switch ( nDestinationInstance )
- {
- case TSS_TYPE_PAGETITLE :
- case TSS_TYPE_TITLE :
- {
- if ( GetSlideLayoutAtom()->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE )
- nDestinationInstance = TSS_TYPE_TITLE;
- else
- nDestinationInstance = TSS_TYPE_PAGETITLE;
- }
- break;
- case TSS_TYPE_BODY :
- // case TSS_TYPE_SUBTITLE :
- case TSS_TYPE_HALFBODY :
- case TSS_TYPE_QUARTERBODY :
- nDestinationInstance = TSS_TYPE_BODY;
- break;
- }
- aTextObj.SetDestinationInstance( (sal_uInt16)nDestinationInstance );
-
- switch ( aTextObj.GetInstance() )
- {
- case TSS_TYPE_PAGETITLE :
- case TSS_TYPE_TITLE : eTextKind = OBJ_TITLETEXT; break;
- case TSS_TYPE_SUBTITLE : eTextKind = OBJ_TEXT; break;
- case TSS_TYPE_BODY :
- case TSS_TYPE_HALFBODY :
- case TSS_TYPE_QUARTERBODY : eTextKind = OBJ_OUTLINETEXT; break;
- }
- if ( aTextObj.GetDestinationInstance() != TSS_TYPE_TEXT_IN_SHAPE )
- {
- if ( !aTextObj.GetOEPlaceHolderAtom() || !aTextObj.GetOEPlaceHolderAtom()->nPlaceholderId )
- {
- aTextObj.SetDestinationInstance( TSS_TYPE_TEXT_IN_SHAPE );
- eTextKind = OBJ_RECT;
- }
- }
- SdrObject* pTObj = NULL;
- sal_Bool bWordWrap = (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone;
- sal_Bool bFitShapeToText = ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0;
-
- if ( pRet && pRet->ISA( SdrObjCustomShape ) && ( eTextKind == OBJ_RECT ) )
- {
- bAutoGrowHeight = bFitShapeToText;
- if ( bWordWrap )
- bAutoGrowWidth = sal_False;
- else
- bAutoGrowWidth = sal_True;
- pTObj = pRet;
- pRet = NULL;
- }
- else
- {
- if ( pRet && pRet->ISA( SdrObjCustomShape ) )
- {
- SdrObject::Free( pRet );
- pRet = NULL;
- }
- pTObj = new SdrRectObj( eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT );
- pTObj->SetModel( pSdrModel );
- SfxItemSet aSet( pSdrModel->GetItemPool() );
- if ( !pRet )
- ((SdrEscherImport*)this)->ApplyAttributes( rSt, aSet, rObjData );
- pTObj->SetMergedItemSet( aSet );
- if ( pRet )
- {
- pTObj->SetMergedItem( XLineStyleItem( XLINE_NONE ) );
- pTObj->SetMergedItem( XFillStyleItem( XFILL_NONE ) );
- }
- if ( bVerticalText )
- {
- bAutoGrowWidth = bFitShapeToText; // bFitShapeToText; can't be used, because we cut the text if it is too height,
- bAutoGrowHeight = sal_False;
- }
- else
- {
- bAutoGrowWidth = sal_False;
- bAutoGrowHeight = sal_True; // bFitShapeToText; can't be used, because we cut the text if it is too height,
- }
- }
- pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
-
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- {
- pTObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoGrowWidth ) );
- pTObj->SetMergedItem( SdrTextAutoGrowHeightItem( bAutoGrowHeight ) );
- }
- else
- {
- pTObj->SetMergedItem( SdrTextWordWrapItem( bWordWrap ) );
- pTObj->SetMergedItem( SdrTextAutoGrowHeightItem( bFitShapeToText ) );
- }
-
- pTObj->SetMergedItem( SdrTextVertAdjustItem( eTVA ) );
- pTObj->SetMergedItem( SdrTextHorzAdjustItem( eTHA ) );
-
- if ( nMinFrameHeight < 0 )
- nMinFrameHeight = 0;
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- pTObj->SetMergedItem( SdrTextMinFrameHeightItem( nMinFrameHeight ) );
-
- if ( nMinFrameWidth < 0 )
- nMinFrameWidth = 0;
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- pTObj->SetMergedItem( SdrTextMinFrameWidthItem( nMinFrameWidth ) );
-
- // Abstaende an den Raendern der Textbox setzen
- pTObj->SetMergedItem( SdrTextLeftDistItem( nTextLeft ) );
- pTObj->SetMergedItem( SdrTextRightDistItem( nTextRight ) );
- pTObj->SetMergedItem( SdrTextUpperDistItem( nTextTop ) );
- pTObj->SetMergedItem( SdrTextLowerDistItem( nTextBottom ) );
- pTObj->SetMergedItem( SdrTextFixedCellHeightItem( TRUE ) );
-
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- pTObj->SetSnapRect( rTextRect );
- pTObj = ReadObjText( &aTextObj, pTObj, rData.pPage );
- if ( pTObj )
- {
- /* check if our new snaprect makes trouble,
- because we do not display the ADJUST_BLOCK
- properly if the textsize is bigger than the
- snaprect of the object. Then we will use
- ADJUST_CENTER instead of ADJUST_BLOCK.
- */
- if ( !pTObj->ISA( SdrObjCustomShape ) && !bFitShapeToText && !bWordWrap )
- {
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pTObj );
- if ( pText )
- {
- if ( bVerticalText )
- {
- if ( eTVA == SDRTEXTVERTADJUST_BLOCK )
- {
- Size aTextSize( pText->GetTextSize() );
- aTextSize.Width() += nTextLeft + nTextRight;
- aTextSize.Height() += nTextTop + nTextBottom;
- if ( rTextRect.GetHeight() < aTextSize.Height() )
- pTObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
- }
- }
- else
- {
- if ( eTHA == SDRTEXTHORZADJUST_BLOCK )
- {
- Size aTextSize( pText->GetTextSize() );
- aTextSize.Width() += nTextLeft + nTextRight;
- aTextSize.Height() += nTextTop + nTextBottom;
- if ( rTextRect.GetWidth() < aTextSize.Width() )
- pTObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
- }
- }
- }
- }
- // rotate text with shape ?
- sal_Int32 nAngle = ( rObjData.nSpFlags & SP_FFLIPV ) ? -mnFix16Angle : mnFix16Angle; // #72116# vertical flip -> rotate by using the other way
- nAngle += nTextRotationAngle;
-
- if ( pTObj->ISA( SdrObjCustomShape ) )
- {
-/*
- if ( nTextRotationAngle )
- {
- double fTextRotateAngle = (double)nTextRotationAngle / 100.0;
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)((SdrObjCustomShape*)pTObj)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
- PropertyValue aPropValue;
- aPropValue.Name = sTextRotateAngle;
- aPropValue.Value <<= fTextRotateAngle;
- aGeometryItem.SetPropertyValue( aPropValue );
- ((SdrObjCustomShape*)pTObj)->SetMergedItem( aGeometryItem );
- }
-*/
- }
- else
- {
- if ( rObjData.nSpFlags & SP_FFLIPV )
- {
- double a = 18000 * nPi180;
- pTObj->Rotate( rTextRect.Center(), 18000, sin( a ), cos( a ) );
- }
- if ( rObjData.nSpFlags & SP_FFLIPH )
- nAngle = 36000 - nAngle;
- if ( nAngle )
- {
- double a = nAngle * nPi180;
- pTObj->NbcRotate( rObjData.aBoundRect.Center(), nAngle, sin( a ), cos( a ) );
- }
- }
- if ( pRet )
- {
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->GetSubList()->NbcInsertObject( pRet );
- pGroup->GetSubList()->NbcInsertObject( pTObj );
- pRet = pGroup;
- }
- else
- pRet = pTObj;
- }
- }
- }
- }
- else
- {
- if ( maShapeRecords.SeekToContent( rSt, DFF_msofbtUDefProp, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- maShapeRecords.Current()->SeekToBegOfRecord( rSt );
- DffPropertyReader aSecPropSet( *this );
- aSecPropSet.ReadPropSet( rSt, (ProcessData*)pData );
- sal_Int32 nTableProperties = aSecPropSet.GetPropertyValue( DFF_Prop_tableProperties, 0 );
- if ( nTableProperties & 3 )
- {
- if ( aSecPropSet.SeekToContent( DFF_Prop_tableRowProperties, rSt ) )
- {
- sal_Int16 i, nRowCount = 0;
- rSt >> nRowCount >> i >> i;
- if ( nRowCount )
- {
- sal_uInt32* pTableArry = new sal_uInt32[ nRowCount + 2 ];
- pTableArry[ 0 ] = nTableProperties;
- pTableArry[ 1 ] = nRowCount;
- for ( i = 0; i < nRowCount; i++ )
- rSt >> pTableArry[ i + 2 ];
- rData.pTableRowProperties = pTableArry;
- }
- }
- }
- }
- }
- if ( pRet ) // sj: #i38501#, and and taking care of connections to group objects
- {
- if ( rObjData.nSpFlags & SP_FBACKGROUND )
- {
- pRet->NbcSetSnapRect( Rectangle( Point(), ((SdrPage*)rData.pPage)->GetSize() ) ); // Groesse setzen
- }
- if ( rPersistEntry.pSolverContainer )
- {
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rPersistEntry.pSolverContainer->aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)rPersistEntry.pSolverContainer->aCList.Next() )
- {
- if ( rObjData.nShapeId == pPtr->nShapeC )
- pPtr->pCObj = pRet;
- else
- {
- SdrObject* pConnectObj = pRet;
- if ( pOriginalObj && pRet->ISA( SdrObjGroup ) )
- { /* check if the original object from the escherimport is part of the group object,
- if this is the case, we will use the original object to connect to */
- SdrObjListIter aIter( *pRet, IM_DEEPWITHGROUPS );
- while( aIter.IsMore() )
- {
- SdrObject* pPartObj = aIter.Next();
- if ( pPartObj == pOriginalObj )
- {
- pConnectObj = pPartObj;
- break;
- }
- }
- }
- if ( rObjData.nShapeId == pPtr->nShapeA )
- {
- pPtr->pAObj = pConnectObj;
- pPtr->nSpFlagsA = rObjData.nSpFlags;
- }
- if ( rObjData.nShapeId == pPtr->nShapeB )
- {
- pPtr->pBObj = pConnectObj;
- pPtr->nSpFlagsB = rObjData.nSpFlags;
- }
- }
- }
- }
- if ( rPersistEntry.ePageKind == PPT_MASTERPAGE )
- { // maybe the escher clusterlist is not correct, but we have to got the right page by using the
- // spMaster property, so we are patching the table
- if ( rPersistEntry.nDrawingDgId != 0xffffffff )
- {
- UINT32 nSec = ( rObjData.nShapeId >> 10 ) - 1;
- if ( mpFidcls && ( nSec < mnIdClusters ) )
- mpFidcls[ nSec ].dgid = rPersistEntry.nDrawingDgId; // insert the correct drawing id;
- }
- }
- if ( GetPropertyValue( DFF_Prop_fNoFillHitTest ) & 0x10 )
- {
- if ( (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ) == mso_fillBackground )
- {
- if ( !rData.pBackgroundColoredObjects )
- rData.pBackgroundColoredObjects = new List;
- rData.pBackgroundColoredObjects->Insert( pRet, LIST_APPEND );
- }
- }
- }
- return pRet;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrEscherImport::CheckWingdings() const
-{
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- ((SdrEscherImport*)this)->bWingdingsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "WINGDINGS" ) ) );
- ((SdrEscherImport*)this)->bWingdingsChecked = TRUE;
-}
-
-void SdrEscherImport::CheckMonotypeSorts() const
-{
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- ((SdrEscherImport*)this)->bMonotypeSortsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "MONOTYPE SORTS" ) ) );
- ((SdrEscherImport*)this)->bMonotypeSortsChecked = TRUE;
-}
-
-void SdrEscherImport::CheckTimesNewRoman() const
-{
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- ((SdrEscherImport*)this)->bTimesNewRomanAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "TIMES NEW ROMAN" ) ) );
- ((SdrEscherImport*)this)->bTimesNewRomanChecked = TRUE;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
- SdrEscherImport ( rParam, rBaseURL ),
- bOk ( rStCtrl.GetErrorCode() == SVSTREAM_OK ),
- pPersistPtr ( NULL ),
- nPersistPtrAnz ( 0 ),
- pDefaultSheet ( NULL ),
- pMasterPages ( NULL ),
- pSlidePages ( NULL ),
- pNotePages ( NULL ),
- nAktPageNum ( 0 ),
- nDocStreamPos ( 0 ),
- nPageColorsNum ( 0xFFFF ),
- ePageColorsKind ( PPT_MASTERPAGE ),
- eAktPageKind ( PPT_MASTERPAGE )
-{
- DffRecordHeader* pHd;
- if ( bOk )
- {
- rStCtrl.Seek( STREAM_SEEK_TO_END );
- nStreamLen = rStCtrl.Tell();
-
- // try to allocate the UserEditAtom via CurrentUserAtom
- sal_uInt32 nCurrentUserEdit = rParam.aCurrentUserAtom.nCurrentUserEdit;
- if ( nCurrentUserEdit )
- {
- rStCtrl.Seek( nCurrentUserEdit );
- rStCtrl >> aUserEditAtom;
- }
- if ( !aUserEditAtom.nOffsetPersistDirectory )
- { // if there is no UserEditAtom try to search the last one
-
- rStCtrl.Seek( 0 );
- DffRecordManager aPptRecManager; // contains all first level container and atoms
- aPptRecManager.Consume( rStCtrl, FALSE, nStreamLen );
- for ( pHd = aPptRecManager.Last(); pHd; pHd = aPptRecManager.Prev() )
- {
- if ( pHd->nRecType == PPT_PST_UserEditAtom )
- {
- pHd->SeekToBegOfRecord( rStCtrl );
- rStCtrl >> aUserEditAtom;
- break;
- }
- }
- if ( !pHd )
- bOk = FALSE;
- }
- }
- if ( rStCtrl.GetError() != 0 )
- bOk = FALSE;
-
- if ( bOk )
- {
- // PersistPtrs lesen (alle)
- nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1; // 1 mehr, damit ich immer direkt indizieren kann
- pPersistPtr = new UINT32[ nPersistPtrAnz ]; // (die fangen naemlich eigentlich bei 1 an)
- if ( !pPersistPtr )
- bOk = FALSE;
- else
- {
- memset( pPersistPtr, 0x00, nPersistPtrAnz * 4 );
-
- // SJ: new search mechanism from bottom to top (Issue 21122)
- PptUserEditAtom aCurrentEditAtom( aUserEditAtom );
- sal_uInt32 nCurrentEditAtomStrmPos = aCurrentEditAtom.aHd.GetRecEndFilePos();
- while( nCurrentEditAtomStrmPos )
- {
- sal_uInt32 nPersistIncPos = aCurrentEditAtom.nOffsetPersistDirectory;
- if ( nPersistIncPos )
- {
- rStCtrl.Seek( nPersistIncPos );
- DffRecordHeader aPersistHd;
- rStCtrl >> aPersistHd;
- if ( aPersistHd.nRecType == PPT_PST_PersistPtrIncrementalBlock )
- {
- ULONG nPibLen = aPersistHd.GetRecEndFilePos();
- while ( bOk && ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nPibLen ) )
- {
- sal_uInt32 nOfs, nAnz;
- rStCtrl >> nOfs;
- nAnz = nOfs;
- nOfs &= 0x000FFFFF;
- nAnz >>= 20;
- while ( bOk && ( rStCtrl.GetError() == 0 ) && ( nAnz > 0 ) && ( nOfs <= nPersistPtrAnz ) )
- {
- sal_uInt32 nPt;
- rStCtrl >> nPt;
- if ( !pPersistPtr[ nOfs ] )
- {
- pPersistPtr[ nOfs ] = nPt;
- if ( pPersistPtr[ nOfs ] > nStreamLen )
- {
- bOk = FALSE;
- DBG_ERROR("SdrPowerPointImport::Ctor(): Ungueltiger Eintrag im Persist-Directory!");
- }
- }
- nAnz--;
- nOfs++;
- }
- if ( bOk && nAnz > 0 )
- {
- DBG_ERROR("SdrPowerPointImport::Ctor(): Nicht alle Persist-Directory Entraege gelesen!");
- bOk = FALSE;
- }
- }
- }
- }
- nCurrentEditAtomStrmPos = aCurrentEditAtom.nOffsetLastEdit < nCurrentEditAtomStrmPos ? aCurrentEditAtom.nOffsetLastEdit : 0;
- if ( nCurrentEditAtomStrmPos )
- {
- rStCtrl.Seek( nCurrentEditAtomStrmPos );
- rStCtrl >> aCurrentEditAtom;
- }
- }
- }
- }
- if ( rStCtrl.GetError() != 0 )
- bOk = FALSE;
- if ( bOk )
- { // Document PersistEntry checken
- nDocStreamPos = aUserEditAtom.nDocumentRef;
- if ( nDocStreamPos > nPersistPtrAnz )
- {
- DBG_ERROR("SdrPowerPointImport::Ctor(): aUserEditAtom.nDocumentRef ungueltig!");
- bOk = FALSE;
- }
- }
- if ( bOk )
- { // Document FilePos checken
- nDocStreamPos = pPersistPtr[ nDocStreamPos ];
- if ( nDocStreamPos >= nStreamLen )
- {
- DBG_ERROR("SdrPowerPointImport::Ctor(): nDocStreamPos >= nStreamLen!");
- bOk = FALSE;
- }
- }
- if ( bOk )
- {
- rStCtrl.Seek( nDocStreamPos );
- aDocRecManager.Consume( rStCtrl );
-
- DffRecordHeader aDocHd;
- rStCtrl >> aDocHd;
- // DocumentAtom lesen
- DffRecordHeader aDocAtomHd;
- rStCtrl >> aDocAtomHd;
- if ( aDocHd.nRecType == PPT_PST_Document && aDocAtomHd.nRecType == PPT_PST_DocumentAtom )
- {
- aDocAtomHd.SeekToBegOfRecord( rStCtrl );
- rStCtrl >> aDocAtom;
- }
- else
- bOk = FALSE;
-
- if ( bOk )
- {
- if ( !pFonts )
- ReadFontCollection();
-
- // reading TxPF, TxSI
- PPTTextCharacterStyleAtomInterpreter aTxCFStyle; // SJ: ToDo, this atom needs to be interpreted, it contains character default styles for standard objects (instance4)
- PPTTextParagraphStyleAtomInterpreter aTxPFStyle;
- PPTTextSpecInfoAtomInterpreter aTxSIStyle; // styles (default language setting ... )
-
- DffRecordHeader* pEnvHd = aDocRecManager.GetRecordHeader( PPT_PST_Environment );
- if ( pEnvHd )
- {
- pEnvHd->SeekToContent( rStCtrl );
- DffRecordHeader aTxPFStyleRecHd;
- if ( SeekToRec( rStCtrl, PPT_PST_TxPFStyleAtom, pEnvHd->GetRecEndFilePos(), &aTxPFStyleRecHd ) )
- aTxPFStyle.Read( rStCtrl, aTxPFStyleRecHd );
-
- pEnvHd->SeekToContent( rStCtrl );
- DffRecordHeader aTxSIStyleRecHd;
- if ( SeekToRec( rStCtrl, PPT_PST_TxSIStyleAtom, pEnvHd->GetRecEndFilePos(), &aTxSIStyleRecHd ) )
- {
- aTxSIStyle.Read( rStCtrl, aTxSIStyleRecHd, PPT_PST_TxSIStyleAtom );
-#ifdef DBG_UTIL
- if ( !aTxSIStyle.bValid )
- {
- if (!(rImportParam.nImportFlags & PPT_IMPORTFLAGS_NO_TEXT_ASSERT ))
- {
- DBG_ERROR( "SdrTextSpecInfoAtomInterpreter::Ctor(): parsing error, this document needs to be analysed (SJ)" );
- }
- }
-#endif
- }
- }
-
- // todo:: PPT_PST_TxPFStyleAtom
-
- // SlidePersists Lesen
- pMasterPages=new PptSlidePersistList;
- pSlidePages =new PptSlidePersistList;
- pNotePages =new PptSlidePersistList;
-
- // now always creating the handout page, it will be the first in our masterpage list
- PptSlidePersistEntry* pE = new PptSlidePersistEntry;
- pE->aPersistAtom.nPsrReference = aDocAtom.nHandoutMasterPersist;
- pE->bHandoutMaster = sal_True;
- if ( !aDocAtom.nHandoutMasterPersist )
- pE->bStarDrawFiller = sal_True; // this is a dummy master page
- pMasterPages->C40_INSERT( PptSlidePersistEntry, pE, 0 );
-
- USHORT nPageListNum = 0;
- DffRecordHeader* pSlideListWithTextHd = aDocRecManager.GetRecordHeader( PPT_PST_SlideListWithText );
- PptSlidePersistEntry* pPreviousPersist = NULL;
- while ( pSlideListWithTextHd && ( nPageListNum < 3 ) )
- {
- pSlideListWithTextHd->SeekToContent( rStCtrl );
- PptSlidePersistList* pPageList = GetPageList( PptPageKind( nPageListNum ) );
- sal_uInt32 nSlideListWithTextHdEndOffset = pSlideListWithTextHd->GetRecEndFilePos();
- while ( SeekToRec( rStCtrl, PPT_PST_SlidePersistAtom, nSlideListWithTextHdEndOffset ) )
- {
- if ( pPreviousPersist )
- pPreviousPersist->nSlidePersistEndOffset = rStCtrl.Tell();
- PptSlidePersistEntry* pE2 = new PptSlidePersistEntry;
- rStCtrl >> pE2->aPersistAtom;
- pE2->nSlidePersistStartOffset = rStCtrl.Tell();
- pE2->ePageKind = PptPageKind( nPageListNum );
- pPageList->C40_INSERT( PptSlidePersistEntry, pE2, pPageList->Count() );
- pPreviousPersist = pE2;
- }
- if ( pPreviousPersist )
- pPreviousPersist->nSlidePersistEndOffset = nSlideListWithTextHdEndOffset;
- pSlideListWithTextHd = aDocRecManager.GetRecordHeader( PPT_PST_SlideListWithText, SEEK_FROM_CURRENT );
- nPageListNum++;
- }
-
- // we will ensure that there is at least one master page
- if ( pMasterPages->Count() == 1 ) // -> there is only a handout page available
- {
- PptSlidePersistEntry* pE2 = new PptSlidePersistEntry;
- pE2->bStarDrawFiller = sal_True; // this is a dummy master page
- pMasterPages->C40_INSERT( PptSlidePersistEntry, pE2, 1 );
- }
-
- // now we will insert at least one notes master for each master page
- sal_uInt16 nMasterPage;
- sal_uInt16 nMasterPages = pMasterPages->Count() - 1;
- for ( nMasterPage = 0; nMasterPage < nMasterPages; nMasterPage++ )
- {
- PptSlidePersistEntry* pE2 = new PptSlidePersistEntry;
- pE2->bNotesMaster = sal_True;
- pE2->bStarDrawFiller = sal_True; // this is a dummy master page
- if ( !nMasterPage && aDocAtom.nNotesMasterPersist )
- { // special treatment for the first notes master
- pE2->aPersistAtom.nPsrReference = aDocAtom.nNotesMasterPersist;
- pE2->bStarDrawFiller = sal_False; // this is a dummy master page
- }
- pMasterPages->C40_INSERT( PptSlidePersistEntry, pE2, ( nMasterPage + 1 ) << 1 );
- }
-
- // Zu jeder Page noch das SlideAtom bzw. NotesAtom lesen, soweit vorhanden
- nPageListNum = 0;
- for ( nPageListNum = 0; nPageListNum < 3; nPageListNum++ )
- {
- PptSlidePersistList* pPageList = GetPageList( PptPageKind( nPageListNum ) );
- for ( USHORT nPageNum = 0; nPageNum < pPageList->Count(); nPageNum++ )
- {
- PptSlidePersistEntry* pE2 = (*pPageList)[ nPageNum ];
- ULONG nPersist = pE2->aPersistAtom.nPsrReference;
- if ( ( nPersist > 0 ) && ( nPersist < nPersistPtrAnz ) )
- {
- ULONG nFPos = pPersistPtr[ nPersist ];
- if ( nFPos < nStreamLen )
- {
- rStCtrl.Seek( nFPos );
- DffRecordHeader aSlideHd;
- rStCtrl >> aSlideHd;
- if ( SeekToRec( rStCtrl, PPT_PST_SlideAtom, aSlideHd.GetRecEndFilePos() ) )
- rStCtrl >> pE2->aSlideAtom;
- else if ( SeekToRec( rStCtrl, PPT_PST_NotesAtom, aSlideHd.GetRecEndFilePos() ) )
- rStCtrl >> pE2->aNotesAtom;
- aSlideHd.SeekToContent( rStCtrl );
-
- DffRecordHeader aPPTDrawingHd;
- if ( SeekToRec( rStCtrl, PPT_PST_PPDrawing, aSlideHd.GetRecEndFilePos(), &aPPTDrawingHd ) )
- {
- DffRecordHeader aPPTDgContainer;
- if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, aPPTDrawingHd.GetRecEndFilePos(), &aPPTDgContainer ) )
- {
- if ( SeekToRec( rStCtrl, DFF_msofbtDg, aPPTDrawingHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aDgRecordHeader;
- rStCtrl >> aDgRecordHeader;
- pE2->nDrawingDgId = aDgRecordHeader.nRecInstance;
- aDgRecordHeader.SeekToEndOfRecord( rStCtrl );
- }
- if ( SeekToRec( rStCtrl, DFF_msofbtSolverContainer, aPPTDgContainer.GetRecEndFilePos() ) )
- {
- pE2->pSolverContainer = new SvxMSDffSolverContainer;
- rStCtrl >> *( pE2->pSolverContainer );
- }
- aPPTDgContainer.SeekToBegOfRecord( rStCtrl );
- SetDgContainer( rStCtrl ); // set this, so that the escherimport is knowing of our drawings
- }
- }
- // office xp is supporting more than one stylesheet
- if ( ( pE2->ePageKind == PPT_MASTERPAGE ) && ( pE2->aSlideAtom.nMasterId == 0 ) && ( pE2->bNotesMaster == 0 ) )
- {
- PPTTextSpecInfo aTxSI( 0 );
- if ( aTxSIStyle.bValid && aTxSIStyle.aList.Count() )
- aTxSI = *( ( (PPTTextSpecInfo*)aTxSIStyle.aList.GetObject( 0 ) ) );
-
- pE2->pStyleSheet = new PPTStyleSheet( aSlideHd, rStCtrl, *this, aTxCFStyle, aTxPFStyle, aTxSI );
- pDefaultSheet = pE2->pStyleSheet;
- }
- if ( SeekToRec( rStCtrl, PPT_PST_ColorSchemeAtom, aSlideHd.GetRecEndFilePos() ) )
- rStCtrl >> pE2->aColorScheme;
- else
- {
- DBG_ERROR( "SdrPowerPointImport::Ctor(): could not get SlideColorScheme! (SJ)" );
- }
- }
- else
- {
- DBG_ERROR("SdrPowerPointImport::Ctor(): Persist-Eintrag fehlerhaft! (SJ)");
- }
- }
- }
- }
- DffRecordHeader* pHeadersFootersHd = aDocRecManager.GetRecordHeader( PPT_PST_HeadersFooters, SEEK_FROM_BEGINNING );
- if ( pHeadersFootersHd )
- {
- HeaderFooterEntry aNormalMaster, aNotesMaster;
- for ( ; pHeadersFootersHd; pHeadersFootersHd = aDocRecManager.GetRecordHeader( PPT_PST_HeadersFooters, SEEK_FROM_CURRENT ) )
- {
- if ( pHeadersFootersHd->nRecInstance == 3 ) // normal master
- ImportHeaderFooterContainer( *pHeadersFootersHd, aNormalMaster );
- else if ( pHeadersFootersHd->nRecInstance == 4 ) // notes master
- ImportHeaderFooterContainer( *pHeadersFootersHd, aNotesMaster );
- }
- for ( USHORT i = 0; i < pMasterPages->Count(); i++ )
- {
- if ( (*pMasterPages)[ i ]->bNotesMaster )
- (*pMasterPages)[ i ]->pHeaderFooterEntry = new HeaderFooterEntry( aNotesMaster );
- else
- (*pMasterPages)[ i ]->pHeaderFooterEntry = new HeaderFooterEntry( aNormalMaster );
- }
- }
- }
- }
- if ( ( rStCtrl.GetError() != 0 ) || ( pDefaultSheet == NULL ) )
- bOk = FALSE;
- pPPTStyleSheet = pDefaultSheet;
- rStCtrl.Seek( 0 );
-}
-
-SdrPowerPointImport::~SdrPowerPointImport()
-{
- for ( void* pPtr = aHyperList.First(); pPtr; pPtr = aHyperList.Next() )
- delete (SdHyperlinkEntry*)pPtr;
- delete pMasterPages;
- delete pSlidePages;
- delete pNotePages;
- delete[] pPersistPtr;
-}
-
-sal_Bool PPTConvertOCXControls::InsertControl(
- const com::sun::star::uno::Reference<
- com::sun::star::form::XFormComponent > &rFComp,
- const com::sun::star::awt::Size& rSize,
- com::sun::star::uno::Reference<
- com::sun::star::drawing::XShape > *pShape,
- BOOL /*bFloatingCtrl*/)
-{
- sal_Bool bRetValue = FALSE;
- try
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape;
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > & rFormComps =
- GetFormComps();
-
- ::com::sun::star::uno::Any aTmp( &rFComp, ::getCppuType((const ::com::sun::star::uno::Reference<
- com::sun::star::form::XFormComponent >*)0) );
-
- rFormComps->insertByIndex( rFormComps->getCount(), aTmp );
-
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rServiceFactory =
- GetServiceFactory();
- if( rServiceFactory.is() )
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xCreate = rServiceFactory
- ->createInstance(String( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.ControlShape" ) ) );
- if( xCreate.is() )
- {
- xShape = ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >(xCreate, ::com::sun::star::uno::UNO_QUERY);
- if ( xShape.is() )
- {
- xShape->setSize(rSize);
-// GetShapes()->add( xShape );
- // Das Control-Model am Control-Shape setzen
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XControlShape > xControlShape( xShape,
- ::com::sun::star::uno::UNO_QUERY );
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > xControlModel( rFComp,
- ::com::sun::star::uno::UNO_QUERY );
- if ( xControlShape.is() && xControlModel.is() )
- {
- xControlShape->setControl( xControlModel );
- if (pShape)
- *pShape = xShape;
- bRetValue = TRUE;
- }
- }
- }
- }
- }
- catch( ... )
- {
- bRetValue = FALSE;
- }
- return bRetValue;
-};
-
-const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& PPTConvertOCXControls::GetDrawPage()
-{
- if( !xDrawPage.is() && pDocSh )
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel( pDocSh->GetModel() );
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > xDrawPages;
- switch( ePageKind )
- {
- case PPT_SLIDEPAGE :
- case PPT_NOTEPAGE :
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPagesSupplier >
- xDrawPagesSupplier( xModel, ::com::sun::star::uno::UNO_QUERY);
- if ( xDrawPagesSupplier.is() )
- xDrawPages = xDrawPagesSupplier->getDrawPages();
- }
- break;
-
- case PPT_MASTERPAGE :
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPagesSupplier >
- xMasterPagesSupplier( xModel, ::com::sun::star::uno::UNO_QUERY);
- if ( xMasterPagesSupplier.is() )
- xDrawPages = xMasterPagesSupplier->getMasterPages();
- }
- break;
- }
- if ( xDrawPages.is() && xDrawPages->getCount() )
- {
- xDrawPages->getCount();
- ::com::sun::star::uno::Any aAny( xDrawPages->getByIndex( xDrawPages->getCount() - 1 ) );
- aAny >>= xDrawPage;
- }
- }
- return xDrawPage;
-}
-
-sal_Bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uInt32 nInputSize )
-{
- sal_uInt32 nOldPos = rInput.Tell();
- char* pBuf = new char[ nInputSize ];
- rInput.Read( pBuf, nInputSize );
- ZCodec aZCodec( 0x8000, 0x8000 );
- aZCodec.BeginCompression();
- SvMemoryStream aSource( pBuf, nInputSize, STREAM_READ );
- aZCodec.Decompress( aSource, rOutput );
- const sal_Bool bSuccess(0L != aZCodec.EndCompression());
- delete[] pBuf;
- rInput.Seek( nOldPos );
- return bSuccess;
-}
-
-// --> OD 2004-12-14 #i32596# - add new parameter <_nCalledByGroup>
-SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
- const Graphic& rGraf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
- const int /*_nCalledByGroup*/,
- sal_Int64 /*nAspect*/ ) const
-// <--
-{
- SdrObject* pRet = NULL;
-
- UINT32 nOldPos = rStCtrl.Tell();
-
- Graphic aGraphic( rGraf );
-
- if ( ((SdrPowerPointImport*)this)->maShapeRecords.SeekToContent( rStCtrl, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- DffRecordHeader aPlaceHd;
- while ( ( rStCtrl.GetError() == 0 )
- && ( rStCtrl.Tell() < ((SdrPowerPointImport*)this)->maShapeRecords.Current()->GetRecEndFilePos() ) )
- {
- rStCtrl >> aPlaceHd;
- if ( aPlaceHd.nRecType == PPT_PST_RecolorInfoAtom )
- {
- ((SdrPowerPointImport*)this)->RecolorGraphic( rStCtrl, aPlaceHd.nRecLen, aGraphic );
- break;
- }
- else
- aPlaceHd.SeekToEndOfRecord( rStCtrl );
- }
- }
-
- PPTOleEntry* pOe;
- for ( pOe = (PPTOleEntry*)((SdrPowerPointImport*)this)->aOleObjectList.First(); pOe;
- pOe = (PPTOleEntry*)((SdrPowerPointImport*)this)->aOleObjectList.Next() )
- {
- if ( pOe->nId != (sal_uInt32)nOLEId )
- continue;
-
- rStCtrl.Seek( pOe->nRecHdOfs );
-
- DffRecordHeader aHd;
- rStCtrl >> aHd;
-
- sal_uInt32 nLen = aHd.nRecLen - 4;
- if ( (INT32)nLen > 0 )
- {
- sal_Bool bSuccess = sal_False;
-
- rStCtrl.SeekRel( 4 );
-
- ::utl::TempFile aTmpFile;
- aTmpFile.EnableKillingFile( sal_True );
-
- if ( aTmpFile.IsValid() )
- {
- SvStream* pDest = ::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), STREAM_TRUNC | STREAM_WRITE );
- if ( pDest )
- bSuccess = SdrPowerPointOLEDecompress( *pDest, rStCtrl, nLen );
- delete pDest;
- }
- if ( bSuccess )
- {
- SvStream* pDest = ::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), STREAM_READ );
- Storage* pObjStor = pDest ? new Storage( *pDest, TRUE ) : NULL;
- if ( pObjStor )
- {
- SotStorageRef xObjStor( new SotStorage( pObjStor ) );
- if ( xObjStor.Is() && !xObjStor->GetError() )
- {
- if ( xObjStor->GetClassName() == SvGlobalName() )
- {
- ClsId aId( pObjStor->GetClassId() );
- xObjStor->SetClass( SvGlobalName( aId.n1, aId.n2, aId.n3, aId.n4, aId.n5, aId.n6, aId.n7, aId.n8, aId.n9, aId.n10, aId.n11 ),
- pObjStor->GetFormat(), pObjStor->GetUserName() );
- }
- SotStorageStreamRef xSrcTst = xObjStor->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "\1Ole" ) ) );
- if ( xSrcTst.Is() )
- {
- BYTE aTestA[ 10 ];
- BOOL bGetItAsOle = ( sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) );
- if ( !bGetItAsOle )
- { // maybe there is a contentsstream in here
- xSrcTst = xObjStor->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Contents" ) ), STREAM_READWRITE | STREAM_NOCREATE );
- bGetItAsOle = ( xSrcTst.Is() && sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) );
- }
- if ( bGetItAsOle )
- {
- ::rtl::OUString aNm;
- // if ( nSvxMSDffOLEConvFlags )
- {
- uno::Reference < embed::XStorage > xDestStorage( pOe->pShell->GetStorage() );
- uno::Reference < embed::XEmbeddedObject > xObj =
- CheckForConvertToSOObj( nSvxMSDffOLEConvFlags, *xObjStor, xDestStorage, rGraf, rVisArea );
- if( xObj.is() )
- {
- pOe->pShell->getEmbeddedObjectContainer().InsertEmbeddedObject( xObj, aNm );
-
- svt::EmbeddedObjectRef aObj( xObj, pOe->nAspect );
-
- // TODO/LATER: need MediaType for Graphic
- aObj.SetGraphic( rGraf, ::rtl::OUString() );
- pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, FALSE );
- }
- }
- if ( !pRet && ( pOe->nType == PPT_PST_ExControl ) )
- {
- PPTConvertOCXControls aPPTConvertOCXControls( pOe->pShell, eAktPageKind );
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape;
- if ( aPPTConvertOCXControls.ReadOCXStream( xObjStor, &xShape, FALSE ) )
- pRet = GetSdrObjectFromXShape( xShape );
- }
- if ( !pRet )
- {
- aNm = pOe->pShell->getEmbeddedObjectContainer().CreateUniqueObjectName();
- ErrCode aErrCode = 0;
-
- // object is not an own object
- SotStorageRef xTarget = SotStorage::OpenOLEStorage( pOe->pShell->GetStorage(), aNm, STREAM_READWRITE );
- if ( xObjStor.Is() && xTarget.Is() )
- {
- xObjStor->CopyTo( xTarget );
- if( !xTarget->GetError() )
- xTarget->Commit();
- if( xTarget->GetError() )
- aErrCode = xTarget->GetError();
- }
- xTarget.Clear();
-
- uno::Reference < embed::XEmbeddedObject > xObj =
- pOe->pShell->getEmbeddedObjectContainer().GetEmbeddedObject( aNm );
- if ( xObj.is() )
- {
- if ( pOe->nAspect != embed::Aspects::MSOLE_ICON )
- {
- //TODO/LATER: keep on hacking?!
- // modifiziert wollen wir nicht werden
- //xInplaceObj->EnableSetModified( FALSE );
- if ( rVisArea.IsEmpty() )
- {
- MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pOe->nAspect ) );
- Size aSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
- aGraphic.GetPrefMapMode(), MapMode( aMapUnit ) ) );
-
- awt::Size aSz;
- aSz.Width = aSize.Width();
- aSz.Height = aSize.Height();
- xObj->setVisualAreaSize( pOe->nAspect, aSz );
- }
- else
- {
- awt::Size aSize( rVisArea.GetSize().Width(), rVisArea.GetSize().Height() );
- xObj->setVisualAreaSize( pOe->nAspect, aSize );
- }
- //xInplaceObj->EnableSetModified( TRUE );
- }
-
- svt::EmbeddedObjectRef aObj( xObj, pOe->nAspect );
-
- // TODO/LATER: need MediaType for Graphic
- aObj.SetGraphic( aGraphic, ::rtl::OUString() );
-
- pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, FALSE );
- }
- }
- }
- }
- }
- }
- delete pDest;
- }
- }
- }
- rStCtrl.Seek( nOldPos );
-
- return pRet;
-}
-
-SvMemoryStream* SdrPowerPointImport::ImportExOleObjStg( UINT32 nPersistPtr, UINT32& nOleId ) const
-{
- SvMemoryStream* pRet = NULL;
- if ( nPersistPtr && ( nPersistPtr < nPersistPtrAnz ) )
- {
- UINT32 nOldPos, nOfs = pPersistPtr[ nPersistPtr ];
- nOldPos = rStCtrl.Tell();
- rStCtrl.Seek( nOfs );
- DffRecordHeader aHd;
- rStCtrl >> aHd;
- if ( aHd.nRecType == DFF_PST_ExOleObjStg )
- {
- UINT32 nLen = aHd.nRecLen - 4;
- if ( (INT32)nLen > 0 )
- {
- rStCtrl >> nOleId;
- pRet = new SvMemoryStream;
- ZCodec aZCodec( 0x8000, 0x8000 );
- aZCodec.BeginCompression();
- aZCodec.Decompress( rStCtrl, *pRet );
- if ( !aZCodec.EndCompression() )
- delete pRet, pRet = NULL;
- }
- }
- rStCtrl.Seek( nOldPos );
- }
- return pRet;
-}
-
-void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions )
-{
- if ( pShell )
- {
- DffRecordHeader* pHd;
-
- UINT32 nOldPos = rStCtrl.Tell();
- if ( nFilterOptions & 1 )
- {
- pHd = aDocRecManager.GetRecordHeader( PPT_PST_List, SEEK_FROM_BEGINNING );
- if ( pHd )
- {
- // we try to locate the basic atom
- pHd->SeekToContent( rStCtrl );
- if ( SeekToRec( rStCtrl, PPT_PST_VBAInfo, pHd->GetRecEndFilePos(), pHd ) )
- {
- if ( SeekToRec( rStCtrl, PPT_PST_VBAInfoAtom, pHd->GetRecEndFilePos(), pHd ) )
- {
- UINT32 nPersistPtr, nIDoNotKnow1, nIDoNotKnow2;
- rStCtrl >> nPersistPtr
- >> nIDoNotKnow1
- >> nIDoNotKnow2;
-
- UINT32 nOleId;
- SvMemoryStream* pBas = ImportExOleObjStg( nPersistPtr, nOleId );
- if ( pBas )
- {
- SotStorageRef xSource( new SotStorage( pBas, TRUE ) );
- SotStorageRef xDest( new SotStorage( new SvMemoryStream(), TRUE ) );
- if ( xSource.Is() && xDest.Is() )
- {
- // is this a visual basic storage ?
- SotStorageRef xSubStorage = xSource->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM( "VBA" ) ),
- STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL );
- if( xSubStorage.Is() && ( SVSTREAM_OK == xSubStorage->GetError() ) )
- {
- SotStorageRef xMacros = xDest->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM( "MACROS" ) ) );
- if ( xMacros.Is() )
- {
- SvStorageInfoList aList;
- xSource->FillInfoList( &aList );
- UINT32 i;
-
- BOOL bCopied = TRUE;
- for ( i = 0; i < aList.Count(); i++ ) // copy all entrys
- {
- const SvStorageInfo& rInfo = aList[ i ];
- if ( !xSource->CopyTo( rInfo.GetName(), xMacros, rInfo.GetName() ) )
- bCopied = FALSE;
- }
- if ( i && bCopied )
- {
- SvxImportMSVBasic aMSVBas( *pShell, *xDest, TRUE, FALSE );
- //int nSuccess = aMSVBas.Import( String( RTL_CONSTASCII_USTRINGPARAM( "MACROS" ) ),
- // String( RTL_CONSTASCII_USTRINGPARAM( "VBA" ) ), TRUE, FALSE );
-
- uno::Reference < embed::XStorage > xDoc( pShell->GetStorage() );
- if ( xDoc.is() )
- {
- SotStorageRef xVBA = SotStorage::OpenOLEStorage( xDoc, String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) ) );
- if ( xVBA.Is() && ( xVBA->GetError() == SVSTREAM_OK ) )
- {
- SotStorageRef xSubVBA = xVBA->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Overhead" ) ) );
- if ( xSubVBA.Is() && ( xSubVBA->GetError() == SVSTREAM_OK ) )
- {
- SotStorageStreamRef xOriginal = xSubVBA->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Overhead2" ) ) );
- if ( xOriginal.Is() && ( xOriginal->GetError() == SVSTREAM_OK ) )
- {
- if ( nPersistPtr && ( nPersistPtr < nPersistPtrAnz ) )
- {
- rStCtrl.Seek( pPersistPtr[ nPersistPtr ] );
- rStCtrl >> *pHd;
-
- *xOriginal << nIDoNotKnow1
- << nIDoNotKnow2;
-
- UINT32 nSource, nToCopy, nBufSize;
- nSource = rStCtrl.Tell();
- nToCopy = pHd->nRecLen;
- BYTE* pBuf = new BYTE[ 0x40000 ]; // 256KB Buffer
- if ( pBuf )
- {
- while ( nToCopy )
- {
- nBufSize = ( nToCopy >= 0x40000 ) ? 0x40000 : nToCopy;
- rStCtrl.Read( pBuf, nBufSize );
- xOriginal->Write( pBuf, nBufSize );
- nToCopy -= nBufSize;
- }
- delete[] pBuf;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- pHd = aDocRecManager.GetRecordHeader( PPT_PST_ExObjList, SEEK_FROM_BEGINNING );
- if ( pHd )
- {
- DffRecordManager* pExObjListManager = NULL;
- DffRecordHeader* pExEmbed = NULL;
-
- pHd->SeekToBegOfRecord( rStCtrl );
- pExObjListManager = new DffRecordManager( rStCtrl );
- sal_uInt16 i, nRecType(PPT_PST_ExEmbed);
-
- for ( i = 0; i < 2; i++ )
- {
- switch ( i )
- {
- case 0 : nRecType = PPT_PST_ExEmbed; break;
- case 1 : nRecType = PPT_PST_ExControl; break;
- }
- for ( pExEmbed = pExObjListManager->GetRecordHeader( nRecType, SEEK_FROM_BEGINNING );
- pExEmbed; pExEmbed = pExObjListManager->GetRecordHeader( nRecType, SEEK_FROM_CURRENT ) )
- {
- pExEmbed->SeekToContent( rStCtrl );
-
- DffRecordHeader aExOleAtHd;
- if ( SeekToRec( rStCtrl, PPT_PST_ExOleObjAtom, pExEmbed->GetRecEndFilePos(), &aExOleAtHd ) )
- {
- PptExOleObjAtom aAt;
- rStCtrl >> aAt;
-
- if ( aAt.nPersistPtr && ( aAt.nPersistPtr < nPersistPtrAnz ) )
- {
- UINT32 nId;
- rStCtrl.Seek( pPersistPtr[ aAt.nPersistPtr ] );
- DffRecordHeader aHd;
- rStCtrl >> aHd;
- if ( aHd.nRecType == DFF_PST_ExOleObjStg )
- {
- rStCtrl >> nId;
- aOleObjectList.Insert(
- new PPTOleEntry( aAt.nId, aHd.nFilePos, pShell, nRecType, aAt.nAspect ) );
- }
- }
- }
- }
- }
- delete pExObjListManager;
- }
- rStCtrl.Seek( nOldPos );
- }
-}
-
-sal_Bool SdrPowerPointImport::ReadFontCollection()
-{
- sal_Bool bRet = FALSE;
- DffRecordHeader* pEnvHd = aDocRecManager.GetRecordHeader( PPT_PST_Environment );
- if ( pEnvHd )
- {
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
- pEnvHd->SeekToContent( rStCtrl );
- DffRecordHeader aListHd;
- if ( SeekToRec( rStCtrl, PPT_PST_FontCollection, pEnvHd->GetRecEndFilePos(), &aListHd ) )
- {
- sal_uInt16 nCount2 = 0;
- VirtualDevice* pVDev = NULL;
- while ( SeekToRec( rStCtrl, PPT_PST_FontEntityAtom, aListHd.GetRecEndFilePos() ) )
- {
- bRet = TRUE;
- if ( !pFonts )
- pFonts = new PptFontCollection;
- PptFontEntityAtom* pFont = new PptFontEntityAtom;
- rStCtrl >> *pFont;
-
- Font aFont;
- aFont.SetCharSet( pFont->eCharSet );
- aFont.SetName( pFont->aName );
- aFont.SetFamily( pFont->eFamily );
- aFont.SetPitch( pFont->ePitch );
- aFont.SetHeight( 100 );
-
- if ( mbTracing && !pFont->bAvailable )
- mpTracer->Trace( rtl::OUString::createFromAscii( "sd1000" ), pFont->aName );
-
-#ifdef DBG_EXTRACTFONTMETRICS
-
- SvxFont aTmpFont( aFont );
-
- if ( !pVDev )
- pVDev = new VirtualDevice;
- aTmpFont.SetPhysFont( pVDev );
- FontMetric aMetric( pVDev->GetFontMetric() );
- sal_uInt16 nTxtHeight = (sal_uInt16)aMetric.GetAscent() + (sal_uInt16)aMetric.GetDescent();
-
- String aFileURLStr;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aFileURLStr ) )
- {
- INetURLObject aURL( aFileURLStr );
- aURL.SetName( String( RTL_CONSTASCII_STRINGPARAM( "dbgfontmetrics.txt" ) ) );
-
- SvStream* pDbgOut = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE );
- if( pDbgOut )
- {
- pDbgOut->Seek( STREAM_SEEK_TO_END );
-
- Printer* pPrinter = NULL;
- if ( pSdrModel->GetRefDevice() && pSdrModel->GetRefDevice()->GetOutDevType() == OUTDEV_PRINTER )
- pPrinter = (Printer*)pSdrModel->GetRefDevice();
- if ( pPrinter )
- {
- Font aOldFont( pPrinter->GetFont() );
- aFont.SetKerning( TRUE );
- pPrinter->SetFont( aFont );
- aMetric = pPrinter->GetFontMetric();
- pPrinter->SetFont( aOldFont );
- }
-
- if ( ( pPrinter == NULL ) || ( aMetric.GetIntLeading() == 0 ) )
- {
- VirtualDevice aVirDev( 1 );
- aVirDev.SetFont( aFont );
- aMetric = aVirDev.GetFontMetric();
- }
- ByteString aFontName( aFont.GetName(), RTL_TEXTENCODING_UTF8 );
- ByteString aHeight( ByteString::CreateFromInt32( aMetric.GetLineHeight() ) );
- ByteString aAscent( ByteString::CreateFromInt32( aMetric.GetAscent() ) );
- ByteString aDescent( ByteString::CreateFromInt32( aMetric.GetDescent() ) );
- ByteString aLeading( ByteString::CreateFromInt32( aMetric.GetIntLeading() ) );
- ByteString aPhysHeight( ByteString::CreateFromInt32( nTxtHeight ) );
-
- *pDbgOut << (sal_uInt8)0xa
- << "FontName : " << aFontName.GetBuffer() << (sal_uInt8)0xa
- << " Height: " << aHeight.GetBuffer() << (sal_uInt8)0xa
- << " Ascent: " << aAscent.GetBuffer() << (sal_uInt8)0xa
- << " Descent:" << aDescent.GetBuffer() << (sal_uInt8)0xa
- << " Leading:" << aLeading.GetBuffer() << (sal_uInt8)0xa
- << "PhysHeight :" << aPhysHeight.GetBuffer()<< (sal_uInt8)0xa;
- }
- delete pDbgOut;
- }
-#endif
- // following block is necessary, because our old PowerPoint export did not set the
- // correct charset
- if ( pFont->aName.EqualsIgnoreCaseAscii( "Wingdings" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Wingdings 2" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Wingdings 3" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Monotype Sorts" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Monotype Sorts 2" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Webdings" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "StarBats" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "StarMath" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "ZapfDingbats" ) )
- {
- pFont->eCharSet = RTL_TEXTENCODING_SYMBOL;
- };
- pFonts->C40_INSERT( PptFontEntityAtom, pFont, nCount2++ );
- }
- delete pVDev;
- }
- rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- }
- return bRet;
-}
-
-PptSlidePersistList* SdrPowerPointImport::GetPageList(PptPageKind ePageKind) const
-{
- if ( ePageKind == PPT_MASTERPAGE )
- return pMasterPages;
- if ( ePageKind == PPT_SLIDEPAGE )
- return pSlidePages;
- if ( ePageKind == PPT_NOTEPAGE )
- return pNotePages;
- return NULL;
-}
-
-SdrOutliner* SdrPowerPointImport::GetDrawOutliner( SdrTextObj* pSdrText ) const
-{
- if ( !pSdrText )
- return NULL;
- else
- return &pSdrText->ImpGetDrawOutliner();
-}
-
-
-SdrObject* SdrPowerPointImport::ReadObjText( PPTTextObj* pTextObj, SdrObject* pSdrObj, SdPage* pPage ) const
-{
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pSdrObj );
- if ( pText )
- {
- if ( !ApplyTextObj( pTextObj, pText, pPage, NULL, NULL ) )
- pSdrObj = NULL;
- }
- return pSdrObj;
-}
-
-
-SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pSdrText, SdPage* /*pPage*/,
- SfxStyleSheet* pSheet, SfxStyleSheet** ppStyleSheetAry ) const
-{
- SdrTextObj* pText = pSdrText;
- if ( pTextObj->Count() )
- {
- UINT32 nDestinationInstance = pTextObj->GetDestinationInstance() ;
- SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
- if ( ( pText->GetObjInventor() == SdrInventor ) && ( pText->GetObjIdentifier() == OBJ_TITLETEXT ) ) // Outliner-Style fuer Titel-Textobjekt?!? (->von DL)
- rOutliner.Init( OUTLINERMODE_TITLEOBJECT ); // Outliner reset
-
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- rOutliner.SetUpdateMode( FALSE );
- if ( pSheet )
- {
- if ( rOutliner.GetStyleSheet( 0 ) != pSheet )
- rOutliner.SetStyleSheet( 0, pSheet );
- }
- rOutliner.SetVertical( pTextObj->GetVertical() );
- sal_Int16 nLastStartNumbering = -1;
- const PPTParagraphObj* pPreviousParagraph = NULL;
- for ( PPTParagraphObj* pPara = pTextObj->First(); pPara; pPara = pTextObj->Next() )
- {
- UINT32 nTextSize = pPara->GetTextSize();
- if ( ! ( nTextSize & 0xffff0000 ) )
- {
- PPTPortionObj* pPortion;
- sal_Unicode* pParaText = new sal_Unicode[ nTextSize ];
- UINT32 nCurrentIndex = 0;
- for ( pPortion = pPara->First(); pPortion; pPortion = pPara->Next() )
- {
- if ( pPortion->mpFieldItem )
- pParaText[ nCurrentIndex++ ] = ' ';
- else
- {
- sal_uInt32 nCharacters = pPortion->Count();
- const sal_Unicode* pSource = pPortion->maString.GetBuffer();
- sal_Unicode* pDest = pParaText + nCurrentIndex;
-
- sal_uInt32 nFont;
- pPortion->GetAttrib( PPT_CharAttr_Font, nFont, pTextObj->GetInstance() );
- PptFontEntityAtom* pFontEnityAtom = GetFontEnityAtom( nFont );
- if ( pFontEnityAtom && ( pFontEnityAtom->eCharSet == RTL_TEXTENCODING_SYMBOL ) )
- {
- sal_uInt32 i;
- sal_Unicode nUnicode;
- for ( i = 0; i < nCharacters; i++ )
- {
- nUnicode = pSource[ i ];
- if ( ! ( nUnicode & 0xff00 ) )
- nUnicode |= 0xf000;
- pDest[ i ] = nUnicode;
- }
- }
- else
- memcpy( pDest, pSource, nCharacters << 1 );
- nCurrentIndex += nCharacters;
- }
- }
- sal_uInt16 nParaIndex = (UINT16)pTextObj->GetCurrentIndex();
- SfxStyleSheet* pS = ( ppStyleSheetAry ) ? ppStyleSheetAry[ pPara->pParaSet->mnDepth ] : pSheet;
-
- ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
- rOutliner.Insert( String(), nParaIndex, pPara->pParaSet->mnDepth );
- rOutliner.QuickInsertText( String( pParaText, (UINT16)nCurrentIndex ), aSelection );
- rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() );
- if ( pS )
- rOutliner.SetStyleSheet( nParaIndex, pS );
-
- for ( pPortion = pPara->First(); pPortion; pPortion = pPara->Next() )
- {
- SfxItemSet aPortionAttribs( rOutliner.GetEmptyItemSet() );
- SvxFieldItem* pFieldItem = pPortion->GetTextField();
- if ( pFieldItem )
- {
- rOutliner.QuickInsertField( *pFieldItem, ESelection( nParaIndex, aSelection.nEndPos, nParaIndex, aSelection.nEndPos + 1 ) );
- aSelection.nEndPos++;
- delete pFieldItem;
- }
- else
- {
- const sal_Unicode *pF, *pPtr = pPortion->maString.GetBuffer();
- const sal_Unicode *pMax = pPtr + pPortion->maString.Len();
- sal_Int32 nLen;
- for ( pF = pPtr; pPtr < pMax; pPtr++ )
- {
- if ( *pPtr == 0xb )
- {
- nLen = pPtr - pF;
- if ( nLen )
- aSelection.nEndPos =
- sal::static_int_cast< USHORT >(
- aSelection.nEndPos + nLen );
- pF = pPtr + 1;
- rOutliner.QuickInsertLineBreak( ESelection( nParaIndex, aSelection.nEndPos, nParaIndex, aSelection.nEndPos + 1 ) );
- aSelection.nEndPos++;
- }
- }
- nLen = pPtr - pF;
- if ( nLen )
- aSelection.nEndPos = sal::static_int_cast< USHORT >(
- aSelection.nEndPos + nLen );
- }
- pPortion->ApplyTo( aPortionAttribs, (SdrPowerPointImport&)*this, nDestinationInstance, pTextObj );
- rOutliner.QuickSetAttribs( aPortionAttribs, aSelection );
- aSelection.nStartPos = aSelection.nEndPos;
- }
- boost::optional< sal_Int16 > oStartNumbering;
- SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
- pPara->ApplyTo( aParagraphAttribs, oStartNumbering, (SdrPowerPointImport&)*this, nDestinationInstance, pPreviousParagraph );
-
- UINT32 nIsBullet2 = 0; //, nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : pTextObj->GetInstance();
- pPara->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
- if ( !nIsBullet2 )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
-
- if ( oStartNumbering )
- {
- if ( *oStartNumbering != nLastStartNumbering )
- rOutliner.SetNumberingStartValue( nParaIndex, *oStartNumbering );
- else
- rOutliner.SetNumberingStartValue( nParaIndex, -1 );
- nLastStartNumbering = *oStartNumbering;
- }
- else
- {
- nLastStartNumbering = -1;
- rOutliner.SetNumberingStartValue( nParaIndex, nLastStartNumbering );
- }
-
- pPreviousParagraph = pPara;
- if ( !aSelection.nStartPos ) // in PPT empty paragraphs never gets a bullet
- {
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
-// rOutliner.SetDepth( rOutliner.GetParagraph( nParaIndex ), -1 );
- }
- aSelection.nStartPos = 0;
- rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
- delete[] pParaText;
- }
- }
- OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
- rOutliner.Clear();
- rOutliner.SetUpdateMode( bOldUpdateMode );
- pText->SetOutlinerParaObject( pNewText );
- }
- return pText;
-}
-
-sal_Bool SdrPowerPointImport::SeekToDocument( DffRecordHeader* pRecHd ) const
-{
- sal_Bool bRet;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
- rStCtrl.Seek( nDocStreamPos );
- DffRecordHeader aDocHd;
- rStCtrl >> aDocHd;
- bRet = aDocHd.nRecType == PPT_PST_Document;
- if ( bRet )
- {
- if ( pRecHd )
- *pRecHd = aDocHd;
- else
- aDocHd.SeekToBegOfRecord( rStCtrl );
- }
- if ( !bRet )
- rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
-}
-
-sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStream& rSt,
- const DffRecordHeader& rSourceHd, DffRecordHeader& rContentHd )
-{
- sal_Bool bRetValue = sal_False;
- sal_uInt32 nOldPos = rSt.Tell();
-
- DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd;
- rSourceHd.SeekToContent( rSt );
- sal_Bool bFound = rSourceHd.nRecType == PPT_PST_ProgTags;
- if ( !bFound )
- bFound = SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd );
- if ( bFound )
- {
- while( SeekToRec( rSt, PPT_PST_ProgBinaryTag, aProgTagsHd.GetRecEndFilePos(), &aProgTagBinaryDataHd ) )
- {
- rSt >> rContentHd;
- if ( rContentHd.nRecType == PPT_PST_CString )
- {
- sal_uInt16 n = 6;
- sal_uInt32 i = rContentHd.nRecLen >> 1;
- if ( i > n )
- {
- String aPre, aSuf;
- sal_Unicode *pTmp = aPre.AllocBuffer( n );
- while ( n-- )
- rSt >> *pTmp++;
- n = (sal_uInt16)( i - 6 );
- pTmp = aSuf.AllocBuffer( n );
- while ( n-- )
- rSt >> *pTmp++;
- sal_Int32 nV = aSuf.ToInt32();
- if ( ( nV == nVersion ) && ( aPre == String( RTL_CONSTASCII_USTRINGPARAM( "___PPT" ) ) ) )
- {
- rContentHd.SeekToEndOfRecord( rSt );
- rSt >> rContentHd;
- if ( rContentHd.nRecType == PPT_PST_BinaryTagData )
- {
- bRetValue = sal_True;
- break;
- }
- }
- }
- }
- aProgTagBinaryDataHd.SeekToEndOfRecord( rSt );
- }
- }
- if ( !bRetValue )
- rSt.Seek( nOldPos );
- return bRetValue;
-}
-
-UINT32 SdrPowerPointImport::GetAktPageId()
-{
- PptSlidePersistList* pList = GetPageList( eAktPageKind );
- if ( pList && nAktPageNum < pList->Count() )
- return (*pList)[ (USHORT)nAktPageNum ]->aPersistAtom.nSlideId;
- return 0;
-}
-
-sal_Bool SdrPowerPointImport::SeekToAktPage( DffRecordHeader* pRecHd ) const
-{
- sal_Bool bRet = FALSE;
- PptSlidePersistList* pList = GetPageList( eAktPageKind );
- if ( pList && ( nAktPageNum < pList->Count() ) )
- {
- ULONG nPersist = (*pList)[ (USHORT)nAktPageNum ]->aPersistAtom.nPsrReference;
- if ( nPersist > 0 && nPersist < nPersistPtrAnz )
- {
- ULONG nFPos = 0;
- nFPos = pPersistPtr[ nPersist ];
- if ( nFPos < nStreamLen )
- {
- rStCtrl.Seek( nFPos );
- if ( pRecHd )
- rStCtrl >> *pRecHd;
- bRet = TRUE;
- }
- }
- }
- return bRet;
-}
-
-USHORT SdrPowerPointImport::GetPageCount( PptPageKind ePageKind ) const
-{
- PptSlidePersistList* pList = GetPageList( ePageKind );
- if ( pList )
- return pList->Count();
- return 0;
-}
-
-void SdrPowerPointImport::SetPageNum( sal_uInt16 nPageNum, PptPageKind eKind )
-{
- eAktPageKind = eKind;
- nAktPageNum = nPageNum;
-
- pPPTStyleSheet = NULL;
-
- sal_Bool bHasMasterPage = sal_True;
- sal_uInt16 nMasterIndex = 0;
-
- if ( eKind == PPT_MASTERPAGE )
- nMasterIndex = nPageNum;
- else
- {
- if ( HasMasterPage( nPageNum, eKind ) )
- nMasterIndex = GetMasterPageIndex( nPageNum, eKind );
- else
- bHasMasterPage = sal_False;
- }
- if ( bHasMasterPage )
- {
- PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
- if ( pPageList && nMasterIndex < pPageList->Count() )
- {
- PptSlidePersistEntry* pMasterPersist = (*pPageList)[ nMasterIndex ];
- if ( ( pMasterPersist->pStyleSheet == NULL ) && pMasterPersist->aSlideAtom.nMasterId )
- {
- nMasterIndex = pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
- if ( nMasterIndex != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- pMasterPersist = (*pPageList)[ nMasterIndex ];
- }
- pPPTStyleSheet = pMasterPersist->pStyleSheet;
- }
- }
- if ( !pPPTStyleSheet )
- pPPTStyleSheet = pDefaultSheet;
-}
-
-Size SdrPowerPointImport::GetPageSize() const
-{
- Size aRet( IsNoteOrHandout( nAktPageNum, eAktPageKind ) ? aDocAtom.GetNotesPageSize() : aDocAtom.GetSlidesPageSize() );
- Scale( aRet );
- // PPT arbeitet nur mit Einheiten zu 576DPI. Um Ungenauigkeiten zu
- // vermeiden runde ich die letzte Nachkommastelle metrisch weg.
- if ( nMapMul > 2 * nMapDiv )
- {
- MapUnit eMap = pSdrModel->GetScaleUnit();
- bool bInch = IsInch( eMap );
- long nInchMul = 1, nInchDiv = 1;
- if ( bInch )
- { // Size temporaer (zum runden) in nach metric konvertieren
- Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
- nInchMul = aFact.GetNumerator();
- nInchDiv = aFact.GetDenominator();
- aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
- aRet.Height() = BigMulDiv( aRet.Height(), nInchMul, nInchDiv );
- }
- aRet.Width() += 5; aRet.Width() /= 10; aRet.Width()*=10;
- aRet.Height() += 5; aRet.Height() /= 10; aRet.Height()*=10;
- if ( bInch )
- {
- aRet.Width() = BigMulDiv( aRet.Width(), nInchDiv, nInchMul );
- aRet.Height() = BigMulDiv( aRet.Height(), nInchDiv, nInchMul );
- }
- }
- return aRet;
-}
-
-FASTBOOL SdrPowerPointImport::GetColorFromPalette( USHORT nNum, Color& rColor ) const
-{
- if ( nPageColorsNum != nAktPageNum || ePageColorsKind != eAktPageKind )
- {
- UINT16 nSlideFlags = 0;
- PptSlidePersistList* pPageList = GetPageList( eAktPageKind );
- if ( pPageList && ( nAktPageNum < pPageList->Count() ) )
- {
- PptSlidePersistEntry* pE = (*pPageList)[ nAktPageNum ];
- if ( pE )
- nSlideFlags = pE->aSlideAtom.nFlags;
- if ( ! ( nSlideFlags & 2 ) )
- ((SdrPowerPointImport*)this)->aPageColors = pE->aColorScheme;
- }
- if ( nSlideFlags & 2 ) // follow master colorscheme ?
- {
- PptSlidePersistList* pPageList2 = GetPageList( PPT_MASTERPAGE );
- if ( pPageList2 )
- {
- PptSlidePersistEntry* pMasterPersist = NULL;
- if ( eAktPageKind == PPT_MASTERPAGE )
- pMasterPersist = (*pPageList2)[ nAktPageNum ];
- else
- {
- if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
- {
- sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
- if ( nMasterNum < pPageList2->Count() )
- pMasterPersist = (*pPageList2)[ nMasterNum ];
- }
- }
- if ( pMasterPersist )
- {
- while( ( pMasterPersist && pMasterPersist->aSlideAtom.nFlags & 2 ) // it is possible that a masterpage
- && pMasterPersist->aSlideAtom.nMasterId ) // itself is following a master colorscheme
- {
- sal_uInt16 nNextMaster = pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
- if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- break;
- else
- pMasterPersist = (*pPageList2)[ nNextMaster ];
- }
- ((SdrPowerPointImport*)this)->aPageColors = pMasterPersist->aColorScheme;
- }
- }
- }
- // momentanes Farbschema eintragen
- ((SdrPowerPointImport*)this)->nPageColorsNum = nAktPageNum;
- ((SdrPowerPointImport*)this)->ePageColorsKind = eAktPageKind;
- }
- rColor = aPageColors.GetColor( nNum );
- return TRUE;
-}
-
-BOOL SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, UINT32 nId ) const
-{
- BOOL bRet = SvxMSDffManager::SeekToShape( rSt, pClientData, nId );
- if ( !bRet )
- {
- ProcessData& rData = *( (ProcessData*)pClientData );
- PptSlidePersistEntry& rPersistEntry = rData.rPersistEntry;
- if ( rPersistEntry.ePageKind == PPT_SLIDEPAGE )
- {
- if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
- {
- USHORT nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
- PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
- if ( pPageList && ( nMasterNum < pPageList->Count() ) )
- {
- PptSlidePersistEntry* pPersist = (*pPageList)[ nMasterNum ]; // get the masterpage's persistentry
- if ( pPersist && pPersist->pPresentationObjects )
- {
- UINT32 nCurrent(0L);
- DffRecordList* pCList = maShapeRecords.pCList; // we got a backup of the current position
- if ( pCList )
- nCurrent = pCList->nCurrent;
- if ( ((SdrEscherImport*)this )->maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- UINT32 nStreamPos = rSt.Tell();
- PPTTextObj aTextObj( rSt, (SdrPowerPointImport&)*this, rPersistEntry, NULL );
- if ( aTextObj.Count() || aTextObj.GetOEPlaceHolderAtom() )
- {
- UINT32 nShapePos = 0;
- switch ( aTextObj.GetInstance() )
- {
- case TSS_TYPE_TITLE :
- nShapePos = pPersist->pPresentationObjects[ TSS_TYPE_PAGETITLE ];
- break;
- case TSS_TYPE_PAGETITLE :
- nShapePos = pPersist->pPresentationObjects[ TSS_TYPE_PAGETITLE ];
- break;
- case TSS_TYPE_SUBTITLE :
- case TSS_TYPE_HALFBODY :
- case TSS_TYPE_QUARTERBODY :
- case TSS_TYPE_BODY :
- nShapePos = pPersist->pPresentationObjects[ TSS_TYPE_BODY ];
- break;
-// case TSS_TYPE_NOTES :
-// case TSS_TYPE_UNUSED :
-// case TSS_TYPE_TEXT_IN_SHAPE :
- }
- if ( nShapePos )
- {
- rSt.Seek( nShapePos );
- bRet = TRUE;
- }
- }
- if ( !bRet )
- rSt.Seek( nStreamPos );
- }
- if ( pCList ) // restoring
- pCList->nCurrent = nCurrent;
- ((SdrEscherImport*)this )->maShapeRecords.pCList = pCList;
- }
- }
- }
- }
- }
- return bRet;
-}
-
-SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const
-{
- SdrPage* pRet = pSdrModel->AllocPage( bMaster );
- pRet->SetSize( GetPageSize() );
-
-/*
- SJ (21.08.00) : since bug #77576# i decided not to set a border size.
-
- Size aPageSize( aDocAtom.GetSlidesPageSize() ); // PageSize in 576DPI-Units
- long nHMarg = aPageSize.Width() - aDocAtom.aSlidesPageSize.Width();
- long nVMarg = aPageSize.Height() - aDocAtom.aSlidesPageSize.Height();
- if ( nHMarg > 0 )
- {
- Scale( nHMarg );
- pRet->SetLftBorder( nHMarg / 2 );
- pRet->SetRgtBorder( nHMarg - nHMarg / 2 );
- }
- if ( nVMarg > 0 )
- {
- Scale( nVMarg );
- pRet->SetUppBorder( nVMarg / 2 );
- pRet->SetLwrBorder( nVMarg - nVMarg / 2 );
- }
-*/
- return pRet;
-}
-
-void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader& rComment10Hd )
-{
- rtl::OUString sAuthor;
- rtl::OUString sText;
- rtl::OUString sInitials;
-
- sal_Int32 nIndex = 0;
- util::DateTime aDateTime;
- sal_Int32 nPosX = 0;
- sal_Int32 nPosY = 0;
-
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < rComment10Hd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aCommentHd;
- rStCtrl >> aCommentHd;
- switch( aCommentHd.nRecType )
- {
- case PPT_PST_CString :
- {
- String aString;
- SvxMSDffManager::MSDFFReadZString( rStCtrl, aString, aCommentHd.nRecLen, TRUE );
- switch ( aCommentHd.nRecInstance )
- {
- case 0 : sAuthor = aString; break;
- case 1 : sText = aString; break;
- case 2 : sInitials = aString; break;
- }
- }
- break;
-
- case PPT_PST_CommentAtom10 :
- {
- rStCtrl >> nIndex
- >> aDateTime.Year
- >> aDateTime.Month
- >> aDateTime.Day // DayOfWeek
- >> aDateTime.Day
- >> aDateTime.Hours
- >> aDateTime.Minutes
- >> aDateTime.Seconds
- >> aDateTime.HundredthSeconds
- >> nPosX
- >> nPosY;
-
- aDateTime.HundredthSeconds /= 10;
- }
- break;
- }
- aCommentHd.SeekToEndOfRecord( rStCtrl );
- }
- Point aPosition( nPosX, nPosY );
- rMan.Scale( aPosition );
-
- try
- {
- uno::Reference< office::XAnnotationAccess > xAnnotationAccess( pPage->getUnoPage(), UNO_QUERY_THROW );
- uno::Reference< office::XAnnotation > xAnnotation( xAnnotationAccess->createAndInsertAnnotation() );
- xAnnotation->setPosition( geometry::RealPoint2D( aPosition.X() / 100.0, aPosition.Y() / 100.0 ) );
- xAnnotation->setAuthor( sAuthor );
- xAnnotation->setDateTime( aDateTime );
- uno::Reference< text::XText > xText( xAnnotation->getTextRange() );
- xText->setString( sText );
- }
- catch( uno::Exception& )
- {
-
- }
-}
-
-
-// be sure not to import masterpages with this method
-// be sure not to import masterpages with this method
-void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* pMasterPersist )
-{
- UINT32 nMerk = rStCtrl.Tell();
- PptSlidePersistList* pList = GetPageList( eAktPageKind );
- if ( ( !pList ) || ( pList->Count() <= nAktPageNum ) )
- return;
- PptSlidePersistEntry& rSlidePersist = *(*pList)[ nAktPageNum ];
- if ( rSlidePersist.bStarDrawFiller )
- return;
-
- DffRecordHeader aPageHd;
- if ( SeekToAktPage( &aPageHd ) )
- {
- if ( mbTracing )
- mpTracer->AddAttribute( eAktPageKind == PPT_SLIDEPAGE
- ? rtl::OUString::createFromAscii( "Page" )
- : rtl::OUString::createFromAscii( "NotesPage" ),
- rtl::OUString::valueOf( (sal_Int32)nAktPageNum + 1 ) );
-
- rSlidePersist.pHeaderFooterEntry = new HeaderFooterEntry( pMasterPersist );
- ProcessData aProcessData( rSlidePersist, (SdPage*)pRet );
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aHd;
- rStCtrl >> aHd;
- switch ( aHd.nRecType )
- {
- case PPT_PST_HeadersFooters :
- {
- ImportHeaderFooterContainer( aHd, *rSlidePersist.pHeaderFooterEntry );
- }
- break;
-
- case PPT_PST_ProgTags :
- {
- DffRecordHeader aContentDataHd;
- if ( SeekToContentOfProgTag( 10, rStCtrl, aHd, aContentDataHd ) )
- {
- DffRecordHeader aComment10Hd;
- while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) )
- {
- ImportComment10( *this, rStCtrl, pRet, aComment10Hd );
- aComment10Hd.SeekToEndOfRecord( rStCtrl );
- }
- }
- }
- break;
-
- case PPT_PST_PPDrawing :
- {
- DffRecordHeader aPPDrawHd;
- if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, aHd.GetRecEndFilePos(), &aPPDrawHd ) )
- {
- sal_uInt32 nPPDrawOfs = rStCtrl.Tell();
-
- // importing the background object before importing the page
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPPDrawHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aEscherObjListHd;
- rStCtrl >> aEscherObjListHd;
- switch ( aEscherObjListHd.nRecType )
- {
- case DFF_msofbtSpContainer :
- {
- Rectangle aPageSize( Point(), pRet->GetSize() );
- if ( rSlidePersist.aSlideAtom.nFlags & 4 ) // follow master background ?
- {
- if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
- {
- sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
- PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
- PptSlidePersistEntry* pE = (*pPageList)[ nMasterNum ];
- while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
- {
- sal_uInt16 nNextMaster = pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
- if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- break;
- else
- pE = (*pPageList)[ nNextMaster ];
- }
- if ( pE->nBackgroundOffset )
- {
- // do not follow master colorscheme ?
- sal_Bool bTemporary = ( rSlidePersist.aSlideAtom.nFlags & 2 ) != 0;
- sal_uInt32 nPos = rStCtrl.Tell();
- rStCtrl.Seek( pE->nBackgroundOffset );
- rSlidePersist.pBObj = ImportObj( rStCtrl, (void*)&aProcessData, aPageSize, aPageSize );
- rSlidePersist.bBObjIsTemporary = bTemporary;
- rStCtrl.Seek( nPos );
- }
- }
- }
- else
- {
- DffRecordHeader aShapeHd;
- rStCtrl >> aShapeHd;
- if ( aShapeHd.nRecType == DFF_msofbtSp )
- {
- UINT32 nSpFlags;
- rStCtrl >> nSpFlags >> nSpFlags;
- if ( nSpFlags & SP_FBACKGROUND )
- {
- aEscherObjListHd.SeekToBegOfRecord( rStCtrl );
- rSlidePersist.pBObj = ImportObj( rStCtrl, (void*)&aProcessData, aPageSize, aPageSize );
- rSlidePersist.bBObjIsTemporary = sal_False;
- }
- }
- }
- }
- break;
- }
- if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
- break;
- aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
- }
-
- // now importing page
- rStCtrl.Seek( nPPDrawOfs );
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPPDrawHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aEscherObjListHd;
- rStCtrl >> aEscherObjListHd;
- switch ( aEscherObjListHd.nRecType )
- {
- case DFF_msofbtSpgrContainer :
- {
- DffRecordHeader aShapeHd;
- if ( SeekToRec( rStCtrl, DFF_msofbtSpContainer, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) )
- {
- aShapeHd.SeekToEndOfRecord( rStCtrl );
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aEscherObjListHd.GetRecEndFilePos() ) )
- {
- rStCtrl >> aShapeHd;
- if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) || ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
- {
- Rectangle aEmpty;
- aShapeHd.SeekToBegOfRecord( rStCtrl );
- sal_Int32 nShapeId;
- aProcessData.pTableRowProperties = NULL;
- SdrObject* pObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty, 0, &nShapeId );
- if ( pObj )
- {
- if ( aProcessData.pTableRowProperties )
- pObj = CreateTable( pObj, aProcessData.pTableRowProperties, aProcessData.rPersistEntry.pSolverContainer );
-
- pRet->NbcInsertObject( pObj );
-
- if( nShapeId )
- insertShapeId( nShapeId, pObj );
- }
- }
- aShapeHd.SeekToEndOfRecord( rStCtrl );
- }
- }
- }
- break;
- }
- if ( aEscherObjListHd.nRecType == DFF_msofbtSpgrContainer )
- break;
- aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
- }
-
- /* There are a lot of Shapes who are dependent to
- the current background color */
- if ( rSlidePersist.ePageKind == PPT_SLIDEPAGE )
- {
- List* pList2 = aProcessData.pBackgroundColoredObjects;
- if ( pList2 )
- {
- if ( rSlidePersist.pBObj )
- {
- void* pPtr;
- const SfxPoolItem* pPoolItem = NULL;
- const SfxItemSet& rObjectItemSet = rSlidePersist.pBObj->GetMergedItemSet();
-
- //SfxItemState eState = rObjectItemSet.GetItemState( XATTR_FILLCOLOR, FALSE, &pPoolItem );
- if ( pPoolItem )
- {
- SfxItemSet aNewSet(*rObjectItemSet.GetPool());
- aNewSet.Put(*pPoolItem);
- aNewSet.Put(XFillStyleItem( XFILL_SOLID ));
-
- for ( pPtr = pList2->First(); pPtr; pPtr = pList2->Next() )
- {
- ((SdrObject*)pPtr)->SetMergedItemSet(aNewSet);
- }
- }
- }
- }
- }
- if ( rSlidePersist.pBObj )
- {
- if ( rSlidePersist.bBObjIsTemporary )
- SdrObject::Free( rSlidePersist.pBObj );
- else
- pRet->SetBackgroundObj( rSlidePersist.pBObj );
- }
- }
- }
- break;
- }
- aHd.SeekToEndOfRecord( rStCtrl );
- }
- if ( rSlidePersist.pSolverContainer )
- SolveSolver( *rSlidePersist.pSolverContainer );
- if ( mbTracing )
- mpTracer->RemoveAttribute( eAktPageKind == PPT_SLIDEPAGE
- ? rtl::OUString::createFromAscii( "Page" )
- : rtl::OUString::createFromAscii( "NotesPage" ) );
- }
- rStCtrl.Seek( nMerk );
-}
-
-const PptSlideLayoutAtom* SdrPowerPointImport::GetSlideLayoutAtom() const
-{
- PptSlidePersistList* pPageList = GetPageList( eAktPageKind );
- if ( pPageList && nAktPageNum < pPageList->Count() )
- {
- PptSlidePersistEntry* pE = (*pPageList)[ nAktPageNum ];
- if ( pE )
- return &pE->aSlideAtom.aLayout;
- }
- return NULL;
-}
-
-sal_Bool SdrPowerPointImport::IsNoteOrHandout( USHORT nPageNum, PptPageKind /*ePageKind*/) const
-{
- sal_Bool bNote = eAktPageKind == PPT_NOTEPAGE;
- if ( eAktPageKind == PPT_MASTERPAGE )
- bNote = ( nPageNum & 1 ) == 0;
- return bNote;
-}
-
-UINT32 SdrPowerPointImport::GetMasterPageId( USHORT nPageNum, PptPageKind ePageKind ) const
-{
- PptSlidePersistList* pPageList = GetPageList( ePageKind );
- if ( pPageList && nPageNum < pPageList->Count() )
- return (*pPageList)[ nPageNum ]->aSlideAtom.nMasterId;
- return 0;
-}
-
-UINT32 SdrPowerPointImport::GetNotesPageId( USHORT nPageNum ) const
-{
- PptSlidePersistList* pPageList=GetPageList( PPT_SLIDEPAGE );
- if ( pPageList && nPageNum < pPageList->Count() )
- return (*pPageList)[ nPageNum ]->aSlideAtom.nNotesId;
- return 0;
-}
-
-sal_Bool SdrPowerPointImport::HasMasterPage( USHORT nPageNum, PptPageKind ePageKind ) const
-{
- if ( ePageKind == PPT_NOTEPAGE )
- return aDocAtom.nNotesMasterPersist != 0;
- if ( ePageKind == PPT_MASTERPAGE )
- return FALSE;
- return GetMasterPageId( nPageNum, ePageKind ) != 0;
-}
-
-USHORT SdrPowerPointImport::GetMasterPageIndex( USHORT nPageNum, PptPageKind ePageKind ) const
-{
- USHORT nIdx = 0;
- if ( ePageKind == PPT_NOTEPAGE )
- return 2;
- UINT32 nId = GetMasterPageId( nPageNum, ePageKind );
- if ( nId && pMasterPages )
- {
- nIdx = pMasterPages->FindPage( nId );
- if ( nIdx == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- nIdx = 0;
- }
- return nIdx;
-}
-
-SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage, sal_uInt32& nBgFileOffset, sal_Bool bForce )
-{
- SdrObject* pRet = NULL;
- sal_Bool bCreateObj = bForce;
- SfxItemSet* pSet = NULL;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
- DffRecordHeader aPageHd;
- if ( SeekToAktPage( &aPageHd ) )
- { // und nun die Hintergrundattribute der Page suchen
- ULONG nPageRecEnd = aPageHd.GetRecEndFilePos();
- DffRecordHeader aPPDrawHd;
- if ( SeekToRec( rStCtrl, PPT_PST_PPDrawing, nPageRecEnd, &aPPDrawHd ) )
- {
- ULONG nPPDrawEnd = aPPDrawHd.GetRecEndFilePos();
- DffRecordHeader aEscherF002Hd;
- if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, nPPDrawEnd, &aEscherF002Hd ) )
- {
- ULONG nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
- DffRecordHeader aEscherObjectHd;
- if ( SeekToRec( rStCtrl, DFF_msofbtSpContainer, nEscherF002End, &aEscherObjectHd ) )
- {
- nBgFileOffset = aEscherObjectHd.GetRecBegFilePos();
- //ULONG nEscherObjectEnd = aEscherObjectHd.GetRecEndFilePos();
- //DffRecordHeader aEscherPropertiesHd;
- if ( SeekToRec( rStCtrl, DFF_msofbtOPT,nEscherF002End ) )
- {
- rStCtrl >> (DffPropertyReader&)*this;
- mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
- UINT32 nColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
- pSet = new SfxItemSet( pSdrModel->GetItemPool() );
- DffObjData aObjData( aEscherObjectHd, Rectangle( 0, 0, 28000, 21000 ), 0 );
- ApplyAttributes( rStCtrl, *pSet, aObjData );
- Color aColor( MSO_CLR_ToColor( nColor ) );
- pSet->Put( XFillColorItem( String(), aColor ) );
- }
- }
- }
- }
- }
- rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- if ( bCreateObj )
- {
- if ( !pSet )
- {
- pSet = new SfxItemSet( pSdrModel->GetItemPool() );
- pSet->Put( XFillStyleItem( XFILL_NONE ) );
- }
- pSet->Put( XLineStyleItem( XLINE_NONE ) );
- Rectangle aRect( rPage.GetLftBorder(), rPage.GetUppBorder(), rPage.GetWdt()-rPage.GetRgtBorder(), rPage.GetHgt()-rPage.GetLwrBorder() );
- pRet = new SdrRectObj( aRect );
- pRet->SetModel( pSdrModel );
-
- pRet->SetMergedItemSet(*pSet);
-
- pRet->SetMarkProtect( TRUE );
- pRet->SetMoveProtect( TRUE );
- pRet->SetResizeProtect( TRUE );
- }
- delete pSet;
- return pRet;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-HeaderFooterEntry::HeaderFooterEntry( const PptSlidePersistEntry* pMPE ) :
- pMasterPersist ( pMPE ),
- nAtom ( 0 )
-{
- if ( pMPE )
- {
- HeaderFooterEntry* pMHFE = pMPE->pHeaderFooterEntry;
- if ( pMHFE )
- {
- nAtom = pMPE->pHeaderFooterEntry->nAtom;
- pPlaceholder[ 0 ] = pMHFE->pPlaceholder[ 0 ];
- pPlaceholder[ 1 ] = pMHFE->pPlaceholder[ 1 ];
- pPlaceholder[ 2 ] = pMHFE->pPlaceholder[ 2 ];
- pPlaceholder[ 3 ] = pMHFE->pPlaceholder[ 3 ];
- }
- }
-}
-
-HeaderFooterEntry::~HeaderFooterEntry()
-{
-}
-
-UINT32 HeaderFooterEntry::GetMaskForInstance( UINT32 nInstance )
-{
- UINT32 nRet = 0;
- switch ( nInstance )
- {
- case 0 : nRet = 0x07ffff; break;
- case 1 : nRet = 0x100000; break;
- case 2 : nRet = 0x200000; break;
- case 3 : nRet = 0x080000; break;
- }
- return nRet;
-}
-
-UINT32 HeaderFooterEntry::IsToDisplay( UINT32 nInstance )
-{
- UINT32 nMask = 0;
- switch ( nInstance )
- {
- case 0 : nMask = 0x010000; break;
- case 1 : nMask = 0x100000; break;
- case 2 : nMask = 0x200000; break;
- case 3 : nMask = 0x080000; break;
- }
- return ( nAtom & nMask );
-}
-
-// The following method checks if the slide is using a different colorscheme than
-// its master, if this is the fact, then the HeaderFooter must probably be
-// imported as real sdrobject. In this case, the return value is the offset to the
-// master header footer object, so it can be re-loaded with a different color set
-sal_uInt32 HeaderFooterEntry::NeedToImportInstance( const sal_uInt32 nInstance, const PptSlidePersistEntry& rSlidePersist )
-{
- sal_uInt32 nRet = 0;
- if ( pMasterPersist )
- {
- if ( !( rSlidePersist.aSlideAtom.nFlags & 2 ) )
- { // not following the master persist, so we have to check if the colors are changed
- if ( memcmp( &rSlidePersist.aColorScheme, &pMasterPersist->aColorScheme, 32 ) )
- {
- nRet = pMasterPersist->HeaderFooterOfs[ nInstance ];
- }
- }
- }
- return nRet;
-}
-
-void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderFooterEntry& rE )
-{
- rHd.SeekToContent( rStCtrl );
- while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < rHd.GetRecEndFilePos() ) )
- {
- DffRecordHeader aHd;
- rStCtrl >> aHd;
- switch ( aHd.nRecType )
- {
- case PPT_PST_HeadersFootersAtom :
- rStCtrl >> rE.nAtom;
- break;
-
- case PPT_PST_CString :
- {
- if ( aHd.nRecInstance < 4 )
- MSDFFReadZString( rStCtrl, rE.pPlaceholder[ aHd.nRecInstance ], aHd.nRecLen, TRUE );
- }
- break;
- }
- aHd.SeekToEndOfRecord( rStCtrl );
- }
-}
-
-//static sal_Unicode PPTExportMapper( sal_Unicode nUni, BOOL& bNeedsStarBats )
-//{
-// bNeedsStarBats = FALSE;
-//
-// sal_Unicode cLo, cReplace;
-// cLo = cReplace = 0;
-// switch ( nUni )
-// {
-// case 132 : cLo = 175; break;
-// case 147 : cLo = 174; break;
-// // Currency
-// case 0x00A2: cReplace = 224; break;
-// case 0x00A4: cReplace = 225; break;
-// case 0x00A5: cReplace = 226; break;
-// case 0x20A1: cReplace = 228; break;
-// case 0x20A2: cReplace = 229; break;
-// case 0x20A3: cReplace = 230; break;
-// case 0x20A4: cReplace = 231; break;
-// case 0x20A7: cReplace = 227; break;
-// case 0x20A8: cReplace = 234; break;
-// case 0x20A9: cReplace = 232; break;
-// case 0x20AB: cReplace = 233; break;
-// case 0x20AC: cReplace = 128; break;
-// // Punctuation and other
-// case 0x201A: cReplace = 130; break; // SINGLE LOW-9 QUOTATION MARK
-// case 0x0192: cReplace = 131; break; // LATIN SMALL LETTER F WITH HOOK
-// case 0x201E: // DOUBLE LOW-9 QUOTATION MARK
-// case 0x301F: // LOW DOUBLE PRIME QUOTATION MARK
-// cReplace = 132; break;
-// case 0x2026: cReplace = 133; break; // HORIZONTAL ELLIPSES
-// case 0x2020: cReplace = 134; break; // DAGGER
-// case 0x2021: cReplace = 135; break; // DOUBLE DAGGER
-// case 0x02C6: cReplace = 136; break; // MODIFIER LETTER CIRCUMFLEX ACCENT
-// case 0x2030: cReplace = 137; break; // PER MILLE SIGN
-// case 0x0160: cReplace = 138; break; // LATIN CAPITAL LETTER S WITH CARON
-// case 0x2039: cReplace = 139; break; // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
-// case 0x0152: cReplace = 140; break; // LATIN CAPITAL LIGATURE OE
-// case 0x017D: cReplace = 142; break; // LATIN CAPITAL LETTER Z WITH CARON
-// case 0x2018: // LEFT SINGLE QUOTATION MARK
-// case 0x02BB: // MODIFIER LETTER TURNED COMMA
-// cReplace = 145; break;
-// case 0x2019: // RIGHT SINGLE QUOTATION MARK
-// case 0x02BC: // MODIFIER LETTER APOSTROPHE
-// cReplace = 146; break;
-// case 0x201C: // LEFT DOUBLE QUOTATION MARK
-// case 0x301D: // REVERSED DOUBLE PRIME QUOTATION MARK
-// cReplace = 147; break;
-// case 0x201D: // RIGHT DOUBLE QUOTATION MARK
-// case 0x301E: // REVERSED DOUBLE PRIME QUOTATION MARK
-// cReplace = 148; break;
-// case 0x2022: cReplace = 149; break; // BULLET
-// case 0x2013: cReplace = 150; break; // EN DASH
-// case 0x2014: cReplace = 151; break; // EM DASH
-// case 0x02DC: cReplace = 152; break; // SMALL TILDE
-// case 0x2122: cReplace = 153; break; // TRADE MARK SIGN
-// case 0x0161: cReplace = 154; break; // LATIN SMALL LETTER S WITH CARON
-// case 0x203A: cReplace = 155; break; // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
-// case 0x0153: cReplace = 156; break; // LATIN SMALL LIGATURE OE
-// case 0x017E: cReplace = 158; break; // LATIN SMALL LETTER Z WITH CARON
-// case 0x0178: cReplace = 159; break; // LATIN CAPITAL LETTER Y WITH DIAERESIS
-// case 0x00B6: cReplace = 222; break; // PILCROW SIGN / PARAGRAPH SIGN
-// }
-// if ( cReplace )
-// {
-// bNeedsStarBats = TRUE;
-// return cReplace;
-// }
-// else
-// return cLo;
-//}
-
-// no longer needed
-sal_Unicode SdrPowerPointImport::PPTSubstitute( UINT16 /*nFont*/, sal_Unicode /*nChar*/,
- UINT32& /*nMappedFontId*/, Font& /*rFont*/, char /*nDefault*/) const
-{
- return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTBuGraEntry::PPTBuGraEntry( Graphic& rGraphic, UINT32 nInst ) :
- nInstance ( nInst ),
- aBuGra ( rGraphic ) {}
-
-PPTExtParaLevel::PPTExtParaLevel()
-: mnExtParagraphMask( 0 )
-, mnBuBlip( 0xffff )
-, mnHasAnm( 0 )
-, mnAnmScheme( 0 )
-, mpfPP10Ext( 0 )
-, mnExtCharacterMask( 0 )
-, mcfPP10Ext( 0 )
-, mbSet( sal_False )
-{}
-
-SvStream& operator>>( SvStream& rIn, PPTExtParaLevel& rLevel )
-{
- rLevel.mbSet = TRUE;
- rIn >> rLevel.mnExtParagraphMask;
- if ( rLevel.mnExtParagraphMask & 0x00800000 )
- rIn >> rLevel.mnBuBlip;
- if ( rLevel.mnExtParagraphMask & 0x02000000 )
- rIn >> rLevel.mnHasAnm;
- if ( rLevel.mnExtParagraphMask & 0x01000000 )
- rIn >> rLevel.mnAnmScheme;
- if ( rLevel.mnExtParagraphMask & 0x04000000 )
- rIn >> rLevel.mpfPP10Ext;
- rIn >> rLevel.mnExtCharacterMask;
- if ( rLevel.mnExtCharacterMask & 0x100000 )
- rIn >> rLevel.mcfPP10Ext;
- return rIn;
-}
-
-BOOL PPTExtParaProv::GetGraphic( UINT32 nInstance, Graphic& rGraph ) const
-{
- BOOL bRetValue = FALSE;
- PPTBuGraEntry* pPtr = NULL;
- if ( nInstance < aBuGraList.Count() )
- {
- pPtr = (PPTBuGraEntry*)aBuGraList.GetObject( nInstance );
- if ( pPtr->nInstance == nInstance )
- bRetValue = TRUE;
- }
- if ( !bRetValue )
- {
- sal_uInt32 i;
- for ( i = 0; i < aBuGraList.Count(); i++ )
- {
- pPtr = (PPTBuGraEntry*)aBuGraList.GetObject( i );
- if ( pPtr->nInstance == nInstance )
- {
- bRetValue = TRUE;
- break;
- }
- }
- }
- if ( bRetValue )
- rGraph = pPtr->aBuGra;
- return bRetValue;
-}
-
-PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const DffRecordHeader* pHd ) :
- bStyles ( FALSE ),
- bGraphics ( FALSE )
-{
- UINT32 nOldPos = rSt.Tell();
-
- // here we have to get the graphical bullets...
-
- DffRecordHeader aHd;
- DffRecordHeader aContentDataHd;
-
- const DffRecordHeader* pListHd = rMan.aDocRecManager.GetRecordHeader( PPT_PST_List, SEEK_FROM_BEGINNING );
- while( pListHd )
- {
- pListHd->SeekToContent( rSt );
- if ( !rMan.SeekToContentOfProgTag( 9, rSt, *pListHd, aContentDataHd ) )
- break;
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aContentDataHd.GetRecEndFilePos() ) )
- {
- rSt >> aHd;
- switch ( aHd.nRecType )
- {
- case PPT_PST_ExtendedBuGraContainer :
- {
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aHd.GetRecEndFilePos() ) )
- {
- UINT16 nType;
- DffRecordHeader aBuGraAtomHd;
- rSt >> aBuGraAtomHd;
- if ( aBuGraAtomHd.nRecType == PPT_PST_ExtendedBuGraAtom )
- {
- rSt >> nType;
- Graphic aGraphic;
- if ( rMan.GetBLIPDirect( rSt, aGraphic, NULL ) )
- {
- UINT32 nInstance = aBuGraAtomHd.nRecInstance;
- PPTBuGraEntry* pBuGra = new PPTBuGraEntry( aGraphic, nInstance );
- UINT32 n = 0;
- UINT32 nBuGraCount = aBuGraList.Count();
- if ( nBuGraCount )
- {
- if ( ( (PPTBuGraEntry*)aBuGraList.GetObject( nBuGraCount - 1 ) )->nInstance < nInstance )
- n = nBuGraCount;
- else
- { // maybe the instances are not sorted, we sort it
- for ( n = 0; n < nBuGraCount; n++ )
- { // sorting fields ( hi >> lo )
- if ( ( (PPTBuGraEntry*)aBuGraList.GetObject( n ) )->nInstance < nInstance )
- break;
- }
- }
- }
- aBuGraList.Insert( pBuGra, (UINT32)n );
- }
-#ifdef DBG_UTIL
- else DBG_ERROR( "PPTExParaProv::PPTExParaProv - bullet graphic is not valid (SJ)" );
-#endif
- }
-#ifdef DBG_UTIL
- else DBG_ERROR( "PPTExParaProv::PPTExParaProv - unknown atom interpreting the PPT_PST_ExtendedBuGraContainer (SJ)" );
-#endif
- aBuGraAtomHd.SeekToEndOfRecord( rSt );
- }
- if ( aBuGraList.Count() )
- bGraphics = TRUE;
- }
- break;
-
- case PPT_PST_ExtendedPresRuleContainer :
- aExtendedPresRules.Consume( rSt, FALSE, aHd.GetRecEndFilePos() );
- break;
-#ifdef DBG_UTIL
- default :
- DBG_ERROR( "PPTExParaProv::PPTExParaProv - unknown atom reading ppt2000 num rules (SJ)" );
- case PPT_PST_MasterText : // first seen in: ms-tt02.ppt
- case PPT_PST_SrKinsoku :
- case PPT_PST_NewlyAddedAtom4016 :
- case PPT_PST_NewlyAddedAtomByPPT2000_6010 :
- case PPT_PST_NewlyAddedAtomByPPT2000_6011 :
- case PPT_PST_NewlyAddedAtomByXP1037 :
- case PPT_PST_NewlyAddedAtomByXP12004 :
- case PPT_PST_NewlyAddedAtomByXP14001 :
- break;
-#endif
- }
- aHd.SeekToEndOfRecord( rSt );
- }
- break;
- }
-
- while( pHd )
- { // get the extended paragraph styles on mainmaster ( graphical bullets, num ruling ... )
- if ( !rMan.SeekToContentOfProgTag( 9, rSt, *pHd, aContentDataHd ) )
- break;
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aContentDataHd.GetRecEndFilePos() ) )
- {
- rSt >> aHd;
- switch ( aHd.nRecType )
- {
- case PPT_PST_ExtendedParagraphMasterAtom :
- {
- if ( aHd.nRecInstance < PPT_STYLESHEETENTRYS )
- {
- UINT16 nDepth, i = 0;
- rSt >> nDepth;
- if ( i <= 5 )
- {
-
- while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aHd.GetRecEndFilePos() ) && ( i < nDepth ) )
- {
- bStyles = TRUE;
- rSt >> aExtParaSheet[ aHd.nRecInstance ].aExtParaLevel[ i++ ];
- }
-#ifdef DBG_UTIL
- if ( rSt.Tell() != aHd.GetRecEndFilePos() )
- DBG_ERROR( "PPTExParaProv::PPTExParaProv - error reading PPT_PST_ExtendedParagraphMasterAtom (SJ)" );
-#endif
- }
-#ifdef DBG_UTIL
- else DBG_ERROR( "PPTExParaProv::PPTExParaProv - depth is greater than 5 (SJ)" );
-#endif
- }
-#ifdef DBG_UTIL
- else DBG_ERROR( "PPTExParaProv::PPTExParaProv - instance out of range (SJ)" );
-#endif
- }
- break;
- default :
- DBG_ERROR( "PPTExParaProv::PPTExParaProv - unknown atom, assuming PPT_PST_ExtendedParagraphMasterAtom (SJ)" );
- case PPT_PST_NewlyAddedAtomByXP11008 :
- case PPT_PST_NewlyAddedAtomByXP11010 :
- case PPT_PST_NewlyAddedAtomByXP12010 :
- case PPT_PST_NewlyAddedAtomByXP12011 :
- case 0xf144 :
- break;
- }
- aHd.SeekToEndOfRecord( rSt );
- }
- break;
- }
- rSt.Seek( nOldPos );
-}
-
-PPTExtParaProv::~PPTExtParaProv()
-{
- void* pPtr;
- for ( pPtr = aBuGraList.First(); pPtr; pPtr = aBuGraList.Next() )
- delete (PPTBuGraEntry*)pPtr;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTNumberFormatCreator::PPTNumberFormatCreator( PPTExtParaProv* pParaProv ) :
- pExtParaProv ( pParaProv )
-{
-}
-
-PPTNumberFormatCreator::~PPTNumberFormatCreator()
-{
- delete pExtParaProv;
-}
-
-BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManager,
- SvxNumberFormat& rNumberFormat, UINT32 nLevel, UINT32 nInstance, UINT32 nDestinationInstance,
- boost::optional< sal_Int16 >& rStartNumbering, UINT32 nFontHeight, PPTParagraphObj* pPara )
-{
- BOOL bHardAttribute = ( nDestinationInstance == 0xffffffff );
-
- UINT32 nBuFlags = 0;
- UINT16 nHasAnm = 0;
- UINT32 nAnmScheme = 0x10003;
- UINT16 nBuBlip = 0xffff;
-
- const PPTExtParaProv* pParaProv = pExtParaProv;
- if ( !pExtParaProv )
- pParaProv = ( pPara ) ? pPara->mrStyleSheet.pExtParaProv
- : rManager.pPPTStyleSheet->pExtParaProv;
- if ( pPara )
- {
- nBuFlags = pPara->pParaSet->mnExtParagraphMask;
- if ( nBuFlags )
- {
- if ( nBuFlags & 0x00800000 )
- nBuBlip = pPara->pParaSet->mnBuBlip;
- if ( nBuFlags & 0x01000000 )
- nAnmScheme = pPara->pParaSet->mnAnmScheme;
- if ( nBuFlags & 0x02000000 )
- nHasAnm = pPara->pParaSet->mnHasAnm;
- bHardAttribute = TRUE;
- }
- }
-
- if ( ( nBuFlags & 0x03800000 ) != 0x03800000 ) // merge style sheet
- { // we have to read the master attributes
- if ( pParaProv && ( nLevel < 5 ) )
- {
- if ( pParaProv->bStyles )
- {
- const PPTExtParaLevel& rLev = pParaProv->aExtParaSheet[ nInstance ].aExtParaLevel[ nLevel ];
- if ( rLev.mbSet )
- {
- UINT32 nMaBuFlags = rLev.mnExtParagraphMask;
-
- if ( (!( nBuFlags & 0x00800000)) && ( nMaBuFlags & 0x00800000 ) )
- {
- if (!( nBuFlags & 0x02000000)) // if there is a BuStart without BuInstance,
- nBuBlip = rLev.mnBuBlip; // then there is no graphical Bullet possible
- }
- if ( (!( nBuFlags & 0x01000000)) && ( nMaBuFlags & 0x01000000 ) )
- nAnmScheme = rLev.mnAnmScheme;
- if ( (!( nBuFlags & 0x02000000)) && ( nMaBuFlags & 0x02000000 ) )
- nHasAnm = rLev.mnHasAnm;
- nBuFlags |= nMaBuFlags;
- }
- }
- }
- }
- if ( nBuBlip != 0xffff ) // set graphical bullet
- {
- Graphic aGraphic;
- if ( pParaProv->GetGraphic( nBuBlip, aGraphic ) )
- {
- SvxBrushItem aBrush( aGraphic, GPOS_MM, SID_ATTR_BRUSH );
- rNumberFormat.SetGraphicBrush( &aBrush );
- sal_uInt32 nHeight = (sal_uInt32)( (double)nFontHeight * 0.2540 * nBulletHeight + 0.5 );
- Size aPrefSize( aGraphic.GetPrefSize() );
- UINT32 nWidth = ( nHeight * aPrefSize.Width() ) / aPrefSize.Height();
- rNumberFormat.SetGraphicSize( Size( nWidth, nHeight ) );
- rNumberFormat.SetNumberingType ( SVX_NUM_BITMAP );
- }
- }
- else if ( nHasAnm )
- {
- switch( static_cast< sal_uInt16 >( nAnmScheme ) )
- {
- default :
- case 0 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_CHARS_LOWER_LETTER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( "." ) ) );
- }
- break;
- case 1 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_CHARS_UPPER_LETTER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( "." ) ) );
- }
- break;
- case 2 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ARABIC );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- }
- break;
- case 3 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ARABIC );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( "." ) ) );
- }
- break;
- case 4 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ROMAN_LOWER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- rNumberFormat.SetPrefix( String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) );
- }
- break;
- case 5 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ROMAN_LOWER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- }
- break;
- case 6 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ROMAN_LOWER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( "." ) ) );
- }
- break;
- case 7 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ROMAN_UPPER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( "." ) ) );
- }
- break;
- case 8 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_CHARS_LOWER_LETTER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- rNumberFormat.SetPrefix( String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) );
- }
- break;
- case 9 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_CHARS_LOWER_LETTER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- }
- break;
- case 10 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_CHARS_UPPER_LETTER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- rNumberFormat.SetPrefix( String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) );
- }
- break;
- case 11 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_CHARS_UPPER_LETTER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- }
- break;
- case 12 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ARABIC );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- rNumberFormat.SetPrefix( String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) );
- }
- break;
- case 13 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ARABIC );
- }
- break;
- case 14 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ROMAN_UPPER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- rNumberFormat.SetPrefix( String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) );
- }
- break;
- case 15 :
- {
- rNumberFormat.SetNumberingType( SVX_NUM_ROMAN_UPPER );
- rNumberFormat.SetSuffix( String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) );
- }
- break;
- }
- rStartNumbering = boost::optional< sal_Int16 >( nAnmScheme >> 16 );
- }
- return bHardAttribute;
-}
-
-void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, UINT32 nLevel, const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, UINT32 nInstance )
-{
- nIsBullet = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn ) ) != 0 ? 1 : 0;
- nBulletChar = rParaLevel.mnBulletChar;
-
- sal_Bool bBuHardFont;
- bBuHardFont = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0;
- if ( bBuHardFont )
- nBulletFont = rParaLevel.mnBulletFont;
- else
- nBulletFont = rCharLevel.mnFont;
- nBulletHeight = rParaLevel.mnBulletHeight;
- nBulletColor = rParaLevel.mnBulletColor;
- nTextOfs = rParaLevel.mnTextOfs;
- nBulletOfs = rParaLevel.mnBulletOfs;
-
- boost::optional< sal_Int16 > oStartNumbering;
- ImplGetExtNumberFormat( rManager, rNumberFormat, nLevel, nInstance, 0xffffffff, oStartNumbering, rCharLevel.mnFontHeight, NULL );
- if ( ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP ) && ( nBulletHeight > 0x7fff ) )
- nBulletHeight = rCharLevel.mnFontHeight ? ((-((sal_Int16)nBulletHeight)) * 100 ) / rCharLevel.mnFontHeight : 100;
- ImplGetNumberFormat( rManager, rNumberFormat, nLevel );
- switch ( rNumberFormat.GetNumberingType() )
- {
- case SVX_NUM_CHARS_UPPER_LETTER :
- case SVX_NUM_CHARS_LOWER_LETTER :
- case SVX_NUM_ROMAN_UPPER :
- case SVX_NUM_ROMAN_LOWER :
- case SVX_NUM_ARABIC :
- case SVX_NUM_CHARS_UPPER_LETTER_N :
- case SVX_NUM_CHARS_LOWER_LETTER_N :
- {
- sal_uInt32 nFont = rCharLevel.mnFont;
- PptFontEntityAtom* pFontEnityAtom = rManager.GetFontEnityAtom( nFont );
- if ( pFontEnityAtom )
- {
- Font aFont;
- aFont.SetCharSet( pFontEnityAtom->eCharSet );
- aFont.SetName( pFontEnityAtom->aName );
- aFont.SetFamily( pFontEnityAtom->eFamily );
- aFont.SetPitch( pFontEnityAtom->ePitch );
- rNumberFormat.SetBulletFont( &aFont );
- }
- }
- break;
- }
-}
-
-BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, PPTParagraphObj* pParaObj,
- UINT32 nDestinationInstance, boost::optional< sal_Int16 >& rStartNumbering )
-{
- UINT32 nHardCount = 0;
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet, nDestinationInstance );
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletChar, nBulletChar, nDestinationInstance );
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletFont, nBulletFont, nDestinationInstance );
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletHeight, nBulletHeight, nDestinationInstance );
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletColor, nBulletColor, nDestinationInstance );
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_TextOfs, nTextOfs, nDestinationInstance );
- nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOfs, nBulletOfs, nDestinationInstance );
-
- if ( nIsBullet )
- rNumberFormat.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
-
- UINT32 nFontHeight = 24;
- PPTPortionObj* pPtr = pParaObj->First();
- if ( pPtr )
- pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
- if ( nIsBullet )
- nHardCount += ImplGetExtNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth,
- pParaObj->mnInstance, nDestinationInstance, rStartNumbering, nFontHeight, pParaObj );
-
- if ( rNumberFormat.GetNumberingType() != SVX_NUM_BITMAP )
- pParaObj->UpdateBulletRelSize( nBulletHeight );
- if ( nHardCount )
- ImplGetNumberFormat( rManager, rNumberFormat, pParaObj->pParaSet->mnDepth );
-
- if ( nHardCount )
- {
- switch ( rNumberFormat.GetNumberingType() )
- {
- case SVX_NUM_CHARS_UPPER_LETTER :
- case SVX_NUM_CHARS_LOWER_LETTER :
- case SVX_NUM_ROMAN_UPPER :
- case SVX_NUM_ROMAN_LOWER :
- case SVX_NUM_ARABIC :
- case SVX_NUM_CHARS_UPPER_LETTER_N :
- case SVX_NUM_CHARS_LOWER_LETTER_N :
- {
- if ( pPtr )
- {
- sal_uInt32 nFont;
- pPtr->GetAttrib( PPT_CharAttr_Font, nFont, nDestinationInstance );
- PptFontEntityAtom* pFontEnityAtom = rManager.GetFontEnityAtom( nFont );
- if ( pFontEnityAtom )
- {
- Font aFont;
- aFont.SetCharSet( pFontEnityAtom->eCharSet );
- aFont.SetName( pFontEnityAtom->aName );
- aFont.SetFamily( pFontEnityAtom->eFamily );
- aFont.SetPitch( pFontEnityAtom->ePitch );
- rNumberFormat.SetBulletFont( &aFont );
- }
- }
- }
- break;
- }
- }
- return ( nHardCount ) ? TRUE : FALSE;
-}
-
-void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, UINT32 /*nLevel*/)
-{
- Font aFont;
- PptFontEntityAtom* pAtom = rManager.GetFontEnityAtom( nBulletFont );
- if ( pAtom )
- {
- CharSet eCharSet( pAtom->eCharSet );
- aFont.SetName( pAtom->aName );
- aFont.SetCharSet( eCharSet );
- aFont.SetFamily( pAtom->eFamily );
- aFont.SetPitch( pAtom->ePitch );
- }
- Color aCol( rManager.MSO_TEXT_CLR_ToColor( nBulletColor ) );
- aFont.SetColor( aCol );
-
- sal_uInt16 nBuChar = (sal_uInt16)nBulletChar;
- if ( aFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
- {
- nBuChar &= 0x00ff;
- nBuChar |= 0xf000;
- }
- rNumberFormat.SetBulletFont( &aFont );
- rNumberFormat.SetBulletChar( nBuChar );
- rNumberFormat.SetBulletRelSize( (UINT16)nBulletHeight );
- rNumberFormat.SetBulletColor( aCol );
- UINT16 nAbsLSpace = (UINT16)( ( (UINT32)nTextOfs * 2540 ) / 576 );
- UINT16 nFirstLineOffset = nAbsLSpace - (UINT16)( ( (UINT32)nBulletOfs * 2540 ) / 576 );
- rNumberFormat.SetAbsLSpace( nAbsLSpace );
- rNumberFormat.SetFirstLineOffset( -nFirstLineOffset );
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTCharSheet::PPTCharSheet( UINT32 nInstance )
-{
- UINT32 nColor = PPT_COLSCHEME_TEXT_UND_ZEILEN;
- UINT16 nFontHeight(0);
- switch ( nInstance )
- {
- case TSS_TYPE_PAGETITLE :
- case TSS_TYPE_TITLE :
- {
- nColor = PPT_COLSCHEME_TITELTEXT;
- nFontHeight = 44;
- }
- break;
- case TSS_TYPE_BODY :
- case TSS_TYPE_SUBTITLE :
- case TSS_TYPE_HALFBODY :
- case TSS_TYPE_QUARTERBODY :
- nFontHeight = 32;
- break;
- case TSS_TYPE_NOTES :
- nFontHeight = 12;
- break;
- case TSS_TYPE_UNUSED :
- case TSS_TYPE_TEXT_IN_SHAPE :
- nFontHeight = 24;
- break;
- }
- for ( UINT32 nDepth = 0; nDepth < 5; nDepth++ )
- {
- maCharLevel[ nDepth ].mnFlags = 0;
- maCharLevel[ nDepth ].mnFont = 0;
- maCharLevel[ nDepth ].mnAsianOrComplexFont = 0xffff;
- maCharLevel[ nDepth ].mnFontHeight = nFontHeight;
- maCharLevel[ nDepth ].mnFontColor = nColor;
- maCharLevel[ nDepth ].mnFontColorInStyleSheet = Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) );
- maCharLevel[ nDepth ].mnEscapement = 0;
- }
-}
-
-PPTCharSheet::PPTCharSheet( const PPTCharSheet& rAttr )
-{
- *this = rAttr;
-}
-
-void PPTCharSheet::Read( SvStream& rIn, sal_Bool /*bMasterStyle*/, sal_uInt32 nLevel, sal_Bool /*bFirst*/)
-{
- // Zeichenattribute
- sal_uInt32 nCMask;
- sal_uInt16 nVal16;
- rIn >> nCMask;
-
- if ( nCMask & 0x0000FFFF )
- {
- sal_uInt16 nBitAttr;
- maCharLevel[ nLevel ].mnFlags &= ~( (sal_uInt16)nCMask );
- rIn >> nBitAttr; // Bit-Attribute (Fett, Unterstrichen, ...)
- maCharLevel[ nLevel ].mnFlags |= nBitAttr;
- }
- if ( nCMask & ( 1 << PPT_CharAttr_Font ) ) // 0x00010000
- rIn >> maCharLevel[ nLevel ].mnFont;
- if ( nCMask & ( 1 << PPT_CharAttr_AsianOrComplexFont ) ) // 0x00200000
- rIn >> maCharLevel[ nLevel ].mnAsianOrComplexFont;
- if ( nCMask & ( 1 << PPT_CharAttr_ANSITypeface ) ) // 0x00400000
- rIn >> nVal16;
- if ( nCMask & ( 1 << PPT_CharAttr_Symbol ) ) // 0x00800000
- rIn >> nVal16;
- if ( nCMask & ( 1 << PPT_CharAttr_FontHeight ) ) // 0x00020000
- rIn >> maCharLevel[ nLevel ].mnFontHeight;
- if ( nCMask & ( 1 << PPT_CharAttr_FontColor ) ) // 0x00040000
- {
- rIn >> maCharLevel[ nLevel ].mnFontColor;
- if( ! (maCharLevel[ nLevel ].mnFontColor & 0xff000000 ) )
- maCharLevel[ nLevel ].mnFontColor = PPT_COLSCHEME_HINTERGRUND;
- }
- if ( nCMask & ( 1 << PPT_CharAttr_Escapement ) ) // 0x00080000
- rIn >> maCharLevel[ nLevel ].mnEscapement;
- if ( nCMask & 0x00100000 ) // 0x00100000
- rIn >> nVal16;
-
- nCMask >>= 24;
- while( nCMask )
- {
- if ( nCMask & 1 )
- {
- DBG_ERROR( "PPTCharSheet::Read - unknown attribute, send me this document (SJ)" );
- rIn >> nVal16;
- }
- nCMask >>= 1;
- }
-}
-
-PPTParaSheet::PPTParaSheet( UINT32 nInstance )
-{
- sal_uInt16 nBuFlags = 0;
- sal_uInt32 nBulletColor = 0x8000000;
- sal_uInt16 nUpperDist = 0;
-
- switch ( nInstance )
- {
- case TSS_TYPE_PAGETITLE :
- case TSS_TYPE_TITLE :
- nBulletColor = PPT_COLSCHEME_TITELTEXT;
- break;
- case TSS_TYPE_BODY :
- case TSS_TYPE_SUBTITLE :
- case TSS_TYPE_HALFBODY :
- case TSS_TYPE_QUARTERBODY :
- {
- nBuFlags = 1;
- nUpperDist = 0x14;
- }
- break;
- case TSS_TYPE_NOTES :
- nUpperDist = 0x1e;
- break;
-/*
- default :
- case TSS_TYPE_UNUSED :
- case TSS_TYPE_TEXT_IN_SHAPE :
- break;
-*/
- }
- for ( UINT32 i = 0; i < 5; i++ )
- {
- maParaLevel[ i ].mnBuFlags = nBuFlags;
- maParaLevel[ i ].mnBulletChar = 0x2022;
- maParaLevel[ i ].mnBulletFont = 0;
- maParaLevel[ i ].mnBulletHeight = 100;
- maParaLevel[ i ].mnBulletColor = nBulletColor;
- maParaLevel[ i ].mnAdjust = 0;
- maParaLevel[ i ].mnLineFeed = 100;
- maParaLevel[ i ].mnLowerDist = 0;
- maParaLevel[ i ].mnUpperDist = nUpperDist;
- maParaLevel[ i ].mnTextOfs = 0;
- maParaLevel[ i ].mnBulletOfs = 0;
- maParaLevel[ i ].mnDefaultTab = 0x240;
- maParaLevel[ i ].mnAsianLineBreak = 0;
- maParaLevel[ i ].mnBiDi = 0;
- }
-}
-
-PPTParaSheet::PPTParaSheet( const PPTParaSheet& rSheet )
-{
- *this = rSheet;
-}
-
-void PPTParaSheet::Read( SdrPowerPointImport&
-#ifdef DBG_UTIL
- rManager
-#endif
- , SvStream& rIn, sal_Bool /*bMasterStyle*/,
- sal_uInt32 nLevel, sal_Bool bFirst )
-{
- // Absatzattribute
- sal_uInt16 nVal16, i, nMask16;
- sal_uInt32 nVal32, nPMask;
- rIn >> nPMask;
-
- nMask16 = (sal_uInt16)nPMask & 0xf;
- if ( nMask16 )
- {
- rIn >> nVal16;
- maParaLevel[ nLevel ].mnBuFlags &=~ nMask16;
- nVal16 &= nMask16;
- maParaLevel[ nLevel ].mnBuFlags |= nVal16;
- }
- if ( nPMask & 0x0080 )
- rIn >> maParaLevel[ nLevel ].mnBulletChar;
- if ( nPMask & 0x0010 )
- rIn >> maParaLevel[ nLevel ].mnBulletFont;
- if ( nPMask & 0x0040 )
- {
- rIn >> nVal16;
- maParaLevel[ nLevel ].mnBulletHeight = nVal16;
- }
- if ( nPMask & 0x0020 )
- {
- rIn >> nVal32;
- maParaLevel[ nLevel ].mnBulletColor = nVal32;
- }
- if ( bFirst )
- {
- if ( nPMask & 0xF00 )
- { // AbsJust!
- rIn >> nVal16;
- maParaLevel[ nLevel ].mnAdjust = nVal16 & 3;
- }
- if ( nPMask & 0x1000 )
- rIn >> maParaLevel[ nLevel ].mnLineFeed;
- if ( nPMask & 0x2000 )
- rIn >> maParaLevel[ nLevel ].mnUpperDist;
- if ( nPMask & 0x4000 )
- rIn >> maParaLevel[ nLevel ].mnLowerDist;
- if ( nPMask & 0x8000 )
- rIn >> maParaLevel[ nLevel ].mnTextOfs;
- if ( nPMask & 0x10000 )
- rIn >> maParaLevel[ nLevel ].mnBulletOfs;
- if ( nPMask & 0x20000 )
- rIn >> maParaLevel[ nLevel ].mnDefaultTab;
- if ( nPMask & 0x200000 )
- {
- // number of tabulators
- rIn >> nVal16;
- for ( i = 0; i < nVal16; i++ )
- rIn >> nVal32; // reading the tabulators
- }
- if ( nPMask & 0x40000 )
- rIn >> nVal16;
- if ( nPMask & 0x80000 )
- rIn >> maParaLevel[ nLevel ].mnAsianLineBreak;
- if ( nPMask & 0x100000 )
- rIn >> maParaLevel[ nLevel ].mnBiDi;
- }
- else
- {
- if ( nPMask & 0x800 )
- {
- rIn >> nVal16;
- maParaLevel[ nLevel ].mnAdjust = nVal16 & 3;
- }
- if ( nPMask & 0x1000 )
- rIn >> maParaLevel[ nLevel ].mnLineFeed;
- if ( nPMask & 0x2000 )
- rIn >> maParaLevel[ nLevel ].mnUpperDist;
- if ( nPMask & 0x4000 )
- rIn >> maParaLevel[ nLevel ].mnLowerDist;
- if ( nPMask & 0x8000 )
- rIn >> nVal16;
- if ( nPMask & 0x100 )
- rIn >> maParaLevel[ nLevel ].mnTextOfs;
- if ( nPMask & 0x200 )
- rIn >> nVal16;
- if ( nPMask & 0x400 )
- rIn >> maParaLevel[ nLevel ].mnBulletOfs;
- if ( nPMask & 0x10000 )
- rIn >> nVal16;
- if ( nPMask & 0xe0000 )
- {
- sal_uInt16 nFlagsToModifyMask = (sal_uInt16)( ( nPMask >> 17 ) & 7 );
- rIn >> nVal16;
- // bits that are not involved to zero
- nVal16 &= nFlagsToModifyMask;
- // bits that are to change to zero
- maParaLevel[ nLevel ].mnAsianLineBreak &=~nFlagsToModifyMask;
- // now set the corresponding bits
- maParaLevel[ nLevel ].mnAsianLineBreak |= nVal16;
- }
- if ( nPMask & 0x100000 )
- {
- // number of tabulators
- rIn >> nVal16;
- for ( i = 0; i < nVal16; i++ )
- rIn >> nVal32; // reading the tabulators
- }
- if ( nPMask & 0x200000 )
- rIn >> maParaLevel[ nLevel ].mnBiDi; // #88602#
- }
-
- nPMask >>= 22;
- while( nPMask )
- {
- if ( nPMask & 1 )
- {
-#ifdef DBG_UTIL
- if (!(rManager.rImportParam.nImportFlags & PPT_IMPORTFLAGS_NO_TEXT_ASSERT))
- {
- DBG_ERROR( "PPTParaSheet::Read - unknown attribute, send me this document (SJ)" );
- }
-#endif
- rIn >> nVal16;
- }
- nPMask >>= 1;
- }
-}
-
-PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, SdrPowerPointImport& rManager,
- const PPTTextCharacterStyleAtomInterpreter& /*rTxCFStyle*/, const PPTTextParagraphStyleAtomInterpreter& rTxPFStyle,
- const PPTTextSpecInfo& rTextSpecInfo ) :
-
- PPTNumberFormatCreator ( new PPTExtParaProv( rManager, rIn, &rSlideHd ) ),
- maTxSI ( rTextSpecInfo )
-{
- UINT32 i;
- UINT32 nOldFilePos = rIn.Tell();
-
- // default stylesheets
- mpCharSheet[ TSS_TYPE_PAGETITLE ] = new PPTCharSheet( TSS_TYPE_PAGETITLE );
- mpCharSheet[ TSS_TYPE_BODY ] = new PPTCharSheet( TSS_TYPE_BODY );
- mpCharSheet[ TSS_TYPE_NOTES ] = new PPTCharSheet( TSS_TYPE_NOTES );
- mpCharSheet[ TSS_TYPE_UNUSED ] = new PPTCharSheet( TSS_TYPE_UNUSED ); // this entry is not used by ppt
- mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ] = new PPTCharSheet( TSS_TYPE_TEXT_IN_SHAPE );
- mpParaSheet[ TSS_TYPE_PAGETITLE ] = new PPTParaSheet( TSS_TYPE_PAGETITLE );
- mpParaSheet[ TSS_TYPE_BODY ] = new PPTParaSheet( TSS_TYPE_BODY );
- mpParaSheet[ TSS_TYPE_NOTES ] = new PPTParaSheet( TSS_TYPE_NOTES );
- mpParaSheet[ TSS_TYPE_UNUSED ] = new PPTParaSheet( TSS_TYPE_UNUSED );
- mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ] = new PPTParaSheet( TSS_TYPE_TEXT_IN_SHAPE );
- mpCharSheet[ TSS_TYPE_QUARTERBODY ] = mpCharSheet[ TSS_TYPE_HALFBODY ] = mpCharSheet[ TSS_TYPE_TITLE ] = mpCharSheet[ TSS_TYPE_SUBTITLE ] = NULL;
- mpParaSheet[ TSS_TYPE_QUARTERBODY ] = mpParaSheet[ TSS_TYPE_HALFBODY ] = mpParaSheet[ TSS_TYPE_TITLE ] = mpParaSheet[ TSS_TYPE_SUBTITLE ] = NULL;
-
- /* SJ: try to locate the txMasterStyleAtom in the Environment
-
- it seems that the environment TextStyle is having a higher priority
- than the TextStyle that can be found within the master page
- */
- sal_Bool bFoundTxMasterStyleAtom04 = sal_False;
- DffRecordHeader* pEnvHeader = rManager.aDocRecManager.GetRecordHeader( PPT_PST_Environment );
- if ( pEnvHeader )
- {
- pEnvHeader->SeekToContent( rIn );
- DffRecordHeader aTxMasterStyleHd;
- while ( rIn.Tell() < pEnvHeader->GetRecEndFilePos() )
- {
- rIn >> aTxMasterStyleHd;
- if ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom )
- {
- sal_uInt16 nLevelAnz;
- rIn >> nLevelAnz;
-
- sal_uInt16 nLev = 0;
- sal_Bool bFirst = sal_True;
- bFoundTxMasterStyleAtom04 = sal_True;
- while ( rIn.GetError() == 0 && rIn.Tell() < aTxMasterStyleHd.GetRecEndFilePos() && nLev < nLevelAnz )
- {
- if ( nLev )
- {
- mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maParaLevel[ nLev ] = mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maParaLevel[ nLev - 1 ];
- mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maCharLevel[ nLev ] = mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maCharLevel[ nLev - 1 ];
- }
- mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->Read( rManager, rIn, sal_True, nLev, bFirst );
- if ( !nLev )
- {
- // set paragraph defaults for instance 4 (TSS_TYPE_TEXT_IN_SHAPE)
- if ( rTxPFStyle.bValid )
- {
- PPTParaLevel& rParaLevel = mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maParaLevel[ 0 ];
- rParaLevel.mnAsianLineBreak = 0;
- if ( rTxPFStyle.bForbiddenRules )
- rParaLevel.mnAsianLineBreak |= 1;
- if ( !rTxPFStyle.bLatinTextWrap )
- rParaLevel.mnAsianLineBreak |= 2;
- if ( rTxPFStyle.bHangingPunctuation )
- rParaLevel.mnAsianLineBreak |= 4;
- }
- }
- mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->Read( rIn, sal_True, nLev, bFirst );
- bFirst = sal_False;
- nLev++;
- }
- break;
- }
- else
- aTxMasterStyleHd.SeekToEndOfRecord( rIn );
- }
- }
-
- rSlideHd.SeekToContent( rIn );
- DffRecordHeader aTxMasterStyleHd;
- while ( rIn.Tell() < rSlideHd.GetRecEndFilePos() )
- {
- rIn >> aTxMasterStyleHd;
- if ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom )
- break;
- else
- aTxMasterStyleHd.SeekToEndOfRecord( rIn );
- }
- while ( ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom ) && ( rIn.Tell() < rSlideHd.GetRecEndFilePos() ) ) //TODO: aTxMasterStyleHd may be used without having been properly initialized
- {
- sal_uInt32 nInstance = aTxMasterStyleHd.nRecInstance;
- if ( ( nInstance < PPT_STYLESHEETENTRYS ) &&
- ( ( nInstance != TSS_TYPE_TEXT_IN_SHAPE ) || ( bFoundTxMasterStyleAtom04 == sal_False ) ) )
- {
- if ( nInstance > 4 )
- {
- delete mpCharSheet[ nInstance ]; // be sure to delete the old one if this instance comes twice
- delete mpParaSheet[ nInstance ];
-
- switch ( nInstance )
- {
- case TSS_TYPE_SUBTITLE :
- {
- mpCharSheet[ TSS_TYPE_SUBTITLE ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_BODY ] ) );
- mpParaSheet[ TSS_TYPE_SUBTITLE ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_BODY ] ) );
- }
- break;
- case TSS_TYPE_TITLE :
- {
- mpCharSheet[ TSS_TYPE_TITLE ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_PAGETITLE ] ) );
- mpParaSheet[ TSS_TYPE_TITLE ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_PAGETITLE ] ) );
- }
- break;
- case TSS_TYPE_HALFBODY :
- {
- mpCharSheet[ TSS_TYPE_HALFBODY ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_BODY ] ) );
- mpParaSheet[ TSS_TYPE_HALFBODY ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_BODY ] ) );
- }
- break;
-
- case TSS_TYPE_QUARTERBODY :
- {
- mpCharSheet[ TSS_TYPE_QUARTERBODY ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_BODY ] ) );
- mpParaSheet[ TSS_TYPE_QUARTERBODY ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_BODY ] ) );
- }
- break;
- }
- }
- sal_uInt16 nLevelAnz;
- rIn >> nLevelAnz;
- if ( nLevelAnz > 5 )
- {
- DBG_ERROR( "PPTStyleSheet::Ppt-TextStylesheet hat mehr als 5 Ebenen! (SJ)" );
- nLevelAnz = 5;
- }
- sal_uInt16 nLev = 0;
- sal_Bool bFirst = sal_True;
-
- while ( rIn.GetError() == 0 && rIn.Tell() < aTxMasterStyleHd.GetRecEndFilePos() && nLev < nLevelAnz )
- {
- if ( nLev && ( nInstance < 5 ) )
- {
- mpParaSheet[ nInstance ]->maParaLevel[ nLev ] = mpParaSheet[ nInstance ]->maParaLevel[ nLev - 1 ];
- mpCharSheet[ nInstance ]->maCharLevel[ nLev ] = mpCharSheet[ nInstance ]->maCharLevel[ nLev - 1 ];
- }
-
- // Ausnahme: Vorlage 5, 6 (MasterTitle Titel und SubTitel)
- if ( nInstance >= TSS_TYPE_SUBTITLE )
- {
- bFirst = sal_False;
-
- sal_uInt16 nDontKnow;
- rIn >> nDontKnow;
- }
- mpParaSheet[ nInstance ]->Read( rManager, rIn, sal_True, nLev, bFirst );
- mpCharSheet[ nInstance ]->Read( rIn, sal_True, nLev, bFirst );
- bFirst = sal_False;
- nLev++;
- }
-#ifdef DBG_UTIL
- if (!(rManager.rImportParam.nImportFlags & PPT_IMPORTFLAGS_NO_TEXT_ASSERT))
- {
- if ( rIn.GetError() == 0 )
- {
- ByteString aMsg;
- if ( rIn.Tell() > aTxMasterStyleHd.GetRecEndFilePos() )
- {
- aMsg += "\n ";
- aMsg += "reading too many bytes:";
- aMsg += ByteString::CreateFromInt32( rIn.Tell() - aTxMasterStyleHd.GetRecEndFilePos() );
- }
- if ( rIn.Tell() < aTxMasterStyleHd.GetRecEndFilePos() )
- {
- aMsg += "\n ";
- aMsg += "reading too less bytes:";
- aMsg += ByteString::CreateFromInt32( aTxMasterStyleHd.GetRecEndFilePos() - rIn.Tell() );
- }
- if ( aMsg.Len() != 0 )
- {
- aMsg.Insert( "]:", 0 );
- aMsg.Insert( "PptStyleSheet::operator>>[", 0 );
- DBG_ERROR(aMsg.GetBuffer());
- }
- }
- if ( rIn.Tell() != aTxMasterStyleHd.GetRecEndFilePos() )
- DBG_ASSERT(0, "SJ: Falsche Anzahl von Bytes gelesen beim Import der PPT-Formatvorlagen");
- }
-#endif
- }
- aTxMasterStyleHd.SeekToEndOfRecord( rIn );
- rIn >> aTxMasterStyleHd;
- }
- if ( !mpCharSheet[ TSS_TYPE_SUBTITLE ] )
- {
- mpCharSheet[ TSS_TYPE_SUBTITLE ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_BODY ] ) );
- mpParaSheet[ TSS_TYPE_SUBTITLE ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_BODY ] ) );
- }
- if ( !mpCharSheet[ TSS_TYPE_TITLE ] )
- {
- mpCharSheet[ TSS_TYPE_TITLE ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_PAGETITLE ] ) );
- mpParaSheet[ TSS_TYPE_TITLE ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_PAGETITLE ] ) );
- }
- if ( !mpCharSheet[ TSS_TYPE_HALFBODY ] )
- {
- mpCharSheet[ TSS_TYPE_HALFBODY ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_BODY ] ) );
- mpParaSheet[ TSS_TYPE_HALFBODY ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_BODY ] ) );
- }
- if ( !mpCharSheet[ TSS_TYPE_QUARTERBODY ] )
- {
- mpCharSheet[ TSS_TYPE_QUARTERBODY ] = new PPTCharSheet( *( mpCharSheet[ TSS_TYPE_BODY ] ) );
- mpParaSheet[ TSS_TYPE_QUARTERBODY ] = new PPTParaSheet( *( mpParaSheet[ TSS_TYPE_BODY ] ) );
- }
- if ( !bFoundTxMasterStyleAtom04 )
- { // try to locate the txMasterStyleAtom in the Environment
- DffRecordHeader* pEnvHeader2 = rManager.aDocRecManager.GetRecordHeader( PPT_PST_Environment );
- if ( pEnvHeader2 )
- {
- pEnvHeader2->SeekToContent( rIn );
- DffRecordHeader aTxMasterStyleHd2;
- while ( rIn.Tell() < pEnvHeader2->GetRecEndFilePos() )
- {
- rIn >> aTxMasterStyleHd2;
- if ( aTxMasterStyleHd2.nRecType == PPT_PST_TxMasterStyleAtom )
- {
- sal_uInt16 nLevelAnz;
- rIn >> nLevelAnz;
-
- sal_uInt16 nLev = 0;
- sal_Bool bFirst = sal_True;
- while ( rIn.GetError() == 0 && rIn.Tell() < aTxMasterStyleHd2.GetRecEndFilePos() && nLev < nLevelAnz )
- {
- if ( nLev )
- {
- mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maParaLevel[ nLev ] = mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maParaLevel[ nLev - 1 ];
- mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maCharLevel[ nLev ] = mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maCharLevel[ nLev - 1 ];
- }
- mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->Read( rManager, rIn, sal_True, nLev, bFirst );
- if ( !nLev )
- {
- // set paragraph defaults for instance 4 (TSS_TYPE_TEXT_IN_SHAPE)
- if ( rTxPFStyle.bValid )
- {
- PPTParaLevel& rParaLevel = mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->maParaLevel[ 0 ];
- rParaLevel.mnAsianLineBreak = 0;
- if ( rTxPFStyle.bForbiddenRules )
- rParaLevel.mnAsianLineBreak |= 1;
- if ( !rTxPFStyle.bLatinTextWrap )
- rParaLevel.mnAsianLineBreak |= 2;
- if ( rTxPFStyle.bHangingPunctuation )
- rParaLevel.mnAsianLineBreak |= 4;
- }
- }
- mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE ]->Read( rIn, sal_True, nLev, bFirst );
- bFirst = sal_False;
- nLev++;
- }
- break;
- }
- else
- aTxMasterStyleHd2.SeekToEndOfRecord( rIn );
- }
- }
- }
- rIn.Seek( nOldFilePos );
-
- // will will create the default numbulletitem for each instance
- for ( i = 0; i < PPT_STYLESHEETENTRYS; i++ )
- {
- UINT16 nLevels, nDepth = 0;
- SvxNumRuleType eNumRuleType;
-
- switch ( i )
- {
- case TSS_TYPE_PAGETITLE :
- case TSS_TYPE_TITLE :
- nLevels = 1;
- eNumRuleType = SVX_RULETYPE_NUMBERING;
- break;
- case TSS_TYPE_SUBTITLE :
- nLevels = 10;
- eNumRuleType = SVX_RULETYPE_NUMBERING;
- break;
- case TSS_TYPE_BODY :
- case TSS_TYPE_HALFBODY :
- case TSS_TYPE_QUARTERBODY :
- nLevels = 10;
- eNumRuleType = SVX_RULETYPE_PRESENTATION_NUMBERING;
- break;
- default :
- case TSS_TYPE_NOTES :
- case TSS_TYPE_UNUSED :
- case TSS_TYPE_TEXT_IN_SHAPE :
- nLevels = 10;
- eNumRuleType = SVX_RULETYPE_NUMBERING;
- break;
- }
- SvxNumRule aRule( NUM_BULLET_REL_SIZE | NUM_BULLET_COLOR |
- NUM_CHAR_TEXT_DISTANCE | NUM_SYMBOL_ALIGNMENT,
- nLevels, FALSE, eNumRuleType );
- for ( UINT16 nCount = 0; nDepth < nLevels; nCount++ )
- {
- const PPTParaLevel& rParaLevel = mpParaSheet[ i ]->maParaLevel[ nCount ];
- const PPTCharLevel& rCharLevel = mpCharSheet[ i ]->maCharLevel[ nCount ];
- SvxNumberFormat aNumberFormat( SVX_NUM_CHAR_SPECIAL );
- aNumberFormat.SetBulletChar( ' ' );
- GetNumberFormat( rManager, aNumberFormat, nCount, rParaLevel, rCharLevel, i );
- aRule.SetLevel( nDepth++, aNumberFormat );
- if ( nCount >= 4 )
- {
- for ( ;nDepth < nLevels; nDepth++ )
- aRule.SetLevel( nDepth, aNumberFormat );
- if ( eNumRuleType == SVX_RULETYPE_PRESENTATION_NUMBERING )
- aRule.SetLevel( 0, aNumberFormat );
- }
- }
- mpNumBulletItem[ i ] = new SvxNumBulletItem( aRule, EE_PARA_NUMBULLET );
- }
-}
-
-PPTStyleSheet::~PPTStyleSheet()
-{
- for ( UINT32 i = 0; i < PPT_STYLESHEETENTRYS; i++ )
- {
- delete mpCharSheet[ i ];
- delete mpParaSheet[ i ];
- delete mpNumBulletItem[ i ];
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTParaPropSet::PPTParaPropSet() :
- pParaSet( new ImplPPTParaPropSet )
-{
- pParaSet->mnHasAnm = 1;
-}
-
-PPTParaPropSet::PPTParaPropSet( PPTParaPropSet& rParaPropSet )
-{
- pParaSet = rParaPropSet.pParaSet;
- pParaSet->mnRefCount++;
-
- mnOriginalTextPos = rParaPropSet.mnOriginalTextPos;
-}
-
-PPTParaPropSet::~PPTParaPropSet()
-{
- if ( ! ( --pParaSet->mnRefCount ) )
- delete pParaSet;
-}
-
-PPTParaPropSet& PPTParaPropSet::operator=( PPTParaPropSet& rParaPropSet )
-{
- if ( this != &rParaPropSet )
- {
- if ( ! ( --pParaSet->mnRefCount ) )
- delete pParaSet;
- pParaSet = rParaPropSet.pParaSet;
- pParaSet->mnRefCount++;
-
- mnOriginalTextPos = rParaPropSet.mnOriginalTextPos;
- }
- return *this;
-}
-
-PPTCharPropSet::PPTCharPropSet( sal_uInt32 nParagraph ) :
- mnParagraph ( nParagraph ),
- mpFieldItem ( NULL ),
- pCharSet ( new ImplPPTCharPropSet )
-{
- mnLanguage[ 0 ] = mnLanguage[ 1 ] = mnLanguage[ 2 ] = 0;
-}
-
-PPTCharPropSet::PPTCharPropSet( PPTCharPropSet& rCharPropSet )
-{
- pCharSet = rCharPropSet.pCharSet;
- pCharSet->mnRefCount++;
-
- mnParagraph = rCharPropSet.mnParagraph;
- mnOriginalTextPos = rCharPropSet.mnOriginalTextPos;
- maString = rCharPropSet.maString;
- mpFieldItem = ( rCharPropSet.mpFieldItem ) ? new SvxFieldItem( *rCharPropSet.mpFieldItem ) : NULL;
- mnLanguage[ 0 ] = rCharPropSet.mnLanguage[ 0 ];
- mnLanguage[ 1 ] = rCharPropSet.mnLanguage[ 1 ];
- mnLanguage[ 2 ] = rCharPropSet.mnLanguage[ 2 ];
-}
-
-PPTCharPropSet::PPTCharPropSet( PPTCharPropSet& rCharPropSet, sal_uInt32 nParagraph )
-{
- pCharSet = rCharPropSet.pCharSet;
- pCharSet->mnRefCount++;
-
- mnParagraph = nParagraph;
- mnOriginalTextPos = rCharPropSet.mnOriginalTextPos;
- maString = rCharPropSet.maString;
- mpFieldItem = ( rCharPropSet.mpFieldItem ) ? new SvxFieldItem( *rCharPropSet.mpFieldItem ) : NULL;
- mnLanguage[ 0 ] = mnLanguage[ 1 ] = mnLanguage[ 2 ] = 0;
-}
-
-PPTCharPropSet::~PPTCharPropSet()
-{
- if ( ! ( --pCharSet->mnRefCount ) )
- delete pCharSet;
- delete mpFieldItem;
-}
-
-PPTCharPropSet& PPTCharPropSet::operator=( PPTCharPropSet& rCharPropSet )
-{
- if ( this != &rCharPropSet )
- {
- if ( ! ( --pCharSet->mnRefCount ) )
- delete pCharSet;
- pCharSet = rCharPropSet.pCharSet;
- pCharSet->mnRefCount++;
-
- mnOriginalTextPos = rCharPropSet.mnOriginalTextPos;
- mnParagraph = rCharPropSet.mnParagraph;
- maString = rCharPropSet.maString;
- mpFieldItem = ( rCharPropSet.mpFieldItem ) ? new SvxFieldItem( *rCharPropSet.mpFieldItem ) : NULL;
- }
- return *this;
-}
-
-void PPTCharPropSet::ImplMakeUnique()
-{
- if ( pCharSet->mnRefCount > 1 )
- {
- ImplPPTCharPropSet& rOld = *pCharSet;
- rOld.mnRefCount--;
- pCharSet = new ImplPPTCharPropSet( rOld );
- pCharSet->mnRefCount = 1;
- }
-}
-
-void PPTCharPropSet::SetFont( UINT16 nFont )
-{
- UINT32 nMask = 1 << PPT_CharAttr_Font;
- UINT32 bDoNotMake = pCharSet->mnAttrSet & nMask;
-
- if ( bDoNotMake )
- bDoNotMake = nFont == pCharSet->mnFont;
-
- if ( !bDoNotMake )
- {
- ImplMakeUnique();
- pCharSet->mnFont = nFont;
- pCharSet->mnAttrSet |= nMask;
- }
-}
-
-void PPTCharPropSet::SetColor( sal_uInt32 nColor )
-{
- ImplMakeUnique();
- pCharSet->mnColor = nColor;
- pCharSet->mnAttrSet |= 1 << PPT_CharAttr_FontColor;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTRuler::PPTRuler() :
- nRefCount ( 1 ),
- nFlags ( 0 ),
- pTab ( NULL ),
- nTabCount ( 0 )
-{
-}
-
-PPTRuler::~PPTRuler()
-{
- delete[] pTab;
-};
-
-
-PPTTextRulerInterpreter::PPTTextRulerInterpreter() :
- mpImplRuler ( new PPTRuler() )
-{
-}
-
-PPTTextRulerInterpreter::PPTTextRulerInterpreter( PPTTextRulerInterpreter& rRuler )
-{
- mpImplRuler = rRuler.mpImplRuler;
- mpImplRuler->nRefCount++;
-}
-
-PPTTextRulerInterpreter::PPTTextRulerInterpreter( UINT32 nFileOfs, SdrPowerPointImport& rMan, DffRecordHeader& rHeader, SvStream& rIn ) :
- mpImplRuler ( new PPTRuler() )
-{
- if ( nFileOfs != 0xffffffff )
- {
- UINT32 nOldPos = rIn.Tell();
- DffRecordHeader rHd;
- if ( nFileOfs )
- {
- rIn.Seek( nFileOfs );
- rIn >> rHd;
- }
- else
- {
- rHeader.SeekToContent( rIn );
- if ( rMan.SeekToRec( rIn, PPT_PST_TextRulerAtom, rHeader.GetRecEndFilePos(), &rHd ) )
- nFileOfs++;
- }
- if ( nFileOfs )
- {
- sal_Int16 nTCount;
- sal_Int32 i;
- rIn >> mpImplRuler->nFlags;
- if ( mpImplRuler->nFlags & 1 )
- rIn >> mpImplRuler->nDefaultTab;
- if ( mpImplRuler->nFlags & 4 )
- {
- rIn >> nTCount;
- if ( nTCount )
- {
- mpImplRuler->nTabCount = (UINT16)nTCount;
- mpImplRuler->pTab = new PPTTabEntry[ mpImplRuler->nTabCount ];
- for ( i = 0; i < nTCount; i++ )
- {
- rIn >> mpImplRuler->pTab[ i ].nOffset
- >> mpImplRuler->pTab[ i ].nStyle;
- }
- }
- }
- for ( i = 0; i < 5; i++ )
- {
- if ( mpImplRuler->nFlags & ( 8 << i ) )
- rIn >> mpImplRuler->nTextOfs[ i ];
- if ( mpImplRuler->nFlags & ( 256 << i ) )
- rIn >> mpImplRuler->nBulletOfs[ i ];
- }
- }
- rIn.Seek( nOldPos );
- }
-}
-
-BOOL PPTTextRulerInterpreter::GetDefaultTab( UINT32 /*nLevel*/, UINT16& nValue ) const
-{
- if ( ! ( mpImplRuler->nFlags & 1 ) )
- return FALSE;
- nValue = mpImplRuler->nDefaultTab;
- return TRUE;
-}
-
-BOOL PPTTextRulerInterpreter::GetTextOfs( UINT32 nLevel, UINT16& nValue ) const
-{
- if ( ! ( ( nLevel < 5 ) && ( mpImplRuler->nFlags & ( 8 << nLevel ) ) ) )
- return FALSE;
- nValue = mpImplRuler->nTextOfs[ nLevel ];
- return TRUE;
-}
-
-BOOL PPTTextRulerInterpreter::GetBulletOfs( UINT32 nLevel, UINT16& nValue ) const
-{
- if ( ! ( ( nLevel < 5 ) && ( mpImplRuler->nFlags & ( 256 << nLevel ) ) ) )
- return FALSE;
- nValue = mpImplRuler->nBulletOfs[ nLevel ];
- return TRUE;
-}
-
-PPTTextRulerInterpreter& PPTTextRulerInterpreter::operator=( PPTTextRulerInterpreter& rRuler )
-{
- if ( this != &rRuler )
- {
- if ( ! ( --mpImplRuler->nRefCount ) )
- delete mpImplRuler;
- mpImplRuler = rRuler.mpImplRuler;
- mpImplRuler->nRefCount++;
- }
- return *this;
-}
-
-PPTTextRulerInterpreter::~PPTTextRulerInterpreter()
-{
- if ( ! ( --mpImplRuler->nRefCount ) )
- delete mpImplRuler;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTTextCharacterStyleAtomInterpreter::PPTTextCharacterStyleAtomInterpreter() :
- nFlags1 ( 0 ),
- nFlags2 ( 0 ),
- nFlags3 ( 0 )
-{
-}
-
-sal_Bool PPTTextCharacterStyleAtomInterpreter::Read( SvStream& rIn, const DffRecordHeader& rRecHd )
-{
- rRecHd.SeekToContent( rIn );
-
- rIn >> nFlags1
- >> nFlags2
- >> nFlags3
- >> n1
- >> nFontHeight
- >> nFontColor;
-
- return sal_True;
-}
-
-PPTTextCharacterStyleAtomInterpreter::~PPTTextCharacterStyleAtomInterpreter()
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-PPTTextParagraphStyleAtomInterpreter::PPTTextParagraphStyleAtomInterpreter() :
- bValid ( sal_False ),
- bForbiddenRules ( sal_False ),
- bHangingPunctuation ( sal_False ),
- bLatinTextWrap ( sal_False )
-{
-}
-
-sal_Bool PPTTextParagraphStyleAtomInterpreter::Read( SvStream& rIn, const DffRecordHeader& rRecHd )
-{
- bValid = sal_False;
- rRecHd.SeekToContent( rIn );
- sal_uInt32 nDummy32, nFlags, nRecEndPos = rRecHd.GetRecEndFilePos();
- sal_uInt16 nDummy16;
-
- rIn >> nDummy16
- >> nFlags;
-
- if ( nFlags & 0xf && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // BuFlags
- if ( nFlags & 0x80 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // BuChar
- if ( nFlags & 0x10 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // nBuFont;
- if ( nFlags & 0x40 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // nBuHeight;
- if ( nFlags & 0x0020 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy32; // nBuColor;
- if ( nFlags & 0x800 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // AbsJust!
- if ( nFlags & 0x400 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16;
- if ( nFlags & 0x200 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16;
- if ( nFlags & 0x100 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16;
- if ( nFlags & 0x1000 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // LineFeed
- if ( nFlags & 0x2000 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // nUpperDist
- if ( nFlags & 0x4000 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16; // nLowerDist
- if ( nFlags & 0x8000 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16;
- if ( nFlags & 0x10000 && ( rIn.Tell() < nRecEndPos ) )
- rIn >> nDummy16;
- if ( nFlags & 0xe0000 && ( rIn.Tell() < nRecEndPos ) )
- {
- rIn >> nDummy16;
- if ( nFlags & 0x20000 )
- bForbiddenRules = ( nDummy16 & 1 ) == 1;
- if ( nFlags & 0x40000 )
- bLatinTextWrap = ( nDummy16 & 2 ) == 0;
- if ( nFlags & 0x80000 )
- bHangingPunctuation = ( nDummy16 & 4 ) == 4;
- }
- nFlags &=~ 0xfffff;
- sal_uInt32 nMask = 0x100000;
- while ( nFlags && nMask && ( rIn.Tell() < nRecEndPos ) )
- {
- if ( nFlags & nMask )
- {
- rIn >> nDummy16;
- nFlags ^= nMask;
- }
- nMask <<= 1;
- }
- bValid = rIn.Tell() == nRecEndPos;
- return bValid;
-}
-
-PPTTextParagraphStyleAtomInterpreter::~PPTTextParagraphStyleAtomInterpreter()
-{
-
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-PPTTextSpecInfo::PPTTextSpecInfo( sal_uInt32 _nCharIdx ) :
- nCharIdx ( _nCharIdx ),
- nDontKnow ( 1 )
-{
- nLanguage[ 0 ] = 0x400;
- nLanguage[ 1 ] = 0;
- nLanguage[ 2 ] = 0;
-}
-
-PPTTextSpecInfo::~PPTTextSpecInfo()
-{
-}
-
-PPTTextSpecInfoAtomInterpreter::PPTTextSpecInfoAtomInterpreter() :
- bValid ( sal_False )
-{
-}
-
-sal_Bool PPTTextSpecInfoAtomInterpreter::Read( SvStream& rIn, const DffRecordHeader& rRecHd,
- sal_uInt16 nRecordType, const PPTTextSpecInfo* pTextSpecDefault )
-{
- bValid = sal_False;
- sal_uInt32 nCharIdx = 0;
- rRecHd.SeekToContent( rIn );
-
- while ( rIn.Tell() < rRecHd.GetRecEndFilePos() )
- {
- sal_uInt32 nCharCount,
- nFlags, i;
-
- if ( nRecordType == PPT_PST_TextSpecInfoAtom )
- {
- rIn >> nCharCount;
- nCharIdx += nCharCount;
- }
- rIn >> nFlags;
-
- PPTTextSpecInfo* pEntry = new PPTTextSpecInfo( nCharIdx );
- if ( pTextSpecDefault )
- {
- pEntry->nDontKnow = pTextSpecDefault->nDontKnow;
- pEntry->nLanguage[ 0 ] = pTextSpecDefault->nLanguage[ 0 ];
- pEntry->nLanguage[ 1 ] = pTextSpecDefault->nLanguage[ 1 ];
- pEntry->nLanguage[ 2 ] = pTextSpecDefault->nLanguage[ 2 ];
- }
- for ( i = 1; nFlags && i ; i <<= 1 )
- {
- sal_uInt16 nLang = 0;
- switch( nFlags & i )
- {
- case 0 : break;
- case 1 : rIn >> pEntry->nDontKnow; break;
- case 2 : rIn >> nLang; break;
- case 4 : rIn >> nLang; break;
- default :
- {
- rIn.SeekRel( 2 );
- }
- }
- if ( nLang )
- {
- sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( nLang );
- if ( nScriptType & SCRIPTTYPE_LATIN )
- pEntry->nLanguage[ 0 ] = nLang;
- if ( nScriptType & SCRIPTTYPE_ASIAN )
- pEntry->nLanguage[ 1 ] = nLang;
- if ( nScriptType & SCRIPTTYPE_COMPLEX )
- pEntry->nLanguage[ 2 ] = nLang;
- }
- nFlags &= ~i;
- }
- aList.Insert( pEntry, LIST_APPEND );
- }
- bValid = rIn.Tell() == rRecHd.GetRecEndFilePos();
- return bValid;
-}
-
-PPTTextSpecInfoAtomInterpreter::~PPTTextSpecInfoAtomInterpreter()
-{
- void *pPtr;
- for ( pPtr = aList.First(); pPtr; pPtr = aList.Next() )
- delete (PPTTextSpecInfo*)pPtr;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void StyleTextProp9::Read( SvStream& rIn )
-{
- rIn >> mnExtParagraphMask;
- if ( mnExtParagraphMask & 0x800000 )
- rIn >> mnBuBlip;
- if ( mnExtParagraphMask & 0x2000000 )
- rIn >> mnHasAnm;
- if ( mnExtParagraphMask & 0x1000000 )
- rIn >> mnAnmScheme;
- if ( mnExtParagraphMask & 0x4000000 )
- rIn >> mpfPP10Ext;
- rIn >> mnExtCharacterMask;
- if ( mnExtCharacterMask & 0x100000 )
- rIn >> mncfPP10Ext;
- rIn >> mnSpecialInfoMask;
- if ( mnSpecialInfoMask & 0x20 )
- rIn >> mnPP10Ext;
- if ( mnSpecialInfoMask & 0x40 )
- rIn >> mfBidi;
-}
-
-PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
- PPTTextRulerInterpreter& rRuler, const DffRecordHeader& rExtParaHd, sal_uInt32 nInstance )
-{
- Init(rIn, rMan, rTextHeader, rRuler, rExtParaHd, nInstance);
-}
-
-void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
- const String& aString, PPTTextRulerInterpreter& rRuler,
- sal_uInt32& nCharCount, sal_Bool& bTextPropAtom )
-{
- sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
- sal_uInt32 nCharAnzRead = 0;
- sal_uInt16 nDummy16;
-
- sal_uInt16 nStringLen = aString.Len();
-
- DffRecordHeader aTextHd2;
- rTextHeader.SeekToContent( rIn );
- if ( rMan.SeekToRec( rIn, PPT_PST_StyleTextPropAtom, rTextHeader.GetRecEndFilePos(), &aTextHd2 ) )
- bTextPropAtom = sal_True;
- while ( nCharAnzRead <= nStringLen )
- {
- PPTParaPropSet aParaPropSet;
- ImplPPTParaPropSet& aSet = *aParaPropSet.pParaSet;
- if ( bTextPropAtom )
- {
- rIn >> nCharCount
- >> aParaPropSet.pParaSet->mnDepth; // Einruecktiefe
-
- nCharCount--;
-
- rIn >> nMask;
- aSet.mnAttrSet = nMask & 0x207df7;
- sal_uInt16 nBulFlg = 0;
- if ( nMask & 0xF )
- rIn >> nBulFlg; // Bullet-HardAttr-Flags
- aSet.mpArry[ PPT_ParaAttr_BulletOn ] = ( nBulFlg & 1 ) ? 1 : 0;
- aSet.mpArry[ PPT_ParaAttr_BuHardFont ] = ( nBulFlg & 2 ) ? 1 : 0;
- aSet.mpArry[ PPT_ParaAttr_BuHardColor ] = ( nBulFlg & 4 ) ? 1 : 0;
-
- if ( nMask & 0x0080 ) // buChar
- rIn >> aSet.mpArry[ PPT_ParaAttr_BulletChar ];
- if ( nMask & 0x0010 ) // buTypeface
- rIn >> aSet.mpArry[ PPT_ParaAttr_BulletFont ];
- if ( nMask & 0x0040 ) // buSize
- {
- rIn >> aSet.mpArry[ PPT_ParaAttr_BulletHeight ];
- if ( ! ( ( nMask & ( 1 << PPT_ParaAttr_BuHardHeight ) )
- && ( nBulFlg && ( 1 << PPT_ParaAttr_BuHardHeight ) ) ) )
- aSet.mnAttrSet ^= 0x40;
- }
- if ( nMask & 0x0020 ) // buColor
- {
- sal_uInt32 nVal32, nHiByte;
- rIn >> nVal32;
- nHiByte = nVal32 >> 24;
- if ( nHiByte <= 8 )
- nVal32 = nHiByte | PPT_COLSCHEME;
- aSet.mnBulletColor = nVal32;
- }
- if ( nMask & 0x0800 ) // pfAlignment
- {
- rIn >> nDummy16;
- aSet.mpArry[ PPT_ParaAttr_Adjust ] = nDummy16 & 3;
- }
- if ( nMask & 0x1000 ) // pfLineSpacing
- rIn >> aSet.mpArry[ PPT_ParaAttr_LineFeed ];
- if ( nMask & 0x2000 ) // pfSpaceBefore
- rIn >> aSet.mpArry[ PPT_ParaAttr_UpperDist ];
- if ( nMask & 0x4000 ) // pfSpaceAfter
- rIn >> aSet.mpArry[ PPT_ParaAttr_LowerDist ];
- if ( nMask & 0x100 ) // pfLeftMargin
- rIn >> nDummy16;
- if ( nMask & 0x400 ) // pfIndent
- rIn >> nDummy16;
- if ( nMask & 0x8000 ) // pfDefaultTabSize
- rIn >> nDummy16;
- if ( nMask & 0x100000 ) // pfTabStops
- {
- sal_uInt16 i, nDistance, nAlignment, nNumberOfTabStops = 0;
- rIn >> nNumberOfTabStops;
- for ( i = 0; i < nNumberOfTabStops; i++ )
- {
- rIn >> nDistance
- >> nAlignment;
- }
- }
- if ( nMask & 0x10000 ) // pfBaseLine
- rIn >> nDummy16;
- if ( nMask & 0xe0000 ) // pfCharWrap, pfWordWrap, pfOverflow
- {
- rIn >> nDummy16;
- if ( nMask & 0x20000 )
- aSet.mpArry[ PPT_ParaAttr_AsianLB_1 ] = nDummy16 & 1;
- if ( nMask & 0x40000 )
- aSet.mpArry[ PPT_ParaAttr_AsianLB_2 ] = ( nDummy16 >> 1 ) & 1;
- if ( nMask & 0x80000 )
- aSet.mpArry[ PPT_ParaAttr_AsianLB_3 ] = ( nDummy16 >> 2 ) & 1;
- aSet.mnAttrSet |= ( ( nMask >> 17 ) & 7 ) << PPT_ParaAttr_AsianLB_1;
- }
- if ( nMask & 0x200000 ) // pfTextDirection
- rIn >> aSet.mpArry[ PPT_ParaAttr_BiDi ];
- }
- else
- nCharCount = nStringLen;
-
- if ( rRuler.GetTextOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_TextOfs ] ) )
- aSet.mnAttrSet |= 1 << PPT_ParaAttr_TextOfs;
- if ( rRuler.GetBulletOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_BulletOfs ] ) )
- aSet.mnAttrSet |= 1 << PPT_ParaAttr_BulletOfs;
- if ( rRuler.GetDefaultTab( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_DefaultTab ] ) )
- aSet.mnAttrSet |= 1 << PPT_ParaAttr_DefaultTab;
-
- if ( ( nCharCount > nStringLen ) || ( nStringLen < nCharAnzRead + nCharCount ) )
- {
- bTextPropAtom = sal_False;
- nCharCount = nStringLen - nCharAnzRead;
- // please fix the right hand side of
- // PPTParaPropSet& PPTParaPropSet::operator=(PPTParaPropSet&),
- // it should be a const reference
- PPTParaPropSet aTmpPPTParaPropSet;
- aParaPropSet = aTmpPPTParaPropSet;
- DBG_ERROR( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the paragraph attributes" );
- }
- PPTParaPropSet* pPara = new PPTParaPropSet( aParaPropSet );
- pPara->mnOriginalTextPos = nCharAnzRead;
- aParaPropList.Insert( pPara, LIST_APPEND );
- if ( nCharCount )
- {
- sal_uInt32 nCount;
- const sal_Unicode* pDat = aString.GetBuffer() + nCharAnzRead;
- for ( nCount = 0; nCount < nCharCount; nCount++ )
- {
- if ( pDat[ nCount ] == 0xd )
- {
- pPara = new PPTParaPropSet( aParaPropSet );
- pPara->mnOriginalTextPos = nCharAnzRead + nCount + 1;
- aParaPropList.Insert( pPara, LIST_APPEND );
- }
- }
- }
- nCharAnzRead += nCharCount + 1;
- }
-}
-
-void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
- sal_uInt32& nCharCount, sal_uInt32 nCharAnzRead,
- sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
- const std::vector< StyleTextProp9 >& aStyleTextProp9,
- sal_uInt32& nExtParaFlags, sal_uInt16& nBuBlip,
- sal_uInt16& nHasAnm, sal_uInt32& nAnmScheme )
-{
- sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
- sal_uInt16 nDummy16;
- sal_Int32 nCharsToRead;
- sal_uInt32 nExtParaNibble = 0;
-
- sal_uInt16 nStringLen = aString.Len();
-
- rIn >> nDummy16;
- nCharCount = nDummy16;
- rIn >> nDummy16;
- nCharsToRead = nStringLen - ( nCharAnzRead + nCharCount );
- if ( nCharsToRead < 0 )
- {
- nCharCount = nStringLen - nCharAnzRead;
- if ( nCharsToRead < -1 )
- {
- bTextPropAtom = sal_False;
- DBG_ERROR( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the character attributes" );
- }
- }
- ImplPPTCharPropSet& aSet = *aCharPropSet.pCharSet;
-
- // character attributes
- rIn >> nMask;
- if ( (sal_uInt16)nMask )
- {
- aSet.mnAttrSet |= (sal_uInt16)nMask;
- rIn >> aSet.mnFlags;
- }
- if ( nMask & 0x10000 ) // cfTypeface
- {
- rIn >> aSet.mnFont;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_Font;
- }
- if ( nMask & 0x200000 ) // cfFEOldTypeface
- {
- rIn >> aSet.mnAsianOrComplexFont;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_AsianOrComplexFont;
- }
- if ( nMask & 0x400000 ) // cfANSITypeface
- {
- rIn >> aSet.mnANSITypeface;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_ANSITypeface;
- }
- if ( nMask & 0x800000 ) // cfSymbolTypeface
- {
- rIn >> aSet.mnSymbolFont;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_Symbol;
- }
- if ( nMask & 0x20000 ) // cfSize
- {
- rIn >> aSet.mnFontHeight;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_FontHeight;
- }
- if ( nMask & 0x40000 ) // cfColor
- {
- sal_uInt32 nVal;
- rIn >> nVal;
- if ( !( nVal & 0xff000000 ) )
- nVal = PPT_COLSCHEME_HINTERGRUND;
- aSet.mnColor = nVal;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_FontColor;
- }
- if ( nMask & 0x80000 ) // cfPosition
- {
- rIn >> aSet.mnEscapement;
- aSet.mnAttrSet |= 1 << PPT_CharAttr_Escapement;
- }
- if ( nExtParaPos )
- {
- sal_uInt32 nExtBuInd = nMask & 0x3c00;
- if ( nExtBuInd )
- nExtBuInd = ( aSet.mnFlags & 0x3c00 ) >> 10;
- if ( nExtBuInd < aStyleTextProp9.size() )
- {
- if ( nExtParaNibble && ( ( nExtBuInd + nExtParaNibble ) < aStyleTextProp9.size() ) )
- nExtBuInd += nExtParaNibble;
-
- nExtParaFlags = aStyleTextProp9[ nExtBuInd ].mnExtParagraphMask;
- nBuBlip = aStyleTextProp9[ nExtBuInd ].mnBuBlip;
- nHasAnm = aStyleTextProp9[ nExtBuInd ].mnHasAnm;
- nAnmScheme = aStyleTextProp9[ nExtBuInd ].mnAnmScheme;
- }
- if ( ( nExtBuInd & 0xf ) == 0xf )
- nExtParaNibble += 16;
- }
-}
-
-void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
- PPTTextRulerInterpreter& rRuler, const DffRecordHeader& rExtParaHd, sal_uInt32 nInstance )
-{
- sal_uInt32 nMerk = rIn.Tell();
- sal_uInt32 nExtParaPos = ( rExtParaHd.nRecType == PPT_PST_ExtendedParagraphAtom ) ? rExtParaHd.nFilePos + 8 : 0;
-
- std::vector< StyleTextProp9 > aStyleTextProp9;
- if ( rExtParaHd.nRecType == PPT_PST_ExtendedParagraphAtom )
- {
- rIn.Seek( rExtParaHd.nFilePos + 8 );
- while( ( rIn.GetError() == 0 ) && ( rIn.Tell() < rExtParaHd.GetRecEndFilePos() ) )
- {
- aStyleTextProp9.resize( aStyleTextProp9.size() + 1 );
- aStyleTextProp9.back().Read( rIn );
- }
- rIn.Seek( nMerk );
- }
-
- String aString;
- DffRecordHeader aTextHd;
- rIn >> aTextHd;
- sal_uInt32 nMaxLen = aTextHd.nRecLen;
- if ( nMaxLen > 0xFFFF )
- nMaxLen = 0xFFFF;
-
- if( aTextHd.nRecType == PPT_PST_TextCharsAtom )
- {
- sal_uInt32 i;
- sal_Unicode nChar,*pBuf = new sal_Unicode[ ( nMaxLen >> 1 ) + 1 ];
- rIn.Read( pBuf, nMaxLen );
- nMaxLen >>= 1;
- pBuf[ nMaxLen ] = 0;
- sal_Unicode* pPtr = pBuf;
-#ifdef OSL_BIGENDIAN
- sal_Unicode nTemp;
- for ( i = 0; i < nMaxLen; i++ )
- {
- nTemp = *pPtr;
- *pPtr++ = ( nTemp << 8 ) | ( nTemp >> 8 );
- }
- pPtr = pBuf;
-#endif
-
- for ( i = 0; i < nMaxLen; pPtr++, i++ )
- {
- nChar = *pPtr;
- if ( !nChar )
- break;
- if ( ( nChar & 0xff00 ) == 0xf000 ) // in this special case we got a symbol
- aSpecMarkerList.Insert( (void*)( i | PPT_SPEC_SYMBOL ), LIST_APPEND );
- else if ( nChar == 0xd )
- {
- if ( nInstance == TSS_TYPE_PAGETITLE )
- *pPtr = 0xb;
- else
- aSpecMarkerList.Insert( (void*)( i | PPT_SPEC_NEWLINE ), LIST_APPEND );
- }
- }
- if ( i )
- aString = String( pBuf, (sal_uInt16)i );
- delete[] pBuf;
- }
- else if( aTextHd.nRecType == PPT_PST_TextBytesAtom )
- {
- sal_Char *pBuf = new sal_Char[ nMaxLen + 1 ];
- pBuf[ nMaxLen ] = 0;
- rIn.Read( pBuf, nMaxLen );
- sal_Char* pPtr = pBuf;
- for (;;)
- {
- sal_Char cLo = *pPtr;
- if ( cLo == 0 )
- break;
- if ( cLo == 0xd )
- {
- if ( nInstance == TSS_TYPE_PAGETITLE )
- *pPtr = 0xb;
- else
- aSpecMarkerList.Insert( (void*)( pPtr - pBuf | PPT_SPEC_NEWLINE ), LIST_APPEND );
- }
- pPtr++;
- }
- xub_StrLen nLen = sal::static_int_cast< xub_StrLen >( pPtr - pBuf );
- if ( nLen )
- aString = String( pBuf, nLen, RTL_TEXTENCODING_MS_1252 );
- delete[] pBuf;
- }
- else
- {
- // no chars, but potentially char/para props?
- sal_uInt32 nCharCount;
- sal_Bool bTextPropAtom = sal_False;
- ReadParaProps( rIn, rMan, rTextHeader, aString, rRuler, nCharCount, bTextPropAtom );
-
- if ( bTextPropAtom )
- {
- // yeah, StyleTextProp is there, read it all & push to
- // aParaPropList
- PPTCharPropSet aCharPropSet(0);
- aCharPropSet.mnOriginalTextPos = 0;
-
- sal_uInt32 nCharAnzRead = 0;
- sal_uInt32 nExtParaFlags = 0, nAnmScheme = 0;
- sal_uInt16 nBuBlip = 0xffff, nHasAnm = 0;
- ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
- bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
- nBuBlip, nHasAnm, nAnmScheme );
-
- aCharPropList.Insert(
- new PPTCharPropSet( aCharPropSet, 0 ), LIST_APPEND );
- }
- }
-
- if ( aString.Len() )
- {
- sal_uInt32 nCharCount;
- sal_Bool bTextPropAtom = sal_False;
-
- ReadParaProps( rIn, rMan, rTextHeader, aString, rRuler, nCharCount, bTextPropAtom );
-
- sal_Bool bEmptyParaPossible = sal_True;
- sal_uInt32 nCharAnzRead = 0;
- sal_uInt32 nCurrentPara = 0;
- sal_uInt32 nCurrentSpecMarker = (sal_uInt32)(sal_uIntPtr)aSpecMarkerList.First();
- sal_uInt16 nStringLen = aString.Len();
-
- while ( nCharAnzRead < nStringLen )
- {
- sal_uInt32 nExtParaFlags = 0, nLatestParaUpdate = 0xffffffff, nAnmScheme = 0;
- sal_uInt16 nBuBlip = 0xffff, nHasAnm = 0;
-
- PPTCharPropSet aCharPropSet( nCurrentPara );
- if ( bTextPropAtom )
- ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
- bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
- nBuBlip, nHasAnm, nAnmScheme );
- else
- nCharCount = nStringLen;
-
- sal_uInt32 nLen;
- while( nCharCount )
- {
- if ( nExtParaPos && ( nLatestParaUpdate != nCurrentPara ) && ( nCurrentPara < aParaPropList.Count() ) )
- {
- PPTParaPropSet* pPropSet = (PPTParaPropSet*)aParaPropList.GetObject( nCurrentPara );
- pPropSet->pParaSet->mnExtParagraphMask = nExtParaFlags;
- if ( nExtParaFlags & 0x800000 )
- pPropSet->pParaSet->mnBuBlip = nBuBlip;
- if ( nExtParaFlags & 0x01000000 )
- pPropSet->pParaSet->mnAnmScheme = nAnmScheme;
- if ( nExtParaFlags & 0x02000000 )
- pPropSet->pParaSet->mnHasAnm = nHasAnm;
- nLatestParaUpdate = nCurrentPara;
- }
- aCharPropSet.mnOriginalTextPos = nCharAnzRead;
- if ( nCurrentSpecMarker && ( ( nCurrentSpecMarker & 0xffff ) < ( nCharAnzRead + nCharCount ) ) )
- {
- if ( nCurrentSpecMarker & PPT_SPEC_NEWLINE )
- {
- nLen = ( nCurrentSpecMarker & 0xffff ) - nCharAnzRead;
- if ( nLen )
- aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nLen );
- else if ( bEmptyParaPossible )
- aCharPropSet.maString = String();
- if ( nLen || bEmptyParaPossible )
- aCharPropList.Insert( new PPTCharPropSet( aCharPropSet, nCurrentPara ), LIST_APPEND );
- nCurrentPara++;
- nLen++;
- nCharAnzRead += nLen;
- nCharCount -= nLen;
- bEmptyParaPossible = sal_True;
- }
- else if ( nCurrentSpecMarker & PPT_SPEC_SYMBOL )
- {
- if ( ( nCurrentSpecMarker & 0xffff ) != nCharAnzRead )
- {
- nLen = ( nCurrentSpecMarker & 0xffff ) - nCharAnzRead;
- aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nLen );
- aCharPropList.Insert( new PPTCharPropSet( aCharPropSet, nCurrentPara ), LIST_APPEND );
- nCharCount -= nLen;
- nCharAnzRead += nLen;
- }
- PPTCharPropSet* pCPropSet = new PPTCharPropSet( aCharPropSet, nCurrentPara );
- pCPropSet->maString = aString.GetChar( (sal_uInt16)nCharAnzRead );
- if ( aCharPropSet.pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Symbol ) )
- pCPropSet->SetFont( aCharPropSet.pCharSet->mnSymbolFont );
- aCharPropList.Insert( pCPropSet, LIST_APPEND );
- nCharCount--;
- nCharAnzRead++;
- bEmptyParaPossible = sal_False;
- }
- nCurrentSpecMarker = (sal_uInt32)(sal_uIntPtr)aSpecMarkerList.Next();
- }
- else
- {
- aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nCharCount );
- aCharPropList.Insert( new PPTCharPropSet( aCharPropSet, nCurrentPara ), LIST_APPEND );
- nCharAnzRead += nCharCount;
- bEmptyParaPossible = sal_False;
- break;
- }
- }
- }
- if ( aCharPropList.Count() && ( ((PPTCharPropSet*)aCharPropList.Last())->mnParagraph != nCurrentPara ) )
- {
- PPTCharPropSet* pCharPropSet = new PPTCharPropSet( *(PPTCharPropSet*)aCharPropList.Last(), nCurrentPara );
- pCharPropSet->maString = String();
- pCharPropSet->mnOriginalTextPos = nStringLen - 1;
- aCharPropList.Insert( pCharPropSet, LIST_APPEND );
- }
- }
- rIn.Seek( nMerk );
-}
-
-PPTStyleTextPropReader::~PPTStyleTextPropReader()
-{
- void* pTmp;
- for ( pTmp = aParaPropList.First(); pTmp; pTmp = aParaPropList.Next() )
- delete (PPTParaPropSet*)pTmp;
- for ( pTmp = aCharPropList.First(); pTmp; pTmp = aCharPropList.Next() )
- delete (PPTCharPropSet*)pTmp;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-struct FieldEntry
-{
- UINT32 nFieldType;
- UINT32 nFieldStartPos;
- UINT32 nFieldEndPos;
- String aFieldUrl;
-
- FieldEntry( UINT32 nType, UINT32 nStart, UINT32 nEnd )
- {
- nFieldType = nType;
- nFieldStartPos = nStart;
- nFieldEndPos = nEnd;
- }
- FieldEntry( FieldEntry& rFieldEntry )
- {
- nFieldType = rFieldEntry.nFieldType;
- nFieldStartPos = rFieldEntry.nFieldStartPos;
- nFieldEndPos = rFieldEntry.nFieldEndPos;
- aFieldUrl = rFieldEntry.aFieldUrl;
- }
-};
-
-
-PPTPortionObj::PPTPortionObj( const PPTStyleSheet& rStyleSheet, UINT32 nInstance, UINT32 nDepth ) :
- PPTCharPropSet ( 0 ),
- mrStyleSheet ( rStyleSheet ),
- mnInstance ( nInstance ),
- mnDepth ( ( nDepth > 4 ) ? 4 : nDepth )
-{
-}
-
-PPTPortionObj::PPTPortionObj( PPTCharPropSet& rCharPropSet, const PPTStyleSheet& rStyleSheet, UINT32 nInstance, UINT32 nDepth ) :
- PPTCharPropSet ( rCharPropSet ),
- mrStyleSheet ( rStyleSheet ),
- mnInstance ( nInstance ),
- mnDepth ( nDepth )
-{
-}
-
-PPTPortionObj::PPTPortionObj( PPTPortionObj& rPortionObj ) :
- PPTCharPropSet ( rPortionObj ),
- mrStyleSheet ( rPortionObj.mrStyleSheet ),
- mnInstance ( rPortionObj.mnInstance ),
- mnDepth ( rPortionObj.mnDepth )
-{
-}
-
-PPTPortionObj::~PPTPortionObj()
-{
-}
-
-BOOL PPTPortionObj::HasTabulator()
-{
- BOOL bRetValue = FALSE;
- sal_Int32 nCount;
- const sal_Unicode* pPtr = maString.GetBuffer();
- for ( nCount = 0; nCount < maString.Len(); nCount++ )
- {
- if ( pPtr[ nCount ] == 0x9 )
- {
- bRetValue = TRUE;
- break;
- }
-
- }
- return bRetValue;
-}
-
-BOOL PPTPortionObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinationInstance )
-{
- UINT32 nMask = 1 << nAttr;
- nRetValue = 0;
-
- UINT32 bIsHardAttribute = ( ( pCharSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
-
- if ( bIsHardAttribute )
- {
- switch ( nAttr )
- {
- case PPT_CharAttr_Bold :
- case PPT_CharAttr_Italic :
- case PPT_CharAttr_Underline :
- case PPT_CharAttr_Shadow :
- case PPT_CharAttr_Strikeout :
- case PPT_CharAttr_Embossed :
- nRetValue = ( pCharSet->mnFlags & nMask ) ? 1 : 0;
- break;
- case PPT_CharAttr_Font :
- nRetValue = pCharSet->mnFont;
- break;
- case PPT_CharAttr_AsianOrComplexFont :
- nRetValue = pCharSet->mnAsianOrComplexFont;
- break;
- case PPT_CharAttr_FontHeight :
- nRetValue = pCharSet->mnFontHeight;
- break;
- case PPT_CharAttr_FontColor :
- nRetValue = pCharSet->mnColor;
- break;
- case PPT_CharAttr_Escapement :
- nRetValue = pCharSet->mnEscapement;
- break;
- default :
- DBG_ERROR( "SJ:PPTPortionObj::GetAttrib ( hard attribute does not exist )" );
- }
- }
- else
- {
- const PPTCharLevel& rCharLevel = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ];
- PPTCharLevel* pCharLevel = NULL;
- if ( ( nDestinationInstance == 0xffffffff )
- || ( mnDepth && ( ( mnInstance == TSS_TYPE_SUBTITLE ) || ( mnInstance == TSS_TYPE_TEXT_IN_SHAPE ) ) ) )
- bIsHardAttribute = 1;
- else if ( nDestinationInstance != mnInstance )
- pCharLevel = &mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ mnDepth ];
- switch( nAttr )
- {
- case PPT_CharAttr_Bold :
- case PPT_CharAttr_Italic :
- case PPT_CharAttr_Underline :
- case PPT_CharAttr_Shadow :
- case PPT_CharAttr_Strikeout :
- case PPT_CharAttr_Embossed :
- {
- nRetValue = ( rCharLevel.mnFlags & nMask ) ? 1 : 0;
- if ( pCharLevel )
- {
- UINT32 nTmp = ( pCharLevel->mnFlags & nMask ) ? 1 : 0;
- if ( nRetValue != nTmp )
- bIsHardAttribute = 1;
- }
- }
- break;
- case PPT_CharAttr_Font :
- {
- nRetValue = rCharLevel.mnFont;
- if ( pCharLevel && ( nRetValue != pCharLevel->mnFont ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_CharAttr_AsianOrComplexFont :
- {
- nRetValue = rCharLevel.mnAsianOrComplexFont;
- if ( pCharLevel && ( nRetValue != pCharLevel->mnAsianOrComplexFont ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_CharAttr_FontHeight :
- {
- nRetValue = rCharLevel.mnFontHeight;
- if ( pCharLevel && ( nRetValue != pCharLevel->mnFontHeight ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_CharAttr_FontColor :
- {
- nRetValue = rCharLevel.mnFontColor;
- if ( pCharLevel && ( nRetValue != pCharLevel->mnFontColor ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_CharAttr_Escapement :
- {
- nRetValue = rCharLevel.mnEscapement;
- if ( pCharLevel && ( nRetValue != pCharLevel->mnEscapement ) )
- bIsHardAttribute = 1;
- }
- break;
- default :
- DBG_ERROR( "SJ:PPTPortionObj::GetAttrib ( attribute does not exist )" );
- }
- }
- return (BOOL)bIsHardAttribute;
-}
-
-void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nDestinationInstance )
-{
- ApplyTo( rSet, rManager, nDestinationInstance, NULL );
-}
-
-void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nDestinationInstance, const PPTTextObj* pTextObj )
-{
- UINT32 nVal;
- if ( GetAttrib( PPT_CharAttr_Bold, nVal, nDestinationInstance ) )
- {
- rSet.Put( SvxWeightItem( nVal != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
- rSet.Put( SvxWeightItem( nVal != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
- rSet.Put( SvxWeightItem( nVal != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
- }
- if ( GetAttrib( PPT_CharAttr_Italic, nVal, nDestinationInstance ) )
- {
- rSet.Put( SvxPostureItem( nVal != 0 ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC ) );
- rSet.Put( SvxPostureItem( nVal != 0 ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
- rSet.Put( SvxPostureItem( nVal != 0 ? ITALIC_NORMAL : ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
- }
- if ( GetAttrib( PPT_CharAttr_Underline, nVal, nDestinationInstance ) )
- rSet.Put( SvxUnderlineItem( nVal != 0 ? UNDERLINE_SINGLE : UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
-
- if ( GetAttrib( PPT_CharAttr_Shadow, nVal, nDestinationInstance ) )
- rSet.Put( SvxShadowedItem( nVal != 0, EE_CHAR_SHADOW ) );
-
- if ( GetAttrib( PPT_CharAttr_Strikeout, nVal, nDestinationInstance ) )
- rSet.Put( SvxCrossedOutItem( nVal != 0 ? STRIKEOUT_SINGLE : STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
-
- sal_uInt32 nAsianFontId = 0xffff;
- if ( GetAttrib( PPT_CharAttr_AsianOrComplexFont, nAsianFontId, nDestinationInstance ) )
- {
- if ( nAsianFontId != 0xffff )
- {
- PptFontEntityAtom* pFontEnityAtom = rManager.GetFontEnityAtom( nAsianFontId );
- if ( pFontEnityAtom )
- {
- rSet.Put( SvxFontItem( pFontEnityAtom->eFamily, pFontEnityAtom->aName,
- String(), pFontEnityAtom->ePitch, pFontEnityAtom->eCharSet, EE_CHAR_FONTINFO_CJK ) );
- rSet.Put( SvxFontItem( pFontEnityAtom->eFamily, pFontEnityAtom->aName,
- String(), pFontEnityAtom->ePitch, pFontEnityAtom->eCharSet, EE_CHAR_FONTINFO_CTL ) );
- }
- }
- }
- if ( GetAttrib( PPT_CharAttr_Font, nVal, nDestinationInstance ) )
- {
- PptFontEntityAtom* pFontEnityAtom = rManager.GetFontEnityAtom( nVal );
- if ( pFontEnityAtom )
- rSet.Put( SvxFontItem( pFontEnityAtom->eFamily, pFontEnityAtom->aName, String(), pFontEnityAtom->ePitch, pFontEnityAtom->eCharSet, EE_CHAR_FONTINFO ) );
- }
- if ( GetAttrib( PPT_CharAttr_FontHeight, nVal, nDestinationInstance ) ) // Schriftgrad in Point
- {
- sal_uInt32 nHeight = rManager.ScalePoint( nVal );
- rSet.Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
- rSet.Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
- rSet.Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
- }
-
- if ( GetAttrib( PPT_CharAttr_Embossed, nVal, nDestinationInstance ) )
- rSet.Put( SvxCharReliefItem( nVal != 0 ? RELIEF_EMBOSSED : RELIEF_NONE, EE_CHAR_RELIEF ) );
- if ( nVal ) /* if Embossed is set, the font color depends to the fillstyle/color of the object,
- if the object has no fillstyle, the font color depends to fillstyle of the background */
- {
- Color aDefColor( COL_BLACK );
- MSO_FillType eFillType = mso_fillSolid;
- if ( rManager.GetPropertyValue( DFF_Prop_fNoFillHitTest ) & 0x10 )
- eFillType = (MSO_FillType)rManager.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
- else
- eFillType = mso_fillBackground;
- switch( eFillType )
- {
- case mso_fillShade :
- case mso_fillShadeCenter :
- case mso_fillShadeShape :
- case mso_fillShadeScale :
- case mso_fillShadeTitle :
- case mso_fillSolid :
- aDefColor = rManager.MSO_CLR_ToColor( rManager.GetPropertyValue( DFF_Prop_fillColor ) );
- break;
- case mso_fillPattern :
- aDefColor = rManager.MSO_CLR_ToColor( rManager.GetPropertyValue( DFF_Prop_fillBackColor ) );
- break;
- case mso_fillTexture :
- {
- Graphic aGraf;
- if ( rManager.GetBLIP( rManager.GetPropertyValue( DFF_Prop_fillBlip ), aGraf, NULL ) )
- {
- Bitmap aBmp( aGraf.GetBitmap() );
- Size aSize( aBmp.GetSizePixel() );
- if ( aSize.Width() && aSize.Height() )
- {
- if ( aSize.Width () > 64 )
- aSize.Width () = 64;
- if ( aSize.Height() > 64 )
- aSize.Height() = 64;
-
- ULONG nRt = 0, nGn = 0, nBl = 0;
- BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
- if( pAcc )
- {
- const long nWidth = aSize.Width();
- const long nHeight = aSize.Height();
-
- if( pAcc->HasPalette() )
- {
- for( long nY = 0L; nY < nHeight; nY++ )
- {
- for( long nX = 0L; nX < nWidth; nX++ )
- {
- const BitmapColor& rCol = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
- nRt+=rCol.GetRed(); nGn+=rCol.GetGreen(); nBl+=rCol.GetBlue();
- }
- }
- }
- else
- {
- for( long nY = 0L; nY < nHeight; nY++ )
- {
- for( long nX = 0L; nX < nWidth; nX++ )
- {
- const BitmapColor aCol( pAcc->GetPixel( nY, nX ) );
- nRt+=aCol.GetRed(); nGn+=aCol.GetGreen(); nBl+=aCol.GetBlue();
- }
- }
- }
- aBmp.ReleaseAccess( pAcc );
- sal_uInt32 nC = ( aSize.Width() * aSize.Height() );
- nRt /= nC;
- nGn /= nC;
- nBl /= nC;
- aDefColor = Color(sal_uInt8( nRt ), sal_uInt8( nGn ),sal_uInt8( nBl ) );
- }
- }
- }
- }
- break;
- case mso_fillBackground :
- {
- if ( pTextObj ) // the textobject is needed
- {
- const SfxItemSet* pItemSet = pTextObj->GetBackground();
- if ( pItemSet )
- {
- const SfxPoolItem* pFillStyleItem = NULL;
- pItemSet->GetItemState( XATTR_FILLSTYLE, FALSE, &pFillStyleItem );
- if ( pFillStyleItem )
- {
- XFillStyle eFillStyle = ((XFillStyleItem*)pFillStyleItem)->GetValue();
- switch( eFillStyle )
- {
- case XFILL_SOLID :
- {
- const SfxPoolItem* pFillColorItem = NULL;
- pItemSet->GetItemState( XATTR_FILLCOLOR, FALSE, &pFillColorItem );
- if ( pFillColorItem )
- aDefColor = ((XColorItem*)pFillColorItem)->GetColorValue();
- }
- break;
- case XFILL_GRADIENT :
- {
- const SfxPoolItem* pGradientItem = NULL;
- pItemSet->GetItemState( XATTR_FILLGRADIENT, FALSE, &pGradientItem );
- if ( pGradientItem )
- aDefColor = ((XFillGradientItem*)pGradientItem)->GetGradientValue().GetStartColor();
- }
- break;
- case XFILL_HATCH :
- case XFILL_BITMAP :
- aDefColor = Color( COL_WHITE );
- break;
- default: break;
- }
- }
- }
- }
- }
- break;
-// case mso_fillPicture :
- default: break;
- }
- rSet.Put( SvxColorItem( aDefColor, EE_CHAR_COLOR ) );
- }
- else
- {
- if ( GetAttrib( PPT_CharAttr_FontColor, nVal, nDestinationInstance ) ) // Textfarbe (4Byte-Arg)
- {
- Color aCol( rManager.MSO_TEXT_CLR_ToColor( nVal ) );
- rSet.Put( SvxColorItem( aCol, EE_CHAR_COLOR ) );
- if ( nDestinationInstance == 0xffffffff )
- mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ].mnFontColorInStyleSheet = aCol;
- }
- else if ( nVal & 0x0f000000 ) // this is not a hard attribute, but maybe the page has a different colerscheme,
- { // so that in this case we must use a hard color attribute
- Color aCol( rManager.MSO_TEXT_CLR_ToColor( nVal ) );
- Color& aColorInSheet = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ mnDepth ].mnFontColorInStyleSheet;
- if ( aColorInSheet != aCol )
- rSet.Put( SvxColorItem( aCol, EE_CHAR_COLOR ) );
- }
- }
-
- if ( GetAttrib( PPT_CharAttr_Escapement, nVal, nDestinationInstance ) ) // Hoch/Tiefstellung in %
- {
- sal_uInt16 nEsc = 0;
- sal_uInt8 nProp = 100;
-
- if ( nVal )
- {
- nEsc = (sal_Int16)nVal;
- nProp = DFLT_ESC_PROP;
- }
- SvxEscapementItem aItem( nEsc, nProp, EE_CHAR_ESCAPEMENT );
- rSet.Put( aItem );
- }
- if ( mnLanguage[ 0 ] )
- rSet.Put( SvxLanguageItem( mnLanguage[ 0 ], EE_CHAR_LANGUAGE ) );
- if ( mnLanguage[ 1 ] )
- rSet.Put( SvxLanguageItem( mnLanguage[ 1 ], EE_CHAR_LANGUAGE_CJK ) );
- if ( mnLanguage[ 2 ] )
- rSet.Put( SvxLanguageItem( mnLanguage[ 2 ], EE_CHAR_LANGUAGE_CTL ) );
-}
-
-SvxFieldItem* PPTPortionObj::GetTextField()
-{
- if ( mpFieldItem )
- return new SvxFieldItem( *mpFieldItem );
- return NULL;
-}
-
-// -----------------------------------------------------------------------
-
-PPTParagraphObj::PPTParagraphObj( const PPTStyleSheet& rStyleSheet, UINT32 nInstance, UINT16 nDepth ) :
- PPTNumberFormatCreator ( NULL ),
- mrStyleSheet ( rStyleSheet ),
- mnInstance ( nInstance ),
- mbTab ( TRUE ), // style sheets always have to get the right tabulator setting
- mnPortionCount ( 0 ),
- mpPortionList ( NULL )
-{
- if ( nDepth > 4 )
- nDepth = 4;
- pParaSet->mnDepth = nDepth;
-}
-
-PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, const PPTStyleSheet& rStyleSheet,
- UINT32 nInstance, PPTTextRulerInterpreter& rRuler ) :
- PPTParaPropSet ( *( (PPTParaPropSet*)rPropReader.aParaPropList.GetCurObject() ) ),
- PPTNumberFormatCreator ( NULL ),
- PPTTextRulerInterpreter ( rRuler ),
- mrStyleSheet ( rStyleSheet ),
- mnInstance ( nInstance ),
- mbTab ( FALSE ),
- mnCurrentObject ( 0 ),
- mnPortionCount ( 0 ),
- mpPortionList ( NULL )
-{
- sal_uInt32 nCurPos = rPropReader.aCharPropList.GetCurPos();
- PPTCharPropSet* pCharPropSet = (PPTCharPropSet*)rPropReader.aCharPropList.GetCurObject();
- if ( pCharPropSet )
- {
- sal_uInt32 nCurrentParagraph = pCharPropSet->mnParagraph;
- for ( ; pCharPropSet && ( pCharPropSet->mnParagraph == nCurrentParagraph ); pCharPropSet = (PPTCharPropSet*)rPropReader.aCharPropList.Next() )
- mnPortionCount++; // counting number of portions that are part of this paragraph
- pCharPropSet = (PPTCharPropSet*)rPropReader.aCharPropList.Seek( nCurPos );
-
- mpPortionList = new PPTPortionObj*[ mnPortionCount ];
- for ( UINT32 i = 0; i < mnPortionCount; i++ )
- {
- if ( pCharPropSet )
- {
- PPTPortionObj* pPPTPortion = new PPTPortionObj( *pCharPropSet, rStyleSheet, nInstance, pParaSet->mnDepth );
- mpPortionList[ i ] = pPPTPortion;
- if ( !mbTab )
- mbTab = mpPortionList[ i ]->HasTabulator();
- }
- else
- {
- DBG_ERROR( "SJ:PPTParagraphObj::It seems that there are missing some textportions" );
- mpPortionList[ i ] = NULL;
- }
- pCharPropSet = (PPTCharPropSet*)rPropReader.aCharPropList.Next();
- }
- }
-}
-
-PPTParagraphObj::~PPTParagraphObj()
-{
- ImplClear();
-}
-
-void PPTParagraphObj::AppendPortion( PPTPortionObj& rPPTPortion )
-{
- UINT32 i;
- PPTPortionObj** mpOldPortionList = mpPortionList;
- mpPortionList = new PPTPortionObj*[ ++mnPortionCount ];
- for ( i = 0; i < mnPortionCount - 1; i++ )
- mpPortionList[ i ] = mpOldPortionList[ i ];
- delete[] mpOldPortionList;
- mpPortionList[ mnPortionCount - 1 ] = new PPTPortionObj( rPPTPortion );
- if ( !mbTab )
- mbTab = mpPortionList[ mnPortionCount - 1 ]->HasTabulator();
-}
-
-void PPTParagraphObj::UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const
-{
- if ( nBulletRelSize > 0x7fff ) // a negative value is the absolute bullet height
- {
- sal_uInt16 nFontHeight = 0;
- if ( mpPortionList )
- {
- PPTPortionObj* pPortion = mpPortionList[ 0 ];
- if ( pPortion && ( pPortion->pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_FontHeight ) ) )
- nFontHeight = pPortion->pCharSet->mnFontHeight;
- }
- // if we do not have a hard attributed fontheight, the fontheight is taken from the style
- if ( !nFontHeight )
- nFontHeight = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontHeight;
- nBulletRelSize = nFontHeight ? ((-((sal_Int16)nBulletRelSize)) * 100 ) / nFontHeight : 100;
- }
-}
-
-BOOL PPTParagraphObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinationInstance )
-{
- UINT32 nMask = 1 << nAttr;
- nRetValue = 0;
-
- if ( nAttr > 21 )
- {
- DBG_ERROR( "SJ:PPTParagraphObj::GetAttrib - attribute does not exist" );
- return FALSE;
- }
-
- UINT32 bIsHardAttribute = ( ( pParaSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
-
- if ( bIsHardAttribute )
- {
- if ( nAttr == PPT_ParaAttr_BulletColor )
- {
- sal_Bool bHardBulletColor;
- if ( pParaSet->mnAttrSet & ( 1 << PPT_ParaAttr_BuHardColor ) )
- bHardBulletColor = pParaSet->mpArry[ PPT_ParaAttr_BuHardColor ] != 0;
- else
- bHardBulletColor = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags
- & ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0;
- if ( bHardBulletColor )
- nRetValue = pParaSet->mnBulletColor;
- else
- {
- nRetValue = PPT_COLSCHEME_TEXT_UND_ZEILEN;
- if ( ( nDestinationInstance != 0xffffffff ) && mnPortionCount )
- {
- PPTPortionObj* pPortion = mpPortionList[ 0 ];
- if ( pPortion )
- {
- if ( pPortion->pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_FontColor ) )
- nRetValue = pPortion->pCharSet->mnColor;
- else
- nRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
- }
- }
- }
- }
- else if ( nAttr == PPT_ParaAttr_BulletFont )
- {
- sal_Bool bHardBuFont;
- if ( pParaSet->mnAttrSet & ( 1 << PPT_ParaAttr_BuHardFont ) )
- bHardBuFont = pParaSet->mpArry[ PPT_ParaAttr_BuHardFont ] != 0;
- else
- bHardBuFont = ( mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ].mnBuFlags
- & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0;
- if ( bHardBuFont )
- nRetValue = pParaSet->mpArry[ PPT_ParaAttr_BulletFont ];
- else
- {
- // it is the font used which assigned to the first character of the following text
- nRetValue = 0;
- if ( ( nDestinationInstance != 0xffffffff ) && mnPortionCount )
- {
- PPTPortionObj* pPortion = mpPortionList[ 0 ];
- if ( pPortion )
- {
- if ( pPortion->pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Font ) )
- nRetValue = pPortion->pCharSet->mnFont;
- else
- nRetValue = mrStyleSheet.mpCharSheet[ nDestinationInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont;
- }
- }
- }
- }
- else
- nRetValue = pParaSet->mpArry[ nAttr ];
- }
- else
- {
- const PPTParaLevel& rParaLevel = mrStyleSheet.mpParaSheet[ mnInstance ]->maParaLevel[ pParaSet->mnDepth ];
-
- PPTParaLevel* pParaLevel = NULL;
- if ( ( nDestinationInstance == 0xffffffff )
- || ( pParaSet->mnDepth && ( ( mnInstance == TSS_TYPE_SUBTITLE ) || ( mnInstance == TSS_TYPE_TEXT_IN_SHAPE ) ) ) )
- bIsHardAttribute = 1;
- else if ( nDestinationInstance != mnInstance )
- pParaLevel = &mrStyleSheet.mpParaSheet[ nDestinationInstance ]->maParaLevel[ pParaSet->mnDepth ];
- switch ( nAttr )
- {
- case PPT_ParaAttr_BulletOn :
- {
- nRetValue = rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn );
- if ( pParaLevel )
- {
- if ( nRetValue != ( (sal_uInt32)pParaLevel->mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn ) ) )
- bIsHardAttribute = 1;
- }
- }
- break;
- case PPT_ParaAttr_BuHardFont :
- case PPT_ParaAttr_BuHardColor :
- case PPT_ParaAttr_BuHardHeight :
- DBG_ERROR( "SJ:PPTParagraphObj::GetAttrib - this attribute does not make sense" );
- break;
- case PPT_ParaAttr_BulletChar :
- {
- nRetValue = rParaLevel.mnBulletChar;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletChar ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_BulletFont :
- {
- sal_Bool bHardBuFont;
- if ( pParaSet->mnAttrSet & ( 1 << PPT_ParaAttr_BuHardFont ) )
- bHardBuFont = pParaSet->mpArry[ PPT_ParaAttr_BuHardFont ] != 0;
- else
- bHardBuFont = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardFont ) ) != 0;
- if ( bHardBuFont )
- {
- nRetValue = rParaLevel.mnBulletFont;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletFont ) )
- bIsHardAttribute = 1;
- }
- else
- {
- if ( mnPortionCount )
- {
- PPTPortionObj* pPortion = mpPortionList[ 0 ];
- if ( pPortion )
- bIsHardAttribute = pPortion->GetAttrib( PPT_CharAttr_Font, nRetValue, nDestinationInstance );
- }
- else
- {
- nRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFont;
- bIsHardAttribute = 1;
- }
- }
- }
- break;
- case PPT_ParaAttr_BulletHeight :
- {
- nRetValue = rParaLevel.mnBulletHeight;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletHeight ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_BulletColor :
- {
- sal_Bool bHardBulletColor;
- if ( pParaSet->mnAttrSet & ( 1 << PPT_ParaAttr_BuHardColor ) )
- bHardBulletColor = pParaSet->mpArry[ PPT_ParaAttr_BuHardColor ] != 0;
- else
- bHardBulletColor = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardColor ) ) != 0;
- if ( bHardBulletColor )
- {
- nRetValue = rParaLevel.mnBulletColor;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletColor ) )
- bIsHardAttribute = 1;
- }
- else
- {
- if ( mnPortionCount )
- {
- PPTPortionObj* pPortion = mpPortionList[ 0 ];
- if ( pPortion )
- bIsHardAttribute = pPortion->GetAttrib( PPT_CharAttr_FontColor, nRetValue, nDestinationInstance );
- }
- else
- {
- nRetValue = mrStyleSheet.mpCharSheet[ mnInstance ]->maCharLevel[ pParaSet->mnDepth ].mnFontColor;
- bIsHardAttribute = 1;
- }
- }
- }
- break;
- case PPT_ParaAttr_Adjust :
- {
- nRetValue = rParaLevel.mnAdjust;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnAdjust ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_LineFeed :
- {
- nRetValue = rParaLevel.mnLineFeed;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnLineFeed ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_UpperDist :
- {
- nRetValue = rParaLevel.mnUpperDist;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnUpperDist ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_LowerDist :
- {
- nRetValue = rParaLevel.mnLowerDist;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnLowerDist ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_TextOfs :
- {
- nRetValue = rParaLevel.mnTextOfs;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnTextOfs ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_BulletOfs :
- {
- nRetValue = rParaLevel.mnBulletOfs;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletOfs ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_DefaultTab :
- {
- nRetValue = rParaLevel.mnDefaultTab;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBulletOfs ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_AsianLB_1 :
- {
- nRetValue = rParaLevel.mnAsianLineBreak & 1;
- if ( pParaLevel && ( nRetValue != ( (sal_uInt32)pParaLevel->mnAsianLineBreak & 1 ) ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_AsianLB_2 :
- {
- nRetValue = ( rParaLevel.mnAsianLineBreak >> 1 ) & 1;
- if ( pParaLevel && ( nRetValue != ( ( (sal_uInt32)pParaLevel->mnAsianLineBreak >> 1 ) & 1 ) ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_AsianLB_3 :
- {
- nRetValue = ( rParaLevel.mnAsianLineBreak >> 2 ) & 1;
- if ( pParaLevel && ( nRetValue != ( ( (sal_uInt32)pParaLevel->mnAsianLineBreak >> 2 ) & 1 ) ) )
- bIsHardAttribute = 1;
- }
- break;
- case PPT_ParaAttr_BiDi :
- {
- nRetValue = rParaLevel.mnBiDi;
- if ( pParaLevel && ( nRetValue != pParaLevel->mnBiDi ) )
- bIsHardAttribute = 1;
- }
- break;
- }
- }
- return (BOOL)bIsHardAttribute;
-}
-
-void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, sal_uInt32 nDestinationInstance, const PPTParagraphObj* /*pPrev*/)
-{
- INT16 nVal2;
- UINT32 nVal, nUpperDist, nLowerDist;
- UINT32 nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : mnInstance;
-
- if ( ( nDestinationInstance != 0xffffffff ) || ( pParaSet->mnDepth <= 1 ) )
- {
- SvxNumBulletItem* pNumBulletItem = mrStyleSheet.mpNumBulletItem[ nInstance ];
- if ( pNumBulletItem )
- {
- SvxNumberFormat aNumberFormat( SVX_NUM_NUMBER_NONE );
- if ( GetNumberFormat( rManager, aNumberFormat, this, nDestinationInstance, rStartNumbering ) )
- {
- if ( aNumberFormat.GetNumberingType() == SVX_NUM_NUMBER_NONE )
- {
- aNumberFormat.SetLSpace( 0 );
- aNumberFormat.SetAbsLSpace( 0 );
- aNumberFormat.SetFirstLineOffset( 0 );
- aNumberFormat.SetCharTextDistance( 0 );
- aNumberFormat.SetFirstLineIndent( 0 );
- aNumberFormat.SetIndentAt( 0 );
- }
- SvxNumBulletItem aNewNumBulletItem( *pNumBulletItem );
- SvxNumRule* pRule = aNewNumBulletItem.GetNumRule();
- if ( pRule )
- {
- pRule->SetLevel( pParaSet->mnDepth, aNumberFormat );
- sal_uInt16 i, n;
- for ( i = 0; i < pRule->GetLevelCount(); i++ )
- {
- if ( i != pParaSet->mnDepth )
- {
- n = i > 4 ? 4 : i;
-
- SvxNumberFormat aNumberFormat2( pRule->GetLevel( i ) );
- const PPTParaLevel& rParaLevel = mrStyleSheet.mpParaSheet[ nInstance ]->maParaLevel[ n ];
- const PPTCharLevel& rCharLevel = mrStyleSheet.mpCharSheet[ nInstance ]->maCharLevel[ n ];
- sal_uInt32 nColor;
- if ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BuHardColor ) )
- nColor = rParaLevel.mnBulletColor;
- else
- nColor = rCharLevel.mnFontColor;
- aNumberFormat2.SetBulletColor( rManager.MSO_TEXT_CLR_ToColor( nColor ) );
- pRule->SetLevel( i, aNumberFormat2 );
- }
- }
- rSet.Put( aNewNumBulletItem );
- }
- }
- }
- }
-
- UINT32 nIsBullet2, _nTextOfs, _nBulletOfs, nHardAttribute = 0;
- GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
- nHardAttribute += GetAttrib( PPT_ParaAttr_TextOfs, _nTextOfs, nDestinationInstance );
- nHardAttribute += GetAttrib( PPT_ParaAttr_BulletOfs, _nBulletOfs, nDestinationInstance );
- if ( !nIsBullet2 )
- {
- SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
- UINT16 nAbsLSpace = (UINT16)( ( (UINT32)_nTextOfs * 2540 ) / 576 );
- UINT16 nFirstLineOffset = nAbsLSpace - (UINT16)( ( (UINT32)_nBulletOfs * 2540 ) / 576 );
- aLRSpaceItem.SetLeft( nAbsLSpace );
- aLRSpaceItem.SetTxtFirstLineOfstValue( -nFirstLineOffset );
- rSet.Put( aLRSpaceItem );
- }
- else
- {
- SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
- aLRSpaceItem.SetLeft( 0 );
- aLRSpaceItem.SetTxtFirstLineOfstValue( 0 );
- rSet.Put( aLRSpaceItem );
- }
- if ( GetAttrib( PPT_ParaAttr_Adjust, nVal, nDestinationInstance ) )
- {
- if ( nVal <= 3 )
- { // Absatzausrichtung
- static SvxAdjust __READONLY_DATA aAdj[ 4 ] = { SVX_ADJUST_LEFT, SVX_ADJUST_CENTER, SVX_ADJUST_RIGHT, SVX_ADJUST_BLOCK };
- rSet.Put( SvxAdjustItem( aAdj[ nVal ], EE_PARA_JUST ) );
- }
- }
-
- if ( GetAttrib( PPT_ParaAttr_AsianLB_1, nVal, nDestinationInstance ) )
- rSet.Put( SfxBoolItem( EE_PARA_FORBIDDENRULES, nVal != 0 ) );
- if ( GetAttrib( PPT_ParaAttr_AsianLB_3, nVal, nDestinationInstance ) )
- rSet.Put( SfxBoolItem( EE_PARA_HANGINGPUNCTUATION, nVal != 0 ) );
-
- if ( GetAttrib( PPT_ParaAttr_BiDi, nVal, nDestinationInstance ) )
- rSet.Put( SvxFrameDirectionItem( nVal == 1 ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
-
- // LineSpacing
- PPTPortionObj* pPortion = First();
- BOOL bIsHardAttribute = GetAttrib( PPT_ParaAttr_LineFeed, nVal, nDestinationInstance );
- nVal2 = (INT16)nVal;
- sal_uInt32 nFont = sal_uInt32();
- if ( pPortion && pPortion->GetAttrib( PPT_CharAttr_Font, nFont, nDestinationInstance ) )
- bIsHardAttribute = TRUE;
-
- if ( bIsHardAttribute )
- {
- if ( pPortion && ( nVal2 > 200 ) )
- {
- UINT32 nFontHeight;
- pPortion->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
- nVal2 = -(sal_Int16)( ( nFontHeight * nVal * 8 ) / 100 );
- }
- rSet.Put( SdrTextFixedCellHeightItem( TRUE ), SDRATTR_TEXT_USEFIXEDCELLHEIGHT );
- SvxLineSpacingItem aItem( 200, EE_PARA_SBL );
- if ( nVal2 <= 0 )
- aItem.SetLineHeight( (UINT16)( rManager.ScalePoint( -nVal2 ) / 8 ) );
- else
- {
- sal_uInt8 nPropLineSpace = (BYTE)nVal2;
- aItem.SetPropLineSpace( nPropLineSpace );
- aItem.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
- }
- rSet.Put( aItem );
- }
-
- // Paragraph Spacing
- UINT32 nFontHeight = 0;
- bIsHardAttribute = ( (UINT32)GetAttrib( PPT_ParaAttr_UpperDist, nUpperDist, nDestinationInstance ) +
- (UINT32)GetAttrib( PPT_ParaAttr_LowerDist, nLowerDist, nDestinationInstance ) ) != 0;
- if ( ( nUpperDist > 0 ) || ( nLowerDist > 0 ) )
- {
- if ( mnPortionCount )
- {
- mpPortionList[ mnPortionCount - 1 ]->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
- if ( ((INT16)nUpperDist) > 0 )
- nUpperDist = - (sal_Int16)( ( nFontHeight * nUpperDist * 100 ) / 1000 );
- if ( ((INT16)nLowerDist) > 0 )
- nLowerDist = - (sal_Int16)( ( nFontHeight * nLowerDist * 100 ) / 1000 );
- }
- bIsHardAttribute = TRUE;
- }
- if ( bIsHardAttribute )
- {
- SvxULSpaceItem aULSpaceItem( EE_PARA_ULSPACE );
- nVal2 = (INT16)nUpperDist;
- if ( nVal2 <= 0 )
- aULSpaceItem.SetUpper( (UINT16)(((UINT32) - nVal2 * 2540 ) / ( 72 * 8 ) ) );
- else
- {
- aULSpaceItem.SetUpperValue( 0 );
- aULSpaceItem.SetPropUpper( (UINT16)nUpperDist == 100 ? 101 : (UINT16)nUpperDist );
- }
- nVal2 = (INT16)nLowerDist;
- if ( nVal2 <= 0 )
- aULSpaceItem.SetLower( (UINT16)(((UINT32) - nVal2 * 2540 ) / ( 72 * 8 ) ) );
- else
- {
- aULSpaceItem.SetLowerValue( 0 );
- aULSpaceItem.SetPropLower( (UINT16)nLowerDist == 100 ? 101 : (UINT16)nLowerDist );
- }
- rSet.Put( aULSpaceItem );
- }
-
- if ( mbTab ) // makes it sense to apply tabsettings
- {
- UINT32 i, nDefaultTab, nTab, nTextOfs2 = 0;
- UINT32 nLatestManTab = 0;
- GetAttrib( PPT_ParaAttr_TextOfs, nTextOfs2, nDestinationInstance );
- GetAttrib( PPT_ParaAttr_BulletOfs, nTab, nDestinationInstance );
- GetAttrib( PPT_ParaAttr_BulletOn, i, nDestinationInstance );
- GetAttrib( PPT_ParaAttr_DefaultTab, nDefaultTab, nDestinationInstance );
- SvxTabStopItem aTabItem( 0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS );
- if ( GetTabCount() )
- {
- for ( i = 0; i < GetTabCount(); i++ )
- {
- SvxTabAdjust eTabAdjust;
- nTab = GetTabOffsetByIndex( (sal_uInt16)i );
- switch( GetTabStyleByIndex( (sal_uInt16)i ) )
- {
- case 1 : eTabAdjust = SVX_TAB_ADJUST_CENTER; break;
- case 2 : eTabAdjust = SVX_TAB_ADJUST_RIGHT; break;
- case 3 : eTabAdjust = SVX_TAB_ADJUST_DECIMAL; break;
- default : eTabAdjust = SVX_TAB_ADJUST_LEFT;
- }
- if ( nTab > nTextOfs2 )
- aTabItem.Insert( SvxTabStop( (UINT16)( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ), eTabAdjust ) );
- }
- nLatestManTab = nTab;
- }
- if ( nIsBullet2 == 0 )
- aTabItem.Insert( SvxTabStop( (sal_uInt16)0 ) );
- if ( nDefaultTab )
- {
- nTab = ( nTextOfs2 > nLatestManTab ) ? nTextOfs2 : nLatestManTab;
- nTab /= nDefaultTab;
- nTab = nDefaultTab * ( 1 + nTab );
- for ( i = 0; ( i < 20 ) && ( nTab < 0x1b00 ); i++ )
- {
- aTabItem.Insert( SvxTabStop( (UINT16)( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ) ) );
- nTab += nDefaultTab;
- }
- }
- rSet.Put( aTabItem );
- }
-}
-
-UINT32 PPTParagraphObj::GetTextSize()
-{
- UINT32 nCount, nRetValue = 0;
- for ( UINT32 i = 0; i < mnPortionCount; i++ )
- {
- PPTPortionObj* pPortionObj = mpPortionList[ i ];
- nCount = pPortionObj->Count();
- if ( ( !nCount ) && pPortionObj->mpFieldItem )
- nCount++;
- nRetValue += nCount;
- }
- return nRetValue;
-}
-
-PPTPortionObj* PPTParagraphObj::First()
-{
- mnCurrentObject = 0;
- if ( !mnPortionCount )
- return NULL;
- return mpPortionList[ 0 ];
-}
-
-PPTPortionObj* PPTParagraphObj::Next()
-{
- UINT32 i = mnCurrentObject + 1;
- if ( i >= mnPortionCount )
- return NULL;
- mnCurrentObject++;
- return mpPortionList[ i ];
-}
-
-void PPTParagraphObj::ImplClear()
-{
- for ( void* pPtr = First(); pPtr; pPtr = Next() )
- delete (PPTPortionObj*)pPtr;
- delete[] mpPortionList;
-}
-
-PPTFieldEntry::~PPTFieldEntry()
-{
- delete pField1;
- delete pField2;
- delete pString;
-};
-
-void PPTFieldEntry::GetDateTime( const sal_uInt32 nVal, SvxDateFormat& eDateFormat, SvxTimeFormat& eTimeFormat )
-{
- eDateFormat = SVXDATEFORMAT_APPDEFAULT;
- eTimeFormat = SVXTIMEFORMAT_APPDEFAULT;
- // ID auswerten
- switch( nVal )
- {
- case 0:
- case 6:
- eDateFormat = SVXDATEFORMAT_A;
- break;
- case 1:
- eDateFormat = SVXDATEFORMAT_F;
- break;
- case 2:
- case 3:
- eDateFormat = SVXDATEFORMAT_D;
- break;
- case 4:
- case 5:
- eDateFormat = SVXDATEFORMAT_C;
- break;
- case 7:
- eDateFormat = SVXDATEFORMAT_A;
- case 9:
- eTimeFormat = SVXTIMEFORMAT_24_HM;
- break;
- case 8:
- eDateFormat = SVXDATEFORMAT_A;
- case 11:
- eTimeFormat = SVXTIMEFORMAT_12_HM;
- break;
- case 10:
- eTimeFormat = SVXTIMEFORMAT_24_HMS;
- break;
- case 12:
- eTimeFormat = SVXTIMEFORMAT_12_HMS;
- break;
- }
-}
-
-void PPTFieldEntry::SetDateTime( UINT32 nVal )
-{
- SvxDateFormat eDateFormat;
- SvxTimeFormat eTimeFormat;
- GetDateTime( nVal, eDateFormat, eTimeFormat );
- if ( eDateFormat != SVXDATEFORMAT_APPDEFAULT )
- pField1 = new SvxFieldItem( SvxDateField( Date(), SVXDATETYPE_VAR, eDateFormat ), EE_FEATURE_FIELD );
- if ( eTimeFormat != SVXTIMEFORMAT_APPDEFAULT )
- {
- SvxFieldItem* pFieldItem = new SvxFieldItem( SvxExtTimeField( Time(), SVXTIMETYPE_VAR, eTimeFormat ), EE_FEATURE_FIELD );
- if ( pField1 )
- pField2 = pFieldItem;
- else
- pField1 = pFieldItem;
- }
-}
-
-// -----------------------------------------------------------------------
-
-PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport, PptSlidePersistEntry& rPersistEntry, DffObjData* pObjData ) :
- mpImplTextObj ( new ImplPPTTextObj( rPersistEntry ) )
-{
- mpImplTextObj->mnRefCount = 1;
- mpImplTextObj->mnShapeId = 0;
- mpImplTextObj->mnShapeMaster = 0;
- mpImplTextObj->mpPlaceHolderAtom = NULL;
- mpImplTextObj->mnDestinationInstance = mpImplTextObj->mnInstance = 4;
- mpImplTextObj->mnCurrentObject = 0;
- mpImplTextObj->mnParagraphCount = 0;
- mpImplTextObj->mpParagraphList = NULL;
- mpImplTextObj->mnTextFlags = 0;
- mpImplTextObj->meShapeType = ( pObjData && pObjData->bShapeType ) ? pObjData->eShapeType : mso_sptMin;
-
- DffRecordHeader aExtParaHd;
- aExtParaHd.nRecType = 0; // set empty
-
- UINT32 bStatus = TRUE;
-
- DffRecordHeader aShapeContainerHd;
- rIn >> aShapeContainerHd;
-
- if ( ( pObjData == NULL ) || ( pObjData->bShapeType ) )
- {
- PPTExtParaProv* pExtParaProv = rSdrPowerPointImport.pPPTStyleSheet->pExtParaProv;
- if ( pObjData )
- {
- mpImplTextObj->mnShapeId = pObjData->nShapeId;
- if ( pObjData->nSpFlags & SP_FHAVEMASTER )
- mpImplTextObj->mnShapeMaster = rSdrPowerPointImport.GetPropertyValue( DFF_Prop_hspMaster, 0 );
- }
- ////////////////
- // ClientData //
- ////////////////
- if ( rSdrPowerPointImport.maShapeRecords.SeekToContent( rIn, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- UINT32 nOldPos = rIn.Tell();
- DffRecordHeader& aClientDataContainerHd = *rSdrPowerPointImport.maShapeRecords.Current();
- DffRecordHeader aPlaceHolderAtomHd;
- if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_OEPlaceholderAtom, aClientDataContainerHd.GetRecEndFilePos(), &aPlaceHolderAtomHd ) )
- {
- mpImplTextObj->mpPlaceHolderAtom = new PptOEPlaceholderAtom;
- rIn >> *( mpImplTextObj->mpPlaceHolderAtom );
- }
- rIn.Seek( nOldPos );
- DffRecordHeader aProgTagHd;
- if ( rSdrPowerPointImport.SeekToContentOfProgTag( 9, rIn, aClientDataContainerHd, aProgTagHd ) )
- {
- rIn >> aExtParaHd;
- }
- }
-
- ///////////////////
- // ClientTextBox //
- ///////////////////
- if ( rSdrPowerPointImport.maShapeRecords.SeekToContent( rIn, DFF_msofbtClientTextbox, SEEK_FROM_CURRENT_AND_RESTART ) )
- {
- DffRecordHeader aClientTextBoxHd( *rSdrPowerPointImport.maShapeRecords.Current() );
- UINT32 nTextRulerAtomOfs = 0; // case of zero -> this atom may be found in aClientDataContainerHd;
- // case of -1 -> ther is no atom of this kind
- // else -> this is the fileofs where we can get it
-
- //////////////////////////////////////
- // checkout if this is a referenced //
- // textobj, if so the we will patch //
- // the ClientTextBoxHd for a //
- // equivalent one //
- //////////////////////////////////////
- DffRecordHeader aTextHd;
- if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_OutlineTextRefAtom, aClientTextBoxHd.GetRecEndFilePos(), &aTextHd ) )
- {
- UINT32 nRefNum;
- rIn >> nRefNum;
-
- if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_TextRulerAtom, aClientTextBoxHd.GetRecEndFilePos() ) )
- nTextRulerAtomOfs = rIn.Tell();
- else
- nTextRulerAtomOfs = 0xffffffff;
-
- UINT32 nInstance = 0;
- switch( rSdrPowerPointImport.eAktPageKind )
- {
- case PPT_NOTEPAGE :
- nInstance++;
- case PPT_MASTERPAGE :
- nInstance++;
- case PPT_SLIDEPAGE :
- break;
- default :
- bStatus = FALSE;
- }
- if ( bStatus )
- {
- sal_uInt32 nSlideId = rSdrPowerPointImport.GetAktPageId();
- if ( !nSlideId )
- bStatus = FALSE;
- else
- {
- if ( !aExtParaHd.nRecType )
- {
- UINT32 nOldPos = rIn.Tell();
- // try to locate the referenced ExtendedParaHd
- DffRecordHeader* pHd = pExtParaProv->
- aExtendedPresRules.GetRecordHeader( PPT_PST_ExtendedParagraphHeaderAtom,
- SEEK_FROM_CURRENT_AND_RESTART );
- DffRecordHeader aPresRuleHd;
- DffRecordHeader* pFirst = pHd;
-
- UINT32 nTmpSlideId, nTmpRef;
- while ( pHd )
- {
- pHd->SeekToContent( rIn );
- rIn >> nTmpSlideId
- >> nTmpRef; // this seems to be the instance
-
- if ( ( nTmpSlideId == nSlideId ) && ( pHd->nRecInstance == nRefNum ) )
- {
- pHd->SeekToEndOfRecord( rIn );
- rIn >> aPresRuleHd;
- if ( aPresRuleHd.nRecType == PPT_PST_ExtendedParagraphAtom )
- {
- aExtParaHd = aPresRuleHd;
- break;
- }
- }
- pHd = pExtParaProv->
- aExtendedPresRules.GetRecordHeader( PPT_PST_ExtendedParagraphHeaderAtom,
- SEEK_FROM_CURRENT_AND_RESTART );
- if ( pHd == pFirst )
- break;
- }
- rIn.Seek( nOldPos );
- }
- // now pHd points to the right SlideListWithText Container
- PptSlidePersistList* pPageList = rSdrPowerPointImport.GetPageList( rSdrPowerPointImport.eAktPageKind );
- PptSlidePersistEntry* pE = NULL;
- if ( pPageList && ( rSdrPowerPointImport.nAktPageNum < pPageList->Count() ) )
- pE = (*pPageList)[ rSdrPowerPointImport.nAktPageNum ];
- if ( (!pE) || (!pE->nSlidePersistStartOffset) || ( pE->aPersistAtom.nSlideId != nSlideId ) )
- bStatus = sal_False;
- else
- {
- rIn.Seek( pE->nSlidePersistStartOffset );
- // now we got the right page and are searching for the right
- // TextHeaderAtom
- while ( rIn.Tell() < pE->nSlidePersistEndOffset )
- {
- rIn >> aClientTextBoxHd;
- if ( aClientTextBoxHd.nRecType == PPT_PST_TextHeaderAtom )
- {
- if ( aClientTextBoxHd.nRecInstance == nRefNum )
- {
- aClientTextBoxHd.SeekToEndOfRecord( rIn );
- break;
- }
- }
- aClientTextBoxHd.SeekToEndOfRecord( rIn );
- }
- if ( rIn.Tell() > pE->nSlidePersistEndOffset )
- bStatus = FALSE;
- else
- { // patching the RecordHeader
- aClientTextBoxHd.nFilePos -= DFF_COMMON_RECORD_HEADER_SIZE;
- aClientTextBoxHd.nRecLen += DFF_COMMON_RECORD_HEADER_SIZE;
- aClientTextBoxHd.nRecType = DFF_msofbtClientTextbox;
- aClientTextBoxHd.nRecVer = DFF_PSFLAG_CONTAINER;
-
- // we have to calculate the correct record len
- DffRecordHeader aTmpHd;
- while ( rIn.Tell() < pE->nSlidePersistEndOffset )
- {
- rIn >> aTmpHd;
- if ( ( aTmpHd.nRecType == PPT_PST_SlidePersistAtom ) || ( aTmpHd.nRecType == PPT_PST_TextHeaderAtom ) )
- break;
- aTmpHd.SeekToEndOfRecord( rIn );
- aClientTextBoxHd.nRecLen += aTmpHd.nRecLen + DFF_COMMON_RECORD_HEADER_SIZE;
- }
- aClientTextBoxHd.SeekToContent( rIn );
- }
- }
- }
- }
- }
-
- if ( bStatus )
- {
- if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_TextHeaderAtom, aClientTextBoxHd.GetRecEndFilePos(), &aTextHd ) )
- {
- // TextHeaderAtom is always the first Atom
- UINT16 nInstance;
- rIn >> nInstance; // this number tells us the TxMasterStyleAtom Instance
- if ( nInstance > 8 )
- nInstance = 4;
- aTextHd.SeekToEndOfRecord( rIn );
- mpImplTextObj->mnInstance = nInstance;
-
- UINT32 nFilePos = rIn.Tell();
- if ( rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom,
- PPT_PST_TextCharsAtom,
- aClientTextBoxHd.GetRecEndFilePos() )
- || rSdrPowerPointImport.SeekToRec( rIn,
- PPT_PST_StyleTextPropAtom,
- aClientTextBoxHd.GetRecEndFilePos() ) )
- {
- PPTTextRulerInterpreter aTextRulerInterpreter( nTextRulerAtomOfs, rSdrPowerPointImport,
- aClientTextBoxHd, rIn );
-
- PPTStyleTextPropReader aStyleTextPropReader( rIn, rSdrPowerPointImport, aClientTextBoxHd,
- aTextRulerInterpreter, aExtParaHd, nInstance );
- sal_uInt32 nParagraphs = mpImplTextObj->mnParagraphCount = aStyleTextPropReader.aParaPropList.Count();
- if ( nParagraphs )
- {
- // the language settings will be merged into the list of PPTCharPropSet
- DffRecordHeader aTextSpecInfoHd;
- PPTTextSpecInfoAtomInterpreter aTextSpecInfoAtomInterpreter;
- if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_TextSpecInfoAtom,
- aClientTextBoxHd.GetRecEndFilePos(), &aTextSpecInfoHd ) )
- {
- if ( aTextSpecInfoAtomInterpreter.Read( rIn, aTextSpecInfoHd, PPT_PST_TextSpecInfoAtom,
- &(rSdrPowerPointImport.pPPTStyleSheet->maTxSI) ) )
- {
- sal_uInt32 nI = 0;
- PPTTextSpecInfo* pSpecInfo;
- for ( pSpecInfo = (PPTTextSpecInfo*)aTextSpecInfoAtomInterpreter.aList.First();
- pSpecInfo; pSpecInfo =(PPTTextSpecInfo*)aTextSpecInfoAtomInterpreter.aList.Next() )
- {
- sal_uInt32 nCharIdx = pSpecInfo->nCharIdx;
-
- // portions and text have to been splitted in some cases
- for ( ; nI < aStyleTextPropReader.aCharPropList.Count(); )
- {
- PPTCharPropSet* pSet = (PPTCharPropSet*)aStyleTextPropReader.aCharPropList.GetObject( nI );
- if ( pSet->mnOriginalTextPos < nCharIdx )
- {
- pSet->mnLanguage[ 0 ] = pSpecInfo->nLanguage[ 0 ];
- pSet->mnLanguage[ 1 ] = pSpecInfo->nLanguage[ 1 ];
- pSet->mnLanguage[ 2 ] = pSpecInfo->nLanguage[ 2 ];
- // test if the current portion needs to be splitted
- if ( pSet->maString.Len() > 1 )
- {
- sal_Int32 nIndexOfNextPortion = pSet->maString.Len() + pSet->mnOriginalTextPos;
- sal_Int32 nNewLen = nIndexOfNextPortion - nCharIdx;
- sal_Int32 nOldLen = pSet->maString.Len() - nNewLen;
-
- if ( ( nNewLen > 0 ) && ( nOldLen > 0 ) )
- {
- String aString( pSet->maString );
- PPTCharPropSet* pNew = new PPTCharPropSet( *pSet );
- pSet->maString = String( aString, 0, (sal_uInt16)nOldLen );
- pNew->maString = String( aString, (sal_uInt16)nOldLen, (sal_uInt16)nNewLen );
- pNew->mnOriginalTextPos += nOldLen;
- aStyleTextPropReader.aCharPropList.Insert( pNew, nI + 1 );
- }
- }
- }
- else
- break;
- nI++;
- }
- }
- }
-#ifdef DBG_UTIL
- else
- {
- if (!(rSdrPowerPointImport.rImportParam.nImportFlags & PPT_IMPORTFLAGS_NO_TEXT_ASSERT))
- {
- DBG_ERROR( "SdrTextSpecInfoAtomInterpreter::Ctor(): parsing error, this document needs to be analysed (SJ)" );
- }
- }
-#endif
- }
- //
- // now will search for possible textextensions such as date/time fields
- // or ParaTabStops and append them on this textobj
- //
- rIn.Seek( nFilePos );
- List* pFieldList = NULL;
- while ( rIn.Tell() < aClientTextBoxHd.GetRecEndFilePos() )
- {
- rIn >> aTextHd;
- UINT16 nVal = 0;
- PPTFieldEntry* pEntry = NULL;
- switch ( aTextHd.nRecType )
- {
- case PPT_PST_DateTimeMCAtom :
- {
- pEntry = new PPTFieldEntry;
- rIn >> pEntry->nPos
- >> nVal
- >> nVal;
- pEntry->SetDateTime( nVal & 0xff );
- }
- break;
-
- case PPT_PST_FooterMCAtom :
- {
- pEntry = new PPTFieldEntry;
- rIn >> pEntry->nPos;
- pEntry->pField1 = new SvxFieldItem( SvxFooterField(), EE_FEATURE_FIELD );
- }
- break;
-
- case PPT_PST_HeaderMCAtom :
- {
- pEntry = new PPTFieldEntry;
- rIn >> pEntry->nPos;
- pEntry->pField1 = new SvxFieldItem( SvxHeaderField(), EE_FEATURE_FIELD );
- }
- break;
-
- case PPT_PST_GenericDateMCAtom :
- {
- pEntry = new PPTFieldEntry;
- rIn >> pEntry->nPos;
- pEntry->pField1 = new SvxFieldItem( SvxDateTimeField(), EE_FEATURE_FIELD );
- if ( rPersistEntry.pHeaderFooterEntry ) // sj: #i34111# on master pages it is possible
- { // that there is no HeaderFooterEntry available
- if ( rPersistEntry.pHeaderFooterEntry->nAtom & 0x20000 ) // auto date time
- pEntry->SetDateTime( rPersistEntry.pHeaderFooterEntry->nAtom & 0xff );
- else
- pEntry->pString = new String( rPersistEntry.pHeaderFooterEntry->pPlaceholder[ nVal ] );
- }
- }
- break;
-
- case PPT_PST_SlideNumberMCAtom :
- case PPT_PST_RTFDateTimeMCAtom :
- {
- pEntry = new PPTFieldEntry;
- if ( aTextHd.nRecLen >= 4 )
- {
- rIn >> pEntry->nPos
- >> nVal;
-
- // ID auswerten
- //SvxFieldItem* pFieldItem = NULL;
- switch( aTextHd.nRecType )
- {
- case PPT_PST_SlideNumberMCAtom:
- pEntry->pField1 = new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD );
- break;
-
- case PPT_PST_RTFDateTimeMCAtom:
- {
- // Rude workaround for one specal case reported
- // by a customer. (#i75203#)
-
- // Don't even attempt to handle the general use
- // case for PPT_PST_RTFDateTimeMCAtom (a generic
- // MS style date/time format string). Just handle
- // the special case where the format string
- // contains only one or several possibly empty
- // quoted strings. I.e. something that doesn't
- // expand to any date or time at all, but to a
- // fixed string. How on earth somebody manages to
- // produce such things in PPT slides I have no
- // idea.
- if (nVal == 0)
- {
- sal_Unicode n;
- xub_StrLen nLen;
- String aStr;
- bool inquote = FALSE;
- for (nLen = 0, n = 0; nLen < 64; nLen++)
- {
- rIn >> n;
-
- // Collect quoted characters into aStr
- if ( n == '\'')
- inquote = !inquote;
- else if (!n)
- {
- // End of format string
- pEntry->pString = new String( aStr );
- break;
- }
- else if (!inquote)
- {
- // Non-quoted character, i.e. a real
- // format specifier. We don't handle
- // those. Sorry.
- break;
- }
- else
- {
- aStr += n;
- }
- }
- }
- if ( pEntry->pString == NULL )
- {
- // Handle as previously
- pEntry->pField1 = new SvxFieldItem( SvxDateField( Date(), SVXDATETYPE_FIX ), EE_FEATURE_FIELD );
- }
- }
- }
- }
- }
- break;
-
- case PPT_PST_InteractiveInfo :
- {
- DffRecordHeader aHdInteractiveInfoAtom;
- if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_InteractiveInfoAtom, aTextHd.GetRecEndFilePos(), &aHdInteractiveInfoAtom ) )
- {
- PptInteractiveInfoAtom aInteractiveInfoAtom;
- rIn >> aInteractiveInfoAtom;
- for ( SdHyperlinkEntry* pHyperlink = (SdHyperlinkEntry*)rSdrPowerPointImport.aHyperList.First();
- pHyperlink; pHyperlink = (SdHyperlinkEntry*)rSdrPowerPointImport.aHyperList.Next() )
- {
- if ( pHyperlink->nIndex == aInteractiveInfoAtom.nExHyperlinkId )
- {
- aTextHd.SeekToEndOfRecord( rIn );
- rIn >> aTextHd;
- if ( aTextHd.nRecType != PPT_PST_TxInteractiveInfoAtom )
- {
- aTextHd.SeekToBegOfRecord( rIn );
- continue;
- }
- else
- {
- sal_uInt32 nStartPos, nEndPos;
- rIn >> nStartPos
- >> nEndPos;
- if ( nEndPos )
- {
- pEntry = new PPTFieldEntry;
- pEntry->nPos = (sal_uInt16)nStartPos;
- pEntry->nTextRangeEnd = (sal_uInt16)nEndPos;
- String aTarget( pHyperlink->aTarget );
- if ( pHyperlink->aConvSubString.Len() )
- {
- aTarget.Append( (sal_Unicode)'#' );
- aTarget.Append( pHyperlink->aConvSubString );
- }
- pEntry->pField1 = new SvxFieldItem( SvxURLField( aTarget, String(), SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
- }
- }
- break;
- }
- }
- }
- }
- break;
- }
- aTextHd.SeekToEndOfRecord( rIn );
- if ( pEntry )
- {
- if ( !pFieldList )
- pFieldList = new List;
- UINT32 n;
- for ( n = 0; n < pFieldList->Count(); n++ )
- { // sorting fields ( hi >> lo )
- if ( ( (PPTFieldEntry*)pFieldList->GetObject( n ) )->nPos < pEntry->nPos )
- break;
- }
- pFieldList->Insert( pEntry, (UINT32)n );
- }
- }
- if ( pFieldList )
- {
- PPTFieldEntry* pFE = (PPTFieldEntry*)pFieldList->First();
- List& aCharPropList = aStyleTextPropReader.aCharPropList;
-
- sal_Int32 i = nParagraphs - 1;
- sal_Int32 n = aCharPropList.Count() - 1;
-
- // at this point we just have a list of textportions(aCharPropList)
- // the next while loop tries to resolve the list of fields(pFieldList)
- while( pFE && ( n >= 0 ) && ( i >= 0 ) )
- {
- PPTCharPropSet* pSet = (PPTCharPropSet*)aCharPropList.GetObject( n );
- String aString( pSet->maString );
- UINT32 nCount = aString.Len();
- UINT32 nPos = pSet->mnOriginalTextPos + nCount;
- while ( pFE && nCount-- )
- {
- nPos--;
- while ( pFE && ( pFE->nPos > nPos ) )
- pFE = (PPTFieldEntry*)pFieldList->Next();
- if ( !pFE )
- break;
-
- if ( pFE->nPos == nPos )
- {
- if ( aString.GetChar( (sal_uInt16)nCount ) == 0x2a )
- {
- UINT32 nBehind = aString.Len() - ( nCount + 1 );
- pSet->maString = String();
- if ( nBehind )
- {
- PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( aString, (UINT16)nCount + 1, (UINT16)nBehind );
- aCharPropList.Insert( pNewCPS, n + 1 );
- }
- if ( pFE->pField2 )
- {
- PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->mpFieldItem = pFE->pField2, pFE->pField2 = NULL;
- aCharPropList.Insert( pNewCPS, n + 1 );
-
- pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( String( RTL_CONSTASCII_USTRINGPARAM( " " ) ) );
- aCharPropList.Insert( pNewCPS, n + 1 );
- }
- if ( nCount )
- {
- PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( aString, (UINT16)0, (UINT16)nCount );
- aCharPropList.Insert( pNewCPS, n++ );
- }
- if ( pFE->pField1 )
- {
- pSet->mpFieldItem = pFE->pField1, pFE->pField1 = NULL;
- }
- else if ( pFE->pString )
- pSet->maString = *pFE->pString;
- }
- else
- {
- if ( pFE->nTextRangeEnd ) // text range hyperlink
- {
- sal_uInt32 nHyperLen = pFE->nTextRangeEnd - nPos;
- if ( nHyperLen )
- {
- PPTCharPropSet* pBefCPS = NULL;
- if ( nCount )
- {
- pBefCPS = new PPTCharPropSet( *pSet );
- pSet->maString = String( pSet->maString, (UINT16)nCount, (UINT16)( pSet->maString.Len() - nCount ) );
- }
- sal_uInt32 nIdx = n;
- sal_Int32 nHyperLenLeft = nHyperLen;
-
- while ( ( aCharPropList.Count() > nIdx ) && nHyperLenLeft )
- {
- // the textrange hyperlink can take more than 1 paragraph
- // the solution here is to clone the hyperlink...
-
- PPTCharPropSet* pCurrent = (PPTCharPropSet*)aCharPropList.GetObject( nIdx );
- sal_Int32 nNextStringLen = pCurrent->maString.Len();
-
- const SvxURLField* pField = (const SvxURLField*)pFE->pField1->GetField();
-
- if ( pCurrent->mpFieldItem )
- {
- pCurrent->SetColor( PPT_COLSCHEME_A_UND_HYPERLINK );
- if ( pCurrent->mpFieldItem->GetField()->ISA( SvxURLField ) )
- break;
- nHyperLenLeft--;
- }
- else if ( nNextStringLen )
- {
- if ( nNextStringLen <= nHyperLenLeft )
- {
- pCurrent->mpFieldItem = new SvxFieldItem( SvxURLField( pField->GetURL(), pCurrent->maString, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
- nHyperLenLeft -= nNextStringLen;
-
- if ( nHyperLenLeft )
- {
- // if the next portion is in a higher paragraph,
- // the textrange is to decrease (because of the LineBreak character)
- if ( aCharPropList.Count() > ( nIdx + 1 ) )
- {
- PPTCharPropSet* pNext = (PPTCharPropSet*)aCharPropList.GetObject( nIdx + 1 );
- if ( pNext->mnParagraph > pCurrent->mnParagraph )
- nHyperLenLeft--;
- }
- }
- }
- else
- {
- PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pCurrent );
- pNewCPS->maString = String( pCurrent->maString, (UINT16)nHyperLenLeft, (UINT16)( nNextStringLen - nHyperLenLeft ) );
- aCharPropList.Insert( pNewCPS, nIdx + 1 );
- String aRepresentation( pCurrent->maString, 0, (UINT16)nHyperLenLeft );
- pCurrent->mpFieldItem = new SvxFieldItem( SvxURLField( pField->GetURL(), aRepresentation, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
- nHyperLenLeft = 0;
- }
- pCurrent->maString = String();
- pCurrent->SetColor( PPT_COLSCHEME_A_UND_HYPERLINK );
- }
- nIdx++;
- }
- delete pFE->pField1, pFE->pField1 = NULL;
-
- if ( pBefCPS )
- {
- pBefCPS->maString = String( aString, (UINT16)0, (UINT16)nCount );
- aCharPropList.Insert( pBefCPS, n++ );
-
- }
- }
- }
- }
- break;
- }
- }
- n--;
- }
- for ( void* pPtr = pFieldList->First(); pPtr; pPtr = pFieldList->Next() )
- delete (PPTFieldEntry*)pPtr;
- delete pFieldList;
- }
- mpImplTextObj->mpParagraphList = new PPTParagraphObj*[ nParagraphs ];
- aStyleTextPropReader.aCharPropList.First();
- UINT32 nCount = 0;
- for ( void* pPtr = aStyleTextPropReader.aParaPropList.First();
- pPtr;
- pPtr = aStyleTextPropReader.aParaPropList.Next() )
- {
- PPTParagraphObj* pPara = new PPTParagraphObj( aStyleTextPropReader, *rSdrPowerPointImport.pPPTStyleSheet, nInstance, aTextRulerInterpreter );
- mpImplTextObj->mpParagraphList[ nCount++ ] = pPara;
-
- sal_uInt32 nParaAdjust, nFlags = 0;
- pPara->GetAttrib( PPT_ParaAttr_Adjust, nParaAdjust, GetInstance() );
-
- switch ( nParaAdjust )
- {
- case 0 : nFlags = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT; break;
- case 1 : nFlags = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER; break;
- case 2 : nFlags = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT; break;
- case 3 : nFlags = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK; break;
- }
- mpImplTextObj->mnTextFlags |= nFlags;
- }
- }
- }
- }
- }
- }
- }
-}
-
-PPTTextObj::PPTTextObj( PPTTextObj& rTextObj )
-{
- mpImplTextObj = rTextObj.mpImplTextObj;
- mpImplTextObj->mnRefCount++;
-}
-
-PPTTextObj::~PPTTextObj()
-{
- ImplClear();
-}
-
-PPTParagraphObj* PPTTextObj::First()
-{
- mpImplTextObj->mnCurrentObject = 0;
- if ( !mpImplTextObj->mnParagraphCount )
- return NULL;
- return mpImplTextObj->mpParagraphList[ 0 ];
-}
-
-PPTParagraphObj* PPTTextObj::Next()
-{
- UINT32 i = mpImplTextObj->mnCurrentObject + 1;
- if ( i >= mpImplTextObj->mnParagraphCount )
- return NULL;
- mpImplTextObj->mnCurrentObject++;
- return mpImplTextObj->mpParagraphList[ i ];
-}
-
-const SfxItemSet* PPTTextObj::GetBackground() const
-{
- if ( mpImplTextObj->mrPersistEntry.pBObj )
- return &mpImplTextObj->mrPersistEntry.pBObj->GetMergedItemSet();
- else
- return NULL;
-}
-
-void PPTTextObj::ImplClear()
-{
- if ( ! ( --mpImplTextObj->mnRefCount ) )
- {
- for ( PPTParagraphObj* pPtr = First(); pPtr; pPtr = Next() )
- delete pPtr;
- delete[] mpImplTextObj->mpParagraphList;
- delete mpImplTextObj->mpPlaceHolderAtom;
- delete mpImplTextObj;
- }
-}
-
-PPTTextObj& PPTTextObj::operator=( PPTTextObj& rTextObj )
-{
- if ( this != &rTextObj )
- {
- ImplClear();
- mpImplTextObj = rTextObj.mpImplTextObj;
- mpImplTextObj->mnRefCount++;
- }
- return *this;
-}
-
-sal_Bool IsLine( const SdrObject* pObj )
-{
- return pObj->ISA( SdrPathObj ) && ((SdrPathObj*)pObj)->IsLine() && (((SdrPathObj*)pObj)->GetPointCount() == 2 );
-}
-
-sal_Bool GetCellPosition( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns,
- sal_Int32& nTableIndex, sal_Int32& nRow, sal_Int32& nRowCount, sal_Int32& nColumn, sal_Int32& nColumnCount )
-{
- Rectangle aSnapRect( pObj->GetSnapRect() );
- sal_Bool bCellObject = ( aSnapRect.GetWidth() > 1 ) && ( aSnapRect.GetHeight() > 1 );
- if ( bCellObject )
- {
- std::set< sal_Int32 >::const_iterator aRowIter( rRows.find( aSnapRect.Top() ) );
- std::set< sal_Int32 >::const_iterator aColumnIter( rColumns.find( aSnapRect.Left() ) );
- if ( ( aRowIter == rRows.end() ) || ( aColumnIter == rColumns.end() ) )
- bCellObject = sal_False;
- else
- {
- nRowCount = 1;
- nRow = std::distance( rRows.begin(), aRowIter );
- while( ++aRowIter != rRows.end() )
- {
- if ( *aRowIter >= aSnapRect.Bottom() )
- break;
- nRowCount++;
- }
- nColumnCount = 1;
- nColumn = std::distance( rColumns.begin(), aColumnIter );
- while( ++aColumnIter != rColumns.end() )
- {
- if ( *aColumnIter >= aSnapRect.Right() )
- break;
- nColumnCount++;
- }
- nTableIndex = nRow * rColumns.size() + nColumn;
- }
- }
- return bCellObject;
-}
-
-#define LinePositionLeft 0x01000000
-#define LinePositionTop 0x02000000
-#define LinePositionRight 0x04000000
-#define LinePositionBottom 0x08000000
-#define LinePositionTLBR 0x10000000
-#define LinePositionBLTR 0x20000000
-
-
-void GetRowPositions( const Rectangle& rSnapRect, const std::set< sal_Int32 >& rRows,
- const std::set< sal_Int32 >& rColumns, std::vector< sal_Int32 >& rPositions, sal_Int32 nColumn, sal_Int32 nFlags )
-{
- std::set< sal_Int32 >::const_iterator aRow( rRows.find( rSnapRect.Top() ) );
- if ( aRow != rRows.end() )
- {
- sal_Int32 nRow = std::distance( rRows.begin(), aRow );
- while( ( aRow != rRows.end() ) && ((*aRow) < rSnapRect.Bottom() ) )
- {
- if ( nFlags & LinePositionLeft )
- rPositions.push_back( ( ( nRow * rColumns.size() ) + nColumn ) | LinePositionLeft );
- if ( nFlags & LinePositionRight )
- rPositions.push_back( ( ( nRow * rColumns.size() ) + ( nColumn - 1 ) ) | LinePositionRight );
-
- nRow++;
- aRow++;
- }
- }
-}
-
-
-void GetColumnPositions( const Rectangle& rSnapRect, const std::set< sal_Int32 >& /* rRows */,
- const std::set< sal_Int32 >& rColumns, std::vector< sal_Int32 >& rPositions, sal_Int32 nRow, sal_Int32 nFlags )
-{
- std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( rSnapRect.Left() ) );
- if ( aColumn != rColumns.end() )
- {
- sal_Int32 nColumn = std::distance( rColumns.begin(), aColumn );
- while( ( aColumn != rColumns.end() ) && ((*aColumn) < rSnapRect.Right() ) )
- {
- if ( nFlags & LinePositionTop )
- rPositions.push_back( ( ( nRow * rColumns.size() ) + nColumn ) | LinePositionTop );
- if ( nFlags & LinePositionBottom )
- rPositions.push_back( ( ( ( nRow - 1 ) * rColumns.size() ) + nColumn ) | LinePositionBottom );
-
- nColumn++;
- aColumn++;
- }
- }
-}
-
-void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns,
- std::vector< sal_Int32 >& rPositions, const Rectangle& rGroupSnap )
-{
- Rectangle aSnapRect( pObj->GetSnapRect() );
- if ( aSnapRect.Left() == aSnapRect.Right() )
- {
- std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( aSnapRect.Left() ) );
- if ( ( aColumn != rColumns.end() ) || ( aSnapRect.Left() == rGroupSnap.Right() ) )
- {
- sal_Int32 nColumn, nFlags;
- if ( aColumn != rColumns.end() )
- {
- nColumn = std::distance( rColumns.begin(), aColumn );
- nFlags = LinePositionLeft;
- if ( aColumn != rColumns.begin() )
- nFlags |= LinePositionRight;
- }
- else
- {
- nColumn = rColumns.size();
- nFlags = LinePositionRight;
- }
- GetRowPositions( aSnapRect, rRows, rColumns, rPositions, nColumn, nFlags );
- }
- }
- else if ( aSnapRect.Top() == aSnapRect.Bottom() )
- {
- std::set< sal_Int32 >::const_iterator aRow( rRows.find( aSnapRect.Top() ) );
- if ( ( aRow != rRows.end() ) || ( aSnapRect.Top() == rGroupSnap.Bottom() ) )
- {
- sal_Int32 nRow, nFlags;
- if ( aRow != rRows.end() )
- {
- nRow = std::distance( rRows.begin(), aRow );
- nFlags = LinePositionTop;
- if ( aRow != rRows.begin() )
- nFlags |= LinePositionBottom;
- }
- else
- {
- nRow = rRows.size();
- nFlags = LinePositionBottom;
- }
- GetColumnPositions( aSnapRect, rRows, rColumns, rPositions, nRow, nFlags );
- }
- }
- else
- {
- sal_uInt32 nPosition = 0;
- Point aPt1( ((SdrPathObj*)pObj)->GetPoint( 0 ) );
- Point aPt2( ((SdrPathObj*)pObj)->GetPoint( 1 ) );
- if ( aPt1.X() < aPt2.X() )
- nPosition |= aPt1.Y() < aPt2.Y() ? LinePositionTLBR : LinePositionBLTR;
- else
- nPosition |= aPt1.Y() < aPt2.Y() ? LinePositionBLTR : LinePositionTLBR;
-
- std::set< sal_Int32 >::const_iterator aRow( rRows.find( aPt1.Y() < aPt2.Y() ? aPt1.Y() : aPt2.Y() ) );
- std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( aPt1.X() < aPt2.X() ? aPt1.X() : aPt2.X() ) );
- if ( ( aRow != rRows.end() ) && ( aColumn != rColumns.end() ) )
- {
- nPosition |= ( std::distance( rRows.begin(), aRow ) * rColumns.size() ) + std::distance( rColumns.begin(), aColumn );
- rPositions.push_back( nPosition );
- }
- }
-}
-
-void CreateTableRows( Reference< XTableRows > xTableRows, const std::set< sal_Int32 >& rRows, sal_Int32 nTableBottom )
-{
- if ( rRows.size() > 1 )
- xTableRows->insertByIndex( 0, rRows.size() - 1 );
-
- std::set< sal_Int32 >::const_iterator aIter( rRows.begin() );
- sal_Int32 nLastPosition( *aIter );
- Reference< XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW );
- for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
- {
- sal_Int32 nHeight;
- if ( ++aIter != rRows.end() )
- {
- nHeight = *aIter - nLastPosition;
- nLastPosition = *aIter;
- }
- else
- nHeight = nTableBottom - nLastPosition;
-
- static const rtl::OUString sWidth( RTL_CONSTASCII_USTRINGPARAM ( "Height" ) );
- Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW );
- xPropSet->setPropertyValue( sWidth, Any( nHeight ) );
- }
-}
-
-void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::set< sal_Int32 >& rColumns, sal_Int32 nTableRight )
-{
- if ( rColumns.size() > 1 )
- xTableColumns->insertByIndex( 0, rColumns.size() - 1 );
-
- std::set< sal_Int32 >::const_iterator aIter( rColumns.begin() );
- sal_Int32 nLastPosition( *aIter );
- Reference< XIndexAccess > xIndexAccess( xTableColumns, UNO_QUERY_THROW );
- for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
- {
- sal_Int32 nWidth;
- if ( ++aIter != rColumns.end() )
- {
- nWidth = *aIter - nLastPosition;
- nLastPosition = *aIter;
- }
- else
- nWidth = nTableRight - nLastPosition;
-
- static const rtl::OUString sWidth( RTL_CONSTASCII_USTRINGPARAM ( "Width" ) );
- Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW );
- xPropSet->setPropertyValue( sWidth, Any( nWidth ) );
- }
-}
-
-void MergeCells( const Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan )
-{
- DBG_ASSERT( (nColSpan > 1) || (nRowSpan > 1), "nonsense parameter!!" );
- DBG_ASSERT( (nCol >= 0) && (nCol < xTable->getColumnCount()) && (nRow >= 0) && (nRow < xTable->getRowCount()), "die celle gibts nicht!!" );
- DBG_ASSERT( (nColSpan >= 1) && ((nCol + nColSpan - 1) < xTable->getColumnCount()), "nColSpan murks!" );
- DBG_ASSERT( (nRowSpan >= 1) && ((nRow + nRowSpan - 1) < xTable->getRowCount()), "nRowSpan murks!" );
-
- if( xTable.is() ) try
- {
- Reference< XMergeableCellRange > xRange( xTable->createCursorByRange( xTable->getCellRangeByPosition( nCol, nRow,nCol + nColSpan - 1, nRow + nRowSpan - 1 ) ), UNO_QUERY_THROW );
- if( xRange->isMergeable() )
- xRange->merge();
- }
- catch( Exception& )
- {
- DBG_ASSERT( false, "exception caught!" );
- }
-}
-
-void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
-{
- try
- {
- Reference< XPropertySet > xPropSet( xCell, UNO_QUERY_THROW );
-
- const sal_Int32 nLeftDist(((const SdrTextLeftDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST)).GetValue());
- const sal_Int32 nRightDist(((const SdrTextRightDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST)).GetValue());
- const sal_Int32 nUpperDist(((const SdrTextUpperDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST)).GetValue());
- const sal_Int32 nLowerDist(((const SdrTextLowerDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST)).GetValue());
- static const rtl::OUString sTopBorder( RTL_CONSTASCII_USTRINGPARAM( "TextUpperDistance" ) );
- static const rtl::OUString sBottomBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLowerDistance" ) );
- static const rtl::OUString sLeftBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLeftDistance" ) );
- static const rtl::OUString sRightBorder( RTL_CONSTASCII_USTRINGPARAM( "TextRightDistance" ) );
- xPropSet->setPropertyValue( sTopBorder, Any( nUpperDist ) );
- xPropSet->setPropertyValue( sRightBorder, Any( nRightDist ) );
- xPropSet->setPropertyValue( sLeftBorder, Any( nLeftDist ) );
- xPropSet->setPropertyValue( sBottomBorder, Any( nLowerDist ) );
-
- static const rtl::OUString sTextVerticalAdjust( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) );
- const SdrTextVertAdjust eTextVertAdjust(((const SdrTextVertAdjustItem&)pObj->GetMergedItem(SDRATTR_TEXT_VERTADJUST)).GetValue());
- drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
- if ( eTextVertAdjust == SDRTEXTVERTADJUST_CENTER )
- eVA = drawing::TextVerticalAdjust_CENTER;
- else if ( eTextVertAdjust == SDRTEXTVERTADJUST_BOTTOM )
- eVA = drawing::TextVerticalAdjust_BOTTOM;
- xPropSet->setPropertyValue( sTextVerticalAdjust, Any( eVA ) );
-
- SfxItemSet aSet( pObj->GetMergedItemSet() );
- XFillStyle eFillStyle(((XFillStyleItem&)pObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue());
- ::com::sun::star::drawing::FillStyle eFS( com::sun::star::drawing::FillStyle_NONE );
- switch( eFillStyle )
- {
- case XFILL_SOLID :
- {
- static const rtl::OUString sFillColor( String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ) );
- eFS = com::sun::star::drawing::FillStyle_SOLID;
- Color aFillColor( ((XFillColorItem&)pObj->GetMergedItem( XATTR_FILLCOLOR )).GetColorValue() );
- sal_Int32 nFillColor( aFillColor.GetColor() );
- xPropSet->setPropertyValue( sFillColor, Any( nFillColor ) );
- }
- break;
- case XFILL_GRADIENT :
- {
- eFS = com::sun::star::drawing::FillStyle_GRADIENT;
- XGradient aXGradient(((const XFillGradientItem&)pObj->GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue());
-
- com::sun::star::awt::Gradient aGradient;
- aGradient.Style = (awt::GradientStyle) aXGradient.GetGradientStyle();
- aGradient.StartColor = (INT32)aXGradient.GetStartColor().GetColor();
- aGradient.EndColor = (INT32)aXGradient.GetEndColor().GetColor();
- aGradient.Angle = (short)aXGradient.GetAngle();
- aGradient.Border = aXGradient.GetBorder();
- aGradient.XOffset = aXGradient.GetXOffset();
- aGradient.YOffset = aXGradient.GetYOffset();
- aGradient.StartIntensity = aXGradient.GetStartIntens();
- aGradient.EndIntensity = aXGradient.GetEndIntens();
- aGradient.StepCount = aXGradient.GetSteps();
-
- static const rtl::OUString sFillGradient( String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ) );
- xPropSet->setPropertyValue( sFillGradient, Any( aGradient ) );
- }
- break;
- case XFILL_HATCH :
- eFS = com::sun::star::drawing::FillStyle_HATCH;
- break;
- case XFILL_BITMAP :
- {
- eFS = com::sun::star::drawing::FillStyle_BITMAP;
-
- XFillBitmapItem aXFillBitmapItem((const XFillBitmapItem&)pObj->GetMergedItem( XATTR_FILLBITMAP ));
- XOBitmap aLocalXOBitmap( aXFillBitmapItem.GetBitmapValue() );
- rtl::OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
- aURL += rtl::OUString::createFromAscii( aLocalXOBitmap.GetGraphicObject().GetUniqueID().GetBuffer() );
-
- static const rtl::OUString sFillBitmapURL( String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ) );
- xPropSet->setPropertyValue( sFillBitmapURL, Any( aURL ) );
- }
- break;
- case XFILL_NONE :
- eFS = com::sun::star::drawing::FillStyle_NONE;
- break;
-
- }
- static const rtl::OUString sFillStyle( String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) );
- xPropSet->setPropertyValue( sFillStyle, Any( eFS ) );
- if ( eFillStyle != XFILL_NONE )
- {
- sal_Int16 nFillTransparence( ( (const XFillTransparenceItem&)pObj->GetMergedItem( XATTR_FILLTRANSPARENCE ) ).GetValue() );
- if ( nFillTransparence != 100 )
- {
- nFillTransparence *= 100;
- static const rtl::OUString sFillTransparence( String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparence" ) ) );
- xPropSet->setPropertyValue( sFillTransparence, Any( nFillTransparence ) );
- }
- }
- }
- catch( Exception& )
- {
- }
-}
-
-void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTable, const std::vector< sal_Int32 > vPositions, sal_Int32 nColumns )
-{
- try
- {
- SfxItemSet aSet( pLine->GetMergedItemSet() );
- XLineStyle eLineStyle(((XLineStyleItem&)pLine->GetMergedItem( XATTR_LINESTYLE )).GetValue());
- com::sun::star::table::BorderLine aBorderLine;
- switch( eLineStyle )
- {
- case XLINE_DASH :
- case XLINE_SOLID :
- {
- Color aLineColor( ((XLineColorItem&)pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() );
- aBorderLine.Color = aLineColor.GetColor();
- aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 );
- aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4 );
- aBorderLine.LineDistance = 0;
- }
- break;
- case XLINE_NONE :
- {
- aBorderLine.OuterLineWidth = 0;
- aBorderLine.InnerLineWidth = 0;
- aBorderLine.LineDistance = 0;
- }
- break;
- }
- Reference< XCellRange > xCellRange( xTable, UNO_QUERY_THROW );
- std::vector< sal_Int32 >::const_iterator aIter( vPositions.begin() );
- while( aIter != vPositions.end() )
- {
- static const rtl::OUString sTopBorder( String( RTL_CONSTASCII_USTRINGPARAM( "TopBorder" ) ) );
- static const rtl::OUString sBottomBorder( String( RTL_CONSTASCII_USTRINGPARAM( "BottomBorder" ) ) );
- static const rtl::OUString sLeftBorder( String( RTL_CONSTASCII_USTRINGPARAM( "LeftBorder" ) ) );
- static const rtl::OUString sRightBorder( String( RTL_CONSTASCII_USTRINGPARAM( "RightBorder" ) ) );
- static const rtl::OUString sDiagonalTLBR( RTL_CONSTASCII_USTRINGPARAM ( "DiagonalTLBR" ) );
- static const rtl::OUString sDiagonalBLTR( RTL_CONSTASCII_USTRINGPARAM ( "DiagonalBLTR" ) );
-
- sal_Int32 nPosition = *aIter & 0xffffff;
- sal_Int32 nFlags = *aIter &~0xffffff;
- sal_Int32 nRow = nPosition / nColumns;
- sal_Int32 nColumn = nPosition - ( nRow * nColumns );
- Reference< XCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ) );
- Reference< XPropertySet > xPropSet( xCell, UNO_QUERY_THROW );
-
- if ( nFlags & LinePositionLeft )
- xPropSet->setPropertyValue( sLeftBorder, Any( aBorderLine ) );
- if ( nFlags & LinePositionTop )
- xPropSet->setPropertyValue( sTopBorder, Any( aBorderLine ) );
- if ( nFlags & LinePositionRight )
- xPropSet->setPropertyValue( sRightBorder, Any( aBorderLine ) );
- if ( nFlags & LinePositionBottom )
- xPropSet->setPropertyValue( sBottomBorder, Any( aBorderLine ) );
- if ( nFlags & LinePositionTLBR )
- xPropSet->setPropertyValue( sDiagonalTLBR, Any( sal_True ) );
- if ( nFlags & LinePositionBLTR )
- xPropSet->setPropertyValue( sDiagonalBLTR, Any( sal_True ) );
- aIter++;
- }
- }
- catch( Exception& )
- {
- }
-}
-
-SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer )
-{
- SdrObject* pRet = pGroup;
- sal_uInt32 nRows = pTableArry[ 1 ];
- if ( nRows && pGroup->ISA( SdrObjGroup ) )
- {
- SdrObjList* pSubList(((SdrObjGroup*)pGroup)->GetSubList());
- if ( pSubList )
- {
- std::set< sal_Int32 > aRows;
- std::set< sal_Int32 > aColumns;
-
- SdrObjListIter aGroupIter( *pSubList, IM_DEEPNOGROUPS, FALSE );
- while( aGroupIter.IsMore() )
- {
- const SdrObject* pObj( aGroupIter.Next() );
- if ( !IsLine( pObj ) )
- {
- Rectangle aSnapRect( pObj->GetSnapRect() );
- aRows.insert( aSnapRect.Top() );
- aColumns.insert( aSnapRect.Left() );
- }
- }
- ::sdr::table::SdrTableObj* pTable = new ::sdr::table::SdrTableObj( pSdrModel );
- pTable->uno_lock();
- Reference< XTable > xTable( pTable->getTable() );
- try
- {
- Reference< XColumnRowRange > xColumnRowRange( xTable, UNO_QUERY_THROW );
-
- CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() );
- CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() );
-
- sal_Int32 nCellCount = aRows.size() * aColumns.size();
- sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ];
- for ( sal_Int32 i = 0; i < nCellCount; i++ )
- pMergedCellIndexTable[ i ] = i;
-
- aGroupIter.Reset();
- while( aGroupIter.IsMore() )
- {
- SdrObject* pObj( aGroupIter.Next() );
- if ( !IsLine( pObj ) )
- {
- Rectangle aSnapRect( pObj->GetSnapRect() );
- sal_Int32 nTableIndex = 0;
- sal_Int32 nRow = 0;
- sal_Int32 nRowCount = 0;
- sal_Int32 nColumn = 0;
- sal_Int32 nColumnCount = 0;
- if ( GetCellPosition( pObj, aRows, aColumns, nTableIndex, nRow, nRowCount, nColumn, nColumnCount ) )
- {
- Reference< XCellRange > xCellRange( xTable, UNO_QUERY_THROW );
- Reference< XCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ) );
-
- ApplyCellAttributes( pObj, xCell );
-
- if ( ( nRowCount > 1 ) || ( nColumnCount > 1 ) ) // cell merging
- {
- MergeCells( xTable, nColumn, nRow, nColumnCount, nRowCount );
- for ( sal_Int32 nRowIter = 0; nRowIter < nRowCount; nRowIter++ )
- {
- for ( sal_Int32 nColumnIter = 0; nColumnIter < nColumnCount; nColumnIter++ )
- { // now set the correct index for the merged cell
- pMergedCellIndexTable[ ( ( nRow + nRowIter ) * aColumns.size() ) + nColumn + nColumnIter ] = nTableIndex;
- }
- }
- }
-
- // applying text
- OutlinerParaObject* pParaObject = pObj->GetOutlinerParaObject();
- if ( pParaObject )
- {
- SdrText* pSdrText = pTable->getText( nTableIndex );
- if ( pSdrText )
- pSdrText->SetOutlinerParaObject(new OutlinerParaObject(*pParaObject) );
- }
- }
- }
- }
- aGroupIter.Reset();
- while( aGroupIter.IsMore() )
- {
- SdrObject* pObj( aGroupIter.Next() );
- if ( IsLine( pObj ) )
- {
- std::vector< sal_Int32 > vPositions; // containing cell indexes + cell position
- GetLinePositions( pObj, aRows, aColumns, vPositions, pGroup->GetSnapRect() );
-
- // correcting merged cell position
- std::vector< sal_Int32 >::iterator aIter( vPositions.begin() );
- while( aIter != vPositions.end() )
- {
- sal_Int32 nOldPosition = *aIter & 0xffff;
- sal_Int32 nOldFlags = *aIter & 0xffff0000;
- sal_Int32 nNewPosition = pMergedCellIndexTable[ nOldPosition ] | nOldFlags;
- *aIter++ = nNewPosition;
- }
- ApplyCellLineAttributes( pObj, xTable, vPositions, aColumns.size() );
- }
- }
- delete[] pMergedCellIndexTable;
-
- // we are replacing the whole group object by a single table object, so
- // possibly connections to the group object have to be removed.
- if ( pSolverContainer )
- {
- for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)pSolverContainer->aCList.First();
- pPtr; pPtr = (SvxMSDffConnectorRule*)pSolverContainer->aCList.Next() )
- {
- SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS );
- while( aIter.IsMore() )
- {
- SdrObject* pPartObj = aIter.Next();
- if ( pPtr->pAObj == pPartObj )
- pPtr->pAObj = NULL;
- if ( pPtr->pBObj == pPartObj )
- pPtr->pBObj = NULL;
- }
- }
- }
- pTable->uno_unlock();
- pTable->SetSnapRect( pGroup->GetSnapRect() );
- pRet = pTable;
-
- //Remove Objects from shape map
- SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS );
- while( aIter.IsMore() )
- {
- SdrObject* pPartObj = aIter.Next();
- removeShapeId( pPartObj );
- }
-
- SdrObject::Free( pGroup );
- }
- catch( Exception& )
- {
- pTable->uno_unlock();
- SdrObject* pObj = pTable;
- SdrObject::Free( pObj );
- }
- }
- }
- return pRet;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index c8e2066bf5..4c67ed985c 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -63,12 +63,12 @@
#include <svx/fhgtitem.hxx>
#include <svx/charscaleitem.hxx>
-#include <svtools/whiter.hxx>
-#include <svtools/flagitem.hxx>
-#include <svtools/ptitem.hxx>
-#include <svtools/rectitem.hxx>
+#include <svl/whiter.hxx>
+#include <svl/flagitem.hxx>
+#include <svl/ptitem.hxx>
+#include <svl/rectitem.hxx>
-#include <svtools/rngitem.hxx>
+#include <svl/rngitem.hxx>
#include <sdrpaintwindow.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 21eef709ef..2ba06a6b80 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -48,7 +48,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <svx/obj3d.hxx>
#include <svx/scene3d.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <svx/svdoedge.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 991582d84b..5bf35f2398 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -42,7 +42,7 @@
#include <unotools/ucbstreamhelper.hxx>
#include <tools/string.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svx/xit.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xlndsit.hxx>
@@ -77,24 +77,24 @@
#include "fontitem.hxx"
#include <svx/colritem.hxx>
#include <svx/fhgtitem.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <tools/bigint.hxx>
#include <svx/numitem.hxx>
#include <bulitem.hxx>
#include <svx/outlobj.hxx>
#include "forbiddencharacterstable.hxx"
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <comphelper/processfactory.hxx>
// #90477#
#include <tools/tenccvt.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
// #95114#
#include <vcl/svapp.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <svx/eeitem.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 44a29c619b..a55d46264d 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -46,7 +46,7 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include "unopolyhelper.hxx"
#include <comphelper/processfactory.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <com/sun/star/uno/Sequence.h>
#include <svx/svdogrp.hxx>
#include <vcl/salbtype.hxx> // FRound
@@ -80,7 +80,7 @@
#include <svx/writingmodeitem.hxx>
#include <svx/xlnclit.hxx>
#include <svx/svxids.hrc>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svx/sdr/properties/customshapeproperties.hxx>
#include <svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx>
#include <svx/xlnclit.hxx>
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index 828cd948ff..d447507542 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -46,8 +46,8 @@
#include <svx/svdorect.hxx>
#include <svx/svdocirc.hxx>
#include <svx/svdomeas.hxx>
-#include <svtools/smplhint.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/smplhint.hxx>
+#include <svl/itemiter.hxx>
#include <svx/xenum.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xlnstwit.hxx>
@@ -67,9 +67,9 @@
//#include <svx/charscaleitem.hxx>
#include <svx/xlnstcit.hxx>
#include <svx/xlnwtit.hxx>
-#include <svtools/style.hxx>
-#include <svtools/style.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/style.hxx>
+#include <svl/style.hxx>
+#include <svl/whiter.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xflclit.hxx>
#include <svx/xlntrit.hxx>
@@ -87,7 +87,7 @@
#include <svx/xlnstit.hxx>
#include <svx/sdr/properties/attributeproperties.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include "xlinjoit.hxx"
+#include "svx/xlinjoit.hxx"
#include <svdoimp.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index ae5686b2c6..f5c55af0d8 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -86,7 +86,7 @@
#include <svx/xfltrit.hxx>
#include <svx/xfltrit.hxx>
#include <svx/xflftrit.hxx>
-#include "xlinjoit.hxx"
+#include "svx/xlinjoit.hxx"
#include <svx/unopage.hxx>
#include <svx/eeitem.hxx>
#include <svx/xenum.hxx>
@@ -97,7 +97,7 @@
#include <svx/svdpool.hxx>
#include <svx/editeng.hxx>
#include <vcl/salbtype.hxx> // FRound
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
// #97849#
#include <svx/fmmodel.hxx>
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 8630d2c1d1..13b5f4a3a2 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <tools/bigint.hxx>
#include <svx/xlnwtit.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svx/svdocapt.hxx>
#include <svx/xpool.hxx>
#include <svx/xpoly.hxx>
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 363fa04a3c..39d67e0646 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -30,7 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <tools/bigint.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/xlnedwit.hxx>
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 1c89bbbd70..8c927b1146 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -48,8 +48,8 @@
#include <svx/svdetc.hxx>
#include "svdglob.hxx" // StringCache
#include "svdstr.hrc" // Objektname
-#include <svtools/style.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/style.hxx>
+#include <svl/smplhint.hxx>
#include <svx/eeitem.hxx>
#include "svdoimp.hxx"
#include <svx/sdr/properties/connectorproperties.hxx>
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 67d02ac706..53022c99db 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -41,9 +41,9 @@
#include <sot/storage.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/localfilehelper.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svtools/filter.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <goodies/grfmgr.hxx>
#include <vcl/svapp.hxx>
@@ -58,7 +58,7 @@
#include <svx/svdpagv.hxx>
#include "svdviter.hxx"
#include <svx/svdview.hxx>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <svx/svdograf.hxx>
#include <svx/svdogrp.hxx>
#include <svx/xbitmap.hxx>
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index d1966d1bfc..70cfe07549 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -41,7 +41,7 @@
#include <sfx2/lnkbase.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <svx/xpool.hxx>
#include <svx/xpoly.hxx>
@@ -58,7 +58,7 @@
#include "svdstr.hrc" // Objektname
#include <svx/svxids.hrc>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svx/svdpool.hxx>
#include <svx/sdr/properties/groupproperties.hxx>
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 975d5dea92..38f92739ca 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -45,8 +45,8 @@
#include <svx/svdview.hxx>
#include "svdglob.hxx" // StringCache
#include "svdstr.hrc" // Objektname
-#include <svtools/style.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/style.hxx>
+#include <svl/smplhint.hxx>
#include <svx/eeitem.hxx>
#include <svx/xlnstit.hxx>
#include <svx/xlnstwit.hxx>
@@ -63,7 +63,7 @@
#include <svx/svdogrp.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include "svdoimp.hxx"
#include <svx/sdr/properties/measureproperties.hxx>
#include <svx/sdr/contact/viewcontactofsdrmeasureobj.hxx>
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 1e89aab1b0..7f2dde332a 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -73,8 +73,8 @@
#include <svtools/transfer.hxx>
#include <cppuhelper/implbase5.hxx>
-#include <svtools/solar.hrc>
-#include <svtools/urihelper.hxx>
+#include <svl/solar.hrc>
+#include <svl/urihelper.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -85,7 +85,7 @@
#include <svx/svdetc.hxx>
#include <svx/svdview.hxx>
#include "unomlstr.hxx"
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <svtools/chartprettypainter.hxx>
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdograf.hxx>
diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx
index 8b6d05ca9e..9153794e9d 100644
--- a/svx/source/svdraw/svdopage.cxx
+++ b/svx/source/svdraw/svdopage.cxx
@@ -41,7 +41,7 @@
#include <svx/svdpagv.hxx>
#include <svx/svdoutl.hxx>
#include <svtools/colorcfg.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/sdr/properties/pageproperties.hxx>
// #111111#
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index a0116cd1d9..5d1b83146c 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -51,7 +51,7 @@
#include <svx/editobj.hxx>
#include <svx/outliner.hxx>
#include <svx/fhgtitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svx/adjitem.hxx>
#include <svx/flditem.hxx>
#include <svx/xftouit.hxx>
@@ -59,9 +59,9 @@
#include <svx/xflgrit.hxx>
#include <svx/svdpool.hxx>
#include <svx/xflclit.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svx/editeng.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/itemiter.hxx>
#include <svx/sdr/properties/textproperties.hxx>
// #110496#
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 8cc1ede0ec..004c97f6ef 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -42,7 +42,7 @@
#include <editstat.hxx>
#include <vcl/salbtype.hxx>
#include <svx/sdtfchim.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/animation/animationtiming.hxx>
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 077ddce02e..060b916ad0 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -38,7 +38,7 @@
#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx>
#include <basegfx/range/b2drange.hxx>
#include <vcl/salbtype.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <algorithm>
@@ -63,7 +63,7 @@
#include <svx/xlnclit.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xlnwtit.hxx>
-#include <xlinjoit.hxx>
+#include <svx/xlinjoit.hxx>
#include <svx/xlndsit.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index ff7d82c523..d5d09aea94 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svx/svdotext.hxx>
#include "svditext.hxx"
#include <svx/svdmodel.hxx> // fuer GetMaxObjSize und GetStyleSheetPool
@@ -47,8 +47,8 @@
#include <svx/editview.hxx>
-#include <svtools/smplhint.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/smplhint.hxx>
+#include <svl/whiter.hxx>
#include <svx/outlobj.hxx>
#include <svx/outliner.hxx>
#include <svx/eeitem.hxx>
@@ -56,10 +56,10 @@
#include <svx/fhgtitem.hxx>
#include <svx/charscaleitem.hxx>
-#include <svtools/style.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/style.hxx>
+#include <svl/itemiter.hxx>
#include <svx/lrspitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svx/numitem.hxx>
#include <svx/editeng.hxx>
#include <svx/postitem.hxx>
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 07258ef669..0191eee99e 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -37,7 +37,7 @@
#include <svx/svdoutl.hxx>
#include <svx/outliner.hxx>
#include <editstat.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/eeitem.hxx>
#include <svx/sdtfchim.hxx>
diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx
index 4a6484c230..a55e2d8740 100644
--- a/svx/source/svdraw/svdotxln.cxx
+++ b/svx/source/svdraw/svdotxln.cxx
@@ -51,7 +51,7 @@
#include <linkmgr.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
// #90477#
#include <tools/tenccvt.hxx>
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 9d4917efbc..1dad4b45ce 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -43,7 +43,7 @@
#include <svx/sdr/properties/itemsettools.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svditer.hxx>
#include <drawinglayer/processor2d/textaspolygonextractor2d.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx
index 0df23e7bb0..79972849be 100644
--- a/svx/source/svdraw/svdoutl.cxx
+++ b/svx/source/svdraw/svdoutl.cxx
@@ -36,7 +36,7 @@
#include <editstat.hxx>
#include <svx/svdmodel.hxx>
#include <svx/eeitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
DBG_NAME(SdrOutliner)
/*************************************************************************
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index cf0034903e..f77dc8dc54 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -42,7 +42,7 @@
#endif
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <svx/svdpntv.hxx>
#include <svx/editdata.hxx>
@@ -66,10 +66,10 @@
#include <svx/svdobj.hxx>
#include <svx/svdview.hxx>
#include <svx/sxlayitm.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/itemiter.hxx>
#include <svx/eeitem.hxx>
-#include <svtools/whiter.hxx>
-#include <svtools/style.hxx>
+#include <svl/whiter.hxx>
+#include <svl/style.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/svdouno.hxx>
#include <vcl/svapp.hxx>
@@ -289,14 +289,14 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
// Flag zur Visualisierung von Gruppen
bVisualizeEnteredGroup = TRUE;
- StartListening( maColorConfig );
+ maColorConfig.AddListener(this);
onChangeColorConfig();
}
SdrPaintView::~SdrPaintView()
{
DBG_DTOR(SdrPaintView,NULL);
- EndListening( maColorConfig );
+ maColorConfig.RemoveListener(this);
ClearPageView();
#ifdef DBG_UTIL
@@ -345,12 +345,12 @@ void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint
}
}
}
+}
- if( rHint.ISA( SfxSimpleHint ) && ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_COLORS_CHANGED )
- {
- onChangeColorConfig();
- InvalidateAllWin();
- }
+void SdrPaintView::ConfigurationChanged( ::utl::ConfigurationBroadcaster* , sal_uInt32 )
+{
+ onChangeColorConfig();
+ InvalidateAllWin();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx
index 93c0024ecc..83588ab129 100644
--- a/svx/source/svdraw/svdtext.cxx
+++ b/svx/source/svdraw/svdtext.cxx
@@ -40,7 +40,7 @@
#include "svx/svdmodel.hxx"
#include "svx/fhgtitem.hxx"
#include <svx/eeitem.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
SdrText::SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject /* = 0 */ )
: mpOutlinerParaObject( pOutlinerParaObject )
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 3d8285b895..63643f178d 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -38,7 +38,7 @@
#include <vcl/virdev.hxx>
#include <tools/bigint.hxx>
#include <tools/debug.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 896e4d4aee..d55c311f14 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -47,7 +47,7 @@
#include <svx/sdr/properties/itemsettools.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <svx/svdocapt.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <svx/e3dsceneupdater.hxx>
#include "svdviter.hxx"
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 4b2b463acf..c64937043e 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -185,14 +185,14 @@ SdrView::SdrView(SdrModel* pModel1, OutputDevice* pOut)
{
bTextEditOnObjectsWithoutTextIfTextTool=FALSE;
- StartListening( maAccessibilityOptions );
+ maAccessibilityOptions.AddListener(this);
onAccessibilityOptionsChanged();
}
SdrView::~SdrView()
{
- EndListening( maAccessibilityOptions );
+ maAccessibilityOptions.RemoveListener(this);
}
BOOL SdrView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
@@ -1298,7 +1298,7 @@ XubString SdrView::GetStatusText()
aStr.SearchAndReplaceAscii("%2", UniString::CreateFromInt32(nLin + 1));
aStr.SearchAndReplaceAscii("%3", UniString::CreateFromInt32(nCol + 1));
-#ifndef PRODUCT
+#ifdef DBG_UTIL
aStr += UniString( RTL_CONSTASCII_USTRINGPARAM( ", Level " ) );
aStr += UniString::CreateFromInt32( pTextEditOutliner->GetDepth( aSel.nEndPara ) );
#endif
@@ -1560,14 +1560,10 @@ BOOL SdrView::IsDeleteMarkedPossible() const
return IsDeleteMarkedObjPossible();
}
-void SdrView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
+void SdrView::ConfigurationChanged( ::utl::ConfigurationBroadcaster*p, sal_uInt32 nHint)
{
- if( rHint.ISA( SfxSimpleHint ) && ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_ACCESSIBILITY_CHANGED )
- {
- onAccessibilityOptionsChanged();
- }
-
- SdrCreateView::Notify(rBC, rHint);
+ onAccessibilityOptionsChanged();
+ SdrCreateView::ConfigurationChanged(p, nHint);
}
SvtAccessibilityOptions& SdrView::getAccessibilityOptions()
diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx
index b86fba9d0c..fa97fe1b29 100644
--- a/svx/source/svdraw/svdviter.cxx
+++ b/svx/source/svdraw/svdviter.cxx
@@ -38,7 +38,7 @@
#include <svx/svdview.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdsob.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <sdrpaintwindow.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 4d717d4dfa..5effd864f1 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -52,8 +52,8 @@
#include "svdglob.hxx" // StringCache
#include "xoutbmp.hxx"
#include <vcl/metaact.hxx>
-#include <svtools/poolitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/itempool.hxx>
#include <tools/bigint.hxx>
#include <sot/formats.hxx>
@@ -62,7 +62,7 @@
#include <vcl/virdev.hxx>
// b4967543
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
// #i72535#
#include "fmobj.hxx"
diff --git a/svx/source/svrtf/rtfgrf.cxx b/svx/source/svrtf/rtfgrf.cxx
index c387fdf7e9..b889384ba2 100644
--- a/svx/source/svrtf/rtfgrf.cxx
+++ b/svx/source/svrtf/rtfgrf.cxx
@@ -40,11 +40,11 @@
#include <svtools/rtftoken.h>
#include <svtools/filter.hxx>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include "svxrtf.hxx"
-#ifdef PRODUCT
+#ifndef DBG_UTIL
#undef DEBUG_JP
#endif
diff --git a/svx/source/svrtf/rtfitem.cxx b/svx/source/svrtf/rtfitem.cxx
index 471b00d497..ca87b02088 100644
--- a/svx/source/svrtf/rtfitem.cxx
+++ b/svx/source/svrtf/rtfitem.cxx
@@ -92,8 +92,8 @@
#include <svtools/rtftoken.h>
-#include <svtools/itempool.hxx>
-#include <svtools/itemiter.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemiter.hxx>
#include "svxrtf.hxx"
diff --git a/svx/source/svrtf/svxrtf.cxx b/svx/source/svrtf/svxrtf.cxx
index 8808a1dfd9..8e4587909d 100644
--- a/svx/source/svrtf/svxrtf.cxx
+++ b/svx/source/svrtf/svxrtf.cxx
@@ -37,10 +37,10 @@
#include <ctype.h>
#include <tools/datetime.hxx>
#include <rtl/tencinfo.h>
-#include <svtools/itemiter.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/itemiter.hxx>
+#include <svl/whiter.hxx>
#include <svtools/rtftoken.h>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <comphelper/string.hxx>
diff --git a/svx/source/svxlink/fileobj.cxx b/svx/source/svxlink/fileobj.cxx
index a77c8852bb..125701b9f6 100644
--- a/svx/source/svxlink/fileobj.cxx
+++ b/svx/source/svxlink/fileobj.cxx
@@ -58,7 +58,7 @@
#include <svx/dialogs.hrc>
#include "xoutbmp.hxx"
#include "opengrf.hxx"
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
namespace css = ::com::sun::star;
@@ -391,7 +391,7 @@ BOOL SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream )
if( pStream && ERRCODE_IO_PENDING == pStream->GetError() )
pStream->ResetError();
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( nRes )
{
if( xMed.Is() && !pStream )
diff --git a/svx/source/svxlink/linkmgr.cxx b/svx/source/svxlink/linkmgr.cxx
index 5d96e0cfc4..84ebe26156 100644
--- a/svx/source/svxlink/linkmgr.cxx
+++ b/svx/source/svxlink/linkmgr.cxx
@@ -37,10 +37,10 @@
#include <vcl/graph.hxx>
#include <sfx2/lnkbase.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/rectitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/rectitem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/request.hxx>
#include <sfx2/objsh.hxx>
@@ -50,8 +50,8 @@
#include <sfx2/dispatch.hxx>
#include <unotools/charclass.hxx>
#include <unotools/localfilehelper.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/itemset.hxx>
+#include <svl/urihelper.hxx>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
#include "linkmgr.hxx"
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 0f399fa73d..22b5a774b9 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -37,8 +37,8 @@
#include <com/sun/star/table/TableBorder.hpp>
#include <cppuhelper/typeprovider.hxx>
-#include <svtools/style.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/style.hxx>
+#include <svl/itemset.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
diff --git a/svx/source/table/celleditsource.cxx b/svx/source/table/celleditsource.cxx
index 3be461adce..bdf6cf0537 100644
--- a/svx/source/table/celleditsource.cxx
+++ b/svx/source/table/celleditsource.cxx
@@ -38,9 +38,9 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
-#include <svtools/lstner.hxx>
-#include <svtools/hint.hxx>
-#include <svtools/style.hxx>
+#include <svl/lstner.hxx>
+#include <svl/hint.hxx>
+#include <svl/style.hxx>
#include "celleditsource.hxx"
#include "cell.hxx"
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index d639b3e884..00d09251cd 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -45,7 +45,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include "editstat.hxx"
#include "svx/outlobj.hxx"
#include "svx/svdview.hxx"
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index d81d768830..43ef34d8c0 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -43,7 +43,7 @@
#include <sal/config.h>
#include <vcl/svapp.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <sfx2/request.hxx>
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index 50388d6e5c..d3e22e9c0a 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -5,7 +5,7 @@
#define __SVX_COLORWINDOW_HXX_
#include <sfx2/tbxctrl.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/frame/XFrame.hpp>
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index c3bc05a560..1931516032 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -41,9 +41,9 @@
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <vcl/settings.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <svx/colritem.hxx>
#include "chrtitem.hxx"
#include <tools/urlobj.hxx>
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 4e5e3e396b..83751efdcb 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -32,7 +32,7 @@
#include "precompiled_svx.hxx"
#include <com/sun/star/text/WritingMode.hpp>
#include <sfx2/app.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <svx/fmmodel.hxx>
#include <sfx2/dispatch.hxx>
#include <dlgutil.hxx>
diff --git a/svx/source/tbxctrls/formatpaintbrushctrl.cxx b/svx/source/tbxctrls/formatpaintbrushctrl.cxx
index 0afb9e8571..0982e843db 100644
--- a/svx/source/tbxctrls/formatpaintbrushctrl.cxx
+++ b/svx/source/tbxctrls/formatpaintbrushctrl.cxx
@@ -34,7 +34,7 @@
#include "formatpaintbrushctrl.hxx"
// header for class SfxBoolItem
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
// header for define SFX_APP
#include <sfx2/app.hxx>
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 87e65ec556..c42ac872ac 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -41,9 +41,9 @@
#endif
#include <vcl/fixed.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/whiter.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 66bd3e6b7b..879c8708f2 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -279,26 +279,7 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvxLineBox::FillControl()
{
- Clear();
-
- InsertEntry( SVX_RESSTR(RID_SVXSTR_INVISIBLE) );
-
- Bitmap aBitmap ( SVX_RES ( RID_SVXCTRL_LINECTRL ) );
-
- ::Color aSourceColors[2];
- ::Color aDestColors[2];
-
- aSourceColors[0] = ::Color( COL_WHITE );
- aSourceColors[1] = ::Color( COL_BLACK );
-
- const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
- aDestColors[0] = rStyles.GetFieldColor();
- aDestColors[1] = rStyles.GetFieldTextColor();
-
- aBitmap.Replace ( aSourceColors, aDestColors, 2 );
- Image aSolidLine ( aBitmap );
- InsertEntry( SVX_RESSTR(RID_SVXSTR_SOLID), aSolidLine );
-
+ FillStyles();
if ( !mpSh )
mpSh = SfxObjectShell::Current();
@@ -308,6 +289,7 @@ void SvxLineBox::FillControl()
if ( pItem )
Fill( pItem->GetDashList() );
}
+
// rBindings.Invalidate( SID_ATTR_LINE_DASH );
}
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 18101465bc..734afcd45b 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -38,7 +38,7 @@
#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
#endif
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 864fcd6d22..a35bcb6f9e 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -43,11 +43,11 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
#include <tools/gen.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
#include <svtools/stdctrl.hxx>
-#include <svtools/slstitm.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/slstitm.hxx>
+#include <svl/stritem.hxx>
#include <svx/dialmgr.hxx>
#include <lboxctrl.hxx>
#ifndef _VCL_MNEMONIC_HXX_
diff --git a/svx/source/tbxctrls/subtoolboxcontrol.cxx b/svx/source/tbxctrls/subtoolboxcontrol.cxx
index 2cc1f4a43e..7c3b8b1201 100644
--- a/svx/source/tbxctrls/subtoolboxcontrol.cxx
+++ b/svx/source/tbxctrls/subtoolboxcontrol.cxx
@@ -30,7 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <vcl/toolbox.hxx>
#include <sfx2/app.hxx>
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index bca857ea25..9ee6ffd0ed 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,35 +36,35 @@
#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
#include <tools/shl.hxx>
-#include <svtools/poolitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/eitem.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/bmpacc.hxx>
#include <svtools/valueset.hxx>
#include <svtools/ctrlbox.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svtools/ctrltool.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/pathoptions.hxx>
+#include <svl/stritem.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/tplpitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/templdlg.hxx>
-#include <svtools/isethint.hxx>
+#include <svl/isethint.hxx>
#include <sfx2/querystatus.hxx>
#include <sfx2/sfxstatuslistener.hxx>
#include <tools/urlobj.hxx>
#include <sfx2/childwin.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svtools/fontoptions.hxx>
+#include <unotools/fontoptions.hxx>
#ifndef _VCL_MNEMONIC_HXX_
#include <vcl/mnemonic.hxx>
#endif
#include <vcl/svapp.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#define _SVX_TBCONTRL_CXX
#include <svtools/colorcfg.hxx>
@@ -848,7 +848,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
if ( pDocSh )
if ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) )
pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
-
+
if ( !pColorTable )
{
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
@@ -1894,7 +1894,7 @@ throw ( Exception, RuntimeException)
}
// XComponent
-void SAL_CALL SvxStyleToolBoxControl::dispose()
+void SAL_CALL SvxStyleToolBoxControl::dispose()
throw (::com::sun::star::uno::RuntimeException)
{
SfxToolBoxControl::dispose();
diff --git a/svx/source/tbxctrls/tbxalign.cxx b/svx/source/tbxctrls/tbxalign.cxx
index fa56bc2111..7f9d4228cc 100644
--- a/svx/source/tbxctrls/tbxalign.cxx
+++ b/svx/source/tbxctrls/tbxalign.cxx
@@ -30,7 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/aeitem.hxx>
+#include <svl/aeitem.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx
index 1c9ccdfd55..88967319d4 100644
--- a/svx/source/tbxctrls/tbxdrctl.cxx
+++ b/svx/source/tbxctrls/tbxdrctl.cxx
@@ -35,7 +35,7 @@
#include <tools/ref.hxx>
#include <tools/shl.hxx>
-#include <svtools/aeitem.hxx>
+#include <svl/aeitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/imagemgr.hxx>
diff --git a/svx/source/tbxctrls/verttexttbxctrl.cxx b/svx/source/tbxctrls/verttexttbxctrl.cxx
index 287ed3513d..9de79579d3 100644
--- a/svx/source/tbxctrls/verttexttbxctrl.cxx
+++ b/svx/source/tbxctrls/verttexttbxctrl.cxx
@@ -34,9 +34,9 @@
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
#include <verttexttbxctrl.hxx>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
#include <sfx2/app.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <vcl/toolbox.hxx>
#include <rtl/ustring.hxx>
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index 11130e35c6..b0ba9cbd8c 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -355,7 +355,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
#include "gallery.hxx"
#include <svx/fmmodel.hxx>
#include <svx/fmpage.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
void GetGeometryForCustomShape( SdrCustomShapeGeometryItem& rGeometryItem, const rtl::OUString rCustomShape )
{
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 783272ebd8..3e2864dc73 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -47,8 +47,8 @@
// header for define RET_OK
#include <vcl/msgbox.hxx>
// header for class SvtLinguConfigItem
-#include <svtools/lingucfg.hxx>
-#include <svtools/linguprops.hxx>
+#include <unotools/lingucfg.hxx>
+#include <unotools/linguprops.hxx>
// header for class IntlWrapper
#include <unotools/intlwrapper.hxx>
#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
@@ -77,7 +77,7 @@ using namespace ::com::sun::star::uno;
DictionaryList::DictionaryList( Window* pParent, const ResId& rResId)
: SvHeaderTabListBox( pParent, rResId )
- , m_xDictionary(0)
+ , m_xDictionary(0)
, m_pHeaderBar(0)
, m_pPropertyTypeNameListBox(0)
, m_aToBeDeleted()
@@ -140,7 +140,7 @@ void DictionaryList::save()
sal_Int32 nN;
DictionaryEntry* pE;
-
+
for( nN = m_aToBeDeleted.size(); nN--; )
{
pE = m_aToBeDeleted[nN];
@@ -186,12 +186,12 @@ void DictionaryList::refillFromDictionary( sal_Int32 nTextConversionOptions )
if(!m_xDictionary.is())
return;
-
+
Sequence< rtl::OUString > aLeftList( m_xDictionary->getConversionEntries( linguistic2::ConversionDirection_FROM_LEFT ) );
sal_Int32 nCount = aLeftList.getLength();
Reference< linguistic2::XConversionPropertyType > xPropertyType( m_xDictionary, uno::UNO_QUERY );
-
+
rtl::OUString aLeft, aRight;
sal_Int16 nConversionPropertyType;
@@ -201,7 +201,7 @@ void DictionaryList::refillFromDictionary( sal_Int32 nTextConversionOptions )
Sequence< rtl::OUString > aRightList( m_xDictionary->getConversions(
aLeft, 0, aLeft.getLength()
, linguistic2::ConversionDirection_FROM_LEFT, nTextConversionOptions ) );
-
+
if(aRightList.getLength()!=1)
{
OSL_ASSERT("The Chinese Translation Dictionary should have exactly one Mapping for each term.");
@@ -339,7 +339,7 @@ HeaderBar* DictionaryList::createHeaderBar( const String& rColumn1, const String
HeaderBarItemBits nBits = HEADER_BAR_BITS;
pHeaderBar->InsertItem( 1, rColumn1, nWidth1, nBits | HIB_UPARROW );
pHeaderBar->InsertItem( 2, rColumn2, nWidth2, nBits );
- pHeaderBar->InsertItem( 3, rColumn3, nWidth3, nBits );
+ pHeaderBar->InsertItem( 3, rColumn3, nWidth3, nBits );
pHeaderBar->Show();
return pHeaderBar;
@@ -352,7 +352,7 @@ void DictionaryList::Resize()
if ( !aBoxSize.Width() )
return;
-
+
Size aBarSize = m_pHeaderBar->GetSizePixel();
aBarSize.Width() = GetSizePixel().Width();
m_pHeaderBar->SetSizePixel( aBarSize );
@@ -500,7 +500,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL );
m_aCB_Reverse.SetHelpId( HID_SVX_CHINESE_DICTIONARY_CB_REVERSE );
-
+
m_aCT_DictionaryToSimplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED );
m_aCT_DictionaryToTraditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL );
@@ -512,7 +512,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
m_aLB_Property.SetDropDownLineCount( m_aLB_Property.GetEntryCount() );
m_aLB_Property.SelectEntryPos(0);
-
+
Reference< linguistic2::XConversionDictionary > xDictionary_To_Simplified(0);
Reference< linguistic2::XConversionDictionary > xDictionary_To_Traditional(0);
//get dictionaries
@@ -538,7 +538,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
rtl::OUString aNameTo_Traditional( rtl::OUString::createFromAscii("ChineseS2T") );
lang::Locale aLocale;
aLocale.Language = rtl::OUString::createFromAscii("zh");
-
+
if( xContainer->hasByName( aNameTo_Simplified ) )
xDictionary_To_Simplified = Reference< linguistic2::XConversionDictionary >(
xContainer->getByName( aNameTo_Simplified ), UNO_QUERY );
@@ -567,7 +567,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
}
if (xDictionary_To_Traditional.is())
xDictionary_To_Traditional->setActive( sal_True );
-
+
}
catch( uno::Exception& )
{
@@ -605,7 +605,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
//
updateAfterDirectionChange();
-
+
//set hdl
if(m_pHeaderBar)
m_pHeaderBar->SetSelectHdl( LINK( this, ChineseDictionaryDialog, HeaderBarClick ) );
@@ -619,7 +619,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent )
m_aCT_DictionaryToSimplified.SetSelectHdl( LINK( this, ChineseDictionaryDialog, MappingSelectHdl ));
m_aCT_DictionaryToTraditional.SetSelectHdl( LINK( this, ChineseDictionaryDialog, MappingSelectHdl ));
-
+
m_aPB_Add.SetClickHdl( LINK( this, ChineseDictionaryDialog, AddHdl ) );
m_aPB_Modify.SetClickHdl( LINK( this, ChineseDictionaryDialog, ModifyHdl ) );
m_aPB_Delete.SetClickHdl( LINK( this, ChineseDictionaryDialog, DeleteHdl ) );
@@ -634,7 +634,7 @@ ChineseDictionaryDialog::~ChineseDictionaryDialog()
void ChineseDictionaryDialog::setDirectionAndTextConversionOptions( bool bDirectionToSimplified, sal_Int32 nTextConversionOptions /*i18n::TextConversionOption*/ )
{
- if( bDirectionToSimplified == bool(m_aRB_To_Simplified.IsChecked())
+ if( bDirectionToSimplified == bool(m_aRB_To_Simplified.IsChecked())
&& nTextConversionOptions == m_nTextConversionOptions )
return;
@@ -665,7 +665,7 @@ void ChineseDictionaryDialog::updateAfterDirectionChange()
}
else
{
- m_aCT_DictionaryToTraditional.activate( m_pHeaderBar );
+ m_aCT_DictionaryToTraditional.activate( m_pHeaderBar );
m_aCT_DictionaryToSimplified.Hide();
xDictionary = m_aCT_DictionaryToTraditional.m_xDictionary;
}
@@ -751,7 +751,7 @@ void ChineseDictionaryDialog::updateButtons()
m_aPB_Add.Enable( bAdd );
m_aPB_Delete.Enable( !bAdd && getActiveDictionary().GetSelectedRowCount()>0 );
-
+
// DictionaryEntry* pFirstSelectedEntry = getActiveDictionary().getFirstSelectedEntry();
bool bModify = false;
@@ -791,13 +791,13 @@ IMPL_LINK( ChineseDictionaryDialog, ModifyHdl, void*, EMPTYARG )
DictionaryList& rActive = getActiveDictionary();
DictionaryList& rReverse = getReverseDictionary();
-
+
DictionaryEntry* pE = rActive.getFirstSelectedEntry();
if( pE->m_aTerm != aTerm )
return 0;
if( pE )
- {
+ {
if( pE->m_aMapping != aMapping || pE->m_nConversionPropertyType != nConversionPropertyType )
{
if( m_aCB_Reverse.IsChecked() )
@@ -852,7 +852,7 @@ short ChineseDictionaryDialog::Execute()
sal_Int32 nTextConversionOptions = m_nTextConversionOptions;
if(m_nTextConversionOptions | i18n::TextConversionOption::USE_CHARACTER_VARIANTS )
nTextConversionOptions = nTextConversionOptions^i18n::TextConversionOption::USE_CHARACTER_VARIANTS ;
-
+
m_aCT_DictionaryToSimplified.refillFromDictionary( nTextConversionOptions );
m_aCT_DictionaryToTraditional.refillFromDictionary( m_nTextConversionOptions );
@@ -890,7 +890,7 @@ IMPL_LINK( ChineseDictionaryDialog, HeaderBarClick, void*, EMPTYARG )
m_pHeaderBar->SetItemBits( nId, HEADER_BAR_BITS | HIB_DOWNARROW );
else
m_pHeaderBar->SetItemBits( nId, HEADER_BAR_BITS | HIB_UPARROW );
-
+
//sort lists
nBits = m_pHeaderBar->GetItemBits(nId);
bool bSortAtoZ = nBits & HIB_UPARROW;
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 85cb9a9676..a6263978d1 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,8 +39,8 @@
// header for define RET_OK
#include <vcl/msgbox.hxx>
// header for class SvtLinguConfigItem
-#include <svtools/lingucfg.hxx>
-#include <svtools/linguprops.hxx>
+#include <unotools/lingucfg.hxx>
+#include <unotools/linguprops.hxx>
#ifndef _SVX_HELPID_HRC
#include "helpid.hrc"
#endif
@@ -103,7 +103,7 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent )
aAny = aLngCfg.GetProperty( rtl::OUString::createFromAscii( UPN_IS_TRANSLATE_COMMON_TERMS ) );
if( aAny >>= bValue )
m_aCB_Translate_Commonterms.Check( bValue );
-
+
m_aPB_Editterms.SetClickHdl( LINK( this, ChineseTranslationDialog, DictionaryHdl ) );
m_aRB_To_Simplified.SetClickHdl( LINK( this, ChineseTranslationDialog, DirectionHdl ) );
m_aRB_To_Traditional.SetClickHdl( LINK( this, ChineseTranslationDialog, DirectionHdl ) );
@@ -191,7 +191,7 @@ IMPL_LINK( ChineseTranslationDialog, DictionaryHdl, void*, EMPTYARG )
nTextConversionOptions = nTextConversionOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
if( m_aCB_Use_Variants.IsChecked() )
nTextConversionOptions = nTextConversionOptions | i18n::TextConversionOption::USE_CHARACTER_VARIANTS;
-
+
m_pDictionaryDialog->setDirectionAndTextConversionOptions( m_aRB_To_Simplified.IsChecked(), nTextConversionOptions );
m_pDictionaryDialog->Execute();
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
index dcc74b99e7..49376d2ef7 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src
@@ -68,13 +68,13 @@ ModalDialog DLG_CHINESETRANSLATION
Moveable = TRUE ;
SVLook = TRUE;
- Text [ en-US ] = "Chinese Translation";
+ Text [ en-US ] = "Chinese Conversion";
FixedLine FL_DIRECTION
{
Pos = MAP_APPFONT ( COL_1 , ROW_1 ) ;
Size = MAP_APPFONT ( FULL_WIDTH - COL_1 - RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Translation direction";
+ Text [ en-US ] = "Conversion direction";
};
DIRECTION_RADIOBUTTONS( COL_2, ROW_2, (FULL_WIDTH - COL_2 - RSC_SP_DLG_INNERBORDER_RIGHT) )
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 691d23ab43..92c4bb77fb 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -59,7 +59,7 @@
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
#include <svtools/FilterConfigItem.hxx>
-#include <svtools/outstrm.hxx>
+#include <svl/outstrm.hxx>
#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
@@ -69,7 +69,7 @@
#include <svx/svdpagv.hxx>
#include <svx/svdograf.hxx>
#include "xoutbmp.hxx"
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include "unoapi.hxx"
#include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx>
diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx
index ef1848cf3e..630d05228d 100644
--- a/svx/source/unodraw/UnoNameItemTable.cxx
+++ b/svx/source/unodraw/UnoNameItemTable.cxx
@@ -32,9 +32,9 @@
#include "precompiled_svx.hxx"
#include <set>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/style.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <svl/style.hxx>
#include <comphelper/stl_types.hxx>
#include <svx/svdmodel.hxx>
diff --git a/svx/source/unodraw/UnoNameItemTable.hxx b/svx/source/unodraw/UnoNameItemTable.hxx
index 5d4effba94..79a9b78fc1 100644
--- a/svx/source/unodraw/UnoNameItemTable.hxx
+++ b/svx/source/unodraw/UnoNameItemTable.hxx
@@ -37,7 +37,7 @@
#include <cppuhelper/implbase2.hxx>
#include <vector>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <svx/xit.hxx>
#include <svx/xdef.hxx>
diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx
index 0296bc060f..f9d1ad5f0e 100644
--- a/svx/source/unodraw/UnoNamespaceMap.cxx
+++ b/svx/source/unodraw/UnoNamespaceMap.cxx
@@ -43,7 +43,7 @@
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <comphelper/stl_types.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include "unoapi.hxx"
#include "xmlcnitm.hxx"
diff --git a/svx/source/unodraw/unobtabl.cxx b/svx/source/unodraw/unobtabl.cxx
index 61854aa9cf..3e369c3e14 100644
--- a/svx/source/unodraw/unobtabl.cxx
+++ b/svx/source/unodraw/unobtabl.cxx
@@ -30,9 +30,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vcl/cvtgrf.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/xit.hxx>
#ifndef SVX_LIGHT
#ifndef _SFXDOCFILE_HXX
@@ -45,7 +45,7 @@
#include <svx/svdmodel.hxx>
#include <svx/xflhtit.hxx>
#include "unoapi.hxx"
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <svx/unomid.hxx>
#include <svx/unoprnms.hxx>
#include "unofill.hxx"
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 671d28e431..1eef2212d1 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,7 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <cppuhelper/implbase2.hxx>
@@ -286,12 +286,12 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
writeInfo( pKey, svx::GraphicExporter_getImplementationName(), svx::GraphicExporter_getSupportedServiceNames() );
#endif
writeInfo( pKey, svx::FontHeightToolBoxControl::getImplementationName_Static(), svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
- writeInfo( pKey, ::unogallery::GalleryThemeProvider_getImplementationName(),::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
+ writeInfo( pKey, ::unogallery::GalleryThemeProvider_getImplementationName(),::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
// XPrimitiveFactory2D
- writeInfo( pKey,
- drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(),
- drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() );
+ writeInfo( pKey,
+ drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(),
+ drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() );
writeInfo( pKey, ::svx::SvXMLGraphicImportHelper_getImplementationName(),::svx::SvXMLGraphicImportHelper_getSupportedServiceNames() );
writeInfo( pKey, ::svx::SvXMLGraphicExportHelper_getImplementationName(),::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() );
diff --git a/svx/source/unodraw/unodtabl.cxx b/svx/source/unodraw/unodtabl.cxx
index b23dc0e6b3..7eec2700c1 100644
--- a/svx/source/unodraw/unodtabl.cxx
+++ b/svx/source/unodraw/unodtabl.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/drawing/LineDash.hpp>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
#include <vector>
#include "UnoNameItemTable.hxx"
diff --git a/svx/source/unodraw/unofdesc.cxx b/svx/source/unodraw/unofdesc.cxx
index 879b13ad5e..2fa0cf4abc 100644
--- a/svx/source/unodraw/unofdesc.cxx
+++ b/svx/source/unodraw/unofdesc.cxx
@@ -45,7 +45,7 @@
#include <svx/crsditem.hxx>
#include <svx/wrlmitem.hxx>
#include <svx/unomid.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include "unofdesc.hxx"
diff --git a/svx/source/unodraw/unogtabl.cxx b/svx/source/unodraw/unogtabl.cxx
index 9e17cc99e3..1cdb92d7f0 100644
--- a/svx/source/unodraw/unogtabl.cxx
+++ b/svx/source/unodraw/unogtabl.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/awt/Gradient.hpp>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
#include "UnoNameItemTable.hxx"
#include <svx/xgrad.hxx>
diff --git a/svx/source/unodraw/unohtabl.cxx b/svx/source/unodraw/unohtabl.cxx
index 329905c31d..bb46cf14ff 100644
--- a/svx/source/unodraw/unohtabl.cxx
+++ b/svx/source/unodraw/unohtabl.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/drawing/Hatch.hpp>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
#include "UnoNameItemTable.hxx"
#include <svx/xhatch.hxx>
diff --git a/svx/source/unodraw/unoipset.cxx b/svx/source/unodraw/unoipset.cxx
index 25a72b0f8b..87d0d53e8c 100644
--- a/svx/source/unodraw/unoipset.cxx
+++ b/svx/source/unodraw/unoipset.cxx
@@ -31,12 +31,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <tools/list.hxx>
#include <hash_map>
#include <vector>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <svx/unoipset.hxx>
#include <svx/svdpool.hxx>
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index b514debc7b..0e4c734683 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -38,7 +38,7 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <tools/list.hxx>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <svtools/unoevent.hxx>
#include <comphelper/sequence.hxx>
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index 1e7645df15..a2a6f8c6dd 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -36,12 +36,12 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/drawing/PointSequence.hpp>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <cppuhelper/implbase2.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <svl/lstner.hxx>
#include <svx/xlnedit.hxx>
#include <svx/xlnstit.hxx>
#include <svx/svdmodel.hxx>
diff --git a/svx/source/unodraw/unonrule.cxx b/svx/source/unodraw/unonrule.cxx
index 638c27fe68..c010c7da47 100644
--- a/svx/source/unodraw/unonrule.cxx
+++ b/svx/source/unodraw/unonrule.cxx
@@ -43,7 +43,7 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase5.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <goodies/grfmgr.hxx>
#include <vcl/svapp.hxx>
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 1d3b94ebe9..6a81a453aa 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -47,7 +47,7 @@
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <svtools/fltcall.hxx>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include <boost/scoped_ptr.hpp>
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 8e4cd15b1c..f90b8ec83b 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/drawing/CircleKind.hpp>
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <vcl/svapp.hxx>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <svtools/fltcall.hxx>
#include <vos/mutex.hxx>
#include <svx/unotext.hxx>
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 75c4d7ab68..224926e462 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -35,11 +35,11 @@
#include <svx/unoshtxt.hxx>
#include <unoedhlp.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <rtl/ref.hxx>
#include <osl/mutex.hxx>
-#include <svtools/hint.hxx>
-#include <svtools/style.hxx>
+#include <svl/hint.hxx>
+#include <svl/style.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svdobj.hxx>
diff --git a/svx/source/unodraw/unottabl.cxx b/svx/source/unodraw/unottabl.cxx
index 172f8a5f69..e6b03af1c4 100644
--- a/svx/source/unodraw/unottabl.cxx
+++ b/svx/source/unodraw/unottabl.cxx
@@ -31,8 +31,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <com/sun/star/awt/Gradient.hpp>
-#include <svtools/itempool.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
#include <svx/xgrad.hxx>
#include <svx/xflftrit.hxx>
diff --git a/svx/source/unoedit/unoedsrc.cxx b/svx/source/unoedit/unoedsrc.cxx
index ffeba43289..7efc794107 100644
--- a/svx/source/unoedit/unoedsrc.cxx
+++ b/svx/source/unoedit/unoedsrc.cxx
@@ -30,7 +30,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <svx/unoedsrc.hxx>
diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx
index 20807d46ff..0a357002aa 100644
--- a/svx/source/unoedit/unofored.cxx
+++ b/svx/source/unoedit/unofored.cxx
@@ -35,7 +35,7 @@
#include <svx/eeitem.hxx>
#include <com/sun/star/i18n/WordType.hpp>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/editeng.hxx>
#include <svx/editview.hxx>
#include <unoedhlp.hxx>
diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx
index 96eef1c0b0..6faf19938a 100644
--- a/svx/source/unoedit/unoforou.cxx
+++ b/svx/source/unoedit/unoforou.cxx
@@ -32,16 +32,16 @@
#include "precompiled_svx.hxx"
#include <algorithm>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <com/sun/star/i18n/WordType.hpp>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/editeng.hxx>
#include <svx/editdata.hxx>
#include <svx/outliner.hxx>
#include <unoedhlp.hxx>
#include <svx/svdobj.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <vcl/wrkwin.hxx>
#include <svx/eeitem.hxx>
diff --git a/svx/source/unoedit/unotext.cxx b/svx/source/unoedit/unotext.cxx
index 0706db84a9..c70b63a1e6 100644
--- a/svx/source/unoedit/unotext.cxx
+++ b/svx/source/unoedit/unotext.cxx
@@ -38,16 +38,16 @@
#include <com/sun/star/text/XTextField.hdl>
#endif
#include <vos/mutex.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/eeitem.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <fontitem.hxx>
#include <svx/tstpitem.hxx>
#include <svx/svdobj.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <rtl/uuid.h>
#include <rtl/memory.h>
diff --git a/svx/source/unoedit/unotext2.cxx b/svx/source/unoedit/unotext2.cxx
index 186f980c7c..249fd71d4e 100644
--- a/svx/source/unoedit/unotext2.cxx
+++ b/svx/source/unoedit/unotext2.cxx
@@ -34,7 +34,7 @@
#include <vos/mutex.hxx>
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <rtl/uuid.h>
#include <rtl/memory.h>
diff --git a/svx/source/unogallery/unogalitem.cxx b/svx/source/unogallery/unogalitem.cxx
index 77ad6522bf..e51b0feb3f 100644
--- a/svx/source/unogallery/unogalitem.cxx
+++ b/svx/source/unogallery/unogalitem.cxx
@@ -34,19 +34,15 @@
#include "unogalitem.hxx"
#include "unogaltheme.hxx"
#include "galtheme.hxx"
-#include "galmisc.hxx"
+#include "svx/galmisc.hxx"
#include <svx/fmmodel.hxx>
#include <rtl/uuid.h>
#include <vos/mutex.hxx>
-#ifndef _SV_SVAPP_HXX_
#include <vcl/svapp.hxx>
-#endif
-#ifndef _SV_GRAPH_HXX_
#include <vcl/graph.hxx>
-#endif
-#include <svtools/itemprop.hxx>
-#include <svtools/itempool.hxx>
-
+#include <svl/itemprop.hxx>
+#include <svl/itempool.hxx>
+#include "galobj.hxx"
#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HDL_
#include <com/sun/star/beans/PropertyState.hpp>
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index ef7646c944..9bbe80effd 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,19 +32,19 @@
#include "precompiled_svx.hxx"
#include <algorithm>
-
-#include "unogaltheme.hxx"
-#include "unogalitem.hxx"
-#include "galtheme.hxx"
-#include "gallery1.hxx"
-#include "galmisc.hxx"
-#include <svx/fmmodel.hxx>
+
+#include "unogaltheme.hxx"
+#include "unogalitem.hxx"
+#include "galtheme.hxx"
+#include "svx/gallery1.hxx"
+#include "svx/galmisc.hxx"
+#include <svx/fmmodel.hxx>
#include <rtl/uuid.h>
#include <vos/mutex.hxx>
-#ifndef _SV_SVAPP_HXX_
+#ifndef _SV_SVAPP_HXX_
#include <vcl/svapp.hxx>
#endif
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
using namespace ::com::sun::star;
@@ -58,7 +58,7 @@ GalleryTheme::GalleryTheme( const ::rtl::OUString& rThemeName )
{
mpGallery = ::Gallery::GetGalleryInstance();
mpTheme = ( mpGallery ? mpGallery->AcquireTheme( rThemeName, *this ) : NULL );
-
+
if( mpGallery )
StartListening( *mpGallery );
}
@@ -68,7 +68,7 @@ GalleryTheme::GalleryTheme( const ::rtl::OUString& rThemeName )
GalleryTheme::~GalleryTheme()
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
DBG_ASSERT( !mpTheme || mpGallery, "Theme is living without Gallery" );
implReleaseItems( NULL );
@@ -76,14 +76,14 @@ GalleryTheme::~GalleryTheme()
if( mpGallery )
{
EndListening( *mpGallery );
-
+
if( mpTheme )
mpGallery->ReleaseTheme( mpTheme, *this );
}
}
// ------------------------------------------------------------------------------
-
+
::rtl::OUString GalleryTheme::getImplementationName_Static()
throw()
{
@@ -96,15 +96,15 @@ uno::Sequence< ::rtl::OUString > GalleryTheme::getSupportedServiceNames_Static()
throw()
{
uno::Sequence< ::rtl::OUString > aSeq( 1 );
-
+
aSeq.getArray()[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.gallery.GalleryTheme" ) );
-
+
return aSeq;
}
// ------------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL GalleryTheme::getImplementationName()
+
+::rtl::OUString SAL_CALL GalleryTheme::getImplementationName()
throw( uno::RuntimeException )
{
return getImplementationName_Static();
@@ -112,7 +112,7 @@ uno::Sequence< ::rtl::OUString > GalleryTheme::getSupportedServiceNames_Static()
// ------------------------------------------------------------------------------
-sal_Bool SAL_CALL GalleryTheme::supportsService( const ::rtl::OUString& ServiceName )
+sal_Bool SAL_CALL GalleryTheme::supportsService( const ::rtl::OUString& ServiceName )
throw( uno::RuntimeException )
{
uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() );
@@ -127,7 +127,7 @@ sal_Bool SAL_CALL GalleryTheme::supportsService( const ::rtl::OUString& ServiceN
// ------------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL GalleryTheme::getSupportedServiceNames()
+uno::Sequence< ::rtl::OUString > SAL_CALL GalleryTheme::getSupportedServiceNames()
throw( uno::RuntimeException )
{
return getSupportedServiceNames_Static();
@@ -135,7 +135,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL GalleryTheme::getSupportedServiceNames
// ------------------------------------------------------------------------------
-uno::Sequence< uno::Type > SAL_CALL GalleryTheme::getTypes()
+uno::Sequence< uno::Type > SAL_CALL GalleryTheme::getTypes()
throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTypes( 5 );
@@ -152,18 +152,18 @@ uno::Sequence< uno::Type > SAL_CALL GalleryTheme::getTypes()
// ------------------------------------------------------------------------------
-uno::Sequence< sal_Int8 > SAL_CALL GalleryTheme::getImplementationId()
+uno::Sequence< sal_Int8 > SAL_CALL GalleryTheme::getImplementationId()
throw(uno::RuntimeException)
{
const vos::OGuard aGuard( Application::GetSolarMutex() );
static uno::Sequence< sal_Int8 > aId;
-
+
if( aId.getLength() == 0 )
{
aId.realloc( 16 );
rtl_createUuid( reinterpret_cast< sal_uInt8* >( aId.getArray() ), 0, sal_True );
}
-
+
return aId;
}
@@ -177,21 +177,21 @@ uno::Type SAL_CALL GalleryTheme::getElementType()
// ------------------------------------------------------------------------------
-sal_Bool SAL_CALL GalleryTheme::hasElements()
+sal_Bool SAL_CALL GalleryTheme::hasElements()
throw (uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
return( ( mpTheme != NULL ) && ( mpTheme->GetObjectCount() > 0 ) );
}
// ------------------------------------------------------------------------------
-sal_Int32 SAL_CALL GalleryTheme::getCount()
+sal_Int32 SAL_CALL GalleryTheme::getCount()
throw (uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
return( mpTheme ? mpTheme->GetObjectCount() : 0 );
}
@@ -202,7 +202,7 @@ uno::Any SAL_CALL GalleryTheme::getByIndex( ::sal_Int32 nIndex )
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Any aRet;
-
+
if( mpTheme )
{
if( ( nIndex < 0 ) || ( nIndex >= getCount() ) )
@@ -212,12 +212,12 @@ uno::Any SAL_CALL GalleryTheme::getByIndex( ::sal_Int32 nIndex )
else
{
const GalleryObject* pObj = mpTheme->ImplGetGalleryObject( nIndex );
-
+
if( pObj )
- aRet = uno::makeAny( uno::Reference< gallery::XGalleryItem >( new GalleryItem( *this, *pObj ) ) );
+ aRet = uno::makeAny( uno::Reference< gallery::XGalleryItem >( new GalleryItem( *this, *pObj ) ) );
}
}
-
+
return aRet;
}
@@ -228,20 +228,20 @@ uno::Any SAL_CALL GalleryTheme::getByIndex( ::sal_Int32 nIndex )
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
::rtl::OUString aRet;
-
+
if( mpTheme )
aRet = mpTheme->GetName();
-
+
return aRet;
}
// ------------------------------------------------------------------------------
-
+
void SAL_CALL GalleryTheme::update( )
throw (uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
if( mpTheme )
{
const Link aDummyLink;
@@ -250,26 +250,26 @@ void SAL_CALL GalleryTheme::update( )
}
// ------------------------------------------------------------------------------
-
+
::sal_Int32 SAL_CALL GalleryTheme::insertURLByIndex(
const ::rtl::OUString& rURL, ::sal_Int32 nIndex )
throw (lang::WrappedTargetException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
sal_Int32 nRet = -1;
-
+
if( mpTheme )
{
try
{
const INetURLObject aURL( rURL );
-
+
nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) );
-
+
if( ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) && mpTheme->InsertURL( aURL, nIndex ) )
{
const GalleryObject* pObj = mpTheme->ImplGetGalleryObject( aURL );
-
+
if( pObj )
nRet = mpTheme->ImplGetGalleryObjectPos( pObj );
}
@@ -278,14 +278,14 @@ void SAL_CALL GalleryTheme::update( )
{
}
}
-
+
return nRet;
}
// ------------------------------------------------------------------------------
-
-::sal_Int32 SAL_CALL GalleryTheme::insertGraphicByIndex(
- const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nIndex )
+
+::sal_Int32 SAL_CALL GalleryTheme::insertGraphicByIndex(
+ const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nIndex )
throw (lang::WrappedTargetException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -296,9 +296,9 @@ void SAL_CALL GalleryTheme::update( )
try
{
const Graphic aGraphic( rxGraphic );
-
+
nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) );
-
+
if( mpTheme->InsertGraphic( aGraphic, nIndex ) )
nRet = nIndex;
}
@@ -306,12 +306,12 @@ void SAL_CALL GalleryTheme::update( )
{
}
}
-
+
return nRet;
}
// ------------------------------------------------------------------------------
-
+
::sal_Int32 SAL_CALL GalleryTheme::insertDrawingByIndex(
const uno::Reference< lang::XComponent >& Drawing, sal_Int32 nIndex )
throw (lang::WrappedTargetException, uno::RuntimeException)
@@ -322,26 +322,26 @@ void SAL_CALL GalleryTheme::update( )
if( mpTheme )
{
GalleryDrawingModel* pModel = GalleryDrawingModel::getImplementation( Drawing );
-
+
if( pModel && pModel->GetDoc() && pModel->GetDoc()->ISA( FmFormModel ) )
{
nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) );
-
+
if( mpTheme->InsertModel( *static_cast< FmFormModel* >( pModel->GetDoc() ), nIndex ) )
nRet = nIndex;
}
}
-
+
return nRet;
}
// ------------------------------------------------------------------------------
-
+
void SAL_CALL GalleryTheme::removeByIndex( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
if( mpTheme )
{
if( ( nIndex < 0 ) || ( nIndex >= getCount() ) )
@@ -363,9 +363,9 @@ void GalleryTheme::Notify( SfxBroadcaster&, const SfxHint& rHint )
case( GALLERY_HINT_CLOSE_THEME ):
{
DBG_ASSERT( !mpTheme || mpGallery, "Theme is living without Gallery" );
-
+
implReleaseItems( NULL );
-
+
if( mpGallery && mpTheme )
{
mpGallery->ReleaseTheme( mpTheme, *this );
@@ -373,16 +373,16 @@ void GalleryTheme::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
break;
-
+
case( GALLERY_HINT_CLOSE_OBJECT ):
{
GalleryObject* pObj = reinterpret_cast< GalleryObject* >( rGalleryHint.GetData1() );
-
+
if( pObj )
implReleaseItems( pObj );
}
break;
-
+
default:
break;
}
@@ -393,7 +393,7 @@ void GalleryTheme::Notify( SfxBroadcaster&, const SfxHint& rHint )
void GalleryTheme::implReleaseItems( GalleryObject* pObj )
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
for( GalleryItemList::iterator aIter = maItemList.begin(); aIter != maItemList.end(); )
{
if( !pObj || ( (*aIter)->implGetObject() == pObj ) )
@@ -418,17 +418,17 @@ void GalleryTheme::implReleaseItems( GalleryObject* pObj )
void GalleryTheme::implRegisterGalleryItem( ::unogallery::GalleryItem& rItem )
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
// DBG_ASSERT( maItemList.find( &rItem ) == maItemList.end(), "Item already registered" );
maItemList.push_back( &rItem );
}
// ------------------------------------------------------------------------------
-
+
void GalleryTheme::implDeregisterGalleryItem( ::unogallery::GalleryItem& rItem )
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
// DBG_ASSERT( maItemList.find( &rItem ) != maItemList.end(), "Item is not registered" );
maItemList.remove( &rItem );
}
diff --git a/svx/source/unogallery/unogaltheme.hxx b/svx/source/unogallery/unogaltheme.hxx
index 8a0f6f95dd..96a2956f63 100644
--- a/svx/source/unogallery/unogaltheme.hxx
+++ b/svx/source/unogallery/unogaltheme.hxx
@@ -34,7 +34,7 @@
#include <list>
#include <cppuhelper/implbase1.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/gallery/XGalleryTheme.hpp>
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index f96d569b75..a2da39ed92 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,15 +31,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "unogalthemeprovider.hxx"
-#include "unogaltheme.hxx"
-#include "gallery1.hxx"
+#include "unogalthemeprovider.hxx"
+#include "unogaltheme.hxx"
+#include "svx/gallery1.hxx"
#include <rtl/uuid.h>
#include <vos/mutex.hxx>
-#ifndef _SV_SVAPP_HXX_
+#ifndef _SV_SVAPP_HXX_
#include <vcl/svapp.hxx>
#endif
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <com/sun/star/gallery/XGalleryTheme.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -52,7 +52,7 @@ namespace unogallery {
// --------------------
uno::Reference< uno::XInterface > SAL_CALL GalleryThemeProvider_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & )
+ const uno::Reference< lang::XMultiServiceFactory > & )
throw( uno::Exception )
{
return *( new GalleryThemeProvider() );
@@ -60,7 +60,7 @@ uno::Reference< uno::XInterface > SAL_CALL GalleryThemeProvider_createInstance(
// -----------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider_getSupportedServiceNames()
+uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider_getSupportedServiceNames()
throw()
{
return GalleryThemeProvider::getSupportedServiceNames_Static();
@@ -68,7 +68,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider_getSupportedServi
// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL GalleryThemeProvider_getImplementationName()
+::rtl::OUString SAL_CALL GalleryThemeProvider_getImplementationName()
throw()
{
return GalleryThemeProvider::getImplementationName_Static();
@@ -91,7 +91,7 @@ GalleryThemeProvider::~GalleryThemeProvider()
}
// ------------------------------------------------------------------------------
-
+
SVX_DLLPUBLIC ::rtl::OUString GalleryThemeProvider::getImplementationName_Static()
throw()
{
@@ -104,15 +104,15 @@ SVX_DLLPUBLIC uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupporte
throw()
{
uno::Sequence< ::rtl::OUString > aSeq( 1 );
-
+
aSeq.getArray()[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.gallery.GalleryThemeProvider" ) );
-
+
return aSeq;
}
// ------------------------------------------------------------------------------
-
-::rtl::OUString SAL_CALL GalleryThemeProvider::getImplementationName()
+
+::rtl::OUString SAL_CALL GalleryThemeProvider::getImplementationName()
throw( uno::RuntimeException )
{
return getImplementationName_Static();
@@ -120,7 +120,7 @@ SVX_DLLPUBLIC uno::Sequence< ::rtl::OUString > GalleryThemeProvider::getSupporte
// ------------------------------------------------------------------------------
-sal_Bool SAL_CALL GalleryThemeProvider::supportsService( const ::rtl::OUString& ServiceName )
+sal_Bool SAL_CALL GalleryThemeProvider::supportsService( const ::rtl::OUString& ServiceName )
throw( uno::RuntimeException )
{
uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() );
@@ -135,7 +135,7 @@ sal_Bool SAL_CALL GalleryThemeProvider::supportsService( const ::rtl::OUString&
// ------------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider::getSupportedServiceNames()
+uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider::getSupportedServiceNames()
throw( uno::RuntimeException )
{
return getSupportedServiceNames_Static();
@@ -143,7 +143,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider::getSupportedServ
// ------------------------------------------------------------------------------
-uno::Sequence< uno::Type > SAL_CALL GalleryThemeProvider::getTypes()
+uno::Sequence< uno::Type > SAL_CALL GalleryThemeProvider::getTypes()
throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTypes( 6 );
@@ -161,18 +161,18 @@ uno::Sequence< uno::Type > SAL_CALL GalleryThemeProvider::getTypes()
// ------------------------------------------------------------------------------
-uno::Sequence< sal_Int8 > SAL_CALL GalleryThemeProvider::getImplementationId()
+uno::Sequence< sal_Int8 > SAL_CALL GalleryThemeProvider::getImplementationId()
throw(uno::RuntimeException)
{
const vos::OGuard aGuard( Application::GetSolarMutex() );
static uno::Sequence< sal_Int8 > aId;
-
+
if( aId.getLength() == 0 )
{
aId.realloc( 16 );
rtl_createUuid( reinterpret_cast< sal_uInt8* >( aId.getArray() ), 0, sal_True );
}
-
+
return aId;
}
@@ -189,11 +189,11 @@ void SAL_CALL GalleryThemeProvider::initialize( const uno::Sequence< uno::Any >&
if( rArguments[ i ] >>= aParams )
break;
}
-
+
for( i = 0; i < aParams.getLength(); ++i )
{
const beans::PropertyValue& rProp = aParams[ i ];
-
+
if( rProp.Name.equalsAscii( "ProvideHiddenThemes" ) )
rProp.Value >>= mbHiddenThemes;
}
@@ -209,22 +209,22 @@ uno::Type SAL_CALL GalleryThemeProvider::getElementType()
// ------------------------------------------------------------------------------
-sal_Bool SAL_CALL GalleryThemeProvider::hasElements()
+sal_Bool SAL_CALL GalleryThemeProvider::hasElements()
throw (uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
return( ( mpGallery != NULL ) && ( mpGallery->GetThemeCount() > 0 ) );
}
// ------------------------------------------------------------------------------
-
+
uno::Any SAL_CALL GalleryThemeProvider::getByName( const ::rtl::OUString& rName )
throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Any aRet;
-
+
if( !mpGallery || !mpGallery->HasTheme( rName ) )
{
throw container::NoSuchElementException();
@@ -233,7 +233,7 @@ uno::Any SAL_CALL GalleryThemeProvider::getByName( const ::rtl::OUString& rName
{
aRet = uno::makeAny( uno::Reference< gallery::XGalleryTheme >( new ::unogallery::GalleryTheme( rName ) ) );
}
-
+
return aRet;
}
@@ -245,17 +245,17 @@ uno::Sequence< ::rtl::OUString > SAL_CALL GalleryThemeProvider::getElementNames(
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
sal_uInt32 i = 0, nCount = ( mpGallery ? mpGallery->GetThemeCount() : 0 ), nRealCount = 0;
uno::Sequence< ::rtl::OUString > aSeq( nCount );
-
+
for( ; i < nCount; ++i )
{
const GalleryThemeEntry* pEntry = mpGallery->GetThemeInfo( i );
-
+
if( mbHiddenThemes || !pEntry->IsHidden() )
aSeq[ nRealCount++ ] = pEntry->GetThemeName();
}
-
+
aSeq.realloc( nRealCount );
-
+
return aSeq;
}
@@ -265,9 +265,9 @@ sal_Bool SAL_CALL GalleryThemeProvider::hasByName( const ::rtl::OUString& rName
throw (uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
+
sal_Bool bRet = sal_False;
-
+
if( mpGallery && mpGallery->HasTheme( rName ) )
bRet = ( mbHiddenThemes || !mpGallery->GetThemeInfo( rName )->IsHidden() );
@@ -276,12 +276,12 @@ sal_Bool SAL_CALL GalleryThemeProvider::hasByName( const ::rtl::OUString& rName
// ------------------------------------------------------------------------------
-uno::Reference< gallery::XGalleryTheme > SAL_CALL GalleryThemeProvider::insertNewByName( const ::rtl::OUString& rThemeName )
+uno::Reference< gallery::XGalleryTheme > SAL_CALL GalleryThemeProvider::insertNewByName( const ::rtl::OUString& rThemeName )
throw (container::ElementExistException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Reference< gallery::XGalleryTheme > xRet;
-
+
if( mpGallery )
{
if( mpGallery->HasTheme( rThemeName ) )
@@ -293,19 +293,19 @@ uno::Reference< gallery::XGalleryTheme > SAL_CALL GalleryThemeProvider::insertNe
xRet = new ::unogallery::GalleryTheme( rThemeName );
}
}
-
+
return xRet;
}
// ------------------------------------------------------------------------------
-void SAL_CALL GalleryThemeProvider::removeByName( const ::rtl::OUString& rName )
+void SAL_CALL GalleryThemeProvider::removeByName( const ::rtl::OUString& rName )
throw (container::NoSuchElementException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if( !mpGallery ||
- !mpGallery->HasTheme( rName ) ||
+
+ if( !mpGallery ||
+ !mpGallery->HasTheme( rName ) ||
( !mbHiddenThemes && mpGallery->GetThemeInfo( rName )->IsHidden() ) )
{
throw container::NoSuchElementException();
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 1ba98b3e79..22e99d74d7 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -49,7 +49,7 @@
#include <vcl/metaact.hxx>
#include <tools/zcodec.hxx>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include "xmlgrhlp.hxx"
#include <algorithm>
diff --git a/svx/source/xml/xmltxtexp.cxx b/svx/source/xml/xmltxtexp.cxx
index 63a681ed41..5eed46da43 100644
--- a/svx/source/xml/xmltxtexp.cxx
+++ b/svx/source/xml/xmltxtexp.cxx
@@ -38,8 +38,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <tools/debug.hxx>
-#include <svtools/itemprop.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/itemprop.hxx>
+#include <svl/brdcst.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <sfx2/docfile.hxx>
#ifndef _SVSTOR_HXX
diff --git a/svx/source/xml/xmltxtimp.cxx b/svx/source/xml/xmltxtimp.cxx
index 092540886a..966b467aa9 100644
--- a/svx/source/xml/xmltxtimp.cxx
+++ b/svx/source/xml/xmltxtimp.cxx
@@ -44,7 +44,7 @@
#ifndef _SVSTOR_HXX
#include <sot/storage.hxx>
#endif
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <sfx2/docfile.hxx>
#include <xmloff/xmlimp.hxx>
#include "xmloff/xmlmetae.hxx"
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 2b9002aa46..0d8df75d8d 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -38,10 +38,10 @@
#include <tools/poly.hxx>
#include <vcl/virdev.hxx>
#include <vcl/wrkwin.hxx>
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#include <sfx2/docfile.hxx>
#include <sfx2/app.hxx>
-#include "impgrf.hxx"
+#include "svx/impgrf.hxx"
#include "xoutbmp.hxx"
#include <svtools/FilterConfigItem.hxx>
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 1e527885b7..eb47f435ad 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -43,16 +43,16 @@
#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <tools/stream.hxx>
#include "unoapi.hxx"
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include "unopolyhelper.hxx"
#include <tools/bigint.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/dialogs.hrc>
#include "svdstr.hrc"
#include "xattr.hxx"
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index f34e9859aa..d0f2052526 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -37,7 +37,7 @@
#include <vcl/virdev.hxx>
#include <vcl/bitmapex.hxx>
#include <toolkit/unohlp.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svx/dialogs.hrc>
#include "xattr.hxx"
diff --git a/svx/source/xoutdev/xexch.cxx b/svx/source/xoutdev/xexch.cxx
index 40e7804adc..0bdaf792bb 100644
--- a/svx/source/xoutdev/xexch.cxx
+++ b/svx/source/xoutdev/xexch.cxx
@@ -38,13 +38,13 @@
#include <svx/xflasit.hxx>
#include <svx/xfillit0.hxx>
#ifndef _SFXIPOOL_HXX
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#endif
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#ifndef _SFXIPOOL_HXX
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#endif
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/xdef.hxx>
#include "xexch.hxx"
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index fe81d0f8bd..f583b2edde 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -36,7 +36,7 @@
#include <svx/xpool.hxx>
#include <svx/svdattr.hxx>
#include <svx/svxids.hrc>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
/*************************************************************************
|*
diff --git a/svx/source/xoutdev/xtabbtmp.cxx b/svx/source/xoutdev/xtabbtmp.cxx
index 57e56fdec0..747a9c873b 100644
--- a/svx/source/xoutdev/xtabbtmp.cxx
+++ b/svx/source/xoutdev/xtabbtmp.cxx
@@ -44,7 +44,7 @@
#include <tools/urlobj.hxx>
#include <vcl/virdev.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/docfile.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/xoutdev/xtabcolr.cxx b/svx/source/xoutdev/xtabcolr.cxx
index 06543d2e82..911f9fd22c 100644
--- a/svx/source/xoutdev/xtabcolr.cxx
+++ b/svx/source/xoutdev/xtabcolr.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@
#include "XPropertyTable.hxx"
#include <unotools/ucbstreamhelper.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include "xmlxtexp.hxx"
#include "xmlxtimp.hxx"
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index e2a3ad1902..a3b2e6d6b3 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -48,7 +48,7 @@
#include <tools/urlobj.hxx>
#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/docfile.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 4f43f10ce2..75f41bb262 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -46,7 +46,7 @@
#include <tools/urlobj.hxx>
#include <vcl/virdev.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/docfile.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 90eba033e8..3e5bed7505 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -47,7 +47,7 @@
#include <tools/urlobj.hxx>
#include <vcl/virdev.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/docfile.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx
index f83e6c35f3..1e48f30c13 100644
--- a/svx/source/xoutdev/xtablend.cxx
+++ b/svx/source/xoutdev/xtablend.cxx
@@ -49,7 +49,7 @@
#ifndef _SV_APP_HXX
#include <vcl/svapp.hxx>
#endif
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/docfile.hxx>
#include <svx/dialogs.hrc>