summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);