[Libreoffice-commits] core.git: 50 commits - basctl/source basic/source bridges/source canvas/source codemaker/source compilerplugins/clang connectivity/source cui/source dbaccess/source drawinglayer/source editeng/source extensions/source filter/source forms/source hwpfilter/source i18npool/source idlc/source idl/source include/basic include/editeng include/filter include/svtools include/svx include/vcl jvmfwk/source l10ntools/source lingucomponent/source oox/source package/source pyuno/source registry/source reportdesign/source rsc/source sal/osl sal/qa sal/rtl scaddins/source sc/qa sc/source sdext/source sd/source sfx2/source shell/source sot/source starmath/inc starmath/source stoc/source svl/source svl/unx svtools/source svx/source sw/inc sw/source toolkit/source tools/source ucb/source unotools/source unoxml/source vcl/generic vcl/opengl vcl/source vcl/unx xmlhelp/source xmloff/source xmlsecurity/source
Stephan Bergmann
sbergman at redhat.com
Thu Mar 26 07:34:53 PDT 2015
basctl/source/basicide/basides1.cxx | 4
basic/source/basmgr/basmgr.cxx | 4
basic/source/comp/codegen.cxx | 2
basic/source/comp/exprnode.cxx | 2
basic/source/comp/scanner.cxx | 2
basic/source/inc/runtime.hxx | 2
basic/source/sbx/sbxobj.cxx | 2
basic/source/sbx/sbxscan.cxx | 2
basic/source/sbx/sbxstr.cxx | 2
basic/source/sbx/sbxvalue.cxx | 16
basic/source/sbx/sbxvar.cxx | 6
bridges/source/jni_uno/jni_data.cxx | 2
bridges/source/jni_uno/jni_uno2java.cxx | 2
canvas/source/cairo/cairo_textlayout.cxx | 4
codemaker/source/codemaker/global.cxx | 2
compilerplugins/clang/cstylecast.cxx | 22
compilerplugins/clang/redundantcast.cxx | 195
connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx | 2
connectivity/source/drivers/jdbc/Blob.cxx | 2
connectivity/source/drivers/jdbc/PreparedStatement.cxx | 6
connectivity/source/drivers/jdbc/ResultSet.cxx | 2
connectivity/source/drivers/kab/KDEInit.cxx | 2
connectivity/source/drivers/kab/KPreparedStatement.cxx | 2
connectivity/source/drivers/postgresql/pq_preparedstatement.cxx | 2
connectivity/source/drivers/postgresql/pq_tools.cxx | 2
connectivity/source/parse/sqlnode.cxx | 2
cui/source/dialogs/hltpbase.cxx | 2
cui/source/dialogs/iconcdlg.cxx | 6
cui/source/dialogs/linkdlg.cxx | 2
cui/source/inc/iconcdlg.hxx | 2
cui/source/options/cfgchart.cxx | 3
cui/source/tabpages/backgrnd.cxx | 2
cui/source/tabpages/chardlg.cxx | 2
dbaccess/source/filter/xml/xmlHelper.cxx | 8
dbaccess/source/ui/browser/unodatbr.cxx | 2
dbaccess/source/ui/control/RelationControl.cxx | 2
dbaccess/source/ui/control/TableGrantCtrl.cxx | 2
dbaccess/source/ui/tabledesign/TableFieldControl.cxx | 8
drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 2
editeng/source/editeng/editdoc.cxx | 2
editeng/source/editeng/editeng.cxx | 4
editeng/source/editeng/impedit2.cxx | 12
editeng/source/editeng/impedit3.cxx | 2
editeng/source/editeng/impedit5.cxx | 2
editeng/source/items/frmitems.cxx | 4
editeng/source/items/svxfont.cxx | 10
editeng/source/misc/svxacorr.cxx | 2
editeng/source/outliner/outliner.cxx | 2
editeng/source/uno/unoforou.cxx | 8
editeng/source/uno/unoipset.cxx | 4
editeng/source/uno/unotext.cxx | 2
extensions/source/bibliography/bibload.cxx | 4
extensions/source/bibliography/toolbar.cxx | 8
extensions/source/plugin/base/xplugin.cxx | 6
extensions/source/plugin/inc/plugin/unx/plugcon.hxx | 3
extensions/source/plugin/unx/npnapi.cxx | 2
extensions/source/plugin/unx/nppapi.cxx | 4
extensions/source/scanner/sane.cxx | 5
extensions/source/scanner/sane.hxx | 6
filter/source/flash/swfwriter1.cxx | 6
filter/source/graphicfilter/eps/eps.cxx | 2
filter/source/msfilter/eschesdo.cxx | 4
filter/source/msfilter/msdffimp.cxx | 4
filter/source/msfilter/svdfppt.cxx | 18
filter/source/svg/svgwriter.cxx | 8
filter/source/t602/t602filter.cxx | 6
forms/source/component/imgprod.cxx | 4
forms/source/xforms/xpathlib/xpathlib.cxx | 2
hwpfilter/source/mzstring.h | 2
i18npool/source/collator/collatorImpl.cxx | 4
i18npool/source/inputchecker/inputsequencechecker.cxx | 4
i18npool/source/transliteration/transliteration_caseignore.cxx | 4
idl/source/objects/basobj.cxx | 2
idl/source/objects/types.cxx | 4
idlc/source/idlcproduce.cxx | 4
include/basic/sbxvar.hxx | 2
include/editeng/unotext.hxx | 2
include/filter/msfilter/svdfppt.hxx | 2
include/svtools/fmtfield.hxx | 2
include/svtools/treelist.hxx | 12
include/svx/svdedtv.hxx | 2
include/svx/svdlayer.hxx | 2
include/svx/svdoedge.hxx | 2
include/svx/svdtrans.hxx | 2
include/vcl/window.hxx | 2
jvmfwk/source/framework.cxx | 4
l10ntools/source/xrmmerge.cxx | 2
lingucomponent/source/spellcheck/spell/sspellimp.cxx | 4
oox/source/drawingml/table/tableproperties.cxx | 2
package/source/zipapi/ZipFile.cxx | 4
pyuno/source/loader/pyuno_loader.cxx | 4
pyuno/source/module/pyuno.cxx | 2
pyuno/source/module/pyuno_adapter.cxx | 8
pyuno/source/module/pyuno_type.cxx | 4
pyuno/source/module/pyuno_util.cxx | 2
registry/source/reflread.cxx | 2
registry/source/reflwrit.cxx | 8
reportdesign/source/filter/xml/xmlHelper.cxx | 4
reportdesign/source/filter/xml/xmlStyleImport.cxx | 2
reportdesign/source/ui/dlg/GroupsSorting.cxx | 2
reportdesign/source/ui/report/FixedTextColor.cxx | 2
reportdesign/source/ui/report/FormattedFieldBeautifier.cxx | 2
rsc/source/tools/rscdef.cxx | 2
rsc/source/tools/rsctree.cxx | 10
sal/osl/unx/file.cxx | 2
sal/osl/unx/profile.cxx | 2
sal/osl/unx/tempfile.cxx | 2
sal/qa/rtl/process/rtl_Process.cxx | 2
sal/rtl/strtmpl.cxx | 2
sc/qa/unit/helper/qahelper.cxx | 2
sc/source/core/data/attarray.cxx | 6
sc/source/core/data/column.cxx | 8
sc/source/core/data/conditio.cxx | 2
sc/source/core/data/dpobject.cxx | 2
sc/source/core/data/dptabres.cxx | 2
sc/source/core/data/dptabsrc.cxx | 6
sc/source/core/data/table2.cxx | 2
sc/source/core/data/table4.cxx | 2
sc/source/core/data/validat.cxx | 2
sc/source/core/opencl/formulagroupcl.cxx | 2
sc/source/core/tool/chgtrack.cxx | 22
sc/source/core/tool/rangelst.cxx | 4
sc/source/core/tool/rangeutl.cxx | 6
sc/source/core/tool/token.cxx | 2
sc/source/core/tool/zforauto.cxx | 2
sc/source/filter/excel/excform.cxx | 4
sc/source/filter/rtf/eeimpars.cxx | 2
sc/source/filter/rtf/expbase.cxx | 2
sc/source/filter/xcl97/XclExpChangeTrack.cxx | 2
sc/source/filter/xml/xmlexprt.cxx | 10
sc/source/filter/xml/xmlimprt.cxx | 8
sc/source/filter/xml/xmlstyle.cxx | 2
sc/source/filter/xml/xmlstyli.cxx | 16
sc/source/ui/Accessibility/AccessibleEditObject.cxx | 2
sc/source/ui/docshell/docfunc.cxx | 2
sc/source/ui/docshell/docsh3.cxx | 6
sc/source/ui/docshell/docsh4.cxx | 4
sc/source/ui/miscdlgs/acredlin.cxx | 14
sc/source/ui/undo/refundo.cxx | 4
sc/source/ui/undo/undostyl.cxx | 2
sc/source/ui/unoobj/cellsuno.cxx | 2
sc/source/ui/view/formatsh.cxx | 10
sc/source/ui/view/output2.cxx | 2
sc/source/ui/view/tabvwsh2.cxx | 2
sc/source/ui/view/tabvwsh4.cxx | 6
sc/source/ui/view/tabvwsh8.cxx | 2
sc/source/ui/view/viewdata.cxx | 8
sc/source/ui/view/viewfunc.cxx | 2
scaddins/source/analysis/analysishelper.cxx | 6
sd/source/core/drawdoc.cxx | 4
sd/source/core/sdpage.cxx | 2
sd/source/core/sdpage2.cxx | 4
sd/source/filter/html/htmlex.cxx | 2
sd/source/filter/ppt/pptin.cxx | 6
sd/source/ui/app/optsitem.cxx | 2
sd/source/ui/app/sdxfer.cxx | 2
sd/source/ui/dlg/custsdlg.cxx | 2
sd/source/ui/dlg/inspagob.cxx | 2
sd/source/ui/dlg/navigatr.cxx | 4
sd/source/ui/dlg/sdtreelb.cxx | 4
sd/source/ui/docshell/docshell.cxx | 2
sd/source/ui/func/futhes.cxx | 2
sd/source/ui/inc/sdxfer.hxx | 2
sd/source/ui/slideshow/slideshowimpl.cxx | 2
sd/source/ui/view/drtxtob1.cxx | 2
sd/source/ui/view/drviewsc.cxx | 2
sd/source/ui/view/sdview2.cxx | 4
sd/source/ui/view/sdview3.cxx | 8
sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 2
sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | 2
sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx | 2
sfx2/source/appl/appserv.cxx | 4
sfx2/source/appl/fileobj.cxx | 2
sfx2/source/bastyp/fltfnc.cxx | 2
sfx2/source/bastyp/sfxhtml.cxx | 4
sfx2/source/control/msg.cxx | 2
sfx2/source/control/objface.cxx | 2
sfx2/source/control/request.cxx | 2
sfx2/source/dialog/tabdlg.cxx | 4
sfx2/source/doc/docfile.cxx | 2
sfx2/source/doc/objcont.cxx | 6
sfx2/source/doc/objembed.cxx | 2
sfx2/source/doc/objmisc.cxx | 2
shell/source/all/xml_parser.cxx | 2
sot/source/sdstor/stg.cxx | 10
sot/source/sdstor/storage.cxx | 6
starmath/inc/dialog.hxx | 2
starmath/inc/format.hxx | 2
starmath/inc/node.hxx | 4
starmath/inc/symbol.hxx | 2
starmath/source/rect.cxx | 2
starmath/source/smmod.cxx | 6
stoc/source/inspect/introspection.cxx | 4
stoc/source/javavm/javavm.cxx | 2
svl/source/items/itemset.cxx | 8
svl/source/items/poolcach.cxx | 2
svl/source/numbers/zforlist.cxx | 4
svl/source/numbers/zforscan.cxx | 12
svl/unx/source/svdde/ddedummy.cxx | 2
svtools/source/brwbox/brwbox1.cxx | 2
svtools/source/brwbox/editbrowsebox.cxx | 2
svtools/source/contnr/imivctl1.cxx | 14
svtools/source/contnr/ivctrl.cxx | 6
svtools/source/contnr/simptabl.cxx | 4
svtools/source/contnr/svimpbox.cxx | 4
svtools/source/contnr/treelist.cxx | 4
svtools/source/contnr/treelistbox.cxx | 2
svtools/source/control/calendar.cxx | 8
svtools/source/control/ctrltool.cxx | 18
svtools/source/control/fmtfield.cxx | 4
svtools/source/control/tabbar.cxx | 2
svtools/source/graphic/descriptor.cxx | 2
svtools/source/graphic/grfcache.cxx | 10
svtools/source/graphic/grfmgr.cxx | 2
svtools/source/graphic/grfmgr2.cxx | 2
svtools/source/misc/embedtransfer.cxx | 2
svx/source/core/graphichelper.cxx | 2
svx/source/customshapes/EnhancedCustomShape2d.cxx | 2
svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 2018 +++++-----
svx/source/dialog/framelink.cxx | 4
svx/source/dialog/hdft.cxx | 2
svx/source/dialog/srchdlg.cxx | 2
svx/source/engine3d/scene3d.cxx | 4
svx/source/engine3d/view3d.cxx | 4
svx/source/fmcomp/fmgridcl.cxx | 2
svx/source/fmcomp/gridctrl.cxx | 2
svx/source/form/fmshell.cxx | 2
svx/source/form/fmundo.cxx | 4
svx/source/gallery2/galbrws1.cxx | 2
svx/source/gallery2/gallery1.cxx | 2
svx/source/gallery2/galtheme.cxx | 2
svx/source/items/numfmtsh.cxx | 6
svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 2
svx/source/sdr/overlay/overlaymanagerbuffered.cxx | 6
svx/source/sdr/properties/attributeproperties.cxx | 2
svx/source/sdr/properties/defaultproperties.cxx | 4
svx/source/sdr/properties/emptyproperties.cxx | 2
svx/source/sdr/properties/pageproperties.cxx | 2
svx/source/svdraw/svdedxv.cxx | 2
svx/source/svdraw/svdglev.cxx | 8
svx/source/svdraw/svdlayer.cxx | 2
svx/source/svdraw/svdmark.cxx | 12
svx/source/svdraw/svdmodel.cxx | 2
svx/source/svdraw/svdmrkv.cxx | 6
svx/source/svdraw/svdmrkv1.cxx | 16
svx/source/svdraw/svdoattr.cxx | 4
svx/source/svdraw/svdobj.cxx | 2
svx/source/svdraw/svdoedge.cxx | 12
svx/source/svdraw/svdograf.cxx | 2
svx/source/svdraw/svdomeas.cxx | 16
svx/source/svdraw/svdopath.cxx | 14
svx/source/svdraw/svdorect.cxx | 2
svx/source/svdraw/svdotext.cxx | 4
svx/source/svdraw/svdovirt.cxx | 18
svx/source/svdraw/svdpage.cxx | 8
svx/source/svdraw/svdpntv.cxx | 10
svx/source/svdraw/svdview.cxx | 4
svx/source/toolbars/extrusionbar.cxx | 2
svx/source/toolbars/fontworkbar.cxx | 4
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 4
svx/source/unodraw/unopage.cxx | 2
svx/source/unodraw/unoshtxt.cxx | 16
svx/source/xoutdev/xattrbmp.cxx | 2
svx/source/xoutdev/xtable.cxx | 12
sw/inc/cellatr.hxx | 4
sw/inc/dcontact.hxx | 2
sw/inc/doc.hxx | 4
sw/inc/docsh.hxx | 2
sw/inc/editsh.hxx | 4
sw/inc/fldbas.hxx | 4
sw/inc/fmtpdsc.hxx | 2
sw/inc/frmfmt.hxx | 6
sw/inc/node.hxx | 6
sw/inc/pagedesc.hxx | 2
sw/inc/paratr.hxx | 2
sw/inc/swddetbl.hxx | 2
sw/inc/swtable.hxx | 2
sw/inc/viewsh.hxx | 4
sw/source/core/access/accpara.cxx | 4
sw/source/core/attr/format.cxx | 6
sw/source/core/crsr/crstrvl.cxx | 4
sw/source/core/crsr/findcoll.cxx | 2
sw/source/core/crsr/pam.cxx | 2
sw/source/core/crsr/swcrsr.cxx | 4
sw/source/core/crsr/trvlcol.cxx | 4
sw/source/core/crsr/viscrs.cxx | 2
sw/source/core/doc/DocumentContentOperationsManager.cxx | 2
sw/source/core/doc/DocumentFieldsManager.cxx | 10
sw/source/core/doc/DocumentLayoutManager.cxx | 2
sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 6
sw/source/core/doc/docbasic.cxx | 4
sw/source/core/doc/doccomp.cxx | 2
sw/source/core/doc/docdesc.cxx | 4
sw/source/core/doc/docedt.cxx | 4
sw/source/core/doc/docfmt.cxx | 4
sw/source/core/doc/docglbl.cxx | 2
sw/source/core/doc/docglos.cxx | 4
sw/source/core/doc/doclay.cxx | 6
sw/source/core/doc/docnum.cxx | 4
sw/source/core/doc/docsort.cxx | 2
sw/source/core/doc/doctxm.cxx | 8
sw/source/core/doc/fmtcol.cxx | 2
sw/source/core/doc/ftnidx.cxx | 2
sw/source/core/doc/gctable.cxx | 6
sw/source/core/doc/htmltbl.cxx | 4
sw/source/core/doc/notxtfrm.cxx | 4
sw/source/core/doc/number.cxx | 2
sw/source/core/doc/tblafmt.cxx | 2
sw/source/core/doc/tblcpy.cxx | 6
sw/source/core/doc/tblrwcl.cxx | 26
sw/source/core/docnode/ndcopy.cxx | 2
sw/source/core/docnode/ndnotxt.cxx | 4
sw/source/core/docnode/ndnum.cxx | 2
sw/source/core/docnode/ndsect.cxx | 6
sw/source/core/docnode/ndtbl.cxx | 30
sw/source/core/docnode/ndtbl1.cxx | 18
sw/source/core/docnode/node.cxx | 8
sw/source/core/docnode/section.cxx | 12
sw/source/core/draw/dcontact.cxx | 4
sw/source/core/edit/edfld.cxx | 2
sw/source/core/edit/edglbldc.cxx | 2
sw/source/core/edit/edglss.cxx | 4
sw/source/core/edit/editsh.cxx | 4
sw/source/core/edit/edlingu.cxx | 4
sw/source/core/edit/ednumber.cxx | 2
sw/source/core/edit/edsect.cxx | 2
sw/source/core/edit/edtab.cxx | 12
sw/source/core/fields/authfld.cxx | 2
sw/source/core/fields/cellfml.cxx | 32
sw/source/core/fields/chpfld.cxx | 4
sw/source/core/fields/docufld.cxx | 2
sw/source/core/fields/expfld.cxx | 4
sw/source/core/fields/fldlst.cxx | 2
sw/source/core/fields/reffld.cxx | 8
sw/source/core/fields/tblcalc.cxx | 2
sw/source/core/frmedt/fefly1.cxx | 10
sw/source/core/frmedt/feshview.cxx | 6
sw/source/core/frmedt/fetab.cxx | 4
sw/source/core/frmedt/fews.cxx | 6
sw/source/core/frmedt/tblsel.cxx | 14
sw/source/core/graphic/ndgrf.cxx | 2
sw/source/core/inc/cntfrm.hxx | 4
sw/source/core/inc/frame.hxx | 4
sw/source/core/inc/layfrm.hxx | 6
sw/source/core/inc/txtfrm.hxx | 2
sw/source/core/layout/atrfrm.cxx | 12
sw/source/core/layout/calcmove.cxx | 2
sw/source/core/layout/flowfrm.cxx | 2
sw/source/core/layout/fly.cxx | 4
sw/source/core/layout/flycnt.cxx | 6
sw/source/core/layout/flylay.cxx | 4
sw/source/core/layout/flypos.cxx | 2
sw/source/core/layout/frmtool.cxx | 4
sw/source/core/layout/ftnfrm.cxx | 8
sw/source/core/layout/hffrm.cxx | 8
sw/source/core/layout/layact.cxx | 2
sw/source/core/layout/newfrm.cxx | 4
sw/source/core/layout/pagechg.cxx | 10
sw/source/core/layout/pagedesc.cxx | 2
sw/source/core/layout/paintfrm.cxx | 16
sw/source/core/layout/sectfrm.cxx | 4
sw/source/core/layout/ssfrm.cxx | 2
sw/source/core/layout/tabfrm.cxx | 16
sw/source/core/layout/trvlfrm.cxx | 20
sw/source/core/layout/wsfrm.cxx | 10
sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx | 4
sw/source/core/ole/ndole.cxx | 6
sw/source/core/table/swtable.cxx | 4
sw/source/core/text/EnhancedPDFExportHelper.cxx | 4
sw/source/core/text/atrstck.cxx | 2
sw/source/core/text/blink.cxx | 4
sw/source/core/text/frmcrsr.cxx | 62
sw/source/core/text/frmform.cxx | 4
sw/source/core/text/frminf.cxx | 30
sw/source/core/text/frmpaint.cxx | 24
sw/source/core/text/inftxt.cxx | 32
sw/source/core/text/inftxt.hxx | 2
sw/source/core/text/itratr.cxx | 16
sw/source/core/text/itrcrsr.cxx | 2
sw/source/core/text/itrform2.cxx | 8
sw/source/core/text/itrtxt.cxx | 6
sw/source/core/text/porfld.cxx | 18
sw/source/core/text/porlay.cxx | 2
sw/source/core/text/porlin.cxx | 4
sw/source/core/text/porref.cxx | 2
sw/source/core/text/porrst.cxx | 4
sw/source/core/text/portox.cxx | 2
sw/source/core/text/txtcache.cxx | 2
sw/source/core/text/txtdrop.cxx | 2
sw/source/core/text/txtfld.cxx | 2
sw/source/core/text/txtftn.cxx | 4
sw/source/core/tox/ToxTextGenerator.cxx | 2
sw/source/core/tox/tox.cxx | 8
sw/source/core/txtnode/atrfld.cxx | 4
sw/source/core/txtnode/atrflyin.cxx | 4
sw/source/core/txtnode/fntcache.cxx | 2
sw/source/core/txtnode/fntcap.cxx | 2
sw/source/core/txtnode/ndtxt.cxx | 2
sw/source/core/txtnode/txtatr2.cxx | 2
sw/source/core/txtnode/txtedt.cxx | 2
sw/source/core/undo/SwUndoField.cxx | 2
sw/source/core/undo/undobj1.cxx | 2
sw/source/core/undo/untbl.cxx | 8
sw/source/core/unocore/unochart.cxx | 2
sw/source/core/unocore/unomap.cxx | 2
sw/source/core/unocore/unoobj2.cxx | 2
sw/source/core/unocore/unotbl.cxx | 8
sw/source/filter/basflt/shellio.cxx | 6
sw/source/filter/html/htmlnum.hxx | 2
sw/source/filter/html/htmlsect.cxx | 12
sw/source/filter/html/htmltab.cxx | 16
sw/source/filter/ww8/docxattributeoutput.cxx | 38
sw/source/filter/ww8/docxexport.cxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 2
sw/source/filter/ww8/wrtw8nds.cxx | 2
sw/source/filter/ww8/wrtw8num.cxx | 2
sw/source/filter/ww8/wrtww8.cxx | 2
sw/source/filter/ww8/ww8par2.cxx | 10
sw/source/filter/ww8/ww8par5.cxx | 2
sw/source/filter/ww8/ww8par6.cxx | 6
sw/source/filter/xml/xmlfmt.cxx | 2
sw/source/filter/xml/xmltble.cxx | 10
sw/source/filter/xml/xmltexti.cxx | 2
sw/source/ui/envelp/envfmt.cxx | 2
sw/source/ui/vba/vbatablehelper.cxx | 4
sw/source/uibase/app/apphdl.cxx | 2
sw/source/uibase/app/docst.cxx | 6
sw/source/uibase/app/docstyle.cxx | 10
sw/source/uibase/app/swmodul1.cxx | 4
sw/source/uibase/cctrl/popbox.cxx | 2
sw/source/uibase/dbui/dbtree.cxx | 2
sw/source/uibase/dochdl/swdtflvr.cxx | 6
sw/source/uibase/docvw/edtdd.cxx | 6
sw/source/uibase/docvw/edtwin.cxx | 8
sw/source/uibase/index/toxmgr.cxx | 10
sw/source/uibase/misc/redlndlg.cxx | 8
sw/source/uibase/shells/frmsh.cxx | 20
sw/source/uibase/shells/grfsh.cxx | 2
sw/source/uibase/shells/textidx.cxx | 2
sw/source/uibase/shells/textsh1.cxx | 6
sw/source/uibase/uiview/pview.cxx | 4
sw/source/uibase/uiview/viewling.cxx | 4
sw/source/uibase/uiview/viewmdi.cxx | 4
sw/source/uibase/uiview/viewtab.cxx | 10
sw/source/uibase/uno/unomailmerge.cxx | 2
sw/source/uibase/utlui/numfmtlb.cxx | 2
sw/source/uibase/wrtsh/wrtsh1.cxx | 4
sw/source/uibase/wrtsh/wrtsh2.cxx | 8
toolkit/source/awt/vclxprinter.cxx | 2
toolkit/source/controls/unocontrolmodel.cxx | 4
tools/source/generic/config.cxx | 4
tools/source/inet/inetstrm.cxx | 2
tools/source/zcodec/zcodec.cxx | 2
ucb/source/ucp/file/filinl.hxx | 10
ucb/source/ucp/gio/gio_seekable.cxx | 4
ucb/source/ucp/webdav-neon/NeonUri.cxx | 6
unotools/source/i18n/intlwrapper.cxx | 6
unotools/source/i18n/localedatawrapper.cxx | 22
unotools/source/i18n/transliterationwrapper.cxx | 2
unoxml/source/dom/documentbuilder.cxx | 2
vcl/generic/fontmanager/fontconfig.cxx | 2
vcl/generic/glyphs/gcach_ftyp.cxx | 2
vcl/opengl/program.cxx | 4
vcl/opengl/x11/X11DeviceInfo.cxx | 2
vcl/source/app/i18nhelp.cxx | 24
vcl/source/app/settings.cxx | 8
vcl/source/control/field.cxx | 2
vcl/source/control/field2.cxx | 2
vcl/source/control/tabctrl.cxx | 4
vcl/source/edit/texteng.cxx | 4
vcl/source/filter/graphicfilter.cxx | 2
vcl/source/filter/ixbm/xbmread.cxx | 2
vcl/source/filter/jpeg/JpegWriter.cxx | 2
vcl/source/filter/wmf/emfwr.cxx | 20
vcl/source/fontsubset/gsub.cxx | 2
vcl/source/fontsubset/sft.cxx | 12
vcl/source/gdi/animate.cxx | 6
vcl/source/gdi/bitmap.cxx | 22
vcl/source/gdi/bitmapex.cxx | 2
vcl/source/gdi/font.cxx | 2
vcl/source/gdi/gfxlink.cxx | 2
vcl/source/gdi/impgraph.cxx | 6
vcl/source/gdi/jobset.cxx | 2
vcl/source/gdi/pngread.cxx | 2
vcl/source/gdi/region.cxx | 8
vcl/source/gdi/salgdilayout.cxx | 8
vcl/source/gdi/sallayout.cxx | 2
vcl/source/outdev/outdev.cxx | 8
vcl/source/outdev/polygon.cxx | 2
vcl/source/outdev/text.cxx | 2
vcl/source/window/accessibility.cxx | 4
vcl/source/window/builder.cxx | 2
vcl/source/window/clipping.cxx | 4
vcl/source/window/menu.cxx | 2
vcl/source/window/splitwin.cxx | 2
vcl/source/window/stacking.cxx | 10
vcl/source/window/toolbox.cxx | 40
vcl/source/window/toolbox2.cxx | 6
vcl/source/window/window.cxx | 10
vcl/unx/generic/app/saldisp.cxx | 6
vcl/unx/generic/gdi/salbmp.cxx | 2
vcl/unx/generic/gdi/xrender_peer.hxx | 2
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 8
vcl/unx/gtk/window/gloactiongroup.cxx | 4
vcl/unx/gtk/window/gtksalmenu.cxx | 8
xmlhelp/source/treeview/tvread.cxx | 10
xmloff/source/draw/sdxmlexp.cxx | 2
xmloff/source/draw/shapeimport.cxx | 2
xmloff/source/draw/ximpstyl.cxx | 6
xmloff/source/forms/elementimport.cxx | 2
xmloff/source/style/PageMasterPropHdlFactory.cxx | 2
xmloff/source/style/XMLPageExport.cxx | 2
xmloff/source/style/xmlaustp.cxx | 2
xmloff/source/style/xmlnumi.cxx | 6
xmloff/source/style/xmlstyle.cxx | 20
xmlsecurity/source/framework/buffernode.cxx | 52
xmlsecurity/source/framework/elementmark.cxx | 2
xmlsecurity/source/framework/saxeventkeeperimpl.cxx | 16
xmlsecurity/source/xmlsec/nss/ciphercontext.cxx | 4
xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 8
xmlsecurity/source/xmlsec/saxhelper.cxx | 8
xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx | 8
522 files changed, 2559 insertions(+), 2387 deletions(-)
New commits:
commit 1c78277801f377458e8cb1d04fae0578a60c69b7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 26 15:33:04 2015 +0100
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I876736d18db6676629c283fccd65e1b6fb2bb2be
diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index 9775a08..048d2d5 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -53,6 +53,7 @@ private:
static const char * recommendedFix(clang::CastKind ck) {
switch(ck) {
+ case CK_NoOp: return "const_cast";
case CK_IntegralToPointer: return "reinterpret_cast";
case CK_PointerToIntegral: return "reinterpret_cast";
case CK_BaseToDerived: return "static_cast";
@@ -89,7 +90,26 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
return true;
}
if( expr->getCastKind() == CK_NoOp ) {
- return true;
+ QualType t1 = expr->getSubExpr()->getType();
+ QualType t2 = expr->getType();
+ if (t1->isPointerType() && t2->isPointerType()) {
+ t1 = t1->getAs<PointerType>()->getPointeeType();
+ t2 = t2->getAs<PointerType>()->getPointeeType();
+ if (t2->isVoidType()) {
+ return true;
+ }
+ } else if (t1->isLValueReferenceType() && t2->isLValueReferenceType()) {
+ t1 = t1->getAs<LValueReferenceType>()->getPointeeType();
+ t2 = t2->getAs<LValueReferenceType>()->getPointeeType();
+ } else {
+ return true;
+ }
+ if (!t1.isMoreQualifiedThan(t2)
+ || (t1.getUnqualifiedType().getCanonicalType().getTypePtr()
+ != t2.getUnqualifiedType().getCanonicalType().getTypePtr()))
+ {
+ return true;
+ }
}
std::string incompFrom;
std::string incompTo;
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index e2f6179..1f580e5 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -15,11 +15,16 @@
// * A static_cast<T*>(e) where e is of void pointer type and whose result is
// then implicitly cast to a void pointer
//
+// * Various const_casts that are either not needed (like casting away constness
+// in a delete expression) or are implicitly cast back afterwards
+//
// C-style casts are ignored because it makes this plugin simpler, and they
// should eventually be eliminated via loplugin:cstylecast and/or
// -Wold-style-cast. That implies that this plugin is only relevant for C++
// code.
+#include "clang/Sema/Sema.h"
+
#include "plugin.hxx"
namespace {
@@ -42,37 +47,185 @@ public:
}
bool VisitImplicitCastExpr(ImplicitCastExpr const * expr);
+
+ bool VisitCallExpr(CallExpr const * expr);
+
+ bool VisitCXXDeleteExpr(CXXDeleteExpr const * expr);
+
+ bool VisitBinSub(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+ bool VisitBinLT(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+ bool VisitBinGT(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+ bool VisitBinLE(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+ bool VisitBinGE(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+ bool VisitBinEQ(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+ bool VisitBinNE(BinaryOperator const * expr)
+ { return visitBinOp(expr); }
+
+private:
+ bool visitBinOp(BinaryOperator const * expr);
};
bool RedundantCast::VisitImplicitCastExpr(const ImplicitCastExpr * expr) {
- if (ignoreLocation(expr) || expr->getCastKind() != CK_BitCast
- || !isVoidPointer(expr->getType())
- || !expr->getSubExpr()->getType()->isPointerType())
+ if (ignoreLocation(expr)) {
+ return true;
+ }
+ switch (expr->getCastKind()) {
+ case CK_NoOp:
+ if (expr->getType()->isPointerType()
+ || expr->getType()->isObjectType())
+ {
+ auto e = dyn_cast<CXXConstCastExpr>(
+ expr->getSubExpr()->IgnoreParenImpCasts());
+ if (e != nullptr) {
+ auto t1 = e->getSubExpr()->getType().getCanonicalType();
+ auto t2 = expr->getType().getCanonicalType();
+ bool ObjCLifetimeConversion;
+ if (t1.getTypePtr() == t2.getTypePtr()
+ || compiler.getSema().IsQualificationConversion(
+ t1, t2, false, ObjCLifetimeConversion))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ ("redundant const_cast from %0 to %1, result is"
+ " implictly cast to %2"),
+ e->getExprLoc())
+ << e->getSubExprAsWritten()->getType() << e->getType()
+ << expr->getType() << expr->getSourceRange();
+ }
+ }
+ }
+ break;
+ case CK_BitCast:
+ if (isVoidPointer(expr->getType())
+ && expr->getSubExpr()->getType()->isPointerType())
+ {
+ Expr const * e = expr->getSubExpr()->IgnoreParenImpCasts();
+ while (isa<CXXConstCastExpr>(e)) {
+ auto cc = dyn_cast<CXXConstCastExpr>(e);
+if(!cc->getSubExpr()->getType()->isPointerType()){
+ report(DiagnosticsEngine::Warning,"TODO",cc->getExprLoc())<<expr->getSourceRange();
+ return true;
+}
+ if (expr->getType()->getAs<PointerType>()->getPointeeType()
+ .isAtLeastAsQualifiedAs(
+ cc->getSubExpr()->getType()
+ ->getAs<PointerType>()->getPointeeType()))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ ("redundant const_cast from %0 to %1, result is"
+ " ultimately implictly cast to %2"),
+ cc->getExprLoc())
+ << cc->getSubExprAsWritten()->getType() << cc->getType()
+ << expr->getType() << expr->getSourceRange();
+ }
+ e = cc->getSubExpr()->IgnoreParenImpCasts();
+ }
+ if (isa<CXXReinterpretCastExpr>(e)) {
+ report(
+ DiagnosticsEngine::Warning,
+ ("redundant reinterpret_cast, result is implicitly cast to"
+ " void pointer"),
+ e->getExprLoc())
+ << e->getSourceRange();
+ } else if (isa<CXXStaticCastExpr>(e)
+ && isVoidPointer(
+ dyn_cast<CXXStaticCastExpr>(e)->getSubExpr()
+ ->IgnoreParenImpCasts()->getType()))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ ("redundant static_cast from void pointer, result is"
+ " implicitly cast to void pointer"),
+ e->getExprLoc())
+ << e->getSourceRange();
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return true;
+}
+
+bool RedundantCast::VisitCallExpr(CallExpr const * expr) {
+ if (ignoreLocation(expr)) {
+ return true;
+ }
+ auto f = expr->getDirectCallee();
+ if (f == nullptr || !f->isVariadic()
+ || expr->getNumArgs() <= f->getNumParams())
{
return true;
}
- Expr const * e = expr->getSubExpr()->IgnoreParenImpCasts();
- while (isa<CXXConstCastExpr>(e)) {
- e = dyn_cast<CXXConstCastExpr>(e)->getSubExpr()->IgnoreParenImpCasts();
+ for (auto i = f->getNumParams(); i != expr->getNumArgs(); ++i) {
+ auto a = expr->getArg(i);
+ if (a->getType()->isPointerType()) {
+ auto e = dyn_cast<CXXConstCastExpr>(a->IgnoreParenImpCasts());
+ if (e != nullptr) {
+ report(
+ DiagnosticsEngine::Warning,
+ "redundant const_cast of variadic function argument",
+ e->getExprLoc())
+ << expr->getSourceRange();
+ }
+ }
+ }
+ return true;
+}
+
+bool RedundantCast::VisitCXXDeleteExpr(CXXDeleteExpr const * expr) {
+ if (ignoreLocation(expr)) {
+ return true;
}
- if (isa<CXXReinterpretCastExpr>(e)) {
+ auto e = dyn_cast<CXXConstCastExpr>(
+ expr->getArgument()->IgnoreParenImpCasts());
+ if (e != nullptr) {
report(
DiagnosticsEngine::Warning,
- ("redundant reinterpret_cast, result is implicitly cast to void"
- " pointer"),
- e->getExprLoc())
- << e->getSourceRange();
- } else if (isa<CXXStaticCastExpr>(e)
- && isVoidPointer(
- dyn_cast<CXXStaticCastExpr>(e)->getSubExpr()
- ->IgnoreParenImpCasts()->getType()))
+ "redundant const_cast in delete expression", e->getExprLoc())
+ << expr->getSourceRange();
+ }
+ return true;
+}
+
+bool RedundantCast::visitBinOp(BinaryOperator const * expr) {
+ if (ignoreLocation(expr)) {
+ return true;
+ }
+ if (expr->getLHS()->getType()->isPointerType()
+ && expr->getRHS()->getType()->isPointerType())
{
- report(
- DiagnosticsEngine::Warning,
- ("redundant static_cast from void pointer, result is implicitly"
- " cast to void pointer"),
- e->getExprLoc())
- << e->getSourceRange();
+ auto e = dyn_cast<CXXConstCastExpr>(
+ expr->getLHS()->IgnoreParenImpCasts());
+ if (e != nullptr) {
+ report(
+ DiagnosticsEngine::Warning,
+ "redundant const_cast on lhs of pointer %select{comparison|subtraction}0 expression",
+ e->getExprLoc())
+ << (expr->getOpcode() == BO_Sub) << expr->getSourceRange();
+ }
+ e = dyn_cast<CXXConstCastExpr>(
+ expr->getRHS()->IgnoreParenImpCasts());
+ if (e != nullptr) {
+ report(
+ DiagnosticsEngine::Warning,
+ "redundant const_cast on rhs of pointer %select{comparison|subtraction}0 expression",
+ e->getExprLoc())
+ << (expr->getOpcode() == BO_Sub) << expr->getSourceRange();
+ }
}
return true;
}
commit c5f1e8c3bbf6bb534b387cdafd1983204f82dd37
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 26 15:32:44 2015 +0100
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I42fdc042ed7317b5b6c337e7b38966e616f8e24b
diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx
index 1a8ba1d..7b7b78a 100644
--- a/xmlsecurity/source/framework/buffernode.cxx
+++ b/xmlsecurity/source/framework/buffernode.cxx
@@ -71,7 +71,7 @@ bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const
for( ; ii != m_vElementCollectors.end() ; ++ii )
{
- ElementCollector* pElementCollector = (ElementCollector*)*ii;
+ ElementCollector* pElementCollector = const_cast<ElementCollector*>(*ii);
if ((nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID ||
pElementCollector->getSecurityId() != nIgnoredSecurityId) &&
@@ -139,7 +139,7 @@ void BufferNode::addElementCollector(const ElementCollector* pElementCollector)
******************************************************************************/
{
m_vElementCollectors.push_back( pElementCollector );
- ((ElementCollector*)pElementCollector)->setBufferNode(this);
+ const_cast<ElementCollector*>(pElementCollector)->setBufferNode(this);
}
void BufferNode::removeElementCollector(const ElementCollector* pElementCollector)
@@ -173,7 +173,7 @@ void BufferNode::removeElementCollector(const ElementCollector* pElementCollecto
if( *ii == pElementCollector )
{
m_vElementCollectors.erase( ii );
- ((ElementCollector*)pElementCollector)->setBufferNode(NULL);
+ const_cast<ElementCollector*>(pElementCollector)->setBufferNode(NULL);
break;
}
}
@@ -209,7 +209,7 @@ void BufferNode::setBlocker(const ElementMark* pBlocker)
{
OSL_ASSERT(!(m_pBlocker != NULL && pBlocker != NULL));
- m_pBlocker = (ElementMark*)pBlocker;
+ m_pBlocker = const_cast<ElementMark*>(pBlocker);
if (m_pBlocker != NULL)
{
m_pBlocker->setBufferNode(this);
@@ -247,14 +247,14 @@ OUString BufferNode::printChildren() const
rc += OUString( "BufID=" );
rc += OUString::number((*ii)->getBufferId());
- if (((ElementCollector*)(*ii))->getModify())
+ if ((*ii)->getModify())
{
rc += OUString( "[M]" );
}
rc += OUString( ",Pri=" );
- switch (((ElementCollector*)(*ii))->getPriority())
+ switch ((*ii)->getPriority())
{
case cssxc::sax::ElementMarkPriority_BEFOREMODIFY:
rc += OUString( "BEFOREMODIFY" );
@@ -269,7 +269,7 @@ OUString BufferNode::printChildren() const
rc += OUString( "(" );
rc += OUString( "SecID=" );
- rc += OUString::number(((ElementCollector*)(*ii))->getSecurityId());
+ rc += OUString::number(const_cast<ElementCollector*>(*ii)->getSecurityId());
rc += OUString( ")" );
rc += OUString( " " );
}
@@ -364,7 +364,7 @@ const BufferNode* BufferNode::getFirstChild() const
if (!m_vChildren.empty())
{
- rc = (BufferNode*)m_vChildren.front();
+ rc = const_cast<BufferNode*>(m_vChildren.front());
}
return (const BufferNode*)rc;
@@ -524,7 +524,7 @@ sal_Int32 BufferNode::indexOfChild(const BufferNode* pChild) const
void BufferNode::setParent(const BufferNode* pParent)
{
- m_pParent = (BufferNode*)pParent;
+ m_pParent = const_cast<BufferNode*>(pParent);
}
const BufferNode* BufferNode::getNextSibling() const
@@ -554,7 +554,7 @@ const BufferNode* BufferNode::getNextSibling() const
if (m_pParent != NULL)
{
- rc = (BufferNode*)m_pParent->getNextChild(this);
+ rc = const_cast<BufferNode*>(m_pParent->getNextChild(this));
}
return (const BufferNode*)rc;
@@ -593,7 +593,7 @@ const BufferNode* BufferNode::isAncestor(const BufferNode* pDescendant) const
for( ; ii != m_vChildren.end() ; ++ii )
{
- BufferNode* pChild = (BufferNode*)*ii;
+ BufferNode* pChild = const_cast<BufferNode*>(*ii);
if (pChild == pDescendant)
{
@@ -639,7 +639,7 @@ bool BufferNode::isPrevious(const BufferNode* pFollowing) const
{
bool rc = false;
- BufferNode* pNextBufferNode = (BufferNode*)getNextNodeByTreeOrder();
+ BufferNode* pNextBufferNode = const_cast<BufferNode*>(getNextNodeByTreeOrder());
while (pNextBufferNode != NULL)
{
if (pNextBufferNode == pFollowing)
@@ -648,7 +648,7 @@ bool BufferNode::isPrevious(const BufferNode* pFollowing) const
break;
}
- pNextBufferNode = (BufferNode*)(pNextBufferNode->getNextNodeByTreeOrder());
+ pNextBufferNode = const_cast<BufferNode*>(pNextBufferNode->getNextNodeByTreeOrder());
}
return rc;
@@ -700,7 +700,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
* Otherwise, it this buffer node has a following sibling,
* then return that sibling.
*/
- BufferNode* pNextSibling = (BufferNode*)getNextSibling();
+ BufferNode* pNextSibling = const_cast<BufferNode*>(getNextSibling());
if (pNextSibling != NULL)
{
return pNextSibling;
@@ -710,7 +710,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
* Otherwise, it this buffer node has parent, then return
* its parent's following sibling.
*/
- BufferNode* pNode = (BufferNode*)this;
+ BufferNode* pNode = const_cast<BufferNode*>(this);
BufferNode* pParent;
BufferNode* pNextSiblingParent = NULL;
@@ -721,10 +721,10 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
break;
}
- pParent = (BufferNode*)pNode->getParent();
+ pParent = const_cast<BufferNode*>(pNode->getParent());
if (pParent != NULL)
{
- pNextSiblingParent = (BufferNode*)pParent->getNextSibling();
+ pNextSiblingParent = const_cast<BufferNode*>(pParent->getNextSibling());
}
pNode = pParent;
@@ -767,7 +767,7 @@ void BufferNode::notifyBranch()
for( ; ii != m_vChildren.end() ; ++ii )
{
- BufferNode* pBufferNode = (BufferNode*)*ii;
+ BufferNode* pBufferNode = const_cast<BufferNode*>(*ii);
pBufferNode->elementCollectorNotify();
pBufferNode->notifyBranch();
}
@@ -808,7 +808,7 @@ void BufferNode::elementCollectorNotify()
std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin();
for( ; ii != m_vElementCollectors.end() ; ++ii )
{
- ElementCollector* pElementCollector = (ElementCollector*)*ii;
+ ElementCollector* pElementCollector = const_cast<ElementCollector*>(*ii);
nPriority = pElementCollector->getPriority();
if (nPriority > nMaxPriority)
{
@@ -821,7 +821,7 @@ void BufferNode::elementCollectorNotify()
for( ; ii != vElementCollectors.end() ; ++ii )
{
- ElementCollector* pElementCollector = (ElementCollector*)*ii;
+ ElementCollector* pElementCollector = const_cast<ElementCollector*>(*ii);
nPriority = pElementCollector->getPriority();
bool bToModify = pElementCollector->getModify();
@@ -893,7 +893,7 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
for( ; jj != m_vElementCollectors.end() ; ++jj )
{
- ElementCollector* pElementCollector = (ElementCollector*)*jj;
+ ElementCollector* pElementCollector = const_cast<ElementCollector*>(*jj);
if (nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID ||
pElementCollector->getSecurityId() != nIgnoredSecurityId)
{
@@ -908,7 +908,7 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
for( ; ii != m_vChildren.end() ; ++ii )
{
- BufferNode* pBufferNode = (BufferNode*)*ii;
+ BufferNode* pBufferNode = const_cast<BufferNode*>(*ii);
if ( pBufferNode->isECInSubTreeIncluded(nIgnoredSecurityId))
{
@@ -962,7 +962,7 @@ bool BufferNode::isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurity
break;
}
- pParentNode = (BufferNode*)pParentNode->getParent();
+ pParentNode = const_cast<BufferNode*>(pParentNode->getParent());
}
return rc;
@@ -1002,7 +1002,7 @@ bool BufferNode::isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const
for( ; ii != m_vChildren.end() ; ++ii )
{
- BufferNode* pBufferNode = (BufferNode*)*ii;
+ BufferNode* pBufferNode = const_cast<BufferNode*>(*ii);
ElementMark* pBlocker = pBufferNode->getBlocker();
if (pBlocker != NULL &&
@@ -1055,7 +1055,7 @@ const BufferNode* BufferNode::getNextChild(const BufferNode* pChild) const
{
if (bChildFound)
{
- rc = (BufferNode*)*ii;
+ rc = const_cast<BufferNode*>(*ii);
break;
}
@@ -1095,7 +1095,7 @@ void BufferNode::freeAllChildren()
std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin();
for( ; ii != m_vChildren.end() ; ++ii )
{
- BufferNode *pChild = (BufferNode *)(*ii);
+ BufferNode *pChild = const_cast<BufferNode *>(*ii);
pChild->freeAllChildren();
delete pChild;
}
diff --git a/xmlsecurity/source/framework/elementmark.cxx b/xmlsecurity/source/framework/elementmark.cxx
index 24edb82..c87e480f 100644
--- a/xmlsecurity/source/framework/elementmark.cxx
+++ b/xmlsecurity/source/framework/elementmark.cxx
@@ -61,7 +61,7 @@ ElementMark::ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId)
void ElementMark::setBufferNode(const BufferNode* pBufferNode)
{
- m_pBufferNode = (BufferNode*)pBufferNode;
+ m_pBufferNode = const_cast<BufferNode*>(pBufferNode);
}
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
index 6013f2d..3d2e397 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
@@ -242,7 +242,7 @@ ElementMark* SAXEventKeeperImpl::findElementMarkBuffer(sal_Int32 nId) const
{
if ( nId == (*ii)->getBufferId())
{
- pElementMark = (ElementMark*)*ii;
+ pElementMark = const_cast<ElementMark*>(*ii);
break;
}
}
@@ -365,7 +365,7 @@ OUString SAXEventKeeperImpl::printBufferNode(
rc += OUString( " " );
rc += m_xXMLDocument->getNodeName(pBufferNode->getXMLElement());
- BufferNode* pParent = (BufferNode*)pBufferNode->getParent();
+ BufferNode* pParent = const_cast<BufferNode*>(pBufferNode->getParent());
if (pParent != NULL)
{
rc += OUString( "[" );
@@ -392,7 +392,7 @@ OUString SAXEventKeeperImpl::printBufferNode(
std::vector< const BufferNode* >::const_iterator jj = vChildren->begin();
for( ; jj != vChildren->end(); ++jj )
{
- rc += printBufferNode((BufferNode *)*jj, nIndent+4);
+ rc += printBufferNode(const_cast<BufferNode *>(*jj), nIndent+4);
}
delete vChildren;
@@ -485,7 +485,7 @@ void SAXEventKeeperImpl::smashBufferNode(
{
if (!pBufferNode->hasAnything())
{
- BufferNode* pParent = (BufferNode*)pBufferNode->getParent();
+ BufferNode* pParent = const_cast<BufferNode*>(pBufferNode->getParent());
/*
* delete the XML data
@@ -584,7 +584,7 @@ void SAXEventKeeperImpl::smashBufferNode(
std::vector< const BufferNode * >::const_iterator ii = vChildren->begin();
for( ; ii != vChildren->end(); ++ii )
{
- ((BufferNode *)(*ii))->setParent(pParent);
+ const_cast<BufferNode *>(*ii)->setParent(pParent);
pParent->addChild(*ii, nIndex);
nIndex++;
}
@@ -631,7 +631,7 @@ BufferNode* SAXEventKeeperImpl::findNextBlockingBufferNode(
{
pNext = pStartBufferNode;
- while (NULL != (pNext = (BufferNode*)pNext->getNextNodeByTreeOrder()))
+ while (NULL != (pNext = const_cast<BufferNode*>(pNext->getNextNodeByTreeOrder())))
{
if (pNext->getBlocker() != NULL)
{
@@ -674,7 +674,7 @@ void SAXEventKeeperImpl::diffuse(BufferNode* pBufferNode) const
while(pParent->isAllReceived())
{
pParent->elementCollectorNotify();
- pParent = (BufferNode*)pParent->getParent();
+ pParent = const_cast<BufferNode*>(pParent->getParent());
}
}
@@ -1267,7 +1267,7 @@ void SAL_CALL SAXEventKeeperImpl::endElement( const OUString& aName )
if (bIsCurrent && (m_pCurrentBufferNode != m_pRootBufferNode))
{
BufferNode* pOldCurrentBufferNode = m_pCurrentBufferNode;
- m_pCurrentBufferNode = (BufferNode*)m_pCurrentBufferNode->getParent();
+ m_pCurrentBufferNode = const_cast<BufferNode*>(m_pCurrentBufferNode->getParent());
pOldCurrentBufferNode->setReceivedAll();
diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
index fbf99a7..1a5b473 100644
--- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
+++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
@@ -157,7 +157,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c
{
int nResultLen = 0;
aResult.realloc( aToConvert.getLength() + m_nBlockSize );
- if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nResultLen, aResult.getLength(), const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( aToConvert.getConstArray() ) ), aToConvert.getLength() ) != SECSuccess )
+ if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nResultLen, aResult.getLength(), reinterpret_cast< const unsigned char* >( aToConvert.getConstArray() ), aToConvert.getLength() ) != SECSuccess )
{
m_bBroken = true;
Dispose();
@@ -221,7 +221,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
{
int nPrefResLen = 0;
aResult.realloc( m_aLastBlock.getLength() + m_nBlockSize );
- if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nPrefResLen, aResult.getLength(), const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( m_aLastBlock.getConstArray() ) ), m_aLastBlock.getLength() ) != SECSuccess )
+ if ( PK11_CipherOp( m_pContext, reinterpret_cast< unsigned char* >( aResult.getArray() ), &nPrefResLen, aResult.getLength(), reinterpret_cast< const unsigned char* >( m_aLastBlock.getConstArray() ), m_aLastBlock.getLength() ) != SECSuccess )
{
m_bBroken = true;
Dispose();
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index cfa3b8a..0355e27 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -437,7 +437,7 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O
// Create cert info from issue and serial
OString ostr = OUStringToOString( issuerName , RTL_TEXTENCODING_UTF8 ) ;
- chIssuer = PL_strndup( ( char* )ostr.getStr(), ( int )ostr.getLength() ) ;
+ chIssuer = PL_strndup( ostr.getStr(), ( int )ostr.getLength() ) ;
nmIssuer = CERT_AsciiToName( chIssuer ) ;
if( nmIssuer == NULL ) {
PL_strfree( chIssuer ) ;
@@ -508,7 +508,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_NssImpl :: buildCerti
//Get the system clock time
timeboundary = PR_Now() ;
- certChain = CERT_GetCertChainFromCert( ( CERTCertificate* )cert, timeboundary, certUsageAnyCA ) ;
+ certChain = CERT_GetCertChainFromCert( const_cast<CERTCertificate*>(cert), timeboundary, certUsageAnyCA ) ;
} else {
certChain = NULL ;
}
@@ -844,13 +844,13 @@ sal_Int32 SecurityEnvironment_NssImpl::getCertificateCharacters(
if (cert->slot != NULL)
{
- priKey = PK11_FindPrivateKeyFromCert( cert->slot, ( CERTCertificate* )cert, NULL ) ;
+ priKey = PK11_FindPrivateKeyFromCert( cert->slot, const_cast<CERTCertificate*>(cert), NULL ) ;
}
if(priKey == NULL)
{
for (CIT_SLOTS is = m_Slots.begin(); is != m_Slots.end(); is++)
{
- priKey = PK11_FindPrivateKeyFromCert(*is, (CERTCertificate*)cert, NULL);
+ priKey = PK11_FindPrivateKeyFromCert(*is, const_cast<CERTCertificate*>(cert), NULL);
if (priKey)
break;
}
diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx
index ee0d950..cd15cc6 100644
--- a/xmlsecurity/source/xmlsec/saxhelper.cxx
+++ b/xmlsecurity/source/xmlsec/saxhelper.cxx
@@ -273,7 +273,7 @@ void SAXHelper::startElement(
if( fullName != NULL )
{
- xmlFree( ( xmlChar* )fullName ) ;
+ xmlFree( const_cast<xmlChar*>(fullName) ) ;
fullName = NULL ;
}
@@ -281,7 +281,7 @@ void SAXHelper::startElement(
{
for( int i = 0 ; attrs[i] != NULL ; ++i )
{
- xmlFree( ( xmlChar* )attrs[i] ) ;
+ xmlFree( const_cast<xmlChar*>(attrs[i]) ) ;
attrs[i] = NULL ;
}
@@ -322,7 +322,7 @@ void SAXHelper::characters( const OUString& aChars )
if( chars != NULL )
{
- xmlFree( ( xmlChar* )chars ) ;
+ xmlFree( const_cast<xmlChar*>(chars) ) ;
}
}
@@ -340,7 +340,7 @@ void SAXHelper::ignorableWhitespace( const OUString& aWhitespaces )
if( chars != NULL )
{
- xmlFree( ( xmlChar* )chars ) ;
+ xmlFree( const_cast<xmlChar*>(chars) ) ;
}
}
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index 76ea5e3..062fee4 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -271,12 +271,12 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
if (xHandler.is())
{
xHandler->startElement(
- OUString(C2U ( ((sal_Char*)(sNodeName.getStr())) )),
+ OUString(C2U ( sNodeName.getStr() )),
xAttrList);
}
xHandler2->startElement(
- OUString(C2U ( ((sal_Char*)(sNodeName.getStr())) )),
+ OUString(C2U ( sNodeName.getStr() )),
xAttrList);
}
@@ -318,10 +318,10 @@ void XMLDocumentWrapper_XmlSecImpl::sendEndElement(
if (xHandler.is())
{
- xHandler->endElement(OUString(C2U ( ((sal_Char*)(sNodeName.getStr())) )));
+ xHandler->endElement(OUString(C2U ( sNodeName.getStr() )));
}
- xHandler2->endElement(OUString(C2U ( ((sal_Char*)(sNodeName.getStr())) )));
+ xHandler2->endElement(OUString(C2U ( sNodeName.getStr() )));
}
void XMLDocumentWrapper_XmlSecImpl::sendNode(
commit f701cce539c58874c07ef7487075b29143cc9ed1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 26 15:32:40 2015 +0100
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Ib054b36c87c87ae2189b5456bc9b12d7b76c49e7
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 9320d38..9371913 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -451,7 +451,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
// construct PresPagePropsMapper
- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef, true);
+ xMapper = new XMLPropertySetMapper(aXMLSDPresPageProps, aFactoryRef, true);
mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this );
// set lock to avoid deletion
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 4522e18..b268861 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -165,7 +165,7 @@ XMLShapeImportHelper::XMLShapeImportHelper(
mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaDefaultExtPropMapper(rImporter));
// construct PresPagePropsMapper
- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory, false);
+ xMapper = new XMLPropertySetMapper(aXMLSDPresPageProps, mpSdPropHdlFactory, false);
mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter );
// set lock to avoid deletion
mpPresPagePropsMapper->acquire();
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 594ac32..a490221 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1102,7 +1102,7 @@ rtl::Reference< SvXMLImportPropertyMapper > SdXMLStylesContext::GetImportPropert
if(!xPresImpPropMapper.is())
{
rtl::Reference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
- ((SdXMLStylesContext*)this)->xPresImpPropMapper =
+ const_cast<SdXMLStylesContext*>(this)->xPresImpPropMapper =
aImpHelper->GetPresPagePropsMapper();
}
xMapper = xPresImpPropMapper;
@@ -1305,7 +1305,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if(nFamily == pStyle->GetFamily() && pStyle->IsDefaultStyle())
{
- ((SvXMLStyleContext*)pStyle)->SetDefaults();
+ const_cast<SvXMLStyleContext*>(pStyle)->SetDefaults();
}
}
@@ -1428,7 +1428,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if(xStyle.is())
{
// set parent style name
- OUString sParentStyleDisplayName( const_cast< SvXMLImport& >( GetImport() ).GetStyleDisplayName( pStyle->GetFamily(), pStyle->GetParentName() ) );
+ OUString sParentStyleDisplayName( GetImport().GetStyleDisplayName( pStyle->GetFamily(), pStyle->GetParentName() ) );
if( nPrefLen )
{
sal_Int32 nStylePrefLen = sParentStyleDisplayName.lastIndexOf( '-' ) + 1;
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 608fcb5..aafd03e 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -196,7 +196,7 @@ namespace xmloff
new OGridColumnPropertyTranslator( Reference< XMultiPropertySet >( m_xElement, UNO_QUERY ) );
const_cast< XMLTextStyleContext* >( m_pStyleElement )->FillPropertySet( xPropTranslation );
- const OUString sNumberStyleName = const_cast< XMLTextStyleContext* >( m_pStyleElement )->GetDataStyleName( );
+ const OUString sNumberStyleName = m_pStyleElement->GetDataStyleName( );
if ( !sNumberStyleName.isEmpty() )
// the style also has a number (sub) style
m_rContext.applyControlNumberStyle( m_xElement, sNumberStyleName );
diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx
index 52c506f..67ce532 100644
--- a/xmloff/source/style/PageMasterPropHdlFactory.cxx
+++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx
@@ -69,7 +69,7 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I
{
nType &= MID_FLAG_MASK;
- XMLPropertyHandler* pHdl = (XMLPropertyHandler*) XMLPropertyHandlerFactory::GetPropertyHandler( nType );
+ XMLPropertyHandler* pHdl = const_cast<XMLPropertyHandler*>(XMLPropertyHandlerFactory::GetPropertyHandler( nType ));
if( !pHdl )
{
switch( nType )
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 2c6fe9c..0bd5d95 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -157,7 +157,7 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) :
{
xPageMasterPropHdlFactory = new XMLPageMasterPropHdlFactory;
xPageMasterPropSetMapper = new XMLPageMasterPropSetMapper(
- (XMLPropertyMapEntry*) aXMLPageMasterStyleMap,
+ aXMLPageMasterStyleMap,
xPageMasterPropHdlFactory, true );
xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper(
xPageMasterPropSetMapper, rExp);
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 96e71a1..b541766 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -131,7 +131,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
pProp->maValue >>= xNumRule;
if( xNumRule.is() && (xNumRule->getCount() > 0 ) )
{
- const OUString sName(((XMLTextListAutoStylePool*)&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
+ const OUString sName(const_cast<XMLTextListAutoStylePool*>(&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, GetExport().EncodeStyleName( sName ) );
}
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index f8994f2..810a724 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -1227,13 +1227,13 @@ void SvxXMLListStyleContext::CreateAndInsertAuto() const
const OUString& rName = GetName();
if( bOutline || xNumRules.is() || rName.isEmpty() )
{
- ((SvxXMLListStyleContext *)this)->SetValid( false );
+ const_cast<SvxXMLListStyleContext *>(this)->SetValid( false );
return;
}
- ((SvxXMLListStyleContext *)this)->xNumRules = CreateNumRule(
+ const_cast<SvxXMLListStyleContext *>(this)->xNumRules = CreateNumRule(
GetImport().GetModel() );
- ((SvxXMLListStyleContext *)this)->nLevels = xNumRules->getCount();
+ const_cast<SvxXMLListStyleContext *>(this)->nLevels = xNumRules->getCount();
FillUnoNumRule(xNumRules);
}
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index 40a052d..a4600a4 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -613,7 +613,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
if( !mxParaImpPropMapper.is() )
{
- SvXMLStylesContext * pThis = (SvXMLStylesContext *)this;
+ SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
pThis->mxParaImpPropMapper =
pThis->GetImport().GetTextImport()
->GetParaImportPropertySetMapper();
@@ -623,7 +623,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
case XML_STYLE_FAMILY_TEXT_TEXT:
if( !mxTextImpPropMapper.is() )
{
- SvXMLStylesContext * pThis = (SvXMLStylesContext *)this;
+ SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
pThis->mxTextImpPropMapper =
pThis->GetImport().GetTextImport()
->GetTextImportPropertySetMapper();
@@ -635,7 +635,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
// don't cache section mapper, as it's rarely used
// *sigh*, cast to non-const, because this is a const method,
// but SvXMLImport::GetTextImport() isn't.
- xMapper = ((SvXMLStylesContext*)this)->GetImport().GetTextImport()->
+ xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
GetSectionImportPropertySetMapper();
break;
@@ -643,7 +643,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
// don't cache section mapper, as it's rarely used
// *sigh*, cast to non-const, because this is a const method,
// but SvXMLImport::GetTextImport() isn't.
- xMapper = ((SvXMLStylesContext*)this)->GetImport().GetTextImport()->
+ xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
GetRubyImportPropertySetMapper();
break;
@@ -653,7 +653,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
if(!mxShapeImpPropMapper.is())
{
rtl::Reference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
- ((SvXMLStylesContext*)this)->mxShapeImpPropMapper =
+ const_cast<SvXMLStylesContext*>(this)->mxShapeImpPropMapper =
aImpHelper->GetPropertySetMapper();
}
xMapper = mxShapeImpPropMapper;
@@ -673,7 +673,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
new XMLPageMasterPropSetMapper( false );
mxPageImpPropMapper =
new PageMasterImportPropertyMapper( pPropMapper,
- ((SvXMLStylesContext*)this)->GetImport() );
+ const_cast<SvXMLStylesContext*>(this)->GetImport() );
}
xMapper = mxPageImpPropMapper;
break;
@@ -703,9 +703,9 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( sal_uInt16 nFa
Any aAny = xAutoStyleFamilies->getByName( sName );
xAutoStyles = *(Reference<XAutoStyleFamily>*)aAny.getValue();
if( bPara )
- ((SvXMLStylesContext *)this)->mxParaAutoStyles = xAutoStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxParaAutoStyles = xAutoStyles;
else
- ((SvXMLStylesContext *)this)->mxTextAutoStyles = xAutoStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxTextAutoStyles = xAutoStyles;
}
}
}
@@ -747,11 +747,11 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
switch( nFamily )
{
case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- ((SvXMLStylesContext *)this)->mxParaStyles = xStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxParaStyles = xStyles;
break;
case XML_STYLE_FAMILY_TEXT_TEXT:
- ((SvXMLStylesContext *)this)->mxTextStyles = xStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxTextStyles = xStyles;
break;
}
}
commit fa683a7020837ee04b8f610490edf08b686cb6b8
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 26 15:32:35 2015 +0100
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I88d1d082cc25a185322435a75c94f4c6b4ad12f8
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index c43ba25..5d6ebbd 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -93,35 +93,35 @@ namespace treeview {
void setApplication( const char* appl )
{
- application = OUString( (sal_Char*)(appl),
+ application = OUString( appl,
strlen( appl ),
RTL_TEXTENCODING_UTF8 );
}
void setTitle( const char* itle )
{
- title += OUString( (sal_Char*)(itle),
+ title += OUString( itle,
strlen( itle ),
RTL_TEXTENCODING_UTF8 );
}
void setTitle( const XML_Char* itle,int len )
{
- title += OUString( (sal_Char*)(itle),
+ title += OUString( itle,
len,
RTL_TEXTENCODING_UTF8 );
}
void setId( const char* d )
{
- id = OUString( (sal_Char*)(d),
+ id = OUString( d,
strlen( d ),
RTL_TEXTENCODING_UTF8 );
}
void setAnchor( const char* nchor )
{
- anchor = OUString( (sal_Char*)(nchor),
+ anchor = OUString( nchor,
strlen( nchor ),
RTL_TEXTENCODING_UTF8 );
}
commit 513fc2916053db5ee7ffaf9f53c271a05cef8981
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Mar 26 15:32:26 2015 +0100
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I17c57a85bcda98ef36ddefd6562d4681d0c7d5fc
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index e98a95b..3712ada 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -506,7 +506,7 @@ private:
inline void release() const
{
if (!--mnRefCnt)
- delete const_cast<Window*>(this);
+ delete this;
}
protected:
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 8504ef0..2a354cc 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -922,7 +922,7 @@ IMPL_LINK_NOARG(PrintFontManager, autoInstallFontLangSupport)
gchar **fonts = (gchar**)g_malloc((m_aCurrentRequests.size() + 1) * sizeof(gchar*));
gchar **font = fonts;
for (std::vector<OString>::const_iterator aI = m_aCurrentRequests.begin(); aI != m_aCurrentRequests.end(); ++aI)
- *font++ = (gchar*)aI->getStr();
+ *font++ = const_cast<gchar*>(aI->getStr());
*font = NULL;
gboolean res = dbus_g_proxy_call(proxy, "InstallFontconfigResources", &error,
G_TYPE_UINT, xid, /* xid */
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index c79c883..887b5f4 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -262,7 +262,7 @@ FT_FaceRec_* FtFontInfo::GetFaceFT()
if (!maFaceFT && mpFontFile->Map())
{
FT_Error rc = FT_New_Memory_Face( aLibFT,
- (FT_Byte*)mpFontFile->GetBuffer(),
+ mpFontFile->GetBuffer(),
mpFontFile->GetFileSize(), mnFaceNum, &maFaceFT );
if( (rc != FT_Err_Ok) || (maFaceFT->num_glyphs <= 0) )
maFaceFT = NULL;
diff --git a/vcl/opengl/program.cxx b/vcl/opengl/program.cxx
index 3504b06..d40aa30 100644
--- a/vcl/opengl/program.cxx
+++ b/vcl/opengl/program.cxx
@@ -87,7 +87,7 @@ bool OpenGLProgram::Clean()
void OpenGLProgram::SetVertexAttrib( GLuint& rAttrib, const OString& rName, const GLvoid* pData )
{
if( rAttrib == SAL_MAX_UINT32 )
- rAttrib = glGetAttribLocation( mnId, (char*) rName.getStr() );
+ rAttrib = glGetAttribLocation( mnId, rName.getStr() );
if( (mnEnabledAttribs & ( 1 << rAttrib )) == 0 )
{
glEnableVertexAttribArray( rAttrib );
@@ -116,7 +116,7 @@ GLuint OpenGLProgram::GetUniformLocation( const OString& rName )
auto it = maUniformLocations.find( rName );
if( it == maUniformLocations.end() )
{
- GLuint nLocation = glGetUniformLocation( mnId, (char*) rName.getStr() );
+ GLuint nLocation = glGetUniformLocation( mnId, rName.getStr() );
maUniformLocations[rName] = nLocation;
return nLocation;
}
diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx
index e7e4b6b..74e84c6 100644
--- a/vcl/opengl/x11/X11DeviceInfo.cxx
+++ b/vcl/opengl/x11/X11DeviceInfo.cxx
@@ -60,7 +60,7 @@ char* strtok_wrapper(const char* aDelims, char** aStr)
return nullptr;
}
- char* ret = (char*)strspnp_wrapper(aDelims, *aStr);
+ char* ret = const_cast<char*>(strspnp_wrapper(aDelims, *aStr));
if (!*ret) {
*aStr = ret;
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index c62b4d6..0ea1286 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -64,8 +64,8 @@ utl::TransliterationWrapper& vcl::I18nHelper::ImplGetTransliterationWrapper() co
if ( mbTransliterateIgnoreCase )
nModules |= i18n::TransliterationModules_IGNORE_CASE;
- ((vcl::I18nHelper*)this)->mpTransliterationWrapper = new utl::TransliterationWrapper( m_xContext, (i18n::TransliterationModules)nModules );
- ((vcl::I18nHelper*)this)->mpTransliterationWrapper->loadModuleIfNeeded( maLanguageTag.getLanguageType() );
+ const_cast<vcl::I18nHelper*>(this)->mpTransliterationWrapper = new utl::TransliterationWrapper( m_xContext, (i18n::TransliterationModules)nModules );
+ const_cast<vcl::I18nHelper*>(this)->mpTransliterationWrapper->loadModuleIfNeeded( maLanguageTag.getLanguageType() );
}
return *mpTransliterationWrapper;
}
@@ -74,7 +74,7 @@ LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const
{
if ( !mpLocaleDataWrapper )
{
- ((vcl::I18nHelper*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( m_xContext, maLanguageTag );
+ const_cast<vcl::I18nHelper*>(this)->mpLocaleDataWrapper = new LocaleDataWrapper( m_xContext, maLanguageTag );
}
return *mpLocaleDataWrapper;
}
@@ -112,15 +112,15 @@ OUString vcl::I18nHelper::filterFormattingChars( const OUString& rStr )
sal_Int32 vcl::I18nHelper::CompareString( const OUString& rStr1, const OUString& rStr2 ) const
{
- ::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
+ ::osl::Guard< ::osl::Mutex > aGuard( const_cast<vcl::I18nHelper*>(this)->maMutex );
if ( mbTransliterateIgnoreCase )
{
// Change mbTransliterateIgnoreCase and destroy the wrapper, next call to
// ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
- ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = false;
- delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
- ((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
+ const_cast<vcl::I18nHelper*>(this)->mbTransliterateIgnoreCase = false;
+ delete const_cast<vcl::I18nHelper*>(this)->mpTransliterationWrapper;
+ const_cast<vcl::I18nHelper*>(this)->mpTransliterationWrapper = NULL;
}
OUString aStr1( filterFormattingChars(rStr1) );
@@ -130,15 +130,15 @@ sal_Int32 vcl::I18nHelper::CompareString( const OUString& rStr1, const OUString&
bool vcl::I18nHelper::MatchString( const OUString& rStr1, const OUString& rStr2 ) const
{
- ::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
+ ::osl::Guard< ::osl::Mutex > aGuard( const_cast<vcl::I18nHelper*>(this)->maMutex );
if ( !mbTransliterateIgnoreCase )
{
// Change mbTransliterateIgnoreCase and destroy the wrapper, next call to
// ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
- ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = true;
- delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
- ((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
+ const_cast<vcl::I18nHelper*>(this)->mbTransliterateIgnoreCase = true;
+ delete const_cast<vcl::I18nHelper*>(this)->mpTransliterationWrapper;
+ const_cast<vcl::I18nHelper*>(this)->mpTransliterationWrapper = NULL;
}
OUString aStr1( filterFormattingChars(rStr1) );
@@ -148,7 +148,7 @@ bool vcl::I18nHelper::MatchString( const OUString& rStr1, const OUString& rStr2
bool vcl::I18nHelper::MatchMnemonic( const OUString& rString, sal_Unicode cMnemonicChar ) const
{
- ::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
+ ::osl::Guard< ::osl::Mutex > aGuard( const_cast<vcl::I18nHelper*>(this)->maMutex );
bool bEqual = false;
sal_Int32 n = rString.indexOf( '~' );
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 2906819..b202d64 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2852,7 +2852,7 @@ const LanguageTag& AllSettings::GetUILanguageTag() const
const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
{
if ( !mxData->mpLocaleDataWrapper )
- ((AllSettings*)this)->mxData->mpLocaleDataWrapper = new LocaleDataWrapper(
+ const_cast<AllSettings*>(this)->mxData->mpLocaleDataWrapper = new LocaleDataWrapper(
comphelper::getProcessComponentContext(), GetLanguageTag() );
return *mxData->mpLocaleDataWrapper;
}
@@ -2860,7 +2860,7 @@ const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
{
if ( !mxData->mpUILocaleDataWrapper )
- ((AllSettings*)this)->mxData->mpUILocaleDataWrapper = new LocaleDataWrapper(
+ const_cast<AllSettings*>(this)->mxData->mpUILocaleDataWrapper = new LocaleDataWrapper(
comphelper::getProcessComponentContext(), GetUILanguageTag() );
return *mxData->mpUILocaleDataWrapper;
}
@@ -2868,7 +2868,7 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
{
if ( !mxData->mpI18nHelper ) {
- ((AllSettings*)this)->mxData->mpI18nHelper = new vcl::I18nHelper(
+ const_cast<AllSettings*>(this)->mxData->mpI18nHelper = new vcl::I18nHelper(
comphelper::getProcessComponentContext(), GetLanguageTag() );
}
return *mxData->mpI18nHelper;
@@ -2877,7 +2877,7 @@ const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
{
if ( !mxData->mpUII18nHelper ) {
- ((AllSettings*)this)->mxData->mpUII18nHelper = new vcl::I18nHelper(
+ const_cast<AllSettings*>(this)->mxData->mpUII18nHelper = new vcl::I18nHelper(
comphelper::getProcessComponentContext(), GetUILanguageTag() );
}
return *mxData->mpUII18nHelper;
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index cab79f5..8a9cbed 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -387,7 +387,7 @@ LocaleDataWrapper& FormatterBase::ImplGetLocaleDataWrapper() const
{
if ( !mpLocaleDataWrapper )
{
- ((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( GetLanguageTag() );
+ const_cast<FormatterBase*>(this)->mpLocaleDataWrapper = new LocaleDataWrapper( GetLanguageTag() );
}
return *mpLocaleDataWrapper;
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index c356a82..4bf320f 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1449,7 +1449,7 @@ CalendarWrapper& DateFormatter::GetCalendarWrapper() const
{
if ( !mpCalendarWrapper )
{
- ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getProcessComponentContext() );
+ const_cast<DateFormatter*>(this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getProcessComponentContext() );
mpCalendarWrapper->loadDefaultCalendar( GetLocale() );
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index ee09d40..3d54413 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1611,7 +1611,7 @@ void TabControl::SetTabPageSizePixel( const Size& rSize )
Size TabControl::GetTabPageSizePixel() const
{
- Rectangle aRect = ((TabControl*)this)->ImplGetTabRect( TAB_PAGERECT );
+ Rectangle aRect = const_cast<TabControl*>(this)->ImplGetTabRect( TAB_PAGERECT );
return aRect.GetSize();
}
@@ -1779,7 +1779,7 @@ sal_uInt16 TabControl::GetPageId( const Point& rPos ) const
{
for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i )
{
- if ( ((TabControl*)this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) )
+ if ( const_cast<TabControl*>(this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) )
return mpTabCtrlData->maItemList[ i ].mnId;
}
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 644ee1c..bac8fdb 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1149,7 +1149,7 @@ sal_uLong TextEngine::GetTextHeight() const
DBG_ASSERT( GetUpdateMode(), "GetTextHeight: GetUpdateMode()" );
if ( !IsFormatted() && !IsFormatting() )
- ((TextEngine*)this)->FormatAndUpdate();
+ const_cast<TextEngine*>(this)->FormatAndUpdate();
return mnCurTextHeight;
}
@@ -1159,7 +1159,7 @@ sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const
DBG_ASSERT( GetUpdateMode(), "GetTextHeight: GetUpdateMode()" );
if ( !IsFormatted() && !IsFormatting() )
- ((TextEngine*)this)->FormatAndUpdate();
+ const_cast<TextEngine*>(this)->FormatAndUpdate();
return CalcParaHeight( nParagraph );
}
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index fbb4e64..21e643e 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1875,7 +1875,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
if( nFormat >= nFormatCount )
return (sal_uInt16) ImplSetError( GRFILTER_FORMATERROR );
- FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData );
+ FilterConfigItem aConfigItem( const_cast<uno::Sequence< beans::PropertyValue >*>(pFilterData) );
OUString aFilterName( pConfig->GetExportFilterName( nFormat ) );
bAbort = false;
diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx
index 58d8cb7..ff1eed9 100644
--- a/vcl/source/filter/ixbm/xbmread.cxx
+++ b/vcl/source/filter/ixbm/xbmread.cxx
@@ -127,7 +127,7 @@ OString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
long XBMReader::ParseDefine( const sal_Char* pDefine )
{
long nRet = 0;
- char* pTmp = (char*) pDefine;
+ char* pTmp = const_cast<char*>(pDefine);
unsigned char cTmp;
// move to end
diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx
index 16e6ccf..179d353 100644
--- a/vcl/source/filter/jpeg/JpegWriter.cxx
+++ b/vcl/source/filter/jpeg/JpegWriter.cxx
@@ -111,7 +111,7 @@ JPEGWriter::JPEGWriter( SvStream& rStream, const css::uno::Sequence< css::beans:
mbNative ( false ),
mpExpWasGrey ( pExportWasGrey )
{
- FilterConfigItem aConfigItem( (css::uno::Sequence< css::beans::PropertyValue >*) pFilterData );
+ FilterConfigItem aConfigItem( const_cast<css::uno::Sequence< css::beans::PropertyValue >*>(pFilterData) );
mbGreys = aConfigItem.ReadInt32( "ColorMode", 0 ) != 0;
mnQuality = aConfigItem.ReadInt32( "Quality", 75 );
maChromaSubsampling = aConfigItem.ReadInt32( "ChromaSubsamplingMode", 0 );
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 6e84f4c..ea74f6b 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -899,7 +899,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, c
if( pDXArray )
{
nNormWidth = maVDev.GetTextWidth( rText );
- pDX = (long*) pDXArray;
+ pDX = const_cast<long*>(pDXArray);
}
else
{
@@ -1405,14 +1405,14 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_LINECOLOR_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
mbLineChanged = true;
}
break;
case( META_FILLCOLOR_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
mbFillChanged = true;
}
break;
@@ -1423,14 +1423,14 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_TEXTALIGN_ACTION ):
case( META_FONT_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
mbTextChanged = true;
}
break;
case( META_ISECTRECTCLIPREGION_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
ImplBeginRecord( WIN_EMR_INTERSECTCLIPRECT );
ImplWriteRect( static_cast<const MetaISectRectClipRegionAction*>(pAction)->GetRect() );
@@ -1442,18 +1442,18 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_ISECTREGIONCLIPREGION_ACTION ):
case( META_MOVECLIPREGION_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
}
break;
case( META_REFPOINT_ACTION ):
case( META_MAPMODE_ACTION ):
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
break;
case( META_PUSH_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
ImplBeginRecord( WIN_EMR_SAVEDC );
ImplEndRecord();
@@ -1462,7 +1462,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_POP_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
ImplBeginRecord( WIN_EMR_RESTOREDC );
m_rStm.WriteInt32( -1 );
@@ -1475,7 +1475,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_RASTEROP_ACTION ):
{
- ( (MetaAction*) pAction )->Execute( &maVDev );
+ const_cast<MetaAction*>(pAction)->Execute( &maVDev );
ImplWriteRasterOp( static_cast<const MetaRasterOpAction*>(pAction)->GetRasterOp() );
}
break;
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index 147cba7..6ff77a4 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -54,7 +54,7 @@ inline sal_uInt16 NEXT_UShort( const unsigned char* &p )
bool ReadGSUB( struct _TrueTypeFont* pTTFile,
int nRequestedScript, int nRequestedLangsys )
{
- const FT_Byte* pGsubBase = (FT_Byte*)pTTFile->tables[ O_gsub ];
+ const FT_Byte* pGsubBase = pTTFile->tables[ O_gsub ];
if( !pGsubBase )
return false;
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 4a0f183..ead68e1 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -300,7 +300,7 @@ _inline int XUnits(int unitsPerEm, int n)
_inline const sal_uInt8* getTable( TrueTypeFont *ttf, sal_uInt32 ord)
{
- return (sal_uInt8*)ttf->tables[ord];
+ return ttf->tables[ord];
}
_inline sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord)
@@ -1633,7 +1633,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
/* Fixup offsets when only a TTC extract was provided */
if( facenum == (sal_uInt32)~0 ) {
- sal_uInt8* pHead = (sal_uInt8*)t->tables[O_head];
+ sal_uInt8* pHead = const_cast<sal_uInt8*>(t->tables[O_head]);
if( !pHead )
return SF_TTFORMAT;
/* limit Head candidate to TTC extract's limits */
@@ -1663,7 +1663,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
* Try to fix tables, so we can cope with minor problems.
*/
- if( (sal_uInt8*)t->tables[i] < t->ptr )
+ if( t->tables[i] < t->ptr )
{
#if OSL_DEBUG_LEVEL > 1
if( t->tables[i] )
@@ -1672,9 +1672,9 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
t->tlens[i] = 0;
t->tables[i] = NULL;
}
- else if( (sal_uInt8*)t->tables[i] + t->tlens[i] > t->ptr + t->fsize )
+ else if( const_cast<sal_uInt8*>(t->tables[i]) + t->tlens[i] > t->ptr + t->fsize )
{
- int nMaxLen = (t->ptr + t->fsize) - (sal_uInt8*)t->tables[i];
+ int nMaxLen = (t->ptr + t->fsize) - t->tables[i];
if( nMaxLen < 0 )
nMaxLen = 0;
t->tlens[i] = nMaxLen;
@@ -2010,7 +2010,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
const sal_uInt8 ptr[] = {0,'T',0,'r',0,'u',0,'e',0,'T',0,'y',0,'p',0,'e',0,'S',0,'u',0,'b',0,'s',0,'e',0,'t'};
NameRecord n1 = {1, 0, 0, 6, 14, const_cast<sal_uInt8 *>(reinterpret_cast<sal_uInt8 const *>("TrueTypeSubset"))};
NameRecord n2 = {3, 1, 1033, 6, 28, 0};
- n2.sptr = (sal_uInt8 *) ptr;
+ n2.sptr = const_cast<sal_uInt8 *>(ptr);
name = TrueTypeTableNew_name(0, 0);
nameAdd(name, &n1);
nameAdd(name, &n2);
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 66cfe54..9efb7fe 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -338,9 +338,9 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes
else
{
const size_t nOldPos = mnPos;
- ( (Animation*) this )->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos;
- delete new ImplAnimView( (Animation*) this, pOut, rDestPt, rDestSz, 0 );
- ( (Animation*) this )->mnPos = nOldPos;
+ const_cast<Animation*>(this)->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos;
+ delete new ImplAnimView( const_cast<Animation*>(this), pOut, rDestPt, rDestSz, 0 );
+ const_cast<Animation*>(this)->mnPos = nOldPos;
}
}
}
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 5a8bad6..2315ab1 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -118,7 +118,7 @@ Bitmap::Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalett
}
}
else
- pRealPal = (BitmapPalette*) pPal;
+ pRealPal = const_cast<BitmapPalette*>(pPal);
}
mpImpBmp = new ImpBitmap;
@@ -275,12 +275,12 @@ bool Bitmap::HasGreyPalette() const
const sal_uInt16 nBitCount = GetBitCount();
bool bRet = nBitCount == 1;
- BitmapInfoAccess* pIAcc = ( (Bitmap*) this )->AcquireInfoAccess();
+ BitmapInfoAccess* pIAcc = const_cast<Bitmap*>(this)->AcquireInfoAccess();
if( pIAcc )
{
bRet = pIAcc->HasPalette() && pIAcc->GetPalette().IsGreyPalette();
- ( (Bitmap*) this )->ReleaseAccess( pIAcc );
+ const_cast<Bitmap*>(this)->ReleaseAccess( pIAcc );
}
return bRet;
@@ -296,7 +296,7 @@ sal_uLong Bitmap::GetChecksum() const
if( !nRet )
{
- BitmapReadAccess* pRAcc = ( (Bitmap*) this )->AcquireReadAccess();
+ BitmapReadAccess* pRAcc = const_cast<Bitmap*>(this)->AcquireReadAccess();
if( pRAcc && pRAcc->Width() && pRAcc->Height() )
{
@@ -334,7 +334,7 @@ sal_uLong Bitmap::GetChecksum() const
mpImpBmp->ImplSetChecksum( nRet = nCrc );
}
- if (pRAcc) ( (Bitmap*) this )->ReleaseAccess( pRAcc );
+ if (pRAcc) const_cast<Bitmap*>(this)->ReleaseAccess( pRAcc );
}
}
@@ -846,7 +846,7 @@ bool Bitmap::CopyPixel( const Rectangle& rRectDst,
{
if( pBmpSrc && ( *pBmpSrc != *this ) )
{
- Bitmap* pSrc = (Bitmap*) pBmpSrc;
+ Bitmap* pSrc = const_cast<Bitmap*>(pBmpSrc);
const Size aCopySizePix( pSrc->GetSizePixel() );
Rectangle aRectSrc( rRectSrc );
const sal_uInt16 nSrcBitCount = pBmpSrc->GetBitCount();
@@ -1031,7 +1031,7 @@ bool Bitmap::CopyPixel_AlphaOptimized( const Rectangle& rRectDst, const Rectangl
{
if( pBmpSrc && ( *pBmpSrc != *this ) )
{
- Bitmap* pSrc = (Bitmap*) pBmpSrc;
+ Bitmap* pSrc = const_cast<Bitmap*>(pBmpSrc);
const Size aCopySizePix( pSrc->GetSizePixel() );
Rectangle aRectSrc( rRectSrc );
@@ -1191,7 +1191,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
if( pWriteAcc )
{
- BitmapReadAccess* pReadAcc = ( (Bitmap*) this )->AcquireReadAccess();
+ BitmapReadAccess* pReadAcc = const_cast<Bitmap*>(this)->AcquireReadAccess();
if( pReadAcc )
{
@@ -1355,7 +1355,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
}
}
- ( (Bitmap*) this )->ReleaseAccess( pReadAcc );
+ const_cast<Bitmap*>(this)->ReleaseAccess( pReadAcc );
bRet = true;
}
@@ -1377,7 +1377,7 @@ vcl::Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect )
{
vcl::Region aRegion;
Rectangle aRect( rRect );
- BitmapReadAccess* pReadAcc = ( (Bitmap*) this )->AcquireReadAccess();
+ BitmapReadAccess* pReadAcc = const_cast<Bitmap*>(this)->AcquireReadAccess();
aRect.Intersection( Rectangle( Point(), GetSizePixel() ) );
aRect.Justify();
@@ -1470,7 +1470,7 @@ vcl::Region Bitmap::CreateRegion( const Color& rColor, const Rectangle& rRect )
//aRegion.ImplEndAddRect();
//aRegion.SetRegionRectangles(aRectangles);
- ( (Bitmap*) this )->ReleaseAccess( pReadAcc );
+ const_cast<Bitmap*>(this)->ReleaseAccess( pReadAcc );
}
else
aRegion = aRect;
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 6d35ec6..ab451c3 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -637,7 +637,7 @@ bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor, s
bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols )
{
- return !!aBitmap && aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, (sal_uLong*) pTols );
+ return !!aBitmap && aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, const_cast<sal_uLong*>(pTols) );
}
bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 43ea999..fb7d136 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -753,7 +753,7 @@ namespace
{
bool bResult = false;
TrueTypeFont* pTTF = NULL;
- if( OpenTTFontBuffer( const_cast<void*>(i_pBuffer), i_nSize, 0, &pTTF ) == SF_OK )
+ if( OpenTTFontBuffer( i_pBuffer, i_nSize, 0, &pTTF ) == SF_OK )
{
TTGlobalFontInfo aInfo;
GetTTGlobalFontInfo( pTTF, &aInfo );
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 2d56965..75fd45c 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -140,7 +140,7 @@ bool GfxLink::IsNative() const
const sal_uInt8* GfxLink::GetData() const
{
if( IsSwappedOut() )
- ( (GfxLink*) this )->SwapIn();
+ const_cast<GfxLink*>(this)->SwapIn();
return( mpBuf ? mpBuf->mpBuffer : NULL );
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 98bee4c..3f65281 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -891,9 +891,9 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev,
default:
{
- ( (ImpGraphic*) this )->maMetaFile.WindStart();
- ( (ImpGraphic*) this )->maMetaFile.Play( pOutDev, rDestPt, rDestSize );
- ( (ImpGraphic*) this )->maMetaFile.WindStart();
+ const_cast<ImpGraphic*>(this)->maMetaFile.WindStart();
+ const_cast<ImpGraphic*>(this)->maMetaFile.Play( pOutDev, rDestPt, rDestSize );
+ const_cast<ImpGraphic*>(this)->maMetaFile.WindStart();
}
break;
}
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 07ddb83..df3f47c 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -114,7 +114,7 @@ ImplJobSetup* JobSetup::ImplGetConstData()
const ImplJobSetup* JobSetup::ImplGetConstData() const
{
if ( !mpData )
- ((JobSetup*)this)->mpData = new ImplJobSetup;
+ const_cast<JobSetup*>(this)->mpData = new ImplJobSetup;
return mpData;
}
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 4e08ba6..38a5bd7 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -173,7 +173,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpScanPrior ( NULL ),
mpTransTab ( NULL ),
mpScanCurrent ( NULL ),
- mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
+ mpColorTable ( const_cast<sal_uInt8*>(mpDefaultColorTable) ),
mnChunkType ( 0 ),
mnChunkLen ( 0 ),
mnBPP ( 0 ),
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index fa908de..d6114ef 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -1537,8 +1537,8 @@ bool vcl::Region::operator==( const vcl::Region& rRegion ) const
{
// one of both has a B2DPolyPolygon based region, ensure both have it
// by evtl. conversion
- const_cast< vcl::Region* >(this)->GetAsB2DPolyPolygon();
- const_cast< vcl::Region& >(rRegion).GetAsB2DPolyPolygon();
+ GetAsB2DPolyPolygon();
+ rRegion.GetAsB2DPolyPolygon();
return *rRegion.getB2DPolyPolygon() == *getB2DPolyPolygon();
}
@@ -1547,8 +1547,8 @@ bool vcl::Region::operator==( const vcl::Region& rRegion ) const
{
// one of both has a B2DPolyPolygon based region, ensure both have it
// by evtl. conversion
- const_cast< vcl::Region* >(this)->GetAsPolyPolygon();
- const_cast< vcl::Region& >(rRegion).GetAsPolyPolygon();
+ GetAsPolyPolygon();
+ rRegion.GetAsPolyPolygon();
return *rRegion.getPolyPolygon() == *getPolyPolygon();
}
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 0112071..760f189 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -105,7 +105,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev, bool bBack ) con
{
if( pOutDev && pOutDev->ImplIsAntiparallel() )
{
- OutputDevice *pOutDevRef = (OutputDevice*) pOutDev;
+ OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
// mirror this window back
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
@@ -137,7 +137,7 @@ void SalGraphics::mirror( long& x, long& nWidth, const OutputDevice *pOutDev, bo
{
if( pOutDev && pOutDev->ImplIsAntiparallel() )
{
- OutputDevice *pOutDevRef = (OutputDevice*) pOutDev;
+ OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
// mirror this window back
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
@@ -172,7 +172,7 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *
if( pOutDev && pOutDev->ImplIsAntiparallel() )
{
- OutputDevice *pOutDevRef = (OutputDevice*) pOutDev;
+ OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
// mirror this window back
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
{
@@ -295,7 +295,7 @@ basegfx::B2DPoint SalGraphics::mirror( const basegfx::B2DPoint& i_rPoint, const
{
if( i_pOutDev && !i_pOutDev->IsRTLEnabled() )
{
- OutputDevice *pOutDevRef = (OutputDevice*)i_pOutDev;
+ OutputDevice *pOutDevRef = const_cast<OutputDevice*>(i_pOutDev);
// mirror this window back
double devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
if( i_bBack )
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index fbaeb22..9ba3dcc 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -668,7 +668,7 @@ void SalLayout::Release() const
if( --mnRefCount > 0 )
return;
// const_cast because some compilers violate ANSI C++ spec
- delete const_cast<SalLayout*>(this);
+ delete this;
}
Point SalLayout::GetDrawPosition( const Point& rRelative ) const
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 0fe7677..0747b7b 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -394,7 +394,7 @@ sal_uInt16 OutputDevice::GetBitCount() const
// we need a graphics instance
if ( !mpGraphics )
{
- if ( !((OutputDevice*)this)->AcquireGraphics() )
+ if ( !AcquireGraphics() )
return 0;
}
@@ -656,7 +656,7 @@ void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rP
{
if ( !pSrcDev->mpGraphics )
{
- if ( !((OutputDevice*)pSrcDev)->AcquireGraphics() )
+ if ( !pSrcDev->AcquireGraphics() )
return;
}
pSrcGraphics = pSrcDev->mpGraphics;
@@ -669,7 +669,7 @@ void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rP
{
if ( !pSrcDev->mpGraphics )
{
- if ( !((OutputDevice*)pSrcDev)->AcquireGraphics() )
+ if ( !pSrcDev->AcquireGraphics() )
return;
}
pSrcGraphics = pSrcDev->mpGraphics;
@@ -814,7 +814,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
aRect.Justify();
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
- (sal_uInt8*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
+ const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), this );
}
// else draw the substitution graphics
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index fdcb852..36f63ac 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -435,7 +435,7 @@ void OutputDevice::ImplDrawPolyPolygon( const tools::PolyPolygon& rPolyPoly, con
}
else
{
- pPolyPoly = (tools::PolyPolygon*) &rPolyPoly;
+ pPolyPoly = const_cast<tools::PolyPolygon*>(&rPolyPoly);
}
if( pPolyPoly->Count() == 1 )
{
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 113a42e..9b97d1d 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1363,7 +1363,7 @@ SalLayout* OutputDevice::ImplLayout(const OUString& rOrigStr,
pDXPixelArray[i] = pDXArray[i];
}
#else /* !VCL_FLOAT_DEVICE_PIXEL */
- pDXPixelArray = (DeviceCoordinate*)pDXArray;
+ pDXPixelArray = const_cast<DeviceCoordinate*>(pDXArray);
#endif /* !VCL_FLOAT_DEVICE_PIXEL */
}
}
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index e21197d..fc3dc74 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -452,7 +452,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
nRole = accessibility::AccessibleRole::FRAME;
else if( IsScrollable() )
nRole = accessibility::AccessibleRole::SCROLL_PANE;
- else if( ((vcl::Window*)this)->ImplGetWindow()->IsMenuFloatingWindow() )
+ else if( const_cast<vcl::Window*>(this)->ImplGetWindow()->IsMenuFloatingWindow() )
nRole = accessibility::AccessibleRole::WINDOW; // #106002#, contextmenus are windows (i.e. toplevel)
else
// #104051# WINDOW seems to be a bad default role, use LAYEREDPANE instead
@@ -579,7 +579,7 @@ OUString Window::GetAccessibleDescription() const
{
// Special code for help text windows. ZT asks the border window for the
// description so we have to forward this request to our inner window.
- const vcl::Window* pWin = ((vcl::Window *)this)->ImplGetWindow();
+ const vcl::Window* pWin = const_cast<vcl::Window *>(this)->ImplGetWindow();
if ( pWin->GetType() == WINDOW_HELPTEXTWINDOW )
aAccessibleDescription = pWin->GetHelpText();
else
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 31736c4..f7de2d1 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -153,7 +153,7 @@ void VclBuilder::loadTranslations(const LanguageTag &rLanguageTag, const OUStrin
break;
}
- xmlreader::XmlReader reader(const_cast<char *>(sStr.getStr()), sStr.getLength());
+ xmlreader::XmlReader reader(sStr.getStr(), sStr.getLength());
handleTranslations(reader);
break;
}
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
index b2054f8..0c24e30 100644
--- a/vcl/source/window/clipping.cxx
+++ b/vcl/source/window/clipping.cxx
@@ -120,12 +120,12 @@ vcl::Region Window::GetWindowClipRegionPixel( sal_uInt16 nFlags ) const
if ( nFlags & WINDOW_GETCLIPREGION_NOCHILDREN )
{
if ( mpWindowImpl->mbInitWinClipRegion )
- ((vcl::Window*)this)->ImplInitWinClipRegion();
+ const_cast<vcl::Window*>(this)->ImplInitWinClipRegion();
aWinClipRegion = mpWindowImpl->maWinClipRegion;
}
else
{
- vcl::Region* pWinChildClipRegion = ((vcl::Window*)this)->ImplGetWinChildClipRegion();
+ vcl::Region* pWinChildClipRegion = const_cast<vcl::Window*>(this)->ImplGetWinChildClipRegion();
aWinClipRegion = *pWinChildClipRegion;
// --- RTL --- remirror clip region before passing it to somebody
if( ImplIsAntiparallel() )
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5de3bb6..8cdcd0f 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2364,7 +2364,7 @@ void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
bool Menu::GetSystemMenuData( SystemMenuData* pData ) const
{
- Menu* pMenu = (Menu*)this;
+ Menu* pMenu = const_cast<Menu*>(this);
if( pData && pMenu->ImplGetSalMenu() )
{
pMenu->ImplGetSalMenu()->GetSystemMenuData( pData );
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index c777f37..86db812 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -3051,7 +3051,7 @@ long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const
return pSet->mpItems[nPos].mnSize;
else
{
- ((SplitWindow*)this)->ImplCalcLayout();
+ const_cast<SplitWindow*>(this)->ImplCalcLayout();
long nRelSize = 0;
long nPerSize = 0;
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index fc676ed..ee29a8d 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -643,7 +643,7 @@ bool Window::IsTopWindow() const
if( mpWindowImpl->mpWinData->mnIsTopWindow == (sal_uInt16)~0) // still uninitialized
{
// #113722#, cache result of expensive queryInterface call
- vcl::Window *pThisWin = (vcl::Window*)this;
+ vcl::Window *pThisWin = const_cast<vcl::Window*>(this);
uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0;
}
@@ -654,7 +654,7 @@ vcl::Window* Window::FindWindow( const Point& rPos ) const
{
Point aPos = OutputToScreenPixel( rPos );
- return ((vcl::Window*)this)->ImplFindWindow( aPos );
+ return const_cast<vcl::Window*>(this)->ImplFindWindow( aPos );
}
vcl::Window* Window::ImplFindWindow( const Point& rFramePos )
@@ -1079,7 +1079,7 @@ vcl::Window* Window::GetWindow( sal_uInt16 nType ) const
case WINDOW_OVERLAP:
if ( ImplIsOverlapWindow() )
- return (vcl::Window*)this;
+ return const_cast<vcl::Window*>(this);
else
return mpWindowImpl->mpOverlapWindow;
@@ -1090,7 +1090,7 @@ vcl::Window* Window::GetWindow( sal_uInt16 nType ) const
return mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpOverlapWindow;
case WINDOW_CLIENT:
- return ((vcl::Window*)this)->ImplGetWindow();
+ return const_cast<vcl::Window*>(this)->ImplGetWindow();
case WINDOW_REALPARENT:
return ImplGetParent();
@@ -1101,7 +1101,7 @@ vcl::Window* Window::GetWindow( sal_uInt16 nType ) const
case WINDOW_BORDER:
if ( mpWindowImpl->mpBorderWindow )
return mpWindowImpl->mpBorderWindow->GetWindow( WINDOW_BORDER );
- return (vcl::Window*)this;
+ return const_cast<vcl::Window*>(this);
case WINDOW_FIRSTTOPWINDOWCHILD:
return ImplGetWinData()->maTopWindowChildren.empty() ? NULL : *ImplGetWinData()->maTopWindowChildren.begin();
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index e6b7c15..1e92d1d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -212,7 +212,7 @@ void ToolBox::ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop,
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( pThis );
// reserve dragarea only for dockable toolbars
- int dragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? ImplGetDragWidth( (ToolBox*)pThis ) : 0;
+ int dragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? ImplGetDragWidth( const_cast<ToolBox*>(pThis) ) : 0;
// no shadow border for dockable toolbars
int borderwidth = pWrapper ? 0: 2;
@@ -682,39 +682,39 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
{
pThis->mpData->mbAssumeDocked = true; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_TOP, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = true;
+ const_cast<ToolBox*>(pThis)->mbHorz = true;
if ( pThis->mbHorz != bOldHorz )
- ((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
+ const_cast<ToolBox*>(pThis)->meAlign = WINDOWALIGN_TOP;
}
else if ( nCalcMode == TB_CALCMODE_VERT )
{
pThis->mpData->mbAssumeDocked = true; // force non-floating mode during calculation
ImplCalcBorder( WINDOWALIGN_LEFT, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->mbHorz = false;
+ const_cast<ToolBox*>(pThis)->mbHorz = false;
if ( pThis->mbHorz != bOldHorz )
- ((ToolBox*)pThis)->meAlign = WINDOWALIGN_LEFT;
+ const_cast<ToolBox*>(pThis)->meAlign = WINDOWALIGN_LEFT;
}
else if ( nCalcMode == TB_CALCMODE_FLOAT )
{
pThis->mpData->mbAssumeFloating = true; // force non-floating mode during calculation
nLeft = nTop = nRight = nBottom = 0;
- ((ToolBox*)pThis)->mbHorz = true;
+ const_cast<ToolBox*>(pThis)->mbHorz = true;
if ( pThis->mbHorz != bOldHorz )
- ((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP;
+ const_cast<ToolBox*>(pThis)->meAlign = WINDOWALIGN_TOP;
}
if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) ||
(pThis->ImplIsFloatingMode() != bOldFloatingMode ) )
- ((ToolBox*)pThis)->mbCalc = true;
+ const_cast<ToolBox*>(pThis)->mbCalc = true;
}
else
ImplCalcBorder( pThis->meAlign, nLeft, nTop, nRight, nBottom, pThis );
- ((ToolBox*)pThis)->ImplCalcItem();
+ const_cast<ToolBox*>(pThis)->ImplCalcItem();
if( !nCalcMode && pThis->ImplIsFloatingMode() )
{
- aSize = ImplCalcFloatSize( ((ToolBox*)pThis), nCalcLines );
+ aSize = ImplCalcFloatSize( const_cast<ToolBox*>(pThis), nCalcLines );
}
else
{
@@ -732,7 +732,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
aSize.Height() += (TB_BORDER_OFFSET2*2) + nTop + nBottom;
nMax = 0;
- ((ToolBox*)pThis)->ImplCalcBreaks( TB_MAXNOSCROLL, &nMax, pThis->mbHorz );
+ const_cast<ToolBox*>(pThis)->ImplCalcBreaks( TB_MAXNOSCROLL, &nMax, pThis->mbHorz );
if ( nMax )
aSize.Width() += nMax;
@@ -750,7 +750,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
aSize.Width() += (TB_BORDER_OFFSET2*2) + nLeft + nRight;
nMax = 0;
- ((ToolBox*)pThis)->ImplCalcBreaks( TB_MAXNOSCROLL, &nMax, pThis->mbHorz );
+ const_cast<ToolBox*>(pThis)->ImplCalcBreaks( TB_MAXNOSCROLL, &nMax, pThis->mbHorz );
if ( nMax )
aSize.Height() += nMax;
@@ -765,9 +765,9 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
pThis->mpData->mbAssumeFloating = bOldAssumeFloating;
if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) )
{
- ((ToolBox*)pThis)->meAlign = eOldAlign;
- ((ToolBox*)pThis)->mbHorz = bOldHorz;
- ((ToolBox*)pThis)->mbCalc = true;
+ const_cast<ToolBox*>(pThis)->meAlign = eOldAlign;
+ const_cast<ToolBox*>(pThis)->mbHorz = bOldHorz;
+ const_cast<ToolBox*>(pThis)->mbCalc = true;
}
}
@@ -4757,8 +4757,8 @@ sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
{
sal_uInt16 nLines = 0;
- std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin();
- while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
+ std::vector< ImplToolItem >::const_iterator it = const_cast<ToolBox*>(pThis)->mpData->m_aItems.begin();
+ while ( it != const_cast<ToolBox*>(pThis)->mpData->m_aItems.end() )
{
if( it->meType == ToolBoxItemType::BREAK )
++nLines;
@@ -4781,7 +4781,7 @@ Size ToolBox::CalcPopupWindowSizePixel() const
}
bool bPopup = mpData->mbAssumePopupMode;
- ToolBox *pThis = (ToolBox*) this;
+ ToolBox *pThis = const_cast<ToolBox*>(this);
pThis->mpData->mbAssumePopupMode = true;
Size aSize = CalcFloatingWindowSizePixel( nLines );
@@ -4803,11 +4803,11 @@ Size ToolBox::CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const
bool bDocking = mpData->mbAssumeDocked;
// simulate floating mode and force reformat before calculating
- ToolBox *pThis = (ToolBox*) this;
+ ToolBox *pThis = const_cast<ToolBox*>(this);
pThis->mpData->mbAssumeFloating = true;
pThis->mpData->mbAssumeDocked = false;
- Size aSize = ImplCalcFloatSize( (ToolBox*) this, nCalcLines );
+ Size aSize = ImplCalcFloatSize( const_cast<ToolBox*>(this), nCalcLines );
pThis->mbFormat = true;
pThis->mpData->mbAssumeFloating = bFloat;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 5b6553f..0bf0583 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1005,7 +1005,7 @@ Point ToolBox::GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) con
Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
- ((ToolBox*)this)->ImplFormat();
+ const_cast<ToolBox*>(this)->ImplFormat();
sal_uInt16 nPos = GetItemPos( nItemId );
return GetItemPosRect( nPos );
@@ -1014,7 +1014,7 @@ Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const
Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
{
if ( mbCalc || mbFormat )
- ((ToolBox*)this)->ImplFormat();
+ const_cast<ToolBox*>(this)->ImplFormat();
if ( nPos < mpData->m_aItems.size() )
return mpData->m_aItems[nPos].maRect;
@@ -1025,7 +1025,7 @@ Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const
Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
- ((ToolBox*)this)->ImplFormat();
+ const_cast<ToolBox*>(this)->ImplFormat();
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index cb931cb..8d7339f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1247,7 +1247,7 @@ ImplWinData* Window::ImplGetWinData() const
{
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
- ((vcl::Window*)this)->mpWindowImpl->mpWinData = new ImplWinData;
+ const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData = new ImplWinData;
mpWindowImpl->mpWinData->mpExtOldText = NULL;
mpWindowImpl->mpWinData->mpExtOldAttrAry = NULL;
mpWindowImpl->mpWinData->mpCursorRect = NULL;
@@ -2131,9 +2131,9 @@ long Window::CalcTitleWidth() const
// border of external dialogs
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
vcl::Font aFont = GetFont();
- ((vcl::Window*)this)->SetPointFont( rStyleSettings.GetTitleFont() );
+ const_cast<vcl::Window*>(this)->SetPointFont( rStyleSettings.GetTitleFont() );
long nTitleWidth = GetTextWidth( GetText() );
- ((vcl::Window*)this)->SetFont( aFont );
+ const_cast<vcl::Window*>(this)->SetFont( aFont );
nTitleWidth += rStyleSettings.GetTitleHeight() * 3;
nTitleWidth += rStyleSettings.GetBorderSize() * 2;
nTitleWidth += 10;
@@ -2973,14 +2973,14 @@ long Window::ImplGetUnmirroredOutOffX()
Point Window::OutputToNormalizedScreenPixel( const Point& rPos ) const
{
// relative to top level parent
- long offx = ((vcl::Window*) this)->ImplGetUnmirroredOutOffX();
+ long offx = const_cast<vcl::Window*>(this)->ImplGetUnmirroredOutOffX();
return Point( rPos.X()+offx, rPos.Y()+mnOutOffY );
}
Point Window::NormalizedScreenToOutputPixel( const Point& rPos ) const
{
// relative to top level parent
- long offx = ((vcl::Window*) this)->ImplGetUnmirroredOutOffX();
+ long offx = const_cast<vcl::Window*>(this)->ImplGetUnmirroredOutOffX();
return Point( rPos.X()-offx, rPos.Y()-mnOutOffY );
}
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index dcdf0bd..47ecec8 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2729,7 +2729,7 @@ SalColor SalColormap::GetColor( Pixel nPixel ) const
&& m_hColormap
&& m_aVisual.GetDepth() <= 12
&& m_aVisual.GetClass() == PseudoColor )
- ((SalColormap*)this)->GetPalette();
+ const_cast<SalColormap*>(this)->GetPalette();
}
if( !m_aPalette.empty() && nPixel < m_nUsed )
@@ -2789,7 +2789,7 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
&& m_hColormap
&& m_aVisual.GetDepth() <= 12
&& m_aVisual.GetClass() == PseudoColor ) // what else ???
- ((SalColormap*)this)->GetPalette();
+ const_cast<SalColormap*>(this)->GetPalette();
if( !m_aPalette.empty() )
for( Pixel i = 0; i < m_nUsed; i++ )
@@ -2850,7 +2850,7 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
return nSalColor;
}
- ((SalColormap*)this)->GetLookupTable();
+ const_cast<SalColormap*>(this)->GetLookupTable();
}
// Colormatching ueber Palette
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index f301148..fb003fb 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -368,7 +368,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB(
nDstFormat = aSrcBuf.mnFormat;
pDIB = StretchAndConvert( aSrcBuf, aTwoRect, nDstFormat,
- const_cast<BitmapPalette*>(pDstPal), &aSrcBuf.maColorMask );
+ pDstPal, &aSrcBuf.maColorMask );
XDestroyImage( pImage );
}
}
diff --git a/vcl/unx/generic/gdi/xrender_peer.hxx b/vcl/unx/generic/gdi/xrender_peer.hxx
index 84622e8..79609d6 100644
--- a/vcl/unx/generic/gdi/xrender_peer.hxx
+++ b/vcl/unx/generic/gdi/xrender_peer.hxx
@@ -145,7 +145,7 @@ inline void XRenderPeer::AddGlyph( GlyphSet aGS, XRenderGlyph nXRGlyph,
const XGlyphInfo& rGI, const char* pBuffer, int nBufSize ) const
{
XRenderAddGlyphs( mpDisplay, aGS, &nXRGlyph, &rGI, 1,
- const_cast<char*>(pBuffer), nBufSize );
+ pBuffer, nBufSize );
}
inline void XRenderPeer::FreeGlyph( GlyphSet aGS, XRenderGlyph nXRGlyph ) const
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 27886a1..ab0ab95 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1940,8 +1940,8 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
Rectangle button21BoundRect = rScrollbarVal.maButton2Rect; // secondary backward
GtkArrowType button1Type; // backward
GtkArrowType button2Type; // forward
- gchar * scrollbarTagH = (gchar *) "hscrollbar";
- gchar * scrollbarTagV = (gchar *) "vscrollbar";
+ gchar * scrollbarTagH = const_cast<gchar *>("hscrollbar");
+ gchar * scrollbarTagV = const_cast<gchar *>("vscrollbar");
gchar * scrollbarTag = NULL;
Rectangle arrowRect;
gint slider_width = 0;
@@ -2876,7 +2876,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
case CTRL_TAB_PANE:
gtk_paint_box_gap( gWidgetData[m_nXScreen].gNotebookWidget->style, gdkPixmap, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, gWidgetData[m_nXScreen].gNotebookWidget,
- (char *)"notebook", 0, 0, pixmapRect.GetWidth(), pixmapRect.GetHeight(), GTK_POS_TOP, 0, 0 );
+ "notebook", 0, 0, pixmapRect.GetWidth(), pixmapRect.GetHeight(), GTK_POS_TOP, 0, 0 );
break;
case CTRL_TAB_ITEM:
@@ -2896,7 +2896,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
g_object_set_data(G_OBJECT(gdkPixmap),tabPrelitDataName,reinterpret_cast<gpointer>(TRUE));
gtk_paint_extension( gWidgetData[m_nXScreen].gNotebookWidget->style, gdkPixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[m_nXScreen].gNotebookWidget,
- (char *)"tab", (tabRect.Left() - pixmapRect.Left()), (tabRect.Top() - pixmapRect.Top()),
+ "tab", (tabRect.Left() - pixmapRect.Left()), (tabRect.Top() - pixmapRect.Top()),
tabRect.GetWidth(), tabRect.GetHeight(), GTK_POS_BOTTOM );
g_object_steal_data(G_OBJECT(gdkPixmap),tabPrelitDataName);
diff --git a/vcl/unx/gtk/window/gloactiongroup.cxx b/vcl/unx/gtk/window/gloactiongroup.cxx
index 8cbc326..11145e3 100644
--- a/vcl/unx/gtk/window/gloactiongroup.cxx
+++ b/vcl/unx/gtk/window/gloactiongroup.cxx
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list