summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-06-18 12:14:29 +0200
committerNoel Grandin <noel@peralex.com>2014-06-24 11:34:21 +0200
commite2080e70fe8b085f18e868e46340454720fa94ca (patch)
tree4038d1d57b41b68a47d5ebbbe6ad390648ec6303
parentf910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff)
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
-rw-r--r--binaryurp/source/binaryany.hxx2
-rw-r--r--binaryurp/source/bridge.cxx4
-rw-r--r--chart2/source/view/charttypes/GL3DBarChart.cxx6
-rw-r--r--chart2/source/view/main/OpenglShapeFactory.cxx6
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx10
-rw-r--r--codemaker/source/javamaker/javatype.cxx4
-rw-r--r--comphelper/source/property/propertysethelper.cxx4
-rw-r--r--comphelper/source/property/propertysetinfo.cxx4
-rw-r--r--compilerplugins/clang/returnbyref.cxx153
-rw-r--r--connectivity/source/drivers/mork/MNSINIParser.hxx2
-rw-r--r--connectivity/source/drivers/mork/MNSProfileDiscover.cxx2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx8
-rw-r--r--connectivity/source/inc/odbc/OBoundParam.hxx4
-rw-r--r--dbaccess/source/ui/control/RelationControl.cxx38
-rw-r--r--dbaccess/source/ui/dlg/RelationDlg.cxx2
-rw-r--r--dbaccess/source/ui/inc/JoinController.hxx4
-rw-r--r--dbaccess/source/ui/inc/JoinTableView.hxx14
-rw-r--r--dbaccess/source/ui/inc/TableConnection.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableConnectionData.hxx4
-rw-r--r--dbaccess/source/ui/inc/TableController.hxx4
-rw-r--r--dbaccess/source/ui/inc/TableWindow.hxx4
-rw-r--r--dbaccess/source/ui/inc/WCopyTable.hxx12
-rw-r--r--dbaccess/source/ui/misc/WCPage.cxx12
-rw-r--r--dbaccess/source/ui/misc/WColumnSelect.cxx42
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx6
-rw-r--r--dbaccess/source/ui/misc/WExtendPages.cxx8
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx24
-rw-r--r--dbaccess/source/ui/misc/WTypeSelect.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/JAccess.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/JoinDesignView.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx152
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx54
-rw-r--r--dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx224
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx85
-rw-r--r--dbaccess/source/ui/querydesign/TableConnection.cxx18
-rw-r--r--dbaccess/source/ui/querydesign/TableConnectionData.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx27
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowTitle.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationDesignView.cxx2
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx34
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx24
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldControl.cxx2
-rw-r--r--editeng/source/uno/unotext.cxx2
-rw-r--r--extensions/source/plugin/base/evtlstnr.cxx2
-rw-r--r--extensions/source/plugin/base/manager.cxx2
-rw-r--r--extensions/source/plugin/base/nfuncs.cxx6
-rw-r--r--extensions/source/plugin/base/plcom.cxx4
-rw-r--r--extensions/source/plugin/base/xplugin.cxx24
-rw-r--r--extensions/source/plugin/inc/plugin/impl.hxx6
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx30
-rw-r--r--hwpfilter/source/hpara.h2
-rw-r--r--hwpfilter/source/hwpfile.h6
-rw-r--r--hwpfilter/source/hwpreader.cxx186
-rw-r--r--idlc/inc/idlc/idlc.hxx4
-rw-r--r--include/basic/sbxvar.hxx2
-rw-r--r--include/codemaker/exceptiontree.hxx4
-rw-r--r--include/comphelper/propertysetinfo.hxx2
-rw-r--r--include/editeng/unoipset.hxx2
-rw-r--r--include/svx/charmap.hxx2
-rw-r--r--include/vcl/openglwin.hxx2
-rw-r--r--lotuswordpro/source/filter/benlist.cxx12
-rw-r--r--lotuswordpro/source/filter/benobj.cxx2
-rw-r--r--lotuswordpro/source/filter/bento.hxx18
-rw-r--r--lotuswordpro/source/filter/lwp9reader.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpbackgroundoverride.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpbulletstylemgr.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpcelllayout.cxx36
-rw-r--r--lotuswordpro/source/filter/lwpcelllayout.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpcharacterstyle.cxx8
-rw-r--r--lotuswordpro/source/filter/lwpcontent.hxx6
-rw-r--r--lotuswordpro/source/filter/lwpdivinfo.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpdivinfo.hxx6
-rw-r--r--lotuswordpro/source/filter/lwpdlvlist.hxx18
-rw-r--r--lotuswordpro/source/filter/lwpdoc.cxx102
-rw-r--r--lotuswordpro/source/filter/lwpdoc.hxx42
-rw-r--r--lotuswordpro/source/filter/lwpfilehdr.hxx6
-rw-r--r--lotuswordpro/source/filter/lwpfnlayout.cxx32
-rw-r--r--lotuswordpro/source/filter/lwpfootnote.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpfootnote.hxx14
-rw-r--r--lotuswordpro/source/filter/lwpfoundry.cxx46
-rw-r--r--lotuswordpro/source/filter/lwpfoundry.hxx22
-rw-r--r--lotuswordpro/source/filter/lwpframelayout.cxx31
-rw-r--r--lotuswordpro/source/filter/lwpframelayout.hxx4
-rw-r--r--lotuswordpro/source/filter/lwpfrib.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpfribbreaks.cxx2
-rw-r--r--lotuswordpro/source/filter/lwpfribbreaks.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpfribframe.cxx2
-rw-r--r--lotuswordpro/source/filter/lwpfribmark.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpfribptr.cxx12
-rw-r--r--lotuswordpro/source/filter/lwpfribsection.cxx28
-rw-r--r--lotuswordpro/source/filter/lwpfribtable.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.cxx34
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpholder.hxx12
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx70
-rw-r--r--lotuswordpro/source/filter/lwplayout.hxx8
-rw-r--r--lotuswordpro/source/filter/lwplaypiece.hxx14
-rw-r--r--lotuswordpro/source/filter/lwpmarker.cxx5
-rw-r--r--lotuswordpro/source/filter/lwpnotes.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpobj.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpobjfactory.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpobjfactory.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpobjhdr.hxx6
-rw-r--r--lotuswordpro/source/filter/lwpobjid.cxx8
-rw-r--r--lotuswordpro/source/filter/lwppagehint.hxx4
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.cxx56
-rw-r--r--lotuswordpro/source/filter/lwppara.cxx29
-rw-r--r--lotuswordpro/source/filter/lwppara.hxx14
-rw-r--r--lotuswordpro/source/filter/lwppara1.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpparastyle.cxx16
-rw-r--r--lotuswordpro/source/filter/lwpproplist.cxx4
-rw-r--r--lotuswordpro/source/filter/lwprowlayout.cxx38
-rw-r--r--lotuswordpro/source/filter/lwprowlayout.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpsection.hxx16
-rw-r--r--lotuswordpro/source/filter/lwpsilverbullet.cxx36
-rw-r--r--lotuswordpro/source/filter/lwpsilverbullet.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpslvlist.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpstory.cxx70
-rw-r--r--lotuswordpro/source/filter/lwpstory.hxx14
-rw-r--r--lotuswordpro/source/filter/lwptable.cxx2
-rw-r--r--lotuswordpro/source/filter/lwptable.hxx2
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx91
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.hxx2
-rw-r--r--lotuswordpro/source/filter/lwptaboverride.hxx8
-rw-r--r--lotuswordpro/source/filter/lwptblcell.hxx10
-rw-r--r--lotuswordpro/source/filter/lwptoc.cxx16
-rw-r--r--lotuswordpro/source/filter/lwpvpointer.hxx2
-rw-r--r--lotuswordpro/source/filter/tocread.cxx10
-rw-r--r--lotuswordpro/source/filter/utlist.cxx14
-rw-r--r--lotuswordpro/source/filter/utlist.hxx4
-rw-r--r--lotuswordpro/source/filter/xfilter/xfborders.hxx8
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx6
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx8
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx6
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx8
-rw-r--r--sc/inc/document.hxx4
-rw-r--r--sc/inc/dpfilteredcache.hxx2
-rw-r--r--sc/inc/externalrefmgr.hxx2
-rw-r--r--sc/inc/olinetab.hxx8
-rw-r--r--sc/inc/refreshtimerprotector.hxx4
-rw-r--r--sc/qa/extras/macros-test.cxx4
-rw-r--r--sc/qa/unit/filters-test.cxx172
-rw-r--r--sc/qa/unit/helper/qahelper.cxx14
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
-rw-r--r--sc/qa/unit/helper/shared_test_impl.hxx26
-rw-r--r--sc/qa/unit/opencl-test.cxx2986
-rw-r--r--sc/qa/unit/rangelst_test.cxx2
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx634
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx715
-rw-r--r--sc/qa/unit/ucalc.cxx74
-rw-r--r--sc/qa/unit/ucalc_formula.cxx114
-rw-r--r--sc/qa/unit/ucalc_sharedformula.cxx10
-rw-r--r--sc/source/core/data/dpfilteredcache.cxx12
-rw-r--r--sc/source/core/data/dpgroup.cxx28
-rw-r--r--sc/source/core/data/dpobject.cxx2
-rw-r--r--sc/source/core/data/dpshttab.cxx4
-rw-r--r--sc/source/core/data/dptabdat.cxx15
-rw-r--r--sc/source/core/data/dptabsrc.cxx2
-rw-r--r--sc/source/core/data/table2.cxx21
-rw-r--r--sc/source/core/tool/consoli.cxx4
-rw-r--r--sc/source/core/tool/dbdata.cxx2
-rw-r--r--sc/source/core/tool/refreshtimer.cxx14
-rw-r--r--sc/source/filter/excel/impop.cxx4
-rw-r--r--sc/source/filter/excel/xestream.cxx6
-rw-r--r--sc/source/filter/excel/xetable.cxx22
-rw-r--r--sc/source/filter/inc/xetable.hxx2
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx2
-rw-r--r--sc/source/filter/xml/XMLExportIterator.hxx4
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.hxx2
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx6
-rw-r--r--sc/source/filter/xml/xmldrani.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx41
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx4
-rw-r--r--sc/source/filter/xml/xmltabi.cxx20
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleCell.cxx12
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx77
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx20
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx31
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx12
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx112
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx97
-rw-r--r--sc/source/ui/app/client.cxx6
-rw-r--r--sc/source/ui/app/drwtrans.cxx21
-rw-r--r--sc/source/ui/app/inputhdl.cxx120
-rw-r--r--sc/source/ui/app/inputwin.cxx82
-rw-r--r--sc/source/ui/app/scmod.cxx70
-rw-r--r--sc/source/ui/app/seltrans.cxx20
-rw-r--r--sc/source/ui/app/transobj.cxx46
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx12
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx2
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx2
-rw-r--r--sc/source/ui/docshell/arealink.cxx60
-rw-r--r--sc/source/ui/docshell/datastream.cxx7
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx302
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx66
-rw-r--r--sc/source/ui/docshell/docfunc.cxx1056
-rw-r--r--sc/source/ui/docshell/docsh.cxx42
-rw-r--r--sc/source/ui/docshell/docsh3.cxx10
-rw-r--r--sc/source/ui/docshell/docsh4.cxx127
-rw-r--r--sc/source/ui/docshell/docsh5.cxx20
-rw-r--r--sc/source/ui/docshell/docsh6.cxx4
-rw-r--r--sc/source/ui/docshell/docsh8.cxx14
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx36
-rw-r--r--sc/source/ui/docshell/olinefun.cxx259
-rw-r--r--sc/source/ui/docshell/servobj.cxx26
-rw-r--r--sc/source/ui/docshell/tablink.cxx93
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx20
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx12
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx12
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx60
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx10
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx14
-rw-r--r--sc/source/ui/drawfunc/fusel2.cxx12
-rw-r--r--sc/source/ui/drawfunc/futext.cxx12
-rw-r--r--sc/source/ui/drawfunc/futext2.cxx4
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx8
-rw-r--r--sc/source/ui/inc/consdlg.hxx2
-rw-r--r--sc/source/ui/inc/datastream.hxx1
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sc/source/ui/inc/optsolver.hxx2
-rw-r--r--sc/source/ui/inc/prevwsh.hxx2
-rw-r--r--sc/source/ui/inc/tabview.hxx6
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx16
-rw-r--r--sc/source/ui/miscdlgs/datastreamdlg.cxx8
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx2
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx22
-rw-r--r--sc/source/ui/miscdlgs/redcom.cxx16
-rw-r--r--sc/source/ui/namedlg/namepast.cxx4
-rw-r--r--sc/source/ui/navipi/content.cxx24
-rw-r--r--sc/source/ui/navipi/navipi.cxx4
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx2
-rw-r--r--sc/source/ui/optdlg/tpview.cxx2
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx4
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx6
-rw-r--r--sc/source/ui/undo/undobase.cxx92
-rw-r--r--sc/source/ui/undo/undoblk.cxx332
-rw-r--r--sc/source/ui/undo/undoblk2.cxx22
-rw-r--r--sc/source/ui/undo/undoblk3.cxx296
-rw-r--r--sc/source/ui/undo/undocell.cxx130
-rw-r--r--sc/source/ui/undo/undocell2.cxx4
-rw-r--r--sc/source/ui/undo/undodat.cxx366
-rw-r--r--sc/source/ui/undo/undorangename.cxx14
-rw-r--r--sc/source/ui/undo/undostyl.cxx20
-rw-r--r--sc/source/ui/undo/undotab.cxx266
-rw-r--r--sc/source/ui/undo/undoutil.cxx4
-rw-r--r--sc/source/ui/unoobj/addruno.cxx20
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx768
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx82
-rw-r--r--sc/source/ui/unoobj/confuno.cxx550
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx24
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx46
-rw-r--r--sc/source/ui/unoobj/datauno.cxx68
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx88
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx288
-rw-r--r--sc/source/ui/unoobj/drdefuno.cxx6
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx10
-rw-r--r--sc/source/ui/unoobj/eventuno.cxx10
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx4
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx12
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx213
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx130
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx6
-rw-r--r--sc/source/ui/unoobj/servuno.cxx44
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx84
-rw-r--r--sc/source/ui/unoobj/targuno.cxx8
-rw-r--r--sc/source/ui/unoobj/textuno.cxx22
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx34
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx262
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx18
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx26
-rw-r--r--sc/source/ui/vba/vbachart.cxx10
-rw-r--r--sc/source/ui/vba/vbaeventshelper.cxx2
-rw-r--r--sc/source/ui/vba/vbaname.cxx4
-rw-r--r--sc/source/ui/vba/vbanames.cxx6
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx4
-rw-r--r--sc/source/ui/vba/vbarange.cxx157
-rw-r--r--sc/source/ui/vba/vbarange.hxx2
-rw-r--r--sc/source/ui/vba/vbatextboxshape.cxx2
-rw-r--r--sc/source/ui/vba/vbawindow.cxx30
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx10
-rw-r--r--sc/source/ui/vba/vbaworksheet.cxx30
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx4
-rw-r--r--sc/source/ui/view/cellsh.cxx16
-rw-r--r--sc/source/ui/view/cellsh2.cxx16
-rw-r--r--sc/source/ui/view/dbfunc.cxx94
-rw-r--r--sc/source/ui/view/dbfunc2.cxx10
-rw-r--r--sc/source/ui/view/dbfunc3.cxx254
-rw-r--r--sc/source/ui/view/drawvie4.cxx4
-rw-r--r--sc/source/ui/view/formatsh.cxx78
-rw-r--r--sc/source/ui/view/gridwin.cxx48
-rw-r--r--sc/source/ui/view/gridwin2.cxx18
-rw-r--r--sc/source/ui/view/gridwin4.cxx30
-rw-r--r--sc/source/ui/view/hdrcont.cxx14
-rw-r--r--sc/source/ui/view/olinewin.cxx2
-rw-r--r--sc/source/ui/view/pfuncache.cxx18
-rw-r--r--sc/source/ui/view/pgbrksh.cxx6
-rw-r--r--sc/source/ui/view/pivotsh.cxx24
-rw-r--r--sc/source/ui/view/preview.cxx66
-rw-r--r--sc/source/ui/view/prevwsh.cxx32
-rw-r--r--sc/source/ui/view/prevwsh2.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx2
-rw-r--r--sc/source/ui/view/reffact.cxx4
-rw-r--r--sc/source/ui/view/select.cxx2
-rw-r--r--sc/source/ui/view/spelldialog.cxx4
-rw-r--r--sc/source/ui/view/spelleng.cxx2
-rw-r--r--sc/source/ui/view/tabcont.cxx6
-rw-r--r--sc/source/ui/view/tabview.cxx12
-rw-r--r--sc/source/ui/view/tabview2.cxx4
-rw-r--r--sc/source/ui/view/tabview3.cxx6
-rw-r--r--sc/source/ui/view/tabvwsh.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx8
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx70
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx192
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx42
-rw-r--r--sc/source/ui/view/tabvwsh8.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx127
-rw-r--r--sc/source/ui/view/tabvwshb.cxx24
-rw-r--r--sc/source/ui/view/tabvwshc.cxx116
-rw-r--r--sc/source/ui/view/tabvwshd.cxx2
-rw-r--r--sc/source/ui/view/tabvwshe.cxx26
-rw-r--r--sc/source/ui/view/tabvwshf.cxx76
-rw-r--r--sc/source/ui/view/tabvwshg.cxx8
-rw-r--r--sc/source/ui/view/tabvwshh.cxx8
-rw-r--r--sc/source/ui/view/viewdata.cxx4
-rw-r--r--sc/source/ui/view/viewfun2.cxx532
-rw-r--r--sc/source/ui/view/viewfun3.cxx116
-rw-r--r--sc/source/ui/view/viewfun4.cxx154
-rw-r--r--sc/source/ui/view/viewfun5.cxx44
-rw-r--r--sc/source/ui/view/viewfun6.cxx90
-rw-r--r--sc/source/ui/view/viewfun7.cxx42
-rw-r--r--sc/source/ui/view/viewfunc.cxx598
-rw-r--r--sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleOutlineView.cxx6
-rw-r--r--sd/source/ui/app/sdmod2.cxx8
-rw-r--r--sd/source/ui/docshell/docshel4.cxx2
-rw-r--r--sd/source/ui/docshell/docshell.cxx4
-rw-r--r--sd/source/ui/func/fubullet.cxx4
-rw-r--r--sd/source/ui/func/fuinsfil.cxx28
-rw-r--r--sd/source/ui/func/fupoor.cxx20
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/OutlineView.hxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx4
-rw-r--r--sd/source/ui/unoidl/unopage.cxx2
-rw-r--r--sd/source/ui/unoidl/unopback.cxx4
-rw-r--r--sd/source/ui/view/drtxtob.cxx2
-rw-r--r--sd/source/ui/view/outlnvs2.cxx8
-rw-r--r--sd/source/ui/view/outlnvsh.cxx149
-rw-r--r--sd/source/ui/view/viewshel.cxx5
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx6
-rw-r--r--shell/source/sessioninstall/SyncDbusSessionHelper.cxx8
-rw-r--r--starmath/inc/view.hxx4
-rw-r--r--starmath/source/edit.cxx2
-rw-r--r--starmath/source/view.cxx5
-rw-r--r--svx/source/accessibility/charmapacc.cxx18
-rw-r--r--svx/source/unodraw/unoshape.cxx6
-rw-r--r--sw/inc/crsrsh.hxx2
-rw-r--r--sw/inc/dcontact.hxx4
-rw-r--r--sw/inc/pam.hxx8
-rw-r--r--sw/inc/txatbase.hxx6
-rw-r--r--sw/qa/core/uwriter.cxx42
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx6
-rw-r--r--sw/source/core/access/accpara.cxx12
-rw-r--r--sw/source/core/crsr/callnk.cxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx26
-rw-r--r--sw/source/core/crsr/crstrvl.cxx30
-rw-r--r--sw/source/core/crsr/findattr.cxx18
-rw-r--r--sw/source/core/crsr/findtxt.cxx12
-rw-r--r--sw/source/core/crsr/pam.cxx6
-rw-r--r--sw/source/core/crsr/swcrsr.cxx34
-rw-r--r--sw/source/core/crsr/trvlfnfl.cxx12
-rw-r--r--sw/source/core/crsr/trvlreg.cxx8
-rw-r--r--sw/source/core/crsr/trvltbl.cxx2
-rw-r--r--sw/source/core/crsr/viscrs.cxx2
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx16
-rw-r--r--sw/source/core/doc/docedt.cxx16
-rw-r--r--sw/source/core/doc/docfld.cxx10
-rw-r--r--sw/source/core/doc/docfmt.cxx4
-rw-r--r--sw/source/core/doc/docftn.cxx8
-rw-r--r--sw/source/core/doc/doclay.cxx2
-rw-r--r--sw/source/core/doc/docruby.cxx10
-rw-r--r--sw/source/core/doc/doctxm.cxx16
-rw-r--r--sw/source/core/doc/ftnidx.cxx2
-rw-r--r--sw/source/core/doc/textboxhelper.cxx2
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/ndcopy.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx6
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx2
-rw-r--r--sw/source/core/docnode/node2lay.cxx2
-rw-r--r--sw/source/core/docnode/nodedump.cxx2
-rw-r--r--sw/source/core/draw/dcontact.cxx16
-rw-r--r--sw/source/core/edit/acorrect.cxx6
-rw-r--r--sw/source/core/edit/autofmt.cxx10
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/eddel.cxx14
-rw-r--r--sw/source/core/edit/editsh.cxx38
-rw-r--r--sw/source/core/edit/edlingu.cxx6
-rw-r--r--sw/source/core/edit/ednumber.cxx16
-rw-r--r--sw/source/core/edit/edtab.cxx6
-rw-r--r--sw/source/core/edit/edws.cxx6
-rw-r--r--sw/source/core/fields/ddefld.cxx4
-rw-r--r--sw/source/core/fields/expfld.cxx4
-rw-r--r--sw/source/core/fields/postithelper.cxx2
-rw-r--r--sw/source/core/fields/reffld.cxx10
-rw-r--r--sw/source/core/frmedt/fecopy.cxx22
-rw-r--r--sw/source/core/frmedt/fefly1.cxx2
-rw-r--r--sw/source/core/frmedt/fetab.cxx6
-rw-r--r--sw/source/core/frmedt/tblsel.cxx8
-rw-r--r--sw/source/core/inc/doctxm.hxx2
-rw-r--r--sw/source/core/inc/flowfrm.hxx4
-rw-r--r--sw/source/core/inc/fntcache.hxx4
-rw-r--r--sw/source/core/inc/swfntcch.hxx4
-rw-r--r--sw/source/core/layout/calcmove.cxx2
-rw-r--r--sw/source/core/layout/flowfrm.cxx10
-rw-r--r--sw/source/core/layout/flycnt.cxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx6
-rw-r--r--sw/source/core/layout/ftnfrm.cxx2
-rw-r--r--sw/source/core/layout/laycache.cxx8
-rw-r--r--sw/source/core/layout/layhelp.hxx2
-rw-r--r--sw/source/core/layout/layouter.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx17
-rw-r--r--sw/source/core/layout/tabfrm.cxx2
-rw-r--r--sw/source/core/layout/trvlfrm.cxx10
-rw-r--r--sw/source/core/layout/wsfrm.cxx2
-rw-r--r--sw/source/core/table/swtable.cxx4
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx14
-rw-r--r--sw/source/core/text/frmform.cxx60
-rw-r--r--sw/source/core/text/frmpaint.cxx26
-rw-r--r--sw/source/core/text/inftxt.cxx10
-rw-r--r--sw/source/core/text/inftxt.hxx10
-rw-r--r--sw/source/core/text/itradj.cxx6
-rw-r--r--sw/source/core/text/itratr.cxx8
-rw-r--r--sw/source/core/text/itrform2.cxx26
-rw-r--r--sw/source/core/text/itrpaint.cxx2
-rw-r--r--sw/source/core/text/itrtxt.cxx2
-rw-r--r--sw/source/core/text/porfly.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx2
-rw-r--r--sw/source/core/text/porlay.hxx12
-rw-r--r--sw/source/core/text/pormulti.cxx22
-rw-r--r--sw/source/core/text/porrst.cxx4
-rw-r--r--sw/source/core/text/redlnitr.cxx2
-rw-r--r--sw/source/core/text/txtdrop.cxx6
-rw-r--r--sw/source/core/text/txtfld.cxx4
-rw-r--r--sw/source/core/text/txtfrm.cxx32
-rw-r--r--sw/source/core/text/txtftn.cxx8
-rw-r--r--sw/source/core/text/txthyph.cxx2
-rw-r--r--sw/source/core/tox/ToxTextGenerator.cxx2
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/tox/txmsrt.cxx22
-rw-r--r--sw/source/core/txtnode/atrfld.cxx16
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
-rw-r--r--sw/source/core/txtnode/fntcap.cxx2
-rw-r--r--sw/source/core/txtnode/modeltoviewhelper.cxx2
-rw-r--r--sw/source/core/txtnode/ndhints.cxx30
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx76
-rw-r--r--sw/source/core/txtnode/thints.cxx112
-rw-r--r--sw/source/core/txtnode/txatritr.cxx2
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx6
-rw-r--r--sw/source/core/txtnode/txtedt.cxx8
-rw-r--r--sw/source/core/undo/rolbck.cxx16
-rw-r--r--sw/source/core/undo/unattr.cxx6
-rw-r--r--sw/source/core/undo/undel.cxx2
-rw-r--r--sw/source/core/undo/undobj.cxx18
-rw-r--r--sw/source/core/undo/undobj1.cxx2
-rw-r--r--sw/source/core/undo/unins.cxx2
-rw-r--r--sw/source/core/undo/unmove.cxx4
-rw-r--r--sw/source/core/undo/unovwr.cxx4
-rw-r--r--sw/source/core/undo/unredln.cxx23
-rw-r--r--sw/source/core/undo/unsort.cxx2
-rw-r--r--sw/source/core/undo/unspnd.cxx2
-rw-r--r--sw/source/core/undo/untbl.cxx12
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx40
-rw-r--r--sw/source/core/unocore/unodraw.cxx6
-rw-r--r--sw/source/core/unocore/unofield.cxx12
-rw-r--r--sw/source/core/unocore/unoframe.cxx8
-rw-r--r--sw/source/core/unocore/unoftn.cxx10
-rw-r--r--sw/source/core/unocore/unoidx.cxx12
-rw-r--r--sw/source/core/unocore/unoobj.cxx16
-rw-r--r--sw/source/core/unocore/unoobj2.cxx12
-rw-r--r--sw/source/core/unocore/unoport.cxx2
-rw-r--r--sw/source/core/unocore/unoportenum.cxx18
-rw-r--r--sw/source/core/unocore/unoredline.cxx10
-rw-r--r--sw/source/core/unocore/unorefmk.cxx20
-rw-r--r--sw/source/core/unocore/unosect.cxx18
-rw-r--r--sw/source/core/unocore/unotbl.cxx18
-rw-r--r--sw/source/core/unocore/unotext.cxx41
-rw-r--r--sw/source/core/view/vprint.cxx2
-rw-r--r--sw/source/filter/ascii/ascatr.cxx8
-rw-r--r--sw/source/filter/basflt/shellio.cxx10
-rw-r--r--sw/source/filter/html/htmlatr.cxx12
-rw-r--r--sw/source/filter/html/htmlfld.cxx2
-rw-r--r--sw/source/filter/html/htmlfldw.cxx2
-rw-r--r--sw/source/filter/html/htmlftn.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmlnumreader.cxx8
-rw-r--r--sw/source/filter/html/htmlnumwriter.cxx4
-rw-r--r--sw/source/filter/html/htmltab.cxx2
-rw-r--r--sw/source/filter/html/swhtml.cxx10
-rw-r--r--sw/source/filter/html/wrthtml.cxx24
-rw-r--r--sw/source/filter/ww1/fltshell.cxx2
-rw-r--r--sw/source/filter/ww1/w1filter.cxx6
-rw-r--r--sw/source/filter/ww1/w1struct.hxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx36
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx46
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par.cxx20
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx4
-rw-r--r--sw/source/filter/xml/xmltbli.cxx2
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx2
-rw-r--r--sw/source/ui/misc/swmodalredlineacceptdlg.cxx2
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx8
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx8
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx4
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx6
-rw-r--r--sw/source/uibase/docvw/frmsidebarwincontainer.cxx2
-rw-r--r--sw/source/uibase/inc/pview.hxx6
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx2
-rw-r--r--sw/source/uibase/shells/langhelper.cxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx10
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx10
-rw-r--r--sw/source/uibase/wrtsh/delete.cxx9
-rw-r--r--ucb/source/sorter/sortresult.cxx10
-rw-r--r--ucb/source/sorter/sortresult.hxx6
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx2
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.hxx4
-rw-r--r--vcl/inc/generic/glyphcache.hxx2
-rw-r--r--vcl/inc/ilstbox.hxx2
-rw-r--r--vcl/source/control/combobox.cxx46
-rw-r--r--vcl/source/control/ilstbox.cxx12
-rw-r--r--vcl/source/control/lstbox.cxx60
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx8
-rw-r--r--vcl/source/window/openglwin.cxx4
-rw-r--r--xmloff/source/text/txtparae.cxx28
-rw-r--r--xmlscript/source/xmldlg_imexp/imp_share.hxx4
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx12
559 files changed, 10063 insertions, 10616 deletions
diff --git a/binaryurp/source/binaryany.hxx b/binaryurp/source/binaryany.hxx
index 38197f12b7bf..717216ae5473 100644
--- a/binaryurp/source/binaryany.hxx
+++ b/binaryurp/source/binaryany.hxx
@@ -47,7 +47,7 @@ public:
BinaryAny & operator =(BinaryAny const & other) throw ();
- uno_Any * get() throw () { return &data_; }
+ uno_Any& get() throw () { return data_; }
com::sun::star::uno::TypeDescription getType() const throw ();
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index dc0f3476bb9a..9191d2349e50 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -352,7 +352,7 @@ BinaryAny Bridge::mapCppToBinaryAny(css::uno::Any const & cppAny) {
BinaryAny out;
out.~BinaryAny();
uno_copyAndConvertData(
- out.get(), &in,
+ &out.get(), &in,
css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()).get(),
cppToBinaryMapping_.get());
return out;
@@ -992,7 +992,7 @@ css::uno::Any Bridge::mapBinaryToCppAny(BinaryAny const & binaryAny) {
css::uno::Any out;
out.~Any();
uno_copyAndConvertData(
- &out, in.get(),
+ &out, &in.get(),
css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()).get(),
binaryToCppMapping_.get());
return out;
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 808bb90df0c1..f29202eeae13 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -301,10 +301,10 @@ void GL3DBarChart::render()
if(!mbValidContext)
return;
- mrWindow.getContext()->makeCurrent();
+ mrWindow.getContext().makeCurrent();
Size aSize = mrWindow.GetSizePixel();
mpRenderer->SetSize(aSize);
- mrWindow.getContext()->setWinSize(aSize);
+ mrWindow.getContext().setWinSize(aSize);
if(mbNeedsNewRender)
{
for(boost::ptr_vector<opengl3D::Renderable3DObject>::iterator itr = maShapes.begin(),
@@ -319,7 +319,7 @@ void GL3DBarChart::render()
}
mpRenderer->ProcessUnrenderedShape(mbNeedsNewRender);
mbNeedsNewRender = false;
- mrWindow.getContext()->swapBuffers();
+ mrWindow.getContext().swapBuffers();
}
void GL3DBarChart::update()
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index a340b01df232..827b8929389c 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -459,15 +459,15 @@ bool OpenglShapeFactory::preRender(OpenGLWindow* pWindow)
return false;
pWindow->Show();
- pWindow->getContext()->makeCurrent();
+ pWindow->getContext().makeCurrent();
Size aSize = pWindow->GetSizePixel();
- pWindow->getContext()->setWinSize(aSize);
+ pWindow->getContext().setWinSize(aSize);
return true;
}
void OpenglShapeFactory::postRender(OpenGLWindow* pWindow)
{
- pWindow->getContext()->swapBuffers();
+ pWindow->getContext().swapBuffers();
}
void OpenglShapeFactory::clearPage(uno::Reference< drawing::XShapes > xRootShape)
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 4a3e4d7c6527..5e166fa33bc5 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3421,10 +3421,10 @@ void ServiceType::dumpHxxFile(
{
tree.add(u2b(*j), m_typeMgr);
}
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
includes.add("com.sun.star.uno.Exception");
includes.add("com.sun.star.uno.RuntimeException");
- includeExceptions(includes, tree.getRoot());
+ includeExceptions(includes, &tree.getRoot());
}
}
}
@@ -3603,7 +3603,7 @@ void ServiceType::dumpHxxFile(
{
tree.add(u2b(*j), m_typeMgr);
}
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
o << indent() << "try {\n";
inc();
}
@@ -3657,14 +3657,14 @@ void ServiceType::dumpHxxFile(
o << "the_arguments";
}
o << ", the_context), ::css::uno::UNO_QUERY);\n#endif\n";
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
dec();
o << indent()
<< ("} catch (const ::css::uno::RuntimeException &) {\n");
inc();
o << indent() << "throw;\n";
dec();
- dumpCatchClauses(o, tree.getRoot());
+ dumpCatchClauses(o, &tree.getRoot());
o << indent()
<< ("} catch (const ::css::uno::Exception &"
" the_exception) {\n");
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 40a17845db55..9e08171bb07d 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -2156,7 +2156,7 @@ void addConstructor(
codemaker::convertString(returnType).replace('.', '/'));
// stack: instance
code->instrAreturn();
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
ClassFile::Code::Position pos1 = code->getPosition();
// stack: e
code->instrInvokevirtual(
@@ -2188,7 +2188,7 @@ void addConstructor(
ClassFile::Code::Position pos2 = code->getPosition();
code->instrAthrow();
addExceptionHandlers(
- tree.getRoot(), tryStart, tryEnd, pos2, code.get());
+ &tree.getRoot(), tryStart, tryEnd, pos2, code.get());
code->addException(
tryStart, tryEnd, pos1, "com/sun/star/uno/Exception");
dependencies->insert("com.sun.star.uno.Exception");
diff --git a/comphelper/source/property/propertysethelper.cxx b/comphelper/source/property/propertysethelper.cxx
index 66b7843fc137..eb07e504d8d5 100644
--- a/comphelper/source/property/propertysethelper.cxx
+++ b/comphelper/source/property/propertysethelper.cxx
@@ -40,9 +40,9 @@ public:
PropertyMapEntry const * PropertySetHelperImpl::find( const OUString& aName ) const throw()
{
- PropertyMap::const_iterator aIter = mpInfo->getPropertyMap()->find( aName );
+ PropertyMap::const_iterator aIter = mpInfo->getPropertyMap().find( aName );
- if( mpInfo->getPropertyMap()->end() != aIter )
+ if( mpInfo->getPropertyMap().end() != aIter )
{
return (*aIter).second;
}
diff --git a/comphelper/source/property/propertysetinfo.cxx b/comphelper/source/property/propertysetinfo.cxx
index 1f3bb28735c4..df4738d0d38e 100644
--- a/comphelper/source/property/propertysetinfo.cxx
+++ b/comphelper/source/property/propertysetinfo.cxx
@@ -40,7 +40,7 @@ public:
Sequence< Property > getProperties() throw();
- const PropertyMap* getPropertyMap() const throw() { return &maPropertyMap;}
+ const PropertyMap& getPropertyMap() const throw() { return maPropertyMap;}
Property getPropertyByName( const OUString& aName ) throw( UnknownPropertyException );
bool hasPropertyByName( const OUString& aName ) throw();
@@ -182,7 +182,7 @@ sal_Bool SAL_CALL PropertySetInfo::hasPropertyByName( const OUString& Name ) thr
return mpMap->hasPropertyByName( Name );
}
-const PropertyMap* PropertySetInfo::getPropertyMap() const throw()
+const PropertyMap& PropertySetInfo::getPropertyMap() const throw()
{
return mpMap->getPropertyMap();
}
diff --git a/compilerplugins/clang/returnbyref.cxx b/compilerplugins/clang/returnbyref.cxx
new file mode 100644
index 000000000000..a386b5d349cd
--- /dev/null
+++ b/compilerplugins/clang/returnbyref.cxx
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <string>
+#include <set>
+
+#include "plugin.hxx"
+
+// Find places where we are returning a pointer to something, where we can be returning a reference.
+// e.g.
+// class A {
+// struct X x;
+// public:
+// X* getX() { return &x; }
+// }
+// which can be:
+// X& getX() { return x; }
+
+namespace {
+
+class ReturnByRef:
+ public RecursiveASTVisitor<ReturnByRef>, public loplugin::Plugin
+{
+public:
+ explicit ReturnByRef(InstantiationData const & data): Plugin(data) {}
+
+ virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+
+ bool VisitCXXMethodDecl(const CXXMethodDecl * decl);
+private:
+ bool isInUnoIncludeFile(SourceLocation spellingLocation) const;
+ bool isInMainFile(SourceLocation spellingLocation) const;
+};
+
+bool ReturnByRef::VisitCXXMethodDecl(const CXXMethodDecl * functionDecl) {
+ if (ignoreLocation(functionDecl)) {
+ return true;
+ }
+ if (functionDecl->isVirtual()) {
+ return true;
+ }
+ if (!functionDecl->isInstance()) {
+ return true;
+ }
+ if (!functionDecl->hasBody()) {
+ return true;
+ }
+ // ignore stuff that forms part of the stable URE interface
+ if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(
+ functionDecl->getCanonicalDecl()->getNameInfo().getLoc()))) {
+ return true;
+ }
+ QualType t1 { functionDecl->getResultType() };
+ if (!t1->isPointerType()) {
+ return true;
+ }
+ // Ignore stuff like:
+ // operator Window *(){ return &m_rWindow; }
+ if (dyn_cast< CXXConversionDecl >( functionDecl ) != nullptr) {
+ return true;
+ }
+
+ /*
+ The AST here looks like:
+ -CompoundStmt
+ `-ReturnStmt
+ `-UnaryOperator
+ `-MemberExpr
+ `-CXXThisExpr
+ */
+
+ const CompoundStmt* compoundStmt = dyn_cast< CompoundStmt >( functionDecl->getBody() );
+ if (compoundStmt == nullptr || compoundStmt->body_begin() == compoundStmt->body_end()) {
+ return true;
+ }
+ const ReturnStmt* returnStmt = dyn_cast<ReturnStmt>(*compoundStmt->child_begin());
+ if (returnStmt == nullptr) {
+ return true;
+ }
+
+ const Stmt* nextStmt = dyn_cast<Expr>(*returnStmt->child_begin())->IgnoreParens();
+ const UnaryOperator* unaryOperator = dyn_cast<UnaryOperator>(nextStmt);
+ if (unaryOperator == nullptr || unaryOperator->getOpcode() != UO_AddrOf) {
+ return true;
+ }
+
+ nextStmt = dyn_cast<Expr>(*unaryOperator->child_begin())->IgnoreParens();
+ const MemberExpr* memberExpr = dyn_cast<MemberExpr>(nextStmt);
+ if (memberExpr == nullptr) {
+ return true;
+ }
+
+ nextStmt = dyn_cast<Expr>(*memberExpr->child_begin())->IgnoreParens();
+ const CXXThisExpr* cXXThisExpr = dyn_cast<CXXThisExpr>(nextStmt);
+ if (cXXThisExpr == nullptr) {
+ return true;
+ }
+
+ report(
+ DiagnosticsEngine::Warning,
+ "rather return by reference",
+ functionDecl->getSourceRange().getBegin())
+ << functionDecl->getSourceRange();
+ // display the location of the class member declaration so I don't have to search for it by hand
+ report(
+ DiagnosticsEngine::Note,
+ "rather return by reference",
+ functionDecl->getCanonicalDecl()->getSourceRange().getBegin())
+ << functionDecl->getCanonicalDecl()->getSourceRange();
+
+ return true;
+}
+
+bool ReturnByRef::isInUnoIncludeFile(SourceLocation spellingLocation) const {
+ StringRef name {
+ compiler.getSourceManager().getFilename(spellingLocation) };
+ return isInMainFile(spellingLocation)
+ ? (name == SRCDIR "/cppu/source/cppu/compat.cxx"
+ || name == SRCDIR "/cppuhelper/source/compat.cxx"
+ || name == SRCDIR "/sal/osl/all/compat.cxx")
+ : (name.startswith(SRCDIR "/include/com/")
+ || name.startswith(SRCDIR "/include/cppu/")
+ || name.startswith(SRCDIR "/include/cppuhelper/")
+ || name.startswith(SRCDIR "/include/osl/")
+ || name.startswith(SRCDIR "/include/rtl/")
+ || name.startswith(SRCDIR "/include/sal/")
+ || name.startswith(SRCDIR "/include/salhelper/")
+ || name.startswith(SRCDIR "/include/systools/")
+ || name.startswith(SRCDIR "/include/typelib/")
+ || name.startswith(SRCDIR "/include/uno/")
+ || name.startswith(SRCDIR "/workdir/")
+ || name == SRCDIR "/include/comphelper/implbase_var.hxx");
+}
+
+bool ReturnByRef::isInMainFile(SourceLocation spellingLocation) const {
+#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
+ return compiler.getSourceManager().isInMainFile(spellingLocation);
+#else
+ return compiler.getSourceManager().isFromMainFile(spellingLocation);
+#endif
+}
+
+loplugin::Plugin::Registration< ReturnByRef > X("returnbyref");
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mork/MNSINIParser.hxx b/connectivity/source/drivers/mork/MNSINIParser.hxx
index afdd742d5185..1967cf3d4675 100644
--- a/connectivity/source/drivers/mork/MNSINIParser.hxx
+++ b/connectivity/source/drivers/mork/MNSINIParser.hxx
@@ -63,7 +63,7 @@ class IniParser
{
IniSectionMap mAllSection;
public:
- IniSectionMap * getAllSection(){return &mAllSection;};
+ IniSectionMap& getAllSection() { return mAllSection; }
IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException);
};
diff --git a/connectivity/source/drivers/mork/MNSProfileDiscover.cxx b/connectivity/source/drivers/mork/MNSProfileDiscover.cxx
index 7622c8074fd3..401fc48bf1ee 100644
--- a/connectivity/source/drivers/mork/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mork/MNSProfileDiscover.cxx
@@ -66,7 +66,7 @@ namespace connectivity
OUString regDir = getRegistryDir(product);
OUString profilesIni = regDir + "profiles.ini";
IniParser parser( profilesIni );
- IniSectionMap &mAllSection = *(parser.getAllSection());
+ IniSectionMap &mAllSection = parser.getAllSection();
IniSectionMap::iterator iBegin = mAllSection.begin();
IniSectionMap::iterator iEnd = mAllSection.end();
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
index b5795c1c668b..7a5a2acc4d45 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
@@ -62,7 +62,7 @@ class IniParser
{
IniSectionMap mAllSection;
public:
- IniSectionMap * getAllSection(){return &mAllSection;};
+ IniSectionMap& getAllSection() { return mAllSection; }
IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException);
};
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index 6660a5c9b690..1d5e5d34c820 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -148,7 +148,7 @@ namespace connectivity
OUString regDir = getRegistryDir(product);
OUString profilesIni = regDir + "profiles.ini";
IniParser parser( profilesIni );
- IniSectionMap &mAllSection = *(parser.getAllSection());
+ IniSectionMap &mAllSection = parser.getAllSection();
IniSectionMap::iterator iBegin = mAllSection.begin();
IniSectionMap::iterator iEnd = mAllSection.end();
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 67dfaeef65ed..74eb5c327b27 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -373,8 +373,8 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
SQLSMALLINT fCType, fSqlType;
OTools::getBindTypes(useWChar, m_pConnection->useOldDateFormat(), OTools::jdbcTypeToOdbc(_nType), fCType, fSqlType);
- SQLLEN *pDataLen=boundParams[parameterIndex-1].getBindLengthBuffer();
- *pDataLen=_nDataLen;
+ SQLLEN& rDataLen = boundParams[parameterIndex-1].getBindLengthBuffer();
+ rDataLen = _nDataLen;
SQLRETURN nRetcode;
nRetcode = (*(T3SQLBindParameter)m_pConnection->getOdbcFunction(ODBC3SQLBindParameter))(
@@ -389,7 +389,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
// we trust the ODBC driver not to touch it because SQL_PARAM_INPUT
const_cast<void*>(_pData),
_nDataAllocLen,
- pDataLen);
+ &rDataLen);
OTools::ThrowException(m_pConnection, nRetcode, m_aStatementHandle, SQL_HANDLE_STMT, *this);
}
@@ -742,7 +742,7 @@ SQLLEN* OPreparedStatement::getLengthBuf (sal_Int32 index)
if ((index >= 1) &&
(index <= numParams))
{
- b = boundParams[index - 1].getBindLengthBuffer ();
+ b = &boundParams[index - 1].getBindLengthBuffer ();
}
return b;
diff --git a/connectivity/source/inc/odbc/OBoundParam.hxx b/connectivity/source/inc/odbc/OBoundParam.hxx
index 4c0eaccb8243..d851e2a2740e 100644
--- a/connectivity/source/inc/odbc/OBoundParam.hxx
+++ b/connectivity/source/inc/odbc/OBoundParam.hxx
@@ -73,9 +73,9 @@ namespace connectivity
// getBindLengthBuffer
// Returns the length buffer to be used when binding to a parameter
- SQLLEN* getBindLengthBuffer ()
+ SQLLEN& getBindLengthBuffer ()
{
- return &paramLength;
+ return paramLength;
}
diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx
index c11deeeeaca7..9082511dded4 100644
--- a/dbaccess/source/ui/control/RelationControl.cxx
+++ b/dbaccess/source/ui/control/RelationControl.cxx
@@ -184,7 +184,7 @@ namespace dbaui
// not the first call
RowRemoved(0, GetRowCount());
- RowInserted(0, m_pConnData->GetConnLineDataList()->size() + 1, true); // add one extra row
+ RowInserted(0, m_pConnData->GetConnLineDataList().size() + 1, true); // add one extra row
}
void ORelationControl::Resize()
@@ -234,16 +234,16 @@ namespace dbaui
if ( nRow != BROWSER_ENDOFSELECTION )
{
OUString sFieldName(m_pListCell->GetSelectEntry());
- OConnectionLineDataVec* pLines = m_pConnData->GetConnLineDataList();
- if ( pLines->size() <= static_cast<OConnectionLineDataVec::size_type>(nRow) )
+ OConnectionLineDataVec& rLines = m_pConnData->GetConnLineDataList();
+ if ( rLines.size() <= static_cast<OConnectionLineDataVec::size_type>(nRow) )
{
- pLines->push_back(new OConnectionLineData());
- nRow = pLines->size() - 1;
- // add new past-pLines row
+ rLines.push_back(new OConnectionLineData());
+ nRow = rLines.size() - 1;
+ // add new past-rLines row
m_ops.push_back(make_pair(INSERT, make_pair(nRow+1, nRow+2)));
}
- OConnectionLineDataRef pConnLineData = (*pLines)[nRow];
+ OConnectionLineDataRef pConnLineData = rLines[nRow];
switch( getColumnIdent( GetCurColumnId() ) )
{
@@ -259,9 +259,9 @@ namespace dbaui
//m_ops.push_back(make_pair(MODIFY, make_pair(nRow, nRow+1)));
}
- const OConnectionLineDataVec::size_type oldSize = m_pConnData->GetConnLineDataList()->size();
+ const OConnectionLineDataVec::size_type oldSize = m_pConnData->GetConnLineDataList().size();
OConnectionLineDataVec::size_type line = m_pConnData->normalizeLines();
- const OConnectionLineDataVec::size_type newSize = m_pConnData->GetConnLineDataList()->size();
+ const OConnectionLineDataVec::size_type newSize = m_pConnData->GetConnLineDataList().size();
assert(newSize <= oldSize);
m_ops.push_back(make_pair(MODIFY, make_pair(line, newSize)));
m_ops.push_back(make_pair(DELETE, make_pair(newSize, oldSize)));
@@ -280,9 +280,9 @@ namespace dbaui
OUString ORelationControl::GetCellText( long nRow, sal_uInt16 nColId ) const
{
OUString sText;
- if ( m_pConnData->GetConnLineDataList()->size() > static_cast<size_t>(nRow) )
+ if ( m_pConnData->GetConnLineDataList().size() > static_cast<size_t>(nRow) )
{
- OConnectionLineDataRef pConnLineData = (*m_pConnData->GetConnLineDataList())[nRow];
+ OConnectionLineDataRef pConnLineData = m_pConnData->GetConnLineDataList()[nRow];
switch( getColumnIdent( nColId ) )
{
case SOURCE_COLUMN:
@@ -403,7 +403,7 @@ namespace dbaui
const OJoinTableView* pView = _pSource->getTableView();
OTableConnection* pConn = pView->GetTabConn(_pSource,_pDest);
- if ( pConn && !m_pConnData->GetConnLineDataList()->empty() )
+ if ( pConn && !m_pConnData->GetConnLineDataList().empty() )
{
m_pConnData->CopyFrom(*pConn->GetData());
m_pBoxControl->getContainer()->notifyConnectionChange();
@@ -411,9 +411,9 @@ namespace dbaui
else
{
// no connection found so we clear our data
- OConnectionLineDataVec* pLines = m_pConnData->GetConnLineDataList();
- ::std::for_each(pLines->begin(),
- pLines->end(),
+ OConnectionLineDataVec& rLines = m_pConnData->GetConnLineDataList();
+ ::std::for_each(rLines.begin(),
+ rLines.end(),
OUnaryRefFunctor<OConnectionLineData>( ::std::mem_fun(&OConnectionLineData::Reset))
);
@@ -608,12 +608,12 @@ namespace dbaui
{
// Enable/disable the OK button, depending on having a valid situation
TTableConnectionData::value_type pConnData = m_pRC_Tables->getData();
- const OConnectionLineDataVec* pLines = pConnData->GetConnLineDataList();
- bool bValid = !pLines->empty();
+ const OConnectionLineDataVec& rLines = pConnData->GetConnLineDataList();
+ bool bValid = !rLines.empty();
if (bValid)
{
- OConnectionLineDataVec::const_iterator l(pLines->begin());
- const OConnectionLineDataVec::const_iterator le(pLines->end());
+ OConnectionLineDataVec::const_iterator l(rLines.begin());
+ const OConnectionLineDataVec::const_iterator le(rLines.end());
for (; bValid && l!=le; ++l)
{
bValid = ! ((*l)->GetSourceFieldName().isEmpty() || (*l)->GetDestFieldName().isEmpty());
diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx
index ee482d578f77..63d5351ee0e2 100644
--- a/dbaccess/source/ui/dlg/RelationDlg.cxx
+++ b/dbaccess/source/ui/dlg/RelationDlg.cxx
@@ -52,7 +52,7 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent,
bool bAllowTableSelect )
: ModalDialog(pParent, "RelationDialog",
"dbaccess/ui/relationdialog.ui")
- , m_pTableMap(pParent->GetTabWinMap())
+ , m_pTableMap(&pParent->GetTabWinMap())
, m_pOrigConnData(pConnectionData)
, m_bTriedOneUpdate(false)
{
diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx
index a2ec2418dc99..01ff6fd39af5 100644
--- a/dbaccess/source/ui/inc/JoinController.hxx
+++ b/dbaccess/source/ui/inc/JoinController.hxx
@@ -82,8 +82,8 @@ namespace dbaui
OJoinController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM);
// attribute access
- inline TTableWindowData* getTableWindowData() { return &m_vTableData; }
- inline TTableConnectionData* getTableConnectionData() { return &m_vTableConnectionData;}
+ inline TTableWindowData& getTableWindowData() { return m_vTableData; }
+ inline TTableConnectionData& getTableConnectionData() { return m_vTableConnectionData;}
inline OAddTableDlg* getAddTableDialog()const { return m_pAddTableDialog; }
// OSingleDocumentController overridables
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index 61b0147bf134..aa266ab9f8ca 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -67,8 +67,8 @@ namespace dbaui
void resetRange(const Point& _aSize);
// own methods
- ScrollBar* GetHScrollBar() { return &m_aHScrollBar; }
- ScrollBar* GetVScrollBar() { return &m_aVScrollBar; }
+ ScrollBar& GetHScrollBar() { return m_aHScrollBar; }
+ ScrollBar& GetVScrollBar() { return m_aVScrollBar; }
};
@@ -121,8 +121,8 @@ namespace dbaui
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
// own methods
- ScrollBar* GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); }
- ScrollBar* GetVScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetVScrollBar(); }
+ ScrollBar& GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); }
+ ScrollBar& GetVScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetVScrollBar(); }
DECL_LINK( ScrollHdl, ScrollBar* );
void DrawConnections( const Rectangle& rRect );
@@ -174,12 +174,12 @@ namespace dbaui
void DeselectConn(OTableConnection* pConn);
void SelectConn(OTableConnection* pConn);
- OTableWindowMap* GetTabWinMap() { return &m_aTableMap; }
- const OTableWindowMap* GetTabWinMap() const { return &m_aTableMap; }
+ OTableWindowMap& GetTabWinMap() { return m_aTableMap; }
+ const OTableWindowMap& GetTabWinMap() const { return m_aTableMap; }
/** gives a read only access to the connection vector
*/
- const ::std::vector<OTableConnection*>* getTableConnections() const { return &m_vTableConnection; }
+ const ::std::vector<OTableConnection*>& getTableConnections() const { return m_vTableConnection; }
bool ExistsAConn(const OTableWindow* pFromWin) const;
diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx
index a48e54f47951..95f60752ae65 100644
--- a/dbaccess/source/ui/inc/TableConnection.hxx
+++ b/dbaccess/source/ui/inc/TableConnection.hxx
@@ -92,7 +92,7 @@ namespace dbaui
Rectangle GetBoundingRect() const;
inline TTableConnectionData::value_type GetData() const { return m_pData; }
- const ::std::vector<OConnectionLine*>* GetConnLineList() const { return &m_vConnLine; }
+ const ::std::vector<OConnectionLine*>& GetConnLineList() const { return m_vConnLine; }
inline OJoinTableView* GetParent() const { return m_pParent; }
virtual void Draw( const Rectangle& rRect );
using Window::Draw;
diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx
index 187377b5c4bc..36ca8d11a731 100644
--- a/dbaccess/source/ui/inc/TableConnectionData.hxx
+++ b/dbaccess/source/ui/inc/TableConnectionData.hxx
@@ -84,8 +84,8 @@ namespace dbaui
*/
OConnectionLineDataVec::size_type normalizeLines();
- const OConnectionLineDataVec* GetConnLineDataList() const { return &m_vConnLineData; }
- OConnectionLineDataVec* GetConnLineDataList() { return &m_vConnLineData; }
+ const OConnectionLineDataVec& GetConnLineDataList() const { return m_vConnLineData; }
+ OConnectionLineDataVec& GetConnLineDataList() { return m_vConnLineData; }
inline TTableWindowData::value_type getReferencingTable() const { return m_pReferencingTable; }
inline TTableWindowData::value_type getReferencedTable() const { return m_pReferencedTable; }
diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx
index a6d84385df3b..d0f6b4d8f543 100644
--- a/dbaccess/source/ui/inc/TableController.hxx
+++ b/dbaccess/source/ui/inc/TableController.hxx
@@ -101,12 +101,12 @@ namespace dbaui
virtual void impl_onModifyChanged() SAL_OVERRIDE;
- inline ::std::vector< ::boost::shared_ptr<OTableRow> >* getRows() { return &m_vRowList; }
+ inline ::std::vector< ::boost::shared_ptr<OTableRow> >& getRows() { return m_vRowList; }
/// returns the position of the first empty row
sal_Int32 getFirstEmptyRowPosition();
- inline const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo; }
+ inline const OTypeInfoMap& getTypeInfo() const { return m_aTypeInfo; }
inline TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) const { return m_aTypeInfoIndex[_nPos]->second; }
TOTypeInfoSP getTypeInfoByType(sal_Int32 _nDataType) const;
diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx
index ed11ef6b0748..82028e1607be 100644
--- a/dbaccess/source/ui/inc/TableWindow.hxx
+++ b/dbaccess/source/ui/inc/TableWindow.hxx
@@ -146,9 +146,9 @@ namespace dbaui
OUString GetTableName() const { return m_pData->GetTableName(); }
OUString GetWinName() const { return m_pData->GetWinName(); }
OUString GetComposedName() const { return m_pData->GetComposedName(); }
- OTableWindowListBox* GetListBox() const { return m_pListBox; }
+ OTableWindowListBox* GetListBox() const { return m_pListBox; }
TTableWindowData::value_type GetData() const { return m_pData; }
- OTableWindowTitle* GetTitleCtrl() { return &m_aTitle; }
+ OTableWindowTitle& GetTitleCtrl() { return m_aTitle; }
/** returns the name which should be used when displaying join or relations
@return
diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx
index 2cfb67fda79f..c8b6831f72c3 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -369,19 +369,19 @@ namespace dbaui
OUString getPrimaryKeyName() const { return m_aKeyName; }
TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) const { return m_aTypeInfoIndex[_nPos]->second; }
- const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo; }
+ const OTypeInfoMap& getTypeInfo() const { return m_aTypeInfo; }
TOTypeInfoSP getDestTypeInfo(sal_Int32 _nPos) const { return m_aDestTypeInfoIndex[_nPos]->second; }
- const OTypeInfoMap* getDestTypeInfo() const { return &m_aDestTypeInfo; }
+ const OTypeInfoMap& getDestTypeInfo() const { return m_aDestTypeInfo; }
::com::sun::star::lang::Locale GetLocale() const { return m_aLocale; }
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const { return m_xFormatter; }
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> GetComponentContext() const { return m_xContext; }
- const ODatabaseExport::TColumns* getSourceColumns() const{ return &m_vSourceColumns; }
- const ODatabaseExport::TColumnVector* getSrcVector() const { return &m_vSourceVec; }
- ODatabaseExport::TColumns* getDestColumns() { return &m_vDestColumns; }
- const ODatabaseExport::TColumnVector* getDestVector() const { return &m_aDestVec; }
+ const ODatabaseExport::TColumns& getSourceColumns() const{ return m_vSourceColumns; }
+ const ODatabaseExport::TColumnVector& getSrcVector() const { return m_vSourceVec; }
+ ODatabaseExport::TColumns& getDestColumns() { return m_vDestColumns; }
+ const ODatabaseExport::TColumnVector& getDestVector() const { return m_aDestVec; }
OUString getName() const { return m_sName; }
/** clears the dest vectors
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index e849e91984ed..7cfb2b9b5ebd 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -265,8 +265,8 @@ bool OCopyTable::checkAppendData()
xTables = xSup->getTables();
if(xTables.is() && xTables->hasByName(m_pEdTableName->GetText()))
{
- const ODatabaseExport::TColumnVector* pSrcColumns = m_pParent->getSrcVector();
- const sal_uInt32 nSrcSize = pSrcColumns->size();
+ const ODatabaseExport::TColumnVector& rSrcColumns = m_pParent->getSrcVector();
+ const sal_uInt32 nSrcSize = rSrcColumns.size();
m_pParent->m_vColumnPos.resize( nSrcSize, ODatabaseExport::TPositions::value_type( COLUMN_POSITION_NOT_FOUND, COLUMN_POSITION_NOT_FOUND ) );
m_pParent->m_vColumnTypes.resize( nSrcSize , COLUMN_POSITION_NOT_FOUND );
@@ -274,10 +274,10 @@ bool OCopyTable::checkAppendData()
xTables->getByName( m_pEdTableName->GetText() ) >>= xTable;
ObjectCopySource aTableCopySource( m_pParent->m_xDestConnection, xTable );
m_pParent->loadData( aTableCopySource, m_pParent->m_vDestColumns, m_pParent->m_aDestVec );
- const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector();
- ODatabaseExport::TColumnVector::const_iterator aDestIter = pDestColumns->begin();
- ODatabaseExport::TColumnVector::const_iterator aDestEnd = pDestColumns->end();
- const sal_uInt32 nDestSize = pDestColumns->size();
+ const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector();
+ ODatabaseExport::TColumnVector::const_iterator aDestIter = rDestColumns.begin();
+ ODatabaseExport::TColumnVector::const_iterator aDestEnd = rDestColumns.end();
+ const sal_uInt32 nDestSize = rDestColumns.size();
bool bNotConvert;
sal_uInt32 i = 0;
for(sal_Int32 nPos = 1;aDestIter != aDestEnd && i < nDestSize && i < nSrcSize;++aDestIter,++nPos,++i)
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 26cccda6131c..fab9f5e7f6bf 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -108,9 +108,9 @@ void OWizColumnSelect::Reset()
m_pParent->m_mNameMapping.clear();
// insert the source columns in the left listbox
- const ODatabaseExport::TColumnVector* pSrcColumns = m_pParent->getSrcVector();
- ODatabaseExport::TColumnVector::const_iterator aIter = pSrcColumns->begin();
- ODatabaseExport::TColumnVector::const_iterator aEnd = pSrcColumns->end();
+ const ODatabaseExport::TColumnVector& rSrcColumns = m_pParent->getSrcVector();
+ ODatabaseExport::TColumnVector::const_iterator aIter = rSrcColumns.begin();
+ ODatabaseExport::TColumnVector::const_iterator aEnd = rSrcColumns.end();
for(;aIter != aEnd;++aIter)
{
@@ -127,15 +127,15 @@ void OWizColumnSelect::Reset()
void OWizColumnSelect::ActivatePage( )
{
// if there are no dest columns reset the left side with the origibnal columns
- if(m_pParent->getDestColumns()->empty())
+ if(m_pParent->getDestColumns().empty())
Reset();
clearListBox(*m_pNewColumnNames);
- const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector();
+ const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector();
- ODatabaseExport::TColumnVector::const_iterator aIter = pDestColumns->begin();
- ODatabaseExport::TColumnVector::const_iterator aEnd = pDestColumns->end();
+ ODatabaseExport::TColumnVector::const_iterator aIter = rDestColumns.begin();
+ ODatabaseExport::TColumnVector::const_iterator aEnd = rDestColumns.end();
for(;aIter != aEnd;++aIter)
{
sal_uInt16 nPos = m_pNewColumnNames->InsertEntry((*aIter)->first);
@@ -164,7 +164,7 @@ bool OWizColumnSelect::LeavePage()
if ( m_pParent->GetPressedButton() == OCopyTableWizard::WIZARD_NEXT
|| m_pParent->GetPressedButton() == OCopyTableWizard::WIZARD_FINISH
)
- return m_pParent->getDestColumns()->size() != 0;
+ return m_pParent->getDestColumns().size() != 0;
else
return true;
}
@@ -331,15 +331,15 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight,
OSL_ENSURE(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined");
if ( aIter == m_pParent->m_mNameMapping.end() )
return; // do nothing
- const ODatabaseExport::TColumns* pSrcColumns = m_pParent->getSourceColumns();
- ODatabaseExport::TColumns::const_iterator aSrcIter = pSrcColumns->find((*aIter).first);
- if ( aSrcIter != pSrcColumns->end() )
+ const ODatabaseExport::TColumns& rSrcColumns = m_pParent->getSourceColumns();
+ ODatabaseExport::TColumns::const_iterator aSrcIter = rSrcColumns.find((*aIter).first);
+ if ( aSrcIter != rSrcColumns.end() )
{
// we need also the old position of this column to insert it back on that position again
- const ODatabaseExport::TColumnVector* pSrcVector = m_pParent->getSrcVector();
- ODatabaseExport::TColumnVector::const_iterator aPos = ::std::find(pSrcVector->begin(),pSrcVector->end(),aSrcIter);
- OSL_ENSURE( aPos != pSrcVector->end(),"Invalid position for the iterator here!");
- ODatabaseExport::TColumnVector::size_type nPos = (aPos - pSrcVector->begin()) - adjustColumnPosition(_pLeft, _sColumnName, (aPos - pSrcVector->begin()), _aCase);
+ const ODatabaseExport::TColumnVector& rSrcVector = m_pParent->getSrcVector();
+ ODatabaseExport::TColumnVector::const_iterator aPos = ::std::find(rSrcVector.begin(), rSrcVector.end(), aSrcIter);
+ OSL_ENSURE( aPos != rSrcVector.end(),"Invalid position for the iterator here!");
+ ODatabaseExport::TColumnVector::size_type nPos = (aPos - rSrcVector.begin()) - adjustColumnPosition(_pLeft, _sColumnName, (aPos - rSrcVector.begin()), _aCase);
_pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< sal_uInt16 >(nPos)),aSrcIter->second );
_rRightColumns.push_back((*aIter).first);
@@ -379,14 +379,14 @@ sal_uInt16 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft,
);
OSL_ENSURE(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined");
- const ODatabaseExport::TColumns* pSrcColumns = m_pParent->getSourceColumns();
- ODatabaseExport::TColumns::const_iterator aSrcIter = pSrcColumns->find((*aIter).first);
- if ( aSrcIter != pSrcColumns->end() )
+ const ODatabaseExport::TColumns& rSrcColumns = m_pParent->getSourceColumns();
+ ODatabaseExport::TColumns::const_iterator aSrcIter = rSrcColumns.find((*aIter).first);
+ if ( aSrcIter != rSrcColumns.end() )
{
// we need also the old position of this column to insert it back on that position again
- const ODatabaseExport::TColumnVector* pSrcVector = m_pParent->getSrcVector();
- ODatabaseExport::TColumnVector::const_iterator aPos = ::std::find(pSrcVector->begin(),pSrcVector->end(),aSrcIter);
- ODatabaseExport::TColumnVector::size_type nPos = aPos - pSrcVector->begin();
+ const ODatabaseExport::TColumnVector& rSrcVector = m_pParent->getSrcVector();
+ ODatabaseExport::TColumnVector::const_iterator aPos = ::std::find(rSrcVector.begin(), rSrcVector.end(), aSrcIter);
+ ODatabaseExport::TColumnVector::size_type nPos = aPos - rSrcVector.begin();
if( nPos < nCurrentPos)
{
nAdjustedPos++;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index d293ea777ded..6e6fcd299fed 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1225,11 +1225,11 @@ Reference< XPropertySet > OCopyTableWizard::createTable()
Reference< XColumnsSupplier > xSuppDestinationColumns( xTable, UNO_QUERY );
// now append the columns
- const ODatabaseExport::TColumnVector* pVec = getDestVector();
- appendColumns( xSuppDestinationColumns, pVec );
+ const ODatabaseExport::TColumnVector& rVec = getDestVector();
+ appendColumns( xSuppDestinationColumns, &rVec );
// now append the primary key
Reference<XKeysSupplier> xKeySup(xTable,UNO_QUERY);
- appendKey(xKeySup,pVec);
+ appendKey(xKeySup, &rVec);
Reference<XAppend> xAppend(xTables,UNO_QUERY);
if(xAppend.is())
diff --git a/dbaccess/source/ui/misc/WExtendPages.cxx b/dbaccess/source/ui/misc/WExtendPages.cxx
index 9f6839b1e819..7d1646fcf682 100644
--- a/dbaccess/source/ui/misc/WExtendPages.cxx
+++ b/dbaccess/source/ui/misc/WExtendPages.cxx
@@ -31,8 +31,8 @@ SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows)
m_pParent->GetColumnPositions(),
m_pParent->GetFormatter(),
m_pParent->GetComponentContext(),
- m_pParent->getDestVector(),
- m_pParent->getTypeInfo(),
+ &m_pParent->getDestVector(),
+ &m_pParent->getTypeInfo(),
m_pParent->shouldCreatePrimaryKey());
}
@@ -43,8 +43,8 @@ SvParser* OWizRTFExtend::createReader(sal_Int32 _nRows)
m_pParent->GetColumnPositions(),
m_pParent->GetFormatter(),
m_pParent->GetComponentContext(),
- m_pParent->getDestVector(),
- m_pParent->getTypeInfo(),
+ &m_pParent->getDestVector(),
+ &m_pParent->getTypeInfo(),
m_pParent->shouldCreatePrimaryKey());
}
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 088a850bf173..b274ba277401 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -104,8 +104,8 @@ void OWizNameMatching::ActivatePage( )
aName += m_pParent->m_sName;
m_FT_TABLE_RIGHT.SetText(aName);
- m_CTRL_LEFT.FillListBox(*m_pParent->getSrcVector());
- m_CTRL_RIGHT.FillListBox(*m_pParent->getDestVector());
+ m_CTRL_LEFT.FillListBox(m_pParent->getSrcVector());
+ m_CTRL_RIGHT.FillListBox(m_pParent->getDestVector());
m_ibColumn_up.Enable( m_CTRL_LEFT.GetEntryCount() > 1 );
m_ibColumn_down.Enable( m_CTRL_LEFT.GetEntryCount() > 1 );
@@ -120,12 +120,12 @@ void OWizNameMatching::ActivatePage( )
bool OWizNameMatching::LeavePage()
{
- const ODatabaseExport::TColumnVector* pSrcColumns = m_pParent->getSrcVector();
+ const ODatabaseExport::TColumnVector& rSrcColumns = m_pParent->getSrcVector();
m_pParent->m_vColumnPos.clear();
m_pParent->m_vColumnTypes.clear();
- m_pParent->m_vColumnPos.resize( pSrcColumns->size(), ODatabaseExport::TPositions::value_type( COLUMN_POSITION_NOT_FOUND, COLUMN_POSITION_NOT_FOUND ) );
- m_pParent->m_vColumnTypes.resize( pSrcColumns->size(), COLUMN_POSITION_NOT_FOUND );
+ m_pParent->m_vColumnPos.resize( rSrcColumns.size(), ODatabaseExport::TPositions::value_type( COLUMN_POSITION_NOT_FOUND, COLUMN_POSITION_NOT_FOUND ) );
+ m_pParent->m_vColumnTypes.resize( rSrcColumns.size(), COLUMN_POSITION_NOT_FOUND );
sal_Int32 nParamPos = 0;
SvTreeListEntry* pLeftEntry = m_CTRL_LEFT.GetModel()->First();
@@ -135,26 +135,26 @@ bool OWizNameMatching::LeavePage()
OFieldDescription* pSrcField = static_cast<OFieldDescription*>(pLeftEntry->GetUserData());
OSL_ENSURE(pSrcField,"OWizNameMatching: OColumn can not be null!");
- ODatabaseExport::TColumnVector::const_iterator aSrcIter = pSrcColumns->begin();
- ODatabaseExport::TColumnVector::const_iterator aSrcEnd = pSrcColumns->end();
+ ODatabaseExport::TColumnVector::const_iterator aSrcIter = rSrcColumns.begin();
+ ODatabaseExport::TColumnVector::const_iterator aSrcEnd = rSrcColumns.end();
for(;aSrcIter != aSrcEnd && (*aSrcIter)->second != pSrcField;++aSrcIter)
;
- const sal_Int32 nPos = ::std::distance(pSrcColumns->begin(),aSrcIter);
+ const sal_Int32 nPos = ::std::distance(rSrcColumns.begin(),aSrcIter);
if(m_CTRL_LEFT.GetCheckButtonState(pLeftEntry) == SV_BUTTON_CHECKED)
{
OFieldDescription* pDestField = static_cast<OFieldDescription*>(pRightEntry->GetUserData());
OSL_ENSURE(pDestField,"OWizNameMatching: OColumn can not be null!");
- const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector();
- ODatabaseExport::TColumnVector::const_iterator aDestIter = pDestColumns->begin();
- ODatabaseExport::TColumnVector::const_iterator aDestEnd = pDestColumns->end();
+ const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector();
+ ODatabaseExport::TColumnVector::const_iterator aDestIter = rDestColumns.begin();
+ ODatabaseExport::TColumnVector::const_iterator aDestEnd = rDestColumns.end();
for(;aDestIter != aDestEnd && (*aDestIter)->second != pDestField;++aDestIter)
;
OSL_ENSURE((nPos) < static_cast<sal_Int32>(m_pParent->m_vColumnPos.size()),"m_pParent->m_vColumnPos: Illegal index for vector");
m_pParent->m_vColumnPos[nPos].first = ++nParamPos;
- m_pParent->m_vColumnPos[nPos].second = ::std::distance(pDestColumns->begin(),aDestIter) + 1;
+ m_pParent->m_vColumnPos[nPos].second = ::std::distance(rDestColumns.begin(),aDestIter) + 1;
bool bNotConvert = true;
TOTypeInfoSP pTypeInfo;
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 6c3180dc641d..018e797123be 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -186,7 +186,7 @@ TOTypeInfoSP OWizTypeSelectControl::getTypeInfo(sal_Int32 _nPos)
const OTypeInfoMap* OWizTypeSelectControl::getTypeInfo() const
{
- return static_cast<OWizTypeSelect*>(GetParent())->m_pParent->getDestTypeInfo();
+ return &static_cast<OWizTypeSelect*>(GetParent())->m_pParent->getDestTypeInfo();
}
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> OWizTypeSelectControl::getMetaData()
@@ -285,9 +285,9 @@ void OWizTypeSelect::Reset()
sal_Int32 nBreakPos;
m_pParent->CheckColumns(nBreakPos);
- const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector();
- ODatabaseExport::TColumnVector::const_iterator aIter = pDestColumns->begin();
- ODatabaseExport::TColumnVector::const_iterator aEnd = pDestColumns->end();
+ const ODatabaseExport::TColumnVector& rDestColumns = m_pParent->getDestVector();
+ ODatabaseExport::TColumnVector::const_iterator aIter = rDestColumns.begin();
+ ODatabaseExport::TColumnVector::const_iterator aEnd = rDestColumns.end();
for(;aIter != aEnd;++aIter)
{
sal_uInt16 nPos;
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
index 5506c7fc0fd4..02d1759dceda 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
@@ -81,10 +81,10 @@ namespace dbaui
if( m_pLine )
{
// search the position of our table window in the table window map
- nIndex = m_pLine->GetParent()->GetTabWinMap()->size();
- const ::std::vector<OTableConnection*>* pVec = m_pLine->GetParent()->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = pVec->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pVec->end();
+ nIndex = m_pLine->GetParent()->GetTabWinMap().size();
+ const ::std::vector<OTableConnection*>& rVec = m_pLine->GetParent()->getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter = rVec.begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rVec.end();
for (; aIter != aEnd && (*aIter) != m_pLine; ++nIndex,++aIter)
;
nIndex = ( aIter != aEnd ) ? nIndex : -1;
diff --git a/dbaccess/source/ui/querydesign/JAccess.cxx b/dbaccess/source/ui/querydesign/JAccess.cxx
index 7d0b8adbc10d..717128eb4aeb 100644
--- a/dbaccess/source/ui/querydesign/JAccess.cxx
+++ b/dbaccess/source/ui/querydesign/JAccess.cxx
@@ -58,7 +58,7 @@ namespace dbaui
::osl::MutexGuard aGuard( m_aMutex );
sal_Int32 nChildCount = 0;
if ( m_pTableView )
- nChildCount = m_pTableView->GetTabWinCount() + m_pTableView->getTableConnections()->size();
+ nChildCount = m_pTableView->GetTabWinCount() + m_pTableView->getTableConnections().size();
return nChildCount;
}
Reference< XAccessible > SAL_CALL OJoinDesignViewAccess::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException,RuntimeException, std::exception)
@@ -71,13 +71,13 @@ namespace dbaui
sal_Int32 nTableWindowCount = m_pTableView->GetTabWinCount();
if( i < nTableWindowCount )
{
- OJoinTableView::OTableWindowMap::iterator aIter = m_pTableView->GetTabWinMap()->begin();
+ OJoinTableView::OTableWindowMap::iterator aIter = m_pTableView->GetTabWinMap().begin();
for (sal_Int32 j=i; j; ++aIter,--j)
;
aRet = aIter->second->GetAccessible();
}
- else if( size_t(i - nTableWindowCount) < m_pTableView->getTableConnections()->size() )
- aRet = (*m_pTableView->getTableConnections())[i - nTableWindowCount]->GetAccessible();
+ else if( size_t(i - nTableWindowCount) < m_pTableView->getTableConnections().size() )
+ aRet = m_pTableView->getTableConnections()[i - nTableWindowCount]->GetAccessible();
}
else
throw IndexOutOfBoundsException();
diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
index cfe2d696d8e4..6372e154038c 100644
--- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
@@ -97,7 +97,7 @@ void OJoinDesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
void OJoinDesignView::SaveTabWinUIConfig(OTableWindow* pWin)
{
- getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos());
+ getController().SaveTabWinPosSize(pWin, m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos());
}
void OJoinDesignView::KeyInput( const KeyEvent& rEvt )
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index c29d55a393d8..e9d7dc8b392d 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -73,14 +73,14 @@ OScrollWindowHelper::OScrollWindowHelper( Window* pParent) : Window( pParent)
// ScrollBars
- GetHScrollBar()->SetRange( Range(0, 1000) );
- GetVScrollBar()->SetRange( Range(0, 1000) );
+ GetHScrollBar().SetRange( Range(0, 1000) );
+ GetVScrollBar().SetRange( Range(0, 1000) );
- GetHScrollBar()->SetLineSize( LINE_SIZE );
- GetVScrollBar()->SetLineSize( LINE_SIZE );
+ GetHScrollBar().SetLineSize( LINE_SIZE );
+ GetVScrollBar().SetLineSize( LINE_SIZE );
- GetHScrollBar()->Show();
- GetVScrollBar()->Show();
+ GetHScrollBar().Show();
+ GetVScrollBar().Show();
m_pCornerWindow->Show();
// normally we should be SCROLL_PANE
@@ -98,15 +98,15 @@ void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView)
{
m_pTableView = _pTableView;
// ScrollBars
- GetHScrollBar()->SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
- GetVScrollBar()->SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
+ GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
+ GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
}
void OScrollWindowHelper::resetRange(const Point& _aSize)
{
Point aPos = PixelToLogic(_aSize);
- GetHScrollBar()->SetRange( Range(0, aPos.X() + TABWIN_SPACING_X) );
- GetVScrollBar()->SetRange( Range(0, aPos.Y() + TABWIN_SPACING_Y) );
+ GetHScrollBar().SetRange( Range(0, aPos.X() + TABWIN_SPACING_X) );
+ GetVScrollBar().SetRange( Range(0, aPos.Y() + TABWIN_SPACING_Y) );
}
void OScrollWindowHelper::Resize()
@@ -114,15 +114,15 @@ void OScrollWindowHelper::Resize()
Window::Resize();
Size aTotalOutputSize = GetOutputSizePixel();
- long nHScrollHeight = GetHScrollBar()->GetSizePixel().Height();
- long nVScrollWidth = GetVScrollBar()->GetSizePixel().Width();
+ long nHScrollHeight = GetHScrollBar().GetSizePixel().Height();
+ long nVScrollWidth = GetVScrollBar().GetSizePixel().Width();
- GetHScrollBar()->SetPosSizePixel(
+ GetHScrollBar().SetPosSizePixel(
Point( 0, aTotalOutputSize.Height()-nHScrollHeight ),
Size( aTotalOutputSize.Width()-nVScrollWidth, nHScrollHeight )
);
- GetVScrollBar()->SetPosSizePixel(
+ GetVScrollBar().SetPosSizePixel(
Point( aTotalOutputSize.Width()-nVScrollWidth, 0 ),
Size( nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight )
);
@@ -132,20 +132,20 @@ void OScrollWindowHelper::Resize()
Size( nVScrollWidth, nHScrollHeight )
);
- GetHScrollBar()->SetPageSize( aTotalOutputSize.Width() );
- GetHScrollBar()->SetVisibleSize( aTotalOutputSize.Width() );
+ GetHScrollBar().SetPageSize( aTotalOutputSize.Width() );
+ GetHScrollBar().SetVisibleSize( aTotalOutputSize.Width() );
- GetVScrollBar()->SetPageSize( aTotalOutputSize.Height() );
- GetVScrollBar()->SetVisibleSize( aTotalOutputSize.Height() );
+ GetVScrollBar().SetPageSize( aTotalOutputSize.Height() );
+ GetVScrollBar().SetVisibleSize( aTotalOutputSize.Height() );
// adjust the ranges of the scrollbars if necessary
- long lRange = GetHScrollBar()->GetRange().Max() - GetHScrollBar()->GetRange().Min();
+ long lRange = GetHScrollBar().GetRange().Max() - GetHScrollBar().GetRange().Min();
if (m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() > lRange)
- GetHScrollBar()->SetRangeMax(m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() + GetHScrollBar()->GetRange().Min());
+ GetHScrollBar().SetRangeMax(m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() + GetHScrollBar().GetRange().Min());
- lRange = GetVScrollBar()->GetRange().Max() - GetVScrollBar()->GetRange().Min();
+ lRange = GetVScrollBar().GetRange().Max() - GetVScrollBar().GetRange().Min();
if (m_pTableView->GetScrollOffset().Y() + aTotalOutputSize.Height() > lRange)
- GetVScrollBar()->SetRangeMax(m_pTableView->GetScrollOffset().Y() + aTotalOutputSize.Height() + GetVScrollBar()->GetRange().Min());
+ GetVScrollBar().SetRangeMax(m_pTableView->GetScrollOffset().Y() + aTotalOutputSize.Height() + GetVScrollBar().GetRange().Min());
m_pTableView->SetPosSizePixel(Point( 0, 0 ),Size( aTotalOutputSize.Width()-nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight ));
}
@@ -186,7 +186,7 @@ OJoinTableView::~OJoinTableView()
IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar )
{
// move all windows
- ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), false );
+ ScrollPane( pScrollBar->GetDelta(), (pScrollBar == &GetHScrollBar()), false );
return 0;
}
@@ -202,8 +202,8 @@ void OJoinTableView::Resize()
return;
// we have at least one table so resize it
- m_aScrollOffset.X() = GetHScrollBar()->GetThumbPos();
- m_aScrollOffset.Y() = GetVScrollBar()->GetThumbPos();
+ m_aScrollOffset.X() = GetHScrollBar().GetThumbPos();
+ m_aScrollOffset.Y() = GetVScrollBar().GetThumbPos();
OTableWindow* pCheck = m_aTableMap.begin()->second;
Point aRealPos = pCheck->GetPosPixel();
@@ -311,7 +311,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
OTableWindow* pNewTabWin = createWindow( pNewTabWinData );
if ( pNewTabWin->Init() )
{
- m_pView->getController().getTableWindowData()->push_back( pNewTabWinData);
+ m_pView->getController().getTableWindowData().push_back( pNewTabWinData);
// when we already have a table with this name insert the full qualified one instead
if(m_aTableMap.find(rWinName) != m_aTableMap.end())
m_aTableMap[_rComposedName] = pNewTabWin;
@@ -366,10 +366,10 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
pTabWin->Hide();
OJoinController& rController = m_pView->getController();
- TTableWindowData::iterator aFind = ::std::find(rController.getTableWindowData()->begin(),rController.getTableWindowData()->end(),pData);
- if(aFind != rController.getTableWindowData()->end())
+ TTableWindowData::iterator aFind = ::std::find(rController.getTableWindowData().begin(), rController.getTableWindowData().end(), pData);
+ if(aFind != rController.getTableWindowData().end())
{
- rController.getTableWindowData()->erase(aFind);
+ rController.getTableWindowData().erase(aFind);
rController.setModified(sal_True);
}
@@ -395,16 +395,14 @@ namespace
bool isScrollAllowed( OJoinTableView* _pView,long nDelta, bool bHoriz)
{
// adjust ScrollBar-Positions
- ScrollBar* pBar = _pView->GetVScrollBar();
- if( bHoriz )
- pBar = _pView->GetHScrollBar();
+ ScrollBar& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar() ;
- long nOldThumbPos = pBar->GetThumbPos();
+ long nOldThumbPos = rBar.GetThumbPos();
long nNewThumbPos = nOldThumbPos + nDelta;
if( nNewThumbPos < 0 )
nNewThumbPos = 0;
- else if( nNewThumbPos > pBar->GetRangeMax() )
- nNewThumbPos = pBar->GetRangeMax();
+ else if( nNewThumbPos > rBar.GetRangeMax() )
+ nNewThumbPos = rBar.GetRangeMax();
if ( bHoriz )
{
@@ -462,12 +460,12 @@ namespace
if ( bVisbile )
{
- sal_Int32 nHRangeMax = _pView->GetHScrollBar()->GetRangeMax();
- sal_Int32 nVRangeMax = _pView->GetVScrollBar()->GetRangeMax();
+ sal_Int32 nHRangeMax = _pView->GetHScrollBar().GetRangeMax();
+ sal_Int32 nVRangeMax = _pView->GetVScrollBar().GetRangeMax();
- if ( aSize.Width() + _pView->GetHScrollBar()->GetThumbPos() + _nScrollX > nHRangeMax )
+ if ( aSize.Width() + _pView->GetHScrollBar().GetThumbPos() + _nScrollX > nHRangeMax )
bVisbile = false;
- if ( bVisbile && aSize.Height() + _pView->GetVScrollBar()->GetThumbPos() + _nScrollY > nVRangeMax )
+ if ( bVisbile && aSize.Height() + _pView->GetVScrollBar().GetThumbPos() + _nScrollY > nVRangeMax )
bVisbile = false;
}
}
@@ -576,10 +574,10 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin )
aBottom.X() += aNewSize.Width();
aBottom.Y() += aNewSize.Height();
- if(!GetHScrollBar()->GetRange().IsInside(aBottom.X()))
- GetHScrollBar()->SetRange( Range(0, aBottom.X()) );
- if(!GetVScrollBar()->GetRange().IsInside(aBottom.Y()))
- GetVScrollBar()->SetRange( Range(0, aBottom.Y()) );
+ if(!GetHScrollBar().GetRange().IsInside(aBottom.X()))
+ GetHScrollBar().SetRange( Range(0, aBottom.X()) );
+ if(!GetVScrollBar().GetRange().IsInside(aBottom.Y()))
+ GetVScrollBar().SetRange( Range(0, aBottom.Y()) );
pTabWin->SetPosSizePixel( aNewPos, aNewSize );
}
@@ -643,50 +641,50 @@ bool OJoinTableView::ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars
{
if( bHoriz )
{
- long nOldThumbPos = GetHScrollBar()->GetThumbPos();
+ long nOldThumbPos = GetHScrollBar().GetThumbPos();
long nNewThumbPos = nOldThumbPos + nDelta;
if( nNewThumbPos < 0 )
{
nNewThumbPos = 0;
bRet = false;
}
- if( nNewThumbPos > GetHScrollBar()->GetRange().Max() )
+ if( nNewThumbPos > GetHScrollBar().GetRange().Max() )
{
- nNewThumbPos = GetHScrollBar()->GetRange().Max();
+ nNewThumbPos = GetHScrollBar().GetRange().Max();
bRet = false;
}
- GetHScrollBar()->SetThumbPos( nNewThumbPos );
- nDelta = GetHScrollBar()->GetThumbPos() - nOldThumbPos;
+ GetHScrollBar().SetThumbPos( nNewThumbPos );
+ nDelta = GetHScrollBar().GetThumbPos() - nOldThumbPos;
}
else
{
- long nOldThumbPos = GetVScrollBar()->GetThumbPos();
+ long nOldThumbPos = GetVScrollBar().GetThumbPos();
long nNewThumbPos = nOldThumbPos+nDelta;
if( nNewThumbPos < 0 )
{
nNewThumbPos = 0;
bRet = false;
}
- if( nNewThumbPos > GetVScrollBar()->GetRange().Max() )
+ if( nNewThumbPos > GetVScrollBar().GetRange().Max() )
{
- nNewThumbPos = GetVScrollBar()->GetRange().Max();
+ nNewThumbPos = GetVScrollBar().GetRange().Max();
bRet = false;
}
- GetVScrollBar()->SetThumbPos( nNewThumbPos );
- nDelta = GetVScrollBar()->GetThumbPos() - nOldThumbPos;
+ GetVScrollBar().SetThumbPos( nNewThumbPos );
+ nDelta = GetVScrollBar().GetThumbPos() - nOldThumbPos;
}
}
// If ScrollOffset hitting borders, no redrawing.
- if( (GetHScrollBar()->GetThumbPos()==m_aScrollOffset.X()) &&
- (GetVScrollBar()->GetThumbPos()==m_aScrollOffset.Y()) )
+ if( (GetHScrollBar().GetThumbPos()==m_aScrollOffset.X()) &&
+ (GetVScrollBar().GetThumbPos()==m_aScrollOffset.Y()) )
return false;
// set ScrollOffset anew
if (bHoriz)
- m_aScrollOffset.X() = GetHScrollBar()->GetThumbPos();
+ m_aScrollOffset.X() = GetHScrollBar().GetThumbPos();
else
- m_aScrollOffset.Y() = GetVScrollBar()->GetThumbPos();
+ m_aScrollOffset.Y() = GetVScrollBar().GetThumbPos();
// move all windows
OTableWindow* pTabWin;
@@ -749,7 +747,7 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt )
if ( ! (pData && pData->HasPosition() && (pData->GetPosition() == aDragWinPos)))
{
// old logic coordinates
- Point ptOldPos = m_pDragWin->GetPosPixel() + Point(GetHScrollBar()->GetThumbPos(), GetVScrollBar()->GetThumbPos());
+ Point ptOldPos = m_pDragWin->GetPosPixel() + Point(GetHScrollBar().GetThumbPos(), GetVScrollBar().GetThumbPos());
// new positioning
m_pDragWin->SetPosPixel(aDragWinPos);
TabWinMoved(m_pDragWin, ptOldPos);
@@ -894,9 +892,9 @@ void OJoinTableView::SelectConn(OTableConnection* pConn)
SvTreeListEntry* pFirstSourceVisible = pSourceBox->GetFirstEntryInView();
SvTreeListEntry* pFirstDestVisible = pDestBox->GetFirstEntryInView();
- const ::std::vector<OConnectionLine*>* pLines = pConn->GetConnLineList();
- ::std::vector<OConnectionLine*>::const_reverse_iterator aIter = pLines->rbegin();
- for(;aIter != pLines->rend();++aIter)
+ const ::std::vector<OConnectionLine*>& rLines = pConn->GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_reverse_iterator aIter = rLines.rbegin();
+ for(;aIter != rLines.rend();++aIter)
{
if ((*aIter)->IsValid())
{
@@ -1077,7 +1075,7 @@ void OJoinTableView::invalidateAndModify(SfxUndoAction *_pAction)
void OJoinTableView::TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPosition)
{
- Point ptThumbPos(GetHScrollBar()->GetThumbPos(), GetVScrollBar()->GetThumbPos());
+ Point ptThumbPos(GetHScrollBar().GetThumbPos(), GetVScrollBar().GetThumbPos());
ptWhich->GetData()->SetPosition(ptWhich->GetPosPixel() + ptThumbPos);
invalidateAndModify(new OJoinMoveTabWinUndoAct(this, ptOldPosition, ptWhich));
@@ -1150,9 +1148,9 @@ void OJoinTableView::Command(const CommandEvent& rEvt)
{
if( pSelConnection )
{
- const ::std::vector<OConnectionLine*>* pLines = pSelConnection->GetConnLineList();
- ::std::vector<OConnectionLine*>::const_iterator aIter = ::std::find_if(pLines->begin(),pLines->end(),::std::mem_fun(&OConnectionLine::IsValid));
- if( aIter != pLines->end() )
+ const ::std::vector<OConnectionLine*>& rLines = pSelConnection->GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_iterator aIter = ::std::find_if(rLines.begin(), rLines.end(),::std::mem_fun(&OConnectionLine::IsValid));
+ if( aIter != rLines.end() )
executePopup((*aIter)->getMidPoint(),pSelConnection);
}
}
@@ -1475,16 +1473,14 @@ void OJoinTableView::HideTabWins()
{
SetUpdateMode(false);
- OTableWindowMap* pTabWins = GetTabWinMap();
- if ( pTabWins )
- {
- // working on a copy because the real list will be cleared in inner calls
- OTableWindowMap aCopy(*pTabWins);
- OTableWindowMap::iterator aIter = aCopy.begin();
- OTableWindowMap::iterator aEnd = aCopy.end();
- for(;aIter != aEnd;++aIter)
- RemoveTabWin(aIter->second);
- }
+ OTableWindowMap& rTabWins = GetTabWinMap();
+
+ // working on a copy because the real list will be cleared in inner calls
+ OTableWindowMap aCopy(rTabWins);
+ OTableWindowMap::iterator aIter = aCopy.begin();
+ OTableWindowMap::iterator aEnd = aCopy.end();
+ for(;aIter != aEnd;++aIter)
+ RemoveTabWin(aIter->second);
m_pView->getController().setModified(sal_True);
@@ -1571,10 +1567,10 @@ void OJoinTableView::addConnection(OTableConnection* _pConnection,bool _bAddData
if ( _bAddData )
{
#if OSL_DEBUG_LEVEL > 0
- TTableConnectionData* pTabConnDataList = m_pView->getController().getTableConnectionData();
- OSL_ENSURE( ::std::find(pTabConnDataList->begin(),pTabConnDataList->end(),_pConnection->GetData()) == pTabConnDataList->end(),"Data already in vector!");
+ TTableConnectionData& rTabConnDataList = m_pView->getController().getTableConnectionData();
+ OSL_ENSURE( ::std::find(rTabConnDataList.begin(), rTabConnDataList.end(),_pConnection->GetData()) == rTabConnDataList.end(),"Data already in vector!");
#endif
- m_pView->getController().getTableConnectionData()->push_back(_pConnection->GetData());
+ m_pView->getController().getTableConnectionData().push_back(_pConnection->GetData());
}
m_vTableConnection.push_back(_pConnection);
_pConnection->RecalcLines();
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index c515159faaa3..213fc3e4710d 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -339,7 +339,7 @@ namespace
bBrace = true;
_rJoin = _rJoin.replaceAt(_rJoin.getLength()-1,1,OUString(' '));
}
- (_rJoin += C_AND) += BuildJoinCriteria(_xConnection,pData->GetConnLineDataList(),pData);
+ (_rJoin += C_AND) += BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
if(bBrace)
_rJoin += ")";
_pEntryConn->SetVisited(true);
@@ -413,7 +413,7 @@ namespace
if ( CROSS_JOIN != pData->GetJoinType() && !pData->isNatural() )
{
aErg += " ON ";
- aErg += BuildJoinCriteria(_xConnection,pData->GetConnLineDataList(),pData);
+ aErg += BuildJoinCriteria(_xConnection,&pData->GetConnLineDataList(),pData);
}
return aErg;
@@ -508,9 +508,9 @@ namespace
pEntryConn->SetVisited(true);
// first search for the "to" window
- const ::std::vector<OTableConnection*>* pConnections = pEntryConn->GetParent()->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = pConnections->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnections->end();
+ const ::std::vector<OTableConnection*>& rConnections = pEntryConn->GetParent()->getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter = rConnections.begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end();
for(;aIter != aEnd;++aIter)
{
OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter);
@@ -528,7 +528,7 @@ namespace
if(aIter == aEnd)
{
OQueryTableWindow* pEntryTabFrom = static_cast<OQueryTableWindow*>(pEntryConn->GetSourceWin());
- aIter = pConnections->begin();
+ aIter = rConnections.begin();
for(;aIter != aEnd;++aIter)
{
OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter);
@@ -636,7 +636,7 @@ namespace
const Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData();
const OUString aQuote = xMetaData->getIdentifierQuoteString();
- OJoinTableView::OTableWindowMap* pTabList = _pView->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap& rTabList = _pView->getTableView()->GetTabWinMap();
const static OUString sFieldSeparator(", ");
const static OUString s_sAs(" AS ");
@@ -660,8 +660,8 @@ namespace
{
// we have to look if we have alias.* here but before we have to check if the column doesn't already exist
OTableFieldDescRef aInfo = new OTableFieldDesc();
- OJoinTableView::OTableWindowMap::iterator tableIter = pTabList->begin();
- OJoinTableView::OTableWindowMap::iterator tableEnd = pTabList->end();
+ OJoinTableView::OTableWindowMap::iterator tableIter = rTabList.begin();
+ OJoinTableView::OTableWindowMap::iterator tableEnd = rTabList.end();
bool bFound = false;
for(;!bFound && tableIter != tableEnd ;++tableIter)
{
@@ -995,7 +995,7 @@ namespace
{
if(!_rJoinCrit.isEmpty())
_rJoinCrit += C_AND;
- _rJoinCrit += BuildJoinCriteria(_xConnection,pEntryConnData->GetConnLineDataList(),pEntryConnData);
+ _rJoinCrit += BuildJoinCriteria(_xConnection,&pEntryConnData->GetConnLineDataList(),pEntryConnData);
}
}
}
@@ -1532,9 +1532,9 @@ namespace
OSQLParseNode* pParamNode = pFunction->getChild(pFunction->count()-2);
if ( pParamNode && pParamNode->getTokenValue().toChar() == '*' )
{
- OJoinTableView::OTableWindowMap* pTabList = _pView->getTableView()->GetTabWinMap();
- OJoinTableView::OTableWindowMap::iterator aIter = pTabList->begin();
- OJoinTableView::OTableWindowMap::iterator aTabEnd = pTabList->end();
+ OJoinTableView::OTableWindowMap& rTabList = _pView->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabList.begin();
+ OJoinTableView::OTableWindowMap::iterator aTabEnd = rTabList.end();
for(;aIter != aTabEnd;++aIter)
{
OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second);
@@ -1606,9 +1606,9 @@ namespace
true));
if ( pConn )
{
- OConnectionLineDataVec* pLineDataList = pConn->GetData()->GetConnLineDataList();
- OConnectionLineDataVec::iterator aIter = pLineDataList->begin();
- OConnectionLineDataVec::iterator aEnd = pLineDataList->end();
+ OConnectionLineDataVec& rLineDataList = pConn->GetData()->GetConnLineDataList();
+ OConnectionLineDataVec::iterator aIter = rLineDataList.begin();
+ OConnectionLineDataVec::iterator aEnd = rLineDataList.end();
for(;aIter != aEnd;++aIter)
{
if((*aIter)->GetSourceFieldName() == aDragLeft->GetField() ||
@@ -2022,7 +2022,7 @@ namespace
}
// now delete the data for which we haven't any tablewindow
- OJoinTableView::OTableWindowMap aTableMap(*pTableView->GetTabWinMap());
+ OJoinTableView::OTableWindowMap aTableMap(pTableView->GetTabWinMap());
OJoinTableView::OTableWindowMap::iterator aIterTableMap = aTableMap.begin();
OJoinTableView::OTableWindowMap::iterator aIterTableEnd = aTableMap.end();
for(;aIterTableMap != aIterTableEnd;++aIterTableMap)
@@ -2056,7 +2056,7 @@ namespace
rController.setLimit(-1);
}
- if ( (eErrorCode = InstallFields(_pView,pParseTree, pTableView->GetTabWinMap())) == eOk )
+ if ( (eErrorCode = InstallFields(_pView, pParseTree, &pTableView->GetTabWinMap())) == eOk )
{
// GetSelectionCriteria must be called before GetHavingCriteria
sal_uInt16 nLevel=0;
@@ -2735,11 +2735,11 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi
bool bAllTables = sAliasName.isEmpty();
- OJoinTableView::OTableWindowMap* pTabWins = m_pTableView->GetTabWinMap();
+ OJoinTableView::OTableWindowMap& rTabWins = m_pTableView->GetTabWinMap();
OUString strCurrentPrefix;
::std::vector< OUString> aFields;
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWins->begin();
- OJoinTableView::OTableWindowMap::iterator aEnd = pTabWins->end();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWins.begin();
+ OJoinTableView::OTableWindowMap::iterator aEnd = rTabWins.end();
for(;aIter != aEnd;++aIter)
{
OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second);
@@ -2831,8 +2831,8 @@ OUString OQueryDesignView::getStatement()
return OUString();
}
- OQueryTableView::OTableWindowMap* pTabList = m_pTableView->GetTabWinMap();
- sal_uInt32 nTabcount = pTabList->size();
+ OQueryTableView::OTableWindowMap& rTabList = m_pTableView->GetTabWinMap();
+ sal_uInt32 nTabcount = rTabList.size();
OUString aFieldListStr(GenerateSelectList(this,rFieldList,nTabcount>1));
if( aFieldListStr.isEmpty() )
@@ -2844,9 +2844,9 @@ OUString OQueryDesignView::getStatement()
// and trigger a error message
// ----------------- Build table list ----------------------
- const ::std::vector<OTableConnection*>* pConnList = m_pTableView->getTableConnections();
+ const ::std::vector<OTableConnection*>& rConnList = m_pTableView->getTableConnections();
Reference< XConnection> xConnection = rController.getConnection();
- OUString aTableListStr(GenerateFromClause(xConnection,pTabList,pConnList));
+ OUString aTableListStr(GenerateFromClause(xConnection,&rTabList,&rConnList));
OSL_ENSURE(!aTableListStr.isEmpty(), "OQueryDesignView::getStatement() : unexpected : have Fields, but no Tables !");
// if fields exist now, these only can be created by inserting from an already existing table; if on the other hand
// a table is deleted, also the belonging fields will be deleted -> therefore it CANNOT occur that fields
@@ -2858,7 +2858,7 @@ OUString OQueryDesignView::getStatement()
return OUString();
OUString aJoinCrit;
- GenerateInnerJoinCriterias(xConnection,aJoinCrit,pConnList);
+ GenerateInnerJoinCriterias(xConnection,aJoinCrit,&rConnList);
if(!aJoinCrit.isEmpty())
{
OUString aTmp = "( " + aJoinCrit + " )";
@@ -2990,7 +2990,7 @@ bool OQueryDesignView::isSlotEnabled(sal_Int32 _nSlotId)
void OQueryDesignView::SaveUIConfig()
{
OQueryController& rCtrl = static_cast<OQueryController&>(getController());
- rCtrl.SaveTabWinsPosSize( m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos() );
+ rCtrl.SaveTabWinsPosSize( &m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos() );
rCtrl.setVisibleRows( m_pSelectionBox->GetNoneVisibleRows() );
if ( m_aSplitter.GetSplitPosPixel() != 0 )
rCtrl.setSplitPos( m_aSplitter.GetSplitPosPixel() );
diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
index 7b0eaed7aff9..e7a0a59a4efe 100644
--- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.cxx
@@ -23,7 +23,7 @@
using namespace dbaui;
void OJoinMoveTabWinUndoAct::TogglePosition()
{
- Point ptFrameScrollPos(m_pOwner->GetHScrollBar()->GetThumbPos(), m_pOwner->GetVScrollBar()->GetThumbPos());
+ Point ptFrameScrollPos(m_pOwner->GetHScrollBar().GetThumbPos(), m_pOwner->GetVScrollBar().GetThumbPos());
Point ptNext = m_pTabWin->GetPosPixel() + ptFrameScrollPos;
m_pTabWin->SetPosPixel(m_ptNextPosition - ptFrameScrollPos);
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
index 33df8ffb49c2..22c9921330a6 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
@@ -54,7 +54,7 @@ namespace dbaui
// access to the managed connections
sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); }
- ::std::vector<OTableConnection*>* GetTabConnList() { return &m_vTableConnection; }
+ ::std::vector<OTableConnection*>& GetTabConnList() { return m_vTableConnection; }
void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); }
void RemoveConnection( OTableConnection* pConnection )
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 68b05500691d..4626706c5cc5 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -118,7 +118,7 @@ namespace
{
OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get());
- DlgQryJoin aDlg(_pView,_pConnectionData,_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
+ DlgQryJoin aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
bool bOk = aDlg.Execute() == RET_OK;
if( bOk )
{
@@ -236,11 +236,11 @@ sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMa
{
sal_Int32 nRet = 0;
- OTableWindowMap::iterator aIter = GetTabWinMap()->find(rName);
- while(aIter != GetTabWinMap()->end())
+ OTableWindowMap::iterator aIter = GetTabWinMap().find(rName);
+ while(aIter != GetTabWinMap().end())
{
- OUString aNewName = OUString(rName) + "_" + OUString::number(++nRet);
- aIter = GetTabWinMap()->find(aNewName);
+ OUString aNewName = rName + "_" + OUString::number(++nRet);
+ aIter = GetTabWinMap().find(aNewName);
}
rMax = nRet;
@@ -250,17 +250,17 @@ sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMa
void OQueryTableView::ReSync()
{
- TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
- OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0),
+ TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData();
+ OSL_ENSURE((getTableConnections().size()==0) && (GetTabWinMap().size()==0),
"before calling OQueryTableView::ReSync() please call ClearAll !");
// I need a collection of all window names that cannot be created so that I do not initialize connections for them.
::std::vector<OUString> arrInvalidTables;
- TTableWindowData::reverse_iterator aIter = pTabWinDataList->rbegin();
+ TTableWindowData::reverse_iterator aIter = rTabWinDataList.rbegin();
// Create the window and add it
- for(;aIter != pTabWinDataList->rend();++aIter)
+ for(;aIter != rTabWinDataList.rend();++aIter)
{
OQueryTableWindowData* pData = static_cast<OQueryTableWindowData*>(aIter->get());
OTableWindow* pTabWin = createWindow(*aIter);
@@ -276,11 +276,11 @@ void OQueryTableView::ReSync()
delete pTabWin;
arrInvalidTables.push_back(pData->GetAliasName());
- pTabWinDataList->erase( ::std::remove(pTabWinDataList->begin(),pTabWinDataList->end(),*aIter) ,pTabWinDataList->end());
+ rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
continue;
}
- (*GetTabWinMap())[pData->GetAliasName()] = pTabWin; // add at the beginning as I am going backwards through the DataList
+ GetTabWinMap()[pData->GetAliasName()] = pTabWin; // add at the beginning as I am going backwards through the DataList
// Use the default if there is no position or size
if (!pData->HasPosition() && !pData->HasSize())
SetDefaultTabWinPosSize(pTabWin);
@@ -289,10 +289,10 @@ void OQueryTableView::ReSync()
}
// Add the connections
- TTableConnectionData* pTabConnDataList = m_pView->getController().getTableConnectionData();
- TTableConnectionData::reverse_iterator aConIter = pTabConnDataList->rbegin();
+ TTableConnectionData& rTabConnDataList = m_pView->getController().getTableConnectionData();
+ TTableConnectionData::reverse_iterator aConIter = rTabConnDataList.rbegin();
- for(;aConIter != pTabConnDataList->rend();++aConIter)
+ for(;aConIter != rTabConnDataList.rend();++aConIter)
{
OQueryTableConnectionData* pTabConnData = static_cast<OQueryTableConnectionData*>(aConIter->get());
@@ -305,7 +305,7 @@ void OQueryTableView::ReSync()
if (bInvalid)
{
// no -> bad luck, no connection
- pTabConnDataList->erase( ::std::remove(pTabConnDataList->begin(),pTabConnDataList->end(),*aConIter) ,pTabConnDataList->end());
+ rTabConnDataList.erase( ::std::remove(rTabConnDataList.begin(), rTabConnDataList.end(), *aConIter), rTabConnDataList.end());
continue;
}
@@ -331,15 +331,15 @@ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn,
{
// let's first check if I have the connection already
OQueryTableConnection* pTabConn = NULL;
- const ::std::vector<OTableConnection*>* pConnections = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnections->end();
- ::std::vector<OTableConnection*>::const_iterator aIter = ::std::find( pConnections->begin(),
+ const ::std::vector<OTableConnection*>& rConnections = getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end();
+ ::std::vector<OTableConnection*>::const_iterator aIter = ::std::find( rConnections.begin(),
aEnd,
static_cast<const OTableConnection*>(&rNewConn)
);
if(aIter == aEnd )
{
- aIter = pConnections->begin();
+ aIter = rConnections.begin();
for(;aIter != aEnd;++aIter)
{
if(*static_cast<OQueryTableConnection*>(*aIter) == rNewConn)
@@ -445,9 +445,9 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
// first check if this already has its data
bool bAppend = bNewTable;
TTableWindowData::value_type pNewTabWinData;
- TTableWindowData* pWindowData = getDesignView()->getController().getTableWindowData();
- TTableWindowData::iterator aWinIter = pWindowData->begin();
- TTableWindowData::iterator aWinEnd = pWindowData->end();
+ TTableWindowData& rWindowData = getDesignView()->getController().getTableWindowData();
+ TTableWindowData::iterator aWinIter = rWindowData.begin();
+ TTableWindowData::iterator aWinEnd = rWindowData.end();
for(;aWinIter != aWinEnd;++aWinIter)
{
pNewTabWinData = *aWinIter;
@@ -479,8 +479,8 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
}
// Show the relations between the individual tables
- OTableWindowMap* pTabWins = GetTabWinMap();
- if(bNewTable && !pTabWins->empty() && !_rTableName.isEmpty())
+ OTableWindowMap& rTabWins = GetTabWinMap();
+ if(bNewTable && !rTabWins.empty() && !_rTableName.isEmpty())
{
modified();
if ( m_pAccessible )
@@ -523,11 +523,11 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
xProp->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= aReferencedTable;
OSL_ENSURE(!aReferencedTable.isEmpty(),"Foreign key without referencedTableName");
- OTableWindowMap::const_iterator aIter = pTabWins->find(aReferencedTable);
- OTableWindowMap::const_iterator aEnd = pTabWins->end();
+ OTableWindowMap::const_iterator aIter = rTabWins.find(aReferencedTable);
+ OTableWindowMap::const_iterator aEnd = rTabWins.end();
if(aIter == aEnd)
{
- for(aIter = pTabWins->begin();aIter != aEnd;++aIter)
+ for(aIter = rTabWins.begin();aIter != aEnd;++aIter)
{
OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second);
OSL_ENSURE( pTabWinTmp,"TableWindow is null!" );
@@ -543,8 +543,8 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
case KeyType::PRIMARY:
{
// we have a primary key so look in our list if there exists a key which this is referred to
- OTableWindowMap::const_iterator aIter = pTabWins->begin();
- OTableWindowMap::const_iterator aEnd = pTabWins->end();
+ OTableWindowMap::const_iterator aIter = rTabWins.begin();
+ OTableWindowMap::const_iterator aEnd = rTabWins.end();
for(;aIter != aEnd;++aIter)
{
OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second);
@@ -659,9 +659,9 @@ void OQueryTableView::createNewConnection()
TTableConnectionData::value_type pData(new OQueryTableConnectionData());
if( openJoinDialog(this,pData,true) )
{
- OTableWindowMap* pMap = GetTabWinMap();
- OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>((*pMap)[pData->getReferencingTable()->GetWinName()]);
- OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>((*pMap)[pData->getReferencedTable()->GetWinName()]);
+ OTableWindowMap& rMap = GetTabWinMap();
+ OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencingTable()->GetWinName()]);
+ OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencedTable()->GetWinName()]);
// first we have to look if the this connection already exists
OTableConnection* pConn = GetTabConn(pSourceWin,pDestWin,true);
bool bNew = true;
@@ -706,8 +706,8 @@ OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName)
{
OSL_ENSURE(!rAliasName.isEmpty(), "OQueryTableView::FindTable : the AliasName should not be empty !");
// (it is harmless but does not make sense and indicates that there is probably an error in the caller)
- OTableWindowMap::const_iterator aIter = GetTabWinMap()->find(rAliasName);
- if(aIter != GetTabWinMap()->end())
+ OTableWindowMap::const_iterator aIter = GetTabWinMap().find(rAliasName);
+ if(aIter != GetTabWinMap().end())
return static_cast<OQueryTableWindow*>(aIter->second);
return NULL;
}
@@ -715,8 +715,8 @@ OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName)
bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt)
{
rCnt = 0;
- OTableWindowMap::const_iterator aIter = GetTabWinMap()->begin();
- OTableWindowMap::const_iterator aEnd = GetTabWinMap()->end();
+ OTableWindowMap::const_iterator aIter = GetTabWinMap().begin();
+ OTableWindowMap::const_iterator aEnd = GetTabWinMap().end();
for(;aIter != aEnd;++aIter)
{
if(static_cast<OQueryTableWindow*>(aIter->second)->ExistsField(rFieldName, rInfo))
@@ -728,11 +728,10 @@ bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableField
bool OQueryTableView::ContainsTabWin(const OTableWindow& rTabWin)
{
- OTableWindowMap* pTabWins = GetTabWinMap();
- OSL_ENSURE(pTabWins != NULL, "OQueryTableView::RemoveTabWin : Window should not be NULL !");
+ OTableWindowMap& rTabWins = GetTabWinMap();
- OTableWindowMap::iterator aIter = pTabWins->begin();
- OTableWindowMap::iterator aEnd = pTabWins->end();
+ OTableWindowMap::iterator aIter = rTabWins.begin();
+ OTableWindowMap::iterator aEnd = rTabWins.end();
for ( ;aIter != aEnd ; ++aIter )
{
@@ -808,74 +807,70 @@ void OQueryTableView::DropConnection(OQueryTableConnection* pConn)
void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction )
{
- OTableWindowMap* pTabWins = GetTabWinMap();
- OSL_ENSURE(pTabWins != NULL, "OQueryTableView::HideTabWin : have no TabWins !");
-
- if (pTabWin)
- {
- // Window
- // save the position in its data
- getDesignView()->SaveTabWinUIConfig(pTabWin);
- // (I need to go via the parent, as only the parent knows the position of the scrollbars)
- // and then out of the TabWins list and hide
- OTableWindowMap::iterator aIter = pTabWins->begin();
- OTableWindowMap::iterator aEnd = pTabWins->end();
- for ( ;aIter != aEnd ; ++aIter )
- if ( aIter->second == pTabWin )
- {
- pTabWins->erase( aIter );
- break;
- }
+ OTableWindowMap& rTabWins = GetTabWinMap();
+
+ // Window
+ // save the position in its data
+ getDesignView()->SaveTabWinUIConfig(pTabWin);
+ // (I need to go via the parent, as only the parent knows the position of the scrollbars)
+ // and then out of the TabWins list and hide
+ OTableWindowMap::iterator aIter = rTabWins.begin();
+ OTableWindowMap::iterator aEnd = rTabWins.end();
+ for ( ;aIter != aEnd ; ++aIter )
+ if ( aIter->second == pTabWin )
+ {
+ rTabWins.erase( aIter );
+ break;
+ }
- pTabWin->Hide(); // do not destroy it, as it is still in the undo list!!
+ pTabWin->Hide(); // do not destroy it, as it is still in the undo list!!
- // the TabWin data must also be passed out of my responsibility
- TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
- pTabWinDataList->erase( ::std::remove(pTabWinDataList->begin(),pTabWinDataList->end(),pTabWin->GetData()),pTabWinDataList->end());
- // The data should not be destroyed as TabWin itself - which is still alive - needs them
- // Either it goes back into my responsibility, (via ShowTabWin), then I add the data back,
- // or the Undo-Action, which currently has full responsibility for the window
- // and its data, gets destroyed and destroys both the window and its data
+ // the TabWin data must also be passed out of my responsibility
+ TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData();
+ rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), pTabWin->GetData()), rTabWinDataList.end());
+ // The data should not be destroyed as TabWin itself - which is still alive - needs them
+ // Either it goes back into my responsibility, (via ShowTabWin), then I add the data back,
+ // or the Undo-Action, which currently has full responsibility for the window
+ // and its data, gets destroyed and destroys both the window and its data
- if (m_pLastFocusTabWin == pTabWin)
- m_pLastFocusTabWin = NULL;
+ if (m_pLastFocusTabWin == pTabWin)
+ m_pLastFocusTabWin = NULL;
- // collect connections belonging to the window and pass to UndoAction
- sal_Int16 nCnt = 0;
- const ::std::vector<OTableConnection*>* pTabConList = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter2 = pTabConList->begin();
- for(;aIter2 != pTabConList->end();)// the end may change
+ // collect connections belonging to the window and pass to UndoAction
+ sal_Int16 nCnt = 0;
+ const ::std::vector<OTableConnection*>& rTabConList = getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter2 = rTabConList.begin();
+ for(;aIter2 != rTabConList.end();)// the end may change
+ {
+ OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>(*aIter2);
+ OSL_ENSURE(pTmpEntry,"OQueryTableConnection is null!");
+ if( pTmpEntry->GetAliasName(JTCS_FROM) == pTabWin->GetAliasName() ||
+ pTmpEntry->GetAliasName(JTCS_TO) == pTabWin->GetAliasName() )
{
- OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>(*aIter2);
- OSL_ENSURE(pTmpEntry,"OQueryTableConnection is null!");
- if( pTmpEntry->GetAliasName(JTCS_FROM) == pTabWin->GetAliasName() ||
- pTmpEntry->GetAliasName(JTCS_TO) == pTabWin->GetAliasName() )
- {
- // add to undo list
- pUndoAction->InsertConnection(pTmpEntry);
-
- // call base class because we append an undo action
- // but this time we are in a undo action list
- OJoinTableView::RemoveConnection(pTmpEntry,sal_False);
- aIter2 = pTabConList->begin();
- ++nCnt;
- }
- else
- ++aIter2;
+ // add to undo list
+ pUndoAction->InsertConnection(pTmpEntry);
+
+ // call base class because we append an undo action
+ // but this time we are in a undo action list
+ OJoinTableView::RemoveConnection(pTmpEntry,sal_False);
+ aIter2 = rTabConList.begin();
+ ++nCnt;
}
+ else
+ ++aIter2;
+ }
- if (nCnt)
- InvalidateConnections();
+ if (nCnt)
+ InvalidateConnections();
- m_pView->getController().InvalidateFeature(ID_BROWSER_ADDTABLE);
+ m_pView->getController().InvalidateFeature(ID_BROWSER_ADDTABLE);
- // inform the UndoAction that the window and connections belong to it
- pUndoAction->SetOwnership(true);
+ // inform the UndoAction that the window and connections belong to it
+ pUndoAction->SetOwnership(true);
- // by doing so, we have modified the document
- m_pView->getController().setModified( sal_True );
- m_pView->getController().InvalidateFeature(SID_BROWSER_CLEAR_QUERY);
- }
+ // by doing so, we have modified the document
+ m_pView->getController().setModified( sal_True );
+ m_pView->getController().InvalidateFeature(SID_BROWSER_CLEAR_QUERY);
}
bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction, bool _bAppend )
@@ -901,8 +896,8 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// Show the window and add to the list
OUString sName = static_cast< OQueryTableWindowData*>(pData.get())->GetAliasName();
- OSL_ENSURE(GetTabWinMap()->find(sName) == GetTabWinMap()->end(),"Alias name already in list!");
- GetTabWinMap()->insert(OTableWindowMap::value_type(sName,pTabWin));
+ OSL_ENSURE(GetTabWinMap().find(sName) == GetTabWinMap().end(),"Alias name already in list!");
+ GetTabWinMap().insert(OTableWindowMap::value_type(sName,pTabWin));
pTabWin->Show();
@@ -913,18 +908,18 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// GetEntryPos, and then in turn by the Connection, when its starting point to the window must be determined.
// the Connections
- ::std::vector<OTableConnection*>* pTableCon = pUndoAction->GetTabConnList();
- ::std::vector<OTableConnection*>::iterator aIter = pTableCon->begin();
- ::std::vector<OTableConnection*>::iterator aEnd = pTableCon->end();
+ ::std::vector<OTableConnection*>& rTableCon = pUndoAction->GetTabConnList();
+ ::std::vector<OTableConnection*>::iterator aIter = rTableCon.begin();
+ ::std::vector<OTableConnection*>::iterator aEnd = rTableCon.end();
for(;aIter != aEnd;++aIter)
addConnection(*aIter); // add all connections from the undo action
- pTableCon->clear();
+ rTableCon.clear();
// and add the window's data to the list (of the document)
if(_bAppend)
- m_pView->getController().getTableWindowData()->push_back(pTabWin->GetData());
+ m_pView->getController().getTableWindowData().push_back(pTabWin->GetData());
m_pView->getController().InvalidateFeature(ID_BROWSER_ADDTABLE);
@@ -959,18 +954,15 @@ void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo)
bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const
{
- const ::std::vector<OTableConnection*>* pList = getTableConnections();
- if (pList)
+ const ::std::vector<OTableConnection*>& rList = getTableConnections();
+ ::std::vector<OTableConnection*>::const_iterator aIter = rList.begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rList.end();
+ for(;aIter != aEnd;++aIter)
{
- ::std::vector<OTableConnection*>::const_iterator aIter = pList->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pList->end();
- for(;aIter != aEnd;++aIter)
- {
- OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(*aIter);
- if (pTemp->IsVisited() &&
- (pFrom == static_cast< OQueryTableWindow*>(pTemp->GetSourceWin()) || pFrom == static_cast< OQueryTableWindow*>(pTemp->GetDestWin())))
- return true;
- }
+ OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(*aIter);
+ if (pTemp->IsVisited() &&
+ (pFrom == static_cast< OQueryTableWindow*>(pTemp->GetSourceWin()) || pFrom == static_cast< OQueryTableWindow*>(pTemp->GetDestWin())))
+ return true;
}
return false;
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 5d76c2110925..195af536eabd 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -488,21 +488,18 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
enableControl(pEntry,m_pTableCell);
if ( !pEntry->isCondition() )
{
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if (pTabWinList)
- {
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->begin();
- OJoinTableView::OTableWindowMap::iterator aEnd = pTabWinList->end();
+ OJoinTableView::OTableWindowMap& rTabWinList = getDesignView()->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.begin();
+ OJoinTableView::OTableWindowMap::iterator aEnd = rTabWinList.end();
- for(;aIter != aEnd;++aIter)
- m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName());
+ for(;aIter != aEnd;++aIter)
+ m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName());
- m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0);
- if (!pEntry->GetAlias().isEmpty())
- m_pTableCell->SelectEntry(pEntry->GetAlias());
- else
- m_pTableCell->SelectEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)));
- }
+ m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0);
+ if (!pEntry->GetAlias().isEmpty())
+ m_pTableCell->SelectEntry(pEntry->GetAlias());
+ else
+ m_pTableCell->SelectEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)));
}
} break;
case BROW_VIS_ROW:
@@ -607,22 +604,18 @@ bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, const OUSt
OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
if ( !pEntryTab ) // no table found with this name so we have to travel through all tables
{
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if ( pTabWinList )
+ sal_uInt16 nTabCount = 0;
+ if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window
{
- sal_uInt16 nTabCount = 0;
- if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window
- {
- OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
- sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName);
- OSQLErrorBox( this, sErrorMsg ).Execute();
- bError = true;
- }
- else
- {
- pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
- notifyTableFieldChanged(OUString(),_pEntry->GetAlias(),_bListAction,GetCurColumnId());
- }
+ OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST));
+ sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName);
+ OSQLErrorBox( this, sErrorMsg ).Execute();
+ bError = true;
+ }
+ else
+ {
+ pEntryTab = static_cast<OQueryTableWindow*>(_pEntry->GetTabWindow());
+ notifyTableFieldChanged(OUString(),_pEntry->GetAlias(),_bListAction,GetCurColumnId());
}
}
if ( pEntryTab ) // here we got a valid table
@@ -991,18 +984,15 @@ bool OSelectionBrowseBox::SaveModified()
{
pEntry->SetAlias(aAliasName);
// we have to set the table name as well as the table window
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if (pTabWinList)
+ OJoinTableView::OTableWindowMap& rTabWinList = getDesignView()->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(aAliasName);
+ if(aIter != rTabWinList.end())
{
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->find(aAliasName);
- if(aIter != pTabWinList->end())
+ OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
+ if (pEntryTab)
{
- OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
- if (pEntryTab)
- {
- pEntry->SetTable(pEntryTab->GetTableName());
- pEntry->SetTabWindow(pEntryTab);
- }
+ pEntry->SetTable(pEntryTab->GetTableName());
+ pEntry->SetTabWindow(pEntryTab);
}
}
}
@@ -2618,19 +2608,16 @@ OUString OSelectionBrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBo
bool OSelectionBrowseBox::fillEntryTable(OTableFieldDescRef& _pEntry,const OUString& _sTableName)
{
bool bRet = false;
- OJoinTableView::OTableWindowMap* pTabWinList = getDesignView()->getTableView()->GetTabWinMap();
- if (pTabWinList)
+ OJoinTableView::OTableWindowMap& rTabWinList = getDesignView()->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(_sTableName);
+ if(aIter != rTabWinList.end())
{
- OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->find(_sTableName);
- if(aIter != pTabWinList->end())
+ OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
+ if (pEntryTab)
{
- OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
- if (pEntryTab)
- {
- _pEntry->SetTable(pEntryTab->GetTableName());
- _pEntry->SetTabWindow(pEntryTab);
- bRet = true;
- }
+ _pEntry->SetTable(pEntryTab->GetTableName());
+ _pEntry->SetTabWindow(pEntryTab);
+ bRet = true;
}
}
return bRet;
diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx
index 9ced392a9e0e..6d7864e06db7 100644
--- a/dbaccess/source/ui/querydesign/TableConnection.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnection.cxx
@@ -53,10 +53,10 @@ namespace dbaui
void OTableConnection::Init()
{
// initialise linelist with defaults
- OConnectionLineDataVec* pLineData = GetData()->GetConnLineDataList();
- OConnectionLineDataVec::const_iterator aIter = pLineData->begin();
- OConnectionLineDataVec::const_iterator aEnd = pLineData->end();
- m_vConnLine.reserve(pLineData->size());
+ OConnectionLineDataVec& rLineData = GetData()->GetConnLineDataList();
+ OConnectionLineDataVec::const_iterator aIter = rLineData.begin();
+ OConnectionLineDataVec::const_iterator aEnd = rLineData.end();
+ m_vConnLine.reserve(rLineData.size());
for(;aIter != aEnd;++aIter)
m_vConnLine.push_back( new OConnectionLine(this, *aIter) );
}
@@ -89,12 +89,12 @@ namespace dbaui
clearLineData();
// copy linelist
- if(! rConn.GetConnLineList()->empty() )
+ if(! rConn.GetConnLineList().empty() )
{
- const ::std::vector<OConnectionLine*>* pLine = rConn.GetConnLineList();
- ::std::vector<OConnectionLine*>::const_iterator aIter = pLine->begin();
- ::std::vector<OConnectionLine*>::const_iterator aEnd = pLine->end();
- m_vConnLine.reserve(pLine->size());
+ const ::std::vector<OConnectionLine*>& rLine = rConn.GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_iterator aIter = rLine.begin();
+ ::std::vector<OConnectionLine*>::const_iterator aEnd = rLine.end();
+ m_vConnLine.reserve(rLine.size());
for(;aIter != aEnd;++aIter)
m_vConnLine.push_back( CreateConnLine( **aIter ));
}
diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
index fe9a3a8e040f..43fc4eed8880 100644
--- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
@@ -77,10 +77,10 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat
ResetConnLines();
// and copy
- OConnectionLineDataVec* pLineData = const_cast<OTableConnectionData*>(&rConnData)->GetConnLineDataList();
+ const OConnectionLineDataVec& rLineData = rConnData.GetConnLineDataList();
- OConnectionLineDataVec::const_iterator aIter = pLineData->begin();
- OConnectionLineDataVec::const_iterator aEnd = pLineData->end();
+ OConnectionLineDataVec::const_iterator aIter = rLineData.begin();
+ OConnectionLineDataVec::const_iterator aEnd = rLineData.end();
for(;aIter != aEnd;++aIter)
m_vConnLineData.push_back(new OConnectionLineData(**aIter));
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index 0585bdb52a04..f4ed8116345f 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -95,8 +95,7 @@ namespace dbaui
sal_Int32 nCount = 0;
if(m_pTable)
{
- if(m_pTable->GetTitleCtrl())
- ++nCount;
+ ++nCount;
if(m_pTable->GetListBox())
++nCount;
}
@@ -111,14 +110,10 @@ namespace dbaui
switch(i)
{
case 0:
- if(m_pTable->GetTitleCtrl())
- {
- aRet = m_pTable->GetTitleCtrl()->GetAccessible();
- break;
- } // fall through if title control does not exist
+ aRet = m_pTable->GetTitleCtrl().GetAccessible();
+ break;
case 1:
- if(m_pTable->GetListBox())
- aRet = m_pTable->GetListBox()->GetAccessible();
+ aRet = m_pTable->GetListBox()->GetAccessible();
break;
default:
throw IndexOutOfBoundsException();
@@ -133,9 +128,9 @@ namespace dbaui
if( m_pTable )
{
// search the position of our table window in the table window map
- OJoinTableView::OTableWindowMap* pMap = m_pTable->getTableView()->GetTabWinMap();
- OJoinTableView::OTableWindowMap::iterator aIter = pMap->begin();
- OJoinTableView::OTableWindowMap::iterator aEnd = pMap->end();
+ OJoinTableView::OTableWindowMap& rMap = m_pTable->getTableView()->GetTabWinMap();
+ OJoinTableView::OTableWindowMap::iterator aIter = rMap.begin();
+ OJoinTableView::OTableWindowMap::iterator aEnd = rMap.end();
for (nIndex = 0; aIter != aEnd && aIter->second != m_pTable; ++nIndex,++aIter)
;
nIndex = aIter != aEnd ? nIndex : -1;
@@ -199,7 +194,7 @@ namespace dbaui
OJoinTableView* pView = m_pTable->getTableView();
::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable) + nIndex;
aRet.TargetSet.realloc(1);
- aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections()->begin());
+ aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections().begin());
aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR;
}
return aRet;
@@ -216,16 +211,16 @@ namespace dbaui
if( AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable)
{
OJoinTableView* pView = m_pTable->getTableView();
- const ::std::vector<OTableConnection*>* pConnectionList = pView->getTableConnections();
+ const ::std::vector<OTableConnection*>& rConnectionList = pView->getTableConnections();
::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable);
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnectionList->end();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = rConnectionList.end();
::std::vector< Reference<XInterface> > aRelations;
aRelations.reserve(5); // just guessing
for (; aIter != aEnd ; ++aIter )
{
uno::Reference<uno::XInterface> xInterface(
- getParentChild(aIter - pConnectionList->begin()));
+ getParentChild(aIter - rConnectionList.begin()));
aRelations.push_back(xInterface);
}
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index 207f2fe484e8..46e25c03c209 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -130,9 +130,9 @@ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt )
OJoinTableView* pView = static_cast<OJoinTableView*>(m_pTabWin->getTableView());
OSL_ENSURE(pView,"No OJoinTableView!");
- const ::std::vector<OTableConnection*>* pConns = pView->getTableConnections();
- ::std::for_each(pConns->begin(),
- pConns->end(),
+ const ::std::vector<OTableConnection*>& rConns = pView->getTableConnections();
+ ::std::for_each(rConns.begin(),
+ rConns.end(),
::std::mem_fun(&OTableConnection::RecalcLines));
pView->InvalidateConnections();
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
index c05f561c2515..03a9b56c8826 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
@@ -65,9 +65,9 @@ void ORelationTableConnection::Draw( const Rectangle& rRect )
long nTemp;
const OConnectionLine* pTopLine = NULL;
- const ::std::vector<OConnectionLine*>* pConnLineList = GetConnLineList();
- ::std::vector<OConnectionLine*>::const_iterator aIter = pConnLineList->begin();
- ::std::vector<OConnectionLine*>::const_iterator aEnd = pConnLineList->end();
+ const ::std::vector<OConnectionLine*>& rConnLineList = GetConnLineList();
+ ::std::vector<OConnectionLine*>::const_iterator aIter = rConnLineList.begin();
+ ::std::vector<OConnectionLine*>::const_iterator aEnd = rConnLineList.end();
for(;aIter != aEnd;++aIter)
{
if( (*aIter)->IsValid() )
diff --git a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
index 469f4e27b3d9..02a826e88dd5 100644
--- a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
@@ -87,7 +87,7 @@ bool ORelationDesignView::PreNotify( NotifyEvent& rNEvt )
void ORelationDesignView::GetFocus()
{
OJoinDesignView::GetFocus();
- if ( m_pTableView && m_pTableView->IsVisible() && !m_pTableView->GetTabWinMap()->empty() )
+ if ( m_pTableView && m_pTableView->IsVisible() && !m_pTableView->GetTabWinMap().empty() )
m_pTableView->GrabTabWinFocus();
}
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 477e9e9dbcef..e54dcc6add61 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -94,9 +94,9 @@ void ORelationTableView::ReSync()
::std::vector< OUString> arrInvalidTables;
// create and insert windows
- TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
- TTableWindowData::reverse_iterator aIter = pTabWinDataList->rbegin();
- for(;aIter != pTabWinDataList->rend();++aIter)
+ TTableWindowData& rTabWinDataList = m_pView->getController().getTableWindowData();
+ TTableWindowData::reverse_iterator aIter = rTabWinDataList.rbegin();
+ for(;aIter != rTabWinDataList.rend();++aIter)
{
TTableWindowData::value_type pData = *aIter;
OTableWindow* pTabWin = createWindow(pData);
@@ -109,11 +109,11 @@ void ORelationTableView::ReSync()
delete pTabWin;
arrInvalidTables.push_back(pData->GetTableName());
- pTabWinDataList->erase( ::std::remove(pTabWinDataList->begin(),pTabWinDataList->end(),*aIter) ,pTabWinDataList->end());
+ rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
continue;
}
- (*GetTabWinMap())[pData->GetComposedName()] = pTabWin; // insert at the beginning, as the Datalist is walked through backward
+ GetTabWinMap()[pData->GetComposedName()] = pTabWin; // insert at the beginning, as the Datalist is walked through backward
// if there's no position or size contained in the data -> Default
if (!pData->HasPosition() && !pData->HasSize())
SetDefaultTabWinPosSize(pTabWin);
@@ -122,10 +122,10 @@ void ORelationTableView::ReSync()
}
// insert connection
- TTableConnectionData* pTabConnDataList = m_pView->getController().getTableConnectionData();
- TTableConnectionData::reverse_iterator aConIter = pTabConnDataList->rbegin();
+ TTableConnectionData& rTabConnDataList = m_pView->getController().getTableConnectionData();
+ TTableConnectionData::reverse_iterator aConIter = rTabConnDataList.rbegin();
- for(;aConIter != pTabConnDataList->rend();++aConIter)
+ for(;aConIter != rTabConnDataList.rend();++aConIter)
{
ORelationTableConnectionData* pTabConnData = static_cast<ORelationTableConnectionData*>(aConIter->get());
if ( !arrInvalidTables.empty() )
@@ -139,7 +139,7 @@ void ORelationTableView::ReSync()
if (bInvalid)
{
// no -> bad luck, the connection is gone
- pTabConnDataList->erase( ::std::remove(pTabConnDataList->begin(),pTabConnDataList->end(),*aConIter),pTabConnDataList->end() );
+ rTabConnDataList.erase( ::std::remove(rTabConnDataList.begin(), rTabConnDataList.end(), *aConIter), rTabConnDataList.end() );
continue;
}
}
@@ -147,8 +147,8 @@ void ORelationTableView::ReSync()
addConnection( new ORelationTableConnection(this, *aConIter), false ); // don't add the data again
}
- if ( !GetTabWinMap()->empty() )
- GetTabWinMap()->begin()->second->GrabFocus();
+ if ( !GetTabWinMap().empty() )
+ GetTabWinMap().begin()->second->GrabFocus();
}
bool ORelationTableView::IsAddAllowed()
@@ -164,8 +164,8 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
OTableWindow* pSourceWin = jxdSource.pListBox->GetTabWin();
OTableWindow* pDestWin = jxdDest.pListBox->GetTabWin();
- ::std::vector<OTableConnection*>::const_iterator aIter = getTableConnections()->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = getTableConnections()->end();
+ ::std::vector<OTableConnection*>::const_iterator aIter = getTableConnections().begin();
+ ::std::vector<OTableConnection*>::const_iterator aEnd = getTableConnections().end();
for(;aIter != aEnd;++aIter)
{
OTableConnection* pFirst = *aIter;
@@ -277,9 +277,9 @@ bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_
void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUString& rWinName, bool /*bNewTable*/)
{
OSL_ENSURE(!_rComposedName.isEmpty(),"There must be a table name supplied!");
- OJoinTableView::OTableWindowMap::iterator aIter = GetTabWinMap()->find(_rComposedName);
+ OJoinTableView::OTableWindowMap::iterator aIter = GetTabWinMap().find(_rComposedName);
- if(aIter != GetTabWinMap()->end())
+ if(aIter != GetTabWinMap().end())
{
aIter->second->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
aIter->second->GrabFocus();
@@ -296,9 +296,9 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
OTableWindow* pNewTabWin = createWindow( pNewTabWinData );
if(pNewTabWin->Init())
{
- m_pView->getController().getTableWindowData()->push_back( pNewTabWinData);
+ m_pView->getController().getTableWindowData().push_back( pNewTabWinData);
// when we already have a table with this name insert the full qualified one instead
- (*GetTabWinMap())[_rComposedName] = pNewTabWin;
+ GetTabWinMap()[_rComposedName] = pNewTabWin;
SetDefaultTabWinPosSize( pNewTabWin );
pNewTabWin->Show();
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 4d71f7a039ea..2f0a4572377e 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -160,7 +160,7 @@ OTableEditorCtrl::OTableEditorCtrl(Window* pWindow)
SetHelpId(HID_TABDESIGN_BACKGROUND);
GetDataWindow().SetHelpId(HID_CTL_TABLEEDIT);
- m_pRowList = GetView()->getController().getRows();
+ m_pRowList = &GetView()->getController().getRows();
m_nDataPos = 0;
}
@@ -378,9 +378,9 @@ void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16
if( !pActFieldDescr )
break;
- const OTypeInfoMap* pTypeInfo = GetView()->getController().getTypeInfo();
- OTypeInfoMap::const_iterator aIter = pTypeInfo->begin();
- OTypeInfoMap::const_iterator aEnd = pTypeInfo->end();
+ const OTypeInfoMap& rTypeInfo = GetView()->getController().getTypeInfo();
+ OTypeInfoMap::const_iterator aIter = rTypeInfo.begin();
+ OTypeInfoMap::const_iterator aEnd = rTypeInfo.end();
for(;aIter != aEnd;++aIter)
pTypeCell->InsertEntry( aIter->second->aUIName );
pTypeCell->SelectEntry( aInitString );
@@ -658,12 +658,12 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId )
GetUndoManager().EnterListAction( sActionDescription, OUString() );
if (!pActFieldDescr)
{
- const OTypeInfoMap* pTypeInfoMap = GetView()->getController().getTypeInfo();
- if ( !pTypeInfoMap->empty() )
+ const OTypeInfoMap& rTypeInfoMap = GetView()->getController().getTypeInfo();
+ if ( !rTypeInfoMap.empty() )
{
- OTypeInfoMap::const_iterator aTypeIter = pTypeInfoMap->find(DataType::VARCHAR);
- if ( aTypeIter == pTypeInfoMap->end() )
- aTypeIter = pTypeInfoMap->begin();
+ OTypeInfoMap::const_iterator aTypeIter = rTypeInfoMap.find(DataType::VARCHAR);
+ if ( aTypeIter == rTypeInfoMap.end() )
+ aTypeIter = rTypeInfoMap.begin();
pActRow->SetFieldType( aTypeIter->second );
}
else
@@ -1640,9 +1640,9 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType )
)
{
sal_Int32 nEntryPos = 0;
- const OTypeInfoMap* pTypeInfo = GetView()->getController().getTypeInfo();
- OTypeInfoMap::const_iterator aIter = pTypeInfo->begin();
- OTypeInfoMap::const_iterator aEnd = pTypeInfo->end();
+ const OTypeInfoMap& rTypeInfo = GetView()->getController().getTypeInfo();
+ OTypeInfoMap::const_iterator aIter = rTypeInfo.begin();
+ OTypeInfoMap::const_iterator aEnd = rTypeInfo.end();
for(;aIter != aEnd;++aIter,++nEntryPos)
{
if(aIter->second == _pType)
diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx
index 8c6815507390..11e313bfea23 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx
@@ -124,7 +124,7 @@ TOTypeInfoSP OTableFieldControl::getTypeInfo(sal_Int32 _nPos)
const OTypeInfoMap* OTableFieldControl::getTypeInfo() const
{
- return const_cast<OTableFieldControl*>(this)->GetCtrl()->GetView()->getController().getTypeInfo();
+ return &const_cast<OTableFieldControl*>(this)->GetCtrl()->GetView()->getController().getTypeInfo();
}
Locale OTableFieldControl::GetLocale() const
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index c384ef579449..16727fff1771 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1316,7 +1316,7 @@ void SAL_CALL SvxUnoTextRangeBase::setAllPropertiesToDefault()
if( pForwarder )
{
- PropertyEntryVector_t aEntries = mpPropSet->getPropertyMap()->getPropertyEntries();
+ PropertyEntryVector_t aEntries = mpPropSet->getPropertyMap().getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aEntries.begin();
while( aIt != aEntries.end() )
{
diff --git a/extensions/source/plugin/base/evtlstnr.cxx b/extensions/source/plugin/base/evtlstnr.cxx
index 6e6a58c72348..228778b86dda 100644
--- a/extensions/source/plugin/base/evtlstnr.cxx
+++ b/extensions/source/plugin/base/evtlstnr.cxx
@@ -65,7 +65,7 @@ PluginEventListener::~PluginEventListener()
void PluginEventListener::disposing( const ::com::sun::star::lang::EventObject& /*rEvt*/ ) throw(std::exception)
{
m_pPlugin->getPluginComm()->
- NPP_URLNotify( m_pPlugin->getNPPInstance(),
+ NPP_URLNotify( &m_pPlugin->getNPPInstance(),
m_pUrl,
NPRES_DONE,
m_pNotifyData );
diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx
index 8f55228d84ed..dc0936694387 100644
--- a/extensions/source/plugin/base/manager.cxx
+++ b/extensions/source/plugin/base/manager.cxx
@@ -149,7 +149,7 @@ XPlugin_Impl* XPluginManager_Impl::getXPluginFromNPP( NPP instance )
for( iter = PluginManager::get().getPlugins().begin();
iter != PluginManager::get().getPlugins().end(); ++iter )
{
- if( (*iter)->getNPPInstance() == instance )
+ if( &(*iter)->getNPPInstance() == instance )
return *iter;
}
diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx
index aaf14bd420eb..c5d25be1f54d 100644
--- a/extensions/source/plugin/base/nfuncs.cxx
+++ b/extensions/source/plugin/base/nfuncs.cxx
@@ -306,7 +306,7 @@ extern "C" {
PluginOutputStream* pStream = new PluginOutputStream( pImpl,
"", 0, 0 );
- *stream = pStream->getStream();
+ *stream = &pStream->getStream();
try
{
@@ -443,10 +443,10 @@ extern "C" {
do
{
nNow = pPlugin->getPluginComm()->
- NPP_WriteReady( pPlugin->getNPPInstance(),
+ NPP_WriteReady( &pPlugin->getNPPInstance(),
stream );
nNow = pPlugin->getPluginComm()->
- NPP_Write( pPlugin->getNPPInstance(),
+ NPP_Write( &pPlugin->getNPPInstance(),
stream,
rangeList->offset + nPos,
nNow,
diff --git a/extensions/source/plugin/base/plcom.cxx b/extensions/source/plugin/base/plcom.cxx
index 48a6bda2beaf..c5c620624488 100644
--- a/extensions/source/plugin/base/plcom.cxx
+++ b/extensions/source/plugin/base/plcom.cxx
@@ -69,12 +69,12 @@ PluginComm::~PluginComm()
NPError PluginComm::NPP_SetWindow( XPlugin_Impl* i_pImpl )
{
- return NPP_SetWindow( i_pImpl->getNPPInstance(), i_pImpl->getNPWindow() );
+ return NPP_SetWindow( &i_pImpl->getNPPInstance(), &i_pImpl->getNPWindow() );
}
NPError PluginComm::NPP_Destroy( XPlugin_Impl* i_pImpl, NPSavedData** save )
{
- return NPP_Destroy( i_pImpl->getNPPInstance(), save );
+ return NPP_Destroy( &i_pImpl->getNPPInstance(), save );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 83a488bdfd85..d9509f013a08 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -554,7 +554,7 @@ void XPlugin_Impl::loadPlugin()
getPluginComm()->
NPP_New( (char*)OUStringToOString( m_aDescription.Mimetype,
m_aEncoding).getStr(),
- getNPPInstance(),
+ &getNPPInstance(),
m_aPluginMode == PluginMode::FULL ? NP_FULL : NP_EMBED,
::sal::static_int_cast< int16_t, int >( m_nArgs ),
(char**)(m_nArgs ? m_pArgn : NULL),
@@ -629,12 +629,12 @@ PluginStream* XPlugin_Impl::getStreamFromNPStream( NPStream* stream )
std::list<PluginInputStream*>::iterator iter;
for( iter = m_aInputStreams.begin(); iter != m_aInputStreams.end(); ++iter )
- if( (*iter)->getStream() == stream )
+ if( &(*iter)->getStream() == stream )
return *iter;
std::list<PluginOutputStream*>::iterator iter2;
for( iter2 = m_aOutputStreams.begin(); iter2 != m_aOutputStreams.end(); ++iter2 )
- if( (*iter2)->getStream() == stream )
+ if( &(*iter2)->getStream() == stream )
return *iter2;
return NULL;
@@ -741,7 +741,7 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype,
uno::Reference< com::sun::star::io::XOutputStream > xNewStream( pStream );
if( iter != m_aPEventListeners.end() )
- pStream->getStream()->notifyData = (*iter)->getNotifyData();
+ pStream->getStream().notifyData = (*iter)->getNotifyData();
uint16_t stype = 0;
@@ -761,7 +761,7 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype,
#endif
if( ! m_pPluginComm->NPP_NewStream( &m_aInstance,
(char*)aMIME.getStr(),
- pStream->getStream(), isfile,
+ &pStream->getStream(), isfile,
&stype ) )
{
#if OSL_DEBUG_LEVEL > 1
@@ -789,7 +789,7 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype,
aFileName = OUStringToOString( url, m_aEncoding );
m_pPluginComm->
NPP_StreamAsFile( &m_aInstance,
- pStream->getStream(),
+ &pStream->getStream(),
aFileName.getStr() );
}
else
@@ -937,7 +937,7 @@ PluginStream::~PluginStream()
if( m_pPlugin && m_pPlugin->getPluginComm() )
{
- m_pPlugin->getPluginComm()->NPP_DestroyStream( m_pPlugin->getNPPInstance(),
+ m_pPlugin->getPluginComm()->NPP_DestroyStream( &m_pPlugin->getNPPInstance(),
&m_aNPStream, NPRES_DONE );
m_pPlugin->checkListeners( m_aNPStream.url );
m_pPlugin->getPluginComm()->NPP_SetWindow( m_pPlugin );
@@ -1001,7 +1001,7 @@ PluginInputStream::~PluginInputStream()
if( m_nMode == NP_ASFILE )
{
m_pPlugin->getPluginComm()->
- NPP_StreamAsFile( m_pPlugin->getNPPInstance(),
+ NPP_StreamAsFile( &m_pPlugin->getNPPInstance(),
&m_aNPStream,
aFileName.getStr() );
}
@@ -1029,8 +1029,8 @@ void PluginInputStream::load()
INetURLObject aUrl;
aUrl.SetSmartProtocol( INET_PROT_FILE );
aUrl.SetSmartURL(
- OUString( getStream()->url,
- strlen( getStream()->url ),
+ OUString( getStream().url,
+ strlen( getStream().url ),
RTL_TEXTENCODING_MS_1252
) );
try
@@ -1081,7 +1081,7 @@ void PluginInputStream::writeBytes( const Sequence<sal_Int8>& Buffer ) throw(std
while( m_nMode != NP_ASFILEONLY &&
m_nWritePos < nPos &&
(nBytes = m_pPlugin->getPluginComm()-> NPP_WriteReady(
- m_pPlugin->getNPPInstance(), &m_aNPStream )) > 0 )
+ &m_pPlugin->getNPPInstance(), &m_aNPStream )) > 0 )
{
nBytes = (nBytes > nPos - m_nWritePos) ? nPos - m_nWritePos : nBytes;
@@ -1093,7 +1093,7 @@ void PluginInputStream::writeBytes( const Sequence<sal_Int8>& Buffer ) throw(std
try
{
nBytesRead = m_pPlugin->getPluginComm()->NPP_Write(
- m_pPlugin->getNPPInstance(), &m_aNPStream, m_nWritePos, nBytes, pBuffer.get() );
+ &m_pPlugin->getNPPInstance(), &m_aNPStream, m_nWritePos, nBytes, pBuffer.get() );
}
catch( ... )
{
diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx
index 6ade5f26ecbe..7aabb9201925 100644
--- a/extensions/source/plugin/inc/plugin/impl.hxx
+++ b/extensions/source/plugin/inc/plugin/impl.hxx
@@ -196,8 +196,8 @@ public:
Reference< com::sun::star::lang::XMultiServiceFactory > getServiceManager() { return m_xSMgr; }
const com::sun::star::plugin::PluginDescription& getDescription() const { return m_aDescription; }
rtl_TextEncoding getTextEncoding() { return m_aEncoding; }
- NPP getNPPInstance() { return &m_aInstance; }
- NPWindow* getNPWindow() { return &m_aNPWindow; }
+ NPP_t& getNPPInstance() { return m_aInstance; }
+ NPWindow& getNPWindow() { return m_aNPWindow; }
SysPlugData& getSysPlugData() { return *m_pSysPlugData; }
void enterPluginCallback() { m_nCalledFromPlugin++; }
@@ -336,7 +336,7 @@ public:
const char* url, sal_uInt32 len, sal_uInt32 lastmod );
virtual ~PluginStream();
- NPStream* getStream() { return &m_aNPStream; }
+ NPStream& getStream() { return m_aNPStream; }
XPlugin_Impl* getPlugin() { return m_pPlugin; }
virtual PluginStreamType getStreamType() = 0;
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 66aca51f7b92..4039e6f1384e 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -968,7 +968,7 @@ namespace pcr
public:
OMultilineFloatingEdit(Window* _pParen);
- MultiLineEdit* getEdit() { return &m_aImplEdit; }
+ MultiLineEdit& getEdit() { return m_aImplEdit; }
protected:
virtual bool PreNotify(NotifyEvent& _rNEvt) SAL_OVERRIDE;
@@ -1047,14 +1047,14 @@ namespace pcr
m_pFloatingEdit = new OMultilineFloatingEdit(this); //FloatingWindow
m_pFloatingEdit->SetPopupModeEndHdl( LINK( this, DropDownEditControl, ReturnHdl ) );
- m_pFloatingEdit->getEdit()->SetReadOnly( ( _nStyle & WB_READONLY ) != 0 );
+ m_pFloatingEdit->getEdit().SetReadOnly( ( _nStyle & WB_READONLY ) != 0 );
}
void DropDownEditControl::setControlHelper( ControlHelper& _rControlHelper )
{
DropDownEditControl_Base::setControlHelper( _rControlHelper );
- m_pFloatingEdit->getEdit()->SetModifyHdl( LINK( &_rControlHelper, ControlHelper, ModifiedHdl ) );
+ m_pFloatingEdit->getEdit().SetModifyHdl( LINK( &_rControlHelper, ControlHelper, ModifiedHdl ) );
m_pImplEdit->SetGetFocusHdl( LINK( &_rControlHelper, ControlHelper, GetFocusHdl ) );
m_pImplEdit->SetModifyHdl( LINK( &_rControlHelper, ControlHelper, ModifiedHdl ) );
m_pImplEdit->SetLoseFocusHdl( LINK( &_rControlHelper, ControlHelper, LoseFocusHdl ) );
@@ -1140,8 +1140,8 @@ namespace pcr
}
Invalidate();
ShowDropDown( true );
- m_pFloatingEdit->getEdit()->GrabFocus();
- m_pFloatingEdit->getEdit()->SetSelection( aSel );
+ m_pFloatingEdit->getEdit().GrabFocus();
+ m_pFloatingEdit->getEdit().SetSelection( aSel );
Window* pFocusWin = Application::GetFocusWindow();
pFocusWin->KeyInput( *rNEvt.GetKeyEvent() );
}
@@ -1214,11 +1214,11 @@ namespace pcr
m_pFloatingEdit->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN );
m_pFloatingEdit->Show();
- m_pFloatingEdit->getEdit()->GrabFocus();
- m_pFloatingEdit->getEdit()->SetSelection(Selection(m_pFloatingEdit->getEdit()->GetText().getLength()));
+ m_pFloatingEdit->getEdit().GrabFocus();
+ m_pFloatingEdit->getEdit().SetSelection(Selection(m_pFloatingEdit->getEdit().GetText().getLength()));
m_bDropdown = true;
if ( m_nOperationMode == eMultiLineText )
- m_pFloatingEdit->getEdit()->SetText( m_pImplEdit->GetText() );
+ m_pFloatingEdit->getEdit().SetText( m_pImplEdit->GetText() );
m_pImplEdit->SetText("");
}
else
@@ -1228,7 +1228,7 @@ namespace pcr
m_pFloatingEdit->Update();
// transfer the text from the floating edit to our own edit
- OUString sDisplayText( m_pFloatingEdit->getEdit()->GetText() );
+ OUString sDisplayText( m_pFloatingEdit->getEdit().GetText() );
if ( m_nOperationMode == eStringList )
sDisplayText = lcl_convertListToDisplayText( lcl_convertMultiLineToList( sDisplayText ) );
@@ -1244,9 +1244,9 @@ namespace pcr
long DropDownEditControl::FindPos(long nSinglePos)
{
- long nPos=0;
+ long nPos = 0;
OUString aOutput;
- OUString aStr=m_pFloatingEdit->getEdit()->GetText();
+ OUString aStr = m_pFloatingEdit->getEdit().GetText();
OUString aStr1 = GetText();
if ((nSinglePos == 0) || (nSinglePos == aStr1.getLength()))
@@ -1302,7 +1302,7 @@ namespace pcr
IMPL_LINK( DropDownEditControl, ReturnHdl, OMultilineFloatingEdit*, /*pMEd*/)
{
- OUString aStr = m_pFloatingEdit->getEdit()->GetText();
+ OUString aStr = m_pFloatingEdit->getEdit().GetText();
OUString aStr2 = GetText();
ShowDropDown(false);
@@ -1326,13 +1326,13 @@ namespace pcr
void DropDownEditControl::SetStringListValue( const StlSyntaxSequence< OUString >& _rStrings )
{
SetText( lcl_convertListToDisplayText( _rStrings ) );
- m_pFloatingEdit->getEdit()->SetText( lcl_convertListToMultiLine( _rStrings ) );
+ m_pFloatingEdit->getEdit().SetText( lcl_convertListToMultiLine( _rStrings ) );
}
StlSyntaxSequence< OUString > DropDownEditControl::GetStringListValue() const
{
- return lcl_convertMultiLineToList( m_pFloatingEdit->getEdit()->GetText() );
+ return lcl_convertMultiLineToList( m_pFloatingEdit->getEdit().GetText() );
}
@@ -1340,7 +1340,7 @@ namespace pcr
{
OSL_PRECOND( m_nOperationMode == eMultiLineText, "DropDownEditControl::SetTextValue: illegal call!" );
- m_pFloatingEdit->getEdit()->SetText( _rText );
+ m_pFloatingEdit->getEdit().SetText( _rText );
SetText( _rText );
}
diff --git a/hwpfilter/source/hpara.h b/hwpfilter/source/hpara.h
index 49c1f3008996..94bd3279ceb3 100644
--- a/hwpfilter/source/hpara.h
+++ b/hwpfilter/source/hpara.h
@@ -130,7 +130,7 @@ class DLLEXPORT HWPPara
/**
* Returns the style of paragraph.
*/
- ParaShape *GetParaShape(void) { return &pshape;}
+ ParaShape& GetParaShape(void) { return pshape;}
/**
* Returns previous paragraph.
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index d6d1a39afae1..f812f81c455f 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -222,9 +222,9 @@ class DLLEXPORT HWPFile
int GetPageMasterNum(int page);
int getCurrentPage(){ return m_nCurrentPage;}
- HWPInfo *GetHWPInfo(void) { return &_hwpInfo; }
- HWPFont *GetHWPFont(void) { return &_hwpFont; }
- HWPStyle *GetHWPStyle(void) { return &_hwpStyle; }
+ HWPInfo& GetHWPInfo(void) { return _hwpInfo; }
+ HWPFont& GetHWPFont(void) { return _hwpFont; }
+ HWPStyle& GetHWPStyle(void) { return _hwpStyle; }
HWPPara *GetFirstPara(void) { return plist.front(); }
HWPPara *GetLastPara(void) { return plist.back(); }
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 81779e0820d1..f140add0de1d 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -55,7 +55,7 @@
// xmloff/xmlkyd.hxx
#define sXML_CDATA ascii("CDATA")
-#define STARTP padd( ascii("text:style-name"), ascii("CDATA"), ascii(getPStyleName(((ParaShape *)para->GetParaShape())->index,buf))); \
+#define STARTP padd( ascii("text:style-name"), ascii("CDATA"), ascii(getPStyleName(((ParaShape &)para->GetParaShape()).index,buf))); \
rstartEl( ascii("text:p"),rList ); \
pList->clear(); \
pstart = true
@@ -239,34 +239,34 @@ void HwpReader::makeTextDecls()
*/
void HwpReader::makeMeta()
{
- HWPInfo *hwpinfo = hwpfile.GetHWPInfo();
+ HWPInfo& hwpinfo = hwpfile.GetHWPInfo();
rstartEl(ascii("office:meta"), rList);
- if (hwpinfo->summary.title[0])
+ if (hwpinfo.summary.title[0])
{
rstartEl(ascii("dc:title"), rList);
- rchars((hconv(hwpinfo->summary.title)));
+ rchars((hconv(hwpinfo.summary.title)));
rendEl(ascii("dc:title"));
}
- if (hwpinfo->summary.subject[0])
+ if (hwpinfo.summary.subject[0])
{
rstartEl(ascii("dc:subject"), rList);
- rchars((hconv(hwpinfo->summary.subject)));
+ rchars((hconv(hwpinfo.summary.subject)));
rendEl(ascii("dc:subject"));
}
- if (hwpinfo->summary.author[0])
+ if (hwpinfo.summary.author[0])
{
rstartEl(ascii("meta:initial-creator"), rList);
- rchars((hconv(hwpinfo->summary.author)));
+ rchars((hconv(hwpinfo.summary.author)));
rendEl(ascii("meta:initial-creator"));
}
- if (hwpinfo->summary.date[0])
+ if (hwpinfo.summary.date[0])
{
- unsigned short *pDate = hwpinfo->summary.date;
+ unsigned short *pDate = hwpinfo.summary.date;
int year,month,day,hour,minute;
int gab = 0;
if( ISNUMBER( pDate[0] ) && ISNUMBER( pDate[1] ) &&
@@ -328,37 +328,37 @@ void HwpReader::makeMeta()
rendEl( ascii("meta:creation-date") );
}
- if (hwpinfo->summary.keyword[0][0] || hwpinfo->summary.etc[0][0])
+ if (hwpinfo.summary.keyword[0][0] || hwpinfo.summary.etc[0][0])
{
rstartEl(ascii("meta:keywords"), rList);
- if (hwpinfo->summary.keyword[0][0])
+ if (hwpinfo.summary.keyword[0][0])
{
rstartEl(ascii("meta:keyword"), rList);
- rchars((hconv(hwpinfo->summary.keyword[0])));
+ rchars((hconv(hwpinfo.summary.keyword[0])));
rendEl(ascii("meta:keyword"));
}
- if (hwpinfo->summary.keyword[1][0])
+ if (hwpinfo.summary.keyword[1][0])
{
rstartEl(ascii("meta:keyword"), rList);
- rchars((hconv(hwpinfo->summary.keyword[1])));
+ rchars((hconv(hwpinfo.summary.keyword[1])));
rendEl(ascii("meta:keyword"));
}
- if (hwpinfo->summary.etc[0][0])
+ if (hwpinfo.summary.etc[0][0])
{
rstartEl(ascii("meta:keyword"), rList);
- rchars((hconv(hwpinfo->summary.etc[0])));
+ rchars((hconv(hwpinfo.summary.etc[0])));
rendEl(ascii("meta:keyword"));
}
- if (hwpinfo->summary.etc[1][0])
+ if (hwpinfo.summary.etc[1][0])
{
rstartEl(ascii("meta:keyword"), rList);
- rchars((hconv(hwpinfo->summary.etc[1])));
+ rchars((hconv(hwpinfo.summary.etc[1])));
rendEl(ascii("meta:keyword"));
}
- if (hwpinfo->summary.etc[2][0])
+ if (hwpinfo.summary.etc[2][0])
{
rstartEl(ascii("meta:keyword"), rList);
- rchars((hconv(hwpinfo->summary.etc[2])));
+ rchars((hconv(hwpinfo.summary.etc[2])));
rendEl(ascii("meta:keyword"));
}
rendEl(ascii("meta:keywords"));
@@ -579,14 +579,14 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
padd( ascii("draw:cx"), sXML_CDATA,ascii(Int2Str(prop->center_x, "%d%%", buf)));
padd( ascii("draw:cy"), sXML_CDATA,ascii(Int2Str(prop->center_y, "%d%%", buf)));
- HWPInfo *hwpinfo = hwpfile.GetHWPInfo();
+ HWPInfo& hwpinfo = hwpfile.GetHWPInfo();
int default_color = 0xffffff;
- if( hwpinfo->back_info.isset )
+ if( hwpinfo.back_info.isset )
{
- if( hwpinfo->back_info.color[0] > 0 || hwpinfo->back_info.color[1] > 0
- || hwpinfo->back_info.color[2] > 0 )
- default_color = hwpinfo->back_info.color[0] << 16 |
- hwpinfo->back_info.color[1] << 8 | hwpinfo->back_info.color[2];
+ if( hwpinfo.back_info.color[0] > 0 || hwpinfo.back_info.color[1] > 0
+ || hwpinfo.back_info.color[2] > 0 )
+ default_color = hwpinfo.back_info.color[0] << 16 |
+ hwpinfo.back_info.color[1] << 8 | hwpinfo.back_info.color[2];
}
if( prop->fromcolor > 0xffffff )
@@ -681,7 +681,7 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
void HwpReader::makeStyles()
{
- HWPStyle *hwpstyle = hwpfile.GetHWPStyle();
+ HWPStyle& hwpstyle = hwpfile.GetHWPStyle();
rstartEl(ascii("office:styles"), rList);
@@ -719,9 +719,9 @@ void HwpReader::makeStyles()
rendEl(ascii("style:style"));
- for (int ii = 0; ii < hwpstyle->Num(); ii++)
+ for (int ii = 0; ii < hwpstyle.Num(); ii++)
{
- unsigned char *stylename = (unsigned char *) hwpstyle->GetName(ii);
+ unsigned char *stylename = (unsigned char *) hwpstyle.GetName(ii);
padd(ascii("style:name"), sXML_CDATA, (hconv(kstr2hstr(stylename).c_str())));
padd(ascii("style:family"), sXML_CDATA, ascii("paragraph"));
padd(ascii("style:parent-style-name"), sXML_CDATA, ascii("Standard"));
@@ -730,8 +730,8 @@ void HwpReader::makeStyles()
pList->clear();
- parseCharShape(hwpstyle->GetCharShape(ii));
- parseParaShape(hwpstyle->GetParaShape(ii));
+ parseCharShape(hwpstyle.GetCharShape(ii));
+ parseParaShape(hwpstyle.GetParaShape(ii));
rstartEl(ascii("style:properties"), rList);
pList->clear();
@@ -784,12 +784,12 @@ void HwpReader::makeStyles()
rendEl( ascii("style:style"));
}
- HWPInfo *hwpinfo = hwpfile.GetHWPInfo();
+ HWPInfo& hwpinfo = hwpfile.GetHWPInfo();
padd(ascii("text:num-suffix"), sXML_CDATA, ascii(")"));
padd(ascii("text:num-format"), sXML_CDATA, ascii("1"));
- if( hwpinfo->beginfnnum != 1)
- padd(ascii("text:offset"), sXML_CDATA, ascii(Int2Str(hwpinfo->beginfnnum -1, "%d", buf)));
+ if( hwpinfo.beginfnnum != 1)
+ padd(ascii("text:offset"), sXML_CDATA, ascii(Int2Str(hwpinfo.beginfnnum -1, "%d", buf)));
rstartEl(ascii("text:footnotes-configuration"), rList);
pList->clear();
rendEl(ascii("text:footnotes-configuration"));
@@ -1313,7 +1313,7 @@ void HwpReader::makeMasterStyles()
*/
void HwpReader::parseCharShape(CharShape * cshape)
{
- HWPFont *hwpfont = hwpfile.GetHWPFont();
+ HWPFont& hwpfont = hwpfile.GetHWPFont();
padd(ascii("fo:font-size"), sXML_CDATA,
ascii(Int2Str(cshape->size / 25, "%dpt", buf)));
@@ -1321,7 +1321,7 @@ void HwpReader::parseCharShape(CharShape * cshape)
ascii(Int2Str(cshape->size / 25, "%dpt", buf)));
::std::string const tmp = hstr2ksstr(kstr2hstr(
- (unsigned char *) hwpfont->GetFontName(0, cshape->font[0])).c_str());
+ (unsigned char *) hwpfont.GetFontName(0, cshape->font[0])).c_str());
double fRatio = 1.0;
int size = getRepFamilyName(tmp.c_str(), buf, fRatio);
@@ -1526,7 +1526,7 @@ void HwpReader::makePStyle(ParaShape * pshape)
*/
void HwpReader::makePageStyle()
{
- HWPInfo *hwpinfo = hwpfile.GetHWPInfo();
+ HWPInfo& hwpinfo = hwpfile.GetHWPInfo();
int pmCount = hwpfile.getColumnCount();
for( int i = 0 ; i < pmCount ; i++ ){
@@ -1535,10 +1535,10 @@ void HwpReader::makePageStyle()
pList->clear();
- switch( hwpinfo->paper.paper_kind )
+ switch( hwpinfo.paper.paper_kind )
{
case 3: // A4
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-height"),sXML_CDATA, ascii("210mm"));
padd(ascii("fo:page-width"),sXML_CDATA, ascii("297mm"));
@@ -1550,7 +1550,7 @@ void HwpReader::makePageStyle()
}
break;
case 4: // 80 column
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-height"),sXML_CDATA, ascii("8.5inch"));
padd(ascii("fo:page-width"),sXML_CDATA, ascii("11inch"));
@@ -1562,7 +1562,7 @@ void HwpReader::makePageStyle()
}
break;
case 5: // B5
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-height"),sXML_CDATA, ascii("176mm"));
padd(ascii("fo:page-width"),sXML_CDATA, ascii("250mm"));
@@ -1574,7 +1574,7 @@ void HwpReader::makePageStyle()
}
break;
case 6: // B4
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-height"),sXML_CDATA, ascii("250mm"));
padd(ascii("fo:page-width"),sXML_CDATA, ascii("353mm"));
@@ -1586,7 +1586,7 @@ void HwpReader::makePageStyle()
}
break;
case 7:
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-height"),sXML_CDATA, ascii("8.5inch"));
padd(ascii("fo:page-width"),sXML_CDATA, ascii("14inch"));
@@ -1598,7 +1598,7 @@ void HwpReader::makePageStyle()
}
break;
case 8:
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-height"),sXML_CDATA, ascii("297mm"));
padd(ascii("fo:page-width"),sXML_CDATA, ascii("420mm"));
@@ -1613,52 +1613,52 @@ void HwpReader::makePageStyle()
case 1:
case 2:
default:
- if( hwpinfo->paper.paper_direction )
+ if( hwpinfo.paper.paper_direction )
{
padd(ascii("fo:page-width"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.paper_height)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.paper_height)) + ascii("inch"));
padd(ascii("fo:page-height"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.paper_width)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.paper_width)) + ascii("inch"));
}
else
{
padd(ascii("fo:page-width"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.paper_width)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.paper_width)) + ascii("inch"));
padd(ascii("fo:page-height"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.paper_height)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.paper_height)) + ascii("inch"));
}
break;
}
padd(ascii("style:print-orientation"),sXML_CDATA,
- ascii(hwpinfo->paper.paper_direction ? "landscape" : "portrait"));
- if( hwpinfo->beginpagenum != 1)
+ ascii(hwpinfo.paper.paper_direction ? "landscape" : "portrait"));
+ if( hwpinfo.beginpagenum != 1)
padd(ascii("style:first-page-number"),sXML_CDATA,
- ascii(Int2Str(hwpinfo->beginpagenum, "%d", buf)));
+ ascii(Int2Str(hwpinfo.beginpagenum, "%d", buf)));
- if( hwpinfo->borderline ){
+ if( hwpinfo.borderline ){
padd(ascii("fo:margin-left"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.left_margin - hwpinfo->bordermargin[0] + hwpinfo->paper.gutter_length)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.left_margin - hwpinfo.bordermargin[0] + hwpinfo.paper.gutter_length)) + ascii("inch"));
padd(ascii("fo:margin-right"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.right_margin - hwpinfo->bordermargin[1])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.right_margin - hwpinfo.bordermargin[1])) + ascii("inch"));
padd(ascii("fo:margin-top"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.top_margin - hwpinfo->bordermargin[2])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.top_margin - hwpinfo.bordermargin[2])) + ascii("inch"));
padd(ascii("fo:margin-bottom"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.bottom_margin - hwpinfo->bordermargin[3])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.bottom_margin - hwpinfo.bordermargin[3])) + ascii("inch"));
}
else{
padd(ascii("fo:margin-left"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.left_margin + hwpinfo->paper.gutter_length)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.left_margin + hwpinfo.paper.gutter_length)) + ascii("inch"));
padd(ascii("fo:margin-right"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.right_margin)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.right_margin)) + ascii("inch"));
padd(ascii("fo:margin-top"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.top_margin)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.top_margin)) + ascii("inch"));
padd(ascii("fo:margin-bottom"),sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.bottom_margin)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.bottom_margin)) + ascii("inch"));
}
- switch( hwpinfo->borderline )
+ switch( hwpinfo.borderline )
{
case 1:
padd(ascii("fo:border"), sXML_CDATA,ascii("0.002cm solid #000000"));
@@ -1676,21 +1676,21 @@ void HwpReader::makePageStyle()
}
padd(ascii("fo:padding-left"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->bordermargin[0])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.bordermargin[0])) + ascii("inch"));
padd(ascii("fo:padding-right"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->bordermargin[1])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.bordermargin[1])) + ascii("inch"));
padd(ascii("fo:padding-top"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->bordermargin[2])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.bordermargin[2])) + ascii("inch"));
padd(ascii("fo:padding-bottom"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->bordermargin[3])) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.bordermargin[3])) + ascii("inch"));
/* background color */
- if( hwpinfo->back_info.isset )
+ if( hwpinfo.back_info.isset )
{
- if( hwpinfo->back_info.color[0] > 0 || hwpinfo->back_info.color[1] > 0
- || hwpinfo->back_info.color[2] > 0 ){
- sprintf(buf,"#%02x%02x%02x",hwpinfo->back_info.color[0],
- hwpinfo->back_info.color[1],hwpinfo->back_info.color[2] );
+ if( hwpinfo.back_info.color[0] > 0 || hwpinfo.back_info.color[1] > 0
+ || hwpinfo.back_info.color[2] > 0 ){
+ sprintf(buf,"#%02x%02x%02x",hwpinfo.back_info.color[0],
+ hwpinfo.back_info.color[1],hwpinfo.back_info.color[2] );
padd(ascii("fo:background-color"), sXML_CDATA, ascii(buf));
}
}
@@ -1699,31 +1699,31 @@ void HwpReader::makePageStyle()
pList->clear();
/* background image */
- if( hwpinfo->back_info.isset && hwpinfo->back_info.type > 0 )
+ if( hwpinfo.back_info.isset && hwpinfo.back_info.type > 0 )
{
- if( hwpinfo->back_info.type == 1 ){
+ if( hwpinfo.back_info.type == 1 ){
#ifdef _WIN32
padd(ascii("xlink:href"), sXML_CDATA,
- hconv(kstr2hstr((uchar*) urltowin(hwpinfo->back_info.filename).c_str()).c_str()));
+ hconv(kstr2hstr((uchar*) urltowin(hwpinfo.back_info.filename).c_str()).c_str()));
#else
padd(ascii("xlink:href"), sXML_CDATA,
- hconv(kstr2hstr( (uchar *)urltounix(hwpinfo->back_info.filename).c_str()).c_str()));
+ hconv(kstr2hstr( (uchar *)urltounix(hwpinfo.back_info.filename).c_str()).c_str()));
#endif
padd(ascii("xlink:type"), sXML_CDATA, ascii("simple"));
padd(ascii("xlink:actuate"), sXML_CDATA, ascii("onLoad"));
}
- if( hwpinfo->back_info.flag >= 2)
+ if( hwpinfo.back_info.flag >= 2)
padd(ascii("style:repeat"), sXML_CDATA, ascii("stretch"));
- else if( hwpinfo->back_info.flag == 1 ){
+ else if( hwpinfo.back_info.flag == 1 ){
padd(ascii("style:repeat"), sXML_CDATA, ascii("no-repeat"));
padd(ascii("style:position"), sXML_CDATA, ascii("center"));
}
rstartEl(ascii("style:background-image"),rList);
- if( hwpinfo->back_info.type == 2 ){
+ if( hwpinfo.back_info.type == 2 ){
rstartEl(ascii("office:binary-data"), rList);
pList->clear();
- boost::shared_ptr<char> pStr(base64_encode_string((unsigned char *) hwpinfo->back_info.data, hwpinfo->back_info.size ), Free<char>());
+ boost::shared_ptr<char> pStr(base64_encode_string((unsigned char *) hwpinfo.back_info.data, hwpinfo.back_info.size ), Free<char>());
rchars(ascii(pStr.get()));
rendEl(ascii("office:binary-data"));
}
@@ -1737,7 +1737,7 @@ void HwpReader::makePageStyle()
/* header style */
rstartEl(ascii("style:header-style"), rList);
padd(ascii("svg:height"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.header_length)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.header_length)) + ascii("inch"));
padd(ascii("fo:margin-bottom"), sXML_CDATA, ascii("0mm"));
rstartEl(ascii("style:properties"),rList);
@@ -1748,7 +1748,7 @@ void HwpReader::makePageStyle()
/* footer style */
rstartEl(ascii("style:footer-style"), rList);
padd(ascii("svg:height"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->paper.footer_length)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.paper.footer_length)) + ascii("inch"));
padd(ascii("fo:margin-top"), sXML_CDATA, ascii("0mm"));
rstartEl(ascii("style:properties"),rList);
pList->clear();
@@ -1759,17 +1759,17 @@ void HwpReader::makePageStyle()
rstartEl(ascii("style:footnote-layout"), rList);
padd(ascii("style:distance-before-sep"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->splinetext)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.splinetext)) + ascii("inch"));
padd(ascii("style:distance-after-sep"), sXML_CDATA,
- Double2Str(WTI(hwpinfo->splinefn)) + ascii("inch"));
+ Double2Str(WTI(hwpinfo.splinefn)) + ascii("inch"));
rstartEl(ascii("style:properties"),rList);
pList->clear();
rendEl(ascii("style:properties"));
- if ( hwpinfo->fnlinetype == 2 )
+ if ( hwpinfo.fnlinetype == 2 )
padd(ascii("style:width"), sXML_CDATA, ascii("15cm"));
- else if ( hwpinfo->fnlinetype == 1)
+ else if ( hwpinfo.fnlinetype == 1)
padd(ascii("style:width"), sXML_CDATA, ascii("2cm"));
- else if ( hwpinfo->fnlinetype == 3)
+ else if ( hwpinfo.fnlinetype == 3)
padd(ascii("style:width"), sXML_CDATA, ascii("0cm"));
else
padd(ascii("style:width"), sXML_CDATA, ascii("5cm"));
@@ -2698,7 +2698,7 @@ void HwpReader::make_text_p0(HWPPara * para, bool bParaStart)
if( !bParaStart)
{
padd(ascii("text:style-name"), sXML_CDATA,
- ascii(getPStyleName(para->GetParaShape()->index, buf)));
+ ascii(getPStyleName(para->GetParaShape().index, buf)));
rstartEl(ascii("text:p"), rList);
pList->clear();
}
@@ -2768,7 +2768,7 @@ void HwpReader::make_text_p1(HWPPara * para,bool bParaStart)
if( !bParaStart )
{
padd(ascii("text:style-name"), sXML_CDATA,
- ascii(getPStyleName(para->GetParaShape()->index, buf)));
+ ascii(getPStyleName(para->GetParaShape().index, buf)));
rstartEl(ascii("text:p"), rList);
pList->clear();
}
@@ -3980,12 +3980,12 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox)
case PAGE_ANCHOR:
case PAPER_ANCHOR:
{
- HWPInfo *hwpinfo = hwpfile.GetHWPInfo();
+ HWPInfo& hwpinfo = hwpfile.GetHWPInfo();
padd(ascii("text:anchor-type"), sXML_CDATA, ascii("page"));
padd(ascii("text:anchor-page-number"), sXML_CDATA,
ascii(Int2Str(hbox->pgno +1, "%d", buf)));
- a = hwpinfo->paper.left_margin;
- b = hwpinfo->paper.top_margin + hwpinfo->paper.header_length;
+ a = hwpinfo.paper.left_margin;
+ b = hwpinfo.paper.top_margin + hwpinfo.paper.header_length;
break;
}
}
@@ -4782,7 +4782,7 @@ void HwpReader::parsePara(HWPPara * para, bool bParaStart)
if( !bParaStart )
{
padd(ascii("text:style-name"), sXML_CDATA,
- ascii(getPStyleName(para->GetParaShape()->index, buf)));
+ ascii(getPStyleName(para->GetParaShape().index, buf)));
rstartEl( ascii("text:p"),rList);
pList->clear();
}
diff --git a/idlc/inc/idlc/idlc.hxx b/idlc/inc/idlc/idlc.hxx
index 551fe3408947..22d43c8569dd 100644
--- a/idlc/inc/idlc/idlc.hxx
+++ b/idlc/inc/idlc/idlc.hxx
@@ -114,8 +114,8 @@ public:
void addInclude(const OString& inc)
{ m_includes.insert(inc); }
- StringSet* getIncludes()
- { return &m_includes; }
+ StringSet& getIncludes()
+ { return m_includes; }
void setPublished(bool published) { m_published = published; }
bool isPublished() const { return m_published; }
diff --git a/include/basic/sbxvar.hxx b/include/basic/sbxvar.hxx
index 1c84f11ba805..2ae113073f3e 100644
--- a/include/basic/sbxvar.hxx
+++ b/include/basic/sbxvar.hxx
@@ -144,7 +144,7 @@ public:
const SbxValues& GetValues_Impl() const { return aData; }
virtual bool Put( const SbxValues& );
- inline SbxValues * data() { return &aData; }
+ inline SbxValues& data() { return aData; }
sal_Unicode GetChar() const;
sal_Int16 GetInteger() const;
diff --git a/include/codemaker/exceptiontree.hxx b/include/codemaker/exceptiontree.hxx
index ab395c68be17..2e4795c5f020 100644
--- a/include/codemaker/exceptiontree.hxx
+++ b/include/codemaker/exceptiontree.hxx
@@ -100,11 +100,11 @@ public:
/**
Gives access to the resultant exception hierarchy.
- @return a non-null pointer to the root of the exception hierarchy, as
+ @return a reference to the root of the exception hierarchy, as
formed by all previous calls to add; it is an error if any calls to add
follow the first call to getRoot
*/
- ExceptionTreeNode const * getRoot() const { return &m_root; }
+ ExceptionTreeNode const & getRoot() const { return m_root; }
private:
ExceptionTree(ExceptionTree &); // not implemented
diff --git a/include/comphelper/propertysetinfo.hxx b/include/comphelper/propertysetinfo.hxx
index 4676875d83a8..8b89fc3c42c8 100644
--- a/include/comphelper/propertysetinfo.hxx
+++ b/include/comphelper/propertysetinfo.hxx
@@ -65,7 +65,7 @@ public:
/** returns a stl map with all PropertyMapEntry pointer.<p>
The key is the property name.
*/
- const PropertyMap* getPropertyMap() const throw();
+ const PropertyMap& getPropertyMap() const throw();
/** adds an array of PropertyMapEntry to this instance.<p>
The end is marked with a PropertyMapEntry where mpName equals NULL</p>
diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx
index 01b8c0e2ca80..ffaa38c4a5fb 100644
--- a/include/editeng/unoipset.hxx
+++ b/include/editeng/unoipset.hxx
@@ -61,7 +61,7 @@ public:
com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;}
- const SfxItemPropertyMap* getPropertyMap()const { return &m_aPropertyMap;}
+ const SfxItemPropertyMap& getPropertyMap()const { return m_aPropertyMap;}
const SfxItemPropertySimpleEntry* getPropertyMapEntry(const OUString &rName) const;
static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > getPropertySetInfo( const SfxItemPropertyMapEntry* pMap );
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 53d78124c30a..d9335fa8c197 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -72,7 +72,7 @@ public:
sal_uInt16 GetRowPos(sal_uInt16 _nPos) const;
sal_uInt16 GetColumnPos(sal_uInt16 _nPos) const;
- ScrollBar* getScrollBar() { return &aVscrollSB;}
+ ScrollBar& getScrollBar() { return aVscrollSB;}
void ReleaseAccessible();
sal_Int32 getMaxCharCount() const;
diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx
index 50d564c177fa..1419dda33e2f 100644
--- a/include/vcl/openglwin.hxx
+++ b/include/vcl/openglwin.hxx
@@ -37,7 +37,7 @@ class VCLOPENGL_DLLPUBLIC OpenGLWindow : public Window
public:
OpenGLWindow(Window* pParent);
virtual ~OpenGLWindow();
- OpenGLContext* getContext();
+ OpenGLContext& getContext();
void setRenderer(IRenderer* pRenderer);
diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx
index c2ec1235134a..39943c470c86 100644
--- a/lotuswordpro/source/filter/benlist.cxx
+++ b/lotuswordpro/source/filter/benlist.cxx
@@ -61,8 +61,8 @@ pCBenNamedObject
FindNamedObject(pCUtList pList, const char * sName,
pCBenNamedObjectListElmt * ppPrev)
{
- pCUtListElmt pTerminating = pList->GetTerminating();
- for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating;
+ CUtListElmt& rTerminating = pList->GetTerminating();
+ for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating;
pCurr = pCurr->GetPrev())
{
pCBenNamedObjectListElmt pCurrNamedObjectListElmt =
@@ -84,7 +84,7 @@ FindNamedObject(pCUtList pList, const char * sName,
}
if (ppPrev != NULL)
- *ppPrev = (pCBenNamedObjectListElmt) pTerminating;
+ *ppPrev = (pCBenNamedObjectListElmt) &rTerminating;
return NULL;
}
@@ -92,8 +92,8 @@ FindNamedObject(pCUtList pList, const char * sName,
pCBenIDListElmt
FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev)
{
- pCUtListElmt pTerminating = pList->GetTerminating();
- for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating;
+ CUtListElmt& rTerminating = pList->GetTerminating();
+ for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating;
pCurr = pCurr->GetPrev())
{
pCBenIDListElmt pCurrIDListElmt = (pCBenIDListElmt) pCurr;
@@ -111,7 +111,7 @@ FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev)
}
if (ppPrev != NULL)
- *ppPrev = (pCBenIDListElmt) pTerminating;
+ *ppPrev = (pCBenIDListElmt) &rTerminating;
return NULL;
}
} //end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/benobj.cxx b/lotuswordpro/source/filter/benobj.cxx
index 4193a6f7f851..f9efc9056358 100644
--- a/lotuswordpro/source/filter/benobj.cxx
+++ b/lotuswordpro/source/filter/benobj.cxx
@@ -76,7 +76,7 @@ CBenObject::UseValue(BenObjectID PropertyID)
pCBenProperty pProperty = UseProperty(PropertyID);
if (pProperty == NULL)
return NULL;
- return pProperty->UseValue();
+ return &pProperty->UseValue();
}
}// end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
index 1940e16d7a10..677533105fb8 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -225,8 +225,8 @@ public: // Internal methods
BenObjectID GetNextAvailObjectID() { return cNextAvailObjectID; }
void SetNextAvailObjectID(BenObjectID ID) { cNextAvailObjectID = ID; }
- pCUtList GetObjects() { return &cObjects; }
- pCUtList GetNamedObjects() { return &cNamedObjects; }
+ CUtList& GetObjects() { return cObjects; }
+ CUtList& GetNamedObjects() { return cNamedObjects; }
LtcUtBenValueStream * FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream);
LtcUtBenValueStream * FindValueStreamWithPropertyName(const char * sPropertyName);
@@ -257,7 +257,7 @@ public: // Internal methods
CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCBenIDListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev)
{ cpContainer = pContainer; }
- pCUtList GetProperties() { return &cProperties; }
+ CUtList& GetProperties() { return cProperties; }
private: // Data
pLtcBenContainer cpContainer;
@@ -296,7 +296,7 @@ public: // Internal methods
inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment
pCurrValueSegment);
inline pLtcBenContainer GetContainer();
- pCUtList GetValueSegments() { return &cValueSegments; }
+ CUtList& GetValueSegments() { return cValueSegments; }
// Currently, no generation support
BenGeneration GetGeneration() { return 1; }
@@ -313,7 +313,7 @@ public:
// different type. But we never use it that way, so in this code a
// property has exactly one value
- pCBenValue UseValue() { return &cValue; }
+ CBenValue& UseValue() { return cValue; }
pCBenObject GetBenObject() { return cpObject; }
pLtcBenContainer GetContainer() { return GetBenObject()->GetContainer(); }
@@ -351,11 +351,11 @@ class CBenValueSegment : public CUtListElmt
{
public: // Internal methods
CBenValueSegment(pCBenValue pValue, BenContainerPos Pos,
- unsigned long Size) : CUtListElmt(pValue->GetValueSegments())
+ unsigned long Size) : CUtListElmt(&pValue->GetValueSegments())
{ cpValue = pValue; cImmediate = false; cPos = Pos;
cSize = Size; }
CBenValueSegment(pCBenValue pValue, BenConstDataPtr pImmData,
- unsigned short Size) : CUtListElmt(pValue->GetValueSegments())
+ unsigned short Size) : CUtListElmt(&pValue->GetValueSegments())
{ cpValue = pValue; cImmediate = true;
UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
CBenValueSegment(BenContainerPos Pos, unsigned long Size)
@@ -366,7 +366,7 @@ public: // Internal methods
UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
bool IsLast()
{
- return cpValue == NULL || cpValue->GetValueSegments()->GetLast() ==
+ return cpValue == NULL || cpValue->GetValueSegments().GetLast() ==
this;
}
bool IsImmediate() { return cImmediate; }
@@ -411,7 +411,7 @@ public: // Internal methods
void SetPosition(BenContainerPos Pos) { cPos = Pos; }
BenContainerPos GetPosition(void) { return cPos; }
size_t GetLength(void) { return csName.length()+ 1; }
- pCBenNamedObjectListElmt GetNameListElmt() { return &cNameListElmt; }
+ CBenNamedObjectListElmt& GetNameListElmt() { return cNameListElmt; }
private: // Data
std::string csName;
diff --git a/lotuswordpro/source/filter/lwp9reader.cxx b/lotuswordpro/source/filter/lwp9reader.cxx
index fe77bd2b078d..d83b84178127 100644
--- a/lotuswordpro/source/filter/lwp9reader.cxx
+++ b/lotuswordpro/source/filter/lwp9reader.cxx
@@ -180,13 +180,13 @@ void Lwp9Reader::ParseDocument()
WriteDocHeader();
//Get root document
- LwpDocument* doc = dynamic_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID()->obj().get() );
+ LwpDocument* doc = dynamic_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID().obj().get() );
if (!doc)
return;
//Parse Doc Data
- LwpDocData *pDocData = dynamic_cast<LwpDocData*>((doc->GetDocData())->obj().get());
+ LwpDocData *pDocData = dynamic_cast<LwpDocData*>(doc->GetDocData().obj().get());
if (pDocData!=NULL)
pDocData->Parse(m_pStream);
diff --git a/lotuswordpro/source/filter/lwpbackgroundoverride.hxx b/lotuswordpro/source/filter/lwpbackgroundoverride.hxx
index afd3e89c606e..1bbebfa1f907 100644
--- a/lotuswordpro/source/filter/lwpbackgroundoverride.hxx
+++ b/lotuswordpro/source/filter/lwpbackgroundoverride.hxx
@@ -83,7 +83,7 @@ public:
}
LwpColor GetBackColor(){ return m_aStuff.m_aFillColor; }
- LwpBackgroundStuff* GetBGStuff() { return &m_aStuff; }
+ LwpBackgroundStuff& GetBGStuff() { return m_aStuff; }
protected:
LwpBackgroundOverride(LwpBackgroundOverride const& rOther);
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
index f8f6225772a1..992a16dd1f8b 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
@@ -155,8 +155,8 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid
m_vIDsPairList.push_back(std::make_pair(pBulletOver, aIndentID));
OUString aStyleName;
- LwpFribPtr* pBulletParaFribs = pBulletPara->GetFribs();
- bool bIsNumbering = (pBulletParaFribs->HasFrib(FRIB_TAG_PARANUMBER) != 0);
+ LwpFribPtr& rBulletParaFribs = pBulletPara->GetFribs();
+ bool bIsNumbering = (rBulletParaFribs.HasFrib(FRIB_TAG_PARANUMBER) != 0);
enumXFAlignType eAlign = enumXFAlignStart;
if (pBullOver->IsRightAligned())
diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx
index 85df93ec26ed..6510ccb5660b 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -91,7 +91,7 @@ LwpCellLayout::~LwpCellLayout()
*/
LwpTableLayout * LwpCellLayout::GetTableLayout()
{
- LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent()->obj().get());
+ LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent().obj().get());
if(!pRow)
{
return NULL;
@@ -272,7 +272,7 @@ void LwpCellLayout::ApplyFmtStyle(XFCellStyle *pCellStyle)
LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(m_BasedOnStyle.obj().get());
if (pCellLayout)
{
- pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject()->obj().get());
+ pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject().obj().get());
}
}
@@ -325,7 +325,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI
// if cell layout is aTableID's default cell layout
// we should judt its style by current position
- if (*pTable->GetDefaultCellStyle() == *GetObjectID())
+ if (pTable->GetDefaultCellStyle() == GetObjectID())
{
aStyleName = GetCellStyleName(nRow, nCol, pTable->GetTableLayout());
}
@@ -348,7 +348,7 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory()
if (pPreStoryID && !(pPreStoryID->IsNull()))
{
LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY).get());
- return dynamic_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA).get());
+ return dynamic_cast<LwpPara*>(pPreStory->GetLastPara().obj(VO_PARA).get());
}
else
{
@@ -433,8 +433,8 @@ LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 n
{
return enumWholeBorder;
}
- XFBorder *pLeftBorder = pBorders->GetLeft();
- XFBorder *pBottomBorder = pBorders->GetBottom();
+ XFBorder& rLeftBorder = pBorders->GetLeft();
+ XFBorder& rBottomBorder = pBorders->GetBottom();
bool bNoLeftBorder = false;
bool bNoBottomBorder = false;
@@ -444,8 +444,8 @@ LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 n
XFBorders * pNeighbourBorders = pLeftNeighbour->GetXFBorders();
if (pNeighbourBorders)
{
- XFBorder * pRightBorder = pNeighbourBorders->GetRight();
- if (*pLeftBorder == *pRightBorder)
+ XFBorder& rRightBorder = pNeighbourBorders->GetRight();
+ if (rLeftBorder == rRightBorder)
{
// for these 2 types cell, left border should be ignored for sake of avoiding duplication border
// but if left border is different with right border of left cell
@@ -463,8 +463,8 @@ LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 n
XFBorders * pBelowBorders = pBelowNeighbour->GetXFBorders();
if (pBelowBorders)
{
- XFBorder * pTopBorder = pBelowBorders->GetTop();
- if (*pTopBorder == *pBottomBorder)
+ XFBorder& rTopBorder = pBelowBorders->GetTop();
+ if (rTopBorder == rBottomBorder)
{
// for these 2 types cell, bottom border should be ignored for sake of avoiding duplication border
// but if bottom border is different with right border of left cell
@@ -571,7 +571,7 @@ void LwpCellLayout::RegisterDefaultCell()
*/
void LwpCellLayout::RegisterStyle()
{
- LwpVirtualLayout * pParent = dynamic_cast<LwpVirtualLayout *>(GetParent()->obj().get());
+ LwpVirtualLayout * pParent = dynamic_cast<LwpVirtualLayout *>(GetParent().obj().get());
if (!pParent || pParent->GetLayoutType() != LWP_ROW_LAYOUT)
{
// default cell layout, we must register 4 styles for it
@@ -730,8 +730,8 @@ LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal
{
return enumWholeBorder;
}
- XFBorder *pLeftBorder = pBorders->GetLeft();
- XFBorder *pBottomBorder = pBorders->GetBottom();
+ XFBorder& rLeftBorder = pBorders->GetLeft();
+ XFBorder& rBottomBorder = pBorders->GetBottom();
bool bNoLeftBorder = true;
bool bNoBottomBorder = true;
@@ -749,8 +749,8 @@ LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal
boost::scoped_ptr<XFBorders> pNeighbourBorders(pLeftNeighbour->GetXFBorders());
if (pNeighbourBorders)
{
- XFBorder * pRightBorder = pNeighbourBorders->GetRight();
- if (*pLeftBorder != *pRightBorder)
+ XFBorder& rRightBorder = pNeighbourBorders->GetRight();
+ if (rLeftBorder != rRightBorder)
{
// if left border is different with right border of left cell
// we should not ignored it
@@ -776,8 +776,8 @@ LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal
boost::scoped_ptr<XFBorders> pBelowBorders(pBelowNeighbour->GetXFBorders());
if (pBelowBorders)
{
- XFBorder * pTopBorder = pBelowBorders->GetTop();
- if (*pTopBorder != *pBottomBorder)
+ XFBorder& rTopBorder = pBelowBorders->GetTop();
+ if (rTopBorder != rBottomBorder)
{
// if bottom border is different with right border of left cell
// we should not ignored it
@@ -889,7 +889,7 @@ XFCell* LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow,
LwpTable *pTable = dynamic_cast<LwpTable *>(aTableID.obj().get());
if (pTable)
{
- LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj().get());
+ LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle().obj().get());
if (pDefault)
{
pXFCell = pDefault->ConvertCell(aTableID, nRow, nCol);
diff --git a/lotuswordpro/source/filter/lwpcelllayout.hxx b/lotuswordpro/source/filter/lwpcelllayout.hxx
index d9ab7589609f..a6123a42f565 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.hxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.hxx
@@ -96,7 +96,7 @@ public:
sal_uInt16 GetRowID(){return crowid;}
sal_uInt8 GetColID(){return ccolid;}
void RegisterStyle() SAL_OVERRIDE;
- LwpObjectID * GetNumericsObject() {return &cLayNumerics;}
+ LwpObjectID& GetNumericsObject() {return cLayNumerics;}
LwpObjectID * GetPreviousCellStory();
virtual LwpPara* GetLastParaOfPreviousStory() SAL_OVERRIDE;
LwpTableLayout * GetTableLayout();
diff --git a/lotuswordpro/source/filter/lwpcharacterstyle.cxx b/lotuswordpro/source/filter/lwpcharacterstyle.cxx
index 1cb925baa7c6..8b61199ceeae 100644
--- a/lotuswordpro/source/filter/lwpcharacterstyle.cxx
+++ b/lotuswordpro/source/filter/lwpcharacterstyle.cxx
@@ -176,19 +176,19 @@ void LwpTextStyle::RegisterStyle()
XFTextStyle* pStyle = new XFTextStyle();
//Set name
- OUString styleName = GetName()->str();
+ OUString styleName = GetName().str();
pStyle->SetStyleName(styleName);
//Create font
- LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
- rtl::Reference<XFFont> pFont = pFontMgr->CreateFont(m_nFinalFontID);
+ LwpFontManager& rFontMgr = m_pFoundry->GetFontManger();
+ rtl::Reference<XFFont> pFont = rFontMgr.CreateFont(m_nFinalFontID);
pStyle->SetFont(pFont);
//Set other properties if needed
//Add style
LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager();
- pStyleMgr->AddStyle(*GetObjectID(), pStyle);
+ pStyleMgr->AddStyle(GetObjectID(), pStyle);
}
diff --git a/lotuswordpro/source/filter/lwpcontent.hxx b/lotuswordpro/source/filter/lwpcontent.hxx
index 70a03da5a466..cd85bd5b1893 100644
--- a/lotuswordpro/source/filter/lwpcontent.hxx
+++ b/lotuswordpro/source/filter/lwpcontent.hxx
@@ -109,7 +109,7 @@ protected:
protected:
void Read() SAL_OVERRIDE;
public:
- inline LwpAssociatedLayouts* GetLayoutsWithMe();
+ inline LwpAssociatedLayouts& GetLayoutsWithMe();
LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout);
inline bool IsActive();
virtual bool IsTable();
@@ -119,9 +119,9 @@ public:
bool IsStyleContent();
};
-LwpAssociatedLayouts* LwpContent::GetLayoutsWithMe()
+LwpAssociatedLayouts& LwpContent::GetLayoutsWithMe()
{
- return &m_LayoutsWithMe;
+ return m_LayoutsWithMe;
}
inline bool LwpContent::IsActive()
diff --git a/lotuswordpro/source/filter/lwpdivinfo.cxx b/lotuswordpro/source/filter/lwpdivinfo.cxx
index 5a93497591eb..2e975875a8ff 100644
--- a/lotuswordpro/source/filter/lwpdivinfo.cxx
+++ b/lotuswordpro/source/filter/lwpdivinfo.cxx
@@ -166,11 +166,11 @@ sal_uInt16 LwpDivInfo::GetMaxNumberOfPages()
LwpDocument* pDiv = GetDivision();
if(!pDiv)
return 0;
- LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID()->obj().get());
+ LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID().obj().get());
if(pHeadTail)
{
- LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail()->obj().get());
- if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull())
+ LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail().obj().get());
+ if(pPageHint && !pPageHint->GetPageLayoutID().IsNull())
{
return pPageHint->GetPageNumber();
}
diff --git a/lotuswordpro/source/filter/lwpdivinfo.hxx b/lotuswordpro/source/filter/lwpdivinfo.hxx
index b191f15a8b48..f99d8079ffed 100644
--- a/lotuswordpro/source/filter/lwpdivinfo.hxx
+++ b/lotuswordpro/source/filter/lwpdivinfo.hxx
@@ -78,8 +78,8 @@ class LwpDivInfo : public LwpObject
{
public:
LwpDivInfo(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
- LwpObjectID* GetInitialLayoutID(){ return &m_InitialLayoutID;}
- LwpObjectID* GetFillerPageTextID(){ return &m_FillerPageTextID;}
+ LwpObjectID& GetInitialLayoutID() { return m_InitialLayoutID; }
+ LwpObjectID& GetFillerPageTextID() { return m_FillerPageTextID; }
// add by ,03/14/2004
OUString GetDivName() { return m_Name.str(); }
// end add
@@ -92,7 +92,7 @@ public:
inline LwpDocument* GetDivision();
void GetNumberOfPages(sal_uInt16& nPageno);
sal_uInt16 GetMaxNumberOfPages();
- LwpAtomHolder* GetExternalName(){return &m_ExternalName;}
+ LwpAtomHolder& GetExternalName() { return m_ExternalName; }
protected:
void Read() SAL_OVERRIDE;
private:
diff --git a/lotuswordpro/source/filter/lwpdlvlist.hxx b/lotuswordpro/source/filter/lwpdlvlist.hxx
index 7b36c34f0179..2255792ab592 100644
--- a/lotuswordpro/source/filter/lwpdlvlist.hxx
+++ b/lotuswordpro/source/filter/lwpdlvlist.hxx
@@ -83,8 +83,8 @@ protected:
protected:
void Read() SAL_OVERRIDE;
public:
- LwpObjectID* GetNext() { return &m_ListNext; }
- LwpObjectID* GetPrevious() { return &m_ListPrevious; }
+ LwpObjectID& GetNext() { return m_ListNext; }
+ LwpObjectID& GetPrevious() { return m_ListPrevious; }
};
/**
@@ -106,11 +106,11 @@ protected:
void ReadName(LwpObjectStream* pObjStrm);
public:
// 01/17/2005
- LwpAtomHolder* GetName() { return &m_Name; }
+ LwpAtomHolder& GetName() { return m_Name; }
//end
- LwpObjectID* GetChildHead() { return &m_ChildHead; }
- LwpObjectID* GetChildTail() { return &m_ChildTail; }
- LwpObjectID* GetParent() { return &m_Parent; }
+ LwpObjectID& GetChildHead() { return m_ChildHead; }
+ LwpObjectID& GetChildTail() { return m_ChildTail; }
+ LwpObjectID& GetParent() { return m_Parent; }
};
@@ -145,8 +145,8 @@ private:
LwpObjectID m_ListHead;
LwpObjectID m_ListTail;
public:
- LwpObjectID* GetHead() { return &m_ListHead; }
- LwpObjectID* GetTail() { return &m_ListTail; }
+ LwpObjectID& GetHead() { return m_ListHead; }
+ LwpObjectID& GetTail() { return m_ListTail; }
};
/**
@@ -158,7 +158,7 @@ public:
LwpDLVListHead(){}
~LwpDLVListHead(){}
void Read(LwpObjectStream* pObjStrm);
- LwpObjectID* GetFirst() { return &m_objHead; }
+ LwpObjectID& GetFirst() { return m_objHead; }
protected:
LwpObjectID m_objHead;//LwpDLVList
};
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx
index 7b421685bc88..e2ab2a793175 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -163,7 +163,7 @@ void LwpDocument::Parse(IXFStream* pOutputStream)
ParseDocContent(pOutputStream);
}
- rtl::Reference<LwpObject> pDocSock = GetSocket()->obj( VO_DOCSOCK );
+ rtl::Reference<LwpObject> pDocSock = GetSocket().obj( VO_DOCSOCK );
if(pDocSock.is())
{
pDocSock->Parse(pOutputStream);
@@ -174,7 +174,7 @@ bool LwpDocument::IsSkippedDivision()
{
OUString sDivName;
bool ret = false;
- LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj(VO_DIVISIONINFO).get());
+ LwpDivInfo* pDiv = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj(VO_DIVISIONINFO).get());
if (pDiv == NULL)
return true;
sDivName = pDiv->GetDivName();
@@ -186,17 +186,17 @@ bool LwpDocument::IsSkippedDivision()
|| (strClassName == STR_DivisionGroupEndnote)
|| (strClassName == STR_DocumentEndnote))
{
- LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID()->obj(VO_PAGELAYOUT).get());
+ LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID().obj(VO_PAGELAYOUT).get());
if(pPageLayout)
{
- LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY).get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj(VO_STORY).get());
if(pStory)
{
//This judgement maybe have problem. If there is only one para in the story,
//this endnote division has no other contents except endnote table.
- LwpObjectID* pFirst = pStory->GetFirstPara();
- LwpObjectID* pLast = pStory->GetLastPara();
- if(*pFirst == *pLast)
+ LwpObjectID& rFirst = pStory->GetFirstPara();
+ LwpObjectID& rLast = pStory->GetLastPara();
+ if(rFirst == rLast)
ret = true;
}
}
@@ -221,7 +221,7 @@ void LwpDocument::RegisterStyle()
RegisterFootnoteStyles();
//Register styles in other document connected with this document: next doc, children doc
- rtl::Reference<LwpObject> pDocSock = GetSocket()->obj();
+ rtl::Reference<LwpObject> pDocSock = GetSocket().obj();
if(pDocSock.is())
{
pDocSock->RegisterStyle();
@@ -233,15 +233,15 @@ void LwpDocument::RegisterStyle()
void LwpDocument::RegisterTextStyles()
{
//Register all text styles: para styles, character styles
- LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead()->obj().get());
+ LwpDLVListHeadHolder* pParaStyleHolder = dynamic_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead().obj().get());
if(pParaStyleHolder)
{
- LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj().get());
+ LwpTextStyle* pParaStyle = dynamic_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID().obj().get());
while(pParaStyle)
{
pParaStyle->SetFoundry(m_pFoundry);
pParaStyle->RegisterStyle();
- pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext()->obj().get());
+ pParaStyle = dynamic_cast<LwpParaStyle*>(pParaStyle->GetNext().obj().get());
}
}
ChangeStyleName();//add by ,for click here block,05/5/26
@@ -260,11 +260,11 @@ void LwpDocument::RegisterLayoutStyles()
LwpPageLayout* pPageLayout = NULL;
if(pDivInfo)
{
- pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj(VO_PAGELAYOUT).get());
+ pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID().obj(VO_PAGELAYOUT).get());
if(pPageLayout)
{
//In Ole division, the content of pagelayout is VO_OLEOBJECT
- LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY).get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj(VO_STORY).get());
if(pStory)
{
//add all the pagelayout in order into the pagelayout list;
@@ -280,16 +280,16 @@ void LwpDocument::RegisterLayoutStyles()
void LwpDocument::RegisterStylesInPara()
{
//Register all automatic styles in para
- LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager()->GetContentList()->obj().get());
+ LwpHeadContent* pContent = dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager().GetContentList().obj().get());
if(pContent)
{
- LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead()->obj(VO_STORY).get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead().obj(VO_STORY).get());
while(pStory)
{
//Register the child para
pStory->SetFoundry(m_pFoundry);
pStory->RegisterStyle();
- pStory = dynamic_cast<LwpStory*>(pStory->GetNext()->obj(VO_STORY).get());
+ pStory = dynamic_cast<LwpStory*>(pStory->GetNext().obj(VO_STORY).get());
}
}
}
@@ -300,16 +300,16 @@ void LwpDocument::RegisterBulletStyles()
{
//Register bullet styles
LwpDLVListHeadHolder* mBulletHead = dynamic_cast<LwpDLVListHeadHolder*>
- (m_pFoundry->GetBulletManagerID()->obj(VO_HEADHOLDER).get());
+ (m_pFoundry->GetBulletManagerID().obj(VO_HEADHOLDER).get());
if( mBulletHead )
{
LwpSilverBullet* pBullet = dynamic_cast<LwpSilverBullet*>
- (mBulletHead->GetHeadID()->obj().get());
+ (mBulletHead->GetHeadID().obj().get());
while(pBullet)
{
pBullet->SetFoundry(m_pFoundry);
pBullet->RegisterStyle();
- pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext()->obj().get());
+ pBullet = dynamic_cast<LwpSilverBullet*> (pBullet->GetNext().obj().get());
}
}
}
@@ -319,7 +319,7 @@ void LwpDocument::RegisterBulletStyles()
void LwpDocument::RegisterGraphicsStyles()
{
//Register all graphics styles, the first object should register the next;
- rtl::Reference<LwpObject> pGraphic = m_pFoundry->GetGraphicListHead()->obj(VO_GRAPHIC);
+ rtl::Reference<LwpObject> pGraphic = m_pFoundry->GetGraphicListHead().obj(VO_GRAPHIC);
if(pGraphic.is())
{
pGraphic->SetFoundry(m_pFoundry);
@@ -356,13 +356,13 @@ void LwpDocument::RegisterFootnoteStyles()
LwpDocument* pEndnoteDiv = GetLastDivisionThatHasEndnote();
if(this == pEndnoteDiv)
{
- LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID()->obj().get());
+ LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID().obj().get());
if(pHeadTail)
{
- LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail()->obj().get());
- if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull())
+ LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetTail().obj().get());
+ if(pPageHint && !pPageHint->GetPageLayoutID().IsNull())
{
- LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID()->obj().get());
+ LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID().obj().get());
if(pPageLayout)
{
pPageLayout->SetFoundry(GetFoundry());
@@ -386,7 +386,7 @@ void LwpDocument::RegisterDefaultParaStyles()
LwpDocument* pFirstDoc = GetFirstDivisionWithContentsThatIsNotOLE();
if(pFirstDoc)
{
- LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc()->obj().get());
+ LwpVerDocument* pVerDoc = dynamic_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc().obj().get());
if(pVerDoc)
{
pVerDoc->RegisterStyle();
@@ -406,7 +406,7 @@ void LwpDocument::ParseDocContent(IXFStream* pOutputStream)
LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (m_DivInfo.obj().get());
if(pDivInfo==NULL) return;
- rtl::Reference<LwpObject> pLayoutObj = pDivInfo->GetInitialLayoutID()->obj();
+ rtl::Reference<LwpObject> pLayoutObj = pDivInfo->GetInitialLayoutID().obj();
if(!pLayoutObj.is())
{
//master document not supported now.
@@ -424,7 +424,7 @@ LwpObjectID* LwpDocument::GetValidFootnoteOpts()
LwpDocument* pRoot = GetRootDocument();
if(pRoot)
{
- return pRoot->GetFootnoteOpts();
+ return &pRoot->GetFootnoteOpts();
}
return NULL;
}
@@ -434,7 +434,7 @@ LwpObjectID* LwpDocument::GetValidFootnoteOpts()
*/
sal_uInt16 LwpDocument::GetEndnoteType()
{
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj().get());
if (!pDivInfo)
return FN_DONTCARE;
OUString strClassName = pDivInfo->GetClassName();
@@ -451,10 +451,10 @@ sal_uInt16 LwpDocument::GetEndnoteType()
*/
LwpDocument* LwpDocument::GetPreviousDivision()
{
- LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get());
+ LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
if(pDocSock)
{
- return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious()->obj().get());
+ return dynamic_cast<LwpDocument*>(pDocSock->GetPrevious().obj().get());
}
return NULL;
}
@@ -463,10 +463,10 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpDocument* LwpDocument::GetNextDivision()
{
- LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get());
+ LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
if(pDocSock)
{
- return dynamic_cast<LwpDocument*>(pDocSock->GetNext()->obj().get());
+ return dynamic_cast<LwpDocument*>(pDocSock->GetNext().obj().get());
}
return NULL;
}
@@ -475,10 +475,10 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpDocument* LwpDocument::GetParentDivision()
{
- LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get());
+ LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
if(pDocSock)
{
- return dynamic_cast<LwpDocument*>(pDocSock->GetParent()->obj().get());
+ return dynamic_cast<LwpDocument*>(pDocSock->GetParent().obj().get());
}
return NULL;
}
@@ -491,7 +491,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
for (pPrev = GetPreviousDivision(); pPrev; pPrev = pPrev->GetPreviousDivision())
{
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pPrev->GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pPrev->GetDivInfoID().obj().get());
if(pDivInfo && pDivInfo->HasContents())
return pPrev;
}
@@ -506,7 +506,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
for (pNext = GetNextDivision(); pNext; pNext = pNext->GetNextDivision())
{
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID().obj().get());
if(pDivInfo && pDivInfo->HasContents())
return pNext;
}
@@ -533,7 +533,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpDocument* LwpDocument::GetLastDivisionWithContents()
{
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj().get());
if(pDivInfo && pDivInfo->HasContents())
{
return this;
@@ -564,7 +564,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
while (pNext)
{
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pNext->GetDivInfoID().obj().get());
if (pDivInfo && pDivInfo->HasContents())
pLast = pNext;
pNext = pNext->GetNextInGroup();
@@ -578,9 +578,9 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpDocument* LwpDocument::GetLastDivision()
{
- LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get());
+ LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
if(pDocSock)
- return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail()->obj().get());
+ return dynamic_cast<LwpDocument*>(pDocSock->GetChildTail().obj().get());
return NULL;
}
@@ -589,9 +589,9 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpDocument* LwpDocument::GetFirstDivision()
{
- LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket()->obj().get());
+ LwpDocSock* pDocSock = dynamic_cast<LwpDocSock*>(GetSocket().obj().get());
if(pDocSock)
- return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead()->obj().get());
+ return dynamic_cast<LwpDocument*>(pDocSock->GetChildHead().obj().get());
return NULL;
}
@@ -614,7 +614,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpDocument* LwpDocument::GetFirstDivisionWithContentsThatIsNotOLE()
{
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(GetDivInfoID().obj().get());
if(pDivInfo && pDivInfo->HasContents()
&& !pDivInfo->IsOleDivision())
return this;
@@ -653,7 +653,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
*/
LwpVirtualLayout* LwpDocument::GetEnSuperTableLayout()
{
- LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout()->obj().get());
+ LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout().obj().get());
if(pHeadLayout)
{
return pHeadLayout->FindEnSuperTableLayout();
@@ -737,13 +737,13 @@ void LwpDocument::XFConvertFrameInPage(XFContentContainer * pCont)
{
LwpDocument* pDivision = GetFirstDivision();
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*> (GetDivInfoID().obj().get());
if(pDivInfo)
{
- LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj().get());
+ LwpPageLayout* pPageLayout = dynamic_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID().obj().get());
if(pPageLayout)
{
- LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent()->obj().get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(pPageLayout->GetContent().obj().get());
if(pStory)
pStory->XFConvertFrameInPage(pCont);
}
@@ -784,11 +784,11 @@ void LwpDocSock::Read()
*/
void LwpDocSock::RegisterStyle()
{
- rtl::Reference<LwpObject> pDoc = GetNext()->obj();
+ rtl::Reference<LwpObject> pDoc = GetNext().obj();
if(pDoc.is())
pDoc->RegisterStyle();
- pDoc = GetChildHead()->obj();
+ pDoc = GetChildHead().obj();
if(pDoc.is())
pDoc->RegisterStyle();
}
@@ -797,11 +797,11 @@ void LwpDocSock::RegisterStyle()
*/
void LwpDocSock::Parse(IXFStream* pOutputStream)
{
- rtl::Reference<LwpObject> pDoc = GetChildHead()->obj();
+ rtl::Reference<LwpObject> pDoc = GetChildHead().obj();
if(pDoc.is())
pDoc->Parse(pOutputStream);
- pDoc = GetNext()->obj();
+ pDoc = GetNext().obj();
if(pDoc.is())
pDoc->Parse(pOutputStream);
}
diff --git a/lotuswordpro/source/filter/lwpdoc.hxx b/lotuswordpro/source/filter/lwpdoc.hxx
index 44155873e9cc..724fea776716 100644
--- a/lotuswordpro/source/filter/lwpdoc.hxx
+++ b/lotuswordpro/source/filter/lwpdoc.hxx
@@ -138,15 +138,15 @@ public:
inline bool IsChildDoc();
inline bool HonorProtection();
- inline LwpObjectID* GetContentList();
- inline LwpObjectID* GetDocData();
- inline LwpObjectID* GetSocket();
+ inline LwpObjectID& GetContentList();
+ inline LwpObjectID& GetDocData();
+ inline LwpObjectID& GetSocket();
inline LwpFoundry* GetFoundry();
- inline LwpObjectID* GetDivInfoID();
- inline LwpObjectID* GetPageHintsID();
- inline LwpObjectID* GetFootnoteOpts();
- inline LwpObjectID* GetVerDoc();
+ inline LwpObjectID& GetDivInfoID();
+ inline LwpObjectID& GetPageHintsID();
+ inline LwpObjectID& GetFootnoteOpts();
+ inline LwpObjectID& GetVerDoc();
LwpObjectID* GetValidFootnoteOpts();
sal_uInt16 GetEndnoteType();
@@ -186,37 +186,37 @@ inline bool LwpDocument::HonorProtection()
{
return m_nPersistentFlags & DOC_PROTECTED;
}
-inline LwpObjectID* LwpDocument::GetContentList()
+inline LwpObjectID& LwpDocument::GetContentList()
{
- return(m_pFoundry->GetContentManager()->GetContentList());
+ return m_pFoundry->GetContentManager().GetContentList();
}
-inline LwpObjectID* LwpDocument::GetSocket()
+inline LwpObjectID& LwpDocument::GetSocket()
{
- return &m_DocSockID;
+ return m_DocSockID;
}
inline LwpFoundry* LwpDocument::GetFoundry()
{
return m_pFoundry;
}
-inline LwpObjectID* LwpDocument::GetDivInfoID()
+inline LwpObjectID& LwpDocument::GetDivInfoID()
{
- return &m_DivInfo;
+ return m_DivInfo;
}
-inline LwpObjectID* LwpDocument::GetPageHintsID()
+inline LwpObjectID& LwpDocument::GetPageHintsID()
{
- return &m_WYSIWYGPageHints;
+ return m_WYSIWYGPageHints;
}
-inline LwpObjectID* LwpDocument::GetFootnoteOpts()
+inline LwpObjectID& LwpDocument::GetFootnoteOpts()
{
- return &m_FootnoteOpts;
+ return m_FootnoteOpts;
}
-inline LwpObjectID* LwpDocument::GetDocData()
+inline LwpObjectID& LwpDocument::GetDocData()
{
- return &m_DocData;
+ return m_DocData;
}
-inline LwpObjectID* LwpDocument::GetVerDoc()
+inline LwpObjectID& LwpDocument::GetVerDoc()
{
- return &m_VerDoc;
+ return m_VerDoc;
}
/**
diff --git a/lotuswordpro/source/filter/lwpfilehdr.hxx b/lotuswordpro/source/filter/lwpfilehdr.hxx
index 896e3330857b..73a2ebabcb2d 100644
--- a/lotuswordpro/source/filter/lwpfilehdr.hxx
+++ b/lotuswordpro/source/filter/lwpfilehdr.hxx
@@ -76,15 +76,15 @@ public:
static sal_uInt16 m_nFileRevision;
sal_uInt32 Read(LwpSvStream *pStrm);
sal_uInt32 GetRootIndexOffset();
- LwpObjectID* GetDocID();
+ LwpObjectID& GetDocID();
};
inline sal_uInt32 LwpFileHeader::GetRootIndexOffset()
{
return m_nRootIndexOffset;
}
-inline LwpObjectID* LwpFileHeader::GetDocID()
+inline LwpObjectID& LwpFileHeader::GetDocID()
{
- return &m_cDocumentID;
+ return m_cDocumentID;
}
#endif
diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx
index 595f43ac1940..86ddc5fb5452 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -118,15 +118,15 @@ void LwpFnRowLayout::Read()
void LwpFnRowLayout::RegisterStyle()
{
// register cells' style
- LwpObjectID *pCellID= GetChildHead();
- LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj().get());
+ LwpObjectID& rCellID = GetChildHead();
+ LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(rCellID.obj().get());
while(pCellLayout)
{
pCellLayout->SetFoundry(m_pFoundry);
pCellLayout->RegisterStyle();
- pCellID = pCellLayout->GetNext();
- pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj().get());
+ rCellID = pCellLayout->GetNext();
+ pCellLayout = static_cast<LwpCellLayout *>(rCellID.obj().get());
}
}
@@ -198,15 +198,15 @@ void LwpEndnoteLayout::Read()
void LwpEndnoteLayout::RegisterStyle()
{
// register style of rows
- LwpObjectID *pRowID = GetChildHead();
- LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj().get());
+ LwpObjectID& rRowID = GetChildHead();
+ LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(rRowID.obj().get());
while (pRowLayout)
{
pRowLayout->SetFoundry(m_pFoundry);
pRowLayout->RegisterStyle();
- pRowID = pRowLayout->GetNext();
- pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj().get());
+ rRowID = pRowLayout->GetNext();
+ pRowLayout = static_cast<LwpRowLayout *>(rRowID.obj().get());
}
}
@@ -258,11 +258,11 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
*/
LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
{
- LwpObjectID *pID = GetChildTail();
+ LwpObjectID& rID = GetChildTail();
- while(pID && !pID->IsNull())
+ while(!rID.IsNull())
{
- LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj().get());
+ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(rID.obj().get());
if(!pLayout)
{
break;
@@ -271,7 +271,7 @@ void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
{
return pLayout;
}
- pID = pLayout->GetPrevious();
+ rID = pLayout->GetPrevious();
}
return NULL;
@@ -314,11 +314,11 @@ void LwpFnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
*/
LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
{
- LwpObjectID *pID = GetChildTail();
+ LwpObjectID& rID = GetChildTail();
- while(pID && !pID->IsNull())
+ while(!rID.IsNull())
{
- LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj().get());
+ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(rID.obj().get());
if(!pLayout)
{
break;
@@ -327,7 +327,7 @@ LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
{
return pLayout;
}
- pID = pLayout->GetPrevious();
+ rID = pLayout->GetPrevious();
}
return NULL;
diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx
index 1761b281915d..19467ef830f1 100644
--- a/lotuswordpro/source/filter/lwpfootnote.cxx
+++ b/lotuswordpro/source/filter/lwpfootnote.cxx
@@ -212,7 +212,7 @@ LwpCellLayout* LwpFootnote::GetCellLayout()
LwpRowLayout* pRowLayout = pTableLayout->GetRowLayout(m_nRow);
if(pRowLayout)
{
- return dynamic_cast<LwpCellLayout*>(pRowLayout->GetChildHead()->obj().get());
+ return dynamic_cast<LwpCellLayout*>(pRowLayout->GetChildHead().obj().get());
}
}
}
@@ -235,7 +235,7 @@ LwpDocument* LwpFootnote::GetFootnoteTableDivision()
// The division might not have a DivisionInfo if it's being Destruct()ed
pPrev = m_pFoundry->GetDocument();
pFootnoteDivision = pPrev;
- if (!pPrev || pPrev->GetDivInfoID()->IsNull())
+ if (!pPrev || pPrev->GetDivInfoID().IsNull())
return NULL;
switch (m_nType)
@@ -396,7 +396,7 @@ LwpContent* LwpFootnote::FindFootnoteContent()
LwpCellLayout* pCellLayout = GetCellLayout();
if(pCellLayout)
{
- pContent = dynamic_cast<LwpContent*>(pCellLayout->GetContent()->obj().get());
+ pContent = dynamic_cast<LwpContent*>(pCellLayout->GetContent().obj().get());
}
return pContent;
diff --git a/lotuswordpro/source/filter/lwpfootnote.hxx b/lotuswordpro/source/filter/lwpfootnote.hxx
index 1abb13552a84..703249fe0af2 100644
--- a/lotuswordpro/source/filter/lwpfootnote.hxx
+++ b/lotuswordpro/source/filter/lwpfootnote.hxx
@@ -231,7 +231,7 @@ public:
sal_uInt32 GetIndent(){ return m_nIndent;}
sal_uInt32 GetAbove(){ return m_nAbove;}
sal_uInt32 GetBelow(){ return m_nBelow;}
- LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
+ LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
@@ -277,12 +277,12 @@ private:
};
public:
- LwpFootnoteNumberOptions* GetFootnoteNumbering(){ return &m_FootnoteNumbering;}
- LwpFootnoteNumberOptions* GetEndnoteDivisionNumbering(){ return &m_EndnoteDivisionNumbering;}
- LwpFootnoteNumberOptions* GetEndnoteDivisionGroupNumbering(){ return &m_EndnoteDivisionGroupNumbering;}
- LwpFootnoteNumberOptions* GetEndnoteDocNumbering(){ return &m_EndnoteDocNumbering;}
- LwpFootnoteSeparatorOptions* GetFootnoteSeparator(){ return &m_FootnoteSeparator;}
- LwpFootnoteSeparatorOptions* GetFootnoteContinuedSeparator(){ return &m_FootnoteContinuedSeparator;}
+ LwpFootnoteNumberOptions& GetFootnoteNumbering(){ return m_FootnoteNumbering;}
+ LwpFootnoteNumberOptions& GetEndnoteDivisionNumbering(){ return m_EndnoteDivisionNumbering;}
+ LwpFootnoteNumberOptions& GetEndnoteDivisionGroupNumbering(){ return m_EndnoteDivisionGroupNumbering;}
+ LwpFootnoteNumberOptions& GetEndnoteDocNumbering(){ return m_EndnoteDocNumbering;}
+ LwpFootnoteSeparatorOptions& GetFootnoteSeparator(){ return m_FootnoteSeparator;}
+ LwpFootnoteSeparatorOptions& GetFootnoteContinuedSeparator(){ return m_FootnoteContinuedSeparator;}
bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
OUString GetContinuedOnMessage();
diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx
index 3fac6aa73511..8874068caab4 100644
--- a/lotuswordpro/source/filter/lwpfoundry.cxx
+++ b/lotuswordpro/source/filter/lwpfoundry.cxx
@@ -232,22 +232,16 @@ LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker)
{
LwpDLVListHeadHolder* pHeadHolder= static_cast
<LwpDLVListHeadHolder*>(m_BookMarkHead.obj().get());
- LwpObjectID* pObjID = pHeadHolder->GetHeadID();
+ LwpObjectID& rObjID = pHeadHolder->GetHeadID();
LwpBookMark* pBookMark;
- if (pObjID)
- pBookMark = static_cast<LwpBookMark*>(pObjID->obj().get());
- else
- return NULL;
+ pBookMark = static_cast<LwpBookMark*>(rObjID.obj().get());
while (pBookMark)
{
if (pBookMark->IsRightMarker(objMarker))
return pBookMark;
- pObjID = pBookMark->GetNext();
- if (pObjID)
- pBookMark = static_cast<LwpBookMark*>(pObjID->obj().get());
- else
- return NULL;
+ rObjID = pBookMark->GetNext();
+ pBookMark = static_cast<LwpBookMark*>(rObjID.obj().get());
}
return NULL;
}
@@ -258,7 +252,7 @@ LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker)
*/
LwpContent* LwpFoundry::EnumContents(LwpContent * pContent)
{
- return GetContentManager()->EnumContents(pContent);
+ return GetContentManager().EnumContents(pContent);
}
/**
@@ -280,7 +274,7 @@ LwpObjectID * LwpFoundry::GetDefaultTextStyle()
if (!pPointer)
return NULL;
- return pPointer->GetPointer();
+ return &pPointer->GetPointer();
}
/**
@@ -290,16 +284,16 @@ LwpObjectID * LwpFoundry::GetDefaultTextStyle()
LwpObjectID * LwpFoundry::FindParaStyleByName(const OUString& name)
{
//Register all text styles: para styles, character styles
- LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(GetTextStyleHead()->obj().get());
+ LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(GetTextStyleHead().obj().get());
if(pParaStyleHolder)
{
- LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj().get());
+ LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID().obj().get());
while(pParaStyle)
{
- OUString strName = pParaStyle->GetName()->str();
+ OUString strName = pParaStyle->GetName().str();
if(strName == name)
- return pParaStyle->GetObjectID();
- pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext()->obj().get());
+ return &pParaStyle->GetObjectID();
+ pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext().obj().get());
}
}
@@ -409,7 +403,7 @@ LwpContent* LwpContentManager::EnumContents(LwpContent* pContent)
if(pContent)
return pContent->GetNextEnumerated();
LwpVersionedPointer* pPointer = static_cast<LwpVersionedPointer*>(m_EnumHead.obj().get());
- return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer()->obj().get()) : NULL;
+ return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer().obj().get()) : NULL;
}
void LwpPieceManager::Read(LwpObjectStream *pStrm)
@@ -459,15 +453,15 @@ void LwpOrderedObjectManager::Read(LwpObjectStream *pStrm)
LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast)
{
// If Last has a next, return it.
- if(pLast && !pLast->GetNext()->IsNull())
- return static_cast<LwpOrderedObject*>(pLast->GetNext()->obj().get());
+ if(pLast && !pLast->GetNext().IsNull())
+ return static_cast<LwpOrderedObject*>(pLast->GetNext().obj().get());
LwpListList* pList = NULL;
if(pLast)
{
// We're at the end of Last's list (not Liszt's list).
// Start with the next active list
- pList = static_cast<LwpListList*>(pLast->GetListList()->obj().get());
+ pList = static_cast<LwpListList*>(pLast->GetListList().obj().get());
pList= GetNextActiveListList(pList);
}
else
@@ -478,7 +472,7 @@ LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast)
if(pList)
{
- return static_cast<LwpOrderedObject*>(pList->GetHead()->obj().get());
+ return static_cast<LwpOrderedObject*>(pList->GetHead().obj().get());
}
return NULL;
@@ -493,23 +487,23 @@ LwpListList* LwpOrderedObjectManager::GetNextActiveListList(LwpListList * pLast)
LwpListList* pList = NULL;
LwpContent* pContent = NULL;
if(pLast)
- pList = static_cast<LwpListList*>(pLast->GetNext()->obj().get());
+ pList = static_cast<LwpListList*>(pLast->GetNext().obj().get());
else
{
LwpDLVListHeadHolder* pHeadHolder= static_cast<LwpDLVListHeadHolder*>(m_Head.obj().get());
if(pHeadHolder)
{
- pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID()->obj().get());
+ pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID().obj().get());
}
}
while(pList)
{
- pContent = static_cast<LwpContent*>(pList->GetObject()->obj().get());
+ pContent = static_cast<LwpContent*>(pList->GetObject().obj().get());
if(pContent && pContent->HasNonEmbeddedLayouts() &&
!pContent->IsStyleContent())
return pList;
- pList = static_cast<LwpListList*>(pList->GetNext()->obj().get());
+ pList = static_cast<LwpListList*>(pList->GetNext().obj().get());
}
return NULL;
}
diff --git a/lotuswordpro/source/filter/lwpfoundry.hxx b/lotuswordpro/source/filter/lwpfoundry.hxx
index ae0834b020f8..51fbf50e1aea 100644
--- a/lotuswordpro/source/filter/lwpfoundry.hxx
+++ b/lotuswordpro/source/filter/lwpfoundry.hxx
@@ -121,7 +121,7 @@ private:
LwpObjectID m_Head;
public:
void Read(LwpObjectStream *pStrm);
- LwpObjectID* GetHeadID() { return &m_Head;}
+ LwpObjectID& GetHeadID() { return m_Head;}
};
class LwpContent;
@@ -141,8 +141,8 @@ private:
LwpObjectID m_OleHead;
LwpObjectID m_OleTail;
public:
- inline LwpObjectID* GetContentList() { return &m_ContentList; }
- inline LwpObjectID* GetGraphicListHead() { return &m_GrapHead; }
+ inline LwpObjectID& GetContentList() { return m_ContentList; }
+ inline LwpObjectID& GetGraphicListHead() { return m_GrapHead; }
LwpContent* EnumContents(LwpContent* pContent);
public:
@@ -195,7 +195,7 @@ protected:
LwpObjectID m_Head;
public:
void Read(LwpObjectStream *pStrm);
- LwpObjectID* GetHeadID() { return &m_Head;}
+ LwpObjectID& GetHeadID() { return m_Head;}
LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
protected:
LwpListList* GetNextActiveListList(LwpListList* pLast);
@@ -262,14 +262,14 @@ private: //file members
private:
void ReadStyles(LwpObjectStream *pStrm);
public:
- inline LwpContentManager* GetContentManager() { return &m_ContentMgr; }
- inline LwpObjectID* GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
- inline LwpFontManager* GetFontManger() { return &m_FontMgr;}
- inline LwpObjectID* GetTextStyleHead() { return &m_TextStyle;}
- inline LwpObjectID* GetLayout() {return &m_Layout;}
- inline LwpObjectID* GetBulletManagerID() { return m_BulMgr.GetHeadID();}
+ inline LwpContentManager& GetContentManager() { return m_ContentMgr; }
+ inline LwpObjectID& GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
+ inline LwpFontManager& GetFontManger() { return m_FontMgr;}
+ inline LwpObjectID& GetTextStyleHead() { return m_TextStyle;}
+ inline LwpObjectID& GetLayout() {return m_Layout;}
+ inline LwpObjectID& GetBulletManagerID() { return m_BulMgr.GetHeadID();}
inline LwpDocument* GetDocument(){ return m_pDoc;}
- inline LwpNumberManager* GetNumberManager() { return &m_NumMgr;}
+ inline LwpNumberManager& GetNumberManager() { return m_NumMgr;}
LwpObjectID * GetDefaultTextStyle() ;
private:
LwpStyleManager* m_pStyleMgr;
diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx
index 7109b9dd1d81..21e601dc5eb1 100644
--- a/lotuswordpro/source/filter/lwpframelayout.cxx
+++ b/lotuswordpro/source/filter/lwpframelayout.cxx
@@ -101,7 +101,7 @@ void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle)
ApplyTextDir(pFrameStyle);
ApplyPosType(pFrameStyle);
- pFrameStyle->SetStyleName(m_pLayout->GetName()->str());
+ pFrameStyle->SetStyleName(m_pLayout->GetName().str());
XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
m_StyleName = pXFStyleManager->AddStyle(pFrameStyle)->GetStyleName();
m_pLayout->SetStyleName(m_StyleName);
@@ -125,7 +125,7 @@ void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle)
}
//Set frame Name
- OUString aFrameName = m_pLayout->GetName()->str();
+ OUString aFrameName = m_pLayout->GetName().str();
if(!aFrameName.isEmpty())
{
//cause the bug of SODC, the linkframe name can not be "Frame1", so I change the frame name
@@ -148,7 +148,7 @@ void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle)
pXFFrame->SetHeight( fHeight );
//Get content obj;
- /*LwpObject* pObj =*/ m_pLayout->GetContent()->obj();
+ /*LwpObject* pObj =*/ m_pLayout->GetContent().obj();
if(m_pLayout->IsGroupHead()&&(m_pLayout->IsMinimumHeight()))
{
//process grouplayout height. there is problems now
@@ -881,15 +881,14 @@ void LwpFrameLayout::RegisterStyle()
OUString LwpFrameLayout::GetNextLinkName()
{
OUString aName;
- LwpObjectID* pObjectID = m_Link.GetNextLayout();
- if(!pObjectID->IsNull())
+ LwpObjectID& rObjectID = m_Link.GetNextLayout();
+ if(!rObjectID.IsNull())
{
- LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pObjectID->obj().get());
+ LwpLayout* pLayout = dynamic_cast<LwpLayout*>(rObjectID.obj().get());
if (pLayout)
{
- LwpAtomHolder *pHolder = pLayout->GetName();
- if (pHolder)
- aName = pHolder->str();
+ LwpAtomHolder& rHolder = pLayout->GetName();
+ aName = rHolder.str();
//for division name confict
if(!pLayout->GetStyleName().isEmpty())
aName = pLayout->GetStyleName();
@@ -903,8 +902,8 @@ OUString LwpFrameLayout::GetNextLinkName()
*/
bool LwpFrameLayout::HasPreviousLinkLayout()
{
- LwpObjectID* pObjectID = m_Link.GetPreviousLayout();
- if(pObjectID->IsNull())
+ LwpObjectID& rObjectID = m_Link.GetPreviousLayout();
+ if(rObjectID.IsNull())
return false;
return true;
}
@@ -1097,11 +1096,11 @@ void LwpGroupLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart
m_pFrame->Parse(pXFFrame, nStart);
//add child frame into group
- LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLayout)
{
pLayout->XFConvert(pXFFrame);
- pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get());
+ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get());
}
pCont ->Add(pXFFrame);
@@ -1150,7 +1149,7 @@ void LwpDropcapLayout::Parse(IXFStream* pOutputStream)
LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY).get());
if (!pStory)
return;
- rtl::Reference<LwpObject> pPara = pStory->GetFirstPara()->obj(VO_PARA);
+ rtl::Reference<LwpObject> pPara = pStory->GetFirstPara().obj(VO_PARA);
if(pPara.is())
{
pPara->SetFoundry(m_pFoundry);
@@ -1180,12 +1179,12 @@ void LwpDropcapLayout::RegisterStyle(LwpFoundry* pFoundry)
{
pStory->SetDropcapFlag(true);
pStory->SetFoundry(pFoundry);
- LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get());
+ LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara().obj().get());
while(pPara)
{
pPara->SetFoundry(pFoundry);
pPara->RegisterStyle();
- pPara = static_cast<LwpPara*>(pPara->GetNext()->obj().get());
+ pPara = static_cast<LwpPara*>(pPara->GetNext().obj().get());
}
}
}
diff --git a/lotuswordpro/source/filter/lwpframelayout.hxx b/lotuswordpro/source/filter/lwpframelayout.hxx
index ec0c39cbbf2f..a686377148df 100644
--- a/lotuswordpro/source/filter/lwpframelayout.hxx
+++ b/lotuswordpro/source/filter/lwpframelayout.hxx
@@ -114,8 +114,8 @@ public:
LwpFrameLink();
~LwpFrameLink();
void Read(LwpObjectStream* pStrm);
- LwpObjectID* GetNextLayout(){ return &m_NextLayout;}
- LwpObjectID* GetPreviousLayout(){ return &m_PreviousLayout;}
+ LwpObjectID& GetNextLayout(){ return m_NextLayout;}
+ LwpObjectID& GetPreviousLayout(){ return m_PreviousLayout;}
private:
LwpObjectID m_PreviousLayout;
LwpObjectID m_NextLayout;
diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx
index 163d80fddcbd..32c6120f363d 100644
--- a/lotuswordpro/source/filter/lwpfrib.cxx
+++ b/lotuswordpro/source/filter/lwpfrib.cxx
@@ -257,7 +257,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
LwpCharacterStyle* pCharStyle = static_cast<LwpCharacterStyle*>(m_pModifiers->CharStyleID.obj().get());
pStyle->SetStyleName("");
- pFont = pFoundry->GetFontManger()->CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID);
+ pFont = pFoundry->GetFontManger().CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID);
pStyle->SetFont(pFont);
IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle);
m_StyleName = pNewStyle->GetStyleName();
@@ -272,7 +272,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
if (m_pModifiers->FontID)
{
pStyle = new XFTextStyle();
- pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID);
+ pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID);
pStyle->SetFont(pFont);
IXFStyle *pNewStyle = pXFStyleManager->AddStyle(pStyle);
m_StyleName = pNewStyle->GetStyleName();
@@ -418,7 +418,7 @@ rtl::Reference<XFFont> LwpFrib::GetFont()
if(m_pModifiers&&m_pModifiers->FontID)
{
LwpFoundry* pFoundry = m_pPara->GetFoundry();
- pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID);
+ pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID);
}
else
{
diff --git a/lotuswordpro/source/filter/lwpfribbreaks.cxx b/lotuswordpro/source/filter/lwpfribbreaks.cxx
index ce71c21d1f61..43fc58575e6f 100644
--- a/lotuswordpro/source/filter/lwpfribbreaks.cxx
+++ b/lotuswordpro/source/filter/lwpfribbreaks.cxx
@@ -84,7 +84,7 @@ void LwpFribColumnBreak::RegisterBreakStyle(LwpPara * pPara)
//if (static_cast<LwpStory*>(pPara->GetStoryID()->obj())
// ->GetCurrentLayout()->GetNumCols() == 1)
//New code
- LwpStory* pStory = static_cast<LwpStory*>(pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(pPara->GetStoryID().obj().get());
LwpPageLayout* pCurLayout = pStory ? pStory->GetCurrentLayout() : NULL;
if( pCurLayout && (pCurLayout->GetNumCols() == 1) )
diff --git a/lotuswordpro/source/filter/lwpfribbreaks.hxx b/lotuswordpro/source/filter/lwpfribbreaks.hxx
index 927f6b28ec16..e5080897537a 100644
--- a/lotuswordpro/source/filter/lwpfribbreaks.hxx
+++ b/lotuswordpro/source/filter/lwpfribbreaks.hxx
@@ -77,7 +77,7 @@ public:
void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) SAL_OVERRIDE;
void RegisterBreakStyle(LwpPara* pPara);
void ParseLayout();
- LwpObjectID* GetLayout(){return &m_Layout;}
+ LwpObjectID& GetLayout() { return m_Layout;}
bool IsLastFrib(){return m_bLastFrib;}
private:
diff --git a/lotuswordpro/source/filter/lwpfribframe.cxx b/lotuswordpro/source/filter/lwpfribframe.cxx
index fbf4cf29ba7e..8eed873f2431 100644
--- a/lotuswordpro/source/filter/lwpfribframe.cxx
+++ b/lotuswordpro/source/filter/lwpfribframe.cxx
@@ -204,7 +204,7 @@ void LwpFribFrame::XFConvert(XFContentContainer* pCont)
XFParagraph* pXFPara = new XFParagraph();
pXFPara->SetStyleName(m_StyleName);
m_pPara->AddXFContent(pXFPara);
- m_pPara->GetFribs()->SetXFPara(pXFPara);
+ m_pPara->GetFribs().SetXFPara(pXFPara);
}
}
diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx
index 5f3061521c35..b9d4658babc4 100644
--- a/lotuswordpro/source/filter/lwpfribmark.cxx
+++ b/lotuswordpro/source/filter/lwpfribmark.cxx
@@ -144,10 +144,10 @@ void LwpFribBookMark::RegisterStyle(LwpFoundry* pFoundry)
LwpDocument* pDoc = pFoundry->GetDocument();
if (pDoc)
{
- LwpObjectID* pID = pDoc->GetDivInfoID();
- if (!pID->IsNull())
+ LwpObjectID& rID = pDoc->GetDivInfoID();
+ if (!rID.IsNull())
{
- LwpDivInfo *pDivInvo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO).get());
+ LwpDivInfo *pDivInvo = dynamic_cast<LwpDivInfo*>(rID.obj(VO_DIVISIONINFO).get());
if (pDivInvo)
sDivision = pDivInvo->GetDivName();
}
diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx
index a6a1669a0635..4f3211a61dc0 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -222,7 +222,7 @@ void LwpFribPtr::XFConvert()
case FRIB_TAG_PAGEBREAK:
{
LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
- LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj().get());
+ LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout().obj().get());
if(pLayout)
{
pPageBreak->ParseLayout();
@@ -397,7 +397,7 @@ void LwpFribPtr::FindLayouts()
//StartWithinColume type not support now
break;
}
- LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
if (pStory)
pStory->AddPageLayout(pSection->GetPageLayout());
}
@@ -408,10 +408,10 @@ void LwpFribPtr::FindLayouts()
case FRIB_TAG_PAGEBREAK:
{
LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
- LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj().get());
+ LwpPageLayout* pLayout = dynamic_cast<LwpPageLayout*>(pPageBreak->GetLayout().obj().get());
if(pLayout)
{
- LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
if (pStory)
pStory->AddPageLayout(pLayout);
}
@@ -607,7 +607,7 @@ void LwpFribPtr::ProcessDropcap(LwpStory* pStory,LwpFrib* pFrib,sal_uInt32 nLen)
XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName());
pFribStyle->GetFont()->SetFontSize(0);
- LwpDropcapLayout* pObj = dynamic_cast<LwpDropcapLayout*>(pStory->GetLayoutsWithMe()->GetOnlyLayout()->obj().get());
+ LwpDropcapLayout* pObj = dynamic_cast<LwpDropcapLayout*>(pStory->GetLayoutsWithMe().GetOnlyLayout().obj().get());
if (pObj)
pObj->SetChars(nLen);
}
@@ -642,7 +642,7 @@ bool LwpFribPtr::ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLay
case FRIB_TAG_PAGEBREAK:
{
LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
- pLayout = dynamic_cast<LwpVirtualLayout*>(pPageBreak->GetLayout()->obj().get());
+ pLayout = dynamic_cast<LwpVirtualLayout*>(pPageBreak->GetLayout().obj().get());
break;
}
default:
diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx
index 1c9da63ceb1f..5cf7a1c0db4b 100644
--- a/lotuswordpro/source/filter/lwpfribsection.cxx
+++ b/lotuswordpro/source/filter/lwpfribsection.cxx
@@ -128,7 +128,7 @@ void LwpFribSection::SetSectionName()
LwpSection* pSection = GetSection();
if(pSection)
{
- LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
pStory->SetSectionName(pSection->GetSectionName());
}
}
@@ -166,7 +166,7 @@ void LwpFribSection::ParseSection()
}
else
{
- LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() );
+ LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID().obj().get() );
if (m_Section.obj()->GetTag() == VO_INDEXSECTION)
{
//create a new section and add it to container
@@ -259,7 +259,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
//if there is no other frib after current firb, register master page in starting para of next page
if(IsNextPageType()&&(!pFrib->HasNextFrib()))
{
- LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
pStory->SetCurrentLayout(m_pLayout);
RegisterFillerPageStyle();
return false;
@@ -290,7 +290,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
case LwpLayout::StartOnOddPage: //fall throught
case LwpLayout::StartOnEvenPage:
{
- LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
pStory->SetCurrentLayout(m_pLayout);
//get odd page layout when the current pagelayout is mirror
m_pLayout = pStory->GetCurrentLayout();
@@ -305,7 +305,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
}
//register tab style;
- LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
pStory->SetTabLayout(m_pLayout);
m_pPara->RegisterTabStyle(pOverStyle);
@@ -316,7 +316,7 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
{
XFSectionStyle* pSectStyle= new XFSectionStyle();
//set margin
- pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
if(pStory)
{
LwpPageLayout* pCurrentLayout = pStory->GetCurrentLayout();
@@ -348,7 +348,7 @@ bool LwpMasterPage::IsNeedSection()
{
bool bNewSection = false;
//get story
- LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID().obj().get());
//if pagelayout is modified, register the pagelayout
if(pStory->IsPMModified())
{
@@ -379,8 +379,8 @@ XFSection* LwpMasterPage::CreateXFSection()
*/
void LwpMasterPage::ParseSection(LwpFrib* pFrib)
{
- LwpFribPtr* pFribPtr = m_pPara->GetFribs();
- //XFParagraph * pXFPara = pFribPtr->GetXFPara();
+ LwpFribPtr& rFribPtr = m_pPara->GetFribs();
+ //XFParagraph * pXFPara = rFribPtr.GetXFPara();
//parse fillerpage text
if(m_pLayout->HasFillerPageText(m_pPara->GetFoundry()))
@@ -388,7 +388,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib)
XFParagraph *pPara = new XFParagraph();
pPara->SetStyleName(GetFillerPageStyleName());
m_pPara->AddXFContent(pPara);
- pFribPtr->SetXFPara(pPara);
+ rFribPtr.SetXFPara(pPara);
m_pLayout->ConvertFillerPageText(m_pPara->GetXFContainer());
}
@@ -396,9 +396,9 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib)
XFContentContainer* pContent = CreateXFSection();
if(pContent)
{
- LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() );
+ LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID().obj().get() );
//delete the additional blank para, 06/28/2005
- XFParagraph* pCurrPara = pFribPtr->GetXFPara();
+ XFParagraph* pCurrPara = rFribPtr.GetXFPara();
if(!pCurrPara->HasContents())
{
XFContentContainer* pCurrContainer = m_pPara->GetXFContainer();
@@ -412,7 +412,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib)
}
else
{
- LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj().get() );
+ LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID().obj().get() );
pContent = pStory->GetXFContent();
}
if(pContent)
@@ -425,7 +425,7 @@ void LwpMasterPage::ParseSection(LwpFrib* pFrib)
XFParagraph *pNextPara = new XFParagraph();
pNextPara->SetStyleName(GetStyleName());
m_pPara->AddXFContent(pNextPara);
- pFribPtr->SetXFPara(pNextPara);
+ rFribPtr.SetXFPara(pNextPara);
}
}
diff --git a/lotuswordpro/source/filter/lwpfribtable.cxx b/lotuswordpro/source/filter/lwpfribtable.cxx
index 8c722fc82f1d..500e44e3569c 100644
--- a/lotuswordpro/source/filter/lwpfribtable.cxx
+++ b/lotuswordpro/source/filter/lwpfribtable.cxx
@@ -107,7 +107,7 @@ void LwpFribTable::XFConvert(XFContentContainer* pCont)
{
pXFContentContainer = m_pPara->GetXFContainer();
//delete the additional blank para, 06/28/2005
- XFParagraph* pCurrPara = m_pPara->GetFribs()->GetXFPara();
+ XFParagraph* pCurrPara = m_pPara->GetFribs().GetXFPara();
if(!pCurrPara->HasContents())
{
if(pXFContentContainer->GetLastContent() == pCurrPara)
@@ -165,7 +165,7 @@ void LwpFribTable::XFConvert(XFContentContainer* pCont)
XFParagraph* pXFPara = new XFParagraph();
pXFPara->SetStyleName(m_StyleName);
m_pPara->AddXFContent(pXFPara);
- m_pPara->GetFribs()->SetXFPara(pXFPara);
+ m_pPara->GetFribs().SetXFPara(pXFPara);
}
}
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 7ec84d640ec5..a4db19a9539e 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -306,9 +306,9 @@ void LwpGraphicObject::CreateDrawObjects()
SvStream* pDrawObjStream = NULL;
// get graphic object's bento objet name
- LwpObjectID* pMyID = this->GetObjectID();
+ LwpObjectID& rMyID = this->GetObjectID();
std::string aGrfObjName;
- this->GetBentoNamebyID(pMyID, aGrfObjName);
+ this->GetBentoNamebyID(rMyID, aGrfObjName);
// get bento stream by the name
pBentoContainer->CreateGraphicStream(pDrawObjStream, aGrfObjName.c_str());
@@ -325,10 +325,10 @@ void LwpGraphicObject::CreateDrawObjects()
/**
* @descr create drawing object.
*/
-void LwpGraphicObject::GetBentoNamebyID(LwpObjectID* pMyID, std::string& rName)
+void LwpGraphicObject::GetBentoNamebyID(LwpObjectID& rMyID, std::string& rName)
{
- sal_uInt16 nHigh = pMyID->GetHigh();
- sal_uInt16 nLow = pMyID->GetLow();
+ sal_uInt16 nHigh = rMyID.GetHigh();
+ sal_uInt16 nLow = rMyID.GetLow();
char pTempStr[32];
rName = std::string("Gr");
sprintf(pTempStr, "%X,%X", nHigh, nLow);
@@ -358,9 +358,9 @@ sal_uInt32 LwpGraphicObject::GetRawGrafData(sal_uInt8*& pGrafData)
SvStream* pGrafStream = NULL;
// get graphic object's bento objet name
- LwpObjectID* pMyID = this->GetObjectID();
+ LwpObjectID& rMyID = this->GetObjectID();
std::string aGrfObjName;
- this->GetBentoNamebyID(pMyID, aGrfObjName);
+ this->GetBentoNamebyID(rMyID, aGrfObjName);
// get bento stream by the name
pBentoContainer->CreateGraphicStream(pGrafStream, aGrfObjName.c_str());
@@ -401,9 +401,9 @@ sal_uInt32 LwpGraphicObject::GetGrafData(sal_uInt8*& pGrafData)
SvStream* pGrafStream = NULL;
// get graphic object's bento objet name
- LwpObjectID* pMyID = this->GetObjectID();
+ LwpObjectID& rMyID = this->GetObjectID();
std::string aGrfObjName;
- this->GetBentoNamebyID(pMyID, aGrfObjName);
+ this->GetBentoNamebyID(rMyID, aGrfObjName);
char sDName[64]="";
sprintf(sDName, "%s-D", aGrfObjName.c_str());
@@ -457,9 +457,9 @@ void LwpGraphicObject::CreateGrafObject()
}
// set scale and crop styles
- LwpAssociatedLayouts* pLayoutWithMe = GetLayoutsWithMe();
+ LwpAssociatedLayouts& rLayoutWithMe = GetLayoutsWithMe();
LwpFrameLayout* pMyFrameLayout =
- static_cast<LwpFrameLayout*>(pLayoutWithMe->GetOnlyLayout()->obj(VO_FRAMELAYOUT).get());
+ static_cast<LwpFrameLayout*>(rLayoutWithMe.GetOnlyLayout().obj(VO_FRAMELAYOUT).get());
if (pMyFrameLayout)
{
LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale();
@@ -576,9 +576,9 @@ void LwpGraphicObject::CreateGrafObject()
pImageStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
// get image position offset
- LwpPoint* pOffset = pMyScale->GetOffset();
- double fOffsetX = LwpTools::ConvertFromUnitsToMetric(pOffset->GetX());
- double fOffsetY = LwpTools::ConvertFromUnitsToMetric(pOffset->GetY());
+ LwpPoint& rOffset = pMyScale->GetOffset();
+ double fOffsetX = LwpTools::ConvertFromUnitsToMetric(rOffset.GetX());
+ double fOffsetY = LwpTools::ConvertFromUnitsToMetric(rOffset.GetY());
struct LwpRect
{
@@ -653,10 +653,10 @@ void LwpGraphicObject::CreateGrafObject()
pImage->SetAnchorType(enumXFAnchorFrame);
// set object name
- LwpAtomHolder* pHolder = this->GetName();
- if ( pHolder && !pHolder->str().isEmpty() )
+ LwpAtomHolder& rHolder = this->GetName();
+ if ( !rHolder.str().isEmpty() )
{
- pImage->SetName(pHolder->str());
+ pImage->SetName(rHolder.str());
}
// insert image object into array
diff --git a/lotuswordpro/source/filter/lwpgrfobj.hxx b/lotuswordpro/source/filter/lwpgrfobj.hxx
index 18a2e23ace21..473a23fd2cc3 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.hxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.hxx
@@ -124,7 +124,7 @@ public:
// add by , 03/25/2005
void CreateDrawObjects();
void CreateGrafObject();
- void GetBentoNamebyID(LwpObjectID* pMyID, std::string& rName);
+ void GetBentoNamebyID(LwpObjectID& rMyID, std::string& rName);
sal_uInt32 GetRawGrafData(sal_uInt8*& pGrafData);
sal_uInt32 GetGrafData(sal_uInt8*& pGrafData);
void GetGrafOrgSize(long& rWidth, long& rHeight) { rWidth = m_Cache.Width; rHeight = m_Cache.Height; }
diff --git a/lotuswordpro/source/filter/lwpholder.hxx b/lotuswordpro/source/filter/lwpholder.hxx
index 6f52ffc4c203..b1f061187d76 100644
--- a/lotuswordpro/source/filter/lwpholder.hxx
+++ b/lotuswordpro/source/filter/lwpholder.hxx
@@ -76,7 +76,7 @@ class LwpDLVListHeadHolder : public LwpObject
public:
LwpDLVListHeadHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
void Read() SAL_OVERRIDE;
- LwpObjectID* GetHeadID() { return &m_DLVHead;}
+ LwpObjectID& GetHeadID() { return m_DLVHead;}
private:
virtual ~LwpDLVListHeadHolder(){}
@@ -91,8 +91,8 @@ class LwpDLVListHeadTailHolder : public LwpObject
public:
LwpDLVListHeadTailHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
void Read() SAL_OVERRIDE;
- LwpObjectID* GetHead(){ return m_HeadTail.GetHead();}
- LwpObjectID* GetTail(){ return m_HeadTail.GetTail();}
+ LwpObjectID& GetHead(){ return m_HeadTail.GetHead();}
+ LwpObjectID& GetTail(){ return m_HeadTail.GetTail();}
protected:
LwpDLVListHeadTail m_HeadTail;
private:
@@ -107,7 +107,7 @@ class LwpObjectHolder : public LwpDLVList
public:
LwpObjectHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
void Read() SAL_OVERRIDE;
- LwpObjectID* GetObject(){return &m_Object;}
+ LwpObjectID& GetObject() { return m_Object; }
protected:
virtual ~LwpObjectHolder(){}
@@ -123,8 +123,8 @@ class LwpListList : public LwpObjectHolder
public:
LwpListList(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
void Read() SAL_OVERRIDE;
- LwpObjectID* GetHead(){ return m_HeadTail.GetHead();}
- LwpObjectID* GetTail(){ return m_HeadTail.GetTail();}
+ LwpObjectID& GetHead(){ return m_HeadTail.GetHead();}
+ LwpObjectID& GetTail(){ return m_HeadTail.GetTail();}
protected:
LwpDLVListHeadTail m_HeadTail;
private:
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 9bf661bed57e..2aa4dc765ba2 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -143,7 +143,7 @@ bool LwpVirtualLayout::HonorProtection()
if(!(m_nAttributes2 & STYLE2_HONORPROTECTION))
return false;
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader())
{
return pParent->HonorProtection();
@@ -171,7 +171,7 @@ bool LwpVirtualLayout::IsProtected()
{
bool bProtected = (m_nAttributes & STYLE_PROTECTED)!=0;
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader())
{
if(pParent->HonorProtection()&&(pParent->HasProtection()||bProtected))
@@ -203,7 +203,7 @@ bool LwpVirtualLayout::HasProtection()
if(m_nAttributes & STYLE_PROTECTED)
return true;
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader())
{
return pParent->HasProtection();
@@ -234,7 +234,7 @@ LwpUseWhen* LwpVirtualLayout::GetUseWhen()
if(GetLayoutType()!=LWP_PAGE_LAYOUT)
{
//get parent
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader()&& (pParent->GetLayoutType()!=LWP_PAGE_LAYOUT))
return pParent->GetUseWhen();
@@ -346,7 +346,7 @@ bool LwpVirtualLayout::IsMinimumHeight()
*/
LwpVirtualLayout* LwpVirtualLayout::GetParentLayout()
{
- return dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ return dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
}
/**
@@ -356,12 +356,12 @@ LwpVirtualLayout* LwpVirtualLayout::GetParentLayout()
void LwpVirtualLayout::RegisterChildStyle()
{
//Register all children styles
- LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLayout)
{
pLayout->SetFoundry(m_pFoundry);
pLayout->RegisterStyle();
- pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get());
+ pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get());
}
}
@@ -375,7 +375,7 @@ bool LwpVirtualLayout::IsStyleLayout()
if (m_nAttributes3 & STYLE3_STYLELAYOUT)
return true;
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*>(GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get());
if (pParent)
return pParent->IsStyleLayout();
return false;
@@ -387,11 +387,11 @@ bool LwpVirtualLayout::IsStyleLayout()
*/
LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
{
- LwpObjectID *pID = GetChildHead();
+ LwpObjectID& rID = GetChildHead();
- while(pID && !pID->IsNull())
+ while(!rID.IsNull())
{
- LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(pID->obj().get());
+ LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get());
if(!pLayout)
{
break;
@@ -401,7 +401,7 @@ LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
{
return pLayout;
}
- pID = pLayout->GetNext();
+ rID = pLayout->GetNext();
}
return NULL;
@@ -453,28 +453,28 @@ LwpVirtualLayout* LwpAssociatedLayouts::GetLayout(LwpVirtualLayout *pStartLayout
/* Looking for the first layout and there's only one layout in the list.*/
return dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj().get());
- LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead()->obj().get());
+ LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead().obj().get());
if(pObjHolder)
{
- pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get());
+ pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get());
if(!pStartLayout )
return pLayout;
while(pObjHolder && pStartLayout != pLayout)
{
- pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj().get());
+ pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext().obj().get());
if(pObjHolder)
{
- pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get());
+ pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get());
}
}
if(pObjHolder)
{
- pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj().get());
+ pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext().obj().get());
if(pObjHolder)
{
- pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj().get());
+ pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get());
return pLayout;
}
}
@@ -501,7 +501,7 @@ void LwpHeadLayout::Read()
void LwpHeadLayout::RegisterStyle()
{
//Register all children styles
- LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLayout)
{
pLayout->SetFoundry(m_pFoundry);
@@ -515,7 +515,7 @@ void LwpHeadLayout::RegisterStyle()
}
pLayout->RegisterStyle();
}
- LwpVirtualLayout *pNext = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get());
+ LwpVirtualLayout *pNext = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get());
if (pNext == pLayout)
{
OSL_FAIL("Layout points to itself");
@@ -531,14 +531,14 @@ void LwpHeadLayout::RegisterStyle()
*/
LwpVirtualLayout* LwpHeadLayout::FindEnSuperTableLayout()
{
- LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLayout)
{
if(pLayout->GetLayoutType() == LWP_ENDNOTE_SUPERTABLE_LAYOUT)
{
return pLayout;
}
- pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj().get());
+ pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get());
}
return NULL;
}
@@ -731,7 +731,7 @@ double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide)
{
if ( MarginsSameAsParent() )
{
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader())
{
fValue = pParent->GetMarginsValue(nWhichSide);
@@ -745,7 +745,7 @@ double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide)
LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj().get());
if(pMar1)
{
- fValue = pMar1->GetMargins()->GetMarginsValue(nWhichSide);
+ fValue = pMar1->GetMargins().GetMarginsValue(nWhichSide);
return fValue;
}
}
@@ -771,7 +771,7 @@ double LwpMiddleLayout::GetExtMarginsValue(const sal_uInt8 &nWhichSide)
LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*> (m_LayMargins.obj().get());
if(pMar1)
{
- fValue = pMar1->GetExtMargins()->GetMarginsValue(nWhichSide);
+ fValue = pMar1->GetExtMargins().GetMarginsValue(nWhichSide);
return fValue;
}
}
@@ -794,7 +794,7 @@ LwpBorderStuff* LwpMiddleLayout::GetBorderStuff()
if(m_nOverrideFlag & OVER_BORDERS)
{
LwpLayoutBorder* pLayoutBorder = dynamic_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj().get());
- return pLayoutBorder ? pLayoutBorder->GetBorderStuff() : NULL;
+ return pLayoutBorder ? &pLayoutBorder->GetBorderStuff() : NULL;
}
else if( !m_BasedOnStyle.IsNull() )
{
@@ -815,7 +815,7 @@ LwpBackgroundStuff* LwpMiddleLayout::GetBackgroundStuff()
if(m_nOverrideFlag & OVER_BACKGROUND)
{
LwpLayoutBackground* pLayoutBackground = dynamic_cast<LwpLayoutBackground*>(m_LayBackgroundStuff.obj().get());
- return pLayoutBackground ? pLayoutBackground->GetBackgoudStuff() : NULL;
+ return pLayoutBackground ? &pLayoutBackground->GetBackgoudStuff() : NULL;
}
else if( !m_BasedOnStyle.IsNull() )
{
@@ -1279,7 +1279,7 @@ bool LwpMiddleLayout::HonorProtection()
if(!(m_nAttributes2 & STYLE2_HONORPROTECTION))
return false;
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader())
{
return pParent->HonorProtection();
@@ -1323,7 +1323,7 @@ bool LwpMiddleLayout::IsProtected()
else
bProtected = LwpVirtualLayout::IsProtected();
- LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent()->obj().get());
+ LwpVirtualLayout* pParent = dynamic_cast<LwpVirtualLayout*> (GetParent().obj().get());
if(pParent && !pParent->IsHeader())
{
/* If a parent's protected then none of its children can be accessed. */
@@ -1359,14 +1359,14 @@ bool LwpMiddleLayout::IsProtected()
*/
LwpVirtualLayout* LwpMiddleLayout::GetWaterMarkLayout()
{
- LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
{
if( pLay->IsForWaterMark())
{
return pLay;
}
- pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get());
+ pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
}
return NULL;
}
@@ -1381,7 +1381,7 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage()
if(pLay)
{
//test BGImage
- LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent()->obj().get());
+ LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent().obj().get());
if(pGrfObj)
{
XFBGImage* pXFBGImage = new XFBGImage();
@@ -1850,7 +1850,7 @@ LwpShadow* LwpLayout::GetShadow()
if(m_nOverrideFlag & OVER_SHADOW)
{
LwpLayoutShadow* pLayoutShadow = dynamic_cast<LwpLayoutShadow*>(m_LayShadow.obj().get());
- return pLayoutShadow ? pLayoutShadow->GetShadow() : NULL;
+ return pLayoutShadow ? &pLayoutShadow->GetShadow() : NULL;
}
else if( !m_BasedOnStyle.IsNull() )
{
@@ -1923,7 +1923,7 @@ LwpVirtualLayout* LwpLayout::GetContainerLayout()
if(IsRelativeAnchored())
{
//get position
- LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj().get());
+ LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition().obj().get());
if(pPara)
{
LwpStory* pStory = pPara->GetStory();
@@ -2038,7 +2038,7 @@ sal_uInt8 LwpPlacableLayout::GetRelativeType()
LwpLayoutRelativity* pLayRel = GetRelativityPiece();
if(pLayRel)
{
- return pLayRel->GetRelGuts()->GetRelativeType();
+ return pLayRel->GetRelGuts().GetRelativeType();
}
return LwpVirtualLayout::GetRelativeType();
}
diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx
index 38c667377487..e1ffb4fc8b87 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -228,8 +228,8 @@ public:
LwpAssociatedLayouts(){}
public:
void Read(LwpObjectStream* pStrm);
- LwpObjectID* GetOnlyLayout(){return &m_OnlyLayout;}
- LwpDLVListHeadTail* GetLayouts(){return &m_Layouts;}
+ LwpObjectID& GetOnlyLayout() { return m_OnlyLayout;}
+ LwpDLVListHeadTail& GetLayouts() { return m_Layouts;}
LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout);
protected:
LwpObjectID m_OnlyLayout; //LwpVirtualLayout
@@ -348,7 +348,7 @@ protected:
LwpObjectID m_LayBackgroundStuff;
LwpObjectID m_LayExtBorderStuff;
public:
- LwpObjectID* GetContent(){return &m_Content;}
+ LwpObjectID& GetContent() { return m_Content; }
LwpTabOverride* GetTabOverride();
};
@@ -393,7 +393,7 @@ public:
virtual bool IsUseOnAllEvenPages() SAL_OVERRIDE;
virtual bool IsUseOnAllOddPages() SAL_OVERRIDE;
virtual bool IsUseOnPage() SAL_OVERRIDE;
- LwpObjectID* GetPosition(){ return &m_Positon;}
+ LwpObjectID& GetPosition(){ return m_Positon;}
virtual LwpVirtualLayout* GetContainerLayout() SAL_OVERRIDE;
};
diff --git a/lotuswordpro/source/filter/lwplaypiece.hxx b/lotuswordpro/source/filter/lwplaypiece.hxx
index fbecee1c3f4f..20e3a3d83240 100644
--- a/lotuswordpro/source/filter/lwplaypiece.hxx
+++ b/lotuswordpro/source/filter/lwplaypiece.hxx
@@ -121,7 +121,7 @@ public:
void SetContentRotation(sal_uInt16 nVal){m_nContentRotation = nVal;}
sal_uInt16 GetPlacement(){return m_nPlacement;}
void SetPlacement(sal_uInt16 nVal){m_nPlacement = nVal;}
- inline LwpPoint* GetOffset() {return &m_Offset;}
+ inline LwpPoint& GetOffset() {return m_Offset;}
protected:
virtual void Read() SAL_OVERRIDE;
protected:
@@ -143,8 +143,8 @@ class LwpLayoutMargins : public LwpVirtualPiece
public:
LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpMargins* GetMargins() { return &m_Margins; }
- LwpMargins* GetExtMargins(){ return &m_ExtMargins;}
+ LwpMargins& GetMargins() { return m_Margins; }
+ LwpMargins& GetExtMargins(){ return m_ExtMargins;}
protected:
virtual void Read() SAL_OVERRIDE;
protected:
@@ -161,7 +161,7 @@ class LwpLayoutBorder : public LwpVirtualPiece
public:
LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
+ LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
protected:
virtual void Read() SAL_OVERRIDE;
protected:
@@ -175,7 +175,7 @@ class LwpLayoutBackground : public LwpVirtualPiece
public:
LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpBackgroundStuff* GetBackgoudStuff(){return &m_BackgroundStuff;}
+ LwpBackgroundStuff& GetBackgoudStuff(){return m_BackgroundStuff;}
protected:
virtual void Read() SAL_OVERRIDE;
protected:
@@ -323,7 +323,7 @@ class LwpLayoutShadow : public LwpVirtualPiece
public:
LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpShadow* GetShadow(){return &m_Shadow;}
+ LwpShadow& GetShadow() { return m_Shadow; }
protected:
virtual void Read() SAL_OVERRIDE;
protected:
@@ -384,7 +384,7 @@ class LwpLayoutRelativity: public LwpVirtualPiece
public:
LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpLayoutRelativityGuts* GetRelGuts(){return &m_RelGuts;}
+ LwpLayoutRelativityGuts& GetRelGuts() { return m_RelGuts; }
protected:
virtual void Read() SAL_OVERRIDE;
protected:
diff --git a/lotuswordpro/source/filter/lwpmarker.cxx b/lotuswordpro/source/filter/lwpmarker.cxx
index 6ef0395bc935..c7f55d339a18 100644
--- a/lotuswordpro/source/filter/lwpmarker.cxx
+++ b/lotuswordpro/source/filter/lwpmarker.cxx
@@ -351,10 +351,7 @@ bool LwpBookMark::IsRightMarker(LwpObjectID objMarker)
OUString LwpBookMark::GetName()
{
- if (LwpDLNFVList::GetName())
- return LwpDLNFVList::GetName()->str();
- else
- return OUString("");
+ return LwpDLNFVList::GetName().str();
}
LwpFieldMark::LwpFieldMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
diff --git a/lotuswordpro/source/filter/lwpnotes.cxx b/lotuswordpro/source/filter/lwpnotes.cxx
index 542943a0b22c..c78fb4f10b3c 100644
--- a/lotuswordpro/source/filter/lwpnotes.cxx
+++ b/lotuswordpro/source/filter/lwpnotes.cxx
@@ -217,10 +217,10 @@ OUString LwpNoteLayout::GetAuthor()
LwpNoteHeaderLayout* pTextLayout = static_cast<LwpNoteHeaderLayout*>(FindChildByType(LWP_NOTEHEADER_LAYOUT));
if(pTextLayout)
{
- LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent()->obj().get());
+ LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent().obj().get());
if(pStory)
{
- LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get());
+ LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara().obj().get());
if(pFirst)
return pFirst->GetContentText(true);
}
diff --git a/lotuswordpro/source/filter/lwpobj.hxx b/lotuswordpro/source/filter/lwpobj.hxx
index 12b68d72deb7..e1ebad5a9362 100644
--- a/lotuswordpro/source/filter/lwpobj.hxx
+++ b/lotuswordpro/source/filter/lwpobj.hxx
@@ -103,7 +103,7 @@ public:
LwpFoundry* GetFoundry(){return m_pFoundry;}
void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
- LwpObjectID* GetObjectID(){ return m_ObjHdr.GetID();}
+ LwpObjectID& GetObjectID(){ return m_ObjHdr.GetID();}
sal_uInt32 GetTag() { return m_ObjHdr.GetTag();}
LwpSvStream* GetStream() { return m_pStrm; }
};
diff --git a/lotuswordpro/source/filter/lwpobjfactory.cxx b/lotuswordpro/source/filter/lwpobjfactory.cxx
index 305024078376..13635c588fd3 100644
--- a/lotuswordpro/source/filter/lwpobjfactory.cxx
+++ b/lotuswordpro/source/filter/lwpobjfactory.cxx
@@ -674,7 +674,7 @@ rtl::Reference<LwpObject> LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObj
if(newObj.is())
{
newObj->QuickRead();
- m_IdToObjList.insert(LwpIdToObjMap::value_type(*objHdr.GetID(), newObj));
+ m_IdToObjList.insert(LwpIdToObjMap::value_type(objHdr.GetID(), newObj));
}
return(newObj);
@@ -700,8 +700,8 @@ rtl::Reference<LwpObject> LwpObjectFactory::QueryObject(const LwpObjectID &objID
if (!objHdr.Read(*m_pSvStream))
return NULL;
- LwpObjectID* pId = objHdr.GetID();
- if (pId && (*pId != objID))
+ LwpObjectID& rId = objHdr.GetID();
+ if (rId != objID)
{
OSL_FAIL("apparently incorrect objid, invalidating");
return NULL;
diff --git a/lotuswordpro/source/filter/lwpobjfactory.hxx b/lotuswordpro/source/filter/lwpobjfactory.hxx
index 7cbc56d118a6..1819db3819f9 100644
--- a/lotuswordpro/source/filter/lwpobjfactory.hxx
+++ b/lotuswordpro/source/filter/lwpobjfactory.hxx
@@ -117,7 +117,7 @@ public:
rtl::Reference<LwpObject> QueryObject(const LwpObjectID &objID);
void ReleaseObject(const LwpObjectID &objID);
void ReadIndex(LwpSvStream* pStrm);
- LwpIndexManager* GetIndexManager(){return &m_IndexMgr;}
+ LwpIndexManager& GetIndexManager(){return m_IndexMgr;}
};
diff --git a/lotuswordpro/source/filter/lwpobjhdr.hxx b/lotuswordpro/source/filter/lwpobjhdr.hxx
index b416cd1fe36b..3adccead48bb 100644
--- a/lotuswordpro/source/filter/lwpobjhdr.hxx
+++ b/lotuswordpro/source/filter/lwpobjhdr.hxx
@@ -114,7 +114,7 @@ public:
bool Read(LwpSvStream &pStrm);
inline sal_uInt32 GetTag();
inline sal_uInt32 GetSize();
- inline LwpObjectID* GetID();
+ inline LwpObjectID& GetID();
inline bool IsCompressed();
};
@@ -126,9 +126,9 @@ inline sal_uInt32 LwpObjectHeader::GetSize()
{
return m_nSize;
}
-inline LwpObjectID* LwpObjectHeader::GetID()
+inline LwpObjectID& LwpObjectHeader::GetID()
{
- return &m_ID;
+ return m_ID;
}
inline bool LwpObjectHeader::IsCompressed()
{
diff --git a/lotuswordpro/source/filter/lwpobjid.cxx b/lotuswordpro/source/filter/lwpobjid.cxx
index 9a2ea6715db8..0c64f91a70a9 100644
--- a/lotuswordpro/source/filter/lwpobjid.cxx
+++ b/lotuswordpro/source/filter/lwpobjid.cxx
@@ -112,8 +112,8 @@ sal_uInt32 LwpObjectID::ReadIndexed(LwpSvStream *pStrm)
//m_nLow = index; //note the m_nLow stores the index instead of the actual time id
LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
LwpObjectFactory* pFactory = pGlobal->GetLwpObjFactory();
- LwpIndexManager* pIdxMgr = pFactory->GetIndexManager();
- m_nLow = pIdxMgr->GetObjTime( (sal_uInt16)m_nIndex);
+ LwpIndexManager& rIdxMgr = pFactory->GetIndexManager();
+ m_nLow = rIdxMgr.GetObjTime( (sal_uInt16)m_nIndex);
}
else
{
@@ -143,8 +143,8 @@ sal_uInt32 LwpObjectID::ReadIndexed(LwpObjectStream *pStrm)
//m_nLow = index; //note the m_nLow stores the index instead of the actual time id
LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
LwpObjectFactory* pFactory = pGlobal->GetLwpObjFactory();
- LwpIndexManager* pIdxMgr = pFactory->GetIndexManager();
- m_nLow = pIdxMgr->GetObjTime( (sal_uInt16)m_nIndex);
+ LwpIndexManager& rIdxMgr = pFactory->GetIndexManager();
+ m_nLow = rIdxMgr.GetObjTime( (sal_uInt16)m_nIndex);
}
else
m_nLow = pStrm->QuickReaduInt32();
diff --git a/lotuswordpro/source/filter/lwppagehint.hxx b/lotuswordpro/source/filter/lwppagehint.hxx
index 2d4f55b31f2f..e37153c9f835 100644
--- a/lotuswordpro/source/filter/lwppagehint.hxx
+++ b/lotuswordpro/source/filter/lwppagehint.hxx
@@ -103,9 +103,9 @@ public:
void Read() SAL_OVERRIDE;
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
sal_uInt16 GetPageNumber(){return m_nPageNumber;}
- LwpObjectID* GetCurrentSectionID(){return &m_CurrentSection;}
+ LwpObjectID& GetCurrentSectionID(){return m_CurrentSection;}
sal_uInt16 GetCurrentSectionPage(){return m_nCurrentSectionPage;}
- LwpObjectID* GetPageLayoutID(){ return &m_PageLayout;}
+ LwpObjectID& GetPageLayoutID(){ return m_PageLayout;}
sal_uInt16 GetLayoutPageNumber(){ return m_nLayoutPageNumber;}
private:
virtual ~LwpPageHint(){}
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index 631a1ad033a6..915621c2f129 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -275,28 +275,28 @@ void LwpPageLayout::ParseFootNoteSeparator(XFPageMaster * pm1)
LwpFootnoteOptions* pFootnoteOpts = pFontnodeId ? dynamic_cast<LwpFootnoteOptions*>(pFontnodeId->obj().get()) : NULL;
if(pFootnoteOpts)
{
- LwpFootnoteSeparatorOptions* pFootnoteSep = pFootnoteOpts->GetFootnoteSeparator();
+ LwpFootnoteSeparatorOptions& rFootnoteSep = pFootnoteOpts->GetFootnoteSeparator();
//set length
sal_uInt32 nLengthPercent = 100;
double fWidth = 0;
- if(pFootnoteSep->HasSeparator())
+ if(rFootnoteSep.HasSeparator())
{
- fWidth = pFootnoteSep->GetTopBorderWidth();
+ fWidth = rFootnoteSep.GetTopBorderWidth();
}
- if(pFootnoteSep->HasCustomLength())
+ if(rFootnoteSep.HasCustomLength())
{
- nLengthPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetLength())/GetMarginWidth());
+ nLengthPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetLength())/GetMarginWidth());
if(nLengthPercent > 100)
nLengthPercent = 100;
}
- double fAbove = LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetAbove());
- double fBelow = LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetBelow());
- LwpColor aColor = pFootnoteSep->GetTopBorderColor();
+ double fAbove = LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetAbove());
+ double fBelow = LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetBelow());
+ LwpColor aColor = rFootnoteSep.GetTopBorderColor();
enumXFAlignType eAlignType = enumXFAlignStart;
- if(pFootnoteSep->GetIndent() > 0)
+ if(rFootnoteSep.GetIndent() > 0)
{
//SODC don't support indent
- sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetIndent())/GetMarginWidth());
+ sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetIndent())/GetMarginWidth());
if(nIndentPercent + nLengthPercent >= 100)
eAlignType = enumXFAlignEnd;
}
@@ -343,7 +343,7 @@ void LwpPageLayout::RegisterStyle()
//Add master page
XFMasterPage* mp1 = new XFMasterPage();
- mp1->SetStyleName(GetName()->str());
+ mp1->SetStyleName(GetName().str());
mp1->SetPageMaster(pmname);
mp1 = (XFMasterPage*)pXFStyleManager->AddStyle(mp1);
m_StyleName = mp1->GetStyleName();
@@ -482,8 +482,8 @@ void LwpPageLayout::ConvertFillerPageText(XFContentContainer* pCont)
{
//get filerpage story from division info
LwpDocument* pDoc = m_pFoundry->GetDocument();
- LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pDoc->GetDivInfoID()->obj().get());
- LwpStory* pStory = dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID()->obj().get());
+ LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pDoc->GetDivInfoID().obj().get());
+ LwpStory* pStory = dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID().obj().get());
//parse fillerpage story
if(pStory)
@@ -506,24 +506,24 @@ void LwpPageLayout::ResetXFColumns()
LwpHeaderLayout* LwpPageLayout::GetHeaderLayout()
{
- LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
{
if( pLay->GetLayoutType() == LWP_HEADER_LAYOUT )
return ( static_cast<LwpHeaderLayout*> (pLay) );
- pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get());
+ pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
}
return NULL;
}
LwpFooterLayout* LwpPageLayout::GetFooterLayout()
{
- LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
{
if( pLay->GetLayoutType() == LWP_FOOTER_LAYOUT )
return ( static_cast<LwpFooterLayout*> (pLay) );
- pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get());
+ pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
}
return NULL;
}
@@ -536,7 +536,7 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout()
{
if(IsComplex())
{
- LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead()->obj().get());
+ LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
{
if( pLay->GetLayoutType() == LWP_PAGE_LAYOUT )
@@ -548,7 +548,7 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout()
return pPageLayout;
}
}
- pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext()->obj().get());
+ pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
}
}
return NULL;
@@ -580,14 +580,14 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber)
sal_Int16 nPageNumber = -1;
LwpFoundry* pFoundry = this->GetFoundry();
LwpDocument* pDoc = pFoundry->GetDocument();
- LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(pDoc->GetPageHintsID()->obj().get());
+ LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(pDoc->GetPageHintsID().obj().get());
if(!pHeadTail) return nPageNumber;
//get first pagehint
- LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead()->obj().get());
+ LwpPageHint* pPageHint = dynamic_cast<LwpPageHint*>(pHeadTail->GetHead().obj().get());
while(pPageHint)
{
- if(*(this->GetObjectID()) == *(pPageHint->GetPageLayoutID()))
+ if(this->GetObjectID() == pPageHint->GetPageLayoutID())
{
sal_uInt16 nNumber = pPageHint->GetPageNumber();
if(nLayoutNumber==FIRST_LAYOUTPAGENO && pPageHint->GetLayoutPageNumber()==1)
@@ -600,7 +600,7 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber)
{
//get the last page number
nPageNumber = nNumber;
- if(pPageHint->GetNext()->IsNull())
+ if(pPageHint->GetNext().IsNull())
{
//if is last page number of entire document, reture directly
return nPageNumber + pDoc->GetNumberOfPagesBefore();
@@ -614,7 +614,7 @@ sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber)
}
}
- pPageHint = dynamic_cast<LwpPageHint*>(pPageHint->GetNext()->obj().get());
+ pPageHint = dynamic_cast<LwpPageHint*>(pPageHint->GetNext().obj().get());
}
if(nPageNumber>=0)
{
@@ -715,7 +715,7 @@ bool LwpPageLayout::operator<(LwpPageLayout& Other)
*/
LwpPara* LwpPageLayout::GetPagePosition()
{
- LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition()->obj().get());
+ LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition().obj().get());
if(pPara)
return pPara;
//Get the position from its related section
@@ -726,7 +726,7 @@ LwpPara* LwpPageLayout::GetPagePosition()
while( (pSection = pFoundry->EnumSections(pSection)) )
{
if(pSection->GetPageLayout() == this)
- return dynamic_cast<LwpPara*>(pSection->GetPosition()->obj().get());
+ return dynamic_cast<LwpPara*>(pSection->GetPosition().obj().get());
}
}
@@ -788,7 +788,7 @@ void LwpHeaderLayout::ParseMargins(XFHeaderStyle* ph1)
}
//Set left,right,bottom margins
- LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj().get());
+ LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent().obj().get());
//left margin in SODC: the space from the left edge of body to the left edge of header
double left = GetMarginsValue(MARGIN_LEFT) - (parent ? parent->GetMarginsValue(MARGIN_LEFT) : 0);
if(left<=0) //The left margin in SODC can not be minus value
@@ -954,7 +954,7 @@ void LwpFooterLayout::ParseMargins(XFFooterStyle* pFooterStyle)
}
//Set left,right,top margins
- LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent()->obj().get());
+ LwpMiddleLayout* parent = dynamic_cast<LwpMiddleLayout*> (GetParent().obj().get());
double left = GetMarginsValue(MARGIN_LEFT) - (parent ? parent->GetMarginsValue(MARGIN_LEFT) : 0);
if(left<=0) //The left margin in SODC can not be minus value
{
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index 3baceb91cf43..3fbf44ef9a85 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -199,7 +199,7 @@ void LwpPara::Read()
if (Notify)
{
LwpForked3NotifyList* pNotifyList = new LwpForked3NotifyList();
- pNotifyList->GetExtraList()->Read(m_pObjStrm);
+ pNotifyList->GetExtraList().Read(m_pObjStrm);
pNotifyList->Read(m_pObjStrm);
delete pNotifyList;
}
@@ -477,17 +477,17 @@ void LwpPara::RegisterStyle()
LwpBackgroundOverride* pBGOver = static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground();
if (pBGOver)
{
- LwpBackgroundStuff* pBGStuff = pBGOver->GetBGStuff();
- if (pBGStuff && !pBGStuff->IsTransparent() )
+ LwpBackgroundStuff& rBGStuff = pBGOver->GetBGStuff();
+ if (!rBGStuff.IsTransparent() )
{
- if (pBGStuff->IsPatternFill())
+ if (rBGStuff.IsPatternFill())
{
- XFBGImage* pXFBGImage = pBGStuff->GetFillPattern();
+ XFBGImage* pXFBGImage = rBGStuff.GetFillPattern();
pOverStyle->SetBackImage(pXFBGImage);
}
else
{
- LwpColor* pColor = pBGStuff->GetFillColor();
+ LwpColor* pColor = rBGStuff.GetFillColor();
if (pColor && pColor->IsValidColor())
{
XFColor aXFColor( pColor->To24Color());
@@ -605,7 +605,7 @@ void LwpPara::RegisterStyle()
pParaSilverBullet = pPara->GetSilverBullet();
pNumbering = pPara->GetParaNumbering();
- if (*(pPara->GetObjectID()) != *(this->GetObjectID()))
+ if (pPara->GetObjectID() != this->GetObjectID())
{
if (!pParaSilverBullet)
{
@@ -625,7 +625,7 @@ void LwpPara::RegisterStyle()
break;
}
if ((pNumbering->GetLevel() == nFoundLevel)
- && (*(pParaSilverBullet->GetObjectID()) != *(m_pSilverBullet->GetObjectID())
+ && (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID()
|| pNumbering->GetPosition() != nPosition))
{
break;
@@ -634,7 +634,7 @@ void LwpPara::RegisterStyle()
else
{
if (pNumbering && pNumbering->GetLevel() < nFoundBound && pParaSilverBullet
- && (*(pParaSilverBullet->GetObjectID()) != *(m_pSilverBullet->GetObjectID())
+ && (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID()
|| pNumbering->GetPosition() != nPosition))
{
nFoundBound = pNumbering->GetLevel();
@@ -659,7 +659,7 @@ void LwpPara::RegisterStyle()
if (m_pBullOver->IsSkip())
;
else if ( pParaSilverBullet
- && *(pParaSilverBullet->GetObjectID()) == *(m_pSilverBullet->GetObjectID())
+ && pParaSilverBullet->GetObjectID() == m_pSilverBullet->GetObjectID()
&& pNumbering && nPosition == pNumbering->GetPosition())
{
if (bLesser)
@@ -690,10 +690,7 @@ void LwpPara::RegisterStyle()
}
}
- if (pPara->GetPrevious())
- pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj(VO_PARA).get());
- else
- pPrePara=NULL;
+ pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj(VO_PARA).get());
if (!pPrePara)
{
@@ -748,9 +745,9 @@ void LwpPara::RegisterStyle()
}
//end add
- if (noSpacing && GetPrevious())
+ if (noSpacing)
{
- LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious()->obj().get());
+ LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious().obj().get());
if (pPrePara && pPrePara->GetBelowSpacing()!=0)
{
pOverStyle = new XFParaStyle;
diff --git a/lotuswordpro/source/filter/lwppara.hxx b/lotuswordpro/source/filter/lwppara.hxx
index 7482fe188aee..eaf8c152c8f0 100644
--- a/lotuswordpro/source/filter/lwppara.hxx
+++ b/lotuswordpro/source/filter/lwppara.hxx
@@ -107,7 +107,7 @@ protected:
LwpNotifyListPersistent m_ExtraList;
LwpNotifyListPersistent m_PersistentList;
public:
- LwpNotifyListPersistent* GetExtraList(){return &m_ExtraList;}
+ LwpNotifyListPersistent& GetExtraList() { return m_ExtraList; }
void Read(LwpObjectStream* pObjStrm);
};
@@ -156,7 +156,7 @@ public:
void Release();
LwpPara* GetParent();
- LwpObjectID* GetStoryID();
+ LwpObjectID& GetStoryID();
LwpStory* GetStory();
LwpBreaksOverride* GetBreaks();
@@ -174,7 +174,7 @@ public:
bool GetBulletFlag() const;
void GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering);
- LwpFribPtr* GetFribs();
+ LwpFribPtr& GetFribs();
double GetBelowSpacing();
LwpParaProperty* GetProperty(sal_uInt32 nPropType);
void GatherDropcapInfo();
@@ -328,9 +328,9 @@ inline bool LwpPara::GetBulletFlag() const
{
return m_bHasBullet;
}
-inline LwpFribPtr* LwpPara::GetFribs()
+inline LwpFribPtr& LwpPara::GetFribs()
{
- return &m_Fribs;
+ return m_Fribs;
}
inline LwpBreaksOverride* LwpPara::GetBreaks()
{
@@ -362,9 +362,9 @@ inline void LwpPara::SetIndent(LwpIndentOverride* pIndentOverride)
delete m_pIndentOverride;
m_pIndentOverride = pIndentOverride;
}
-inline LwpObjectID* LwpPara::GetStoryID()
+inline LwpObjectID& LwpPara::GetStoryID()
{
- return &m_Story;
+ return m_Story;
}
inline LwpStory* LwpPara::GetStory()
{
diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx
index 15ddf4e02f08..b508c6cc01e9 100644
--- a/lotuswordpro/source/filter/lwppara1.cxx
+++ b/lotuswordpro/source/filter/lwppara1.cxx
@@ -175,13 +175,13 @@ LwpPara* LwpPara::GetParent()
if (level != 1)
{
- pPara = dynamic_cast<LwpPara*>(GetPrevious()->obj().get());
+ pPara = dynamic_cast<LwpPara*>(GetPrevious().obj().get());
while (pPara)
{
otherlevel = pPara->GetLevel();
if ((otherlevel < level) || (otherlevel && (level == 0)))
return pPara;
- pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj().get());
+ pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get());
}
}
return NULL;
@@ -569,7 +569,7 @@ void LwpPara::FindLayouts()
{
m_Fribs.SetPara(this);
m_Fribs.FindLayouts();
- LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext()->obj().get());
+ LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext().obj().get());
if(pNextPara)
{
pNextPara->FindLayouts();
diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx
index 47aa89be8050..a44d0ae8c73f 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -589,7 +589,7 @@ void LwpParaStyle::ApplySpacing(LwpPara* pPara, XFParaStyle* pParaStyle, LwpSpac
{
if (below_val != -1)
pPara->SetBelowSpacing(below_val);
- LwpPara* pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj().get());
+ LwpPara* pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get());
if (pPrePara && above_val != -1)
{
above_val += pPrePara->GetBelowSpacing();
@@ -608,14 +608,14 @@ void LwpParaStyle::ApplySpacing(LwpPara* pPara, XFParaStyle* pParaStyle, LwpSpac
**************************************************************************/
void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTabOverRide)
{
- LwpObjectID* pTabRackID = pTabOverRide->GetTabRackID();
- if(pTabRackID->IsNull())
+ LwpObjectID& rTabRackID = pTabOverRide->GetTabRackID();
+ if(rTabRackID.IsNull())
{
//assert(false);
return;
}
- LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(pTabRackID->obj().get());
+ LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(rTabRackID.obj().get());
if(!pTabRack)
{
//assert(false);
@@ -688,12 +688,12 @@ void LwpParaStyle::RegisterStyle()
XFParaStyle* pStyle = new XFParaStyle();
//Set name
- OUString styleName = GetName()->str();
+ OUString styleName = GetName().str();
pStyle->SetStyleName(styleName);
//Create font
- LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
- rtl::Reference<XFFont> pFont = pFontMgr->CreateFont(m_nFinalFontID);
+ LwpFontManager& rFontMgr = m_pFoundry->GetFontManger();
+ rtl::Reference<XFFont> pFont = rFontMgr.CreateFont(m_nFinalFontID);
pStyle->SetFont(pFont);
//Set other paragraph properties...
@@ -701,7 +701,7 @@ void LwpParaStyle::RegisterStyle()
Apply(pStyle);
//Add style
LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager();
- pStyleMgr->AddStyle(*GetObjectID(), pStyle);
+ pStyleMgr->AddStyle(GetObjectID(), pStyle);
}
LwpAlignmentOverride* LwpParaStyle::GetAlignment()
diff --git a/lotuswordpro/source/filter/lwpproplist.cxx b/lotuswordpro/source/filter/lwpproplist.cxx
index 6547f64ea607..f79022f4898e 100644
--- a/lotuswordpro/source/filter/lwpproplist.cxx
+++ b/lotuswordpro/source/filter/lwpproplist.cxx
@@ -71,7 +71,7 @@ LwpPropListElement::LwpPropListElement(LwpObjectHeader &objHdr, LwpSvStream *pSt
LwpPropListElement* LwpPropListElement::GetNext()
{
- return static_cast<LwpPropListElement*>(LwpDLVList::GetNext()->obj().get());
+ return static_cast<LwpPropListElement*>(LwpDLVList::GetNext().obj().get());
}
void LwpPropListElement::Read()
@@ -117,7 +117,7 @@ void LwpPropList::Read(LwpObjectStream* pObjStrm)
LwpPropListElement* LwpPropList::GetFirst()
{
- return static_cast<LwpPropListElement*>(LwpDLVListHead::GetFirst()->obj().get());
+ return static_cast<LwpPropListElement*>(LwpDLVListHead::GetFirst().obj().get());
}
OUString LwpPropList::EnumNamedProperty(OUString& name,OUString& value)
diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx
index f51d539012f4..b09f1ad7547e 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -95,15 +95,15 @@ LwpRowLayout::~LwpRowLayout()
*/
void LwpRowLayout::SetRowMap(void)
{
- LwpObjectID *pCellID= GetChildHead();
- LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ LwpObjectID& rCellID= GetChildHead();
+ LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
while(pCellLayout)
{
pCellLayout->SetCellMap();
- pCellID = pCellLayout->GetNext();
- pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ rCellID = pCellLayout->GetNext();
+ pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
}
}
/**
@@ -135,15 +135,15 @@ void LwpRowLayout::RegisterStyle()
pTableLayout->GetTable();
}
// register cells' style
- LwpObjectID *pCellID= GetChildHead();
- LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ LwpObjectID& rCellID= GetChildHead();
+ LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
while(pCellLayout)
{
pCellLayout->SetFoundry(m_pFoundry);
pCellLayout->RegisterStyle();
- pCellID = pCellLayout->GetNext();
- pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ rCellID = pCellLayout->GetNext();
+ pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
}
}
@@ -225,7 +225,7 @@ void LwpRowLayout::ConvertRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uInt8 nE
sal_uInt8 nColID = m_ConnCellList[nMarkConnCell]->GetColID()
+m_ConnCellList[nMarkConnCell]->GetNumcols()-1;
pXFCell = m_ConnCellList[nMarkConnCell]->ConvertCell(
- *pTable->GetObjectID(),
+ pTable->GetObjectID(),
crowid+m_ConnCellList[nMarkConnCell]->GetNumrows()-1,
m_ConnCellList[nMarkConnCell]->GetColID());
@@ -377,8 +377,8 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI
for (sal_uInt8 i = nStartCol; i < nEndCol ; i++)
{
// add row to table
- LwpObjectID *pCellID= GetChildHead();
- LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ LwpObjectID& rCellID= GetChildHead();
+ LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
nCellStartCol = i;//mark the begin position of cell
nCellEndCol = i;//mark the end position of cell
while(pCellLayout)
@@ -391,11 +391,11 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI
nCellEndCol = i+pConnCell->GetNumcols()-1;
i = nCellEndCol;
}
- pCell = pCellLayout->ConvertCell(*pTable->GetObjectID(),crowid,i);
+ pCell = pCellLayout->ConvertCell(pTable->GetObjectID(),crowid,i);
break;
}
- pCellID = pCellLayout->GetNext();
- pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ rCellID = pCellLayout->GetNext();
+ pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
}
if (!pCellLayout)
{
@@ -405,7 +405,7 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI
if (pDefaultCell)
{
pCell = pDefaultCell->ConvertCell(
- *pTable->GetObjectID(),crowid, i);
+ pTable->GetObjectID(),crowid, i);
}
else
{
@@ -425,8 +425,8 @@ void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uI
*/
void LwpRowLayout::CollectMergeInfo()
{
- LwpObjectID *pCellID= GetChildHead();
- LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ LwpObjectID& rCellID= GetChildHead();
+ LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
while(pCellLayout)
{
@@ -435,8 +435,8 @@ void LwpRowLayout::CollectMergeInfo()
LwpConnectedCellLayout* pConnCell = static_cast<LwpConnectedCellLayout*>(pCellLayout);
m_ConnCellList.push_back(pConnCell);
}
- pCellID = pCellLayout->GetNext();
- pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get());
+ rCellID = pCellLayout->GetNext();
+ pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
}
}
/**
diff --git a/lotuswordpro/source/filter/lwprowlayout.hxx b/lotuswordpro/source/filter/lwprowlayout.hxx
index 2ece96f35bc5..070683ed47b2 100644
--- a/lotuswordpro/source/filter/lwprowlayout.hxx
+++ b/lotuswordpro/source/filter/lwprowlayout.hxx
@@ -83,7 +83,7 @@ public:
virtual LWP_LAYOUT_TYPE GetLayoutType () SAL_OVERRIDE { return LWP_ROW_LAYOUT;}
sal_uInt16 GetRowID() { return crowid;}
virtual void RegisterStyle() SAL_OVERRIDE;
- inline LwpTableLayout * GetParentTableLayout(){return dynamic_cast<LwpTableLayout *>(GetParent()->obj().get());}
+ inline LwpTableLayout * GetParentTableLayout(){return dynamic_cast<LwpTableLayout *>(GetParent().obj().get());}
void SetRowMap(void);
protected:
void Read() SAL_OVERRIDE;
diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
index 430de02ad88e..aabda032cc72 100644
--- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
+++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
@@ -155,9 +155,9 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram
double fFrameHeight = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetHeight());
// get frame offset
- LwpPoint* pOffset = pMyScale->GetOffset();
- double fOffsetX = LwpTools::ConvertFromUnitsToMetric(pOffset->GetX());
- double fOffsetY = LwpTools::ConvertFromUnitsToMetric(pOffset->GetY());
+ LwpPoint& rOffset = pMyScale->GetOffset();
+ double fOffsetX = LwpTools::ConvertFromUnitsToMetric(rOffset.GetX());
+ double fOffsetY = LwpTools::ConvertFromUnitsToMetric(rOffset.GetY());
// get scale mode
sal_uInt16 nScalemode = pMyScale->GetScaleMode();
diff --git a/lotuswordpro/source/filter/lwpsection.hxx b/lotuswordpro/source/filter/lwpsection.hxx
index 3e2fa83777ab..6c714e44a5a8 100644
--- a/lotuswordpro/source/filter/lwpsection.hxx
+++ b/lotuswordpro/source/filter/lwpsection.hxx
@@ -77,8 +77,8 @@ public:
LwpOrderedObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
virtual ~LwpOrderedObject(){}
void Read() SAL_OVERRIDE;
- LwpObjectID* GetPosition(){ return &m_Para;}
- LwpObjectID* GetListList(){ return &m_ListList;}
+ LwpObjectID& GetPosition(){ return m_Para;}
+ LwpObjectID& GetListList(){ return m_ListList;}
protected:
LwpObjectID m_ListList;//lwplistlist object,
LwpObjectID m_Para;
@@ -97,8 +97,8 @@ public:
virtual ~LwpSection();
inline sal_uInt16 GetFlags();
inline LwpPageLayout* GetPageLayout();
- inline LwpColor* GetColor();
- inline LwpAtomHolder* GetAtomHolder();
+ inline LwpColor& GetColor();
+ inline LwpAtomHolder& GetAtomHolder();
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
OUString GetSectionName(){return m_AtomHolder.str();}
@@ -134,18 +134,18 @@ inline LwpPageLayout* LwpSection::GetPageLayout()
* @descr get section tab color
*
*/
-inline LwpColor* LwpSection::GetColor()
+inline LwpColor& LwpSection::GetColor()
{
- return &m_Color;
+ return m_Color;
}
/**
* @descr get section atom holder pointer
*
*/
-inline LwpAtomHolder* LwpSection::GetAtomHolder()
+inline LwpAtomHolder& LwpSection::GetAtomHolder()
{
- return &m_AtomHolder;
+ return m_AtomHolder;
}
class LwpIndexSection : public LwpSection
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index aad380c460f0..43a3657e2aa9 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -200,11 +200,7 @@ OUString LwpSilverBullet::GetBulletFontName()
return aEmpty;
}
- LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
- if (!pFontMgr)
- {
- return aEmpty;
- }
+ LwpFontManager& rFontMgr = m_pFoundry->GetFontManger();
sal_uInt32 nBulletFontID = m_pBulletPara->GetBulletFontID();
sal_uInt16 nFinalFont = static_cast<sal_uInt16>((nBulletFontID >> 16) & 0xFFFF);
@@ -216,7 +212,7 @@ OUString LwpSilverBullet::GetBulletFontName()
}
//get font name from font manager.
- OUString aFontName = pFontMgr->GetNameByID(nBulletFontID);
+ OUString aFontName = rFontMgr.GetNameByID(nBulletFontID);
return aFontName;
}
@@ -245,7 +241,7 @@ LwpPara* LwpSilverBullet::GetBulletPara()
return NULL;
}
- m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara()->obj(VO_PARA).get());
+ m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara().obj(VO_PARA).get());
}
return m_pBulletPara;
@@ -332,12 +328,9 @@ bool LwpSilverBullet::IsBulletOrdered()
if (!m_pBulletPara)
return false;
- LwpFribPtr* pFribs = m_pBulletPara->GetFribs();
-
- if (!pFribs)
- return false;
+ LwpFribPtr& rFribs = m_pBulletPara->GetFribs();
- return (pFribs->HasFrib(FRIB_TAG_PARANUMBER) != NULL);
+ return (rFribs.HasFrib(FRIB_TAG_PARANUMBER) != NULL);
}
/**
@@ -378,7 +371,7 @@ OUString LwpSilverBullet::GetAdditionalName(sal_uInt8 nPos)
bool bDivisionName = false;
bool bSectionName = false;
- LwpFrib* pParaFrib = m_pBulletPara->GetFribs()->GetFribs();
+ LwpFrib* pParaFrib = m_pBulletPara->GetFribs().GetFribs();
if (!pParaFrib)
{
return aEmpty;
@@ -435,10 +428,10 @@ OUString LwpSilverBullet::GetDivisionName()
LwpDocument* pDoc = m_pFoundry->GetDocument();
if (pDoc)
{
- LwpObjectID* pID = pDoc->GetDivInfoID();
- if (!pID->IsNull())
+ LwpObjectID& rID = pDoc->GetDivInfoID();
+ if (!rID.IsNull())
{
- LwpDivInfo *pInfo = dynamic_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO).get());
+ LwpDivInfo *pInfo = dynamic_cast<LwpDivInfo*>(rID.obj(VO_DIVISIONINFO).get());
if (pInfo)
aRet = pInfo->GetDivName();
}
@@ -461,14 +454,7 @@ OUString LwpSilverBullet::GetSectionName()
bool LwpSilverBullet::HasName()
{
- LwpAtomHolder* pName = this->GetName();
- if (pName)
- {
- return (!pName->str().isEmpty());
- }
- else
- {
- return false;
- }
+ LwpAtomHolder& rName = this->GetName();
+ return (!rName.str().isEmpty());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx
index 511b1f80ef56..27412b084749 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.hxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx
@@ -163,7 +163,7 @@ inline OUString LwpSilverBullet::GetBulletStyleName() const
inline OUString LwpSilverBullet::GetNumberingName()
{
- return GetName()->str();
+ return GetName().str();
}
inline LwpPara* LwpSilverBullet::GetNumberingPara()
{
diff --git a/lotuswordpro/source/filter/lwpslvlist.hxx b/lotuswordpro/source/filter/lwpslvlist.hxx
index 2033e2024117..fa8a4aeeb4c5 100644
--- a/lotuswordpro/source/filter/lwpslvlist.hxx
+++ b/lotuswordpro/source/filter/lwpslvlist.hxx
@@ -76,7 +76,7 @@ public:
if( LwpFileHeader::m_nFileRevision < 0x0006 )
pStrm->SkipExtra();
}
- LwpObjectID* GetNext(){return &m_NextID;}
+ LwpObjectID& GetNext(){return m_NextID;}
public:
private:
LwpObjectID m_NextID;
diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index e38197a5b8b0..911e9ae47e90 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -105,7 +105,7 @@ void LwpStory::XFConvert(XFContentContainer* pCont)
XFConvertFrameInFrame(pCont);
//process para list
XFContentContainer* pParaCont = pCont;
- LwpPara* pPara = dynamic_cast<LwpPara*> ( GetFirstPara()->obj().get() );
+ LwpPara* pPara = dynamic_cast<LwpPara*> ( GetFirstPara().obj().get() );
while(pPara)
{
pPara->SetFoundry(m_pFoundry);
@@ -113,7 +113,7 @@ void LwpStory::XFConvert(XFContentContainer* pCont)
//Get the xfcontainer for the next para
pParaCont = pPara->GetXFContainer();
- pPara = dynamic_cast<LwpPara*> ( pPara->GetNext()->obj().get() );
+ pPara = dynamic_cast<LwpPara*> ( pPara->GetNext().obj().get() );
}
//process frame which anchor is to cell after converter all the para
@@ -121,27 +121,27 @@ void LwpStory::XFConvert(XFContentContainer* pCont)
XFConvertFrameInHeaderFooter(pCont);
//Release Lwp Objects
- LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara()->obj().get());
+ LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara().obj().get());
LwpPara* pNext;
while(pCur)
{
pCur->Release();
- pNext = dynamic_cast<LwpPara*> ( pCur->GetNext()->obj().get() );
+ pNext = dynamic_cast<LwpPara*> ( pCur->GetNext().obj().get() );
LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory();
- pObjMgr->ReleaseObject(*pCur->GetObjectID());
+ pObjMgr->ReleaseObject(pCur->GetObjectID());
pCur = pNext;
}
}
void LwpStory::RegisterStyle()
{
- LwpPara* pPara = dynamic_cast<LwpPara*>( GetFirstPara()->obj().get() );
+ LwpPara* pPara = dynamic_cast<LwpPara*>( GetFirstPara().obj().get() );
while(pPara)
{
pPara->SetFoundry(m_pFoundry);
pPara->RegisterStyle();
- pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj().get());
+ pPara = dynamic_cast<LwpPara*>(pPara->GetNext().obj().get());
}
}
@@ -340,7 +340,7 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont)
LwpVirtualLayout* pLayout = GetLayout(NULL);
while(pLayout)
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get());
+ LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get());
while(pFrameLayout)
{
@@ -354,7 +354,7 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont)
if(pXFFirtPara)
pFrameLayout->XFConvert(pXFFirtPara);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get());
+ pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
}
pLayout = GetLayout(pLayout);
}
@@ -371,7 +371,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont)
LwpVirtualLayout* pLayout = GetLayout(NULL);
while(pLayout)
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get());
+ LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get());
while(pFrameLayout)
{
if((pFrameLayout->IsAnchorPage()
@@ -381,7 +381,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont)
{
pFrameLayout->XFConvert(pCont);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get());
+ pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
}
pLayout = GetLayout(pLayout);
}
@@ -397,14 +397,14 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont)
LwpVirtualLayout* pLayout = GetLayout(NULL);
while(pLayout)
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get());
+ LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get());
while(pFrameLayout)
{
if(pFrameLayout->IsAnchorFrame())
{
pFrameLayout->XFConvert(pCont);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get());
+ pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
}
pLayout = GetLayout(pLayout);
}
@@ -420,7 +420,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont)
LwpVirtualLayout* pLayout = GetLayout(NULL);
while(pLayout)
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj().get());
+ LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get());
while(pFrameLayout)
{
if(pFrameLayout->IsAnchorPage() && (pLayout->IsHeader() || pLayout->IsFooter()))
@@ -432,7 +432,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont)
if(pXFFirtPara)
pFrameLayout->XFConvert(pXFFirtPara);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj().get());
+ pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
}
pLayout = GetLayout(pLayout);
}
@@ -474,22 +474,22 @@ OUString LwpStory::GetContentText(bool bAllText)
{
OUString sText("");
//process para list
- LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj().get());
+ LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara().obj().get());
while (pPara)
{
pPara->SetFoundry(m_pFoundry);
sText += pPara->GetContentText(true);
- pPara = dynamic_cast<LwpPara*>(pPara->GetNext()->obj().get());
+ pPara = dynamic_cast<LwpPara*>(pPara->GetNext().obj().get());
}
return sText;
}
else //only the first text frib
{
- rtl::Reference<LwpObject> pObj = GetFirstPara()->obj();
+ rtl::Reference<LwpObject> pObj = GetFirstPara().obj();
if(pObj.is())
{
LwpPara* pPara = dynamic_cast<LwpPara*>(pObj.get());
- if (!pPara || pPara->GetNext()->obj() != NULL)
+ if (!pPara || pPara->GetNext().obj() != NULL)
return OUString("");
pPara->SetFoundry(m_pFoundry);
return pPara->GetContentText();
@@ -500,27 +500,23 @@ OUString LwpStory::GetContentText(bool bAllText)
}
OUString LwpStory::RegisterFirstFribStyle()
{
- LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara()->obj().get());
+ LwpPara* pPara = dynamic_cast<LwpPara*>(GetFirstPara().obj().get());
if (!pPara)
return OUString("");
pPara->SetFoundry(m_pFoundry);
- LwpFribPtr* pFribs = pPara->GetFribs();
- if (pFribs)
- {
- LwpFrib* pFirstFrib = pFribs->GetFribs();
- pFirstFrib->RegisterStyle(m_pFoundry);
- XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
- XFTextStyle* pBaseStyle = pXFStyleManager->FindTextStyle(pFirstFrib->GetStyleName());
- if (pBaseStyle == NULL)
- return OUString("");
- XFTextStyle* pStyle = new XFTextStyle;
- *pStyle = *pBaseStyle;
- OUString sName = "Ruby" + pFirstFrib->GetStyleName();
- pStyle->SetStyleName(sName);
- pXFStyleManager->AddStyle(pStyle);
- return sName;
- }
- return OUString("");
+ LwpFribPtr& rFribs = pPara->GetFribs();
+ LwpFrib* pFirstFrib = rFribs.GetFribs();
+ pFirstFrib->RegisterStyle(m_pFoundry);
+ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
+ XFTextStyle* pBaseStyle = pXFStyleManager->FindTextStyle(pFirstFrib->GetStyleName());
+ if (pBaseStyle == NULL)
+ return OUString("");
+ XFTextStyle* pStyle = new XFTextStyle;
+ *pStyle = *pBaseStyle;
+ OUString sName = "Ruby" + pFirstFrib->GetStyleName();
+ pStyle->SetStyleName(sName);
+ pXFStyleManager->AddStyle(pStyle);
+ return sName;
}
bool LwpStory::IsBullStyleUsedBefore(const OUString& rStyleName, const sal_uInt8& nPos)
diff --git a/lotuswordpro/source/filter/lwpstory.hxx b/lotuswordpro/source/filter/lwpstory.hxx
index a1777240f850..a546b9d88ca8 100644
--- a/lotuswordpro/source/filter/lwpstory.hxx
+++ b/lotuswordpro/source/filter/lwpstory.hxx
@@ -106,9 +106,9 @@ public:
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
virtual void XFConvert(XFContentContainer* pCont) SAL_OVERRIDE;
void XFConvertFrameInPage(XFContentContainer* pCont);
- inline LwpDLVListHeadTail* GetParaList();
- inline LwpObjectID* GetFirstPara();
- inline LwpObjectID* GetLastPara();
+ inline LwpDLVListHeadTail& GetParaList();
+ inline LwpObjectID& GetFirstPara();
+ inline LwpObjectID& GetLastPara();
XFContentContainer* GetXFContent();
void AddXFContent(XFContent* pContent);
@@ -139,15 +139,15 @@ public:
OUString RegisterFirstFribStyle();
};
-LwpDLVListHeadTail* LwpStory::GetParaList()
+LwpDLVListHeadTail& LwpStory::GetParaList()
{
- return &m_ParaList;
+ return m_ParaList;
}
-LwpObjectID* LwpStory::GetFirstPara()
+LwpObjectID& LwpStory::GetFirstPara()
{
return m_ParaList.GetHead();
}
-LwpObjectID* LwpStory::GetLastPara()
+LwpObjectID& LwpStory::GetLastPara()
{
return m_ParaList.GetTail();
}
diff --git a/lotuswordpro/source/filter/lwptable.cxx b/lotuswordpro/source/filter/lwptable.cxx
index 4d5539ee0dff..300fb38d3945 100644
--- a/lotuswordpro/source/filter/lwptable.cxx
+++ b/lotuswordpro/source/filter/lwptable.cxx
@@ -144,7 +144,7 @@ void LwpTable::Parse(IXFStream* /*pOutputStream*/)
{
LwpTableLayout* pLayout = dynamic_cast<LwpTableLayout*>(m_Layout.obj().get());
if(pLayout)
- return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent()->obj().get());
+ return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent().obj().get());
return NULL;
}
diff --git a/lotuswordpro/source/filter/lwptable.hxx b/lotuswordpro/source/filter/lwptable.hxx
index e421a92227ba..833716c4a34e 100644
--- a/lotuswordpro/source/filter/lwptable.hxx
+++ b/lotuswordpro/source/filter/lwptable.hxx
@@ -121,7 +121,7 @@ public:
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
double GetWidth() {return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
double GetHeight() {return LwpTools::ConvertFromUnitsToMetric(m_nHeight);}
- LwpObjectID * GetDefaultCellStyle() {return &m_DefaultCellStyle;}
+ LwpObjectID& GetDefaultCellStyle() {return m_DefaultCellStyle;}
sal_uInt16 GetRow() {return m_nRow;}
sal_uInt16 GetColumn() {return m_nColumn;}
LwpTableLayout * GetTableLayout(){return static_cast<LwpTableLayout *>(GetLayout(NULL));}
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 89eaa0444fac..0605ab3096bf 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -114,11 +114,11 @@ void LwpSuperTableLayout::Read()
*/
LwpTableLayout* LwpSuperTableLayout::GetTableLayout()
{
- LwpObjectID *pID = GetChildTail();
+ LwpObjectID& rID = GetChildTail();
- while(pID && !pID->IsNull())
+ while(!rID.IsNull())
{
- LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pID->obj().get());
+ LwpLayout* pLayout = dynamic_cast<LwpLayout*>(rID.obj().get());
if (!pLayout)
{
break;
@@ -127,7 +127,7 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout()
{
return dynamic_cast<LwpTableLayout *>(pLayout);
}
- pID = pLayout->GetPrevious();
+ rID = pLayout->GetPrevious();
}
return NULL;
@@ -138,11 +138,11 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout()
*/
LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout()
{
- LwpObjectID *pID = GetChildTail();
+ LwpObjectID& rID = GetChildTail();
- while(pID && !pID->IsNull())
+ while(!rID.IsNull())
{
- LwpLayout * pLayout = dynamic_cast<LwpLayout *>(pID->obj().get());
+ LwpLayout * pLayout = dynamic_cast<LwpLayout *>(rID.obj().get());
if (!pLayout)
{
break;
@@ -152,7 +152,7 @@ LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout()
{
return dynamic_cast<LwpTableHeadingLayout *>(pLayout);
}
- pID = pLayout->GetPrevious();
+ rID = pLayout->GetPrevious();
}
return NULL;
@@ -234,8 +234,8 @@ double LwpSuperTableLayout::GetTableWidth()
for(sal_uInt16 i =0; i< nCol; i++)
{
- LwpObjectID *pColumnID = pTableLayout->GetColumnLayoutHead();
- LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get());
+ LwpObjectID& rColumnID = pTableLayout->GetColumnLayoutHead();
+ LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get());
double dColumnWidth = dDefaultWidth;
while (pColumnLayout)
{
@@ -244,8 +244,8 @@ double LwpSuperTableLayout::GetTableWidth()
dColumnWidth = pColumnLayout->GetWidth();
break;
}
- pColumnID = pColumnLayout->GetNext();
- pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get());
+ rColumnID = pColumnLayout->GetNext();
+ pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get());
}
dWidth += dColumnWidth;
}
@@ -468,8 +468,8 @@ void LwpTableLayout::TraverseTable()
}
// set value
- LwpObjectID *pRowID = GetChildHead();
- LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get());
+ LwpObjectID& rRowID = GetChildHead();
+ LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
while (pRowLayout)
{
pRowLayout->SetRowMap();
@@ -479,8 +479,8 @@ void LwpTableLayout::TraverseTable()
pRowLayout->CollectMergeInfo();
// end for 's analysis
- pRowID = pRowLayout->GetNext();
- pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get());
+ rRowID = pRowLayout->GetNext();
+ pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
}
}
@@ -506,7 +506,7 @@ LwpObjectID * LwpTableLayout::SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCo
{
return NULL;
}
- return pCell->GetContent();
+ return &pCell->GetContent();
}
return NULL;
@@ -518,7 +518,7 @@ LwpObjectID * LwpTableLayout::SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCo
*/
LwpSuperTableLayout * LwpTableLayout::GetSuperTableLayout()
{
- return dynamic_cast<LwpSuperTableLayout *>(GetParent()->obj().get());
+ return dynamic_cast<LwpSuperTableLayout *>(GetParent().obj().get());
}
/**
* @short Get table pointer
@@ -577,8 +577,8 @@ void LwpTableLayout::RegisterColumns()
// Get total width of justifiable columns
// NOTICE: all default columns are regarded as justifiable columns
- LwpObjectID *pColumnID = GetColumnLayoutHead();
- LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get());
+ LwpObjectID& rColumnID = GetColumnLayoutHead();
+ LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get());
while (pColumnLayout)
{
m_pColumns[pColumnLayout->GetColumnID()] = pColumnLayout;
@@ -589,8 +589,8 @@ void LwpTableLayout::RegisterColumns()
nJustifiableColumn --;
}
- pColumnID = pColumnLayout->GetNext();
- pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get());
+ rColumnID = pColumnLayout->GetNext();
+ pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get());
}
// if all columns are not justifiable, the rightmost column will be changed to justifiable
@@ -668,15 +668,15 @@ void LwpTableLayout::RegisterRows()
m_DefaultRowStyleName = pXFStyleManager->AddStyle(pRowStyle)->GetStyleName();
// register style of rows
- LwpObjectID * pRowID = GetChildHead();
- LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get());
+ LwpObjectID& rRowID = GetChildHead();
+ LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
while (pRowLayout)
{
pRowLayout->SetFoundry(m_pFoundry);
pRowLayout->RegisterStyle();
- pRowID = pRowLayout->GetNext();
- pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get());
+ rRowID = pRowLayout->GetNext();
+ pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
}
}
/**
@@ -706,11 +706,8 @@ void LwpTableLayout::RegisterStyle()
m_nCols = pTable->GetColumn();
// get default cell layout of current table
- LwpObjectID * pID= pTable->GetDefaultCellStyle();
- if (pID)
- {
- m_pDefaultCellLayout = dynamic_cast<LwpCellLayout *>(pID->obj().get());
- }
+ LwpObjectID& rID= pTable->GetDefaultCellStyle();
+ m_pDefaultCellLayout = dynamic_cast<LwpCellLayout *>(rID.obj().get());
// register columns styles
RegisterColumns();
@@ -759,7 +756,7 @@ void LwpTableLayout::RegisterStyle()
//New Code
if( GetFoundry() && GetTable() )
- PutCellVals( GetFoundry(),*GetTable()->GetObjectID() );
+ PutCellVals( GetFoundry(),GetTable()->GetObjectID() );
}
/**
* @short read table layout
@@ -777,7 +774,7 @@ void LwpTableLayout::ParseTable()
// set name of object
m_pXFTable = new XFTable;
- m_pXFTable->SetTableName(pSuper->GetName()->str());
+ m_pXFTable->SetTableName(pSuper->GetName().str());
// set table style
m_pXFTable->SetStyleName(m_StyleName);
@@ -1111,9 +1108,9 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID)
try{
- LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager()->GetTableRangeID().obj().get();
+ LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager().GetTableRangeID().obj().get();
- LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID()->obj().get();
+ LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID().obj().get();
//Look up the table
while (NULL!=pTableRange)
@@ -1251,8 +1248,8 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn
for (sal_uInt32 iLoop = 0; iLoop < static_cast<sal_uInt32>(nEndCol)-nStartCol; ++iLoop)
{
// add row to table
- LwpObjectID *pColID = GetColumnLayoutHead();
- LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj().get());
+ LwpObjectID& rColID = GetColumnLayoutHead();
+ LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColID.obj().get());
while (pColumnLayout)
{
if (pColumnLayout->GetColumnID() == (iLoop+nStartCol))
@@ -1260,8 +1257,8 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn
pXFTable->SetColumnStyle(iLoop+1, pColumnLayout->GetStyleName());
break;
}
- pColID = pColumnLayout->GetNext();
- pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColID->obj().get());
+ rColID = pColumnLayout->GetNext();
+ pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColID.obj().get());
}
if (!pColumnLayout)
{
@@ -1342,7 +1339,7 @@ void LwpTableLayout::ConvertDefaultRow(XFTable* pXFTable,sal_uInt8 nStartCol,
if (m_pDefaultCellLayout)
{
pCell = m_pDefaultCellLayout->ConvertCell(
- *GetTable()->GetObjectID(),nRowID,j+nStartCol);
+ GetTable()->GetObjectID(),nRowID,j+nStartCol);
}
else
{
@@ -1393,15 +1390,15 @@ XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol)
*/
LwpRowLayout* LwpTableLayout::GetRowLayout(sal_uInt16 nRow)
{
- LwpObjectID *pRowID = GetChildHead();
- LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get());
+ LwpObjectID& rRowID = GetChildHead();
+ LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
while (pRowLayout)
{
if(pRowLayout->GetRowID() == nRow)
return pRowLayout;
- pRowID = pRowLayout->GetNext();
- pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get());
+ rRowID = pRowLayout->GetNext();
+ pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
}
return NULL;
}
@@ -1479,10 +1476,10 @@ void LwpTableHeadingLayout::GetStartEndRow(sal_uInt16& nStartRow, sal_uInt16& nE
*/
LwpRowHeadingLayout * LwpTableHeadingLayout::GetFirstRowHeadingLayout()
{
- LwpObjectID *pID = GetChildHead();
- if(pID && !pID->IsNull())
+ LwpObjectID& rID = GetChildHead();
+ if(!rID.IsNull())
{
- LwpRowHeadingLayout * pHeadingRow = dynamic_cast<LwpRowHeadingLayout *>(pID->obj().get());
+ LwpRowHeadingLayout * pHeadingRow = dynamic_cast<LwpRowHeadingLayout *>(rID.obj().get());
return pHeadingRow;
}
return NULL;
diff --git a/lotuswordpro/source/filter/lwptablelayout.hxx b/lotuswordpro/source/filter/lwptablelayout.hxx
index 1e7fb3b35a65..71ddcfdfd5d4 100644
--- a/lotuswordpro/source/filter/lwptablelayout.hxx
+++ b/lotuswordpro/source/filter/lwptablelayout.hxx
@@ -90,7 +90,7 @@ public:
LwpTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
virtual ~LwpTableLayout();
virtual LWP_LAYOUT_TYPE GetLayoutType () SAL_OVERRIDE { return LWP_TABLE_LAYOUT;}
- LwpObjectID * GetColumnLayoutHead(){return &m_ColumnLayout;}
+ LwpObjectID& GetColumnLayoutHead(){return m_ColumnLayout;}
void RegisterStyle() SAL_OVERRIDE;
LwpTable * GetTable();
LwpCellLayout * GetDefaultCellLayout(){return m_pDefaultCellLayout;}
diff --git a/lotuswordpro/source/filter/lwptaboverride.hxx b/lotuswordpro/source/filter/lwptaboverride.hxx
index b9c28e21e5c2..8abcb540b38a 100644
--- a/lotuswordpro/source/filter/lwptaboverride.hxx
+++ b/lotuswordpro/source/filter/lwptaboverride.hxx
@@ -87,7 +87,7 @@ public:
pStrm->SkipExtra();
}
- inline LwpObjectID* GetTabRackID();
+ inline LwpObjectID& GetTabRackID();
inline bool IsTabRackOverridden();
inline void Override(LwpTabOverride* pOther);
inline void OverrideTabRack(LwpObjectID* pTabRackID);
@@ -106,9 +106,9 @@ private:
};
};
-inline LwpObjectID* LwpTabOverride::GetTabRackID()
+inline LwpObjectID& LwpTabOverride::GetTabRackID()
{
- return &m_aTabRackID;
+ return m_aTabRackID;
}
inline void LwpTabOverride::Override(LwpTabOverride* pOther)
@@ -117,7 +117,7 @@ inline void LwpTabOverride::Override(LwpTabOverride* pOther)
{
if (IsTabRackOverridden())
//m_aTabRackID = *(pOther->GetTabRackID());
- pOther->OverrideTabRack(GetTabRackID());
+ pOther->OverrideTabRack(&GetTabRackID());
}
}
diff --git a/lotuswordpro/source/filter/lwptblcell.hxx b/lotuswordpro/source/filter/lwptblcell.hxx
index b304999e5144..1d610248d271 100644
--- a/lotuswordpro/source/filter/lwptblcell.hxx
+++ b/lotuswordpro/source/filter/lwptblcell.hxx
@@ -85,7 +85,7 @@ public:
LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpObjectID GetNextID(){return *GetNext();}
+ LwpObjectID GetNextID(){return GetNext();}
sal_uInt8 GetColumnID(){return cColumn;}
virtual bool IsFormula(){return false;}
LwpObjectID GetValueID(){return cValue;}
@@ -110,8 +110,8 @@ public:
LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpObjectID GetChildHeadID(){return *cChild.GetHead();}
- LwpObjectID GetNextID(){return *GetNext();}
+ LwpObjectID GetChildHeadID(){return cChild.GetHead();}
+ LwpObjectID GetNextID(){return GetNext();}
sal_uInt16 GetRowID(){return cRowID;}
protected:
LwpDLVListHeadTail cChild;
@@ -152,7 +152,7 @@ public:
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
LwpObjectID GetCellRangeID(){return cpCellRange;}
LwpObjectID GetTableID(){ return cqTable;}
- LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext()->obj().get());}
+ LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext().obj().get());}
protected:
LwpObjectID cqTable;
LwpObjectID cpCellRange;
@@ -187,7 +187,7 @@ public:
LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpObjectID GetChildHeadID(){ return *cChild.GetHead();}
+ LwpObjectID GetChildHeadID(){ return cChild.GetHead();}
protected:
LwpDLVListHeadTail cChild;
LwpObjectID cParent;
diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx
index 0a8b848a09b6..d36a9659c3d7 100644
--- a/lotuswordpro/source/filter/lwptoc.cxx
+++ b/lotuswordpro/source/filter/lwptoc.cxx
@@ -384,8 +384,8 @@ sal_uInt16 LwpTocSuperLayout::GetSeparatorType(sal_uInt16 index)
*/
LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index)
{
- LwpObjectID * pID = m_SearchItems.GetHead(); // not necessary to check pID NULL or not
- LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get());
+ LwpObjectID& rID = m_SearchItems.GetHead();
+ LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get());
while(pObj)
{
@@ -394,8 +394,8 @@ LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index)
return pObj;
}
- pID = pObj->GetNext(); // not necessary to check pID NULL or not
- pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get());
+ rID = pObj->GetNext();
+ pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get());
}
return NULL;
@@ -408,8 +408,8 @@ LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index)
*/
LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, LwpTocLevelData * pCurData)
{
- LwpObjectID * pID = pCurData->GetNext();
- LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get());
+ LwpObjectID& rID = pCurData->GetNext();
+ LwpTocLevelData * pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get());
while(pObj)
{
@@ -418,8 +418,8 @@ LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, Lwp
return pObj;
}
- pID = pObj->GetNext(); // not necessary to check pID NULL or not
- pObj = dynamic_cast<LwpTocLevelData *>(pID->obj().get());
+ rID = pObj->GetNext();
+ pObj = dynamic_cast<LwpTocLevelData *>(rID.obj().get());
}
return NULL;
diff --git a/lotuswordpro/source/filter/lwpvpointer.hxx b/lotuswordpro/source/filter/lwpvpointer.hxx
index c9bc1f58ce06..93837ee4c6fc 100644
--- a/lotuswordpro/source/filter/lwpvpointer.hxx
+++ b/lotuswordpro/source/filter/lwpvpointer.hxx
@@ -75,7 +75,7 @@ public:
void Read() SAL_OVERRIDE;
void RegisterStyle() SAL_OVERRIDE;
void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
- LwpObjectID* GetPointer(){return &m_PointerID;}
+ LwpObjectID& GetPointer(){return m_PointerID;}
protected:
LwpObjectID m_PointerID;
private:
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index bb143710338b..90544df0ad6a 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -278,7 +278,7 @@ CBenTOCReader::ReadTOC()
}
pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
- if (FindNamedObject(cpContainer->GetNamedObjects(),
+ if (FindNamedObject(&cpContainer->GetNamedObjects(),
sBuffer, &pPrevNamedObjectListElmt) != NULL)
{
delete[] sAllocBuffer;
@@ -286,7 +286,7 @@ CBenTOCReader::ReadTOC()
}
pCBenObject pPrevObject = (pCBenObject) cpContainer->
- GetObjects()->GetLast();
+ GetObjects().GetLast();
if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME)
pObject = new CBenPropertyName(cpContainer, ObjectID,
@@ -332,12 +332,12 @@ CBenTOCReader::ReadTOC()
if (pObject == NULL)
pObject = new CBenObject(cpContainer, ObjectID,
- (pCBenObject) cpContainer->GetObjects()->GetLast());
+ (pCBenObject) cpContainer->GetObjects().GetLast());
pProperty = new CBenProperty(pObject, PropertyID, TypeID,
- (pCBenProperty) pObject->GetProperties()->GetLast());
+ (pCBenProperty) pObject->GetProperties().GetLast());
- if ((Err = ReadSegments(pProperty->UseValue(),
+ if ((Err = ReadSegments(&pProperty->UseValue(),
&LookAhead)) != BenErr_OK)
return Err;
}
diff --git a/lotuswordpro/source/filter/utlist.cxx b/lotuswordpro/source/filter/utlist.cxx
index 11d5bf04f107..9825cbf0baa9 100644
--- a/lotuswordpro/source/filter/utlist.cxx
+++ b/lotuswordpro/source/filter/utlist.cxx
@@ -77,15 +77,15 @@ CUtListElmt::~CUtListElmt()
CUtList::~CUtList()
{
- pCUtListElmt pTerminating = GetTerminating();
- for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating; )
+ CUtListElmt& rTerminating = GetTerminating();
+ for (pCUtListElmt pCurr = GetFirst(); pCurr != &rTerminating; )
{
pCUtListElmt pNext = pCurr->GetNext();
pCurr->MakeNotOnList();
pCurr = pNext;
}
- pTerminating->SetPrev(pTerminating);
- pTerminating->SetNext(pTerminating);
+ rTerminating.SetPrev(&rTerminating);
+ rTerminating.SetNext(&rTerminating);
}
// If pCurr is NULL, returns first item in list. Otherwise, returns item
@@ -99,7 +99,7 @@ CUtList::GetNextOrNULL(pCUtListElmt pCurr)
if (pCurr == NULL)
pNext = GetFirst();
else pNext = pCurr->GetNext();
- if (pNext == GetTerminating())
+ if (pNext == &GetTerminating())
pNext = NULL;
return pNext;
}
@@ -107,8 +107,8 @@ CUtList::GetNextOrNULL(pCUtListElmt pCurr)
void
CUtList::Destroy()
{
- pCUtListElmt pTerminating = GetTerminating();
- for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating; )
+ CUtListElmt& rTerminating = GetTerminating();
+ for (pCUtListElmt pCurr = GetFirst(); pCurr != &rTerminating; )
{
pCUtListElmt pNext = pCurr->GetNext();
delete pCurr;
diff --git a/lotuswordpro/source/filter/utlist.hxx b/lotuswordpro/source/filter/utlist.hxx
index bd7f50faefcb..deb9f72d1e4b 100644
--- a/lotuswordpro/source/filter/utlist.hxx
+++ b/lotuswordpro/source/filter/utlist.hxx
@@ -120,9 +120,9 @@ public: // Methods
virtual ~CUtList();
pCUtListElmt GetFirst() { return cDummyElmt.GetNext(); }
pCUtListElmt GetLast() { return cDummyElmt.GetPrev(); }
- pCUtListElmt GetTerminating() { return &cDummyElmt; }
+ CUtListElmt& GetTerminating() { return cDummyElmt; }
pCUtListElmt GetNextOrNULL(pCUtListElmt pCurr);
- bool IsEmpty() { return GetFirst() == GetTerminating(); };
+ bool IsEmpty() { return GetFirst() == &GetTerminating(); };
bool ContainsAtLeastTwoItems() { return GetFirst() != GetLast(); };
void Destroy(void);
diff --git a/lotuswordpro/source/filter/xfilter/xfborders.hxx b/lotuswordpro/source/filter/xfilter/xfborders.hxx
index dd718422cbee..4d5592c08fd9 100644
--- a/lotuswordpro/source/filter/xfilter/xfborders.hxx
+++ b/lotuswordpro/source/filter/xfilter/xfborders.hxx
@@ -167,13 +167,13 @@ public:
*/
void SetWidthOuter(enumXFBorder side, double outer);
- XFBorder * GetLeft() {return &m_aBorderLeft;}
+ XFBorder& GetLeft() {return m_aBorderLeft;}
- XFBorder * GetRight() {return &m_aBorderRight;}
+ XFBorder& GetRight() {return m_aBorderRight;}
- XFBorder * GetTop() {return &m_aBorderTop;}
+ XFBorder& GetTop() {return m_aBorderTop;}
- XFBorder * GetBottom() {return &m_aBorderBottom;}
+ XFBorder& GetBottom() {return m_aBorderBottom;}
void ToXml(IXFStream *pStrm);
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx
index 2ef981425e04..db8e73e1364e 100644
--- a/reportdesign/source/ui/inc/ScrollHelper.hxx
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -81,10 +81,10 @@ namespace rptui
inline Point getThumbPos() const { return Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; }
inline const OReportWindow& getReportWindow() const { return m_aReportWindow; }
- void setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight);
+ void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight);
inline Size getTotalSize() const { return m_aTotalPixelSize; }
- inline ScrollBar* GetHScroll() { return &m_aHScroll; }
- inline ScrollBar* GetVScroll() { return &m_aVScroll; }
+ inline ScrollBar& GetHScroll() { return m_aHScroll; }
+ inline ScrollBar& GetVScroll() { return m_aVScroll; }
// forwards
void SetMode( DlgEdMode _eMode );
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 7533d843aee0..134de05e92b0 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -266,8 +266,8 @@ namespace
{
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
- const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
- PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
+ const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
+ PropertyEntryVector_t aPropVector = rPropertyMap.getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
while( aIt != aPropVector.end() )
{
@@ -291,8 +291,8 @@ namespace
{
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
- const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
- PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
+ const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
+ PropertyEntryVector_t aPropVector = rPropertyMap.getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
while( aIt != aPropVector.end() )
{
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 5715f3700912..e30b797ad74e 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1444,9 +1444,9 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
{
// scroll page
OScrollWindowHelper* pScrollWindow = getView()->getScrollWindow();
- ScrollBar* pScrollBar = ( nCode == KEY_LEFT || nCode == KEY_RIGHT ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll();
- if ( pScrollBar && pScrollBar->IsVisible() )
- pScrollBar->DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? SCROLL_LINEUP : SCROLL_LINEDOWN );
+ ScrollBar& rScrollBar = ( nCode == KEY_LEFT || nCode == KEY_RIGHT ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll();
+ if ( rScrollBar.IsVisible() )
+ rScrollBar.DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? SCROLL_LINEUP : SCROLL_LINEDOWN );
return;
}
TSectionsMap::const_iterator aIter = m_aSections.begin();
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index 024b7cce9e95..ffc1a6b84dd8 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -94,8 +94,8 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
{
- ScrollBar* pHScroll = pScrollWindow->GetHScroll();
- ScrollBar* pVScroll = pScrollWindow->GetVScroll();
+ ScrollBar& rHScroll = pScrollWindow->GetHScroll();
+ ScrollBar& rVScroll = pScrollWindow->GetVScroll();
ScrollType eH = SCROLL_LINEDOWN,eV = SCROLL_LINEDOWN;
if( rPos.X() < aOutRect.Left() )
eH = SCROLL_LINEUP;
@@ -107,8 +107,8 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
else if( rPos.Y() <= aOutRect.Bottom() )
eV = SCROLL_DONTKNOW;
- pHScroll->DoScrollAction(eH);
- pVScroll->DoScrollAction(eV);
+ rHScroll.DoScrollAction(eH);
+ rVScroll.DoScrollAction(eV);
}
aScrollTimer.Start();
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 5d6cc276153b..368e644c3b44 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2024,8 +2024,8 @@ public:
ScRefreshTimerControl* GetRefreshTimerControl() const
{ return pRefreshTimerControl; }
- ScRefreshTimerControl * const * GetRefreshTimerControlAddress() const
- { return &pRefreshTimerControl; }
+ ScRefreshTimerControl * const & GetRefreshTimerControlAddress() const
+ { return pRefreshTimerControl; }
void SetPastingDrawFromOtherDoc( bool bVal )
{ bPastingDrawFromOtherDoc = bVal; }
diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx
index ba578d2b5262..0587b32d78af 100644
--- a/sc/inc/dpfilteredcache.hxx
+++ b/sc/inc/dpfilteredcache.hxx
@@ -106,7 +106,7 @@ public:
sal_Int32 getRowSize() const;
sal_Int32 getColSize() const;
- const ScDPCache* getCache() const { return &mrCache;}
+ const ScDPCache& getCache() const { return mrCache;}
void fillTable(const ScQueryParam& rQuery, bool bIgnoreEmptyRows, bool bRepeatIfEmpty);
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index 78176fbc94f5..9b73b4a73ee3 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -767,7 +767,7 @@ private:
/**
* Caller must ensure that the passed shell is not already stored.
*/
- ScDocument* cacheNewDocShell( sal_uInt16 nFileId, SrcShell& rSrcShell );
+ ScDocument& cacheNewDocShell( sal_uInt16 nFileId, SrcShell& rSrcShell );
void maybeLinkExternalFile(sal_uInt16 nFileId);
diff --git a/sc/inc/olinetab.hxx b/sc/inc/olinetab.hxx
index a0df79d56a95..0312c6f3fefe 100644
--- a/sc/inc/olinetab.hxx
+++ b/sc/inc/olinetab.hxx
@@ -151,10 +151,10 @@ public:
ScOutlineTable();
ScOutlineTable( const ScOutlineTable& rOutline );
- const ScOutlineArray* GetColArray() const { return &aColOutline; }
- ScOutlineArray* GetColArray() { return &aColOutline; }
- const ScOutlineArray* GetRowArray() const { return &aRowOutline; }
- ScOutlineArray* GetRowArray() { return &aRowOutline; }
+ const ScOutlineArray& GetColArray() const { return aColOutline; }
+ ScOutlineArray& GetColArray() { return aColOutline; }
+ const ScOutlineArray& GetRowArray() const { return aRowOutline; }
+ ScOutlineArray& GetRowArray() { return aRowOutline; }
bool TestInsertCol( SCSIZE nSize );
void InsertCol( SCCOL nStartCol, SCSIZE nSize );
diff --git a/sc/inc/refreshtimerprotector.hxx b/sc/inc/refreshtimerprotector.hxx
index 3ca5568411a7..743643a48b28 100644
--- a/sc/inc/refreshtimerprotector.hxx
+++ b/sc/inc/refreshtimerprotector.hxx
@@ -17,10 +17,10 @@ class ScRefreshTimerControl;
class SC_DLLPUBLIC ScRefreshTimerProtector
{
- ScRefreshTimerControl * const * ppControl;
+ ScRefreshTimerControl * const & m_rpControl;
public:
- ScRefreshTimerProtector( ScRefreshTimerControl * const * pp );
+ ScRefreshTimerProtector( ScRefreshTimerControl * const & rp );
~ScRefreshTimerProtector();
};
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index cd65d0987af2..3f210db0d68e 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -116,14 +116,14 @@ void ScMacrosTest::testStarBasic()
CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
ScDocShell* xDocSh = static_cast<ScDocShell*>(pFoundShell);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
SfxObjectShell::CallXScript(
xComponent,
"vnd.sun.Star.script:Standard.Module1.Macro1?language=Basic&location=document",
aParams, aRet, aOutParamIndex, aOutParam);
double aValue;
- pDoc->GetValue(0,0,0,aValue);
+ rDoc.GetValue(0,0,0,aValue);
std::cout << "returned value = " << aValue << std::endl;
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("script did not change the value of Sheet1.A1",2.0, aValue, 0.00001);
xDocSh->DoClose();
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 796a01d20836..33c96921a6e9 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -132,27 +132,27 @@ void ScFiltersTest::testCVEs()
namespace {
-void testRangeNameImpl(ScDocument* pDoc)
+void testRangeNameImpl(ScDocument& rDoc)
{
//check one range data per sheet and one global more detailed
//add some more checks here
- ScRangeData* pRangeData = pDoc->GetRangeName()->findByUpperName(OUString("GLOBAL1"));
+ ScRangeData* pRangeData = rDoc.GetRangeName()->findByUpperName(OUString("GLOBAL1"));
CPPUNIT_ASSERT_MESSAGE("range name Global1 not found", pRangeData);
double aValue;
- pDoc->GetValue(1,0,0,aValue);
+ rDoc.GetValue(1,0,0,aValue);
CPPUNIT_ASSERT_MESSAGE("range name Global1 should reference Sheet1.A1", aValue == 1);
- pRangeData = pDoc->GetRangeName(0)->findByUpperName(OUString("LOCAL1"));
+ pRangeData = rDoc.GetRangeName(0)->findByUpperName(OUString("LOCAL1"));
CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 not found", pRangeData);
- pDoc->GetValue(1,2,0,aValue);
+ rDoc.GetValue(1,2,0,aValue);
CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 should reference Sheet1.A3", aValue == 3);
- pRangeData = pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL2"));
+ pRangeData = rDoc.GetRangeName(1)->findByUpperName(OUString("LOCAL2"));
CPPUNIT_ASSERT_MESSAGE("range name Sheet2.Local2 not found", pRangeData);
//check for correct results for the remaining formulas
- pDoc->GetValue(1,1,0, aValue);
+ rDoc.GetValue(1,1,0, aValue);
CPPUNIT_ASSERT_MESSAGE("=global2 should be 2", aValue == 2);
- pDoc->GetValue(1,3,0, aValue);
+ rDoc.GetValue(1,3,0, aValue);
CPPUNIT_ASSERT_MESSAGE("=local2 should be 4", aValue == 4);
- pDoc->GetValue(2,0,0, aValue);
+ rDoc.GetValue(2,0,0, aValue);
CPPUNIT_ASSERT_MESSAGE("=SUM(global3) should be 10", aValue == 10);
}
@@ -166,42 +166,42 @@ void ScFiltersTest::testRangeNameODS()
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testRangeNameImpl(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testRangeNameImpl(rDoc);
OUString aSheet2CSV("rangeExp_Sheet2.");
OUString aCSVPath;
createCSVPath( aSheet2CSV, aCSVPath );
- testFile( aCSVPath, pDoc, 1);
+ testFile( aCSVPath, rDoc, 1);
xDocSh->DoClose();
}
namespace {
-void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods, xls, xlsx
+void testContentImpl(ScDocument& rDoc, sal_Int32 nFormat ) //same code for ods, xls, xlsx
{
double fValue;
//check value import
- pDoc->GetValue(0,0,0,fValue);
+ rDoc.GetValue(0,0,0,fValue);
CPPUNIT_ASSERT_MESSAGE("value not imported correctly", fValue == 1);
- pDoc->GetValue(0,1,0,fValue);
+ rDoc.GetValue(0,1,0,fValue);
CPPUNIT_ASSERT_MESSAGE("value not imported correctly", fValue == 2);
- OUString aString = pDoc->GetString(1, 0, 0);
+ OUString aString = rDoc.GetString(1, 0, 0);
//check string import
CPPUNIT_ASSERT_MESSAGE("string imported not correctly", aString == "String1");
- aString = pDoc->GetString(1, 1, 0);
+ aString = rDoc.GetString(1, 1, 0);
CPPUNIT_ASSERT_MESSAGE("string not imported correctly", aString == "String2");
//check basic formula import
// in case of DIF it just contains values
- pDoc->GetValue(2,0,0,fValue);
+ rDoc.GetValue(2,0,0,fValue);
CPPUNIT_ASSERT_MESSAGE("=2*3", fValue == 6);
- pDoc->GetValue(2,1,0,fValue);
+ rDoc.GetValue(2,1,0,fValue);
CPPUNIT_ASSERT_MESSAGE("=2+3", fValue == 5);
- pDoc->GetValue(2,2,0,fValue);
+ rDoc.GetValue(2,2,0,fValue);
CPPUNIT_ASSERT_MESSAGE("=2-3", fValue == -1);
- pDoc->GetValue(2,3,0,fValue);
+ rDoc.GetValue(2,3,0,fValue);
CPPUNIT_ASSERT_MESSAGE("=C1+C2", fValue == 11);
//check merged cells import
@@ -209,12 +209,12 @@ void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods,
{
SCCOL nCol = 4;
SCROW nRow = 1;
- pDoc->ExtendMerge(4, 1, nCol, nRow, 0, false);
+ rDoc.ExtendMerge(4, 1, nCol, nRow, 0, false);
CPPUNIT_ASSERT_MESSAGE("merged cells are not imported", nCol == 5 && nRow == 2);
//check notes import
ScAddress aAddress(7, 2, 0);
- ScPostIt* pNote = pDoc->GetNote(aAddress);
+ ScPostIt* pNote = rDoc.GetNote(aAddress);
CPPUNIT_ASSERT_MESSAGE("note not imported", pNote);
CPPUNIT_ASSERT_EQUAL_MESSAGE("note text not imported correctly", pNote->GetText(), OUString("Test"));
}
@@ -229,8 +229,8 @@ void ScFiltersTest::testContentODS()
ScDocShellRef xDocSh = loadDoc("universal-content.", ODS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testContentImpl(pDoc, ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testContentImpl(rDoc, ODS);
xDocSh->DoClose();
}
@@ -239,8 +239,8 @@ void ScFiltersTest::testContentXLS()
ScDocShellRef xDocSh = loadDoc("universal-content.", XLS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testContentImpl(pDoc, XLS);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testContentImpl(rDoc, XLS);
xDocSh->DoClose();
}
@@ -249,8 +249,8 @@ void ScFiltersTest::testContentXLSX()
ScDocShellRef xDocSh = loadDoc("universal-content.", XLSX);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testContentImpl(pDoc, XLSX);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testContentImpl(rDoc, XLSX);
xDocSh->DoClose();
}
@@ -259,8 +259,8 @@ void ScFiltersTest::testContentXLSXStrict()
ScDocShellRef xDocSh = loadDoc("universal-content-strict.", XLSX);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testContentImpl(pDoc, XLSX);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testContentImpl(rDoc, XLSX);
xDocSh->DoClose();
}
@@ -269,9 +269,9 @@ void ScFiltersTest::testContentLotus123()
ScDocShellRef xDocSh = loadDoc("universal-content.", LOTUS123);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- testContentImpl(pDoc, LOTUS123);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc);
+ testContentImpl(rDoc, LOTUS123);
xDocSh->DoClose();
}
@@ -279,8 +279,8 @@ void ScFiltersTest::testContentDIF()
{
ScDocShellRef xDocSh = loadDoc("universal-content.", DIF);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc);
xDocSh->DoClose();
}
@@ -289,8 +289,8 @@ void ScFiltersTest::testContentDIF()
// ScDocShellRef xDocSh = loadDoc("universal-content.", XLS_XML);
// CPPUNIT_ASSERT(xDocSh);
//
-// ScDocument* pDoc = xDocSh->GetDocument();
-// CPPUNIT_ASSERT(pDoc);
+// ScDocument& rDoc = xDocSh->GetDocument();
+// CPPUNIT_ASSERT(&rDoc);
// testContentImpl(pDoc, XLS_XML);
// xDocSh->DoClose();
// }
@@ -299,17 +299,17 @@ void ScFiltersTest::testSharedFormulaXLS()
{
ScDocShellRef xDocSh = loadDoc("shared-formula/basic.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
xDocSh->DoHardRecalc(true);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 18; ++i)
{
- double fVal = pDoc->GetValue(ScAddress(1,i,0));
+ double fVal = rDoc.GetValue(ScAddress(1,i,0));
double fCheck = i*10.0;
CPPUNIT_ASSERT_EQUAL(fCheck, fVal);
}
- ScFormulaCell* pCell = pDoc->GetFormulaCell(ScAddress(1,18,0));
+ ScFormulaCell* pCell = rDoc.GetFormulaCell(ScAddress(1,18,0));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pCell);
ScFormulaCellGroupRef xGroup = pCell->GetCellGroup();
CPPUNIT_ASSERT_MESSAGE("This cell should be a part of a cell group.", xGroup);
@@ -323,40 +323,40 @@ void ScFiltersTest::testSharedFormulaXLS()
xDocSh = loadDoc("shared-formula/gap.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- pDoc = xDocSh->GetDocument();
- pDoc->CalcAll();
+ ScDocument& rDoc2 = xDocSh->GetDocument();
+ rDoc2.CalcAll();
- if (!checkFormula(*pDoc, ScAddress(1,0,0), "A1*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,0,0), "A1*20"))
CPPUNIT_FAIL("Wrong formula.");
- if (!checkFormula(*pDoc, ScAddress(1,1,0), "A2*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,1,0), "A2*20"))
CPPUNIT_FAIL("Wrong formula.");
- if (!checkFormula(*pDoc, ScAddress(1,2,0), "A3*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,2,0), "A3*20"))
CPPUNIT_FAIL("Wrong formula.");
// There is an intentional gap at row 4.
- if (!checkFormula(*pDoc, ScAddress(1,4,0), "A5*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,4,0), "A5*20"))
CPPUNIT_FAIL("Wrong formula.");
- if (!checkFormula(*pDoc, ScAddress(1,5,0), "A6*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,5,0), "A6*20"))
CPPUNIT_FAIL("Wrong formula.");
- if (!checkFormula(*pDoc, ScAddress(1,6,0), "A7*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,6,0), "A7*20"))
CPPUNIT_FAIL("Wrong formula.");
- if (!checkFormula(*pDoc, ScAddress(1,7,0), "A8*20"))
+ if (!checkFormula(rDoc2, ScAddress(1,7,0), "A8*20"))
CPPUNIT_FAIL("Wrong formula.");
// We re-group formula cells on load. Let's check that as well.
- ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1,0,0));
+ ScFormulaCell* pFC = rDoc2.GetFormulaCell(ScAddress(1,0,0));
CPPUNIT_ASSERT_MESSAGE("Failed to fetch formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This should be the top cell in formula group.", pFC->IsSharedTop());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(3), pFC->GetSharedLength());
- pFC = pDoc->GetFormulaCell(ScAddress(1,4,0));
+ pFC = rDoc2.GetFormulaCell(ScAddress(1,4,0));
CPPUNIT_ASSERT_MESSAGE("Failed to fetch formula cell.", pFC);
CPPUNIT_ASSERT_MESSAGE("This should be the top cell in formula group.", pFC->IsSharedTop());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(4), pFC->GetSharedLength());
@@ -367,18 +367,18 @@ void ScFiltersTest::testSharedFormulaXLS()
void ScFiltersTest::testSharedFormulaXLSX()
{
ScDocShellRef xDocSh = loadDoc("shared-formula/basic.", XLSX);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc);
xDocSh->DoHardRecalc(true);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 18; ++i)
{
- double fVal = pDoc->GetValue(ScAddress(1,i,0));
+ double fVal = rDoc.GetValue(ScAddress(1,i,0));
double fCheck = i*10.0;
CPPUNIT_ASSERT_EQUAL(fCheck, fVal);
}
- ScFormulaCell* pCell = pDoc->GetFormulaCell(ScAddress(1,18,0));
+ ScFormulaCell* pCell = rDoc.GetFormulaCell(ScAddress(1,18,0));
CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pCell);
ScFormulaCellGroupRef xGroup = pCell->GetCellGroup();
CPPUNIT_ASSERT_MESSAGE("This cell should be a part of a cell group.", xGroup);
@@ -387,9 +387,9 @@ void ScFiltersTest::testSharedFormulaXLSX()
xDocSh->DoClose();
}
-void impl_testLegacyCellAnchoredRotatedShape( ScDocument* pDoc, Rectangle& aRect, ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ )
+void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, Rectangle& aRect, ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ )
{
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
CPPUNIT_ASSERT_MESSAGE("No drawing layer.", pDrawLayer);
SdrPage* pPage = pDrawLayer->GetPage(0);
CPPUNIT_ASSERT_MESSAGE("No page instance for the 1st sheet.", pPage);
@@ -427,8 +427,8 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
// is a good edge case test to see if we import it still correctly )
ScDocShellRef xDocSh = loadDoc("legacycellanchoredrotatedclippedshape.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc);
// ensure the imported legacy rotated shape is in the expected position
Rectangle aRect( 6000, -2000, 8000, 4000 );
// ensure the imported ( and converted ) anchor ( note we internally now store the anchor in
@@ -438,14 +438,14 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
aAnchor.maStart.SetCol( 5 );
aAnchor.maEnd.SetRow( 3 );
aAnchor.maEnd.SetCol( 7 );
- impl_testLegacyCellAnchoredRotatedShape( pDoc, aRect, aAnchor );
+ impl_testLegacyCellAnchoredRotatedShape( rDoc, aRect, aAnchor );
// test save and reload
// for some reason having this test in subsequent_export-test.cxx causes
// a core dump in editeng ( so moved to here )
xDocSh = saveAndReload( &(*xDocSh), ODS);
- pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- impl_testLegacyCellAnchoredRotatedShape( pDoc, aRect, aAnchor );
+ ScDocument& rDoc2 = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc2);
+ impl_testLegacyCellAnchoredRotatedShape( rDoc2, aRect, aAnchor );
xDocSh->DoClose();
}
@@ -455,8 +455,8 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
// the shape is completely hidden because the rows the shape occupies
// are hidden
ScDocShellRef xDocSh = loadDoc("legacycellanchoredrotatedhiddenshape.", ODS, true);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc);
// ensure the imported legacy rotated shape is in the expected position
// when a shape is fully hidden reloading seems to result is in some errors, usually
// ( same but different error happens pre-patch ) - we should do better here, I regard it
@@ -470,12 +470,12 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
aAnchor.maStart.SetCol( 5 );
aAnchor.maEnd.SetRow( 3 );
aAnchor.maEnd.SetCol( 7 );
- pDoc->ShowRows(0, 9, 0, true); // show relavent rows
- pDoc->SetDrawPageSize(0); // trigger recalcpos
+ rDoc.ShowRows(0, 9, 0, true); // show relavent rows
+ rDoc.SetDrawPageSize(0); // trigger recalcpos
// apply hefty ( 1 mm ) tolerence here, as some opensuse tinderbox
// failing
- impl_testLegacyCellAnchoredRotatedShape( pDoc, aRect, aAnchor, 100 );
+ impl_testLegacyCellAnchoredRotatedShape( rDoc, aRect, aAnchor, 100 );
xDocSh->DoClose();
}
@@ -483,8 +483,8 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
// This example doc contains cell anchored shape that is rotated
ScDocShellRef xDocSh = loadDoc("legacycellanchoredrotatedshape.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc);
// ensure the imported legacy rotated shape is in the expected position
Rectangle aRect( 6000, 3000, 8000, 9000 );
// ensure the imported ( and converted ) anchor ( note we internally now store the anchor in
@@ -496,20 +496,20 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape()
aAnchor.maEnd.SetRow( 9 );
aAnchor.maEnd.SetCol( 7 );
// test import
- impl_testLegacyCellAnchoredRotatedShape( pDoc, aRect, aAnchor );
+ impl_testLegacyCellAnchoredRotatedShape( rDoc, aRect, aAnchor );
// test save and reload
xDocSh = saveAndReload( &(*xDocSh), ODS);
- pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- impl_testLegacyCellAnchoredRotatedShape( pDoc, aRect, aAnchor );
+ ScDocument& rDoc2 = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(&rDoc2);
+ impl_testLegacyCellAnchoredRotatedShape( rDoc2, aRect, aAnchor );
xDocSh->DoClose();
}
}
-void testEnhancedProtectionImpl( ScDocument* pDoc )
+void testEnhancedProtectionImpl( ScDocument& rDoc )
{
- const ScTableProtection* pProt = pDoc->GetTabProtection(0);
+ const ScTableProtection* pProt = rDoc.GetTabProtection(0);
CPPUNIT_ASSERT( pProt);
@@ -528,9 +528,9 @@ void ScFiltersTest::testEnhancedProtectionXLS()
{
ScDocShellRef xDocSh = loadDoc("enhanced-protection.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testEnhancedProtectionImpl( pDoc);
+ testEnhancedProtectionImpl( rDoc);
xDocSh->DoClose();
}
@@ -539,9 +539,9 @@ void ScFiltersTest::testEnhancedProtectionXLSX()
{
ScDocShellRef xDocSh = loadDoc("enhanced-protection.", XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testEnhancedProtectionImpl( pDoc);
+ testEnhancedProtectionImpl( rDoc);
xDocSh->DoClose();
}
@@ -550,16 +550,16 @@ void ScFiltersTest::testSortWithSharedFormulasODS()
{
ScDocShellRef xDocSh = loadDoc("shared-formula/sort-crash.", ODS, true);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// E2:E10 should be shared.
- const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(4,1,0));
+ const ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(4,1,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(9), pFC->GetSharedLength());
// E12:E17 should be shared.
- pFC = pDoc->GetFormulaCell(ScAddress(4,11,0));
+ pFC = rDoc.GetFormulaCell(ScAddress(4,11,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(11), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(6), pFC->GetSharedLength());
@@ -567,7 +567,7 @@ void ScFiltersTest::testSortWithSharedFormulasODS()
// Set A1:E17 as an anonymous database range to sheet, or else Calc would
// refuse to sort the range.
ScDBData* pDBData = new ScDBData(STR_DB_LOCAL_NONAME, 0, 0, 0, 4, 16, true, true);
- pDoc->SetAnonymousDBData(0, pDBData);
+ rDoc.SetAnonymousDBData(0, pDBData);
// Sort ascending by Column E.
@@ -587,7 +587,7 @@ void ScFiltersTest::testSortWithSharedFormulasODS()
CPPUNIT_ASSERT(bSorted);
// After the sort, E2:E16 should be shared.
- pFC = pDoc->GetFormulaCell(ScAddress(4,1,0));
+ pFC = rDoc.GetFormulaCell(ScAddress(4,1,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(15), pFC->GetSharedLength());
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 91b4a12d1724..a22e3bc17d44 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -109,9 +109,9 @@ void loadFile(const OUString& aFileName, std::string& aContent)
#if ENABLE_ORCUS
-void testFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab, StringType aStringFormat)
+void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat)
{
- csv_handler aHandler(pDoc, nTab, aStringFormat);
+ csv_handler aHandler(&rDoc, nTab, aStringFormat);
orcus::csv::parser_config aConfig;
aConfig.delimiters.push_back(',');
aConfig.delimiters.push_back(';');
@@ -170,7 +170,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
//test Sheet1 with csv file
OUString aCSVFileName;
pTest->createCSVPath(OUString("numberFormat."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 0, PureString);
+ testFile(aCSVFileName, *pDoc, 0, PureString);
//need to test the color of B3
//it's not a font color!
//formatting for B5: # ??/100 gets lost during import
@@ -535,7 +535,7 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite,
pFilter->SetVersion(nFilterVersion);
ScDocShellRef xDocShRef = new ScDocShell;
- xDocShRef->GetDocument()->EnableUserInteraction(false);
+ xDocShRef->GetDocument().EnableUserInteraction(false);
SfxMedium* pSrcMed = new SfxMedium(rURL, bReadWrite ? STREAM_STD_READWRITE : STREAM_STD_READ );
pSrcMed->SetFilter(pFilter);
pSrcMed->UseInteractionHandler(false);
@@ -663,7 +663,7 @@ void ScBootstrapFixture::miscRowHeightsTest( TestParam* aTestValues, unsigned in
CPPUNIT_ASSERT(xShell.Is());
- ScDocument* pDoc = xShell->GetDocument();
+ ScDocument& rDoc = xShell->GetDocument();
for (int i=0; i<aTestValues[ index ].nRowData; ++i)
{
@@ -677,10 +677,10 @@ void ScBootstrapFixture::miscRowHeightsTest( TestParam* aTestValues, unsigned in
for ( ; nRow <= nEndRow; ++nRow )
{
SAL_INFO( "sc.qa", " checking row " << nRow << " for height " << nExpectedHeight );
- int nHeight = sc::TwipsToHMM( pDoc->GetRowHeight(nRow, nTab, false) );
+ int nHeight = sc::TwipsToHMM( rDoc.GetRowHeight(nRow, nTab, false) );
if ( bCheckOpt )
{
- bool bOpt = !(pDoc->GetRowFlags( nRow, nTab ) & CR_MANUALSIZE);
+ bool bOpt = !(rDoc.GetRowFlags( nRow, nTab ) & CR_MANUALSIZE);
CPPUNIT_ASSERT_EQUAL(aTestValues[ index ].pData[ i ].bOptimal, bOpt);
}
CPPUNIT_ASSERT_EQUAL(nExpectedHeight, nHeight);
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 805c6d2a596a..193fc489c7f2 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -108,7 +108,7 @@ std::ostream& operator<<(std::ostream& rStrm, const Color& rColor);
SCQAHELPER_DLLPUBLIC void loadFile(const OUString& aFileName, std::string& aContent);
-SCQAHELPER_DLLPUBLIC void testFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab, StringType aStringFormat = StringValue);
+SCQAHELPER_DLLPUBLIC void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat = StringValue);
//need own handler because conditional formatting strings must be generated
SCQAHELPER_DLLPUBLIC void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab);
diff --git a/sc/qa/unit/helper/shared_test_impl.hxx b/sc/qa/unit/helper/shared_test_impl.hxx
index 8be0a71dd548..c339efa20c46 100644
--- a/sc/qa/unit/helper/shared_test_impl.hxx
+++ b/sc/qa/unit/helper/shared_test_impl.hxx
@@ -48,9 +48,9 @@ DataBarData aData[] = {
{ ScRange(1,9,0,1,12,0), COLORSCALE_AUTO, COLORSCALE_AUTO, databar::MIDDLE }
};
-void testDataBar_Impl(ScDocument* pDoc)
+void testDataBar_Impl(ScDocument& rDoc)
{
- ScConditionalFormatList* pList = pDoc->GetCondFormList(0);
+ ScConditionalFormatList* pList = rDoc.GetCondFormList(0);
CPPUNIT_ASSERT(pList);
for(size_t i = 0; i < SAL_N_ELEMENTS(aData); ++i)
@@ -85,9 +85,9 @@ ColorScale2EntryData aData2Entry[] = {
{ ScRange(5,2,0,5,5,0), COLORSCALE_VALUE, COLORSCALE_FORMULA }
};
-void testColorScale2Entry_Impl(ScDocument* pDoc)
+void testColorScale2Entry_Impl(ScDocument& rDoc)
{
- const ScConditionalFormatList* pList = pDoc->GetCondFormList(0);
+ const ScConditionalFormatList* pList = rDoc.GetCondFormList(0);
CPPUNIT_ASSERT(pList);
for(size_t i = 0; i < SAL_N_ELEMENTS(aData2Entry); ++i)
@@ -124,9 +124,9 @@ ColorScale3EntryData aData3Entry[] = {
{ ScRange(5,1,1,5,6,1), COLORSCALE_VALUE, COLORSCALE_VALUE, COLORSCALE_FORMULA }
};
-void testColorScale3Entry_Impl(ScDocument* pDoc)
+void testColorScale3Entry_Impl(ScDocument& rDoc)
{
- ScConditionalFormatList* pList = pDoc->GetCondFormList(1);
+ ScConditionalFormatList* pList = rDoc.GetCondFormList(1);
CPPUNIT_ASSERT(pList);
for(size_t i = 0; i < SAL_N_ELEMENTS(aData3Entry); ++i)
@@ -152,7 +152,7 @@ void testColorScale3Entry_Impl(ScDocument* pDoc)
}
}
-void testFunctionsExcel2010_Impl( ScDocument* pDoc )
+void testFunctionsExcel2010_Impl( ScDocument& rDoc )
{
// Original test case document is functions-excel-2010.xlsx
// Which test rows to evaluate, 1-based as in UI to ease maintenance.
@@ -252,20 +252,20 @@ void testFunctionsExcel2010_Impl( ScDocument* pDoc )
OString aStr = OString::number( aTests[i].nRow) +
", function name=[ " +
- OUStringToOString( pDoc->GetString( ScAddress( 0, nRow, 0)), RTL_TEXTENCODING_UTF8 ) +
+ OUStringToOString( rDoc.GetString( ScAddress( 0, nRow, 0)), RTL_TEXTENCODING_UTF8 ) +
" ], result=" +
- OString::number( pDoc->GetValue( ScAddress( 1, nRow, 0)) ) +
+ OString::number( rDoc.GetValue( ScAddress( 1, nRow, 0)) ) +
", expected=" +
- OString::number( pDoc->GetValue( ScAddress( 2, nRow, 0)) );
+ OString::number( rDoc.GetValue( ScAddress( 2, nRow, 0)) );
- ScFormulaCell* pFC = pDoc->GetFormulaCell( ScAddress( 1, nRow, 0) );
+ ScFormulaCell* pFC = rDoc.GetFormulaCell( ScAddress( 1, nRow, 0) );
if ( pFC && pFC->GetErrCode() != 0 )
aStr += ", error code =" + OString::number( pFC->GetErrCode() );
CPPUNIT_ASSERT_MESSAGE( OString( "Expected a formula cell without error at row " +
- aStr ).getStr(), isFormulaWithoutError( *pDoc, ScAddress( 1, nRow, 0)));
+ aStr ).getStr(), isFormulaWithoutError( rDoc, ScAddress( 1, nRow, 0)));
CPPUNIT_ASSERT_MESSAGE( OString( "Expected a TRUE value at row " +
- aStr ).getStr(), 0 != pDoc->GetValue( ScAddress( 3, nRow, 0)));
+ aStr ).getStr(), 0 != rDoc.GetValue( ScAddress( 3, nRow, 0)));
}
}
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index ee6b2e3e7051..21e074958d9c 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -556,25 +556,23 @@ void ScOpenclTest::testCompilerHorizontal()
return;
ScDocShellRef xDocSh = loadDoc("opencl/compiler/horizontal.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/compiler/horizontal.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i < 5; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(12, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(12, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(12, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(12, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(13, i, 0));
- fExcel = pDocRes->GetValue(ScAddress(13, i, 0));
+ fLibre = rDoc.GetValue(ScAddress(13, i, 0));
+ fExcel = rDocRes.GetValue(ScAddress(13, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(14, i, 0));
- fExcel = pDocRes->GetValue(ScAddress(14, i, 0));
+ fLibre = rDoc.GetValue(ScAddress(14, i, 0));
+ fExcel = rDocRes.GetValue(ScAddress(14, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -586,19 +584,17 @@ void ScOpenclTest::testCompilerNested()
return;
ScDocShellRef xDocSh = loadDoc("opencl/compiler/nested.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/compiler/nested.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i < 5; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -612,24 +608,22 @@ void ScOpenclTest::testCompilerString()
ScDocShellRef xDocSh = loadDoc("opencl/compiler/string.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/compiler/string.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocShRes.Is());
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i < 5; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -643,20 +637,18 @@ void ScOpenclTest::testCompilerInEq()
ScDocShellRef xDocSh = loadDoc("opencl/compiler/ineq.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/compiler/ineq.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocShRes.Is());
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i < 7; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -670,25 +662,23 @@ void ScOpenclTest::testSharedFormulaXLSStockHistory()
return;
ScDocShellRef xDocSh = loadDoc("stock-history.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("stock-history.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 33; i < 44; ++i)
{ // Cell H34:H44 in S&P 500 (tab 1)
- double fLibre = pDoc->GetValue(ScAddress(7, i, 1));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 1));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 1));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 0.0001*fExcel);
}
for (SCROW i = 33; i < 44; ++i)
{ // Cell J34:J44 in S&P 500 (tab 1)
- double fLibre = pDoc->GetValue(ScAddress(9, i, 1));
- double fExcel = pDocRes->GetValue(ScAddress(9, i, 1));
+ double fLibre = rDoc.GetValue(ScAddress(9, i, 1));
+ double fExcel = rDocRes.GetValue(ScAddress(9, i, 1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 0.0001*fExcel);
}
@@ -702,18 +692,16 @@ void ScOpenclTest::testSharedFormulaXLSGroundWater()
return;
ScDocShellRef xDocSh = loadDoc("ground-water-daily.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("ground-water-daily.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 5; i <= 77; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(11,i,1));
- double fExcel = pDocRes->GetValue(ScAddress(11,i,1));
+ double fLibre = rDoc.GetValue(ScAddress(11,i,1));
+ double fExcel = rDocRes.GetValue(ScAddress(11,i,1));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
xDocSh->DoClose();
@@ -727,50 +715,48 @@ void ScOpenclTest::testSharedFormulaXLS()
return;
ScDocShellRef xDocSh = loadDoc("sum_ex.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("sum_ex.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
// AMLOEXT-5
for (SCROW i = 0; i < 5; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-6
for (SCROW i = 6; i < 14; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-8
for (SCROW i = 15; i < 18; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-10
for (SCROW i = 19; i < 22; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-9
for (SCROW i = 23; i < 25; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- //double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ //double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
// There seems to be a bug in LibreOffice beta
ASSERT_DOUBLES_EQUAL(/*fExcel*/ 60.0, fLibre);
}
@@ -778,34 +764,34 @@ void ScOpenclTest::testSharedFormulaXLS()
// AMLOEXT-9
for (SCROW i = 25; i < 27; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-11
for (SCROW i = 28; i < 35; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-11; workaround for a Calc beta bug
- ASSERT_DOUBLES_EQUAL(25.0, pDoc->GetValue(ScAddress(2, 35, 0)));
- ASSERT_DOUBLES_EQUAL(24.0, pDoc->GetValue(ScAddress(2, 36, 0)));
+ ASSERT_DOUBLES_EQUAL(25.0, rDoc.GetValue(ScAddress(2, 35, 0)));
+ ASSERT_DOUBLES_EQUAL(24.0, rDoc.GetValue(ScAddress(2, 36, 0)));
// AMLOEXT-12
for (SCROW i = 38; i < 43; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
// AMLOEXT-14
for (SCROW i = 5; i < 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 1));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 1));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 1));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 1));
ASSERT_DOUBLES_EQUAL(fExcel, fLibre);
}
@@ -814,8 +800,8 @@ void ScOpenclTest::testSharedFormulaXLS()
{
for (SCCOL j = 6; j < 11; ++j)
{
- double fLibre = pDoc->GetValue(ScAddress(j, i, 1));
- double fExcel = pDocRes->GetValue(ScAddress(j, i, 1));
+ double fLibre = rDoc.GetValue(ScAddress(j, i, 1));
+ double fExcel = rDocRes.GetValue(ScAddress(j, i, 1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre,
fabs(fExcel*0.0001));
}
@@ -830,17 +816,15 @@ void ScOpenclTest::testMathFormulaCos()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/cos.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/cos.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -853,15 +837,15 @@ void ScOpenclTest::testMathFormulaSinh()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sinh.", XLS);
- enableOpenCL(); ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc); xDocSh->DoHardRecalc(true);
+ enableOpenCL();
+ ScDocument& rDoc = xDocSh->GetDocument();
+ xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("opencl/math/sinh.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -874,17 +858,15 @@ void ScOpenclTest::testMathFormulaPi()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/pi.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/pi.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(0,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(0,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(0,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(0,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -897,17 +879,15 @@ void ScOpenclTest::testMathFormulaRandom()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/random.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/random.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(0,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(0,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(0,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(0,i,0));
//because the random numbers will always change,so give the test "true"
(void) fLibre;
(void) fExcel;
@@ -923,152 +903,150 @@ void ScOpenclTest::testFinacialFormula()
ScDocShellRef xDocSh = loadDoc("opencl/financial/general.", XLS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/general.", XLS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocShRes.Is());
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
// AMLOEXT-22
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,1));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,1));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,1));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-23]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,2));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,2));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,2));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,2));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-24]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,3));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,3));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,3));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,3));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-25]
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,4));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,4));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,4));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,4));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-26]
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,5));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,5));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,5));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,5));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-27]
for (SCROW i = 0; i < 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,6));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,6));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,6));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,6));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-28]
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,7));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,7));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,7));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,7));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-29]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,8));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,8));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,8));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,8));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-30]
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,9));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,9));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,9));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,9));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-31]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,10));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,10));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,10));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,10));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-32]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7,i,11));
- double fExcel = pDocRes->GetValue(ScAddress(7,i,11));
+ double fLibre = rDoc.GetValue(ScAddress(7,i,11));
+ double fExcel = rDocRes.GetValue(ScAddress(7,i,11));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-33]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,12));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,12));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,12));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,12));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-34]
for (SCROW i = 0; i <= 12; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,13));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,13));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,13));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,13));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-35]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,14));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,14));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,14));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,14));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-36]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,15));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,15));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,15));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,15));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-37]
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,16));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,16));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,16));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,16));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-38]
for (SCROW i = 1; i <= 5; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,17));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,17));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,17));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,17));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-39]
for (SCROW i = 0; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,18));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,18));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,18));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,18));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
//[AMLOEXT-42]
for (SCROW i = 0; i <= 18; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,19));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,19));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,19));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,19));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1082,20 +1060,18 @@ void ScOpenclTest::testStatisticalFormulaCorrel()
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Correl.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Correl.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load document.", xDocShRes.Is());
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1108,19 +1084,17 @@ void ScOpenclTest::testStatisticalFormulaFisher()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Fisher.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Fisher.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1133,19 +1107,17 @@ void ScOpenclTest::testStatisticalFormulaFisherInv()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/FisherInv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/FisherInv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1158,19 +1130,17 @@ void ScOpenclTest::testStatisticalFormulaGamma()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Gamma.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Gamma.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1182,17 +1152,15 @@ void ScOpenclTest::testFinacialFvscheduleFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Fvschedule.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Fvschedule.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1203,22 +1171,18 @@ void ScOpenclTest::testMathFormulaAbs()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/Abs.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/Abs.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/Abs.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/Abs.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ABS Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1230,17 +1194,15 @@ void ScOpenclTest::testFinacialSYDFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/SYD.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/SYD.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1253,17 +1215,15 @@ void ScOpenclTest::testFinacialIRRFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/IRR.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/IRR.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1275,19 +1235,17 @@ void ScOpenclTest::testStatisticalFormulaGammaLn()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/GammaLn.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/GammaLn.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1299,18 +1257,16 @@ void ScOpenclTest::testStatisticalFormulaGauss()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Gauss.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Gauss.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1322,19 +1278,17 @@ void ScOpenclTest::testStatisticalFormulaGeoMean()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/GeoMean.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/GeoMean.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1346,19 +1300,17 @@ void ScOpenclTest::testStatisticalFormulaHarMean()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/HarMean.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/HarMean.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1370,17 +1322,15 @@ void ScOpenclTest::testFinacialSLNFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/SLN.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/SLN.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1392,17 +1342,15 @@ void ScOpenclTest::testFinacialMIRRFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/MIRR.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/MIRR.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1415,17 +1363,15 @@ void ScOpenclTest::testFinancialCoupdaybsFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupdaybs.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupdaybs.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <=10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1437,17 +1383,15 @@ void ScOpenclTest::testFinacialDollardeFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Dollarde.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Dollarde.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1459,17 +1403,15 @@ void ScOpenclTest::testFinancialCoupdaysFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupdays.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupdays.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <=10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1481,17 +1423,15 @@ void ScOpenclTest::testFinancialCoupdaysncFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupdaysnc.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupdaysnc.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <=10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1502,17 +1442,15 @@ void ScOpenclTest::testFinacialRateFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/RATE.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/RATE.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 5; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1524,17 +1462,15 @@ void ScOpenclTest::testFinancialAccrintmFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Accrintm.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Accrintm.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1546,17 +1482,15 @@ void ScOpenclTest::testFinancialCoupnumFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupnum.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupnum.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1569,18 +1503,16 @@ void ScOpenclTest::testStatisticalFormulaNegbinomdist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Negbinomdist." ,XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Negbinomdist." ,XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1592,17 +1524,15 @@ void ScOpenclTest::testMathFormulaSin()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sin.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sin.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1614,17 +1544,15 @@ void ScOpenclTest::testMathFormulaSumSQ()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sumsq.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sumsq.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i < 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1636,17 +1564,15 @@ void ScOpenclTest::testMathFormulaTan()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/tan.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/tan.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1658,17 +1584,15 @@ void ScOpenclTest::testMathFormulaTanH()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/tanh.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/tanh.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1680,17 +1604,15 @@ void ScOpenclTest::testMathFormulaSqrt()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sqrt.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sqrt.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1702,17 +1624,15 @@ void ScOpenclTest::testFinacialPriceFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Price.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Price.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1724,17 +1644,15 @@ void ScOpenclTest::testFinacialDollarfrFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Dollarfr.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Dollarfr.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1746,17 +1664,15 @@ void ScOpenclTest::testFinacialPriceDiscFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PriceDisc.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PriceDisc.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1768,17 +1684,15 @@ void ScOpenclTest::testFinacialODDLPRICEFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Oddlprice.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Oddlprice.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(8, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(8, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(8, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(8, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1790,17 +1704,15 @@ void ScOpenclTest:: testFinacialOddlyieldFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Oddlyield.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Oddlyield.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(8, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(8, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(8, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(8, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1812,17 +1724,15 @@ void ScOpenclTest::testFinacialDISCFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/DISC.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/DISC.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1834,17 +1744,15 @@ void ScOpenclTest:: testFinacialPVFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PV.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PV.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1856,17 +1764,15 @@ void ScOpenclTest::testFinacialINTRATEFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/INTRATE.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/INTRATE.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1879,19 +1785,17 @@ void ScOpenclTest::testStatisticalFormulaStandard()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Standard.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Standard.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1904,19 +1808,17 @@ void ScOpenclTest::testStatisticalFormulaWeibull()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Weibull.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Weibull.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre,
fExcel == 0?1e-4:fabs(1e-4*fExcel));
}
@@ -1930,19 +1832,17 @@ void ScOpenclTest::testStatisticalFormulaVar()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Var.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Var.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1955,19 +1855,17 @@ void ScOpenclTest::testStatisticalFormulaSkew()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Skew.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Skew.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -1980,19 +1878,17 @@ void ScOpenclTest::testStatisticalFormulaSkewp()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Skewp.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Skewp.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2004,18 +1900,16 @@ void ScOpenclTest::testStatisticalFormulaPearson()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Pearson.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Pearson.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2027,18 +1921,16 @@ void ScOpenclTest::testStatisticalFormulaRsq()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Rsq.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Rsq.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2050,17 +1942,15 @@ void ScOpenclTest::testMathFormulaTrunc()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/trunc.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/trunc.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2073,17 +1963,15 @@ void ScOpenclTest::testMathFormulaCosh()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/cosh.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/cosh.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2095,19 +1983,17 @@ void ScOpenclTest::testStatisticalFormulaCovar()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Covar.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Covar.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 16; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2120,18 +2006,16 @@ void ScOpenclTest::testStatisticalFormulaKurt()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Kurt.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Kurt.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2144,17 +2028,15 @@ void ScOpenclTest::testMathFormulaCot()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/cot.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/cot.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2167,19 +2049,17 @@ void ScOpenclTest::testStatisticalFormulaDevSq()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/DevSq.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/DevSq.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 11; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2191,17 +2071,15 @@ void ScOpenclTest::testMathFormulaCsc()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/csc.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/csc.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2214,17 +2092,15 @@ void ScOpenclTest::testMathFormulaCoth()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/coth.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/coth.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2236,24 +2112,22 @@ void ScOpenclTest::testFinacialXNPVFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/XNPV.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/XNPV.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 16; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2266,17 +2140,15 @@ void ScOpenclTest::testStatisticalFormulaIntercept()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Intercept.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Intercept.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2288,17 +2160,15 @@ void ScOpenclTest::testFinancialAmordegrcFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Amordegrc.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Amordegrc.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2310,17 +2180,15 @@ void ScOpenclTest:: testFinancialISPMTFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/ISPMT.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/ISPMT.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2332,18 +2200,16 @@ void ScOpenclTest::testStatisticalFormulaMedian()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Median.",XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Median.",XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2355,18 +2221,16 @@ void ScOpenclTest::testStatisticalFormulaNormdist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Normdist.",XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Normdist.",XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2378,18 +2242,16 @@ void ScOpenclTest::testStatisticalFormulaNormsdist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Normsdist.",XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Normsdist.",XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2401,18 +2263,16 @@ void ScOpenclTest::testStatisticalFormulaPermut()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Permut.",XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Permut.",XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2424,18 +2284,16 @@ void ScOpenclTest::testStatisticalFormulaPermutation()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Permutation.",XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Permutation.",XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2447,18 +2305,16 @@ void ScOpenclTest::testStatisticalFormulaPhi()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Phi.",XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Phi.",XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2470,17 +2326,15 @@ void ScOpenclTest::testMathFormulaCscH()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/csch.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/csch.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2493,18 +2347,16 @@ void ScOpenclTest::testStatisticalFormulaLogInv()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/LogInv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/LogInv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2516,17 +2368,15 @@ void ScOpenclTest::testFinacialNPERFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/NPER.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/NPER.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2539,18 +2389,16 @@ void ScOpenclTest::testStatisticalFormulaForecast()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Forecast.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Forecast.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2562,17 +2410,15 @@ void ScOpenclTest::testFinancialAmorlincFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Amorlinc.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Amorlinc.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2584,17 +2430,15 @@ void ScOpenclTest::testFinancialDDBFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/ddb.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/ddb.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2605,17 +2449,15 @@ void ScOpenclTest::testFinacialPriceMatFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PriceMat.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PriceMat.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2626,18 +2468,16 @@ void ScOpenclTest::testFinacialFormulaReceived()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Received.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Received.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i < 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2648,18 +2488,16 @@ void ScOpenclTest::testFinancialFormulaCumipmt()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Cumipmt.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Cumipmt.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2670,18 +2508,16 @@ void ScOpenclTest::testFinancialFormulaCumprinc()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Cumprinc.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Cumprinc.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2692,17 +2528,15 @@ void ScOpenclTest::testFinacialRRIFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/RRI.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/RRI.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2713,17 +2547,15 @@ void ScOpenclTest::testFinacialEFFECT_ADDFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/EFFECT_ADD.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/EFFECT_ADD.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2734,18 +2566,16 @@ void ScOpenclTest::testFinacialNominalFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Nominal.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Nominal.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2756,17 +2586,15 @@ void ScOpenclTest::testFinacialTBILLEQFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/TBILLEQ.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/TBILLEQ.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2777,17 +2605,15 @@ void ScOpenclTest::testFinacialTBILLPRICEFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/TBILLPRICE.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/TBILLPRICE.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2798,17 +2624,15 @@ void ScOpenclTest::testFinacialTBILLYIELDFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/TBILLYIELD.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/TBILLYIELD.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2819,17 +2643,15 @@ void ScOpenclTest::testFinacialYIELDFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/YIELD.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/YIELD.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2841,17 +2663,15 @@ void ScOpenclTest::testFinacialYIELDDISCFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/YIELDDISC.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/YIELDDISC.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2863,17 +2683,15 @@ void ScOpenclTest::testFinacialYIELDMATFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/YIELDMAT.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/YIELDMAT.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2884,17 +2702,15 @@ void ScOpenclTest:: testFinacialPMTFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PMT.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PMT.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2906,17 +2722,15 @@ void ScOpenclTest:: testFinancialDurationFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Duration.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Duration.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2929,19 +2743,17 @@ void ScOpenclTest::testStatisticalFormulaLogNormDist()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/LogNormDist.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/LogNormDist.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2952,21 +2764,17 @@ void ScOpenclTest::testMathFormulaArcCos()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcCos.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcCos.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcCos.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcCos.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ACos Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -2978,17 +2786,15 @@ void ScOpenclTest::testMathFormulaPower()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/power.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/power.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3000,17 +2806,15 @@ void ScOpenclTest:: testFinacialPPMTFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PPMT.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PPMT.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3022,17 +2826,15 @@ void ScOpenclTest:: testFinacialNPVFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/NPV.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/NPV.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3044,17 +2846,15 @@ void ScOpenclTest:: testFinancialDuration_ADDFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Duration_ADD.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Duration_ADD.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3066,18 +2866,16 @@ void ScOpenclTest::testStatisticalFormulaNorminv()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Norminv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Norminv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3089,18 +2887,16 @@ void ScOpenclTest::testStatisticalFormulaNormsinv()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Normsinv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Normsinv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3111,21 +2907,17 @@ void ScOpenclTest::testMathFormulaArcCosHyp()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcCosHyp.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcCosHyp.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcCosHyp.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcCosHyp.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ACosH Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3137,17 +2929,15 @@ void ScOpenclTest:: testFinancialMDurationFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/MDuration.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/MDuration.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3158,21 +2948,17 @@ void ScOpenclTest::testMathFormulaArcCot()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcCot.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcCot.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcCot.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcCot.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ACot Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3184,17 +2970,15 @@ void ScOpenclTest:: testFinancialFVFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/FV.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/FV.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3206,17 +2990,15 @@ void ScOpenclTest::testFinancialDBFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/db.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/db.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3228,17 +3010,15 @@ void ScOpenclTest::testFinancialCouppcdFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Couppcd.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Couppcd.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3250,35 +3030,33 @@ void ScOpenclTest::testMathSumIfsFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sumifs.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
sc::FormulaGroupInterpreter::enableOpenCL(true);
xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("opencl/math/sumifs.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 2; i <= 11; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 2; i <= 11; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 2; i <= 11; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(7,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(7,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(7,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 2; i <= 11; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(8,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(8,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(8,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(8,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3289,21 +3067,17 @@ void ScOpenclTest::testMathFormulaArcCotHyp()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcCotHyp.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcCotHyp.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcCotHyp.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcCotHyp.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ACotH Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3314,21 +3088,17 @@ void ScOpenclTest::testMathFormulaArcSin()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcSin.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcSin.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcSin.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcSin.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ACotH Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3340,29 +3110,27 @@ void ScOpenclTest:: testFinancialVDBFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/VDB.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/VDB.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 15; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 30; i <= 41; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3374,17 +3142,15 @@ void ScOpenclTest:: testFinancialIPMTFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/IPMT.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/IPMT.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3398,20 +3164,20 @@ void ScOpenclTest:: testFinancialXirrFormula()
ScDocShellRef xDocSh = loadDoc("opencl/financial/XIRR.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument *pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
for (SCROW i = 1; i <= 10; ++i)
{
- double fFormula = pDoc->GetValue(ScAddress(2, i, 0));
- double fExpected = pDoc->GetValue(ScAddress(3, i, 0));
+ double fFormula = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExpected = rDoc.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT(rtl::math::approxEqual(fExpected, fFormula));
}
for (SCROW i = 18; i <= 27; ++i)
{
- double fFormula = pDoc->GetValue(ScAddress(2, i, 0));
- double fExpected = pDoc->GetValue(ScAddress(3, i, 0));
+ double fFormula = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExpected = rDoc.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT(rtl::math::approxEqual(fExpected, fFormula));
}
@@ -3423,24 +3189,22 @@ void ScOpenclTest::testStatisticalFormulaChiSqDist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/CHISQDIST.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CHISQDIST.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3453,19 +3217,17 @@ void ScOpenclTest::testStatisticalFormulaConfidence()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Confidence.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Confidence.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3477,18 +3239,16 @@ void ScOpenclTest::testStatisticalFormulaFDist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Fdist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Fdist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3500,17 +3260,15 @@ void ScOpenclTest::testFinancialCoupncdFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupncd.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupncd.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3522,17 +3280,15 @@ void ScOpenclTest::testFinancialAccrintFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Accrint.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Accrint.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(7, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(7, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3545,19 +3301,17 @@ void ScOpenclTest::testStatisticalFormulaCritBinom()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/CritBinom.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CritBinom.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3568,21 +3322,17 @@ void ScOpenclTest::testMathFormulaArcSinHyp()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcSinHyp.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcSinHyp.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcSinHyp.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcSinHyp.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ASinH Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3593,21 +3343,17 @@ void ScOpenclTest::testMathFormulaArcTan()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcTan.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcTan.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcTan.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcTan.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ATan Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3618,21 +3364,17 @@ void ScOpenclTest::testMathFormulaArcTanHyp()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcTanHyp.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcTanHyp.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcTanHyp.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcTanHyp.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ATanH Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3644,17 +3386,15 @@ void ScOpenclTest:: testFinacialNPER1Formula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/NPER1.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/NPER1.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 6; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(5, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3665,21 +3405,17 @@ void ScOpenclTest::testMathFormulaArcTan2()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/ArcTan2.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/ArcTan2.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/ArcTan2.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/ArcTan2.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify ATan2 Function
for (SCROW i = 1; i <= 17; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 0.000001);
}
xDocSh->DoClose();
@@ -3693,18 +3429,16 @@ void ScOpenclTest::testStatisticalFormulaChiSqInv()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/CHISQINV.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CHISQINV.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3715,21 +3449,17 @@ void ScOpenclTest::testMathFormulaBitAnd()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/BitAnd.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/BitAnd.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/BitAnd.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/BitAnd.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify BitAnd Function
for (SCROW i = 1; i <= 1000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3741,18 +3471,16 @@ void ScOpenclTest::testStatisticalFormulaPoisson()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Poisson.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Poisson.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3764,18 +3492,16 @@ void ScOpenclTest::testStatisticalFormulaExpondist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Expondist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Expondist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3786,21 +3512,17 @@ void ScOpenclTest::testMathFormulaBitOr()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/BitOr.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/BitOr.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/BitOr.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/BitOr.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify BitOr Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3813,17 +3535,15 @@ void ScOpenclTest::testMathFormulaOdd()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/odd.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/odd.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3835,18 +3555,16 @@ void ScOpenclTest::testMathFormulaLN()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/LN.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/LN.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3859,17 +3577,15 @@ void ScOpenclTest::testMathFormulaMod()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/mod.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/mod.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
if(fExcel == 0.0f)
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 1e-10);
else
@@ -3884,24 +3600,22 @@ void ScOpenclTest::testMathFormulaRound()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/ROUND.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/ROUND.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 15; i <= 25; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3914,18 +3628,16 @@ void ScOpenclTest::testStatisticalFormulaGammaDist()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/GammaDist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/GammaDist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3938,21 +3650,19 @@ void ScOpenclTest::testStatisticalFormulaGammaInv()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/GammaInv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/GammaInv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(4,i,0));
- fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3965,21 +3675,19 @@ void ScOpenclTest::testStatisticalFormulaFInv()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/FInv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/FInv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(4,i,0));
- fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -3992,18 +3700,16 @@ void ScOpenclTest::testStatisticalFormulaFTest()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/FTest.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/FTest.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4015,21 +3721,19 @@ void ScOpenclTest::testStatisticalFormulaB()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/B.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/B.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(5,i,0));
- fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4041,21 +3745,19 @@ void ScOpenclTest::testStatisticalFormulaBetaDist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/BetaDist.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/BetaDist.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
- fLibre = pDoc->GetValue(ScAddress(7,i,0));
- fExcel = pDocRes->GetValue(ScAddress(7,i,0));
+ fLibre = rDoc.GetValue(ScAddress(7,i,0));
+ fExcel = rDocRes.GetValue(ScAddress(7,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4068,17 +3770,15 @@ void ScOpenclTest::testMathFormulaEven()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/even.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/even.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4091,17 +3791,15 @@ void ScOpenclTest::testMathFormulaExp()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/exp.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/exp.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4113,18 +3811,16 @@ void ScOpenclTest::testStatisticalFormulaChiDist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/ChiDist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ChiDist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4136,18 +3832,16 @@ void ScOpenclTest::testMathFormulaBitLshift()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/BitLshift.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/BitLshift.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify BitLshift Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4159,18 +3853,16 @@ void ScOpenclTest::testMathFormulaBitRshift()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/BitRshift.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/BitRshift.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify BitRshift Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4182,17 +3874,15 @@ void ScOpenclTest::testMathFormulaFloor()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/floor.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/floor.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4205,17 +3895,15 @@ void ScOpenclTest::testMathFormulaLog()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/log.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/log.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 47; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4227,24 +3915,22 @@ void ScOpenclTest::testSpreadSheetFormulaVLookup()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/spreadsheet/VLookup.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/spreadsheet/VLookup.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 40; i <= 50; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4256,18 +3942,16 @@ void ScOpenclTest::testStatisticalFormulaChiInv()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/ChiInv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ChiInv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4279,17 +3963,15 @@ void ScOpenclTest::testMathFormulaConvert()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/convert.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/convert.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 3; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4301,17 +3983,15 @@ void ScOpenclTest::testMathCountIfsFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/countifs.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
sc::FormulaGroupInterpreter::enableOpenCL(true);
xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("opencl/math/countifs.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i < 10; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(4, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4323,18 +4003,16 @@ void ScOpenclTest::testMathFormulaBitXor()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/BitXor.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/BitXor.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify BitXor Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4346,17 +4024,15 @@ void ScOpenclTest::testMathAverageIfsFormula()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/averageifs.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
sc::FormulaGroupInterpreter::enableOpenCL(true);
xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("opencl/math/averageifs.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 11; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4369,17 +4045,15 @@ void ScOpenclTest::testMathFormulaLog10()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/log10.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/log10.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4392,17 +4066,15 @@ void ScOpenclTest::testMathFormulaCombina()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/combina.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/combina.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 47; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4413,21 +4085,17 @@ void ScOpenclTest::testMathFormulaCeil()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/Ceil.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/Ceil.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/Ceil.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/Ceil.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify Ceiling Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4439,17 +4107,15 @@ void ScOpenclTest::testMathFormulaSqrtPi()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sqrtpi.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sqrtpi.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i < 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4462,19 +4128,17 @@ void ScOpenclTest::testStatisticalFormulaVarP()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarP.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarP.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4487,19 +4151,17 @@ void ScOpenclTest::testStatisticalFormulaStDev()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDev.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDev.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4512,19 +4174,17 @@ void ScOpenclTest::testStatisticalFormulaStDevP()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevP.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevP.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4537,19 +4197,17 @@ void ScOpenclTest::testStatisticalFormulaSlope()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Slope.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Slope.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4562,19 +4220,17 @@ void ScOpenclTest::testStatisticalFormulaSTEYX()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/STEYX.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/STEYX.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4587,19 +4243,17 @@ void ScOpenclTest::testStatisticalFormulaZTest()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/ZTest.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ZTest.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4612,19 +4266,17 @@ void ScOpenclTest::testStatisticalFormulaTTest()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/TTest.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/TTest.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4637,19 +4289,17 @@ void ScOpenclTest::testStatisticalFormulaTDist()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/TDist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/TDist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4662,19 +4312,17 @@ void ScOpenclTest::testStatisticalFormulaTInv()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/TInv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/TInv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4686,18 +4334,16 @@ void ScOpenclTest::testStatisticalFormulaBinomDist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/BinomDist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/BinomDist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4709,17 +4355,15 @@ void ScOpenclTest::testMathFormulaProduct()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/product.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/product.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 3; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4732,18 +4376,16 @@ void ScOpenclTest::testMathFormulaKombin()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/Kombin.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/Kombin.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify Combin Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4756,23 +4398,21 @@ void ScOpenclTest:: testArrayFormulaSumX2MY2()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/array/SUMX2MY2.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMX2MY2.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 20; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4784,18 +4424,16 @@ void ScOpenclTest::testStatisticalFormulaHypGeomDist()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/HypGeomDist.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/HypGeomDist.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4807,23 +4445,21 @@ void ScOpenclTest:: testArrayFormulaSumX2PY2()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/array/SUMX2PY2.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMX2PY2.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 20; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4835,18 +4471,16 @@ void ScOpenclTest::testStatisticalFormulaBetainv()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Betainv.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Betainv.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(5,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(5,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4858,17 +4492,15 @@ void ScOpenclTest::testStatisticalFormulaMina()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Mina.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Mina.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4880,23 +4512,21 @@ void ScOpenclTest:: testArrayFormulaSumXMY2()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/array/SUMXMY2.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMXMY2.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 20; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4908,17 +4538,15 @@ void ScOpenclTest::testStatisticalFormulaCountA()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/counta.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/counta.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4931,17 +4559,15 @@ void ScOpenclTest::testStatisticalFormulaMaxa()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Maxa.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Maxa.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -4954,18 +4580,16 @@ void ScOpenclTest::testMathFormulaSumProduct()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sumproduct_mixSliding.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sumproduct_mixSliding.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
if ( i == 1 )
CPPUNIT_ASSERT_DOUBLES_EQUAL(82, fLibre, fabs(0.0001*fExcel));
else if ( i == 2 )
@@ -4990,17 +4614,15 @@ void ScOpenclTest::testMathFormulaAverageIf()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/averageif.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/averageif.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 2; i <= 21; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(6,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(6,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(6,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5012,17 +4634,15 @@ void ScOpenclTest::testStatisticalFormulaAverageA()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/AverageA.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/AverageA.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5034,23 +4654,21 @@ void ScOpenclTest:: testLogicalFormulaAnd()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/logical/and.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/logical/and.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(3, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(3, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(3, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5063,19 +4681,17 @@ void ScOpenclTest::testStatisticalFormulaVarA()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarA.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarA.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5088,19 +4704,17 @@ void ScOpenclTest::testStatisticalFormulaVarPA()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarPA.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarPA.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5113,19 +4727,17 @@ void ScOpenclTest::testStatisticalFormulaStDevA()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevA.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevA.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5138,19 +4750,17 @@ void ScOpenclTest::testStatisticalFormulaStDevPA()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevPA.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevPA.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5162,17 +4772,15 @@ void ScOpenclTest:: testFinancialMDurationFormula1()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/MDuration1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/MDuration1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(6, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel,fLibre,fabs(0.00000000001*fExcel));
}
xDocSh->DoClose();
@@ -5184,18 +4792,16 @@ void ScOpenclTest::testMathFormulaSumProduct2()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sumproductTest.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sumproductTest.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 2; i <= 12; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(4,i,1));
- double fExcel = pDocRes->GetValue(ScAddress(4,i,1));
+ double fLibre = rDoc.GetValue(ScAddress(4,i,1));
+ double fExcel = rDocRes.GetValue(ScAddress(4,i,1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5209,18 +4815,16 @@ void ScOpenclTest:: testStatisticalParallelCountBug()
return;
ScDocShellRef xDocSh =
loadDoc("opencl/statistical/parallel_count_bug_243.", ODS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes =
loadDoc("opencl/statistical/parallel_count_bug_243.", ODS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i < 13; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5232,17 +4836,15 @@ void ScOpenclTest:: testLogicalFormulaOr()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/logical/or.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/logical/or.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i < 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(2, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(2, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5254,17 +4856,15 @@ void ScOpenclTest:: testLogicalFormulaNot()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/logical/not.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/logical/not.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i < 3000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(1, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(1, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(1, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5276,17 +4876,15 @@ void ScOpenclTest:: testLogicalFormulaXor()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/logical/xor.", XLS);
- ScDocument *pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/logical/xor.", XLS);
- ScDocument *pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i < 3000; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1, i, 0));
- double fExcel = pDocRes->GetValue(ScAddress(1, i, 0));
+ double fLibre = rDoc.GetValue(ScAddress(1, i, 0));
+ double fExcel = rDocRes.GetValue(ScAddress(1, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5298,18 +4896,16 @@ void ScOpenclTest::testDatabaseFormulaDcount()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dcount.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dcount.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
xDocSh->DoClose();
@@ -5321,18 +4917,16 @@ void ScOpenclTest::testDatabaseFormulaDcountA()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dcountA.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dcountA.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
xDocSh->DoClose();
@@ -5344,18 +4938,16 @@ void ScOpenclTest::testDatabaseFormulaDmax()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dmax.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dmax.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
xDocSh->DoClose();
@@ -5368,18 +4960,16 @@ void ScOpenclTest::testDatabaseFormulaDmin()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dmin.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dmin.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
xDocSh->DoClose();
@@ -5392,18 +4982,16 @@ void ScOpenclTest::testDatabaseFormulaDproduct()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dproduct.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dproduct.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
xDocSh->DoClose();
@@ -5416,18 +5004,16 @@ void ScOpenclTest::testDatabaseFormulaDaverage()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/daverage.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/daverage.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
//CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
@@ -5441,18 +5027,16 @@ void ScOpenclTest::testDatabaseFormulaDstdev()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dstdev.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dstdev.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
//CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
@@ -5466,18 +5050,16 @@ void ScOpenclTest::testDatabaseFormulaDstdevp()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dstdevp.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dstdevp.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
//CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
@@ -5491,18 +5073,16 @@ void ScOpenclTest::testDatabaseFormulaDsum()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dsum.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dsum.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
//CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
@@ -5516,18 +5096,16 @@ void ScOpenclTest::testDatabaseFormulaDvar()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dvar.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dvar.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
//CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
@@ -5541,18 +5119,16 @@ void ScOpenclTest::testDatabaseFormulaDvarp()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/database/dvarp.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/database/dvarp.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 32; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(9,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(9,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(10,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
}
xDocSh->DoClose();
@@ -5564,18 +5140,16 @@ void ScOpenclTest::testMathFormulaRoundUp()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/roundup.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/roundup.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5587,18 +5161,16 @@ void ScOpenclTest::testMathFormulaRoundDown()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/rounddown.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/rounddown.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5610,18 +5182,16 @@ void ScOpenclTest::testMathFormulaInt()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/int.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/int.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5633,18 +5203,16 @@ void ScOpenclTest::testMathFormulaRadians()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/radians.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/radians.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5656,17 +5224,15 @@ void ScOpenclTest::testMathFormulaDegrees()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/degrees.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/degrees.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 200; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5678,18 +5244,16 @@ void ScOpenclTest::testMathFormulaIsEven()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/iseven.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/iseven.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5701,17 +5265,15 @@ void ScOpenclTest::testMathFormulaCountIf()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/countif.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/countif.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5723,18 +5285,16 @@ void ScOpenclTest::testMathFormulaIsOdd()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/isodd.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/isodd.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5746,17 +5306,15 @@ void ScOpenclTest::testMathFormulaFact()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/fact.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/fact.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 18; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5769,17 +5327,15 @@ void ScOpenclTest::testMathFormulaSEC()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sec.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sec.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5792,17 +5348,15 @@ void ScOpenclTest::testMathFormulaSECH()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sech.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sech.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5815,17 +5369,15 @@ void ScOpenclTest::testMathFormulaMROUND()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/MROUND.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/MROUND.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 13; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5836,21 +5388,17 @@ void ScOpenclTest::testMathFormulaQuotient()
{
if (!detectOpenCLDevice())
return;
- ScDocShellRef xDocSh =
- loadDoc("opencl/math/Quotient.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocShellRef xDocSh = loadDoc("opencl/math/Quotient.", ODS);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
- ScDocShellRef xDocShRes =
- loadDoc("opencl/math/Quotient.", ODS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ rDoc.CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/Quotient.", ODS);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Verify BitAnd Function
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5862,17 +5410,15 @@ void ScOpenclTest::testMathFormulaSeriesSum()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/seriessum.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/seriessum.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 15; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5884,17 +5430,15 @@ void ScOpenclTest::testMathFormulaSumIf()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/sumif.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/sumif.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 26; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5907,19 +5451,17 @@ void ScOpenclTest::testAddInFormulaBesseLJ()
return;
ScDocShellRef xDocSh = loadDoc("opencl/addin/besselj.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/addin/besselj.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5932,18 +5474,16 @@ void ScOpenclTest::testStatisticalFormulaAvedev()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Avedev.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Avedev.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(3,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(3,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5957,19 +5497,17 @@ void ScOpenclTest::testNegSub()
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/NegSub.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/NegSub.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -5981,17 +5519,15 @@ void ScOpenclTest::testMathFormulaAverageIf_Mix()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/averageif_mix.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/averageif_mix.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
for (SCROW i = 0; i <= 9; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -6003,18 +5539,16 @@ void ScOpenclTest::testStatisticalFormulaKurt1()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Kurt1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Kurt1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(2,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(2,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -6026,18 +5560,16 @@ void ScOpenclTest::testStatisticalFormulaHarMean1()
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/HarMean1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/HarMean1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -6050,19 +5582,17 @@ void ScOpenclTest::testStatisticalFormulaVarA1()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarA1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarA1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -6075,19 +5605,17 @@ void ScOpenclTest::testStatisticalFormulaVarPA1()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarPA1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarPA1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -6100,19 +5628,17 @@ void ScOpenclTest::testStatisticalFormulaStDevA1()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevA1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevA1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
@@ -6125,19 +5651,17 @@ void ScOpenclTest::testStatisticalFormulaStDevPA1()
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevPA1.", XLS);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
enableOpenCL();
- pDoc->CalcAll();
+ rDoc.CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevPA1.", XLS);
- ScDocument* pDocRes = xDocShRes->GetDocument();
- CPPUNIT_ASSERT(pDocRes);
+ ScDocument& rDocRes = xDocShRes->GetDocument();
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++i)
{
- double fLibre = pDoc->GetValue(ScAddress(1,i,0));
- double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ double fLibre = rDoc.GetValue(ScAddress(1,i,0));
+ double fExcel = rDocRes.GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index deba389e90e5..0068d03641d3 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -94,7 +94,7 @@ void Test::setUp()
SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
- m_pDoc = m_xDocShRef->GetDocument();
+ m_pDoc = &m_xDocShRef->GetDocument();
}
void Test::tearDown()
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 2e36357b56e3..d457538fd268 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -202,16 +202,15 @@ void ScExportTest::test()
SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
pShell->DoInitNew();
- ScDocument* pDoc = pShell->GetDocument();
+ ScDocument& rDoc = pShell->GetDocument();
- pDoc->SetValue(0,0,0, 1.0);
- CPPUNIT_ASSERT(pDoc);
+ rDoc.SetValue(0,0,0, 1.0);
ScDocShellRef xDocSh = saveAndReload( pShell, ODS );
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pLoadedDoc = xDocSh->GetDocument();
- double aVal = pLoadedDoc->GetValue(0,0,0);
+ ScDocument& rLoadedDoc = xDocSh->GetDocument();
+ double aVal = rLoadedDoc.GetValue(0,0,0);
ASSERT_DOUBLES_EQUAL(aVal, 1.0);
}
@@ -224,10 +223,9 @@ void ScExportTest::testPasswordExport()
SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
pShell->DoInitNew();
- ScDocument* pDoc = pShell->GetDocument();
+ ScDocument& rDoc = pShell->GetDocument();
- pDoc->SetValue(0,0,0, 1.0);
- CPPUNIT_ASSERT(pDoc);
+ rDoc.SetValue(0,0,0, 1.0);
sal_Int32 nFormat = ODS;
OUString aFilterName(getFileFormats()[nFormat].pFilterName, strlen(getFileFormats()[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
@@ -235,8 +233,8 @@ void ScExportTest::testPasswordExport()
ScDocShellRef xDocSh = saveAndReloadPassword(pShell, aFilterName, OUString(), aFilterType, getFileFormats()[nFormat].nFormatType);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pLoadedDoc = xDocSh->GetDocument();
- double aVal = pLoadedDoc->GetValue(0,0,0);
+ ScDocument& rLoadedDoc = xDocSh->GetDocument();
+ double aVal = rLoadedDoc.GetValue(0,0,0);
ASSERT_DOUBLES_EQUAL(aVal, 1.0);
xDocSh->DoClose();
@@ -250,11 +248,11 @@ void ScExportTest::testConditionalFormatExportODS()
ScDocShellRef xDocSh = saveAndReload(&(*xShell), ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFile("new_cond_format_test.");
OUString aCSVPath;
createCSVPath( aCSVFile, aCSVPath );
- testCondFile(aCSVPath, pDoc, 0);
+ testCondFile(aCSVPath, &rDoc, 0);
xDocSh->DoClose();
}
@@ -266,18 +264,18 @@ void ScExportTest::testConditionalFormatExportXLSX()
ScDocShellRef xDocSh = saveAndReload(&(*xShell), XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
{
OUString aCSVFile("new_cond_format_test.");
OUString aCSVPath;
createCSVPath( aCSVFile, aCSVPath );
- testCondFile(aCSVPath, pDoc, 0);
+ testCondFile(aCSVPath, &rDoc, 0);
}
{
OUString aCSVFile("new_cond_format_test_sheet2.");
OUString aCSVPath;
createCSVPath( aCSVFile, aCSVPath );
- testCondFile(aCSVPath, pDoc, 1);
+ testCondFile(aCSVPath, &rDoc, 1);
}
@@ -292,11 +290,10 @@ void ScExportTest::testColorScaleExportODS()
ScDocShellRef xDocSh = saveAndReload(xShell, ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- testColorScale2Entry_Impl(pDoc);
- testColorScale3Entry_Impl(pDoc);
+ testColorScale2Entry_Impl(rDoc);
+ testColorScale3Entry_Impl(rDoc);
xDocSh->DoClose();
}
@@ -309,11 +306,10 @@ void ScExportTest::testColorScaleExportXLSX()
ScDocShellRef xDocSh = saveAndReload(xShell, XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- testColorScale2Entry_Impl(pDoc);
- testColorScale3Entry_Impl(pDoc);
+ testColorScale2Entry_Impl(rDoc);
+ testColorScale3Entry_Impl(rDoc);
xDocSh->DoClose();
}
@@ -326,10 +322,9 @@ void ScExportTest::testDataBarExportODS()
ScDocShellRef xDocSh = saveAndReload(xShell, ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- testDataBar_Impl(pDoc);
+ testDataBar_Impl(rDoc);
xDocSh->DoClose();
}
@@ -342,9 +337,9 @@ void ScExportTest::testFormatExportODS()
ScDocShellRef xDocSh = saveAndReload(xShell, ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testFormats(this, pDoc, ODS);
+ testFormats(this, &rDoc, ODS);
xDocSh->DoClose();
}
@@ -357,10 +352,9 @@ void ScExportTest::testDataBarExportXLSX()
ScDocShellRef xDocSh = saveAndReload(xShell, XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- testDataBar_Impl(pDoc);
+ testDataBar_Impl(rDoc);
xDocSh->DoClose();
}
@@ -476,23 +470,21 @@ void ScExportTest::testNamedRangeBugfdo62729()
{
ScDocShellRef xShell = loadDoc("fdo62729.", ODS);
CPPUNIT_ASSERT(xShell.Is());
- ScDocument* pDoc = xShell->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xShell->GetDocument();
- ScRangeName* pNames = pDoc->GetRangeName();
+ ScRangeName* pNames = rDoc.GetRangeName();
//should be just a single named range
CPPUNIT_ASSERT(pNames->size() == 1 );
- pDoc->DeleteTab(0);
+ rDoc.DeleteTab(0);
//should be still a single named range
CPPUNIT_ASSERT(pNames->size() == 1 );
ScDocShellRef xDocSh = saveAndReload(xShell, ODS);
xShell->DoClose();
CPPUNIT_ASSERT(xDocSh.Is());
- pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc2 = xDocSh->GetDocument();
- pNames = pDoc->GetRangeName();
+ pNames = rDoc2.GetRangeName();
//after reload should still have a named range
CPPUNIT_ASSERT(pNames->size() == 1 );
@@ -804,106 +796,111 @@ void ScExportTest::testRichTextExportODS()
// Start with an empty document, put one edit text cell, and make sure it
// survives the save and reload.
ScDocShellRef xOrigDocSh = loadDoc("empty.", ODS, true);
- ScDocument* pDoc = xOrigDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- CPPUNIT_ASSERT_MESSAGE("This document should at least have one sheet.", pDoc->GetTableCount() > 0);
-
- // Insert an edit text cell.
- ScFieldEditEngine* pEE = &pDoc->GetEditEngine();
- pEE->SetText("Bold and Italic");
- // Set the 'Bold' part bold.
- setAttribute(*pEE, 0, 0, 4, EE_CHAR_WEIGHT);
- // Set the 'Italic' part italic.
- setAttribute(*pEE, 0, 9, 15, EE_CHAR_ITALIC);
- ESelection aSel;
- aSel.nStartPara = aSel.nEndPara = 0;
-
- // Set this edit text to cell B2.
- pDoc->SetEditText(ScAddress(1,1,0), pEE->CreateTextObject());
- const EditTextObject* pEditText = pDoc->GetEditText(ScAddress(1,1,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B2 value.", aCheckFunc.checkB2(pEditText));
+ const EditTextObject* pEditText;
+ {
+ ScDocument& rDoc = xOrigDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("This document should at least have one sheet.", rDoc.GetTableCount() > 0);
+
+ // Insert an edit text cell.
+ ScFieldEditEngine* pEE = &rDoc.GetEditEngine();
+ pEE->SetText("Bold and Italic");
+ // Set the 'Bold' part bold.
+ setAttribute(*pEE, 0, 0, 4, EE_CHAR_WEIGHT);
+ // Set the 'Italic' part italic.
+ setAttribute(*pEE, 0, 9, 15, EE_CHAR_ITALIC);
+ ESelection aSel;
+ aSel.nStartPara = aSel.nEndPara = 0;
+
+ // Set this edit text to cell B2.
+ rDoc.SetEditText(ScAddress(1,1,0), pEE->CreateTextObject());
+ pEditText = rDoc.GetEditText(ScAddress(1,1,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorret B2 value.", aCheckFunc.checkB2(pEditText));
+ }
// Now, save and reload this document.
ScDocShellRef xNewDocSh = saveAndReload(xOrigDocSh, ODS);
- xOrigDocSh->DoClose();
- CPPUNIT_ASSERT(xNewDocSh.Is());
- pDoc = xNewDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.", pDoc->GetTableCount() > 0);
- pEE = &pDoc->GetEditEngine();
-
- // Make sure the content of B2 is still intact.
- CPPUNIT_ASSERT_MESSAGE("Incorret B2 value.", aCheckFunc.checkB2(pEditText));
-
- // Insert a multi-line content to B4.
- pEE->Clear();
- pEE->SetText("One\nTwo\nThree");
- pDoc->SetEditText(ScAddress(1,3,0), pEE->CreateTextObject());
- pEditText = pDoc->GetEditText(ScAddress(1,3,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B4 value.", aCheckFunc.checkB4(pEditText));
+ {
+ xOrigDocSh->DoClose();
+ CPPUNIT_ASSERT(xNewDocSh.Is());
+ ScDocument& rDoc2 = xNewDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.", rDoc2.GetTableCount() > 0);
+ ScFieldEditEngine* pEE = &rDoc2.GetEditEngine();
+
+ // Make sure the content of B2 is still intact.
+ CPPUNIT_ASSERT_MESSAGE("Incorret B2 value.", aCheckFunc.checkB2(pEditText));
+
+ // Insert a multi-line content to B4.
+ pEE->Clear();
+ pEE->SetText("One\nTwo\nThree");
+ rDoc2.SetEditText(ScAddress(1,3,0), pEE->CreateTextObject());
+ pEditText = rDoc2.GetEditText(ScAddress(1,3,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B4 value.", aCheckFunc.checkB4(pEditText));
+ }
// Reload the doc again, and check the content of B2 and B4.
ScDocShellRef xNewDocSh2 = saveAndReload(xNewDocSh, ODS);
- pDoc = xNewDocSh2->GetDocument();
- pEE = &pDoc->GetEditEngine();
- xNewDocSh->DoClose();
-
- pEditText = pDoc->GetEditText(ScAddress(1,1,0));
- CPPUNIT_ASSERT_MESSAGE("B2 should be an edit text.", pEditText);
- pEditText = pDoc->GetEditText(ScAddress(1,3,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B4 value.", aCheckFunc.checkB4(pEditText));
-
- // Insert a multi-line content to B5, but this time, set some empty paragraphs.
- pEE->Clear();
- pEE->SetText("\nTwo\nThree\n\nFive\n");
- pDoc->SetEditText(ScAddress(1,4,0), pEE->CreateTextObject());
- pEditText = pDoc->GetEditText(ScAddress(1,4,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B5 value.", aCheckFunc.checkB5(pEditText));
-
- // Insert a text with strikethrough in B6.
- pEE->Clear();
- pEE->SetText("Strike Me");
- // Set the 'Strike' part strikethrough.
- setAttribute(*pEE, 0, 0, 6, EE_CHAR_STRIKEOUT);
- pDoc->SetEditText(ScAddress(1,5,0), pEE->CreateTextObject());
- pEditText = pDoc->GetEditText(ScAddress(1,5,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B6 value.", aCheckFunc.checkB6(pEditText));
-
- // Insert a text with different font segments in B7.
- pEE->Clear();
- pEE->SetText("Font1 and Font2");
- setFont(*pEE, 0, 0, 5, "Courier");
- setFont(*pEE, 0, 10, 15, "Luxi Mono");
- pDoc->SetEditText(ScAddress(1,6,0), pEE->CreateTextObject());
- pEditText = pDoc->GetEditText(ScAddress(1,6,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B7 value.", aCheckFunc.checkB7(pEditText));
-
- // Insert a text with overline and underline in B8.
- pEE->Clear();
- pEE->SetText("Over and Under");
- setAttribute(*pEE, 0, 0, 4, EE_CHAR_OVERLINE);
- setAttribute(*pEE, 0, 9, 14, EE_CHAR_UNDERLINE);
- pDoc->SetEditText(ScAddress(1,7,0), pEE->CreateTextObject());
- pEditText = pDoc->GetEditText(ScAddress(1,7,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B8 value.", aCheckFunc.checkB8(pEditText));
+ {
+ ScDocument& rDoc3 = xNewDocSh2->GetDocument();
+ ScFieldEditEngine* pEE = &rDoc3.GetEditEngine();
+ xNewDocSh->DoClose();
+
+ pEditText = rDoc3.GetEditText(ScAddress(1,1,0));
+ CPPUNIT_ASSERT_MESSAGE("B2 should be an edit text.", pEditText);
+ pEditText = rDoc3.GetEditText(ScAddress(1,3,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B4 value.", aCheckFunc.checkB4(pEditText));
+
+ // Insert a multi-line content to B5, but this time, set some empty paragraphs.
+ pEE->Clear();
+ pEE->SetText("\nTwo\nThree\n\nFive\n");
+ rDoc3.SetEditText(ScAddress(1,4,0), pEE->CreateTextObject());
+ pEditText = rDoc3.GetEditText(ScAddress(1,4,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B5 value.", aCheckFunc.checkB5(pEditText));
+
+ // Insert a text with strikethrough in B6.
+ pEE->Clear();
+ pEE->SetText("Strike Me");
+ // Set the 'Strike' part strikethrough.
+ setAttribute(*pEE, 0, 0, 6, EE_CHAR_STRIKEOUT);
+ rDoc3.SetEditText(ScAddress(1,5,0), pEE->CreateTextObject());
+ pEditText = rDoc3.GetEditText(ScAddress(1,5,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B6 value.", aCheckFunc.checkB6(pEditText));
+
+ // Insert a text with different font segments in B7.
+ pEE->Clear();
+ pEE->SetText("Font1 and Font2");
+ setFont(*pEE, 0, 0, 5, "Courier");
+ setFont(*pEE, 0, 10, 15, "Luxi Mono");
+ rDoc3.SetEditText(ScAddress(1,6,0), pEE->CreateTextObject());
+ pEditText = rDoc3.GetEditText(ScAddress(1,6,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B7 value.", aCheckFunc.checkB7(pEditText));
+
+ // Insert a text with overline and underline in B8.
+ pEE->Clear();
+ pEE->SetText("Over and Under");
+ setAttribute(*pEE, 0, 0, 4, EE_CHAR_OVERLINE);
+ setAttribute(*pEE, 0, 9, 14, EE_CHAR_UNDERLINE);
+ rDoc3.SetEditText(ScAddress(1,7,0), pEE->CreateTextObject());
+ pEditText = rDoc3.GetEditText(ScAddress(1,7,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B8 value.", aCheckFunc.checkB8(pEditText));
+ }
// Reload the doc again, and check the content of B2, B4, B6 and B7.
ScDocShellRef xNewDocSh3 = saveAndReload(xNewDocSh2, ODS);
- pDoc = xNewDocSh3->GetDocument();
+ ScDocument& rDoc4 = xNewDocSh3->GetDocument();
xNewDocSh2->DoClose();
- pEditText = pDoc->GetEditText(ScAddress(1,1,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B2 value after save and reload.", aCheckFunc.checkB2(pEditText));
- pEditText = pDoc->GetEditText(ScAddress(1,3,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B4 value after save and reload.", aCheckFunc.checkB4(pEditText));
- pEditText = pDoc->GetEditText(ScAddress(1,4,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B5 value after save and reload.", aCheckFunc.checkB5(pEditText));
- pEditText = pDoc->GetEditText(ScAddress(1,5,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B6 value after save and reload.", aCheckFunc.checkB6(pEditText));
- pEditText = pDoc->GetEditText(ScAddress(1,6,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B7 value after save and reload.", aCheckFunc.checkB7(pEditText));
- pEditText = pDoc->GetEditText(ScAddress(1,7,0));
- CPPUNIT_ASSERT_MESSAGE("Incorret B8 value after save and reload.", aCheckFunc.checkB8(pEditText));
+ pEditText = rDoc4.GetEditText(ScAddress(1,1,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B2 value after save and reload.", aCheckFunc.checkB2(pEditText));
+ pEditText = rDoc4.GetEditText(ScAddress(1,3,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B4 value after save and reload.", aCheckFunc.checkB4(pEditText));
+ pEditText = rDoc4.GetEditText(ScAddress(1,4,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B5 value after save and reload.", aCheckFunc.checkB5(pEditText));
+ pEditText = rDoc4.GetEditText(ScAddress(1,5,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B6 value after save and reload.", aCheckFunc.checkB6(pEditText));
+ pEditText = rDoc4.GetEditText(ScAddress(1,6,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B7 value after save and reload.", aCheckFunc.checkB7(pEditText));
+ pEditText = rDoc4.GetEditText(ScAddress(1,7,0));
+ CPPUNIT_ASSERT_MESSAGE("Incorrect B8 value after save and reload.", aCheckFunc.checkB8(pEditText));
xNewDocSh3->DoClose();
}
@@ -911,22 +908,23 @@ void ScExportTest::testRichTextExportODS()
void ScExportTest::testFormulaRefSheetNameODS()
{
ScDocShellRef xDocSh = loadDoc("formula-quote-in-sheet-name.", ODS, true);
- ScDocument* pDoc = xDocSh->GetDocument();
-
- sc::AutoCalcSwitch aACSwitch(*pDoc, true); // turn on auto calc.
- pDoc->SetString(ScAddress(1,1,0), "='90''s Data'.B2");
- CPPUNIT_ASSERT_EQUAL(1.1, pDoc->GetValue(ScAddress(1,1,0)));
- if (!checkFormula(*pDoc, ScAddress(1,1,0), "'90''s Data'.B2"))
- CPPUNIT_FAIL("Wrong formula");
+ {
+ ScDocument& rDoc = xDocSh->GetDocument();
+ sc::AutoCalcSwitch aACSwitch(rDoc, true); // turn on auto calc.
+ rDoc.SetString(ScAddress(1,1,0), "='90''s Data'.B2");
+ CPPUNIT_ASSERT_EQUAL(1.1, rDoc.GetValue(ScAddress(1,1,0)));
+ if (!checkFormula(rDoc, ScAddress(1,1,0), "'90''s Data'.B2"))
+ CPPUNIT_FAIL("Wrong formula");
+ }
// Now, save and reload this document.
ScDocShellRef xNewDocSh = saveAndReload(xDocSh, ODS);
xDocSh->DoClose();
- pDoc = xNewDocSh->GetDocument();
- pDoc->CalcAll();
- CPPUNIT_ASSERT_EQUAL(1.1, pDoc->GetValue(ScAddress(1,1,0)));
- if (!checkFormula(*pDoc, ScAddress(1,1,0), "'90''s Data'.B2"))
+ ScDocument& rDoc = xNewDocSh->GetDocument();
+ rDoc.CalcAll();
+ CPPUNIT_ASSERT_EQUAL(1.1, rDoc.GetValue(ScAddress(1,1,0)));
+ if (!checkFormula(rDoc, ScAddress(1,1,0), "'90''s Data'.B2"))
CPPUNIT_FAIL("Wrong formula");
xNewDocSh->DoClose();
@@ -936,73 +934,72 @@ void ScExportTest::testCellValuesExportODS()
{
// Start with an empty document
ScDocShellRef xOrigDocSh = loadDoc("empty.", ODS);
- ScDocument* pDoc = xOrigDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- CPPUNIT_ASSERT_MESSAGE("This document should at least have one sheet.", pDoc->GetTableCount() > 0);
-
- // set a value double
- pDoc->SetValue(ScAddress(0,0,0), 2.0); // A1
-
- // set a formula
- pDoc->SetValue(ScAddress(2,0,0), 3.0); // C1
- pDoc->SetValue(ScAddress(3,0,0), 3); // D1
- pDoc->SetString(ScAddress(4,0,0), "=10*C1/4"); // E1
- pDoc->SetValue(ScAddress(5,0,0), 3.0); // F1
- pDoc->SetString(ScAddress(7,0,0), "=SUM(C1:F1)"); //H1
-
- // set a string
- pDoc->SetString(ScAddress(0,2,0), "a simple line"); //A3
-
- // set a digit string
- pDoc->SetString(ScAddress(0,4,0), "'12"); //A5
- // set a contiguous value
- pDoc->SetValue(ScAddress(0,5,0), 12.0); //A6
- // set acontiguous string
- pDoc->SetString(ScAddress(0,6,0), "a string"); //A7
- // set a contiguous formula
- pDoc->SetString(ScAddress(0,7,0), "=$A$6"); //A8
-
+ {
+ ScDocument& rDoc = xOrigDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("This document should at least have one sheet.", rDoc.GetTableCount() > 0);
+
+ // set a value double
+ rDoc.SetValue(ScAddress(0,0,0), 2.0); // A1
+
+ // set a formula
+ rDoc.SetValue(ScAddress(2,0,0), 3.0); // C1
+ rDoc.SetValue(ScAddress(3,0,0), 3); // D1
+ rDoc.SetString(ScAddress(4,0,0), "=10*C1/4"); // E1
+ rDoc.SetValue(ScAddress(5,0,0), 3.0); // F1
+ rDoc.SetString(ScAddress(7,0,0), "=SUM(C1:F1)"); //H1
+
+ // set a string
+ rDoc.SetString(ScAddress(0,2,0), "a simple line"); //A3
+
+ // set a digit string
+ rDoc.SetString(ScAddress(0,4,0), "'12"); //A5
+ // set a contiguous value
+ rDoc.SetValue(ScAddress(0,5,0), 12.0); //A6
+ // set acontiguous string
+ rDoc.SetString(ScAddress(0,6,0), "a string"); //A7
+ // set a contiguous formula
+ rDoc.SetString(ScAddress(0,7,0), "=$A$6"); //A8
+ }
// save and reload
ScDocShellRef xNewDocSh = saveAndReload(xOrigDocSh, ODS);
xOrigDocSh->DoClose();
CPPUNIT_ASSERT(xNewDocSh.Is());
- pDoc = xNewDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.", pDoc->GetTableCount() > 0);
+ ScDocument& rDoc = xNewDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("Reloaded document should at least have one sheet.", rDoc.GetTableCount() > 0);
// check value
- CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(0,0,0));
- CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(2,0,0));
- CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(3,0,0));
- CPPUNIT_ASSERT_EQUAL(7.5, pDoc->GetValue(4,0,0));
- CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(5,0,0));
+ CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(0,0,0));
+ CPPUNIT_ASSERT_EQUAL(3.0, rDoc.GetValue(2,0,0));
+ CPPUNIT_ASSERT_EQUAL(3.0, rDoc.GetValue(3,0,0));
+ CPPUNIT_ASSERT_EQUAL(7.5, rDoc.GetValue(4,0,0));
+ CPPUNIT_ASSERT_EQUAL(3.0, rDoc.GetValue(5,0,0));
// check formula
- if (!checkFormula(*pDoc, ScAddress(4,0,0), "10*C1/4"))
+ if (!checkFormula(rDoc, ScAddress(4,0,0), "10*C1/4"))
CPPUNIT_FAIL("Wrong formula =10*C1/4");
- if (!checkFormula(*pDoc, ScAddress(7,0,0), "SUM(C1:F1)"))
+ if (!checkFormula(rDoc, ScAddress(7,0,0), "SUM(C1:F1)"))
CPPUNIT_FAIL("Wrong formula =SUM(C1:F1)");
- CPPUNIT_ASSERT_EQUAL(16.5, pDoc->GetValue(7,0,0));
+ CPPUNIT_ASSERT_EQUAL(16.5, rDoc.GetValue(7,0,0));
// check string
ScRefCellValue aCell;
- aCell.assign(*pDoc, ScAddress(0,2,0));
+ aCell.assign(rDoc, ScAddress(0,2,0));
CPPUNIT_ASSERT_EQUAL( CELLTYPE_STRING, aCell.meType );
// check for an empty cell
- aCell.assign(*pDoc, ScAddress(0,3,0));
+ aCell.assign(rDoc, ScAddress(0,3,0));
CPPUNIT_ASSERT_EQUAL( CELLTYPE_NONE, aCell.meType);
// check a digit string
- aCell.assign(*pDoc, ScAddress(0,4,0));
+ aCell.assign(rDoc, ScAddress(0,4,0));
CPPUNIT_ASSERT_EQUAL( CELLTYPE_STRING, aCell.meType);
//check contiguous values
- CPPUNIT_ASSERT_EQUAL( 12.0, pDoc->GetValue(0,5,0) );
- CPPUNIT_ASSERT_EQUAL( OUString("a string"), pDoc->GetString(0,6,0) );
- if (!checkFormula(*pDoc, ScAddress(0,7,0), "$A$6"))
+ CPPUNIT_ASSERT_EQUAL( 12.0, rDoc.GetValue(0,5,0) );
+ CPPUNIT_ASSERT_EQUAL( OUString("a string"), rDoc.GetString(0,6,0) );
+ if (!checkFormula(rDoc, ScAddress(0,7,0), "$A$6"))
CPPUNIT_FAIL("Wrong formula =$A$6");
- CPPUNIT_ASSERT_EQUAL( pDoc->GetValue(0,5,0), pDoc->GetValue(0,7,0) );
+ CPPUNIT_ASSERT_EQUAL( rDoc.GetValue(0,5,0), rDoc.GetValue(0,7,0) );
xNewDocSh->DoClose();
}
@@ -1010,27 +1007,28 @@ void ScExportTest::testCellValuesExportODS()
void ScExportTest::testCellNoteExportODS()
{
ScDocShellRef xOrigDocSh = loadDoc("single-note.", ODS);
- ScDocument* pDoc = xOrigDocSh->GetDocument();
-
ScAddress aPos(0,0,0); // Start with A1.
- CPPUNIT_ASSERT_MESSAGE("There should be a note at A1.", pDoc->HasNote(aPos));
+ {
+ ScDocument& rDoc = xOrigDocSh->GetDocument();
- aPos.IncRow(); // Move to A2.
- ScPostIt* pNote = pDoc->GetOrCreateNote(aPos);
- pNote->SetText(aPos, "Note One");
- pNote->SetAuthor("Author One");
- CPPUNIT_ASSERT_MESSAGE("There should be a note at A2.", pDoc->HasNote(aPos));
+ CPPUNIT_ASSERT_MESSAGE("There should be a note at A1.", rDoc.HasNote(aPos));
+ aPos.IncRow(); // Move to A2.
+ ScPostIt* pNote = rDoc.GetOrCreateNote(aPos);
+ pNote->SetText(aPos, "Note One");
+ pNote->SetAuthor("Author One");
+ CPPUNIT_ASSERT_MESSAGE("There should be a note at A2.", rDoc.HasNote(aPos));
+ }
// save and reload
ScDocShellRef xNewDocSh = saveAndReload(xOrigDocSh, ODS);
xOrigDocSh->DoClose();
CPPUNIT_ASSERT(xNewDocSh.Is());
- pDoc = xNewDocSh->GetDocument();
+ ScDocument& rDoc = xNewDocSh->GetDocument();
aPos.SetRow(0); // Move back to A1.
- CPPUNIT_ASSERT_MESSAGE("There should be a note at A1.", pDoc->HasNote(aPos));
+ CPPUNIT_ASSERT_MESSAGE("There should be a note at A1.", rDoc.HasNote(aPos));
aPos.IncRow(); // Move to A2.
- CPPUNIT_ASSERT_MESSAGE("There should be a note at A2.", pDoc->HasNote(aPos));
+ CPPUNIT_ASSERT_MESSAGE("There should be a note at A2.", rDoc.HasNote(aPos));
xNewDocSh->DoClose();
}
@@ -1039,43 +1037,46 @@ void ScExportTest::testCellNoteExportXLS()
{
// Start with an empty document.s
ScDocShellRef xOrigDocSh = loadDoc("notes-on-3-sheets.", ODS);
- ScDocument* pDoc = xOrigDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("This document should have 3 sheets.", pDoc->GetTableCount() == 3);
-
- // Check note's presence.
- CPPUNIT_ASSERT( pDoc->HasNote(ScAddress(0,0,0)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,1,0)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,2,0)));
+ {
+ ScDocument& rDoc = xOrigDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("This document should have 3 sheets.", rDoc.GetTableCount() == 3);
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,0,1)));
- CPPUNIT_ASSERT( pDoc->HasNote(ScAddress(0,1,1)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,2,1)));
+ // Check note's presence.
+ CPPUNIT_ASSERT( rDoc.HasNote(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,2,0)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,0,2)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,1,2)));
- CPPUNIT_ASSERT( pDoc->HasNote(ScAddress(0,2,2)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,0,1)));
+ CPPUNIT_ASSERT( rDoc.HasNote(ScAddress(0,1,1)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,2,1)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,0,2)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,1,2)));
+ CPPUNIT_ASSERT( rDoc.HasNote(ScAddress(0,2,2)));
+ }
// save and reload as XLS.
ScDocShellRef xNewDocSh = saveAndReload(xOrigDocSh, XLS);
- xOrigDocSh->DoClose();
- CPPUNIT_ASSERT(xNewDocSh.Is());
- pDoc = xNewDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("This document should have 3 sheets.", pDoc->GetTableCount() == 3);
+ {
+ xOrigDocSh->DoClose();
+ CPPUNIT_ASSERT(xNewDocSh.Is());
+ ScDocument& rDoc = xNewDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("This document should have 3 sheets.", rDoc.GetTableCount() == 3);
- // Check note's presence again.
- CPPUNIT_ASSERT( pDoc->HasNote(ScAddress(0,0,0)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,1,0)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,2,0)));
+ // Check note's presence again.
+ CPPUNIT_ASSERT( rDoc.HasNote(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,2,0)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,0,1)));
- CPPUNIT_ASSERT( pDoc->HasNote(ScAddress(0,1,1)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,2,1)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,0,1)));
+ CPPUNIT_ASSERT( rDoc.HasNote(ScAddress(0,1,1)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,2,1)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,0,2)));
- CPPUNIT_ASSERT(!pDoc->HasNote(ScAddress(0,1,2)));
- CPPUNIT_ASSERT( pDoc->HasNote(ScAddress(0,2,2)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,0,2)));
+ CPPUNIT_ASSERT(!rDoc.HasNote(ScAddress(0,1,2)));
+ CPPUNIT_ASSERT( rDoc.HasNote(ScAddress(0,2,2)));
- xNewDocSh->DoClose();
+ xNewDocSh->DoClose();
+ }
}
namespace {
@@ -1113,17 +1114,16 @@ void ScExportTest::testInlineArrayXLS()
xShell->DoClose();
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
// B2:C3 contains a matrix.
- checkMatrixRange(*pDoc, ScRange(1,1,0,2,2,0));
+ checkMatrixRange(rDoc, ScRange(1,1,0,2,2,0));
// B5:D6 contains a matrix.
- checkMatrixRange(*pDoc, ScRange(1,4,0,3,5,0));
+ checkMatrixRange(rDoc, ScRange(1,4,0,3,5,0));
// B8:C10 as well.
- checkMatrixRange(*pDoc, ScRange(1,7,0,2,9,0));
+ checkMatrixRange(rDoc, ScRange(1,7,0,2,9,0));
xDocSh->DoClose();
}
@@ -1137,18 +1137,17 @@ void ScExportTest::testEmbeddedChartXLS()
xShell->DoClose();
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
// Make sure the 2nd sheet is named 'Chart1'.
OUString aName;
- pDoc->GetName(1, aName);
+ rDoc.GetName(1, aName);
CPPUNIT_ASSERT_EQUAL(OUString("Chart1"), aName);
- const SdrOle2Obj* pOleObj = getSingleChartObject(*pDoc, 1);
+ const SdrOle2Obj* pOleObj = getSingleChartObject(rDoc, 1);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd sheet.", pOleObj);
- ScRangeList aRanges = getChartRanges(*pDoc, *pOleObj);
+ ScRangeList aRanges = getChartRanges(rDoc, *pOleObj);
CPPUNIT_ASSERT_MESSAGE("Label range (B3:B5) not found.", aRanges.In(ScRange(1,2,1,1,4,1)));
CPPUNIT_ASSERT_MESSAGE("Data label (C2) not found.", aRanges.In(ScAddress(2,1,1)));
CPPUNIT_ASSERT_MESSAGE("Data range (C3:C5) not found.", aRanges.In(ScRange(2,2,1,2,4,1)));
@@ -1165,31 +1164,30 @@ void ScExportTest::testFormulaReferenceXLS()
xShell->DoClose();
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- if (!checkFormula(*pDoc, ScAddress(3,1,0), "$A$2+$B$2+$C$2"))
+ if (!checkFormula(rDoc, ScAddress(3,1,0), "$A$2+$B$2+$C$2"))
CPPUNIT_FAIL("Wrong formula in D2");
- if (!checkFormula(*pDoc, ScAddress(3,2,0), "A3+B3+C3"))
+ if (!checkFormula(rDoc, ScAddress(3,2,0), "A3+B3+C3"))
CPPUNIT_FAIL("Wrong formula in D3");
- if (!checkFormula(*pDoc, ScAddress(3,5,0), "SUM($A$6:$C$6)"))
+ if (!checkFormula(rDoc, ScAddress(3,5,0), "SUM($A$6:$C$6)"))
CPPUNIT_FAIL("Wrong formula in D6");
- if (!checkFormula(*pDoc, ScAddress(3,6,0), "SUM(A7:C7)"))
+ if (!checkFormula(rDoc, ScAddress(3,6,0), "SUM(A7:C7)"))
CPPUNIT_FAIL("Wrong formula in D7");
- if (!checkFormula(*pDoc, ScAddress(3,9,0), "$Two.$A$2+$Two.$B$2+$Two.$C$2"))
+ if (!checkFormula(rDoc, ScAddress(3,9,0), "$Two.$A$2+$Two.$B$2+$Two.$C$2"))
CPPUNIT_FAIL("Wrong formula in D10");
- if (!checkFormula(*pDoc, ScAddress(3,10,0), "$Two.A3+$Two.B3+$Two.C3"))
+ if (!checkFormula(rDoc, ScAddress(3,10,0), "$Two.A3+$Two.B3+$Two.C3"))
CPPUNIT_FAIL("Wrong formula in D11");
- if (!checkFormula(*pDoc, ScAddress(3,13,0), "MIN($Two.$A$2:$C$2)"))
+ if (!checkFormula(rDoc, ScAddress(3,13,0), "MIN($Two.$A$2:$C$2)"))
CPPUNIT_FAIL("Wrong formula in D14");
- if (!checkFormula(*pDoc, ScAddress(3,14,0), "MAX($Two.A3:C3)"))
+ if (!checkFormula(rDoc, ScAddress(3,14,0), "MAX($Two.A3:C3)"))
CPPUNIT_FAIL("Wrong formula in D15");
xDocSh->DoClose();
@@ -1203,9 +1201,8 @@ void ScExportTest::testSheetProtectionXLSX()
ScDocShellRef xDocSh = saveAndReload(xShell, XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- const ScTableProtection* pTabProtect = pDoc->GetTabProtection(0);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ const ScTableProtection* pTabProtect = rDoc.GetTabProtection(0);
CPPUNIT_ASSERT(pTabProtect);
if ( pTabProtect )
{
@@ -1247,11 +1244,6 @@ const char* toBorderName( sal_Int16 eStyle )
void ScExportTest::testExcelCellBorders( sal_uLong nFormatType )
{
- ScDocShellRef xDocSh = loadDoc("cell-borders.", nFormatType);
-
- CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
-
struct
{
SCROW mnRow;
@@ -1272,23 +1264,29 @@ void ScExportTest::testExcelCellBorders( sal_uLong nFormatType )
{ 25, table::BorderLineStyle::DOUBLE_THIN, -1L }, // double (don't check width)
};
- for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
+ ScDocShellRef xDocSh = loadDoc("cell-borders.", nFormatType);
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is());
{
- const editeng::SvxBorderLine* pLine = NULL;
- pDoc->GetBorderLines(2, aChecks[i].mnRow, 0, NULL, &pLine, NULL, NULL);
- CPPUNIT_ASSERT(pLine);
- CPPUNIT_ASSERT_EQUAL(toBorderName(aChecks[i].mnStyle), toBorderName(pLine->GetBorderLineStyle()));
- if (aChecks[i].mnWidth >= 0)
- CPPUNIT_ASSERT_EQUAL(aChecks[i].mnWidth, pLine->GetWidth());
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
+ {
+ const editeng::SvxBorderLine* pLine = NULL;
+ rDoc.GetBorderLines(2, aChecks[i].mnRow, 0, NULL, &pLine, NULL, NULL);
+ CPPUNIT_ASSERT(pLine);
+ CPPUNIT_ASSERT_EQUAL(toBorderName(aChecks[i].mnStyle), toBorderName(pLine->GetBorderLineStyle()));
+ if (aChecks[i].mnWidth >= 0)
+ CPPUNIT_ASSERT_EQUAL(aChecks[i].mnWidth, pLine->GetWidth());
+ }
}
ScDocShellRef xNewDocSh = saveAndReload(xDocSh, nFormatType);
xDocSh->DoClose();
- pDoc = xNewDocSh->GetDocument();
+ ScDocument& rDoc = xNewDocSh->GetDocument();
for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
{
const editeng::SvxBorderLine* pLine = NULL;
- pDoc->GetBorderLines(2, aChecks[i].mnRow, 0, NULL, &pLine, NULL, NULL);
+ rDoc.GetBorderLines(2, aChecks[i].mnRow, 0, NULL, &pLine, NULL, NULL);
CPPUNIT_ASSERT(pLine);
CPPUNIT_ASSERT_EQUAL(toBorderName(aChecks[i].mnStyle), toBorderName(pLine->GetBorderLineStyle()));
if (aChecks[i].mnWidth >= 0)
@@ -1312,10 +1310,10 @@ void ScExportTest::testSheetTabColorsXLSX()
{
struct
{
- bool checkContent( ScDocument* pDoc )
+ bool checkContent( ScDocument& rDoc )
{
- std::vector<OUString> aTabNames = pDoc->GetAllTableNames();
+ std::vector<OUString> aTabNames = rDoc.GetAllTableNames();
// green, red, blue, yellow (from left to right).
if (aTabNames.size() != 4)
@@ -1345,7 +1343,7 @@ void ScExportTest::testSheetTabColorsXLSX()
for (size_t i = 0, n = SAL_N_ELEMENTS(aXclColors); i < n; ++i)
{
- if (aXclColors[i] != pDoc->GetTabBgColor(i).GetColor())
+ if (aXclColors[i] != rDoc.GetTabBgColor(i).GetColor())
{
cerr << "wrong sheet color for sheet " << i << endl;
return false;
@@ -1358,16 +1356,18 @@ void ScExportTest::testSheetTabColorsXLSX()
} aTest;
ScDocShellRef xDocSh = loadDoc("sheet-tab-color.", XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- bool bRes = aTest.checkContent(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Failed on the initial content check.", bRes);
+ {
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
+ ScDocument& rDoc = xDocSh->GetDocument();
+ bool bRes = aTest.checkContent(rDoc);
+ CPPUNIT_ASSERT_MESSAGE("Failed on the initial content check.", bRes);
+ }
ScDocShellRef xDocSh2 = saveAndReload(xDocSh, XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to reload file.", xDocSh2.Is());
xDocSh->DoClose();
- pDoc = xDocSh2->GetDocument();
- bRes = aTest.checkContent(pDoc);
+ ScDocument& rDoc = xDocSh2->GetDocument();
+ bool bRes = aTest.checkContent(rDoc);
CPPUNIT_ASSERT_MESSAGE("Failed on the content check after reload.", bRes);
xDocSh2->DoClose();
@@ -1377,15 +1377,15 @@ void ScExportTest::testSharedFormulaExportXLS()
{
struct
{
- bool checkContent( ScDocument* pDoc )
+ bool checkContent( ScDocument& rDoc )
{
formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1;
- pDoc->SetGrammar(eGram);
- sc::TokenStringContext aCxt(pDoc, eGram);
+ rDoc.SetGrammar(eGram);
+ sc::TokenStringContext aCxt(&rDoc, eGram);
// Check the title row.
- OUString aActual = pDoc->GetString(0,1,0);
+ OUString aActual = rDoc.GetString(0,1,0);
OUString aExpected = "Response";
if (aActual != aExpected)
{
@@ -1393,7 +1393,7 @@ void ScExportTest::testSharedFormulaExportXLS()
return false;
}
- aActual = pDoc->GetString(1,1,0);
+ aActual = rDoc.GetString(1,1,0);
aExpected = "Response";
if (aActual != aExpected)
{
@@ -1406,7 +1406,7 @@ void ScExportTest::testSharedFormulaExportXLS()
{
double fExpected = i + 1.0;
ScAddress aPos(0,i+2,0);
- double fActual = pDoc->GetValue(aPos);
+ double fActual = rDoc.GetValue(aPos);
if (fExpected != fActual)
{
cerr << "Wrong value in A" << (i+2) << ": expected=" << fExpected << ", actual=" << fActual << endl;
@@ -1414,7 +1414,7 @@ void ScExportTest::testSharedFormulaExportXLS()
}
aPos.IncCol();
- ScFormulaCell* pFC = pDoc->GetFormulaCell(aPos);
+ ScFormulaCell* pFC = rDoc.GetFormulaCell(aPos);
if (!pFC)
{
cerr << "B" << (i+2) << " should be a formula cell." << endl;
@@ -1429,7 +1429,7 @@ void ScExportTest::testSharedFormulaExportXLS()
return false;
}
- fActual = pDoc->GetValue(aPos);
+ fActual = rDoc.GetValue(aPos);
if (fExpected != fActual)
{
cerr << "Wrong value in B" << (i+2) << ": expected=" << fExpected << ", actual=" << fActual << endl;
@@ -1443,21 +1443,23 @@ void ScExportTest::testSharedFormulaExportXLS()
} aTest;
ScDocShellRef xDocSh = loadDoc("shared-formula/3d-reference.", ODS);
- CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ {
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
+ ScDocument& rDoc = xDocSh->GetDocument();
- // Check the content of the original.
- bool bRes = aTest.checkContent(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Content check on the original document failed.", bRes);
+ // Check the content of the original.
+ bool bRes = aTest.checkContent(rDoc);
+ CPPUNIT_ASSERT_MESSAGE("Content check on the original document failed.", bRes);
+ }
ScDocShellRef xDocSh2 = saveAndReload(xDocSh, XLS);
xDocSh->DoClose();
CPPUNIT_ASSERT_MESSAGE("Failed to reload file.", xDocSh2.Is());
- pDoc = xDocSh2->GetDocument();
+ ScDocument& rDoc = xDocSh2->GetDocument();
// Check the content of the reloaded. This should be identical.
- bRes = aTest.checkContent(pDoc);
+ bool bRes = aTest.checkContent(rDoc);
CPPUNIT_ASSERT_MESSAGE("Content check on the reloaded document failed.", bRes);
xDocSh2->DoClose();
@@ -1467,14 +1469,14 @@ void ScExportTest::testSharedFormulaExportXLSX()
{
struct
{
- bool checkContent( ScDocument* pDoc )
+ bool checkContent( ScDocument& rDoc )
{
// B2:B7 should show 1,2,3,4,5,6.
double fExpected = 1.0;
for (SCROW i = 1; i <= 6; ++i, ++fExpected)
{
ScAddress aPos(1,i,0);
- double fVal = pDoc->GetValue(aPos);
+ double fVal = rDoc.GetValue(aPos);
if (fVal != fExpected)
{
cerr << "Wrong value in B" << (i+1) << ": expected=" << fExpected << ", actual=" << fVal << endl;
@@ -1487,7 +1489,7 @@ void ScExportTest::testSharedFormulaExportXLSX()
for (SCROW i = 1; i <= 6; ++i, fExpected+=10.0)
{
ScAddress aPos(2,i,0);
- double fVal = pDoc->GetValue(aPos);
+ double fVal = rDoc.GetValue(aPos);
if (fVal != fExpected)
{
cerr << "Wrong value in C" << (i+1) << ": expected=" << fExpected << ", actual=" << fVal << endl;
@@ -1500,7 +1502,7 @@ void ScExportTest::testSharedFormulaExportXLSX()
for (SCROW i = 1; i <= 6; ++i, ++fExpected)
{
ScAddress aPos(3,i,0);
- double fVal = pDoc->GetValue(aPos);
+ double fVal = rDoc.GetValue(aPos);
if (fVal != fExpected)
{
cerr << "Wrong value in D" << (i+1) << ": expected=" << fExpected << ", actual=" << fVal << endl;
@@ -1514,25 +1516,27 @@ void ScExportTest::testSharedFormulaExportXLSX()
} aTest;
ScDocShellRef xDocSh = loadDoc("shared-formula/3d-reference.", XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ {
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
+ ScDocument& rDoc = xDocSh->GetDocument();
- bool bRes = aTest.checkContent(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Content check on the initial document failed.", bRes);
+ bool bRes = aTest.checkContent(rDoc);
+ CPPUNIT_ASSERT_MESSAGE("Content check on the initial document failed.", bRes);
- pDoc->CalcAll(); // Recalculate to flush all cached results.
- bRes = aTest.checkContent(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Content check on the initial recalculated document failed.", bRes);
+ rDoc.CalcAll(); // Recalculate to flush all cached results.
+ bRes = aTest.checkContent(rDoc);
+ CPPUNIT_ASSERT_MESSAGE("Content check on the initial recalculated document failed.", bRes);
+ }
// Save and reload, and check the content again.
ScDocShellRef xDocSh2 = saveAndReload(xDocSh, XLSX);
xDocSh->DoClose();
CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh2.Is());
- pDoc = xDocSh2->GetDocument();
- pDoc->CalcAll(); // Recalculate to flush all cached results.
+ ScDocument& rDoc = xDocSh2->GetDocument();
+ rDoc.CalcAll(); // Recalculate to flush all cached results.
- bRes = aTest.checkContent(pDoc);
+ bool bRes = aTest.checkContent(rDoc);
CPPUNIT_ASSERT_MESSAGE("Content check on the reloaded document failed.", bRes);
xDocSh2->DoClose();
@@ -1542,7 +1546,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
{
struct
{
- bool checkContent( ScDocument* pDoc )
+ bool checkContent( ScDocument& rDoc )
{
{
// B2:B7 should show A,B,....,F.
@@ -1550,7 +1554,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
for (SCROW i = 0; i <= 5; ++i)
{
ScAddress aPos(1,i+1,0);
- OUString aStr = pDoc->GetString(aPos);
+ OUString aStr = rDoc.GetString(aPos);
OUString aExpected = OUString::createFromAscii(expected[i]);
if (aStr != aExpected)
{
@@ -1566,7 +1570,7 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
for (SCROW i = 0; i <= 5; ++i)
{
ScAddress aPos(2,i+1,0);
- OUString aStr = pDoc->GetString(aPos);
+ OUString aStr = rDoc.GetString(aPos);
OUString aExpected = OUString::createFromAscii(expected[i]);
if (aStr != aExpected)
{
@@ -1582,25 +1586,26 @@ void ScExportTest::testSharedFormulaStringResultExportXLSX()
} aTest;
ScDocShellRef xDocSh = loadDoc("shared-formula/text-results.", XLSX);
- CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
-
- // Check content without re-calculation, to test cached formula results.
- bool bRes = aTest.checkContent(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Content check on the initial document failed.", bRes);
+ {
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocSh.Is());
+ ScDocument& rDoc = xDocSh->GetDocument();
- // Now, re-calculate and check the results.
- pDoc->CalcAll();
- bRes = aTest.checkContent(pDoc);
- CPPUNIT_ASSERT_MESSAGE("Content check on the initial recalculated document failed.", bRes);
+ // Check content without re-calculation, to test cached formula results.
+ bool bRes = aTest.checkContent(rDoc);
+ CPPUNIT_ASSERT_MESSAGE("Content check on the initial document failed.", bRes);
+ // Now, re-calculate and check the results.
+ rDoc.CalcAll();
+ bRes = aTest.checkContent(rDoc);
+ CPPUNIT_ASSERT_MESSAGE("Content check on the initial recalculated document failed.", bRes);
+ }
// Reload and check again.
ScDocShellRef xDocSh2 = saveAndReload(xDocSh, XLSX);
xDocSh->DoClose();
CPPUNIT_ASSERT_MESSAGE("Failed to re-load file.", xDocSh2.Is());
- pDoc = xDocSh2->GetDocument();
+ ScDocument& rDoc = xDocSh2->GetDocument();
- bRes = aTest.checkContent(pDoc);
+ bool bRes = aTest.checkContent(rDoc);
CPPUNIT_ASSERT_MESSAGE("Content check on the reloaded document failed.", bRes);
xDocSh2->DoClose();
@@ -1612,11 +1617,10 @@ void ScExportTest::testFunctionsExcel2010( sal_uLong nFormatType )
CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xShell.Is());
ScDocShellRef xDocSh = saveAndReload(xShell, nFormatType);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- pDoc->CalcAll(); // perform hard re-calculation.
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll(); // perform hard re-calculation.
- testFunctionsExcel2010_Impl(pDoc);
+ testFunctionsExcel2010_Impl(rDoc);
xDocSh->DoClose();
}
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index bdc58b840d0f..4374d6fb6988 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -280,34 +280,34 @@ bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
namespace {
-void testRangeNameImpl(ScDocument* pDoc)
+void testRangeNameImpl(ScDocument& rDoc)
{
//check one range data per sheet and one global more detailed
//add some more checks here
- ScRangeData* pRangeData = pDoc->GetRangeName()->findByUpperName(OUString("GLOBAL1"));
+ ScRangeData* pRangeData = rDoc.GetRangeName()->findByUpperName(OUString("GLOBAL1"));
CPPUNIT_ASSERT_MESSAGE("range name Global1 not found", pRangeData);
double aValue;
- pDoc->GetValue(1,0,0,aValue);
+ rDoc.GetValue(1,0,0,aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Global1 should reference Sheet1.A1", 1.0, aValue);
- pRangeData = pDoc->GetRangeName(0)->findByUpperName(OUString("LOCAL1"));
+ pRangeData = rDoc.GetRangeName(0)->findByUpperName(OUString("LOCAL1"));
CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 not found", pRangeData);
- pDoc->GetValue(1,2,0,aValue);
+ rDoc.GetValue(1,2,0,aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Sheet1.Local1 should reference Sheet1.A3", 3.0, aValue);
- pRangeData = pDoc->GetRangeName(1)->findByUpperName(OUString("LOCAL2"));
+ pRangeData = rDoc.GetRangeName(1)->findByUpperName(OUString("LOCAL2"));
CPPUNIT_ASSERT_MESSAGE("range name Sheet2.Local2 not found", pRangeData);
- pDoc->GetValue(1,1,1,aValue);
+ rDoc.GetValue(1,1,1,aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Sheet2.Local2 should reference Sheet2.A2", 7.0, aValue);
//check for correct results for the remaining formulas
- pDoc->GetValue(1,1,0, aValue);
+ rDoc.GetValue(1,1,0, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("=global2 should be 2", 2.0, aValue);
- pDoc->GetValue(1,3,0, aValue);
+ rDoc.GetValue(1,3,0, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("=local2 should be 4", 4.0, aValue);
- pDoc->GetValue(2,0,0, aValue);
+ rDoc.GetValue(2,0,0, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("=SUM(global3) should be 10", 10.0, aValue);
- pDoc->GetValue(1,0,1,aValue);
+ rDoc.GetValue(1,0,1,aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Sheet2.local1 should reference Sheet1.A5", 5.0, aValue);
// Test if Global5 ( which depends on Global6 ) is evaluated
- pDoc->GetValue(0,5,1, aValue);
+ rDoc.GetValue(0,5,1, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("formula Global5 should reference Global6 ( which is evaluated as local1 )", 5.0, aValue);
}
@@ -318,17 +318,17 @@ void ScFiltersTest::testBasicCellContentODS()
ScDocShellRef xDocSh = loadDoc("basic-cell-content.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load basic-cell-content.ods", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- OUString aStr = pDoc->GetString(1, 1, 0); // B2
+ ScDocument& rDoc = xDocSh->GetDocument();
+ OUString aStr = rDoc.GetString(1, 1, 0); // B2
CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice Calc"), aStr);
- double fVal = pDoc->GetValue(1, 2, 0); // B3
+ double fVal = rDoc.GetValue(1, 2, 0); // B3
CPPUNIT_ASSERT_EQUAL(12345.0, fVal);
- aStr = pDoc->GetString(1, 3, 0); // B4
+ aStr = rDoc.GetString(1, 3, 0); // B4
CPPUNIT_ASSERT_EQUAL(OUString("A < B"), aStr);
// Numeric value of 0.
ScRefCellValue aCell;
- aCell.assign(*pDoc, ScAddress(1,4,0)); // B5
+ aCell.assign(rDoc, ScAddress(1,4,0)); // B5
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"This cell must be numeric.", CELLTYPE_VALUE, aCell.meType);
CPPUNIT_ASSERT_EQUAL(0.0, aCell.mfValue);
@@ -341,14 +341,14 @@ void ScFiltersTest::testRangeNameXLS()
ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testRangeNameImpl(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testRangeNameImpl(rDoc);
OUString aSheet2CSV("rangeExp_Sheet2.");
OUString aCSVPath;
createCSVPath( aSheet2CSV, aCSVPath );
// fdo#44587
- testFile( aCSVPath, pDoc, 1);
+ testFile( aCSVPath, rDoc, 1);
xDocSh->DoClose();
}
@@ -358,8 +358,8 @@ void ScFiltersTest::testRangeNameXLSX()
ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLSX);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- testRangeNameImpl(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testRangeNameImpl(rDoc);
xDocSh->DoClose();
}
@@ -367,11 +367,11 @@ void ScFiltersTest::testRangeNameXLSX()
void ScFiltersTest::testHyperlinksXLSX()
{
ScDocShellRef xDocSh = loadDoc("hyperlinks.", XLSX);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_EQUAL(OUString("10:ABC10"), pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("10:ABC11"), pDoc->GetString(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("10:ABC12"), pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("10:ABC10"), rDoc.GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("10:ABC11"), rDoc.GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("10:ABC12"), rDoc.GetString(ScAddress(0,3,0)));
xDocSh->DoClose();
}
@@ -382,13 +382,13 @@ void ScFiltersTest::testHardRecalcODS()
xDocSh->DoHardRecalc(true);
CPPUNIT_ASSERT_MESSAGE("Failed to load hard-recalc.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFileName;
//test hard recalc: document has an incorrect cached formula result
//hard recalc should have updated to the correct result
createCSVPath(OUString("hard-recalc."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
xDocSh->DoClose();
}
@@ -399,59 +399,59 @@ void ScFiltersTest::testFunctionsODS()
xDocSh->DoHardRecalc(true);
CPPUNIT_ASSERT_MESSAGE("Failed to load functions.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFileName;
//test logical functions
createCSVPath(OUString("logical-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
//test spreadsheet functions
createCSVPath(OUString("spreadsheet-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 1);
+ testFile(aCSVFileName, rDoc, 1);
//test mathematical functions
createCSVPath(OUString("mathematical-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 2, PureString);
+ testFile(aCSVFileName, rDoc, 2, PureString);
//test information functions
createCSVPath(OUString("information-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 3);
+ testFile(aCSVFileName, rDoc, 3);
// text functions
createCSVPath(OUString("text-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 4, PureString);
+ testFile(aCSVFileName, rDoc, 4, PureString);
// statistical functions
createCSVPath(OUString("statistical-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 5);
+ testFile(aCSVFileName, rDoc, 5);
// financial functions
createCSVPath("financial-functions.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 6);
+ testFile(aCSVFileName, rDoc, 6);
xDocSh->DoClose();
xDocSh = loadDoc("database-functions.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load functions.*", xDocSh.Is());
xDocSh->DoHardRecalc(true);
- pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc2 = xDocSh->GetDocument();
createCSVPath("database-functions.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc2, 0);
xDocSh->DoClose();
xDocSh = loadDoc("date-time-functions.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load functions.*", xDocSh.Is());
xDocSh->DoHardRecalc(true);
- pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc3 = xDocSh->GetDocument();
createCSVPath("date-time-functions.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 0, PureString);
+ testFile(aCSVFileName, rDoc3, 0, PureString);
}
void ScFiltersTest::testFunctionsExcel2010()
{
ScDocShellRef xDocSh = loadDoc("functions-excel-2010.", XLSX);
CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- pDoc->CalcAll(); // perform hard re-calculation.
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll(); // perform hard re-calculation.
- testFunctionsExcel2010_Impl(pDoc);
+ testFunctionsExcel2010_Impl(rDoc);
xDocSh->DoClose();
}
@@ -462,24 +462,24 @@ void ScFiltersTest::testCachedFormulaResultsODS()
ScDocShellRef xDocSh = loadDoc("functions.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load functions.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFileName;
//test cached formula results of logical functions
createCSVPath(OUString("logical-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
//test cached formula results of spreadsheet functions
createCSVPath(OUString("spreadsheet-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 1);
+ testFile(aCSVFileName, rDoc, 1);
//test cached formula results of mathematical functions
createCSVPath(OUString("mathematical-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 2, PureString);
+ testFile(aCSVFileName, rDoc, 2, PureString);
//test cached formula results of information functions
createCSVPath(OUString("information-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 3);
+ testFile(aCSVFileName, rDoc, 3);
// text functions
createCSVPath(OUString("text-functions."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 4, PureString);
+ testFile(aCSVFileName, rDoc, 4, PureString);
xDocSh->DoClose();
}
@@ -488,21 +488,21 @@ void ScFiltersTest::testCachedFormulaResultsODS()
ScDocShellRef xDocSh = loadDoc("cachedValue.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load cachedValue.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFileName;
createCSVPath("cachedValue.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
//we want to me sure that volatile functions are always recalculated
//regardless of cached results. if you update the ods file, you must
//update the values here.
//if NOW() is recacluated, then it should never equal sTodayCache
OUString sTodayCache("01/25/13 01:06 PM");
- OUString sTodayRecalc(pDoc->GetString(0,0,1));
+ OUString sTodayRecalc(rDoc.GetString(0,0,1));
CPPUNIT_ASSERT(sTodayCache != sTodayRecalc);
- OUString sTodayRecalcRef(pDoc->GetString(1,0,1));
+ OUString sTodayRecalcRef(rDoc.GetString(1,0,1));
CPPUNIT_ASSERT_EQUAL(sTodayRecalc, sTodayRecalcRef);
// make sure that error values are not being treated as string values
@@ -514,14 +514,14 @@ void ScFiltersTest::testCachedFormulaResultsODS()
aIsErrorFormula.append((char)('A'+nCol)).append(OUString::number(nRow));
aIsErrorFormula.append(")");
OUString aFormula = aIsErrorFormula.makeStringAndClear();
- pDoc->SetString(nCol, nRow + 2, 2, aFormula);
- CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8).getStr(), pDoc->GetString(nCol, nRow +2, 2), OUString("TRUE"));
+ rDoc.SetString(nCol, nRow + 2, 2, aFormula);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8).getStr(), rDoc.GetString(nCol, nRow +2, 2), OUString("TRUE"));
OUStringBuffer aIsTextFormula("=ISTEXT(");
aIsTextFormula.append((char)('A'+nCol)).append(OUString::number(nRow));
aIsTextFormula.append(")");
- pDoc->SetString(nCol, nRow + 4, 2, aIsTextFormula.makeStringAndClear());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("", pDoc->GetString(nCol, nRow +4, 2), OUString("FALSE"));
+ rDoc.SetString(nCol, nRow + 4, 2, aIsTextFormula.makeStringAndClear());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("", rDoc.GetString(nCol, nRow +4, 2), OUString("FALSE"));
}
}
@@ -534,17 +534,17 @@ void ScFiltersTest::testCachedMatrixFormulaResultsODS()
ScDocShellRef xDocSh = loadDoc("matrix.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load matrix.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
//test matrix
OUString aCSVFileName;
createCSVPath("matrix.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
//test matrices with special cases
createCSVPath("matrix2.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 1);
+ testFile(aCSVFileName, rDoc, 1);
createCSVPath("matrix3.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 2);
+ testFile(aCSVFileName, rDoc, 2);
//The above testFile() does not catch the below case.
//If a matrix formula has a matrix reference cell that is intended to have
//a blank text result, the matrix reference cell is actually saved(export)
@@ -552,12 +552,12 @@ void ScFiltersTest::testCachedMatrixFormulaResultsODS()
//Import works around this by setting these cells as text cells so that
//the blank text is used for display instead of the number 0.
//If this is working properly, the following cell should NOT have value data.
- CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(3,0,2));
+ CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetString(3,0,2));
// fdo#59293 with cached value import error formulas require special
// treatment
- pDoc->SetString(2, 5, 2, "=ISERROR(A6)");
- double nVal = pDoc->GetValue(2,5,2);
+ rDoc.SetString(2, 5, 2, "=ISERROR(A6)");
+ double nVal = rDoc.GetValue(2,5,2);
CPPUNIT_ASSERT_EQUAL(1.0, nVal);
xDocSh->DoClose();
@@ -567,22 +567,22 @@ void ScFiltersTest::testFormulaDepAcrossSheetsODS()
{
ScDocShellRef xDocSh = loadDoc("formula-across-sheets.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load the file.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- sc::AutoCalcSwitch aACSwitch(*pDoc, true); // Make sure auto calc is turned on.
+ sc::AutoCalcSwitch aACSwitch(rDoc, true); // Make sure auto calc is turned on.
// Save the original values of A4:C4.
- double fA4 = pDoc->GetValue(ScAddress(0,3,2));
- double fB4 = pDoc->GetValue(ScAddress(1,3,2));
- double fC4 = pDoc->GetValue(ScAddress(2,3,2));
+ double fA4 = rDoc.GetValue(ScAddress(0,3,2));
+ double fB4 = rDoc.GetValue(ScAddress(1,3,2));
+ double fC4 = rDoc.GetValue(ScAddress(2,3,2));
// Change the value of D4. This should trigger A4:C4 to be recalculated.
- double fD4 = pDoc->GetValue(ScAddress(3,3,2));
- pDoc->SetValue(ScAddress(3,3,2), fD4+1.0);
+ double fD4 = rDoc.GetValue(ScAddress(3,3,2));
+ rDoc.SetValue(ScAddress(3,3,2), fD4+1.0);
- CPPUNIT_ASSERT_MESSAGE("The value must differ from the original.", fA4 != pDoc->GetValue(ScAddress(0,3,2)));
- CPPUNIT_ASSERT_MESSAGE("The value must differ from the original.", fB4 != pDoc->GetValue(ScAddress(1,3,2)));
- CPPUNIT_ASSERT_MESSAGE("The value must differ from the original.", fC4 != pDoc->GetValue(ScAddress(2,3,2)));
+ CPPUNIT_ASSERT_MESSAGE("The value must differ from the original.", fA4 != rDoc.GetValue(ScAddress(0,3,2)));
+ CPPUNIT_ASSERT_MESSAGE("The value must differ from the original.", fB4 != rDoc.GetValue(ScAddress(1,3,2)));
+ CPPUNIT_ASSERT_MESSAGE("The value must differ from the original.", fC4 != rDoc.GetValue(ScAddress(2,3,2)));
xDocSh->DoClose();
}
@@ -591,12 +591,12 @@ void ScFiltersTest::testFormulaDepDeleteContentsODS()
{
ScDocShellRef xDocSh = loadDoc("formula-delete-contents.", ODS, true);
CPPUNIT_ASSERT_MESSAGE("Failed to load the file.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- sc::UndoSwitch aUndoSwitch(*pDoc, true); // Enable undo.
- sc::AutoCalcSwitch aACSwitch(*pDoc, true); // Make sure auto calc is turned on.
+ sc::UndoSwitch aUndoSwitch(rDoc, true); // Enable undo.
+ sc::AutoCalcSwitch aACSwitch(rDoc, true); // Make sure auto calc is turned on.
- CPPUNIT_ASSERT_EQUAL(195.0, pDoc->GetValue(ScAddress(3,15,0))); // formula in D16
+ CPPUNIT_ASSERT_EQUAL(195.0, rDoc.GetValue(ScAddress(3,15,0))); // formula in D16
// Delete D2:D5.
ScDocFunc& rFunc = xDocSh->GetDocFunc();
@@ -606,55 +606,55 @@ void ScFiltersTest::testFormulaDepDeleteContentsODS()
aMark.MarkToMulti();
bool bGood = rFunc.DeleteContents(aMark, IDF_ALL, true, true);
CPPUNIT_ASSERT(bGood);
- CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(3,1,0)));
- CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(3,2,0)));
- CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(3,3,0)));
- CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(3,4,0)));
+ CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(3,1,0)));
+ CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(3,2,0)));
+ CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(3,3,0)));
+ CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(ScAddress(3,4,0)));
- CPPUNIT_ASSERT_EQUAL(94.0, pDoc->GetValue(ScAddress(3,15,0))); // formula in D16
+ CPPUNIT_ASSERT_EQUAL(94.0, rDoc.GetValue(ScAddress(3,15,0))); // formula in D16
- SfxUndoManager* pUndoMgr = pDoc->GetUndoManager();
+ SfxUndoManager* pUndoMgr = rDoc.GetUndoManager();
CPPUNIT_ASSERT(pUndoMgr);
pUndoMgr->Undo();
- CPPUNIT_ASSERT_EQUAL(195.0, pDoc->GetValue(ScAddress(3,15,0))); // formula in D16
+ CPPUNIT_ASSERT_EQUAL(195.0, rDoc.GetValue(ScAddress(3,15,0))); // formula in D16
xDocSh->DoClose();
}
namespace {
-void testDBRanges_Impl(ScDocument* pDoc, sal_Int32 nFormat)
+void testDBRanges_Impl(ScDocument& rDoc, sal_Int32 nFormat)
{
- ScDBCollection* pDBCollection = pDoc->GetDBCollection();
+ ScDBCollection* pDBCollection = rDoc.GetDBCollection();
CPPUNIT_ASSERT_MESSAGE("no database collection", pDBCollection);
- ScDBData* pAnonDBData = pDoc->GetAnonymousDBData(0);
+ ScDBData* pAnonDBData = rDoc.GetAnonymousDBData(0);
CPPUNIT_ASSERT_MESSAGE("missing anonymous DB data in sheet 1", pAnonDBData);
//control hidden rows
bool bHidden;
SCROW nRow1, nRow2;
- bHidden = pDoc->RowHidden(0, 0, &nRow1, &nRow2);
+ bHidden = rDoc.RowHidden(0, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("Sheet1: row 0 should be visible", !bHidden && nRow1 == 0 && nRow2 == 0);
- bHidden = pDoc->RowHidden(1, 0, &nRow1, &nRow2);
+ bHidden = rDoc.RowHidden(1, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("Sheet1: rows 1-2 should be hidden", bHidden && nRow1 == 1 && nRow2 == 2);
- bHidden = pDoc->RowHidden(3, 0, &nRow1, &nRow2);
+ bHidden = rDoc.RowHidden(3, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("Sheet1: row 3 should be visible", !bHidden && nRow1 == 3 && nRow2 == 3);
- bHidden = pDoc->RowHidden(4, 0, &nRow1, &nRow2);
+ bHidden = rDoc.RowHidden(4, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("Sheet1: row 4-5 should be hidden", bHidden && nRow1 == 4 && nRow2 == 5);
- bHidden = pDoc->RowHidden(6, 0, &nRow1, &nRow2);
+ bHidden = rDoc.RowHidden(6, 0, &nRow1, &nRow2);
CPPUNIT_ASSERT_MESSAGE("Sheet1: row 6-end should be visible", !bHidden && nRow1 == 6 && nRow2 == MAXROW);
if(nFormat == ODS) //excel doesn't support named db ranges
{
double aValue;
- pDoc->GetValue(0,10,1, aValue);
+ rDoc.GetValue(0,10,1, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet2: A11: formula result is incorrect", 4.0, aValue);
- pDoc->GetValue(1, 10, 1, aValue);
+ rDoc.GetValue(1, 10, 1, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet2: B11: formula result is incorrect", 2.0, aValue);
}
double aValue;
- pDoc->GetValue(3,10,1, aValue);
+ rDoc.GetValue(3,10,1, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet2: D11: formula result is incorrect", 4.0, aValue);
- pDoc->GetValue(4, 10, 1, aValue);
+ rDoc.GetValue(4, 10, 1, aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet2: E11: formula result is incorrect", 2.0, aValue);
}
@@ -666,9 +666,9 @@ void ScFiltersTest::testDatabaseRangesODS()
ScDocShellRef xDocSh = loadDoc("database.", ODS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testDBRanges_Impl(pDoc, ODS);
+ testDBRanges_Impl(rDoc, ODS);
xDocSh->DoClose();
}
@@ -677,9 +677,9 @@ void ScFiltersTest::testDatabaseRangesXLS()
ScDocShellRef xDocSh = loadDoc("database.", XLS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testDBRanges_Impl(pDoc, XLS);
+ testDBRanges_Impl(rDoc, XLS);
xDocSh->DoClose();
}
@@ -688,9 +688,9 @@ void ScFiltersTest::testDatabaseRangesXLSX()
ScDocShellRef xDocSh = loadDoc("database.", XLSX);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testDBRanges_Impl(pDoc, XLSX);
+ testDBRanges_Impl(rDoc, XLSX);
xDocSh->DoClose();
}
@@ -699,9 +699,9 @@ void ScFiltersTest::testFormatsODS()
ScDocShellRef xDocSh = loadDoc("formats.", ODS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- testFormats(this, pDoc, ODS);
+ testFormats(this, &rDoc, ODS);
xDocSh->DoClose();
}
@@ -710,9 +710,9 @@ void ScFiltersTest::testFormatsODS()
// ScDocShellRef xDocSh = loadDoc("formats.", XLS);
// xDocSh->DoHardRecalc(true);
//
-// ScDocument* pDoc = xDocSh->GetDocument();
+// ScDocument& rDoc = xDocSh->GetDocument();
//
-// testFormats(this, pDoc, XLS);
+// testFormats(this, rDoc, XLS);
// xDocSh->DoClose();
// }
@@ -721,9 +721,9 @@ void ScFiltersTest::testFormatsODS()
// ScDocShellRef xDocSh = loadDoc("formats.", XLSX);
// xDocSh->DoHardRecalc(true);
//
-// ScDocument* pDoc = xDocSh->GetDocument();
+// ScDocument& rDoc = xDocSh->GetDocument();
//
-// testFormats(this, pDoc, XLSX);
+// testFormats(this, rDoc, XLSX);
// xDocSh->DoClose();
// }
@@ -732,11 +732,11 @@ void ScFiltersTest::testMatrixODS()
ScDocShellRef xDocSh = loadDoc("matrix.", ODS);
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFileName;
createCSVPath(OUString("matrix."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
xDocSh->DoClose();
}
@@ -747,11 +747,11 @@ void ScFiltersTest::testMatrixXLS()
xDocSh->DoHardRecalc(true);
CPPUNIT_ASSERT_MESSAGE("Failed to load matrix.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFileName;
createCSVPath(OUString("matrix."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 0);
+ testFile(aCSVFileName, rDoc, 0);
xDocSh->DoClose();
}
@@ -761,14 +761,14 @@ void ScFiltersTest::testBorderODS()
ScDocShellRef xDocSh = loadDoc("border.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load border.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
const editeng::SvxBorderLine* pLeft = NULL;
const editeng::SvxBorderLine* pTop = NULL;
const editeng::SvxBorderLine* pRight = NULL;
const editeng::SvxBorderLine* pBottom = NULL;
- pDoc->GetBorderLines( 0, 1, 0, &pLeft, &pTop, &pRight, &pBottom );
+ rDoc.GetBorderLines( 0, 1, 0, &pLeft, &pTop, &pRight, &pBottom );
CPPUNIT_ASSERT(!pLeft);
CPPUNIT_ASSERT(!pTop);
CPPUNIT_ASSERT(!pBottom);
@@ -776,7 +776,7 @@ void ScFiltersTest::testBorderODS()
CPPUNIT_ASSERT_EQUAL(
table::BorderLineStyle::SOLID, pRight->GetBorderLineStyle());
- pDoc->GetBorderLines( 2, 1, 0, &pLeft, &pTop, &pRight, &pBottom );
+ rDoc.GetBorderLines( 2, 1, 0, &pLeft, &pTop, &pRight, &pBottom );
CPPUNIT_ASSERT(!pLeft);
CPPUNIT_ASSERT(!pTop);
CPPUNIT_ASSERT(!pBottom);
@@ -786,7 +786,7 @@ void ScFiltersTest::testBorderODS()
table::BorderLineStyle::SOLID, pRight->GetBorderLineStyle());
CPPUNIT_ASSERT_EQUAL(20L, pRight->GetWidth());
- pDoc->GetBorderLines( 2, 8, 0, &pLeft, &pTop, &pRight, &pBottom );
+ rDoc.GetBorderLines( 2, 8, 0, &pLeft, &pTop, &pRight, &pBottom );
CPPUNIT_ASSERT(pLeft);
CPPUNIT_ASSERT(pTop);
@@ -857,7 +857,7 @@ void ScFiltersTest::testBordersOoo33()
ScDocShellRef xDocSh = loadDoc("borders_ooo33.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load borders_ooo33.*", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
const editeng::SvxBorderLine* pLeft = NULL;
const editeng::SvxBorderLine* pTop = NULL;
@@ -868,7 +868,7 @@ void ScFiltersTest::testBordersOoo33()
{
for(sal_Int32 j = 0; j<22; ++j)
{
- pDoc->GetBorderLines( i, j, 0, &pLeft, &pTop, &pRight, &pBottom );
+ rDoc.GetBorderLines( i, j, 0, &pLeft, &pTop, &pRight, &pBottom );
if(pLeft!=NULL && pTop!=NULL && pRight!=NULL && pBottom!=NULL)
{
CPPUNIT_ASSERT_EQUAL(borders[temp].column, i);
@@ -911,22 +911,22 @@ void ScFiltersTest::testBugFixesODS()
CPPUNIT_ASSERT_MESSAGE("Failed to load bugFixes.ods", xDocSh.Is());
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
{
// fdo#40967
OUString aCSVFileName;
createCSVPath(OUString("bugFix_Sheet2."), aCSVFileName);
- testFile(aCSVFileName, pDoc, 1);
+ testFile(aCSVFileName, rDoc, 1);
}
{
// fdo#40426
- ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByUpperName("DBRANGE1");
+ ScDBData* pDBData = rDoc.GetDBCollection()->getNamedDBs().findByUpperName("DBRANGE1");
CPPUNIT_ASSERT(pDBData);
CPPUNIT_ASSERT(pDBData->HasHeader());
// no header
- pDBData = pDoc->GetDBCollection()->getNamedDBs().findByUpperName("DBRANGE2");
+ pDBData = rDoc.GetDBCollection()->getNamedDBs().findByUpperName("DBRANGE2");
CPPUNIT_ASSERT(pDBData);
CPPUNIT_ASSERT(!pDBData->HasHeader());
}
@@ -935,7 +935,7 @@ void ScFiltersTest::testBugFixesODS()
// fdo#59240
OUString aCSVFileName;
createCSVPath("bugFix_Sheet4.", aCSVFileName);
- testFile(aCSVFileName, pDoc, 3);
+ testFile(aCSVFileName, rDoc, 3);
}
xDocSh->DoClose();
@@ -947,8 +947,7 @@ void ScFiltersTest::testBugFixesXLS()
CPPUNIT_ASSERT_MESSAGE("Failed to load bugFixes.xls", xDocSh.Is());
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+ xDocSh->GetDocument();
xDocSh->DoClose();
}
@@ -958,19 +957,18 @@ void ScFiltersTest::testBugFixesXLSX()
CPPUNIT_ASSERT_MESSAGE("Failed to load bugFixes.xls", xDocSh.Is());
xDocSh->DoHardRecalc(true);
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+ xDocSh->GetDocument();
xDocSh->DoClose();
}
namespace {
-void checkMergedCells( ScDocument* pDoc, const ScAddress& rStartAddress,
+void checkMergedCells( ScDocument& rDoc, const ScAddress& rStartAddress,
const ScAddress& rExpectedEndAddress )
{
SCCOL nActualEndCol = rStartAddress.Col();
SCROW nActualEndRow = rStartAddress.Row();
- pDoc->ExtendMerge( rStartAddress.Col(), rStartAddress.Row(),
+ rDoc.ExtendMerge( rStartAddress.Col(), rStartAddress.Row(),
nActualEndCol, nActualEndRow, rStartAddress.Tab(), false );
OString sTab = OString::number( rStartAddress.Tab() + 1 );
OString msg = "Merged cells are not correctly imported on sheet" + sTab;
@@ -985,25 +983,25 @@ void checkMergedCells( ScDocument* pDoc, const ScAddress& rStartAddress,
void ScFiltersTest::testMergedCellsODS()
{
ScDocShellRef xDocSh = loadDoc("merged.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
//check sheet1 content
OUString aCSVFileName1;
createCSVPath(OUString("merged1."), aCSVFileName1);
- testFile(aCSVFileName1, pDoc, 0);
+ testFile(aCSVFileName1, rDoc, 0);
//check sheet1 merged cells
- checkMergedCells( pDoc, ScAddress( 0, 0, 0 ), ScAddress( 5, 11, 0 ) );
- checkMergedCells( pDoc, ScAddress( 7, 2, 0 ), ScAddress( 9, 12, 0 ) );
- checkMergedCells( pDoc, ScAddress( 3, 15, 0 ), ScAddress( 7, 23, 0 ) );
+ checkMergedCells( rDoc, ScAddress( 0, 0, 0 ), ScAddress( 5, 11, 0 ) );
+ checkMergedCells( rDoc, ScAddress( 7, 2, 0 ), ScAddress( 9, 12, 0 ) );
+ checkMergedCells( rDoc, ScAddress( 3, 15, 0 ), ScAddress( 7, 23, 0 ) );
//check sheet2 content
OUString aCSVFileName2;
createCSVPath(OUString("merged2."), aCSVFileName2);
- testFile(aCSVFileName2, pDoc, 1);
+ testFile(aCSVFileName2, rDoc, 1);
//check sheet2 merged cells
- checkMergedCells( pDoc, ScAddress( 4, 3, 1 ), ScAddress( 6, 15, 1 ) );
+ checkMergedCells( rDoc, ScAddress( 4, 3, 1 ), ScAddress( 6, 15, 1 ) );
xDocSh->DoClose();
}
@@ -1011,17 +1009,17 @@ void ScFiltersTest::testMergedCellsODS()
void ScFiltersTest::testRepeatedColumnsODS()
{
ScDocShellRef xDocSh = loadDoc("repeatedColumns.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
//text
OUString aCSVFileName1;
createCSVPath(OUString("repeatedColumns1."), aCSVFileName1);
- testFile(aCSVFileName1, pDoc, 0);
+ testFile(aCSVFileName1, rDoc, 0);
//numbers
OUString aCSVFileName2;
createCSVPath(OUString("repeatedColumns2."), aCSVFileName2);
- testFile(aCSVFileName2, pDoc, 1);
+ testFile(aCSVFileName2, rDoc, 1);
xDocSh->DoClose();
}
@@ -1035,7 +1033,7 @@ struct ValDataTestParams
ScConditionMode eCondOp;
OUString aStrVal1;
OUString aStrVal2;
- ScDocument* pDocument;
+ ScDocument& rDocument;
ScAddress aPosition;
OUString aErrorTitle;
OUString aErrorMessage;
@@ -1043,24 +1041,24 @@ struct ValDataTestParams
sal_uLong nExpectedIndex;
ValDataTestParams( ScValidationMode eMode, ScConditionMode eOp,
- const OUString& aExpr1, const OUString& aExpr2, ScDocument* pDoc,
+ const OUString& aExpr1, const OUString& aExpr2, ScDocument& rDoc,
ScAddress aPos, const OUString& aETitle, const OUString& aEMsg,
ScValidErrorStyle eEStyle, sal_uLong nIndex ):
eValMode(eMode), eCondOp(eOp), aStrVal1(aExpr1),
- aStrVal2(aExpr2), pDocument(pDoc), aPosition(aPos),
+ aStrVal2(aExpr2), rDocument(rDoc), aPosition(aPos),
aErrorTitle(aETitle), aErrorMessage(aEMsg),
eErrorStyle(eEStyle), nExpectedIndex(nIndex) { };
};
void checkValiditationEntries( const ValDataTestParams& rVDTParams )
{
- ScDocument* pDoc = rVDTParams.pDocument;
+ ScDocument& rDoc = rVDTParams.rDocument;
//create expected data validation entry
ScValidationData aValData(
rVDTParams.eValMode, rVDTParams.eCondOp, rVDTParams.aStrVal1,
- rVDTParams.aStrVal2, pDoc, rVDTParams.aPosition, EMPTY_OUSTRING,
- EMPTY_OUSTRING, pDoc->GetStorageGrammar(), pDoc->GetStorageGrammar()
+ rVDTParams.aStrVal2, &rDoc, rVDTParams.aPosition, EMPTY_OUSTRING,
+ EMPTY_OUSTRING, rDoc.GetStorageGrammar(), rDoc.GetStorageGrammar()
);
aValData.SetIgnoreBlank( true );
aValData.SetListType( 1 );
@@ -1069,7 +1067,7 @@ void checkValiditationEntries( const ValDataTestParams& rVDTParams )
aValData.SetSrcString( EMPTY_OUSTRING );
//get actual data validation entry from document
- const ScValidationData* pValDataTest = pDoc->GetValidationEntry( rVDTParams.nExpectedIndex );
+ const ScValidationData* pValDataTest = rDoc.GetValidationEntry( rVDTParams.nExpectedIndex );
sal_Int32 nCol( static_cast<sal_Int32>(rVDTParams.aPosition.Col()) );
sal_Int32 nRow( static_cast<sal_Int32>(rVDTParams.aPosition.Row()) );
@@ -1089,14 +1087,14 @@ void checkValiditationEntries( const ValDataTestParams& rVDTParams )
}
}
-void checkCellValidity( const ScAddress& rValBaseAddr, const ScRange& rRange, const ScDocument* pDoc )
+void checkCellValidity( const ScAddress& rValBaseAddr, const ScRange& rRange, const ScDocument& rDoc )
{
SCCOL nBCol( rValBaseAddr.Col() );
SCROW nBRow( rValBaseAddr.Row() );
SCTAB nTab( static_cast<const sal_Int32>(rValBaseAddr.Tab()) );
//get from the document the data validation entry we are checking against
- const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pDoc->GetAttr(nBCol, nBRow, nTab, ATTR_VALIDDATA) );
- const ScValidationData* pValData = pDoc->GetValidationEntry( pItem->GetValue() );
+ const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(rDoc.GetAttr(nBCol, nBRow, nTab, ATTR_VALIDDATA) );
+ const ScValidationData* pValData = rDoc.GetValidationEntry( pItem->GetValue() );
CPPUNIT_ASSERT(pValData);
//check that each cell in the expected range is associated with the data validation entry
@@ -1104,8 +1102,8 @@ void checkCellValidity( const ScAddress& rValBaseAddr, const ScRange& rRange, co
{
for(SCROW j = rRange.aStart.Row(); j <= rRange.aEnd.Row(); ++j)
{
- const SfxUInt32Item* pItemTest = static_cast<const SfxUInt32Item*>( pDoc->GetAttr(i, j, nTab, ATTR_VALIDDATA) );
- const ScValidationData* pValDataTest = pDoc->GetValidationEntry( pItemTest->GetValue() );
+ const SfxUInt32Item* pItemTest = static_cast<const SfxUInt32Item*>( rDoc.GetAttr(i, j, nTab, ATTR_VALIDDATA) );
+ const ScValidationData* pValDataTest = rDoc.GetValidationEntry( pItemTest->GetValue() );
//prevent string operations for occurring unnecessarily
if(!(pValDataTest && pValData->GetKey() == pValDataTest->GetKey()))
{
@@ -1132,21 +1130,21 @@ void checkCellValidity( const ScAddress& rValBaseAddr, const ScRange& rRange, co
void ScFiltersTest::testDataValidityODS()
{
ScDocShellRef xDocSh = loadDoc("dataValidity.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
ScAddress aValBaseAddr1( 2,6,0 ); //sheet1
ScAddress aValBaseAddr2( 2,3,1 ); //sheet2
//sheet1's expected Data Validation Entry values
ValDataTestParams aVDTParams1(
- SC_VALID_DECIMAL, SC_COND_GREATER, "3.14", EMPTY_OUSTRING, pDoc,
+ SC_VALID_DECIMAL, SC_COND_GREATER, "3.14", EMPTY_OUSTRING, rDoc,
aValBaseAddr1, "Too small",
"The number you are trying to enter is not greater than 3.14! Are you sure you want to enter it anyway?",
SC_VALERR_WARNING, 1
);
//sheet2's expected Data Validation Entry values
ValDataTestParams aVDTParams2(
- SC_VALID_WHOLE, SC_COND_BETWEEN, "1", "10", pDoc,
+ SC_VALID_WHOLE, SC_COND_BETWEEN, "1", "10", rDoc,
aValBaseAddr2, "Error sheet 2",
"Must be a whole number between 1 and 10.",
SC_VALERR_STOP, 2
@@ -1160,17 +1158,17 @@ void ScFiltersTest::testDataValidityODS()
ScRange aRange2( 2,3,1, 6,7,1 ); //sheet2
//check each sheet's cells for data validity
- checkCellValidity( aValBaseAddr1, aRange1, pDoc );
- checkCellValidity( aValBaseAddr2, aRange2, pDoc );
+ checkCellValidity( aValBaseAddr1, aRange1, rDoc );
+ checkCellValidity( aValBaseAddr2, aRange2, rDoc );
//check each sheet's content
OUString aCSVFileName1;
createCSVPath(OUString("dataValidity1."), aCSVFileName1);
- testFile(aCSVFileName1, pDoc, 0);
+ testFile(aCSVFileName1, rDoc, 0);
OUString aCSVFileName2;
createCSVPath(OUString("dataValidity2."), aCSVFileName2);
- testFile(aCSVFileName2, pDoc, 1);
+ testFile(aCSVFileName2, rDoc, 1);
xDocSh->DoClose();
}
@@ -1186,43 +1184,43 @@ void ScFiltersTest::testDataTableMortgageXLS()
aOptions.SetFormulaSepArrayRow(";");
xDocSh->SetFormulaOptions(aOptions);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// One-variable table
- if (!checkFormula(*pDoc, ScAddress(3,1,0), "PMT(B3/12,B4,-B5)"))
+ if (!checkFormula(rDoc, ScAddress(3,1,0), "PMT(B3/12,B4,-B5)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(3,2,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C3)"))
+ if (!checkFormula(rDoc, ScAddress(3,2,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C3)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(3,3,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C4)"))
+ if (!checkFormula(rDoc, ScAddress(3,3,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C4)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(3,4,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C5)"))
+ if (!checkFormula(rDoc, ScAddress(3,4,0), "MULTIPLE.OPERATIONS(D$2,$B$3,$C5)"))
CPPUNIT_FAIL("Wrong formula!");
// Two-variable table
- if (!checkFormula(*pDoc, ScAddress(2,7,0), "PMT(B9/12,B10,-B11)"))
+ if (!checkFormula(rDoc, ScAddress(2,7,0), "PMT(B9/12,B10,-B11)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(3,8,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,D$8)"))
+ if (!checkFormula(rDoc, ScAddress(3,8,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,D$8)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(3,9,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,D$8)"))
+ if (!checkFormula(rDoc, ScAddress(3,9,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,D$8)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(3,10,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,D$8)"))
+ if (!checkFormula(rDoc, ScAddress(3,10,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,D$8)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(4,8,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,E$8)"))
+ if (!checkFormula(rDoc, ScAddress(4,8,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C9,$B$10,E$8)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(4,9,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,E$8)"))
+ if (!checkFormula(rDoc, ScAddress(4,9,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C10,$B$10,E$8)"))
CPPUNIT_FAIL("Wrong formula!");
- if (!checkFormula(*pDoc, ScAddress(4,10,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,E$8)"))
+ if (!checkFormula(rDoc, ScAddress(4,10,0), "MULTIPLE.OPERATIONS($C$8,$B$9,$C11,$B$10,E$8)"))
CPPUNIT_FAIL("Wrong formula!");
xDocSh->DoClose();
@@ -1239,38 +1237,38 @@ void ScFiltersTest::testDataTableOneVarXLSX()
aOptions.SetFormulaSepArrayRow(";");
xDocSh->SetFormulaOptions(aOptions);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Right now, we have a bug that prevents Calc from re-calculating these
// cells automatically upon file load. We can remove this call if/when we
// fix the aforementioned bug.
- pDoc->CalcAll();
+ rDoc.CalcAll();
// B5:B11 should have multiple operations formula cells. Just check the
// top and bottom cells.
- if (!checkFormula(*pDoc, ScAddress(1,4,0), "MULTIPLE.OPERATIONS(B$4,$A$2,$A5)"))
+ if (!checkFormula(rDoc, ScAddress(1,4,0), "MULTIPLE.OPERATIONS(B$4,$A$2,$A5)"))
CPPUNIT_FAIL("Wrong formula!");
- CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1,4,0)));
+ CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(1,4,0)));
- if (!checkFormula(*pDoc, ScAddress(1,10,0), "MULTIPLE.OPERATIONS(B$4,$A$2,$A11)"))
+ if (!checkFormula(rDoc, ScAddress(1,10,0), "MULTIPLE.OPERATIONS(B$4,$A$2,$A11)"))
CPPUNIT_FAIL("Wrong formula!");
- CPPUNIT_ASSERT_EQUAL(14.0, pDoc->GetValue(ScAddress(1,10,0)));
+ CPPUNIT_ASSERT_EQUAL(14.0, rDoc.GetValue(ScAddress(1,10,0)));
// Likewise, E5:I5 should have multiple operations formula cells. Just
// check the left- and right-most cells.
- if (!checkFormula(*pDoc, ScAddress(4,4,0), "MULTIPLE.OPERATIONS($D5,$B$2,E$4)"))
+ if (!checkFormula(rDoc, ScAddress(4,4,0), "MULTIPLE.OPERATIONS($D5,$B$2,E$4)"))
CPPUNIT_FAIL("Wrong formula!");
- CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(4,4,0)));
+ CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(4,4,0)));
- if (!checkFormula(*pDoc, ScAddress(8,4,0), "MULTIPLE.OPERATIONS($D5,$B$2,I$4)"))
+ if (!checkFormula(rDoc, ScAddress(8,4,0), "MULTIPLE.OPERATIONS($D5,$B$2,I$4)"))
CPPUNIT_FAIL("Wrong formula!");
- CPPUNIT_ASSERT_EQUAL(50.0, pDoc->GetValue(ScAddress(8,4,0)));
+ CPPUNIT_ASSERT_EQUAL(50.0, rDoc.GetValue(ScAddress(8,4,0)));
xDocSh->DoClose();
}
@@ -1286,25 +1284,25 @@ void ScFiltersTest::testDataTableMultiTableXLSX()
aOptions.SetFormulaSepArrayRow(";");
xDocSh->SetFormulaOptions(aOptions);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Right now, we have a bug that prevents Calc from re-calculating these
// cells automatically upon file load. We can remove this call if/when we
// fix the aforementioned bug.
- pDoc->CalcAll();
+ rDoc.CalcAll();
// B4:M15 should have multiple operations formula cells. We'll just check
// the top-left and bottom-right ones.
- if (!checkFormula(*pDoc, ScAddress(1,3,0), "MULTIPLE.OPERATIONS($A$3,$E$1,$A4,$D$1,B$3)"))
+ if (!checkFormula(rDoc, ScAddress(1,3,0), "MULTIPLE.OPERATIONS($A$3,$E$1,$A4,$D$1,B$3)"))
CPPUNIT_FAIL("Wrong formula!");
- CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(1,3,0)));
+ CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(1,3,0)));
- if (!checkFormula(*pDoc, ScAddress(12,14,0), "MULTIPLE.OPERATIONS($A$3,$E$1,$A15,$D$1,M$3)"))
+ if (!checkFormula(rDoc, ScAddress(12,14,0), "MULTIPLE.OPERATIONS($A$3,$E$1,$A15,$D$1,M$3)"))
CPPUNIT_FAIL("Wrong formula!");
- CPPUNIT_ASSERT_EQUAL(144.0, pDoc->GetValue(ScAddress(12,14,0)));
+ CPPUNIT_ASSERT_EQUAL(144.0, rDoc.GetValue(ScAddress(12,14,0)));
xDocSh->DoClose();
}
@@ -1325,14 +1323,13 @@ void ScFiltersTest::testBrokenQuotesCSV()
nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);
CPPUNIT_ASSERT_MESSAGE("Failed to load fdo48621_broken_quotes.csv", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aSheet2CSV("fdo48621_broken_quotes_exported.");
OUString aCSVPath;
createCSVPath( aSheet2CSV, aCSVPath );
// fdo#48621
- testFile( aCSVPath, pDoc, 0, PureString);
+ testFile( aCSVPath, rDoc, 0, PureString);
xDocSh->DoClose();
}
@@ -1353,12 +1350,11 @@ void ScFiltersTest::testCellValueXLSX()
nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);
CPPUNIT_ASSERT_MESSAGE("Failed to load cell-value.xlsx", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVPath;
createCSVPath( aFileNameBase, aCSVPath );
- testFile( aCSVPath, pDoc, 0 );
+ testFile( aCSVPath, rDoc, 0 );
xDocSh->DoClose();
}
@@ -1367,22 +1363,22 @@ void ScFiltersTest::testRowIndex1BasedXLSX()
{
ScDocShellRef xDocSh = loadDoc("row-index-1-based.", XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// A1
- OUString aStr = pDoc->GetString(ScAddress(0,0,0));
+ OUString aStr = rDoc.GetString(ScAddress(0,0,0));
CPPUNIT_ASSERT_EQUAL(OUString("Action Plan.Name"), aStr);
// B1
- aStr = pDoc->GetString(ScAddress(1,0,0));
+ aStr = rDoc.GetString(ScAddress(1,0,0));
CPPUNIT_ASSERT_EQUAL(OUString("Action Plan.Description"), aStr);
// A2
- aStr = pDoc->GetString(ScAddress(0,1,0));
+ aStr = rDoc.GetString(ScAddress(0,1,0));
CPPUNIT_ASSERT_EQUAL(OUString("Jerry"), aStr);
// B2 - multi-line text.
- const EditTextObject* pText = pDoc->GetEditText(ScAddress(1,1,0));
+ const EditTextObject* pText = rDoc.GetEditText(ScAddress(1,1,0));
CPPUNIT_ASSERT(pText);
CPPUNIT_ASSERT(pText->GetParagraphCount() == 3);
aStr = pText->GetText(0);
@@ -1424,10 +1420,8 @@ void ScFiltersTest::testPassword_Impl(const OUString& aFileNameBase)
}
CPPUNIT_ASSERT_MESSAGE("Failed to load password.ods", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+ xDocSh->GetDocument();
xDocSh->DoClose();
-
}
void ScFiltersTest::testPasswordNew()
@@ -1474,27 +1468,27 @@ void ScFiltersTest::testChartImportODS()
ScDocShellRef xDocSh = loadDoc("chart-import-basic.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load chart-import-basic.ods.", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Ensure that the document contains "Empty", "Chart", "Data" and "Title" sheets in this exact order.
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"There should be 4 sheets in this document.", sal_Int16(4),
- pDoc->GetTableCount());
+ rDoc.GetTableCount());
OUString aName;
- pDoc->GetName(0, aName);
+ rDoc.GetName(0, aName);
CPPUNIT_ASSERT_EQUAL(OUString("Empty"), aName);
- pDoc->GetName(1, aName);
+ rDoc.GetName(1, aName);
CPPUNIT_ASSERT_EQUAL(OUString("Chart"), aName);
- pDoc->GetName(2, aName);
+ rDoc.GetName(2, aName);
CPPUNIT_ASSERT_EQUAL(OUString("Data"), aName);
- pDoc->GetName(3, aName);
+ rDoc.GetName(3, aName);
CPPUNIT_ASSERT_EQUAL(OUString("Title"), aName);
// Retrieve the chart object instance from the 2nd page (for the 2nd sheet).
- const SdrOle2Obj* pOleObj = getSingleChartObject(*pDoc, 1);
+ const SdrOle2Obj* pOleObj = getSingleChartObject(rDoc, 1);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd sheet.", pOleObj);
- ScRangeList aRanges = getChartRanges(*pDoc, *pOleObj);
+ ScRangeList aRanges = getChartRanges(rDoc, *pOleObj);
CPPUNIT_ASSERT_MESSAGE("Data series title cell not found.", aRanges.In(ScAddress(1,0,3))); // B1 on Title
CPPUNIT_ASSERT_MESSAGE("Data series label range not found.", aRanges.In(ScRange(0,1,2,0,3,2))); // A2:A4 on Data
@@ -1508,24 +1502,24 @@ void ScFiltersTest::testNumberFormatHTML()
ScDocShellRef xDocSh = loadDoc("numberformat.", HTML);
CPPUNIT_ASSERT_MESSAGE("Failed to load numberformat.html", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Check the header just in case.
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Cell value is not as expected", OUString("Product"),
- pDoc->GetString(0, 0, 0));
+ rDoc.GetString(0, 0, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Cell value is not as expected", OUString("Price"),
- pDoc->GetString(1, 0, 0));
+ rDoc.GetString(1, 0, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Cell value is not as expected", OUString("Note"),
- pDoc->GetString(2, 0, 0));
+ rDoc.GetString(2, 0, 0));
// B2 should be imported as a value cell.
- bool bHasValue = pDoc->HasValueData(1, 1, 0);
+ bool bHasValue = rDoc.HasValueData(1, 1, 0);
CPPUNIT_ASSERT_MESSAGE("Fail to import number as a value cell.", bHasValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- "Incorrect value.", 199.98, pDoc->GetValue(1, 1, 0));
+ "Incorrect value.", 199.98, rDoc.GetValue(1, 1, 0));
xDocSh->DoClose();
}
@@ -1535,24 +1529,24 @@ void ScFiltersTest::testNumberFormatCSV()
ScDocShellRef xDocSh = loadDoc("numberformat.", CSV);
CPPUNIT_ASSERT_MESSAGE("Failed to load numberformat.csv", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Check the header just in case.
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Cell value is not as expected", OUString("Product"),
- pDoc->GetString(0, 0, 0));
+ rDoc.GetString(0, 0, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Cell value is not as expected", OUString("Price"),
- pDoc->GetString(1, 0, 0));
+ rDoc.GetString(1, 0, 0));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Cell value is not as expected", OUString("Note"),
- pDoc->GetString(2, 0, 0));
+ rDoc.GetString(2, 0, 0));
// B2 should be imported as a value cell.
- bool bHasValue = pDoc->HasValueData(1, 1, 0);
+ bool bHasValue = rDoc.HasValueData(1, 1, 0);
CPPUNIT_ASSERT_MESSAGE("Fail to import number as a value cell.", bHasValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- "Incorrect value.", 199.98, pDoc->GetValue(1, 1, 0));
+ "Incorrect value.", 199.98, rDoc.GetValue(1, 1, 0));
xDocSh->DoClose();
}
@@ -1563,11 +1557,11 @@ void ScFiltersTest::testCellAnchoredShapesODS()
CPPUNIT_ASSERT_MESSAGE("Failed to load cell-anchored-shapes.ods", xDocSh.Is());
// There are two cell-anchored objects on the first sheet.
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT_MESSAGE("There should be at least one sheet.", pDoc->GetTableCount() > 0);
+ CPPUNIT_ASSERT_MESSAGE("There should be at least one sheet.", rDoc.GetTableCount() > 0);
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
SdrPage* pPage = pDrawLayer->GetPage(0);
CPPUNIT_ASSERT_MESSAGE("draw page for sheet 1 should exist.", pPage);
sal_uIntPtr nCount = pPage->GetObjCount();
@@ -1611,12 +1605,12 @@ void ScFiltersTest::testPivotTableBasicODS()
ScDocShellRef xDocSh = loadDoc("pivot-table-basic.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load pivot-table-basic.ods", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"There should be exactly two sheets.", sal_Int16(2),
- pDoc->GetTableCount());
+ rDoc.GetTableCount());
- ScDPCollection* pDPs = pDoc->GetDPCollection();
+ ScDPCollection* pDPs = rDoc.GetDPCollection();
CPPUNIT_ASSERT_MESSAGE("Failed to get a live ScDPCollection instance.", pDPs);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"There should be exactly one pivot table instance.", size_t(1),
@@ -1674,9 +1668,9 @@ void ScFiltersTest::testPivotTableNamedRangeSourceODS()
ScDocShellRef xDocSh = loadDoc("pivot-table-named-range-source.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load pivot-table-named-range-source.ods", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- ScDPCollection* pDPs = pDoc->GetDPCollection();
+ ScDPCollection* pDPs = rDoc.GetDPCollection();
CPPUNIT_ASSERT(pDPs->GetCount() == 1);
ScDPObject* pDP = (*pDPs)[0];
@@ -1729,11 +1723,11 @@ void ScFiltersTest::testPivotTableSharedCacheGroupODS()
{
ScDocShellRef xDocSh = loadDoc("pivot-table-shared-cache-with-group.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Make sure that page field's visibility settings are loaded correctly.
- ScDPObject* pDPObj = pDoc->GetDPAtCursor(0, 0, 1); // A1 on 2nd sheet
+ ScDPObject* pDPObj = rDoc.GetDPAtCursor(0, 0, 1); // A1 on 2nd sheet
CPPUNIT_ASSERT_MESSAGE("There should be a pivot table here.", pDPObj);
ScDPSaveData* pSaveData = pDPObj->GetSaveData();
CPPUNIT_ASSERT_MESSAGE("Save data is expected.", pSaveData);
@@ -1743,7 +1737,7 @@ void ScFiltersTest::testPivotTableSharedCacheGroupODS()
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), pMembers->size());
CPPUNIT_ASSERT_MESSAGE("Incorrect member visibility.", checkVisiblePageFieldMember(*pMembers, "APL-01-1"));
- pDPObj = pDoc->GetDPAtCursor(0, 1, 2); // A2 on 3rd sheet
+ pDPObj = rDoc.GetDPAtCursor(0, 1, 2); // A2 on 3rd sheet
CPPUNIT_ASSERT_MESSAGE("There should be a pivot table here.", pDPObj);
pSaveData = pDPObj->GetSaveData();
CPPUNIT_ASSERT_MESSAGE("Save data is expected.", pSaveData);
@@ -1755,7 +1749,7 @@ void ScFiltersTest::testPivotTableSharedCacheGroupODS()
// These two pivot tables share the same data range. We should only have
// one pivot cache.
- ScDPCollection* pDPs = pDoc->GetDPCollection();
+ ScDPCollection* pDPs = rDoc.GetDPCollection();
ScDPCollection::SheetCaches& rSheetCaches = pDPs->GetSheetCaches();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rSheetCaches.size());
@@ -1864,14 +1858,14 @@ void ScFiltersTest::testGetPivotDataXLS()
{
ScDocShellRef xDocSh = loadDoc("pivot-getpivotdata.", XLS);
CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- pDoc->CalcAll();
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll();
// Check GETPIVOTDATA results in E3:E20. Expected results are given in
// F3:F20.
for (SCROW nRow = 2; nRow <= 19; ++nRow)
- CPPUNIT_ASSERT_EQUAL(pDoc->GetValue(ScAddress(4,nRow,1)), pDoc->GetValue(ScAddress(5,nRow,1)));
+ CPPUNIT_ASSERT_EQUAL(rDoc.GetValue(ScAddress(4,nRow,1)), rDoc.GetValue(ScAddress(5,nRow,1)));
xDocSh->DoClose();
}
@@ -1883,37 +1877,37 @@ void ScFiltersTest::testRowHeightODS()
SCTAB nTab = 0;
SCROW nRow = 0;
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// The first 3 rows have manual heights.
- int nHeight = pDoc->GetRowHeight(nRow, nTab, false);
- bool bManual = pDoc->IsManualRowHeight(nRow, nTab);
+ int nHeight = rDoc.GetRowHeight(nRow, nTab, false);
+ bool bManual = rDoc.IsManualRowHeight(nRow, nTab);
CPPUNIT_ASSERT_EQUAL(600, nHeight);
CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", bManual);
- nHeight = pDoc->GetRowHeight(++nRow, nTab, false);
- bManual = pDoc->IsManualRowHeight(nRow, nTab);
+ nHeight = rDoc.GetRowHeight(++nRow, nTab, false);
+ bManual = rDoc.IsManualRowHeight(nRow, nTab);
CPPUNIT_ASSERT_EQUAL(1200, nHeight);
CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", bManual);
- nHeight = pDoc->GetRowHeight(++nRow, nTab, false);
- bManual = pDoc->IsManualRowHeight(nRow, nTab);
+ nHeight = rDoc.GetRowHeight(++nRow, nTab, false);
+ bManual = rDoc.IsManualRowHeight(nRow, nTab);
CPPUNIT_ASSERT_EQUAL(1800, nHeight);
CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", bManual);
// This one should have an automatic row height.
- bManual = pDoc->IsManualRowHeight(++nRow, nTab);
+ bManual = rDoc.IsManualRowHeight(++nRow, nTab);
CPPUNIT_ASSERT_MESSAGE("Row should have an automatic height.", !bManual);
// Followed by a row with manual height.
- nHeight = pDoc->GetRowHeight(++nRow, nTab, false);
- bManual = pDoc->IsManualRowHeight(nRow, nTab);
+ nHeight = rDoc.GetRowHeight(++nRow, nTab, false);
+ bManual = rDoc.IsManualRowHeight(nRow, nTab);
CPPUNIT_ASSERT_EQUAL(2400, nHeight);
CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", bManual);
// And all the rest should have automatic heights.
- bManual = pDoc->IsManualRowHeight(++nRow, nTab);
+ bManual = rDoc.IsManualRowHeight(++nRow, nTab);
CPPUNIT_ASSERT_MESSAGE("Row should have an automatic height.", !bManual);
- bManual = pDoc->IsManualRowHeight(MAXROW, nTab);
+ bManual = rDoc.IsManualRowHeight(MAXROW, nTab);
CPPUNIT_ASSERT_MESSAGE("Row should have an automatic height.", !bManual);
xDocSh->DoClose();
@@ -1923,25 +1917,25 @@ void ScFiltersTest::testRichTextContentODS()
{
ScDocShellRef xDocSh = loadDoc("rich-text-cells.", ODS);
CPPUNIT_ASSERT_MESSAGE("Failed to load rich-text-cells.ods", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aTabName;
- CPPUNIT_ASSERT_MESSAGE("Failed to get the name of the first sheet.", pDoc->GetName(0, aTabName));
+ CPPUNIT_ASSERT_MESSAGE("Failed to get the name of the first sheet.", rDoc.GetName(0, aTabName));
// All tested cells are in the first column.
ScAddress aPos(0, 0, 0);
// Normal simple string with no formatting.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("Normal"), pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+ CPPUNIT_ASSERT_EQUAL(OUString("Normal"), rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
// Normal string with bold applied to the whole cell.
{
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("All bold"), pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
- const ScPatternAttr* pAttr = pDoc->GetPattern(aPos.Col(), aPos.Row(), aPos.Tab());
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+ CPPUNIT_ASSERT_EQUAL(OUString("All bold"), rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ const ScPatternAttr* pAttr = rDoc.GetPattern(aPos.Col(), aPos.Row(), aPos.Tab());
CPPUNIT_ASSERT_MESSAGE("Failed to get cell attribute.", pAttr);
const SvxWeightItem& rWeightItem =
static_cast<const SvxWeightItem&>(pAttr->GetItem(ATTR_FONT_WEIGHT));
@@ -1951,8 +1945,8 @@ void ScFiltersTest::testRichTextContentODS()
// This cell has an unformatted but multi-line content. Multi-line text is
// stored in edit cell even if it has no formatting applied.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- const EditTextObject* pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ const EditTextObject* pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pEditText->GetParagraphCount());
OUString aParaText = pEditText->GetText(0);
@@ -1964,56 +1958,56 @@ void ScFiltersTest::testRichTextContentODS()
// Cell with sheet name field item.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("Sheet name is "));
CPPUNIT_ASSERT_MESSAGE("Sheet name field item not found.", pEditText->HasField(text::textfield::Type::TABLE));
- CPPUNIT_ASSERT_EQUAL(OUString("Sheet name is Test."), ScEditUtil::GetString(*pEditText, pDoc));
+ CPPUNIT_ASSERT_EQUAL(OUString("Sheet name is Test."), ScEditUtil::GetString(*pEditText, &rDoc));
CPPUNIT_ASSERT_EQUAL(OUString("Sheet name is ?."), ScEditUtil::GetString(*pEditText, NULL));
// Cell with URL field item.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("URL: "));
CPPUNIT_ASSERT_MESSAGE("URL field item not found.", pEditText->HasField(text::textfield::Type::URL));
- CPPUNIT_ASSERT_EQUAL(OUString("URL: http://libreoffice.org"), ScEditUtil::GetString(*pEditText, pDoc));
+ CPPUNIT_ASSERT_EQUAL(OUString("URL: http://libreoffice.org"), ScEditUtil::GetString(*pEditText, &rDoc));
CPPUNIT_ASSERT_EQUAL(OUString("URL: http://libreoffice.org"), ScEditUtil::GetString(*pEditText, NULL));
// Cell with Date field item.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("Date: "));
CPPUNIT_ASSERT_MESSAGE("Date field item not found.", pEditText->HasField(text::textfield::Type::DATE));
- CPPUNIT_ASSERT_MESSAGE("Date field not resolved with pDoc.", ScEditUtil::GetString(*pEditText, pDoc).indexOf("/20") > 0);
+ CPPUNIT_ASSERT_MESSAGE("Date field not resolved with rDoc.", ScEditUtil::GetString(*pEditText, &rDoc).indexOf("/20") > 0);
CPPUNIT_ASSERT_MESSAGE("Date field not resolved with NULL.", ScEditUtil::GetString(*pEditText, NULL).indexOf("/20") > 0);
// Cell with DocInfo title field item.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
CPPUNIT_ASSERT_MESSAGE("Unexpected text.", aParaText.startsWith("Title: "));
CPPUNIT_ASSERT_MESSAGE("DocInfo title field item not found.", pEditText->HasField(text::textfield::Type::DOCINFO_TITLE));
- CPPUNIT_ASSERT_EQUAL(OUString("Title: Test Document"), ScEditUtil::GetString(*pEditText, pDoc));
+ CPPUNIT_ASSERT_EQUAL(OUString("Title: Test Document"), ScEditUtil::GetString(*pEditText, &rDoc));
CPPUNIT_ASSERT_EQUAL(OUString("Title: ?"), ScEditUtil::GetString(*pEditText, NULL));
// Cell with sentence with both bold and italic sequences.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
@@ -2044,8 +2038,8 @@ void ScFiltersTest::testRichTextContentODS()
// Cell with multi-line content with formatting applied.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
@@ -2106,31 +2100,31 @@ void ScFiltersTest::testRichTextContentODS()
// field objects gets imported. Later we should add checks for the
// formats.
aPos.IncRow();
- pEditText = pDoc->GetEditText(aPos);
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_MESSAGE("URL field item not found.", pEditText->HasField(text::textfield::Type::URL));
// Sheet name with formats applied.
aPos.IncRow();
- pEditText = pDoc->GetEditText(aPos);
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_MESSAGE("Sheet name field item not found.", pEditText->HasField(text::textfield::Type::TABLE));
// Date with formats applied.
aPos.IncRow();
- pEditText = pDoc->GetEditText(aPos);
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_MESSAGE("Date field item not found.", pEditText->HasField(text::textfield::Type::DATE));
// Document title with formats applied.
aPos.IncRow();
- pEditText = pDoc->GetEditText(aPos);
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_MESSAGE("Date field item not found.", pEditText->HasField(text::textfield::Type::DOCINFO_TITLE));
// URL for a file in the same directory. It should be converted into an absolute URL on import.
aPos.IncRow();
- pEditText = pDoc->GetEditText(aPos);
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
const SvxFieldData* pData = pEditText->GetFieldData(0, 0, text::textfield::Type::URL);
CPPUNIT_ASSERT_MESSAGE("Failed to get the URL data.", pData && pData->GetClassId() == text::textfield::Type::URL);
@@ -2139,19 +2133,19 @@ void ScFiltersTest::testRichTextContentODS()
// Embedded spaces as <text:s text:c='4' />, normal text
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString("one two"), pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+ CPPUNIT_ASSERT_EQUAL(OUString("one two"), rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
// Leading space as <text:s />.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos));
- CPPUNIT_ASSERT_EQUAL(OUString(" =3+4"), pDoc->GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+ CPPUNIT_ASSERT_EQUAL(OUString(" =3+4"), rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab()));
// Embedded spaces with <text:s text:c='4' /> inside a <text:span>, text
// partly bold.
aPos.IncRow();
- CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, pDoc->GetCellType(aPos));
- pEditText = pDoc->GetEditText(aPos);
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_EDIT, rDoc.GetCellType(aPos));
+ pEditText = rDoc.GetEditText(aPos);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve edit text object.", pEditText);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), pEditText->GetParagraphCount());
aParaText = pEditText->GetText(0);
@@ -2184,9 +2178,8 @@ void ScFiltersTest::testDataBarODS()
ScDocShellRef xDocSh = loadDoc("databar.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- testDataBar_Impl(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testDataBar_Impl(rDoc);
xDocSh->DoClose();
}
@@ -2196,9 +2189,8 @@ void ScFiltersTest::testDataBarXLSX()
ScDocShellRef xDocSh = loadDoc("databar.", XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
- testDataBar_Impl(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testDataBar_Impl(rDoc);
xDocSh->DoClose();
}
@@ -2207,11 +2199,10 @@ void ScFiltersTest::testColorScaleODS()
{
ScDocShellRef xDocSh = loadDoc("colorscale.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- testColorScale2Entry_Impl(pDoc);
- testColorScale3Entry_Impl(pDoc);
+ testColorScale2Entry_Impl(rDoc);
+ testColorScale3Entry_Impl(rDoc);
xDocSh->DoClose();
}
@@ -2220,11 +2211,10 @@ void ScFiltersTest::testColorScaleXLSX()
{
ScDocShellRef xDocSh = loadDoc("colorscale.", XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- testColorScale2Entry_Impl(pDoc);
- testColorScale3Entry_Impl(pDoc);
+ testColorScale2Entry_Impl(rDoc);
+ testColorScale3Entry_Impl(rDoc);
xDocSh->DoClose();
}
@@ -2235,12 +2225,12 @@ void ScFiltersTest::testNewCondFormatODS()
CPPUNIT_ASSERT_MESSAGE("Failed to load new_cond_format_test.xlsx", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFile("new_cond_format_test.");
OUString aCSVPath;
createCSVPath( aCSVFile, aCSVPath );
- testCondFile(aCSVPath, pDoc, 0);
+ testCondFile(aCSVPath, &rDoc, 0);
xDocSh->DoClose();
}
@@ -2251,12 +2241,12 @@ void ScFiltersTest::testNewCondFormatXLSX()
CPPUNIT_ASSERT_MESSAGE("Failed to load new_cond_format_test.xlsx", xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
OUString aCSVFile("new_cond_format_test.");
OUString aCSVPath;
createCSVPath( aCSVFile, aCSVPath );
- testCondFile(aCSVPath, pDoc, 0);
+ testCondFile(aCSVPath, &rDoc, 0);
xDocSh->DoClose();
}
@@ -2266,10 +2256,10 @@ void ScFiltersTest::testLiteralInFormulaXLS()
ScDocShellRef xDocSh = loadDoc("shared-string/literal-in-formula.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- pDoc->CalcAll();
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll();
- CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(0,0,0)));
xDocSh->DoClose();
}
@@ -2278,17 +2268,17 @@ void ScFiltersTest::testFormulaDependency()
{
ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc( "dependencyTree.", ODS );
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// check if formula in A1 changes value
- double nVal = pDoc->GetValue(0,0,0);
+ double nVal = rDoc.GetValue(0,0,0);
CPPUNIT_ASSERT_DOUBLES_EQUAL(nVal, 1.0, 1e-10);
- pDoc->SetValue(0,1,0, 0.0);
- nVal = pDoc->GetValue(0,0,0);
+ rDoc.SetValue(0,1,0, 0.0);
+ nVal = rDoc.GetValue(0,0,0);
CPPUNIT_ASSERT_DOUBLES_EQUAL(nVal, 2.0, 1e-10);
// check that the number format is implicity inherited
- // CPPUNIT_ASSERT_EQUAL(pDoc->GetString(0,4,0), pDoc->GetString(0,5,0));
+ // CPPUNIT_ASSERT_EQUAL(rDoc.GetString(0,4,0), rDoc.GetString(0,5,0));
xDocSh->DoClose();
}
@@ -2336,11 +2326,11 @@ void ScFiltersTest::testOptimalHeightReset()
ScDocShellRef xDocSh = loadDoc("multilineoptimal.", ODS, true);
SCTAB nTab = 0;
SCROW nRow = 0;
- ScDocument* pDoc = xDocSh->GetDocument();
- pDoc->EnableAdjustHeight( true );
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.EnableAdjustHeight( true );
// open document in read/write mode ( otherwise optimal height stuff won't
// be triggered ) *and* you can't delete cell contents.
- int nHeight = sc::TwipsToHMM ( pDoc->GetRowHeight(nRow, nTab, false) );
+ int nHeight = sc::TwipsToHMM ( rDoc.GetRowHeight(nRow, nTab, false) );
CPPUNIT_ASSERT_EQUAL(1263, nHeight);
ScDocFunc &rFunc = xDocSh->GetDocFunc();
@@ -2352,14 +2342,14 @@ void ScFiltersTest::testOptimalHeightReset()
rFunc.DeleteContents( aMark, IDF_ALL, false, true );
// get the new height of A1
- nHeight = sc::TwipsToHMM( pDoc->GetRowHeight(nRow, nTab, false) );
+ nHeight = sc::TwipsToHMM( rDoc.GetRowHeight(nRow, nTab, false) );
// set optimal height for empty row 2
std::vector<sc::ColRowSpan> aRowArr(1, sc::ColRowSpan(2,2));
rFunc.SetWidthOrHeight(false, aRowArr, nTab, SC_SIZE_OPTIMAL, 0, true, true);
// retrieve optimal height
- int nOptimalHeight = sc::TwipsToHMM( pDoc->GetRowHeight(aRowArr[0].mnStart, nTab, false) );
+ int nOptimalHeight = sc::TwipsToHMM( rDoc.GetRowHeight(aRowArr[0].mnStart, nTab, false) );
// check if the new height of A1 ( after delete ) is now the optimal height of an empty cell
CPPUNIT_ASSERT_EQUAL(nOptimalHeight, nHeight );
@@ -2369,12 +2359,12 @@ void ScFiltersTest::testOptimalHeightReset()
void ScFiltersTest::testPrintRangeODS()
{
ScDocShellRef xDocSh = loadDoc("print-range.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
- const ScRange* pRange = pDoc->GetRepeatRowRange(0);
+ ScDocument& rDoc = xDocSh->GetDocument();
+ const ScRange* pRange = rDoc.GetRepeatRowRange(0);
CPPUNIT_ASSERT(pRange);
CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,0,1,0), *pRange);
- pRange = pDoc->GetRepeatRowRange(1);
+ pRange = rDoc.GetRepeatRowRange(1);
CPPUNIT_ASSERT(pRange);
CPPUNIT_ASSERT_EQUAL(ScRange(0,2,0,0,4,0), *pRange);
@@ -2384,18 +2374,18 @@ void ScFiltersTest::testPrintRangeODS()
void ScFiltersTest::testOutlineODS()
{
ScDocShellRef xDocSh = loadDoc("outline.", ODS);
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
- const ScOutlineTable* pTable = pDoc->GetOutlineTable(0);
+ const ScOutlineTable* pTable = rDoc.GetOutlineTable(0);
CPPUNIT_ASSERT(pTable);
- const ScOutlineArray* pArr = pTable->GetRowArray();
- size_t nDepth = pArr->GetDepth();
+ const ScOutlineArray& rArr = pTable->GetRowArray();
+ size_t nDepth = rArr.GetDepth();
CPPUNIT_ASSERT_EQUAL(size_t(4), nDepth);
for(size_t i = 0; i < nDepth; ++i)
{
- CPPUNIT_ASSERT_EQUAL(size_t(1), pArr->GetCount(i));
+ CPPUNIT_ASSERT_EQUAL(size_t(1), rArr.GetCount(i));
}
struct OutlineData {
@@ -2419,7 +2409,7 @@ void ScFiltersTest::testOutlineODS()
for(size_t i = 0; i < SAL_N_ELEMENTS(aRow); ++i)
{
- const ScOutlineEntry* pEntry = pArr->GetEntry(aRow[i].nDepth, aRow[i].nIndex);
+ const ScOutlineEntry* pEntry = rArr.GetEntry(aRow[i].nDepth, aRow[i].nIndex);
SCCOLROW nStart = pEntry->GetStart();
CPPUNIT_ASSERT_EQUAL(aRow[i].nStart, nStart);
@@ -2440,16 +2430,15 @@ void ScFiltersTest::testColumnStyleXLSX()
{
ScDocShellRef xDocSh = loadDoc("column-style.", XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- CPPUNIT_ASSERT(pDoc);
+ ScDocument& rDoc = xDocSh->GetDocument();
- const ScPatternAttr* pPattern = pDoc->GetPattern(0,0,0);
+ const ScPatternAttr* pPattern = rDoc.GetPattern(0,0,0);
CPPUNIT_ASSERT(pPattern);
const ScProtectionAttr& rAttr = static_cast<const ScProtectionAttr&>(pPattern->GetItem(ATTR_PROTECTION));
CPPUNIT_ASSERT(rAttr.GetProtection());
- pPattern = pDoc->GetPattern(0,1,0);
+ pPattern = rDoc.GetPattern(0,1,0);
CPPUNIT_ASSERT(pPattern);
const ScProtectionAttr& rAttrNew = static_cast<const ScProtectionAttr&>(pPattern->GetItem(ATTR_PROTECTION));
@@ -2462,14 +2451,14 @@ void ScFiltersTest::testSharedFormulaHorizontalXLS()
{
ScDocShellRef xDocSh = loadDoc("shared-formula/horizontal.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Make sure K2:S2 on the 2nd sheet are all formula cells.
ScAddress aPos(0, 1, 1);
for (SCCOL nCol = 10; nCol <= 18; ++nCol)
{
aPos.SetCol(nCol);
- CPPUNIT_ASSERT_MESSAGE("Formula cell is expected here.", pDoc->GetCellType(aPos) == CELLTYPE_FORMULA);
+ CPPUNIT_ASSERT_MESSAGE("Formula cell is expected here.", rDoc.GetCellType(aPos) == CELLTYPE_FORMULA);
}
// Likewise, B3:J9 all should be formula cells.
@@ -2479,7 +2468,7 @@ void ScFiltersTest::testSharedFormulaHorizontalXLS()
for (SCROW nRow = 2; nRow <= 8; ++nRow)
{
aPos.SetRow(nRow);
- CPPUNIT_ASSERT_MESSAGE("Formula cell is expected here.", pDoc->GetCellType(aPos) == CELLTYPE_FORMULA);
+ CPPUNIT_ASSERT_MESSAGE("Formula cell is expected here.", rDoc.GetCellType(aPos) == CELLTYPE_FORMULA);
}
}
@@ -2488,12 +2477,12 @@ void ScFiltersTest::testSharedFormulaHorizontalXLS()
for (SCCOL nCol = 1; nCol <= 8; ++nCol)
{
aPos.SetCol(nCol);
- CPPUNIT_ASSERT_MESSAGE("Formula cell is expected here.", pDoc->GetCellType(aPos) == CELLTYPE_FORMULA);
+ CPPUNIT_ASSERT_MESSAGE("Formula cell is expected here.", rDoc.GetCellType(aPos) == CELLTYPE_FORMULA);
}
// J2 has a string of "MW".
aPos.SetCol(9);
- CPPUNIT_ASSERT_EQUAL(OUString("MW"), pDoc->GetString(aPos));
+ CPPUNIT_ASSERT_EQUAL(OUString("MW"), rDoc.GetString(aPos));
xDocSh->DoClose();
}
@@ -2502,23 +2491,23 @@ void ScFiltersTest::testSharedFormulaWrappedRefsXLS()
{
ScDocShellRef xDocSh = loadDoc("shared-formula/wrapped-refs.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- pDoc->CalcAll();
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll();
// Check the values of H7:H10.
- CPPUNIT_ASSERT_EQUAL(7.0, pDoc->GetValue(ScAddress(7,6,0)));
- CPPUNIT_ASSERT_EQUAL(8.0, pDoc->GetValue(ScAddress(7,7,0)));
- CPPUNIT_ASSERT_EQUAL(9.0, pDoc->GetValue(ScAddress(7,8,0)));
- CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(7,9,0)));
+ CPPUNIT_ASSERT_EQUAL(7.0, rDoc.GetValue(ScAddress(7,6,0)));
+ CPPUNIT_ASSERT_EQUAL(8.0, rDoc.GetValue(ScAddress(7,7,0)));
+ CPPUNIT_ASSERT_EQUAL(9.0, rDoc.GetValue(ScAddress(7,8,0)));
+ CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(7,9,0)));
// EM7:EM10 should reference H7:H10.
- CPPUNIT_ASSERT_EQUAL(7.0, pDoc->GetValue(ScAddress(142,6,0)));
- CPPUNIT_ASSERT_EQUAL(8.0, pDoc->GetValue(ScAddress(142,7,0)));
- CPPUNIT_ASSERT_EQUAL(9.0, pDoc->GetValue(ScAddress(142,8,0)));
- CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(142,9,0)));
+ CPPUNIT_ASSERT_EQUAL(7.0, rDoc.GetValue(ScAddress(142,6,0)));
+ CPPUNIT_ASSERT_EQUAL(8.0, rDoc.GetValue(ScAddress(142,7,0)));
+ CPPUNIT_ASSERT_EQUAL(9.0, rDoc.GetValue(ScAddress(142,8,0)));
+ CPPUNIT_ASSERT_EQUAL(10.0, rDoc.GetValue(ScAddress(142,9,0)));
// Make sure EM7:EM10 are grouped.
- const ScFormulaCell *pFC = pDoc->GetFormulaCell(ScAddress(142,6,0));
+ const ScFormulaCell *pFC = rDoc.GetFormulaCell(ScAddress(142,6,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(6), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(4), pFC->GetSharedLength());
@@ -2530,11 +2519,11 @@ void ScFiltersTest::testSharedFormulaBIFF5()
{
ScDocShellRef xDocSh = loadDoc("shared-formula/biff5.", XLS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
- pDoc->CalcAll();
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll();
// E6:E376 should be all formulas, and they should belong to the same group.
- const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(4,5,0));
+ const ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(4,5,0));
CPPUNIT_ASSERT(pFC);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(5), pFC->GetSharedTopRow());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(371), pFC->GetSharedLength());
@@ -2546,13 +2535,13 @@ void ScFiltersTest::testExternalRefCacheXLSX()
{
ScDocShellRef xDocSh = loadDoc("external-refs.", XLSX);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// These string values are cached external cell values.
- CPPUNIT_ASSERT_EQUAL(OUString("Name"), pDoc->GetString(ScAddress(0,0,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Andy"), pDoc->GetString(ScAddress(0,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Bruce"), pDoc->GetString(ScAddress(0,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("Charlie"), pDoc->GetString(ScAddress(0,3,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Name"), rDoc.GetString(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Andy"), rDoc.GetString(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Bruce"), rDoc.GetString(ScAddress(0,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Charlie"), rDoc.GetString(ScAddress(0,3,0)));
xDocSh->DoClose();
}
@@ -2562,12 +2551,12 @@ void ScFiltersTest::testExternalRefCacheODS()
ScDocShellRef xDocSh = loadDoc("external-ref-cache.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Cells B2:B4 have VLOOKUP with external references which should all show "text".
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(1,1,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(1,2,0)));
- CPPUNIT_ASSERT_EQUAL(OUString("text"), pDoc->GetString(ScAddress(1,3,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("text"), rDoc.GetString(ScAddress(1,1,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("text"), rDoc.GetString(ScAddress(1,2,0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("text"), rDoc.GetString(ScAddress(1,3,0)));
xDocSh->DoClose();
}
@@ -2577,10 +2566,10 @@ void ScFiltersTest::testHybridSharedStringODS()
ScDocShellRef xDocSh = loadDoc("hybrid-shared-string.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// A2 contains formula with MATCH function. The result must be 2, not #N/A!
- CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(0,1,0)));
xDocSh->DoClose();
}
@@ -2589,16 +2578,16 @@ void ScFiltersTest::testCopyMergedNumberFormats()
{
ScDocShellRef xDocSh = loadDoc("copy-merged-number-formats.", ODS);
CPPUNIT_ASSERT(xDocSh.Is());
- ScDocument* pDoc = xDocSh->GetDocument();
+ ScDocument& rDoc = xDocSh->GetDocument();
// Cells B1, C1 and D1 are formatted as dates.
- OUString aStrB1 = pDoc->GetString(ScAddress(1,0,0));
- OUString aStrC1 = pDoc->GetString(ScAddress(2,0,0));
- OUString aStrD1 = pDoc->GetString(ScAddress(3,0,0));
+ OUString aStrB1 = rDoc.GetString(ScAddress(1,0,0));
+ OUString aStrC1 = rDoc.GetString(ScAddress(2,0,0));
+ OUString aStrD1 = rDoc.GetString(ScAddress(3,0,0));
ScDocument aCopyDoc;
aCopyDoc.InsertTab(0, "CopyHere");
- pDoc->CopyStaticToDocument(ScRange(1,0,0,3,0,0), 0, &aCopyDoc);
+ rDoc.CopyStaticToDocument(ScRange(1,0,0,3,0,0), 0, &aCopyDoc);
// Make sure the date formats are copied to the new document.
CPPUNIT_ASSERT_EQUAL(aStrB1, aCopyDoc.GetString(ScAddress(1,0,0)));
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 3396446d5f03..d6ed393497b7 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -162,7 +162,7 @@ void Test::setUp()
SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
m_pImpl->m_xDocShell->DoInitUnitTest();
- m_pDoc = m_pImpl->m_xDocShell->GetDocument();
+ m_pDoc = &m_pImpl->m_xDocShell->GetDocument();
}
void Test::tearDown()
@@ -4579,7 +4579,7 @@ void Test::testCopyPasteFormulasExternalDoc()
OUString aDocName("file:///source.fake");
SfxMedium* pMedium = new SfxMedium(aDocName, STREAM_STD_READWRITE);
getDocShell().DoInitNew(pMedium);
- m_pDoc = getDocShell().GetDocument();
+ m_pDoc = &getDocShell().GetDocument();
ScDocShellRef xExtDocSh = new ScDocShell;
OUString aExtDocName("file:///extdata.fake");
@@ -4590,9 +4590,9 @@ void Test::testCopyPasteFormulasExternalDoc()
CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.",
findLoadedDocShellByName(aExtDocName) != NULL);
- ScDocument* pExtDoc = xExtDocSh->GetDocument();
- pExtDoc->InsertTab(0, aExtSh1Name);
- pExtDoc->InsertTab(1, aExtSh2Name);
+ ScDocument& rExtDoc = xExtDocSh->GetDocument();
+ rExtDoc.InsertTab(0, aExtSh1Name);
+ rExtDoc.InsertTab(1, aExtSh2Name);
m_pDoc->InsertTab(0, "Sheet1");
m_pDoc->InsertTab(1, "Sheet2");
@@ -4615,23 +4615,23 @@ void Test::testCopyPasteFormulasExternalDoc()
aRange = ScRange(1,1,1,1,6,1);
ScMarkData aMarkData2;
aMarkData2.SetMarkArea(aRange);
- pExtDoc->CopyFromClip(aRange, aMarkData2, nFlags, NULL, pClipDoc);
+ rExtDoc.CopyFromClip(aRange, aMarkData2, nFlags, NULL, pClipDoc);
OUString aFormula;
- pExtDoc->GetFormula(1,1,1, aFormula);
+ rExtDoc.GetFormula(1,1,1, aFormula);
//adjust absolute refs pointing to the copy area
CPPUNIT_ASSERT_EQUAL(aFormula, OUString("=COLUMN($B$2)"));
- pExtDoc->GetFormula(1,2,1, aFormula);
+ rExtDoc.GetFormula(1,2,1, aFormula);
//adjust absolute refs and keep relative refs
CPPUNIT_ASSERT_EQUAL(aFormula, OUString("=$B$2+C3"));
- pExtDoc->GetFormula(1,3,1, aFormula);
+ rExtDoc.GetFormula(1,3,1, aFormula);
// make absolute sheet refs external refs
CPPUNIT_ASSERT_EQUAL(aFormula, OUString("='file:///source.fake'#$Sheet2.B2"));
- pExtDoc->GetFormula(1,4,1, aFormula);
+ rExtDoc.GetFormula(1,4,1, aFormula);
CPPUNIT_ASSERT_EQUAL(aFormula, OUString("='file:///source.fake'#$Sheet2.$A$1"));
- pExtDoc->GetFormula(1,5,1, aFormula);
+ rExtDoc.GetFormula(1,5,1, aFormula);
CPPUNIT_ASSERT_EQUAL(aFormula, OUString("='file:///source.fake'#$Sheet2.B$1"));
- pExtDoc->GetFormula(1,6,1, aFormula);
+ rExtDoc.GetFormula(1,6,1, aFormula);
CPPUNIT_ASSERT_EQUAL(aFormula, OUString("=$ExtSheet2.$B$2"));
}
@@ -5466,21 +5466,21 @@ void Test::testNoteDeleteRow()
void Test::testNoteDeleteCol()
{
- ScDocument* pDoc = getDocShell().GetDocument();
- pDoc->InsertTab(0, "Sheet1");
+ ScDocument& rDoc = getDocShell().GetDocument();
+ rDoc.InsertTab(0, "Sheet1");
ScAddress rAddr(1, 1, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr);
pNote->SetText(rAddr, "Hello");
pNote->SetAuthor("Jim Bob");
- CPPUNIT_ASSERT_MESSAGE("there should be a note", pDoc->HasNote(1, 1, 0));
+ CPPUNIT_ASSERT_MESSAGE("there should be a note", rDoc.HasNote(1, 1, 0));
- pDoc->DeleteCol(0, 0, MAXROW, 0, 1, 1);
+ rDoc.DeleteCol(0, 0, MAXROW, 0, 1, 1);
- CPPUNIT_ASSERT_MESSAGE("there should be no more note", !pDoc->HasNote(1, 1, 0));
+ CPPUNIT_ASSERT_MESSAGE("there should be no more note", !rDoc.HasNote(1, 1, 0));
- pDoc->DeleteTab(0);
+ rDoc.DeleteTab(0);
}
void Test::testNoteLifeCycle()
@@ -5583,8 +5583,8 @@ void Test::testNoteCopyPaste()
void Test::testAreasWithNotes()
{
- ScDocument* pDoc = getDocShell().GetDocument();
- pDoc->InsertTab(0, "Sheet1");
+ ScDocument& rDoc = getDocShell().GetDocument();
+ rDoc.InsertTab(0, "Sheet1");
ScAddress rAddr(1, 5, 0);
ScPostIt* pNote = m_pDoc->GetOrCreateNote(rAddr);
@@ -5600,40 +5600,40 @@ void Test::testAreasWithNotes()
// only cell notes (empty content)
- dataFound = pDoc->GetDataStart(0,col,row);
+ dataFound = rDoc.GetDataStart(0,col,row);
CPPUNIT_ASSERT_MESSAGE("No DataStart found", dataFound);
CPPUNIT_ASSERT_MESSAGE("DataStart wrong col for notes", col == 1);
CPPUNIT_ASSERT_MESSAGE("DataStart wrong row for notes", row == 2);
- dataFound = pDoc->GetCellArea(0,col,row);
+ dataFound = rDoc.GetCellArea(0,col,row);
CPPUNIT_ASSERT_MESSAGE("No CellArea found", dataFound);
CPPUNIT_ASSERT_MESSAGE("CellArea wrong col for notes", col == 2);
CPPUNIT_ASSERT_MESSAGE("CellArea wrong row for notes", row == 5);
bool bNotes = true;
- dataFound = pDoc->GetPrintArea(0,col,row, bNotes);
+ dataFound = rDoc.GetPrintArea(0,col,row, bNotes);
CPPUNIT_ASSERT_MESSAGE("No PrintArea found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintArea wrong col for notes", col == 2);
CPPUNIT_ASSERT_MESSAGE("PrintArea wrong row for notes", row == 5);
bNotes = false;
- dataFound = pDoc->GetPrintArea(0,col,row, bNotes);
+ dataFound = rDoc.GetPrintArea(0,col,row, bNotes);
CPPUNIT_ASSERT_MESSAGE("No PrintArea should be found", !dataFound);
bNotes = true;
- dataFound = pDoc->GetPrintAreaVer(0,0,1,row, bNotes); // cols 0 & 1
+ dataFound = rDoc.GetPrintAreaVer(0,0,1,row, bNotes); // cols 0 & 1
CPPUNIT_ASSERT_MESSAGE("No PrintAreaVer found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintAreaVer wrong row for notes", row == 5);
- dataFound = pDoc->GetPrintAreaVer(0,2,3,row, bNotes); // cols 2 & 3
+ dataFound = rDoc.GetPrintAreaVer(0,2,3,row, bNotes); // cols 2 & 3
CPPUNIT_ASSERT_MESSAGE("No PrintAreaVer found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintAreaVer wrong row for notes", row == 2);
bNotes = false;
- dataFound = pDoc->GetPrintAreaVer(0,0,1,row, bNotes); // col 0 & 1
+ dataFound = rDoc.GetPrintAreaVer(0,0,1,row, bNotes); // col 0 & 1
CPPUNIT_ASSERT_MESSAGE("No PrintAreaVer should be found", !dataFound);
// now add cells with value, check that notes are taken into accompt in good cases
@@ -5641,46 +5641,46 @@ void Test::testAreasWithNotes()
m_pDoc->SetString(0, 3, 0, "Some Text");
m_pDoc->SetString(3, 3, 0, "Some Text");
- dataFound = pDoc->GetDataStart(0,col,row);
+ dataFound = rDoc.GetDataStart(0,col,row);
CPPUNIT_ASSERT_MESSAGE("No DataStart found", dataFound);
CPPUNIT_ASSERT_MESSAGE("DataStart wrong col", col == 0);
CPPUNIT_ASSERT_MESSAGE("DataStart wrong row", row == 2);
- dataFound = pDoc->GetCellArea(0,col,row);
+ dataFound = rDoc.GetCellArea(0,col,row);
CPPUNIT_ASSERT_MESSAGE("No CellArea found", dataFound);
CPPUNIT_ASSERT_MESSAGE("CellArea wrong col", col == 3);
CPPUNIT_ASSERT_MESSAGE("CellArea wrong row", row == 5);
bNotes = true;
- dataFound = pDoc->GetPrintArea(0,col,row, bNotes);
+ dataFound = rDoc.GetPrintArea(0,col,row, bNotes);
CPPUNIT_ASSERT_MESSAGE("No PrintArea found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintArea wrong col", col == 3);
CPPUNIT_ASSERT_MESSAGE("PrintArea wrong row", row == 5);
bNotes = false;
- dataFound = pDoc->GetPrintArea(0,col,row, bNotes);
+ dataFound = rDoc.GetPrintArea(0,col,row, bNotes);
CPPUNIT_ASSERT_MESSAGE("No PrintArea found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintArea wrong col", col == 3);
CPPUNIT_ASSERT_MESSAGE("PrintArea wrong row", row == 3);
bNotes = true;
- dataFound = pDoc->GetPrintAreaVer(0,0,1,row, bNotes); // cols 0 & 1
+ dataFound = rDoc.GetPrintAreaVer(0,0,1,row, bNotes); // cols 0 & 1
CPPUNIT_ASSERT_MESSAGE("No PrintAreaVer found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintAreaVer wrong row", row == 5);
- dataFound = pDoc->GetPrintAreaVer(0,2,3,row, bNotes); // cols 2 & 3
+ dataFound = rDoc.GetPrintAreaVer(0,2,3,row, bNotes); // cols 2 & 3
CPPUNIT_ASSERT_MESSAGE("No PrintAreaVer found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintAreaVer wrong row", row == 3);
bNotes = false;
- dataFound = pDoc->GetPrintAreaVer(0,0,1,row, bNotes); // cols 0 & 1
+ dataFound = rDoc.GetPrintAreaVer(0,0,1,row, bNotes); // cols 0 & 1
CPPUNIT_ASSERT_MESSAGE("No PrintAreaVer found", dataFound);
CPPUNIT_ASSERT_MESSAGE("PrintAreaVer wrong row", row == 3);
- pDoc->DeleteTab(0);
+ rDoc.DeleteTab(0);
}
void Test::testAnchoredRotatedShape()
@@ -6460,10 +6460,10 @@ void Test::pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocu
ScUndoPaste* Test::createUndoPaste(ScDocShell& rDocSh, const ScRange& rRange, ScDocument* pUndoDoc)
{
- ScDocument* pDoc = rDocSh.GetDocument();
+ ScDocument& rDoc = rDocSh.GetDocument();
ScMarkData aMarkData;
aMarkData.SetMarkArea(rRange);
- ScRefUndoData* pRefUndoData = new ScRefUndoData(pDoc);
+ ScRefUndoData* pRefUndoData = new ScRefUndoData(&rDoc);
return new ScUndoPaste(
&rDocSh, rRange, aMarkData, pUndoDoc, NULL, IDF_ALL, pRefUndoData, false);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 95836004bda9..6d521d6da690 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -3656,10 +3656,10 @@ void Test::testExternalRef()
findLoadedDocShellByName(aExtDocName) != NULL);
// Populate the external source document.
- ScDocument* pExtDoc = xExtDocSh->GetDocument();
- pExtDoc->InsertTab(0, aExtSh1Name);
- pExtDoc->InsertTab(1, aExtSh2Name);
- pExtDoc->InsertTab(2, aExtSh3Name);
+ ScDocument& rExtDoc = xExtDocSh->GetDocument();
+ rExtDoc.InsertTab(0, aExtSh1Name);
+ rExtDoc.InsertTab(1, aExtSh2Name);
+ rExtDoc.InsertTab(2, aExtSh3Name);
OUString name("Name");
OUString value("Value");
@@ -3673,38 +3673,38 @@ void Test::testExternalRef()
OUString henry("Henry");
// Sheet 1
- pExtDoc->SetString(0, 0, 0, name);
- pExtDoc->SetString(0, 1, 0, andy);
- pExtDoc->SetString(0, 2, 0, bruce);
- pExtDoc->SetString(0, 3, 0, charlie);
- pExtDoc->SetString(0, 4, 0, david);
- pExtDoc->SetString(1, 0, 0, value);
+ rExtDoc.SetString(0, 0, 0, name);
+ rExtDoc.SetString(0, 1, 0, andy);
+ rExtDoc.SetString(0, 2, 0, bruce);
+ rExtDoc.SetString(0, 3, 0, charlie);
+ rExtDoc.SetString(0, 4, 0, david);
+ rExtDoc.SetString(1, 0, 0, value);
double val = 10;
- pExtDoc->SetValue(1, 1, 0, val);
+ rExtDoc.SetValue(1, 1, 0, val);
val = 11;
- pExtDoc->SetValue(1, 2, 0, val);
+ rExtDoc.SetValue(1, 2, 0, val);
val = 12;
- pExtDoc->SetValue(1, 3, 0, val);
+ rExtDoc.SetValue(1, 3, 0, val);
val = 13;
- pExtDoc->SetValue(1, 4, 0, val);
+ rExtDoc.SetValue(1, 4, 0, val);
// Sheet 2 remains empty.
// Sheet 3
- pExtDoc->SetString(0, 0, 2, name);
- pExtDoc->SetString(0, 1, 2, edward);
- pExtDoc->SetString(0, 2, 2, frank);
- pExtDoc->SetString(0, 3, 2, george);
- pExtDoc->SetString(0, 4, 2, henry);
- pExtDoc->SetString(1, 0, 2, value);
+ rExtDoc.SetString(0, 0, 2, name);
+ rExtDoc.SetString(0, 1, 2, edward);
+ rExtDoc.SetString(0, 2, 2, frank);
+ rExtDoc.SetString(0, 3, 2, george);
+ rExtDoc.SetString(0, 4, 2, henry);
+ rExtDoc.SetString(1, 0, 2, value);
val = 99;
- pExtDoc->SetValue(1, 1, 2, val);
+ rExtDoc.SetValue(1, 1, 2, val);
val = 98;
- pExtDoc->SetValue(1, 2, 2, val);
+ rExtDoc.SetValue(1, 2, 2, val);
val = 97;
- pExtDoc->SetValue(1, 3, 2, val);
+ rExtDoc.SetValue(1, 3, 2, val);
val = 96;
- pExtDoc->SetValue(1, 4, 2, val);
+ rExtDoc.SetValue(1, 4, 2, val);
// Test external refernces on the main document while the external
// document is still in memory.
@@ -3815,14 +3815,14 @@ void Test::testExternalRef()
m_pDoc->DeleteTab(0);
}
-void testExtRefFuncT(ScDocument* pDoc, ScDocument* pExtDoc)
+void testExtRefFuncT(ScDocument* pDoc, ScDocument& rExtDoc)
{
Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0));
- Test::clearRange(pExtDoc, ScRange(0, 0, 0, 1, 9, 0));
+ Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0));
- pExtDoc->SetString(0, 0, 0, OUString("'1.2"));
- pExtDoc->SetString(0, 1, 0, OUString("Foo"));
- pExtDoc->SetValue(0, 2, 0, 12.3);
+ rExtDoc.SetString(0, 0, 0, OUString("'1.2"));
+ rExtDoc.SetString(0, 1, 0, OUString("Foo"));
+ rExtDoc.SetValue(0, 2, 0, 12.3);
pDoc->SetString(0, 0, 0, OUString("=T('file:///extdata.fake'#Data.A1)"));
pDoc->SetString(0, 1, 0, OUString("=T('file:///extdata.fake'#Data.A2)"));
pDoc->SetString(0, 2, 0, OUString("=T('file:///extdata.fake'#Data.A3)"));
@@ -3836,36 +3836,36 @@ void testExtRefFuncT(ScDocument* pDoc, ScDocument* pExtDoc)
CPPUNIT_ASSERT_MESSAGE("Unexpected result with T.", aRes.isEmpty());
}
-void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument* pExtDoc)
+void testExtRefFuncOFFSET(ScDocument* pDoc, ScDocument& rExtDoc)
{
Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0));
- Test::clearRange(pExtDoc, ScRange(0, 0, 0, 1, 9, 0));
+ Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0));
sc::AutoCalcSwitch aACSwitch(*pDoc, true);
// External document has sheet named 'Data', and the internal doc has sheet named 'Test'.
- pExtDoc->SetValue(ScAddress(0,1,0), 1.2); // Set 1.2 to A2.
+ rExtDoc.SetValue(ScAddress(0,1,0), 1.2); // Set 1.2 to A2.
pDoc->SetString(ScAddress(0,0,0), "=OFFSET('file:///extdata.fake'#Data.$A$1;1;0;1;1)");
CPPUNIT_ASSERT_EQUAL(1.2, pDoc->GetValue(ScAddress(0,0,0)));
}
-void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument* pExtDoc)
+void testExtRefFuncVLOOKUP(ScDocument* pDoc, ScDocument& rExtDoc)
{
Test::clearRange(pDoc, ScRange(0, 0, 0, 1, 9, 0));
- Test::clearRange(pExtDoc, ScRange(0, 0, 0, 1, 9, 0));
+ Test::clearRange(&rExtDoc, ScRange(0, 0, 0, 1, 9, 0));
// Populate the external document.
- pExtDoc->SetString(ScAddress(0,0,0), "A1");
- pExtDoc->SetString(ScAddress(0,1,0), "A2");
- pExtDoc->SetString(ScAddress(0,2,0), "A3");
- pExtDoc->SetString(ScAddress(0,3,0), "A4");
- pExtDoc->SetString(ScAddress(0,4,0), "A5");
-
- pExtDoc->SetString(ScAddress(1,0,0), "B1");
- pExtDoc->SetString(ScAddress(1,1,0), "B2");
- pExtDoc->SetString(ScAddress(1,2,0), "B3");
- pExtDoc->SetString(ScAddress(1,3,0), "B4");
- pExtDoc->SetString(ScAddress(1,4,0), "B5");
+ rExtDoc.SetString(ScAddress(0,0,0), "A1");
+ rExtDoc.SetString(ScAddress(0,1,0), "A2");
+ rExtDoc.SetString(ScAddress(0,2,0), "A3");
+ rExtDoc.SetString(ScAddress(0,3,0), "A4");
+ rExtDoc.SetString(ScAddress(0,4,0), "A5");
+
+ rExtDoc.SetString(ScAddress(1,0,0), "B1");
+ rExtDoc.SetString(ScAddress(1,1,0), "B2");
+ rExtDoc.SetString(ScAddress(1,2,0), "B3");
+ rExtDoc.SetString(ScAddress(1,3,0), "B4");
+ rExtDoc.SetString(ScAddress(1,4,0), "B5");
// Put formula in the source document.
@@ -3899,20 +3899,20 @@ void Test::testExternalRefFunctions()
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
// Populate the external source document.
- ScDocument* pExtDoc = xExtDocSh->GetDocument();
- pExtDoc->InsertTab(0, OUString("Data"));
+ ScDocument& rExtDoc = xExtDocSh->GetDocument();
+ rExtDoc.InsertTab(0, OUString("Data"));
double val = 1;
- pExtDoc->SetValue(0, 0, 0, val);
+ rExtDoc.SetValue(0, 0, 0, val);
// leave cell B1 empty.
val = 2;
- pExtDoc->SetValue(0, 1, 0, val);
- pExtDoc->SetValue(1, 1, 0, val);
+ rExtDoc.SetValue(0, 1, 0, val);
+ rExtDoc.SetValue(1, 1, 0, val);
val = 3;
- pExtDoc->SetValue(0, 2, 0, val);
- pExtDoc->SetValue(1, 2, 0, val);
+ rExtDoc.SetValue(0, 2, 0, val);
+ rExtDoc.SetValue(1, 2, 0, val);
val = 4;
- pExtDoc->SetValue(0, 3, 0, val);
- pExtDoc->SetValue(1, 3, 0, val);
+ rExtDoc.SetValue(0, 3, 0, val);
+ rExtDoc.SetValue(1, 3, 0, val);
m_pDoc->InsertTab(0, OUString("Test"));
@@ -3935,9 +3935,9 @@ void Test::testExternalRefFunctions()
}
pRefMgr->clearCache(nFileId);
- testExtRefFuncT(m_pDoc, pExtDoc);
- testExtRefFuncOFFSET(m_pDoc, pExtDoc);
- testExtRefFuncVLOOKUP(m_pDoc, pExtDoc);
+ testExtRefFuncT(m_pDoc, rExtDoc);
+ testExtRefFuncOFFSET(m_pDoc, rExtDoc);
+ testExtRefFuncVLOOKUP(m_pDoc, rExtDoc);
// Unload the external document shell.
xExtDocSh->DoClose();
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index 76ba05eebdcd..06c09b05c929 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -465,13 +465,13 @@ void Test::testSharedFormulasRefUpdateExternal()
SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE);
xExtDocSh->DoInitNew(pMed);
- ScDocument* pExtDoc = xExtDocSh->GetDocument();
+ ScDocument& rExtDoc = xExtDocSh->GetDocument();
// Populate A1:A3.
- pExtDoc->InsertTab(0, "Data");
- pExtDoc->SetString(ScAddress(0,0,0), "A");
- pExtDoc->SetString(ScAddress(0,1,0), "B");
- pExtDoc->SetString(ScAddress(0,2,0), "C");
+ rExtDoc.InsertTab(0, "Data");
+ rExtDoc.SetString(ScAddress(0,0,0), "A");
+ rExtDoc.SetString(ScAddress(0,1,0), "B");
+ rExtDoc.SetString(ScAddress(0,2,0), "C");
// Insert formula cells in A7:A10 of the host document, referencing A1:A3
// of the external document.
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
index 3b248ff9be3b..1569034291ac 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -138,10 +138,10 @@ void ScDPFilteredCache::fillTable(
// Process the non-empty data rows.
for (SCROW nRow = 0; nRow < nDataSize; ++nRow)
{
- if (!getCache()->ValidQuery(nRow, rQuery))
+ if (!getCache().ValidQuery(nRow, rQuery))
continue;
- if (bIgnoreEmptyRows && getCache()->IsRowEmpty(nRow))
+ if (bIgnoreEmptyRows && getCache().IsRowEmpty(nRow))
continue;
maShowByFilter.insert_back(nRow, nRow+1, true);
@@ -161,7 +161,7 @@ void ScDPFilteredCache::fillTable(
for (SCCOL nCol = 0; nCol < nColCount; ++nCol)
{
maFieldEntries.push_back( vector<SCROW>() );
- SCROW nMemCount = getCache()->GetDimMemberCount( nCol );
+ SCROW nMemCount = getCache().GetDimMemberCount( nCol );
if (!nMemCount)
continue;
@@ -186,7 +186,7 @@ void ScDPFilteredCache::fillTable(
continue;
}
- SCROW nIndex = getCache()->GetItemDataId(nCol, nRow, bRepeatIfEmpty);
+ SCROW nIndex = getCache().GetItemDataId(nCol, nRow, bRepeatIfEmpty);
SCROW nOrder = getOrder(nCol, nIndex);
aAdded[nOrder] = nIndex;
}
@@ -220,7 +220,7 @@ void ScDPFilteredCache::fillTable()
for (SCCOL nCol = 0; nCol < nColCount; ++nCol)
{
maFieldEntries.push_back( vector<SCROW>() );
- SCROW nMemCount = getCache()->GetDimMemberCount( nCol );
+ SCROW nMemCount = getCache().GetDimMemberCount( nCol );
if (!nMemCount)
continue;
@@ -228,7 +228,7 @@ void ScDPFilteredCache::fillTable()
for (SCROW nRow = 0; nRow < nRowCount; ++nRow)
{
- SCROW nIndex = getCache()->GetItemDataId(nCol, nRow, false);
+ SCROW nIndex = getCache().GetItemDataId(nCol, nRow, false);
SCROW nOrder = getOrder(nCol, nIndex);
aAdded[nOrder] = nIndex;
}
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 70085f64f078..2b38717f54f5 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -394,7 +394,7 @@ const std::vector<SCROW>& ScDPGroupDimension::GetColumnEntries(
if (!maMemberEntries.empty())
return maMemberEntries;
- rCacheTable.getCache()->GetGroupDimMemberIds(nGroupDim, maMemberEntries);
+ rCacheTable.getCache().GetGroupDimMemberIds(nGroupDim, maMemberEntries);
return maMemberEntries;
}
@@ -558,7 +558,7 @@ const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( long nColumn
{
// dimension number is unchanged for numerical groups
return pNumGroups[nColumn].GetNumEntries(
- static_cast<SCCOL>(nColumn), GetCacheTable().getCache());
+ static_cast<SCCOL>(nColumn), &GetCacheTable().getCache());
}
return pSourceData->GetColumnEntries( nColumn );
@@ -675,7 +675,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
// Go through all the filtered field names and process them appropriately.
- const ScDPCache* pCache = GetCacheTable().getCache();
+ const ScDPCache& rCache = GetCacheTable().getCache();
vector<ScDPFilteredCache::Criterion>::const_iterator itrEnd = rCriteria.end();
GroupFieldMapType::const_iterator itrGrpEnd = aGroupFieldIds.end();
for (vector<ScDPFilteredCache::Criterion>::const_iterator itr = rCriteria.begin(); itr != itrEnd; ++itr)
@@ -688,7 +688,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
if (IsNumGroupDimension(itr->mnFieldIndex))
{
// internal number group field
- const ScDPNumGroupInfo* pNumInfo = pCache->GetNumGroupInfo(itr->mnFieldIndex);
+ const ScDPNumGroupInfo* pNumInfo = rCache.GetNumGroupInfo(itr->mnFieldIndex);
if (!pNumInfo)
// Number group dimension without num info? Something is wrong...
continue;
@@ -726,7 +726,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
const ScDPGroupDimension* pGrpDim = itrGrp->second;
long nSrcDim = pGrpDim->GetSourceDim();
long nGrpDim = pGrpDim->GetGroupDim();
- const ScDPNumGroupInfo* pNumInfo = pCache->GetNumGroupInfo(nGrpDim);
+ const ScDPNumGroupInfo* pNumInfo = rCache.GetNumGroupInfo(nGrpDim);
if (pGrpDim->IsDateDimension() && pNumInfo)
{
@@ -833,7 +833,7 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
{
long nGroupedColumns = aGroups.size();
- const ScDPCache* pCache = GetCacheTable().getCache();
+ const ScDPCache& rCache = GetCacheTable().getCache();
vector<long>::const_iterator it = rDims.begin(), itEnd = rDims.end();
for (size_t i = 0; it != itEnd; ++it, ++i)
{
@@ -853,10 +853,10 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
if (pGroupItem)
{
rItems[i] =
- pCache->GetIdByItemData(nColumn, pGroupItem->GetName());
+ rCache.GetIdByItemData(nColumn, pGroupItem->GetName());
}
else
- rItems[i] = pCache->GetIdByItemData(nColumn, rItem);
+ rItems[i] = rCache.GetIdByItemData(nColumn, rItem);
}
}
else if ( IsNumGroupDimension( nColumn ) )
@@ -864,7 +864,7 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
bDateDim = pNumGroups[nColumn].IsDateDimension();
if (!bDateDim) // date is handled below
{
- const ScDPItemData* pData = pCache->GetItemDataById(nSourceDim, rItems[i]);
+ const ScDPItemData* pData = rCache.GetItemDataById(nSourceDim, rItems[i]);
if (pData->GetType() == ScDPItemData::Value)
{
ScDPNumGroupInfo aNumInfo;
@@ -872,19 +872,19 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
double fGroupValue = ScDPUtil::getNumGroupStartValue(pData->GetValue(), aNumInfo);
ScDPItemData aItemData;
aItemData.SetRangeStart(fGroupValue);
- rItems[i] = pCache->GetIdByItemData(nSourceDim, aItemData);
+ rItems[i] = rCache.GetIdByItemData(nSourceDim, aItemData);
}
// else (textual) keep original value
}
}
- const ScDPNumGroupInfo* pNumInfo = pCache->GetNumGroupInfo(nColumn);
+ const ScDPNumGroupInfo* pNumInfo = rCache.GetNumGroupInfo(nColumn);
if (bDateDim && pNumInfo)
{
// This is a date group dimension.
- sal_Int32 nDatePart = pCache->GetGroupType(nColumn);
- const ScDPItemData* pData = pCache->GetItemDataById(nSourceDim, rItems[i]);
+ sal_Int32 nDatePart = rCache.GetGroupType(nColumn);
+ const ScDPItemData* pData = rCache.GetItemDataById(nSourceDim, rItems[i]);
if (pData->GetType() == ScDPItemData::Value)
{
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
@@ -892,7 +892,7 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<lon
pData->GetValue(), pNumInfo, nDatePart, pFormatter);
ScDPItemData aItem(nDatePart, nPartValue);
- rItems[i] = pCache->GetIdByItemData(nColumn, aItem);
+ rItems[i] = rCache.GetIdByItemData(nColumn, aItem);
}
}
}
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index c69dfd38f51d..98e6fa29a898 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -816,7 +816,7 @@ void ScDPObject::ClearTableData()
ClearSource();
if (mpTableData)
- mpTableData->GetCacheTable().getCache()->RemoveReference(this);
+ mpTableData->GetCacheTable().getCache().RemoveReference(this);
mpTableData.reset();
}
diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx
index 166c4a3c28be..329dc7c49f49 100644
--- a/sc/source/core/data/dpshttab.cxx
+++ b/sc/source/core/data/dpshttab.cxx
@@ -114,7 +114,7 @@ bool ScSheetDPData::IsDateDimension(long nDim)
}
else
{
- return GetCacheTable().getCache()->IsDateDimension( nDim);
+ return GetCacheTable().getCache().IsDateDimension( nDim);
}
}
@@ -132,7 +132,7 @@ sal_uLong ScSheetDPData::GetNumberFormat(long nDim)
}
else
{
- return GetCacheTable().getCache()->GetNumberFormat( nDim );
+ return GetCacheTable().getCache().GetNumberFormat( nDim );
}
}
sal_uInt32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx )
diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx
index 7056a9f7a52b..2fc2348697a7 100644
--- a/sc/source/core/data/dptabdat.cxx
+++ b/sc/source/core/data/dptabdat.cxx
@@ -60,8 +60,8 @@ ScDPTableData::~ScDPTableData()
OUString ScDPTableData::GetFormattedString(long nDim, const ScDPItemData& rItem) const
{
- const ScDPCache* pCache = GetCacheTable().getCache();
- return pCache->GetFormattedString(nDim, rItem);
+ const ScDPCache& rCache = GetCacheTable().getCache();
+ return rCache.GetFormattedString(nDim, rItem);
}
long ScDPTableData::GetDatePart( long nDateVal, long nHierarchy, long nLevel )
@@ -159,7 +159,7 @@ void ScDPTableData::FillRowDataFromCacheTable(sal_Int32 nRow, const ScDPFiltered
// page dimensions
GetItemData(rCacheTable, nRow, rInfo.aPageDims, rData.aPageData);
- long nCacheColumnCount = rCacheTable.getCache()->GetColumnCount();
+ long nCacheColumnCount = rCacheTable.getCache().GetColumnCount();
sal_Int32 n = rInfo.aDataSrcCols.size();
for (sal_Int32 i = 0; i < n; ++i)
{
@@ -239,10 +239,10 @@ void ScDPTableData::GetItemData(const ScDPFilteredCache& rCacheTable, sal_Int32
}
nDim = GetSourceDim( nDim );
- if ( nDim >= rCacheTable.getCache()->GetColumnCount() )
+ if ( nDim >= rCacheTable.getCache().GetColumnCount() )
continue;
- SCROW nId= rCacheTable.getCache()->GetItemDataId( static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow), IsRepeatIfEmpty());
+ SCROW nId= rCacheTable.getCache().GetItemDataId( static_cast<SCCOL>(nDim), static_cast<SCROW>(nRow), IsRepeatIfEmpty());
rItemData.push_back( nId );
}
}
@@ -261,13 +261,12 @@ const ScDPItemData* ScDPTableData::GetMemberByIndex( long nDim, long nIndex )
const ::std::vector<SCROW>& nMembers = GetCacheTable().getFieldEntries( nDim );
- return GetCacheTable().getCache()->GetItemDataById( (SCCOL) nDim, (SCROW)nMembers[nIndex] );
+ return GetCacheTable().getCache().GetItemDataById( (SCCOL) nDim, (SCROW)nMembers[nIndex] );
}
const ScDPItemData* ScDPTableData::GetMemberById( long nDim, long nId)
{
-
- return GetCacheTable().getCache()->GetItemDataById(nDim, static_cast<SCROW>(nId));
+ return GetCacheTable().getCache().GetItemDataById(nDim, static_cast<SCROW>(nId));
}
const std::vector< SCROW >& ScDPTableData::GetColumnEntries( long nColumn )
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index f7120ba7e8da..6490b2904554 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -2715,7 +2715,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDPMember )
const ScDPCache* ScDPSource::GetCache()
{
OSL_ENSURE( GetData() , "empty ScDPTableData pointer");
- return ( GetData()!=NULL) ? GetData()->GetCacheTable().getCache() : NULL ;
+ return ( GetData()!=NULL ) ? &GetData()->GetCacheTable().getCache() : NULL ;
}
const ScDPItemData* ScDPMember::GetItemData() const
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4c75534b5970..1d38126a2e0f 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -92,16 +92,16 @@ bool ScTable::SetOutlineTable( const ScOutlineTable* pNewOutline )
if (pOutlineTable)
{
- nOldSizeX = pOutlineTable->GetColArray()->GetDepth();
- nOldSizeY = pOutlineTable->GetRowArray()->GetDepth();
+ nOldSizeX = pOutlineTable->GetColArray().GetDepth();
+ nOldSizeY = pOutlineTable->GetRowArray().GetDepth();
delete pOutlineTable;
}
if (pNewOutline)
{
pOutlineTable = new ScOutlineTable( *pNewOutline );
- nNewSizeX = pOutlineTable->GetColArray()->GetDepth();
- nNewSizeY = pOutlineTable->GetRowArray()->GetDepth();
+ nNewSizeX = pOutlineTable->GetColArray().GetDepth();
+ nNewSizeY = pOutlineTable->GetRowArray().GetDepth();
}
else
pOutlineTable = NULL;
@@ -3348,7 +3348,7 @@ bool ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, bool bShow )
if (pOutlineTable && pColFlags)
{
ScBitMaskCompressedArray< SCCOLROW, sal_uInt8> aArray( MAXCOL, pColFlags, MAXCOLCOUNT);
- return pOutlineTable->GetColArray()->ManualAction( nStartCol, nEndCol, bShow, *this, true );
+ return pOutlineTable->GetColArray().ManualAction( nStartCol, nEndCol, bShow, *this, true );
}
else
return false;
@@ -3358,7 +3358,7 @@ bool ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, bool bShow )
bool ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, bool bShow )
{
if (pOutlineTable && pRowFlags)
- return pOutlineTable->GetRowArray()->ManualAction( nStartRow, nEndRow, bShow, *this, false );
+ return pOutlineTable->GetRowArray().ManualAction( nStartRow, nEndRow, bShow, *this, false );
else
return false;
}
@@ -3475,7 +3475,6 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
SCCOL nCol;
SCROW nRow;
bool bFound;
- ScOutlineArray* pArray;
ScRange aRef;
StartOutlineTable();
@@ -3487,7 +3486,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
aCol[nCol].FindUsed(nStartRow, nEndRow, aUsed);
aUsed.build_tree();
- pArray = pOutlineTable->GetRowArray();
+ ScOutlineArray& rRowArray = pOutlineTable->GetRowArray();
for (nRow=nStartRow; nRow<=nEndRow; nRow++)
{
bool bUsed = false;
@@ -3515,7 +3514,7 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
DiffSign( aRef.aStart.Row(), nRow ) ==
DiffSign( aRef.aEnd.Row(), nRow ) )
{
- if (pArray->Insert( aRef.aStart.Row(), aRef.aEnd.Row(), bSizeChanged ))
+ if (rRowArray.Insert( aRef.aStart.Row(), aRef.aEnd.Row(), bSizeChanged ))
{
bFound = true;
}
@@ -3524,13 +3523,13 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SC
}
// Column
- pArray = pOutlineTable->GetColArray();
+ ScOutlineArray& rColArray = pOutlineTable->GetColArray();
for (nCol=nStartCol; nCol<=nEndCol; nCol++)
{
if (aCol[nCol].IsEmptyData())
continue;
- OutlineArrayFinder aFunc(aRef, nCol, nTab, pArray, bSizeChanged);
+ OutlineArrayFinder aFunc(aRef, nCol, nTab, &rColArray, bSizeChanged);
sc::FindFormula(aCol[nCol].maCells, nStartRow, nEndRow, aFunc);
}
}
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index cacd7ddccf28..08215131094b 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -743,11 +743,11 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
// Gliederung einfuegen
- ScOutlineArray* pOutArr = pDestDoc->GetOutlineTable( nTab, true )->GetRowArray();
+ ScOutlineArray& rOutArr = pDestDoc->GetOutlineTable( nTab, true )->GetRowArray();
SCROW nOutStart = nRow+nArrY;
SCROW nOutEnd = nRow+nArrY+nNeeded-1;
bool bSize = false;
- pOutArr->Insert( nOutStart, nOutEnd, bSize );
+ rOutArr.Insert( nOutStart, nOutEnd, bSize );
for (SCROW nOutRow=nOutStart; nOutRow<=nOutEnd; nOutRow++)
pDestDoc->ShowRow( nOutRow, nTab, false );
pDestDoc->SetDrawPageSize(nTab);
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 9e51ae1aa8a3..48c505e9ff93 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -696,7 +696,7 @@ bool ScDBCollection::NamedDBs::insert(ScDBData* p)
if (r.second && p->HasImportParam() && !p->HasImportSelection())
{
p->SetRefreshHandler(mrParent.GetRefreshHandler());
- p->SetRefreshControl(mrDoc.GetRefreshTimerControlAddress());
+ p->SetRefreshControl(&mrDoc.GetRefreshTimerControlAddress());
}
return r.second;
}
diff --git a/sc/source/core/tool/refreshtimer.cxx b/sc/source/core/tool/refreshtimer.cxx
index 380d7546fda7..320463f88cdf 100644
--- a/sc/source/core/tool/refreshtimer.cxx
+++ b/sc/source/core/tool/refreshtimer.cxx
@@ -28,22 +28,22 @@ void ScRefreshTimerControl::SetAllowRefresh( bool b )
++nBlockRefresh;
}
-ScRefreshTimerProtector::ScRefreshTimerProtector( ScRefreshTimerControl * const * pp )
+ScRefreshTimerProtector::ScRefreshTimerProtector( ScRefreshTimerControl * const & rp )
:
- ppControl( pp )
+ m_rpControl( rp )
{
- if ( ppControl && *ppControl )
+ if ( m_rpControl )
{
- (*ppControl)->SetAllowRefresh( false );
+ m_rpControl->SetAllowRefresh( false );
// wait for any running refresh in another thread to finnish
- ::osl::MutexGuard aGuard( (*ppControl)->GetMutex() );
+ ::osl::MutexGuard aGuard( m_rpControl->GetMutex() );
}
}
ScRefreshTimerProtector::~ScRefreshTimerProtector()
{
- if ( ppControl && *ppControl )
- (*ppControl)->SetAllowRefresh( true );
+ if ( m_rpControl )
+ m_rpControl->SetAllowRefresh( true );
}
ScRefreshTimer::ScRefreshTimer() : ppControl(0)
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 4ee35b21637e..dfbd0dbcb11e 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -1387,10 +1387,10 @@ XclImpOutlineDataBuffer::~XclImpOutlineDataBuffer()
void XclImpOutlineDataBuffer::Convert()
{
- mxColOutlineBuff->SetOutlineArray( GetDoc().GetOutlineTable( mnScTab, true )->GetColArray() );
+ mxColOutlineBuff->SetOutlineArray( &GetDoc().GetOutlineTable( mnScTab, true )->GetColArray() );
mxColOutlineBuff->MakeScOutline();
- mxRowOutlineBuff->SetOutlineArray( GetDoc().GetOutlineTable( mnScTab, true )->GetRowArray() );
+ mxRowOutlineBuff->SetOutlineArray( &GetDoc().GetOutlineTable( mnScTab, true )->GetRowArray() );
mxRowOutlineBuff->MakeScOutline();
mxColRowBuff->ConvertHiddenFlags( mnScTab );
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 81f8cd3be35c..345d08674caa 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1050,8 +1050,8 @@ bool XclExpXmlStream::exportDocument()
throw (css::uno::RuntimeException, std::exception)
{
ScDocShell* pShell = getDocShell();
- ScDocument* pDoc = pShell->GetDocument();
- ScRefreshTimerProtector aProt(pDoc->GetRefreshTimerControlAddress());
+ ScDocument& rDoc = pShell->GetDocument();
+ ScRefreshTimerProtector aProt(rDoc.GetRefreshTimerControlAddress());
uno::Reference<task::XStatusIndicator> xStatusIndicator = getStatusIndicator();
@@ -1064,7 +1064,7 @@ bool XclExpXmlStream::exportDocument()
SotStorageRef rStorage = static_cast<SotStorage*>(NULL);
XclExpObjList::ResetCounters();
- XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, *pDoc, RTL_TEXTENCODING_DONTKNOW );
+ XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, rDoc, RTL_TEXTENCODING_DONTKNOW );
aData.meOutput = EXC_OUTPUT_XML_2007;
aData.maXclMaxPos.Set( EXC_MAXCOL_XML_2007, EXC_MAXROW_XML_2007, EXC_MAXTAB_XML_2007 );
aData.maMaxPos.SetCol( ::std::min( aData.maScMaxPos.Col(), aData.maXclMaxPos.Col() ) );
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 3f9e9a93ce05..c27fd95a2c9a 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -1340,7 +1340,7 @@ XclExpOutlineBuffer::XclExpOutlineBuffer( const XclExpRoot& rRoot, bool bRows )
mbCurrCollapse( false )
{
if( const ScOutlineTable* pOutlineTable = rRoot.GetDoc().GetOutlineTable( rRoot.GetCurrScTab() ) )
- mpScOLArray = bRows ? pOutlineTable->GetRowArray() : pOutlineTable->GetColArray();
+ mpScOLArray = &(bRows ? pOutlineTable->GetRowArray() : pOutlineTable->GetColArray());
if( mpScOLArray )
for( size_t nLevel = 0; nLevel < SC_OL_MAXDEPTH; ++nLevel )
@@ -1402,8 +1402,8 @@ XclExpGuts::XclExpGuts( const XclExpRoot& rRoot ) :
if( const ScOutlineTable* pOutlineTable = rRoot.GetDoc().GetOutlineTable( rRoot.GetCurrScTab() ) )
{
// column outline groups
- if( const ScOutlineArray* pColArray = pOutlineTable->GetColArray() )
- mnColLevels = ulimit_cast< sal_uInt16 >( pColArray->GetDepth(), EXC_OUTLINE_MAX );
+ const ScOutlineArray& rColArray = pOutlineTable->GetColArray();
+ mnColLevels = ulimit_cast< sal_uInt16 >( rColArray.GetDepth(), EXC_OUTLINE_MAX );
if( mnColLevels )
{
++mnColLevels;
@@ -1411,8 +1411,8 @@ XclExpGuts::XclExpGuts( const XclExpRoot& rRoot ) :
}
// row outline groups
- if( const ScOutlineArray* pRowArray = pOutlineTable->GetRowArray() )
- mnRowLevels = ulimit_cast< sal_uInt16 >( pRowArray->GetDepth(), EXC_OUTLINE_MAX );
+ const ScOutlineArray& rRowArray = pOutlineTable->GetRowArray();
+ mnRowLevels = ulimit_cast< sal_uInt16 >( rRowArray.GetDepth(), EXC_OUTLINE_MAX );
if( mnRowLevels )
{
++mnRowLevels;
@@ -2281,12 +2281,10 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
if( const ScOutlineTable* pOutlineTable = rDoc.GetOutlineTable( nScTab ) )
{
SCCOLROW nScStartPos, nScEndPos;
- if( const ScOutlineArray* pRowArray = pOutlineTable->GetRowArray() )
- {
- pRowArray->GetRange( nScStartPos, nScEndPos );
- // +1 because open/close button is in next row in Excel, +1 for "end->first unused"
- nFirstUngroupedScRow = static_cast< SCROW >( nScEndPos + 2 );
- }
+ const ScOutlineArray& rRowArray = pOutlineTable->GetRowArray();
+ rRowArray.GetRange( nScStartPos, nScEndPos );
+ // +1 because open/close button is in next row in Excel, +1 for "end->first unused"
+ nFirstUngroupedScRow = static_cast< SCROW >( nScEndPos + 2 );
}
// column settings
@@ -2482,7 +2480,7 @@ XclExpRecordRef XclExpCellTable::CreateRecord( sal_uInt16 nRecId ) const
XclExpRecordRef xRec;
switch( nRecId )
{
- case EXC_ID3_DIMENSIONS: xRec.reset( new XclExpDelegatingRecord( const_cast<XclExpRowBuffer*>(&maRowBfr)->GetDimensions() ) ); break;
+ case EXC_ID3_DIMENSIONS: xRec.reset( new XclExpDelegatingRecord( &const_cast<XclExpRowBuffer*>(&maRowBfr)->GetDimensions() ) ); break;
case EXC_ID2_DEFROWHEIGHT: xRec = mxDefrowheight; break;
case EXC_ID_GUTS: xRec = mxGuts; break;
case EXC_ID_NOTE: xRec = mxNoteList; break;
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 0d90d08f2086..422810bc0c8c 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -941,7 +941,7 @@ public:
virtual void Save( XclExpStream& rStrm ) SAL_OVERRIDE;
virtual void SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE;
- XclExpDimensions* GetDimensions() { return &maDimensions;}
+ XclExpDimensions& GetDimensions() { return maDimensions;}
private:
/** Returns access to the specified ROW record. Inserts preceding missing ROW records.
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 4463be4b429d..d7c6443e1e2a 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -542,7 +542,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile )
if (pModel)
mpDocShell = static_cast<ScDocShell*>(pModel->GetEmbeddedObject());
if (mpDocShell)
- mpDoc = mpDocShell->GetDocument();
+ mpDoc = &mpDocShell->GetDocument();
}
if (!mpDoc)
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index 6e2aa04c79b5..8b2a8c4b035b 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -85,7 +85,7 @@ public:
using ScMyIteratorBase::UpdateAddress;
void AddNewShape(const ScMyShape& aShape);
bool HasShapes() { return !aShapeList.empty(); }
- const ScMyShapeList* GetShapes() const { return &aShapeList; }
+ const ScMyShapeList& GetShapes() const { return aShapeList; }
virtual void SetCellData( ScMyCell& rMyCell ) SAL_OVERRIDE;
virtual void Sort() SAL_OVERRIDE;
void SkipTable(SCTAB nSkip);
@@ -114,7 +114,7 @@ public:
using ScMyIteratorBase::UpdateAddress;
void AddNewNote(const ScMyNoteShape& aNote);
bool HasNotes() { return !aNoteShapeList.empty(); }
- const ScMyNoteShapeList* GetNotes() const { return &aNoteShapeList; }
+ const ScMyNoteShapeList& GetNotes() const { return aNoteShapeList; }
virtual void SetCellData( ScMyCell& rMyCell ) SAL_OVERRIDE;
virtual void Sort() SAL_OVERRIDE;
void SkipTable(SCTAB nSkip);
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index e51f46820b4f..38dc7938cee1 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -124,7 +124,7 @@ public:
const sal_Int32 nLastRow, const sal_Int32 nLastCol,
const ScFormatRangeStyles* pCellStyles, ScDocument* pDoc);
- const ScMyDefaultStyleList* GetColDefaults() const { return &maColDefaults; }
+ const ScMyDefaultStyleList& GetColDefaults() const { return maColDefaults; }
};
struct ScMyRowFormatRange
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index b85d9eacd8f1..d5e80a7f5f26 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -283,11 +283,11 @@ void ScXMLTableColsContext::EndElement()
{
ScXMLImport::MutexGuard aGuard(GetScImport());
ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(nSheet, true);
- ScOutlineArray* pColArray = pOutlineTable ? pOutlineTable->GetColArray() : NULL;
- if (pColArray)
+ if (pOutlineTable)
{
+ ScOutlineArray& rColArray = pOutlineTable->GetColArray();
bool bResized;
- pColArray->Insert(static_cast<SCCOL>(nGroupStartCol), static_cast<SCCOL>(nGroupEndCol), bResized, !bGroupDisplay, true);
+ rColArray.Insert(static_cast<SCCOL>(nGroupStartCol), static_cast<SCCOL>(nGroupEndCol), bResized, !bGroupDisplay, true);
}
}
}
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index 60ef6c766b53..9088e00d4c32 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -414,7 +414,7 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName)
{
pData->SetRefreshDelay(nRefresh);
pData->SetRefreshHandler(pDoc->GetDBCollection()->GetRefreshHandler());
- pData->SetRefreshControl(pDoc->GetRefreshTimerControlAddress());
+ pData->SetRefreshControl(&pDoc->GetRefreshTimerControlAddress());
}
return pData.release();
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 5051ee0f013d..828cd99d1a19 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -719,7 +719,7 @@ void ScXMLExport::CollectShapesAutoStyles(const sal_Int32 nTableCount)
ScMyShapeList::const_iterator aShapeItr = aDummyInitList.end();
if (pSharedData->GetShapesContainer())
{
- pShapeList = pSharedData->GetShapesContainer()->GetShapes();
+ pShapeList = &pSharedData->GetShapesContainer()->GetShapes();
aShapeItr = pShapeList->begin();
}
if (pSharedData->HasDrawPage())
@@ -762,15 +762,12 @@ void ScXMLExport::CollectShapesAutoStyles(const sal_Int32 nTableCount)
}
if (pSharedData->GetNoteShapes())
{
- const ScMyNoteShapeList* pNoteShapes = pSharedData->GetNoteShapes()->GetNotes();
- if (pNoteShapes)
+ const ScMyNoteShapeList& rNoteShapes = pSharedData->GetNoteShapes()->GetNotes();
+ for (ScMyNoteShapeList::const_iterator aNoteShapeItr = rNoteShapes.begin(), aNoteShapeEndItr = rNoteShapes.end();
+ aNoteShapeItr != aNoteShapeEndItr; ++aNoteShapeItr)
{
- for (ScMyNoteShapeList::const_iterator aNoteShapeItr = pNoteShapes->begin(), aNoteShapeEndItr = pNoteShapes->end();
- aNoteShapeItr != aNoteShapeEndItr; ++aNoteShapeItr)
- {
- if (static_cast<sal_Int32>(aNoteShapeItr->aPos.Tab()) == nTable)
- GetShapeExport()->collectShapeAutoStyles(aNoteShapeItr->xShape);
- }
+ if (static_cast<sal_Int32>(aNoteShapeItr->aPos.Tab()) == nTable)
+ GetShapeExport()->collectShapeAutoStyles(aNoteShapeItr->xShape);
}
}
}
@@ -904,16 +901,16 @@ void ScXMLExport::WriteColumn(const sal_Int32 nColumn, const sal_Int32 nRepeatCo
const sal_Int32 nStyleIndex, const bool bIsVisible)
{
sal_Int32 nRepeat(1);
- sal_Int32 nPrevIndex((*pDefaults->GetColDefaults())[nColumn].nIndex);
- bool bPrevAutoStyle((*pDefaults->GetColDefaults())[nColumn].bIsAutoStyle);
+ sal_Int32 nPrevIndex(pDefaults->GetColDefaults()[nColumn].nIndex);
+ bool bPrevAutoStyle(pDefaults->GetColDefaults()[nColumn].bIsAutoStyle);
for (sal_Int32 i = nColumn + 1; i < nColumn + nRepeatColumns; ++i)
{
- if (((*pDefaults->GetColDefaults())[i].nIndex != nPrevIndex) ||
- ((*pDefaults->GetColDefaults())[i].bIsAutoStyle != bPrevAutoStyle))
+ if ((pDefaults->GetColDefaults()[i].nIndex != nPrevIndex) ||
+ (pDefaults->GetColDefaults()[i].bIsAutoStyle != bPrevAutoStyle))
{
WriteSingleColumn(nRepeat, nStyleIndex, nPrevIndex, bPrevAutoStyle, bIsVisible);
- nPrevIndex = (*pDefaults->GetColDefaults())[i].nIndex;
- bPrevAutoStyle = (*pDefaults->GetColDefaults())[i].bIsAutoStyle;
+ nPrevIndex = pDefaults->GetColDefaults()[i].nIndex;
+ bPrevAutoStyle = pDefaults->GetColDefaults()[i].bIsAutoStyle;
nRepeat = 1;
}
else
@@ -1756,12 +1753,10 @@ void ScXMLExport::FillColumnRowGroups()
ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable( static_cast<SCTAB>(nCurrentTable), false );
if(pOutlineTable)
{
- ScOutlineArray* pCols(pOutlineTable->GetColArray());
- ScOutlineArray* pRows(pOutlineTable->GetRowArray());
- if (pCols)
- FillFieldGroup(pCols, pGroupColumns);
- if (pRows)
- FillFieldGroup(pRows, pGroupRows);
+ ScOutlineArray& rCols(pOutlineTable->GetColArray());
+ ScOutlineArray& rRows(pOutlineTable->GetRowArray());
+ FillFieldGroup(&rCols, pGroupColumns);
+ FillFieldGroup(&rRows, pGroupRows);
pSharedData->SetLastColumn(nCurrentTable, pGroupColumns->GetLast());
pSharedData->SetLastRow(nCurrentTable, pGroupRows->GetLast());
}
@@ -2992,8 +2987,8 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
pSharedData->SetLastRow(nTable, aRowHeaderRange.EndRow);
pDefaults->FillDefaultStyles(nTable, pSharedData->GetLastRow(nTable),
pSharedData->GetLastColumn(nTable), pCellStyles, pDoc);
- pRowFormatRanges->SetColDefaults(pDefaults->GetColDefaults());
- pCellStyles->SetColDefaults(pDefaults->GetColDefaults());
+ pRowFormatRanges->SetColDefaults(&pDefaults->GetColDefaults());
+ pCellStyles->SetColDefaults(&pDefaults->GetColDefaults());
ExportColumns(nTable, aColumnHeaderRange, bHasColumnHeader);
bool bIsFirst(true);
sal_Int32 nEqualCells(0);
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index 887504c84d26..65af6b0905c0 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -332,9 +332,9 @@ void ScXMLTableRowsContext::EndElement()
{
ScXMLImport::MutexGuard aGuard(GetScImport());
ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(nSheet, true));
- ScOutlineArray* pRowArray(pOutlineTable->GetRowArray());
+ ScOutlineArray& rRowArray(pOutlineTable->GetRowArray());
bool bResized;
- pRowArray->Insert(static_cast<SCROW>(nGroupStartRow), static_cast<SCROW>(nGroupEndRow), bResized, !bGroupDisplay, true);
+ rRowArray.Insert(static_cast<SCROW>(nGroupStartRow), static_cast<SCROW>(nGroupEndRow), bResized, !bGroupDisplay, true);
}
}
}
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index c2a7c8d8ea9c..b0f836dac78c 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -373,28 +373,28 @@ void ScXMLTableContext::EndElement()
ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(nCurTab, false));
if (pOutlineTable)
{
- ScOutlineArray* pColArray(pOutlineTable->GetColArray());
- size_t nDepth = pColArray->GetDepth();
+ ScOutlineArray& rColArray(pOutlineTable->GetColArray());
+ size_t nDepth = rColArray.GetDepth();
for (size_t i = 0; i < nDepth; ++i)
{
- size_t nCount = pColArray->GetCount(i);
+ size_t nCount = rColArray.GetCount(i);
for (size_t j = 0; j < nCount; ++j)
{
- const ScOutlineEntry* pEntry = pColArray->GetEntry(i, j);
+ const ScOutlineEntry* pEntry = rColArray.GetEntry(i, j);
if (pEntry->IsHidden())
- pColArray->SetVisibleBelow(i, j, false);
+ rColArray.SetVisibleBelow(i, j, false);
}
}
- ScOutlineArray* pRowArray(pOutlineTable->GetRowArray());
- nDepth = pRowArray->GetDepth();
+ ScOutlineArray& rRowArray(pOutlineTable->GetRowArray());
+ nDepth = rRowArray.GetDepth();
for (size_t i = 0; i < nDepth; ++i)
{
- size_t nCount = pRowArray->GetCount(i);
+ size_t nCount = rRowArray.GetCount(i);
for (size_t j = 0; j < nCount; ++j)
{
- const ScOutlineEntry* pEntry = pRowArray->GetEntry(i, j);
+ const ScOutlineEntry* pEntry = rRowArray.GetEntry(i, j);
if (pEntry->IsHidden())
- pRowArray->SetVisibleBelow(i, j, false);
+ rRowArray.SetVisibleBelow(i, j, false);
}
}
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index f092200846f8..e51fc51b658a 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -78,7 +78,7 @@ using namespace com::sun::star;
ScXMLImportWrapper::ScXMLImportWrapper( ScDocShell& rDocSh, SfxMedium* pM, const uno::Reference < embed::XStorage >& xStor ) :
mrDocShell(rDocSh),
- rDoc(*rDocSh.GetDocument()),
+ rDoc(rDocSh.GetDocument()),
pMedium(pM),
xStorage(xStor)
{
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index fdfb27a4b89a..8022fa6d6893 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -173,10 +173,10 @@ Rectangle ScAccessibleCell::GetBoundingBox() const
if (mpViewShell)
{
long nSizeX, nSizeY;
- mpViewShell->GetViewData()->GetMergeSizePixel(
+ mpViewShell->GetViewData().GetMergeSizePixel(
maCellAddress.Col(), maCellAddress.Row(), nSizeX, nSizeY);
aCellRect.SetSize(Size(nSizeX, nSizeY));
- aCellRect.SetPos(mpViewShell->GetViewData()->GetScrPos(maCellAddress.Col(), maCellAddress.Row(), meSplitPos, true));
+ aCellRect.SetPos(mpViewShell->GetViewData().GetScrPos(maCellAddress.Col(), maCellAddress.Row(), meSplitPos, true));
Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos);
if (pWindow)
@@ -373,9 +373,9 @@ bool ScAccessibleCell::IsSelected()
}
bool bResult(false);
- if (mpViewShell && mpViewShell->GetViewData())
+ if (mpViewShell)
{
- const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
bResult = rMarkdata.IsCellMarked(maCellAddress.Col(), maCellAddress.Row());
}
return bResult;
@@ -384,8 +384,8 @@ bool ScAccessibleCell::IsSelected()
ScDocument* ScAccessibleCell::GetDocument(ScTabViewShell* pViewShell)
{
ScDocument* pDoc = NULL;
- if (pViewShell && pViewShell->GetViewData())
- pDoc = pViewShell->GetViewData()->GetDocument();
+ if (pViewShell)
+ pDoc = pViewShell->GetViewData().GetDocument();
return pDoc;
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 3c48184dcfb3..981822210371 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -358,14 +358,14 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc
}
if (pViewShell)
{
- ScViewData *pViewData = pViewShell->GetViewData();
- SfxBroadcaster* pDrawBC = pViewData ? pViewData->GetDocument()->GetDrawBroadcaster() : NULL;
+ ScViewData& rViewData = pViewShell->GetViewData();
+ SfxBroadcaster* pDrawBC = rViewData.GetDocument()->GetDrawBroadcaster();
if (pDrawBC)
{
StartListening(*pDrawBC);
- maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(pViewData->GetDocument()->GetDrawLayer()) );
- maShapeTreeInfo.SetSdrView(pViewData->GetScDrawView());
+ maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(rViewData.GetDocument()->GetDrawLayer()) );
+ maShapeTreeInfo.SetSdrView(rViewData.GetScDrawView());
maShapeTreeInfo.SetController(NULL);
maShapeTreeInfo.SetWindow(pViewShell->GetWindowByPos(meSplitPos));
maShapeTreeInfo.SetViewForwarder(mpAccessibleDocument);
@@ -378,8 +378,7 @@ ScChildrenShapes::~ScChildrenShapes()
std::for_each(maZOrderedShapes.begin(), maZOrderedShapes.end(), Destroy());
if (mpViewShell)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- SfxBroadcaster* pDrawBC = pViewData ? pViewData->GetDocument()->GetDrawBroadcaster() : NULL;
+ SfxBroadcaster* pDrawBC = mpViewShell->GetViewData().GetDocument()->GetDrawBroadcaster();
if (pDrawBC)
EndListening(*pDrawBC);
}
@@ -389,14 +388,14 @@ void ScChildrenShapes::SetDrawBroadcaster()
{
if (mpViewShell)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- SfxBroadcaster* pDrawBC = pViewData ? pViewData->GetDocument()->GetDrawBroadcaster() : NULL;
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ SfxBroadcaster* pDrawBC = rViewData.GetDocument()->GetDrawBroadcaster();
if (pDrawBC)
{
StartListening(*pDrawBC, true);
- maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(pViewData->GetDocument()->GetDrawLayer()) );
- maShapeTreeInfo.SetSdrView(pViewData->GetScDrawView());
+ maShapeTreeInfo.SetModelBroadcaster( new ScDrawModelBroadcaster(rViewData.GetDocument()->GetDrawLayer()) );
+ maShapeTreeInfo.SetSdrView(rViewData.GetScDrawView());
maShapeTreeInfo.SetController(NULL);
maShapeTreeInfo.SetWindow(mpViewShell->GetWindowByPos(meSplitPos));
maShapeTreeInfo.SetViewForwarder(mpAccessibleDocument);
@@ -892,8 +891,8 @@ SdrPage* ScChildrenShapes::GetDrawPage() const
SdrPage* pDrawPage = NULL;
if (mpViewShell)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- ScDocument* pDoc = pViewData ? pViewData->GetDocument() : NULL;
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
if (pDoc && pDoc->GetDrawLayer())
{
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
@@ -1049,8 +1048,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X
bool bIsFocuseMarked = true;
if( mpViewShell && mnShapesSelected == 1 && bWinFocus)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- ScDrawView* pScDrawView = pViewData ? pViewData->GetScDrawView() : NULL;
+ ScDrawView* pScDrawView = mpViewShell->GetViewData().GetScDrawView();
if( pScDrawView )
{
if( pScDrawView->GetMarkedObjectList().GetMarkCount() == 1 )
@@ -1431,10 +1429,10 @@ ScAccessibleDocument::ScAccessibleDocument(
AddChild( pChildWin->GetAccessible(), false );
}
}
- ScViewData *pViewData = pViewShell->GetViewData();
- if (pViewData && pViewData->HasEditView(eSplitPos))
+ ScViewData& rViewData = pViewShell->GetViewData();
+ if (rViewData.HasEditView(eSplitPos))
{
- uno::Reference<XAccessible> xAcc = new ScAccessibleEditObject(this, pViewData->GetEditView(eSplitPos),
+ uno::Reference<XAccessible> xAcc = new ScAccessibleEditObject(this, rViewData.GetEditView(eSplitPos),
pViewShell->GetWindowByPos(eSplitPos), GetCurrentCellName(), GetCurrentCellDescription(),
ScAccessibleEditObject::CellInEditMode);
AddChild(xAcc, false);
@@ -1599,13 +1597,13 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else if ((rRef.GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
{
- ScViewData *pViewData = mpViewShell ? mpViewShell->GetViewData() : NULL;
- if (pViewData && pViewData->HasEditView(meSplitPos))
+ if (mpViewShell->GetViewData().HasEditView(meSplitPos))
{
- const EditEngine* pEditEng = pViewData->GetEditView(meSplitPos)->GetEditEngine();
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ const EditEngine* pEditEng = rViewData.GetEditView(meSplitPos)->GetEditEngine();
if (pEditEng && pEditEng->GetUpdateMode())
{
- mpTempAccEdit = new ScAccessibleEditObject(this, pViewData->GetEditView(meSplitPos),
+ mpTempAccEdit = new ScAccessibleEditObject(this, rViewData.GetEditView(meSplitPos),
mpViewShell->GetWindowByPos(meSplitPos), GetCurrentCellName(),
OUString(ScResId(STR_ACC_EDITLINE_DESCR)), ScAccessibleEditObject::CellInEditMode);
uno::Reference<XAccessible> xAcc = mpTempAccEdit;
@@ -1774,8 +1772,8 @@ void SAL_CALL ScAccessibleDocument::grabFocus( )
{
xAccessibleComponent->grabFocus();
// grab only focus if it does not have the focus and it is not hidden
- if (mpViewShell && mpViewShell->GetViewData() &&
- (mpViewShell->GetViewData()->GetActivePart() != meSplitPos) &&
+ if (mpViewShell &&
+ (mpViewShell->GetViewData().GetActivePart() != meSplitPos) &&
mpViewShell->GetWindowByPos(meSplitPos)->IsVisible())
{
mpViewShell->ActivatePart(meSplitPos);
@@ -2127,14 +2125,10 @@ Rectangle ScAccessibleDocument::GetVisibleArea_Impl() const
if (mpViewShell)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- if (pViewData)
- {
- Point aPoint(pViewData->GetPixPos(meSplitPos)); // returns a negative Point
- aPoint.setX(-aPoint.getX());
- aPoint.setY(-aPoint.getY());
- aVisRect.SetPos(aPoint);
- }
+ Point aPoint(mpViewShell->GetViewData().GetPixPos(meSplitPos)); // returns a negative Point
+ aPoint.setX(-aPoint.getX());
+ aPoint.setY(-aPoint.getY());
+ aVisRect.SetPos(aPoint);
ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
if (pWin)
@@ -2260,9 +2254,8 @@ Rectangle ScAccessibleDocument::GetBoundingBox() const
SCTAB ScAccessibleDocument::getVisibleTable() const
{
SCTAB nVisibleTable(0);
- ScViewData *pViewData = mpViewShell ? mpViewShell->GetViewData() : NULL;
- if (pViewData)
- nVisibleTable = pViewData->GetTabNo();
+ if (mpViewShell)
+ nVisibleTable = mpViewShell->GetViewData().GetTabNo();
return nVisibleTable;
}
@@ -2292,12 +2285,11 @@ void ScAccessibleDocument::FreeAccessibleSpreadsheet()
bool ScAccessibleDocument::IsTableSelected() const
{
bool bResult (false);
- ScViewData *pViewData = mpViewShell ? mpViewShell->GetViewData() : NULL;
- if(pViewData)
+ if(mpViewShell)
{
SCTAB nTab(getVisibleTable());
//#103800#; use a copy of MarkData
- ScMarkData aMarkData(pViewData->GetMarkData());
+ ScMarkData aMarkData(mpViewShell->GetViewData().GetMarkData());
aMarkData.MarkToMulti();
if (aMarkData.IsAllMarked(ScRange(ScAddress(0, 0, nTab),ScAddress(MAXCOL, MAXROW, nTab))))
bResult = true;
@@ -2357,11 +2349,10 @@ void ScAccessibleDocument::RemoveChild(const uno::Reference<XAccessible>& xAcc,
OUString ScAccessibleDocument::GetCurrentCellName() const
{
OUString sName(SC_RESSTR(STR_ACC_CELL_NAME));
- ScViewData *pViewData = mpViewShell ? mpViewShell->GetViewData() : NULL;
- if (pViewData)
+ if (mpViewShell)
{
// Document not needed, because only the cell address, but not the tablename is needed
- OUString sAddress(pViewData->GetCurPos().Format(SCA_VALID, NULL));
+ OUString sAddress(mpViewShell->GetViewData().GetCurPos().Format(SCA_VALID, NULL));
sName = sName.replaceFirst("%1", sAddress);
}
return sName;
@@ -2374,14 +2365,12 @@ OUString ScAccessibleDocument::GetCurrentCellDescription() const
ScDocument *ScAccessibleDocument::GetDocument() const
{
- ScViewData *pViewData = mpViewShell ? mpViewShell->GetViewData() : NULL;
- return pViewData ? pViewData->GetDocument() : NULL;
+ return mpViewShell ? mpViewShell->GetViewData().GetDocument() : NULL;
}
ScAddress ScAccessibleDocument::GetCurCellAddress() const
{
- ScViewData *pViewData = mpViewShell ? mpViewShell->GetViewData() : NULL;
- return pViewData ? pViewData->GetCurPos() : ScAddress();
+ return mpViewShell ? mpViewShell->GetViewData().GetCurPos() : ScAddress();
}
uno::Any SAL_CALL ScAccessibleDocument::getExtendedAttributes()
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 040a2a1d0a72..8c24d1dd4659 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -485,7 +485,7 @@ inline ScDocument* ScNotesChildren::GetDocument() const
{
ScDocument* pDoc = NULL;
if (mpViewShell)
- pDoc = mpViewShell->GetDocument();
+ pDoc = &mpViewShell->GetDocument();
return pDoc;
}
@@ -723,7 +723,7 @@ ScShapeChildren::ScShapeChildren(ScPreviewShell* pViewShell, ScAccessibleDocumen
{
if (pViewShell)
{
- SfxBroadcaster* pDrawBC = pViewShell->GetDocument()->GetDrawBroadcaster();
+ SfxBroadcaster* pDrawBC = pViewShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
StartListening(*pDrawBC);
}
@@ -733,7 +733,7 @@ ScShapeChildren::~ScShapeChildren()
{
if (mpViewShell)
{
- SfxBroadcaster* pDrawBC = mpViewShell->GetDocument()->GetDrawBroadcaster();
+ SfxBroadcaster* pDrawBC = mpViewShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
EndListening(*pDrawBC);
}
@@ -743,7 +743,7 @@ void ScShapeChildren::SetDrawBroadcaster()
{
if (mpViewShell)
{
- SfxBroadcaster* pDrawBC = mpViewShell->GetDocument()->GetDrawBroadcaster();
+ SfxBroadcaster* pDrawBC = mpViewShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
StartListening(*pDrawBC, true);
}
@@ -1163,10 +1163,10 @@ SdrPage* ScShapeChildren::GetDrawPage() const
{
SCTAB nTab( mpViewShell->GetLocationData().GetPrintTab() );
SdrPage* pDrawPage = NULL;
- ScDocument* pDoc = mpViewShell->GetDocument();
- if (pDoc && pDoc->GetDrawLayer())
+ ScDocument& rDoc = mpViewShell->GetDocument();
+ if (rDoc.GetDrawLayer())
{
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab))
pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
}
@@ -1688,11 +1688,9 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
SolarMutexGuard g;
OUString aName = ScResId(STR_ACC_DOC_SPREADSHEET);
- ScDocument* pScDoc = mpViewShell->GetDocument();
- if (!pScDoc)
- return aName;
+ ScDocument& rScDoc = mpViewShell->GetDocument();
- SfxObjectShell* pObjSh = pScDoc->GetDocumentShell();
+ SfxObjectShell* pObjSh = rScDoc.GetDocumentShell();
if (!pObjSh)
return aName;
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index a8f88fbdea21..b2828b781832 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -227,25 +227,22 @@ sal_Int32 SAL_CALL ScAccessiblePageHeader::getAccessibleChildCount() throw (uno:
if((mnChildCount < 0) && mpViewShell)
{
mnChildCount = 0;
- ScDocument* pDoc = mpViewShell->GetDocument();
- if (pDoc)
- {
- // find out how many regions (left,center, right) are with content
+ ScDocument& rDoc = mpViewShell->GetDocument();
+ // find out how many regions (left,center, right) are with content
- SfxStyleSheetBase* pStyle = pDoc->GetStyleSheetPool()->Find(pDoc->GetPageStyle(mpViewShell->GetLocationData().GetPrintTab()), SFX_STYLE_FAMILY_PAGE);
- if (pStyle)
- {
- sal_uInt16 nPageWhichId(0);
- if (mbHeader)
- nPageWhichId = mpViewShell->GetLocationData().IsHeaderLeft() ? ATTR_PAGE_HEADERLEFT : ATTR_PAGE_HEADERRIGHT;
- else
- nPageWhichId = mpViewShell->GetLocationData().IsFooterLeft() ? ATTR_PAGE_FOOTERLEFT : ATTR_PAGE_FOOTERRIGHT;
+ SfxStyleSheetBase* pStyle = rDoc.GetStyleSheetPool()->Find(rDoc.GetPageStyle(mpViewShell->GetLocationData().GetPrintTab()), SFX_STYLE_FAMILY_PAGE);
+ if (pStyle)
+ {
+ sal_uInt16 nPageWhichId(0);
+ if (mbHeader)
+ nPageWhichId = mpViewShell->GetLocationData().IsHeaderLeft() ? ATTR_PAGE_HEADERLEFT : ATTR_PAGE_HEADERRIGHT;
+ else
+ nPageWhichId = mpViewShell->GetLocationData().IsFooterLeft() ? ATTR_PAGE_FOOTERLEFT : ATTR_PAGE_FOOTERRIGHT;
- const ScPageHFItem& rPageItem = static_cast<const ScPageHFItem&>(pStyle->GetItemSet().Get(nPageWhichId));
- AddChild(rPageItem.GetLeftArea(), 0, SVX_ADJUST_LEFT);
- AddChild(rPageItem.GetCenterArea(), 1, SVX_ADJUST_CENTER);
- AddChild(rPageItem.GetRightArea(), 2, SVX_ADJUST_RIGHT);
- }
+ const ScPageHFItem& rPageItem = static_cast<const ScPageHFItem&>(pStyle->GetItemSet().Get(nPageWhichId));
+ AddChild(rPageItem.GetLeftArea(), 0, SVX_ADJUST_LEFT);
+ AddChild(rPageItem.GetCenterArea(), 1, SVX_ADJUST_CENTER);
+ AddChild(rPageItem.GetRightArea(), 2, SVX_ADJUST_RIGHT);
}
}
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index 23650ecbc8e8..d2cc20171cf3 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -45,7 +45,7 @@ ScAccessiblePreviewCell::ScAccessiblePreviewCell( const ::com::sun::star::uno::R
::com::sun::star::accessibility::XAccessible>& rxParent,
ScPreviewShell* pViewShell, /* const */ ScAddress& rCellAddress,
sal_Int32 nIndex ) :
- ScAccessibleCellBase( rxParent, ( pViewShell ? pViewShell->GetDocument() : NULL ), rCellAddress, nIndex ),
+ ScAccessibleCellBase( rxParent, ( pViewShell ? &pViewShell->GetDocument() : NULL ), rCellAddress, nIndex ),
mpViewShell( pViewShell ),
mpTextHelper(NULL)
{
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 1dd15c14f54c..78f1b3af1fca 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -204,8 +204,8 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleRowExtentAt( sal_Int32
}
else
{
- ScDocument* pDoc = mpViewShell->GetDocument();
- const ScMergeAttr* pItem = (const ScMergeAttr*)pDoc->GetAttr(
+ ScDocument& rDoc = mpViewShell->GetDocument();
+ const ScMergeAttr* pItem = (const ScMergeAttr*)rDoc.GetAttr(
static_cast<SCCOL>(rColInfo.nDocIndex), static_cast<SCROW>(rRowInfo.nDocIndex), mpTableInfo->GetTab(), ATTR_MERGE );
if ( pItem && pItem->GetRowMerge() > 0 )
nRows = pItem->GetRowMerge();
@@ -238,8 +238,8 @@ sal_Int32 SAL_CALL ScAccessiblePreviewTable::getAccessibleColumnExtentAt( sal_In
}
else
{
- ScDocument* pDoc = mpViewShell->GetDocument();
- const ScMergeAttr* pItem = (const ScMergeAttr*)pDoc->GetAttr(
+ ScDocument& rDoc = mpViewShell->GetDocument();
+ const ScMergeAttr* pItem = (const ScMergeAttr*)rDoc.GetAttr(
static_cast<SCCOL>(rColInfo.nDocIndex), static_cast<SCROW>(rRowInfo.nDocIndex), mpTableInfo->GetTab(), ATTR_MERGE );
if ( pItem && pItem->GetColMerge() > 0 )
nColumns = pItem->GetColMerge();
@@ -614,14 +614,14 @@ OUString SAL_CALL ScAccessiblePreviewTable::createAccessibleName()
{
OUString sName(SC_RESSTR(STR_ACC_TABLE_NAME));
- if (mpViewShell && mpViewShell->GetDocument())
+ if (mpViewShell)
{
FillTableInfo();
if ( mpTableInfo )
{
OUString sCoreName;
- if (mpViewShell->GetDocument()->GetName( mpTableInfo->GetTab(), sCoreName ))
+ if (mpViewShell->GetDocument().GetName( mpTableInfo->GetTab(), sCoreName ))
sName = sName.replaceFirst("%1", sCoreName);
}
}
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 4e3c8db27f57..ef9b834054e5 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -300,7 +300,7 @@ void ScAccessibleSpreadsheet::ConstructScAccessibleSpreadsheet(
{
mpViewShell->AddAccessibilityObject(*this);
- const ScViewData& rViewData = *mpViewShell->GetViewData();
+ const ScViewData& rViewData = mpViewShell->GetViewData();
const ScMarkData& rMarkData = rViewData.GetMarkData();
maActiveCell = rViewData.GetCurPos();
mbHasSelection = rMarkData.GetTableSelect(maActiveCell.Tab()) &&
@@ -425,9 +425,9 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
{
if (mpViewShell)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
+ ScViewData& rViewData = mpViewShell->GetViewData();
- m_bFormulaMode = pViewData->IsRefMode() || SC_MOD()->IsFormulaMode();
+ m_bFormulaMode = rViewData.IsRefMode() || SC_MOD()->IsFormulaMode();
if ( m_bFormulaMode )
{
NotifyRefMode();
@@ -445,7 +445,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
AccessibleEventObject aEvent;
aEvent.Source = uno::Reference< XAccessible >(this);
- ScAddress aNewCell = pViewData->GetCurPos();
+ ScAddress aNewCell = rViewData.GetCurPos();
if(aNewCell.Tab() != maActiveCell.Tab())
{
aEvent.EventId = AccessibleEventId::PAGE_CHANGED;
@@ -462,14 +462,14 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
{//single Focus
bNewPosCellFocus=true;
}
- ScMarkData &refScMarkData = pViewData->GetMarkData();
+ ScMarkData &refScMarkData = rViewData.GetMarkData();
// MT IA2: Not used
// int nSelCount = refScMarkData.GetSelectCount();
bool bIsMark =refScMarkData.IsMarked();
bool bIsMultMark = refScMarkData.IsMultiMarked();
bool bNewMarked = refScMarkData.GetTableSelect(aNewCell.Tab()) && ( bIsMark || bIsMultMark );
// sal_Bool bNewCellSelected = isAccessibleSelected(aNewCell.Row(), aNewCell.Col());
- sal_uInt16 nTab = pViewData->GetTabNo();
+ sal_uInt16 nTab = rViewData.GetTabNo();
ScRange aMarkRange;
refScMarkData.GetMarkArea(aMarkRange);
aEvent.OldValue <<= ::com::sun::star::uno::Any();
@@ -554,7 +554,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
else
{
ScRange aDelRange;
- bool bIsDel = pViewData->GetDelMark( aDelRange );
+ bool bIsDel = rViewData.GetDelMark( aDelRange );
if ( (!bIsDel || (bIsDel && aMarkRange != aDelRange)) &&
bNewMarked &&
nNewMarkCount > 0 &&
@@ -605,8 +605,8 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
else
mbDelIns = false;
- ScViewData *pViewData = mpViewShell->GetViewData();
- ScAddress aNewCell = pViewData->GetCurPos();
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ ScAddress aNewCell = rViewData.GetCurPos();
if( maActiveCell == aNewCell)
{
ScDocument* pScDoc= GetDocument(mpViewShell);
@@ -822,10 +822,10 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessib
{
return aSequence;
}
- if (mpViewShell && mpViewShell->GetViewData())
+ if (mpViewShell)
{
aSequence.realloc(maRange.aEnd.Row() - maRange.aStart.Row() + 1);
- const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
sal_Int32* pSequence = aSequence.getArray();
sal_Int32 nCount(0);
for (SCROW i = maRange.aStart.Row(); i <= maRange.aEnd.Row(); ++i)
@@ -853,10 +853,10 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessib
{
return aSequence;
}
- if (mpViewShell && mpViewShell->GetViewData())
+ if (mpViewShell)
{
aSequence.realloc(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
- const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
sal_Int32* pSequence = aSequence.getArray();
sal_Int32 nCount(0);
for (SCCOL i = maRange.aStart.Col(); i <= maRange.aEnd.Col(); ++i)
@@ -888,9 +888,9 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleRowSelected( sal_Int32 nR
throw lang::IndexOutOfBoundsException();
bool bResult(false);
- if (mpViewShell && mpViewShell->GetViewData())
+ if (mpViewShell)
{
- const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
bResult = rMarkdata.IsRowMarked((SCROW)nRow);
}
return bResult;
@@ -910,9 +910,9 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleColumnSelected( sal_Int32
throw lang::IndexOutOfBoundsException();
bool bResult(false);
- if (mpViewShell && mpViewShell->GetViewData())
+ if (mpViewShell)
{
- const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
bResult = rMarkdata.IsColumnMarked((SCCOL)nColumn);
}
return bResult;
@@ -922,7 +922,7 @@ rtl::Reference<ScAccessibleCell> ScAccessibleSpreadsheet::GetAccessibleCellAt(sa
{
if (IsFormulaMode())
{
- ScAddress aCellAddress(static_cast<SCCOL>(nColumn), nRow, mpViewShell->GetViewData()->GetTabNo());
+ ScAddress aCellAddress(static_cast<SCCOL>(nColumn), nRow, mpViewShell->GetViewData().GetTabNo());
if ((aCellAddress == m_aFormulaActiveCell) && m_pAccFormulaCell.is())
{
return m_pAccFormulaCell;
@@ -978,7 +978,7 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleSelected( sal_Int32 nRow,
bool bResult(false);
if (mpViewShell)
{
- const ScMarkData& rMarkdata = mpViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
bResult = rMarkdata.IsCellMarked(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow));
}
return bResult;
@@ -998,9 +998,9 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleAtP
{
SCsCOL nX;
SCsROW nY;
- mpViewShell->GetViewData()->GetPosFromPixel( rPoint.X, rPoint.Y, meSplitPos, nX, nY);
- try{
- xAccessible = getAccessibleCellAt(nY, nX);
+ mpViewShell->GetViewData().GetPosFromPixel( rPoint.X, rPoint.Y, meSplitPos, nX, nY);
+ try {
+ xAccessible = getAccessibleCellAt(nY, nX);
}
catch(const ::com::sun::star::lang::IndexOutOfBoundsException &)
{
@@ -1126,11 +1126,11 @@ void SAL_CALL ScAccessibleSpreadsheet::selectAllAccessibleChildren( )
{
if (IsFormulaMode())
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- mpViewShell->InitRefMode( 0, 0, pViewData->GetTabNo(), SC_REFTYPE_REF );
- pViewData->SetRefStart(0,0,pViewData->GetTabNo());
- pViewData->SetRefEnd(MAXCOL,MAXROW,pViewData->GetTabNo());
- mpViewShell->UpdateRef(MAXCOL, MAXROW, pViewData->GetTabNo());
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ mpViewShell->InitRefMode( 0, 0, rViewData.GetTabNo(), SC_REFTYPE_REF );
+ rViewData.SetRefStart(0, 0, rViewData.GetTabNo());
+ rViewData.SetRefEnd(MAXCOL, MAXROW, rViewData.GetTabNo());
+ mpViewShell->UpdateRef(MAXCOL, MAXROW, rViewData.GetTabNo());
}
else
mpViewShell->SelectAll();
@@ -1155,7 +1155,7 @@ sal_Int32 SAL_CALL
if (!mpMarkedRanges)
{
mpMarkedRanges = new ScRangeList();
- ScMarkData aMarkData(mpViewShell->GetViewData()->GetMarkData());
+ ScMarkData aMarkData(mpViewShell->GetViewData().GetMarkData());
aMarkData.FillRangeListWithMarks(mpMarkedRanges, false);
}
// is possible, because there shouldn't be overlapped ranges in it
@@ -1187,7 +1187,7 @@ uno::Reference<XAccessible > SAL_CALL
if (!mpMarkedRanges)
{
mpMarkedRanges = new ScRangeList();
- mpViewShell->GetViewData()->GetMarkData().FillRangeListWithMarks(mpMarkedRanges, false);
+ mpViewShell->GetViewData().GetMarkData().FillRangeListWithMarks(mpMarkedRanges, false);
}
if (mpMarkedRanges)
{
@@ -1223,14 +1223,14 @@ void SAL_CALL ScAccessibleSpreadsheet::deselectAccessibleChild( sal_Int32 nChild
if (IsFormulaMode())
{
if(IsScAddrFormulaSel(
- ScAddress(static_cast<SCCOL>(nCol), nRow,mpViewShell->GetViewData()->GetTabNo()))
+ ScAddress(static_cast<SCCOL>(nCol), nRow,mpViewShell->GetViewData().GetTabNo()))
)
{
SelectCell(nRow, nCol, true);
}
return ;
}
- if (mpViewShell->GetViewData()->GetMarkData().IsCellMarked(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)))
+ if (mpViewShell->GetViewData().GetMarkData().IsCellMarked(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)))
SelectCell(nRow, nCol, true);
}
}
@@ -1245,10 +1245,10 @@ void ScAccessibleSpreadsheet::SelectCell(sal_Int32 nRow, sal_Int32 nCol, bool bD
}
else
{
- ScViewData *pViewData = mpViewShell->GetViewData();
+ ScViewData& rViewData = mpViewShell->GetViewData();
- mpViewShell->InitRefMode( static_cast<SCCOL>(nCol), nRow, pViewData->GetTabNo(), SC_REFTYPE_REF );
- mpViewShell->UpdateRef(static_cast<SCCOL>(nCol), nRow, pViewData->GetTabNo());
+ mpViewShell->InitRefMode( static_cast<SCCOL>(nCol), nRow, rViewData.GetTabNo(), SC_REFTYPE_REF );
+ mpViewShell->UpdateRef(static_cast<SCCOL>(nCol), nRow, rViewData.GetTabNo());
}
return ;
}
@@ -1400,7 +1400,7 @@ bool ScAccessibleSpreadsheet::IsFocused()
bool bFocused(false);
if (mpViewShell)
{
- if (mpViewShell->GetViewData()->GetActivePart() == meSplitPos)
+ if (mpViewShell->GetViewData().GetActivePart() == meSplitPos)
bFocused = mpViewShell->GetActiveWin()->HasFocus();
}
return bFocused;
@@ -1417,7 +1417,7 @@ bool ScAccessibleSpreadsheet::IsCompleteSheetSelected()
if(mpViewShell)
{
//#103800#; use a copy of MarkData
- ScMarkData aMarkData(mpViewShell->GetViewData()->GetMarkData());
+ ScMarkData aMarkData(mpViewShell->GetViewData().GetMarkData());
aMarkData.MarkToMulti();
if (aMarkData.IsAllMarked(maRange))
bResult = true;
@@ -1429,7 +1429,7 @@ ScDocument* ScAccessibleSpreadsheet::GetDocument(ScTabViewShell* pViewShell)
{
ScDocument* pDoc = NULL;
if (pViewShell)
- pDoc = pViewShell->GetViewData()->GetDocument();
+ pDoc = pViewShell->GetViewData().GetDocument();
return pDoc;
}
@@ -1441,7 +1441,7 @@ Rectangle ScAccessibleSpreadsheet::GetVisArea(ScTabViewShell* pViewShell, ScSpli
Window* pWindow = pViewShell->GetWindowByPos(eSplitPos);
if (pWindow)
{
- aVisArea.SetPos(pViewShell->GetViewData()->GetPixPos(eSplitPos));
+ aVisArea.SetPos(pViewShell->GetViewData().GetPixPos(eSplitPos));
aVisArea.SetSize(pWindow->GetSizePixel());
}
}
@@ -1455,8 +1455,8 @@ Rectangle ScAccessibleSpreadsheet::GetVisCells(const Rectangle& rVisArea)
SCsCOL nStartX, nEndX;
SCsROW nStartY, nEndY;
- mpViewShell->GetViewData()->GetPosFromPixel( 1, 1, meSplitPos, nStartX, nStartY);
- mpViewShell->GetViewData()->GetPosFromPixel( rVisArea.GetWidth(), rVisArea.GetHeight(), meSplitPos, nEndX, nEndY);
+ mpViewShell->GetViewData().GetPosFromPixel( 1, 1, meSplitPos, nStartX, nStartY);
+ mpViewShell->GetViewData().GetPosFromPixel( rVisArea.GetWidth(), rVisArea.GetHeight(), meSplitPos, nEndX, nEndY);
return Rectangle(nStartX, nStartY, nEndX, nEndY);
}
@@ -1558,15 +1558,15 @@ void ScAccessibleSpreadsheet::FireFirstCellFocus()
void ScAccessibleSpreadsheet::NotifyRefMode()
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- if (!pViewData->IsRefMode())
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ if (!rViewData.IsRefMode())
// Not in reference mode. Bail out.
return;
- sal_uInt16 nRefStartX =pViewData->GetRefStartX();
- sal_Int32 nRefStartY=pViewData->GetRefStartY();
- sal_uInt16 nRefEndX=pViewData->GetRefEndX();
- sal_Int32 nRefEndY=pViewData->GetRefEndY();
+ sal_uInt16 nRefStartX = rViewData.GetRefStartX();
+ sal_Int32 nRefStartY = rViewData.GetRefStartY();
+ sal_uInt16 nRefEndX = rViewData.GetRefEndX();
+ sal_Int32 nRefEndY = rViewData.GetRefEndY();
ScAddress aFormulaAddr;
if(!GetFormulaCurrentFocusCell(aFormulaAddr))
{
@@ -1678,7 +1678,7 @@ bool ScAccessibleSpreadsheet::IsScAddrFormulaSel(const ScAddress &addr) const
{
if( addr.Col() >= m_nMinX && addr.Col() <= m_nMaxX &&
addr.Row() >= m_nMinY && addr.Row() <= m_nMaxY &&
- addr.Tab() == mpViewShell->GetViewData()->GetTabNo() )
+ addr.Tab() == mpViewShell->GetViewData().GetTabNo() )
{
return true;
}
@@ -1702,7 +1702,7 @@ ScAddress ScAccessibleSpreadsheet::GetChildIndexAddress(sal_Int32 nIndex) const
return ScAddress(
static_cast<SCCOL>((nIndex - nIndex % nRowAll) / nRowAll + + m_nMinX),
nIndex % nRowAll + m_nMinY,
- mpViewShell->GetViewData()->GetTabNo()
+ mpViewShell->GetViewData().GetTabNo()
);
}
@@ -1719,29 +1719,29 @@ sal_Int32 ScAccessibleSpreadsheet::GetAccessibleIndexFormula( sal_Int32 nRow, sa
bool ScAccessibleSpreadsheet::IsFormulaMode()
{
- ScViewData *pViewData = mpViewShell->GetViewData();
- m_bFormulaMode = pViewData->IsRefMode() || SC_MOD()->IsFormulaMode();
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ m_bFormulaMode = rViewData.IsRefMode() || SC_MOD()->IsFormulaMode();
return m_bFormulaMode ;
}
bool ScAccessibleSpreadsheet::GetFormulaCurrentFocusCell(ScAddress &addr)
{
- ScViewData *pViewData = mpViewShell->GetViewData();
+ ScViewData& rViewData = mpViewShell->GetViewData();
sal_uInt16 nRefX=0;
sal_Int32 nRefY=0;
if(m_bFormulaLastMode)
{
- nRefX=pViewData->GetRefEndX();
- nRefY=pViewData->GetRefEndY();
+ nRefX=rViewData.GetRefEndX();
+ nRefY=rViewData.GetRefEndY();
}
else
{
- nRefX=pViewData->GetRefStartX();
- nRefY=pViewData->GetRefStartY();
+ nRefX=rViewData.GetRefStartX();
+ nRefY=rViewData.GetRefStartY();
}
if( /* Always true: nRefX >= 0 && */ nRefX <= MAXCOL && nRefY >= 0 && nRefY <= MAXROW)
{
- addr = ScAddress(nRefX,nRefY,pViewData->GetTabNo());
+ addr = ScAddress(nRefX,nRefY,rViewData.GetTabNo());
return true;
}
return false;
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 00bb8646f5c9..a1c28d3b07ab 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -94,9 +94,9 @@ Rectangle ScViewForwarder::GetVisArea() const
ScVSplitPos eWhichV = ((meSplitPos == SC_SPLIT_TOPLEFT) || (meSplitPos == SC_SPLIT_TOPRIGHT)) ?
SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
- Point aBaseCellPos(mpViewShell->GetViewData()->GetScrPos(mpViewShell->GetViewData()->GetPosX(eWhichH),
- mpViewShell->GetViewData()->GetPosY(eWhichV), meSplitPos, true));
- Point aCellPos(mpViewShell->GetViewData()->GetScrPos(maCellPos.Col(), maCellPos.Row(), meSplitPos, true));
+ Point aBaseCellPos(mpViewShell->GetViewData().GetScrPos(mpViewShell->GetViewData().GetPosX(eWhichH),
+ mpViewShell->GetViewData().GetPosY(eWhichV), meSplitPos, true));
+ Point aCellPos(mpViewShell->GetViewData().GetScrPos(maCellPos.Col(), maCellPos.Row(), meSplitPos, true));
aVisArea.SetPos(aCellPos - aBaseCellPos);
}
}
@@ -755,25 +755,22 @@ void ScAccessibleCellTextData::GetCellText(const ScAddress& rCellPos, OUString&
{
// #104893#; don't use the input string
// ScCellTextData::GetCellText(rCellPos, rText);
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
+ ScDocument& rDoc = pDocShell->GetDocument();
+ // #104893#; use the displayed string
+ rText = rDoc.GetString(rCellPos.Col(), rCellPos.Row(), rCellPos.Tab());
+ if (mpViewShell)
{
- // #104893#; use the displayed string
- rText = pDoc->GetString(rCellPos.Col(), rCellPos.Row(), rCellPos.Tab());
- if (mpViewShell)
+ const ScViewOptions& aOptions = mpViewShell->GetViewData().GetOptions();
+ CellType aCellType;
+ rDoc.GetCellType(rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), aCellType);
+ if (aCellType == CELLTYPE_FORMULA && aOptions.GetOption( VOPT_FORMULAS ))
{
- const ScViewOptions& aOptions = mpViewShell->GetViewData()->GetOptions();
- CellType aCellType;
- pDoc->GetCellType(rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), aCellType);
- if (aCellType == CELLTYPE_FORMULA && aOptions.GetOption( VOPT_FORMULAS ))
- {
- pDoc->GetFormula( rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), rText);
- }
- else if (!aOptions.GetOption( VOPT_NULLVALS ))
- {
- if ((aCellType == CELLTYPE_VALUE || aCellType == CELLTYPE_FORMULA) && pDoc->GetValue(rCellPos) == 0.0)
- rText = "";
- }
+ rDoc.GetFormula( rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), rText);
+ }
+ else if (!aOptions.GetOption( VOPT_NULLVALS ))
+ {
+ if ((aCellType == CELLTYPE_VALUE || aCellType == CELLTYPE_FORMULA) && rDoc.GetValue(rCellPos) == 0.0)
+ rText = "";
}
}
}
@@ -782,11 +779,11 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
{
ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
- ScDocument* pDoc = ( pDocShell ? pDocShell->GetDocument() : NULL );
- if ( pDoc && pEditEngine && mpViewShell )
+ if ( pDocShell && pEditEngine && mpViewShell )
{
+ ScDocument& rDoc = pDocShell->GetDocument();
long nSizeX, nSizeY;
- mpViewShell->GetViewData()->GetMergeSizePixel(
+ mpViewShell->GetViewData().GetMergeSizePixel(
aCellPos.Col(), aCellPos.Row(), nSizeX, nSizeY);
Size aSize(nSizeX, nSizeY);
@@ -794,12 +791,12 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
// #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
long nIndent = 0;
const SvxHorJustifyItem* pHorJustifyItem = static_cast< const SvxHorJustifyItem* >(
- pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_HOR_JUSTIFY ) );
+ rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_HOR_JUSTIFY ) );
SvxCellHorJustify eHorJust = ( pHorJustifyItem ? static_cast< SvxCellHorJustify >( pHorJustifyItem->GetValue() ) : SVX_HOR_JUSTIFY_STANDARD );
if ( eHorJust == SVX_HOR_JUSTIFY_LEFT )
{
const SfxUInt16Item* pIndentItem = static_cast< const SfxUInt16Item* >(
- pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_INDENT ) );
+ rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_INDENT ) );
if ( pIndentItem )
{
nIndent = static_cast< long >( pIndentItem->GetValue() );
@@ -807,10 +804,10 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
}
const SvxMarginItem* pMarginItem = static_cast< const SvxMarginItem* >(
- pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_MARGIN ) );
- ScViewData* pViewData = mpViewShell->GetViewData();
- double nPPTX = ( pViewData ? pViewData->GetPPTX() : 0 );
- double nPPTY = ( pViewData ? pViewData->GetPPTY() : 0 );
+ rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_MARGIN ) );
+ ScViewData& rViewData = mpViewShell->GetViewData();
+ double nPPTX = rViewData.GetPPTX();
+ double nPPTY = rViewData.GetPPTY();
long nLeftM = ( pMarginItem ? static_cast< long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 );
long nTopM = ( pMarginItem ? static_cast< long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 );
long nRightM = ( pMarginItem ? static_cast< long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 );
@@ -836,7 +833,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
the cell bounding box in ScAccessibleCell::GetBoundingBox()
(see sc/source/ui/Accessibility/AccessibleCell.cxx). */
const SfxInt32Item* pItem = static_cast< const SfxInt32Item* >(
- pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_ROTATE_VALUE ) );
+ rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_ROTATE_VALUE ) );
if( pItem && (pItem->GetValue() != 0) )
{
pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
@@ -847,7 +844,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
{
// #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
const SfxBoolItem* pLineBreakItem = static_cast< const SfxBoolItem* >(
- pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_LINEBREAK ) );
+ rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_LINEBREAK ) );
bool bLineBreak = ( pLineBreakItem && pLineBreakItem->GetValue() );
if ( !bLineBreak )
{
@@ -859,7 +856,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
pEditEngine->SetPaperSize( aSize );
// #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
- if ( eHorJust == SVX_HOR_JUSTIFY_STANDARD && pDoc->HasValueData( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
+ if ( eHorJust == SVX_HOR_JUSTIFY_STANDARD && rDoc.HasValueData( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
{
pEditEngine->SetDefaultItem( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
}
@@ -897,7 +894,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
long nOffsetY = 0;
const SvxVerJustifyItem* pVerJustifyItem = static_cast< const SvxVerJustifyItem* >(
- pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_VER_JUSTIFY ) );
+ rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_VER_JUSTIFY ) );
SvxCellVerJustify eVerJust = ( pVerJustifyItem ? static_cast< SvxCellVerJustify >( pVerJustifyItem->GetValue() ) : SVX_VER_JUSTIFY_STANDARD );
switch ( eVerJust )
{
@@ -962,7 +959,7 @@ ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell)
{
ScDocShell* pDocSh = NULL;
if (pViewShell)
- pDocSh = pViewShell->GetViewData()->GetDocShell();
+ pDocSh = pViewShell->GetViewData().GetDocShell();
return pDocSh;
}
@@ -1310,8 +1307,8 @@ SvxViewForwarder* ScAccessiblePreviewCellTextData::GetViewForwarder()
ScDocShell* ScAccessiblePreviewCellTextData::GetDocShell(ScPreviewShell* pViewShell)
{
ScDocShell* pDocSh = NULL;
- if (pViewShell && pViewShell->GetDocument())
- pDocSh = (ScDocShell*) pViewShell->GetDocument()->GetDocumentShell();
+ if (pViewShell)
+ pDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
return pDocSh;
}
@@ -1363,8 +1360,8 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
{
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pEditEngine = pDoc->CreateFieldEditEngine();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ pEditEngine = rDoc.CreateFieldEditEngine();
}
else
{
@@ -1418,8 +1415,8 @@ SvxViewForwarder* ScAccessiblePreviewHeaderCellTextData::GetViewForwarder()
ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* pViewShell)
{
ScDocShell* pDocSh = NULL;
- if (pViewShell && pViewShell->GetDocument())
- pDocSh = (ScDocShell*) pViewShell->GetDocument()->GetDocumentShell();
+ if (pViewShell)
+ pDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
return pDocSh;
}
@@ -1436,10 +1433,10 @@ ScAccessibleHeaderTextData::ScAccessibleHeaderTextData(ScPreviewShell* pViewShel
mbDataValid(false),
meAdjust(eAdjust)
{
- if (pViewShell && pViewShell->GetDocument())
- mpDocSh = (ScDocShell*) pViewShell->GetDocument()->GetDocumentShell();
+ if (pViewShell)
+ mpDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
if (mpDocSh)
- mpDocSh->GetDocument()->AddUnoObject(*this);
+ mpDocSh->GetDocument().AddUnoObject(*this);
}
ScAccessibleHeaderTextData::~ScAccessibleHeaderTextData()
@@ -1447,7 +1444,7 @@ ScAccessibleHeaderTextData::~ScAccessibleHeaderTextData()
SolarMutexGuard aGuard; // needed for EditEngine dtor
if (mpDocSh)
- mpDocSh->GetDocument()->RemoveUnoObject(*this);
+ mpDocSh->GetDocument().RemoveUnoObject(*this);
if (mpEditEngine)
mpEditEngine->SetNotifyHdl(Link());
delete mpEditEngine;
@@ -1550,10 +1547,10 @@ ScAccessibleNoteTextData::ScAccessibleNoteTextData(ScPreviewShell* pViewShell,
mbMarkNote(bMarkNote),
mbDataValid(false)
{
- if (pViewShell && pViewShell->GetDocument())
- mpDocSh = (ScDocShell*) pViewShell->GetDocument()->GetDocumentShell();
+ if (pViewShell)
+ mpDocSh = (ScDocShell*) pViewShell->GetDocument().GetDocumentShell();
if (mpDocSh)
- mpDocSh->GetDocument()->AddUnoObject(*this);
+ mpDocSh->GetDocument().AddUnoObject(*this);
}
ScAccessibleNoteTextData::~ScAccessibleNoteTextData()
@@ -1561,7 +1558,7 @@ ScAccessibleNoteTextData::~ScAccessibleNoteTextData()
SolarMutexGuard aGuard; // needed for EditEngine dtor
if (mpDocSh)
- mpDocSh->GetDocument()->RemoveUnoObject(*this);
+ mpDocSh->GetDocument().RemoveUnoObject(*this);
if (mpEditEngine)
mpEditEngine->SetNotifyHdl(Link());
delete mpEditEngine;
@@ -1594,8 +1591,8 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
{
if ( mpDocSh )
{
- ScDocument* pDoc = mpDocSh->GetDocument();
- mpEditEngine = pDoc->CreateFieldEditEngine();
+ ScDocument& rDoc = mpDocSh->GetDocument();
+ mpEditEngine = rDoc.CreateFieldEditEngine();
}
else
{
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 089790d626e2..0982b2ed42e7 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -98,7 +98,7 @@ void ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
aLogicRect.SetPos( aOldRect.TopLeft() );
}
- sal_uInt16 nTab = pViewSh->GetViewData()->GetTabNo();
+ sal_uInt16 nTab = pViewSh->GetViewData().GetTabNo();
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
if ( pPage && aLogicRect != aOldRect )
{
@@ -176,7 +176,7 @@ void ScClient::ObjectAreaChanged()
// SfxViewShell* pSfxViewSh = GetViewShell();
// ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
if (pViewSh)
- pViewSh->GetViewData()->GetDocShell()->SetDrawModified();
+ pViewSh->GetViewData().GetDocShell()->SetDrawModified();
}
if (pDrawObj)
@@ -236,7 +236,7 @@ void ScClient::ViewChanged()
pDrawObj->SetLogicRect( aLogicRect );
// set document modified (SdrModel::SetChanged is not used)
- pViewSh->GetViewData()->GetDocShell()->SetDrawModified();
+ pViewSh->GetViewData().GetDocShell()->SetDrawModified();
}
}
}
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 5288b1d7ac5f..426763a9b8b7 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -225,14 +225,11 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
if ( pContainerShell )
{
- ScDocument* pDoc = pContainerShell->GetDocument();
- if ( pDoc )
+ ScDocument& rDoc = pContainerShell->GetDocument();
+ nSourceDocID = rDoc.GetDocumentID();
+ if ( pPage )
{
- nSourceDocID = pDoc->GetDocumentID();
- if ( pPage )
- {
- ScChartHelper::FillProtectedChartRangesVector( m_aProtectedChartRangesVector, pDoc, pPage );
- }
+ ScChartHelper::FillProtectedChartRangesVector( m_aProtectedChartRangesVector, &rDoc, pPage );
}
}
}
@@ -745,10 +742,10 @@ void ScDrawTransferObj::InitDocShell()
pDocSh->DoInitNew(NULL);
- ScDocument* pDestDoc = pDocSh->GetDocument();
- pDestDoc->InitDrawLayer( pDocSh );
+ ScDocument& rDestDoc = pDocSh->GetDocument();
+ rDestDoc.InitDrawLayer( pDocSh );
- SdrModel* pDestModel = pDestDoc->GetDrawLayer();
+ SdrModel* pDestModel = rDestDoc.GetDrawLayer();
// #i71538# use complete SdrViews
// SdrExchangeView aDestView( pDestModel );
SdrView aDestView( pDestModel );
@@ -779,9 +776,9 @@ void ScDrawTransferObj::InitDocShell()
Rectangle aDestArea( aTmpPoint, aSrcSize );
pDocSh->SetVisArea( aDestArea );
- ScViewOptions aViewOpt( pDestDoc->GetViewOptions() );
+ ScViewOptions aViewOpt( rDestDoc.GetViewOptions() );
aViewOpt.SetOption( VOPT_GRID, false );
- pDestDoc->SetViewOptions( aViewOpt );
+ rDestDoc.SetViewOptions( aViewOpt );
ScViewData aViewData( pDocSh, NULL );
aViewData.SetTabNo( 0 );
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index be0220d0fd7f..819e580e733e 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -202,9 +202,9 @@ void removeChars(OUString& rStr, sal_Unicode c)
void ScInputHandler::InitRangeFinder( const OUString& rFormula )
{
DeleteRangeFinder();
- ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- const sal_Unicode cSheetSep = lcl_getSheetSeparator(pDoc);
+ ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ const sal_Unicode cSheetSep = lcl_getSheetSeparator(&rDoc);
if ( !pActiveViewSh || !SC_MOD()->GetInputOptions().GetRangeFinder() )
return;
@@ -250,7 +250,7 @@ handle_r1c1:
// integer. we need to clean up this code.
if( nPos < nLen && nPos > 0 &&
'-' == pChar[nPos] && '[' == pChar[nPos-1] &&
- formula::FormulaGrammar::CONV_XL_R1C1 == pDoc->GetAddressConvention() )
+ formula::FormulaGrammar::CONV_XL_R1C1 == rDoc.GetAddressConvention() )
{
nPos++;
goto handle_r1c1;
@@ -259,13 +259,13 @@ handle_r1c1:
if ( nPos > nStart )
{
OUString aTest = rFormula.copy( nStart, nPos-nStart );
- const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
- sal_uInt16 nFlags = aRange.ParseAny( aTest, pDoc, aAddrDetails );
+ const ScAddress::Details aAddrDetails( &rDoc, aCursorPos );
+ sal_uInt16 nFlags = aRange.ParseAny( aTest, &rDoc, aAddrDetails );
if ( nFlags & SCA_VALID )
{
// Set tables if not specified
if ( (nFlags & SCA_TAB_3D) == 0 )
- aRange.aStart.SetTab( pActiveViewSh->GetViewData()->GetTabNo() );
+ aRange.aStart.SetTab( pActiveViewSh->GetViewData().GetTabNo() );
if ( (nFlags & SCA_TAB2_3D) == 0 )
aRange.aEnd.SetTab( aRange.aStart.Tab() );
@@ -343,7 +343,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
ScRange aJustified = rNew;
aJustified.Justify(); // Always display Ref in the Formula the right way
- ScDocument* pDoc = pDocView->GetViewData()->GetDocument();
+ ScDocument* pDoc = pDocView->GetViewData().GetDocument();
const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
OUString aNewStr(aJustified.Format(pData->nFlags, pDoc, aAddrDetails));
ESelection aOldSel( 0, nOldStart, 0, nOldEnd );
@@ -381,7 +381,7 @@ void ScInputHandler::DeleteRangeFinder()
ScTabViewShell* pPaintView = pRefViewSh ? pRefViewSh : pActiveViewSh;
if ( pRangeFindList && pPaintView )
{
- ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
pRangeFindList->SetHidden(true);
pDocSh->Broadcast( SfxSimpleHint( SC_HINT_SHOWRANGEFINDER ) ); // Steal
DELETEZ(pRangeFindList);
@@ -597,7 +597,7 @@ void ScInputHandler::UpdateRefDevice()
nCtrl &= ~EE_CNTRL_FORMAT100; // when formatting for screen, use the actual MapMode
pEngine->SetControlWord( nCtrl );
if ( bTextWysiwyg && pActiveViewSh )
- pEngine->SetRefDevice( pActiveViewSh->GetViewData()->GetDocument()->GetPrinter() );
+ pEngine->SetRefDevice( pActiveViewSh->GetViewData().GetDocument()->GetPrinter() );
else
pEngine->SetRefDevice( NULL );
@@ -618,8 +618,8 @@ void ScInputHandler::ImplCreateEditEngine()
{
if ( pActiveViewSh )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
- pEngine = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool());
+ ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
+ pEngine = new ScFieldEditEngine(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool());
}
else
pEngine = new ScFieldEditEngine(NULL, EditEngine::CreatePool(), NULL, true);
@@ -653,8 +653,8 @@ void ScInputHandler::UpdateSpellSettings( bool bFromStartTab )
{
if ( pActiveViewSh )
{
- ScViewData* pViewData = pActiveViewSh->GetViewData();
- bool bOnlineSpell = pViewData->GetDocument()->GetDocOptions().IsAutoSpell();
+ ScViewData& rViewData = pActiveViewSh->GetViewData();
+ bool bOnlineSpell = rViewData.GetDocument()->GetDocOptions().IsAutoSpell();
// SetDefaultLanguage is independent of the language attributes,
// ScGlobal::GetEditDefaultLanguage is always used.
@@ -681,10 +681,10 @@ void ScInputHandler::UpdateSpellSettings( bool bFromStartTab )
if ( nCntrl != nOld )
pEngine->SetControlWord(nCntrl);
- ScDocument* pDoc = pViewData->GetDocument();
+ ScDocument* pDoc = rViewData.GetDocument();
pDoc->ApplyAsianEditSettings( *pEngine );
pEngine->SetDefaultHorizontalTextDirection(
- (EEHorizontalTextDirection)pDoc->GetEditTextDirection( pViewData->GetTabNo() ) );
+ (EEHorizontalTextDirection)pDoc->GetEditTextDirection( rViewData.GetTabNo() ) );
pEngine->SetFirstWordCapitalization( false );
}
@@ -711,7 +711,7 @@ void ScInputHandler::GetFormulaData()
{
if ( pActiveViewSh )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
+ ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
if ( pFormulaData )
pFormulaData->clear();
@@ -749,8 +749,8 @@ void ScInputHandler::GetFormulaData()
}
}
miAutoPosFormula = pFormulaData->end();
- pDoc->GetFormulaEntries( *pFormulaData );
- pDoc->GetFormulaEntries( *pFormulaDataPara );
+ rDoc.GetFormulaEntries( *pFormulaData );
+ rDoc.GetFormulaEntries( *pFormulaDataPara );
}
}
@@ -796,9 +796,9 @@ void ScInputHandler::HideTipBelow()
void ScInputHandler::ShowArgumentsTip( const OUString& rParagraph, OUString& rSelText, const ESelection& rSel,
bool bTryFirstSel )
{
- ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
- const sal_Unicode cSheetSep = lcl_getSheetSeparator(pDocSh->GetDocument());
+ const sal_Unicode cSheetSep = lcl_getSheetSeparator(&pDocSh->GetDocument());
FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
bool bFound = false;
while( !bFound )
@@ -1272,8 +1272,8 @@ void ScInputHandler::FormulaPreview()
OUString aPart = pActiveView->GetSelected();
if (aPart.isEmpty())
aPart = pEngine->GetText(0);
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
- aValue = lcl_Calculate( aPart, pDoc, aCursorPos );
+ ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
+ aValue = lcl_Calculate( aPart, &rDoc, aCursorPos );
}
if (!aValue.isEmpty())
@@ -1404,7 +1404,7 @@ void ScInputHandler::GetColData()
{
if ( pActiveViewSh )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
+ ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
if ( pColumnData )
pColumnData->clear();
@@ -1412,7 +1412,7 @@ void ScInputHandler::GetColData()
pColumnData = new ScTypedCaseStrSet;
std::vector<ScTypedStrData> aEntries;
- pDoc->GetDataEntries(
+ rDoc.GetDataEntries(
aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, aEntries, true);
if (!aEntries.empty())
pColumnData->insert(aEntries.begin(), aEntries.end());
@@ -1661,7 +1661,7 @@ void ScInputHandler::UpdateActiveView()
// panes of a split view.
Window* pShellWin = pActiveViewSh ?
- pActiveViewSh->GetWindowByPos( pActiveViewSh->GetViewData()->GetEditActivePart() ) :
+ pActiveViewSh->GetWindowByPos( pActiveViewSh->GetViewData().GetEditActivePart() ) :
NULL;
sal_uInt16 nCount = pEngine->GetViewCount();
@@ -1720,8 +1720,8 @@ void ScInputHandler::UpdateAdjust( sal_Unicode cTyped )
bNumber = (cTyped>='0' && cTyped<='9'); // Ony ciphers are numbers
else if ( pActiveViewSh )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
- bNumber = ( pDoc->GetCellType( aCursorPos ) == CELLTYPE_VALUE );
+ ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
+ bNumber = ( rDoc.GetCellType( aCursorPos ) == CELLTYPE_VALUE );
}
eSvxAdjust = bNumber ? SVX_ADJUST_RIGHT : SVX_ADJUST_LEFT;
}
@@ -1801,15 +1801,15 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
UpdateActiveView();
SyncViews();
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
+ ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument();
- const ScMarkData& rMark = pActiveViewSh->GetViewData()->GetMarkData();
+ const ScMarkData& rMark = pActiveViewSh->GetViewData().GetMarkData();
ScEditableTester aTester;
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
- aTester.TestSelection( pDoc, rMark );
+ aTester.TestSelection( &rDoc, rMark );
else
aTester.TestSelectedBlock(
- pDoc, aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Col(), aCursorPos.Row(), rMark );
+ &rDoc, aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Col(), aCursorPos.Row(), rMark );
bool bStartInputMode = true;
@@ -1821,7 +1821,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
// activation is requested (double-click or F2) or a click in input
// line.
bool bShowError = (!bInputActivated || aTester.GetMessageId() != STR_PROTECTIONERR) &&
- !pActiveViewSh->GetViewData()->GetDocShell()->IsReadOnly();
+ !pActiveViewSh->GetViewData().GetDocShell()->IsReadOnly();
if (bShowError)
{
eMode = SC_INPUT_NONE;
@@ -1849,7 +1849,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
pEngine->SetUpdateMode( false );
// Take over attributes in EditEngine
- const ScPatternAttr* pPattern = pDoc->GetPattern( aCursorPos.Col(),
+ const ScPatternAttr* pPattern = rDoc.GetPattern( aCursorPos.Col(),
aCursorPos.Row(),
aCursorPos.Tab() );
if (pPattern != pLastPattern)
@@ -1862,7 +1862,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
{
sal_uLong nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
bCellHasPercentFormat = ( NUMBERFORMAT_PERCENT ==
- pDoc->GetFormatTable()->GetType( nFormat ) );
+ rDoc.GetFormatTable()->GetType( nFormat ) );
}
else
bCellHasPercentFormat = false; // Default: no percent
@@ -2033,7 +2033,7 @@ IMPL_LINK_NOARG(ScInputHandler, ModifyHdl)
bool ScInputHandler::DataChanging( sal_Unicode cTyped, bool bFromCommand )
{
if (pActiveViewSh)
- pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
+ pActiveViewSh->GetViewData().SetPasteMode( SC_PASTE_NONE );
bInOwnChange = true; // disable ModifyHdl (reset in DataChanged)
if ( eMode == SC_INPUT_NONE )
@@ -2094,7 +2094,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified )
EditView* pActiveView = pTopView ? pTopView : pTableView;
if (pActiveView && pActiveViewSh)
{
- ScViewData* pViewData = pActiveViewSh->GetViewData();
+ ScViewData& rViewData = pActiveViewSh->GetViewData();
bool bNeedGrow = ( nEditAdjust != SVX_ADJUST_LEFT ); // Always right-aligned
if (!bNeedGrow)
@@ -2106,13 +2106,13 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified )
}
if (!bNeedGrow)
{
- bNeedGrow = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+ bNeedGrow = rViewData.GetDocument()->IsLayoutRTL( rViewData.GetTabNo() );
}
if (bNeedGrow)
{
// Adjust inplace view
- pViewData->EditGrowY();
- pViewData->EditGrowX();
+ rViewData.EditGrowY();
+ rViewData.EditGrowX();
}
}
@@ -2266,7 +2266,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const OUString* pInitText )
if (eNewMode != SC_INPUT_NONE && pActiveViewSh)
// Disable paste mode when edit mode starts.
- pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
+ pActiveViewSh->GetViewData().SetPasteMode( SC_PASTE_NONE );
bInOwnChange = true; // disable ModifyHdl (reset below)
@@ -2282,7 +2282,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const OUString* pInitText )
if (StartTable(0, false, eMode == SC_INPUT_TABLE))
{
if (pActiveViewSh)
- pActiveViewSh->GetViewData()->GetDocShell()->PostEditView( pEngine, aCursorPos );
+ pActiveViewSh->GetViewData().GetDocShell()->PostEditView( pEngine, aCursorPos );
}
}
@@ -2399,7 +2399,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
// Test if valid (always with simple string)
if ( bModified && nValidation && pActiveViewSh )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pActiveViewSh->GetViewData().GetDocument();
const ScValidationData* pData = pDoc->GetValidationEntry( nValidation );
if (pData && pData->HasErrMsg())
{
@@ -2423,7 +2423,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
// Check for input into DataPilot table
if ( bModified && pActiveViewSh && !bForget )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pActiveViewSh->GetViewData().GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab() );
if ( pDPObj )
{
@@ -2443,7 +2443,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
// it still has to be treated as number, not EditEngine object.
if ( pActiveViewSh )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pActiveViewSh->GetViewData().GetDocument();
// #i67990# don't use pLastPattern in EnterHandler
const ScPatternAttr* pPattern = pDoc->GetPattern( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab() );
if (pPattern)
@@ -2508,7 +2508,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
if ( pCommonAttrs )
{
- ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pActiveViewSh->GetViewData().GetDocument();
pCellAttrs = new ScPatternAttr( pDoc->GetPool() );
pCellAttrs->GetFromEditItemSet( pCommonAttrs );
delete pCommonAttrs;
@@ -2752,7 +2752,7 @@ bool ScInputHandler::IsModalMode( SfxObjectShell* pDocSh )
{
// References to unnamed document; that doesn't work
return bFormulaMode && pRefViewSh
- && pRefViewSh->GetViewData()->GetDocument()->GetDocumentShell() != pDocSh
+ && pRefViewSh->GetViewData().GetDocument()->GetDocumentShell() != pDocSh
&& !pDocSh->HasName();
}
@@ -2779,7 +2779,7 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
HideTip();
bool bOtherDoc = ( pRefViewSh &&
- pRefViewSh->GetViewData()->GetDocument() != pDoc );
+ pRefViewSh->GetViewData().GetDocument() != pDoc );
if (bOtherDoc)
if (!pDoc->GetDocumentShell()->HasName())
{
@@ -3075,7 +3075,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
if (bNewView ) // Create anew
{
if (pActiveViewSh)
- pActiveViewSh->GetViewData()->GetDocShell()->PostEditView( pEngine, aCursorPos );
+ pActiveViewSh->GetViewData().GetDocShell()->PostEditView( pEngine, aCursorPos );
UpdateActiveView();
if (eMode==SC_INPUT_NONE)
if (pTableView || pTopView)
@@ -3248,7 +3248,7 @@ bool ScInputHandler::InputCommand( const CommandEvent& rCEvt, bool bForce )
if (bNewView) // create new edit view
{
if (pActiveViewSh)
- pActiveViewSh->GetViewData()->GetDocShell()->PostEditView( pEngine, aCursorPos );
+ pActiveViewSh->GetViewData().GetDocShell()->PostEditView( pEngine, aCursorPos );
UpdateActiveView();
if (eMode==SC_INPUT_NONE)
if (pTableView || pTopView)
@@ -3371,8 +3371,8 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
const EditTextObject* pData = pState->GetEditData();
OUString aString = pState->GetString();
bool bTxtMod = false;
- ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
aCursorPos = pState->GetPos();
@@ -3411,12 +3411,12 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( pInputWin ) // Named range input
{
OUString aPosStr;
- const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
+ const ScAddress::Details aAddrDetails( &rDoc, aCursorPos );
// Is the range a name?
//! Find by Timer?
if ( pActiveViewSh )
- pActiveViewSh->GetViewData()->GetDocument()->
+ pActiveViewSh->GetViewData().GetDocument()->
GetRangeAtBlock( ScRange( rSPos, rEPos ), &aPosStr );
if ( aPosStr.isEmpty() ) // Not a name -> format
@@ -3428,10 +3428,10 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
{
ScRange r(rSPos, rEPos);
nFlags |= (nFlags << 4);
- aPosStr = r.Format(SCA_VALID | nFlags, pDoc, aAddrDetails);
+ aPosStr = r.Format(SCA_VALID | nFlags, &rDoc, aAddrDetails);
}
else
- aPosStr = aCursorPos.Format(SCA_VALID | nFlags, pDoc, aAddrDetails);
+ aPosStr = aCursorPos.Format(SCA_VALID | nFlags, &rDoc, aAddrDetails);
}
// Disable the accessible VALUE_CHANGE event
@@ -3587,12 +3587,12 @@ void ScInputHandler::InputChanged( EditView* pView, bool bFromNotify )
if ( pActiveViewSh )
{
- ScViewData* pViewData = pActiveViewSh->GetViewData();
+ ScViewData& rViewData = pActiveViewSh->GetViewData();
if ( bNewView )
- pViewData->GetDocShell()->PostEditView( pEngine, aCursorPos );
+ rViewData.GetDocShell()->PostEditView( pEngine, aCursorPos );
- pViewData->EditGrowY();
- pViewData->EditGrowX();
+ rViewData.EditGrowY();
+ rViewData.EditGrowX();
}
SyncViews( pView );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index c2ca1f7e8351..12fd5728b3ae 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -310,7 +310,7 @@ bool ScInputWindow::UseSubTotal(ScRangeList* pRangeList) const
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
if ( pViewSh )
{
- ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
size_t nRangeCount (pRangeList->size());
size_t nRangeIndex (0);
while (!bSubTotal && nRangeIndex < nRangeCount)
@@ -402,12 +402,12 @@ void ScInputWindow::Select()
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
if ( pViewSh )
{
- const ScMarkData& rMark = pViewSh->GetViewData()->GetMarkData();
+ const ScMarkData& rMark = pViewSh->GetViewData().GetMarkData();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
ScRangeList aMarkRangeList;
rMark.FillRangeListWithMarks( &aMarkRangeList, false );
- ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
// check if one of the marked ranges is empty
bool bEmpty = false;
@@ -464,7 +464,7 @@ void ScInputWindow::Select()
ScRangeList aRangeList;
const bool bDataFound = pViewSh->GetAutoSumArea( aRangeList );
const bool bSubTotal( UseSubTotal( &aRangeList ) );
- ScAddress aAddr = pViewSh->GetViewData()->GetCurPos();
+ ScAddress aAddr = pViewSh->GetViewData().GetCurPos();
const OUString aFormula = pViewSh->GetAutoSumFormula( aRangeList, bSubTotal, aAddr );
SetFuncString( aFormula );
@@ -515,8 +515,8 @@ void ScInputWindow::Select()
const OUString& rString = aTextWindow.GetTextString();
const sal_Int32 nLen = rString.getLength();
- ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
- CellType eCellType = pDoc->GetCellType( pViewSh->GetViewData()->GetCurPos() );
+ ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
+ CellType eCellType = pDoc->GetCellType( pViewSh->GetViewData().GetCurPos() );
switch ( eCellType )
{
case CELLTYPE_VALUE:
@@ -1357,8 +1357,8 @@ void ScMultiTextWnd::InitEditEngine()
ScDocShell* pDocSh = NULL;
if ( pViewSh )
{
- pDocSh = pViewSh->GetViewData()->GetDocShell();
- ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
+ pDocSh = pViewSh->GetViewData().GetDocShell();
+ ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool());
}
else
@@ -1424,8 +1424,8 @@ void ScMultiTextWnd::InitEditEngine()
// repaint now to have the EditEngine's version visible
if (pDocSh)
{
- ScDocument* pDoc = pDocSh->GetDocument(); // any document
- sal_uInt8 nScript = pDoc->GetStringScriptType( aString );
+ ScDocument& rDoc = pDocSh->GetDocument(); // any document
+ sal_uInt8 nScript = rDoc.GetStringScriptType( aString );
if ( nScript & SCRIPTTYPE_COMPLEX )
Invalidate();
}
@@ -1609,12 +1609,12 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
ScTabViewShell* pEndViewSh = ScTabViewShell::GetActiveViewShell();
if ( pEndViewSh != pStartViewSh && pStartViewSh != NULL )
{
- ScViewData* pViewData = pStartViewSh->GetViewData();
+ ScViewData& rViewData = pStartViewSh->GetViewData();
ScInputHandler* pHdl = pScMod->GetInputHdl( pStartViewSh );
- if ( pHdl && pViewData->HasEditView( pViewData->GetActivePart() ) )
+ if ( pHdl && rViewData.HasEditView( rViewData.GetActivePart() ) )
{
pHdl->CancelHandler();
- pViewData->GetView()->ShowCursor(); // Missing for KillEditView, due to being inactive
+ rViewData.GetView()->ShowCursor(); // Missing for KillEditView, due to being inactive
}
}
}
@@ -1734,7 +1734,7 @@ void ScTextWnd::StartEditEngine()
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
{
- ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool());
}
else
@@ -1800,8 +1800,8 @@ void ScTextWnd::StartEditEngine()
// SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && pObjSh->ISA(ScDocShell) )
{
- ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
- sal_uInt8 nScript = pDoc->GetStringScriptType( aString );
+ ScDocument& rDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
+ sal_uInt8 nScript = rDoc.GetStringScriptType( aString );
if ( nScript & SCRIPTTYPE_COMPLEX )
Invalidate();
}
@@ -1900,9 +1900,9 @@ void ScTextWnd::SetTextString( const OUString& rNewString )
if ( pObjSh && pObjSh->ISA(ScDocShell) )
{
// any document can be used (used only for its break iterator)
- ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
- nOldScript = pDoc->GetStringScriptType( aString );
- nNewScript = pDoc->GetStringScriptType( rNewString );
+ ScDocument& rDoc = ((ScDocShell*)pObjSh)->GetDocument();
+ nOldScript = rDoc.GetStringScriptType( aString );
+ nNewScript = rDoc.GetStringScriptType( rNewString );
}
bPaintAll = ( nOldScript & SCRIPTTYPE_COMPLEX ) || ( nNewScript & SCRIPTTYPE_COMPLEX );
}
@@ -1978,7 +1978,7 @@ void ScTextWnd::MakeDialogEditView()
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
{
- ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
+ ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool());
}
else
@@ -2139,14 +2139,14 @@ void ScPosWnd::FillRangeNames()
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && pObjSh->ISA(ScDocShell) )
{
- ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
+ ScDocument& rDoc = ((ScDocShell*)pObjSh)->GetDocument();
InsertEntry(ScGlobal::GetRscString( STR_MANAGE_NAMES ));
SetSeparatorPos(0);
ScRange aDummy;
std::set<OUString> aSet;
- ScRangeName* pRangeNames = pDoc->GetRangeName();
+ ScRangeName* pRangeNames = rDoc.GetRangeName();
if (!pRangeNames->empty())
{
ScRangeName::const_iterator itrBeg = pRangeNames->begin(), itrEnd = pRangeNames->end();
@@ -2156,13 +2156,13 @@ void ScPosWnd::FillRangeNames()
aSet.insert(itr->second->GetName());
}
}
- for (SCTAB i = 0; i < pDoc->GetTableCount(); ++i)
+ for (SCTAB i = 0; i < rDoc.GetTableCount(); ++i)
{
- ScRangeName* pLocalRangeName = pDoc->GetRangeName(i);
+ ScRangeName* pLocalRangeName = rDoc.GetRangeName(i);
if (pLocalRangeName && !pLocalRangeName->empty())
{
OUString aTableName;
- pDoc->GetName(i, aTableName);
+ rDoc.GetName(i, aTableName);
for (ScRangeName::const_iterator itr = pLocalRangeName->begin(); itr != pLocalRangeName->end(); ++itr)
{
if (itr->second->IsValidReference(aDummy))
@@ -2256,9 +2256,9 @@ static ScNameInputType lcl_GetInputType( const OUString& rText )
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- SCTAB nTab = pViewData->GetTabNo();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ SCTAB nTab = rViewData.GetTabNo();
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
// test in same order as in SID_CURRENTCELL execute
@@ -2286,7 +2286,7 @@ static ScNameInputType lcl_GetInputType( const OUString& rText )
eRet = SC_NAME_INPUT_SHEET;
else if ( ScRangeData::IsNameValid( rText, pDoc ) ) // nothing found, create new range?
{
- if ( pViewData->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ if ( rViewData.GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
eRet = SC_NAME_INPUT_DEFINE;
else
eRet = SC_NAME_INPUT_BAD_SELECTION;
@@ -2401,9 +2401,9 @@ void ScPosWnd::DoEnter()
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocShell* pDocShell = pViewData->GetDocShell();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocShell* pDocShell = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScNameInputType eType = lcl_GetInputType( aText );
if ( eType == SC_NAME_INPUT_BAD_NAME || eType == SC_NAME_INPUT_BAD_SELECTION )
@@ -2413,15 +2413,15 @@ void ScPosWnd::DoEnter()
}
else if ( eType == SC_NAME_INPUT_DEFINE )
{
- ScRangeName* pNames = pDoc->GetRangeName();
+ ScRangeName* pNames = rDoc.GetRangeName();
ScRange aSelection;
if ( pNames && !pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aText)) &&
- (pViewData->GetSimpleArea( aSelection ) == SC_MARK_SIMPLE) )
+ (rViewData.GetSimpleArea( aSelection ) == SC_MARK_SIMPLE) )
{
ScRangeName aNewRanges( *pNames );
- ScAddress aCursor( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() );
- OUString aContent(aSelection.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
- ScRangeData* pNew = new ScRangeData( pDoc, aText, aContent, aCursor );
+ ScAddress aCursor( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() );
+ OUString aContent(aSelection.Format(SCR_ABS_3D, &rDoc, rDoc.GetAddressConvention()));
+ ScRangeData* pNew = new ScRangeData( &rDoc, aText, aContent, aCursor );
if ( aNewRanges.insert(pNew) )
{
pDocShell->GetDocFunc().ModifyRangeNames( aNewRanges );
@@ -2444,15 +2444,15 @@ void ScPosWnd::DoEnter()
{
// Note that SID_CURRENTCELL always expects address to
// be in Calc A1 format. Convert the text.
- ScRange aRange(0,0,pViewData->GetTabNo());
- aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention());
- aText = aRange.Format(SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO);
+ ScRange aRange(0,0, rViewData.GetTabNo());
+ aRange.ParseAny(aText, &rDoc, rDoc.GetAddressConvention());
+ aText = aRange.Format(SCR_ABS_3D, &rDoc, ::formula::FormulaGrammar::CONV_OOO);
}
SfxStringItem aPosItem( SID_CURRENTCELL, aText );
SfxBoolItem aUnmarkItem( FN_PARAM_1, true ); // remove existing selection
- pViewSh->GetViewData()->GetDispatcher().Execute( SID_CURRENTCELL,
+ pViewSh->GetViewData().GetDispatcher().Execute( SID_CURRENTCELL,
SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD,
&aPosItem, &aUnmarkItem, 0L );
}
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index b070c3697f7e..cfaa93ca15a5 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -234,9 +234,9 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
{
ScDocShell* pDocSh = ((ScDocShell*)pObjSh);
if ( bArrows )
- ScDetectiveFunc( pDocSh->GetDocument(), 0 ).UpdateAllArrowColors();
+ ScDetectiveFunc( &pDocSh->GetDocument(), 0 ).UpdateAllArrowColors();
if ( bComments )
- ScDetectiveFunc::UpdateAllComments( *pDocSh->GetDocument() );
+ ScDetectiveFunc::UpdateAllComments( pDocSh->GetDocument() );
}
pObjSh = SfxObjectShell::GetNext( *pObjSh );
}
@@ -283,7 +283,7 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
pDocSh->CalcOutputFactor();
- SCTAB nTabCount = pDocSh->GetDocument()->GetTableCount();
+ SCTAB nTabCount = pDocSh->GetDocument().GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
pDocSh->AdjustRowHeight( 0, MAXROW, nTab );
}
@@ -400,7 +400,7 @@ void ScModule::Execute( SfxRequest& rReq )
{ // Toggle
ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
if ( pDocSh )
- bSet = !pDocSh->GetDocument()->GetDocOptions().IsAutoSpell();
+ bSet = !pDocSh->GetDocument().GetDocOptions().IsAutoSpell();
else
bSet = !GetDocOptions().IsAutoSpell();
}
@@ -502,12 +502,12 @@ void ScModule::Execute( SfxRequest& rReq )
if ( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( GetPool().GetWhich(nSlot), true, &pItem ) )
{
ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
- ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
- if ( pDoc )
+ if ( pDocSh )
{
+ ScDocument& rDoc = pDocSh->GetDocument();
LanguageType eNewLang = ((SvxLanguageItem*)pItem)->GetLanguage();
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
LanguageType eOld = ( nSlot == SID_ATTR_CHAR_CJK_LANGUAGE ) ? eCjk :
( ( nSlot == SID_ATTR_CHAR_CTL_LANGUAGE ) ? eCtl : eLatin );
if ( eNewLang != eOld )
@@ -519,7 +519,7 @@ void ScModule::Execute( SfxRequest& rReq )
else
eLatin = eNewLang;
- pDoc->SetLanguage( eLatin, eCjk, eCtl );
+ rDoc.SetLanguage( eLatin, eCjk, eCtl );
ScInputHandler* pInputHandler = GetInputHdl();
if ( pInputHandler )
@@ -598,21 +598,17 @@ void ScModule::GetState( SfxItemSet& rSet )
rSet.Put( SfxUInt16Item( nWhich, sal::static_int_cast<sal_uInt16>(GetAppOptions().GetAppMetric()) ) );
break;
case SID_AUTOSPELL_CHECK:
- rSet.Put( SfxBoolItem( nWhich, pDocSh->GetDocument()->GetDocOptions().IsAutoSpell()) );
+ rSet.Put( SfxBoolItem( nWhich, pDocSh->GetDocument().GetDocOptions().IsAutoSpell()) );
break;
case SID_ATTR_LANGUAGE:
case ATTR_CJK_FONT_LANGUAGE: // WID for SID_ATTR_CHAR_CJK_LANGUAGE
case ATTR_CTL_FONT_LANGUAGE: // WID for SID_ATTR_CHAR_CTL_LANGUAGE
{
- ScDocument* pDoc = pDocSh->GetDocument();
- if ( pDoc )
- {
- LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
- LanguageType eLang = ( nWhich == ATTR_CJK_FONT_LANGUAGE ) ? eCjk :
- ( ( nWhich == ATTR_CTL_FONT_LANGUAGE ) ? eCtl : eLatin );
- rSet.Put( SvxLanguageItem( eLang, nWhich ) );
- }
+ LanguageType eLatin, eCjk, eCtl;
+ pDocSh->GetDocument().GetLanguage( eLatin, eCjk, eCtl );
+ LanguageType eLang = ( nWhich == ATTR_CJK_FONT_LANGUAGE ) ? eCjk :
+ ( ( nWhich == ATTR_CTL_FONT_LANGUAGE ) ? eCtl : eLatin );
+ rSet.Put( SvxLanguageItem( eLang, nWhich ) );
}
break;
}
@@ -971,7 +967,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
- ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
+ ScDocument* pDoc = pDocSh ? &pDocSh->GetDocument() : NULL;
const SfxPoolItem* pItem = NULL;
bool bRepaint = false;
bool bUpdateMarks = false;
@@ -1062,16 +1058,16 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
if ( pViewSh )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- const ScViewOptions& rOldOpt = pViewData->GetOptions();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ const ScViewOptions& rOldOpt = rViewData.GetOptions();
bool bAnchorList = ( rOldOpt.GetOption( VOPT_ANCHOR ) !=
rNewOpt.GetOption( VOPT_ANCHOR ) );
if ( rOldOpt != rNewOpt )
{
- pViewData->SetOptions( rNewOpt ); // Changes rOldOpt
- pViewData->GetDocument()->SetViewOptions( rNewOpt );
+ rViewData.SetOptions( rNewOpt ); // Changes rOldOpt
+ rViewData.GetDocument()->SetViewOptions( rNewOpt );
if (pDocSh)
pDocSh->SetDocumentModified();
bRepaint = true;
@@ -1095,15 +1091,15 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
if ( pViewSh )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- ScViewOptions aNewViewOpt( pViewData->GetOptions() );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScViewOptions aNewViewOpt( rViewData.GetOptions() );
const ScGridOptions& rOldGridOpt = aNewViewOpt.GetGridOptions();
if ( rOldGridOpt != aNewGridOpt )
{
aNewViewOpt.SetGridOptions( aNewGridOpt );
- pViewData->SetOptions( aNewViewOpt );
- pViewData->GetDocument()->SetViewOptions( aNewViewOpt );
+ rViewData.SetOptions( aNewViewOpt );
+ rViewData.GetDocument()->SetViewOptions( aNewViewOpt );
pDocSh->SetDocumentModified();
bRepaint = true;
}
@@ -1329,7 +1325,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
{
ScDocShell* pOneDocSh = ((ScDocShell*)pObjSh);
pOneDocSh->CalcOutputFactor();
- SCTAB nTabCount = pOneDocSh->GetDocument()->GetTableCount();
+ SCTAB nTabCount = pOneDocSh->GetDocument().GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
pOneDocSh->AdjustRowHeight( 0, MAXROW, nTab );
}
@@ -1349,8 +1345,8 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
pHdl->UpdateRefDevice();
// update view scale
- ScViewData* pViewData = pOneViewSh->GetViewData();
- pOneViewSh->SetZoom( pViewData->GetZoomX(), pViewData->GetZoomY(), false );
+ ScViewData& rViewData = pOneViewSh->GetViewData();
+ pOneViewSh->SetZoom( rViewData.GetZoomX(), rViewData.GetZoomY(), false );
// repaint
pOneViewSh->PaintGrid();
@@ -1893,14 +1889,14 @@ IMPL_LINK_NOARG(ScModule, IdleHandler)
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
- bAutoSpell = pDoc->GetDocOptions().IsAutoSpell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bAutoSpell = rDoc.GetDocOptions().IsAutoSpell();
if (pDocSh->IsReadOnly())
bAutoSpell = false;
- sc::DocumentLinkManager& rLinkMgr = pDoc->GetDocLinkManager();
+ sc::DocumentLinkManager& rLinkMgr = rDoc.GetDocLinkManager();
bool bLinks = rLinkMgr.idleCheckLinks();
- bool bWidth = pDoc->IdleCalcTextWidth();
+ bool bWidth = rDoc.IdleCalcTextWidth();
bMore = bLinks || bWidth; // Still something at all?
@@ -2008,13 +2004,13 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId )
ScDocShell* pDocSh = PTR_CAST(ScDocShell,
SfxObjectShell::Current());
ScDocOptions aCalcOpt = pDocSh
- ? pDocSh->GetDocument()->GetDocOptions()
+ ? pDocSh->GetDocument().GetDocOptions()
: GetDocOptions();
ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,
SfxViewShell::Current());
ScViewOptions aViewOpt = pViewSh
- ? pViewSh->GetViewData()->GetOptions()
+ ? pViewSh->GetViewData().GetOptions()
: GetViewOptions();
ScUserListItem aULItem( SCITEM_USERLIST );
@@ -2085,7 +2081,7 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId )
if (pDocSh)
{
ScCalcConfig aConfig( aOptions.GetCalcConfig());
- aConfig.MergeDocumentSpecific( pDocSh->GetDocument()->GetCalcConfig());
+ aConfig.MergeDocumentSpecific( pDocSh->GetDocument().GetCalcConfig());
aOptions.SetCalcConfig( aConfig);
}
pRet->Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, aOptions ) );
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 2008695ecf53..04c32072217d 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -111,14 +111,14 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView
if ( eMode == SC_SELTRANS_INVALID ) // no drawing object selected
{
ScRange aRange;
- ScViewData* pViewData = pView->GetViewData();
- const ScMarkData& rMark = pViewData->GetMarkData();
+ ScViewData& rViewData = pView->GetViewData();
+ const ScMarkData& rMark = rViewData.GetMarkData();
// allow MultiMarked because GetSimpleArea may be able to merge into a simple range
// (GetSimpleArea modifies a local copy of MarkData)
// Also allow simple filtered area.
ScMarkType eMarkType;
if ( ( rMark.IsMarked() || rMark.IsMultiMarked() ) &&
- (((eMarkType = pViewData->GetSimpleArea( aRange )) == SC_MARK_SIMPLE) ||
+ (((eMarkType = rViewData.GetSimpleArea( aRange )) == SC_MARK_SIMPLE) ||
(eMarkType == SC_MARK_SIMPLE_FILTERED)) )
{
// only for "real" selection, cursor alone isn't used
@@ -269,19 +269,19 @@ void ScSelectionTransferObj::CreateCellData()
OSL_ENSURE( !pCellData, "CreateCellData twice" );
if ( pView )
{
- ScViewData* pViewData = pView->GetViewData();
- ScMarkData aNewMark( pViewData->GetMarkData() ); // use local copy for MarkToSimple
+ ScViewData& rViewData = pView->GetViewData();
+ ScMarkData aNewMark( rViewData.GetMarkData() ); // use local copy for MarkToSimple
aNewMark.MarkToSimple();
// similar to ScViewFunctionSet::BeginDrag
if ( aNewMark.IsMarked() && !aNewMark.IsMultiMarked() )
{
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
ScRange aSelRange;
aNewMark.GetMarkArea( aSelRange );
ScDocShellRef aDragShellRef;
- if ( pDocSh->GetDocument()->HasOLEObjectsInArea( aSelRange, &aNewMark ) )
+ if ( pDocSh->GetDocument().HasOLEObjectsInArea( aSelRange, &aNewMark ) )
{
aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately
aDragShellRef->DoInitNew(NULL);
@@ -292,7 +292,7 @@ void ScSelectionTransferObj::CreateCellData()
// bApi = sal_True -> no error messages
// #i18364# bStopEdit = sal_False -> don't end edit mode
// (this may be called from pasting into the edit line)
- bool bCopied = pViewData->GetView()->CopyToClip( pClipDoc, false, true, true, false );
+ bool bCopied = rViewData.GetView()->CopyToClip( pClipDoc, false, true, true, false );
ScDrawLayer::SetGlobalDrawPersist(NULL);
@@ -351,8 +351,8 @@ void ScSelectionTransferObj::CreateDrawData()
SdrModel* pModel = pDrawView->GetMarkedObjModel();
ScDrawLayer::SetGlobalDrawPersist(NULL);
- ScViewData* pViewData = pView->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = pView->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
TransferableObjectDescriptor aObjDesc;
pDocSh->FillTransferableObjectDescriptor( aObjDesc );
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 1d3bb94e2906..f0c6c73e20bf 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -555,7 +555,7 @@ ScDocument* ScTransferObj::GetSourceDocument()
{
ScDocShell* pSourceDocSh = GetSourceDocShell();
if (pSourceDocSh)
- return pSourceDocSh->GetDocument();
+ return &pSourceDocSh->GetDocument();
return NULL;
}
@@ -595,17 +595,17 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
pDocSh->DoInitNew(NULL);
- ScDocument* pDestDoc = pDocSh->GetDocument();
+ ScDocument& rDestDoc = pDocSh->GetDocument();
ScMarkData aDestMark;
aDestMark.SelectTable( 0, true );
- pDestDoc->SetDocOptions( pDoc->GetDocOptions() ); // #i42666#
+ rDestDoc.SetDocOptions( pDoc->GetDocOptions() ); // #i42666#
OUString aTabName;
pDoc->GetName( aBlock.aStart.Tab(), aTabName );
- pDestDoc->RenameTab( 0, aTabName, false ); // no UpdateRef (empty)
+ rDestDoc.RenameTab( 0, aTabName, false ); // no UpdateRef (empty)
- pDestDoc->CopyStdStylesFrom( pDoc );
+ rDestDoc.CopyStdStylesFrom( pDoc );
SCCOL nStartX = aBlock.aStart.Col();
SCROW nStartY = aBlock.aStart.Row();
@@ -617,24 +617,24 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
SCCOL nCol;
SCTAB nSrcTab = aBlock.aStart.Tab();
- pDestDoc->SetLayoutRTL(0, pDoc->IsLayoutRTL(nSrcTab));
+ rDestDoc.SetLayoutRTL(0, pDoc->IsLayoutRTL(nSrcTab));
for (nCol=nStartX; nCol<=nEndX; nCol++)
if ( pDoc->ColHidden(nCol, nSrcTab) )
- pDestDoc->ShowCol( nCol, 0, false );
+ rDestDoc.ShowCol( nCol, 0, false );
else
- pDestDoc->SetColWidth( nCol, 0, pDoc->GetColWidth( nCol, nSrcTab ) );
+ rDestDoc.SetColWidth( nCol, 0, pDoc->GetColWidth( nCol, nSrcTab ) );
for (SCROW nRow = nStartY; nRow <= nEndY; ++nRow)
{
if ( pDoc->RowHidden(nRow, nSrcTab) )
- pDestDoc->ShowRow( nRow, 0, false );
+ rDestDoc.ShowRow( nRow, 0, false );
else
{
- pDestDoc->SetRowHeight( nRow, 0, pDoc->GetOriginalHeight( nRow, nSrcTab ) );
+ rDestDoc.SetRowHeight( nRow, 0, pDoc->GetOriginalHeight( nRow, nSrcTab ) );
// if height was set manually, that flag has to be copied, too
bool bManual = pDoc->IsManualRowHeight(nRow, nSrcTab);
- pDestDoc->SetManualHeight(nRow, nRow, 0, bManual);
+ rDestDoc.SetManualHeight(nRow, nRow, 0, bManual);
}
}
@@ -649,15 +649,15 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
bool bWasCut = pDoc->IsCutMode();
if (!bWasCut)
pDoc->SetClipArea( aDestRange, true ); // Cut
- pDestDoc->CopyFromClip( aDestRange, aDestMark, IDF_ALL, NULL, pDoc, false );
+ rDestDoc.CopyFromClip( aDestRange, aDestMark, IDF_ALL, NULL, pDoc, false );
pDoc->SetClipArea( aDestRange, bWasCut );
- StripRefs( pDoc, nStartX,nStartY, nEndX,nEndY, pDestDoc, 0,0 );
+ StripRefs( pDoc, nStartX,nStartY, nEndX,nEndY, &rDestDoc, 0,0 );
ScRange aMergeRange = aDestRange;
- pDestDoc->ExtendMerge( aMergeRange, true );
+ rDestDoc.ExtendMerge( aMergeRange, true );
- pDoc->CopyDdeLinks( pDestDoc ); // copy values of DDE Links
+ pDoc->CopyDdeLinks( &rDestDoc ); // copy values of DDE Links
// page format (grid etc) and page size (maximum size for ole object)
@@ -671,7 +671,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
aPaperSize = ((const SvxSizeItem&) rSourceSet.Get(ATTR_PAGE_SIZE)).GetSize();
// CopyStyleFrom kopiert SetItems mit richtigem Pool
- ScStyleSheetPool* pDestPool = pDestDoc->GetStyleSheetPool();
+ ScStyleSheetPool* pDestPool = rDestDoc.GetStyleSheetPool();
pDestPool->CopyStyleFrom( pStylePool, aStyleName, SFX_STYLE_FAMILY_PAGE );
}
@@ -680,7 +680,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
aViewData.SetCurX( nStartX );
aViewData.SetCurY( nStartY );
- pDestDoc->SetViewOptions( pDoc->GetViewOptions() );
+ rDestDoc.SetViewOptions( pDoc->GetViewOptions() );
// Size
//! get while copying sizes
@@ -689,8 +689,8 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
long nPosY = 0;
for (nCol=0; nCol<nStartX; nCol++)
- nPosX += pDestDoc->GetColWidth( nCol, 0 );
- nPosY += pDestDoc->GetRowHeight( 0, nStartY-1, 0 );
+ nPosX += rDestDoc.GetColWidth( nCol, 0 );
+ nPosY += rDestDoc.GetRowHeight( 0, nStartY-1, 0 );
nPosX = (long) ( nPosX * HMM_PER_TWIPS );
nPosY = (long) ( nPosY * HMM_PER_TWIPS );
@@ -702,14 +702,14 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
long nSizeY = 0;
for (nCol=nStartX; nCol<=nEndX; nCol++)
{
- long nAdd = pDestDoc->GetColWidth( nCol, 0 );
+ long nAdd = rDestDoc.GetColWidth( nCol, 0 );
if ( bLimitToPageSize && nSizeX+nAdd > aPaperSize.Width() && nSizeX ) // above limit?
break;
nSizeX += nAdd;
}
for (SCROW nRow=nStartY; nRow<=nEndY; nRow++)
{
- long nAdd = pDestDoc->GetRowHeight( nRow, 0 );
+ long nAdd = rDestDoc.GetRowHeight( nRow, 0 );
if ( bLimitToPageSize && nSizeY+nAdd > aPaperSize.Height() && nSizeY ) // above limit?
break;
nSizeY += nAdd;
@@ -727,8 +727,8 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
pDocSh->UpdateOle(&aViewData, true);
//! SetDocumentModified?
- if ( pDestDoc->IsChartListenerCollectionNeedsUpdate() )
- pDestDoc->UpdateChartListenerCollection();
+ if ( rDestDoc.IsChartListenerCollectionNeedsUpdate() )
+ rDestDoc.UpdateChartListenerCollection();
}
}
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 3bd36c39c5ff..67a973255831 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -69,10 +69,10 @@ ScConsolidateDlg::ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
rArgSet.Get( rArgSet.GetPool()->
GetWhich( SID_CONSOLIDATE ) )
).GetData() ),
- pViewData ( ((ScTabViewShell*)SfxViewShell::Current())->
+ rViewData ( ((ScTabViewShell*)SfxViewShell::Current())->
GetViewData() ),
pDoc ( ((ScTabViewShell*)SfxViewShell::Current())->
- GetViewData()->GetDocument() ),
+ GetViewData().GetDocument() ),
pRangeUtil ( new ScRangeUtil ),
pAreaData ( NULL ),
nAreaDataCount ( 0 ),
@@ -113,7 +113,7 @@ ScConsolidateDlg::~ScConsolidateDlg()
void ScConsolidateDlg::Init()
{
- OSL_ENSURE( pViewData && pDoc && pRangeUtil, "Error in Ctor" );
+ OSL_ENSURE( pDoc && pRangeUtil, "Error in Ctor" );
OUString aStr;
sal_uInt16 i=0;
@@ -299,11 +299,11 @@ void ScConsolidateDlg::Deactivate()
bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd )
{
- if ( !pRangeUtil || !pDoc || !pViewData ||
+ if ( !pRangeUtil || !pDoc ||
((pEd != pEdDataArea) && (pEd != pEdDestArea)) )
return false;
- SCTAB nTab = pViewData->GetTabNo();
+ SCTAB nTab = rViewData.GetTabNo();
bool bEditOk = false;
OUString theCompleteStr;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
@@ -357,7 +357,7 @@ IMPL_LINK_NOARG(ScConsolidateDlg, OkHdl)
if ( nDataAreaCount > 0 )
{
ScRefAddress aDestAddress;
- SCTAB nTab = pViewData->GetTabNo();
+ SCTAB nTab = rViewData.GetTabNo();
OUString aDestPosStr( pEdDestArea->GetText() );
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index d3a0c9c5a8e8..b253b28d9a78 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -148,7 +148,7 @@ void ScNewScenarioDlg::SetScenarioData( const OUString& rName, const OUString& r
IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl)
{
OUString aName = comphelper::string::strip(m_pEdName->GetText(), ' ');
- ScDocument* pDoc = ((ScTabViewShell*)SfxViewShell::Current())->GetViewData()->GetDocument();
+ ScDocument* pDoc = ((ScTabViewShell*)SfxViewShell::Current())->GetViewData().GetDocument();
m_pEdName->SetText( aName );
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 3eda96fc61f7..6333016fc1b9 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -215,7 +215,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
m_pCbFormulas->Show();
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current());
bool bFormulas = (pViewSh ?
- pViewSh->GetViewData()->GetOptions().GetOption( VOPT_FORMULAS) :
+ pViewSh->GetViewData().GetOptions().GetOption( VOPT_FORMULAS) :
false);
m_pCbFormulas->Check( bFormulas );
}
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index cb7344e411b7..6bfb499821ae 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -75,7 +75,7 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const OUString& rFile,
OSL_ENSURE(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell");
pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell );
SetRefreshHandler( LINK( this, ScAreaLink, RefreshHdl ) );
- SetRefreshControl( pImpl->m_pDocSh->GetDocument()->GetRefreshTimerControlAddress() );
+ SetRefreshControl( &pImpl->m_pDocSh->GetDocument().GetRefreshTimerControlAddress() );
}
ScAreaLink::~ScAreaLink()
@@ -109,7 +109,7 @@ void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
if (bInCreate)
return SUCCESS;
- sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument().GetLinkManager();
if (pLinkManager!=NULL)
{
OUString aFile, aArea, aFilter;
@@ -143,8 +143,8 @@ void ScAreaLink::Closed()
{
// Verknuepfung loeschen: Undo
- ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pImpl->m_pDocSh->GetDocument();
+ bool bUndo (rDoc.IsUndoEnabled());
if (bAddUndo && bUndo)
{
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction( new ScUndoRemoveAreaLink( pImpl->m_pDocSh,
@@ -155,8 +155,8 @@ void ScAreaLink::Closed()
}
SCTAB nDestTab = aDestArea.aStart.Tab();
- if (pDoc->IsStreamValid(nDestTab))
- pDoc->SetStreamValid(nDestTab, false);
+ if (rDoc.IsStreamValid(nDestTab))
+ rDoc.SetStreamValid(nDestTab, false);
SvBaseLink::Closed();
}
@@ -242,10 +242,10 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
if (!pFilter)
return false;
- ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
+ ScDocument& rDoc = pImpl->m_pDocSh->GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- pDoc->SetInLinkUpdate( true );
+ bool bUndo (rDoc.IsUndoEnabled());
+ rDoc.SetInLinkUpdate( true );
// wenn neuer Filter ausgewaehlt wurde, Optionen vergessen
if ( rNewFilter != aFilterName )
@@ -258,7 +258,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
SfxObjectShellLock aRef = pSrcShell;
pSrcShell->DoLoad(pMed);
- ScDocument* pSrcDoc = pSrcShell->GetDocument();
+ ScDocument& rSrcDoc = pSrcShell->GetDocument();
// Optionen koennten gesetzt worden sein
OUString aNewOpt = ScDocumentLoader::GetOptions(*pMed);
@@ -269,7 +269,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
OUString aTempArea;
if( rNewFilter == ScDocShell::GetWebQueryFilterName() )
- aTempArea = ScFormatFilter::Get().GetHTMLRangeNameList( pSrcDoc, rNewArea );
+ aTempArea = ScFormatFilter::Get().GetHTMLRangeNameList( &rSrcDoc, rNewArea );
else
aTempArea = rNewArea;
@@ -284,7 +284,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
{
OUString aToken( aTempArea.getToken( 0, ';', nStringIx ) );
ScRange aTokenRange;
- if( FindExtRange( aTokenRange, pSrcDoc, aToken ) )
+ if( FindExtRange( aTokenRange, &rSrcDoc, aToken ) )
{
// columns: find maximum
nWidth = std::max( nWidth, (SCCOL)(aTokenRange.aEnd.Col() - aTokenRange.aStart.Col() + 1) );
@@ -310,7 +310,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
//! check CanFitBlock only if bDoInsert is set?
bool bCanDo = ValidColRow( aNewRange.aEnd.Col(), aNewRange.aEnd.Row() ) &&
- pDoc->CanFitBlock( aOldRange, aNewRange );
+ rDoc.CanFitBlock( aOldRange, aNewRange );
if (bCanDo)
{
ScDocShellModificator aModificator( *pImpl->m_pDocSh );
@@ -332,18 +332,18 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
{
if ( nNewEndX != nOldEndX || nNewEndY != nOldEndY ) // Bereich veraendert?
{
- pUndoDoc->InitUndo( pDoc, 0, pDoc->GetTableCount()-1 );
- pDoc->CopyToDocument( 0,0,0,MAXCOL,MAXROW,MAXTAB,
+ pUndoDoc->InitUndo( &rDoc, 0, rDoc.GetTableCount()-1 );
+ rDoc.CopyToDocument( 0,0,0,MAXCOL,MAXROW,MAXTAB,
IDF_FORMULA, false, pUndoDoc ); // alle Formeln
}
else
- pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); // nur Zieltabelle
+ rDoc.CopyToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
else // ohne Einfuegen
{
- pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab ); // nur Zieltabelle
- pDoc->CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); // nur Zieltabelle
+ rDoc.CopyToDocument( aMaxRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
}
@@ -351,9 +351,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
// DeleteAreaTab loescht auch MERGE_FLAG Attribute
if (bDoInsert)
- pDoc->FitBlock( aOldRange, aNewRange ); // incl. loeschen
+ rDoc.FitBlock( aOldRange, aNewRange ); // incl. loeschen
else
- pDoc->DeleteAreaTab( aMaxRange, IDF_ALL & ~IDF_NOTE );
+ rDoc.DeleteAreaTab( aMaxRange, IDF_ALL & ~IDF_NOTE );
// Daten kopieren
@@ -366,7 +366,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
{
OUString aToken( aTempArea.getToken( 0, ';', nStringIx ) );
ScRange aTokenRange;
- if( FindExtRange( aTokenRange, pSrcDoc, aToken ) )
+ if( FindExtRange( aTokenRange, &rSrcDoc, aToken ) )
{
SCTAB nSrcTab = aTokenRange.aStart.Tab();
ScMarkData aSourceMark;
@@ -374,14 +374,14 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
aSourceMark.SetMarkArea( aTokenRange );
ScClipParam aClipParam(aTokenRange, false);
- pSrcDoc->CopyToClip(aClipParam, &aClipDoc, &aSourceMark);
+ rSrcDoc.CopyToClip(aClipParam, &aClipDoc, &aSourceMark);
if ( aClipDoc.HasAttrib( 0,0,nSrcTab, MAXCOL,MAXROW,nSrcTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{
//! ResetAttrib am Dokument !!!
- ScPatternAttr aPattern( pSrcDoc->GetPool() );
+ ScPatternAttr aPattern( rSrcDoc.GetPool() );
aPattern.GetItemSet().Put( ScMergeAttr() ); // Defaults
aPattern.GetItemSet().Put( ScMergeFlagAttr() );
aClipDoc.ApplyPatternAreaTab( 0,0, MAXCOL,MAXROW, nSrcTab, aPattern );
@@ -392,7 +392,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
ScMarkData aDestMark;
aDestMark.SelectOneTable( nDestTab );
aDestMark.SetMarkArea( aNewTokenRange );
- pDoc->CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, false );
+ rDoc.CopyFromClip( aNewTokenRange, aDestMark, IDF_ALL, NULL, &aClipDoc, false );
aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
}
}
@@ -400,7 +400,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
else
{
OUString aErr = ScGlobal::GetRscString(STR_LINKERROR);
- pDoc->SetString( aDestPos.Col(), aDestPos.Row(), aDestPos.Tab(), aErr );
+ rDoc.SetString( aDestPos.Col(), aDestPos.Row(), aDestPos.Tab(), aErr );
}
// Undo eintragen
@@ -408,8 +408,8 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
if ( bAddUndo && bUndo)
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndo( pDoc, nDestTab, nDestTab );
- pDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
+ pRedoDoc->InitUndo( &rDoc, nDestTab, nDestTab );
+ rDoc.CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
pImpl->m_pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoUpdateAreaLink( pImpl->m_pDocSh,
@@ -468,7 +468,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
aRef->DoClose();
- pDoc->SetInLinkUpdate( false );
+ rDoc.SetInLinkUpdate( false );
if (bCanDo)
{
@@ -476,7 +476,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
//! also notify Uno objects if file name was changed!
ScLinkRefreshedHint aHint;
aHint.SetAreaLink( aDestPos );
- pDoc->BroadcastUno( aHint );
+ rDoc.BroadcastUno( aHint );
}
return bCanDo;
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 5b9951c6769a..84f4db54704f 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -306,7 +306,7 @@ DataStream* DataStream::Set(
sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings)
{
DataStream* pLink = new DataStream(pShell, rURL, rRange, nLimit, eMove, nSettings);
- sc::DocumentLinkManager& rMgr = pShell->GetDocument()->GetDocLinkManager();
+ sc::DocumentLinkManager& rMgr = pShell->GetDocument().GetDocLinkManager();
rMgr.setDataStream(pLink);
return pLink;
}
@@ -314,8 +314,7 @@ DataStream* DataStream::Set(
DataStream::DataStream(ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings) :
mpDocShell(pShell),
- mpDoc(mpDocShell->GetDocument()),
- maDocAccess(*mpDoc),
+ maDocAccess(mpDocShell->GetDocument()),
meOrigMove(NO_MOVE),
meMove(NO_MOVE),
mbRunning(false),
@@ -546,7 +545,7 @@ void DataStream::Text2Doc()
if (meMove == RANGE_DOWN)
{
++mnCurRow;
-// mpDocShell->GetViewData()->GetView()->AlignToCursor(
+// mpDocShell->GetViewData().GetView()->AlignToCursor(
// maStartRange.aStart.Col(), mnCurRow, SC_FOLLOW_JUMP);
}
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index deaf24481a34..d6c9a0df990a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -58,9 +58,9 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- ScDBCollection* pDocColl = pDoc->GetDBCollection();
- bool bUndo (pDoc->IsUndoEnabled());
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScDBCollection* pDocColl = rDoc.GetDBCollection();
+ bool bUndo (rDoc.IsUndoEnabled());
ScDBCollection* pUndoColl = NULL;
if (bUndo)
@@ -73,13 +73,13 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool
// #i55926# While loading XML, formula cells only have a single string token,
// so CompileDBFormula would never find any name (index) tokens, and would
// unnecessarily loop through all cells.
- bool bCompile = !pDoc->IsImportingXML();
+ bool bCompile = !rDoc.IsImportingXML();
bool bOk;
if ( bCompile )
- pDoc->CompileDBFormula( true ); // CreateFormulaString
+ rDoc.CompileDBFormula( true ); // CreateFormulaString
if ( rName == STR_DB_LOCAL_NONAME )
{
- pDoc->SetAnonymousDBData(rRange.aStart.Tab() , pNew);
+ rDoc.SetAnonymousDBData(rRange.aStart.Tab() , pNew);
bOk = true;
}
else
@@ -87,7 +87,7 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool
bOk = pDocColl->getNamedDBs().insert(pNew);
}
if ( bCompile )
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ rDoc.CompileDBFormula( false ); // CompileFormulaString
if (!bOk)
{
@@ -111,9 +111,9 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool
bool ScDBDocFunc::DeleteDBRange(const OUString& rName)
{
bool bDone = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- ScDBCollection* pDocColl = pDoc->GetDBCollection();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScDBCollection* pDocColl = rDoc.GetDBCollection();
+ bool bUndo = rDoc.IsUndoEnabled();
ScDBCollection::NamedDBs& rDBs = pDocColl->getNamedDBs();
const ScDBData* p = rDBs.findByUpperName(ScGlobal::pCharClass->uppercase(rName));
@@ -125,9 +125,9 @@ bool ScDBDocFunc::DeleteDBRange(const OUString& rName)
if (bUndo)
pUndoColl = new ScDBCollection( *pDocColl );
- pDoc->CompileDBFormula( true ); // CreateFormulaString
+ rDoc.CompileDBFormula( true ); // CreateFormulaString
rDBs.erase(*p);
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ rDoc.CompileDBFormula( false ); // CompileFormulaString
if (bUndo)
{
@@ -147,9 +147,9 @@ bool ScDBDocFunc::DeleteDBRange(const OUString& rName)
bool ScDBDocFunc::RenameDBRange( const OUString& rOld, const OUString& rNew )
{
bool bDone = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- ScDBCollection* pDocColl = pDoc->GetDBCollection();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScDBCollection* pDocColl = rDoc.GetDBCollection();
+ bool bUndo = rDoc.IsUndoEnabled();
ScDBCollection::NamedDBs& rDBs = pDocColl->getNamedDBs();
const ScDBData* pOld = rDBs.findByUpperName(ScGlobal::pCharClass->uppercase(rOld));
const ScDBData* pNew = rDBs.findByUpperName(ScGlobal::pCharClass->uppercase(rNew));
@@ -161,16 +161,16 @@ bool ScDBDocFunc::RenameDBRange( const OUString& rOld, const OUString& rNew )
ScDBCollection* pUndoColl = new ScDBCollection( *pDocColl );
- pDoc->CompileDBFormula(true); // CreateFormulaString
+ rDoc.CompileDBFormula(true); // CreateFormulaString
rDBs.erase(*pOld);
bool bInserted = rDBs.insert(pNewData);
if (!bInserted) // Fehler -> alten Zustand wiederherstellen
{
delete pNewData;
- pDoc->SetDBCollection(pUndoColl); // gehoert dann dem Dokument
+ rDoc.SetDBCollection(pUndoColl); // gehoert dann dem Dokument
}
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ rDoc.CompileDBFormula( false ); // CompileFormulaString
if (bInserted) // Einfuegen hat geklappt
{
@@ -195,9 +195,9 @@ bool ScDBDocFunc::RenameDBRange( const OUString& rOld, const OUString& rNew )
bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData )
{
bool bDone = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- ScDBCollection* pDocColl = pDoc->GetDBCollection();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScDBCollection* pDocColl = rDoc.GetDBCollection();
+ bool bUndo = rDoc.IsUndoEnabled();
ScDBData* pData = NULL;
if (rNewData.GetName() == STR_DB_LOCAL_NONAME)
@@ -205,7 +205,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData )
ScRange aRange;
rNewData.GetArea(aRange);
SCTAB nTab = aRange.aStart.Tab();
- pData = pDoc->GetAnonymousDBData(nTab);
+ pData = rDoc.GetAnonymousDBData(nTab);
}
else
pData = pDocColl->getNamedDBs().findByUpperName(rNewData.GetUpperName());
@@ -224,7 +224,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData& rNewData )
*pData = rNewData;
if (bAreaChanged)
- pDoc->CompileDBFormula();
+ rDoc.CompileDBFormula();
if (bUndo)
{
@@ -245,17 +245,17 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
//! auch fuer ScDBFunc::RepeatDB benutzen!
bool bDone = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScDBData* pDBData = NULL;
if (bIsUnnamed)
{
- pDBData = pDoc->GetAnonymousDBData( aTab );
+ pDBData = rDoc.GetAnonymousDBData( aTab );
}
else
{
- ScDBCollection* pColl = pDoc->GetDBCollection();
+ ScDBCollection* pColl = rDoc.GetDBCollection();
if (pColl)
pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rDBName));
}
@@ -281,7 +281,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
ScRange aNewQuery;
if (bQuery && !aQueryParam.bInplace)
{
- ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
+ ScDBData* pDest = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
aQueryParam.nDestTab, true );
if (pDest && pDest->IsDoSize())
{
@@ -306,9 +306,9 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
if (bRecord)
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
pUndoTab = new ScOutlineTable( *pTable );
@@ -316,31 +316,31 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
// column/row state
SCCOLROW nOutStartCol, nOutEndCol;
SCCOLROW nOutStartRow, nOutEndRow;
- pTable->GetColArray()->GetRange( nOutStartCol, nOutEndCol );
- pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
+ pTable->GetColArray().GetRange( nOutStartCol, nOutEndCol );
+ pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0,
nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab,
IDF_NONE, false, pUndoDoc );
- pDoc->CopyToDocument( 0, static_cast<SCROW>(nOutStartRow),
+ rDoc.CopyToDocument( 0, static_cast<SCROW>(nOutStartRow),
nTab, MAXCOL, static_cast<SCROW>(nOutEndRow), nTab,
IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
// Datenbereich sichern - incl. Filter-Ergebnis
- pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
+ rDoc.CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, false, pUndoDoc );
+ rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
- ScRangeName* pDocRange = pDoc->GetRangeName();
+ ScRangeName* pDocRange = rDoc.GetRangeName();
if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
- ScDBCollection* pDocDB = pDoc->GetDBCollection();
+ ScDBCollection* pDocDB = rDoc.GetDBCollection();
if (!pDocDB->empty())
pUndoDB = new ScDBCollection( *pDocDB );
}
@@ -390,7 +390,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
const ScRange* pNew = NULL;
if (bQuerySize)
{
- ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
+ ScDBData* pDest = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
aQueryParam.nDestTab, true );
if (pDest)
{
@@ -427,13 +427,13 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
SCTAB nSrcTab = nTab;
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
- ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rSortParam.nCol1, rSortParam.nRow1,
+ ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rSortParam.nCol1, rSortParam.nRow1,
rSortParam.nCol2, rSortParam.nRow2 );
if (!pDBData)
{
@@ -459,13 +459,13 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
}
nTab = rSortParam.nDestTab;
- pDestData = pDoc->GetDBAtCursor( rSortParam.nDestCol, rSortParam.nDestRow,
+ pDestData = rDoc.GetDBAtCursor( rSortParam.nDestCol, rSortParam.nDestRow,
rSortParam.nDestTab, true );
if (pDestData)
pDestData->GetArea(aOldDest);
}
- ScEditableTester aTester( pDoc, nTab, aLocalParam.nCol1,aLocalParam.nRow1,
+ ScEditableTester aTester( &rDoc, nTab, aLocalParam.nCol1,aLocalParam.nRow1,
aLocalParam.nCol2,aLocalParam.nRow2 );
if (!aTester.IsEditable())
{
@@ -474,7 +474,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
return false;
}
- if ( aLocalParam.bIncludePattern && pDoc->HasAttrib(
+ if ( aLocalParam.bIncludePattern && rDoc.HasAttrib(
aLocalParam.nCol1, aLocalParam.nRow1, nTab,
aLocalParam.nCol2, aLocalParam.nRow2, nTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
@@ -495,14 +495,14 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
// Calculate the script types for all cells in the sort range beforehand.
// This will speed up the row height adjustment that takes place after the
// sort.
- pDoc->UpdateScriptTypes(
+ rDoc.UpdateScriptTypes(
ScAddress(aLocalParam.nCol1,nStartRow,nTab),
aLocalParam.nCol2-aLocalParam.nCol1+1,
aLocalParam.nRow2-nStartRow+1);
// No point adjusting row heights after the sort when all rows have the same height.
bool bUniformRowHeight =
- pDoc->HasUniformRowHeight(nTab, nStartRow, aLocalParam.nRow2);
+ rDoc.HasUniformRowHeight(nTab, nStartRow, aLocalParam.nRow2);
bool bRepeatQuery = false; // bestehenden Filter wiederholen?
ScQueryParam aQueryParam;
@@ -527,14 +527,14 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
// Zeilenhoehen immer (wegen automatischer Anpassung)
//! auf ScBlockUndo umstellen
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
/* #i59745# Do not copy note captions to undo document. All existing
caption objects will be repositioned while sorting which is tracked
in drawing undo. When undo is executed, the old positions will be
restored, and the cells with the old notes (which still refer to the
existing captions) will be copied back into the source document. */
- pDoc->CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nTab,
+ rDoc.CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nTab,
aLocalParam.nCol2, aLocalParam.nRow2, nTab,
IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
@@ -547,18 +547,18 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
caption objects are reinserted with drawing undo, and the cells
with the old notes (which still refer to the existing captions)
will be copied back into the source document. */
- pDoc->CopyToDocument( aOldDest, IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
+ rDoc.CopyToDocument( aOldDest, IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
pR = &aOldDest;
}
// Zeilenhoehen immer (wegen automatischer Anpassung)
//! auf ScBlockUndo umstellen
// if (bRepeatQuery)
- pDoc->CopyToDocument( 0, aLocalParam.nRow1, nTab, MAXCOL, aLocalParam.nRow2, nTab,
+ rDoc.CopyToDocument( 0, aLocalParam.nRow1, nTab, MAXCOL, aLocalParam.nRow2, nTab,
IDF_NONE, false, pUndoDoc );
ScDBCollection* pUndoDB = NULL;
- ScDBCollection* pDocDB = pDoc->GetDBCollection();
+ ScDBCollection* pDocDB = rDoc.GetDBCollection();
if (!pDocDB->empty())
pUndoDB = new ScDBCollection( *pDocDB );
@@ -573,7 +573,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
if ( bCopy )
{
if (pDestData)
- pDoc->DeleteAreaTab(aOldDest, IDF_CONTENTS); // Zielbereich vorher loeschen
+ rDoc.DeleteAreaTab(aOldDest, IDF_CONTENTS); // Zielbereich vorher loeschen
ScRange aSource( rSortParam.nCol1,rSortParam.nRow1,nSrcTab,
rSortParam.nCol2,rSortParam.nRow2,nSrcTab );
@@ -586,7 +586,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
if (aLocalParam.GetSortKeyCount() && aLocalParam.maKeyState[0].bDoSort)
{
ScProgress aProgress(&rDocShell, ScGlobal::GetRscString(STR_PROGRESS_SORTING), 0);
- pDoc->Sort( nTab, aLocalParam, bRepeatQuery, &aProgress );
+ rDoc.Sort( nTab, aLocalParam, bRepeatQuery, &aProgress );
}
bool bSave = true;
@@ -641,7 +641,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
ScRange aDirtyRange(
aLocalParam.nCol1, nStartRow, nTab,
aLocalParam.nCol2, aLocalParam.nRow2, nTab);
- pDoc->SetDirty( aDirtyRange );
+ rDoc.SetDirty( aDirtyRange );
if (bPaint)
{
@@ -683,10 +683,10 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rQueryParam.nCol1, rQueryParam.nRow1,
+ ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rQueryParam.nCol1, rQueryParam.nRow1,
rQueryParam.nCol2, rQueryParam.nRow2 );
if (!pDBData)
{
@@ -736,7 +736,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
return false;
}
- ScEditableTester aTester( pDoc, nDestTab, aLocalParam.nCol1,aLocalParam.nRow1,
+ ScEditableTester aTester( &rDoc, nDestTab, aLocalParam.nCol1,aLocalParam.nRow1,
aLocalParam.nCol2,aLocalParam.nRow2);
if (!aTester.IsEditable())
{
@@ -745,7 +745,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
return false;
}
- pDestData = pDoc->GetDBAtCursor( rQueryParam.nDestCol, rQueryParam.nDestRow,
+ pDestData = rDoc.GetDBAtCursor( rQueryParam.nDestCol, rQueryParam.nDestRow,
rQueryParam.nDestTab, true );
if (pDestData)
{
@@ -765,12 +765,12 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
SCROW nTestRow = rQueryParam.nDestRow +
( aLocalParam.bHasHeader ? 1 : 0 );
while ( nTestCol <= MAXCOL &&
- pDoc->GetCellType(ScAddress( nTestCol, nTestRow, nTab )) == CELLTYPE_FORMULA )
+ rDoc.GetCellType(ScAddress( nTestCol, nTestRow, nTab )) == CELLTYPE_FORMULA )
++nTestCol, ++nFormulaCols;
}
bKeepFmt = pDestData->IsKeepFmt();
- if ( bDoSize && !pDoc->CanFitBlock( aOldDest, aDestTotal ) )
+ if ( bDoSize && !rDoc.CanFitBlock( aOldDest, aDestTotal ) )
{
if (!bApi)
rDocShell.ErrorMessage(STR_MSSG_DOSUBTOTALS_2); // kann keine Zeilen einfuegen
@@ -802,30 +802,30 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bCopy)
{
- pUndoDoc->InitUndo( pDoc, nDestTab, nDestTab, false, true );
- pDoc->CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
+ pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true );
+ rDoc.CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
aLocalParam.nCol2, aLocalParam.nRow2, nDestTab,
IDF_ALL, false, pUndoDoc );
// Attribute sichern, falls beim Filtern mitkopiert
if (pDestData)
{
- pDoc->CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
+ rDoc.CopyToDocument( aOldDest, IDF_ALL, false, pUndoDoc );
pOld = &aOldDest;
}
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
- pDoc->CopyToDocument( 0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
+ rDoc.CopyToDocument( 0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab,
IDF_NONE, false, pUndoDoc );
}
- ScDBCollection* pDocDB = pDoc->GetDBCollection();
+ ScDBCollection* pDocDB = rDoc.GetDBCollection();
if (!pDocDB->empty())
pUndoDB = new ScDBCollection( *pDocDB );
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
ScDocument* pAttribDoc = NULL;
@@ -845,18 +845,18 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
aAttribRange.aEnd.SetCol( aAttribRange.aEnd.Col() + nFormulaCols );
pAttribDoc = new ScDocument( SCDOCMODE_UNDO );
- pAttribDoc->InitUndo( pDoc, nDestTab, nDestTab, false, true );
- pDoc->CopyToDocument( aAttribRange, IDF_ATTRIB, false, pAttribDoc );
+ pAttribDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true );
+ rDoc.CopyToDocument( aAttribRange, IDF_ATTRIB, false, pAttribDoc );
}
if ( bDoSize )
- pDoc->FitBlock( aOldDest, aDestTotal );
+ rDoc.FitBlock( aOldDest, aDestTotal );
else
- pDoc->DeleteAreaTab(aOldDest, IDF_ALL); // einfach loeschen
+ rDoc.DeleteAreaTab(aOldDest, IDF_ALL); // einfach loeschen
}
// Filtern am Dokument ausfuehren
- SCSIZE nCount = pDoc->Query( nTab, rQueryParam, bKeepSub );
+ SCSIZE nCount = rDoc.Query( nTab, rQueryParam, bKeepSub );
if (bCopy)
{
aLocalParam.nRow2 = aLocalParam.nRow1 + nCount;
@@ -870,7 +870,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
ScRange aNewDest( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab,
aLocalParam.nCol2, aLocalParam.nRow2, nDestTab );
- pDoc->FitBlock( aDestTotal, aNewDest, false ); // sal_False - nicht loeschen
+ rDoc.FitBlock( aDestTotal, aNewDest, false ); // sal_False - nicht loeschen
if ( nFormulaCols > 0 )
{
@@ -881,7 +881,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
aLocalParam.nCol2+nFormulaCols, aLocalParam.nRow2, nDestTab );
ScRange aOldForm = aNewForm;
aOldForm.aEnd.SetRow( aOldDest.aEnd.Row() );
- pDoc->FitBlock( aOldForm, aNewForm, false );
+ rDoc.FitBlock( aOldForm, aNewForm, false );
ScMarkData aMark;
aMark.SelectOneTable(nDestTab);
@@ -889,10 +889,10 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
sal_uLong nProgCount = nFormulaCols;
nProgCount *= aLocalParam.nRow2 - nFStartY;
- ScProgress aProgress( pDoc->GetDocumentShell(),
+ ScProgress aProgress( rDoc.GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- pDoc->Fill( aLocalParam.nCol2+1, nFStartY,
+ rDoc.Fill( aLocalParam.nCol2+1, nFStartY,
aLocalParam.nCol2+nFormulaCols, nFStartY, &aProgress, aMark,
aLocalParam.nRow2 - nFStartY,
FILL_TO_BOTTOM, FILL_SIMPLE );
@@ -906,7 +906,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
{
ScRange aHdrRange = aAttribRange;
aHdrRange.aEnd.SetRow( aHdrRange.aStart.Row() );
- pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, false, pDoc );
+ pAttribDoc->CopyToDocument( aHdrRange, IDF_ATTRIB, false, &rDoc );
}
// Daten
@@ -919,11 +919,11 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
OSL_ENSURE(pSrcPattern,"Pattern ist 0");
if (pSrcPattern)
{
- pDoc->ApplyPatternAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
+ rDoc.ApplyPatternAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
nDestTab, *pSrcPattern );
const ScStyleSheet* pStyle = pSrcPattern->GetStyleSheet();
if (pStyle)
- pDoc->ApplyStyleAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
+ rDoc.ApplyStyleAreaTab( nCol, nAttrRow, nCol, aLocalParam.nRow2,
nDestTab, *pStyle );
}
}
@@ -974,13 +974,13 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
if (!bCopy)
{
- pDoc->InvalidatePageBreaks(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.InvalidatePageBreaks(nTab);
+ rDoc.UpdatePageBreaks( nTab );
}
// #i23299# Subtotal functions depend on cell's filtered states.
ScRange aDirtyRange(0 , aLocalParam.nRow1, nDestTab, MAXCOL, aLocalParam.nRow2, nDestTab);
- pDoc->SetSubTotalCellsDirty(aDirtyRange);
+ rDoc.SetSubTotalCellsDirty(aDirtyRange);
if ( bRecord )
{
@@ -1028,10 +1028,10 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
bool bDo = !rParam.bRemoveOnly; // sal_False = nur loeschen
bool bRet = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
+ ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
@@ -1039,7 +1039,7 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
return false;
}
- ScEditableTester aTester( pDoc, nTab, 0,rParam.nRow1+1, MAXCOL,MAXROW );
+ ScEditableTester aTester( &rDoc, nTab, 0,rParam.nRow1+1, MAXCOL,MAXROW );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -1047,7 +1047,7 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
return false;
}
- if (pDoc->HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab,
+ if (rDoc.HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab,
rParam.nCol2, rParam.nRow2, nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ))
{
if (!bApi)
@@ -1057,7 +1057,7 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
bool bOk = true;
if (rParam.bReplace)
- if (pDoc->TestRemoveSubTotals( nTab, rParam ))
+ if (rDoc.TestRemoveSubTotals( nTab, rParam ))
{
bOk = ( MessBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
// "StarCalc" "Daten loeschen?"
@@ -1081,9 +1081,9 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
{
bool bOldFilter = bDo && rParam.bDoSort;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
pUndoTab = new ScOutlineTable( *pTable );
@@ -1091,40 +1091,40 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
// column/row state
SCCOLROW nOutStartCol, nOutEndCol;
SCCOLROW nOutStartRow, nOutEndRow;
- pTable->GetColArray()->GetRange( nOutStartCol, nOutEndCol );
- pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
+ pTable->GetColArray().GetRange( nOutStartCol, nOutEndCol );
+ pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, bOldFilter );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, bOldFilter );
// Datenbereich sichern - incl. Filter-Ergebnis
- pDoc->CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
+ rDoc.CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
+ rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
- ScRangeName* pDocRange = pDoc->GetRangeName();
+ ScRangeName* pDocRange = rDoc.GetRangeName();
if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
- ScDBCollection* pDocDB = pDoc->GetDBCollection();
+ ScDBCollection* pDocDB = rDoc.GetDBCollection();
if (!pDocDB->empty())
pUndoDB = new ScDBCollection( *pDocDB );
}
-// pDoc->SetOutlineTable( nTab, NULL );
- ScOutlineTable* pOut = pDoc->GetOutlineTable( nTab );
+// rDoc.SetOutlineTable( nTab, NULL );
+ ScOutlineTable* pOut = rDoc.GetOutlineTable( nTab );
if (pOut)
- pOut->GetRowArray()->RemoveAll(); // nur Zeilen-Outlines loeschen
+ pOut->GetRowArray().RemoveAll(); // nur Zeilen-Outlines loeschen
if (rParam.bReplace)
- pDoc->RemoveSubTotals( nTab, aNewParam );
+ rDoc.RemoveSubTotals( nTab, aNewParam );
bool bSuccess = true;
if (bDo)
{
@@ -1142,12 +1142,12 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
Sort( nTab, aSortParam, false, false, bApi );
}
- bSuccess = pDoc->DoSubTotals( nTab, aNewParam );
- pDoc->SetDrawPageSize(nTab);
+ bSuccess = rDoc.DoSubTotals( nTab, aNewParam );
+ rDoc.SetDrawPageSize(nTab);
}
ScRange aDirtyRange( aNewParam.nCol1, aNewParam.nRow1, nTab,
aNewParam.nCol2, aNewParam.nRow2, nTab );
- pDoc->SetDirty( aDirtyRange );
+ rDoc.SetDirty( aDirtyRange );
if (bRecord)
{
@@ -1169,7 +1169,7 @@ bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
// merken
pDBData->SetSubTotalParam( aNewParam );
pDBData->SetArea( nTab, aNewParam.nCol1,aNewParam.nRow1, aNewParam.nCol2,aNewParam.nRow2 );
- pDoc->CompileDBFormula();
+ rDoc.CompileDBFormula();
rDocShell.PostPaint(ScRange(0, 0, nTab, MAXCOL,MAXROW,nTab),
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE);
@@ -1199,8 +1199,8 @@ bool lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rE
bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi)
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if (!rDocShell.IsEditable() || pDoc->GetChangeTrack())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (!rDocShell.IsEditable() || rDoc.GetChangeTrack())
{
// not recorded -> disallow
if (!bApi)
@@ -1212,7 +1212,7 @@ bool isEditable(ScDocShell& rDocShell, const ScRangeList& rRanges, bool bApi)
for (size_t i = 0, n = rRanges.size(); i < n; ++i)
{
const ScRange* p = rRanges[i];
- ScEditableTester aTester(pDoc, *p);
+ ScEditableTester aTester(&rDoc, *p);
if (!aTester.IsEditable())
{
if (!bApi)
@@ -1237,7 +1237,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi)
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
bool bOverflow = false;
rNewOut = rDPObj.GetNewOutputRange(bOverflow);
@@ -1265,7 +1265,7 @@ bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNe
return false;
}
- ScEditableTester aTester(pDoc, rNewOut);
+ ScEditableTester aTester(&rDoc, rNewOut);
if (!aTester.IsEditable())
{
// destination area isn't editable
@@ -1318,12 +1318,12 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
ScDPObject aUndoDPObj(*pOldObj); // for undo or revert on failure
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if (bRecord)
- createUndoDoc(pOldUndoDoc, pDoc, pOldObj->GetOutRange());
+ createUndoDoc(pOldUndoDoc, &rDoc, pOldObj->GetOutRange());
pNewObj->WriteSourceDataTo(*pOldObj); // copy source data
@@ -1339,7 +1339,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
// make sure the table has a name (not set by dialog)
if (pOldObj->GetName().isEmpty())
- pOldObj->SetName( pDoc->GetDPCollection()->CreateNewName() );
+ pOldObj->SetName( rDoc.GetDPCollection()->CreateNewName() );
ScRange aNewOut;
if (!checkNewOutputRange(*pOldObj, rDocShell, aNewOut, bApi))
@@ -1352,7 +1352,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
if (!bApi)
{
// OutRange of pOldObj (pDestObj) is still old area
- if (!lcl_EmptyExcept(pDoc, aNewOut, pOldObj->GetOutRange()))
+ if (!lcl_EmptyExcept(&rDoc, aNewOut, pOldObj->GetOutRange()))
{
QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
@@ -1366,7 +1366,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
}
if (bRecord)
- createUndoDoc(pNewUndoDoc, pDoc, aNewOut);
+ createUndoDoc(pNewUndoDoc, &rDoc, aNewOut);
pOldObj->Output(aNewOut.aStart);
rDocShell.PostPaintGridAll(); //! only necessary parts
@@ -1379,7 +1379,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
}
// notify API objects
- pDoc->BroadcastUno( ScDataPilotModifiedHint(pOldObj->GetName()) );
+ rDoc.BroadcastUno( ScDataPilotModifiedHint(pOldObj->GetName()) );
aModificator.SetDocumentModified();
return true;
@@ -1401,8 +1401,8 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
if (bRecord)
pUndoDPObj.reset(new ScDPObject(rDPObj)); // copy old settings for undo
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
// delete table
@@ -1411,16 +1411,16 @@ bool ScDBDocFunc::RemovePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
SCTAB nTab = aRange.aStart.Tab();
if (bRecord)
- createUndoDoc(pOldUndoDoc, pDoc, aRange);
+ createUndoDoc(pOldUndoDoc, &rDoc, aRange);
- pDoc->DeleteAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
+ rDoc.DeleteAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(),
nTab, IDF_ALL );
- pDoc->RemoveFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
+ rDoc.RemoveFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(),
nTab, SC_MF_AUTO );
- pDoc->GetDPCollection()->FreeTable(&rDPObj); // object is deleted here
+ rDoc.GetDPCollection()->FreeTable(&rDPObj); // object is deleted here
rDocShell.PostPaintGridAll(); //! only necessary parts
rDocShell.PostPaint(aRange, PAINT_GRID);
@@ -1451,8 +1451,8 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
std::auto_ptr<ScDocument> pNewUndoDoc;
SAL_WNODEPRECATED_DECLARATIONS_POP
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
// output range must be set at pNewObj
@@ -1465,10 +1465,10 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
// #i94570# When changing the output position in the dialog, a new table is created
// with the settings from the old table, including the name.
// So we have to check for duplicate names here (before inserting).
- if (pDoc->GetDPCollection()->GetByName(rDestObj.GetName()))
+ if (rDoc.GetDPCollection()->GetByName(rDestObj.GetName()))
rDestObj.SetName(OUString()); // ignore the invalid name, create a new name below
- if (!pDoc->GetDPCollection()->InsertNewTable(pDestObj.release()))
+ if (!rDoc.GetDPCollection()->InsertNewTable(pDestObj.release()))
// Insertion into collection failed.
return false;
@@ -1478,7 +1478,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
// make sure the table has a name (not set by dialog)
if (rDestObj.GetName().isEmpty())
- rDestObj.SetName(pDoc->GetDPCollection()->CreateNewName());
+ rDestObj.SetName(rDoc.GetDPCollection()->CreateNewName());
bool bOverflow = false;
ScRange aNewOut = rDestObj.GetNewOutputRange(bOverflow);
@@ -1492,7 +1492,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
}
{
- ScEditableTester aTester(pDoc, aNewOut);
+ ScEditableTester aTester(&rDoc, aNewOut);
if (!aTester.IsEditable())
{
// destination area isn't editable
@@ -1506,7 +1506,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
// test if new output area is empty except for old area
if (!bApi)
{
- bool bEmpty = pDoc->IsBlockEmpty(
+ bool bEmpty = rDoc.IsBlockEmpty(
aNewOut.aStart.Tab(), aNewOut.aStart.Col(), aNewOut.aStart.Row(),
aNewOut.aEnd.Col(), aNewOut.aEnd.Row());
@@ -1525,7 +1525,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
}
if (bRecord)
- createUndoDoc(pNewUndoDoc, pDoc, aNewOut);
+ createUndoDoc(pNewUndoDoc, &rDoc, aNewOut);
rDestObj.Output(aNewOut.aStart);
rDocShell.PostPaintGridAll(); //! only necessary parts
@@ -1537,7 +1537,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
}
// notify API objects
- pDoc->BroadcastUno(ScDataPilotModifiedHint(rDestObj.GetName()));
+ rDoc.BroadcastUno(ScDataPilotModifiedHint(rDestObj.GetName()));
aModificator.SetDocumentModified();
return true;
@@ -1558,12 +1558,12 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
ScDPObject aUndoDPObj(rDPObj); // For undo or revert on failure.
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if (bRecord)
- createUndoDoc(pOldUndoDoc, pDoc, rDPObj.GetOutRange());
+ createUndoDoc(pOldUndoDoc, &rDoc, rDPObj.GetOutRange());
rDPObj.SetAllowMove(false);
rDPObj.ReloadGroupTableData();
@@ -1574,7 +1574,7 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
// make sure the table has a name (not set by dialog)
if (rDPObj.GetName().isEmpty())
- rDPObj.SetName( pDoc->GetDPCollection()->CreateNewName() );
+ rDPObj.SetName( rDoc.GetDPCollection()->CreateNewName() );
ScRange aNewOut;
if (!checkNewOutputRange(rDPObj, rDocShell, aNewOut, bApi))
@@ -1586,7 +1586,7 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
// test if new output area is empty except for old area
if (!bApi)
{
- if (!lcl_EmptyExcept(pDoc, aNewOut, rDPObj.GetOutRange()))
+ if (!lcl_EmptyExcept(&rDoc, aNewOut, rDPObj.GetOutRange()))
{
QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
@@ -1599,7 +1599,7 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
}
if (bRecord)
- createUndoDoc(pNewUndoDoc, pDoc, aNewOut);
+ createUndoDoc(pNewUndoDoc, &rDoc, aNewOut);
rDPObj.Output(aNewOut.aStart);
rDocShell.PostPaintGridAll(); //! only necessary parts
@@ -1612,14 +1612,14 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
}
// notify API objects
- pDoc->BroadcastUno( ScDataPilotModifiedHint(rDPObj.GetName()) );
+ rDoc.BroadcastUno( ScDataPilotModifiedHint(rDPObj.GetName()) );
aModificator.SetDocumentModified();
return true;
}
sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi)
{
- ScDPCollection* pDPs = rDocShell.GetDocument()->GetDPCollection();
+ ScDPCollection* pDPs = rDocShell.GetDocument().GetDPCollection();
if (!pDPs)
return 0;
@@ -1645,7 +1645,7 @@ void ScDBDocFunc::RefreshPivotTableGroups(ScDPObject* pDPObj)
if (!pDPObj)
return;
- ScDPCollection* pDPs = rDocShell.GetDocument()->GetDPCollection();
+ ScDPCollection* pDPs = rDocShell.GetDocument().GetDPCollection();
if (!pDPs)
return;
@@ -1681,8 +1681,8 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD
{
// rTarget is the name of a database range
- ScDocument* pDoc = rDocShell.GetDocument();
- ScDBCollection& rDBColl = *pDoc->GetDBCollection();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScDBCollection& rDBColl = *rDoc.GetDBCollection();
const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget));
if (!pData)
{
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 6f7d16161c78..8aec5c0c9feb 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -119,17 +119,17 @@ bool ScDBDocFunc::DoImportUno( const ScAddress& rPos,
bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
const svx::ODataAccessDescriptor* pDescriptor, bool bRecord, bool bAddrInsert )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
ScChangeTrack *pChangeTrack = NULL;
ScRange aChangedRange;
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScDBData* pDBData = NULL;
if ( !bAddrInsert )
{
- pDBData = pDoc->GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
+ pDBData = rDoc.GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
@@ -187,7 +187,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// ImportDoc - also used for Redo
ScDocument* pImportDoc = new ScDocument( SCDOCMODE_UNDO );
- pImportDoc->InitUndo( pDoc, nTab, nTab );
+ pImportDoc->InitUndo( &rDoc, nTab, nTab );
// get data from database into import document
@@ -413,7 +413,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
SCCOL nTestCol = rParam.nCol2 + 1; // right of the data
SCROW nTestRow = rParam.nRow1 + 1; // below the title row
while ( nTestCol <= MAXCOL &&
- pDoc->GetCellType(ScAddress( nTestCol, nTestRow, nTab )) == CELLTYPE_FORMULA )
+ rDoc.GetCellType(ScAddress( nTestCol, nTestRow, nTab )) == CELLTYPE_FORMULA )
++nTestCol, ++nFormulaCols;
}
@@ -421,14 +421,14 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
{
// old and new range editable?
ScEditableTester aTester;
- aTester.TestBlock( pDoc, nTab, rParam.nCol1,rParam.nRow1,rParam.nCol2,rParam.nRow2 );
- aTester.TestBlock( pDoc, nTab, rParam.nCol1,rParam.nRow1,nEndCol,nEndRow );
+ aTester.TestBlock( &rDoc, nTab, rParam.nCol1,rParam.nRow1,rParam.nCol2,rParam.nRow2 );
+ aTester.TestBlock( &rDoc, nTab, rParam.nCol1,rParam.nRow1,nEndCol,nEndRow );
if ( !aTester.IsEditable() )
{
nErrStringId = aTester.GetMessageId();
bSuccess = false;
}
- else if ( (pChangeTrack = pDoc->GetChangeTrack()) != NULL )
+ else if ( (pChangeTrack = rDoc.GetChangeTrack()) != NULL )
aChangedRange = ScRange(rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab );
}
@@ -439,7 +439,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
ScRange aNew( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab );
- if (!pDoc->CanFitBlock( aOld, aNew ))
+ if (!rDoc.CanFitBlock( aOld, aNew ))
{
nErrStringId = STR_MSSG_DOSUBTOTALS_2; // can't insert cells
bSuccess = false;
@@ -460,14 +460,14 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
SCCOL nMinEndCol = std::min( rParam.nCol2, nEndCol ); // not too much
nMinEndCol = sal::static_int_cast<SCCOL>( nMinEndCol + nFormulaCols ); // only if column count unchanged
pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, IDF_ATTRIB );
- pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
+ rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nMinEndCol, rParam.nRow1, nTab,
IDF_ATTRIB, false, pImportDoc );
SCROW nDataStartRow = rParam.nRow1+1;
for (SCCOL nCopyCol=rParam.nCol1; nCopyCol<=nMinEndCol; nCopyCol++)
{
- const ScPatternAttr* pSrcPattern = pDoc->GetPattern(
+ const ScPatternAttr* pSrcPattern = rDoc.GetPattern(
nCopyCol, nDataStartRow, nTab );
pImportDoc->ApplyPatternAreaTab( nCopyCol, nDataStartRow, nCopyCol, nEndRow,
nTab, *pSrcPattern );
@@ -479,7 +479,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
// don't set cell protection attribute if table is protected
- if (pDoc->IsTabProtected(nTab))
+ if (rDoc.IsTabProtected(nTab))
{
ScPatternAttr aPattern(pImportDoc->GetPool());
aPattern.GetItemSet().Put( ScProtectionAttr( false,false,false,false ) );
@@ -498,7 +498,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if ( bRecord )
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
if ( !bAddrInsert )
pUndoDBData = new ScDBData( *pDBData );
@@ -513,15 +513,15 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
sal_uInt16 nCopyFlags = IDF_ALL & ~IDF_NOTE;
// nFormulaCols is set only if column count is unchanged
- pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
+ rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
nCopyFlags, false, pUndoDoc );
if ( rParam.nCol2 > nEndCol )
- pDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
+ rDoc.CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nUndoEndCol, nUndoEndRow, nTab,
nCopyFlags, false, pUndoDoc );
if ( rParam.nRow2 > nEndRow )
- pDoc->CopyToDocument( rParam.nCol1, nEndRow+1, nTab,
+ rDoc.CopyToDocument( rParam.nCol1, nEndRow+1, nTab,
nUndoEndCol+nFormulaCols, nUndoEndRow, nTab,
nCopyFlags, false, pUndoDoc );
}
@@ -537,48 +537,48 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
ScRange aDelRange( rParam.nCol1, rParam.nRow1, nTab,
rParam.nCol2, rParam.nRow2, nTab );
- pDoc->DeleteAreaTab( aDelRange, IDF_ALL & ~IDF_NOTE ); // ohne die Formeln
+ rDoc.DeleteAreaTab( aDelRange, IDF_ALL & ~IDF_NOTE ); // ohne die Formeln
ScRange aOld( rParam.nCol1, rParam.nRow1, nTab,
rParam.nCol2+nFormulaCols, rParam.nRow2, nTab );
ScRange aNew( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab );
- pDoc->FitBlock( aOld, aNew, false ); // Formeln nicht loeschen
+ rDoc.FitBlock( aOld, aNew, false ); // Formeln nicht loeschen
}
else if ( nEndCol < rParam.nCol2 ) // DeleteArea calls PutInOrder
- pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
+ rDoc.DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
aNewMark, IDF_CONTENTS & ~IDF_NOTE );
// CopyToDocument doesn't remove contents
- pDoc->DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
+ rDoc.DeleteAreaTab( rParam.nCol1, rParam.nRow1, nEndCol, nEndRow, nTab, IDF_CONTENTS & ~IDF_NOTE );
// remove each column from ImportDoc after copying to reduce memory usage
- bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( false ); // outside of the loop
+ bool bOldAutoCalc = rDoc.GetAutoCalc();
+ rDoc.SetAutoCalc( false ); // outside of the loop
for (SCCOL nCopyCol = rParam.nCol1; nCopyCol <= nEndCol; nCopyCol++)
{
pImportDoc->CopyToDocument( nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab,
- IDF_ALL, false, pDoc );
+ IDF_ALL, false, &rDoc );
pImportDoc->DeleteAreaTab( nCopyCol, rParam.nRow1, nCopyCol, nEndRow, nTab, IDF_CONTENTS );
}
- pDoc->SetAutoCalc( bOldAutoCalc );
+ rDoc.SetAutoCalc( bOldAutoCalc );
if (nFormulaCols > 0) // copy formulas
{
if (bKeepFormat) // formats for formulas
pImportDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
- IDF_ATTRIB, false, pDoc );
+ IDF_ATTRIB, false, &rDoc );
// fill formulas
ScMarkData aMark;
aMark.SelectOneTable(nTab);
sal_uLong nProgCount = nFormulaCols;
nProgCount *= nEndRow-rParam.nRow1-1;
- ScProgress aProgress( pDoc->GetDocumentShell(),
+ ScProgress aProgress( rDoc.GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- pDoc->Fill( nEndCol+1, rParam.nRow1+1, nEndCol+nFormulaCols, rParam.nRow1+1,
+ rDoc.Fill( nEndCol+1, rParam.nRow1+1, nEndCol+nFormulaCols, rParam.nRow1+1,
&aProgress, aMark, nEndRow-rParam.nRow1-1, FILL_TO_BOTTOM, FILL_SIMPLE );
}
@@ -587,10 +587,10 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
if (!bMoveCells) // move has happened above
{
if ( rParam.nCol2 > nEndCol )
- pDoc->DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
+ rDoc.DeleteArea( nEndCol+1, rParam.nRow1, rParam.nCol2, rParam.nRow2,
aNewMark, IDF_CONTENTS );
if ( rParam.nRow2 > nEndRow )
- pDoc->DeleteArea( rParam.nCol1, nEndRow+1, rParam.nCol2, rParam.nRow2,
+ rDoc.DeleteArea( rParam.nCol1, nEndRow+1, rParam.nCol2, rParam.nRow2,
aNewMark, IDF_CONTENTS );
}
@@ -601,7 +601,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pDBData->SetByRow( true );
pDBData->SetArea( nTab, rParam.nCol1,rParam.nRow1, nEndCol,nEndRow );
pDBData->SetImportSelection( bRealSelection );
- pDoc->CompileDBFormula();
+ rDoc.CompileDBFormula();
}
if (bRecord)
@@ -610,7 +610,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
pImportDoc = NULL;
if (nFormulaCols > 0) // include filled formulas for redo
- pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
+ rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab,
nEndCol+nFormulaCols, nEndRow, nTab,
IDF_ALL & ~IDF_NOTE, false, pRedoDoc );
@@ -624,12 +624,12 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
}
sc::SetFormulaDirtyContext aCxt;
- pDoc->SetAllFormulasDirty(aCxt);
+ rDoc.SetAllFormulasDirty(aCxt);
rDocShell.PostPaint(ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab), PAINT_GRID);
aModificator.SetDocumentModified();
ScDBRangeRefreshedHint aHint( rParam );
- pDoc->BroadcastUno( aHint );
+ rDoc.BroadcastUno( aHint );
if (pWaitWin)
pWaitWin->LeaveWait();
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index b67ef09bbfbf..fbac2b51c6ef 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -102,7 +102,7 @@ using ::std::vector;
IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
{
// #i101118# if drawing layer collects the undo actions, add it there
- ScDrawLayer* pDrawLayer = rDocShell.GetDocument()->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDocShell.GetDocument().GetDrawLayer();
if( pDrawLayer && pDrawLayer->IsRecording() )
pDrawLayer->AddCalcUndo( pUndoAction );
else
@@ -110,11 +110,11 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction )
rDocShell.SetDrawModified();
// the affected sheet isn't known, so all stream positions are invalidated
- ScDocument* pDoc = rDocShell.GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
return 0;
}
@@ -134,13 +134,13 @@ static void lcl_PaintAbove( ScDocShell& rDocShell, const ScRange& rRange )
bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if ( pDoc->IsImportingXML() )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if ( rDoc.IsImportingXML() )
{
// for XML import, all row heights are updated together after importing
return false;
}
- if ( !pDoc->IsAdjustHeightEnabled() )
+ if ( !rDoc.IsAdjustHeightEnabled() )
{
return false;
}
@@ -153,7 +153,7 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint )
Fraction aOne(1,1);
sc::RowHeightContext aCxt(aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, aProv.GetDevice());
- bool bChanged = pDoc->SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab);
+ bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab);
if ( bPaint && bChanged )
rDocShell.PostPaint(ScRange(0, nStartRow, nTab, MAXCOL, MAXROW, nTab),
@@ -168,23 +168,23 @@ bool ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
SCCOL nCol = rPos.Col();
SCROW nRow = rPos.Row();
SCTAB nTab = rPos.Tab();
if (bUndo)
pModel->BeginCalcUndo(false);
- bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowPred( nCol, nRow );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).ShowPred( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
if (bDone)
{
ScDetOpData aOperation( ScAddress(nCol,nRow,nTab), SCDETOP_ADDPRED );
- pDoc->AddDetectiveOperation( aOperation );
+ rDoc.AddDetectiveOperation( aOperation );
if (bUndo)
{
rDocShell.GetUndoManager()->AddUndoAction(
@@ -203,10 +203,10 @@ bool ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ bool bUndo(rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
if (!pModel)
return false;
@@ -218,14 +218,14 @@ bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo(false);
- bool bDone = ScDetectiveFunc( pDoc,nTab ).DeletePred( nCol, nRow );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeletePred( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
if (bDone)
{
ScDetOpData aOperation( ScAddress(nCol,nRow,nTab), SCDETOP_DELPRED );
- pDoc->AddDetectiveOperation( aOperation );
+ rDoc.AddDetectiveOperation( aOperation );
if (bUndo)
{
rDocShell.GetUndoManager()->AddUndoAction(
@@ -247,24 +247,24 @@ bool ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ bool bUndo(rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
SCCOL nCol = rPos.Col();
SCROW nRow = rPos.Row();
SCTAB nTab = rPos.Tab();
if (bUndo)
pModel->BeginCalcUndo(false);
- bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowSucc( nCol, nRow );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).ShowSucc( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
if (bDone)
{
ScDetOpData aOperation( ScAddress(nCol,nRow,nTab), SCDETOP_ADDSUCC );
- pDoc->AddDetectiveOperation( aOperation );
+ rDoc.AddDetectiveOperation( aOperation );
if (bUndo)
{
rDocShell.GetUndoManager()->AddUndoAction(
@@ -283,10 +283,10 @@ bool ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
if (!pModel)
return false;
@@ -298,14 +298,14 @@ bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
if (bUndo)
pModel->BeginCalcUndo(false);
- bool bDone = ScDetectiveFunc( pDoc,nTab ).DeleteSucc( nCol, nRow );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeleteSucc( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
if (bDone)
{
ScDetOpData aOperation( ScAddress(nCol,nRow,nTab), SCDETOP_DELSUCC );
- pDoc->AddDetectiveOperation( aOperation );
+ rDoc.AddDetectiveOperation( aOperation );
if (bUndo)
{
rDocShell.GetUndoManager()->AddUndoAction(
@@ -327,24 +327,24 @@ bool ScDocFunc::DetectiveAddError(const ScAddress& rPos)
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
SCCOL nCol = rPos.Col();
SCROW nRow = rPos.Row();
SCTAB nTab = rPos.Tab();
if (bUndo)
pModel->BeginCalcUndo(false);
- bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowError( nCol, nRow );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).ShowError( nCol, nRow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
if (bDone)
{
ScDetOpData aOperation( ScAddress(nCol,nRow,nTab), SCDETOP_ADDERROR );
- pDoc->AddDetectiveOperation( aOperation );
+ rDoc.AddDetectiveOperation( aOperation );
if (bUndo)
{
rDocShell.GetUndoManager()->AddUndoAction(
@@ -366,10 +366,10 @@ bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
ScDocShellModificator aModificator( rDocShell );
rDocShell.MakeDrawLayer();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
Window* pWaitWin = rDocShell.GetActiveDialogParent();
if (pWaitWin)
@@ -377,7 +377,7 @@ bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
if (bUndo)
pModel->BeginCalcUndo(false);
bool bOverflow;
- bool bDone = ScDetectiveFunc( pDoc,nTab ).MarkInvalid( bOverflow );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).MarkInvalid( bOverflow );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
@@ -405,10 +405,10 @@ bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
if (!pModel)
return false;
@@ -416,18 +416,18 @@ bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
if (bUndo)
pModel->BeginCalcUndo(false);
- bool bDone = ScDetectiveFunc( pDoc,nTab ).DeleteAll( SC_DET_DETECTIVE );
+ bool bDone = ScDetectiveFunc( &rDoc,nTab ).DeleteAll( SC_DET_DETECTIVE );
SdrUndoGroup* pUndo = NULL;
if (bUndo)
pUndo = pModel->GetCalcUndo();
if (bDone)
{
- ScDetOpList* pOldList = pDoc->GetDetOpList();
+ ScDetOpList* pOldList = rDoc.GetDetOpList();
ScDetOpList* pUndoList = NULL;
if (bUndo)
pUndoList = pOldList ? new ScDetOpList(*pOldList) : NULL;
- pDoc->ClearDetectiveOperations();
+ rDoc.ClearDetectiveOperations();
if (bUndo)
{
@@ -448,22 +448,22 @@ bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
bool ScDocFunc::DetectiveRefresh( bool bAutomatic )
{
bool bDone = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScDetOpList* pList = pDoc->GetDetOpList();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScDetOpList* pList = rDoc.GetDetOpList();
if ( pList && pList->Count() )
{
rDocShell.MakeDrawLayer();
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
if (bUndo)
pModel->BeginCalcUndo(false);
// Loeschen auf allen Tabellen
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- ScDetectiveFunc( pDoc,nTab ).DeleteAll( SC_DET_ARROWS ); // don't remove circles
+ ScDetectiveFunc( &rDoc,nTab ).DeleteAll( SC_DET_ARROWS ); // don't remove circles
// Wiederholen
@@ -474,7 +474,7 @@ bool ScDocFunc::DetectiveRefresh( bool bAutomatic )
if (pData)
{
ScAddress aPos = pData->GetPos();
- ScDetectiveFunc aFunc( pDoc, aPos.Tab() );
+ ScDetectiveFunc aFunc( &rDoc, aPos.Tab() );
SCCOL nCol = aPos.Col();
SCROW nRow = aPos.Row();
switch (pData->GetOperation())
@@ -522,13 +522,13 @@ static void lcl_collectAllPredOrSuccRanges(
const ScRangeList& rSrcRanges, vector<ScTokenRef>& rRefTokens, ScDocShell& rDocShell,
bool bPred)
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
vector<ScTokenRef> aRefTokens;
ScRangeList aSrcRanges(rSrcRanges);
if (aSrcRanges.empty())
return;
ScRange* p = aSrcRanges.front();
- ScDetectiveFunc aDetFunc(pDoc, p->aStart.Tab());
+ ScDetectiveFunc aDetFunc(&rDoc, p->aStart.Tab());
ScRangeList aDestRanges;
for (size_t i = 0, n = aSrcRanges.size(); i < n; ++i)
{
@@ -568,12 +568,12 @@ bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
return false;
}
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScEditableTester aTester( pDoc, rMark );
+ ScEditableTester aTester( &rDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -591,7 +591,7 @@ bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
aMultiMark.MarkToMulti();
aMultiMark.GetMultiMarkArea( aMarkRange );
ScRange aExtendedRange(aMarkRange);
- if ( pDoc->ExtendMerge( aExtendedRange, true ) )
+ if ( rDoc.ExtendMerge( aExtendedRange, true ) )
bMulti = false;
// keine Objekte auf geschuetzten Tabellen
@@ -599,10 +599,10 @@ bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
if ( nFlags & IDF_OBJECTS )
{
bObjects = true;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
- if (pDoc->IsTabProtected(*itr))
+ if (rDoc.IsTabProtected(*itr))
bObjects = false;
}
@@ -618,14 +618,14 @@ bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
bool bDrawUndo = bObjects || (nFlags & IDF_NOTE);
if (bRecord && bDrawUndo)
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
if (bObjects)
{
if (bMulti)
- pDoc->DeleteObjectsInSelection( aMultiMark );
+ rDoc.DeleteObjectsInSelection( aMultiMark );
else
- pDoc->DeleteObjectsInArea( aMarkRange.aStart.Col(), aMarkRange.aStart.Row(),
+ rDoc.DeleteObjectsInArea( aMarkRange.aStart.Col(), aMarkRange.aStart.Row(),
aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(),
aMultiMark );
}
@@ -633,7 +633,7 @@ bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
if ( bRecord )
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, aMarkRange.aStart.Tab(), aMarkRange.aEnd.Tab() );
+ pUndoDoc->InitUndo( &rDoc, aMarkRange.aStart.Tab(), aMarkRange.aEnd.Tab() );
// bei "Format/Standard" alle Attribute kopieren, weil CopyToDocument
// nur mit IDF_HARDATTR zu langsam ist:
@@ -646,11 +646,11 @@ bool ScDocFunc::DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags,
nUndoDocFlags |= IDF_CONTENTS; // copy all cells with their notes
// note captions are handled in drawing undo
nUndoDocFlags |= IDF_NOCAPTIONS;
- pDoc->CopyToDocument( aExtendedRange, nUndoDocFlags, bMulti, pUndoDoc, &aMultiMark );
+ rDoc.CopyToDocument( aExtendedRange, nUndoDocFlags, bMulti, pUndoDoc, &aMultiMark );
}
//! HideAllCursors(); // falls Zusammenfassung aufgehoben wird
- pDoc->DeleteSelection( nFlags, aMultiMark );
+ rDoc.DeleteSelection( nFlags, aMultiMark );
// add undo action after drawing undo is complete (objects and note captions)
if( bRecord )
@@ -673,11 +673,11 @@ bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScEditableTester aTester( pDoc, rMark );
+ ScEditableTester aTester( &rDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -694,10 +694,10 @@ bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
if (bRecord)
{
SCTAB nStartTab = aMarkRange.aStart.Tab();
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nStartTab );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nStartTab );
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
if (*itr != nStartTab)
@@ -706,13 +706,13 @@ bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
ScRange aCopyRange = aMarkRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_CONTENTS, true, pUndoDoc, &aMultiMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_CONTENTS, true, pUndoDoc, &aMultiMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoTransliterate( &rDocShell, aMultiMark, pUndoDoc, nType ) );
}
- pDoc->TransliterateText( aMultiMark, nType );
+ rDoc.TransliterateText( aMultiMark, nType );
if (!AdjustRowHeight( aMarkRange ))
rDocShell.PostPaint( aMarkRange, PAINT_GRID );
@@ -725,10 +725,10 @@ bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const OUString& rText, bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
- ScEditableTester aTester( pDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
+ bool bUndo(rDoc.IsUndoEnabled());
+ ScEditableTester aTester( &rDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -736,7 +736,7 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con
return false;
}
- bool bEditDeleted = (pDoc->GetCellType(rPos) == CELLTYPE_EDIT);
+ bool bEditDeleted = (rDoc.GetCellType(rPos) == CELLTYPE_EDIT);
ScUndoEnterData::ValuesType aOldValues;
if (bUndo)
@@ -744,10 +744,10 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con
ScUndoEnterData::Value aOldValue;
aOldValue.mnTab = rPos.Tab();
- aOldValue.maCell.assign(*pDoc, rPos);
+ aOldValue.maCell.assign(rDoc, rPos);
const SfxPoolItem* pItem;
- const ScPatternAttr* pPattern = pDoc->GetPattern( rPos.Col(),rPos.Row(),rPos.Tab() );
+ const ScPatternAttr* pPattern = rDoc.GetPattern( rPos.Col(),rPos.Row(),rPos.Tab() );
if ( SFX_ITEM_SET == pPattern->GetItemSet().GetItemState(
ATTR_VALUE_FORMAT,false,&pItem) )
{
@@ -760,7 +760,7 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con
aOldValues.push_back(aOldValue);
}
- o_rbNumFmtSet = pDoc->SetString( rPos.Col(), rPos.Row(), rPos.Tab(), rText );
+ o_rbNumFmtSet = rDoc.SetString( rPos.Col(), rPos.Row(), rPos.Tab(), rText );
if (bUndo)
{
@@ -769,7 +769,7 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con
new ScUndoEnterData(&rDocShell, rPos, aOldValues, rText, NULL));
}
- if ( bEditDeleted || pDoc->HasAttrib( ScRange(rPos), HASATTR_NEEDHEIGHT ) )
+ if ( bEditDeleted || rDoc.HasAttrib( ScRange(rPos), HASATTR_NEEDHEIGHT ) )
AdjustRowHeight( ScRange(rPos) );
rDocShell.PostPaintCell( rPos );
@@ -785,22 +785,22 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con
bool ScDocFunc::SetValueCell( const ScAddress& rPos, double fVal, bool bInteraction )
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo = rDoc.IsUndoEnabled();
- bool bHeight = pDoc->HasAttrib(rPos, HASATTR_NEEDHEIGHT);
+ bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT);
ScCellValue aOldVal;
if (bUndo)
- aOldVal.assign(*pDoc, rPos);
+ aOldVal.assign(rDoc, rPos);
- pDoc->SetValue(rPos, fVal);
+ rDoc.SetValue(rPos, fVal);
if (bUndo)
{
svl::IUndoManager* pUndoMgr = rDocShell.GetUndoManager();
ScCellValue aNewVal;
- aNewVal.assign(*pDoc, rPos);
+ aNewVal.assign(rDoc, rPos);
pUndoMgr->AddUndoAction(new ScUndoSetCell(&rDocShell, rPos, aOldVal, aNewVal));
}
@@ -829,18 +829,18 @@ bool ScDocFunc::SetValueCells( const ScAddress& rPos, const std::vector<double>&
aRange.aEnd.SetRow(nLastRow);
ScDocShellModificator aModificator(rDocShell);
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (pDoc->IsUndoEnabled())
+ if (rDoc.IsUndoEnabled())
{
sc::UndoSetCells* pUndoObj = new sc::UndoSetCells(&rDocShell, rPos);
- pDoc->TransferCellValuesTo(rPos, aVals.size(), pUndoObj->GetOldValues());
+ rDoc.TransferCellValuesTo(rPos, aVals.size(), pUndoObj->GetOldValues());
pUndoObj->SetNewValues(aVals);
svl::IUndoManager* pUndoMgr = rDocShell.GetUndoManager();
pUndoMgr->AddUndoAction(pUndoObj);
}
- pDoc->SetValues(rPos, aVals);
+ rDoc.SetValues(rPos, aVals);
rDocShell.PostPaint(aRange, PAINT_GRID);
aModificator.SetDocumentModified();
@@ -855,24 +855,24 @@ bool ScDocFunc::SetValueCells( const ScAddress& rPos, const std::vector<double>&
bool ScDocFunc::SetStringCell( const ScAddress& rPos, const OUString& rStr, bool bInteraction )
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo = rDoc.IsUndoEnabled();
- bool bHeight = pDoc->HasAttrib(rPos, HASATTR_NEEDHEIGHT);
+ bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT);
ScCellValue aOldVal;
if (bUndo)
- aOldVal.assign(*pDoc, rPos);
+ aOldVal.assign(rDoc, rPos);
ScSetStringParam aParam;
aParam.setTextInput();
- pDoc->SetString(rPos, rStr, &aParam);
+ rDoc.SetString(rPos, rStr, &aParam);
if (bUndo)
{
svl::IUndoManager* pUndoMgr = rDocShell.GetUndoManager();
ScCellValue aNewVal;
- aNewVal.assign(*pDoc, rPos);
+ aNewVal.assign(rDoc, rPos);
pUndoMgr->AddUndoAction(new ScUndoSetCell(&rDocShell, rPos, aOldVal, aNewVal));
}
@@ -892,22 +892,22 @@ bool ScDocFunc::SetStringCell( const ScAddress& rPos, const OUString& rStr, bool
bool ScDocFunc::SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, bool bInteraction )
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo = rDoc.IsUndoEnabled();
- bool bHeight = pDoc->HasAttrib(rPos, HASATTR_NEEDHEIGHT);
+ bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT);
ScCellValue aOldVal;
if (bUndo)
- aOldVal.assign(*pDoc, rPos);
+ aOldVal.assign(rDoc, rPos);
- pDoc->SetEditText(rPos, rStr.Clone());
+ rDoc.SetEditText(rPos, rStr.Clone());
if (bUndo)
{
svl::IUndoManager* pUndoMgr = rDocShell.GetUndoManager();
ScCellValue aNewVal;
- aNewVal.assign(*pDoc, rPos);
+ aNewVal.assign(rDoc, rPos);
pUndoMgr->AddUndoAction(new ScUndoSetCell(&rDocShell, rPos, aOldVal, aNewVal));
}
@@ -926,11 +926,11 @@ bool ScDocFunc::SetEditCell( const ScAddress& rPos, const EditTextObject& rStr,
bool ScDocFunc::SetStringOrEditCell( const ScAddress& rPos, const OUString& rStr, bool bInteraction )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
if (ScStringUtil::isMultiline(rStr))
{
- ScFieldEditEngine& rEngine = pDoc->GetEditEngine();
+ ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
rEngine.SetText(rStr);
boost::scoped_ptr<EditTextObject> pEditText(rEngine.CreateTextObject());
return SetEditCell(rPos, *pEditText, bInteraction);
@@ -946,34 +946,34 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo
SAL_WNODEPRECATED_DECLARATIONS_POP
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo = rDoc.IsUndoEnabled();
- bool bHeight = pDoc->HasAttrib(rPos, HASATTR_NEEDHEIGHT);
+ bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT);
ScCellValue aOldVal;
if (bUndo)
- aOldVal.assign(*pDoc, rPos);
+ aOldVal.assign(rDoc, rPos);
- pCell = pDoc->SetFormulaCell(rPos, xCell.release());
+ pCell = rDoc.SetFormulaCell(rPos, xCell.release());
// For performance reasons API calls may disable calculation while
// operating and recalculate once when done. If through user interaction
// and AutoCalc is disabled, calculate the formula (without its
// dependencies) once so the result matches the current document's content.
- if (bInteraction && !pDoc->GetAutoCalc() && pCell)
+ if (bInteraction && !rDoc.GetAutoCalc() && pCell)
{
// calculate just the cell once and set Dirty again
pCell->Interpret();
pCell->SetDirtyVar();
- pDoc->PutInFormulaTree( pCell);
+ rDoc.PutInFormulaTree( pCell);
}
if (bUndo)
{
svl::IUndoManager* pUndoMgr = rDocShell.GetUndoManager();
ScCellValue aNewVal;
- aNewVal.assign(*pDoc, rPos);
+ aNewVal.assign(rDoc, rPos);
pUndoMgr->AddUndoAction(new ScUndoSetCell(&rDocShell, rPos, aOldVal, aNewVal));
}
@@ -993,7 +993,7 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo
void ScDocFunc::NotifyInputHandler( const ScAddress& rPos )
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- if ( pViewSh && pViewSh->GetViewData()->GetDocShell() == &rDocShell )
+ if ( pViewSh && pViewSh->GetViewData().GetDocShell() == &rDocShell )
{
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
if ( pInputHdl && pInputHdl->GetCursorPos() == rPos )
@@ -1025,7 +1025,7 @@ bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
// PutData ruft PutCell oder SetNormalString
bool bRet = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
ScEditAttrTester aTester( &rEngine );
bool bEditCell = aTester.NeedsObject();
if ( bEditCell )
@@ -1033,7 +1033,7 @@ bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
// #i61702# With bLoseContent set, the content of rEngine isn't restored
// (used in loading XML, where after the removeActionLock call the API object's
// EditEngine isn't accessed again.
- bool bLoseContent = pDoc->IsImportingXML();
+ bool bLoseContent = rDoc.IsImportingXML();
bool bUpdateMode(rEngine.GetUpdateMode());
if (bUpdateMode)
@@ -1097,9 +1097,9 @@ bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
if ( bRet && aTester.NeedsCellAttr() )
{
const SfxItemSet& rEditAttr = aTester.GetAttribs();
- ScPatternAttr aPattern( pDoc->GetPool() );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetFromEditItemSet( &rEditAttr );
- aPattern.DeleteUnchanged( pDoc->GetPattern( rPos.Col(), rPos.Row(), rPos.Tab() ) );
+ aPattern.DeleteUnchanged( rDoc.GetPattern( rPos.Col(), rPos.Row(), rPos.Tab() ) );
aPattern.GetItemSet().ClearItem( ATTR_HOR_JUSTIFY ); // wasn't removed above if no edit object
if ( aPattern.GetItemSet().Count() > 0 )
{
@@ -1132,19 +1132,19 @@ bool ScDocFunc::SetCellText(
{
if ( bEnglish )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
::boost::scoped_ptr<ScExternalRefManager::ApiGuard> pExtRefGuard;
if (bApi)
- pExtRefGuard.reset(new ScExternalRefManager::ApiGuard(pDoc));
+ pExtRefGuard.reset(new ScExternalRefManager::ApiGuard(&rDoc));
ScInputStringType aRes =
- ScStringUtil::parseInputString(*pDoc->GetFormatTable(), rText, LANGUAGE_ENGLISH_US);
+ ScStringUtil::parseInputString(*rDoc.GetFormatTable(), rText, LANGUAGE_ENGLISH_US);
switch (aRes.meType)
{
case ScInputStringType::Formula:
- bSet = SetFormulaCell(rPos, new ScFormulaCell(pDoc, rPos, aRes.maText, eGrammar), !bApi);
+ bSet = SetFormulaCell(rPos, new ScFormulaCell(&rDoc, rPos, aRes.maText, eGrammar), !bApi);
break;
case ScInputStringType::Number:
bSet = SetValueCell(rPos, aRes.mfValue, !bApi);
@@ -1173,7 +1173,7 @@ bool ScDocFunc::SetCellText(
bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow )
{
- ScDocument& rDoc = *rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
ScPostIt* pNote = rDoc.GetNote( rPos );
if( !pNote || (bShow == pNote->IsCaptionShown()) ) return false;
@@ -1194,8 +1194,8 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const OUString& rText, bool
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- ScEditableTester aTester( pDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScEditableTester aTester( &rDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -1205,13 +1205,13 @@ bool ScDocFunc::SetNoteText( const ScAddress& rPos, const OUString& rText, bool
OUString aNewText = convertLineEnd(rText, GetSystemLineEnd()); //! ist das noetig ???
- if( ScPostIt* pNote = (!aNewText.isEmpty()) ? pDoc->GetOrCreateNote( rPos ) : pDoc->GetNote(rPos) )
+ if( ScPostIt* pNote = (!aNewText.isEmpty()) ? rDoc.GetOrCreateNote( rPos ) : rDoc.GetNote(rPos) )
pNote->SetText( rPos, aNewText );
//! Undo !!!
- if (pDoc->IsStreamValid(rPos.Tab()))
- pDoc->SetStreamValid(rPos.Tab(), false);
+ if (rDoc.IsStreamValid(rPos.Tab()))
+ rDoc.SetStreamValid(rPos.Tab(), false);
rDocShell.PostPaintCell( rPos );
aModificator.SetDocumentModified();
@@ -1224,7 +1224,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c
bool bDone = false;
ScDocShellModificator aModificator( rDocShell );
- ScDocument& rDoc = *rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
ScEditableTester aTester( &rDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
if (aTester.IsEditable())
{
@@ -1282,15 +1282,15 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c
bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& rPattern,
bool bRecord, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if ( bRecord && !pDoc->IsUndoEnabled() )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if ( bRecord && !rDoc.IsUndoEnabled() )
bRecord = false;
- bool bImportingXML = pDoc->IsImportingXML();
+ bool bImportingXML = rDoc.IsImportingXML();
// Cell formats can still be set if the range isn't editable only because of matrix formulas.
// #i62483# When loading XML, the check can be skipped altogether.
bool bOnlyNotBecauseOfMatrix;
- if ( !bImportingXML && !pDoc->IsSelectionEditable( rMark, &bOnlyNotBecauseOfMatrix )
+ if ( !bImportingXML && !rDoc.IsSelectionEditable( rMark, &bOnlyNotBecauseOfMatrix )
&& !bOnlyNotBecauseOfMatrix )
{
if (!bApi)
@@ -1312,8 +1312,8 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
if ( bRecord )
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, aMultiRange.aStart.Tab(), aMultiRange.aEnd.Tab() );
- pDoc->CopyToDocument( aMultiRange, IDF_ATTRIB, bMulti, pUndoDoc, &rMark );
+ pUndoDoc->InitUndo( &rDoc, aMultiRange.aStart.Tab(), aMultiRange.aEnd.Tab() );
+ rDoc.CopyToDocument( aMultiRange, IDF_ATTRIB, bMulti, pUndoDoc, &rMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoSelectionAttr(
@@ -1327,7 +1327,7 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
sal_uInt16 nExtFlags = 0;
if ( !bImportingXML )
rDocShell.UpdatePaintExt( nExtFlags, aMultiRange ); // content before the change
- pDoc->ApplySelectionPattern( rPattern, rMark );
+ rDoc.ApplySelectionPattern( rPattern, rMark );
if ( !bImportingXML )
rDocShell.UpdatePaintExt( nExtFlags, aMultiRange ); // content after the change
@@ -1345,15 +1345,15 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r
bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
bool bRecord, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if ( bRecord && !pDoc->IsUndoEnabled() )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if ( bRecord && !rDoc.IsUndoEnabled() )
bRecord = false;
- bool bImportingXML = pDoc->IsImportingXML();
+ bool bImportingXML = rDoc.IsImportingXML();
// Cell formats can still be set if the range isn't editable only because of matrix formulas.
// #i62483# When loading XML, the check can be skipped altogether.
bool bOnlyNotBecauseOfMatrix;
- if ( !bImportingXML && !pDoc->IsSelectionEditable( rMark, &bOnlyNotBecauseOfMatrix )
+ if ( !bImportingXML && !rDoc.IsSelectionEditable( rMark, &bOnlyNotBecauseOfMatrix )
&& !bOnlyNotBecauseOfMatrix )
{
if (!bApi)
@@ -1361,7 +1361,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
return false;
}
- ScStyleSheet* pStyleSheet = (ScStyleSheet*) pDoc->GetStyleSheetPool()->Find(
+ ScStyleSheet* pStyleSheet = (ScStyleSheet*) rDoc.GetStyleSheetPool()->Find(
rStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
return false;
@@ -1379,8 +1379,8 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
SCTAB nStartTab = aMultiRange.aStart.Tab();
- SCTAB nTabCount = pDoc->GetTableCount();
- pUndoDoc->InitUndo( pDoc, nStartTab, nStartTab );
+ SCTAB nTabCount = rDoc.GetTableCount();
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nStartTab );
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
if (*itr != nStartTab)
@@ -1389,7 +1389,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
ScRange aCopyRange = aMultiRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, pUndoDoc, &rMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, pUndoDoc, &rMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoSelectionStyle(
@@ -1397,7 +1397,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
}
- pDoc->ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, rMark );
+ rDoc.ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, rMark );
if (!AdjustRowHeight( aMultiRange ))
rDocShell.PostPaint( aMultiRange, PAINT_GRID, 0 );
@@ -1602,8 +1602,8 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
return false;
}
- ScDocument* pDoc = rDocShell.GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCCOL nPaintStartCol = nStartCol;
SCROW nPaintStartRow = nStartRow;
SCCOL nPaintEndCol = nEndCol;
@@ -1617,11 +1617,11 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nCursorRow = 0;
if( pViewSh )
{
- nCursorCol = pViewSh->GetViewData()->GetCurX();
- nCursorRow = pViewSh->GetViewData()->GetCurY();
+ nCursorCol = pViewSh->GetViewData().GetCurX();
+ nCursorRow = pViewSh->GetViewData().GetCurY();
}
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
@@ -1632,7 +1632,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nCount = 0;
for( i=0; i<nTabCount; i++ )
{
- if( !pDoc->IsScenario(i) )
+ if( !rDoc.IsScenario(i) )
{
nCount++;
if( nCount == nEndTab+1 )
@@ -1647,7 +1647,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScMarkData aFullMark( aMark ); // including scenario sheets
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
- for( SCTAB j = *itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j = *itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
aFullMark.SelectTable( j, true );
SCTAB nSelCount = aMark.GetSelectCount();
@@ -1662,10 +1662,10 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aExtendMergeRange( rRange );
- if( rRange.aStart == rRange.aEnd && pDoc->HasAttrib(rRange, HASATTR_MERGED) )
+ if( rRange.aStart == rRange.aEnd && rDoc.HasAttrib(rRange, HASATTR_MERGED) )
{
- pDoc->ExtendMerge( aExtendMergeRange );
- pDoc->ExtendOverlapped( aExtendMergeRange );
+ rDoc.ExtendMerge( aExtendMergeRange );
+ rDoc.ExtendOverlapped( aExtendMergeRange );
nMergeTestEndCol = aExtendMergeRange.aEnd.Col();
nMergeTestEndRow = aExtendMergeRange.aEnd.Row();
nPaintEndCol = nMergeTestEndCol;
@@ -1691,7 +1691,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCCOL nEditTestEndCol = (eCmd==INS_INSCOLS) ? MAXCOL : nMergeTestEndCol;
SCROW nEditTestEndRow = (eCmd==INS_INSROWS) ? MAXROW : nMergeTestEndRow;
- ScEditableTester aTester( pDoc, nMergeTestStartCol, nMergeTestStartRow, nEditTestEndCol, nEditTestEndRow, aMark );
+ ScEditableTester aTester( &rDoc, nMergeTestStartCol, nMergeTestStartRow, nEditTestEndCol, nEditTestEndRow, aMark );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -1700,7 +1700,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
}
// Check if this insertion is allowed with respect to pivot table.
- if (!canInsertCellsByPivot(rRange, aMark, eCmd, pDoc))
+ if (!canInsertCellsByPivot(rRange, aMark, eCmd, &rDoc))
{
if (!bApi)
rDocShell.ErrorMessage(STR_NO_INSERT_DELETE_OVER_PIVOT_TABLE);
@@ -1714,13 +1714,13 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if ( bRecord )
{
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
+ pRefUndoDoc->InitUndo( &rDoc, 0, nTabCount-1, false, false );
// pRefUndoDoc is filled in InsertCol / InsertRow
- pUndoData = new ScRefUndoData( pDoc );
+ pUndoData = new ScRefUndoData( &rDoc );
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
// #i8302 : we unmerge overwhelming ranges, before insertion all the actions are put in the same ListAction
@@ -1735,7 +1735,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
for (; itr != itrEnd && nTabCount; ++itr)
{
i = *itr;
- if( pDoc->HasAttrib( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HASATTR_MERGED | HASATTR_OVERLAPPED ) )
+ if( rDoc.HasAttrib( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{
if (eCmd==INS_CELLSRIGHT)
bNeedRefresh = true;
@@ -1745,8 +1745,8 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCCOL nMergeEndCol = nMergeTestEndCol;
SCROW nMergeEndRow = nMergeTestEndRow;
- pDoc->ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
- pDoc->ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
+ rDoc.ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
+ rDoc.ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
if(( eCmd == INS_CELLSDOWN && ( nMergeStartCol != nMergeTestStartCol || nMergeEndCol != nMergeTestEndCol )) ||
(eCmd == INS_CELLSRIGHT && ( nMergeStartRow != nMergeTestStartRow || nMergeEndRow != nMergeTestEndRow )) )
@@ -1762,7 +1762,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nTestRow1 = -1;
SCROW nTestRow2 = -1;
- ScDocAttrIterator aTestIter( pDoc, i, nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow );
+ ScDocAttrIterator aTestIter( &rDoc, i, nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow );
ScRange aExtendRange( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i );
const ScPatternAttr* pPattern = NULL;
const ScMergeAttr* pMergeFlag = NULL;
@@ -1775,16 +1775,16 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER )
{
ScRange aRange( nTestCol, nTestRow1, i );
- pDoc->ExtendOverlapped(aRange);
- pDoc->ExtendMerge(aRange, true);
+ rDoc.ExtendOverlapped(aRange);
+ rDoc.ExtendMerge(aRange, true);
if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR )
{
for( SCROW nTestRow = nTestRow1; nTestRow <= nTestRow2; nTestRow++ )
{
ScRange aTestRange( nTestCol, nTestRow, i );
- pDoc->ExtendOverlapped( aTestRange );
- pDoc->ExtendMerge( aTestRange, true);
+ rDoc.ExtendOverlapped( aTestRange );
+ rDoc.ExtendMerge( aTestRange, true);
ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
if( !aExtendRange.In( aMergeRange ) )
{
@@ -1841,7 +1841,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
for( ::std::vector<ScRange>::const_iterator iIter( qIncreaseRange.begin()); iIter != qIncreaseRange.end(); ++iIter )
{
ScRange aRange( *iIter );
- if( pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
+ if( rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
UnmergeCells( aRange, true );
}
@@ -1862,22 +1862,22 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
switch (eCmd)
{
case INS_CELLSDOWN:
- bSuccess = pDoc->InsertRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &aFullMark );
+ bSuccess = rDoc.InsertRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &aFullMark );
nPaintEndRow = MAXROW;
break;
case INS_INSROWS:
- bSuccess = pDoc->InsertRow( 0, 0, MAXCOL, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &aFullMark );
+ bSuccess = rDoc.InsertRow( 0, 0, MAXCOL, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &aFullMark );
nPaintStartCol = 0;
nPaintEndCol = MAXCOL;
nPaintEndRow = MAXROW;
nPaintFlags |= PAINT_LEFT;
break;
case INS_CELLSRIGHT:
- bSuccess = pDoc->InsertCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &aFullMark );
+ bSuccess = rDoc.InsertCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &aFullMark );
nPaintEndCol = MAXCOL;
break;
case INS_INSCOLS:
- bSuccess = pDoc->InsertCol( 0, 0, MAXROW, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &aFullMark );
+ bSuccess = rDoc.InsertCol( 0, 0, MAXROW, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &aFullMark );
nPaintStartRow = 0;
nPaintEndRow = MAXROW;
nPaintEndCol = MAXCOL;
@@ -1904,7 +1904,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
SCTAB nCount = 0;
- for( SCTAB j=*itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j=*itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
nCount ++;
pScenarios[nUndoPos] = nCount;
@@ -1927,7 +1927,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
while( !qIncreaseRange.empty() )
{
ScRange aRange = qIncreaseRange.back();
- if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
+ if( !rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
switch (eCmd)
{
@@ -1958,22 +1958,22 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
i = *itr;
- pDoc->SetDrawPageSize(i);
+ rDoc.SetDrawPageSize(i);
if (bNeedRefresh)
- pDoc->ExtendMerge( nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow, i, true );
+ rDoc.ExtendMerge( nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow, i, true );
else
- pDoc->RefreshAutoFilter( nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow, i );
+ rDoc.RefreshAutoFilter( nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow, i );
if ( eCmd == INS_INSROWS || eCmd == INS_INSCOLS )
- pDoc->UpdatePageBreaks( i );
+ rDoc.UpdatePageBreaks( i );
sal_uInt16 nExtFlags = 0;
rDocShell.UpdatePaintExt( nExtFlags, nPaintStartCol, nPaintStartRow, i, nPaintEndCol, nPaintEndRow, i );
SCTAB nScenarioCount = 0;
- for( SCTAB j = i+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j = i+1; j<nTabCount && rDoc.IsScenario(j); j++ )
nScenarioCount ++;
bool bAdjusted = ( eCmd == INS_INSROWS ) ? AdjustRowHeight(ScRange(0, nStartRow, i, MAXCOL, nEndRow, i+nScenarioCount )) :
@@ -2042,15 +2042,15 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
return false;
}
- ScDocument* pDoc = rDocShell.GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCCOL nPaintStartCol = nStartCol;
SCROW nPaintStartRow = nStartRow;
SCCOL nPaintEndCol = nEndCol;
SCROW nPaintEndRow = nEndRow;
sal_uInt16 nPaintFlags = PAINT_GRID;
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
@@ -2061,7 +2061,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCTAB nCount = 0;
for(SCTAB i=0; i<nTabCount; i++ )
{
- if( !pDoc->IsScenario(i) )
+ if( !rDoc.IsScenario(i) )
{
nCount++;
if( nCount == nEndTab+1 )
@@ -2076,7 +2076,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScMarkData aFullMark( aMark ); // including scenario sheets
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
- for( SCTAB j = *itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j = *itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
aFullMark.SelectTable( j, true );
SCTAB nSelCount = aMark.GetSelectCount();
@@ -2088,10 +2088,10 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aExtendMergeRange( rRange );
- if( rRange.aStart == rRange.aEnd && pDoc->HasAttrib(rRange, HASATTR_MERGED) )
+ if( rRange.aStart == rRange.aEnd && rDoc.HasAttrib(rRange, HASATTR_MERGED) )
{
- pDoc->ExtendMerge( aExtendMergeRange );
- pDoc->ExtendOverlapped( aExtendMergeRange );
+ rDoc.ExtendMerge( aExtendMergeRange );
+ rDoc.ExtendOverlapped( aExtendMergeRange );
nUndoEndCol = aExtendMergeRange.aEnd.Col();
nUndoEndRow = aExtendMergeRange.aEnd.Row();
nPaintEndCol = nUndoEndCol;
@@ -2116,7 +2116,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEditTestEndY = nUndoEndRow;
if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP )
nEditTestEndY = MAXROW;
- ScEditableTester aTester( pDoc, nUndoStartCol, nUndoStartRow, nEditTestEndX, nEditTestEndY, aMark );
+ ScEditableTester aTester( &rDoc, nUndoStartCol, nUndoStartRow, nEditTestEndX, nEditTestEndY, aMark );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -2124,7 +2124,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
return false;
}
- if (!canDeleteCellsByPivot(rRange, aMark, eCmd, pDoc))
+ if (!canDeleteCellsByPivot(rRange, aMark, eCmd, &rDoc))
{
if (!bApi)
rDocShell.ErrorMessage(STR_NO_INSERT_DELETE_OVER_PIVOT_TABLE);
@@ -2150,15 +2150,15 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
SCTAB i = *itr;
- if ( pDoc->HasAttrib( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HASATTR_MERGED | HASATTR_OVERLAPPED ))
+ if ( rDoc.HasAttrib( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HASATTR_MERGED | HASATTR_OVERLAPPED ))
{
SCCOL nMergeStartCol = nUndoStartCol;
SCROW nMergeStartRow = nUndoStartRow;
SCCOL nMergeEndCol = nMergeTestEndCol;
SCROW nMergeEndRow = nMergeTestEndRow;
- pDoc->ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
- pDoc->ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
+ rDoc.ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
+ rDoc.ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
if( ( eCmd == DEL_CELLSUP && ( nMergeStartCol != nUndoStartCol || nMergeEndCol != nMergeTestEndCol))||
( eCmd == DEL_CELLSLEFT && ( nMergeStartRow != nUndoStartRow || nMergeEndRow != nMergeTestEndRow)))
{
@@ -2174,7 +2174,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nTestRow1 = -1;
SCROW nTestRow2 = -1;
- ScDocAttrIterator aTestIter( pDoc, i, nUndoStartCol, nUndoStartRow, nMergeTestEndCol, nMergeTestEndRow );
+ ScDocAttrIterator aTestIter( &rDoc, i, nUndoStartCol, nUndoStartRow, nMergeTestEndCol, nMergeTestEndRow );
ScRange aExtendRange( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i );
const ScPatternAttr* pPattern = NULL;
const ScMergeAttr* pMergeFlag = NULL;
@@ -2187,16 +2187,16 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER )
{
ScRange aRange( nTestCol, nTestRow1, i );
- pDoc->ExtendOverlapped( aRange );
- pDoc->ExtendMerge( aRange, true );
+ rDoc.ExtendOverlapped( aRange );
+ rDoc.ExtendMerge( aRange, true );
if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR )
{
for( SCROW nTestRow = nTestRow1; nTestRow <= nTestRow2; nTestRow++ )
{
ScRange aTestRange( nTestCol, nTestRow, i );
- pDoc->ExtendOverlapped( aTestRange );
- pDoc->ExtendMerge( aTestRange, true );
+ rDoc.ExtendOverlapped( aTestRange );
+ rDoc.ExtendMerge( aTestRange, true );
ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
if( !aExtendRange.In( aMergeRange ) )
{
@@ -2258,7 +2258,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
for( ::std::vector<ScRange>::const_iterator iIter( qDecreaseRange.begin()); iIter != qDecreaseRange.end(); ++iIter )
{
ScRange aRange( *iIter );
- if( pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
+ if( rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
UnmergeCells( aRange, true );
}
@@ -2290,25 +2290,25 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
// so it's no longer necessary to copy more than the deleted range into pUndoDoc.
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, 0, nTabCount-1, (eCmd==DEL_DELCOLS), (eCmd==DEL_DELROWS) );
+ pUndoDoc->InitUndo( &rDoc, 0, nTabCount-1, (eCmd==DEL_DELCOLS), (eCmd==DEL_DELROWS) );
itr = aMark.begin();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
SCTAB nScenarioCount = 0;
- for( SCTAB j = *itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j = *itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
nScenarioCount ++;
- pDoc->CopyToDocument( nUndoStartCol, nUndoStartRow, *itr, nUndoEndCol, nUndoEndRow, *itr+nScenarioCount,
+ rDoc.CopyToDocument( nUndoStartCol, nUndoStartRow, *itr, nUndoEndCol, nUndoEndRow, *itr+nScenarioCount,
IDF_ALL | IDF_NOCAPTIONS, false, pUndoDoc );
}
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
+ pRefUndoDoc->InitUndo( &rDoc, 0, nTabCount-1, false, false );
- pUndoData = new ScRefUndoData( pDoc );
+ pUndoData = new ScRefUndoData( &rDoc );
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
sal_uInt16 nExtFlags = 0;
@@ -2322,22 +2322,22 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
switch (eCmd)
{
case DEL_CELLSUP:
- pDoc->DeleteRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, NULL, &aFullMark );
+ rDoc.DeleteRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, NULL, &aFullMark );
nPaintEndRow = MAXROW;
break;
case DEL_DELROWS:
- pDoc->DeleteRow( 0, 0, MAXCOL, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &bUndoOutline, &aFullMark );
+ rDoc.DeleteRow( 0, 0, MAXCOL, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &bUndoOutline, &aFullMark );
nPaintStartCol = 0;
nPaintEndCol = MAXCOL;
nPaintEndRow = MAXROW;
nPaintFlags |= PAINT_LEFT;
break;
case DEL_CELLSLEFT:
- pDoc->DeleteCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, NULL, &aFullMark );
+ rDoc.DeleteCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, NULL, &aFullMark );
nPaintEndCol = MAXCOL;
break;
case DEL_DELCOLS:
- pDoc->DeleteCol( 0, 0, MAXROW, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &bUndoOutline, &aFullMark );
+ rDoc.DeleteCol( 0, 0, MAXROW, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &bUndoOutline, &aFullMark );
nPaintStartRow = 0;
nPaintEndRow = MAXROW;
nPaintEndCol = MAXCOL;
@@ -2371,7 +2371,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
SCTAB nCount = 0;
- for( SCTAB j=*itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j=*itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
nCount ++;
pScenarios[nUndoPos] = nCount;
@@ -2431,7 +2431,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
break;
}
- if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
+ if( !rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
ScCellMergeOption aMergeOption(aRange);
MergeCells( aMergeOption, false, true, true );
@@ -2451,37 +2451,37 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
nMergeTestEndCol = MAXCOL;
if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP )
nMergeTestEndRow = MAXROW;
- ScPatternAttr aPattern( pDoc->GetPool() );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( ScMergeFlagAttr() );
- pDoc->ApplyPatternArea( nExtendStartCol, nExtendStartRow, nMergeTestEndCol, nMergeTestEndRow, aMark, aPattern );
+ rDoc.ApplyPatternArea( nExtendStartCol, nExtendStartRow, nMergeTestEndCol, nMergeTestEndRow, aMark, aPattern );
itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
SCTAB nScenarioCount = 0;
- for( SCTAB j = *itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j = *itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
nScenarioCount ++;
ScRange aMergedRange( nExtendStartCol, nExtendStartRow, *itr, nMergeTestEndCol, nMergeTestEndRow, *itr+nScenarioCount );
- pDoc->ExtendMerge( aMergedRange, true );
+ rDoc.ExtendMerge( aMergedRange, true );
}
}
itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
- pDoc->SetDrawPageSize(*itr);
+ rDoc.SetDrawPageSize(*itr);
if ( eCmd == DEL_DELCOLS || eCmd == DEL_DELROWS )
- pDoc->UpdatePageBreaks( *itr );
+ rDoc.UpdatePageBreaks( *itr );
rDocShell.UpdatePaintExt( nExtFlags, nPaintStartCol, nPaintStartRow, *itr, nPaintEndCol, nPaintEndRow, *itr );
SCTAB nScenarioCount = 0;
- for( SCTAB j = *itr+1; j<nTabCount && pDoc->IsScenario(j); j++ )
+ for( SCTAB j = *itr+1; j<nTabCount && rDoc.IsScenario(j); j++ )
nScenarioCount ++;
// ganze Zeilen loeschen: nichts anpassen
@@ -2527,13 +2527,13 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
// zugehoerige Szenarien auch anpassen - nur wenn innerhalb einer Tabelle verschoben wird!
bool bScenariosAdded = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- SCTAB nTabCount = pDoc->GetTableCount();
- if ( nDestTab == nStartTab && !pDoc->IsScenario(nEndTab) )
- while ( nEndTab+1 < nTabCount && pDoc->IsScenario(nEndTab+1) )
+ SCTAB nTabCount = rDoc.GetTableCount();
+ if ( nDestTab == nStartTab && !rDoc.IsScenario(nEndTab) )
+ while ( nEndTab+1 < nTabCount && rDoc.IsScenario(nEndTab+1) )
{
++nEndTab;
bScenariosAdded = true;
@@ -2551,7 +2551,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
aSourceMark.SetMarkArea( rSource );
ScDocShellRef aDragShellRef;
- if ( pDoc->HasOLEObjectsInArea( rSource ) )
+ if ( rDoc.HasOLEObjectsInArea( rSource ) )
{
aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately
aDragShellRef->DoInitNew(NULL);
@@ -2559,7 +2559,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
ScDrawLayer::SetGlobalDrawPersist(aDragShellRef);
ScClipParam aClipParam(ScRange(nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nStartTab), bCut);
- pDoc->CopyToClip(aClipParam, pClipDoc, &aSourceMark, false, bScenariosAdded, true);
+ rDoc.CopyToClip(aClipParam, pClipDoc, &aSourceMark, false, bScenariosAdded, true);
ScDrawLayer::SetGlobalDrawPersist(NULL);
@@ -2570,7 +2570,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
{
SCCOL nTmpEndCol = nOldEndCol;
SCROW nTmpEndRow = nOldEndRow;
- if (pDoc->ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab ))
+ if (rDoc.ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab ))
bClipOver = true;
if ( nTmpEndCol > nEndCol ) nEndCol = nTmpEndCol;
if ( nTmpEndRow > nEndRow ) nEndRow = nTmpEndRow;
@@ -2607,10 +2607,10 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
ScEditableTester aTester;
for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
- aTester.TestBlock( pDoc, nTab, nDestCol,nDestRow, nUndoEndCol,nUndoEndRow );
+ aTester.TestBlock( &rDoc, nTab, nDestCol,nDestRow, nUndoEndCol,nUndoEndRow );
if (bCut)
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
- aTester.TestBlock( pDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+ aTester.TestBlock( &rDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow );
if (!aTester.IsEditable())
{
@@ -2623,7 +2623,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
// Test auf zusammengefasste - beim Verschieben erst nach dem Loeschen
if (bClipOver && !bCut)
- if (pDoc->HasAttrib( nDestCol,nDestRow,nDestTab, nUndoEndCol,nUndoEndRow,nDestEndTab,
+ if (rDoc.HasAttrib( nDestCol,nDestRow,nDestTab, nUndoEndCol,nUndoEndRow,nDestEndTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ))
{ // "Zusammenfassen nicht verschachteln !"
if (!bApi)
@@ -2653,25 +2653,25 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
sal_uInt16 nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab, bWholeCols, bWholeRows );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab, bWholeCols, bWholeRows );
if (bCut)
{
- pDoc->CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
+ rDoc.CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
nUndoFlags, false, pUndoDoc );
pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRefUndoDoc->InitUndo( pDoc, 0, nTabCount-1, false, false );
+ pRefUndoDoc->InitUndo( &rDoc, 0, nTabCount-1, false, false );
}
if ( nDestTab != nStartTab )
pUndoDoc->AddUndoTab( nDestTab, nDestEndTab, bWholeCols, bWholeRows );
- pDoc->CopyToDocument( nDestCol, nDestRow, nDestTab,
+ rDoc.CopyToDocument( nDestCol, nDestRow, nDestTab,
nDestEndCol, nDestEndRow, nDestEndTab,
nUndoFlags, false, pUndoDoc );
- pUndoData = new ScRefUndoData( pDoc );
+ pUndoData = new ScRefUndoData( &rDoc );
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
bool bSourceHeight = false; // Hoehen angepasst?
@@ -2680,24 +2680,24 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
ScMarkData aDelMark; // only for tables
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
{
- pDoc->DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, IDF_ALL );
+ rDoc.DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, IDF_ALL );
aDelMark.SelectTable( nTab, true );
}
- pDoc->DeleteObjectsInArea( nStartCol,nStartRow, nOldEndCol,nOldEndRow, aDelMark );
+ rDoc.DeleteObjectsInArea( nStartCol,nStartRow, nOldEndCol,nOldEndRow, aDelMark );
// Test auf zusammengefasste
if (bClipOver)
- if (pDoc->HasAttrib( nDestCol,nDestRow,nDestTab,
+ if (rDoc.HasAttrib( nDestCol,nDestRow,nDestTab,
nUndoEndCol,nUndoEndRow,nDestEndTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ))
{
- pDoc->CopyFromClip( rSource, aSourceMark, IDF_ALL, pRefUndoDoc, pClipDoc );
+ rDoc.CopyFromClip( rSource, aSourceMark, IDF_ALL, pRefUndoDoc, pClipDoc );
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
{
SCCOL nTmpEndCol = nEndCol;
SCROW nTmpEndRow = nEndRow;
- pDoc->ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab, true );
+ rDoc.ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab, true );
}
// Fehlermeldung erst nach dem Wiederherstellen des Inhalts
@@ -2725,7 +2725,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
function ScDocument::UpdateReference() is called which calls
ScDrawLayer::MoveCells() which may move away inserted objects to wrong
positions (e.g. if source and destination range overlaps).*/
- pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_ALL & ~(IDF_OBJECTS),
+ rDoc.CopyFromClip( aPasteDest, aDestMark, IDF_ALL & ~(IDF_OBJECTS),
NULL, pClipDoc, true, false, bIncludeFiltered );
@@ -2742,7 +2742,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
and row heights. There are no cell notes or drawing objects, if the
clipdoc does not contain a drawing layer.*/
if ( pClipDoc->GetDrawLayer() )
- pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_OBJECTS,
+ rDoc.CopyFromClip( aPasteDest, aDestMark, IDF_OBJECTS,
pRefUndoDoc, pClipDoc, true, false, bIncludeFiltered );
if (bRecord)
@@ -2773,14 +2773,14 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
{
SCCOL nTmpEndCol = nDestEndCol;
SCROW nTmpEndRow = nDestEndRow;
- pDoc->ExtendMerge( nDestCol, nDestRow, nTmpEndCol, nTmpEndRow, nTab, true );
+ rDoc.ExtendMerge( nDestCol, nDestRow, nTmpEndCol, nTmpEndRow, nTab, true );
if (nTmpEndCol > nDestPaintEndCol) nDestPaintEndCol = nTmpEndCol;
if (nTmpEndRow > nDestPaintEndRow) nDestPaintEndRow = nTmpEndRow;
}
if (bCut)
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
- pDoc->RefreshAutoFilter( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
+ rDoc.RefreshAutoFilter( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
if (bPaint)
{
@@ -2962,29 +2962,29 @@ bool ScDocFunc::InsertTable( SCTAB nTab, const OUString& rName, bool bRecord, bo
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
// Strange loop, also basic is loaded too early ( InsertTable )
// is called via the xml import for sheets in described in ODF
bool bInsertDocModule = false;
- if( !rDocShell.GetDocument()->IsImportingXML() )
+ if( !rDocShell.GetDocument().IsImportingXML() )
{
- bInsertDocModule = pDoc && pDoc->IsInVBAMode();
+ bInsertDocModule = rDoc.IsInVBAMode();
}
- if ( bInsertDocModule || ( bRecord && !pDoc->IsUndoEnabled() ) )
+ if ( bInsertDocModule || ( bRecord && !rDoc.IsUndoEnabled() ) )
bRecord = false;
if (bRecord)
- pDoc->BeginDrawUndo(); // InsertTab erzeugt ein SdrUndoNewPage
+ rDoc.BeginDrawUndo(); // InsertTab erzeugt ein SdrUndoNewPage
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
bool bAppend = ( nTab >= nTabCount );
if ( bAppend )
nTab = nTabCount; // wichtig fuer Undo
- if (pDoc->InsertTab( nTab, rName ))
+ if (rDoc.InsertTab( nTab, rName ))
{
if (bRecord)
rDocShell.GetUndoManager()->AddUndoAction(
@@ -2994,7 +2994,7 @@ bool ScDocFunc::InsertTable( SCTAB nTab, const OUString& rName, bool bRecord, bo
if( bInsertDocModule )
{
OUString sSource, sCodeName;
- VBA_InsertModule( *pDoc, nTab, sCodeName, sSource );
+ VBA_InsertModule( rDoc, nTab, sCodeName, sSource );
}
rDocShell.Broadcast( ScTablesHint( SC_TAB_INSERTED, nTab ) );
@@ -3016,55 +3016,55 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ )
ScDocShellModificator aModificator( rDocShell );
bool bSuccess = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bVbaEnabled = pDoc && pDoc->IsInVBAMode();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bVbaEnabled = rDoc.IsInVBAMode();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if ( bVbaEnabled )
bRecord = false;
- bool bWasLinked = pDoc->IsLinked(nTab);
+ bool bWasLinked = rDoc.IsLinked(nTab);
ScDocument* pUndoDoc = NULL;
ScRefUndoData* pUndoData = NULL;
if (bRecord)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = rDoc.GetTableCount();
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true ); // nur nTab mit Flags
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); // nur nTab mit Flags
pUndoDoc->AddUndoTab( 0, nCount-1 ); // alle Tabs fuer Referenzen
- pDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
+ rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
OUString aOldName;
- pDoc->GetName( nTab, aOldName );
+ rDoc.GetName( nTab, aOldName );
pUndoDoc->RenameTab( nTab, aOldName, false );
if (bWasLinked)
- pUndoDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), pDoc->GetLinkDoc(nTab),
- pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab),
- pDoc->GetLinkTab(nTab),
- pDoc->GetLinkRefreshDelay(nTab) );
+ pUndoDoc->SetLink( nTab, rDoc.GetLinkMode(nTab), rDoc.GetLinkDoc(nTab),
+ rDoc.GetLinkFlt(nTab), rDoc.GetLinkOpt(nTab),
+ rDoc.GetLinkTab(nTab),
+ rDoc.GetLinkRefreshDelay(nTab) );
- if ( pDoc->IsScenario(nTab) )
+ if ( rDoc.IsScenario(nTab) )
{
pUndoDoc->SetScenario( nTab, true );
OUString aComment;
Color aColor;
sal_uInt16 nScenFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nScenFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nScenFlags );
pUndoDoc->SetScenarioData( nTab, aComment, aColor, nScenFlags );
- bool bActive = pDoc->IsActiveScenario( nTab );
+ bool bActive = rDoc.IsActiveScenario( nTab );
pUndoDoc->SetActiveScenario( nTab, bActive );
}
- pUndoDoc->SetVisible( nTab, pDoc->IsVisible( nTab ) );
- pUndoDoc->SetTabBgColor( nTab, pDoc->GetTabBgColor(nTab) );
- pUndoDoc->SetSheetEvents( nTab, pDoc->GetSheetEvents( nTab ) );
+ pUndoDoc->SetVisible( nTab, rDoc.IsVisible( nTab ) );
+ pUndoDoc->SetTabBgColor( nTab, rDoc.GetTabBgColor(nTab) );
+ pUndoDoc->SetSheetEvents( nTab, rDoc.GetSheetEvents( nTab ) );
// Drawing-Layer muss sein Undo selbst in der Hand behalten !!!
- pDoc->BeginDrawUndo(); // DeleteTab erzeugt ein SdrUndoDelPage
+ rDoc.BeginDrawUndo(); // DeleteTab erzeugt ein SdrUndoDelPage
- pUndoData = new ScRefUndoData( pDoc );
+ pUndoData = new ScRefUndoData( &rDoc );
}
- if (pDoc->DeleteTab(nTab))
+ if (rDoc.DeleteTab(nTab))
{
if (bRecord)
{
@@ -3077,7 +3077,7 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ )
if( bVbaEnabled )
{
OUString sCodeName;
- if( pDoc->GetCodeName( nTab, sCodeName ) )
+ if( rDoc.GetCodeName( nTab, sCodeName ) )
{
VBA_DeleteModule( rDocShell, sCodeName );
}
@@ -3112,12 +3112,12 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ )
bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
- if ( pDoc->IsVisible( nTab ) == bVisible )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
+ if ( rDoc.IsVisible( nTab ) == bVisible )
return true; // nichts zu tun - ok
- if ( !pDoc->IsDocEditable() )
+ if ( !rDoc.IsDocEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
@@ -3126,14 +3126,14 @@ bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, bool bApi )
ScDocShellModificator aModificator( rDocShell );
- if ( !bVisible && !pDoc->IsImportingXML() ) // #i57869# allow hiding in any order for loading
+ if ( !bVisible && !rDoc.IsImportingXML() ) // #i57869# allow hiding in any order for loading
{
// nicht alle Tabellen ausblenden
sal_uInt16 nVisCount = 0;
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = rDoc.GetTableCount();
for (SCTAB i=0; i<nCount && nVisCount<2; i++)
- if (pDoc->IsVisible(i))
+ if (rDoc.IsVisible(i))
++nVisCount;
if (nVisCount <= 1)
@@ -3144,7 +3144,7 @@ bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, bool bApi )
}
}
- pDoc->SetVisible( nTab, bVisible );
+ rDoc.SetVisible( nTab, bVisible );
if (bUndo)
{
std::vector<SCTAB> undoTabs;
@@ -3165,16 +3165,16 @@ bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, bool bApi )
bool ScDocFunc::SetLayoutRTL( SCTAB nTab, bool bRTL, bool /* bApi */ )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
- if ( pDoc->IsLayoutRTL( nTab ) == bRTL )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
+ if ( rDoc.IsLayoutRTL( nTab ) == bRTL )
return true; // nothing to do - ok
//! protection (sheet or document?)
ScDocShellModificator aModificator( rDocShell );
- pDoc->SetLayoutRTL( nTab, bRTL );
+ rDoc.SetLayoutRTL( nTab, bRTL );
if (bUndo)
{
@@ -3196,10 +3196,10 @@ bool ScDocFunc::SetLayoutRTL( SCTAB nTab, bool bRTL, bool /* bApi */ )
bool ScDocFunc::RenameTable( SCTAB nTab, const OUString& rName, bool bRecord, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- if ( !pDoc->IsDocEditable() )
+ if ( !rDoc.IsDocEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR);
@@ -3210,8 +3210,8 @@ bool ScDocFunc::RenameTable( SCTAB nTab, const OUString& rName, bool bRecord, bo
bool bSuccess = false;
OUString sOldName;
- pDoc->GetName(nTab, sOldName);
- if (pDoc->RenameTab( nTab, rName ))
+ rDoc.GetName(nTab, sOldName);
+ if (rDoc.RenameTab( nTab, rName ))
{
if (bRecord)
{
@@ -3230,10 +3230,10 @@ bool ScDocFunc::RenameTable( SCTAB nTab, const OUString& rName, bool bRecord, bo
bool ScDocFunc::SetTabBgColor( SCTAB nTab, const Color& rColor, bool bRecord, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- if ( !pDoc->IsDocEditable() || pDoc->IsTabProtected(nTab) )
+ if ( !rDoc.IsDocEditable() || rDoc.IsTabProtected(nTab) )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Check to see what this string is...
@@ -3241,11 +3241,11 @@ bool ScDocFunc::SetTabBgColor( SCTAB nTab, const Color& rColor, bool bRecord, bo
}
Color aOldTabBgColor;
- aOldTabBgColor = pDoc->GetTabBgColor(nTab);
+ aOldTabBgColor = rDoc.GetTabBgColor(nTab);
bool bSuccess = false;
- pDoc->SetTabBgColor(nTab, rColor);
- if ( pDoc->GetTabBgColor(nTab) == rColor)
+ rDoc.SetTabBgColor(nTab, rColor);
+ if ( rDoc.GetTabBgColor(nTab) == rColor)
bSuccess = true;
if (bSuccess)
{
@@ -3267,11 +3267,11 @@ bool ScDocFunc::SetTabBgColor( SCTAB nTab, const Color& rColor, bool bRecord, bo
bool ScDocFunc::SetTabBgColor(
ScUndoTabColorInfo::List& rUndoTabColorList, bool bRecord, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- if ( !pDoc->IsDocEditable() )
+ if ( !rDoc.IsDocEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error...
@@ -3287,12 +3287,12 @@ bool ScDocFunc::SetTabBgColor(
{
ScUndoTabColorInfo& rInfo = rUndoTabColorList[i];
nTab = rInfo.mnTabId;
- if ( !pDoc->IsTabProtected(nTab) )
+ if ( !rDoc.IsTabProtected(nTab) )
{
aNewTabBgColor = rInfo.maNewTabBgColor;
- rInfo.maOldTabBgColor = pDoc->GetTabBgColor(nTab);
- pDoc->SetTabBgColor(nTab, aNewTabBgColor);
- if ( pDoc->GetTabBgColor(nTab) != aNewTabBgColor)
+ rInfo.maOldTabBgColor = rDoc.GetTabBgColor(nTab);
+ rDoc.SetTabBgColor(nTab, aNewTabBgColor);
+ if ( rDoc.GetTabBgColor(nTab) != aNewTabBgColor)
{
bSuccess = false;
break;
@@ -3337,9 +3337,9 @@ static sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCT
double nPPTX = aProv.GetPPTX();
double nPPTY = aProv.GetPPTY();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
Fraction aOne(1,1);
- sal_uInt16 nTwips = pDoc->GetOptimalColWidth( nCol, nTab, pDev, nPPTX, nPPTY, aOne, aOne,
+ sal_uInt16 nTwips = rDoc.GetOptimalColWidth( nCol, nTab, pDev, nPPTX, nPPTY, aOne, aOne,
bFormula, NULL );
return nTwips;
@@ -3354,12 +3354,12 @@ bool ScDocFunc::SetWidthOrHeight(
if (rRanges.empty())
return true;
- ScDocument* pDoc = rDocShell.GetDocument();
- if ( bRecord && !pDoc->IsUndoEnabled() )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if ( bRecord && !rDoc.IsUndoEnabled() )
bRecord = false;
// import into read-only document is possible
- if ( !pDoc->IsChangeReadOnlyEnabled() && !rDocShell.IsEditable() )
+ if ( !rDoc.IsChangeReadOnlyEnabled() && !rDocShell.IsEditable() )
{
if (!bApi)
rDocShell.ErrorMessage(STR_PROTECTIONERR); //! eigene Meldung?
@@ -3382,23 +3382,23 @@ bool ScDocFunc::SetWidthOrHeight(
if ( bRecord )
{
- pDoc->BeginDrawUndo(); // Drawing Updates
+ rDoc.BeginDrawUndo(); // Drawing Updates
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bWidth)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, false );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, false );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
- pDoc->CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
+ rDoc.CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, IDF_NONE, false, pUndoDoc );
}
aUndoRanges = rRanges;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
pUndoTab = new ScOutlineTable( *pTable );
}
@@ -3422,11 +3422,11 @@ bool ScDocFunc::SetWidthOrHeight(
// dann SetOptimalHeight mit bShrink = FALSE
for (SCROW nRow=nStartNo; nRow<=nEndNo; nRow++)
{
- sal_uInt8 nOld = pDoc->GetRowFlags(nRow,nTab);
+ sal_uInt8 nOld = rDoc.GetRowFlags(nRow,nTab);
SCROW nLastRow = -1;
- bool bHidden = pDoc->RowHidden(nRow, nTab, NULL, &nLastRow);
+ bool bHidden = rDoc.RowHidden(nRow, nTab, NULL, &nLastRow);
if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
- pDoc->SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
+ rDoc.SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
}
}
@@ -3434,10 +3434,10 @@ bool ScDocFunc::SetWidthOrHeight(
Fraction aOne(1,1);
sc::RowHeightContext aCxt(aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, aProv.GetDevice());
aCxt.setForceAutoSize(bAll);
- pDoc->SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab);
+ rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab);
if (bAll)
- pDoc->ShowRows( nStartNo, nEndNo, nTab, true );
+ rDoc.ShowRows( nStartNo, nEndNo, nTab, true );
// Manual-Flag wird bei bAll=sal_True schon in SetOptimalHeight gesetzt
// (an bei Extra-Height, sonst aus).
@@ -3446,22 +3446,22 @@ bool ScDocFunc::SetWidthOrHeight(
{
if (nSizeTwips)
{
- pDoc->SetRowHeightRange( nStartNo, nEndNo, nTab, nSizeTwips );
- pDoc->SetManualHeight( nStartNo, nEndNo, nTab, true ); // height was set manually
+ rDoc.SetRowHeightRange( nStartNo, nEndNo, nTab, nSizeTwips );
+ rDoc.SetManualHeight( nStartNo, nEndNo, nTab, true ); // height was set manually
}
if ( eMode != SC_SIZE_ORIGINAL )
- pDoc->ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
+ rDoc.ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
}
else if ( eMode==SC_SIZE_SHOW )
{
- pDoc->ShowRows( nStartNo, nEndNo, nTab, true );
+ rDoc.ShowRows( nStartNo, nEndNo, nTab, true );
}
}
else // Spaltenbreiten
{
for (SCCOL nCol=static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
{
- if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab) )
+ if ( eMode != SC_SIZE_VISOPT || !rDoc.ColHidden(nCol, nTab) )
{
sal_uInt16 nThisSize = nSizeTwips;
@@ -3469,10 +3469,10 @@ bool ScDocFunc::SetWidthOrHeight(
nThisSize = nSizeTwips +
lcl_GetOptimalColWidth( rDocShell, nCol, nTab, bFormula );
if ( nThisSize )
- pDoc->SetColWidth( nCol, nTab, nThisSize );
+ rDoc.SetColWidth( nCol, nTab, nThisSize );
if ( eMode != SC_SIZE_ORIGINAL )
- pDoc->ShowCol( nCol, nTab, bShow );
+ rDoc.ShowCol( nCol, nTab, bShow );
}
}
}
@@ -3482,16 +3482,16 @@ bool ScDocFunc::SetWidthOrHeight(
if ( eMode != SC_SIZE_ORIGINAL )
{
if (bWidth)
- bOutline = bOutline || pDoc->UpdateOutlineCol(
+ bOutline = bOutline || rDoc.UpdateOutlineCol(
static_cast<SCCOL>(nStartNo),
static_cast<SCCOL>(nEndNo), nTab, bShow );
else
- bOutline = bOutline || pDoc->UpdateOutlineRow(
+ bOutline = bOutline || rDoc.UpdateOutlineRow(
static_cast<SCROW>(nStartNo),
static_cast<SCROW>(nEndNo), nTab, bShow );
}
}
- pDoc->SetDrawPageSize(nTab);
+ rDoc.SetDrawPageSize(nTab);
if (!bOutline)
DELETEZ(pUndoTab);
@@ -3506,7 +3506,7 @@ bool ScDocFunc::SetWidthOrHeight(
aUndoRanges, pUndoTab, eMode, nSizeTwips, bWidth));
}
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
rDocShell.PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PAINT_ALL);
aModificator.SetDocumentModified();
@@ -3520,8 +3520,8 @@ bool ScDocFunc::InsertPageBreak( bool bColumn, const ScAddress& rPos,
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
SCTAB nTab = rPos.Tab();
SfxBindings* pBindings = rDocShell.GetViewBindings();
@@ -3532,8 +3532,8 @@ bool ScDocFunc::InsertPageBreak( bool bColumn, const ScAddress& rPos,
return false; // erste Spalte / Zeile
ScBreakType nBreak = bColumn ?
- pDoc->HasColBreak(static_cast<SCCOL>(nPos), nTab) :
- pDoc->HasRowBreak(static_cast<SCROW>(nPos), nTab);
+ rDoc.HasColBreak(static_cast<SCCOL>(nPos), nTab) :
+ rDoc.HasRowBreak(static_cast<SCROW>(nPos), nTab);
if (nBreak & BREAK_MANUAL)
return true;
@@ -3542,15 +3542,15 @@ bool ScDocFunc::InsertPageBreak( bool bColumn, const ScAddress& rPos,
new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, true ) );
if (bColumn)
- pDoc->SetColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
+ rDoc.SetColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
else
- pDoc->SetRowBreak(static_cast<SCROW>(nPos), nTab, false, true);
+ rDoc.SetRowBreak(static_cast<SCROW>(nPos), nTab, false, true);
- pDoc->InvalidatePageBreaks(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.InvalidatePageBreaks(nTab);
+ rDoc.UpdatePageBreaks( nTab );
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
if (bColumn)
{
@@ -3584,8 +3584,8 @@ bool ScDocFunc::RemovePageBreak( bool bColumn, const ScAddress& rPos,
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
SCTAB nTab = rPos.Tab();
SfxBindings* pBindings = rDocShell.GetViewBindings();
@@ -3595,9 +3595,9 @@ bool ScDocFunc::RemovePageBreak( bool bColumn, const ScAddress& rPos,
ScBreakType nBreak;
if (bColumn)
- nBreak = pDoc->HasColBreak(static_cast<SCCOL>(nPos), nTab);
+ nBreak = rDoc.HasColBreak(static_cast<SCCOL>(nPos), nTab);
else
- nBreak = pDoc->HasRowBreak(static_cast<SCROW>(nPos), nTab);
+ nBreak = rDoc.HasRowBreak(static_cast<SCROW>(nPos), nTab);
if ((nBreak & BREAK_MANUAL) == 0)
// There is no manual break.
return false;
@@ -3607,14 +3607,14 @@ bool ScDocFunc::RemovePageBreak( bool bColumn, const ScAddress& rPos,
new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, false ) );
if (bColumn)
- pDoc->RemoveColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
+ rDoc.RemoveColBreak(static_cast<SCCOL>(nPos), nTab, false, true);
else
- pDoc->RemoveRowBreak(static_cast<SCROW>(nPos), nTab, false, true);
+ rDoc.RemoveRowBreak(static_cast<SCROW>(nPos), nTab, false, true);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
if (bColumn)
{
@@ -3645,12 +3645,12 @@ bool ScDocFunc::RemovePageBreak( bool bColumn, const ScAddress& rPos,
void ScDocFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- pDoc->SetTabProtection(nTab, &rProtect);
- if (pDoc->IsUndoEnabled())
+ rDoc.SetTabProtection(nTab, &rProtect);
+ if (rDoc.IsUndoEnabled())
{
- ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!");
if (pProtect)
{
@@ -3672,17 +3672,17 @@ void ScDocFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
bool ScDocFunc::Protect( SCTAB nTab, const OUString& rPassword, bool /*bApi*/ )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
if (nTab == TABLEID_DOC)
{
// document protection
ScDocProtection aProtection;
aProtection.setProtected(true);
aProtection.setPassword(rPassword);
- pDoc->SetDocProtection(&aProtection);
- if (pDoc->IsUndoEnabled())
+ rDoc.SetDocProtection(&aProtection);
+ if (rDoc.IsUndoEnabled())
{
- ScDocProtection* pProtect = pDoc->GetDocProtection();
+ ScDocProtection* pProtect = rDoc.GetDocProtection();
OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScDocProtection pointer is NULL!");
if (pProtect)
{
@@ -3703,10 +3703,10 @@ bool ScDocFunc::Protect( SCTAB nTab, const OUString& rPassword, bool /*bApi*/ )
ScTableProtection aProtection;
aProtection.setProtected(true);
aProtection.setPassword(rPassword);
- pDoc->SetTabProtection(nTab, &aProtection);
- if (pDoc->IsUndoEnabled())
+ rDoc.SetTabProtection(nTab, &aProtection);
+ if (rDoc.IsUndoEnabled())
{
- ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
OSL_ENSURE(pProtect, "ScDocFunc::Unprotect: ScTableProtection pointer is NULL!");
if (pProtect)
{
@@ -3730,13 +3730,13 @@ bool ScDocFunc::Protect( SCTAB nTab, const OUString& rPassword, bool /*bApi*/ )
bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
if (nTab == TABLEID_DOC)
{
// document protection
- ScDocProtection* pDocProtect = pDoc->GetDocProtection();
+ ScDocProtection* pDocProtect = rDoc.GetDocProtection();
if (!pDocProtect || !pDocProtect->isProtected())
// already unprotected (should not happen)!
return true;
@@ -3756,8 +3756,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
return false;
}
- pDoc->SetDocProtection(NULL);
- if (pDoc->IsUndoEnabled())
+ rDoc.SetDocProtection(NULL);
+ if (rDoc.IsUndoEnabled())
{
pProtectCopy->setProtected(false);
rDocShell.GetUndoManager()->AddUndoAction(
@@ -3769,7 +3769,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
// sheet protection
- ScTableProtection* pTabProtect = pDoc->GetTabProtection(nTab);
+ ScTableProtection* pTabProtect = rDoc.GetTabProtection(nTab);
if (!pTabProtect || !pTabProtect->isProtected())
// already unprotected (should not happen)!
return true;
@@ -3788,8 +3788,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
return false;
}
- pDoc->SetTabProtection(nTab, NULL);
- if (pDoc->IsUndoEnabled())
+ rDoc.SetTabProtection(nTab, NULL);
+ if (rDoc.IsUndoEnabled())
{
pProtectCopy->setProtected(false);
rDocShell.GetUndoManager()->AddUndoAction(
@@ -3809,9 +3809,9 @@ bool ScDocFunc::ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhich, b
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
- ScEditableTester aTester( pDoc, rMark );
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo (rDoc.IsUndoEnabled());
+ ScEditableTester aTester( &rDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -3835,14 +3835,14 @@ bool ScDocFunc::ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhich, b
SCTAB nEndTab = aMarkRange.aEnd.Tab();
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( aMarkRange, IDF_ATTRIB, true, pUndoDoc, (ScMarkData*)&aMultiMark );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab );
+ rDoc.CopyToDocument( aMarkRange, IDF_ATTRIB, true, pUndoDoc, (ScMarkData*)&aMultiMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoClearItems( &rDocShell, aMultiMark, pUndoDoc, pWhich ) );
}
- pDoc->ClearSelectionItems( pWhich, aMultiMark );
+ rDoc.ClearSelectionItems( pWhich, aMultiMark );
rDocShell.PostPaint( aMarkRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
aModificator.SetDocumentModified();
@@ -3856,9 +3856,9 @@ bool ScDocFunc::ChangeIndent( const ScMarkData& rMark, bool bIncrement, bool bAp
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
- ScEditableTester aTester( pDoc, rMark );
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
+ ScEditableTester aTester( &rDoc, rMark );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -3872,10 +3872,10 @@ bool ScDocFunc::ChangeIndent( const ScMarkData& rMark, bool bIncrement, bool bAp
if (bUndo)
{
SCTAB nStartTab = aMarkRange.aStart.Tab();
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nStartTab );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nStartTab );
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
if (*itr != nStartTab)
@@ -3884,13 +3884,13 @@ bool ScDocFunc::ChangeIndent( const ScMarkData& rMark, bool bIncrement, bool bAp
ScRange aCopyRange = aMarkRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, true, pUndoDoc, (ScMarkData*)&rMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, true, pUndoDoc, (ScMarkData*)&rMark );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoIndent( &rDocShell, rMark, pUndoDoc, bIncrement ) );
}
- pDoc->ChangeSelectionIndent( bIncrement, rMark );
+ rDoc.ChangeSelectionIndent( bIncrement, rMark );
rDocShell.PostPaint( aMarkRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
aModificator.SetDocumentModified();
@@ -3924,7 +3924,7 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
ScDocShellModificator aModificator( rDocShell );
bool bSuccess = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCTAB nStartTab = rRange.aStart.Tab();
@@ -3932,7 +3932,7 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nEndTab = rRange.aEnd.Tab();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
if (pTabMark)
@@ -3944,19 +3944,19 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
}
ScAutoFormat* pAutoFormat = ScGlobal::GetOrCreateAutoFormat();
- ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
+ ScEditableTester aTester( &rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
if ( nFormatNo < pAutoFormat->size() && aTester.IsEditable() )
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
bool bSize = pAutoFormat->findByIndex(nFormatNo)->GetIncludeWidthHeight();
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScDocument* pUndoDoc = NULL;
if ( bRecord )
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nStartTab, bSize, bSize );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nStartTab, bSize, bSize );
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
if (*itr != nStartTab)
@@ -3965,18 +3965,18 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aCopyRange = rRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aStart.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, pUndoDoc, &aMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, false, pUndoDoc, &aMark );
if (bSize)
{
- pDoc->CopyToDocument( nStartCol,0,0, nEndCol,MAXROW,nTabCount-1,
+ rDoc.CopyToDocument( nStartCol,0,0, nEndCol,MAXROW,nTabCount-1,
IDF_NONE, false, pUndoDoc, &aMark );
- pDoc->CopyToDocument( 0,nStartRow,0, MAXCOL,nEndRow,nTabCount-1,
+ rDoc.CopyToDocument( 0,nStartRow,0, MAXCOL,nEndRow,nTabCount-1,
IDF_NONE, false, pUndoDoc, &aMark );
}
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
- pDoc->AutoFormat( nStartCol, nStartRow, nEndCol, nEndRow, nFormatNo, aMark );
+ rDoc.AutoFormat( nStartCol, nStartRow, nEndCol, nEndRow, nFormatNo, aMark );
if (bSize)
{
@@ -4029,7 +4029,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
ScDocShellModificator aModificator( rDocShell );
bool bSuccess = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCTAB nStartTab = rRange.aStart.Tab();
@@ -4037,7 +4037,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nEndTab = rRange.aEnd.Tab();
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
ScMarkData aMark;
if (pTabMark)
@@ -4048,7 +4048,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
aMark.SelectTable( nTab, true );
}
- ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
+ ScEditableTester aTester( &rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
if ( aTester.IsEditable() )
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
@@ -4059,35 +4059,35 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
{
//! auch bei Undo selektierte Tabellen beruecksichtigen
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab );
+ rDoc.CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
}
// use TokenArray if given, string (and flags) otherwise
if ( pTokenArray )
{
- pDoc->InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
+ rDoc.InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
aMark, EMPTY_OUSTRING, pTokenArray, eGrammar);
}
- else if ( pDoc->IsImportingXML() )
+ else if ( rDoc.IsImportingXML() )
{
ScTokenArray* pCode = lcl_ScDocFunc_CreateTokenArrayXML( rString, rFormulaNmsp, eGrammar );
- pDoc->InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
+ rDoc.InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
aMark, EMPTY_OUSTRING, pCode, eGrammar);
delete pCode;
- pDoc->IncXMLImportedFormulaCount( rString.getLength() );
+ rDoc.IncXMLImportedFormulaCount( rString.getLength() );
}
else if (bEnglish)
{
- ScCompiler aComp( pDoc, rRange.aStart);
+ ScCompiler aComp( &rDoc, rRange.aStart);
aComp.SetGrammar(eGrammar);
ScTokenArray* pCode = aComp.CompileString( rString );
- pDoc->InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
+ rDoc.InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
aMark, EMPTY_OUSTRING, pCode, eGrammar);
delete pCode;
}
else
- pDoc->InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
+ rDoc.InsertMatrixFormula( nStartCol, nStartRow, nEndCol, nEndRow,
aMark, rString, NULL, eGrammar);
if (bUndo)
@@ -4115,7 +4115,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
ScDocShellModificator aModificator( rDocShell );
bool bSuccess = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCTAB nStartTab = rRange.aStart.Tab();
@@ -4123,7 +4123,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nEndTab = rRange.aEnd.Tab();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
@@ -4135,17 +4135,17 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
aMark.SelectTable( nTab, true );
}
- ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
+ ScEditableTester aTester( &rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
if ( aTester.IsEditable() )
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
- pDoc->SetDirty( rRange );
+ rDoc.SetDirty( rRange );
if ( bRecord )
{
//! auch bei Undo selektierte Tabellen beruecksichtigen
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
- pDoc->CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab );
+ rDoc.CopyToDocument( rRange, IDF_ALL & ~IDF_NOTE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoTabOp( &rDocShell,
@@ -4157,7 +4157,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
rParam.aRefColCell,
rParam.meMode) );
}
- pDoc->InsertTableOp(rParam, nStartCol, nStartRow, nEndCol, nEndRow, aMark);
+ rDoc.InsertTableOp(rParam, nStartCol, nStartRow, nEndCol, nEndRow, aMark);
rDocShell.PostPaintGridAll();
aModificator.SetDocumentModified();
bSuccess = true;
@@ -4253,7 +4253,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
FillDir eDir, bool bRecord, bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
bool bSuccess = false;
ScRange aRange = rRange;
@@ -4266,7 +4266,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEndRow = aRange.aEnd.Row();
SCTAB nEndTab = aRange.aEnd.Tab();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
@@ -4278,7 +4278,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
aMark.SelectTable( nTab, true );
}
- ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
+ ScEditableTester aTester( &rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
if ( aTester.IsEditable() )
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
@@ -4310,11 +4310,11 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
ScDocument* pUndoDoc = NULL;
if ( bRecord )
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nDestStartTab = aDestArea.aStart.Tab();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nDestStartTab, nDestStartTab );
+ pUndoDoc->InitUndo( &rDoc, nDestStartTab, nDestStartTab );
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
if (*itr != nDestStartTab)
@@ -4323,7 +4323,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aCopyRange = aDestArea;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_AUTOFILL, false, pUndoDoc, &aMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_AUTOFILL, false, pUndoDoc, &aMark );
}
sal_uLong nProgCount;
@@ -4332,10 +4332,10 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
else
nProgCount = aSourceArea.aEnd.Row() - aSourceArea.aStart.Row() + 1;
nProgCount *= nCount;
- ScProgress aProgress( pDoc->GetDocumentShell(),
+ ScProgress aProgress( rDoc.GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
+ rDoc.Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
aSourceArea.aEnd.Col(), aSourceArea.aEnd.Row(), &aProgress,
aMark, nCount, eDir, FILL_SIMPLE );
AdjustRowHeight(aRange);
@@ -4366,7 +4366,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
ScDocShellModificator aModificator( rDocShell );
bool bSuccess = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCTAB nStartTab = rRange.aStart.Tab();
@@ -4374,7 +4374,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nEndTab = rRange.aEnd.Tab();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
@@ -4386,7 +4386,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
aMark.SelectTable( nTab, true );
}
- ScEditableTester aTester( pDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
+ ScEditableTester aTester( &rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
if ( aTester.IsEditable() )
{
WaitObject aWait( rDocShell.GetActiveDialogParent() );
@@ -4394,7 +4394,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
ScRange aSourceArea = rRange;
ScRange aDestArea = rRange;
- SCSIZE nCount = pDoc->GetEmptyLinesInBlock(
+ SCSIZE nCount = rDoc.GetEmptyLinesInBlock(
aSourceArea.aStart.Col(), aSourceArea.aStart.Row(), aSourceArea.aStart.Tab(),
aSourceArea.aEnd.Col(), aSourceArea.aEnd.Row(), aSourceArea.aEnd.Tab(),
DirFromFillDir(eDir) );
@@ -4425,17 +4425,17 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
ScDocument* pUndoDoc = NULL;
if ( bRecord )
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nDestStartTab = aDestArea.aStart.Tab();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nDestStartTab, nDestStartTab );
+ pUndoDoc->InitUndo( &rDoc, nDestStartTab, nDestStartTab );
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
if (*itr != nDestStartTab)
pUndoDoc->AddUndoTab( *itr, *itr );
- pDoc->CopyToDocument(
+ rDoc.CopyToDocument(
aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0,
aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1,
IDF_AUTOFILL, false, pUndoDoc, &aMark );
@@ -4449,7 +4449,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
SCCOL nValX = (eDir == FILL_TO_LEFT) ? aDestArea.aEnd.Col() : aDestArea.aStart.Col();
SCROW nValY = (eDir == FILL_TO_TOP ) ? aDestArea.aEnd.Row() : aDestArea.aStart.Row();
SCTAB nTab = aDestArea.aStart.Tab();
- pDoc->SetValue( nValX, nValY, nTab, fStart );
+ rDoc.SetValue( nValX, nValY, nTab, fStart );
}
sal_uLong nProgCount;
@@ -4458,10 +4458,10 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
else
nProgCount = aSourceArea.aEnd.Row() - aSourceArea.aStart.Row() + 1;
nProgCount *= nCount;
- ScProgress aProgress( pDoc->GetDocumentShell(),
+ ScProgress aProgress( rDoc.GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
+ rDoc.Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
aSourceArea.aEnd.Col(), aSourceArea.aEnd.Row(), &aProgress,
aMark, nCount, eDir, eCmd, eDateCmd, fStep, fMax );
AdjustRowHeight(rRange);
@@ -4497,7 +4497,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
{
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCTAB nStartTab = rRange.aStart.Tab();
@@ -4505,7 +4505,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nEndTab = rRange.aEnd.Tab();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScMarkData aMark;
@@ -4554,7 +4554,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
//! Quellbereich darf geschuetzt sein !!!
//! aber kein Matrixfragment enthalten !!!
- ScEditableTester aTester( pDoc, aDestArea );
+ ScEditableTester aTester( &rDoc, aDestArea );
if ( !aTester.IsEditable() )
{
if (!bApi)
@@ -4562,7 +4562,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
return false;
}
- if ( pDoc->HasSelectedBlockMatrixFragment( nStartCol, nStartRow,
+ if ( rDoc.HasSelectedBlockMatrixFragment( nStartCol, nStartRow,
nEndCol, nEndRow, aMark ) )
{
if (!bApi)
@@ -4575,18 +4575,18 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
ScDocument* pUndoDoc = NULL;
if ( bRecord )
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nDestStartTab = aDestArea.aStart.Tab();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nDestStartTab, nDestStartTab );
+ pUndoDoc->InitUndo( &rDoc, nDestStartTab, nDestStartTab );
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && nTabCount; ++itr)
if (*itr != nDestStartTab)
pUndoDoc->AddUndoTab( *itr, *itr );
// do not clone note captions in undo document
- pDoc->CopyToDocument(
+ rDoc.CopyToDocument(
aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0,
aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1,
IDF_AUTOFILL, false, pUndoDoc, &aMark );
@@ -4598,10 +4598,10 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
else
nProgCount = aSourceArea.aEnd.Row() - aSourceArea.aStart.Row() + 1;
nProgCount *= nCount;
- ScProgress aProgress( pDoc->GetDocumentShell(),
+ ScProgress aProgress( rDoc.GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- pDoc->Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
+ rDoc.Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
aSourceArea.aEnd.Col(), aSourceArea.aEnd.Row(), &aProgress,
aMark, nCount, eDir, eCmd, eDateCmd, fStep, fMax );
@@ -4637,16 +4637,16 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
return true;
}
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
set<SCTAB>::const_iterator itrBeg = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end();
SCTAB nTab1 = *itrBeg, nTab2 = *rOption.maTabs.rbegin();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScEditableTester aTester( pDoc, *itr, nStartCol, nStartRow, nEndCol, nEndRow );
+ ScEditableTester aTester( &rDoc, *itr, nStartCol, nStartRow, nEndCol, nEndRow );
if (!aTester.IsEditable())
{
if (!bApi)
@@ -4654,7 +4654,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
return false;
}
- if ( pDoc->HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr,
+ if ( rDoc.HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{
// "Zusammenfassen nicht verschachteln !"
@@ -4670,8 +4670,8 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
{
SCTAB nTab = *itr;
bool bNeedContents = bContents &&
- ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
- !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) );
+ ( !rDoc.IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
+ !rDoc.IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) );
if (bRecord)
{
@@ -4679,28 +4679,28 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
bool bHasNotes = false;
for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() )
for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() )
- bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->HasNote(aPos));
+ bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (rDoc.HasNote(aPos));
if (!pUndoDoc)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo(pDoc, nTab1, nTab2);
+ pUndoDoc->InitUndo(&rDoc, nTab1, nTab2);
}
// note captions are collected by drawing undo
- pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
+ rDoc.CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc );
if( bHasNotes )
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
if (bNeedContents)
- pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
- pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+ rDoc.DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+ rDoc.DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
if (rOption.mbCenter)
{
- pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
- pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
+ rDoc.ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
+ rDoc.ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
}
if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) )
@@ -4709,7 +4709,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
if (bNeedContents || rOption.mbCenter)
{
ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab);
- pDoc->SetDirty(aRange);
+ rDoc.SetDirty(aRange);
}
bNeedContentsUndo |= bNeedContents;
@@ -4717,7 +4717,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
if (pUndoDoc)
{
- SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : NULL;
+ SdrUndoGroup* pDrawUndo = rDoc.GetDrawLayer() ? rDoc.GetDrawLayer()->GetCalcUndo() : NULL;
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, pUndoDoc, pDrawUndo) );
}
@@ -4754,9 +4754,9 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord )
return true;
ScDocShellModificator aModificator( rDocShell );
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScDocument* pUndoDoc = NULL;
@@ -4765,36 +4765,36 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord )
{
SCTAB nTab = *itr;
ScRange aRange = rOption.getSingleRange(nTab);
- if ( !pDoc->HasAttrib(aRange, HASATTR_MERGED) )
+ if ( !rDoc.HasAttrib(aRange, HASATTR_MERGED) )
continue;
ScRange aExtended = aRange;
- pDoc->ExtendMerge(aExtended);
+ rDoc.ExtendMerge(aExtended);
ScRange aRefresh = aExtended;
- pDoc->ExtendOverlapped(aRefresh);
+ rDoc.ExtendOverlapped(aRefresh);
if (bRecord)
{
if (!pUndoDoc)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo(pDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin());
+ pUndoDoc->InitUndo(&rDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin());
}
- pDoc->CopyToDocument(aExtended, IDF_ATTRIB, false, pUndoDoc);
+ rDoc.CopyToDocument(aExtended, IDF_ATTRIB, false, pUndoDoc);
}
- const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
- ScPatternAttr aPattern( pDoc->GetPool() );
+ const SfxPoolItem& rDefAttr = rDoc.GetPool()->GetDefaultItem( ATTR_MERGE );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( rDefAttr );
- pDoc->ApplyPatternAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
+ rDoc.ApplyPatternAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(), nTab,
aPattern );
- pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(),
+ rDoc.RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(),
aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
SC_MF_HOR | SC_MF_VER );
- pDoc->ExtendMerge( aRefresh, true );
+ rDoc.ExtendMerge( aRefresh, true );
if ( !AdjustRowHeight( aExtended ) )
rDocShell.PostPaint( aExtended, PAINT_GRID );
@@ -4820,19 +4820,19 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA
ScDocShellModificator aModificator( rDocShell );
OSL_ENSURE( pNewRanges, "pNewRanges is 0" );
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
if (bUndo)
{
ScRangeName* pOld;
if (nTab >=0)
{
- pOld = pDoc->GetRangeName(nTab);
+ pOld = rDoc.GetRangeName(nTab);
}
else
{
- pOld = pDoc->GetRangeName();
+ pOld = rDoc.GetRangeName();
}
ScRangeName* pUndoRanges = new ScRangeName(*pOld);
ScRangeName* pRedoRanges = new ScRangeName(*pNewRanges);
@@ -4843,16 +4843,16 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA
// #i55926# While loading XML, formula cells only have a single string token,
// so CompileNameFormula would never find any name (index) tokens, and would
// unnecessarily loop through all cells.
- bool bCompile = ( !pDoc->IsImportingXML() && pDoc->GetNamedRangesLockCount() == 0 );
+ bool bCompile = ( !rDoc.IsImportingXML() && rDoc.GetNamedRangesLockCount() == 0 );
if ( bCompile )
- pDoc->PreprocessRangeNameUpdate();
+ rDoc.PreprocessRangeNameUpdate();
if (nTab >= 0)
- pDoc->SetRangeName( nTab, pNewRanges ); // takes ownership
+ rDoc.SetRangeName( nTab, pNewRanges ); // takes ownership
else
- pDoc->SetRangeName( pNewRanges ); // takes ownership
+ rDoc.SetRangeName( pNewRanges ); // takes ownership
if ( bCompile )
- pDoc->PostprocessRangeNameUpdate();
+ rDoc.PostprocessRangeNameUpdate();
if (bModifyDoc)
{
@@ -4866,19 +4866,19 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA
void ScDocFunc::ModifyAllRangeNames( const boost::ptr_map<OUString, ScRangeName>& rRangeMap )
{
ScDocShellModificator aModificator(rDocShell);
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (pDoc->IsUndoEnabled())
+ if (rDoc.IsUndoEnabled())
{
std::map<OUString, ScRangeName*> aOldRangeMap;
- pDoc->GetRangeNameMap(aOldRangeMap);
+ rDoc.GetRangeNameMap(aOldRangeMap);
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoAllRangeNames(&rDocShell, aOldRangeMap, rRangeMap));
}
- pDoc->PreprocessRangeNameUpdate();
- pDoc->SetAllRangeNames(rRangeMap);
- pDoc->PostprocessRangeNameUpdate();
+ rDoc.PreprocessRangeNameUpdate();
+ rDoc.SetAllRangeNames(rRangeMap);
+ rDoc.PostprocessRangeNameUpdate();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
@@ -4892,14 +4892,14 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
if (rCancel)
return;
- ScDocument* pDoc = rDocShell.GetDocument();
- if (!pDoc->HasValueData( nPosX, nPosY, nTab ))
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (!rDoc.HasValueData( nPosX, nPosY, nTab ))
{
- OUString aName = pDoc->GetString(nPosX, nPosY, nTab);
+ OUString aName = rDoc.GetString(nPosX, nPosY, nTab);
ScRangeData::MakeValidName(aName);
if (!aName.isEmpty())
{
- OUString aContent(ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format(SCR_ABS_3D, pDoc));
+ OUString aContent(ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).Format(SCR_ABS_3D, &rDoc));
bool bInsert = false;
ScRangeData* pOld = rList.findByUpperName(ScGlobal::pCharClass->uppercase(aName));
@@ -4937,7 +4937,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
if (bInsert)
{
- ScRangeData* pData = new ScRangeData( pDoc, aName, aContent,
+ ScRangeData* pData = new ScRangeData( &rDoc, aName, aContent,
ScAddress( nPosX, nPosY, nTab));
if (!rList.insert(pData))
{
@@ -4973,12 +4973,12 @@ bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, bool bApi
if (bValid)
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
ScRangeName* pNames;
if (aTab >=0)
- pNames = pDoc->GetRangeName(nTab);
+ pNames = rDoc.GetRangeName(nTab);
else
- pNames = pDoc->GetRangeName();
+ pNames = rDoc.GetRangeName();
if (!pNames)
return false; // soll nicht sein
@@ -5043,13 +5043,13 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi )
ScDocShellModificator aModificator( rDocShell );
bool bDone = false;
- ScDocument* pDoc = rDocShell.GetDocument();
- const bool bRecord = pDoc->IsUndoEnabled();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ const bool bRecord = rDoc.IsUndoEnabled();
SCTAB nTab = rStartPos.Tab();
ScDocument* pUndoDoc = NULL;
//local names have higher priority than global names
- ScRangeName* pLocalList = pDoc->GetRangeName(nTab);
+ ScRangeName* pLocalList = rDoc.GetRangeName(nTab);
sal_uInt16 nValidCount = 0;
ScRangeName::iterator itrLocalBeg = pLocalList->begin(), itrLocalEnd = pLocalList->end();
for (ScRangeName::iterator itr = itrLocalBeg; itr != itrLocalEnd; ++itr)
@@ -5058,7 +5058,7 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi )
if (!r.HasType(RT_DATABASE))
++nValidCount;
}
- ScRangeName* pList = pDoc->GetRangeName();
+ ScRangeName* pList = rDoc.GetRangeName();
ScRangeName::iterator itrBeg = pList->begin(), itrEnd = pList->end();
for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
@@ -5074,17 +5074,17 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi )
SCCOL nEndCol = nStartCol + 1;
SCROW nEndRow = nStartRow + static_cast<SCROW>(nValidCount) - 1;
- ScEditableTester aTester( pDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+ ScEditableTester aTester( &rDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow );
if (aTester.IsEditable())
{
if (bRecord)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
IDF_ALL, false, pUndoDoc );
- pDoc->BeginDrawUndo(); // wegen Hoehenanpassung
+ rDoc.BeginDrawUndo(); // wegen Hoehenanpassung
}
boost::scoped_array<ScRangeData*> ppSortArray(new ScRangeData* [ nValidCount ]);
@@ -5116,8 +5116,8 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi )
aFormula = "=" + aContent.toString();
ScSetStringParam aParam;
aParam.setTextInput();
- pDoc->SetString(ScAddress(nStartCol,nOutRow,nTab), aName, &aParam);
- pDoc->SetString(ScAddress(nEndCol,nOutRow,nTab), aFormula, &aParam);
+ rDoc.SetString(ScAddress(nStartCol,nOutRow,nTab), aName, &aParam);
+ rDoc.SetString(ScAddress(nEndCol,nOutRow,nTab), aFormula, &aParam);
++nOutRow;
}
@@ -5126,8 +5126,8 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi )
if (bRecord)
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
+ pRedoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
IDF_ALL, false, pRedoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
@@ -5150,17 +5150,17 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi )
bool ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCCOL nStartCol = rOldRange.aStart.Col();
SCROW nStartRow = rOldRange.aStart.Row();
SCTAB nTab = rOldRange.aStart.Tab();
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
bool bRet = false;
OUString aFormula;
- pDoc->GetFormula( nStartCol, nStartRow, nTab, aFormula );
+ rDoc.GetFormula( nStartCol, nStartRow, nTab, aFormula );
if ( aFormula.startsWith("{") && aFormula.endsWith("}") )
{
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_RESIZEMATRIX );
@@ -5197,10 +5197,10 @@ bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter,
const ScRange& rDestRange, sal_uLong nRefresh,
bool bFitBlock, bool bApi )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bool bUndo (rDoc.IsUndoEnabled());
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
// #i52120# if other area links exist at the same start position,
// remove them first (file format specifies only one link definition
@@ -5264,7 +5264,7 @@ bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter,
}
// Update hat sein eigenes Undo
- if (pDoc->IsExecuteLinkEnabled())
+ if (rDoc.IsExecuteLinkEnabled())
{
pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen
pLink->Update(); // kein SetInCreate -> Update ausfuehren
@@ -5298,18 +5298,18 @@ void SetConditionalFormatAttributes(ScDocument* pDoc, const ScRangeList& rRanges
void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFormat* pFormat, SCTAB nTab, const ScRangeList& rRanges )
{
ScDocShellModificator aModificator(rDocShell);
- ScDocument* pDoc = rDocShell.GetDocument();
- if(pDoc->IsTabProtected(nTab))
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if(rDoc.IsTabProtected(nTab))
return;
- bool bUndo = pDoc->IsUndoEnabled();
+ bool bUndo = rDoc.IsUndoEnabled();
ScDocument* pUndoDoc = NULL;
ScRange aCombinedRange = rRanges.Combine();
ScRange aCompleteRange;
if(bUndo)
{
pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
if(pFormat)
{
@@ -5317,12 +5317,12 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
}
if(nOldFormat)
{
- ScConditionalFormat* pOldFormat = pDoc->GetCondFormList(nTab)->GetFormat(nOldFormat);
+ ScConditionalFormat* pOldFormat = rDoc.GetCondFormList(nTab)->GetFormat(nOldFormat);
if(pOldFormat)
aCompleteRange.ExtendTo(pOldFormat->GetRange().Combine());
}
- pDoc->CopyToDocument( aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab,
+ rDoc.CopyToDocument( aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab,
aCompleteRange.aEnd.Col(),aCompleteRange.aEnd.Row(),nTab,
IDF_ALL, false, pUndoDoc );
}
@@ -5330,15 +5330,15 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
boost::scoped_ptr<ScRange> pRepaintRange;
if(nOldFormat)
{
- ScConditionalFormat* pOldFormat = pDoc->GetCondFormList(nTab)->GetFormat(nOldFormat);
+ ScConditionalFormat* pOldFormat = rDoc.GetCondFormList(nTab)->GetFormat(nOldFormat);
if(pOldFormat)
{
pRepaintRange.reset(new ScRange( pOldFormat->GetRange().Combine() ));
- RemoveCondFormatAttributes(pDoc, pOldFormat, nTab);
+ RemoveCondFormatAttributes(&rDoc, pOldFormat, nTab);
}
- pDoc->DeleteConditionalFormat(nOldFormat, nTab);
- pDoc->SetStreamValid(nTab, false);
+ rDoc.DeleteConditionalFormat(nOldFormat, nTab);
+ rDoc.SetStreamValid(nTab, false);
}
if(pFormat)
{
@@ -5347,17 +5347,17 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
else
pRepaintRange.reset(new ScRange(aCombinedRange));
- sal_uLong nIndex = pDoc->AddCondFormat(pFormat, nTab);
+ sal_uLong nIndex = rDoc.AddCondFormat(pFormat, nTab);
- SetConditionalFormatAttributes(pDoc, rRanges, nIndex, nTab);
- pDoc->SetStreamValid(nTab, false);
+ SetConditionalFormatAttributes(&rDoc, rRanges, nIndex, nTab);
+ rDoc.SetStreamValid(nTab, false);
}
if(bUndo)
{
ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO);
- pRedoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab,
+ pRedoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab,
aCompleteRange.aEnd.Col(),aCompleteRange.aEnd.Row(),nTab,
IDF_ALL, false, pRedoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
@@ -5374,15 +5374,15 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB nTab )
{
ScDocShellModificator aModificator(rDocShell);
- ScDocument* pDoc = rDocShell.GetDocument();
- if(pDoc->IsTabProtected(nTab))
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if(rDoc.IsTabProtected(nTab))
return;
// first remove all old entries
- ScConditionalFormatList* pOldList = pDoc->GetCondFormList(nTab);
+ ScConditionalFormatList* pOldList = rDoc.GetCondFormList(nTab);
for(ScConditionalFormatList::const_iterator itr = pOldList->begin(), itrEnd = pOldList->end(); itr != itrEnd; ++itr)
{
- RemoveCondFormatAttributes(pDoc, &(*itr), nTab);
+ RemoveCondFormatAttributes(&rDoc, &(*itr), nTab);
}
// then set new entries
@@ -5390,13 +5390,13 @@ void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB
{
sal_uLong nIndex = itr->GetKey();
const ScRangeList& rRange = itr->GetRange();
- SetConditionalFormatAttributes(pDoc, rRange, nIndex, nTab);
+ SetConditionalFormatAttributes(&rDoc, rRange, nIndex, nTab);
}
- pDoc->SetCondFormList(pList, nTab);
+ rDoc.SetCondFormList(pList, nTab);
rDocShell.PostPaintGridAll();
- pDoc->SetStreamValid(nTab, false);
+ rDoc.SetStreamValid(nTab, false);
aModificator.SetDocumentModified();
SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 7ed1836346d0..8c1ea5b0b2db 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -213,7 +213,7 @@ void ScDocShell::DoEnterHandler()
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if (pViewSh)
- if (pViewSh->GetViewData()->GetDocShell() == this)
+ if (pViewSh->GetViewData().GetDocShell() == this)
SC_MOD()->InputEnterHandler();
}
@@ -223,7 +223,7 @@ SCTAB ScDocShell::GetSaveTab()
ScTabViewShell* pSh = GetBestViewShell();
if (pSh)
{
- const ScMarkData& rMark = pSh->GetViewData()->GetMarkData();
+ const ScMarkData& rMark = pSh->GetViewData().GetMarkData();
nTab = rMark.GetFirstSelected();
}
return nTab;
@@ -423,7 +423,7 @@ void processDataStream( ScDocShell& rShell, const sc::ImportPostProcessData& rDa
sc::DataStream* pStrm = new sc::DataStream(&rShell, r.maURL, aTopRange, nLimit, eMove, 0);
pStrm->SetRefreshOnEmptyLine(r.mbRefreshOnEmpty);
- sc::DocumentLinkManager& rMgr = rShell.GetDocument()->GetDocLinkManager();
+ sc::DocumentLinkManager& rMgr = rShell.GetDocument().GetDocLinkManager();
rMgr.setDataStream(pStrm);
}
@@ -933,7 +933,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
case SFX_EVENT_SAVEASDOC:
{
- if ( GetDocument()->GetExternalRefManager()->containsUnsavedReferences() )
+ if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() )
{
WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) );
@@ -2223,7 +2223,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
ScExtDocOptions* pExtDocOpt = aDocument.GetExtDocOptions();
if( !pExtDocOpt )
aDocument.SetExtDocOptions( pExtDocOpt = new ScExtDocOptions );
- pViewShell->GetViewData()->WriteExtOptions( *pExtDocOpt );
+ pViewShell->GetViewData().WriteExtOptions( *pExtDocOpt );
/* #i104990# If the imported document contains a medium
password, determine if we can save it, otherwise ask the users
@@ -3068,43 +3068,43 @@ void ScDocShell::UseSheetSaveEntries()
ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS )
:
rDocShell( rDS ),
- mpProtector(new ScRefreshTimerProtector(rDS.GetDocument()->GetRefreshTimerControlAddress()))
+ mpProtector(new ScRefreshTimerProtector(rDS.GetDocument().GetRefreshTimerControlAddress()))
{
- ScDocument* pDoc = rDocShell.GetDocument();
- bAutoCalcShellDisabled = pDoc->IsAutoCalcShellDisabled();
- bIdleEnabled = pDoc->IsIdleEnabled();
- pDoc->SetAutoCalcShellDisabled( true );
- pDoc->EnableIdle(false);
+ ScDocument& rDoc = rDocShell.GetDocument();
+ bAutoCalcShellDisabled = rDoc.IsAutoCalcShellDisabled();
+ bIdleEnabled = rDoc.IsIdleEnabled();
+ rDoc.SetAutoCalcShellDisabled( true );
+ rDoc.EnableIdle(false);
}
ScDocShellModificator::~ScDocShellModificator()
{
- ScDocument* pDoc = rDocShell.GetDocument();
- pDoc->SetAutoCalcShellDisabled( bAutoCalcShellDisabled );
+ ScDocument& rDoc = rDocShell.GetDocument();
+ rDoc.SetAutoCalcShellDisabled( bAutoCalcShellDisabled );
if ( !bAutoCalcShellDisabled && rDocShell.IsDocumentModifiedPending() )
rDocShell.SetDocumentModified(); // last one shuts off the lights
- pDoc->EnableIdle(bIdleEnabled);
+ rDoc.EnableIdle(bIdleEnabled);
}
void ScDocShellModificator::SetDocumentModified()
{
- ScDocument* pDoc = rDocShell.GetDocument();
- pDoc->ClearFormulaContext();
- if ( !pDoc->IsImportingXML() )
+ ScDocument& rDoc = rDocShell.GetDocument();
+ rDoc.ClearFormulaContext();
+ if ( !rDoc.IsImportingXML() )
{
// AutoCalcShellDisabled temporaer restaurieren
- bool bDisabled = pDoc->IsAutoCalcShellDisabled();
- pDoc->SetAutoCalcShellDisabled( bAutoCalcShellDisabled );
+ bool bDisabled = rDoc.IsAutoCalcShellDisabled();
+ rDoc.SetAutoCalcShellDisabled( bAutoCalcShellDisabled );
rDocShell.SetDocumentModified();
- pDoc->SetAutoCalcShellDisabled( bDisabled );
+ rDoc.SetAutoCalcShellDisabled( bDisabled );
}
else
{
// uno broadcast is necessary for api to work
// -> must also be done during xml import
- pDoc->BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
+ rDoc.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
}
}
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 22d295e68295..d7862d17195e 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -72,7 +72,7 @@ void ScDocShell::PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddre
// Test: nur aktive ViewShell
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- if (pViewSh && pViewSh->GetViewData()->GetDocShell() == this)
+ if (pViewSh && pViewSh->GetViewData().GetDocShell() == this)
{
ScEditViewHint aHint( pEditEngine, rCursorPos );
pViewSh->Notify( *this, aHint );
@@ -554,7 +554,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
ScChangeAction* ScDocShell::GetChangeAction( const ScAddress& rPos )
{
- ScChangeTrack* pTrack = GetDocument()->GetChangeTrack();
+ ScChangeTrack* pTrack = GetDocument().GetChangeTrack();
if (!pTrack)
return NULL;
@@ -612,7 +612,7 @@ void ScDocShell::SetChangeComment( ScChangeAction* pAction, const OUString& rCom
SetDocumentModified();
// Dialog-Notify
- ScChangeTrack* pTrack = GetDocument()->GetChangeTrack();
+ ScChangeTrack* pTrack = GetDocument().GetChangeTrack();
if (pTrack)
{
sal_uLong nNumber = pAction->GetActionNumber();
@@ -879,7 +879,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
bool bHasRejected = false;
OUString aOldUser = pThisTrack->GetUser();
pThisTrack->SetUseFixDateTime( true );
- ScMarkData& rMarkData = pViewSh->GetViewData()->GetMarkData();
+ ScMarkData& rMarkData = pViewSh->GetViewData().GetMarkData();
ScMarkData aOldMarkData( rMarkData );
pSourceAction = pFirstMergeAction;
while ( pSourceAction && pSourceAction->GetActionNumber() <= nLastMergeAction )
@@ -1151,7 +1151,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
return false;
}
- ScDocument& rSharedDoc = *( pSharedDocShell->GetDocument() );
+ ScDocument& rSharedDoc = pSharedDocShell->GetDocument();
ScChangeTrack* pSharedTrack = rSharedDoc.GetChangeTrack();
if ( !pSharedTrack )
{
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index dd9eaf8a585a..04751134d07b 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -254,7 +254,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_CHART_ADDSOURCE:
if (pReqArgs)
{
- ScDocument* pDoc = GetDocument();
+ ScDocument& rDoc = GetDocument();
const SfxPoolItem* pItem;
OUString aChartName, aRangeName;
@@ -285,12 +285,12 @@ void ScDocShell::Execute( SfxRequest& rReq )
bRowInit = true;
}
- ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
- bool bValid = ( aSingleRange.ParseAny( aRangeName, pDoc, aDetails ) & SCA_VALID ) != 0;
+ ScAddress::Details aDetails(rDoc.GetAddressConvention(), 0, 0);
+ bool bValid = ( aSingleRange.ParseAny( aRangeName, &rDoc, aDetails ) & SCA_VALID ) != 0;
if (!bValid)
{
aRangeListRef = new ScRangeList;
- aRangeListRef->Parse( aRangeName, pDoc );
+ aRangeListRef->Parse( aRangeName, &rDoc );
if ( !aRangeListRef->empty() )
{
bMultiRange = true;
@@ -410,9 +410,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
break;
case SID_UPDATETABLINKS:
{
- ScDocument* pDoc = GetDocument();
+ ScDocument& rDoc = GetDocument();
- ScLkUpdMode nSet=pDoc->GetLinkMode();
+ ScLkUpdMode nSet = rDoc.GetLinkMode();
sal_uInt16 nDlgRet=RET_NO;
if(nSet==LM_UNKNOWN)
@@ -557,70 +557,67 @@ void ScDocShell::Execute( SfxRequest& rReq )
case FID_CHG_RECORD:
{
- ScDocument* pDoc = GetDocument();
- if(pDoc!=NULL)
+ ScDocument& rDoc = GetDocument();
+ // get argument (recorded macro)
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, false );
+ bool bDo = true;
+
+ // xmlsec05/06:
+ // getting real parent window when called from Security-Options TP
+ Window* pParent = NULL;
+ const SfxPoolItem* pParentItem;
+ if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
+ pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
+
+ // desired state
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
+ bool bActivateTracking = (pChangeTrack == 0); // toggle
+ if ( pItem )
+ bActivateTracking = pItem->GetValue(); // from argument
+
+ if ( !bActivateTracking )
{
- // get argument (recorded macro)
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, false );
- bool bDo = true;
-
- // xmlsec05/06:
- // getting real parent window when called from Security-Options TP
- Window* pParent = NULL;
- const SfxPoolItem* pParentItem;
- if( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
- pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
-
- // desired state
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
- bool bActivateTracking = (pChangeTrack == 0); // toggle
- if ( pItem )
- bActivateTracking = pItem->GetValue(); // from argument
-
- if ( !bActivateTracking )
+ if ( !pItem )
{
- if ( !pItem )
- {
- // no dialog on playing the macro
- WarningBox aBox( pParent ? pParent : GetActiveDialogParent(),
- WinBits(WB_YES_NO | WB_DEF_NO),
- ScGlobal::GetRscString( STR_END_REDLINING ) );
- bDo = ( aBox.Execute() == RET_YES );
- }
+ // no dialog on playing the macro
+ WarningBox aBox( pParent ? pParent : GetActiveDialogParent(),
+ WinBits(WB_YES_NO | WB_DEF_NO),
+ ScGlobal::GetRscString( STR_END_REDLINING ) );
+ bDo = ( aBox.Execute() == RET_YES );
+ }
+ if ( bDo )
+ {
+ if ( pChangeTrack->IsProtected() )
+ bDo = ExecuteChangeProtectionDialog( NULL );
if ( bDo )
{
- if ( pChangeTrack->IsProtected() )
- bDo = ExecuteChangeProtectionDialog( NULL );
- if ( bDo )
- {
- pDoc->EndChangeTracking();
- PostPaintGridAll();
- }
+ rDoc.EndChangeTracking();
+ PostPaintGridAll();
}
}
- else
- {
- pDoc->StartChangeTracking();
- ScChangeViewSettings aChangeViewSet;
- aChangeViewSet.SetShowChanges(true);
- pDoc->SetChangeViewSettings(aChangeViewSet);
- }
+ }
+ else
+ {
+ rDoc.StartChangeTracking();
+ ScChangeViewSettings aChangeViewSet;
+ aChangeViewSet.SetShowChanges(true);
+ rDoc.SetChangeViewSettings(aChangeViewSet);
+ }
- if ( bDo )
- {
- UpdateAcceptChangesDialog();
+ if ( bDo )
+ {
+ UpdateAcceptChangesDialog();
- // Slots invalidieren
- if (pBindings)
- pBindings->InvalidateAll(false);
- if ( !pItem )
- rReq.AppendItem( SfxBoolItem( FID_CHG_RECORD, bActivateTracking ) );
- rReq.Done();
- }
- else
- rReq.Ignore();
+ // Slots invalidieren
+ if (pBindings)
+ pBindings->InvalidateAll(false);
+ if ( !pItem )
+ rReq.AppendItem( SfxBoolItem( FID_CHG_RECORD, bActivateTracking ) );
+ rReq.Done();
}
+ else
+ rReq.Ignore();
}
break;
@@ -746,9 +743,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
#endif
if ( nSlot == SID_DOCUMENT_COMPARE )
- CompareDocument( *pOtherDocSh->GetDocument() );
+ CompareDocument( pOtherDocSh->GetDocument() );
else
- MergeDocument( *pOtherDocSh->GetDocument() );
+ MergeDocument( pOtherDocSh->GetDocument() );
// show "accept changes" dialog
//! get view for this document!
@@ -822,7 +819,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( pSh )
{
//! SetTabNo in DeleteTable weglassen?
- SCTAB nDispTab = pSh->GetViewData()->GetTabNo();
+ SCTAB nDispTab = pSh->GetViewData().GetTabNo();
pSh->DeleteTable( nTab );
pSh->SetTabNo(nDispTab);
rReq.Done();
@@ -2186,7 +2183,7 @@ ScViewData* ScDocShell::GetViewData()
{
SfxViewShell* pCur = SfxViewShell::Current();
ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pCur);
- return pViewSh ? pViewSh->GetViewData() : NULL;
+ return pViewSh ? &pViewSh->GetViewData() : NULL;
}
SCTAB ScDocShell::GetCurTab()
@@ -2202,7 +2199,7 @@ ScTabViewShell* ScDocShell::GetBestViewShell( bool bOnlyVisible )
{
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
// falsches Doc?
- if( pViewSh && pViewSh->GetViewData()->GetDocShell() != this )
+ if( pViewSh && pViewSh->GetViewData().GetDocShell() != this )
pViewSh = NULL;
if( !pViewSh )
{
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index c52e287efd37..88cab9572471 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -822,40 +822,40 @@ sal_uLong ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
SCTAB nDestPos, bool bInsertNew,
bool bNotifyAndPaint )
{
- ScDocument* pSrcDoc = rSrcDocShell.GetDocument();
+ ScDocument& rSrcDoc = rSrcDocShell.GetDocument();
// set the transferred area to the copyparam to make adjusting formulas possible
ScClipParam aParam;
ScRange aRange(0, 0, nSrcPos, MAXCOL, MAXROW, nSrcPos);
aParam.maRanges.Append(aRange);
- pSrcDoc->SetClipParam(aParam);
+ rSrcDoc.SetClipParam(aParam);
- sal_uLong nErrVal = aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos,
+ sal_uLong nErrVal = aDocument.TransferTab( &rSrcDoc, nSrcPos, nDestPos,
bInsertNew ); // no insert
// TransferTab doesn't copy drawing objects with bInsertNew=FALSE
if ( nErrVal > 0 && !bInsertNew)
- aDocument.TransferDrawPage( pSrcDoc, nSrcPos, nDestPos );
+ aDocument.TransferDrawPage( &rSrcDoc, nSrcPos, nDestPos );
- if(nErrVal>0 && pSrcDoc->IsScenario( nSrcPos ))
+ if(nErrVal>0 && rSrcDoc.IsScenario( nSrcPos ))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pSrcDoc->GetScenarioData( nSrcPos, aComment,aColor, nFlags);
+ rSrcDoc.GetScenarioData( nSrcPos, aComment,aColor, nFlags);
aDocument.SetScenario(nDestPos,true);
aDocument.SetScenarioData(nDestPos,aComment,aColor,nFlags);
- bool bActive = pSrcDoc->IsActiveScenario(nSrcPos);
+ bool bActive = rSrcDoc.IsActiveScenario(nSrcPos);
aDocument.SetActiveScenario(nDestPos, bActive );
- bool bVisible=pSrcDoc->IsVisible(nSrcPos);
+ bool bVisible = rSrcDoc.IsVisible(nSrcPos);
aDocument.SetVisible(nDestPos,bVisible );
}
- if ( nErrVal > 0 && pSrcDoc->IsTabProtected( nSrcPos ) )
- aDocument.SetTabProtection(nDestPos, pSrcDoc->GetTabProtection(nSrcPos));
+ if ( nErrVal > 0 && rSrcDoc.IsTabProtected( nSrcPos ) )
+ aDocument.SetTabProtection(nDestPos, rSrcDoc.GetTabProtection(nSrcPos));
if ( bNotifyAndPaint )
{
Broadcast( ScTablesHint( SC_TAB_INSERTED, nDestPos ) );
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 7dd8d0eaf46e..1e21b7541ea7 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -151,7 +151,7 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, bool bModifyStart
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if (pViewSh)
{
- if (pViewSh->GetViewData()->GetDocShell() == this)
+ if (pViewSh->GetViewData().GetDocShell() == this)
pViewSh->UpdateOleZoom();
}
}
@@ -279,7 +279,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS
if ( !bCellStyles && !bPageStyles ) // nothing to do
return;
- ScStyleSheetPool* pSourcePool = rSource.GetDocument()->GetStyleSheetPool();
+ ScStyleSheetPool* pSourcePool = rSource.GetDocument().GetStyleSheetPool();
ScStyleSheetPool* pDestPool = aDocument.GetStyleSheetPool();
SfxStyleFamily eFamily = bCellStyles ?
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index ddb2e575d112..a37f78fdbc30 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -486,8 +486,8 @@ void lcl_GetColumnTypes(
OUString* pColNames, sal_Int32* pColTypes, sal_Int32* pColLengths,
sal_Int32* pColScales, bool& bHasMemo, rtl_TextEncoding eCharSet )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- SvNumberFormatter* pNumFmt = pDoc->GetFormatTable();
+ ScDocument& rDoc = rDocShell.GetDocument();
+ SvNumberFormatter* pNumFmt = rDoc.GetFormatTable();
SCTAB nTab = rDataRange.aStart.Tab();
SCCOL nFirstCol = rDataRange.aStart.Col();
@@ -514,7 +514,7 @@ void lcl_GetColumnTypes(
// Type etc.: L; D; C[,W]; N[,W[,P]]
if ( bHasFieldNames )
{
- aString = pDoc->GetString(nCol, nFirstRow, nTab);
+ aString = rDoc.GetString(nCol, nFirstRow, nTab);
aString = aString.toAsciiUpperCase();
sal_Int32 nToken = comphelper::string::getTokenCount(aString, ',');
if ( nToken > 1 )
@@ -615,13 +615,13 @@ void lcl_GetColumnTypes(
if ( !bTypeDefined )
{ // Field type.
ScRefCellValue aCell;
- aCell.assign(*pDoc, ScAddress(nCol, nFirstDataRow, nTab));
+ aCell.assign(rDoc, ScAddress(nCol, nFirstDataRow, nTab));
if (aCell.isEmpty() || aCell.hasString())
nDbType = sdbc::DataType::VARCHAR;
else
{
sal_uInt32 nFormat;
- pDoc->GetNumberFormat( nCol, nFirstDataRow, nTab, nFormat );
+ rDoc.GetNumberFormat( nCol, nFirstDataRow, nTab, nFormat );
switch ( pNumFmt->GetType( nFormat ) )
{
case NUMBERFORMAT_LOGICAL :
@@ -646,7 +646,7 @@ void lcl_GetColumnTypes(
// Field length.
if ( nDbType == sdbc::DataType::VARCHAR && !nFieldLen )
{ // Determine maximum field width.
- nFieldLen = pDoc->GetMaxStringLen( nTab, nCol, nFirstDataRow,
+ nFieldLen = rDoc.GetMaxStringLen( nTab, nCol, nFirstDataRow,
nLastRow, eCharSet );
if ( nFieldLen == 0 )
nFieldLen = 1;
@@ -655,7 +655,7 @@ void lcl_GetColumnTypes(
{ // Determine maximum field width and precision.
sal_Int32 nLen;
sal_uInt16 nPrec;
- nLen = pDoc->GetMaxNumberStringLen( nPrec, nTab, nCol,
+ nLen = rDoc.GetMaxNumberStringLen( nPrec, nTab, nCol,
nFirstDataRow, nLastRow );
// dBaseIII precision limit: 15
if ( nPrecision > 15 )
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index fae875483756..5269d78b58c4 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2239,7 +2239,7 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
if (pFileName->equalsIgnoreAsciiCase(pMedium->GetName()))
{
// Found !
- pSrcDoc = pShell->GetDocument();
+ pSrcDoc = &pShell->GetDocument();
break;
}
}
@@ -2254,7 +2254,7 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
aSrcDoc.maShell = pShell;
maUnsavedDocShells.insert(DocShellMap::value_type(nFileId, aSrcDoc));
StartListening(*pShell);
- pSrcDoc = pShell->GetDocument();
+ pSrcDoc = &pShell->GetDocument();
break;
}
}
@@ -2279,7 +2279,7 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
SfxObjectShell* p = itr->second.maShell;
itr->second.maLastAccess = Time( Time::SYSTEM );
- return static_cast<ScDocShell*>(p)->GetDocument();
+ return &static_cast<ScDocShell*>(p)->GetDocument();
}
itrEnd = maUnsavedDocShells.end();
@@ -2290,7 +2290,7 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
SfxObjectShell* p = itr->second.maShell;
itr->second.maLastAccess = Time( Time::SYSTEM );
- return static_cast<ScDocShell*>(p)->GetDocument();
+ return &static_cast<ScDocShell*>(p)->GetDocument();
}
const OUString* pFile = getExternalFileName(nFileId);
@@ -2313,7 +2313,7 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
return NULL;
}
- return cacheNewDocShell(nFileId, aSrcDoc);
+ return &cacheNewDocShell(nFileId, aSrcDoc);
}
SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUString& rFilter)
@@ -2376,17 +2376,17 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
// increment the recursive link count of the source document.
ScExtDocOptions* pExtOpt = mpDoc->GetExtDocOptions();
sal_uInt32 nLinkCount = pExtOpt ? pExtOpt->GetDocSettings().mnLinkCnt : 0;
- ScDocument* pSrcDoc = pNewShell->GetDocument();
- pSrcDoc->EnableExecuteLink(false); // to prevent circular access of external references.
- pSrcDoc->EnableUndo(false);
- pSrcDoc->EnableAdjustHeight(false);
- pSrcDoc->EnableUserInteraction(false);
+ ScDocument& rSrcDoc = pNewShell->GetDocument();
+ rSrcDoc.EnableExecuteLink(false); // to prevent circular access of external references.
+ rSrcDoc.EnableUndo(false);
+ rSrcDoc.EnableAdjustHeight(false);
+ rSrcDoc.EnableUserInteraction(false);
- ScExtDocOptions* pExtOptNew = pSrcDoc->GetExtDocOptions();
+ ScExtDocOptions* pExtOptNew = rSrcDoc.GetExtDocOptions();
if (!pExtOptNew)
{
pExtOptNew = new ScExtDocOptions;
- pSrcDoc->SetExtDocOptions(pExtOptNew);
+ rSrcDoc.SetExtDocOptions(pExtOptNew);
}
pExtOptNew->GetDocSettings().mnLinkCnt = nLinkCount + 1;
@@ -2406,7 +2406,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
return aRef;
}
-ScDocument* ScExternalRefManager::cacheNewDocShell( sal_uInt16 nFileId, SrcShell& rSrcShell )
+ScDocument& ScExternalRefManager::cacheNewDocShell( sal_uInt16 nFileId, SrcShell& rSrcShell )
{
if (mbDocTimerEnabled && maDocShells.empty())
// If this is the first source document insertion, start up the timer.
@@ -2414,9 +2414,9 @@ ScDocument* ScExternalRefManager::cacheNewDocShell( sal_uInt16 nFileId, SrcShell
maDocShells.insert(DocShellMap::value_type(nFileId, rSrcShell));
SfxObjectShell& rShell = *rSrcShell.maShell;
- ScDocument* pSrcDoc = static_cast<ScDocShell&>(rShell).GetDocument();
- initDocInCache(maRefCache, pSrcDoc, nFileId);
- return pSrcDoc;
+ ScDocument& rSrcDoc = static_cast<ScDocShell&>(rShell).GetDocument();
+ initDocInCache(maRefCache, &rSrcDoc, nFileId);
+ return rSrcDoc;
}
bool ScExternalRefManager::isFileLoadable(const OUString& rFile) const
@@ -2742,13 +2742,13 @@ bool ScExternalRefManager::refreshSrcDocument(sal_uInt16 nFileId)
return false;
ScDocShell& rDocSh = static_cast<ScDocShell&>(*xDocShell);
- ScDocument* pSrcDoc = rDocSh.GetDocument();
+ ScDocument& rSrcDoc = rDocSh.GetDocument();
// Clear the existing cache, and refill it. Make sure we keep the
// existing cache table instances here.
maRefCache.clearCacheTables(nFileId);
RefCacheFiller aAction(mpDoc->GetSharedStringPool(), maRefCache, nFileId);
- aCachedArea.executeColumnAction(*pSrcDoc, aAction);
+ aCachedArea.executeColumnAction(rSrcDoc, aAction);
DocShellMap::iterator it = maDocShells.find(nFileId);
if (it != maDocShells.end())
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 57656d4f7bdc..3aa5cf6b0c64 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -46,7 +46,7 @@ static void lcl_InvalidateOutliner( SfxBindings* pBindings )
static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab,
bool bColumns, SCCOLROW nStart, SCCOLROW nEnd )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
sal_uInt16 nParts = PAINT_GRID;
SCCOL nStartCol = 0;
@@ -65,7 +65,7 @@ static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab,
nStartRow = nStart;
nEndRow = nEnd;
}
- if (pDoc->HasAttrib( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
+ if (rDoc.HasAttrib( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ))
{
nStartCol = 0;
@@ -83,24 +83,24 @@ bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, bool bColumns, bool b
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nTab = rRange.aStart.Tab();
- ScDocument* pDoc = rDocShell.GetDocument();
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab, true );
+ ScDocument& rDoc = rDocShell.GetDocument();
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab, true );
ScOutlineTable* pUndoTab = NULL;
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if (bRecord)
pUndoTab = new ScOutlineTable( *pTable );
- ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
+ ScOutlineArray& rArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
bool bRes;
bool bSize = false;
if ( bColumns )
- bRes = pArray->Insert( nStartCol, nEndCol, bSize );
+ bRes = rArray.Insert( nStartCol, nEndCol, bSize );
else
- bRes = pArray->Insert( nStartRow, nEndRow, bSize );
+ bRes = rArray.Insert( nStartRow, nEndRow, bSize );
if ( bRes )
{
@@ -112,8 +112,8 @@ bool ScOutlineDocFunc::MakeOutline( const ScRange& rRange, bool bColumns, bool b
pUndoTab, bColumns, true ) );
}
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
sal_uInt16 nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
@@ -148,25 +148,25 @@ bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, bool bColumns, bool
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nTab = rRange.aStart.Tab();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
ScOutlineTable* pUndoTab = NULL;
if (bRecord)
pUndoTab = new ScOutlineTable( *pTable );
- ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
+ ScOutlineArray& rArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
bool bRes;
bool bSize = false;
if ( bColumns )
- bRes = pArray->Remove( nStartCol, nEndCol, bSize );
+ bRes = rArray.Remove( nStartCol, nEndCol, bSize );
else
- bRes = pArray->Remove( nStartRow, nEndRow, bSize );
+ bRes = rArray.Remove( nStartRow, nEndRow, bSize );
if ( bRes )
{
@@ -178,8 +178,8 @@ bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, bool bColumns, bool
pUndoTab, bColumns, false ) );
}
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
sal_uInt16 nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
@@ -209,27 +209,27 @@ bool ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, bool bColumns, bool
bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, bool bRecord )
{
bool bSuccess = false;
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
if (bRecord)
{
SCCOLROW nCol1, nCol2, nRow1, nRow2;
- pTable->GetColArray()->GetRange( nCol1, nCol2 );
- pTable->GetRowArray()->GetRange( nRow1, nRow2 );
+ pTable->GetColArray().GetRange( nCol1, nCol2 );
+ pTable->GetRowArray().GetRange( nRow1, nRow2 );
SCCOL nStartCol = static_cast<SCCOL>(nCol1);
SCROW nStartRow = nRow1;
SCCOL nEndCol = static_cast<SCCOL>(nCol2);
SCROW nEndRow = nRow2;
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
- pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
@@ -240,14 +240,14 @@ bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, bool bRecord )
pUndoDoc, pUndoTab ) );
}
- SelectLevel( nTab, true, pTable->GetColArray()->GetDepth(), false, false );
- SelectLevel( nTab, false, pTable->GetRowArray()->GetDepth(), false, false );
- pDoc->SetOutlineTable( nTab, NULL );
+ SelectLevel( nTab, true, pTable->GetColArray().GetDepth(), false, false );
+ SelectLevel( nTab, false, pTable->GetRowArray().GetDepth(), false, false );
+ rDoc.SetOutlineTable( nTab, NULL );
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
@@ -267,11 +267,11 @@ bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord )
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nTab = rRange.aStart.Tab();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
ScDocument* pUndoDoc = NULL;
ScOutlineTable* pUndoTab = NULL;
@@ -283,26 +283,26 @@ bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord )
pUndoTab = new ScOutlineTable( *pTable );
SCCOLROW nCol1, nCol2, nRow1, nRow2;
- pTable->GetColArray()->GetRange( nCol1, nCol2 );
- pTable->GetRowArray()->GetRange( nRow1, nRow2 );
+ pTable->GetColArray().GetRange( nCol1, nCol2 );
+ pTable->GetRowArray().GetRange( nRow1, nRow2 );
SCCOL nOutStartCol = static_cast<SCCOL>(nCol1);
SCROW nOutStartRow = nRow1;
SCCOL nOutEndCol = static_cast<SCCOL>(nCol2);
SCROW nOutEndRow = nRow2;
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
// einblenden
- SelectLevel( nTab, true, pTable->GetColArray()->GetDepth(), false, false );
- SelectLevel( nTab, false, pTable->GetRowArray()->GetDepth(), false, false );
- pDoc->SetOutlineTable( nTab, NULL );
+ SelectLevel( nTab, true, pTable->GetColArray().GetDepth(), false, false );
+ SelectLevel( nTab, false, pTable->GetRowArray().GetDepth(), false, false );
+ rDoc.SetOutlineTable( nTab, NULL );
}
- pDoc->DoAutoOutline( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
+ rDoc.DoAutoOutline( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
if (bRecord)
{
@@ -313,8 +313,8 @@ bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord )
pUndoDoc, pUndoTab ) );
}
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
@@ -326,19 +326,17 @@ bool ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord )
bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel,
bool bRecord, bool bPaint )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab ); // ist schon da
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab ); // ist schon da
if (!pTable)
return false;
- ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
- if (!pArray)
- return false;
+ ScOutlineArray& rArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
SCCOLROW nStart, nEnd;
- pArray->GetRange( nStart, nEnd );
+ rArray.GetRange( nStart, nEnd );
if ( bRecord )
{
@@ -346,15 +344,15 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, false );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, false );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
+ rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
@@ -364,7 +362,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
bColumns, nLevel ) );
}
- ScSubOutlineIterator aIter( pArray ); // alle Eintraege
+ ScSubOutlineIterator aIter( &rArray ); // alle Eintraege
ScOutlineEntry* pEntry;
while ((pEntry=aIter.GetNext()) != NULL)
{
@@ -390,22 +388,22 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
for (SCCOLROW i=nThisStart; i<=nThisEnd; i++)
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, bShow );
+ rDoc.ShowCol( static_cast<SCCOL>(i), nTab, bShow );
else
{
// show several rows together, don't show filtered rows
SCROW nFilterEnd = i;
- bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd );
+ bool bFiltered = rDoc.RowFiltered( i, nTab, NULL, &nFilterEnd );
nFilterEnd = std::min( nThisEnd, nFilterEnd );
if ( !bShow || !bFiltered )
- pDoc->ShowRows( i, nFilterEnd, nTab, bShow );
+ rDoc.ShowRows( i, nFilterEnd, nTab, bShow );
i = nFilterEnd;
}
}
}
- pDoc->SetDrawPageSize(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.SetDrawPageSize(nTab);
+ rDoc.UpdatePageBreaks( nTab );
if (bPaint)
lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd );
@@ -426,15 +424,14 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord )
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nTab = rRange.aStart.Tab();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
- ScOutlineArray* pArray;
ScOutlineEntry* pEntry;
SCCOLROW nStart;
SCCOLROW nEnd;
@@ -446,9 +443,9 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord )
{
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
- pDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoOutlineBlock( &rDocShell,
@@ -460,8 +457,8 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord )
nMin=MAXCOL;
nMax=0;
- pArray = pTable->GetColArray();
- ScSubOutlineIterator aColIter( pArray );
+ ScOutlineArray& rColArray = pTable->GetColArray();
+ ScSubOutlineIterator aColIter( &rColArray );
while ((pEntry=aColIter.GetNext()) != NULL)
{
nStart = pEntry->GetStart();
@@ -475,14 +472,14 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord )
}
}
for ( i=nMin; i<=nMax; i++ )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, true );
+ rDoc.ShowCol( static_cast<SCCOL>(i), nTab, true );
// Zeilen
nMin=MAXROW;
nMax=0;
- pArray = pTable->GetRowArray();
- ScSubOutlineIterator aRowIter( pArray );
+ ScOutlineArray& rRowArray = pTable->GetRowArray();
+ ScSubOutlineIterator aRowIter( &rRowArray );
while ((pEntry=aRowIter.GetNext()) != NULL)
{
nStart = pEntry->GetStart();
@@ -499,15 +496,15 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord )
{
// show several rows together, don't show filtered rows
SCROW nFilterEnd = i;
- bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd );
+ bool bFiltered = rDoc.RowFiltered( i, nTab, NULL, &nFilterEnd );
nFilterEnd = std::min( nMax, nFilterEnd );
if ( !bFiltered )
- pDoc->ShowRows( i, nFilterEnd, nTab, true );
+ rDoc.ShowRows( i, nFilterEnd, nTab, true );
i = nFilterEnd;
}
- pDoc->SetDrawPageSize(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.SetDrawPageSize(nTab);
+ rDoc.UpdatePageBreaks( nTab );
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP );
rDocShell.SetDocumentModified();
@@ -529,11 +526,11 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord )
SCROW nEndRow = rRange.aEnd.Row();
SCTAB nTab = rRange.aStart.Tab();
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
@@ -547,24 +544,24 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord )
SCCOLROW nEffStartCol = nStartCol;
SCCOLROW nEffEndCol = nEndCol;
- ScOutlineArray* pColArray = pTable->GetColArray();
- pColArray->FindTouchedLevel( nStartCol, nEndCol, nColLevel );
- pColArray->ExtendBlock( nColLevel, nEffStartCol, nEffEndCol );
+ ScOutlineArray& rColArray = pTable->GetColArray();
+ rColArray.FindTouchedLevel( nStartCol, nEndCol, nColLevel );
+ rColArray.ExtendBlock( nColLevel, nEffStartCol, nEffEndCol );
SCCOLROW nEffStartRow = nStartRow;
SCCOLROW nEffEndRow = nEndRow;
- ScOutlineArray* pRowArray = pTable->GetRowArray();
- pRowArray->FindTouchedLevel( nStartRow, nEndRow, nRowLevel );
- pRowArray->ExtendBlock( nRowLevel, nEffStartRow, nEffEndRow );
+ ScOutlineArray& rRowArray = pTable->GetRowArray();
+ rRowArray.FindTouchedLevel( nStartRow, nEndRow, nRowLevel );
+ rRowArray.ExtendBlock( nRowLevel, nEffStartRow, nEffEndRow );
if ( bRecord )
{
ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable );
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( static_cast<SCCOL>(nEffStartCol), 0, nTab,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nEffStartCol), 0, nTab,
static_cast<SCCOL>(nEffEndCol), MAXROW, nTab, IDF_NONE,
false, pUndoDoc );
- pDoc->CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, IDF_NONE, false, pUndoDoc );
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoOutlineBlock( &rDocShell,
@@ -574,10 +571,10 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord )
// Spalten
- nCount = pColArray->GetCount(nColLevel);
+ nCount = rColArray.GetCount(nColLevel);
for ( i=0; i<nCount; i++ )
{
- pEntry = pColArray->GetEntry(nColLevel,i);
+ pEntry = rColArray.GetEntry(nColLevel,i);
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
@@ -587,10 +584,10 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord )
// Zeilen
- nCount = pRowArray->GetCount(nRowLevel);
+ nCount = rRowArray.GetCount(nRowLevel);
for ( i=0; i<nCount; i++ )
{
- pEntry = pRowArray->GetEntry(nRowLevel,i);
+ pEntry = rRowArray.GetEntry(nRowLevel,i);
nStart = pEntry->GetStart();
nEnd = pEntry->GetEnd();
@@ -598,8 +595,8 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord )
HideOutline( nTab, false, nRowLevel, i, false, false );
}
- pDoc->SetDrawPageSize(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.SetDrawPageSize(nTab);
+ rDoc.UpdatePageBreaks( nTab );
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP );
@@ -615,13 +612,13 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord )
bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
bool bRecord, bool bPaint )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
- ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
- ScOutlineEntry* pEntry = pArray->GetEntry( nLevel, nEntry );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
+ ScOutlineArray& rArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
+ ScOutlineEntry* pEntry = rArray.GetEntry( nLevel, nEntry );
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
@@ -630,15 +627,15 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, false );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, false );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
+ rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
@@ -652,20 +649,20 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
for ( i = nStart; i <= nEnd; i++ )
{
if ( bColumns )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, true );
+ rDoc.ShowCol( static_cast<SCCOL>(i), nTab, true );
else
{
// show several rows together, don't show filtered rows
SCROW nFilterEnd = i;
- bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd );
+ bool bFiltered = rDoc.RowFiltered( i, nTab, NULL, &nFilterEnd );
nFilterEnd = std::min( nEnd, nFilterEnd );
if ( !bFiltered )
- pDoc->ShowRows( i, nFilterEnd, nTab, true );
+ rDoc.ShowRows( i, nFilterEnd, nTab, true );
i = nFilterEnd;
}
}
- ScSubOutlineIterator aIter( pArray, nLevel, nEntry );
+ ScSubOutlineIterator aIter( &rArray, nLevel, nEntry );
while ((pEntry=aIter.GetNext()) != NULL)
{
if ( pEntry->IsHidden() )
@@ -674,17 +671,17 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
SCCOLROW nSubEnd = pEntry->GetEnd();
if ( bColumns )
for ( i = nSubStart; i <= nSubEnd; i++ )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
+ rDoc.ShowCol( static_cast<SCCOL>(i), nTab, false );
else
- pDoc->ShowRows( nSubStart, nSubEnd, nTab, false );
+ rDoc.ShowRows( nSubStart, nSubEnd, nTab, false );
}
}
- pArray->SetVisibleBelow( nLevel, nEntry, true, true );
+ rArray.SetVisibleBelow( nLevel, nEntry, true, true );
- pDoc->SetDrawPageSize(nTab);
- pDoc->InvalidatePageBreaks(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.SetDrawPageSize(nTab);
+ rDoc.InvalidatePageBreaks(nTab);
+ rDoc.UpdatePageBreaks( nTab );
if (bPaint)
lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd );
@@ -699,13 +696,13 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
bool bRecord, bool bPaint )
{
- ScDocument* pDoc = rDocShell.GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocument& rDoc = rDocShell.GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
- ScOutlineArray* pArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
- ScOutlineEntry* pEntry = pArray->GetEntry( nLevel, nEntry );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
+ ScOutlineArray& rArray = bColumns ? pTable->GetColArray() : pTable->GetRowArray();
+ ScOutlineEntry* pEntry = rArray.GetEntry( nLevel, nEntry );
SCCOLROW nStart = pEntry->GetStart();
SCCOLROW nEnd = pEntry->GetEnd();
@@ -714,15 +711,15 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if (bColumns)
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, false );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, false );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false,
pUndoDoc );
}
else
{
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true );
- pDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true );
+ rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pUndoDoc );
}
rDocShell.GetUndoManager()->AddUndoAction(
@@ -735,15 +732,15 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel
SCCOLROW i;
if ( bColumns )
for ( i = nStart; i <= nEnd; i++ )
- pDoc->ShowCol( static_cast<SCCOL>(i), nTab, false );
+ rDoc.ShowCol( static_cast<SCCOL>(i), nTab, false );
else
- pDoc->ShowRows( nStart, nEnd, nTab, false );
+ rDoc.ShowRows( nStart, nEnd, nTab, false );
- pArray->SetVisibleBelow( nLevel, nEntry, false );
+ rArray.SetVisibleBelow( nLevel, nEntry, false );
- pDoc->SetDrawPageSize(nTab);
- pDoc->InvalidatePageBreaks(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.SetDrawPageSize(nTab);
+ rDoc.InvalidatePageBreaks(nTab);
+ rDoc.UpdatePageBreaks( nTab );
if (bPaint)
lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd );
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 2cafae98e2ea..416e6359311e 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -33,8 +33,8 @@ static bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const OU
{
if (pDocSh)
{
- ScDocument* pDoc = pDocSh->GetDocument();
- ScRangeName* pNames = pDoc->GetRangeName();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScRangeName* pNames = rDoc.GetRangeName();
if (pNames)
{
const ScRangeData* pData = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(rName));
@@ -78,17 +78,17 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const OUString& rItem ) :
else
{
// parse ref
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = ScDocShell::GetCurTab();
aRange.aStart.SetTab( nTab );
// For DDE link, we always must parse references using OOO A1 convention.
- if ( aRange.Parse( rItem, pDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
+ if ( aRange.Parse( rItem, &rDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
{
// area reference
}
- else if ( aRange.aStart.Parse( rItem, pDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
+ else if ( aRange.aStart.Parse( rItem, &rDoc, FormulaGrammar::CONV_OOO ) & SCA_VALID )
{
// cell reference
aRange.aEnd = aRange.aStart;
@@ -99,8 +99,8 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const OUString& rItem ) :
}
}
- pDocSh->GetDocument()->GetLinkManager()->InsertServer( this );
- pDocSh->GetDocument()->StartListeningArea( aRange, &aForwarder );
+ pDocSh->GetDocument().GetLinkManager()->InsertServer( this );
+ pDocSh->GetDocument().StartListeningArea( aRange, &aForwarder );
StartListening(*pDocSh); // um mitzubekommen, wenn die DocShell geloescht wird
StartListening(*SFX_APP()); // for SC_HINT_AREAS_CHANGED
@@ -118,8 +118,8 @@ void ScServerObject::Clear()
ScDocShell* pTemp = pDocSh;
pDocSh = NULL;
- pTemp->GetDocument()->EndListeningArea( aRange, &aForwarder );
- pTemp->GetDocument()->GetLinkManager()->RemoveServer( this );
+ pTemp->GetDocument().EndListeningArea( aRange, &aForwarder );
+ pTemp->GetDocument().GetLinkManager()->RemoveServer( this );
EndListening(*pTemp);
EndListening(*SFX_APP());
}
@@ -154,18 +154,18 @@ bool ScServerObject::GetData(
// refresh the listeners now (this is called from a timer)
EndListeningAll();
- pDocSh->GetDocument()->StartListeningArea( aRange, &aForwarder );
+ pDocSh->GetDocument().StartListeningArea( aRange, &aForwarder );
StartListening(*pDocSh);
StartListening(*SFX_APP());
bRefreshListener = false;
}
OUString aDdeTextFmt = pDocSh->GetDdeTextFmt();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
if( FORMAT_STRING == SotExchange::GetFormatIdFromMimeType( rMimeType ))
{
- ScImportExport aObj( pDoc, aRange );
+ ScImportExport aObj( &rDoc, aRange );
if( aDdeTextFmt[0] == 'F' )
aObj.SetFormulas( true );
if( aDdeTextFmt.equalsAscii( "SYLK" ) ||
@@ -188,7 +188,7 @@ bool ScServerObject::GetData(
return aObj.ExportData( rMimeType, rData );
}
- ScImportExport aObj( pDoc, aRange );
+ ScImportExport aObj( &rDoc, aRange );
aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );
if( aObj.IsRef() )
return aObj.ExportData( rMimeType, rData );
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index f1af923f6f84..9059a27a67f1 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -89,7 +89,7 @@ ScTableLink::ScTableLink(SfxObjectShell* pShell, const OUString& rFile,
{
pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell );
SetRefreshHandler( LINK( this, ScTableLink, RefreshHdl ) );
- SetRefreshControl( pImpl->m_pDocSh->GetDocument()->GetRefreshTimerControlAddress() );
+ SetRefreshControl( &pImpl->m_pDocSh->GetDocument().GetRefreshTimerControlAddress() );
}
ScTableLink::~ScTableLink()
@@ -98,11 +98,11 @@ ScTableLink::~ScTableLink()
StopRefreshTimer();
OUString aEmpty;
- ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- SCTAB nCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pImpl->m_pDocSh->GetDocument();
+ SCTAB nCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nCount; nTab++)
- if (pDoc->IsLinked(nTab) && aFileName.equals(pDoc->GetLinkDoc(nTab)))
- pDoc->SetLink( nTab, SC_LINK_NONE, aEmpty, aEmpty, aEmpty, aEmpty, 0 );
+ if (rDoc.IsLinked(nTab) && aFileName.equals(rDoc.GetLinkDoc(nTab)))
+ rDoc.SetLink( nTab, SC_LINK_NONE, aEmpty, aEmpty, aEmpty, aEmpty, 0 );
delete pImpl;
}
@@ -123,7 +123,7 @@ void ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
::sfx2::SvBaseLink::UpdateResult ScTableLink::DataChanged(
const OUString&, const ::com::sun::star::uno::Any& )
{
- sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument().GetLinkManager();
if (pLinkManager!=NULL)
{
OUString aFile, aFilter;
@@ -142,8 +142,8 @@ void ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
void ScTableLink::Closed()
{
// Verknuepfung loeschen: Undo
- ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pImpl->m_pDocSh->GetDocument();
+ bool bUndo (rDoc.IsUndoEnabled());
if (bAddUndo && bUndo)
{
@@ -160,7 +160,7 @@ void ScTableLink::Closed()
bool ScTableLink::IsUsed() const
{
- return pImpl->m_pDocSh->GetDocument()->HasLink( aFileName, aFilterName, aOptions );
+ return pImpl->m_pDocSh->GetDocument().HasLink( aFileName, aFilterName, aOptions );
}
bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
@@ -178,10 +178,10 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
if (!pFilter)
return false;
- ScDocument* pDoc = pImpl->m_pDocSh->GetDocument();
- pDoc->SetInLinkUpdate( true );
+ ScDocument& rDoc = pImpl->m_pDocSh->GetDocument();
+ rDoc.SetInLinkUpdate( true );
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
// wenn neuer Filter ausgewaehlt wurde, Optionen vergessen
if (!aFilterName.equals(rNewFilter))
@@ -221,36 +221,36 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
ScDocShellModificator aModificator( *pImpl->m_pDocSh );
bool bNotFound = false;
- ScDocument* pSrcDoc = pSrcShell->GetDocument();
+ ScDocument& rSrcDoc = pSrcShell->GetDocument();
// from text filters that don't set the table name,
// use the one table regardless of link table name
- bool bAutoTab = (pSrcDoc->GetTableCount() == 1) &&
+ bool bAutoTab = (rSrcDoc.GetTableCount() == 1) &&
ScDocShell::HasAutomaticTableName( rNewFilter );
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nCount; nTab++)
{
- sal_uInt8 nMode = pDoc->GetLinkMode(nTab);
- if (nMode && aFileName.equals(pDoc->GetLinkDoc(nTab)))
+ sal_uInt8 nMode = rDoc.GetLinkMode(nTab);
+ if (nMode && aFileName.equals(rDoc.GetLinkDoc(nTab)))
{
- OUString aTabName = pDoc->GetLinkTab(nTab);
+ OUString aTabName = rDoc.GetLinkTab(nTab);
// Undo
if (bAddUndo && bUndo)
{
if (bFirst)
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
else
pUndoDoc->AddUndoTab( nTab, nTab, true, true );
bFirst = false;
ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab);
- pDoc->CopyToDocument(aRange, IDF_ALL, false, pUndoDoc);
- pUndoDoc->TransferDrawPage( pDoc, nTab, nTab );
+ rDoc.CopyToDocument(aRange, IDF_ALL, false, pUndoDoc);
+ pUndoDoc->TransferDrawPage( &rDoc, nTab, nTab );
pUndoDoc->SetLink( nTab, nMode, aFileName, aFilterName,
aOptions, aTabName, GetRefreshDelay() );
- pUndoDoc->SetTabBgColor( nTab, pDoc->GetTabBgColor(nTab) );
+ pUndoDoc->SetTabBgColor( nTab, rDoc.GetTabBgColor(nTab) );
}
// Tabellenname einer ExtDocRef anpassen
@@ -258,11 +258,11 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
if ( bNewUrlName && nMode == SC_LINK_VALUE )
{
OUString aName;
- pDoc->GetName( nTab, aName );
+ rDoc.GetName( nTab, aName );
if ( ScGlobal::GetpTransliteration()->isEqual(
ScGlobal::GetDocTabName( aFileName, aTabName ), aName ) )
{
- pDoc->RenameTab( nTab,
+ rDoc.RenameTab( nTab,
ScGlobal::GetDocTabName( aNewUrl, aTabName ),
false, true ); // kein RefUpdate, kein ValidTabName
}
@@ -274,22 +274,22 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
bool bFound = false;
/* #i71497# check if external document is loaded successfully,
otherwise we may find the empty default sheet "Sheet1" in
- pSrcDoc, even if the document does not exist. */
+ rSrcDoc, even if the document does not exist. */
if( pMed->GetError() == 0 )
{
// no sheet name -> use first sheet
if ( !aTabName.isEmpty() && !bAutoTab )
- bFound = pSrcDoc->GetTable( aTabName, nSrcTab );
+ bFound = rSrcDoc.GetTable( aTabName, nSrcTab );
else
bFound = true;
}
if (bFound)
- pDoc->TransferTab( pSrcDoc, nSrcTab, nTab, false, // nicht neu einfuegen
+ rDoc.TransferTab( &rSrcDoc, nSrcTab, nTab, false, // nicht neu einfuegen
(nMode == SC_LINK_VALUE) ); // nur Werte?
else
{
- pDoc->DeleteAreaTab( 0,0,MAXCOL,MAXROW, nTab, IDF_ALL );
+ rDoc.DeleteAreaTab( 0,0,MAXCOL,MAXROW, nTab, IDF_ALL );
bool bShowError = true;
if ( nMode == SC_LINK_VALUE )
@@ -299,7 +299,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
ScRangeList aErrorCells; // cells on the linked sheets that need error values
- ScCellIterator aIter(pDoc, ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB)); // all sheets
+ ScCellIterator aIter(&rDoc, ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB)); // all sheets
for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
{
if (aIter.getType() != CELLTYPE_FORMULA)
@@ -339,7 +339,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
for (SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
{
ScAddress aDestPos( nCol, nRow, nTab );
- pDoc->SetFormula(aDestPos, aTokenArr);
+ rDoc.SetFormula(aDestPos, aTokenArr);
}
}
@@ -352,11 +352,11 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
{
// Normal link or no references: put error message on sheet.
- pDoc->SetString( 0,0,nTab, ScGlobal::GetRscString(STR_LINKERROR) );
- pDoc->SetString( 0,1,nTab, ScGlobal::GetRscString(STR_LINKERRORFILE) );
- pDoc->SetString( 1,1,nTab, aNewUrl );
- pDoc->SetString( 0,2,nTab, ScGlobal::GetRscString(STR_LINKERRORTAB) );
- pDoc->SetString( 1,2,nTab, aTabName );
+ rDoc.SetString( 0,0,nTab, ScGlobal::GetRscString(STR_LINKERROR) );
+ rDoc.SetString( 0,1,nTab, ScGlobal::GetRscString(STR_LINKERRORFILE) );
+ rDoc.SetString( 1,1,nTab, aNewUrl );
+ rDoc.SetString( 0,2,nTab, ScGlobal::GetRscString(STR_LINKERRORTAB) );
+ rDoc.SetString( 1,2,nTab, aTabName );
}
bNotFound = true;
@@ -365,7 +365,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
if ( bNewUrlName || !aFilterName.equals(rNewFilter) ||
!aOptions.equals(aNewOpt) || pNewOptions ||
nNewRefresh != GetRefreshDelay() )
- pDoc->SetLink( nTab, nMode, aNewUrl, rNewFilter, aNewOpt,
+ rDoc.SetLink( nTab, nMode, aNewUrl, rNewFilter, aNewOpt,
aTabName, nNewRefresh );
}
}
@@ -403,13 +403,13 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
//! Fehler ausgeben ?
}
- pDoc->SetInLinkUpdate( false );
+ rDoc.SetInLinkUpdate( false );
// notify Uno objects (for XRefreshListener)
//! also notify Uno objects if file name was changed!
ScLinkRefreshedHint aHint;
aHint.SetSheetLink( aFileName );
- pDoc->BroadcastUno( aHint );
+ rDoc.BroadcastUno( aHint );
return true;
}
@@ -535,17 +535,14 @@ ScDocumentLoader::ScDocumentLoader( const OUString& rFileName,
pDocShell = new ScDocShell( SFX_CREATE_MODE_INTERNAL );
aRef = pDocShell;
- ScDocument* pDoc = pDocShell->GetDocument();
- if( pDoc )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScExtDocOptions* pExtDocOpt = rDoc.GetExtDocOptions();
+ if( !pExtDocOpt )
{
- ScExtDocOptions* pExtDocOpt = pDoc->GetExtDocOptions();
- if( !pExtDocOpt )
- {
- pExtDocOpt = new ScExtDocOptions;
- pDoc->SetExtDocOptions( pExtDocOpt );
- }
- pExtDocOpt->GetDocSettings().mnLinkCnt = nRekCnt;
+ pExtDocOpt = new ScExtDocOptions;
+ rDoc.SetExtDocOptions( pExtDocOpt );
}
+ pExtDocOpt->GetDocSettings().mnLinkCnt = nRekCnt;
pDocShell->DoLoad( pMedium );
@@ -577,7 +574,7 @@ void ScDocumentLoader::ReleaseDocRef()
ScDocument* ScDocumentLoader::GetDocument()
{
- return pDocShell ? pDocShell->GetDocument() : 0;
+ return pDocShell ? &pDocShell->GetDocument() : 0;
}
bool ScDocumentLoader::IsError() const
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 10644e41548e..62417f593359 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -537,7 +537,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
}
// ChartListenerCollectionNeedsUpdate is needed for Navigator update
- pDocSh->GetDocument()->SetChartListenerCollectionNeedsUpdate( true );
+ pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true );
pDocSh->SetDrawModified();
}
}
@@ -574,7 +574,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
pSelected->SetDescription(aDescription);
// ChartListenerCollectionNeedsUpdate is needed for Navigator update
- pDocSh->GetDocument()->SetChartListenerCollectionNeedsUpdate( true );
+ pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true );
pDocSh->SetDrawModified();
}
}
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index bcb26657dd24..2aff287c54b2 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -71,9 +71,9 @@ sal_uInt8 FuConstruct::Command(const CommandEvent& rCEvt)
Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos )
{
Point aRetGridOff;
- ScViewData* pViewData = pViewShell->GetViewData();
- ScDocument* pDoc = pViewData ? pViewData->GetDocument() : NULL;
- if ( pViewData && pDoc )
+ ScViewData& rViewData = pViewShell->GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ if ( pDoc )
{
// rInOutPos mightn't be where you think it is if there is zoom
// involved. Lets calculate where aPos would be at 100% zoom
@@ -86,10 +86,10 @@ Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos )
Point aOldPos( pDoc->GetColOffset( aOldStt.Col(), aOldStt.Tab() ), pDoc->GetRowOffset( aOldStt.Row(), aOldStt.Tab() ) );
aOldPos.X() = sc::TwipsToHMM( aOldPos.X() );
aOldPos.Y() = sc::TwipsToHMM( aOldPos.Y() );
- ScSplitPos eWhich = pViewData->GetActivePart();
- ScGridWindow* pGridWin = (ScGridWindow*)pViewData->GetActiveWin();
+ ScSplitPos eWhich = rViewData.GetActivePart();
+ ScGridWindow* pGridWin = (ScGridWindow*)rViewData.GetActiveWin();
// and equiv screen pos
- Point aScreenPos = pViewShell->GetViewData()->GetScrPos( aOldStt.Col(), aOldStt.Row(), eWhich, true );
+ Point aScreenPos = pViewShell->GetViewData().GetScrPos( aOldStt.Col(), aOldStt.Row(), eWhich, true );
MapMode aDrawMode = pGridWin->GetDrawMapMode();
Point aCurPosHmm = pGridWin->PixelToLogic(aScreenPos, aDrawMode );
Point aOff = ( rInOutPos - aCurPosHmm );
@@ -237,11 +237,11 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
bool bVertical = ( pOPO && pOPO->IsVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
- pViewShell->GetViewData()->GetDispatcher().
+ pViewShell->GetViewData().GetDispatcher().
Execute(nTextSlotId, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
// jetzt den erzeugten FuText holen und in den EditModus setzen
- FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // hat keine RTTI
{
FuText* pText = (FuText*)pPoor;
@@ -288,7 +288,7 @@ bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
{
pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
- SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
+ SfxDispatcher& rDisp = pViewShell->GetViewData().GetDispatcher();
if ( pView->AreObjectsMarked() )
rDisp.Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
else
@@ -323,7 +323,7 @@ bool FuConstruct::KeyInput(const KeyEvent& rKEvt)
}
else // Zeichenmodus beenden
{
- pViewShell->GetViewData()->GetDispatcher().
+ pViewShell->GetViewData().GetDispatcher().
Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
break;
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index ddeb4a691aa3..59a9a5e1ab6b 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -107,8 +107,8 @@ void FuDraw::ResetModifiers()
if (!pView)
return;
- ScViewData* pViewData = pViewShell->GetViewData();
- const ScViewOptions& rOpt = pViewData->GetOptions();
+ ScViewData& rViewData = pViewShell->GetViewData();
+ const ScViewOptions& rOpt = rViewData.GetOptions();
const ScGridOptions& rGrid = rOpt.GetGridOptions();
bool bGridOpt = rGrid.GetUseGridSnap();
@@ -196,15 +196,15 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
// don't switch shells if text shell is already active
- FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( !pPoor || pPoor->GetSlotID() != nTextSlotId )
{
- pViewShell->GetViewData()->GetDispatcher().
+ pViewShell->GetViewData().GetDispatcher().
Execute(nTextSlotId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD);
}
// get the resulting FuText and set in edit mode
- pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // no RTTI
{
FuText* pText = (FuText*)pPoor;
@@ -219,7 +219,7 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const
bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
bool bReturn = false;
- ScViewData& rViewData = *pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
switch ( rKEvt.GetKeyCode().GetCode() )
{
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 096219e379e3..1c44ded93288 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -147,8 +147,8 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
SdrPage* pPage = pPV->GetPage();
Point aInsertPos = pViewSh->GetInsertPos();
- ScViewData* pData = pViewSh->GetViewData();
- if ( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
+ ScViewData& rData = pViewSh->GetViewData();
+ if ( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
aInsertPos.X() -= aLogicSize.Width(); // move position to left edge
ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetSize() );
@@ -182,7 +182,7 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
{
SdrPageView* pPV = pView->GetSdrPageView();
SdrPage* pPage = pPV->GetPage();
- ScViewData* pData = pViewSh->GetViewData();
+ ScViewData& rData = pViewSh->GetViewData();
Point aInsertPos( pViewSh->GetInsertPos() );
Size aSize;
@@ -198,7 +198,7 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
ScLimitSizeOnDrawPage( aSize, aInsertPos, pPage->GetSize() );
- if( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
+ if( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
aInsertPos.X() -= aSize.Width();
OUString realURL;
@@ -209,14 +209,14 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
else
{
uno::Reference<frame::XModel> const xModel(
- pData->GetDocument()->GetDocumentShell()->GetModel());
+ rData.GetDocument()->GetDocumentShell()->GetModel());
bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL);
if (!bRet) { return; }
}
SdrMediaObj* pObj = new SdrMediaObj( Rectangle( aInsertPos, aSize ) );
- pObj->SetModel(pData->GetDocument()->GetDrawLayer()); // set before setURL
+ pObj->SetModel(rData.GetDocument()->GetDrawLayer()); // set before setURL
pObj->setURL( realURL, ""/*TODO?*/ );
pView->InsertObjectAtView( pObj, *pPV, bApi ? SDRINSERT_DONTMARK : 0 );
}
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index f92797c23ab8..f91725ff81f1 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -87,7 +87,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
const OUString& rRangeParam )
{
ScDocShell* pDocShell = pViewData->GetDocShell();
- ScDocument* pScDoc = pDocShell->GetDocument();
+ ScDocument& rScDoc = pDocShell->GetDocument();
OUString aRangeString( rRangeParam );
if ( aRangeString.isEmpty() )
@@ -113,7 +113,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
pDoc->LimitChartArea( nTab1, nCol1,nRow1, nCol2,nRow2 );
ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
- aRangeString = aRange.Format(SCR_ABS_3D, pScDoc);
+ aRangeString = aRange.Format(SCR_ABS_3D, &rScDoc);
}
}
}
@@ -129,7 +129,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
OSL_ASSERT( xReceiver.is());
if( xReceiver.is() )
{
- uno::Reference< chart2::data::XDataProvider > xDataProvider = new ScChart2DataProvider( pScDoc );
+ uno::Reference< chart2::data::XDataProvider > xDataProvider = new ScChart2DataProvider( &rScDoc );
xReceiver->attachDataProvider( xDataProvider );
uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pDocShell->GetModel(), uno::UNO_QUERY );
@@ -142,17 +142,17 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
// use ScChartPositioner to auto-detect column/row headers (like ScChartArray in old version)
ScRangeListRef aRangeListRef( new ScRangeList );
- aRangeListRef->Parse( aRangeString, pScDoc, SCA_VALID, pScDoc->GetAddressConvention() );
+ aRangeListRef->Parse( aRangeString, &rScDoc, SCA_VALID, rScDoc.GetAddressConvention() );
if ( !aRangeListRef->empty() )
{
- pScDoc->LimitChartIfAll( aRangeListRef ); // limit whole columns/rows to used area
+ rScDoc.LimitChartIfAll( aRangeListRef ); // limit whole columns/rows to used area
// update string from modified ranges. The ranges must be in the current formula syntax.
OUString aTmpStr;
- aRangeListRef->Format( aTmpStr, SCR_ABS_3D, pScDoc, pScDoc->GetAddressConvention() );
+ aRangeListRef->Format( aTmpStr, SCR_ABS_3D, &rScDoc, rScDoc.GetAddressConvention() );
aRangeString = aTmpStr;
- ScChartPositioner aChartPositioner( pScDoc, aRangeListRef );
+ ScChartPositioner aChartPositioner( &rScDoc, aRangeListRef );
const ScChartPositionMap* pPositionMap( aChartPositioner.GetPositionMap() );
if( pPositionMap )
{
@@ -356,12 +356,12 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
// Chart initialisieren ?
if ( SvtModuleOptions().IsChart() && SotExchange::IsChart( SvGlobalName( xObj->getClassID() ) ) )
- lcl_ChartInit( xObj, pViewSh->GetViewData(), OUString() );
+ lcl_ChartInit( xObj, &pViewSh->GetViewData(), OUString() );
- ScViewData* pData = pViewSh->GetViewData();
+ ScViewData& rData = pViewSh->GetViewData();
Point aPnt = pViewSh->GetInsertPos();
- if ( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
+ if ( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
aPnt.X() -= aSize.Width(); // move position to left edge
Rectangle aRect (aPnt, aSize);
SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
@@ -443,21 +443,21 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
// get range
OUString aRangeString;
ScRange aPositionRange; // cell range for chart positioning
- ScMarkData aMark = pViewSh->GetViewData()->GetMarkData();
+ ScMarkData aMark = pViewSh->GetViewData().GetMarkData();
if( pReqArgs )
{
const SfxPoolItem* pItem;
if( pReqArgs->HasItem( FN_PARAM_5, &pItem ) )
aRangeString = OUString( ((const SfxStringItem*)pItem)->GetValue());
- aPositionRange = pViewSh->GetViewData()->GetCurPos();
+ aPositionRange = pViewSh->GetViewData().GetCurPos();
}
else
{
bool bAutomaticMark = false;
if ( !aMark.IsMarked() && !aMark.IsMultiMarked() )
{
- pViewSh->GetViewData()->GetView()->MarkDataArea( true );
+ pViewSh->GetViewData().GetView()->MarkDataArea( true );
bAutomaticMark = true;
}
@@ -467,7 +467,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
ScRangeList aRanges;
aMultiMark.FillRangeListWithMarks( &aRanges, false );
OUString aStr;
- ScDocument* pDocument = pViewSh->GetViewData()->GetDocument();
+ ScDocument* pDocument = pViewSh->GetViewData().GetDocument();
aRanges.Format( aStr, SCR_ABS_3D, pDocument, pDocument->GetAddressConvention() );
aRangeString = aStr;
@@ -482,7 +482,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
}
if(bAutomaticMark)
- pViewSh->GetViewData()->GetView()->Unmark();
+ pViewSh->GetViewData().GetView()->Unmark();
}
@@ -540,12 +540,12 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
xObj->setVisualAreaSize( nAspect, aSz );
}
- ScViewData* pData = pViewSh->GetViewData();
- ScDocShell* pScDocSh = pData->GetDocShell();
- ScDocument* pScDoc = pScDocSh->GetDocument();
- bool bUndo (pScDoc->IsUndoEnabled());
+ ScViewData& rData = pViewSh->GetViewData();
+ ScDocShell* pScDocSh = rData.GetDocShell();
+ ScDocument& rScDoc = pScDocSh->GetDocument();
+ bool bUndo (rScDoc.IsUndoEnabled());
- Window* pParentWindow = pData->GetActiveWin();
+ Window* pParentWindow = rData.GetActiveWin();
OpenGLWindow* pChildWindow = new OpenGLWindow(pParentWindow);
Size aWindowSize = pChildWindow->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) );
pChildWindow->SetSizePixel(aWindowSize);
@@ -576,9 +576,9 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
// -> wenn gesetzt, neue Tabelle, sonst aktuelle Tabelle
if ( ((const SfxBoolItem*)pItem)->GetValue() )
- nToTable = static_cast<sal_uInt16>(pScDoc->GetTableCount());
+ nToTable = static_cast<sal_uInt16>(rScDoc.GetTableCount());
else
- nToTable = static_cast<sal_uInt16>(pData->GetTabNo());
+ nToTable = static_cast<sal_uInt16>(rData.GetTabNo());
}
}
else
@@ -589,15 +589,15 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
}
// auf neue Tabelle ausgeben?
- if ( nToTable == pScDoc->GetTableCount() )
+ if ( nToTable == rScDoc.GetTableCount() )
{
// dann los...
OUString aTabName;
- SCTAB nNewTab = pScDoc->GetTableCount();
+ SCTAB nNewTab = rScDoc.GetTableCount();
- pScDoc->CreateValidTabName( aTabName );
+ rScDoc.CreateValidTabName( aTabName );
- if ( pScDoc->InsertTab( nNewTab, aTabName ) )
+ if ( rScDoc.InsertTab( nNewTab, aTabName ) )
{
bool bAppend = true;
@@ -617,13 +617,13 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
OSL_FAIL( "Could not create new table :-/" );
}
}
- else if ( nToTable != pData->GetTabNo() )
+ else if ( nToTable != rData.GetTabNo() )
{
pViewSh->SetTabNo( nToTable, true );
}
}
- lcl_ChartInit( xObj, pData, aRangeString ); // set source range, auto-detect column/row headers
+ lcl_ChartInit( xObj, &rData, aRangeString ); // set source range, auto-detect column/row headers
// Objekt-Position
@@ -760,7 +760,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
// reset marked cell area
- pViewSh->GetViewData()->GetViewShell()->SetMarkData(aMark);
+ pViewSh->GetViewData().GetViewShell()->SetMarkData(aMark);
}
else
{
@@ -812,7 +812,7 @@ FuInsertChartFromFile::FuInsertChartFromFile( ScTabViewShell* pViewSh, Window* p
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
Size aSize( aSz.Width, aSz.Height );
- ScRange aPositionRange = pViewSh->GetViewData()->GetCurPos();
+ ScRange aPositionRange = pViewSh->GetViewData().GetCurPos();
Point aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
Rectangle aRect (aStart, aSize);
SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index cade7aec847a..07ce80ef9831 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -97,18 +97,18 @@ void FuPoor::ForceScroll(const Point& aPixPos)
if ( aPixPos.Y() <= 0 ) dy = -1;
if ( aPixPos.Y() >= aSize.Height() ) dy = 1;
- ScViewData* pViewData = pViewShell->GetViewData();
- if ( pViewData->GetDocument()->IsNegativePage( pViewData->GetTabNo() ) )
+ ScViewData& rViewData = pViewShell->GetViewData();
+ if ( rViewData.GetDocument()->IsNegativePage( rViewData.GetTabNo() ) )
dx = -dx;
- ScSplitPos eWhich = pViewData->GetActivePart();
- if ( dx > 0 && pViewData->GetHSplitMode() == SC_SPLIT_FIX && WhichH(eWhich) == SC_SPLIT_LEFT )
+ ScSplitPos eWhich = rViewData.GetActivePart();
+ if ( dx > 0 && rViewData.GetHSplitMode() == SC_SPLIT_FIX && WhichH(eWhich) == SC_SPLIT_LEFT )
{
pViewShell->ActivatePart( ( eWhich == SC_SPLIT_TOPLEFT ) ?
SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT );
dx = 0;
}
- if ( dy > 0 && pViewData->GetVSplitMode() == SC_SPLIT_FIX && WhichV(eWhich) == SC_SPLIT_TOP )
+ if ( dy > 0 && rViewData.GetVSplitMode() == SC_SPLIT_FIX && WhichV(eWhich) == SC_SPLIT_TOP )
{
pViewShell->ActivatePart( ( eWhich == SC_SPLIT_TOPLEFT ) ?
SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT );
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 402cb4ac1331..904ef4e301fb 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -216,7 +216,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
new uno::Sequence< uno::Any >(0);
pObjSh->CallXScript( pInfo->GetMacro(),
*pInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller );
- pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
+ pViewShell->FakeButtonUp( pViewShell->GetViewData().GetActivePart() );
return true; // kein CaptureMouse etc.
}
}
@@ -250,7 +250,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if ( !sURL.isEmpty() )
{
ScGlobal::OpenURL( sURL, sTarget );
- pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
+ pViewShell->FakeButtonUp( pViewShell->GetViewData().GetActivePart() );
return true; // kein CaptureMouse etc.
}
@@ -388,7 +388,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
bool bCopy = false;
- ScViewData* pViewData = ( pViewShell ? pViewShell->GetViewData() : NULL );
+ ScViewData* pViewData = ( pViewShell ? &pViewShell->GetViewData() : NULL );
ScDocument* pDocument = ( pViewData ? pViewData->GetDocument() : NULL );
SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : NULL );
SdrPage* pPage = ( pPageView ? pPageView->GetPage() : NULL );
@@ -448,7 +448,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{
SdrMark* pMark = rMarkList.GetMark(0);
pObj = pMark->GetMarkedSdrObj();
- FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
FuText* pText = static_cast<FuText*>(pPoor);
pText->StopDragMode(pObj );
}
@@ -545,11 +545,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
bool bVertical = ( pOPO && pOPO->IsVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
- pViewShell->GetViewData()->GetDispatcher().
+ pViewShell->GetViewData().GetDispatcher().
Execute(nTextSlotId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD);
// jetzt den erzeugten FuText holen und in den EditModus setzen
- FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // hat keine RTTI
{
FuText* pText = (FuText*)pPoor;
@@ -581,7 +581,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// darum hier die harte IsLeft-Abfrage
if ( !bReturn && rMEvt.IsLeft() )
if (pViewShell->IsDrawSelMode())
- pViewShell->GetViewData()->GetDispatcher().
+ pViewShell->GetViewData().GetDispatcher().
Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
if ( bCopy && pViewData && pDocument && pPage )
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index 6b3a5157804e..75efe90b36ab 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -62,20 +62,20 @@ bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
Size(pView->GetHitTolerancePixel(),0)).Width();
if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, 0, false))
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos ePos = pViewShell->FindWindow( pWindow );
Point aLineStart = pObject->GetPoint(0);
Point aLineEnd = pObject->GetPoint(1);
Point aPixel = pWindow->LogicToPixel( aLineStart );
SCsCOL nStartCol;
SCsROW nStartRow;
- pViewData->GetPosFromPixel( aPixel.X(), aPixel.Y(), ePos, nStartCol, nStartRow );
+ rViewData.GetPosFromPixel( aPixel.X(), aPixel.Y(), ePos, nStartCol, nStartRow );
aPixel = pWindow->LogicToPixel( aLineEnd );
SCsCOL nEndCol;
SCsROW nEndRow;
- pViewData->GetPosFromPixel( aPixel.X(), aPixel.Y(), ePos, nEndCol, nEndRow );
- SCsCOL nCurX = (SCsCOL) pViewData->GetCurX();
- SCsROW nCurY = (SCsROW) pViewData->GetCurY();
+ rViewData.GetPosFromPixel( aPixel.X(), aPixel.Y(), ePos, nEndCol, nEndRow );
+ SCsCOL nCurX = (SCsCOL) rViewData.GetCurX();
+ SCsROW nCurY = (SCsROW) rViewData.GetCurY();
bool bStart = ( Diff( rPos,aLineStart ) > Diff( rPos,aLineEnd ) );
if ( nCurX == nStartCol && nCurY == nStartRow )
bStart = false;
@@ -124,7 +124,7 @@ bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const
SdrPageView* pPageView = pView ? pView->GetSdrPageView() : 0;
if( pPageView )
{
- const ScViewData& rViewData = *pViewShell->GetViewData();
+ const ScViewData& rViewData = pViewShell->GetViewData();
ScDocument& rDoc = *rViewData.GetDocument();
SCTAB nTab = rViewData.GetTabNo();
ScDocShell* pDocSh = rViewData.GetDocShell();
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index c0822fa1b023..8afd5210c215 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -309,7 +309,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
// Notizen editieren -> keine neuen Textobjekte erzeugen,
// stattdessen Textmodus verlassen
- pViewShell->GetViewData()->GetDispatcher().
+ pViewShell->GetViewData().GetDispatcher().
Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
else
@@ -332,7 +332,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
else if (pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_BEFOREMARK))
{
pView->UnmarkAllObj();
- ScViewData& rViewData = *pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
pView->MarkObj(pObj,pPV,false,false);
@@ -357,7 +357,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
if (!bStraightEnter)
{
pView->UnmarkAll();
- ScViewData& rViewData = *pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
@@ -442,7 +442,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
SdrMark* pMark = rMarkList.GetMark(0);
SdrObject* pObj = pMark->GetMarkedSdrObj();
- FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr();
FuText* pText = static_cast<FuText*>(pPoor);
pText->StopDragMode(pObj );
}
@@ -512,7 +512,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
- SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
+ SfxDispatcher& rDisp = pViewShell->GetViewData().GetDispatcher();
if ( pView->AreObjectsMarked() )
rDisp.Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
else
@@ -532,7 +532,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
- SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
+ SfxDispatcher& rDisp = pViewShell->GetViewData().GetDispatcher();
if ( pView->AreObjectsMarked() )
rDisp.Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
else
diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx
index 86e5c515f8e6..4e0e9368e43e 100644
--- a/sc/source/ui/drawfunc/futext2.cxx
+++ b/sc/source/ui/drawfunc/futext2.cxx
@@ -26,10 +26,10 @@
SdrOutliner* FuText::MakeOutliner()
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
SdrOutliner* pOutl = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, pDrDoc);
- pViewData->UpdateOutlinerFlags(*pOutl);
+ rViewData.UpdateOutlinerFlags(*pOutl);
// Die EditEngine benutzt beim RTF Export (Clipboard / Drag&Drop)
// den MapMode des RefDevices, um die Fontgroesse zu setzen
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 29112e429ff4..884d89fbf965 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -60,7 +60,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/)
if ( pObject->GetLayer() == SC_LAYER_INTERN )
pView->LockInternalLayer();
- ScViewData& rViewData = *pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScDocument& rDoc = *rViewData.GetDocument();
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
OSL_ENSURE( pDrawLayer && (pDrawLayer == pDrDoc), "FuText::StopEditMode - missing or different drawing layers" );
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 5ff5a5471736..3dbe12584259 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -449,7 +449,7 @@ bool ScFormulaDlg::IsDocAllowed(SfxObjectShell* pDocSh) const
{
// not allowed: different from this doc, and no name
// pDocSh is always a ScDocShell
- if ( pDocSh && ((ScDocShell*)pDocSh)->GetDocument() != pDoc && !pDocSh->HasName() )
+ if ( pDocSh && &((ScDocShell*)pDocSh)->GetDocument() != pDoc && !pDocSh->HasName() )
return false;
return true; // everything else is allowed
@@ -579,15 +579,15 @@ void ScFormulaDlg::switchBack()
ScTabViewShell* pScViewShell = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
if ( pScViewShell )
{
- ScViewData* pVD=pScViewShell->GetViewData();
+ ScViewData& rVD=pScViewShell->GetViewData();
SCTAB nExecTab = aCursorPos.Tab();
- if ( nExecTab != pVD->GetTabNo() )
+ if ( nExecTab != rVD.GetTabNo() )
pScViewShell->SetTabNo( nExecTab );
SCROW nRow=aCursorPos.Row();
SCCOL nCol=aCursorPos.Col();
- if(pVD->GetCurX()!=nCol || pVD->GetCurY()!=nRow)
+ if(rVD.GetCurX()!=nCol || rVD.GetCurY()!=nRow)
pScViewShell->SetCursor(nCol,nRow);
}
}
diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx
index 30ce8f61a292..95bae7849df9 100644
--- a/sc/source/ui/inc/consdlg.hxx
+++ b/sc/source/ui/inc/consdlg.hxx
@@ -77,7 +77,7 @@ private:
OUString aStrUndefined;
ScConsolidateParam theConsData;
- ScViewData* pViewData;
+ ScViewData& rViewData;
ScDocument* pDoc;
ScRangeUtil* pRangeUtil;
ScAreaData* pAreaData;
diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx
index d7320ecefe04..6450bb579d2b 100644
--- a/sc/source/ui/inc/datastream.hxx
+++ b/sc/source/ui/inc/datastream.hxx
@@ -105,7 +105,6 @@ private:
private:
ScDocShell* mpDocShell;
- ScDocument* mpDoc;
DocumentStreamAccess maDocAccess;
OUString msURL;
sal_Int32 mnLimit;
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 16d84bb09852..2f8c1ee40870 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -239,7 +239,7 @@ public:
void GetDocStat( ScDocStat& rDocStat );
- ScDocument* GetDocument() { return &aDocument; }
+ ScDocument& GetDocument() { return aDocument; }
ScDocFunc& GetDocFunc() { return *pDocFunc; }
void SetDocFunc( ScDocFunc *pDF ) { pDocFunc = pDF; }
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index db7e199cda6a..769bb1998292 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -159,7 +159,7 @@ private:
OUString maConditionError;
ScDocShell* mpDocShell;
- ScDocument* mpDoc;
+ ScDocument& mrDoc;
const SCTAB mnCurTab;
formula::RefEdit* mpEdActive;
bool mbDlgLostFocus;
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 7c6d7a8f7f44..a28c2f18f4a2 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -120,7 +120,7 @@ public:
bool HasAccessibilityObjects();
const ScPreviewLocationData& GetLocationData();
- ScDocument* GetDocument();
+ ScDocument& GetDocument();
SC_DLLPUBLIC ScPreview* GetPreview() { return pPreview; }
};
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 698087d38d4d..b44db7012d11 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -287,10 +287,10 @@ public:
void DrawMarkRect( const Rectangle& rRect );
- ScViewData* GetViewData() { return &aViewData; }
- const ScViewData* GetViewData() const { return &aViewData; }
+ ScViewData& GetViewData() { return aViewData; }
+ const ScViewData& GetViewData() const { return aViewData; }
- ScViewFunctionSet* GetFunctionSet() { return &aFunctionSet; }
+ ScViewFunctionSet& GetFunctionSet() { return aFunctionSet; }
ScViewSelectionEngine* GetSelEngine() { return pSelEngine; }
bool SelMouseButtonDown( const MouseEvent& rMEvt );
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index e11cd1b247fb..7e9a2f40ba29 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -290,8 +290,8 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit, formula::R
pViewShell->ActiveGrabFocus();
if( pRefEdit )
{
- const ScViewData* pViewData = pViewShell->GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ const ScViewData& rViewData = pViewShell->GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
ScRangeList aRangeList;
if( ParseWithNames( aRangeList, pRefEdit->GetText(), pDoc ) )
{
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index a4d8207e24f0..433d1946a306 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -39,13 +39,13 @@ ScDataFormDlg::ScDataFormDlg(Window* pParent, ScTabViewShell* pTabViewShellOri)
//read header form current document, and add new controls
OSL_ENSURE( pTabViewShell, "pTabViewShell is NULL! :-/" );
- ScViewData* pViewData = pTabViewShell->GetViewData();
+ ScViewData& rViewData = pTabViewShell->GetViewData();
- pDoc = pViewData->GetDocument();
+ pDoc = rViewData.GetDocument();
if (pDoc)
{
ScRange aRange;
- pViewData->GetSimpleArea( aRange );
+ rViewData.GetSimpleArea( aRange );
ScAddress aStart = aRange.aStart;
ScAddress aEnd = aRange.aEnd;
@@ -54,7 +54,7 @@ ScDataFormDlg::ScDataFormDlg(Window* pParent, ScTabViewShell* pTabViewShellOri)
nStartRow = aStart.Row();
nEndRow = aEnd.Row();
- nTab = pViewData->GetTabNo();
+ nTab = rViewData.GetTabNo();
//if there is no selection
if ((nStartCol == nEndCol) && (nStartRow == nEndRow))
bNoSelection = true;
@@ -241,8 +241,8 @@ IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit)
IMPL_LINK_NOARG(ScDataFormDlg, Impl_NewHdl)
{
- ScViewData* pViewData = pTabViewShell->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = pTabViewShell->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
if ( pDoc )
{
bool bHasData = false;
@@ -310,8 +310,8 @@ IMPL_LINK_NOARG(ScDataFormDlg, Impl_RestoreHdl)
IMPL_LINK_NOARG(ScDataFormDlg, Impl_DeleteHdl)
{
- ScViewData* pViewData = pTabViewShell->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = pTabViewShell->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
if (pDoc)
{
ScRange aRange(nStartCol, nCurrentRow, nTab, nEndCol, nCurrentRow, nTab);
diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx
index 2b6f023ff9c7..5dc52bde35a8 100644
--- a/sc/source/ui/miscdlgs/datastreamdlg.cxx
+++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx
@@ -98,9 +98,9 @@ void DataStreamDlg::UpdateEnable()
ScRange DataStreamDlg::GetStartRange()
{
OUString aStr = m_pEdRange->GetText();
- ScDocument* pDoc = mpDocShell->GetDocument();
+ ScDocument& rDoc = mpDocShell->GetDocument();
ScRange aRange;
- sal_uInt16 nRes = aRange.Parse(aStr, pDoc, pDoc->GetAddressConvention());
+ sal_uInt16 nRes = aRange.Parse(aStr, &rDoc, rDoc.GetAddressConvention());
if ((nRes & SCA_VALID) != SCA_VALID || !aRange.IsValid())
{
// Invalid range.
@@ -118,12 +118,12 @@ ScRange DataStreamDlg::GetStartRange()
void DataStreamDlg::Init( const DataStream& rStrm )
{
m_pCbUrl->SetText(rStrm.GetURL());
- ScDocument* pDoc = mpDocShell->GetDocument();
+ ScDocument& rDoc = mpDocShell->GetDocument();
ScRange aRange = rStrm.GetRange();
ScRange aTopRange = aRange;
aTopRange.aEnd.SetRow(aTopRange.aStart.Row());
- OUString aStr = aTopRange.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention());
+ OUString aStr = aTopRange.Format(SCR_ABS_3D, &rDoc, rDoc.GetAddressConvention());
m_pEdRange->SetText(aStr);
SCROW nRows = aRange.aEnd.Row() - aRange.aStart.Row() + 1;
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 51d292d6ba26..22e2c47d82b8 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -336,7 +336,7 @@ IMPL_LINK( ScInsertTableDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
if ( !pDocShTables->GetError() ) // nur Errors
{
- FillTables_Impl( pDocShTables->GetDocument() );
+ FillTables_Impl( &pDocShTables->GetDocument() );
m_pFtPath->SetText( pDocShTables->GetTitle( SFX_TITLE_FULLNAME ) );
}
else
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 2fb4a91ab9f4..8d413077173d 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -266,7 +266,7 @@ void ScLinkedAreaDlg::UpdateSourceRanges()
m_pLbRanges->Clear();
if ( pSourceShell )
{
- ScAreaNameIterator aIter( pSourceShell->GetDocument() );
+ ScAreaNameIterator aIter( &pSourceShell->GetDocument() );
ScRange aDummy;
OUString aName;
while ( aIter.Next( aName, aDummy ) )
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 9d57e0574323..46311bdb201b 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -243,7 +243,7 @@ void ScMoveTableDlg::InitDocListBox()
}
pLbDoc->InsertEntry( aEntryName, i );
- pLbDoc->SetEntryData( i, (void*)pScSh->GetDocument() );
+ pLbDoc->SetEntryData( i, (void*)&pScSh->GetDocument() );
i++;
}
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index a72a0fe6bf5b..7844e5ef49d1 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -155,7 +155,7 @@ ScOptSolverDlg::ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
, maConditionError(ScGlobal::GetRscString(STR_INVALIDCONDITION))
, mpDocShell(pDocSh)
- , mpDoc(pDocSh->GetDocument())
+ , mrDoc(pDocSh->GetDocument())
, mnCurTab(aCursorPos.Tab())
, mpEdActive(NULL)
, mbDlgLostFocus(false)
@@ -366,8 +366,8 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
{
m_pRbMax->Check();
OUString aCursorStr;
- if ( !mpDoc->GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) )
- aCursorStr = rCursorPos.Format(SCA_ABS, NULL, mpDoc->GetAddressConvention());
+ if ( !mrDoc.GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) )
+ aCursorStr = rCursorPos.Format(SCA_ABS, NULL, mrDoc.GetAddressConvention());
m_pEdObjectiveCell->SetRefString( aCursorStr );
if ( nImplCount > 0 )
maEngine = maImplNames[0]; // use first implementation
@@ -735,8 +735,8 @@ void ScOptSolverDlg::ShowError( bool bCondition, formula::RefEdit* pFocus )
bool ScOptSolverDlg::ParseRef( ScRange& rRange, const OUString& rInput, bool bAllowRange )
{
ScRangeUtil aRangeUtil;
- ScAddress::Details aDetails(mpDoc->GetAddressConvention(), 0, 0);
- sal_uInt16 nFlags = rRange.ParseAny( rInput, mpDoc, aDetails );
+ ScAddress::Details aDetails(mrDoc.GetAddressConvention(), 0, 0);
+ sal_uInt16 nFlags = rRange.ParseAny( rInput, &mrDoc, aDetails );
if ( nFlags & SCA_VALID )
{
if ( (nFlags & SCA_TAB_3D) == 0 )
@@ -745,7 +745,7 @@ bool ScOptSolverDlg::ParseRef( ScRange& rRange, const OUString& rInput, bool bAl
rRange.aEnd.SetTab( rRange.aStart.Tab() );
return ( bAllowRange || rRange.aStart == rRange.aEnd );
}
- else if ( aRangeUtil.MakeRangeFromName( rInput, mpDoc, mnCurTab, rRange, RUTL_NAMES, aDetails ) )
+ else if ( aRangeUtil.MakeRangeFromName( rInput, &mrDoc, mnCurTab, rRange, RUTL_NAMES, aDetails ) )
return ( bAllowRange || rRange.aStart == rRange.aEnd );
return false; // not recognized
@@ -800,7 +800,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
// "changing cells" can be several ranges
ScRangeList aVarRanges;
- if ( !ParseWithNames( aVarRanges, m_pEdVariableCells->GetText(), mpDoc ) )
+ if ( !ParseWithNames( aVarRanges, m_pEdVariableCells->GetText(), &mrDoc ) )
{
ShowError( false, m_pEdVariableCells );
return false;
@@ -863,7 +863,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
sal_uInt32 nFormat = 0; //! explicit language?
double fValue = 0.0;
- if ( mpDoc->GetFormatTable()->IsNumberFormat( aConstrIter->aRightStr, nFormat, fValue ) )
+ if ( mrDoc.GetFormatTable()->IsNumberFormat( aConstrIter->aRightStr, nFormat, fValue ) )
aConstraint.Right <<= fValue;
else if ( aConstraint.Operator != sheet::SolverConstraintOperator_INTEGER &&
aConstraint.Operator != sheet::SolverConstraintOperator_BINARY )
@@ -911,7 +911,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
sal_uInt32 nFormat = 0; //! explicit language?
double fValue = 0.0;
- if ( mpDoc->GetFormatTable()->IsNumberFormat( aValStr, nFormat, fValue ) )
+ if ( mrDoc.GetFormatTable()->IsNumberFormat( aValStr, nFormat, fValue ) )
aConstraint.Right <<= fValue;
else
{
@@ -933,7 +933,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
ScAddress aCellPos;
ScUnoConversion::FillScAddress( aCellPos, aVariables[nVarPos] );
- aOldValues[nVarPos] = mpDoc->GetValue( aCellPos );
+ aOldValues[nVarPos] = mrDoc.GetValue( aCellPos );
}
// create and initialize solver
@@ -993,7 +993,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
//! else error?
// take formatted result from document (result value from component is ignored)
- OUString aResultStr = mpDoc->GetString(
+ OUString aResultStr = mrDoc.GetString(
static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row),
static_cast<SCTAB>(aObjective.Sheet));
diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx
index 89e37f823d2d..2a69e4ba013a 100644
--- a/sc/source/ui/miscdlgs/redcom.cxx
+++ b/sc/source/ui/miscdlgs/redcom.cxx
@@ -58,8 +58,8 @@ ScChangeAction *ScRedComDialog::FindPrev(ScChangeAction *pAction)
{
if(pAction!=NULL && pDocShell !=NULL)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeViewSettings* pSettings = pDoc->GetChangeViewSettings();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeViewSettings* pSettings = rDoc.GetChangeViewSettings();
pAction=pAction->GetPrev();
@@ -67,7 +67,7 @@ ScChangeAction *ScRedComDialog::FindPrev(ScChangeAction *pAction)
{
if( pAction->GetState()==SC_CAS_VIRGIN &&
pAction->IsDialogRoot() &&
- ScViewUtil::IsActionShown(*pAction,*pSettings,*pDoc)) break;
+ ScViewUtil::IsActionShown(*pAction,*pSettings,rDoc)) break;
pAction=pAction->GetPrev();
}
@@ -79,8 +79,8 @@ ScChangeAction *ScRedComDialog::FindNext(ScChangeAction *pAction)
{
if(pAction!=NULL && pDocShell !=NULL)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeViewSettings* pSettings = pDoc->GetChangeViewSettings();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeViewSettings* pSettings = rDoc.GetChangeViewSettings();
pAction=pAction->GetNext();
@@ -88,7 +88,7 @@ ScChangeAction *ScRedComDialog::FindNext(ScChangeAction *pAction)
{
if( pAction->GetState()==SC_CAS_VIRGIN &&
pAction->IsDialogRoot() &&
- ScViewUtil::IsActionShown(*pAction,*pSettings,*pDoc)) break;
+ ScViewUtil::IsActionShown(*pAction,*pSettings,rDoc)) break;
pAction=pAction->GetNext();
}
@@ -102,7 +102,7 @@ void ScRedComDialog::ReInit(ScChangeAction *pAction)
if(pChangeAction!=NULL && pDocShell !=NULL)
{
OUString aTitle;
- pChangeAction->GetDescription( aTitle, pDocShell->GetDocument());
+ pChangeAction->GetDescription( aTitle, &pDocShell->GetDocument());
pDlg->SetText(aTitle);
aComment=pChangeAction->GetComment();
@@ -142,7 +142,7 @@ void ScRedComDialog::SelectCell()
const ScChangeAction* pAction=pChangeAction;
const ScBigRange& rRange = pAction->GetBigRange();
- if(rRange.IsValid(pDocShell->GetDocument()))
+ if(rRange.IsValid(&pDocShell->GetDocument()))
{
ScViewData* pViewData=ScDocShell::GetViewData();
ScRange aRef=rRange.MakeRange();
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx
index 52fde2ef009e..85cb1e55d8ef 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -37,9 +37,9 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, ScDocShell* pShell, bool )
get(m_pBtnPaste, "paste");
get(m_pBtnClose, "close");
- ScDocument* pDoc = pShell->GetDocument();
+ ScDocument& rDoc = pShell->GetDocument();
std::map<OUString, ScRangeName*> aCopyMap;
- pDoc->GetRangeNameMap(aCopyMap);
+ rDoc.GetRangeNameMap(aCopyMap);
std::map<OUString, ScRangeName*>::iterator itr = aCopyMap.begin(), itrEnd = aCopyMap.end();
for (; itr != itrEnd; ++itr)
{
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index ed7336adb394..3441da2dcce4 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -493,7 +493,7 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt )
if (pScNavigatorDlg!=NULL)
pScTabViewShell=pScNavigatorDlg->GetTabViewShell();
if(pScTabViewShell !=NULL)
- pScDrawView =pScTabViewShell->GetViewData()->GetScDrawView();
+ pScDrawView =pScTabViewShell->GetViewData().GetScDrawView();
if(pScDrawView!=NULL)
{
pScDrawView->SelectCurrentViewObject(aText );
@@ -717,7 +717,7 @@ ScDocument* ScContentTree::GetSourceDocument()
{
ScDocShell* pSh = GetManualOrCurrent();
if (pSh)
- return pSh->GetDocument();
+ return &pSh->GetDocument();
}
return NULL;
@@ -979,7 +979,7 @@ void ScContentTree::GetDrawNames( sal_uInt16 nType )
if (pScNavigatorDlg!=NULL)
pScTabViewShell=pScNavigatorDlg->GetTabViewShell();
if(pScTabViewShell !=NULL)
- pScDrawView =pScTabViewShell->GetViewData()->GetScDrawView();
+ pScDrawView =pScTabViewShell->GetViewData().GetScDrawView();
if(pScDrawView!=NULL)
{
bool bMarked =pScDrawView->GetObjectIsMarked(pObject);
@@ -1224,8 +1224,8 @@ static bool lcl_GetRange( ScDocument* pDoc, sal_uInt16 nType, const OUString& rN
static void lcl_DoDragObject( ScDocShell* pSrcShell, const OUString& rName, sal_uInt16 nType, Window* pWin )
{
- ScDocument* pSrcDoc = pSrcShell->GetDocument();
- ScDrawLayer* pModel = pSrcDoc->GetDrawLayer();
+ ScDocument& rSrcDoc = pSrcShell->GetDocument();
+ ScDrawLayer* pModel = rSrcDoc.GetDrawLayer();
if (pModel)
{
bool bOle = ( nType == SC_CONTENT_OLEOBJECT );
@@ -1266,14 +1266,14 @@ static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, sal_u
aMark.SelectTable( rRange.aStart.Tab(), true );
aMark.SetMarkArea( rRange );
- ScDocument* pSrcDoc = pSrcShell->GetDocument();
- if ( !pSrcDoc->HasSelectedBlockMatrixFragment( rRange.aStart.Col(), rRange.aStart.Row(),
+ ScDocument& rSrcDoc = pSrcShell->GetDocument();
+ if ( !rSrcDoc.HasSelectedBlockMatrixFragment( rRange.aStart.Col(), rRange.aStart.Row(),
rRange.aEnd.Col(), rRange.aEnd.Row(),
aMark ) )
{
ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
ScClipParam aClipParam(rRange, false);
- pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark);
+ rSrcDoc.CopyToClip(aClipParam, pClipDoc, &aMark);
// pClipDoc->ExtendMerge( rRange, sal_True );
TransferableObjectDescriptor aObjDesc;
@@ -1325,7 +1325,7 @@ void ScContentTree::DoDrag()
if (pDocSh->HasName())
aDocName = pDocSh->GetMedium()->GetName();
else
- pLocalDoc = pDocSh->GetDocument(); // Drop nur in dieses Dokument
+ pLocalDoc = &pDocSh->GetDocument(); // Drop nur in dieses Dokument
}
}
@@ -1392,11 +1392,11 @@ void ScContentTree::DoDrag()
if ( pSrcShell )
{
- ScDocument* pSrcDoc = pSrcShell->GetDocument();
+ ScDocument& rSrcDoc = pSrcShell->GetDocument();
if ( nType == SC_CONTENT_RANGENAME || nType == SC_CONTENT_DBAREA )
{
ScRange aRange;
- if ( lcl_GetRange( pSrcDoc, nType, aText, aRange ) )
+ if ( lcl_GetRange( &rSrcDoc, nType, aText, aRange ) )
{
lcl_DoDragCells( pSrcShell, aRange, SC_DROP_NAVIGATOR, this );
}
@@ -1404,7 +1404,7 @@ void ScContentTree::DoDrag()
else if ( nType == SC_CONTENT_TABLE )
{
SCTAB nTab;
- if ( pSrcDoc->GetTable( aText, nTab ) )
+ if ( rSrcDoc.GetTable( aText, nTab ) )
{
ScRange aRange( 0,0,nTab, MAXCOL,MAXROW,nTab );
lcl_DoDragCells( pSrcShell, aRange, SC_DROP_NAVIGATOR | SC_DROP_TABLE, this );
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index cf3cdc8ac163..7d0696b5b2ed 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -1021,7 +1021,7 @@ ScNavigatorSettings* ScNavigatorDlg::GetNavigatorSettings()
bool ScNavigatorDlg::GetViewData()
{
ScTabViewShell* pViewSh = GetTabViewShell();
- pViewData = pViewSh ? pViewSh->GetViewData() : NULL;
+ pViewData = pViewSh ? &pViewSh->GetViewData() : NULL;
return ( pViewData != NULL );
}
@@ -1272,7 +1272,7 @@ void ScNavigatorDlg::MarkDataArea()
pViewSh->MarkDataArea();
ScRange aMarkRange;
- pViewSh->GetViewData()->GetMarkData().GetMarkArea(aMarkRange);
+ pViewSh->GetViewData().GetMarkData().GetMarkArea(aMarkRange);
pMarkArea->nColStart = aMarkRange.aStart.Col();
pMarkArea->nRowStart = aMarkRange.aStart.Row();
pMarkArea->nColEnd = aMarkRange.aEnd.Col();
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 71515ca1916d..b1d78151b3ad 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -112,7 +112,7 @@ void ScTpUserLists::Init()
SCCOL nEndCol = 0;
SCROW nEndRow = 0;
- pViewData = pViewSh->GetViewData();
+ pViewData = &pViewSh->GetViewData();
pDoc = pViewData->GetDocument();
pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 9c74b954f0d9..9d8a16370b5c 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -419,7 +419,7 @@ SfxTabPage* ScTpLayoutOptions::Create( Window* pParent,
ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
if(pDocSh!=NULL)
- pNew->SetDocument(pDocSh->GetDocument());
+ pNew->SetDocument(&pDocSh->GetDocument());
return pNew;
}
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 097a1bb1e510..88f652c98732 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -123,11 +123,11 @@ ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, Window*
OSL_ENSURE( pScDocSh, "Current DocumentShell not found :-(" );
- pDoc = pScDocSh->GetDocument();
+ pDoc = &pScDocSh->GetDocument();
if ( pScViewSh )
{
- pViewData = pScViewSh->GetViewData();
+ pViewData = &pScViewSh->GetViewData();
nCurTab = pViewData->GetTabNo();
}
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index e819be7a9dac..3e8ac5cd7724 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -62,10 +62,10 @@ ScHFPage::ScHFPage( Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSetId )
if ( pViewSh )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
- aStrPageStyle = pDoc->GetPageStyle( pViewData->GetTabNo() );
+ aStrPageStyle = pDoc->GetPageStyle( rViewData.GetTabNo() );
}
m_pBtnEdit->SetClickHdl ( LINK( this, ScHFPage, BtnHdl ) );
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 6a2510b6c2cc..55d80ad42a7c 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -146,8 +146,8 @@ void ScSimpleUndo::EndRedo()
void ScSimpleUndo::BroadcastChanges( const ScRange& rRange )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->BroadcastCells(rRange, SC_HINT_DATACHANGED);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.BroadcastCells(rRange, SC_HINT_DATACHANGED);
}
namespace {
@@ -181,14 +181,14 @@ public:
void ScSimpleUndo::BroadcastChanges( const DataSpansType& rSpans )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- SpanBroadcaster aBroadcaster(*pDoc);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SpanBroadcaster aBroadcaster(rDoc);
DataSpansType::const_iterator it = rSpans.begin(), itEnd = rSpans.end();
for (; it != itEnd; ++it)
{
const sc::ColumnSpanSet& rSet = *it->second;
- rSet.executeColumnAction(*pDoc, aBroadcaster);
+ rSet.executeColumnAction(rDoc, aBroadcaster);
}
}
@@ -206,7 +206,7 @@ void ScSimpleUndo::ShowTable( const ScRange& rRange )
{
SCTAB nStart = rRange.aStart.Tab();
SCTAB nEnd = rRange.aEnd.Tab();
- SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
if ( nTab < nStart || nTab > nEnd ) // if not in range:
pViewShell->SetTabNo( nStart ); // at beginning of the range
}
@@ -218,7 +218,7 @@ ScBlockUndo::ScBlockUndo( ScDocShell* pDocSh, const ScRange& rRange,
aBlockRange( rRange ),
eMode( eBlockMode )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScBlockUndo::~ScBlockUndo()
@@ -229,7 +229,7 @@ ScBlockUndo::~ScBlockUndo()
void ScBlockUndo::BeginUndo()
{
ScSimpleUndo::BeginUndo();
- EnableDrawAdjust( pDocShell->GetDocument(), false );
+ EnableDrawAdjust( &pDocShell->GetDocument(), false );
}
void ScBlockUndo::EndUndo()
@@ -237,8 +237,8 @@ void ScBlockUndo::EndUndo()
if (eMode == SC_UNDO_AUTOHEIGHT)
AdjustHeight();
- EnableDrawAdjust( pDocShell->GetDocument(), true );
- DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() );
+ EnableDrawAdjust( &pDocShell->GetDocument(), true );
+ DoSdrUndoAction( pDrawUndo, &pDocShell->GetDocument() );
ShowBlock();
ScSimpleUndo::EndUndo();
@@ -255,7 +255,7 @@ void ScBlockUndo::EndRedo()
bool ScBlockUndo::AdjustHeight()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
VirtualDevice aVirtDev;
Fraction aZoomX( 1, 1 );
@@ -264,11 +264,11 @@ bool ScBlockUndo::AdjustHeight()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- ScViewData* pData = pViewShell->GetViewData();
- nPPTX = pData->GetPPTX();
- nPPTY = pData->GetPPTY();
- aZoomX = pData->GetZoomX();
- aZoomY = pData->GetZoomY();
+ ScViewData& rData = pViewShell->GetViewData();
+ nPPTX = rData.GetPPTX();
+ nPPTY = rData.GetPPTY();
+ aZoomX = rData.GetZoomX();
+ aZoomY = rData.GetZoomY();
}
else
{
@@ -278,7 +278,7 @@ bool ScBlockUndo::AdjustHeight()
}
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
- bool bRet = pDoc->SetOptimalHeight(
+ bool bRet = rDoc.SetOptimalHeight(
aCxt, aBlockRange.aStart.Row(), aBlockRange.aEnd.Row(), aBlockRange.aStart.Tab());
if (bRet)
@@ -300,7 +300,7 @@ void ScBlockUndo::ShowBlock()
ShowTable( aBlockRange ); // with multiple sheets in range each of them is good
pViewShell->MoveCursorAbs( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
SC_FOLLOW_JUMP, false, false );
- SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
ScRange aRange = aBlockRange;
aRange.aStart.SetTab( nTab );
aRange.aEnd.SetTab( nTab );
@@ -316,7 +316,7 @@ ScMultiBlockUndo::ScMultiBlockUndo(
maBlockRanges(rRanges),
meMode(eBlockMode)
{
- mpDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ mpDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScMultiBlockUndo::~ScMultiBlockUndo()
@@ -327,7 +327,7 @@ ScMultiBlockUndo::~ScMultiBlockUndo()
void ScMultiBlockUndo::BeginUndo()
{
ScSimpleUndo::BeginUndo();
- EnableDrawAdjust(pDocShell->GetDocument(), false);
+ EnableDrawAdjust(&pDocShell->GetDocument(), false);
}
void ScMultiBlockUndo::EndUndo()
@@ -335,8 +335,8 @@ void ScMultiBlockUndo::EndUndo()
if (meMode == SC_UNDO_AUTOHEIGHT)
AdjustHeight();
- EnableDrawAdjust(pDocShell->GetDocument(), true);
- DoSdrUndoAction(mpDrawUndo, pDocShell->GetDocument());
+ EnableDrawAdjust(&pDocShell->GetDocument(), true);
+ DoSdrUndoAction(mpDrawUndo, &pDocShell->GetDocument());
ShowBlock();
ScSimpleUndo::EndUndo();
@@ -353,7 +353,7 @@ void ScMultiBlockUndo::EndRedo()
void ScMultiBlockUndo::AdjustHeight()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
VirtualDevice aVirtDev;
Fraction aZoomX( 1, 1 );
@@ -362,11 +362,11 @@ void ScMultiBlockUndo::AdjustHeight()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- ScViewData* pData = pViewShell->GetViewData();
- nPPTX = pData->GetPPTX();
- nPPTY = pData->GetPPTY();
- aZoomX = pData->GetZoomX();
- aZoomY = pData->GetZoomY();
+ ScViewData& rData = pViewShell->GetViewData();
+ nPPTX = rData.GetPPTX();
+ nPPTY = rData.GetPPTY();
+ aZoomX = rData.GetZoomX();
+ aZoomY = rData.GetZoomY();
}
else
{
@@ -379,7 +379,7 @@ void ScMultiBlockUndo::AdjustHeight()
for (size_t i = 0, n = maBlockRanges.size(); i < n; ++i)
{
const ScRange& r = *maBlockRanges[i];
- bool bRet = pDoc->SetOptimalHeight(aCxt, r.aStart.Row(), r.aEnd.Row(), r.aStart.Tab());
+ bool bRet = rDoc.SetOptimalHeight(aCxt, r.aStart.Row(), r.aEnd.Row(), r.aStart.Tab());
if (bRet)
pDocShell->PostPaint(
@@ -405,7 +405,7 @@ void ScMultiBlockUndo::ShowBlock()
ShowTable(aRange);
pViewShell->MoveCursorAbs(
aRange.aStart.Col(), aRange.aStart.Row(), SC_FOLLOW_JUMP, false, false);
- SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
aRange.aStart.SetTab(nTab);
aRange.aEnd.SetTab(nTab);
pViewShell->MarkRange(aRange, false, false);
@@ -426,10 +426,10 @@ ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocument* pRefDoc, ScRefUndoData*
pRefUndoData( pRefData ),
eMode( eRefMode )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if (pRefUndoData)
- pRefUndoData->DeleteUnchanged(pDoc);
- pDrawUndo = GetSdrUndoAction( pDoc );
+ pRefUndoData->DeleteUnchanged(&rDoc);
+ pDrawUndo = GetSdrUndoAction( &rDoc );
}
ScMoveUndo::~ScMoveUndo()
@@ -441,11 +441,11 @@ ScMoveUndo::~ScMoveUndo()
void ScMoveUndo::UndoRef()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1);
- pRefUndoDoc->CopyToDocument( aRange, IDF_FORMULA, false, pDoc, NULL, false );
+ pRefUndoDoc->CopyToDocument( aRange, IDF_FORMULA, false, &rDoc, NULL, false );
if (pRefUndoData)
- pRefUndoData->DoUndo( pDoc, (eMode == SC_UNDO_REFFIRST) );
+ pRefUndoData->DoUndo( &rDoc, (eMode == SC_UNDO_REFFIRST) );
// HACK: ScDragDropUndo is the only one with REFFIRST.
// If not, results possibly in a too frequent adjustment
// of ChartRefs. Not that pretty, but not too bad either..
@@ -455,7 +455,7 @@ void ScMoveUndo::BeginUndo()
{
ScSimpleUndo::BeginUndo();
- EnableDrawAdjust( pDocShell->GetDocument(), false );
+ EnableDrawAdjust( &pDocShell->GetDocument(), false );
if (pRefUndoDoc && eMode == SC_UNDO_REFFIRST)
UndoRef();
@@ -463,12 +463,12 @@ void ScMoveUndo::BeginUndo()
void ScMoveUndo::EndUndo()
{
- DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() ); // must also be called when pointer is null
+ DoSdrUndoAction( pDrawUndo, &pDocShell->GetDocument() ); // must also be called when pointer is null
if (pRefUndoDoc && eMode == SC_UNDO_REFLAST)
UndoRef();
- EnableDrawAdjust( pDocShell->GetDocument(), true );
+ EnableDrawAdjust( &pDocShell->GetDocument(), true );
ScSimpleUndo::EndUndo();
}
@@ -496,7 +496,7 @@ void ScDBFuncUndo::SetDrawUndoAction( SdrUndoAction* pDrawUndo )
void ScDBFuncUndo::BeginUndo()
{
ScSimpleUndo::BeginUndo();
- DoSdrUndoAction( mpDrawUndo, pDocShell->GetDocument() );
+ DoSdrUndoAction( mpDrawUndo, &pDocShell->GetDocument() );
}
void ScDBFuncUndo::EndUndo()
@@ -505,9 +505,9 @@ void ScDBFuncUndo::EndUndo()
if ( pAutoDBRange )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTab = pDoc->GetVisibleTab();
- ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTab = rDoc.GetVisibleTab();
+ ScDBData* pNoNameData = rDoc.GetAnonymousDBData(nTab);
if (pNoNameData )
{
SCCOL nRangeX1;
@@ -524,7 +524,7 @@ void ScDBFuncUndo::EndUndo()
{
// restore AutoFilter buttons
pAutoDBRange->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
- pDoc->ApplyFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, SC_MF_AUTO );
+ rDoc.ApplyFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, SC_MF_AUTO );
pDocShell->PostPaint( nRangeX1, nRangeY1, nRangeTab, nRangeX2, nRangeY1, nRangeTab, PAINT_GRID );
}
}
@@ -538,8 +538,8 @@ void ScDBFuncUndo::BeginRedo()
{
// move the database range to this function's position again (see ScDocShell::GetDBData)
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDBData* pNoNameData = pDoc->GetAnonymousDBData(aOriginalRange.aStart.Tab());
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDBData* pNoNameData = rDoc.GetAnonymousDBData(aOriginalRange.aStart.Tab());
if ( pNoNameData )
{
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index aaa58ec792be..65e4875b97d7 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -149,7 +149,7 @@ bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction )
void ScUndoInsertCells::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
pChangeTrack->AppendInsert( aEffRange );
@@ -161,12 +161,12 @@ void ScUndoInsertCells::SetChangeTrack()
void ScUndoInsertCells::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB i;
if ( bUndo )
{
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
}
@@ -182,10 +182,10 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
for( i=0; i<nCount; i++ )
{
if (bUndo)
- pDoc->DeleteRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
+ rDoc.DeleteRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Row(), static_cast<SCSIZE>(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
else
- pDoc->InsertRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
+ rDoc.InsertRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Row(), static_cast<SCSIZE>(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
}
break;
@@ -194,10 +194,10 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
for( i=0; i<nCount; i++ )
{
if (bUndo)
- pDoc->DeleteCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
+ rDoc.DeleteCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Col(), static_cast<SCSIZE>(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
else
- pDoc->InsertCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
+ rDoc.InsertCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Col(), static_cast<SCSIZE>(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
}
break;
@@ -212,12 +212,12 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
aWorkRange.aEnd.SetCol(MAXCOL);
for( i=0; i<nCount; i++ )
{
- if ( pDoc->HasAttrib( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), pTabs[i],
+ if ( rDoc.HasAttrib( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), pTabs[i],
aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(), pTabs[i], HASATTR_MERGED ) )
{
SCCOL nEndCol = aWorkRange.aEnd.Col();
SCROW nEndRow = aWorkRange.aEnd.Row();
- pDoc->ExtendMerge( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), nEndCol, nEndRow, pTabs[i], true );
+ rDoc.ExtendMerge( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), nEndCol, nEndRow, pTabs[i], true );
}
}
@@ -283,9 +283,9 @@ void ScUndoInsertCells::Undo()
DoChange( true );
EndUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (SCTAB i = 0; i < nCount; ++i)
- pDoc->SetDrawPageSize(pTabs[i]);
+ rDoc.SetDrawPageSize(pTabs[i]);
}
void ScUndoInsertCells::Redo()
@@ -298,9 +298,9 @@ void ScUndoInsertCells::Redo()
if ( pPasteUndo )
pPasteUndo->Redo(); // redo paste last
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (SCTAB i = 0; i < nCount; ++i)
- pDoc->SetDrawPageSize(pTabs[i]);
+ rDoc.SetDrawPageSize(pTabs[i]);
}
void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
@@ -363,7 +363,7 @@ OUString ScUndoDeleteCells::GetComment() const
void ScUndoDeleteCells::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->AppendDeleteRange( aEffRange, pRefUndoDoc,
nStartChangeAction, nEndChangeAction );
@@ -373,12 +373,12 @@ void ScUndoDeleteCells::SetChangeTrack()
void ScUndoDeleteCells::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB i;
if ( bUndo )
{
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
}
@@ -392,10 +392,10 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
for( i=0; i<nCount; i++ )
{
if (bUndo)
- pDoc->InsertRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
+ rDoc.InsertRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Row(), static_cast<SCSIZE>(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
else
- pDoc->DeleteRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
+ rDoc.DeleteRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Row(), static_cast<SCSIZE>(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
}
break;
@@ -404,10 +404,10 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
for( i=0; i<nCount; i++ )
{
if (bUndo)
- pDoc->InsertCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
+ rDoc.InsertCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Col(), static_cast<SCSIZE>(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
else
- pDoc->DeleteCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
+ rDoc.DeleteCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
aEffRange.aStart.Col(), static_cast<SCSIZE>(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
}
break;
@@ -421,7 +421,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
for( i=0; i<nCount && bUndo; i++ )
{
pRefUndoDoc->CopyToDocument( aEffRange.aStart.Col(), aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Col(), aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
- IDF_ALL | IDF_NOCAPTIONS, false, pDoc );
+ IDF_ALL | IDF_NOCAPTIONS, false, &rDoc );
}
ScRange aWorkRange( aEffRange );
@@ -430,7 +430,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
for( i=0; i<nCount; i++ )
{
- if ( pDoc->HasAttrib( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), pTabs[i],
+ if ( rDoc.HasAttrib( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), pTabs[i],
aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(), pTabs[i], HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{
// #i51445# old merge flag attributes must be deleted also for single cells,
@@ -444,16 +444,16 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
aWorkRange.aEnd.SetRow(MAXROW);
ScMarkData aMarkData;
aMarkData.SelectOneTable( aWorkRange.aStart.Tab() );
- ScPatternAttr aPattern( pDoc->GetPool() );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( ScMergeFlagAttr() );
- pDoc->ApplyPatternArea( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(),
+ rDoc.ApplyPatternArea( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(),
aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(),
aMarkData, aPattern );
}
SCCOL nEndCol = aWorkRange.aEnd.Col();
SCROW nEndRow = aWorkRange.aEnd.Row();
- pDoc->ExtendMerge( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), nEndCol, nEndRow, pTabs[i], true );
+ rDoc.ExtendMerge( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), nEndCol, nEndRow, pTabs[i], true );
}
}
@@ -526,9 +526,9 @@ void ScUndoDeleteCells::Undo()
}
}
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (SCTAB i = 0; i < nCount; ++i)
- pDoc->SetDrawPageSize(pTabs[i]);
+ rDoc.SetDrawPageSize(pTabs[i]);
}
void ScUndoDeleteCells::Redo()
@@ -543,9 +543,9 @@ void ScUndoDeleteCells::Redo()
if (pViewShell)
pViewShell->DoneBlockMode(); // current way
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (SCTAB i = 0; i < nCount; ++i)
- pDoc->SetDrawPageSize(pTabs[i]);
+ rDoc.SetDrawPageSize(pTabs[i]);
}
void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)
@@ -603,11 +603,11 @@ void ScUndoDeleteMulti::DoChange() const
if (mbRefresh)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCCOL nEndCol = MAXCOL;
SCROW nEndRow = MAXROW;
- pDoc->RemoveFlagsTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER );
- pDoc->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab, true );
+ rDoc.RemoveFlagsTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER );
+ rDoc.ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab, true );
}
pDocShell->PostPaint( nStartCol, nStartRow, nTab, MAXCOL, MAXROW, nTab, nPaint );
@@ -621,7 +621,7 @@ void ScUndoDeleteMulti::DoChange() const
void ScUndoDeleteMulti::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
nStartChangeAction = pChangeTrack->GetActionMax() + 1;
@@ -660,7 +660,7 @@ void ScUndoDeleteMulti::Undo()
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // important because of TrackFormulas in UpdateReference
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
// reverse delete -> forward insert
std::vector<sc::ColRowSpan>::const_iterator it = maSpans.begin(), itEnd = maSpans.end();
@@ -669,9 +669,9 @@ void ScUndoDeleteMulti::Undo()
SCCOLROW nStart = it->mnStart;
SCCOLROW nEnd = it->mnEnd;
if (mbRows)
- pDoc->InsertRow( 0,nTab, MAXCOL,nTab, nStart,static_cast<SCSIZE>(nEnd-nStart+1) );
+ rDoc.InsertRow( 0,nTab, MAXCOL,nTab, nStart,static_cast<SCSIZE>(nEnd-nStart+1) );
else
- pDoc->InsertCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
+ rDoc.InsertCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
}
it = maSpans.begin();
@@ -680,13 +680,13 @@ void ScUndoDeleteMulti::Undo()
SCCOLROW nStart = it->mnStart;
SCCOLROW nEnd = it->mnEnd;
if (mbRows)
- pRefUndoDoc->CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, IDF_ALL,false,pDoc );
+ pRefUndoDoc->CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, IDF_ALL,false, &rDoc );
else
pRefUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart),0,nTab,
- static_cast<SCCOL>(nEnd),MAXROW,nTab, IDF_ALL,false,pDoc );
+ static_cast<SCCOL>(nEnd),MAXROW,nTab, IDF_ALL,false, &rDoc );
}
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -704,7 +704,7 @@ void ScUndoDeleteMulti::Redo()
WaitObject aWait( pDocShell->GetActiveDialogParent() ); // important because of TrackFormulas in UpdateReference
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
// reverse delete
std::vector<sc::ColRowSpan>::const_reverse_iterator ri = maSpans.rbegin(), riEnd = maSpans.rend();
@@ -713,9 +713,9 @@ void ScUndoDeleteMulti::Redo()
SCCOLROW nEnd = ri->mnEnd;
SCCOLROW nStart = ri->mnStart;
if (mbRows)
- pDoc->DeleteRow( 0,nTab, MAXCOL,nTab, nStart,static_cast<SCSIZE>(nEnd-nStart+1) );
+ rDoc.DeleteRow( 0,nTab, MAXCOL,nTab, nStart,static_cast<SCSIZE>(nEnd-nStart+1) );
else
- pDoc->DeleteCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
+ rDoc.DeleteCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
}
SetChangeTrack();
@@ -762,7 +762,7 @@ OUString ScUndoCut::GetComment() const
void ScUndoCut::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc,
nStartChangeAction, nEndChangeAction, SC_CACM_CUT );
@@ -772,7 +772,7 @@ void ScUndoCut::SetChangeTrack()
void ScUndoCut::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
sal_uInt16 nExtFlags = 0;
// do not undo/redo objects and note captions, they are handled via drawing undo
@@ -781,12 +781,12 @@ void ScUndoCut::DoChange( const bool bUndo )
if (bUndo) // only for Undo
{
// all sheets - CopyToDocument skips those that don't exist in pUndoDoc
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScRange aCopyRange = aExtendedRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, false, pDoc );
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, false, &rDoc );
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -795,7 +795,7 @@ void ScUndoCut::DoChange( const bool bUndo )
else // only for Redo
{
pDocShell->UpdatePaintExt( nExtFlags, aExtendedRange );
- pDoc->DeleteArea( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
+ rDoc.DeleteArea( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(), aMarkData, nUndoFlags );
SetChangeTrack();
}
@@ -822,10 +822,10 @@ void ScUndoCut::Undo()
void ScUndoCut::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ ScDocument& rDoc = pDocShell->GetDocument();
+ EnableDrawAdjust( &rDoc, false ); //! include in ScBlockUndo?
DoChange( false );
- EnableDrawAdjust( pDoc, true ); //! include in ScBlockUndo?
+ EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
}
@@ -856,7 +856,7 @@ ScUndoPaste::ScUndoPaste( ScDocShell* pNewDocShell, const ScRangeList& rRanges,
bRedoFilled( bRedoIsFilled )
{
if ( pRefUndoData )
- pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() );
+ pRefUndoData->DeleteUnchanged( &pDocShell->GetDocument() );
if ( pOptions )
aPasteOptions = *pOptions; // used only for Repeat
@@ -879,7 +879,7 @@ OUString ScUndoPaste::GetComment() const
void ScUndoPaste::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack && (nFlags & IDF_CONTENTS) )
{
for (size_t i = 0, n = maBlockRanges.size(); i < n; ++i)
@@ -894,13 +894,13 @@ void ScUndoPaste::SetChangeTrack()
void ScUndoPaste::DoChange(bool bUndo)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
// RefUndoData for redo is created before first undo
// (with DeleteUnchanged after the DoUndo call)
bool bCreateRedoData = ( bUndo && pRefUndoData && !pRefRedoData );
if ( bCreateRedoData )
- pRefRedoData = new ScRefUndoData( pDoc );
+ pRefRedoData = new ScRefUndoData( &rDoc );
ScRefUndoData* pWorkRefData = bUndo ? pRefUndoData : pRefRedoData;
@@ -918,7 +918,7 @@ void ScUndoPaste::DoChange(bool bUndo)
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
if ( bUndo && !bRedoFilled )
{
if (!pRedoDoc)
@@ -935,7 +935,7 @@ void ScUndoPaste::DoChange(bool bUndo)
}
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndoSelected( pDoc, aMarkData, bColInfo, bRowInfo );
+ pRedoDoc->InitUndoSelected( &rDoc, aMarkData, bColInfo, bRowInfo );
}
// read "redo" data from the document in the first undo
// all sheets - CopyToDocument skips those that don't exist in pRedoDoc
@@ -944,7 +944,7 @@ void ScUndoPaste::DoChange(bool bUndo)
ScRange aCopyRange = *maBlockRanges[i];
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, nUndoFlags, false, pRedoDoc );
+ rDoc.CopyToDocument( aCopyRange, nUndoFlags, false, pRedoDoc );
bRedoFilled = true;
}
}
@@ -952,11 +952,11 @@ void ScUndoPaste::DoChange(bool bUndo)
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt(nExtFlags, maBlockRanges.Combine());
- pDoc->ForgetNoteCaptions(maBlockRanges);
+ rDoc.ForgetNoteCaptions(maBlockRanges);
aMarkData.MarkToMulti();
- pDoc->DeleteSelection(nUndoFlags, aMarkData, false); // no broadcasting here
+ rDoc.DeleteSelection(nUndoFlags, aMarkData, false); // no broadcasting here
for (size_t i = 0, n = maBlockRanges.size(); i < n; ++i)
- pDoc->BroadcastCells(*maBlockRanges[i], SC_HINT_DATACHANGED);
+ rDoc.BroadcastCells(*maBlockRanges[i], SC_HINT_DATACHANGED);
aMarkData.MarkToSimple();
@@ -969,7 +969,7 @@ void ScUndoPaste::DoChange(bool bUndo)
ScRange aRange = *maBlockRanges[i];
aRange.aStart.SetTab(nFirstSelected);
aRange.aEnd.SetTab(nFirstSelected);
- pRedoDoc->UndoToDocument(aRange, nUndoFlags, false, pDoc);
+ pRedoDoc->UndoToDocument(aRange, nUndoFlags, false, &rDoc);
ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
@@ -978,21 +978,21 @@ void ScUndoPaste::DoChange(bool bUndo)
aRange.aStart.SetTab(*itr);
aRange.aEnd.SetTab(*itr);
- pRedoDoc->CopyToDocument( aRange, nUndoFlags, false, pDoc );
+ pRedoDoc->CopyToDocument( aRange, nUndoFlags, false, &rDoc );
}
}
}
if (pWorkRefData)
{
- pWorkRefData->DoUndo( pDoc, true ); // true = bSetChartRangeLists for SetChartListenerCollection
+ pWorkRefData->DoUndo( &rDoc, true ); // true = bSetChartRangeLists for SetChartListenerCollection
if (!maBlockRanges.empty() &&
- pDoc->RefreshAutoFilter(0, 0, MAXCOL, MAXROW, maBlockRanges[0]->aStart.Tab()))
+ rDoc.RefreshAutoFilter(0, 0, MAXCOL, MAXROW, maBlockRanges[0]->aStart.Tab()))
bPaintAll = true;
}
if ( bCreateRedoData && pRefRedoData )
- pRefRedoData->DeleteUnchanged( pDoc );
+ pRefRedoData->DeleteUnchanged( &rDoc );
if (bUndo) // Undo: UndoToDocument after handling RefData
{
@@ -1004,14 +1004,14 @@ void ScUndoPaste::DoChange(bool bUndo)
{
aRange.aStart.SetTab(*itr);
aRange.aEnd.SetTab(*itr);
- pUndoDoc->UndoToDocument(aRange, nUndoFlags, false, pDoc);
+ pUndoDoc->UndoToDocument(aRange, nUndoFlags, false, &rDoc);
}
}
}
if ( bUndo )
{
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
}
@@ -1023,7 +1023,7 @@ void ScUndoPaste::DoChange(bool bUndo)
for (size_t i = 0, n = aDrawRanges.size(); i < n; ++i)
{
ScRange& rDrawRange = *aDrawRanges[i];
- pDoc->ExtendMerge(rDrawRange, true); // only needed for single sheet (text/rtf etc.)
+ rDoc.ExtendMerge(rDrawRange, true); // only needed for single sheet (text/rtf etc.)
if (bPaintAll)
{
rDrawRange.aStart.SetCol(0);
@@ -1081,10 +1081,10 @@ void ScUndoPaste::Undo()
void ScUndoPaste::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ ScDocument& rDoc = pDocShell->GetDocument();
+ EnableDrawAdjust( &rDoc, false ); //! include in ScBlockUndo?
DoChange( false );
- EnableDrawAdjust( pDoc, true ); //! include in ScBlockUndo?
+ EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
@@ -1130,7 +1130,7 @@ ScUndoDragDrop::ScUndoDragDrop( ScDocShell* pNewDocShell,
if ( !bIncludeFiltered )
{
// find number of non-filtered rows
- SCROW nPastedCount = pDocShell->GetDocument()->CountNonFilteredRows(
+ SCROW nPastedCount = pDocShell->GetDocument().CountNonFilteredRows(
aSrcRange.aStart.Row(), aSrcRange.aEnd.Row(), aSrcRange.aStart.Tab());
if ( nPastedCount == 0 )
@@ -1157,7 +1157,7 @@ OUString ScUndoDragDrop::GetComment() const
void ScUndoDragDrop::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
if ( bCut )
@@ -1178,17 +1178,17 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const
{
sal_uInt16 nPaint = PAINT_GRID;
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if (pViewShell)
{
VirtualDevice aVirtDev;
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
sc::RowHeightContext aCxt(
- pViewData->GetPPTX(), pViewData->GetPPTY(), pViewData->GetZoomX(), pViewData->GetZoomY(),
+ rViewData.GetPPTX(), rViewData.GetPPTY(), rViewData.GetZoomX(), rViewData.GetZoomY(),
&aVirtDev);
- if (pDoc->SetOptimalHeight(aCxt, aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab()))
+ if (rDoc.SetOptimalHeight(aCxt, aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab()))
{
aRange.aStart.SetCol(0);
aRange.aEnd.SetCol(MAXCOL);
@@ -1223,26 +1223,26 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const
void ScUndoDragDrop::DoUndo( ScRange aRange )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
// Database range before data, so that the Autofilter button match up in ExtendMerge
ScRange aPaintRange = aRange;
- pDoc->ExtendMerge( aPaintRange ); // before deleting
+ rDoc.ExtendMerge( aPaintRange ); // before deleting
pDocShell->UpdatePaintExt(mnPaintExtFlags, aPaintRange);
// do not undo objects and note captions, they are handled via drawing undo
sal_uInt16 nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
- pDoc->DeleteAreaTab( aRange, nUndoFlags );
- pRefUndoDoc->CopyToDocument( aRange, nUndoFlags, false, pDoc );
- if ( pDoc->HasAttrib( aRange, HASATTR_MERGED ) )
- pDoc->ExtendMerge( aRange, true );
+ rDoc.DeleteAreaTab( aRange, nUndoFlags );
+ pRefUndoDoc->CopyToDocument( aRange, nUndoFlags, false, &rDoc );
+ if ( rDoc.HasAttrib( aRange, HASATTR_MERGED ) )
+ rDoc.ExtendMerge( aRange, true );
aPaintRange.aEnd.SetCol( std::max( aPaintRange.aEnd.Col(), aRange.aEnd.Col() ) );
aPaintRange.aEnd.SetRow( std::max( aPaintRange.aEnd.Row(), aRange.aEnd.Row() ) );
@@ -1261,18 +1261,18 @@ void ScUndoDragDrop::Undo()
if (bCut)
{
// Notify all listeners of the destination range, and have them update their references.
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCCOL nColDelta = aSrcRange.aStart.Col() - aDestRange.aStart.Col();
SCROW nRowDelta = aSrcRange.aStart.Row() - aDestRange.aStart.Row();
SCTAB nTabDelta = aSrcRange.aStart.Tab() - aDestRange.aStart.Tab();
sc::RefMovedHint aHint(aDestRange, ScAddress(nColDelta, nRowDelta, nTabDelta));
- pDoc->BroadcastRefMoved(aHint);
+ rDoc.BroadcastRefMoved(aHint);
- ScValidationDataList* pValidList = pDoc->GetValidationList();
+ ScValidationDataList* pValidList = rDoc.GetValidationList();
if (pValidList)
{
// Update the references of validation entries.
- sc::RefUpdateContext aCxt(*pDoc);
+ sc::RefUpdateContext aCxt(rDoc);
aCxt.meMode = URM_MOVE;
aCxt.maRange = aSrcRange;
aCxt.mnColDelta = nColDelta;
@@ -1300,10 +1300,10 @@ void ScUndoDragDrop::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
boost::scoped_ptr<ScDocument> pClipDoc(new ScDocument( SCDOCMODE_CLIP ));
- EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ EnableDrawAdjust( &rDoc, false ); //! include in ScBlockUndo?
// do not undo/redo objects and note captions, they are handled via drawing undo
sal_uInt16 nRedoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
@@ -1329,15 +1329,15 @@ void ScUndoDragDrop::Redo()
// do not clone objects and note captions into clipdoc (see above)
// but at least copy notes
ScClipParam aClipParam(aSrcRange, bCut);
- pDoc->CopyToClip(aClipParam, pClipDoc.get(), &aSourceMark, false, bKeepScenarioFlags, false, true);
+ rDoc.CopyToClip(aClipParam, pClipDoc.get(), &aSourceMark, false, bKeepScenarioFlags, false, true);
if (bCut)
{
ScRange aSrcPaintRange = aSrcRange;
- pDoc->ExtendMerge( aSrcPaintRange ); // before deleting
+ rDoc.ExtendMerge( aSrcPaintRange ); // before deleting
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aSrcPaintRange );
- pDoc->DeleteAreaTab( aSrcRange, nRedoFlags );
+ rDoc.DeleteAreaTab( aSrcRange, nRedoFlags );
PaintArea( aSrcPaintRange, nExtFlags );
}
@@ -1347,11 +1347,11 @@ void ScUndoDragDrop::Redo()
bool bIncludeFiltered = bCut;
// TODO: restore old note captions instead of cloning new captions...
- pDoc->CopyFromClip( aDestRange, aDestMark, IDF_ALL & ~IDF_OBJECTS, NULL, pClipDoc.get(), true, false, bIncludeFiltered );
+ rDoc.CopyFromClip( aDestRange, aDestMark, IDF_ALL & ~IDF_OBJECTS, NULL, pClipDoc.get(), true, false, bIncludeFiltered );
if (bCut)
for (nTab=aSrcRange.aStart.Tab(); nTab<=aSrcRange.aEnd.Tab(); nTab++)
- pDoc->RefreshAutoFilter( aSrcRange.aStart.Col(), aSrcRange.aStart.Row(),
+ rDoc.RefreshAutoFilter( aSrcRange.aStart.Col(), aSrcRange.aStart.Row(),
aSrcRange.aEnd.Col(), aSrcRange.aEnd.Row(), nTab );
// skipped rows and merged cells don't mix
@@ -1362,7 +1362,7 @@ void ScUndoDragDrop::Redo()
{
SCCOL nEndCol = aDestRange.aEnd.Col();
SCROW nEndRow = aDestRange.aEnd.Row();
- pDoc->ExtendMerge( aDestRange.aStart.Col(), aDestRange.aStart.Row(),
+ rDoc.ExtendMerge( aDestRange.aStart.Col(), aDestRange.aStart.Row(),
nEndCol, nEndRow, nTab, true );
PaintArea( ScRange( aDestRange.aStart.Col(), aDestRange.aStart.Row(), nTab,
nEndCol, nEndRow, nTab ), 0 );
@@ -1374,7 +1374,7 @@ void ScUndoDragDrop::Redo()
ShowTable( aDestRange.aStart.Tab() );
RedoSdrUndoAction( pDrawUndo ); //! include in ScBlockUndo?
- EnableDrawAdjust( pDoc, true ); //! include in ScBlockUndo?
+ EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
@@ -1412,10 +1412,10 @@ OUString ScUndoListNames::GetComment() const
void ScUndoListNames::DoChange( ScDocument* pSrcDoc ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- pDoc->DeleteAreaTab( aBlockRange, IDF_ALL );
- pSrcDoc->CopyToDocument( aBlockRange, IDF_ALL, false, pDoc );
+ rDoc.DeleteAreaTab( aBlockRange, IDF_ALL );
+ pSrcDoc->CopyToDocument( aBlockRange, IDF_ALL, false, &rDoc );
pDocShell->PostPaint( aBlockRange, PAINT_GRID );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1478,10 +1478,10 @@ void ScUndoConditionalFormat::Redo()
void ScUndoConditionalFormat::DoChange(ScDocument* pSrcDoc)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- pDoc->DeleteAreaTab( maRange, IDF_ALL );
- pSrcDoc->CopyToDocument( maRange, IDF_ALL, false, pDoc );
+ rDoc.DeleteAreaTab( maRange, IDF_ALL );
+ pSrcDoc->CopyToDocument( maRange, IDF_ALL, false, &rDoc );
pDocShell->PostPaint( maRange, PAINT_GRID );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1538,9 +1538,9 @@ void ScUndoUseScenario::Undo()
pViewShell->InitOwnBlockMode();
}
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->DeleteSelection( IDF_ALL, aMarkData );
- pUndoDoc->CopyToDocument( aRange, IDF_ALL, true, pDoc, &aMarkData );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.DeleteSelection( IDF_ALL, aMarkData );
+ pUndoDoc->CopyToDocument( aRange, IDF_ALL, true, &rDoc, &aMarkData );
// scenario table
bool bFrame = false;
@@ -1555,14 +1555,14 @@ void ScUndoUseScenario::Undo()
Color aColor;
sal_uInt16 nScenFlags;
pUndoDoc->GetScenarioData( i, aComment, aColor, nScenFlags );
- pDoc->SetScenarioData( i, aComment, aColor, nScenFlags );
+ rDoc.SetScenarioData( i, aComment, aColor, nScenFlags );
bool bActive = pUndoDoc->IsActiveScenario( i );
- pDoc->SetActiveScenario( i, bActive );
+ rDoc.SetActiveScenario( i, bActive );
// For copy-back scenario also consider content
if ( nScenFlags & SC_SCENARIO_TWOWAY )
{
- pDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, i, IDF_ALL );
- pUndoDoc->CopyToDocument( 0,0,i, MAXCOL,MAXROW,i, IDF_ALL,false, pDoc );
+ rDoc.DeleteAreaTab( 0,0, MAXCOL,MAXROW, i, IDF_ALL );
+ pUndoDoc->CopyToDocument( 0,0,i, MAXCOL,MAXROW,i, IDF_ALL,false, &rDoc );
}
if ( nScenFlags & SC_SCENARIO_SHOWFRAME )
bFrame = true;
@@ -1613,8 +1613,8 @@ bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const
{
if (rTarget.ISA(ScTabViewTarget))
{
- ScViewData* pViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
- return !pViewData->GetDocument()->IsScenario( pViewData->GetTabNo() );
+ ScViewData& rViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
+ return !rViewData.GetDocument()->IsScenario( rViewData.GetTabNo() );
}
return false;
}
@@ -1645,28 +1645,28 @@ OUString ScUndoSelectionStyle::GetComment() const
void ScUndoSelectionStyle::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SetViewMarkData( aMarkData );
ScRange aWorkRange( aRange );
- if ( pDoc->HasAttrib( aWorkRange, HASATTR_MERGED ) ) // Merged cells?
- pDoc->ExtendMerge( aWorkRange, true );
+ if ( rDoc.HasAttrib( aWorkRange, HASATTR_MERGED ) ) // Merged cells?
+ rDoc.ExtendMerge( aWorkRange, true );
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aWorkRange );
if (bUndo) // if Undo then push back all old data again
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScRange aCopyRange = aWorkRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, true, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, true, &rDoc, &aMarkData );
}
else // if Redo, then reapply style
{
- ScStyleSheetPool* pStlPool = pDoc->GetStyleSheetPool();
+ ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool();
ScStyleSheet* pStyleSheet =
(ScStyleSheet*) pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
@@ -1674,7 +1674,7 @@ void ScUndoSelectionStyle::DoChange( const bool bUndo )
OSL_FAIL("StyleSheet not found");
return;
}
- pDoc->ApplySelectionStyle( *pStyleSheet, aMarkData );
+ rDoc.ApplySelectionStyle( *pStyleSheet, aMarkData );
}
pDocShell->UpdatePaintExt( nExtFlags, aWorkRange );
@@ -1704,8 +1704,8 @@ void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStlPool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool();
ScStyleSheet* pStyleSheet = (ScStyleSheet*) pStlPool->
Find( aStyleName, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
@@ -1750,8 +1750,8 @@ OUString ScUndoEnterMatrix::GetComment() const
void ScUndoEnterMatrix::SetChangeTrack()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc,
nStartChangeAction, nEndChangeAction );
@@ -1763,17 +1763,17 @@ void ScUndoEnterMatrix::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- pDoc->DeleteAreaTab( aBlockRange, IDF_ALL & ~IDF_NOTE );
- pUndoDoc->CopyToDocument( aBlockRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ rDoc.DeleteAreaTab( aBlockRange, IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->CopyToDocument( aBlockRange, IDF_ALL & ~IDF_NOTE, false, &rDoc );
pDocShell->PostPaint( aBlockRange, PAINT_GRID );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
pViewShell->CellContentChanged();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -1784,13 +1784,13 @@ void ScUndoEnterMatrix::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aDestMark;
aDestMark.SelectOneTable( aBlockRange.aStart.Tab() );
aDestMark.SetMarkArea( aBlockRange );
- pDoc->InsertMatrixFormula( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
+ rDoc.InsertMatrixFormula( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(),
aDestMark, aFormula );
@@ -1804,8 +1804,8 @@ void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
if (rTarget.ISA(ScTabViewTarget))
{
OUString aTemp = aFormula;
- ScDocument* pDoc = pDocShell->GetDocument();
- ((ScTabViewTarget&)rTarget).GetViewShell()->EnterMatrix(aTemp, pDoc->GetGrammar());
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ((ScTabViewTarget&)rTarget).GetViewShell()->EnterMatrix(aTemp, rDoc.GetGrammar());
}
}
@@ -1847,12 +1847,12 @@ void ScUndoIndent::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScRange aCopyRange = aBlockRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, true, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, true, &rDoc, &aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndUndo();
@@ -1862,8 +1862,8 @@ void ScUndoIndent::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->ChangeSelectionIndent( bIsIncrement, aMarkData );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.ChangeSelectionIndent( bIsIncrement, aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndRedo();
@@ -1903,12 +1903,12 @@ void ScUndoTransliterate::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScRange aCopyRange = aBlockRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, IDF_CONTENTS, true, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_CONTENTS, true, &rDoc, &aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndUndo();
@@ -1918,8 +1918,8 @@ void ScUndoTransliterate::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->TransliterateText( aMarkData, nTransliterationType );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.TransliterateText( aMarkData, nTransliterationType );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndRedo();
@@ -1968,8 +1968,8 @@ void ScUndoClearItems::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
- pUndoDoc->CopyToDocument( aBlockRange, IDF_ATTRIB, true, pDoc, &aMarkData );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ pUndoDoc->CopyToDocument( aBlockRange, IDF_ATTRIB, true, &rDoc, &aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndUndo();
@@ -1979,8 +1979,8 @@ void ScUndoClearItems::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->ClearSelectionItems( pWhich, aMarkData );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.ClearSelectionItems( pWhich, aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndRedo();
@@ -1990,8 +1990,8 @@ void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
{
- ScViewData* pViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
- pViewData->GetDocFunc().ClearItems( pViewData->GetMarkData(), pWhich, false );
+ ScViewData& rViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
+ rViewData.GetDocFunc().ClearItems( rViewData.GetMarkData(), pWhich, false );
}
}
@@ -2023,10 +2023,10 @@ void ScUndoRemoveBreaks::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, &rDoc );
if (pViewShell)
pViewShell->UpdatePageBreakData( true );
pDocShell->PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID );
@@ -2038,11 +2038,11 @@ void ScUndoRemoveBreaks::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- pDoc->RemoveManualBreaks(nTab);
- pDoc->UpdatePageBreaks(nTab);
+ rDoc.RemoveManualBreaks(nTab);
+ rDoc.UpdatePageBreaks(nTab);
if (pViewShell)
pViewShell->UpdatePageBreakData( true );
pDocShell->PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID );
@@ -2091,7 +2091,7 @@ void ScUndoRemoveMerge::Undo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
itr != itrEnd; ++itr)
{
@@ -2100,8 +2100,8 @@ void ScUndoRemoveMerge::Undo()
continue;
// There is no need to extend merge area because it's already been extended.
ScRange aRange = maOption.getSingleRange(*itr);
- pDoc->DeleteAreaTab(aRange, IDF_ATTRIB);
- pUndoDoc->CopyToDocument(aRange, IDF_ATTRIB, false, pDoc);
+ rDoc.DeleteAreaTab(aRange, IDF_ATTRIB);
+ pUndoDoc->CopyToDocument(aRange, IDF_ATTRIB, false, &rDoc);
bool bDidPaint = false;
if ( pViewShell )
@@ -2123,7 +2123,7 @@ void ScUndoRemoveMerge::Redo()
SetCurTab();
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
@@ -2133,18 +2133,18 @@ void ScUndoRemoveMerge::Redo()
// There is no need to extend merge area because it's already been extended.
ScRange aRange = maOption.getSingleRange(nTab);
- const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
- ScPatternAttr aPattern( pDoc->GetPool() );
+ const SfxPoolItem& rDefAttr = rDoc.GetPool()->GetDefaultItem( ATTR_MERGE );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( rDefAttr );
- pDoc->ApplyPatternAreaTab( maOption.mnStartCol, maOption.mnStartRow,
+ rDoc.ApplyPatternAreaTab( maOption.mnStartCol, maOption.mnStartRow,
maOption.mnEndCol, maOption.mnEndRow, nTab,
aPattern );
- pDoc->RemoveFlagsTab( maOption.mnStartCol, maOption.mnStartRow,
+ rDoc.RemoveFlagsTab( maOption.mnStartCol, maOption.mnStartRow,
maOption.mnEndCol, maOption.mnEndRow, nTab,
SC_MF_HOR | SC_MF_VER );
- pDoc->ExtendMerge(aRange, true);
+ rDoc.ExtendMerge(aRange, true);
// Paint
@@ -2228,10 +2228,10 @@ void ScUndoBorder::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aMarkData;
aMarkData.MarkFromRangeList( *pRanges, false );
- pUndoDoc->CopyToDocument( aBlockRange, IDF_ATTRIB, true, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aBlockRange, IDF_ATTRIB, true, &rDoc, &aMarkData );
pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
EndUndo();
@@ -2241,7 +2241,7 @@ void ScUndoBorder::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument(); // call function at docfunc
+ ScDocument& rDoc = pDocShell->GetDocument(); // call function at docfunc
size_t nCount = pRanges->size();
for (size_t i = 0; i < nCount; ++i )
{
@@ -2252,7 +2252,7 @@ void ScUndoBorder::Redo()
aMark.SetMarkArea( aRange );
aMark.SelectTable( nTab, true );
- pDoc->ApplySelectionFrame( aMark, pOuter, pInner );
+ rDoc.ApplySelectionFrame( aMark, pOuter, pInner );
}
for (size_t i = 0; i < nCount; ++i)
pDocShell->PostPaint( *(*pRanges)[i], PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 674f9bb62f23..071198b43d7e 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -53,7 +53,7 @@ ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
eMode( eNewMode ),
pDrawUndo( NULL )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScUndoWidthOrHeight::~ScUndoWidthOrHeight()
@@ -81,7 +81,7 @@ void ScUndoWidthOrHeight::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCCOLROW nPaintStart = nStart > 0 ? nStart-1 : static_cast<SCCOLROW>(0);
@@ -93,9 +93,9 @@ void ScUndoWidthOrHeight::Undo()
//! outlines from all tables?
if (pUndoTab) // Outlines are included when saving ?
- pDoc->SetOutlineTable( nStartTab, pUndoTab );
+ rDoc.SetOutlineTable( nStartTab, pUndoTab );
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
@@ -103,27 +103,27 @@ void ScUndoWidthOrHeight::Undo()
{
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, *itr,
static_cast<SCCOL>(nEnd), MAXROW, *itr, IDF_NONE,
- false, pDoc );
- pDoc->UpdatePageBreaks( *itr );
+ false, &rDoc );
+ rDoc.UpdatePageBreaks( *itr );
pDocShell->PostPaint( static_cast<SCCOL>(nPaintStart), 0, *itr,
MAXCOL, MAXROW, *itr, PAINT_GRID | PAINT_TOP );
}
else // Height
{
- pUndoDoc->CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, IDF_NONE, false, pDoc );
- pDoc->UpdatePageBreaks( *itr );
+ pUndoDoc->CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, IDF_NONE, false, &rDoc );
+ rDoc.UpdatePageBreaks( *itr );
pDocShell->PostPaint( 0, nPaintStart, *itr, MAXCOL, MAXROW, *itr, PAINT_GRID | PAINT_LEFT );
}
}
- DoSdrUndoAction( pDrawUndo, pDoc );
+ DoSdrUndoAction( pDrawUndo, &rDoc );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
pViewShell->UpdateScrollBars();
- SCTAB nCurrentTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab )
pViewShell->SetTabNo( nStartTab );
}
@@ -145,7 +145,7 @@ void ScUndoWidthOrHeight::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
if ( nTab < nStartTab || nTab > nEndTab )
pViewShell->SetTabNo( nStartTab );
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 736d140c5b0d..e80c5265969b 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -87,7 +87,7 @@ ScUndoDeleteContents::ScUndoDeleteContents(
bMulti ( bNewMulti ) // unnecessary
{
if (bObjects)
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
if ( !(aMarkData.IsMarked() || aMarkData.IsMultiMarked()) ) // if no cell is selected:
aMarkData.SetMarkArea( aRange ); // select cell under cursor
@@ -113,7 +113,7 @@ void ScUndoDeleteContents::SetDataSpans( const boost::shared_ptr<DataSpansType>&
void ScUndoDeleteContents::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack && (nFlags & IDF_CONTENTS) )
pChangeTrack->AppendContentRange( aRange, pUndoDoc,
nStartChangeAction, nEndChangeAction );
@@ -123,7 +123,7 @@ void ScUndoDeleteContents::SetChangeTrack()
void ScUndoDeleteContents::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SetViewMarkData( aMarkData );
@@ -142,15 +142,15 @@ void ScUndoDeleteContents::DoChange( const bool bUndo )
nUndoFlags |= IDF_NOCAPTIONS;
ScRange aCopyRange = aRange;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, bMulti, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, bMulti, &rDoc, &aMarkData );
- DoSdrUndoAction( pDrawUndo, pDoc );
+ DoSdrUndoAction( pDrawUndo, &rDoc );
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -164,7 +164,7 @@ void ScUndoDeleteContents::DoChange( const bool bUndo )
RedoSdrUndoAction( pDrawUndo );
// do not delete objects and note captions, they have been removed via drawing undo
sal_uInt16 nRedoFlags = (nFlags & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
- pDoc->DeleteSelection( nRedoFlags, aMarkData );
+ rDoc.DeleteSelection( nRedoFlags, aMarkData );
aMarkData.MarkToSimple();
SetChangeTrack();
@@ -256,10 +256,10 @@ OUString ScUndoFillTable::GetComment() const
void ScUndoFillTable::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
- SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
+ SCTAB nTabCount = pDocShell->GetDocument().GetTableCount();
ScRange aWorkRange(aRange);
nStartChangeAction = 0;
sal_uLong nTmpAction;
@@ -283,13 +283,13 @@ void ScUndoFillTable::SetChangeTrack()
void ScUndoFillTable::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SetViewMarkData( aMarkData );
if (bUndo) // only Undo
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScRange aWorkRange(aRange);
ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -298,20 +298,20 @@ void ScUndoFillTable::DoChange( const bool bUndo )
aWorkRange.aStart.SetTab(*itr);
aWorkRange.aEnd.SetTab(*itr);
if (bMulti)
- pDoc->DeleteSelectionTab( *itr, IDF_ALL, aMarkData );
+ rDoc.DeleteSelectionTab( *itr, IDF_ALL, aMarkData );
else
- pDoc->DeleteAreaTab( aWorkRange, IDF_ALL );
- pUndoDoc->CopyToDocument( aWorkRange, IDF_ALL, bMulti, pDoc, &aMarkData );
+ rDoc.DeleteAreaTab( aWorkRange, IDF_ALL );
+ pUndoDoc->CopyToDocument( aWorkRange, IDF_ALL, bMulti, &rDoc, &aMarkData );
}
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
}
else // only Redo
{
aMarkData.MarkToMulti();
- pDoc->FillTabMarked( nSrcTab, aMarkData, nFlags, nFunction, bSkipEmpty, bAsLink );
+ rDoc.FillTabMarked( nSrcTab, aMarkData, nFlags, nFunction, bSkipEmpty, bAsLink );
aMarkData.MarkToSimple();
SetChangeTrack();
}
@@ -324,7 +324,7 @@ void ScUndoFillTable::DoChange( const bool bUndo )
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nTab = pViewShell->GetViewData().GetTabNo();
if ( !aMarkData.GetTableSelect(nTab) )
pViewShell->SetTabNo( nSrcTab );
@@ -371,7 +371,7 @@ ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell,
pUndoDoc ( pNewUndoDoc ),
bMulti ( bNewMulti )
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
pApplyPattern = (ScPatternAttr*) &pPool->Put( *pNewApply );
pLineOuter = pNewOuter ? (SvxBoxItem*) &pPool->Put( *pNewOuter ) : NULL;
pLineInner = pNewInner ? (SvxBoxInfoItem*) &pPool->Put( *pNewInner ) : NULL;
@@ -379,7 +379,7 @@ ScUndoSelectionAttr::ScUndoSelectionAttr( ScDocShell* pNewDocShell,
ScUndoSelectionAttr::~ScUndoSelectionAttr()
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
pPool->Remove(*pApplyPattern);
if (pLineOuter)
pPool->Remove(*pLineOuter);
@@ -402,13 +402,13 @@ ScEditDataArray* ScUndoSelectionAttr::GetDataArray()
void ScUndoSelectionAttr::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SetViewMarkData( aMarkData );
ScRange aEffRange( aRange );
- if ( pDoc->HasAttrib( aEffRange, HASATTR_MERGED ) ) // merged cells?
- pDoc->ExtendMerge( aEffRange );
+ if ( rDoc.HasAttrib( aEffRange, HASATTR_MERGED ) ) // merged cells?
+ rDoc.ExtendMerge( aEffRange );
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aEffRange );
@@ -418,19 +418,19 @@ void ScUndoSelectionAttr::DoChange( const bool bUndo )
if (bUndo) // only for Undo
{
ScRange aCopyRange = aRange;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, &rDoc, &aMarkData );
}
else // only for Redo
{
aMarkData.MarkToMulti();
- pDoc->ApplySelectionPattern( *pApplyPattern, aMarkData );
+ rDoc.ApplySelectionPattern( *pApplyPattern, aMarkData );
aMarkData.MarkToSimple();
if (pLineOuter)
- pDoc->ApplySelectionFrame( aMarkData, pLineOuter, pLineInner );
+ rDoc.ApplySelectionFrame( aMarkData, pLineOuter, pLineInner );
}
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -442,26 +442,26 @@ void ScUndoSelectionAttr::DoChange( const bool bUndo )
void ScUndoSelectionAttr::ChangeEditData( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (const ScEditDataArray::Item* pItem = mpDataArray->First(); pItem; pItem = mpDataArray->Next())
{
ScAddress aPos(pItem->GetCol(), pItem->GetRow(), pItem->GetTab());
- if (pDoc->GetCellType(aPos) != CELLTYPE_EDIT)
+ if (rDoc.GetCellType(aPos) != CELLTYPE_EDIT)
continue;
if (bUndo)
{
if (pItem->GetOldData())
- pDoc->SetEditText(aPos, *pItem->GetOldData(), NULL);
+ rDoc.SetEditText(aPos, *pItem->GetOldData(), NULL);
else
- pDoc->SetEmptyCell(aPos);
+ rDoc.SetEmptyCell(aPos);
}
else
{
if (pItem->GetNewData())
- pDoc->SetEditText(aPos, *pItem->GetNewData(), NULL);
+ rDoc.SetEditText(aPos, *pItem->GetNewData(), NULL);
else
- pDoc->SetEmptyCell(aPos);
+ rDoc.SetEmptyCell(aPos);
}
}
}
@@ -528,7 +528,7 @@ OUString ScUndoAutoFill::GetComment() const
void ScUndoAutoFill::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc,
nStartChangeAction, nEndChangeAction );
@@ -540,9 +540,9 @@ void ScUndoAutoFill::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
@@ -552,10 +552,10 @@ void ScUndoAutoFill::Undo()
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aWorkRange );
- pDoc->DeleteAreaTab( aWorkRange, IDF_AUTOFILL );
- pUndoDoc->CopyToDocument( aWorkRange, IDF_AUTOFILL, false, pDoc );
+ rDoc.DeleteAreaTab( aWorkRange, IDF_AUTOFILL );
+ pUndoDoc->CopyToDocument( aWorkRange, IDF_AUTOFILL, false, &rDoc );
- pDoc->ExtendMerge( aWorkRange, true );
+ rDoc.ExtendMerge( aWorkRange, true );
pDocShell->PostPaint( aWorkRange, PAINT_GRID, nExtFlags );
}
pDocShell->PostDataChanged();
@@ -563,7 +563,7 @@ void ScUndoAutoFill::Undo()
if (pViewShell)
pViewShell->CellContentChanged();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -593,13 +593,13 @@ void ScUndoAutoFill::Redo()
break;
}
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if ( fStartValue != MAXDOUBLE )
{
SCCOL nValX = (eFillDir == FILL_TO_LEFT) ? aSource.aEnd.Col() : aSource.aStart.Col();
SCROW nValY = (eFillDir == FILL_TO_TOP ) ? aSource.aEnd.Row() : aSource.aStart.Row();
SCTAB nTab = aSource.aStart.Tab();
- pDoc->SetValue( nValX, nValY, nTab, fStartValue );
+ rDoc.SetValue( nValX, nValY, nTab, fStartValue );
}
sal_uLong nProgCount;
if (eFillDir == FILL_TO_BOTTOM || eFillDir == FILL_TO_TOP)
@@ -607,10 +607,10 @@ void ScUndoAutoFill::Redo()
else
nProgCount = aSource.aEnd.Row() - aSource.aStart.Row() + 1;
nProgCount *= nCount;
- ScProgress aProgress( pDoc->GetDocumentShell(),
+ ScProgress aProgress( rDoc.GetDocumentShell(),
ScGlobal::GetRscString(STR_FILL_SERIES_PROGRESS), nProgCount );
- pDoc->Fill( aSource.aStart.Col(), aSource.aStart.Row(),
+ rDoc.Fill( aSource.aStart.Col(), aSource.aStart.Row(),
aSource.aEnd.Col(), aSource.aEnd.Row(), &aProgress,
aMarkData, nCount,
eFillDir, eFillCmd, eFillDateCmd,
@@ -674,7 +674,7 @@ void ScUndoMerge::DoChange( bool bUndo ) const
// Nothing to do.
return;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ScRange aCurRange = maOption.getSingleRange(ScDocShell::GetCurTab());
@@ -688,20 +688,20 @@ void ScUndoMerge::DoChange( bool bUndo ) const
if (bUndo)
// remove merge (contents are copied back below from undo document)
- pDoc->RemoveMerge( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
+ rDoc.RemoveMerge( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
else
{
// repeat merge, but do not remove note captions (will be done by drawing redo below)
- pDoc->DoMerge( aRange.aStart.Tab(),
+ rDoc.DoMerge( aRange.aStart.Tab(),
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(), false );
if (maOption.mbCenter)
{
- pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
+ rDoc.ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aStart.Tab(),
SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
- pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
+ rDoc.ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aStart.Tab(),
SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
}
@@ -710,20 +710,20 @@ void ScUndoMerge::DoChange( bool bUndo ) const
// undo -> copy back deleted contents
if (bUndo && mpUndoDoc)
{
- pDoc->DeleteAreaTab( aRange, IDF_CONTENTS|IDF_NOCAPTIONS );
- mpUndoDoc->CopyToDocument( aRange, IDF_ALL|IDF_NOCAPTIONS, false, pDoc );
+ rDoc.DeleteAreaTab( aRange, IDF_CONTENTS|IDF_NOCAPTIONS );
+ mpUndoDoc->CopyToDocument( aRange, IDF_ALL|IDF_NOCAPTIONS, false, &rDoc );
}
// redo -> merge contents again
else if (!bUndo && mbMergeContents)
{
- pDoc->DoMergeContents( aRange.aStart.Tab(),
+ rDoc.DoMergeContents( aRange.aStart.Tab(),
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row() );
}
if (bUndo)
- DoSdrUndoAction( mpDrawUndo, pDoc );
+ DoSdrUndoAction( mpDrawUndo, &rDoc );
else
RedoSdrUndoAction( mpDrawUndo );
@@ -795,16 +795,16 @@ void ScUndoAutoFormat::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
- pDoc->DeleteArea( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
+ SCTAB nTabCount = rDoc.GetTableCount();
+ rDoc.DeleteArea( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(),
aMarkData, IDF_ATTRIB );
ScRange aCopyRange = aBlockRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, pDoc, &aMarkData );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, &rDoc, &aMarkData );
// cell heights and widths (IDF_NONE)
if (bSize)
@@ -817,9 +817,9 @@ void ScUndoAutoFormat::Undo()
SCTAB nEndZ = aBlockRange.aEnd.Tab();
pUndoDoc->CopyToDocument( nStartX, 0, 0, nEndX, MAXROW, nTabCount-1,
- IDF_NONE, false, pDoc, &aMarkData );
+ IDF_NONE, false, &rDoc, &aMarkData );
pUndoDoc->CopyToDocument( 0, nStartY, 0, MAXCOL, nEndY, nTabCount-1,
- IDF_NONE, false, pDoc, &aMarkData );
+ IDF_NONE, false, &rDoc, &aMarkData );
pDocShell->PostPaint( 0, 0, nStartZ, MAXCOL, MAXROW, nEndZ,
PAINT_GRID | PAINT_LEFT | PAINT_TOP, SC_PF_LINES );
}
@@ -833,7 +833,7 @@ void ScUndoAutoFormat::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCCOL nStartX = aBlockRange.aStart.Col();
SCROW nStartY = aBlockRange.aStart.Row();
@@ -842,7 +842,7 @@ void ScUndoAutoFormat::Redo()
SCROW nEndY = aBlockRange.aEnd.Row();
SCTAB nEndZ = aBlockRange.aEnd.Tab();
- pDoc->AutoFormat( nStartX, nStartY, nEndX, nEndY, nFormatNo, aMarkData );
+ rDoc.AutoFormat( nStartX, nStartY, nEndX, nEndY, nFormatNo, aMarkData );
if (bSize)
{
@@ -853,11 +853,11 @@ void ScUndoAutoFormat::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- ScViewData* pData = pViewShell->GetViewData();
- nPPTX = pData->GetPPTX();
- nPPTY = pData->GetPPTY();
- aZoomX = pData->GetZoomX();
- aZoomY = pData->GetZoomY();
+ ScViewData& rData = pViewShell->GetViewData();
+ nPPTX = rData.GetPPTX();
+ nPPTY = rData.GetPPTY();
+ aZoomX = rData.GetZoomX();
+ aZoomY = rData.GetZoomY();
}
else
{
@@ -879,22 +879,22 @@ void ScUndoAutoFormat::Redo()
// as SC_SIZE_VISOPT
for (SCROW nRow=nStartY; nRow<=nEndY; nRow++)
{
- sal_uInt8 nOld = pDoc->GetRowFlags(nRow,nTab);
- bool bHidden = pDoc->RowHidden(nRow, nTab);
+ sal_uInt8 nOld = rDoc.GetRowFlags(nRow,nTab);
+ bool bHidden = rDoc.RowHidden(nRow, nTab);
if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
- pDoc->SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
+ rDoc.SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
}
- pDoc->SetOptimalHeight(aCxt, nStartY, nEndY, nTab);
+ rDoc.SetOptimalHeight(aCxt, nStartY, nEndY, nTab);
for (SCCOL nCol=nStartX; nCol<=nEndX; nCol++)
- if (!pDoc->ColHidden(nCol, nTab))
+ if (!rDoc.ColHidden(nCol, nTab))
{
- sal_uInt16 nThisSize = STD_EXTRA_WIDTH + pDoc->GetOptimalColWidth( nCol, nTab,
+ sal_uInt16 nThisSize = STD_EXTRA_WIDTH + rDoc.GetOptimalColWidth( nCol, nTab,
&aVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
&aDestMark );
- pDoc->SetColWidth( nCol, nTab, nThisSize );
- pDoc->ShowCol( nCol, nTab, true );
+ rDoc.SetColWidth( nCol, nTab, nThisSize );
+ rDoc.ShowCol( nCol, nTab, true );
}
}
@@ -941,8 +941,8 @@ ScUndoReplace::~ScUndoReplace()
void ScUndoReplace::SetChangeTrack()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
{
if ( pUndoDoc )
@@ -957,9 +957,9 @@ void ScUndoReplace::SetChangeTrack()
ScChangeActionContent* pContent = new ScChangeActionContent(
ScRange( aCursorPos) );
ScCellValue aCell;
- aCell.assign(*pDoc, aCursorPos);
- pContent->SetOldValue( aUndoStr, pDoc );
- pContent->SetNewValue(aCell, pDoc);
+ aCell.assign(rDoc, aCursorPos);
+ pContent->SetOldValue( aUndoStr, &rDoc );
+ pContent->SetNewValue(aCell, &rDoc);
pChangeTrack->Append( pContent );
nEndChangeAction = pChangeTrack->GetActionMax();
}
@@ -977,7 +977,7 @@ void ScUndoReplace::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ShowTable( aCursorPos.Tab() );
@@ -998,7 +998,7 @@ void ScUndoReplace::Undo()
sal_uInt16 nUndoFlags = (pSearchItem->GetPattern()) ? IDF_ATTRIB : IDF_CONTENTS;
pUndoDoc->CopyToDocument( 0, 0, 0,
MAXCOL, MAXROW, MAXTAB,
- nUndoFlags, false, pDoc, NULL, false ); // without row flags
+ nUndoFlags, false, &rDoc, NULL, false ); // without row flags
pDocShell->PostPaintGridAll();
}
else if (pSearchItem->GetPattern() &&
@@ -1007,7 +1007,7 @@ void ScUndoReplace::Undo()
OUString aTempStr = pSearchItem->GetSearchString(); // toggle
pSearchItem->SetSearchString(pSearchItem->GetReplaceString());
pSearchItem->SetReplaceString(aTempStr);
- pDoc->ReplaceStyle( *pSearchItem,
+ rDoc.ReplaceStyle( *pSearchItem,
aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(),
aMarkData, true);
pSearchItem->SetReplaceString(pSearchItem->GetSearchString());
@@ -1019,7 +1019,7 @@ void ScUndoReplace::Undo()
}
else if (pSearchItem->GetCellType() == SVX_SEARCHIN_NOTE)
{
- ScPostIt* pNote = pDoc->GetNote(aCursorPos);
+ ScPostIt* pNote = rDoc.GetNote(aCursorPos);
OSL_ENSURE( pNote, "ScUndoReplace::Undo - cell does not contain a note" );
if (pNote)
pNote->SetText( aCursorPos, aUndoStr );
@@ -1032,19 +1032,19 @@ void ScUndoReplace::Undo()
// aUndoStr may contain line breaks
if ( aUndoStr.indexOf('\n') != -1 )
{
- ScFieldEditEngine& rEngine = pDoc->GetEditEngine();
+ ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
rEngine.SetText(aUndoStr);
- pDoc->SetEditText(aCursorPos, rEngine.CreateTextObject());
+ rDoc.SetEditText(aCursorPos, rEngine.CreateTextObject());
}
else
- pDoc->SetString( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aUndoStr );
+ rDoc.SetString( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aUndoStr );
if (pViewShell)
pViewShell->MoveCursorAbs( aCursorPos.Col(), aCursorPos.Row(),
SC_FOLLOW_JUMP, false, false );
pDocShell->PostPaintGridAll();
}
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -1055,7 +1055,7 @@ void ScUndoReplace::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -1073,7 +1073,7 @@ void ScUndoReplace::Redo()
else if (pSearchItem->GetPattern() &&
pSearchItem->GetCommand() == SVX_SEARCHCMD_REPLACE)
{
- pDoc->ReplaceStyle( *pSearchItem,
+ rDoc.ReplaceStyle( *pSearchItem,
aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(),
aMarkData, true);
pDocShell->PostPaintGridAll();
@@ -1137,9 +1137,9 @@ void ScUndoTabOp::Undo()
sal_uInt16 nExtFlags = 0;
pDocShell->UpdatePaintExt( nExtFlags, aRange );
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->DeleteAreaTab( aRange,IDF_ALL & ~IDF_NOTE );
- pUndoDoc->CopyToDocument( aRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.DeleteAreaTab( aRange,IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->CopyToDocument( aRange, IDF_ALL & ~IDF_NOTE, false, &rDoc );
pDocShell->PostPaint( aRange, PAINT_GRID, nExtFlags );
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1197,8 +1197,8 @@ ScUndoConversion::~ScUndoConversion()
void ScUndoConversion::SetChangeTrack()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
{
if ( pUndoDoc )
@@ -1231,18 +1231,18 @@ void ScUndoConversion::DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPo
{
if (pRefDoc)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ShowTable( rCursorPos.Tab() );
SetViewMarkData( aMarkData );
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
// Undo/Redo-doc has only selected tables
bool bMulti = aMarkData.IsMultiMarked();
pRefDoc->CopyToDocument( 0, 0, 0,
MAXCOL, MAXROW, nTabCount-1,
- IDF_CONTENTS, bMulti, pDoc, &aMarkData );
+ IDF_CONTENTS, bMulti, &rDoc, &aMarkData );
pDocShell->PostPaintGridAll();
}
else
@@ -1255,7 +1255,7 @@ void ScUndoConversion::Undo()
{
BeginUndo();
DoChange( pUndoDoc, aCursorPos );
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
EndUndo();
@@ -1307,7 +1307,7 @@ OUString ScUndoRefConversion::GetComment() const
void ScUndoRefConversion::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack && (nFlags & IDF_FORMULA) )
pChangeTrack->AppendContentsIfInRefDoc( pUndoDoc,
nStartChangeAction, nEndChangeAction );
@@ -1317,17 +1317,17 @@ void ScUndoRefConversion::SetChangeTrack()
void ScUndoRefConversion::DoChange( ScDocument* pRefDoc)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ShowTable(aRange);
SetViewMarkData( aMarkData );
ScRange aCopyRange = aRange;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pRefDoc->CopyToDocument( aCopyRange, nFlags, bMulti, pDoc, &aMarkData );
+ pRefDoc->CopyToDocument( aCopyRange, nFlags, bMulti, &rDoc, &aMarkData );
pDocShell->PostPaint( aRange, PAINT_GRID);
pDocShell->PostDataChanged();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1340,7 +1340,7 @@ void ScUndoRefConversion::Undo()
BeginUndo();
if (pUndoDoc)
DoChange(pUndoDoc);
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
EndUndo();
@@ -1394,8 +1394,8 @@ void ScUndoRefreshLink::Undo()
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
bool bFirst = true;
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nCount; nTab++)
if (pUndoDoc->HasTable(nTab))
{
@@ -1403,28 +1403,28 @@ void ScUndoRefreshLink::Undo()
if (bMakeRedo)
{
if (bFirst)
- pRedoDoc->InitUndo( pDoc, nTab, nTab, true, true );
+ pRedoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
else
pRedoDoc->AddUndoTab( nTab, nTab, true, true );
bFirst = false;
- pDoc->CopyToDocument(aRange, IDF_ALL, false, pRedoDoc);
+ rDoc.CopyToDocument(aRange, IDF_ALL, false, pRedoDoc);
pRedoDoc->SetLink( nTab,
- pDoc->GetLinkMode(nTab),
- pDoc->GetLinkDoc(nTab),
- pDoc->GetLinkFlt(nTab),
- pDoc->GetLinkOpt(nTab),
- pDoc->GetLinkTab(nTab),
- pDoc->GetLinkRefreshDelay(nTab) );
- pRedoDoc->SetTabBgColor( nTab, pDoc->GetTabBgColor(nTab) );
+ rDoc.GetLinkMode(nTab),
+ rDoc.GetLinkDoc(nTab),
+ rDoc.GetLinkFlt(nTab),
+ rDoc.GetLinkOpt(nTab),
+ rDoc.GetLinkTab(nTab),
+ rDoc.GetLinkRefreshDelay(nTab) );
+ pRedoDoc->SetTabBgColor( nTab, rDoc.GetTabBgColor(nTab) );
}
- pDoc->DeleteAreaTab( aRange,IDF_ALL );
- pUndoDoc->CopyToDocument( aRange, IDF_ALL, false, pDoc );
- pDoc->SetLink( nTab, pUndoDoc->GetLinkMode(nTab), pUndoDoc->GetLinkDoc(nTab),
+ rDoc.DeleteAreaTab( aRange,IDF_ALL );
+ pUndoDoc->CopyToDocument( aRange, IDF_ALL, false, &rDoc );
+ rDoc.SetLink( nTab, pUndoDoc->GetLinkMode(nTab), pUndoDoc->GetLinkDoc(nTab),
pUndoDoc->GetLinkFlt(nTab), pUndoDoc->GetLinkOpt(nTab),
pUndoDoc->GetLinkTab(nTab),
pUndoDoc->GetLinkRefreshDelay(nTab) );
- pDoc->SetTabBgColor( nTab, pUndoDoc->GetTabBgColor(nTab) );
+ rDoc.SetTabBgColor( nTab, pUndoDoc->GetTabBgColor(nTab) );
}
pDocShell->PostPaintGridAll();
@@ -1439,23 +1439,23 @@ void ScUndoRefreshLink::Redo()
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nCount; nTab++)
if (pRedoDoc->HasTable(nTab))
{
ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab);
- pDoc->DeleteAreaTab( aRange, IDF_ALL );
- pRedoDoc->CopyToDocument( aRange, IDF_ALL, false, pDoc );
- pDoc->SetLink( nTab,
+ rDoc.DeleteAreaTab( aRange, IDF_ALL );
+ pRedoDoc->CopyToDocument( aRange, IDF_ALL, false, &rDoc );
+ rDoc.SetLink( nTab,
pRedoDoc->GetLinkMode(nTab),
pRedoDoc->GetLinkDoc(nTab),
pRedoDoc->GetLinkFlt(nTab),
pRedoDoc->GetLinkOpt(nTab),
pRedoDoc->GetLinkTab(nTab),
pRedoDoc->GetLinkRefreshDelay(nTab) );
- pDoc->SetTabBgColor( nTab, pRedoDoc->GetTabBgColor(nTab) );
+ rDoc.SetTabBgColor( nTab, pRedoDoc->GetTabBgColor(nTab) );
}
pDocShell->PostPaintGridAll();
@@ -1518,8 +1518,8 @@ OUString ScUndoInsertAreaLink::GetComment() const
void ScUndoInsertAreaLink::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
ScAreaLink* pLink = lcl_FindAreaLink( pLinkManager, aDocName, aFltName, aOptions,
aAreaName, aRange );
@@ -1531,8 +1531,8 @@ void ScUndoInsertAreaLink::Undo()
void ScUndoInsertAreaLink::Redo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
ScAreaLink* pLink = new ScAreaLink( pDocShell, aDocName, aFltName, aOptions,
aAreaName, aRange.aStart, nRefreshDelay );
@@ -1580,8 +1580,8 @@ OUString ScUndoRemoveAreaLink::GetComment() const
void ScUndoRemoveAreaLink::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
ScAreaLink* pLink = new ScAreaLink( pDocShell, aDocName, aFltName, aOptions,
aAreaName, aRange.aStart, nRefreshDelay );
@@ -1596,8 +1596,8 @@ void ScUndoRemoveAreaLink::Undo()
void ScUndoRemoveAreaLink::Redo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
ScAreaLink* pLink = lcl_FindAreaLink( pLinkManager, aDocName, aFltName, aOptions,
aAreaName, aRange );
@@ -1656,7 +1656,7 @@ OUString ScUndoUpdateAreaLink::GetComment() const
void ScUndoUpdateAreaLink::DoChange( const bool bUndo ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCCOL nEndX = std::max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() );
SCROW nEndY = std::max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() );
@@ -1666,35 +1666,35 @@ void ScUndoUpdateAreaLink::DoChange( const bool bUndo ) const
{
if ( bWithInsert )
{
- pDoc->FitBlock( aNewRange, aOldRange );
- pDoc->DeleteAreaTab( aOldRange, IDF_ALL & ~IDF_NOTE );
- pUndoDoc->UndoToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ rDoc.FitBlock( aNewRange, aOldRange );
+ rDoc.DeleteAreaTab( aOldRange, IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->UndoToDocument( aOldRange, IDF_ALL & ~IDF_NOTE, false, &rDoc );
}
else
{
ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) );
- pDoc->DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
- pUndoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ rDoc.DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
+ pUndoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, false, &rDoc );
}
}
else
{
if ( bWithInsert )
{
- pDoc->FitBlock( aOldRange, aNewRange );
- pDoc->DeleteAreaTab( aNewRange, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ rDoc.FitBlock( aOldRange, aNewRange );
+ rDoc.DeleteAreaTab( aNewRange, IDF_ALL & ~IDF_NOTE );
+ pRedoDoc->CopyToDocument( aNewRange, IDF_ALL & ~IDF_NOTE, false, &rDoc );
}
else
{
ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) );
- pDoc->DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ rDoc.DeleteAreaTab( aCopyRange, IDF_ALL & ~IDF_NOTE );
+ pRedoDoc->CopyToDocument( aCopyRange, IDF_ALL & ~IDF_NOTE, false, &rDoc );
}
}
ScRange aWorkRange( aNewRange.aStart, ScAddress( nEndX, nEndY, nEndZ ) );
- pDoc->ExtendMerge( aWorkRange, true );
+ rDoc.ExtendMerge( aWorkRange, true );
// Paint
@@ -1714,8 +1714,8 @@ void ScUndoUpdateAreaLink::DoChange( const bool bUndo ) const
void ScUndoUpdateAreaLink::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
ScAreaLink* pLink = lcl_FindAreaLink( pLinkManager, aNewDoc, aNewFlt, aNewOpt,
aNewArea, aNewRange );
if (pLink)
@@ -1730,8 +1730,8 @@ void ScUndoUpdateAreaLink::Undo()
void ScUndoUpdateAreaLink::Redo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
ScAreaLink* pLink = lcl_FindAreaLink( pLinkManager, aOldDoc, aOldFlt, aOldOpt,
aOldArea, aOldRange );
if (pLink)
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 1119a9ee5024..aa8497870598 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -49,7 +49,7 @@ using ::boost::shared_ptr;
namespace HelperNotifyChanges
{
- void NotifyIfChangesListeners(ScDocShell &rDocShell, const ScAddress &rPos,
+ void NotifyIfChangesListeners(ScDocShell& rDocShell, const ScAddress &rPos,
const ScUndoEnterData::ValuesType &rOldValues, const OUString &rType = OUString("cell-change"))
{
if (ScModelObj* pModelObj = getMustPropagateChangesModel(rDocShell))
@@ -90,7 +90,7 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell,
pNewEditData( static_cast<EditTextObject*>(NULL) ),
bIsAutomatic( bAutomatic )
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
pNewPattern = (ScPatternAttr*) &pPool->Put( *pNewPat );
pOldPattern = (ScPatternAttr*) &pPool->Put( *pOldPat );
pApplyPattern = (ScPatternAttr*) &pPool->Put( *pApplyPat );
@@ -98,7 +98,7 @@ ScUndoCursorAttr::ScUndoCursorAttr( ScDocShell* pNewDocShell,
ScUndoCursorAttr::~ScUndoCursorAttr()
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
pPool->Remove(*pNewPattern);
pPool->Remove(*pOldPattern);
pPool->Remove(*pApplyPattern);
@@ -120,12 +120,12 @@ void ScUndoCursorAttr::SetEditData( EditTextObject* pOld, EditTextObject* pNew )
void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const shared_ptr<EditTextObject>& pEditData ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScAddress aPos(nCol, nRow, nTab);
- pDoc->SetPattern( nCol, nRow, nTab, *pWhichPattern, true );
+ rDoc.SetPattern( nCol, nRow, nTab, *pWhichPattern, true );
- if (pDoc->GetCellType(aPos) == CELLTYPE_EDIT && pEditData)
- pDoc->SetEditText(aPos, *pEditData, NULL);
+ if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT && pEditData)
+ rDoc.SetEditText(aPos, *pEditData, NULL);
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -225,7 +225,7 @@ void ScUndoEnterData::DoChange() const
void ScUndoEnterData::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
@@ -249,29 +249,29 @@ void ScUndoEnterData::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (size_t i = 0, n = maOldValues.size(); i < n; ++i)
{
Value& rVal = maOldValues[i];
ScCellValue aNewCell;
- aNewCell.assign(rVal.maCell, *pDoc, SC_CLONECELL_STARTLISTENING);
+ aNewCell.assign(rVal.maCell, rDoc, SC_CLONECELL_STARTLISTENING);
ScAddress aPos = maPos;
aPos.SetTab(rVal.mnTab);
- aNewCell.release(*pDoc, aPos);
+ aNewCell.release(rDoc, aPos);
if (rVal.mbHasFormat)
- pDoc->ApplyAttr(maPos.Col(), maPos.Row(), rVal.mnTab,
+ rDoc.ApplyAttr(maPos.Col(), maPos.Row(), rVal.mnTab,
SfxUInt32Item(ATTR_VALUE_FORMAT, rVal.mnFormat));
else
{
- ScPatternAttr aPattern(*pDoc->GetPattern(maPos.Col(), maPos.Row(), rVal.mnTab));
+ ScPatternAttr aPattern(*rDoc.GetPattern(maPos.Col(), maPos.Row(), rVal.mnTab));
aPattern.GetItemSet().ClearItem( ATTR_VALUE_FORMAT );
- pDoc->SetPattern(maPos.Col(), maPos.Row(), rVal.mnTab, aPattern, true);
+ rDoc.SetPattern(maPos.Col(), maPos.Row(), rVal.mnTab, aPattern, true);
}
pDocShell->PostPaintCell(maPos.Col(), maPos.Row(), rVal.mnTab);
}
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
size_t nCount = maOldValues.size();
if ( pChangeTrack && mnEndChangeAction >= sal::static_int_cast<sal_uLong>(nCount) )
pChangeTrack->Undo( mnEndChangeAction - nCount + 1, mnEndChangeAction );
@@ -286,7 +286,7 @@ void ScUndoEnterData::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for (size_t i = 0, n = maOldValues.size(); i < n; ++i)
{
SCTAB nTab = maOldValues[i].mnTab;
@@ -295,10 +295,10 @@ void ScUndoEnterData::Redo()
ScAddress aPos = maPos;
aPos.SetTab(nTab);
// edit text wil be cloned.
- pDoc->SetEditText(aPos, *mpNewEditData, NULL);
+ rDoc.SetEditText(aPos, *mpNewEditData, NULL);
}
else
- pDoc->SetString(maPos.Col(), maPos.Row(), nTab, maNewString);
+ rDoc.SetString(maPos.Col(), maPos.Row(), nTab, maNewString);
pDocShell->PostPaintCell(maPos.Col(), maPos.Row(), nTab);
}
@@ -348,8 +348,8 @@ OUString ScUndoEnterValue::GetComment() const
void ScUndoEnterValue::SetChangeTrack()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
{
nEndChangeAction = pChangeTrack->GetActionMax() + 1;
@@ -365,14 +365,14 @@ void ScUndoEnterValue::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScCellValue aNewCell;
- aNewCell.assign(maOldCell, *pDoc, SC_CLONECELL_STARTLISTENING);
- aNewCell.release(*pDoc, aPos);
+ aNewCell.assign(maOldCell, rDoc, SC_CLONECELL_STARTLISTENING);
+ aNewCell.release(rDoc, aPos);
pDocShell->PostPaintCell( aPos );
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
@@ -383,8 +383,8 @@ void ScUndoEnterValue::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->SetValue( aPos.Col(), aPos.Row(), aPos.Tab(), nValue );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.SetValue( aPos.Col(), aPos.Row(), aPos.Tab(), nValue );
pDocShell->PostPaintCell( aPos );
SetChangeTrack();
@@ -416,8 +416,8 @@ void ScUndoSetCell::Undo()
SetValue(maOldValue);
pDocShell->PostPaintCell(maPos);
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if (pChangeTrack)
pChangeTrack->Undo(mnEndChangeAction, mnEndChangeAction);
@@ -450,8 +450,8 @@ OUString ScUndoSetCell::GetComment() const
void ScUndoSetCell::SetChangeTrack()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if (pChangeTrack)
{
mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
@@ -467,29 +467,29 @@ void ScUndoSetCell::SetChangeTrack()
void ScUndoSetCell::SetValue( const ScCellValue& rVal )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
switch (rVal.meType)
{
case CELLTYPE_NONE:
// empty cell
- pDoc->SetEmptyCell(maPos);
+ rDoc.SetEmptyCell(maPos);
break;
case CELLTYPE_VALUE:
- pDoc->SetValue(maPos, rVal.mfValue);
+ rDoc.SetValue(maPos, rVal.mfValue);
break;
case CELLTYPE_STRING:
{
ScSetStringParam aParam;
aParam.setTextInput();
- pDoc->SetString(maPos, rVal.mpString->getString());
+ rDoc.SetString(maPos, rVal.mpString->getString());
}
break;
case CELLTYPE_EDIT:
- pDoc->SetEditText(maPos, rVal.mpEditText->Clone());
+ rDoc.SetEditText(maPos, rVal.mpEditText->Clone());
break;
case CELLTYPE_FORMULA:
- pDoc->SetFormulaCell(maPos, rVal.mpFormula->Clone());
+ rDoc.SetFormulaCell(maPos, rVal.mpFormula->Clone());
break;
default:
;
@@ -540,7 +540,7 @@ void ScUndoPageBreak::DoChange( bool bInsertP ) const
else
pViewShell->DeletePageBreak(bColumn, false);
- pDocShell->GetDocument()->InvalidatePageBreaks(nTab);
+ pDocShell->GetDocument().InvalidatePageBreaks(nTab);
}
}
@@ -601,9 +601,9 @@ void ScUndoPrintZoom::DoChange( bool bUndo )
sal_uInt16 nScale = bUndo ? nOldScale : nNewScale;
sal_uInt16 nPages = bUndo ? nOldPages : nNewPages;
- ScDocument* pDoc = pDocShell->GetDocument();
- OUString aStyleName = pDoc->GetPageStyle( nTab );
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ OUString aStyleName = rDoc.GetPageStyle( nTab );
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found" );
if ( pStyleSheet )
@@ -636,8 +636,8 @@ void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
if (rTarget.ISA(ScTabViewTarget))
{
ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
- ScViewData* pViewData = rViewShell.GetViewData();
- pViewData->GetDocShell()->SetPrintZoom( pViewData->GetTabNo(), nNewScale, nNewPages );
+ ScViewData& rViewData = rViewShell.GetViewData();
+ rViewData.GetDocShell()->SetPrintZoom( rViewData.GetTabNo(), nNewScale, nNewPages );
}
}
@@ -668,7 +668,7 @@ OUString ScUndoThesaurus::GetComment() const
void ScUndoThesaurus::SetChangeTrack( const ScCellValue& rOldCell )
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
nEndChangeAction = pChangeTrack->GetActionMax() + 1;
@@ -682,7 +682,7 @@ void ScUndoThesaurus::SetChangeTrack( const ScCellValue& rOldCell )
void ScUndoThesaurus::DoChange( bool bUndo, const ScCellValue& rText )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -692,7 +692,7 @@ void ScUndoThesaurus::DoChange( bool bUndo, const ScCellValue& rText )
}
ScAddress aPos(nCol, nRow, nTab);
- rText.commit(*pDoc, aPos);
+ rText.commit(rDoc, aPos);
if (!bUndo)
SetChangeTrack(maOldText);
@@ -703,7 +703,7 @@ void ScUndoThesaurus::Undo()
{
BeginUndo();
DoChange(true, maOldText);
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
EndUndo();
@@ -757,7 +757,7 @@ ScUndoReplaceNote::~ScUndoReplaceNote()
void ScUndoReplaceNote::Undo()
{
BeginUndo();
- DoSdrUndoAction( mpDrawUndo, pDocShell->GetDocument() );
+ DoSdrUndoAction( mpDrawUndo, &pDocShell->GetDocument() );
/* Undo insert -> remove new note.
Undo remove -> insert old note.
Undo replace -> remove new note, insert old note. */
@@ -799,7 +799,7 @@ void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData )
{
if( rNoteData.mpCaption )
{
- ScDocument& rDoc = *pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" );
ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false );
rDoc.SetNote( maPos, pNote );
@@ -810,7 +810,7 @@ void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData )
{
if( rNoteData.mpCaption )
{
- ScDocument& rDoc = *pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OSL_ENSURE( rDoc.GetNote(maPos), "ScUndoReplaceNote::DoRemoveNote - missing cell note" );
if( ScPostIt* pNote = rDoc.ReleaseNote( maPos ) )
{
@@ -837,7 +837,7 @@ ScUndoShowHideNote::~ScUndoShowHideNote()
void ScUndoShowHideNote::Undo()
{
BeginUndo();
- if( ScPostIt* pNote = pDocShell->GetDocument()->GetNote(maPos) )
+ if( ScPostIt* pNote = pDocShell->GetDocument().GetNote(maPos) )
pNote->ShowCaption( maPos, !mbShown );
EndUndo();
}
@@ -845,7 +845,7 @@ void ScUndoShowHideNote::Undo()
void ScUndoShowHideNote::Redo()
{
BeginRedo();
- if( ScPostIt* pNote = pDocShell->GetDocument()->GetNote(maPos) )
+ if( ScPostIt* pNote = pDocShell->GetDocument().GetNote(maPos) )
pNote->ShowCaption( maPos, mbShown );
EndRedo();
}
@@ -906,19 +906,19 @@ void ScUndoDetective::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
- DoSdrUndoAction(pDrawUndo, pDoc);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ DoSdrUndoAction(pDrawUndo, &rDoc);
if (bIsDelete)
{
if ( pOldList )
- pDoc->SetDetOpList( new ScDetOpList(*pOldList) );
+ rDoc.SetDetOpList( new ScDetOpList(*pOldList) );
}
else
{
// Remove entry from list
- ScDetOpList* pList = pDoc->GetDetOpList();
+ ScDetOpList* pList = rDoc.GetDetOpList();
if (pList && pList->Count())
{
ScDetOpDataVector& rVec = pList->GetDataVector();
@@ -945,12 +945,12 @@ void ScUndoDetective::Redo()
RedoSdrUndoAction(pDrawUndo);
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if (bIsDelete)
- pDoc->ClearDetectiveOperations();
+ rDoc.ClearDetectiveOperations();
else
- pDoc->AddDetectiveOperation( ScDetOpData( aPos, (ScDetOpType) nAction ) );
+ rDoc.AddDetectiveOperation( ScDetOpData( aPos, (ScDetOpType) nAction ) );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -991,25 +991,25 @@ OUString ScUndoRangeNames::GetComment() const
void ScUndoRangeNames::DoChange( bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->PreprocessRangeNameUpdate();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.PreprocessRangeNameUpdate();
if ( bUndo )
{
if (mnTab >= 0)
- pDoc->SetRangeName( mnTab, new ScRangeName( *pOldRanges ) );
+ rDoc.SetRangeName( mnTab, new ScRangeName( *pOldRanges ) );
else
- pDoc->SetRangeName( new ScRangeName( *pOldRanges ) );
+ rDoc.SetRangeName( new ScRangeName( *pOldRanges ) );
}
else
{
if (mnTab >= 0)
- pDoc->SetRangeName( mnTab, new ScRangeName( *pNewRanges ) );
+ rDoc.SetRangeName( mnTab, new ScRangeName( *pNewRanges ) );
else
- pDoc->SetRangeName( new ScRangeName( *pNewRanges ) );
+ rDoc.SetRangeName( new ScRangeName( *pNewRanges ) );
}
- pDoc->PostprocessRangeNameUpdate();
+ rDoc.PostprocessRangeNameUpdate();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
}
diff --git a/sc/source/ui/undo/undocell2.cxx b/sc/source/ui/undo/undocell2.cxx
index 0b45efc419e9..0aa39a56fa01 100644
--- a/sc/source/ui/undo/undocell2.cxx
+++ b/sc/source/ui/undo/undocell2.cxx
@@ -20,8 +20,8 @@ UndoSetCells::~UndoSetCells() {}
void UndoSetCells::DoChange( const CellValues& rValues )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->CopyCellValuesFrom(maTopPos, rValues);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.CopyCellValuesFrom(maTopPos, rValues);
ScRange aRange(maTopPos);
aRange.aEnd.IncRow(rValues.size());
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 59845fa4a057..94c0df4a5598 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -96,12 +96,12 @@ void ScUndoDoOutline::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
// sheet has to be switched over (#46952#)!
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -115,9 +115,9 @@ void ScUndoDoOutline::Undo()
// Original column/row status
if (bColumns)
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pDoc);
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, &rDoc);
else
- pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, &rDoc );
pViewShell->UpdateScrollBars();
@@ -134,7 +134,7 @@ void ScUndoDoOutline::Redo()
// sheet has to be switched over (#46952#)!
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -185,15 +185,15 @@ void ScUndoMakeOutline::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd );
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -268,26 +268,26 @@ void ScUndoOutlineLevel::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
// Original Outline table
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
// Original column/row status
if (bColumns)
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab,
- static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, pDoc);
+ static_cast<SCCOL>(nEnd), MAXROW, nTab, IDF_NONE, false, &rDoc);
else
- pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, IDF_NONE, false, &rDoc );
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
pViewShell->UpdateScrollBars();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -304,7 +304,7 @@ void ScUndoOutlineLevel::Redo()
// sheet has to be switched on or off before this (#46952#) !!!
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -355,12 +355,12 @@ void ScUndoOutlineBlock::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
// Original Outline table
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
// Original column/row status
SCCOLROW nStartCol = aBlockStart.Col();
@@ -371,21 +371,21 @@ void ScUndoOutlineBlock::Undo()
if (!bShow)
{ // Size of the hidden blocks
size_t nLevel;
- pUndoTable->GetColArray()->FindTouchedLevel( nStartCol, nEndCol, nLevel );
- pUndoTable->GetColArray()->ExtendBlock( nLevel, nStartCol, nEndCol );
- pUndoTable->GetRowArray()->FindTouchedLevel( nStartRow, nEndRow, nLevel );
- pUndoTable->GetRowArray()->ExtendBlock( nLevel, nStartRow, nEndRow );
+ pUndoTable->GetColArray().FindTouchedLevel( nStartCol, nEndCol, nLevel );
+ pUndoTable->GetColArray().ExtendBlock( nLevel, nStartCol, nEndCol );
+ pUndoTable->GetRowArray().FindTouchedLevel( nStartRow, nEndRow, nLevel );
+ pUndoTable->GetRowArray().ExtendBlock( nLevel, nStartRow, nEndRow );
}
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
- static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false, pDoc );
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
+ static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false, &rDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, &rDoc );
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
pViewShell->UpdateScrollBars();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -454,12 +454,12 @@ void ScUndoRemoveAllOutlines::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
// Original Outline table
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
// Original column/row status
SCCOL nStartCol = aBlockStart.Col();
@@ -467,14 +467,14 @@ void ScUndoRemoveAllOutlines::Undo()
SCROW nStartRow = aBlockStart.Row();
SCROW nEndRow = aBlockEnd.Row();
- pUndoDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, pDoc );
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, IDF_NONE, false, &rDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, &rDoc );
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
pViewShell->UpdateScrollBars();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -492,7 +492,7 @@ void ScUndoRemoveAllOutlines::Redo()
// sheet has to be switched over (#46952#)!
SCTAB nTab = aBlockStart.Tab();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -539,12 +539,12 @@ void ScUndoAutoOutline::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
// Original outline table
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
// Original column/row status
if (pUndoDoc && pUndoTable)
@@ -553,18 +553,18 @@ void ScUndoAutoOutline::Undo()
SCCOLROW nStartRow;
SCCOLROW nEndCol;
SCCOLROW nEndRow;
- pUndoTable->GetColArray()->GetRange( nStartCol, nEndCol );
- pUndoTable->GetRowArray()->GetRange( nStartRow, nEndRow );
+ pUndoTable->GetColArray().GetRange( nStartCol, nEndCol );
+ pUndoTable->GetRowArray().GetRange( nStartRow, nEndRow );
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false,
- pDoc);
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
+ &rDoc);
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, &rDoc );
pViewShell->UpdateScrollBars();
}
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -584,7 +584,7 @@ void ScUndoAutoOutline::Redo()
{
// sheet has to be switched on or off before this (#46952#) !!!
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
}
@@ -648,21 +648,21 @@ void ScUndoSubTotals::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (nNewEndRow > aParam.nRow2)
{
- pDoc->DeleteRow( 0,nTab, MAXCOL,nTab, aParam.nRow2+1, static_cast<SCSIZE>(nNewEndRow-aParam.nRow2) );
+ rDoc.DeleteRow( 0,nTab, MAXCOL,nTab, aParam.nRow2+1, static_cast<SCSIZE>(nNewEndRow-aParam.nRow2) );
}
else if (nNewEndRow < aParam.nRow2)
{
- pDoc->InsertRow( 0,nTab, MAXCOL,nTab, nNewEndRow+1, static_cast<SCSIZE>(aParam.nRow2-nNewEndRow) );
+ rDoc.InsertRow( 0,nTab, MAXCOL,nTab, nNewEndRow+1, static_cast<SCSIZE>(aParam.nRow2-nNewEndRow) );
}
// Original Outline table
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
// Original column/row status
if (pUndoTable)
@@ -671,13 +671,13 @@ void ScUndoSubTotals::Undo()
SCCOLROW nStartRow;
SCCOLROW nEndCol;
SCCOLROW nEndRow;
- pUndoTable->GetColArray()->GetRange( nStartCol, nEndCol );
- pUndoTable->GetRowArray()->GetRange( nStartRow, nEndRow );
+ pUndoTable->GetColArray().GetRange( nStartCol, nEndCol );
+ pUndoTable->GetRowArray().GetRange( nStartRow, nEndRow );
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false,
- pDoc);
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
+ &rDoc);
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, &rDoc );
pViewShell->UpdateScrollBars();
}
@@ -687,22 +687,22 @@ void ScUndoSubTotals::Undo()
ScUndoUtil::MarkSimpleBlock( pDocShell, 0, aParam.nRow1+1, nTab,
MAXCOL, aParam.nRow2, nTab );
- pDoc->DeleteAreaTab( 0,aParam.nRow1+1, MAXCOL,aParam.nRow2, nTab, IDF_ALL );
+ rDoc.DeleteAreaTab( 0,aParam.nRow1+1, MAXCOL,aParam.nRow2, nTab, IDF_ALL );
pUndoDoc->CopyToDocument( 0, aParam.nRow1+1, nTab, MAXCOL, aParam.nRow2, nTab,
- IDF_NONE, false, pDoc ); // Flags
+ IDF_NONE, false, &rDoc ); // Flags
pUndoDoc->UndoToDocument( 0, aParam.nRow1+1, nTab, MAXCOL, aParam.nRow2, nTab,
- IDF_ALL, false, pDoc );
+ IDF_ALL, false, &rDoc );
ScUndoUtil::MarkSimpleBlock( pDocShell, aParam.nCol1,aParam.nRow1,nTab,
aParam.nCol2,aParam.nRow2,nTab );
if (pUndoRange)
- pDoc->SetRangeName( new ScRangeName( *pUndoRange ) );
+ rDoc.SetRangeName( new ScRangeName( *pUndoRange ) );
if (pUndoDB)
- pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), true );
+ rDoc.SetDBCollection( new ScDBCollection( *pUndoDB ), true );
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -718,7 +718,7 @@ void ScUndoSubTotals::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -772,7 +772,7 @@ void ScUndoSort::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCCOL nStartCol = aSortParam.nCol1;
@@ -793,26 +793,26 @@ void ScUndoSort::Undo()
nEndCol, nEndRow, nSortTab );
// do not delete/copy note captions, they are handled in drawing undo (ScDBFuncUndo::mpDrawUndo)
- pDoc->DeleteAreaTab( nStartCol,nStartRow, nEndCol,nEndRow, nSortTab, IDF_ALL|IDF_NOCAPTIONS );
+ rDoc.DeleteAreaTab( nStartCol,nStartRow, nEndCol,nEndRow, nSortTab, IDF_ALL|IDF_NOCAPTIONS );
pUndoDoc->CopyToDocument( nStartCol, nStartRow, nSortTab, nEndCol, nEndRow, nSortTab,
- IDF_ALL|IDF_NOCAPTIONS, false, pDoc );
+ IDF_ALL|IDF_NOCAPTIONS, false, &rDoc );
if (bDestArea)
{
// do not delete/copy note captions, they are handled in drawing undo (ScDBFuncUndo::mpDrawUndo)
- pDoc->DeleteAreaTab( aDestRange, IDF_ALL|IDF_NOCAPTIONS );
- pUndoDoc->CopyToDocument( aDestRange, IDF_ALL|IDF_NOCAPTIONS, false, pDoc );
+ rDoc.DeleteAreaTab( aDestRange, IDF_ALL|IDF_NOCAPTIONS );
+ pUndoDoc->CopyToDocument( aDestRange, IDF_ALL|IDF_NOCAPTIONS, false, &rDoc );
}
// Row heights always (due to automatic adjustment)
// TODO change to use ScBlockUndo
pUndoDoc->CopyToDocument( 0, nStartRow, nSortTab, MAXCOL, nEndRow, nSortTab,
- IDF_NONE, false, pDoc );
+ IDF_NONE, false, &rDoc );
if (pUndoDB)
- pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), true );
+ rDoc.SetDBCollection( new ScDBCollection( *pUndoDB ), true );
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nSortTab )
pViewShell->SetTabNo( nSortTab );
@@ -828,7 +828,7 @@ void ScUndoSort::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -879,7 +879,7 @@ ScUndoQuery::ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab, const ScQuery
aAdvSource = *pAdvSrc;
}
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScUndoQuery::~ScUndoQuery()
@@ -898,7 +898,7 @@ void ScUndoQuery::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
bool bCopy = !aQueryParam.bInplace;
@@ -909,7 +909,7 @@ void ScUndoQuery::Undo()
nDestEndCol = aQueryParam.nDestCol + ( aQueryParam.nCol2-aQueryParam.nCol1 );
nDestEndRow = aQueryParam.nDestRow + ( aQueryParam.nRow2-aQueryParam.nRow1 );
- ScDBData* pData = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
+ ScDBData* pData = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
aQueryParam.nDestTab, true );
if (pData)
{
@@ -922,7 +922,7 @@ void ScUndoQuery::Undo()
if ( bDoSize && bDestArea )
{
// aDestRange is the old range
- pDoc->FitBlock( ScRange(
+ rDoc.FitBlock( ScRange(
aQueryParam.nDestCol, aQueryParam.nDestRow, aQueryParam.nDestTab,
nDestEndCol, nDestEndRow, aQueryParam.nDestTab ),
aOldDest );
@@ -931,43 +931,43 @@ void ScUndoQuery::Undo()
ScUndoUtil::MarkSimpleBlock( pDocShell,
aQueryParam.nDestCol, aQueryParam.nDestRow, aQueryParam.nDestTab,
nDestEndCol, nDestEndRow, aQueryParam.nDestTab );
- pDoc->DeleteAreaTab( aQueryParam.nDestCol, aQueryParam.nDestRow,
+ rDoc.DeleteAreaTab( aQueryParam.nDestCol, aQueryParam.nDestRow,
nDestEndCol, nDestEndRow, aQueryParam.nDestTab, IDF_ALL );
pViewShell->DoneBlockMode();
pUndoDoc->CopyToDocument( aQueryParam.nDestCol, aQueryParam.nDestRow, aQueryParam.nDestTab,
nDestEndCol, nDestEndRow, aQueryParam.nDestTab,
- IDF_ALL, false, pDoc );
+ IDF_ALL, false, &rDoc );
// Attributes are always copied (#49287#)
// rest of the old range
if ( bDestArea && !bDoSize )
{
- pDoc->DeleteAreaTab( aOldDest, IDF_ALL );
- pUndoDoc->CopyToDocument( aOldDest, IDF_ALL, false, pDoc );
+ rDoc.DeleteAreaTab( aOldDest, IDF_ALL );
+ pUndoDoc->CopyToDocument( aOldDest, IDF_ALL, false, &rDoc );
}
}
else
pUndoDoc->CopyToDocument( 0, aQueryParam.nRow1, nTab, MAXCOL, aQueryParam.nRow2, nTab,
- IDF_NONE, false, pDoc );
+ IDF_NONE, false, &rDoc );
if (pUndoDB)
- pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), true );
+ rDoc.SetDBCollection( new ScDBCollection( *pUndoDB ), true );
if (!bCopy)
{
- pDoc->InvalidatePageBreaks(nTab);
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.InvalidatePageBreaks(nTab);
+ rDoc.UpdatePageBreaks( nTab );
}
ScRange aDirtyRange( 0 , aQueryParam.nRow1, nTab,
MAXCOL, aQueryParam.nRow2, nTab );
- pDoc->SetDirty( aDirtyRange );
+ rDoc.SetDirty( aDirtyRange );
- DoSdrUndoAction( pDrawUndo, pDoc );
+ DoSdrUndoAction( pDrawUndo, &rDoc );
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -1003,7 +1003,7 @@ void ScUndoQuery::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -1047,16 +1047,16 @@ void ScUndoAutoFilter::DoChange( bool bUndo )
{
bool bNewFilter = bUndo ? !bFilterSet : bFilterSet;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScDBData* pDBData=NULL;
if (aDBName.equalsAscii(STR_DB_LOCAL_NONAME))
{
SCTAB nTab = aOriginalRange.aStart.Tab();
- pDBData = pDoc->GetAnonymousDBData(nTab);
+ pDBData = rDoc.GetAnonymousDBData(nTab);
}
else
{
- ScDBCollection* pColl = pDoc->GetDBCollection();
+ ScDBCollection* pColl = rDoc.GetDBCollection();
pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aDBName));
}
@@ -1072,9 +1072,9 @@ void ScUndoAutoFilter::DoChange( bool bUndo )
pDBData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
if ( bNewFilter )
- pDoc->ApplyFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, SC_MF_AUTO );
+ rDoc.ApplyFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, SC_MF_AUTO );
else
- pDoc->RemoveFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, SC_MF_AUTO );
+ rDoc.RemoveFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, SC_MF_AUTO );
pDocShell->PostPaint( nRangeX1, nRangeY1, nRangeTab, nRangeX2, nRangeY1, nRangeTab, PAINT_GRID );
}
@@ -1127,14 +1127,14 @@ void ScUndoDBData::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( false ); // Avoid unnecessary calculations
- pDoc->CompileDBFormula( true ); // CreateFormulaString
- pDoc->SetDBCollection( new ScDBCollection(*pUndoColl), true );
- pDoc->CompileDBFormula( false ); // CompileFormulaString
- pDoc->SetAutoCalc( bOldAutoCalc );
+ bool bOldAutoCalc = rDoc.GetAutoCalc();
+ rDoc.SetAutoCalc( false ); // Avoid unnecessary calculations
+ rDoc.CompileDBFormula( true ); // CreateFormulaString
+ rDoc.SetDBCollection( new ScDBCollection(*pUndoColl), true );
+ rDoc.CompileDBFormula( false ); // CompileFormulaString
+ rDoc.SetAutoCalc( bOldAutoCalc );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
@@ -1145,14 +1145,14 @@ void ScUndoDBData::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( false ); // Avoid unnecessary calculations
- pDoc->CompileDBFormula( true ); // CreateFormulaString
- pDoc->SetDBCollection( new ScDBCollection(*pRedoColl), true );
- pDoc->CompileDBFormula( false ); // CompileFormulaString
- pDoc->SetAutoCalc( bOldAutoCalc );
+ bool bOldAutoCalc = rDoc.GetAutoCalc();
+ rDoc.SetAutoCalc( false ); // Avoid unnecessary calculations
+ rDoc.CompileDBFormula( true ); // CreateFormulaString
+ rDoc.SetDBCollection( new ScDBCollection(*pRedoColl), true );
+ rDoc.CompileDBFormula( false ); // CompileFormulaString
+ rDoc.SetAutoCalc( bOldAutoCalc );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
@@ -1205,7 +1205,7 @@ void ScUndoImportData::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ScUndoUtil::MarkSimpleBlock( pDocShell, aImportParam.nCol1,aImportParam.nRow1,nTab,
@@ -1218,7 +1218,7 @@ void ScUndoImportData::Undo()
if (pUndoDBData && pRedoDBData)
{
pRedoDBData->GetArea( nTable, nCol1, nRow1, nCol2, nRow2 );
- pCurrentData = ScUndoUtil::GetOldDBData( pRedoDBData, pDoc, nTab,
+ pCurrentData = ScUndoUtil::GetOldDBData( pRedoDBData, &rDoc, nTab,
nCol1, nRow1, nCol2, nRow2 );
if ( !bRedoFilled )
@@ -1227,15 +1227,15 @@ void ScUndoImportData::Undo()
// imported data is deleted later anyway,
// so now delete each column after copying to save memory (#41216#)
- bool bOldAutoCalc = pDoc->GetAutoCalc();
- pDoc->SetAutoCalc( false ); // outside of the loop
+ bool bOldAutoCalc = rDoc.GetAutoCalc();
+ rDoc.SetAutoCalc( false ); // outside of the loop
for (SCCOL nCopyCol = nCol1; nCopyCol <= nCol2; nCopyCol++)
{
- pDoc->CopyToDocument( nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab,
+ rDoc.CopyToDocument( nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab,
IDF_CONTENTS & ~IDF_NOTE, false, pRedoDoc );
- pDoc->DeleteAreaTab( nCopyCol,nRow1, nCopyCol,nRow2, nTab, IDF_CONTENTS & ~IDF_NOTE );
+ rDoc.DeleteAreaTab( nCopyCol,nRow1, nCopyCol,nRow2, nTab, IDF_CONTENTS & ~IDF_NOTE );
}
- pDoc->SetAutoCalc( bOldAutoCalc );
+ rDoc.SetAutoCalc( bOldAutoCalc );
bRedoFilled = true;
}
}
@@ -1249,20 +1249,20 @@ void ScUndoImportData::Undo()
pUndoDBData->GetArea( aOld );
pRedoDBData->GetArea( aNew );
- pDoc->DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
+ rDoc.DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL & ~IDF_NOTE );
aOld.aEnd.SetCol( aOld.aEnd.Col() + nFormulaCols ); // FitBlock also for formulas
aNew.aEnd.SetCol( aNew.aEnd.Col() + nFormulaCols );
- pDoc->FitBlock( aNew, aOld, false ); // backwards
+ rDoc.FitBlock( aNew, aOld, false ); // backwards
}
else
- pDoc->DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
+ rDoc.DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
nEndCol,nEndRow, nTab, IDF_ALL & ~IDF_NOTE );
pUndoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab,
nEndCol+nFormulaCols,nEndRow,nTab,
- IDF_ALL & ~IDF_NOTE, false, pDoc );
+ IDF_ALL & ~IDF_NOTE, false, &rDoc );
if (pCurrentData)
{
@@ -1272,7 +1272,7 @@ void ScUndoImportData::Undo()
ScUndoUtil::MarkSimpleBlock( pDocShell, nCol1, nRow1, nTable, nCol2, nRow2, nTable );
}
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -1290,7 +1290,7 @@ void ScUndoImportData::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
ScUndoUtil::MarkSimpleBlock( pDocShell, aImportParam.nCol1,aImportParam.nRow1,nTab,
@@ -1303,7 +1303,7 @@ void ScUndoImportData::Redo()
if (pUndoDBData && pRedoDBData)
{
pUndoDBData->GetArea( nTable, nCol1, nRow1, nCol2, nRow2 );
- pCurrentData = ScUndoUtil::GetOldDBData( pUndoDBData, pDoc, nTab,
+ pCurrentData = ScUndoUtil::GetOldDBData( pUndoDBData, &rDoc, nTab,
nCol1, nRow1, nCol2, nRow2 );
}
bool bMoveCells = pUndoDBData && pRedoDBData &&
@@ -1318,19 +1318,19 @@ void ScUndoImportData::Redo()
aOld.aEnd.SetCol( aOld.aEnd.Col() + nFormulaCols ); // FitBlock also for formulas
aNew.aEnd.SetCol( aNew.aEnd.Col() + nFormulaCols );
- pDoc->FitBlock( aOld, aNew );
+ rDoc.FitBlock( aOld, aNew );
- pDoc->DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
+ rDoc.DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, IDF_ALL & ~IDF_NOTE );
- pRedoDoc->CopyToDocument( aNew, IDF_ALL & ~IDF_NOTE, false, pDoc ); // including formulas
+ pRedoDoc->CopyToDocument( aNew, IDF_ALL & ~IDF_NOTE, false, &rDoc ); // including formulas
}
else
{
- pDoc->DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
+ rDoc.DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1,
nEndCol,nEndRow, nTab, IDF_ALL & ~IDF_NOTE );
pRedoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab,
- nEndCol,nEndRow,nTab, IDF_ALL & ~IDF_NOTE, false, pDoc );
+ nEndCol,nEndRow,nTab, IDF_ALL & ~IDF_NOTE, false, &rDoc );
}
if (pCurrentData)
@@ -1341,7 +1341,7 @@ void ScUndoImportData::Redo()
ScUndoUtil::MarkSimpleBlock( pDocShell, nCol1, nRow1, nTable, nCol2, nRow2, nTable );
}
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -1423,13 +1423,13 @@ void ScUndoRepeatDB::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
if (bQuerySize)
{
- pDoc->FitBlock( aNewQuery, aOldQuery, false );
+ rDoc.FitBlock( aNewQuery, aOldQuery, false );
if ( aNewQuery.aEnd.Col() == aOldQuery.aEnd.Col() )
{
@@ -1437,7 +1437,7 @@ void ScUndoRepeatDB::Undo()
SCCOL nCol = aOldQuery.aEnd.Col() + 1;
SCROW nRow = aOldQuery.aStart.Row() + 1; // test the header
while ( nCol <= MAXCOL &&
- pDoc->GetCellType(ScAddress( nCol, nRow, nTab )) == CELLTYPE_FORMULA )
+ rDoc.GetCellType(ScAddress( nCol, nRow, nTab )) == CELLTYPE_FORMULA )
++nCol, ++nFormulaCols;
if ( nFormulaCols > 0 )
@@ -1447,7 +1447,7 @@ void ScUndoRepeatDB::Undo()
aOldForm.aEnd.SetCol( aOldQuery.aEnd.Col() + nFormulaCols );
ScRange aNewForm = aOldForm;
aNewForm.aEnd.SetRow( aNewQuery.aEnd.Row() );
- pDoc->FitBlock( aNewForm, aOldForm, false );
+ rDoc.FitBlock( aNewForm, aOldForm, false );
}
}
}
@@ -1456,15 +1456,15 @@ void ScUndoRepeatDB::Undo()
if (nNewEndRow > aBlockEnd.Row())
{
- pDoc->DeleteRow( 0,nTab, MAXCOL,nTab, aBlockEnd.Row()+1, static_cast<SCSIZE>(nNewEndRow-aBlockEnd.Row()) );
+ rDoc.DeleteRow( 0,nTab, MAXCOL,nTab, aBlockEnd.Row()+1, static_cast<SCSIZE>(nNewEndRow-aBlockEnd.Row()) );
}
else if (nNewEndRow < aBlockEnd.Row())
{
- pDoc->InsertRow( 0,nTab, MAXCOL,nTab, nNewEndRow+1, static_cast<SCSIZE>(nNewEndRow-aBlockEnd.Row()) );
+ rDoc.InsertRow( 0,nTab, MAXCOL,nTab, nNewEndRow+1, static_cast<SCSIZE>(nNewEndRow-aBlockEnd.Row()) );
}
// Original Outline table
- pDoc->SetOutlineTable( nTab, pUndoTable );
+ rDoc.SetOutlineTable( nTab, pUndoTable );
// Original column/row status
if (pUndoTable)
@@ -1473,13 +1473,13 @@ void ScUndoRepeatDB::Undo()
SCCOLROW nStartRow;
SCCOLROW nEndCol;
SCCOLROW nEndRow;
- pUndoTable->GetColArray()->GetRange( nStartCol, nEndCol );
- pUndoTable->GetRowArray()->GetRange( nStartRow, nEndRow );
+ pUndoTable->GetColArray().GetRange( nStartCol, nEndCol );
+ pUndoTable->GetRowArray().GetRange( nStartRow, nEndRow );
pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab,
static_cast<SCCOL>(nEndCol), MAXROW, nTab, IDF_NONE, false,
- pDoc );
- pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, pDoc );
+ &rDoc );
+ pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, IDF_NONE, false, &rDoc );
pViewShell->UpdateScrollBars();
}
@@ -1487,23 +1487,23 @@ void ScUndoRepeatDB::Undo()
// Original data and references
ScUndoUtil::MarkSimpleBlock( pDocShell, 0, aBlockStart.Row(), nTab,
MAXCOL, aBlockEnd.Row(), nTab );
- pDoc->DeleteAreaTab( 0, aBlockStart.Row(),
+ rDoc.DeleteAreaTab( 0, aBlockStart.Row(),
MAXCOL, aBlockEnd.Row(), nTab, IDF_ALL );
pUndoDoc->CopyToDocument( 0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab,
- IDF_NONE, false, pDoc ); // Flags
+ IDF_NONE, false, &rDoc ); // Flags
pUndoDoc->UndoToDocument( 0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab,
- IDF_ALL, false, pDoc );
+ IDF_ALL, false, &rDoc );
ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart.Col(),aBlockStart.Row(),nTab,
aBlockEnd.Col(),aBlockEnd.Row(),nTab );
if (pUndoRange)
- pDoc->SetRangeName( new ScRangeName( *pUndoRange ) );
+ rDoc.SetRangeName( new ScRangeName( *pUndoRange ) );
if (pUndoDB)
- pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), true );
+ rDoc.SetDBCollection( new ScDBCollection( *pUndoDB ), true );
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -1520,7 +1520,7 @@ void ScUndoRepeatDB::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab = aBlockStart.Tab();
- SCTAB nVisTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
pViewShell->SetTabNo( nTab );
@@ -1585,7 +1585,7 @@ void ScUndoDataPilot::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRange aOldRange;
ScRange aNewRange;
@@ -1593,14 +1593,14 @@ void ScUndoDataPilot::Undo()
if ( pNewDPObject && pNewUndoDoc )
{
aNewRange = pNewDPObject->GetOutRange();
- pDoc->DeleteAreaTab( aNewRange, IDF_ALL );
- pNewUndoDoc->CopyToDocument( aNewRange, IDF_ALL, false, pDoc );
+ rDoc.DeleteAreaTab( aNewRange, IDF_ALL );
+ pNewUndoDoc->CopyToDocument( aNewRange, IDF_ALL, false, &rDoc );
}
if ( pOldDPObject && pOldUndoDoc )
{
aOldRange = pOldDPObject->GetOutRange();
- pDoc->DeleteAreaTab( aOldRange, IDF_ALL );
- pOldUndoDoc->CopyToDocument( aOldRange, IDF_ALL, false, pDoc );
+ rDoc.DeleteAreaTab( aOldRange, IDF_ALL );
+ pOldUndoDoc->CopyToDocument( aOldRange, IDF_ALL, false, &rDoc );
}
// update objects in collection
@@ -1610,7 +1610,7 @@ void ScUndoDataPilot::Undo()
// find updated object
//! find by name!
- ScDPObject* pDocObj = pDoc->GetDPAtCursor(
+ ScDPObject* pDocObj = rDoc.GetDPAtCursor(
aNewRange.aStart.Col(), aNewRange.aStart.Row(), aNewRange.aStart.Tab() );
OSL_ENSURE(pDocObj, "DPObject not found");
if (pDocObj)
@@ -1628,7 +1628,7 @@ void ScUndoDataPilot::Undo()
else
{
// delete inserted object
- pDoc->GetDPCollection()->FreeTable(pDocObj);
+ rDoc.GetDPCollection()->FreeTable(pDocObj);
}
}
}
@@ -1637,7 +1637,7 @@ void ScUndoDataPilot::Undo()
// re-insert deleted object
ScDPObject* pDestObj = new ScDPObject( *pOldDPObject );
- if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) )
+ if ( !rDoc.GetDPCollection()->InsertNewTable(pDestObj) )
{
OSL_FAIL("cannot insert DPObject");
DELETEZ( pDestObj );
@@ -1659,7 +1659,7 @@ void ScUndoDataPilot::Undo()
if (pNewDPObject)
{
// notify API objects
- pDoc->BroadcastUno( ScDataPilotModifiedHint( pNewDPObject->GetName() ) );
+ rDoc.BroadcastUno( ScDataPilotModifiedHint( pNewDPObject->GetName() ) );
}
EndUndo();
@@ -1672,7 +1672,7 @@ void ScUndoDataPilot::Redo()
//! copy output data instead of repeating the change,
//! in case external data have changed!
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScDPObject* pSourceObj = NULL;
if ( pOldDPObject )
@@ -1681,7 +1681,7 @@ void ScUndoDataPilot::Redo()
//! find by name!
ScRange aOldRange = pOldDPObject->GetOutRange();
- pSourceObj = pDoc->GetDPAtCursor(
+ pSourceObj = rDoc.GetDPAtCursor(
aOldRange.aStart.Col(), aOldRange.aStart.Row(), aOldRange.aStart.Tab() );
OSL_ENSURE(pSourceObj, "DPObject not found");
}
@@ -1734,7 +1734,7 @@ void ScUndoConsolidate::Undo()
{
BeginUndo();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTab = aDestArea.nTab;
ScRange aOldRange;
@@ -1743,23 +1743,23 @@ void ScUndoConsolidate::Undo()
if (bInsRef)
{
- pDoc->DeleteRow( 0,nTab, MAXCOL,nTab, aDestArea.nRowStart, nInsertCount );
- pDoc->SetOutlineTable( nTab, pUndoTab );
+ rDoc.DeleteRow( 0,nTab, MAXCOL,nTab, aDestArea.nRowStart, nInsertCount );
+ rDoc.SetOutlineTable( nTab, pUndoTab );
// Row status
- pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pDoc );
+ pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, &rDoc );
// Data and references
- pDoc->DeleteAreaTab( 0,aDestArea.nRowStart, MAXCOL,aDestArea.nRowEnd, nTab, IDF_ALL );
+ rDoc.DeleteAreaTab( 0,aDestArea.nRowStart, MAXCOL,aDestArea.nRowEnd, nTab, IDF_ALL );
pUndoDoc->UndoToDocument( 0, aDestArea.nRowStart, nTab,
MAXCOL, aDestArea.nRowEnd, nTab,
- IDF_ALL, false, pDoc );
+ IDF_ALL, false, &rDoc );
// Original range
if (pUndoData)
{
- pDoc->DeleteAreaTab(aOldRange, IDF_ALL);
- pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, false, pDoc);
+ rDoc.DeleteAreaTab(aOldRange, IDF_ALL);
+ pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, false, &rDoc);
}
pDocShell->PostPaint( 0,aDestArea.nRowStart,nTab, MAXCOL,MAXROW,nTab,
@@ -1767,17 +1767,17 @@ void ScUndoConsolidate::Undo()
}
else
{
- pDoc->DeleteAreaTab( aDestArea.nColStart,aDestArea.nRowStart,
+ rDoc.DeleteAreaTab( aDestArea.nColStart,aDestArea.nRowStart,
aDestArea.nColEnd,aDestArea.nRowEnd, nTab, IDF_ALL );
pUndoDoc->CopyToDocument( aDestArea.nColStart, aDestArea.nRowStart, nTab,
aDestArea.nColEnd, aDestArea.nRowEnd, nTab,
- IDF_ALL, false, pDoc );
+ IDF_ALL, false, &rDoc );
// Original range
if (pUndoData)
{
- pDoc->DeleteAreaTab(aOldRange, IDF_ALL);
- pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, false, pDoc);
+ rDoc.DeleteAreaTab(aOldRange, IDF_ALL);
+ pUndoDoc->CopyToDocument(aOldRange, IDF_ALL, false, &rDoc);
}
SCCOL nEndX = aDestArea.nColEnd;
@@ -1796,7 +1796,7 @@ void ScUndoConsolidate::Undo()
// Adjust Database range again
if (pUndoData)
{
- ScDBCollection* pColl = pDoc->GetDBCollection();
+ ScDBCollection* pColl = rDoc.GetDBCollection();
if (pColl)
{
ScDBData* pDocData = pColl->getNamedDBs().findByUpperName(pUndoData->GetUpperName());
@@ -1808,7 +1808,7 @@ void ScUndoConsolidate::Undo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- SCTAB nViewTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nViewTab = pViewShell->GetViewData().GetTabNo();
if ( nViewTab != nTab )
pViewShell->SetTabNo( nTab );
}
@@ -1825,7 +1825,7 @@ void ScUndoConsolidate::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- SCTAB nViewTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nViewTab = pViewShell->GetViewData().GetTabNo();
if ( nViewTab != aParam.nTab )
pViewShell->SetTabNo( aParam.nTab );
}
@@ -1845,9 +1845,9 @@ bool ScUndoConsolidate::CanRepeat(SfxRepeatTarget& /* rTarget */) const
// Change source data of Chart
void ScUndoChartData::Init()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
aOldRangeListRef = new ScRangeList;
- pDoc->GetOldChartParameters( aChartName, *aOldRangeListRef, bOldColHeaders, bOldRowHeaders );
+ rDoc.GetOldChartParameters( aChartName, *aOldRangeListRef, bOldColHeaders, bOldRowHeaders );
}
ScUndoChartData::ScUndoChartData( ScDocShell* pNewDocShell, const OUString& rName,
@@ -1891,7 +1891,7 @@ void ScUndoChartData::Undo()
{
BeginUndo();
- pDocShell->GetDocument()->UpdateChartArea( aChartName, aOldRangeListRef,
+ pDocShell->GetDocument().UpdateChartArea( aChartName, aOldRangeListRef,
bOldColHeaders, bOldRowHeaders, false );
EndUndo();
@@ -1901,7 +1901,7 @@ void ScUndoChartData::Redo()
{
BeginRedo();
- pDocShell->GetDocument()->UpdateChartArea( aChartName, aNewRangeListRef,
+ pDocShell->GetDocument().UpdateChartArea( aChartName, aNewRangeListRef,
bNewColHeaders, bNewRowHeaders, bAddRange );
EndRedo();
@@ -1942,7 +1942,7 @@ ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell,
mpMarkData->SetMarkArea(aBlockRange); // mark paste block
if ( pRefUndoData )
- pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() );
+ pRefUndoData->DeleteUnchanged( &pDocShell->GetDocument() );
SetChangeTrack();
}
@@ -1962,7 +1962,7 @@ OUString ScUndoDataForm::GetComment() const
void ScUndoDataForm::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack && (nFlags & IDF_CONTENTS) )
pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc,
nStartChangeAction, nEndChangeAction, SC_CACM_PASTE );
@@ -1982,10 +1982,10 @@ void ScUndoDataForm::Undo()
void ScUndoDataForm::Redo()
{
BeginRedo();
- ScDocument* pDoc = pDocShell->GetDocument();
- EnableDrawAdjust( pDoc, false ); //! include in ScBlockUndo?
+ ScDocument& rDoc = pDocShell->GetDocument();
+ EnableDrawAdjust( &rDoc, false ); //! include in ScBlockUndo?
DoChange( false );
- EnableDrawAdjust( pDoc, true ); //! include in ScBlockUndo?
+ EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
}
@@ -2001,13 +2001,13 @@ bool ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const
void ScUndoDataForm::DoChange( const bool bUndo )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
// RefUndoData for redo is created before first undo
// (with DeleteUnchanged after the DoUndo call)
bool bCreateRedoData = ( bUndo && pRefUndoData && !pRefRedoData );
if ( bCreateRedoData )
- pRefRedoData = new ScRefUndoData( pDoc );
+ pRefRedoData = new ScRefUndoData( &rDoc );
ScRefUndoData* pWorkRefData = bUndo ? pRefUndoData : pRefRedoData;
@@ -2022,7 +2022,7 @@ void ScUndoDataForm::DoChange( const bool bUndo )
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
if ( bUndo && !bRedoFilled )
{
if (!pRedoDoc)
@@ -2031,14 +2031,14 @@ void ScUndoDataForm::DoChange( const bool bUndo )
bool bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==MAXCOL );
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndoSelected( pDoc, *mpMarkData, bColInfo, bRowInfo );
+ pRedoDoc->InitUndoSelected( &rDoc, *mpMarkData, bColInfo, bRowInfo );
}
// read "redo" data from the document in the first undo
// all sheets - CopyToDocument skips those that don't exist in pRedoDoc
ScRange aCopyRange = aBlockRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, 1, false, pRedoDoc );
+ rDoc.CopyToDocument( aCopyRange, 1, false, pRedoDoc );
bRedoFilled = true;
}
@@ -2049,22 +2049,22 @@ void ScUndoDataForm::DoChange( const bool bUndo )
{
OUString aOldString = pUndoDoc->GetString(
aBlockRange.aStart.Col()+i, aBlockRange.aStart.Row(), aBlockRange.aStart.Tab());
- pDoc->SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
+ rDoc.SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
}
if (pWorkRefData)
{
- pWorkRefData->DoUndo( pDoc, true ); // TRUE = bSetChartRangeLists for SetChartListenerCollection
- if ( pDoc->RefreshAutoFilter( 0,0, MAXCOL,MAXROW, aBlockRange.aStart.Tab() ) )
+ pWorkRefData->DoUndo( &rDoc, true ); // TRUE = bSetChartRangeLists for SetChartListenerCollection
+ if ( rDoc.RefreshAutoFilter( 0,0, MAXCOL,MAXROW, aBlockRange.aStart.Tab() ) )
bPaintAll = true;
}
if ( bCreateRedoData && pRefRedoData )
- pRefRedoData->DeleteUnchanged( pDoc );
+ pRefRedoData->DeleteUnchanged( &rDoc );
if ( bUndo )
{
- ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
}
@@ -2072,7 +2072,7 @@ void ScUndoDataForm::DoChange( const bool bUndo )
SetChangeTrack();
ScRange aDrawRange( aBlockRange );
- pDoc->ExtendMerge( aDrawRange, true ); // only needed for single sheet (text/rtf etc.)
+ rDoc.ExtendMerge( aDrawRange, true ); // only needed for single sheet (text/rtf etc.)
sal_uInt16 nPaint = PAINT_GRID;
if (bPaintAll)
{
diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx
index db9b0e43429e..13da03bd9200 100644
--- a/sc/source/ui/undo/undorangename.cxx
+++ b/sc/source/ui/undo/undorangename.cxx
@@ -75,7 +75,7 @@ OUString ScUndoAllRangeNames::GetComment() const
void ScUndoAllRangeNames::DoChange(const boost::ptr_map<OUString, ScRangeName>& rNames)
{
- ScDocument& rDoc = *pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
rDoc.PreprocessRangeNameUpdate();
rDoc.SetAllRangeNames(rNames);
@@ -99,15 +99,15 @@ ScUndoAddRangeData::~ScUndoAddRangeData()
void ScUndoAddRangeData::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeName* pRangeName = NULL;
if (mnTab == -1)
{
- pRangeName = pDoc->GetRangeName();
+ pRangeName = rDoc.GetRangeName();
}
else
{
- pRangeName = pDoc->GetRangeName( mnTab );
+ pRangeName = rDoc.GetRangeName( mnTab );
}
pRangeName->erase(*mpRangeData);
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
@@ -116,15 +116,15 @@ void ScUndoAddRangeData::Undo()
void ScUndoAddRangeData::Redo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeName* pRangeName = NULL;
if (mnTab == -1)
{
- pRangeName = pDoc->GetRangeName();
+ pRangeName = rDoc.GetRangeName();
}
else
{
- pRangeName = pDoc->GetRangeName( mnTab );
+ pRangeName = rDoc.GetRangeName( mnTab );
}
pRangeName->insert(new ScRangeData(*mpRangeData));
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index b0e240fcd321..68d3510d7bd8 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -122,8 +122,8 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo
void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
SfxStyleFamily eStyleFamily, const ScStyleSaveData& rData )
{
- ScDocument* pDoc = pDocSh->GetDocument();
- ScStyleSheetPool* pStlPool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool();
OUString aNewName = rData.GetName();
bool bDelete = aNewName.isEmpty(); // no new name -> delete style
bool bNew = ( rName.isEmpty() && !bDelete ); // creating new style
@@ -147,7 +147,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
pStyle = &pStlPool->Make( aNewName, eStyleFamily, SFXSTYLEBIT_USERDEF );
if ( eStyleFamily == SFX_STYLE_FAMILY_PARA )
- pDoc->GetPool()->CellStyleCreated( aNewName );
+ rDoc.GetPool()->CellStyleCreated( aNewName );
}
if ( pStyle )
@@ -155,9 +155,9 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
if ( bDelete )
{
if ( eStyleFamily == SFX_STYLE_FAMILY_PARA )
- lcl_DocStyleChanged( pDoc, pStyle, true ); // TRUE: remove usage of style
+ lcl_DocStyleChanged( &rDoc, pStyle, true ); // TRUE: remove usage of style
else
- pDoc->RemovePageStyleInUse( rName );
+ rDoc.RemovePageStyleInUse( rName );
// delete style
pStlPool->Remove( pStyle );
@@ -178,17 +178,17 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
if ( eStyleFamily == SFX_STYLE_FAMILY_PARA )
{
- lcl_DocStyleChanged( pDoc, pStyle, false ); // cell styles: row heights
+ lcl_DocStyleChanged( &rDoc, pStyle, false ); // cell styles: row heights
}
else
{
// page styles
if ( bNew && aNewName != rName )
- pDoc->RenamePageStyleInUse( rName, aNewName );
+ rDoc.RenamePageStyleInUse( rName, aNewName );
if (pNewSet)
- pDoc->ModifyStyleSheet( *pStyle, *pNewSet );
+ rDoc.ModifyStyleSheet( *pStyle, *pNewSet );
pDocSh->PageStyleModified( aNewName, true );
}
@@ -257,7 +257,7 @@ void ScUndoApplyPageStyle::Undo()
BeginUndo();
for( ApplyStyleVec::const_iterator aIt = maEntries.begin(), aEnd = maEntries.end(); aIt != aEnd; ++aIt )
{
- pDocShell->GetDocument()->SetPageStyle( aIt->mnTab, aIt->maOldStyle );
+ pDocShell->GetDocument().SetPageStyle( aIt->mnTab, aIt->maOldStyle );
ScPrintFunc( pDocShell, pDocShell->GetPrinter(), aIt->mnTab ).UpdatePages();
}
EndUndo();
@@ -268,7 +268,7 @@ void ScUndoApplyPageStyle::Redo()
BeginRedo();
for( ApplyStyleVec::const_iterator aIt = maEntries.begin(), aEnd = maEntries.end(); aIt != aEnd; ++aIt )
{
- pDocShell->GetDocument()->SetPageStyle( aIt->mnTab, maNewStyle );
+ pDocShell->GetDocument().SetPageStyle( aIt->mnTab, maNewStyle );
ScPrintFunc( pDocShell, pDocShell->GetPrinter(), aIt->mnTab ).UpdatePages();
}
EndRedo();
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 816e2b845414..1a3b9f6c276b 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -84,7 +84,7 @@ ScUndoInsertTab::ScUndoInsertTab( ScDocShell* pNewDocShell,
nTab( nTabNum ),
bAppend( bApp )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
SetChangeTrack();
}
@@ -103,7 +103,7 @@ OUString ScUndoInsertTab::GetComment() const
void ScUndoInsertTab::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
ScRange aRange( 0, 0, nTab, MAXCOL, MAXROW, nTab );
@@ -125,9 +125,9 @@ void ScUndoInsertTab::Undo()
bDrawIsInUndo = false;
pDocShell->SetInUndo( false ); //! EndUndo
- DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() );
+ DoSdrUndoAction( pDrawUndo, &pDocShell->GetDocument() );
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
@@ -159,7 +159,7 @@ void ScUndoInsertTab::Redo()
void ScUndoInsertTab::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
@@ -176,7 +176,7 @@ ScUndoInsertTables::ScUndoInsertTables( ScDocShell* pNewDocShell,
aNameList( newNameList ),
nTab( nTabNum )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
SetChangeTrack();
}
@@ -193,7 +193,7 @@ OUString ScUndoInsertTables::GetComment() const
void ScUndoInsertTables::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
nStartChangeAction = pChangeTrack->GetActionMax() + 1;
@@ -224,9 +224,9 @@ void ScUndoInsertTables::Undo()
bDrawIsInUndo = false;
pDocShell->SetInUndo( false ); //! EndUndo
- DoSdrUndoAction( pDrawUndo, pDocShell->GetDocument() );
+ DoSdrUndoAction( pDrawUndo, &pDocShell->GetDocument() );
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -254,7 +254,7 @@ void ScUndoInsertTables::Redo()
void ScUndoInsertTables::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
@@ -283,7 +283,7 @@ OUString ScUndoDeleteTab::GetComment() const
void ScUndoDeleteTab::SetChangeTrack()
{
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
{
sal_uLong nTmpChangeAction;
@@ -314,7 +314,7 @@ void ScUndoDeleteTab::Undo()
{
BeginUndo();
unsigned int i=0;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bLink = false;
OUString aName;
@@ -325,18 +325,18 @@ void ScUndoDeleteTab::Undo()
pRefUndoDoc->GetName( nTab, aName );
bDrawIsInUndo = true;
- bool bOk = pDoc->InsertTab(nTab, aName, false, true);
+ bool bOk = rDoc.InsertTab(nTab, aName, false, true);
bDrawIsInUndo = false;
if (bOk)
{
- pRefUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pDoc );
+ pRefUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, &rDoc );
OUString aOldName;
pRefUndoDoc->GetName( nTab, aOldName );
- pDoc->RenameTab( nTab, aOldName, false );
+ rDoc.RenameTab( nTab, aOldName, false );
if (pRefUndoDoc->IsLinked(nTab))
{
- pDoc->SetLink( nTab, pRefUndoDoc->GetLinkMode(nTab), pRefUndoDoc->GetLinkDoc(nTab),
+ rDoc.SetLink( nTab, pRefUndoDoc->GetLinkMode(nTab), pRefUndoDoc->GetLinkDoc(nTab),
pRefUndoDoc->GetLinkFlt(nTab), pRefUndoDoc->GetLinkOpt(nTab),
pRefUndoDoc->GetLinkTab(nTab), pRefUndoDoc->GetLinkRefreshDelay(nTab) );
bLink = true;
@@ -344,22 +344,22 @@ void ScUndoDeleteTab::Undo()
if ( pRefUndoDoc->IsScenario(nTab) )
{
- pDoc->SetScenario( nTab, true );
+ rDoc.SetScenario( nTab, true );
OUString aComment;
Color aColor;
sal_uInt16 nScenFlags;
pRefUndoDoc->GetScenarioData( nTab, aComment, aColor, nScenFlags );
- pDoc->SetScenarioData( nTab, aComment, aColor, nScenFlags );
+ rDoc.SetScenarioData( nTab, aComment, aColor, nScenFlags );
bool bActive = pRefUndoDoc->IsActiveScenario( nTab );
- pDoc->SetActiveScenario( nTab, bActive );
+ rDoc.SetActiveScenario( nTab, bActive );
}
- pDoc->SetVisible( nTab, pRefUndoDoc->IsVisible( nTab ) );
- pDoc->SetTabBgColor( nTab, pRefUndoDoc->GetTabBgColor(nTab) );
- pDoc->SetSheetEvents( nTab, pRefUndoDoc->GetSheetEvents( nTab ) );
- pDoc->SetLayoutRTL( nTab, pRefUndoDoc->IsLayoutRTL( nTab ) );
+ rDoc.SetVisible( nTab, pRefUndoDoc->IsVisible( nTab ) );
+ rDoc.SetTabBgColor( nTab, pRefUndoDoc->GetTabBgColor(nTab) );
+ rDoc.SetSheetEvents( nTab, pRefUndoDoc->GetSheetEvents( nTab ) );
+ rDoc.SetLayoutRTL( nTab, pRefUndoDoc->IsLayoutRTL( nTab ) );
if ( pRefUndoDoc->IsTabProtected( nTab ) )
- pDoc->SetTabProtection(nTab, pRefUndoDoc->GetTabProtection(nTab));
+ rDoc.SetTabProtection(nTab, pRefUndoDoc->GetTabProtection(nTab));
}
}
if (bLink)
@@ -369,7 +369,7 @@ void ScUndoDeleteTab::Undo()
EndUndo(); // Draw-Undo has to be called before Broadcast!
- ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
@@ -387,13 +387,13 @@ void ScUndoDeleteTab::Undo()
// not ShowTable due to SetTabNo(..., sal_True):
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
- pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDoc, theTabs[0] ), true );
+ pViewShell->SetTabNo( lcl_GetVisibleTabBefore( rDoc, theTabs[0] ), true );
}
void ScUndoDeleteTab::Redo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- pViewShell->SetTabNo( lcl_GetVisibleTabBefore( *pDocShell->GetDocument(), theTabs.front() ) );
+ pViewShell->SetTabNo( lcl_GetVisibleTabBefore( pDocShell->GetDocument(), theTabs.front() ) );
RedoSdrUndoAction( pDrawUndo ); // Draw Redo first
@@ -414,7 +414,7 @@ void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget)
if (rTarget.ISA(ScTabViewTarget))
{
ScTabViewShell* pViewShell = ((ScTabViewTarget&)rTarget).GetViewShell();
- pViewShell->DeleteTable( pViewShell->GetViewData()->GetTabNo(), true );
+ pViewShell->DeleteTable( pViewShell->GetViewData().GetTabNo(), true );
}
}
@@ -445,8 +445,8 @@ OUString ScUndoRenameTab::GetComment() const
void ScUndoRenameTab::DoChange( SCTAB nTabP, const OUString& rName ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->RenameTab( nTabP, rName );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.RenameTab( nTabP, rName );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); // Navigator
@@ -507,28 +507,28 @@ OUString ScUndoMoveTab::GetComment() const
void ScUndoMoveTab::DoChange( bool bUndo ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (bUndo) // UnDo
{
size_t i = mpNewTabs->size();
boost::scoped_ptr<ScProgress> pProgress(new ScProgress(pDocShell , ScGlobal::GetRscString(STR_UNDO_MOVE_TAB),
- i * pDoc->GetCodeCount()));
+ i * rDoc.GetCodeCount()));
for (; i > 0; --i)
{
SCTAB nDestTab = (*mpNewTabs)[i-1];
SCTAB nOldTab = (*mpOldTabs)[i-1];
if (nDestTab > MAXTAB) // appended ?
- nDestTab = pDoc->GetTableCount() - 1;
+ nDestTab = rDoc.GetTableCount() - 1;
- pDoc->MoveTab( nDestTab, nOldTab, pProgress.get() );
- pViewShell->GetViewData()->MoveTab( nDestTab, nOldTab );
+ rDoc.MoveTab( nDestTab, nOldTab, pProgress.get() );
+ pViewShell->GetViewData().MoveTab( nDestTab, nOldTab );
pViewShell->SetTabNo( nOldTab, true );
if (mpOldNames)
{
const OUString& rOldName = (*mpOldNames)[i-1];
- pDoc->RenameTab(nOldTab, rOldName);
+ rDoc.RenameTab(nOldTab, rOldName);
}
}
}
@@ -536,22 +536,22 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
{
size_t n = mpNewTabs->size();
boost::scoped_ptr<ScProgress> pProgress(new ScProgress(pDocShell , ScGlobal::GetRscString(STR_UNDO_MOVE_TAB),
- n * pDoc->GetCodeCount()));
+ n * rDoc.GetCodeCount()));
for (size_t i = 0; i < n; ++i)
{
SCTAB nDestTab = (*mpNewTabs)[i];
SCTAB nNewTab = nDestTab;
SCTAB nOldTab = (*mpOldTabs)[i];
if (nDestTab > MAXTAB) // appended ?
- nDestTab = pDoc->GetTableCount() - 1;
+ nDestTab = rDoc.GetTableCount() - 1;
- pDoc->MoveTab( nOldTab, nNewTab, pProgress.get() );
- pViewShell->GetViewData()->MoveTab( nOldTab, nNewTab );
+ rDoc.MoveTab( nOldTab, nNewTab, pProgress.get() );
+ pViewShell->GetViewData().MoveTab( nOldTab, nNewTab );
pViewShell->SetTabNo( nDestTab, true );
if (mpNewNames)
{
const OUString& rNewName = (*mpNewNames)[i];
- pDoc->RenameTab(nNewTab, rNewName);
+ rDoc.RenameTab(nNewTab, rNewName);
}
}
}
@@ -593,7 +593,7 @@ ScUndoCopyTab::ScUndoCopyTab(
mpNewNames(pNewNames),
pDrawUndo( NULL )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
if (mpNewNames && mpNewTabs->size() != mpNewNames->size())
// The sizes differ. Something is wrong.
@@ -626,19 +626,19 @@ void ScUndoCopyTab::DoChange() const
void ScUndoCopyTab::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- DoSdrUndoAction( pDrawUndo, pDoc ); // before the sheets are deleted
+ DoSdrUndoAction( pDrawUndo, &rDoc ); // before the sheets are deleted
vector<SCTAB>::const_reverse_iterator itr, itrEnd = mpNewTabs->rend();
for (itr = mpNewTabs->rbegin(); itr != itrEnd; ++itr)
{
SCTAB nDestTab = *itr;
if (nDestTab > MAXTAB) // append?
- nDestTab = pDoc->GetTableCount() - 1;
+ nDestTab = rDoc.GetTableCount() - 1;
bDrawIsInUndo = true;
- pDoc->DeleteTab(nDestTab);
+ rDoc.DeleteTab(nDestTab);
bDrawIsInUndo = false;
}
@@ -649,7 +649,7 @@ void ScUndoCopyTab::Undo()
{
SCTAB nDestTab = *itr;
if (nDestTab > MAXTAB) // append?
- nDestTab = pDoc->GetTableCount() - 1;
+ nDestTab = rDoc.GetTableCount() - 1;
pDocShell->Broadcast( ScTablesHint( SC_TAB_DELETED, nDestTab ) );
}
@@ -659,7 +659,7 @@ void ScUndoCopyTab::Undo()
void ScUndoCopyTab::Redo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nDestTab = 0;
@@ -669,39 +669,39 @@ void ScUndoCopyTab::Redo()
SCTAB nNewTab = nDestTab;
SCTAB nOldTab = (*mpOldTabs)[i];
if (nDestTab > MAXTAB) // appended ?
- nDestTab = pDoc->GetTableCount() - 1;
+ nDestTab = rDoc.GetTableCount() - 1;
bDrawIsInUndo = true;
- pDoc->CopyTab( nOldTab, nNewTab );
+ rDoc.CopyTab( nOldTab, nNewTab );
bDrawIsInUndo = false;
- pViewShell->GetViewData()->MoveTab( nOldTab, nNewTab );
+ pViewShell->GetViewData().MoveTab( nOldTab, nNewTab );
SCTAB nAdjSource = nOldTab;
if ( nNewTab <= nOldTab )
++nAdjSource; // new position of source table after CopyTab
- if ( pDoc->IsScenario(nAdjSource) )
+ if ( rDoc.IsScenario(nAdjSource) )
{
- pDoc->SetScenario(nNewTab, true );
+ rDoc.SetScenario(nNewTab, true );
OUString aComment;
Color aColor;
sal_uInt16 nScenFlags;
- pDoc->GetScenarioData(nAdjSource, aComment, aColor, nScenFlags );
- pDoc->SetScenarioData(nNewTab, aComment, aColor, nScenFlags );
- bool bActive = pDoc->IsActiveScenario(nAdjSource);
- pDoc->SetActiveScenario(nNewTab, bActive );
- bool bVisible=pDoc->IsVisible(nAdjSource);
- pDoc->SetVisible(nNewTab,bVisible );
+ rDoc.GetScenarioData(nAdjSource, aComment, aColor, nScenFlags );
+ rDoc.SetScenarioData(nNewTab, aComment, aColor, nScenFlags );
+ bool bActive = rDoc.IsActiveScenario(nAdjSource);
+ rDoc.SetActiveScenario(nNewTab, bActive );
+ bool bVisible = rDoc.IsVisible(nAdjSource);
+ rDoc.SetVisible(nNewTab,bVisible );
}
- if ( pDoc->IsTabProtected( nAdjSource ) )
- pDoc->CopyTabProtection(nAdjSource, nNewTab);
+ if ( rDoc.IsTabProtected( nAdjSource ) )
+ rDoc.CopyTabProtection(nAdjSource, nNewTab);
if (mpNewNames)
{
const OUString& rName = (*mpNewNames)[i];
- pDoc->RenameTab(nNewTab, rName);
+ rDoc.RenameTab(nNewTab, rName);
}
}
@@ -755,15 +755,13 @@ OUString ScUndoTabColor::GetComment() const
void ScUndoTabColor::DoChange(bool bUndoType) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (!pDoc)
- return;
+ ScDocument& rDoc = pDocShell->GetDocument();
size_t nTabColorCount = aTabColorList.size();
for (size_t i = 0; i < nTabColorCount; ++i)
{
const ScUndoTabColorInfo& rTabColor = aTabColorList[i];
- pDoc->SetTabBgColor(rTabColor.mnTabId,
+ rDoc.SetTabBgColor(rTabColor.mnTabId,
bUndoType ? rTabColor.maOldTabBgColor : rTabColor.maNewTabBgColor);
}
@@ -807,7 +805,7 @@ ScUndoMakeScenario::ScUndoMakeScenario( ScDocShell* pNewDocShell,
nFlags( nF ),
pDrawUndo( NULL )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScUndoMakeScenario::~ScUndoMakeScenario()
@@ -822,15 +820,15 @@ OUString ScUndoMakeScenario::GetComment() const
void ScUndoMakeScenario::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
pDocShell->SetInUndo( true );
bDrawIsInUndo = true;
- pDoc->DeleteTab( nDestTab );
+ rDoc.DeleteTab( nDestTab );
bDrawIsInUndo = false;
pDocShell->SetInUndo( false );
- DoSdrUndoAction( pDrawUndo, pDoc );
+ DoSdrUndoAction( pDrawUndo, &rDoc );
pDocShell->PostPaint(0,0,nDestTab,MAXCOL,MAXROW,MAXTAB, PAINT_ALL);
pDocShell->PostDataChanged();
@@ -887,7 +885,7 @@ ScUndoImportTab::ScUndoImportTab( ScDocShell* pShell,
pRedoDoc( NULL ),
pDrawUndo( NULL )
{
- pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() );
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScUndoImportTab::~ScUndoImportTab()
@@ -904,8 +902,8 @@ OUString ScUndoImportTab::GetComment() const
void ScUndoImportTab::DoChange() const
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
if (pViewShell)
{
if(nTab<nTabCount)
@@ -928,48 +926,48 @@ void ScUndoImportTab::Undo()
// Inserted range names, etc.
SCTAB i;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bMakeRedo = !pRedoDoc;
if (bMakeRedo)
{
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndo( pDoc, nTab,nTab+nCount-1, true,true );
+ pRedoDoc->InitUndo( &rDoc, nTab,nTab+nCount-1, true,true );
OUString aOldName;
for (i=0; i<nCount; i++)
{
SCTAB nTabPos=nTab+i;
- pDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,false, pRedoDoc );
- pDoc->GetName( nTabPos, aOldName );
+ rDoc.CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,false, pRedoDoc );
+ rDoc.GetName( nTabPos, aOldName );
pRedoDoc->RenameTab( nTabPos, aOldName, false );
- pRedoDoc->SetTabBgColor( nTabPos, pDoc->GetTabBgColor(nTabPos) );
+ pRedoDoc->SetTabBgColor( nTabPos, rDoc.GetTabBgColor(nTabPos) );
- if ( pDoc->IsScenario(nTabPos) )
+ if ( rDoc.IsScenario(nTabPos) )
{
pRedoDoc->SetScenario(nTabPos, true );
OUString aComment;
Color aColor;
sal_uInt16 nScenFlags;
- pDoc->GetScenarioData(nTabPos, aComment, aColor, nScenFlags );
+ rDoc.GetScenarioData(nTabPos, aComment, aColor, nScenFlags );
pRedoDoc->SetScenarioData(nTabPos, aComment, aColor, nScenFlags );
- bool bActive = pDoc->IsActiveScenario(nTabPos);
+ bool bActive = rDoc.IsActiveScenario(nTabPos);
pRedoDoc->SetActiveScenario(nTabPos, bActive );
- bool bVisible=pDoc->IsVisible(nTabPos);
+ bool bVisible = rDoc.IsVisible(nTabPos);
pRedoDoc->SetVisible(nTabPos,bVisible );
}
- if ( pDoc->IsTabProtected( nTabPos ) )
- pRedoDoc->SetTabProtection(nTabPos, pDoc->GetTabProtection(nTabPos));
+ if ( rDoc.IsTabProtected( nTabPos ) )
+ pRedoDoc->SetTabProtection(nTabPos, rDoc.GetTabProtection(nTabPos));
}
}
- DoSdrUndoAction( pDrawUndo, pDoc ); // before the sheets are deleted
+ DoSdrUndoAction( pDrawUndo, &rDoc ); // before the sheets are deleted
bDrawIsInUndo = true;
for (i=0; i<nCount; i++)
- pDoc->DeleteTab( nTab );
+ rDoc.DeleteTab( nTab );
bDrawIsInUndo = false;
DoChange();
@@ -983,7 +981,7 @@ void ScUndoImportTab::Redo()
return;
}
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OUString aName;
SCTAB i;
for (i=0; i<nCount; i++) // first insert all sheets (#63304#)
@@ -991,31 +989,31 @@ void ScUndoImportTab::Redo()
SCTAB nTabPos=nTab+i;
pRedoDoc->GetName(nTabPos,aName);
bDrawIsInUndo = true;
- pDoc->InsertTab(nTabPos,aName);
+ rDoc.InsertTab(nTabPos,aName);
bDrawIsInUndo = false;
}
for (i=0; i<nCount; i++) // then copy into inserted sheets
{
SCTAB nTabPos=nTab+i;
- pRedoDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,false, pDoc );
- pDoc->SetTabBgColor( nTabPos, pRedoDoc->GetTabBgColor(nTabPos) );
+ pRedoDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, IDF_ALL,false, &rDoc );
+ rDoc.SetTabBgColor( nTabPos, pRedoDoc->GetTabBgColor(nTabPos) );
if ( pRedoDoc->IsScenario(nTabPos) )
{
- pDoc->SetScenario(nTabPos, true );
+ rDoc.SetScenario(nTabPos, true );
OUString aComment;
Color aColor;
sal_uInt16 nScenFlags;
pRedoDoc->GetScenarioData(nTabPos, aComment, aColor, nScenFlags );
- pDoc->SetScenarioData(nTabPos, aComment, aColor, nScenFlags );
+ rDoc.SetScenarioData(nTabPos, aComment, aColor, nScenFlags );
bool bActive = pRedoDoc->IsActiveScenario(nTabPos);
- pDoc->SetActiveScenario(nTabPos, bActive );
+ rDoc.SetActiveScenario(nTabPos, bActive );
bool bVisible=pRedoDoc->IsVisible(nTabPos);
- pDoc->SetVisible(nTabPos,bVisible );
+ rDoc.SetVisible(nTabPos,bVisible );
}
if ( pRedoDoc->IsTabProtected( nTabPos ) )
- pDoc->SetTabProtection(nTabPos, pRedoDoc->GetTabProtection(nTabPos));
+ rDoc.SetTabProtection(nTabPos, pRedoDoc->GetTabProtection(nTabPos));
}
RedoSdrUndoAction( pDrawUndo ); // after the sheets are inserted
@@ -1026,7 +1024,7 @@ void ScUndoImportTab::Redo()
void ScUndoImportTab::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
@@ -1035,39 +1033,39 @@ bool ScUndoImportTab::CanRepeat(SfxRepeatTarget& rTarget) const
return rTarget.ISA(ScTabViewTarget);
}
-ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const OUString& rDoc ) :
+ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const OUString& rDocName ) :
ScSimpleUndo( pShell ),
- aDocName( rDoc ),
+ aDocName( rDocName ),
nRefreshDelay( 0 ),
nCount( 0 )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
pTabs = new SCTAB[nTabCount];
pModes = new sal_uInt8[nTabCount];
pTabNames = new OUString[nTabCount];
for (SCTAB i=0; i<nTabCount; i++)
{
- sal_uInt8 nMode = pDoc->GetLinkMode(i);
+ sal_uInt8 nMode = rDoc.GetLinkMode(i);
if (nMode)
- if (pDoc->GetLinkDoc(i) == aDocName)
+ if (rDoc.GetLinkDoc(i) == aDocName)
{
if (!nCount)
{
- aFltName = pDoc->GetLinkFlt(i);
- aOptions = pDoc->GetLinkOpt(i);
- nRefreshDelay = pDoc->GetLinkRefreshDelay(i);
+ aFltName = rDoc.GetLinkFlt(i);
+ aOptions = rDoc.GetLinkOpt(i);
+ nRefreshDelay = rDoc.GetLinkRefreshDelay(i);
}
else
{
- OSL_ENSURE(OUString(aFltName) == pDoc->GetLinkFlt(i) &&
- OUString(aOptions) == pDoc->GetLinkOpt(i),
+ OSL_ENSURE(OUString(aFltName) == rDoc.GetLinkFlt(i) &&
+ OUString(aOptions) == rDoc.GetLinkOpt(i),
"different Filter for a Document?");
}
pTabs[nCount] = i;
pModes[nCount] = nMode;
- pTabNames[nCount] = pDoc->GetLinkTab(i);
+ pTabNames[nCount] = rDoc.GetLinkTab(i);
++nCount;
}
}
@@ -1087,13 +1085,13 @@ OUString ScUndoRemoveLink::GetComment() const
void ScUndoRemoveLink::DoChange( bool bLink ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OUString aEmpty;
for (sal_uInt16 i=0; i<nCount; i++)
if (bLink) // establish link
- pDoc->SetLink( pTabs[i], pModes[i], aDocName, aFltName, aOptions, pTabNames[i], nRefreshDelay );
+ rDoc.SetLink( pTabs[i], pModes[i], aDocName, aFltName, aOptions, pTabNames[i], nRefreshDelay );
else // remove link
- pDoc->SetLink( pTabs[i], SC_LINK_NONE, aEmpty, aEmpty, aEmpty, aEmpty, 0 );
+ rDoc.SetLink( pTabs[i], SC_LINK_NONE, aEmpty, aEmpty, aEmpty, aEmpty, 0 );
pDocShell->UpdateLinks();
}
@@ -1130,7 +1128,7 @@ ScUndoShowHideTab::~ScUndoShowHideTab()
void ScUndoShowHideTab::DoChange( bool bShowP ) const
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCTAB nTab;
@@ -1138,7 +1136,7 @@ void ScUndoShowHideTab::DoChange( bool bShowP ) const
for(std::vector<SCTAB>::const_iterator itr = undoTabs.begin(), itrEnd = undoTabs.end(); itr != itrEnd; ++itr)
{
nTab = *itr;
- pDoc->SetVisible( nTab, bShowP );
+ rDoc.SetVisible( nTab, bShowP );
if (pViewShell)
pViewShell->SetTabNo(nTab,true);
}
@@ -1160,7 +1158,7 @@ void ScUndoShowHideTab::Redo()
void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute( bShow ? FID_TABLE_SHOW : FID_TABLE_HIDE,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
@@ -1199,7 +1197,7 @@ ScUndoDocProtect::~ScUndoDocProtect()
void ScUndoDocProtect::DoProtect(bool bProtect)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if (bProtect)
{
@@ -1208,12 +1206,12 @@ void ScUndoDocProtect::DoProtect(bool bProtect)
auto_ptr<ScDocProtection> pCopy(new ScDocProtection(*mpProtectSettings));
SAL_WNODEPRECATED_DECLARATIONS_POP
pCopy->setProtected(true);
- pDoc->SetDocProtection(pCopy.get());
+ rDoc.SetDocProtection(pCopy.get());
}
else
{
// remove protection.
- pDoc->SetDocProtection(NULL);
+ rDoc.SetDocProtection(NULL);
}
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1271,7 +1269,7 @@ ScUndoTabProtect::~ScUndoTabProtect()
void ScUndoTabProtect::DoProtect(bool bProtect)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if (bProtect)
{
@@ -1280,12 +1278,12 @@ void ScUndoTabProtect::DoProtect(bool bProtect)
auto_ptr<ScTableProtection> pCopy(new ScTableProtection(*mpProtectSettings));
SAL_WNODEPRECATED_DECLARATIONS_POP
pCopy->setProtected(true);
- pDoc->SetTabProtection(mnTab, pCopy.get());
+ rDoc.SetTabProtection(mnTab, pCopy.get());
}
else
{
// remove protection.
- pDoc->SetTabProtection(mnTab, NULL);
+ rDoc.SetTabProtection(mnTab, NULL);
}
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -1345,11 +1343,11 @@ ScUndoPrintRange::~ScUndoPrintRange()
void ScUndoPrintRange::DoChange(bool bUndo)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if (bUndo)
- pDoc->RestorePrintRanges( *pOldRanges );
+ rDoc.RestorePrintRanges( *pOldRanges );
else
- pDoc->RestorePrintRanges( *pNewRanges );
+ rDoc.RestorePrintRanges( *pNewRanges );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -1416,10 +1414,10 @@ OUString ScUndoScenarioFlags::GetComment() const
void ScUndoScenarioFlags::Undo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- pDoc->RenameTab( nTab, aOldName );
- pDoc->SetScenarioData( nTab, aOldComment, aOldColor, nOldFlags );
+ rDoc.RenameTab( nTab, aOldName );
+ rDoc.SetScenarioData( nTab, aOldComment, aOldColor, nOldFlags );
pDocShell->PostPaintGridAll();
// The sheet name might be used in a formula ...
@@ -1433,10 +1431,10 @@ void ScUndoScenarioFlags::Undo()
void ScUndoScenarioFlags::Redo()
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
- pDoc->RenameTab( nTab, aNewName );
- pDoc->SetScenarioData( nTab, aNewComment, aNewColor, nNewFlags );
+ rDoc.RenameTab( nTab, aNewName );
+ rDoc.SetScenarioData( nTab, aNewComment, aNewColor, nNewFlags );
pDocShell->PostPaintGridAll();
// The sheet name might be used in a formula ...
@@ -1480,8 +1478,8 @@ OUString ScUndoRenameObject::GetComment() const
SdrObject* ScUndoRenameObject::GetObject()
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if ( pDrawLayer )
{
sal_uInt16 nCount = pDrawLayer->GetPageCount();
@@ -1550,8 +1548,8 @@ void ScUndoLayoutRTL::DoChange( bool bNew )
{
pDocShell->SetInUndo( true );
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->SetLayoutRTL( nTab, bNew );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.SetLayoutRTL( nTab, bNew );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -1575,7 +1573,7 @@ void ScUndoLayoutRTL::Redo()
void ScUndoLayoutRTL::Repeat(SfxRepeatTarget& rTarget)
{
if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData().GetDispatcher().
Execute( FID_TAB_RTL, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx
index 51ba554e5439..0e0891cb29b8 100644
--- a/sc/source/ui/undo/undoutil.cxx
+++ b/sc/source/ui/undo/undoutil.cxx
@@ -38,14 +38,14 @@ void ScUndoUtil::MarkSimpleBlock( ScDocShell* pDocShell,
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
- SCTAB nViewTab = pViewShell->GetViewData()->GetTabNo();
+ SCTAB nViewTab = pViewShell->GetViewData().GetTabNo();
if ( nViewTab < nStartZ || nViewTab > nEndZ )
pViewShell->SetTabNo( nStartZ );
pViewShell->DoneBlockMode();
pViewShell->MoveCursorAbs( nStartX, nStartY, SC_FOLLOW_JUMP, false, false );
pViewShell->InitOwnBlockMode();
- pViewShell->GetViewData()->GetMarkData().
+ pViewShell->GetViewData().GetMarkData().
SetMarkArea( ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ) );
pViewShell->MarkDataChanged();
}
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 82f540905501..d7a273c240da 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -37,13 +37,13 @@ ScAddressConversionObj::ScAddressConversionObj(ScDocShell* pDocSh, bool _bIsRang
nRefSheet( 0 ),
bIsRange( _bIsRange )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScAddressConversionObj::~ScAddressConversionObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -60,11 +60,11 @@ bool ScAddressConversionObj::ParseUIString( const OUString& rUIString, ::formula
if (!pDocShell)
return false;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bSuccess = false;
if ( bIsRange )
{
- sal_uInt16 nResult = aRange.ParseAny( rUIString, pDoc, eConv );
+ sal_uInt16 nResult = aRange.ParseAny( rUIString, &rDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -78,7 +78,7 @@ bool ScAddressConversionObj::ParseUIString( const OUString& rUIString, ::formula
}
else
{
- sal_uInt16 nResult = aRange.aStart.Parse( rUIString, pDoc, eConv );
+ sal_uInt16 nResult = aRange.aStart.Parse( rUIString, &rDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -222,7 +222,7 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
if ( !pDocShell )
throw uno::RuntimeException();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
uno::Any aRet;
OUString aNameStr(aPropertyName);
@@ -253,9 +253,9 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
if ( aRange.aStart.Tab() != nRefSheet )
nFlags |= SCA_TAB_3D;
if ( bIsRange )
- aFormatStr = aRange.Format(nFlags, pDoc);
+ aFormatStr = aRange.Format(nFlags, &rDoc);
else
- aFormatStr = aRange.aStart.Format(nFlags, pDoc);
+ aFormatStr = aRange.aStart.Format(nFlags, &rDoc);
aRet <<= aFormatStr;
}
else if ( aNameStr.equalsAscii( SC_UNONAME_PERSREPR ) || aNameStr.equalsAscii( SC_UNONAME_XLA1REPR ) )
@@ -264,7 +264,7 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
::formula::FormulaGrammar::CONV_XL_A1 : ::formula::FormulaGrammar::CONV_OOO;
// generate file format string - always include sheet
- OUString aFormatStr(aRange.aStart.Format(SCA_VALID | SCA_TAB_3D, pDoc, eConv));
+ OUString aFormatStr(aRange.aStart.Format(SCA_VALID | SCA_TAB_3D, &rDoc, eConv));
if ( bIsRange )
{
// manually concatenate range so both parts always have the sheet name
@@ -272,7 +272,7 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
sal_uInt16 nFlags = SCA_VALID;
if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 )
nFlags |= SCA_TAB_3D;
- OUString aSecond(aRange.aEnd.Format(nFlags, pDoc, eConv));
+ OUString aSecond(aRange.aEnd.Format(nFlags, &rDoc, eConv));
aFormatStr += aSecond ;
}
aRet <<= OUString( aFormatStr );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 276a2fec54d8..77321977bf36 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1045,8 +1045,8 @@ void ScHelperFunctions::AssignTableBorder2ToAny( uno::Any& rAny,
void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& rRanges,
const SvxBoxItem& rOuter, const SvxBoxInfoItem& rInner )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
ScDocument* pUndoDoc = NULL;
if (bUndo)
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -1059,17 +1059,17 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
if (bUndo)
{
if ( i==0 )
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
else
pUndoDoc->AddUndoTab( nTab, nTab );
- pDoc->CopyToDocument( aRange, IDF_ATTRIB, false, pUndoDoc );
+ rDoc.CopyToDocument( aRange, IDF_ATTRIB, false, pUndoDoc );
}
ScMarkData aMark;
aMark.SetMarkArea( aRange );
aMark.SelectTable( nTab, true );
- pDoc->ApplySelectionFrame( aMark, &rOuter, &rInner );
+ rDoc.ApplySelectionFrame( aMark, &rOuter, &rInner );
// RowHeight bei Umrandung alleine nicht noetig
}
@@ -1091,15 +1091,15 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
const uno::Sequence< uno::Sequence<uno::Any> >& aData )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
SCROW nEndRow = rRange.aEnd.Row();
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
- if ( !pDoc->IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
+ if ( !rDoc.IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
{
//! error message
return false;
@@ -1121,11 +1121,11 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( bUndo )
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( rRange, IDF_CONTENTS|IDF_NOCAPTIONS, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( rRange, IDF_CONTENTS|IDF_NOCAPTIONS, false, pUndoDoc );
}
- pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
+ rDoc.DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
bool bError = false;
SCROW nDocRow = nStartRow;
@@ -1146,7 +1146,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
case uno::TypeClass_VOID:
{
// void = "no value"
- pDoc->SetError( nDocCol, nDocRow, nTab, NOTAVAILABLE );
+ rDoc.SetError( nDocCol, nDocRow, nTab, NOTAVAILABLE );
}
break;
@@ -1162,7 +1162,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
{
double fVal(0.0);
rElement >>= fVal;
- pDoc->SetValue(aPos, fVal);
+ rDoc.SetValue(aPos, fVal);
}
break;
@@ -1174,7 +1174,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
{
ScSetStringParam aParam;
aParam.setTextInput();
- pDoc->SetString(aPos, aUStr, &aParam);
+ rDoc.SetString(aPos, aUStr, &aParam);
}
}
break;
@@ -1186,8 +1186,8 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( rElement >>= aTokens )
{
ScTokenArray aTokenArray;
- ScTokenConversion::ConvertToTokenArray( *pDoc, aTokenArray, aTokens );
- pDoc->SetFormula(aPos, aTokenArray);
+ ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, aTokens );
+ rDoc.SetFormula(aPos, aTokenArray);
}
else
bError = true;
@@ -1230,15 +1230,15 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
const uno::Sequence< uno::Sequence<OUString> >& aData,
const formula::FormulaGrammar::Grammar eGrammar )
{
- ScDocument* pDoc = rDocShell.GetDocument();
+ ScDocument& rDoc = rDocShell.GetDocument();
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
SCCOL nEndCol = rRange.aEnd.Col();
SCROW nEndRow = rRange.aEnd.Row();
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
- if ( !pDoc->IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
+ if ( !rDoc.IsBlockEditable( nTab, nStartCol,nStartRow, nEndCol,nEndRow ) )
{
//! error message
return false;
@@ -1260,11 +1260,11 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
if ( bUndo )
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( rRange, IDF_CONTENTS, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( rRange, IDF_CONTENTS, false, pUndoDoc );
}
- pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
+ rDoc.DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS );
bool bError = false;
SCROW nDocRow = nStartRow;
@@ -1282,17 +1282,17 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
ScInputStringType aRes =
ScStringUtil::parseInputString(
- *pDoc->GetFormatTable(), aText, LANGUAGE_ENGLISH_US);
+ *rDoc.GetFormatTable(), aText, LANGUAGE_ENGLISH_US);
switch (aRes.meType)
{
case ScInputStringType::Formula:
- pDoc->SetFormula(aPos, aRes.maText, eGrammar);
+ rDoc.SetFormula(aPos, aRes.maText, eGrammar);
break;
case ScInputStringType::Number:
- pDoc->SetValue(aPos, aRes.mfValue);
+ rDoc.SetValue(aPos, aRes.mfValue);
break;
case ScInputStringType::Text:
- pDoc->SetTextCell(aPos, aRes.maText);
+ rDoc.SetTextCell(aPos, aRes.maText);
break;
default:
;
@@ -1328,13 +1328,10 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
}
// used in ScCellRangeObj::getFormulaArray and ScCellObj::GetInputString_Impl
-static OUString lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPos, bool bEnglish )
+static OUString lcl_GetInputString( ScDocument& rDoc, const ScAddress& rPos, bool bEnglish )
{
- if (!pDoc)
- return EMPTY_OUSTRING;
-
ScRefCellValue aCell;
- aCell.assign(*pDoc, rPos);
+ aCell.assign(rDoc, rPos);
if (aCell.isEmpty())
return EMPTY_OUSTRING;
@@ -1349,11 +1346,11 @@ static OUString lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPos, boo
}
SvNumberFormatter* pFormatter = bEnglish ? ScGlobal::GetEnglishFormatter() :
- pDoc->GetFormatTable();
+ rDoc.GetFormatTable();
// Since the English formatter was constructed with
// LANGUAGE_ENGLISH_US the "General" format has index key 0,
// we don't have to query.
- sal_uInt32 nNumFmt = bEnglish ? 0 : pDoc->GetNumberFormat(rPos);
+ sal_uInt32 nNumFmt = bEnglish ? 0 : rDoc.GetNumberFormat(rPos);
if (eType == CELLTYPE_EDIT)
{
@@ -1362,13 +1359,13 @@ static OUString lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPos, boo
const EditTextObject* pData = aCell.mpEditText;
if (pData)
{
- EditEngine& rEngine = pDoc->GetEditEngine();
+ EditEngine& rEngine = rDoc.GetEditEngine();
rEngine.SetText(*pData);
aVal = rEngine.GetText(LINEEND_LF);
}
}
else
- ScCellFormat::GetInputString(aCell, nNumFmt, aVal, *pFormatter, pDoc);
+ ScCellFormat::GetInputString(aCell, nNumFmt, aVal, *pFormatter, &rDoc);
// ggf. ein ' davorhaengen wie in ScTabViewShell::UpdateInputHandler
if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
@@ -1412,9 +1409,9 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR) :
if (pDocShell) // Null if created with createInstance
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->AddUnoObject(*this);
- nObjectId = pDoc->GetNewUnoId();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.AddUnoObject(*this);
+ nObjectId = rDoc.GetNewUnoId();
}
}
@@ -1437,9 +1434,9 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR) :
{
if (pDocShell) // Null if created with createInstance
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->AddUnoObject(*this);
- nObjectId = pDoc->GetNewUnoId();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.AddUnoObject(*this);
+ nObjectId = rDoc.GetNewUnoId();
}
}
@@ -1449,7 +1446,7 @@ ScCellRangesBase::~ScCellRangesBase()
// during ForgetCurrentAttrs
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
ForgetCurrentAttrs();
ForgetMarkData();
@@ -1486,8 +1483,8 @@ const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsFlat()
if ( !pCurrentFlat && pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pCurrentFlat = pDoc->CreateSelectionPattern( *GetMarkData(), false );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ pCurrentFlat = rDoc.CreateSelectionPattern( *GetMarkData(), false );
}
return pCurrentFlat;
}
@@ -1498,8 +1495,8 @@ const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsDeep()
if ( !pCurrentDeep && pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pCurrentDeep = pDoc->CreateSelectionPattern( *GetMarkData(), true );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ pCurrentDeep = rDoc.CreateSelectionPattern( *GetMarkData(), true );
}
return pCurrentDeep;
}
@@ -1536,12 +1533,12 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
boost::scoped_ptr<ScRangeList> pUndoRanges;
- if ( pDoc->HasUnoRefUndo() )
+ if ( rDoc.HasUnoRefUndo() )
pUndoRanges.reset(new ScRangeList( aRanges ));
- if ( aRanges.UpdateReference( rRef.GetMode(), pDoc, rRef.GetRange(),
+ if ( aRanges.UpdateReference( rRef.GetMode(), &rDoc, rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() ) )
{
// i#90076; the object "this" was destroyed after calling ScTableSheetObj::getImplementation
@@ -1569,7 +1566,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
bGotDataChangedHint = true;
if ( pUndoRanges )
- pDoc->AddUnoRefChange( nObjectId, *pUndoRanges );
+ rDoc.AddUnoRefChange( nObjectId, *pUndoRanges );
}
}
else if ( rHint.ISA( SfxSimpleHint ) )
@@ -1615,9 +1612,9 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
// the EventObject holds a Ref to this object until after the listener calls
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for ( sal_uInt16 n=0; n<aValueListeners.size(); n++ )
- pDoc->AddUnoListenerCall( aValueListeners[n], aEvent );
+ rDoc.AddUnoListenerCall( aValueListeners[n], aEvent );
bGotDataChangedHint = false;
}
@@ -1655,9 +1652,9 @@ void ScCellRangesBase::RefChanged()
{
pValueListener->EndListeningAll();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
- pDoc->StartListeningArea( *aRanges[ i ], pValueListener );
+ rDoc.StartListeningArea( *aRanges[ i ], pValueListener );
}
ForgetCurrentAttrs();
@@ -1667,7 +1664,7 @@ void ScCellRangesBase::RefChanged()
ScDocument* ScCellRangesBase::GetDocument() const
{
if (pDocShell)
- return pDocShell->GetDocument();
+ return &pDocShell->GetDocument();
else
return NULL;
}
@@ -1683,7 +1680,7 @@ void ScCellRangesBase::InitInsertRange(ScDocShell* pDocSh, const ScRange& rR)
aRanges.RemoveAll();
aRanges.Append( aCellRange );
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
RefChanged(); // Range im Range-Objekt anpassen
}
@@ -1805,8 +1802,8 @@ double SAL_CALL ScCellRangesBase::computeFunction( sheet::GeneralFunction nFunct
ScAddress aDummy; // wenn nicht Marked, ignoriert wegen Negative
double fVal;
ScSubTotalFunc eFunc = ScDPUtil::toSubTotalFunc(nFunction);
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( !pDoc->GetSelectionFunction( eFunc, aDummy, aMark, fVal ) )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if ( !rDoc.GetSelectionFunction( eFunc, aDummy, aMark, fVal ) )
{
throw uno::RuntimeException(); //! own exception?
}
@@ -1903,7 +1900,7 @@ beans::PropertyState ScCellRangesBase::GetOnePropertyState( sal_uInt16 nItemWhic
else if ( pEntry->nWID == SC_WID_UNO_CELLSTYL )
{
// a style is always set, there's no default state
- const ScStyleSheet* pStyle = pDocShell->GetDocument()->GetSelectionStyle(*GetMarkData());
+ const ScStyleSheet* pStyle = pDocShell->GetDocument().GetSelectionStyle(*GetMarkData());
if (pStyle)
eRet = beans::PropertyState_DIRECT_VALUE;
else
@@ -2005,14 +2002,14 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
const SfxItemPropertyMap& rPropertyMap = GetItemPropertyMap(); // from derived class
const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName );
if ( pEntry )
{
if ( IsScItemWid( pEntry->nWID ) )
{
- const ScPatternAttr* pPattern = pDoc->GetDefPattern();
+ const ScPatternAttr* pPattern = rDoc.GetDefPattern();
if ( pPattern )
{
const SfxItemSet& rSet = pPattern->GetItemSet();
@@ -2046,7 +2043,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert
case SC_WID_UNO_TBLBORD:
case SC_WID_UNO_TBLBORD2:
{
- const ScPatternAttr* pPattern = pDoc->GetDefPattern();
+ const ScPatternAttr* pPattern = rDoc.GetDefPattern();
if ( pPattern )
{
if (pEntry->nWID == SC_WID_UNO_TBLBORD2)
@@ -2067,11 +2064,11 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert
bool bEnglish = ( pEntry->nWID != SC_WID_UNO_CONDLOC );
bool bXML = ( pEntry->nWID == SC_WID_UNO_CONDXML );
formula::FormulaGrammar::Grammar eGrammar = (bXML ?
- pDoc->GetStorageGrammar() :
+ rDoc.GetStorageGrammar() :
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
aAny <<= uno::Reference<sheet::XSheetConditionalEntries>(
- new ScTableConditionalFormat( pDoc, 0, aRanges[0]->aStart.Tab(), eGrammar ));
+ new ScTableConditionalFormat( &rDoc, 0, aRanges[0]->aStart.Tab(), eGrammar ));
}
break;
case SC_WID_UNO_VALIDAT:
@@ -2081,11 +2078,11 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert
bool bEnglish = ( pEntry->nWID != SC_WID_UNO_VALILOC );
bool bXML = ( pEntry->nWID == SC_WID_UNO_VALIXML );
formula::FormulaGrammar::Grammar eGrammar = (bXML ?
- pDoc->GetStorageGrammar() :
+ rDoc.GetStorageGrammar() :
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
aAny <<= uno::Reference<beans::XPropertySet>(
- new ScTableValidationObj( pDoc, 0, eGrammar ));
+ new ScTableValidationObj( &rDoc, 0, eGrammar ));
}
break;
case SC_WID_UNO_NUMRULES:
@@ -2112,7 +2109,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellRangesBase::getPropertySe
}
static void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rValue,
- ScPatternAttr& rPattern, ScDocument* pDoc,
+ ScPatternAttr& rPattern, ScDocument &rDoc,
sal_uInt16& rFirstItemId, sal_uInt16& rSecondItemId )
{
rFirstItemId = rEntry.nWID;
@@ -2124,7 +2121,7 @@ static void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const
case ATTR_VALUE_FORMAT:
{
// language for number formats
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
sal_uLong nOldFormat = ((const SfxUInt32Item&)rSet.Get( ATTR_VALUE_FORMAT )).GetValue();
LanguageType eOldLang = ((const SvxLanguageItem&)rSet.Get( ATTR_LANGUAGE_FORMAT )).GetLanguage();
nOldFormat = pFormatter->GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
@@ -2249,7 +2246,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
{
if ( !aRanges.empty() ) // leer = nichts zu tun
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
// Fuer Teile von zusammengesetzten Items mit mehreren Properties (z.B. Hintergrund)
// muss vorher das alte Item aus dem Dokument geholt werden
@@ -2263,7 +2260,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
rSet.ClearInvalidItems();
sal_uInt16 nFirstItem, nSecondItem;
- lcl_SetCellProperty( *pEntry, aValue, aPattern, pDoc, nFirstItem, nSecondItem );
+ lcl_SetCellProperty( *pEntry, aValue, aPattern, rDoc, nFirstItem, nSecondItem );
for (sal_uInt16 nWhich = ATTR_PATTERN_START; nWhich <= ATTR_PATTERN_END; nWhich++)
if ( nWhich != nFirstItem && nWhich != nSecondItem )
@@ -2287,13 +2284,13 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
/* TODO: Iterate through the range */
ScAddress aAddr = aRange.aStart;
- ScDocument *pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRefCellValue aCell;
- aCell.assign(*pDoc, aAddr);
+ aCell.assign(rDoc, aAddr);
- OUString aStr = aCell.getString(pDoc);
- EditEngine aEngine( pDoc->GetEnginePool() );
- aEngine.SetEditTextObjectPool(pDoc->GetEditPool());
+ OUString aStr = aCell.getString(&rDoc);
+ EditEngine aEngine( rDoc.GetEnginePool() );
+ aEngine.SetEditTextObjectPool(rDoc.GetEditPool());
/* EE_CHAR_ESCAPEMENT seems to be set on the cell _only_ when
* there are no other attribs for the cell.
@@ -2310,7 +2307,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
aEngine.QuickSetAttribs(aAttr, ESelection(0, 0, 0, aStr.getLength()));
// The cell will own the text object instance.
- pDoc->SetEditText(aRanges[0]->aStart, aEngine.CreateTextObject());
+ rDoc.SetEditText(aRanges[0]->aStart, aEngine.CreateTextObject());
}
}
}
@@ -2368,15 +2365,15 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
ScTableConditionalFormat::getImplementation( xInterface );
if (pFormat)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bEnglish = ( pEntry->nWID != SC_WID_UNO_CONDLOC );
bool bXML = ( pEntry->nWID == SC_WID_UNO_CONDXML );
formula::FormulaGrammar::Grammar eGrammar = (bXML ?
formula::FormulaGrammar::GRAM_UNSPECIFIED :
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
- ScConditionalFormat* pNew = new ScConditionalFormat( 0, pDoc ); // Index wird beim Einfuegen gesetzt
- pFormat->FillFormat( *pNew, pDoc, eGrammar );
+ ScConditionalFormat* pNew = new ScConditionalFormat( 0, &rDoc ); // Index wird beim Einfuegen gesetzt
+ pFormat->FillFormat( *pNew, &rDoc, eGrammar );
pNew->AddRange( aRanges );
SCTAB nTab = aRanges.front()->aStart.Tab();
pDocShell->GetDocFunc().ReplaceConditionalFormat( 0, pNew, nTab, aRanges );
@@ -2395,7 +2392,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
ScTableValidationObj::getImplementation( xInterface );
if (pValidObj)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bEnglish = ( pEntry->nWID != SC_WID_UNO_VALILOC );
bool bXML = ( pEntry->nWID == SC_WID_UNO_VALIXML );
formula::FormulaGrammar::Grammar eGrammar = (bXML ?
@@ -2403,11 +2400,11 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
boost::scoped_ptr<ScValidationData> pNewData(
- pValidObj->CreateValidationData( pDoc, eGrammar ));
- sal_uLong nIndex = pDoc->AddValidationEntry( *pNewData );
+ pValidObj->CreateValidationData( &rDoc, eGrammar ));
+ sal_uLong nIndex = rDoc.AddValidationEntry( *pNewData );
pNewData.reset();
- ScPatternAttr aPattern( pDoc->GetPool() );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALIDDATA, nIndex ) );
pDocShell->GetDocFunc().ApplyAttributes( *GetMarkData(), aPattern, true, true );
}
@@ -2452,13 +2449,13 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
{
case ATTR_VALUE_FORMAT:
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
sal_uLong nOldFormat = ((const SfxUInt32Item&)
pDataSet->Get( ATTR_VALUE_FORMAT )).GetValue();
LanguageType eOldLang = ((const SvxLanguageItem&)
pDataSet->Get( ATTR_LANGUAGE_FORMAT )).GetLanguage();
- nOldFormat = pDoc->GetFormatTable()->
+ nOldFormat = rDoc.GetFormatTable()->
GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
rAny <<= (sal_Int32)( nOldFormat );
}
@@ -2491,7 +2488,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
case SC_WID_UNO_CELLSTYL:
{
OUString aStyleName;
- const ScStyleSheet* pStyle = pDocShell->GetDocument()->GetSelectionStyle(*GetMarkData());
+ const ScStyleSheet* pStyle = pDocShell->GetDocument().GetSelectionStyle(*GetMarkData());
if (pStyle)
aStyleName = pStyle->GetName();
rAny <<= OUString( ScStyleNameConversion::DisplayToProgrammaticName(
@@ -2508,11 +2505,11 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
SvxBoxItem aOuter(ATTR_BORDER);
SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aMark;
aMark.SetMarkArea( *pFirst );
aMark.SelectTable( pFirst->aStart.Tab(), true );
- pDoc->GetSelectionFrame( aMark, aOuter, aInner );
+ rDoc.GetSelectionFrame( aMark, aOuter, aInner );
if (pEntry->nWID == SC_WID_UNO_TBLBORD2)
ScHelperFunctions::AssignTableBorder2ToAny( rAny, aOuter, aInner);
@@ -2528,11 +2525,11 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
const ScPatternAttr* pPattern = GetCurrentAttrsDeep();
if ( pPattern )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bEnglish = ( pEntry->nWID != SC_WID_UNO_CONDLOC );
bool bXML = ( pEntry->nWID == SC_WID_UNO_CONDXML );
formula::FormulaGrammar::Grammar eGrammar = (bXML ?
- pDoc->GetStorageGrammar() :
+ rDoc.GetStorageGrammar() :
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
const std::vector<sal_uInt32>& rIndex = ((const ScCondFormatItem&)
pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData();
@@ -2540,7 +2537,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
if(!rIndex.empty())
nIndex = rIndex[0];
rAny <<= uno::Reference<sheet::XSheetConditionalEntries>(
- new ScTableConditionalFormat( pDoc, nIndex, aRanges.front()->aStart.Tab(), eGrammar ));
+ new ScTableConditionalFormat( &rDoc, nIndex, aRanges.front()->aStart.Tab(), eGrammar ));
}
}
break;
@@ -2551,16 +2548,16 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
const ScPatternAttr* pPattern = GetCurrentAttrsDeep();
if ( pPattern )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
bool bEnglish = ( pEntry->nWID != SC_WID_UNO_VALILOC );
bool bXML = ( pEntry->nWID == SC_WID_UNO_VALIXML );
formula::FormulaGrammar::Grammar eGrammar = (bXML ?
- pDoc->GetStorageGrammar() :
+ rDoc.GetStorageGrammar() :
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
sal_uLong nIndex = ((const SfxUInt32Item&)
pPattern->GetItem(ATTR_VALIDDATA)).GetValue();
rAny <<= uno::Reference<beans::XPropertySet>(
- new ScTableValidationObj( pDoc, nIndex, eGrammar ));
+ new ScTableValidationObj( &rDoc, nIndex, eGrammar ));
}
}
break;
@@ -2573,7 +2570,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
case SC_WID_UNO_ABSNAME:
{
OUString sRet;
- aRanges.Format(sRet, SCR_ABS_3D, pDocShell->GetDocument());
+ aRanges.Format(sRet, SCR_ABS_3D, &pDocShell->GetDocument());
rAny <<= sRet;
}
}
@@ -2668,7 +2665,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< OUString
}
}
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
boost::scoped_ptr<ScPatternAttr> pOldPattern;
boost::scoped_ptr<ScPatternAttr> pNewPattern;
@@ -2685,13 +2682,13 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< OUString
{
pOldPattern.reset(new ScPatternAttr( *GetCurrentAttrsDeep() ));
pOldPattern->GetItemSet().ClearInvalidItems();
- pNewPattern.reset(new ScPatternAttr( pDoc->GetPool() ));
+ pNewPattern.reset(new ScPatternAttr( rDoc.GetPool() ));
}
// collect items in pNewPattern, apply with one call after the loop
sal_uInt16 nFirstItem, nSecondItem;
- lcl_SetCellProperty( *pEntry, pValues[i], *pOldPattern, pDoc, nFirstItem, nSecondItem );
+ lcl_SetCellProperty( *pEntry, pValues[i], *pOldPattern, rDoc, nFirstItem, nSecondItem );
// put only affected items into new set
if ( nFirstItem )
@@ -2811,7 +2808,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
}
}
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
boost::scoped_ptr<ScPatternAttr> pOldPattern;
boost::scoped_ptr<ScPatternAttr> pNewPattern;
@@ -2829,7 +2826,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
{
pOldPattern.reset(new ScPatternAttr( *GetCurrentAttrsDeep() ));
pOldPattern->GetItemSet().ClearInvalidItems();
- pNewPattern.reset(new ScPatternAttr( pDoc->GetPool() ));
+ pNewPattern.reset(new ScPatternAttr( rDoc.GetPool() ));
}
// collect items in pNewPattern, apply with one call after the loop
@@ -2837,7 +2834,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set
sal_uInt16 nFirstItem, nSecondItem;
try
{
- lcl_SetCellProperty( *pEntry, pValues[i], *pOldPattern, pDoc, nFirstItem, nSecondItem );
+ lcl_SetCellProperty( *pEntry, pValues[i], *pOldPattern, rDoc, nFirstItem, nSecondItem );
// put only affected items into new set
if ( nFirstItem )
@@ -3000,7 +2997,7 @@ ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const
SCCOL nStartX;
SCROW nStartY; // Anfang holen
- if (!pDocShell->GetDocument()->GetDataStart( nTab, nStartX, nStartY ))
+ if (!pDocShell->GetDocument().GetDataStart( nTab, nStartX, nStartY ))
{
nStartX = 0;
nStartY = 0;
@@ -3008,7 +3005,7 @@ ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const
SCCOL nEndX;
SCROW nEndY; // Ende holen
- if (!pDocShell->GetDocument()->GetTableArea( nTab, nEndX, nEndY ))
+ if (!pDocShell->GetDocument().GetTableArea( nTab, nEndX, nEndY ))
{
nEndX = 0;
nEndY = 0;
@@ -3020,7 +3017,7 @@ ScMemChart* ScCellRangesBase::CreateMemChart_Impl() const
}
if (!xChartRanges.Is()) // sonst Ranges direkt uebernehmen
xChartRanges = new ScRangeList(aRanges);
- ScChartArray aArr( pDocShell->GetDocument(), xChartRanges, OUString() );
+ ScChartArray aArr( &pDocShell->GetDocument(), xChartRanges, OUString() );
// RowAsHdr = ColHeaders und umgekehrt
aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr );
@@ -3101,8 +3098,8 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, nRowCount );
if ( pDocShell && xChartRanges.Is() )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChartArray aArr( pDoc, xChartRanges, OUString() );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChartArray aArr( &rDoc, xChartRanges, OUString() );
aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); // RowAsHdr = ColHeaders
const ScChartPositionMap* pPosMap = aArr.GetPositionMap();
if (pPosMap)
@@ -3124,9 +3121,9 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub
{
double fVal = pArray[nCol];
if ( fVal == DBL_MIN )
- pDoc->SetEmptyCell(*pPos);
+ rDoc.SetEmptyCell(*pPos);
else
- pDoc->SetValue(*pPos, pArray[nCol]);
+ rDoc.SetValue(*pPos, pArray[nCol]);
}
}
}
@@ -3174,8 +3171,8 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions(
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( 1, nRowCount );
if ( pDocShell && xChartRanges.Is() )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChartArray aArr( pDoc, xChartRanges, OUString() );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChartArray aArr( &rDoc, xChartRanges, OUString() );
aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); // RowAsHdr = ColHeaders
const ScChartPositionMap* pPosMap = aArr.GetPositionMap();
if (pPosMap)
@@ -3191,12 +3188,12 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions(
{
const OUString& aStr = pArray[nRow];
if (aStr.isEmpty())
- pDoc->SetEmptyCell(*pPos);
+ rDoc.SetEmptyCell(*pPos);
else
{
ScSetStringParam aParam;
aParam.setTextInput();
- pDoc->SetString(*pPos, aStr, &aParam);
+ rDoc.SetString(*pPos, aStr, &aParam);
}
}
}
@@ -3245,8 +3242,8 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions(
ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, 1 );
if ( pDocShell && xChartRanges.Is() )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChartArray aArr( pDoc, xChartRanges, OUString() );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChartArray aArr( &rDoc, xChartRanges, OUString() );
aArr.SetHeaders( bChartRowAsHdr, bChartColAsHdr ); // RowAsHdr = ColHeaders
const ScChartPositionMap* pPosMap = aArr.GetPositionMap();
if (pPosMap)
@@ -3262,12 +3259,12 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions(
{
const OUString& aStr = pArray[nCol];
if (aStr.isEmpty())
- pDoc->SetEmptyCell(*pPos);
+ rDoc.SetEmptyCell(*pPos);
else
{
ScSetStringParam aParam;
aParam.setTextInput();
- pDoc->SetString(*pPos, aStr, &aParam);
+ rDoc.SetString(*pPos, aStr, &aParam);
}
}
}
@@ -3294,7 +3291,7 @@ void ScCellRangesBase::ForceChartListener_Impl()
if (!pDocShell)
return;
- ScChartListenerCollection* pColl = pDocShell->GetDocument()->GetChartListenerCollection();
+ ScChartListenerCollection* pColl = pDocShell->GetDocument().GetChartListenerCollection();
if (!pColl)
return;
@@ -3318,15 +3315,15 @@ void SAL_CALL ScCellRangesBase::addChartDataChangeEventListener( const uno::Refe
{
//! auf doppelte testen?
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeListRef aRangesRef( new ScRangeList(aRanges) );
- ScChartListenerCollection* pColl = pDoc->GetChartListenerCollection();
+ ScChartListenerCollection* pColl = rDoc.GetChartListenerCollection();
OUString aName = pColl->getUniqueName(OUString("__Uno"));
if (aName.isEmpty())
// failed to create unique name.
return;
- ScChartListener* pListener = new ScChartListener( aName, pDoc, aRangesRef );
+ ScChartListener* pListener = new ScChartListener( aName, &rDoc, aRangesRef );
pListener->SetUno( aListener, this );
pColl->insert( pListener );
pListener->StartListeningTo();
@@ -3340,8 +3337,8 @@ void SAL_CALL ScCellRangesBase::removeChartDataChangeEventListener( const uno::R
SolarMutexGuard aGuard;
if ( pDocShell && !aRanges.empty() )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScChartListenerCollection* pColl = pDoc->GetChartListenerCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScChartListenerCollection* pColl = rDoc.GetChartListenerCollection();
pColl->FreeUno( aListener, this );
}
}
@@ -3376,9 +3373,9 @@ void SAL_CALL ScCellRangesBase::addModifyListener(const uno::Reference<util::XMo
if (!pValueListener)
pValueListener = new ScLinkListener( LINK( this, ScCellRangesBase, ValueListenerHdl ) );
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
for ( size_t i = 0, nCount = aRanges.size(); i < nCount; i++)
- pDoc->StartListeningArea( *aRanges[ i ], pValueListener );
+ rDoc.StartListeningArea( *aRanges[ i ], pValueListener );
acquire(); // don't lose this object (one ref for all listeners)
}
@@ -3430,11 +3427,11 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
ScMarkData aMarkData(*GetMarkData());
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCCOL nCol = 0, nLastCol;
while (nCol <= MAXCOL)
{
- if (pDoc->ColHidden(nCol, nTab, NULL, &nLastCol))
+ if (rDoc.ColHidden(nCol, nTab, NULL, &nLastCol))
// hidden columns. Unselect them.
aMarkData.SetMultiMarkArea(ScRange(nCol, 0, nTab, nLastCol, MAXROW, nTab), false);
@@ -3444,7 +3441,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
SCROW nRow = 0, nLastRow;
while (nRow <= MAXROW)
{
- if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow))
+ if (rDoc.RowHidden(nRow, nTab, NULL, &nLastRow))
// These rows are hidden. Unselect them.
aMarkData.SetMultiMarkArea(ScRange(0, nRow, nTab, MAXCOL, nLastRow, nTab), false);
@@ -3465,7 +3462,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aMarkData(*GetMarkData());
@@ -3474,7 +3471,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel
{
ScRange aRange = *aRanges[ i ];
- ScCellIterator aIter( pDoc, aRange );
+ ScCellIterator aIter( &rDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
// Notizen zaehlen als nicht-leer
@@ -3501,7 +3498,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aMarkData;
@@ -3510,7 +3507,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
{
ScRange aRange = *aRanges[ i ];
- ScCellIterator aIter( pDoc, aRange );
+ ScCellIterator aIter( &rDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
bool bAdd = false;
@@ -3536,9 +3533,9 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
{
// Date/Time Erkennung
- sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)pDoc->GetAttr(
+ sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)rDoc.GetAttr(
aIter.GetPos(), ATTR_VALUE_FORMAT))->GetValue();
- short nTyp = pDoc->GetFormatTable()->GetType(nIndex);
+ short nTyp = rDoc.GetFormatTable()->GetType(nIndex);
if ((nTyp == NUMBERFORMAT_DATE) || (nTyp == NUMBERFORMAT_TIME) ||
(nTyp == NUMBERFORMAT_DATETIME))
{
@@ -3581,7 +3578,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aMarkData;
@@ -3590,7 +3587,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
{
ScRange aRange = *aRanges[ i ];
- ScCellIterator aIter( pDoc, aRange );
+ ScCellIterator aIter( &rDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
if (aIter.getType() == CELLTYPE_FORMULA)
@@ -3636,7 +3633,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
{
size_t nRangeCount = aRanges.size();
size_t i;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScMarkData aMarkData;
SCCOLROW nCmpPos = bColumnDiff ? (SCCOLROW)aCompare.Row : (SCCOLROW)aCompare.Column;
@@ -3650,7 +3647,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
aCmpRange = ScRange( 0,nCmpPos,nTab, MAXCOL,nCmpPos,nTab );
else
aCmpRange = ScRange( static_cast<SCCOL>(nCmpPos),0,nTab, static_cast<SCCOL>(nCmpPos),MAXROW,nTab );
- ScCellIterator aCmpIter( pDoc, aCmpRange );
+ ScCellIterator aCmpIter( &rDoc, aCmpRange );
for (bool bHasCell = aCmpIter.first(); bHasCell; bHasCell = aCmpIter.next())
{
SCCOLROW nCellPos = bColumnDiff ? static_cast<SCCOLROW>(aCmpIter.GetPos().Col()) : static_cast<SCCOLROW>(aCmpIter.GetPos().Row());
@@ -3688,7 +3685,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
{
ScRange aRange( *aRanges[ i ] );
- ScCellIterator aIter( pDoc, aRange );
+ ScCellIterator aIter( &rDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
if (bColumnDiff)
@@ -3758,7 +3755,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden
SolarMutexGuard aGuard;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeList aNewRanges(aRanges);
bool bFound;
@@ -3774,7 +3771,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden
for (size_t nR = 0, nCount = aNewRanges.size(); nR<nCount; ++nR)
{
ScRange aRange( *aNewRanges[ nR] );
- ScCellIterator aIter( pDoc, aRange );
+ ScCellIterator aIter( &rDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
if (aIter.getType() != CELLTYPE_FORMULA)
@@ -3807,7 +3804,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
SolarMutexGuard aGuard;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeList aNewRanges(aRanges);
bool bFound;
@@ -3822,7 +3819,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
SCTAB nTab = lcl_FirstTab(aNewRanges); //! alle Tabellen
- ScCellIterator aCellIter( pDoc, ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab) );
+ ScCellIterator aCellIter( &rDoc, ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab) );
for (bool bHasCell = aCellIter.first(); bHasCell; bHasCell = aCellIter.next())
{
if (aCellIter.getType() != CELLTYPE_FORMULA)
@@ -3885,7 +3882,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangesBase::findAll(
SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
if (pSearchItem)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
pSearchItem->SetCommand( SVX_SEARCHCMD_FIND_ALL );
// immer nur innerhalb dieses Objekts
pSearchItem->SetSelection( !lcl_WholeSheet(aRanges) );
@@ -3897,7 +3894,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL ScCellRangesBase::findAll(
SCCOL nCol = 0;
SCROW nRow = 0;
SCTAB nTab = 0;
- bool bFound = pDoc->SearchAndReplace(
+ bool bFound = rDoc.SearchAndReplace(
*pSearchItem, nCol, nRow, nTab, aMark, aMatchedRanges, aDummyUndo, NULL);
if (bFound)
{
@@ -3923,7 +3920,7 @@ uno::Reference<uno::XInterface> ScCellRangesBase::Find_Impl(
SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
if (pSearchItem)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
pSearchItem->SetCommand( SVX_SEARCHCMD_FIND );
// immer nur innerhalb dieses Objekts
pSearchItem->SetSelection( !lcl_WholeSheet(aRanges) );
@@ -3943,7 +3940,7 @@ uno::Reference<uno::XInterface> ScCellRangesBase::Find_Impl(
OUString aDummyUndo;
ScRangeList aMatchedRanges;
- bool bFound = pDoc->SearchAndReplace(
+ bool bFound = rDoc.SearchAndReplace(
*pSearchItem, nCol, nRow, nTab, aMark, aMatchedRanges, aDummyUndo, NULL);
if (bFound)
{
@@ -4009,19 +4006,19 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea
SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
if (pSearchItem)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
pSearchItem->SetCommand( SVX_SEARCHCMD_REPLACE_ALL );
// immer nur innerhalb dieses Objekts
pSearchItem->SetSelection( !lcl_WholeSheet(aRanges) );
ScMarkData aMark(*GetMarkData());
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
bool bProtected = !pDocShell->IsEditable();
ScMarkData::iterator itr = aMark.begin(), itrEnd = aMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
- if ( pDoc->IsTabProtected(*itr) )
+ if ( rDoc.IsTabProtected(*itr) )
bProtected = true;
if (bProtected)
{
@@ -4038,7 +4035,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea
if (bUndo)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
}
itr = aMark.begin();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -4052,7 +4049,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea
if (bUndo)
{
ScRangeList aMatchedRanges;
- bFound = pDoc->SearchAndReplace(
+ bFound = rDoc.SearchAndReplace(
*pSearchItem, nCol, nRow, nTab, aMark, aMatchedRanges, aUndoStr, pUndoDoc );
}
if (bFound)
@@ -4253,7 +4250,7 @@ OUString SAL_CALL ScCellRangesObj::getRangeAddressesAsString()
ScDocShell* pDocSh = GetDocShell();
const ScRangeList& rRanges = GetRangeList();
if (pDocSh)
- rRanges.Format( aString, SCA_VALID | SCA_TAB_3D, pDocSh->GetDocument() );
+ rRanges.Format( aString, SCA_VALID | SCA_TAB_3D, &pDocSh->GetDocument() );
return aString;
}
@@ -4440,10 +4437,10 @@ static bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh,
if (pDocSh)
{
OUString aRangeStr;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
{
- aRangeStr = rRanges[ i ]->Format(SCA_VALID | SCA_TAB_3D, pDoc);
+ aRangeStr = rRanges[ i ]->Format(SCA_VALID | SCA_TAB_3D, &rDoc);
if ( aRangeStr == rName )
{
rIndex = i;
@@ -4470,7 +4467,7 @@ static bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
// range contained in selection? (sheet must be specified)
ScRange aCellRange;
- sal_uInt16 nParse = aCellRange.ParseAny( rName, pDocSh->GetDocument() );
+ sal_uInt16 nParse = aCellRange.ParseAny( rName, &pDocSh->GetDocument() );
if ( ( nParse & ( SCA_VALID | SCA_TAB_3D ) ) == ( SCA_VALID | SCA_TAB_3D ) )
{
ScMarkData aMarkData;
@@ -4531,7 +4528,7 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName )
{
// deselect any ranges (parsed or named entry)
ScRangeList aDiff;
- bool bValid = ( aDiff.Parse( aNameStr, pDocSh->GetDocument() ) & SCA_VALID ) != 0;
+ bool bValid = ( aDiff.Parse( aNameStr, &pDocSh->GetDocument() ) & SCA_VALID ) != 0;
if (!bValid && !m_pImpl->m_aNamedEntries.empty())
{
sal_uInt16 nCount = m_pImpl->m_aNamedEntries.size();
@@ -4633,7 +4630,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesObj::getElementNames()
if (pDocSh)
{
OUString aRangeStr;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
size_t nCount = rRanges.size();
uno::Sequence<OUString> aSeq(nCount);
@@ -4645,7 +4642,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesObj::getElementNames()
if (m_pImpl->m_aNamedEntries.empty() ||
!lcl_FindEntryName(m_pImpl->m_aNamedEntries, aRange, aRangeStr))
{
- aRangeStr = aRange.Format(SCA_VALID | SCA_TAB_3D, pDoc);
+ aRangeStr = aRange.Format(SCA_VALID | SCA_TAB_3D, &rDoc);
}
pAry[i] = aRangeStr;
}
@@ -4926,13 +4923,13 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = aRange.aStart.Tab();
ScRange aCellRange;
bool bFound = false;
OUString aString(aName);
- sal_uInt16 nParse = aCellRange.ParseAny( aString, pDoc, rDetails );
+ sal_uInt16 nParse = aCellRange.ParseAny( aString, &rDoc, rDetails );
if ( nParse & SCA_VALID )
{
if ( !(nParse & SCA_TAB_3D) ) // keine Tabelle angegeben -> auf dieser Tabelle
@@ -4945,8 +4942,8 @@ uno::Reference<table::XCellRange> ScCellRangeObj::getCellRangeByName(
else
{
ScRangeUtil aRangeUtil;
- if ( aRangeUtil.MakeRangeFromName( aString, pDoc, nTab, aCellRange, RUTL_NAMES ) ||
- aRangeUtil.MakeRangeFromName( aString, pDoc, nTab, aCellRange, RUTL_DBASE ) )
+ if ( aRangeUtil.MakeRangeFromName( aString, &rDoc, nTab, aCellRange, RUTL_NAMES ) ||
+ aRangeUtil.MakeRangeFromName( aString, &rDoc, nTab, aCellRange, RUTL_DBASE ) )
bFound = true;
}
@@ -5034,11 +5031,11 @@ OUString SAL_CALL ScCellRangeObj::getArrayFormula() throw(uno::RuntimeException,
OUString aFormula;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScRefCellValue aCell1;
ScRefCellValue aCell2;
- aCell1.assign(*pDoc, aRange.aStart);
- aCell2.assign(*pDoc, aRange.aEnd);
+ aCell1.assign(rDoc, aRange.aStart);
+ aCell2.assign(rDoc, aRange.aEnd);
if (aCell1.meType == CELLTYPE_FORMULA && aCell2.meType == CELLTYPE_FORMULA)
{
const ScFormulaCell* pFCell1 = aCell1.mpFormula;
@@ -5112,11 +5109,11 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellRangeObj::getArrayTokens()
if (!pDocSh)
return aSequence;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScRefCellValue aCell1;
ScRefCellValue aCell2;
- aCell1.assign(*pDoc, aRange.aStart);
- aCell2.assign(*pDoc, aRange.aEnd);
+ aCell1.assign(rDoc, aRange.aStart);
+ aCell2.assign(rDoc, aRange.aEnd);
if (aCell1.meType == CELLTYPE_FORMULA && aCell2.meType == CELLTYPE_FORMULA)
{
const ScFormulaCell* pFCell1 = aCell1.mpFormula;
@@ -5129,7 +5126,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellRangeObj::getArrayTokens()
{
const ScTokenArray* pTokenArray = pFCell1->GetCode();
if (pTokenArray)
- (void)ScTokenConversion::ConvertToTokenSequence(*pDoc, aSequence, *pTokenArray);
+ (void)ScTokenConversion::ConvertToTokenSequence(rDoc, aSequence, *pTokenArray);
}
}
}
@@ -5150,9 +5147,9 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::Formula
throw uno::RuntimeException();
}
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScTokenArray aTokenArray;
- (void)ScTokenConversion::ConvertToTokenArray( *pDoc, aTokenArray, rTokens );
+ (void)ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
// Actually GRAM_PODF_A1 is a don't-care here because of the token
// array being set, it fits with other API compatibility grammars
@@ -5188,7 +5185,7 @@ uno::Sequence< uno::Sequence<uno::Any> > SAL_CALL ScCellRangeObj::getDataArray()
{
uno::Any aAny;
// bAllowNV = TRUE: errors as void
- if ( ScRangeToSequence::FillMixedArray( aAny, pDocSh->GetDocument(), aRange, true ) )
+ if ( ScRangeToSequence::FillMixedArray( aAny, &pDocSh->GetDocument(), aRange, true ) )
{
uno::Sequence< uno::Sequence<uno::Any> > aSeq;
if ( aAny >>= aSeq )
@@ -5270,7 +5267,7 @@ void SAL_CALL ScCellRangeObj::setFormulaArray(
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
- ScExternalRefManager::ApiGuard aExtRefGuard(pDocSh->GetDocument());
+ ScExternalRefManager::ApiGuard aExtRefGuard(&pDocSh->GetDocument());
// GRAM_PODF_A1 for API compatibility.
bDone = lcl_PutFormulaArray( *pDocSh, aRange, aArray, formula::FormulaGrammar::GRAM_PODF_A1 );
@@ -5352,7 +5349,7 @@ sal_Bool SAL_CALL ScCellRangeObj::getIsMerged() throw(uno::RuntimeException, std
{
SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
- return pDocSh && pDocSh->GetDocument()->HasAttrib( aRange, HASATTR_MERGED );
+ return pDocSh && pDocSh->GetDocument().HasAttrib( aRange, HASATTR_MERGED );
}
// XCellSeries
@@ -5651,7 +5648,7 @@ void SAL_CALL ScCellRangeObj::filter( const uno::Reference<sheet::XSheetFilterDe
static_cast<SCCOLROW>(aRange.aStart.Col()) :
static_cast<SCCOLROW>(aRange.aStart.Row());
SCSIZE nCount = aParam.GetEntryCount();
- svl::SharedStringPool& rPool = pDocSh->GetDocument()->GetSharedStringPool();
+ svl::SharedStringPool& rPool = pDocSh->GetDocument().GetSharedStringPool();
for (SCSIZE i=0; i<nCount; i++)
{
ScQueryEntry& rEntry = aParam.GetEntry(i);
@@ -5665,7 +5662,7 @@ void SAL_CALL ScCellRangeObj::filter( const uno::Reference<sheet::XSheetFilterDe
if (rItem.meType != ScQueryEntry::ByString)
{
OUString aStr;
- pDocSh->GetDocument()->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
+ pDocSh->GetDocument().GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
rItem.maString = rPool.intern(aStr);
}
}
@@ -5719,8 +5716,8 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScCellRangeObj::createFil
aParam.nRow2 = (SCROW)aDataAddress.EndRow;
aParam.nTab = aDataAddress.Sheet;
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bOk = pDoc->CreateQueryParam(
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bOk = rDoc.CreateQueryParam(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(),
aRange.aStart.Tab(), aParam );
@@ -5960,7 +5957,7 @@ void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEnt
if (pDocSh)
{
// GetMMRect converts using HMM_PER_TWIPS, like the DrawingLayer
- Rectangle aMMRect(pDocSh->GetDocument()->GetMMRect(
+ Rectangle aMMRect(pDocSh->GetDocument().GetMMRect(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab() ));
awt::Point aPos( aMMRect.Left(), aMMRect.Top() );
@@ -5973,7 +5970,7 @@ void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEnt
if (pDocSh)
{
// GetMMRect converts using HMM_PER_TWIPS, like the DrawingLayer
- Rectangle aMMRect = pDocSh->GetDocument()->GetMMRect(
+ Rectangle aMMRect = pDocSh->GetDocument().GetMMRect(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab() );
Size aSize(aMMRect.GetSize());
@@ -6145,11 +6142,11 @@ OUString ScCellObj::GetOutputString_Impl() const
OUString aVal;
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScRefCellValue aCell;
- aCell.assign(*pDoc, aCellPos);
+ aCell.assign(rDoc, aCellPos);
- aVal = ScCellFormat::GetOutputString(*pDoc, aCellPos, aCell);
+ aVal = ScCellFormat::GetOutputString(rDoc, aCellPos, aCell);
}
return aVal;
}
@@ -6169,7 +6166,7 @@ double ScCellObj::GetValue_Impl() const
{
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- return pDocSh->GetDocument()->GetValue( aCellPos );
+ return pDocSh->GetDocument().GetValue( aCellPos );
return 0.0;
}
@@ -6194,9 +6191,9 @@ void ScCellObj::InputEnglishString( const OUString& rText )
return;
OUString aString(rText);
- ScDocument* pDoc = pDocSh->GetDocument();
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
- sal_uInt32 nOldFormat = pDoc->GetNumberFormat( aCellPos );
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
+ sal_uInt32 nOldFormat = rDoc.GetNumberFormat( aCellPos );
if (pFormatter->GetType(nOldFormat) == NUMBERFORMAT_TEXT)
{
SetString_Impl(aString, false, false); // text cell
@@ -6216,7 +6213,7 @@ void ScCellObj::InputEnglishString( const OUString& rText )
sal_uInt32 nNewFormat = ScGlobal::GetStandardFormat(*pFormatter, nOldFormat, aRes.mnFormatType);
if (nNewFormat != nOldFormat)
{
- ScPatternAttr aPattern( pDoc->GetPool() );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) );
// ATTR_LANGUAGE_FORMAT remains unchanged
rFunc.ApplyAttributes( *GetMarkData(), aPattern, true, true );
@@ -6228,7 +6225,7 @@ void ScCellObj::InputEnglishString( const OUString& rText )
case ScInputStringType::Formula:
rFunc.SetFormulaCell(
aCellPos,
- new ScFormulaCell(pDoc, aCellPos, aRes.maText, formula::FormulaGrammar::GRAM_PODF_A1),
+ new ScFormulaCell(&rDoc, aCellPos, aRes.maText, formula::FormulaGrammar::GRAM_PODF_A1),
false);
break;
case ScInputStringType::Number:
@@ -6451,7 +6448,7 @@ void SAL_CALL ScCellObj::setFormulaString( const OUString& aFormula) throw(uno::
ScDocShell *pDocSh = GetDocShell();
if( pDocSh )
{
- ScFormulaCell* pCell = new ScFormulaCell( pDocSh->GetDocument(), aCellPos );
+ ScFormulaCell* pCell = new ScFormulaCell( &pDocSh->GetDocument(), aCellPos );
pCell->SetHybridFormula( aFormula, formula::FormulaGrammar::GRAM_NATIVE );
pDocSh->GetDocFunc().SetFormulaCell(aCellPos, pCell, false);
}
@@ -6460,9 +6457,9 @@ void SAL_CALL ScCellObj::setFormulaResult( double nValue ) throw(uno::RuntimeExc
{
SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
- if ( pDocSh && pDocSh->GetDocument()->GetCellType( aCellPos ) == CELLTYPE_FORMULA )
+ if ( pDocSh && pDocSh->GetDocument().GetCellType( aCellPos ) == CELLTYPE_FORMULA )
{
- ScFormulaCell* pCell = pDocSh->GetDocument()->GetFormulaCell(aCellPos);
+ ScFormulaCell* pCell = pDocSh->GetDocument().GetFormulaCell(aCellPos);
if (!pCell)
return;
pCell->SetHybridDouble( nValue );
@@ -6478,7 +6475,7 @@ table::CellContentType SAL_CALL ScCellObj::getType() throw(uno::RuntimeException
ScDocShell* pDocSh = GetDocShell();
if (pDocSh)
{
- CellType eCalcType = pDocSh->GetDocument()->GetCellType( aCellPos );
+ CellType eCalcType = pDocSh->GetDocument().GetCellType( aCellPos );
switch (eCalcType)
{
case CELLTYPE_VALUE:
@@ -6509,7 +6506,7 @@ table::CellContentType ScCellObj::GetResultType_Impl()
if ( pDocSh )
{
ScRefCellValue aCell;
- aCell.assign(*pDocSh->GetDocument(), aCellPos);
+ aCell.assign(pDocSh->GetDocument(), aCellPos);
if (aCell.meType == CELLTYPE_FORMULA)
{
bool bValue = aCell.mpFormula->IsValue();
@@ -6531,7 +6528,7 @@ sal_Int32 SAL_CALL ScCellObj::getError() throw(uno::RuntimeException, std::excep
sal_uInt16 nError = 0;
ScRefCellValue aCell;
- aCell.assign(*pDocSh->GetDocument(), aCellPos);
+ aCell.assign(pDocSh->GetDocument(), aCellPos);
if (aCell.meType == CELLTYPE_FORMULA)
nError = aCell.mpFormula->GetErrCode();
@@ -6549,14 +6546,14 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellObj::getTokens()
if (!pDocSh)
return aSequence;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScRefCellValue aCell;
- aCell.assign(*pDoc, aCellPos);
+ aCell.assign(rDoc, aCellPos);
if (aCell.meType == CELLTYPE_FORMULA)
{
ScTokenArray* pTokenArray = aCell.mpFormula->GetCode();
if (pTokenArray)
- ScTokenConversion::ConvertToTokenSequence(*pDoc, aSequence, *pTokenArray);
+ ScTokenConversion::ConvertToTokenSequence(rDoc, aSequence, *pTokenArray);
}
return aSequence;
}
@@ -6567,11 +6564,11 @@ void SAL_CALL ScCellObj::setTokens( const uno::Sequence<sheet::FormulaToken>& rT
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScTokenArray aTokenArray;
- (void)ScTokenConversion::ConvertToTokenArray( *pDoc, aTokenArray, rTokens );
+ (void)ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
- ScFormulaCell* pNewCell = new ScFormulaCell(pDoc, aCellPos, aTokenArray);
+ ScFormulaCell* pNewCell = new ScFormulaCell(&rDoc, aCellPos, aTokenArray);
(void)pDocSh->GetDocFunc().SetFormulaCell(aCellPos, pNewCell, false);
}
}
@@ -7022,12 +7019,12 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getColumnPage
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- Size aSize(pDoc->GetPageSize( nTab ));
+ Size aSize(rDoc.GetPageSize( nTab ));
if (aSize.Width() && aSize.Height()) // effektive Groesse schon gesetzt?
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
else
{
// Umbrueche updaten wie in ScDocShell::PageStyleModified:
@@ -7038,7 +7035,7 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getColumnPage
SCCOL nCount = 0;
SCCOL nCol;
for (nCol=0; nCol<=MAXCOL; nCol++)
- if (pDoc->HasColBreak(nCol, nTab))
+ if (rDoc.HasColBreak(nCol, nTab))
++nCount;
sheet::TablePageBreakData aData;
@@ -7047,7 +7044,7 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getColumnPage
sal_uInt16 nPos = 0;
for (nCol=0; nCol<=MAXCOL; nCol++)
{
- ScBreakType nBreak = pDoc->HasColBreak(nCol, nTab);
+ ScBreakType nBreak = rDoc.HasColBreak(nCol, nTab);
if (nBreak)
{
aData.Position = nCol;
@@ -7068,19 +7065,19 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getRowPageBre
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- Size aSize(pDoc->GetPageSize( nTab ));
+ Size aSize(rDoc.GetPageSize( nTab ));
if (aSize.Width() && aSize.Height()) // effektive Groesse schon gesetzt?
- pDoc->UpdatePageBreaks( nTab );
+ rDoc.UpdatePageBreaks( nTab );
else
{
// Umbrueche updaten wie in ScDocShell::PageStyleModified:
ScPrintFunc aPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab );
aPrintFunc.UpdatePages();
}
- return pDoc->GetRowBreakData(nTab);
+ return rDoc.GetRowBreakData(nTab);
}
return uno::Sequence<sheet::TablePageBreakData>(0);
}
@@ -7093,21 +7090,21 @@ void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() throw(uno::RuntimeExc
{
//! docfunc Funktion, auch fuer ScViewFunc::RemoveManualBreaks
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bUndo (pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bUndo (rDoc.IsUndoEnabled());
SCTAB nTab = GetTab_Impl();
if (bUndo)
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pUndoDoc );
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) );
}
- pDoc->RemoveManualBreaks(nTab);
- pDoc->UpdatePageBreaks(nTab);
+ rDoc.RemoveManualBreaks(nTab);
+ rDoc.UpdatePageBreaks(nTab);
//? UpdatePageBreakData( sal_True );
pDocSh->SetDocumentModified();
@@ -7123,7 +7120,7 @@ OUString SAL_CALL ScTableSheetObj::getName() throw(uno::RuntimeException, std::e
OUString aName;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- pDocSh->GetDocument()->GetName( GetTab_Impl(), aName );
+ pDocSh->GetDocument().GetName( GetTab_Impl(), aName );
return aName;
}
@@ -7265,11 +7262,11 @@ void ScTableSheetObj::PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges )
{
// Umbrueche und Undo
ScDocShell* pDocSh = GetDocShell();
- ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : 0;
- if(pDocSh && pDoc)
+ if(pDocSh)
{
- const bool bUndo(pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pDocSh->GetDocument();
+ const bool bUndo(rDoc.IsUndoEnabled());
const SCTAB nTab(GetTab_Impl());
if(bUndo)
@@ -7279,7 +7276,7 @@ void ScTableSheetObj::PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges )
pDocSh,
nTab,
pOldRanges,
- pDoc->CreatePrintRangeSaver())); // create new ranges
+ rDoc.CreatePrintRangeSaver())); // create new ranges
// #i120105# ownership of old ranges has changed, mark as consumed
pOldRanges = 0;
@@ -7307,16 +7304,16 @@ uno::Sequence<table::CellRangeAddress> SAL_CALL ScTableSheetObj::getPrintAreas()
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- sal_uInt16 nCount = pDoc->GetPrintRangeCount( nTab );
+ sal_uInt16 nCount = rDoc.GetPrintRangeCount( nTab );
table::CellRangeAddress aRangeAddress;
uno::Sequence<table::CellRangeAddress> aSeq(nCount);
table::CellRangeAddress* pAry = aSeq.getArray();
for (sal_uInt16 i=0; i<nCount; i++)
{
- const ScRange* pRange = pDoc->GetPrintRange( nTab, i );
+ const ScRange* pRange = rDoc.GetPrintRange( nTab, i );
OSL_ENSURE(pRange,"wo ist der Druckbereich");
if (pRange)
{
@@ -7339,14 +7336,14 @@ void SAL_CALL ScTableSheetObj::setPrintAreas(
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- if ( pDoc->IsUndoEnabled() )
- pOldRanges = pDoc->CreatePrintRangeSaver();
+ if ( rDoc.IsUndoEnabled() )
+ pOldRanges = rDoc.CreatePrintRangeSaver();
sal_uInt16 nCount = (sal_uInt16) aPrintAreas.getLength();
- pDoc->ClearPrintRanges( nTab );
+ rDoc.ClearPrintRanges( nTab );
if (nCount)
{
ScRange aPrintRange;
@@ -7354,11 +7351,11 @@ void SAL_CALL ScTableSheetObj::setPrintAreas(
for (sal_uInt16 i=0; i<nCount; i++)
{
ScUnoConversion::FillScRange( aPrintRange, pAry[i] );
- pDoc->AddPrintRange( nTab, aPrintRange );
+ rDoc.AddPrintRange( nTab, aPrintRange );
}
}
- if ( pDoc->IsUndoEnabled() )
+ if ( rDoc.IsUndoEnabled() )
PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc.
}
}
@@ -7369,9 +7366,9 @@ sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleColumns() throw(uno::RuntimeExce
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- return ( pDoc->GetRepeatColRange(nTab) != NULL );
+ return ( rDoc.GetRepeatColRange(nTab) != NULL );
}
return false;
}
@@ -7383,21 +7380,21 @@ void SAL_CALL ScTableSheetObj::setPrintTitleColumns( sal_Bool bPrintTitleColumns
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver();
+ ScPrintRangeSaver* pOldRanges = rDoc.CreatePrintRangeSaver();
if ( bPrintTitleColumns )
{
- if ( !pDoc->GetRepeatColRange( nTab ) ) // keinen bestehenden Bereich veraendern
+ if ( !rDoc.GetRepeatColRange( nTab ) ) // keinen bestehenden Bereich veraendern
{
ScRange aNew( 0, 0, nTab, 0, 0, nTab ); // Default
- pDoc->SetRepeatColRange( nTab, &aNew ); // einschalten
+ rDoc.SetRepeatColRange( nTab, &aNew ); // einschalten
}
}
else
- pDoc->SetRepeatColRange( nTab, NULL ); // abschalten
+ rDoc.SetRepeatColRange( nTab, NULL ); // abschalten
PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc.
@@ -7412,9 +7409,9 @@ table::CellRangeAddress SAL_CALL ScTableSheetObj::getTitleColumns() throw(uno::R
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- const ScRange* pRange = pDoc->GetRepeatColRange(nTab);
+ const ScRange* pRange = rDoc.GetRepeatColRange(nTab);
if (pRange)
{
ScUnoConversion::FillApiRange( aRet, *pRange );
@@ -7431,14 +7428,14 @@ void SAL_CALL ScTableSheetObj::setTitleColumns( const table::CellRangeAddress& a
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver();
+ ScPrintRangeSaver* pOldRanges = rDoc.CreatePrintRangeSaver();
ScRange aNew;
ScUnoConversion::FillScRange( aNew, aTitleColumns );
- pDoc->SetRepeatColRange( nTab, &aNew ); // immer auch einschalten
+ rDoc.SetRepeatColRange( nTab, &aNew ); // immer auch einschalten
PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc.
}
@@ -7450,9 +7447,9 @@ sal_Bool SAL_CALL ScTableSheetObj::getPrintTitleRows() throw(uno::RuntimeExcepti
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- return ( pDoc->GetRepeatRowRange(nTab) != NULL );
+ return ( rDoc.GetRepeatRowRange(nTab) != NULL );
}
return false;
}
@@ -7464,21 +7461,21 @@ void SAL_CALL ScTableSheetObj::setPrintTitleRows( sal_Bool bPrintTitleRows )
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver();
+ ScPrintRangeSaver* pOldRanges = rDoc.CreatePrintRangeSaver();
if ( bPrintTitleRows )
{
- if ( !pDoc->GetRepeatRowRange( nTab ) ) // keinen bestehenden Bereich veraendern
+ if ( !rDoc.GetRepeatRowRange( nTab ) ) // keinen bestehenden Bereich veraendern
{
ScRange aNew( 0, 0, nTab, 0, 0, nTab ); // Default
- pDoc->SetRepeatRowRange( nTab, &aNew ); // einschalten
+ rDoc.SetRepeatRowRange( nTab, &aNew ); // einschalten
}
}
else
- pDoc->SetRepeatRowRange( nTab, NULL ); // abschalten
+ rDoc.SetRepeatRowRange( nTab, NULL ); // abschalten
PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc.
@@ -7493,9 +7490,9 @@ table::CellRangeAddress SAL_CALL ScTableSheetObj::getTitleRows() throw(uno::Runt
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- const ScRange* pRange = pDoc->GetRepeatRowRange(nTab);
+ const ScRange* pRange = rDoc.GetRepeatRowRange(nTab);
if (pRange)
{
ScUnoConversion::FillApiRange( aRet, *pRange );
@@ -7512,14 +7509,14 @@ void SAL_CALL ScTableSheetObj::setTitleRows( const table::CellRangeAddress& aTit
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver();
+ ScPrintRangeSaver* pOldRanges = rDoc.CreatePrintRangeSaver();
ScRange aNew;
ScUnoConversion::FillScRange( aNew, aTitleRows );
- pDoc->SetRepeatRowRange( nTab, &aNew ); // immer auch einschalten
+ rDoc.SetRepeatRowRange( nTab, &aNew ); // immer auch einschalten
PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc.
}
@@ -7534,7 +7531,7 @@ sheet::SheetLinkMode SAL_CALL ScTableSheetObj::getLinkMode() throw(uno::RuntimeE
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- sal_uInt8 nMode = pDocSh->GetDocument()->GetLinkMode( GetTab_Impl() );
+ sal_uInt8 nMode = pDocSh->GetDocument().GetLinkMode( GetTab_Impl() );
if ( nMode == SC_LINK_NORMAL )
eRet = sheet::SheetLinkMode_NORMAL;
else if ( nMode == SC_LINK_VALUE )
@@ -7563,7 +7560,7 @@ OUString SAL_CALL ScTableSheetObj::getLinkUrl() throw(uno::RuntimeException, std
OUString aFile;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- aFile = pDocSh->GetDocument()->GetLinkDoc( GetTab_Impl() );
+ aFile = pDocSh->GetDocument().GetLinkDoc( GetTab_Impl() );
return aFile;
}
@@ -7587,7 +7584,7 @@ OUString SAL_CALL ScTableSheetObj::getLinkSheetName() throw(uno::RuntimeExceptio
OUString aSheet;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- aSheet = pDocSh->GetDocument()->GetLinkTab( GetTab_Impl() );
+ aSheet = pDocSh->GetDocument().GetLinkTab( GetTab_Impl() );
return aSheet;
}
@@ -7613,7 +7610,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
OUString aFileString = aUrl;
@@ -7636,7 +7633,7 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
nLinkMode = SC_LINK_VALUE;
sal_uLong nRefresh = 0;
- pDoc->SetLink( nTab, nLinkMode, aFileString, aFilterString, aOptString, aSheetString, nRefresh );
+ rDoc.SetLink( nTab, nLinkMode, aFileString, aFilterString, aOptString, aSheetString, nRefresh );
pDocSh->UpdateLinks(); // ggf. Link eintragen oder loeschen
SfxBindings* pBindings = pDocSh->GetViewBindings();
@@ -7645,12 +7642,12 @@ void SAL_CALL ScTableSheetObj::link( const OUString& aUrl, const OUString& aShee
//! Undo fuer Link-Daten an der Table
- if ( nLinkMode != SC_LINK_NONE && pDoc->IsExecuteLinkEnabled() ) // Link updaten
+ if ( nLinkMode != SC_LINK_NONE && rDoc.IsExecuteLinkEnabled() ) // Link updaten
{
// Update immer, auch wenn der Link schon da war
//! Update nur fuer die betroffene Tabelle???
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
sal_uInt16 nCount = pLinkManager->GetLinks().size();
for ( sal_uInt16 i=0; i<nCount; i++ )
{
@@ -7877,7 +7874,7 @@ void SAL_CALL ScTableSheetObj::protect( const OUString& aPassword )
SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
// #i108245# if already protected, don't change anything
- if ( pDocSh && !pDocSh->GetDocument()->IsTabProtected( GetTab_Impl() ) )
+ if ( pDocSh && !pDocSh->GetDocument().IsTabProtected( GetTab_Impl() ) )
{
OUString aString(aPassword);
pDocSh->GetDocFunc().Protect( GetTab_Impl(), aString, true );
@@ -7903,7 +7900,7 @@ sal_Bool SAL_CALL ScTableSheetObj::isProtected() throw(uno::RuntimeException, st
SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- return pDocSh->GetDocument()->IsTabProtected( GetTab_Impl() );
+ return pDocSh->GetDocument().IsTabProtected( GetTab_Impl() );
OSL_FAIL("keine DocShell"); //! Exception oder so?
return false;
@@ -7916,7 +7913,7 @@ sal_Bool SAL_CALL ScTableSheetObj::getIsScenario() throw(uno::RuntimeException,
SolarMutexGuard aGuard;
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- return pDocSh->GetDocument()->IsScenario( GetTab_Impl() );
+ return pDocSh->GetDocument().IsScenario( GetTab_Impl() );
return false;
}
@@ -7930,7 +7927,7 @@ OUString SAL_CALL ScTableSheetObj::getScenarioComment() throw(uno::RuntimeExcept
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDocSh->GetDocument()->GetScenarioData( GetTab_Impl(), aComment, aColor, nFlags );
+ pDocSh->GetDocument().GetScenarioData( GetTab_Impl(), aComment, aColor, nFlags );
return aComment;
}
return OUString();
@@ -7943,15 +7940,15 @@ void SAL_CALL ScTableSheetObj::setScenarioComment( const OUString& aScenarioComm
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
aComment = aScenarioComment;
@@ -7966,10 +7963,10 @@ void SAL_CALL ScTableSheetObj::addRanges( const uno::Sequence<table::CellRangeAd
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
ScMarkData aMarkData;
aMarkData.SelectTable( nTab, true );
@@ -7989,7 +7986,7 @@ void SAL_CALL ScTableSheetObj::addRanges( const uno::Sequence<table::CellRangeAd
}
// Szenario-Ranges sind durch Attribut gekennzeichnet
- ScPatternAttr aPattern( pDoc->GetPool() );
+ ScPatternAttr aPattern( rDoc.GetPool() );
aPattern.GetItemSet().Put( ScMergeFlagAttr( SC_MF_SCENARIO ) );
aPattern.GetItemSet().Put( ScProtectionAttr( true ) );
pDocSh->GetDocFunc().ApplyAttributes( aMarkData, aPattern, true, true );
@@ -8003,16 +8000,16 @@ void SAL_CALL ScTableSheetObj::apply() throw(uno::RuntimeException, std::excepti
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
OUString aName;
- pDoc->GetName( nTab, aName ); // Name dieses Szenarios
+ rDoc.GetName( nTab, aName ); // Name dieses Szenarios
SCTAB nDestTab = nTab;
- while ( nDestTab > 0 && pDoc->IsScenario(nDestTab) )
+ while ( nDestTab > 0 && rDoc.IsScenario(nDestTab) )
--nDestTab;
- if ( !pDoc->IsScenario(nDestTab) )
+ if ( !rDoc.IsScenario(nDestTab) )
pDocSh->UseScenario( nDestTab, aName );
//! sonst Fehler oder so
@@ -8028,9 +8025,9 @@ uno::Sequence< table::CellRangeAddress > SAL_CALL ScTableSheetObj::getRanges( )
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
- const ScRangeList* pRangeList = pDoc->GetScenarioRanges(nTab);
+ const ScRangeList* pRangeList = rDoc.GetScenarioRanges(nTab);
if (pRangeList)
{
size_t nCount = pRangeList->size();
@@ -8061,16 +8058,13 @@ void ScTableSheetObj::setExternalName( const OUString& aUrl, const OUString& aSh
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
- if ( pDoc )
+ ScDocument& rDoc = pDocSh->GetDocument();
+ const SCTAB nTab = GetTab_Impl();
+ const OUString aAbsDocName( ScGlobal::GetAbsDocName( aUrl, pDocSh ) );
+ const OUString aDocTabName( ScGlobal::GetDocTabName( aAbsDocName, aSheetName ) );
+ if ( !rDoc.RenameTab( nTab, aDocTabName, false /*bUpdateRef*/, true /*bExternalDocument*/ ) )
{
- const SCTAB nTab = GetTab_Impl();
- const OUString aAbsDocName( ScGlobal::GetAbsDocName( aUrl, pDocSh ) );
- const OUString aDocTabName( ScGlobal::GetDocTabName( aAbsDocName, aSheetName ) );
- if ( !pDoc->RenameTab( nTab, aDocTabName, false /*bUpdateRef*/, true /*bExternalDocument*/ ) )
- {
- throw container::ElementExistException( OUString(), *this );
- }
+ throw container::ElementExistException( OUString(), *this );
}
}
}
@@ -8116,7 +8110,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
ScDocShell* pDocSh = GetDocShell();
if (!pDocSh)
return; //! Exception oder so?
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
ScDocFunc &rFunc = pDocSh->GetDocFunc();
@@ -8129,10 +8123,10 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
//! Undo? (auch bei SID_STYLE_APPLY an der View)
- if ( pDoc->GetPageStyle( nTab ) != aNewStr )
+ if ( rDoc.GetPageStyle( nTab ) != aNewStr )
{
- pDoc->SetPageStyle( nTab, aNewStr );
- if (!pDoc->IsImportingXML())
+ rDoc.SetPageStyle( nTab, aNewStr );
+ if (!rDoc.IsImportingXML())
{
ScPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab ).UpdatePages();
@@ -8156,12 +8150,12 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_ISACTIVE )
{
- if (pDoc->IsScenario(nTab))
- pDoc->SetActiveScenario( nTab, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ if (rDoc.IsScenario(nTab))
+ rDoc.SetActiveScenario( nTab, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
}
else if ( pEntry->nWID == SC_WID_UNO_BORDCOL )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
sal_Int32 nNewColor = 0;
if (aValue >>= nNewColor)
@@ -8170,8 +8164,8 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
aColor = Color(static_cast<sal_uInt32>(nNewColor));
@@ -8181,14 +8175,14 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_PROTECT )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -8214,14 +8208,14 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_SHOWBORD )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -8247,14 +8241,14 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_PRINTBORD )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -8280,14 +8274,14 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_COPYBACK )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -8313,14 +8307,14 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_COPYSTYL )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -8346,14 +8340,14 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_COPYFORM )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aName;
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetName( nTab, aName );
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetName( nTab, aName );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
bool bModify(false);
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
@@ -8392,11 +8386,11 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
{
bool bAutoPrint = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if (bAutoPrint)
- pDoc->SetPrintEntireSheet( nTab ); // clears all print ranges
+ rDoc.SetPrintEntireSheet( nTab ); // clears all print ranges
else
{
- if (pDoc->IsPrintEntireSheet( nTab ))
- pDoc->ClearPrintRanges( nTab ); // if this flag is true, there are no PrintRanges, so Clear clears only the flag.
+ if (rDoc.IsPrintEntireSheet( nTab ))
+ rDoc.ClearPrintRanges( nTab ); // if this flag is true, there are no PrintRanges, so Clear clears only the flag.
}
}
else if ( pEntry->nWID == SC_WID_UNO_TABCOLOR )
@@ -8405,7 +8399,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
if ( aValue >>= nColor )
{
const Color aColor( static_cast< ColorData >( nColor ) );
- if ( pDoc->GetTabBgColor( nTab ) != aColor )
+ if ( rDoc.GetTabBgColor( nTab ) != aColor )
rFunc.SetTabBgColor( nTab, aColor, true, true );
}
}
@@ -8414,7 +8408,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
OUString aCodeName;
if ( pDocSh && ( aValue >>= aCodeName ) )
{
- pDocSh->GetDocument()->SetCodeName( GetTab_Impl(), aCodeName );
+ pDocSh->GetDocument().SetCodeName( GetTab_Impl(), aCodeName );
}
}
else
@@ -8432,7 +8426,7 @@ void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
ScDocShell* pDocSh = GetDocShell();
if (!pDocSh)
throw uno::RuntimeException();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = GetTab_Impl();
if ( pEntry->nWID == SC_WID_UNO_NAMES )
@@ -8442,11 +8436,11 @@ void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
else if ( pEntry->nWID == SC_WID_UNO_PAGESTL )
{
rAny <<= OUString( ScStyleNameConversion::DisplayToProgrammaticName(
- pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ) );
+ rDoc.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ) );
}
else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
{
- bool bVis = pDoc->IsVisible( nTab );
+ bool bVis = rDoc.IsVisible( nTab );
ScUnoHelpFunctions::SetBoolInAny( rAny, bVis );
}
else if ( pEntry->nWID == SC_WID_UNO_LINKDISPBIT )
@@ -8461,114 +8455,114 @@ void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn
}
else if ( pEntry->nWID == SC_WID_UNO_ISACTIVE )
{
- if (pDoc->IsScenario(nTab))
- ScUnoHelpFunctions::SetBoolInAny( rAny, pDoc->IsActiveScenario( nTab ));
+ if (rDoc.IsScenario(nTab))
+ ScUnoHelpFunctions::SetBoolInAny( rAny, rDoc.IsActiveScenario( nTab ));
}
else if ( pEntry->nWID == SC_WID_UNO_BORDCOL )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
rAny <<= static_cast<sal_Int32>(aColor.GetColor());
}
}
else if ( pEntry->nWID == SC_WID_UNO_PROTECT )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
ScUnoHelpFunctions::SetBoolInAny( rAny, (nFlags & SC_SCENARIO_PROTECT) != 0 );
}
}
else if ( pEntry->nWID == SC_WID_UNO_SHOWBORD )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
ScUnoHelpFunctions::SetBoolInAny( rAny, (nFlags & SC_SCENARIO_SHOWFRAME) != 0 );
}
}
else if ( pEntry->nWID == SC_WID_UNO_PRINTBORD )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
ScUnoHelpFunctions::SetBoolInAny( rAny, (nFlags & SC_SCENARIO_PRINTFRAME) != 0 );
}
}
else if ( pEntry->nWID == SC_WID_UNO_COPYBACK )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
ScUnoHelpFunctions::SetBoolInAny( rAny, (nFlags & SC_SCENARIO_TWOWAY) != 0 );
}
}
else if ( pEntry->nWID == SC_WID_UNO_COPYSTYL )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
ScUnoHelpFunctions::SetBoolInAny( rAny, (nFlags & SC_SCENARIO_ATTRIB) != 0 );
}
}
else if ( pEntry->nWID == SC_WID_UNO_COPYFORM )
{
- if (pDoc->IsScenario(nTab))
+ if (rDoc.IsScenario(nTab))
{
OUString aComment;
Color aColor;
sal_uInt16 nFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nFlags );
ScUnoHelpFunctions::SetBoolInAny( rAny, !(nFlags & SC_SCENARIO_VALUE));
}
}
else if ( pEntry->nWID == SC_WID_UNO_TABLAYOUT )
{
- if (pDoc->IsLayoutRTL(nTab))
+ if (rDoc.IsLayoutRTL(nTab))
rAny <<= sal_Int16(com::sun::star::text::WritingMode2::RL_TB);
else
rAny <<= sal_Int16(com::sun::star::text::WritingMode2::LR_TB);
}
else if ( pEntry->nWID == SC_WID_UNO_AUTOPRINT )
{
- bool bAutoPrint = pDoc->IsPrintEntireSheet( nTab );
+ bool bAutoPrint = rDoc.IsPrintEntireSheet( nTab );
ScUnoHelpFunctions::SetBoolInAny( rAny, bAutoPrint );
}
else if ( pEntry->nWID == SC_WID_UNO_TABCOLOR )
{
- rAny <<= sal_Int32(pDoc->GetTabBgColor(nTab).GetColor());
+ rAny <<= sal_Int32(rDoc.GetTabBgColor(nTab).GetColor());
}
else if ( pEntry->nWID == SC_WID_UNO_CODENAME )
{
OUString aCodeName;
if ( pDocSh )
- pDocSh->GetDocument()->GetCodeName( GetTab_Impl(), aCodeName );
+ pDocSh->GetDocument().GetCodeName( GetTab_Impl(), aCodeName );
rAny <<= OUString( aCodeName );
}
else
@@ -8799,7 +8793,7 @@ void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
if (!pDocSh)
throw uno::RuntimeException();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
const ScRange& rRange = GetRange();
OSL_ENSURE(rRange.aStart.Col() == rRange.aEnd.Col(), "zuviele Spalten");
SCCOL nCol = rRange.aStart.Col();
@@ -8808,30 +8802,30 @@ void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
if ( pEntry->nWID == SC_WID_UNO_CELLWID )
{
// for hidden column, return original height
- sal_uInt16 nWidth = pDoc->GetOriginalWidth( nCol, nTab );
+ sal_uInt16 nWidth = rDoc.GetOriginalWidth( nCol, nTab );
// property is 1/100mm, column width is twips
nWidth = (sal_uInt16) TwipsToHMM(nWidth);
rAny <<= (sal_Int32)( nWidth );
}
else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
{
- bool bHidden = pDoc->ColHidden(nCol, nTab);
+ bool bHidden = rDoc.ColHidden(nCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, !bHidden );
}
else if ( pEntry->nWID == SC_WID_UNO_OWIDTH )
{
//! momentan immer gesetzt ??!?!
- bool bOpt = !(pDoc->GetColFlags( nCol, nTab ) & CR_MANUALSIZE);
+ bool bOpt = !(rDoc.GetColFlags( nCol, nTab ) & CR_MANUALSIZE);
ScUnoHelpFunctions::SetBoolInAny( rAny, bOpt );
}
else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE )
{
- ScBreakType nBreak = pDoc->HasColBreak(nCol, nTab);
+ ScBreakType nBreak = rDoc.HasColBreak(nCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak );
}
else if ( pEntry->nWID == SC_WID_UNO_MANPAGE )
{
- ScBreakType nBreak = pDoc->HasColBreak(nCol, nTab);
+ ScBreakType nBreak = rDoc.HasColBreak(nCol, nTab);
ScUnoHelpFunctions::SetBoolInAny(rAny, (nBreak & BREAK_MANUAL) != 0);
}
else
@@ -8882,7 +8876,7 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
ScDocShell* pDocSh = GetDocShell();
if (!pDocSh)
return; //! Exception oder so?
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
const ScRange& rRange = GetRange();
OSL_ENSURE(rRange.aStart.Row() == rRange.aEnd.Row(), "zuviele Zeilen");
SCROW nRow = rRange.aStart.Row();
@@ -8913,7 +8907,7 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
{
bool bFil = ScUnoHelpFunctions::GetBoolFromAny( aValue );
// SC_SIZE_DIRECT mit Groesse 0 blendet aus
- pDoc->SetRowFiltered(nRow, nRow, nTab, bFil);
+ rDoc.SetRowFiltered(nRow, nRow, nTab, bFil);
}
else if ( pEntry->nWID == SC_WID_UNO_OHEIGHT )
{
@@ -8923,7 +8917,7 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
else
{
// set current height again manually
- sal_uInt16 nHeight = pDoc->GetOriginalHeight( nRow, nTab );
+ sal_uInt16 nHeight = rDoc.GetOriginalHeight( nRow, nTab );
rFunc.SetWidthOrHeight(false, aRowArr, nTab, SC_SIZE_ORIGINAL, nHeight, true, true);
}
}
@@ -8948,7 +8942,7 @@ void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
ScDocShell* pDocSh = GetDocShell();
if (!pDocSh)
throw uno::RuntimeException();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
const ScRange& rRange = GetRange();
OSL_ENSURE(rRange.aStart.Row() == rRange.aEnd.Row(), "zuviele Zeilen");
SCROW nRow = rRange.aStart.Row();
@@ -8957,34 +8951,34 @@ void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
if ( pEntry->nWID == SC_WID_UNO_CELLHGT )
{
// for hidden row, return original height
- sal_uInt16 nHeight = pDoc->GetOriginalHeight( nRow, nTab );
+ sal_uInt16 nHeight = rDoc.GetOriginalHeight( nRow, nTab );
// property is 1/100mm, row height is twips
nHeight = (sal_uInt16) TwipsToHMM(nHeight);
rAny <<= (sal_Int32)( nHeight );
}
else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
{
- bool bHidden = pDoc->RowHidden(nRow, nTab);
+ bool bHidden = rDoc.RowHidden(nRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, !bHidden );
}
else if ( pEntry->nWID == SC_WID_UNO_CELLFILT )
{
- bool bVis = pDoc->RowFiltered(nRow, nTab);
+ bool bVis = rDoc.RowFiltered(nRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, bVis );
}
else if ( pEntry->nWID == SC_WID_UNO_OHEIGHT )
{
- bool bOpt = !(pDoc->GetRowFlags( nRow, nTab ) & CR_MANUALSIZE);
+ bool bOpt = !(rDoc.GetRowFlags( nRow, nTab ) & CR_MANUALSIZE);
ScUnoHelpFunctions::SetBoolInAny( rAny, bOpt );
}
else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE )
{
- ScBreakType nBreak = pDoc->HasRowBreak(nRow, nTab);
+ ScBreakType nBreak = rDoc.HasRowBreak(nRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak );
}
else if ( pEntry->nWID == SC_WID_UNO_MANPAGE )
{
- ScBreakType nBreak = (pDoc->HasRowBreak(nRow, nTab) & BREAK_MANUAL);
+ ScBreakType nBreak = (rDoc.HasRowBreak(nRow, nTab) & BREAK_MANUAL);
ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak );
}
else
@@ -9001,13 +8995,13 @@ ScCellsObj::ScCellsObj(ScDocShell* pDocSh, const ScRangeList& rR) :
pDocShell( pDocSh ),
aRanges( rR )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScCellsObj::~ScCellsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -9015,7 +9009,7 @@ void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( rHint.ISA( ScUpdateRefHint ) )
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- aRanges.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
+ aRanges.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
}
else if ( rHint.ISA( SfxSimpleHint ) &&
@@ -9062,8 +9056,8 @@ ScCellsEnumeration::ScCellsEnumeration(ScDocShell* pDocSh, const ScRangeList& rR
pMark( NULL ),
bAtEnd( false )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->AddUnoObject(*this);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.AddUnoObject(*this);
if ( aRanges.empty() )
bAtEnd = true;
@@ -9084,9 +9078,9 @@ void ScCellsEnumeration::CheckPos_Impl()
return;
bool bFound = false;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRefCellValue aCell;
- aCell.assign(*pDoc, aPos);
+ aCell.assign(rDoc, aPos);
if (!aCell.isEmpty())
{
if (!pMark)
@@ -9104,7 +9098,7 @@ void ScCellsEnumeration::CheckPos_Impl()
ScCellsEnumeration::~ScCellsEnumeration()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
delete pMark;
}
@@ -9121,7 +9115,7 @@ void ScCellsEnumeration::Advance_Impl()
SCCOL nCol = aPos.Col();
SCROW nRow = aPos.Row();
SCTAB nTab = aPos.Tab();
- bool bFound = pDocShell->GetDocument()->GetNextMarkedCell( nCol, nRow, nTab, *pMark );
+ bool bFound = pDocShell->GetDocument().GetNextMarkedCell( nCol, nRow, nTab, *pMark );
if (bFound)
aPos.Set( nCol, nRow, nTab );
else
@@ -9135,7 +9129,7 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
if (pDocShell)
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- aRanges.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
+ aRanges.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
delete pMark; // aus verschobenen Bereichen neu erzeugen
@@ -9145,7 +9139,7 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
ScRangeList aNew;
aNew.Append(ScRange(aPos));
- aNew.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
+ aNew.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
if (aNew.size()==1)
{
@@ -9190,8 +9184,8 @@ ScCellFormatsObj::ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) :
pDocShell( pDocSh ),
aTotalRange( rRange )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->AddUnoObject(*this);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.AddUnoObject(*this);
OSL_ENSURE( aTotalRange.aStart.Tab() == aTotalRange.aEnd.Tab(), "unterschiedliche Tabellen" );
}
@@ -9199,7 +9193,7 @@ ScCellFormatsObj::ScCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) :
ScCellFormatsObj::~ScCellFormatsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -9222,9 +9216,9 @@ ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(long nIndex) const
ScCellRangeObj* pRet = NULL;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
long nPos = 0;
- ScAttrRectIterator aIter( pDoc, aTotalRange.aStart.Tab(),
+ ScAttrRectIterator aIter( &rDoc, aTotalRange.aStart.Tab(),
aTotalRange.aStart.Col(), aTotalRange.aStart.Row(),
aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() );
SCCOL nCol1, nCol2;
@@ -9258,8 +9252,8 @@ sal_Int32 SAL_CALL ScCellFormatsObj::getCount() throw(uno::RuntimeException, std
long nCount = 0;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScAttrRectIterator aIter( pDoc, aTotalRange.aStart.Tab(),
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScAttrRectIterator aIter( &rDoc, aTotalRange.aStart.Tab(),
aTotalRange.aStart.Col(), aTotalRange.aStart.Row(),
aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() );
SCCOL nCol1, nCol2;
@@ -9313,13 +9307,13 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR
bAtEnd( false ),
bDirty( false )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->AddUnoObject(*this);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.AddUnoObject(*this);
OSL_ENSURE( rRange.aStart.Tab() == rRange.aEnd.Tab(),
"CellFormatsEnumeration: unterschiedliche Tabellen" );
- pIter = new ScAttrRectIterator( pDoc, nTab,
+ pIter = new ScAttrRectIterator( &rDoc, nTab,
rRange.aStart.Col(), rRange.aStart.Row(),
rRange.aEnd.Col(), rRange.aEnd.Row() );
Advance_Impl();
@@ -9328,7 +9322,7 @@ ScCellFormatsEnumeration::ScCellFormatsEnumeration(ScDocShell* pDocSh, const ScR
ScCellFormatsEnumeration::~ScCellFormatsEnumeration()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
delete pIter;
}
@@ -9417,7 +9411,7 @@ ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange
aTotalRange( rRange ),
aRangeLists()
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
OSL_ENSURE( aTotalRange.aStart.Tab() == aTotalRange.aEnd.Tab(), "unterschiedliche Tabellen" );
@@ -9427,7 +9421,7 @@ ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange
ScUniqueCellFormatsObj::~ScUniqueCellFormatsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScUniqueCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -9590,9 +9584,9 @@ void ScUniqueCellFormatsObj::GetObjects_Impl()
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTab = aTotalRange.aStart.Tab();
- ScAttrRectIterator aIter( pDoc, nTab,
+ ScAttrRectIterator aIter( &rDoc, nTab,
aTotalRange.aStart.Col(), aTotalRange.aStart.Row(),
aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() );
SCCOL nCol1, nCol2;
@@ -9604,7 +9598,7 @@ void ScUniqueCellFormatsObj::GetObjects_Impl()
while (aIter.GetNext( nCol1, nCol2, nRow1, nRow2 ) )
{
ScRange aRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab );
- const ScPatternAttr* pPattern = pDoc->GetPattern(nCol1, nRow1, nTab);
+ const ScPatternAttr* pPattern = rDoc.GetPattern(nCol1, nRow1, nTab);
aHashMap[pPattern].Join( aRange );
}
@@ -9679,13 +9673,13 @@ ScUniqueCellFormatsEnumeration::ScUniqueCellFormatsEnumeration(ScDocShell* pDocS
pDocShell( pDocSh ),
nCurrentPosition(0)
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScUniqueCellFormatsEnumeration::~ScUniqueCellFormatsEnumeration()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScUniqueCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index c94e4d9f5507..a0c70540f14d 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -56,8 +56,8 @@ static SdrOle2Obj* lcl_FindChartObj( ScDocShell* pDocShell, SCTAB nTab, const OU
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if (pDrawLayer)
{
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
@@ -68,7 +68,7 @@ static SdrOle2Obj* lcl_FindChartObj( ScDocShell* pDocShell, SCTAB nTab, const OU
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart(pObject) )
+ if ( pObject->GetObjIdentifier() == OBJ_OLE2 && rDoc.IsChart(pObject) )
{
uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef();
if ( xObj.is() )
@@ -90,13 +90,13 @@ ScChartsObj::ScChartsObj(ScDocShell* pDocSh, SCTAB nT) :
pDocShell( pDocSh ),
nTab( nT )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScChartsObj::~ScChartsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScChartsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -115,8 +115,8 @@ ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const
OUString aName;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if (pDrawLayer)
{
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
@@ -128,7 +128,7 @@ ScChartObj* ScChartsObj::GetObjectByIndex_Impl(long nIndex) const
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart(pObject) )
+ if ( pObject->GetObjIdentifier() == OBJ_OLE2 && rDoc.IsChart(pObject) )
{
if ( nPos == nIndex )
{
@@ -170,11 +170,11 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
if (!pDocShell)
return;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScDrawLayer* pModel = pDocShell->MakeDrawLayer();
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
OSL_ENSURE(pPage,"addChart: keine Page");
- if (!pPage || !pDoc)
+ if (!pPage)
return;
// chart can't be inserted if any ole object with that name exists on any table
@@ -210,7 +210,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
// Rechteck anpassen
//! Fehler/Exception, wenn leer/ungueltig ???
Point aRectPos( aRect.X, aRect.Y );
- bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
if ( ( aRectPos.X() < 0 && !bLayoutRTL ) || ( aRectPos.X() > 0 && bLayoutRTL ) )
aRectPos.X() = 0;
@@ -235,7 +235,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
// Calc -> DataProvider
uno::Reference< chart2::data::XDataProvider > xDataProvider = new
- ScChart2DataProvider( pDoc );
+ ScChart2DataProvider( &rDoc );
// Chart -> DataReceiver
uno::Reference< chart2::data::XDataReceiver > xReceiver;
uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
@@ -244,7 +244,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
if( xReceiver.is())
{
OUString sRangeStr;
- xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
+ xNewRanges->Format(sRangeStr, SCR_ABS_3D, &rDoc);
// connect
if( !sRangeStr.isEmpty() )
@@ -273,8 +273,8 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
}
ScChartListener* pChartListener =
- new ScChartListener( aName, pDoc, xNewRanges );
- pDoc->GetChartListenerCollection()->insert( pChartListener );
+ new ScChartListener( aName, &rDoc, xNewRanges );
+ rDoc.GetChartListenerCollection()->insert( pChartListener );
pChartListener->StartListeningTo();
SdrOle2Obj* pObj = new SdrOle2Obj( ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), aName, aInsRect );
@@ -299,9 +299,9 @@ void SAL_CALL ScChartsObj::removeByName( const OUString& aName )
SdrOle2Obj* pObj = lcl_FindChartObj( pDocShell, nTab, aName );
if (pObj)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->GetChartListenerCollection()->removeByName(aName);
- ScDrawLayer* pModel = pDoc->GetDrawLayer(); // ist nicht 0
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.GetChartListenerCollection()->removeByName(aName);
+ ScDrawLayer* pModel = rDoc.GetDrawLayer(); // ist nicht 0
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); // ist nicht 0
pModel->AddUndo( new SdrUndoDelObj( *pObj ) );
@@ -328,8 +328,8 @@ sal_Int32 SAL_CALL ScChartsObj::getCount() throw(uno::RuntimeException, std::exc
sal_Int32 nCount = 0;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if (pDrawLayer)
{
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
@@ -340,7 +340,7 @@ sal_Int32 SAL_CALL ScChartsObj::getCount() throw(uno::RuntimeException, std::exc
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart(pObject) )
+ if ( pObject->GetObjIdentifier() == OBJ_OLE2 && rDoc.IsChart(pObject) )
++nCount;
pObject = aIter.Next();
}
@@ -391,14 +391,14 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() throw(uno::Runti
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
long nCount = getCount();
uno::Sequence<OUString> aSeq(nCount);
OUString* pAry = aSeq.getArray();
long nPos = 0;
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
if (pDrawLayer)
{
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
@@ -409,7 +409,7 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() throw(uno::Runti
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart(pObject) )
+ if ( pObject->GetObjIdentifier() == OBJ_OLE2 && rDoc.IsChart(pObject) )
{
OUString aName;
uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObject)->GetObjRef();
@@ -444,7 +444,7 @@ ScChartObj::ScChartObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN)
,nTab( nT )
,aChartName( rN )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
uno::Sequence< table::CellRangeAddress > aInitialPropValue;
registerPropertyNoMember( OUString( "RelatedCellRanges" ),
@@ -455,7 +455,7 @@ ScChartObj::ScChartObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN)
ScChartObj::~ScChartObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScChartObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -472,11 +472,11 @@ void ScChartObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool& rRowHeaders ) const
{
bool bFound = false;
- ScDocument* pDoc = (pDocShell? pDocShell->GetDocument(): 0);
- if( pDoc )
+ if( pDocShell )
{
- uno::Reference< chart2::XChartDocument > xChartDoc( pDoc->GetChartByName( aChartName ) );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ uno::Reference< chart2::XChartDocument > xChartDoc( rDoc.GetChartByName( aChartName ) );
if( xChartDoc.is() )
{
uno::Reference< chart2::data::XDataReceiver > xReceiver( xChartDoc, uno::UNO_QUERY );
@@ -516,7 +516,7 @@ void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool&
rColHeaders=bHasCategories;
rRowHeaders=bFirstCellAsLabel;
}
- rRanges->Parse( aRanges, pDoc);
+ rRanges->Parse( aRanges, &rDoc);
}
bFound = true;
}
@@ -533,15 +533,15 @@ void ScChartObj::Update_Impl( const ScRangeListRef& rRanges, bool bColHeaders, b
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
if (bUndo)
{
pDocShell->GetUndoManager()->AddUndoAction(
new ScUndoChartData( pDocShell, aChartName, rRanges, bColHeaders, bRowHeaders, false ) );
}
- pDoc->UpdateChartArea( aChartName, rRanges, bColHeaders, bRowHeaders, false );
+ rDoc.UpdateChartArea( aChartName, rRanges, bColHeaders, bRowHeaders, false );
}
}
@@ -572,11 +572,13 @@ void ScChartObj::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno:
ScUnoConversion::FillScRange( aRange, aCellRange );
rRangeList->Append( aRange );
}
- ScDocument* pDoc = ( pDocShell ? pDocShell->GetDocument() : NULL );
- ScChartListenerCollection* pCollection = ( pDoc ? pDoc->GetChartListenerCollection() : NULL );
- if ( pCollection )
+ if ( pDocShell )
{
- pCollection->ChangeListening( aChartName, rRangeList );
+ ScChartListenerCollection* pCollection = pDocShell->GetDocument().GetChartListenerCollection();
+ if ( pCollection )
+ {
+ pCollection->ChangeListening( aChartName, rRangeList );
+ }
}
}
}
@@ -592,11 +594,11 @@ void ScChartObj::getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) con
{
case PROP_HANDLE_RELATED_CELLRANGES:
{
- ScDocument* pDoc = ( pDocShell ? pDocShell->GetDocument() : NULL );
- if (!pDoc)
+ if (!pDocShell)
break;
+ ScDocument& rDoc = pDocShell->GetDocument();
- ScChartListenerCollection* pCollection = pDoc->GetChartListenerCollection();
+ ScChartListenerCollection* pCollection = rDoc.GetChartListenerCollection();
if (!pCollection)
break;
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 1f2637257801..4f849aec5df3 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -85,13 +85,13 @@ ScDocumentConfiguration::ScDocumentConfiguration(ScDocShell* pDocSh)
: pDocShell(pDocSh) ,
aPropSet ( lcl_GetConfigPropertyMap() )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDocumentConfiguration::~ScDocumentConfiguration()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDocumentConfiguration::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -126,201 +126,196 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
if(pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bUpdateHeights = false;
+
+ ScViewOptions aViewOpt(rDoc.GetViewOptions());
+
+ /*Stampit enable/disable print cancel */
+ if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) )
+ pDocShell->Stamp_SetPrintCancelState( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ /*Stampit enable/disable print cancel */
+
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) )
+ aViewOpt.SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) )
+ aViewOpt.SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) )
+ aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) )
{
- bool bUpdateHeights = false;
-
- ScViewOptions aViewOpt(pDoc->GetViewOptions());
-
- /*Stampit enable/disable print cancel */
- if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) )
- pDocShell->Stamp_SetPrintCancelState( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- /*Stampit enable/disable print cancel */
-
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) )
- aViewOpt.SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) )
- aViewOpt.SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) )
- aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) )
+ sal_Int64 nColor = 0;
+ if (aValue >>= nColor)
{
- sal_Int64 nColor = 0;
- if (aValue >>= nColor)
- {
- OUString aColorName;
- Color aColor(static_cast<sal_uInt32>(nColor));
- aViewOpt.SetGridColor(aColor, aColorName);
- }
+ OUString aColorName;
+ Color aColor(static_cast<sal_uInt32>(nColor));
+ aViewOpt.SetGridColor(aColor, aColorName);
}
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) )
- aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) )
- pDoc->SetLinkMode( static_cast<ScLkUpdMode> ( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) )
- aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) )
- aViewOpt.SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) )
- aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) )
- pDoc->SetAutoCalc( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) )
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) )
+ aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) )
+ rDoc.SetLinkMode( static_cast<ScLkUpdMode> ( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) )
+ aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) )
+ aViewOpt.SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) )
+ aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) )
+ rDoc.SetAutoCalc( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) )
+ {
+ OUString sPrinterName;
+ if ( aValue >>= sPrinterName )
{
- OUString sPrinterName;
- if ( aValue >>= sPrinterName )
+ // #i75610# if the name is empty, do nothing (don't create any printer)
+ if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
- // #i75610# if the name is empty, do nothing (don't create any printer)
- if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+ SfxPrinter* pPrinter = pDocShell->GetPrinter();
+ if (pPrinter)
{
- SfxPrinter* pPrinter = pDocShell->GetPrinter();
- if (pPrinter)
+ if (pPrinter->GetName() != sPrinterName)
{
- if (pPrinter->GetName() != sPrinterName)
- {
- SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
- if (pNewPrinter->IsKnown())
- pDocShell->SetPrinter( pNewPrinter, SFX_PRINTER_PRINTER );
- else
- delete pNewPrinter;
- }
+ SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
+ if (pNewPrinter->IsKnown())
+ pDocShell->SetPrinter( pNewPrinter, SFX_PRINTER_PRINTER );
+ else
+ delete pNewPrinter;
}
- else
- throw uno::RuntimeException();
}
+ else
+ throw uno::RuntimeException();
}
- else
- throw lang::IllegalArgumentException();
}
- else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) )
+ else
+ throw lang::IllegalArgumentException();
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) )
+ {
+ uno::Sequence<sal_Int8> aSequence;
+ if ( aValue >>= aSequence )
{
- uno::Sequence<sal_Int8> aSequence;
- if ( aValue >>= aSequence )
+ sal_uInt32 nSize = aSequence.getLength();
+ // #i75610# if the sequence is empty, do nothing (don't create any printer)
+ if ( nSize != 0 )
{
- sal_uInt32 nSize = aSequence.getLength();
- // #i75610# if the sequence is empty, do nothing (don't create any printer)
- if ( nSize != 0 )
- {
- SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ );
- aStream.Seek ( STREAM_SEEK_TO_BEGIN );
- SfxItemSet* pSet = new SfxItemSet( *pDoc->GetPool(),
- SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
- SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
- SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
- SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
- NULL );
- pDocShell->SetPrinter( SfxPrinter::Create( aStream, pSet ) );
- }
+ SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ );
+ aStream.Seek ( STREAM_SEEK_TO_BEGIN );
+ SfxItemSet* pSet = new SfxItemSet( *rDoc.GetPool(),
+ SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
+ SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
+ SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
+ SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
+ NULL );
+ pDocShell->SetPrinter( SfxPrinter::Create( aStream, pSet ) );
}
}
- else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) )
- {
- bool bTmp=true;
- if ( aValue >>= bTmp )
- pDocShell->SetUseUserData( bTmp );
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) )
- {
- // read-only - should not be set
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) )
- {
- // Int16 contains CharacterCompressionType values
- sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue );
- pDoc->SetAsianCompression( (sal_uInt8) nUno );
- bUpdateHeights = true;
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) )
- {
- pDoc->SetAsianKerning( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- bUpdateHeights = true;
- }
- else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) )
- {
- bool bTmp=false;
- if ( aValue >>= bTmp )
- pDocShell->SetSaveVersionOnClose( bTmp );
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) )
- {
- bool bTmp=true;
- if ( aValue >>= bTmp )
- pDocShell->SetQueryLoadTemplate( bTmp );
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) )
- {
- bool bTmp=false;
- if ( aValue >>= bTmp )
- pDocShell->SetLoadReadonly( bTmp );
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) )
- {
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) )
+ {
+ bool bTmp=true;
+ if ( aValue >>= bTmp )
+ pDocShell->SetUseUserData( bTmp );
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) )
+ {
+ // read-only - should not be set
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) )
+ {
+ // Int16 contains CharacterCompressionType values
+ sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue );
+ rDoc.SetAsianCompression( (sal_uInt8) nUno );
+ bUpdateHeights = true;
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) )
+ {
+ rDoc.SetAsianKerning( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ bUpdateHeights = true;
+ }
+ else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) )
+ {
+ bool bTmp=false;
+ if ( aValue >>= bTmp )
+ pDocShell->SetSaveVersionOnClose( bTmp );
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) )
+ {
+ bool bTmp=true;
+ if ( aValue >>= bTmp )
+ pDocShell->SetQueryLoadTemplate( bTmp );
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) )
+ {
+ bool bTmp=false;
+ if ( aValue >>= bTmp )
+ pDocShell->SetLoadReadonly( bTmp );
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) )
+ {
#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
- bool bDocShared = false;
- if ( aValue >>= bDocShared )
- {
- pDocShell->SetSharedXMLFlag( bDocShared );
- }
-#endif
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) )
+ bool bDocShared = false;
+ if ( aValue >>= bDocShared )
{
- uno::Sequence< beans::PropertyValue > aInfo;
- if ( !( aValue >>= aInfo ) )
- throw lang::IllegalArgumentException(
- OUString( "Value of type Sequence<PropertyValue> expected!" ),
- uno::Reference< uno::XInterface >(),
- 2 );
-
- if ( !pDocShell->SetModifyPasswordInfo( aInfo ) )
- throw beans::PropertyVetoException(
- "The hash is not allowed to be changed now!" );
+ pDocShell->SetSharedXMLFlag( bDocShared );
}
- else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) )
+#endif
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) )
+ {
+ uno::Sequence< beans::PropertyValue > aInfo;
+ if ( !( aValue >>= aInfo ) )
+ throw lang::IllegalArgumentException(
+ OUString( "Value of type Sequence<PropertyValue> expected!" ),
+ uno::Reference< uno::XInterface >(),
+ 2 );
+
+ if ( !pDocShell->SetModifyPasswordInfo( aInfo ) )
+ throw beans::PropertyVetoException(
+ "The hash is not allowed to be changed now!" );
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) )
+ {
+ bool bVal = false;
+ if ( aValue >>=bVal )
{
- bool bVal = false;
- if ( aValue >>=bVal )
- {
- pDoc->SetIsUsingEmbededFonts(bVal);
- }
+ rDoc.SetIsUsingEmbededFonts(bVal);
}
+ }
+ else
+ {
+ ScGridOptions aGridOpt(aViewOpt.GetGridOptions());
+ if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) )
+ aGridOpt.SetUseGridSnap( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) )
+ aGridOpt.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) )
+ aGridOpt.SetFldDrawX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) )
+ aGridOpt.SetFldDrawY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) )
+ aGridOpt.SetFldDivisionX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) )
+ aGridOpt.SetFldDivisionY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) )
+ aGridOpt.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
else
- {
- ScGridOptions aGridOpt(aViewOpt.GetGridOptions());
- if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) )
- aGridOpt.SetUseGridSnap( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) )
- aGridOpt.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) )
- aGridOpt.SetFldDrawX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) )
- aGridOpt.SetFldDrawY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) )
- aGridOpt.SetFldDivisionX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) )
- aGridOpt.SetFldDivisionY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) )
- aGridOpt.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
- else
- throw beans::UnknownPropertyException();
- aViewOpt.SetGridOptions(aGridOpt);
- }
- pDoc->SetViewOptions(aViewOpt);
+ throw beans::UnknownPropertyException();
+ aViewOpt.SetGridOptions(aGridOpt);
+ }
+ rDoc.SetViewOptions(aViewOpt);
- if ( bUpdateHeights && !pDoc->IsImportingXML() )
- {
- // update automatic row heights and repaint
- SCTAB nTabCount = pDoc->GetTableCount();
- for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if ( !pDocShell->AdjustRowHeight( 0, MAXROW, nTab ) )
- pDocShell->PostPaint(ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab), PAINT_GRID);
- pDocShell->SetDocumentModified();
- }
+ if ( bUpdateHeights && !rDoc.IsImportingXML() )
+ {
+ // update automatic row heights and repaint
+ SCTAB nTabCount = rDoc.GetTableCount();
+ for (SCTAB nTab=0; nTab<nTabCount; nTab++)
+ if ( !pDocShell->AdjustRowHeight( 0, MAXROW, nTab ) )
+ pDocShell->PostPaint(ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab), PAINT_GRID);
+ pDocShell->SetDocumentModified();
}
- else
- throw uno::RuntimeException();
}
else
throw uno::RuntimeException();
@@ -335,121 +330,116 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr
if(pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
+ ScDocument& rDoc = pDocShell->GetDocument();
+ const ScViewOptions& aViewOpt = rDoc.GetViewOptions();
+
+ /*Stampit enable/disable print cancel */
+ if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->Stamp_GetPrintCancelState() );
+ /*Stampit enable/disable print cancel */
+
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NULLVALS ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NOTES ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_GRID ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) )
{
- const ScViewOptions& aViewOpt = pDoc->GetViewOptions();
-
- /*Stampit enable/disable print cancel */
- if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->Stamp_GetPrintCancelState() );
- /*Stampit enable/disable print cancel */
-
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NULLVALS ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NOTES ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_GRID ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) )
- {
- OUString aColorName;
- Color aColor = aViewOpt.GetGridColor(&aColorName);
- aRet <<= static_cast<sal_Int64>(aColor.GetColor());
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_PAGEBREAKS ) );
- else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) )
- aRet <<= static_cast<sal_Int16> ( pDoc->GetLinkMode() );
- else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_HEADER ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_TABCONTROLS ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_OUTLINER ) );
- else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->GetAutoCalc() );
- else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) )
- {
- // #i75610# don't create the printer, return empty string if no printer created yet
- // (as in SwXDocumentSettings)
- SfxPrinter* pPrinter = pDoc->GetPrinter( false );
- if (pPrinter)
- aRet <<= OUString ( pPrinter->GetName());
- else
- aRet <<= OUString();
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) )
- {
- // #i75610# don't create the printer, return empty sequence if no printer created yet
- // (as in SwXDocumentSettings)
- SfxPrinter* pPrinter = pDoc->GetPrinter( false );
- if (pPrinter)
- {
- SvMemoryStream aStream;
- pPrinter->Store( aStream );
- aStream.Seek ( STREAM_SEEK_TO_END );
- sal_uInt32 nSize = aStream.Tell();
- aStream.Seek ( STREAM_SEEK_TO_BEGIN );
- uno::Sequence < sal_Int8 > aSequence( nSize );
- aStream.Read ( aSequence.getArray(), nSize );
- aRet <<= aSequence;
- }
- else
- aRet <<= uno::Sequence<sal_Int8>();
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) )
- aRet <<= pDocShell->IsUseUserData();
- else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) )
+ OUString aColorName;
+ Color aColor = aViewOpt.GetGridColor(&aColorName);
+ aRet <<= static_cast<sal_Int64>(aColor.GetColor());
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_PAGEBREAKS ) );
+ else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) )
+ aRet <<= static_cast<sal_Int16> ( rDoc.GetLinkMode() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_HEADER ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_TABCONTROLS ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_OUTLINER ) );
+ else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.GetAutoCalc() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) )
+ {
+ // #i75610# don't create the printer, return empty string if no printer created yet
+ // (as in SwXDocumentSettings)
+ SfxPrinter* pPrinter = rDoc.GetPrinter( false );
+ if (pPrinter)
+ aRet <<= OUString ( pPrinter->GetName());
+ else
+ aRet <<= OUString();
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) )
+ {
+ // #i75610# don't create the printer, return empty sequence if no printer created yet
+ // (as in SwXDocumentSettings)
+ SfxPrinter* pPrinter = rDoc.GetPrinter( false );
+ if (pPrinter)
{
- aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell ));
+ SvMemoryStream aStream;
+ pPrinter->Store( aStream );
+ aStream.Seek ( STREAM_SEEK_TO_END );
+ sal_uInt32 nSize = aStream.Tell();
+ aStream.Seek ( STREAM_SEEK_TO_BEGIN );
+ uno::Sequence < sal_Int8 > aSequence( nSize );
+ aStream.Read ( aSequence.getArray(), nSize );
+ aRet <<= aSequence;
}
- else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) )
- aRet <<= static_cast<sal_Int16> ( pDoc->GetAsianCompression() );
- else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->GetAsianKerning() );
- else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) )
- aRet <<= pDocShell->IsSaveVersionOnClose();
- else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) )
- aRet <<= pDocShell->IsQueryLoadTemplate();
- else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) )
- aRet <<= pDocShell->IsLoadReadonly();
- else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) )
- {
+ else
+ aRet <<= uno::Sequence<sal_Int8>();
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) )
+ aRet <<= pDocShell->IsUseUserData();
+ else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) )
+ {
+ aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell ));
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) )
+ aRet <<= static_cast<sal_Int16> ( rDoc.GetAsianCompression() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.GetAsianKerning() );
+ else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) )
+ aRet <<= pDocShell->IsSaveVersionOnClose();
+ else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) )
+ aRet <<= pDocShell->IsQueryLoadTemplate();
+ else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) )
+ aRet <<= pDocShell->IsLoadReadonly();
+ else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) )
+ {
#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasSharedXMLFlagSet() );
+ ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasSharedXMLFlagSet() );
#endif
- }
- else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) )
- aRet <<= pDocShell->GetModifyPasswordInfo();
- else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) )
- {
- aRet <<= pDoc->IsUsingEmbededFonts();
- }
+ }
+ else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) )
+ aRet <<= pDocShell->GetModifyPasswordInfo();
+ else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) )
+ {
+ aRet <<= rDoc.IsUsingEmbededFonts();
+ }
+ else
+ {
+ const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions();
+ if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetUseGridSnap() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetGridVisible() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) )
+ aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDrawX() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) )
+ aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDrawY() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) )
+ aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDivisionX() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) )
+ aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDivisionY() );
+ else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) )
+ ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetSynchronize() );
else
- {
- const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions();
- if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetUseGridSnap() );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetGridVisible() );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) )
- aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDrawX() );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) )
- aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDrawY() );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) )
- aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDivisionX() );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) )
- aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDivisionY() );
- else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) )
- ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetSynchronize() );
- else
- throw beans::UnknownPropertyException();
- }
+ throw beans::UnknownPropertyException();
}
- else
- throw uno::RuntimeException();
}
else
throw uno::RuntimeException();
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index a50792d8cb49..bd203db8ecf9 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -110,7 +110,7 @@ void SAL_CALL ScCellCursorObj::collapseToCurrentRegion() throw(uno::RuntimeExcep
SCROW nEndRow = aOneRange.aEnd.Row();
SCTAB nTab = aOneRange.aStart.Tab();
- pDocSh->GetDocument()->GetDataArea(
+ pDocSh->GetDocument().GetDataArea(
nTab, nStartCol, nStartRow, nEndCol, nEndRow, true, false );
ScRange aNew( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab );
@@ -132,11 +132,11 @@ void SAL_CALL ScCellCursorObj::collapseToCurrentArray()
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScRange aMatrix;
// finding the matrix range is now in GetMatrixFormulaRange in the document
- if ( pDoc->GetMatrixFormulaRange( aCursor, aMatrix ) )
+ if ( rDoc.GetMatrixFormulaRange( aCursor, aMatrix ) )
{
SetNewRange( aMatrix );
}
@@ -161,9 +161,9 @@ void SAL_CALL ScCellCursorObj::collapseToMergedArea() throw(uno::RuntimeExceptio
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aNewRange( *rRanges[ 0 ] );
- ScDocument* pDoc = pDocSh->GetDocument();
- pDoc->ExtendOverlapped( aNewRange );
- pDoc->ExtendMerge( aNewRange ); // after ExtendOverlapped!
+ ScDocument& rDoc = pDocSh->GetDocument();
+ rDoc.ExtendOverlapped( aNewRange );
+ rDoc.ExtendMerge( aNewRange ); // after ExtendOverlapped!
SetNewRange( aNewRange );
}
@@ -245,7 +245,7 @@ void SAL_CALL ScCellCursorObj::gotoStartOfUsedArea(sal_Bool bExpand)
SCCOL nUsedX = 0; // Anfang holen
SCROW nUsedY = 0;
- if (!pDocSh->GetDocument()->GetDataStart( nTab, nUsedX, nUsedY ))
+ if (!pDocSh->GetDocument().GetDataStart( nTab, nUsedX, nUsedY ))
{
nUsedX = 0;
nUsedY = 0;
@@ -273,7 +273,7 @@ void SAL_CALL ScCellCursorObj::gotoEndOfUsedArea( sal_Bool bExpand )
SCCOL nUsedX = 0; // Ende holen
SCROW nUsedY = 0;
- if (!pDocSh->GetDocument()->GetTableArea( nTab, nUsedX, nUsedY ))
+ if (!pDocSh->GetDocument().GetTableArea( nTab, nUsedX, nUsedY ))
{
nUsedX = 0;
nUsedY = 0;
@@ -309,7 +309,7 @@ void SAL_CALL ScCellCursorObj::gotoStart() throw(uno::RuntimeException, std::exc
SCROW nEndRow = aOneRange.aEnd.Row();
SCTAB nTab = aOneRange.aStart.Tab();
- pDocSh->GetDocument()->GetDataArea(
+ pDocSh->GetDocument().GetDataArea(
nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, false );
ScRange aNew( nStartCol, nStartRow, nTab );
@@ -337,7 +337,7 @@ void SAL_CALL ScCellCursorObj::gotoEnd() throw(uno::RuntimeException, std::excep
SCROW nEndRow = aOneRange.aEnd.Row();
SCTAB nTab = aOneRange.aStart.Tab();
- pDocSh->GetDocument()->GetDataArea(
+ pDocSh->GetDocument().GetDataArea(
nTab, nStartCol, nStartRow, nEndCol, nEndRow, false, false );
ScRange aNew( nEndCol, nEndRow, nTab );
@@ -361,7 +361,7 @@ void SAL_CALL ScCellCursorObj::gotoNext() throw(uno::RuntimeException, std::exce
SCTAB nTab = aCursor.Tab();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- pDocSh->GetDocument()->GetNextPos( nNewX,nNewY, nTab, 1,0, false,true, aMark );
+ pDocSh->GetDocument().GetNextPos( nNewX,nNewY, nTab, 1,0, false,true, aMark );
//! sonst Exception oder so
SetNewRange( ScRange( nNewX, nNewY, nTab ) );
@@ -383,7 +383,7 @@ void SAL_CALL ScCellCursorObj::gotoPrevious() throw(uno::RuntimeException, std::
SCTAB nTab = aCursor.Tab();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
- pDocSh->GetDocument()->GetNextPos( nNewX,nNewY, nTab, -1,0, false,true, aMark );
+ pDocSh->GetDocument().GetNextPos( nNewX,nNewY, nTab, -1,0, false,true, aMark );
//! sonst Exception oder so
SetNewRange( ScRange( nNewX, nNewY, nTab ) );
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 3ace2c48bd14..ff3d54b1f3e2 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -234,8 +234,8 @@ static ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const OUS
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDPCollection* pColl = pDoc->GetDPCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDPCollection* pColl = rDoc.GetDPCollection();
if ( pColl )
{
size_t nCount = pColl->GetCount();
@@ -255,8 +255,8 @@ static OUString lcl_CreatePivotName( ScDocShell* pDocShell )
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDPCollection* pColl = pDoc->GetDPCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDPCollection* pColl = rDoc.GetDPCollection();
if ( pColl )
return pColl->CreateNewName();
}
@@ -284,13 +284,13 @@ ScDataPilotTablesObj::ScDataPilotTablesObj(ScDocShell* pDocSh, SCTAB nT) :
pDocShell( pDocSh ),
nTab( nT )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDataPilotTablesObj::~ScDataPilotTablesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDataPilotTablesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -310,8 +310,8 @@ ScDataPilotTableObj* ScDataPilotTablesObj::GetObjectByIndex_Impl( sal_Int32 nInd
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDPCollection* pColl = pDoc->GetDPCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDPCollection* pColl = rDoc.GetDPCollection();
if ( pColl )
{
// count tables on this sheet
@@ -459,8 +459,8 @@ sal_Int32 SAL_CALL ScDataPilotTablesObj::getCount() throw(RuntimeException, std:
SolarMutexGuard aGuard;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDPCollection* pColl = pDoc->GetDPCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDPCollection* pColl = rDoc.GetDPCollection();
if ( pColl )
{
// count tables on this sheet
@@ -520,8 +520,8 @@ Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames()
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDPCollection* pColl = pDoc->GetDPCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDPCollection* pColl = rDoc.GetDPCollection();
if ( pColl )
{
// count tables on this sheet
@@ -558,8 +558,8 @@ sal_Bool SAL_CALL ScDataPilotTablesObj::hasByName( const OUString& aName )
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDPCollection* pColl = pDoc->GetDPCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDPCollection* pColl = rDoc.GetDPCollection();
if ( pColl )
{
size_t nCount = pColl->GetCount();
@@ -579,13 +579,13 @@ ScDataPilotDescriptorBase::ScDataPilotDescriptorBase(ScDocShell* pDocSh) :
maPropSet( lcl_GetDataPilotDescriptorBaseMap() ),
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDataPilotDescriptorBase::~ScDataPilotDescriptorBase()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
Any SAL_CALL ScDataPilotDescriptorBase::queryInterface( const uno::Type& rType )
@@ -672,7 +672,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setSourceRange( const CellRangeAddress&
if (!pDPObject)
throw RuntimeException();
- ScSheetSourceDesc aSheetDesc(pDocShell->GetDocument());
+ ScSheetSourceDesc aSheetDesc(&pDocShell->GetDocument());
if (pDPObject->IsSheetData())
aSheetDesc = *pDPObject->GetSheetDesc();
@@ -792,7 +792,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
uno::Sequence<beans::PropertyValue> aArgSeq;
if ( aValue >>= aArgSeq )
{
- ScImportSourceDesc aImportDesc(pDocShell->GetDocument());
+ ScImportSourceDesc aImportDesc(&pDocShell->GetDocument());
const ScImportSourceDesc* pOldDesc = pDPObject->GetImportSourceDesc();
if (pOldDesc)
@@ -1351,7 +1351,7 @@ void ScDataPilotTableObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
ScRangeList aRanges;
aRanges.Append( aRange );
const ScUpdateRefHint& rRef = static_cast< const ScUpdateRefHint& >( rHint );
- if ( aRanges.UpdateReference( rRef.GetMode(), GetDocShell()->GetDocument(), rRef.GetRange(),
+ if ( aRanges.UpdateReference( rRef.GetMode(), &GetDocShell()->GetDocument(), rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() ) &&
aRanges.size() == 1 )
{
@@ -1373,14 +1373,14 @@ void ScDataPilotTableObj::Refreshed_Impl()
// the EventObject holds a Ref to this object until after the listener calls
- ScDocument* pDoc = GetDocShell()->GetDocument();
+ ScDocument& rDoc = GetDocShell()->GetDocument();
for ( sal_uInt16 n=0; n<aModifyListeners.size(); n++ )
- pDoc->AddUnoListenerCall( aModifyListeners[n], aEvent );
+ rDoc.AddUnoListenerCall( aModifyListeners[n], aEvent );
}
ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) :
ScDataPilotDescriptorBase( pDocSh ),
- mpDPObject(new ScDPObject(pDocSh ? pDocSh->GetDocument() : NULL) )
+ mpDPObject(new ScDPObject(pDocSh ? &pDocSh->GetDocument() : NULL) )
{
ScDPSaveData aSaveData;
// set defaults like in ScPivotParam constructor
@@ -1389,7 +1389,7 @@ ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) :
aSaveData.SetIgnoreEmptyRows( false );
aSaveData.SetRepeatIfEmpty( false );
mpDPObject->SetSaveData(aSaveData);
- ScSheetSourceDesc aSheetDesc(pDocSh ? pDocSh->GetDocument() : NULL);
+ ScSheetSourceDesc aSheetDesc(pDocSh ? &pDocSh->GetDocument() : NULL);
mpDPObject->SetSheetDesc(aSheetDesc);
mpDPObject->GetSource();
}
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 09762b1f1402..d1afe899dd3c 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -994,13 +994,13 @@ ScFilterDescriptorBase::ScFilterDescriptorBase(ScDocShell* pDocShell) :
pDocSh(pDocShell)
{
if (pDocSh)
- pDocSh->GetDocument()->AddUnoObject(*this);
+ pDocSh->GetDocument().AddUnoObject(*this);
}
ScFilterDescriptorBase::~ScFilterDescriptorBase()
{
if (pDocSh)
- pDocSh->GetDocument()->RemoveUnoObject(*this);
+ pDocSh->GetDocument().RemoveUnoObject(*this);
}
void ScFilterDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1356,8 +1356,8 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields(
SCSIZE nCount = static_cast<SCSIZE>(aFilterFields.getLength());
aParam.Resize( nCount );
- ScDocument* pDoc = pDocSh->GetDocument();
- svl::SharedStringPool& rPool = pDoc->GetSharedStringPool();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ svl::SharedStringPool& rPool = rDoc.GetSharedStringPool();
const sheet::TableFilterField* pAry = aFilterFields.getConstArray();
SCSIZE i;
for (i=0; i<nCount; i++)
@@ -1376,7 +1376,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields(
if (rItem.meType != ScQueryEntry::ByString)
{
OUString aStr;
- pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
+ rDoc.GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
rItem.maString = rPool.intern(aStr);
}
@@ -1418,7 +1418,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields2(
SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
- fillQueryParam(aParam, pDocSh->GetDocument(), aFilterFields);
+ fillQueryParam(aParam, &pDocSh->GetDocument(), aFilterFields);
PutData(aParam);
}
@@ -1429,7 +1429,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields3(
SolarMutexGuard aGuard;
ScQueryParam aParam;
GetData(aParam);
- fillQueryParam(aParam, pDocSh->GetDocument(), aFilterFields);
+ fillQueryParam(aParam, &pDocSh->GetDocument(), aFilterFields);
PutData(aParam);
}
@@ -1621,7 +1621,7 @@ void ScDataPilotFilterDescriptor::PutData( const ScQueryParam& rParam )
ScDPObject* pDPObj = pParent->GetDPObject();
if (pDPObj)
{
- ScSheetSourceDesc aSheetDesc(pParent->GetDocShell()->GetDocument());
+ ScSheetSourceDesc aSheetDesc(&pParent->GetDocShell()->GetDocument());
if (pDPObj->IsSheetData())
aSheetDesc = *pDPObj->GetSheetDesc();
aSheetDesc.SetQueryParam(rParam);
@@ -1638,7 +1638,7 @@ ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const OUString& rNm)
bIsUnnamed(false),
aTab( 0 )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab) :
@@ -1648,13 +1648,13 @@ ScDatabaseRangeObj::ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab) :
bIsUnnamed(true),
aTab( nTab )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDatabaseRangeObj::~ScDatabaseRangeObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDatabaseRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1682,11 +1682,11 @@ ScDBData* ScDatabaseRangeObj::GetDBData_Impl() const
{
if (bIsUnnamed)
{
- pRet = pDocShell->GetDocument()->GetAnonymousDBData(aTab);
+ pRet = pDocShell->GetDocument().GetAnonymousDBData(aTab);
}
else
{
- ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection();
+ ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection();
if (pNames)
{
ScDBData* p = pNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aName));
@@ -2037,13 +2037,13 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
aNewData.SetAutoFilter(bAutoFilter);
ScRange aRange;
aNewData.GetArea(aRange);
- ScDocument* pDoc = pDocShell->GetDocument();
- if (bAutoFilter && pDoc)
- pDoc->ApplyFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if (bAutoFilter)
+ rDoc.ApplyFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aStart.Row(),
aRange.aStart.Tab(), SC_MF_AUTO );
- else if (!bAutoFilter && pDoc)
- pDoc->RemoveFlagsTab(aRange.aStart.Col(), aRange.aStart.Row(),
+ else if (!bAutoFilter)
+ rDoc.RemoveFlagsTab(aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aStart.Row(),
aRange.aStart.Tab(), SC_MF_AUTO );
ScRange aPaintRange(aRange.aStart, aRange.aEnd);
@@ -2081,12 +2081,12 @@ void SAL_CALL ScDatabaseRangeObj::setPropertyValue(
sal_Int32 nRefresh = 0;
if (aValue >>= nRefresh)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
aNewData.SetRefreshDelay(nRefresh);
- if (pDoc && pDoc->GetDBCollection())
+ if (rDoc.GetDBCollection())
{
- aNewData.SetRefreshHandler( pDoc->GetDBCollection()->GetRefreshHandler() );
- aNewData.SetRefreshControl( pDoc->GetRefreshTimerControlAddress() );
+ aNewData.SetRefreshHandler( rDoc.GetDBCollection()->GetRefreshHandler() );
+ aNewData.SetRefreshControl( &rDoc.GetRefreshTimerControlAddress() );
}
}
}
@@ -2203,13 +2203,13 @@ uno::Sequence<OUString> SAL_CALL ScDatabaseRangeObj::getSupportedServiceNames()
ScDatabaseRangesObj::ScDatabaseRangesObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDatabaseRangesObj::~ScDatabaseRangesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -2230,7 +2230,7 @@ ScDatabaseRangeObj* ScDatabaseRangesObj::GetObjectByIndex_Impl(size_t nIndex)
if (!pDocShell)
return NULL;
- ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection();
+ ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection();
if (!pNames)
return NULL;
@@ -2307,7 +2307,7 @@ sal_Int32 SAL_CALL ScDatabaseRangesObj::getCount() throw(uno::RuntimeException,
if (pDocShell)
{
- ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection();
+ ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection();
if (pNames)
return static_cast<sal_Int32>(pNames->getNamedDBs().size());
}
@@ -2365,7 +2365,7 @@ uno::Sequence<OUString> SAL_CALL ScDatabaseRangesObj::getElementNames()
if (pDocShell)
{
- ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection();
+ ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection();
if (pNames)
{
const ScDBCollection::NamedDBs& rDBs = pNames->getNamedDBs();
@@ -2389,7 +2389,7 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const OUString& aName )
if (pDocShell)
{
- ScDBCollection* pNames = pDocShell->GetDocument()->GetDBCollection();
+ ScDBCollection* pNames = pDocShell->GetDocument().GetDBCollection();
if (pNames)
return pNames->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aName)) != NULL;
}
@@ -2399,13 +2399,13 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const OUString& aName )
ScUnnamedDatabaseRangesObj::ScUnnamedDatabaseRangesObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScUnnamedDatabaseRangesObj::~ScUnnamedDatabaseRangesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScUnnamedDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -2429,7 +2429,7 @@ void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRan
bool bDone = false;
if (pDocShell)
{
- if ( pDocShell->GetDocument()->GetTableCount() <= aRange.Sheet )
+ if ( pDocShell->GetDocument().GetTableCount() <= aRange.Sheet )
throw lang::IndexOutOfBoundsException();
ScDBDocFunc aFunc(*pDocShell);
@@ -2450,7 +2450,7 @@ uno::Any ScUnnamedDatabaseRangesObj::getByTable( sal_Int32 nTab )
SolarMutexGuard aGuard;
if (pDocShell)
{
- if ( pDocShell->GetDocument()->GetTableCount() <= nTab )
+ if ( pDocShell->GetDocument().GetTableCount() <= nTab )
throw lang::IndexOutOfBoundsException();
uno::Reference<sheet::XDatabaseRange> xRange(
new ScDatabaseRangeObj(pDocShell, static_cast<SCTAB>(nTab)));
@@ -2470,9 +2470,9 @@ sal_Bool ScUnnamedDatabaseRangesObj::hasByTable( sal_Int32 nTab )
SolarMutexGuard aGuard;
if (pDocShell)
{
- if (pDocShell->GetDocument()->GetTableCount() <= nTab)
+ if (pDocShell->GetDocument().GetTableCount() <= nTab)
throw lang::IndexOutOfBoundsException();
- if (pDocShell->GetDocument()->GetAnonymousDBData((SCTAB) nTab))
+ if (pDocShell->GetDocument().GetAnonymousDBData((SCTAB) nTab))
return true;
return false;
}
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index eebb8c72bfc2..1a2527d6b5ea 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -77,13 +77,13 @@ ScDocDefaultsObj::ScDocDefaultsObj(ScDocShell* pDocSh) :
pDocShell( pDocSh ),
aPropertyMap(lcl_GetDocDefaultsMap())
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDocDefaultsObj::~ScDocDefaultsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDocDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -134,35 +134,25 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue(
{
if(aPropertyName.equalsAscii(SC_UNO_STANDARDDEC) )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDocOptions aDocOpt(rDoc.GetDocOptions());
+ sal_Int16 nValue = 0;
+ if (aValue >>= nValue)
{
- ScDocOptions aDocOpt(pDoc->GetDocOptions());
- sal_Int16 nValue = 0;
- if (aValue >>= nValue)
- {
- aDocOpt.SetStdPrecision(static_cast<sal_uInt16> (nValue));
- pDoc->SetDocOptions(aDocOpt);
- }
+ aDocOpt.SetStdPrecision(static_cast<sal_uInt16> (nValue));
+ rDoc.SetDocOptions(aDocOpt);
}
- else
- throw uno::RuntimeException();
}
else if (aPropertyName.equalsAscii(SC_UNO_TABSTOPDIS) )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDocOptions aDocOpt(rDoc.GetDocOptions());
+ sal_Int32 nValue = 0;
+ if (aValue >>= nValue)
{
- ScDocOptions aDocOpt(pDoc->GetDocOptions());
- sal_Int32 nValue = 0;
- if (aValue >>= nValue)
- {
- aDocOpt.SetTabDistance(static_cast<sal_uInt16>(HMMToTwips(nValue)));
- pDoc->SetDocOptions(aDocOpt);
- }
+ aDocOpt.SetTabDistance(static_cast<sal_uInt16>(HMMToTwips(nValue)));
+ rDoc.SetDocOptions(aDocOpt);
}
- else
- throw uno::RuntimeException();
}
}
else if ( pEntry->nWID == ATTR_FONT_LANGUAGE ||
@@ -181,9 +171,9 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue(
else
eNew = LANGUAGE_NONE;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
if ( pEntry->nWID == ATTR_CJK_FONT_LANGUAGE )
eCjk = eNew;
@@ -192,12 +182,12 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue(
else
eLatin = eNew;
- pDoc->SetLanguage( eLatin, eCjk, eCtl );
+ rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
else
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
SfxPoolItem* pNewItem = pPool->GetDefaultItem(pEntry->nWID).Clone();
if( !pNewItem->PutValue( aValue, pEntry->nMemberId ) )
@@ -230,36 +220,26 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyValue( const OUString& aPropertyN
{
if(aPropertyName.equalsAscii(SC_UNO_STANDARDDEC) )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
- {
- const ScDocOptions& aDocOpt = pDoc->GetDocOptions();
- sal_uInt16 nPrec = aDocOpt.GetStdPrecision();
- // the max value of unsigned 16-bit integer is used as the flag
- // value for unlimited precision, c.f.
- // SvNumberFormatter::UNLIMITED_PRECISION.
- if (nPrec <= ::std::numeric_limits<sal_Int16>::max())
- aRet <<= static_cast<sal_Int16> (nPrec);
- }
- else
- throw uno::RuntimeException();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ const ScDocOptions& aDocOpt = rDoc.GetDocOptions();
+ sal_uInt16 nPrec = aDocOpt.GetStdPrecision();
+ // the max value of unsigned 16-bit integer is used as the flag
+ // value for unlimited precision, c.f.
+ // SvNumberFormatter::UNLIMITED_PRECISION.
+ if (nPrec <= ::std::numeric_limits<sal_Int16>::max())
+ aRet <<= static_cast<sal_Int16> (nPrec);
}
else if (aPropertyName.equalsAscii(SC_UNO_TABSTOPDIS) )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (pDoc)
- {
- const ScDocOptions& aDocOpt = pDoc->GetDocOptions();
- sal_Int32 nValue (TwipsToEvenHMM(aDocOpt.GetTabDistance()));
- aRet <<= nValue;
- }
- else
- throw uno::RuntimeException();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ const ScDocOptions& aDocOpt = rDoc.GetDocOptions();
+ sal_Int32 nValue (TwipsToEvenHMM(aDocOpt.GetTabDistance()));
+ aRet <<= nValue;
}
}
else
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
const SfxPoolItem& rItem = pPool->GetDefaultItem( pEntry->nWID );
rItem.QueryValue( aRet, pEntry->nMemberId );
}
@@ -296,7 +276,7 @@ beans::PropertyState SAL_CALL ScDocDefaultsObj::getPropertyState( const OUString
{
// check if pool default is set
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
if ( pPool->GetPoolDefaultItem( nWID ) != NULL )
eRet = beans::PropertyState_DIRECT_VALUE;
}
@@ -333,7 +313,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyToDefault( const OUString& aPropertyN
if (pEntry->nWID)
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
pPool->ResetPoolDefaultItem( pEntry->nWID );
ItemsChanged();
@@ -358,7 +338,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const OUString& aPropert
uno::Any aRet;
if (pEntry->nWID)
{
- ScDocumentPool* pPool = pDocShell->GetDocument()->GetPool();
+ ScDocumentPool* pPool = pDocShell->GetDocument().GetPool();
const SfxPoolItem* pItem = pPool->GetItem2( pEntry->nWID, SFX_ITEMS_DEFAULT );
if (pItem)
pItem->QueryValue( aRet, pEntry->nMemberId );
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index 0b29ddda4c35..b87ad9be3358 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -227,10 +227,10 @@ void SAL_CALL ScDispatch::dispatch( const util::URL& aURL,
bool bDone = false;
if ( pViewShell && aURL.Complete.equalsAscii(cURLInsertColumns) )
{
- ScViewData* pViewData = pViewShell->GetViewData();
- ScAddress aPos( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() );
+ ScViewData& rViewData = pViewShell->GetViewData();
+ ScAddress aPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() );
- ScDBDocFunc aFunc( *pViewData->GetDocShell() );
+ ScDBDocFunc aFunc( *rViewData.GetDocShell() );
bDone = aFunc.DoImportUno( aPos, aArgs );
}
// cURLDocDataSource is never dispatched
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 75cabca93aee..131f9b7db07d 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -355,14 +355,14 @@ ScModelObj::ScModelObj( ScDocShell* pDocSh ) :
// pDocShell may be NULL if this is the base of a ScDocOptionsObj
if ( pDocShell )
{
- pDocShell->GetDocument()->AddUnoObject(*this); // SfxModel is derived from SfxListener
+ pDocShell->GetDocument().AddUnoObject(*this); // SfxModel is derived from SfxListener
}
}
ScModelObj::~ScModelObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
if (xNumberAgg.is())
xNumberAgg->setDelegator(uno::Reference<uno::XInterface>());
@@ -381,7 +381,7 @@ uno::Reference< uno::XAggregation> ScModelObj::GetFormatter()
comphelper::increment( m_refCount );
// waehrend des queryInterface braucht man ein Ref auf das
// SvNumberFormatsSupplierObj, sonst wird es geloescht.
- uno::Reference<util::XNumberFormatsSupplier> xFormatter(new SvNumberFormatsSupplierObj(pDocShell->GetDocument()->GetFormatTable() ));
+ uno::Reference<util::XNumberFormatsSupplier> xFormatter(new SvNumberFormatsSupplierObj(pDocShell->GetDocument().GetFormatTable() ));
{
xNumberAgg.set(uno::Reference<uno::XAggregation>( xFormatter, uno::UNO_QUERY ));
// extra block to force deletion of the temporary before setDelegator
@@ -400,7 +400,7 @@ uno::Reference< uno::XAggregation> ScModelObj::GetFormatter()
ScDocument* ScModelObj::GetDocument() const
{
if (pDocShell)
- return pDocShell->GetDocument();
+ return &pDocShell->GetDocument();
return NULL;
}
@@ -584,16 +584,16 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// handle "OnCalculate" sheet events (search also for VBA event handlers)
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( pDoc->GetVbaEventProcessor().is() )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if ( rDoc.GetVbaEventProcessor().is() )
{
// If the VBA event processor is set, HasAnyCalcNotification is much faster than HasAnySheetEventScript
- if ( pDoc->HasAnyCalcNotification() && pDoc->HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE, true ) )
+ if ( rDoc.HasAnyCalcNotification() && rDoc.HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE, true ) )
HandleCalculateEvents();
}
else
{
- if ( pDoc->HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE ) )
+ if ( rDoc.HasAnySheetEventScript( SC_SHEETEVENT_CALCULATE ) )
HandleCalculateEvents();
}
}
@@ -612,7 +612,7 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SvNumberFormatsSupplierObj::getImplementation(
uno::Reference<util::XNumberFormatsSupplier>(xNumberAgg, uno::UNO_QUERY) );
if ( pNumFmt && pDocShell )
- pNumFmt->SetNumberFormatter( pDocShell->GetDocument()->GetFormatTable() );
+ pNumFmt->SetNumberFormatter( pDocShell->GetDocument().GetFormatTable() );
}
}
}
@@ -861,12 +861,12 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
SdrObject *pSdrObj = pShape->GetSdrObject();
if( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if( pDoc && pSdrObj )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if( pSdrObj )
{
Rectangle aObjRect = pSdrObj->GetCurrentBoundRect();
SCTAB nCurrentTab = ScDocShell::GetCurTab();
- ScRange aRange = pDoc->GetRange( nCurrentTab, aObjRect );
+ ScRange aRange = rDoc.GetRange( nCurrentTab, aObjRect );
rMark.SetMarkArea( aRange );
if( rMark.IsMarked() && !rMark.IsMultiMarked() )
@@ -884,7 +884,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
// render the whole document
// -> no selection, all sheets
- SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
+ SCTAB nTabCount = pDocShell->GetDocument().GetTableCount();
for (SCTAB nTab = 0; nTab < nTabCount; nTab++)
rMark.SelectTable( nTab, true );
rStatus.SetMode( SC_PRINTSEL_DOCUMENT );
@@ -899,7 +899,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
{
uno::Sequence<sal_Int32> aSelected = xSelectedSheets->getSelectedSheets();
ScMarkData::MarkedTabsType aSelectedTabs;
- SCTAB nMaxTab = pDocShell->GetDocument()->GetTableCount() -1;
+ SCTAB nMaxTab = pDocShell->GetDocument().GetTableCount() -1;
for (sal_Int32 i = 0, n = aSelected.getLength(); i < n; ++i)
{
SCTAB nSelected = static_cast<SCTAB>(aSelected[i]);
@@ -1119,12 +1119,12 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
throw lang::IllegalArgumentException();
SCTAB nTab = pPrintFuncCache->GetTabForPage( nRenderer );
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
FmFormView* pDrawView = NULL;
// #114135#
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
if( pModel )
{
@@ -1169,7 +1169,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
Rectangle aArea( pDev->PixelToLogic( Rectangle( 0,0,0,0 ) ) );
sal_Int32 nDestID = pPDFData->CreateDest( aArea );
OUString aTabName;
- pDoc->GetName( nTab, aTabName );
+ rDoc.GetName( nTab, aTabName );
sal_Int32 nParent = -1; // top-level
pPDFData->CreateOutlineItem( nParent, aTabName, nDestID );
}
@@ -1178,7 +1178,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
{
Rectangle aArea( pDev->PixelToLogic( Rectangle( 0,0,0,0 ) ) );
OUString aTabName;
- pDoc->GetName( nTab, aTabName );
+ rDoc.GetName( nTab, aTabName );
//need the PDF page number here
pPDFData->CreateNamedDest( aTabName, aArea );
}
@@ -1207,7 +1207,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
ScRange aTargetRange;
Rectangle aTargetRect; // 1/100th mm
bool bIsSheet = false;
- bool bValid = lcl_ParseTarget( aTarget, aTargetRange, aTargetRect, bIsSheet, pDoc, nTab );
+ bool bValid = lcl_ParseTarget( aTarget, aTargetRange, aTargetRect, bIsSheet, &rDoc, nTab );
if ( bValid )
{
@@ -1231,7 +1231,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
// get the rectangle of the page's cell range in 1/100th mm
ScRange aLocRange = aLocation.aCellRange;
- Rectangle aLocationMM = pDoc->GetMMRect(
+ Rectangle aLocationMM = rDoc.GetMMRect(
aLocRange.aStart.Col(), aLocRange.aStart.Row(),
aLocRange.aEnd.Col(), aLocRange.aEnd.Row(),
aLocRange.aStart.Tab() );
@@ -1385,7 +1385,7 @@ sal_Bool SAL_CALL ScModelObj::isAutomaticCalculationEnabled() throw(uno::Runtime
{
SolarMutexGuard aGuard;
if (pDocShell)
- return pDocShell->GetDocument()->GetAutoCalc();
+ return pDocShell->GetDocument().GetAutoCalc();
OSL_FAIL("keine DocShell"); //! Exception oder so?
return false;
@@ -1398,10 +1398,10 @@ void SAL_CALL ScModelObj::enableAutomaticCalculation( sal_Bool bEnabledIn )
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( pDoc->GetAutoCalc() != bEnabled )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if ( rDoc.GetAutoCalc() != bEnabled )
{
- pDoc->SetAutoCalc( bEnabled );
+ rDoc.SetAutoCalc( bEnabled );
pDocShell->SetDocumentModified();
}
}
@@ -1417,7 +1417,7 @@ void SAL_CALL ScModelObj::protect( const OUString& aPassword ) throw(uno::Runtim
{
SolarMutexGuard aGuard;
// #i108245# if already protected, don't change anything
- if ( pDocShell && !pDocShell->GetDocument()->IsDocProtected() )
+ if ( pDocShell && !pDocShell->GetDocument().IsDocProtected() )
{
OUString aString(aPassword);
pDocShell->GetDocFunc().Protect( TABLEID_DOC, aString, true );
@@ -1441,7 +1441,7 @@ sal_Bool SAL_CALL ScModelObj::isProtected() throw(uno::RuntimeException, std::ex
{
SolarMutexGuard aGuard;
if (pDocShell)
- return pDocShell->GetDocument()->IsDocProtected();
+ return pDocShell->GetDocument().IsDocProtected();
OSL_FAIL("keine DocShell"); //! Exception oder so?
return false;
@@ -1475,9 +1475,9 @@ sheet::GoalResult SAL_CALL ScModelObj::seekGoal(
{
WaitObject aWait( pDocShell->GetActiveDialogParent() );
OUString aGoalString(aGoalValue);
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
double fValue = 0.0;
- bool bFound = pDoc->Solver(
+ bool bFound = rDoc.Solver(
(SCCOL)aFormulaPosition.Column, (SCROW)aFormulaPosition.Row, aFormulaPosition.Sheet,
(SCCOL)aVariablePosition.Column, (SCROW)aVariablePosition.Row, aVariablePosition.Sheet,
aGoalString, fValue );
@@ -1497,8 +1497,8 @@ uno::Reference<sheet::XConsolidationDescriptor> SAL_CALL ScModelObj::createConso
ScConsolidationDescriptor* pNew = new ScConsolidationDescriptor;
if ( pDocShell && !bEmpty )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- const ScConsolidateParam* pParam = pDoc->GetConsolidateDlgData();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ const ScConsolidateParam* pParam = rDoc.GetConsolidateDlgData();
if (pParam)
pNew->SetParam( *pParam );
}
@@ -1527,7 +1527,7 @@ void SAL_CALL ScModelObj::consolidate(
{
const ScConsolidateParam& rParam = aImpl.GetParam();
pDocShell->DoConsolidate( rParam, true );
- pDocShell->GetDocument()->SetConsolidateDlgData( &rParam );
+ pDocShell->GetDocument().SetConsolidateDlgData( &rParam );
}
}
@@ -1557,7 +1557,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL ScModelObj::getViewData( )
uno::Sequence< beans::PropertyValue > aSeq;
aSeq.realloc(1);
OUString sName;
- pDocShell->GetDocument()->GetName( pDocShell->GetDocument()->GetVisibleTab(), sName );
+ pDocShell->GetDocument().GetName( pDocShell->GetDocument().GetVisibleTab(), sName );
OUString sOUName(sName);
aSeq[0].Name = SC_ACTIVETABLE;
aSeq[0].Value <<= sOUName;
@@ -1591,12 +1591,12 @@ void SAL_CALL ScModelObj::setPropertyValue(
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- const ScDocOptions& rOldOpt = pDoc->GetDocOptions();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ const ScDocOptions& rOldOpt = rDoc.GetDocOptions();
ScDocOptions aNewOpt = rOldOpt;
// Don't recalculate while loading XML, when the formula text is stored
// Recalculation after loading is handled separately.
- bool bHardRecalc = !pDoc->IsImportingXML();
+ bool bHardRecalc = !rDoc.IsImportingXML();
bool bOpt = ScDocOptionsHelper::setPropertyValue( aNewOpt, aPropSet.getPropertyMap(), aPropertyName, aValue );
if (bOpt)
@@ -1613,16 +1613,16 @@ void SAL_CALL ScModelObj::setPropertyValue(
if ( aValue >>= aLocale )
{
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
eLatin = ScUnoConversion::GetLanguage(aLocale);
- pDoc->SetLanguage( eLatin, eCjk, eCtl );
+ rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
else if ( aString.equalsAscii( SC_UNO_CODENAME ) )
{
OUString sCodeName;
if ( aValue >>= sCodeName )
- pDoc->SetCodeName( sCodeName );
+ rDoc.SetCodeName( sCodeName );
}
else if ( aString.equalsAscii( SC_UNO_CJK_CLOCAL ) )
{
@@ -1630,9 +1630,9 @@ void SAL_CALL ScModelObj::setPropertyValue(
if ( aValue >>= aLocale )
{
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
eCjk = ScUnoConversion::GetLanguage(aLocale);
- pDoc->SetLanguage( eLatin, eCjk, eCtl );
+ rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
else if ( aString.equalsAscii( SC_UNO_CTL_CLOCAL ) )
@@ -1641,9 +1641,9 @@ void SAL_CALL ScModelObj::setPropertyValue(
if ( aValue >>= aLocale )
{
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
eCtl = ScUnoConversion::GetLanguage(aLocale);
- pDoc->SetLanguage( eLatin, eCjk, eCtl );
+ rDoc.SetLanguage( eLatin, eCjk, eCtl );
}
}
else if ( aString.equalsAscii( SC_UNO_APPLYFMDES ) )
@@ -1673,25 +1673,25 @@ void SAL_CALL ScModelObj::setPropertyValue(
else if ( aString.equalsAscii( SC_UNO_ISUNDOENABLED ) )
{
bool bUndoEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
- pDoc->EnableUndo( bUndoEnabled );
+ rDoc.EnableUndo( bUndoEnabled );
pDocShell->GetUndoManager()->SetMaxUndoActionCount(
bUndoEnabled
? officecfg::Office::Common::Undo::Steps::get() : 0);
}
else if ( aString.equalsAscii( SC_UNO_ISADJUSTHEIGHTENABLED ) )
{
- bool bOldAdjustHeightEnabled = pDoc->IsAdjustHeightEnabled();
+ bool bOldAdjustHeightEnabled = rDoc.IsAdjustHeightEnabled();
bool bAdjustHeightEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if( bOldAdjustHeightEnabled != bAdjustHeightEnabled )
- pDoc->EnableAdjustHeight( bAdjustHeightEnabled );
+ rDoc.EnableAdjustHeight( bAdjustHeightEnabled );
}
else if ( aString.equalsAscii( SC_UNO_ISEXECUTELINKENABLED ) )
{
- pDoc->EnableExecuteLink( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ rDoc.EnableExecuteLink( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
}
else if ( aString.equalsAscii( SC_UNO_ISCHANGEREADONLYENABLED ) )
{
- pDoc->EnableChangeReadOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
+ rDoc.EnableChangeReadOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
}
else if ( aString.equalsAscii( "BuildId" ) )
{
@@ -1702,7 +1702,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
OUString aObjName;
aValue >>= aObjName;
if ( !aObjName.isEmpty() )
- pDoc->RestoreChartListener( aObjName );
+ rDoc.RestoreChartListener( aObjName );
}
else if ( aString.equalsAscii( SC_UNO_INTEROPGRABBAG ) )
{
@@ -1711,7 +1711,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
if ( aNewOpt != rOldOpt )
{
- pDoc->SetDocOptions( aNewOpt );
+ rDoc.SetDocOptions( aNewOpt );
//! Recalc only for options that need it?
if ( bHardRecalc )
pDocShell->DoHardRecalc( true );
@@ -1730,8 +1730,8 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- const ScDocOptions& rOpt = pDoc->GetDocOptions();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ const ScDocOptions& rOpt = rDoc.GetDocOptions();
aRet = ScDocOptionsHelper::getPropertyValue( rOpt, aPropSet.getPropertyMap(), aPropertyName );
if ( aRet.hasValue() )
{
@@ -1740,7 +1740,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
else if ( aString.equalsAscii( SC_UNONAME_CLOCAL ) )
{
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
lang::Locale aLocale;
ScUnoConversion::FillLocale( aLocale, eLatin );
@@ -1748,14 +1748,14 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
}
else if ( aString.equalsAscii( SC_UNO_CODENAME ) )
{
- OUString sCodeName = pDoc->GetCodeName();
+ OUString sCodeName = rDoc.GetCodeName();
aRet <<= sCodeName;
}
else if ( aString.equalsAscii( SC_UNO_CJK_CLOCAL ) )
{
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
lang::Locale aLocale;
ScUnoConversion::FillLocale( aLocale, eCjk );
@@ -1764,7 +1764,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
else if ( aString.equalsAscii( SC_UNO_CTL_CLOCAL ) )
{
LanguageType eLatin, eCjk, eCtl;
- pDoc->GetLanguage( eLatin, eCjk, eCtl );
+ rDoc.GetLanguage( eLatin, eCjk, eCtl );
lang::Locale aLocale;
ScUnoConversion::FillLocale( aLocale, eCtl );
@@ -1809,14 +1809,14 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
else if ( aString.equalsAscii( SC_UNO_APPLYFMDES ) )
{
// default for no model is TRUE
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
bool bOpenInDesign = pModel ? pModel->GetOpenInDesignMode() : sal_True;
ScUnoHelpFunctions::SetBoolInAny( aRet, bOpenInDesign );
}
else if ( aString.equalsAscii( SC_UNO_AUTOCONTFOC ) )
{
// default for no model is FALSE
- ScDrawLayer* pModel = pDoc->GetDrawLayer();
+ ScDrawLayer* pModel = rDoc.GetDrawLayer();
bool bAutoControlFocus = pModel && pModel->GetAutoControlFocus();
ScUnoHelpFunctions::SetBoolInAny( aRet, bAutoControlFocus );
}
@@ -1826,7 +1826,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
}
else if ( aString.equalsAscii( SC_UNO_HASDRAWPAGES ) )
{
- ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetDocument()->GetDrawLayer() != 0) );
+ ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetDocument().GetDrawLayer() != 0) );
}
else if ( aString.equalsAscii( SC_UNO_BASICLIBRARIES ) )
{
@@ -1859,24 +1859,24 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
}
else if ( aString.equalsAscii( SC_UNO_ISUNDOENABLED ) )
{
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsUndoEnabled() );
+ ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsUndoEnabled() );
}
else if ( aString.equalsAscii( SC_UNO_ISADJUSTHEIGHTENABLED ) )
{
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsAdjustHeightEnabled() );
+ ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsAdjustHeightEnabled() );
}
else if ( aString.equalsAscii( SC_UNO_ISEXECUTELINKENABLED ) )
{
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsExecuteLinkEnabled() );
+ ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsExecuteLinkEnabled() );
}
else if ( aString.equalsAscii( SC_UNO_ISCHANGEREADONLYENABLED ) )
{
- ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->IsChangeReadOnlyEnabled() );
+ ScUnoHelpFunctions::SetBoolInAny( aRet, rDoc.IsChangeReadOnlyEnabled() );
}
else if ( aString.equalsAscii( SC_UNO_REFERENCEDEVICE ) )
{
VCLXDevice* pXDev = new VCLXDevice();
- pXDev->SetOutputDevice( pDoc->GetRefDevice() );
+ pXDev->SetOutputDevice( rDoc.GetRefDevice() );
aRet <<= uno::Reference< awt::XDevice >( pXDev );
}
else if ( aString.equalsAscii( "BuildId" ) )
@@ -2130,7 +2130,7 @@ bool ScModelObj::HasChangesListeners() const
return true;
// "change" event set in any sheet?
- return pDocShell && pDocShell->GetDocument()->HasAnySheetEventScript(SC_SHEETEVENT_CHANGE);
+ return pDocShell && pDocShell->GetDocument().HasAnySheetEventScript(SC_SHEETEVENT_CHANGE);
}
void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& rRanges,
@@ -2183,13 +2183,13 @@ void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& r
{
ScMarkData aMarkData;
aMarkData.MarkFromRangeList( rRanges, false );
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
SCTAB nTab = *itr;
- const ScSheetEvents* pEvents = pDoc->GetSheetEvents(nTab);
+ const ScSheetEvents* pEvents = rDoc.GetSheetEvents(nTab);
if (pEvents)
{
const OUString* pScript = pEvents->GetScript(SC_SHEETEVENT_CHANGE);
@@ -2237,17 +2237,17 @@ void ScModelObj::HandleCalculateEvents()
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
// don't call events before the document is visible
// (might also set a flag on SFX_EVENT_LOADFINISHED and only disable while loading)
- if ( pDoc->IsDocVisible() )
+ if ( rDoc.IsDocVisible() )
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab = 0; nTab < nTabCount; nTab++)
{
- if (pDoc->HasCalcNotification(nTab))
+ if (rDoc.HasCalcNotification(nTab))
{
- if (const ScSheetEvents* pEvents = pDoc->GetSheetEvents( nTab ))
+ if (const ScSheetEvents* pEvents = rDoc.GetSheetEvents( nTab ))
{
if (const OUString* pScript = pEvents->GetScript(SC_SHEETEVENT_CALCULATE))
{
@@ -2261,7 +2261,7 @@ void ScModelObj::HandleCalculateEvents()
try
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( rDoc.GetVbaEventProcessor(), uno::UNO_SET_THROW );
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= nTab;
xVbaEvents->processVbaEvent( ScSheetEvents::GetVbaSheetEventId( SC_SHEETEVENT_CALCULATE ), aArgs );
@@ -2272,7 +2272,7 @@ void ScModelObj::HandleCalculateEvents()
}
}
}
- pDoc->ResetCalcNotifications();
+ rDoc.ResetCalcNotifications();
}
}
@@ -2380,13 +2380,13 @@ uno::Sequence< sheet::opencl::OpenCLPlatform > ScModelObj::getOpenCLPlatforms()
ScDrawPagesObj::ScDrawPagesObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDrawPagesObj::~ScDrawPagesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDrawPagesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -2406,7 +2406,7 @@ uno::Reference<drawing::XDrawPage> ScDrawPagesObj::GetObjectByIndex_Impl(sal_Int
{
ScDrawLayer* pDrawLayer = pDocShell->MakeDrawLayer();
OSL_ENSURE(pDrawLayer,"kann Draw-Layer nicht anlegen");
- if ( pDrawLayer && nIndex >= 0 && nIndex < pDocShell->GetDocument()->GetTableCount() )
+ if ( pDrawLayer && nIndex >= 0 && nIndex < pDocShell->GetDocument().GetTableCount() )
{
SdrPage* pPage = pDrawLayer->GetPage((sal_uInt16)nIndex);
OSL_ENSURE(pPage,"Draw-Page nicht gefunden");
@@ -2429,7 +2429,7 @@ uno::Reference<drawing::XDrawPage> SAL_CALL ScDrawPagesObj::insertNewByIndex( sa
if (pDocShell)
{
OUString aNewName;
- pDocShell->GetDocument()->CreateValidTabName(aNewName);
+ pDocShell->GetDocument().CreateValidTabName(aNewName);
if ( pDocShell->GetDocFunc().InsertTable( static_cast<SCTAB>(nPos),
aNewName, true, true ) )
xRet.set(GetObjectByIndex_Impl( nPos ));
@@ -2459,7 +2459,7 @@ sal_Int32 SAL_CALL ScDrawPagesObj::getCount() throw(uno::RuntimeException, std::
{
SolarMutexGuard aGuard;
if (pDocShell)
- return pDocShell->GetDocument()->GetTableCount();
+ return pDocShell->GetDocument().GetTableCount();
return 0;
}
@@ -2490,13 +2490,13 @@ sal_Bool SAL_CALL ScDrawPagesObj::hasElements() throw(uno::RuntimeException, std
ScTableSheetsObj::ScTableSheetsObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScTableSheetsObj::~ScTableSheetsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScTableSheetsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -2514,7 +2514,7 @@ void ScTableSheetsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScTableSheetObj* ScTableSheetsObj::GetObjectByIndex_Impl(sal_Int32 nIndex) const
{
- if ( pDocShell && nIndex >= 0 && nIndex < pDocShell->GetDocument()->GetTableCount() )
+ if ( pDocShell && nIndex >= 0 && nIndex < pDocShell->GetDocument().GetTableCount() )
return new ScTableSheetObj( pDocShell, static_cast<SCTAB>(nIndex) );
return NULL;
@@ -2525,7 +2525,7 @@ ScTableSheetObj* ScTableSheetsObj::GetObjectByName_Impl(const OUString& aName) c
if (pDocShell)
{
SCTAB nIndex;
- if ( pDocShell->GetDocument()->GetTable( aName, nIndex ) )
+ if ( pDocShell->GetDocument().GetTable( aName, nIndex ) )
return new ScTableSheetObj( pDocShell, nIndex );
}
return NULL;
@@ -2553,7 +2553,7 @@ void SAL_CALL ScTableSheetsObj::moveByName( const OUString& aName, sal_Int16 nDe
if (pDocShell)
{
SCTAB nSource;
- if ( pDocShell->GetDocument()->GetTable( aName, nSource ) )
+ if ( pDocShell->GetDocument().GetTable( aName, nSource ) )
bDone = pDocShell->MoveTable( nSource, nDestination, false, true );
}
if (!bDone)
@@ -2570,14 +2570,14 @@ void SAL_CALL ScTableSheetsObj::copyByName( const OUString& aName,
{
OUString aNewStr(aCopy);
SCTAB nSource;
- if ( pDocShell->GetDocument()->GetTable( aName, nSource ) )
+ if ( pDocShell->GetDocument().GetTable( aName, nSource ) )
{
bDone = pDocShell->MoveTable( nSource, nDestination, true, true );
if (bDone)
{
// #i92477# any index past the last sheet means "append" in MoveTable
SCTAB nResultTab = static_cast<SCTAB>(nDestination);
- SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); // count after copying
+ SCTAB nTabCount = pDocShell->GetDocument().GetTableCount(); // count after copying
if (nResultTab >= nTabCount)
nResultTab = nTabCount - 1;
@@ -2608,17 +2608,17 @@ void SAL_CALL ScTableSheetsObj::insertByName( const OUString& aName, const uno::
ScTableSheetObj* pSheetObj = ScTableSheetObj::getImplementation( xInterface );
if ( pSheetObj && !pSheetObj->GetDocShell() ) // noch nicht eingefuegt?
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OUString aNamStr(aName);
SCTAB nDummy;
- if ( pDoc->GetTable( aNamStr, nDummy ) )
+ if ( rDoc.GetTable( aNamStr, nDummy ) )
{
// name already exists
throw container::ElementExistException();
}
else
{
- SCTAB nPosition = pDoc->GetTableCount();
+ SCTAB nPosition = rDoc.GetTableCount();
bDone = pDocShell->GetDocFunc().InsertTable( nPosition, aNamStr,
true, true );
if (bDone)
@@ -2661,7 +2661,7 @@ void SAL_CALL ScTableSheetsObj::replaceByName( const OUString& aName, const uno:
if ( pSheetObj && !pSheetObj->GetDocShell() ) // noch nicht eingefuegt?
{
SCTAB nPosition;
- if ( pDocShell->GetDocument()->GetTable( aName, nPosition ) )
+ if ( pDocShell->GetDocument().GetTable( aName, nPosition ) )
{
if ( pDocShell->GetDocFunc().DeleteTable( nPosition, true, true ) )
{
@@ -2703,7 +2703,7 @@ void SAL_CALL ScTableSheetsObj::removeByName( const OUString& aName )
if (pDocShell)
{
SCTAB nIndex;
- if ( pDocShell->GetDocument()->GetTable( aName, nIndex ) )
+ if ( pDocShell->GetDocument().GetTable( aName, nIndex ) )
bDone = pDocShell->GetDocFunc().DeleteTable( nIndex, true, true );
else // not found
throw container::NoSuchElementException();
@@ -2719,7 +2719,7 @@ sal_Int32 ScTableSheetsObj::importSheet(
throw( lang::IllegalArgumentException, lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
{
//pDocShell is the destination
- ScDocument* pDocDest = pDocShell->GetDocument();
+ ScDocument& rDocDest = pDocShell->GetDocument();
// Source document docShell
if ( !xDocSrc.is() )
@@ -2729,11 +2729,11 @@ sal_Int32 ScTableSheetsObj::importSheet(
// SourceSheet Position and does srcName exists ?
SCTAB nIndexSrc;
- if ( !pDocShellSrc->GetDocument()->GetTable( srcName, nIndexSrc ) )
+ if ( !pDocShellSrc->GetDocument().GetTable( srcName, nIndexSrc ) )
throw lang::IllegalArgumentException();
// Check the validity of destination index.
- SCTAB nCount = pDocDest->GetTableCount();
+ SCTAB nCount = rDocDest.GetTableCount();
SCTAB nIndexDest = static_cast<SCTAB>(nDestPosition);
if (nIndexDest > nCount || nIndexDest < 0)
throw lang::IndexOutOfBoundsException();
@@ -2778,8 +2778,8 @@ uno::Sequence < uno::Reference< table::XCellRange > > SAL_CALL ScTableSheetsObj:
uno::Sequence < uno::Reference < table::XCellRange > > xRet;
ScRangeList aRangeList;
- ScDocument* pDoc = pDocShell->GetDocument();
- if (ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, pDoc, ::formula::FormulaGrammar::CONV_OOO, ';' ))
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if (ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, &rDoc, ::formula::FormulaGrammar::CONV_OOO, ';' ))
{
size_t nCount = aRangeList.size();
if (nCount)
@@ -2815,7 +2815,7 @@ sal_Int32 SAL_CALL ScTableSheetsObj::getCount() throw(uno::RuntimeException, std
{
SolarMutexGuard aGuard;
if (pDocShell)
- return pDocShell->GetDocument()->GetTableCount();
+ return pDocShell->GetDocument().GetTableCount();
return 0;
}
@@ -2864,14 +2864,14 @@ uno::Sequence<OUString> SAL_CALL ScTableSheetsObj::getElementNames()
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nCount = rDoc.GetTableCount();
OUString aName;
uno::Sequence<OUString> aSeq(nCount);
OUString* pAry = aSeq.getArray();
for (SCTAB i=0; i<nCount; i++)
{
- pDoc->GetName( i, aName );
+ rDoc.GetName( i, aName );
pAry[i] = aName;
}
return aSeq;
@@ -2886,7 +2886,7 @@ sal_Bool SAL_CALL ScTableSheetsObj::hasByName( const OUString& aName )
if (pDocShell)
{
SCTAB nIndex;
- if ( pDocShell->GetDocument()->GetTable( aName, nIndex ) )
+ if ( pDocShell->GetDocument().GetTable( aName, nIndex ) )
return sal_True;
}
return false;
@@ -2898,13 +2898,13 @@ ScTableColumnsObj::ScTableColumnsObj(ScDocShell* pDocSh, SCTAB nT, SCCOL nSC, SC
nStartCol( nSC ),
nEndCol ( nEC )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScTableColumnsObj::~ScTableColumnsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScTableColumnsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -3120,7 +3120,7 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const OUString& aProperty
if (!pDocShell)
throw uno::RuntimeException();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OUString aNameString(aPropertyName);
uno::Any aAny;
@@ -3129,27 +3129,27 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const OUString& aProperty
if ( aNameString.equalsAscii( SC_UNONAME_CELLWID ) )
{
// for hidden column, return original height
- sal_uInt16 nWidth = pDoc->GetOriginalWidth( nStartCol, nTab );
+ sal_uInt16 nWidth = rDoc.GetOriginalWidth( nStartCol, nTab );
aAny <<= (sal_Int32)TwipsToHMM(nWidth);
}
else if ( aNameString.equalsAscii( SC_UNONAME_CELLVIS ) )
{
- bool bVis = !pDoc->ColHidden(nStartCol, nTab);
+ bool bVis = !rDoc.ColHidden(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
else if ( aNameString.equalsAscii( SC_UNONAME_OWIDTH ) )
{
- bool bOpt = !(pDoc->GetColFlags( nStartCol, nTab ) & CR_MANUALSIZE);
+ bool bOpt = !(rDoc.GetColFlags( nStartCol, nTab ) & CR_MANUALSIZE);
ScUnoHelpFunctions::SetBoolInAny( aAny, bOpt );
}
else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE ) )
{
- ScBreakType nBreak = pDoc->HasColBreak(nStartCol, nTab);
+ ScBreakType nBreak = rDoc.HasColBreak(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak );
}
else if ( aNameString.equalsAscii( SC_UNONAME_MANPAGE ) )
{
- ScBreakType nBreak = pDoc->HasColBreak(nStartCol, nTab);
+ ScBreakType nBreak = rDoc.HasColBreak(nStartCol, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) != 0 );
}
@@ -3164,13 +3164,13 @@ ScTableRowsObj::ScTableRowsObj(ScDocShell* pDocSh, SCTAB nT, SCROW nSR, SCROW nE
nStartRow( nSR ),
nEndRow ( nER )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScTableRowsObj::~ScTableRowsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScTableRowsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -3292,20 +3292,20 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
throw uno::RuntimeException();
ScDocFunc& rFunc = pDocShell->GetDocFunc();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
std::vector<sc::ColRowSpan> aRowArr(1, sc::ColRowSpan(nStartRow,nEndRow));
OUString aNameString(aPropertyName);
if ( aNameString.equalsAscii( SC_UNONAME_OHEIGHT ) )
{
sal_Int32 nNewHeight = 0;
- if ( pDoc->IsImportingXML() && ( aValue >>= nNewHeight ) )
+ if ( rDoc.IsImportingXML() && ( aValue >>= nNewHeight ) )
{
// used to set the stored row height for rows with optimal height when loading.
// TODO: It's probably cleaner to use a different property name
// for this.
- pDoc->SetRowHeightOnly( nStartRow, nEndRow, nTab, (sal_uInt16)HMMToTwips(nNewHeight) );
+ rDoc.SetRowHeightOnly( nStartRow, nEndRow, nTab, (sal_uInt16)HMMToTwips(nNewHeight) );
}
else
{
@@ -3323,13 +3323,13 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
sal_Int32 nNewHeight = 0;
if ( aValue >>= nNewHeight )
{
- if (pDoc->IsImportingXML())
+ if (rDoc.IsImportingXML())
{
// TODO: This is a band-aid fix. Eventually we need to
// re-work ods' style import to get it to set styles to
// ScDocument directly.
- pDoc->SetRowHeightOnly( nStartRow, nEndRow, nTab, (sal_uInt16)HMMToTwips(nNewHeight) );
- pDoc->SetManualHeight( nStartRow, nEndRow, nTab, true );
+ rDoc.SetRowHeightOnly( nStartRow, nEndRow, nTab, (sal_uInt16)HMMToTwips(nNewHeight) );
+ rDoc.SetManualHeight( nStartRow, nEndRow, nTab, true );
}
else
rFunc.SetWidthOrHeight(
@@ -3347,15 +3347,15 @@ void SAL_CALL ScTableRowsObj::setPropertyValue(
{
// #i116460# Shortcut to only set the flag, without drawing layer update etc.
// Should only be used from import filters.
- pDoc->SetRowHidden(nStartRow, nEndRow, nTab, !ScUnoHelpFunctions::GetBoolFromAny( aValue ));
+ rDoc.SetRowHidden(nStartRow, nEndRow, nTab, !ScUnoHelpFunctions::GetBoolFromAny( aValue ));
}
else if ( aNameString.equalsAscii( SC_UNONAME_CELLFILT ) )
{
//! undo etc.
if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
- pDoc->SetRowFiltered(nStartRow, nEndRow, nTab, true);
+ rDoc.SetRowFiltered(nStartRow, nEndRow, nTab, true);
else
- pDoc->SetRowFiltered(nStartRow, nEndRow, nTab, false);
+ rDoc.SetRowFiltered(nStartRow, nEndRow, nTab, false);
}
else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE) || aNameString.equalsAscii( SC_UNONAME_MANPAGE) )
{
@@ -3389,7 +3389,7 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam
if (!pDocShell)
throw uno::RuntimeException();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OUString aNameString(aPropertyName);
uno::Any aAny;
@@ -3398,33 +3398,33 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam
if ( aNameString.equalsAscii( SC_UNONAME_CELLHGT ) )
{
// for hidden row, return original height
- sal_uInt16 nHeight = pDoc->GetOriginalHeight( nStartRow, nTab );
+ sal_uInt16 nHeight = rDoc.GetOriginalHeight( nStartRow, nTab );
aAny <<= (sal_Int32)TwipsToHMM(nHeight);
}
else if ( aNameString.equalsAscii( SC_UNONAME_CELLVIS ) )
{
SCROW nLastRow;
- bool bVis = !pDoc->RowHidden(nStartRow, nTab, NULL, &nLastRow);
+ bool bVis = !rDoc.RowHidden(nStartRow, nTab, NULL, &nLastRow);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
else if ( aNameString.equalsAscii( SC_UNONAME_CELLFILT ) )
{
- bool bVis = pDoc->RowFiltered(nStartRow, nTab);
+ bool bVis = rDoc.RowFiltered(nStartRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
}
else if ( aNameString.equalsAscii( SC_UNONAME_OHEIGHT ) )
{
- bool bOpt = !(pDoc->GetRowFlags( nStartRow, nTab ) & CR_MANUALSIZE);
+ bool bOpt = !(rDoc.GetRowFlags( nStartRow, nTab ) & CR_MANUALSIZE);
ScUnoHelpFunctions::SetBoolInAny( aAny, bOpt );
}
else if ( aNameString.equalsAscii( SC_UNONAME_NEWPAGE ) )
{
- ScBreakType nBreak = pDoc->HasRowBreak(nStartRow, nTab);
+ ScBreakType nBreak = rDoc.HasRowBreak(nStartRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak );
}
else if ( aNameString.equalsAscii( SC_UNONAME_MANPAGE ) )
{
- ScBreakType nBreak = pDoc->HasRowBreak(nStartRow, nTab);
+ ScBreakType nBreak = rDoc.HasRowBreak(nStartRow, nTab);
ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) != 0 );
}
else if ( aNameString.equalsAscii( SC_UNONAME_CELLBACK ) || aNameString.equalsAscii( SC_UNONAME_CELLTRAN ) )
@@ -3445,7 +3445,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScTableRowsObj )
ScSpreadsheetSettingsObj::~ScSpreadsheetSettingsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScSpreadsheetSettingsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -3491,13 +3491,13 @@ ScAnnotationsObj::ScAnnotationsObj(ScDocShell* pDocSh, SCTAB nT) :
pDocShell( pDocSh ),
nTab( nT )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScAnnotationsObj::~ScAnnotationsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScAnnotationsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -3516,8 +3516,8 @@ bool ScAnnotationsObj::GetAddressByIndex_Impl( sal_Int32 nIndex, ScAddress& rPos
if (!pDocShell)
return false;
- ScDocument* pDoc = pDocShell->GetDocument();
- rPos = pDoc->GetNotePosition(nIndex);
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rPos = rDoc.GetNotePosition(nIndex);
return rPos.IsValid();
}
@@ -3584,10 +3584,10 @@ sal_Int32 SAL_CALL ScAnnotationsObj::getCount()
sal_Int32 nCount = 0;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
const ScRangeList aRangeList( ScRange( 0, 0, nTab, MAXCOL, MAXROW, nTab) );
std::vector<sc::NoteEntry> rNotes;
- pDoc->GetNotesInRange(aRangeList, rNotes);
+ rDoc.GetNotesInRange(aRangeList, rNotes);
nCount = rNotes.size();
}
return nCount;
@@ -3621,13 +3621,13 @@ ScScenariosObj::ScScenariosObj(ScDocShell* pDocSh, SCTAB nT) :
pDocShell( pDocSh ),
nTab ( nT )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScScenariosObj::~ScScenariosObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScScenariosObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -3652,10 +3652,10 @@ bool ScScenariosObj::GetScenarioIndex_Impl( const OUString& rName, SCTAB& rIndex
if ( pDocShell )
{
OUString aTabName;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nCount = (SCTAB)getCount();
for (SCTAB i=0; i<nCount; i++)
- if (pDoc->GetName( nTab+i+1, aTabName ))
+ if (rDoc.GetName( nTab+i+1, aTabName ))
if (aTabName.equals(rName))
{
rIndex = i;
@@ -3745,12 +3745,12 @@ sal_Int32 SAL_CALL ScScenariosObj::getCount() throw(uno::RuntimeException, std::
SCTAB nCount = 0;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if (!pDoc->IsScenario(nTab))
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if (!rDoc.IsScenario(nTab))
{
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nNext = nTab + 1;
- while (nNext < nTabCount && pDoc->IsScenario(nNext))
+ while (nNext < nTabCount && rDoc.IsScenario(nNext))
{
++nCount;
++nNext;
@@ -3806,10 +3806,10 @@ uno::Sequence<OUString> SAL_CALL ScScenariosObj::getElementNames()
if ( pDocShell ) // sonst ist auch Count = 0
{
OUString aTabName;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
OUString* pAry = aSeq.getArray();
for (SCTAB i=0; i<nCount; i++)
- if (pDoc->GetName( nTab+i+1, aTabName ))
+ if (rDoc.GetName( nTab+i+1, aTabName ))
pAry[i] = aTabName;
}
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index 8aa8fda0ed5f..b382b17da612 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -30,13 +30,13 @@ ScDrawDefaultsObj::ScDrawDefaultsObj(ScDocShell* pDocSh) :
// SvxUnoDrawPool is initialized without model,
// draw layer is created on demand in getModelPool
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDrawDefaultsObj::~ScDrawDefaultsObj() throw ()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDrawDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -57,7 +57,7 @@ SfxItemPool* ScDrawDefaultsObj::getModelPool( bool bReadOnly ) throw()
if ( pDocShell )
{
ScDrawLayer* pModel = bReadOnly ?
- pDocShell->GetDocument()->GetDrawLayer() :
+ pDocShell->GetDocument().GetDrawLayer() :
pDocShell->MakeDrawLayer();
if ( pModel )
pRet = &pModel->GetItemPool();
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index ff1fa5e33c2b..85ab77eb3e02 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -112,7 +112,7 @@ ScAnnotationEditSource::ScAnnotationEditSource(ScDocShell* pDocSh, const ScAddre
bDataValid( false )
{
if (pDocShell)
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScAnnotationEditSource::~ScAnnotationEditSource()
@@ -120,7 +120,7 @@ ScAnnotationEditSource::~ScAnnotationEditSource()
SolarMutexGuard aGuard; // needed for EditEngine dtor
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
delete pForwarder;
delete pEditEngine;
@@ -133,7 +133,7 @@ SvxEditSource* ScAnnotationEditSource::Clone() const
SdrObject* ScAnnotationEditSource::GetCaptionObj()
{
- ScPostIt* pNote = pDocShell->GetDocument()->GetNote(aCellPos);
+ ScPostIt* pNote = pDocShell->GetDocument().GetNote(aCellPos);
return pNote ? pNote->GetOrCreateCaption( aCellPos ) : 0;
}
@@ -144,7 +144,7 @@ SvxTextForwarder* ScAnnotationEditSource::GetTextForwarder()
// Notizen haben keine Felder
if ( pDocShell )
{
- pEditEngine = new ScNoteEditEngine( pDocShell->GetDocument()->GetNoteEngine() );
+ pEditEngine = new ScNoteEditEngine( pDocShell->GetDocument().GetNoteEngine() );
}
else
{
@@ -159,7 +159,7 @@ SvxTextForwarder* ScAnnotationEditSource::GetTextForwarder()
return pForwarder;
if ( pDocShell )
- if ( ScPostIt* pNote = pDocShell->GetDocument()->GetNote(aCellPos) )
+ if ( ScPostIt* pNote = pDocShell->GetDocument().GetNote(aCellPos) )
if ( const EditTextObject* pEditObj = pNote->GetEditTextObject() )
pEditEngine->SetText( *pEditObj ); // incl. Umbrueche
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index e72d8062324b..14a7af9eaf8e 100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -33,13 +33,13 @@ ScSheetEventsObj::ScSheetEventsObj(ScDocShell* pDocSh, SCTAB nT) :
mpDocShell( pDocSh ),
mnTab( nT )
{
- mpDocShell->GetDocument()->AddUnoObject(*this);
+ mpDocShell->GetDocument().AddUnoObject(*this);
}
ScSheetEventsObj::~ScSheetEventsObj()
{
if (mpDocShell)
- mpDocShell->GetDocument()->RemoveUnoObject(*this);
+ mpDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScSheetEventsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -76,7 +76,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno:
throw container::NoSuchElementException();
ScSheetEvents aNewEvents;
- const ScSheetEvents* pOldEvents = mpDocShell->GetDocument()->GetSheetEvents(mnTab);
+ const ScSheetEvents* pOldEvents = mpDocShell->GetDocument().GetSheetEvents(mnTab);
if (pOldEvents)
aNewEvents = *pOldEvents;
@@ -110,7 +110,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno:
else
aNewEvents.SetScript( nEvent, NULL ); // reset
- mpDocShell->GetDocument()->SetSheetEvents( mnTab, &aNewEvents );
+ mpDocShell->GetDocument().SetSheetEvents( mnTab, &aNewEvents );
mpDocShell->SetDocumentModified();
}
@@ -127,7 +127,7 @@ uno::Any SAL_CALL ScSheetEventsObj::getByName( const OUString& aName )
const OUString* pScript = NULL;
if (mpDocShell)
{
- const ScSheetEvents* pEvents = mpDocShell->GetDocument()->GetSheetEvents(mnTab);
+ const ScSheetEvents* pEvents = mpDocShell->GetDocument().GetSheetEvents(mnTab);
if (pEvents)
pScript = pEvents->GetScript(nEvent);
}
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 8021562df8a0..a43e5448e7e1 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -284,7 +284,7 @@ ScCellFieldsObj::ScCellFieldsObj(
aCellPos( rPos ),
mpRefreshListeners( NULL )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
mpEditSource = new ScCellEditSource( pDocShell, aCellPos );
}
@@ -292,7 +292,7 @@ ScCellFieldsObj::ScCellFieldsObj(
ScCellFieldsObj::~ScCellFieldsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
delete mpEditSource;
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index e6843c0f94e0..bfaa5a2196b9 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -29,15 +29,15 @@ static rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell*
rtl::Reference<SvxForbiddenCharactersTable> xRet;
if ( pDocSh )
{
- ScDocument* pDoc = pDocSh->GetDocument();
- xRet = pDoc->GetForbiddenCharacters();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ xRet = rDoc.GetForbiddenCharacters();
if ( !xRet.is() )
{
// create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable,
// so changes can be stored.
xRet = new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() );
- pDoc->SetForbiddenCharacters( xRet );
+ rDoc.SetForbiddenCharacters( xRet );
}
}
return xRet;
@@ -48,13 +48,13 @@ ScForbiddenCharsObj::ScForbiddenCharsObj( ScDocShell* pDocSh ) :
pDocShell( pDocSh )
{
if (pDocShell)
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScForbiddenCharsObj::~ScForbiddenCharsObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScForbiddenCharsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -70,7 +70,7 @@ void ScForbiddenCharsObj::onChange()
{
if (pDocShell)
{
- pDocShell->GetDocument()->SetForbiddenCharacters( mxForbiddenChars );
+ pDocShell->GetDocument().SetForbiddenCharacters( mxForbiddenChars );
pDocShell->PostPaintGridAll();
pDocShell->SetDocumentModified();
}
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 24769484d77d..18a4a2c4f1b1 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -77,13 +77,13 @@ ScSheetLinkObj::ScSheetLinkObj(ScDocShell* pDocSh, const OUString& rName) :
pDocShell( pDocSh ),
aFileName( rName )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScSheetLinkObj::~ScSheetLinkObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScSheetLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -108,7 +108,7 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const
{
if (pDocShell)
{
- sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = pDocShell->GetDocument().GetLinkManager();
size_t nCount = pLinkManager->GetLinks().size();
for (size_t i=0; i<nCount; i++)
{
@@ -289,14 +289,14 @@ void ScSheetLinkObj::setFileName(const OUString& rNewName)
// zuerst Tabellen umsetzen
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if ( pDoc->IsLinked(nTab) && pDoc->GetLinkDoc(nTab) == aFileName ) // alte Datei
- pDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), aNewStr,
- pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab),
- pDoc->GetLinkTab(nTab),
- pDoc->GetLinkRefreshDelay(nTab) ); // nur Datei aendern
+ if ( rDoc.IsLinked(nTab) && rDoc.GetLinkDoc(nTab) == aFileName ) // alte Datei
+ rDoc.SetLink( nTab, rDoc.GetLinkMode(nTab), aNewStr,
+ rDoc.GetLinkFlt(nTab), rDoc.GetLinkOpt(nTab),
+ rDoc.GetLinkTab(nTab),
+ rDoc.GetLinkRefreshDelay(nTab) ); // nur Datei aendern
// Links updaten
//! Undo !!!
@@ -374,13 +374,13 @@ void ScSheetLinkObj::setRefreshDelay(sal_Int32 nRefreshDelay)
ScSheetLinksObj::ScSheetLinksObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScSheetLinksObj::~ScSheetLinksObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -403,15 +403,15 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex)
typedef boost::unordered_set<OUString, OUStringHash> StrSetType;
StrSetType aNames;
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
sal_Int32 nCount = 0;
for (SCTAB nTab = 0; nTab < nTabCount; ++nTab)
{
- if (!pDoc->IsLinked(nTab))
+ if (!rDoc.IsLinked(nTab))
continue;
- OUString aLinkDoc = pDoc->GetLinkDoc(nTab);
+ OUString aLinkDoc = rDoc.GetLinkDoc(nTab);
if (aNames.insert(aLinkDoc).second)
{
// unique document name.
@@ -432,13 +432,13 @@ ScSheetLinkObj* ScSheetLinksObj::GetObjectByName_Impl(const OUString& aName)
{
OUString aNameStr(aName);
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if (pDoc->IsLinked(nTab))
+ if (rDoc.IsLinked(nTab))
{
- //! case-insensitiv ???
- OUString aLinkDoc = pDoc->GetLinkDoc( nTab );
+ //! case-insensitive ???
+ OUString aLinkDoc = rDoc.GetLinkDoc( nTab );
if ( aLinkDoc == aNameStr )
return new ScSheetLinkObj( pDocShell, aNameStr );
}
@@ -469,14 +469,14 @@ sal_Int32 SAL_CALL ScSheetLinksObj::getCount() throw(uno::RuntimeException, std:
sal_Int32 nCount = 0;
StrSetType aNames;
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab = 0; nTab < nTabCount; ++nTab)
{
- if (!pDoc->IsLinked(nTab))
+ if (!rDoc.IsLinked(nTab))
continue;
- OUString aLinkDoc = pDoc->GetLinkDoc(nTab);
+ OUString aLinkDoc = rDoc.GetLinkDoc(nTab);
if (aNames.insert(aLinkDoc).second)
++nCount;
}
@@ -530,13 +530,13 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const OUString& aName )
{
OUString aNameStr(aName);
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if (pDoc->IsLinked(nTab))
+ if (rDoc.IsLinked(nTab))
{
//! case-insensitiv ???
- OUString aLinkDoc(pDoc->GetLinkDoc( nTab ));
+ OUString aLinkDoc(rDoc.GetLinkDoc( nTab ));
if ( aLinkDoc == aNameStr )
return sal_True;
}
@@ -555,8 +555,8 @@ uno::Sequence<OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::R
return uno::Sequence<OUString>();
StrSetType aNames;
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
sal_Int32 nLinkCount = getCount();
uno::Sequence<OUString> aSeq(nLinkCount);
@@ -564,10 +564,10 @@ uno::Sequence<OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::R
size_t nPos = 0;
for (SCTAB nTab = 0; nTab < nTabCount; ++nTab)
{
- if (!pDoc->IsLinked(nTab))
+ if (!rDoc.IsLinked(nTab))
continue;
- OUString aLinkDoc = pDoc->GetLinkDoc(nTab);
+ OUString aLinkDoc = rDoc.GetLinkDoc(nTab);
if (aNames.insert(aLinkDoc).second)
pAry[nPos++] = aLinkDoc;
}
@@ -579,7 +579,7 @@ static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, size_t nPos )
{
if (pDocShell)
{
- sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = pDocShell->GetDocument().GetLinkManager();
size_t nTotalCount = pLinkManager->GetLinks().size();
size_t nAreaCount = 0;
for (size_t i=0; i<nTotalCount; i++)
@@ -601,13 +601,13 @@ ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, size_t nP) :
pDocShell( pDocSh ),
nPos( nP )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScAreaLinkObj::~ScAreaLinkObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScAreaLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -652,7 +652,7 @@ void ScAreaLinkObj::Modify_Impl( const OUString* pNewFile, const OUString* pNewF
//! Undo fuer Loeschen
//! Undo zusammenfassen
- sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = pDocShell->GetDocument().GetLinkManager();
pLinkManager->Remove( pLink );
pLink = NULL; // bei Remove geloescht
@@ -916,13 +916,13 @@ void SAL_CALL ScAreaLinkObj::setDestArea( const table::CellRangeAddress& aDestAr
ScAreaLinksObj::ScAreaLinksObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScAreaLinksObj::~ScAreaLinksObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScAreaLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -977,7 +977,7 @@ void SAL_CALL ScAreaLinksObj::removeByIndex( sal_Int32 nIndex ) throw(uno::Runti
{
//! SetAddUndo oder so
- sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = pDocShell->GetDocument().GetLinkManager();
pLinkManager->Remove( pLink );
}
}
@@ -999,7 +999,7 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException, std::
sal_Int32 nAreaCount = 0;
if (pDocShell)
{
- sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = pDocShell->GetDocument().GetLinkManager();
size_t nTotalCount = pLinkManager->GetLinks().size();
for (size_t i=0; i<nTotalCount; i++)
{
@@ -1042,13 +1042,13 @@ ScDDELinkObj::ScDDELinkObj(ScDocShell* pDocSh, const OUString& rA,
aTopic( rT ),
aItem( rI )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDDELinkObj::~ScDDELinkObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1126,7 +1126,7 @@ void SAL_CALL ScDDELinkObj::refresh() throw(uno::RuntimeException, std::exceptio
SolarMutexGuard aGuard;
if (pDocShell)
{
- sc::DocumentLinkManager& rMgr = pDocShell->GetDocument()->GetDocLinkManager();
+ sc::DocumentLinkManager& rMgr = pDocShell->GetDocument().GetDocLinkManager();
rMgr.updateDdeLink(aAppl, aTopic, aItem);
}
}
@@ -1175,23 +1175,20 @@ uno::Sequence< uno::Sequence< uno::Any > > ScDDELinkObj::getResults( )
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( pDoc )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ size_t nPos = 0;
+ if ( rDoc.FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) )
{
- size_t nPos = 0;
- if ( pDoc->FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) )
+ const ScMatrix* pMatrix = rDoc.GetDdeLinkResultMatrix( nPos );
+ if ( pMatrix )
{
- const ScMatrix* pMatrix = pDoc->GetDdeLinkResultMatrix( nPos );
- if ( pMatrix )
+ uno::Any aAny;
+ if ( ScRangeToSequence::FillMixedArray( aAny, pMatrix, true ) )
{
- uno::Any aAny;
- if ( ScRangeToSequence::FillMixedArray( aAny, pMatrix, true ) )
- {
- aAny >>= aReturn;
- }
+ aAny >>= aReturn;
}
- bSuccess = true;
}
+ bSuccess = true;
}
}
@@ -1212,17 +1209,14 @@ void ScDDELinkObj::setResults( const uno::Sequence< uno::Sequence< uno::Any > >&
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( pDoc )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ size_t nPos = 0;
+ if ( rDoc.FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) )
{
- size_t nPos = 0;
- if ( pDoc->FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) )
- {
- uno::Any aAny;
- aAny <<= aResults;
- ScMatrixRef xMatrix = ScSequenceToMatrix::CreateMixedMatrix( aAny );
- bSuccess = pDoc->SetDdeLinkResultMatrix( nPos, xMatrix );
- }
+ uno::Any aAny;
+ aAny <<= aResults;
+ ScMatrixRef xMatrix = ScSequenceToMatrix::CreateMixedMatrix( aAny );
+ bSuccess = rDoc.SetDdeLinkResultMatrix( nPos, xMatrix );
}
}
@@ -1244,13 +1238,13 @@ void ScDDELinkObj::Refreshed_Impl()
ScDDELinksObj::ScDDELinksObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScDDELinksObj::~ScDDELinksObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScDDELinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1271,7 +1265,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex)
if (pDocShell)
{
OUString aAppl, aTopic, aItem;
- if ( pDocShell->GetDocument()->GetDdeLinkData( (size_t)nIndex, aAppl, aTopic, aItem ) )
+ if ( pDocShell->GetDocument().GetDdeLinkData( (size_t)nIndex, aAppl, aTopic, aItem ) )
return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem );
}
return NULL;
@@ -1284,11 +1278,11 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName)
OUString aNamStr(aName);
OUString aAppl, aTopic, aItem;
- ScDocument* pDoc = pDocShell->GetDocument();
- size_t nCount = pDoc->GetDocLinkManager().getDdeLinkCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ size_t nCount = rDoc.GetDocLinkManager().getDdeLinkCount();
for (size_t i=0; i<nCount; i++)
{
- pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem );
+ rDoc.GetDdeLinkData( i, aAppl, aTopic, aItem );
if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr )
return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem );
}
@@ -1312,7 +1306,7 @@ sal_Int32 SAL_CALL ScDDELinksObj::getCount() throw(uno::RuntimeException, std::e
SolarMutexGuard aGuard;
sal_Int32 nAreaCount = 0;
if (pDocShell)
- nAreaCount = pDocShell->GetDocument()->GetDocLinkManager().getDdeLinkCount();
+ nAreaCount = pDocShell->GetDocument().GetDocLinkManager().getDdeLinkCount();
return nAreaCount;
}
@@ -1359,14 +1353,14 @@ uno::Sequence<OUString> SAL_CALL ScDDELinksObj::getElementNames() throw(uno::Run
{
OUString aAppl, aTopic, aItem;
- ScDocument* pDoc = pDocShell->GetDocument();
- size_t nCount = pDocShell->GetDocument()->GetDocLinkManager().getDdeLinkCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ size_t nCount = pDocShell->GetDocument().GetDocLinkManager().getDdeLinkCount();
uno::Sequence<OUString> aSeq(nCount);
OUString* pAry = aSeq.getArray();
for (size_t i=0; i<nCount; i++)
{
- pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem );
+ rDoc.GetDdeLinkData( i, aAppl, aTopic, aItem );
pAry[i] = lcl_BuildDDEName(aAppl, aTopic, aItem);
}
return aSeq;
@@ -1383,11 +1377,11 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const OUString& aName )
OUString aNamStr(aName);
OUString aAppl, aTopic, aItem;
- ScDocument* pDoc = pDocShell->GetDocument();
- size_t nCount = pDocShell->GetDocument()->GetDocLinkManager().getDdeLinkCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ size_t nCount = pDocShell->GetDocument().GetDocLinkManager().getDdeLinkCount();
for (size_t i=0; i<nCount; i++)
{
- pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem );
+ rDoc.GetDdeLinkData( i, aAppl, aTopic, aItem );
if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr )
return sal_True;
}
@@ -1407,38 +1401,35 @@ uno::Reference< sheet::XDDELink > ScDDELinksObj::addDDELink(
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( pDoc )
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sal_uInt8 nMod = SC_DDE_DEFAULT;
+ switch ( nMode )
{
- sal_uInt8 nMod = SC_DDE_DEFAULT;
- switch ( nMode )
- {
- case sheet::DDELinkMode_DEFAULT:
- {
- nMod = SC_DDE_DEFAULT;
- }
- break;
- case sheet::DDELinkMode_ENGLISH:
- {
- nMod = SC_DDE_ENGLISH;
- }
- break;
- case sheet::DDELinkMode_TEXT:
- {
- nMod = SC_DDE_TEXT;
- }
- break;
- default:
- {
- }
- break;
- }
+ case sheet::DDELinkMode_DEFAULT:
+ {
+ nMod = SC_DDE_DEFAULT;
+ }
+ break;
+ case sheet::DDELinkMode_ENGLISH:
+ {
+ nMod = SC_DDE_ENGLISH;
+ }
+ break;
+ case sheet::DDELinkMode_TEXT:
+ {
+ nMod = SC_DDE_TEXT;
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
- if ( pDoc->CreateDdeLink( aApplication, aTopic, aItem, nMod, ScMatrixRef() ) )
- {
- const OUString aName( lcl_BuildDDEName( aApplication, aTopic, aItem ) );
- xLink.set( GetObjectByName_Impl( aName ) );
- }
+ if ( rDoc.CreateDdeLink( aApplication, aTopic, aItem, nMod, ScMatrixRef() ) )
+ {
+ const OUString aName( lcl_BuildDDEName( aApplication, aTopic, aItem ) );
+ xLink.set( GetObjectByName_Impl( aName ) );
}
}
@@ -1476,7 +1467,7 @@ void SAL_CALL ScExternalSheetCacheObj::setCellValue(sal_Int32 nCol, sal_Int32 nR
pToken.reset(new FormulaDoubleToken(fVal));
else if (rValue >>= aVal)
{
- svl::SharedStringPool& rPool = mpDocShell->GetDocument()->GetSharedStringPool();
+ svl::SharedStringPool& rPool = mpDocShell->GetDocument().GetSharedStringPool();
svl::SharedString aSS = rPool.intern(aVal);
pToken.reset(new FormulaStringToken(aSS));
}
@@ -1692,7 +1683,7 @@ sal_Int32 SAL_CALL ScExternalDocLinkObj::getTokenIndex()
ScExternalDocLinksObj::ScExternalDocLinksObj(ScDocShell* pDocShell) :
mpDocShell(pDocShell),
- mpRefMgr(pDocShell->GetDocument()->GetExternalRefManager())
+ mpRefMgr(pDocShell->GetDocument().GetExternalRefManager())
{
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 6d4107401305..edceecf35013 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -88,13 +88,13 @@ ScNamedRangeObj::ScNamedRangeObj( rtl::Reference< ScNamedRangesObj > xParent, Sc
aName( rNm ),
mxSheet( xSheet )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScNamedRangeObj::~ScNamedRangeObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScNamedRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -115,9 +115,9 @@ ScRangeData* ScNamedRangeObj::GetRangeData_Impl()
ScRangeName* pNames;
SCTAB nTab = GetTab_Impl();
if (nTab >= 0)
- pNames = pDocShell->GetDocument()->GetRangeName(nTab);
+ pNames = pDocShell->GetDocument().GetRangeName(nTab);
else
- pNames = pDocShell->GetDocument()->GetRangeName();
+ pNames = pDocShell->GetDocument().GetRangeName();
if (pNames)
{
pRet = pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName));
@@ -134,10 +134,10 @@ SCTAB ScNamedRangeObj::GetTab_Impl()
{
if (!pDocShell)
return -2;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTab;
OUString sName = mxSheet->getName();
- pDoc->GetTable(sName, nTab);
+ rDoc.GetTable(sName, nTab);
return nTab;
}
else
@@ -153,13 +153,13 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray*
if (!pDocShell)
return;
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeName* pNames;
SCTAB nTab = GetTab_Impl();
if (nTab >= 0)
- pNames = pDoc->GetRangeName(nTab);
+ pNames = rDoc.GetRangeName(nTab);
else
- pNames = pDoc->GetRangeName();
+ pNames = rDoc.GetRangeName();
if (!pNames)
return;
@@ -188,9 +188,9 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray*
ScRangeData* pNew = NULL;
if (pNewTokens)
- pNew = new ScRangeData( pDoc, aInsName, *pNewTokens, aPos, nType );
+ pNew = new ScRangeData( &rDoc, aInsName, *pNewTokens, aPos, nType );
else
- pNew = new ScRangeData( pDoc, aInsName, aContent, aPos, nType, eGrammar );
+ pNew = new ScRangeData( &rDoc, aInsName, aContent, aPos, nType, eGrammar );
pNew->SetIndex( pOld->GetIndex() );
@@ -263,7 +263,7 @@ table::CellAddress SAL_CALL ScNamedRangeObj::getReferencePosition()
aAddress.Sheet = aPos.Tab();
if (pDocShell)
{
- SCTAB nDocTabs = pDocShell->GetDocument()->GetTableCount();
+ SCTAB nDocTabs = pDocShell->GetDocument().GetTableCount();
if ( aAddress.Sheet >= nDocTabs && nDocTabs > 0 )
{
// Even after ValidateTabRefs, the position can be invalid if
@@ -328,7 +328,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScNamedRangeObj::getTokens()
{
ScTokenArray* pTokenArray = pData->GetCode();
if ( pTokenArray )
- (void)ScTokenConversion::ConvertToTokenSequence( *pDocShell->GetDocument(), aSequence, *pTokenArray );
+ (void)ScTokenConversion::ConvertToTokenSequence( pDocShell->GetDocument(), aSequence, *pTokenArray );
}
return aSequence;
}
@@ -340,7 +340,7 @@ void SAL_CALL ScNamedRangeObj::setTokens( const uno::Sequence<sheet::FormulaToke
if( pDocShell )
{
ScTokenArray aTokenArray;
- (void)ScTokenConversion::ConvertToTokenArray( *pDocShell->GetDocument(), aTokenArray, rTokens );
+ (void)ScTokenConversion::ConvertToTokenArray( pDocShell->GetDocument(), aTokenArray, rTokens );
// GRAM_PODF_A1 for API compatibility.
Modify_Impl( NULL, &aTokenArray, NULL, NULL, NULL, formula::FormulaGrammar::GRAM_PODF_A1 );
}
@@ -471,13 +471,13 @@ ScNamedRangesObj::ScNamedRangesObj(ScDocShell* pDocSh) :
mbModifyAndBroadcast(true),
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScNamedRangesObj::~ScNamedRangesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScNamedRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -511,13 +511,13 @@ void SAL_CALL ScNamedRangesObj::addNewByName( const OUString& aName,
bool bDone = false;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScRangeName* pNames = GetRangeName_Impl();
if (pNames && !pNames->findByUpperName(ScGlobal::pCharClass->uppercase(aName)))
{
ScRangeName* pNewRanges = new ScRangeName( *pNames );
// GRAM_PODF_A1 for API compatibility.
- ScRangeData* pNew = new ScRangeData( pDoc, aName, aContent,
+ ScRangeData* pNew = new ScRangeData( &rDoc, aName, aContent,
aPos, nNewType,formula::FormulaGrammar::GRAM_PODF_A1 );
if ( pNewRanges->insert(pNew) )
{
@@ -739,13 +739,13 @@ sal_Bool SAL_CALL ScNamedRangesObj::hasByName( const OUString& aName )
/** called from the XActionLockable interface methods on initial locking */
void ScNamedRangesObj::lock()
{
- pDocShell->GetDocument()->PreprocessRangeNameUpdate();
+ pDocShell->GetDocument().PreprocessRangeNameUpdate();
}
/** called from the XActionLockable interface methods on final unlock */
void ScNamedRangesObj::unlock()
{
- pDocShell->GetDocument()->PostprocessRangeNameUpdate();
+ pDocShell->GetDocument().PostprocessRangeNameUpdate();
}
// document::XActionLockable
@@ -753,27 +753,27 @@ void ScNamedRangesObj::unlock()
sal_Bool ScNamedRangesObj::isActionLocked() throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return pDocShell->GetDocument()->GetNamedRangesLockCount() != 0;
+ return pDocShell->GetDocument().GetNamedRangesLockCount() != 0;
}
void ScNamedRangesObj::addActionLock() throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- ScDocument* pDoc = pDocShell->GetDocument();
- sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
++nLockCount;
if ( nLockCount == 1 )
{
lock();
}
- pDoc->SetNamedRangesLockCount( nLockCount );
+ rDoc.SetNamedRangesLockCount( nLockCount );
}
void ScNamedRangesObj::removeActionLock() throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- ScDocument* pDoc = pDocShell->GetDocument();
- sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
if ( nLockCount > 0 )
{
--nLockCount;
@@ -781,7 +781,7 @@ void ScNamedRangesObj::removeActionLock() throw(uno::RuntimeException, std::exce
{
unlock();
}
- pDoc->SetNamedRangesLockCount( nLockCount );
+ rDoc.SetNamedRangesLockCount( nLockCount );
}
}
@@ -790,8 +790,8 @@ void ScNamedRangesObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeExcep
SolarMutexGuard aGuard;
if ( nLock >= 0 )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
if ( nLock == 0 && nLockCount > 0 )
{
unlock();
@@ -800,20 +800,20 @@ void ScNamedRangesObj::setActionLocks( sal_Int16 nLock ) throw(uno::RuntimeExcep
{
lock();
}
- pDoc->SetNamedRangesLockCount( nLock );
+ rDoc.SetNamedRangesLockCount( nLock );
}
}
sal_Int16 ScNamedRangesObj::resetActionLocks() throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- ScDocument* pDoc = pDocShell->GetDocument();
- sal_Int16 nLockCount = pDoc->GetNamedRangesLockCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
if ( nLockCount > 0 )
{
unlock();
}
- pDoc->SetNamedRangesLockCount( 0 );
+ rDoc.SetNamedRangesLockCount( 0 );
return nLockCount;
}
@@ -833,7 +833,7 @@ ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByIndex_Impl(sal_uInt16 nIndex
if (!pDocShell)
return NULL;
- ScRangeName* pNames = pDocShell->GetDocument()->GetRangeName();
+ ScRangeName* pNames = pDocShell->GetDocument().GetRangeName();
if (!pNames)
return NULL;
@@ -860,7 +860,7 @@ ScNamedRangeObj* ScGlobalNamedRangesObj::GetObjectByName_Impl(const OUString& aN
ScRangeName* ScGlobalNamedRangesObj::GetRangeName_Impl()
{
- return pDocShell->GetDocument()->GetRangeName();
+ return pDocShell->GetDocument().GetRangeName();
}
SCTAB ScGlobalNamedRangesObj::GetTab_Impl()
@@ -894,11 +894,11 @@ ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByIndex_Impl( sal_uInt16 nIndex
return NULL;
OUString aName = mxSheet->getName();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTab;
- pDoc->GetTable( aName, nTab );
+ rDoc.GetTable( aName, nTab );
- ScRangeName* pNames = pDoc->GetRangeName( nTab );
+ ScRangeName* pNames = rDoc.GetRangeName( nTab );
if (!pNames)
return NULL;
@@ -919,13 +919,13 @@ ScNamedRangeObj* ScLocalNamedRangesObj::GetObjectByIndex_Impl( sal_uInt16 nIndex
ScRangeName* ScLocalNamedRangesObj::GetRangeName_Impl()
{
SCTAB nTab = GetTab_Impl();
- return pDocShell->GetDocument()->GetRangeName( nTab );
+ return pDocShell->GetDocument().GetRangeName( nTab );
}
SCTAB ScLocalNamedRangesObj::GetTab_Impl()
{
SCTAB nTab;
- pDocShell->GetDocument()->GetTable(mxSheet->getName(), nTab);
+ pDocShell->GetDocument().GetTable(mxSheet->getName(), nTab);
return nTab;
}
@@ -934,13 +934,13 @@ ScLabelRangeObj::ScLabelRangeObj(ScDocShell* pDocSh, bool bCol, const ScRange& r
bColumn( bCol ),
aRange( rR )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScLabelRangeObj::~ScLabelRangeObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScLabelRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -958,8 +958,8 @@ ScRangePair* ScLabelRangeObj::GetData_Impl()
ScRangePair* pRet = NULL;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangePairList* pList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
if (pList)
pRet = pList->Find( aRange );
}
@@ -970,8 +970,8 @@ void ScLabelRangeObj::Modify_Impl( const ScRange* pLabel, const ScRange* pData )
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangePairList* pOldList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScRangePairList* pOldList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
if (pOldList)
{
ScRangePairListRef xNewList(pOldList->Clone());
@@ -989,11 +989,11 @@ void ScLabelRangeObj::Modify_Impl( const ScRange* pLabel, const ScRange* pData )
delete pEntry;
if (bColumn)
- pDoc->GetColNameRangesRef() = xNewList;
+ rDoc.GetColNameRangesRef() = xNewList;
else
- pDoc->GetRowNameRangesRef() = xNewList;
+ rDoc.GetRowNameRangesRef() = xNewList;
- pDoc->CompileColRowNameFormula();
+ rDoc.CompileColRowNameFormula();
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID );
pDocShell->SetDocumentModified();
@@ -1052,13 +1052,13 @@ ScLabelRangesObj::ScLabelRangesObj(ScDocShell* pDocSh, bool bCol) :
pDocShell( pDocSh ),
bColumn( bCol )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScLabelRangesObj::~ScLabelRangesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScLabelRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1078,8 +1078,8 @@ ScLabelRangeObj* ScLabelRangesObj::GetObjectByIndex_Impl(size_t nIndex)
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangePairList* pList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
if ( pList && nIndex < pList->size() )
{
ScRangePair* pData = (*pList)[nIndex];
@@ -1097,8 +1097,8 @@ void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelAre
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangePairList* pOldList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScRangePairList* pOldList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
if (pOldList)
{
ScRangePairListRef xNewList(pOldList->Clone());
@@ -1110,11 +1110,11 @@ void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelAre
xNewList->Join( ScRangePair( aLabelRange, aDataRange ) );
if (bColumn)
- pDoc->GetColNameRangesRef() = xNewList;
+ rDoc.GetColNameRangesRef() = xNewList;
else
- pDoc->GetRowNameRangesRef() = xNewList;
+ rDoc.GetRowNameRangesRef() = xNewList;
- pDoc->CompileColRowNameFormula();
+ rDoc.CompileColRowNameFormula();
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID );
pDocShell->SetDocumentModified();
@@ -1130,8 +1130,8 @@ void SAL_CALL ScLabelRangesObj::removeByIndex( sal_Int32 nIndex )
bool bDone = false;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangePairList* pOldList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScRangePairList* pOldList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
if ( pOldList && nIndex >= 0 && nIndex < (sal_Int32)pOldList->size() )
{
@@ -1144,11 +1144,11 @@ void SAL_CALL ScLabelRangesObj::removeByIndex( sal_Int32 nIndex )
delete pEntry;
if (bColumn)
- pDoc->GetColNameRangesRef() = xNewList;
+ rDoc.GetColNameRangesRef() = xNewList;
else
- pDoc->GetRowNameRangesRef() = xNewList;
+ rDoc.GetRowNameRangesRef() = xNewList;
- pDoc->CompileColRowNameFormula();
+ rDoc.CompileColRowNameFormula();
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID );
pDocShell->SetDocumentModified();
bDone = true;
@@ -1177,8 +1177,8 @@ sal_Int32 SAL_CALL ScLabelRangesObj::getCount() throw(uno::RuntimeException, std
SolarMutexGuard aGuard;
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScRangePairList* pList = bColumn ? pDoc->GetColNameRanges() : pDoc->GetRowNameRanges();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
if (pList)
return pList->size();
}
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index c0bcef6d3fcc..d8dcbcec9679 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -60,7 +60,7 @@ ScAnnotationObj::ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos) :
aCellPos( rPos ),
pUnoText( NULL )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
// pUnoText is allocated on demand (GetUnoText)
// can't be aggregated because getString/setString is handled here
@@ -69,7 +69,7 @@ ScAnnotationObj::ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos) :
ScAnnotationObj::~ScAnnotationObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
if (pUnoText)
pUnoText->release();
@@ -248,6 +248,6 @@ SvxUnoText& ScAnnotationObj::GetUnoText()
const ScPostIt* ScAnnotationObj::ImplGetNote() const
{
- return pDocShell ? pDocShell->GetDocument()->GetNote(aCellPos) : 0;
+ return pDocShell ? pDocShell->GetDocument().GetNote(aCellPos) : 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index 7227f056fc95..e9bf1d5d158b 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -83,10 +83,6 @@ class ScVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container
public:
ScVbaObjectForCodeNameProvider( ScDocShell* pDocShell ) : mpDocShell( pDocShell )
{
- ScDocument* pDoc = mpDocShell->GetDocument();
- if ( !pDoc )
- throw uno::RuntimeException();
-
uno::Sequence< uno::Any > aArgs(2);
// access the application object ( parent for workbook )
aArgs[0] = uno::Any( ooo::vba::createVBAUnoAPIServiceWithArgs( mpDocShell, "ooo.vba.Application", uno::Sequence< uno::Any >() ) );
@@ -99,26 +95,24 @@ public:
SolarMutexGuard aGuard;
maCachedObject = uno::Any(); // clear cached object
- ScDocument* pDoc = mpDocShell->GetDocument();
- if ( !pDoc )
- throw uno::RuntimeException();
+ ScDocument& rDoc = mpDocShell->GetDocument();
// aName is generated from the stream name which can be different ( case-wise )
// from the code name
- if( aName.equalsIgnoreAsciiCase( pDoc->GetCodeName() ) )
+ if( aName.equalsIgnoreAsciiCase( rDoc.GetCodeName() ) )
maCachedObject = maWorkbook;
else
{
OUString sCodeName;
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = rDoc.GetTableCount();
for( SCTAB i = 0; i < nCount; i++ )
{
- pDoc->GetCodeName( i, sCodeName );
+ rDoc.GetCodeName( i, sCodeName );
// aName is generated from the stream name which can be different ( case-wise )
// from the code name
if( sCodeName.equalsIgnoreAsciiCase( aName ) )
{
OUString sSheetName;
- if( pDoc->GetName( i, sSheetName ) )
+ if( rDoc.GetName( i, sSheetName ) )
{
uno::Reference< frame::XModel > xModel( mpDocShell->GetModel() );
uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW );
@@ -151,19 +145,17 @@ public:
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
{
SolarMutexGuard aGuard;
- ScDocument* pDoc = mpDocShell->GetDocument();
- if ( !pDoc )
- throw uno::RuntimeException();
- SCTAB nCount = pDoc->GetTableCount();
+ ScDocument& rDoc = mpDocShell->GetDocument();
+ SCTAB nCount = rDoc.GetTableCount();
uno::Sequence< OUString > aNames( nCount + 1 );
SCTAB index = 0;
OUString sCodeName;
for( ; index < nCount; ++index )
{
- pDoc->GetCodeName( index, sCodeName );
+ rDoc.GetCodeName( index, sCodeName );
aNames[ index ] = sCodeName;
}
- aNames[ index ] = pDoc->GetCodeName();
+ aNames[ index ] = rDoc.GetCodeName();
return aNames;
}
// XElemenAccess
@@ -204,7 +196,7 @@ public:
if ( bMatched )
{
OUString sName;
- mrDocShell.GetDocument()->GetCodeName( static_cast<SCTAB>( index ), sName );
+ mrDocShell.GetDocument().GetCodeName( static_cast<SCTAB>( index ), sName );
sCodeName = sName;
}
}
@@ -235,7 +227,7 @@ public:
if (xFormControls == xContainer)
{
OUString aName;
- if (mrDocShell.GetDocument()->GetCodeName(static_cast<SCTAB>(i), aName))
+ if (mrDocShell.GetDocument().GetCodeName(static_cast<SCTAB>(i), aName))
return aName;
}
}
@@ -583,8 +575,8 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
break;
case SC_SERVICE_CHDATAPROV:
- if (pDocShell && pDocShell->GetDocument())
- xRet = *new ScChart2DataProvider( pDocShell->GetDocument() );
+ if (pDocShell)
+ xRet = *new ScChart2DataProvider( &pDocShell->GetDocument() );
break;
case SC_SERVICE_FORMULAPARS:
@@ -595,10 +587,10 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
case SC_SERVICE_OPCODEMAPPER:
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
ScAddress aAddress;
- ScCompiler* pComp = new ScCompiler(pDoc,aAddress);
- pComp->SetGrammar( pDoc->GetGrammar() );
+ ScCompiler* pComp = new ScCompiler(&rDoc,aAddress);
+ pComp->SetGrammar( rDoc.GetGrammar() );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
xRet.set(static_cast<sheet::XFormulaOpCodeMapper*>(new ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::FormulaCompiler> (pComp))));
SAL_WNODEPRECATED_DECLARATIONS_POP
@@ -606,7 +598,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
}
#ifndef DISABLE_SCRIPTING
case SC_SERVICE_VBAOBJECTPROVIDER:
- if (pDocShell && pDocShell->GetDocument()->IsInVBAMode())
+ if (pDocShell && pDocShell->GetDocument().IsInVBAMode())
{
OSL_TRACE("**** creating VBA Object mapper");
xRet.set(static_cast<container::XNameAccess*>(new ScVbaObjectForCodeNameProvider( pDocShell )));
@@ -636,7 +628,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
// create the VBA document event processor
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents(
::ooo::vba::createVBAUnoAPIServiceWithArgs( pDocShell, "com.sun.star.script.vba.VBASpreadsheetEventProcessor", aArgs ), uno::UNO_QUERY );
- pDocShell->GetDocument()->SetVbaEventProcessor( xVbaEvents );
+ pDocShell->GetDocument().SetVbaEventProcessor( xVbaEvents );
}
}
break;
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 8d0050fd8146..357d06dbf51e 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -399,13 +399,13 @@ static bool lcl_AnyTabProtected( ScDocument& rDoc )
ScStyleFamiliesObj::ScStyleFamiliesObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScStyleFamiliesObj::~ScStyleFamiliesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScStyleFamiliesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -588,13 +588,13 @@ ScStyleFamilyObj::ScStyleFamilyObj(ScDocShell* pDocSh, SfxStyleFamily eFam) :
pDocShell( pDocSh ),
eFamily( eFam )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScStyleFamilyObj::~ScStyleFamilyObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScStyleFamilyObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -614,8 +614,8 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByIndex_Impl(sal_uInt32 nIndex)
{
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
SfxStyleSheetIterator aIter( pStylePool, eFamily );
if ( nIndex < aIter.Count() )
@@ -636,8 +636,8 @@ ScStyleObj* ScStyleFamilyObj::GetObjectByName_Impl(const OUString& aName)
{
OUString aString(aName);
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
if ( pStylePool->Find( aString, eFamily ) )
return new ScStyleObj( pDocShell, eFamily, aString );
}
@@ -660,8 +660,8 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::
{
OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
//! DocFunc-Funktion??
//! Undo ?????????????
@@ -670,8 +670,8 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::
{
(void)pStylePool->Make( aNameStr, eFamily, SFXSTYLEBIT_USERDEF );
- if ( eFamily == SFX_STYLE_FAMILY_PARA && !pDoc->IsImportingXML() )
- pDoc->GetPool()->CellStyleCreated( aNameStr );
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() )
+ rDoc.GetPool()->CellStyleCreated( aNameStr );
pStyleObj->InitDoc( pDocShell, aNameStr ); // Objekt kann benutzt werden
@@ -712,8 +712,8 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
{
OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
//! DocFunc-Funktion??
//! Undo ?????????????
@@ -730,7 +730,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -740,7 +740,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
}
else
{
- if ( pDoc->RemovePageStyleInUse( aString ) )
+ if ( rDoc.RemovePageStyleInUse( aString ) )
pDocShell->PageStyleModified( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), true );
pStylePool->Remove( pStyle );
@@ -764,8 +764,8 @@ sal_Int32 SAL_CALL ScStyleFamilyObj::getCount() throw(uno::RuntimeException, std
SolarMutexGuard aGuard;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
SfxStyleSheetIterator aIter( pStylePool, eFamily );
return aIter.Count();
@@ -820,8 +820,8 @@ uno::Sequence<OUString> SAL_CALL ScStyleFamilyObj::getElementNames()
SolarMutexGuard aGuard;
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
SfxStyleSheetIterator aIter( pStylePool, eFamily );
sal_uInt16 nCount = aIter.Count();
@@ -851,8 +851,8 @@ sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const OUString& aName )
{
OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ));
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
if ( pStylePool->Find( aString, eFamily ) )
return sal_True;
}
@@ -934,7 +934,7 @@ ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString&
// pDocShell ist Null, wenn per ServiceProvider erzeugt
if (pDocShell)
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
void ScStyleObj::InitDoc( ScDocShell* pNewDocSh, const OUString& rNewName )
@@ -943,14 +943,14 @@ void ScStyleObj::InitDoc( ScDocShell* pNewDocSh, const OUString& rNewName )
{
aStyleName = rNewName;
pDocShell = pNewDocSh;
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
}
ScStyleObj::~ScStyleObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
// XUnoTunnel
@@ -1002,8 +1002,8 @@ SfxStyleSheetBase* ScStyleObj::GetStyle_Impl()
{
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
return pStylePool->Find( aStyleName, eFamily );
}
return NULL;
@@ -1048,7 +1048,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
if (pStyle)
{
// cell styles cannot be modified if any sheet is protected
- if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
return; //! exception?
//! DocFunc-Funktion??
@@ -1060,7 +1060,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
{
// wie bei setPropertyValue
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if ( eFamily == SFX_STYLE_FAMILY_PARA )
{
// Zeilenhoehen anpassen...
@@ -1070,7 +1070,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1104,7 +1104,7 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
if (pStyle)
{
// cell styles cannot be renamed if any sheet is protected
- if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
return; //! exception?
//! DocFunc-Funktion??
@@ -1116,9 +1116,9 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
{
aStyleName = aString; //! notify other objects for this style?
- ScDocument* pDoc = pDocShell->GetDocument();
- if ( eFamily == SFX_STYLE_FAMILY_PARA && !pDoc->IsImportingXML() )
- pDoc->GetPool()->CellStyleCreated( aString );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() )
+ rDoc.GetPool()->CellStyleCreated( aString );
// Zellvorlagen = 2, Seitenvorlagen = 4
sal_uInt16 nId = ( eFamily == SFX_STYLE_FAMILY_PARA ) ?
@@ -1416,7 +1416,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
if ( pStyle )
{
// cell styles cannot be modified if any sheet is protected
- if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
throw uno::RuntimeException();
SfxItemSet& rSet = pStyle->GetItemSet();
@@ -1424,7 +1424,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
//! merge with SetOneProperty
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if ( eFamily == SFX_STYLE_FAMILY_PARA )
{
// row heights
@@ -1434,7 +1434,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1527,7 +1527,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
if ( pStyle && pEntry )
{
// cell styles cannot be modified if any sheet is protected
- if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( *pDocShell->GetDocument() ) )
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
throw uno::RuntimeException();
SfxItemSet& rSet = pStyle->GetItemSet(); // direkt im lebenden Style aendern...
@@ -1577,7 +1577,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
{
// language for number formats
SvNumberFormatter* pFormatter =
- pDocShell->GetDocument()->GetFormatTable();
+ pDocShell->GetDocument().GetFormatTable();
sal_uInt32 nOldFormat = ((const SfxUInt32Item&)
rSet.Get( ATTR_VALUE_FORMAT )).GetValue();
LanguageType eOldLang = ((const SvxLanguageItem&)
@@ -1803,7 +1803,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
//! DocFunc-Funktion??
//! Undo ?????????????
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
if ( eFamily == SFX_STYLE_FAMILY_PARA )
{
// Zeilenhoehen anpassen...
@@ -1813,7 +1813,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1861,7 +1861,7 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName )
pItemSet->Get( ATTR_VALUE_FORMAT )).GetValue();
LanguageType eOldLang = ((const SvxLanguageItem&)
pItemSet->Get( ATTR_LANGUAGE_FORMAT )).GetLanguage();
- nOldFormat = pDocShell->GetDocument()->GetFormatTable()->
+ nOldFormat = pDocShell->GetDocument().GetFormatTable()->
GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
aAny <<= nOldFormat;
}
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index df1b80de2ee5..84beb009ede8 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -67,7 +67,7 @@ SC_SIMPLE_SERVICE_INFO( ScLinkTargetsObj, "ScLinkTargetsObj", "com.sun.s
ScLinkTargetTypesObj::ScLinkTargetTypesObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++)
aNames[i] = ScResId( nTypeResIds[i] );
@@ -76,7 +76,7 @@ ScLinkTargetTypesObj::ScLinkTargetTypesObj(ScDocShell* pDocSh) :
ScLinkTargetTypesObj::~ScLinkTargetTypesObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScLinkTargetTypesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -135,14 +135,14 @@ ScLinkTargetTypeObj::ScLinkTargetTypeObj(ScDocShell* pDocSh, sal_uInt16 nT) :
pDocShell( pDocSh ),
nType( nT )
{
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
aName = ScResId( nTypeResIds[nType] ); //! on demand?
}
ScLinkTargetTypeObj::~ScLinkTargetTypeObj()
{
if (pDocShell)
- pDocShell->GetDocument()->RemoveUnoObject(*this);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScLinkTargetTypeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 5b5dd354961d..48238e41bd5d 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -901,7 +901,7 @@ ScCellTextData::ScCellTextData(ScDocShell* pDocSh, const ScAddress& rP) :
bDoUpdate( true )
{
if (pDocShell)
- pDocShell->GetDocument()->AddUnoObject(*this);
+ pDocShell->GetDocument().AddUnoObject(*this);
}
ScCellTextData::~ScCellTextData()
@@ -910,8 +910,8 @@ ScCellTextData::~ScCellTextData()
if (pDocShell)
{
- pDocShell->GetDocument()->RemoveUnoObject(*this);
- pDocShell->GetDocument()->DisposeFieldEditEngine(pEditEngine);
+ pDocShell->GetDocument().RemoveUnoObject(*this);
+ pDocShell->GetDocument().DisposeFieldEditEngine(pEditEngine);
}
else
delete pEditEngine;
@@ -932,8 +932,8 @@ void ScCellTextData::GetCellText(const ScAddress& rCellPos, OUString& rText)
{
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pDoc->GetInputString( rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), rText );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ rDoc.GetInputString( rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), rText );
}
}
@@ -943,8 +943,8 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
{
if ( pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- pEditEngine = pDoc->CreateFieldEditEngine();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ pEditEngine = rDoc.CreateFieldEditEngine();
}
else
{
@@ -970,19 +970,19 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
if (pDocShell)
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SfxItemSet aDefaults( pEditEngine->GetEmptyItemSet() );
if( const ScPatternAttr* pPattern =
- pDoc->GetPattern( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
+ rDoc.GetPattern( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
{
pPattern->FillEditItemSet( &aDefaults );
pPattern->FillEditParaItems( &aDefaults ); // including alignment etc. (for reading)
}
- if (pDoc->GetCellType(aCellPos) == CELLTYPE_EDIT)
+ if (rDoc.GetCellType(aCellPos) == CELLTYPE_EDIT)
{
- const EditTextObject* pObj = pDoc->GetEditText(aCellPos);
+ const EditTextObject* pObj = rDoc.GetEditText(aCellPos);
if (pObj)
pEditEngine->SetTextNewDefaults(*pObj, aDefaults);
}
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 2b7b884e0e11..738d33d8a5be 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -68,13 +68,13 @@ ScFormulaParserObj::ScFormulaParserObj(ScDocShell* pDocSh) :
mbIgnoreSpaces( true ),
mbCompileFAP( false )
{
- mpDocShell->GetDocument()->AddUnoObject(*this);
+ mpDocShell->GetDocument().AddUnoObject(*this);
}
ScFormulaParserObj::~ScFormulaParserObj()
{
if (mpDocShell)
- mpDocShell->GetDocument()->RemoveUnoObject(*this);
+ mpDocShell->GetDocument().RemoveUnoObject(*this);
}
void ScFormulaParserObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -129,17 +129,17 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScFormulaParserObj::parseFormula(
if (mpDocShell)
{
- ScDocument* pDoc = mpDocShell->GetDocument();
- ScExternalRefManager::ApiGuard aExtRefGuard(pDoc);
+ ScDocument& rDoc = mpDocShell->GetDocument();
+ ScExternalRefManager::ApiGuard aExtRefGuard(&rDoc);
ScAddress aRefPos( ScAddress::UNINITIALIZED );
ScUnoConversion::FillScAddress( aRefPos, rReferencePos );
- ScCompiler aCompiler( pDoc, aRefPos);
- aCompiler.SetGrammar(pDoc->GetGrammar());
+ ScCompiler aCompiler( &rDoc, aRefPos);
+ aCompiler.SetGrammar(rDoc.GetGrammar());
SetCompilerFlags( aCompiler );
ScTokenArray* pCode = aCompiler.CompileString( aFormula );
- (void)ScTokenConversion::ConvertToTokenSequence( *pDoc, aRet, *pCode );
+ (void)ScTokenConversion::ConvertToTokenSequence( rDoc, aRet, *pCode );
delete pCode;
}
@@ -155,13 +155,13 @@ OUString SAL_CALL ScFormulaParserObj::printFormula(
if (mpDocShell)
{
- ScDocument* pDoc = mpDocShell->GetDocument();
+ ScDocument& rDoc = mpDocShell->GetDocument();
ScTokenArray aCode;
- (void)ScTokenConversion::ConvertToTokenArray( *pDoc, aCode, aTokens );
+ (void)ScTokenConversion::ConvertToTokenArray( rDoc, aCode, aTokens );
ScAddress aRefPos( ScAddress::UNINITIALIZED );
ScUnoConversion::FillScAddress( aRefPos, rReferencePos );
- ScCompiler aCompiler( pDoc, aRefPos, aCode);
- aCompiler.SetGrammar(pDoc->GetGrammar());
+ ScCompiler aCompiler( &rDoc, aRefPos, aCode);
+ aCompiler.SetGrammar(rDoc.GetGrammar());
SetCompilerFlags( aCompiler );
OUStringBuffer aBuffer;
@@ -204,9 +204,9 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue(
// CompileEnglish _before_ OpCodeMap!
if (mxOpCodeMap.get() && mbEnglish != bOldEnglish)
{
- ScDocument* pDoc = mpDocShell->GetDocument();
- ScCompiler aCompiler( pDoc, ScAddress());
- aCompiler.SetGrammar(pDoc->GetGrammar());
+ ScDocument& rDoc = mpDocShell->GetDocument();
+ ScCompiler aCompiler( &rDoc, ScAddress());
+ aCompiler.SetGrammar(rDoc.GetGrammar());
mxOpCodeMap = aCompiler.CreateOpCodeMap( maOpCodeMapping, mbEnglish);
}
}
@@ -225,9 +225,9 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue(
{
if (aValue >>= maOpCodeMapping)
{
- ScDocument* pDoc = mpDocShell->GetDocument();
- ScCompiler aCompiler( pDoc, ScAddress());
- aCompiler.SetGrammar(pDoc->GetGrammar());
+ ScDocument& rDoc = mpDocShell->GetDocument();
+ ScCompiler aCompiler( &rDoc, ScAddress());
+ aCompiler.SetGrammar(rDoc.GetGrammar());
mxOpCodeMap = aCompiler.CreateOpCodeMap( maOpCodeMapping, mbEnglish);
}
else
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 4c40d4a39284..65dcffabfedc 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -183,13 +183,13 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleColumn() throw(uno::RuntimeExc
SolarMutexGuard aGuard;
if (pViewShell)
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewData->GetActivePart() :
+ rViewData.GetActivePart() :
(ScSplitPos) nPane;
ScHSplitPos eWhichH = WhichH( eWhich );
- return pViewData->GetPosX( eWhichH );
+ return rViewData.GetPosX( eWhichH );
}
OSL_FAIL("keine View ?!?"); //! Exception?
return 0;
@@ -201,13 +201,13 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleColumn(sal_Int32 nFirstVisibleColum
SolarMutexGuard aGuard;
if (pViewShell)
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewData->GetActivePart() :
+ rViewData.GetActivePart() :
(ScSplitPos) nPane;
ScHSplitPos eWhichH = WhichH( eWhich );
- long nDeltaX = ((long)nFirstVisibleColumn) - pViewData->GetPosX( eWhichH );
+ long nDeltaX = ((long)nFirstVisibleColumn) - rViewData.GetPosX( eWhichH );
pViewShell->ScrollX( nDeltaX, eWhichH );
}
}
@@ -217,13 +217,13 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleRow() throw(uno::RuntimeExcept
SolarMutexGuard aGuard;
if (pViewShell)
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewData->GetActivePart() :
+ rViewData.GetActivePart() :
(ScSplitPos) nPane;
ScVSplitPos eWhichV = WhichV( eWhich );
- return pViewData->GetPosY( eWhichV );
+ return rViewData.GetPosY( eWhichV );
}
OSL_FAIL("keine View ?!?"); //! Exception?
return 0;
@@ -235,13 +235,13 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleRow( sal_Int32 nFirstVisibleRow )
SolarMutexGuard aGuard;
if (pViewShell)
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewData->GetActivePart() :
+ rViewData.GetActivePart() :
(ScSplitPos) nPane;
ScVSplitPos eWhichV = WhichV( eWhich );
- long nDeltaY = ((long)nFirstVisibleRow) - pViewData->GetPosY( eWhichV );
+ long nDeltaY = ((long)nFirstVisibleRow) - rViewData.GetPosY( eWhichV );
pViewShell->ScrollY( nDeltaY, eWhichV );
}
}
@@ -253,9 +253,9 @@ table::CellRangeAddress SAL_CALL ScViewPaneBase::getVisibleRange()
table::CellRangeAddress aAdr;
if (pViewShell)
{
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewData->GetActivePart() :
+ rViewData.GetActivePart() :
(ScSplitPos) nPane;
ScHSplitPos eWhichH = WhichH( eWhich );
ScVSplitPos eWhichV = WhichV( eWhich );
@@ -264,13 +264,13 @@ table::CellRangeAddress SAL_CALL ScViewPaneBase::getVisibleRange()
// VisibleRange in Excel auch teilweise sichtbare.
//! anpassen ???
- SCCOL nVisX = pViewData->VisibleCellsX( eWhichH );
- SCROW nVisY = pViewData->VisibleCellsY( eWhichV );
+ SCCOL nVisX = rViewData.VisibleCellsX( eWhichH );
+ SCROW nVisY = rViewData.VisibleCellsY( eWhichV );
if (!nVisX) nVisX = 1; // irgendwas muss ja im Range sein
if (!nVisY) nVisY = 1;
- aAdr.Sheet = pViewData->GetTabNo();
- aAdr.StartColumn = pViewData->GetPosX( eWhichH );
- aAdr.StartRow = pViewData->GetPosY( eWhichV );
+ aAdr.Sheet = rViewData.GetTabNo();
+ aAdr.StartColumn = rViewData.GetPosX( eWhichH );
+ aAdr.StartRow = rViewData.GetPosY( eWhichV );
aAdr.EndColumn = aAdr.StartColumn + nVisX - 1;
aAdr.EndRow = aAdr.StartRow + nVisY - 1;
}
@@ -285,7 +285,7 @@ uno::Reference<table::XCellRange> SAL_CALL ScViewPaneBase::getReferredCells()
SolarMutexGuard aGuard;
if (pViewShell)
{
- ScDocShell* pDocSh = pViewShell->GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = pViewShell->GetViewData().GetDocShell();
table::CellRangeAddress aAdr(getVisibleRange()); //! Hilfsfunktion mit ScRange?
ScRange aRange( (SCCOL)aAdr.StartColumn, (SCROW)aAdr.StartRow, aAdr.Sheet,
@@ -306,9 +306,9 @@ namespace
if ( !_pViewShell )
return false;
- ScViewData* pViewData = _pViewShell->GetViewData();
+ ScViewData& rViewData = _pViewShell->GetViewData();
ScSplitPos eWhich = ( _nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewData->GetActivePart() :
+ rViewData.GetActivePart() :
(ScSplitPos) _nPane;
_rpWindow = _pViewShell->GetWindowByPos( eWhich );
_rpSdrView = _pViewShell->GetSdrView();
@@ -385,19 +385,19 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const
if (pViewShell)
{
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
- pViewShell->GetViewData()->GetActivePart() :
+ pViewShell->GetViewData().GetActivePart() :
(ScSplitPos) nPane;
ScGridWindow* pWindow = (ScGridWindow*)pViewShell->GetWindowByPos(eWhich);
- ScDocument* pDoc = pViewShell->GetViewData()->GetDocument();
+ ScDocument* pDoc = pViewShell->GetViewData().GetDocument();
if (pWindow && pDoc)
{
ScHSplitPos eWhichH = ((eWhich == SC_SPLIT_TOPLEFT) || (eWhich == SC_SPLIT_BOTTOMLEFT)) ?
SC_SPLIT_LEFT : SC_SPLIT_RIGHT;
ScVSplitPos eWhichV = ((eWhich == SC_SPLIT_TOPLEFT) || (eWhich == SC_SPLIT_TOPRIGHT)) ?
SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
- ScAddress aCell(pViewShell->GetViewData()->GetPosX(eWhichH),
- pViewShell->GetViewData()->GetPosY(eWhichV),
- pViewShell->GetViewData()->GetTabNo());
+ ScAddress aCell(pViewShell->GetViewData().GetPosX(eWhichH),
+ pViewShell->GetViewData().GetPosY(eWhichV),
+ pViewShell->GetViewData().GetTabNo());
Rectangle aCellRect( pDoc->GetMMRect( aCell.Col(), aCell.Row(), aCell.Col(), aCell.Row(), aCell.Tab() ) );
Size aVisSize( pWindow->PixelToLogic( pWindow->GetSizePixel(), pWindow->GetDrawMapMode( true ) ) );
Point aVisPos( aCellRect.TopLeft() );
@@ -458,7 +458,7 @@ ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) :
mbPendingSelectionChanged(false)
{
if (pViewSh)
- nPreviousTab = pViewSh->GetViewData()->GetTabNo();
+ nPreviousTab = pViewSh->GetViewData().GetTabNo();
}
ScTabViewObj::~ScTabViewObj()
@@ -512,13 +512,13 @@ void SAL_CALL ScTabViewObj::release() throw()
static void lcl_CallActivate( ScDocShell* pDocSh, SCTAB nTab, sal_Int32 nEvent )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
// when deleting a sheet, nPreviousTab can be invalid
// (could be handled with reference updates)
- if (!pDoc->HasTable(nTab))
+ if (!rDoc.HasTable(nTab))
return;
- const ScSheetEvents* pEvents = pDoc->GetSheetEvents(nTab);
+ const ScSheetEvents* pEvents = rDoc.GetSheetEvents(nTab);
if (pEvents)
{
const OUString* pScript = pEvents->GetScript(nEvent);
@@ -535,7 +535,7 @@ static void lcl_CallActivate( ScDocShell* pDocSh, SCTAB nTab, sal_Int32 nEvent )
// execute VBA event handlers
try
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( rDoc.GetVbaEventProcessor(), uno::UNO_SET_THROW );
// the parameter is the clicked object, as in the mousePressed call above
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= nTab;
@@ -551,15 +551,15 @@ void ScTabViewObj::SheetChanged( bool bSameTabButMoved )
if ( !GetViewShell() )
return;
- ScViewData* pViewData = GetViewShell()->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = GetViewShell()->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
if (!aActivationListeners.empty())
{
sheet::ActivationEvent aEvent;
uno::Reference< sheet::XSpreadsheetView > xView(this);
uno::Reference< uno::XInterface > xSource(xView, uno::UNO_QUERY);
aEvent.Source = xSource;
- aEvent.ActiveSheet = new ScTableSheetObj(pDocSh, pViewData->GetTabNo());
+ aEvent.ActiveSheet = new ScTableSheetObj(pDocSh, rViewData.GetTabNo());
for (XActivationEventListenerVector::iterator it = aActivationListeners.begin(); it != aActivationListeners.end(); )
{
try
@@ -576,7 +576,7 @@ void ScTabViewObj::SheetChanged( bool bSameTabButMoved )
/* Handle sheet events, but do not trigger event handlers, if the old
active sheet gets re-activated after inserting/deleting/moving a sheet. */
- SCTAB nNewTab = pViewData->GetTabNo();
+ SCTAB nNewTab = rViewData.GetTabNo();
if ( !bSameTabButMoved && (nNewTab != nPreviousTab) )
{
lcl_CallActivate( pDocSh, nPreviousTab, SC_SHEETEVENT_UNFOCUS );
@@ -721,8 +721,8 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
if (pRangesImp) // Zell-Ranges
{
- ScViewData* pViewData = pViewSh->GetViewData();
- if ( pViewData->GetDocShell() == pRangesImp->GetDocShell() )
+ ScViewData& rViewData = pViewSh->GetViewData();
+ if ( rViewData.GetDocShell() == pRangesImp->GetDocShell() )
{
// Zuerst evtl. Drawing-Selektion aufheben
// (MarkListHasChanged hebt Tabellen-Selektion auf)
@@ -758,13 +758,13 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
// Mehrfachselektion
const ScRange* pFirst = rRanges[ 0 ];
- if ( pFirst && !lcl_TabInRanges( pViewData->GetTabNo(), rRanges ) )
+ if ( pFirst && !lcl_TabInRanges( rViewData.GetTabNo(), rRanges ) )
pViewSh->SetTabNo( pFirst->aStart.Tab() );
pViewSh->DoneBlockMode();
pViewSh->InitOwnBlockMode();
- pViewData->GetMarkData().MarkFromRangeList( rRanges, true );
+ rViewData.GetMarkData().MarkFromRangeList( rRanges, true );
pViewSh->MarkDataChanged();
- pViewData->GetDocShell()->PostPaintGridAll(); // Markierung (alt&neu)
+ rViewData.GetDocShell()->PostPaintGridAll(); // Markierung (alt&neu)
if ( pFirst )
{
pViewSh->AlignToCursor( pFirst->aStart.Col(), pFirst->aStart.Row(),
@@ -902,14 +902,14 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
// sonst Tabellen-(Zellen-)Selektion
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
- const ScMarkData& rMark = pViewData->GetMarkData();
+ const ScMarkData& rMark = rViewData.GetMarkData();
SCTAB nTabs = rMark.GetSelectCount();
ScRange aRange;
- ScMarkType eMarkType = pViewData->GetSimpleArea(aRange);
+ ScMarkType eMarkType = rViewData.GetSimpleArea(aRange);
if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) )
{
if (aRange.aStart == aRange.aEnd)
@@ -920,7 +920,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
else if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE_FILTERED) )
{
ScMarkData aFilteredMark( rMark );
- ScViewUtil::UnmarkFiltered( aFilteredMark, pDocSh->GetDocument());
+ ScViewUtil::UnmarkFiltered( aFilteredMark, &pDocSh->GetDocument());
ScRangeList aRangeList;
aFilteredMark.FillRangeListWithMarks( &aRangeList, false);
// Theoretically a selection may start and end on a filtered row.
@@ -947,7 +947,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
else // Mehrfachselektion
{
ScRangeListRef xRanges;
- pViewData->GetMultiArea( xRanges );
+ rViewData.GetMultiArea( xRanges );
// bei mehreren Tabellen Ranges kopieren
//! sollte eigentlich schon in ScMarkData::FillRangeListWithMarks passieren?
@@ -988,10 +988,10 @@ sal_Int32 SAL_CALL ScTabViewObj::getCount() throw(uno::RuntimeException, std::ex
if (pViewSh)
{
nPanes = 1;
- ScViewData* pViewData = pViewSh->GetViewData();
- if ( pViewData->GetHSplitMode() != SC_SPLIT_NONE )
+ ScViewData& rViewData = pViewSh->GetViewData();
+ if ( rViewData.GetHSplitMode() != SC_SPLIT_NONE )
nPanes *= 2;
- if ( pViewData->GetVSplitMode() != SC_SPLIT_NONE )
+ if ( rViewData.GetVSplitMode() != SC_SPLIT_NONE )
nPanes *= 2;
}
return nPanes;
@@ -1034,9 +1034,9 @@ ScViewPaneObj* ScTabViewObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) const
{
ScSplitPos eWhich = SC_SPLIT_BOTTOMLEFT; // default Position
bool bError = false;
- ScViewData* pViewData = pViewSh->GetViewData();
- bool bHor = ( pViewData->GetHSplitMode() != SC_SPLIT_NONE );
- bool bVer = ( pViewData->GetVSplitMode() != SC_SPLIT_NONE );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ bool bHor = ( rViewData.GetHSplitMode() != SC_SPLIT_NONE );
+ bool bVer = ( rViewData.GetVSplitMode() != SC_SPLIT_NONE );
if ( bHor && bVer )
{
// links oben, links unten, rechts oben, rechts unten - wie in Excel
@@ -1078,9 +1078,9 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet()
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pData = pViewSh->GetViewData();
- SCTAB nTab = pData->GetTabNo();
- return new ScTableSheetObj( pData->GetDocShell(), nTab );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ SCTAB nTab = rViewData.GetTabNo();
+ return new ScTableSheetObj( rViewData.GetDocShell(), nTab );
}
return NULL;
}
@@ -1097,13 +1097,13 @@ void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreads
// XSpreadsheet und ScCellRangesBase -> muss ein Sheet sein
ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( xActiveSheet );
- if ( pRangesImp && pViewSh->GetViewData()->GetDocShell() == pRangesImp->GetDocShell() )
+ if ( pRangesImp && pViewSh->GetViewData().GetDocShell() == pRangesImp->GetDocShell() )
{
const ScRangeList& rRanges = pRangesImp->GetRangeList();
if ( rRanges.size() == 1 )
{
SCTAB nNewTab = rRanges[ 0 ]->aStart.Tab();
- if ( pViewSh->GetViewData()->GetDocument()->HasTable(nNewTab) )
+ if ( pViewSh->GetViewData().GetDocument()->HasTable(nNewTab) )
pViewSh->SetTabNo( nNewTab );
}
}
@@ -1117,17 +1117,17 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
{
SCsCOL nX;
SCsROW nY;
- ScViewData* pData = GetViewShell()->GetViewData();
- ScSplitPos eSplitMode = pData->GetActivePart();
- SCTAB nTab(pData->GetTabNo());
- pData->GetPosFromPixel( rPoint.X(), rPoint.Y(), eSplitMode, nX, nY);
+ ScViewData& rData = GetViewShell()->GetViewData();
+ ScSplitPos eSplitMode = rData.GetActivePart();
+ SCTAB nTab(rData.GetTabNo());
+ rData.GetPosFromPixel( rPoint.X(), rPoint.Y(), eSplitMode, nX, nY);
ScAddress aCellPos (nX, nY, nTab);
- ScCellObj* pCellObj = new ScCellObj(pData->GetDocShell(), aCellPos);
+ ScCellObj* pCellObj = new ScCellObj(rData.GetDocShell(), aCellPos);
xTarget.set(uno::Reference<table::XCell>(pCellObj), uno::UNO_QUERY);
- ScDocument* pDoc = pData->GetDocument();
+ ScDocument* pDoc = rData.GetDocument();
if (pDoc && pDoc->GetDrawLayer())
{
SdrPage* pDrawPage = NULL;
@@ -1139,7 +1139,7 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
if (pDrawPage && pDrawView && pDrawView->GetSdrPageView())
{
- Window* pActiveWin = pData->GetActiveWin();
+ Window* pActiveWin = rData.GetActiveWin();
Point aPos = pActiveWin->PixelToLogic(rPoint);
sal_uInt16 nHitLog = (sal_uInt16) pActiveWin->PixelToLogic(
@@ -1170,9 +1170,9 @@ bool ScTabViewObj::IsMouseListening() const
return true;
// also include sheet events, because MousePressed must be called for them
- ScViewData* pViewData = GetViewShell()->GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- SCTAB nTab = pViewData->GetTabNo();
+ ScViewData& rViewData = GetViewShell()->GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ SCTAB nTab = rViewData.GetTabNo();
return
pDoc->HasSheetEventScript( nTab, SC_SHEETEVENT_RIGHTCLICK, true ) ||
pDoc->HasSheetEventScript( nTab, SC_SHEETEVENT_DOUBLECLICK, true ) ||
@@ -1223,11 +1223,11 @@ bool ScTabViewObj::MousePressed( const awt::MouseEvent& e )
sal_Int32 nEvent = bDoubleClick ? SC_SHEETEVENT_DOUBLECLICK : SC_SHEETEVENT_RIGHTCLICK;
ScTabViewShell* pViewSh = GetViewShell();
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = pViewData->GetTabNo();
- const ScSheetEvents* pEvents = pDoc->GetSheetEvents(nTab);
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = rViewData.GetTabNo();
+ const ScSheetEvents* pEvents = rDoc.GetSheetEvents(nTab);
if (pEvents)
{
const OUString* pScript = pEvents->GetScript(nEvent);
@@ -1256,7 +1256,7 @@ bool ScTabViewObj::MousePressed( const awt::MouseEvent& e )
// execute VBA event handler
if (!bReturn && xTarget.is()) try
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( rDoc.GetVbaEventProcessor(), uno::UNO_SET_THROW );
// the parameter is the clicked object, as in the mousePressed call above
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= xTarget;
@@ -1283,10 +1283,10 @@ bool ScTabViewObj::MouseReleased( const awt::MouseEvent& e )
{
mbPendingSelectionChanged = false;
ScTabViewShell* pViewSh = GetViewShell();
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( rDoc.GetVbaEventProcessor(), uno::UNO_SET_THROW );
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= getSelection();
xVbaEvents->processVbaEvent( ScSheetEvents::GetVbaSheetEventId( SC_SHEETEVENT_SELECT ), aArgs );
@@ -1450,7 +1450,7 @@ sal_Int16 ScTabViewObj::GetZoom(void) const
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- const Fraction& rZoomY = pViewSh->GetViewData()->GetZoomY(); // Y wird angezeigt
+ const Fraction& rZoomY = pViewSh->GetViewData().GetZoomY(); // Y wird angezeigt
return (sal_Int16)(( rZoomY.GetNumerator() * 100 ) / rZoomY.GetDenominator());
}
return 0;
@@ -1463,12 +1463,12 @@ void ScTabViewObj::SetZoom(sal_Int16 nZoom)
{
if ( nZoom != GetZoom() && nZoom != 0 )
{
- if (!pViewSh->GetViewData()->IsPagebreakMode())
+ if (!pViewSh->GetViewData().IsPagebreakMode())
{
ScModule* pScMod = SC_MOD();
ScAppOptions aNewOpt(pScMod->GetAppOptions());
aNewOpt.SetZoom( nZoom );
- aNewOpt.SetZoomType( pViewSh->GetViewData()->GetView()->GetZoomType() );
+ aNewOpt.SetZoomType( pViewSh->GetViewData().GetView()->GetZoomType() );
pScMod->SetAppOptions( aNewOpt );
}
}
@@ -1488,7 +1488,7 @@ sal_Int16 ScTabViewObj::GetZoomType(void) const
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- SvxZoomType eZoomType = pViewSh->GetViewData()->GetView()->GetZoomType();
+ SvxZoomType eZoomType = pViewSh->GetViewData().GetView()->GetZoomType();
switch (eZoomType)
{
case SVX_ZOOM_PERCENT:
@@ -1516,7 +1516,7 @@ void ScTabViewObj::SetZoomType(sal_Int16 aZoomType)
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScDBFunc* pView = pViewSh->GetViewData()->GetView();
+ ScDBFunc* pView = pViewSh->GetViewData().GetView();
if (pView)
{
SvxZoomType eZoomType;
@@ -1573,9 +1573,9 @@ sal_Bool SAL_CALL ScTabViewObj::getIsWindowSplit() throw(uno::RuntimeException,
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- return ( pViewData->GetHSplitMode() == SC_SPLIT_NORMAL ||
- pViewData->GetVSplitMode() == SC_SPLIT_NORMAL );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ return ( rViewData.GetHSplitMode() == SC_SPLIT_NORMAL ||
+ rViewData.GetVSplitMode() == SC_SPLIT_NORMAL );
}
return false;
@@ -1589,9 +1589,9 @@ sal_Bool SAL_CALL ScTabViewObj::hasFrozenPanes() throw(uno::RuntimeException, st
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- return ( pViewData->GetHSplitMode() == SC_SPLIT_FIX ||
- pViewData->GetVSplitMode() == SC_SPLIT_FIX );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ return ( rViewData.GetHSplitMode() == SC_SPLIT_FIX ||
+ rViewData.GetVSplitMode() == SC_SPLIT_FIX );
}
return false;
@@ -1603,9 +1603,9 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitHorizontal() throw(uno::RuntimeExceptio
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- if ( pViewData->GetHSplitMode() != SC_SPLIT_NONE )
- return pViewData->GetHSplitPos();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ if ( rViewData.GetHSplitMode() != SC_SPLIT_NONE )
+ return rViewData.GetHSplitPos();
}
return 0;
}
@@ -1616,9 +1616,9 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitVertical() throw(uno::RuntimeException,
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- if ( pViewData->GetVSplitMode() != SC_SPLIT_NONE )
- return pViewData->GetVSplitPos();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ if ( rViewData.GetVSplitMode() != SC_SPLIT_NONE )
+ return rViewData.GetVSplitPos();
}
return 0;
}
@@ -1630,18 +1630,18 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitColumn()
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- if ( pViewData->GetHSplitMode() != SC_SPLIT_NONE )
+ ScViewData& rViewData = pViewSh->GetViewData();
+ if ( rViewData.GetHSplitMode() != SC_SPLIT_NONE )
{
- long nSplit = pViewData->GetHSplitPos();
+ long nSplit = rViewData.GetHSplitPos();
ScSplitPos ePos = SC_SPLIT_BOTTOMLEFT;
- if ( pViewData->GetVSplitMode() != SC_SPLIT_NONE )
+ if ( rViewData.GetVSplitMode() != SC_SPLIT_NONE )
ePos = SC_SPLIT_TOPLEFT;
SCsCOL nCol;
SCsROW nRow;
- pViewData->GetPosFromPixel( nSplit, 0, ePos, nCol, nRow, false );
+ rViewData.GetPosFromPixel( nSplit, 0, ePos, nCol, nRow, false );
if ( nCol > 0 )
return nCol;
}
@@ -1655,15 +1655,15 @@ sal_Int32 SAL_CALL ScTabViewObj::getSplitRow() throw(uno::RuntimeException, std:
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- if ( pViewData->GetVSplitMode() != SC_SPLIT_NONE )
+ ScViewData& rViewData = pViewSh->GetViewData();
+ if ( rViewData.GetVSplitMode() != SC_SPLIT_NONE )
{
- long nSplit = pViewData->GetVSplitPos();
+ long nSplit = rViewData.GetVSplitPos();
ScSplitPos ePos = SC_SPLIT_TOPLEFT; // es ist vertikal geteilt
SCsCOL nCol;
SCsROW nRow;
- pViewData->GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, false );
+ rViewData.GetPosFromPixel( 0, nSplit, ePos, nCol, nRow, false );
if ( nRow > 0 )
return nRow;
}
@@ -1700,8 +1700,8 @@ void SAL_CALL ScTabViewObj::freezeAtPosition( sal_Int32 nColumns, sal_Int32 nRow
if (pWin)
aWinStart = pWin->GetPosPixel();
- ScViewData* pViewData = pViewSh->GetViewData();
- Point aSplit(pViewData->GetScrPos( (SCCOL)nColumns, (SCROW)nRows, SC_SPLIT_BOTTOMLEFT, true ));
+ ScViewData& rViewData = pViewSh->GetViewData();
+ Point aSplit(rViewData.GetScrPos( (SCCOL)nColumns, (SCROW)nRows, SC_SPLIT_BOTTOMLEFT, true ));
aSplit += aWinStart;
pViewSh->SplitAtPixel( aSplit, true, true );
@@ -1742,7 +1742,7 @@ void ScTabViewObj::SelectionChanged()
// Note: executing this slot through the dispatcher
// will cause the style dialog to be raised so we go
// direct here
- ScFormatShell aShell( GetViewShell()->GetViewData() );
+ ScFormatShell aShell( &GetViewShell()->GetViewData() );
SfxAllItemSet reqList( SFX_APP()->GetPool() );
SfxRequest aReq( SID_STYLE_END_PREVIEW, 0, reqList );
aShell.ExecuteStyle( aReq );
@@ -1753,11 +1753,11 @@ void ScTabViewObj::SelectionChanged()
// handle sheet events
ScTabViewShell* pViewSh = GetViewShell();
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = pViewData->GetTabNo();
- const ScSheetEvents* pEvents = pDoc->GetSheetEvents(nTab);
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = rViewData.GetTabNo();
+ const ScSheetEvents* pEvents = rDoc.GetSheetEvents(nTab);
if (pEvents)
{
const OUString* pScript = pEvents->GetScript(SC_SHEETEVENT_SELECT);
@@ -1777,7 +1777,7 @@ void ScTabViewObj::SelectionChanged()
mbPendingSelectionChanged = false;
try
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( rDoc.GetVbaEventProcessor(), uno::UNO_SET_THROW );
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= getSelection();
xVbaEvents->processVbaEvent( ScSheetEvents::GetVbaSheetEventId( SC_SHEETEVENT_SELECT ), aArgs );
@@ -1823,8 +1823,8 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- ScViewData* pViewData = pViewSh->GetViewData();
- const ScViewOptions& rOldOpt = pViewSh->GetViewData()->GetOptions();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ const ScViewOptions& rOldOpt = pViewSh->GetViewData().GetOptions();
ScViewOptions aNewOpt(rOldOpt);
if ( aString.equalsAscii( SC_UNO_COLROWHDR ) || aString.equalsAscii( OLD_UNO_COLROWHDR ) )
@@ -1912,9 +1912,9 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
if ( aNewOpt != rOldOpt )
{
- pViewData->SetOptions( aNewOpt );
- pViewData->GetDocument()->SetViewOptions( aNewOpt );
- pViewData->GetDocShell()->SetDocumentModified(); //! wirklich?
+ rViewData.SetOptions( aNewOpt );
+ rViewData.GetDocument()->SetViewOptions( aNewOpt );
+ rViewData.GetDocShell()->SetDocumentModified(); //! wirklich?
pViewSh->UpdateFixPos();
pViewSh->PaintGrid();
@@ -1947,7 +1947,7 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName
ScTabViewShell* pViewSh = GetViewShell();
if (pViewSh)
{
- const ScViewOptions& rOpt = pViewSh->GetViewData()->GetOptions();
+ const ScViewOptions& rOpt = pViewSh->GetViewData().GetOptions();
if ( aString.equalsAscii( SC_UNO_COLROWHDR ) || aString.equalsAscii( OLD_UNO_COLROWHDR ) )
ScUnoHelpFunctions::SetBoolInAny( aRet, rOpt.GetOption( VOPT_HEADER ) );
@@ -1977,8 +1977,8 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName
else if ( aString.equalsAscii( SC_UNO_ZOOMVALUE ) ) aRet <<= GetZoom();
else if ( aString.equalsAscii( SC_UNO_VISAREASCREEN ) )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- Window* pActiveWin = ( pViewData ? pViewData->GetActiveWin() : NULL );
+ ScViewData& rViewData = pViewSh->GetViewData();
+ Window* pActiveWin = rViewData.GetActiveWin();
if ( pActiveWin )
{
Rectangle aRect = pActiveWin->GetWindowExtentsRelative( NULL );
@@ -2256,8 +2256,8 @@ ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterf
ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pTextShell)
{
- ScViewData* pViewData = GetViewShell()->GetViewData();
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScViewData& rViewData = GetViewShell()->GetViewData();
+ ScDrawView* pView = rViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if (pOutView)
return pOutView->GetEditView().GetTransferable();
@@ -2286,8 +2286,8 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref
ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pTextShell)
{
- ScViewData* pViewData = GetViewShell()->GetViewData();
- ScDrawView* pView = pViewData->GetScDrawView();
+ ScViewData& rViewData = GetViewShell()->GetViewData();
+ ScDrawView* pView = rViewData.GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
if ( pOutView )
{
@@ -2321,21 +2321,19 @@ uno::Sequence<sal_Int32> ScTabViewObj::getSelectedSheets()
if (!pViewSh)
return uno::Sequence<sal_Int32>();
- ScViewData* pViewData = pViewSh->GetViewData();
- if (!pViewData)
- return uno::Sequence<sal_Int32>();
+ ScViewData& rViewData = pViewSh->GetViewData();
// #i95280# when printing from the shell, the view is never activated,
// so Excel view settings must also be evaluated here.
- ScExtDocOptions* pExtOpt = pViewData->GetDocument()->GetExtDocOptions();
+ ScExtDocOptions* pExtOpt = rViewData.GetDocument()->GetExtDocOptions();
if (pExtOpt && pExtOpt->IsChanged())
{
- pViewSh->GetViewData()->ReadExtOptions(*pExtOpt); // Excel view settings
- pViewSh->SetTabNo(pViewSh->GetViewData()->GetTabNo(), true);
+ pViewSh->GetViewData().ReadExtOptions(*pExtOpt); // Excel view settings
+ pViewSh->SetTabNo(pViewSh->GetViewData().GetTabNo(), true);
pExtOpt->SetChanged(false);
}
- return toSequence(pViewData->GetMarkData().GetSelectedTabs());
+ return toSequence(rViewData.GetMarkData().GetSelectedTabs());
}
ScPreviewObj::ScPreviewObj(ScPreviewShell* pViewSh) :
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index ef7ebc1ad8d8..96c76a725612 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -98,7 +98,7 @@ void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom
{
ScTabViewShell* pViewSh = excel::getBestViewShell( xModel );
Fraction aFract( nZoom, 100 );
- pViewSh->GetViewData()->SetZoom( aFract, aFract, nTabs );
+ pViewSh->GetViewData().SetZoom( aFract, aFract, nTabs );
pViewSh->RefreshZoom();
}
@@ -195,8 +195,8 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, sal_uInt16
ScTabViewShell* pTabViewShell = getBestViewShell( xModel );
if ( pTabViewShell )
{
- ScViewData* pView = pTabViewShell->GetViewData();
- Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
+ ScViewData& rView = pTabViewShell->GetViewData();
+ Window* pWin = rView.GetActiveWin();
if (pWin)
{
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
@@ -319,21 +319,21 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess( xSF->createInstance("ooo.vba.VBAObjectModuleObjectProvider"), uno::UNO_QUERY_THROW );
// set up the module info for the workbook and sheets in the nealy created
// spreadsheet
- ScDocument* pDoc = pShell->GetDocument();
- OUString sCodeName = pDoc->GetCodeName();
+ ScDocument& rDoc = pShell->GetDocument();
+ OUString sCodeName = rDoc.GetCodeName();
if ( sCodeName.isEmpty() )
{
sCodeName = "ThisWorkbook";
- pDoc->SetCodeName( sCodeName );
+ rDoc.SetCodeName( sCodeName );
}
std::vector< OUString > sDocModuleNames;
sDocModuleNames.push_back( sCodeName );
- for ( SCTAB index = 0; index < pDoc->GetTableCount(); index++)
+ for ( SCTAB index = 0; index < rDoc.GetTableCount(); index++)
{
OUString aName;
- pDoc->GetCodeName( index, aName );
+ rDoc.GetCodeName( index, aName );
sDocModuleNames.push_back( aName );
}
@@ -359,7 +359,7 @@ void setUpDocumentModules( const uno::Reference< sheet::XSpreadsheetDocument >&
itself as listener for specific events. */
try
{
- uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pShell->GetDocument()->GetVbaEventProcessor(), uno::UNO_SET_THROW );
+ uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pShell->GetDocument().GetVbaEventProcessor(), uno::UNO_SET_THROW );
uno::Sequence< uno::Any > aArgs;
xVbaEvents->processVbaEvent( script::vba::VBAEventId::WORKBOOK_OPEN, aArgs );
}
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 95de99017ab2..c050f1153c53 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -302,12 +302,10 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException, std::exception )
ScTabViewShell* pViewShell = excel::getCurrentBestViewShell(mxContext);
if ( !pViewShell )
throw uno::RuntimeException("No ViewShell available" );
- ScViewData* pTabView = pViewShell->GetViewData();
- if ( !pTabView )
- throw uno::RuntimeException("No ViewData available" );
+ ScViewData& rTabView = pViewShell->GetViewData();
- sal_Int32 nCursorX = pTabView->GetCurX();
- sal_Int32 nCursorY = pTabView->GetCurY();
+ sal_Int32 nCursorX = rTabView.GetCurX();
+ sal_Int32 nCursorY = rTabView.GetCurY();
// #i117392# excel::getUnoSheetModuleObj() may return null in documents without global VBA mode enabled
return new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) );
@@ -576,9 +574,9 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
{
xVbaSheetRange->Select();
uno::Reference< excel::XWindow > xWindow = getActiveWindow();
- ScSplitPos eWhich = pShell->GetViewData()->GetActivePart();
- sal_Int32 nValueX = pShell->GetViewData()->GetPosX(WhichH(eWhich));
- sal_Int32 nValueY = pShell->GetViewData()->GetPosY(WhichV(eWhich));
+ ScSplitPos eWhich = pShell->GetViewData().GetActivePart();
+ sal_Int32 nValueX = pShell->GetViewData().GetPosX(WhichH(eWhich));
+ sal_Int32 nValueY = pShell->GetViewData().GetPosY(WhichV(eWhich));
xWindow->SmallScroll( uno::makeAny( (sal_Int16)(xVbaSheetRange->getRow() - 1) ),
uno::makeAny( (sal_Int16)nValueY ),
uno::makeAny( (sal_Int16)(xVbaSheetRange->getColumn() - 1) ),
@@ -616,9 +614,9 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
{
xVbaRange->Select();
uno::Reference< excel::XWindow > xWindow = getActiveWindow();
- ScSplitPos eWhich = pShell->GetViewData()->GetActivePart();
- sal_Int32 nValueX = pShell->GetViewData()->GetPosX(WhichH(eWhich));
- sal_Int32 nValueY = pShell->GetViewData()->GetPosY(WhichV(eWhich));
+ ScSplitPos eWhich = pShell->GetViewData().GetActivePart();
+ sal_Int32 nValueX = pShell->GetViewData().GetPosX(WhichH(eWhich));
+ sal_Int32 nValueY = pShell->GetViewData().GetPosY(WhichV(eWhich));
xWindow->SmallScroll( uno::makeAny( (sal_Int16)(xVbaRange->getRow() - 1) ),
uno::makeAny( (sal_Int16)nValueY ),
uno::makeAny( (sal_Int16)(xVbaRange->getColumn() - 1) ),
@@ -772,7 +770,7 @@ ScVbaApplication::getDisplayScrollBars() throw (uno::RuntimeException, std::exc
ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext );
if ( pShell )
{
- return ( pShell->GetViewData()->IsHScrollMode() && pShell->GetViewData()->IsVScrollMode() );
+ return ( pShell->GetViewData().IsHScrollMode() && pShell->GetViewData().IsVScrollMode() );
}
return true;
}
@@ -1225,8 +1223,8 @@ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeExc
{
OSL_TRACE("ScVbaApplication::Volatile() In method ->%s<-", OUStringToOString( pMeth->GetName(), RTL_TEXTENCODING_UTF8 ).getStr() );
uno::Reference< frame::XModel > xModel( getCurrentDocument() );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- pDoc->GetMacroManager()->SetUserFuncVolatile( pMeth->GetName(), bVolatile);
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ rDoc.GetMacroManager()->SetUserFuncVolatile( pMeth->GetName(), bVolatile);
}
// this is bound to break when loading the document
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index 811768a374fd..18214850e401 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -579,13 +579,9 @@ ScVbaChart::setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange
ScVbaRange* pRange = static_cast< ScVbaRange* >( _xCalcRange.get() );
if ( pRange )
{
- ScDocument* pDoc = pRange->getScDocument();
- if ( pDoc )
- {
- bsetRowHeaders = pDoc->HasRowHeader( static_cast< SCCOL >( mSingleRangeAddress.StartColumn ), static_cast< SCROW >( mSingleRangeAddress.StartRow ), static_cast< SCCOL >( mSingleRangeAddress.EndColumn ), static_cast< SCROW >( mSingleRangeAddress.EndRow ), static_cast< SCTAB >( mSingleRangeAddress.Sheet ) );
- bsetColumnHeaders = pDoc->HasColHeader( static_cast< SCCOL >( mSingleRangeAddress.StartColumn ), static_cast< SCROW >( mSingleRangeAddress.StartRow ), static_cast< SCCOL >( mSingleRangeAddress.EndColumn ), static_cast< SCROW >( mSingleRangeAddress.EndRow ), static_cast< SCTAB >( mSingleRangeAddress.Sheet ));
-;
- }
+ ScDocument& rDoc = pRange->getScDocument();
+ bsetRowHeaders = rDoc.HasRowHeader( static_cast< SCCOL >( mSingleRangeAddress.StartColumn ), static_cast< SCROW >( mSingleRangeAddress.StartRow ), static_cast< SCCOL >( mSingleRangeAddress.EndColumn ), static_cast< SCROW >( mSingleRangeAddress.EndRow ), static_cast< SCTAB >( mSingleRangeAddress.Sheet ) );
+ bsetColumnHeaders = rDoc.HasColHeader( static_cast< SCCOL >( mSingleRangeAddress.StartColumn ), static_cast< SCROW >( mSingleRangeAddress.StartRow ), static_cast< SCCOL >( mSingleRangeAddress.EndColumn ), static_cast< SCROW >( mSingleRangeAddress.EndRow ), static_cast< SCTAB >( mSingleRangeAddress.Sheet ));
}
mxTableChart->setHasRowHeaders(bsetRowHeaders);
mxTableChart->setHasColumnHeaders(bsetColumnHeaders);
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index c506dded4893..c4c42a1c30f8 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -510,7 +510,7 @@ ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs, co
mbOpened( false )
{
mpDocShell = dynamic_cast< ScDocShell* >( mpShell ); // mpShell from base class
- mpDoc = mpDocShell ? mpDocShell->GetDocument() : 0;
+ mpDoc = mpDocShell ? &mpDocShell->GetDocument() : 0;
if( !mxModel.is() || !mpDocShell || !mpDoc )
return;
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index f80eaf534519..4949384b17fc 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -130,12 +130,12 @@ void ScVbaName::setContent( const OUString& rContent, const formula::FormulaGra
if ( pNamedRange && pNamedRange->pDocShell )
{
- ScDocument* pDoc = pNamedRange->pDocShell->GetDocument();
+ ScDocument& rDoc = pNamedRange->pDocShell->GetDocument();
ScRangeData* pOldData = pNamedRange->GetRangeData_Impl();
if (pOldData)
{
// Shorter way of doing this ?
- ScCompiler aComp( pDoc, pOldData->GetPos() );
+ ScCompiler aComp( &rDoc, pOldData->GetPos() );
aComp.SetGrammar( eGrammar );
boost::scoped_ptr<ScTokenArray> pArray(aComp.CompileString(sContent));
pOldData->SetCode(*pArray);
diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx
index c93fdbac564b..8cf18ec2183e 100644
--- a/sc/source/ui/vba/vbanames.cxx
+++ b/sc/source/ui/vba/vbanames.cxx
@@ -78,10 +78,8 @@ ScVbaNames::getScDocument()
ScTabViewShell * pTabViewShell = excel::getBestViewShell( xModel );
if ( !pTabViewShell )
throw uno::RuntimeException( "No ViewShell available" );
- ScViewData* pViewData = pTabViewShell->GetViewData();
- if ( !pViewData )
- throw uno::RuntimeException( "No ViewData available" );
- return pViewData->GetDocument();
+ ScViewData& rViewData = pTabViewShell->GetViewData();
+ return rViewData.GetDocument();
}
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index f422778ccb0b..7f91a80da576 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -82,8 +82,8 @@ OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeExcepti
ScUnoConversion::FillScRange( aRange, aSeq[i] );
aRangeList.Append( aRange );
}
- ScDocument* pDoc = excel::getDocShell( mxModel )->GetDocument();
- aRangeList.Format( aPrintArea, nFlags, pDoc, formula::FormulaGrammar::CONV_XL_A1, ',' );
+ ScDocument& rDoc = excel::getDocShell( mxModel )->GetDocument();
+ aRangeList.Format( aPrintArea, nFlags, &rDoc, formula::FormulaGrammar::CONV_XL_A1, ',' );
}
return aPrintArea;
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 75d34169cf2c..57d3ec747257 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -274,18 +274,16 @@ void ScVbaRange::fireChangeEvent()
{
if( ScVbaApplication::getDocumentEventsEnabled() )
{
- if( ScDocument* pDoc = getScDocument() )
+ ScDocument& rDoc = getScDocument();
+ uno::Reference< script::vba::XVBAEventProcessor > xVBAEvents = rDoc.GetVbaEventProcessor();
+ if( xVBAEvents.is() ) try
+ {
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[ 0 ] <<= uno::Reference< excel::XRange >( this );
+ xVBAEvents->processVbaEvent( script::vba::VBAEventId::WORKSHEET_CHANGE, aArgs );
+ }
+ catch( uno::Exception& )
{
- uno::Reference< script::vba::XVBAEventProcessor > xVBAEvents = pDoc->GetVbaEventProcessor();
- if( xVBAEvents.is() ) try
- {
- uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[ 0 ] <<= uno::Reference< excel::XRange >( this );
- xVBAEvents->processVbaEvent( script::vba::VBAEventId::WORKSHEET_CHANGE, aArgs );
- }
- catch( uno::Exception& )
- {
- }
}
}
}
@@ -426,17 +424,17 @@ uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::
return getModelFromXIf( xIf );
}
-ScDocument*
+ScDocument&
getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange )
{
ScDocShell* pDocShell = getDocShellFromRange( xRange );
if ( !pDocShell )
throw uno::RuntimeException("Failed to access underlying docshell from uno range object" );
- ScDocument* pDoc = pDocShell->GetDocument();
- return pDoc;
+ ScDocument& rDoc = pDocShell->GetDocument();
+ return rDoc;
}
-ScDocument*
+ScDocument&
ScVbaRange::getScDocument() throw (uno::RuntimeException)
{
if ( mxRanges.is() )
@@ -1157,12 +1155,11 @@ bool
ScVbaRange::getCellRangesForAddress( sal_uInt16& rResFlags, const OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter )
{
- ScDocument* pDoc = NULL;
if ( pDocSh )
{
- pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
sal_uInt16 nMask = SCA_VALID;
- rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, 0, cDelimiter );
+ rResFlags = rCellRanges.Parse( sAddress, &rDoc, nMask, eConv, 0, cDelimiter );
if ( rResFlags & SCA_VALID )
{
return true;
@@ -1203,17 +1200,14 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, ScRang
if ( !xNameAccess->hasByName( sAddress ) )
{
// try a local name
- ScDocument* pDoc = pDocSh->GetDocument();
- if ( pDoc )
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nCurTab = ScDocShell::GetCurTab();
+ ScRangeName* pRangeName = rDoc.GetRangeName(nCurTab);
+ if (pRangeName)
{
- SCTAB nCurTab = ScDocShell::GetCurTab();
- ScRangeName* pRangeName = pDoc->GetRangeName(nCurTab);
- if (pRangeName)
- {
- bLocalName = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(sAddress)) != NULL;
- // TODO: Handle local names correctly.
- (void)bLocalName;
- }
+ bLocalName = pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(sAddress)) != NULL;
+ // TODO: Handle local names correctly.
+ (void)bLocalName;
}
}
char aChar = 0;
@@ -1223,7 +1217,7 @@ bool getScRangeListForAddress( const OUString& sName, ScDocShell* pDocSh, ScRang
sAddress = xNamed->getContent();
// As the address comes from OOO, the addressing
// style is may not be XL_A1
- eConv = pDocSh->GetDocument()->GetAddressConvention();
+ eConv = pDocSh->GetDocument().GetAddressConvention();
aChar = ';';
}
@@ -1367,7 +1361,7 @@ util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxC
of a merged range is part of this range are not covered. */
ScRange aScRange;
ScUnoConversion::FillScRange( aScRange, aRangeAddr );
- bool bHasMerged = getDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED );
+ bool bHasMerged = getDocumentFromRange( rxCellRange ).HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED );
return bHasMerged ? util::TriState_INDETERMINATE : util::TriState_NO;
}
@@ -1424,10 +1418,8 @@ static uno::Reference< XCollection >
lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno::Reference<uno::XComponentContext>& xContext, const uno::Reference< table::XCellRange >& xRange ) throw( uno::RuntimeException )
{
uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW );
- ScDocument* pDoc = getDocumentFromRange(xRange);
- if ( !pDoc )
- throw uno::RuntimeException("Failed to access document from shell" );
- ScVbaPalette aPalette( pDoc->GetDocumentShell() );
+ ScDocument& rDoc = getDocumentFromRange(xRange);
+ ScVbaPalette aPalette( rDoc.GetDocumentShell() );
uno::Reference< XCollection > borders( new ScVbaBorders( xParent, xContext, xRange, aPalette ) );
return borders;
}
@@ -1667,7 +1659,7 @@ ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar::
aVisitor.visit( valueProcessor );
return;
}
- CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram );
+ CellFormulaValueSetter formulaValueSetter( rFormula, &getScDocument(), eGram );
setValue( rFormula, formulaValueSetter, bFireEvent );
}
@@ -1683,7 +1675,7 @@ ScVbaRange::getFormulaValue( formula::FormulaGrammar::Grammar eGram ) throw (uno
uno::Reference< excel::XRange > xRange( getArea( 0 ), uno::UNO_QUERY_THROW );
return xRange->getFormula();
}
- CellFormulaValueGetter valueGetter( getScDocument(), eGram );
+ CellFormulaValueGetter valueGetter( &getScDocument(), eGram );
return getValue( valueGetter );
}
@@ -2023,7 +2015,7 @@ ScVbaRange::setFormulaArray(const uno::Any& rFormula) throw (uno::RuntimeExcepti
rFormula >>= sFormula;
uno::Sequence<sheet::FormulaToken> aTokens = xParser->parseFormula( sFormula, aAddress );
ScTokenArray aTokenArray;
- (void)ScTokenConversion::ConvertToTokenArray( *getScDocument(), aTokenArray, aTokens );
+ (void)ScTokenConversion::ConvertToTokenArray( getScDocument(), aTokenArray, aTokens );
getScDocShell()->GetDocFunc().EnterMatrix( *getScRangeList()[0], NULL, &aTokenArray, OUString(), true, true, EMPTY_OUSTRING, formula::FormulaGrammar::GRAM_PODF_A1 );
}
@@ -2089,7 +2081,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut
}
sal_uInt16 nFlags = SCA_VALID;
ScDocShell* pDocShell = getScDocShell();
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
@@ -2126,22 +2118,20 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut
table::CellRangeAddress refAddress = getCellRangeAddressForVBARange( RelativeTo, pDocShell );
dDetails = ScAddress::Details( formula::FormulaGrammar::CONV_XL_R1C1, static_cast< SCROW >( refAddress.StartRow ), static_cast< SCCOL >( refAddress.StartColumn ) );
}
- return aRange.Format(nFlags, pDoc, dDetails);
+ return aRange.Format(nFlags, &rDoc, dDetails);
}
uno::Reference < excel::XFont >
ScVbaRange::Font() throw ( script::BasicErrorException, uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps(mxRange, ::uno::UNO_QUERY );
- ScDocument* pDoc = getScDocument();
+ ScDocument& rDoc = getScDocument();
if ( mxRange.is() )
xProps.set(mxRange, ::uno::UNO_QUERY );
else if ( mxRanges.is() )
xProps.set(mxRanges, ::uno::UNO_QUERY );
- if ( !pDoc )
- throw uno::RuntimeException("Failed to access document from shell" );
- ScVbaPalette aPalette( pDoc->GetDocumentShell() );
+ ScVbaPalette aPalette( rDoc.GetDocumentShell() );
ScCellRangeObj* pRangeObj = NULL;
try
{
@@ -2210,7 +2200,7 @@ ScVbaRange::CellsHelper( const uno::Reference< ov::XHelperInterface >& xParent,
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- sal_uInt16 flags = tmpRange.ParseCols( sCol, getDocumentFromRange( xRange ), dDetails );
+ sal_uInt16 flags = tmpRange.ParseCols( sCol, &getDocumentFromRange( xRange ), dDetails );
if ( ( flags & 0x200 ) != 0x200 )
throw uno::RuntimeException();
nColumn = tmpRange.aStart.Col() + 1;
@@ -2387,7 +2377,7 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException, std::exc
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- tmpRange.ParseRows( sAddress, getDocumentFromRange( mxRange ), dDetails );
+ tmpRange.ParseRows( sAddress, &getDocumentFromRange( mxRange ), dDetails );
SCROW nStartRow = tmpRange.aStart.Row();
SCROW nEndRow = tmpRange.aEnd.Row();
@@ -2431,7 +2421,7 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException, std::
{
ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
ScRange tmpRange;
- tmpRange.ParseCols( sAddress, getDocumentFromRange( mxRange ), dDetails );
+ tmpRange.ParseCols( sAddress, &getDocumentFromRange( mxRange ), dDetails );
SCCOL nStartCol = tmpRange.aStart.Col();
SCCOL nEndCol = tmpRange.aEnd.Col();
@@ -2691,7 +2681,7 @@ ScVbaRange::getWrapText() throw (script::BasicErrorException, uno::RuntimeExcept
uno::Reference< excel::XInterior > ScVbaRange::Interior( ) throw ( script::BasicErrorException, uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW );
- return new ScVbaInterior ( this, mxContext, xProps, getScDocument() );
+ return new ScVbaInterior ( this, mxContext, xProps, &getScDocument() );
}
uno::Reference< excel::XRange >
ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2 ) throw (uno::RuntimeException, std::exception)
@@ -3400,15 +3390,13 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
sal_Int16 nDataOption2 = excel::XlSortDataOption::xlSortNormal;
sal_Int16 nDataOption3 = excel::XlSortDataOption::xlSortNormal;
- ScDocument* pDoc = getScDocument();
- if ( !pDoc )
- throw uno::RuntimeException("Failed to access document from shell" );
+ ScDocument& rDoc = getScDocument();
RangeHelper thisRange( mxRange );
table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress();
ScSortParam aSortParam;
SCTAB nTab = thisRangeAddress.Sheet;
- pDoc->GetSortParam( aSortParam, nTab );
+ rDoc.GetSortParam( aSortParam, nTab );
if ( DataOption1.hasValue() )
DataOption1 >>= nDataOption1;
@@ -3464,8 +3452,8 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
if ( nHeader == excel::XlYesNoGuess::xlGuess )
{
- bool bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), static_cast< SCCOL >( thisRangeAddress.EndColumn ), static_cast< SCROW >( thisRangeAddress.EndRow ), static_cast< SCTAB >( thisRangeAddress.Sheet ));
- bool bHasRowHeader = pDoc->HasRowHeader( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), static_cast< SCCOL >( thisRangeAddress.EndColumn ), static_cast< SCROW >( thisRangeAddress.EndRow ), static_cast< SCTAB >( thisRangeAddress.Sheet ) );
+ bool bHasColHeader = rDoc.HasColHeader( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), static_cast< SCCOL >( thisRangeAddress.EndColumn ), static_cast< SCROW >( thisRangeAddress.EndRow ), static_cast< SCTAB >( thisRangeAddress.Sheet ));
+ bool bHasRowHeader = rDoc.HasRowHeader( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), static_cast< SCCOL >( thisRangeAddress.EndColumn ), static_cast< SCROW >( thisRangeAddress.EndRow ), static_cast< SCTAB >( thisRangeAddress.Sheet ) );
if ( bHasColHeader || bHasRowHeader )
nHeader = excel::XlYesNoGuess::xlYes;
else
@@ -3559,7 +3547,7 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
nIndex = findSortPropertyIndex( sortDescriptor, CONTS_HEADER );
sortDescriptor[ nIndex ].Value <<= bContainsHeader;
- pDoc->SetSortParam( aSortParam, nTab );
+ rDoc.SetSortParam( aSortParam, nTab );
xSort->sort( sortDescriptor );
// #FIXME #TODO
@@ -3663,12 +3651,10 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u
if ( !isSingleCellRange() )
throw uno::RuntimeException("Can't create Characters property for multicell range " );
uno::Reference< text::XSimpleText > xSimple(mxRange->getCellByPosition(0,0) , uno::UNO_QUERY_THROW );
- ScDocument* pDoc = getDocumentFromRange(mxRange);
- if ( !pDoc )
- throw uno::RuntimeException("Failed to access document from shell" );
+ ScDocument& rDoc = getDocumentFromRange(mxRange);
- ScVbaPalette aPalette( pDoc->GetDocumentShell() );
- return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length );
+ ScVbaPalette aPalette( rDoc.GetDocumentShell() );
+ return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length );
}
void SAL_CALL
@@ -3761,8 +3747,8 @@ double
ScVbaRange::getCalcColWidth(const table::CellRangeAddress& rAddress)
throw (uno::RuntimeException, std::exception)
{
- ScDocument* pDoc = getScDocument();
- sal_uInt16 nWidth = pDoc->GetOriginalWidth( static_cast< SCCOL >( rAddress.StartColumn ), static_cast< SCTAB >( rAddress.Sheet ) );
+ ScDocument& rDoc = getScDocument();
+ sal_uInt16 nWidth = rDoc.GetOriginalWidth( static_cast< SCCOL >( rAddress.StartColumn ), static_cast< SCTAB >( rAddress.Sheet ) );
double nPoints = lcl_TwipsToPoints( nWidth );
nPoints = lcl_Round2DecPlaces( nPoints );
return nPoints;
@@ -3772,8 +3758,8 @@ double
ScVbaRange::getCalcRowHeight(const table::CellRangeAddress& rAddress)
throw (uno::RuntimeException, std::exception)
{
- ScDocument* pDoc = getDocumentFromRange( mxRange );
- sal_uInt16 nWidth = pDoc->GetOriginalHeight( rAddress.StartRow, rAddress.Sheet );
+ ScDocument& rDoc = getDocumentFromRange( mxRange );
+ sal_uInt16 nWidth = rDoc.GetOriginalHeight( rAddress.StartRow, rAddress.Sheet );
double nPoints = lcl_TwipsToPoints( nWidth );
nPoints = lcl_Round2DecPlaces( nPoints );
return nPoints;
@@ -3782,9 +3768,9 @@ ScVbaRange::getCalcRowHeight(const table::CellRangeAddress& rAddress)
// return Char Width in points
double getDefaultCharWidth( ScDocShell* pDocShell )
{
- ScDocument* pDoc = pDocShell->GetDocument();
- OutputDevice* pRefDevice = pDoc->GetRefDevice();
- ScPatternAttr* pAttr = pDoc->GetDefPattern();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ OutputDevice* pRefDevice = rDoc.GetRefDevice();
+ ScPatternAttr* pAttr = rDoc.GetDefPattern();
::Font aDefFont;
pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice );
pRefDevice->SetFont( aDefFont );
@@ -3815,7 +3801,7 @@ ScVbaRange::getColumnWidth() throw (uno::RuntimeException, std::exception)
for( sal_Int32 nCol = nStartCol ; nCol <= nEndCol; ++nCol )
{
thisAddress.StartColumn = nCol;
- sal_uInt16 nCurTwips = pShell->GetDocument()->GetOriginalWidth( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCTAB >( thisAddress.Sheet ) );
+ sal_uInt16 nCurTwips = pShell->GetDocument().GetOriginalWidth( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCTAB >( thisAddress.Sheet ) );
if ( nCol == nStartCol )
nColTwips = nCurTwips;
if ( nColTwips != nCurTwips )
@@ -3983,7 +3969,7 @@ ScVbaRange::getRowHeight()
for ( sal_Int32 nRow = nStartRow ; nRow <= nEndRow; ++nRow )
{
thisAddress.StartRow = nRow;
- sal_uInt16 nCurTwips = pShell->GetDocument()->GetOriginalHeight( thisAddress.StartRow, thisAddress.Sheet );
+ sal_uInt16 nCurTwips = pShell->GetDocument().GetOriginalHeight( thisAddress.StartRow, thisAddress.Sheet );
if ( nRow == nStartRow )
nRowTwips = nCurTwips;
if ( nRowTwips != nCurTwips )
@@ -4037,13 +4023,13 @@ ScVbaRange::getPageBreak() throw (uno::RuntimeException, std::exception)
uno::Reference< frame::XModel > xModel = pShell->GetModel();
if ( xModel.is() )
{
- ScDocument* pDoc = getDocumentFromRange( mxRange );
+ ScDocument& rDoc = getDocumentFromRange( mxRange );
ScBreakType nBreak = BREAK_NONE;
if ( !bColumn )
- nBreak = pDoc->HasRowBreak(thisAddress.StartRow, thisAddress.Sheet);
+ nBreak = rDoc.HasRowBreak(thisAddress.StartRow, thisAddress.Sheet);
else
- nBreak = pDoc->HasColBreak(thisAddress.StartColumn, thisAddress.Sheet);
+ nBreak = rDoc.HasColBreak(thisAddress.StartColumn, thisAddress.Sheet);
if (nBreak & BREAK_PAGE)
nPageBreak = excel::XlPageBreak::xlPageBreakAutomatic;
@@ -4276,7 +4262,7 @@ static ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet )
ScDBData* pRet = NULL;
if (pDocShell)
{
- pRet = pDocShell->GetDocument()->GetAnonymousDBData(nSheet);
+ pRet = pDocShell->GetDocument().GetAnonymousDBData(nSheet);
}
return pRet;
}
@@ -4441,7 +4427,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
RangeHelper multiCellRange( mxRange );
autoFiltAddress = multiCellRange.getCellRangeAddressable()->getRangeAddress();
// #163530# Filter box shows only entry of first row
- ScDocument* pDocument = ( pShell ? pShell->GetDocument() : NULL );
+ ScDocument* pDocument = ( pShell ? &pShell->GetDocument() : NULL );
if ( pDocument )
{
SCCOL nStartCol = autoFiltAddress.StartColumn;
@@ -4473,7 +4459,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const
// set header (autofilter always need column headers)
uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW );
bool bHasColHeader = false;
- ScDocument* pDoc = pShell ? pShell->GetDocument() : NULL;
+ ScDocument* pDoc = pShell ? &pShell->GetDocument() : NULL;
if (pDoc)
{
bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) );
@@ -4881,18 +4867,15 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException, std::ex
(thisAddress.StartColumn == thisAddress.EndColumn && thisAddress.EndColumn == aOutlineAddress.EndColumn ))
{
bool bColumn =thisAddress.StartRow == thisAddress.EndRow ? false:sal_True;
- ScDocument* pDoc = getDocumentFromRange( mxRange );
- ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(thisAddress.Sheet), true);
- const ScOutlineArray* pOutlineArray = bColumn ? pOutlineTable->GetColArray(): pOutlineTable->GetRowArray();
- if( pOutlineArray )
+ ScDocument& rDoc = getDocumentFromRange( mxRange );
+ ScOutlineTable* pOutlineTable = rDoc.GetOutlineTable(static_cast<SCTAB>(thisAddress.Sheet), true);
+ const ScOutlineArray& rOutlineArray = bColumn ? pOutlineTable->GetColArray(): pOutlineTable->GetRowArray();
+ SCCOLROW nPos = bColumn ? (SCCOLROW)(thisAddress.EndColumn-1):(SCCOLROW)(thisAddress.EndRow-1);
+ const ScOutlineEntry* pEntry = rOutlineArray.GetEntryByPos( 0, nPos );
+ if( pEntry )
{
- SCCOLROW nPos = bColumn ? (SCCOLROW)(thisAddress.EndColumn-1):(SCCOLROW)(thisAddress.EndRow-1);
- const ScOutlineEntry* pEntry = pOutlineArray->GetEntryByPos( 0, nPos );
- if( pEntry )
- {
- bShowDetail = !pEntry->IsHidden();
- return uno::makeAny( bShowDetail );
- }
+ bShowDetail = !pEntry->IsHidden();
+ return uno::makeAny( bShowDetail );
}
}
else
@@ -5334,8 +5317,8 @@ ScVbaRange::PreviousNext( bool bIsPrevious )
SCROW nNewY = refRange.aStart.Row();
SCTAB nTab = refRange.aStart.Tab();
- ScDocument* pDoc = getScDocument();
- pDoc->GetNextPos( nNewX,nNewY, nTab, nMove,0, true,true, markedRange );
+ ScDocument& rDoc = getScDocument();
+ rDoc.GetNextPos( nNewX,nNewY, nTab, nMove,0, true,true, markedRange );
refRange.aStart.SetCol( nNewX );
refRange.aStart.SetRow( nNewY );
refRange.aStart.SetTab( nTab );
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index 985823553d83..5fe1c664b412 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -122,7 +122,7 @@ public:
ScVbaRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges, bool bIsRows = false, bool bIsColumns = false ) throw ( css::lang::IllegalArgumentException, css::uno::RuntimeException );
ScVbaRange( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException, css::uno::RuntimeException );
- ScDocument* getScDocument() throw (css::uno::RuntimeException);
+ ScDocument& getScDocument() throw (css::uno::RuntimeException);
ScDocShell* getScDocShell() throw (css::uno::RuntimeException);
/** Returns the ScVbaRange implementation object for the passed VBA Range object. */
diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx
index 3cbb47743ea1..747aad67543d 100644
--- a/sc/source/ui/vba/vbatextboxshape.cxx
+++ b/sc/source/ui/vba/vbatextboxshape.cxx
@@ -47,7 +47,7 @@ uno::Reference< excel::XCharacters > SAL_CALL
ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) throw (uno::RuntimeException, std::exception)
{
ScDocShell* pDocShell = excel::getDocShell( m_xModel );
- ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL;
+ ScDocument* pDoc = pDocShell ? &pDocShell->GetDocument() : NULL;
if ( !pDoc )
throw uno::RuntimeException("Failed to access document from shell" );
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index ac89af3c0ab4..3f383c6da532 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -111,9 +111,9 @@ public:
if ( !pViewShell )
throw uno::RuntimeException("Cannot obtain view shell" );
- SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
+ SCTAB nTabCount = pDocShell->GetDocument().GetTableCount();
SCTAB nIndex = 0;
- const ScMarkData& rMarkData = pViewShell->GetViewData()->GetMarkData();
+ const ScMarkData& rMarkData = pViewShell->GetViewData().GetMarkData();
sheets.reserve( nTabCount );
uno::Reference <sheet::XSpreadsheetDocument> xSpreadSheet( m_xModel, uno::UNO_QUERY_THROW );
uno::Reference <container::XIndexAccess> xIndex( xSpreadSheet->getSheets(), uno::UNO_QUERY_THROW );
@@ -355,8 +355,8 @@ ScVbaWindow::getScrollRow() throw (uno::RuntimeException, std::exception)
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
if ( pViewShell )
{
- ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart();
- nValue = pViewShell->GetViewData()->GetPosY(WhichV(eWhich));
+ ScSplitPos eWhich = pViewShell->GetViewData().GetActivePart();
+ nValue = pViewShell->GetViewData().GetPosY(WhichV(eWhich));
}
return uno::makeAny( nValue + 1);
@@ -371,8 +371,8 @@ ScVbaWindow::setScrollRow( const uno::Any& _scrollrow ) throw (uno::RuntimeExcep
{
sal_Int32 scrollRow = 0;
_scrollrow >>= scrollRow;
- ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart();
- sal_Int32 nOldValue = pViewShell->GetViewData()->GetPosY(WhichV(eWhich)) + 1;
+ ScSplitPos eWhich = pViewShell->GetViewData().GetActivePart();
+ sal_Int32 nOldValue = pViewShell->GetViewData().GetPosY(WhichV(eWhich)) + 1;
pViewShell->ScrollLines(0, scrollRow - nOldValue);
}
}
@@ -385,8 +385,8 @@ ScVbaWindow::getScrollColumn() throw (uno::RuntimeException, std::exception)
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
if ( pViewShell )
{
- ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart();
- nValue = pViewShell->GetViewData()->GetPosX(WhichH(eWhich));
+ ScSplitPos eWhich = pViewShell->GetViewData().GetActivePart();
+ nValue = pViewShell->GetViewData().GetPosX(WhichH(eWhich));
}
return uno::makeAny( nValue + 1);
@@ -401,8 +401,8 @@ ScVbaWindow::setScrollColumn( const uno::Any& _scrollcolumn ) throw (uno::Runtim
{
sal_Int32 scrollColumn = 0;
_scrollcolumn >>= scrollColumn;
- ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart();
- sal_Int32 nOldValue = pViewShell->GetViewData()->GetPosX(WhichH(eWhich)) + 1;
+ ScSplitPos eWhich = pViewShell->GetViewData().GetActivePart();
+ sal_Int32 nOldValue = pViewShell->GetViewData().GetPosX(WhichH(eWhich)) + 1;
pViewShell->ScrollLines(scrollColumn - nOldValue, 0);
}
}
@@ -794,7 +794,7 @@ ScVbaWindow::getView() throw (uno::RuntimeException, std::exception)
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
if (pViewShell)
- bPageBreak = pViewShell->GetViewData()->IsPagebreakMode();
+ bPageBreak = pViewShell->GetViewData().IsPagebreakMode();
if( bPageBreak )
nWindowView = excel::XlWindowView::xlPageBreakPreview;
@@ -871,9 +871,9 @@ ScVbaWindow::PrintPreview( const css::uno::Any& EnableChanges ) throw (css::scri
double SAL_CALL ScVbaWindow::getTabRatio() throw (css::uno::RuntimeException, std::exception)
{
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
- if ( pViewShell && pViewShell->GetViewData() && pViewShell->GetViewData()->GetView() )
+ if ( pViewShell && pViewShell->GetViewData().GetView() )
{
- double fRatio = pViewShell->GetViewData()->GetView()->GetRelTabBarWidth();
+ double fRatio = pViewShell->GetViewData().GetView()->GetRelTabBarWidth();
if ( fRatio >= 0.0 && fRatio <= 1.0 )
return fRatio;
}
@@ -883,10 +883,10 @@ double SAL_CALL ScVbaWindow::getTabRatio() throw (css::uno::RuntimeException, st
void SAL_CALL ScVbaWindow::setTabRatio( double fRatio ) throw (css::uno::RuntimeException, std::exception)
{
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
- if ( pViewShell && pViewShell->GetViewData() && pViewShell->GetViewData()->GetView() )
+ if ( pViewShell && pViewShell->GetViewData().GetView() )
{
if ( fRatio >= 0.0 && fRatio <= 1.0 )
- pViewShell->GetViewData()->GetView()->SetRelTabBarWidth( fRatio );
+ pViewShell->GetViewData().GetView()->SetRelTabBarWidth( fRatio );
}
}
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 7599126b685c..d78bdde29f80 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -280,17 +280,17 @@ ScVbaWorkbook::getProtectStructure() throw (uno::RuntimeException, std::exceptio
sal_Bool SAL_CALL ScVbaWorkbook::getPrecisionAsDisplayed() throw (uno::RuntimeException, std::exception)
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- return pDoc->GetDocOptions().IsCalcAsShown();
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ return rDoc.GetDocOptions().IsCalcAsShown();
}
void SAL_CALL ScVbaWorkbook::setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (uno::RuntimeException, std::exception)
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- ScDocOptions aOpt = pDoc->GetDocOptions();
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ ScDocOptions aOpt = rDoc.GetDocOptions();
aOpt.SetCalcAsShown( _precisionAsDisplayed );
- pDoc->SetDocOptions( aOpt );
+ rDoc.SetDocOptions( aOpt );
}
void
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index b367e3611c9a..4b5d2d4a62a1 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -234,7 +234,7 @@ ScVbaWorksheet::createSheetCopyInNewDoc(const OUString& aCurrSheetName)
ScDocShell* pShell = excel::getDocShell( xModel );
OUString aCodeName;
- pShell->GetDocument()->GetCodeName( 0, aCodeName );
+ pShell->GetDocument().GetCodeName( 0, aCodeName );
return uno::Reference< excel::XWorksheet >( getUnoDocModule( aCodeName, pShell ), uno::UNO_QUERY_THROW );
}
@@ -344,8 +344,8 @@ ScVbaWorksheet::getEnableSelection() throw (uno::RuntimeException, std::exceptio
if ( ScVbaWorksheets::nameExists(xSpreadDoc, getName(), nTab) )
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
bool bLockedCells = false;
bool bUnlockedCells = false;
if( pProtect )
@@ -379,8 +379,8 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx
if ( ScVbaWorksheets::nameExists(xSpreadDoc, getName(), nTab) )
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
// default is xlNoSelection
bool bLockedCells = false;
bool bUnlockedCells = false;
@@ -407,8 +407,8 @@ ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeEx
sal_Bool SAL_CALL ScVbaWorksheet::getAutoFilterMode() throw (uno::RuntimeException, std::exception)
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- ScDBData* pDBData = pDoc->GetAnonymousDBData(getSheetID());
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ ScDBData* pDBData = rDoc.GetAnonymousDBData(getSheetID());
if (pDBData)
return pDBData->HasAutoFilter();
return false;
@@ -418,19 +418,19 @@ void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) thro
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
ScDocShell* pDocShell = excel::getDocShell( xModel );
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDBData* pDBData = pDoc->GetAnonymousDBData(getSheetID());
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDBData* pDBData = rDoc.GetAnonymousDBData(getSheetID());
if (pDBData)
{
pDBData->SetAutoFilter(bAutoFilterMode);
ScRange aRange;
pDBData->GetArea(aRange);
- if (bAutoFilterMode && pDoc)
- pDoc->ApplyFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
+ if (bAutoFilterMode)
+ rDoc.ApplyFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aStart.Row(),
aRange.aStart.Tab(), SC_MF_AUTO );
- else if (!bAutoFilterMode && pDoc)
- pDoc->RemoveFlagsTab(aRange.aStart.Col(), aRange.aStart.Row(),
+ else if (!bAutoFilterMode)
+ rDoc.RemoveFlagsTab(aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aStart.Row(),
aRange.aStart.Tab(), SC_MF_AUTO );
ScRange aPaintRange(aRange.aStart, aRange.aEnd);
@@ -519,8 +519,8 @@ ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException, std::ex
if ( bSheetExists )
{
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument();
- ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ ScDocument& rDoc = excel::getDocShell( xModel )->GetDocument();
+ ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
if ( pProtect )
return pProtect->isOptionEnabled( ScTableProtection::OBJECTS );
}
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 7a88275337cb..038b3f052bd4 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -370,7 +370,7 @@ ScVbaWorksheets::Select( const uno::Any& Replace ) throw (uno::RuntimeException,
if ( !pViewShell )
throw uno::RuntimeException("Cannot obtain view shell" );
- ScMarkData& rMarkData = pViewShell->GetViewData()->GetMarkData();
+ ScMarkData& rMarkData = pViewShell->GetViewData().GetMarkData();
bool bReplace = true;
Replace >>= bReplace;
// Replace is defaulted to True, meanining this current collection
@@ -549,7 +549,7 @@ void ScVbaWorksheets::PrintPreview( const css::uno::Any& /*EnableChanges*/ ) thr
WaitUntilPreviewIsClosed( pViewFrame );
// restore old tab selection
pViewShell = excel::getBestViewShell( mxModel );
- pViewShell->GetViewData()->GetMarkData().SetSelectedTabs(aOldTabs);
+ pViewShell->GetViewData().GetMarkData().SetSelectedTabs(aOldTabs);
}
}
}
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index eca9ed891a6d..ac091beea9c6 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -277,7 +277,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
void ScCellShell::GetCellState( SfxItemSet& rSet )
{
ScDocShell* pDocShell = GetViewData()->GetDocShell();
- ScDocument* pDoc = GetViewData()->GetDocShell()->GetDocument();
+ ScDocument& rDoc = GetViewData()->GetDocShell()->GetDocument();
ScAddress aCursor( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
GetViewData()->GetTabNo() );
@@ -291,25 +291,25 @@ void ScCellShell::GetCellState( SfxItemSet& rSet )
{
case SID_THESAURUS:
{
- CellType eType = pDoc->GetCellType( aCursor );
+ CellType eType = rDoc.GetCellType( aCursor );
bDisable = ( eType != CELLTYPE_STRING && eType != CELLTYPE_EDIT);
if (!bDisable)
{
// test for available languages
- sal_uInt16 nLang = ScViewUtil::GetEffLanguage( pDoc, aCursor );
+ sal_uInt16 nLang = ScViewUtil::GetEffLanguage( &rDoc, aCursor );
bDisable = !ScModule::HasThesaurusLanguage( nLang );
}
}
break;
case SID_OPENDLG_FUNCTION:
{
- ScMarkData aMarkData=GetViewData()->GetMarkData();
+ ScMarkData aMarkData = GetViewData()->GetMarkData();
aMarkData.MarkToSimple();
ScRange aRange;
aMarkData.GetMarkArea(aRange);
if(aMarkData.IsMarked())
{
- if (!pDoc->IsBlockEditable( aCursor.Tab(), aRange.aStart.Col(),aRange.aStart.Row(),
+ if (!rDoc.IsBlockEditable( aCursor.Tab(), aRange.aStart.Col(),aRange.aStart.Row(),
aRange.aEnd.Col(),aRange.aEnd.Row() ))
{
bDisable = true;
@@ -329,7 +329,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet )
break;
}
if (!bDisable && bNeedEdit)
- if (!pDoc->IsBlockEditable( aCursor.Tab(), aCursor.Col(),aCursor.Row(),
+ if (!rDoc.IsBlockEditable( aCursor.Tab(), aCursor.Col(),aCursor.Row(),
aCursor.Col(),aCursor.Row() ))
bDisable = true;
if (bDisable)
@@ -523,8 +523,8 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
SCCOL nCol = GetViewData()->GetCurX();
SCROW nRow = GetViewData()->GetCurY();
SCTAB nTab = GetViewData()->GetTabNo();
- ScDocument* pDoc = GetViewData()->GetDocShell()->GetDocument();
- if (!pDoc->IsBlockEditable( nTab, nCol,nRow, nCol,nRow ))
+ ScDocument& rDoc = GetViewData()->GetDocShell()->GetDocument();
+ if (!rDoc.IsBlockEditable( nTab, nCol,nRow, nCol,nRow ))
bDisable = true;
if (!checkDestRanges(*GetViewData()))
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 52ad408ae387..55fa4be7083d 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -994,7 +994,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
ScViewData* pData = GetViewData();
ScDocShell* pDocSh = pData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCCOL nPosX = pData->GetCurX();
SCROW nPosY = pData->GetCurY();
SCTAB nTab = pData->GetTabNo();
@@ -1014,7 +1014,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
// or filter,sort,subtotal (also without import)
bool bOk = false;
ScDBData* pDBData = pTabViewShell->GetDBData(false,SC_DB_OLD);
- if (pDBData && pDoc->GetChangeTrack() == NULL)
+ if (pDBData && rDoc.GetChangeTrack() == NULL)
{
if ( pDBData->HasImportParam() )
bOk = !pDBData->HasImportSelection();
@@ -1052,7 +1052,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
{
//! move ReadOnly check to idl flags
- if ( pDocSh->IsReadOnly() || pDoc->GetChangeTrack()!=NULL ||
+ if ( pDocSh->IsReadOnly() || rDoc.GetChangeTrack()!=NULL ||
GetViewData()->IsMultiMarked() )
{
rSet.DisableItem( nWhich );
@@ -1065,7 +1065,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
// only imported data without selection
ScDBData* pDBData = pTabViewShell->GetDBData(false,SC_DB_OLD);
if (!pDBData || !pDBData->HasImportParam() || pDBData->HasImportSelection() ||
- pDoc->GetChangeTrack()!=NULL)
+ rDoc.GetChangeTrack()!=NULL)
{
rSet.DisableItem( nWhich );
}
@@ -1095,7 +1095,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
{
if (!bAutoFilterTested)
{
- bAutoFilter = pDoc->HasAutoFilter( nPosX, nPosY, nTab );
+ bAutoFilter = rDoc.HasAutoFilter( nPosX, nPosY, nTab );
bAutoFilterTested = true;
}
if ( nWhich == SID_AUTO_FILTER )
@@ -1106,7 +1106,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
{
rSet.DisableItem( nWhich );
}
- else if (pDoc->GetDPAtBlock(aDummy))
+ else if (rDoc.GetDPAtBlock(aDummy))
{
rSet.DisableItem( nWhich );
}
@@ -1143,8 +1143,8 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
}
ScDBData* pDBData = bSelected
- ? pDoc->GetDBAtArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow )
- : pDoc->GetDBAtCursor( nStartCol, nStartRow, nStartTab );
+ ? rDoc.GetDBAtArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow )
+ : rDoc.GetDBAtCursor( nStartCol, nStartRow, nStartTab );
if ( pDBData )
{
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 704fda74ce72..4356a354111d 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -52,7 +52,7 @@ ScDBFunc::~ScDBFunc()
void ScDBFunc::GotoDBArea( const OUString& rDBName )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDBCollection* pDBCol = pDoc->GetDBCollection();
ScDBData* pData = pDBCol->getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rDBName));
if (pData)
@@ -79,10 +79,10 @@ void ScDBFunc::GotoDBArea( const OUString& rDBName )
ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection eSel )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDBData* pData = NULL;
ScRange aRange;
- ScMarkType eMarkType = GetViewData()->GetSimpleArea(aRange);
+ ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange);
if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
{
bool bShrinkColumnsOnly = false;
@@ -103,7 +103,7 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection e
{
// One cell only, if it is not marked obtain entire used data
// area.
- const ScMarkData& rMarkData = GetViewData()->GetMarkData();
+ const ScMarkData& rMarkData = GetViewData().GetMarkData();
if (!(rMarkData.IsMarked() || rMarkData.IsMultiMarked()))
eSel = SC_DBSEL_KEEP;
}
@@ -113,10 +113,10 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection e
case SC_DBSEL_SHRINK_TO_SHEET_DATA:
{
// Shrink the selection to sheet data area.
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col();
SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row();
- if (pDoc->ShrinkToDataArea( aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2))
+ if (rDoc.ShrinkToDataArea( aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2))
{
aRange.aStart.SetCol(nCol1);
aRange.aEnd.SetCol(nCol2);
@@ -129,11 +129,11 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection e
case SC_DBSEL_ROW_DOWN:
{
// Shrink the selection to actual used area.
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col();
SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row();
bool bShrunk;
- pDoc->ShrinkToUsedDataArea( bShrunk, aRange.aStart.Tab(),
+ rDoc.ShrinkToUsedDataArea( bShrunk, aRange.aStart.Tab(),
nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly);
if (bShrunk)
{
@@ -151,8 +151,8 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection e
}
else if ( eMode != SC_DB_OLD )
pData = pDocSh->GetDBData(
- ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() ),
+ ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(),
+ GetViewData().GetTabNo() ),
eMode, SC_DBSEL_KEEP );
if (!pData)
@@ -169,21 +169,21 @@ ScDBData* ScDBFunc::GetDBData( bool bMark, ScGetDBMode eMode, ScGetDBSelection e
ScDBData* ScDBFunc::GetAnonymousDBData()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScRange aRange;
- ScMarkType eMarkType = GetViewData()->GetSimpleArea(aRange);
+ ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange);
if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED)
return NULL;
// Expand to used data area if not explicitly marked.
- const ScMarkData& rMarkData = GetViewData()->GetMarkData();
+ const ScMarkData& rMarkData = GetViewData().GetMarkData();
if (!rMarkData.IsMarked() && !rMarkData.IsMultiMarked())
{
SCCOL nCol1 = aRange.aStart.Col();
SCCOL nCol2 = aRange.aEnd.Col();
SCROW nRow1 = aRange.aStart.Row();
SCROW nRow2 = aRange.aEnd.Row();
- pDocSh->GetDocument()->GetDataArea(aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2, false, false);
+ pDocSh->GetDocument().GetDataArea(aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2, false, false);
aRange.aStart.SetCol(nCol1);
aRange.aStart.SetRow(nRow1);
aRange.aEnd.SetCol(nCol2);
@@ -198,12 +198,12 @@ ScDBData* ScDBFunc::GetAnonymousDBData()
void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::vector<ScRange> &rDelAreaList )
{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
ScDocShellModificator aModificator( *pDocShell );
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDBCollection* pOldColl = pDoc->GetDBCollection();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDBCollection* pOldColl = rDoc.GetDBCollection();
ScDBCollection* pUndoColl = NULL;
- const bool bRecord (pDoc->IsUndoEnabled());
+ const bool bRecord (rDoc.IsUndoEnabled());
std::vector<ScRange>::const_iterator iter;
for (iter = rDelAreaList.begin(); iter != rDelAreaList.end(); ++iter)
@@ -222,9 +222,9 @@ void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::
// register target in SBA no longer necessary
- pDoc->CompileDBFormula( true ); // CreateFormulaString
- pDoc->SetDBCollection( new ScDBCollection( rNewColl ) );
- pDoc->CompileDBFormula( false ); // CompileFormulaString
+ rDoc.CompileDBFormula( true ); // CreateFormulaString
+ rDoc.SetDBCollection( new ScDBCollection( rNewColl ) );
+ rDoc.CompileDBFormula( false ); // CompileFormulaString
pOldColl = NULL;
pDocShell->PostPaint(ScRange(0, 0, 0, MAXCOL, MAXROW, MAXTAB), PAINT_GRID);
aModificator.SetDocumentModified();
@@ -246,10 +246,10 @@ void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::
void ScDBFunc::UISort( const ScSortParam& rSortParam, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rSortParam.nCol1, rSortParam.nRow1,
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rSortParam.nCol1, rSortParam.nRow1,
rSortParam.nCol2, rSortParam.nRow2 );
if (!pDBData)
{
@@ -273,8 +273,8 @@ void ScDBFunc::UISort( const ScSortParam& rSortParam, bool bRecord )
void ScDBFunc::Sort( const ScSortParam& rSortParam, bool bRecord, bool bPaint )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
ScDBDocFunc aDBDocFunc( *pDocSh );
bool bSuccess = aDBDocFunc.Sort( nTab, rSortParam, bRecord, bPaint, false );
if ( bSuccess && !rSortParam.bInplace )
@@ -294,8 +294,8 @@ void ScDBFunc::Sort( const ScSortParam& rSortParam, bool bRecord, bool bPaint )
void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
ScDBDocFunc aDBDocFunc( *pDocSh );
bool bSuccess = aDBDocFunc.Query( nTab, rQueryParam, pAdvSource, bRecord, false );
@@ -305,8 +305,8 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource
if (bCopy)
{
// mark target range (data base range has been set up if applicable)
- ScDocument* pDoc = pDocSh->GetDocument();
- ScDBData* pDestData = pDoc->GetDBAtCursor(
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScDBData* pDestData = rDoc.GetDBAtCursor(
rQueryParam.nDestCol, rQueryParam.nDestRow,
rQueryParam.nDestTab, true );
if (pDestData)
@@ -323,7 +323,7 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource
SelectionChanged(); // for attribute states (filtered rows are ignored)
}
- GetViewData()->GetBindings().Invalidate( SID_UNFILTER );
+ GetViewData().GetBindings().Invalidate( SID_UNFILTER );
}
}
@@ -331,11 +331,11 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource
void ScDBFunc::ToggleAutoFilter()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
ScQueryParam aParam;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
pDBData->SetByRow( true ); //! undo, retrieve beforehand ??
@@ -344,7 +344,7 @@ void ScDBFunc::ToggleAutoFilter()
SCCOL nCol;
SCROW nRow = aParam.nRow1;
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
sal_Int16 nFlag;
bool bHasAuto = true;
bool bHeader = pDBData->HasHeader();
@@ -404,7 +404,7 @@ void ScDBFunc::ToggleAutoFilter()
{
if (!bHeader)
{
- if ( MessBox( GetViewData()->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ if ( MessBox( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), // "StarCalc"
ScGlobal::GetRscString( STR_MSSG_MAKEAUTOFILTER_0 ) // header from first row?
).Execute() == RET_YES )
@@ -433,7 +433,7 @@ void ScDBFunc::ToggleAutoFilter()
}
else
{
- ErrorBox aErrorBox( GetViewData()->GetDialogParent(), WinBits( WB_OK | WB_DEF_OK ),
+ ErrorBox aErrorBox( GetViewData().GetDialogParent(), WinBits( WB_OK | WB_DEF_OK ),
ScGlobal::GetRscString( STR_ERR_AUTOFILTER ) );
aErrorBox.Execute();
}
@@ -443,7 +443,7 @@ void ScDBFunc::ToggleAutoFilter()
{
aModificator.SetDocumentModified();
- SfxBindings& rBindings = GetViewData()->GetBindings();
+ SfxBindings& rBindings = GetViewData().GetBindings();
rBindings.Invalidate( SID_AUTO_FILTER );
rBindings.Invalidate( SID_AUTOFILTER_HIDE );
}
@@ -453,10 +453,10 @@ void ScDBFunc::ToggleAutoFilter()
void ScDBFunc::HideAutoFilter()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScQueryParam aParam;
ScDBData* pDBData = GetDBData( false );
@@ -468,9 +468,9 @@ void ScDBFunc::HideAutoFilter()
for (SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
{
- sal_Int16 nFlag = ((ScMergeFlagAttr*) pDoc->
+ sal_Int16 nFlag = ((ScMergeFlagAttr*) rDoc.
GetAttr( nCol, nRow1, nTab, ATTR_MERGE_FLAG ))->GetValue();
- pDoc->ApplyAttr( nCol, nRow1, nTab, ScMergeFlagAttr( nFlag & ~SC_MF_AUTO ) );
+ rDoc.ApplyAttr( nCol, nRow1, nTab, ScMergeFlagAttr( nFlag & ~SC_MF_AUTO ) );
}
ScRange aRange;
@@ -483,7 +483,7 @@ void ScDBFunc::HideAutoFilter()
pDocSh->PostPaint(ScRange(nCol1, nRow1, nTab, nCol2, nRow1, nTab), PAINT_GRID );
aModificator.SetDocumentModified();
- SfxBindings& rBindings = GetViewData()->GetBindings();
+ SfxBindings& rBindings = GetViewData().GetBindings();
rBindings.Invalidate( SID_AUTO_FILTER );
rBindings.Invalidate( SID_AUTOFILTER_HIDE );
}
@@ -492,8 +492,8 @@ void ScDBFunc::HideAutoFilter()
bool ScDBFunc::ImportData( const ScImportParam& rParam, bool bRecord )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScEditableTester aTester( pDoc, GetViewData()->GetTabNo(), rParam.nCol1,rParam.nRow1,
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScEditableTester aTester( pDoc, GetViewData().GetTabNo(), rParam.nCol1,rParam.nRow1,
rParam.nCol2,rParam.nRow2 );
if ( !aTester.IsEditable() )
{
@@ -501,8 +501,8 @@ bool ScDBFunc::ImportData( const ScImportParam& rParam, bool bRecord )
return false;
}
- ScDBDocFunc aDBDocFunc( *GetViewData()->GetDocShell() );
- return aDBDocFunc.DoImport( GetViewData()->GetTabNo(), rParam, NULL, bRecord );
+ ScDBDocFunc aDBDocFunc( *GetViewData().GetDocShell() );
+ return aDBDocFunc.DoImport( GetViewData().GetTabNo(), rParam, NULL, bRecord );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/dbfunc2.cxx b/sc/source/ui/view/dbfunc2.cxx
index 6261a5460d70..0e3012a4c712 100644
--- a/sc/source/ui/view/dbfunc2.cxx
+++ b/sc/source/ui/view/dbfunc2.cxx
@@ -27,13 +27,13 @@
void ScDBFunc::UpdateCharts( bool bAllCharts )
{
sal_uInt16 nFound = 0;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
if ( pDoc->GetDrawLayer() )
- nFound = DoUpdateCharts( ScAddress( pViewData->GetCurX(),
- pViewData->GetCurY(),
- pViewData->GetTabNo()),
+ nFound = DoUpdateCharts( ScAddress( rViewData.GetCurX(),
+ rViewData.GetCurY(),
+ rViewData.GetTabNo()),
pDoc,
bAllCharts );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 76d6cc2b6b7b..f60471e57491 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -96,9 +96,9 @@ using ::std::vector;
void ScDBFunc::MakeOutline( bool bColumns, bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
aFunc.MakeOutline( aRange, bColumns, bRecord, false );
}
@@ -111,9 +111,9 @@ void ScDBFunc::MakeOutline( bool bColumns, bool bRecord )
void ScDBFunc::RemoveOutline( bool bColumns, bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
aFunc.RemoveOutline( aRange, bColumns, bRecord, false );
}
@@ -131,14 +131,13 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow )
SCCOL nStartCol, nEndCol;
SCROW nStartRow, nEndRow;
SCTAB nStartTab, nEndTab;
- if (GetViewData()->GetSimpleArea(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) == SC_MARK_SIMPLE)
{
SCTAB nTab = nStartTab;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
- ScOutlineArray* pArray;
ScOutlineEntry* pEntry;
SCCOLROW nStart;
SCCOLROW nEnd;
@@ -149,8 +148,8 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow )
if ( !bRowMarked || bColMarked ) // nicht wenn ganze Zeilen markiert
{
- pArray = pTable->GetColArray();
- ScSubOutlineIterator aColIter( pArray );
+ ScOutlineArray& rArray = pTable->GetColArray();
+ ScSubOutlineIterator aColIter( &rArray );
while ((pEntry=aColIter.GetNext()) != NULL && !bColFound)
{
nStart = pEntry->GetStart();
@@ -164,8 +163,8 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow )
if ( !bColMarked || bRowMarked ) // nicht wenn ganze Spalten markiert
{
- pArray = pTable->GetRowArray();
- ScSubOutlineIterator aRowIter( pArray );
+ ScOutlineArray& rArray = pTable->GetRowArray();
+ ScSubOutlineIterator aRowIter( &rArray );
while ((pEntry=aRowIter.GetNext()) != NULL && !bRowFound)
{
nStart = pEntry->GetStart();
@@ -183,8 +182,8 @@ void ScDBFunc::TestRemoveOutline( bool& rCol, bool& rRow )
void ScDBFunc::RemoveAllOutlines( bool bRecord )
{
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
bool bOk = aFunc.RemoveAllOutlines( nTab, bRecord );
@@ -197,16 +196,16 @@ void ScDBFunc::RemoveAllOutlines( bool bRecord )
void ScDBFunc::AutoOutline( bool bRecord )
{
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
ScRange aRange( 0,0,nTab, MAXCOL,MAXROW,nTab ); // ganze Tabelle, wenn nichts markiert
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
rMark.MarkToMulti();
rMark.GetMultiMarkArea( aRange );
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
aFunc.AutoOutline( aRange, bRecord );
}
@@ -215,8 +214,8 @@ void ScDBFunc::AutoOutline( bool bRecord )
void ScDBFunc::SelectLevel( bool bColumns, sal_uInt16 nLevel, bool bRecord, bool bPaint )
{
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
bool bOk = aFunc.SelectLevel( nTab, bColumns, nLevel, bRecord, bPaint );
@@ -229,8 +228,8 @@ void ScDBFunc::SelectLevel( bool bColumns, sal_uInt16 nLevel, bool bRecord, bool
void ScDBFunc::ShowOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, bool bRecord, bool bPaint )
{
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
bool bOk = aFunc.ShowOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint );
@@ -243,8 +242,8 @@ void ScDBFunc::ShowOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
void ScDBFunc::HideOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, bool bRecord, bool bPaint )
{
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
bool bOk = aFunc.HideOutline( nTab, bColumns, nLevel, nEntry, bRecord, bPaint );
@@ -266,22 +265,21 @@ bool ScDBFunc::OutlinePossible(bool bHide)
SCROW nEndRow;
SCTAB nEndTab;
- if (GetViewData()->GetSimpleArea(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) == SC_MARK_SIMPLE)
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
if (pTable)
{
- ScOutlineArray* pArray;
ScOutlineEntry* pEntry;
SCCOLROW nStart;
SCCOLROW nEnd;
// Spalten
- pArray = pTable->GetColArray();
- ScSubOutlineIterator aColIter( pArray );
+ ScOutlineArray& rColArray = pTable->GetColArray();
+ ScSubOutlineIterator aColIter( &rColArray );
while ((pEntry=aColIter.GetNext()) != NULL && !bEnable)
{
nStart = pEntry->GetStart();
@@ -302,8 +300,8 @@ bool ScDBFunc::OutlinePossible(bool bHide)
// Zeilen
- pArray = pTable->GetRowArray();
- ScSubOutlineIterator aRowIter( pArray );
+ ScOutlineArray& rRowArray = pTable->GetRowArray();
+ ScSubOutlineIterator aRowIter( &rRowArray );
while ((pEntry=aRowIter.GetNext()) != NULL)
{
nStart = pEntry->GetStart();
@@ -332,9 +330,9 @@ bool ScDBFunc::OutlinePossible(bool bHide)
void ScDBFunc::ShowMarkedOutlines( bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
bool bDone = aFunc.ShowMarkedOutlines( aRange, bRecord );
if (bDone)
@@ -349,9 +347,9 @@ void ScDBFunc::ShowMarkedOutlines( bool bRecord )
void ScDBFunc::HideMarkedOutlines( bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScOutlineDocFunc aFunc(*pDocSh);
bool bDone = aFunc.HideMarkedOutlines( aRange, bRecord );
if (bDone)
@@ -370,14 +368,14 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
{
bool bDo = !rParam.bRemoveOnly; // sal_False = nur loeschen
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- SCTAB nTab = GetViewData()->GetTabNo();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ SCTAB nTab = GetViewData().GetTabNo();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
- ScDBData* pDBData = pDoc->GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
+ ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rParam.nCol1, rParam.nRow1,
rParam.nCol2, rParam.nRow2 );
if (!pDBData)
{
@@ -385,26 +383,26 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
return;
}
- ScEditableTester aTester( pDoc, nTab, 0,rParam.nRow1+1, MAXCOL,MAXROW );
+ ScEditableTester aTester( &rDoc, nTab, 0,rParam.nRow1+1, MAXCOL,MAXROW );
if (!aTester.IsEditable())
{
ErrorMessage(aTester.GetMessageId());
return;
}
- if (pDoc->HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab,
+ if (rDoc.HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab,
rParam.nCol2, rParam.nRow2, nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ))
{
ErrorMessage(STR_MSSG_INSERTCELLS_0); // nicht in zusammengefasste einfuegen
return;
}
- WaitObject aWait( GetViewData()->GetDialogParent() );
+ WaitObject aWait( GetViewData().GetDialogParent() );
bool bOk = true;
if (rParam.bReplace)
- if (pDoc->TestRemoveSubTotals( nTab, rParam ))
+ if (rDoc.TestRemoveSubTotals( nTab, rParam ))
{
- bOk = ( MessBox( GetViewData()->GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ bOk = ( MessBox( GetViewData().GetDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
// "StarCalc" "Daten loeschen?"
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_1 ) ).Execute()
@@ -424,9 +422,9 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
if (bRecord) // alte Daten sichern
{
bool bOldFilter = bDo && rParam.bDoSort;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nTab );
if (pTable)
{
pUndoTab = new ScOutlineTable( *pTable );
@@ -435,48 +433,48 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
SCCOLROW nOutStartRow;
SCCOLROW nOutEndCol;
SCCOLROW nOutEndRow;
- pTable->GetColArray()->GetRange( nOutStartCol, nOutEndCol );
- pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
+ pTable->GetColArray().GetRange( nOutStartCol, nOutEndCol );
+ pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
- pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, IDF_NONE, false, pUndoDoc );
}
else
- pUndoDoc->InitUndo( pDoc, nTab, nTab, false, bOldFilter );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, bOldFilter );
// Datenbereich sichern - incl. Filter-Ergebnis
- pDoc->CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
+ rDoc.CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab,
IDF_ALL, false, pUndoDoc );
// alle Formeln wegen Referenzen
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
+ rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1,
IDF_FORMULA, false, pUndoDoc );
// DB- und andere Bereiche
- ScRangeName* pDocRange = pDoc->GetRangeName();
+ ScRangeName* pDocRange = rDoc.GetRangeName();
if (!pDocRange->empty())
pUndoRange = new ScRangeName( *pDocRange );
- ScDBCollection* pDocDB = pDoc->GetDBCollection();
+ ScDBCollection* pDocDB = rDoc.GetDBCollection();
if (!pDocDB->empty())
pUndoDB = new ScDBCollection( *pDocDB );
}
- ScOutlineTable* pOut = pDoc->GetOutlineTable( nTab );
+ ScOutlineTable* pOut = rDoc.GetOutlineTable( nTab );
if (pOut)
{
// Remove all existing outlines in the specified range.
- ScOutlineArray* pRowArray = pOut->GetRowArray();
- sal_uInt16 nDepth = pRowArray->GetDepth();
+ ScOutlineArray& rRowArray = pOut->GetRowArray();
+ sal_uInt16 nDepth = rRowArray.GetDepth();
for (sal_uInt16 i = 0; i < nDepth; ++i)
{
bool bSize;
- pRowArray->Remove(aNewParam.nRow1, aNewParam.nRow2, bSize);
+ rRowArray.Remove(aNewParam.nRow1, aNewParam.nRow2, bSize);
}
}
if (rParam.bReplace)
- pDoc->RemoveSubTotals( nTab, aNewParam );
+ rDoc.RemoveSubTotals( nTab, aNewParam );
bool bSuccess = true;
if (bDo)
{
@@ -494,11 +492,11 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
Sort( aSortParam, false, false );
}
- bSuccess = pDoc->DoSubTotals( nTab, aNewParam );
+ bSuccess = rDoc.DoSubTotals( nTab, aNewParam );
}
ScRange aDirtyRange( aNewParam.nCol1, aNewParam.nRow1, nTab,
aNewParam.nCol2, aNewParam.nRow2, nTab );
- pDoc->SetDirty( aDirtyRange );
+ rDoc.SetDirty( aDirtyRange );
if (bRecord)
{
@@ -518,7 +516,7 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
// merken
pDBData->SetSubTotalParam( aNewParam );
pDBData->SetArea( nTab, aNewParam.nCol1,aNewParam.nRow1, aNewParam.nCol2,aNewParam.nRow2 );
- pDoc->CompileDBFormula();
+ rDoc.CompileDBFormula();
DoneBlockMode();
InitOwnBlockMode();
@@ -541,7 +539,7 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
void ScDBFunc::Consolidate( const ScConsolidateParam& rParam, bool bRecord )
{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
pDocShell->DoConsolidate( rParam, bRecord );
SetTabNo( rParam.nTab, true );
}
@@ -569,14 +567,14 @@ bool ScDBFunc::MakePivotTable(
return false;
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument* pDoc = GetViewData().GetDocument();
bool bUndo = pDoc->IsUndoEnabled();
ScRange aDestRange = rDest;
if ( bNewTable )
{
- SCTAB nSrcTab = GetViewData()->GetTabNo();
+ SCTAB nSrcTab = GetViewData().GetTabNo();
OUString aName( ScGlobal::GetRscString(STR_PIVOT_TABLE) );
OUString aStr;
@@ -599,7 +597,7 @@ bool ScDBFunc::MakePivotTable(
new ScUndoInsertTab( pDocSh, nNewTab, bAppend, lcl_MakePivotTabName( aName, i ) ));
}
- GetViewData()->InsertTab( nNewTab );
+ GetViewData().InsertTab( nNewTab );
SetTabNo(nNewTab, true);
aDestRange = ScRange( 0, 0, nNewTab );
@@ -645,11 +643,11 @@ bool ScDBFunc::MakePivotTable(
void ScDBFunc::DeletePivotTable()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScDPObject* pDPObj = pDoc->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScDPObject* pDPObj = rDoc.GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() );
if ( pDPObj )
{
ScDBDocFunc aFunc( *pDocSh );
@@ -662,12 +660,12 @@ void ScDBFunc::DeletePivotTable()
void ScDBFunc::RecalcPivotTable()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument* pDoc = GetViewData().GetDocument();
- ScDPObject* pDPObj = pDoc->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = pDoc->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() );
if (pDPObj)
{
// Remove existing data cache for the data that this datapilot uses,
@@ -683,8 +681,8 @@ void ScDBFunc::RecalcPivotTable()
void ScDBFunc::GetSelectedMemberList(ScDPUniqueStringSet& rEntries, long& rDimension)
{
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if ( !pDPObj )
return;
@@ -693,7 +691,7 @@ void ScDBFunc::GetSelectedMemberList(ScDPUniqueStringSet& rEntries, long& rDimen
long nStartLevel = -1;
ScRangeListRef xRanges;
- GetViewData()->GetMultiArea( xRanges ); // incl. cursor if nothing is selected
+ GetViewData().GetMultiArea( xRanges ); // incl. cursor if nothing is selected
size_t nRangeCount = xRanges->size();
bool bContinue = true;
@@ -749,10 +747,10 @@ bool ScDBFunc::HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32&
bool bFound = false;
- SCCOL nCurX = GetViewData()->GetCurX();
- SCROW nCurY = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( nCurX, nCurY, nTab );
if ( pDPObj )
@@ -827,7 +825,7 @@ bool ScDBFunc::HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32&
// in a normal dimension with date content
ScRange aSelRange;
- if ( (GetViewData()->GetSimpleArea( aSelRange ) == SC_MARK_SIMPLE) &&
+ if ( (GetViewData().GetSimpleArea( aSelRange ) == SC_MARK_SIMPLE) &&
aSelRange.aStart == aSelRange.aEnd )
{
SCCOL nSelCol = aSelRange.aStart.Col();
@@ -862,10 +860,10 @@ bool ScDBFunc::HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo )
bool bFound = false;
- SCCOL nCurX = GetViewData()->GetCurX();
- SCROW nCurY = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( nCurX, nCurY, nTab );
if ( pDPObj )
@@ -903,7 +901,7 @@ bool ScDBFunc::HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo )
// in a normal dimension with numeric content
ScRange aSelRange;
- if ( (GetViewData()->GetSimpleArea( aSelRange ) == SC_MARK_SIMPLE) &&
+ if ( (GetViewData().GetSimpleArea( aSelRange ) == SC_MARK_SIMPLE) &&
aSelRange.aStart == aSelRange.aEnd )
{
if ( pDoc->HasValueData( aSelRange.aStart.Col(), aSelRange.aStart.Row(),
@@ -926,8 +924,8 @@ bool ScDBFunc::HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo )
void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts )
{
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if (!pDPObj)
return;
@@ -1016,7 +1014,7 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
}
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
pDPObj->SetSaveData( aData );
aFunc.RefreshPivotTableGroups(pDPObj);
@@ -1026,8 +1024,8 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
void ScDBFunc::NumGroupDataPilot( const ScDPNumGroupInfo& rInfo )
{
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if (!pDPObj)
return;
@@ -1058,7 +1056,7 @@ void ScDBFunc::NumGroupDataPilot( const ScDPNumGroupInfo& rInfo )
}
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
pDPObj->SetSaveData( aData );
aFunc.RefreshPivotTableGroups(pDPObj);
@@ -1068,8 +1066,8 @@ void ScDBFunc::NumGroupDataPilot( const ScDPNumGroupInfo& rInfo )
void ScDBFunc::GroupDataPilot()
{
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if (!pDPObj)
return;
@@ -1198,7 +1196,7 @@ void ScDBFunc::GroupDataPilot()
}
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
pDPObj->SetSaveData( aData );
aFunc.RefreshPivotTableGroups(pDPObj);
@@ -1208,8 +1206,8 @@ void ScDBFunc::GroupDataPilot()
void ScDBFunc::UngroupDataPilot()
{
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if (!pDPObj)
return;
@@ -1274,7 +1272,7 @@ void ScDBFunc::UngroupDataPilot()
}
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
pDPObj->SetSaveData( aData );
aFunc.RefreshPivotTableGroups(pDPObj);
@@ -1331,7 +1329,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
{
using namespace ::com::sun::star::sheet;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( rPos.Col(), rPos.Row(), rPos.Tab() );
if (!pDPObj)
return;
@@ -1585,7 +1583,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
if ( bChange )
{
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
pDPObj->SetSaveData( aData );
aFunc.UpdatePivotTable(*pDPObj, true, false);
}
@@ -1624,7 +1622,7 @@ struct ScOUStringCollate
bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor(rPos.Col(), rPos.Row(), rPos.Tab());
if (!pDPObj)
return false;
@@ -1760,7 +1758,7 @@ bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16
boost::scoped_ptr<ScDPObject> pNewObj(new ScDPObject(*pDPObj));
pNewObj->SetSaveData(aNewSaveData);
- ScDBDocFunc aFunc(*GetViewData()->GetDocShell());
+ ScDBDocFunc aFunc(*GetViewData().GetDocShell());
return aFunc.DataPilotUpdate(pDPObj, pNewObj.get(), true, false);
}
@@ -1768,7 +1766,7 @@ bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16
bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest )
{
bool bRet = false;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDPObject* pDPObj = pDoc->GetDPAtCursor( rSource.aStart.Col(), rSource.aStart.Row(), rSource.aStart.Tab() );
if ( pDPObj && pDPObj == pDoc->GetDPAtCursor( rDest.Col(), rDest.Row(), rDest.Tab() ) )
{
@@ -1845,7 +1843,7 @@ bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest )
pDim->SetSortInfo( &aSortInfo );
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
boost::scoped_ptr<ScDPObject> pNewObj(new ScDPObject( *pDPObj ));
pNewObj->SetSaveData( aData );
aFunc.DataPilotUpdate( pDPObj, pNewObj.get(), true, false ); //! bApi for drag&drop?
@@ -1865,8 +1863,8 @@ bool ScDBFunc::HasSelectionForDrillDown( sal_uInt16& rOrientation )
{
bool bRet = false;
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if ( pDPObj )
{
ScDPUniqueStringSet aEntries;
@@ -1900,8 +1898,8 @@ bool ScDBFunc::HasSelectionForDrillDown( sal_uInt16& rOrientation )
void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName)
{
- ScDPObject* pDPObj = GetViewData()->GetDocument()->GetDPAtCursor( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScDPObject* pDPObj = GetViewData().GetDocument()->GetDPAtCursor( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
if ( pDPObj )
{
ScDPUniqueStringSet aEntries;
@@ -1974,7 +1972,7 @@ void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName
}
// apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ ScDBDocFunc aFunc( *GetViewData().GetDocShell() );
boost::scoped_ptr<ScDPObject> pNewObj(new ScDPObject( *pDPObj ));
pNewObj->SetSaveData( aData );
aFunc.DataPilotUpdate( pDPObj, pNewObj.get(), true, false );
@@ -1989,7 +1987,7 @@ void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName
void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet::DataPilotFieldFilter>& rFilters )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if (pDoc->GetDocumentShell()->IsReadOnly())
{
ErrorMessage(STR_READONLYERR);
@@ -2010,7 +2008,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
sal_Int32 nColSize = aTabData[0].getLength();
- SCTAB nNewTab = GetViewData()->GetTabNo();
+ SCTAB nNewTab = GetViewData().GetTabNo();
boost::scoped_ptr<ScDocument> pInsDoc(new ScDocument(SCDOCMODE_CLIP));
pInsDoc->ResetClip( pDoc, nNewTab );
@@ -2058,7 +2056,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
pInsDoc->GetCellArea( nNewTab, nEndCol, nEndRow );
pInsDoc->SetClipArea( ScRange( 0, 0, nNewTab, nEndCol, nEndRow, nNewTab ) );
- ::svl::IUndoManager* pMgr = GetViewData()->GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = GetViewData().GetDocShell()->GetUndoManager();
OUString aUndo = ScGlobal::GetRscString( STR_UNDO_DOOUTLINE );
pMgr->EnterListAction( aUndo, aUndo );
@@ -2076,10 +2074,10 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
void ScDBFunc::RepeatDB( bool bRecord )
{
- SCCOL nCurX = GetViewData()->GetCurX();
- SCROW nCurY = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScDBData* pDBData = GetDBData();
if (bRecord && !pDoc->IsUndoEnabled())
bRecord = false;
@@ -2139,8 +2137,8 @@ void ScDBFunc::RepeatDB( bool bRecord )
SCCOLROW nOutStartRow;
SCCOLROW nOutEndCol;
SCCOLROW nOutEndRow;
- pTable->GetColArray()->GetRange( nOutStartCol, nOutEndCol );
- pTable->GetRowArray()->GetRange( nOutStartRow, nOutEndRow );
+ pTable->GetColArray().GetRange( nOutStartCol, nOutEndCol );
+ pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow );
pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, IDF_NONE, false, pUndoDoc );
@@ -2224,8 +2222,8 @@ void ScDBFunc::RepeatDB( bool bRecord )
}
}
- GetViewData()->GetDocShell()->GetUndoManager()->AddUndoAction(
- new ScUndoRepeatDB( GetViewData()->GetDocShell(), nTab,
+ GetViewData().GetDocShell()->GetUndoManager()->AddUndoAction(
+ new ScUndoRepeatDB( GetViewData().GetDocShell(), nTab,
nStartCol, nStartRow, nEndCol, nEndRow,
nNewEndRow,
nCurX, nCurY,
@@ -2234,7 +2232,7 @@ void ScDBFunc::RepeatDB( bool bRecord )
pOld, pNew ) );
}
- GetViewData()->GetDocShell()->PostPaint(
+ GetViewData().GetDocShell()->PostPaint(
ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab),
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE);
}
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index d5e280d66a1c..ab48a9ceec16 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -371,8 +371,8 @@ void ScDrawView::DoCopy()
// Copy data referenced by the chart objects to the draw clip
// document. We need to do this before GetMarkedObjModel() below.
ScDocShellRef xDocSh = *ScGlobal::pDrawClipDocShellRef;
- ScDocument* pClipDoc = xDocSh->GetDocument();
- copyChartRefDataToClipDoc(pDoc, pClipDoc, aRanges);
+ ScDocument& rClipDoc = xDocSh->GetDocument();
+ copyChartRefDataToClipDoc(pDoc, &rClipDoc, aRanges);
}
SdrModel* pModel = GetMarkedObjModel();
ScDrawLayer::SetGlobalDrawPersist(NULL);
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index a0817d8bc512..900b21d9b345 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -151,9 +151,9 @@ ScFormatShell::~ScFormatShell()
void ScFormatShell::GetStyleState( SfxItemSet& rSet )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
- SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
+ SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool();
bool bProtected = false;
SCTAB nTabCount = pDoc->GetTableCount();
@@ -264,12 +264,12 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
const SCTAB nCurTab = GetViewData()->GetTabNo();
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScTabViewShell* pTabViewShell= GetViewData()->GetViewShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScMarkData& rMark = GetViewData()->GetMarkData();
ScModule* pScMod = SC_MOD();
OUString aRefName;
- bool bUndo = pDoc->IsUndoEnabled();
- SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool();
+ bool bUndo = rDoc.IsUndoEnabled();
+ SfxStyleSheetBasePool* pStylePool = rDoc.GetStyleSheetPool();
if ( (nSlotId == SID_STYLE_PREVIEW)
|| (nSlotId == SID_STYLE_END_PREVIEW) )
@@ -287,7 +287,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( eFamily == SFX_STYLE_FAMILY_PARA ) // CellStyles
{
ScMarkData aFuncMark( pViewData->GetMarkData() );
- ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
+ ScViewUtil::UnmarkFiltered( aFuncMark, &rDoc );
aFuncMark.MarkToMulti();
if ( !aFuncMark.IsMarked() && !aFuncMark.IsMultiMarked() )
@@ -298,10 +298,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
ScRange aRange( nCol, nRow, nTab );
aFuncMark.SetMarkArea( aRange );
}
- pDoc->SetPreviewSelection( aFuncMark );
+ rDoc.SetPreviewSelection( aFuncMark );
ScStyleSheet* pPreviewStyle = static_cast<ScStyleSheet*>( pStylePool->Find( aStyleName, eFamily ) );
- pDoc->SetPreviewCellStyle( pPreviewStyle );
- ScPatternAttr aAttr( *pDoc->GetSelectionPattern( aFuncMark ) );
+ rDoc.SetPreviewCellStyle( pPreviewStyle );
+ ScPatternAttr aAttr( *rDoc.GetSelectionPattern( aFuncMark ) );
aAttr.SetStyleSheet( pPreviewStyle );
SfxItemSet aItemSet( GetPool() );
@@ -310,7 +310,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SfxItemSet& rNewSet = aNewAttrs.GetItemSet();
rNewSet.Put( aItemSet, false );
- pDoc->ApplySelectionPattern( aNewAttrs, pDoc->GetPreviewSelection() );
+ rDoc.ApplySelectionPattern( aNewAttrs, rDoc.GetPreviewSelection() );
pTabViewShell->UpdateSelectionArea( aFuncMark, &aAttr );
}
}
@@ -319,20 +319,20 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// No mark at all happens when creating a new document, in which
// case the selection pattern obtained would be empty (created of
// GetPool()) anyway and nothing needs to be applied.
- ScMarkData aPreviewMark( pDoc->GetPreviewSelection());
+ ScMarkData aPreviewMark( rDoc.GetPreviewSelection());
if (aPreviewMark.IsMarked() || aPreviewMark.IsMultiMarked())
{
- ScPatternAttr aAttr( *pDoc->GetSelectionPattern( aPreviewMark ) );
- if ( ScStyleSheet* pPreviewStyle = pDoc->GetPreviewCellStyle() )
+ ScPatternAttr aAttr( *rDoc.GetSelectionPattern( aPreviewMark ) );
+ if ( ScStyleSheet* pPreviewStyle = rDoc.GetPreviewCellStyle() )
aAttr.SetStyleSheet( pPreviewStyle );
- pDoc->SetPreviewCellStyle(NULL);
+ rDoc.SetPreviewCellStyle(NULL);
SfxItemSet aItemSet( GetPool() );
ScPatternAttr aNewAttrs( GetViewData()->GetDocument()->GetPool() );
SfxItemSet& rNewSet = aNewAttrs.GetItemSet();
rNewSet.Put( aItemSet, false );
- pDoc->ApplySelectionPattern( aNewAttrs, aPreviewMark );
+ rDoc.ApplySelectionPattern( aNewAttrs, aPreviewMark );
pTabViewShell->UpdateSelectionArea( aPreviewMark, &aAttr );
}
}
@@ -554,7 +554,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// ScViewData* pViewData = GetViewData();
SCCOL nCol = pViewData->GetCurX();
SCROW nRow = pViewData->GetCurY();
- pAttrItem = pDoc->GetPattern( nCol, nRow, nCurTab );
+ pAttrItem = rDoc.GetPattern( nCol, nRow, nCurTab );
SfxItemSet aAttrSet = pAttrItem->GetItemSet();
aAttrSet.ClearItem( ATTR_MERGE );
@@ -592,7 +592,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// enthalten.
//!!! bei Gelenheit mal eine Methode, die
// das fuer einen bestimmten Style macht
- pDoc->StylesToNames();
+ rDoc.StylesToNames();
bConvertBack = true;
pStylePool->Remove(pStyleSheet);
}
@@ -608,9 +608,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( bConvertBack )
// Namen zu Style-Pointer
- pDoc->UpdStlShtPtrsFrmNms();
+ rDoc.UpdStlShtPtrsFrmNms();
else
- pDoc->GetPool()->CellStyleCreated( aStyleName );
+ rDoc.GetPool()->CellStyleCreated( aStyleName );
// Attribute uebernehmen und Style anwenden
pStyleSheet->GetItemSet().Put( aAttrSet );
@@ -665,7 +665,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
nRetMask = sal_uInt16( NULL != pStyleSheet );
if ( pStyleSheet )
{
- if ( pDoc->RemovePageStyleInUse( pStyleSheet->GetName() ) )
+ if ( rDoc.RemovePageStyleInUse( pStyleSheet->GetName() ) )
{
ScPrintFunc( pDocSh, pTabViewShell->GetPrinter(true), nCurTab ).UpdatePages();
rBindings.Invalidate( SID_STATUS_PAGESTYLE );
@@ -700,14 +700,14 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( pStyleSheet && !pScMod->GetIsWaterCan() )
{
ScUndoApplyPageStyle* pUndoAction = 0;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
- OUString aOldName = pDoc->GetPageStyle( *itr );
+ OUString aOldName = rDoc.GetPageStyle( *itr );
if ( aOldName != aStyleName )
{
- pDoc->SetPageStyle( *itr, aStyleName );
+ rDoc.SetPageStyle( *itr, aStyleName );
ScPrintFunc( pDocSh, pTabViewShell->GetPrinter(true), *itr ).UpdatePages();
if( !pUndoAction )
pUndoAction = new ScUndoApplyPageStyle( pDocSh, aStyleName );
@@ -729,14 +729,14 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
case SID_STYLE_NEW_BY_EXAMPLE:
{
- const OUString& rStrCurStyle = pDoc->GetPageStyle( nCurTab );
+ const OUString& rStrCurStyle = rDoc.GetPageStyle( nCurTab );
if ( rStrCurStyle != aStyleName )
{
SfxStyleSheetBase* pCurStyle = pStylePool->Find( rStrCurStyle, eFamily );
SfxItemSet aAttrSet = pCurStyle->GetItemSet();
SCTAB nInTab;
- bool bUsed = pDoc->IsPageStyleInUse( aStyleName, &nInTab );
+ bool bUsed = rDoc.IsPageStyleInUse( aStyleName, &nInTab );
// wenn bereits vorhanden, erstmal entfernen...
if ( pStyleSheet )
@@ -807,7 +807,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
LanguageType eLang =
((SvxLanguageItem*)&rSet.Get(
ATTR_LANGUAGE_FORMAT ))->GetLanguage();
- sal_uLong nLangFormat = pDoc->GetFormatTable()->
+ sal_uLong nLangFormat = rDoc.GetFormatTable()->
GetFormatForLanguageIfBuiltIn( nFormat, eLang );
if ( nLangFormat != nFormat )
{
@@ -820,7 +820,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
boost::scoped_ptr<SvxNumberInfoItem> pNumberInfoItem(
- pTabViewShell->MakeNumberInfoItem(pDoc, GetViewData()));
+ pTabViewShell->MakeNumberInfoItem(&rDoc, GetViewData()));
pDocSh->PutItem( *pNumberInfoItem );
nRsc = RID_SCDLG_STYLES_PAR;
@@ -886,12 +886,12 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
bool bNumFormatChanged;
if ( ScGlobal::CheckWidthInvalidate(
bNumFormatChanged, aOldSet, rNewSet ) )
- pDoc->InvalidateTextWidth( NULL, NULL, bNumFormatChanged );
+ rDoc.InvalidateTextWidth( NULL, NULL, bNumFormatChanged );
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if (pDoc->IsStreamValid(nTab))
- pDoc->SetStreamValid(nTab, false);
+ if (rDoc.IsStreamValid(nTab))
+ rDoc.SetStreamValid(nTab, false);
sal_uLong nOldFormat = ((const SfxUInt32Item&)aOldSet.
Get( ATTR_VALUE_FORMAT )).GetValue();
@@ -899,7 +899,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
Get( ATTR_VALUE_FORMAT )).GetValue();
if ( nNewFormat != nOldFormat )
{
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
const SvNumberformat* pOld = pFormatter->GetEntry( nOldFormat );
const SvNumberformat* pNew = pFormatter->GetEntry( nNewFormat );
if ( pOld && pNew && pOld->GetLanguage() != pNew->GetLanguage() )
@@ -907,7 +907,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
pNew->GetLanguage(), ATTR_LANGUAGE_FORMAT ) );
}
- pDoc->GetPool()->CellStyleCreated( pStyleSheet->GetName() );
+ rDoc.GetPool()->CellStyleCreated( pStyleSheet->GetName() );
}
else
{
@@ -915,13 +915,13 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
OUString aNewName = pStyleSheet->GetName();
if ( aNewName != aOldName &&
- pDoc->RenamePageStyleInUse( aOldName, aNewName ) )
+ rDoc.RenamePageStyleInUse( aOldName, aNewName ) )
{
rBindings.Invalidate( SID_STATUS_PAGESTYLE );
rBindings.Invalidate( FID_RESET_PRINTZOOM );
}
- pDoc->ModifyStyleSheet( *pStyleSheet, *pOutSet );
+ rDoc.ModifyStyleSheet( *pStyleSheet, *pOutSet );
rBindings.Invalidate( FID_RESET_PRINTZOOM );
}
@@ -1604,10 +1604,10 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
- ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
+ ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
SfxBindings& rBindings = pViewData->GetBindings();
const SfxItemSet* pNewAttrs = rReq.GetArgs();
- sal_uInt16 nSlot = rReq.GetSlot();
+ sal_uInt16 nSlot = rReq.GetSlot();
pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox
ScDocument* pDoc = GetViewData()->GetDocument();
@@ -2414,7 +2414,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
// sal_uLong nNumberFormat = ((const SfxUInt32Item&)rAttrSet.Get(
// ATTR_VALUE_FORMAT )).GetValue();
//
- // SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ // SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
// const SvNumberformat* pFormatEntry = pFormatter->GetEntry( nNumberFormat );
// if ( pFormatEntry )
// aFormatCode = pFormatEntry->GetFormatstring();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 219f79442a1c..20d2558439a1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2129,7 +2129,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScViewFunc* pView = pViewData->GetView();
pView->StopRefMode();
pViewData->ResetFillMode();
- pView->GetFunctionSet()->SetAnchorFlag( false ); // #i5819# don't use AutoFill anchor flag for selection
+ pView->GetFunctionSet().SetAnchorFlag( false ); // #i5819# don't use AutoFill anchor flag for selection
if ( bIsDel )
{
@@ -2165,7 +2165,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScTabView* pView = pViewData->GetView();
pView->StopRefMode();
pViewData->ResetFillMode();
- pView->GetFunctionSet()->SetAnchorFlag( false );
+ pView->GetFunctionSet().SetAnchorFlag( false );
if ( aEndPos != aBlockRange.aEnd )
{
@@ -2179,7 +2179,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScTabView* pView = pViewData->GetView();
pView->StopRefMode();
pViewData->ResetFillMode();
- pView->GetFunctionSet()->SetAnchorFlag( false );
+ pView->GetFunctionSet().SetAnchorFlag( false );
pViewData->GetDocShell()->UpdateOle(pViewData);
}
@@ -4653,14 +4653,14 @@ void ScGridWindow::UpdateFormulas()
SCROW nPosY = nY1;
ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
- pDoc->ExtendHidden( nX1, nY1, nX2, nY2, nTab );
+ rDoc.ExtendHidden( nX1, nY1, nX2, nY2, nTab );
Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
long nMirrorWidth = GetSizePixel().Width();
- bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
if ( bLayoutRTL )
{
long nEndPixel = pViewData->GetScrPos( nX2+1, nPosY, eWhich ).X();
@@ -4675,11 +4675,11 @@ void ScGridWindow::UpdateFormulas()
double nPPTY = pViewData->GetPPTY();
ScTableInfo aTabInfo;
- pDoc->FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab, nPPTX, nPPTY, false, false );
+ rDoc.FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab, nPPTX, nPPTY, false, false );
Fraction aZoomX = pViewData->GetZoomX();
Fraction aZoomY = pViewData->GetZoomY();
- ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, pDoc, nTab,
+ ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab,
nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY,
&aZoomX, &aZoomY );
aOutputData.SetMirrorWidth( nMirrorWidth );
@@ -4897,18 +4897,18 @@ static void lcl_PaintOneRange( ScDocShell* pDocSh, const ScRange& rRange, sal_uI
bool bHiddenEdge = false;
SCROW nTmp;
- ScDocument* pDoc = pDocSh->GetDocument();
- while ( nCol1 > 0 && pDoc->ColHidden(nCol1, nTab1) )
+ ScDocument& rDoc = pDocSh->GetDocument();
+ while ( nCol1 > 0 && rDoc.ColHidden(nCol1, nTab1) )
{
--nCol1;
bHiddenEdge = true;
}
- while ( nCol2 < MAXCOL && pDoc->ColHidden(nCol2, nTab1) )
+ while ( nCol2 < MAXCOL && rDoc.ColHidden(nCol2, nTab1) )
{
++nCol2;
bHiddenEdge = true;
}
- nTmp = pDoc->FirstVisibleRow(0, nRow1, nTab1);
+ nTmp = rDoc.FirstVisibleRow(0, nRow1, nTab1);
if (!ValidRow(nTmp))
nTmp = 0;
if (nTmp < nRow1)
@@ -4916,7 +4916,7 @@ static void lcl_PaintOneRange( ScDocShell* pDocSh, const ScRange& rRange, sal_uI
nRow1 = nTmp;
bHiddenEdge = true;
}
- nTmp = pDoc->FirstVisibleRow(nRow2, MAXROW, nTab1);
+ nTmp = rDoc.FirstVisibleRow(nRow2, MAXROW, nTab1);
if (!ValidRow(nTmp))
nTmp = MAXROW;
if (nTmp > nRow2)
@@ -4953,9 +4953,9 @@ static void lcl_PaintRefChanged( ScDocShell* pDocSh, const ScRange& rOldUn, cons
aNew.Justify();
if ( aOld.aStart == aOld.aEnd ) //! Tab ignorieren?
- pDocSh->GetDocument()->ExtendMerge(aOld);
+ pDocSh->GetDocument().ExtendMerge(aOld);
if ( aNew.aStart == aNew.aEnd ) //! Tab ignorieren?
- pDocSh->GetDocument()->ExtendMerge(aNew);
+ pDocSh->GetDocument().ExtendMerge(aNew);
SCCOL nOldCol1 = aOld.aStart.Col();
SCROW nOldRow1 = aOld.aStart.Row();
@@ -5193,9 +5193,9 @@ SvxAdjust toSvxAdjust( const ScPatternAttr& rPat )
boost::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const ScPatternAttr& rPat )
{
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
- boost::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(pDoc, pDoc->GetEditPool()));
+ boost::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool()));
ScSizeDeviceProvider aProv(pDocSh);
pEngine->SetRefDevice(aProv.GetDevice());
pEngine->SetRefMapMode(MAP_100TH_MM);
@@ -5251,14 +5251,14 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
SCTAB nTab = pViewData->GetTabNo();
ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
OUString sURL;
ScRefCellValue aCell;
- bool bFound = lcl_GetHyperlinkCell(pDoc, nPosX, nPosY, nTab, aCell, sURL);
+ bool bFound = lcl_GetHyperlinkCell(&rDoc, nPosX, nPosY, nTab, aCell, sURL);
if( !bFound )
return false;
- const ScPatternAttr* pPattern = pDoc->GetPattern( nPosX, nPosY, nTab );
+ const ScPatternAttr* pPattern = rDoc.GetPattern( nPosX, nPosY, nTab );
// bForceToTop = sal_False, use the cell's real position
Rectangle aEditRect = pViewData->GetEditArea( eWhich, nPosX, nPosY, this, pPattern, false );
if (rPos.Y() < aEditRect.Top())
@@ -5309,7 +5309,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
if (sURL.isEmpty())
pTextObj.reset(aCell.mpFormula->CreateURLObject());
else
- pTextObj.reset(ScEditUtil::CreateURLObjectFromURL(*pDoc, sURL, sURL));
+ pTextObj.reset(ScEditUtil::CreateURLObjectFromURL(rDoc, sURL, sURL));
if (pTextObj.get())
pEngine->SetText(*pTextObj);
@@ -5366,11 +5366,11 @@ bool ScGridWindow::IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCCOL nCol
SCTAB nTab = pViewData->GetTabNo();
ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScAddress aCellPos(nCol1, nRow, nTab);
ScRefCellValue aCell;
- aCell.assign(*pDoc, aCellPos);
+ aCell.assign(rDoc, aCellPos);
if (aCell.meType != CELLTYPE_STRING && aCell.meType != CELLTYPE_EDIT)
return false;
@@ -5378,7 +5378,7 @@ bool ScGridWindow::IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCCOL nCol
if (!pRanges)
return false;
- const ScPatternAttr* pPattern = pDoc->GetPattern(nCol1, nRow, nTab);
+ const ScPatternAttr* pPattern = rDoc.GetPattern(nCol1, nRow, nTab);
Rectangle aEditRect = pViewData->GetEditArea(eWhich, nCol1, nRow, this, pPattern, false);
if (rPos.Y() < aEditRect.Top())
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index d308eee6a2b7..9c79f0c7372e 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -926,9 +926,9 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
{
ScViewFunc* pViewFunc = pViewData->GetView();
ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
- bool bUndo (pDoc->IsUndoEnabled());
+ bool bUndo (rDoc.IsUndoEnabled());
if ( bBreak )
{
@@ -945,7 +945,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
bool bGrow = !bHide && nNew > nPagebreakBreak;
if ( bColumn )
{
- if (pDoc->HasColBreak(static_cast<SCCOL>(nPagebreakBreak), nTab) & BREAK_MANUAL)
+ if (rDoc.HasColBreak(static_cast<SCCOL>(nPagebreakBreak), nTab) & BREAK_MANUAL)
{
ScAddress aOldAddr( static_cast<SCCOL>(nPagebreakBreak), nPosY, nTab );
pViewFunc->DeletePageBreak( true, true, &aOldAddr, false );
@@ -958,7 +958,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
if ( bGrow )
{
// vorigen Break auf hart, und Skalierung aendern
- bool bManualBreak = (pDoc->HasColBreak(static_cast<SCCOL>(nPagebreakPrev), nTab) & BREAK_MANUAL);
+ bool bManualBreak = (rDoc.HasColBreak(static_cast<SCCOL>(nPagebreakPrev), nTab) & BREAK_MANUAL);
if ( static_cast<SCCOL>(nPagebreakPrev) > aPagebreakSource.aStart.Col() && !bManualBreak )
{
ScAddress aPrev( static_cast<SCCOL>(nPagebreakPrev), nPosY, nTab );
@@ -972,7 +972,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
}
else
{
- if (pDoc->HasRowBreak(nPagebreakBreak, nTab) & BREAK_MANUAL)
+ if (rDoc.HasRowBreak(nPagebreakBreak, nTab) & BREAK_MANUAL)
{
ScAddress aOldAddr( nPosX, nPagebreakBreak, nTab );
pViewFunc->DeletePageBreak( false, true, &aOldAddr, false );
@@ -985,7 +985,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
if ( bGrow )
{
// vorigen Break auf hart, und Skalierung aendern
- bool bManualBreak = (pDoc->HasRowBreak(nPagebreakPrev, nTab) & BREAK_MANUAL);
+ bool bManualBreak = (rDoc.HasRowBreak(nPagebreakPrev, nTab) & BREAK_MANUAL);
if ( nPagebreakPrev > aPagebreakSource.aStart.Row() && !bManualBreak )
{
ScAddress aPrev( nPosX, nPagebreakPrev, nTab );
@@ -1015,12 +1015,12 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
// Druckbereich setzen
OUString aNewRanges;
- sal_uInt16 nOldCount = pDoc->GetPrintRangeCount( nTab );
+ sal_uInt16 nOldCount = rDoc.GetPrintRangeCount( nTab );
if ( nOldCount )
{
for (sal_uInt16 nPos=0; nPos<nOldCount; nPos++)
{
- const ScRange* pOld = pDoc->GetPrintRange( nTab, nPos );
+ const ScRange* pOld = rDoc.GetPrintRange( nTab, nPos );
if ( pOld )
{
OUString aTemp;
@@ -1040,7 +1040,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, bool bUp )
else if (!bHide)
aNewRanges = aPagebreakDrag.Format(SCA_VALID);
- pViewFunc->SetPrintRanges( pDoc->IsPrintEntireSheet( nTab ), &aNewRanges, NULL, NULL, false );
+ pViewFunc->SetPrintRanges( rDoc.IsPrintEntireSheet( nTab ), &aNewRanges, NULL, NULL, false );
}
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 69de77b6ebcf..d31da8a24148 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -416,14 +416,14 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
++nPaintCount; // merken, dass gemalt wird (wichtig beim Invertieren)
ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
- pDoc->ExtendHidden( nX1, nY1, nX2, nY2, nTab );
+ rDoc.ExtendHidden( nX1, nY1, nX2, nY2, nTab );
Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
long nMirrorWidth = GetSizePixel().Width();
- bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
long nLayoutSign = bLayoutRTL ? -1 : 1;
if ( bLayoutRTL )
{
@@ -439,7 +439,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
SCROW nCurY = pViewData->GetCurY();
SCCOL nCurEndX = nCurX;
SCROW nCurEndY = nCurY;
- pDoc->ExtendMerge( nCurX, nCurY, nCurEndX, nCurEndY, nTab );
+ rDoc.ExtendMerge( nCurX, nCurY, nCurEndX, nCurEndY, nTab );
bool bCurVis = nCursorHideCount==0 &&
( nCurEndX+1 >= nX1 && nCurX <= nX2+1 && nCurEndY+1 >= nY1 && nCurY <= nY2+1 );
@@ -449,7 +449,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
SCCOL nHdlX = aAutoMarkPos.Col();
SCROW nHdlY = aAutoMarkPos.Row();
- pDoc->ExtendMerge( nHdlX, nHdlY, nHdlX, nHdlY, nTab );
+ rDoc.ExtendMerge( nHdlX, nHdlY, nHdlX, nHdlY, nTab );
bCurVis = ( nHdlX+1 >= nX1 && nHdlX <= nX2 && nHdlY+1 >= nY1 && nHdlY <= nY2 );
// links und oben ist nicht betroffen
@@ -466,13 +466,13 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
// Datenblock
ScTableInfo aTabInfo;
- pDoc->FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab,
+ rDoc.FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab,
nPPTX, nPPTY, false, bFormulaMode,
&pViewData->GetMarkData() );
Fraction aZoomX = pViewData->GetZoomX();
Fraction aZoomY = pViewData->GetZoomY();
- ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, pDoc, nTab,
+ ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab,
nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY,
&aZoomX, &aZoomY );
@@ -486,7 +486,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
// use printer for text formatting
- OutputDevice* pFmtDev = pDoc->GetPrinter();
+ OutputDevice* pFmtDev = rDoc.GetPrinter();
pFmtDev->SetMapMode( pViewData->GetLogicMode(eWhich) );
aOutputData.SetFmtDevice( pFmtDev );
}
@@ -514,7 +514,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.SetGridColor ( aGridColor );
aOutputData.SetShowNullValues ( rOpts.GetOption( VOPT_NULLVALS ) );
aOutputData.SetShowFormulas ( bFormulaMode );
- aOutputData.SetShowSpellErrors ( pDoc->GetDocOptions().IsAutoSpell() );
+ aOutputData.SetShowSpellErrors ( rDoc.GetDocOptions().IsAutoSpell() );
aOutputData.SetMarkClipped ( bMarkClipped );
aOutputData.SetUseStyleColor( true ); // always set in table view
@@ -657,7 +657,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
pContentDev->SetMapMode(aCurrentMapMode);
}
- if ( pDoc->HasBackgroundDraw( nTab, aDrawingRectLogic ) )
+ if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) )
{
pContentDev->SetMapMode(MAP_PIXEL);
aOutputData.DrawClear();
@@ -721,10 +721,10 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
//! Test, ob ChangeTrack-Anzeige aktiv ist
//! Szenario-Rahmen per View-Optionen abschaltbar?
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
const std::vector<ScHighlightEntry> &rHigh = pViewData->GetView()->GetHighlightRanges();
- bool bHasScenario = ( nTab+1<nTabCount && pDoc->IsScenario(nTab+1) && !pDoc->IsScenario(nTab) );
- bool bHasChange = ( pDoc->GetChangeTrack() != NULL );
+ bool bHasScenario = ( nTab+1<nTabCount && rDoc.IsScenario(nTab+1) && !rDoc.IsScenario(nTab) );
+ bool bHasChange = ( rDoc.GetChangeTrack() != NULL );
if ( bHasChange || bHasScenario || !rHigh.empty() )
{
@@ -870,8 +870,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
CheckNeedsRepaint();
// Flag drawn formula cells "unchanged".
- pDoc->ResetChanged(ScRange(nX1,nY1,nTab,nX2,nY2,nTab));
- pDoc->ClearFormulaContext();
+ rDoc.ResetChanged(ScRange(nX1,nY1,nTab,nX2,nY2,nTab));
+ rDoc.ClearFormulaContext();
}
void ScGridWindow::CheckNeedsRepaint()
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index dcf157e05ee9..44643d60062b 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -611,9 +611,9 @@ bool ScHeaderControl::IsSelectionAllowed(SCCOLROW nPos) const
if (!pViewSh)
return false;
- ScViewData* pViewData = pViewSh->GetViewData();
- sal_uInt16 nTab = pViewData->GetTabNo();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ sal_uInt16 nTab = rViewData.GetTabNo();
+ ScDocument* pDoc = rViewData.GetDocument();
const ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
bool bSelectAllowed = true;
if ( pProtect && pProtect->isProtected() )
@@ -827,10 +827,10 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
if ( rCEvt.IsMouseEvent() )
{
// #i18735# select the column/row under the mouse pointer
- ScViewData* pViewData = pViewSh->GetViewData();
+ ScViewData& rViewData = pViewSh->GetViewData();
SelectWindow(); // also deselects drawing objects, stops draw text edit
- if ( pViewData->HasEditView( pViewData->GetActivePart() ) )
+ if ( rViewData.HasEditView( rViewData.GetActivePart() ) )
SC_MOD()->InputEnterHandler(); // always end edit mode
MouseEvent aMEvt( rCEvt.GetMousePosPixel() );
@@ -840,7 +840,7 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
// Selecting this cell is not allowed, neither is context menu.
return;
- SCTAB nTab = pViewData->GetTabNo();
+ SCTAB nTab = rViewData.GetTabNo();
ScRange aNewRange;
if ( bVertical )
aNewRange = ScRange( 0, sal::static_int_cast<SCROW>(nPos), nTab,
@@ -851,7 +851,7 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
// see if any part of the range is already selected
ScRangeList aRanges;
- pViewData->GetMarkData().FillRangeListWithMarks( &aRanges, false );
+ rViewData.GetMarkData().FillRangeListWithMarks( &aRanges, false );
bool bSelected = aRanges.Intersects(aNewRange);
// select the range if no part of it was selected
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 162271b7d738..be76dde7a1b1 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -157,7 +157,7 @@ const ScOutlineArray* ScOutlineWindow::GetOutlineArray() const
{
const ScOutlineTable* pTable = GetDoc().GetOutlineTable( GetTab() );
if ( !pTable ) return NULL;
- return mbHoriz ? pTable->GetColArray() : pTable->GetRowArray();
+ return mbHoriz ? &pTable->GetColArray() : &pTable->GetRowArray();
}
const ScOutlineEntry* ScOutlineWindow::GetOutlineEntry( size_t nLevel, size_t nEntry ) const
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index 062716a3a2da..404d4dc3a1c1 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -47,8 +47,8 @@ ScPrintFuncCache::ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark,
pSelRange = &aRange;
}
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
// avoid repeated progress bars if row heights for all sheets are needed
if ( nTabCount > 1 && rMark.GetSelectCount() == nTabCount )
@@ -94,8 +94,8 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
long nRenderer = 0; // 0-based physical page number across sheets
long nTabStart = 0;
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd && (*itr) < nTabCount; ++itr)
{
@@ -112,7 +112,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& rMark, OutputDevice* pDe
aPage.SetTotalRange( Range(0,RANGE_MAX) );
aPage.Select( aPageRange );
- ScPreviewLocationData aLocData( pDoc, pDev );
+ ScPreviewLocationData aLocData( &rDoc, pDev );
aFunc.DoPrint( aPage, nTabStart, nDisplayStart, false, &aLocData );
ScRange aCellRange;
@@ -150,8 +150,8 @@ bool ScPrintFuncCache::IsSameSelection( const ScPrintSelectionStatus& rStatus )
SCTAB ScPrintFuncCache::GetTabForPage( long nPage ) const
{
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nTab = 0;
while ( nTab < nTabCount && nPage >= nPages[nTab] )
nPage -= nPages[nTab++];
@@ -173,10 +173,10 @@ long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const
//! merge with lcl_GetDisplayStart in preview?
long nDisplayStart = 0;
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
for (SCTAB i=0; i<nTab; i++)
{
- if ( pDoc->NeedPageResetAfterTab(i) )
+ if ( rDoc.NeedPageResetAfterTab(i) )
nDisplayStart = 0;
else
{
diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx
index 5265c93a1cb7..d98f8e9ba24c 100644
--- a/sc/source/ui/view/pgbrksh.cxx
+++ b/sc/source/ui/view/pgbrksh.cxx
@@ -47,10 +47,10 @@ ScPageBreakShell::ScPageBreakShell( ScTabViewShell* pViewSh ) :
SfxShell(pViewSh)
{
SetPool( &pViewSh->GetPool() );
- ScViewData* pViewData = pViewSh->GetViewData();
- ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ::svl::IUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
- if ( !pViewData->GetDocument()->IsUndoEnabled() )
+ if ( !rViewData.GetDocument()->IsUndoEnabled() )
{
pMgr->SetMaxUndoActionCount( 0 );
}
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index ff4b004989ed..3e425ccb5a53 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -57,10 +57,10 @@ ScPivotShell::ScPivotShell( ScTabViewShell* pViewSh ) :
pViewShell( pViewSh )
{
SetPool( &pViewSh->GetPool() );
- ScViewData* pViewData = pViewSh->GetViewData();
- ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ScViewData& rViewData = pViewSh->GetViewData();
+ ::svl::IUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
- if ( !pViewData->GetDocument()->IsUndoEnabled() )
+ if ( !rViewData.GetDocument()->IsUndoEnabled() )
{
pMgr->SetMaxUndoActionCount( 0 );
}
@@ -100,10 +100,10 @@ void ScPivotShell::Execute( SfxRequest& rReq )
nSrcTab = pDesc->GetSourceRange().aStart.Tab();
}
- ScViewData* pViewData = pViewShell->GetViewData();
+ ScViewData& rViewData = pViewShell->GetViewData();
SfxItemSet aArgSet( pViewShell->GetPool(),
SCITEM_QUERYDATA, SCITEM_QUERYDATA );
- aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) );
+ aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, &rViewData, &aQueryParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
@@ -114,7 +114,7 @@ void ScPivotShell::Execute( SfxRequest& rReq )
if( pDlg->Execute() == RET_OK )
{
- ScSheetSourceDesc aNewDesc(pViewData->GetDocument());
+ ScSheetSourceDesc aNewDesc(rViewData.GetDocument());
if( pDesc )
aNewDesc = *pDesc;
@@ -123,9 +123,9 @@ void ScPivotShell::Execute( SfxRequest& rReq )
ScDPObject aNewObj( *pDPObj );
aNewObj.SetSheetDesc( aNewDesc );
- ScDBDocFunc aFunc( *pViewData->GetDocShell() );
+ ScDBDocFunc aFunc( *rViewData.GetDocShell() );
aFunc.DataPilotUpdate( pDPObj, &aNewObj, true, false );
- pViewData->GetView()->CursorPosChanged(); // shells may be switched
+ rViewData.GetView()->CursorPosChanged(); // shells may be switched
}
}
}
@@ -135,9 +135,9 @@ void ScPivotShell::Execute( SfxRequest& rReq )
void ScPivotShell::GetState( SfxItemSet& rSet )
{
- ScDocShell* pDocSh = pViewShell->GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bDisable = pDocSh->IsReadOnly() || pDoc->GetChangeTrack();
+ ScDocShell* pDocSh = pViewShell->GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bDisable = pDocSh->IsReadOnly() || rDoc.GetChangeTrack();
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
@@ -169,7 +169,7 @@ void ScPivotShell::GetState( SfxItemSet& rSet )
ScDPObject* ScPivotShell::GetCurrDPObject()
{
- const ScViewData& rViewData = *pViewShell->GetViewData();
+ const ScViewData& rViewData = pViewShell->GetViewData();
return rViewData.GetDocument()->GetDPAtCursor(
rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() );
}
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 3b3c0ace8d63..cc9f8eb2b00e 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -152,8 +152,8 @@ ScPreview::~ScPreview()
void ScPreview::UpdateDrawView() // nTab must be right
{
- ScDocument* pDoc = pDocShell->GetDocument();
- ScDrawLayer* pModel = pDoc->GetDrawLayer(); // is not 0
+ ScDocument& rDoc = pDocShell->GetDocument();
+ ScDrawLayer* pModel = rDoc.GetDrawLayer(); // is not 0
// #114135#
if ( pModel )
@@ -201,8 +201,8 @@ void ScPreview::TestLastPage()
for (sal_uInt16 i=0; i<nTab; i++)
nTabStart += nPages[i];
- ScDocument* pDoc = pDocShell->GetDocument();
- nDisplayStart = lcl_GetDisplayStart( nTab, pDoc, nPages );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ nDisplayStart = lcl_GetDisplayStart( nTab, &rDoc, nPages );
}
else // empty Document
{
@@ -224,8 +224,8 @@ void ScPreview::CalcPages()
{
WaitObject aWait( this );
- ScDocument* pDoc = pDocShell->GetDocument();
- nTabCount = pDoc->GetTableCount();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ nTabCount = rDoc.GetTableCount();
SCTAB nStart = nTabsTested;
if (!bValid)
@@ -284,7 +284,7 @@ void ScPreview::CalcPages()
}
}
- nDisplayStart = lcl_GetDisplayStart( nTab, pDoc, nPages );
+ nDisplayStart = lcl_GetDisplayStart( nTab, &rDoc, nPages );
if (nTabCount > nTabsTested)
nTabsTested = nTabCount;
@@ -329,8 +329,8 @@ void ScPreview::RecalcPages() // only nPageNo is changed
}
}
- ScDocument* pDoc = pDocShell->GetDocument();
- nDisplayStart = lcl_GetDisplayStart( nTab, pDoc, nPages );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ nDisplayStart = lcl_GetDisplayStart( nTab, &rDoc, nPages );
}
TestLastPage(); // to test, if after last page
@@ -382,8 +382,8 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
bool bHeaderOn = false;
bool bFooterOn = false;
- ScDocument* pDoc = pDocShell->GetDocument();
- bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
Size aLocalPageSize;
if ( bValidPage )
@@ -506,7 +506,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
const ScPatternAttr& rDefPattern =
static_cast<const ScPatternAttr&>(
- pDoc->GetPool()->GetDefaultItem(ATTR_PATTERN));
+ rDoc.GetPool()->GetDefaultItem(ATTR_PATTERN));
boost::scoped_ptr<ScEditEngineDefaulter> pEditEng(
new ScEditEngineDefaulter(EditEngine::CreatePool(), true));
@@ -687,7 +687,7 @@ const ScPreviewLocationData& ScPreview::GetLocationData()
{
if ( !pLocationData )
{
- pLocationData = new ScPreviewLocationData( pDocShell->GetDocument(), this );
+ pLocationData = new ScPreviewLocationData( &pDocShell->GetDocument(), this );
bLocationValid = false;
}
if ( !bLocationValid )
@@ -773,7 +773,7 @@ void ScPreview::SetPageNo( long nPage )
long ScPreview::GetFirstPage(SCTAB nTabP)
{
- SCTAB nDocTabCount = pDocShell->GetDocument()->GetTableCount();
+ SCTAB nDocTabCount = pDocShell->GetDocument().GetTableCount();
if (nTabP >= nDocTabCount)
nTabP = nDocTabCount-1;
@@ -829,7 +829,7 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly)
aWinSize.Width() -= 2 * aMarginSize.Width();
aWinSize.Height() -= 2 * aMarginSize.Height();
- Size aLocalPageSize = lcl_GetDocPageSize( pDocShell->GetDocument(), nTab );
+ Size aLocalPageSize = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab );
if ( aLocalPageSize.Width() && aLocalPageSize.Height() )
{
long nZoomX = (long) ( aWinSize.Width() * 100 / ( aLocalPageSize.Width() * nWinScaleX ));
@@ -1069,18 +1069,18 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
aButtonUpPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode );
- long nWidth = (long) lcl_GetDocPageSize(pDocShell->GetDocument(), nTab).Width();
- long nHeight = (long) lcl_GetDocPageSize(pDocShell->GetDocument(), nTab).Height();
+ long nWidth = (long) lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Width();
+ long nHeight = (long) lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Height();
if( rMEvt.IsLeft() && GetPointer() == POINTER_HSIZEBAR )
{
SetPointer( Pointer( POINTER_ARROW ) );
- ScDocument * pDoc = pDocShell->GetDocument();
- OUString aOldName = pDoc->GetPageStyle( nTab );
- bool bUndo = pDoc->IsUndoEnabled();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ OUString aOldName = rDoc.GetPageStyle( nTab );
+ bool bUndo = rDoc.IsUndoEnabled();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE );
if ( pStyleSheet )
@@ -1173,10 +1173,10 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
}
if( bMoveRulerAction )
{
- ScDocument * pDoc = pDocShell->GetDocument();
- bool bUndo = pDoc->IsUndoEnabled();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
- SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bUndo = rDoc.IsUndoEnabled();
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
+ SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found" );
if ( pStyleSheet )
{
@@ -1264,8 +1264,8 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
if( rMEvt.IsLeft() && GetPointer() == POINTER_HSPLIT )
{
SetPointer(POINTER_ARROW);
- ScDocument* pDoc = pDocShell->GetDocument();
- bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ ScDocument& rDoc = pDocShell->GetDocument();
+ bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
bool bMoveRulerAction = true;
if( aButtonDownPt.X() == aButtonUpPt.X() )
{
@@ -1284,13 +1284,13 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
if( !bLayoutRTL )
{
nNewColWidth = (long) ( PixelToLogic( Point( rMEvt.GetPosPixel().X() - nRight[ nColNumberButttonDown ], 0), aMMMode ).X() / HMM_PER_TWIPS ) * 100 / mnScale;
- nNewColWidth += pDocShell->GetDocument()->GetColWidth( nColNumberButttonDown, nTab );
+ nNewColWidth += pDocShell->GetDocument().GetColWidth( nColNumberButttonDown, nTab );
}
else
{
nNewColWidth = (long) ( PixelToLogic( Point( nRight[ nColNumberButttonDown ] - rMEvt.GetPosPixel().X(), 0), aMMMode ).X() / HMM_PER_TWIPS ) * 100 / mnScale;
- nNewColWidth += pDocShell->GetDocument()->GetColWidth( nColNumberButttonDown, nTab );
+ nNewColWidth += pDocShell->GetDocument().GetColWidth( nColNumberButttonDown, nTab );
}
if( nNewColWidth >= 0 )
@@ -1324,8 +1324,8 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt )
long nTopMargin = 0;
long nBottomMargin = 0;
- long nWidth = (long) lcl_GetDocPageSize(pDocShell->GetDocument(), nTab).Width();
- long nHeight = (long) lcl_GetDocPageSize(pDocShell->GetDocument(), nTab).Height();
+ long nWidth = (long) lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Width();
+ long nHeight = (long) lcl_GetDocPageSize(&pDocShell->GetDocument(), nTab).Height();
if ( nPageNo < nTotalPages )
{
@@ -1587,8 +1587,8 @@ void ScPreview::DragMove( long nDragMovePos, sal_uInt16 nFlags )
void ScPreview::DrawInvert( long nDragPos, sal_uInt16 nFlags )
{
- long nHeight = (long) lcl_GetDocPageSize( pDocShell->GetDocument(), nTab ).Height();
- long nWidth = (long) lcl_GetDocPageSize( pDocShell->GetDocument(), nTab ).Width();
+ long nHeight = (long) lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab ).Height();
+ long nWidth = (long) lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab ).Width();
if( nFlags == POINTER_HSIZEBAR || nFlags == POINTER_HSPLIT )
{
Rectangle aRect( nDragPos, -aOffset.Y(), nDragPos + 1,(long)( ( nHeight * HMM_PER_TWIPS ) - aOffset.Y()));
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 2fe8b19669ef..a1ad80126ae1 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -136,7 +136,7 @@ void ScPreviewShell::Construct( Window* pParent )
SetWindow( pPreview );
StartListening(*pDocShell,true);
StartListening(*SFX_APP(),true); // #i62045# #i62046# application is needed for Calc's own hints
- SfxBroadcaster* pDrawBC = pDocShell->GetDocument()->GetDrawBroadcaster();
+ SfxBroadcaster* pDrawBC = pDocShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
StartListening(*pDrawBC);
@@ -165,10 +165,10 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
//! or completely forget aSourceData on ScTablesHint?
ScTabViewShell* pTabViewShell = ((ScTabViewShell*)pOldSh);
- const ScViewData* pData = pTabViewShell->GetViewData();
- pData->WriteUserDataSequence( aSourceData );
- pPreview->SetSelectedTabs(pData->GetMarkData());
- InitStartTable( pData->GetTabNo() );
+ const ScViewData& rData = pTabViewShell->GetViewData();
+ rData.WriteUserDataSequence( aSourceData );
+ pPreview->SetSelectedTabs(rData.GetMarkData());
+ InitStartTable( rData.GetTabNo() );
// also have to store the TabView's DesignMode state
// (only if draw view exists)
@@ -189,7 +189,7 @@ ScPreviewShell::~ScPreviewShell()
BroadcastAccessibility( SfxSimpleHint( SFX_HINT_DYING ) );
DELETEZ(pAccessibilityBroadcaster);
- SfxBroadcaster* pDrawBC = pDocShell->GetDocument()->GetDrawBroadcaster();
+ SfxBroadcaster* pDrawBC = pDocShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
EndListening(*pDrawBC);
EndListening(*SFX_APP());
@@ -240,11 +240,11 @@ void ScPreviewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
bool ScPreviewShell::GetPageSize( Size& aPageSize )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTab = pPreview->GetTab();
- ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
- SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ),
+ ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
+ SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ),
SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE(pStyleSheet,"No style sheet");
if (!pStyleSheet) return false;
@@ -738,8 +738,8 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
{
const SfxPoolItem* pItem;
SCTAB nTab = pPreview->GetTab();
- OUString aOldName = pDocShell->GetDocument()->GetPageStyle( pPreview->GetTab() );
- ScStyleSheetPool* pStylePool = pDocShell->GetDocument()->GetStyleSheetPool();
+ OUString aOldName = pDocShell->GetDocument().GetPageStyle( pPreview->GetTab() );
+ ScStyleSheetPool* pStylePool = pDocShell->GetDocument().GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" );
@@ -852,8 +852,8 @@ void ScPreviewShell::GetState( SfxItemSet& rSet )
rSet.DisableItem( nWhich );
else
{
- OUString aOldName = pDocShell->GetDocument()->GetPageStyle( pPreview->GetTab() );
- ScStyleSheetPool* pStylePool = pDocShell->GetDocument()->GetStyleSheetPool();
+ OUString aOldName = pDocShell->GetDocument().GetPageStyle( pPreview->GetTab() );
+ ScStyleSheetPool* pStylePool = pDocShell->GetDocument().GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" );
@@ -894,10 +894,10 @@ void ScPreviewShell::GetState( SfxItemSet& rSet )
void ScPreviewShell::FillFieldData( ScHeaderFieldData& rData )
{
- ScDocument* pDoc = pDocShell->GetDocument();
+ ScDocument& rDoc = pDocShell->GetDocument();
SCTAB nTab = pPreview->GetTab();
OUString aTmp;
- pDoc->GetName(nTab, aTmp);
+ rDoc.GetName(nTab, aTmp);
rData.aTabName = aTmp;
if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
@@ -1200,7 +1200,7 @@ const ScPreviewLocationData& ScPreviewShell::GetLocationData()
return pPreview->GetLocationData();
}
-ScDocument* ScPreviewShell::GetDocument()
+ScDocument& ScPreviewShell::GetDocument()
{
return pDocShell->GetDocument();
}
diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx
index bc8b5f2fc43b..f33443f49ac0 100644
--- a/sc/source/ui/view/prevwsh2.cxx
+++ b/sc/source/ui/view/prevwsh2.cxx
@@ -43,7 +43,7 @@ void ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
case SC_HINT_DRWLAYER_NEW:
{
- SfxBroadcaster* pDrawBC = pDocShell->GetDocument()->GetDrawBroadcaster();
+ SfxBroadcaster* pDrawBC = pDocShell->GetDocument().GetDrawBroadcaster();
if (pDrawBC)
StartListening(*pDrawBC);
}
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 9988884e7c5e..9362c0838244 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -167,7 +167,7 @@ static long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine)
void ScPrintFunc::Construct( const ScPrintOptions* pOptions )
{
pDocShell->UpdatePendingRowHeights( nPrintTab );
- pDoc = pDocShell->GetDocument();
+ pDoc = &pDocShell->GetDocument();
SfxPrinter* pDocPrinter = pDoc->GetPrinter(); // use the printer, even for preview
if (pDocPrinter)
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 66012a845943..3d1481cacf5c 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -243,7 +243,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( Window* pParentP,
PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
OSL_ENSURE( pViewShell, "missing view shell :-(" );
pWindow = pViewShell ?
- new ScAcceptChgDlg( pBindings, this, pParentP, pViewShell->GetViewData() ) :
+ new ScAcceptChgDlg( pBindings, this, pParentP, &pViewShell->GetViewData() ) :
NULL;
if(pWindow!=NULL)
{
@@ -261,7 +261,7 @@ void ScAcceptChgDlgWrapper::ReInitDlg()
if(pWindow!=NULL && pViewShell)
{
- ((ScAcceptChgDlg*)pWindow)->ReInit(pViewShell->GetViewData());
+ ((ScAcceptChgDlg*)pWindow)->ReInit(&pViewShell->GetViewData());
}
}
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index 378e469b8bc5..2ba0735db856 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -734,7 +734,7 @@ void ScViewFunctionSet::DeselectAll()
ScViewSelectionEngine::ScViewSelectionEngine( Window* pWindow, ScTabView* pView,
ScSplitPos eSplitPos ) :
- SelectionEngine( pWindow, pView->GetFunctionSet() ),
+ SelectionEngine( pWindow, &pView->GetFunctionSet() ),
eWhich( eSplitPos )
{
SetSelectionMode( MULTIPLE_SELECTION );
diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx
index 03e407373f4e..65fc6dcd9863 100644
--- a/sc/source/ui/view/spelldialog.cxx
+++ b/sc/source/ui/view/spelldialog.cxx
@@ -166,7 +166,7 @@ void ScSpellDialogChildWindow::Init()
if( (mpViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() )) == 0 )
return;
- mpViewData = mpViewShell->GetViewData();
+ mpViewData = &mpViewShell->GetViewData();
// exit edit mode - TODO support spelling in edit mode
if( mpViewData->HasEditView( mpViewData->GetActivePart() ) )
@@ -175,7 +175,7 @@ void ScSpellDialogChildWindow::Init()
mxOldSel.reset( new ScSelectionState( *mpViewData ) );
mpDocShell = mpViewData->GetDocShell();
- mpDoc = mpDocShell->GetDocument();
+ mpDoc = &mpDocShell->GetDocument();
const ScAddress& rCursor = mxOldSel->GetCellCursor();
SCCOL nCol = rCursor.Col();
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index e243cc829493..602f9fbd26ea 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -51,7 +51,7 @@ ScConversionEngineBase::ScConversionEngineBase(
ScEditEngineDefaulter( pEnginePoolP ),
mrViewData( rViewData ),
mrDocShell( *rViewData.GetDocShell() ),
- mrDoc( *rViewData.GetDocShell()->GetDocument() ),
+ mrDoc( rViewData.GetDocShell()->GetDocument() ),
maSelState( rViewData ),
mpUndoDoc( pUndoDoc ),
mpRedoDoc( pRedoDoc ),
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index e6092771e0f2..df49a4263adf 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -467,7 +467,7 @@ void ScTabControl::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
void ScTabControl::DoDrag( const Region& /* rRegion */ )
{
ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
ScRange aTabRange( 0, 0, nTab, MAXCOL, MAXROW, nTab );
@@ -477,7 +477,7 @@ void ScTabControl::DoDrag( const Region& /* rRegion */ )
ScDocument* pClipDoc = new ScDocument( SCDOCMODE_CLIP );
ScClipParam aClipParam(aTabRange, false);
- pDoc->CopyToClip(aClipParam, pClipDoc, &aTabMark, false);
+ rDoc.CopyToClip(aClipParam, pClipDoc, &aTabMark, false);
TransferableObjectDescriptor aObjDesc;
pDocSh->FillTransferableObjectDescriptor( aObjDesc );
@@ -504,7 +504,7 @@ static sal_uInt16 lcl_DocShellNr( ScDocument* pDoc )
{
if ( pShell->Type() == TYPE(ScDocShell) )
{
- if ( ((ScDocShell*)pShell)->GetDocument() == pDoc )
+ if ( &((ScDocShell*)pShell)->GetDocument() == pDoc )
return nShellCnt;
++nShellCnt;
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 0777d419637d..88d623b95570 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -167,8 +167,8 @@ static bool lcl_HasColOutline( const ScViewData& rViewData )
const ScOutlineTable* pTable = rViewData.GetDocument()->GetOutlineTable(rViewData.GetTabNo());
if (pTable)
{
- const ScOutlineArray* pArray = pTable->GetColArray();
- if ( pArray->GetDepth() > 0 )
+ const ScOutlineArray& rArray = pTable->GetColArray();
+ if ( rArray.GetDepth() > 0 )
return true;
}
return false;
@@ -179,8 +179,8 @@ static bool lcl_HasRowOutline( const ScViewData& rViewData )
const ScOutlineTable* pTable = rViewData.GetDocument()->GetOutlineTable(rViewData.GetTabNo());
if (pTable)
{
- const ScOutlineArray* pArray = pTable->GetRowArray();
- if ( pArray->GetDepth() > 0 )
+ const ScOutlineArray& rArray = pTable->GetRowArray();
+ if ( rArray.GetDepth() > 0 )
return true;
}
return false;
@@ -706,8 +706,8 @@ void ScTabView::UpdateVarZoom()
if ( eZoomType != SVX_ZOOM_PERCENT && !bInZoomUpdate )
{
bInZoomUpdate = true;
- const Fraction& rOldX = GetViewData()->GetZoomX();
- const Fraction& rOldY = GetViewData()->GetZoomY();
+ const Fraction& rOldX = GetViewData().GetZoomX();
+ const Fraction& rOldY = GetViewData().GetZoomY();
long nOldPercent = ( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator();
sal_uInt16 nNewZoom = CalcZoom( eZoomType, (sal_uInt16)nOldPercent );
Fraction aNew( nNewZoom, 100 );
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 501459f3211a..54b0ec871946 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1436,10 +1436,10 @@ void ScTabView::UpdatePageBreakData( bool bForcePaint )
if (aViewData.IsPagebreakMode())
{
ScDocShell* pDocSh = aViewData.GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nTab = aViewData.GetTabNo();
- sal_uInt16 nCount = pDoc->GetPrintRangeCount(nTab);
+ sal_uInt16 nCount = rDoc.GetPrintRangeCount(nTab);
if (!nCount)
nCount = 1;
pNewData = new ScPageBreakData(nCount);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index c37cd4c3104a..9589c102fa73 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1838,7 +1838,7 @@ void ScTabView::UpdateEditView()
EditView* pEditView = aViewData.GetEditView( (ScSplitPos) i );
aViewData.SetEditEngine( (ScSplitPos) i,
static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
- pGridWin[i], GetViewData()->GetCurX(), GetViewData()->GetCurY() );
+ pGridWin[i], GetViewData().GetCurX(), GetViewData().GetCurY() );
if ( (ScSplitPos)i == eActive )
pEditView->ShowCursor( false );
}
@@ -2182,9 +2182,9 @@ void ScTabView::DoChartSelection(
{
Color aSelColor( rHilightRanges[i].PreferredColor );
ScRangeList aRangeList;
- ScDocument* pDoc = aViewData.GetDocShell()->GetDocument();
+ ScDocument& rDoc = aViewData.GetDocShell()->GetDocument();
if( ScRangeStringConverter::GetRangeListFromString(
- aRangeList, rHilightRanges[i].RangeRepresentation, pDoc, pDoc->GetAddressConvention(), sep ))
+ aRangeList, rHilightRanges[i].RangeRepresentation, &rDoc, rDoc.GetAddressConvention(), sep ))
{
size_t nListSize = aRangeList.size();
for ( size_t j = 0; j < nListSize; ++j )
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index 01e61d9a2099..7d6e1bf79275 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -108,7 +108,7 @@ SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" )
OUString ScTabViewShell::GetFormula(ScAddress& rAddress)
{
OUString sFormula;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScRefCellValue aCell;
aCell.assign(*pDoc, rAddress);
if (!aCell.isEmpty() && aCell.meType == CELLTYPE_FORMULA)
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index a2810c1b942a..064c120a2f9c 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -78,7 +78,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
MakeDrawLayer();
- ScTabView* pTabView = GetViewData()->GetView();
+ ScTabView* pTabView = GetViewData().GetView();
SfxBindings& rBindings = GetViewFrame()->GetBindings();
Window* pWin = pTabView->GetActiveWin();
@@ -181,7 +181,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
// Execute fuer die Form-Shell, um im Controller zu deselektieren
if ( nNewId == SID_FM_CREATE_CONTROL )
{
- GetViewData()->GetDispatcher().Execute(SID_FM_LEAVE_CREATE);
+ GetViewData().GetDispatcher().Execute(SID_FM_LEAVE_CREATE);
GetViewFrame()->GetBindings().InvalidateAll(false);
//! was fuer einen Slot braucht der komische Controller wirklich, um das anzuzeigen????
}
@@ -195,7 +195,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if ( nDrawSfxId == SID_FM_CREATE_CONTROL && nNewId != nDrawSfxId )
{
// Wechsel von Control- zu Zeichenfunktion -> im Control-Controller deselektieren
- GetViewData()->GetDispatcher().Execute(SID_FM_LEAVE_CREATE);
+ GetViewData().GetDispatcher().Execute(SID_FM_LEAVE_CREATE);
GetViewFrame()->GetBindings().InvalidateAll(false);
//! was fuer einen Slot braucht der komische Controller wirklich, um das anzuzeigen????
}
@@ -443,7 +443,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet)
bool ScTabViewShell::SelectObject( const OUString& rName )
{
- ScDrawView* pView = GetViewData()->GetScDrawView();
+ ScDrawView* pView = GetViewData().GetScDrawView();
if (!pView)
return false;
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 58665e25b376..8e7b24e4e642 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -214,8 +214,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case SID_FORMATPAGE:
case SID_STATUS_PAGESTYLE:
case SID_HFEDIT:
- GetViewData()->GetDocShell()->
- ExecutePageStyle( *this, rReq, GetViewData()->GetTabNo() );
+ GetViewData().GetDocShell()->
+ ExecutePageStyle( *this, rReq, GetViewData().GetTabNo() );
break;
case SID_JUMPTOMARK:
@@ -251,13 +251,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
}
bool bFound = false;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScMarkData& rMark = rViewData.GetMarkData();
ScRange aScRange;
ScAddress aScAddress;
sal_uInt16 nResult = lcl_ParseRange(aScRange, aAddress, pDoc, nSlot);
- SCTAB nTab = pViewData->GetTabNo();
+ SCTAB nTab = rViewData.GetTabNo();
bool bMark = true;
// Is this a range ?
@@ -311,7 +311,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
// 1-basierte Zeilennummer
aScAddress.SetRow( (SCROW)(nNumeric - 1) );
- aScAddress.SetCol( pViewData->GetCurX() );
+ aScAddress.SetCol( rViewData.GetCurX() );
aScAddress.SetTab( nTab );
aScRange = ScRange( aScAddress, aScAddress );
bMark = false;
@@ -328,7 +328,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
bFound = true;
SCCOL nCol = aScRange.aStart.Col();
SCROW nRow = aScRange.aStart.Row();
- bool bNothing = ( pViewData->GetCurX()==nCol && pViewData->GetCurY()==nRow );
+ bool bNothing = ( rViewData.GetCurX()==nCol && rViewData.GetCurY()==nRow );
// markieren
if( bMark )
@@ -374,7 +374,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
}
else
{
- pViewData->ResetOldCursor();
+ rViewData.ResetOldCursor();
SetCursor( nCol, nRow );
rBindings.Invalidate( SID_CURRENTCELL );
rBindings.Update( nSlot );
@@ -431,7 +431,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
// Tabelle fuer Basic ist 1-basiert
SCTAB nTab = ((const SfxUInt16Item&)pReqArgs->Get(nSlot)).GetValue() - 1;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( nTab < pDoc->GetTableCount() )
{
SetTabNo( nTab );
@@ -527,7 +527,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
bWantPageBreak = (nSlot == FID_PAGEBREAKMODE) == bItemValue;
}
- if( GetViewData()->IsPagebreakMode() != bWantPageBreak )
+ if( GetViewData().IsPagebreakMode() != bWantPageBreak )
{
SetPagebreakMode( bWantPageBreak );
UpdatePageBreakData();
@@ -561,11 +561,11 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case FID_TOGGLESYNTAX:
{
- bool bSet = !GetViewData()->IsSyntaxMode();
+ bool bSet = !GetViewData().IsSyntaxMode();
const SfxPoolItem* pItem;
if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SFX_ITEM_SET )
bSet = ((const SfxBoolItem*)pItem)->GetValue();
- GetViewData()->SetSyntaxMode( bSet );
+ GetViewData().SetSyntaxMode( bSet );
PaintGrid();
rBindings.Invalidate( FID_TOGGLESYNTAX );
rReq.AppendItem( SfxBoolItem( nSlot, bSet ) );
@@ -574,11 +574,11 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
break;
case FID_TOGGLEHEADERS:
{
- bool bSet = !GetViewData()->IsHeaderMode();
+ bool bSet = !GetViewData().IsHeaderMode();
const SfxPoolItem* pItem;
if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SFX_ITEM_SET )
bSet = ((const SfxBoolItem*)pItem)->GetValue();
- GetViewData()->SetHeaderMode( bSet );
+ GetViewData().SetHeaderMode( bSet );
RepeatResize();
rBindings.Invalidate( FID_TOGGLEHEADERS );
rReq.AppendItem( SfxBoolItem( nSlot, bSet ) );
@@ -588,8 +588,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case FID_TOGGLEFORMULA:
{
- ScViewData* pViewData = GetViewData();
- const ScViewOptions& rOpts = pViewData->GetOptions();
+ ScViewData& rViewData = GetViewData();
+ const ScViewOptions& rOpts = rViewData.GetOptions();
bool bFormulaMode = !rOpts.GetOption( VOPT_FORMULAS );
const SfxPoolItem *pItem;
if( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SFX_ITEM_SET )
@@ -597,9 +597,9 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
ScViewOptions rSetOpts = ScViewOptions( rOpts );
rSetOpts.SetOption( VOPT_FORMULAS, bFormulaMode );
- pViewData->SetOptions( rSetOpts );
+ rViewData.SetOptions( rSetOpts );
- pViewData->GetDocShell()->PostPaintGridAll();
+ rViewData.GetDocShell()->PostPaintGridAll();
rBindings.Invalidate( FID_TOGGLEFORMULA );
rReq.AppendItem( SfxBoolItem( nSlot, bFormulaMode ) );
@@ -629,7 +629,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom();
SvxZoomType eOldZoomType = GetZoomType();
SvxZoomType eNewZoomType = eOldZoomType;
- const Fraction& rOldY = GetViewData()->GetZoomY(); // Y wird angezeigt
+ const Fraction& rOldY = GetViewData().GetZoomY(); // Y wird angezeigt
sal_uInt16 nOldZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 )
/ rOldY.GetDenominator());
sal_uInt16 nZoom = nOldZoom;
@@ -648,7 +648,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
boost::scoped_ptr<AbstractSvxZoomDialog> pDlg;
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
sal_uInt16 nBtnFlags = SVX_ZOOM_ENABLE_50
| SVX_ZOOM_ENABLE_75
| SVX_ZOOM_ENABLE_100
@@ -715,7 +715,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if ( nZoom != nOldZoom && !bCancel )
{
- if (!GetViewData()->IsPagebreakMode())
+ if (!GetViewData().IsPagebreakMode())
{
ScAppOptions aNewOpt = pScMod->GetAppOptions();
aNewOpt.SetZoom( nZoom );
@@ -744,7 +744,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if( nCurrentZoom )
{
SetZoomType( SVX_ZOOM_PERCENT, bSyncZoom );
- if (!GetViewData()->IsPagebreakMode())
+ if (!GetViewData().IsPagebreakMode())
{
ScAppOptions aNewOpt = pScMod->GetAppOptions();
aNewOpt.SetZoom( nCurrentZoom );
@@ -775,7 +775,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case SID_SELECT_TABLES:
{
- ScViewData& rViewData = *GetViewData();
+ ScViewData& rViewData = GetViewData();
ScDocument& rDoc = *rViewData.GetDocument();
ScMarkData& rMark = rViewData.GetMarkData();
SCTAB nTabCount = rDoc.GetTableCount();
@@ -872,8 +872,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case SID_WINDOW_SPLIT:
{
- ScSplitMode eHSplit = GetViewData()->GetHSplitMode();
- ScSplitMode eVSplit = GetViewData()->GetVSplitMode();
+ ScSplitMode eHSplit = GetViewData().GetHSplitMode();
+ ScSplitMode eVSplit = GetViewData().GetVSplitMode();
if ( eHSplit == SC_SPLIT_NORMAL || eVSplit == SC_SPLIT_NORMAL ) // aufheben
RemoveSplit();
else if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // normal
@@ -888,8 +888,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case SID_WINDOW_FIX:
{
- ScSplitMode eHSplit = GetViewData()->GetHSplitMode();
- ScSplitMode eVSplit = GetViewData()->GetVSplitMode();
+ ScSplitMode eHSplit = GetViewData().GetHSplitMode();
+ ScSplitMode eVSplit = GetViewData().GetVSplitMode();
if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // aufheben
RemoveSplit();
else
@@ -926,9 +926,9 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case FID_CHG_COMMENT:
{
- ScViewData* pData = GetViewData();
- ScAddress aCursorPos( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
- ScDocShell* pDocSh = pData->GetDocShell();
+ ScViewData& rData = GetViewData();
+ ScAddress aCursorPos( rData.GetCurX(), rData.GetCurY(), rData.GetTabNo() );
+ ScDocShell* pDocSh = rData.GetDocShell();
ScChangeAction* pAction = pDocSh->GetChangeAction( aCursorPos );
if ( pAction )
@@ -956,14 +956,14 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
// angelegt werden muss
if (!GetScDrawView())
{
- GetViewData()->GetDocShell()->MakeDrawLayer();
+ GetViewData().GetDocShell()->MakeDrawLayer();
rBindings.InvalidateAll(false);
}
break;
case FID_PROTECT_DOC:
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if( pReqArgs )
{
@@ -1030,8 +1030,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case FID_PROTECT_TABLE:
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
bool bOldProtection = pDoc->IsTabProtected(nTab);
if( pReqArgs )
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 08cf2c5001a3..6067ac1600b1 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -121,7 +121,7 @@ void ScTabViewShell::Activate(bool bMDI)
pScMod->ViewShellChanged();
ActivateView( true, bFirstActivate );
- ActivateOlk( GetViewData() );
+ ActivateOlk( &GetViewData() );
// AutoCorrect umsetzen, falls der Writer seins neu angelegt hat
UpdateDrawTextOutliner();
@@ -174,11 +174,11 @@ void ScTabViewShell::Activate(bool bMDI)
// bridge, it's done in ImplSetReallyVisible), there are problems if Window::Show
// is called during the ViewShell ctor and reschedules asynchronous calls
// (for example from the FmFormShell ctor).
- ScExtDocOptions* pExtOpt = GetViewData()->GetDocument()->GetExtDocOptions();
+ ScExtDocOptions* pExtOpt = GetViewData().GetDocument()->GetExtDocOptions();
if ( pExtOpt && pExtOpt->IsChanged() )
{
- GetViewData()->ReadExtOptions(*pExtOpt); // Excel view settings
- SetTabNo( GetViewData()->GetTabNo(), true );
+ GetViewData().ReadExtOptions(*pExtOpt); // Excel view settings
+ SetTabNo( GetViewData().GetTabNo(), true );
pExtOpt->SetChanged( false );
}
}
@@ -188,7 +188,7 @@ void ScTabViewShell::Activate(bool bMDI)
ScInputHandler* pHdl = pScMod->GetInputHdl(this);
if (pHdl)
{
- pHdl->SetRefScale( GetViewData()->GetZoomX(), GetViewData()->GetZoomY() );
+ pHdl->SetRefScale( GetViewData().GetZoomX(), GetViewData().GetZoomY() );
}
// Aenderungs-Dialog aktualisieren
@@ -234,7 +234,7 @@ void ScTabViewShell::Deactivate(bool bMDI)
{
HideTip();
- ScDocument* pDoc=GetViewData()->GetDocument();
+ ScDocument* pDoc=GetViewData().GetDocument();
ScChangeTrack* pChanges=pDoc->GetChangeTrack();
@@ -255,11 +255,11 @@ void ScTabViewShell::Deactivate(bool bMDI)
bool bOldDontSwitch = bDontSwitch;
bDontSwitch = true;
- DeActivateOlk( GetViewData() );
+ DeActivateOlk( &GetViewData() );
ActivateView( false, false );
if ( GetViewFrame()->GetFrame().IsInPlace() ) // inplace
- GetViewData()->GetDocShell()->UpdateOle(GetViewData(), true);
+ GetViewData().GetDocShell()->UpdateOle(&GetViewData(), true);
if ( pHdl )
pHdl->NotifyChange( NULL, true ); // Timer-verzoegert wg. Dokumentwechsel
@@ -300,7 +300,7 @@ bool ScTabViewShell::PrepareClose(bool bUI)
{
// "clean" end of text edit, including note handling, subshells and draw func switching,
// as in FuDraw and ScTabView::DrawDeselectAll
- GetViewData()->GetDispatcher().Execute( pPoor->GetSlotID(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
+ GetViewData().GetDispatcher().Execute( pPoor->GetSlotID(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
}
ScDrawView* pDrView = GetScDrawView();
if ( pDrView )
@@ -324,7 +324,7 @@ bool ScTabViewShell::PrepareClose(bool bUI)
void ScTabViewShell::UpdateOleZoom()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
if ( pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
//TODO/LATER: is there a difference between the two GetVisArea methods?
@@ -384,7 +384,7 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize )
UpdateOleZoom(); // Zoom fuer In-Place berechnen
- GetViewData()->GetDocShell()->SetDocumentModified();
+ GetViewData().GetDocShell()->SetDocumentModified();
}
void ScTabViewShell::OuterResizePixel( const Point &rOfs, const Size &rSize )
@@ -419,7 +419,7 @@ void ScTabViewShell::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoo
if ( aNewY > aFrac400 )
aNewY = aFrac400;
- GetViewData()->UpdateScreenZoom( aNewX, aNewY );
+ GetViewData().UpdateScreenZoom( aNewX, aNewY );
SetZoom( aNewX, aNewY, true );
PaintGrid();
@@ -437,12 +437,12 @@ void ScTabViewShell::QueryObjAreaPixel( Rectangle& rRect ) const
Window* pWin = ((ScTabViewShell*)this)->GetActiveWin();
Size aLogicSize = pWin->PixelToLogic( aPixelSize );
- const ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScSplitPos ePos = pViewData->GetActivePart();
- SCCOL nCol = pViewData->GetPosX(WhichH(ePos));
- SCROW nRow = pViewData->GetPosY(WhichV(ePos));
- SCTAB nTab = pViewData->GetTabNo();
+ const ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScSplitPos ePos = rViewData.GetActivePart();
+ SCCOL nCol = rViewData.GetPosX(WhichH(ePos));
+ SCROW nRow = rViewData.GetPosY(WhichV(ePos));
+ SCTAB nTab = rViewData.GetTabNo();
bool bNegativePage = pDoc->IsNegativePage( nTab );
Rectangle aLogicRect = pDoc->GetMMRect( nCol, nRow, nCol, nRow, nTab );
@@ -453,7 +453,7 @@ void ScTabViewShell::QueryObjAreaPixel( Rectangle& rRect ) const
}
aLogicRect.SetSize( aLogicSize );
- pViewData->GetDocShell()->SnapVisArea( aLogicRect );
+ rViewData.GetDocShell()->SnapVisArea( aLogicRect );
rRect.SetSize( pWin->LogicToPixel( aLogicRect.GetSize() ) );
}
@@ -483,23 +483,23 @@ void ScTabViewShell::ShowCursor(bool /* bOn */)
void ScTabViewShell::WriteUserData(OUString& rData, bool /* bBrowse */)
{
- GetViewData()->WriteUserData(rData);
+ GetViewData().WriteUserData(rData);
}
void ScTabViewShell::WriteUserDataSequence (uno::Sequence < beans::PropertyValue >& rSettings, bool /* bBrowse */ )
{
- GetViewData()->WriteUserDataSequence (rSettings);
+ GetViewData().WriteUserDataSequence (rSettings);
}
void ScTabViewShell::ReadUserData(const OUString& rData, bool /* bBrowse */)
{
- if ( !GetViewData()->GetDocShell()->IsPreview() )
+ if ( !GetViewData().GetDocShell()->IsPreview() )
DoReadUserData( rData );
}
void ScTabViewShell::ReadUserDataSequence (const uno::Sequence < beans::PropertyValue >& rSettings, bool /* bBrowse */ )
{
- if ( !GetViewData()->GetDocShell()->IsPreview() )
+ if ( !GetViewData().GetDocShell()->IsPreview() )
DoReadUserDataSequence( rSettings );
}
@@ -508,10 +508,10 @@ void ScTabViewShell::DoReadUserDataSequence( const uno::Sequence < beans::Proper
Window* pOldWin = GetActiveWin();
bool bFocus = pOldWin && pOldWin->HasFocus();
- GetViewData()->ReadUserDataSequence(rSettings);
- SetTabNo( GetViewData()->GetTabNo(), true );
+ GetViewData().ReadUserDataSequence(rSettings);
+ SetTabNo( GetViewData().GetTabNo(), true );
- if ( GetViewData()->IsPagebreakMode() )
+ if ( GetViewData().IsPagebreakMode() )
SetCurSubShell( GetCurObjectSelectionType(), true );
Window* pNewWin = GetActiveWin();
@@ -523,8 +523,8 @@ void ScTabViewShell::DoReadUserDataSequence( const uno::Sequence < beans::Proper
WindowChanged(); // Drawing-Layer (z.B. #56771#)
}
- if (GetViewData()->GetHSplitMode() == SC_SPLIT_FIX ||
- GetViewData()->GetVSplitMode() == SC_SPLIT_FIX)
+ if (GetViewData().GetHSplitMode() == SC_SPLIT_FIX ||
+ GetViewData().GetVSplitMode() == SC_SPLIT_FIX)
{
InvalidateSplit();
}
@@ -573,7 +573,7 @@ bool isGL3DDiagram( const css::uno::Reference<css::chart2::XDiagram>& xDiagram )
void ScTabViewShell::AddOpenGLChartWindows()
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScGridWindow* pParentWindow = GetActiveWin();
std::vector<std::pair<uno::Reference<chart2::XChartDocument>, Rectangle> > aCharts = pDoc->GetAllCharts();
@@ -611,10 +611,10 @@ void ScTabViewShell::DoReadUserData( const OUString& rData )
Window* pOldWin = GetActiveWin();
bool bFocus = pOldWin && pOldWin->HasFocus();
- GetViewData()->ReadUserData(rData);
- SetTabNo( GetViewData()->GetTabNo(), true );
+ GetViewData().ReadUserData(rData);
+ SetTabNo( GetViewData().GetTabNo(), true );
- if ( GetViewData()->IsPagebreakMode() )
+ if ( GetViewData().IsPagebreakMode() )
SetCurSubShell( GetCurObjectSelectionType(), true );
Window* pNewWin = GetActiveWin();
@@ -626,8 +626,8 @@ void ScTabViewShell::DoReadUserData( const OUString& rData )
WindowChanged(); // Drawing-Layer (z.B. #56771#)
}
- if (GetViewData()->GetHSplitMode() == SC_SPLIT_FIX ||
- GetViewData()->GetVSplitMode() == SC_SPLIT_FIX)
+ if (GetViewData().GetHSplitMode() == SC_SPLIT_FIX ||
+ GetViewData().GetVSplitMode() == SC_SPLIT_FIX)
{
InvalidateSplit();
}
@@ -713,11 +713,11 @@ void ScTabViewShell::SetDrawShell( bool bActive )
{
ResetDrawDragMode(); // Mirror / Rotate aus
- if (bWasDraw && (GetViewData()->GetHSplitMode() == SC_SPLIT_FIX ||
- GetViewData()->GetVSplitMode() == SC_SPLIT_FIX))
+ if (bWasDraw && (GetViewData().GetHSplitMode() == SC_SPLIT_FIX ||
+ GetViewData().GetVSplitMode() == SC_SPLIT_FIX))
{
// Aktiven Teil an Cursor anpassen, etc.
- MoveCursorAbs( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
+ MoveCursorAbs( GetViewData().GetCurX(), GetViewData().GetCurY(),
SC_FOLLOW_NONE, false, false, true );
}
}
@@ -830,7 +830,7 @@ void ScTabViewShell::SetEditShell(EditView* pView, bool bActive )
if (pEditShell)
pEditShell->SetEditView( pView );
else
- pEditShell = new ScEditShell( pView, GetViewData() );
+ pEditShell = new ScEditShell( pView, &GetViewData() );
SetCurSubShell(OST_Editing);
}
@@ -843,18 +843,18 @@ void ScTabViewShell::SetEditShell(EditView* pView, bool bActive )
void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
{
- ScViewData* pViewData = GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
if(bDontSwitch) return;
if(!pCellShell) //Wird eh immer gebraucht.
{
- pCellShell = new ScCellShell( GetViewData() );
+ pCellShell = new ScCellShell( &GetViewData() );
pCellShell->SetRepeatTarget( &aTarget );
}
- bool bPgBrk=pViewData->IsPagebreakMode();
+ bool bPgBrk = rViewData.IsPagebreakMode();
if(bPgBrk && !pPageBreakShell)
{
@@ -898,7 +898,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pDrawTextShell )
{
pDocSh->MakeDrawLayer();
- pDrawTextShell = new ScDrawTextObjectBar( GetViewData() );
+ pDrawTextShell = new ScDrawTextObjectBar( &GetViewData() );
}
AddSubShell(*pDrawTextShell);
}
@@ -922,7 +922,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pDrawShell )
{
pDocSh->MakeDrawLayer();
- pDrawShell = new ScDrawShell( GetViewData() );
+ pDrawShell = new ScDrawShell( &GetViewData() );
pDrawShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pDrawShell);
@@ -935,7 +935,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pDrawFormShell )
{
pDocSh->MakeDrawLayer();
- pDrawFormShell = new ScDrawFormShell( GetViewData() );
+ pDrawFormShell = new ScDrawFormShell( &GetViewData() );
pDrawFormShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pDrawFormShell);
@@ -948,7 +948,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pChartShell )
{
pDocSh->MakeDrawLayer();
- pChartShell = new ScChartShell( GetViewData() );
+ pChartShell = new ScChartShell( &GetViewData() );
pChartShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pChartShell);
@@ -961,7 +961,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pOleObjectShell )
{
pDocSh->MakeDrawLayer();
- pOleObjectShell = new ScOleObjectShell( GetViewData() );
+ pOleObjectShell = new ScOleObjectShell( &GetViewData() );
pOleObjectShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pOleObjectShell);
@@ -974,7 +974,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pGraphicShell)
{
pDocSh->MakeDrawLayer();
- pGraphicShell = new ScGraphicShell( GetViewData() );
+ pGraphicShell = new ScGraphicShell( &GetViewData() );
pGraphicShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pGraphicShell);
@@ -987,7 +987,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
if ( !pMediaShell)
{
pDocSh->MakeDrawLayer();
- pMediaShell = new ScMediaShell( GetViewData() );
+ pMediaShell = new ScMediaShell( &GetViewData() );
pMediaShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pMediaShell);
@@ -1017,7 +1017,7 @@ void ScTabViewShell::SetCurSubShell(ObjectSelectionType eOST, bool bForce)
{
pDocSh->MakeDrawLayer(); // die Wartezeit lieber jetzt als beim Klick
- pAuditingShell = new ScAuditingShell( GetViewData() );
+ pAuditingShell = new ScAuditingShell( &GetViewData() );
pAuditingShell->SetRepeatTarget( &aTarget );
}
AddSubShell(*pAuditingShell);
@@ -1097,14 +1097,14 @@ void ScTabViewShell::SetDrawTextUndo( ::svl::IUndoManager* pNewUndoMgr )
{
// Default: Undo-Manager der DocShell
if (!pNewUndoMgr)
- pNewUndoMgr = GetViewData()->GetDocShell()->GetUndoManager();
+ pNewUndoMgr = GetViewData().GetDocShell()->GetUndoManager();
if (pDrawTextShell)
{
pDrawTextShell->SetUndoManager(pNewUndoMgr);
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
if ( pNewUndoMgr == pDocSh->GetUndoManager() &&
- !pDocSh->GetDocument()->IsUndoEnabled() )
+ !pDocSh->GetDocument().IsUndoEnabled() )
{
pNewUndoMgr->SetMaxUndoActionCount( 0 );
}
@@ -1123,12 +1123,12 @@ ScTabViewShell* ScTabViewShell::GetActiveViewShell()
SfxPrinter* ScTabViewShell::GetPrinter( bool bCreate )
{
// Drucker ist immer da (wird fuer die FontListe schon beim Starten angelegt)
- return GetViewData()->GetDocShell()->GetPrinter(bCreate);
+ return GetViewData().GetDocShell()->GetPrinter(bCreate);
}
sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
{
- return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
+ return GetViewData().GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
}
bool ScTabViewShell::HasPrintOptionsPage() const
@@ -1162,7 +1162,7 @@ IMPL_LINK_NOARG(ScTabViewShell, SimpleRefClose)
// If range selection was started with an active embedded object,
// switch back to original sheet (while the dialog is still open).
- SetTabNo( GetViewData()->GetRefTabNo() );
+ SetTabNo( GetViewData().GetRefTabNo() );
}
ScSimpleRefDlgWrapper::SetAutoReOpen( true );
@@ -1279,13 +1279,13 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
HideNoteMarker(); // Notiz-Anzeige
// don't do extra HideCursor/ShowCursor calls if EnterHandler will switch to a different sheet
- bool bOnRefSheet = ( GetViewData()->GetRefTabNo() == GetViewData()->GetTabNo() );
+ bool bOnRefSheet = ( GetViewData().GetRefTabNo() == GetViewData().GetTabNo() );
bool bHideCursor = ( ( nCode == KEY_RETURN && bInPlace ) || nCode == KEY_TAB ) && bOnRefSheet;
if (bHideCursor)
HideAllCursors();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( pDoc )
pDoc->KeyInput( rKEvt ); // TimerDelays etc.
@@ -1345,7 +1345,7 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
if ( eFunc == KEYFUNC_CUT )
{
ScRange aDummy;
- ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy );
+ ScMarkType eMarkType = GetViewData().GetSimpleArea( aDummy );
if (eMarkType != SC_MARK_SIMPLE)
{
ErrorMessage(STR_NOMULTISELECT);
@@ -1400,10 +1400,10 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
if (nMode == SC_ENTER_NORMAL)
{
if( bShift )
- GetViewData()->GetDispatcher().Execute( SID_CURSORENTERUP,
+ GetViewData().GetDispatcher().Execute( SID_CURSORENTERUP,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
else
- GetViewData()->GetDispatcher().Execute( SID_CURSORENTERDOWN,
+ GetViewData().GetDispatcher().Execute( SID_CURSORENTERDOWN,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
}
else
@@ -1455,7 +1455,7 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
}
if ( nSlotId )
{
- GetViewData()->GetDispatcher().Execute( nSlotId, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
+ GetViewData().GetDispatcher().Execute( nSlotId, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
bUsed = true;
}
}
@@ -1499,7 +1499,7 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
{
sal_uInt16 nMode = GetLockedModifiers();
LockModifiers(KEY_MOD1);
- GetViewData()->GetDispatcher().Execute( nSlotId, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
+ GetViewData().GetDispatcher().Execute( nSlotId, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD );
LockModifiers(nMode);
bUsed = true;
}
@@ -1571,12 +1571,12 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
{
SfxApplication* pSfxApp = SFX_APP();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
bReadOnly = pDocSh->IsReadOnly();
bIsActive = false;
- EnableAutoSpell(pDoc->GetDocOptions().IsAutoSpell());
+ EnableAutoSpell(rDoc.GetDocOptions().IsAutoSpell());
SetName(OUString("View")); // fuer SBX
Color aColBlack( COL_BLACK );
@@ -1586,7 +1586,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
pCurFrameLine = new ::editeng::SvxBorderLine(&aColBlack, 20,
table::BorderLineStyle::SOLID);
pPivotSource = new ScArea;
- StartListening(*GetViewData()->GetDocShell(),true);
+ StartListening(*GetViewData().GetDocShell(),true);
StartListening(*GetViewFrame(),true);
StartListening(*pSfxApp,true); // #i62045# #i62046# application is needed for Calc's own hints
@@ -1599,29 +1599,29 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
//TODO/LATER: is there a difference between the two GetVisArea methods?
Rectangle aVisArea = ((const SfxObjectShell*)pDocSh)->GetVisArea();
- SCTAB nVisTab = pDoc->GetVisibleTab();
- if (!pDoc->HasTable(nVisTab))
+ SCTAB nVisTab = rDoc.GetVisibleTab();
+ if (!rDoc.HasTable(nVisTab))
{
nVisTab = 0;
- pDoc->SetVisibleTab(nVisTab);
+ rDoc.SetVisibleTab(nVisTab);
}
SetTabNo( nVisTab );
- bool bNegativePage = pDoc->IsNegativePage( nVisTab );
+ bool bNegativePage = rDoc.IsNegativePage( nVisTab );
// show the right cells
- GetViewData()->SetScreenPos( bNegativePage ? aVisArea.TopRight() : aVisArea.TopLeft() );
+ GetViewData().SetScreenPos( bNegativePage ? aVisArea.TopRight() : aVisArea.TopLeft() );
if ( GetViewFrame()->GetFrame().IsInPlace() ) // inplace
{
pDocSh->SetInplace( true ); // schon so initialisiert
- if (pDoc->IsEmbedded())
- pDoc->ResetEmbedded(); // keine blaue Markierung
+ if (rDoc.IsEmbedded())
+ rDoc.ResetEmbedded(); // keine blaue Markierung
}
else if ( bFirstView )
{
pDocSh->SetInplace( false );
- GetViewData()->RefreshZoom(); // recalculate PPT
- if (!pDoc->IsEmbedded())
- pDoc->SetEmbedded( pDoc->GetVisibleTab(), aVisArea ); // VisArea markieren
+ GetViewData().RefreshZoom(); // recalculate PPT
+ if (!rDoc.IsEmbedded())
+ rDoc.SetEmbedded( rDoc.GetVisibleTab(), aVisArea ); // VisArea markieren
}
}
@@ -1649,14 +1649,14 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
// DrawView darf nicht im TabView - ctor angelegt werden,
// wenn die ViewShell noch nicht kostruiert ist...
- if (pDoc->GetDrawLayer())
+ if (rDoc.GetDrawLayer())
MakeDrawView( nForceDesignMode );
ViewOptionsHasChanged(false); // legt auch evtl. DrawView an
::svl::IUndoManager* pMgr = pDocSh->GetUndoManager();
SetUndoManager( pMgr );
pFormShell->SetUndoManager( pMgr );
- if ( !pDoc->IsUndoEnabled() )
+ if ( !rDoc.IsUndoEnabled() )
{
pMgr->SetMaxUndoActionCount( 0 );
}
@@ -1666,11 +1666,11 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
if ( bFirstView ) // first view?
{
- pDoc->SetDocVisible( true ); // used when creating new sheets
+ rDoc.SetDocVisible( true ); // used when creating new sheets
if ( pDocSh->IsEmpty() )
{
// set first sheet's RTL flag (following will already be initialized because of SetDocVisible)
- pDoc->SetLayoutRTL( 0, ScGlobal::IsSystemRTL() );
+ rDoc.SetLayoutRTL( 0, ScGlobal::IsSystemRTL() );
// append additional sheets (not for OLE object)
if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
@@ -1680,7 +1680,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
SCTAB nInitTabCount = rOpt.GetInitTabCount();
for (SCTAB i=1; i<nInitTabCount; i++)
- pDoc->MakeTable(i,false);
+ rDoc.MakeTable(i,false);
}
pDocSh->SetEmpty( false ); // #i6232# make sure this is done only once
@@ -1693,19 +1693,19 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
pDocSh->IsUpdateEnabled() ) // #105575#; update only in the first creation of the ViewShell
{
// Check if there are any external data.
- bool bLink = pDoc->GetExternalRefManager()->hasExternalData();
+ bool bLink = rDoc.GetExternalRefManager()->hasExternalData();
if (!bLink)
{
// #i100042# sheet links can still exist independently from external formula references
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
for (SCTAB i=0; i<nTabCount && !bLink; i++)
- if (pDoc->IsLinked(i))
+ if (rDoc.IsLinked(i))
bLink = true;
}
if (!bLink)
{
- const sc::DocumentLinkManager& rMgr = pDoc->GetDocLinkManager();
- if (rMgr.hasDdeLinks() || pDoc->HasAreaLinks())
+ const sc::DocumentLinkManager& rMgr = rDoc.GetDocLinkManager();
+ if (rMgr.hasDdeLinks() || rDoc.HasAreaLinks())
bLink = true;
}
if (bLink)
@@ -1721,7 +1721,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
}
bool bReImport = false; // importierte Daten aktualisieren
- ScDBCollection* pDBColl = pDoc->GetDBCollection();
+ ScDBCollection* pDBColl = rDoc.GetDBCollection();
if ( pDBColl )
{
const ScDBCollection::NamedDBs& rDBs = pDBColl->getNamedDBs();
@@ -1790,12 +1790,12 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
nForceDesignMode = pPreviewShell->GetSourceDesignMode();
ScPreview* p = pPreviewShell->GetPreview();
if (p)
- GetViewData()->GetMarkData().SetSelectedTabs(p->GetSelectedTabs());
+ GetViewData().GetMarkData().SetSelectedTabs(p->GetSelectedTabs());
}
Construct( nForceDesignMode );
- if ( GetViewData()->GetDocShell()->IsPreview() )
+ if ( GetViewData().GetDocShell()->IsPreview() )
{
// preview for template dialog: always show whole page
SetZoomType( SVX_ZOOM_WHOLEPAGE, true ); // zoom value is recalculated at next Resize
@@ -1823,7 +1823,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
ScTabViewShell::~ScTabViewShell()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
EndListening(*pDocSh);
EndListening(*GetViewFrame());
EndListening(*SFX_APP()); // #i62045# #i62046# needed now - SfxViewShell no longer does it
@@ -1874,11 +1874,11 @@ void ScTabViewShell::SetDialogDPObject( const ScDPObject* pObj )
void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData )
{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocShell->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocShell->GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
OUString aTmp;
- pDoc->GetName(nTab, aTmp);
+ rDoc.GetName(nTab, aTmp);
rData.aTabName = aTmp;
if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
@@ -1903,7 +1903,7 @@ void ScTabViewShell::SetChartArea( const ScRangeListRef& rSource, const Rectangl
bChartAreaValid = true;
aChartSource = rSource;
aChartPos = rDest;
- nChartDestTab = GetViewData()->GetTabNo();
+ nChartDestTab = GetViewData().GetTabNo();
}
bool ScTabViewShell::GetChartArea( ScRangeListRef& rSource, Rectangle& rDest, SCTAB& rTab ) const
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 636fcfb721a4..43bd5976df8b 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -59,7 +59,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
else
{
GetSelEngine()->Reset();
- GetFunctionSet()->SetAnchorFlag(true);
+ GetFunctionSet().SetAnchorFlag(true);
// AnchorFlag, damit gleich mit Control angehaengt werden kann
}
}
@@ -73,8 +73,8 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
case SFX_HINT_DOCCHANGED:
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- if (!pDoc->HasTable( GetViewData()->GetTabNo() ))
+ ScDocument* pDoc = GetViewData().GetDocument();
+ if (!pDoc->HasTable( GetViewData().GetTabNo() ))
{
SetTabNo(0);
}
@@ -107,12 +107,12 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// dieser Hint kommt, den Design-Modus immer dann umschalten, wenn der
// ReadOnly-Status sich wirklich geaendert hat:
- if ( GetViewData()->GetSfxDocShell()->IsReadOnly() != bReadOnly )
+ if ( GetViewData().GetSfxDocShell()->IsReadOnly() != bReadOnly )
{
- bReadOnly = GetViewData()->GetSfxDocShell()->IsReadOnly();
+ bReadOnly = GetViewData().GetSfxDocShell()->IsReadOnly();
SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadOnly);
- GetViewData()->GetDispatcher().Execute( SID_FM_DESIGN_MODE, SFX_CALLMODE_ASYNCHRON,
+ GetViewData().GetDispatcher().Execute( SID_FM_DESIGN_MODE, SFX_CALLMODE_ASYNCHRON,
&aItem, 0L );
UpdateInputContext();
@@ -124,7 +124,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
break;
case SC_HINT_FORCESETTAB:
- SetTabNo( GetViewData()->GetTabNo(), true );
+ SetTabNo( GetViewData().GetTabNo(), true );
break;
default:
@@ -135,7 +135,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
ScPaintHint* pHint = (ScPaintHint*) &rHint;
sal_uInt16 nParts = pHint->GetParts();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
if (pHint->GetStartTab() <= nTab && pHint->GetEndTab() >= nTab)
{
if (nParts & PAINT_EXTRAS) // zuerst, falls Tabelle weg ist !!!
@@ -144,7 +144,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// if the current sheet has pending row height updates (sheet links refreshed),
// execute them before invalidating the window
- GetViewData()->GetDocShell()->UpdatePendingRowHeights( GetViewData()->GetTabNo() );
+ GetViewData().GetDocShell()->UpdatePendingRowHeights( GetViewData().GetTabNo() );
if (nParts & PAINT_SIZE)
RepeatResize(); //! InvalidateBorder ???
@@ -171,7 +171,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// ScEditViewHint kommt nur an aktiver View an
ScEditViewHint* pHint = (ScEditViewHint*) &rHint;
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
if ( pHint->GetTab() == nTab )
{
SCCOL nCol = pHint->GetCol();
@@ -183,14 +183,14 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
StopEditShell(); // sollte nicht gesetzt sein
- ScSplitPos eActive = GetViewData()->GetActivePart();
- if ( GetViewData()->HasEditView(eActive) )
+ ScSplitPos eActive = GetViewData().GetActivePart();
+ if ( GetViewData().HasEditView(eActive) )
{
// MakeEditView geht schief, wenn der Cursor ausserhalb des
// Bildschirms steht. GetEditView gibt dann eine nicht aktive
// View zurueck, darum die Abfrage HasEditView.
- EditView* pView = GetViewData()->GetEditView(eActive); // ist nicht 0
+ EditView* pView = GetViewData().GetEditView(eActive); // ist nicht 0
SetEditShell(pView, true);
}
@@ -200,7 +200,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
else if (rHint.ISA(ScTablesHint)) // Tabelle eingefuegt / geloescht
{
// aktuelle Tabelle zuerst holen (kann bei DeleteTab an ViewData geaendert werden)
- SCTAB nActiveTab = GetViewData()->GetTabNo();
+ SCTAB nActiveTab = GetViewData().GetTabNo();
const ScTablesHint& rTabHint = (const ScTablesHint&)rHint;
SCTAB nTab1 = rTabHint.GetTab1();
@@ -209,24 +209,24 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
switch (nId)
{
case SC_TAB_INSERTED:
- GetViewData()->InsertTab( nTab1 );
+ GetViewData().InsertTab( nTab1 );
break;
case SC_TAB_DELETED:
- GetViewData()->DeleteTab( nTab1 );
+ GetViewData().DeleteTab( nTab1 );
break;
case SC_TAB_MOVED:
- GetViewData()->MoveTab( nTab1, nTab2 );
+ GetViewData().MoveTab( nTab1, nTab2 );
break;
case SC_TAB_COPIED:
- GetViewData()->CopyTab( nTab1, nTab2 );
+ GetViewData().CopyTab( nTab1, nTab2 );
break;
case SC_TAB_HIDDEN:
break;
case SC_TABS_INSERTED:
- GetViewData()->InsertTabs( nTab1, nTab2 );
+ GetViewData().InsertTabs( nTab1, nTab2 );
break;
case SC_TABS_DELETED:
- GetViewData()->DeleteTabs( nTab1, nTab2 );
+ GetViewData().DeleteTabs( nTab1, nTab2 );
break;
default:
OSL_FAIL("unbekannter ScTablesHint");
@@ -281,7 +281,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
break;
}
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( nNewTab >= pDoc->GetTableCount() )
nNewTab = pDoc->GetTableCount() - 1;
diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx
index 65a310fd0798..9b348188d49c 100644
--- a/sc/source/ui/view/tabvwsh8.cxx
+++ b/sc/source/ui/view/tabvwsh8.cxx
@@ -43,7 +43,7 @@ void ScTabViewShell::SetDefaultFrameLine( const ::editeng::SvxBorderLine* pLine
bool ScTabViewShell::HasSelection( bool bText ) const
{
bool bHas = false;
- ScViewData* pData = (ScViewData*)GetViewData(); // const weggecasted
+ ScViewData* pData = (ScViewData*)&GetViewData(); // const weggecasted
if ( bText )
{
// Text enthalten: Anzahl2 >= 1
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 122e24cac482..83d7530a49d8 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -155,7 +155,7 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq )
else
pIMapInfo->SetImageMap( rImageMap );
- GetViewData()->GetDocShell()->SetDrawModified();
+ GetViewData().GetDocShell()->SetDrawModified();
}
}
}
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 8cb4244e8f9a..c01343fe3ff2 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -66,8 +66,8 @@ bool ScTabViewShell::GetFunction( OUString& rFuncStr, sal_uInt16 nErrCode )
OUString aStr;
ScSubTotalFunc eFunc = (ScSubTotalFunc) SC_MOD()->GetAppOptions().GetStatusFunc();
- ScViewData* pViewData = GetViewData();
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScViewData& rViewData = GetViewData();
+ ScMarkData& rMark = rViewData.GetMarkData();
bool bIgnoreError = (rMark.IsMarked() || rMark.IsMultiMarked());
if (bIgnoreError && (eFunc == SUBTOTAL_FUNC_CNT || eFunc == SUBTOTAL_FUNC_CNT2))
@@ -97,10 +97,10 @@ bool ScTabViewShell::GetFunction( OUString& rFuncStr, sal_uInt16 nErrCode )
}
if (nGlobStrId)
{
- ScDocument* pDoc = pViewData->GetDocument();
- SCCOL nPosX = pViewData->GetCurX();
- SCROW nPosY = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
+ ScDocument* pDoc = rViewData.GetDocument();
+ SCCOL nPosX = rViewData.GetCurX();
+ SCROW nPosY = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
aStr = ScGlobal::GetRscString(nGlobStrId);
aStr += "=";
@@ -146,14 +146,14 @@ bool ScTabViewShell::GetFunction( OUString& rFuncStr, sal_uInt16 nErrCode )
void ScTabViewShell::GetState( SfxItemSet& rSet )
{
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScDocShell* pDocShell = pViewData->GetDocShell();
- ScMarkData& rMark = pViewData->GetMarkData();
- SCCOL nPosX = pViewData->GetCurX();
- SCROW nPosY = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
- sal_uInt16 nMyId = 0;
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScDocShell* pDocShell = rViewData.GetDocShell();
+ ScMarkData& rMark = rViewData.GetMarkData();
+ SCCOL nPosX = rViewData.GetCurX();
+ SCROW nPosY = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
+ sal_uInt16 nMyId = 0;
SfxViewFrame* pThisFrame = GetViewFrame();
bool bOle = GetViewFrame()->GetFrame().IsInPlace();
@@ -169,7 +169,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
{
case FID_CHG_COMMENT:
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScAddress aPos( nPosX, nPosY, nTab );
if ( pDocSh->IsReadOnly() || !pDocSh->GetChangeAction(aPos) || pDocSh->IsDocShared() )
rSet.DisableItem( nWhich );
@@ -198,7 +198,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
case SID_STATUS_PAGESTYLE:
case SID_HFEDIT:
- GetViewData()->GetDocShell()->GetStatePageStyle( *this, rSet, nTab );
+ GetViewData().GetDocShell()->GetStatePageStyle( *this, rSet, nTab );
break;
case SID_SEARCH_ITEM:
@@ -216,7 +216,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
sal_uInt16 nOptions = 0xffff;
// No replacement if ReadOnly
- if (GetViewData()->GetDocShell()->IsReadOnly())
+ if (GetViewData().GetDocShell()->IsReadOnly())
nOptions &= ~( SEARCH_OPTIONS_REPLACE | SEARCH_OPTIONS_REPLACE_ALL );
rSet.Put( SfxUInt16Item( nWhich, nOptions ) );
}
@@ -224,7 +224,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
case SID_CURRENTCELL:
{
- ScAddress aScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(), 0 );
+ ScAddress aScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), 0 );
OUString aAddr(aScAddress.Format(SCA_ABS, NULL, pDoc->GetAddressConvention()));
SfxStringItem aPosItem( SID_CURRENTCELL, aAddr );
@@ -234,11 +234,11 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
case SID_CURRENTTAB:
// Table for Basic is 1-based
- rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(GetViewData()->GetTabNo()) + 1 ) );
+ rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(GetViewData().GetTabNo()) + 1 ) );
break;
case SID_CURRENTDOC:
- rSet.Put( SfxStringItem( nWhich, GetViewData()->GetDocShell()->GetTitle() ) );
+ rSet.Put( SfxStringItem( nWhich, GetViewData().GetDocShell()->GetTitle() ) );
break;
case FID_TOGGLEINPUTLINE:
@@ -288,7 +288,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
rSet.DisableItem( nWhich );
else
{
- const Fraction& rOldY = GetViewData()->GetZoomY();
+ const Fraction& rOldY = GetViewData().GetZoomY();
sal_uInt16 nZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 )
/ rOldY.GetDenominator());
rSet.Put( SvxZoomItem( SVX_ZOOM_PERCENT, nZoom, nWhich ) );
@@ -301,7 +301,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
rSet.DisableItem( nWhich );
else
{
- const Fraction& rOldY = GetViewData()->GetZoomY();
+ const Fraction& rOldY = GetViewData().GetZoomY();
sal_uInt16 nCurrentZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator());
if( nCurrentZoom )
@@ -315,16 +315,16 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
break;
case FID_TOGGLESYNTAX:
- rSet.Put(SfxBoolItem(nWhich, GetViewData()->IsSyntaxMode()));
+ rSet.Put(SfxBoolItem(nWhich, GetViewData().IsSyntaxMode()));
break;
case FID_TOGGLEHEADERS:
- rSet.Put(SfxBoolItem(nWhich, GetViewData()->IsHeaderMode()));
+ rSet.Put(SfxBoolItem(nWhich, GetViewData().IsHeaderMode()));
break;
case FID_TOGGLEFORMULA:
{
- const ScViewOptions& rOpts = pViewData->GetOptions();
+ const ScViewOptions& rOpts = rViewData.GetOptions();
bool bFormulaMode = rOpts.GetOption( VOPT_FORMULAS );
rSet.Put(SfxBoolItem(nWhich, bFormulaMode ));
}
@@ -340,8 +340,8 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
}
else
{
- rSet.Put(SfxBoolItem(FID_NORMALVIEWMODE, !GetViewData()->IsPagebreakMode()));
- rSet.Put(SfxBoolItem(FID_PAGEBREAKMODE, GetViewData()->IsPagebreakMode()));
+ rSet.Put(SfxBoolItem(FID_NORMALVIEWMODE, !GetViewData().IsPagebreakMode()));
+ rSet.Put(SfxBoolItem(FID_PAGEBREAKMODE, GetViewData().IsPagebreakMode()));
}
break;
@@ -378,7 +378,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
case SID_AUTO_OUTLINE:
{
- if (pDoc->GetChangeTrack()!=NULL || GetViewData()->IsMultiMarked())
+ if (pDoc->GetChangeTrack()!=NULL || GetViewData().IsMultiMarked())
{
rSet.DisableItem( nWhich );
}
@@ -387,7 +387,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
case SID_OUTLINE_DELETEALL:
{
- SCTAB nOlTab = GetViewData()->GetTabNo();
+ SCTAB nOlTab = GetViewData().GetTabNo();
ScOutlineTable* pOlTable = pDoc->GetOutlineTable( nOlTab );
if (pOlTable == NULL)
rSet.DisableItem( nWhich );
@@ -396,14 +396,14 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
case SID_WINDOW_SPLIT:
rSet.Put(SfxBoolItem(nWhich,
- pViewData->GetHSplitMode() == SC_SPLIT_NORMAL ||
- pViewData->GetVSplitMode() == SC_SPLIT_NORMAL ));
+ rViewData.GetHSplitMode() == SC_SPLIT_NORMAL ||
+ rViewData.GetVSplitMode() == SC_SPLIT_NORMAL ));
break;
case SID_WINDOW_FIX:
rSet.Put(SfxBoolItem(nWhich,
- pViewData->GetHSplitMode() == SC_SPLIT_FIX ||
- pViewData->GetVSplitMode() == SC_SPLIT_FIX ));
+ rViewData.GetHSplitMode() == SC_SPLIT_FIX ||
+ rViewData.GetVSplitMode() == SC_SPLIT_FIX ));
break;
case FID_CHG_SHOW:
@@ -442,7 +442,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
break;
case SID_READONLY_MODE:
- rSet.Put( SfxBoolItem( nWhich, GetViewData()->GetDocShell()->IsReadOnly() ) );
+ rSet.Put( SfxBoolItem( nWhich, GetViewData().GetDocShell()->IsReadOnly() ) );
break;
case FID_TAB_DESELECTALL:
@@ -458,7 +458,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName)
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
SvxBoxItem aLineOuter( ATTR_BORDER );
SvxBoxInfoItem aLineInner( ATTR_BORDER_INNER );
@@ -492,7 +492,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
// Get border items and put them in the set:
GetSelectionFrame( aLineOuter, aLineInner );
//Fix border incorrect for RTL fdo#62399
- if( pDoc->IsLayoutRTL( GetViewData()->GetTabNo() ) )
+ if( pDoc->IsLayoutRTL( GetViewData().GetTabNo() ) )
{
SvxBoxItem aNewFrame( aLineOuter );
SvxBoxInfoItem aTempInfo( aLineInner );
@@ -516,7 +516,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
pOldSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT,
pOldAttrs->GetNumberFormat( pDoc->GetFormatTable() ) ) );
- pNumberInfoItem.reset(MakeNumberInfoItem(pDoc, GetViewData()));
+ pNumberInfoItem.reset(MakeNumberInfoItem(pDoc, &GetViewData()));
pOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO );
pOldSet->Put(*pNumberInfoItem );
@@ -565,21 +565,18 @@ bool ScTabViewShell::IsRefInputMode() const
if ( !pHdl->GetSelIsRef() && aString.getLength() > 1 &&
( aString[0] == '+' || aString[0] == '-' ) )
{
- const ScViewData* pViewData = GetViewData();
- if ( pViewData )
+ const ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ if ( pDoc )
{
- ScDocument* pDoc = pViewData->GetDocument();
- if ( pDoc )
+ const ScAddress aPos( rViewData.GetCurPos() );
+ ScCompiler aComp( pDoc, aPos );
+ aComp.SetGrammar(pDoc->GetGrammar());
+ aComp.SetCloseBrackets( false );
+ boost::scoped_ptr<ScTokenArray> pArr(aComp.CompileString(aString));
+ if ( pArr && pArr->MayReferenceFollow() )
{
- const ScAddress aPos( pViewData->GetCurPos() );
- ScCompiler aComp( pDoc, aPos );
- aComp.SetGrammar(pDoc->GetGrammar());
- aComp.SetCloseBrackets( false );
- boost::scoped_ptr<ScTokenArray> pArr(aComp.CompileString(aString));
- if ( pArr && pArr->MayReferenceFollow() )
- {
- return true;
- }
+ return true;
}
}
}
@@ -614,21 +611,21 @@ void ScTabViewShell::UpdateInputHandler( bool bForce /* = sal_False */, bool bSt
{
OUString aString;
const EditTextObject* pObject = NULL;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
CellType eType;
- SCCOL nPosX = pViewData->GetCurX();
- SCROW nPosY = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
+ SCCOL nPosX = rViewData.GetCurX();
+ SCROW nPosY = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
SCTAB nStartTab = 0;
SCTAB nEndTab = 0;
SCCOL nStartCol = 0;
SCROW nStartRow = 0;
SCCOL nEndCol = 0;
SCROW nEndRow = 0;
- ScAddress aPos = pViewData->GetCurPos();
+ ScAddress aPos = rViewData.GetCurPos();
- pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
+ rViewData.GetSimpleArea( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab );
PutInOrder( nStartCol, nEndCol );
@@ -711,24 +708,24 @@ void ScTabViewShell::ExecuteSave( SfxRequest& rReq )
// Finish entering in any case, even if a formula is being processed
SC_MOD()->InputEnterHandler();
- if ( GetViewData()->GetDocShell()->IsDocShared() )
+ if ( GetViewData().GetDocShell()->IsDocShared() )
{
- GetViewData()->GetDocShell()->SetDocumentModified();
+ GetViewData().GetDocShell()->SetDocumentModified();
}
// otherwise as normal
- GetViewData()->GetDocShell()->ExecuteSlot( rReq );
+ GetViewData().GetDocShell()->ExecuteSlot( rReq );
}
void ScTabViewShell::GetSaveState( SfxItemSet& rSet )
{
- SfxShell* pDocSh = GetViewData()->GetDocShell();
+ SfxShell* pDocSh = GetViewData().GetDocShell();
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
while( nWhich )
{
- if ( nWhich != SID_SAVEDOC || !GetViewData()->GetDocShell()->IsDocShared() )
+ if ( nWhich != SID_SAVEDOC || !GetViewData().GetDocShell()->IsDocShared() )
{
// get state from DocShell
pDocSh->GetSlotState( nWhich, NULL, &rSet );
@@ -739,7 +736,7 @@ void ScTabViewShell::GetSaveState( SfxItemSet& rSet )
void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq )
{
- ScViewOptions aViewOptions = GetViewData()->GetOptions();
+ ScViewOptions aViewOptions = GetViewData().GetOptions();
ScGridOptions aGridOptions = aViewOptions.GetGridOptions();
SfxBindings& rBindings = GetViewFrame()->GetBindings();
@@ -775,14 +772,14 @@ void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq )
break;
}
- GetViewData()->SetOptions(aViewOptions);
+ GetViewData().SetOptions(aViewOptions);
}
void ScTabViewShell::GetDrawOptState( SfxItemSet& rSet )
{
SfxBoolItem aBool;
- const ScViewOptions& rViewOptions = GetViewData()->GetOptions();
+ const ScViewOptions& rViewOptions = GetViewData().GetOptions();
const ScGridOptions& rGridOptions = rViewOptions.GetGridOptions();
aBool.SetValue(rGridOptions.GetGridVisible());
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 3871bc8dce35..6db2356d9130 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -210,7 +210,7 @@ bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
}
//! SetDocumentName sollte schon im Sfx passieren ???
//TODO/LATER: how "SetDocumentName"?
- //xIPObj->SetDocumentName( GetViewData()->GetDocShell()->GetTitle() );
+ //xIPObj->SetDocumentName( GetViewData().GetDocShell()->GetTitle() );
return ( !(nErr & ERRCODE_ERROR_MASK) );
}
@@ -273,16 +273,16 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
// Rahmen fuer Chart einfuegen wird abgebrochen:
FuPoor* pPoor = GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == SID_DRAW_CHART )
- GetViewData()->GetDispatcher().Execute(SID_DRAW_CHART, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
+ GetViewData().GetDispatcher().Execute(SID_DRAW_CHART, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
MakeDrawLayer();
SfxBindings& rBindings = GetViewFrame()->GetBindings();
- ScTabView* pTabView = GetViewData()->GetView();
+ ScTabView* pTabView = GetViewData().GetView();
Window* pWin = pTabView->GetActiveWin();
ScDrawView* pView = pTabView->GetScDrawView();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
SdrModel* pDrModel = pView->GetModel();
switch ( nSlot )
@@ -362,7 +362,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
case SID_LINKS:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( pWin, pDoc->GetLinkManager() );
+ SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( pWin, rDoc.GetLinkManager() );
if ( pDlg )
{
pDlg->Execute();
@@ -438,8 +438,8 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
{
bool bOle = GetViewFrame()->GetFrame().IsInPlace();
- bool bTabProt = GetViewData()->GetDocument()->IsTabProtected(GetViewData()->GetTabNo());
- ScDocShell* pDocShell = ( GetViewData() ? GetViewData()->GetDocShell() : NULL );
+ bool bTabProt = GetViewData().GetDocument()->IsTabProtected(GetViewData().GetTabNo());
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
bool bShared = pDocShell && pDocShell->IsDocShared();
SfxWhichIter aIter(rSet);
@@ -483,7 +483,7 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
case SID_LINKS:
{
- if (GetViewData()->GetDocument()->GetLinkManager()->GetLinks().empty())
+ if (GetViewData().GetDocument()->GetLinkManager()->GetLinks().empty())
rSet.DisableItem( SID_LINKS );
}
break;
@@ -495,11 +495,11 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
{
- SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ SfxShell* pSh = GetViewData().GetDispatcher().GetShell(0);
::svl::IUndoManager* pUndoManager = pSh->GetUndoManager();
const SfxItemSet* pReqArgs = rReq.GetArgs();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
sal_uInt16 nSlot = rReq.GetSlot();
switch ( nSlot )
@@ -549,7 +549,7 @@ void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
{
- SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ SfxShell* pSh = GetViewData().GetDispatcher().GetShell(0);
::svl::IUndoManager* pUndoManager = pSh->GetUndoManager();
SfxWhichIter aIter(rSet);
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 9d858a658b68..99da797cda2e 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -126,7 +126,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
// the dialog has been opened in a different view
// -> lock the dispatcher for this view (modal mode)
- GetViewData()->GetDispatcher().Lock( true ); // lock is reset when closing dialog
+ GetViewData().GetDispatcher().Lock( true ); // lock is reset when closing dialog
return NULL;
}
@@ -135,7 +135,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
if(pCW)
pCW->SetHideNotDelete(true);
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
switch( nSlotId )
{
@@ -143,17 +143,17 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
if (!mbInSwitch)
{
- pResult = new ScNameDlg( pB, pCW, pParent, GetViewData(),
- ScAddress( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() ) );
+ pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(),
+ ScAddress( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() ) );
}
else
{
- pResult = new ScNameDlg( pB, pCW, pParent, GetViewData(),
- ScAddress( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() ), &maRangeMap);
+ pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(),
+ ScAddress( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() ), &maRangeMap);
static_cast<ScNameDlg*>(pResult)->SetEntry( maName, maScope);
mbInSwitch = false;
}
@@ -166,10 +166,10 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
std::map<OUString, ScRangeName*> aRangeMap;
pDoc->GetRangeNameMap(aRangeMap);
- pResult = new ScNameDefDlg( pB, pCW, pParent, GetViewData(), aRangeMap,
- ScAddress( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() ), true );
+ pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap,
+ ScAddress( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() ), true );
}
else
{
@@ -179,17 +179,17 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr->first, itr->second));
}
- pResult = new ScNameDefDlg( pB, pCW, pParent, GetViewData(), aRangeMap,
- ScAddress( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() ), false );
+ pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap,
+ ScAddress( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() ), false );
}
}
break;
case SID_DEFINE_COLROWNAMERANGES:
{
- pResult = new ScColRowNameRangesDlg( pB, pCW, pParent, GetViewData() );
+ pResult = new ScColRowNameRangesDlg( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -209,7 +209,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
SCROW nStartRow, nEndRow;
SCTAB nStartTab, nEndTab;
- GetViewData()->GetSimpleArea( nStartCol, nStartRow, nStartTab,
+ GetViewData().GetSimpleArea( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab );
PutInOrder( nStartCol, nEndCol );
@@ -235,11 +235,11 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// wenn auf einem bestehenden Bereich aufgerufen, den markieren
GetDBData( true, SC_DB_OLD );
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
MarkDataArea( false );
- pResult = new ScDbNameDlg( pB, pCW, pParent, GetViewData() );
+ pResult = new ScDbNameDlg( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -258,7 +258,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
pDBData->GetArea(aArea);
MarkRange(aArea, false);
- ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
+ ScQueryItem aItem( SCITEM_QUERYDATA, &GetViewData(), &aQueryParam );
ScRange aAdvSource;
if (pDBData->GetAdvancedQuerySource(aAdvSource))
aItem.SetAdvancedQuerySource( &aAdvSource );
@@ -266,7 +266,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
aArgSet.Put( aItem );
// aktuelle Tabelle merken (wg. RefInput im Dialog)
- GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
+ GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
pResult = new ScSpecialFilterDlg( pB, pCW, pParent, aArgSet );
}
@@ -289,11 +289,11 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
MarkRange(aArea, false);
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
- GetViewData(),
+ &GetViewData(),
&aQueryParam ) );
// aktuelle Tabelle merken (wg. RefInput im Dialog)
- GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
+ GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
pResult = new ScFilterDlg( pB, pCW, pParent, aArgSet );
}
@@ -301,91 +301,91 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
case SID_OPENDLG_TABOP:
{
- ScViewData* pViewData = GetViewData();
- ScRefAddress aCurPos ( pViewData->GetCurX(),
- pViewData->GetCurY(),
- pViewData->GetTabNo(),
+ ScViewData& rViewData = GetViewData();
+ ScRefAddress aCurPos ( rViewData.GetCurX(),
+ rViewData.GetCurY(),
+ rViewData.GetTabNo(),
false, false, false );
- pResult = new ScTabOpDlg( pB, pCW, pParent, pViewData->GetDocument(), aCurPos );
+ pResult = new ScTabOpDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
case SID_OPENDLG_SOLVE:
{
- ScViewData* pViewData = GetViewData();
- ScAddress aCurPos( pViewData->GetCurX(),
- pViewData->GetCurY(),
- pViewData->GetTabNo());
- pResult = new ScSolverDlg( pB, pCW, pParent, pViewData->GetDocument(), aCurPos );
+ ScViewData& rViewData = GetViewData();
+ ScAddress aCurPos( rViewData.GetCurX(),
+ rViewData.GetCurY(),
+ rViewData.GetTabNo());
+ pResult = new ScSolverDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
{
- pResult = new ScRandomNumberGeneratorDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScRandomNumberGeneratorDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_SAMPLING_DIALOG:
{
- pResult = new ScSamplingDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScSamplingDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_DESCRIPTIVE_STATISTICS_DIALOG:
{
- pResult = new ScDescriptiveStatisticsDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScDescriptiveStatisticsDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
- pResult = new ScAnalysisOfVarianceDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScAnalysisOfVarianceDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_CORRELATION_DIALOG:
{
- pResult = new ScCorrelationDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScCorrelationDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_COVARIANCE_DIALOG:
{
- pResult = new ScCovarianceDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScCovarianceDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_EXPONENTIAL_SMOOTHING_DIALOG:
{
- pResult = new ScExponentialSmoothingDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScExponentialSmoothingDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_MOVING_AVERAGE_DIALOG:
{
- pResult = new ScMovingAverageDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScMovingAverageDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_TTEST_DIALOG:
{
- pResult = new ScTTestDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScTTestDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_FTEST_DIALOG:
{
- pResult = new ScFTestDialog( pB, pCW, pParent, GetViewData() );
+ pResult = new ScFTestDialog( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_OPENDLG_OPTSOLVER:
{
- ScViewData* pViewData = GetViewData();
- ScAddress aCurPos( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
- pResult = new ScOptSolverDlg( pB, pCW, pParent, pViewData->GetDocShell(), aCurPos );
+ ScViewData& rViewData = GetViewData();
+ ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
+ pResult = new ScOptSolverDlg( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos );
}
break;
@@ -396,10 +396,10 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
if( pDialogDPObject )
{
// Check for an existing datapilot output.
- ScViewData* pViewData = GetViewData();
- pViewData->SetRefTabNo( pViewData->GetTabNo() );
- ScDPObject* pObj = pDoc->GetDPAtCursor(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
- pResult = new ScPivotLayoutDialog(pB, pCW, pParent, pViewData, pDialogDPObject, pObj == NULL);
+ ScViewData& rViewData = GetViewData();
+ rViewData.SetRefTabNo( rViewData.GetTabNo() );
+ ScDPObject* pObj = pDoc->GetDPAtCursor(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
+ pResult = new ScPivotLayoutDialog(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == NULL);
}
}
break;
@@ -414,7 +414,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- pResult = new ScFormulaDlg( pB, pCW, pParent, GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
+ pResult = new ScFormulaDlg( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
}
break;
@@ -430,7 +430,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- pResult = new ScHighlightChgDlg( pB, pCW, pParent, GetViewData() );
+ pResult = new ScHighlightChgDlg( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -438,9 +438,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- ScViewData* pViewData = GetViewData();
- pViewData->SetRefTabNo( pViewData->GetTabNo() );
- pResult = new ScSimpleRefDlg( pB, pCW, pParent, pViewData );
+ ScViewData& rViewData = GetViewData();
+ rViewData.SetRefTabNo( rViewData.GetTabNo() );
+ pResult = new ScSimpleRefDlg( pB, pCW, pParent, &rViewData );
}
break;
diff --git a/sc/source/ui/view/tabvwshd.cxx b/sc/source/ui/view/tabvwshd.cxx
index f3431d332125..828b3e0fd8b5 100644
--- a/sc/source/ui/view/tabvwshd.cxx
+++ b/sc/source/ui/view/tabvwshd.cxx
@@ -55,7 +55,7 @@ Window* ScTabViewShell::GetDialogParent()
}
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
if ( pDocSh->IsOle() )
{
// TODO/LATER: how to GetEditWindow in embedded document?!
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index 2629d49c5eae..6904328d25d4 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -54,9 +54,9 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
{
ScRange aRange;
- if ( GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( bInFormatDialog && aRange.aStart.Row() != aRange.aEnd.Row() )
{
// Range auf eine Datenzeile begrenzen
@@ -95,7 +95,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
}
ScImportExport aObj( pDoc, aRange );
- aObj.SetFormulas( GetViewData()->GetOptions().GetOption( VOPT_FORMULAS ) );
+ aObj.SetFormulas( GetViewData().GetOptions().GetOption( VOPT_FORMULAS ) );
OUString aExportOUString;
aObj.ExportString( aExportOUString );
aStrSelection = convertLineEnd(aExportOUString, LINEEND_CR);
@@ -125,7 +125,7 @@ void ScTabViewShell::InsertURL( const OUString& rName, const OUString& rURL, con
if ( bAsText )
{
- if ( GetViewData()->IsActive() )
+ if ( GetViewData().IsActive() )
{
// if the view is active, always use InsertURLField, which starts EditMode
// and selects the URL, so it can be changed from the URL bar / dialog
@@ -138,8 +138,8 @@ void ScTabViewShell::InsertURL( const OUString& rName, const OUString& rURL, con
// -> use InsertBookmark to directly manipulate cell content
// bTryReplace=sal_True -> if cell contains only one URL, replace it
- SCCOL nPosX = GetViewData()->GetCurX();
- SCROW nPosY = GetViewData()->GetCurY();
+ SCCOL nPosX = GetViewData().GetCurX();
+ SCROW nPosY = GetViewData().GetCurY();
InsertBookmark( rName, rURL, nPosX, nPosY, &rTarget, true );
}
}
@@ -168,9 +168,9 @@ void ScTabViewShell::InsertURLField( const OUString& rName, const OUString& rURL
aURLField.SetTargetFrame( rTarget );
SvxFieldItem aURLItem( aURLField, EE_FEATURE_FIELD );
- ScViewData* pViewData = GetViewData();
+ ScViewData& rViewData = GetViewData();
ScModule* pScMod = SC_MOD();
- ScInputHandler* pHdl = pScMod->GetInputHdl( pViewData->GetViewShell() );
+ ScInputHandler* pHdl = pScMod->GetInputHdl( rViewData.GetViewShell() );
bool bSelectFirst = false;
if ( !pScMod->IsEditMode() )
@@ -239,7 +239,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
SvxSearchDialog* pSearchDlg = (SvxSearchDialog*)(pChildWindow->GetWindow());
if( pSearchDlg )
{
- ScTabView* pTabView = GetViewData()->GetView();
+ ScTabView* pTabView = GetViewData().GetView();
if( pTabView )
{
Window* pWin = pTabView->GetActiveWin();
@@ -298,7 +298,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
// Request ausfuehren (dabei wird das SearchItem gespeichert)
aSearchItem.SetWhich(SID_SEARCH_ITEM);
- GetViewData()->GetDispatcher().Execute( FID_SEARCH_NOW,
+ GetViewData().GetDispatcher().Execute( FID_SEARCH_NOW,
rReq.IsAPI() ? SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON :
SFX_CALLMODE_STANDARD,
&aSearchItem, 0L );
@@ -309,7 +309,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
SvxSearchDialog* pSearchDlg = (SvxSearchDialog*)(pChildWindow->GetWindow());
if( pSearchDlg )
{
- ScTabView* pTabView = GetViewData()->GetView();
+ ScTabView* pTabView = GetViewData().GetView();
if( pTabView )
{
Window* pWin = pTabView->GetActiveWin();
@@ -324,7 +324,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
}
else
{
- GetViewData()->GetDispatcher().Execute(
+ GetViewData().GetDispatcher().Execute(
SID_SEARCH_DLG, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD );
}
}
@@ -335,7 +335,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
SvxSearchItem aSearchItem = ScGlobal::GetSearchItem();
aSearchItem.SetWhich(SID_SEARCH_ITEM);
- GetViewData()->GetDispatcher().Execute( FID_SEARCH_NOW,
+ GetViewData().GetDispatcher().Execute( FID_SEARCH_NOW,
rReq.IsAPI() ? SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON :
SFX_CALLMODE_STANDARD,
&aSearchItem, 0L );
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 01b33721543d..06701689f913 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -57,12 +57,12 @@ using namespace com::sun::star;
void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
- SCTAB nCurrentTab = pViewData->GetTabNo();
+ SCTAB nCurrentTab = rViewData.GetTabNo();
SCTAB nTabCount = pDoc->GetTableCount();
- sal_uInt16 nSlot = rReq.GetSlot();
+ sal_uInt16 nSlot = rReq.GetSlot();
const SfxItemSet* pReqArgs = rReq.GetArgs();
HideListBox(); // Autofilter-DropDown-Listbox
@@ -86,7 +86,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
if ( pDoc->IsDocEditable() )
{
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScMarkData& rMark = rViewData.GetMarkData();
HideTable( rMark );
}
}
@@ -103,7 +103,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
if ( pDoc->IsDocEditable() )
{
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScMarkData& rMark = rViewData.GetMarkData();
HideTable( rMark );
}
}
@@ -165,7 +165,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
case FID_INS_TABLE:
case FID_INS_TABLE_EXT:
{
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScMarkData& rMark = rViewData.GetMarkData();
SCTAB nTabSelCount = rMark.GetSelectCount();
SCTAB nTabNr = nCurrentTab;
@@ -199,7 +199,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- boost::scoped_ptr<AbstractScInsertTableDlg> pDlg(pFact->CreateScInsertTableDlg(GetDialogParent(), *pViewData,
+ boost::scoped_ptr<AbstractScInsertTableDlg> pDlg(pFact->CreateScInsertTableDlg(GetDialogParent(), rViewData,
nTabSelCount, nSlot == FID_INS_TABLE_EXT));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( RET_OK == pDlg->Execute() )
@@ -306,8 +306,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if ( nSlot == FID_TAB_MENU_RENAME )
nSlot = FID_TAB_RENAME; // Execute ist gleich
- SCTAB nTabNr = pViewData->GetTabNo();
- ScMarkData& rMark = pViewData->GetMarkData();
+ SCTAB nTabNr = rViewData.GetTabNo();
+ ScMarkData& rMark = rViewData.GetMarkData();
SCTAB nTabSelCount = rMark.GetSelectCount();
if ( !pDoc->IsDocEditable() )
@@ -363,7 +363,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
case FID_TAB_RENAME:
aDlgTitle = OUString(ScResId(SCSTR_RENAMETAB));
- pDoc->GetName( pViewData->GetTabNo(), aName );
+ pDoc->GetName( rViewData.GetTabNo(), aName );
pHelpId = HID_SC_RENAME_NAME;
break;
}
@@ -431,7 +431,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
bool bDoIt = false;
sal_uInt16 nDoc = 0;
- SCTAB nTab = pViewData->GetTabNo();
+ SCTAB nTab = rViewData.GetTabNo();
bool bCpy = false;
OUString aDocName;
OUString aTabName;
@@ -470,9 +470,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if (aDocName.equals(pScSh->GetTitle()))
{
nDoc = i;
- ScDocument* pDestDoc = pScSh->GetDocument();
- nTableCount = pDestDoc->GetTableCount();
- bDoIt = pDestDoc->IsDocEditable();
+ ScDocument& rDestDoc = pScSh->GetDocument();
+ nTableCount = rDestDoc.GetTableCount();
+ bDoIt = rDestDoc.IsDocEditable();
break;
}
@@ -493,7 +493,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
else
{
OUString aDefaultName;
- pDoc->GetName( pViewData->GetTabNo(), aDefaultName );
+ pDoc->GetName( rViewData.GetTabNo(), aDefaultName );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
@@ -503,7 +503,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
OSL_ENSURE(pDlg, "Dialog create fail!");
SCTAB nTableCount = pDoc->GetTableCount();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
SCTAB nTabSelCount = rMark.GetSelectCount();
@@ -536,7 +536,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if (pSh)
{
aFoundDocName = pSh->GetTitle();
- if ( !pSh->GetDocument()->IsDocEditable() )
+ if ( !pSh->GetDocument().IsDocEditable() )
{
ErrorMessage(STR_READONLYERR);
bDoIt = false;
@@ -580,7 +580,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
SCTAB nNewTab = nCurrentTab;
SCTAB nFirstTab=0;
bool bTabFlag=false;
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScMarkData& rMark = rViewData.GetMarkData();
std::vector<SCTAB> TheTabs;
for(SCTAB i=0;i<nTabCount;i++)
{
@@ -594,7 +594,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
if(nNewTab>=nTabCount) nNewTab=nFirstTab;
- pViewData->SetTabNo(nNewTab);
+ rViewData.SetTabNo(nNewTab);
DeleteTables(TheTabs);
TheTabs.clear();
rReq.Done();
@@ -604,11 +604,11 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
case FID_TAB_RTL:
{
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
ScDocFunc &rFunc = pDocSh->GetDocFunc();
bool bSet = !pDoc->IsLayoutRTL( nCurrentTab );
- const ScMarkData& rMark = pViewData->GetMarkData();
+ const ScMarkData& rMark = rViewData.GetMarkData();
if ( rMark.GetSelectCount() != 0 )
{
// handle several sheets
@@ -630,8 +630,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
case FID_TAB_TOGGLE_GRID:
{
- bool bShowGrid = pViewData->GetShowGrid();
- pViewData->SetShowGrid(!bShowGrid);
+ bool bShowGrid = rViewData.GetShowGrid();
+ rViewData.SetShowGrid(!bShowGrid);
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
PaintGrid();
@@ -644,8 +644,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
if ( nSlot == FID_TAB_MENU_SET_TAB_BG_COLOR )
nSlot = FID_TAB_SET_TAB_BG_COLOR;
- SCTAB nTabNr = pViewData->GetTabNo();
- ScMarkData& rMark = pViewData->GetMarkData();
+ SCTAB nTabNr = rViewData.GetTabNo();
+ ScMarkData& rMark = rViewData.GetMarkData();
SCTAB nTabSelCount = rMark.GetSelectCount();
if ( !pDoc->IsDocEditable() )
break;
@@ -751,9 +751,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
break;
- case FID_TAB_EVENTS:
+ case FID_TAB_EVENTS:
{
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
uno::Reference<container::XNameReplace> xEvents( new ScSheetEventsObj( pDocSh, nCurrentTab ) );
uno::Reference<frame::XFrame> xFrame = GetViewFrame()->GetFrame().GetFrameInterface();
SvxAbstractDialogFactory* pDlgFactory = SvxAbstractDialogFactory::Create();
@@ -769,19 +769,19 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
break;
- default:
+ default:
OSL_FAIL("Unbekannte Message bei ViewShell");
break;
- }
}
+}
- void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
- {
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScDocShell* pDocShell = pViewData->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- SCTAB nTab = pViewData->GetTabNo();
+void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+{
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScDocShell* pDocShell = rViewData.GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ SCTAB nTab = rViewData.GetTabNo();
SCTAB nTabCount = pDoc->GetTableCount();
SCTAB nTabSelCount = rMark.GetSelectCount();
@@ -904,7 +904,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
break;
case FID_TAB_TOGGLE_GRID:
- rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
+ rSet.Put( SfxBoolItem(nWhich, rViewData.GetShowGrid()) );
break;
}
nWhich = aIter.NextWhich();
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index a2457bd312b8..e38b495f9fe7 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -43,9 +43,9 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR
{
// Tabelle geschuetzt ?
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- SCTAB nTab = pViewData->GetTabNo();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ SCTAB nTab = rViewData.GetTabNo();
if ( pDoc->IsTabProtected(nTab) )
{
ErrorMessage(STR_PROTECTIONERR);
@@ -54,7 +54,7 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR
MakeDrawLayer();
- ScTabView* pView = pViewData->GetView();
+ ScTabView* pView = rViewData.GetView();
ScDrawView* pDrView = pView->GetScDrawView();
SdrModel* pModel = pDrView->GetModel();
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 3853aad088f3..5ce836ce3b64 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -177,7 +177,7 @@ void ScTabViewShell::GetObjectState( SfxItemSet& rSet )
uno::Reference < embed::XEmbeddedObject > xOLE = lcl_GetSelectedObj( GetSdrView() );
if (xOLE.is())
{
- aName = GetViewData()->GetSfxDocShell()->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xOLE );
+ aName = GetViewData().GetSfxDocShell()->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xOLE );
}
rSet.Put( SfxStringItem( nWhich, aName ) );
}
@@ -224,7 +224,7 @@ void ScTabViewShell::AddAccessibilityObject( SfxListener& rObject )
pAccessibilityBroadcaster = new SfxBroadcaster;
rObject.StartListening( *pAccessibilityBroadcaster );
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if (pDoc)
pDoc->AddUnoObject(rObject);
}
@@ -234,7 +234,7 @@ void ScTabViewShell::RemoveAccessibilityObject( SfxListener& rObject )
if (pAccessibilityBroadcaster)
{
rObject.EndListening( *pAccessibilityBroadcaster );
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if (pDoc)
pDoc->RemoveUnoObject(rObject);
}
@@ -257,7 +257,7 @@ bool ScTabViewShell::HasAccessibilityObjects()
bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash)
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
boost::scoped_ptr<ScRetypePassDlg> pDlg(new ScRetypePassDlg(GetDialogParent()));
pDlg->SetDataFromDocument(*pDoc);
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 14d41550082e..a1a5c709ff98 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -354,7 +354,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
if (pDocShell)
{
- pDoc = pDocShell->GetDocument();
+ pDoc = &pDocShell->GetDocument();
*pOptions = pDoc->GetViewOptions();
}
@@ -445,7 +445,7 @@ ScDocument* ScViewData::GetDocument() const
if (pDoc)
return pDoc;
else if (pDocShell)
- return pDocShell->GetDocument();
+ return &pDocShell->GetDocument();
OSL_FAIL("kein Document an ViewData");
return NULL;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 85ec4034a554..3a9724ccef62 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -103,23 +103,23 @@ void VBA_DeleteModule( ScDocShell& rDocSh, const OUString& sModuleName );
bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
if (!pMarkData)
- pMarkData = &GetViewData()->GetMarkData();
+ pMarkData = &GetViewData().GetMarkData();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
std::vector<sc::ColRowSpan> aMarkedRows = pMarkData->GetMarkedRowSpans();
if (aMarkedRows.empty())
{
- SCROW nCurRow = GetViewData()->GetCurY();
+ SCROW nCurRow = GetViewData().GetCurY();
aMarkedRows.push_back(sc::ColRowSpan(nCurRow, nCurRow));
}
- double nPPTX = GetViewData()->GetPPTX();
- double nPPTY = GetViewData()->GetPPTY();
- Fraction aZoomX = GetViewData()->GetZoomX();
- Fraction aZoomY = GetViewData()->GetZoomY();
+ double nPPTX = GetViewData().GetPPTX();
+ double nPPTY = GetViewData().GetPPTY();
+ Fraction aZoomX = GetViewData().GetZoomX();
+ Fraction aZoomY = GetViewData().GetZoomY();
ScSizeDeviceProvider aProv(pDocSh);
if (aProv.IsPrinter())
@@ -142,7 +142,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData )
{
SCROW nStartNo = itRows->mnStart;
SCROW nEndNo = itRows->mnEnd;
- if (pDoc->SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab))
+ if (rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab))
{
if (!bChanged)
nPaintY = nStartNo;
@@ -155,7 +155,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData )
}
if ( bPaint && bAnyChanged )
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
return bAnyChanged;
}
@@ -163,16 +163,16 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData )
bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, bool bPaint )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
- double nPPTX = GetViewData()->GetPPTX();
- double nPPTY = GetViewData()->GetPPTY();
- Fraction aZoomX = GetViewData()->GetZoomX();
- Fraction aZoomY = GetViewData()->GetZoomY();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
+ double nPPTX = GetViewData().GetPPTX();
+ double nPPTY = GetViewData().GetPPTY();
+ Fraction aZoomX = GetViewData().GetZoomX();
+ Fraction aZoomY = GetViewData().GetZoomY();
sal_uInt16 nOldPixel = 0;
if (nStartRow == nEndRow)
- nOldPixel = (sal_uInt16) (pDoc->GetRowHeight(nStartRow,nTab) * nPPTY);
+ nOldPixel = (sal_uInt16) (rDoc.GetRowHeight(nStartRow,nTab) * nPPTY);
ScSizeDeviceProvider aProv(pDocSh);
if (aProv.IsPrinter())
@@ -182,11 +182,11 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, bool bPaint )
aZoomX = aZoomY = Fraction( 1, 1 );
}
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, aProv.GetDevice());
- bool bChanged = pDoc->SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab);
+ bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab);
if (bChanged && ( nStartRow == nEndRow ))
{
- sal_uInt16 nNewPixel = (sal_uInt16) (pDoc->GetRowHeight(nStartRow,nTab) * nPPTY);
+ sal_uInt16 nNewPixel = (sal_uInt16) (rDoc.GetRowHeight(nStartRow,nTab) * nPPTY);
if ( nNewPixel == nOldPixel )
bChanged = false;
}
@@ -383,11 +383,11 @@ static bool lcl_GetAutoSumForRowRange( ScDocument* pDoc, ScRangeList& rRangeList
bool ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
SCCOL nStartCol = nCol;
SCROW nStartRow = nRow;
@@ -493,7 +493,7 @@ void ScViewFunc::EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, con
bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor, bool bContinue )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
const SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -692,8 +692,8 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
OUString ScViewFunc::GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr )
{
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
::boost::scoped_ptr<ScTokenArray> pArray(new ScTokenArray);
pArray->AddOpCode(bSubTotal ? ocSubTotal : ocSum);
@@ -737,10 +737,10 @@ void ScViewFunc::EnterBlock( const OUString& rString, const EditTextObject* pDat
{
// test for multi selection
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if ( rMark.IsMultiMarked() )
{
rMark.MarkToSimple();
@@ -757,7 +757,7 @@ void ScViewFunc::EnterBlock( const OUString& rString, const EditTextObject* pDat
}
}
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
OUString aNewStr = rString;
if ( pData )
{
@@ -821,14 +821,14 @@ void ScViewFunc::EnterBlock( const OUString& rString, const EditTextObject* pDat
void ScViewFunc::InsertPageBreak( bool bColumn, bool bRecord, const ScAddress* pPos,
bool bSetModified )
{
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
ScAddress aCursor;
if (pPos)
aCursor = *pPos;
else
- aCursor = ScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(), nTab );
+ aCursor = ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), nTab );
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().
InsertPageBreak( bColumn, aCursor, bRecord, bSetModified, false );
if ( bSuccess && bSetModified )
@@ -839,14 +839,14 @@ void ScViewFunc::InsertPageBreak( bool bColumn, bool bRecord, const ScAddress* p
void ScViewFunc::DeletePageBreak( bool bColumn, bool bRecord, const ScAddress* pPos,
bool bSetModified )
{
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
ScAddress aCursor;
if (pPos)
aCursor = *pPos;
else
- aCursor = ScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(), nTab );
+ aCursor = ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), nTab );
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().
RemovePageBreak( bColumn, aCursor, bRecord, bSetModified, false );
if ( bSuccess && bSetModified )
@@ -855,22 +855,22 @@ void ScViewFunc::DeletePageBreak( bool bColumn, bool bRecord, const ScAddress* p
void ScViewFunc::RemoveManualBreaks()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
+ bool bUndo(rDoc.IsUndoEnabled());
if (bUndo)
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true );
- pDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true );
+ rDoc.CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, IDF_NONE, false, pUndoDoc );
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) );
}
- pDoc->RemoveManualBreaks(nTab);
- pDoc->UpdatePageBreaks(nTab);
+ rDoc.RemoveManualBreaks(nTab);
+ rDoc.UpdatePageBreaks(nTab);
UpdatePageBreakData( true );
pDocSh->SetDocumentModified();
@@ -879,17 +879,17 @@ void ScViewFunc::RemoveManualBreaks()
void ScViewFunc::SetPrintZoom(sal_uInt16 nScale, sal_uInt16 nPages)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
pDocSh->SetPrintZoom( nTab, nScale, nPages );
}
void ScViewFunc::AdjustPrintZoom()
{
ScRange aRange;
- if ( GetViewData()->GetSimpleArea( aRange ) != SC_MARK_SIMPLE )
- GetViewData()->GetMarkData().GetMultiMarkArea( aRange );
- GetViewData()->GetDocShell()->AdjustPrintZoom( aRange );
+ if ( GetViewData().GetSimpleArea( aRange ) != SC_MARK_SIMPLE )
+ GetViewData().GetMarkData().GetMultiMarkArea( aRange );
+ GetViewData().GetDocShell()->AdjustPrintZoom( aRange );
}
void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
@@ -898,15 +898,15 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
{
// on all selected tables
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
SCTAB nTab;
- bool bUndo (pDoc->IsUndoEnabled());
+ bool bUndo (rDoc.IsUndoEnabled());
- ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver();
+ ScPrintRangeSaver* pOldRanges = rDoc.CreatePrintRangeSaver();
- ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
+ ScAddress::Details aDetails(rDoc.GetAddressConvention(), 0, 0);
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd; ++itr)
@@ -917,11 +917,11 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
// print ranges
if( !bAddPrint )
- pDoc->ClearPrintRanges( nTab );
+ rDoc.ClearPrintRanges( nTab );
if( bEntireSheet )
{
- pDoc->SetPrintEntireSheet( nTab );
+ rDoc.SetPrintEntireSheet( nTab );
}
else if ( pPrint )
{
@@ -932,16 +932,16 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
for (sal_uInt16 i=0; i<nTCount; i++)
{
OUString aToken = pPrint->getToken(i, sep);
- if ( aRange.ParseAny( aToken, pDoc, aDetails ) & SCA_VALID )
- pDoc->AddPrintRange( nTab, aRange );
+ if ( aRange.ParseAny( aToken, &rDoc, aDetails ) & SCA_VALID )
+ rDoc.AddPrintRange( nTab, aRange );
}
}
}
else // NULL = use selection (print range is always set), use empty string to delete all ranges
{
- if ( GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
{
- pDoc->AddPrintRange( nTab, aRange );
+ rDoc.AddPrintRange( nTab, aRange );
}
else if ( rMark.IsMultiMarked() )
{
@@ -951,7 +951,7 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
for (size_t i = 0, n = pList->size(); i < n; ++i)
{
ScRange* pR = (*pList)[i];
- pDoc->AddPrintRange(nTab, *pR);
+ rDoc.AddPrintRange(nTab, *pR);
}
}
}
@@ -961,10 +961,10 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
if ( pRepCol )
{
if ( pRepCol->isEmpty() )
- pDoc->SetRepeatColRange( nTab, NULL );
+ rDoc.SetRepeatColRange( nTab, NULL );
else
- if ( aRange.ParseAny( *pRepCol, pDoc, aDetails ) & SCA_VALID )
- pDoc->SetRepeatColRange( nTab, &aRange );
+ if ( aRange.ParseAny( *pRepCol, &rDoc, aDetails ) & SCA_VALID )
+ rDoc.SetRepeatColRange( nTab, &aRange );
}
// repeat rows
@@ -972,18 +972,18 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
if ( pRepRow )
{
if ( pRepRow->isEmpty() )
- pDoc->SetRepeatRowRange( nTab, NULL );
+ rDoc.SetRepeatRowRange( nTab, NULL );
else
- if ( aRange.ParseAny( *pRepRow, pDoc, aDetails ) & SCA_VALID )
- pDoc->SetRepeatRowRange( nTab, &aRange );
+ if ( aRange.ParseAny( *pRepRow, &rDoc, aDetails ) & SCA_VALID )
+ rDoc.SetRepeatRowRange( nTab, &aRange );
}
}
// undo (for all tables)
if (bUndo)
{
- SCTAB nCurTab = GetViewData()->GetTabNo();
- ScPrintRangeSaver* pNewRanges = pDoc->CreatePrintRangeSaver();
+ SCTAB nCurTab = GetViewData().GetTabNo();
+ ScPrintRangeSaver* pNewRanges = rDoc.CreatePrintRangeSaver();
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoPrintRange( pDocSh, nCurTab, pOldRanges, pNewRanges ) );
}
@@ -996,7 +996,7 @@ void ScViewFunc::SetPrintRanges( bool bEntireSheet, const OUString* pPrint,
for (; itr != itrEnd; ++itr)
ScPrintFunc( pDocSh, pDocSh->GetPrinter(), *itr ).UpdatePages();
- SfxBindings& rBindings = GetViewData()->GetBindings();
+ SfxBindings& rBindings = GetViewData().GetBindings();
rBindings.Invalidate( SID_DELETE_PRINTAREA );
pDocSh->SetDocumentModified();
@@ -1009,11 +1009,11 @@ bool ScViewFunc::TestMergeCells() // pre-test (for menu)
{
// simple test: true if there's a selection but no multi selection and not filtered
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
ScRange aDummy;
- return GetViewData()->GetSimpleArea( aDummy) == SC_MARK_SIMPLE;
+ return GetViewData().GetSimpleArea( aDummy) == SC_MARK_SIMPLE;
}
else
return false;
@@ -1031,7 +1031,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
return false;
}
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
rMark.MarkToSimple();
if (!rMark.IsMarked())
{
@@ -1039,8 +1039,8 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
return false;
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScRange aMarkRange;
rMark.GetMarkArea( aMarkRange );
@@ -1056,7 +1056,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
return true;
}
- if ( pDoc->HasAttrib( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
+ if ( rDoc.HasAttrib( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ) )
{ // "Don't nest merging !"
ErrorMessage(STR_MSSG_MERGECELLS_0);
@@ -1072,8 +1072,8 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
SCTAB i = *itr;
aMergeOption.maTabs.insert(i);
- if (!pDoc->IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) ||
- !pDoc->IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow))
+ if (!rDoc.IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) ||
+ !rDoc.IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow))
bAskDialog = true;
}
@@ -1083,7 +1083,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
{
if (!bApi)
{
- MessBox aBox( GetViewData()->GetDialogParent(),
+ MessBox aBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO_CANCEL | WB_DEF_NO),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
ScGlobal::GetRscString( STR_MERGE_NOTEMPTY ) );
@@ -1106,7 +1106,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
//DoneBlockMode( sal_False);
Unmark();
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
UpdateInputLine();
}
}
@@ -1119,9 +1119,9 @@ bool ScViewFunc::TestRemoveMerge()
{
bool bMerged = false;
ScRange aRange;
- if (GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE)
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( pDoc->HasAttrib( aRange, HASATTR_MERGED ) )
bMerged = true;
}
@@ -1164,13 +1164,13 @@ bool ScViewFunc::RemoveMerge( bool bRecord )
ErrorMessage(aTester.GetMessageId());
return false;
}
- else if (GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE)
+ else if (GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE)
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScRange aExtended( aRange );
pDoc->ExtendMerge( aExtended );
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
ScCellMergeOption aOption(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row());
bool bExtended = false;
do
@@ -1198,7 +1198,7 @@ bool ScViewFunc::RemoveMerge( bool bRecord )
MarkRange( aExtended );
if (bOk)
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
}
return true; //! bOk ??
}
@@ -1206,14 +1206,14 @@ bool ScViewFunc::RemoveMerge( bool bRecord )
void ScViewFunc::FillSimple( FillDir eDir, bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
bool bSuccess = pDocSh->GetDocFunc().FillSimple( aRange, &rMark, eDir, bRecord, false );
if (bSuccess)
{
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
UpdateScrollBars();
}
}
@@ -1225,16 +1225,16 @@ void ScViewFunc::FillSeries( FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd,
double fStart, double fStep, double fMax, bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
bool bSuccess = pDocSh->GetDocFunc().
FillSeries( aRange, &rMark, eDir, eCmd, eDateCmd,
fStart, fStep, fMax, bRecord, false );
if (bSuccess)
{
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
UpdateScrollBars();
HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, aRange);
@@ -1247,17 +1247,17 @@ void ScViewFunc::FillSeries( FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd,
void ScViewFunc::FillAuto( FillDir eDir, SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow, sal_uLong nCount, bool bRecord )
{
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
ScRange aRange( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab );
ScRange aSourceRange( aRange );
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
bool bSuccess = pDocSh->GetDocFunc().
FillAuto( aRange, &rMark, eDir, nCount, bRecord, false );
if (bSuccess)
{
MarkRange( aRange, false ); // aRange was modified in FillAuto
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
UpdateScrollBars();
if (ScModelObj* pModelObj = HelperNotifyChanges::getMustPropagateChangesModel(*pDocSh))
@@ -1297,11 +1297,11 @@ void ScViewFunc::FillTab( sal_uInt16 nFlags, sal_uInt16 nFunction, bool bSkipEmp
return;
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- SCTAB nTab = GetViewData()->GetTabNo();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ SCTAB nTab = GetViewData().GetTabNo();
+ bool bUndo(rDoc.IsUndoEnabled());
ScRange aMarkRange;
rMark.MarkToSimple();
@@ -1311,14 +1311,14 @@ void ScViewFunc::FillTab( sal_uInt16 nFlags, sal_uInt16 nFunction, bool bSkipEmp
else if (rMark.IsMarked())
rMark.GetMarkArea( aMarkRange );
else
- aMarkRange = ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(), nTab );
+ aMarkRange = ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(), nTab );
ScDocument* pUndoDoc = NULL;
if (bUndo)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
for (; itr != itrEnd; ++itr)
@@ -1328,17 +1328,17 @@ void ScViewFunc::FillTab( sal_uInt16 nFlags, sal_uInt16 nFunction, bool bSkipEmp
pUndoDoc->AddUndoTab( i, i );
aMarkRange.aStart.SetTab( i );
aMarkRange.aEnd.SetTab( i );
- pDoc->CopyToDocument( aMarkRange, IDF_ALL, bMulti, pUndoDoc );
+ rDoc.CopyToDocument( aMarkRange, IDF_ALL, bMulti, pUndoDoc );
}
}
if (bMulti)
- pDoc->FillTabMarked( nTab, rMark, nFlags, nFunction, bSkipEmpty, bAsLink );
+ rDoc.FillTabMarked( nTab, rMark, nFlags, nFunction, bSkipEmpty, bAsLink );
else
{
aMarkRange.aStart.SetTab( nTab );
aMarkRange.aEnd.SetTab( nTab );
- pDoc->FillTab( aMarkRange, rMark, nFlags, nFunction, bSkipEmpty, bAsLink );
+ rDoc.FillTab( aMarkRange, rMark, nFlags, nFunction, bSkipEmpty, bAsLink );
}
if (bUndo)
@@ -1370,16 +1370,16 @@ void ScViewFunc::FillTab( sal_uInt16 nFlags, sal_uInt16 nFunction, bool bSkipEmp
void ScViewFunc::FillCrossDblClick()
{
ScRange aRange;
- GetViewData()->GetSimpleArea( aRange );
+ GetViewData().GetSimpleArea( aRange );
aRange.Justify();
- SCTAB nTab = GetViewData()->GetCurPos().Tab();
+ SCTAB nTab = GetViewData().GetCurPos().Tab();
SCCOL nStartX = aRange.aStart.Col();
SCROW nStartY = aRange.aStart.Row();
SCCOL nEndX = aRange.aEnd.Col();
SCROW nEndY = aRange.aEnd.Row();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
// Make sure the selection is not empty
if ( pDoc->IsBlockEmpty( nTab, nStartX, nStartY, nEndX, nEndY ) )
@@ -1429,20 +1429,20 @@ void ScViewFunc::FillCrossDblClick()
void ScViewFunc::TransliterateText( sal_Int32 nType )
{
- ScMarkData aFuncMark = GetViewData()->GetMarkData();
+ ScMarkData aFuncMark = GetViewData().GetMarkData();
if ( !aFuncMark.IsMarked() && !aFuncMark.IsMultiMarked() )
{
// no selection -> use cursor position
- ScAddress aCursor( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ ScAddress aCursor( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() );
aFuncMark.SetMarkArea( ScRange( aCursor ) );
}
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().
TransliterateText( aFuncMark, nType, true, false );
if (bSuccess)
{
- GetViewData()->GetViewShell()->UpdateInputHandler();
+ GetViewData().GetViewShell()->UpdateInputHandler();
}
}
@@ -1458,11 +1458,11 @@ ScAutoFormatData* ScViewFunc::CreateAutoFormatData()
SCCOL nEndCol;
SCROW nEndRow;
SCTAB nEndTab;
- if (GetViewData()->GetSimpleArea(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab) == SC_MARK_SIMPLE)
{
if ( nEndCol-nStartCol >= 3 && nEndRow-nStartRow >= 3 )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
pData = new ScAutoFormatData;
pDoc->GetAutoFormatData( nStartTab, nStartCol,nStartRow,nEndCol,nEndRow, *pData );
}
@@ -1474,14 +1474,14 @@ ScAutoFormatData* ScViewFunc::CreateAutoFormatData()
void ScViewFunc::AutoFormat( sal_uInt16 nFormatNo, bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
bool bSuccess = pDocSh->GetDocFunc().AutoFormat( aRange, &rMark, nFormatNo, bRecord, false );
if (bSuccess)
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -1493,23 +1493,23 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
bool bAddUndo, bool bIsApi )
{
SvxSearchDialogWrapper::SetSearchLabel(SL_Empty);
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- if (bAddUndo && !pDoc->IsUndoEnabled())
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ if (bAddUndo && !rDoc.IsUndoEnabled())
bAddUndo = false;
SCCOL nCol, nOldCol;
SCROW nRow, nOldRow;
SCTAB nTab, nOldTab;
- nCol = nOldCol = GetViewData()->GetCurX();
- nRow = nOldRow = GetViewData()->GetCurY();
- nTab = nOldTab = GetViewData()->GetTabNo();
+ nCol = nOldCol = GetViewData().GetCurX();
+ nRow = nOldRow = GetViewData().GetCurY();
+ nTab = nOldTab = GetViewData().GetTabNo();
sal_uInt16 nCommand = pSearchItem->GetCommand();
bool bAllTables = pSearchItem->IsAllTables();
std::set<SCTAB> aOldSelectedTables;
- SCTAB nLastTab = pDoc->GetTableCount() - 1;
+ SCTAB nLastTab = rDoc.GetTableCount() - 1;
SCTAB nStartTab, nEndTab;
if ( bAllTables )
{
@@ -1541,7 +1541,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
if ( nCommand == SVX_SEARCHCMD_REPLACE_ALL )
{
pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO));
- pUndoDoc->InitUndo( pDoc, nStartTab, nEndTab );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab );
}
}
@@ -1566,14 +1566,14 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
{
GetFrameWin()->EnterWait();
ScRangeList aMatchedRanges;
- if (pDoc->SearchAndReplace(*pSearchItem, nCol, nRow, nTab, rMark, aMatchedRanges, aUndoStr, pUndoDoc.get()))
+ if (rDoc.SearchAndReplace(*pSearchItem, nCol, nRow, nTab, rMark, aMatchedRanges, aUndoStr, pUndoDoc.get()))
{
bFound = true;
bFirst = true;
if (bAddUndo)
{
- GetViewData()->GetDocShell()->GetUndoManager()->AddUndoAction(
- new ScUndoReplace( GetViewData()->GetDocShell(), *pUndoMark,
+ GetViewData().GetDocShell()->GetUndoManager()->AddUndoAction(
+ new ScUndoReplace( GetViewData().GetDocShell(), *pUndoMark,
nCol, nRow, nTab,
aUndoStr, pUndoDoc.release(), pSearchItem ) );
}
@@ -1589,7 +1589,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
{
sc::SearchResultsDlg* pDlg = static_cast<sc::SearchResultsDlg*>(pWnd->GetWindow());
if (pDlg)
- pDlg->FillResults(pDoc, aMatchedRanges);
+ pDlg->FillResults(&rDoc, aMatchedRanges);
}
}
@@ -1666,7 +1666,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
if ( bFound )
{
- if ( nTab != GetViewData()->GetTabNo() )
+ if ( nTab != GetViewData().GetTabNo() )
SetTabNo( nTab );
// if nothing is marked, DoneBlockMode, then marking can start
@@ -1694,7 +1694,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
ScRangeList aMatchedRanges;
ScTable::UpdateSearchItemAddressForReplace( aSearchItem, nCol, nRow );
- if ( pDoc->SearchAndReplace( aSearchItem, nCol, nRow, nTab, rMark, aMatchedRanges, aUndoStr, NULL ) &&
+ if ( rDoc.SearchAndReplace( aSearchItem, nCol, nRow, nTab, rMark, aMatchedRanges, aUndoStr, NULL ) &&
( nTab == nOldTab ) &&
( nCol != nOldCol || nRow != nOldRow ) )
{
@@ -1717,7 +1717,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
void ScViewFunc::Solve( const ScSolveParam& rParam )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
SCCOL nDestCol = rParam.aRefVariableCell.Col();
SCROW nDestRow = rParam.aRefVariableCell.Row();
@@ -1775,7 +1775,7 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_4 );
}
- MessBox aBox( GetViewData()->GetDialogParent(),
+ MessBox aBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr );
sal_uInt16 nRetVal = aBox.Execute();
@@ -1783,7 +1783,7 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
if ( RET_YES == nRetVal )
EnterValue( nDestCol, nDestRow, nDestTab, nSolveResult );
- GetViewData()->GetViewShell()->UpdateInputHandler( true );
+ GetViewData().GetViewShell()->UpdateInputHandler( true );
}
}
@@ -1792,10 +1792,10 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
void ScViewFunc::TabOp( const ScTabOpParam& rParam, bool bRecord )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
pDocSh->GetDocFunc().TabOp( aRange, &rMark, rParam, bRecord, false );
}
else
@@ -1806,16 +1806,16 @@ void ScViewFunc::TabOp( const ScTabOpParam& rParam, bool bRecord )
void ScViewFunc::MakeScenario( const OUString& rName, const OUString& rComment,
const Color& rColor, sal_uInt16 nFlags )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ SCTAB nTab = GetViewData().GetTabNo();
SCTAB nNewTab = pDocSh->MakeScenario( nTab, rName, rComment, rColor, nFlags, rMark );
if (nFlags & SC_SCENARIO_COPYALL)
SetTabNo( nNewTab, true ); // SC_SCENARIO_COPYALL -> visible
else
{
- SfxBindings& rBindings = GetViewData()->GetBindings();
+ SfxBindings& rBindings = GetViewData().GetBindings();
rBindings.Invalidate( SID_STATUS_DOCPOS ); // Statusbar
rBindings.Invalidate( SID_ROWCOL_SELCOUNT ); // Statusbar
rBindings.Invalidate( SID_TABLES_COUNT );
@@ -1836,7 +1836,7 @@ void ScViewFunc::ExtendScenario()
// Undo: apply attributes
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
ScPatternAttr aPattern( pDoc->GetPool() );
aPattern.GetItemSet().Put( ScMergeFlagAttr( SC_MF_SCENARIO ) );
aPattern.GetItemSet().Put( ScProtectionAttr( true ) );
@@ -1846,8 +1846,8 @@ void ScViewFunc::ExtendScenario()
void ScViewFunc::UseScenario( const OUString& rName )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
DoneBlockMode();
InitOwnBlockMode();
@@ -1859,7 +1859,7 @@ void ScViewFunc::UseScenario( const OUString& rName )
bool ScViewFunc::InsertTable( const OUString& rName, SCTAB nTab, bool bRecord )
{
// Order Tabl/Name is inverted for DocFunc
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().
InsertTable( nTab, rName, bRecord, false );
if (bSuccess)
SetTabNo( nTab, true );
@@ -1873,25 +1873,25 @@ bool ScViewFunc::InsertTable( const OUString& rName, SCTAB nTab, bool bRecord )
bool ScViewFunc::InsertTables(std::vector<OUString>& aNames, SCTAB nTab,
SCTAB nCount, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
WaitObject aWait( GetFrameWin() );
if (bRecord)
{
- pDoc->BeginDrawUndo(); // InsertTab creates a SdrUndoNewPage
+ rDoc.BeginDrawUndo(); // InsertTab creates a SdrUndoNewPage
}
bool bFlag=false;
if(aNames.empty())
{
- pDoc->CreateValidTabNames(aNames, nCount);
+ rDoc.CreateValidTabNames(aNames, nCount);
}
- if (pDoc->InsertTabs(nTab, aNames, false))
+ if (rDoc.InsertTabs(nTab, aNames, false))
{
pDocSh->Broadcast( ScTablesHint( SC_TABS_INSERTED, nTab, nCount ) );
bFlag = true;
@@ -1920,23 +1920,23 @@ bool ScViewFunc::InsertTables(std::vector<OUString>& aNames, SCTAB nTab,
bool ScViewFunc::AppendTable( const OUString& rName, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
WaitObject aWait( GetFrameWin() );
if (bRecord)
- pDoc->BeginDrawUndo(); // InsertTab creates a SdrUndoNewPage
+ rDoc.BeginDrawUndo(); // InsertTab creates a SdrUndoNewPage
- if (pDoc->InsertTab( SC_TAB_APPEND, rName ))
+ if (rDoc.InsertTab( SC_TAB_APPEND, rName ))
{
- SCTAB nTab = pDoc->GetTableCount()-1;
+ SCTAB nTab = rDoc.GetTableCount()-1;
if (bRecord)
pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoInsertTab( pDocSh, nTab, true, rName));
- GetViewData()->InsertTab( nTab );
+ GetViewData().InsertTab( nTab );
SetTabNo( nTab, true );
pDocSh->PostPaintExtras();
pDocSh->SetDocumentModified();
@@ -1952,14 +1952,14 @@ bool ScViewFunc::AppendTable( const OUString& rName, bool bRecord )
bool ScViewFunc::DeleteTable( SCTAB nTab, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
bool bSuccess = pDocSh->GetDocFunc().DeleteTable( nTab, bRecord, false );
if (bSuccess)
{
SCTAB nNewTab = nTab;
- if ( nNewTab >= pDoc->GetTableCount() )
+ if ( nNewTab >= rDoc.GetTableCount() )
--nNewTab;
SetTabNo( nNewTab, true );
}
@@ -1970,31 +1970,31 @@ bool ScViewFunc::DeleteTable( SCTAB nTab, bool bRecord )
//this method doesn't support undo for now, merge it when it with the other method later
bool ScViewFunc::DeleteTables( const SCTAB nTab, SCTAB nSheets )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bVbaEnabled = pDoc->IsInVBAMode();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bVbaEnabled = rDoc.IsInVBAMode();
SCTAB nNewTab = nTab;
WaitObject aWait( GetFrameWin() );
- while ( nNewTab > 0 && !pDoc->IsVisible( nNewTab ) )
+ while ( nNewTab > 0 && !rDoc.IsVisible( nNewTab ) )
--nNewTab;
- if (pDoc->DeleteTabs(nTab, nSheets))
+ if (rDoc.DeleteTabs(nTab, nSheets))
{
if( bVbaEnabled )
{
for (SCTAB aTab = 0; aTab < nSheets; ++aTab)
{
OUString sCodeName;
- bool bHasCodeName = pDoc->GetCodeName( nTab + aTab, sCodeName );
+ bool bHasCodeName = rDoc.GetCodeName( nTab + aTab, sCodeName );
if ( bHasCodeName )
VBA_DeleteModule( *pDocSh, sCodeName );
}
}
pDocSh->Broadcast( ScTablesHint( SC_TABS_DELETED, nTab, nSheets ) );
- if ( nNewTab >= pDoc->GetTableCount() )
- nNewTab = pDoc->GetTableCount() - 1;
+ if ( nNewTab >= rDoc.GetTableCount() )
+ nNewTab = rDoc.GetTableCount() - 1;
SetTabNo( nNewTab, true );
pDocSh->PostPaintExtras();
@@ -2011,17 +2011,17 @@ bool ScViewFunc::DeleteTables( const SCTAB nTab, SCTAB nSheets )
bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bVbaEnabled = pDoc->IsInVBAMode();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bVbaEnabled = rDoc.IsInVBAMode();
SCTAB nNewTab = TheTabs.front();
WaitObject aWait( GetFrameWin() );
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if ( bVbaEnabled )
bRecord = false;
- while ( nNewTab > 0 && !pDoc->IsVisible( nNewTab ) )
+ while ( nNewTab > 0 && !rDoc.IsVisible( nNewTab ) )
--nNewTab;
bool bWasLinked = false;
@@ -2030,46 +2030,46 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
if (bRecord)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- SCTAB nCount = pDoc->GetTableCount();
+ SCTAB nCount = rDoc.GetTableCount();
OUString aOldName;
for(unsigned int i=0; i<TheTabs.size(); ++i)
{
SCTAB nTab = TheTabs[i];
if (i==0)
- pUndoDoc->InitUndo( pDoc, nTab,nTab, true,true ); // incl. column/fow flags
+ pUndoDoc->InitUndo( &rDoc, nTab,nTab, true,true ); // incl. column/fow flags
else
pUndoDoc->AddUndoTab( nTab,nTab, true,true ); // incl. column/fow flags
- pDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
- pDoc->GetName( nTab, aOldName );
+ rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, IDF_ALL,false, pUndoDoc );
+ rDoc.GetName( nTab, aOldName );
pUndoDoc->RenameTab( nTab, aOldName, false );
- if (pDoc->IsLinked(nTab))
+ if (rDoc.IsLinked(nTab))
{
bWasLinked = true;
- pUndoDoc->SetLink( nTab, pDoc->GetLinkMode(nTab), pDoc->GetLinkDoc(nTab),
- pDoc->GetLinkFlt(nTab), pDoc->GetLinkOpt(nTab),
- pDoc->GetLinkTab(nTab),
- pDoc->GetLinkRefreshDelay(nTab) );
+ pUndoDoc->SetLink( nTab, rDoc.GetLinkMode(nTab), rDoc.GetLinkDoc(nTab),
+ rDoc.GetLinkFlt(nTab), rDoc.GetLinkOpt(nTab),
+ rDoc.GetLinkTab(nTab),
+ rDoc.GetLinkRefreshDelay(nTab) );
}
- if ( pDoc->IsScenario(nTab) )
+ if ( rDoc.IsScenario(nTab) )
{
pUndoDoc->SetScenario( nTab, true );
OUString aComment;
Color aColor;
sal_uInt16 nScenFlags;
- pDoc->GetScenarioData( nTab, aComment, aColor, nScenFlags );
+ rDoc.GetScenarioData( nTab, aComment, aColor, nScenFlags );
pUndoDoc->SetScenarioData( nTab, aComment, aColor, nScenFlags );
- bool bActive = pDoc->IsActiveScenario( nTab );
+ bool bActive = rDoc.IsActiveScenario( nTab );
pUndoDoc->SetActiveScenario( nTab, bActive );
}
- pUndoDoc->SetVisible( nTab, pDoc->IsVisible( nTab ) );
- pUndoDoc->SetTabBgColor( nTab, pDoc->GetTabBgColor(nTab) );
- pUndoDoc->SetSheetEvents( nTab, pDoc->GetSheetEvents( nTab ) );
- pUndoDoc->SetLayoutRTL( nTab, pDoc->IsLayoutRTL( nTab ) );
+ pUndoDoc->SetVisible( nTab, rDoc.IsVisible( nTab ) );
+ pUndoDoc->SetTabBgColor( nTab, rDoc.GetTabBgColor(nTab) );
+ pUndoDoc->SetSheetEvents( nTab, rDoc.GetSheetEvents( nTab ) );
+ pUndoDoc->SetLayoutRTL( nTab, rDoc.IsLayoutRTL( nTab ) );
- if ( pDoc->IsTabProtected( nTab ) )
- pUndoDoc->SetTabProtection(nTab, pDoc->GetTabProtection(nTab));
+ if ( rDoc.IsTabProtected( nTab ) )
+ pUndoDoc->SetTabProtection(nTab, rDoc.GetTabProtection(nTab));
// Drawing-Layer is responsible for its Undo !!!
// pUndoDoc->TransferDrawPage(pDoc, nTab,nTab);
@@ -2077,9 +2077,9 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
pUndoDoc->AddUndoTab( 0, nCount-1 ); // all Tabs for references
- pDoc->BeginDrawUndo(); // DeleteTab creates a SdrUndoDelPage
+ rDoc.BeginDrawUndo(); // DeleteTab creates a SdrUndoDelPage
- pUndoData = new ScRefUndoData( pDoc );
+ pUndoData = new ScRefUndoData( &rDoc );
}
bool bDelDone = false;
@@ -2087,8 +2087,8 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
for(int i=TheTabs.size()-1; i>=0; --i)
{
OUString sCodeName;
- bool bHasCodeName = pDoc->GetCodeName( TheTabs[i], sCodeName );
- if (pDoc->DeleteTab(TheTabs[i]))
+ bool bHasCodeName = rDoc.GetCodeName( TheTabs[i], sCodeName );
+ if (rDoc.DeleteTab(TheTabs[i]))
{
bDelDone = true;
if( bVbaEnabled )
@@ -2104,22 +2104,22 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
if (bRecord)
{
pDocSh->GetUndoManager()->AddUndoAction(
- new ScUndoDeleteTab( GetViewData()->GetDocShell(), TheTabs,
+ new ScUndoDeleteTab( GetViewData().GetDocShell(), TheTabs,
pUndoDoc, pUndoData ));
}
if (bDelDone)
{
- if ( nNewTab >= pDoc->GetTableCount() )
- nNewTab = pDoc->GetTableCount() - 1;
+ if ( nNewTab >= rDoc.GetTableCount() )
+ nNewTab = rDoc.GetTableCount() - 1;
SetTabNo( nNewTab, true );
if (bWasLinked)
{
pDocSh->UpdateLinks(); // update Link-Manager
- GetViewData()->GetBindings().Invalidate(SID_LINKS);
+ GetViewData().GetBindings().Invalidate(SID_LINKS);
}
pDocSh->PostPaintExtras();
@@ -2143,12 +2143,12 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
bool ScViewFunc::RenameTable( const OUString& rName, SCTAB nTab )
{
// order Table/Name is inverted for DocFunc
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().
RenameTable( nTab, rName, true, false );
if (bSuccess)
{
// the table name might be part of a formula
- GetViewData()->GetViewShell()->UpdateInputHandler();
+ GetViewData().GetViewShell()->UpdateInputHandler();
}
return bSuccess;
}
@@ -2156,20 +2156,20 @@ bool ScViewFunc::RenameTable( const OUString& rName, SCTAB nTab )
bool ScViewFunc::SetTabBgColor( const Color& rColor, SCTAB nTab )
{
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( nTab, rColor, true, false );
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().SetTabBgColor( nTab, rColor, true, false );
if (bSuccess)
{
- GetViewData()->GetViewShell()->UpdateInputHandler();
+ GetViewData().GetViewShell()->UpdateInputHandler();
}
return bSuccess;
}
bool ScViewFunc::SetTabBgColor( ScUndoTabColorInfo::List& rUndoSetTabBgColorInfoList )
{
- bool bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( rUndoSetTabBgColorInfoList, true, false );
+ bool bSuccess = GetViewData().GetDocShell()->GetDocFunc().SetTabBgColor( rUndoSetTabBgColorInfoList, true, false );
if (bSuccess)
{
- GetViewData()->GetViewShell()->UpdateInputHandler();
+ GetViewData().GetViewShell()->UpdateInputHandler();
}
return bSuccess;
}
@@ -2178,10 +2178,10 @@ void ScViewFunc::InsertAreaLink( const OUString& rFile,
const OUString& rFilter, const OUString& rOptions,
const OUString& rSource, sal_uLong nRefresh )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- SCCOL nPosX = GetViewData()->GetCurX();
- SCROW nPosY = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ SCCOL nPosX = GetViewData().GetCurX();
+ SCROW nPosY = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
ScAddress aPos( nPosX, nPosY, nTab );
pDocSh->GetDocFunc().InsertAreaLink( rFile, rFilter, rOptions, rSource, aPos, nRefresh, false, false );
@@ -2199,17 +2199,17 @@ void ScViewFunc::InsertTableLink( const OUString& rFile,
if (!aLoader.IsError())
{
ScDocShell* pSrcSh = aLoader.GetDocShell();
- ScDocument* pSrcDoc = pSrcSh->GetDocument();
+ ScDocument& rSrcDoc = pSrcSh->GetDocument();
SCTAB nTab = MAXTAB+1;
if (rTabName.isEmpty()) // no name given -> first table
nTab = 0;
else
{
OUString aTemp;
- SCTAB nCount = pSrcDoc->GetTableCount();
+ SCTAB nCount = rSrcDoc.GetTableCount();
for (SCTAB i=0; i<nCount; i++)
{
- pSrcDoc->GetName( i, aTemp );
+ rSrcDoc.GetName( i, aTemp );
if ( aTemp.equals(rTabName) )
nTab = i;
}
@@ -2217,7 +2217,7 @@ void ScViewFunc::InsertTableLink( const OUString& rFile,
if ( nTab <= MAXTAB )
ImportTables( pSrcSh, 1, &nTab, true,
- GetViewData()->GetTabNo() );
+ GetViewData().GetTabNo() );
}
}
@@ -2226,30 +2226,30 @@ void ScViewFunc::InsertTableLink( const OUString& rFile,
void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
SCTAB nCount, const SCTAB* pSrcTabs, bool bLink,SCTAB nTab )
{
- ScDocument* pSrcDoc = pSrcShell->GetDocument();
+ ScDocument& rSrcDoc = pSrcShell->GetDocument();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
bool bError = false;
bool bRefs = false;
bool bName = false;
- if (pSrcDoc->GetDrawLayer())
+ if (rSrcDoc.GetDrawLayer())
pDocSh->MakeDrawLayer();
if (bUndo)
- pDoc->BeginDrawUndo(); // drawing layer must do its own undo actions
+ rDoc.BeginDrawUndo(); // drawing layer must do its own undo actions
SCTAB nInsCount = 0;
SCTAB i;
for( i=0; i<nCount; i++ )
{ // insert sheets first and update all references
OUString aName;
- pSrcDoc->GetName( pSrcTabs[i], aName );
- pDoc->CreateValidTabName( aName );
- if ( !pDoc->InsertTab( nTab+i, aName ) )
+ rSrcDoc.GetName( pSrcTabs[i], aName );
+ rDoc.CreateValidTabName( aName );
+ if ( !rDoc.InsertTab( nTab+i, aName ) )
{
bError = true; // total error
break; // for
@@ -2283,7 +2283,7 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
if (bLink)
{
- sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager();
SfxMedium* pMed = pSrcShell->GetMedium();
OUString aFileName = pMed->GetName();
@@ -2292,14 +2292,14 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
aFilterName = pMed->GetFilter()->GetFilterName();
OUString aOptions = ScDocumentLoader::GetOptions(*pMed);
- bool bWasThere = pDoc->HasLink( aFileName, aFilterName, aOptions );
+ bool bWasThere = rDoc.HasLink( aFileName, aFilterName, aOptions );
sal_uLong nRefresh = 0;
OUString aTabStr;
for (i=0; i<nInsCount; i++)
{
- pSrcDoc->GetName( pSrcTabs[i], aTabStr );
- pDoc->SetLink( nTab+i, SC_LINK_NORMAL,
+ rSrcDoc.GetName( pSrcTabs[i], aTabStr );
+ rDoc.SetLink( nTab+i, SC_LINK_NORMAL,
aFileName, aFilterName, aOptions, aTabStr, nRefresh );
}
@@ -2311,7 +2311,7 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
pLink->Update();
pLink->SetInCreate( false );
- SfxBindings& rBindings = GetViewData()->GetBindings();
+ SfxBindings& rBindings = GetViewData().GetBindings();
rBindings.Invalidate( SID_LINKS );
}
}
@@ -2324,7 +2324,7 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
}
for (i=0; i<nInsCount; i++)
- GetViewData()->InsertTab(nTab);
+ GetViewData().InsertTab(nTab);
SetTabNo(nTab,true);
pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS );
@@ -2348,8 +2348,8 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
void ScViewFunc::MoveTable(
sal_uInt16 nDestDocNo, SCTAB nDestTab, bool bCopy, const OUString* pNewTabName )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
ScDocument* pDestDoc = NULL;
ScDocShell* pDestShell = NULL;
ScTabViewShell* pDestViewSh = NULL;
@@ -2367,7 +2367,7 @@ void ScViewFunc::MoveTable(
SfxStringItem aItem( SID_FILE_NAME, aUrl );
SfxStringItem aTarget( SID_TARGETNAME, OUString("_blank") );
- const SfxPoolItem* pRetItem = GetViewData()->GetDispatcher().Execute(
+ const SfxPoolItem* pRetItem = GetViewData().GetDispatcher().Execute(
SID_OPENDOC, SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON, &aItem, &aTarget, 0L );
if ( pRetItem )
{
@@ -2392,7 +2392,7 @@ void ScViewFunc::MoveTable(
return;
}
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if (bRename && rMark.GetSelectCount() != 1)
{
// Custom sheet name is provided, but more than one sheet is selected.
@@ -2400,9 +2400,9 @@ void ScViewFunc::MoveTable(
return;
}
- pDestDoc = pDestShell->GetDocument();
+ pDestDoc = &pDestShell->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
if (pDestDoc != pDoc)
{
@@ -2428,7 +2428,7 @@ void ScViewFunc::MoveTable(
TheTabs.push_back(i);
for(SCTAB j=i+1;j<nTabCount;j++)
{
- if((!pDoc->IsVisible(j))&&(pDoc->IsScenario(j)))
+ if((!pDoc->IsVisible(j)) && pDoc->IsScenario(j))
{
pDoc->GetName( j, aTabName);
TheTabs.push_back(j);
@@ -2587,7 +2587,7 @@ void ScViewFunc::MoveTable(
for(SCTAB j=i+1;j<nTabCount;j++)
{
- if((!pDoc->IsVisible(j))&&(pDoc->IsScenario(j)))
+ if((!pDoc->IsVisible(j)) && pDoc->IsScenario(j))
{
pDoc->GetName( j, aTabName);
pTabNames->push_back(aTabName);
@@ -2665,7 +2665,7 @@ void ScViewFunc::MoveTable(
// No need to keep this around when we are not renaming.
pTabNames.reset();
- nTab = GetViewData()->GetTabNo();
+ nTab = GetViewData().GetTabNo();
if (bUndo)
{
@@ -2700,9 +2700,9 @@ void ScViewFunc::MoveTable(
void ScViewFunc::ShowTable( const std::vector<OUString>& rNames )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
std::vector<SCTAB> undoTabs;
OUString aName;
@@ -2713,9 +2713,9 @@ void ScViewFunc::ShowTable( const std::vector<OUString>& rNames )
for (std::vector<OUString>::const_iterator itr=rNames.begin(), itrEnd = rNames.end(); itr!=itrEnd; ++itr)
{
aName = *itr;
- if (pDoc->GetTable(aName, nPos))
+ if (rDoc.GetTable(aName, nPos))
{
- pDoc->SetVisible( nPos, true );
+ rDoc.SetVisible( nPos, true );
SetTabNo( nPos, true );
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
if (!bFound)
@@ -2738,17 +2738,17 @@ void ScViewFunc::ShowTable( const std::vector<OUString>& rNames )
void ScViewFunc::HideTable( const ScMarkData& rMark )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bUndo(pDoc->IsUndoEnabled());
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bUndo(rDoc.IsUndoEnabled());
SCTAB nVisible = 0;
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
SCTAB nTabSelCount = rMark.GetSelectCount();
// check to make sure we won't hide all sheets. we need at least one visible at all times.
for ( SCTAB i=0; i < nTabCount && nVisible <= nTabSelCount ; i++ )
- if (pDoc->IsVisible(i))
+ if (rDoc.IsVisible(i))
++nVisible;
if (nVisible > nTabSelCount)
@@ -2761,9 +2761,9 @@ void ScViewFunc::HideTable( const ScMarkData& rMark )
for (it=selectedTabs.begin(); it!=selectedTabs.end(); ++it)
{
nTab = *it;
- if (pDoc->IsVisible( nTab ))
+ if (rDoc.IsVisible( nTab ))
{
- pDoc->SetVisible( nTab, false );
+ rDoc.SetVisible( nTab, false );
// Update views
pDocSh->Broadcast( ScTablesHint( SC_TAB_HIDDEN, nTab ) );
SetTabNo( nTab, true );
@@ -2795,7 +2795,7 @@ void ScViewFunc::InsertSpecialChar( const OUString& rStr, const Font& rFont )
}
const sal_Unicode* pChar = rStr.getStr();
- ScTabViewShell* pViewShell = GetViewData()->GetViewShell();
+ ScTabViewShell* pViewShell = GetViewData().GetViewShell();
SvxFontItem aFontItem( rFont.GetFamily(),
rFont.GetName(),
rFont.GetStyleName(),
@@ -2805,7 +2805,7 @@ void ScViewFunc::InsertSpecialChar( const OUString& rStr, const Font& rFont )
// if string contains WEAK characters, set all fonts
sal_uInt8 nScript;
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( pDoc->HasStringWeakCharacters( rStr ) )
nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX;
else
@@ -2868,10 +2868,10 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
return;
}
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData aFuncMark( GetViewData()->GetMarkData() ); // local copy for UnmarkFiltered
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData aFuncMark( GetViewData().GetMarkData() ); // local copy for UnmarkFiltered
ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
const ScPatternAttr* pSelAttrs = GetSelectionPattern();
const SfxItemSet& rSelItemSet = pSelAttrs->GetItemSet();
@@ -2962,7 +2962,7 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
nEndCol, nEndRow, nEndTab,
PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE );
- pDocSh->UpdateOle( GetViewData() );
+ pDocSh->UpdateOle( &GetViewData() );
pDocSh->SetDocumentModified();
}
}
@@ -2971,7 +2971,7 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
void ScViewFunc::SetValidation( const ScValidationData& rNew )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
sal_uLong nIndex = pDoc->AddValidationEntry(rNew); // for it there is no Undo
SfxUInt32Item aItem( ATTR_VALIDDATA, nIndex );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index be5d96c68218..627e870e519e 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -90,11 +90,11 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects )
}
ScRange aRange; // zu loeschender Bereich
- if ( GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
const bool bRecord(pDoc->IsUndoEnabled()); // Undo/Redo
ScDocShellModificator aModificator( *pDocSh );
@@ -142,7 +142,7 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects )
new ScUndoCut( pDocSh, aRange, aOldEnd, rMark, pUndoDoc ) );
aModificator.SetDocumentModified();
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
CellContentChanged();
}
@@ -155,8 +155,8 @@ void ScViewFunc::CutToClip( ScDocument* pClipDoc, bool bIncludeObjects )
bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, bool bCut, bool bApi, bool bIncludeObjects, bool bStopEdit )
{
ScRange aRange;
- ScMarkType eMarkType = GetViewData()->GetSimpleArea( aRange );
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkType eMarkType = GetViewData().GetSimpleArea( aRange );
+ ScMarkData& rMark = GetViewData().GetMarkData();
bool bDone = false;
if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
@@ -194,8 +194,8 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b
ScClipParam aClipParam( aRange, bCut );
aClipParam.maRanges = rRanges;
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if ( !aClipParam.isMultiRange() )
{
@@ -257,7 +257,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b
if ( bSysClip )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
TransferableObjectDescriptor aObjDesc;
pDocSh->FillTransferableObjectDescriptor( aObjDesc );
aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
@@ -367,7 +367,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b
pChangeTrack->ResetLastCut(); // kein CutMode mehr
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
TransferableObjectDescriptor aObjDesc;
pDocSh->FillTransferableObjectDescriptor( aObjDesc );
aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
@@ -402,10 +402,10 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b
ScTransferObj* ScViewFunc::CopyToTransferable()
{
ScRange aRange;
- if ( GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if ( !pDoc->HasSelectedBlockMatrixFragment(
aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(),
@@ -422,7 +422,7 @@ ScTransferObj* ScViewFunc::CopyToTransferable()
ScDrawLayer::SetGlobalDrawPersist(NULL);
pClipDoc->ExtendMerge( aRange, true );
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
TransferableObjectDescriptor aObjDesc;
pDocSh->FillTransferableObjectDescriptor( aObjDesc );
aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
@@ -439,17 +439,17 @@ ScTransferObj* ScViewFunc::CopyToTransferable()
void ScViewFunc::PasteDraw()
{
- ScViewData* pViewData = GetViewData();
- SCCOL nPosX = pViewData->GetCurX();
- SCROW nPosY = pViewData->GetCurY();
+ ScViewData& rViewData = GetViewData();
+ SCCOL nPosX = rViewData.GetCurX();
+ SCROW nPosY = rViewData.GetCurY();
Window* pWin = GetActiveWin();
- Point aPos = pWin->PixelToLogic( pViewData->GetScrPos( nPosX, nPosY,
- pViewData->GetActivePart() ) );
+ Point aPos = pWin->PixelToLogic( rViewData.GetScrPos( nPosX, nPosY,
+ rViewData.GetActivePart() ) );
ScDrawTransferObj* pDrawClip = ScDrawTransferObj::GetOwnClipboard( pWin );
if (pDrawClip)
{
OUString aSrcShellID = pDrawClip->GetShellID();
- OUString aDestShellID = SfxObjectShell::CreateShellID(pViewData->GetDocShell());
+ OUString aDestShellID = SfxObjectShell::CreateShellID(rViewData.GetDocShell());
PasteDraw(aPos, pDrawClip->GetModel(), false, aSrcShellID, aDestShellID);
}
}
@@ -582,14 +582,14 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
}
else if (pDrawClip)
{
- ScViewData* pViewData = GetViewData();
- SCCOL nPosX = pViewData->GetCurX();
- SCROW nPosY = pViewData->GetCurY();
+ ScViewData& rViewData = GetViewData();
+ SCCOL nPosX = rViewData.GetCurX();
+ SCROW nPosY = rViewData.GetCurY();
Window* pWin = GetActiveWin();
- Point aPos = pWin->PixelToLogic( pViewData->GetScrPos( nPosX, nPosY, pViewData->GetActivePart() ) );
+ Point aPos = pWin->PixelToLogic( rViewData.GetScrPos( nPosX, nPosY, rViewData.GetActivePart() ) );
PasteDraw(
aPos, pDrawClip->GetModel(), false,
- pDrawClip->GetShellID(), SfxObjectShell::CreateShellID(pViewData->GetDocShell()));
+ pDrawClip->GetShellID(), SfxObjectShell::CreateShellID(rViewData.GetDocShell()));
}
else
{
@@ -654,7 +654,7 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
return;
PasteDataFormat( nFormatId, aDataHelper.GetTransferable(),
- GetViewData()->GetCurX(), GetViewData()->GetCurY(),
+ GetViewData().GetCurX(), GetViewData().GetCurY(),
NULL, false, false );
}
}
@@ -682,7 +682,7 @@ bool ScViewFunc::PasteFromSystem( sal_uLong nFormatId, bool bApi )
return false;
bRet = PasteDataFormat( nFormatId, aDataHelper.GetTransferable(),
- GetViewData()->GetCurX(), GetViewData()->GetCurY(),
+ GetViewData().GetCurX(), GetViewData().GetCurY(),
NULL, false, !bApi ); // allow warning dialog
if ( !bRet && !bApi )
@@ -837,7 +837,7 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
eMoveMode, nUndoFlags);
}
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if (rMark.IsMultiMarked())
{
// Source data is single-range but destination is multi-range.
@@ -900,8 +900,8 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
SCROW nDestSizeY;
pClipDoc->GetClipArea( nDestSizeX, nDestSizeY, bIncludeFiltered );
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
const bool bRecord(pDoc->IsUndoEnabled());
@@ -909,7 +909,7 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
ScRange aMarkRange;
ScMarkData aFilteredMark( rMark); // local copy for all modifications
- ScMarkType eMarkType = GetViewData()->GetSimpleArea( aMarkRange, aFilteredMark);
+ ScMarkType eMarkType = GetViewData().GetSimpleArea( aMarkRange, aFilteredMark);
bool bMarkIsFiltered = (eMarkType == SC_MARK_SIMPLE_FILTERED);
bool bNoPaste = ((eMarkType != SC_MARK_SIMPLE && !bMarkIsFiltered) ||
(bMarkIsFiltered && (eMoveMode != INS_NONE || bAsLink)));
@@ -920,9 +920,9 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
{
// Create a selection with clipboard row count and check that for
// filtered.
- nStartCol = GetViewData()->GetCurX();
- nStartRow = GetViewData()->GetCurY();
- nStartTab = GetViewData()->GetTabNo();
+ nStartCol = GetViewData().GetCurX();
+ nStartRow = GetViewData().GetCurY();
+ nStartTab = GetViewData().GetTabNo();
nEndCol = nStartCol + nDestSizeX;
nEndRow = nStartRow + nDestSizeY;
nEndTab = nStartTab;
@@ -1002,7 +1002,7 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
{
ScWaitCursorOff aWaitOff( GetFrameWin() );
OUString aMessage = ScGlobal::GetRscString( STR_PASTE_BIGGER );
- QueryBox aBox( GetViewData()->GetDialogParent(),
+ QueryBox aBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO), aMessage );
if ( aBox.Execute() != RET_YES )
{
@@ -1045,9 +1045,9 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
}
else
{
- nStartCol = GetViewData()->GetCurX();
- nStartRow = GetViewData()->GetCurY();
- nStartTab = GetViewData()->GetTabNo();
+ nStartCol = GetViewData().GetCurX();
+ nStartRow = GetViewData().GetCurY();
+ nStartTab = GetViewData().GetTabNo();
nEndCol = nStartCol + nDestSizeX;
nEndRow = nStartRow + nDestSizeY;
nEndTab = nStartTab;
@@ -1089,7 +1089,7 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
{
ScRangeList aTestRanges;
aTestRanges.Append(aUserRange);
- if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aFilteredMark, GetViewData()->GetDialogParent()))
+ if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aFilteredMark, GetViewData().GetDialogParent()))
return false;
}
}
@@ -1200,7 +1200,7 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab ); // content before the change
- if (GetViewData()->IsActive())
+ if (GetViewData().IsActive())
{
DoneBlockMode();
InitOwnBlockMode();
@@ -1402,7 +1402,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
InsCellCmd eMoveMode, sal_uInt16 nUndoFlags)
{
- ScViewData& rViewData = *GetViewData();
+ ScViewData& rViewData = GetViewData();
ScDocument* pDoc = rViewData.GetDocument();
ScDocShell* pDocSh = rViewData.GetDocShell();
ScMarkData aMark(rViewData.GetMarkData());
@@ -1580,7 +1580,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
return false;
}
- ScViewData& rViewData = *GetViewData();
+ ScViewData& rViewData = GetViewData();
ScClipParam& rClipParam = pClipDoc->GetClipParam();
if (rClipParam.mbCutMode)
{
@@ -1722,9 +1722,9 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
void ScViewFunc::PostPasteFromClip(const ScRangeList& rPasteRanges, const ScMarkData& rMark)
{
- ScViewData* pViewData = GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- pDocSh->UpdateOle(pViewData);
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ pDocSh->UpdateOle(&rViewData);
SelectionChanged();
@@ -1755,12 +1755,12 @@ void ScViewFunc::PostPasteFromClip(const ScRangeList& rPasteRanges, const ScMark
bool ScViewFunc::MoveBlockTo( const ScRange& rSource, const ScAddress& rDestPos,
bool bCut, bool bRecord, bool bPaint, bool bApi )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
HideAllCursors(); // wegen zusammengefassten
bool bSuccess = true;
SCTAB nDestTab = rDestPos.Tab();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
if ( rSource.aStart.Tab() == nDestTab && rSource.aEnd.Tab() == nDestTab && rMark.GetSelectCount() > 1 )
{
// moving within one table and several tables selected -> apply to all selected tables
@@ -1775,7 +1775,7 @@ bool ScViewFunc::MoveBlockTo( const ScRange& rSource, const ScAddress& rDestPos,
ScRange aLocalSource = rSource;
ScAddress aLocalDest = rDestPos;
- SCTAB nTabCount = pDocSh->GetDocument()->GetTableCount();
+ SCTAB nTabCount = pDocSh->GetDocument().GetTableCount();
SCTAB nStartTab = 0;
while ( nStartTab < nTabCount && bSuccess )
{
@@ -1821,7 +1821,7 @@ bool ScViewFunc::MoveBlockTo( const ScRange& rSource, const ScAddress& rDestPos,
if ( !bIncludeFiltered )
{
// find number of non-filtered rows
- SCROW nPastedCount = pDocSh->GetDocument()->CountNonFilteredRows(
+ SCROW nPastedCount = pDocSh->GetDocument().CountNonFilteredRows(
rSource.aStart.Row(), rSource.aEnd.Row(), rSource.aStart.Tab());
if ( nPastedCount == 0 )
@@ -1831,7 +1831,7 @@ bool ScViewFunc::MoveBlockTo( const ScRange& rSource, const ScAddress& rDestPos,
MarkRange( ScRange( rDestPos, aDestEnd ), false ); //! sal_False ???
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
SelectionChanged();
ResetAutoSpell();
}
@@ -1860,7 +1860,7 @@ bool ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, b
// Ausfuehren per Paste
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
boost::scoped_ptr<ScDocument> pClipDoc(new ScDocument( SCDOCMODE_CLIP ));
pDoc->CopyTabToClip( rSource.aStart.Col(), rSource.aStart.Row(),
rSource.aEnd.Col(), rSource.aEnd.Row(),
@@ -1868,7 +1868,7 @@ bool ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, b
// Zielbereich markieren (Cursor setzen, keine Markierung)
- if ( GetViewData()->GetTabNo() != rDestPos.Tab() )
+ if ( GetViewData().GetTabNo() != rDestPos.Tab() )
SetTabNo( rDestPos.Tab() );
MoveCursorAbs( rDestPos.Col(), rDestPos.Row(), SC_FOLLOW_NONE, false, false );
@@ -1886,9 +1886,9 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
boost::ptr_vector<boost::nullable<Edit> >& aEdits,
sal_uInt16 aColLength )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
ScDocShellModificator aModificator( *pDocSh );
::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
if ( pDoc )
@@ -1897,7 +1897,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
ScDocument* pUndoDoc = NULL;
ScDocument* pRedoDoc = NULL;
ScRefUndoData* pUndoData = NULL;
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
SCTAB nStartTab = nTab;
SCTAB nEndTab = nTab;
@@ -1955,7 +1955,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
pDocSh->PostPaint(
ScRange(nStartCol, nCurrentRow, nStartTab, nUndoEndCol, nUndoEndRow, nEndTab),
nPaint, nExtFlags);
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
}
}
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 73432c6c9f3b..9298b6913a71 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -87,13 +87,13 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
HideAllCursors();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
- const bool bRecord (pDoc->IsUndoEnabled());
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
+ const bool bRecord (rDoc.IsUndoEnabled());
- const ScPatternAttr* pPattern = pDoc->GetPattern( nStartCol, nStartRow, nTab );
- boost::scoped_ptr<ScTabEditEngine> pEngine(new ScTabEditEngine( *pPattern, pDoc->GetEnginePool() ));
+ const ScPatternAttr* pPattern = rDoc.GetPattern( nStartCol, nStartRow, nTab );
+ boost::scoped_ptr<ScTabEditEngine> pEngine(new ScTabEditEngine( *pPattern, rDoc.GetEnginePool() ));
pEngine->EnableUndo( false );
Window* pActWin = GetActiveWin();
@@ -120,15 +120,15 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
if (bRecord)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, IDF_ALL, false, pUndoDoc );
}
SCROW nRow = nStartRow;
// Temporarily turn off undo generation for this lot
- bool bUndoEnabled = pDoc->IsUndoEnabled();
- pDoc->EnableUndo( false );
+ bool bUndoEnabled = rDoc.IsUndoEnabled();
+ rDoc.EnableUndo( false );
for( sal_Int32 n = 0; n < nParCnt; n++ )
{
boost::scoped_ptr<EditTextObject> pObject(pEngine->CreateTextObject(n));
@@ -136,13 +136,13 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
if( ++nRow > MAXROW )
break;
}
- pDoc->EnableUndo(bUndoEnabled);
+ rDoc.EnableUndo(bUndoEnabled);
if (bRecord)
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndo( pDoc, nTab, nTab );
- pDoc->CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, IDF_ALL|IDF_NOCAPTIONS, false, pRedoDoc );
+ pRedoDoc->InitUndo( &rDoc, nTab, nTab );
+ rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, IDF_ALL|IDF_NOCAPTIONS, false, pRedoDoc );
ScRange aMarkRange(nStartCol, nStartRow, nTab, nStartCol, nEndRow, nTab);
ScMarkData aDestMark;
@@ -160,9 +160,9 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
else
{
HideAllCursors();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScImportExport aImpEx( pDocSh->GetDocument(),
- ScAddress( nStartCol, nStartRow, GetViewData()->GetTabNo() ) );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScImportExport aImpEx( &pDocSh->GetDocument(),
+ ScAddress( nStartCol, nStartRow, GetViewData().GetTabNo() ) );
OUString aStr;
SotStorageStreamRef xStream;
@@ -173,14 +173,14 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
aImpEx.ImportString( aStr, SOT_FORMAT_RTF );
AdjustRowHeight( nStartRow, aImpEx.GetRange().aEnd.Row() );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
ShowAllCursors();
}
}
void ScViewFunc::DoRefConversion( bool bRecord )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
SCTAB nTabCount = pDoc->GetTableCount();
if (bRecord && !pDoc->IsUndoEnabled())
bRecord = false;
@@ -194,8 +194,8 @@ void ScViewFunc::DoRefConversion( bool bRecord )
rMark.GetMarkArea( aMarkRange );
else
{
- aMarkRange = ScRange( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ aMarkRange = ScRange( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
}
ScEditableTester aTester( pDoc, aMarkRange.aStart.Col(), aMarkRange.aStart.Row(),
aMarkRange.aEnd.Col(), aMarkRange.aEnd.Row(),rMark );
@@ -205,7 +205,7 @@ void ScViewFunc::DoRefConversion( bool bRecord )
return;
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
bool bOk = false;
ScDocument* pUndoDoc = NULL;
@@ -229,7 +229,7 @@ void ScViewFunc::DoRefConversion( bool bRecord )
}
ScRangeListRef xRanges;
- GetViewData()->GetMultiArea( xRanges );
+ GetViewData().GetMultiArea( xRanges );
size_t nCount = xRanges->size();
ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
@@ -294,7 +294,7 @@ void ScViewFunc::DoRefConversion( bool bRecord )
}
pDocSh->PostPaint( aMarkRange, PAINT_GRID );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
pDocSh->SetDocumentModified();
CellContentChanged();
@@ -307,33 +307,33 @@ void ScViewFunc::DoThesaurus( bool bRecord )
SCCOL nCol;
SCROW nRow;
SCTAB nTab;
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- ScSplitPos eWhich = GetViewData()->GetActivePart();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ ScSplitPos eWhich = GetViewData().GetActivePart();
EESpellState eState;
EditView* pEditView = NULL;
boost::scoped_ptr<ESelection> pEditSel;
boost::scoped_ptr<ScEditEngineDefaulter> pThesaurusEngine;
- bool bIsEditMode = GetViewData()->HasEditView(eWhich);
- if (bRecord && !pDoc->IsUndoEnabled())
+ bool bIsEditMode = GetViewData().HasEditView(eWhich);
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if (bIsEditMode) // Edit-Mode aktiv
{
- GetViewData()->GetEditView(eWhich, pEditView, nCol, nRow);
+ GetViewData().GetEditView(eWhich, pEditView, nCol, nRow);
pEditSel.reset(new ESelection(pEditView->GetSelection()));
SC_MOD()->InputEnterHandler();
- GetViewData()->GetBindings().Update(); // sonst kommt der Sfx durcheinander...
+ GetViewData().GetBindings().Update(); // sonst kommt der Sfx durcheinander...
}
else
{
- nCol = GetViewData()->GetCurX();
- nRow = GetViewData()->GetCurY();
+ nCol = GetViewData().GetCurX();
+ nRow = GetViewData().GetCurY();
}
- nTab = GetViewData()->GetTabNo();
+ nTab = GetViewData().GetTabNo();
ScAddress aPos(nCol, nRow, nTab);
- ScEditableTester aTester( pDoc, nCol, nRow, nCol, nRow, rMark );
+ ScEditableTester aTester( &rDoc, nCol, nRow, nCol, nRow, rMark );
if (!aTester.IsEditable())
{
ErrorMessage(aTester.GetMessageId());
@@ -341,7 +341,7 @@ void ScViewFunc::DoThesaurus( bool bRecord )
}
ScCellValue aOldText;
- aOldText.assign(*pDoc, aPos);
+ aOldText.assign(rDoc, aPos);
if (aOldText.meType != CELLTYPE_STRING && aOldText.meType != CELLTYPE_EDIT)
{
ErrorMessage(STR_THESAURUS_NO_STRING);
@@ -350,15 +350,15 @@ void ScViewFunc::DoThesaurus( bool bRecord )
uno::Reference<linguistic2::XSpellChecker1> xSpeller = LinguMgr::GetSpellChecker();
- pThesaurusEngine.reset(new ScEditEngineDefaulter(pDoc->GetEnginePool()));
- pThesaurusEngine->SetEditTextObjectPool( pDoc->GetEditPool() );
- pThesaurusEngine->SetRefDevice(GetViewData()->GetActiveWin());
+ pThesaurusEngine.reset(new ScEditEngineDefaulter(rDoc.GetEnginePool()));
+ pThesaurusEngine->SetEditTextObjectPool( rDoc.GetEditPool() );
+ pThesaurusEngine->SetRefDevice(GetViewData().GetActiveWin());
pThesaurusEngine->SetSpeller(xSpeller);
MakeEditView(pThesaurusEngine.get(), nCol, nRow );
const ScPatternAttr* pPattern = NULL;
boost::scoped_ptr<SfxItemSet> pEditDefaults(
new SfxItemSet(pThesaurusEngine->GetEmptyItemSet()));
- pPattern = pDoc->GetPattern(nCol, nRow, nTab);
+ pPattern = rDoc.GetPattern(nCol, nRow, nTab);
if (pPattern)
{
pPattern->FillEditItemSet( pEditDefaults.get() );
@@ -368,9 +368,9 @@ void ScViewFunc::DoThesaurus( bool bRecord )
if (aOldText.meType == CELLTYPE_EDIT)
pThesaurusEngine->SetText(*aOldText.mpEditText);
else
- pThesaurusEngine->SetText(aOldText.getString(pDoc));
+ pThesaurusEngine->SetText(aOldText.getString(&rDoc));
- pEditView = GetViewData()->GetEditView(GetViewData()->GetActivePart());
+ pEditView = GetViewData().GetEditView(GetViewData().GetActivePart());
if (pEditSel)
pEditView->SetSelection(*pEditSel);
else
@@ -385,10 +385,10 @@ void ScViewFunc::DoThesaurus( bool bRecord )
if (eState == EE_SPELL_ERRORFOUND) // sollte spaeter durch Wrapper geschehen!
{
- LanguageType eLnge = ScViewUtil::GetEffLanguage( pDoc, ScAddress( nCol, nRow, nTab ) );
+ LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) );
OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG );
- InfoBox aBox( GetViewData()->GetDialogParent(), aErr );
+ InfoBox aBox( GetViewData().GetDialogParent(), aErr );
aBox.Execute();
}
if (pThesaurusEngine->IsModified())
@@ -399,22 +399,22 @@ void ScViewFunc::DoThesaurus( bool bRecord )
{
// The cell will own the text object instance.
EditTextObject* pText = pThesaurusEngine->CreateTextObject();
- pDoc->SetEditText(ScAddress(nCol,nRow,nTab), pText);
+ rDoc.SetEditText(ScAddress(nCol,nRow,nTab), pText);
aNewText.set(*pText);
}
else
{
OUString aStr = pThesaurusEngine->GetText();
- aNewText.set(pDoc->GetSharedStringPool().intern(aStr));
- pDoc->SetString(nCol, nRow, nTab, aStr);
+ aNewText.set(rDoc.GetSharedStringPool().intern(aStr));
+ rDoc.SetString(nCol, nRow, nTab, aStr);
}
pDocSh->SetDocumentModified();
if (bRecord)
{
- GetViewData()->GetDocShell()->GetUndoManager()->AddUndoAction(
+ GetViewData().GetDocShell()->GetUndoManager()->AddUndoAction(
new ScUndoThesaurus(
- GetViewData()->GetDocShell(), nCol, nRow, nTab, aOldText, aNewText));
+ GetViewData().GetDocShell(), nCol, nRow, nTab, aOldText, aNewText));
}
}
@@ -433,14 +433,14 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
SCCOL nCol;
SCROW nRow;
SCTAB nTab;
- ScViewData& rViewData = *GetViewData();
+ ScViewData& rViewData = GetViewData();
ScDocShell* pDocSh = rViewData.GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScMarkData& rMark = rViewData.GetMarkData();
ScSplitPos eWhich = rViewData.GetActivePart();
EditView* pEditView = NULL;
bool bIsEditMode = rViewData.HasEditView(eWhich);
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
if (bIsEditMode) // Edit-Mode aktiv
{
@@ -460,7 +460,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
bool bMarked = rMark.IsMultiMarked();
if (bMarked)
{
- ScEditableTester aTester( pDoc, rMark );
+ ScEditableTester aTester( &rDoc, rMark );
if (!aTester.IsEditable())
{
ErrorMessage(aTester.GetMessageId());
@@ -473,9 +473,9 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
if (bRecord)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
- pRedoDoc->InitUndo( pDoc, nTab, nTab );
+ pRedoDoc->InitUndo( &rDoc, nTab, nTab );
if ( rMark.GetSelectCount() > 1 )
{
@@ -491,8 +491,8 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
// ab hier kein return mehr
- bool bOldEnabled = pDoc->IsIdleEnabled();
- pDoc->EnableIdle(false); // stop online spelling
+ bool bOldEnabled = rDoc.IsIdleEnabled();
+ rDoc.EnableIdle(false); // stop online spelling
// *** create and init the edit engine *** --------------------------------
@@ -501,12 +501,12 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
{
case SC_CONVERSION_SPELLCHECK:
pEngine.reset(new ScSpellingEngine(
- pDoc->GetEnginePool(), rViewData, pUndoDoc, pRedoDoc, LinguMgr::GetSpellChecker() ));
+ rDoc.GetEnginePool(), rViewData, pUndoDoc, pRedoDoc, LinguMgr::GetSpellChecker() ));
break;
case SC_CONVERSION_HANGULHANJA:
case SC_CONVERSION_CHINESE_TRANSL:
pEngine.reset(new ScTextConversionEngine(
- pDoc->GetEnginePool(), rViewData, rConvParam, pUndoDoc, pRedoDoc ));
+ rDoc.GetEnginePool(), rViewData, rConvParam, pUndoDoc, pRedoDoc ));
break;
default:
OSL_FAIL( "ScViewFunc::DoSheetConversion - unknown conversion type" );
@@ -545,7 +545,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
}
sc::SetFormulaDirtyContext aCxt;
- pDoc->SetAllFormulasDirty(aCxt);
+ rDoc.SetAllFormulasDirty(aCxt);
pDocSh->SetDocumentModified();
}
@@ -562,7 +562,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, bool bR
pEngine.reset();
pDocSh->PostPaintGridAll();
rViewData.GetViewShell()->UpdateInputHandler();
- pDoc->EnableIdle(bOldEnabled);
+ rDoc.EnableIdle(bOldEnabled);
}
// Pasten von FORMAT_FILE-Items
@@ -578,7 +578,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
if( ::avmedia::MediaWindow::isMediaURL( aStrURL, ""/*TODO?*/ ) )
{
const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aStrURL );
- return ( 0 != GetViewData()->GetDispatcher().Execute(
+ return ( 0 != GetViewData().GetDispatcher().Execute(
SID_INSERT_AVMEDIA, SFX_CALLMODE_SYNCHRON,
&aMediaURLItem, 0L ) );
}
@@ -599,7 +599,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
if ( pFlt && !nErr )
{
// Code aus dem SFX geklaut!
- SfxDispatcher &rDispatcher = GetViewData()->GetDispatcher();
+ SfxDispatcher &rDispatcher = GetViewData().GetDispatcher();
SfxStringItem aFileNameItem( SID_FILE_NAME, aStrURL );
SfxStringItem aFilterItem( SID_FILTER_NAME, pFlt->GetName() );
// #i69524# add target, as in SfxApplication when the Open dialog is used
@@ -638,8 +638,8 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
if (bLink) // bei bLink alles, was nicht Grafik ist, als URL
{
Rectangle aRect( rPos, Size(0,0) );
- ScRange aRange = GetViewData()->GetDocument()->
- GetRange( GetViewData()->GetTabNo(), aRect );
+ ScRange aRange = GetViewData().GetDocument()->
+ GetRange( GetViewData().GetTabNo(), aRect );
SCCOL nPosX = aRange.aStart.Col();
SCROW nPosY = aRange.aStart.Row();
@@ -666,7 +666,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
// If an OLE object can't be created, insert a URL button
- GetViewData()->GetViewShell()->InsertURLButton( aStrURL, aStrURL, EMPTY_OUSTRING, &rPos );
+ GetViewData().GetViewShell()->InsertURLButton( aStrURL, aStrURL, EMPTY_OUSTRING, &rPos );
return true;
}
}
@@ -689,24 +689,24 @@ void ScViewFunc::InsertBookmark( const OUString& rDescription, const OUString& r
SCCOL nPosX, SCROW nPosY, const OUString* pTarget,
bool bTryReplace )
{
- ScViewData* pViewData = GetViewData();
- if ( pViewData->HasEditView( pViewData->GetActivePart() ) &&
- nPosX >= pViewData->GetEditStartCol() && nPosX <= pViewData->GetEditEndCol() &&
- nPosY >= pViewData->GetEditStartRow() && nPosY <= pViewData->GetEditEndRow() )
+ ScViewData& rViewData = GetViewData();
+ if ( rViewData.HasEditView( rViewData.GetActivePart() ) &&
+ nPosX >= rViewData.GetEditStartCol() && nPosX <= rViewData.GetEditEndCol() &&
+ nPosY >= rViewData.GetEditStartRow() && nPosY <= rViewData.GetEditEndRow() )
{
// in die gerade editierte Zelle einfuegen
OUString aTargetFrame;
if (pTarget)
aTargetFrame = *pTarget;
- pViewData->GetViewShell()->InsertURLField( rDescription, rURL, aTargetFrame );
+ rViewData.GetViewShell()->InsertURLField( rDescription, rURL, aTargetFrame );
return;
}
// in nicht editierte Zelle einfuegen
- ScDocument* pDoc = GetViewData()->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
ScAddress aCellPos( nPosX, nPosY, nTab );
EditEngine aEngine( pDoc->GetEnginePool() );
@@ -746,10 +746,10 @@ void ScViewFunc::InsertBookmark( const OUString& rDescription, const OUString& r
bool ScViewFunc::HasBookmarkAtCursor( SvxHyperlinkItem* pContent )
{
- ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
- ScDocument* pDoc = GetViewData()->GetDocShell()->GetDocument();
+ ScAddress aPos( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() );
+ ScDocument& rDoc = GetViewData().GetDocShell()->GetDocument();
- const EditTextObject* pData = pDoc->GetEditText(aPos);
+ const EditTextObject* pData = rDoc.GetEditText(aPos);
if (!pData)
return false;
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 9d398119e296..9ee7fa5dbcea 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -75,7 +75,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
const uno::Reference<datatransfer::XTransferable>& rxTransferable,
SCCOL nPosX, SCROW nPosY, Point* pLogicPos, bool bLink, bool bAllowDialogs )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
pDoc->SetPastingDrawFromOtherDoc( true );
Point aPos; // inserting position (1/100 mm)
@@ -90,7 +90,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
{
// Window MapMode isn't drawing MapMode if DrawingLayer hasn't been created yet
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
long nXT = 0;
for (SCCOL i=0; i<nPosX; i++)
nXT += pDoc->GetColWidth(i,nTab);
@@ -135,9 +135,9 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
ScDocShellRef xDocShRef = new ScDocShell(SFX_CREATE_MODE_EMBEDDED);
if (xDocShRef->DoLoad(pMedium))
{
- ScDocument* pSrcDoc = xDocShRef->GetDocument();
- SCTAB nSrcTab = pSrcDoc->GetVisibleTab();
- if (!pSrcDoc->HasTable(nSrcTab))
+ ScDocument& rSrcDoc = xDocShRef->GetDocument();
+ SCTAB nSrcTab = rSrcDoc.GetVisibleTab();
+ if (!rSrcDoc.HasTable(nSrcTab))
nSrcTab = 0;
ScMarkData aSrcMark;
@@ -146,15 +146,15 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
SCCOL nFirstCol, nLastCol;
SCROW nFirstRow, nLastRow;
- if ( pSrcDoc->GetDataStart( nSrcTab, nFirstCol, nFirstRow ) )
- pSrcDoc->GetCellArea( nSrcTab, nLastCol, nLastRow );
+ if ( rSrcDoc.GetDataStart( nSrcTab, nFirstCol, nFirstRow ) )
+ rSrcDoc.GetCellArea( nSrcTab, nLastCol, nLastRow );
else
{
nFirstCol = nLastCol = 0;
nFirstRow = nLastRow = 0;
}
ScClipParam aClipParam(ScRange(nFirstCol, nFirstRow, nSrcTab, nLastCol, nLastRow, nSrcTab), false);
- pSrcDoc->CopyToClip(aClipParam, pClipDoc.get(), &aSrcMark);
+ rSrcDoc.CopyToClip(aClipParam, pClipDoc.get(), &aSrcMark);
ScGlobal::SetClipDocName( xDocShRef->GetTitle( SFX_TITLE_FULLNAME ) );
SetCursor( nPosX, nPosY );
@@ -171,7 +171,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
else
{
OUString aName;
- uno::Reference < embed::XEmbeddedObject > xObj = GetViewData()->GetViewShell()->GetObjectShell()->
+ uno::Reference < embed::XEmbeddedObject > xObj = GetViewData().GetViewShell()->GetObjectShell()->
GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
if ( xObj.is() )
{
@@ -217,7 +217,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
if (xStm.is())
{
- xObj = GetViewData()->GetDocShell()->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
+ xObj = GetViewData().GetDocShell()->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
}
else
{
@@ -236,7 +236,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
// for example whether the object should be an iconified one
xObj = aInfo.Object;
if ( xObj.is() )
- GetViewData()->GetDocShell()->GetEmbeddedObjectContainer().InsertEmbeddedObject( xObj, aName );
+ GetViewData().GetDocShell()->GetEmbeddedObjectContainer().InsertEmbeddedObject( xObj, aName );
}
catch( uno::Exception& )
{}
@@ -294,8 +294,8 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
}
else
{
- ScAddress aCellPos( nPosX, nPosY, GetViewData()->GetTabNo() );
- ScImportExport aObj( GetViewData()->GetDocument(), aCellPos );
+ ScAddress aCellPos( nPosX, nPosY, GetViewData().GetTabNo() );
+ ScImportExport aObj( GetViewData().GetDocument(), aCellPos );
aObj.SetImportBroadcast(true);
OUString aStr;
@@ -368,7 +368,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
bRet = aObj.ImportString( aStr, nFormatId );
InvalidateAttribs();
- GetViewData()->UpdateInputHandler();
+ GetViewData().UpdateInputHandler();
}
}
else if (nFormatId == SOT_FORMATSTR_ID_SBA_DATAEXCHANGE)
@@ -385,8 +385,8 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
aDescAny <<= aProperties;
SfxUsrAnyItem aDataDesc(SID_SBA_IMPORT, aDescAny);
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ SCTAB nTab = GetViewData().GetTabNo();
ClickCursor(nPosX, nPosY, false); // set cursor position
@@ -408,7 +408,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
SfxBoolItem aAreaNew(FN_PARAM_2, bAreaIsNew);
// asynchronous, to avoid doing the whole import in drop handler
- SfxDispatcher& rDisp = GetViewData()->GetDispatcher();
+ SfxDispatcher& rDisp = GetViewData().GetDispatcher();
rDisp.Execute(SID_SBA_IMPORT, SFX_CALLMODE_ASYNCHRON,
&aDataDesc, &aTarget, &aAreaNew, (void*)0 );
@@ -455,7 +455,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
pScDrawView->InsertObjectSafe(pObj, *pScDrawView->GetSdrPageView());
- GetViewData()->GetViewShell()->SetDrawShell( true );
+ GetViewData().GetViewShell()->SetDrawShell( true );
bRet = true;
}
}
@@ -705,7 +705,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r
// uses Calc A1 syntax even when another formula syntax is specified
// in the UI.
EnterMatrix("='"
- + OUString(ScGlobal::GetAbsDocName(*pTopic, GetViewData()->GetDocument()->GetDocumentShell()))
+ + OUString(ScGlobal::GetAbsDocName(*pTopic, GetViewData().GetDocument()->GetDocumentShell()))
+ "'#" + *pItem
, ::formula::FormulaGrammar::GRAM_NATIVE);
return true;
@@ -728,9 +728,9 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r
// mark range
- SCTAB nTab = GetViewData()->GetTabNo();
- SCCOL nCurX = GetViewData()->GetCurX();
- SCROW nCurY = GetViewData()->GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
HideAllCursors();
DoneBlockMode();
InitBlockMode( nCurX, nCurY, nTab );
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index abfb11abf96a..74fe5592d660 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -51,56 +51,56 @@ using ::std::vector;
void ScViewFunc::DetectiveAddPred()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveAddPred( GetViewData()->GetCurPos() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveAddPred( GetViewData().GetCurPos() );
RecalcPPT(); //! use broadcast in DocFunc instead?
}
void ScViewFunc::DetectiveDelPred()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveDelPred( GetViewData()->GetCurPos() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveDelPred( GetViewData().GetCurPos() );
RecalcPPT();
}
void ScViewFunc::DetectiveAddSucc()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveAddSucc( GetViewData()->GetCurPos() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveAddSucc( GetViewData().GetCurPos() );
RecalcPPT();
}
void ScViewFunc::DetectiveDelSucc()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveDelSucc( GetViewData()->GetCurPos() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveDelSucc( GetViewData().GetCurPos() );
RecalcPPT();
}
void ScViewFunc::DetectiveAddError()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveAddError( GetViewData()->GetCurPos() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveAddError( GetViewData().GetCurPos() );
RecalcPPT();
}
void ScViewFunc::DetectiveDelAll()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveDelAll( GetViewData()->GetTabNo() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveDelAll( GetViewData().GetTabNo() );
RecalcPPT();
}
void ScViewFunc::DetectiveMarkInvalid()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- pDocSh->GetDocFunc().DetectiveMarkInvalid( GetViewData()->GetTabNo() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ pDocSh->GetDocFunc().DetectiveMarkInvalid( GetViewData().GetTabNo() );
RecalcPPT();
}
void ScViewFunc::DetectiveRefresh()
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
pDocSh->GetDocFunc().DetectiveRefresh();
RecalcPPT();
}
@@ -117,12 +117,12 @@ static void lcl_jumpToRange(const ScRange& rRange, ScViewData* pView, ScDocument
void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges)
{
- ScViewData* pView = GetViewData();
- ScDocShell* pDocSh = pView->GetDocShell();
+ ScViewData& rView = GetViewData();
+ ScDocShell* pDocSh = rView.GetDocShell();
ScRangeList aRanges(rRanges);
ScRangeList aRangesToMark;
- ScAddress aCurPos = pView->GetCurPos();
+ ScAddress aCurPos = rView.GetCurPos();
size_t ListSize = aRanges.size();
for ( size_t i = 0; i < ListSize; ++i )
{
@@ -138,7 +138,7 @@ void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges)
// Jump to the first range of all precedent ranges.
const ScRange* p = aRangesToMark.front();
- lcl_jumpToRange(*p, pView, pDocSh->GetDocument());
+ lcl_jumpToRange(*p, &rView, &pDocSh->GetDocument());
ListSize = aRangesToMark.size();
for ( size_t i = 0; i < ListSize; ++i )
@@ -150,11 +150,11 @@ void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges)
void ScViewFunc::DetectiveMarkPred()
{
- ScViewData* pView = GetViewData();
- ScDocShell* pDocSh = pView->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMarkData = pView->GetMarkData();
- ScAddress aCurPos = pView->GetCurPos();
+ ScViewData& rView = GetViewData();
+ ScDocShell* pDocSh = rView.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMarkData = rView.GetMarkData();
+ ScAddress aCurPos = rView.GetCurPos();
ScRangeList aRanges;
if (rMarkData.IsMarked() || rMarkData.IsMultiMarked())
rMarkData.FillRangeListWithMarks(&aRanges, false);
@@ -175,7 +175,7 @@ void ScViewFunc::DetectiveMarkPred()
// jump to the destination.
sal_uInt16 nFileId = p->GetIndex();
- ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
+ ScExternalRefManager* pRefMgr = rDoc.GetExternalRefManager();
const OUString* pPath = pRefMgr->getExternalFileName(nFileId);
ScRange aRange;
@@ -203,7 +203,7 @@ void ScViewFunc::DetectiveMarkPred()
{
// The first precedent range is on a different sheet. Jump to it
// immediately and forget the rest.
- lcl_jumpToRange(aRange, pView, pDoc);
+ lcl_jumpToRange(aRange, &rView, &rDoc);
return;
}
}
@@ -215,10 +215,10 @@ void ScViewFunc::DetectiveMarkPred()
void ScViewFunc::DetectiveMarkSucc()
{
- ScViewData* pView = GetViewData();
- ScDocShell* pDocSh = pView->GetDocShell();
- ScMarkData& rMarkData = pView->GetMarkData();
- ScAddress aCurPos = pView->GetCurPos();
+ ScViewData& rView = GetViewData();
+ ScDocShell* pDocSh = rView.GetDocShell();
+ ScMarkData& rMarkData = rView.GetMarkData();
+ ScAddress aCurPos = rView.GetCurPos();
ScRangeList aRanges;
if (rMarkData.IsMarked() || rMarkData.IsMultiMarked())
rMarkData.FillRangeListWithMarks(&aRanges, false);
@@ -239,12 +239,12 @@ void ScViewFunc::DetectiveMarkSucc()
void ScViewFunc::InsertCurrentTime(short nCellFmt, const OUString& rUndoStr)
{
- ScViewData* pViewData = GetViewData();
- ScAddress aCurPos = pViewData->GetCurPos();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScAddress aCurPos = rViewData.GetCurPos();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
Date aActDate( Date::SYSTEM );
double fDate = aActDate - *pFormatter->GetNullDate();
Time aActTime( Time::SYSTEM );
@@ -257,7 +257,7 @@ void ScViewFunc::InsertCurrentTime(short nCellFmt, const OUString& rUndoStr)
// Set the new cell format only when it differs from the current cell
// format type.
- sal_uInt32 nCurNumFormat = pDoc->GetNumberFormat(aCurPos);
+ sal_uInt32 nCurNumFormat = rDoc.GetNumberFormat(aCurPos);
const SvNumberformat* pEntry = pFormatter->GetEntry(nCurNumFormat);
if (!pEntry || !(pEntry->GetType() & nCellFmt))
SetNumberFormat(nCellFmt);
@@ -268,7 +268,7 @@ void ScViewFunc::ShowNote( bool bShow )
{
if( bShow )
HideNoteMarker();
- const ScViewData& rViewData = *GetViewData();
+ const ScViewData& rViewData = GetViewData();
ScAddress aPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() );
// show note moved to ScDocFunc, to be able to use it in notesuno.cxx
rViewData.GetDocShell()->GetDocFunc().ShowNote( aPos, bShow );
@@ -278,21 +278,21 @@ void ScViewFunc::EditNote()
{
// for editing display and activate
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
ScAddress aPos( nCol, nRow, nTab );
// start drawing undo to catch undo action for insertion of the caption object
pDocSh->MakeDrawLayer();
- ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
pDrawLayer->BeginCalcUndo(true);
// generated undo action is processed in FuText::StopEditMode
// get existing note or create a new note (including caption drawing object)
- if( ScPostIt* pNote = pDoc->GetOrCreateNote( aPos ) )
+ if( ScPostIt* pNote = rDoc.GetOrCreateNote( aPos ) )
{
// hide temporary note caption
HideNoteMarker();
@@ -311,7 +311,7 @@ void ScViewFunc::EditNote()
static_cast< FuSelection* >( pDraw )->ActivateNoteHandles( pCaption );
// activate object (as in FuSelection::TestComment)
- GetViewData()->GetDispatcher().Execute( SID_DRAW_NOTEEDIT, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD );
+ GetViewData().GetDispatcher().Execute( SID_DRAW_NOTEEDIT, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD );
// now get the created FuText and set into EditMode
FuPoor* pPoor = GetDrawFuncPtr();
if ( pPoor && (pPoor->GetSlotID() == SID_DRAW_NOTEEDIT) ) // has no RTTI
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 8799d59c191d..77093e4b12c1 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -84,14 +84,14 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
// MapMode at Outliner-RefDevice has to be right (as in FuText::MakeOutliner)
//! merge with FuText::MakeOutliner?
MapMode aOldMapMode;
- OutputDevice* pRef = GetViewData()->GetDocument()->GetDrawLayer()->GetRefDevice();
+ OutputDevice* pRef = GetViewData().GetDocument()->GetDrawLayer()->GetRefDevice();
if (pRef)
{
aOldMapMode = pRef->GetMapMode();
pRef->SetMapMode( MapMode(MAP_100TH_MM) );
}
- bool bNegativePage = GetViewData()->GetDocument()->IsNegativePage( GetViewData()->GetTabNo() );
+ bool bNegativePage = GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() );
SdrView* pDragEditView = NULL;
ScModule* pScMod = SC_MOD();
@@ -138,7 +138,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
else
{
SdrModel* pDrawModel = pDragEditView->GetModel();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
SdrPage* pDestPage = pDrawModel->GetPage( static_cast< sal_uInt16 >( nTab ) );
OSL_ENSURE(pDestPage,"who is this, Page?");
@@ -173,15 +173,15 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
pScDrawView->AddUndo(new SdrUndoInsertObj( *pNeuObj ));
if (ScDrawLayer::IsCellAnchored(*pNeuObj))
- ScDrawLayer::SetCellAnchoredFromPosition(*pNeuObj, *GetViewData()->GetDocument(), nTab);
+ ScDrawLayer::SetCellAnchoredFromPosition(*pNeuObj, *GetViewData().GetDocument(), nTab);
}
}
if (bPasteIsMove)
pDragEditView->DeleteMarked();
- ScDocument* pDocument = GetViewData()->GetDocument();
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocument* pDocument = GetViewData().GetDocument();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL );
if ( pDocument && pDestPage && pModelObj && pDrawTrans )
{
@@ -199,18 +199,18 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
aView.MarkAllObj(pPv);
Size aSize = aView.GetAllMarkedRect().GetSize();
- lcl_AdjustInsertPos( GetViewData(), aPos, aSize );
+ lcl_AdjustInsertPos( &GetViewData(), aPos, aSize );
// don't change marking if OLE object is active
// (at Drop from OLE object it would be deactivated in the middle of ExecuteDrag!)
sal_uLong nOptions = 0;
- SfxInPlaceClient* pClient = GetViewData()->GetViewShell()->GetIPClient();
+ SfxInPlaceClient* pClient = GetViewData().GetViewShell()->GetIPClient();
if ( pClient && pClient->IsObjectInPlaceActive() )
nOptions |= SDRINSERT_DONTMARK;
::std::vector< OUString > aExcludedChartNames;
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCTAB nTab = GetViewData().GetTabNo();
SdrPage* pPage = pScDrawView->GetModel()->GetPage( static_cast< sal_uInt16 >( nTab ) );
OSL_ENSURE( pPage, "Page?" );
if ( pPage )
@@ -221,12 +221,12 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
// #89247# Set flag for ScDocument::UpdateChartListeners() which is
// called during paste.
if ( !bSameDocClipboard )
- GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( true );
+ GetViewData().GetDocument()->SetPastingDrawFromOtherDoc( true );
pScDrawView->Paste(*pModel, aPos, NULL, nOptions, rSrcShellID, rDestShellID);
if ( !bSameDocClipboard )
- GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( false );
+ GetViewData().GetDocument()->SetPastingDrawFromOtherDoc( false );
// Paste puts all objects on the active (front) layer
// controls must be on SC_LAYER_CONTROLS
@@ -240,17 +240,17 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
pObject->NbcSetLayer(SC_LAYER_CONTROLS);
if (ScDrawLayer::IsCellAnchored(*pObject))
- ScDrawLayer::SetCellAnchoredFromPosition(*pObject, *GetViewData()->GetDocument(), nTab);
+ ScDrawLayer::SetCellAnchoredFromPosition(*pObject, *GetViewData().GetDocument(), nTab);
pObject = aIter.Next();
}
}
// all graphics objects must have names
- GetViewData()->GetDocument()->EnsureGraphicNames();
+ GetViewData().GetDocument()->EnsureGraphicNames();
- ScDocument* pDocument = GetViewData()->GetDocument();
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocument* pDocument = GetViewData().GetDocument();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL );
ScDrawTransferObj* pTransferObj = ScDrawTransferObj::GetOwnClipboard( NULL );
if ( pDocument && pPage && pModelObj && ( pTransferObj || pDrawTrans ) )
@@ -271,7 +271,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
if (pRef)
pRef->SetMapMode( aOldMapMode );
- // GetViewData()->GetViewShell()->SetDrawShell( true );
+ // GetViewData().GetViewShell()->SetDrawShell( true );
// It is not sufficient to just set the DrawShell if we pasted, for
// example, a chart. SetDrawShellOrSub() would only work for D&D in the
// same document but not if inserting from the clipboard, therefore
@@ -288,7 +288,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
{
OUString aName;
//TODO/MBA: is that OK?
- comphelper::EmbeddedObjectContainer& aCnt = GetViewData()->GetViewShell()->GetObjectShell()->GetEmbeddedObjectContainer();
+ comphelper::EmbeddedObjectContainer& aCnt = GetViewData().GetViewShell()->GetObjectShell()->GetEmbeddedObjectContainer();
if ( !aCnt.HasEmbeddedObject( xObj ) )
aCnt.InsertEmbeddedObject( xObj, aName );
else
@@ -347,7 +347,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
// don't call AdjustInsertPos
Point aInsPos = rPos;
- if ( GetViewData()->GetDocument()->IsNegativePage( GetViewData()->GetTabNo() ) )
+ if ( GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() ) )
aInsPos.X() -= aSize.Width();
Rectangle aRect( aInsPos, aSize );
@@ -356,7 +356,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
SdrPageView* pPV = pDrView->GetSdrPageView();
pDrView->InsertObjectSafe( pSdrObj, *pPV ); // don't mark if OLE
- GetViewData()->GetViewShell()->SetDrawShell( true );
+ GetViewData().GetViewShell()->SetDrawShell( true );
return true;
}
else
@@ -428,10 +428,10 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
Size aSize = pWin->LogicToLogic( rGraphic.GetPrefSize(), &aSourceMap, &aDestMap );
- if ( GetViewData()->GetDocument()->IsNegativePage( GetViewData()->GetTabNo() ) )
+ if ( GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() ) )
aPos.X() -= aSize.Width();
- GetViewData()->GetViewShell()->SetDrawShell( true );
+ GetViewData().GetViewShell()->SetDrawShell( true );
Rectangle aRect(aPos, aSize);
SdrGrafObj* pGrafObj = new SdrGrafObj(rGraphic, aRect);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 9ce469a3d909..a996f3735bcd 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -107,7 +107,7 @@ void ScViewFunc::StartFormatArea()
// start only with single cell (marked or cursor position)
ScRange aMarkRange;
- bool bOk = (GetViewData()->GetSimpleArea( aMarkRange ) == SC_MARK_SIMPLE);
+ bool bOk = (GetViewData().GetSimpleArea( aMarkRange ) == SC_MARK_SIMPLE);
if ( bOk && aMarkRange.aStart != aMarkRange.aEnd )
bOk = false;
@@ -189,12 +189,12 @@ bool ScViewFunc::TestFormatArea( SCCOL nCol, SCROW nRow, SCTAB nTab, bool bAttrC
void ScViewFunc::DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab,
bool bAttrChanged, bool bAddUndo )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- if (bAddUndo && !pDoc->IsUndoEnabled())
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ if (bAddUndo && !rDoc.IsUndoEnabled())
bAddUndo = false;
- const ScPatternAttr* pSource = pDoc->GetPattern(
+ const ScPatternAttr* pSource = rDoc.GetPattern(
aFormatSource.Col(), aFormatSource.Row(), nTab );
if ( !((const ScMergeAttr&)pSource->GetItem(ATTR_MERGE)).IsMerged() )
{
@@ -202,10 +202,10 @@ void ScViewFunc::DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab,
ScMarkData aMark;
aMark.SetMarkArea( aRange );
- ScDocFunc &rFunc = GetViewData()->GetDocFunc();
+ ScDocFunc &rFunc = GetViewData().GetDocFunc();
// pOldPattern is only valid until call to ApplyAttributes!
- const ScPatternAttr* pOldPattern = pDoc->GetPattern( nCol, nRow, nTab );
+ const ScPatternAttr* pOldPattern = rDoc.GetPattern( nCol, nRow, nTab );
const ScStyleSheet* pSrcStyle = pSource->GetStyleSheet();
if ( pSrcStyle && pSrcStyle != pOldPattern->GetStyleSheet() )
rFunc.ApplyStyle( aMark, pSrcStyle->GetName(), true, false );
@@ -221,14 +221,14 @@ void ScViewFunc::DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab,
sal_uInt16 ScViewFunc::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, bool bFormula )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
- double nPPTX = GetViewData()->GetPPTX();
- double nPPTY = GetViewData()->GetPPTY();
- Fraction aZoomX = GetViewData()->GetZoomX();
- Fraction aZoomY = GetViewData()->GetZoomY();
+ double nPPTX = GetViewData().GetPPTX();
+ double nPPTY = GetViewData().GetPPTY();
+ Fraction aZoomX = GetViewData().GetZoomX();
+ Fraction aZoomY = GetViewData().GetZoomY();
ScSizeDeviceProvider aProv(pDocSh);
if (aProv.IsPrinter())
@@ -238,7 +238,7 @@ sal_uInt16 ScViewFunc::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, bool bFormula
aZoomX = aZoomY = Fraction( 1, 1 );
}
- sal_uInt16 nTwips = pDoc->GetOptimalColWidth( nCol, nTab, aProv.GetDevice(),
+ sal_uInt16 nTwips = rDoc.GetOptimalColWidth( nCol, nTab, aProv.GetDevice(),
nPPTX, nPPTY, aZoomX, aZoomY, bFormula, &rMark );
return nTwips;
}
@@ -246,15 +246,15 @@ sal_uInt16 ScViewFunc::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, bool bFormula
bool ScViewFunc::SelectionEditable( bool* pOnlyNotBecauseOfMatrix /* = NULL */ )
{
bool bRet;
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
if (rMark.IsMarked() || rMark.IsMultiMarked())
bRet = pDoc->IsSelectionEditable( rMark, pOnlyNotBecauseOfMatrix );
else
{
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
bRet = pDoc->IsBlockEditable( nTab, nCol, nRow, nCol, nRow,
pOnlyNotBecauseOfMatrix );
}
@@ -336,13 +336,13 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
const OUString& rString,
const EditTextObject* pData )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
bool bRecord = pDoc->IsUndoEnabled();
SCTAB i;
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocFunc &rFunc = GetViewData()->GetDocFunc();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocFunc &rFunc = GetViewData().GetDocFunc();
ScDocShellModificator aModificator( *pDocSh );
ScEditableTester aTester( pDoc, nCol,nRow, nCol,nRow, rMark );
@@ -441,7 +441,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
{
OUString aMessage( ScResId( SCSTR_FORMULA_AUTOCORRECTION ) );
aMessage += aCorrectedFormula;
- nResult = QueryBox( GetViewData()->GetDialogParent(),
+ nResult = QueryBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_YES),
aMessage ).Execute();
}
@@ -559,7 +559,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
if (bAutoFormat)
DoAutoAttributes(nCol, nRow, nTab, bNumFmtChanged, bRecord);
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, rMark, nCol, nRow);
@@ -574,8 +574,8 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
void ScViewFunc::EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rValue )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
if ( pDoc && pDocSh )
{
@@ -600,7 +600,7 @@ void ScViewFunc::EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& r
}
pDocSh->PostPaintCell( aPos );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
aModificator.SetDocumentModified();
}
else
@@ -611,14 +611,14 @@ void ScViewFunc::EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& r
void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
const EditTextObject& rData, bool bTestSimple )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData& rMark = GetViewData()->GetMarkData();
- ScDocument* pDoc = pDocSh->GetDocument();
- bool bRecord = pDoc->IsUndoEnabled();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ bool bRecord = rDoc.IsUndoEnabled();
ScDocShellModificator aModificator( *pDocSh );
- ScEditableTester aTester( pDoc, nTab, nCol,nRow, nCol,nRow );
+ ScEditableTester aTester( &rDoc, nTab, nCol,nRow, nCol,nRow );
if (aTester.IsEditable())
{
@@ -629,8 +629,8 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
boost::scoped_ptr<ScPatternAttr> pCellAttrs;
OUString aString;
- const ScPatternAttr* pOldPattern = pDoc->GetPattern( nCol, nRow, nTab );
- ScTabEditEngine aEngine( *pOldPattern, pDoc->GetEnginePool() );
+ const ScPatternAttr* pOldPattern = rDoc.GetPattern( nCol, nRow, nTab );
+ ScTabEditEngine aEngine( *pOldPattern, rDoc.GetEnginePool() );
aEngine.SetText(rData);
if (bTestSimple) // test, if simple string without attribute
@@ -674,7 +674,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
{
ScUndoEnterData::Value aOldValue;
aOldValue.mnTab = *itr;
- aOldValue.maCell.assign(*pDoc, ScAddress(nCol, nRow, *itr));
+ aOldValue.maCell.assign(rDoc, ScAddress(nCol, nRow, *itr));
aOldValues.push_back(aOldValue);
}
@@ -686,7 +686,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
if (bCommon)
- pDoc->ApplyPattern(nCol,nRow,nTab,*pCellAttrs); //! undo
+ rDoc.ApplyPattern(nCol,nRow,nTab,*pCellAttrs); //! undo
if (bSimple)
{
@@ -701,7 +701,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
for (; itr != itrEnd; ++itr)
{
ScAddress aPos(nCol, nRow, *itr);
- pDoc->SetEditText(aPos, rData, pDoc->GetEditPool());
+ rDoc.SetEditText(aPos, rData, rDoc.GetEditPool());
}
if ( bRecord )
@@ -720,13 +720,13 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
ShowAllCursors();
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, rMark, nCol, nRow);
aModificator.SetDocumentModified();
}
- lcl_PostRepaintCondFormat( pDoc->GetCondFormat( nCol, nRow, nTab ), pDocSh );
+ lcl_PostRepaintCondFormat( rDoc.GetCondFormat( nCol, nRow, nTab ), pDocSh );
}
else
{
@@ -737,26 +737,26 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
void ScViewFunc::EnterDataAtCursor( const OUString& rString )
{
- SCCOL nPosX = GetViewData()->GetCurX();
- SCROW nPosY = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCCOL nPosX = GetViewData().GetCurX();
+ SCROW nPosY = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
EnterData( nPosX, nPosY, nTab, rString );
}
void ScViewFunc::EnterMatrix( const OUString& rString, ::formula::FormulaGrammar::Grammar eGram )
{
- ScViewData* pData = GetViewData();
- const ScMarkData& rMark = pData->GetMarkData();
+ ScViewData& rData = GetViewData();
+ const ScMarkData& rMark = rData.GetMarkData();
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
{
// nothing marked -> temporarily calculate block
// with size of result formula to get the size
- ScDocument* pDoc = pData->GetDocument();
- SCCOL nCol = pData->GetCurX();
- SCROW nRow = pData->GetCurY();
- SCTAB nTab = pData->GetTabNo();
+ ScDocument* pDoc = rData.GetDocument();
+ SCCOL nCol = rData.GetCurX();
+ SCROW nRow = rData.GetCurY();
+ SCTAB nTab = rData.GetTabNo();
ScFormulaCell aFormCell( pDoc, ScAddress(nCol,nRow,nTab), rString, eGram, MM_FORMULA );
SCSIZE nSizeX;
@@ -774,13 +774,13 @@ void ScViewFunc::EnterMatrix( const OUString& rString, ::formula::FormulaGrammar
}
ScRange aRange;
- if (pData->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (rData.GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = pData->GetDocShell();
+ ScDocShell* pDocSh = rData.GetDocShell();
bool bSuccess = pDocSh->GetDocFunc().EnterMatrix(
aRange, &rMark, NULL, rString, false, false, EMPTY_OUSTRING, eGram );
if (bSuccess)
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
}
else
ErrorMessage(STR_NOMULTISELECT);
@@ -790,14 +790,14 @@ sal_uInt8 ScViewFunc::GetSelectionScriptType()
{
sal_uInt8 nScript = 0;
- ScDocument* pDoc = GetViewData()->GetDocument();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
{
// no selection -> cursor
- nScript = pDoc->GetScriptType( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo());
+ nScript = pDoc->GetScriptType( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo());
}
else
{
@@ -817,8 +817,8 @@ const ScPatternAttr* ScViewFunc::GetSelectionPattern()
// Don't use UnmarkFiltered in slot state functions, for performance reasons.
// The displayed state is always that of the whole selection including filtered rows.
- const ScMarkData& rMark = GetViewData()->GetMarkData();
- ScDocument* pDoc = GetViewData()->GetDocument();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
// MarkToMulti is no longer necessary for pDoc->GetSelectionPattern
@@ -827,9 +827,9 @@ const ScPatternAttr* ScViewFunc::GetSelectionPattern()
}
else
{
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
ScMarkData aTempMark( rMark ); // copy sheet selection
aTempMark.SetMarkArea( ScRange( nCol, nRow, nTab ) );
@@ -841,8 +841,8 @@ const ScPatternAttr* ScViewFunc::GetSelectionPattern()
void ScViewFunc::GetSelectionFrame( SvxBoxItem& rLineOuter,
SvxBoxInfoItem& rLineInner )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
{
@@ -858,9 +858,9 @@ void ScViewFunc::GetSelectionFrame( SvxBoxItem& rLineOuter,
else
{
const ScPatternAttr* pAttrs =
- pDoc->GetPattern( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo() );
+ pDoc->GetPattern( GetViewData().GetCurX(),
+ GetViewData().GetCurY(),
+ GetViewData().GetTabNo() );
rLineOuter = (const SvxBoxItem&) (pAttrs->GetItem( ATTR_BORDER ));
rLineInner = (const SvxBoxInfoItem&)(pAttrs->GetItem( ATTR_BORDER_INNER ));
@@ -901,7 +901,7 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet,
if ( nNewFormat != nOldFormat )
{
SvNumberFormatter* pFormatter =
- GetViewData()->GetDocument()->GetFormatTable();
+ GetViewData().GetDocument()->GetFormatTable();
const SvNumberformat* pOldEntry = pFormatter->GetEntry( nOldFormat );
LanguageType eOldLang =
pOldEntry ? pOldEntry->GetLanguage() : LANGUAGE_DONTKNOW;
@@ -1000,7 +1000,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem )
return;
}
- ScPatternAttr aNewAttrs( new SfxItemSet( *GetViewData()->GetDocument()->GetPool(),
+ ScPatternAttr aNewAttrs( new SfxItemSet( *GetViewData().GetDocument()->GetPool(),
ATTR_PATTERN_START, ATTR_PATTERN_END ) );
aNewAttrs.GetItemSet().Put( rAttrItem );
@@ -1020,8 +1020,8 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem )
void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem* pNewOuter,
const SvxBoxInfoItem* pNewInner, bool bRecord )
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScMarkData aFuncMark( GetViewData()->GetMarkData() ); // local copy for UnmarkFiltered
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScMarkData aFuncMark( GetViewData().GetMarkData() ); // local copy for UnmarkFiltered
ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
if (bRecord && !pDoc->IsUndoEnabled())
bRecord = false;
@@ -1035,15 +1035,15 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem
aFuncMark.GetMarkArea( aMarkRange );
else
{
- aMarkRange = ScRange( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
+ aMarkRange = ScRange( GetViewData().GetCurX(),
+ GetViewData().GetCurY(), GetViewData().GetTabNo() );
DoneBlockMode();
InitOwnBlockMode();
aFuncMark.SetMarkArea(aMarkRange);
MarkDataChanged();
}
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
@@ -1082,7 +1082,7 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem
pDoc->ApplySelectionPattern( rAttr, aFuncMark );
pDocSh->PostPaint( aMarkRange, PAINT_GRID, nExt );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
aModificator.SetDocumentModified();
CellContentChanged();
@@ -1094,13 +1094,13 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem
void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr,
bool bRecord, bool bCursorOnly )
{
- ScViewData* pViewData = GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData aFuncMark( pViewData->GetMarkData() ); // local copy for UnmarkFiltered
- ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData aFuncMark( rViewData.GetMarkData() ); // local copy for UnmarkFiltered
+ ScViewUtil::UnmarkFiltered( aFuncMark, &rDoc );
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
// State from old ItemSet doesn't matter for paint flags, as any change will be
@@ -1125,9 +1125,9 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr,
bool bOnlyTab = (!aFuncMark.IsMultiMarked() && !bCursorOnly && aFuncMark.GetSelectCount() > 1);
if (bOnlyTab)
{
- SCCOL nCol = pViewData->GetCurX();
- SCROW nRow = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
+ SCCOL nCol = rViewData.GetCurX();
+ SCROW nRow = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
aFuncMark.SetMarkArea(ScRange(nCol,nRow,nTab));
aFuncMark.MarkToMulti();
}
@@ -1138,7 +1138,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr,
{
ScRange aMarkRange;
aFuncMark.GetMultiMarkArea( aMarkRange );
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
ScMarkData::iterator itr = aFuncMark.begin(), itrEnd = aFuncMark.end();
for (; itr != itrEnd; ++itr)
{
@@ -1164,12 +1164,12 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr,
aCopyRange.aEnd.SetTab(nTabCount-1);
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nStartTab, nStartTab );
+ pUndoDoc->InitUndo( &rDoc, nStartTab, nStartTab );
itr = aFuncMark.begin();
for (; itr != itrEnd; ++itr)
if (*itr != nStartTab)
pUndoDoc->AddUndoTab( *itr, *itr );
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, pUndoDoc, &aFuncMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, bMulti, pUndoDoc, &aFuncMark );
aFuncMark.MarkToMulti();
@@ -1180,37 +1180,37 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr,
pEditDataArray = pUndoAttr->GetDataArray();
}
- pDoc->ApplySelectionPattern( rAttr, aFuncMark, pEditDataArray );
+ rDoc.ApplySelectionPattern( rAttr, aFuncMark, pEditDataArray );
pDocSh->PostPaint( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab,
PAINT_GRID, nExtFlags | SC_PF_TESTMERGE );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
aModificator.SetDocumentModified();
CellContentChanged();
}
else // single cell - simpler undo
{
- SCCOL nCol = pViewData->GetCurX();
- SCROW nRow = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
+ SCCOL nCol = rViewData.GetCurX();
+ SCROW nRow = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
EditTextObject* pOldEditData = NULL;
EditTextObject* pNewEditData = NULL;
ScAddress aPos(nCol, nRow, nTab);
- if (pDoc->GetCellType(aPos) == CELLTYPE_EDIT)
+ if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT)
{
- pOldEditData = pDoc->GetEditText(aPos)->Clone();
- pDoc->RemoveEditTextCharAttribs(aPos, rAttr);
- pNewEditData = pDoc->GetEditText(aPos)->Clone();
+ pOldEditData = rDoc.GetEditText(aPos)->Clone();
+ rDoc.RemoveEditTextCharAttribs(aPos, rAttr);
+ pNewEditData = rDoc.GetEditText(aPos)->Clone();
}
aChangeRanges.Append(aPos);
- boost::scoped_ptr<ScPatternAttr> pOldPat(new ScPatternAttr(*pDoc->GetPattern( nCol, nRow, nTab )));
+ boost::scoped_ptr<ScPatternAttr> pOldPat(new ScPatternAttr(*rDoc.GetPattern( nCol, nRow, nTab )));
- pDoc->ApplyPattern( nCol, nRow, nTab, rAttr );
+ rDoc.ApplyPattern( nCol, nRow, nTab, rAttr );
- const ScPatternAttr* pNewPat = pDoc->GetPattern( nCol, nRow, nTab );
+ const ScPatternAttr* pNewPat = rDoc.GetPattern( nCol, nRow, nTab );
if (bRecord)
{
@@ -1222,7 +1222,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr,
pOldPat.reset(); // is copied in undo (Pool)
pDocSh->PostPaint( nCol,nRow,nTab, nCol,nRow,nTab, PAINT_GRID, nExtFlags | SC_PF_TESTMERGE );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
aModificator.SetDocumentModified();
CellContentChanged();
}
@@ -1272,7 +1272,7 @@ void ScViewFunc::ApplyUserItemSet( const SfxItemSet& rItemSet )
return;
}
- ScPatternAttr aNewAttrs( GetViewData()->GetDocument()->GetPool() );
+ ScPatternAttr aNewAttrs( GetViewData().GetDocument()->GetPool() );
SfxItemSet& rNewSet = aNewAttrs.GetItemSet();
rNewSet.Put( rItemSet, false );
ApplySelectionPattern( aNewAttrs );
@@ -1286,16 +1286,16 @@ const SfxStyleSheet* ScViewFunc::GetStyleSheetFromMarked()
// The displayed state is always that of the whole selection including filtered rows.
const ScStyleSheet* pSheet = NULL;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScMarkData& rMark = rViewData.GetMarkData();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
pSheet = pDoc->GetSelectionStyle( rMark ); // MarkToMulti isn't necessary
else
- pSheet = pDoc->GetStyle( pViewData->GetCurX(),
- pViewData->GetCurY(),
- pViewData->GetTabNo() );
+ pSheet = pDoc->GetStyle( rViewData.GetCurX(),
+ rViewData.GetCurY(),
+ rViewData.GetTabNo() );
return pSheet;
}
@@ -1313,13 +1313,13 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, bool bRecord
if ( !pStyleSheet) return;
- ScViewData* pViewData = GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData aFuncMark( pViewData->GetMarkData() ); // local copy for UnmarkFiltered
- ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
- SCTAB nTabCount = pDoc->GetTableCount();
- if (bRecord && !pDoc->IsUndoEnabled())
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData aFuncMark( rViewData.GetMarkData() ); // local copy for UnmarkFiltered
+ ScViewUtil::UnmarkFiltered( aFuncMark, &rDoc );
+ SCTAB nTabCount = rDoc.GetTableCount();
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScDocShellModificator aModificator( *pDocSh );
@@ -1332,9 +1332,9 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, bool bRecord
if ( bRecord )
{
- SCTAB nTab = pViewData->GetTabNo();
+ SCTAB nTab = rViewData.GetTabNo();
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
ScMarkData::iterator itr = aFuncMark.begin(), itrEnd = aFuncMark.end();
for (; itr != itrEnd; ++itr)
if (*itr != nTab)
@@ -1343,7 +1343,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, bool bRecord
ScRange aCopyRange = aMarkRange;
aCopyRange.aStart.SetTab(0);
aCopyRange.aEnd.SetTab(nTabCount-1);
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, true, pUndoDoc, &aFuncMark );
+ rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, true, pUndoDoc, &aFuncMark );
aFuncMark.MarkToMulti();
OUString aName = pStyleSheet->GetName();
@@ -1351,30 +1351,30 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, bool bRecord
new ScUndoSelectionStyle( pDocSh, aFuncMark, aMarkRange, aName, pUndoDoc ) );
}
- pDoc->ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, aFuncMark );
+ rDoc.ApplySelectionStyle( (ScStyleSheet&)*pStyleSheet, aFuncMark );
if (!AdjustBlockHeight())
- pViewData->GetDocShell()->PostPaint( aMarkRange, PAINT_GRID );
+ rViewData.GetDocShell()->PostPaint( aMarkRange, PAINT_GRID );
aFuncMark.MarkToSimple();
}
else
{
- SCCOL nCol = pViewData->GetCurX();
- SCROW nRow = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
+ SCCOL nCol = rViewData.GetCurX();
+ SCROW nRow = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
if ( bRecord )
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab );
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab );
ScMarkData::iterator itr = aFuncMark.begin(), itrEnd = aFuncMark.end();
for (; itr != itrEnd; ++itr)
if (*itr != nTab)
pUndoDoc->AddUndoTab( *itr, *itr );
ScRange aCopyRange( nCol, nRow, 0, nCol, nRow, nTabCount-1 );
- pDoc->CopyToDocument( aCopyRange, IDF_ATTRIB, false, pUndoDoc );
+ rDoc.CopyToDocument( aCopyRange, IDF_ATTRIB, false, pUndoDoc );
ScRange aMarkRange ( nCol, nRow, nTab );
ScMarkData aUndoMark = aFuncMark;
@@ -1387,10 +1387,10 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, bool bRecord
ScMarkData::iterator itr = aFuncMark.begin(), itrEnd = aFuncMark.end();
for (; itr != itrEnd; ++itr)
- pDoc->ApplyStyle( nCol, nRow, *itr, (ScStyleSheet&)*pStyleSheet );
+ rDoc.ApplyStyle( nCol, nRow, *itr, (ScStyleSheet&)*pStyleSheet );
if (!AdjustBlockHeight())
- pViewData->GetDocShell()->PostPaintCell( nCol, nRow, nTab );
+ rViewData.GetDocShell()->PostPaintCell( nCol, nRow, nTab );
}
@@ -1405,19 +1405,19 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
if ( !pStyleSheet) return;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
VirtualDevice aVirtDev;
aVirtDev.SetMapMode(MAP_PIXEL);
pDoc->StyleSheetChanged( pStyleSheet, true, &aVirtDev,
- pViewData->GetPPTX(),
- pViewData->GetPPTY(),
- pViewData->GetZoomX(),
- pViewData->GetZoomY() );
+ rViewData.GetPPTX(),
+ rViewData.GetPPTY(),
+ rViewData.GetZoomX(),
+ rViewData.GetZoomY() );
pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
aModificator.SetDocumentModified();
@@ -1432,19 +1432,19 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
if ( !pStyleSheet) return;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
- ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
VirtualDevice aVirtDev;
aVirtDev.SetMapMode(MAP_PIXEL);
pDoc->StyleSheetChanged( pStyleSheet, false, &aVirtDev,
- pViewData->GetPPTX(),
- pViewData->GetPPTY(),
- pViewData->GetZoomX(),
- pViewData->GetZoomY() );
+ rViewData.GetPPTX(),
+ rViewData.GetPPTY(),
+ rViewData.GetZoomX(),
+ rViewData.GetZoomY() );
pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
aModificator.SetDocumentModified();
@@ -1459,14 +1459,14 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
{
ScRange aRange;
- if (GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
bool bSuccess = pDocSh->GetDocFunc().InsertCells( aRange, &rMark, eCmd, bRecord, false, bPartOfPaste );
if (bSuccess)
{
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
CellContentChanged();
ResetAutoSpell();
@@ -1492,10 +1492,10 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
void ScViewFunc::DeleteCells( DelCellCmd eCmd, bool bRecord )
{
ScRange aRange;
- if ( GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
+ if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- const ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ const ScMarkData& rMark = GetViewData().GetMarkData();
#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
// #i94841# [Collaboration] if deleting rows is rejected, the content is sometimes wrong
@@ -1523,7 +1523,7 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd, bool bRecord )
pDocSh->GetDocFunc().DeleteCells( aRange, &rMark, eCmd, bRecord, false );
}
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
CellContentChanged();
ResetAutoSpell();
@@ -1536,8 +1536,8 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd, bool bRecord )
}
// put cursor directly behind deleted range
- SCCOL nCurX = GetViewData()->GetCurX();
- SCROW nCurY = GetViewData()->GetCurY();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
if ( eCmd==DEL_CELLSLEFT || eCmd==DEL_DELCOLS )
nCurX = aRange.aStart.Col();
else
@@ -1559,14 +1559,14 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd, bool bRecord )
void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
{
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocument* pDoc = pDocSh->GetDocument();
- ScMarkData aFuncMark( GetViewData()->GetMarkData() ); // local copy for UnmarkFiltered
- ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ ScMarkData aFuncMark( GetViewData().GetMarkData() ); // local copy for UnmarkFiltered
+ ScViewUtil::UnmarkFiltered( aFuncMark, &rDoc );
- if (!pDoc->IsUndoEnabled())
+ if (!rDoc.IsUndoEnabled())
bRecord = false;
std::vector<sc::ColRowSpan> aSpans;
@@ -1577,7 +1577,7 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
if (aSpans.empty())
{
- SCCOLROW nCurPos = bRows ? GetViewData()->GetCurY() : GetViewData()->GetCurX();
+ SCCOLROW nCurPos = bRows ? GetViewData().GetCurY() : GetViewData().GetCurX();
aSpans.push_back(sc::ColRowSpan(nCurPos, nCurPos));
}
@@ -1611,7 +1611,7 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
if (i == 0)
{
// test to the end of the sheet
- ScEditableTester aTester( pDoc, nTab, nStartCol, nStartRow, MAXCOL, MAXROW );
+ ScEditableTester aTester( &rDoc, nTab, nStartCol, nStartRow, MAXCOL, MAXROW );
if (!aTester.IsEditable())
nErrorId = aTester.GetMessageId();
}
@@ -1621,8 +1621,8 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
SCROW nMergeStartY = nStartRow;
SCCOL nMergeEndX = nEndCol;
SCROW nMergeEndY = nEndRow;
- pDoc->ExtendMerge( nMergeStartX, nMergeStartY, nMergeEndX, nMergeEndY, nTab );
- pDoc->ExtendOverlapped( nMergeStartX, nMergeStartY, nMergeEndX, nMergeEndY, nTab );
+ rDoc.ExtendMerge( nMergeStartX, nMergeStartY, nMergeEndX, nMergeEndY, nTab );
+ rDoc.ExtendOverlapped( nMergeStartX, nMergeStartY, nMergeEndX, nMergeEndY, nTab );
if ( nMergeStartX != nStartCol || nMergeStartY != nStartRow )
{
@@ -1654,28 +1654,28 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
if (bRecord)
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
- pUndoDoc->InitUndo( pDoc, nTab, nTab, !bRows, bRows ); // row height
+ pUndoDoc->InitUndo( &rDoc, nTab, nTab, !bRows, bRows ); // row height
for (size_t i = 0, n = aSpans.size(); i < n; ++i)
{
SCCOLROW nStart = aSpans[i].mnStart;
SCCOLROW nEnd = aSpans[i].mnEnd;
if (bRows)
- pDoc->CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, IDF_ALL,false,pUndoDoc );
+ rDoc.CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, IDF_ALL,false,pUndoDoc );
else
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart),0,nTab,
+ rDoc.CopyToDocument( static_cast<SCCOL>(nStart),0,nTab,
static_cast<SCCOL>(nEnd),MAXROW,nTab,
IDF_ALL,false,pUndoDoc );
}
// all Formulas because of references
- SCTAB nTabCount = pDoc->GetTableCount();
+ SCTAB nTabCount = rDoc.GetTableCount();
pUndoDoc->AddUndoTab( 0, nTabCount-1, false, false );
- pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA,false,pUndoDoc );
+ rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,MAXTAB, IDF_FORMULA,false,pUndoDoc );
- pUndoData = new ScRefUndoData( pDoc );
+ pUndoData = new ScRefUndoData( &rDoc );
- pDoc->BeginDrawUndo();
+ rDoc.BeginDrawUndo();
}
std::vector<sc::ColRowSpan>::const_reverse_iterator ri = aSpans.rbegin(), riEnd = aSpans.rend();
@@ -1685,9 +1685,9 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
SCCOLROW nStart = ri->mnStart;
if (bRows)
- pDoc->DeleteRow( 0,nTab, MAXCOL,nTab, nStart, static_cast<SCSIZE>(nEnd-nStart+1) );
+ rDoc.DeleteRow( 0,nTab, MAXCOL,nTab, nStart, static_cast<SCSIZE>(nEnd-nStart+1) );
else
- pDoc->DeleteCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
+ rDoc.DeleteCol( 0,nTab, MAXROW,nTab, static_cast<SCCOL>(nStart), static_cast<SCSIZE>(nEnd-nStart+1) );
}
if (bNeedRefresh)
@@ -1698,8 +1698,8 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
SCCOL nEndCol = MAXCOL;
SCROW nEndRow = MAXROW;
- pDoc->RemoveFlagsTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER );
- pDoc->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab, true );
+ rDoc.RemoveFlagsTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, SC_MF_HOR | SC_MF_VER );
+ rDoc.ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab, true );
}
if (bRecord)
@@ -1731,8 +1731,8 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
CellContentChanged();
// put cursor directly behind the first deleted range
- SCCOL nCurX = GetViewData()->GetCurX();
- SCROW nCurY = GetViewData()->GetCurY();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
if ( bRows )
nCurY = aSpans[0].mnStart;
else
@@ -1746,9 +1746,9 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
{
- ScViewData* pViewData = GetViewData();
- pViewData->SetPasteMode( SC_PASTE_NONE );
- pViewData->GetViewShell()->UpdateCopySourceOverlay();
+ ScViewData& rViewData = GetViewData();
+ rViewData.SetPasteMode( SC_PASTE_NONE );
+ rViewData.GetViewShell()->UpdateCopySourceOverlay();
// not editable because of matrix only? attribute OK nonetheless
bool bOnlyNotBecauseOfMatrix;
@@ -1766,9 +1766,9 @@ void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
ScRange aMarkRange;
bool bSimple = false;
- ScDocument* pDoc = GetViewData()->GetDocument();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScMarkData aFuncMark( GetViewData()->GetMarkData() ); // local copy for UnmarkFiltered
+ ScDocument* pDoc = GetViewData().GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScMarkData aFuncMark( GetViewData().GetMarkData() ); // local copy for UnmarkFiltered
ScViewUtil::UnmarkFiltered( aFuncMark, pDoc );
if (bRecord && !pDoc->IsUndoEnabled())
@@ -1778,9 +1778,9 @@ void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
if ( !aFuncMark.IsMarked() && !aFuncMark.IsMultiMarked() )
{
- aMarkRange.aStart.SetCol(GetViewData()->GetCurX());
- aMarkRange.aStart.SetRow(GetViewData()->GetCurY());
- aMarkRange.aStart.SetTab(GetViewData()->GetTabNo());
+ aMarkRange.aStart.SetCol(GetViewData().GetCurX());
+ aMarkRange.aStart.SetRow(GetViewData().GetCurY());
+ aMarkRange.aStart.SetTab(GetViewData().GetTabNo());
aMarkRange.aEnd = aMarkRange.aStart;
if ( pDoc->HasAttrib( aMarkRange, HASATTR_MERGED ) )
{
@@ -1919,7 +1919,7 @@ void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
if (!AdjustRowHeight( aExtendedRange.aStart.Row(), aExtendedRange.aEnd.Row() ))
pDocSh->PostPaint( aExtendedRange, PAINT_GRID, nExtFlags );
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
if (ScModelObj *pModelObj = HelperNotifyChanges::getMustPropagateChangesModel(*pDocSh))
{
@@ -1959,14 +1959,14 @@ void ScViewFunc::SetWidthOrHeight(
// use view's mark if none specified
if ( !pMarkData )
- pMarkData = &GetViewData()->GetMarkData();
+ pMarkData = &GetViewData().GetMarkData();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
SCTAB nFirstTab = pMarkData->GetFirstSelected();
- SCTAB nCurTab = GetViewData()->GetTabNo();
+ SCTAB nCurTab = GetViewData().GetTabNo();
SCTAB nTab;
- if (bRecord && !pDoc->IsUndoEnabled())
+ if (bRecord && !rDoc.IsUndoEnabled())
bRecord = false;
ScDocShellModificator aModificator( *pDocSh );
@@ -1980,13 +1980,13 @@ void ScViewFunc::SetWidthOrHeight(
bool bOnlyMatrix;
if (bWidth)
{
- bAllowed = pDoc->IsBlockEditable(
+ bAllowed = rDoc.IsBlockEditable(
*itr, rRanges[i].mnStart, 0, rRanges[i].mnEnd, MAXROW,
&bOnlyMatrix ) || bOnlyMatrix;
}
else
{
- bAllowed = pDoc->IsBlockEditable(
+ bAllowed = rDoc.IsBlockEditable(
*itr, 0, rRanges[i].mnStart, MAXCOL,rRanges[i].mnEnd, &bOnlyMatrix) || bOnlyMatrix;
}
}
@@ -2006,7 +2006,7 @@ void ScViewFunc::SetWidthOrHeight(
bool bFormula = false;
if ( eMode == SC_SIZE_OPTIMAL )
{
- const ScViewOptions& rOpts = GetViewData()->GetOptions();
+ const ScViewOptions& rOpts = GetViewData().GetOptions();
bFormula = rOpts.GetOption( VOPT_FORMULAS );
}
@@ -2016,7 +2016,7 @@ void ScViewFunc::SetWidthOrHeight(
if ( bRecord )
{
- pDoc->BeginDrawUndo(); // Drawing Updates
+ rDoc.BeginDrawUndo(); // Drawing Updates
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
itr = pMarkData->begin();
@@ -2025,27 +2025,27 @@ void ScViewFunc::SetWidthOrHeight(
if (bWidth)
{
if ( *itr == nFirstTab )
- pUndoDoc->InitUndo( pDoc, *itr, *itr, true, false );
+ pUndoDoc->InitUndo( &rDoc, *itr, *itr, true, false );
else
pUndoDoc->AddUndoTab( *itr, *itr, true, false );
- pDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, *itr,
+ rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, *itr,
static_cast<SCCOL>(nEnd), MAXROW, *itr, IDF_NONE,
false, pUndoDoc );
}
else
{
if ( *itr == nFirstTab )
- pUndoDoc->InitUndo( pDoc, *itr, *itr, false, true );
+ pUndoDoc->InitUndo( &rDoc, *itr, *itr, false, true );
else
pUndoDoc->AddUndoTab( *itr, *itr, false, true );
- pDoc->CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, IDF_NONE, false, pUndoDoc );
+ rDoc.CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, IDF_NONE, false, pUndoDoc );
}
}
aUndoRanges = rRanges;
//! outlines from all tab?
- ScOutlineTable* pTable = pDoc->GetOutlineTable( nCurTab );
+ ScOutlineTable* pTable = rDoc.GetOutlineTable( nCurTab );
if (pTable)
pUndoTab = new ScOutlineTable( *pTable );
}
@@ -2078,22 +2078,22 @@ void ScViewFunc::SetWidthOrHeight(
for (SCROW nRow = nStartNo; nRow <= nEndNo; ++nRow)
{
SCROW nLastRow = nRow;
- if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow))
+ if (rDoc.RowHidden(nRow, nTab, NULL, &nLastRow))
{
nRow = nLastRow;
continue;
}
- sal_uInt8 nOld = pDoc->GetRowFlags(nRow, nTab);
+ sal_uInt8 nOld = rDoc.GetRowFlags(nRow, nTab);
if (nOld & CR_MANUALSIZE)
- pDoc->SetRowFlags(nRow, nTab, nOld & ~CR_MANUALSIZE);
+ rDoc.SetRowFlags(nRow, nTab, nOld & ~CR_MANUALSIZE);
}
}
- double nPPTX = GetViewData()->GetPPTX();
- double nPPTY = GetViewData()->GetPPTY();
- Fraction aZoomX = GetViewData()->GetZoomX();
- Fraction aZoomY = GetViewData()->GetZoomY();
+ double nPPTX = GetViewData().GetPPTX();
+ double nPPTY = GetViewData().GetPPTY();
+ Fraction aZoomX = GetViewData().GetZoomX();
+ Fraction aZoomY = GetViewData().GetZoomY();
ScSizeDeviceProvider aProv(pDocSh);
if (aProv.IsPrinter())
@@ -2106,9 +2106,9 @@ void ScViewFunc::SetWidthOrHeight(
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, aProv.GetDevice());
aCxt.setForceAutoSize(bAll);
aCxt.setExtraHeight(nSizeTwips);
- pDoc->SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab);
+ rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab);
if (bAll)
- pDoc->ShowRows( nStartNo, nEndNo, nTab, true );
+ rDoc.ShowRows( nStartNo, nEndNo, nTab, true );
// Manual-Flag already (re)set in SetOptimalHeight in case of bAll=sal_True
// (set for Extra-Height, else reset).
@@ -2117,30 +2117,30 @@ void ScViewFunc::SetWidthOrHeight(
{
if (nSizeTwips)
{
- pDoc->SetRowHeightRange( nStartNo, nEndNo, nTab, nSizeTwips );
- pDoc->SetManualHeight( nStartNo, nEndNo, nTab, true ); // height was set manually
+ rDoc.SetRowHeightRange( nStartNo, nEndNo, nTab, nSizeTwips );
+ rDoc.SetManualHeight( nStartNo, nEndNo, nTab, true ); // height was set manually
}
- pDoc->ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
+ rDoc.ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
}
else if ( eMode==SC_SIZE_SHOW )
{
- pDoc->ShowRows( nStartNo, nEndNo, nTab, true );
+ rDoc.ShowRows( nStartNo, nEndNo, nTab, true );
}
}
else // column width
{
for (SCCOL nCol=static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
{
- if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab) )
+ if ( eMode != SC_SIZE_VISOPT || !rDoc.ColHidden(nCol, nTab) )
{
sal_uInt16 nThisSize = nSizeTwips;
if ( eMode==SC_SIZE_OPTIMAL || eMode==SC_SIZE_VISOPT )
nThisSize = nSizeTwips + GetOptimalColWidth( nCol, nTab, bFormula );
if ( nThisSize )
- pDoc->SetColWidth( nCol, nTab, nThisSize );
+ rDoc.SetColWidth( nCol, nTab, nThisSize );
- pDoc->ShowCol( nCol, nTab, bShow );
+ rDoc.ShowCol( nCol, nTab, bShow );
}
}
}
@@ -2149,17 +2149,17 @@ void ScViewFunc::SetWidthOrHeight(
if (bWidth)
{
- if ( pDoc->UpdateOutlineCol( static_cast<SCCOL>(nStartNo),
+ if ( rDoc.UpdateOutlineCol( static_cast<SCCOL>(nStartNo),
static_cast<SCCOL>(nEndNo), nTab, bShow ) )
bOutline = true;
}
else
{
- if ( pDoc->UpdateOutlineRow( nStartNo, nEndNo, nTab, bShow ) )
+ if ( rDoc.UpdateOutlineRow( nStartNo, nEndNo, nTab, bShow ) )
bOutline = true;
}
}
- pDoc->SetDrawPageSize(nTab);
+ rDoc.SetDrawPageSize(nTab);
}
@@ -2176,13 +2176,13 @@ void ScViewFunc::SetWidthOrHeight(
// fdo#36247 Ensure that the drawing layer's map mode scaling factors match
// the new heights and widths.
- GetViewData()->GetView()->RefreshZoom();
+ GetViewData().GetView()->RefreshZoom();
itr = pMarkData->begin();
for (; itr != itrEnd; ++itr)
- pDoc->UpdatePageBreaks( *itr );
+ rDoc.UpdatePageBreaks( *itr );
- GetViewData()->GetView()->UpdateScrollBars();
+ GetViewData().GetView()->UpdateScrollBars();
if (bPaint)
{
@@ -2192,7 +2192,7 @@ void ScViewFunc::SetWidthOrHeight(
nTab = *itr;
if (bWidth)
{
- if (pDoc->HasAttrib( static_cast<SCCOL>(nStart),0,nTab,
+ if (rDoc.HasAttrib( static_cast<SCCOL>(nStart),0,nTab,
static_cast<SCCOL>(nEnd),MAXROW,nTab,
HASATTR_MERGED | HASATTR_OVERLAPPED ))
nStart = 0;
@@ -2203,7 +2203,7 @@ void ScViewFunc::SetWidthOrHeight(
}
else
{
- if (pDoc->HasAttrib( 0,nStart,nTab, MAXCOL,nEnd,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ))
+ if (rDoc.HasAttrib( 0,nStart,nTab, MAXCOL,nEnd,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ))
nStart = 0;
if (nStart != 0)
--nStart;
@@ -2211,7 +2211,7 @@ void ScViewFunc::SetWidthOrHeight(
}
}
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
if( !pDocSh->IsReadOnly() )
aModificator.SetDocumentModified();
}
@@ -2245,14 +2245,14 @@ void ScViewFunc::SetWidthOrHeight(
void ScViewFunc::SetMarkedWidthOrHeight( bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips,
bool bRecord, bool bPaint )
{
- ScMarkData& rMark = GetViewData()->GetMarkData();
+ ScMarkData& rMark = GetViewData().GetMarkData();
rMark.MarkToMulti();
if (!rMark.IsMultiMarked())
{
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
DoneBlockMode();
InitOwnBlockMode();
rMark.SetMultiMarkArea( ScRange( nCol,nRow,nTab ), true );
@@ -2276,17 +2276,17 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
ScModule* pScMod = SC_MOD();
bool bAnyEdit = pScMod->IsInputMode();
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
bool bAllowed, bOnlyMatrix;
if ( eDir == DIR_LEFT || eDir == DIR_RIGHT )
- bAllowed = pDoc->IsBlockEditable( nTab, nCol,0, nCol,MAXROW, &bOnlyMatrix );
+ bAllowed = rDoc.IsBlockEditable( nTab, nCol,0, nCol,MAXROW, &bOnlyMatrix );
else
- bAllowed = pDoc->IsBlockEditable( nTab, 0,nRow, MAXCOL,nRow, &bOnlyMatrix );
+ bAllowed = rDoc.IsBlockEditable( nTab, 0,nRow, MAXCOL,nRow, &bOnlyMatrix );
if ( !bAllowed && !bOnlyMatrix )
{
ErrorMessage(STR_PROTECTIONERR);
@@ -2295,8 +2295,8 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
HideAllCursors();
- sal_uInt16 nWidth = pDoc->GetColWidth( nCol, nTab );
- sal_uInt16 nHeight = pDoc->GetRowHeight( nRow, nTab );
+ sal_uInt16 nWidth = rDoc.GetColWidth( nCol, nTab );
+ sal_uInt16 nHeight = rDoc.GetRowHeight( nRow, nTab );
std::vector<sc::ColRowSpan> aRange(1, sc::ColRowSpan(0,0));
if ( eDir == DIR_LEFT || eDir == DIR_RIGHT )
{
@@ -2305,12 +2305,12 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
if ( bAnyEdit )
{
// when editing the actual entered width
- ScInputHandler* pHdl = pScMod->GetInputHdl( GetViewData()->GetViewShell() );
+ ScInputHandler* pHdl = pScMod->GetInputHdl( GetViewData().GetViewShell() );
if (pHdl)
{
long nEdit = pHdl->GetTextSize().Width(); // in 0.01 mm
- const ScPatternAttr* pPattern = pDoc->GetPattern( nCol, nRow, nTab );
+ const ScPatternAttr* pPattern = rDoc.GetPattern( nCol, nRow, nTab );
const SvxMarginItem& rMItem =
(const SvxMarginItem&)pPattern->GetItem(ATTR_MARGIN);
sal_uInt16 nMargin = rMItem.GetLeftMargin() + rMItem.GetRightMargin();
@@ -2325,10 +2325,10 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
}
else
{
- double nPPTX = GetViewData()->GetPPTX();
- double nPPTY = GetViewData()->GetPPTY();
- Fraction aZoomX = GetViewData()->GetZoomX();
- Fraction aZoomY = GetViewData()->GetZoomY();
+ double nPPTX = GetViewData().GetPPTX();
+ double nPPTY = GetViewData().GetPPTY();
+ Fraction aZoomX = GetViewData().GetZoomX();
+ Fraction aZoomY = GetViewData().GetZoomY();
ScSizeDeviceProvider aProv(pDocSh);
if (aProv.IsPrinter())
@@ -2338,7 +2338,7 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
aZoomX = aZoomY = Fraction( 1, 1 );
}
- long nPixel = pDoc->GetNeededSize( nCol, nRow, nTab, aProv.GetDevice(),
+ long nPixel = rDoc.GetNeededSize( nCol, nRow, nTab, aProv.GetDevice(),
nPPTX, nPPTY, aZoomX, aZoomY, true );
sal_uInt16 nTwips = (sal_uInt16)( nPixel / nPPTX );
if (nTwips != 0)
@@ -2364,7 +2364,7 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
if (!bAnyEdit)
{
- const ScPatternAttr* pPattern = pDoc->GetPattern( nCol, nRow, nTab );
+ const ScPatternAttr* pPattern = rDoc.GetPattern( nCol, nRow, nTab );
bool bNeedHeight =
((const SfxBoolItem&)pPattern->GetItem( ATTR_LINEBREAK )).GetValue() ||
((const SvxHorJustifyItem&)pPattern->
@@ -2399,9 +2399,9 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal )
if ( bAnyEdit )
{
UpdateEditView();
- if ( pDoc->HasAttrib( nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_NEEDHEIGHT ) )
+ if ( rDoc.HasAttrib( nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_NEEDHEIGHT ) )
{
- ScInputHandler* pHdl = pScMod->GetInputHdl( GetViewData()->GetViewShell() );
+ ScInputHandler* pHdl = pScMod->GetInputHdl( GetViewData().GetViewShell() );
if (pHdl)
pHdl->SetModified(); // so that the height is adjusted with Enter
}
@@ -2415,11 +2415,11 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
if (nTab == TABLEID_DOC)
return;
- ScMarkData& rMark = GetViewData()->GetMarkData();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScDocFunc &rFunc = pDocSh->GetDocFunc();
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
// modifying several tabs is handled here
@@ -2441,11 +2441,11 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
void ScViewFunc::Protect( SCTAB nTab, const OUString& rPassword )
{
- ScMarkData& rMark = GetViewData()->GetMarkData();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScDocFunc &rFunc = pDocSh->GetDocFunc();
- bool bUndo(pDoc->IsUndoEnabled());
+ bool bUndo(rDoc.IsUndoEnabled());
if ( nTab == TABLEID_DOC || rMark.GetSelectCount() <= 1 )
rFunc.Protect( nTab, rPassword, false );
@@ -2472,12 +2472,12 @@ void ScViewFunc::Protect( SCTAB nTab, const OUString& rPassword )
bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword )
{
- ScMarkData& rMark = GetViewData()->GetMarkData();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
+ ScMarkData& rMark = GetViewData().GetMarkData();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
ScDocFunc &rFunc = pDocSh->GetDocFunc();
bool bChanged = false;
- bool bUndo (pDoc->IsUndoEnabled());
+ bool bUndo (rDoc.IsUndoEnabled());
if ( nTab == TABLEID_DOC || rMark.GetSelectCount() <= 1 )
bChanged = rFunc.Unprotect( nTab, rPassword, false );
@@ -2508,12 +2508,12 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword )
void ScViewFunc::SetNoteText( const ScAddress& rPos, const OUString& rNoteText )
{
- GetViewData()->GetDocShell()->GetDocFunc().SetNoteText( rPos, rNoteText, false );
+ GetViewData().GetDocShell()->GetDocFunc().SetNoteText( rPos, rNoteText, false );
}
void ScViewFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, const OUString* pAuthor, const OUString* pDate )
{
- GetViewData()->GetDocShell()->GetDocFunc().ReplaceNote( rPos, rNoteText, pAuthor, pDate, false );
+ GetViewData().GetDocShell()->GetDocFunc().ReplaceNote( rPos, rNoteText, pAuthor, pDate, false );
}
void ScViewFunc::SetNumberFormat( short nFormatType, sal_uLong nAdd )
@@ -2527,8 +2527,8 @@ void ScViewFunc::SetNumberFormat( short nFormatType, sal_uLong nAdd )
}
sal_uInt32 nNumberFormat = 0;
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable();
LanguageType eLanguage = ScGlobal::eLnge;
ScPatternAttr aNewAttrs( pDoc->GetPool() );
@@ -2536,9 +2536,9 @@ void ScViewFunc::SetNumberFormat( short nFormatType, sal_uLong nAdd )
// always take language from cursor position, even if there is a selection
sal_uInt32 nCurrentNumberFormat;
- pDoc->GetNumberFormat( pViewData->GetCurX(),
- pViewData->GetCurY(),
- pViewData->GetTabNo(),
+ pDoc->GetNumberFormat( rViewData.GetCurX(),
+ rViewData.GetCurY(),
+ rViewData.GetTabNo(),
nCurrentNumberFormat );
const SvNumberformat* pEntry = pNumberFormatter->GetEntry( nCurrentNumberFormat );
if (pEntry)
@@ -2562,15 +2562,15 @@ void ScViewFunc::SetNumFmtByStr( const OUString& rCode )
return;
}
- ScViewData* pViewData = GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
+ ScViewData& rViewData = GetViewData();
+ ScDocument* pDoc = rViewData.GetDocument();
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
// language always from cursor position
sal_uInt32 nCurrentNumberFormat;
- pDoc->GetNumberFormat( pViewData->GetCurX(), pViewData->GetCurY(),
- pViewData->GetTabNo(), nCurrentNumberFormat );
+ pDoc->GetNumberFormat( rViewData.GetCurX(), rViewData.GetCurY(),
+ rViewData.GetTabNo(), nCurrentNumberFormat );
const SvNumberformat* pEntry = pFormatter->GetEntry( nCurrentNumberFormat );
LanguageType eLanguage = pEntry ? pEntry->GetLanguage() : ScGlobal::eLnge;
@@ -2610,12 +2610,12 @@ void ScViewFunc::ChangeNumFmtDecimals( bool bIncrement )
return;
}
- ScDocument* pDoc = GetViewData()->GetDocument();
+ ScDocument* pDoc = GetViewData().GetDocument();
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
- SCCOL nCol = GetViewData()->GetCurX();
- SCROW nRow = GetViewData()->GetCurY();
- SCTAB nTab = GetViewData()->GetTabNo();
+ SCCOL nCol = GetViewData().GetCurX();
+ SCROW nRow = GetViewData().GetCurY();
+ SCTAB nTab = GetViewData().GetTabNo();
sal_uInt32 nOldFormat;
pDoc->GetNumberFormat( nCol, nRow, nTab, nOldFormat );
@@ -2721,29 +2721,29 @@ void ScViewFunc::ChangeNumFmtDecimals( bool bIncrement )
void ScViewFunc::ChangeIndent( bool bIncrement )
{
- ScViewData* pViewData = GetViewData();
- ScDocShell* pDocSh = pViewData->GetDocShell();
- ScMarkData& rMark = pViewData->GetMarkData();
+ ScViewData& rViewData = GetViewData();
+ ScDocShell* pDocSh = rViewData.GetDocShell();
+ ScMarkData& rMark = rViewData.GetMarkData();
ScMarkData aWorkMark = rMark;
- ScViewUtil::UnmarkFiltered( aWorkMark, pDocSh->GetDocument() );
+ ScViewUtil::UnmarkFiltered( aWorkMark, &pDocSh->GetDocument() );
aWorkMark.MarkToMulti();
if (!aWorkMark.IsMultiMarked())
{
- SCCOL nCol = pViewData->GetCurX();
- SCROW nRow = pViewData->GetCurY();
- SCTAB nTab = pViewData->GetTabNo();
+ SCCOL nCol = rViewData.GetCurX();
+ SCROW nRow = rViewData.GetCurY();
+ SCTAB nTab = rViewData.GetTabNo();
aWorkMark.SetMultiMarkArea( ScRange(nCol,nRow,nTab) );
}
bool bSuccess = pDocSh->GetDocFunc().ChangeIndent( aWorkMark, bIncrement, false );
if (bSuccess)
{
- pDocSh->UpdateOle(pViewData);
+ pDocSh->UpdateOle(&rViewData);
StartFormatArea();
// stuff for sidebar panels
- SfxBindings& rBindings = GetViewData()->GetBindings();
+ SfxBindings& rBindings = GetViewData().GetBindings();
rBindings.Invalidate( SID_H_ALIGNCELL );
rBindings.Invalidate( SID_ATTR_ALIGN_INDENT );
}
@@ -2756,14 +2756,14 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol,
//! undo...
bool bOk = false;
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
- ScRangeName* pList = pDoc->GetRangeName();
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
+ ScRangeName* pList = rDoc.GetRangeName();
RangeType nType = RT_NAME;
- ScRangeData* pNewEntry = new ScRangeData( pDoc, rName, rSymbol,
- ScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(),
+ ScRangeData* pNewEntry = new ScRangeData( &rDoc, rName, rSymbol,
+ ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(),
nTab), nType );
OUString aUpType = rType.toAsciiUpperCase();
if ( aUpType.indexOf( 'P' ) != -1 )
@@ -2780,7 +2780,7 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol,
{
ScDocShellModificator aModificator( *pDocSh );
- pDoc->PreprocessRangeNameUpdate();
+ rDoc.PreprocessRangeNameUpdate();
// input available yet? Then remove beforehand (=change)
ScRangeData* pData = pList->findByUpperName(ScGlobal::pCharClass->uppercase(rName));
@@ -2794,7 +2794,7 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol,
bOk = true;
pNewEntry = NULL; // never delete, insert took ownership
- pDoc->PostprocessRangeNameUpdate();
+ rDoc.PostprocessRangeNameUpdate();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
@@ -2808,8 +2808,8 @@ void ScViewFunc::CreateNames( sal_uInt16 nFlags )
{
bool bDone = false;
ScRange aRange;
- if ( GetViewData()->GetSimpleArea(aRange) == SC_MARK_SIMPLE )
- bDone = GetViewData()->GetDocShell()->GetDocFunc().CreateNames( aRange, nFlags, false );
+ if ( GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE )
+ bDone = GetViewData().GetDocShell()->GetDocFunc().CreateNames( aRange, nFlags, false );
if (!bDone)
ErrorMessage(STR_CREATENAME_MARKERR);
@@ -2822,10 +2822,10 @@ sal_uInt16 ScViewFunc::GetCreateNameFlags()
SCCOL nStartCol, nEndCol;
SCROW nStartRow, nEndRow;
SCTAB nDummy;
- if (GetViewData()->GetSimpleArea(nStartCol,nStartRow,nDummy,nEndCol,nEndRow,nDummy) == SC_MARK_SIMPLE)
+ if (GetViewData().GetSimpleArea(nStartCol,nStartRow,nDummy,nEndCol,nEndRow,nDummy) == SC_MARK_SIMPLE)
{
- ScDocument* pDoc = GetViewData()->GetDocument();
- SCTAB nTab = GetViewData()->GetTabNo();
+ ScDocument* pDoc = GetViewData().GetDocument();
+ SCTAB nTab = GetViewData().GetTabNo();
bool bOk;
SCCOL i;
SCROW j;
@@ -2879,15 +2879,15 @@ sal_uInt16 ScViewFunc::GetCreateNameFlags()
void ScViewFunc::InsertNameList()
{
- ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScAddress aPos( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() );
+ ScDocShell* pDocSh = GetViewData().GetDocShell();
if ( pDocSh->GetDocFunc().InsertNameList( aPos, false ) )
- pDocSh->UpdateOle(GetViewData());
+ pDocSh->UpdateOle(&GetViewData());
}
void ScViewFunc::UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr )
{
- ScDocShell* pDocShell = GetViewData()->GetDocShell();
+ ScDocShell* pDocShell = GetViewData().GetDocShell();
ScRange aMarkRange;
if (rSel.IsMultiMarked() )
rSel.GetMultiMarkArea( aMarkRange );
@@ -2919,7 +2919,7 @@ void ScViewFunc::UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAt
pDocShell->PostPaint( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab,
PAINT_GRID, nExtFlags | SC_PF_TESTMERGE );
- ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
+ ScTabViewShell* pTabViewShell = GetViewData().GetViewShell();
pTabViewShell->CellContentChanged();
pTabViewShell->AdjustBlockHeight(false, const_cast<ScMarkData*>(&rSel));
}
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 0dba41cc3d5b..374cb96a1fd9 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -860,7 +860,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
sValue += OUString::number((sal_Int16)((sal_uInt16)((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1)) ;
sName = ";total-pages:";
sValue += sName;
- sValue += OUString::number(pDrViewSh->GetPageTabControl()->GetPageCount()) ;
+ sValue += OUString::number(pDrViewSh->GetPageTabControl().GetPageCount()) ;
sValue += ";";
if(pDrViewSh->IsLayerModeActive() && pDrViewSh->GetLayerTabControl()) // #i87182#
{
diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
index dddaeec8a3dc..1ee2d591bc55 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
@@ -79,14 +79,14 @@ AccessibleOutlineView::AccessibleOutlineView (
{
OutlinerView* pOutlineView = static_cast< ::sd::OutlineView*>(
pView)->GetViewByWindow( pSdWindow );
- SdrOutliner* pOutliner =
+ SdrOutliner& rOutliner =
static_cast< ::sd::OutlineView*>(pView)->GetOutliner();
- if( pOutlineView && pOutliner )
+ if( pOutlineView )
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
maTextHelper.SetEditSource( ::std::auto_ptr< SvxEditSource >( new AccessibleOutlineEditSource(
- *pOutliner, *pView, *pOutlineView, *pSdWindow ) ) );
+ rOutliner, *pView, *pOutlineView, *pSdWindow ) ) );
SAL_WNODEPRECATED_DECLARATIONS_POP
}
}
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index b26d86a26e69..407132f4a369 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -91,17 +91,17 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
if( pViewSh && pViewSh->ISA(sd::OutlineViewShell))
pSdView = static_cast<sd::OutlineView*> (static_cast<sd::OutlineViewShell*>(pViewSh)->GetView());
- if (pSdView != NULL && (pOutliner == pSdView->GetOutliner()))
+ if (pSdView != NULL && (pOutliner == &pSdView->GetOutliner()))
{
// outline mode
int nPgNum = 0;
- Outliner* pOutl = pSdView->GetOutliner();
+ Outliner& rOutl = pSdView->GetOutliner();
long nPos = pInfo->GetPara();
sal_Int32 nParaPos = 0;
- for( Paragraph* pPara = pOutl->GetParagraph( 0 ); pPara && nPos >= 0; pPara = pOutl->GetParagraph( ++nParaPos ), nPos-- )
+ for( Paragraph* pPara = rOutl.GetParagraph( 0 ); pPara && nPos >= 0; pPara = rOutl.GetParagraph( ++nParaPos ), nPos-- )
{
- if( pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
+ if( rOutl.HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
nPgNum++;
}
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index e5c5273b0ce2..e5892ae95e8b 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -622,7 +622,7 @@ bool DrawDocShell::SaveCompleted( const ::com::sun::star::uno::Reference< ::com:
{
if( mpViewShell->ISA( OutlineViewShell ) )
static_cast<OutlineView*>(mpViewShell->GetView())
- ->GetOutliner()->ClearModifyFlag();
+ ->GetOutliner().ClearModifyFlag();
SdrOutliner* pOutl = mpViewShell->GetView()->GetTextEditOutliner();
if( pOutl )
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 75665fa8763d..bb8d48f9e181 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -456,9 +456,7 @@ void DrawDocShell::ClearUndoBuffer()
sd::OutlineView* pOutlView = dynamic_cast< sd::OutlineView* >( pView );
if( pOutlView )
{
- SdrOutliner* pOutliner = pOutlView->GetOutliner();
- if( pOutliner )
- pOutliner->GetUndoManager().Clear();
+ pOutlView->GetOutliner().GetUndoManager().Clear();
}
}
}
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index d2359f9952f1..54c4f87a4e45 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -112,7 +112,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
}
else if (mpViewShell->ISA(OutlineViewShell))
{
- pOL = static_cast<OutlineView*>(mpView)->GetOutliner();
+ pOL = &static_cast<OutlineView*>(mpView)->GetOutliner();
pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
mpViewShell->GetActiveWindow());
}
@@ -234,7 +234,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
}
else if(mpViewShell && mpViewShell->ISA(OutlineViewShell))
{
- pOL = static_cast<OutlineView*>(mpView)->GetOutliner();
+ pOL = &static_cast<OutlineView*>(mpView)->GetOutliner();
pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
mpViewShell->GetActiveWindow());
}
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 6ba1ebeffd5e..7074a9a5f596 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -559,28 +559,28 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
else if( aFilterName.indexOf( "HTML" ) != -1 )
nFormat = EE_FORMAT_HTML;
- ::Outliner* pDocliner = static_cast<OutlineView*>(mpView)->GetOutliner();
+ ::Outliner& rDocliner = static_cast<OutlineView*>(mpView)->GetOutliner();
std::vector<Paragraph*> aSelList;
- pDocliner->GetView(0)->CreateSelectionList(aSelList);
+ rDocliner.GetView(0)->CreateSelectionList(aSelList);
Paragraph* pPara = aSelList.empty() ? NULL : *(aSelList.begin());
// what should we insert?
- while (pPara && !pDocliner->HasParaFlag(pPara, PARAFLAG_ISPAGE))
- pPara = pDocliner->GetParent(pPara);
+ while (pPara && !rDocliner.HasParaFlag(pPara, PARAFLAG_ISPAGE))
+ pPara = rDocliner.GetParent(pPara);
- sal_Int32 nTargetPos = pDocliner->GetAbsPos(pPara) + 1;
+ sal_Int32 nTargetPos = rDocliner.GetAbsPos(pPara) + 1;
// apply layout of predecessor page
sal_uInt16 nPage = 0;
- pPara = pDocliner->GetParagraph( pDocliner->GetAbsPos( pPara ) - 1 );
+ pPara = rDocliner.GetParagraph( rDocliner.GetAbsPos( pPara ) - 1 );
while (pPara)
{
- sal_Int32 nPos = pDocliner->GetAbsPos( pPara );
- if ( pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
+ sal_Int32 nPos = rDocliner.GetAbsPos( pPara );
+ if ( rDocliner.HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
nPage++;
- pPara = pDocliner->GetParagraph( nPos - 1 );
+ pPara = rDocliner.GetParagraph( nPos - 1 );
}
SdPage* pPage = mpDoc->GetSdPage(nPage, PK_STANDARD);
aLayoutName = pPage->GetLayoutName();
@@ -636,7 +636,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
nNewPages = 0;
- pDocliner->GetUndoManager().EnterListAction(
+ rDocliner.GetUndoManager().EnterListAction(
SD_RESSTR(STR_UNDO_INSERT_FILE), OUString() );
sal_Int32 nSourcePos = 0;
@@ -651,16 +651,16 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if (nSourcePos < nParaCount - 1 ||
!pOutliner->GetText(pSourcePara).isEmpty())
{
- pDocliner->Insert( pOutliner->GetText(pSourcePara), nTargetPos, nDepth );
+ rDocliner.Insert( pOutliner->GetText(pSourcePara), nTargetPos, nDepth );
OUString aStyleSheetName( pStyleSheet->GetName() );
aStyleSheetName = aStyleSheetName.copy( 0, aStyleSheetName.getLength()-1 );
aStyleSheetName += OUString::number( nDepth <= 0 ? 1 : nDepth+1 );
SfxStyleSheetBasePool* pStylePool = mpDoc->GetStyleSheetPool();
SfxStyleSheet* pOutlStyle = (SfxStyleSheet*) pStylePool->Find( aStyleSheetName, pStyleSheet->GetFamily() );
- pDocliner->SetStyleSheet( nTargetPos, pOutlStyle );
+ rDocliner.SetStyleSheet( nTargetPos, pOutlStyle );
}
- if( pDocliner->HasParaFlag( pSourcePara, PARAFLAG_ISPAGE ) )
+ if( rDocliner.HasParaFlag( pSourcePara, PARAFLAG_ISPAGE ) )
{
nNewPages++;
if( pProgress )
@@ -672,7 +672,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
nSourcePos++;
}
- pDocliner->GetUndoManager().LeaveListAction();
+ rDocliner.GetUndoManager().LeaveListAction();
pProgress.reset();
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 9d642e5949a7..11412a25e3c3 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -455,14 +455,14 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// Switch the page and send events regarding
// deactivation the old page and activating the new
// one.
- TabControl* pPageTabControl =
+ TabControl& rPageTabControl =
static_cast<DrawViewShell*>(mpViewShell)
->GetPageTabControl();
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendDeactivatePageEvent ();
+ if (rPageTabControl.IsReallyShown())
+ rPageTabControl.SendDeactivatePageEvent ();
static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage - 1);
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendActivatePageEvent ();
+ if (rPageTabControl.IsReallyShown())
+ rPageTabControl.SendActivatePageEvent ();
}
}
else if (rKEvt.GetKeyCode().IsMod1())
@@ -501,13 +501,13 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// Switch the page and send events regarding
// deactivation the old page and activating the new
// one.
- TabControl* pPageTabControl =
+ TabControl& rPageTabControl =
static_cast<DrawViewShell*>(mpViewShell)->GetPageTabControl();
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendDeactivatePageEvent ();
+ if (rPageTabControl.IsReallyShown())
+ rPageTabControl.SendDeactivatePageEvent ();
static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage + 1);
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendActivatePageEvent ();
+ if (rPageTabControl.IsReallyShown())
+ rPageTabControl.SendActivatePageEvent ();
}
}
else if (rKEvt.GetKeyCode().IsMod1())
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index bf7462554f1f..c550e808234f 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -347,7 +347,7 @@ public:
/** Return a pointer to the tab control for pages.
*/
- TabControl* GetPageTabControl (void) { return &maTabControl;}
+ TabControl& GetPageTabControl (void) { return maTabControl;}
/** Return a pointer to the tab control for layers.
*/
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index df312e82b1e8..21b29542e7ec 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -80,8 +80,8 @@ public:
virtual void AddWindowToPaintView(OutputDevice* pWin) SAL_OVERRIDE;
virtual void DeleteWindowFromPaintView(OutputDevice* pWin) SAL_OVERRIDE;
- OutlinerView* GetViewByWindow (::Window* pWin) const;
- SdrOutliner* GetOutliner() { return(&mrOutliner) ; }
+ OutlinerView* GetViewByWindow(::Window* pWin) const;
+ SdrOutliner& GetOutliner() { return mrOutliner; }
Paragraph* GetPrevTitle(const Paragraph* pPara);
Paragraph* GetNextTitle(const Paragraph* pPara);
diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
index e7a14b8ee2f5..6e5c3bb196e8 100644
--- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
@@ -208,7 +208,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri
{
sal_uInt16 nPageNumber = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
pDrawViewShell->SwitchPage(nPageNumber);
- pDrawViewShell->GetPageTabControl()->SetCurPageId(nPageNumber+1);
+ pDrawViewShell->GetPageTabControl().SetCurPageId(nPageNumber+1);
}
}
}
@@ -228,7 +228,7 @@ void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescripto
if (pDrawViewShell)
{
sal_uInt16 nPageNumber = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
- pDrawViewShell->GetPageTabControl()->SetCurPageId(nPageNumber+1);
+ pDrawViewShell->GetPageTabControl().SetCurPageId(nPageNumber+1);
}
}
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index c7dc1d787f1e..048d6fe1416e 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2856,7 +2856,7 @@ void SdMasterPage::setBackground( const Any& rValue )
Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_QUERY_THROW );
Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY );
- PropertyEntryVector_t aBackgroundProperties = ImplGetPageBackgroundPropertySet()->getPropertyMap()->getPropertyEntries();
+ PropertyEntryVector_t aBackgroundProperties = ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aBackgroundProperties.begin();
while( aIt != aBackgroundProperties.end() )
{
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index 399d363f2c33..2c24a0fe3624 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -110,7 +110,7 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
if( mpPropSet->AreThereOwnUsrAnys() )
{
uno::Any* pAny;
- PropertyEntryVector_t aProperties = mpPropSet->getPropertyMap()->getPropertyEntries();
+ PropertyEntryVector_t aProperties = mpPropSet->getPropertyMap().getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aProperties.begin();
while( aIt != aProperties.end() )
@@ -445,7 +445,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp
/** this is used because our property map is not sorted yet */
const SfxItemPropertySimpleEntry* SdUnoPageBackground::getPropertyMapEntry( const OUString& rPropertyName ) const throw()
{
- return mpPropSet->getPropertyMap()->getByName(rPropertyName);
+ return mpPropSet->getPropertyMap().getByName(rPropertyName);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 35626c02c57b..2e7fb1938e1d 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -99,7 +99,7 @@ TextObjectBar::TextObjectBar (
OutlineView* pOutlinerView = dynamic_cast< OutlineView* >( mpView );
if( pOutlinerView )
{
- SetUndoManager(&pOutlinerView->GetOutliner()->GetUndoManager());
+ SetUndoManager(&pOutlinerView->GetOutliner().GetUndoManager());
}
else
{
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 0f3812b72c1c..976d8a6a26ba 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -223,8 +223,8 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
case SID_SELECTALL:
{
- ::Outliner* pOutl = pOlView->GetOutliner();
- sal_Int32 nParaCount = pOutl->GetParagraphCount();
+ ::Outliner& rOutl = pOlView->GetOutliner();
+ sal_Int32 nParaCount = rOutl.GetParagraphCount();
if (nParaCount > 0)
{
pOutlinerView->SelectRange( 0, nParaCount );
@@ -445,7 +445,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
{
pOlView->SetSelectedPages();
SetCurrentFunction( FuSummaryPage::Create( this, GetActiveWindow(), pOlView, GetDoc(), rReq ) );
- pOlView->GetOutliner()->Clear();
+ pOlView->GetOutliner().Clear();
pOlView->FillOutliner();
pOlView->GetActualPage();
Cancel();
@@ -456,7 +456,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
{
pOlView->SetSelectedPages();
SetCurrentFunction( FuExpandPage::Create( this, GetActiveWindow(), pOlView, GetDoc(), rReq ) );
- pOlView->GetOutliner()->Clear();
+ pOlView->GetOutliner().Clear();
pOlView->FillOutliner();
pOlView->GetActualPage();
Cancel();
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index b78fbfb1c67d..2cb952d56ad8 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -152,12 +152,12 @@ void OutlineViewShell::Construct(DrawDocShell* )
// Apply settings of FrameView
ReadFrameViewData(mpFrameView);
- ::Outliner* pOutl = pOlView->GetOutliner();
- pOutl->SetUpdateMode(true);
+ ::Outliner& rOutl = pOlView->GetOutliner();
+ rOutl.SetUpdateMode(true);
if (!bModified)
{
- pOutl->ClearModifyFlag();
+ rOutl.ClearModifyFlag();
}
pLastPage = GetActualPage();
@@ -296,7 +296,7 @@ void OutlineViewShell::ArrangeGUIElements ()
Rectangle aText = Rectangle(Point(0,0),
Size(pOlView->GetPaperWidth(),
- pOlView->GetOutliner()->GetTextHeight()));
+ pOlView->GetOutliner().GetTextHeight()));
if (aWin.GetHeight() > aText.Bottom())
aText.Bottom() = aWin.GetHeight();
@@ -324,7 +324,7 @@ void OutlineViewShell::ExecCtrl(SfxRequest &rReq)
case SID_OPT_LOCALE_CHANGED:
{
- pOlView->GetOutliner()->UpdateFields();
+ pOlView->GetOutliner().UpdateFields();
UpdatePreview( GetActualPage() );
rReq.Done();
break;
@@ -716,12 +716,9 @@ void OutlineViewShell::FuPermanent(SfxRequest &rReq)
{
case SID_EDIT_OUTLINER:
{
- ::Outliner* pOutl = pOlView->GetOutliner();
- if( pOutl )
- {
- pOutl->GetUndoManager().Clear();
- pOutl->UpdateFields();
- }
+ ::Outliner& rOutl = pOlView->GetOutliner();
+ rOutl.GetUndoManager().Clear();
+ rOutl.UpdateFields();
SetCurrentFunction( FuOutlineText::Create(this,GetActiveWindow(),pOlView,GetDoc(),rReq) );
@@ -796,19 +793,16 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem( SID_ZOOM_OUT );
}
- ::Outliner* pOutl = pOlView->GetOutliner();
- DBG_ASSERT(pOutl, "OutlineViewShell::GetMenuState(), no outliner? Fatality!");
- if( !pOutl )
- return;
+ ::Outliner& rOutl = pOlView->GetOutliner();
// allow 'Select All'?
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SELECTALL ) )
{
- sal_Int32 nParaCount = pOutl->GetParagraphCount();
+ sal_Int32 nParaCount = rOutl.GetParagraphCount();
bool bDisable = nParaCount == 0;
if (!bDisable && nParaCount == 1)
{
- OUString aTest = pOutl->GetText(pOutl->GetParagraph(0));
+ OUString aTest = rOutl.GetText(rOutl.GetParagraph(0));
if (aTest.isEmpty())
{
bDisable = true;
@@ -822,14 +816,14 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
rSet.Put( SfxBoolItem( SID_RULER, HasRuler() ) );
// Enable formatting?
- rSet.Put( SfxBoolItem( SID_OUTLINE_FORMAT, !pOutl->IsFlatMode() ) );
+ rSet.Put( SfxBoolItem( SID_OUTLINE_FORMAT, !rOutl.IsFlatMode() ) );
- if( pOutl->IsFlatMode() )
+ if( rOutl.IsFlatMode() )
rSet.DisableItem( SID_COLORVIEW );
else
{
// Enable color view?
- sal_uLong nCntrl = pOutl->GetControlWord();
+ sal_uLong nCntrl = rOutl.GetControlWord();
bool bNoColor = false;
if (nCntrl & EE_CNTRL_NOCOLORS)
bNoColor = true;
@@ -853,21 +847,21 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
Paragraph* pPara = *iter;
sal_Int16 nDepth;
- sal_Int16 nTmpDepth = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) );
- bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE );
+ sal_Int16 nTmpDepth = rOutl.GetDepth( rOutl.GetAbsPos( pPara ) );
+ bool bPage = rOutl.HasParaFlag( pPara, PARAFLAG_ISPAGE );
while (iter != aSelList.begin())
{
pPara = *iter;
- nDepth = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) );
+ nDepth = rOutl.GetDepth( rOutl.GetAbsPos( pPara ) );
- if( nDepth != nTmpDepth || bPage != pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ))
+ if( nDepth != nTmpDepth || bPage != rOutl.HasParaFlag( pPara, PARAFLAG_ISPAGE ))
bUnique = false;
- if (pOutl->HasChildren(pPara))
+ if (rOutl.HasChildren(pPara))
{
- if (!pOutl->IsExpanded(pPara))
+ if (!rOutl.IsExpanded(pPara))
bDisableExpand = false;
else
bDisableCollapse = false;
@@ -910,16 +904,16 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if (bDisableCollapseAll || bDisableExpandAll)
{
sal_Int32 nParaPos = 0;
- Paragraph* pPara = pOutl->GetParagraph( nParaPos );
+ Paragraph* pPara = rOutl.GetParagraph( nParaPos );
while (pPara && (bDisableCollapseAll || bDisableExpandAll))
{
- if (!pOutl->IsExpanded(pPara) && pOutl->HasChildren(pPara))
+ if (!rOutl.IsExpanded(pPara) && rOutl.HasChildren(pPara))
bDisableExpandAll = false;
- if (pOutl->IsExpanded(pPara) && pOutl->HasChildren(pPara))
+ if (rOutl.IsExpanded(pPara) && rOutl.HasChildren(pPara))
bDisableCollapseAll = false;
- pPara = pOutl->GetParagraph( ++nParaPos );
+ pPara = rOutl.GetParagraph( ++nParaPos );
}
}
@@ -957,7 +951,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem(SID_COPY);
}
- if (pOlView->GetOutliner()->IsModified())
+ if (pOlView->GetOutliner().IsModified())
{
GetDoc()->SetChanged(true);
}
@@ -1151,7 +1145,7 @@ long OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin);
long nViewHeight = pWin->PixelToLogic(
pWin->GetSizePixel()).Height();
- long nTextHeight = pOlView->GetOutliner()->GetTextHeight();
+ long nTextHeight = pOlView->GetOutliner().GetTextHeight();
nViewHeight += nTextHeight;
long nCurrentPos = pOutlinerView->GetVisArea().Top();
long nTargetPos = (long)(fY * nViewHeight);
@@ -1275,16 +1269,16 @@ void OutlineViewShell::Execute(SfxRequest& rReq)
*/
void OutlineViewShell::ReadFrameViewData(FrameView* pView)
{
- ::Outliner* pOutl = pOlView->GetOutliner();
+ ::Outliner& rOutl = pOlView->GetOutliner();
- pOutl->SetFlatMode( pView->IsNoAttribs() );
+ rOutl.SetFlatMode( pView->IsNoAttribs() );
- sal_uLong nCntrl = pOutl->GetControlWord();
+ sal_uLong nCntrl = rOutl.GetControlWord();
if ( pView->IsNoColors() )
- pOutl->SetControlWord(nCntrl | EE_CNTRL_NOCOLORS);
+ rOutl.SetControlWord(nCntrl | EE_CNTRL_NOCOLORS);
else
- pOutl->SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS);
+ rOutl.SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS);
sal_uInt16 nPage = mpFrameView->GetSelectedPage();
pLastPage = GetDoc()->GetSdPage( nPage, PK_STANDARD );
@@ -1298,14 +1292,14 @@ void OutlineViewShell::ReadFrameViewData(FrameView* pView)
*/
void OutlineViewShell::WriteFrameViewData()
{
- ::Outliner* pOutl = pOlView->GetOutliner();
+ ::Outliner& rOutl = pOlView->GetOutliner();
- sal_uLong nCntrl = pOutl->GetControlWord();
+ sal_uLong nCntrl = rOutl.GetControlWord();
bool bNoColor = false;
if (nCntrl & EE_CNTRL_NOCOLORS)
bNoColor = true;
mpFrameView->SetNoColors(bNoColor);
- mpFrameView->SetNoAttribs( pOutl->IsFlatMode() );
+ mpFrameView->SetNoAttribs( rOutl.IsFlatMode() );
SdPage* pActualPage = pOlView->GetActualPage();
DBG_ASSERT(pActualPage, "No current page");
if( pActualPage )
@@ -1361,9 +1355,9 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
sal_uInt16 nPageCount = GetDoc()->GetSdPageCount( PK_STANDARD );
OUString aPageStr, aLayoutStr;
- ::sd::Window* pWin = GetActiveWindow();
+ ::sd::Window* pWin = GetActiveWindow();
OutlinerView* pActiveView = pOlView->GetViewByWindow( pWin );
- ::Outliner* pOutliner = pOlView->GetOutliner();
+ ::Outliner& rOutliner = pOlView->GetOutliner();
std::vector<Paragraph*> aSelList;
pActiveView->CreateSelectionList(aSelList);
@@ -1377,10 +1371,10 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
pLastPara = *(aSelList.rbegin());
}
- if( !pOutliner->HasParaFlag(pFirstPara,PARAFLAG_ISPAGE) )
+ if( !rOutliner.HasParaFlag(pFirstPara,PARAFLAG_ISPAGE) )
pFirstPara = pOlView->GetPrevTitle( pFirstPara );
- if( !pOutliner->HasParaFlag(pLastPara, PARAFLAG_ISPAGE) )
+ if( !rOutliner.HasParaFlag(pLastPara, PARAFLAG_ISPAGE) )
pLastPara = pOlView->GetPrevTitle( pLastPara );
// only one page selected?
@@ -1499,24 +1493,21 @@ bool OutlineViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
OUString OutlineViewShell::GetSelectionText(bool bCompleteWords)
{
OUString aStrSelection;
- ::Outliner* pOl = pOlView->GetOutliner();
+ ::Outliner& rOl = pOlView->GetOutliner();
OutlinerView* pOutlinerView = pOlView->GetViewByWindow( GetActiveWindow() );
- if (pOl)
+ if (bCompleteWords)
{
- if (bCompleteWords)
- {
- ESelection aSel = pOutlinerView->GetSelection();
- OUString aStrCurrentDelimiters = pOl->GetWordDelimiters();
+ ESelection aSel = pOutlinerView->GetSelection();
+ OUString aStrCurrentDelimiters = rOl.GetWordDelimiters();
- pOl->SetWordDelimiters(" .,;\"'");
- aStrSelection = pOl->GetWord( aSel.nEndPara, aSel.nEndPos );
- pOl->SetWordDelimiters( aStrCurrentDelimiters );
- }
- else
- {
- aStrSelection = pOutlinerView->GetSelected();
- }
+ rOl.SetWordDelimiters(" .,;\"'");
+ aStrSelection = rOl.GetWord( aSel.nEndPara, aSel.nEndPos );
+ rOl.SetWordDelimiters( aStrCurrentDelimiters );
+ }
+ else
+ {
+ aStrSelection = pOutlinerView->GetSelected();
}
return (aStrSelection);
@@ -1705,11 +1696,11 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
if( !pPage || !pPara )
return false;
- ::Outliner* pOutliner = pOlView->GetOutliner();
+ ::Outliner& rOutliner = pOlView->GetOutliner();
SdrTextObj* pTO = pOlView->GetTitleTextObject( pPage );
OutlinerParaObject* pOPO = NULL;
- OUString aTest = pOutliner->GetText(pPara);
+ OUString aTest = rOutliner.GetText(pPara);
bool bText = !aTest.isEmpty();
bool bNewObject = false;
@@ -1726,7 +1717,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
// if we have a title object and a text, set the text
if( pTO )
{
- pOPO = pOutliner->CreateParaObject( pOutliner->GetAbsPos( pPara ), 1 );
+ pOPO = rOutliner.CreateParaObject( rOutliner.GetAbsPos( pPara ), 1 );
pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT );
pOPO->SetVertical( pTO->IsVerticalWriting() );
if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) )
@@ -1787,7 +1778,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
if( !pPage || !pPara )
return false;
- ::Outliner* pOutliner = pOlView->GetOutliner();
+ ::Outliner& rOutliner = pOlView->GetOutliner();
OutlinerParaObject* pOPO = NULL;
SdrTextObj* pTO = NULL;
@@ -1802,19 +1793,19 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
}
// how many paragraphs in the outline?
- sal_Int32 nTitlePara = pOutliner->GetAbsPos( pPara );
+ sal_Int32 nTitlePara = rOutliner.GetAbsPos( pPara );
sal_Int32 nPara = nTitlePara + 1;
sal_Int32 nParasInLayout = 0L;
- pPara = pOutliner->GetParagraph( nPara );
- while( pPara && !pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) )
+ pPara = rOutliner.GetParagraph( nPara );
+ while( pPara && !rOutliner.HasParaFlag(pPara, PARAFLAG_ISPAGE) )
{
nParasInLayout++;
- pPara = pOutliner->GetParagraph( ++nPara );
+ pPara = rOutliner.GetParagraph( ++nPara );
}
if( nParasInLayout )
{
// create an OutlinerParaObject
- pOPO = pOutliner->CreateParaObject( nTitlePara + 1, nParasInLayout );
+ pOPO = rOutliner.CreateParaObject( nTitlePara + 1, nParasInLayout );
}
if( pOPO )
@@ -1892,41 +1883,40 @@ sal_uLong OutlineViewShell::Read(SvStream& rInput, const OUString& rBaseURL, sal
{
sal_uLong bRet = 0;
- ::Outliner* pOutl = pOlView->GetOutliner();
+ ::Outliner& rOutl = pOlView->GetOutliner();
- {
OutlineViewPageChangesGuard aGuard( pOlView );
OutlineViewModelChangeGuard aGuard2( *pOlView );
- bRet = pOutl->Read( rInput, rBaseURL, eFormat, GetDocSh()->GetHeaderAttributes() );
+ bRet = rOutl.Read( rInput, rBaseURL, eFormat, GetDocSh()->GetHeaderAttributes() );
SdPage* pPage = GetDoc()->GetSdPage( GetDoc()->GetSdPageCount(PK_STANDARD) - 1, PK_STANDARD );;
SfxStyleSheet* pTitleSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
SfxStyleSheet* pOutlSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
- sal_Int32 nParaCount = pOutl->GetParagraphCount();
+ sal_Int32 nParaCount = rOutl.GetParagraphCount();
if ( nParaCount > 0 )
{
for ( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
{
pOlView->UpdateParagraph( nPara );
- sal_Int16 nDepth = pOutl->GetDepth( nPara );
+ sal_Int16 nDepth = rOutl.GetDepth( nPara );
if( (nDepth == 0) || !nPara )
{
- Paragraph* pPara = pOutl->GetParagraph( nPara );
- pOutl->SetDepth(pPara, -1);
- pOutl->SetParaFlag(pPara, PARAFLAG_ISPAGE);
+ Paragraph* pPara = rOutl.GetParagraph( nPara );
+ rOutl.SetDepth(pPara, -1);
+ rOutl.SetParaFlag(pPara, PARAFLAG_ISPAGE);
- pOutl->SetStyleSheet( nPara, pTitleSheet );
+ rOutl.SetStyleSheet( nPara, pTitleSheet );
if( nPara ) // first slide already exists
pOlView->InsertSlideForParagraph( pPara );
}
else
{
- pOutl->SetDepth( pOutl->GetParagraph( nPara ), nDepth - 1 );
+ rOutl.SetDepth( rOutl.GetParagraph( nPara ), nDepth - 1 );
OUString aStyleSheetName = pOutlSheet->GetName();
if (!aStyleSheetName.isEmpty())
aStyleSheetName = aStyleSheetName.copy(0, aStyleSheetName.getLength() - 1);
@@ -1935,13 +1925,12 @@ sal_uLong OutlineViewShell::Read(SvStream& rInput, const OUString& rBaseURL, sal
SfxStyleSheet* pStyle = (SfxStyleSheet*) pStylePool->Find( aStyleSheetName, pOutlSheet->GetFamily() );
DBG_ASSERT( pStyle, "AutoStyleSheetName - Style not found!" );
if ( pStyle )
- pOutl->SetStyleSheet( nPara, pStyle );
+ rOutl.SetStyleSheet( nPara, pStyle );
}
}
}
- }
- pOutl->GetUndoManager().Clear();
+ rOutl.GetUndoManager().Clear();
return( bRet );
}
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 2ff4a712b1d1..11f710137d45 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1067,9 +1067,8 @@ void ViewShell::UpdatePreview (SdPage*, bool )
OutlineView* pOlView = dynamic_cast< OutlineView* >( pView );
if( pOlView )
{
- ::Outliner* pOutl = pOlView->GetOutliner();
- if( pOutl )
- return &pOutl->GetUndoManager();
+ ::Outliner& rOutl = pOlView->GetOutliner();
+ return &rOutl.GetUndoManager();
}
}
else if( pView->IsTextEdit() )
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index ee84eaaacf2f..9a063ecef86c 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -125,9 +125,9 @@ namespace
delete pFilter;
}
}
- SfxFilterList_Impl *getList()
+ SfxFilterList_Impl& getList()
{
- return &aList;
+ return aList;
}
};
class theSfxFilterArray : public rtl::Static<SfxFilterArray, theSfxFilterArray > {};
@@ -138,7 +138,7 @@ static bool bFirstRead = true;
static void CreateFilterArr()
{
- pFilterArr = theSfxFilterArray::get().getList();
+ pFilterArr = &theSfxFilterArray::get().getList();
theSfxFilterListener::get();
}
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
index c02274dbfb11..42e4f4df9b07 100644
--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
@@ -36,7 +36,7 @@ namespace
g_error_free(m_pError);
throw RuntimeException(sMsg);
}
- GError** getRef() { return &m_pError; }
+ GError*& getRef() { return m_pError; }
};
static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface)
{
@@ -49,7 +49,7 @@ namespace
"/org/freedesktop/PackageKit",
reinterpret_cast<const gchar*>(sFullInterface.getStr()),
NULL,
- error.getRef());
+ &error.getRef());
if(!proxy)
throw RuntimeException("couldnt get a proxy!");
return proxy;
@@ -87,7 +87,7 @@ namespace shell { namespace sessioninstall
G_DBUS_CALL_FLAGS_NONE,
-1, /* timeout */
NULL, /* cancellable */
- error.getRef());
+ &error.getRef());
}
void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, const OUString& sInteraction, sal_Bool& o_isInstalled ) throw (RuntimeException, std::exception)
@@ -104,7 +104,7 @@ namespace shell { namespace sessioninstall
G_DBUS_CALL_FLAGS_NONE,
-1, /* timeout */
NULL, /* cancellable */
- error.getRef()),GVariantDeleter());
+ &error.getRef()),GVariantDeleter());
if(result.get())
o_isInstalled = g_variant_get_boolean(g_variant_get_child_value(result.get(),0)) ? sal_True : sal_False;
}
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 9c7980609250..fa2edee2bfee 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -185,7 +185,7 @@ public:
void AdjustPosition();
- SmEditWindow *GetEditWindow() { return (&aEdit); }
+ SmEditWindow& GetEditWindow() { return aEdit; }
SmViewShell *GetView();
};
@@ -207,7 +207,7 @@ protected:
public:
- SmEditWindow *GetEditWindow()
+ SmEditWindow& GetEditWindow()
{
return (((SmCmdBoxWindow *)pWindow)->GetEditWindow());
}
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 4376b7ad8fb6..eb3ac83c21d6 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -98,7 +98,7 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) :
SetMapMode(MAP_PIXEL);
// Even RTL languages don't use RTL for math
- rCmdBox.GetEditWindow()->EnableRTL( false );
+ rCmdBox.GetEditWindow().EnableRTL( false );
ApplyColorConfigValues( SM_MOD()->GetColorConfig() );
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 1de12e66c507..e60f22df460d 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1374,9 +1374,8 @@ SmEditWindow *SmViewShell::GetEditWindow()
if (pWrapper != NULL)
{
- SmEditWindow *pEditWin = pWrapper->GetEditWindow();
- SAL_WARN_IF( !pEditWin, "starmath", "SmEditWindow missing" );
- return pEditWin;
+ SmEditWindow& rEditWin = pWrapper->GetEditWindow();
+ return &rEditWin;
}
return NULL;
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index 5dddac9487d2..46db02efa01a 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -78,7 +78,7 @@ sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChildCount( ) throw (
{
OExternalLockGuard aGuard( this );
ensureAlive();
- return ( mpParent->getScrollBar()->IsVisible() ) ? 2 : 1;
+ return ( mpParent->getScrollBar().IsVisible() ) ? 2 : 1;
}
uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleAtPoint( const awt::Point& aPoint )
@@ -96,14 +96,14 @@ uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetVirtual
m_pTable = new SvxShowCharSetAcc(this);
xRet = m_pTable;
}
- else if ( mpParent->getScrollBar()->IsVisible() )
+ else if ( mpParent->getScrollBar().IsVisible() )
{
- const Point aOutPos( mpParent->getScrollBar()->GetPosPixel() );
- const Size aScrollBar = mpParent->getScrollBar()->GetOutputSizePixel();
+ const Point aOutPos( mpParent->getScrollBar().GetPosPixel() );
+ const Size aScrollBar = mpParent->getScrollBar().GetOutputSizePixel();
Rectangle aRect(aOutPos,aScrollBar);
if ( aRect.IsInside(VCLPoint(aPoint)) )
- xRet = mpParent->getScrollBar()->GetAccessible();
+ xRet = mpParent->getScrollBar().GetAccessible();
}
return xRet;
}
@@ -128,8 +128,8 @@ Reference< XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChild(
{
OExternalLockGuard aGuard( this );
ensureAlive();
- if ( mpParent->getScrollBar()->IsVisible() && i == 0 )
- return mpParent->getScrollBar()->GetAccessible();
+ if ( mpParent->getScrollBar().IsVisible() && i == 0 )
+ return mpParent->getScrollBar().GetAccessible();
else if ( i == 1 )
{
if ( !m_xAcc.is() )
@@ -340,9 +340,9 @@ void SvxShowCharSetAcc::implSelect(sal_Int32 nAccessibleChildIndex, sal_Bool bSe
{
const Point aOutPos;//( m_pParent->getCharSetControl()->GetPosPixel() );
Size aOutSize( m_pParent->getCharSetControl()->GetOutputSizePixel());
- if ( m_pParent->getCharSetControl()->getScrollBar()->IsVisible() )
+ if ( m_pParent->getCharSetControl()->getScrollBar().IsVisible() )
{
- const Size aScrollBar = m_pParent->getCharSetControl()->getScrollBar()->GetOutputSizePixel();
+ const Size aScrollBar = m_pParent->getCharSetControl()->getScrollBar().GetOutputSizePixel();
aOutSize.Width() -= aScrollBar.Width();
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 0c2e6076ae53..6d344f60e455 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -615,8 +615,8 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet&
{
if(rPropSet.AreThereOwnUsrAnys())
{
- const SfxItemPropertyMap* pSrc = rPropSet.getPropertyMap();
- PropertyEntryVector_t aSrcPropVector = pSrc->getPropertyEntries();
+ const SfxItemPropertyMap& rSrc = rPropSet.getPropertyMap();
+ PropertyEntryVector_t aSrcPropVector = rSrc.getPropertyEntries();
PropertyEntryVector_t::const_iterator aSrcIt = aSrcPropVector.begin();
while(aSrcIt != aSrcPropVector.end())
{
@@ -662,7 +662,7 @@ void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet)
{
SfxItemSet aSet( mpModel->GetItemPool(), SDRATTR_START, SDRATTR_END);
Reference< beans::XPropertySet > xShape( (OWeakObject*)this, UNO_QUERY );
- SvxItemPropertySet_ObtainSettingsFromPropertySet(rPropSet, aSet, xShape, mpPropSet->getPropertyMap() );
+ SvxItemPropertySet_ObtainSettingsFromPropertySet(rPropSet, aSet, xShape, &mpPropSet->getPropertyMap() );
mpObj->SetMergedItemSetAndBroadcast(aSet);
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index b94b412e9e79..a7f9b1f0a9e7 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -896,7 +896,7 @@ inline bool SwCrsrShell::IsSelOnePara() const
inline const SwTableNode* SwCrsrShell::IsCrsrInTbl( bool bIsPtInTbl ) const
{
- return m_pCurCrsr->GetNode( bIsPtInTbl )->FindTableNode();
+ return m_pCurCrsr->GetNode( bIsPtInTbl ).FindTableNode();
}
inline bool SwCrsrShell::IsCrsrPtAtEnd() const
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 63c92528b476..fc8b107f5d5d 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -260,8 +260,8 @@ class SwDrawVirtObj : public SdrVirtObj
SwDrawVirtObj& operator= (const SwDrawVirtObj& rObj);
/// connection to writer layout
- const SwAnchoredObject* GetAnchoredObj() const { return &maAnchoredDrawObj;}
- SwAnchoredObject* AnchoredObj() { return &maAnchoredDrawObj;}
+ const SwAnchoredObject& GetAnchoredObj() const { return maAnchoredDrawObj; }
+ SwAnchoredObject& AnchoredObj() { return maAnchoredDrawObj; }
const SwFrm* GetAnchorFrm() const;
SwFrm* AnchorFrm();
void RemoveFromWriterLayout();
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 957f9673b18f..c090b3f0dfae 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -216,7 +216,7 @@ public:
{
/** clear the mark position; this helps if mark's SwIndex is
registered at some node, and that node is then deleted */
- *m_pMark = SwPosition( SwNodeIndex( GetNode()->GetNodes() ) );
+ *m_pMark = SwPosition( SwNodeIndex( GetNode().GetNodes() ) );
m_pMark = m_pPoint;
}
}
@@ -256,15 +256,15 @@ public:
{ return (*m_pPoint) > (*m_pMark) ? m_pPoint : m_pMark; }
/// @return current Node at Point/Mark
- SwNode * GetNode ( bool bPoint = true ) const
+ SwNode & GetNode ( bool bPoint = true ) const
{
- return &( bPoint ? m_pPoint->nNode : m_pMark->nNode ).GetNode();
+ return ( bPoint ? m_pPoint->nNode : m_pMark->nNode ).GetNode();
}
/// @return current ContentNode at Point/Mark
SwCntntNode* GetCntntNode( bool bPoint = true ) const
{
- return GetNode(bPoint)->GetCntntNode();
+ return GetNode(bPoint).GetCntntNode();
}
/**
diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index c849a7b70e8d..222857da0d0d 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -76,8 +76,8 @@ public:
static void Destroy( SwTxtAttr * pToDestroy, SfxItemPool& rPool );
/// start position
- sal_Int32* GetStart() { return & m_nStart; }
- const sal_Int32* GetStart() const { return & m_nStart; }
+ sal_Int32& GetStart() { return m_nStart; }
+ const sal_Int32& GetStart() const { return m_nStart; }
/// end position
virtual sal_Int32* GetEnd(); // also used to change the end position
@@ -140,7 +140,7 @@ inline const sal_Int32* SwTxtAttr::End() const
inline const sal_Int32* SwTxtAttr::GetAnyEnd() const
{
const sal_Int32* pEnd = End();
- return pEnd ? pEnd : GetStart();
+ return pEnd ? pEnd : &GetStart();
}
inline const SfxPoolItem& SwTxtAttr::GetAttr() const
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 6b073fee70d7..c15ca72f0c21 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -232,7 +232,7 @@ void SwDocTest::testModelToViewHelper()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, OUString("AAAAA BBBBB "));
- SwTxtNode* pTxtNode = aPaM.GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = aPaM.GetNode().GetTxtNode();
sal_Int32 nPos = aPaM.GetPoint()->nContent.GetIndex();
pTxtNode->InsertItem(aFtn, nPos, nPos);
m_pDoc->InsertString(aPaM, OUString(" CCCCC "));
@@ -411,7 +411,7 @@ void SwDocTest::testModelToViewHelper()
(*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] = uno::makeAny(vListEntries);
(*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_RESULT] = uno::makeAny(sal_Int32(0));
m_pDoc->InsertString(aPaM, OUString("CCCCC"));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11),
pTxtNode->GetTxt().getLength());
@@ -442,7 +442,7 @@ void SwDocTest::testSwScanner()
SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
SwPaM aPaM(aIdx);
- SwTxtNode* pTxtNode = aPaM.GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = aPaM.GetNode().GetTxtNode();
CPPUNIT_ASSERT_MESSAGE("Has Text Node", pTxtNode);
@@ -482,7 +482,7 @@ void SwDocTest::testSwScanner()
m_pDoc->InsertPoolItem(aPaM, aWestLangItem, 0 );
SwDocStat aDocStat;
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(IDEOGRAPHICFULLSTOP_D));
CPPUNIT_ASSERT_MESSAGE("Should be 2", aDocStat.nChar == 2);
@@ -518,7 +518,7 @@ void SwDocTest::testSwScanner()
m_pDoc->InsertPoolItem(aPaM, aWestLangItem, 0 );
SwDocStat aDocStat;
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(test));
CPPUNIT_ASSERT_MESSAGE("58 words", aDocStat.nWord == 58);
CPPUNIT_ASSERT_MESSAGE("43 Asian characters and Korean syllables", aDocStat.nAsianWord == 43);
@@ -539,7 +539,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, OUString(aShouldBeThree, SAL_N_ELEMENTS(aShouldBeThree)));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(aShouldBeThree));
CPPUNIT_ASSERT_MESSAGE("Should be 3", aDocStat.nWord == 3);
@@ -556,7 +556,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, OUString(aShouldBeFive, SAL_N_ELEMENTS(aShouldBeFive)));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
aDocStat.Reset();
pTxtNode->CountWords(aDocStat, 0, SAL_N_ELEMENTS(aShouldBeFive));
CPPUNIT_ASSERT_MESSAGE("Should be 5", aDocStat.nWord == 5);
@@ -568,7 +568,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, OUString("Apple"));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
sal_Int32 nPos = aPaM.GetPoint()->nContent.GetIndex();
SwFmtFtn aFtn;
aFtn.SetNumStr(OUString("banana"));
@@ -601,7 +601,7 @@ void SwDocTest::testSwScanner()
m_pDoc->InsertPoolItem(aPaM, SwFmtFld(aPostIt), 0);
m_pDoc->InsertString(aPaM, OUString("Apple"));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
aDocStat.Reset();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 1);
@@ -618,7 +618,7 @@ void SwDocTest::testSwScanner()
const char aString[] = "Lorem ipsum";
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, OUString(aString));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT_EQUAL(aDocStat.nWord, static_cast<sal_uLong>(2));
@@ -681,7 +681,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', ' '));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
aDocStat.nCharExcludingSpaces == 12 &&
@@ -690,7 +690,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replaceAll(OUString('X'), OUString(" = ")));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 5 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -699,7 +699,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replaceAll(OUString('X'), OUString(" _ ")));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 5 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -708,7 +708,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replaceAll(OUString('X'), OUString(" -- ")));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 5 &&
aDocStat.nCharExcludingSpaces == 14 &&
@@ -717,7 +717,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', '_'));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -726,7 +726,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', '-'));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -735,7 +735,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', 0x2012));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -744,7 +744,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', 0x2015));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 3 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -755,7 +755,7 @@ void SwDocTest::testSwScanner()
//and endash as word separators for word-counting
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', 0x2013));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -764,7 +764,7 @@ void SwDocTest::testSwScanner()
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replace('X', 0x2014));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
aDocStat.nCharExcludingSpaces == 13 &&
@@ -775,7 +775,7 @@ void SwDocTest::testSwScanner()
OUString sChunk(aChunk, SAL_N_ELEMENTS(aChunk));
m_pDoc->AppendTxtNode(*aPaM.GetPoint());
m_pDoc->InsertString(aPaM, sTemplate.replaceAll(OUString('X'), sChunk));
- pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode = aPaM.GetNode().GetTxtNode();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
CPPUNIT_ASSERT(aDocStat.nWord == 4 &&
aDocStat.nCharExcludingSpaces == 13 &&
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 7fd4a7012f2c..85c294c07776 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -88,7 +88,7 @@ void SwUiWriterTest::testReplaceForward()
pDoc->InsertString(aPaM, ORIGINAL_REPLACE_CONTENT);
- SwTxtNode* pTxtNode = aPaM.GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = aPaM.GetNode().GetTxtNode();
lcl_selectCharacters(aPaM, 5, 9);
pDoc->ReplaceRange(aPaM, OUString("toto"), false);
@@ -137,7 +137,7 @@ void SwUiWriterTest::testReplaceBackward()
SwPaM aPaM(aIdx);
pDoc->InsertString(aPaM, OUString("toto titi tutu"));
- SwTxtNode* pTxtNode = aPaM.GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = aPaM.GetNode().GetTxtNode();
lcl_selectCharacters(aPaM, 9, 5);
pDoc->ReplaceRange(aPaM, OUString("toto"), false);
@@ -207,7 +207,7 @@ void SwUiWriterTest::testImportRTF()
CPPUNIT_ASSERT(pRTFReader != 0);
CPPUNIT_ASSERT_EQUAL(sal_uLong(0), aReader.Read(*pRTFReader));
- sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode()->GetIndex();
+ sal_uLong nIndex = pWrtShell->GetCrsr()->GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(OUString("fooHello world!"), static_cast<SwTxtNode*>(pDoc->GetNodes()[nIndex - 1])->GetTxt());
CPPUNIT_ASSERT_EQUAL(OUString("bar"), static_cast<SwTxtNode*>(pDoc->GetNodes()[nIndex])->GetTxt());
}
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index f35dfcd30eac..9c70eb15c652 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -686,11 +686,11 @@ SwTOXSortTabBase* SwAccessibleParagraph::GetTOXSortTabBase()
if( pSect->GetType() == TOX_CONTENT_SECTION )
{
SwTOXSortTabBase* pSortBase = 0;
- size_t nSize = pTOXBaseSect->GetTOXSortTabBases()->size();
+ size_t nSize = pTOXBaseSect->GetTOXSortTabBases().size();
for(size_t nIndex = 0; nIndex<nSize; nIndex++ )
{
- pSortBase = (*(pTOXBaseSect->GetTOXSortTabBases()))[nIndex];
+ pSortBase = pTOXBaseSect->GetTOXSortTabBases()[nIndex];
if( pSortBase->pTOXNd == pTxtNd )
break;
}
@@ -3134,7 +3134,7 @@ const SwTxtAttr *SwHyperlinkIter_Impl::next()
const SwTxtAttr *pHt = (*pHints)[nPos];
if( RES_TXTATR_INETFMT == pHt->Which() )
{
- const sal_Int32 nHtStt = *pHt->GetStart();
+ const sal_Int32 nHtStt = pHt->GetStart();
const sal_Int32 nHtEnd = *pHt->GetAnyEnd();
if( nHtEnd > nHtStt &&
( (nHtStt >= nStt && nHtStt < nEnd) ||
@@ -3188,7 +3188,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
bool bH = false;
if( pHt )
- nHStt = *pHt->GetStart();
+ nHStt = pHt->GetStart();
bool bTOC = false;
// Inside TOC & get the first link
if( pTBase && nTIndex == -1 )
@@ -3221,7 +3221,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
{
{
const sal_Int32 nTmpHStt= GetPortionData().GetAccessiblePosition(
- max( aHIter.startIdx(), *pHt->GetStart() ) );
+ max( aHIter.startIdx(), pHt->GetStart() ) );
const sal_Int32 nTmpHEnd= GetPortionData().GetAccessiblePosition(
min( aHIter.endIdx(), *pHt->GetAnyEnd() ) );
xRet = new SwAccessibleHyperlink( aHIter.getCurrHintPos(),
@@ -3280,7 +3280,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharInde
const sal_Int32 nIdx = GetPortionData().GetModelPosition( nCharIndex );
sal_Int32 nPos = 0;
const SwTxtAttr *pHt = aHIter.next();
- while( pHt && !(nIdx >= *pHt->GetStart() && nIdx < *pHt->GetAnyEnd()) )
+ while( pHt && !(nIdx >= pHt->GetStart() && nIdx < *pHt->GetAnyEnd()) )
{
pHt = aHIter.next();
nPos++;
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index ba0d893f8c6b..a8449fbebdb0 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -167,7 +167,7 @@ SwCallLink::~SwCallLink()
{
const SwTxtAttr* pHt = rHts[ n ];
const sal_Int32 *pEnd = pHt->End();
- const sal_Int32 nStart = *pHt->GetStart();
+ const sal_Int32 nStart = pHt->GetStart();
// If "only start" or "start and end equal" then call on
// every overflow of start.
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 46446c2f18fa..fb9b19d53c07 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -353,7 +353,7 @@ bool SwCrsrShell::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
// to the left will simply set the bInFrontOfLabel flag:
else if ( bLeft && 0 == pShellCrsr->GetPoint()->nContent.GetIndex() &&
!pShellCrsr->IsInFrontOfLabel() && !pShellCrsr->HasMark() &&
- 0 != ( pTxtNd = pShellCrsr->GetNode()->GetTxtNode() ) &&
+ 0 != ( pTxtNd = pShellCrsr->GetNode().GetTxtNode() ) &&
pTxtNd->HasVisibleNumberingOrBullet() )
{
SetInFrontOfLabel( true );
@@ -405,7 +405,7 @@ void SwCrsrShell::MarkListLevel( const OUString& sListId,
void SwCrsrShell::UpdateMarkedListLevel()
{
- SwTxtNode * pTxtNd = _GetCrsr()->GetNode()->GetTxtNode();
+ SwTxtNode * pTxtNd = _GetCrsr()->GetNode().GetTxtNode();
if ( pTxtNd )
{
@@ -547,7 +547,7 @@ bool SwCrsrShell::LRMargin( bool bLeft, bool bAPI)
if ( bLeft && !bTableMode && bRet && bWasAtLM && !_GetCrsr()->HasMark() )
{
- const SwTxtNode * pTxtNd = _GetCrsr()->GetNode()->GetTxtNode();
+ const SwTxtNode * pTxtNd = _GetCrsr()->GetNode().GetTxtNode();
if ( pTxtNd && pTxtNd->HasVisibleNumberingOrBullet() )
SetInFrontOfLabel( true );
}
@@ -734,7 +734,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, bool bOnlyText, bool bBlock )
bOnlyText ? MV_SETONLYTEXT : MV_NONE );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
- SwTxtNode * pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ SwTxtNode * pTxtNd = pCrsr->GetNode().GetTxtNode();
if ( pTxtNd && !IsTableMode() &&
// #i37515# No bInFrontOfLabel during selection
@@ -1405,8 +1405,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd )
if( pTstCrsr->HasMark() && !m_pBlockCrsr &&
mpDoc->IsIdxInTbl( pTstCrsr->GetPoint()->nNode ) &&
( m_pTblCrsr ||
- pTstCrsr->GetNode( true )->StartOfSectionNode() !=
- pTstCrsr->GetNode( false )->StartOfSectionNode() ) && !mbSelectAll)
+ pTstCrsr->GetNode( true ).StartOfSectionNode() !=
+ pTstCrsr->GetNode( false ).StartOfSectionNode() ) && !mbSelectAll)
{
SwShellCrsr* pITmpCrsr = getShellCrsr( true );
Point aTmpPt( pITmpCrsr->GetPtPos() );
@@ -1572,7 +1572,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd )
{
SwShellCrsr* pShellCrsr = getShellCrsr( true );
bool bChgState = true;
- const SwSectionNode* pSectNd = pShellCrsr->GetNode()->FindSectionNode();
+ const SwSectionNode* pSectNd = pShellCrsr->GetNode().FindSectionNode();
if( pSectNd && ( pSectNd->GetSection().IsHiddenFlag() ||
( !IsReadOnlyAvailable() &&
pSectNd->GetSection().IsProtectFlag() &&
@@ -2236,7 +2236,7 @@ OUString SwCrsrShell::GetSelTxt() const
if( m_pCurCrsr->GetPoint()->nNode.GetIndex() ==
m_pCurCrsr->GetMark()->nNode.GetIndex() )
{
- SwTxtNode* pTxtNd = m_pCurCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = m_pCurCrsr->GetNode().GetTxtNode();
if( pTxtNd )
{
const sal_Int32 nStt = m_pCurCrsr->Start()->nContent.GetIndex();
@@ -2254,7 +2254,7 @@ OUString SwCrsrShell::GetText() const
if( m_pCurCrsr->GetPoint()->nNode.GetIndex() ==
m_pCurCrsr->GetMark()->nNode.GetIndex() )
{
- SwTxtNode* pTxtNd = m_pCurCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = m_pCurCrsr->GetNode().GetTxtNode();
if( pTxtNd )
aTxt = pTxtNd->GetTxt().copy(
m_pCurCrsr->GetPoint()->nContent.GetIndex() );
@@ -2843,22 +2843,22 @@ bool SwCrsrShell::FindValidCntntNode( bool bOnlyText )
// move forward into non-protected area.
SwPaM aPam( rNdIdx.GetNode(), 0 );
- while( aPam.GetNode()->IsProtect() &&
+ while( aPam.GetNode().IsProtect() &&
aPam.Move( fnMoveForward, fnGoCntnt ) )
; // nothing to do in the loop; the aPam.Move does the moving!
// didn't work? then go backwards!
- if( aPam.GetNode()->IsProtect() )
+ if( aPam.GetNode().IsProtect() )
{
SwPaM aTmpPaM( rNdIdx.GetNode(), 0 );
aPam = aTmpPaM;
- while( aPam.GetNode()->IsProtect() &&
+ while( aPam.GetNode().IsProtect() &&
aPam.Move( fnMoveBackward, fnGoCntnt ) )
; // nothing to do in the loop; the aPam.Move does the moving!
}
// if we're successful, set the new position
- if( ! aPam.GetNode()->IsProtect() )
+ if( ! aPam.GetNode().IsProtect() )
{
*m_pCurCrsr->GetPoint() = *aPam.GetPoint();
}
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 9925e1e0f282..8ff7f73720e0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -564,7 +564,7 @@ const SwTOXMark& SwCrsrShell::GotoTOXMark( const SwTOXMark& rStart,
SwPosition& rPos = *GetCrsr()->GetPoint();
rPos.nNode = rNewMark.GetTxtTOXMark()->GetTxtNode();
rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(),
- *rNewMark.GetTxtTOXMark()->GetStart() );
+ rNewMark.GetTxtTOXMark()->GetStart() );
if( !m_pCurCrsr->IsSelOvr() )
UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
@@ -752,7 +752,7 @@ bool SwCrsrShell::GotoFld( const SwFmtFld& rFld )
SwTxtNode* pTNd = (SwTxtNode*)rFld.GetTxtFld()->GetpTxtNode();
pCrsr->GetPoint()->nNode = *pTNd;
- pCrsr->GetPoint()->nContent.Assign( pTNd, *rFld.GetTxtFld()->GetStart() );
+ pCrsr->GetPoint()->nContent.Assign( pTNd, rFld.GetTxtFld()->GetStart() );
bRet = !pCrsr->IsSelOvr();
if( bRet )
@@ -788,7 +788,7 @@ SwField* SwCrsrShell::GetFieldAtCrsr(
{
const sal_Int32 nTxtFldLength =
pTxtFld->End() != NULL
- ? *(pTxtFld->End()) - *(pTxtFld->GetStart())
+ ? *(pTxtFld->End()) - pTxtFld->GetStart()
: 1;
if ( ( pCrsr->End()->nContent.GetIndex() - pCrsr->Start()->nContent.GetIndex() ) <= nTxtFldLength )
{
@@ -861,7 +861,7 @@ sal_Int32 SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const
OSL_ENSURE( false, "<SwEditShell::StartOfInputFldAtPos(..)> - no Input Field at given position" );
return 0;
}
- return *(pTxtInputFld->GetStart());
+ return pTxtInputFld->GetStart();
}
sal_Int32 SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const
@@ -915,7 +915,7 @@ bool SwCrsrShell::GotoNextOutline()
SwCursor* pCrsr = getShellCrsr( true );
const SwNodes& rNds = GetDoc()->GetNodes();
- SwNode* pNd = pCrsr->GetNode();
+ SwNode* pNd = &(pCrsr->GetNode());
sal_uInt16 nPos;
if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
++nPos;
@@ -943,7 +943,7 @@ bool SwCrsrShell::GotoPrevOutline()
SwCursor* pCrsr = getShellCrsr( true );
const SwNodes& rNds = GetDoc()->GetNodes();
- SwNode* pNd = pCrsr->GetNode();
+ SwNode* pNd = &(pCrsr->GetNode());
sal_uInt16 nPos;
rNds.GetOutLineNds().Seek_Entry( pNd, &nPos );
@@ -975,7 +975,7 @@ sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel )
SwPaM* pCrsr = getShellCrsr( true );
const SwNodes& rNds = GetDoc()->GetNodes();
- SwNode* pNd = pCrsr->GetNode();
+ SwNode* pNd = &(pCrsr->GetNode());
sal_uInt16 nPos;
if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
nPos++; // is at correct position; take next for while
@@ -1354,7 +1354,7 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
const sal_Int32* pEnd = pTxtAttr->GetEnd();
if( pEnd )
rCntntAtPos.sStr =
- pTxtNd->GetExpandTxt( *pTxtAttr->GetStart(), *pEnd - *pTxtAttr->GetStart() );
+ pTxtNd->GetExpandTxt( pTxtAttr->GetStart(), *pEnd - pTxtAttr->GetStart() );
else if( RES_TXTATR_TOXMARK == pTxtAttr->Which())
rCntntAtPos.sStr =
pTxtAttr->GetTOXMark().GetAlternativeText();
@@ -1397,8 +1397,8 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( bRet )
{
rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
- *pTxtAttr->GetStart(),
- *pTxtAttr->GetEnd() - *pTxtAttr->GetStart() );
+ pTxtAttr->GetStart(),
+ *pTxtAttr->GetEnd() - pTxtAttr->GetStart() );
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR;
@@ -1518,7 +1518,7 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i )
{
const SwTxtAttr* pHt = pTxtNd->GetSwpHints()[i];
- const sal_Int32 nAttrStart = *pHt->GetStart();
+ const sal_Int32 nAttrStart = pHt->GetStart();
if( nAttrStart > n ) // over the section
break;
@@ -1737,7 +1737,7 @@ bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich,
if( pTxtAttr )
{
const sal_Int32* pEnd = pTxtAttr->End();
- bRet = SelectTxt( *pTxtAttr->GetStart(), ( pEnd ? *pEnd : *pTxtAttr->GetStart() + 1 ) );
+ bRet = SelectTxt( pTxtAttr->GetStart(), ( pEnd ? *pEnd : pTxtAttr->GetStart() + 1 ) );
}
}
return bRet;
@@ -1756,7 +1756,7 @@ bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
pCrsr->GetPoint()->nNode = *rAttr.GetpTxtNode();
pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)rAttr.GetpTxtNode(),
- *rAttr.GetStart() );
+ rAttr.GetStart() );
bRet = !pCrsr->IsSelOvr();
if( bRet )
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
@@ -2188,8 +2188,8 @@ bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext )
? ( aPos < aCmpPos && aCurPos < aPos )
: ( aCmpPos < aPos && aPos < aCurPos ))
{
- OUString sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
- *rAttr.GetEnd() - *rAttr.GetStart() ) );
+ OUString sTxt( pTxtNd->GetExpandTxt( rAttr.GetStart(),
+ *rAttr.GetEnd() - rAttr.GetStart() ) );
sTxt = comphelper::string::remove(sTxt, 0x0a);
sTxt = comphelper::string::strip(sTxt, ' ');
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index bc02b63d5ade..bc581a78b7f9 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -94,7 +94,7 @@ const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
{
const SwTxtAttr *pTxtHt = rHtsArr.GetStart( rPos++ );
// the start of an attribute has to be in the section
- if( *pTxtHt->GetStart() >= nCntntPos )
+ if( pTxtHt->GetStart() >= nCntntPos )
return pTxtHt; // valid text attribute
}
return 0; // invalid text attribute
@@ -107,7 +107,7 @@ const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
{
const SwTxtAttr *pTxtHt = rHtsArr.GetStart( --rPos );
// the start of an attribute has to be in the section
- if( *pTxtHt->GetStart() < nCntntPos )
+ if( pTxtHt->GetStart() < nCntntPos )
return pTxtHt; // valid text attribute
}
return 0; // invalid text attribute
@@ -167,7 +167,7 @@ static bool lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
if( pTxtHt->Which() == rCmpItem.Which() &&
( !bValue || CmpAttr( pTxtHt->GetAttr(), rCmpItem )))
{
- lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->End(), bForward );
+ lcl_SetAttrPam( rPam, pTxtHt->GetStart(), pTxtHt->End(), bForward );
return true;
}
return false;
@@ -332,7 +332,7 @@ lcl_IsAttributeIgnorable(sal_Int32 const nNdStart, sal_Int32 const nNdEnd,
bool SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
{
- _SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() );
+ _SwSrchChrAttr aTmp( rAttr.GetAttr(), rAttr.GetStart(), *rAttr.GetAnyEnd() );
// ignore all attributes not in search range
if (lcl_IsAttributeIgnorable(nNdStt, nNdEnd, aTmp))
@@ -485,7 +485,7 @@ bool SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
bool SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
{
- _SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() );
+ _SwSrchChrAttr aTmp( rAttr.GetAttr(), rAttr.GetStart(), *rAttr.GetAnyEnd() );
// ignore all attributes not in search range
if (lcl_IsAttributeIgnorable(nNdStt, nNdEnd, aTmp))
@@ -714,11 +714,11 @@ static int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
for( ; nPos < rHtArr.Count(); ++nPos )
if( !rCmpArr.SetAttrFwd( *( pAttr = rHtArr.GetStart( nPos )) ) )
{
- if( rCmpArr.GetNdStt() < *pAttr->GetStart() )
+ if( rCmpArr.GetNdStt() < pAttr->GetStart() )
{
// found end
lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(),
- pAttr->GetStart(), true );
+ &pAttr->GetStart(), true );
return sal_True;
}
// continue search
@@ -739,9 +739,9 @@ static int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr,
if( rCmpArr.SetAttrFwd( *( pAttr = rHtArr.GetStart( nPos )) ) )
{
// Do multiple start at that position? Do also check those:
- nSttPos = *pAttr->GetStart();
+ nSttPos = pAttr->GetStart();
while( ++nPos < rHtArr.Count() && nSttPos ==
- *( pAttr = rHtArr.GetStart( nPos ))->GetStart() &&
+ ( pAttr = rHtArr.GetStart( nPos ))->GetStart() &&
rCmpArr.SetAttrFwd( *pAttr ) )
;
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 8b0b33cbf51b..b8e2b470dfb3 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -66,7 +66,7 @@ lcl_CleanStr(const SwTxtNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd,
{
if ( bNewHint )
nHintStart = pHts && n < pHts->Count() ?
- *(*pHts)[n]->GetStart() :
+ (*pHts)[n]->GetStart() :
-1;
if ( bNewSoftHyphen )
@@ -269,7 +269,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
const SwTxtAttr* pTxtAttr = (*pHts)[i];
if ( pTxtAttr->Which()==RES_TXTATR_ANNOTATION )
{
- const sal_Int32 aPos = *pTxtAttr->GetStart();
+ const sal_Int32 aPos = pTxtAttr->GetStart();
if ( (aPos >= nStart) && (aPos <= nEnd) )
aNumberPostits++;
else
@@ -328,14 +328,14 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
{
if (bSrchForward)
{
- nStartInside = aLoop==0 ? nStart : *(*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
- nEndInside = aLoop==aNumberPostits ? nEnd : *(*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
+ nStartInside = aLoop==0 ? nStart : (*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
+ nEndInside = aLoop==aNumberPostits ? nEnd : (*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
nTxtLen = nEndInside - nStartInside;
}
else
{
- nStartInside = aLoop==aNumberPostits ? nStart : *(*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
- nEndInside = aLoop==0 ? nEnd : *(*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
+ nStartInside = aLoop==aNumberPostits ? nStart : (*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
+ nEndInside = aLoop==0 ? nEnd : (*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
nTxtLen = nStartInside - nEndInside;
}
// search inside the text between a note
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 36c0aa2fcac0..1b3801f9a657 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1072,9 +1072,9 @@ OUString SwPaM::GetTxt() const
void SwPaM::InvalidatePaM()
{
- const SwNode *_pNd=this->GetNode();
- const SwTxtNode *_pTxtNd=(_pNd!=NULL?_pNd->GetTxtNode():NULL);
- if (_pTxtNd!=NULL)
+ const SwNode &_pNd = this->GetNode();
+ const SwTxtNode *_pTxtNd = _pNd.GetTxtNode();
+ if (_pTxtNd != NULL)
{
// pretend that the PaM marks inserted text to recalc the portion...
SwInsTxt aHint( Start()->nContent.GetIndex(),
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b2b6dde7b37c..c93bfc77326a 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -447,14 +447,14 @@ bool SwCursor::IsSelOvr( int eFlags )
if ( pInputFldTxtAttrAtPoint != NULL )
{
const sal_Int32 nNewPointPos =
- bIsForwardSelection ? *(pInputFldTxtAttrAtPoint->End()) : *(pInputFldTxtAttrAtPoint->GetStart());
+ bIsForwardSelection ? *(pInputFldTxtAttrAtPoint->End()) : pInputFldTxtAttrAtPoint->GetStart();
GetPoint()->nContent.Assign( pTxtNdAtPoint, nNewPointPos );
}
if ( pInputFldTxtAttrAtMark != NULL )
{
const sal_Int32 nNewMarkPos =
- bIsForwardSelection ? *(pInputFldTxtAttrAtMark->GetStart()) : *(pInputFldTxtAttrAtMark->End());
+ bIsForwardSelection ? pInputFldTxtAttrAtMark->GetStart() : *(pInputFldTxtAttrAtMark->End());
GetMark()->nContent.Assign( pTxtNdAtMark, nNewMarkPos );
}
}
@@ -492,7 +492,7 @@ bool SwCursor::IsSelOvr( int eFlags )
nSttEndTbl = rNds[ nSEIdx ]->StartOfSectionIndex() - 1;
GetPoint()->nNode = nSttEndTbl;
- const SwNode* pMyNd = GetNode();
+ const SwNode* pMyNd = &(GetNode());
if( pMyNd->IsSectionNode() || ( pMyNd->IsEndNode() &&
pMyNd->StartOfSectionNode()->IsSectionNode() ) )
@@ -592,7 +592,7 @@ bool SwCursor::IsInProtectTable( bool bMove, bool bChgCrsr )
// search next valid box
// if there is another StartNode after the EndNode of a cell then
// there is another cell
- SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
+ SwNodeIndex aCellStt( *GetNode().FindTableBoxStartNode()->EndOfSectionNode(), 1 );
bool bProt = true;
GoNextCell:
do {
@@ -640,7 +640,7 @@ SetNextCrsr:
{
// if there is another EndNode in front of the StartNode than there
// exists a previous cell
- SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode(), -1 );
+ SwNodeIndex aCellStt( *GetNode().FindTableBoxStartNode(), -1 );
SwNode* pNd;
bool bProt = true;
GoPrevCell:
@@ -1163,7 +1163,7 @@ bool SwCursor::SelectWord( SwViewShell* pViewShell, const Point* pPt )
bool SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex();
@@ -1178,7 +1178,7 @@ bool SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
bool SwCursor::IsEndWordWT( sal_Int16 nWordType ) const
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex();
@@ -1194,7 +1194,7 @@ bool SwCursor::IsEndWordWT( sal_Int16 nWordType ) const
bool SwCursor::IsInWordWT( sal_Int16 nWordType ) const
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex();
@@ -1235,7 +1235,7 @@ bool SwCursor::IsStartEndSentence( bool bEnd ) const
bool SwCursor::GoStartWordWT( sal_Int16 nWordType )
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
SwCrsrSaveState aSave( *this );
@@ -1259,7 +1259,7 @@ bool SwCursor::GoStartWordWT( sal_Int16 nWordType )
bool SwCursor::GoEndWordWT( sal_Int16 nWordType )
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
SwCrsrSaveState aSave( *this );
@@ -1284,7 +1284,7 @@ bool SwCursor::GoEndWordWT( sal_Int16 nWordType )
bool SwCursor::GoNextWordWT( sal_Int16 nWordType )
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
SwCrsrSaveState aSave( *this );
@@ -1308,7 +1308,7 @@ bool SwCursor::GoNextWordWT( sal_Int16 nWordType )
bool SwCursor::GoPrevWordWT( sal_Int16 nWordType )
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
SwCrsrSaveState aSave( *this );
@@ -1347,7 +1347,7 @@ bool SwCursor::SelectWordWT( SwViewShell* pViewShell, sal_Int16 nWordType, const
pLayout->GetCrsrOfst( GetPoint(), aPt );
}
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
// Should we select the whole fieldmark?
@@ -1438,7 +1438,7 @@ static OUString lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd )
bool SwCursor::GoSentence( SentenceMoveType eMoveType )
{
bool bRet = false;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetNode().GetTxtNode();
if( pTxtNd && g_pBreakIt->GetBreakIter().is() )
{
OUString sNodeText( lcl_MaskDeletedRedlines( pTxtNd ) );
@@ -1758,8 +1758,8 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
// If the point/mark of the table cursor in the same box then set cursor to
// beginning of the box
- if( pTblCrsr && GetNode( true )->StartOfSectionNode() ==
- GetNode( false )->StartOfSectionNode() )
+ if( pTblCrsr && GetNode( true ).StartOfSectionNode() ==
+ GetNode( false ).StartOfSectionNode() )
{
if ( End() != GetPoint() )
Exchange();
@@ -1798,7 +1798,7 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
// than one paragraph. If we want to go down, we have to set the
// point to the last frame in the table box. This is only necessary
// if we do not already have a table selection
- const SwStartNode* pTblNd = GetNode( true )->FindTableBoxStartNode();
+ const SwStartNode* pTblNd = GetNode( true ).FindTableBoxStartNode();
OSL_ENSURE( pTblNd, "pTblCrsr without SwTableNode?" );
if ( pTblNd ) // safety first
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index a26fe9d19044..dc220d9eae3d 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -124,7 +124,7 @@ bool SwCrsrShell::GotoFtnTxt()
bool SwCursor::GotoFtnAnchor()
{
// jump from footnote to anchor
- const SwNode* pSttNd = GetNode()->FindFootnoteStartNode();
+ const SwNode* pSttNd = GetNode().FindFootnoteStartNode();
if( pSttNd )
{
// search in all footnotes in document for this StartIndex
@@ -138,7 +138,7 @@ bool SwCursor::GotoFtnAnchor()
SwTxtNode& rTNd = (SwTxtNode&)pTxtFtn->GetTxtNode();
GetPoint()->nNode = rTNd;
- GetPoint()->nContent.Assign( &rTNd, *pTxtFtn->GetStart() );
+ GetPoint()->nContent.Assign( &rTNd, pTxtFtn->GetStart() );
return !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE );
@@ -165,13 +165,13 @@ bool SwCrsrShell::GotoFtnAnchor()
inline bool CmpLE( const SwTxtFtn& rFtn, sal_uLong nNd, sal_Int32 nCnt )
{
const sal_uLong nTNd = rFtn.GetTxtNode().GetIndex();
- return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() <= nCnt );
+ return nTNd < nNd || ( nTNd == nNd && rFtn.GetStart() <= nCnt );
}
inline bool CmpL( const SwTxtFtn& rFtn, sal_uLong nNd, sal_Int32 nCnt )
{
const sal_uLong nTNd = rFtn.GetTxtNode().GetIndex();
- return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() < nCnt );
+ return nTNd < nNd || ( nTNd == nNd && rFtn.GetStart() < nCnt );
}
bool SwCursor::GotoNextFtnAnchor()
@@ -227,7 +227,7 @@ bool SwCursor::GotoNextFtnAnchor()
SwTxtNode& rTNd = (SwTxtNode&)pTxtFtn->GetTxtNode();
GetPoint()->nNode = rTNd;
- GetPoint()->nContent.Assign( &rTNd, *pTxtFtn->GetStart() );
+ GetPoint()->nContent.Assign( &rTNd, pTxtFtn->GetStart() );
bRet = !IsSelOvr();
}
return bRet;
@@ -284,7 +284,7 @@ bool SwCursor::GotoPrevFtnAnchor()
SwTxtNode& rTNd = (SwTxtNode&)pTxtFtn->GetTxtNode();
GetPoint()->nNode = rTNd;
- GetPoint()->nContent.Assign( &rTNd, *pTxtFtn->GetStart() );
+ GetPoint()->nContent.Assign( &rTNd, pTxtFtn->GetStart() );
bRet = !IsSelOvr();
}
return bRet;
diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx
index d5b8f231e950..92f37ab8cf2b 100644
--- a/sw/source/core/crsr/trvlreg.cxx
+++ b/sw/source/core/crsr/trvlreg.cxx
@@ -138,7 +138,7 @@ bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
bool GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
bool bInReadOnly )
{
- SwSectionNode* pNd = rCurCrsr.GetNode()->FindSectionNode();
+ SwSectionNode* pNd = rCurCrsr.GetNode().FindSectionNode();
if( !pNd )
return false;
@@ -168,8 +168,8 @@ bool GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
bool bInReadOnly )
{
- SwNode* pCurrNd = rCurCrsr.GetNode();
- SwSectionNode* pNd = pCurrNd->FindSectionNode();
+ SwNode& rCurrNd = rCurCrsr.GetNode();
+ SwSectionNode* pNd = rCurrNd.FindSectionNode();
if( !pNd )
return false;
@@ -198,7 +198,7 @@ bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
pPos->nContent.Assign( pCNd, bMoveBackward ? pCNd->Len() : 0 );
- if( &pPos->nNode.GetNode() != pCurrNd ||
+ if( &pPos->nNode.GetNode() != &rCurrNd ||
pPos->nContent.GetIndex() != nCurrCnt )
// there was a change
return true;
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 5d7a647ba3b2..080521648e11 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -53,7 +53,7 @@ bool SwCrsrShell::GoNextCell( bool bAppendLine )
// Check if we have to move the cursor to a covered cell before
// proceeding:
- const SwNode* pTableBoxStartNode = pCrsr->GetNode()->FindTableBoxStartNode();
+ const SwNode* pTableBoxStartNode = pCrsr->GetNode().FindTableBoxStartNode();
const SwTableBox* pTableBox = 0;
if ( pCrsr->GetCrsrRowSpanOffset() )
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 8dfc31213479..b81dde872449 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -364,7 +364,7 @@ void SwSelPaintRects::HighlightInputFld()
{
SwTxtNode* pTxtNode = pCurTxtInputFldAtCrsr->GetpTxtNode();
::boost::scoped_ptr<SwShellCrsr> pCrsrForInputTxtFld(
- new SwShellCrsr( *GetShell(), SwPosition( *pTxtNode, *(pCurTxtInputFldAtCrsr->GetStart()) ) ) );
+ new SwShellCrsr( *GetShell(), SwPosition( *pTxtNode, pCurTxtInputFldAtCrsr->GetStart() ) ) );
pCrsrForInputTxtFld->SetMark();
pCrsrForInputTxtFld->GetMark()->nNode = *pTxtNode;
pCrsrForInputTxtFld->GetMark()->nContent.Assign( pTxtNode, *(pCurTxtInputFldAtCrsr->End()) );
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 070aaea7a71a..824ac667cb41 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -301,7 +301,7 @@ static const OUString lcl_dbg_out(const SwTxtAttr & rAttr)
{
OUString aStr("[ ");
- aStr += OUString::number(*rAttr.GetStart());
+ aStr += OUString::number(rAttr.GetStart());
aStr += "->";
aStr += OUString::number(*rAttr.End());
aStr += " ";
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index effc0bdbef31..289b13fcfef3 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1988,12 +1988,12 @@ bool SwDoc::ConvertFieldsToText()
sText = "";
//now remove the field and insert the string
- SwPaM aPam1(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart());
+ SwPaM aPam1(*pTxtFld->GetpTxtNode(), pTxtFld->GetStart());
aPam1.Move();
//insert first to keep the field's attributes
if (!sText.isEmpty())
InsertString( aPam1, sText );
- SwPaM aPam2(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart());
+ SwPaM aPam2(*pTxtFld->GetpTxtNode(), pTxtFld->GetStart());
aPam2.SetMark();
aPam2.Move();
DeleteAndJoin(aPam2);//remove the field
@@ -2154,9 +2154,9 @@ void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew)
OUString SwDoc::GetPaMDescr(const SwPaM & rPam) const
{
- if (rPam.GetNode(true) == rPam.GetNode(false))
+ if (&rPam.GetNode(true) == &rPam.GetNode(false))
{
- SwTxtNode * pTxtNode = rPam.GetNode(true)->GetTxtNode();
+ SwTxtNode * pTxtNode = rPam.GetNode(true).GetTxtNode();
if (0 != pTxtNode)
{
@@ -2170,13 +2170,9 @@ OUString SwDoc::GetPaMDescr(const SwPaM & rPam) const
+ SW_RESSTR(STR_END_QUOTE);
}
}
- else if (0 != rPam.GetNode(true))
+ else
{
- if (0 != rPam.GetNode(false))
- {
- return SW_RESSTR(STR_PARAGRAPHS);
- }
- return OUString();
+ return SW_RESSTR(STR_PARAGRAPHS);
}
return OUString("??");
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 2ce11ac1752b..24c2761873ee 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -356,7 +356,7 @@ static bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
&( pSrch = rFtnArr[ nPos ] )->GetTxtNode())->GetIndex()
<= rEndNd.GetIndex() )
{
- const sal_Int32 nFtnSttIdx = *pSrch->GetStart();
+ const sal_Int32 nFtnSttIdx = pSrch->GetStart();
if( ( pEndCnt && pSttCnt )
? (( &rSttNd.GetNode() == pFtnNd &&
pSttCnt->GetIndex() > nFtnSttIdx) ||
@@ -389,7 +389,7 @@ static bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
while( nPos-- && ( pFtnNd = &( pSrch = rFtnArr[ nPos ] )->
GetTxtNode())->GetIndex() >= rSttNd.GetIndex() )
{
- const sal_Int32 nFtnSttIdx = *pSrch->GetStart();
+ const sal_Int32 nFtnSttIdx = pSrch->GetStart();
if( !pEndCnt || !pSttCnt ||
!( (( &rSttNd.GetNode() == pFtnNd &&
pSttCnt->GetIndex() > nFtnSttIdx ) ||
@@ -449,7 +449,7 @@ static bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
static void lcl_SaveRedlines( const SwPaM& aPam, _SaveRedlines& rArr )
{
- SwDoc* pDoc = aPam.GetNode()->GetDoc();
+ SwDoc* pDoc = aPam.GetNode().GetDoc();
const SwPosition* pStart = aPam.Start();
const SwPosition* pEnd = aPam.End();
@@ -964,7 +964,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
*aSavePam.GetMark() = rPos;
rPaM.SetMark(); // create a Sel. around the new range
- pTNd = aSavePam.GetNode()->GetTxtNode();
+ pTNd = aSavePam.GetNode().GetTxtNode();
if (GetIDocumentUndoRedo().DoesUndo())
{
// correct the SavePam's Content first
@@ -983,7 +983,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// If it's not possible to call Undo JoinNext here.
bool bJoin = bSplit && pTNd;
bCorrSavePam = bCorrSavePam &&
- 0 != ( pPamTxtNd = rPaM.GetNode()->GetTxtNode() )
+ 0 != ( pPamTxtNd = rPaM.GetNode().GetTxtNode() )
&& pPamTxtNd->CanJoinNext()
&& (*rPaM.GetPoint() <= *aSavePam.GetPoint());
@@ -1595,12 +1595,12 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
for( sal_uInt16 n = pHts->Count(); n; )
{
const SwTxtAttr* pAttr = (*pHts)[ --n ];
- if( nMkCntPos > *pAttr->GetStart() )
+ if( nMkCntPos > pAttr->GetStart() )
break;
- if( nMkCntPos == *pAttr->GetStart() &&
+ if( nMkCntPos == pAttr->GetStart() &&
0 != (pEndIdx = pAttr->End()) &&
- *pEndIdx == *pAttr->GetStart() )
+ *pEndIdx == pAttr->GetStart() )
pTxtNd->DestroyAttr( pHts->Cut( n ) );
}
}
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 2c032717935a..9832b23912f7 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -726,7 +726,7 @@ _SetGetExpFld::_SetGetExpFld(
if( pIdx )
nCntnt = pIdx->GetIndex();
else if( pFld )
- nCntnt = *pFld->GetStart();
+ nCntnt = pFld->GetStart();
else
nCntnt = 0;
}
@@ -740,7 +740,7 @@ _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx,
if( pIdx )
nCntnt = pIdx->GetIndex();
else
- nCntnt = *rINet.GetStart();
+ nCntnt = rINet.GetStart();
}
// Extension for Sections:
@@ -798,7 +798,7 @@ _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx,
if( pIdx )
nCntnt = pIdx->GetIndex();
else
- nCntnt = *rTOX.GetStart();
+ nCntnt = rTOX.GetStart();
}
_SetGetExpFld::_SetGetExpFld( const SwPosition& rPos )
@@ -972,7 +972,7 @@ sal_Int32 _SetGetExpFld::GetCntPosFromCntnt() const
case TEXTFIELD:
case TEXTINET:
case TEXTTOXMARK:
- nRet = *CNTNT.pTxtFld->GetStart();
+ nRet = CNTNT.pTxtFld->GetStart();
break;
case CRSRPOS:
nRet = CNTNT.pPos->nContent.GetIndex();
@@ -2646,7 +2646,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
if (GetIDocumentUndoRedo().DoesUndo())
{
SwPosition aPosition( pDstTxtFld->GetTxtNode() );
- aPosition.nContent = *pDstTxtFld->GetStart();
+ aPosition.nContent = pDstTxtFld->GetStart();
SwUndo *const pUndo( new SwUndoFieldFromDoc( aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
GetIDocumentUndoRedo().AppendUndo(pUndo);
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 8f1f9762ab3c..39515aefa85f 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -331,7 +331,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
pTxtNd->GetTxtAttrAt(rSt.GetIndex(), RES_TXTATR_INETFMT));
if (pURLAttr && !pURLAttr->GetINetFmt().GetValue().isEmpty())
{
- nMkPos = *pURLAttr->GetStart();
+ nMkPos = pURLAttr->GetStart();
nPtPos = *pURLAttr->End();
}
else
@@ -789,7 +789,7 @@ static bool lcl_InsAttr(
pTxtNd->GetTxtAttrAt(rSt.GetIndex(), RES_TXTATR_INETFMT));
if (pURLAttr && !pURLAttr->GetINetFmt().GetValue().isEmpty())
{
- nMkPos = *pURLAttr->GetStart();
+ nMkPos = pURLAttr->GetStart();
nPtPos = *pURLAttr->End();
}
else
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index be8be9a23921..54f0469fa010 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -412,9 +412,9 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const OUString& rNumStr,
while( nPos < rFtnArr.size() &&
(( nIdx = _SwTxtFtn_GetIndex((pTxtFtn = rFtnArr[ nPos++ ] )))
< nEndNd || ( nIdx == nEndNd &&
- nEndCnt >= *pTxtFtn->GetStart() )) )
+ nEndCnt >= pTxtFtn->GetStart() )) )
if( nIdx > nSttNd || ( nIdx == nSttNd &&
- nSttCnt <= *pTxtFtn->GetStart() ) )
+ nSttCnt <= pTxtFtn->GetStart() ) )
{
const SwFmtFtn& rFtn = pTxtFtn->GetFtn();
if( rFtn.GetNumStr() != rNumStr ||
@@ -443,9 +443,9 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const OUString& rNumStr,
while( nPos &&
(( nIdx = _SwTxtFtn_GetIndex((pTxtFtn = rFtnArr[ --nPos ] )))
> nSttNd || ( nIdx == nSttNd &&
- nSttCnt <= *pTxtFtn->GetStart() )) )
+ nSttCnt <= pTxtFtn->GetStart() )) )
if( nIdx < nEndNd || ( nIdx == nEndNd &&
- nEndCnt >= *pTxtFtn->GetStart() ) )
+ nEndCnt >= pTxtFtn->GetStart() ) )
{
const SwFmtFtn& rFtn = pTxtFtn->GetFtn();
if( rFtn.GetNumStr() != rNumStr ||
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 9db67c3ba8cd..52c62633ee08 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -908,7 +908,7 @@ SwDrawFrmFmt* SwDoc::InsertDrawObj(
eAnchorId = aAnch.GetAnchorId();
if ( eAnchorId == FLY_AT_FLY )
{
- SwPosition aPos( *rRg.GetNode()->FindFlyStartNode() );
+ SwPosition aPos( *rRg.GetNode().FindFlyStartNode() );
aAnch.SetAnchor( &aPos );
}
else
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index 1f7126910847..b8f264a82da0 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -214,12 +214,12 @@ bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_uInt
if( RES_TXTATR_CJK_RUBY == ( pHt = (*pHts)[ nHtIdx ])->Which() &&
*pHt->GetAnyEnd() > nStart )
{
- if( *pHt->GetStart() < nEnd )
+ if( pHt->GetStart() < nEnd )
{
pAttr = pHt;
- if( !bHasMark && nStart > *pAttr->GetStart() )
+ if( !bHasMark && nStart > pAttr->GetStart() )
{
- nStart = *pAttr->GetStart();
+ nStart = pAttr->GetStart();
pPos->nContent = nStart;
}
}
@@ -227,7 +227,7 @@ bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_uInt
}
}
- if( !bHasMark && nStart && ( !pAttr || nStart != *pAttr->GetStart()) )
+ if( !bHasMark && nStart && ( !pAttr || nStart != pAttr->GetStart()) )
{
// skip to the word begin!
const sal_Int32 nWordStt = g_pBreakIt->GetBreakIter()->getWordBoundary(
@@ -247,7 +247,7 @@ bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_uInt
CharClass& rCC = GetAppCharClass();
while( nStart < nEnd )
{
- if( pAttr && nStart == *pAttr->GetStart() )
+ if( pAttr && nStart == pAttr->GetStart() )
{
pPos->nContent = nStart;
if( !rPam.HasMark() )
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 3a80426ef4f0..d98edcac5f5a 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -123,7 +123,7 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
{
if( RES_TXTATR_TOXMARK != (pHt = rHts[n])->Which() )
continue;
- if( ( nSttIdx = *pHt->GetStart() ) < nAktPos )
+ if( ( nSttIdx = pHt->GetStart() ) < nAktPos )
{
// also check the end
if( 0 == ( pEndIdx = pHt->End() ) ||
@@ -154,7 +154,7 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
{
// save attributes for Undo
SwUndoResetAttr* pUndo = new SwUndoResetAttr(
- SwPosition( rTxtNd, SwIndex( &rTxtNd, *pTxtTOXMark->GetStart() ) ),
+ SwPosition( rTxtNd, SwIndex( &rTxtNd, pTxtTOXMark->GetStart() ) ),
RES_TXTATR_TOXMARK );
GetIDocumentUndoRedo().AppendUndo( pUndo );
@@ -207,7 +207,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
const SwTxtNode *pTOXSrc = pMark->GetpTxtNd();
- CompareNodeCntnt aAbsIdx( pTOXSrc->GetIndex(), *pMark->GetStart() );
+ CompareNodeCntnt aAbsIdx( pTOXSrc->GetIndex(), pMark->GetStart() );
CompareNodeCntnt aPrevPos( 0, 0 );
CompareNodeCntnt aNextPos( ULONG_MAX, SAL_MAX_INT32 );
CompareNodeCntnt aMax( 0, 0 );
@@ -242,7 +242,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
if ( bInReadOnly || !pCFrm->IsProtected() )
{
- CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), *pMark->GetStart() );
+ CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), pMark->GetStart() );
switch( eDir )
{
// The following (a bit more complicated) statements make it
@@ -1150,7 +1150,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
pTOXSrc->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
(!IsFromChapter() || ::lcl_FindChapterNode( *pTOXSrc, 0 ) == pOwnChapterNode ) &&
!pTOXSrc->HasHiddenParaField() &&
- !SwScriptInfo::IsInHiddenRange( *pTOXSrc, *pTxtMark->GetStart() ) )
+ !SwScriptInfo::IsInHiddenRange( *pTOXSrc, pTxtMark->GetStart() ) )
{
SwTOXSortTabBase* pBase = 0;
if(TOX_INDEX == eTOXTyp)
@@ -1160,7 +1160,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
if ( g_pBreakIt->GetBreakIter().is() )
{
aLocale = g_pBreakIt->GetLocale(
- pTOXSrc->GetLang( *pTxtMark->GetStart() ) );
+ pTOXSrc->GetLang( pTxtMark->GetStart() ) );
}
pBase = new SwTOXIndex( *pTOXSrc, pTxtMark,
@@ -1292,7 +1292,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
}
else if(GetCaptionDisplay() == CAPTION_NUMBER)
{
- pNew->SetEndIndex(*pTxtFld->GetStart() + 1);
+ pNew->SetEndIndex(pTxtFld->GetStart() + 1);
}
InsertSorted(pNew);
}
@@ -1696,7 +1696,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
{
SwTxtAttr* pAttr = pHints->GetStart(nHintIdx);
const sal_Int32 nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
- if( nStartPos >= *pAttr->GetStart() &&
+ if( nStartPos >= pAttr->GetStart() &&
(nStartPos + 2) <= nTmpEnd &&
pAttr->Which() == RES_TXTATR_CHARFMT)
{
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 428ddad5b44e..2d63872af828 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -32,7 +32,7 @@ bool CompareSwFtnIdxs::operator()(SwTxtFtn* const& lhs, SwTxtFtn* const& rhs) co
{
sal_uLong nIdxLHS = _SwTxtFtn_GetIndex( lhs );
sal_uLong nIdxRHS = _SwTxtFtn_GetIndex( rhs );
- return ( nIdxLHS == nIdxRHS && *lhs->GetStart() < *rhs->GetStart() ) || nIdxLHS < nIdxRHS;
+ return ( nIdxLHS == nIdxRHS && lhs->GetStart() < rhs->GetStart() ) || nIdxLHS < nIdxRHS;
}
void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 70f3ef8b857b..8e6bfd5b152c 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -76,7 +76,7 @@ void SwTextBoxHelper::create(SwFrmFmt* pShape)
if (sw::XTextRangeToSwPaM(aInternalPaM, xTextBox))
{
SwAttrSet aSet(pShape->GetAttrSet());
- SwFmtCntnt aCntnt(aInternalPaM.GetNode()->StartOfSectionNode());
+ SwFmtCntnt aCntnt(aInternalPaM.GetNode().StartOfSectionNode());
aSet.Put(aCntnt);
pShape->SetFmtAttr(aSet);
}
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 4c08fd7dba30..db255aee7805 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -77,7 +77,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
}
const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
const SwTxtAttr* pAttr = pTxtAttr;
- SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
+ SwUpdateAttr aUpdateAttr( pAttr->GetStart(),
*pAttr->End(),
RES_FMT_CHG );
((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index fd9f0137e907..55759345356d 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -754,7 +754,7 @@ SwDoc::CopyRange( SwPaM& rPam, SwPosition& rPos, const bool bCopyAll ) const
pDoc->GetNodes().GoPrevious( &aPam.GetMark()->nNode );
pNode->MakeEndIndex( &aPam.GetMark()->nContent );
- aPam.GetPoint()->nNode = *aPam.GetNode()->StartOfSectionNode();
+ aPam.GetPoint()->nNode = *aPam.GetNode().StartOfSectionNode();
pNode = pDoc->GetNodes().GoNext( &aPam.GetPoint()->nNode );
pNode->MakeStartIndex( &aPam.GetPoint()->nContent );
// move to desired position
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index fad6ee095773..ec985559728a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1802,7 +1802,7 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor )
// - when there's another Line, we place it in that one
// - when a Line preceeds it, we place it in that one
{
- SwTableNode* pTblNd = rCursor.GetNode()->FindTableNode();
+ SwTableNode* pTblNd = rCursor.GetNode().FindTableNode();
if( pTblNd->GetTable().ISA( SwDDETable ))
return false;
@@ -1905,7 +1905,7 @@ bool SwDoc::DeleteCol( const SwCursor& rCursor )
SwEditShell* pESh = GetEditShell();
if( pESh )
{
- const SwNode* pNd = rCursor.GetNode()->FindTableBoxStartNode();
+ const SwNode* pNd = rCursor.GetNode().FindTableBoxStartNode();
pESh->ParkCrsr( SwNodeIndex( *pNd ) );
}
@@ -2196,7 +2196,7 @@ bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt,
sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam )
{
// Check if the current cursor's Point/Mark are inside a Table
- SwTableNode* pTblNd = rPam.GetNode()->FindTableNode();
+ SwTableNode* pTblNd = rPam.GetNode().FindTableNode();
if( !pTblNd )
return TBLMERGE_NOSELECTION;
SwTable& rTable = pTblNd->GetTable();
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index aa267de1e22c..038281f3f400 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -129,7 +129,7 @@ static bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
{
const SwPaM *pCurPam = &rCursor, *pSttPam = pCurPam;
do {
- const SwNode* pNd = pCurPam->GetNode()->FindTableBoxStartNode();
+ const SwNode* pNd = pCurPam->GetNode().FindTableBoxStartNode();
if( pNd )
{
SwTableBox* pBox = (SwTableBox*)pNd->FindTableNode()->GetTable().
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index 6a04f88d83f2..8f80d9180bfb 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -217,7 +217,7 @@ SwFrm* SwNode2LayImpl::NextFrm()
{
while( pFlow->HasFollow() )
pFlow = pFlow->GetFollow();
- pRet = pFlow->GetFrm();
+ pRet = &(pFlow->GetFrm());
}
if( pRet->IsInSct() )
{
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 743d749dae32..3c1b3c1c9833 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -710,7 +710,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
SwTxtAttr* pHint = rHints.GetTextHint(i);
if (pHint->GetStart())
- writer.writeFormatAttribute("start", TMP_FORMAT, *pHint->GetStart());
+ writer.writeFormatAttribute("start", TMP_FORMAT, pHint->GetStart());
if (pHint->GetEnd())
writer.writeFormatAttribute("end", TMP_FORMAT, *pHint->GetEnd());
writer.writeFormatAttribute("whichId", TMP_FORMAT, pHint->Which());
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 11ffaf829f30..1734bb462572 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -692,7 +692,7 @@ const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj
{
if ( _pSdrObj->ISA(SwDrawVirtObj) )
{
- pRetAnchoredObj = static_cast<const SwDrawVirtObj*>(_pSdrObj)->GetAnchoredObj();
+ pRetAnchoredObj = &(static_cast<const SwDrawVirtObj*>(_pSdrObj)->GetAnchoredObj());
}
else if ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) )
{
@@ -725,7 +725,7 @@ SwAnchoredObject* SwDrawContact::GetAnchoredObj( SdrObject* _pSdrObj )
{
if ( _pSdrObj->ISA(SwDrawVirtObj) )
{
- pRetAnchoredObj = static_cast<SwDrawVirtObj*>(_pSdrObj)->AnchoredObj();
+ pRetAnchoredObj = &(static_cast<SwDrawVirtObj*>(_pSdrObj)->AnchoredObj());
}
else if ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) )
{
@@ -976,7 +976,7 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
if ( pDrawVirtObj->GetAnchorFrm() )
{
// #i34640# - determine correct page frame
- SwPageFrm* pPage = pDrawVirtObj->AnchoredObj()->FindPageFrmOfAnchor();
+ SwPageFrm* pPage = pDrawVirtObj->AnchoredObj().FindPageFrmOfAnchor();
if( pOldBoundRect && pPage )
{
SwRect aOldRect( *pOldBoundRect );
@@ -986,7 +986,7 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
aOldRect, PREP_FLY_LEAVE,true);
}
// #i34640# - include spacing for wrapping
- SwRect aRect( pDrawVirtObj->GetAnchoredObj()->GetObjRectWithSpaces() );
+ SwRect aRect( pDrawVirtObj->GetAnchoredObj().GetObjRectWithSpaces() );
if (aRect.HasArea() && pPage)
{
SwPageFrm* pPg = (SwPageFrm*)::FindPage( aRect, pPage );
@@ -1568,11 +1568,11 @@ void SwDrawContact::_InvalidateObjs( const bool _bUpdateSortedObjsList )
// 'virtual' drawing objects
if ( pDrawVirtObj->IsConnected() )
{
- pDrawVirtObj->AnchoredObj()->InvalidateObjPos();
+ pDrawVirtObj->AnchoredObj().InvalidateObjPos();
// #i28701#
if ( _bUpdateSortedObjsList )
{
- pDrawVirtObj->AnchoredObj()->UpdateObjInSortedList();
+ pDrawVirtObj->AnchoredObj().UpdateObjInSortedList();
}
}
}
@@ -1869,7 +1869,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
{
ClrContourCache( pDrawVirtObj );
}
- pFrm->AppendDrawObj( *(pDrawVirtObj->AnchoredObj()) );
+ pFrm->AppendDrawObj( pDrawVirtObj->AnchoredObj() );
pDrawVirtObj->ActionChanged();
}
@@ -1976,7 +1976,7 @@ void SwDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredOb
aDrawVirtObjsIter != maDrawVirtObjs.end();
++aDrawVirtObjsIter )
{
- _roAnchoredObjs.push_back( (*aDrawVirtObjsIter)->AnchoredObj() );
+ _roAnchoredObjs.push_back( &(*aDrawVirtObjsIter)->AnchoredObj() );
}
}
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 20ee723f6eb9..6e836f4e919a 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -153,7 +153,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const
pPam->GetPoint()->nContent = nPos;
}
- SwTxtNode * const pNd = pPam->GetNode()->GetTxtNode();
+ SwTxtNode * const pNd = pPam->GetNode().GetTxtNode();
if ( !pNd )
{
return false;
@@ -303,7 +303,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos,
// Found a beginning of a paragraph or a Blank,
// search for the word Kuerzel (Shortcut) in the Auto
- SwTxtNode* pTxtNd = rCrsr.GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = rCrsr.GetNode().GetTxtNode();
OSL_ENSURE( pTxtNd, "where is the TextNode?" );
bool bRet = false;
@@ -491,7 +491,7 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos )
for( n = 0; n < nSize; ++n )
{
SwTxtAttr* pHt = pTxtNd->GetpSwpHints()->GetTextHint( n );
- nAttrStart = *pHt->GetStart();
+ nAttrStart = pHt->GetStart();
if( nAttrStart > nStart ) // beyond the area
break;
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index c39acfccd88b..dafa0a939ade 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1115,7 +1115,7 @@ bool SwAutoFormat::DeleteCurNxtPara( const OUString& rNxtPara )
m_aDelPam.SetMark();
m_aDelPam.GetPoint()->nNode++;
- SwTxtNode* pTNd = m_aDelPam.GetNode()->GetTxtNode();
+ SwTxtNode* pTNd = m_aDelPam.GetNode().GetTxtNode();
if( !pTNd )
{
// then delete only up to end of the paragraph
@@ -1148,7 +1148,7 @@ void SwAutoFormat::DelEmptyLine( bool bTstNextPara )
m_aDelPam.SetMark();
m_aDelPam.GetMark()->nNode--;
- SwTxtNode* pTNd = m_aDelPam.GetNode( false )->GetTxtNode();
+ SwTxtNode* pTNd = m_aDelPam.GetNode( false ).GetTxtNode();
if( pTNd )
// first use the previous text node
m_aDelPam.GetMark()->nContent.Assign(pTNd, pTNd->GetTxt().getLength());
@@ -1156,7 +1156,7 @@ void SwAutoFormat::DelEmptyLine( bool bTstNextPara )
{
// then try the next (at the beginning of a Doc, table cells, borders, ...)
m_aDelPam.GetMark()->nNode += 2;
- pTNd = m_aDelPam.GetNode( false )->GetTxtNode();
+ pTNd = m_aDelPam.GetNode( false ).GetTxtNode();
if( pTNd )
{
m_aDelPam.GetMark()->nContent.Assign( pTNd, 0 );
@@ -1221,7 +1221,7 @@ void SwAutoFormat::DelPrevPara()
m_aDelPam.SetMark();
m_aDelPam.GetPoint()->nNode--;
- SwTxtNode* pTNd = m_aDelPam.GetNode()->GetTxtNode();
+ SwTxtNode* pTNd = m_aDelPam.GetNode().GetTxtNode();
if( pTNd )
{
// use the previous text node first
@@ -1571,7 +1571,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
{
m_aDelPam.SetMark();
m_aDelPam.GetMark()->nNode++;
- m_aDelPam.GetNode(false)->GetTxtNode()->SetAttrListLevel( nLvl );
+ m_aDelPam.GetNode(false).GetTxtNode()->SetAttrListLevel( nLvl );
}
m_pCurTxtNd->SetAttrListLevel(nLvl);
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 0e52b380075e..1c0ac183b1b5 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -285,7 +285,7 @@ bool SwEditShell::GetCurFtn( SwFmtFtn* pFillFtn )
{
// The cursor must be positioned on the current footnotes anchor:
SwPaM* pCrsr = GetCrsr();
- SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode();
if( !pTxtNd )
return false;
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 47614f2c925b..854d31357b34 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -45,9 +45,9 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo )
// 1. Point and Mark are in one box, delete selection as usual
// 2. Point and Mark are in different boxes, search all selected boxes and delete content
// 3. Point and Mark are at the document start and end, Point is in a table: delete selection as usual
- if( rPam.GetNode()->FindTableNode() &&
- rPam.GetNode()->StartOfSectionNode() !=
- rPam.GetNode(false)->StartOfSectionNode() && !bSelectAll )
+ if( rPam.GetNode().FindTableNode() &&
+ rPam.GetNode().StartOfSectionNode() !=
+ rPam.GetNode(false).StartOfSectionNode() && !bSelectAll )
{
// group the Undo in the table
if( pUndo && !*pUndo )
@@ -59,8 +59,8 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo )
const SwPosition* pEndSelPos = rPam.End();
do {
aDelPam.SetMark();
- SwNode* pNd = aDelPam.GetNode();
- const SwNode& rEndNd = *pNd->EndOfSectionNode();
+ SwNode& rNd = aDelPam.GetNode();
+ const SwNode& rEndNd = *rNd.EndOfSectionNode();
if( pEndSelPos->nNode.GetIndex() <= rEndNd.GetIndex() )
{
*aDelPam.GetPoint() = *pEndSelPos;
@@ -73,8 +73,8 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo )
aDelPam.Move( fnMoveBackward, fnGoCntnt );
}
// skip protected boxes
- if( !pNd->IsCntntNode() ||
- !pNd->IsInProtectSect() )
+ if( !rNd.IsCntntNode() ||
+ !rNd.IsInProtectSect() )
{
// delete everything
GetDoc()->DeleteAndJoin( aDelPam );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index c536aab51521..2746b725290c 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -290,7 +290,7 @@ bool SwEditShell::GetGrfSize(Size& rSz) const
SwPaM* pCurrentCrsr = GetCrsr();
if( ( !pCurrentCrsr->HasMark()
|| pCurrentCrsr->GetPoint()->nNode == pCurrentCrsr->GetMark()->nNode )
- && 0 != ( pNoTxtNd = pCurrentCrsr->GetNode()->GetNoTxtNode() ) )
+ && 0 != ( pNoTxtNd = pCurrentCrsr->GetNode().GetNoTxtNode() ) )
{
rSz = pNoTxtNd->GetTwipSize();
return true;
@@ -326,13 +326,13 @@ void SwEditShell::GetGrfNms( OUString* pGrfName, OUString* pFltName,
const PolyPolygon *SwEditShell::GetGraphicPolygon() const
{
- SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
+ SwNoTxtNode *pNd = GetCrsr()->GetNode().GetNoTxtNode();
return pNd->HasContour();
}
void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly )
{
- SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
+ SwNoTxtNode *pNd = GetCrsr()->GetNode().GetNoTxtNode();
StartAllAction();
pNd->SetContour( pPoly );
SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
@@ -344,7 +344,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly )
void SwEditShell::ClearAutomaticContour()
{
- SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
+ SwNoTxtNode *pNd = GetCrsr()->GetNode().GetNoTxtNode();
OSL_ENSURE( pNd, "is no NoTxtNode!" );
if( pNd->HasAutomaticContour() )
{
@@ -372,7 +372,7 @@ svt::EmbeddedObjectRef& SwEditShell::GetOLEObject() const
GetCrsr()->GetPoint()->nNode == GetCrsr()->GetMark()->nNode),
"GetOLEObj: no OLENode." );
- SwOLENode *pOLENode = GetCrsr()->GetNode()->GetOLENode();
+ SwOLENode *pOLENode = GetCrsr()->GetNode().GetOLENode();
OSL_ENSURE( pOLENode, "GetOLEObj: no OLENode." );
SwOLEObj& rOObj = pOLENode->GetOLEObj();
return rOObj.GetObject();
@@ -398,7 +398,7 @@ bool SwEditShell::HasOLEObj( const OUString &rName ) const
void SwEditShell::SetChartName( const OUString &rName )
{
- SwOLENode *pONd = GetCrsr()->GetNode()->GetOLENode();
+ SwOLENode *pONd = GetCrsr()->GetNode().GetOLENode();
OSL_ENSURE( pONd, "ChartNode not found" );
pONd->SetChartTblName( rName );
}
@@ -418,7 +418,7 @@ void SwEditShell::SetTableName( SwFrmFmt& rTblFmt, const OUString &rNewName )
OUString SwEditShell::GetCurWord()
{
const SwPaM& rPaM = *GetCrsr();
- const SwTxtNode* pNd = rPaM.GetNode()->GetTxtNode();
+ const SwTxtNode* pNd = rPaM.GetNode().GetTxtNode();
OUString aString = pNd ?
pNd->GetCurWord(rPaM.GetPoint()->nContent.GetIndex()) :
OUString();
@@ -489,7 +489,7 @@ OUString SwEditShell::GetDropTxt( const sal_uInt16 nChars ) const
}
}
- SwTxtNode* pTxtNd = pCrsr->GetNode( !pCrsr->HasMark() )->GetTxtNode();
+ SwTxtNode* pTxtNd = pCrsr->GetNode( !pCrsr->HasMark() ).GetTxtNode();
if( pTxtNd )
{
sal_Int32 nDropLen = pTxtNd->GetDropLen( nChars );
@@ -504,7 +504,7 @@ void SwEditShell::ReplaceDropTxt( const OUString &rStr, SwPaM* pPaM )
{
SwPaM* pCrsr = pPaM ? pPaM : GetCrsr();
if( pCrsr->GetPoint()->nNode == pCrsr->GetMark()->nNode &&
- pCrsr->GetNode()->GetTxtNode()->IsTxtNode() )
+ pCrsr->GetNode().GetTxtNode()->IsTxtNode() )
{
StartAllAction();
@@ -528,7 +528,7 @@ OUString SwEditShell::Calculate()
const CharClass& rCC = GetAppCharClass();
do {
- SwTxtNode* pTxtNd = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = pPaM->GetNode().GetTxtNode();
if(pTxtNd)
{
const SwPosition *pStart = pPaM->Start(), *pEnd = pPaM->End();
@@ -591,7 +591,7 @@ sfx2::LinkManager& SwEditShell::GetLinkManager()
void *SwEditShell::GetIMapInventor() const
{
// The node on which the cursor points should be sufficient as a unique identifier
- return (void*)GetCrsr()->GetNode();
+ return (void*)&(GetCrsr()->GetNode());
}
// #i73788#
@@ -603,10 +603,10 @@ Graphic SwEditShell::GetIMapGraphic() const
SwPaM* pCrsr = GetCrsr();
if ( !pCrsr->HasMark() )
{
- SwNode *pNd =pCrsr->GetNode();
- if( pNd->IsGrfNode() )
+ SwNode& rNd =pCrsr->GetNode();
+ if( rNd.IsGrfNode() )
{
- SwGrfNode & rGrfNode(*static_cast<SwGrfNode*>(pNd));
+ SwGrfNode & rGrfNode(static_cast<SwGrfNode&>(rNd));
const Graphic& rGrf = rGrfNode.GetGrf();
if( rGrf.IsSwapOut() || ( rGrfNode.IsLinkedFile() &&
GRAPHIC_DEFAULT == rGrf.GetType() ) )
@@ -617,13 +617,13 @@ Graphic SwEditShell::GetIMapGraphic() const
}
aRet = rGrf;
}
- else if ( pNd->IsOLENode() )
+ else if ( rNd.IsOLENode() )
{
- aRet = *((SwOLENode*)pNd)->GetGraphic();
+ aRet = *((SwOLENode&)rNd).GetGraphic();
}
else
{
- SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->getLayoutFrm( GetLayout() )->FindFlyFrm();
+ SwFlyFrm* pFlyFrm = rNd.GetCntntNode()->getLayoutFrm( GetLayout() )->FindFlyFrm();
if(pFlyFrm)
aRet = pFlyFrm->GetFmt()->MakeGraphic();
}
@@ -700,8 +700,8 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
pTxtNd->GetNodes().IsDocNodes() )
{
SwTxtINetFmt& rAttr = *pFnd;
- OUString sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
- *rAttr.GetEnd() - *rAttr.GetStart() ) );
+ OUString sTxt( pTxtNd->GetExpandTxt( rAttr.GetStart(),
+ *rAttr.GetEnd() - rAttr.GetStart() ) );
sTxt = comphelper::string::remove(sTxt, 0x0a);
sTxt = comphelper::string::strip(sTxt, ' ');
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 713f6519ba18..efa5650e5cbe 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1260,7 +1260,7 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh)
{
SwPaM *pCrsr = pSh->GetCrsr();
const SwPosition* pStartPos = pCrsr->Start();
- const SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNode = pCrsr->GetNode().GetTxtNode();
sal_uInt16 nAct = pDoc->GetRedlinePos( *pTxtNode, USHRT_MAX );
const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex();
@@ -1425,7 +1425,7 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar
pMySh->GoEndSentence();
if( bGrammarErrorFound )
{
- const ModelToViewHelper aConversionMap(*(SwTxtNode*)pCrsr->GetNode());
+ const ModelToViewHelper aConversionMap((SwTxtNode&)pCrsr->GetNode());
OUString aExpandText = aConversionMap.getViewText();
sal_Int32 nSentenceEnd =
aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition );
@@ -1619,7 +1619,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt,
// iterate over the text to find changes in language
// set the mark equal to the point
*pCrsr->GetMark() = aStart;
- SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pCrsr->GetNode().GetTxtNode();
LanguageType eStartLanguage = lcl_GetLanguage(*GetSh());
SpellContentPosition aNextRedline = lcl_FindNextDeletedRedline(
rDeletedRedlines, aStart.nContent.GetIndex() );
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index c86790175399..1f36489f98d7 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -414,7 +414,7 @@ int SwEditShell::GetCurrentParaOutlineLevel( ) const
int nLevel = 0;
SwPaM* pCrsr = GetCrsr();
- const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode();
if( pTxtNd )
nLevel = pTxtNd->GetAttrOutlineLevel();
return nLevel;
@@ -472,9 +472,9 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft )
}
else // move down
{
- const SwNumRule* pOrig = aCrsr.GetNode(false)->GetTxtNode()->GetNumRule();
- if( aCrsr.GetNode()->IsTxtNode() &&
- pOrig == aCrsr.GetNode()->GetTxtNode()->GetNumRule() )
+ const SwNumRule* pOrig = aCrsr.GetNode(false).GetTxtNode()->GetNumRule();
+ if( aCrsr.GetNode().IsTxtNode() &&
+ pOrig == aCrsr.GetNode().GetTxtNode()->GetNumRule() )
{
sal_uLong nStt = aCrsr.GetPoint()->nNode.GetIndex(), nIdx = nStt+1;
@@ -654,7 +654,7 @@ bool SwEditShell::IsNoNum( bool bChkStart ) const
&& !HasSelection()
&& ( !bChkStart || IsSttPara() ) )
{
- const SwTxtNode* pTxtNd = GetCrsr()->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = GetCrsr()->GetNode().GetTxtNode();
if ( pTxtNd != NULL )
{
bResult = !pTxtNd->IsCountedInList();
@@ -670,7 +670,7 @@ sal_uInt8 SwEditShell::GetNumLevel() const
sal_uInt8 nLevel = MAXLEVEL;
SwPaM* pCrsr = GetCrsr();
- const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode();
OSL_ENSURE( pTxtNd, "GetNumLevel() without text node" );
if ( pTxtNd == NULL )
@@ -811,7 +811,7 @@ bool SwEditShell::IsNumRuleStart( SwPaM* pPaM ) const
{
bool bResult = false;
SwPaM* pCrsr = pPaM ? pPaM : GetCrsr( );
- const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode();
if( pTxtNd )
bResult = pTxtNd->IsListRestart() ? sal_True : sal_False;
return bResult;
@@ -840,7 +840,7 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM )
sal_uInt16 SwEditShell::GetNodeNumStart( SwPaM* pPaM ) const
{
SwPaM* pCrsr = pPaM ? pPaM : GetCrsr();
- const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode();
// correction: check, if list restart value is set at text node and
// use new method <SwTxtNode::GetAttrListRestartValue()>.
// return USHRT_MAX, if no list restart value is found.
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index fec6777ae923..3efe0e9cd924 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -429,7 +429,7 @@ bool SwEditShell::SplitTable( sal_uInt16 eMode )
{
bool bRet = false;
SwPaM *pCrsr = GetCrsr();
- if( pCrsr->GetNode()->FindTableNode() )
+ if( pCrsr->GetNode().FindTableNode() )
{
StartAllAction();
GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
@@ -447,7 +447,7 @@ bool SwEditShell::MergeTable( bool bWithPrev, sal_uInt16 nMode )
{
bool bRet = false;
SwPaM *pCrsr = GetCrsr();
- if( pCrsr->GetNode()->FindTableNode() )
+ if( pCrsr->GetNode().FindTableNode() )
{
StartAllAction();
GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
@@ -465,7 +465,7 @@ bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const
{
bool bRet = false;
const SwPaM *pCrsr = GetCrsr();
- const SwTableNode* pTblNd = pCrsr->GetNode()->FindTableNode();
+ const SwTableNode* pTblNd = pCrsr->GetNode().FindTableNode();
if( pTblNd && !pTblNd->GetTable().ISA( SwDDETable ))
{
bool bNew = pTblNd->GetTable().IsNewModel();
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 4d6f493a0db1..8be5eaad765a 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -118,7 +118,7 @@ sal_uInt16 SwEditShell::GetCntType() const
if( IsTableMode() )
nRet = CNT_TXT;
else
- switch( GetCrsr()->GetNode()->GetNodeType() )
+ switch( GetCrsr()->GetNode().GetNodeType() )
{
case ND_TEXTNODE: nRet = CNT_TXT; break;
case ND_GRFNODE: nRet = CNT_GRF; break;
@@ -246,7 +246,7 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, bool bInsert,
StartAllAction();
SwPaM* pCrsr = getShellCrsr( true );
- SwTxtNode* pTNd = pCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTNd = pCrsr->GetNode().GetTxtNode();
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar );
// FIXME: this _must_ be called with reference to the actual node text!
@@ -271,7 +271,7 @@ bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect& rACorr, OUString& rWord )
bool bRet;
SwPaM* pCrsr = getShellCrsr( true );
const sal_Int32 nPos = pCrsr->GetPoint()->nContent.GetIndex();
- SwTxtNode* pTNd = pCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTNd = pCrsr->GetNode().GetTxtNode();
if( pTNd && nPos )
{
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, 0 );
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index d947cebad397..d0fd69dbe32f 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -217,8 +217,8 @@ bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
{
sal_uLong nNdPos = pNd->GetIndex();
if( nSttNd <= nNdPos && nNdPos <= nEndNd &&
- ( nNdPos != nSttNd || *pTFld->GetStart() >= nStt ) &&
- ( nNdPos != nEndNd || *pTFld->GetStart() < nEnd ))
+ ( nNdPos != nSttNd || pTFld->GetStart() >= nStt ) &&
+ ( nNdPos != nEndNd || pTFld->GetStart() < nEnd ))
return true;
}
}
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 35e32aa1e461..45262262dd52 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -212,7 +212,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
const SwTxtFtn* pFtn = ((SwFtnFrm*)pLayout)->GetAttr();
pTxtNode = &pFtn->GetTxtNode();
rPos.nNode = *pTxtNode;
- rPos.nContent = *pFtn->GetStart();
+ rPos.nContent = pFtn->GetStart();
}
else if( pLayout->IsHeaderFrm() || pLayout->IsFooterFrm() )
{
@@ -873,7 +873,7 @@ sal_Int32 SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc,
const SwTxtFld* pTxtFld = rFmt.GetTxtFld();
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
- sal_Int32 nRet = nHint ? nHint : *pTxtFld->GetStart() + 1;
+ sal_Int32 nRet = nHint ? nHint : pTxtFld->GetStart() + 1;
OUString sNodeText = rTxtNode.GetTxt();
if(nRet<sNodeText.getLength())
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 66d354d5ac9f..91aab4cceb70 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -134,7 +134,7 @@ SwPosition SwAnnotationItem::GetAnchorPosition() const
SwTxtNode* pTxtNode = pTxtFld->GetpTxtNode();
SwPosition aPos( *pTxtNode );
- aPos.nContent.Assign( pTxtNode, *(pTxtFld->GetStart()) );
+ aPos.nContent.Assign( pTxtNode, pTxtFld->GetStart() );
return aPos;
}
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index f3205dfb69a3..18b85c50c0ed 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -464,13 +464,13 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
// first a "short" test - in case both are in the same node
if( pFldTxtAttr->GetpTxtNode() == pTxtNd )
{
- sTxt = nNumStart < *pFldTxtAttr->GetStart()
+ sTxt = nNumStart < pFldTxtAttr->GetStart()
? aLocaleData.getAboveWord()
: aLocaleData.getBelowWord();
break;
}
- sTxt = ::IsFrameBehind( *pFldTxtAttr->GetpTxtNode(), *pFldTxtAttr->GetStart(),
+ sTxt = ::IsFrameBehind( *pFldTxtAttr->GetpTxtNode(), pFldTxtAttr->GetStart(),
*pTxtNd, nNumStart )
? aLocaleData.getAboveWord()
: aLocaleData.getBelowWord();
@@ -800,7 +800,7 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
pTFld->GetpTxtNode() )
{
pGRef->SetLanguage( pTFld->GetpTxtNode()->GetLang(
- *pTFld->GetStart() ) );
+ pTFld->GetStart() ) );
}
// #i81002#
@@ -826,7 +826,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
if( pRef && pRef->GetTxtRefMark() )
{
pTxtNd = (SwTxtNode*)&pRef->GetTxtRefMark()->GetTxtNode();
- *pStt = *pRef->GetTxtRefMark()->GetStart();
+ *pStt = pRef->GetTxtRefMark()->GetStart();
if( pEnd )
*pEnd = *pRef->GetTxtRefMark()->GetAnyEnd();
}
@@ -847,7 +847,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
{
SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
pTxtNd = (SwTxtNode*)pTxtFld->GetpTxtNode();
- *pStt = *pTxtFld->GetStart();
+ *pStt = pTxtFld->GetStart();
if( pEnd )
*pEnd = (*pStt) + 1;
break;
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 2dfa6a9c08ad..c980082b5b82 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -348,11 +348,11 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
else
{
SwPaM *pCrsr = pDestShell->GetCrsr();
- if( pCrsr->GetNode()->IsNoTxtNode() )
+ if( pCrsr->GetNode().IsNoTxtNode() )
bRet = false;
else
bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(),
- *pCrsr->GetNode(), 0, rInsPt,
+ pCrsr->GetNode(), 0, rInsPt,
*pDestShell, aAnchor,
aNewAnch, false );
}
@@ -506,10 +506,10 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
else
{
const SwPaM *pCrsr = pDestShell->GetCrsr();
- if( pCrsr->GetNode()->IsNoTxtNode() )
+ if( pCrsr->GetNode().IsNoTxtNode() )
bRet = false;
else
- bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(), *pCrsr->GetNode(),
+ bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(), pCrsr->GetNode(),
pFly, rInsPt, *pDestShell, aAnchor,
aNewAnch, GetDoc() == pDestShell->GetDoc());
}
@@ -587,7 +587,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
if( !pDstPos->nNode.GetNode().IsNoTxtNode() )
bRet = true;
}
- else if( !pDestShell->GetCrsr()->GetNode()->IsNoTxtNode() )
+ else if( !pDestShell->GetCrsr()->GetNode().IsNoTxtNode() )
{
pDstPos = new SwPosition( *pDestShell->GetCrsr()->GetPoint() );
bRet = true;
@@ -631,7 +631,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
GetLayout()->GetCrsrOfst( &aPos, aPt );
bRet = !aPos.nNode.GetNode().IsNoTxtNode();
}
- else if( pDestShell->GetCrsr()->GetNode()->IsNoTxtNode() )
+ else if( pDestShell->GetCrsr()->GetNode().IsNoTxtNode() )
bRet = false;
if( bRet )
@@ -682,10 +682,10 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
// (individual boxes in the area are retrieved via the layout)
SwFieldType* pTblFldTyp = GetDoc()->GetSysFldType( RES_TABLEFLD );
- SwTableNode *pDestNd, *pSrcNd = aCpyPam.GetNode()->GetTableNode();
+ SwTableNode *pDestNd, *pSrcNd = aCpyPam.GetNode().GetTableNode();
if( !pSrcNd ) // TabellenNode ?
{ // nicht ueberspringen!!
- SwCntntNode* pCNd = aCpyPam.GetNode()->GetCntntNode();
+ SwCntntNode* pCNd = aCpyPam.GetNode().GetCntntNode();
if( pCNd )
aCpyPam.GetPoint()->nContent.Assign( pCNd, 0 );
else if( !aCpyPam.Move( fnMoveForward, fnGoNode ))
@@ -819,7 +819,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
SwPosition aDestPos( *PCURCRSR->GetPoint() );
bool bParkTblCrsr = false;
- const SwStartNode* pSttNd = PCURCRSR->GetNode()->FindTableBoxStartNode();
+ const SwStartNode* pSttNd = PCURCRSR->GetNode().FindTableBoxStartNode();
// TABLE IN TABLE: copy table in table
// search boxes via the layout
@@ -959,7 +959,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
{
Point aPt;
- lcl_SetAnchor( *PCURCRSR->GetPoint(), *PCURCRSR->GetNode(),
+ lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(),
0, aPt, *this, aAnchor, aPt, false );
}
@@ -1133,7 +1133,7 @@ bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt1
return false;
}
//if the page starts with a table a paragraph has to be inserted before
- SwNode* pTableNode = aCpyPam.GetNode()->FindTableNode();
+ SwNode* pTableNode = aCpyPam.GetNode().FindTableNode();
if(pTableNode)
{
//insert a paragraph
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 25c329ffcf15..cb1c552b471e 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -774,7 +774,7 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName,
case FLY_AT_FLY:
if( !pAnchor->GetCntntAnchor() )
{
- lcl_SetNewFlyPos( *pCursor->GetNode(),
+ lcl_SetNewFlyPos( pCursor->GetNode(),
*pAnchor, GetCrsrDocPos() );
}
break;
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index b12762b31d12..0b104a395a21 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -452,7 +452,7 @@ sal_uInt16 SwFEShell::MergeTab()
if( IsTableMode() )
{
SwShellTableCrsr* pTableCrsr = GetTableCrsr();
- const SwTableNode* pTblNd = pTableCrsr->GetNode()->FindTableNode();
+ const SwTableNode* pTblNd = pTableCrsr->GetNode().FindTableNode();
if( pTblNd->GetTable().ISA( SwDDETable ))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
@@ -884,7 +884,7 @@ bool SwFEShell::HasBoxSelection() const
}
SwNode* pNd;
if( pPam->GetPoint()->nNode.GetIndex() -1 ==
- ( pNd = pPam->GetNode())->StartOfSectionIndex() &&
+ ( pNd = &pPam->GetNode())->StartOfSectionIndex() &&
!pPam->GetPoint()->nContent.GetIndex() &&
pPam->GetMark()->nNode.GetIndex() + 1 ==
pNd->EndOfSectionIndex())
@@ -2081,7 +2081,7 @@ static bool lcl_GoTableRow( SwCrsrShell* pShell, bool bUp )
OSL_ENSURE( pShell != NULL, "need shell" );
SwPaM* pPam = pShell->GetCrsr();
- const SwStartNode* pTableBox = pPam->GetNode()->FindTableBoxStartNode();
+ const SwStartNode* pTableBox = pPam->GetNode().FindTableBoxStartNode();
OSL_ENSURE( pTableBox != NULL, "I'm living in a box... NOT!" );
// move cursor to start node of table box
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 2d94ddfbe82c..e69b80f7c9df 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -161,7 +161,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
// Row-selection:
// Check for complex tables. If Yes, search selected boxes via
// the layout. Otherwise via the table structure (for macros !!)
- const SwCntntNode* pContentNd = rCrsr.GetNode()->GetCntntNode();
+ const SwCntntNode* pContentNd = rCrsr.GetNode().GetCntntNode();
const SwTableNode* pTblNd = pContentNd ? pContentNd->FindTableNode() : 0;
if( pTblNd && pTblNd->GetTable().IsNewModel() )
{
@@ -182,8 +182,8 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const SwTable& rTbl = pTblNd->GetTable();
const SwTableLines& rLines = rTbl.GetTabLines();
- const SwNode* pMarkNode = rCrsr.GetNode( false );
- const sal_uLong nMarkSectionStart = pMarkNode->StartOfSectionIndex();
+ const SwNode& rMarkNode = rCrsr.GetNode( false );
+ const sal_uLong nMarkSectionStart = rMarkNode.StartOfSectionIndex();
const SwTableBox* pMarkBox = rTbl.GetTblBox( nMarkSectionStart );
OSL_ENSURE( pMarkBox, "Point in table, mark outside?" );
@@ -191,7 +191,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const SwTableLine* pLine = pMarkBox ? pMarkBox->GetUpper() : 0;
sal_uInt16 nSttPos = rLines.GetPos( pLine );
OSL_ENSURE( USHRT_MAX != nSttPos, "Where is my row in the table?" );
- pLine = rTbl.GetTblBox( rCrsr.GetNode( true )->StartOfSectionIndex() )->GetUpper();
+ pLine = rTbl.GetTblBox( rCrsr.GetNode( true ).StartOfSectionIndex() )->GetUpper();
sal_uInt16 nEndPos = rLines.GetPos( pLine );
OSL_ENSURE( USHRT_MAX != nEndPos, "Where is my row in the table?" );
// pb: #i20193# if tableintable then nSttPos == nEndPos == USHRT_MAX
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index bae445ada61d..c1339634c1db 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -86,7 +86,7 @@ public:
void UpdatePageNum(); // insert page numbering
TYPEINFO_OVERRIDE(); // for rtti
- SwTOXSortTabBases* GetTOXSortTabBases() { return &aSortArr; }
+ SwTOXSortTabBases& GetTOXSortTabBases() { return aSortArr; }
bool SetPosAtStartEnd( SwPosition& rPos, bool bAtStart = true ) const;
};
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 13b1db252057..489119fa7446 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -145,8 +145,8 @@ public:
SwFlowFrm( SwFrm &rFrm );
virtual ~SwFlowFrm();
- const SwFrm *GetFrm() const { return &m_rThis; }
- SwFrm *GetFrm() { return &m_rThis; }
+ const SwFrm& GetFrm() const { return m_rThis; }
+ SwFrm& GetFrm() { return m_rThis; }
static bool IsMoveBwdJump() { return m_bMoveBwdJump; }
static void SetMoveBwdJump( bool bNew ){ m_bMoveBwdJump = bNew; }
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index b3adc89ef259..106b7076ecfa 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -93,8 +93,8 @@ public:
virtual ~SwFntObj();
inline Font *GetScrFont() { return pScrFont; }
- inline Font *GetFont() { return &aFont; }
- inline const Font *GetFont() const { return &aFont; }
+ inline Font& GetFont() { return aFont; }
+ inline const Font& GetFont() const { return aFont; }
inline sal_uInt16 GetGuessedLeading() const { return nGuessedLeading; }
inline sal_uInt16 GetExtLeading() const { return nExtLeading; }
diff --git a/sw/source/core/inc/swfntcch.hxx b/sw/source/core/inc/swfntcch.hxx
index 5bb84ba74904..24b39d0405c7 100644
--- a/sw/source/core/inc/swfntcch.hxx
+++ b/sw/source/core/inc/swfntcch.hxx
@@ -59,8 +59,8 @@ public:
virtual ~SwFontObj();
- inline SwFont *GetFont() { return &aSwFont; }
- inline const SwFont *GetFont() const { return &aSwFont; }
+ inline SwFont& GetFont() { return aSwFont; }
+ inline const SwFont& GetFont() const { return aSwFont; }
inline const SfxPoolItem** GetDefault() { return pDefaultArray; }
};
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 869f5a3bf289..7910135c2951 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1122,7 +1122,7 @@ void SwCntntFrm::MakeAll()
if ( GetUpper()->IsSctFrm() &&
HasFollow() &&
- GetFollow()->GetFrm() == GetNext() )
+ &GetFollow()->GetFrm() == GetNext() )
{
dynamic_cast<SwTxtFrm&>(*this).JoinFrm();
}
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 7a7441e25d67..233f0e6dc3c8 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -194,7 +194,7 @@ bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep
{
SwFrm *pNxt;
if( 0 != (pNxt = m_rThis.FindNextCnt()) &&
- (!m_pFollow || pNxt != m_pFollow->GetFrm()))
+ (!m_pFollow || pNxt != &m_pFollow->GetFrm()))
{
// #135914#
// The last row of a table only keeps with the next content
@@ -277,7 +277,7 @@ sal_uInt8 SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRe
// do a test formatting, because paragraph bound objects wouldn't
// be properly considered, and character bound objects shouldn't
// be test formatted at all.
- if( pTmp->GetFrm()->GetDrawObjs() )
+ if( pTmp->GetFrm().GetDrawObjs() )
nRet = 1;
pTmp = pTmp->GetFollow();
} while ( !nRet && pTmp );
@@ -831,10 +831,10 @@ bool SwFrm::WrongPageDesc( SwPageFrm* pNew )
// Did we find ourselves?
if( pNewFlow == pFlow )
pNewFlow = NULL;
- if ( pNewFlow && pNewFlow->GetFrm()->IsInTab() )
- pNewFlow = pNewFlow->GetFrm()->FindTabFrm();
+ if ( pNewFlow && pNewFlow->GetFrm().IsInTab() )
+ pNewFlow = pNewFlow->GetFrm().FindTabFrm();
const SwPageDesc *pNewDesc= ( pNewFlow && !pNewFlow->IsFollow() )
- ? pNewFlow->GetFrm()->GetAttrSet()->GetPageDesc().GetPageDesc() : 0;
+ ? pNewFlow->GetFrm().GetAttrSet()->GetPageDesc().GetPageDesc() : 0;
return (pNew->GetPageDesc() != pDesc) // own desc ?
|| (pNew->GetFmt() !=
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 513efae5144c..0ca29c21f5fc 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1351,7 +1351,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
pCnt->GetNode()->GetTxtNode()->GetTxtAttrAt( pPos->nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTxtNode::PARENT );
if ( pTxtInputFld != NULL )
{
- pPos->nContent = *(pTxtInputFld->GetStart());
+ pPos->nContent = pTxtInputFld->GetStart();
}
}
ResetLastCharRectHeight();
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index daa1205d2d5f..849d29c74fa2 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1679,16 +1679,16 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if( pTmp )
{
- SwFrm* pOldUp = pTmp->GetFrm()->GetUpper();
+ SwFrm* pOldUp = pTmp->GetFrm().GetUpper();
// MoveFwd==sal_True means that we are still on the same page.
// But since we want to move if possible!
bool bTmpOldLock = pTmp->IsJoinLocked();
pTmp->LockJoin();
while( pTmp->MoveFwd( true, false, true ) )
{
- if( pOldUp == pTmp->GetFrm()->GetUpper() )
+ if( pOldUp == pTmp->GetFrm().GetUpper() )
break;
- pOldUp = pTmp->GetFrm()->GetUpper();
+ pOldUp = pTmp->GetFrm().GetUpper();
}
if( !bTmpOldLock )
pTmp->UnlockJoin();
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index bffbb1481ad5..70d79fc7ce9c 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2825,7 +2825,7 @@ SwCntntFrm* SwFtnFrm::GetRefFromAttr()
{
OSL_ENSURE( pAttr, "invalid Attribute" );
SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode();
- SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() ));
+ SwPosition aPos( rTNd, SwIndex( &rTNd, pAttr->GetStart() ));
SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, false );
return pCFrm;
}
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index baa24c18aaf2..6d405a1cd064 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -922,7 +922,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
// skip fly frames from pages before the current page
while( nFlyIdx < nFlyCount &&
- pImpl->GetFlyCache(nFlyIdx)->nPageNum < nPgNum )
+ pImpl->GetFlyCache(nFlyIdx).nPageNum < nPgNum )
++nFlyIdx;
// sort cached objects on this page by ordnum
@@ -931,7 +931,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
SwFlyCache* pFlyC;
while( nIdx < nFlyCount &&
- ( pFlyC = pImpl->GetFlyCache( nIdx ) )->nPageNum == nPgNum )
+ ( pFlyC = &pImpl->GetFlyCache( nIdx ) )->nPageNum == nPgNum )
{
aFlyCacheSet.insert( pFlyC );
++nIdx;
@@ -1016,11 +1016,11 @@ bool SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
// skip fly frames from pages before the current page
while( nIdx < nCnt &&
- nPgNum > (pFlyC = pCache->GetFlyCache( nIdx ))->nPageNum )
+ nPgNum > (pFlyC = &pCache->GetFlyCache( nIdx ))->nPageNum )
++nIdx;
while( nIdx < nCnt &&
- nOrdNum != (pFlyC = pCache->GetFlyCache( nIdx ))->nOrdNum )
+ nOrdNum != (pFlyC = &pCache->GetFlyCache( nIdx ))->nOrdNum )
++nIdx;
if( nIdx < nCnt )
{
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index bb8728354872..493e40962450 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -66,7 +66,7 @@ public:
sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }
sal_uInt16 GetFlyCount() const { return aFlyCache.size(); }
- SwFlyCache *GetFlyCache( sal_uInt16 nIdx ) { return &aFlyCache[ nIdx ]; }
+ SwFlyCache& GetFlyCache( sal_uInt16 nIdx ) { return aFlyCache[ nIdx ]; }
bool IsUseFlyCache() const { return bUseFlyCache; }
};
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 87201c552018..b485c84c9094 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -446,7 +446,7 @@ bool SwLayouter::MoveBwdSuppressed( const SwDoc& p_rDoc,
// create hash map key
tMoveBwdLayoutInfoKey aMoveBwdLayoutInfo;
- aMoveBwdLayoutInfo.mnFrmId = p_rFlowFrm.GetFrm()->GetFrmId();
+ aMoveBwdLayoutInfo.mnFrmId = p_rFlowFrm.GetFrm().GetFrmId();
aMoveBwdLayoutInfo.mnNewUpperPosX = p_rNewUpperFrm.Frm().Pos().X();
aMoveBwdLayoutInfo.mnNewUpperPosY = p_rNewUpperFrm.Frm().Pos().Y();
aMoveBwdLayoutInfo.mnNewUpperWidth = p_rNewUpperFrm.Frm().Width();
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 35634f431bec..d046fb4b311e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -148,7 +148,7 @@ public:
SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyle,
const SwTabFrm *pT , const sal_uInt8 nSCol );
- const Color *GetColor() const { return &aColor;}
+ const Color& GetColor() const { return aColor;}
SvxBorderStyle GetStyle() const { return nStyle; }
const SwTabFrm *GetTab() const { return pTab; }
void SetPainted() { bPainted = true; }
@@ -661,8 +661,7 @@ void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol, const Svx
if ( rLRect.GetTab() == pTab &&
!rLRect.IsPainted() && rLRect.GetSubColor() == nSCol &&
(rLRect.Height() > rLRect.Width()) == (rRect.Height() > rRect.Width()) &&
- ((!rLRect.GetColor() && !pCol) ||
- (rLRect.GetColor() && pCol && *rLRect.GetColor() == *pCol)) )
+ (pCol && rLRect.GetColor() == *pCol) )
{
if ( rLRect.MakeUnion( rRect ) )
return;
@@ -773,7 +772,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
aIns.Bottom( pLA->Bottom() );
if ( !rL1.IsInside( aIns ) )
continue;
- aLineRects.push_back( SwLineRect( aIns, rL1.GetColor(),
+ aLineRects.push_back( SwLineRect( aIns, &rL1.GetColor(),
table::BorderLineStyle::SOLID,
rL1.GetTab(), SUBCOL_TAB ) );
if ( isFull() )
@@ -814,7 +813,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
aIns.Right( pLA->Right() );
if ( !rL1.IsInside( aIns ) )
continue;
- aLineRects.push_back( SwLineRect( aIns, rL1.GetColor(),
+ aLineRects.push_back( SwLineRect( aIns, &rL1.GetColor(),
table::BorderLineStyle::SOLID,
rL1.GetTab(), SUBCOL_TAB ) );
if ( isFull() )
@@ -1043,9 +1042,9 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
}
if ( bPaint )
{
- if ( !pLast || *pLast != *rLRect.GetColor() )
+ if ( !pLast || *pLast != rLRect.GetColor() )
{
- pLast = rLRect.GetColor();
+ pLast = &rLRect.GetColor();
sal_uLong nOldDrawMode = pOut->GetDrawMode();
if( pGlobalShell->GetWin() &&
@@ -1078,9 +1077,9 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
continue;
}
- if ( !pLast || *pLast != *rLRect.GetColor() )
+ if ( !pLast || *pLast != rLRect.GetColor() )
{
- pLast = rLRect.GetColor();
+ pLast = &rLRect.GetColor();
sal_uLong nOldDrawMode = pOut->GetDrawMode();
if( pGlobalShell->GetWin() &&
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index f8dfce209ce1..d5429472937d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -133,7 +133,7 @@ extern const SwFrm *pRowCacheLastCellFrm;
SwTabFrm* SwTabFrm::GetFollowFlowLineFor()
{
SwFlowFrm *pPrec = GetPrecede();
- if (pPrec && pPrec->GetFrm()->IsTabFrm())
+ if (pPrec && pPrec->GetFrm().IsTabFrm())
{
SwTabFrm *pPrevTabFrm = (SwTabFrm*)pPrec;
assert(this == pPrevTabFrm->GetFollow());
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 8e48c430dc57..f98aee6be4a8 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -618,7 +618,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
/** Layout dependent cursor travelling */
bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
{
- if( pPam->GetNode() != (SwCntntNode*)GetNode() )
+ if( &pPam->GetNode() != (SwCntntNode*)GetNode() )
return false;
((SwCntntNode*)GetNode())->
MakeStartIndex((SwIndex *) &pPam->GetPoint()->nContent);
@@ -627,7 +627,7 @@ bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
bool SwCntntFrm::RightMargin(SwPaM *pPam, bool) const
{
- if( pPam->GetNode() != (SwCntntNode*)GetNode() )
+ if( &pPam->GetNode() != (SwCntntNode*)GetNode() )
return false;
((SwCntntNode*)GetNode())->
MakeEndIndex((SwIndex *) &pPam->GetPoint()->nContent);
@@ -693,7 +693,7 @@ static const SwCntntFrm * lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
static bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
GetNxtPrvCnt fnNxtPrv, bool bInReadOnly )
{
- OSL_ENSURE( pPam->GetNode() == (SwCntntNode*)pStart->GetNode(),
+ OSL_ENSURE( &pPam->GetNode() == (SwCntntNode*)pStart->GetNode(),
"lcl_UpDown doesn't work for others." );
const SwCntntFrm *pCnt = 0;
@@ -703,8 +703,8 @@ static bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
//going down.
bool bTblSel = false;
if ( pStart->IsInTab() &&
- pPam->GetNode( true )->StartOfSectionNode() !=
- pPam->GetNode( false )->StartOfSectionNode() )
+ pPam->GetNode( true ).StartOfSectionNode() !=
+ pPam->GetNode( false ).StartOfSectionNode() )
{
bTblSel = true;
const SwLayoutFrm *pCell = pStart->GetUpper();
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 73762f764825..f30fa20d023e 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2526,7 +2526,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, bool bTst, bool bInfo )
{ // If we are in an other column/page than the frame with the
// reference, we don't need to invalidate its master.
SwFrm *pTmp = pCnt->FindFtnBossFrm(true) == FindFtnBossFrm(true)
- ? pCnt->FindMaster()->GetFrm() : pCnt;
+ ? &pCnt->FindMaster()->GetFrm() : pCnt;
pTmp->Prepare( PREP_ADJUST_FRM );
pTmp->InvalidateSize();
}
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 2f2666e41740..cf5b25b07dc7 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2474,7 +2474,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( bool bCheckAttr ) const
const SwTxtAttr* pAttr = (*pHts)[ n ];
if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() )
{
- if ( (*pAttr->GetStart() == nNextSetField)
+ if ( (pAttr->GetStart() == nNextSetField)
&& (pAttr->Which() == RES_TXTATR_FIELD))
{
// #i104949# hideous hack for report builder:
@@ -2488,7 +2488,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( bool bCheckAttr ) const
(pField)->GetSubType() &
nsSwExtendedSubType::SUB_INVISIBLE)))
{
- nNextSetField = *pAttr->GetStart() + 1;
+ nNextSetField = pAttr->GetStart() + 1;
continue;
}
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 6afa51d3fdc7..84c771d38d29 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1915,7 +1915,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
SwTxtNode& rTNd = const_cast<SwTxtNode&>(pTxtFtn->GetTxtNode());
mrSh._GetCrsr()->GetPoint()->nNode = rTNd;
- mrSh._GetCrsr()->GetPoint()->nContent.Assign( &rTNd, *pTxtFtn->GetStart() );
+ mrSh._GetCrsr()->GetPoint()->nContent.Assign( &rTNd, pTxtFtn->GetStart() );
// 1. Check if the whole paragraph is hidden
// 2. Check for hidden text attribute
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index b5f053ccd252..0aecaab906f3 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -669,7 +669,7 @@ bool SwTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& rPoint,
bool SwTxtFrm::LeftMargin(SwPaM *pPam) const
{
- if( ((const SwNode*)pPam->GetNode()) != GetNode() )
+ if( &pPam->GetNode() != GetNode() )
pPam->GetPoint()->nNode = *((SwTxtFrm*)this)->GetTxtNode();
SwTxtFrm *pFrm = GetAdjFrmAtPos( (SwTxtFrm*)this, *pPam->GetPoint(),
@@ -704,7 +704,7 @@ bool SwTxtFrm::LeftMargin(SwPaM *pPam) const
bool SwTxtFrm::RightMargin(SwPaM *pPam, bool bAPI) const
{
- if( ((const SwNode*)pPam->GetNode()) != GetNode() )
+ if( &pPam->GetNode() != GetNode() )
pPam->GetPoint()->nNode = *((SwTxtFrm*)this)->GetTxtNode();
SwTxtFrm *pFrm = GetAdjFrmAtPos( (SwTxtFrm*)this, *pPam->GetPoint(),
@@ -758,8 +758,8 @@ bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
SwSetToRightMargin aSet;
if( IsInTab() &&
- pPam->GetNode( true )->StartOfSectionNode() !=
- pPam->GetNode( false )->StartOfSectionNode() )
+ pPam->GetNode( true ).StartOfSectionNode() !=
+ pPam->GetNode( false ).StartOfSectionNode() )
{
// If the PaM is located within different boxes, we have a table selection,
// which is handled by the base class.
@@ -1145,8 +1145,8 @@ bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
{
if ( IsInTab() &&
- pPam->GetNode( true )->StartOfSectionNode() !=
- pPam->GetNode( false )->StartOfSectionNode() )
+ pPam->GetNode( true ).StartOfSectionNode() !=
+ pPam->GetNode( false ).StartOfSectionNode() )
{
// If the PaM is located within different boxes, we have a table selection,
// which is handled by the base class.
@@ -1375,7 +1375,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
else
{
SwFontAccess aFontAccess( pColl, pSh );
- pFnt = new SwFont( *aFontAccess.Get()->GetFont() );
+ pFnt = new SwFont( aFontAccess.Get()->GetFont() );
pFnt->ChkMagic( pSh, pFnt->GetActual() );
}
OutputDevice* pOut = pSh->GetOut();
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1d688d88718b..29c3f3ca8852 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -222,8 +222,8 @@ bool SwTxtFrm::CalcFollow( const sal_Int32 nTxtOfst )
ValidateBodyFrm();
if( pPara )
{
- *(pPara->GetReformat()) = SwCharRange();
- *(pPara->GetDelta()) = 0;
+ pPara->GetReformat() = SwCharRange();
+ pPara->GetDelta() = 0;
}
}
@@ -313,8 +313,8 @@ bool SwTxtFrm::CalcFollow( const sal_Int32 nTxtOfst )
ValidateFrm();
if( pPara )
{
- *(pPara->GetReformat()) = SwCharRange();
- *(pPara->GetDelta()) = 0;
+ pPara->GetReformat() = SwCharRange();
+ pPara->GetDelta() = 0;
}
}
@@ -615,7 +615,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
for ( sal_uInt16 i = 0; i < pHints->Count(); ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
- if( RES_TXTATR_FTN==pHt->Which() && *pHt->GetStart()>=nStart )
+ if( RES_TXTATR_FTN==pHt->Which() && pHt->GetStart()>=nStart )
{
if( pHt->GetFtn().IsEndNote() )
{
@@ -708,7 +708,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const sal_Int32 nTxtPos )
for ( sal_uInt16 i = 0; i < pHints->Count(); ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
- if( RES_TXTATR_FTN==pHt->Which() && *pHt->GetStart()>=nTxtPos )
+ if( RES_TXTATR_FTN==pHt->Which() && pHt->GetStart()>=nTxtPos )
{
if( pHt->GetFtn().IsEndNote() )
{
@@ -755,10 +755,10 @@ void SwTxtFrm::_SetOfst( const sal_Int32 nNewOfst )
SwParaPortion *pPara = GetPara();
if( pPara )
{
- SwCharRange &rReformat = *(pPara->GetReformat());
+ SwCharRange &rReformat = pPara->GetReformat();
rReformat.Start() = 0;
rReformat.Len() = GetTxt().getLength();
- *(pPara->GetDelta()) = rReformat.Len();
+ pPara->GetDelta() = rReformat.Len();
}
InvalidateSize();
}
@@ -778,7 +778,7 @@ bool SwTxtFrm::CalcPreps()
ResetPreps();
bool bRet = false;
- if( bPrep && !pPara->GetReformat()->Len() )
+ if( bPrep && !pPara->GetReformat().Len() )
{
// PREP_WIDOWS means that the orphans rule got activated in the Follow.
// In unfortunate cases we could also have a PrepAdjust!
@@ -830,7 +830,7 @@ bool SwTxtFrm::CalcPreps()
GetFollow()->SetJustWidow( true );
GetFollow()->Prepare( PREP_CLEAR );
Shrink( nChgHeight );
- SwRect &rRepaint = *(pPara->GetRepaint());
+ SwRect &rRepaint = pPara->GetRepaint();
if ( bVert )
{
@@ -907,7 +907,7 @@ bool SwTxtFrm::CalcPreps()
// We delete a line before the Master, because the Follow
// could hand over a line
const SwCharRange aFollowRg( GetFollow()->GetOfst(), 1 );
- *(pPara->GetReformat()) += aFollowRg;
+ pPara->GetReformat() += aFollowRg;
// We should continue!
bRet = false;
}
@@ -1000,9 +1000,9 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
// If the current values have been calculated, show that they
// are valid now
- *(pPara->GetReformat()) = SwCharRange();
- bool bDelta = *pPara->GetDelta() != 0;
- *(pPara->GetDelta()) = 0;
+ pPara->GetReformat() = SwCharRange();
+ bool bDelta = pPara->GetDelta() != 0;
+ pPara->GetDelta() = 0;
if( rLine.IsStop() )
{
@@ -1090,7 +1090,7 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
if ( IsVertical() && !IsVertLR() && nChg )
{
- SwRect &rRepaint = *(pPara->GetRepaint());
+ SwRect &rRepaint = pPara->GetRepaint();
rRepaint.Left( rRepaint.Left() - nChg );
rRepaint.Width( rRepaint.Width() - nChg );
}
@@ -1151,9 +1151,9 @@ bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const bool bPrev )
// Calculate rRepaint
const SwTwips nBottom = rLine.Y() + rLine.GetLineHeight();
- SwRepaint &rRepaint = *(pPara->GetRepaint());
+ SwRepaint &rRepaint = pPara->GetRepaint();
if( bUnChg && rRepaint.Top() == rLine.Y()
- && (bPrev || nNewStart <= pPara->GetReformat()->Start())
+ && (bPrev || nNewStart <= pPara->GetReformat().Start())
&& (nNewStart < GetTxtNode()->GetTxt().getLength()))
{
rRepaint.Top( nBottom );
@@ -1216,7 +1216,7 @@ bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const bool bPrev )
rLine.SetChanges();
// Calculating the good ol' nDelta
- *(pPara->GetDelta()) -= long(pNew->GetLen()) - long(nOldLen);
+ pPara->GetDelta() -= long(pNew->GetLen()) - long(nOldLen);
// Stop!
if( rLine.IsStop() )
@@ -1234,13 +1234,13 @@ bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const bool bPrev )
return true;
// Reached the Reformat's end?
- const sal_Int32 nEnd = pPara->GetReformat()->Start() +
- pPara->GetReformat()->Len();
+ const sal_Int32 nEnd = pPara->GetReformat().Start() +
+ pPara->GetReformat().Len();
if( nNewStart <= nEnd )
return true;
- return 0 != *(pPara->GetDelta());
+ return 0 != pPara->GetDelta();
}
void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
@@ -1255,8 +1255,8 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
const OUString &rString = GetTxtNode()->GetTxt();
const sal_Int32 nStrLen = rString.getLength();
- SwCharRange &rReformat = *(pPara->GetReformat());
- SwRepaint &rRepaint = *(pPara->GetRepaint());
+ SwCharRange &rReformat = pPara->GetReformat();
+ SwRepaint &rRepaint = pPara->GetRepaint();
SwRepaint *pFreeze = NULL;
// Due to performance reasons we set rReformat to COMPLETE_STRING in Init()
@@ -1588,7 +1588,7 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
if( !rLine.GetDropFmt() )
rLine.SetOnceMore( false );
SwCharRange aRange( 0, rInf.GetTxt().getLength() );
- *(pPara->GetReformat()) = aRange;
+ pPara->GetReformat() = aRange;
_Format( rLine, rInf );
bGoOn = rLine.IsOnceMore();
@@ -1618,7 +1618,7 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
rLine.SetDropLines( 1 );
rLine.CalcDropHeight( 1 );
SwCharRange aTmpRange( 0, rInf.GetTxt().getLength() );
- *(pPara->GetReformat()) = aTmpRange;
+ pPara->GetReformat() = aTmpRange;
_Format( rLine, rInf, true );
// We paint everything ...
SetCompletePaint();
@@ -1768,7 +1768,7 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
; // nothing
// We return if already formatted, but if the TxtFrm was just created
// and does not have any format information
- else if( !bNew && !aAccess.GetPara()->GetReformat()->Len() )
+ else if( !bNew && !aAccess.GetPara()->GetReformat().Len() )
{
if( GetTxtNode()->GetSwAttrSet().GetRegister().GetValue() )
{
@@ -1934,12 +1934,12 @@ bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
// We made it!
// Set repaint
- pPara->GetRepaint()->Pos( aTopLeft );
- pPara->GetRepaint()->SSize( Prt().SSize() );
+ pPara->GetRepaint().Pos( aTopLeft );
+ pPara->GetRepaint().SSize( Prt().SSize() );
// Delete reformat
- *(pPara->GetReformat()) = SwCharRange();
- *(pPara->GetDelta()) = 0;
+ pPara->GetReformat() = SwCharRange();
+ pPara->GetDelta() = 0;
return true;
}
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 112c1486038c..cccdaf87d5a3 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -422,20 +422,20 @@ SwRect SwTxtFrm::Paint()
{
// We return the right paint rect. Use the calculated PaintOfst as the
// left margin
- SwRepaint *pRepaint = GetPara()->GetRepaint();
+ SwRepaint& rRepaint = GetPara()->GetRepaint();
long l;
if ( IsVertLR() ) // mba: the following line was added, but we don't need it for the existing directions; kept for IsVertLR(), but should be checked
- pRepaint->Chg( ( GetUpper()->Frm() ).Pos() + ( GetUpper()->Prt() ).Pos(), ( GetUpper()->Prt() ).SSize() );
+ rRepaint.Chg( ( GetUpper()->Frm() ).Pos() + ( GetUpper()->Prt() ).Pos(), ( GetUpper()->Prt() ).SSize() );
- if( pRepaint->GetOfst() )
- pRepaint->Left( pRepaint->GetOfst() );
+ if( rRepaint.GetOfst() )
+ rRepaint.Left( rRepaint.GetOfst() );
- l = pRepaint->GetRightOfst();
- if( l && l > pRepaint->Right() )
- pRepaint->Right( l );
- pRepaint->SetOfst( 0 );
- aRet = *pRepaint;
+ l = rRepaint.GetRightOfst();
+ if( l && l > rRepaint.Right() )
+ rRepaint.Right( l );
+ rRepaint.SetOfst( 0 );
+ aRet = rRepaint;
// In case our left edge is the same as the body frame's left edge,
// then extend the rectangle to include the page margin as well,
@@ -479,7 +479,7 @@ bool SwTxtFrm::PaintEmpty( const SwRect &rRect, bool bCheck ) const
else
{
SwFontAccess aFontAccess( &rTxtNode.GetAnyFmtColl(), pSh );
- pFnt = new SwFont( *aFontAccess.Get()->GetFont() );
+ pFnt = new SwFont( aFontAccess.Get()->GetFont() );
}
const IDocumentRedlineAccess* pIDRA = rTxtNode.getIDocumentRedlineAccess();
@@ -633,7 +633,7 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
SwTxtLineAccess aAccess( (SwTxtFrm*)this );
SwParaPortion *pPara = aAccess.GetPara();
- SwRepaint &rRepaint = *(pPara->GetRepaint());
+ SwRepaint &rRepaint = pPara->GetRepaint();
// Switch off recycling when in the FlyCntFrm.
// A DrawRect is called for repainting the line anyways.
@@ -662,12 +662,12 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aInf.SetWrongList( ( (SwTxtNode*)GetTxtNode() )->GetWrong() );
aInf.SetGrammarCheckList( ( (SwTxtNode*)GetTxtNode() )->GetGrammarCheck() );
aInf.SetSmartTags( ( (SwTxtNode*)GetTxtNode() )->GetSmartTags() );
- aInf.GetTxtFly()->SetTopRule();
+ aInf.GetTxtFly().SetTopRule();
SwTxtPainter aLine( (SwTxtFrm*)this, &aInf );
// Optimization: if no free flying Frm overlaps into our line, the
// SwTxtFly just switches off
- aInf.GetTxtFly()->Relax();
+ aInf.GetTxtFly().Relax();
OutputDevice* pOut = aInf.GetOut();
const bool bOnWin = pSh->GetWin() != 0;
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index d260a6ff830a..f45a7aff2c7d 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -474,7 +474,7 @@ SwTxtPaintInfo::SwTxtPaintInfo( const SwTxtPaintInfo &rInf, const OUString* pTxt
pSmartTags( rInf.GetSmartTags() ),
pSpaceAdd( rInf.GetpSpaceAdd() ),
pBrushItem( rInf.GetBrushItem() ),
- aTxtFly( *rInf.GetTxtFly() ),
+ aTxtFly( rInf.GetTxtFly() ),
aPos( rInf.GetPos() ),
aPaintRect( rInf.GetPaintRect() ),
nSpaceIdx( rInf.GetSpaceIdx() )
@@ -487,7 +487,7 @@ SwTxtPaintInfo::SwTxtPaintInfo( const SwTxtPaintInfo &rInf )
pSmartTags( rInf.GetSmartTags() ),
pSpaceAdd( rInf.GetpSpaceAdd() ),
pBrushItem( rInf.GetBrushItem() ),
- aTxtFly( *rInf.GetTxtFly() ),
+ aTxtFly( rInf.GetTxtFly() ),
aPos( rInf.GetPos() ),
aPaintRect( rInf.GetPaintRect() ),
nSpaceIdx( rInf.GetSpaceIdx() )
@@ -659,7 +659,7 @@ void SwTxtPaintInfo::_DrawText( const OUString &rText, const SwLinePortion &rPor
aFontPos.X() = 0;
}
- if( GetTxtFly()->IsOn() )
+ if( GetTxtFly().IsOn() )
{
// aPos needs to be the TopLeft, because we cannot calculate the
// ClipRects otherwise
@@ -672,7 +672,7 @@ void SwTxtPaintInfo::_DrawText( const OUString &rText, const SwLinePortion &rPor
aDrawInf.SetWrong( bTmpWrong ? pWrongList : NULL );
aDrawInf.SetGrammarCheck( bTmpGrammarCheck ? pGrammarCheckList : NULL );
aDrawInf.SetSmartTags( bTmpSmart ? pSmartTags : NULL );
- GetTxtFly()->DrawTextOpaque( aDrawInf );
+ GetTxtFly().DrawTextOpaque( aDrawInf );
}
else
{
@@ -897,7 +897,7 @@ void SwTxtPaintInfo::DrawRect( const SwRect &rRect, bool bNoGraphic,
if ( OnWin() || !bRetouche )
{
if( aTxtFly.IsOn() )
- ((SwTxtPaintInfo*)this)->GetTxtFly()->
+ ((SwTxtPaintInfo*)this)->GetTxtFly().
DrawFlyRect( m_pOut, rRect, *this, bNoGraphic );
else if ( bNoGraphic )
m_pOut->DrawRect( rRect.SVRect() );
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index a7572228ace3..5364cd7d841e 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -432,8 +432,8 @@ public:
inline SwTwips Y() const { return aPos.Y(); }
inline void Y( const SwTwips nNew ) { aPos.Y() = nNew; }
- inline SwTxtFly *GetTxtFly() { return &aTxtFly; }
- inline const SwTxtFly *GetTxtFly() const { return &aTxtFly; }
+ inline SwTxtFly& GetTxtFly() { return aTxtFly; }
+ inline const SwTxtFly& GetTxtFly() const { return aTxtFly; }
inline void DrawText( const OUString &rText, const SwLinePortion &rPor,
const sal_Int32 nIdx = 0,
const sal_Int32 nLen = COMPLETE_STRING,
@@ -795,12 +795,12 @@ inline SwPosSize SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI,
inline SwTwips SwTxtPaintInfo::GetPaintOfst() const
{
- return GetParaPortion()->GetRepaint()->GetOfst();
+ return GetParaPortion()->GetRepaint().GetOfst();
}
inline void SwTxtPaintInfo::SetPaintOfst( const SwTwips nNew )
{
- GetParaPortion()->GetRepaint()->SetOfst( nNew );
+ GetParaPortion()->GetRepaint().SetOfst( nNew );
}
inline void SwTxtPaintInfo::DrawText( const OUString &rText,
@@ -829,7 +829,7 @@ inline void SwTxtPaintInfo::DrawMarkedText( const SwLinePortion &rPor,
inline sal_Int32 SwTxtFormatInfo::GetReformatStart() const
{
- return GetParaPortion()->GetReformat()->Start();
+ return GetParaPortion()->GetReformat().Start();
}
inline const SwAttrSet& SwTxtFormatInfo::GetCharAttr() const
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 24e71116f116..b2ad8a232166 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -106,7 +106,7 @@ void SwTxtAdjuster::FormatBlock( )
GetInfo().SetIdx( nStart );
CalcNewBlock( pCurr, pFly );
GetInfo().SetIdx( nOldIdx );
- GetInfo().GetParaPortion()->GetRepaint()->SetOfst(0);
+ GetInfo().GetParaPortion()->GetRepaint().SetOfst(0);
}
static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTxtIter& rItr,
@@ -677,7 +677,7 @@ void SwTxtAdjuster::CalcAdjLine( SwLineLayout *pCurrent )
case SVX_ADJUST_CENTER:
{
CalcFlyAdjust( pCurrent );
- pPara->GetRepaint()->SetOfst( 0 );
+ pPara->GetRepaint().SetOfst( 0 );
break;
}
case SVX_ADJUST_BLOCK:
@@ -824,7 +824,7 @@ void SwTxtAdjuster::CalcDropAdjust()
void SwTxtAdjuster::CalcDropRepaint()
{
Top();
- SwRepaint &rRepaint = *GetInfo().GetParaPortion()->GetRepaint();
+ SwRepaint &rRepaint = GetInfo().GetParaPortion()->GetRepaint();
if( rRepaint.Top() > Y() )
rRepaint.Top( Y() );
for( MSHORT i = 1; i < GetDropLines(); ++i )
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 41488530e0ea..f4212b6fdc0e 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -157,7 +157,7 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo
SwTxtAttr *pTxtAttr;
// While we've not reached the end of the StartArray && the TextAttribute starts at position 0...
while ( ( nStartIndex < pHints->GetStartCount() ) &&
- !(*(pTxtAttr=pHints->GetStart(nStartIndex))->GetStart()) )
+ !((pTxtAttr=pHints->GetStart(nStartIndex))->GetStart()) )
{
// open the TextAttributes
Chg( pTxtAttr );
@@ -199,7 +199,7 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos )
{
// schliesse die TextAttribute, deren StartPos vor
// oder an der alten nPos lag, die z.Z. geoeffnet sind.
- if (*pTxtAttr->GetStart() <= nPos) Rst( pTxtAttr );
+ if (pTxtAttr->GetStart() <= nPos) Rst( pTxtAttr );
nEndIndex++;
}
}
@@ -214,7 +214,7 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos )
// Solange wir noch nicht am Ende des StartArrays angekommen sind &&
// das TextAttribut vor oder an der neuen Position beginnt ...
while ( ( nStartIndex < pHints->GetStartCount() ) &&
- (*(pTxtAttr=pHints->GetStart(nStartIndex))->GetStart()<=nNewPos))
+ ((pTxtAttr=pHints->GetStart(nStartIndex))->GetStart()<=nNewPos) )
{
// open the TextAttributes, whose ends lie behind the new position
@@ -280,7 +280,7 @@ sal_Int32 SwAttrIter::GetNextAttr( ) const
SwTxtAttr *const pAttr(pHints->GetStart(i));
if (!pAttr->IsFormatIgnoreStart())
{
- nNext = *pAttr->GetStart();
+ nNext = pAttr->GetStart();
break;
}
}
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index abbfecafc3c4..8bf8437304d8 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1582,7 +1582,7 @@ sal_Int32 SwTxtFormatter::FormatLine(const sal_Int32 nStartPos)
}
else
{
- bBuild = ( GetInfo().GetTxtFly()->IsOn() && ChkFlyUnderflow(GetInfo()) )
+ bBuild = ( GetInfo().GetTxtFly().IsOn() && ChkFlyUnderflow(GetInfo()) )
|| GetInfo().CheckFtnPortion(pCurr);
if( bBuild )
{
@@ -1640,7 +1640,7 @@ sal_Int32 SwTxtFormatter::FormatLine(const sal_Int32 nStartPos)
// This corrects the start of the reformat range if something has
// moved to the next line. Otherwise IsFirstReformat in AllowRepaintOpt
// will give us a wrong result if we have to reformat another line
- GetInfo().GetParaPortion()->GetReformat()->LeftMove( GetInfo().GetIdx() );
+ GetInfo().GetParaPortion()->GetReformat().LeftMove( GetInfo().GetIdx() );
// delete master copy of rest portion
xSaveFld.reset();
@@ -1901,7 +1901,7 @@ bool SwTxtFormatter::CalcOnceMore()
SwTwips SwTxtFormatter::CalcBottomLine() const
{
SwTwips nRet = Y() + GetLineHeight();
- SwTwips nMin = GetInfo().GetTxtFly()->GetMinBottom();
+ SwTwips nMin = GetInfo().GetTxtFly().GetMinBottom();
if( nMin && ++nMin > nRet )
{
SwTwips nDist = pFrm->Frm().Height() - pFrm->Prt().Height()
@@ -1909,12 +1909,12 @@ SwTwips SwTxtFormatter::CalcBottomLine() const
if( nRet + nDist < nMin )
{
const bool bRepaint = HasTruncLines() &&
- GetInfo().GetParaPortion()->GetRepaint()->Bottom() == nRet-1;
+ GetInfo().GetParaPortion()->GetRepaint().Bottom() == nRet-1;
nRet = nMin - nDist;
if( bRepaint )
{
- ((SwRepaint*)GetInfo().GetParaPortion()
- ->GetRepaint())->Bottom( nRet-1 );
+ ((SwRepaint&)GetInfo().GetParaPortion()
+ ->GetRepaint()).Bottom( nRet-1 );
((SwTxtFormatInfo&)GetInfo()).SetPaintOfst( 0 );
}
}
@@ -2167,7 +2167,7 @@ void SwTxtFormatter::AlignFlyInCntBase( long nBaseLine ) const
bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
{
- OSL_ENSURE( rInf.GetTxtFly()->IsOn(), "SwTxtFormatter::ChkFlyUnderflow: why?" );
+ OSL_ENSURE( rInf.GetTxtFly().IsOn(), "SwTxtFormatter::ChkFlyUnderflow: why?" );
if( GetCurr() )
{
// First we check, whether a fly overlaps with the line.
@@ -2178,7 +2178,7 @@ bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
SwRect aLineVert( aLine );
if ( pFrm->IsVertical() )
pFrm->SwitchHorizontalToVertical( aLineVert );
- SwRect aInter( rInf.GetTxtFly()->GetFrm( aLineVert ) );
+ SwRect aInter( rInf.GetTxtFly().GetFrm( aLineVert ) );
if ( pFrm->IsVertical() )
pFrm->SwitchVerticalToHorizontal( aInter );
@@ -2198,7 +2198,7 @@ bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
aLineVert = aLine;
if ( pFrm->IsVertical() )
pFrm->SwitchHorizontalToVertical( aLineVert );
- aInter = rInf.GetTxtFly()->GetFrm( aLineVert );
+ aInter = rInf.GetTxtFly().GetFrm( aLineVert );
if ( pFrm->IsVertical() )
pFrm->SwitchVerticalToHorizontal( aInter );
@@ -2258,8 +2258,8 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
if( GetMulti() || rInf.GetFly() )
return;
- SwTxtFly *pTxtFly = rInf.GetTxtFly();
- if( !pTxtFly->IsOn() || rInf.IsIgnoreFly() )
+ SwTxtFly& rTxtFly = rInf.GetTxtFly();
+ if( !rTxtFly.IsOn() || rInf.IsIgnoreFly() )
return;
const SwLinePortion *pLast = rInf.GetLast();
@@ -2304,7 +2304,7 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
if ( pFrm->IsVertical() )
pFrm->SwitchHorizontalToVertical( aLineVert );
- SwRect aInter( pTxtFly->GetFrm( aLineVert ) );
+ SwRect aInter( rTxtFly.GetFrm( aLineVert ) );
if ( pFrm->IsRightToLeft() )
pFrm->SwitchRTLtoLTR( aInter );
@@ -2385,7 +2385,7 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
// or the next margin's top edge, which we need to respect.
// That means we can comfortably grow up to this value; that's how
// we save a few empty lines.
- long nNextTop = pTxtFly->GetNextTop();
+ long nNextTop = rTxtFly.GetNextTop();
if ( pFrm->IsVertical() )
nNextTop = pFrm->SwitchVerticalToHorizontal( nNextTop );
if( nNextTop > aInter.Bottom() )
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index fff6ea7488c5..5c34b7535ca1 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -503,7 +503,7 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
if ( pItem )
{
- const sal_Int32 nSt = *pTxtAttr->GetStart();
+ const sal_Int32 nSt = pTxtAttr->GetStart();
const sal_Int32 nEnd = *pTxtAttr->GetEnd();
if( nEnd > nSt )
{
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 6268c8c138cb..ac2f7dc5d6fd 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -351,7 +351,7 @@ void SwTxtIter::TruncLines( bool bNoteFollow )
if( RES_TXTATR_FLYCNT == pHt->Which() )
{
// check, if hint is in our range
- const sal_uInt16 nTmpPos = *pHt->GetStart();
+ const sal_uInt16 nTmpPos = pHt->GetStart();
if ( nEnd <= nTmpPos && nTmpPos < nRangeEnd )
pFollow->_InvalidateRange(
SwCharRange( nTmpPos, nTmpPos ), 0 );
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index d848bc1170ea..46d88b41dabb 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -198,7 +198,7 @@ sal_Int32 SwTxtFrm::CalcFlyPos( SwFrmFmt* pSearch )
OSL_ENSURE( pHints, "CalcFlyPos: Not Found!" );
if( !pFound )
return COMPLETE_STRING;
- return *pFound->GetStart();
+ return pFound->GetStart();
}
void SwFlyCntPortion::Paint( const SwTxtPaintInfo &rInf ) const
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 40e3a58238fa..3c8f77bc3ba0 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2081,7 +2081,7 @@ void SwScriptInfo::selectHiddenTextProperty(const SwTxtNode& rNode, MultiSelecti
static_cast<const SvxCharHiddenItem*>( CharFmt::GetItem( *pTxtAttr, RES_CHRATR_HIDDEN ) );
if( pHiddenItem )
{
- const sal_Int32 nSt = *pTxtAttr->GetStart();
+ const sal_Int32 nSt = pTxtAttr->GetStart();
const sal_Int32 nEnd = *pTxtAttr->End();
if( nEnd > nSt )
{
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 7d138cb5bb3c..64c8082d7908 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -276,12 +276,12 @@ public:
inline void ResetPreps();
// Get/Set methods
- inline SwRepaint *GetRepaint() { return &aRepaint; }
- inline const SwRepaint *GetRepaint() const { return &aRepaint; }
- inline SwCharRange *GetReformat() { return &aReformat; }
- inline const SwCharRange *GetReformat() const { return &aReformat; }
- inline long *GetDelta() { return &nDelta; }
- inline const long *GetDelta() const { return &nDelta; }
+ inline SwRepaint& GetRepaint() { return aRepaint; }
+ inline const SwRepaint& GetRepaint() const { return aRepaint; }
+ inline SwCharRange& GetReformat() { return aReformat; }
+ inline const SwCharRange& GetReformat() const { return aReformat; }
+ inline long& GetDelta() { return nDelta; }
+ inline const long& GetDelta() const { return nDelta; }
inline SwScriptInfo& GetScriptInfo() { return aScriptInfo; }
inline const SwScriptInfo& GetScriptInfo() const { return aScriptInfo; }
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index f9ccc77a16ed..b0909b7663f1 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -270,7 +270,7 @@ SwDoubleLinePortion::SwDoubleLinePortion(const SwMultiCreator& rCreate, sal_Int3
else
{
const SwTxtAttr& rAttr = *rCreate.pAttr;
- pBracket->nStart = *rAttr.GetStart();
+ pBracket->nStart = rAttr.GetStart();
const SfxPoolItem * const pItem =
CharFmt::GetItem( rAttr, RES_CHRATR_TWO_LINES );
@@ -864,7 +864,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( sal_Int32 &rPos,
for( i = 0; i < nCount; ++i )
{
const SwTxtAttr *pTmp = (*pHints)[i];
- sal_Int32 nStart = *pTmp->GetStart();
+ sal_Int32 nStart = pTmp->GetStart();
if( rPos < nStart )
break;
if( *pTmp->GetAnyEnd() > rPos )
@@ -958,18 +958,18 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( sal_Int32 &rPos,
const SwTxtAttr *pTmp = (*pHints)[i++];
if( *pTmp->GetAnyEnd() <= rPos )
continue;
- if( rPos < *pTmp->GetStart() )
+ if( rPos < pTmp->GetStart() )
{
// If bOn is false and the next attribute starts later than rPos
// the winner attribute is interrupted at rPos.
// If the start of the next attribute is behind the end of
// the last attribute on the aEnd-stack, this is the endposition
// on the stack is the end of the 2-line portion.
- if( !bOn || aEnd.back() < *pTmp->GetStart() )
+ if( !bOn || aEnd.back() < pTmp->GetStart() )
break;
// At this moment, bOn is true and the next attribute starts
// behind rPos, so we could move rPos to the next startpoint
- rPos = *pTmp->GetStart();
+ rPos = pTmp->GetStart();
// We clean up the aEnd-stack, endpositions equal to rPos are
// superfluous.
while( !aEnd.empty() && aEnd.back() <= rPos )
@@ -1038,11 +1038,11 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( sal_Int32 &rPos,
const SwTxtAttr *pTmp = (*pHints)[i++];
if( *pTmp->GetAnyEnd() <= n2Start )
continue;
- if( n2Start < *pTmp->GetStart() )
+ if( n2Start < pTmp->GetStart() )
{
- if( bOn || aEnd.back() < *pTmp->GetStart() )
+ if( bOn || aEnd.back() < pTmp->GetStart() )
break;
- n2Start = *pTmp->GetStart();
+ n2Start = pTmp->GetStart();
while( !aEnd.empty() && aEnd.back() <= n2Start )
{
bOn = !bOn;
@@ -1111,11 +1111,11 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( sal_Int32 &rPos,
const SwTxtAttr *pTmp = (*pHints)[i++];
if( *pTmp->GetAnyEnd() <= rPos )
continue;
- if( rPos < *pTmp->GetStart() )
+ if( rPos < pTmp->GetStart() )
{
- if( !bOn || aEnd.back() < *pTmp->GetStart() )
+ if( !bOn || aEnd.back() < pTmp->GetStart() )
break;
- rPos = *pTmp->GetStart();
+ rPos = pTmp->GetStart();
while( !aEnd.empty() && aEnd.back() <= rPos )
{
bOn = !bOn;
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 280acfdbb92d..e34f0f8915d7 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -224,7 +224,7 @@ SwTwips SwTxtFrm::EmptyHeight() const
else
{
SwFontAccess aFontAccess( &rTxtNode.GetAnyFmtColl(), pSh);
- pFnt = new SwFont( *aFontAccess.Get()->GetFont() );
+ pFnt = new SwFont( aFontAccess.Get()->GetFont() );
pFnt->ChkMagic( pSh, pFnt->GetActual() );
}
@@ -370,7 +370,7 @@ bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff )
{
SwViewShell *pSh = getRootFrm()->GetCurrShell();
SwFontAccess aFontAccess( pFmt, pSh );
- SwFont aFnt( *aFontAccess.Get()->GetFont() );
+ SwFont aFnt( aFontAccess.Get()->GetFont() );
OutputDevice *pOut = 0;
if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index f783ef335ac1..7fdc70127cf7 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -58,7 +58,7 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
// Build a font matching the default paragraph style:
SwFontAccess aFontAccess( &rTxtNode.GetAnyFmtColl(), pShell );
delete pFnt;
- pFnt = new SwFont( *aFontAccess.Get()->GetFont() );
+ pFnt = new SwFont( aFontAccess.Get()->GetFont() );
// set font to vertical if frame layout is vertical
bool bVertLayout = false;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index b7e8d67ed3ed..bd64f1cae05f 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -47,14 +47,14 @@ using namespace ::com::sun::star;
static bool lcl_IsDropFlyInter( const SwTxtFormatInfo &rInf,
sal_uInt16 nWidth, sal_uInt16 nHeight )
{
- const SwTxtFly *pTxtFly = rInf.GetTxtFly();
- if( pTxtFly && pTxtFly->IsOn() )
+ const SwTxtFly& rTxtFly = rInf.GetTxtFly();
+ if( rTxtFly.IsOn() )
{
SwRect aRect( rInf.GetTxtFrm()->Frm().Pos(), Size( nWidth, nHeight) );
aRect.Pos() += rInf.GetTxtFrm()->Prt().Pos();
aRect.Pos().X() += rInf.X();
aRect.Pos().Y() = rInf.Y();
- aRect = pTxtFly->GetFrm( aRect );
+ aRect = rTxtFly.GetFrm( aRect );
return aRect.HasArea();
}
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 84cd6156c2f9..d04227f6b370 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -418,8 +418,8 @@ static void checkApplyParagraphMarkFormatToNumbering( SwFont* pNumFnt, SwTxtForm
SwTxtAttr* hint = hints->GetTextHint( i );
// Formatting for the paragraph mark is set to apply only to the (non-existent) extra character
// the at end of the txt node.
- if( hint->Which() == RES_TXTATR_AUTOFMT && hint->GetStart() != NULL && hint->GetEnd() != NULL
- && *hint->GetStart() == *hint->GetEnd() && *hint->GetStart() == node->Len())
+ if( hint->Which() == RES_TXTATR_AUTOFMT && hint->GetEnd() != NULL
+ && hint->GetStart() == *hint->GetEnd() && hint->GetStart() == node->Len())
{
boost::shared_ptr<SfxItemSet> pSet(hint->GetAutoFmt().GetStyleHandle());
pNumFnt->SetDiffFnt( pSet.get(), pIDSA );
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 4871825e729e..0fe340f2eacb 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -443,7 +443,7 @@ void SwTxtFrm::HideFootnotes( sal_Int32 nStart, sal_Int32 nEnd )
const SwTxtAttr *pHt = (*pHints)[i];
if ( pHt->Which() == RES_TXTATR_FTN )
{
- const sal_Int32 nIdx = *pHt->GetStart();
+ const sal_Int32 nIdx = pHt->GetStart();
if ( nEnd < nIdx )
break;
if( nStart <= nIdx )
@@ -674,10 +674,10 @@ void SwTxtFrm::_InvalidateRange( const SwCharRange &aRange, const long nD)
// linelengths are being added, that's why it's negative
// if chars have been added and positive, if chars have
// deleted
- *(pPara->GetDelta()) += nD;
+ pPara->GetDelta() += nD;
bInv = true;
}
- SwCharRange &rReformat = *(pPara->GetReformat());
+ SwCharRange &rReformat = pPara->GetReformat();
if(aRange != rReformat) {
if( COMPLETE_STRING == rReformat.Len() )
rReformat = aRange;
@@ -725,14 +725,14 @@ void SwTxtFrm::CalcLineSpace()
SwTwips nDelta = aNewSize.Height() - Prt().Height();
// 4291: underflow with free-flying frames
- if( aInf.GetTxtFly()->IsOn() )
+ if( aInf.GetTxtFly().IsOn() )
{
SwRect aTmpFrm( Frm() );
if( nDelta < 0 )
aTmpFrm.Height( Prt().Height() );
else
aTmpFrm.Height( aNewSize.Height() );
- if( aInf.GetTxtFly()->Relax( aTmpFrm ) )
+ if( aInf.GetTxtFly().Relax( aTmpFrm ) )
{
Init();
return;
@@ -1019,7 +1019,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
case RES_TXTATR_FIELD:
case RES_TXTATR_ANNOTATION:
{
- nPos = *((SwFmtFld*)pNew)->GetTxtFld()->GetStart();
+ nPos = ((SwFmtFld*)pNew)->GetTxtFld()->GetStart();
if( IsIdxInside( nPos, 1 ) )
{
if( pNew == pOld )
@@ -1041,7 +1041,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
case RES_TXTATR_FTN :
{
- nPos = *((SwFmtFtn*)pNew)->GetTxtFtn()->GetStart();
+ nPos = ((SwFmtFtn*)pNew)->GetTxtFtn()->GetStart();
if( IsInFtn() || IsIdxInside( nPos, 1 ) )
Prepare( PREP_FTN, ((SwFmtFtn*)pNew)->GetTxtFtn() );
break;
@@ -1058,7 +1058,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if( SFX_ITEM_SET == rNewSet.GetItemState( RES_TXTATR_FTN, false, &pItem ))
{
- nPos = *((SwFmtFtn*)pItem)->GetTxtFtn()->GetStart();
+ nPos = ((SwFmtFtn*)pItem)->GetTxtFtn()->GetStart();
if( IsIdxInside( nPos, 1 ) )
Prepare( PREP_FTN, pNew );
nClear = 0x01;
@@ -1067,7 +1067,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if( SFX_ITEM_SET == rNewSet.GetItemState( RES_TXTATR_FIELD, false, &pItem ))
{
- nPos = *((SwFmtFld*)pItem)->GetTxtFld()->GetStart();
+ nPos = ((SwFmtFld*)pItem)->GetTxtFld()->GetStart();
if( IsIdxInside( nPos, 1 ) )
{
const SfxPoolItem& rOldItem =
@@ -1258,7 +1258,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const SwFmtFld *pFld = (const SwFmtFld *)pNew;
InvalidateRange(
- SwCharRange( *pFld->GetTxtFld()->GetStart(), 1 ) );
+ SwCharRange( pFld->GetTxtFld()->GetStart(), 1 ) );
}
}
break;
@@ -1527,7 +1527,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
else
{
// we are the TxtFrm _with_ the footnote
- const sal_Int32 nPos = *pFtn->GetStart();
+ const sal_Int32 nPos = pFtn->GetStart();
InvalidateRange( SwCharRange( nPos, 1 ), 1);
}
break;
@@ -1568,7 +1568,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
for ( sal_uInt16 i = 0; i < nSize; ++i )
{
const SwTxtAttr *pHt = (*pHints)[i];
- const sal_Int32 nStart = *pHt->GetStart();
+ const sal_Int32 nStart = pHt->GetStart();
if( nStart >= GetOfst() )
{
if( nStart >= nEnd )
@@ -1652,7 +1652,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
{
if( !IsLocked() )
{
- if( pPara->GetRepaint()->HasArea() )
+ if( pPara->GetRepaint().HasArea() )
SetCompletePaint();
Init();
pPara = 0;
@@ -1742,7 +1742,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
}
else
{
- if( pPara->GetRepaint()->HasArea() )
+ if( pPara->GetRepaint().HasArea() )
SetCompletePaint();
Init();
pPara = 0;
@@ -2417,8 +2417,8 @@ void SwTxtFrm::ChgThisLines()
// Extend repaint to the bottom.
if ( HasPara() )
{
- SwRepaint *pRepaint = GetPara()->GetRepaint();
- pRepaint->Bottom( std::max( pRepaint->Bottom(),
+ SwRepaint& rRepaint = GetPara()->GetRepaint();
+ rRepaint.Bottom( std::max( rRepaint.Bottom(),
Frm().Top()+Prt().Bottom()));
}
}
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 15c7021cb8b3..868bce76a316 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -66,7 +66,7 @@ bool SwTxtFrm::_IsFtnNumFrm() const
SwTxtFrm *SwTxtFrm::FindFtnRef( const SwTxtFtn *pFtn )
{
SwTxtFrm *pFrm = this;
- const bool bFwd = *pFtn->GetStart() >= GetOfst();
+ const bool bFwd = pFtn->GetStart() >= GetOfst();
while( pFrm )
{
if( SwFtnBossFrm::FindFtn( pFrm, pFtn ) )
@@ -103,7 +103,7 @@ void SwTxtFrm::CalcFtnFlag()
const SwTxtAttr *pHt = (*pHints)[i];
if ( pHt->Which() == RES_TXTATR_FTN )
{
- const sal_Int32 nIdx = *pHt->GetStart();
+ const sal_Int32 nIdx = pHt->GetStart();
if ( nEnd < nIdx )
break;
if( GetOfst() <= nIdx )
@@ -267,7 +267,7 @@ SwTwips SwTxtFrm::GetFtnLine( const SwTxtFtn *pFtn ) const
SwTxtInfo aInf( pThis );
SwTxtIter aLine( pThis, &aInf );
- const sal_Int32 nPos = *pFtn->GetStart();
+ const sal_Int32 nPos = pFtn->GetStart();
aLine.CharToLine( nPos );
SwTwips nRet = aLine.Y() + SwTwips(aLine.GetLineHeight());
@@ -421,7 +421,7 @@ void SwTxtFrm::RemoveFtn( const sal_Int32 nStart, const sal_Int32 nLen )
if ( RES_TXTATR_FTN != pHt->Which() )
continue;
- const sal_Int32 nIdx = *pHt->GetStart();
+ const sal_Int32 nIdx = pHt->GetStart();
if( nStart > nIdx )
break;
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 491e05044098..e2eb32badb06 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -125,7 +125,7 @@ bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
// In der letzten Zeile gibt es nie etwas zu trennen.
// Es sei denn, es befindet sich eine FlyPortion darin,
// oder es ist die letzte Zeile des Masters
- if( !GetNext() && !rInf.GetTxtFly()->IsOn() && !pFrm->GetFollow() )
+ if( !GetNext() && !rInf.GetTxtFly().IsOn() && !pFrm->GetFollow() )
return false;
sal_Int32 nWrdStart = nStart;
diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx
index 3e2581576bec..a02b5c7624d3 100644
--- a/sw/source/core/tox/ToxTextGenerator.cxx
+++ b/sw/source/core/tox/ToxTextGenerator.cxx
@@ -311,7 +311,7 @@ ToxTextGenerator::HandleTextToken(const SwTOXSortTabBase& source, SwAttrPool& po
clone->SetStyleHandle(attributesToClone);
result.autoFormats.push_back(clone);
- result.startPositions.push_back(stripper.GetPositionInStrippedString(*hint->GetStart()));
+ result.startPositions.push_back(stripper.GetPositionInStrippedString(hint->GetStart()));
result.endPositions.push_back(stripper.GetPositionInStrippedString(*hint->GetAnyEnd()));
}
return result;
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 819b94fb4610..2608d35a27c6 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -221,7 +221,7 @@ OUString SwTOXMark::GetText() const
OSL_ENSURE( pEndIdx, "TOXMark without mark!");
if( pEndIdx )
{
- const sal_Int32 nStt = *pTxtAttr->GetStart();
+ const sal_Int32 nStt = pTxtAttr->GetStart();
return pTxtAttr->GetpTxtNd()->GetExpandTxt( nStt, *pEndIdx-nStt );
}
}
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 80736682d924..ff7bc61234f4 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -142,7 +142,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
{
sal_Int32 n = 0;
if( pTxtMark )
- n = *pTxtMark->GetStart();
+ n = pTxtMark->GetStart();
SwTOXSource aTmp( pNd, n, pTxtMark && pTxtMark->GetTOXMark().IsMainEntry() );
aTOXSources.push_back(aTmp);
@@ -199,7 +199,7 @@ bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp )
if( TOX_SORT_CONTENT == nType )
{
bRet = bRet && pTxtMark && rCmp.pTxtMark &&
- *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart();
+ pTxtMark->GetStart() == rCmp.pTxtMark->GetStart();
if( bRet )
{
@@ -235,10 +235,10 @@ bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
{
if( TOX_SORT_CONTENT == nType && pTxtMark && rCmp.pTxtMark )
{
- if( *pTxtMark->GetStart() < *rCmp.pTxtMark->GetStart() )
+ if( pTxtMark->GetStart() < rCmp.pTxtMark->GetStart() )
return true;
- if( *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart() )
+ if( pTxtMark->GetStart() == rCmp.pTxtMark->GetStart() )
{
const sal_Int32 *pEnd = pTxtMark->End();
const sal_Int32 *pEndCmp = rCmp.pTxtMark->End();
@@ -371,8 +371,8 @@ void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 )
0 == (GetOptions() & nsSwTOIOptions::TOI_KEY_AS_ENTRY))
{
aRet.sText = ((SwTxtNode*)aTOXSources[0].pNd)->GetExpandTxt(
- *pTxtMark->GetStart(),
- *pEnd - *pTxtMark->GetStart());
+ pTxtMark->GetStart(),
+ *pEnd - pTxtMark->GetStart());
if(nsSwTOIOptions::TOI_INITIAL_CAPS & nOpt && pTOXIntl && !aRet.sText.isEmpty())
{
aRet.sText = pTOXIntl->ToUpper( aRet.sText, 0 ) + aRet.sText.copy(1);
@@ -450,8 +450,8 @@ TextAndReading SwTOXContent::GetText_Impl() const
{
return TextAndReading(
((SwTxtNode*)aTOXSources[0].pNd)->GetExpandTxt(
- *pTxtMark->GetStart(),
- *pEnd - *pTxtMark->GetStart() ),
+ pTxtMark->GetStart(),
+ *pEnd - pTxtMark->GetStart() ),
pTxtMark->GetTOXMark().GetTextReading());
}
@@ -463,8 +463,8 @@ void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16
const sal_Int32* pEnd = pTxtMark->End();
if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() )
((SwTxtNode*)aTOXSources[0].pNd)->GetExpandTxt( rNd, &rInsPos,
- *pTxtMark->GetStart(),
- *pEnd - *pTxtMark->GetStart() );
+ pTxtMark->GetStart(),
+ *pEnd - pTxtMark->GetStart() );
else
{
rNd.InsertText( GetTxt().sText, rInsPos );
@@ -663,7 +663,7 @@ SwTOXAuthority::SwTOXAuthority( const SwCntntNode& rNd,
m_rField(rField)
{
if(rField.GetTxtFld())
- nCntPos = *rField.GetTxtFld()->GetStart();
+ nCntPos = rField.GetTxtFld()->GetStart();
}
sal_uInt16 SwTOXAuthority::GetLevel() const
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index dc7bc1dfd9cb..b704710101a2 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -195,7 +195,7 @@ void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
SwDoc* pDoc = pPaM->GetDoc();
const SwTxtNode& rTxtNode = mpTxtFld->GetTxtNode();
pPaM->GetPoint()->nNode = rTxtNode;
- pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, *mpTxtFld->GetStart() );
+ pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, mpTxtFld->GetStart() );
OUString const aEntry( GetField()->ExpandField( pDoc->IsClipBoard() ) );
pPaM->SetMark();
@@ -448,9 +448,9 @@ void SwTxtFld::GetPamForTxtFld(
const SwTxtNode& rTxtNode = rTxtFld.GetTxtNode();
rPamForTxtFld.reset( new SwPaM( rTxtNode,
- ( (rTxtFld.End() != NULL) ? *(rTxtFld.End()) : ( *(rTxtFld.GetStart()) + 1 ) ),
+ (rTxtFld.End() != NULL) ? *(rTxtFld.End()) : ( rTxtFld.GetStart() + 1 ),
rTxtNode,
- *(rTxtFld.GetStart()) ) );
+ rTxtFld.GetStart() ) );
}
@@ -529,12 +529,12 @@ const OUString SwTxtInputFld::GetFieldContent() const
void SwTxtInputFld::UpdateFieldContent()
{
if ( IsFldInDoc()
- && (*GetStart()) != (*End()) )
+ && GetStart() != (*End()) )
{
- OSL_ENSURE( (*End()) - (*GetStart()) >= 2,
+ OSL_ENSURE( (*End()) - GetStart() >= 2,
"<SwTxtInputFld::UpdateFieldContent()> - Are CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" );
// skip CH_TXT_ATR_INPUTFIELDSTART character
- const sal_Int32 nIdx = (*GetStart()) + 1;
+ const sal_Int32 nIdx = GetStart() + 1;
// skip CH_TXT_ATR_INPUTFIELDEND character
const sal_Int32 nLen = static_cast<sal_Int32>(std::max<sal_Int32>( 0, ( (*End()) - 1 - nIdx ) ));
const OUString aNewFieldContent = GetTxtNode().GetExpandTxt( nIdx, nLen );
@@ -557,10 +557,10 @@ void SwTxtInputFld::UpdateTextNodeContent( const OUString& rNewContent )
return;
}
- OSL_ENSURE( (*End()) - (*GetStart()) >= 2,
+ OSL_ENSURE( (*End()) - GetStart() >= 2,
"<SwTxtInputFld::UpdateTextNodeContent(..)> - Are CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" );
// skip CH_TXT_ATR_INPUTFIELDSTART character
- const sal_Int32 nIdx = (*GetStart()) + 1;
+ const sal_Int32 nIdx = GetStart() + 1;
// skip CH_TXT_ATR_INPUTFIELDEND character
const sal_Int32 nDelLen = std::max<sal_Int32>( 0, ( (*End()) - 1 - nIdx ) );
SwIndex aIdx( &GetTxtNode(), nIdx );
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index a8cf81c84c37..51759e2b00b5 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -45,7 +45,7 @@ bool SwFmtFlyCnt::operator==( const SfxPoolItem& rAttr ) const
{
OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return( pTxtAttr && ((SwFmtFlyCnt&)rAttr).pTxtAttr &&
- *pTxtAttr->GetStart() == *((SwFmtFlyCnt&)rAttr).pTxtAttr->GetStart() &&
+ pTxtAttr->GetStart() == ((SwFmtFlyCnt&)rAttr).pTxtAttr->GetStart() &&
pFmt == ((SwFmtFlyCnt&)rAttr).GetFrmFmt() );
}
@@ -144,7 +144,7 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode )
SwDoc* pDoc = (SwDoc*)pNode->GetDoc();
- SwIndex aIdx( (SwTxtNode*)pNode, *GetStart() );
+ SwIndex aIdx( (SwTxtNode*)pNode, GetStart() );
SwPosition aPos( *pNode->StartOfSectionNode(), aIdx );
SwFrmFmt* pFmt = GetFlyCnt().GetFrmFmt();
SwFmtAnchor aAnchor( pFmt->GetAnchor() );
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 1a6fd1cb4a7c..de3583011b01 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1635,7 +1635,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
sal_uInt16 nDir = bBidiPor ?
1800 :
UnMapDirection(
- GetFont()->GetOrientation(),
+ GetFont().GetOrientation(),
bSwitchH2V );
switch ( nDir )
@@ -1686,7 +1686,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// anything to do?
if (rInf.GetWrong() || rInf.GetGrammarCheck() || rInf.GetSmartTags())
{
- CalcLinePosData aCalcLinePosData(rInf, *GetFont(),
+ CalcLinePosData aCalcLinePosData(rInf, GetFont(),
nCnt, bSwitchH2V, bSwitchL2R,
nHalfSpace, pKernArray, bBidiPor);
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 19304787680d..0a173ed208be 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -266,7 +266,7 @@ void SwDoDrawCapital::Do()
}
OSL_ENSURE( pUpperFnt, "No upper font, dying soon!");
- rInf.Shift( pUpperFnt->GetFont()->GetOrientation() );
+ rInf.Shift( pUpperFnt->GetFont().GetOrientation() );
rInf.SetWidth( nOrgWidth );
}
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx
index bd1a3ae8250d..63223e64e6d7 100644
--- a/sw/source/core/txtnode/modeltoviewhelper.cxx
+++ b/sw/source/core/txtnode/modeltoviewhelper.cxx
@@ -133,7 +133,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, sal_uInt16 eMode)
const SwTxtAttr* pAttr = (*pSwpHints2)[i];
if (pAttr->HasDummyChar())
{
- const sal_Int32 nDummyCharPos = *pAttr->GetStart();
+ const sal_Int32 nDummyCharPos = pAttr->GetStart();
if (aHiddenMulti.IsSelected(nDummyCharPos))
continue;
std::vector<block>::iterator aFind = std::find_if(aBlocks.begin(),
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index b2ec93036de3..e0b616e4c8a7 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -34,7 +34,7 @@ inline void DumpHints(const SwpHtStart &, const SwpHtEnd &) { }
static bool lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
- if ( *rHt1.GetStart() == *rHt2.GetStart() )
+ if ( rHt1.GetStart() == rHt2.GetStart() )
{
const sal_Int32 nHt1 = *rHt1.GetAnyEnd();
const sal_Int32 nHt2 = *rHt2.GetAnyEnd();
@@ -59,7 +59,7 @@ static bool lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
}
return ( nHt1 > nHt2 );
}
- return ( *rHt1.GetStart() < *rHt2.GetStart() );
+ return ( rHt1.GetStart() < rHt2.GetStart() );
}
// Zuerst nach Ende danach nach Ptr
@@ -69,7 +69,7 @@ static bool lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
const sal_Int32 nHt2 = *rHt2.GetAnyEnd();
if ( nHt1 == nHt2 )
{
- if ( *rHt1.GetStart() == *rHt2.GetStart() )
+ if ( rHt1.GetStart() == rHt2.GetStart() )
{
const sal_uInt16 nWhich1 = rHt1.Which();
const sal_uInt16 nWhich2 = rHt2.Which();
@@ -89,7 +89,7 @@ static bool lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
return ( nWhich1 < nWhich2 );
}
else
- return ( *rHt1.GetStart() > *rHt2.GetStart() );
+ return ( rHt1.GetStart() > rHt2.GetStart() );
}
return ( nHt1 < nHt2 );
}
@@ -191,7 +191,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
CHECK_ERR( 0xFF != *(unsigned char*)pHt, "HintsCheck: start ptr was deleted" );
// 3a) Stimmt die Start-Sortierung?
- sal_Int32 nIdx = *pHt->GetStart();
+ sal_Int32 nIdx = pHt->GetStart();
CHECK_ERR( nIdx >= nLastStart, "HintsCheck: starts are unsorted" );
// 4a) IsLessStart-Konsistenz
@@ -251,8 +251,8 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
&& (RES_TXTATR_AUTOFMT != pHtLast->Which()))
|| ( (RES_TXTATR_CHARFMT != pHtThis->Which())
&& (RES_TXTATR_AUTOFMT != pHtThis->Which()))
- || (*pHtThis->GetStart() >= *pHtLast->End()) // no overlap
- || ( ( (*pHtThis->GetStart() == *pHtLast->GetStart())
+ || (pHtThis->GetStart() >= *pHtLast->End()) // no overlap
+ || ( ( (pHtThis->GetStart() == pHtLast->GetStart())
&& (*pHtThis->End() == *pHtLast->End())
) // same range
&& ( (pHtThis->Which() != RES_TXTATR_AUTOFMT)
@@ -266,7 +266,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
->GetSortNumber())
) // multiple CHARFMT on same range need distinct sortnr
)
- || (*pHtThis->GetStart() == *pHtThis->End()), // this empty
+ || (pHtThis->GetStart() == *pHtThis->End()), // this empty
"HintsCheck: Portion inconsistency. "
"This can be temporarily ok during undo operations" );
@@ -279,7 +279,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
{
// mostly ignore the annoying no-length hints
// BuildPortions inserts these in the middle of an existing one
- bool const bNoLength(*pHt->GetStart() == *pHt->End());
+ bool const bNoLength(pHt->GetStart() == *pHt->End());
bool bNeedContinuation(!bNoLength && pHt->IsFormatIgnoreEnd());
bool bForbidContinuation(!bNoLength && !bNeedContinuation);
if (RES_TXTATR_AUTOFMT == pHt->Which())
@@ -297,15 +297,15 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
for (sal_uInt16 j = i + 1; j < Count(); ++j)
{
SwTxtAttr *const pOther(m_HintStarts[j]);
- if (*pOther->GetStart() > *pHt->End())
+ if (pOther->GetStart() > *pHt->End())
{
break; // done
}
- else if (*pOther->GetStart() == *pOther->GetAnyEnd())
+ else if (pOther->GetStart() == *pOther->GetAnyEnd())
{
continue; // empty hint: ignore
}
- else if (*pOther->GetStart() == *pHt->End())
+ else if (pOther->GetStart() == *pHt->End())
{
if (RES_TXTATR_AUTOFMT == pOther->Which() ||
RES_TXTATR_CHARFMT == pOther->Which())
@@ -346,8 +346,8 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
if ( pOther->IsNesting() && (i != j) )
{
SwComparePosition cmp = ComparePosition(
- *pHtThis->GetStart(), *pHtThis->End(),
- *pOther->GetStart(), *pOther->End());
+ pHtThis->GetStart(), *pHtThis->End(),
+ pOther->GetStart(), *pOther->End());
CHECK_ERR( (POS_OVERLAP_BEFORE != cmp) &&
(POS_OVERLAP_BEHIND != cmp),
"HintsCheck: overlapping nesting hints!!!" );
@@ -363,7 +363,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
SwTxtAttr const * const pOther( m_HintStarts[j] );
if (pOther->HasDummyChar())
{
- CHECK_ERR( (*pOther->GetStart() != *pHtThis->GetStart()),
+ CHECK_ERR( (pOther->GetStart() != pHtThis->GetStart()),
"HintsCheck: multiple hints claim same CH_TXTATR!");
}
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index ba6061d5f679..01f9e9a1f5f3 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -451,7 +451,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
else if ( pHt->DontExpand() )
{
const sal_Int32* const pEnd = pHt->GetEnd();
- if (pEnd && *pHt->GetStart() == *pEnd )
+ if (pEnd && pHt->GetStart() == *pEnd )
{
// delete it!
m_pSwpHints->DeleteAtPos( j );
@@ -533,7 +533,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
{
SwTxtAttr* const pHt = m_pSwpHints->GetTextHint( --j );
const sal_Int32* const pEnd = pHt->GetEnd();
- if ( pHt->DontExpand() && pEnd && (*pHt->GetStart() == *pEnd) )
+ if ( pHt->DontExpand() && pEnd && (pHt->GetStart() == *pEnd) )
{
// delete it!
m_pSwpHints->DeleteAtPos( j );
@@ -590,7 +590,7 @@ void SwTxtNode::MoveTxtAttr_To_AttrSet()
{
SwTxtAttr *pHt = m_pSwpHints->GetTextHint(i);
- if( *pHt->GetStart() )
+ if( pHt->GetStart() )
break;
const sal_Int32* pHtEndIdx = pHt->GetEnd();
@@ -844,16 +844,16 @@ void SwTxtNode::Update(
bool bTxtAttrChanged = false;
bool bStartOfTxtAttrChanged = false;
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n);
- sal_Int32 * const pStart = pHint->GetStart();
- if ( *pStart > nChangePos )
+ sal_Int32 & rStart = pHint->GetStart();
+ if ( rStart > nChangePos )
{
- if ( *pStart > nChangeEnd )
+ if ( rStart > nChangeEnd )
{
- *pStart = *pStart - nChangeLen;
+ rStart = rStart - nChangeLen;
}
else
{
- *pStart = nChangePos;
+ rStart = nChangePos;
}
bStartOfTxtAttrChanged = true;
}
@@ -903,11 +903,11 @@ void SwTxtNode::Update(
{
bool bTxtAttrChanged = false;
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n);
- sal_Int32 * const pStart = pHint->GetStart();
+ sal_Int32 & rStart = pHint->GetStart();
sal_Int32 * const pEnd = pHint->GetEnd();
- if ( *pStart >= nChangePos )
+ if ( rStart >= nChangePos )
{
- *pStart = *pStart + nChangeLen;
+ rStart = rStart + nChangeLen;
if ( pEnd )
{
*pEnd = *pEnd + nChangeLen;
@@ -1173,7 +1173,7 @@ bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag,
if( nIdx != *pEnd )
nPos = 0;
else if( bFlag != pTmp->DontExpand() && !pTmp->IsLockExpandFlag()
- && *pEnd > *pTmp->GetStart())
+ && *pEnd > pTmp->GetStart())
{
bRet = true;
m_pSwpHints->NoteInHistory( pTmp );
@@ -1219,7 +1219,7 @@ lcl_GetTxtAttrs(
for( sal_uInt16 i = 0; i < nSize; ++i )
{
SwTxtAttr *const pHint = pSwpHints->GetTextHint(i);
- sal_Int32 const nHintStart( *(pHint->GetStart()) );
+ sal_Int32 const nHintStart = pHint->GetStart();
if (nIndex < nHintStart)
{
return; // hints are sorted by start, so we are done...
@@ -1292,7 +1292,7 @@ const SwTxtInputFld* SwTxtNode::GetOverlappingInputFld( const SwTxtAttr& rTxtAtt
{
const SwTxtInputFld* pTxtInputFld = NULL;
- pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtAttrAt( *(rTxtAttr.GetStart()), RES_TXTATR_INPUTFIELD, PARENT ));
+ pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtAttrAt( rTxtAttr.GetStart(), RES_TXTATR_INPUTFIELD, PARENT ));
if ( pTxtInputFld == NULL && rTxtAttr.End() != NULL )
{
@@ -1461,7 +1461,7 @@ void lcl_CopyHint(
case RES_TXTATR_METAFIELD:
OSL_ENSURE( pNewHt, "copying Meta should not fail!" );
OSL_ENSURE( pDest
- && (CH_TXTATR_INWORD == pDest->GetTxt()[*pNewHt->GetStart()]),
+ && (CH_TXTATR_INWORD == pDest->GetTxt()[pNewHt->GetStart()]),
"missing CH_TXTATR?");
break;
}
@@ -1483,7 +1483,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const sal_Int32 nTxtStartIdx,
for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); i++ )
{
SwTxtAttr *const pHt = m_pSwpHints->GetTextHint(i);
- sal_Int32 const nAttrStartIdx = *pHt->GetStart();
+ sal_Int32 const nAttrStartIdx = pHt->GetStart();
if ( nTxtStartIdx < nAttrStartIdx )
break; // ueber das Textende, da nLen == 0
@@ -1659,7 +1659,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
//Achtung: kann ungueltig sein!!
for (sal_uInt16 n = 0; ( n < nSize ); ++n)
{
- const sal_Int32 nAttrStartIdx = *(*m_pSwpHints)[n]->GetStart();
+ const sal_Int32 nAttrStartIdx = (*m_pSwpHints)[n]->GetStart();
if (!( nAttrStartIdx < nEnd))
break;
@@ -1791,7 +1791,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
}
else
{
- const SwIndex aIdx( pDest, *pNewHt->GetStart() );
+ const SwIndex aIdx( pDest, pNewHt->GetStart() );
pDest->EraseText( aIdx, 1 );
}
}
@@ -1843,7 +1843,7 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
{
bool bMergePortionsNeeded(false);
for ( sal_uInt16 i = 0; i < m_pSwpHints->Count() &&
- rIdx >= *(*m_pSwpHints)[i]->GetStart(); ++i )
+ rIdx >= (*m_pSwpHints)[i]->GetStart(); ++i )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint( i );
sal_Int32 * const pEndIdx = pHt->GetEnd();
@@ -1857,8 +1857,8 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
&& pHt->DontExpand()) )
{
// bei leeren Attributen auch Start veraendern
- if( rIdx == *pHt->GetStart() )
- *pHt->GetStart() = *pHt->GetStart() - nLen;
+ if( rIdx == pHt->GetStart() )
+ pHt->GetStart() = pHt->GetStart() - nLen;
*pEndIdx = *pEndIdx - nLen;
m_pSwpHints->DeleteAtPos(i);
// could be that pHt has IsFormatIgnoreEnd set, and it's
@@ -1873,9 +1873,9 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
}
// empty hints at insert position?
else if ( (nMode & IDocumentContentOperations::INS_EMPTYEXPAND)
- && (*pEndIdx == *pHt->GetStart()) )
+ && (*pEndIdx == pHt->GetStart()) )
{
- *pHt->GetStart() = *pHt->GetStart() - nLen;
+ pHt->GetStart() = pHt->GetStart() - nLen;
const sal_uInt16 nAktLen = m_pSwpHints->Count();
m_pSwpHints->DeleteAtPos(i);
InsertHint( pHt/* AUTOSTYLES:, nsSetAttrMode::SETATTR_NOHINTADJUST*/ );
@@ -1891,12 +1891,12 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
}
}
if ( !(nMode & IDocumentContentOperations::INS_NOHINTEXPAND) &&
- rIdx == nLen && *pHt->GetStart() == rIdx.GetIndex() &&
+ rIdx == nLen && pHt->GetStart() == rIdx.GetIndex() &&
!pHt->IsDontExpandStartAttr() )
{
// Kein Feld, am Absatzanfang, HintExpand
m_pSwpHints->DeleteAtPos(i);
- *pHt->GetStart() = *pHt->GetStart() - nLen;
+ pHt->GetStart() = pHt->GetStart() - nLen;
// no effect on format ignore flags here (para start)
InsertHint( pHt, nsSetAttrMode::SETATTR_NOHINTADJUST );
}
@@ -1998,7 +1998,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
while ( m_pSwpHints && nAttrCnt < m_pSwpHints->Count() )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
- const sal_Int32 nAttrStartIdx = *pHt->GetStart();
+ const sal_Int32 nAttrStartIdx = pHt->GetStart();
if (!( nAttrStartIdx < nEnd ))
break;
const sal_Int32 * const pEndIdx = pHt->GetEnd();
@@ -2027,7 +2027,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// Attribut verschieben
m_pSwpHints->Delete( pHt );
// die Start/End Indicies neu setzen
- *pHt->GetStart() = nAttrStartIdx - nTxtStartIdx;
+ pHt->GetStart() = nAttrStartIdx - nTxtStartIdx;
if( pEndIdx )
*pHt->GetEnd() = *pEndIdx - nTxtStartIdx;
aArr.push_back( pHt );
@@ -2078,7 +2078,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
for ( sal_uInt16 n = 0; n < aArr.size(); ++n )
{
SwTxtAttr *const pNewHt = aArr[n];
- *pNewHt->GetStart() = nDestStart + *pNewHt->GetStart();
+ pNewHt->GetStart() = nDestStart + pNewHt->GetStart();
sal_Int32 * const pEndIdx = pNewHt->GetEnd();
if ( pEndIdx )
{
@@ -2150,7 +2150,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
while ( m_pSwpHints && (nAttrCnt < m_pSwpHints->Count()) )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
- const sal_Int32 nAttrStartIdx = *pHt->GetStart();
+ const sal_Int32 nAttrStartIdx = pHt->GetStart();
if (!( nAttrStartIdx < nEnd ))
break;
const sal_Int32 * const pEndIdx = pHt->GetEnd();
@@ -2193,7 +2193,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
{
bMergePortionsNeeded = true;
}
- *pHt->GetStart() =
+ pHt->GetStart() =
nDestStart + (nAttrStartIdx - nTxtStartIdx);
if( pEndIdx )
{
@@ -2244,7 +2244,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
while ( nAttrCnt < m_pSwpHints->Count() )
{
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
- if ( nEnd != *pHt->GetStart() )
+ if ( nEnd != pHt->GetStart() )
break;
const sal_Int32 * const pEndIdx = pHt->GetEnd();
if ( pEndIdx && *pEndIdx == nEnd )
@@ -2262,7 +2262,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
for ( sal_uInt16 n = 0; n < aArr.size(); ++n )
{
SwTxtAttr * const pHt = aArr[ n ];
- *pHt->GetStart() = *pHt->GetEnd() = rStart.GetIndex();
+ pHt->GetStart() = *pHt->GetEnd() = rStart.GetIndex();
InsertHint( pHt );
}
}
@@ -2308,7 +2308,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const sal_Int32 nCount,
{
SwTxtAttr *pHt = m_pSwpHints->GetTextHint(i);
- const sal_Int32 nHintStart = *pHt->GetStart();
+ const sal_Int32 nHintStart = pHt->GetStart();
if ( nHintStart < nStartIdx )
continue;
@@ -2406,11 +2406,11 @@ void SwTxtNode::GCAttr()
// wenn Ende und Start gleich sind --> loeschen
const sal_Int32 * const pEndIdx = pHt->GetEnd();
- if (pEndIdx && !pHt->HasDummyChar() && (*pEndIdx == *pHt->GetStart())
+ if (pEndIdx && !pHt->HasDummyChar() && (*pEndIdx == pHt->GetStart())
&& ( bAll || pHt->Which() == RES_TXTATR_INETFMT ) )
{
bChanged = true;
- nMin = std::min( nMin, *pHt->GetStart() );
+ nMin = std::min( nMin, pHt->GetStart() );
nMax = std::max( nMax, *pHt->GetEnd() );
DestroyAttr( m_pSwpHints->Cut(i) );
--i;
@@ -2690,7 +2690,7 @@ SwTxtAttr * SwTxtNode::GetTxtAttrForCharAt(
for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); ++i )
{
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(i);
- const sal_Int32 nStartPos = *pHint->GetStart();
+ const sal_Int32 nStartPos = pHint->GetStart();
if ( nIndex < nStartPos )
{
return 0;
@@ -3171,7 +3171,7 @@ bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); i++ )
{
const SwTxtAttr* pHt = (*m_pSwpHints)[i];
- const sal_Int32 nAttrStartIdx = *pHt->GetStart();
+ const sal_Int32 nAttrStartIdx = pHt->GetStart();
const sal_uInt16 nWhich = pHt->Which();
if (nIdx + nLen <= nAttrStartIdx)
break; // ueber das Textende
@@ -3409,7 +3409,7 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const sal_Int32 nDelLen,
if (pHint)
{
assert(!( pHint->GetEnd() && pHint->HasDummyChar()
- && (*pHint->GetStart() < nEndPos)
+ && (pHint->GetStart() < nEndPos)
&& (*pHint->GetEnd() > nEndPos) ));
// "deleting left-overlapped attribute with CH_TXTATR"
DeleteAttribute( pHint );
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index cae6296bf64e..294f28af0034 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -113,7 +113,7 @@ struct TxtAttrContains
TxtAttrContains( const sal_Int32 nPos ) : m_nPos( nPos ) { }
bool operator() (SwTxtAttrEnd * const pAttr)
{
- return (*pAttr->GetStart() < m_nPos) && (m_nPos < *pAttr->End());
+ return (pAttr->GetStart() < m_nPos) && (m_nPos < *pAttr->End());
}
};
@@ -354,7 +354,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
{
// INVARIANT: the nestable hints in the array are properly nested
const sal_uInt16 nNewWhich( rNewHint.Which() );
- const sal_Int32 nNewStart( *rNewHint.GetStart() );
+ const sal_Int32 nNewStart( rNewHint.GetStart() );
const sal_Int32 nNewEnd ( *rNewHint.GetEnd() );
const bool bNewSelfNestable( isSelfNestable(nNewWhich) );
@@ -379,7 +379,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
if (pOther->IsNesting())
{
const sal_uInt16 nOtherWhich( pOther->Which() );
- const sal_Int32 nOtherStart( *(pOther)->GetStart() );
+ const sal_Int32 nOtherStart( pOther->GetStart() );
const sal_Int32 nOtherEnd ( *(pOther)->GetEnd() );
if (isOverlap(nNewStart, nNewEnd, nOtherStart, nOtherEnd ))
{
@@ -423,9 +423,9 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
// should be corrected because it may lead to problems
// in SwXMeta::createEnumeration
// SplitNew is sorted, so this is the first split
- sal_Int32 *const pStart(SplitNew.front()->GetStart());
- OSL_ENSURE(*pStart == nNewStart, "how did that happen?");
- *pStart = nNewStart + 1;
+ sal_Int32& rStart(SplitNew.front()->GetStart());
+ OSL_ENSURE(rStart == nNewStart, "how did that happen?");
+ rStart = nNewStart + 1;
}
}
}
@@ -446,13 +446,13 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
for (NestList_t::iterator itOther = OverlappingExisting.begin();
itOther != OverlappingExisting.end(); ++itOther)
{
- const sal_Int32 nOtherStart( *(*itOther)->GetStart() );
+ const sal_Int32 nOtherStart( (*itOther)->GetStart() );
const sal_Int32 nOtherEnd ( *(*itOther)->GetEnd() );
for (NestList_t::iterator itNew = SplitNew.begin();
itNew != SplitNew.end(); ++itNew)
{
- const sal_Int32 nSplitNewStart( *(*itNew)->GetStart() );
+ const sal_Int32 nSplitNewStart( (*itNew)->GetStart() );
const sal_Int32 nSplitNewEnd ( *(*itNew)->GetEnd() );
// 4 cases: within, around, overlap l, overlap r, (OTHER: no action)
const bool bRemoveOverlap(
@@ -476,7 +476,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
case POS_OVERLAP_BEFORE:
{
Delete( *itOther ); // this also does NoteInHistory!
- *(*itOther)->GetStart() = nSplitNewEnd;
+ (*itOther)->GetStart() = nSplitNewEnd;
InsertNesting( **itOther );
if (!bRemoveOverlap)
{
@@ -536,7 +536,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
for (NestList_t::iterator itOther = OverwrittenExisting.begin();
itOther != OverwrittenExisting.end(); ++itOther)
{
- const sal_Int32 nOtherStart( *(*itOther)->GetStart() );
+ const sal_Int32 nOtherStart( (*itOther)->GetStart() );
const sal_Int32 nOtherEnd ( *(*itOther)->GetEnd() );
// overwritten portion is given by start/end of inserted hint
@@ -582,7 +582,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
{
const sal_uInt16 nWhich = rNewHint.Which();
- const sal_Int32 nThisStart = *rNewHint.GetStart();
+ const sal_Int32 nThisStart = rNewHint.GetStart();
const sal_Int32 nThisEnd = *rNewHint.GetEnd();
const bool bNoLengthAttribute = nThisStart == nThisEnd;
@@ -606,7 +606,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
RES_TXTATR_AUTOFMT != pOther->Which() )
continue;
- sal_Int32 nOtherStart = *pOther->GetStart();
+ sal_Int32 nOtherStart = pOther->GetStart();
const sal_Int32 nOtherEnd = *pOther->GetEnd();
// Check if start of new attribute overlaps with pOther:
@@ -620,7 +620,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
aInsDelHints.push_back( pNewAttr );
NoteInHistory( pOther );
- *pOther->GetStart() = nThisStart;
+ pOther->GetStart() = nThisStart;
NoteInHistory( pOther, true );
nOtherStart = nThisStart;
@@ -637,7 +637,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
aInsDelHints.push_back( pNewAttr );
NoteInHistory( pOther );
- *pOther->GetStart() = nThisEnd;
+ pOther->GetStart() = nThisEnd;
NoteInHistory( pOther, true );
}
}
@@ -671,7 +671,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
RES_TXTATR_AUTOFMT != pOther->Which() )
continue;
- const sal_Int32 nOtherStart = *pOther->GetStart();
+ const sal_Int32 nOtherStart = pOther->GetStart();
const sal_Int32 nOtherEnd = *pOther->End();
aBounds.insert( nOtherStart );
@@ -703,7 +703,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
RES_TXTATR_AUTOFMT != pOther->Which() )
continue;
- const sal_Int32 nOtherStart = *pOther->GetStart();
+ const sal_Int32 nOtherStart = pOther->GetStart();
if ( nOtherStart > nPorStart )
break;
@@ -1243,7 +1243,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
bool bHiddenPara = false;
- OSL_ENSURE( pAttr && *pAttr->GetStart() <= Len(), "StartIdx out of bounds!" );
+ OSL_ENSURE( pAttr && pAttr->GetStart() <= Len(), "StartIdx out of bounds!" );
OSL_ENSURE( !pAttr->GetEnd() || (*pAttr->GetEnd() <= Len()),
"EndIdx out of bounds!" );
@@ -1256,7 +1256,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
: IDocumentContentOperations::INS_EMPTYEXPAND;
// need this after TryInsertHint, when pAttr may be deleted
- const sal_Int32 nStart( *pAttr->GetStart() );
+ const sal_Int32 nStart( pAttr->GetStart() );
const bool bDummyChar( pAttr->HasDummyChar() );
if (bDummyChar)
{
@@ -1279,7 +1279,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
pFmt->GetItemState( RES_ANCHOR, false,
(const SfxPoolItem**)&pAnchor );
- SwIndex aIdx( this, *pAttr->GetStart() );
+ SwIndex aIdx( this, pAttr->GetStart() );
const OUString c(GetCharOfTxtAttr(*pAttr));
OUString const ins( InsertText(c, aIdx, nInsertFlags) );
if (ins.isEmpty())
@@ -1328,13 +1328,13 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
// loesche das Zeichen aus dem String !
OSL_ENSURE( ( CH_TXTATR_BREAKWORD ==
- m_Text[*pAttr->GetStart()] ||
+ m_Text[pAttr->GetStart()] ||
CH_TXTATR_INWORD ==
- m_Text[*pAttr->GetStart()]),
+ m_Text[pAttr->GetStart()]),
"where is my attribute character?" );
- m_Text = m_Text.replaceAt(*pAttr->GetStart(), 1, "");
+ m_Text = m_Text.replaceAt(pAttr->GetStart(), 1, "");
// Indizies Updaten
- SwIndex aTmpIdx( this, *pAttr->GetStart() );
+ SwIndex aTmpIdx( this, pAttr->GetStart() );
Update( aTmpIdx, 1, true );
}
// do not record deletion of Format!
@@ -1364,13 +1364,13 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
// loesche das Zeichen aus dem String !
OSL_ENSURE( ( CH_TXTATR_BREAKWORD ==
- m_Text[*pAttr->GetStart()] ||
+ m_Text[pAttr->GetStart()] ||
CH_TXTATR_INWORD ==
- m_Text[*pAttr->GetStart()]),
+ m_Text[pAttr->GetStart()]),
"where is my attribute character?" );
- m_Text = m_Text.replaceAt(*pAttr->GetStart(), 1, "");
+ m_Text = m_Text.replaceAt(pAttr->GetStart(), 1, "");
// Indizies Updaten
- SwIndex aTmpIdx( this, *pAttr->GetStart() );
+ SwIndex aTmpIdx( this, pAttr->GetStart() );
Update( aTmpIdx, 1, true );
}
DestroyAttr( pAttr );
@@ -1404,7 +1404,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// Wir muessen zuerst einfuegen, da sonst gleiche Indizes
// entstehen koennen und das Attribut im _SortArr_ am
// Dokument nicht eingetrage wird.
- SwIndex aNdIdx( this, *pAttr->GetStart() );
+ SwIndex aNdIdx( this, pAttr->GetStart() );
const OUString c(GetCharOfTxtAttr(*pAttr));
OUString const ins( InsertText(c, aNdIdx, nInsertFlags) );
if (ins.isEmpty())
@@ -1470,7 +1470,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// mitkopiert. In solchem Fall ist SETATTR_NOTXTATRCHR angegeben worden.
if( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nInsMode) )
{
- SwIndex aIdx( this, *pAttr->GetStart() );
+ SwIndex aIdx( this, pAttr->GetStart() );
OUString const ins( InsertText(OUString(GetCharOfTxtAttr(*pAttr)),
aIdx, nInsertFlags) );
if (ins.isEmpty())
@@ -1504,7 +1504,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
if( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nMode) )
{
- SwIndex aIdx( this, *pAttr->GetStart() );
+ SwIndex aIdx( this, pAttr->GetStart() );
InsertText( OUString(CH_TXT_ATR_INPUTFIELDSTART), aIdx, nInsertFlags );
const OUString aContent = pTxtInputFld->GetFieldContent();
InsertText( aContent, aIdx, nInsertFlags );
@@ -1521,9 +1521,9 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
else
{
// assure that CH_TXT_ATR_INPUTFIELDSTART and CH_TXT_ATR_INPUTFIELDEND are inserted.
- if ( m_Text[ *(pAttr->GetStart()) ] != CH_TXT_ATR_INPUTFIELDSTART )
+ if ( m_Text[ pAttr->GetStart() ] != CH_TXT_ATR_INPUTFIELDSTART )
{
- SwIndex aIdx( this, *pAttr->GetStart() );
+ SwIndex aIdx( this, pAttr->GetStart() );
InsertText( OUString(CH_TXT_ATR_INPUTFIELDSTART), aIdx, nInsertFlags );
bInputFieldStartCharInserted = true;
sal_Int32* const pEnd(pAttr->GetEnd());
@@ -1569,9 +1569,9 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
}
else
{
- if ( *(pAttr->GetStart()) > *(pTxtInputFld->GetStart()) )
+ if ( pAttr->GetStart() > pTxtInputFld->GetStart() )
{
- *(pAttr->GetStart()) = *(pTxtInputFld->GetStart());
+ pAttr->GetStart() = pTxtInputFld->GetStart();
}
if ( *(pAttr->End()) < *(pTxtInputFld->End()) )
{
@@ -1647,21 +1647,21 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
if ( pAttr->HasDummyChar() )
{
// Unbedingt Copy-konstruieren!
- const SwIndex aIdx( this, *pAttr->GetStart() );
+ const SwIndex aIdx( this, pAttr->GetStart() );
// erase the CH_TXTATR, which will also delete pAttr
EraseText( aIdx, 1 );
}
else if ( pAttr->HasContent() )
{
- const SwIndex aIdx( this, *pAttr->GetStart() );
+ const SwIndex aIdx( this, pAttr->GetStart() );
OSL_ENSURE( pAttr->End() != NULL, "<SwTxtNode::DeleteAttribute(..)> - missing End() at <SwTxtAttr> instance which has content" );
- EraseText( aIdx, *pAttr->End() - *pAttr->GetStart() );
+ EraseText( aIdx, *pAttr->End() - pAttr->GetStart() );
}
else
{
// create MsgHint before start/end become invalid
SwUpdateAttr aHint(
- *pAttr->GetStart(), *pAttr->GetEnd(), pAttr->Which() );
+ pAttr->GetStart(), *pAttr->GetEnd(), pAttr->Which() );
m_pSwpHints->Delete( pAttr );
SwTxtAttr::Destroy( pAttr, GetDoc()->GetAttrPool() );
NotifyClients( 0, &aHint );
@@ -1682,7 +1682,7 @@ void SwTxtNode::DeleteAttributes(
for ( sal_uInt16 nPos = 0; m_pSwpHints && nPos < m_pSwpHints->Count(); nPos++ )
{
SwTxtAttr * const pTxtHt = m_pSwpHints->GetTextHint( nPos );
- const sal_Int32 nHintStart = *(pTxtHt->GetStart());
+ const sal_Int32 nHintStart = pTxtHt->GetStart();
if (nStart < nHintStart)
{
break; // sorted by start
@@ -2092,7 +2092,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
for (sal_uInt16 n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
- const sal_Int32 nAttrStart = *pHt->GetStart();
+ const sal_Int32 nAttrStart = pHt->GetStart();
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
@@ -2119,7 +2119,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
for (sal_uInt16 n = 0; n < nSize; ++n)
{
const SwTxtAttr* pHt = (*m_pSwpHints)[n];
- const sal_Int32 nAttrStart = *pHt->GetStart();
+ const sal_Int32 nAttrStart = pHt->GetStart();
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
@@ -2346,7 +2346,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength,
const sal_uInt16 nWhich(pHint->Which());
if (nWhich == RES_TXTATR_CHARFMT || nWhich == RES_TXTATR_AUTOFMT)
{
- const AttrSpan_t aSpan(*pHint->GetStart(), *pHint->End());
+ const AttrSpan_t aSpan(pHint->GetStart(), *pHint->End());
o_rSpanMap.insert(AttrSpanMap_t::value_type(aSpan, pHint));
// < not != because there may be multiple CHARFMT at same range
@@ -2661,7 +2661,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
{
// fdo#70201: eliminate no-extent RSID-only AUTOFMT
// could be produced by ReplaceText or (maybe?) RstAttr
- if (*pHt->GetStart() == *pHt->GetEnd())
+ if (pHt->GetStart() == *pHt->GetEnd())
{
SwpHintsArray::DeleteAtPos(i); // kill it without History!
SwTxtAttr::Destroy(pHt, rNode.GetDoc()->GetAttrPool());
@@ -2680,14 +2680,14 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
}
}
- if (*pHt->GetStart() == *pHt->GetEnd())
+ if (pHt->GetStart() == *pHt->GetEnd())
{
// no-length hints are a disease. ignore them here.
// the SwAttrIter::SeekFwd will not call Rst/Chg for them.
continue;
}
- const sal_Int32 nPorStart = *pHt->GetStart();
+ const sal_Int32 nPorStart = pHt->GetStart();
if (nPorStart != nLastPorStart)
++nKey;
nLastPorStart = nPorStart;
@@ -2731,7 +2731,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
{
// first of all test if there's no gap (before skipping stuff!)
if (aIter1 != aRange1.second && aIter2 != aRange2.second &&
- *aIter1->second.first->End() < *aIter2->second.first->GetStart())
+ *aIter1->second.first->End() < aIter2->second.first->GetStart())
{
eMerge = DIFFER;
break;
@@ -2900,7 +2900,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
// check if there is already a character format and adjust the sort numbers
static void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharFmt )
{
- const sal_Int32 nHtStart = *rNewCharFmt.GetStart();
+ const sal_Int32 nHtStart = rNewCharFmt.GetStart();
const sal_Int32 nHtEnd = *rNewCharFmt.GetEnd();
sal_uInt16 nSortNumber = 0;
@@ -2908,7 +2908,7 @@ static void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharF
{
const SwTxtAttr* pOtherHt = rHints[i];
- const sal_Int32 nOtherStart = *pOtherHt->GetStart();
+ const sal_Int32 nOtherStart = pOtherHt->GetStart();
if ( nOtherStart > nHtStart )
break;
@@ -2974,7 +2974,7 @@ bool SwpHints::TryInsertHint(
case RES_TXTATR_AUTOFMT:
{
boost::shared_ptr<SfxItemSet> const pSet( pHint->GetAutoFmt().GetStyleHandle() );
- if (*pHint->GetStart() == *pHint->GetEnd())
+ if (pHint->GetStart() == *pHint->GetEnd())
{
if (pSet->Count() == 1 && pSet->GetItem(RES_CHRATR_RSID, false))
{ // empty range RSID-only hints could cause trouble, there's no
@@ -3102,8 +3102,8 @@ bool SwpHints::TryInsertHint(
0 != ( pTmpHintEnd = pHint->GetEnd() ) )
{
SwComparePosition eCmp = ::ComparePosition(
- *pTmpHt->GetStart(), *pTmpHtEnd,
- *pHint->GetStart(), *pTmpHintEnd );
+ pTmpHt->GetStart(), *pTmpHtEnd,
+ pHint->GetStart(), *pTmpHintEnd );
bool bDelOld = true, bChgStart = false, bChgEnd = false;
switch( eCmp )
{
@@ -3120,7 +3120,7 @@ bool SwpHints::TryInsertHint(
}
if( bChgStart )
- *pHint->GetStart() = *pTmpHt->GetStart();
+ pHint->GetStart() = pTmpHt->GetStart();
if( bChgEnd )
*pTmpHintEnd = *pTmpHtEnd;
@@ -3159,7 +3159,7 @@ bool SwpHints::TryInsertHint(
// Sie werden natuerlich in das Array insertet, aber sie werden nicht
// in die pPrev/Next/On/Off-Verkettung aufgenommen.
// Der Formatierer erkennt diese TxtHints an dem CH_TXTATR_.. im Text !
- sal_Int32 nHtStart = *pHint->GetStart();
+ sal_Int32 nHtStart = pHint->GetStart();
if( !pHtEnd )
{
SwpHintsArray::Insert( pHint );
@@ -3185,9 +3185,9 @@ bool SwpHints::TryInsertHint(
"+SwpHints::Insert: invalid hint, end < start" );
// Wir drehen den Quatsch einfach um:
- *pHint->GetStart() = *pHtEnd;
+ pHint->GetStart() = *pHtEnd;
*pHtEnd = nHtStart;
- nHtStart = *pHint->GetStart();
+ nHtStart = pHint->GetStart();
}
// I need this value later on for notification but the pointer may become invalid
@@ -3364,7 +3364,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
{
// ist der Attribut-Anfang schon groesser als der Idx ?
const SwTxtAttr *pHt = m_pSwpHints->operator[](i);
- const sal_Int32 nAttrStart = *pHt->GetStart();
+ const sal_Int32 nAttrStart = pHt->GetStart();
if( nEnd < nAttrStart )
break;
diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx
index 5fc1f4a8255d..e8499ac664c5 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -203,7 +203,7 @@ void SwTxtAttrIterator::SearchNextChg()
{
const SwTxtAttr* pHt = (*pHts)[ nAttrPos ];
const sal_Int32* pEnd = pHt->End();
- const sal_Int32 nHtStt = *pHt->GetStart();
+ const sal_Int32 nHtStt = pHt->GetStart();
if( nHtStt < nStt && ( !pEnd || *pEnd <= nStt ))
continue;
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index c8f8daa56c37..e676498d8c9e 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -59,7 +59,7 @@ void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolIte
if ( m_pTxtNode )
{
- SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
+ SwUpdateAttr aUpdateAttr( GetStart(), *GetEnd(), nWhich );
m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -167,7 +167,7 @@ void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if ( m_pTxtNode )
{
- SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
+ SwUpdateAttr aUpdateAttr( GetStart(), *GetEnd(), nWhich );
m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -212,7 +212,7 @@ void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
if ( m_pTxtNode )
{
- SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
+ SwUpdateAttr aUpdateAttr( GetStart(), *GetEnd(), nWhich );
m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 6c2adee3c350..af8e9f2a10e3 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -392,9 +392,9 @@ void SwTxtNode::RstTxtAttr(
}
if ( pTxtInputFld != NULL )
{
- if ( nStt > *(pTxtInputFld->GetStart()) )
+ if ( nStt > pTxtInputFld->GetStart() )
{
- nStt = *(pTxtInputFld->GetStart());
+ nStt = pTxtInputFld->GetStart();
}
if ( nEnd < *(pTxtInputFld->End()) )
{
@@ -420,7 +420,7 @@ void SwTxtNode::RstTxtAttr(
sal_Int32 nAttrStart;
SwTxtAttr *pHt = NULL;
while ( (i < m_pSwpHints->Count())
- && ( ( ( nAttrStart = *(*m_pSwpHints)[i]->GetStart()) < nEnd )
+ && ( ( ( nAttrStart = (*m_pSwpHints)[i]->GetStart()) < nEnd )
|| nLen==0 ) )
{
pHt = m_pSwpHints->GetTextHint(i);
@@ -531,7 +531,7 @@ void SwTxtNode::RstTxtAttr(
{
m_pSwpHints->NoteInHistory( pHt );
// UGLY: this may temporarily destroy the sorting!
- *pHt->GetStart() = nEnd;
+ pHt->GetStart() = nEnd;
m_pSwpHints->NoteInHistory( pHt, true );
if ( pStyleHandle.get() && nAttrStart < nEnd )
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index f7c696c921c0..c5cfc3409597 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -194,7 +194,7 @@ void SwHistoryResetFmt::SetInDoc( SwDoc* pDoc, bool )
SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTXTHNT )
, m_nNodeIndex( nNodePos )
- , m_nStart( *pTxtHt->GetStart() )
+ , m_nStart( pTxtHt->GetStart() )
, m_nEnd( *pTxtHt->GetAnyEnd() )
, m_bFormatIgnoreStart(pTxtHt->IsFormatIgnoreStart())
, m_bFormatIgnoreEnd (pTxtHt->IsFormatIgnoreEnd ())
@@ -272,7 +272,7 @@ SwHistorySetTxtFld::SwHistorySetTxtFld( SwTxtFld* pTxtFld, sal_uLong nNodePos )
m_pFld->GetField()->ChgTyp( m_pFldType.get() ); // change field type
}
m_nNodeIndex = nNodePos;
- m_nPos = *pTxtFld->GetStart();
+ m_nPos = pTxtFld->GetStart();
}
OUString SwHistorySetTxtFld::GetDescription() const
@@ -316,7 +316,7 @@ SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNodeP
: SwHistoryHint( HSTRY_SETREFMARKHNT )
, m_RefName( pTxtHt->GetRefMark().GetRefName() )
, m_nNodeIndex( nNodePos )
- , m_nStart( *pTxtHt->GetStart() )
+ , m_nStart( pTxtHt->GetStart() )
, m_nEnd( *pTxtHt->GetAnyEnd() )
{
}
@@ -345,7 +345,7 @@ SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodeP
, m_TOXName( m_TOXMark.GetTOXType()->GetTypeName() )
, m_eTOXTypes( m_TOXMark.GetTOXType()->GetType() )
, m_nNodeIndex( nNodePos )
- , m_nStart( *pTxtHt->GetStart() )
+ , m_nStart( pTxtHt->GetStart() )
, m_nEnd( *pTxtHt->GetAnyEnd() )
{
m_TOXMark.DeRegister();
@@ -417,7 +417,7 @@ SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePo
, m_pUndo( new SwUndoSaveSection )
, m_FootnoteNumber( pTxtFtn->GetFtn().GetNumStr() )
, m_nNodeIndex( nNodePos )
- , m_nStart( *pTxtFtn->GetStart() )
+ , m_nStart( pTxtFtn->GetStart() )
, m_bEndNote( pTxtFtn->GetFtn().IsEndNote() )
{
OSL_ENSURE( pTxtFtn->GetStartNode(),
@@ -442,7 +442,7 @@ SwHistorySetFootnote::SwHistorySetFootnote( const SwTxtFtn &rTxtFtn )
, m_pUndo( 0 )
, m_FootnoteNumber( rTxtFtn.GetFtn().GetNumStr() )
, m_nNodeIndex( _SwTxtFtn_GetIndex( (&rTxtFtn) ) )
- , m_nStart( *rTxtFtn.GetStart() )
+ , m_nStart( rTxtFtn.GetStart() )
, m_bEndNote( rTxtFtn.GetFtn().IsEndNote() )
{
OSL_ENSURE( rTxtFtn.GetStartNode(),
@@ -1042,7 +1042,7 @@ void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
}
else
{
- pHt = new SwHistoryResetTxt( pHint->Which(), *pHint->GetStart(),
+ pHt = new SwHistoryResetTxt( pHint->Which(), pHint->GetStart(),
*pHint->GetAnyEnd(), nNodeIdx );
}
m_SwpHstry.push_back( pHt );
@@ -1231,7 +1231,7 @@ void SwHistory::CopyAttr(
{
// nAttrStt must even be set when !pEndIdx
pHt = pHts->GetTextHint(n);
- const sal_Int32 nAttrStt = *pHt->GetStart();
+ const sal_Int32 nAttrStt = pHt->GetStart();
if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt > nEnd )
break;
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 2f482e38a24d..ed0ac1ce43c9 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -328,7 +328,7 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
case RES_GRFFMTCOLL:
{
SwNoTxtNode *const pNd =
- rContext.GetRepeatPaM().GetNode()->GetNoTxtNode();
+ rContext.GetRepeatPaM().GetNode().GetNoTxtNode();
if( pNd )
{
rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() );
@@ -339,7 +339,7 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
case RES_TXTFMTCOLL:
{
SwTxtNode *const pNd =
- rContext.GetRepeatPaM().GetNode()->GetTxtNode();
+ rContext.GetRepeatPaM().GetNode().GetTxtNode();
if( pNd )
{
rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() );
@@ -353,7 +353,7 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
// Steps: search in all FlyFrmFormats for the FlyCntnt attribute
// and validate if the cursor is in the respective section
SwFrmFmt *const pFly =
- rContext.GetRepeatPaM().GetNode()->GetFlyFmt();
+ rContext.GetRepeatPaM().GetNode().GetFlyFmt();
if( pFly )
{
// Bug 43672: do not set all attributes!
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 839550ef80ab..7e1074cb7fcd 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -343,7 +343,7 @@ SwUndoDelete::SwUndoDelete(
nNdDiff -= rPam.GetPoint()->nNode.GetIndex();
}
- if( !rPam.GetNode()->IsCntntNode() )
+ if( !rPam.GetNode().IsCntntNode() )
rPam.GetPoint()->nContent.Assign( 0, 0 );
// is a history necessary here at all?
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 78697dcf1a80..f99b377537b4 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -97,9 +97,9 @@ void SwUndRng::SetPaM( SwPaM & rPam, bool bCorrToCntnt ) const
{
rPam.DeleteMark();
rPam.GetPoint()->nNode = nSttNode;
- SwNode* pNd = rPam.GetNode();
- if( pNd->IsCntntNode() )
- rPam.GetPoint()->nContent.Assign( pNd->GetCntntNode(), nSttCntnt );
+ SwNode& rNd = rPam.GetNode();
+ if( rNd.IsCntntNode() )
+ rPam.GetPoint()->nContent.Assign( rNd.GetCntntNode(), nSttCntnt );
else if( bCorrToCntnt )
rPam.Move( fnMoveForward, fnGoCntnt );
else
@@ -113,8 +113,8 @@ void SwUndRng::SetPaM( SwPaM & rPam, bool bCorrToCntnt ) const
return; // nothing left to do
rPam.GetPoint()->nNode = nEndNode;
- if( (pNd = rPam.GetNode())->IsCntntNode() )
- rPam.GetPoint()->nContent.Assign( pNd->GetCntntNode(), nEndCntnt );
+ if( rPam.GetNode().IsCntntNode() )
+ rPam.GetPoint()->nContent.Assign( rPam.GetNode().GetCntntNode(), nEndCntnt );
else if( bCorrToCntnt )
rPam.Move( fnMoveBackward, fnGoCntnt );
else
@@ -333,7 +333,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
SwDoc& rDoc = *rPaM.GetDoc();
::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
- SwNoTxtNode* pCpyNd = rPaM.GetNode()->GetNoTxtNode();
+ SwNoTxtNode* pCpyNd = rPaM.GetNode().GetNoTxtNode();
// here comes the actual delete (move)
SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
@@ -387,7 +387,7 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
GoInCntnt( aPaM, fnMoveBackward );
}
- SwTxtNode* pTxtNd = aPaM.GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = aPaM.GetNode().GetTxtNode();
if (!pEndNdIdx && pTxtNd)
{
if( pEndCntIdx )
@@ -498,7 +498,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
&( pSrch = rFtnArr[ nPos ] )->GetTxtNode())->GetIndex()
<= pEnd->nNode.GetIndex() )
{
- const sal_Int32 nFtnSttIdx = *pSrch->GetStart();
+ const sal_Int32 nFtnSttIdx = pSrch->GetStart();
if( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType )
? (&pEnd->nNode.GetNode() == pFtnNd )
: (( &pStt->nNode.GetNode() == pFtnNd &&
@@ -528,7 +528,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
while( nPos-- && ( pFtnNd = &( pSrch = rFtnArr[ nPos ] )->
GetTxtNode())->GetIndex() >= pStt->nNode.GetIndex() )
{
- const sal_Int32 nFtnSttIdx = *pSrch->GetStart();
+ const sal_Int32 nFtnSttIdx = pSrch->GetStart();
if( !(nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType) && (
( &pStt->nNode.GetNode() == pFtnNd &&
pStt->nContent.GetIndex() > nFtnSttIdx ) ||
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 126807d5676c..38893d497ee1 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -311,7 +311,7 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
{
SwStartNode const*const pSttNd =
- rContext.GetRepeatPaM().GetNode()->FindFlyStartNode();
+ rContext.GetRepeatPaM().GetNode().FindFlyStartNode();
if( pSttNd )
{
SwPosition aPos( *pSttNd );
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 10c1b7ee1329..e18a02e8a7e3 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -680,7 +680,7 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext)
pDoc->DeleteAndJoin( rPam );
rPam.DeleteMark();
- pNd = rPam.GetNode()->GetTxtNode();
+ pNd = rPam.GetNode().GetTxtNode();
OSL_ENSURE( pNd, "Dude, where's my TextNode?" );
aIdx.Assign( pNd, m_nSttCnt );
}
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index c7ff4f34f57e..8b4812acb83e 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -232,8 +232,8 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
aPam.Exchange();
aPam.DeleteMark();
- if( aPam.GetNode()->IsCntntNode() )
- aPam.GetNode()->GetCntntNode()->ResetAllAttr();
+ if( aPam.GetNode().IsCntntNode() )
+ aPam.GetNode().GetCntntNode()->ResetAllAttr();
// the Pam will be dropped now
}
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index cf36e15d65ca..03a6d7250fdd 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -177,7 +177,7 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
- SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = pAktPam->GetNode().GetTxtNode();
OSL_ENSURE( pTxtNd, "Overwrite not in a TextNode?" );
SwIndex& rIdx = pAktPam->GetPoint()->nContent;
rIdx.Assign( pTxtNd, nSttCntnt );
@@ -259,7 +259,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
- SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = pAktPam->GetNode().GetTxtNode();
OSL_ENSURE( pTxtNd, "Overwrite not in TextNode?" );
SwIndex& rIdx = pAktPam->GetPoint()->nContent;
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 283bf307cb91..4c31ca31b2f0 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -146,7 +146,7 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
const SwTxtNode* pTNd;
if( UNDO_DELETE == mnUserId &&
nSttNode == nEndNode && nSttCntnt + 1 == nEndCntnt &&
- 0 != (pTNd = rRange.GetNode()->GetTxtNode()) )
+ 0 != (pTNd = rRange.GetNode().GetTxtNode()) )
{
sal_Unicode const cCh = pTNd->GetTxt()[nSttCntnt];
if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
@@ -428,19 +428,16 @@ void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext)
if( pCSttNd && !pCEndNd)
{
// #112139# Do not step behind the end of content.
- SwNode * pTmp = pPam->GetNode(true);
- if (pTmp)
+ SwNode & rTmp = pPam->GetNode(true);
+ SwNode * pEnd = pDoc->GetNodes().DocumentSectionEndNode(&rTmp);
+
+ if (&rTmp != pEnd)
{
- SwNode * pEnd = pDoc->GetNodes().DocumentSectionEndNode(pTmp);
-
- if (pTmp != pEnd)
- {
- pPam->SetMark();
- pPam->GetPoint()->nNode++;
- pPam->GetBound( true ).nContent.Assign( 0, 0 );
- pPam->GetBound( false ).nContent.Assign( 0, 0 );
- pUnDel2 = new SwUndoDelete( *pPam, true );
- }
+ pPam->SetMark();
+ pPam->GetPoint()->nNode++;
+ pPam->GetBound( true ).nContent.Assign( 0, 0 );
+ pPam->GetBound( false ).nContent.Assign( 0, 0 );
+ pUnDel2 = new SwUndoDelete( *pPam, true );
}
}
pPam->DeleteMark();
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index e7d791e4dbb6..5316daa0a64b 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -224,7 +224,7 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
delete *it;
aIdxList.clear();
SetPaM(rPam, true);
- SwTxtNode const*const pTNd = rPam.GetNode()->GetTxtNode();
+ SwTxtNode const*const pTNd = rPam.GetNode().GetTxtNode();
if( pTNd )
{
rPam.GetPoint()->nContent = pTNd->GetTxt().getLength();
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 53dd57ba49a9..704673bd64c9 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -149,7 +149,7 @@ void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
rPam.GetPoint()->nNode = nNode;
- SwTxtNode * pTNd = rPam.GetNode()->GetTxtNode();
+ SwTxtNode * pTNd = rPam.GetNode().GetTxtNode();
OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTxtNode expected");
if (pTNd)
{
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index f40696f94797..54ce92d8a1c7 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -500,7 +500,7 @@ void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext)
pPam->DeleteMark();
pPam->GetPoint()->nNode = *pTblNd->EndOfSectionNode();
pPam->SetMark();
- pPam->GetPoint()->nNode = *pPam->GetNode()->StartOfSectionNode();
+ pPam->GetPoint()->nNode = *pPam->GetNode().StartOfSectionNode();
pPam->Move( fnMoveForward, fnGoCntnt );
pPam->Exchange();
pPam->Move( fnMoveBackward, fnGoCntnt );
@@ -629,7 +629,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
pPam->SetMark(); // log off all indices
pPam->DeleteMark();
- SwTableNode* pTblNd = pPam->GetNode()->GetTableNode();
+ SwTableNode* pTblNd = pPam->GetNode().GetTableNode();
OSL_ENSURE( pTblNd, "Could not find any TableNode" );
if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) )
@@ -656,7 +656,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoTblToTxt::RepeatImpl(::sw::RepeatContext & rContext)
{
SwPaM *const pPam = & rContext.GetRepeatPaM();
- SwTableNode *const pTblNd = pPam->GetNode()->FindTableNode();
+ SwTableNode *const pTblNd = pPam->GetNode().FindTableNode();
if( pTblNd )
{
// move cursor out of table
@@ -798,7 +798,7 @@ void SwUndoTxtToTbl::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoTxtToTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
// no Table In Table
- if (!rContext.GetRepeatPaM().GetNode()->FindTableNode())
+ if (!rContext.GetRepeatPaM().GetNode().FindTableNode())
{
rContext.GetDoc().TextToTable( aInsTblOpts, rContext.GetRepeatPaM(),
cTrenner, nAdjust,
@@ -855,7 +855,7 @@ void SwUndoTblHeadline::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoTblHeadline::RepeatImpl(::sw::RepeatContext & rContext)
{
SwTableNode *const pTblNd =
- rContext.GetRepeatPaM().GetNode()->FindTableNode();
+ rContext.GetRepeatPaM().GetNode().FindTableNode();
if( pTblNd )
{
rContext.GetDoc().SetRowsToRepeat( pTblNd->GetTable(), nNewHeadline );
@@ -1924,7 +1924,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel )
: SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTblSel ), pHistory( 0 )
{
- const SwTableNode* pTblNd = rTblSel.GetNode()->FindTableNode();
+ const SwTableNode* pTblNd = rTblSel.GetNode().FindTableNode();
OSL_ENSURE( pTblNd, "Where is the TableNode?" );
pSaveTbl = new _SaveTable( pTblNd->GetTable() );
pMoves = new SwUndoMoves;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 7cdfe1214985..8c5c93721bec 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -280,8 +280,8 @@ GetNestedTextContent(SwTxtNode & rTextNode, sal_Int32 const nIndex,
// which is innermost?
SwTxtAttr *const pTxtAttr = (pMetaTxtAttr)
? ((pMetaFieldTxtAttr)
- ? ((*pMetaFieldTxtAttr->GetStart() >
- *pMetaTxtAttr->GetStart())
+ ? ((pMetaFieldTxtAttr->GetStart() >
+ pMetaTxtAttr->GetStart())
? pMetaFieldTxtAttr : pMetaTxtAttr)
: pMetaTxtAttr)
: pMetaFieldTxtAttr;
@@ -315,7 +315,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
const SwTxtNode * pTmpNode = pNode;
if (!pTmpNode)
- pTmpNode = rPam.GetNode()->GetTxtNode();
+ pTmpNode = rPam.GetNode().GetTxtNode();
bool bRet = false;
@@ -335,7 +335,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
const SwTxtNode * pTmpNode = pNode;
if (!pTmpNode)
- pTmpNode = rPam.GetNode()->GetTxtNode();
+ pTmpNode = rPam.GetNode().GetTxtNode();
OUString sRet;
if ( pTmpNode && pTmpNode->GetNum() )
@@ -352,7 +352,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
const SwTxtNode * pTmpNode = pNode;
if (!pTmpNode)
- pTmpNode = rPam.GetNode()->GetTxtNode();
+ pTmpNode = rPam.GetNode().GetTxtNode();
sal_Int16 nRet = -1;
if ( pTmpNode )
@@ -410,7 +410,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
case FN_NUMBER_NEWSTART:
{
// a multi selection is not considered
- const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = rPam.GetNode().GetTxtNode();
if ( pTxtNd && pTxtNd->IsInList() )
{
if( pAny )
@@ -469,9 +469,9 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
case FN_UNO_DOCUMENT_INDEX_MARK:
{
::std::vector<SwTxtAttr *> marks;
- if (rPam.GetNode()->IsTxtNode())
+ if (rPam.GetNode().IsTxtNode())
{
- marks = rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ marks = rPam.GetNode().GetTxtNode()->GetTxtAttrsAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_TOXMARK);
}
if (marks.size())
@@ -535,7 +535,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
case FN_UNO_TEXT_TABLE:
case FN_UNO_CELL:
{
- SwStartNode* pSttNode = rPam.GetNode()->StartOfSectionNode();
+ SwStartNode* pSttNode = rPam.GetNode().StartOfSectionNode();
SwStartNodeType eType = pSttNode->GetStartNodeType();
if(SwTableBoxStartNode == eType)
{
@@ -563,7 +563,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
break;
case FN_UNO_TEXT_FRAME:
{
- SwStartNode* pSttNode = rPam.GetNode()->StartOfSectionNode();
+ SwStartNode* pSttNode = rPam.GetNode().StartOfSectionNode();
SwStartNodeType eType = pSttNode->GetStartNodeType();
SwFrmFmt* pFmt;
@@ -597,8 +597,8 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
case FN_UNO_ENDNOTE:
case FN_UNO_FOOTNOTE:
{
- SwTxtAttr *const pTxtAttr = rPam.GetNode()->IsTxtNode() ?
- rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ SwTxtAttr *const pTxtAttr = rPam.GetNode().IsTxtNode() ?
+ rPam.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN) : 0;
if(pTxtAttr)
{
@@ -622,10 +622,10 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
case FN_UNO_REFERENCE_MARK:
{
::std::vector<SwTxtAttr *> marks;
- if (rPam.GetNode()->IsTxtNode())
+ if (rPam.GetNode().IsTxtNode())
{
marks = (
- rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ rPam.GetNode().GetTxtNode()->GetTxtAttrsAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_REFMARK));
}
if (marks.size())
@@ -643,8 +643,8 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
break;
case FN_UNO_NESTED_TEXT_CONTENT:
{
- uno::Reference<XTextContent> const xRet(rPam.GetNode()->IsTxtNode()
- ? GetNestedTextContent(*rPam.GetNode()->GetTxtNode(),
+ uno::Reference<XTextContent> const xRet(rPam.GetNode().IsTxtNode()
+ ? GetNestedTextContent(*rPam.GetNode().GetTxtNode(),
rPam.GetPoint()->nContent.GetIndex(), false)
: 0);
if (xRet.is())
@@ -663,8 +663,8 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
case FN_UNO_CHARFMT_SEQUENCE:
{
- SwTxtNode *const pTxtNode = rPam.GetNode()->GetTxtNode();
- if (rPam.GetNode(true) == rPam.GetNode(false)
+ SwTxtNode *const pTxtNode = rPam.GetNode().GetTxtNode();
+ if (&rPam.GetNode(true) == &rPam.GetNode(false)
&& pTxtNode && pTxtNode->GetpSwpHints())
{
sal_Int32 nPaMStart = rPam.GetPoint()->nContent.GetIndex();
@@ -680,7 +680,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
SwTxtAttr* pAttr = pHints->GetStart( nAttr );
if(pAttr->Which() != RES_TXTATR_CHARFMT)
continue;
- const sal_Int32 nAttrStart = *pAttr->GetStart();
+ const sal_Int32 nAttrStart = pAttr->GetStart();
const sal_Int32 nAttrEnd = *pAttr->GetEnd();
//check if the attribute touches the selection
if( ( nAttrEnd > nPaMStart && nAttrStart < nPaMEnd ) ||
@@ -731,7 +731,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
sal_Int16 IsNodeNumStart(SwPaM& rPam, PropertyState& eState)
{
- const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = rPam.GetNode().GetTxtNode();
// correction: check, if restart value is set at the text node and use
// new method <SwTxtNode::GetAttrListRestartValue()> to retrieve the value
if ( pTxtNd && pTxtNd->GetNumRule() && pTxtNd->IsListRestart() &&
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 8bcc0ca3322e..4bc32b47e999 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -689,7 +689,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
if (::sw::XTextRangeToSwPaM(*pInternalPam, xRg))
{
if(FLY_AT_FLY == aAnchor.GetAnchorId() &&
- !pInternalPam->GetNode()->FindFlyStartNode())
+ !pInternalPam->GetNode().FindFlyStartNode())
{
aAnchor.SetType(FLY_AS_CHAR);
}
@@ -1172,7 +1172,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
//The connection is removed now the attribute can be deleted.
pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx );
//create a new one
- SwTxtNode *pNd = pInternalPam->GetNode()->GetTxtNode();
+ SwTxtNode *pNd = pInternalPam->GetNode().GetTxtNode();
SAL_WARN_IF( !pNd, "sw.uno", "Cursor not at TxtNode." );
SwFmtFlyCnt aFmt( pFmt );
pNd->InsertItem(aFmt, pInternalPam->GetPoint()
@@ -1341,7 +1341,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
aPam.Move( fnMoveBackward, fnGoDoc );
}
//the RES_TXTATR_FLYCNT needs to be added now
- SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
+ SwTxtNode *pNd = aPam.GetNode().GetTxtNode();
SAL_WARN_IF( !pNd, "sw.uno", "Crsr is not in a TxtNode." );
SwFmtFlyCnt aFmt( pFlyFmt );
pNd->InsertItem(aFmt,
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index a89c8b3d2157..a27eadd7dc27 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1929,7 +1929,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
else
pDoc->InsertPoolItem(aPam, aFmt, nInsertFlags);
- SwTxtAttr* pTxtAttr = aPam.GetNode()->GetTxtNode()->GetFldTxtAttrAt( aPam.GetPoint()->nContent.GetIndex()-1, true );
+ SwTxtAttr* pTxtAttr = aPam.GetNode().GetTxtNode()->GetFldTxtAttrAt( aPam.GetPoint()->nContent.GetIndex()-1, true );
// was passiert mit dem Update der Felder ? (siehe fldmgr.cxx)
if (pTxtAttr)
@@ -1987,14 +1987,14 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
const SwTxtFld* pTxtFld = m_pImpl->m_pFmtFld->GetTxtFld();
SwTxtNode& rTxtNode = (SwTxtNode&)*pTxtFld->GetpTxtNode();
- SwPaM aPam( rTxtNode, *pTxtFld->GetStart() );
+ SwPaM aPam( rTxtNode, pTxtFld->GetStart() );
aPam.SetMark();
aPam.Move();
m_pImpl->m_pDoc->DeleteAndJoin(aPam);
}
// keep inserted annotation
{
- SwTxtFld* pTxtAttr = aEnd.GetNode()->GetTxtNode()->GetFldTxtAttrAt( aEnd.End()->nContent.GetIndex()-1, true );
+ SwTxtFld* pTxtAttr = aEnd.GetNode().GetTxtNode()->GetFldTxtAttrAt( aEnd.End()->nContent.GetIndex()-1, true );
if ( pTxtAttr != NULL )
{
m_pImpl->m_pFmtFld = &pTxtAttr->GetFmtFld();
@@ -2142,7 +2142,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
if(!pTxtFld)
throw uno::RuntimeException();
SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
+ aPosition.nContent = pTxtFld->GetStart();
pDoc->PutValueToField( aPosition, rValue, pEntry->nWID);
}
@@ -2335,10 +2335,10 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
sal_Int32 nHiddenEnd;
SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
+ aPosition.nContent = pTxtFld->GetStart();
bHidden = SwScriptInfo::GetBoundsOfHiddenRange( pTxtFld->GetTxtNode(),
- *pTxtFld->GetStart(),
+ pTxtFld->GetStart(),
nHiddenStart, nHiddenEnd );
}
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 55c50d4aca26..ca1555bd0bfc 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2765,7 +2765,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
{
eAnchorId = ((const SwFmtAnchor*)pItem)->GetAnchorId();
if( FLY_AT_FLY == eAnchorId &&
- !aPam.GetNode()->FindFlyStartNode())
+ !aPam.GetNode().FindFlyStartNode())
{
//rahmengebunden geht nur dort, wo ein Rahmen ist!
SwFmtAnchor aAnchor(FLY_AT_PARA);
@@ -3234,7 +3234,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw(
SwPaM aPam(rNode);
aPam.Move(fnMoveForward, fnGoNode);
- SwTableNode* pTblNode = aPam.GetNode()->FindTableNode();
+ SwTableNode* pTblNode = aPam.GetNode().FindTableNode();
SwCntntNode* pCont = 0;
while( pTblNode )
{
@@ -3246,7 +3246,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw(
aPam.GetPoint()->nContent.Assign(pCont, 0);
const SwStartNode* pNewStartNode =
- aPam.GetNode()->FindSttNodeByType(SwFlyStartNode);
+ aPam.GetNode().FindSttNodeByType(SwFlyStartNode);
if(!pNewStartNode || pNewStartNode != pOwnStartNode)
{
uno::RuntimeException aExcept;
@@ -3282,7 +3282,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const
(void)p1;
(void)p2;
#endif
- if(aPam.GetNode()->FindFlyStartNode() == rNode.FindFlyStartNode())
+ if(aPam.GetNode().FindFlyStartNode() == rNode.FindFlyStartNode())
{
aRef = static_cast<text::XWordCursor*>(
new SwXTextCursor(*pFmt->GetDoc(), this, CURSOR_FRAME,
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index bdf91c63ad86..bca83baeff2d 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -269,7 +269,7 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException, std:
OSL_ENSURE(pTxtFtn, "kein TextNode?");
SwTxtNode& rTxtNode = (SwTxtNode&)pTxtFtn->GetTxtNode();
- SwPaM aPam(rTxtNode, *pTxtFtn->GetStart());
+ SwPaM aPam(rTxtNode, pTxtFtn->GetStart());
GetDoc()->SetCurFtn(aPam, aLabel, pFmt->GetNumber(), pFmt->IsEndNote());
}
else if (m_pImpl->m_bIsDescriptor)
@@ -328,7 +328,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
pNewDoc->InsertPoolItem(aPam, aFootNote, nInsertFlags);
SwTxtFtn *const pTxtAttr = static_cast<SwTxtFtn*>(
- aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ aPam.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_FTN ));
if (pTxtAttr)
@@ -358,7 +358,7 @@ SwXFootnote::getAnchor() throw (uno::RuntimeException, std::exception)
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn();
- SwPaM aPam( pTxtFtn->GetTxtNode(), *pTxtFtn->GetStart() );
+ SwPaM aPam( pTxtFtn->GetTxtNode(), pTxtFtn->GetStart() );
SwPosition aMark( *aPam.Start() );
aPam.SetMark();
aPam.GetMark()->nContent++;
@@ -376,7 +376,7 @@ void SAL_CALL SwXFootnote::dispose() throw (uno::RuntimeException, std::exceptio
SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn();
OSL_ENSURE(pTxtFtn, "no TextNode?");
SwTxtNode& rTxtNode = const_cast<SwTxtNode&>(pTxtFtn->GetTxtNode());
- const sal_Int32 nPos = *pTxtFtn->GetStart();
+ const sal_Int32 nPos = pTxtFtn->GetStart();
SwPaM aPam(rTxtNode, nPos, rTxtNode, nPos+1);
GetDoc()->DeleteAndJoin( aPam );
}
@@ -455,7 +455,7 @@ throw (uno::RuntimeException, std::exception)
SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn();
SwNode const*const pFtnStartNode = &pTxtFtn->GetStartNode()->GetNode();
- const SwNode* pStart = aPam.GetNode()->FindFootnoteStartNode();
+ const SwNode* pStart = aPam.GetNode().FindFootnoteStartNode();
if (pStart != pFtnStartNode)
{
throw uno::RuntimeException();
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 7440a9d331a2..888dfb6eed58 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -1764,7 +1764,7 @@ throw (uno::RuntimeException, std::exception)
aMark.SetAlternativeText(rIndexEntry);
SwTxtTOXMark const*const pTxtMark =
m_pImpl->m_pTOXMark->GetTxtTOXMark();
- SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
+ SwPaM aPam(pTxtMark->GetTxtNode(), pTxtMark->GetStart());
aPam.SetMark();
if(pTxtMark->End())
{
@@ -1953,7 +1953,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark(
::std::vector<SwTxtAttr *> oldMarks;
if (bMark)
{
- oldMarks = rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ oldMarks = rPam.GetNode().GetTxtNode()->GetTxtAttrsAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_TOXMARK);
}
@@ -1970,7 +1970,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark(
// #i107672#
// ensure that we do not retrieve a different mark at the same position
::std::vector<SwTxtAttr *> const newMarks(
- rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ rPam.GetNode().GetTxtNode()->GetTxtAttrsAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_TOXMARK));
::std::vector<SwTxtAttr *>::const_iterator const iter(
::std::find_if(newMarks.begin(), newMarks.end(),
@@ -1983,7 +1983,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark(
}
else
{
- pTxtAttr = rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ pTxtAttr = rPam.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
rPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_TOXMARK );
}
@@ -2015,7 +2015,7 @@ SwXDocumentIndexMark::getAnchor() throw (uno::RuntimeException, std::exception)
throw uno::RuntimeException();
}
const SwTxtTOXMark* pTxtMark = m_pImpl->m_pTOXMark->GetTxtTOXMark();
- SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
+ SwPaM aPam(pTxtMark->GetTxtNode(), pTxtMark->GetStart());
aPam.SetMark();
if(pTxtMark->End())
{
@@ -2157,7 +2157,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
}
SwTxtTOXMark const*const pTxtMark =
m_pImpl->m_pTOXMark->GetTxtTOXMark();
- SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
+ SwPaM aPam(pTxtMark->GetTxtNode(), pTxtMark->GetStart());
aPam.SetMark();
if(pTxtMark->End())
{
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index dacbf6a6032f..e1c99dc5a1d2 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -518,7 +518,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, uno::DeploymentExc
case FN_UNO_IS_NUMBER:
{
// multi selection is not considered
- SwTxtNode *const pTxtNd = rPam.GetNode()->GetTxtNode();
+ SwTxtNode *const pTxtNd = rPam.GetNode().GetTxtNode();
if (!pTxtNd)
{
throw lang::IllegalArgumentException();
@@ -1037,7 +1037,7 @@ SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException, std::exc
{
rUnoCursor.Move( fnMoveBackward, fnGoDoc );
//check, that the cursor is not in a table
- SwTableNode * pTblNode = rUnoCursor.GetNode()->FindTableNode();
+ SwTableNode * pTblNode = rUnoCursor.GetNode().FindTableNode();
SwCntntNode * pCNode = 0;
while (pTblNode)
{
@@ -1050,7 +1050,7 @@ SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException, std::exc
rUnoCursor.GetPoint()->nContent.Assign(pCNode, 0);
}
SwStartNode const*const pTmp =
- rUnoCursor.GetNode()->StartOfSectionNode();
+ rUnoCursor.GetNode().StartOfSectionNode();
if (pTmp->IsSectionNode())
{
SwSectionNode const*const pSectionStartNode =
@@ -1171,7 +1171,7 @@ throw (uno::RuntimeException, std::exception)
;
}
- const SwStartNode* pOwnStartNode = rOwnCursor.GetNode()->FindSttNodeByType(eSearchNodeType);
+ const SwStartNode* pOwnStartNode = rOwnCursor.GetNode().FindSttNodeByType(eSearchNodeType);
while ( pOwnStartNode != NULL
&& pOwnStartNode->IsSectionNode())
{
@@ -1179,7 +1179,7 @@ throw (uno::RuntimeException, std::exception)
}
const SwStartNode* pTmp =
- pPam->GetNode()->FindSttNodeByType(eSearchNodeType);
+ pPam->GetNode().FindSttNodeByType(eSearchNodeType);
while ( pTmp != NULL
&& pTmp->IsSectionNode() )
{
@@ -2557,11 +2557,9 @@ throw (uno::RuntimeException, std::exception)
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
- SwNode* node = rUnoCursor.GetNode();
+ SwNode& node = rUnoCursor.GetNode();
- if (node == 0) return;
-
- SwTxtNode* txtNode = node->GetTxtNode();
+ SwTxtNode* txtNode = node.GetTxtNode();
if (txtNode == 0) return;
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 1328b228bfaf..cb0dfc56f53c 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -332,7 +332,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
if( rSet.GetItemState( RES_PARATR_OUTLINELEVEL, false ) >= SFX_ITEM_AVAILABLE )
{
- SwTxtNode * pTmpNode = rPam.GetNode()->GetTxtNode();
+ SwTxtNode * pTmpNode = rPam.GetNode().GetTxtNode();
if ( pTmpNode )
{
rPam.GetDoc()->GetNodes().UpdateOutlineNode( *pTmpNode );
@@ -605,7 +605,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
// os 2005-01-14: This part is only necessary to detect movements out
// of a selection; if there is no selection we don't have to care
- SwTableNode *const pTblNode = aNewCrsr->GetNode()->FindTableNode();
+ SwTableNode *const pTblNode = aNewCrsr->GetNode().FindTableNode();
if (((CURSOR_TBLTEXT != m_eCursorType) &&
(CURSOR_SELECTION_IN_TABLE != m_eCursorType)) && pTblNode)
{
@@ -627,7 +627,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
{
pUnoCrsr->SetRemainInSection( false );
// what to do if already in a table?
- SwTableNode * pTblNode = pUnoCrsr->GetNode()->FindTableNode();
+ SwTableNode * pTblNode = pUnoCrsr->GetNode().FindTableNode();
pTblNode = lcl_FindTopLevelTable( pTblNode, m_pOwnTable );
if (pTblNode && (&pTblNode->GetTable() != m_pOwnTable))
{
@@ -656,7 +656,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
(m_nEndIndex == pStart->nNode.GetIndex()) ? m_nLastParaEnd : -1;
// position in a table, or in a simple paragraph?
- SwTableNode * pTblNode = pUnoCrsr->GetNode()->FindTableNode();
+ SwTableNode * pTblNode = pUnoCrsr->GetNode().FindTableNode();
pTblNode = lcl_FindTopLevelTable( pTblNode, m_pOwnTable );
if (/*CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType && */
pTblNode && (&pTblNode->GetTable() != m_pOwnTable))
@@ -1794,8 +1794,8 @@ lcl_FillFrame(SwClient & rEnum, SwUnoCrsr& rUnoCrsr,
FrameDependList_t & rFrames)
{
// search for objects at the cursor - anchored at/as char
- SwTxtAttr const*const pTxtAttr = (rUnoCrsr.GetNode()->IsTxtNode())
- ? rUnoCrsr.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ SwTxtAttr const*const pTxtAttr = (rUnoCrsr.GetNode().IsTxtNode())
+ ? rUnoCrsr.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
rUnoCrsr.GetPoint()->nContent.GetIndex(), RES_TXTATR_FLYCNT)
: 0;
if (pTxtAttr)
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index b6bc4318459d..6750c47134c7 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -197,7 +197,7 @@ throw( uno::RuntimeException, std::exception )
throw uno::RuntimeException();
// TextPortions are always within a paragraph
- SwTxtNode* pTxtNd = pUnoCrsr->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = pUnoCrsr->GetNode().GetTxtNode();
if ( pTxtNd )
{
const sal_Int32 nStt = pUnoCrsr->Start()->nContent.GetIndex();
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 2b0ae04147ff..c4d49ca55b93 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -727,7 +727,7 @@ lcl_ExportHints(
break;
case RES_TXTATR_CJK_RUBY:
//#i91534# GetEnd() == 0 mixes the order of ruby start/end
- if( *pAttr->GetEnd() == *pAttr->GetStart())
+ if( *pAttr->GetEnd() == pAttr->GetStart())
{
lcl_InsertRubyPortion( *rPortionStack.top().first,
xParent, pUnoCrsr, *pAttr, false);
@@ -738,17 +738,17 @@ lcl_ExportHints(
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
{
- OSL_ENSURE(*pAttr->GetStart() != *pAttr->GetEnd(),
+ OSL_ENSURE(pAttr->GetStart() != *pAttr->GetEnd(),
"empty meta?");
if ((i_nStartPos > 0) &&
- (*pAttr->GetStart() < i_nStartPos))
+ (pAttr->GetStart() < i_nStartPos))
{
// force skip pAttr and rest of attribute ends
// at nCurrentIndex
// because they are not contained in the meta pAttr
// and the meta pAttr itself is outside selection!
// (necessary for SwXMeta::createEnumeration)
- if (*pAttr->GetStart() + 1 == i_nStartPos)
+ if (pAttr->GetStart() + 1 == i_nStartPos)
{
nEndIndex = pHints->GetEndCount() - 1;
}
@@ -783,7 +783,7 @@ lcl_ExportHints(
sal_uInt16 nStartIndex = 0;
sal_uInt16 nNextStart = 0;
while(nStartIndex < pHints->GetStartCount() &&
- nCurrentIndex >= (nNextStart = (*pHints->GetStart(nStartIndex)->GetStart())))
+ nCurrentIndex >= (nNextStart = pHints->GetStart(nStartIndex)->GetStart()))
{
SwTxtAttr * const pAttr = pHints->GetStart(nStartIndex);
sal_uInt16 nAttrWhich = pAttr->Which();
@@ -917,7 +917,7 @@ lcl_ExportHints(
break;
case RES_TXTATR_CJK_RUBY:
//#i91534# GetEnd() == 0 mixes the order of ruby start/end
- if(pAttr->GetEnd() && (*pAttr->GetEnd() != *pAttr->GetStart()))
+ if(pAttr->GetEnd() && (*pAttr->GetEnd() != pAttr->GetStart()))
{
lcl_InsertRubyPortion( *rPortionStack.top().first,
xParent, pUnoCrsr, *pAttr, false);
@@ -925,7 +925,7 @@ lcl_ExportHints(
break;
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- if (*pAttr->GetStart() != *pAttr->GetEnd())
+ if (pAttr->GetStart() != *pAttr->GetEnd())
{
if (!bRightMoveForbidden)
{
@@ -965,7 +965,7 @@ lcl_ExportHints(
nStartIndex = 0;
nNextStart = 0;
while(nStartIndex < pHints->GetStartCount() &&
- nCurrentIndex >= (nNextStart = (*pHints->GetStart(nStartIndex)->GetStart())))
+ nCurrentIndex >= (nNextStart = pHints->GetStart(nStartIndex)->GetStart()))
nStartIndex++;
nEndIndex = 0;
@@ -1253,7 +1253,7 @@ static void lcl_CreatePortions(
pUnoCrsr->DeleteMark();
}
- SwTxtNode * const pTxtNode = pUnoCrsr->GetNode()->GetTxtNode();
+ SwTxtNode * const pTxtNode = pUnoCrsr->GetNode().GetTxtNode();
if (!pTxtNode)
{
OSL_FAIL("lcl_CreatePortions: no TextNode - what now ?");
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index b1ea530adbf3..5093f6c28c2a 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -113,7 +113,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
// Patterned after SwXTextFrame::createTextCursor(void).
// skip all tables at the beginning
- SwTableNode* pTableNode = pUnoCursor->GetNode()->FindTableNode();
+ SwTableNode* pTableNode = pUnoCursor->GetNode().FindTableNode();
SwCntntNode* pContentNode = NULL;
bool bTable = pTableNode != NULL;
while( pTableNode != NULL )
@@ -124,7 +124,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
}
if( pContentNode != NULL )
pUnoCursor->GetPoint()->nContent.Assign( pContentNode, 0 );
- if( bTable && pUnoCursor->GetNode()->FindSttNodeByType( SwNormalStartNode )
+ if( bTable && pUnoCursor->GetNode().FindSttNodeByType( SwNormalStartNode )
!= GetStartNode() )
{
// We have gone too far and have left our own redline. This means that
@@ -448,9 +448,9 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
rPropertyName == UNO_NAME_REDLINE_END)
{
uno::Reference<XInterface> xRet;
- SwNode* pNode = pRedline->GetNode();
+ SwNode* pNode = &pRedline->GetNode();
if(!bStart && pRedline->HasMark())
- pNode = pRedline->GetNode(false);
+ pNode = &pRedline->GetNode(false);
switch(pNode->GetNodeType())
{
case ND_SECTIONNODE:
@@ -591,7 +591,7 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u
pUnoCrsr->Move(fnMoveForward, fnGoNode);
//steht hier eine Tabelle?
- SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode();
+ SwTableNode* pTblNode = pUnoCrsr->GetNode().FindTableNode();
SwCntntNode* pCont = 0;
while( pTblNode )
{
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 1c16911c1953..617ad1aeba6a 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -221,7 +221,7 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam,
::std::vector<SwTxtAttr *> oldMarks;
if (bMark)
{
- oldMarks = rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ oldMarks = rPam.GetNode().GetTxtNode()->GetTxtAttrsAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_REFMARK);
}
@@ -239,7 +239,7 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam,
// #i107672#
// ensure that we do not retrieve a different mark at the same position
::std::vector<SwTxtAttr *> const newMarks(
- rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ rPam.GetNode().GetTxtNode()->GetTxtAttrsAt(
rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_REFMARK));
::std::vector<SwTxtAttr *>::const_iterator const iter(
::std::find_if(newMarks.begin(), newMarks.end(),
@@ -252,9 +252,9 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam,
}
else
{
- SwTxtNode *pTxtNd = rPam.GetNode()->GetTxtNode();
+ SwTxtNode *pTxtNd = rPam.GetNode().GetTxtNode();
OSL_ASSERT(pTxtNd);
- pTxtAttr = pTxtNd ? rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ pTxtAttr = pTxtNd ? rPam.GetNode().GetTxtNode()->GetTxtAttrForCharAt(
rPam.GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_REFMARK) : NULL;
}
@@ -324,8 +324,8 @@ SwXReferenceMark::getAnchor() throw (uno::RuntimeException, std::exception)
SAL_WNODEPRECATED_DECLARATIONS_PUSH
const ::std::auto_ptr<SwPaM> pPam( (pTxtMark->End())
? new SwPaM( rTxtNode, *pTxtMark->End(),
- rTxtNode, *pTxtMark->GetStart())
- : new SwPaM( rTxtNode, *pTxtMark->GetStart()) );
+ rTxtNode, pTxtMark->GetStart())
+ : new SwPaM( rTxtNode, pTxtMark->GetStart()) );
SAL_WNODEPRECATED_DECLARATIONS_POP
return SwXTextRange::CreateXTextRange(
@@ -352,7 +352,7 @@ void SAL_CALL SwXReferenceMark::dispose() throw (uno::RuntimeException, std::exc
&m_pImpl->m_pDoc->GetNodes()))
{
SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode();
- const sal_Int32 nStt = *pTxtMark->GetStart();
+ const sal_Int32 nStt = pTxtMark->GetStart();
const sal_Int32 nEnd = pTxtMark->End()
? *pTxtMark->End()
: nStt + 1;
@@ -425,7 +425,7 @@ throw (uno::RuntimeException, std::exception)
&m_pImpl->m_pDoc->GetNodes()))
{
SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode();
- const sal_Int32 nStt = *pTxtMark->GetStart();
+ const sal_Int32 nStt = pTxtMark->GetStart();
const sal_Int32 nEnd = pTxtMark->End()
? *pTxtMark->End()
: nStt + 1;
@@ -766,7 +766,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta,
SwTxtMeta * const pTxtAttr( rMeta.GetTxtAttr() );
OSL_ENSURE(pTxtAttr, "CreateXMeta: no text attr?");
if (!pTxtAttr) { return 0; }
- const SwPosition aPos(*pTxtNode, *pTxtAttr->GetStart());
+ const SwPosition aPos(*pTxtNode, pTxtAttr->GetStart());
xParentText.set( ::sw::CreateParentXText(*pTxtNode->GetDoc(), aPos) );
}
if (!xParentText.is()) { return 0; }
@@ -796,7 +796,7 @@ bool SwXMeta::SetContentRange(
if (rpNode)
{
// rStart points at the first position _within_ the meta!
- rStart = *pTxtAttr->GetStart() + 1;
+ rStart = pTxtAttr->GetStart() + 1;
rEnd = *pTxtAttr->End();
return true;
}
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index f37109283d10..acc576db54d5 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -1138,16 +1138,16 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
for (size_t nRed = 0; nRed < rRedTbl.size(); ++nRed)
{
const SwRangeRedline* pRedline = rRedTbl[nRed];
- SwNode const*const pRedPointNode = pRedline->GetNode(true);
- SwNode const*const pRedMarkNode = pRedline->GetNode(false);
- if ((pRedPointNode == pSectNode) ||
- (pRedMarkNode == pSectNode))
+ const SwNode& rRedPointNode = pRedline->GetNode(true);
+ const SwNode& rRedMarkNode = pRedline->GetNode(false);
+ if ((&rRedPointNode == pSectNode) ||
+ (&rRedMarkNode == pSectNode))
{
- SwNode const*const pStartOfRedline =
- (SwNodeIndex(*pRedPointNode) <=
- SwNodeIndex(*pRedMarkNode))
- ? pRedPointNode : pRedMarkNode;
- const bool bIsStart = (pStartOfRedline == pSectNode);
+ const SwNode& rStartOfRedline =
+ (SwNodeIndex(rRedPointNode) <=
+ SwNodeIndex(rRedMarkNode))
+ ? rRedPointNode : rRedMarkNode;
+ const bool bIsStart = (&rStartOfRedline == pSectNode);
pRet[nProperty] <<=
SwXRedlinePortion::CreateRedlineProperties(
*pRedline, bIsStart);
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 061f43061cb2..c7215a8a4b35 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -317,13 +317,13 @@ static uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimp
for(size_t nRed = 0; nRed < rRedTbl.size(); ++nRed)
{
const SwRangeRedline* pRedline = rRedTbl[nRed];
- const SwNode* pRedPointNode = pRedline->GetNode(true);
- const SwNode* pRedMarkNode = pRedline->GetNode(false);
- if(pRedPointNode == pTblNode || pRedMarkNode == pTblNode)
+ const SwNode& rRedPointNode = pRedline->GetNode(true);
+ const SwNode& rRedMarkNode = pRedline->GetNode(false);
+ if(&rRedPointNode == pTblNode || &rRedMarkNode == pTblNode)
{
- const SwNode* pStartOfRedline = SwNodeIndex(*pRedPointNode) <= SwNodeIndex(*pRedMarkNode) ?
- pRedPointNode : pRedMarkNode;
- bool bIsStart = pStartOfRedline == pTblNode;
+ const SwNode& rStartOfRedline = SwNodeIndex(rRedPointNode) <= SwNodeIndex(rRedMarkNode) ?
+ rRedPointNode : rRedMarkNode;
+ bool bIsStart = &rStartOfRedline == pTblNode;
aRet <<= SwXRedlinePortion::CreateRedlineProperties(*pRedline, bIsStart);
break;
}
@@ -1026,7 +1026,7 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno:
{
const SwStartNode* pSttNd = pStartNode ? pStartNode : pBox->GetSttNd();
// skip sections
- SwStartNode* p1 = aPam.GetNode()->StartOfSectionNode();
+ SwStartNode* p1 = aPam.GetNode().StartOfSectionNode();
while(p1->IsSectionNode())
p1 = p1->StartOfSectionNode();
@@ -1810,7 +1810,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
{
- SwStartNode* pSttNode = pUnoCrsr->GetNode()->StartOfSectionNode();
+ SwStartNode* pSttNode = pUnoCrsr->GetNode().StartOfSectionNode();
const SwTableNode* pTblNode = pSttNode->FindTableNode();
lcl_FormatTable((SwFrmFmt*)pTblNode->GetTable().GetFrmFmt());
SwUnoTableCrsr& rTblCrsr = dynamic_cast<SwUnoTableCrsr&>(*pUnoCrsr);
@@ -1875,7 +1875,7 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
{
- SwStartNode* pSttNode = pUnoCrsr->GetNode()->StartOfSectionNode();
+ SwStartNode* pSttNode = pUnoCrsr->GetNode().StartOfSectionNode();
const SwTableNode* pTblNode = pSttNode->FindTableNode();
lcl_FormatTable((SwFrmFmt*)pTblNode->GetTable().GetFrmFmt());
SwUnoTableCrsr& rTblCrsr = dynamic_cast<SwUnoTableCrsr&>(*pUnoCrsr);
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index b89f32b0f35b..e6bf2304dd5c 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -326,7 +326,7 @@ throw (uno::RuntimeException, std::exception)
throw uno::RuntimeException();
}
- const SwStartNode* pTmp(pPam->GetNode()->StartOfSectionNode());
+ const SwStartNode* pTmp(pPam->GetNode().StartOfSectionNode());
while (pTmp && pTmp->IsSectionNode())
{
pTmp = pTmp->StartOfSectionNode();
@@ -550,7 +550,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
}
const SwStartNode* pTmp =
- aPam.GetNode()->FindSttNodeByType(eSearchNodeType);
+ aPam.GetNode().FindSttNodeByType(eSearchNodeType);
// ignore SectionNodes
while (pTmp && pTmp->IsSectionNode())
@@ -993,7 +993,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel);
OSL_ENSURE(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? ");
const SwStartNode* pOwnStartNode =
- pOwnCursor->GetPaM()->GetNode()->StartOfSectionNode();
+ pOwnCursor->GetPaM()->GetNode().StartOfSectionNode();
SwStartNodeType eSearchNodeType = SwNormalStartNode;
switch (m_eType)
{
@@ -1008,9 +1008,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
;
}
- SwNode const*const pSrcNode(rPaM.GetNode());
- if (!pSrcNode) { return false; }
- const SwStartNode* pTmp = pSrcNode->FindSttNodeByType(eSearchNodeType);
+ const SwNode& rSrcNode = rPaM.GetNode();
+ const SwStartNode* pTmp = rSrcNode.FindSttNodeByType(eSearchNodeType);
//SectionNodes ueberspringen
while(pTmp && pTmp->IsSectionNode())
@@ -1564,12 +1563,12 @@ SwXText::convertToTextFrame(
bool bIllegalException = false;
bool bRuntimeException = false;
OUString sMessage;
- SwStartNode* pStartStartNode = aStartPam.GetNode()->StartOfSectionNode();
+ SwStartNode* pStartStartNode = aStartPam.GetNode().StartOfSectionNode();
while (pStartStartNode && pStartStartNode->IsSectionNode())
{
pStartStartNode = pStartStartNode->StartOfSectionNode();
}
- SwStartNode* pEndStartNode = pEndPam->GetNode()->StartOfSectionNode();
+ SwStartNode* pEndStartNode = pEndPam->GetNode().StartOfSectionNode();
while (pEndStartNode && pEndStartNode->IsSectionNode())
{
pEndStartNode = pEndStartNode->StartOfSectionNode();
@@ -1600,7 +1599,7 @@ SwXText::convertToTextFrame(
bParaBeforeInserted = GetDoc()->AppendTxtNode( aBefore );
aStartPam.DeleteMark();
*aStartPam.GetPoint() = aBefore;
- pStartStartNode = aStartPam.GetNode()->StartOfSectionNode();
+ pStartStartNode = aStartPam.GetNode().StartOfSectionNode();
}
if (pEndStartNode->GetStartNodeType() == SwTableBoxStartNode)
{
@@ -1610,7 +1609,7 @@ SwXText::convertToTextFrame(
bParaAfterInserted = GetDoc()->AppendTxtNode( aTableEnd );
pEndPam->DeleteMark();
*pEndPam->GetPoint() = aTableEnd;
- pEndStartNode = pEndPam->GetNode()->StartOfSectionNode();
+ pEndStartNode = pEndPam->GetNode().StartOfSectionNode();
}
// now we should have the positions in the same hierarchy
if ((pStartStartNode != pEndStartNode) ||
@@ -1690,13 +1689,13 @@ SwXText::convertToTextFrame(
pNewFrame->setName(m_pImpl->m_pDoc->GetUniqueFrameName());
}
- SwTxtNode *const pTxtNode(aStartPam.GetNode()->GetTxtNode());
+ SwTxtNode *const pTxtNode(aStartPam.GetNode().GetTxtNode());
OSL_ASSERT(pTxtNode);
if (!pTxtNode || !pTxtNode->Len()) // don't remove if it contains text!
{
{ // has to be in a block to remove the SwIndexes before
// DelFullPara is called
- SwPaM aMovePam( *aStartPam.GetNode() );
+ SwPaM aMovePam( aStartPam.GetNode() );
if (aMovePam.Move( fnMoveForward, fnGoCntnt ))
{
// move the anchor to the next paragraph
@@ -1754,7 +1753,7 @@ SwXText::convertToTextFrame(
else
{
// In case the frame has a table only, the cursor points to the end of the first cell of the table.
- SwPaM aPaM(*pFrameCursor->GetPaM()->GetNode()->FindSttNodeByType(SwFlyStartNode)->EndOfSectionNode());
+ SwPaM aPaM(*pFrameCursor->GetPaM()->GetNode().FindSttNodeByType(SwFlyStartNode)->EndOfSectionNode());
// Now we have the end of the frame -- the node before that will be the paragraph we want to remove.
aPaM.GetPoint()->nNode--;
m_pImpl->m_pDoc->DelFullPara(aPaM);
@@ -1949,7 +1948,7 @@ void SwXText::Impl::ConvertCell(
aEndCellPam.DeleteMark();
aEndCellPam.Move(fnMoveBackward, fnGoNode);
aEndCellPam.GetPoint()->nContent =
- aEndCellPam.GetNode()->GetTxtNode()->Len();
+ aEndCellPam.GetNode().GetTxtNode()->Len();
}
*rLastPaM.GetPoint() = *aEndCellPam.Start();
@@ -2443,7 +2442,7 @@ SwXTextCursor * SwXBodyText::CreateTextCursor(const bool bIgnoreTables)
aPam.Move( fnMoveBackward, fnGoDoc );
if (!bIgnoreTables)
{
- SwTableNode * pTblNode = aPam.GetNode()->FindTableNode();
+ SwTableNode * pTblNode = aPam.GetNode().FindTableNode();
SwCntntNode * pCont = 0;
while (pTblNode)
{
@@ -2493,12 +2492,12 @@ throw (uno::RuntimeException, std::exception)
SwUnoInternalPaM aPam(*GetDoc());
if (::sw::XTextRangeToSwPaM(aPam, xTextPosition))
{
- if ( !aPam.GetNode()->GetTxtNode() )
+ if ( !aPam.GetNode().GetTxtNode() )
throw uno::RuntimeException("Invalid text range" );
SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent();
- SwStartNode* p1 = aPam.GetNode()->StartOfSectionNode();
+ SwStartNode* p1 = aPam.GetNode().StartOfSectionNode();
//document starts with a section?
while(p1->IsSectionNode())
{
@@ -2730,7 +2729,7 @@ SwXHeadFootText::createTextCursor() throw (uno::RuntimeException, std::exception
SwStartNode const*const pOwnStartNode = rNode.FindSttNodeByType(
(m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode);
// is there a table here?
- SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode();
+ SwTableNode* pTblNode = pUnoCrsr->GetNode().FindTableNode();
SwCntntNode* pCont = 0;
while (pTblNode)
{
@@ -2743,7 +2742,7 @@ SwXHeadFootText::createTextCursor() throw (uno::RuntimeException, std::exception
pUnoCrsr->GetPoint()->nContent.Assign(pCont, 0);
}
SwStartNode const*const pNewStartNode =
- pUnoCrsr->GetNode()->FindSttNodeByType(
+ pUnoCrsr->GetNode().FindSttNodeByType(
(m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode);
if (!pNewStartNode || (pNewStartNode != pOwnStartNode))
{
@@ -2777,9 +2776,9 @@ throw (uno::RuntimeException, std::exception)
SwPosition aPos(rNode);
SwPaM aHFPam(aPos);
aHFPam.Move(fnMoveForward, fnGoNode);
- SwStartNode *const pOwnStartNode = aHFPam.GetNode()->FindSttNodeByType(
+ SwStartNode *const pOwnStartNode = aHFPam.GetNode().FindSttNodeByType(
(m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode);
- SwStartNode *const p1 = aPam.GetNode()->FindSttNodeByType(
+ SwStartNode *const p1 = aPam.GetNode().FindSttNodeByType(
(m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode);
if (p1 == pOwnStartNode)
{
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 3a548f5fc944..ce5f4dc7d0d1 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -353,7 +353,7 @@ SwDoc * SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
{
SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr();
- const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode();
+ const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode().GetCntntNode();
const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0;
if( pCntntFrm )
{
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 04a5d890f477..d9ca76da33bf 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -90,7 +90,7 @@ sal_Int32 SwASC_AttrIter::SearchNext( sal_Int32 nStartPos )
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
if ( pHt->HasDummyChar() )
{
- sal_Int32 nPos = *pHt->GetStart();
+ sal_Int32 nPos = pHt->GetStart();
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
@@ -100,7 +100,7 @@ sal_Int32 SwASC_AttrIter::SearchNext( sal_Int32 nStartPos )
}
else if ( pHt->HasContent() )
{
- const sal_Int32 nHintStart = *pHt->GetStart();
+ const sal_Int32 nHintStart = pHt->GetStart();
if ( nHintStart >= nStartPos && nHintStart <= nMinPos )
{
nMinPos = nHintStart;
@@ -129,7 +129,7 @@ bool SwASC_AttrIter::OutAttr( sal_Int32 nSwPos )
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
if ( ( pHt->HasDummyChar()
|| pHt->HasContent() )
- && nSwPos == *pHt->GetStart() )
+ && nSwPos == pHt->GetStart() )
{
bRet = true;
OUString sOut;
@@ -158,7 +158,7 @@ bool SwASC_AttrIter::OutAttr( sal_Int32 nSwPos )
if( !sOut.isEmpty() )
rWrt.Strm().WriteUnicodeOrByteText( sOut );
}
- else if( nSwPos < *pHt->GetStart() )
+ else if( nSwPos < pHt->GetStart() )
break;
}
}
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 8162258b726a..a5eb5e414c90 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -203,15 +203,15 @@ sal_uLong SwReader::Read( const Reader& rOptions )
{
*pUndoPam->GetMark() = *pPam->GetPoint();
pUndoPam->GetPoint()->nNode++;
- SwNode* pNd = pUndoPam->GetNode();
- if( pNd->IsCntntNode() )
+ SwNode& rNd = pUndoPam->GetNode();
+ if( rNd.IsCntntNode() )
pUndoPam->GetPoint()->nContent.Assign(
- (SwCntntNode*)pNd, nSttCntnt );
+ (SwCntntNode*)&rNd, nSttCntnt );
else
pUndoPam->GetPoint()->nContent.Assign( 0, 0 );
- bool bChkHeaderFooter = pNd->FindHeaderStartNode() ||
- pNd->FindFooterStartNode();
+ bool bChkHeaderFooter = rNd.FindHeaderStartNode() ||
+ rNd.FindFooterStartNode();
// search all new Fly's, and store them as individual Undo Objects
for( sal_uInt16 n = 0; n < pDoc->GetSpzFrmFmts()->size(); ++n )
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index c6eb10e26ef0..db52907da556 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -477,7 +477,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
sal_uInt8 nBulletGrfLvl = 255; // Die auszugebende Bullet-Grafik
// Sind wir in einer Aufzaehlungs- oder Numerierungliste?
- const SwTxtNode* pTxtNd = rWrt.pCurPam->GetNode()->GetTxtNode();
+ const SwTxtNode* pTxtNd = rWrt.pCurPam->GetNode().GetTxtNode();
SwHTMLNumRuleInfo aNumInfo;
if( rHWrt.GetNextNumInfo() )
@@ -2339,7 +2339,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
sal_Int32 nStrPos = rHTMLWrt.pCurPam->GetPoint()->nContent.GetIndex();
const SwTxtAttr * pHt = 0;
sal_uInt16 nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0;
- if( nCntAttr && nStrPos > *( pHt = pNd->GetSwpHints()[ 0 ] )->GetStart() )
+ if( nCntAttr && nStrPos > ( pHt = pNd->GetSwpHints()[ 0 ] )->GetStart() )
{
// Ok, es gibt vorher Attribute, die ausgegeben werden muessen
do {
@@ -2353,7 +2353,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
if ( pHt->End() && !pHt->HasDummyChar() )
{
const sal_Int32 nHtEnd = *pHt->End(),
- nHtStt = *pHt->GetStart();
+ nHtStt = pHt->GetStart();
if( !rHTMLWrt.bWriteAll && nHtEnd <= nStrPos )
continue;
@@ -2379,7 +2379,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
}
} while( nAttrPos < nCntAttr && nStrPos >
- *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
+ ( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
// dann gebe mal alle gesammelten Attribute von der String-Pos aus
aEndPosLst.OutEndAttrs( rHTMLWrt, nStrPos + nOffset );
@@ -2407,7 +2407,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
bool bOutChar = true;
const SwTxtAttr * pTxtHt = 0;
- if( nAttrPos < nCntAttr && *pHt->GetStart() == nStrPos
+ if( nAttrPos < nCntAttr && pHt->GetStart() == nStrPos
&& nStrPos != nEnd )
{
do {
@@ -2445,7 +2445,7 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
bOutChar = false; // keine 255 ausgeben
}
} while( ++nAttrPos < nCntAttr && nStrPos ==
- *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
+ ( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
}
// Manche Draw-Formate koennen auch noch Attribute mitbringen
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index b9bf7140d2df..bc8359cb5e71 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -612,7 +612,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const sal_Char *pTag
// werden soll, fuegen wir es vor dem Space ein. Dann gibt es
// weniger Probleme beim Formatieren (bug #40483#)
const sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex();
- SwTxtNode *pTxtNd = pPam->GetNode()->GetTxtNode();
+ SwTxtNode *pTxtNd = pPam->GetNode().GetTxtNode();
bool bMoveFwd = false;
if (nPos>0 && pTxtNd && (' ' == pTxtNd->GetTxt()[nPos-1]))
{
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index f97112855185..e0d37e3bef54 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -536,7 +536,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt )
OSL_ENSURE( pTxtFld, "Where is the txt fld?" );
if( pTxtFld )
OutHTML_SwField( rWrt, pFld, pTxtFld->GetTxtNode(),
- *pTxtFld->GetStart() );
+ pTxtFld->GetStart() );
}
return rWrt;
}
diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx
index 3d0602fbf347..c3c2b9061739 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -206,7 +206,7 @@ void SwHTMLParser::FinishFootEndNote()
pDoc->InsertPoolItem( *pPam, aFtn, 0 );
SwTxtFtn * const pTxtFtn = static_cast<SwTxtFtn *>(
- pPam->GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ pPam->GetNode().GetTxtNode()->GetTxtAttrForCharAt(
pPam->GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_FTN ) );
// In Kopf- und Fusszeilen duerfen keine Fussnoten eingefuegt werden.
if( pTxtFtn )
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index eee34a296dc3..0eeea5eb6ced 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -439,7 +439,7 @@ IMAGE_SETEVENT:
!aBulletGrfs[GetNumInfo().GetDepth()-1].isEmpty() &&
aBulletGrfs[GetNumInfo().GetDepth()-1]==sGrfNm )
{
- SwTxtNode* pTxtNode = pPam->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pPam->GetNode().GetTxtNode();
if( pTxtNode && ! pTxtNode->IsCountedInList())
{
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index f56d3b168bdf..bb5efeb872d7 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -338,7 +338,7 @@ void SwHTMLParser::EndNumBulList( int nToken )
bool bAppend = pPam->GetPoint()->nContent.GetIndex() > 0;
if( !bAppend )
{
- SwTxtNode* pTxtNode = pPam->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pPam->GetNode().GetTxtNode();
bAppend = (pTxtNode && ! pTxtNode->IsOutline() && pTxtNode->IsCountedInList()) ||
@@ -399,7 +399,7 @@ void SwHTMLParser::EndNumBulList( int nToken )
// Beim letzen Append wurde das NumRule-Item und das
// NodeNum-Objekt mit kopiert. Beides muessen wir noch
// loeschen. Das ResetAttr loescht das NodeNum-Objekt mit!
- pPam->GetNode()->GetTxtNode()->ResetAttr( RES_PARATR_NUMRULE );
+ pPam->GetNode().GetTxtNode()->ResetAttr( RES_PARATR_NUMRULE );
rInfo.Clear();
}
@@ -507,7 +507,7 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
nOpenParaToken = static_cast< sal_uInt16 >(nToken);
}
- SwTxtNode* pTxtNode = pPam->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pPam->GetNode().GetTxtNode();
((SwCntntNode *)pTxtNode)->SetAttr( SwNumRuleItem(aNumRuleName) );
pTxtNode->SetAttrListLevel(nLevel);
// #i57656# - <IsCounted()> state of text node has to be adjusted accordingly.
@@ -600,7 +600,7 @@ void SwHTMLParser::EndNumBulListItem( int nToken, bool bSetColl,
void SwHTMLParser::SetNodeNum( sal_uInt8 nLevel, bool bCountedInList )
{
- SwTxtNode* pTxtNode = pPam->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pPam->GetNode().GetTxtNode();
OSL_ENSURE( pTxtNode, "Kein Text-Node an PaM-Position" );
OSL_ENSURE( GetNumInfo().GetNumRule(), "Kein Numerierungs-Regel" );
diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx
index 8296f8d971a3..34f4528704d4 100644
--- a/sw/source/filter/html/htmlnumwriter.cxx
+++ b/sw/source/filter/html/htmlnumwriter.cxx
@@ -243,10 +243,10 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt,
if( bStartValue && 1 == nStartVal && i == rInfo.GetDepth()-1 )
{
// #i51089 - TUNING#
- if ( rWrt.pCurPam->GetNode()->GetTxtNode()->GetNum() )
+ if ( rWrt.pCurPam->GetNode().GetTxtNode()->GetNum() )
{
nStartVal = static_cast< sal_uInt16 >( rWrt.pCurPam->GetNode()
- ->GetTxtNode()->GetNumberVector()[i] );
+ .GetTxtNode()->GetNumberVector()[i] );
}
else
{
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index ddba2af44821..5f3e5bbd26e5 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -5344,7 +5344,7 @@ HTMLTable *SwHTMLParser::BuildTable( SvxAdjust eParentAdjust,
SwStartNode *pTblStNd = pTCntxt->GetTableNode();
OSL_ENSURE( pTblStNd, "Wo ist der Tabellen-Node" );
- OSL_ENSURE( pTblStNd==pPam->GetNode()->FindTableNode(),
+ OSL_ENSURE( pTblStNd==pPam->GetNode().FindTableNode(),
"Stehen wir in der falschen Tabelle?" );
SwNode* pNd;
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index a5983c1ba17a..f2469a39e2e4 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -1671,10 +1671,10 @@ void SwHTMLParser::NextToken( int nToken )
if( nOpenParaToken )
EndPara();
OSL_ENSURE( !pTable, "table in table not allowed here" );
- if( !pTable && (IsNewDoc() || !pPam->GetNode()->FindTableNode()) &&
+ if( !pTable && (IsNewDoc() || !pPam->GetNode().FindTableNode()) &&
(pPam->GetPoint()->nNode.GetIndex() >
pDoc->GetNodes().GetEndOfExtras().GetIndex() ||
- !pPam->GetNode()->FindFootnoteStartNode() ) )
+ !pPam->GetNode().FindFootnoteStartNode() ) )
{
if ( nParaCnt < 5 )
Show(); // show what we have up to here
@@ -2260,7 +2260,7 @@ bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, bool bUpdateNum )
SetNodeNum( nLvl, false );
}
else
- pPam->GetNode()->GetTxtNode()->ResetAttr( RES_PARATR_NUMRULE );
+ pPam->GetNode().GetTxtNode()->ResetAttr( RES_PARATR_NUMRULE );
}
// Attrubute im Absatz davor sollte man jetzt setzen (wegen JavaScript)
@@ -2337,7 +2337,7 @@ bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, bool bUpdateNum )
}
if( nIdx != -1 )
{
- sal_Int32 nStt = *pHt->GetStart();
+ sal_Int32 nStt = pHt->GetStart();
if( nStt >= aEndPos[nIdx] )
{
bool bFont = (nIdx % 5) == 0;
@@ -3946,7 +3946,7 @@ void SwHTMLParser::EndPara( bool bReal )
if( HTML_LI_ON==nOpenParaToken && pTable )
{
#if OSL_DEBUG_LEVEL > 0
- const SwNumRule *pNumRule = pPam->GetNode()->GetTxtNode()->GetNumRule();
+ const SwNumRule *pNumRule = pPam->GetNode().GetTxtNode()->GetNumRule();
OSL_ENSURE( pNumRule, "Wo ist die Numrule geblieben" );
#endif
}
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index cb32cd81bbc5..18a17ded3a0d 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -294,7 +294,7 @@ sal_uLong SwHTMLWriter::WriteStream()
// Tabellen und Bereiche am Doc.-Anfang beachten
{
- SwTableNode * pTNd = pCurPam->GetNode()->FindTableNode();
+ SwTableNode * pTNd = pCurPam->GetNode().FindTableNode();
if( pTNd && bWriteAll )
{
// mit dem Tabellen-Node anfangen !!
@@ -307,7 +307,7 @@ sal_uLong SwHTMLWriter::WriteStream()
// erster Node (der einen Seitenumbruch enthalten darf)
pStartNdIdx = new SwNodeIndex( pCurPam->GetPoint()->nNode );
- SwSectionNode * pSNd = pCurPam->GetNode()->FindSectionNode();
+ SwSectionNode * pSNd = pCurPam->GetNode().FindSectionNode();
while( pSNd )
{
if( bWriteAll )
@@ -737,30 +737,30 @@ void SwHTMLWriter::Out_SwDoc( SwPaM* pPam )
(pCurPam->GetPoint()->nNode.GetIndex() == pCurPam->GetMark()->nNode.GetIndex() &&
pCurPam->GetPoint()->nContent.GetIndex() <= pCurPam->GetMark()->nContent.GetIndex()) )
{
- SwNode * pNd = pCurPam->GetNode();
+ SwNode& rNd = pCurPam->GetNode();
- OSL_ENSURE( !(pNd->IsGrfNode() || pNd->IsOLENode()),
+ OSL_ENSURE( !(rNd.IsGrfNode() || rNd.IsOLENode()),
"Grf- oder OLE-Node hier unerwartet" );
- if( pNd->IsTxtNode() )
+ if( rNd.IsTxtNode() )
{
- SwTxtNode* pTxtNd = pNd->GetTxtNode();
+ SwTxtNode* pTxtNd = rNd.GetTxtNode();
if( !bFirstLine )
pCurPam->GetPoint()->nContent.Assign( pTxtNd, 0 );
OutHTML_SwTxtNode( *this, *pTxtNd );
}
- else if( pNd->IsTableNode() )
+ else if( rNd.IsTableNode() )
{
- OutHTML_SwTblNode( *this, *pNd->GetTableNode(), 0 );
+ OutHTML_SwTblNode( *this, *rNd.GetTableNode(), 0 );
nBkmkTabPos = bWriteAll ? FindPos_Bkmk( *pCurPam->GetPoint() ) : -1;
}
- else if( pNd->IsSectionNode() )
+ else if( rNd.IsSectionNode() )
{
- OutHTML_Section( *this, *pNd->GetSectionNode() );
+ OutHTML_Section( *this, *rNd.GetSectionNode() );
nBkmkTabPos = bWriteAll ? FindPos_Bkmk( *pCurPam->GetPoint() ) : -1;
}
- else if( pNd == &pDoc->GetNodes().GetEndOfContent() )
+ else if( &rNd == &pDoc->GetNodes().GetEndOfContent() )
break;
pCurPam->GetPoint()->nNode++; // Bewegen
@@ -877,7 +877,7 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs()
const SwTxtAttr *pHt = pTxtNd->GetSwpHints()[i];
if( !pHt->End() )
{
- sal_Int32 nPos = *pHt->GetStart();
+ sal_Int32 nPos = pHt->GetStart();
if( nPos-nOldPos > 1
|| ( pHt->Which() != RES_TXTATR_FIELD
&& pHt->Which() != RES_TXTATR_ANNOTATION ) )
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 7cd8b9fad273..a77f06f94216 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -2000,7 +2000,7 @@ void SwFltShell::BeginFootnote()
OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
pSavedPos = new SwPosition(*pPaM->GetPoint());
pPaM->Move(fnMoveBackward, fnGoCntnt);
- SwTxtNode* pTxt = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxt = pPaM->GetNode().GetTxtNode();
SwTxtAttr *const pFN = pTxt->GetTxtAttrForCharAt(
pPaM->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN);
if( !pFN ){ // Happens at footnote in Fly, among others
diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx
index d52cfeea5436..2ad184434dd3 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -1745,7 +1745,7 @@ static sal_uLong GuessPicSize(W1_PIC* pPic)
void Ww1Picture::WriteBmp(SvStream& rOut)
{
long nSize = pPic->lcbGet() - (sizeof(*pPic)-sizeof(pPic->rgb));
- sal_uInt8* p = pPic->rgbGet();
+ sal_uInt8* p = &pPic->rgbGet();
sal_uInt16 maxx = pPic->mfp.xExtGet();
sal_uInt16 padx = ((maxx + 7) / 8) * 8;
sal_uInt16 maxy = pPic->mfp.yExtGet();
@@ -1869,7 +1869,7 @@ void Ww1Picture::Out(Ww1Shell& rOut, Ww1Manager& /*rMan*/)
case 8: // embedded metafile
{
SvMemoryStream aOut(8192, 8192);
- aOut.Write(pPic->rgbGet(), pPic->lcbGet() -
+ aOut.Write(&pPic->rgbGet(), pPic->lcbGet() -
(sizeof(*pPic)-sizeof(pPic->rgb)));
aOut.Seek(0);
GDIMetaFile aWMF;
@@ -1889,7 +1889,7 @@ void Ww1Picture::Out(Ww1Shell& rOut, Ww1Manager& /*rMan*/)
case 94: // embedded name SH:??? Which one is it? Embedded or Name ?
case 98: // TIFF name
{
- OUString aDir( (sal_Char*)pPic->rgbGet(),
+ OUString aDir( (sal_Char*)&pPic->rgbGet(),
(sal_uInt16)(pPic->lcbGet() - (sizeof(*pPic)-sizeof(pPic->rgb))),
RTL_TEXTENCODING_MS_1252 );
diff --git a/sw/source/filter/ww1/w1struct.hxx b/sw/source/filter/ww1/w1struct.hxx
index 189103f88706..f8b7de9ee52a 100644
--- a/sw/source/filter/ww1/w1struct.hxx
+++ b/sw/source/filter/ww1/w1struct.hxx
@@ -793,7 +793,7 @@ struct W1_PIC // PictureStructure
// sal_uInt16 dyaOriginGet() {
// return SVBT16ToShort(dyaOrigin); }
sal_uInt8 rgb;// 0x3a variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
- sal_uInt8* rgbGet() { return &rgb; }
+ sal_uInt8& rgbGet() { return rgb; }
};
struct W1_TBD
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 83c753e9f5bc..e725b7e61905 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -407,7 +407,7 @@ void RtfExport::WriteMainText()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
- SwTableNode* pTableNode = pCurPam->GetNode()->FindTableNode();
+ SwTableNode* pTableNode = pCurPam->GetNode().FindTableNode();
if (m_pWriter && m_pWriter->bWriteOnlyFirstTable
&& pTableNode != 0)
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index d885948a1616..9b662f99ce6a 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -313,7 +313,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
for( sal_uInt16 i = 0; i < pTxtAttrs->Count(); i++ )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- sal_Int32 nPos = *pHt->GetStart(); // first Attr characters
+ sal_Int32 nPos = pHt->GetStart(); // first Attr characters
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
@@ -326,7 +326,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
if (pHt->HasDummyChar())
{
// pos + 1 because of CH_TXTATR in Text
- nPos = *pHt->GetStart() + 1;
+ nPos = pHt->GetStart() + 1;
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
}
@@ -422,8 +422,8 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
const sal_Int32* pEnd = pHt->End();
- if (pEnd ? ( nSwPos >= *pHt->GetStart() && nSwPos < *pEnd)
- : nSwPos == *pHt->GetStart() )
+ if (pEnd ? ( nSwPos >= pHt->GetStart() && nSwPos < *pEnd)
+ : nSwPos == pHt->GetStart() )
{
sal_uInt16 nWhich = pHt->GetAttr().Which();
if (nWhich == RES_TXTATR_AUTOFMT)
@@ -450,7 +450,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
else
aRangeItems[nWhich] = (&(pHt->GetAttr()));
}
- else if (nSwPos < *pHt->GetStart())
+ else if (nSwPos < pHt->GetStart())
break;
}
}
@@ -617,7 +617,7 @@ bool SwWW8AttrIter::IsTxtAttr( sal_Int32 nSwPos )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
if ( ( pHt->HasDummyChar() || pHt->HasContent() )
- && (*pHt->GetStart() == nSwPos) )
+ && (pHt->GetStart() == nSwPos) )
{
return true;
}
@@ -676,7 +676,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
const SfxPoolItem* pItem = &pHt->GetAttr();
const sal_Int32 * pAtrEnd = 0;
if( 0 != ( pAtrEnd = pHt->End() ) && // only Attr with an end
- nTmpSwPos >= *pHt->GetStart() && nTmpSwPos < *pAtrEnd )
+ nTmpSwPos >= pHt->GetStart() && nTmpSwPos < *pAtrEnd )
{
if ( nWhich == pItem->Which() )
{
@@ -697,7 +697,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
}
}
}
- else if (nTmpSwPos < *pHt->GetStart())
+ else if (nTmpSwPos < pHt->GetStart())
break; // nothing more to come
}
}
@@ -805,7 +805,7 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, sal_Int32 /*nPos*/,
if ( g_pBreakIt->GetBreakIter().is() )
nRubyScript = g_pBreakIt->GetBreakIter()->getScriptType( rNode.GetTxt(),
- *( pRubyTxt->GetStart() ) );
+ pRubyTxt->GetStart() );
else
nRubyScript = i18n::ScriptType::ASIAN;
@@ -1146,8 +1146,8 @@ void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAtt
const sal_Int32* pTxtEnd = rTxtTOXMark.End();
if ( pTxtEnd ) // has range?
{
- sTxt = rNode.GetExpandTxt( *rTxtTOXMark.GetStart(),
- *pTxtEnd - *rTxtTOXMark.GetStart() );
+ sTxt = rNode.GetExpandTxt( rTxtTOXMark.GetStart(),
+ *pTxtEnd - rTxtTOXMark.GetStart() );
}
else
sTxt = rAttr.GetAlternativeText();
@@ -1205,7 +1205,7 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
switch ( pItem->Which() )
{
case RES_TXTATR_INETFMT:
- if ( nPos == *pHt->GetStart() )
+ if ( nPos == pHt->GetStart() )
{
const SwFmtINetFmt *rINet = static_cast< const SwFmtINetFmt* >( pItem );
if ( m_rExport.AttrOutput().StartURL( rINet->GetValue(), rINet->GetTargetFrame() ) )
@@ -1218,7 +1218,7 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
}
break;
case RES_TXTATR_REFMARK:
- if ( nPos == *pHt->GetStart() )
+ if ( nPos == pHt->GetStart() )
{
OutSwFmtRefMark( *static_cast< const SwFmtRefMark* >( pItem ), true );
++nRet;
@@ -1230,11 +1230,11 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
}
break;
case RES_TXTATR_TOXMARK:
- if ( nPos == *pHt->GetStart() )
+ if ( nPos == pHt->GetStart() )
m_rExport.AttrOutput().TOXMark( rNd, *static_cast< const SwTOXMark* >( pItem ) );
break;
case RES_TXTATR_CJK_RUBY:
- if ( nPos == *pHt->GetStart() )
+ if ( nPos == pHt->GetStart() )
{
m_rExport.AttrOutput().StartRuby( rNd, nPos, *static_cast< const SwFmtRuby* >( pItem ) );
++nRet;
@@ -2659,14 +2659,14 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
for( sal_uInt16 i = 0; i < pTxtAttrs->Count(); i++ )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- const sal_Int32* startPos = pHt->GetStart(); // first Attr characters
+ const sal_Int32 startPos = pHt->GetStart(); // first Attr characters
const sal_Int32* endPos = pHt->End(); // end Attr characters
// Check if these attributes are for the last character in the paragraph
// - which means the paragraph marker. If a paragraph has 7 characters,
// then properties on character 8 are for the paragraph marker
- if( (startPos && endPos) && (*startPos == *endPos ) && (*endPos == rNode.GetTxt().getLength()) )
+ if( (endPos) && (startPos == *endPos ) && (*endPos == rNode.GetTxt().getLength()) )
{
- SAL_INFO( "sw.ww8", *startPos << "startPos == endPos" << *endPos);
+ SAL_INFO( "sw.ww8", startPos << "startPos == endPos" << *endPos);
sal_uInt16 nWhich = pHt->GetAttr().Which();
SAL_INFO( "sw.ww8", "nWhich" << nWhich);
if (nWhich == RES_TXTATR_AUTOFMT)
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 215c33ad2ec4..c4bde9e0df92 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1044,7 +1044,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
sal_uLong nRstLnNum = pSet ? ((SwFmtLineNumber&)pSet->Get( RES_LINENUMBER )).GetStartValue() : 0;
- const SwTableNode* pTblNd = rExport.pCurPam->GetNode()->FindTableNode();
+ const SwTableNode* pTblNd = rExport.pCurPam->GetNode().FindTableNode();
const SwSectionNode* pSectNd;
if ( pTblNd )
{
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 368422fbcf4f..c69ee3f5fbe2 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2546,38 +2546,38 @@ void MSWordExportBase::WriteText()
( pCurPam->GetPoint()->nNode == pCurPam->GetMark()->nNode &&
pCurPam->GetPoint()->nContent.GetIndex() <= pCurPam->GetMark()->nContent.GetIndex() ) )
{
- SwNode * pNd = pCurPam->GetNode();
+ SwNode& rNd = pCurPam->GetNode();
- if ( pNd->IsTxtNode() )
- SectionBreaksAndFrames( *pNd->GetTxtNode() );
+ if ( rNd.IsTxtNode() )
+ SectionBreaksAndFrames( *rNd.GetTxtNode() );
// output the various types of nodes
- if ( pNd->IsCntntNode() )
+ if ( rNd.IsCntntNode() )
{
- SwCntntNode* pCNd = (SwCntntNode*)pNd;
+ SwCntntNode* pCNd = (SwCntntNode*)&rNd;
- const SwPageDesc* pTemp = pNd->FindPageDesc(false);
+ const SwPageDesc* pTemp = rNd.FindPageDesc(false);
if ( pTemp )
pAktPageDesc = pTemp;
pCurPam->GetPoint()->nContent.Assign( pCNd, 0 );
OutputContentNode( *pCNd );
}
- else if ( pNd->IsTableNode() )
+ else if ( rNd.IsTableNode() )
{
- mpTableInfo->processSwTable( &pNd->GetTableNode()->GetTable() );
+ mpTableInfo->processSwTable( &rNd.GetTableNode()->GetTable() );
}
- else if ( pNd->IsSectionNode() && TXT_MAINTEXT == nTxtTyp )
- OutputSectionNode( *pNd->GetSectionNode() );
- else if ( TXT_MAINTEXT == nTxtTyp && pNd->IsEndNode() &&
- pNd->StartOfSectionNode()->IsSectionNode() )
+ else if ( rNd.IsSectionNode() && TXT_MAINTEXT == nTxtTyp )
+ OutputSectionNode( *rNd.GetSectionNode() );
+ else if ( TXT_MAINTEXT == nTxtTyp && rNd.IsEndNode() &&
+ rNd.StartOfSectionNode()->IsSectionNode() )
{
- const SwSection& rSect = pNd->StartOfSectionNode()->GetSectionNode()
+ const SwSection& rSect = rNd.StartOfSectionNode()->GetSectionNode()
->GetSection();
if ( bStartTOX && TOX_CONTENT_SECTION == rSect.GetType() )
bStartTOX = false;
- SwNodeIndex aIdx( *pNd, 1 );
+ SwNodeIndex aIdx( rNd, 1 );
if ( aIdx.GetNode().IsEndNode() && aIdx.GetNode().StartOfSectionNode()->IsSectionNode() )
;
else if ( aIdx.GetNode().IsSectionNode() )
@@ -2634,16 +2634,16 @@ void MSWordExportBase::WriteText()
}
}
}
- else if ( pNd->IsStartNode() )
+ else if ( rNd.IsStartNode() )
{
- OutputStartNode( *pNd->GetStartNode() );
+ OutputStartNode( *rNd.GetStartNode() );
}
- else if ( pNd->IsEndNode() )
+ else if ( rNd.IsEndNode() )
{
- OutputEndNode( *pNd->GetEndNode() );
+ OutputEndNode( *rNd.GetEndNode() );
}
- if ( pNd == &pNd->GetNodes().GetEndOfContent() )
+ if ( &rNd == &rNd.GetNodes().GetEndOfContent() )
break;
SwNode * pCurrentNode = &pCurPam->GetPoint()->nNode.GetNode();
@@ -2695,11 +2695,11 @@ bool MSWordExportBase::IsInTable() const
if (pCurPam != NULL)
{
- SwNode * pNode = pCurPam->GetNode();
+ SwNode& rNode = pCurPam->GetNode();
- if (pNode != NULL && mpTableInfo.get() != NULL)
+ if (mpTableInfo.get() != NULL)
{
- ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = mpTableInfo->getTableNodeInfo(pNode);
+ ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = mpTableInfo->getTableNodeInfo(&rNode);
if (pTableNodeInfo.get() != NULL && pTableNodeInfo->getDepth() > 0)
{
@@ -3425,7 +3425,7 @@ sal_uLong SwWW8Writer::WriteStorage()
// Respect table at the beginning of the document
{
- SwTableNode * pTNd = pCurPam->GetNode()->FindTableNode();
+ SwTableNode* pTNd = pCurPam->GetNode().FindTableNode();
if( pTNd && bWriteAll )
// start with the table node !!
pCurPam->GetPoint()->nNode = *pTNd;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2f8959d2cdb1..31b9df797f2c 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3083,8 +3083,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
const SwTxtNode *pTxtNd = GetExport().GetHdFtPageRoot();
if (!pTxtNd)
{
- if (const SwNode *pNd = GetExport().pCurPam->GetNode())
- pTxtNd = pNd->GetTxtNode();
+ pTxtNd = GetExport().pCurPam->GetNode().GetTxtNode();
}
if (pTxtNd)
@@ -3318,8 +3317,8 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, ww::bytes* pOutArr )
pCFmt = pInfo->GetCharFmt( *pDoc );
aSet.Set( pCFmt->GetAttrSet() );
- pTxtFtn->GetTxtNode().GetAttr( aSet, *pTxtFtn->GetStart(),
- (*pTxtFtn->GetStart()) + 1 );
+ pTxtFtn->GetTxtNode().GetAttr( aSet, pTxtFtn->GetStart(),
+ (pTxtFtn->GetStart()) + 1 );
m_pAttrOutput->OutputItem( aSet.Get( RES_CHRATR_FONT ) );
pO = pOld;
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 90b6a44c551a..ae1d28cfea65 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2468,7 +2468,7 @@ void wwSectionManager::SetHdFt(wwSection &rSection, int nSect,
void SwWW8ImplReader::AppendTxtNode(SwPosition& rPos)
{
- SwTxtNode* pTxt = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxt = pPaM->GetNode().GetTxtNode();
const SwNumRule* pRule = NULL;
@@ -3432,7 +3432,7 @@ bool SwWW8ImplReader::HandlePageBreakChar()
if (!nInTable)
{
bool IsTemp=true;
- SwTxtNode* pTemp = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTemp = pPaM->GetNode().GetTxtNode();
if (pTemp && pTemp->GetTxt().isEmpty()
&& (bFirstPara || bFirstParaOfPage))
{
@@ -3453,7 +3453,7 @@ bool SwWW8ImplReader::HandlePageBreakChar()
bParaEndAdded = true;
if (0 >= pPaM->GetPoint()->nContent.GetIndex())
{
- if (SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode())
+ if (SwTxtNode* pTxtNode = pPaM->GetNode().GetTxtNode())
{
pTxtNode->SetAttr(
*GetDfltAttr(RES_PARATR_NUMRULE));
@@ -3716,20 +3716,20 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTxtPos, bool& rbStartLine)
long nSkipChars = 0;
WW8PLCFManResult aRes;
- OSL_ENSURE(pPaM->GetNode()->GetTxtNode(), "Missing txtnode");
+ OSL_ENSURE(pPaM->GetNode().GetTxtNode(), "Missing txtnode");
bool bStartAttr = pPlcxMan->Get(&aRes); // Get Attribute position again
aRes.nAktCp = rTxtPos; // Current Cp position
bool bNewSection = (aRes.nFlags & MAN_MASK_NEW_SEP) && !bIgnoreText;
if ( bNewSection ) // New Section
{
- OSL_ENSURE(pPaM->GetNode()->GetTxtNode(), "Missing txtnode");
+ OSL_ENSURE(pPaM->GetNode().GetTxtNode(), "Missing txtnode");
// Create PageDesc and fill it
maSectionManager.CreateSep(rTxtPos, bPgSecBreak);
// -> 0xc was a Sectionbreak, but not a Pagebreak;
// Create PageDesc and fill it
bPgSecBreak = false;
- OSL_ENSURE(pPaM->GetNode()->GetTxtNode(), "Missing txtnode");
+ OSL_ENSURE(pPaM->GetNode().GetTxtNode(), "Missing txtnode");
}
// New paragraph over Plcx.Fkp.papx
@@ -3930,7 +3930,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
while ( l<nStartCp+nTextLen )
{
ReadAttrs( nNext, l, bStartLine );// Takes SectionBreaks into account, too
- OSL_ENSURE(pPaM->GetNode()->GetTxtNode(), "Missing txtnode");
+ OSL_ENSURE(pPaM->GetNode().GetTxtNode(), "Missing txtnode");
if (mpPostProcessAttrsInfo != NULL)
PostProcessAttrs();
@@ -3968,7 +3968,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
if (pPreviousNode && bStartLine)
{
- SwTxtNode* pEndNd = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pEndNd = pPaM->GetNode().GetTxtNode();
const sal_Int32 nDropCapLen = pPreviousNode->GetTxt().getLength();
// Need to reset the font size and text position for the dropcap
@@ -4001,7 +4001,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
else if (bDropCap)
{
// If we have found a dropcap store the textnode
- pPreviousNode = pPaM->GetNode()->GetTxtNode();
+ pPreviousNode = pPaM->GetNode().GetTxtNode();
const sal_uInt8 *pDCS;
@@ -5244,7 +5244,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
for( sal_uInt16 nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos)
{
const SwTxtAttr *pHt = (*pHints)[nHintPos];
- const sal_Int32 st = *(pHt->GetStart());
+ const sal_Int32 st = pHt->GetStart();
if( pHt
&& pHt->Which() == RES_TXTATR_FLYCNT
&& (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex()) )
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 2a7cc2ca8437..758c35b8e592 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -288,7 +288,7 @@ sal_uInt16 SwWW8ImplReader::End_Ftn()
//Get the footnote character and remove it from the txtnode. We'll
//replace it with the footnote
- SwTxtNode* pTxt = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxt = pPaM->GetNode().GetTxtNode();
sal_Int32 nPos = pPaM->GetPoint()->nContent.GetIndex();
OUString sChar;
@@ -996,7 +996,7 @@ void SwWW8ImplReader::NextAnlLine(const sal_uInt8* pSprm13)
else
nSwNumLevel = 0xff; // no number
- SwTxtNode* pNd = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pNd = pPaM->GetNode().GetTxtNode();
if (nSwNumLevel < MAXLEVEL)
pNd->SetAttrListLevel( nSwNumLevel );
else
@@ -2848,7 +2848,7 @@ bool WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
}
// Better to turn Snap to Grid off for all paragraphs in tables
- if(SwTxtNode *pNd = pIo->pPaM->GetNode()->GetTxtNode())
+ if(SwTxtNode *pNd = pIo->pPaM->GetNode().GetTxtNode())
{
const SfxPoolItem &rItm = pNd->SwCntntNode::GetAttr(RES_PARATR_SNAPTOGRID);
SvxParaGridItem &rSnapToGrid = (SvxParaGridItem&)(rItm);
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index b547cd080366..dd40c3ac396f 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1629,7 +1629,7 @@ bool SwWW8ImplReader::SetTxtFmtCollAndListLevel(const SwPaM& rRg,
if( rStyleInfo.pFmt && rStyleInfo.bColl )
{
bRes = rDoc.SetTxtFmtColl(rRg, (SwTxtFmtColl*)rStyleInfo.pFmt);
- SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pPaM->GetNode().GetTxtNode();
OSL_ENSURE( pTxtNode, "No Text-Node at PaM-Position" );
// make code robust
if ( !pTxtNode )
@@ -1792,7 +1792,7 @@ void SwWW8ImplReader::RegisterNumFmtOnTxtNode(sal_uInt16 nActLFO,
if (pLstManager) // sind die Listendeklarationen gelesen?
{
- SwTxtNode* pTxtNd = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNd = pPaM->GetNode().GetTxtNode();
OSL_ENSURE(pTxtNd, "No Text-Node at PaM-Position");
if (!pTxtNd)
return;
@@ -2001,7 +2001,7 @@ void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
// reset/blank the indent
pAktColl->SetFmtAttr(SvxLRSpaceItem(RES_LR_SPACE));
}
- else if (SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode())
+ else if (SwTxtNode* pTxtNode = pPaM->GetNode().GetTxtNode())
{
// here a paragraph is being directly formated
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index e3414ee10e9d..c7352c21c58e 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2364,7 +2364,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt
//we have inserted a section before this point, so adjust pos
//for future page/section segment insertion
- maSectionManager.PrependedInlineNode(aTmpPos, *pPaM->GetNode());
+ maSectionManager.PrependedInlineNode(aTmpPos, pPaM->GetNode());
return FLD_TEXT;
}
@@ -3325,7 +3325,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
// inserting a toc inserts a section before this point, so adjust pos
// for future page/section segment insertion
- maSectionManager.PrependedInlineNode( *mpPosAfterTOC->GetPoint(), *aRegion.GetNode() );
+ maSectionManager.PrependedInlineNode( *mpPosAfterTOC->GetPoint(), aRegion.GetNode() );
}
// Setze Ende in Stack
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index de10966c796d..884af8595a57 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3884,7 +3884,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
// for list levels of mode LABEL_ALIGNMENT.(see ww8par3.cxx
// W8ImplReader::RegisterNumFmtOnTxtNode).
// Need to apply the list format to the paragraph here.
- SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode();
+ SwTxtNode* pTxtNode = pPaM->GetNode().GetTxtNode();
if( pTxtNode && pTxtNode->AreListLevelIndentsApplicable() )
{
SwNumRule * pNumRule = pTxtNode->GetNumRule();
@@ -3975,7 +3975,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
if (!pAktColl)
{
- if (const SwTxtNode* pNode = pPaM->GetNode()->GetTxtNode())
+ if (const SwTxtNode* pNode = pPaM->GetNode().GetTxtNode())
{
if ( const SwNumFmt *pNumFmt = GetNumFmtFromTxtNode(*pNode) )
{
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index d129574b808e..f9a14fd049dd 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2845,7 +2845,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection(
if( bFirstSection )
{
// The Cursor already is in the first section
- pStNd = pTxtCrsr->GetPaM()->GetNode()->FindTableBoxStartNode();
+ pStNd = pTxtCrsr->GetPaM()->GetNode().FindTableBoxStartNode();
bFirstSection = false;
GetImport().GetTextImport()->SetStyleAndAttrs( GetImport(),
GetImport().GetTextImport()->GetCursor(), "Standard", true );
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 12cabb4ea082..7d302395f980 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -315,7 +315,7 @@ void SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading()
OSL_ENSURE(pTxtNode, "need current SwTxtNode");
if(!pTxtNode)
return;
- sal_Int32 nTextIndex = *pTxtTOXMark->GetStart();
+ sal_Int32 nTextIndex = pTxtTOXMark->GetStart();
nLangForPhoneticReading = pTxtNode->GetLang( nTextIndex );
}
else //if dialog is opened to create a new mark
diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
index 67d0f03d07fd..f8c5f7f192be 100644
--- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
+++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
@@ -66,7 +66,7 @@ void SwModalRedlineAcceptDlg::Activate()
void SwModalRedlineAcceptDlg::AcceptAll( bool bAccept )
{
- SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl()->GetFilterPage();
+ SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl().GetFilterPage();
if (pFilterTP->IsDate() || pFilterTP->IsAuthor() ||
pFilterTP->IsRange() || pFilterTP->IsAction())
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index a53cc29cd401..90a56323595b 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -545,8 +545,8 @@ void SwSpellDialogChildWindow::GetFocus()
case SHELL_MODE_TABLE_LIST_TEXT:
{
SwPaM* pCursor = pWrtShell->GetCrsr();
- if(m_pSpellState->m_pPointNode != pCursor->GetNode(true) ||
- m_pSpellState->m_pMarkNode != pCursor->GetNode(false)||
+ if(m_pSpellState->m_pPointNode != &pCursor->GetNode(true) ||
+ m_pSpellState->m_pMarkNode != &pCursor->GetNode(false)||
m_pSpellState->m_nPointPos != pCursor->GetPoint()->nContent.GetIndex()||
m_pSpellState->m_nMarkPos != pCursor->GetMark()->nContent.GetIndex())
bInvalidate = true;
@@ -602,8 +602,8 @@ void SwSpellDialogChildWindow::LoseFocus()
{
// store a node pointer and a pam-position to be able to check on next GetFocus();
SwPaM* pCursor = pWrtShell->GetCrsr();
- m_pSpellState->m_pPointNode = pCursor->GetNode(true);
- m_pSpellState->m_pMarkNode = pCursor->GetNode(false);
+ m_pSpellState->m_pPointNode = &pCursor->GetNode(true);
+ m_pSpellState->m_pMarkNode = &pCursor->GetNode(false);
m_pSpellState->m_nPointPos = pCursor->GetPoint()->nContent.GetIndex();
m_pSpellState->m_nMarkPos = pCursor->GetMark()->nContent.GetIndex();
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index 9ef1e482bae0..1a0692146548 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -127,7 +127,7 @@ void SwAnnotationWin::UpdateData()
{
SwTxtFld *const pTxtFld = mpFmtFld->GetTxtFld();
SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
+ aPosition.nContent = pTxtFld->GetStart();
rUndoRedo.AppendUndo(
new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
}
@@ -169,7 +169,7 @@ bool SwAnnotationWin::CalcFollow()
{
SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
+ aPosition.nContent = pTxtFld->GetStart();
SwTxtAttr * const pTxtAttr =
pTxtFld->GetTxtNode().GetTxtAttrForCharAt(
aPosition.nContent.GetIndex() - 1,
@@ -184,7 +184,7 @@ sal_uInt32 SwAnnotationWin::CountFollowing()
sal_uInt32 aCount = 1; // we start with 1, so we have to subtract one at the end again
SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
+ aPosition.nContent = pTxtFld->GetStart();
SwTxtAttr * pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttrForCharAt(
aPosition.nContent.GetIndex() + 1,
@@ -267,7 +267,7 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
{
SwTxtFld *const pTxtFld = mpFmtFld->GetTxtFld();
SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
+ aPosition.nContent = pTxtFld->GetStart();
rUndoRedo.AppendUndo(
new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
}
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 856d18c993d3..7f574601e827 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -660,7 +660,7 @@ void SwSidebarWin::SetPosAndSize()
SwShellTableCrsr* pTableCrsr = new SwShellTableCrsr( DocView().GetWrtShell(), aStartPos );
pTableCrsr->SetMark();
pTableCrsr->GetMark()->nNode = *pTxtNode;
- pTableCrsr->GetMark()->nContent.Assign( pTxtNode, *(pTxtAnnotationFld->GetStart())+1 );
+ pTableCrsr->GetMark()->nContent.Assign( pTxtNode, pTxtAnnotationFld->GetStart()+1 );
pTableCrsr->NewTableSelection();
pTmpCrsr = pTableCrsr;
}
@@ -669,7 +669,7 @@ void SwSidebarWin::SetPosAndSize()
SwShellCrsr* pCrsr = new SwShellCrsr( DocView().GetWrtShell(), aStartPos );
pCrsr->SetMark();
pCrsr->GetMark()->nNode = *pTxtNode;
- pCrsr->GetMark()->nContent.Assign( pTxtNode, *(pTxtAnnotationFld->GetStart())+1 );
+ pCrsr->GetMark()->nContent.Assign( pTxtNode, pTxtAnnotationFld->GetStart()+1 );
pTmpCrsr = pCrsr;
}
::boost::scoped_ptr<SwShellCrsr> pTmpCrsrForAnnotationTextRange( pTmpCrsr );
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 71e7f483c4be..e1fda396a3a2 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3609,10 +3609,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// half of the field was clicked on.
SwTxtAttr const*const pTxtFld(aFieldAtPos.pFndTxtAttr);
if (rSh.GetCurrentShellCursor().GetPoint()->nContent
- .GetIndex() != *pTxtFld->GetStart())
+ .GetIndex() != pTxtFld->GetStart())
{
assert(rSh.GetCurrentShellCursor().GetPoint()->nContent
- .GetIndex() == (*pTxtFld->GetStart() + 1));
+ .GetIndex() == (pTxtFld->GetStart() + 1));
rSh.Left( CRSR_SKIP_CHARS, false, 1, false );
}
// don't go into the !bOverSelect block below - it moves
@@ -4507,7 +4507,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
// select content of Input Field, but exclude CH_TXT_ATR_INPUTFIELDSTART
// and CH_TXT_ATR_INPUTFIELDEND
rSh.SttSelect();
- rSh.SelectTxt( *(aCntntAtPos.pFndTxtAttr->GetStart()) + 1,
+ rSh.SelectTxt( aCntntAtPos.pFndTxtAttr->GetStart() + 1,
*(aCntntAtPos.pFndTxtAttr->End()) - 1 );
}
else
diff --git a/sw/source/uibase/docvw/frmsidebarwincontainer.cxx b/sw/source/uibase/docvw/frmsidebarwincontainer.cxx
index 3760f9778446..14c96d5da3a9 100644
--- a/sw/source/uibase/docvw/frmsidebarwincontainer.cxx
+++ b/sw/source/uibase/docvw/frmsidebarwincontainer.cxx
@@ -101,7 +101,7 @@ bool SwFrmSidebarWinContainer::insert( const SwFrm& rFrm,
FrmKey aFrmKey( &rFrm );
SidebarWinContainer& rSidebarWinContainer = (*mpFrmSidebarWinContainer)[ aFrmKey ];
- SidebarWinKey aSidebarWinKey( *(rFmtFld.GetTxtFld()->GetStart()) );
+ SidebarWinKey aSidebarWinKey( rFmtFld.GetTxtFld()->GetStart() );
if ( rSidebarWinContainer.empty() ||
rSidebarWinContainer.find( aSidebarWinKey) == rSidebarWinContainer.end() )
{
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index 17676f2fff92..e3372fbf8239 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -225,8 +225,8 @@ private:
static void InitInterface_Impl();
public:
- inline Window* GetFrameWindow() const { return &(GetViewFrame())->GetWindow(); }
- inline SwViewShell* GetViewShell() const { return pViewWin->GetViewShell(); }
+ inline Window& GetFrameWindow() const { return GetViewFrame()->GetWindow(); }
+ inline SwViewShell* GetViewShell() const { return pViewWin->GetViewShell(); }
inline const Rectangle& GetVisArea() const { return aVisArea; }
inline void GrabFocusViewWin() { pViewWin->GrabFocus(); }
inline void RepaintCoreRect( const SwRect& rRect )
@@ -297,7 +297,7 @@ public:
inline void SwPagePreview::AdjustEditWin()
{
- OuterResizePixel( Point(), GetFrameWindow()->GetOutputSizePixel() );
+ OuterResizePixel( Point(), GetFrameWindow().GetOutputSizePixel() );
}
#endif
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index 1c3ca950a205..1a84a2a895fb 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -118,7 +118,7 @@ public:
DECL_LINK( FilterChangedHdl, void *pDummy = 0 );
- inline SvxAcceptChgCtr* GetChgCtrl() { return &aTabPagesCTRL; }
+ inline SvxAcceptChgCtr& GetChgCtrl() { return aTabPagesCTRL; }
inline bool HasRedlineAutoFmt() const { return bRedlnAutoFmt; }
void Init(sal_uInt16 nStart = 0);
diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx
index 62474b422739..801a420471b5 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -546,7 +546,7 @@ namespace SwLangHelper
// string for guessing language
OUString aText;
SwPaM *pCrsr = rSh.GetCrsr();
- SwTxtNode *pNode = pCrsr->GetNode()->GetTxtNode();
+ SwTxtNode *pNode = pCrsr->GetNode().GetTxtNode();
if (pNode)
{
aText = pNode->GetTxt();
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index a10d2c68a24e..1ce5469bd189 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -839,11 +839,11 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor >
pUnoCrsr->DeleteMark();
}
}
- const SwNode* pRangeNode = pUnoCrsr->GetNode();
- bParentInExtra = pRangeNode->FindFlyStartNode() ||
- pRangeNode->FindFootnoteStartNode() ||
- pRangeNode->FindHeaderStartNode() ||
- pRangeNode->FindFooterStartNode() ;
+ const SwNode& rRangeNode = pUnoCrsr->GetNode();
+ bParentInExtra = rRangeNode.FindFlyStartNode() ||
+ rRangeNode.FindFootnoteStartNode() ||
+ rRangeNode.FindHeaderStartNode() ||
+ rRangeNode.FindFooterStartNode() ;
}
util::SearchOptions aSearchOpt;
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index a21ae7536924..75d94dbab393 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -1105,20 +1105,20 @@ void SwXTextViewCursor::gotoRange(
else if(nFrmType & FRMTYPE_FOOTNOTE)
eSearchNodeType = SwFootnoteStartNode;
- const SwStartNode* pOwnStartNode = aOwnPaM.GetNode()->
+ const SwStartNode* pOwnStartNode = aOwnPaM.GetNode().
FindSttNodeByType(eSearchNodeType);
const SwNode* pSrcNode = 0;
if(pCursor && pCursor->GetPaM())
{
- pSrcNode = pCursor->GetPaM()->GetNode();
+ pSrcNode = &pCursor->GetPaM()->GetNode();
}
else if (pRange)
{
SwPaM aPam(pRange->GetDoc()->GetNodes());
if (pRange->GetPositions(aPam))
{
- pSrcNode = aPam.GetNode();
+ pSrcNode = &aPam.GetNode();
}
}
else if (pPara && pPara->GetTxtNode())
@@ -1501,8 +1501,8 @@ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const
{
SwWrtShell& rSh = m_pView->GetWrtShell();
SwPaM* pShellCrsr = rSh.GetCrsr();
- SwNode *pNode = pShellCrsr->GetNode();
- if (pNode && pNode->IsTxtNode())
+ SwNode& rNode = pShellCrsr->GetNode();
+ if (rNode.IsTxtNode())
{
SwUnoCursorHelper::SetPropertyValue(
*pShellCrsr, *m_pPropSet, rPropertyName, aValue );
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index dcb9d4c52d0c..ae07f4b9c902 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -184,7 +184,7 @@ long SwWrtShell::DelLeft()
// #i4032# Don't actually call a 'delete' if we
// changed the table cell, compare DelRight().
const SwStartNode * pSNdOld = pWasInTblNd ?
- GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
+ GetSwCrsr()->GetNode().FindTableBoxStartNode() :
0;
// If the cursor is at the beginning of a paragraph, try to step
@@ -199,7 +199,7 @@ long SwWrtShell::DelLeft()
return 0;
const SwStartNode* pSNdNew = pIsInTblNd ?
- GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
+ GetSwCrsr()->GetNode().FindTableBoxStartNode() :
0;
// #i4032# Don't actually call a 'delete' if we
@@ -300,8 +300,7 @@ long SwWrtShell::DelRight()
{
// #108049# Save the startnode of the current cell
const SwStartNode * pSNdOld;
- pSNdOld = GetSwCrsr()->GetNode()->
- FindTableBoxStartNode();
+ pSNdOld = GetSwCrsr()->GetNode().FindTableBoxStartNode();
if ( SwCrsrShell::IsEndPara() )
{
@@ -320,7 +319,7 @@ long SwWrtShell::DelRight()
cell. May be different to pSNdOld as we have
moved. */
const SwStartNode * pSNdNew = GetSwCrsr()
- ->GetNode()->FindTableBoxStartNode();
+ ->GetNode().FindTableBoxStartNode();
/** #108049# Only move instead of deleting if we
have moved to a different cell */
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index eb35bb6ffbca..703b0aa62097 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1347,8 +1347,8 @@ void SortedResultSet::PropertyChanged( const PropertyChangeEvent& rEvt )
void SortedResultSet::CopyData( SortedResultSet *pSource )
{
- const SortedEntryList *pSrcS2O = pSource->GetS2OList();
- const SimpleList *pSrcO2S = pSource->GetO2SList();
+ const SortedEntryList& rSrcS2O = pSource->GetS2OList();
+ const SimpleList& rSrcO2S = pSource->GetO2SList();
sal_IntPtr i, nCount;
@@ -1359,12 +1359,12 @@ void SortedResultSet::CopyData( SortedResultSet *pSource )
maS2O.Insert( NULL, 0 );
maO2S.Insert( 0, (sal_uInt32) 0 ); // value, pos
- nCount = pSrcS2O->Count();
+ nCount = rSrcS2O.Count();
for ( i=1; i<nCount; i++ )
{
- maS2O.Insert( new SortListData( (*pSrcS2O)[ i ] ), i );
- maO2S.Insert( pSrcO2S->GetObject( i ), (sal_uInt32) i );
+ maS2O.Insert( new SortListData( rSrcS2O[ i ] ), i );
+ maO2S.Insert( rSrcO2S.GetObject( i ), (sal_uInt32) i );
}
mnLastSort = maS2O.Count();
diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx
index 43c9f45772b7..7e51e7f9caec 100644
--- a/ucb/source/sorter/sortresult.hxx
+++ b/ucb/source/sorter/sortresult.hxx
@@ -167,11 +167,11 @@ public:
SortedResultSet( css::uno::Reference< css::sdbc::XResultSet > aResult );
virtual ~SortedResultSet();
- const SortedEntryList* GetS2OList() const { return &maS2O; }
- const SimpleList* GetO2SList() const { return &maO2S; }
+ const SortedEntryList& GetS2OList() const { return maS2O; }
+ const SimpleList& GetO2SList() const { return maO2S; }
css::uno::Reference < css::sdbc::XResultSet > GetResultSet() const { return mxOriginal; }
SortInfo* GetSortInfo() const { return mpSortInfo; }
- sal_IntPtr GetCount() const { return mnCount; }
+ sal_IntPtr GetCount() const { return mnCount; }
void CopyData( SortedResultSet* pSource );
void Initialize( const css::uno::Sequence < css::ucb::NumberedSortingInfo > &xSortInfo,
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 7ef4f8be8779..f8880b937456 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -615,7 +615,7 @@ boost::shared_ptr<ImplFontOptions> ServerFont::GetFontOptions() const
return mpFontOptions;
}
-const OString* ServerFont::GetFontFileName() const
+const OString& ServerFont::GetFontFileName() const
{
return mpFontInfo->GetFontFileName();
}
diff --git a/vcl/generic/glyphs/gcach_ftyp.hxx b/vcl/generic/glyphs/gcach_ftyp.hxx
index 7babff34e085..b43d47b39397 100644
--- a/vcl/generic/glyphs/gcach_ftyp.hxx
+++ b/vcl/generic/glyphs/gcach_ftyp.hxx
@@ -41,7 +41,7 @@ public:
const unsigned char* GetBuffer() const { return mpFileMap; }
int GetFileSize() const { return mnFileSize; }
- const OString* GetFileName() const { return &maNativeFileName; }
+ const OString& GetFileName() const { return maNativeFileName; }
int GetLangBoost() const { return mnLangBoost; }
private:
@@ -71,7 +71,7 @@ public:
#endif
void ReleaseFaceFT();
- const OString* GetFontFileName() const { return mpFontFile->GetFileName(); }
+ const OString& GetFontFileName() const { return mpFontFile->GetFileName(); }
int GetFaceNum() const { return mnFaceNum; }
int GetSynthetic() const { return mnSynthetic; }
sal_IntPtr GetFontId() const { return mnFontId; }
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index d9347df0a15d..a3b1c4f9ea87 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -167,7 +167,7 @@ public:
ServerFont( const FontSelectPattern&, FtFontInfo* );
virtual ~ServerFont();
- const OString* GetFontFileName() const;
+ const OString& GetFontFileName() const;
bool TestFont() const { return mbFaceOk;}
FT_Face GetFtFace() const;
int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 9f928c9b7937..d9f943fca21f 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -414,7 +414,7 @@ public:
virtual ~ImplListBox();
const ImplEntryList* GetEntryList() const { return maLBWindow.GetEntryList(); }
- ImplListBoxWindow* GetMainWindow() { return &maLBWindow; }
+ ImplListBoxWindow& GetMainWindow() { return maLBWindow; }
virtual void Resize() SAL_OVERRIDE;
virtual const Wallpaper& GetDisplayBackground() const SAL_OVERRIDE;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index ecaca6598f0c..a5d619fc0af5 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -188,7 +188,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
if ( mpFloatWin )
mpFloatWin->SetImplListBox( mpImplLB );
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( true );
+ mpImplLB->GetMainWindow().AllowGrabFocus( true );
ImplCalcEditHeight();
@@ -249,7 +249,7 @@ IMPL_LINK_NOARG(ComboBox, ImplClickBtnHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
return 0;
}
@@ -270,7 +270,7 @@ IMPL_LINK_NOARG(ComboBox, ImplPopupModeEndHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
mpBtn->SetPressed( false );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
@@ -578,20 +578,20 @@ void ComboBox::FillLayoutData() const
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
AppendLayoutData( *mpSubEdit );
mpSubEdit->SetLayoutDataParent( this );
- Control* pMainWindow = mpImplLB->GetMainWindow();
+ Control& rMainWindow = mpImplLB->GetMainWindow();
if( mpFloatWin )
{
// dropdown mode
if( mpFloatWin->IsReallyVisible() )
{
- AppendLayoutData( *pMainWindow );
- pMainWindow->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWindow );
+ rMainWindow.SetLayoutDataParent( this );
}
}
else
{
- AppendLayoutData( *pMainWindow );
- pMainWindow->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWindow );
+ rMainWindow.SetLayoutDataParent( this );
}
}
@@ -644,7 +644,7 @@ void ComboBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
+ mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
}
else if( nType == STATE_CHANGE_MIRRORING )
{
@@ -762,7 +762,7 @@ bool ComboBox::Notify( NotifyEvent& rNEvt )
nDone = false; // don't eat this event, let the default handling happen (i.e. scroll the context)
}
}
- else if( ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) && ( rNEvt.GetWindow() == mpImplLB->GetMainWindow() ) )
+ else if( ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) && ( rNEvt.GetWindow() == &mpImplLB->GetMainWindow() ) )
{
mpSubEdit->GrabFocus();
}
@@ -1107,7 +1107,7 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
long nCharWidth = GetTextWidth(OUString(static_cast<sal_Unicode>('x')));
if ( !IsDropDownBox() )
{
- Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
+ Size aOutSz = mpImplLB->GetMainWindow().GetOutputSizePixel();
rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
rnLines = (sal_uInt16)(aOutSz.Height()/mpImplLB->GetEntryHeight());
}
@@ -1121,11 +1121,11 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( true, true, true );
+ mpImplLB->GetMainWindow().ImplInitSettings( true, true, true );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
- Font aFont = mpImplLB->GetMainWindow()->GetDrawPixelFont( pDev );
+ Font aFont = mpImplLB->GetMainWindow().GetDrawPixelFont( pDev );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -1235,18 +1235,18 @@ void ComboBox::UserDraw( const UserDrawEvent& )
void ComboBox::SetUserItemSize( const Size& rSz )
{
- mpImplLB->GetMainWindow()->SetUserItemSize( rSz );
+ mpImplLB->GetMainWindow().SetUserItemSize( rSz );
}
void ComboBox::EnableUserDraw( bool bUserDraw )
{
- mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
+ mpImplLB->GetMainWindow().EnableUserDraw( bUserDraw );
}
void ComboBox::DrawEntry( const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos )
{
- DBG_ASSERT( rEvt.GetDevice() == mpImplLB->GetMainWindow(), "DrawEntry?!" );
- mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
+ DBG_ASSERT( rEvt.GetDevice() == &mpImplLB->GetMainWindow(), "DrawEntry?!" );
+ mpImplLB->GetMainWindow().DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
}
void ComboBox::SetSeparatorPos( sal_Int32 n )
@@ -1357,8 +1357,8 @@ void ComboBox::SetNoSelection()
Rectangle ComboBox::GetBoundingRectangle( sal_Int32 nItem ) const
{
- Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
- Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
+ Rectangle aRect = mpImplLB->GetMainWindow().GetBoundingRectangle( nItem );
+ Rectangle aOffset = mpImplLB->GetMainWindow().GetWindowExtentsRelative( (Window*)this );
aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
return aRect;
}
@@ -1384,16 +1384,16 @@ long ComboBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const
{
// point must be either in main list window
// or in impl window (dropdown case)
- ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
+ ImplListBoxWindow& rMain = mpImplLB->GetMainWindow();
// convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
- aConvPoint = pMain->PixelToLogic( aConvPoint );
+ aConvPoint = rMain.AbsoluteScreenToOutputPixel( aConvPoint );
+ aConvPoint = rMain.PixelToLogic( aConvPoint );
// try to find entry
- sal_Int32 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_Int32 nEntry = rMain.GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
nIndex = -1;
else
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 2769e905423b..194c7c3556ce 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2952,13 +2952,13 @@ void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth,
// this the presence of the vertical Scrollbar has to be known.
mpImplLB->SetSizePixel( GetOutputSizePixel() );
((Window*)mpImplLB)->Resize();
- ((Window*)mpImplLB->GetMainWindow())->Resize();
+ ((Window&)mpImplLB->GetMainWindow()).Resize();
}
}
void ImplListBoxFloatingWindow::Resize()
{
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
FloatingWindow::Resize();
}
@@ -3077,12 +3077,12 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking )
mpImplLB->ShowProminentEntry( nPos );
if( bStartTracking )
- mpImplLB->GetMainWindow()->EnableMouseMoveSelect( true );
+ mpImplLB->GetMainWindow().EnableMouseMoveSelect( true );
- if ( mpImplLB->GetMainWindow()->IsGrabFocusAllowed() )
- mpImplLB->GetMainWindow()->GrabFocus();
+ if ( mpImplLB->GetMainWindow().IsGrabFocusAllowed() )
+ mpImplLB->GetMainWindow().GrabFocus();
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
}
}
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 27e5d5e00feb..cdb711917a53 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -39,7 +39,7 @@
void ListBox::EnableQuickSelection( const bool& b )
{
- mpImplLB->GetMainWindow()->EnableQuickSelection(b);
+ mpImplLB->GetMainWindow().EnableQuickSelection(b);
}
ListBox::ListBox(WindowType nType)
@@ -173,7 +173,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetSelectionChangedHdl( LINK( this, ListBox, ImplSelectionChangedHdl ) );
}
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( true );
+ mpImplLB->GetMainWindow().AllowGrabFocus( true );
SetCompoundControl( true );
}
@@ -311,7 +311,7 @@ IMPL_LINK_NOARG(ListBox, ImplClickBtnHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
}
@@ -343,7 +343,7 @@ IMPL_LINK_NOARG(ListBox, ImplPopupModeEndHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
@@ -371,11 +371,11 @@ void ListBox::ToggleDropDown()
void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( true, true, true );
+ mpImplLB->GetMainWindow().ImplInitSettings( true, true, true );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
- Font aFont = mpImplLB->GetMainWindow()->GetDrawPixelFont( pDev );
+ Font aFont = mpImplLB->GetMainWindow().GetDrawPixelFont( pDev );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -693,7 +693,7 @@ void ListBox::Resize()
void ListBox::FillLayoutData() const
{
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
- const Control* pMainWin = mpImplLB->GetMainWindow();
+ const Control& rMainWin = mpImplLB->GetMainWindow();
if( mpFloatWin )
{
// Dropdown mode
@@ -701,14 +701,14 @@ void ListBox::FillLayoutData() const
mpImplWin->SetLayoutDataParent( this );
if( mpFloatWin->IsReallyVisible() )
{
- AppendLayoutData( *pMainWin );
- pMainWin->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWin );
+ rMainWin.SetLayoutDataParent( this );
}
}
else
{
- AppendLayoutData( *pMainWin );
- pMainWin->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWin );
+ rMainWin.SetLayoutDataParent( this );
}
}
@@ -723,16 +723,16 @@ long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const
{
// Point must be either in main list window
// or in impl window (dropdown case)
- ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
+ ImplListBoxWindow& rMain = mpImplLB->GetMainWindow();
// Convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
- aConvPoint = pMain->PixelToLogic( aConvPoint );
+ aConvPoint = rMain.AbsoluteScreenToOutputPixel( aConvPoint );
+ aConvPoint = rMain.PixelToLogic( aConvPoint );
// Try to find entry
- sal_Int32 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_Int32 nEntry = rMain.GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
{
// Not found, maybe dropdown case
@@ -805,7 +805,7 @@ void ListBox::StateChanged( StateChangedType nType )
if ( mpImplWin )
{
mpImplWin->SetZoom( GetZoom() );
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
Resize();
@@ -816,7 +816,7 @@ void ListBox::StateChanged( StateChangedType nType )
if ( mpImplWin )
{
mpImplWin->SetControlFont( GetControlFont() );
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
Resize();
@@ -828,7 +828,7 @@ void ListBox::StateChanged( StateChangedType nType )
{
mpImplWin->SetControlForeground( GetControlForeground() );
mpImplWin->SetTextColor( GetControlForeground() );
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
}
@@ -845,17 +845,17 @@ void ListBox::StateChanged( StateChangedType nType )
}
else
{
- mpImplWin->SetBackground( mpImplLB->GetMainWindow()->GetControlBackground() );
- mpImplWin->SetControlBackground( mpImplLB->GetMainWindow()->GetControlBackground() );
+ mpImplWin->SetBackground( mpImplLB->GetMainWindow().GetControlBackground() );
+ mpImplWin->SetControlBackground( mpImplLB->GetMainWindow().GetControlBackground() );
}
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
}
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
+ mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? true : false;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
}
@@ -1159,8 +1159,8 @@ bool ListBox::IsInDropDown() const
Rectangle ListBox::GetBoundingRectangle( sal_Int32 nItem ) const
{
- Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
- Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
+ Rectangle aRect = mpImplLB->GetMainWindow().GetBoundingRectangle( nItem );
+ Rectangle aOffset = mpImplLB->GetMainWindow().GetWindowExtentsRelative( (Window*)this );
aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
return aRect;
}
@@ -1182,7 +1182,7 @@ void ListBox::EnableMultiSelection( bool bMulti, bool bStackSelection )
// In a MultiSelection, we can't see us travelling without focus
if ( mpFloatWin )
- mpImplLB->GetMainWindow()->AllowGrabFocus( bMulti );
+ mpImplLB->GetMainWindow().AllowGrabFocus( bMulti );
}
bool ListBox::IsMultiSelectionEnabled() const
@@ -1350,7 +1350,7 @@ void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
float nCharWidth = approximate_char_width();
if ( !IsDropDownBox() )
{
- Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
+ Size aOutSz = mpImplLB->GetMainWindow().GetOutputSizePixel();
rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
rnLines = (sal_uInt16) (aOutSz.Height()/mpImplLB->GetEntryHeight());
}
@@ -1374,22 +1374,22 @@ void ListBox::UserDraw( const UserDrawEvent& )
void ListBox::DrawEntry( const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos )
{
- if ( rEvt.GetDevice() == mpImplLB->GetMainWindow() )
- mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
+ if ( rEvt.GetDevice() == &mpImplLB->GetMainWindow() )
+ mpImplLB->GetMainWindow().DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
else if ( rEvt.GetDevice() == mpImplWin )
mpImplWin->DrawEntry( bDrawImage, bDrawText, bDrawTextAtImagePos );
}
void ListBox::SetUserItemSize( const Size& rSz )
{
- mpImplLB->GetMainWindow()->SetUserItemSize( rSz );
+ mpImplLB->GetMainWindow().SetUserItemSize( rSz );
if ( mpImplWin )
mpImplWin->SetUserItemSize( rSz );
}
void ListBox::EnableUserDraw( bool bUserDraw )
{
- mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
+ mpImplLB->GetMainWindow().EnableUserDraw( bUserDraw );
if ( mpImplWin )
mpImplWin->EnableUserDraw( bUserDraw );
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 3ee986b70247..9628eec29ba4 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2211,7 +2211,7 @@ private:
public:
enum {PDF_FONT_MAGIC = 0xBDFF0A1C };
ImplPdfBuiltinFontData( const PDFWriterImpl::BuiltinFont& );
- const PDFWriterImpl::BuiltinFont* GetBuiltinFont() const { return &mrBuiltin; }
+ const PDFWriterImpl::BuiltinFont& GetBuiltinFont() const { return mrBuiltin; }
virtual PhysicalFontFace* Clone() const SAL_OVERRIDE { return new ImplPdfBuiltinFontData(*this); }
virtual ImplFontEntry* CreateFontInstance( FontSelectPattern& ) const SAL_OVERRIDE;
@@ -2899,7 +2899,7 @@ sal_Int32 PDFWriterImpl::emitBuiltinFont( const PhysicalFontFace* pFont, sal_Int
const ImplPdfBuiltinFontData* pFD = GetPdfFontData( pFont );
if( !pFD )
return 0;
- const BuiltinFont* pBuiltinFont = pFD->GetBuiltinFont();
+ const BuiltinFont& rBuiltinFont = pFD->GetBuiltinFont();
OStringBuffer aLine( 1024 );
@@ -2909,9 +2909,9 @@ sal_Int32 PDFWriterImpl::emitBuiltinFont( const PhysicalFontFace* pFont, sal_Int
aLine.append( nFontObject );
aLine.append( " 0 obj\n"
"<</Type/Font/Subtype/Type1/BaseFont/" );
- appendName( pBuiltinFont->m_pPSName, aLine );
+ appendName( rBuiltinFont.m_pPSName, aLine );
aLine.append( "\n" );
- if( pBuiltinFont->m_eCharSet == RTL_TEXTENCODING_MS_1252 )
+ if( rBuiltinFont.m_eCharSet == RTL_TEXTENCODING_MS_1252 )
aLine.append( "/Encoding/WinAnsiEncoding\n" );
aLine.append( ">>\nendobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 60563f974315..a107eeb83c0f 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1682,7 +1682,7 @@ struct BitStreamState
{
}
- const sal_uInt8* getByte() const { return &mnBuffer; }
+ const sal_uInt8& getByte() const { return mnBuffer; }
void flush() { mnNextBitPos = 8; mnBuffer = 0; }
};
@@ -1692,7 +1692,7 @@ void PDFWriterImpl::putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStre
{
io_rState.mnBuffer |= static_cast<sal_uInt8>( i_nCode >> (i_nLength - io_rState.mnNextBitPos) );
i_nLength -= io_rState.mnNextBitPos;
- writeBuffer( io_rState.getByte(), 1 );
+ writeBuffer( &io_rState.getByte(), 1 );
io_rState.flush();
}
OSL_ASSERT( i_nLength < 9 );
@@ -1701,7 +1701,7 @@ void PDFWriterImpl::putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStre
io_rState.mnNextBitPos -= i_nLength;
if( io_rState.mnNextBitPos == 0 )
{
- writeBuffer( io_rState.getByte(), 1 );
+ writeBuffer( &io_rState.getByte(), 1 );
io_rState.flush();
}
}
@@ -2033,7 +2033,7 @@ void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap )
putG4Bits( 12, 1, aBitState );
if( aBitState.mnNextBitPos != 8 )
{
- writeBuffer( aBitState.getByte(), 1 );
+ writeBuffer( &aBitState.getByte(), 1 );
aBitState.flush();
}
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index 7f160668d16d..cfe6e6af1fc4 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -15,7 +15,7 @@ class OpenGLWindowImpl
{
public:
OpenGLWindowImpl(Window* pWindow);
- OpenGLContext* getContext() { return &maContext;}
+ OpenGLContext& getContext() { return maContext;}
private:
OpenGLContext maContext;
boost::scoped_ptr<SystemChildWindow> mpChildWindow;
@@ -43,7 +43,7 @@ OpenGLWindow::~OpenGLWindow()
mpRenderer->contextDestroyed();
}
-OpenGLContext* OpenGLWindow::getContext()
+OpenGLContext& OpenGLWindow::getContext()
{
return mpImpl->getContext();
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 108fe8ea53f1..f02a6951092e 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -183,8 +183,8 @@ namespace
};
BoundFrames()
{};
- const TextContentSet* GetPageBoundContents() const
- { return &m_vPageBounds; };
+ const TextContentSet& GetPageBoundContents() const
+ { return m_vPageBounds; };
const TextContentSet* GetFrameBoundContents(const Reference<XTextFrame>& rParentFrame) const
{
framebound_map_t::const_iterator it = m_vFrameBoundsOf.find(rParentFrame);
@@ -1387,24 +1387,24 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaDefaultExtPropMappe
void XMLTextParagraphExport::exportPageFrames( bool bAutoStyles,
bool bIsProgress )
{
- const TextContentSet* const pTexts = pBoundFrameSets->GetTexts()->GetPageBoundContents();
- const TextContentSet* const pGraphics = pBoundFrameSets->GetGraphics()->GetPageBoundContents();
- const TextContentSet* const pEmbeddeds = pBoundFrameSets->GetEmbeddeds()->GetPageBoundContents();
- const TextContentSet* const pShapes = pBoundFrameSets->GetShapes()->GetPageBoundContents();
- for(TextContentSet::const_iterator_t it = pTexts->getBegin();
- it != pTexts->getEnd();
+ const TextContentSet& rTexts = pBoundFrameSets->GetTexts()->GetPageBoundContents();
+ const TextContentSet& rGraphics = pBoundFrameSets->GetGraphics()->GetPageBoundContents();
+ const TextContentSet& rEmbeddeds = pBoundFrameSets->GetEmbeddeds()->GetPageBoundContents();
+ const TextContentSet& rShapes = pBoundFrameSets->GetShapes()->GetPageBoundContents();
+ for(TextContentSet::const_iterator_t it = rTexts.getBegin();
+ it != rTexts.getEnd();
++it)
exportTextFrame(*it, bAutoStyles, bIsProgress, true);
- for(TextContentSet::const_iterator_t it = pGraphics->getBegin();
- it != pGraphics->getEnd();
+ for(TextContentSet::const_iterator_t it = rGraphics.getBegin();
+ it != rGraphics.getEnd();
++it)
exportTextGraphic(*it, bAutoStyles);
- for(TextContentSet::const_iterator_t it = pEmbeddeds->getBegin();
- it != pEmbeddeds->getEnd();
+ for(TextContentSet::const_iterator_t it = rEmbeddeds.getBegin();
+ it != rEmbeddeds.getEnd();
++it)
exportTextEmbedded(*it, bAutoStyles);
- for(TextContentSet::const_iterator_t it = pShapes->getBegin();
- it != pShapes->getEnd();
+ for(TextContentSet::const_iterator_t it = rShapes.getBegin();
+ it != rShapes.getEnd();
++it)
exportShape(*it, bAutoStyles);
}
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index ec9d7b46f8f4..0d097ac36be1 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -366,8 +366,8 @@ protected:
css::uno::Reference< css::xml::input::XElement > getStyle(
css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
public:
- ::std::vector<css::uno::Reference< css::xml::input::XElement> > *getEvents()
- { return &_events; }
+ ::std::vector<css::uno::Reference< css::xml::input::XElement> >& getEvents()
+ { return _events; }
ControlElement(
OUString const & rLocalName,
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index d7e563448c4f..cabfb297d687 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1184,12 +1184,12 @@ void TitledBoxElement::endElement()
}
xControlModel->setPropertyValue( "State", makeAny( nVal ) );
ctx.importDataAwareProperty( "linked-cell" , xAttributes );
- ::std::vector< Reference< xml::input::XElement > > * radioEvents =
+ ::std::vector< Reference< xml::input::XElement > > & radioEvents =
static_cast< RadioElement * >( xRadio.get() )->getEvents();
- ctx.importEvents( *radioEvents );
+ ctx.importEvents( radioEvents );
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
- radioEvents->clear();
+ radioEvents.clear();
}
// avoid ring-reference:
// vector< radio elements > holding radio elements holding this (via _pParent)
@@ -1280,12 +1280,12 @@ void RadioGroupElement::endElement()
ctx.importDataAwareProperty( "linked-cell", xAttributes );
- ::std::vector< Reference< xml::input::XElement > > * radioEvents =
+ ::std::vector< Reference< xml::input::XElement > > & radioEvents =
static_cast< RadioElement * >( xRadio.get() )->getEvents();
- ctx.importEvents( *radioEvents );
+ ctx.importEvents( radioEvents );
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
- radioEvents->clear();
+ radioEvents.clear();
}
// avoid ring-reference:
// vector< radio elements > holding radio elements holding this (via _pParent)