summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/attarray.cxx2433
-rw-r--r--sc/source/core/data/attrib.cxx1233
-rw-r--r--sc/source/core/data/autonamecache.cxx111
-rw-r--r--sc/source/core/data/bcaslot.cxx935
-rw-r--r--sc/source/core/data/cell.cxx1977
-rw-r--r--sc/source/core/data/cell2.cxx1717
-rw-r--r--sc/source/core/data/clipparam.cxx214
-rw-r--r--sc/source/core/data/column.cxx2176
-rw-r--r--sc/source/core/data/column2.cxx1781
-rw-r--r--sc/source/core/data/column3.cxx2034
-rw-r--r--sc/source/core/data/compressedarray.cxx497
-rw-r--r--sc/source/core/data/conditio.cxx1688
-rw-r--r--sc/source/core/data/dbdocutl.cxx208
-rw-r--r--sc/source/core/data/dociter.cxx2208
-rw-r--r--sc/source/core/data/docparam.cxx39
-rw-r--r--sc/source/core/data/docpool.cxx1045
-rw-r--r--sc/source/core/data/documen2.cxx1251
-rw-r--r--sc/source/core/data/documen3.cxx2042
-rw-r--r--sc/source/core/data/documen4.cxx1234
-rw-r--r--sc/source/core/data/documen5.cxx790
-rw-r--r--sc/source/core/data/documen6.cxx185
-rw-r--r--sc/source/core/data/documen7.cxx523
-rw-r--r--sc/source/core/data/documen8.cxx1628
-rw-r--r--sc/source/core/data/documen9.cxx775
-rw-r--r--sc/source/core/data/document.cxx5447
-rw-r--r--sc/source/core/data/dpcachetable.cxx469
-rw-r--r--sc/source/core/data/dpdimsave.cxx586
-rw-r--r--sc/source/core/data/dpglobal.cxx101
-rw-r--r--sc/source/core/data/dpgroup.cxx1566
-rw-r--r--sc/source/core/data/dpobject.cxx2804
-rw-r--r--sc/source/core/data/dpoutput.cxx2183
-rw-r--r--sc/source/core/data/dpoutputgeometry.cxx217
-rw-r--r--sc/source/core/data/dpsave.cxx1439
-rw-r--r--sc/source/core/data/dpsdbtab.cxx187
-rw-r--r--sc/source/core/data/dpshttab.cxx360
-rw-r--r--sc/source/core/data/dptabdat.cxx314
-rw-r--r--sc/source/core/data/dptablecache.cxx1063
-rw-r--r--sc/source/core/data/dptabres.cxx4063
-rw-r--r--sc/source/core/data/dptabsrc.cxx2843
-rw-r--r--sc/source/core/data/drawpage.cxx67
-rw-r--r--sc/source/core/data/drwlayer.cxx1963
-rw-r--r--sc/source/core/data/fillinfo.cxx1081
-rw-r--r--sc/source/core/data/funcdesc.cxx888
-rw-r--r--sc/source/core/data/global.cxx1175
-rw-r--r--sc/source/core/data/global2.cxx517
-rw-r--r--sc/source/core/data/globalx.cxx176
-rw-r--r--sc/source/core/data/markarr.cxx405
-rw-r--r--sc/source/core/data/markdata.cxx609
-rw-r--r--sc/source/core/data/olinetab.cxx778
-rw-r--r--sc/source/core/data/pagepar.cxx125
-rw-r--r--sc/source/core/data/patattr.cxx1340
-rw-r--r--sc/source/core/data/pivot2.cxx225
-rw-r--r--sc/source/core/data/poolhelp.cxx130
-rw-r--r--sc/source/core/data/postit.cxx925
-rw-r--r--sc/source/core/data/segmenttree.cxx573
-rw-r--r--sc/source/core/data/sheetevents.cxx168
-rw-r--r--sc/source/core/data/sortparam.cxx273
-rw-r--r--sc/source/core/data/stlpool.cxx523
-rw-r--r--sc/source/core/data/stlsheet.cxx354
-rw-r--r--sc/source/core/data/subtotalparam.cxx232
-rw-r--r--sc/source/core/data/tabbgcolor.cxx52
-rw-r--r--sc/source/core/data/table1.cxx1906
-rw-r--r--sc/source/core/data/table2.cxx3126
-rw-r--r--sc/source/core/data/table3.cxx2125
-rw-r--r--sc/source/core/data/table4.cxx1982
-rw-r--r--sc/source/core/data/table5.cxx1231
-rw-r--r--sc/source/core/data/table6.cxx1053
-rw-r--r--sc/source/core/data/tabprotection.cxx525
-rw-r--r--sc/source/core/data/userdat.cxx129
-rw-r--r--sc/source/core/data/validat.cxx974
-rw-r--r--sc/source/core/inc/addinhelpid.hxx62
-rw-r--r--sc/source/core/inc/addinlis.hxx99
-rw-r--r--sc/source/core/inc/adiasync.hxx95
-rw-r--r--sc/source/core/inc/bcaslot.hxx309
-rw-r--r--sc/source/core/inc/cellkeytranslator.hxx94
-rw-r--r--sc/source/core/inc/core_pch.hxx243
-rw-r--r--sc/source/core/inc/ddelink.hxx101
-rw-r--r--sc/source/core/inc/doubleref.hxx193
-rw-r--r--sc/source/core/inc/interpre.hxx922
-rw-r--r--sc/source/core/inc/jumpmatrix.hxx224
-rw-r--r--sc/source/core/inc/parclass.hxx182
-rw-r--r--sc/source/core/inc/poolhelp.hxx76
-rw-r--r--sc/source/core/inc/refupdat.hxx102
-rw-r--r--sc/source/core/inc/scrdata.hxx51
-rw-r--r--sc/source/core/src/compiler.src77
-rw-r--r--sc/source/core/tool/addincfg.cxx74
-rw-r--r--sc/source/core/tool/addincol.cxx1782
-rw-r--r--sc/source/core/tool/addinhelpid.cxx214
-rw-r--r--sc/source/core/tool/addinlis.cxx157
-rw-r--r--sc/source/core/tool/address.cxx2039
-rw-r--r--sc/source/core/tool/adiasync.cxx189
-rw-r--r--sc/source/core/tool/appoptio.cxx752
-rw-r--r--sc/source/core/tool/autoform.cxx1169
-rw-r--r--sc/source/core/tool/callform.cxx456
-rw-r--r--sc/source/core/tool/cellform.cxx218
-rw-r--r--sc/source/core/tool/cellkeytranslator.cxx235
-rw-r--r--sc/source/core/tool/cellkeywords.inl181
-rw-r--r--sc/source/core/tool/chartarr.cxx531
-rw-r--r--sc/source/core/tool/charthelper.cxx448
-rw-r--r--sc/source/core/tool/chartlis.cxx731
-rw-r--r--sc/source/core/tool/chartlock.cxx198
-rw-r--r--sc/source/core/tool/chartpos.cxx607
-rw-r--r--sc/source/core/tool/chgtrack.cxx4647
-rw-r--r--sc/source/core/tool/chgviset.cxx171
-rw-r--r--sc/source/core/tool/collect.cxx506
-rw-r--r--sc/source/core/tool/compiler.cxx5426
-rw-r--r--sc/source/core/tool/consoli.cxx844
-rw-r--r--sc/source/core/tool/dbcolect.cxx1025
-rw-r--r--sc/source/core/tool/ddelink.cxx277
-rw-r--r--sc/source/core/tool/detdata.cxx120
-rw-r--r--sc/source/core/tool/detfunc.cxx1742
-rw-r--r--sc/source/core/tool/docoptio.cxx717
-rw-r--r--sc/source/core/tool/doubleref.cxx547
-rw-r--r--sc/source/core/tool/editutil.cxx780
-rw-r--r--sc/source/core/tool/filtopt.cxx122
-rw-r--r--sc/source/core/tool/formulaparserpool.cxx165
-rw-r--r--sc/source/core/tool/hints.cxx160
-rw-r--r--sc/source/core/tool/inputopt.cxx276
-rw-r--r--sc/source/core/tool/interpr1.cxx7784
-rw-r--r--sc/source/core/tool/interpr2.cxx3029
-rw-r--r--sc/source/core/tool/interpr3.cxx4158
-rw-r--r--sc/source/core/tool/interpr4.cxx4314
-rw-r--r--sc/source/core/tool/interpr5.cxx3316
-rw-r--r--sc/source/core/tool/interpr6.cxx200
-rw-r--r--sc/source/core/tool/interpr7.cxx38
-rw-r--r--sc/source/core/tool/lookupcache.cxx92
-rw-r--r--sc/source/core/tool/navicfg.cxx82
-rw-r--r--sc/source/core/tool/odffmap.cxx151
-rw-r--r--sc/source/core/tool/optutil.cxx79
-rw-r--r--sc/source/core/tool/parclass.cxx586
-rw-r--r--sc/source/core/tool/printopt.cxx210
-rw-r--r--sc/source/core/tool/prnsave.cxx137
-rw-r--r--sc/source/core/tool/progress.cxx207
-rw-r--r--sc/source/core/tool/queryparam.cxx385
-rw-r--r--sc/source/core/tool/rangelst.cxx925
-rw-r--r--sc/source/core/tool/rangenam.cxx884
-rw-r--r--sc/source/core/tool/rangeseq.cxx473
-rw-r--r--sc/source/core/tool/rangeutl.cxx1094
-rw-r--r--sc/source/core/tool/rechead.cxx175
-rw-r--r--sc/source/core/tool/refdata.cxx271
-rw-r--r--sc/source/core/tool/reffind.cxx303
-rw-r--r--sc/source/core/tool/refreshtimer.cxx83
-rw-r--r--sc/source/core/tool/reftokenhelper.cxx490
-rw-r--r--sc/source/core/tool/refupdat.cxx941
-rw-r--r--sc/source/core/tool/scmatrix.cxx1210
-rw-r--r--sc/source/core/tool/simplerangelist.cxx243
-rw-r--r--sc/source/core/tool/stringutil.cxx167
-rw-r--r--sc/source/core/tool/subtotal.cxx84
-rw-r--r--sc/source/core/tool/token.cxx1835
-rw-r--r--sc/source/core/tool/unitconv.cxx180
-rw-r--r--sc/source/core/tool/userlist.cxx299
-rw-r--r--sc/source/core/tool/viewopti.cxx753
-rw-r--r--sc/source/core/tool/zforauto.cxx109
-rw-r--r--sc/source/filter/dif/difexp.cxx319
-rw-r--r--sc/source/filter/dif/difimp.cxx994
-rw-r--r--sc/source/filter/excel/colrowst.cxx364
-rw-r--r--sc/source/filter/excel/excdoc.cxx827
-rw-r--r--sc/source/filter/excel/excel.cxx298
-rw-r--r--sc/source/filter/excel/excform.cxx1944
-rw-r--r--sc/source/filter/excel/excform8.cxx1681
-rw-r--r--sc/source/filter/excel/excimp8.cxx859
-rw-r--r--sc/source/filter/excel/excrecds.cxx1060
-rw-r--r--sc/source/filter/excel/exctools.cxx296
-rw-r--r--sc/source/filter/excel/expop2.cxx151
-rw-r--r--sc/source/filter/excel/fontbuff.cxx165
-rw-r--r--sc/source/filter/excel/frmbase.cxx248
-rw-r--r--sc/source/filter/excel/impop.cxx1336
-rw-r--r--sc/source/filter/excel/namebuff.cxx346
-rw-r--r--sc/source/filter/excel/ooxml-export-TODO.txt148
-rw-r--r--sc/source/filter/excel/read.cxx1307
-rw-r--r--sc/source/filter/excel/tokstack.cxx881
-rw-r--r--sc/source/filter/excel/xechart.cxx3525
-rw-r--r--sc/source/filter/excel/xecontent.cxx1496
-rw-r--r--sc/source/filter/excel/xeescher.cxx1641
-rw-r--r--sc/source/filter/excel/xeformula.cxx2629
-rw-r--r--sc/source/filter/excel/xehelper.cxx1127
-rw-r--r--sc/source/filter/excel/xelink.cxx2367
-rw-r--r--sc/source/filter/excel/xename.cxx767
-rw-r--r--sc/source/filter/excel/xepage.cxx436
-rw-r--r--sc/source/filter/excel/xepivot.cxx1971
-rw-r--r--sc/source/filter/excel/xerecord.cxx304
-rw-r--r--sc/source/filter/excel/xeroot.cxx319
-rw-r--r--sc/source/filter/excel/xestream.cxx1221
-rw-r--r--sc/source/filter/excel/xestring.cxx606
-rw-r--r--sc/source/filter/excel/xestyle.cxx2860
-rw-r--r--sc/source/filter/excel/xetable.cxx2443
-rw-r--r--sc/source/filter/excel/xeview.cxx540
-rw-r--r--sc/source/filter/excel/xichart.cxx4332
-rw-r--r--sc/source/filter/excel/xicontent.cxx1329
-rw-r--r--sc/source/filter/excel/xiescher.cxx4206
-rw-r--r--sc/source/filter/excel/xiformula.cxx129
-rw-r--r--sc/source/filter/excel/xihelper.cxx893
-rw-r--r--sc/source/filter/excel/xilink.cxx952
-rw-r--r--sc/source/filter/excel/xiname.cxx279
-rw-r--r--sc/source/filter/excel/xipage.cxx392
-rw-r--r--sc/source/filter/excel/xipivot.cxx1678
-rw-r--r--sc/source/filter/excel/xiroot.cxx311
-rw-r--r--sc/source/filter/excel/xistream.cxx1142
-rw-r--r--sc/source/filter/excel/xistring.cxx215
-rw-r--r--sc/source/filter/excel/xistyle.cxx2000
-rw-r--r--sc/source/filter/excel/xiview.cxx309
-rw-r--r--sc/source/filter/excel/xladdress.cxx165
-rw-r--r--sc/source/filter/excel/xlchart.cxx1351
-rw-r--r--sc/source/filter/excel/xlescher.cxx382
-rw-r--r--sc/source/filter/excel/xlformula.cxx788
-rw-r--r--sc/source/filter/excel/xlpage.cxx277
-rw-r--r--sc/source/filter/excel/xlpivot.cxx1028
-rw-r--r--sc/source/filter/excel/xlroot.cxx440
-rw-r--r--sc/source/filter/excel/xlstyle.cxx1772
-rw-r--r--sc/source/filter/excel/xltoolbar.cxx447
-rw-r--r--sc/source/filter/excel/xltoolbar.hxx127
-rw-r--r--sc/source/filter/excel/xltools.cxx750
-rw-r--r--sc/source/filter/excel/xltracer.cxx266
-rw-r--r--sc/source/filter/excel/xlview.cxx117
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx420
-rw-r--r--sc/source/filter/ftools/fprogressbar.cxx253
-rw-r--r--sc/source/filter/ftools/ftools.cxx410
-rw-r--r--sc/source/filter/html/htmlexp.cxx1338
-rw-r--r--sc/source/filter/html/htmlexp2.cxx251
-rw-r--r--sc/source/filter/html/htmlimp.cxx263
-rw-r--r--sc/source/filter/html/htmlpars.cxx3002
-rw-r--r--sc/source/filter/inc/XclExpChangeTrack.hxx679
-rw-r--r--sc/source/filter/inc/XclImpChangeTrack.hxx198
-rw-r--r--sc/source/filter/inc/biff.hxx66
-rw-r--r--sc/source/filter/inc/colrowst.hxx91
-rw-r--r--sc/source/filter/inc/decl.h46
-rw-r--r--sc/source/filter/inc/dif.hxx204
-rw-r--r--sc/source/filter/inc/eeimport.hxx71
-rw-r--r--sc/source/filter/inc/eeparser.hxx149
-rw-r--r--sc/source/filter/inc/excdefs.hxx108
-rw-r--r--sc/source/filter/inc/excdoc.hxx123
-rw-r--r--sc/source/filter/inc/excform.hxx162
-rw-r--r--sc/source/filter/inc/excimp8.hxx163
-rw-r--r--sc/source/filter/inc/excrecds.hxx511
-rw-r--r--sc/source/filter/inc/excscen.hxx89
-rw-r--r--sc/source/filter/inc/exp_op.hxx134
-rw-r--r--sc/source/filter/inc/expbase.hxx84
-rw-r--r--sc/source/filter/inc/fapihelper.hxx350
-rw-r--r--sc/source/filter/inc/filt_pch.hxx313
-rw-r--r--sc/source/filter/inc/fkttab.h48
-rw-r--r--sc/source/filter/inc/flttypes.hxx53
-rw-r--r--sc/source/filter/inc/formel.hxx202
-rw-r--r--sc/source/filter/inc/fprogressbar.hxx246
-rw-r--r--sc/source/filter/inc/ftools.hxx341
-rw-r--r--sc/source/filter/inc/funktion.h52
-rw-r--r--sc/source/filter/inc/htmlexp.hxx177
-rw-r--r--sc/source/filter/inc/htmlimp.hxx55
-rw-r--r--sc/source/filter/inc/htmlpars.hxx640
-rw-r--r--sc/source/filter/inc/imp_op.hxx209
-rw-r--r--sc/source/filter/inc/lotattr.hxx159
-rw-r--r--sc/source/filter/inc/lotfntbf.hxx114
-rw-r--r--sc/source/filter/inc/lotform.hxx134
-rw-r--r--sc/source/filter/inc/lotimpop.hxx171
-rw-r--r--sc/source/filter/inc/lotrange.hxx169
-rw-r--r--sc/source/filter/inc/namebuff.hxx358
-rw-r--r--sc/source/filter/inc/op.h72
-rw-r--r--sc/source/filter/inc/optab.h54
-rw-r--r--sc/source/filter/inc/otlnbuff.hxx62
-rw-r--r--sc/source/filter/inc/qpro.hxx61
-rw-r--r--sc/source/filter/inc/qproform.hxx89
-rw-r--r--sc/source/filter/inc/qprostyle.hxx72
-rw-r--r--sc/source/filter/inc/root.hxx121
-rw-r--r--sc/source/filter/inc/rtfexp.hxx54
-rw-r--r--sc/source/filter/inc/rtfimp.hxx44
-rw-r--r--sc/source/filter/inc/rtfparse.hxx92
-rw-r--r--sc/source/filter/inc/scflt.hxx766
-rw-r--r--sc/source/filter/inc/scfobj.hxx47
-rw-r--r--sc/source/filter/inc/scmem.h39
-rw-r--r--sc/source/filter/inc/tokstack.hxx416
-rw-r--r--sc/source/filter/inc/tool.h166
-rw-r--r--sc/source/filter/inc/xcl97dum.hxx93
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx214
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx627
-rw-r--r--sc/source/filter/inc/xechart.hxx1287
-rw-r--r--sc/source/filter/inc/xecontent.hxx356
-rw-r--r--sc/source/filter/inc/xeescher.hxx485
-rw-r--r--sc/source/filter/inc/xeformula.hxx100
-rw-r--r--sc/source/filter/inc/xehelper.hxx451
-rw-r--r--sc/source/filter/inc/xelink.hxx222
-rw-r--r--sc/source/filter/inc/xename.hxx92
-rw-r--r--sc/source/filter/inc/xepage.hxx139
-rw-r--r--sc/source/filter/inc/xepivot.hxx488
-rw-r--r--sc/source/filter/inc/xerecord.hxx422
-rw-r--r--sc/source/filter/inc/xeroot.hxx182
-rw-r--r--sc/source/filter/inc/xestream.hxx361
-rw-r--r--sc/source/filter/inc/xestring.hxx301
-rw-r--r--sc/source/filter/inc/xestyle.hxx742
-rw-r--r--sc/source/filter/inc/xetable.hxx1070
-rw-r--r--sc/source/filter/inc/xeview.hxx182
-rw-r--r--sc/source/filter/inc/xichart.hxx1526
-rw-r--r--sc/source/filter/inc/xicontent.hxx348
-rw-r--r--sc/source/filter/inc/xiescher.hxx1315
-rw-r--r--sc/source/filter/inc/xiformula.hxx71
-rw-r--r--sc/source/filter/inc/xihelper.hxx355
-rw-r--r--sc/source/filter/inc/xilink.hxx235
-rw-r--r--sc/source/filter/inc/xiname.hxx102
-rw-r--r--sc/source/filter/inc/xipage.hxx84
-rw-r--r--sc/source/filter/inc/xipivot.hxx467
-rw-r--r--sc/source/filter/inc/xiroot.hxx228
-rw-r--r--sc/source/filter/inc/xistream.hxx532
-rw-r--r--sc/source/filter/inc/xistring.hxx123
-rw-r--r--sc/source/filter/inc/xistyle.hxx683
-rw-r--r--sc/source/filter/inc/xiview.hxx97
-rw-r--r--sc/source/filter/inc/xladdress.hxx199
-rw-r--r--sc/source/filter/inc/xlchart.hxx1525
-rw-r--r--sc/source/filter/inc/xlconst.hxx266
-rw-r--r--sc/source/filter/inc/xlcontent.hxx196
-rw-r--r--sc/source/filter/inc/xlescher.hxx462
-rw-r--r--sc/source/filter/inc/xlformula.hxx572
-rw-r--r--sc/source/filter/inc/xllink.hxx95
-rw-r--r--sc/source/filter/inc/xlname.hxx77
-rw-r--r--sc/source/filter/inc/xlpage.hxx163
-rw-r--r--sc/source/filter/inc/xlpivot.hxx784
-rw-r--r--sc/source/filter/inc/xlroot.hxx300
-rw-r--r--sc/source/filter/inc/xlstream.hxx55
-rw-r--r--sc/source/filter/inc/xlstring.hxx99
-rw-r--r--sc/source/filter/inc/xlstyle.hxx623
-rw-r--r--sc/source/filter/inc/xltable.hxx180
-rw-r--r--sc/source/filter/inc/xltools.hxx280
-rw-r--r--sc/source/filter/inc/xltracer.hxx149
-rw-r--r--sc/source/filter/inc/xlview.hxx181
-rw-r--r--sc/source/filter/lotus/expop.cxx414
-rw-r--r--sc/source/filter/lotus/export.cxx60
-rw-r--r--sc/source/filter/lotus/filter.cxx250
-rw-r--r--sc/source/filter/lotus/lotattr.cxx273
-rw-r--r--sc/source/filter/lotus/lotform.cxx2076
-rw-r--r--sc/source/filter/lotus/lotimpop.cxx475
-rw-r--r--sc/source/filter/lotus/lotread.cxx326
-rw-r--r--sc/source/filter/lotus/lotus.cxx104
-rw-r--r--sc/source/filter/lotus/memory.cxx142
-rw-r--r--sc/source/filter/lotus/op.cxx668
-rw-r--r--sc/source/filter/lotus/optab.cxx251
-rw-r--r--sc/source/filter/lotus/tool.cxx654
-rw-r--r--sc/source/filter/qpro/biff.cxx106
-rw-r--r--sc/source/filter/qpro/qpro.cxx233
-rw-r--r--sc/source/filter/qpro/qproform.cxx749
-rw-r--r--sc/source/filter/qpro/qprostyle.cxx171
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx645
-rw-r--r--sc/source/filter/rtf/expbase.cxx108
-rw-r--r--sc/source/filter/rtf/rtfexp.cxx277
-rw-r--r--sc/source/filter/rtf/rtfimp.cxx77
-rw-r--r--sc/source/filter/rtf/rtfparse.cxx434
-rw-r--r--sc/source/filter/starcalc/scflt.cxx2406
-rw-r--r--sc/source/filter/starcalc/scfobj.cxx106
-rw-r--r--sc/source/filter/xcl97/XclExpChangeTrack.cxx1706
-rw-r--r--sc/source/filter/xcl97/XclImpChangeTrack.cxx504
-rw-r--r--sc/source/filter/xcl97/xcl97dum.cxx165
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx554
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx1752
-rw-r--r--sc/source/filter/xml/XMLCalculationSettingsContext.cxx275
-rw-r--r--sc/source/filter/xml/XMLCalculationSettingsContext.hxx114
-rw-r--r--sc/source/filter/xml/XMLCellRangeSourceContext.cxx135
-rw-r--r--sc/source/filter/xml/XMLCellRangeSourceContext.hxx82
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx765
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx101
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx938
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx252
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx208
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.hxx73
-rw-r--r--sc/source/filter/xml/XMLColumnRowGroupExport.cxx189
-rw-r--r--sc/source/filter/xml/XMLColumnRowGroupExport.hxx75
-rw-r--r--sc/source/filter/xml/XMLConsolidationContext.cxx161
-rw-r--r--sc/source/filter/xml/XMLConsolidationContext.hxx75
-rw-r--r--sc/source/filter/xml/XMLConverter.cxx665
-rw-r--r--sc/source/filter/xml/XMLConverter.hxx176
-rw-r--r--sc/source/filter/xml/XMLDDELinksContext.cxx495
-rw-r--r--sc/source/filter/xml/XMLDDELinksContext.hxx233
-rw-r--r--sc/source/filter/xml/XMLDetectiveContext.cxx266
-rw-r--r--sc/source/filter/xml/XMLDetectiveContext.hxx177
-rw-r--r--sc/source/filter/xml/XMLEmptyContext.cxx66
-rw-r--r--sc/source/filter/xml/XMLEmptyContext.hxx60
-rw-r--r--sc/source/filter/xml/XMLExportDDELinks.cxx198
-rw-r--r--sc/source/filter/xml/XMLExportDDELinks.hxx55
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.cxx903
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.hxx82
-rw-r--r--sc/source/filter/xml/XMLExportDatabaseRanges.cxx1223
-rw-r--r--sc/source/filter/xml/XMLExportDatabaseRanges.hxx64
-rw-r--r--sc/source/filter/xml/XMLExportIterator.cxx895
-rw-r--r--sc/source/filter/xml/XMLExportIterator.hxx417
-rw-r--r--sc/source/filter/xml/XMLExportSharedData.cxx166
-rw-r--r--sc/source/filter/xml/XMLExportSharedData.hxx92
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx1280
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.hxx305
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.cxx577
-rw-r--r--sc/source/filter/xml/XMLStylesImportHelper.hxx197
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.cxx272
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.hxx117
-rw-r--r--sc/source/filter/xml/XMLTableMasterPageExport.cxx180
-rw-r--r--sc/source/filter/xml/XMLTableMasterPageExport.hxx68
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.cxx222
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.hxx65
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.cxx160
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.hxx71
-rw-r--r--sc/source/filter/xml/XMLTableShapesContext.cxx89
-rw-r--r--sc/source/filter/xml/XMLTableShapesContext.hxx58
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.cxx147
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.hxx66
-rw-r--r--sc/source/filter/xml/XMLTextPContext.cxx226
-rw-r--r--sc/source/filter/xml/XMLTextPContext.hxx75
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx2008
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.hxx64
-rw-r--r--sc/source/filter/xml/cachedattraccess.cxx72
-rw-r--r--sc/source/filter/xml/cachedattraccess.hxx66
-rw-r--r--sc/source/filter/xml/sheetdata.cxx285
-rw-r--r--sc/source/filter/xml/xmlannoi.cxx211
-rw-r--r--sc/source/filter/xml/xmlannoi.hxx124
-rw-r--r--sc/source/filter/xml/xmlbodyi.cxx312
-rw-r--r--sc/source/filter/xml/xmlbodyi.hxx67
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx1132
-rw-r--r--sc/source/filter/xml/xmlcelli.hxx132
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx312
-rw-r--r--sc/source/filter/xml/xmlcoli.hxx96
-rw-r--r--sc/source/filter/xml/xmlconti.cxx110
-rw-r--r--sc/source/filter/xml/xmlconti.hxx66
-rw-r--r--sc/source/filter/xml/xmlcvali.cxx699
-rw-r--r--sc/source/filter/xml/xmlcvali.hxx64
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx1851
-rw-r--r--sc/source/filter/xml/xmldpimp.hxx698
-rw-r--r--sc/source/filter/xml/xmldrani.cxx1216
-rw-r--r--sc/source/filter/xml/xmldrani.hxx371
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx4459
-rw-r--r--sc/source/filter/xml/xmlexprt.hxx287
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.cxx440
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.hxx179
-rw-r--r--sc/source/filter/xml/xmlfilti.cxx787
-rw-r--r--sc/source/filter/xml/xmlfilti.hxx313
-rw-r--r--sc/source/filter/xml/xmlfonte.cxx155
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx3187
-rw-r--r--sc/source/filter/xml/xmlimprt.hxx1061
-rw-r--r--sc/source/filter/xml/xmllabri.cxx147
-rw-r--r--sc/source/filter/xml/xmllabri.hxx93
-rw-r--r--sc/source/filter/xml/xmlnexpi.cxx245
-rw-r--r--sc/source/filter/xml/xmlnexpi.hxx156
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx362
-rw-r--r--sc/source/filter/xml/xmlrowi.hxx96
-rw-r--r--sc/source/filter/xml/xmlsceni.cxx177
-rw-r--r--sc/source/filter/xml/xmlsceni.hxx73
-rw-r--r--sc/source/filter/xml/xmlsorti.cxx281
-rw-r--r--sc/source/filter/xml/xmlsorti.hxx109
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx1952
-rw-r--r--sc/source/filter/xml/xmlstyle.hxx363
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx1092
-rw-r--r--sc/source/filter/xml/xmlstyli.hxx331
-rw-r--r--sc/source/filter/xml/xmlsubti.cxx831
-rw-r--r--sc/source/filter/xml/xmlsubti.hxx208
-rw-r--r--sc/source/filter/xml/xmltabi.cxx506
-rw-r--r--sc/source/filter/xml/xmltabi.hxx103
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx968
-rw-r--r--sc/source/ui/Accessibility/AccessibilityHints.cxx115
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx456
-rw-r--r--sc/source/ui/Accessibility/AccessibleCellBase.cxx342
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx625
-rw-r--r--sc/source/ui/Accessibility/AccessibleCsvControl.cxx1669
-rw-r--r--sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx736
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx2090
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentBase.cxx52
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx1712
-rw-r--r--sc/source/ui/Accessibility/AccessibleEditObject.cxx354
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenu.cxx400
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx207
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx129
-rw-r--r--sc/source/ui/Accessibility/AccessibleGlobal.cxx97
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx442
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx327
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx318
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx444
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx707
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx978
-rw-r--r--sc/source/ui/Accessibility/AccessibleTableBase.cxx489
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx1781
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx96
-rw-r--r--sc/source/ui/app/client.cxx257
-rw-r--r--sc/source/ui/app/drwtrans.cxx813
-rw-r--r--sc/source/ui/app/inputhdl.cxx3818
-rw-r--r--sc/source/ui/app/inputwin.cxx1800
-rw-r--r--sc/source/ui/app/lnktrans.cxx99
-rw-r--r--sc/source/ui/app/msgpool.cxx125
-rw-r--r--sc/source/ui/app/rfindlst.cxx69
-rw-r--r--sc/source/ui/app/scdll.cxx337
-rw-r--r--sc/source/ui/app/scmod.cxx2208
-rw-r--r--sc/source/ui/app/scmod2.cxx106
-rw-r--r--sc/source/ui/app/seltrans.cxx450
-rw-r--r--sc/source/ui/app/template.cxx81
-rw-r--r--sc/source/ui/app/transobj.cxx876
-rw-r--r--sc/source/ui/app/typemap.cxx139
-rw-r--r--sc/source/ui/app/uiitems.cxx724
-rw-r--r--sc/source/ui/app/wtcdummy.cxx68
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx147
-rw-r--r--sc/source/ui/attrdlg/condfrmt.cxx871
-rw-r--r--sc/source/ui/attrdlg/scabstdlg.cxx60
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx1648
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx603
-rw-r--r--sc/source/ui/attrdlg/scuiexp.cxx58
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx253
-rw-r--r--sc/source/ui/cctrl/cbuttonw.cxx180
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx1424
-rw-r--r--sc/source/ui/cctrl/dpcontrol.src79
-rw-r--r--sc/source/ui/cctrl/editfield.cxx86
-rw-r--r--sc/source/ui/cctrl/popmenu.cxx50
-rw-r--r--sc/source/ui/cctrl/tbinsert.cxx143
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx532
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx412
-rw-r--r--sc/source/ui/dbgui/asciiopt.hrc62
-rw-r--r--sc/source/ui/dbgui/asciiopt.src277
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx657
-rw-r--r--sc/source/ui/dbgui/consdlg.hrc60
-rw-r--r--sc/source/ui/dbgui/consdlg.src230
-rw-r--r--sc/source/ui/dbgui/csvcontrol.cxx339
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx1375
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx685
-rw-r--r--sc/source/ui/dbgui/csvsplits.cxx122
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx436
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx231
-rw-r--r--sc/source/ui/dbgui/dapitype.cxx184
-rw-r--r--sc/source/ui/dbgui/dapitype.hrc54
-rw-r--r--sc/source/ui/dbgui/dapitype.src310
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx726
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.cxx358
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.hrc63
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.src285
-rw-r--r--sc/source/ui/dbgui/dpuiglobal.hxx42
-rw-r--r--sc/source/ui/dbgui/expftext.cxx97
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx1294
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx1253
-rw-r--r--sc/source/ui/dbgui/foptmgr.cxx341
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx120
-rw-r--r--sc/source/ui/dbgui/imoptdlg.hrc43
-rw-r--r--sc/source/ui/dbgui/imoptdlg.src135
-rw-r--r--sc/source/ui/dbgui/outline.src42
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx622
-rw-r--r--sc/source/ui/dbgui/pivot.hrc81
-rw-r--r--sc/source/ui/dbgui/pivot.src329
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx859
-rw-r--r--sc/source/ui/dbgui/pvfundlg.hrc79
-rw-r--r--sc/source/ui/dbgui/pvfundlg.src538
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx1941
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx250
-rw-r--r--sc/source/ui/dbgui/scendlg.hrc60
-rw-r--r--sc/source/ui/dbgui/scendlg.src171
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx736
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx325
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx523
-rw-r--r--sc/source/ui/dbgui/sortdlg.cxx110
-rw-r--r--sc/source/ui/dbgui/subtdlg.cxx71
-rw-r--r--sc/source/ui/dbgui/textimportoptions.cxx120
-rw-r--r--sc/source/ui/dbgui/textimportoptions.src111
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx1078
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx681
-rw-r--r--sc/source/ui/dbgui/validate.cxx998
-rw-r--r--sc/source/ui/dbgui/validate.src337
-rw-r--r--sc/source/ui/docshell/arealink.cxx531
-rw-r--r--sc/source/ui/docshell/autostyl.cxx234
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx1533
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx724
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4948
-rw-r--r--sc/source/ui/docshell/docsh.cxx3049
-rw-r--r--sc/source/ui/docshell/docsh2.cxx233
-rw-r--r--sc/source/ui/docshell/docsh3.cxx1373
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2333
-rw-r--r--sc/source/ui/docshell/docsh5.cxx1021
-rw-r--r--sc/source/ui/docshell/docsh6.cxx535
-rw-r--r--sc/source/ui/docshell/docsh7.cxx47
-rw-r--r--sc/source/ui/docshell/docsh8.cxx1175
-rw-r--r--sc/source/ui/docshell/docshimp.hxx59
-rw-r--r--sc/source/ui/docshell/editable.cxx164
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2647
-rw-r--r--sc/source/ui/docshell/hiranges.cxx55
-rw-r--r--sc/source/ui/docshell/impex.cxx2104
-rw-r--r--sc/source/ui/docshell/macromgr.cxx216
-rw-r--r--sc/source/ui/docshell/olinefun.cxx799
-rw-r--r--sc/source/ui/docshell/pagedata.cxx141
-rw-r--r--sc/source/ui/docshell/pntlock.cxx63
-rw-r--r--sc/source/ui/docshell/servobj.cxx278
-rw-r--r--sc/source/ui/docshell/sizedev.cxx79
-rw-r--r--sc/source/ui/docshell/tablink.cxx620
-rw-r--r--sc/source/ui/docshell/tpstat.cxx103
-rw-r--r--sc/source/ui/docshell/tpstat.hrc36
-rw-r--r--sc/source/ui/docshell/tpstat.src79
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx82
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx482
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx397
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx117
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx751
-rw-r--r--sc/source/ui/drawfunc/drformsh.cxx83
-rw-r--r--sc/source/ui/drawfunc/drformsh.src215
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx1076
-rw-r--r--sc/source/ui/drawfunc/drtxtob1.cxx150
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx301
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx227
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx287
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx358
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx311
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx337
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx192
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx828
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx388
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx852
-rw-r--r--sc/source/ui/drawfunc/fumark.cxx292
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx388
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx655
-rw-r--r--sc/source/ui/drawfunc/fusel2.cxx187
-rw-r--r--sc/source/ui/drawfunc/futext.cxx813
-rw-r--r--sc/source/ui/drawfunc/futext2.cxx173
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx200
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx150
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx146
-rw-r--r--sc/source/ui/drawfunc/objdraw.src685
-rw-r--r--sc/source/ui/drawfunc/oleobjsh.cxx83
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx1141
-rw-r--r--sc/source/ui/formdlg/dwfunctr.hrc33
-rw-r--r--sc/source/ui/formdlg/dwfunctr.src127
-rw-r--r--sc/source/ui/formdlg/formdata.cxx63
-rw-r--r--sc/source/ui/formdlg/formdlgs.src30
-rw-r--r--sc/source/ui/formdlg/formula.cxx678
-rw-r--r--sc/source/ui/formdlg/privsplt.cxx424
-rw-r--r--sc/source/ui/inc/AccessibilityHints.hxx100
-rw-r--r--sc/source/ui/inc/AccessibleCell.hxx176
-rw-r--r--sc/source/ui/inc/AccessibleCellBase.hxx156
-rw-r--r--sc/source/ui/inc/AccessibleContextBase.hxx345
-rw-r--r--sc/source/ui/inc/AccessibleCsvControl.hxx668
-rw-r--r--sc/source/ui/inc/AccessibleDataPilotControl.hxx148
-rw-r--r--sc/source/ui/inc/AccessibleDocument.hxx331
-rw-r--r--sc/source/ui/inc/AccessibleDocumentBase.hxx50
-rw-r--r--sc/source/ui/inc/AccessibleDocumentPagePreview.hxx157
-rw-r--r--sc/source/ui/inc/AccessibleEditObject.hxx181
-rw-r--r--sc/source/ui/inc/AccessiblePageHeader.hxx114
-rw-r--r--sc/source/ui/inc/AccessiblePageHeaderArea.hxx138
-rw-r--r--sc/source/ui/inc/AccessiblePreviewCell.hxx123
-rw-r--r--sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx155
-rw-r--r--sc/source/ui/inc/AccessiblePreviewTable.hxx185
-rw-r--r--sc/source/ui/inc/AccessibleSpreadsheet.hxx288
-rw-r--r--sc/source/ui/inc/AccessibleTableBase.hxx301
-rw-r--r--sc/source/ui/inc/AccessibleText.hxx360
-rw-r--r--sc/source/ui/inc/ChartRangeSelectionListener.hxx82
-rw-r--r--sc/source/ui/inc/DrawModelBroadcaster.hxx62
-rw-r--r--sc/source/ui/inc/IAnyRefDialog.hxx61
-rw-r--r--sc/source/ui/inc/ScDevChart.hxx87
-rw-r--r--sc/source/ui/inc/acredlin.hrc71
-rw-r--r--sc/source/ui/inc/acredlin.hxx257
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx267
-rw-r--r--sc/source/ui/inc/areasave.hxx86
-rw-r--r--sc/source/ui/inc/areasdlg.hxx106
-rw-r--r--sc/source/ui/inc/asciiopt.hxx112
-rw-r--r--sc/source/ui/inc/attrdlg.hrc49
-rw-r--r--sc/source/ui/inc/attrdlg.hxx71
-rw-r--r--sc/source/ui/inc/auditsh.hxx61
-rw-r--r--sc/source/ui/inc/autofmt.hxx141
-rw-r--r--sc/source/ui/inc/autostyl.hxx75
-rw-r--r--sc/source/ui/inc/cbutton.hxx86
-rw-r--r--sc/source/ui/inc/cellmergeoption.hxx61
-rw-r--r--sc/source/ui/inc/cellsh.hxx117
-rw-r--r--sc/source/ui/inc/chartsh.hxx55
-rw-r--r--sc/source/ui/inc/client.hxx64
-rw-r--r--sc/source/ui/inc/colrowba.hxx112
-rw-r--r--sc/source/ui/inc/condfrmt.hrc78
-rw-r--r--sc/source/ui/inc/condfrmt.hxx154
-rw-r--r--sc/source/ui/inc/conflictsdlg.hrc43
-rw-r--r--sc/source/ui/inc/conflictsdlg.hxx215
-rw-r--r--sc/source/ui/inc/consdlg.hxx130
-rw-r--r--sc/source/ui/inc/content.hxx169
-rw-r--r--sc/source/ui/inc/corodlg.hxx77
-rw-r--r--sc/source/ui/inc/crdlg.hxx65
-rw-r--r--sc/source/ui/inc/crnrdlg.hrc45
-rw-r--r--sc/source/ui/inc/crnrdlg.hxx114
-rw-r--r--sc/source/ui/inc/csvcontrol.hxx434
-rw-r--r--sc/source/ui/inc/csvgrid.hxx363
-rw-r--r--sc/source/ui/inc/csvruler.hxx202
-rw-r--r--sc/source/ui/inc/csvsplits.hxx105
-rw-r--r--sc/source/ui/inc/csvtablebox.hxx159
-rw-r--r--sc/source/ui/inc/dapidata.hxx72
-rw-r--r--sc/source/ui/inc/dapitype.hxx103
-rw-r--r--sc/source/ui/inc/datafdlg.hrc42
-rw-r--r--sc/source/ui/inc/datafdlg.hxx102
-rw-r--r--sc/source/ui/inc/dbdocfun.hxx127
-rw-r--r--sc/source/ui/inc/dbfunc.hxx136
-rw-r--r--sc/source/ui/inc/dbnamdlg.hrc50
-rw-r--r--sc/source/ui/inc/dbnamdlg.hxx123
-rw-r--r--sc/source/ui/inc/delcldlg.hxx66
-rw-r--r--sc/source/ui/inc/delcodlg.hxx76
-rw-r--r--sc/source/ui/inc/docfunc.hxx212
-rw-r--r--sc/source/ui/inc/docsh.hxx479
-rw-r--r--sc/source/ui/inc/dpcontrol.hrc40
-rw-r--r--sc/source/ui/inc/dpcontrol.hxx366
-rw-r--r--sc/source/ui/inc/dpgroupdlg.hxx168
-rw-r--r--sc/source/ui/inc/drawsh.hxx94
-rw-r--r--sc/source/ui/inc/drawutil.hxx53
-rw-r--r--sc/source/ui/inc/drawview.hxx147
-rw-r--r--sc/source/ui/inc/drformsh.hxx58
-rw-r--r--sc/source/ui/inc/drtxtob.hxx88
-rw-r--r--sc/source/ui/inc/drwtrans.hxx115
-rw-r--r--sc/source/ui/inc/dwfunctr.hxx149
-rw-r--r--sc/source/ui/inc/editable.hxx88
-rw-r--r--sc/source/ui/inc/editfield.hxx52
-rw-r--r--sc/source/ui/inc/editsh.hxx88
-rw-r--r--sc/source/ui/inc/expftext.hxx48
-rw-r--r--sc/source/ui/inc/fieldwnd.hxx394
-rw-r--r--sc/source/ui/inc/filldlg.hxx133
-rw-r--r--sc/source/ui/inc/filtdlg.hxx263
-rw-r--r--sc/source/ui/inc/filter.hrc88
-rw-r--r--sc/source/ui/inc/foptmgr.hxx116
-rw-r--r--sc/source/ui/inc/formatsh.hxx85
-rw-r--r--sc/source/ui/inc/formdata.hxx68
-rw-r--r--sc/source/ui/inc/formula.hxx138
-rw-r--r--sc/source/ui/inc/fuconarc.hxx64
-rw-r--r--sc/source/ui/inc/fuconcustomshape.hxx63
-rw-r--r--sc/source/ui/inc/fuconpol.hxx65
-rw-r--r--sc/source/ui/inc/fuconrec.hxx64
-rw-r--r--sc/source/ui/inc/fuconstr.hxx70
-rw-r--r--sc/source/ui/inc/fuconuno.hxx69
-rw-r--r--sc/source/ui/inc/fudraw.hxx80
-rw-r--r--sc/source/ui/inc/fuedipo.hxx62
-rw-r--r--sc/source/ui/inc/fuinsert.hxx87
-rw-r--r--sc/source/ui/inc/fumark.hxx76
-rw-r--r--sc/source/ui/inc/funcpage.hxx128
-rw-r--r--sc/source/ui/inc/funcutl.hxx197
-rw-r--r--sc/source/ui/inc/fupoor.hxx138
-rw-r--r--sc/source/ui/inc/fusel.hxx80
-rw-r--r--sc/source/ui/inc/futext.hxx83
-rw-r--r--sc/source/ui/inc/graphsh.hxx60
-rw-r--r--sc/source/ui/inc/gridmerg.hxx66
-rw-r--r--sc/source/ui/inc/gridwin.hxx419
-rw-r--r--sc/source/ui/inc/groupdlg.hxx63
-rw-r--r--sc/source/ui/inc/hdrcont.hxx141
-rw-r--r--sc/source/ui/inc/hfedtdlg.hxx59
-rw-r--r--sc/source/ui/inc/highred.hrc60
-rw-r--r--sc/source/ui/inc/highred.hxx116
-rw-r--r--sc/source/ui/inc/hintwin.hxx56
-rw-r--r--sc/source/ui/inc/hiranges.hxx66
-rw-r--r--sc/source/ui/inc/imoptdlg.hxx114
-rw-r--r--sc/source/ui/inc/impex.hxx195
-rw-r--r--sc/source/ui/inc/inputhdl.hxx304
-rw-r--r--sc/source/ui/inc/inputwin.hxx228
-rw-r--r--sc/source/ui/inc/inscldlg.hxx64
-rw-r--r--sc/source/ui/inc/inscodlg.hxx118
-rw-r--r--sc/source/ui/inc/instbdlg.hrc48
-rw-r--r--sc/source/ui/inc/instbdlg.hxx126
-rw-r--r--sc/source/ui/inc/invmerge.hxx63
-rw-r--r--sc/source/ui/inc/lbseldlg.hxx69
-rw-r--r--sc/source/ui/inc/linkarea.hrc41
-rw-r--r--sc/source/ui/inc/linkarea.hxx101
-rw-r--r--sc/source/ui/inc/lnktrans.hxx55
-rw-r--r--sc/source/ui/inc/mediash.hxx57
-rw-r--r--sc/source/ui/inc/miscdlgs.hrc183
-rw-r--r--sc/source/ui/inc/msgpool.hxx79
-rw-r--r--sc/source/ui/inc/mtrindlg.hxx78
-rw-r--r--sc/source/ui/inc/mvtabdlg.hxx109
-rw-r--r--sc/source/ui/inc/namecrea.hxx57
-rw-r--r--sc/source/ui/inc/namedlg.hrc54
-rw-r--r--sc/source/ui/inc/namedlg.hxx137
-rw-r--r--sc/source/ui/inc/namepast.hxx62
-rw-r--r--sc/source/ui/inc/navcitem.hxx57
-rw-r--r--sc/source/ui/inc/navipi.hxx367
-rw-r--r--sc/source/ui/inc/navsett.hxx61
-rw-r--r--sc/source/ui/inc/notemark.hxx80
-rw-r--r--sc/source/ui/inc/oleobjsh.hxx55
-rw-r--r--sc/source/ui/inc/olinefun.hxx70
-rw-r--r--sc/source/ui/inc/olinewin.hxx246
-rw-r--r--sc/source/ui/inc/opredlin.hrc38
-rw-r--r--sc/source/ui/inc/opredlin.hxx78
-rw-r--r--sc/source/ui/inc/optdlg.hrc196
-rw-r--r--sc/source/ui/inc/optload.hrc38
-rw-r--r--sc/source/ui/inc/optload.hxx68
-rw-r--r--sc/source/ui/inc/optsolver.hrc95
-rw-r--r--sc/source/ui/inc/optsolver.hxx266
-rw-r--r--sc/source/ui/inc/output.hxx345
-rw-r--r--sc/source/ui/inc/overlayobject.hxx58
-rw-r--r--sc/source/ui/inc/pagedata.hxx97
-rw-r--r--sc/source/ui/inc/parawin.hxx171
-rw-r--r--sc/source/ui/inc/pfiltdlg.hxx131
-rw-r--r--sc/source/ui/inc/pfuncache.hxx127
-rw-r--r--sc/source/ui/inc/pgbrksh.hxx55
-rw-r--r--sc/source/ui/inc/pivotsh.hxx63
-rw-r--r--sc/source/ui/inc/pntlock.hxx69
-rw-r--r--sc/source/ui/inc/popmenu.hxx53
-rw-r--r--sc/source/ui/inc/preview.hxx173
-rw-r--r--sc/source/ui/inc/prevloc.hxx161
-rw-r--r--sc/source/ui/inc/prevwsh.hxx136
-rw-r--r--sc/source/ui/inc/printfun.hxx368
-rw-r--r--sc/source/ui/inc/privsplt.hxx89
-rw-r--r--sc/source/ui/inc/protectiondlg.hrc44
-rw-r--r--sc/source/ui/inc/protectiondlg.hxx85
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx254
-rw-r--r--sc/source/ui/inc/pvlaydlg.hxx255
-rw-r--r--sc/source/ui/inc/redcom.hxx68
-rw-r--r--sc/source/ui/inc/reffact.hxx123
-rw-r--r--sc/source/ui/inc/refundo.hxx71
-rw-r--r--sc/source/ui/inc/retypepassdlg.hrc71
-rw-r--r--sc/source/ui/inc/retypepassdlg.hxx177
-rw-r--r--sc/source/ui/inc/rfindlst.hxx77
-rw-r--r--sc/source/ui/inc/scendlg.hxx82
-rw-r--r--sc/source/ui/inc/scui_def.hxx59
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx149
-rw-r--r--sc/source/ui/inc/scuiautofmt.hxx90
-rw-r--r--sc/source/ui/inc/scuiimoptdlg.hxx81
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx167
-rw-r--r--sc/source/ui/inc/select.hxx131
-rw-r--r--sc/source/ui/inc/selectionstate.hxx81
-rw-r--r--sc/source/ui/inc/seltrans.hxx83
-rw-r--r--sc/source/ui/inc/servobj.hxx79
-rw-r--r--sc/source/ui/inc/sharedocdlg.hrc44
-rw-r--r--sc/source/ui/inc/sharedocdlg.hxx79
-rw-r--r--sc/source/ui/inc/shtabdlg.hxx71
-rw-r--r--sc/source/ui/inc/simpref.hrc36
-rw-r--r--sc/source/ui/inc/simpref.hxx116
-rw-r--r--sc/source/ui/inc/sizedev.hxx57
-rw-r--r--sc/source/ui/inc/solveroptions.hrc46
-rw-r--r--sc/source/ui/inc/solveroptions.hxx123
-rw-r--r--sc/source/ui/inc/solverutil.hxx52
-rw-r--r--sc/source/ui/inc/solvrdlg.hrc45
-rw-r--r--sc/source/ui/inc/solvrdlg.hxx111
-rw-r--r--sc/source/ui/inc/sortdlg.hrc78
-rw-r--r--sc/source/ui/inc/sortdlg.hxx90
-rw-r--r--sc/source/ui/inc/spelldialog.hxx105
-rw-r--r--sc/source/ui/inc/spelleng.hxx171
-rw-r--r--sc/source/ui/inc/spellparam.hxx89
-rw-r--r--sc/source/ui/inc/strindlg.hxx68
-rw-r--r--sc/source/ui/inc/styledlg.hrc39
-rw-r--r--sc/source/ui/inc/styledlg.hxx58
-rw-r--r--sc/source/ui/inc/submenu.hrc68
-rw-r--r--sc/source/ui/inc/subtdlg.hrc56
-rw-r--r--sc/source/ui/inc/subtdlg.hxx52
-rw-r--r--sc/source/ui/inc/tabbgcolordlg.hxx79
-rw-r--r--sc/source/ui/inc/tabcont.hxx91
-rw-r--r--sc/source/ui/inc/tabopdlg.hrc48
-rw-r--r--sc/source/ui/inc/tabopdlg.hxx116
-rw-r--r--sc/source/ui/inc/tabpages.hxx84
-rw-r--r--sc/source/ui/inc/tabpopsh.hxx55
-rw-r--r--sc/source/ui/inc/tabsplit.hxx62
-rw-r--r--sc/source/ui/inc/tabview.hxx522
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx426
-rw-r--r--sc/source/ui/inc/target.hxx54
-rw-r--r--sc/source/ui/inc/tbinsert.hrc30
-rw-r--r--sc/source/ui/inc/tbinsert.hxx56
-rw-r--r--sc/source/ui/inc/tbzoomsliderctrl.hxx80
-rw-r--r--sc/source/ui/inc/textdlgs.hxx74
-rw-r--r--sc/source/ui/inc/textimportoptions.hrc39
-rw-r--r--sc/source/ui/inc/textimportoptions.hxx76
-rw-r--r--sc/source/ui/inc/tpcalc.hxx103
-rw-r--r--sc/source/ui/inc/tpcompatibility.hxx66
-rw-r--r--sc/source/ui/inc/tpformula.hxx99
-rw-r--r--sc/source/ui/inc/tphf.hxx103
-rw-r--r--sc/source/ui/inc/tphfedit.hxx140
-rw-r--r--sc/source/ui/inc/tpprint.hxx58
-rw-r--r--sc/source/ui/inc/tpsort.hxx224
-rw-r--r--sc/source/ui/inc/tpstat.hxx68
-rw-r--r--sc/source/ui/inc/tpsubt.hxx191
-rw-r--r--sc/source/ui/inc/tptable.hxx116
-rw-r--r--sc/source/ui/inc/tpusrlst.hxx119
-rw-r--r--sc/source/ui/inc/tpview.hxx173
-rw-r--r--sc/source/ui/inc/transobj.hxx118
-rw-r--r--sc/source/ui/inc/ui_pch.hxx327
-rw-r--r--sc/source/ui/inc/uiitems.hxx374
-rw-r--r--sc/source/ui/inc/undobase.hxx179
-rw-r--r--sc/source/ui/inc/undoblk.hxx997
-rw-r--r--sc/source/ui/inc/undocell.hxx377
-rw-r--r--sc/source/ui/inc/undodat.hxx541
-rw-r--r--sc/source/ui/inc/undodraw.hxx65
-rw-r--r--sc/source/ui/inc/undoolk.hxx47
-rw-r--r--sc/source/ui/inc/undostyl.hxx119
-rw-r--r--sc/source/ui/inc/undotab.hxx527
-rw-r--r--sc/source/ui/inc/undoutil.hxx69
-rw-r--r--sc/source/ui/inc/validate.hrc85
-rw-r--r--sc/source/ui/inc/validate.hxx324
-rw-r--r--sc/source/ui/inc/viewdata.hxx568
-rw-r--r--sc/source/ui/inc/viewfunc.hxx378
-rw-r--r--sc/source/ui/inc/viewutil.hxx114
-rw-r--r--sc/source/ui/inc/warnbox.hxx76
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2007
-rw-r--r--sc/source/ui/miscdlgs/acredlin.src221
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx956
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx566
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx842
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.src112
-rw-r--r--sc/source/ui/miscdlgs/crdlg.cxx89
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx1173
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx416
-rw-r--r--sc/source/ui/miscdlgs/delcldlg.cxx122
-rw-r--r--sc/source/ui/miscdlgs/delcodlg.cxx182
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx381
-rw-r--r--sc/source/ui/miscdlgs/groupdlg.cxx85
-rw-r--r--sc/source/ui/miscdlgs/highred.cxx289
-rw-r--r--sc/source/ui/miscdlgs/highred.src107
-rw-r--r--sc/source/ui/miscdlgs/inscldlg.cxx122
-rw-r--r--sc/source/ui/miscdlgs/inscodlg.cxx374
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx436
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.src156
-rw-r--r--sc/source/ui/miscdlgs/lbseldlg.cxx103
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx370
-rw-r--r--sc/source/ui/miscdlgs/linkarea.src126
-rw-r--r--sc/source/ui/miscdlgs/mtrindlg.cxx188
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx377
-rw-r--r--sc/source/ui/miscdlgs/namecrea.cxx81
-rw-r--r--sc/source/ui/miscdlgs/namepast.cxx124
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx1079
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.cxx165
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.src131
-rw-r--r--sc/source/ui/miscdlgs/redcom.cxx187
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx547
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.src322
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx479
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx238
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.src111
-rw-r--r--sc/source/ui/miscdlgs/shtabdlg.cxx113
-rw-r--r--sc/source/ui/miscdlgs/simpref.cxx259
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx494
-rw-r--r--sc/source/ui/miscdlgs/solverutil.cxx228
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx318
-rw-r--r--sc/source/ui/miscdlgs/strindlg.cxx91
-rw-r--r--sc/source/ui/miscdlgs/tabbgcolordlg.cxx196
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx373
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx132
-rw-r--r--sc/source/ui/miscdlgs/warnbox.cxx96
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx642
-rw-r--r--sc/source/ui/navipi/content.cxx1490
-rw-r--r--sc/source/ui/navipi/navcitem.cxx125
-rw-r--r--sc/source/ui/navipi/navipi.cxx1483
-rw-r--r--sc/source/ui/navipi/navipi.hrc55
-rw-r--r--sc/source/ui/navipi/navipi.src343
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx311
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx227
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx306
-rw-r--r--sc/source/ui/optdlg/tpcompatibility.cxx108
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx290
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx146
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx808
-rw-r--r--sc/source/ui/optdlg/tpview.cxx684
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx908
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.cxx187
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.hrc54
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.src777
-rw-r--r--sc/source/ui/pagedlg/pagedlg.hrc100
-rw-r--r--sc/source/ui/pagedlg/pagedlg.src409
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx994
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx334
-rw-r--r--sc/source/ui/pagedlg/tphf.src37
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx441
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx570
-rw-r--r--sc/source/ui/src/attrdlg.src168
-rw-r--r--sc/source/ui/src/autofmt.src228
-rw-r--r--sc/source/ui/src/condfrmt.src407
-rw-r--r--sc/source/ui/src/crnrdlg.src143
-rw-r--r--sc/source/ui/src/datafdlg.src99
-rw-r--r--sc/source/ui/src/dbnamdlg.src187
-rw-r--r--sc/source/ui/src/filter.src894
-rw-r--r--sc/source/ui/src/globstr.src1827
-rw-r--r--sc/source/ui/src/hdrcont.src200
-rw-r--r--sc/source/ui/src/miscdlgs.src1508
-rw-r--r--sc/source/ui/src/namedlg.src195
-rw-r--r--sc/source/ui/src/opredlin.src103
-rw-r--r--sc/source/ui/src/optdlg.src910
-rw-r--r--sc/source/ui/src/optsolver.src573
-rw-r--r--sc/source/ui/src/popup.src544
-rw-r--r--sc/source/ui/src/pseudo.src28
-rw-r--r--sc/source/ui/src/sc.src44
-rw-r--r--sc/source/ui/src/scerrors.src169
-rw-r--r--sc/source/ui/src/scfuncs.src9044
-rw-r--r--sc/source/ui/src/scstring.src856
-rw-r--r--sc/source/ui/src/scwarngs.src43
-rw-r--r--sc/source/ui/src/simpref.src79
-rw-r--r--sc/source/ui/src/solveroptions.src191
-rw-r--r--sc/source/ui/src/solvrdlg.src139
-rw-r--r--sc/source/ui/src/sortdlg.src380
-rw-r--r--sc/source/ui/src/subtdlg.src245
-rw-r--r--sc/source/ui/src/tabopdlg.src149
-rw-r--r--sc/source/ui/src/textdlgs.src155
-rw-r--r--sc/source/ui/src/toolbox.src154
-rw-r--r--sc/source/ui/styleui/scstyles.src68
-rw-r--r--sc/source/ui/styleui/styledlg.cxx219
-rw-r--r--sc/source/ui/styleui/styledlg.src137
-rw-r--r--sc/source/ui/styleui/template.curbin0 -> 326 bytes
-rw-r--r--sc/source/ui/undo/areasave.cxx231
-rw-r--r--sc/source/ui/undo/refundo.cxx216
-rw-r--r--sc/source/ui/undo/target.cxx48
-rw-r--r--sc/source/ui/undo/undobase.cxx532
-rw-r--r--sc/source/ui/undo/undoblk.cxx2267
-rw-r--r--sc/source/ui/undo/undoblk2.cxx208
-rw-r--r--sc/source/ui/undo/undoblk3.cxx2136
-rw-r--r--sc/source/ui/undo/undocell.cxx1147
-rw-r--r--sc/source/ui/undo/undodat.cxx2235
-rw-r--r--sc/source/ui/undo/undodraw.cxx198
-rw-r--r--sc/source/ui/undo/undoolk.cxx104
-rw-r--r--sc/source/ui/undo/undorangename.cxx117
-rw-r--r--sc/source/ui/undo/undostyl.cxx312
-rw-r--r--sc/source/ui/undo/undotab.cxx1680
-rw-r--r--sc/source/ui/undo/undoutil.cxx137
-rw-r--r--sc/source/ui/unoobj/ChartRangeSelectionListener.cxx88
-rw-r--r--sc/source/ui/unoobj/addruno.cxx330
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx884
-rw-r--r--sc/source/ui/unoobj/appluno.cxx960
-rw-r--r--sc/source/ui/unoobj/celllistsource.cxx451
-rw-r--r--sc/source/ui/unoobj/celllistsource.hxx178
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx9833
-rw-r--r--sc/source/ui/unoobj/cellvaluebinding.cxx665
-rw-r--r--sc/source/ui/unoobj/cellvaluebinding.hxx174
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx3614
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx809
-rw-r--r--sc/source/ui/unoobj/confuno.cxx487
-rw-r--r--sc/source/ui/unoobj/convuno.cxx66
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx512
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx3563
-rw-r--r--sc/source/ui/unoobj/datauno.cxx2463
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx389
-rw-r--r--sc/source/ui/unoobj/detreg.cxx92
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx417
-rw-r--r--sc/source/ui/unoobj/docuno.cxx3734
-rw-r--r--sc/source/ui/unoobj/drdefuno.cxx85
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx373
-rw-r--r--sc/source/ui/unoobj/eventuno.cxx200
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx1514
-rw-r--r--sc/source/ui/unoobj/filtuno.cxx314
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx1091
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx95
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx743
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx1819
-rw-r--r--sc/source/ui/unoobj/listenercalls.cxx91
-rw-r--r--sc/source/ui/unoobj/miscuno.cxx318
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx1167
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx735
-rw-r--r--sc/source/ui/unoobj/optuno.cxx235
-rw-r--r--sc/source/ui/unoobj/pageuno.cxx81
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx897
-rw-r--r--sc/source/ui/unoobj/scdetect.hxx98
-rw-r--r--sc/source/ui/unoobj/servuno.cxx622
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx1513
-rw-r--r--sc/source/ui/unoobj/srchuno.cxx278
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx2132
-rw-r--r--sc/source/ui/unoobj/targuno.cxx315
-rw-r--r--sc/source/ui/unoobj/textuno.cxx1139
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx475
-rw-r--r--sc/source/ui/unoobj/unodoc.cxx69
-rw-r--r--sc/source/ui/unoobj/unoreflist.cxx75
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx2390
-rw-r--r--sc/source/ui/unoobj/warnpassword.cxx97
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx557
-rw-r--r--sc/source/ui/vba/excelvbahelper.hxx113
-rw-r--r--sc/source/ui/vba/helperdecl.hxx55
-rw-r--r--sc/source/ui/vba/service.cxx102
-rw-r--r--sc/source/ui/vba/testvba/README37
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/ApplicationRunTest.xlsbin0 -> 25088 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/AutoFilter.xlsbin0 -> 54272 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcFont.xlsbin0 -> 73728 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcZoom.xlsbin0 -> 62976 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncTests.xlsbin0 -> 71168 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncs.xlsbin0 -> 47104 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscOperatorTests.xlsbin0 -> 66048 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscRangeTests.xlsbin0 -> 126976 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/PageBreaks.xlsbin0 -> 63488 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-2.xlsbin0 -> 2209280 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-3.xlsbin0 -> 54784 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges.xlsbin0 -> 2236416 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/Shapes.xlsbin0 -> 74240 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/StrConv-test.xlsbin0 -> 65024 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/Template.xlsbin0 -> 65024 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestAddress.xlsbin0 -> 84480 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest.xlsbin0 -> 67584 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest2.xlsbin0 -> 71680 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestIntersection.xlsbin0 -> 81408 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestUnion.xlsbin0 -> 72192 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/VariantTest.xlsbin0 -> 68608 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/Window.xlsbin0 -> 87040 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/bytearraystring.xlsbin0 -> 58880 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/dateserial.xlsbin0 -> 57344 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/datevalue.xlsbin0 -> 61952 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/format.xlsbin0 -> 102400 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/AutoFilter.log20
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/MiscRangeTests.log45
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-2.log68
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-3.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges.log280
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestAddress.log62
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest.log60
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest2.log64
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/format.log36
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/AutoFilter.log20
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcFont.log17
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcZoom.log18
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/FinancialFuncTests.log31
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscOperatorTests.log30
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscRangeTests.log45
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/PageBreaks.log10
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-2.log68
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-3.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges.log280
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Shapes.log77
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/StrConv-test.log9
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Template.log14
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestAddress.log67
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest.log60
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest2.log65
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestIntersection.log26
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestUnion.log17
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/VariantTest.log47
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Window.log46
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/bytearraystring.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/dateserial.log9
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/datevalue.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/format.log36
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/pagesetup.log77
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/partition.log11
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/range-4.log16
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/replace.log14
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/stringplusdouble.log62
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/window2.log41
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/AutoFilter.log20
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/CalcFont.log17
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscOperatorTests.log29
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscRangeTests.log45
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/PageBreaks.log10
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-2.log68
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-3.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges.log280
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Shapes.log77
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/StrConv-test.log9
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Template.log14
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestAddress.log67
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest.log60
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest2.log65
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestIntersection.log26
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestUnion.log17
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/VariantTest.log47
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Window.log46
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/bytearraystring.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/dateserial.log9
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/datevalue.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/format.log36
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/pagesetup.log87
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/partition.log11
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/range-4.log16
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/replace.log14
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/stringplusdouble.log62
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/window2.log41
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/error.xlsbin0 -> 38400 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/imagecontrols.xlsbin0 -> 2415104 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/keyword.xlsbin0 -> 50688 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/objectmodule.xlsbin0 -> 62464 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/stringtodouble.odsbin0 -> 13260 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/partition.xlsbin0 -> 65536 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/range-4.xlsbin0 -> 2192384 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/replace.xlsbin0 -> 64512 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/stringplusdouble.xlsbin0 -> 75264 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments-ooo-build/window2.xlsbin0 -> 72192 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/ApplicationRunTest.xlsbin0 -> 25088 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/AutoFilter.xlsbin0 -> 54272 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/CalcFont.xlsbin0 -> 73728 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/FinancialFuncs.xlsbin0 -> 47104 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/MiscRangeTests.xlsbin0 -> 126976 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/PageBreaks.xlsbin0 -> 63488 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/Ranges-2.xlsbin0 -> 2209280 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/Ranges-3.xlsbin0 -> 54784 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/Ranges.xlsbin0 -> 2236416 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/Shapes.xlsbin0 -> 74240 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/StrConv-test.xlsbin0 -> 65024 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/Template.xlsbin0 -> 65024 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/TestAddress.xlsbin0 -> 84480 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest.xlsbin0 -> 67584 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/TestCalc_Rangetest2.xlsbin0 -> 71680 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/TestIntersection.xlsbin0 -> 81408 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/TestUnion.xlsbin0 -> 72192 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/Window.xlsbin0 -> 87040 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/bytearraystring.xlsbin0 -> 58880 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/dateserial.xlsbin0 -> 57344 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/datevalue.xlsbin0 -> 61952 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/format.xlsbin0 -> 102400 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/AutoFilter.log20
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/MiscRangeTests.log45
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-2.log68
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges-3.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/Ranges.log280
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestAddress.log62
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest.log60
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/excel/TestCalc_Rangetest2.log64
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/AutoFilter.log20
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/CalcFont.log17
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/MiscRangeTests.log45
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/PageBreaks.log10
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-2.log68
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges-3.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log280
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/Shapes.log77
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/StrConv-test.log9
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/Template.log14
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log67
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest.log60
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestCalc_Rangetest2.log65
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestIntersection.log26
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestUnion.log17
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/Window.log46
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/bytearraystring.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/dateserial.log9
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/datevalue.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log36
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/pagesetup.log77
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/partition.log11
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/range-4.log16
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log14
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/stringplusdouble.log62
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log41
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/AutoFilter.log20
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/MiscRangeTests.log45
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-2.log68
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges-3.log8
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/Ranges.log280
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/Shapes.log77
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/TestAddress.log62
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest.log60
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/TestCalc_Rangetest2.log65
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/pagesetup.log87
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/logs/win/replace.log14
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/pagesetup.xlsbin0 -> 72704 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/partition.xlsbin0 -> 65536 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/range-4.xlsbin0 -> 2192384 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/replace.xlsbin0 -> 64512 bytes
-rw-r--r--sc/source/ui/vba/testvba/TestDocuments/stringplusdouble.xlsbin0 -> 75264 bytes
-rwxr-xr-xsc/source/ui/vba/testvba/TestDocuments/window2.xlsbin0 -> 72192 bytes
-rw-r--r--sc/source/ui/vba/testvba/launchTest.pl45
-rwxr-xr-xsc/source/ui/vba/testvba/runTests.pl121
-rw-r--r--sc/source/ui/vba/testvba/testResult.pl171
-rwxr-xr-xsc/source/ui/vba/testvba/testResults.pl163
-rwxr-xr-xsc/source/ui/vba/testvba/testclientbin0 -> 50595 bytes
-rw-r--r--sc/source/ui/vba/testvba/testvba.cxx304
-rwxr-xr-xsc/source/ui/vba/testvba/timestampsClean.pl73
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx1836
-rw-r--r--sc/source/ui/vba/vbaapplication.hxx149
-rw-r--r--sc/source/ui/vba/vbaassistant.cxx135
-rw-r--r--sc/source/ui/vba/vbaassistant.hxx73
-rw-r--r--sc/source/ui/vba/vbaaxes.cxx205
-rw-r--r--sc/source/ui/vba/vbaaxes.hxx54
-rw-r--r--sc/source/ui/vba/vbaaxis.cxx669
-rw-r--r--sc/source/ui/vba/vbaaxis.hxx101
-rw-r--r--sc/source/ui/vba/vbaaxistitle.cxx60
-rw-r--r--sc/source/ui/vba/vbaaxistitle.hxx47
-rw-r--r--sc/source/ui/vba/vbaborders.cxx577
-rw-r--r--sc/source/ui/vba/vbaborders.hxx78
-rw-r--r--sc/source/ui/vba/vbacharacters.cxx138
-rw-r--r--sc/source/ui/vba/vbacharacters.hxx77
-rw-r--r--sc/source/ui/vba/vbachart.cxx1129
-rw-r--r--sc/source/ui/vba/vbachart.hxx107
-rw-r--r--sc/source/ui/vba/vbachartobject.cxx159
-rw-r--r--sc/source/ui/vba/vbachartobject.hxx71
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx196
-rw-r--r--sc/source/ui/vba/vbachartobjects.hxx78
-rw-r--r--sc/source/ui/vba/vbacharttitle.cxx60
-rw-r--r--sc/source/ui/vba/vbacharttitle.hxx47
-rw-r--r--sc/source/ui/vba/vbacomment.cxx252
-rw-r--r--sc/source/ui/vba/vbacomment.hxx83
-rw-r--r--sc/source/ui/vba/vbacomments.cxx119
-rw-r--r--sc/source/ui/vba/vbacomments.hxx67
-rw-r--r--sc/source/ui/vba/vbacommentshape.cxx49
-rw-r--r--sc/source/ui/vba/vbacommentshape.hxx49
-rw-r--r--sc/source/ui/vba/vbacondition.cxx177
-rw-r--r--sc/source/ui/vba/vbacondition.hxx57
-rw-r--r--sc/source/ui/vba/vbadialog.cxx111
-rw-r--r--sc/source/ui/vba/vbadialog.hxx55
-rw-r--r--sc/source/ui/vba/vbadialogs.cxx77
-rw-r--r--sc/source/ui/vba/vbadialogs.hxx59
-rw-r--r--sc/source/ui/vba/vbaeventshelper.cxx791
-rw-r--r--sc/source/ui/vba/vbaeventshelper.hxx84
-rw-r--r--sc/source/ui/vba/vbafiledialog.cxx186
-rw-r--r--sc/source/ui/vba/vbafiledialog.hxx63
-rw-r--r--sc/source/ui/vba/vbafiledialogselecteditems.cxx157
-rw-r--r--sc/source/ui/vba/vbafiledialogselecteditems.hxx90
-rw-r--r--sc/source/ui/vba/vbafilesearch.cxx245
-rw-r--r--sc/source/ui/vba/vbafilesearch.hxx80
-rw-r--r--sc/source/ui/vba/vbafont.cxx504
-rw-r--r--sc/source/ui/vba/vbafont.hxx92
-rw-r--r--sc/source/ui/vba/vbaformat.cxx845
-rw-r--r--sc/source/ui/vba/vbaformat.hxx111
-rw-r--r--sc/source/ui/vba/vbaformatcondition.cxx179
-rw-r--r--sc/source/ui/vba/vbaformatcondition.hxx73
-rw-r--r--sc/source/ui/vba/vbaformatconditions.cxx291
-rw-r--r--sc/source/ui/vba/vbaformatconditions.hxx67
-rw-r--r--sc/source/ui/vba/vbafoundfiles.cxx146
-rw-r--r--sc/source/ui/vba/vbafoundfiles.hxx91
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx313
-rw-r--r--sc/source/ui/vba/vbaglobals.hxx99
-rw-r--r--sc/source/ui/vba/vbahelper.cxx761
-rw-r--r--sc/source/ui/vba/vbahyperlink.cxx249
-rw-r--r--sc/source/ui/vba/vbahyperlink.hxx90
-rw-r--r--sc/source/ui/vba/vbahyperlinks.cxx296
-rw-r--r--sc/source/ui/vba/vbahyperlinks.hxx153
-rw-r--r--sc/source/ui/vba/vbainterior.cxx416
-rw-r--r--sc/source/ui/vba/vbainterior.hxx90
-rw-r--r--sc/source/ui/vba/vbamenu.cxx87
-rw-r--r--sc/source/ui/vba/vbamenu.hxx57
-rw-r--r--sc/source/ui/vba/vbamenubar.cxx69
-rw-r--r--sc/source/ui/vba/vbamenubar.hxx53
-rw-r--r--sc/source/ui/vba/vbamenubars.cxx140
-rw-r--r--sc/source/ui/vba/vbamenubars.hxx64
-rw-r--r--sc/source/ui/vba/vbamenuitem.cxx85
-rw-r--r--sc/source/ui/vba/vbamenuitem.hxx58
-rw-r--r--sc/source/ui/vba/vbamenuitems.cxx153
-rw-r--r--sc/source/ui/vba/vbamenuitems.hxx63
-rw-r--r--sc/source/ui/vba/vbamenus.cxx139
-rw-r--r--sc/source/ui/vba/vbamenus.hxx63
-rw-r--r--sc/source/ui/vba/vbaname.cxx232
-rw-r--r--sc/source/ui/vba/vbaname.hxx90
-rw-r--r--sc/source/ui/vba/vbanames.cxx262
-rw-r--r--sc/source/ui/vba/vbanames.hxx84
-rw-r--r--sc/source/ui/vba/vbaoleobject.cxx155
-rw-r--r--sc/source/ui/vba/vbaoleobject.hxx69
-rw-r--r--sc/source/ui/vba/vbaoleobjects.cxx188
-rw-r--r--sc/source/ui/vba/vbaoleobjects.hxx59
-rw-r--r--sc/source/ui/vba/vbaoutline.cxx68
-rw-r--r--sc/source/ui/vba/vbaoutline.hxx55
-rw-r--r--sc/source/ui/vba/vbapagebreak.cxx174
-rw-r--r--sc/source/ui/vba/vbapagebreak.hxx106
-rw-r--r--sc/source/ui/vba/vbapagebreaks.cxx321
-rw-r--r--sc/source/ui/vba/vbapagebreaks.hxx100
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx732
-rw-r--r--sc/source/ui/vba/vbapagesetup.hxx95
-rw-r--r--sc/source/ui/vba/vbapalette.cxx116
-rw-r--r--sc/source/ui/vba/vbapalette.hxx56
-rw-r--r--sc/source/ui/vba/vbapane.cxx209
-rw-r--r--sc/source/ui/vba/vbapane.hxx70
-rw-r--r--sc/source/ui/vba/vbapivotcache.cxx73
-rw-r--r--sc/source/ui/vba/vbapivotcache.hxx56
-rw-r--r--sc/source/ui/vba/vbapivottable.cxx66
-rw-r--r--sc/source/ui/vba/vbapivottable.hxx52
-rw-r--r--sc/source/ui/vba/vbapivottables.cxx97
-rw-r--r--sc/source/ui/vba/vbapivottables.hxx68
-rw-r--r--sc/source/ui/vba/vbapropvalue.cxx48
-rw-r--r--sc/source/ui/vba/vbapropvalue.hxx60
-rw-r--r--sc/source/ui/vba/vbaquerytable.cxx90
-rw-r--r--sc/source/ui/vba/vbaquerytable.hxx62
-rw-r--r--sc/source/ui/vba/vbarange.cxx6289
-rw-r--r--sc/source/ui/vba/vbarange.hxx324
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx551
-rw-r--r--sc/source/ui/vba/vbasheetobject.hxx223
-rw-r--r--sc/source/ui/vba/vbasheetobjects.cxx537
-rw-r--r--sc/source/ui/vba/vbasheetobjects.hxx116
-rw-r--r--sc/source/ui/vba/vbastyle.cxx189
-rw-r--r--sc/source/ui/vba/vbastyle.hxx69
-rw-r--r--sc/source/ui/vba/vbastyles.cxx185
-rw-r--r--sc/source/ui/vba/vbastyles.hxx60
-rw-r--r--sc/source/ui/vba/vbatextboxshape.cxx69
-rw-r--r--sc/source/ui/vba/vbatextboxshape.hxx53
-rw-r--r--sc/source/ui/vba/vbatextframe.cxx81
-rw-r--r--sc/source/ui/vba/vbatextframe.hxx52
-rw-r--r--sc/source/ui/vba/vbatitle.hxx166
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx346
-rw-r--r--sc/source/ui/vba/vbavalidation.hxx74
-rw-r--r--sc/source/ui/vba/vbawindow.cxx848
-rw-r--r--sc/source/ui/vba/vbawindow.hxx126
-rw-r--r--sc/source/ui/vba/vbawindows.cxx257
-rw-r--r--sc/source/ui/vba/vbawindows.hxx66
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx460
-rw-r--r--sc/source/ui/vba/vbaworkbook.hxx94
-rw-r--r--sc/source/ui/vba/vbaworkbooks.cxx332
-rw-r--r--sc/source/ui/vba/vbaworkbooks.hxx71
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx1191
-rw-r--r--sc/source/ui/vba/vbaworksheet.hxx181
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx540
-rw-r--r--sc/source/ui/vba/vbaworksheets.hxx87
-rw-r--r--sc/source/ui/vba/vbawsfunction.cxx322
-rw-r--r--sc/source/ui/vba/vbawsfunction.hxx59
-rw-r--r--sc/source/ui/view/auditsh.cxx157
-rw-r--r--sc/source/ui/view/cellmergeoption.cxx90
-rw-r--r--sc/source/ui/view/cellsh.cxx985
-rw-r--r--sc/source/ui/view/cellsh1.cxx2485
-rw-r--r--sc/source/ui/view/cellsh2.cxx1192
-rw-r--r--sc/source/ui/view/cellsh3.cxx923
-rw-r--r--sc/source/ui/view/cellsh4.cxx456
-rw-r--r--sc/source/ui/view/colrowba.cxx416
-rw-r--r--sc/source/ui/view/dbfunc.cxx538
-rw-r--r--sc/source/ui/view/dbfunc2.cxx79
-rw-r--r--sc/source/ui/view/dbfunc3.cxx2334
-rw-r--r--sc/source/ui/view/dbfunc4.cxx103
-rw-r--r--sc/source/ui/view/drawattr.cxx84
-rw-r--r--sc/source/ui/view/drawutil.cxx118
-rw-r--r--sc/source/ui/view/drawvie2.cxx64
-rw-r--r--sc/source/ui/view/drawvie3.cxx214
-rw-r--r--sc/source/ui/view/drawvie4.cxx357
-rw-r--r--sc/source/ui/view/drawview.cxx753
-rw-r--r--sc/source/ui/view/editsh.cxx1203
-rw-r--r--sc/source/ui/view/formatsh.cxx2242
-rw-r--r--sc/source/ui/view/galwrap.cxx81
-rw-r--r--sc/source/ui/view/gridmerg.cxx176
-rw-r--r--sc/source/ui/view/gridwin.cxx5742
-rw-r--r--sc/source/ui/view/gridwin2.cxx1066
-rw-r--r--sc/source/ui/view/gridwin3.cxx400
-rw-r--r--sc/source/ui/view/gridwin4.cxx1749
-rw-r--r--sc/source/ui/view/gridwin5.cxx440
-rw-r--r--sc/source/ui/view/hdrcont.cxx1027
-rw-r--r--sc/source/ui/view/hintwin.cxx111
-rw-r--r--sc/source/ui/view/imapwrap.cxx78
-rw-r--r--sc/source/ui/view/invmerge.cxx194
-rw-r--r--sc/source/ui/view/notemark.cxx202
-rw-r--r--sc/source/ui/view/olinewin.cxx1045
-rw-r--r--sc/source/ui/view/olkact.cxx217
-rw-r--r--sc/source/ui/view/output.cxx2373
-rw-r--r--sc/source/ui/view/output2.cxx4766
-rw-r--r--sc/source/ui/view/output3.cxx274
-rw-r--r--sc/source/ui/view/overlayobject.cxx104
-rw-r--r--sc/source/ui/view/pfuncache.cxx200
-rw-r--r--sc/source/ui/view/pgbrksh.cxx87
-rw-r--r--sc/source/ui/view/pivotsh.cxx202
-rw-r--r--sc/source/ui/view/preview.cxx1612
-rw-r--r--sc/source/ui/view/prevloc.cxx751
-rw-r--r--sc/source/ui/view/prevwsh.cxx1136
-rw-r--r--sc/source/ui/view/prevwsh2.cxx222
-rw-r--r--sc/source/ui/view/printfun.cxx3176
-rw-r--r--sc/source/ui/view/reffact.cxx402
-rw-r--r--sc/source/ui/view/scextopt.cxx227
-rw-r--r--sc/source/ui/view/select.cxx965
-rw-r--r--sc/source/ui/view/selectionstate.cxx91
-rw-r--r--sc/source/ui/view/spelldialog.cxx281
-rw-r--r--sc/source/ui/view/spelleng.cxx460
-rw-r--r--sc/source/ui/view/tabcont.cxx647
-rw-r--r--sc/source/ui/view/tabpopsh.cxx75
-rw-r--r--sc/source/ui/view/tabsplit.cxx107
-rw-r--r--sc/source/ui/view/tabview.cxx2447
-rw-r--r--sc/source/ui/view/tabview2.cxx1470
-rw-r--r--sc/source/ui/view/tabview3.cxx2540
-rw-r--r--sc/source/ui/view/tabview4.cxx565
-rw-r--r--sc/source/ui/view/tabview5.cxx676
-rw-r--r--sc/source/ui/view/tabvwsh.cxx112
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx482
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx1160
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx1891
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx428
-rw-r--r--sc/source/ui/view/tabvwsh8.cxx105
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx282
-rw-r--r--sc/source/ui/view/tabvwsha.cxx805
-rw-r--r--sc/source/ui/view/tabvwshb.cxx577
-rw-r--r--sc/source/ui/view/tabvwshc.cxx344
-rw-r--r--sc/source/ui/view/tabvwshd.cxx102
-rw-r--r--sc/source/ui/view/tabvwshe.cxx345
-rw-r--r--sc/source/ui/view/tabvwshf.cxx978
-rw-r--r--sc/source/ui/view/tabvwshg.cxx137
-rw-r--r--sc/source/ui/view/tabvwshh.cxx295
-rw-r--r--sc/source/ui/view/viewdata.cxx3096
-rw-r--r--sc/source/ui/view/viewfun2.cxx3093
-rw-r--r--sc/source/ui/view/viewfun3.cxx1955
-rw-r--r--sc/source/ui/view/viewfun4.cxx827
-rw-r--r--sc/source/ui/view/viewfun5.cxx737
-rw-r--r--sc/source/ui/view/viewfun6.cxx375
-rw-r--r--sc/source/ui/view/viewfun7.cxx491
-rw-r--r--sc/source/ui/view/viewfunc.cxx3046
-rw-r--r--sc/source/ui/view/viewutil.cxx473
-rw-r--r--sc/source/ui/view/waitoff.cxx72
1440 files changed, 649468 insertions, 0 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
new file mode 100644
index 000000000000..d0685130155e
--- /dev/null
+++ b/sc/source/core/data/attarray.cxx
@@ -0,0 +1,2433 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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_sc.hxx"
+
+//------------------------------------------------------------------------
+
+#include "scitems.hxx"
+#include <svx/algitem.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/bolnitem.hxx>
+#include <editeng/frmdiritem.hxx>
+#include <editeng/shaditem.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/justifyitem.hxx>
+#include <svl/poolcach.hxx>
+#include <editeng/fontitem.hxx>
+#include <unotools/fontcvt.hxx>
+
+#include "attarray.hxx"
+#include "global.hxx"
+#include "document.hxx"
+#include "docpool.hxx"
+#include "patattr.hxx"
+#include "stlsheet.hxx"
+#include "stlpool.hxx"
+#include "markarr.hxx"
+#include "rechead.hxx"
+#include "globstr.hrc"
+#include "segmenttree.hxx"
+#include "cell.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+//------------------------------------------------------------------------
+using ::editeng::SvxBorderLine;
+
+ScAttrArray::ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc ) :
+ nCol( nNewCol ),
+ nTab( nNewTab ),
+ pDocument( pDoc )
+{
+ nCount = nLimit = 1;
+ pData = new ScAttrEntry[1];
+ if (pData)
+ {
+ pData[0].nRow = MAXROW;
+ pData[0].pPattern = pDocument->GetDefPattern(); // no put
+ }
+}
+
+//------------------------------------------------------------------------
+
+ScAttrArray::~ScAttrArray()
+{
+#if OSL_DEBUG_LEVEL > 1
+ TestData();
+#endif
+
+ if (pData)
+ {
+ ScDocumentPool* pDocPool = pDocument->GetPool();
+ for (SCSIZE i=0; i<nCount; i++)
+ pDocPool->Remove(*pData[i].pPattern);
+
+ delete[] pData;
+ }
+}
+
+//------------------------------------------------------------------------
+#if OSL_DEBUG_LEVEL > 1
+void ScAttrArray::TestData() const
+{
+
+ sal_uInt16 nErr = 0;
+ if (pData)
+ {
+ SCSIZE nPos;
+ for (nPos=0; nPos<nCount; nPos++)
+ {
+ if (nPos > 0)
+ if (pData[nPos].pPattern == pData[nPos-1].pPattern || pData[nPos].nRow <= pData[nPos-1].nRow)
+ ++nErr;
+ if (pData[nPos].pPattern->Which() != ATTR_PATTERN)
+ ++nErr;
+ }
+ if ( nPos && pData[nPos-1].nRow != MAXROW )
+ ++nErr;
+ }
+ if (nErr)
+ {
+ ByteString aMsg = ByteString::CreateFromInt32(nErr);
+ aMsg += " errors in attribute array, column ";
+ aMsg += ByteString::CreateFromInt32(nCol);
+ OSL_FAIL( aMsg.GetBuffer() );
+ }
+}
+#endif
+
+//------------------------------------------------------------------------
+
+void ScAttrArray::Reset( const ScPatternAttr* pPattern, sal_Bool bAlloc )
+{
+ if (pData)
+ {
+ ScDocumentPool* pDocPool = pDocument->GetPool();
+ const ScPatternAttr* pOldPattern;
+ ScAddress aAdrStart( nCol, 0, nTab );
+ ScAddress aAdrEnd ( nCol, 0, nTab );
+
+ for (SCSIZE i=0; i<nCount; i++)
+ {
+ // ensure that attributing changes text width of cell
+ pOldPattern = pData[i].pPattern;
+ sal_Bool bNumFormatChanged;
+ if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
+ pPattern->GetItemSet(), pOldPattern->GetItemSet() ) )
+ {
+ aAdrStart.SetRow( i ? pData[i-1].nRow+1 : 0 );
+ aAdrEnd .SetRow( pData[i].nRow );
+ pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
+ }
+ // conditional format or deleted?
+ if ( &pPattern->GetItem(ATTR_CONDITIONAL) != &pOldPattern->GetItem(ATTR_CONDITIONAL) )
+ {
+ pDocument->ConditionalChanged( ((const SfxUInt32Item&)
+ pOldPattern->GetItem(ATTR_CONDITIONAL)).GetValue() );
+ pDocument->ConditionalChanged( ((const SfxUInt32Item&)
+ pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() );
+ }
+ pDocPool->Remove(*pOldPattern);
+ }
+ delete[] pData;
+
+ if (pDocument->IsStreamValid(nTab))
+ pDocument->SetStreamValid(nTab, false);
+
+ if (bAlloc)
+ {
+ nCount = nLimit = 1;
+ pData = new ScAttrEntry[1];
+ if (pData)
+ {
+ ScPatternAttr* pNewPattern = (ScPatternAttr*) &pDocPool->Put(*pPattern);
+ pData[0].nRow = MAXROW;
+ pData[0].pPattern = pNewPattern;
+ }
+ }
+ else
+ {
+ nCount = nLimit = 0;
+ pData = NULL; // should be immediately occupied again
+ }
+ }
+}
+
+
+sal_Bool ScAttrArray::Concat(SCSIZE nPos)
+{
+ sal_Bool bRet = false;
+ if (pData && (nPos < nCount))
+ {
+ if (nPos > 0)
+ {
+ if (pData[nPos - 1].pPattern == pData[nPos].pPattern)
+ {
+ pData[nPos - 1].nRow = pData[nPos].nRow;
+ pDocument->GetPool()->Remove(*pData[nPos].pPattern);
+ memmove(&pData[nPos], &pData[nPos + 1], (nCount - nPos - 1) * sizeof(ScAttrEntry));
+ pData[nCount - 1].pPattern = NULL;
+ pData[nCount - 1].nRow = 0;
+ nCount--;
+ nPos--;
+ bRet = sal_True;
+ }
+ }
+ if (nPos + 1 < nCount)
+ {
+ if (pData[nPos + 1].pPattern == pData[nPos].pPattern)
+ {
+ pData[nPos].nRow = pData[nPos + 1].nRow;
+ pDocument->GetPool()->Remove(*pData[nPos].pPattern);
+ memmove(&pData[nPos + 1], &pData[nPos + 2], (nCount - nPos - 2) * sizeof(ScAttrEntry));
+ pData[nCount - 1].pPattern = NULL;
+ pData[nCount - 1].nRow = 0;
+ nCount--;
+ bRet = sal_True;
+ }
+ }
+ }
+ return bRet;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const
+{
+ long nHi = static_cast<long>(nCount) - 1;
+ long i = 0;
+ sal_Bool bFound = (nCount == 1);
+ if (pData)
+ {
+ long nLo = 0;
+ long nStartRow = 0;
+ long nEndRow = 0;
+ while ( !bFound && nLo <= nHi )
+ {
+ i = (nLo + nHi) / 2;
+ if (i > 0)
+ nStartRow = (long) pData[i - 1].nRow;
+ else
+ nStartRow = -1;
+ nEndRow = (long) pData[i].nRow;
+ if (nEndRow < (long) nRow)
+ nLo = ++i;
+ else
+ if (nStartRow >= (long) nRow)
+ nHi = --i;
+ else
+ bFound = sal_True;
+ }
+ }
+ else
+ bFound = false;
+
+ if (bFound)
+ nIndex=(SCSIZE)i;
+ else
+ nIndex=0;
+ return bFound;
+}
+
+
+const ScPatternAttr* ScAttrArray::GetPattern( SCROW nRow ) const
+{
+ SCSIZE i;
+ if (Search( nRow, i ))
+ return pData[i].pPattern;
+ else
+ return NULL;
+}
+
+
+const ScPatternAttr* ScAttrArray::GetPatternRange( SCROW& rStartRow,
+ SCROW& rEndRow, SCROW nRow ) const
+{
+ SCSIZE nIndex;
+ if ( Search( nRow, nIndex ) )
+ {
+ if ( nIndex > 0 )
+ rStartRow = pData[nIndex-1].nRow + 1;
+ else
+ rStartRow = 0;
+ rEndRow = pData[nIndex].nRow;
+ return pData[nIndex].pPattern;
+ }
+ return NULL;
+}
+
+//------------------------------------------------------------------------
+
+void ScAttrArray::SetPattern( SCROW nRow, const ScPatternAttr* pPattern, sal_Bool bPutToPool )
+{
+ SetPatternArea( nRow, nRow, pPattern, bPutToPool );
+}
+
+void ScAttrArray::RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow,
+ const ScPatternAttr* pPattern, ScEditDataArray* pDataArray )
+{
+ for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
+ {
+ ScBaseCell* pCell;
+ pDocument->GetCell(nCol, nRow, nTab, pCell);
+ if (pCell && pCell->GetCellType() == CELLTYPE_EDIT)
+ {
+ EditTextObject* pOldData = NULL;
+ ScEditCell* pEditCell = static_cast<ScEditCell*>(pCell);
+ if (pDataArray)
+ pOldData = pEditCell->GetData()->Clone();
+ pEditCell->RemoveCharAttribs(*pPattern);
+ if (pDataArray)
+ {
+ EditTextObject* pNewData = pEditCell->GetData()->Clone();
+ pDataArray->AddItem(nTab, nCol, nRow, pOldData, pNewData);
+ }
+ }
+ }
+}
+
+void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPatternAttr *pPattern,
+ sal_Bool bPutToPool, ScEditDataArray* pDataArray )
+{
+ if (ValidRow(nStartRow) && ValidRow(nEndRow))
+ {
+ if (bPutToPool)
+ pPattern = (const ScPatternAttr*) &pDocument->GetPool()->Put(*pPattern);
+
+ if ((nStartRow == 0) && (nEndRow == MAXROW))
+ Reset(pPattern);
+ else
+ {
+ SCSIZE nNeeded = nCount + 2;
+ if ( nLimit < nNeeded )
+ {
+ nLimit += SC_ATTRARRAY_DELTA;
+ if ( nLimit < nNeeded )
+ nLimit = nNeeded;
+ ScAttrEntry* pNewData = new ScAttrEntry[nLimit];
+ memcpy( pNewData, pData, nCount*sizeof(ScAttrEntry) );
+ delete[] pData;
+ pData = pNewData;
+ }
+
+ ScAddress aAdrStart( nCol, 0, nTab );
+ ScAddress aAdrEnd ( nCol, 0, nTab );
+
+ SCSIZE ni = 0; // number of entries in beginning
+ SCSIZE nx = 0; // track position
+ SCROW ns = 0; // start row of track position
+ if ( nStartRow > 0 )
+ {
+ // skip beginning
+ SCSIZE nIndex;
+ Search( nStartRow, nIndex );
+ ni = nIndex;
+
+ if ( ni > 0 )
+ {
+ nx = ni;
+ ns = pData[ni-1].nRow+1;
+ }
+ }
+
+ // ensure that attributing changes text width of cell
+ // otherwise, conditional formats need to be reset or deleted
+ while ( ns <= nEndRow )
+ {
+ const SfxItemSet& rNewSet = pPattern->GetItemSet();
+ const SfxItemSet& rOldSet = pData[nx].pPattern->GetItemSet();
+
+ sal_Bool bNumFormatChanged;
+ if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
+ rNewSet, rOldSet ) )
+ {
+ aAdrStart.SetRow( Max(nStartRow,ns) );
+ aAdrEnd .SetRow( Min(nEndRow,pData[nx].nRow) );
+ pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
+ }
+ if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
+ {
+ pDocument->ConditionalChanged( ((const SfxUInt32Item&)
+ rOldSet.Get(ATTR_CONDITIONAL)).GetValue() );
+ pDocument->ConditionalChanged( ((const SfxUInt32Item&)
+ rNewSet.Get(ATTR_CONDITIONAL)).GetValue() );
+ }
+ ns = pData[nx].nRow + 1;
+ nx++;
+ }
+
+ // continue modifying data array
+
+ SCSIZE nInsert; // insert position (MAXROWCOUNT := no insert)
+ sal_Bool bCombined = false;
+ sal_Bool bSplit = false;
+ if ( nStartRow > 0 )
+ {
+ nInsert = MAXROWCOUNT;
+ if ( pData[ni].pPattern != pPattern )
+ {
+ if ( ni == 0 || (pData[ni-1].nRow < nStartRow - 1) )
+ { // may be a split or a simple insert or just a shrink,
+ // row adjustment is done further down
+ if ( pData[ni].nRow > nEndRow )
+ bSplit = sal_True;
+ ni++;
+ nInsert = ni;
+ }
+ else if ( ni > 0 && pData[ni-1].nRow == nStartRow - 1 )
+ nInsert = ni;
+ }
+ if ( ni > 0 && pData[ni-1].pPattern == pPattern )
+ { // combine
+ pData[ni-1].nRow = nEndRow;
+ nInsert = MAXROWCOUNT;
+ bCombined = sal_True;
+ }
+ }
+ else
+ nInsert = 0;
+
+ SCSIZE nj = ni; // stop position of range to replace
+ while ( nj < nCount && pData[nj].nRow <= nEndRow )
+ nj++;
+ if ( !bSplit )
+ {
+ if ( nj < nCount && pData[nj].pPattern == pPattern )
+ { // combine
+ if ( ni > 0 )
+ {
+ if ( pData[ni-1].pPattern == pPattern )
+ { // adjacent entries
+ pData[ni-1].nRow = pData[nj].nRow;
+ nj++;
+ }
+ else if ( ni == nInsert )
+ pData[ni-1].nRow = nStartRow - 1; // shrink
+ }
+ nInsert = MAXROWCOUNT;
+ bCombined = sal_True;
+ }
+ else if ( ni > 0 && ni == nInsert )
+ pData[ni-1].nRow = nStartRow - 1; // shrink
+ }
+ ScDocumentPool* pDocPool = pDocument->GetPool();
+ if ( bSplit )
+ { // duplicate splitted entry in pool
+ pDocPool->Put( *pData[ni-1].pPattern );
+ }
+ if ( ni < nj )
+ { // remove middle entries
+ for ( SCSIZE nk=ni; nk<nj; nk++)
+ { // remove entries from pool
+ pDocPool->Remove( *pData[nk].pPattern );
+ }
+ if ( !bCombined )
+ { // replace one entry
+ pData[ni].nRow = nEndRow;
+ pData[ni].pPattern = pPattern;
+ ni++;
+ nInsert = MAXROWCOUNT;
+ }
+ if ( ni < nj )
+ { // remove entries
+ memmove( pData + ni, pData + nj, (nCount - nj) * sizeof(ScAttrEntry) );
+ nCount -= nj - ni;
+ }
+ }
+
+ if ( nInsert < sal::static_int_cast<SCSIZE>(MAXROWCOUNT) )
+ { // insert or append new entry
+ if ( nInsert <= nCount )
+ {
+ if ( !bSplit )
+ memmove( pData + nInsert + 1, pData + nInsert,
+ (nCount - nInsert) * sizeof(ScAttrEntry) );
+ else
+ {
+ memmove( pData + nInsert + 2, pData + nInsert,
+ (nCount - nInsert) * sizeof(ScAttrEntry) );
+ pData[nInsert+1] = pData[nInsert-1];
+ nCount++;
+ }
+ }
+ if ( nInsert )
+ pData[nInsert-1].nRow = nStartRow - 1;
+ pData[nInsert].nRow = nEndRow;
+ pData[nInsert].pPattern = pPattern;
+
+ // Remove character attributes from these cells if the pattern
+ // is applied during normal session.
+ if (pDataArray)
+ RemoveCellCharAttribs(nStartRow, nEndRow, pPattern, pDataArray);
+
+ nCount++;
+ }
+
+ if (pDocument->IsStreamValid(nTab))
+ pDocument->SetStreamValid(nTab, false);
+ }
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ TestData();
+#endif
+}
+
+
+void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, ScStyleSheet* pStyle )
+{
+ if (ValidRow(nStartRow) && ValidRow(nEndRow))
+ {
+ SCSIZE nPos;
+ SCROW nStart=0;
+ if (!Search( nStartRow, nPos ))
+ {
+ OSL_FAIL("Search Failure");
+ return;
+ }
+
+ ScAddress aAdrStart( nCol, 0, nTab );
+ ScAddress aAdrEnd ( nCol, 0, nTab );
+
+ do
+ {
+ const ScPatternAttr* pOldPattern = pData[nPos].pPattern;
+ ScPatternAttr* pNewPattern = new ScPatternAttr(*pOldPattern);
+ pNewPattern->SetStyleSheet(pStyle);
+ SCROW nY1 = nStart;
+ SCROW nY2 = pData[nPos].nRow;
+ nStart = pData[nPos].nRow + 1;
+
+ if ( *pNewPattern == *pOldPattern )
+ {
+ // keep the original pattern (might be default)
+ // pNewPattern is deleted below
+ nPos++;
+ }
+ else if ( nY1 < nStartRow || nY2 > nEndRow )
+ {
+ if (nY1 < nStartRow) nY1=nStartRow;
+ if (nY2 > nEndRow) nY2=nEndRow;
+ SetPatternArea( nY1, nY2, pNewPattern, sal_True );
+ Search( nStart, nPos );
+ }
+ else
+ {
+ // ensure attributing changes text width of cell; otherwise
+ // there aren't (yet) template format changes
+ const SfxItemSet& rNewSet = pNewPattern->GetItemSet();
+ const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
+
+ sal_Bool bNumFormatChanged;
+ if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
+ rNewSet, rOldSet ) )
+ {
+ aAdrStart.SetRow( nPos ? pData[nPos-1].nRow+1 : 0 );
+ aAdrEnd .SetRow( pData[nPos].nRow );
+ pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
+ }
+
+ pDocument->GetPool()->Remove(*pData[nPos].pPattern);
+ pData[nPos].pPattern = (const ScPatternAttr*)
+ &pDocument->GetPool()->Put(*pNewPattern);
+ if (Concat(nPos))
+ Search(nStart, nPos);
+ else
+ nPos++;
+ }
+ delete pNewPattern;
+ }
+ while ((nStart <= nEndRow) && (nPos < nCount));
+
+ if (pDocument->IsStreamValid(nTab))
+ pDocument->SetStreamValid(nTab, false);
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ TestData();
+#endif
+}
+
+
+ // const cast, otherwise it will be too inefficient/complicated
+#define SET_LINECOLOR(dest,c) \
+ if ((dest)) \
+ { \
+ ((SvxBorderLine*)(dest))->SetColor((c)); \
+ }
+
+#define SET_LINE(dest,src) \
+ if ((dest)) \
+ { \
+ SvxBorderLine* pCast = (SvxBorderLine*)(dest); \
+ pCast->SetStyle( (src)->GetStyle( ) ); \
+ pCast->SetWidth( (src)->GetWidth( ) ); \
+ }
+
+void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
+ const SvxBorderLine* pLine, sal_Bool bColorOnly )
+{
+ if ( bColorOnly && !pLine )
+ return;
+
+ if (ValidRow(nStartRow) && ValidRow(nEndRow))
+ {
+ SCSIZE nPos;
+ SCROW nStart=0;
+ if (!Search( nStartRow, nPos ))
+ {
+ OSL_FAIL("Search failure");
+ return;
+ }
+
+ do
+ {
+ const ScPatternAttr* pOldPattern = pData[nPos].pPattern;
+ const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
+ const SfxPoolItem* pBoxItem = 0;
+ SfxItemState eState = rOldSet.GetItemState( ATTR_BORDER, sal_True, &pBoxItem );
+ const SfxPoolItem* pTLBRItem = 0;
+ SfxItemState eTLBRState = rOldSet.GetItemState( ATTR_BORDER_TLBR, sal_True, &pTLBRItem );
+ const SfxPoolItem* pBLTRItem = 0;
+ SfxItemState eBLTRState = rOldSet.GetItemState( ATTR_BORDER_BLTR, sal_True, &pBLTRItem );
+
+ if ( (SFX_ITEM_SET == eState) || (SFX_ITEM_SET == eTLBRState) || (SFX_ITEM_SET == eBLTRState) )
+ {
+ ScPatternAttr* pNewPattern = new ScPatternAttr(*pOldPattern);
+ SfxItemSet& rNewSet = pNewPattern->GetItemSet();
+ SCROW nY1 = nStart;
+ SCROW nY2 = pData[nPos].nRow;
+
+ SvxBoxItem* pNewBoxItem = pBoxItem ? (SvxBoxItem*)pBoxItem->Clone() : 0;
+ SvxLineItem* pNewTLBRItem = pTLBRItem ? (SvxLineItem*)pTLBRItem->Clone() : 0;
+ SvxLineItem* pNewBLTRItem = pBLTRItem ? (SvxLineItem*)pBLTRItem->Clone() : 0;
+
+ // fetch line and update attributes with parameters
+
+ if ( !pLine )
+ {
+ if( pNewBoxItem )
+ {
+ if ( pNewBoxItem->GetTop() ) pNewBoxItem->SetLine( NULL, BOX_LINE_TOP );
+ if ( pNewBoxItem->GetBottom() ) pNewBoxItem->SetLine( NULL, BOX_LINE_BOTTOM );
+ if ( pNewBoxItem->GetLeft() ) pNewBoxItem->SetLine( NULL, BOX_LINE_LEFT );
+ if ( pNewBoxItem->GetRight() ) pNewBoxItem->SetLine( NULL, BOX_LINE_RIGHT );
+ }
+ if( pNewTLBRItem && pNewTLBRItem->GetLine() )
+ pNewTLBRItem->SetLine( 0 );
+ if( pNewBLTRItem && pNewBLTRItem->GetLine() )
+ pNewBLTRItem->SetLine( 0 );
+ }
+ else
+ {
+ if ( bColorOnly )
+ {
+ Color aColor( pLine->GetColor() );
+ if( pNewBoxItem )
+ {
+ SET_LINECOLOR( pNewBoxItem->GetTop(), aColor );
+ SET_LINECOLOR( pNewBoxItem->GetBottom(), aColor );
+ SET_LINECOLOR( pNewBoxItem->GetLeft(), aColor );
+ SET_LINECOLOR( pNewBoxItem->GetRight(), aColor );
+ }
+ if( pNewTLBRItem )
+ SET_LINECOLOR( pNewTLBRItem->GetLine(), aColor );
+ if( pNewBLTRItem )
+ SET_LINECOLOR( pNewBLTRItem->GetLine(), aColor );
+ }
+ else
+ {
+ if( pNewBoxItem )
+ {
+ SET_LINE( pNewBoxItem->GetTop(), pLine );
+ SET_LINE( pNewBoxItem->GetBottom(), pLine );
+ SET_LINE( pNewBoxItem->GetLeft(), pLine );
+ SET_LINE( pNewBoxItem->GetRight(), pLine );
+ }
+ if( pNewTLBRItem )
+ SET_LINE( pNewTLBRItem->GetLine(), pLine );
+ if( pNewBLTRItem )
+ SET_LINE( pNewBLTRItem->GetLine(), pLine );
+ }
+ }
+ if( pNewBoxItem ) rNewSet.Put( *pNewBoxItem );
+ if( pNewTLBRItem ) rNewSet.Put( *pNewTLBRItem );
+ if( pNewBLTRItem ) rNewSet.Put( *pNewBLTRItem );
+
+ nStart = pData[nPos].nRow + 1;
+
+ if ( nY1 < nStartRow || nY2 > nEndRow )
+ {
+ if (nY1 < nStartRow) nY1=nStartRow;
+ if (nY2 > nEndRow) nY2=nEndRow;
+ SetPatternArea( nY1, nY2, pNewPattern, sal_True );
+ Search( nStart, nPos );
+ }
+ else
+ {
+ // remove from pool ?
+ pDocument->GetPool()->Remove(*pData[nPos].pPattern);
+ pData[nPos].pPattern = (const ScPatternAttr*)
+ &pDocument->GetPool()->Put(*pNewPattern);
+
+ if (Concat(nPos))
+ Search(nStart, nPos);
+ else
+ nPos++;
+ }
+ delete pNewBoxItem;
+ delete pNewTLBRItem;
+ delete pNewBLTRItem;
+ delete pNewPattern;
+ }
+ else
+ {
+ nStart = pData[nPos].nRow + 1;
+ nPos++;
+ }
+ }
+ while ((nStart <= nEndRow) && (nPos < nCount));
+ }
+}
+
+#undef SET_LINECOLOR
+#undef SET_LINE
+
+
+void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache, ScEditDataArray* pDataArray )
+{
+#if OSL_DEBUG_LEVEL > 1
+ TestData();
+#endif
+
+ if (ValidRow(nStartRow) && ValidRow(nEndRow))
+ {
+ SCSIZE nPos;
+ SCROW nStart=0;
+ if (!Search( nStartRow, nPos ))
+ {
+ OSL_FAIL("Search Failure");
+ return;
+ }
+
+ ScAddress aAdrStart( nCol, 0, nTab );
+ ScAddress aAdrEnd ( nCol, 0, nTab );
+
+ do
+ {
+ const ScPatternAttr* pOldPattern = pData[nPos].pPattern;
+ const ScPatternAttr* pNewPattern = (const ScPatternAttr*) &pCache->ApplyTo( *pOldPattern, sal_True );
+ ScDocumentPool::CheckRef( *pOldPattern );
+ ScDocumentPool::CheckRef( *pNewPattern );
+ if (pNewPattern != pOldPattern)
+ {
+ SCROW nY1 = nStart;
+ SCROW nY2 = pData[nPos].nRow;
+ nStart = pData[nPos].nRow + 1;
+
+ if ( nY1 < nStartRow || nY2 > nEndRow )
+ {
+ if (nY1 < nStartRow) nY1=nStartRow;
+ if (nY2 > nEndRow) nY2=nEndRow;
+ SetPatternArea( nY1, nY2, pNewPattern, false, pDataArray );
+ Search( nStart, nPos );
+ }
+ else
+ {
+ // ensure attributing changes text-width of cell
+
+ const SfxItemSet& rNewSet = pNewPattern->GetItemSet();
+ const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
+
+ sal_Bool bNumFormatChanged;
+ if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged,
+ rNewSet, rOldSet ) )
+ {
+ aAdrStart.SetRow( nPos ? pData[nPos-1].nRow+1 : 0 );
+ aAdrEnd .SetRow( pData[nPos].nRow );
+ pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged );
+ }
+
+ // Reset conditional formats or delete ?
+
+ if ( &rNewSet.Get(ATTR_CONDITIONAL) != &rOldSet.Get(ATTR_CONDITIONAL) )
+ {
+ pDocument->ConditionalChanged( ((const SfxUInt32Item&)
+ rOldSet.Get(ATTR_CONDITIONAL)).GetValue() );
+ pDocument->ConditionalChanged( ((const SfxUInt32Item&)
+ rNewSet.Get(ATTR_CONDITIONAL)).GetValue() );
+ }
+
+ pDocument->GetPool()->Remove(*pData[nPos].pPattern);
+ pData[nPos].pPattern = pNewPattern;
+ if (Concat(nPos))
+ Search(nStart, nPos);
+ else
+ ++nPos;
+ }
+ }
+ else
+ {
+ nStart = pData[nPos].nRow + 1;
+ ++nPos;
+ }
+ }
+ while (nStart <= nEndRow);
+
+ if (pDocument->IsStreamValid(nTab))
+ pDocument->SetStreamValid(nTab, false);
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ TestData();
+#endif
+}
+
+bool ScAttrArray::SetAttrEntries(ScAttrEntry* pNewData, SCSIZE nSize)
+{
+ if (pData)
+ {
+ ScDocumentPool* pDocPool = pDocument->GetPool();
+ for (SCSIZE i=0; i<nCount; i++)
+ pDocPool->Remove(*pData[i].pPattern);
+
+ delete[] pData;
+ }
+
+ pData = pNewData;
+ nCount = nLimit = nSize;
+ return true;
+}
+
+void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource )
+{
+ const SfxPoolItem* pNewItem;
+ const SfxPoolItem* pOldItem;
+ for (sal_uInt16 nId=ATTR_PATTERN_START; nId<=ATTR_PATTERN_END; nId++)
+ {
+ // pMergeSet has no parent
+ SfxItemState eOldState = rMergeSet.GetItemState( nId, false, &pOldItem );
+
+ if ( eOldState == SFX_ITEM_DEFAULT )
+ {
+ SfxItemState eNewState = rSource.GetItemState( nId, sal_True, &pNewItem );
+ if ( eNewState == SFX_ITEM_SET )
+ {
+ if ( *pNewItem != rMergeSet.GetPool()->GetDefaultItem(nId) )
+ rMergeSet.InvalidateItem( nId );
+ }
+ }
+ else if ( eOldState == SFX_ITEM_SET ) // Item gesetzt
+ {
+ SfxItemState eNewState = rSource.GetItemState( nId, sal_True, &pNewItem );
+ if ( eNewState == SFX_ITEM_SET )
+ {
+ if ( pNewItem != pOldItem ) // beide gepuhlt
+ rMergeSet.InvalidateItem( nId );
+ }
+ else // Default
+ {
+ if ( *pOldItem != rSource.GetPool()->GetDefaultItem(nId) )
+ rMergeSet.InvalidateItem( nId );
+ }
+ }
+ // Dontcare remains Dontcare
+ }
+}
+
+
+void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
+ ScMergePatternState& rState, sal_Bool bDeep ) const
+{
+ if (ValidRow(nStartRow) && ValidRow(nEndRow))
+ {
+ SCSIZE nPos;
+ SCROW nStart=0;
+ if (!Search( nStartRow, nPos ))
+ {
+ OSL_FAIL("Search failure");
+ return;
+ }
+
+ do
+ {
+ // similar patterns must not be repeated
+
+ const ScPatternAttr* pPattern = pData[nPos].pPattern;
+ if ( pPattern != rState.pOld1 && pPattern != rState.pOld2 )
+ {
+ const SfxItemSet& rThisSet = pPattern->GetItemSet();
+ if (rState.pItemSet)
+ {
+ if (bDeep)
+ lcl_MergeDeep( *rState.pItemSet, rThisSet );
+ else
+ rState.pItemSet->MergeValues( rThisSet, false );
+ }
+ else
+ {
+ // first pattern - copied from parent
+ rState.pItemSet = new SfxItemSet( *rThisSet.GetPool(), rThisSet.GetRanges() );
+ rState.pItemSet->Set( rThisSet, bDeep );
+ }
+
+ rState.pOld2 = rState.pOld1;
+ rState.pOld1 = pPattern;
+ }
+
+ nStart = pData[nPos].nRow + 1;
+ ++nPos;
+ }
+ while (nStart <= nEndRow);
+ }
+}
+
+
+
+// assemble border
+
+sal_Bool lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine,
+ sal_uInt8& rModified, const SvxBorderLine*& rpNew )
+{
+ if (rModified == SC_LINE_DONTCARE)
+ return false; // don't go again
+
+ if (rModified == SC_LINE_EMPTY)
+ {
+ rModified = SC_LINE_SET;
+ rpNew = pNewLine;
+ return true; // initial value
+ }
+
+ if (pOldLine == pNewLine)
+ {
+ rpNew = pOldLine;
+ return false;
+ }
+
+ if (pOldLine && pNewLine)
+ if (*pOldLine == *pNewLine)
+ {
+ rpNew = pOldLine;
+ return false;
+ }
+
+ rModified = SC_LINE_DONTCARE;
+ rpNew = NULL;
+ return true; // another line -> don't care
+}
+
+
+void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
+ ScLineFlags& rFlags, const ScPatternAttr* pPattern,
+ sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom )
+{
+ // right/bottom border set when connected together
+ const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE);
+ if ( rMerge.GetColMerge() == nDistRight + 1 )
+ nDistRight = 0;
+ if ( rMerge.GetRowMerge() == nDistBottom + 1 )
+ nDistBottom = 0;
+
+ const SvxBoxItem* pCellFrame = (SvxBoxItem*) &pPattern->GetItemSet().Get( ATTR_BORDER );
+ const SvxBorderLine* pLeftAttr = pCellFrame->GetLeft();
+ const SvxBorderLine* pRightAttr = pCellFrame->GetRight();
+ const SvxBorderLine* pTopAttr = pCellFrame->GetTop();
+ const SvxBorderLine* pBottomAttr = pCellFrame->GetBottom();
+ const SvxBorderLine* pNew;
+
+ if (bTop)
+ {
+ if (lcl_TestAttr( pLineOuter->GetTop(), pTopAttr, rFlags.nTop, pNew ))
+ pLineOuter->SetLine( pNew, BOX_LINE_TOP );
+ }
+ else
+ {
+ if (lcl_TestAttr( pLineInner->GetHori(), pTopAttr, rFlags.nHori, pNew ))
+ pLineInner->SetLine( pNew, BOXINFO_LINE_HORI );
+ }
+
+ if (nDistBottom == 0)
+ {
+ if (lcl_TestAttr( pLineOuter->GetBottom(), pBottomAttr, rFlags.nBottom, pNew ))
+ pLineOuter->SetLine( pNew, BOX_LINE_BOTTOM );
+ }
+ else
+ {
+ if (lcl_TestAttr( pLineInner->GetHori(), pBottomAttr, rFlags.nHori, pNew ))
+ pLineInner->SetLine( pNew, BOXINFO_LINE_HORI );
+ }
+
+ if (bLeft)
+ {
+ if (lcl_TestAttr( pLineOuter->GetLeft(), pLeftAttr, rFlags.nLeft, pNew ))
+ pLineOuter->SetLine( pNew, BOX_LINE_LEFT );
+ }
+ else
+ {
+ if (lcl_TestAttr( pLineInner->GetVert(), pLeftAttr, rFlags.nVert, pNew ))
+ pLineInner->SetLine( pNew, BOXINFO_LINE_VERT );
+ }
+
+ if (nDistRight == 0)
+ {
+ if (lcl_TestAttr( pLineOuter->GetRight(), pRightAttr, rFlags.nRight, pNew ))
+ pLineOuter->SetLine( pNew, BOX_LINE_RIGHT );
+ }
+ else
+ {
+ if (lcl_TestAttr( pLineInner->GetVert(), pRightAttr, rFlags.nVert, pNew ))
+ pLineInner->SetLine( pNew, BOXINFO_LINE_VERT );
+ }
+}
+
+
+void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
+ ScLineFlags& rFlags,
+ SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight ) const
+{
+ const ScPatternAttr* pPattern;
+
+ if (nStartRow == nEndRow)
+ {
+ pPattern = GetPattern( nStartRow );
+ lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, sal_True, 0 );
+ }
+ else
+ {
+ pPattern = GetPattern( nStartRow );
+ lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, sal_True,
+ nEndRow-nStartRow );
+
+ SCSIZE nStartIndex;
+ SCSIZE nEndIndex;
+ Search( nStartRow+1, nStartIndex );
+ Search( nEndRow-1, nEndIndex );
+ for (SCSIZE i=nStartIndex; i<=nEndIndex; i++)
+ {
+ pPattern = (ScPatternAttr*) pData[i].pPattern;
+ lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false,
+ nEndRow - Min( pData[i].nRow, (SCROW)(nEndRow-1) ) );
+ // nDistBottom here always > 0
+ }
+
+ pPattern = GetPattern( nEndRow );
+ lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false, 0 );
+ }
+}
+
+//
+// apply border
+//
+
+// ApplyFrame - on an entry into the array
+
+sal_Bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem,
+ const SvxBoxInfoItem* pBoxInfoItem,
+ SCROW nStartRow, SCROW nEndRow,
+ sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom )
+{
+ DBG_ASSERT( pBoxItem && pBoxInfoItem, "Linienattribute fehlen!" );
+
+ const ScPatternAttr* pPattern = GetPattern( nStartRow );
+ const SvxBoxItem* pOldFrame = (const SvxBoxItem*)
+ &pPattern->GetItemSet().Get( ATTR_BORDER );
+
+ // right/bottom border set when connected together
+ const ScMergeAttr& rMerge = (const ScMergeAttr&)pPattern->GetItem(ATTR_MERGE);
+ if ( rMerge.GetColMerge() == nDistRight + 1 )
+ nDistRight = 0;
+ if ( rMerge.GetRowMerge() == nDistBottom + 1 )
+ nDistBottom = 0;
+
+ SvxBoxItem aNewFrame( *pOldFrame );
+
+ if ( bLeft ? pBoxInfoItem->IsValid(VALID_LEFT) : pBoxInfoItem->IsValid(VALID_VERT) )
+ aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
+ BOX_LINE_LEFT );
+ if ( (nDistRight==0) ? pBoxInfoItem->IsValid(VALID_RIGHT) : pBoxInfoItem->IsValid(VALID_VERT) )
+ aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
+ BOX_LINE_RIGHT );
+ if ( bTop ? pBoxInfoItem->IsValid(VALID_TOP) : pBoxInfoItem->IsValid(VALID_HORI) )
+ aNewFrame.SetLine( bTop ? pBoxItem->GetTop() : pBoxInfoItem->GetHori(),
+ BOX_LINE_TOP );
+ if ( (nDistBottom==0) ? pBoxInfoItem->IsValid(VALID_BOTTOM) : pBoxInfoItem->IsValid(VALID_HORI) )
+ aNewFrame.SetLine( (nDistBottom==0) ? pBoxItem->GetBottom() : pBoxInfoItem->GetHori(),
+ BOX_LINE_BOTTOM );
+
+ if (aNewFrame == *pOldFrame)
+ {
+ // nothing to do
+ return false;
+ }
+ else
+ {
+ SfxItemPoolCache aCache( pDocument->GetPool(), &aNewFrame );
+ ApplyCacheArea( nStartRow, nEndRow, &aCache );
+
+ return true;
+ }
+}
+
+
+void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInfoItem* pLineInner,
+ SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight )
+{
+ if (nStartRow == nEndRow)
+ ApplyFrame( pLineOuter, pLineInner, nStartRow, nEndRow, bLeft, nDistRight, sal_True, 0 );
+ else
+ {
+ ApplyFrame( pLineOuter, pLineInner, nStartRow, nStartRow, bLeft, nDistRight,
+ sal_True, nEndRow-nStartRow );
+
+ if ( nEndRow > nStartRow+1 ) // inner part available?
+ {
+ SCSIZE nStartIndex;
+ SCSIZE nEndIndex;
+ Search( nStartRow+1, nStartIndex );
+ Search( nEndRow-1, nEndIndex );
+ SCROW nTmpStart = nStartRow+1;
+ SCROW nTmpEnd;
+ for (SCSIZE i=nStartIndex; i<=nEndIndex;)
+ {
+ nTmpEnd = Min( (SCROW)(nEndRow-1), (SCROW)(pData[i].nRow) );
+ sal_Bool bChanged = ApplyFrame( pLineOuter, pLineInner, nTmpStart, nTmpEnd,
+ bLeft, nDistRight, false, nEndRow-nTmpEnd );
+ nTmpStart = nTmpEnd+1;
+ if (bChanged)
+ {
+ Search(nTmpStart, i);
+ Search(nEndRow-1, nEndIndex);
+ }
+ else
+ i++;
+ }
+ }
+
+ ApplyFrame( pLineOuter, pLineInner, nEndRow, nEndRow, bLeft, nDistRight, false, 0 );
+ }
+}
+
+
+long lcl_LineSize( const SvxBorderLine& rLine )
+{
+ // only one line -> half width, min. 20
+ // double line -> half line spacing + (per min. 20)
+
+ long nTotal = 0;
+ sal_uInt16 nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() );
+ sal_uInt16 nDist = rLine.GetDistance();
+ if (nDist)
+ {
+ DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(),
+ "Line has a distance, but only a width?" );
+
+ nTotal += ( nDist > 20 ) ? nDist : 20;
+ nTotal += ( nWidth > 20 ) ? nWidth : 20;
+ }
+ else if (nWidth)
+ nTotal += ( nWidth > 20 ) ? nWidth : 20;
+
+ // also halved ?
+
+ return nTotal;
+}
+
+sal_Bool ScAttrArray::HasLines( SCROW nRow1, SCROW nRow2, Rectangle& rSizes,
+ sal_Bool bLeft, sal_Bool bRight ) const
+{
+ SCSIZE nStartIndex;
+ SCSIZE nEndIndex;
+ Search( nRow1, nStartIndex );
+ Search( nRow2, nEndIndex );
+ sal_Bool bFound = false;
+
+ const SvxBoxItem* pItem = 0;
+ const SvxBorderLine* pLine = 0;
+ long nCmp;
+
+ // top
+
+ pItem = (const SvxBoxItem*) &pData[nStartIndex].pPattern->GetItem(ATTR_BORDER);
+ pLine = pItem->GetTop();
+ if (pLine)
+ {
+ nCmp = lcl_LineSize(*pLine);
+ if ( nCmp > rSizes.Top() )
+ rSizes.Top() = nCmp;
+ bFound = sal_True;
+ }
+
+ // down
+
+ if ( nEndIndex != nStartIndex )
+ pItem = (const SvxBoxItem*) &pData[nEndIndex].pPattern->GetItem(ATTR_BORDER);
+ pLine = pItem->GetBottom();
+ if (pLine)
+ {
+ nCmp = lcl_LineSize(*pLine);
+ if ( nCmp > rSizes.Bottom() )
+ rSizes.Bottom() = nCmp;
+ bFound = sal_True;
+ }
+
+ if ( bLeft || bRight )
+ for ( SCSIZE i=nStartIndex; i<=nEndIndex; i++)
+ {
+ pItem = (const SvxBoxItem*) &pData[i].pPattern->GetItem(ATTR_BORDER);
+
+ if (bLeft)
+ {
+ pLine = pItem->GetLeft();
+ if (pLine)
+ {
+ nCmp = lcl_LineSize(*pLine);
+ if ( nCmp > rSizes.Left() )
+ rSizes.Left() = nCmp;
+ bFound = sal_True;
+ }
+ }
+
+ if (bRight)
+ {
+ pLine = pItem->GetRight();
+ if (pLine)
+ {
+ nCmp = lcl_LineSize(*pLine);
+ if ( nCmp > rSizes.Right() )
+ rSizes.Right() = nCmp;
+ bFound = sal_True;
+ }
+ }
+ }
+
+ return bFound;
+}
+
+// Test if field contains specific attribute
+
+bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const
+{
+ SCSIZE nStartIndex;
+ SCSIZE nEndIndex;
+ Search( nRow1, nStartIndex );
+ Search( nRow2, nEndIndex );
+ bool bFound = false;
+
+ for (SCSIZE i=nStartIndex; i<=nEndIndex && !bFound; i++)
+ {
+ const ScPatternAttr* pPattern = pData[i].pPattern;
+ if ( nMask & HASATTR_MERGED )
+ {
+ const ScMergeAttr* pMerge =
+ (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
+ if ( pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1 )
+ bFound = true;
+ }
+ if ( nMask & ( HASATTR_OVERLAPPED | HASATTR_NOTOVERLAPPED | HASATTR_AUTOFILTER ) )
+ {
+ const ScMergeFlagAttr* pMergeFlag =
+ (const ScMergeFlagAttr*) &pPattern->GetItem( ATTR_MERGE_FLAG );
+ if ( (nMask & HASATTR_OVERLAPPED) && pMergeFlag->IsOverlapped() )
+ bFound = true;
+ if ( (nMask & HASATTR_NOTOVERLAPPED) && !pMergeFlag->IsOverlapped() )
+ bFound = true;
+ if ( (nMask & HASATTR_AUTOFILTER) && pMergeFlag->HasAutoFilter() )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_LINES )
+ {
+ const SvxBoxItem* pBox =
+ (const SvxBoxItem*) &pPattern->GetItem( ATTR_BORDER );
+ if ( pBox->GetLeft() || pBox->GetRight() || pBox->GetTop() || pBox->GetBottom() )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_SHADOW )
+ {
+ const SvxShadowItem* pShadow =
+ (const SvxShadowItem*) &pPattern->GetItem( ATTR_SHADOW );
+ if ( pShadow->GetLocation() != SVX_SHADOW_NONE )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_CONDITIONAL )
+ {
+ const SfxUInt32Item* pConditional =
+ (const SfxUInt32Item*) &pPattern->GetItem( ATTR_CONDITIONAL );
+ if ( pConditional->GetValue() != 0 )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_PROTECTED )
+ {
+ const ScProtectionAttr* pProtect =
+ (const ScProtectionAttr*) &pPattern->GetItem( ATTR_PROTECTION );
+ if ( pProtect->GetProtection() || pProtect->GetHideCell() )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_ROTATE )
+ {
+ const SfxInt32Item* pRotate =
+ (const SfxInt32Item*) &pPattern->GetItem( ATTR_ROTATE_VALUE );
+ // 90 or 270 degrees is former SvxOrientationItem - only look for other values
+ // (see ScPatternAttr::GetCellOrientation)
+ sal_Int32 nAngle = pRotate->GetValue();
+ if ( nAngle != 0 && nAngle != 9000 && nAngle != 27000 )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_NEEDHEIGHT )
+ {
+ if (pPattern->GetCellOrientation() != SVX_ORIENTATION_STANDARD)
+ bFound = true;
+ else if (((const SfxBoolItem&)pPattern->GetItem( ATTR_LINEBREAK )).GetValue())
+ bFound = true;
+ else if ((SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern->
+ GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SVX_HOR_JUSTIFY_BLOCK)
+ bFound = true;
+ else if (((const SfxUInt32Item&)pPattern->GetItem( ATTR_CONDITIONAL )).GetValue())
+ bFound = true;
+ else if (((const SfxInt32Item&)pPattern->GetItem( ATTR_ROTATE_VALUE )).GetValue())
+ bFound = true;
+ }
+ if ( nMask & ( HASATTR_SHADOW_RIGHT | HASATTR_SHADOW_DOWN ) )
+ {
+ const SvxShadowItem* pShadow =
+ (const SvxShadowItem*) &pPattern->GetItem( ATTR_SHADOW );
+ SvxShadowLocation eLoc = pShadow->GetLocation();
+ if ( nMask & HASATTR_SHADOW_RIGHT )
+ if ( eLoc == SVX_SHADOW_TOPRIGHT || eLoc == SVX_SHADOW_BOTTOMRIGHT )
+ bFound = true;
+ if ( nMask & HASATTR_SHADOW_DOWN )
+ if ( eLoc == SVX_SHADOW_BOTTOMLEFT || eLoc == SVX_SHADOW_BOTTOMRIGHT )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_RTL )
+ {
+ const SvxFrameDirectionItem& rDirection =
+ (const SvxFrameDirectionItem&) pPattern->GetItem( ATTR_WRITINGDIR );
+ if ( rDirection.GetValue() == FRMDIR_HORI_RIGHT_TOP )
+ bFound = true;
+ }
+ if ( nMask & HASATTR_RIGHTORCENTER )
+ {
+ // called only if the sheet is LTR, so physical=logical alignment can be assumed
+ SvxCellHorJustify eHorJust = (SvxCellHorJustify)
+ ((const SvxHorJustifyItem&) pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue();
+ if ( eHorJust == SVX_HOR_JUSTIFY_RIGHT || eHorJust == SVX_HOR_JUSTIFY_CENTER )
+ bFound = true;
+ }
+ }
+
+ return bFound;
+}
+
+// Area around any given summaries expand and adapt any MergeFlag (bRefresh)
+sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
+ SCCOL& rPaintCol, SCROW& rPaintRow,
+ sal_Bool bRefresh, sal_Bool bAttrs )
+{
+ const ScPatternAttr* pPattern;
+ const ScMergeAttr* pItem;
+ SCSIZE nStartIndex;
+ SCSIZE nEndIndex;
+ Search( nStartRow, nStartIndex );
+ Search( nEndRow, nEndIndex );
+ sal_Bool bFound = false;
+
+ for (SCSIZE i=nStartIndex; i<=nEndIndex; i++)
+ {
+ pPattern = pData[i].pPattern;
+ pItem = (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
+ SCsCOL nCountX = pItem->GetColMerge();
+ SCsROW nCountY = pItem->GetRowMerge();
+ if (nCountX>1 || nCountY>1)
+ {
+ SCROW nThisRow = (i>0) ? pData[i-1].nRow+1 : 0;
+ SCCOL nMergeEndCol = nThisCol + nCountX - 1;
+ SCROW nMergeEndRow = nThisRow + nCountY - 1;
+ if (nMergeEndCol > rPaintCol && nMergeEndCol <= MAXCOL)
+ rPaintCol = nMergeEndCol;
+ if (nMergeEndRow > rPaintRow && nMergeEndRow <= MAXROW)
+ rPaintRow = nMergeEndRow;
+ bFound = sal_True;
+
+ if (bAttrs)
+ {
+ const SvxShadowItem* pShadow =
+ (const SvxShadowItem*) &pPattern->GetItem( ATTR_SHADOW );
+ SvxShadowLocation eLoc = pShadow->GetLocation();
+ if ( eLoc == SVX_SHADOW_TOPRIGHT || eLoc == SVX_SHADOW_BOTTOMRIGHT )
+ if ( nMergeEndCol+1 > rPaintCol && nMergeEndCol < MAXCOL )
+ rPaintCol = nMergeEndCol+1;
+ if ( eLoc == SVX_SHADOW_BOTTOMLEFT || eLoc == SVX_SHADOW_BOTTOMRIGHT )
+ if ( nMergeEndRow+1 > rPaintRow && nMergeEndRow < MAXROW )
+ rPaintRow = nMergeEndRow+1;
+ }
+
+ if (bRefresh)
+ {
+ if ( nMergeEndCol > nThisCol )
+ pDocument->ApplyFlagsTab( nThisCol+1, nThisRow, nMergeEndCol, pData[i].nRow,
+ nTab, SC_MF_HOR );
+ if ( nMergeEndRow > nThisRow )
+ pDocument->ApplyFlagsTab( nThisCol, nThisRow+1, nThisCol, nMergeEndRow,
+ nTab, SC_MF_VER );
+ if ( nMergeEndCol > nThisCol && nMergeEndRow > nThisRow )
+ pDocument->ApplyFlagsTab( nThisCol+1, nThisRow+1, nMergeEndCol, nMergeEndRow,
+ nTab, SC_MF_HOR | SC_MF_VER );
+
+ Search( nThisRow, i ); // Data changed
+ Search( nStartRow, nStartIndex );
+ Search( nEndRow, nEndIndex );
+ }
+ }
+ }
+
+ return bFound;
+}
+
+
+sal_Bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow)
+{
+ sal_Bool bFound = false;
+ const ScPatternAttr* pPattern;
+ const ScMergeAttr* pItem;
+ SCSIZE nIndex;
+
+ Search( nStartRow, nIndex );
+ SCROW nThisStart = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ if (nThisStart < nStartRow)
+ nThisStart = nStartRow;
+
+ while ( nThisStart <= nEndRow )
+ {
+ SCROW nThisEnd = pData[nIndex].nRow;
+ if (nThisEnd > nEndRow)
+ nThisEnd = nEndRow;
+
+ pPattern = pData[nIndex].pPattern;
+ pItem = (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
+ SCsCOL nCountX = pItem->GetColMerge();
+ SCsROW nCountY = pItem->GetRowMerge();
+ if (nCountX>1 || nCountY>1)
+ {
+ const ScMergeAttr* pAttr = (const ScMergeAttr*)
+ &pDocument->GetPool()->GetDefaultItem( ATTR_MERGE );
+ const ScMergeFlagAttr* pFlagAttr = (const ScMergeFlagAttr*)
+ &pDocument->GetPool()->GetDefaultItem( ATTR_MERGE_FLAG );
+
+ DBG_ASSERT( nCountY==1 || nThisStart==nThisEnd, "What's up?" );
+
+ SCCOL nThisCol = nCol;
+ SCCOL nMergeEndCol = nThisCol + nCountX - 1;
+ SCROW nMergeEndRow = nThisEnd + nCountY - 1;
+
+ // ApplyAttr for areas
+
+ for (SCROW nThisRow = nThisStart; nThisRow <= nThisEnd; nThisRow++)
+ pDocument->ApplyAttr( nThisCol, nThisRow, nTab, *pAttr );
+
+ ScPatternAttr* pNewPattern = new ScPatternAttr( pDocument->GetPool() );
+ SfxItemSet* pSet = &pNewPattern->GetItemSet();
+ pSet->Put( *pFlagAttr );
+ pDocument->ApplyPatternAreaTab( nThisCol, nThisStart, nMergeEndCol, nMergeEndRow,
+ nTab, *pNewPattern );
+ delete pNewPattern;
+
+ Search( nThisEnd, nIndex ); // data changed
+ }
+
+ ++nIndex;
+ if ( nIndex < nCount )
+ nThisStart = pData[nIndex-1].nRow+1;
+ else
+ nThisStart = MAXROW+1; // End
+ }
+
+ return bFound;
+}
+
+// Remove field, but leave MergeFlags
+
+void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow)
+{
+ SetPatternAreaSafe( nStartRow, nEndRow, pDocument->GetDefPattern(), sal_True );
+}
+
+
+void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
+ const ScPatternAttr* pWantedPattern, sal_Bool bDefault )
+{
+ const ScPatternAttr* pOldPattern;
+ const ScMergeFlagAttr* pItem;
+
+ SCSIZE nIndex;
+ SCROW nRow;
+ SCROW nThisRow;
+ sal_Bool bFirstUse = sal_True;
+
+ Search( nStartRow, nIndex );
+ nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ while ( nThisRow <= nEndRow )
+ {
+ pOldPattern = pData[nIndex].pPattern;
+ if (pOldPattern != pWantedPattern) //! else-Zweig ?
+ {
+ if (nThisRow < nStartRow) nThisRow = nStartRow;
+ nRow = pData[nIndex].nRow;
+ SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
+ pItem = (const ScMergeFlagAttr*) &pOldPattern->GetItem( ATTR_MERGE_FLAG );
+
+ if (pItem->IsOverlapped() || pItem->HasAutoFilter())
+ {
+ // default-constructing a ScPatternAttr for DeleteArea doesn't work
+ // because it would have no cell style information.
+ // Instead, the document's GetDefPattern is copied. Since it is passed as
+ // pWantedPattern, no special treatment of default is needed here anymore.
+ ScPatternAttr* pNewPattern = new ScPatternAttr( *pWantedPattern );
+ SfxItemSet* pSet = &pNewPattern->GetItemSet();
+ pSet->Put( *pItem );
+ SetPatternArea( nThisRow, nAttrRow, pNewPattern, sal_True );
+ delete pNewPattern;
+ }
+ else
+ {
+ if ( !bDefault )
+ {
+ if (bFirstUse)
+ bFirstUse = false;
+ else
+ // it's in the pool
+ pDocument->GetPool()->Put( *pWantedPattern );
+ }
+ SetPatternArea( nThisRow, nAttrRow, pWantedPattern );
+ }
+
+ Search( nThisRow, nIndex ); // data changed
+ }
+
+ ++nIndex;
+ nThisRow = pData[nIndex-1].nRow+1;
+ }
+}
+
+
+sal_Bool ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags )
+{
+ const ScPatternAttr* pOldPattern;
+
+ sal_Int16 nOldValue;
+ SCSIZE nIndex;
+ SCROW nRow;
+ SCROW nThisRow;
+ sal_Bool bChanged = false;
+
+ Search( nStartRow, nIndex );
+ nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ if (nThisRow < nStartRow) nThisRow = nStartRow;
+
+ while ( nThisRow <= nEndRow )
+ {
+ pOldPattern = pData[nIndex].pPattern;
+ nOldValue = ((const ScMergeFlagAttr*) &pOldPattern->GetItem( ATTR_MERGE_FLAG ))->GetValue();
+ if ( (nOldValue | nFlags) != nOldValue )
+ {
+ nRow = pData[nIndex].nRow;
+ SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
+ ScPatternAttr aNewPattern(*pOldPattern);
+ aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue | nFlags ) );
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
+ Search( nThisRow, nIndex ); // data changed
+ bChanged = true;
+ }
+
+ ++nIndex;
+ nThisRow = pData[nIndex-1].nRow+1;
+ }
+
+ return bChanged;
+}
+
+
+sal_Bool ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags )
+{
+ const ScPatternAttr* pOldPattern;
+
+ sal_Int16 nOldValue;
+ SCSIZE nIndex;
+ SCROW nRow;
+ SCROW nThisRow;
+ sal_Bool bChanged = false;
+
+ Search( nStartRow, nIndex );
+ nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ if (nThisRow < nStartRow) nThisRow = nStartRow;
+
+ while ( nThisRow <= nEndRow )
+ {
+ pOldPattern = pData[nIndex].pPattern;
+ nOldValue = ((const ScMergeFlagAttr*) &pOldPattern->GetItem( ATTR_MERGE_FLAG ))->GetValue();
+ if ( (nOldValue & ~nFlags) != nOldValue )
+ {
+ nRow = pData[nIndex].nRow;
+ SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
+ ScPatternAttr aNewPattern(*pOldPattern);
+ aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue & ~nFlags ) );
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
+ Search( nThisRow, nIndex ); // data changed
+ bChanged = true;
+ }
+
+ ++nIndex;
+ nThisRow = pData[nIndex-1].nRow+1;
+ }
+
+ return bChanged;
+}
+
+
+void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich )
+{
+ const ScPatternAttr* pOldPattern;
+
+ SCSIZE nIndex;
+ SCROW nRow;
+ SCROW nThisRow;
+
+ Search( nStartRow, nIndex );
+ nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ if (nThisRow < nStartRow) nThisRow = nStartRow;
+
+ while ( nThisRow <= nEndRow )
+ {
+ pOldPattern = pData[nIndex].pPattern;
+ if ( pOldPattern->HasItemsSet( pWhich ) )
+ {
+ ScPatternAttr aNewPattern(*pOldPattern);
+ aNewPattern.ClearItems( pWhich );
+
+ nRow = pData[nIndex].nRow;
+ SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
+ Search( nThisRow, nIndex ); // data changed
+ }
+
+ ++nIndex;
+ nThisRow = pData[nIndex-1].nRow+1;
+ }
+}
+
+
+void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, sal_Bool bIncrement )
+{
+ SCSIZE nIndex;
+ Search( nStartRow, nIndex );
+ SCROW nThisStart = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ if (nThisStart < nStartRow) nThisStart = nStartRow;
+
+ while ( nThisStart <= nEndRow )
+ {
+ const ScPatternAttr* pOldPattern = pData[nIndex].pPattern;
+ const SfxItemSet& rOldSet = pOldPattern->GetItemSet();
+ const SfxPoolItem* pItem;
+
+ sal_Bool bNeedJust = ( rOldSet.GetItemState( ATTR_HOR_JUSTIFY, false, &pItem ) != SFX_ITEM_SET
+ || ((const SvxHorJustifyItem*)pItem)->GetValue() != SVX_HOR_JUSTIFY_LEFT );
+ sal_uInt16 nOldValue = ((const SfxUInt16Item&)rOldSet.Get( ATTR_INDENT )).GetValue();
+ sal_uInt16 nNewValue = nOldValue;
+ if ( bIncrement )
+ {
+ if ( nNewValue < SC_MAX_INDENT )
+ {
+ nNewValue += SC_INDENT_STEP;
+ if ( nNewValue > SC_MAX_INDENT ) nNewValue = SC_MAX_INDENT;
+ }
+ }
+ else
+ {
+ if ( nNewValue > 0 )
+ {
+ if ( nNewValue > SC_INDENT_STEP )
+ nNewValue -= SC_INDENT_STEP;
+ else
+ nNewValue = 0;
+ }
+ }
+
+ if ( bNeedJust || nNewValue != nOldValue )
+ {
+ SCROW nThisEnd = pData[nIndex].nRow;
+ SCROW nAttrRow = Min( nThisEnd, nEndRow );
+ ScPatternAttr aNewPattern(*pOldPattern);
+ aNewPattern.GetItemSet().Put( SfxUInt16Item( ATTR_INDENT, nNewValue ) );
+ if ( bNeedJust )
+ aNewPattern.GetItemSet().Put(
+ SvxHorJustifyItem( SVX_HOR_JUSTIFY_LEFT, ATTR_HOR_JUSTIFY ) );
+ SetPatternArea( nThisStart, nAttrRow, &aNewPattern, sal_True );
+
+ nThisStart = nThisEnd + 1;
+ Search( nThisStart, nIndex ); // data changed
+ }
+ else
+ {
+ nThisStart = pData[nIndex].nRow + 1;
+ ++nIndex;
+ }
+ }
+}
+
+
+SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, sal_Bool bUp ) const
+{
+ long nRet = nRow;
+ if (VALIDROW(nRow))
+ {
+ SCSIZE nIndex;
+ Search(nRow, nIndex);
+ while (((const ScProtectionAttr&)pData[nIndex].pPattern->
+ GetItem(ATTR_PROTECTION)).GetProtection())
+ {
+ if (bUp)
+ {
+ if (nIndex==0)
+ return -1; // not found
+ --nIndex;
+ nRet = pData[nIndex].nRow;
+ }
+ else
+ {
+ nRet = pData[nIndex].nRow+1;
+ ++nIndex;
+ if (nIndex>=nCount)
+ return MAXROW+1; // not found
+ }
+ }
+ }
+ return nRet;
+}
+
+void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
+{
+ SCROW nStart = 0;
+ SCSIZE nPos = 0;
+ while (nPos < nCount)
+ {
+ SCROW nEnd = pData[nPos].nRow;
+ if (pData[nPos].pPattern->GetStyleSheet() == pStyleSheet)
+ {
+ rUsedRows.setTrue(nStart, nEnd);
+
+ if (bReset)
+ {
+ ScPatternAttr* pNewPattern = new ScPatternAttr(*pData[nPos].pPattern);
+ pDocument->GetPool()->Remove(*pData[nPos].pPattern);
+ pNewPattern->SetStyleSheet( (ScStyleSheet*)
+ pDocument->GetStyleSheetPool()->
+ Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD),
+ SFX_STYLE_FAMILY_PARA,
+ SFXSTYLEBIT_AUTO | SCSTYLEBIT_STANDARD ) );
+ pData[nPos].pPattern = (const ScPatternAttr*)
+ &pDocument->GetPool()->Put(*pNewPattern);
+ delete pNewPattern;
+
+ if (Concat(nPos))
+ {
+ Search(nStart, nPos);
+ --nPos; // because ++ at end
+ }
+ }
+ }
+ nStart = nEnd + 1;
+ ++nPos;
+ }
+}
+
+
+sal_Bool ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle,
+ sal_Bool bGatherAllStyles ) const
+{
+ sal_Bool bIsUsed = false;
+ SCSIZE nPos = 0;
+
+ while ( nPos < nCount )
+ {
+ const ScStyleSheet* pStyle = pData[nPos].pPattern->GetStyleSheet();
+ if ( pStyle )
+ {
+ pStyle->SetUsage( ScStyleSheet::USED );
+ if ( pStyle == &rStyle )
+ {
+ if ( !bGatherAllStyles )
+ return sal_True;
+ bIsUsed = sal_True;
+ }
+ }
+ nPos++;
+ }
+
+ return bIsUsed;
+}
+
+
+sal_Bool ScAttrArray::IsEmpty() const
+{
+ if (nCount == 1)
+ {
+ if ( pData[0].pPattern != pDocument->GetDefPattern() )
+ return false;
+ else
+ return sal_True;
+ }
+ else
+ return false;
+}
+
+
+sal_Bool ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const
+{
+ DBG_ASSERT( nCount, "nCount == 0" );
+
+ sal_Bool bFound = false;
+ SCSIZE nStart = 0;
+
+ // Skip first entry if more than 1 row.
+ // Entries at the end are not skipped, GetFirstVisibleAttr may be larger than GetLastVisibleAttr.
+
+ SCSIZE nVisStart = 1;
+ while ( nVisStart < nCount && pData[nVisStart].pPattern->IsVisibleEqual(*pData[nVisStart-1].pPattern) )
+ ++nVisStart;
+ if ( nVisStart >= nCount || pData[nVisStart-1].nRow > 0 ) // more than 1 row?
+ nStart = nVisStart;
+
+ while ( nStart < nCount && !bFound )
+ {
+ if ( pData[nStart].pPattern->IsVisible() )
+ {
+ rFirstRow = nStart ? ( pData[nStart-1].nRow + 1 ) : 0;
+ bFound = sal_True;
+ }
+ else
+ ++nStart;
+ }
+
+ return bFound;
+}
+
+// size (rows) of a range of attributes after cell content where the search is stopped
+// (more than a default page size, 2*42 because it's as good as any number)
+
+const SCROW SC_VISATTR_STOP = 84;
+
+sal_Bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const
+{
+ // #i30830# changed behavior:
+ // ignore all attributes starting with the first run of SC_VISATTR_STOP equal rows
+ // below the last content cell
+
+ if ( nLastData == MAXROW )
+ {
+ rLastRow = MAXROW; // can't look for attributes below MAXROW
+ return sal_True;
+ }
+
+ sal_Bool bFound = false;
+
+ // loop backwards from the end instead of using Search, assuming that
+ // there usually aren't many attributes below the last cell
+
+ SCSIZE nPos = nCount;
+ while ( nPos > 0 && pData[nPos-1].nRow > nLastData )
+ {
+ SCSIZE nEndPos = nPos - 1;
+ SCSIZE nStartPos = nEndPos; // find range of visually equal formats
+ while ( nStartPos > 0 &&
+ pData[nStartPos-1].nRow > nLastData &&
+ pData[nStartPos-1].pPattern->IsVisibleEqual(*pData[nStartPos].pPattern) )
+ --nStartPos;
+
+ SCROW nAttrStartRow = ( nStartPos > 0 ) ? ( pData[nStartPos-1].nRow + 1 ) : 0;
+ if ( nAttrStartRow <= nLastData )
+ nAttrStartRow = nLastData + 1;
+ SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow;
+ if ( nAttrSize >= SC_VISATTR_STOP )
+ {
+ bFound = false; // ignore this range and below
+ }
+ else if ( !bFound && pData[nEndPos].pPattern->IsVisible() )
+ {
+ rLastRow = pData[nEndPos].nRow;
+ bFound = sal_True;
+ }
+
+ nPos = nStartPos; // look further from the top of the range
+ }
+
+ return bFound;
+}
+
+
+sal_Bool ScAttrArray::HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const
+{
+ SCSIZE nIndex;
+ Search( nStartRow, nIndex );
+ SCROW nThisStart = nStartRow;
+ sal_Bool bFound = false;
+ while ( nIndex < nCount && nThisStart <= nEndRow && !bFound )
+ {
+ if ( pData[nIndex].pPattern->IsVisible() )
+ bFound = sal_True;
+
+ nThisStart = pData[nIndex].nRow + 1;
+ ++nIndex;
+ }
+
+ return bFound;
+}
+
+
+sal_Bool ScAttrArray::IsVisibleEqual( const ScAttrArray& rOther,
+ SCROW nStartRow, SCROW nEndRow ) const
+{
+ sal_Bool bEqual = sal_True;
+ SCSIZE nThisPos = 0;
+ SCSIZE nOtherPos = 0;
+ if ( nStartRow > 0 )
+ {
+ Search( nStartRow, nThisPos );
+ rOther.Search( nStartRow, nOtherPos );
+ }
+
+ while ( nThisPos<nCount && nOtherPos<rOther.nCount && bEqual )
+ {
+ SCROW nThisRow = pData[nThisPos].nRow;
+ SCROW nOtherRow = rOther.pData[nOtherPos].nRow;
+ const ScPatternAttr* pThisPattern = pData[nThisPos].pPattern;
+ const ScPatternAttr* pOtherPattern = rOther.pData[nOtherPos].pPattern;
+ bEqual = ( pThisPattern == pOtherPattern ||
+ pThisPattern->IsVisibleEqual(*pOtherPattern) );
+
+ if ( nThisRow >= nOtherRow )
+ {
+ if ( nOtherRow >= nEndRow ) break;
+ ++nOtherPos;
+ }
+ if ( nThisRow <= nOtherRow )
+ {
+ if ( nThisRow >= nEndRow ) break;
+ ++nThisPos;
+ }
+ }
+
+ return bEqual;
+}
+
+
+sal_Bool ScAttrArray::IsAllEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const
+{
+ // summarised with IsVisibleEqual
+
+ sal_Bool bEqual = sal_True;
+ SCSIZE nThisPos = 0;
+ SCSIZE nOtherPos = 0;
+ if ( nStartRow > 0 )
+ {
+ Search( nStartRow, nThisPos );
+ rOther.Search( nStartRow, nOtherPos );
+ }
+
+ while ( nThisPos<nCount && nOtherPos<rOther.nCount && bEqual )
+ {
+ SCROW nThisRow = pData[nThisPos].nRow;
+ SCROW nOtherRow = rOther.pData[nOtherPos].nRow;
+ const ScPatternAttr* pThisPattern = pData[nThisPos].pPattern;
+ const ScPatternAttr* pOtherPattern = rOther.pData[nOtherPos].pPattern;
+ bEqual = ( pThisPattern == pOtherPattern );
+
+ if ( nThisRow >= nOtherRow )
+ {
+ if ( nOtherRow >= nEndRow ) break;
+ ++nOtherPos;
+ }
+ if ( nThisRow <= nOtherRow )
+ {
+ if ( nThisRow >= nEndRow ) break;
+ ++nThisPos;
+ }
+ }
+
+ return bEqual;
+}
+
+
+sal_Bool ScAttrArray::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
+{
+ // Horizontal aggregate are not allowed to be moved out; if whole summary,
+ // here is not recognized
+
+ sal_Bool bTest = sal_True;
+ if (!IsEmpty())
+ {
+ SCSIZE nIndex = 0;
+ if ( nStartRow > 0 )
+ Search( nStartRow, nIndex );
+
+ for ( ; nIndex < nCount; nIndex++ )
+ {
+ if ( ((const ScMergeFlagAttr&)pData[nIndex].pPattern->
+ GetItem(ATTR_MERGE_FLAG)).IsHorOverlapped() )
+ {
+ bTest = false; // may not be pushed out
+ break;
+ }
+ if ( pData[nIndex].nRow >= nEndRow ) // end of range
+ break;
+ }
+ }
+ return bTest;
+}
+
+
+sal_Bool ScAttrArray::TestInsertRow( SCSIZE nSize ) const
+{
+ // if 1st row pushed out is vertically overlapped, summary would be broken
+
+ if (pData)
+ {
+ // MAXROW + 1 - nSize = 1st row pushed out
+
+ SCSIZE nFirstLost = nCount-1;
+ while ( nFirstLost && pData[nFirstLost-1].nRow >= sal::static_int_cast<SCROW>(MAXROW + 1 - nSize) )
+ --nFirstLost;
+
+ if ( ((const ScMergeFlagAttr&)pData[nFirstLost].pPattern->
+ GetItem(ATTR_MERGE_FLAG)).IsVerOverlapped() )
+ return false;
+ }
+
+ return sal_True;
+}
+
+
+void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize )
+{
+ if (!pData)
+ return;
+
+ SCROW nSearch = nStartRow > 0 ? nStartRow - 1 : 0; // expand predecessor
+ SCSIZE nIndex;
+ Search( nSearch, nIndex );
+
+ // set ScMergeAttr may not be extended (so behind delete again)
+
+ sal_Bool bDoMerge = ((const ScMergeAttr&) pData[nIndex].pPattern->GetItem(ATTR_MERGE)).IsMerged();
+
+ SCSIZE nRemove = 0;
+ SCSIZE i;
+ for (i = nIndex; i < nCount-1; i++)
+ {
+ SCROW nNew = pData[i].nRow + nSize;
+ if ( nNew >= MAXROW ) // at end?
+ {
+ nNew = MAXROW;
+ if (!nRemove)
+ nRemove = i+1; // remove the following?
+ }
+ pData[i].nRow = nNew;
+ }
+
+ // Remove entries at end ?
+
+ if (nRemove && nRemove < nCount)
+ DeleteRange( nRemove, nCount-1 );
+
+ if (bDoMerge) // extensively repair (again) ScMergeAttr
+ {
+ // ApplyAttr for areas
+
+ const SfxPoolItem& rDef = pDocument->GetPool()->GetDefaultItem( ATTR_MERGE );
+ for (SCSIZE nAdd=0; nAdd<nSize; nAdd++)
+ pDocument->ApplyAttr( nCol, nStartRow+nAdd, nTab, rDef );
+
+ // reply inserts in this area not summarized
+ }
+
+ // Don't duplicate the merge flags in the inserted row.
+ // #i108488# SC_MF_SCENARIO has to be allowed.
+ RemoveFlags( nStartRow, nStartRow+nSize-1, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO | SC_MF_BUTTON );
+}
+
+
+void ScAttrArray::DeleteRow( SCROW nStartRow, SCSIZE nSize )
+{
+ if (pData)
+ {
+ sal_Bool bFirst=sal_True;
+ SCSIZE nStartIndex = 0;
+ SCSIZE nEndIndex = 0;
+ SCSIZE i;
+
+ for ( i = 0; i < nCount-1; i++)
+ if (pData[i].nRow >= nStartRow && pData[i].nRow <= sal::static_int_cast<SCROW>(nStartRow+nSize-1))
+ {
+ if (bFirst)
+ {
+ nStartIndex = i;
+ bFirst = false;
+ }
+ nEndIndex = i;
+ }
+ if (!bFirst)
+ {
+ SCROW nStart;
+ if (nStartIndex==0)
+ nStart = 0;
+ else
+ nStart = pData[nStartIndex-1].nRow + 1;
+
+ if (nStart < nStartRow)
+ {
+ pData[nStartIndex].nRow = nStartRow - 1;
+ ++nStartIndex;
+ }
+ if (nEndIndex >= nStartIndex)
+ {
+ DeleteRange( nStartIndex, nEndIndex );
+ if (nStartIndex > 0)
+ if ( pData[nStartIndex-1].pPattern == pData[nStartIndex].pPattern )
+ DeleteRange( nStartIndex-1, nStartIndex-1 );
+ }
+ }
+ for (i = 0; i < nCount-1; i++)
+ if (pData[i].nRow >= nStartRow)
+ pData[i].nRow -= nSize;
+
+ // Below does not follow the pattern to detect pressure ranges;
+ // instead, only remove merge flags.
+ RemoveFlags( MAXROW-nSize+1, MAXROW, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO );
+ }
+}
+
+
+void ScAttrArray::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex )
+{
+ ScDocumentPool* pDocPool = pDocument->GetPool();
+ for (SCSIZE i = nStartIndex; i <= nEndIndex; i++)
+ pDocPool->Remove(*pData[i].pPattern);
+
+ memmove( &pData[nStartIndex], &pData[nEndIndex + 1], (nCount - nEndIndex - 1) * sizeof(ScAttrEntry) );
+ nCount -= nEndIndex-nStartIndex+1;
+}
+
+
+void ScAttrArray::DeleteArea(SCROW nStartRow, SCROW nEndRow)
+{
+ RemoveAreaMerge( nStartRow, nEndRow ); // remove from combined flags
+
+ if ( !HasAttrib( nStartRow, nEndRow, HASATTR_OVERLAPPED | HASATTR_AUTOFILTER) )
+ SetPatternArea( nStartRow, nEndRow, pDocument->GetDefPattern() );
+ else
+ DeleteAreaSafe( nStartRow, nEndRow ); // leave merge flags
+}
+
+
+void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
+{
+ const ScPatternAttr* pDefPattern = pDocument->GetDefPattern();
+ const ScPatternAttr* pOldPattern;
+
+ SCSIZE nIndex;
+ SCROW nRow;
+ SCROW nThisRow;
+
+ Search( nStartRow, nIndex );
+ nThisRow = (nIndex>0) ? pData[nIndex-1].nRow+1 : 0;
+ if (nThisRow < nStartRow) nThisRow = nStartRow;
+
+ while ( nThisRow <= nEndRow )
+ {
+ pOldPattern = pData[nIndex].pPattern;
+
+ if ( pOldPattern->GetItemSet().Count() ) // hard attributes ?
+ {
+ nRow = pData[nIndex].nRow;
+ SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow );
+
+ ScPatternAttr aNewPattern(*pOldPattern);
+ SfxItemSet& rSet = aNewPattern.GetItemSet();
+ for (sal_uInt16 nId = ATTR_PATTERN_START; nId <= ATTR_PATTERN_END; nId++)
+ if (nId != ATTR_MERGE && nId != ATTR_MERGE_FLAG)
+ rSet.ClearItem(nId);
+
+ if ( aNewPattern == *pDefPattern )
+ SetPatternArea( nThisRow, nAttrRow, pDefPattern, false );
+ else
+ SetPatternArea( nThisRow, nAttrRow, &aNewPattern, sal_True );
+
+ Search( nThisRow, nIndex ); // data changed
+ }
+
+ ++nIndex;
+ nThisRow = pData[nIndex-1].nRow+1;
+ }
+}
+
+
+// move within a document
+
+void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray)
+{
+ SCROW nStart = nStartRow;
+ for (SCSIZE i = 0; i < nCount; i++)
+ {
+ if ((pData[i].nRow >= nStartRow) && ((i==0) ? sal_True : pData[i-1].nRow < nEndRow))
+ {
+ // copy (bPutToPool=TRUE)
+ rAttrArray.SetPatternArea( nStart, Min( (SCROW)pData[i].nRow, (SCROW)nEndRow ),
+ pData[i].pPattern, sal_True );
+ }
+ nStart = Max( (SCROW)nStart, (SCROW)(pData[i].nRow + 1) );
+ }
+ DeleteArea(nStartRow, nEndRow);
+}
+
+
+// copy between documents (Clipboard)
+
+void ScAttrArray::CopyArea( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray,
+ sal_Int16 nStripFlags )
+{
+ nStartRow -= nDy; // Source
+ nEndRow -= nDy;
+
+ SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0);
+ SCROW nDestEnd = Min((long)((long)nEndRow + nDy), (long) MAXROW);
+
+ ScDocumentPool* pSourceDocPool = pDocument->GetPool();
+ ScDocumentPool* pDestDocPool = rAttrArray.pDocument->GetPool();
+ sal_Bool bSamePool = (pSourceDocPool==pDestDocPool);
+
+ for (SCSIZE i = 0; (i < nCount) && (nDestStart <= nDestEnd); i++)
+ {
+ if (pData[i].nRow >= nStartRow)
+ {
+ const ScPatternAttr* pOldPattern = pData[i].pPattern;
+ const ScPatternAttr* pNewPattern;
+
+ if (IsDefaultItem( pOldPattern ))
+ {
+ // default: nothing changed
+
+ pNewPattern = (const ScPatternAttr*)
+ &pDestDocPool->GetDefaultItem( ATTR_PATTERN );
+ }
+ else if ( nStripFlags )
+ {
+ ScPatternAttr* pTmpPattern = new ScPatternAttr( *pOldPattern );
+ sal_Int16 nNewFlags = 0;
+ if ( nStripFlags != SC_MF_ALL )
+ nNewFlags = ((const ScMergeFlagAttr&)pTmpPattern->GetItem(ATTR_MERGE_FLAG)).
+ GetValue() & ~nStripFlags;
+
+ if ( nNewFlags )
+ pTmpPattern->GetItemSet().Put( ScMergeFlagAttr( nNewFlags ) );
+ else
+ pTmpPattern->GetItemSet().ClearItem( ATTR_MERGE_FLAG );
+
+ if (bSamePool)
+ pNewPattern = (ScPatternAttr*) &pDestDocPool->Put(*pTmpPattern);
+ else
+ pNewPattern = pTmpPattern->PutInPool( rAttrArray.pDocument, pDocument );
+ delete pTmpPattern;
+ }
+ else
+ {
+ if (bSamePool)
+ pNewPattern = (ScPatternAttr*) &pDestDocPool->Put(*pOldPattern);
+ else
+ pNewPattern = pOldPattern->PutInPool( rAttrArray.pDocument, pDocument );
+ }
+
+ rAttrArray.SetPatternArea(nDestStart,
+ Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern);
+ }
+
+ // when pasting from clipboard and skipping filtered rows, the adjusted
+ // end position can be negative
+ nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1));
+ }
+}
+
+
+// leave flags
+// summarized with CopyArea
+
+void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray )
+{
+ nStartRow -= nDy; // Source
+ nEndRow -= nDy;
+
+ SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0);
+ SCROW nDestEnd = Min((long)((long)nEndRow + nDy), (long) MAXROW);
+
+ if ( !rAttrArray.HasAttrib( nDestStart, nDestEnd, HASATTR_OVERLAPPED ) )
+ {
+ CopyArea( nStartRow+nDy, nEndRow+nDy, nDy, rAttrArray );
+ return;
+ }
+
+ ScDocumentPool* pSourceDocPool = pDocument->GetPool();
+ ScDocumentPool* pDestDocPool = rAttrArray.pDocument->GetPool();
+ sal_Bool bSamePool = (pSourceDocPool==pDestDocPool);
+
+ for (SCSIZE i = 0; (i < nCount) && (nDestStart <= nDestEnd); i++)
+ {
+ if (pData[i].nRow >= nStartRow)
+ {
+ const ScPatternAttr* pOldPattern = pData[i].pPattern;
+ const ScPatternAttr* pNewPattern;
+
+ if (bSamePool)
+ pNewPattern = (ScPatternAttr*) &pDestDocPool->Put(*pOldPattern);
+ else
+ pNewPattern = pOldPattern->PutInPool( rAttrArray.pDocument, pDocument );
+
+ rAttrArray.SetPatternAreaSafe(nDestStart,
+ Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, false);
+ }
+
+ // when pasting from clipboard and skipping filtered rows, the adjusted
+ // end position can be negative
+ nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1));
+ }
+}
+
+
+SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle,
+ sal_Bool bUp, ScMarkArray* pMarkArray )
+{
+ sal_Bool bFound = false;
+
+ if (pMarkArray)
+ {
+ nRow = pMarkArray->GetNextMarked( nRow, bUp );
+ if (!VALIDROW(nRow))
+ return nRow;
+ }
+
+ SCSIZE nIndex;
+ Search(nRow, nIndex);
+ const ScPatternAttr* pPattern = pData[nIndex].pPattern;
+
+ while (nIndex < nCount && !bFound)
+ {
+ if (pPattern->GetStyleSheet() == pSearchStyle)
+ {
+ if (pMarkArray)
+ {
+ nRow = pMarkArray->GetNextMarked( nRow, bUp );
+ SCROW nStart = nIndex ? pData[nIndex-1].nRow+1 : 0;
+ if (nRow >= nStart && nRow <= pData[nIndex].nRow)
+ bFound = sal_True;
+ }
+ else
+ bFound = sal_True;
+ }
+
+ if (!bFound)
+ {
+ if (bUp)
+ {
+ if (nIndex==0)
+ {
+ nIndex = nCount;
+ nRow = -1;
+ }
+ else
+ {
+ --nIndex;
+ nRow = pData[nIndex].nRow;
+ pPattern = pData[nIndex].pPattern;
+ }
+ }
+ else
+ {
+ nRow = pData[nIndex].nRow+1;
+ ++nIndex;
+ if (nIndex<nCount)
+ pPattern = pData[nIndex].pPattern;
+ }
+ }
+ }
+
+ DBG_ASSERT( bFound || !ValidRow(nRow), "Internal failure in in ScAttrArray::SearchStyle" );
+
+ return nRow;
+}
+
+
+sal_Bool ScAttrArray::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow,
+ const ScStyleSheet* pSearchStyle, sal_Bool bUp, ScMarkArray* pMarkArray )
+{
+ SCsROW nStartRow = SearchStyle( rRow, pSearchStyle, bUp, pMarkArray );
+ if (VALIDROW(nStartRow))
+ {
+ SCSIZE nIndex;
+ Search(nStartRow,nIndex);
+
+ rRow = nStartRow;
+ if (bUp)
+ {
+ if (nIndex>0)
+ rEndRow = pData[nIndex-1].nRow + 1;
+ else
+ rEndRow = 0;
+ if (pMarkArray)
+ {
+ SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, sal_True );
+ if (nMarkEnd>rEndRow)
+ rEndRow = nMarkEnd;
+ }
+ }
+ else
+ {
+ rEndRow = pData[nIndex].nRow;
+ if (pMarkArray)
+ {
+ SCROW nMarkEnd = pMarkArray->GetMarkEnd( nStartRow, false );
+ if (nMarkEnd<rEndRow)
+ rEndRow = nMarkEnd;
+ }
+ }
+
+ return sal_True;
+ }
+ else
+ return false;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
new file mode 100644
index 000000000000..5de173eec222
--- /dev/null
+++ b/sc/source/core/data/attrib.cxx
@@ -0,0 +1,1233 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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_sc.hxx"
+
+
+
+// INCLUDE ---------------------------------------------------------------
+
+
+#include <com/sun/star/util/CellProtection.hpp>
+#include <com/sun/star/util/XProtectable.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include "scitems.hxx"
+#include <editeng/eeitem.hxx>
+
+#include <editeng/boxitem.hxx>
+#include <editeng/editdata.hxx>
+#include <editeng/editeng.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/flditem.hxx>
+
+#include "attrib.hxx"
+#include "global.hxx"
+#include "editutil.hxx"
+#include "sc.hrc"
+#include "globstr.hrc"
+
+#include "textuno.hxx" // ScHeaderFooterContentObj
+
+using namespace com::sun::star;
+
+//------------------------------------------------------------------------
+
+TYPEINIT1(ScMergeAttr, SfxPoolItem);
+TYPEINIT1_AUTOFACTORY(ScProtectionAttr, SfxPoolItem);
+TYPEINIT1(ScRangeItem, SfxPoolItem);
+TYPEINIT1(ScTableListItem, SfxPoolItem);
+TYPEINIT1(ScPageHFItem, SfxPoolItem);
+TYPEINIT1(ScViewObjectModeItem, SfxEnumItem);
+TYPEINIT1(ScDoubleItem, SfxPoolItem);
+TYPEINIT1(ScPageScaleToItem, SfxPoolItem);
+
+//------------------------------------------------------------------------
+
+//
+// allgemeine Hilfsfunktionen
+//
+
+sal_Bool ScHasPriority( const ::editeng::SvxBorderLine* pThis, const ::editeng::SvxBorderLine* pOther )
+{
+
+ if (!pThis)
+ return false;
+ if (!pOther)
+ return sal_True;
+
+ sal_uInt16 nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth();
+ sal_uInt16 nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth();
+
+ if (nThisSize > nOtherSize)
+ return sal_True;
+ else if (nThisSize < nOtherSize)
+ return false;
+ else
+ {
+ if ( pOther->GetInWidth() && !pThis->GetInWidth() )
+ return sal_True;
+ else if ( pThis->GetInWidth() && !pOther->GetInWidth() )
+ return false;
+ else
+ {
+ return sal_True; //! ???
+ }
+ }
+}
+
+
+//
+// Item - Implementierungen
+//
+
+//------------------------------------------------------------------------
+// Merge
+//------------------------------------------------------------------------
+
+ScMergeAttr::ScMergeAttr():
+ SfxPoolItem(ATTR_MERGE),
+ nColMerge(0),
+ nRowMerge(0)
+{}
+
+//------------------------------------------------------------------------
+
+ScMergeAttr::ScMergeAttr( SCsCOL nCol, SCsROW nRow):
+ SfxPoolItem(ATTR_MERGE),
+ nColMerge(nCol),
+ nRowMerge(nRow)
+{}
+
+//------------------------------------------------------------------------
+
+ScMergeAttr::ScMergeAttr(const ScMergeAttr& rItem):
+ SfxPoolItem(ATTR_MERGE)
+{
+ nColMerge = rItem.nColMerge;
+ nRowMerge = rItem.nRowMerge;
+}
+
+ScMergeAttr::~ScMergeAttr()
+{
+}
+
+//------------------------------------------------------------------------
+
+String ScMergeAttr::GetValueText() const
+{
+ String aString( '(' );
+ aString += String::CreateFromInt32( nColMerge );
+ aString += ',';
+ aString += String::CreateFromInt32( nRowMerge );
+ aString += ')';
+ return aString;
+}
+
+//------------------------------------------------------------------------
+
+int ScMergeAttr::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_ASSERT( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" );
+ return (Which() == rItem.Which())
+ && (nColMerge == ((ScMergeAttr&)rItem).nColMerge)
+ && (nRowMerge == ((ScMergeAttr&)rItem).nRowMerge);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScMergeAttr::Clone( SfxItemPool * ) const
+{
+ return new ScMergeAttr(*this);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const
+{
+ sal_Int16 nCol;
+ sal_Int16 nRow;
+ rStream >> nCol;
+ rStream >> nRow;
+ return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow));
+}
+
+//------------------------------------------------------------------------
+// MergeFlag
+//------------------------------------------------------------------------
+
+ScMergeFlagAttr::ScMergeFlagAttr():
+ SfxInt16Item(ATTR_MERGE_FLAG, 0)
+{
+}
+
+//------------------------------------------------------------------------
+
+ScMergeFlagAttr::ScMergeFlagAttr(sal_Int16 nFlags):
+ SfxInt16Item(ATTR_MERGE_FLAG, nFlags)
+{
+}
+
+ScMergeFlagAttr::~ScMergeFlagAttr()
+{
+}
+
+//------------------------------------------------------------------------
+// Protection
+//------------------------------------------------------------------------
+
+ScProtectionAttr::ScProtectionAttr():
+ SfxPoolItem(ATTR_PROTECTION),
+ bProtection(sal_True),
+ bHideFormula(false),
+ bHideCell(false),
+ bHidePrint(false)
+{
+}
+
+//------------------------------------------------------------------------
+
+ScProtectionAttr::ScProtectionAttr( sal_Bool bProtect, sal_Bool bHFormula,
+ sal_Bool bHCell, sal_Bool bHPrint):
+ SfxPoolItem(ATTR_PROTECTION),
+ bProtection(bProtect),
+ bHideFormula(bHFormula),
+ bHideCell(bHCell),
+ bHidePrint(bHPrint)
+{
+}
+
+//------------------------------------------------------------------------
+
+ScProtectionAttr::ScProtectionAttr(const ScProtectionAttr& rItem):
+ SfxPoolItem(ATTR_PROTECTION)
+{
+ bProtection = rItem.bProtection;
+ bHideFormula = rItem.bHideFormula;
+ bHideCell = rItem.bHideCell;
+ bHidePrint = rItem.bHidePrint;
+}
+
+ScProtectionAttr::~ScProtectionAttr()
+{
+}
+
+//------------------------------------------------------------------------
+
+bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+{
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
+ {
+ case 0 :
+ {
+ util::CellProtection aProtection;
+ aProtection.IsLocked = bProtection;
+ aProtection.IsFormulaHidden = bHideFormula;
+ aProtection.IsHidden = bHideCell;
+ aProtection.IsPrintHidden = bHidePrint;
+ rVal <<= aProtection;
+ break;
+ }
+ case MID_1 :
+ rVal <<= (sal_Bool ) bProtection; break;
+ case MID_2 :
+ rVal <<= (sal_Bool ) bHideFormula; break;
+ case MID_3 :
+ rVal <<= (sal_Bool ) bHideCell; break;
+ case MID_4 :
+ rVal <<= (sal_Bool ) bHidePrint; break;
+ default:
+ OSL_FAIL("Wrong MemberID!");
+ return false;
+ }
+
+ return true;
+}
+
+bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+{
+ bool bRet = false;
+ sal_Bool bVal = sal_Bool();
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
+ {
+ case 0 :
+ {
+ util::CellProtection aProtection;
+ if ( rVal >>= aProtection )
+ {
+ bProtection = aProtection.IsLocked;
+ bHideFormula = aProtection.IsFormulaHidden;
+ bHideCell = aProtection.IsHidden;
+ bHidePrint = aProtection.IsPrintHidden;
+ bRet = true;
+ }
+ else
+ {
+ OSL_FAIL("exception - wrong argument");
+ }
+ break;
+ }
+ case MID_1 :
+ bRet = (rVal >>= bVal); if (bRet) bProtection=bVal; break;
+ case MID_2 :
+ bRet = (rVal >>= bVal); if (bRet) bHideFormula=bVal; break;
+ case MID_3 :
+ bRet = (rVal >>= bVal); if (bRet) bHideCell=bVal; break;
+ case MID_4 :
+ bRet = (rVal >>= bVal); if (bRet) bHidePrint=bVal; break;
+ default:
+ OSL_FAIL("Wrong MemberID!");
+ }
+
+ return bRet;
+}
+
+//------------------------------------------------------------------------
+
+String ScProtectionAttr::GetValueText() const
+{
+ String aValue;
+ String aStrYes ( ScGlobal::GetRscString(STR_YES) );
+ String aStrNo ( ScGlobal::GetRscString(STR_NO) );
+ sal_Unicode cDelim = ',';
+
+ aValue = '(';
+ aValue += (bProtection ? aStrYes : aStrNo); aValue += cDelim;
+ aValue += (bHideFormula ? aStrYes : aStrNo); aValue += cDelim;
+ aValue += (bHideCell ? aStrYes : aStrNo); aValue += cDelim;
+ aValue += (bHidePrint ? aStrYes : aStrNo);
+ aValue += ')';
+
+ return aValue;
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation ScProtectionAttr::GetPresentation
+ (
+ SfxItemPresentation ePres,
+ SfxMapUnit /* eCoreMetric */,
+ SfxMapUnit /* ePresMetric */,
+ String& rText,
+ const IntlWrapper* /* pIntl */
+ ) const
+{
+ String aStrYes ( ScGlobal::GetRscString(STR_YES) );
+ String aStrNo ( ScGlobal::GetRscString(STR_NO) );
+ String aStrSep = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
+ String aStrDelim = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( ", " ));
+
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ rText.Erase();
+ break;
+
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ rText = GetValueText();
+ break;
+
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText = ScGlobal::GetRscString(STR_PROTECTION); rText += aStrSep;
+ rText += (bProtection ? aStrYes : aStrNo); rText += aStrDelim;
+ rText += ScGlobal::GetRscString(STR_FORMULAS); rText += aStrSep;
+ rText += (!bHideFormula ? aStrYes : aStrNo); rText += aStrDelim;
+ rText += ScGlobal::GetRscString(STR_HIDE); rText += aStrSep;
+ rText += (bHideCell ? aStrYes : aStrNo); rText += aStrDelim;
+ rText += ScGlobal::GetRscString(STR_PRINT); rText += aStrSep;
+ rText += (!bHidePrint ? aStrYes : aStrNo);
+ break;
+
+ default:
+ ePres = SFX_ITEM_PRESENTATION_NONE;
+ }
+
+ return ePres;
+}
+
+//------------------------------------------------------------------------
+
+int ScProtectionAttr::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_ASSERT( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" );
+ return (Which() == rItem.Which())
+ && (bProtection == ((ScProtectionAttr&)rItem).bProtection)
+ && (bHideFormula == ((ScProtectionAttr&)rItem).bHideFormula)
+ && (bHideCell == ((ScProtectionAttr&)rItem).bHideCell)
+ && (bHidePrint == ((ScProtectionAttr&)rItem).bHidePrint);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScProtectionAttr::Clone( SfxItemPool * ) const
+{
+ return new ScProtectionAttr(*this);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, sal_uInt16 /* n */ ) const
+{
+ sal_Bool bProtect;
+ sal_Bool bHFormula;
+ sal_Bool bHCell;
+ sal_Bool bHPrint;
+
+ rStream >> bProtect;
+ rStream >> bHFormula;
+ rStream >> bHCell;
+ rStream >> bHPrint;
+
+ return new ScProtectionAttr(bProtect,bHFormula,bHCell,bHPrint);
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool ScProtectionAttr::SetProtection( sal_Bool bProtect)
+{
+ bProtection = bProtect;
+ return sal_True;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool ScProtectionAttr::SetHideFormula( sal_Bool bHFormula)
+{
+ bHideFormula = bHFormula;
+ return sal_True;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool ScProtectionAttr::SetHideCell( sal_Bool bHCell)
+{
+ bHideCell = bHCell;
+ return sal_True;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool ScProtectionAttr::SetHidePrint( sal_Bool bHPrint)
+{
+ bHidePrint = bHPrint;
+ return sal_True;
+}
+
+// -----------------------------------------------------------------------
+// ScRangeItem - Tabellenbereich
+// -----------------------------------------------------------------------
+
+int ScRangeItem::operator==( const SfxPoolItem& rAttr ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+
+ return ( aRange == ( (ScRangeItem&)rAttr ).aRange );
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* ScRangeItem::Clone( SfxItemPool* ) const
+{
+ return new ScRangeItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation ScRangeItem::GetPresentation
+ (
+ SfxItemPresentation ePres,
+ SfxMapUnit /* eCoreUnit */,
+ SfxMapUnit /* ePresUnit */,
+ String& rText,
+ const IntlWrapper* /* pIntl */
+ ) const
+{
+ rText.Erase();
+
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText = ScGlobal::GetRscString(STR_AREA);
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
+ /* !!! fall-through !!! */
+
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ {
+ String aText;
+ /* Always use OOo:A1 format */
+ aRange.Format( aText );
+ rText += aText;
+ }
+ break;
+
+ default:
+ {
+ // added to avoid warnings
+ }
+ }
+
+ return ePres;
+}
+
+// -----------------------------------------------------------------------
+// ScTableListItem - Liste von Tabellen(-nummern)
+// -----------------------------------------------------------------------
+
+ScTableListItem::ScTableListItem( const ScTableListItem& rCpy )
+ : SfxPoolItem ( rCpy.Which() ),
+ nCount ( rCpy.nCount )
+{
+ if ( nCount > 0 )
+ {
+ pTabArr = new SCTAB [nCount];
+
+ for ( sal_uInt16 i=0; i<nCount; i++ )
+ pTabArr[i] = rCpy.pTabArr[i];
+ }
+ else
+ pTabArr = NULL;
+}
+
+// -----------------------------------------------------------------------
+
+
+ScTableListItem::~ScTableListItem()
+{
+ delete [] pTabArr;
+}
+
+// -----------------------------------------------------------------------
+
+ScTableListItem& ScTableListItem::operator=( const ScTableListItem& rCpy )
+{
+ delete [] pTabArr;
+
+ if ( rCpy.nCount > 0 )
+ {
+ pTabArr = new SCTAB [rCpy.nCount];
+ for ( sal_uInt16 i=0; i<rCpy.nCount; i++ )
+ pTabArr[i] = rCpy.pTabArr[i];
+ }
+ else
+ pTabArr = NULL;
+
+ nCount = rCpy.nCount;
+
+ return *this;
+}
+
+// -----------------------------------------------------------------------
+
+int ScTableListItem::operator==( const SfxPoolItem& rAttr ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+
+ ScTableListItem& rCmp = (ScTableListItem&)rAttr;
+ sal_Bool bEqual = (nCount == rCmp.nCount);
+
+ if ( nCount > 0 )
+ {
+ sal_uInt16 i=0;
+
+ bEqual = ( pTabArr && rCmp.pTabArr );
+
+ while ( bEqual && i<nCount )
+ {
+ bEqual = ( pTabArr[i] == rCmp.pTabArr[i] );
+ i++;
+ }
+ }
+ return bEqual;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* ScTableListItem::Clone( SfxItemPool* ) const
+{
+ return new ScTableListItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation ScTableListItem::GetPresentation
+ (
+ SfxItemPresentation ePres,
+ SfxMapUnit /* eCoreUnit */,
+ SfxMapUnit /* ePresUnit */,
+ String& rText,
+ const IntlWrapper* /* pIntl */
+ ) const
+{
+ const sal_Unicode cDelim = ',';
+
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ rText.Erase();
+ return ePres;
+
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ {
+ rText = '(';
+ if ( nCount>0 && pTabArr )
+ for ( sal_uInt16 i=0; i<nCount; i++ )
+ {
+ rText += String::CreateFromInt32( pTabArr[i] );
+ if ( i<(nCount-1) )
+ rText += cDelim;
+ }
+ rText += ')';
+ }
+ return ePres;
+
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+
+ default:
+ {
+ // added to avoid warnings
+ }
+ }
+
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+
+// -----------------------------------------------------------------------
+// ScPageHFItem - Daten der Kopf-/Fusszeilen
+// -----------------------------------------------------------------------
+
+ScPageHFItem::ScPageHFItem( sal_uInt16 nWhichP )
+ : SfxPoolItem ( nWhichP ),
+ pLeftArea ( NULL ),
+ pCenterArea ( NULL ),
+ pRightArea ( NULL )
+{
+}
+
+//------------------------------------------------------------------------
+
+ScPageHFItem::ScPageHFItem( const ScPageHFItem& rItem )
+ : SfxPoolItem ( rItem ),
+ pLeftArea ( NULL ),
+ pCenterArea ( NULL ),
+ pRightArea ( NULL )
+{
+ if ( rItem.pLeftArea )
+ pLeftArea = rItem.pLeftArea->Clone();
+ if ( rItem.pCenterArea )
+ pCenterArea = rItem.pCenterArea->Clone();
+ if ( rItem.pRightArea )
+ pRightArea = rItem.pRightArea->Clone();
+}
+
+//------------------------------------------------------------------------
+
+ScPageHFItem::~ScPageHFItem()
+{
+ delete pLeftArea;
+ delete pCenterArea;
+ delete pRightArea;
+}
+
+//------------------------------------------------------------------------
+
+bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const
+{
+ uno::Reference<sheet::XHeaderFooterContent> xContent =
+ new ScHeaderFooterContentObj( pLeftArea, pCenterArea, pRightArea );
+
+ rVal <<= xContent;
+ return true;
+}
+
+bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ )
+{
+ bool bRet = false;
+ uno::Reference<sheet::XHeaderFooterContent> xContent;
+ if ( rVal >>= xContent )
+ {
+ if ( xContent.is() )
+ {
+ ScHeaderFooterContentObj* pImp =
+ ScHeaderFooterContentObj::getImplementation( xContent );
+ if (pImp)
+ {
+ const EditTextObject* pImpLeft = pImp->GetLeftEditObject();
+ delete pLeftArea;
+ pLeftArea = pImpLeft ? pImpLeft->Clone() : NULL;
+
+ const EditTextObject* pImpCenter = pImp->GetCenterEditObject();
+ delete pCenterArea;
+ pCenterArea = pImpCenter ? pImpCenter->Clone() : NULL;
+
+ const EditTextObject* pImpRight = pImp->GetRightEditObject();
+ delete pRightArea;
+ pRightArea = pImpRight ? pImpRight->Clone() : NULL;
+
+ if ( !pLeftArea || !pCenterArea || !pRightArea )
+ {
+ // keine Texte auf NULL stehen lassen
+ ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True );
+ if (!pLeftArea)
+ pLeftArea = aEngine.CreateTextObject();
+ if (!pCenterArea)
+ pCenterArea = aEngine.CreateTextObject();
+ if (!pRightArea)
+ pRightArea = aEngine.CreateTextObject();
+ }
+
+ bRet = true;
+ }
+ }
+ }
+
+ if (!bRet)
+ {
+ OSL_FAIL("exception - wrong argument");
+ }
+
+ return true;
+}
+
+//------------------------------------------------------------------------
+
+String ScPageHFItem::GetValueText() const
+{
+ return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScPageHFItem"));
+}
+
+//------------------------------------------------------------------------
+
+int ScPageHFItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+
+ const ScPageHFItem& r = (const ScPageHFItem&)rItem;
+
+ return ScGlobal::EETextObjEqual(pLeftArea, r.pLeftArea)
+ && ScGlobal::EETextObjEqual(pCenterArea, r.pCenterArea)
+ && ScGlobal::EETextObjEqual(pRightArea, r.pRightArea);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScPageHFItem::Clone( SfxItemPool* ) const
+{
+ return new ScPageHFItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+void lcl_SetSpace( String& rStr, const ESelection& rSel )
+{
+ // Text durch ein Leerzeichen ersetzen, damit Positionen stimmen:
+
+ xub_StrLen nLen = rSel.nEndPos-rSel.nStartPos;
+ rStr.Erase( rSel.nStartPos, nLen-1 );
+ rStr.SetChar( rSel.nStartPos, ' ' );
+}
+
+sal_Bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands)
+{
+ sal_Bool bChange = false;
+ sal_uInt16 nParCnt = rEng.GetParagraphCount();
+ for (sal_uInt16 nPar = 0; nPar<nParCnt; nPar++)
+ {
+ String aStr = rEng.GetText( nPar );
+ xub_StrLen nPos;
+
+ while ((nPos = aStr.Search(pCommands[0])) != STRING_NOTFOUND)
+ {
+ ESelection aSel( nPar,nPos, nPar,nPos+pCommands[0].Len() );
+ rEng.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), aSel );
+ lcl_SetSpace(aStr, aSel ); bChange = sal_True;
+ }
+ while ((nPos = aStr.Search(pCommands[1])) != STRING_NOTFOUND)
+ {
+ ESelection aSel( nPar,nPos, nPar,nPos+pCommands[1].Len() );
+ rEng.QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), aSel );
+ lcl_SetSpace(aStr, aSel ); bChange = sal_True;
+ }
+ while ((nPos = aStr.Search(pCommands[2])) != STRING_NOTFOUND)
+ {
+ ESelection aSel( nPar,nPos, nPar,nPos+pCommands[2].Len() );
+ rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel );
+ lcl_SetSpace(aStr, aSel ); bChange = sal_True;
+ }
+ while ((nPos = aStr.Search(pCommands[3])) != STRING_NOTFOUND)
+ {
+ ESelection aSel( nPar,nPos, nPar,nPos+pCommands[3].Len() );
+ rEng.QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD ), aSel );
+ lcl_SetSpace(aStr, aSel ); bChange = sal_True;
+ }
+ while ((nPos = aStr.Search(pCommands[4])) != STRING_NOTFOUND)
+ {
+ ESelection aSel( nPar,nPos, nPar,nPos+pCommands[4].Len() );
+ rEng.QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), aSel );
+ lcl_SetSpace(aStr, aSel ); bChange = sal_True;
+ }
+ while ((nPos = aStr.Search(pCommands[5])) != STRING_NOTFOUND)
+ {
+ ESelection aSel( nPar,nPos, nPar,nPos+pCommands[5].Len() );
+ rEng.QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), aSel );
+ lcl_SetSpace(aStr, aSel ); bChange = sal_True;
+ }
+ }
+ return bChange;
+}
+
+#define SC_FIELD_COUNT 6
+
+SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const
+{
+ EditTextObject* pLeft = EditTextObject::Create(rStream);
+ EditTextObject* pCenter = EditTextObject::Create(rStream);
+ EditTextObject* pRight = EditTextObject::Create(rStream);
+
+ DBG_ASSERT( pLeft && pCenter && pRight, "Error reading ScPageHFItem" );
+
+ if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 ||
+ pCenter == NULL || pCenter->GetParagraphCount() == 0 ||
+ pRight == NULL || pRight->GetParagraphCount() == 0 )
+ {
+ // If successfully loaded, each object contains at least one paragraph.
+ // Excel import in 5.1 created broken TextObjects (#67442#) that are
+ // corrected here to avoid saving wrong files again (#90487#).
+
+ ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True );
+ if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 )
+ {
+ delete pLeft;
+ pLeft = aEngine.CreateTextObject();
+ }
+ if ( pCenter == NULL || pCenter->GetParagraphCount() == 0 )
+ {
+ delete pCenter;
+ pCenter = aEngine.CreateTextObject();
+ }
+ if ( pRight == NULL || pRight->GetParagraphCount() == 0 )
+ {
+ delete pRight;
+ pRight = aEngine.CreateTextObject();
+ }
+ }
+
+ if ( nVer < 1 ) // alte Feldbefehle umsetzen
+ {
+ sal_uInt16 i;
+ const String& rDel = ScGlobal::GetRscString( STR_HFCMD_DELIMITER );
+ String aCommands[SC_FIELD_COUNT];
+ for (i=0; i<SC_FIELD_COUNT; i++)
+ aCommands[i] = rDel;
+ aCommands[0] += ScGlobal::GetRscString(STR_HFCMD_PAGE);
+ aCommands[1] += ScGlobal::GetRscString(STR_HFCMD_PAGES);
+ aCommands[2] += ScGlobal::GetRscString(STR_HFCMD_DATE);
+ aCommands[3] += ScGlobal::GetRscString(STR_HFCMD_TIME);
+ aCommands[4] += ScGlobal::GetRscString(STR_HFCMD_FILE);
+ aCommands[5] += ScGlobal::GetRscString(STR_HFCMD_TABLE);
+ for (i=0; i<SC_FIELD_COUNT; i++)
+ aCommands[i] += rDel;
+
+ ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True );
+ aEngine.SetText(*pLeft);
+ if (lcl_ConvertFields(aEngine,aCommands))
+ {
+ delete pLeft;
+ pLeft = aEngine.CreateTextObject();
+ }
+ aEngine.SetText(*pCenter);
+ if (lcl_ConvertFields(aEngine,aCommands))
+ {
+ delete pCenter;
+ pCenter = aEngine.CreateTextObject();
+ }
+ aEngine.SetText(*pRight);
+ if (lcl_ConvertFields(aEngine,aCommands))
+ {
+ delete pRight;
+ pRight = aEngine.CreateTextObject();
+ }
+ }
+ else if ( nVer < 2 )
+ { // nichts tun, SvxFileField nicht gegen SvxExtFileField austauschen
+ }
+
+ ScPageHFItem* pItem = new ScPageHFItem( Which() );
+ pItem->SetArea( pLeft, SC_HF_LEFTAREA );
+ pItem->SetArea( pCenter, SC_HF_CENTERAREA );
+ pItem->SetArea( pRight, SC_HF_RIGHTAREA );
+
+ return pItem;
+}
+
+//------------------------------------------------------------------------
+
+
+void ScPageHFItem::SetLeftArea( const EditTextObject& rNew )
+{
+ delete pLeftArea;
+ pLeftArea = rNew.Clone();
+}
+
+//------------------------------------------------------------------------
+
+void ScPageHFItem::SetCenterArea( const EditTextObject& rNew )
+{
+ delete pCenterArea;
+ pCenterArea = rNew.Clone();
+}
+
+//------------------------------------------------------------------------
+
+void ScPageHFItem::SetRightArea( const EditTextObject& rNew )
+{
+ delete pRightArea;
+ pRightArea = rNew.Clone();
+}
+
+void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea )
+{
+ switch ( nArea )
+ {
+ case SC_HF_LEFTAREA: delete pLeftArea; pLeftArea = pNew; break;
+ case SC_HF_CENTERAREA: delete pCenterArea; pCenterArea = pNew; break;
+ case SC_HF_RIGHTAREA: delete pRightArea; pRightArea = pNew; break;
+ default:
+ OSL_FAIL( "New Area?" );
+ }
+}
+
+//-----------------------------------------------------------------------
+// ScViewObjectModeItem - Darstellungsmodus von ViewObjekten
+//-----------------------------------------------------------------------
+
+ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP )
+ : SfxEnumItem( nWhichP, VOBJ_MODE_SHOW )
+{
+}
+
+//------------------------------------------------------------------------
+
+ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP, ScVObjMode eMode )
+ : SfxEnumItem( nWhichP, sal::static_int_cast<sal_uInt16>(eMode) )
+{
+}
+
+//------------------------------------------------------------------------
+
+ScViewObjectModeItem::~ScViewObjectModeItem()
+{
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation ScViewObjectModeItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit /* eCoreUnit */,
+ SfxMapUnit /* ePresUnit */,
+ String& rText,
+ const IntlWrapper* /* pIntl */
+) const
+{
+ String aDel = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(": "));
+ rText.Erase();
+
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ switch( Which() )
+ {
+ case SID_SCATTR_PAGE_CHARTS:
+ rText = ScGlobal::GetRscString(STR_VOBJ_CHART);
+ rText += aDel;
+ break;
+
+ case SID_SCATTR_PAGE_OBJECTS:
+ rText = ScGlobal::GetRscString(STR_VOBJ_OBJECT);
+ rText += aDel;
+ break;
+
+ case SID_SCATTR_PAGE_DRAWINGS:
+ rText = ScGlobal::GetRscString(STR_VOBJ_DRAWINGS);
+ rText += aDel;
+ break;
+
+ default:
+ ePres = SFX_ITEM_PRESENTATION_NAMELESS;//das geht immer!
+ break;
+ }
+ /* !!! fall-through !!! */
+
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ rText += ScGlobal::GetRscString(STR_VOBJ_MODE_SHOW+GetValue());
+ break;
+
+ default:
+ {
+ // added to avoid warnings
+ }
+ }
+
+ return ePres;
+}
+
+//------------------------------------------------------------------------
+
+String ScViewObjectModeItem::GetValueText( sal_uInt16 nVal ) const
+{
+ DBG_ASSERT( nVal <= VOBJ_MODE_HIDE, "enum overflow!" );
+
+ return ScGlobal::GetRscString( STR_VOBJ_MODE_SHOW + (nVal % 2));
+}
+
+//------------------------------------------------------------------------
+
+sal_uInt16 ScViewObjectModeItem::GetValueCount() const
+{
+ return 2;
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScViewObjectModeItem::Clone( SfxItemPool* ) const
+{
+ return new ScViewObjectModeItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+sal_uInt16 ScViewObjectModeItem::GetVersion( sal_uInt16 /* nFileVersion */ ) const
+{
+ return 1;
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScViewObjectModeItem::Create(
+ SvStream& rStream,
+ sal_uInt16 nVersion ) const
+{
+ if ( nVersion == 0 )
+ {
+ // alte Version mit AllEnumItem -> mit Mode "Show" erzeugen
+ return new ScViewObjectModeItem( Which() );
+ }
+ else
+ {
+ sal_uInt16 nVal;
+ rStream >> nVal;
+
+ //#i80528# adapt to new range eventually
+ if((sal_uInt16)VOBJ_MODE_HIDE < nVal) nVal = (sal_uInt16)VOBJ_MODE_SHOW;
+
+ return new ScViewObjectModeItem( Which(), (ScVObjMode)nVal);
+ }
+}
+
+// -----------------------------------------------------------------------
+// double
+// -----------------------------------------------------------------------
+
+ScDoubleItem::ScDoubleItem( sal_uInt16 nWhichP, double nVal )
+ : SfxPoolItem ( nWhichP ),
+ nValue ( nVal )
+{
+}
+
+//------------------------------------------------------------------------
+
+ScDoubleItem::ScDoubleItem( const ScDoubleItem& rItem )
+ : SfxPoolItem ( rItem )
+{
+ nValue = rItem.nValue;
+}
+
+//------------------------------------------------------------------------
+
+String ScDoubleItem::GetValueText() const
+{
+ return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("ScDoubleItem"));
+}
+
+//------------------------------------------------------------------------
+
+int ScDoubleItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" );
+ const ScDoubleItem& _rItem = (const ScDoubleItem&)rItem;
+ return int(nValue == _rItem.nValue);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScDoubleItem::Clone( SfxItemPool* ) const
+{
+ return new ScDoubleItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* ScDoubleItem::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const
+{
+ double nTmp=0;
+ rStream >> nTmp;
+
+ ScDoubleItem* pItem = new ScDoubleItem( Which(), nTmp );
+
+ return pItem;
+}
+
+//------------------------------------------------------------------------
+
+ScDoubleItem::~ScDoubleItem()
+{
+}
+
+
+// ============================================================================
+
+ScPageScaleToItem::ScPageScaleToItem() :
+ SfxPoolItem( ATTR_PAGE_SCALETO ),
+ mnWidth( 0 ),
+ mnHeight( 0 )
+{
+}
+
+ScPageScaleToItem::ScPageScaleToItem( sal_uInt16 nWidth, sal_uInt16 nHeight ) :
+ SfxPoolItem( ATTR_PAGE_SCALETO ),
+ mnWidth( nWidth ),
+ mnHeight( nHeight )
+{
+}
+
+ScPageScaleToItem::~ScPageScaleToItem()
+{
+}
+
+ScPageScaleToItem* ScPageScaleToItem::Clone( SfxItemPool* ) const
+{
+ return new ScPageScaleToItem( *this );
+}
+
+int ScPageScaleToItem::operator==( const SfxPoolItem& rCmp ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "ScPageScaleToItem::operator== - unequal wid or type" );
+ const ScPageScaleToItem& rPageCmp = static_cast< const ScPageScaleToItem& >( rCmp );
+ return ((mnWidth == rPageCmp.mnWidth) && (mnHeight == rPageCmp.mnHeight)) ? 1 : 0;
+}
+
+namespace {
+void lclAppendScalePageCount( String& rText, sal_uInt16 nPages )
+{
+ rText.AppendAscii( ": " );
+ if( nPages )
+ {
+ String aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) );
+ aPages.SearchAndReplaceAscii( "%1", String::CreateFromInt32( nPages ) );
+ rText.Append( aPages );
+ }
+ else
+ rText.Append( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_AUTO ) );
+}
+} // namespace
+
+SfxItemPresentation ScPageScaleToItem::GetPresentation(
+ SfxItemPresentation ePres, SfxMapUnit, SfxMapUnit, XubString& rText, const IntlWrapper* ) const
+{
+ rText.Erase();
+ if( !IsValid() || (ePres == SFX_ITEM_PRESENTATION_NONE) )
+ return SFX_ITEM_PRESENTATION_NONE;
+
+ String aName( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETO ) );
+ String aValue( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_WIDTH ) );
+ lclAppendScalePageCount( aValue, mnWidth );
+ aValue.AppendAscii( ", " ).Append( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_HEIGHT ) );
+ lclAppendScalePageCount( aValue, mnHeight );
+
+ switch( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ break;
+
+ case SFX_ITEM_PRESENTATION_NAMEONLY:
+ rText = aName;
+ break;
+
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ rText = aValue;
+ break;
+
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText.Assign( aName ).AppendAscii( " (" ).Append( aValue ).Append( ')' );
+ break;
+
+ default:
+ DBG_ERRORFILE( "ScPageScaleToItem::GetPresentation - unknown presentation mode" );
+ ePres = SFX_ITEM_PRESENTATION_NONE;
+ }
+ return ePres;
+}
+
+bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const
+{
+ bool bRet = true;
+ switch( nMemberId )
+ {
+ case SC_MID_PAGE_SCALETO_WIDTH: rAny <<= mnWidth; break;
+ case SC_MID_PAGE_SCALETO_HEIGHT: rAny <<= mnHeight; break;
+ default:
+ DBG_ERRORFILE( "ScPageScaleToItem::QueryValue - unknown member ID" );
+ bRet = false;
+ }
+ return bRet;
+}
+
+bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId )
+{
+ sal_Bool bRet = false;
+ switch( nMemberId )
+ {
+ case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break;
+ case SC_MID_PAGE_SCALETO_HEIGHT: bRet = rAny >>= mnHeight; break;
+ default:
+ DBG_ERRORFILE( "ScPageScaleToItem::PutValue - unknown member ID" );
+ }
+ return bRet;
+}
+
+// ============================================================================
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx
new file mode 100644
index 000000000000..039aedf2735c
--- /dev/null
+++ b/sc/source/core/data/autonamecache.cxx
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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_sc.hxx"
+
+
+
+// INCLUDE ---------------------------------------------------------------
+
+#include <unotools/transliterationwrapper.hxx>
+
+#include "autonamecache.hxx"
+#include "dociter.hxx"
+#include "cell.hxx"
+#include "queryparam.hxx"
+
+// -----------------------------------------------------------------------
+
+ScAutoNameCache::ScAutoNameCache( ScDocument* pD ) :
+ pDoc( pD ),
+ nCurrentTab( 0 ) // doesn't matter - aNames is empty
+{
+}
+
+ScAutoNameCache::~ScAutoNameCache()
+{
+}
+
+const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const String& rName, SCTAB nTab )
+{
+ if ( nTab != nCurrentTab )
+ {
+ // the lists are valid only for one sheet, so they are cleared when another sheet is used
+ aNames.clear();
+ nCurrentTab = nTab;
+ }
+
+ ScAutoNameHashMap::const_iterator aFound = aNames.find( rName );
+ if ( aFound != aNames.end() )
+ return aFound->second; // already initialized
+
+ ScAutoNameAddresses& rAddresses = aNames[rName];
+
+ ScCellIterator aIter( pDoc, ScRange( 0, 0, nCurrentTab, MAXCOL, MAXROW, nCurrentTab ) );
+ for ( ScBaseCell* pCell = aIter.GetFirst(); pCell; pCell = aIter.GetNext() )
+ {
+ // don't check code length here, always use the stored result
+ // (AutoCalc is disabled during CompileXML)
+
+ if ( pCell->HasStringData() )
+ {
+ String aStr;
+ CellType eType = pCell->GetCellType();
+ switch ( eType )
+ {
+ case CELLTYPE_STRING:
+ ((ScStringCell*)pCell)->GetString( aStr );
+ break;
+ case CELLTYPE_FORMULA:
+ ((ScFormulaCell*)pCell)->GetString( aStr );
+ break;
+ case CELLTYPE_EDIT:
+ ((ScEditCell*)pCell)->GetString( aStr );
+ break;
+ case CELLTYPE_NONE:
+ case CELLTYPE_VALUE:
+ case CELLTYPE_NOTE:
+ case CELLTYPE_SYMBOLS:
+#ifdef DBG_UTIL
+ case CELLTYPE_DESTROYED:
+#endif
+ ; // nothing, prevent compiler warning
+ break;
+ }
+ if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rName ) )
+ {
+ rAddresses.push_back( ScAddress( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ) );
+ }
+ }
+ }
+
+ return rAddresses;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
new file mode 100644
index 000000000000..f31bd26958e2
--- /dev/null
+++ b/sc/source/core/data/bcaslot.cxx
@@ -0,0 +1,935 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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_sc.hxx"
+
+
+
+#include <sfx2/objsh.hxx>
+#include <svl/listener.hxx>
+#include <svl/listeneriter.hxx>
+
+#include "document.hxx"
+#include "brdcst.hxx"
+#include "bcaslot.hxx"
+#include "scerrors.hxx"
+#include "docoptio.hxx"
+#include "refupdat.hxx"
+#include "table.hxx"
+
+// Number of slots per dimension
+// must be integer divisors of MAXCOLCOUNT respectively MAXROWCOUNT
+#define BCA_SLOTS_COL ((MAXCOLCOUNT_DEFINE) / 16)
+#if MAXROWCOUNT_DEFINE == 32000
+#define BCA_SLOTS_ROW 256
+#define BCA_SLICE 125
+#else
+#define BCA_SLICE 128
+#define BCA_SLOTS_ROW ((MAXROWCOUNT_DEFINE) / BCA_SLICE)
+#endif
+#define BCA_SLOT_COLS ((MAXCOLCOUNT_DEFINE) / BCA_SLOTS_COL)
+#define BCA_SLOT_ROWS ((MAXROWCOUNT_DEFINE) / BCA_SLOTS_ROW)
+// multiple?
+#if (BCA_SLOT_COLS * BCA_SLOTS_COL) != (MAXCOLCOUNT_DEFINE)
+#error bad BCA_SLOTS_COL value!
+#endif
+#if (BCA_SLOT_ROWS * BCA_SLOTS_ROW) != (MAXROWCOUNT_DEFINE)
+#error bad BCA_SLOTS_ROW value!
+#endif
+// size of slot array if linear
+#define BCA_SLOTS_DEFINE (BCA_SLOTS_COL * BCA_SLOTS_ROW)
+// Arbitrary 2**31/8, assuming size_t can hold at least 2^31 values and
+// sizeof_ptr is at most 8 bytes. You'd probably doom your machine's memory
+// anyway, once you reached these values..
+#if BCA_SLOTS_DEFINE > 268435456
+#error BCA_SLOTS_DEFINE DOOMed!
+#endif
+
+// STATIC DATA -----------------------------------------------------------
+
+TYPEINIT1( ScHint, SfxSimpleHint );
+TYPEINIT1( ScAreaChangedHint, SfxHint );
+
+struct ScSlotData
+{
+ SCROW nStartRow; // first row of this segment
+ SCROW nStopRow; // first row of next segment
+ SCSIZE nSlice; // slice size in this segment
+ SCSIZE nCumulated; // cumulated slots of previous segments
+
+ ScSlotData( SCROW r1, SCROW r2, SCSIZE s, SCSIZE c ) : nStartRow(r1), nStopRow(r2), nSlice(s), nCumulated(c) {}
+};
+typedef ::std::vector< ScSlotData > ScSlotDistribution;
+#if MAXROWCOUNT_DEFINE <= 65536
+// Linear distribution.
+static ScSlotDistribution aSlotDistribution( ScSlotData( 0, MAXROWCOUNT, BCA_SLOT_ROWS, 0));
+static SCSIZE nBcaSlotsRow = BCA_SLOTS_ROW;
+static SCSIZE nBcaSlots = BCA_SLOTS_DEFINE;
+#else
+// Logarithmic or any other distribution.
+// Upper sheet part usually is more populated and referenced and gets fine
+// grained resolution, larger data in larger hunks.
+// Could be further enhanced by also applying a different distribution of
+// column slots.
+static SCSIZE initSlotDistribution( ScSlotDistribution & rSD, SCSIZE & rBSR )
+{
+ SCSIZE nSlots = 0;
+ SCROW nRow1 = 0;
+ SCROW nRow2 = 32*1024;
+ SCSIZE nSlice = 128;
+ // Must be sorted by row1,row2!
+ while (nRow2 <= MAXROWCOUNT)
+ {
+ rSD.push_back( ScSlotData( nRow1, nRow2, nSlice, nSlots));
+ nSlots += (nRow2 - nRow1) / nSlice;
+ nRow1 = nRow2;
+ nRow2 *= 2;
+ nSlice *= 2;
+ }
+ rBSR = nSlots;
+ return nSlots;
+}
+static ScSlotDistribution aSlotDistribution;
+static SCSIZE nBcaSlotsRow;
+static SCSIZE nBcaSlots = initSlotDistribution( aSlotDistribution, nBcaSlotsRow) * BCA_SLOTS_COL;
+// Ensure that all static variables are initialized with this one call.
+#endif
+
+
+ScBroadcastAreaSlot::ScBroadcastAreaSlot( ScDocument* pDocument,
+ ScBroadcastAreaSlotMachine* pBASMa ) :
+ aTmpSeekBroadcastArea( ScRange()),
+ pDoc( pDocument ),
+ pBASM( pBASMa )
+{
+}
+
+
+ScBroadcastAreaSlot::~ScBroadcastAreaSlot()
+{
+ for ( ScBroadcastAreas::iterator aIter( aBroadcastAreaTbl.begin());
+ aIter != aBroadcastAreaTbl.end(); /* none */)
+ {
+ // Prevent hash from accessing dangling pointer in case area is
+ // deleted.
+ ScBroadcastArea* pArea = *aIter;
+ // Erase all so no hash will be accessed upon destruction of the
+ // boost::unordered_map.
+ aBroadcastAreaTbl.erase( aIter++);
+ if (!pArea->DecRef())
+ delete pArea;
+ }
+}
+
+
+bool ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const
+{
+ if ( pDoc->GetHardRecalcState() )
+ return true;
+ if (aBroadcastAreaTbl.size() >= aBroadcastAreaTbl.max_size())
+ { // this is more hypothetical now, check existed for old SV_PTRARR_SORT
+ if ( !pDoc->GetHardRecalcState() )
+ {
+ pDoc->SetHardRecalcState( 1 );
+
+ SfxObjectShell* pShell = pDoc->GetDocumentShell();
+ DBG_ASSERT( pShell, "Missing DocShell :-/" );
+
+ if ( pShell )
+ pShell->SetError( SCWARN_CORE_HARD_RECALC, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+
+ pDoc->SetAutoCalc( false );
+ pDoc->SetHardRecalcState( 2 );
+ }
+ return true;
+ }
+ return false;
+}
+
+
+bool ScBroadcastAreaSlot::StartListeningArea( const ScRange& rRange,
+ SvtListener* pListener, ScBroadcastArea*& rpArea )
+{
+ bool bNewArea = false;
+ DBG_ASSERT(pListener, "StartListeningArea: pListener Null");
+ if (CheckHardRecalcStateCondition())
+ return false;
+ if ( !rpArea )
+ {
+ // Even if most times the area doesn't exist yet and immediately trying
+ // to new and insert it would save an attempt to find it, on mass
+ // operations like identical large [HV]LOOKUP() areas the new/delete
+ // would add quite some penalty for all but the first formula cell.
+ ScBroadcastAreas::const_iterator aIter( FindBroadcastArea( rRange));
+ if (aIter != aBroadcastAreaTbl.end())
+ rpArea = *aIter;
+ else
+ {
+ rpArea = new ScBroadcastArea( rRange);
+ if (aBroadcastAreaTbl.insert( rpArea).second)
+ {
+ rpArea->IncRef();
+ bNewArea = true;
+ }
+ else
+ {
+ DBG_ERRORFILE("StartListeningArea: area not found and not inserted in slot?!?");
+ delete rpArea;
+ rpArea = 0;
+ }
+ }
+ if (rpArea)
+ pListener->StartListening( rpArea->GetBroadcaster());
+ }
+ else
+ {
+ if (aBroadcastAreaTbl.insert( rpArea).second)
+ rpArea->IncRef();
+ }
+ return bNewArea;
+}
+
+
+void ScBroadcastAreaSlot::InsertListeningArea( ScBroadcastArea* pArea )
+{
+ DBG_ASSERT( pArea, "InsertListeningArea: pArea NULL");
+ if (CheckHardRecalcStateCondition())
+ return;
+ if (aBroadcastAreaTbl.insert( pArea).second)
+ pArea->IncRef();
+}
+
+
+// If rpArea != NULL then no listeners are stopped, only the area is removed
+// and the reference count decremented.
+void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange,
+ SvtListener* pListener, ScBroadcastArea*& rpArea )
+{
+ DBG_ASSERT(pListener, "EndListeningArea: pListener Null");
+ if ( !rpArea )
+ {
+ ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange));
+ if (aIter == aBroadcastAreaTbl.end())
+ return;
+ rpArea = *aIter;
+ pListener->EndListening( rpArea->GetBroadcaster() );
+ if ( !rpArea->GetBroadcaster().HasListeners() )
+ { // if nobody is listening we can dispose it
+ aBroadcastAreaTbl.erase( aIter);
+ if ( !rpArea->DecRef() )
+ {
+ delete rpArea;
+ rpArea = NULL;
+ }
+ }
+ }
+ else
+ {
+ if ( !rpArea->GetBroadcaster().HasListeners() )
+ {
+ ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange));
+ if (aIter == aBroadcastAreaTbl.end())
+ return;
+ DBG_ASSERT( *aIter == rpArea, "EndListeningArea: area pointer mismatch");
+ aBroadcastAreaTbl.erase( aIter);
+ if ( !rpArea->DecRef() )
+ {
+ delete rpArea;
+ rpArea = NULL;
+ }
+ }
+ }
+}
+
+
+ScBroadcastAreas::iterator ScBroadcastAreaSlot::FindBroadcastArea(
+ const ScRange& rRange ) const
+{
+ aTmpSeekBroadcastArea.UpdateRange( rRange);
+ return aBroadcastAreaTbl.find( &aTmpSeekBroadcastArea);
+}
+
+
+sal_Bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& rHint) const
+{
+ if (aBroadcastAreaTbl.empty())
+ return false;
+ sal_Bool bIsBroadcasted = false;
+ const ScAddress& rAddress = rHint.GetAddress();
+ for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin());
+ aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
+ {
+ ScBroadcastArea* pArea = *aIter;
+ // A Notify() during broadcast may call EndListeningArea() and thus
+ // dispose this area if it was the last listener, which would
+ // invalidate the iterator, hence increment before call.
+ ++aIter;
+ const ScRange& rAreaRange = pArea->GetRange();
+ if (rAreaRange.In( rAddress))
+ {
+ if (!pBASM->IsInBulkBroadcast() || pBASM->InsertBulkArea( pArea))
+ {
+ pArea->GetBroadcaster().Broadcast( rHint);
+ bIsBroadcasted = sal_True;
+ }
+ }
+ }
+ return bIsBroadcasted;
+}
+
+
+sal_Bool ScBroadcastAreaSlot::AreaBroadcastInRange( const ScRange& rRange,
+ const ScHint& rHint) const
+{
+ if (aBroadcastAreaTbl.empty())
+ return false;
+ sal_Bool bIsBroadcasted = false;
+ for (ScBroadcastAreas::const_iterator aIter( aBroadcastAreaTbl.begin());
+ aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
+ {
+ ScBroadcastArea* pArea = *aIter;
+ // A Notify() during broadcast may call EndListeningArea() and thus
+ // dispose this area if it was the last listener, which would
+ // invalidate the iterator, hence increment before call.
+ ++aIter;
+ const ScRange& rAreaRange = pArea->GetRange();
+ if (rAreaRange.Intersects( rRange ))
+ {
+ if (!pBASM->IsInBulkBroadcast() || pBASM->InsertBulkArea( pArea))
+ {
+ pArea->GetBroadcaster().Broadcast( rHint);
+ bIsBroadcasted = sal_True;
+ }
+ }
+ }
+ return bIsBroadcasted;
+}
+
+
+void ScBroadcastAreaSlot::DelBroadcastAreasInRange( const ScRange& rRange )
+{
+ if (aBroadcastAreaTbl.empty())
+ return;
+ for (ScBroadcastAreas::iterator aIter( aBroadcastAreaTbl.begin());
+ aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
+ {
+ const ScRange& rAreaRange = (*aIter)->GetRange();
+ if (rRange.In( rAreaRange))
+ {
+ ScBroadcastArea* pArea = *aIter;
+ aBroadcastAreaTbl.erase( aIter++); // erase before modifying
+ if (!pArea->DecRef())
+ {
+ if (pBASM->IsInBulkBroadcast())
+ pBASM->RemoveBulkArea( pArea);
+ delete pArea;
+ }
+ }
+ else
+ ++aIter;
+ }
+}
+
+
+void ScBroadcastAreaSlot::UpdateRemove( UpdateRefMode eUpdateRefMode,
+ const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+{
+ if (aBroadcastAreaTbl.empty())
+ return;
+
+ SCCOL nCol1, nCol2, theCol1, theCol2;
+ SCROW nRow1, nRow2, theRow1, theRow2;
+ SCTAB nTab1, nTab2, theTab1, theTab2;
+ rRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
+ for ( ScBroadcastAreas::iterator aIter( aBroadcastAreaTbl.begin());
+ aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
+ {
+ ScBroadcastArea* pArea = *aIter;
+ if ( pArea->IsInUpdateChain() )
+ {
+ aBroadcastAreaTbl.erase( aIter++);
+ pArea->DecRef();
+ }
+ else
+ {
+ pArea->GetRange().GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2);
+ if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
+ nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
+ theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ))
+ {
+ aBroadcastAreaTbl.erase( aIter++);
+ pArea->DecRef();
+ if (pBASM->IsInBulkBroadcast())
+ pBASM->RemoveBulkArea( pArea);
+ pArea->SetInUpdateChain( sal_True );
+ ScBroadcastArea* pUC = pBASM->GetEOUpdateChain();
+ if ( pUC )
+ pUC->SetUpdateChainNext( pArea );
+ else // no tail => no head
+ pBASM->SetUpdateChain( pArea );
+ pBASM->SetEOUpdateChain( pArea );
+ }
+ else
+ ++aIter;
+ }
+ }
+}
+
+
+void ScBroadcastAreaSlot::UpdateRemoveArea( ScBroadcastArea* pArea )
+{
+ ScBroadcastAreas::iterator aIter( aBroadcastAreaTbl.find( pArea));
+ if (aIter == aBroadcastAreaTbl.end())
+ return;
+ if (*aIter != pArea)
+ DBG_ERRORFILE( "UpdateRemoveArea: area pointer mismatch");
+ else
+ {
+ aBroadcastAreaTbl.erase( aIter);
+ pArea->DecRef();
+ }
+}
+
+
+void ScBroadcastAreaSlot::UpdateInsert( ScBroadcastArea* pArea )
+{
+ ::std::pair< ScBroadcastAreas::iterator, bool > aPair =
+ aBroadcastAreaTbl.insert( pArea );
+ if (aPair.second)
+ pArea->IncRef();
+ else
+ {
+ // Identical area already exists, add listeners.
+ ScBroadcastArea* pTarget = *(aPair.first);
+ if (pArea != pTarget)
+ {
+ SvtBroadcaster& rTarget = pTarget->GetBroadcaster();
+ SvtListenerIter it( pArea->GetBroadcaster());
+ for (SvtListener* pListener = it.GetCurr(); pListener;
+ pListener = it.GoNext())
+ {
+ pListener->StartListening( rTarget);
+ }
+ }
+ }
+}
+
+
+// --- ScBroadcastAreaSlotMachine -------------------------------------
+
+ScBroadcastAreaSlotMachine::TableSlots::TableSlots()
+{
+ ppSlots = new ScBroadcastAreaSlot* [ nBcaSlots ];
+ memset( ppSlots, 0 , sizeof( ScBroadcastAreaSlot* ) * nBcaSlots );
+}
+
+
+ScBroadcastAreaSlotMachine::TableSlots::~TableSlots()
+{
+ for ( ScBroadcastAreaSlot** pp = ppSlots + nBcaSlots; --pp >= ppSlots; /* nothing */ )
+ {
+ if (*pp)
+ delete *pp;
+ }
+ delete [] ppSlots;
+}
+
+
+ScBroadcastAreaSlotMachine::ScBroadcastAreaSlotMachine(
+ ScDocument* pDocument ) :
+ pBCAlways( NULL ),
+ pDoc( pDocument ),
+ pUpdateChain( NULL ),
+ pEOUpdateChain( NULL ),
+ nInBulkBroadcast( 0 )
+{
+}
+
+
+ScBroadcastAreaSlotMachine::~ScBroadcastAreaSlotMachine()
+{
+ for (TableSlotsMap::iterator iTab( aTableSlotsMap.begin());
+ iTab != aTableSlotsMap.end(); ++iTab)
+ {
+ delete (*iTab).second;
+ }
+ delete pBCAlways;
+}
+
+
+inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset(
+ const ScAddress& rAddress ) const
+{
+ SCROW nRow = rAddress.Row();
+ SCCOL nCol = rAddress.Col();
+ if ( !ValidRow(nRow) || !ValidCol(nCol) )
+ {
+ DBG_ERRORFILE( "Row/Col invalid, using first slot!" );
+ return 0;
+ }
+ for (size_t i=0; i < aSlotDistribution.size(); ++i)
+ {
+ if (nRow < aSlotDistribution[i].nStopRow)
+ {
+ const ScSlotData& rSD = aSlotDistribution[i];
+ return rSD.nCumulated +
+ (static_cast<SCSIZE>(nRow - rSD.nStartRow)) / rSD.nSlice +
+ static_cast<SCSIZE>(nCol) / BCA_SLOT_COLS * nBcaSlotsRow;
+ }
+ }
+ DBG_ERRORFILE( "No slot found, using last!" );
+ return nBcaSlots - 1;
+}
+
+
+void ScBroadcastAreaSlotMachine::ComputeAreaPoints( const ScRange& rRange,
+ SCSIZE& rStart, SCSIZE& rEnd, SCSIZE& rRowBreak ) const
+{
+ rStart = ComputeSlotOffset( rRange.aStart );
+ rEnd = ComputeSlotOffset( rRange.aEnd );
+ // count of row slots per column minus one
+ rRowBreak = ComputeSlotOffset(
+ ScAddress( rRange.aStart.Col(), rRange.aEnd.Row(), 0 ) ) - rStart;
+}
+
+
+inline void ComputeNextSlot( SCSIZE & nOff, SCSIZE & nBreak, ScBroadcastAreaSlot** & pp,
+ SCSIZE & nStart, ScBroadcastAreaSlot** const & ppSlots, SCSIZE const & nRowBreak )
+{
+ if ( nOff < nBreak )
+ {
+ ++nOff;
+ ++pp;
+ }
+ else
+ {
+ nStart += nBcaSlotsRow;
+ nOff = nStart;
+ pp = ppSlots + nOff;
+ nBreak = nOff + nRowBreak;
+ }
+}
+
+
+void ScBroadcastAreaSlotMachine::StartListeningArea( const ScRange& rRange,
+ SvtListener* pListener )
+{
+ if ( rRange == BCA_LISTEN_ALWAYS )
+ {
+ if ( !pBCAlways )
+ pBCAlways = new SvtBroadcaster;
+ pListener->StartListening( *pBCAlways );
+ }
+ else
+ {
+ bool bDone = false;
+ for (SCTAB nTab = rRange.aStart.Tab();
+ !bDone && nTab <= rRange.aEnd.Tab(); ++nTab)
+ {
+ TableSlotsMap::iterator iTab( aTableSlotsMap.find( nTab));
+ if (iTab == aTableSlotsMap.end())
+ iTab = aTableSlotsMap.insert( TableSlotsMap::value_type(
+ nTab, new TableSlots)).first;
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( rRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ ScBroadcastArea* pArea = NULL;
+ while ( !bDone && nOff <= nEnd )
+ {
+ if ( !*pp )
+ *pp = new ScBroadcastAreaSlot( pDoc, this );
+ if (!pArea)
+ {
+ // If the call to StartListeningArea didn't create the
+ // ScBroadcastArea, listeners were added to an already
+ // existing identical area that doesn't need to be inserted
+ // to slots again.
+ if (!(*pp)->StartListeningArea( rRange, pListener, pArea))
+ bDone = true;
+ }
+ else
+ (*pp)->InsertListeningArea( pArea);
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+ }
+}
+
+
+void ScBroadcastAreaSlotMachine::EndListeningArea( const ScRange& rRange,
+ SvtListener* pListener )
+{
+ if ( rRange == BCA_LISTEN_ALWAYS )
+ {
+ DBG_ASSERT( pBCAlways, "ScBroadcastAreaSlotMachine::EndListeningArea: BCA_LISTEN_ALWAYS but none established");
+ if ( pBCAlways )
+ {
+ pListener->EndListening( *pBCAlways);
+ if (!pBCAlways->HasListeners())
+ {
+ delete pBCAlways;
+ pBCAlways = NULL;
+ }
+ }
+ }
+ else
+ {
+ SCTAB nEndTab = rRange.aEnd.Tab();
+ for (TableSlotsMap::iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
+ iTab != aTableSlotsMap.end() && (*iTab).first <= nEndTab; ++iTab)
+ {
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( rRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ ScBroadcastArea* pArea = NULL;
+ if (nOff == 0 && nEnd == nBcaSlots-1)
+ {
+ // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they
+ // happen for insertion and deletion of sheets.
+ ScBroadcastAreaSlot** const pStop = ppSlots + nEnd;
+ do
+ {
+ if ( *pp )
+ (*pp)->EndListeningArea( rRange, pListener, pArea );
+ } while (++pp < pStop);
+ }
+ else
+ {
+ while ( nOff <= nEnd )
+ {
+ if ( *pp )
+ (*pp)->EndListeningArea( rRange, pListener, pArea );
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+ }
+ }
+}
+
+
+sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcast( const ScHint& rHint ) const
+{
+ const ScAddress& rAddress = rHint.GetAddress();
+ if ( rAddress == BCA_BRDCST_ALWAYS )
+ {
+ if ( pBCAlways )
+ {
+ pBCAlways->Broadcast( rHint );
+ return sal_True;
+ }
+ else
+ return false;
+ }
+ else
+ {
+ TableSlotsMap::const_iterator iTab( aTableSlotsMap.find( rAddress.Tab()));
+ if (iTab == aTableSlotsMap.end())
+ return false;
+ ScBroadcastAreaSlot* pSlot = (*iTab).second->getAreaSlot(
+ ComputeSlotOffset( rAddress));
+ if ( pSlot )
+ return pSlot->AreaBroadcast( rHint );
+ else
+ return false;
+ }
+}
+
+
+sal_Bool ScBroadcastAreaSlotMachine::AreaBroadcastInRange( const ScRange& rRange,
+ const ScHint& rHint ) const
+{
+ sal_Bool bBroadcasted = false;
+ SCTAB nEndTab = rRange.aEnd.Tab();
+ for (TableSlotsMap::const_iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
+ iTab != aTableSlotsMap.end() && (*iTab).first <= nEndTab; ++iTab)
+ {
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( rRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ while ( nOff <= nEnd )
+ {
+ if ( *pp )
+ bBroadcasted |= (*pp)->AreaBroadcastInRange( rRange, rHint );
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+ return bBroadcasted;
+}
+
+
+void ScBroadcastAreaSlotMachine::DelBroadcastAreasInRange(
+ const ScRange& rRange )
+{
+ SCTAB nEndTab = rRange.aEnd.Tab();
+ for (TableSlotsMap::iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
+ iTab != aTableSlotsMap.end() && (*iTab).first <= nEndTab; ++iTab)
+ {
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( rRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ if (nOff == 0 && nEnd == nBcaSlots-1)
+ {
+ // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they
+ // happen for insertion and deletion of sheets.
+ ScBroadcastAreaSlot** const pStop = ppSlots + nEnd;
+ do
+ {
+ if ( *pp )
+ (*pp)->DelBroadcastAreasInRange( rRange );
+ } while (++pp < pStop);
+ }
+ else
+ {
+ while ( nOff <= nEnd )
+ {
+ if ( *pp )
+ (*pp)->DelBroadcastAreasInRange( rRange );
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+ }
+}
+
+
+// for all affected: remove, chain, update range, insert, and maybe delete
+void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas(
+ UpdateRefMode eUpdateRefMode,
+ const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+{
+ // remove affected and put in chain
+ SCTAB nEndTab = rRange.aEnd.Tab();
+ for (TableSlotsMap::iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
+ iTab != aTableSlotsMap.end() && (*iTab).first <= nEndTab; ++iTab)
+ {
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( rRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ if (nOff == 0 && nEnd == nBcaSlots-1)
+ {
+ // Slightly optimized for 0,0,MAXCOL,MAXROW calls as they
+ // happen for insertion and deletion of sheets.
+ ScBroadcastAreaSlot** const pStop = ppSlots + nEnd;
+ do
+ {
+ if ( *pp )
+ (*pp)->UpdateRemove( eUpdateRefMode, rRange, nDx, nDy, nDz );
+ } while (++pp < pStop);
+ }
+ else
+ {
+ while ( nOff <= nEnd )
+ {
+ if ( *pp )
+ (*pp)->UpdateRemove( eUpdateRefMode, rRange, nDx, nDy, nDz );
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+ }
+
+ // Updating an area's range will modify the hash key, remove areas from all
+ // affected slots. Will be reinserted later with the updated range.
+ ScBroadcastArea* pChain = pUpdateChain;
+ while (pChain)
+ {
+ ScBroadcastArea* pArea = pChain;
+ pChain = pArea->GetUpdateChainNext();
+ ScRange aRange( pArea->GetRange());
+ // remove from slots
+ for (SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab() && pArea->GetRef(); ++nTab)
+ {
+ TableSlotsMap::iterator iTab( aTableSlotsMap.find( nTab));
+ if (iTab == aTableSlotsMap.end())
+ {
+ DBG_ERRORFILE( "UpdateBroadcastAreas: Where's the TableSlot?!?");
+ continue; // for
+ }
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( aRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ while ( nOff <= nEnd && pArea->GetRef() )
+ {
+ if (*pp)
+ (*pp)->UpdateRemoveArea( pArea);
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+
+ }
+
+ // shift sheets
+ if (nDz)
+ {
+ if (nDz < 0)
+ {
+ TableSlotsMap::iterator iDel( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
+ TableSlotsMap::iterator iTab( aTableSlotsMap.lower_bound( rRange.aStart.Tab() - nDz));
+ // Remove sheets, if any, iDel or/and iTab may as well point to end().
+ while (iDel != iTab)
+ {
+ delete (*iDel).second;
+ aTableSlotsMap.erase( iDel++);
+ }
+ // shift remaining down
+ while (iTab != aTableSlotsMap.end())
+ {
+ SCTAB nTab = (*iTab).first + nDz;
+ aTableSlotsMap[nTab] = (*iTab).second;
+ aTableSlotsMap.erase( iTab++);
+ }
+ }
+ else
+ {
+ TableSlotsMap::iterator iStop( aTableSlotsMap.lower_bound( rRange.aStart.Tab()));
+ if (iStop != aTableSlotsMap.end())
+ {
+ bool bStopIsBegin = (iStop == aTableSlotsMap.begin());
+ if (!bStopIsBegin)
+ --iStop;
+ TableSlotsMap::iterator iTab( aTableSlotsMap.end());
+ --iTab;
+ while (iTab != iStop)
+ {
+ SCTAB nTab = (*iTab).first + nDz;
+ aTableSlotsMap[nTab] = (*iTab).second;
+ aTableSlotsMap.erase( iTab--);
+ }
+ // Shift the very first, iTab==iStop in this case.
+ if (bStopIsBegin)
+ {
+ SCTAB nTab = (*iTab).first + nDz;
+ aTableSlotsMap[nTab] = (*iTab).second;
+ aTableSlotsMap.erase( iStop);
+ }
+ }
+ }
+ }
+
+ // work off chain
+ SCCOL nCol1, nCol2, theCol1, theCol2;
+ SCROW nRow1, nRow2, theRow1, theRow2;
+ SCTAB nTab1, nTab2, theTab1, theTab2;
+ rRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
+ while ( pUpdateChain )
+ {
+ ScBroadcastArea* pArea = pUpdateChain;
+ ScRange aRange( pArea->GetRange());
+ pUpdateChain = pArea->GetUpdateChainNext();
+
+ // update range
+ aRange.GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2);
+ if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
+ nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
+ theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ))
+ {
+ aRange = ScRange( theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 );
+ pArea->UpdateRange( aRange );
+ pArea->GetBroadcaster().Broadcast( ScAreaChangedHint( aRange ) ); // for DDE
+ }
+
+ // insert to slots
+ for (SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); ++nTab)
+ {
+ TableSlotsMap::iterator iTab( aTableSlotsMap.find( nTab));
+ if (iTab == aTableSlotsMap.end())
+ iTab = aTableSlotsMap.insert( TableSlotsMap::value_type(
+ nTab, new TableSlots)).first;
+ ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots();
+ SCSIZE nStart, nEnd, nRowBreak;
+ ComputeAreaPoints( aRange, nStart, nEnd, nRowBreak );
+ SCSIZE nOff = nStart;
+ SCSIZE nBreak = nOff + nRowBreak;
+ ScBroadcastAreaSlot** pp = ppSlots + nOff;
+ while ( nOff <= nEnd )
+ {
+ if (!*pp)
+ *pp = new ScBroadcastAreaSlot( pDoc, this );
+ (*pp)->UpdateInsert( pArea );
+ ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak);
+ }
+ }
+
+ // unchain
+ pArea->SetUpdateChainNext( NULL );
+ pArea->SetInUpdateChain( false );
+
+ // Delete if not inserted to any slot. RemoveBulkArea(pArea) was
+ // already executed in UpdateRemove().
+ if (!pArea->GetRef())
+ delete pArea;
+ }
+ pEOUpdateChain = NULL;
+}
+
+
+void ScBroadcastAreaSlotMachine::EnterBulkBroadcast()
+{
+ ++nInBulkBroadcast;
+}
+
+
+void ScBroadcastAreaSlotMachine::LeaveBulkBroadcast()
+{
+ if (nInBulkBroadcast > 0)
+ {
+ if (--nInBulkBroadcast == 0)
+ ScBroadcastAreasBulk().swap( aBulkBroadcastAreas);
+ }
+}
+
+
+bool ScBroadcastAreaSlotMachine::InsertBulkArea( const ScBroadcastArea* pArea )
+{
+ return aBulkBroadcastAreas.insert( pArea ).second;
+}
+
+
+size_t ScBroadcastAreaSlotMachine::RemoveBulkArea( const ScBroadcastArea* pArea )
+{
+ return aBulkBroadcastAreas.erase( pArea );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
new file mode 100644
index 000000000000..d3e9cb8db5a5
--- /dev/null
+++ b/sc/source/core/data/cell.cxx
@@ -0,0 +1,1977 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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_sc.hxx"
+
+// INCLUDE ---------------------------------------------------------------
+
+#include <svl/zforlist.hxx>
+
+#include "scitems.hxx"
+#include "attrib.hxx"
+#include "cell.hxx"
+#include "compiler.hxx"
+#include "interpre.hxx"
+#include "document.hxx"
+#include "scmatrix.hxx"
+#include "dociter.hxx"
+#include "docoptio.hxx"
+#include "rechead.hxx"
+#include "rangenam.hxx"
+#include "brdcst.hxx"
+#include "ddelink.hxx"
+#include "validat.hxx"
+#include "progress.hxx"
+#include "editutil.hxx"
+#include "recursionhelper.hxx"
+#include "postit.hxx"
+#include "externalrefmgr.hxx"
+#include "macromgr.hxx"
+#include <editeng/editobj.hxx>
+#include <svl/intitem.hxx>
+#include <editeng/flditem.hxx>
+#include <svl/broadcast.hxx>
+
+using namespace formula;
+// More or less arbitrary, of course all recursions must fit into available
+// stack space (which is what on all systems we don't know yet?). Choosing a
+// lower value may be better than trying a much higher value that also isn't
+// sufficient but temporarily leads to high memory consumption. On the other
+// hand, if the value fits all recursions, execution is quicker as no resumes
+// are necessary. Could be made a configurable option.
+// Allow for a year's calendar (366).
+const sal_uInt16 MAXRECURSION = 400;
+
+// STATIC DATA -----------------------------------------------------------
+
+#ifdef USE_MEMPOOL
+// MemPools auf 4k Boundaries - 64 Bytes ausrichten
+const sal_uInt16 nMemPoolValueCell = (0x8000 - 64) / sizeof(ScValueCell);
+const sal_uInt16 nMemPoolFormulaCell = (0x8000 - 64) / sizeof(ScFormulaCell);
+const sal_uInt16 nMemPoolStringCell = (0x4000 - 64) / sizeof(ScStringCell);
+const sal_uInt16 nMemPoolNoteCell = (0x1000 - 64) / sizeof(ScNoteCell);
+IMPL_FIXEDMEMPOOL_NEWDEL( ScValueCell, nMemPoolValueCell, nMemPoolValueCell )
+IMPL_FIXEDMEMPOOL_NEWDEL( ScFormulaCell, nMemPoolFormulaCell, nMemPoolFormulaCell )
+IMPL_FIXEDMEMPOOL_NEWDEL( ScStringCell, nMemPoolStringCell, nMemPoolStringCell )
+IMPL_FIXEDMEMPOOL_NEWDEL( ScNoteCell, nMemPoolNoteCell, nMemPoolNoteCell )
+#endif
+
+// ============================================================================
+
+ScBaseCell::ScBaseCell( CellType eNewType ) :
+ mpNote( 0 ),
+ mpBroadcaster( 0 ),
+ nTextWidth( TEXTWIDTH_DIRTY ),
+ eCellType( sal::static_int_cast<sal_uInt8>(eNewType) ),
+ nScriptType( SC_SCRIPTTYPE_UNKNOWN )
+{
+}
+
+ScBaseCell::ScBaseCell( const ScBaseCell& rCell ) :
+ mpNote( 0 ),
+ mpBroadcaster( 0 ),
+ nTextWidth( rCell.nTextWidth ),
+ eCellType( rCell.eCellType ),
+ nScriptType( SC_SCRIPTTYPE_UNKNOWN )
+{
+}
+
+ScBaseCell::~ScBaseCell()
+{
+ delete mpNote;
+ delete mpBroadcaster;
+ DBG_ASSERT( eCellType == CELLTYPE_DESTROYED, "BaseCell Destructor" );
+}
+
+namespace {
+
+ScBaseCell* lclCloneCell( const ScBaseCell& rSrcCell, ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags )
+{
+ switch( rSrcCell.GetCellType() )
+ {
+ case CELLTYPE_VALUE:
+ return new ScValueCell( static_cast< const ScValueCell& >( rSrcCell ) );
+ case CELLTYPE_STRING:
+ return new ScStringCell( static_cast< const ScStringCell& >( rSrcCell ) );
+ case CELLTYPE_EDIT:
+ return new ScEditCell( static_cast< const ScEditCell& >( rSrcCell ), rDestDoc );
+ case CELLTYPE_FORMULA:
+ return new ScFormulaCell( static_cast< const ScFormulaCell& >( rSrcCell ), rDestDoc, rDestPos, nCloneFlags );
+ case CELLTYPE_NOTE:
+ return new ScNoteCell;
+ default:;
+ }
+ OSL_FAIL( "lclCloneCell - unknown cell type" );
+ return 0;
+}
+
+} // namespace
+
+ScBaseCell* ScBaseCell::CloneWithoutNote( ScDocument& rDestDoc, int nCloneFlags ) const
+{
+ // notes will not be cloned -> cell address only needed for formula cells
+ ScAddress aDestPos;
+ if( eCellType == CELLTYPE_FORMULA )
+ aDestPos = static_cast< const ScFormulaCell* >( this )->aPos;
+ return lclCloneCell( *this, rDestDoc, aDestPos, nCloneFlags );
+}
+
+ScBaseCell* ScBaseCell::CloneWithoutNote( ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags ) const
+{
+ return lclCloneCell( *this, rDestDoc, rDestPos, nCloneFlags );
+}
+
+ScBaseCell* ScBaseCell::CloneWithNote( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags ) const
+{
+ ScBaseCell* pNewCell = lclCloneCell( *this, rDestDoc, rDestPos, nCloneFlags );
+ if( mpNote )
+ {
+ if( !pNewCell )
+ pNewCell = new ScNoteCell;
+ bool bCloneCaption = (nCloneFlags & SC_CLONECELL_NOCAPTION) == 0;
+ pNewCell->TakeNote( mpNote->Clone( rOwnPos, rDestDoc, rDestPos, bCloneCaption ) );
+ }
+ return pNewCell;
+}
+
+void ScBaseCell::Delete()
+{
+ DeleteNote();
+ switch (eCellType)
+ {
+ case CELLTYPE_VALUE:
+ delete (ScValueCell*) this;
+ break;
+ case CELLTYPE_STRING:
+ delete (ScStringCell*) this;
+ break;
+ case CELLTYPE_EDIT:
+ delete (ScEditCell*) this;
+ break;
+ case CELLTYPE_FORMULA:
+ delete (ScFormulaCell*) this;
+ break;
+ case CELLTYPE_NOTE:
+ delete (ScNoteCell*) this;
+ break;
+ default:
+ OSL_FAIL("Unbekannter Zellentyp");
+ break;
+ }
+}
+
+bool ScBaseCell::IsBlank( bool bIgnoreNotes ) const
+{
+ return (eCellType == CELLTYPE_NOTE) && (bIgnoreNotes || !mpNote);
+}
+
+void ScBaseCell::TakeNote( ScPostIt* pNote )
+{
+ delete mpNote;
+ mpNote = pNote;
+}
+
+ScPostIt* ScBaseCell::ReleaseNote()
+{
+ ScPostIt* pNote = mpNote;
+ mpNote = 0;
+ return pNote;
+}
+
+void ScBaseCell::DeleteNote()
+{
+ DELETEZ( mpNote );
+}
+
+void ScBaseCell::TakeBroadcaster( SvtBroadcaster* pBroadcaster )
+{
+ delete mpBroadcaster;
+ mpBroadcaster = pBroadcaster;
+}
+
+SvtBroadcaster* ScBaseCell::ReleaseBroadcaster()
+{
+ SvtBroadcaster* pBroadcaster = mpBroadcaster;
+ mpBroadcaster = 0;
+ return pBroadcaster;
+}
+
+void ScBaseCell::DeleteBroadcaster()
+{
+ DELETEZ( mpBroadcaster );
+}
+
+ScBaseCell* ScBaseCell::CreateTextCell( const String& rString, ScDocument* pDoc )
+{
+ if ( rString.Search('\n') != STRING_NOTFOUND || rString.Search(CHAR_CR) != STRING_NOTFOUND )
+ return new ScEditCell( rString, pDoc );
+ else
+ return new ScStringCell( rString );
+}
+
+void ScBaseCell::StartListeningTo( ScDocument* pDoc )
+{
+ if ( eCellType == CELLTYPE_FORMULA && !pDoc->IsClipOrUndo()
+ && !pDoc->GetNoListening()
+ && !((ScFormulaCell*)this)->IsInChangeTrack()
+ )
+ {
+ pDoc->SetDetectiveDirty(sal_True); // es hat sich was geaendert...
+
+ ScFormulaCell* pFormCell = (ScFormulaCell*)this;
+ ScTokenArray* pArr = pFormCell->GetCode();
+ if( pArr->IsRecalcModeAlways() )
+ pDoc->StartListeningArea( BCA_LISTEN_ALWAYS, pFormCell );
+ else
+ {
+ pArr->Reset();
+ ScToken* t;
+ while ( ( t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()) ) != NULL )
+ {
+ StackVar eType = t->GetType();
+ ScSingleRefData& rRef1 = t->GetSingleRef();
+ ScSingleRefData& rRef2 = (eType == svDoubleRef ?
+ t->GetDoubleRef().Ref2 : rRef1);
+ switch( eType )
+ {
+ case svSingleRef:
+ rRef1.CalcAbsIfRel( pFormCell->aPos );
+ if ( rRef1.Valid() )
+ {
+ pDoc->StartListeningCell(
+ ScAddress( rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab ), pFormCell );
+ }
+ break;
+ case svDoubleRef:
+ t->CalcAbsIfRel( pFormCell->aPos );
+ if ( rRef1.Valid() && rRef2.Valid() )
+ {
+ if ( t->GetOpCode() == ocColRowNameAuto )
+ { // automagically
+ if ( rRef1.IsColRel() )
+ { // ColName
+ pDoc->StartListeningArea( ScRange (
+ rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab,
+ rRef2.nCol,
+ MAXROW,
+ rRef2.nTab ), pFormCell );
+ }
+ else
+ { // RowName
+ pDoc->StartListeningArea( ScRange (
+ rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab,
+ MAXCOL,
+ rRef2.nRow,
+ rRef2.nTab ), pFormCell );
+ }
+ }
+ else
+ {
+ pDoc->StartListeningArea( ScRange (
+ rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab,
+ rRef2.nCol,
+ rRef2.nRow,
+ rRef2.nTab ), pFormCell );
+ }
+ }
+ break;
+ default:
+ ; // nothing
+ }
+ }
+ }
+ pFormCell->SetNeedsListening( false);
+ }
+}
+
+// pArr gesetzt -> Referenzen von anderer Zelle nehmen
+// dann muss auch aPos uebergeben werden!
+
+void ScBaseCell::EndListeningTo( ScDocument* pDoc, ScTokenArray* pArr,
+ ScAddress aPos )
+{
+ if ( eCellType == CELLTYPE_FORMULA && !pDoc->IsClipOrUndo()
+ && !((ScFormulaCell*)this)->IsInChangeTrack()
+ )
+ {
+ pDoc->SetDetectiveDirty(sal_True); // es hat sich was geaendert...
+
+ ScFormulaCell* pFormCell = (ScFormulaCell*)this;
+ if( pFormCell->GetCode()->IsRecalcModeAlways() )
+ pDoc->EndListeningArea( BCA_LISTEN_ALWAYS, pFormCell );
+ else
+ {
+ if (!pArr)
+ {
+ pArr = pFormCell->GetCode();
+ aPos = pFormCell->aPos;
+ }
+ pArr->Reset();
+ ScToken* t;
+ while ( ( t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()) ) != NULL )
+ {
+ StackVar eType = t->GetType();
+ ScSingleRefData& rRef1 = t->GetSingleRef();
+ ScSingleRefData& rRef2 = (eType == svDoubleRef ?
+ t->GetDoubleRef().Ref2 : rRef1);
+ switch( eType )
+ {
+ case svSingleRef:
+ rRef1.CalcAbsIfRel( aPos );
+ if ( rRef1.Valid() )
+ {
+ pDoc->EndListeningCell(
+ ScAddress( rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab ), pFormCell );
+ }
+ break;
+ case svDoubleRef:
+ t->CalcAbsIfRel( aPos );
+ if ( rRef1.Valid() && rRef2.Valid() )
+ {
+ if ( t->GetOpCode() == ocColRowNameAuto )
+ { // automagically
+ if ( rRef1.IsColRel() )
+ { // ColName
+ pDoc->EndListeningArea( ScRange (
+ rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab,
+ rRef2.nCol,
+ MAXROW,
+ rRef2.nTab ), pFormCell );
+ }
+ else
+ { // RowName
+ pDoc->EndListeningArea( ScRange (
+ rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab,
+ MAXCOL,
+ rRef2.nRow,
+ rRef2.nTab ), pFormCell );
+ }
+ }
+ else
+ {
+ pDoc->EndListeningArea( ScRange (
+ rRef1.nCol,
+ rRef1.nRow,
+ rRef1.nTab,
+ rRef2.nCol,
+ rRef2.nRow,
+ rRef2.nTab ), pFormCell );
+ }
+ }
+ break;
+ default:
+ ; // nothing
+ }
+ }
+ }
+ }
+}
+
+
+sal_uInt16 ScBaseCell::GetErrorCode() const
+{
+ switch ( eCellType )
+ {
+ case CELLTYPE_FORMULA :
+ return ((ScFormulaCell*)this)->GetErrCode();
+ default:
+ return 0;
+ }
+}
+
+
+sal_Bool ScBaseCell::HasEmptyData() const
+{
+ switch ( eCellType )
+ {
+ case CELLTYPE_NOTE :
+ return sal_True;
+ case CELLTYPE_FORMULA :
+ return ((ScFormulaCell*)this)->IsEmpty();
+ default:
+ return false;
+ }
+}
+
+
+sal_Bool ScBaseCell::HasValueData() const
+{
+ switch ( eCellType )
+ {
+ case CELLTYPE_VALUE :
+ return sal_True;
+ case CELLTYPE_FORMULA :
+ return ((ScFormulaCell*)this)->IsValue();
+ default:
+ return false;
+ }
+}
+
+
+sal_Bool ScBaseCell::HasStringData() const
+{
+ switch ( eCellType )
+ {
+ case CELLTYPE_STRING :
+ case CELLTYPE_EDIT :
+ return sal_True;
+ case CELLTYPE_FORMULA :
+ return !((ScFormulaCell*)this)->IsValue();
+ default:
+ return false;
+ }
+}
+
+String ScBaseCell::GetStringData() const
+{
+ String aStr;
+ switch ( eCellType )
+ {
+ case CELLTYPE_STRING:
+ ((const ScStringCell*)this)->GetString( aStr );
+ break;
+ case CELLTYPE_EDIT:
+ ((const ScEditCell*)this)->GetString( aStr );
+ break;
+ case CELLTYPE_FORMULA:
+ ((ScFormulaCell*)this)->GetString( aStr ); // an der Formelzelle nicht-const
+ break;
+ }
+ return aStr;
+}
+
+sal_Bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 )
+{
+ CellType eType1 = CELLTYPE_NONE;
+ CellType eType2 = CELLTYPE_NONE;
+ if ( pCell1 )
+ {
+ eType1 = pCell1->GetCellType();
+ if (eType1 == CELLTYPE_EDIT)
+ eType1 = CELLTYPE_STRING;
+ else if (eType1 == CELLTYPE_NOTE)
+ eType1 = CELLTYPE_NONE;
+ }
+ if ( pCell2 )
+ {
+ eType2 = pCell2->GetCellType();
+ if (eType2 == CELLTYPE_EDIT)
+ eType2 = CELLTYPE_STRING;
+ else if (eType2 == CELLTYPE_NOTE)
+ eType2 = CELLTYPE_NONE;
+ }
+ if ( eType1 != eType2 )
+ return false;
+
+ switch ( eType1 ) // beide Typen gleich
+ {
+ case CELLTYPE_NONE: // beide leer
+ return sal_True;
+ case CELLTYPE_VALUE: // wirklich Value-Zellen
+ return ( ((const ScValueCell*)pCell1)->GetValue() ==
+ ((const ScValueCell*)pCell2)->GetValue() );
+ case CELLTYPE_STRING: // String oder Edit
+ {
+ String aText1;
+ if ( pCell1->GetCellType() == CELLTYPE_STRING )
+ ((const ScStringCell*)pCell1)->GetString(aText1);
+ else
+ ((const ScEditCell*)pCell1)->GetString(aText1);
+ String aText2;
+ if ( pCell2->GetCellType() == CELLTYPE_STRING )
+ ((const ScStringCell*)pCell2)->GetString(aText2);
+ else
+ ((const ScEditCell*)pCell2)->GetString(aText2);
+ return ( aText1 == aText2 );
+ }
+ case CELLTYPE_FORMULA:
+ {
+ //! eingefuegte Zeilen / Spalten beruecksichtigen !!!!!
+ //! Vergleichsfunktion an der Formelzelle ???
+ //! Abfrage mit ScColumn::SwapRow zusammenfassen!
+
+ ScTokenArray* pCode1 = ((ScFormulaCell*)pCell1)->GetCode();
+ ScTokenArray* pCode2 = ((ScFormulaCell*)pCell2)->GetCode();
+
+ if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN
+ {
+ sal_Bool bEqual = sal_True;
+ sal_uInt16 nLen = pCode1->GetLen();
+ FormulaToken** ppToken1 = pCode1->GetArray();
+ FormulaToken** ppToken2 = pCode2->GetArray();
+ for (sal_uInt16 i=0; i<nLen; i++)
+ if ( !ppToken1[i]->TextEqual(*(ppToken2[i])) )
+ {
+ bEqual = false;
+ break;
+ }
+
+ if (bEqual)
+ return sal_True;
+ }
+
+ return false; // unterschiedlich lang oder unterschiedliche Tokens
+ }
+ default:
+ OSL_FAIL("huch, was fuer Zellen???");
+ }
+ return false;
+}
+
+// ============================================================================
+
+ScNoteCell::ScNoteCell( SvtBroadcaster* pBC ) :
+ ScBaseCell( CELLTYPE_NOTE )
+{
+ TakeBroadcaster( pBC );
+}
+
+ScNoteCell::ScNoteCell( ScPostIt* pNote, SvtBroadcaster* pBC ) :
+ ScBaseCell( CELLTYPE_NOTE )
+{
+ TakeNote( pNote );
+ TakeBroadcaster( pBC );
+}
+
+#ifdef DBG_UTIL
+ScNoteCell::~ScNoteCell()
+{
+ eCellType = CELLTYPE_DESTROYED;
+}
+#endif
+
+// ============================================================================
+
+ScValueCell::ScValueCell() :
+ ScBaseCell( CELLTYPE_VALUE ),
+ mfValue( 0.0 )
+{
+}
+
+ScValueCell::ScValueCell( double fValue ) :
+ ScBaseCell( CELLTYPE_VALUE ),
+ mfValue( fValue )
+{
+}
+
+#ifdef DBG_UTIL
+ScValueCell::~ScValueCell()
+{
+ eCellType = CELLTYPE_DESTROYED;
+}
+#endif
+
+// ============================================================================
+
+ScStringCell::ScStringCell() :
+ ScBaseCell( CELLTYPE_STRING )
+{
+}
+
+ScStringCell::ScStringCell( const String& rString ) :
+ ScBaseCell( CELLTYPE_STRING ),
+ maString( rString.intern() )
+{
+}
+
+#ifdef DBG_UTIL
+ScStringCell::~ScStringCell()
+{
+ eCellType = CELLTYPE_DESTROYED;
+}
+#endif
+
+// ============================================================================
+
+//
+// ScFormulaCell
+//
+
+ScFormulaCell::ScFormulaCell() :
+ ScBaseCell( CELLTYPE_FORMULA ),
+ eTempGrammar( FormulaGrammar::GRAM_DEFAULT),
+ pCode( NULL ),
+ pDocument( NULL ),
+ pPrevious(0),
+ pNext(0),
+ pPreviousTrack(0),
+ pNextTrack(0),
+ nFormatIndex(0),
+ nFormatType( NUMBERFORMAT_NUMBER ),
+ nSeenInIteration(0),
+ cMatrixFlag ( MM_NONE ),
+ bDirty( false ),
+ bChanged( false ),
+ bRunning( false ),
+ bCompile( false ),
+ bSubTotal( false ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
+ aPos(0,0,0)
+{
+}
+
+ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
+ const String& rFormula,
+ const FormulaGrammar::Grammar eGrammar,
+ sal_uInt8 cMatInd ) :
+ ScBaseCell( CELLTYPE_FORMULA ),
+ eTempGrammar( eGrammar),
+ pCode( NULL ),
+ pDocument( pDoc ),
+ pPrevious(0),
+ pNext(0),
+ pPreviousTrack(0),
+ pNextTrack(0),
+ nFormatIndex(0),
+ nFormatType( NUMBERFORMAT_NUMBER ),
+ nSeenInIteration(0),
+ cMatrixFlag ( cMatInd ),
+ bDirty( sal_True ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cMatInd != 0
+ bChanged( false ),
+ bRunning( false ),
+ bCompile( false ),
+ bSubTotal( false ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
+ aPos( rPos )
+{
+ Compile( rFormula, sal_True, eGrammar ); // bNoListening, Insert does that
+}
+
+// Wird von den Importfiltern verwendet
+
+ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
+ const ScTokenArray* pArr,
+ const FormulaGrammar::Grammar eGrammar, sal_uInt8 cInd ) :
+ ScBaseCell( CELLTYPE_FORMULA ),
+ eTempGrammar( eGrammar),
+ pCode( pArr ? new ScTokenArray( *pArr ) : new ScTokenArray ),
+ pDocument( pDoc ),
+ pPrevious(0),
+ pNext(0),
+ pPreviousTrack(0),
+ pNextTrack(0),
+ nFormatIndex(0),
+ nFormatType( NUMBERFORMAT_NUMBER ),
+ nSeenInIteration(0),
+ cMatrixFlag ( cInd ),
+ bDirty( NULL != pArr ), // -> wg. Benutzung im Fkt.AutoPiloten, war: cInd != 0
+ bChanged( false ),
+ bRunning( false ),
+ bCompile( false ),
+ bSubTotal( false ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
+ aPos( rPos )
+{
+ // UPN-Array erzeugen
+ if( pCode->GetLen() && !pCode->GetCodeError() && !pCode->GetCodeLen() )
+ {
+ ScCompiler aComp( pDocument, aPos, *pCode);
+ aComp.SetGrammar(eTempGrammar);
+ bSubTotal = aComp.CompileTokenArray();
+ nFormatType = aComp.GetNumFormatType();
+ }
+ else
+ {
+ pCode->Reset();
+ if ( pCode->GetNextOpCodeRPN( ocSubTotal ) )
+ bSubTotal = sal_True;
+ }
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
+}
+
+ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, const ScAddress& rPos, int nCloneFlags ) :
+ ScBaseCell( rCell ),
+ SvtListener(),
+ aResult( rCell.aResult ),
+ eTempGrammar( rCell.eTempGrammar),
+ pDocument( &rDoc ),
+ pPrevious(0),
+ pNext(0),
+ pPreviousTrack(0),
+ pNextTrack(0),
+ nFormatIndex( &rDoc == rCell.pDocument ? rCell.nFormatIndex : 0 ),
+ nFormatType( rCell.nFormatType ),
+ nSeenInIteration(0),
+ cMatrixFlag ( rCell.cMatrixFlag ),
+ bDirty( rCell.bDirty ),
+ bChanged( rCell.bChanged ),
+ bRunning( false ),
+ bCompile( rCell.bCompile ),
+ bSubTotal( rCell.bSubTotal ),
+ bIsIterCell( false ),
+ bInChangeTrack( false ),
+ bTableOpDirty( false ),
+ bNeedListening( false ),
+ aPos( rPos )
+{
+ pCode = rCell.pCode->Clone();
+
+ if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
+ pCode->ReadjustRelative3DReferences( rCell.aPos, aPos );
+
+ // evtl. Fehler zuruecksetzen und neu kompilieren
+ // nicht im Clipboard - da muss das Fehlerflag erhalten bleiben
+ // Spezialfall Laenge=0: als Fehlerzelle erzeugt, dann auch Fehler behalten
+ if ( pCode->GetCodeError() && !pDocument->IsClipboard() && pCode->GetLen() )
+ {
+ pCode->SetCodeError( 0 );
+ bCompile = sal_True;
+ }
+ //! Compile ColRowNames on URM_MOVE/URM_COPY _after_ UpdateReference
+ sal_Bool bCompileLater = false;
+ sal_Bool bClipMode = rCell.pDocument->IsClipboard();
+ if( !bCompile )
+ { // Name references with references and ColRowNames
+ pCode->Reset();
+ ScToken* t;
+ while ( ( t = static_cast<ScToken*>(pCode->GetNextReferenceOrName()) ) != NULL && !bCompile )
+ {
+ if ( t->IsExternalRef() )
+ {
+ // External name, cell, and area references.
+ bCompile = true;
+ }
+ else if ( t->GetType() == svIndex )
+ {
+ ScRangeData* pRangeData = rDoc.GetRangeName()->findByIndex( t->GetIndex() );
+ if( pRangeData )
+ {
+ if( pRangeData->HasReferences() )
+ bCompile = sal_True;
+ }
+ else
+ bCompile = sal_True; // invalid reference!
+ }
+ else if ( t->GetOpCode() == ocColRowName )
+ {
+ bCompile = sal_True; // new lookup needed
+ bCompileLater = bClipMode;
+ }
+ }
+ }
+ if( bCompile )
+ {
+ if ( !bCompileLater && bClipMode )
+ {
+ // Merging ranges needs the actual positions after UpdateReference.
+ // ColRowNames need new lookup after positions are adjusted.
+ bCompileLater = pCode->HasOpCode( ocRange) || pCode->HasOpCode( ocColRowName);
+ }
+ if ( !bCompileLater )
+ {
+ // bNoListening, not at all if in Clipboard/Undo,
+ // and not from Clipboard either, instead after Insert(Clone) and UpdateReference.
+ CompileTokenArray( sal_True );
+ }
+ }
+
+ if( nCloneFlags & SC_CLONECELL_STARTLISTENING )
+ StartListeningTo( &rDoc );
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
+}
+
+ScFormulaCell::~ScFormulaCell()
+{
+ pDocument->RemoveFromFormulaTree( this );
+ pDocument->RemoveSubTotalCell(this);
+ if (pCode->HasOpCode(ocMacro))
+ pDocument->GetMacroManager()->RemoveDependentCell(this);
+
+ if (pDocument->HasExternalRefManager())
+ pDocument->GetExternalRefManager()->removeRefCell(this);
+
+ delete pCode;
+#ifdef DBG_UTIL
+ eCellType = CELLTYPE_DESTROYED;
+#endif
+}
+
+void ScFormulaCell::GetFormula( rtl::OUStringBuffer& rBuffer,
+ const FormulaGrammar::Grammar eGrammar ) const
+{
+ if( pCode->GetCodeError() && !pCode->GetLen() )
+ {
+ rBuffer = rtl::OUStringBuffer( ScGlobal::GetErrorString( pCode->GetCodeError()));
+ return;
+ }
+ else if( cMatrixFlag == MM_REFERENCE )
+ {
+ // Reference to another cell that contains a matrix formula.
+ pCode->Reset();
+ ScToken* p = static_cast<ScToken*>(pCode->GetNextReferenceRPN());
+ if( p )
+ {
+ /* FIXME: original GetFormula() code obtained
+ * pCell only if (!this->IsInChangeTrack()),
+ * GetEnglishFormula() omitted that test.
+ * Can we live without in all cases? */
+ ScBaseCell* pCell;
+ ScSingleRefData& rRef = p->GetSingleRef();
+ rRef.CalcAbsIfRel( aPos );
+ if ( rRef.Valid() )
+ pCell = pDocument->GetCell( ScAddress( rRef.nCol,
+ rRef.nRow, rRef.nTab ) );
+ else
+ pCell = NULL;
+ if (pCell && pCell->GetCellType() == CELLTYPE_FORMULA)
+ {
+ ((ScFormulaCell*)pCell)->GetFormula( rBuffer, eGrammar);
+ return;
+ }
+ else
+ {
+ ScCompiler aComp( pDocument, aPos, *pCode);
+ aComp.SetGrammar(eGrammar);
+ aComp.CreateStringFromTokenArray( rBuffer );
+ }
+ }
+ else
+ {
+ OSL_FAIL("ScFormulaCell::GetFormula: not a matrix");
+ }
+ }
+ else
+ {
+ ScCompiler aComp( pDocument, aPos, *pCode);
+ aComp.SetGrammar(eGrammar);
+ aComp.CreateStringFromTokenArray( rBuffer );
+ }
+
+ sal_Unicode ch('=');
+ rBuffer.insert( 0, &ch, 1 );
+ if( cMatrixFlag )
+ {
+ sal_Unicode ch2('{');
+ rBuffer.insert( 0, &ch2, 1);
+ rBuffer.append( sal_Unicode('}'));
+ }
+}
+
+void ScFormulaCell::GetFormula( String& rFormula, const FormulaGrammar::Grammar eGrammar ) const
+{
+ rtl::OUStringBuffer rBuffer( rFormula );
+ GetFormula( rBuffer, eGrammar );
+ rFormula = rBuffer;
+}
+
+void ScFormulaCell::GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows )
+{
+ MaybeInterpret();
+
+ const ScMatrix* pMat = NULL;
+ if (!pCode->GetCodeError() && aResult.GetType() == svMatrixCell &&
+ ((pMat = static_cast<const ScToken*>(aResult.GetToken().get())->GetMatrix()) != 0))
+ pMat->GetDimensions( rCols, rRows );
+ else
+ {
+ rCols = 0;
+ rRows = 0;
+ }
+}
+
+void ScFormulaCell::Compile( const String& rFormula, sal_Bool bNoListening,
+ const FormulaGrammar::Grammar eGrammar )
+{
+ if ( pDocument->IsClipOrUndo() ) return;
+ sal_Bool bWasInFormulaTree = pDocument->IsInFormulaTree( this );
+ if ( bWasInFormulaTree )
+ pDocument->RemoveFromFormulaTree( this );
+ // pCode darf fuer Abfragen noch nicht geloescht, muss aber leer sein
+ if ( pCode )
+ pCode->Clear();
+ ScTokenArray* pCodeOld = pCode;
+ ScCompiler aComp( pDocument, aPos);
+ aComp.SetGrammar(eGrammar);
+ pCode = aComp.CompileString( rFormula );
+ if ( pCodeOld )
+ delete pCodeOld;
+ if( !pCode->GetCodeError() )
+ {
+ if ( !pCode->GetLen() && aResult.GetHybridFormula().Len() && rFormula == aResult.GetHybridFormula() )
+ { // nicht rekursiv CompileTokenArray/Compile/CompileTokenArray
+ if ( rFormula.GetChar(0) == '=' )
+ pCode->AddBad( rFormula.GetBuffer() + 1 );
+ else
+ pCode->AddBad( rFormula.GetBuffer() );
+ }
+ bCompile = sal_True;
+ CompileTokenArray( bNoListening );
+ }
+ else
+ {
+ bChanged = sal_True;
+ SetTextWidth( TEXTWIDTH_DIRTY );
+ SetScriptType( SC_SCRIPTTYPE_UNKNOWN );
+ }
+ if ( bWasInFormulaTree )
+ pDocument->PutInFormulaTree( this );
+}
+
+
+void ScFormulaCell::CompileTokenArray( sal_Bool bNoListening )
+{
+ // Not already compiled?
+ if( !pCode->GetLen() && aResult.GetHybridFormula().Len() )
+ Compile( aResult.GetHybridFormula(), bNoListening, eTempGrammar);
+ else if( bCompile && !pDocument->IsClipOrUndo() && !pCode->GetCodeError() )
+ {
+ // RPN length may get changed
+ sal_Bool bWasInFormulaTree = pDocument->IsInFormulaTree( this );
+ if ( bWasInFormulaTree )
+ pDocument->RemoveFromFormulaTree( this );
+
+ // Loading from within filter? No listening yet!
+ if( pDocument->IsInsertingFromOtherDoc() )
+ bNoListening = sal_True;
+
+ if( !bNoListening && pCode->GetCodeLen() )
+ EndListeningTo( pDocument );
+ ScCompiler aComp(pDocument, aPos, *pCode);
+ aComp.SetGrammar(pDocument->GetGrammar());
+ bSubTotal = aComp.CompileTokenArray();
+ if( !pCode->GetCodeError() )
+ {
+ nFormatType = aComp.GetNumFormatType();
+ nFormatIndex = 0;
+ bChanged = sal_True;
+ aResult.SetToken( NULL);
+ bCompile = false;
+ if ( !bNoListening )
+ StartListeningTo( pDocument );
+ }
+ if ( bWasInFormulaTree )
+ pDocument->PutInFormulaTree( this );
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
+ }
+}
+
+
+void ScFormulaCell::CompileXML( ScProgress& rProgress )
+{
+ if ( cMatrixFlag == MM_REFERENCE )
+ { // is already token code via ScDocFunc::EnterMatrix, ScDocument::InsertMatrixFormula
+ // just establish listeners
+ StartListeningTo( pDocument );
+ return ;
+ }
+
+ ScCompiler aComp( pDocument, aPos, *pCode);
+ aComp.SetGrammar(eTempGrammar);
+ String aFormula, aFormulaNmsp;
+ aComp.CreateStringFromXMLTokenArray( aFormula, aFormulaNmsp );
+ pDocument->DecXMLImportedFormulaCount( aFormula.Len() );
+ rProgress.SetStateCountDownOnPercent( pDocument->GetXMLImportedFormulaCount() );
+ // pCode darf fuer Abfragen noch nicht geloescht, muss aber leer sein
+ if ( pCode )
+ pCode->Clear();
+ ScTokenArray* pCodeOld = pCode;
+ pCode = aComp.CompileString( aFormula, aFormulaNmsp );
+ delete pCodeOld;
+ if( !pCode->GetCodeError() )
+ {
+ if ( !pCode->GetLen() )
+ {
+ if ( aFormula.GetChar(0) == '=' )
+ pCode->AddBad( aFormula.GetBuffer() + 1 );
+ else
+ pCode->AddBad( aFormula.GetBuffer() );
+ }
+ bSubTotal = aComp.CompileTokenArray();
+ if( !pCode->GetCodeError() )
+ {
+ nFormatType = aComp.GetNumFormatType();
+ nFormatIndex = 0;
+ bChanged = sal_True;
+ bCompile = false;
+ StartListeningTo( pDocument );
+ }
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
+ }
+ else
+ {
+ bChanged = sal_True;
+ SetTextWidth( TEXTWIDTH_DIRTY );
+ SetScriptType( SC_SCRIPTTYPE_UNKNOWN );
+ }
+
+ // Same as in Load: after loading, it must be known if ocMacro is in any formula
+ // (for macro warning, CompileXML is called at the end of loading XML file)
+ if ( !pDocument->GetHasMacroFunc() && pCode->HasOpCodeRPN( ocMacro ) )
+ pDocument->SetHasMacroFunc( sal_True );
+}
+
+
+void ScFormulaCell::CalcAfterLoad()
+{
+ sal_Bool bNewCompiled = false;
+ // Falls ein Calc 1.0-Doc eingelesen wird, haben wir ein Ergebnis,
+ // aber kein TokenArray
+ if( !pCode->GetLen() && aResult.GetHybridFormula().Len() )
+ {
+ Compile( aResult.GetHybridFormula(), sal_True, eTempGrammar);
+ aResult.SetToken( NULL);
+ bDirty = sal_True;
+ bNewCompiled = sal_True;
+ }
+ // Das UPN-Array wird nicht erzeugt, wenn ein Calc 3.0-Doc eingelesen
+ // wurde, da die RangeNames erst jetzt existieren.
+ if( pCode->GetLen() && !pCode->GetCodeLen() && !pCode->GetCodeError() )
+ {
+ ScCompiler aComp(pDocument, aPos, *pCode);
+ aComp.SetGrammar(pDocument->GetGrammar());
+ bSubTotal = aComp.CompileTokenArray();
+ nFormatType = aComp.GetNumFormatType();
+ nFormatIndex = 0;
+ bDirty = true;
+ bCompile = false;
+ bNewCompiled = true;
+
+ if (bSubTotal)
+ pDocument->AddSubTotalCell(this);
+ }
+ // irgendwie koennen unter os/2 mit rotter FPU-Exception /0 ohne Err503
+ // gespeichert werden, woraufhin spaeter im NumberFormatter die BLC Lib
+ // bei einem fabs(-NAN) abstuerzt (#32739#)
+ // hier fuer alle Systeme ausbuegeln, damit da auch Err503 steht
+ if ( aResult.IsValue() && !::rtl::math::isFinite( aResult.GetDouble() ) )
+ {
+ DBG_ERRORFILE("Formelzelle INFINITY !!! Woher kommt das Dokument?");
+ aResult.SetResultError( errIllegalFPOperation );
+ bDirty = sal_True;
+ }
+ // DoubleRefs bei binaeren Operatoren waren vor v5.0 immer Matrix,
+ // jetzt nur noch wenn in Matrixformel, sonst implizite Schnittmenge
+ if ( pDocument->GetSrcVersion() < SC_MATRIX_DOUBLEREF &&
+ GetMatrixFlag() == MM_NONE && pCode->HasMatrixDoubleRefOps() )
+ {
+ cMatrixFlag = MM_FORMULA;
+ SetMatColsRows( 1, 1);
+ }
+ // Muss die Zelle berechnet werden?
+ // Nach Load koennen Zellen einen Fehlercode enthalten, auch dann
+ // Listener starten und ggbf. neu berechnen wenn nicht RECALCMODE_NORMAL
+ if( !bNewCompiled || !pCode->GetCodeError() )
+ {
+ StartListeningTo( pDocument );
+ if( !pCode->IsRecalcModeNormal() )
+ bDirty = sal_True;
+ }
+ if ( pCode->IsRecalcModeAlways() )
+ { // zufall(), heute(), jetzt() bleiben immer im FormulaTree, damit sie
+ // auch bei jedem F9 berechnet werden.
+ bDirty = sal_True;
+ }
+ // Noch kein SetDirty weil noch nicht alle Listener bekannt, erst in
+ // SetDirtyAfterLoad.
+}
+
+
+bool ScFormulaCell::MarkUsedExternalReferences()
+{
+ return pCode && pDocument->MarkUsedExternalReferences( *pCode);
+}
+
+
+void ScFormulaCell::Interpret()
+{
+ if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn())
+ return; // no double/triple processing
+
+ //! HACK:
+ // Wenn der Aufruf aus einem Reschedule im DdeLink-Update kommt, dirty stehenlassen
+ // Besser: Dde-Link Update ohne Reschedule oder ganz asynchron !!!
+
+ if ( pDocument->IsInDdeLinkUpdate() )
+ return;
+
+ if (bRunning)
+ {
+ if (!pDocument->GetDocOptions().IsIter())
+ {
+ aResult.SetResultError( errCircularReference );
+ return;
+ }
+
+ if (aResult.GetResultError() == errCircularReference)
+ aResult.SetResultError( 0 );
+
+ // Start or add to iteration list.
+ if (!pDocument->GetRecursionHelper().IsDoingIteration() ||
+ !pDocument->GetRecursionHelper().GetRecursionInIterationStack().top()->bIsIterCell)
+ pDocument->GetRecursionHelper().SetInIterationReturn( true);
+
+ return;
+ }
+ // no multiple interprets for GetErrCode, IsValue, GetValue and
+ // different entry point recursions. Would also lead to premature
+ // convergence in iterations.
+ if (pDocument->GetRecursionHelper().GetIteration() && nSeenInIteration ==
+ pDocument->GetRecursionHelper().GetIteration())
+ return ;
+
+ ScRecursionHelper& rRecursionHelper = pDocument->GetRecursionHelper();
+ sal_Bool bOldRunning = bRunning;
+ if (rRecursionHelper.GetRecursionCount() > MAXRECURSION)
+ {
+