summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-19 15:18:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-20 08:04:53 +0200
commit1e822e401ea8fe950c7fb62172ac61d8396c98e9 (patch)
tree3a29227adfe1c5ec9209d7e7deb2035633104986
parentb225980d2d65694278c9ed89512fbe21b08febd6 (diff)
use tools::Long in sw
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/AnnotationWin.hxx18
-rw-r--r--sw/inc/EnhancedPDFExportHelper.hxx2
-rw-r--r--sw/inc/PostItMgr.hxx10
-rw-r--r--sw/inc/ToxTabStopTokenHandler.hxx2
-rw-r--r--sw/inc/accmap.hxx2
-rw-r--r--sw/inc/anchoredobject.hxx2
-rw-r--r--sw/inc/calc.hxx3
-rw-r--r--sw/inc/crsrsh.hxx8
-rw-r--r--sw/inc/dbfld.hxx12
-rw-r--r--sw/inc/dbmgr.hxx3
-rw-r--r--sw/inc/dcontact.hxx8
-rw-r--r--sw/inc/doc.hxx8
-rw-r--r--sw/inc/editsh.hxx6
-rw-r--r--sw/inc/fesh.hxx4
-rw-r--r--sw/inc/flddat.hxx6
-rw-r--r--sw/inc/fmtfsize.hxx2
-rw-r--r--sw/inc/htmltbl.hxx6
-rw-r--r--sw/inc/mdiexp.hxx5
-rw-r--r--sw/inc/ndgrf.hxx4
-rw-r--r--sw/inc/ndindex.hxx12
-rw-r--r--sw/inc/ndtxt.hxx6
-rw-r--r--sw/inc/node.hxx6
-rw-r--r--sw/inc/pam.hxx4
-rw-r--r--sw/inc/postithelper.hxx2
-rw-r--r--sw/inc/redline.hxx2
-rw-r--r--sw/inc/shellio.hxx2
-rw-r--r--sw/inc/swatrset.hxx2
-rw-r--r--sw/inc/swcrsr.hxx6
-rw-r--r--sw/inc/swrect.hxx138
-rw-r--r--sw/inc/swtable.hxx12
-rw-r--r--sw/inc/tabcol.hxx39
-rw-r--r--sw/inc/toxwrap.hxx3
-rw-r--r--sw/inc/unotxdoc.hxx4
-rw-r--r--sw/inc/view.hxx24
-rw-r--r--sw/inc/viewsh.hxx12
-rw-r--r--sw/inc/viscrs.hxx4
-rw-r--r--sw/qa/extras/layout/layout.cxx27
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx4
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx6
-rw-r--r--sw/qa/extras/unowriter/unowriter.cxx2
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx6
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx10
-rw-r--r--sw/source/core/access/acccontext.cxx4
-rw-r--r--sw/source/core/access/accmap.cxx8
-rw-r--r--sw/source/core/access/acctable.cxx12
-rw-r--r--sw/source/core/attr/swatrset.cxx2
-rw-r--r--sw/source/core/bastyp/bparr.cxx4
-rw-r--r--sw/source/core/bastyp/swrect.cxx88
-rw-r--r--sw/source/core/bastyp/swregion.cxx8
-rw-r--r--sw/source/core/bastyp/tabcol.cxx4
-rw-r--r--sw/source/core/crsr/DropDownFormFieldButton.cxx5
-rw-r--r--sw/source/core/crsr/callnk.cxx2
-rw-r--r--sw/source/core/crsr/callnk.hxx4
-rw-r--r--sw/source/core/crsr/crsrsh.cxx4
-rw-r--r--sw/source/core/crsr/pam.cxx4
-rw-r--r--sw/source/core/crsr/swcrsr.cxx2
-rw-r--r--sw/source/core/crsr/viscrs.cxx10
-rw-r--r--sw/source/core/doc/CntntIdxStore.cxx10
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx2
-rw-r--r--sw/source/core/doc/DocumentListsManager.cxx2
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx4
-rw-r--r--sw/source/core/doc/DocumentStatisticsManager.cxx4
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx22
-rw-r--r--sw/source/core/doc/doc.cxx4
-rw-r--r--sw/source/core/doc/doccomp.cxx32
-rw-r--r--sw/source/core/doc/docedt.cxx4
-rw-r--r--sw/source/core/doc/docfmt.cxx2
-rw-r--r--sw/source/core/doc/docnum.cxx8
-rw-r--r--sw/source/core/doc/docredln.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx12
-rw-r--r--sw/source/core/doc/fmtcol.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx2
-rw-r--r--sw/source/core/doc/notxtfrm.cxx20
-rw-r--r--sw/source/core/doc/number.cxx10
-rw-r--r--sw/source/core/doc/tblafmt.cxx2
-rw-r--r--sw/source/core/doc/tblcpy.cxx2
-rw-r--r--sw/source/core/doc/tblrwcl.cxx26
-rw-r--r--sw/source/core/docnode/ndtbl.cxx54
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx44
-rw-r--r--sw/source/core/docnode/node.cxx2
-rw-r--r--sw/source/core/docnode/nodes.cxx8
-rw-r--r--sw/source/core/draw/dcontact.cxx8
-rw-r--r--sw/source/core/draw/dflyobj.cxx20
-rw-r--r--sw/source/core/edit/autofmt.cxx2
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/editsh.cxx8
-rw-r--r--sw/source/core/edit/ednumber.cxx4
-rw-r--r--sw/source/core/fields/cellfml.cxx4
-rw-r--r--sw/source/core/fields/docufld.cxx4
-rw-r--r--sw/source/core/fields/flddat.cxx2
-rw-r--r--sw/source/core/fields/postithelper.cxx4
-rw-r--r--sw/source/core/frmedt/fefly1.cxx12
-rw-r--r--sw/source/core/frmedt/feshview.cxx20
-rw-r--r--sw/source/core/frmedt/fetab.cxx24
-rw-r--r--sw/source/core/frmedt/fews.cxx4
-rw-r--r--sw/source/core/frmedt/tblsel.cxx72
-rw-r--r--sw/source/core/inc/DocumentStatisticsManager.hxx3
-rw-r--r--sw/source/core/inc/UndoNumbering.hxx4
-rw-r--r--sw/source/core/inc/UndoRedline.hxx3
-rw-r--r--sw/source/core/inc/UndoTable.hxx5
-rw-r--r--sw/source/core/inc/cellfrm.hxx2
-rw-r--r--sw/source/core/inc/cntfrm.hxx2
-rw-r--r--sw/source/core/inc/dflyobj.hxx4
-rw-r--r--sw/source/core/inc/drawfont.hxx22
-rw-r--r--sw/source/core/inc/flyfrms.hxx2
-rw-r--r--sw/source/core/inc/fntcache.hxx2
-rw-r--r--sw/source/core/inc/frame.hxx124
-rw-r--r--sw/source/core/inc/frmtool.hxx6
-rw-r--r--sw/source/core/inc/layact.hxx2
-rw-r--r--sw/source/core/inc/layfrm.hxx2
-rw-r--r--sw/source/core/inc/pagefrm.hxx2
-rw-r--r--sw/source/core/inc/rootfrm.hxx8
-rw-r--r--sw/source/core/inc/scriptinfo.hxx19
-rw-r--r--sw/source/core/inc/swcache.hxx27
-rw-r--r--sw/source/core/inc/swfont.hxx8
-rw-r--r--sw/source/core/inc/tabfrm.hxx4
-rw-r--r--sw/source/core/inc/tblrwcl.hxx4
-rw-r--r--sw/source/core/inc/txtfly.hxx18
-rw-r--r--sw/source/core/inc/txtfrm.hxx14
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx10
-rw-r--r--sw/source/core/layout/anchoredobject.cxx4
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
-rw-r--r--sw/source/core/layout/calcmove.cxx50
-rw-r--r--sw/source/core/layout/colfrm.cxx6
-rw-r--r--sw/source/core/layout/dbg_lay.cxx6
-rw-r--r--sw/source/core/layout/findfrm.cxx4
-rw-r--r--sw/source/core/layout/flowfrm.cxx8
-rw-r--r--sw/source/core/layout/fly.cxx18
-rw-r--r--sw/source/core/layout/flylay.cxx36
-rw-r--r--sw/source/core/layout/frmtool.cxx20
-rw-r--r--sw/source/core/layout/ftnfrm.cxx8
-rw-r--r--sw/source/core/layout/hffrm.cxx2
-rw-r--r--sw/source/core/layout/layact.cxx26
-rw-r--r--sw/source/core/layout/layhelp.hxx2
-rw-r--r--sw/source/core/layout/newfrm.cxx8
-rw-r--r--sw/source/core/layout/pagechg.cxx56
-rw-r--r--sw/source/core/layout/paintfrm.cxx106
-rw-r--r--sw/source/core/layout/sectfrm.cxx34
-rw-r--r--sw/source/core/layout/ssfrm.cxx50
-rw-r--r--sw/source/core/layout/tabfrm.cxx120
-rw-r--r--sw/source/core/layout/trvlfrm.cxx32
-rw-r--r--sw/source/core/layout/wsfrm.cxx62
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx4
-rw-r--r--sw/source/core/table/swnewtable.cxx158
-rw-r--r--sw/source/core/table/swtable.cxx90
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx14
-rw-r--r--sw/source/core/text/frmcrsr.cxx10
-rw-r--r--sw/source/core/text/frmform.cxx14
-rw-r--r--sw/source/core/text/frminf.cxx2
-rw-r--r--sw/source/core/text/frmpaint.cxx16
-rw-r--r--sw/source/core/text/inftxt.cxx8
-rw-r--r--sw/source/core/text/inftxt.hxx12
-rw-r--r--sw/source/core/text/itradj.cxx28
-rw-r--r--sw/source/core/text/itratr.cxx50
-rw-r--r--sw/source/core/text/itrcrsr.cxx24
-rw-r--r--sw/source/core/text/itrform2.cxx50
-rw-r--r--sw/source/core/text/itrform2.hxx2
-rw-r--r--sw/source/core/text/itrpaint.cxx4
-rw-r--r--sw/source/core/text/itrpaint.hxx2
-rw-r--r--sw/source/core/text/itrtxt.hxx6
-rw-r--r--sw/source/core/text/porfld.cxx12
-rw-r--r--sw/source/core/text/porfld.hxx8
-rw-r--r--sw/source/core/text/porfly.cxx8
-rw-r--r--sw/source/core/text/porfly.hxx6
-rw-r--r--sw/source/core/text/porglue.cxx2
-rw-r--r--sw/source/core/text/porglue.hxx6
-rw-r--r--sw/source/core/text/porlay.cxx36
-rw-r--r--sw/source/core/text/porlay.hxx12
-rw-r--r--sw/source/core/text/porlin.cxx2
-rw-r--r--sw/source/core/text/porlin.hxx2
-rw-r--r--sw/source/core/text/pormulti.cxx20
-rw-r--r--sw/source/core/text/pormulti.hxx16
-rw-r--r--sw/source/core/text/porrst.cxx4
-rw-r--r--sw/source/core/text/portxt.cxx2
-rw-r--r--sw/source/core/text/portxt.hxx2
-rw-r--r--sw/source/core/text/txtdrop.cxx28
-rw-r--r--sw/source/core/text/txtfld.cxx4
-rw-r--r--sw/source/core/text/txtfly.cxx28
-rw-r--r--sw/source/core/text/txtfrm.cxx48
-rw-r--r--sw/source/core/text/txtftn.cxx6
-rw-r--r--sw/source/core/text/txttab.cxx2
-rw-r--r--sw/source/core/tox/ToxTabStopTokenHandler.cxx8
-rw-r--r--sw/source/core/tox/toxhlp.cxx2
-rw-r--r--sw/source/core/txtnode/fntcache.cxx136
-rw-r--r--sw/source/core/txtnode/fntcap.cxx24
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx10
-rw-r--r--sw/source/core/txtnode/swfont.cxx24
-rw-r--r--sw/source/core/undo/unnum.cxx2
-rw-r--r--sw/source/core/undo/unovwr.cxx6
-rw-r--r--sw/source/core/undo/untbl.cxx4
-rw-r--r--sw/source/core/unocore/unofield.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx2
-rw-r--r--sw/source/core/unocore/unotbl.cxx2
-rw-r--r--sw/source/core/unocore/unotext.cxx2
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx2
-rw-r--r--sw/source/core/view/viewpg.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx24
-rw-r--r--sw/source/core/view/vnew.cxx4
-rw-r--r--sw/source/core/view/vprint.cxx6
-rw-r--r--sw/source/filter/ascii/parasc.cxx8
-rw-r--r--sw/source/filter/ascii/wrtasc.cxx2
-rw-r--r--sw/source/filter/basflt/fltshell.cxx8
-rw-r--r--sw/source/filter/html/css1atr.cxx46
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/filter/html/htmldrawreader.cxx4
-rw-r--r--sw/source/filter/html/htmlform.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx10
-rw-r--r--sw/source/filter/html/htmlnumreader.cxx2
-rw-r--r--sw/source/filter/html/htmlplug.cxx32
-rw-r--r--sw/source/filter/html/htmlsect.cxx2
-rw-r--r--sw/source/filter/html/htmltab.cxx12
-rw-r--r--sw/source/filter/html/htmltabw.cxx14
-rw-r--r--sw/source/filter/html/svxcss1.cxx80
-rw-r--r--sw/source/filter/html/svxcss1.hxx8
-rw-r--r--sw/source/filter/html/swhtml.cxx18
-rw-r--r--sw/source/filter/html/wrthtml.hxx4
-rw-r--r--sw/source/filter/inc/fltshell.hxx16
-rw-r--r--sw/source/filter/inc/wrtswtbl.hxx28
-rw-r--r--sw/source/filter/writer/writer.cxx2
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx54
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx12
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx18
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx6
-rw-r--r--sw/source/filter/ww8/escher.hxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx8
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx2
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx4
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx2
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx8
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx20
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx4
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx30
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx50
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par.cxx62
-rw-r--r--sw/source/filter/ww8/ww8par.hxx54
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par2.hxx6
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx28
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx22
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx94
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx96
-rw-r--r--sw/source/filter/ww8/ww8toolbar.cxx6
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx2
-rw-r--r--sw/source/filter/xml/xmlimp.cxx8
-rw-r--r--sw/source/filter/xml/xmltble.cxx2
-rw-r--r--sw/source/filter/xml/xmltbli.cxx2
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx20
-rw-r--r--sw/source/ui/config/optload.cxx2
-rw-r--r--sw/source/ui/config/optpage.cxx22
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx8
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx14
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx6
-rw-r--r--sw/source/ui/envelp/envfmt.cxx32
-rw-r--r--sw/source/ui/envelp/envlop1.cxx36
-rw-r--r--sw/source/ui/envelp/label1.cxx2
-rw-r--r--sw/source/ui/envelp/labfmt.cxx112
-rw-r--r--sw/source/ui/envelp/labfmt.hxx18
-rw-r--r--sw/source/ui/fldui/flddok.cxx2
-rw-r--r--sw/source/ui/frmdlg/column.cxx66
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx16
-rw-r--r--sw/source/ui/index/cntex.cxx4
-rw-r--r--sw/source/ui/index/cnttab.cxx42
-rw-r--r--sw/source/ui/misc/num.cxx32
-rw-r--r--sw/source/ui/misc/outline.cxx46
-rw-r--r--sw/source/ui/misc/pgfnote.cxx6
-rw-r--r--sw/source/ui/misc/pggrid.cxx4
-rw-r--r--sw/source/ui/table/autoformatpreview.cxx2
-rw-r--r--sw/source/ui/table/tabledlg.cxx6
-rw-r--r--sw/source/ui/vba/vbafield.cxx11
-rw-r--r--sw/source/ui/vba/vbatablehelper.cxx2
-rw-r--r--sw/source/uibase/app/appenv.cxx10
-rw-r--r--sw/source/uibase/app/applab.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx2
-rw-r--r--sw/source/uibase/app/docsh2.cxx2
-rw-r--r--sw/source/uibase/app/mainwn.cxx6
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx8
-rw-r--r--sw/source/uibase/dialog/regionsw.cxx6
-rw-r--r--sw/source/uibase/docvw/AnchorOverlayObject.cxx3
-rw-r--r--sw/source/uibase/docvw/AnchorOverlayObject.hxx4
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx6
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx40
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx4
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx12
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx82
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx2
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx26
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx4
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx12
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx22
-rw-r--r--sw/source/uibase/frmdlg/frmmgr.cxx10
-rw-r--r--sw/source/uibase/inc/HeaderFooterWin.hxx2
-rw-r--r--sw/source/uibase/inc/autoformatpreview.hxx8
-rw-r--r--sw/source/uibase/inc/column.hxx12
-rw-r--r--sw/source/uibase/inc/content.hxx12
-rw-r--r--sw/source/uibase/inc/drpcps.hxx6
-rw-r--r--sw/source/uibase/inc/edtwin.hxx8
-rw-r--r--sw/source/uibase/inc/frmmgr.hxx12
-rw-r--r--sw/source/uibase/inc/frmpage.hxx2
-rw-r--r--sw/source/uibase/inc/labrec.hxx16
-rw-r--r--sw/source/uibase/inc/mmconfigitem.hxx3
-rw-r--r--sw/source/uibase/inc/navicont.hxx2
-rw-r--r--sw/source/uibase/inc/numprevw.hxx4
-rw-r--r--sw/source/uibase/inc/pgfnote.hxx2
-rw-r--r--sw/source/uibase/inc/pview.hxx2
-rw-r--r--sw/source/uibase/inc/shdwcrsr.hxx8
-rw-r--r--sw/source/uibase/inc/srcedtw.hxx2
-rw-r--r--sw/source/uibase/inc/swcont.hxx4
-rw-r--r--sw/source/uibase/inc/swuicnttab.hxx2
-rw-r--r--sw/source/uibase/inc/wrtsh.hxx14
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx2
-rw-r--r--sw/source/uibase/misc/swruler.cxx18
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx8
-rw-r--r--sw/source/uibase/shells/annotsh.cxx4
-rw-r--r--sw/source/uibase/shells/drwbassh.cxx4
-rw-r--r--sw/source/uibase/shells/tabsh.cxx22
-rw-r--r--sw/source/uibase/shells/textidx.cxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx6
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.cxx4
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.hxx12
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx22
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.hxx26
-rw-r--r--sw/source/uibase/sidebar/PageMarginUtils.hxx64
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.cxx28
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.hxx4
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/TableEditPanel.cxx4
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx14
-rw-r--r--sw/source/uibase/table/swtablerep.cxx2
-rw-r--r--sw/source/uibase/uitest/uiobject.cxx4
-rw-r--r--sw/source/uibase/uiview/pview.cxx16
-rw-r--r--sw/source/uibase/uiview/scroll.cxx6
-rw-r--r--sw/source/uibase/uiview/srcview.cxx18
-rw-r--r--sw/source/uibase/uiview/swcli.cxx8
-rw-r--r--sw/source/uibase/uiview/view.cxx16
-rw-r--r--sw/source/uibase/uiview/view2.cxx22
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx14
-rw-r--r--sw/source/uibase/uiview/viewport.cxx94
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx10
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx148
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx4
-rw-r--r--sw/source/uibase/utlui/attrdesc.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx4
-rw-r--r--sw/source/uibase/utlui/numfmtlb.cxx2
-rw-r--r--sw/source/uibase/utlui/shdwcrsr.cxx16
-rw-r--r--sw/source/uibase/utlui/uiitems.cxx2
-rw-r--r--sw/source/uibase/utlui/viewlayoutctrl.cxx30
-rw-r--r--sw/source/uibase/wrtsh/move.cxx2
-rw-r--r--sw/source/uibase/wrtsh/select.cxx10
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx8
357 files changed, 2799 insertions, 2782 deletions
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index e55cda17c41c..d384d200d867 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -83,14 +83,14 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
bool IsProtected() const;
void SetSize( const Size& rNewSize );
- void SetPosSizePixelRect( long nX,
- long nY,
- long nWidth,
- long nHeight,
+ void SetPosSizePixelRect( tools::Long nX,
+ tools::Long nY,
+ tools::Long nWidth,
+ tools::Long nHeight,
const SwRect& aAnchorRect,
- const long PageBorder);
+ const tools::Long PageBorder);
void SetPosAndSize();
- void TranslateTopPosition(const long aAmount);
+ void TranslateTopPosition(const tools::Long aAmount);
void CheckMetaText();
Point const & GetAnchorPos() { return mAnchorRect.Pos(); }
@@ -110,7 +110,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
::sw::sidebarwindows::ShadowOverlayObject* Shadow() { return mpShadow.get();}
::sw::overlay::OverlayRanges* TextRange() { return mpTextRangeOverlay.get();}
- long GetPostItTextHeight();
+ tools::Long GetPostItTextHeight();
void SwitchToPostIt(sal_uInt16 aDirection);
void SwitchToFieldPos();
@@ -118,7 +118,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
void ExecuteCommand(sal_uInt16 nSlot);
void InitControls();
void DoResize();
- void ResizeIfNecessary(long aOldHeight, long aNewHeight);
+ void ResizeIfNecessary(tools::Long aOldHeight, tools::Long aNewHeight);
void SetScrollbar();
void SetVirtualPosSize( const Point& aPoint, const Size& aSize);
@@ -254,7 +254,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window
tools::Rectangle mPosSize;
SwRect mAnchorRect;
- long mPageBorder;
+ tools::Long mPageBorder;
bool mbAnchorRectChanged;
bool mbResolvedStateUpdated;
diff --git a/sw/inc/EnhancedPDFExportHelper.hxx b/sw/inc/EnhancedPDFExportHelper.hxx
index 6aa5867377eb..f5a6d5806a13 100644
--- a/sw/inc/EnhancedPDFExportHelper.hxx
+++ b/sw/inc/EnhancedPDFExportHelper.hxx
@@ -117,7 +117,7 @@ struct Por_Info
struct lt_TableColumn
{
- bool operator()( long nVal1, long nVal2 ) const
+ bool operator()( tools::Long nVal1, tools::Long nVal2 ) const
{
return nVal1 + ( MINLAY - 1 ) < nVal2;
}
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 6b3d1161cda3..bbcb862b0190 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -63,7 +63,7 @@ struct SwPostItPageItem
{
bool bScrollbar;
sw::sidebarwindows::SidebarPosition eSidebarPosition;
- long lOffset;
+ tools::Long lOffset;
SwRect mPageRect;
std::vector<SwSidebarItem*> mvSidebarItems;
SwPostItPageItem(): bScrollbar(false), eSidebarPosition( sw::sidebarwindows::SidebarPosition::LEFT ), lOffset(0)
@@ -132,7 +132,7 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener
bool mbWaitingForCalcRects;
VclPtr<sw::annotation::SwAnnotationWin> mpActivePostIt;
bool mbLayout;
- long mbLayoutHeight;
+ tools::Long mbLayoutHeight;
bool mbLayouting;
bool mbReadOnly;
bool mbDeleteNote;
@@ -147,12 +147,12 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener
void AddPostIts(bool bCheckExistence = true,bool bFocus = true);
void RemoveSidebarWin();
void PreparePageContainer();
- void Scroll(const long lScroll,const unsigned long aPage );
+ void Scroll(const tools::Long lScroll,const unsigned long aPage );
void AutoScroll(const sw::annotation::SwAnnotationWin* pPostIt,const unsigned long aPage );
bool ScrollbarHit(const unsigned long aPage,const Point &aPoint);
bool LayoutByPage( std::vector<sw::annotation::SwAnnotationWin*> &aVisiblePostItList,
const tools::Rectangle& rBorder,
- long lNeededHeight);
+ tools::Long lNeededHeight);
void CheckForRemovedPostIts();
bool ArrowEnabled(sal_uInt16 aDirection,unsigned long aPage) const;
bool BorderOverPageBorder(unsigned long aPage) const;
@@ -228,7 +228,7 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener
sw::annotation::SwAnnotationWin* GetNextPostIt( sal_uInt16 aDirection,
sw::annotation::SwAnnotationWin* aPostIt);
- long GetNextBorder();
+ tools::Long GetNextBorder();
sw::annotation::SwAnnotationWin* GetActiveSidebarWin() { return mpActivePostIt; }
void SetActiveSidebarWin( sw::annotation::SwAnnotationWin* p);
diff --git a/sw/inc/ToxTabStopTokenHandler.hxx b/sw/inc/ToxTabStopTokenHandler.hxx
index 5282f6897aaf..158c2129b0ef 100644
--- a/sw/inc/ToxTabStopTokenHandler.hxx
+++ b/sw/inc/ToxTabStopTokenHandler.hxx
@@ -97,7 +97,7 @@ private:
*
* This is the fallback method to determine the position of a tab stop.
*/
- long
+ tools::Long
CalculatePageMarginFromPageDescription(const SwTextNode& targetNode) const;
sal_uInt32 mIndexOfSectionNode;
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 29e5fbfd3303..58f758706cbf 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -264,7 +264,7 @@ public:
virtual bool ReplaceChild (
::accessibility::AccessibleShape* pCurrentChild,
const css::uno::Reference< css::drawing::XShape >& _rxShape,
- const long _nIndex,
+ const tools::Long _nIndex,
const ::accessibility::AccessibleShapeTreeInfo& _rShapeTreeInfo
) override;
virtual ::accessibility::AccessibleControlShape* GetAccControlShapeFromModel
diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index bb65029c97f2..5309602f9ef0 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -268,7 +268,7 @@ class SW_DLLPUBLIC SwAnchoredObject
const SwRect& GetLastCharRect() const { return maLastCharRect;}
SwTwips GetRelCharX( const SwFrame* pFrame ) const;
SwTwips GetRelCharY( const SwFrame* pFrame ) const;
- void AddLastCharY( long nDiff );
+ void AddLastCharY( tools::Long nDiff );
void ResetLastCharRectHeight();
// accessor to member <nmLastTopOfLine>
diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index b7bb83af26a8..dee45a3cbc1d 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -26,6 +26,7 @@
#include <unotools/syslocale.hxx>
#include <rtl/ustrbuf.hxx>
#include <tools/solar.h>
+#include <tools/long.hxx>
#include "swdllapi.h"
class CharClass;
@@ -112,7 +113,7 @@ class SwSbxValue final : public SbxValue
bool m_bDBvalue;
public:
// always default to a number. otherwise it will become a SbxEMPTY
- SwSbxValue( long n = 0 ) : m_bVoid(false), m_bDBvalue(false) { PutLong( n ); }
+ SwSbxValue( tools::Long n = 0 ) : m_bVoid(false), m_bDBvalue(false) { PutLong( n ); }
SwSbxValue( const double& rD ) : m_bVoid(false), m_bDBvalue(false) { PutDouble( rD ); }
bool GetBool() const;
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index d6888bcac2cb..e4d47805a1bf 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -184,9 +184,9 @@ private:
SwNodeIndex* m_pBoxIdx; ///< for recognizing of the changed
SwTableBox* m_pBoxPtr; ///< table row
- long m_nUpDownX; /**< try to move the cursor on up/down always
+ tools::Long m_nUpDownX; /**< try to move the cursor on up/down always
in the same column */
- long m_nLeftFramePos;
+ tools::Long m_nLeftFramePos;
sal_uLong m_nCurrentNode; // save CursorPos at Start-Action
sal_Int32 m_nCurrentContent;
SwNodeType m_nCurrentNdTyp;
@@ -344,7 +344,7 @@ public:
void EndAction( const bool bIdleEnd = false, const bool DoSetPosX = false );
// basic cursor travelling
- long GetUpDownX() const { return m_nUpDownX; }
+ tools::Long GetUpDownX() const { return m_nUpDownX; }
bool Left( sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual = false )
{ return LeftRight( true, nCnt, nMode, bAllowVisual ); }
@@ -680,7 +680,7 @@ public:
sal_uInt16 nSeqNo );
// get the nth character from the start or end of the current selection
- sal_Unicode GetChar( bool bEnd = true, long nOffset = 0 );
+ sal_Unicode GetChar( bool bEnd = true, tools::Long nOffset = 0 );
bool ExtendSelection( bool bEnd = true, sal_Int32 nCount = 1 );
// Place only the visible cursor at the given position in the document.
diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx
index 5d95036246a3..4fabaff6c253 100644
--- a/sw/inc/dbfld.hxx
+++ b/sw/inc/dbfld.hxx
@@ -31,7 +31,7 @@ class SW_DLLPUBLIC SwDBFieldType final : public SwValueFieldType
SwDBData m_aDBData;
OUString m_sName; ///< only used in ::GetName() !
OUString m_sColumn;
- long m_nRefCnt;
+ tools::Long m_nRefCnt;
public:
@@ -265,7 +265,7 @@ public:
// Database field.
class SW_DLLPUBLIC SwDBSetNumberField final : public SwDBNameInfField
{
- long m_nNumber;
+ tools::Long m_nNumber;
public:
SwDBSetNumberField(SwDBSetNumberFieldType*, const SwDBData& rDBData, sal_uInt32 nFormat = 0);
@@ -273,16 +273,16 @@ public:
virtual std::unique_ptr<SwField> Copy() const override;
void Evaluate(const SwDoc&);
- inline long GetSetNumber() const;
- inline void SetSetNumber(long nNum);
+ inline tools::Long GetSetNumber() const;
+ inline void SetSetNumber(tools::Long nNum);
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const override;
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override;
};
-inline long SwDBSetNumberField::GetSetNumber() const
+inline tools::Long SwDBSetNumberField::GetSetNumber() const
{ return m_nNumber; }
-inline void SwDBSetNumberField::SetSetNumber(long nNum)
+inline void SwDBSetNumberField::SetSetNumber(tools::Long nNum)
{ m_nNumber = nNum; }
#endif // INCLUDED_SW_INC_DBFLD_HXX
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 26c7fee7432c..94fd5ba3861f 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -21,6 +21,7 @@
#include <rtl/ustring.hxx>
#include <tools/solar.h>
+#include <tools/long.hxx>
#include <i18nlangtag/lang.h>
#include <com/sun/star/util/Date.hpp>
#include "swdllapi.h"
@@ -108,7 +109,7 @@ struct SwDSParam : public SwDBData
css::uno::Sequence< css::uno::Any > aSelection;
bool bScrollable;
bool bEndOfDB;
- long nSelectionIndex;
+ tools::Long nSelectionIndex;
SwDSParam(const SwDBData& rData) :
SwDBData(rData),
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 09fb15b6a8fd..1082ebc70d94 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -264,14 +264,14 @@ class SwDrawVirtObj final : public SdrVirtObj
virtual void AddToHdlList(SdrHdlList& rHdlList) const override;
virtual void NbcMove(const Size& rSiz) override;
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
- virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override;
+ virtual void NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs) override;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override;
- virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override;
+ virtual void NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) override;
virtual void Move(const Size& rSiz) override;
virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) override;
- virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs) override;
+ virtual void Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs) override;
virtual void Mirror(const Point& rRef1, const Point& rRef2) override;
- virtual void Shear(const Point& rRef, long nAngle, double tn, bool bVShear) override;
+ virtual void Shear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear) override;
virtual void RecalcSnapRect() override;
virtual const tools::Rectangle& GetSnapRect() const override;
virtual void SetSnapRect(const tools::Rectangle& rRect) override;
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 115a08a4b17b..fdcc5e4091f0 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1141,8 +1141,8 @@ public:
/** Move selected paragraphs (not only numberings)
according to offsets. (if negative: go to doc start). */
- bool MoveParagraph(SwPaM&, long nOffset, bool bIsOutlMv = false);
- bool MoveParagraphImpl(SwPaM&, long nOffset, bool bIsOutlMv, SwRootFrame const*);
+ bool MoveParagraph(SwPaM&, tools::Long nOffset, bool bIsOutlMv = false);
+ bool MoveParagraphImpl(SwPaM&, tools::Long nOffset, bool bIsOutlMv, SwRootFrame const*);
bool NumOrNoNum( const SwNodeIndex& rIdx, bool bDel = false);
@@ -1434,10 +1434,10 @@ public:
bool GenerateHTMLDoc( const OUString& rPath, int nOutlineLevel );
// Compare two documents.
- long CompareDoc( const SwDoc& rDoc );
+ tools::Long CompareDoc( const SwDoc& rDoc );
// Merge two documents.
- long MergeDoc( const SwDoc& rDoc );
+ tools::Long MergeDoc( const SwDoc& rDoc );
bool IsAutoFormatRedline() const { return mbIsAutoFormatRedline; }
void SetAutoFormatRedline( bool bFlag ) { mbIsAutoFormatRedline = bFlag; }
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index b2ba48315230..f47edfafa5a1 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -525,7 +525,7 @@ public:
void NumUpDown( bool bDown = true );
- bool MoveParagraph( long nOffset = 1);
+ bool MoveParagraph( tools::Long nOffset = 1);
bool MoveNumParas( bool bUpperLower, bool bUpperLeft );
/// Switch on/off of numbering via Delete/Backspace.
@@ -946,10 +946,10 @@ public:
void UpdateRedlineAttr();
/// Compare two documents.
- long CompareDoc( const SwDoc& rDoc );
+ tools::Long CompareDoc( const SwDoc& rDoc );
/// Merge two documents.
- long MergeDoc( const SwDoc& rDoc );
+ tools::Long MergeDoc( const SwDoc& rDoc );
/// Footnote attributes global to document.
const SwFootnoteInfo& GetFootnoteInfo() const;
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 0639833d0b1e..a363c241d2b1 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -623,7 +623,7 @@ public:
/// Page number of the page containing Point, O if no page.
sal_uInt16 GetPageNumber( const Point &rPoint ) const;
- bool GetPageNumber( long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay ) const;
+ bool GetPageNumber( tools::Long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay ) const;
SwFlyFrameFormat* InsertObject( const svt::EmbeddedObjectRef&,
SfxItemSet* pFlyAttrSet );
@@ -770,7 +770,7 @@ public:
bool IsLastCellInRow() const;
/// Width of current range for column-dialog.
- long GetSectionWidth( SwFormat const & rFormat ) const;
+ tools::Long GetSectionWidth( SwFormat const & rFormat ) const;
void GetConnectableFrameFormats
(SwFrameFormat & rFormat, const OUString & rReference, bool bSuccessors,
diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index 38c16c9039a3..39c00f68a235 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -45,7 +45,7 @@ public:
class SW_DLLPUBLIC SwDateTimeField final : public SwValueField
{
sal_uInt16 m_nSubType;
- long m_nOffset; // Offset in minutes.
+ tools::Long m_nOffset; // Offset in minutes.
virtual OUString ExpandImpl(SwRootFrame const* pLayout) const override;
virtual std::unique_ptr<SwField> Copy() const override;
@@ -62,8 +62,8 @@ public:
virtual void SetPar2(const OUString& rStr) override;
virtual OUString GetPar2() const override;
- void SetOffset(long nMinutes) { m_nOffset = nMinutes; }
- long GetOffset() const { return m_nOffset; }
+ void SetOffset(tools::Long nMinutes) { m_nOffset = nMinutes; }
+ tools::Long GetOffset() const { return m_nOffset; }
Date GetDate() const;
tools::Time GetTime() const;
diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx
index 2eb3dbf13678..cf890371a2f1 100644
--- a/sw/inc/fmtfsize.hxx
+++ b/sw/inc/fmtfsize.hxx
@@ -60,7 +60,7 @@ class SW_DLLPUBLIC SwFormatFrameSize: public SvxSizeItem
// the object is placed (PrtArea) and to the screen width
// minus borders in BrowseView if the environment is the page.
- void ScaleMetrics(long lMult, long lDiv) override;
+ void ScaleMetrics(tools::Long lMult, tools::Long lDiv) override;
bool HasMetrics() const override;
public:
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx
index 7fad4b0fd087..5b59f2a8d71d 100644
--- a/sw/inc/htmltbl.hxx
+++ b/sw/inc/htmltbl.hxx
@@ -280,7 +280,7 @@ public:
sal_uLong GetMin() const { return m_nMin; }
sal_uLong GetMax() const { return m_nMax; }
- inline long GetBrowseWidthMin() const;
+ inline tools::Long GetBrowseWidthMin() const;
bool HasColsOption() const { return m_bColsOption; }
bool HasColTags() const { return m_bColTags; }
@@ -423,9 +423,9 @@ inline void SwHTMLTableLayout::SetCell( std::unique_ptr<SwHTMLTableLayoutCell> p
m_aCells[static_cast<size_t>(nRow)*m_nCols+nCol] = std::move(pCell);
}
-inline long SwHTMLTableLayout::GetBrowseWidthMin() const
+inline tools::Long SwHTMLTableLayout::GetBrowseWidthMin() const
{
- return static_cast<long>( (!m_nWidthOption || m_bPercentWidthOption) ? m_nMin : m_nRelTabWidth );
+ return static_cast<tools::Long>( (!m_nWidthOption || m_bPercentWidthOption) ? m_nMin : m_nRelTabWidth );
}
void SwHTMLTableLayout::SetInhBorderWidths( sal_uInt16 nLeft, sal_uInt16 nRight )
diff --git a/sw/inc/mdiexp.hxx b/sw/inc/mdiexp.hxx
index 3715c6702f78..eee934b66ddf 100644
--- a/sw/inc/mdiexp.hxx
+++ b/sw/inc/mdiexp.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_MDIEXP_HXX
#include <rtl/ustring.hxx>
+#include <tools/long.hxx>
#include "tblenum.hxx"
#include "swdllapi.h"
@@ -41,9 +42,9 @@ extern void PageNumNotify( SwViewShell const * pVwSh,
enum FlyMode { FLY_DRAG_START, FLY_DRAG, FLY_DRAG_END };
extern void FrameNotify( SwViewShell* pVwSh, FlyMode eMode = FLY_DRAG );
-SW_DLLPUBLIC void StartProgress(const char* pMessId, long nStartVal, long nEndVal, SwDocShell *pDocSh = nullptr);
+SW_DLLPUBLIC void StartProgress(const char* pMessId, tools::Long nStartVal, tools::Long nEndVal, SwDocShell *pDocSh = nullptr);
SW_DLLPUBLIC void EndProgress ( SwDocShell const *pDocSh );
-SW_DLLPUBLIC void SetProgressState ( long nPosition, SwDocShell const *pDocShell );
+SW_DLLPUBLIC void SetProgressState ( tools::Long nPosition, SwDocShell const *pDocShell );
void RescheduleProgress( SwDocShell const *pDocShell );
void RepaintPagePreview( SwViewShell const * pVwSh, const SwRect& rRect );
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index ee53db6a7c3c..afaf8936558c 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -82,9 +82,9 @@ public:
void SetGraphic(const Graphic& rGraphic);
/// wrappers for non-const calls at GraphicObject
- void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData, OutputDevice* pFirstFrameOutDev)
+ void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, tools::Long nExtraData, OutputDevice* pFirstFrameOutDev)
{ maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pFirstFrameOutDev); }
- void StopGraphicAnimation(const OutputDevice* pOut, long nExtraData) { maGrfObj.StopAnimation(pOut, nExtraData); }
+ void StopGraphicAnimation(const OutputDevice* pOut, tools::Long nExtraData) { maGrfObj.StopAnimation(pOut, nExtraData); }
virtual Size GetTwipSize() const override;
void SetTwipSize( const Size& rSz );
diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index 274bc4b2014c..303a7801ca6f 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -56,7 +56,7 @@ public:
{
RegisterIndex( rNds );
};
- SwNodeIndex( const SwNodeIndex& rIdx, long nDiff = 0 )
+ SwNodeIndex( const SwNodeIndex& rIdx, tools::Long nDiff = 0 )
: sw::Ring<SwNodeIndex>()
{
if( nDiff )
@@ -66,7 +66,7 @@ public:
RegisterIndex( m_pNode->GetNodes() );
}
- SwNodeIndex( const SwNode& rNd, long nDiff = 0 )
+ SwNodeIndex( const SwNode& rNd, tools::Long nDiff = 0 )
{
if( nDiff )
m_pNode = rNd.GetNodes()[ rNd.GetIndex() + nDiff ];
@@ -109,7 +109,7 @@ public:
// Enables assignments without creation of a temporary object.
inline SwNodeIndex& Assign( SwNodes const & rNds, sal_uLong );
- inline SwNodeIndex& Assign( const SwNode& rNd, long nOffset = 0 );
+ inline SwNodeIndex& Assign( const SwNode& rNd, tools::Long nOffset = 0 );
// Gets pointer on NodesArray.
inline const SwNodes& GetNodes() const;
@@ -140,9 +140,9 @@ public:
SwNodeRange( SwNodes& rNds, sal_uLong nSttIdx, sal_uLong nEndIdx = 0 )
: aStart( rNds, nSttIdx ), aEnd( rNds, nEndIdx ) {};
- SwNodeRange( const SwNodeIndex& rS, long nSttDiff, const SwNodeIndex& rE, long nEndDiff = 0 )
+ SwNodeRange( const SwNodeIndex& rS, tools::Long nSttDiff, const SwNodeIndex& rE, tools::Long nEndDiff = 0 )
: aStart( rS, nSttDiff ), aEnd( rE, nEndDiff ) {};
- SwNodeRange( const SwNode& rS, long nSttDiff, const SwNode& rE, long nEndDiff = 0 )
+ SwNodeRange( const SwNode& rS, tools::Long nSttDiff, const SwNode& rE, tools::Long nEndDiff = 0 )
: aStart( rS, nSttDiff ), aEnd( rE, nEndDiff ) {};
};
@@ -275,7 +275,7 @@ SwNodeIndex& SwNodeIndex::Assign( SwNodes const & rNds, sal_uLong nIdx )
return *this;
}
-SwNodeIndex& SwNodeIndex::Assign( const SwNode& rNd, long nOffset )
+SwNodeIndex& SwNodeIndex::Assign( const SwNode& rNd, tools::Long nOffset )
{
*this = rNd;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index e2d3dde7f887..539db67906cf 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -471,7 +471,7 @@ public:
@return additional indents
*/
- long GetLeftMarginWithNum( bool bTextLeft = false ) const;
+ tools::Long GetLeftMarginWithNum( bool bTextLeft = false ) const;
/**
Returns the combined first line indent of this text node and
@@ -494,7 +494,7 @@ public:
Needed for text formatting
Method considers new list level attributes, which also can provide a left margin value
*/
- long GetLeftMarginForTabCalculation() const;
+ tools::Long GetLeftMarginForTabCalculation() const;
/** Returns if this text node has a number.
@@ -654,7 +654,7 @@ public:
@return boolean - indicating, if a list tab stop position is provided
*/
- bool GetListTabStopPosition( long& nListTabStopPosition ) const;
+ bool GetListTabStopPosition( tools::Long& nListTabStopPosition ) const;
/** Retrieves the character following the list label, if the paragraph's
list level defines one.
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 7c052e037d7d..e1ed5c9a03ac 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -99,8 +99,8 @@ private:
Merge m_eMerge;
#ifdef DBG_UTIL
- static long s_nSerial;
- long m_nSerial;
+ static tools::Long s_nSerial;
+ tools::Long m_nSerial;
#endif
/// all SwFrameFormat that are anchored at the node
@@ -122,7 +122,7 @@ public:
virtual ~SwNode() override = 0;
#ifdef DBG_UTIL
- long GetSerial() const { return m_nSerial; }
+ tools::Long GetSerial() const { return m_nSerial; }
#endif
sal_uInt16 GetSectionLevel() const;
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 8c0a8abe6de9..7e64a4665a9f 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -147,9 +147,9 @@ public:
explicit SwPaM( const SwPosition& rPos, SwPaM* pRing = nullptr );
SwPaM( const SwPosition& rMk, const SwPosition& rPt, SwPaM* pRing = nullptr );
SwPaM( const SwNodeIndex& rMk, const SwNodeIndex& rPt,
- long nMkOffset = 0, long nPtOffset = 0, SwPaM* pRing = nullptr );
+ tools::Long nMkOffset = 0, tools::Long nPtOffset = 0, SwPaM* pRing = nullptr );
SwPaM( const SwNode& rMk, const SwNode& rPt,
- long nMkOffset = 0, long nPtOffset = 0, SwPaM* pRing = nullptr );
+ tools::Long nMkOffset = 0, tools::Long nPtOffset = 0, SwPaM* pRing = nullptr );
SwPaM( const SwNodeIndex& rMk, sal_Int32 nMkContent,
const SwNodeIndex& rPt, sal_Int32 nPtContent, SwPaM* pRing = nullptr );
SwPaM( const SwNode& rMk, sal_Int32 nMkContent,
diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx
index 935549ac786d..fb946b969c87 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -86,7 +86,7 @@ namespace SwPostItHelper
const SwPosition& rAnchorPos,
const sw::mark::IMark* pAnnotationMark = nullptr );
- long getLayoutHeight( const SwRootFrame* pRoot );
+ tools::Long getLayoutHeight( const SwRootFrame* pRoot );
void setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode );
unsigned long getPageInfo( SwRect& rPageFrame, const SwRootFrame* , const Point& );
}
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 95cab2924272..8fbded6e61f1 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -261,7 +261,7 @@ public:
bool operator<( const SwRangeRedline& ) const;
void dumpAsXml(xmlTextWriterPtr pWriter) const;
- void MaybeNotifyRedlinePositionModification(long nTop);
+ void MaybeNotifyRedlinePositionModification(tools::Long nTop);
};
void MaybeNotifyRedlineModification(SwRangeRedline& rRedline, SwDoc& rDoc);
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 46529ceb7394..d05293c45365 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -458,7 +458,7 @@ public:
// Stream-specific routines. Do not use in storage-writer!
// Optimizing output on stream.
- static SvStream& OutLong( SvStream& rStrm, long nVal );
+ static SvStream& OutLong( SvStream& rStrm, tools::Long nVal );
static SvStream& OutULong( SvStream& rStrm, sal_uLong nVal );
void SetStream(SvStream *const pStream);
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index fc9f034bcc69..02b16c80b75d 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -319,7 +319,7 @@ public:
};
//Helper for filters to find true lineheight of a font
-SW_DLLPUBLIC long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
+SW_DLLPUBLIC tools::Long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
const SwAttrSet &rSet,
const vcl::RenderContext &rOut, sal_Int16 nScript);
#endif
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 4ed649e85681..9aa390386221 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -72,7 +72,7 @@ class SW_DLLPUBLIC SwCursor : public SwPaM
friend class SwCursorSaveState;
std::vector<SwCursor_SavePos> m_vSavePos; // the current entry is the last element
- long m_nRowSpanOffset; // required for travelling in tabs with rowspans
+ tools::Long m_nRowSpanOffset; // required for travelling in tabs with rowspans
sal_uInt8 m_nCursorBidiLevel; // bidi level of the cursor
bool m_bColumnSelection; // true: cursor is aprt of a column selection
@@ -163,7 +163,7 @@ public:
virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
bool bAllowVisual, bool bSkipHidden, bool bInsertCursor,
SwRootFrame const* pLayout, bool isFieldNames);
- bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, long nUpDownX, SwRootFrame & rLayout);
+ bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, tools::Long nUpDownX, SwRootFrame & rLayout);
bool LeftRightMargin(SwRootFrame const& rLayout, bool bLeftMargin, bool bAPI);
bool IsAtLeftRightMargin(SwRootFrame const& rLayout, bool bLeftMargin, bool bAPI) const;
bool SttEndDoc( bool bSttDoc );
@@ -214,7 +214,7 @@ public:
bool IsColumnSelection() const { return m_bColumnSelection; }
void SetColumnSelection( bool bNew ) { m_bColumnSelection = bNew; }
- long GetCursorRowSpanOffset() const { return m_nRowSpanOffset; }
+ tools::Long GetCursorRowSpanOffset() const { return m_nRowSpanOffset; }
SwCursor* GetNext() { return dynamic_cast<SwCursor *>(GetNextInRing()); }
const SwCursor* GetNext() const { return dynamic_cast<SwCursor const *>(GetNextInRing()); }
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index 79a5be6649a9..a9c5a79c023f 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -42,7 +42,7 @@ public:
inline SwRect( const SwRect &rRect );
inline SwRect( const Point& rLT, const Size& rSize );
inline SwRect( const Point& rLT, const Point& rRB );
- inline SwRect( long X, long Y, long Width, long Height );
+ inline SwRect( tools::Long X, tools::Long Y, tools::Long Width, tools::Long Height );
//SV-SS e.g. SwRect( pWin->GetClipRect() );
SwRect( const tools::Rectangle &rRect );
@@ -50,25 +50,25 @@ public:
//Set-Methods
inline void Chg( const Point& rNP, const Size &rNS );
inline void Pos( const Point& rNew );
- inline void Pos( const long nNewX, const long nNewY );
+ inline void Pos( const tools::Long nNewX, const tools::Long nNewY );
inline void SSize( const Size& rNew );
- inline void SSize( const long nHeight, const long nWidth );
- inline void Width( long nNew );
- inline void Height( long nNew );
- inline void Left( const long nLeft );
- inline void Right( const long nRight );
- inline void Top( const long nTop );
- inline void Bottom( const long nBottom );
+ inline void SSize( const tools::Long nHeight, const tools::Long nWidth );
+ inline void Width( tools::Long nNew );
+ inline void Height( tools::Long nNew );
+ inline void Left( const tools::Long nLeft );
+ inline void Right( const tools::Long nRight );
+ inline void Top( const tools::Long nTop );
+ inline void Bottom( const tools::Long nBottom );
//Get-Methods
inline const Point &Pos() const;
inline const Size &SSize() const;
- inline long Width() const;
- inline long Height() const;
- inline long Left() const;
- inline long Right() const;
- inline long Top() const;
- inline long Bottom() const;
+ inline tools::Long Width() const;
+ inline tools::Long Height() const;
+ inline tools::Long Left() const;
+ inline tools::Long Right() const;
+ inline tools::Long Top() const;
+ inline tools::Long Bottom() const;
// In order to be able to access the members of Pos and SSize from the layout side.
inline Point &Pos();
@@ -84,7 +84,7 @@ public:
SwRect &Intersection_( const SwRect &rRect );
bool IsInside( const Point& rPOINT ) const;
- bool IsNear(const Point& rPoint, long nTolerance ) const;
+ bool IsNear(const Point& rPoint, tools::Long nTolerance ) const;
bool IsInside( const SwRect& rRect ) const;
bool IsOver( const SwRect& rRect ) const;
inline bool HasArea() const;
@@ -106,32 +106,32 @@ public:
friend SvStream& WriteSwRect( SvStream &rStream, const SwRect &rRect );
void dumpAsXmlAttributes(xmlTextWriterPtr writer) const;
- void Top_( const long nTop );
- void Bottom_( const long nBottom );
- void Left_( const long nLeft );
- void Right_( const long nRight );
- void Width_( const long nNew );
- void Height_( const long nNew );
- long Top_() const;
- long Bottom_() const;
- long Left_() const;
- long Right_() const;
- long Width_() const;
- long Height_() const;
- void SubTop( const long nSub );
- void AddTop( const long nAdd );
- void AddBottom( const long nAdd );
- void AddLeft( const long nAdd );
- void SubLeft( const long nSub );
- void AddRight( const long nAdd );
- void AddWidth( const long nAdd );
- void AddHeight( const long nAdd );
- void SetPosX( const long nNew );
- void SetPosY( const long nNew );
- void SetLeftAndWidth( long nLeft, long nNew );
- void SetTopAndHeight( long nTop, long nNew );
- void SetRightAndWidth( long nRight, long nNew );
- void SetBottomAndHeight( long nBottom, long nNew );
+ void Top_( const tools::Long nTop );
+ void Bottom_( const tools::Long nBottom );
+ void Left_( const tools::Long nLeft );
+ void Right_( const tools::Long nRight );
+ void Width_( const tools::Long nNew );
+ void Height_( const tools::Long nNew );
+ tools::Long Top_() const;
+ tools::Long Bottom_() const;
+ tools::Long Left_() const;
+ tools::Long Right_() const;
+ tools::Long Width_() const;
+ tools::Long Height_() const;
+ void SubTop( const tools::Long nSub );
+ void AddTop( const tools::Long nAdd );
+ void AddBottom( const tools::Long nAdd );
+ void AddLeft( const tools::Long nAdd );
+ void SubLeft( const tools::Long nSub );
+ void AddRight( const tools::Long nAdd );
+ void AddWidth( const tools::Long nAdd );
+ void AddHeight( const tools::Long nAdd );
+ void SetPosX( const tools::Long nNew );
+ void SetPosY( const tools::Long nNew );
+ void SetLeftAndWidth( tools::Long nLeft, tools::Long nNew );
+ void SetTopAndHeight( tools::Long nTop, tools::Long nNew );
+ void SetRightAndWidth( tools::Long nRight, tools::Long nNew );
+ void SetBottomAndHeight( tools::Long nBottom, tools::Long nNew );
void SetUpperLeftCorner( const Point& rNew );
void SetUpperRightCorner( const Point& rNew );
void SetLowerLeftCorner( const Point& rNew );
@@ -141,23 +141,23 @@ public:
Point BottomLeft() const;
Point BottomRight() const;
Size SwappedSize() const;
- long GetLeftDistance( long ) const;
- long GetBottomDistance( long ) const;
- long GetRightDistance( long ) const;
- long GetTopDistance( long ) const;
- bool OverStepLeft( long ) const;
- bool OverStepBottom( long ) const;
- bool OverStepTop( long ) const;
- bool OverStepRight( long ) const;
+ tools::Long GetLeftDistance( tools::Long ) const;
+ tools::Long GetBottomDistance( tools::Long ) const;
+ tools::Long GetRightDistance( tools::Long ) const;
+ tools::Long GetTopDistance( tools::Long ) const;
+ bool OverStepLeft( tools::Long ) const;
+ bool OverStepBottom( tools::Long ) const;
+ bool OverStepTop( tools::Long ) const;
+ bool OverStepRight( tools::Long ) const;
};
-typedef void (SwRect::*SwRectSet)( const long nNew );
+typedef void (SwRect::*SwRectSet)( const tools::Long nNew );
typedef long (SwRect::*SwRectGet)() const;
typedef Point (SwRect::*SwRectPoint)() const;
typedef Size (SwRect::*SwRectSize)() const;
-typedef bool (SwRect::*SwRectMax)( long ) const;
-typedef long (SwRect::*SwRectDist)( long ) const;
-typedef void (SwRect::*SwRectSetTwice)( long, long );
+typedef bool (SwRect::*SwRectMax)( tools::Long ) const;
+typedef long (SwRect::*SwRectDist)( tools::Long ) const;
+typedef void (SwRect::*SwRectSetTwice)( tools::Long, tools::Long );
typedef void (SwRect::*SwRectSetPos)( const Point& );
// Set-Methods
@@ -170,7 +170,7 @@ inline void SwRect::Pos( const Point& rNew )
{
m_Point = rNew;
}
-inline void SwRect::Pos( const long nNewX, const long nNewY )
+inline void SwRect::Pos( const tools::Long nNewX, const tools::Long nNewY )
{
m_Point.setX(nNewX);
m_Point.setY(nNewY);
@@ -179,34 +179,34 @@ inline void SwRect::SSize( const Size& rNew )
{
m_Size = rNew;
}
-inline void SwRect::SSize( const long nNewHeight, const long nNewWidth )
+inline void SwRect::SSize( const tools::Long nNewHeight, const tools::Long nNewWidth )
{
m_Size.setWidth(nNewWidth);
m_Size.setHeight(nNewHeight);
}
-inline void SwRect::Width( long nNew )
+inline void SwRect::Width( tools::Long nNew )
{
m_Size.setWidth(nNew);
}
-inline void SwRect::Height( long nNew )
+inline void SwRect::Height( tools::Long nNew )
{
m_Size.setHeight(nNew);
}
-inline void SwRect::Left( const long nLeft )
+inline void SwRect::Left( const tools::Long nLeft )
{
m_Size.AdjustWidth( m_Point.getX() - nLeft );
m_Point.setX(nLeft);
}
-inline void SwRect::Right( const long nRight )
+inline void SwRect::Right( const tools::Long nRight )
{
m_Size.setWidth(nRight - m_Point.getX() + 1);
}
-inline void SwRect::Top( const long nTop )
+inline void SwRect::Top( const tools::Long nTop )
{
m_Size.AdjustHeight( m_Point.getY() - nTop );
m_Point.setY(nTop);
}
-inline void SwRect::Bottom( const long nBottom )
+inline void SwRect::Bottom( const tools::Long nBottom )
{
m_Size.setHeight(nBottom - m_Point.getY() + 1);
}
@@ -224,27 +224,27 @@ inline const Size &SwRect::SSize() const
{
return m_Size;
}
-inline long SwRect::Width() const
+inline tools::Long SwRect::Width() const
{
return m_Size.Width();
}
-inline long SwRect::Height() const
+inline tools::Long SwRect::Height() const
{
return m_Size.Height();
}
-inline long SwRect::Left() const
+inline tools::Long SwRect::Left() const
{
return m_Point.X();
}
-inline long SwRect::Right() const
+inline tools::Long SwRect::Right() const
{
return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : m_Point.getX();
}
-inline long SwRect::Top() const
+inline tools::Long SwRect::Top() const
{
return m_Point.Y();
}
-inline long SwRect::Bottom() const
+inline tools::Long SwRect::Bottom() const
{
return m_Size.getHeight() ? m_Point.getY() + m_Size.getHeight() - 1 : m_Point.getY();
}
@@ -322,7 +322,7 @@ inline SwRect::SwRect( const Point& rLT, const Point& rRB ) :
m_Size( rRB.X() - rLT.X() + 1, rRB.Y() - rLT.Y() + 1 )
{
}
-inline SwRect::SwRect( long X, long Y, long W, long H ) :
+inline SwRect::SwRect( tools::Long X, tools::Long Y, tools::Long W, tools::Long H ) :
m_Point( X, Y ),
m_Size( W, H )
{
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 9694db0113ef..a101cfeeb85e 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -165,7 +165,7 @@ private:
bool InsertRow_( SwDoc*, const SwSelBoxes&, sal_uInt16 nCnt, bool bBehind );
bool NewInsertCol( SwDoc&, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool );
void FindSuperfluousRows_( SwSelBoxes& rBoxes, SwTableLine*, SwTableLine* );
- void AdjustWidths( const long nOld, const long nNew );
+ void AdjustWidths( const tools::Long nOld, const tools::Long nNew );
void NewSetTabCols( Parm &rP, const SwTabCols &rNew, const SwTabCols &rOld,
const SwTableBox *pStart, bool bCurRowOnly );
void ConvertSubtableBox(sal_uInt16 const nRow, sal_uInt16 const nBox);
@@ -241,8 +241,8 @@ public:
}
bool PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwSelBoxes& rMerged, SwTableBox** ppMergeBox, SwUndoTableMerge* pUndo );
- void ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax ) const;
- void PrepareDeleteCol( long nMin, long nMax );
+ void ExpandColumnSelection( SwSelBoxes& rBoxes, tools::Long &rMin, tools::Long &rMax ) const;
+ void PrepareDeleteCol( tools::Long nMin, tools::Long nMax );
bool InsertCol( SwDoc&, const SwSelBoxes& rBoxes,
sal_uInt16 nCnt, bool bBehind );
@@ -404,7 +404,7 @@ class SW_DLLPUBLIC SwTableBox: public SwClient //Client of FrameFormat.
std::unique_ptr<Color> mpUserColor;
std::unique_ptr<Color> mpNumFormatColor;
- long mnRowSpan;
+ tools::Long mnRowSpan;
bool mbDummyFlag;
/// Do we contain any direct formatting?
@@ -483,8 +483,8 @@ public:
inline void SetSaveUserColor(const Color* p );
inline void SetSaveNumFormatColor( const Color* p );
- long getRowSpan() const;
- void setRowSpan( long nNewRowSpan );
+ tools::Long getRowSpan() const;
+ void setRowSpan( tools::Long nNewRowSpan );
bool getDummyFlag() const;
void setDummyFlag( bool bDummy );
diff --git a/sw/inc/tabcol.hxx b/sw/inc/tabcol.hxx
index 0a4a990c378c..ec9c9b101859 100644
--- a/sw/inc/tabcol.hxx
+++ b/sw/inc/tabcol.hxx
@@ -23,12 +23,13 @@
#include <memory>
#include "swdllapi.h"
+#include <tools/long.hxx>
struct SwTabColsEntry
{
- long nPos;
- long nMin;
- long nMax;
+ tools::Long nPos;
+ tools::Long nMin;
+ tools::Long nMax;
bool bHidden; // For each entry a flag, hidden or not.
// If the flag bHidden is true column separator
// is not in current line. It must maintained
@@ -39,12 +40,12 @@ typedef std::vector< SwTabColsEntry > SwTabColsEntries;
class SW_DLLPUBLIC SwTabCols
{
- long m_nLeftMin; // Leftmost border (reference point) for
+ tools::Long m_nLeftMin; // Leftmost border (reference point) for
// document coordinates.
// All other values are relative to this point!
- long m_nLeft; // Left border of table.
- long m_nRight; // Right border of table.
- long m_nRightMax; // Maximum right border of table.
+ tools::Long m_nLeft; // Left border of table.
+ tools::Long m_nRight; // Right border of table.
+ tools::Long m_nRightMax; // Maximum right border of table.
bool m_bLastRowAllowedToChange; // If the last row of the table frame
// is split across pages, it may not
@@ -59,29 +60,29 @@ public:
SwTabCols( sal_uInt16 nSize = 0 );
SwTabCols( const SwTabCols& );
SwTabCols &operator=( const SwTabCols& );
- long& operator[]( size_t nPos ) { return m_aData[nPos].nPos; }
- long operator[]( size_t nPos ) const { return m_aData[nPos].nPos; }
+ tools::Long& operator[]( size_t nPos ) { return m_aData[nPos].nPos; }
+ tools::Long operator[]( size_t nPos ) const { return m_aData[nPos].nPos; }
size_t Count() const { return m_aData.size(); }
bool IsHidden( size_t nPos ) const { return m_aData[nPos].bHidden; }
void SetHidden( size_t nPos, bool bValue ) { m_aData[nPos].bHidden = bValue; }
- void Insert( long nValue, bool bValue, size_t nPos );
- void Insert( long nValue, long nMin, long nMax, bool bValue, size_t nPos );
+ void Insert( tools::Long nValue, bool bValue, size_t nPos );
+ void Insert( tools::Long nValue, tools::Long nMin, tools::Long nMax, bool bValue, size_t nPos );
void Remove( size_t nPos, size_t nCount = 1 );
const SwTabColsEntry& GetEntry( size_t nPos ) const { return m_aData[nPos]; }
SwTabColsEntry& GetEntry( size_t nPos ) { return m_aData[nPos]; }
- long GetLeftMin() const { return m_nLeftMin; }
- long GetLeft() const { return m_nLeft; }
- long GetRight() const { return m_nRight; }
- long GetRightMax()const { return m_nRightMax;}
+ tools::Long GetLeftMin() const { return m_nLeftMin; }
+ tools::Long GetLeft() const { return m_nLeft; }
+ tools::Long GetRight() const { return m_nRight; }
+ tools::Long GetRightMax()const { return m_nRightMax;}
- void SetLeftMin ( long nNew ) { m_nLeftMin = nNew; }
- void SetLeft ( long nNew ) { m_nLeft = nNew; }
- void SetRight ( long nNew ) { m_nRight = nNew; }
- void SetRightMax( long nNew ) { m_nRightMax = nNew;}
+ void SetLeftMin ( tools::Long nNew ) { m_nLeftMin = nNew; }
+ void SetLeft ( tools::Long nNew ) { m_nLeft = nNew; }
+ void SetRight ( tools::Long nNew ) { m_nRight = nNew; }
+ void SetRightMax( tools::Long nNew ) { m_nRightMax = nNew;}
bool IsLastRowAllowedToChange() const { return m_bLastRowAllowedToChange; }
void SetLastRowAllowedToChange( bool bNew ) { m_bLastRowAllowedToChange = bNew; }
diff --git a/sw/inc/toxwrap.hxx b/sw/inc/toxwrap.hxx
index 71feadb6fcf5..63a09b323ff0 100644
--- a/sw/inc/toxwrap.hxx
+++ b/sw/inc/toxwrap.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
+#include <tools/long.hxx>
#include "swdllapi.h"
namespace com::sun::star::i18n { class XExtendedIndexEntrySupplier; }
@@ -47,7 +48,7 @@ public:
GetAlgorithmList( const css::lang::Locale& rLcl ) const;
bool LoadAlgorithm( const css::lang::Locale& rLcl,
- const OUString& sSortAlgorithm, long nOptions ) const;
+ const OUString& sSortAlgorithm, tools::Long nOptions ) const;
sal_Int16 CompareIndexEntry( const OUString& rText1, const OUString& rTextReading1,
const css::lang::Locale& rLcl1,
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index c44174cbe99b..1f814a915b05 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -393,8 +393,8 @@ public:
int nOutputHeight,
int nTilePosX,
int nTilePosY,
- long nTileWidth,
- long nTileHeight ) override;
+ tools::Long nTileWidth,
+ tools::Long nTileHeight ) override;
/// @see vcl::ITiledRenderable::getDocumentSize().
virtual Size getDocumentSize() override;
/// @see vcl::ITiledRenderable::setPart().
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 85ab3f1c930f..8513b6c7e171 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -73,9 +73,9 @@ namespace com::sun::star::view { class XSelectionSupplier; }
namespace sfx2 { class FileDialogHelper; }
namespace sw::mark { class IFieldmark; }
-const long nLeftOfst = -370;
-const long nScrollX = 30;
-const long nScrollY = 30;
+const tools::Long nLeftOfst = -370;
+const tools::Long nScrollX = 30;
+const tools::Long nScrollY = 30;
#define MINZOOM 20
#define MAXZOOM 600
@@ -264,8 +264,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
- inline long GetXScroll() const;
- inline long GetYScroll() const;
+ inline tools::Long GetXScroll() const;
+ inline tools::Long GetYScroll() const;
SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
SAL_DLLPRIVATE void CalcPt( Point* pPt,const tools::Rectangle& rRect,
sal_uInt16 nRangeX,
@@ -371,7 +371,7 @@ public:
virtual SdrView* GetDrawView() const override;
virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
virtual void ShowCursor( bool bOn = true ) override;
- virtual ErrCode DoVerb( long nVerb ) override;
+ virtual ErrCode DoVerb( tools::Long nVerb ) override;
virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
@@ -415,8 +415,8 @@ public:
sal_uInt16 nRangeX = USHRT_MAX,
sal_uInt16 nRangeY = USHRT_MAX);
- long SetVScrollMax(long lMax);
- long SetHScrollMax(long lMax);
+ tools::Long SetVScrollMax(tools::Long lMax);
+ tools::Long SetHScrollMax(tools::Long lMax);
void SpellError(LanguageType eLang);
bool ExecSpellPopup( const Point& rPt );
@@ -576,11 +576,11 @@ public:
bool JumpToSwMark( const OUString& rMark );
- long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
+ tools::Long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
const OUString& rFilterName, sal_Int16 nVersion = 0 );
void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
- long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
+ tools::Long InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion );
DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper *, void );
// status methods for clipboard.
@@ -674,12 +674,12 @@ public:
void SetOldDrwCat(const OUString& sStr);
};
-inline long SwView::GetXScroll() const
+inline tools::Long SwView::GetXScroll() const
{
return (m_aVisArea.GetWidth() * nScrollX) / 100;
}
-inline long SwView::GetYScroll() const
+inline tools::Long SwView::GetYScroll() const
{
return (m_aVisArea.GetHeight() * nScrollY) / 100;
}
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 57fae99e99ba..e5a6ae810a49 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -73,8 +73,8 @@ namespace vcl
// Define for flags needed in ctor or layers below.
// Currently the Preview flag is needed for DrawPage.
-#define VSHELLFLAG_ISPREVIEW (long(0x1))
-#define VSHELLFLAG_SHARELAYOUT (long(0x2))
+#define VSHELLFLAG_ISPREVIEW (tools::Long(0x1))
+#define VSHELLFLAG_SHARELAYOUT (tools::Long(0x2))
typedef std::shared_ptr<SwRootFrame> SwRootFramePtr;
typedef struct _xmlTextWriter* xmlTextWriterPtr;
@@ -233,7 +233,7 @@ public:
Sets the pOut so that the rRect is always painted over the entire
pOut, ie. starts in 0,0 and ends in width/height.
*/
- void PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, long tileWidth, long tileHeight);
+ void PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, tools::Long tileWidth, tools::Long tileHeight);
bool IsPaintInProgress() const { return mbPaintInProgress; }
bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); }
@@ -243,7 +243,7 @@ public:
// The passed rect is situated on pixel borders
// in order to avoid pixel errors when scrolling.
virtual void VisPortChgd( const SwRect & );
- bool SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle* );//Browser
+ bool SmoothScroll( tools::Long lXDiff, tools::Long lYDiff, const tools::Rectangle* );//Browser
void EnableSmooth( bool b ) { mbEnableSmooth = b; }
const SwRect& VisArea() const;
@@ -540,10 +540,10 @@ public:
SwAccessibleMap* GetAccessibleMap();
SwViewShell( SwViewShell&, vcl::Window *pWin, OutputDevice *pOut = nullptr,
- long nFlags = 0 );
+ tools::Long nFlags = 0 );
SwViewShell( SwDoc& rDoc, vcl::Window *pWin,
const SwViewOption *pOpt, OutputDevice *pOut = nullptr,
- long nFlags = 0 );
+ tools::Long nFlags = 0 );
virtual ~SwViewShell() override;
sal_Int32 GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const;
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 36cf0ceb8eef..95c013b233ca 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -71,7 +71,7 @@ class SwSelPaintRects : public SwRects
friend void InitCore();
friend void FinitCore();
- static long s_nPixPtX, s_nPixPtY;
+ static tools::Long s_nPixPtX, s_nPixPtY;
static MapMode *s_pMapMode;
const SwCursorShell* m_pCursorShell;
@@ -110,7 +110,7 @@ public:
// check current MapMode of the shell and set possibly the static members.
// Optional set the parameters pX, pY
static void Get1PixelInLogic( const SwViewShell& rSh,
- long* pX = nullptr, long* pY = nullptr );
+ tools::Long* pX = nullptr, tools::Long* pY = nullptr );
};
class SW_DLLPUBLIC SwShellCursor : public virtual SwCursor, public SwSelPaintRects
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 428878d8e85b..95891b40d7b1 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -851,15 +851,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025)
CPPUNIT_ASSERT(pFrameFormat);
// The shape has these values to copy to the associated text frame after modification::
- const long nLPaddng = xShapeProps->getPropertyValue("TextLeftDistance").get<long>();
- const long nRPaddng = xShapeProps->getPropertyValue("TextRightDistance").get<long>();
- const long nTPaddng = xShapeProps->getPropertyValue("TextUpperDistance").get<long>();
- const long nBPaddng = xShapeProps->getPropertyValue("TextLowerDistance").get<long>();
+ const tools::Long nLPaddng = xShapeProps->getPropertyValue("TextLeftDistance").get<long>();
+ const tools::Long nRPaddng = xShapeProps->getPropertyValue("TextRightDistance").get<long>();
+ const tools::Long nTPaddng = xShapeProps->getPropertyValue("TextUpperDistance").get<long>();
+ const tools::Long nBPaddng = xShapeProps->getPropertyValue("TextLowerDistance").get<long>();
- CPPUNIT_ASSERT_EQUAL(long(1000), nLPaddng);
- CPPUNIT_ASSERT_EQUAL(long(2000), nRPaddng);
- CPPUNIT_ASSERT_EQUAL(long(3000), nTPaddng);
- CPPUNIT_ASSERT_EQUAL(long(4001), nBPaddng);
+ CPPUNIT_ASSERT_EQUAL(tools::Long(1000), nLPaddng);
+ CPPUNIT_ASSERT_EQUAL(tools::Long(2000), nRPaddng);
+ CPPUNIT_ASSERT_EQUAL(tools::Long(3000), nTPaddng);
+ CPPUNIT_ASSERT_EQUAL(tools::Long(4001), nBPaddng);
// TODO: modify shape distance via UNO with text frame synchronization
// Check the textbox as well:
@@ -867,10 +867,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025)
CPPUNIT_ASSERT(xTxFrm);
uno::Reference<beans::XPropertySet> xFrameProps(xTxFrm, uno::UNO_QUERY);
- const long nFrameLeftPaddng = xFrameProps->getPropertyValue("LeftBorderDistance").get<long>();
- const long nFrameRightPaddng = xFrameProps->getPropertyValue("RightBorderDistance").get<long>();
- const long nFrameTopPaddng = xFrameProps->getPropertyValue("TopBorderDistance").get<long>();
- const long nFrameBottomPaddng
+ const tools::Long nFrameLeftPaddng
+ = xFrameProps->getPropertyValue("LeftBorderDistance").get<long>();
+ const tools::Long nFrameRightPaddng
+ = xFrameProps->getPropertyValue("RightBorderDistance").get<long>();
+ const tools::Long nFrameTopPaddng
+ = xFrameProps->getPropertyValue("TopBorderDistance").get<long>();
+ const tools::Long nFrameBottomPaddng
= xFrameProps->getPropertyValue("BottomBorderDistance").get<long>();
// Check if the shape and frame have different setting
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 27a651d2dde7..5b22f0ea274b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -820,7 +820,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123104, "tdf123104.docx")
// See SwXCell::getPropertyValue(), we really put 'long' into an Any there.
// Without the accompanying fix in place, this test would have failed with 'Expected: 3;Actual :
// 2', i.e. the vertical merge covered one less cell, resulting in a cell with white background.
- CPPUNIT_ASSERT_EQUAL(static_cast<long>(3), getProperty<long>(xCell, "RowSpan"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(3), getProperty<tools::Long>(xCell, "RowSpan"));
}
DECLARE_OOXMLEXPORT_TEST(testFdo85542, "fdo85542.docx")
@@ -1174,7 +1174,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97371, "tdf97371.docx")
SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
SdrObject* pShape = pPage->GetObj(0);
SdrObject* pTextBox = pPage->GetObj(1);
- long nDiff = std::abs(pShape->GetSnapRect().Top() - pTextBox->GetSnapRect().Top());
+ tools::Long nDiff = std::abs(pShape->GetSnapRect().Top() - pTextBox->GetSnapRect().Top());
// The top of the two shapes were 410 and 3951, now it should be 3950 and 3951.
CPPUNIT_ASSERT(nDiff < 10);
}
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index f2969c14402f..8e7a9adffd62 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2396,8 +2396,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testImageComment)
const SwSortedObjs& rAnchored = *pTextFrame->GetDrawObjs();
CPPUNIT_ASSERT_GREATER(static_cast<size_t>(0), rAnchored.size());
SwAnchoredObject* pObject = rAnchored[0];
- long nFrameLeft = pObject->GetObjRect().Left();
- long nFrameTop = pObject->GetObjRect().Top();
+ tools::Long nFrameLeft = pObject->GetObjRect().Left();
+ tools::Long nFrameTop = pObject->GetObjRect().Top();
// Make sure that the anchor points to the bottom left corner of the image.
// Without the accompanying fix in place, this test would have failed with:
@@ -2878,7 +2878,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf105330)
// Without the accompanying fix in place, height was only 1 twips (practically invisible).
// Require at least 12pt height (font size under the cursor), in twips.
CPPUNIT_ASSERT_GREATEREQUAL(
- static_cast<long>(240),
+ static_cast<tools::Long>(240),
pWrtShell->GetVisibleCursor()->GetTextCursor().GetSize().getHeight());
}
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index 5d17fc33a1f5..895728bd412f 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -747,7 +747,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testImageCommentAtChar)
for (const auto& pItem : *pPostItMgr)
{
const SwRect& rAnchor = pItem->mpPostIt->GetAnchorRect();
- CPPUNIT_ASSERT_GREATEREQUAL(static_cast<long>(5892), rAnchor.Left());
+ CPPUNIT_ASSERT_GREATEREQUAL(static_cast<tools::Long>(5892), rAnchor.Left());
}
}
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index f811fc5200e1..bded9504b579 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -279,7 +279,7 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_pageRightRTL, "tdf80635_pageRightRTL.doc")
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient"));
- CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(3500), getProperty<long>(xTable, "LeftMargin"), 100);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", tools::Long(3500), getProperty<tools::Long>(xTable, "LeftMargin"), 100);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix me? Text probably should wrap here", 2, getPages() );
// If so, replace test with the table set to a greater preferred width so that the text shouldn't wrap
}
@@ -301,7 +301,7 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_marginLeft, "tdf80635_marginLeft.doc")
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
// This was just the GetMinLeft of -199
- CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(-2950), getProperty<long>(xTable, "LeftMargin"), 100);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", tools::Long(-2950), getProperty<tools::Long>(xTable, "LeftMargin"), 100);
}
DECLARE_WW8EXPORT_TEST(testTdf80635_pageLeft, "tdf80635_pageLeft.doc")
@@ -311,7 +311,7 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_pageLeft, "tdf80635_pageLeft.doc")
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
// This was just the GetMinLeft of -199
- CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(-2750), getProperty<long>(xTable, "LeftMargin"), 100);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", tools::Long(-2750), getProperty<tools::Long>(xTable, "LeftMargin"), 100);
}
DECLARE_WW8EXPORT_TEST(testTdf99197_defaultLTR, "tdf99197_defaultLTR.doc")
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 9afe9cbb4cb4..9cbae7f83a3a 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -160,8 +160,8 @@ DECLARE_WW8IMPORT_TEST(testTdf121734, "tdf121734.doc")
CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_LR_SPACE, false, &pItem));
auto pLR = static_cast<const SvxLRSpaceItem*>(pItem);
CPPUNIT_ASSERT(pLR);
- CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetLeft());
- CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetRight());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0), pLR->GetLeft());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0), pLR->GetRight());
CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_UL_SPACE, false, &pItem));
auto pUL = static_cast<const SvxULSpaceItem*>(pItem);
@@ -197,7 +197,7 @@ DECLARE_WW8IMPORT_TEST(testTdf125281, "tdf125281.doc")
// Without the accompanying fix in place, this test would have failed, as pref size was 0 till
// an actual Paint() was performed (and even then, it was wrong).
- long nExpected = 25664;
+ tools::Long nExpected = 25664;
CPPUNIT_ASSERT_EQUAL(nExpected, rGraphic.GetPrefSize().getWidth());
// Without the accompanying fix in place, this test would have failed, as setting the pref size
@@ -227,8 +227,8 @@ DECLARE_WW8IMPORT_TEST(testTdf122425_1, "tdf122425_1.doc")
CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_LR_SPACE, false, &pItem));
auto pLR = static_cast<const SvxLRSpaceItem*>(pItem);
CPPUNIT_ASSERT(pLR);
- CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetLeft());
- CPPUNIT_ASSERT_EQUAL(long(0), pLR->GetRight());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0), pLR->GetLeft());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0), pLR->GetRight());
CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, rFormat.GetItemState(RES_UL_SPACE, false, &pItem));
auto pUL = static_cast<const SvxULSpaceItem*>(pItem);
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 14c76002e73a..e36b89a890b0 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -793,8 +793,8 @@ void SAL_CALL SwAccessibleContext::removeAccessibleEventListener(
static bool lcl_PointInRectangle(const awt::Point & aPoint,
const awt::Rectangle & aRect)
{
- long nDiffX = aPoint.X - aRect.X;
- long nDiffY = aPoint.Y - aRect.Y;
+ tools::Long nDiffX = aPoint.X - aRect.X;
+ tools::Long nDiffY = aPoint.Y - aRect.Y;
return
nDiffX >= 0 && nDiffX < aRect.Width && nDiffY >= 0 &&
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index ce88aa618665..f45c30224b41 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -3125,7 +3125,7 @@ Size SwAccessibleMap::LogicToPixel( const Size& rSize ) const
bool SwAccessibleMap::ReplaceChild (
::accessibility::AccessibleShape* pCurrentChild,
const uno::Reference< drawing::XShape >& _rxShape,
- const long /*_nIndex*/,
+ const tools::Long /*_nIndex*/,
const ::accessibility::AccessibleShapeTreeInfo& /*_rShapeTreeInfo*/
)
{
@@ -3240,10 +3240,10 @@ Point SwAccessibleMap::PixelToCore( const Point& rPoint ) const
return aPoint;
}
-static long lcl_CorrectCoarseValue(long aCoarseValue, long aFineValue,
- long aRefValue, bool bToLower)
+static tools::Long lcl_CorrectCoarseValue(tools::Long aCoarseValue, tools::Long aFineValue,
+ tools::Long aRefValue, bool bToLower)
{
- long aResult = aCoarseValue;
+ tools::Long aResult = aCoarseValue;
if (bToLower)
{
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 457e5451dc3b..4a1ff7d98656 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -1567,10 +1567,10 @@ sal_Bool SAL_CALL SwAccessibleTable::selectRow( sal_Int32 row )
if( isAccessibleColumnSelected( row ) )
return true;
- long lColumnCount = getAccessibleColumnCount();
- for(long lCol = 0; lCol < lColumnCount; lCol ++)
+ tools::Long lColumnCount = getAccessibleColumnCount();
+ for(tools::Long lCol = 0; lCol < lColumnCount; lCol ++)
{
- long lChildIndex = getAccessibleIndex(row, lCol);
+ tools::Long lChildIndex = getAccessibleIndex(row, lCol);
selectAccessibleChild(lChildIndex);
}
@@ -1583,11 +1583,11 @@ sal_Bool SAL_CALL SwAccessibleTable::selectColumn( sal_Int32 column )
if( isAccessibleColumnSelected( column ) )
return true;
- long lRowCount = getAccessibleRowCount();
+ tools::Long lRowCount = getAccessibleRowCount();
- for(long lRow = 0; lRow < lRowCount; lRow ++)
+ for(tools::Long lRow = 0; lRow < lRowCount; lRow ++)
{
- long lChildIndex = getAccessibleIndex(lRow, column);
+ tools::Long lChildIndex = getAccessibleIndex(lRow, column);
selectAccessibleChild(lChildIndex);
}
return true;
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index e2c96e069879..6ebd4120989c 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -75,7 +75,7 @@ void SwAttrPool::createAndAddSecondaryPools()
// #75371# change DefaultItems for the SdrEdgeObj distance items
// to TWIPS.
// 1/100th mm in twips
- const long nDefEdgeDist = (500 * 72) / 127;
+ const tools::Long nDefEdgeDist = (500 * 72) / 127;
pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 1e8ecaa83a3b..6b7aa28edb44 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -18,7 +18,7 @@
*/
#include <bparr.hxx>
-
+#include <tools/long.hxx>
#include <limits.h>
#include <string.h>
@@ -413,7 +413,7 @@ sal_uInt16 BigPtrArray::Compress()
sal_uInt16 nFirstChgPos = USHRT_MAX; // at which position was the 1st change?
// convert fill percentage into number of remaining elements
- short const nMax = MAXENTRY - long(MAXENTRY) * COMPRESSLVL / 100;
+ short const nMax = MAXENTRY - tools::Long(MAXENTRY) * COMPRESSLVL / 100;
for( sal_uInt16 cur = 0; cur < m_nBlock; ++cur )
{
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index d443c85d99c3..3809c2113c04 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -44,7 +44,7 @@ SwRect& SwRect::Union( const SwRect& rRect )
Top( rRect.Top() );
if ( Left() > rRect.Left() )
Left( rRect.Left() );
- long n = rRect.Right();
+ tools::Long n = rRect.Right();
if ( Right() < n )
Right( n );
n = rRect.Bottom();
@@ -63,7 +63,7 @@ SwRect& SwRect::Intersection( const SwRect& rRect )
Left( rRect.Left() );
if ( Top() < rRect.Top() )
Top( rRect.Top() );
- long n = rRect.Right();
+ tools::Long n = rRect.Right();
if ( Right() > n )
Right( n );
n = rRect.Bottom();
@@ -82,7 +82,7 @@ SwRect& SwRect::Intersection_( const SwRect& rOther )
// get smaller right and lower, and greater left and upper edge
auto left = std::max( m_Point.X(), rOther.m_Point.X() );
auto top = std::max( m_Point.Y(), rOther.m_Point.Y() );
- long right = std::min( m_Point.X() + m_Size.Width(), rOther.m_Point.X() + rOther.m_Size.Width() );
+ tools::Long right = std::min( m_Point.X() + m_Size.Width(), rOther.m_Point.X() + rOther.m_Size.Width() );
auto bottom = std::min( m_Point.Y() + m_Size.Height(), rOther.m_Point.Y() + rOther.m_Size.Height() );
*this = SwRect( left, top, right - left, bottom - top );
@@ -92,10 +92,10 @@ SwRect& SwRect::Intersection_( const SwRect& rOther )
bool SwRect::IsInside( const SwRect& rRect ) const
{
- const long nRight = Right();
- const long nBottom = Bottom();
- const long nrRight = rRect.Right();
- const long nrBottom= rRect.Bottom();
+ const tools::Long nRight = Right();
+ const tools::Long nBottom = Bottom();
+ const tools::Long nrRight = rRect.Right();
+ const tools::Long nrBottom= rRect.Bottom();
return (Left() <= rRect.Left()) && (rRect.Left()<= nRight) &&
(Left() <= nrRight) && (nrRight <= nRight) &&
(Top() <= rRect.Top()) && (rRect.Top() <= nBottom) &&
@@ -111,7 +111,7 @@ bool SwRect::IsInside( const Point& rPoint ) const
}
// mouse moving of table borders
-bool SwRect::IsNear( const Point& rPoint, long nTolerance ) const
+bool SwRect::IsNear( const Point& rPoint, tools::Long nTolerance ) const
{
bool bIsNearby = (((Left() - nTolerance) <= rPoint.X()) &&
((Top() - nTolerance) <= rPoint.Y()) &&
@@ -143,30 +143,30 @@ void SwRect::Justify()
}
// Similar to the inline methods, but we need the function pointers
-void SwRect::Width_( const long nNew ) { m_Size.setWidth(nNew); }
-void SwRect::Height_( const long nNew ) { m_Size.setHeight(nNew); }
-void SwRect::Left_( const long nLeft ){ m_Size.AdjustWidth(m_Point.getX() - nLeft ); m_Point.setX(nLeft); }
-void SwRect::Right_( const long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); }
-void SwRect::Top_( const long nTop ){ m_Size.AdjustHeight(m_Point.getY() - nTop ); m_Point.setY(nTop); }
-void SwRect::Bottom_( const long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); }
-
-long SwRect::Width_() const{ return m_Size.getWidth(); }
-long SwRect::Height_() const{ return m_Size.getHeight(); }
-long SwRect::Left_() const{ return m_Point.getX(); }
-long SwRect::Right_() const{ return m_Point.getX() + m_Size.getWidth(); }
-long SwRect::Top_() const{ return m_Point.getY(); }
-long SwRect::Bottom_() const{ return m_Point.getY() + m_Size.getHeight(); }
-
-void SwRect::AddWidth( const long nAdd ) { m_Size.AdjustWidth(nAdd ); }
-void SwRect::AddHeight( const long nAdd ) { m_Size.AdjustHeight(nAdd ); }
-void SwRect::AddLeft( const long nAdd ){ m_Size.AdjustWidth(-nAdd ); m_Point.setX(m_Point.getX() + nAdd); }
-void SwRect::SubLeft( const long nSub ){ m_Size.AdjustWidth(nSub ); m_Point.setX(m_Point.getX() - nSub); }
-void SwRect::AddRight( const long nAdd ){ m_Size.AdjustWidth(nAdd ); }
-void SwRect::AddTop( const long nAdd ){ m_Size.AdjustHeight(-nAdd ); m_Point.setY(m_Point.getY() + nAdd); }
-void SwRect::SubTop( const long nSub ){ m_Size.AdjustHeight(nSub ); m_Point.setY(m_Point.getY() - nSub); }
-void SwRect::AddBottom( const long nAdd ){ m_Size.AdjustHeight(nAdd ); }
-void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); }
-void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); }
+void SwRect::Width_( const tools::Long nNew ) { m_Size.setWidth(nNew); }
+void SwRect::Height_( const tools::Long nNew ) { m_Size.setHeight(nNew); }
+void SwRect::Left_( const tools::Long nLeft ){ m_Size.AdjustWidth(m_Point.getX() - nLeft ); m_Point.setX(nLeft); }
+void SwRect::Right_( const tools::Long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); }
+void SwRect::Top_( const tools::Long nTop ){ m_Size.AdjustHeight(m_Point.getY() - nTop ); m_Point.setY(nTop); }
+void SwRect::Bottom_( const tools::Long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); }
+
+tools::Long SwRect::Width_() const{ return m_Size.getWidth(); }
+tools::Long SwRect::Height_() const{ return m_Size.getHeight(); }
+tools::Long SwRect::Left_() const{ return m_Point.getX(); }
+tools::Long SwRect::Right_() const{ return m_Point.getX() + m_Size.getWidth(); }
+tools::Long SwRect::Top_() const{ return m_Point.getY(); }
+tools::Long SwRect::Bottom_() const{ return m_Point.getY() + m_Size.getHeight(); }
+
+void SwRect::AddWidth( const tools::Long nAdd ) { m_Size.AdjustWidth(nAdd ); }
+void SwRect::AddHeight( const tools::Long nAdd ) { m_Size.AdjustHeight(nAdd ); }
+void SwRect::AddLeft( const tools::Long nAdd ){ m_Size.AdjustWidth(-nAdd ); m_Point.setX(m_Point.getX() + nAdd); }
+void SwRect::SubLeft( const tools::Long nSub ){ m_Size.AdjustWidth(nSub ); m_Point.setX(m_Point.getX() - nSub); }
+void SwRect::AddRight( const tools::Long nAdd ){ m_Size.AdjustWidth(nAdd ); }
+void SwRect::AddTop( const tools::Long nAdd ){ m_Size.AdjustHeight(-nAdd ); m_Point.setY(m_Point.getY() + nAdd); }
+void SwRect::SubTop( const tools::Long nSub ){ m_Size.AdjustHeight(nSub ); m_Point.setY(m_Point.getY() - nSub); }
+void SwRect::AddBottom( const tools::Long nAdd ){ m_Size.AdjustHeight(nAdd ); }
+void SwRect::SetPosX( const tools::Long nNew ){ m_Point.setX(nNew); }
+void SwRect::SetPosY( const tools::Long nNew ){ m_Point.setY(nNew); }
Size SwRect::Size_() const { return SSize(); }
Size SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
@@ -177,36 +177,36 @@ Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY()
Point SwRect::BottomRight() const
{ return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() + m_Size.getHeight() ); }
-long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLimit; }
-long SwRect::GetBottomDistance( long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();}
-long SwRect::GetTopDistance( long nLimit ) const { return m_Point.getY() - nLimit; }
-long SwRect::GetRightDistance( long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); }
+tools::Long SwRect::GetLeftDistance( tools::Long nLimit ) const { return m_Point.getX() - nLimit; }
+tools::Long SwRect::GetBottomDistance( tools::Long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();}
+tools::Long SwRect::GetTopDistance( tools::Long nLimit ) const { return m_Point.getY() - nLimit; }
+tools::Long SwRect::GetRightDistance( tools::Long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); }
-bool SwRect::OverStepLeft( long nLimit ) const
+bool SwRect::OverStepLeft( tools::Long nLimit ) const
{ return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
-bool SwRect::OverStepBottom( long nLimit ) const
+bool SwRect::OverStepBottom( tools::Long nLimit ) const
{ return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
-bool SwRect::OverStepTop( long nLimit ) const
+bool SwRect::OverStepTop( tools::Long nLimit ) const
{ return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
-bool SwRect::OverStepRight( long nLimit ) const
+bool SwRect::OverStepRight( tools::Long nLimit ) const
{ return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
-void SwRect::SetLeftAndWidth( long nLeft, long nNew )
+void SwRect::SetLeftAndWidth( tools::Long nLeft, tools::Long nNew )
{
m_Point.setX(nLeft);
m_Size.setWidth(nNew);
}
-void SwRect::SetTopAndHeight( long nTop, long nNew )
+void SwRect::SetTopAndHeight( tools::Long nTop, tools::Long nNew )
{
m_Point.setY(nTop);
m_Size.setHeight(nNew);
}
-void SwRect::SetRightAndWidth( long nRight, long nNew )
+void SwRect::SetRightAndWidth( tools::Long nRight, tools::Long nNew )
{
m_Point.setX(nRight - nNew);
m_Size.setWidth(nNew);
}
-void SwRect::SetBottomAndHeight( long nBottom, long nNew )
+void SwRect::SetBottomAndHeight( tools::Long nBottom, tools::Long nNew )
{
m_Point.setY(nBottom - nNew);
m_Size.setHeight(nNew);
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index f2fb006d9006..09e07757b236 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -74,10 +74,10 @@ void SwRegionRects::operator-=( const SwRect &rRect )
// now split; only those rectangles should be left over that are in
// the "old" but not in the "new" area; hence, not in intersection.
- long nTmp = aInter.Top() - aTmp.Top();
+ tools::Long nTmp = aInter.Top() - aTmp.Top();
if ( 0 < nTmp )
{
- const long nOldVal = aTmp.Height();
+ const tools::Long nOldVal = aTmp.Height();
aTmp.Height(nTmp);
InsertRect( aTmp, i, bDel );
aTmp.Height( nOldVal );
@@ -92,7 +92,7 @@ void SwRegionRects::operator-=( const SwRect &rRect )
nTmp = aInter.Left() - aTmp.Left();
if ( 0 < nTmp )
{
- const long nOldVal = aTmp.Width();
+ const tools::Long nOldVal = aTmp.Width();
aTmp.Width( nTmp );
InsertRect( aTmp, i, bDel );
aTmp.Width( nOldVal );
@@ -171,7 +171,7 @@ void SwRegionRects::Compress()
// paints), the area of the union can be a little bit larger:
// ( 9622 * 141.5 = 1361513 ~= a quarter (1/4) centimeter wider
// than the width of an A4 page
- const long nFuzzy = 1361513;
+ const tools::Long nFuzzy = 1361513;
SwRect aUnion( (*this)[i] );
aUnion.Union( (*this)[j] );
SwRect aInter( (*this)[i] );
diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx
index 0ecbb10693fd..cb01a5e3c3ae 100644
--- a/sw/source/core/bastyp/tabcol.cxx
+++ b/sw/source/core/bastyp/tabcol.cxx
@@ -55,7 +55,7 @@ SwTabCols &SwTabCols::operator=( const SwTabCols& rCpy )
return *this;
}
-void SwTabCols::Insert( long nValue, long nMin, long nMax,
+void SwTabCols::Insert( tools::Long nValue, tools::Long nMin, tools::Long nMax,
bool bValue, size_t nPos )
{
SwTabColsEntry aEntry;
@@ -66,7 +66,7 @@ void SwTabCols::Insert( long nValue, long nMin, long nMax,
m_aData.insert( m_aData.begin() + nPos, aEntry );
}
-void SwTabCols::Insert( long nValue, bool bValue, size_t nPos )
+void SwTabCols::Insert( tools::Long nValue, bool bValue, size_t nPos )
{
SwTabColsEntry aEntry;
aEntry.nPos = nValue;
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index 9d7453dae5ff..5a876f907f96 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -57,13 +57,14 @@ private:
DECL_STATIC_LINK(SwFieldDialog, KeyInputHdl, const KeyEvent&, bool);
public:
- SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, long nMinListWidth);
+ SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, tools::Long nMinListWidth);
virtual ~SwFieldDialog() override;
virtual void dispose() override;
};
}
-SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, long nMinListWidth)
+SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM,
+ tools::Long nMinListWidth)
: FloatingWindow(parent, WB_BORDER | WB_SYSTEMWINDOW)
, m_xListBox(VclPtr<SwFieldListBox>::Create(this))
, m_pFieldmark(fieldBM)
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index a59c9c6aac61..8c585524470e 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -220,7 +220,7 @@ SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE
m_rShell.GetFlyMacroLnk().Call( pFlyFrame->GetFormat() );
}
-long SwCallLink::getLayoutFrame(const SwRootFrame* pRoot,
+tools::Long SwCallLink::getLayoutFrame(const SwRootFrame* pRoot,
SwTextNode const & rNd, sal_Int32 nCntPos, bool /*bCalcFrame*/)
{
SwTextFrame* pFrame = static_cast<SwTextFrame*>(rNd.getLayoutFrame(pRoot, nullptr, nullptr));
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index 24149191711a..713f469bb6cc 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -34,13 +34,13 @@ public:
sal_uLong m_nNode;
sal_Int32 m_nContent;
SwNodeType m_nNodeType;
- long m_nLeftFramePos;
+ tools::Long m_nLeftFramePos;
bool m_bHasSelection;
explicit SwCallLink( SwCursorShell & rSh );
~SwCallLink() COVERITY_NOEXCEPT_FALSE;
- static long getLayoutFrame( const SwRootFrame*, SwTextNode const & rNd, sal_Int32 nCntPos, bool bCalcFrame );
+ static tools::Long getLayoutFrame( const SwRootFrame*, SwTextNode const & rNd, sal_Int32 nCntPos, bool bCalcFrame );
};
#endif // INCLUDED_SW_SOURCE_CORE_CRSR_CALLNK_HXX
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 72269f071b84..80cc4f69da90 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2578,7 +2578,7 @@ OUString SwCursorShell::GetSelText() const
@param bEnd Start counting from the end? From start otherwise.
@param nOffset position of the character
*/
-sal_Unicode SwCursorShell::GetChar( bool bEnd, long nOffset )
+sal_Unicode SwCursorShell::GetChar( bool bEnd, tools::Long nOffset )
{
if( IsTableMode() ) // not possible in table mode
return 0;
@@ -3063,7 +3063,7 @@ void SwCursorShell::MakeSelVisible()
if( m_aCursorHeight.Y() < m_aCharRect.Height() && m_aCharRect.Height() > VisArea().Height() )
{
SwRect aTmp( m_aCharRect );
- long nDiff = m_aCharRect.Height() - VisArea().Height();
+ tools::Long nDiff = m_aCharRect.Height() - VisArea().Height();
if( nDiff < m_aCursorHeight.getX() )
aTmp.Top( nDiff + m_aCharRect.Top() );
else
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index aae189370d0a..3d759416a387 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -350,7 +350,7 @@ SwPaM::SwPaM( const SwPosition& rMark, const SwPosition& rPoint, SwPaM* pRing )
}
SwPaM::SwPaM( const SwNodeIndex& rMark, const SwNodeIndex& rPoint,
- long nMarkOffset, long nPointOffset, SwPaM* pRing )
+ tools::Long nMarkOffset, tools::Long nPointOffset, SwPaM* pRing )
: Ring( pRing )
, m_Bound1( rMark )
, m_Bound2( rPoint )
@@ -371,7 +371,7 @@ SwPaM::SwPaM( const SwNodeIndex& rMark, const SwNodeIndex& rPoint,
}
SwPaM::SwPaM( const SwNode& rMark, const SwNode& rPoint,
- long nMarkOffset, long nPointOffset, SwPaM* pRing )
+ tools::Long nMarkOffset, tools::Long nPointOffset, SwPaM* pRing )
: Ring( pRing )
, m_Bound1( rMark )
, m_Bound2( rPoint )
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index e3c45e3b808e..4086ae11e899 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1960,7 +1960,7 @@ void SwCursor::DoSetBidiLevelUpDown()
}
bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
- Point const * pPt, long nUpDownX,
+ Point const * pPt, tools::Long nUpDownX,
SwRootFrame & rLayout)
{
SwTableCursor* pTableCursor = dynamic_cast<SwTableCursor*>(this);
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index c4d88972bb70..a72e4836b3ca 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -63,8 +63,8 @@
// MapMode. This is done so that on ShowCursor the same size does not have to be
// expensively determined again and again.
-long SwSelPaintRects::s_nPixPtX = 0;
-long SwSelPaintRects::s_nPixPtY = 0;
+tools::Long SwSelPaintRects::s_nPixPtX = 0;
+tools::Long SwSelPaintRects::s_nPixPtY = 0;
MapMode* SwSelPaintRects::s_pMapMode = nullptr;
// Starting from here: classes / methods for the non-text-cursor
@@ -129,7 +129,7 @@ OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink)
void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
{
SwRect aRect;
- long nTmpY = m_pCursorShell->m_aCursorHeight.getY();
+ tools::Long nTmpY = m_pCursorShell->m_aCursorHeight.getY();
if( 0 > nTmpY )
{
nTmpY = -nTmpY;
@@ -175,7 +175,7 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
const OutputDevice *pOut = m_pCursorShell->GetOut();
if ( pOut )
{
- long nSize = pOut->GetSettings().GetStyleSettings().GetCursorSize();
+ tools::Long nSize = pOut->GetSettings().GetStyleSettings().GetCursorSize();
Size aSize( nSize, nSize );
aSize = pOut->PixelToLogic( aSize );
aRect.Left( aRect.Left() - aSize.Width() );
@@ -589,7 +589,7 @@ void SwSelPaintRects::Invalidate( const SwRect& rRect )
// check current MapMode of the shell and set possibly the static members.
// Optional set the parameters pX, pY
void SwSelPaintRects::Get1PixelInLogic( const SwViewShell& rSh,
- long* pX, long* pY )
+ tools::Long* pX, tools::Long* pY )
{
const OutputDevice* pOut = rSh.GetWin();
if ( ! pOut )
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index 0656d172b9de..c37221e189e8 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -71,7 +71,7 @@ namespace
}
struct MarkEntry
{
- long int m_nIdx;
+ tools::Long m_nIdx;
bool m_bOther;
sal_Int32 m_nContent;
#if 0
@@ -243,7 +243,7 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, sal_uLong nNode, sal_Int32 nCon
{
if(pBkmk->GetMarkPos().nContent.GetIndex() < nContent)
{
- const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() };
+ const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() };
m_aBkmkEntries.push_back(aEntry);
}
else // if a bookmark position is equal nContent, the other position
@@ -255,10 +255,10 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, sal_uLong nNode, sal_Int32 nCon
{
if(bMarkPosEqual)
{ // the other position is before, the (main) position is equal
- const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() };
+ const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() };
m_aBkmkEntries.push_back(aEntry);
}
- const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), true, pBkmk->GetOtherMarkPos().nContent.GetIndex() };
+ const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), true, pBkmk->GetOtherMarkPos().nContent.GetIndex() };
m_aBkmkEntries.push_back(aEntry);
}
}
@@ -286,7 +286,7 @@ void ContentIdxStoreImpl::RestoreBkmks(SwDoc& rDoc, updater_t const & rUpdater)
void ContentIdxStoreImpl::SaveRedlines(SwDoc& rDoc, sal_uLong nNode, sal_Int32 nContent)
{
SwRedlineTable const & rRedlineTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
- long int nIdx = 0;
+ tools::Long nIdx = 0;
for (const SwRangeRedline* pRdl : rRedlineTable)
{
int nPointPos = lcl_RelativePosition( *pRdl->GetPoint(), nNode, nContent );
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index ded1dc72fe1e..473e0dbe491b 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3766,7 +3766,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
}
else
{
- long nOffset = newPos.nNode.GetIndex() - rRg.aStart.GetIndex();
+ tools::Long nOffset = newPos.nNode.GetIndex() - rRg.aStart.GetIndex();
SwNodeIndex aIdx( rStartIdx, nOffset );
newPos.nNode = aIdx;
}
diff --git a/sw/source/core/doc/DocumentListsManager.cxx b/sw/source/core/doc/DocumentListsManager.cxx
index d74e924fde95..177489aedfb2 100644
--- a/sw/source/core/doc/DocumentListsManager.cxx
+++ b/sw/source/core/doc/DocumentListsManager.cxx
@@ -180,7 +180,7 @@ DocumentListsManager::~DocumentListsManager()
OUString DocumentListsManager::MakeListIdUnique( const OUString& aSuggestedUniqueListId )
{
- long nHitCount = 0;
+ tools::Long nHitCount = 0;
OUString aTmpStr = aSuggestedUniqueListId;
while ( getListByName( aTmpStr ) )
{
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 206a81a928b2..a3496039ab0f 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2509,7 +2509,7 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r
const SwRangeRedline* pTmp = (*mpRedlineTable)[ n ];
sal_uLong nPt = pTmp->GetPoint()->nNode.GetIndex(),
nMk = pTmp->GetMark()->nNode.GetIndex();
- if( nPt < nMk ) { long nTmp = nMk; nMk = nPt; nPt = nTmp; }
+ if( nPt < nMk ) { tools::Long nTmp = nMk; nMk = nPt; nPt = nTmp; }
if( ( RedlineType::Any == nType || nType == pTmp->GetType()) &&
nMk <= nNdIdx && nNdIdx <= nPt )
@@ -2726,7 +2726,7 @@ void DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam
const SwRangeRedline* pTmp = (*mpRedlineTable)[ n ];
sal_uLong nPt = pTmp->GetPoint()->nNode.GetIndex(),
nMk = pTmp->GetMark()->nNode.GetIndex();
- if( nPt < nMk ) { long nTmp = nMk; nMk = nPt; nPt = nTmp; }
+ if( nPt < nMk ) { tools::Long nTmp = nMk; nMk = nPt; nPt = nTmp; }
if( RedlineType::ParagraphFormat == pTmp->GetType() &&
( (nSttIdx <= nMk && nMk <= nEndIdx) || (nSttIdx <= nPt && nPt <= nEndIdx) ) )
diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx
index 5d9a6faa94f4..91ca7aa498e9 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -102,7 +102,7 @@ void DocumentStatisticsManager::UpdateDocStat( bool bCompleteAsync, bool bFields
}
// returns true while there is more to do
-bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bFields)
+bool DocumentStatisticsManager::IncrementalDocStatCalculate(tools::Long nChars, bool bFields)
{
mbInitialized = true;
mpDocStat->Reset();
@@ -116,7 +116,7 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF
{
case SwNodeType::Text:
{
- long const nOldChars(mpDocStat->nChar);
+ tools::Long const nOldChars(mpDocStat->nChar);
SwTextNode *pText = static_cast< SwTextNode * >( pNd );
if (pText->CountWords(*mpDocStat, 0, pText->GetText().getLength()))
{
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 0244670d288e..5c2fdf4cf16e 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -106,15 +106,15 @@ namespace
PT_7, PT_7, PT_7, PT_7, PT_7 // HTML mode
};
- long lcl_GetRightMargin( SwDoc& rDoc )
+ tools::Long lcl_GetRightMargin( SwDoc& rDoc )
{
// Make sure that the printer settings are taken over to the standard
// page style
const SwFrameFormat& rPgDscFormat = rDoc.GetPageDesc( 0 ).GetMaster();
const SvxLRSpaceItem& rLR = rPgDscFormat.GetLRSpace();
- const long nLeft = rLR.GetLeft();
- const long nRight = rLR.GetRight();
- const long nWidth = rPgDscFormat.GetFrameSize().GetWidth();
+ const tools::Long nLeft = rLR.GetLeft();
+ const tools::Long nRight = rLR.GetRight();
+ const tools::Long nWidth = rPgDscFormat.GetFrameSize().GetWidth();
return nWidth - nLeft - nRight;
}
@@ -238,7 +238,7 @@ namespace
}
if( bTab )
{
- long nRightMargin = lcl_GetRightMargin( rDoc );
+ tools::Long nRightMargin = lcl_GetRightMargin( rDoc );
SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
aTStops.Insert( SvxTabStop( nRightMargin - nLeft,
SvxTabAdjust::Right,
@@ -908,7 +908,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
aLN.SetCountLines( false );
aSet.Put( aLN );
- long nRightMargin = lcl_GetRightMargin( m_rDoc );
+ tools::Long nRightMargin = lcl_GetRightMargin( m_rDoc );
SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
aTStops.Insert( SvxTabStop( nRightMargin / 2, SvxTabAdjust::Center ) );
@@ -1573,7 +1573,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
case RES_POOLCHR_RUBYTEXT:
{
- long nH = GetDfltAttr( RES_CHRATR_CJK_FONTSIZE )->GetHeight() / 2;
+ tools::Long nH = GetDfltAttr( RES_CHRATR_CJK_FONTSIZE )->GetHeight() / 2;
SetAllScriptItem( aSet, SvxFontHeightItem( nH, 100, RES_CHRATR_FONTSIZE));
aSet.Put(SvxUnderlineItem( LINESTYLE_NONE, RES_CHRATR_UNDERLINE ));
aSet.Put(SvxEmphasisMarkItem( FontEmphasisMark::NONE, RES_CHRATR_EMPHASIS_MARK) );
@@ -2032,7 +2032,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
aFormat.SetIncludeUpperLevels( 1 );
aFormat.SetSuffix( "." );
- long const nOffs = 397; // 0.70 cm
+ tools::Long const nOffs = 397; // 0.70 cm
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -2052,7 +2052,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- long nPos = (n+1) * nOffs;
+ tools::Long nPos = (n+1) * nOffs;
aFormat.SetListtabPos(nPos + 357);
aFormat.SetIndentAt(nPos + 357);
}
@@ -2210,7 +2210,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- long nPos = nOffs2 + ((n-3) * static_cast<long>(nOffs));
+ tools::Long nPos = nOffs2 + ((n-3) * static_cast<tools::Long>(nOffs));
aFormat.SetListtabPos(nPos);
aFormat.SetIndentAt(nPos);
}
@@ -2344,7 +2344,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- long nPos = ((n & 1) +1) * static_cast<long>(nOffs);
+ tools::Long nPos = ((n & 1) +1) * static_cast<tools::Long>(nOffs);
aFormat.SetListtabPos(nPos);
aFormat.SetIndentAt(nPos);
}
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 87aecbdf908d..7fda1705f0f0 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1229,13 +1229,13 @@ void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImp
SwNodeIndex aEndOfDoc( rExtDoc.GetNodes().GetEndOfContent(), -1 );
for( SwOutlineNodes::size_type i = 0; i < rOutNds.size(); ++i )
{
- ::SetProgressState( static_cast<long>(i), GetDocShell() );
+ ::SetProgressState( static_cast<tools::Long>(i), GetDocShell() );
const sal_uLong nIndex = rOutNds[ i ]->GetIndex();
const int nLvl = GetNodes()[ nIndex ]->GetTextNode()->GetAttrOutlineLevel()-1;
if( nLvl > nLevel )
continue;
- long nEndOfs = 1;
+ tools::Long nEndOfs = 1;
sal_uInt8 nWish = nPara;
sal_uLong nNextOutNd = i + 1 < rOutNds.size() ?
rOutNds[ i + 1 ]->GetIndex() : GetNodes().Count();
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 6c4ff48e09ff..1b81e89ab4c8 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -226,7 +226,7 @@ private:
CompareData &m_rData1, &m_rData2;
const MovedData &m_rMoved1, &m_rMoved2;
std::unique_ptr<long[]> m_pMemory;
- long *m_pFDiag, *m_pBDiag;
+ tools::Long *m_pFDiag, *m_pBDiag;
void Compare( sal_uLong nStt1, sal_uLong nEnd1, sal_uLong nStt2, sal_uLong nEnd2 );
sal_uLong CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
@@ -847,16 +847,16 @@ void Compare::CompareSequence::Compare( sal_uLong nStt1, sal_uLong nEnd1,
sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
sal_uLong nStt2, sal_uLong nEnd2, sal_uLong* pCost )
{
- const long dmin = nStt1 - nEnd2; /* Minimum valid diagonal. */
- const long dmax = nEnd1 - nStt2; /* Maximum valid diagonal. */
- const long fmid = nStt1 - nStt2; /* Center diagonal of top-down search. */
- const long bmid = nEnd1 - nEnd2; /* Center diagonal of bottom-up search. */
+ const tools::Long dmin = nStt1 - nEnd2; /* Minimum valid diagonal. */
+ const tools::Long dmax = nEnd1 - nStt2; /* Maximum valid diagonal. */
+ const tools::Long fmid = nStt1 - nStt2; /* Center diagonal of top-down search. */
+ const tools::Long bmid = nEnd1 - nEnd2; /* Center diagonal of bottom-up search. */
- long fmin = fmid, fmax = fmid; /* Limits of top-down search. */
- long bmin = bmid, bmax = bmid; /* Limits of bottom-up search. */
+ tools::Long fmin = fmid, fmax = fmid; /* Limits of top-down search. */
+ tools::Long bmin = bmid, bmax = bmid; /* Limits of bottom-up search. */
- long c; /* Cost. */
- long odd = (fmid - bmid) & 1; /* True if southeast corner is on an odd
+ tools::Long c; /* Cost. */
+ tools::Long odd = (fmid - bmid) & 1; /* True if southeast corner is on an odd
diagonal with respect to the northwest. */
m_pFDiag[fmid] = nStt1;
@@ -864,7 +864,7 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
for (c = 1;; ++c)
{
- long d; /* Active diagonal. */
+ tools::Long d; /* Active diagonal. */
/* Extend the top-down search by an edit step in each diagonal. */
if (fmin > dmin)
@@ -877,7 +877,7 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
--fmax;
for (d = fmax; d >= fmin; d -= 2)
{
- long x, y, tlo = m_pFDiag[d - 1], thi = m_pFDiag[d + 1];
+ tools::Long x, y, tlo = m_pFDiag[d - 1], thi = m_pFDiag[d + 1];
if (tlo >= thi)
x = tlo + 1;
@@ -909,7 +909,7 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
--bmax;
for (d = bmax; d >= bmin; d -= 2)
{
- long x, y, tlo = m_pBDiag[d - 1], thi = m_pBDiag[d + 1];
+ tools::Long x, y, tlo = m_pBDiag[d - 1], thi = m_pBDiag[d + 1];
if (tlo < thi)
x = tlo;
@@ -1829,12 +1829,12 @@ namespace
}
// Returns (the difference count?) if something is different
-long SwDoc::CompareDoc( const SwDoc& rDoc )
+tools::Long SwDoc::CompareDoc( const SwDoc& rDoc )
{
if( &rDoc == this )
return 0;
- long nRet = 0;
+ tools::Long nRet = 0;
// Get comparison options
CmpOptions.eCmpMode = SW_MOD()->GetCompareMode();
@@ -2077,12 +2077,12 @@ sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline)
}
/// Merge two documents
-long SwDoc::MergeDoc( const SwDoc& rDoc )
+tools::Long SwDoc::MergeDoc( const SwDoc& rDoc )
{
if( &rDoc == this )
return 0;
- long nRet = 0;
+ tools::Long nRet = 0;
GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 00d1dd842f6d..3f0b3802b417 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -570,7 +570,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
if( *pPageCnt < *pPageSt )
*pPageCnt = *pPageSt;
}
- long nStat;
+ tools::Long nStat;
if( nPageNr >= *pPageSt )
nStat = nPageNr - *pPageSt + 1;
else
@@ -797,7 +797,7 @@ static bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs )
if( *pPageCnt < *pPageSt )
*pPageCnt = *pPageSt;
}
- long nStat = nPageNr >= *pPageSt ? nPageNr - *pPageSt + 1
+ tools::Long nStat = nPageNr >= *pPageSt ? nPageNr - *pPageSt + 1
: nPageNr + *pPageCnt - *pPageSt + 1;
::SetProgressState( nStat, pNode->GetDoc().GetDocShell() );
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 8dd9c6e84a3a..6a913565867f 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1666,7 +1666,7 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool bRight, bool bModulus,
}
}
- long nNext = aLS.GetTextLeft();
+ tools::Long nNext = aLS.GetTextLeft();
if( bModulus )
nNext = ( nNext / nDefDist ) * nDefDist;
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 2511b45bb963..10895e96af2f 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -578,7 +578,7 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, SwOutlineNodes::difference_type
// Sections or Tables at the document start will be pushed backwards.
nNewPos = std::max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 );
- long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex());
+ tools::Long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex());
SwPaM aPam( aSttRg, aEndRg, 0, -1 );
return MoveParagraph( aPam, nOffs, true );
}
@@ -1823,7 +1823,7 @@ bool SwDoc::NumUpDown(const SwPaM& rPam, bool bDown, SwRootFrame const*const pLa
// this function doesn't contain any numbering-related code, but it is
// primarily called to move numbering-relevant paragraphs around, hence
// it will expand its selection to include full SwTextFrames.
-bool SwDoc::MoveParagraph(SwPaM& rPam, long nOffset, bool const bIsOutlMv)
+bool SwDoc::MoveParagraph(SwPaM& rPam, tools::Long nOffset, bool const bIsOutlMv)
{
// sw_redlinehide: as long as a layout with Hide mode exists, only
// move nodes that have merged frames *completely*
@@ -1932,7 +1932,7 @@ bool SwDoc::MoveParagraph(SwPaM& rPam, long nOffset, bool const bIsOutlMv)
return MoveParagraphImpl(rPam, nOffset, bIsOutlMv, pLayout);
}
-bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset,
+bool SwDoc::MoveParagraphImpl(SwPaM& rPam, tools::Long const nOffset,
bool const bIsOutlMv, SwRootFrame const*const pLayout)
{
const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
@@ -1976,7 +1976,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset,
}
sal_uLong nInStIdx, nInEndIdx;
- long nOffs = nOffset;
+ tools::Long nOffs = nOffset;
if( nOffset > 0 )
{
nInEndIdx = nEndIdx;
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 23c4fa59d145..ecb510869bbf 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1052,7 +1052,7 @@ void MaybeNotifyRedlineModification(SwRangeRedline& rRedline, SwDoc& rDoc)
}
}
-void SwRangeRedline::MaybeNotifyRedlinePositionModification(long nTop)
+void SwRangeRedline::MaybeNotifyRedlinePositionModification(tools::Long nTop)
{
if (!comphelper::LibreOfficeKit::isActive())
return;
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 8735715e6014..f45b7b2be8b5 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1913,7 +1913,7 @@ void SwTOXBaseSection::InsertSorted(std::unique_ptr<SwTOXSortTabBase> pNew)
}
// find position and insert
- long i;
+ tools::Long i;
for( i = aRange.Min(); i < aRange.Max(); ++i)
{ // Only check for same level
@@ -1970,10 +1970,10 @@ Range SwTOXBaseSection::GetKeyRange(const OUString& rStr, const OUString& rStrRe
OSL_ENSURE(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
- const long nMin = rRange.Min();
- const long nMax = rRange.Max();
+ const tools::Long nMin = rRange.Min();
+ const tools::Long nMax = rRange.Max();
- long i;
+ tools::Long i;
for( i = nMin; i < nMax; ++i)
{
@@ -1995,8 +1995,8 @@ Range SwTOXBaseSection::GetKeyRange(const OUString& rStr, const OUString& rStrRe
}
m_aSortArr.insert(m_aSortArr.begin() + i, std::move(pKey));
}
- const long nStart = i+1;
- const long nEnd = m_aSortArr.size();
+ const tools::Long nStart = i+1;
+ const tools::Long nEnd = m_aSortArr.size();
// Find end of range
for(i = nStart; i < nEnd; ++i)
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index f59efb8b10a4..93089178dd62 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -213,14 +213,14 @@ void SwTextFormatColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
// We had a relative value -> recalculate
if( 100 != aNew.GetPropLeft() )
{
- long nTmp = aNew.GetLeft(); // keep so that we can compare
+ tools::Long nTmp = aNew.GetLeft(); // keep so that we can compare
aNew.SetLeft( pNewLRSpace->GetLeft(), aNew.GetPropLeft() );
bChg |= nTmp != aNew.GetLeft();
}
// We had a relative value -> recalculate
if( 100 != aNew.GetPropRight() )
{
- long nTmp = aNew.GetRight(); // keep so that we can compare
+ tools::Long nTmp = aNew.GetRight(); // keep so that we can compare
aNew.SetRight( pNewLRSpace->GetRight(), aNew.GetPropRight() );
bChg |= nTmp != aNew.GetRight();
}
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 7441ddf7447c..31edb6dff0bc 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -361,7 +361,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrame(
}
SwTwips nUpperDummy = 0;
- long nRightOffset = 0,
+ tools::Long nRightOffset = 0,
nLeftOffset = 0;
rTabFrame.CalcFlyOffsets( nUpperDummy, nLeftOffset, nRightOffset );
nWidth -= (nLeftOffset + nRightOffset);
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index e61cdf0b6acd..f51bc19bc9c0 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -382,7 +382,7 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
// We read graphic from the Node, if needed.
// It may fail, however.
- long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop;
+ tools::Long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop;
Size aOrigSz( static_cast<const SwNoTextNode*>(GetNode())->GetTwipSize() );
if ( !aOrigSz.Width() )
{
@@ -393,16 +393,16 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
else
{
nLeftCrop = std::max( aOrigSz.Width() -
- (rCrop.GetRight() + rCrop.GetLeft()), long(1) );
+ (rCrop.GetRight() + rCrop.GetLeft()), tools::Long(1) );
const double nScale = double(aFramePrintArea.Width()) / double(nLeftCrop);
- nLeftCrop = long(nScale * -rCrop.GetLeft() );
- nRightCrop = long(nScale * -rCrop.GetRight() );
+ nLeftCrop = tools::Long(nScale * -rCrop.GetLeft() );
+ nRightCrop = tools::Long(nScale * -rCrop.GetRight() );
}
// crop values have to be mirrored too
if( nMirror == MirrorGraph::Vertical || nMirror == MirrorGraph::Both )
{
- long nTmpCrop = nLeftCrop;
+ tools::Long nTmpCrop = nLeftCrop;
nLeftCrop = nRightCrop;
nRightCrop= nTmpCrop;
}
@@ -415,16 +415,16 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
}
else
{
- nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) );
+ nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), tools::Long(1) );
const double nScale = double(aFramePrintArea.Height()) / double(nTopCrop);
- nTopCrop = long(nScale * -rCrop.GetTop() );
- nBottomCrop= long(nScale * -rCrop.GetBottom() );
+ nTopCrop = tools::Long(nScale * -rCrop.GetTop() );
+ nBottomCrop= tools::Long(nScale * -rCrop.GetBottom() );
}
// crop values have to be mirrored too
if( nMirror == MirrorGraph::Horizontal || nMirror == MirrorGraph::Both )
{
- long nTmpCrop = nTopCrop;
+ tools::Long nTmpCrop = nTopCrop;
nTopCrop = nBottomCrop;
nBottomCrop= nTmpCrop;
}
@@ -1510,7 +1510,7 @@ bool SwNoTextFrame::IsTransparent() const
// we can be more specific - rotations of multiples of
// 90 degrees will leave no gaps. Go from [0.0 .. F_2PI]
// to [0 .. 360] and check modulo 90
- const long nRot(static_cast<long>(basegfx::rad2deg(getLocalFrameRotation())));
+ const tools::Long nRot(static_cast<tools::Long>(basegfx::rad2deg(getLocalFrameRotation())));
const bool bMultipleOf90(0 == (nRot % 90));
if(!bMultipleOf90)
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index f652861d9a6f..66ff2976ca75 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -392,11 +392,11 @@ SwNumRule::SwNumRule( const OUString& rNm,
}
// position-and-space mode LABEL_ALIGNMENT
// first line indent of general numbering in inch: -0,25 inch
- const long cFirstLineIndent = -1440/4;
+ const tools::Long cFirstLineIndent = -1440/4;
// indent values of general numbering in inch:
// 0,5 0,75 1,0 1,25 1,5
// 1,75 2,0 2,25 2,5 2,75
- const long cIndentAt[ MAXLEVEL ] = {
+ const tools::Long cIndentAt[ MAXLEVEL ] = {
1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2,
1440*7/4, 1440*2, 1440*9/4, 1440*5/2, 1440*11/4 };
for( n = 0; n < MAXLEVEL; ++n )
@@ -951,11 +951,11 @@ void SwNumRule::ChangeIndent( const sal_Int32 nDiff )
// adjust also the list tab position, if a list tab stop is applied
if ( aTmpNumFormat.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
- const long nNewListTab = aTmpNumFormat.GetListtabPos() + nDiff;
+ const tools::Long nNewListTab = aTmpNumFormat.GetListtabPos() + nDiff;
aTmpNumFormat.SetListtabPos( nNewListTab );
}
- const long nNewIndent = nDiff +
+ const tools::Long nNewIndent = nDiff +
aTmpNumFormat.GetIndentAt();
aTmpNumFormat.SetIndentAt( nNewIndent );
}
@@ -983,7 +983,7 @@ void SwNumRule::SetIndent( const short nNewIndent,
// adjust also the list tab position, if a list tab stop is applied
if ( aTmpNumFormat.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
- const long nNewListTab = aTmpNumFormat.GetListtabPos() +
+ const tools::Long nNewListTab = aTmpNumFormat.GetListtabPos() +
( nNewIndent - aTmpNumFormat.GetIndentAt() );
aTmpNumFormat.SetListtabPos( nNewListTab );
}
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 0600e56070b7..2289b2290f3e 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1080,7 +1080,7 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream )
(AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) )
{
sal_uInt8 nChrSet, nCnt;
- long nPos = rStream.Tell();
+ tools::Long nPos = rStream.Tell();
rStream.ReadUChar( nCnt ).ReadUChar( nChrSet );
if( rStream.Tell() != sal_uLong(nPos + nCnt) )
{
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index d3bc393b906c..ba2eac002e9b 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -369,7 +369,7 @@ namespace
{
BoxStructure::iterator pInfo = maLines[nLine].begin();
BoxStructure::iterator pEnd = maLines[nLine].end();
- long nCol = pInfo->mnColSpan;
+ tools::Long nCol = pInfo->mnColSpan;
while( nNewCol > nCol && ++pInfo != pEnd )
nCol += pInfo->mnColSpan;
if( pInfo != pEnd )
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 402f2c920095..4ea0c5af6366 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -276,7 +276,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
{
// The first Line should be enough
FndBoxes_t const& rFndBoxes = pCmpLine->GetBoxes();
- long nSz = 0;
+ tools::Long nSz = 0;
for( auto n = rFndBoxes.size(); n; )
{
nSz += rFndBoxes[--n]->GetBox()->
@@ -611,17 +611,17 @@ bool SwTable::InsertRow_( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return true;
}
-static void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
+static void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const tools::Long nOffset,
bool bFirst, SwShareBoxFormats& rShareFormats );
-static void lcl_LastBoxSetWidthLine( SwTableLines &rLines, const long nOffset,
+static void lcl_LastBoxSetWidthLine( SwTableLines &rLines, const tools::Long nOffset,
bool bFirst, SwShareBoxFormats& rShareFormats )
{
for ( auto pLine : rLines )
::lcl_LastBoxSetWidth( pLine->GetTabBoxes(), nOffset, bFirst, rShareFormats );
}
-static void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
+static void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const tools::Long nOffset,
bool bFirst, SwShareBoxFormats& rShareFormats )
{
SwTableBox& rBox = *(bFirst ? rBoxes.front() : rBoxes.back());
@@ -1306,7 +1306,7 @@ static void lcl_CalcWidth( SwTableBox* pBox )
SwTableLine* pLine = pBox->GetTabLines()[0];
OSL_ENSURE( pLine, "Box is not within a Line" );
- long nWidth = 0;
+ tools::Long nWidth = 0;
for( auto pTabBox : pLine->GetTabBoxes() )
nWidth += pTabBox->GetFrameFormat()->GetFrameSize().GetWidth();
@@ -1640,15 +1640,15 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
static void lcl_CheckRowSpan( SwTable &rTable )
{
- const long nLineCount = static_cast<long>(rTable.GetTabLines().size());
- long nMaxSpan = nLineCount;
- long nMinSpan = 1;
+ const tools::Long nLineCount = static_cast<tools::Long>(rTable.GetTabLines().size());
+ tools::Long nMaxSpan = nLineCount;
+ tools::Long nMinSpan = 1;
while( nMaxSpan )
{
SwTableLine* pLine = rTable.GetTabLines()[ nLineCount - nMaxSpan ];
for( auto pBox : pLine->GetTabBoxes() )
{
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan > nMaxSpan )
pBox->setRowSpan( nMaxSpan );
else if( nRowSpan < nMinSpan )
@@ -2669,7 +2669,7 @@ bool SwTable::SetColWidth( SwTableBox& rCurrentBox, TableChgWidthHeightType eTyp
if( ppUndo )
ppUndo->reset(new SwUndoAttrTable( *aParam.pTableNd, true ));
- long nFrameWidth = LONG_MAX;
+ tools::Long nFrameWidth = LONG_MAX;
LockModify();
SwFormatFrameSize aSz( rSz );
SvxLRSpaceItem aLR( rLR );
@@ -2940,7 +2940,7 @@ static void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewH
Fraction aTmp( nMyOldH );
aTmp *= Fraction( nNewHeight, nOldHeight );
aTmp += Fraction( 1, 2 ); // round up if needed
- nMyNewH = long(aTmp);
+ nMyNewH = tools::Long(aTmp);
}
SwFrameSize eSize = SwFrameSize::Minimum;
@@ -3207,7 +3207,7 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eTy
return bRet;
}
-SwFrameFormat* SwShareBoxFormat::GetFormat( long nWidth ) const
+SwFrameFormat* SwShareBoxFormat::GetFormat( tools::Long nWidth ) const
{
SwFrameFormat *pRet = nullptr, *pTmp;
for( auto n = m_aNewFormats.size(); n; )
@@ -3258,7 +3258,7 @@ SwShareBoxFormats::~SwShareBoxFormats()
{
}
-SwFrameFormat* SwShareBoxFormats::GetFormat( const SwFrameFormat& rFormat, long nWidth ) const
+SwFrameFormat* SwShareBoxFormats::GetFormat( const SwFrameFormat& rFormat, tools::Long nWidth ) const
{
sal_uInt16 nPos;
return Seek_Entry( rFormat, &nPos )
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 6b1f09b69b90..ff1db5358919 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1966,8 +1966,8 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
::ClearFEShellTabCols(*this, nullptr);
SwSelBoxes aSelBoxes( rBoxes );
SwTable &rTable = pTableNd->GetTable();
- long nMin = 0;
- long nMax = 0;
+ tools::Long nMin = 0;
+ tools::Long nMax = 0;
if( rTable.IsNewModel() )
{
if( bColumn )
@@ -2527,12 +2527,12 @@ namespace {
struct FuzzyCompare
{
- bool operator() ( long s1, long s2 ) const;
+ bool operator() ( tools::Long s1, tools::Long s2 ) const;
};
}
-bool FuzzyCompare::operator() ( long s1, long s2 ) const
+bool FuzzyCompare::operator() ( tools::Long s1, tools::Long s2 ) const
{
return ( s1 < s2 && std::abs( s1 - s2 ) > ROWFUZZY );
}
@@ -2588,12 +2588,12 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
// Set fixed points, LeftMin in Document coordinates, all others relative
SwRectFnSet aRectFnSet(pTab);
const SwPageFrame* pPage = pTab->FindPageFrame();
- const long nLeftMin = ( aRectFnSet.IsVert() ?
+ const tools::Long nLeftMin = ( aRectFnSet.IsVert() ?
pTab->GetPrtLeft() - pPage->getFrameArea().Left() :
pTab->GetPrtTop() - pPage->getFrameArea().Top() );
- const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0;
- const long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea());
- const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX;
+ const tools::Long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0;
+ const tools::Long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea());
+ const tools::Long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX;
rFill.SetLeftMin( nLeftMin );
rFill.SetLeft( nLeft );
@@ -2614,8 +2614,8 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
if ( pFrame->IsCellFrame() && pFrame->FindTabFrame() == pTab )
{
// upper and lower borders of current cell frame:
- long nUpperBorder = aRectFnSet.GetTop(pFrame->getFrameArea());
- long nLowerBorder = aRectFnSet.GetBottom(pFrame->getFrameArea());
+ tools::Long nUpperBorder = aRectFnSet.GetTop(pFrame->getFrameArea());
+ tools::Long nLowerBorder = aRectFnSet.GetBottom(pFrame->getFrameArea());
// get boundaries for nUpperBorder:
aIter = aBoundaries.find( nUpperBorder );
@@ -2634,13 +2634,13 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
else
{
nLowerBorder = (*aIter).first;
- long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder );
+ tools::Long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder );
aPair.first = nNewLowerBorderUpperBoundary; aPair.second = LONG_MAX;
}
aBoundaries[ nLowerBorder ] = aPair;
// calculate hidden flags for entry nUpperBorder/nLowerBorder:
- long nTmpVal = nUpperBorder;
+ tools::Long nTmpVal = nUpperBorder;
for ( sal_uInt8 i = 0; i < 2; ++i )
{
aHiddenIter = aHidden.find( nTmpVal );
@@ -2663,11 +2663,11 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
size_t nIdx = 0;
for ( const auto& rEntry : aBoundaries )
{
- const long nTabTop = aRectFnSet.GetPrtTop(*pTab);
- const long nKey = aRectFnSet.YDiff( rEntry.first, nTabTop );
+ const tools::Long nTabTop = aRectFnSet.GetPrtTop(*pTab);
+ const tools::Long nKey = aRectFnSet.YDiff( rEntry.first, nTabTop );
const std::pair< long, long > aTmpPair = rEntry.second;
- const long nFirst = aRectFnSet.YDiff( aTmpPair.first, nTabTop );
- const long nSecond = aTmpPair.second;
+ const tools::Long nFirst = aRectFnSet.YDiff( aTmpPair.first, nTabTop );
+ const tools::Long nSecond = aTmpPair.second;
aHiddenIter = aHidden.find( rEntry.first );
const bool bHidden = aHiddenIter != aHidden.end() && (*aHiddenIter).second;
@@ -2763,7 +2763,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
const SwPageFrame* pPage = pTab->FindPageFrame();
aOld.SetRight( aRectFnSet.GetHeight(pTab->getFramePrintArea()) );
- long nLeftMin;
+ tools::Long nLeftMin;
if ( aRectFnSet.IsVert() )
{
nLeftMin = pTab->GetPrtLeft() - pPage->getFrameArea().Left();
@@ -2793,15 +2793,15 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
const size_t nIdxStt = aRectFnSet.IsVert() ? nCount - i : i - 1;
const size_t nIdxEnd = aRectFnSet.IsVert() ? nCount - i - 1 : i;
- const long nOldRowStart = i == 0 ? 0 : aOld[ nIdxStt ];
- const long nOldRowEnd = i == nCount ? aOld.GetRight() : aOld[ nIdxEnd ];
- const long nOldRowHeight = nOldRowEnd - nOldRowStart;
+ const tools::Long nOldRowStart = i == 0 ? 0 : aOld[ nIdxStt ];
+ const tools::Long nOldRowEnd = i == nCount ? aOld.GetRight() : aOld[ nIdxEnd ];
+ const tools::Long nOldRowHeight = nOldRowEnd - nOldRowStart;
- const long nNewRowStart = i == 0 ? 0 : rNew[ nIdxStt ];
- const long nNewRowEnd = i == nCount ? rNew.GetRight() : rNew[ nIdxEnd ];
- const long nNewRowHeight = nNewRowEnd - nNewRowStart;
+ const tools::Long nNewRowStart = i == 0 ? 0 : rNew[ nIdxStt ];
+ const tools::Long nNewRowEnd = i == nCount ? rNew.GetRight() : rNew[ nIdxEnd ];
+ const tools::Long nNewRowHeight = nNewRowEnd - nNewRowStart;
- const long nDiff = nNewRowHeight - nOldRowHeight;
+ const tools::Long nDiff = nNewRowHeight - nOldRowHeight;
if ( std::abs( nDiff ) >= ROWFUZZY )
{
// For the old table model pTextFrame and pLine will be set for every box.
@@ -2818,7 +2818,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
{
if ( pFrame->IsCellFrame() && pFrame->FindTabFrame() == pTab )
{
- const long nLowerBorder = aRectFnSet.GetBottom(pFrame->getFrameArea());
+ const tools::Long nLowerBorder = aRectFnSet.GetBottom(pFrame->getFrameArea());
const sal_uLong nTabTop = aRectFnSet.GetPrtTop(*pTab);
if ( std::abs( aRectFnSet.YInc( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY )
{
@@ -2829,7 +2829,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
if ( pContent && pContent->IsTextFrame() )
{
const SwTableBox* pBox = static_cast<const SwCellFrame*>(pFrame)->GetTabBox();
- const long nRowSpan = pBox->getRowSpan();
+ const tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan > 0 ) // Not overlapped
pTextFrame = static_cast<const SwTextFrame*>(pContent);
if( nRowSpan < 2 ) // Not overlapping for row height
@@ -2838,7 +2838,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
{
// The new row height must not to be calculated from an overlapping box
SwFormatFrameSize aNew( pLine->GetFrameFormat()->GetFrameSize() );
- const long nNewSize = aRectFnSet.GetHeight(pFrame->getFrameArea()) + nDiff;
+ const tools::Long nNewSize = aRectFnSet.GetHeight(pFrame->getFrameArea()) + nDiff;
if( nNewSize != aNew.GetHeight() )
{
aNew.SetHeight( nNewSize );
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 486baf643c83..2bacf8976553 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -56,7 +56,7 @@ using namespace ::com::sun::star;
// See swtable.cxx too
#define COLFUZZY 20L
-static bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; }
+static bool IsSame( tools::Long nA, tools::Long nB ) { return std::abs(nA-nB) <= COLFUZZY; }
namespace {
@@ -442,7 +442,7 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly, const bool
{
if( !bTstOnly )
{
- long nHeight = 0;
+ tools::Long nHeight = 0;
sal_Int32 nTotalHeight = 0;
for ( auto pLn : aRowArr )
{
@@ -1312,7 +1312,7 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrame *pCell )
// To compensate for the accuracy of calculation later on in SwTable::SetTabCols
// we keep adding up a little.
nRet += COLFUZZY;
- return static_cast<sal_uInt16>(std::max( long(MINLAY), nRet ));
+ return static_cast<sal_uInt16>(std::max( tools::Long(MINLAY), nRet ));
}
/* The Line is within the Selection but not outlined by the TabCols.
@@ -1340,23 +1340,23 @@ static void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabC
for ( size_t i = 0 ; i <= rCols.Count(); ++i )
{
- long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
- long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
+ tools::Long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
+ tools::Long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
nColLeft += rCols.GetLeftMin();
nColRight += rCols.GetLeftMin();
// Adapt values to the proportions of the Table (Follows)
if ( rCols.GetLeftMin() != aRectFnSet.GetLeft(pTab->getFrameArea()) )
{
- const long nDiff = aRectFnSet.GetLeft(pTab->getFrameArea()) - rCols.GetLeftMin();
+ const tools::Long nDiff = aRectFnSet.GetLeft(pTab->getFrameArea()) - rCols.GetLeftMin();
nColLeft += nDiff;
nColRight += nDiff;
}
- const long nCellLeft = aRectFnSet.GetLeft(pCell->getFrameArea());
- const long nCellRight = aRectFnSet.GetRight(pCell->getFrameArea());
+ const tools::Long nCellLeft = aRectFnSet.GetLeft(pCell->getFrameArea());
+ const tools::Long nCellRight = aRectFnSet.GetRight(pCell->getFrameArea());
// Calculate overlapping value
- long nWidth = 0;
+ tools::Long nWidth = 0;
if ( nColLeft <= nCellLeft && nColRight >= (nCellLeft+COLFUZZY) )
nWidth = nColRight - nCellLeft;
else if ( nColLeft <= (nCellRight-COLFUZZY) && nColRight >= nCellRight )
@@ -1365,7 +1365,7 @@ static void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabC
nWidth = nColRight - nColLeft;
if ( nWidth && pCell->getFrameArea().Width() )
{
- long nTmp = nWidth * nWish / pCell->getFrameArea().Width();
+ tools::Long nTmp = nWidth * nWish / pCell->getFrameArea().Width();
if ( o3tl::make_unsigned(nTmp) > rToFill[i] )
rToFill[i] = sal_uInt16(nTmp);
}
@@ -1414,20 +1414,20 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols
{
if ( pCell->IsCellFrame() && pCell->FindTabFrame() == pTab && ::IsFrameInTableSel( rUnion, pCell ) )
{
- const long nCLeft = aRectFnSet.GetLeft(pCell->getFrameArea());
- const long nCRight = aRectFnSet.GetRight(pCell->getFrameArea());
+ const tools::Long nCLeft = aRectFnSet.GetLeft(pCell->getFrameArea());
+ const tools::Long nCRight = aRectFnSet.GetRight(pCell->getFrameArea());
bool bNotInCols = true;
for ( size_t i = 0; i <= rCols.Count(); ++i )
{
sal_uInt16 nFit = rToFill[i];
- long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
- long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
+ tools::Long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
+ tools::Long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
if ( bRTL )
{
- long nTmpRight = nColRight;
+ tools::Long nTmpRight = nColRight;
nColRight = rCols.GetRight() - nColLeft;
nColLeft = rCols.GetRight() - nTmpRight;
}
@@ -1436,11 +1436,11 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols
nColRight += rCols.GetLeftMin();
// Adapt values to the proportions of the Table (Follows)
- long nLeftA = nColLeft;
- long nRightA = nColRight;
+ tools::Long nLeftA = nColLeft;
+ tools::Long nRightA = nColRight;
if ( rCols.GetLeftMin() != sal_uInt16(aRectFnSet.GetLeft(pTab->getFrameArea())) )
{
- const long nDiff = aRectFnSet.GetLeft(pTab->getFrameArea()) - rCols.GetLeftMin();
+ const tools::Long nDiff = aRectFnSet.GetLeft(pTab->getFrameArea()) - rCols.GetLeftMin();
nLeftA += nDiff;
nRightA += nDiff;
}
@@ -1541,7 +1541,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor,
rn = nEqualWidth;
}
- const long nOldRight = aTabCols.GetRight();
+ const tools::Long nOldRight = aTabCols.GetRight();
// In order to make the implementation easier, but still use the available
// space properly, we do this twice.
@@ -1582,13 +1582,13 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor,
else
nDiff -= aTabCols[i] - aTabCols[i-1];
- long nTabRight = aTabCols.GetRight() + nDiff;
+ tools::Long nTabRight = aTabCols.GetRight() + nDiff;
// If the Table would become too wide, we restrict the
// adjusted amount to the allowed maximum.
if ( !bBalance && nTabRight > aTabCols.GetRightMax() )
{
- const long nTmpD = nTabRight - aTabCols.GetRightMax();
+ const tools::Long nTmpD = nTabRight - aTabCols.GetRightMax();
nDiff -= nTmpD;
nTabRight -= nTmpD;
}
@@ -1599,7 +1599,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor,
}
}
- const long nNewRight = aTabCols.GetRight();
+ const tools::Long nNewRight = aTabCols.GetRight();
SwFrameFormat *pFormat = pTableNd->GetTable().GetFrameFormat();
const sal_Int16 nOriHori = pFormat->GetHoriOrient().GetHoriOrient();
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index b65b45fe5196..317c149faeb2 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -278,7 +278,7 @@ sal_uInt16 SwNode::GetSectionLevel() const
}
#ifdef DBG_UTIL
-long SwNode::s_nSerial = 0;
+tools::Long SwNode::s_nSerial = 0;
#endif
SwNode::SwNode( const SwNodeIndex &rWhere, const SwNodeType nNdType )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 9d7561913550..a7a2078b2091 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1708,7 +1708,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
SwNodeIndex aOrigInsPos( rIndex, -1 ); // original insertion position
int nLevel = 0; // level counter
- for( long nNodeCnt = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
+ for( tools::Long nNodeCnt = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
nNodeCnt > 0; --nNodeCnt )
{
pCurrentNode = &aRg.aStart.GetNode();
@@ -1720,7 +1720,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
rDoc.GetNodes().GetEndOfInserts().StartOfSectionIndex()
< aInsPos.GetIndex() )
{
- const long nDistance =
+ const tools::Long nDistance =
pCurrentNode->EndOfSectionIndex() -
aRg.aStart.GetIndex();
if (nDistance < nNodeCnt)
@@ -1761,7 +1761,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
SwNodeIndex nStt( aInsPos, -1 );
SwTableNode* pTableNd = static_cast<SwTableNode*>(pCurrentNode)->
MakeCopy( rDoc, aInsPos );
- const long nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2;
+ const tools::Long nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2;
if (nDistance < nNodeCnt)
nNodeCnt -= nDistance;
else
@@ -1789,7 +1789,7 @@ void SwNodes::CopyNodes( const SwNodeRange& rRange,
SwSectionNode* pSectNd = static_cast<SwSectionNode*>(pCurrentNode)->
MakeCopy( rDoc, aInsPos );
- const long nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2;
+ const tools::Long nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2;
if (nDistance < nNodeCnt)
nNodeCnt -= nDistance;
else
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 5481b4d9e4c3..8bdcac6344de 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -2368,7 +2368,7 @@ void SwDrawVirtObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fr
SetRectsDirty();
}
-void SwDrawVirtObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
+void SwDrawVirtObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
{
rRefObj.NbcRotate(rRef - GetOffset(), nAngle, sn, cs);
SetRectsDirty();
@@ -2380,7 +2380,7 @@ void SwDrawVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2)
SetRectsDirty();
}
-void SwDrawVirtObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear)
+void SwDrawVirtObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear)
{
rRefObj.NbcShear(rRef - GetOffset(), nAngle, tn, bVShear);
SetRectsDirty();
@@ -2402,7 +2402,7 @@ void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fract
}
}
-void SwDrawVirtObj::Rotate(const Point& rRef, long nAngle, double sn, double cs)
+void SwDrawVirtObj::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
{
if(nAngle)
{
@@ -2421,7 +2421,7 @@ void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2)
SendUserCall(SdrUserCallType::Resize, aBoundRect0);
}
-void SwDrawVirtObj::Shear(const Point& rRef, long nAngle, double tn, bool bVShear)
+void SwDrawVirtObj::Shear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear)
{
if(nAngle)
{
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 94d566d046f0..3360229124df 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -378,7 +378,7 @@ bool SwVirtFlyDrawObj::HasLimitedRotation() const
return ContainsSwGrfNode();
}
-void SwVirtFlyDrawObj::Rotate(const Point& rRef, long nAngle, double sn, double cs)
+void SwVirtFlyDrawObj::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
{
if(ContainsSwGrfNode())
{
@@ -665,7 +665,7 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
const SwFrameFormat *pTmpFormat = GetFormat();
const SwFormatVertOrient &rVert = pTmpFormat->GetVertOrient();
const SwFormatHoriOrient &rHori = pTmpFormat->GetHoriOrient();
- long lXDiff = aNewPos.X() - aOldPos.X();
+ tools::Long lXDiff = aNewPos.X() - aOldPos.X();
if( rHori.IsPosToggle() && text::HoriOrientation::NONE == eHori &&
!GetFlyFrame()->FindPageFrame()->OnRightPage() )
lXDiff = -lXDiff;
@@ -674,7 +674,7 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
text::HoriOrientation::NONE == eHori )
lXDiff = -lXDiff;
- long lYDiff = aNewPos.Y() - aOldPos.Y();
+ tools::Long lYDiff = aNewPos.Y() - aOldPos.Y();
if( GetFlyFrame()->GetAnchorFrame()->IsVertical() )
{
//lXDiff -= rVert.GetPos();
@@ -842,8 +842,8 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou
const tools::Rectangle aOldRect(
GetFlyFrame()->getFrameArea().TopLeft() + GetFlyFrame()->getFramePrintArea().TopLeft(),
GetFlyFrame()->getFramePrintArea().SSize());
- const long nOldWidth(aOldRect.GetWidth());
- const long nOldHeight(aOldRect.GetHeight());
+ const tools::Long nOldWidth(aOldRect.GetWidth());
+ const tools::Long nOldHeight(aOldRect.GetHeight());
if (!nOldWidth || !nOldHeight)
{
@@ -904,8 +904,8 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou
// Set new frame size
SwFrameFormat *pFormat = GetFormat();
SwFormatFrameSize aSz( pFormat->GetFrameSize() );
- const long aNewWidth(aNewRect.GetWidth() + (aOutRect.GetWidth() - aOldRect.GetWidth()));
- const long aNewHeight(aNewRect.GetHeight() + (aOutRect.GetHeight() - aOldRect.GetHeight()));
+ const tools::Long aNewWidth(aNewRect.GetWidth() + (aOutRect.GetWidth() - aOldRect.GetWidth()));
+ const tools::Long aNewHeight(aNewRect.GetHeight() + (aOutRect.GetHeight() - aOldRect.GetHeight()));
aSz.SetWidth(aNewWidth);
aSz.SetHeight(aNewHeight);
pFormat->GetDoc()->SetAttr( aSz, *pFormat );
@@ -1033,7 +1033,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const
{
SwBorderAttrAccess aAccess( SwFrame::GetCache(), GetFlyFrame() );
const SwBorderAttrs &rAttrs = *aAccess.Get();
- long nMin = rAttrs.CalcLeftLine()+rAttrs.CalcRightLine();
+ tools::Long nMin = rAttrs.CalcLeftLine()+rAttrs.CalcRightLine();
const SwFormatCol& rCol = rAttrs.GetAttrSet().GetCol();
if ( rCol.GetColumns().size() > 1 )
{
@@ -1053,7 +1053,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const
if ( aFrameSz.GetWidthPercent() || aFrameSz.GetHeightPercent() )
{
- long nRelWidth, nRelHeight;
+ tools::Long nRelWidth, nRelHeight;
const SwFrame *pRel = GetFlyFrame()->IsFlyLayFrame() ?
GetFlyFrame()->GetAnchorFrame() :
GetFlyFrame()->GetAnchorFrame()->GetUpper();
@@ -1167,7 +1167,7 @@ sal_uInt16 SwVirtFlyDrawObj::getPossibleRotationFromFraphicFrame(Size& rSize) co
return nRetval;
}
-long SwVirtFlyDrawObj::GetRotateAngle() const
+tools::Long SwVirtFlyDrawObj::GetRotateAngle() const
{
if(ContainsSwGrfNode())
{
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index f373c85963ba..bd0cfc1972fb 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1858,7 +1858,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces )
SwTextFrameInfo aFInfo( m_pCurTextFrame );
const SwTextFrame * pNextFrame = GetNextNode();
while (CanJoin(pNextFrame) &&
- 20 < std::abs( static_cast<long>(nSpaces - aFInfo.SetFrame(
+ 20 < std::abs( static_cast<tools::Long>(nSpaces - aFInfo.SetFrame(
EnsureFormatted(*pNextFrame)).GetLineStart()) )
)
{
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index f5c332a72bfc..d0a3730e000b 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -526,7 +526,7 @@ bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const
pCNd->GetAttr( RES_LR_SPACE ));
if( bRight )
{
- long nNext = rLS.GetTextLeft() + nDefDist;
+ tools::Long nNext = rLS.GetTextLeft() + nDefDist;
if( bModulus )
nNext = ( nNext / nDefDist ) * nDefDist;
SwFrame* pFrame = pCNd->getLayoutFrame( GetLayout() );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 1e16460f49e2..cacb319b15da 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -871,18 +871,18 @@ sal_uInt16 SwEditShell::GetLineCount()
return nRet;
}
-long SwEditShell::CompareDoc( const SwDoc& rDoc )
+tools::Long SwEditShell::CompareDoc( const SwDoc& rDoc )
{
StartAllAction();
- long nRet = GetDoc()->CompareDoc( rDoc );
+ tools::Long nRet = GetDoc()->CompareDoc( rDoc );
EndAllAction();
return nRet;
}
-long SwEditShell::MergeDoc( const SwDoc& rDoc )
+tools::Long SwEditShell::MergeDoc( const SwDoc& rDoc )
{
StartAllAction();
- long nRet = GetDoc()->MergeDoc( rDoc );
+ tools::Long nRet = GetDoc()->MergeDoc( rDoc );
EndAllAction();
return nRet;
}
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 0b96be07b05c..354e2782e20c 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -390,7 +390,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
EndAllAction();
}
-bool SwEditShell::MoveParagraph( long nOffset )
+bool SwEditShell::MoveParagraph( tools::Long nOffset )
{
StartAllAction();
@@ -444,7 +444,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft )
if( bUpperLower )
{
// on top of the next numbering
- long nOffset = 0;
+ tools::Long nOffset = 0;
const SwNode* pNd;
if( bUpperLeft ) // move up
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 81948ff54056..752193225283 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -890,9 +890,9 @@ static OUString lcl_BoxNmToRel( const SwTable& rTable, const SwTableNode& rTable
// If the formula is spanning over a table then keep external presentation
if( &rTable == &rTableNd.GetTable() )
{
- long nBox = SwTable::GetBoxNum( sTmp, true );
+ tools::Long nBox = SwTable::GetBoxNum( sTmp, true );
nBox -= SwTable::GetBoxNum( sRefBoxNm, true );
- long nLine = SwTable::GetBoxNum( sTmp );
+ tools::Long nLine = SwTable::GetBoxNum( sTmp );
nLine -= SwTable::GetBoxNum( sRefBoxNm );
const OUString sCpy = sTmp; //JP 01.11.95: add rest from box name
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 196dcba31d3b..051e7e674c09 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1015,8 +1015,8 @@ static double lcl_TimeToDouble( const T& rTime )
template<class D>
static double lcl_DateToDouble( const D& rDate, const Date& rNullDate )
{
- long nDate = Date::DateToDays( rDate.Day, rDate.Month, rDate.Year );
- long nNullDate = Date::DateToDays( rNullDate.GetDay(), rNullDate.GetMonth(), rNullDate.GetYear() );
+ tools::Long nDate = Date::DateToDays( rDate.Day, rDate.Month, rDate.Year );
+ tools::Long nNullDate = Date::DateToDays( rNullDate.GetDay(), rNullDate.GetMonth(), rNullDate.GetYear() );
return double( nDate - nNullDate );
}
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index d68fe77beabe..df3d15aafc49 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -141,7 +141,7 @@ Date SwDateTimeField::GetDate() const
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
const Date& rNullDate = pFormatter->GetNullDate();
- long nVal = static_cast<long>( GetValue() );
+ tools::Long nVal = static_cast<tools::Long>( GetValue() );
Date aDate = rNullDate + nVal;
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 85898389d69e..d647fc9621bf 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -206,9 +206,9 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
: aRet;
}
-long SwPostItHelper::getLayoutHeight( const SwRootFrame* pRoot )
+tools::Long SwPostItHelper::getLayoutHeight( const SwRootFrame* pRoot )
{
- long nRet = pRoot ? pRoot->getFrameArea().Height() : 0;
+ tools::Long nRet = pRoot ? pRoot->getFrameArea().Height() : 0;
return nRet;
}
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 9a83a033fb76..7afe6ee04afa 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1399,8 +1399,8 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
const SwFrameFormat *pFormat = pFly->GetFormat();
const SwFormatVertOrient &rVert = pFormat->GetVertOrient();
const SwFormatHoriOrient &rHori = pFormat->GetHoriOrient();
- const long lXDiff = aPt.getX() - pFly->getFrameArea().Left();
- const long lYDiff = aPt.getY() - pFly->getFrameArea().Top();
+ const tools::Long lXDiff = aPt.getX() - pFly->getFrameArea().Left();
+ const tools::Long lYDiff = aPt.getY() - pFly->getFrameArea().Top();
const Point aTmp( rHori.GetPos() + lXDiff,
rVert.GetPos() + lYDiff );
pFly->ChgRelPos( aTmp );
@@ -1796,11 +1796,11 @@ void SwFEShell::ReplaceSdrObj( const OUString& rGrfName, const Graphic* pGrf )
const tools::Rectangle &rBound = pObj->GetSnapRect();
Point aRelPos( pObj->GetRelativePos() );
- const long nWidth = rBound.Right() - rBound.Left();
- const long nHeight= rBound.Bottom() - rBound.Top();
+ const tools::Long nWidth = rBound.Right() - rBound.Left();
+ const tools::Long nHeight= rBound.Bottom() - rBound.Top();
aFrameSet.Put( SwFormatFrameSize( SwFrameSize::Minimum,
- std::max( nWidth, long(MINFLY) ),
- std::max( nHeight, long(MINFLY) )));
+ std::max( nWidth, tools::Long(MINFLY) ),
+ std::max( nHeight, tools::Long(MINFLY) )));
if( SfxItemState::SET != aFrameSet.GetItemState( RES_HORI_ORIENT ))
aFrameSet.Put( SwFormatHoriOrient( aRelPos.getX(), text::HoriOrientation::NONE, text::RelOrientation::FRAME ));
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 47760d2e0df6..8cf74ca1e8f7 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -117,8 +117,8 @@ namespace {
if( pLineEndList.is() )
{
OUString aArrowName( SvxResId(pResId) );
- long nCount = pLineEndList->Count();
- long nIndex;
+ tools::Long nCount = pLineEndList->Count();
+ tools::Long nIndex;
for( nIndex = 0; nIndex < nCount; nIndex++ )
{
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
@@ -957,12 +957,12 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1
}
SfxItemSet aSet( rModel.GetItemPool() );
- long nWidth = 100; // (1/100th mm)
+ tools::Long nWidth = 100; // (1/100th mm)
// determine line width and calculate with it the line end width
if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
{
- long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
+ tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
if( nValue > 0 )
nWidth = nValue * 3;
}
@@ -1472,7 +1472,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool
const SdrObject *pBest = nullptr,
*pTop = nullptr;
- const long nTmp = bNext ? LONG_MAX : 0;
+ const tools::Long nTmp = bNext ? LONG_MAX : 0;
Point aBestPos( nTmp, nTmp );
Point aTopPos( nTmp, nTmp );
Point aCurPos;
@@ -1970,10 +1970,10 @@ bool SwFEShell::ImpEndCreate()
if( OBJ_NONE == nIdent )
{
// For OBJ_NONE a fly is inserted.
- const long nWidth = rBound.Right() - rBound.Left();
- const long nHeight= rBound.Bottom() - rBound.Top();
- aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, std::max( nWidth, long(MINFLY) ),
- std::max( nHeight, long(MINFLY) )));
+ const tools::Long nWidth = rBound.Right() - rBound.Left();
+ const tools::Long nHeight= rBound.Bottom() - rBound.Top();
+ aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, std::max( nWidth, tools::Long(MINFLY) ),
+ std::max( nHeight, tools::Long(MINFLY) )));
SwFormatHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
SwFormatVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
@@ -2910,7 +2910,7 @@ void SwFEShell::SetChainMarker()
}
}
-long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
+tools::Long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
{
SwFrame *pFrame = GetCurrFrame();
// Is the cursor at this moment in a SectionFrame?
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index ac99bd2777e4..97878a01e3ea 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -66,7 +66,7 @@ using namespace ::com::sun::star;
// also see swtable.cxx
#define COLFUZZY 20L
-static bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; }
+static bool IsSame( tools::Long nA, tools::Long nB ) { return std::abs(nA-nB) <= COLFUZZY; }
namespace {
@@ -576,12 +576,12 @@ void SwFEShell::GetTabRows_(SwTabCols &rToFill, const SwFrame *pBox) const
bDel = false;
SwRectFnSet aRectFnSet(pTab);
const SwPageFrame* pPage = pTab->FindPageFrame();
- const long nLeftMin = ( aRectFnSet.IsVert() ?
+ const tools::Long nLeftMin = ( aRectFnSet.IsVert() ?
pTab->GetPrtLeft() - pPage->getFrameArea().Left() :
pTab->GetPrtTop() - pPage->getFrameArea().Top() );
- const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0;
- const long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea());
- const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX;
+ const tools::Long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0;
+ const tools::Long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea());
+ const tools::Long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX;
if (m_pRowCache->pLastTabFrame != pTab || m_pRowCache->pLastCellFrame != pBox)
bDel = true;
@@ -1346,9 +1346,9 @@ size_t SwFEShell::GetCurTabColNum() const
if( pFrame->FindTabFrame()->IsRightToLeft() )
{
- long nX = aRectFnSet.GetRight(pFrame->getFrameArea()) - aRectFnSet.GetLeft(pPage->getFrameArea());
+ tools::Long nX = aRectFnSet.GetRight(pFrame->getFrameArea()) - aRectFnSet.GetLeft(pPage->getFrameArea());
- const long nRight = aTabCols.GetLeftMin() + aTabCols.GetRight();
+ const tools::Long nRight = aTabCols.GetLeftMin() + aTabCols.GetRight();
if ( !::IsSame( nX, nRight ) )
{
@@ -1363,10 +1363,10 @@ size_t SwFEShell::GetCurTabColNum() const
}
else
{
- const long nX = aRectFnSet.GetLeft(pFrame->getFrameArea()) -
+ const tools::Long nX = aRectFnSet.GetLeft(pFrame->getFrameArea()) -
aRectFnSet.GetLeft(pPage->getFrameArea());
- const long nLeft = aTabCols.GetLeftMin();
+ const tools::Long nLeft = aTabCols.GetLeftMin();
if ( !::IsSame( nX, nLeft + aTabCols.GetLeft() ) )
{
@@ -2060,13 +2060,13 @@ size_t SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const
OSL_ENSURE( pFrame, "Table not found" );
if( pFrame )
{
- const long nX = pFrame->getFrameArea().Left();
+ const tools::Long nX = pFrame->getFrameArea().Left();
// get TabCols, only via these we get the position
SwTabCols aTabCols;
GetMouseTabCols( aTabCols, rPt );
- const long nLeft = aTabCols.GetLeftMin();
+ const tools::Long nLeft = aTabCols.GetLeftMin();
if ( !::IsSame( nX, nLeft + aTabCols.GetLeft() ) )
{
@@ -2156,7 +2156,7 @@ void SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16
// then it should be recalculated to absolute values now
const SwFormatFrameSize& rTableFrameSz = pTab->GetFormat()->GetFrameSize();
SwRectFnSet aRectFnSet(pTab);
- long nPrtWidth = aRectFnSet.GetWidth(pTab->getFramePrintArea());
+ tools::Long nPrtWidth = aRectFnSet.GetWidth(pTab->getFramePrintArea());
TableChgWidthHeightType eTypePos = extractPosition(eType);
if( TableChgMode::VarWidthChangeAbs == pTab->GetTable()->GetTableChgMode() &&
( eTypePos == TableChgWidthHeightType::ColLeft || eTypePos == TableChgWidthHeightType::ColRight ) &&
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 662b681dc91c..fd1d137b15f4 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -192,7 +192,7 @@ sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const
return 0;
}
-bool SwFEShell::GetPageNumber( long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay) const
+bool SwFEShell::GetPageNumber( tools::Long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, OUString &rDisplay) const
{
const SwFrame *pPage;
@@ -1083,7 +1083,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
if ( pUpper->IsCellFrame() )//MA_FLY_HEIGHT
{
const SwFrame* pTab = pUpper->FindTabFrame();
- long nBottom = aRectFnSet.GetPrtBottom(*pTab->GetUpper());
+ tools::Long nBottom = aRectFnSet.GetPrtBottom(*pTab->GetUpper());
aRectFnSet.SetBottom( _orRect, nBottom );
}
}
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 81ab48f4accd..aca6663389bd 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -81,8 +81,8 @@ struct CmpLPt
return Y() < rCmp.Y() || ( Y() == rCmp.Y() && X() < rCmp.X() );
}
- long X() const { return aPos.X(); }
- long Y() const { return aPos.Y(); }
+ tools::Long X() const { return aPos.X(); }
+ tools::Long Y() const { return aPos.Y(); }
};
}
@@ -531,15 +531,15 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
const SwRect& rUnion = pUnion->GetUnion(),
& rFrameRect = pCell->getFrameArea();
- const long nUnionRight = rUnion.Right();
- const long nUnionBottom = rUnion.Bottom();
- const long nFrameRight = rFrameRect.Right();
- const long nFrameBottom = rFrameRect.Bottom();
+ const tools::Long nUnionRight = rUnion.Right();
+ const tools::Long nUnionBottom = rUnion.Bottom();
+ const tools::Long nFrameRight = rFrameRect.Right();
+ const tools::Long nFrameBottom = rFrameRect.Bottom();
// ignore if FrameRect is outside the union
- const long nXFuzzy = aRectFnSet.IsVert() ? 0 : 20;
- const long nYFuzzy = aRectFnSet.IsVert() ? 20 : 0;
+ const tools::Long nXFuzzy = aRectFnSet.IsVert() ? 0 : 20;
+ const tools::Long nYFuzzy = aRectFnSet.IsVert() ? 20 : 0;
if( !( rUnion.Top() + nYFuzzy > nFrameBottom ||
nUnionBottom < rFrameRect.Top() + nYFuzzy ||
@@ -586,9 +586,9 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
// they're all adjacent
size_t n;
sal_uInt16 nCellCnt = 0;
- long nYPos = LONG_MAX;
- long nXPos = 0;
- long nHeight = 0;
+ tools::Long nYPos = LONG_MAX;
+ tools::Long nXPos = 0;
+ tools::Long nHeight = 0;
for( n = 0 ; n < aCellFrames.size(); ++n )
{
@@ -961,7 +961,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
GetSttNd()->FindTableNode());
MergePos aPosArr; // Sort-Array with the frame positions
- long nWidth;
+ tools::Long nWidth;
SwTableBox* pLastBox = nullptr;
SwRectFnSet aRectFnSet(pStart->GetUpper());
@@ -1006,7 +1006,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
nWidth = rUnion.Right() - pCell->getFrameArea().Left();
nWidth = nWidth * aNew.GetWidth() /
pCell->getFrameArea().Width();
- long nTmpWidth = aNew.GetWidth() - nWidth;
+ tools::Long nTmpWidth = aNew.GetWidth() - nWidth;
aNew.SetWidth( nWidth );
pBox->GetFrameFormat()->SetFormatAttr( aNew );
// this box is selected
@@ -1043,10 +1043,10 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
pBox->ClaimFrameFormat();
SwFormatFrameSize aNew(
pBox->GetFrameFormat()->GetFrameSize() );
- long nLeft = rUnion.Left() - pCell->getFrameArea().Left();
+ tools::Long nLeft = rUnion.Left() - pCell->getFrameArea().Left();
nLeft = nLeft * aNew.GetWidth() /
pCell->getFrameArea().Width();
- long nRight = pCell->getFrameArea().Right() - rUnion.Right();
+ tools::Long nRight = pCell->getFrameArea().Right() - rUnion.Right();
nRight = nRight * aNew.GetWidth() /
pCell->getFrameArea().Width();
nWidth = aNew.GetWidth() - nLeft - nRight;
@@ -1098,7 +1098,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
lcl_InsTableBox( pTableNd, pDoc, pBox, nInsPos );
SwFormatFrameSize aNew(pBox->GetFrameFormat()->GetFrameSize() );
- long nLeft = rUnion.Left() - pCell->getFrameArea().Left(),
+ tools::Long nLeft = rUnion.Left() - pCell->getFrameArea().Left(),
nRight = pCell->getFrameArea().Right() - rUnion.Left();
nLeft = nLeft * aNew.GetWidth() /
@@ -1295,7 +1295,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// DEL_ALL_EMPTY_BOXES
nWidth = 0;
- long nY = !aPosArr.empty() ?
+ tools::Long nY = !aPosArr.empty() ?
( aRectFnSet.IsVert() ?
aPosArr[ 0 ].X() :
aPosArr[ 0 ].Y() ) :
@@ -1517,8 +1517,8 @@ TableMergeErr CheckMergeSel( const SwSelBoxes& rBoxes )
return eRet;
}
-static SwTwips lcl_CalcWish( const SwLayoutFrame *pCell, long nWish,
- const long nAct )
+static SwTwips lcl_CalcWish( const SwLayoutFrame *pCell, tools::Long nWish,
+ const tools::Long nAct )
{
const SwLayoutFrame *pTmp = pCell;
if ( !nWish )
@@ -1629,8 +1629,8 @@ static void lcl_FindStartEndCol( const SwLayoutFrame *&rpStart,
SwRectFnSet aRectFnSet(pTab);
bool bRTL = pTab->IsRightToLeft();
- const long nTmpWish = pOrg->GetFormat()->GetFrameSize().GetWidth();
- const long nWish = ( nTmpWish > 0 ) ? nTmpWish : 1;
+ const tools::Long nTmpWish = pOrg->GetFormat()->GetFrameSize().GetWidth();
+ const tools::Long nWish = ( nTmpWish > 0 ) ? nTmpWish : 1;
while ( pTab->IsFollow() )
{
@@ -1799,8 +1799,8 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart,
else
{
SwRectFnSet aRectFnSet(pTable);
- long nSttTop = aRectFnSet.GetTop(pStart->getFrameArea());
- long nEndTop = aRectFnSet.GetTop(pEnd->getFrameArea());
+ tools::Long nSttTop = aRectFnSet.GetTop(pStart->getFrameArea());
+ tools::Long nEndTop = aRectFnSet.GetTop(pEnd->getFrameArea());
if( nSttTop == nEndTop )
{
if( aRectFnSet.GetLeft(pStart->getFrameArea()) >
@@ -1832,24 +1832,24 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart,
pTable = pStart->FindTabFrame();
pEndTable = pEnd->FindTabFrame();
- const long nStSz = pStart->GetFormat()->GetFrameSize().GetWidth();
- const long nEdSz = pEnd->GetFormat()->GetFrameSize().GetWidth();
- const long nWish = std::max( 1L, pTable->GetFormat()->GetFrameSize().GetWidth() );
+ const tools::Long nStSz = pStart->GetFormat()->GetFrameSize().GetWidth();
+ const tools::Long nEdSz = pEnd->GetFormat()->GetFrameSize().GetWidth();
+ const tools::Long nWish = std::max( 1L, pTable->GetFormat()->GetFrameSize().GetWidth() );
while ( pTable )
{
SwRectFnSet aRectFnSet(pTable);
- const long nOfst = aRectFnSet.GetPrtLeft(*pTable);
- const long nPrtWidth = aRectFnSet.GetWidth(pTable->getFramePrintArea());
- long nSt1 = ::lcl_CalcWish( pStart, nWish, nPrtWidth ) + nOfst;
- long nEd1 = ::lcl_CalcWish( pEnd, nWish, nPrtWidth ) + nOfst;
+ const tools::Long nOfst = aRectFnSet.GetPrtLeft(*pTable);
+ const tools::Long nPrtWidth = aRectFnSet.GetWidth(pTable->getFramePrintArea());
+ tools::Long nSt1 = ::lcl_CalcWish( pStart, nWish, nPrtWidth ) + nOfst;
+ tools::Long nEd1 = ::lcl_CalcWish( pEnd, nWish, nPrtWidth ) + nOfst;
if ( nSt1 <= nEd1 )
- nEd1 += static_cast<long>((nEdSz * nPrtWidth) / nWish) - 1;
+ nEd1 += static_cast<tools::Long>((nEdSz * nPrtWidth) / nWish) - 1;
else
- nSt1 += static_cast<long>((nStSz * nPrtWidth) / nWish) - 1;
+ nSt1 += static_cast<tools::Long>((nStSz * nPrtWidth) / nWish) - 1;
- long nSt2;
- long nEd2;
+ tools::Long nSt2;
+ tools::Long nEd2;
if( pTable->IsAnLower( pStart ) )
nSt2 = aRectFnSet.GetTop(pStart->getFrameArea());
else
@@ -1861,13 +1861,13 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart,
Point aSt, aEd;
if( nSt1 > nEd1 )
{
- long nTmp = nSt1;
+ tools::Long nTmp = nSt1;
nSt1 = nEd1;
nEd1 = nTmp;
}
if( nSt2 > nEd2 )
{
- long nTmp = nSt2;
+ tools::Long nTmp = nSt2;
nSt2 = nEd2;
nEd2 = nTmp;
}
diff --git a/sw/source/core/inc/DocumentStatisticsManager.hxx b/sw/source/core/inc/DocumentStatisticsManager.hxx
index ab82a767ae41..7986610e9bfc 100644
--- a/sw/source/core/inc/DocumentStatisticsManager.hxx
+++ b/sw/source/core/inc/DocumentStatisticsManager.hxx
@@ -21,6 +21,7 @@
#include <IDocumentStatistics.hxx>
#include <SwDocIdle.hxx>
+#include <tools/long.hxx>
#include <memory>
class SwDoc;
@@ -56,7 +57,7 @@ private:
*
* returns false when there is no more to calculate
*/
- bool IncrementalDocStatCalculate(long nChars, bool bFields = true);
+ bool IncrementalDocStatCalculate(tools::Long nChars, bool bFields = true);
// Our own 'StatsUpdateTimer' calls the following method
DECL_LINK( DoIdleStatsUpdate, Timer *, void );
diff --git a/sw/source/core/inc/UndoNumbering.hxx b/sw/source/core/inc/UndoNumbering.hxx
index 57a833b86760..5414b70257a2 100644
--- a/sw/source/core/inc/UndoNumbering.hxx
+++ b/sw/source/core/inc/UndoNumbering.hxx
@@ -83,10 +83,10 @@ public:
class SwUndoMoveNum : public SwUndo, private SwUndRng
{
sal_uLong m_nNewStart;
- long m_nOffset;
+ tools::Long m_nOffset;
public:
- SwUndoMoveNum( const SwPaM& rPam, long nOffset, bool bIsOutlMv );
+ SwUndoMoveNum( const SwPaM& rPam, tools::Long nOffset, bool bIsOutlMv );
virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
diff --git a/sw/source/core/inc/UndoRedline.hxx b/sw/source/core/inc/UndoRedline.hxx
index 1688e2872578..7eaf23a62a22 100644
--- a/sw/source/core/inc/UndoRedline.hxx
+++ b/sw/source/core/inc/UndoRedline.hxx
@@ -22,6 +22,7 @@
#include <memory>
#include <undobj.hxx>
+#include <tools/long.hxx>
struct SwSortOptions;
class SwRangeRedline;
@@ -68,7 +69,7 @@ public:
bool CanGrouping( const SwUndoRedlineDelete& rPrev );
// SwUndoTableCpyTable needs this information:
- long NodeDiff() const { return m_nSttNode - m_nEndNode; }
+ tools::Long NodeDiff() const { return m_nSttNode - m_nEndNode; }
sal_Int32 ContentStart() const { return m_nSttContent; }
void SetRedlineText(const OUString & rText);
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index b5e925e48fbf..15bb1dc85bea 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SW_SOURCE_CORE_INC_UNDOTABLE_HXX
#include <o3tl/deleter.hxx>
+#include <tools/long.hxx>
#include <ndarr.hxx>
#include <undobj.hxx>
#include <set>
@@ -176,7 +177,7 @@ class SwUndoTableNdsChg : public SwUndo
};
std::unique_ptr< std::set<BoxMove> > m_pNewSttNds;
std::unique_ptr<SwUndoSaveSections> m_pDelSects;
- long m_nMin, m_nMax; // for redo of delete column
+ tools::Long m_nMin, m_nMax; // for redo of delete column
sal_uLong m_nSttNode;
sal_uInt16 m_nCount;
bool m_bFlag;
@@ -189,7 +190,7 @@ public:
SwUndoTableNdsChg( SwUndoId UndoId,
const SwSelBoxes& rBoxes,
const SwTableNode& rTableNd,
- long nMn, long nMx,
+ tools::Long nMn, tools::Long nMx,
sal_uInt16 nCnt, bool bFlg, bool bSameHeight );
virtual ~SwUndoTableNdsChg() override;
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index e98654ae4765..4e4aa9b016c3 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -60,7 +60,7 @@ public:
// used for rowspan stuff:
const SwCellFrame& FindStartEndOfRowSpanCell( bool bStart ) const;
- long GetLayoutRowSpan() const;
+ tools::Long GetLayoutRowSpan() const;
void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
};
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 2daec8fdd81a..3b85365d3668 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -92,7 +92,7 @@ public:
inline SwContentFrame* GetNextContentFrame() const;
inline SwContentFrame* GetPrevContentFrame() const;
static bool CalcLowers(SwLayoutFrame & rLay, SwLayoutFrame const& rDontLeave,
- long nBottom, bool bSkipRowSpanCells);
+ tools::Long nBottom, bool bSkipRowSpanCells);
};
inline SwContentFrame* SwContentFrame::GetNextContentFrame() const
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 8da47dafda1d..e0ace3274bf5 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -99,7 +99,7 @@ public:
// we treat the size calculation completely on ourself here
virtual const tools::Rectangle& GetCurrentBoundRect() const override;
virtual const tools::Rectangle& GetLastBoundRect() const override;
- virtual long GetRotateAngle() const override;
+ virtual tools::Long GetRotateAngle() const override;
virtual void RecalcBoundRect() override;
virtual void RecalcSnapRect() override;
virtual const tools::Rectangle& GetSnapRect() const override;
@@ -118,7 +118,7 @@ public:
const Fraction& yFact, bool bUnsetRelative = true) override;
virtual void Crop(const basegfx::B2DPoint& rRef, double fxFact, double fyFact) override;
virtual void addCropHandles(SdrHdlList& rTarget) const override;
- virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs) override;
+ virtual void Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs) override;
// FullDrag support
virtual SdrObjectUniquePtr getFullDragClone() const override;
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 410943c984d1..08152e3c7181 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -55,7 +55,7 @@ class SW_DLLPUBLIC SwDrawTextInfo
SwFont *m_pFnt;
SwUnderlineFont* m_pUnderFnt;
TextFrameIndex* m_pHyphPos;
- long m_nKanaDiff;
+ tools::Long m_nKanaDiff;
TextFrameIndex m_nIdx;
TextFrameIndex m_nLen;
/// this is not a string index
@@ -63,9 +63,9 @@ class SW_DLLPUBLIC SwDrawTextInfo
sal_uInt16 m_nWidth;
sal_uInt16 m_nAscent;
sal_uInt16 m_nCompress;
- long m_nSperren;
- long m_nSpace;
- long m_nKern;
+ tools::Long m_nSperren;
+ tools::Long m_nSpace;
+ tools::Long m_nKern;
TextFrameIndex m_nNumberOfBlanks;
sal_uInt8 m_nCursorBidiLevel;
bool m_bBullet : 1;
@@ -283,7 +283,7 @@ public:
return m_nIdx + m_nLen;
}
- long GetKanaDiff() const
+ tools::Long GetKanaDiff() const
{
#ifdef DBG_UTIL
OSL_ENSURE( m_bKana, "DrawTextInfo: Undefined kana difference" );
@@ -309,7 +309,7 @@ public:
return m_nCompress;
}
- long GetSperren() const
+ tools::Long GetSperren() const
{
#ifdef DBG_UTIL
OSL_ENSURE( m_bSperr, "DrawTextInfo: Undefined >Sperren<" );
@@ -317,12 +317,12 @@ public:
return m_nSperren;
}
- long GetKern() const
+ tools::Long GetKern() const
{
return m_nKern;
}
- long GetSpace() const
+ tools::Long GetSpace() const
{
#ifdef DBG_UTIL
OSL_ENSURE( m_bSpace, "DrawTextInfo: Undefined Spacing" );
@@ -471,7 +471,7 @@ public:
#endif
}
- void SetKanaDiff( long nNew )
+ void SetKanaDiff( tools::Long nNew )
{
m_nKanaDiff = nNew;
#ifdef DBG_UTIL
@@ -492,12 +492,12 @@ public:
#endif
}
- void SetKern( long nNew )
+ void SetKern( tools::Long nNew )
{
m_nKern = nNew;
}
- void SetSpace( long nNew )
+ void SetSpace( tools::Long nNew )
{
if( nNew < 0 )
{
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 5a6e4643bda2..82a67b9b5342 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -226,7 +226,7 @@ public:
void RegistFlys();
//see layact.cxx
- void AddRefOfst( long nOfst ) { m_aRef.AdjustY( nOfst ); }
+ void AddRefOfst( tools::Long nOfst ) { m_aRef.AdjustY( nOfst ); }
// #i26791#
virtual void MakeObjPos() override;
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index f908ed62ec0d..61564de93e72 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -98,7 +98,7 @@ class SwFntObj : public SwCacheObj
/// Cache of already calculated layout glyphs.
std::map<SwTextGlyphsKey, SalLayoutGlyphs> m_aTextGlyphs;
- static long nPixWidth;
+ static tools::Long nPixWidth;
static MapMode *pPixMap;
public:
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ac5bc9570569..27622be75dbb 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -870,20 +870,20 @@ public:
bool IsInDtor() const { return mbInDtor; }
// No inline cause we need the function pointers
- long GetTopMargin() const;
- long GetBottomMargin() const;
- long GetLeftMargin() const;
- long GetRightMargin() const;
- void SetTopBottomMargins( long, long );
- void SetLeftRightMargins( long, long );
- void SetRightLeftMargins( long, long );
- long GetPrtLeft() const;
- long GetPrtBottom() const;
- long GetPrtRight() const;
- long GetPrtTop() const;
- bool SetMinLeft( long );
- bool SetMaxBottom( long );
- bool SetMaxRight( long );
+ tools::Long GetTopMargin() const;
+ tools::Long GetBottomMargin() const;
+ tools::Long GetLeftMargin() const;
+ tools::Long GetRightMargin() const;
+ void SetTopBottomMargins( tools::Long, tools::Long );
+ void SetLeftRightMargins( tools::Long, tools::Long );
+ void SetRightLeftMargins( tools::Long, tools::Long );
+ tools::Long GetPrtLeft() const;
+ tools::Long GetPrtBottom() const;
+ tools::Long GetPrtRight() const;
+ tools::Long GetPrtTop() const;
+ bool SetMinLeft( tools::Long );
+ bool SetMaxBottom( tools::Long );
+ bool SetMaxRight( tools::Long );
void MakeBelowPos( const SwFrame*, const SwFrame*, bool );
void MakeLeftPos( const SwFrame*, const SwFrame*, bool );
void MakeRightPos( const SwFrame*, const SwFrame*, bool );
@@ -1259,10 +1259,10 @@ public:
};
typedef long (SwFrame::*SwFrameGet)() const;
-typedef bool (SwFrame::*SwFrameMax)( long );
+typedef bool (SwFrame::*SwFrameMax)( tools::Long );
typedef void (SwFrame::*SwFrameMakePos)( const SwFrame*, const SwFrame*, bool );
-typedef long (*SwOperator)( long, long );
-typedef void (SwFrame::*SwFrameSet)( long, long );
+typedef long (*SwOperator)( tools::Long, tools::Long );
+typedef void (SwFrame::*SwFrameSet)( tools::Long, tools::Long );
struct SwRectFnCollection
{
@@ -1352,58 +1352,58 @@ public:
|| (rRect1.*m_fnRect->fnGetLeft)() != (rRect2.*m_fnRect->fnGetLeft)());
}
- long GetTop (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetTop) (); }
- long GetBottom(const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetBottom)(); }
- long GetLeft (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetLeft) (); }
- long GetRight (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetRight) (); }
- long GetWidth (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetWidth) (); }
- long GetHeight(const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetHeight)(); }
+ tools::Long GetTop (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetTop) (); }
+ tools::Long GetBottom(const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetBottom)(); }
+ tools::Long GetLeft (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetLeft) (); }
+ tools::Long GetRight (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetRight) (); }
+ tools::Long GetWidth (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetWidth) (); }
+ tools::Long GetHeight(const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetHeight)(); }
Point GetPos (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetPos) (); }
Size GetSize (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetSize) (); }
- void SetTop (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetTop) (nNew); }
- void SetBottom(SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetBottom)(nNew); }
- void SetLeft (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetLeft) (nNew); }
- void SetRight (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetRight) (nNew); }
- void SetWidth (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetWidth) (nNew); }
- void SetHeight(SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetHeight)(nNew); }
-
- void SubTop (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSubTop) (nNew); }
- void AddBottom(SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnAddBottom)(nNew); }
- void SubLeft (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSubLeft) (nNew); }
- void AddRight (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnAddRight) (nNew); }
- void AddWidth (SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnAddWidth) (nNew); }
- void AddHeight(SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnAddHeight)(nNew); }
-
- void SetPosX(SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetPosX)(nNew); }
- void SetPosY(SwRect& rRect, long nNew) const { (rRect.*m_fnRect->fnSetPosY)(nNew); }
-
- long GetTopMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetTopMargin) (); }
- long GetBottomMargin(const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetBottomMargin)(); }
- long GetLeftMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetLeftMargin) (); }
- long GetRightMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetRightMargin) (); }
- void SetXMargins(SwFrame& rFrame, long nLeft, long nRight) const { (rFrame.*m_fnRect->fnSetXMargins)(nLeft, nRight); }
- void SetYMargins(SwFrame& rFrame, long nTop, long nBottom) const { (rFrame.*m_fnRect->fnSetYMargins)(nTop, nBottom); }
- long GetPrtTop (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtTop) (); }
- long GetPrtBottom (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtBottom) (); }
- long GetPrtLeft (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtLeft) (); }
- long GetPrtRight (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtRight) (); }
- long TopDist (const SwRect& rRect, long nPos) const { return (rRect.*m_fnRect->fnTopDist) (nPos); }
- long BottomDist(const SwRect& rRect, long nPos) const { return (rRect.*m_fnRect->fnBottomDist) (nPos); }
- long LeftDist (const SwRect& rRect, long nPos) const { return (rRect.*m_fnRect->fnLeftDist) (nPos); }
- long RightDist (const SwRect& rRect, long nPos) const { return (rRect.*m_fnRect->fnRightDist) (nPos); }
- void SetLimit (SwFrame& rFrame, long nNew) const { (rFrame.*m_fnRect->fnSetLimit) (nNew); }
- bool OverStep (const SwRect& rRect, long nPos) const { return (rRect.*m_fnRect->fnOverStep) (nPos); }
+ void SetTop (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetTop) (nNew); }
+ void SetBottom(SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetBottom)(nNew); }
+ void SetLeft (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetLeft) (nNew); }
+ void SetRight (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetRight) (nNew); }
+ void SetWidth (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetWidth) (nNew); }
+ void SetHeight(SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetHeight)(nNew); }
+
+ void SubTop (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSubTop) (nNew); }
+ void AddBottom(SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnAddBottom)(nNew); }
+ void SubLeft (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSubLeft) (nNew); }
+ void AddRight (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnAddRight) (nNew); }
+ void AddWidth (SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnAddWidth) (nNew); }
+ void AddHeight(SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnAddHeight)(nNew); }
+
+ void SetPosX(SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetPosX)(nNew); }
+ void SetPosY(SwRect& rRect, tools::Long nNew) const { (rRect.*m_fnRect->fnSetPosY)(nNew); }
+
+ tools::Long GetTopMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetTopMargin) (); }
+ tools::Long GetBottomMargin(const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetBottomMargin)(); }
+ tools::Long GetLeftMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetLeftMargin) (); }
+ tools::Long GetRightMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetRightMargin) (); }
+ void SetXMargins(SwFrame& rFrame, tools::Long nLeft, tools::Long nRight) const { (rFrame.*m_fnRect->fnSetXMargins)(nLeft, nRight); }
+ void SetYMargins(SwFrame& rFrame, tools::Long nTop, tools::Long nBottom) const { (rFrame.*m_fnRect->fnSetYMargins)(nTop, nBottom); }
+ tools::Long GetPrtTop (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtTop) (); }
+ tools::Long GetPrtBottom (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtBottom) (); }
+ tools::Long GetPrtLeft (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtLeft) (); }
+ tools::Long GetPrtRight (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtRight) (); }
+ tools::Long TopDist (const SwRect& rRect, tools::Long nPos) const { return (rRect.*m_fnRect->fnTopDist) (nPos); }
+ tools::Long BottomDist(const SwRect& rRect, tools::Long nPos) const { return (rRect.*m_fnRect->fnBottomDist) (nPos); }
+ tools::Long LeftDist (const SwRect& rRect, tools::Long nPos) const { return (rRect.*m_fnRect->fnLeftDist) (nPos); }
+ tools::Long RightDist (const SwRect& rRect, tools::Long nPos) const { return (rRect.*m_fnRect->fnRightDist) (nPos); }
+ void SetLimit (SwFrame& rFrame, tools::Long nNew) const { (rFrame.*m_fnRect->fnSetLimit) (nNew); }
+ bool OverStep (const SwRect& rRect, tools::Long nPos) const { return (rRect.*m_fnRect->fnOverStep) (nPos); }
void SetPos(SwRect& rRect, const Point& rNew) const { (rRect.*m_fnRect->fnSetPos)(rNew); }
void MakePos(SwFrame& rFrame, const SwFrame* pUp, const SwFrame* pPrv, bool bNotify) const { (rFrame.*m_fnRect->fnMakePos)(pUp, pPrv, bNotify); }
- long XDiff(long n1, long n2) const { return (m_fnRect->fnXDiff) (n1, n2); }
- long YDiff(long n1, long n2) const { return (m_fnRect->fnYDiff) (n1, n2); }
- long XInc (long n1, long n2) const { return (m_fnRect->fnXInc) (n1, n2); }
- long YInc (long n1, long n2) const { return (m_fnRect->fnYInc) (n1, n2); }
+ tools::Long XDiff(tools::Long n1, tools::Long n2) const { return (m_fnRect->fnXDiff) (n1, n2); }
+ tools::Long YDiff(tools::Long n1, tools::Long n2) const { return (m_fnRect->fnYDiff) (n1, n2); }
+ tools::Long XInc (tools::Long n1, tools::Long n2) const { return (m_fnRect->fnXInc) (n1, n2); }
+ tools::Long YInc (tools::Long n1, tools::Long n2) const { return (m_fnRect->fnYInc) (n1, n2); }
- void SetLeftAndWidth(SwRect& rRect, long nLeft, long nWidth) const { (rRect.*m_fnRect->fnSetLeftAndWidth)(nLeft, nWidth); }
- void SetTopAndHeight(SwRect& rRect, long nTop, long nHeight) const { (rRect.*m_fnRect->fnSetTopAndHeight)(nTop, nHeight); }
+ void SetLeftAndWidth(SwRect& rRect, tools::Long nLeft, tools::Long nWidth) const { (rRect.*m_fnRect->fnSetLeftAndWidth)(nLeft, nWidth); }
+ void SetTopAndHeight(SwRect& rRect, tools::Long nTop, tools::Long nHeight) const { (rRect.*m_fnRect->fnSetTopAndHeight)(nTop, nHeight); }
private:
bool m_bVert;
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 027fd6b6461d..9e4565f508cf 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -157,7 +157,7 @@ extern bool bSetCompletePaintOnInvalidate;
// for table settings via keyboard
SwTwips CalcRowRstHeight( SwLayoutFrame *pRow );
-long CalcHeightWithFlys( const SwFrame *pFrame );
+tools::Long CalcHeightWithFlys( const SwFrame *pFrame );
namespace sw {
@@ -392,8 +392,8 @@ public:
inline sal_uInt16 CalcTop() const;
inline sal_uInt16 CalcBottom() const;
inline sal_uInt16 CalcLineSpacing() const;
- long CalcLeft( const SwFrame *pCaller ) const;
- long CalcRight( const SwFrame *pCaller ) const;
+ tools::Long CalcLeft( const SwFrame *pCaller ) const;
+ tools::Long CalcRight( const SwFrame *pCaller ) const;
inline bool IsLine() const;
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 990c0e4b88f0..44dfa7feb4d8 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -103,7 +103,7 @@ class SwLayAction
sal_uInt32 m_nCallCount; // calling FormatLayoutTab on the same page
void PaintContent( const SwContentFrame *, const SwPageFrame *,
- const SwRect &rOldRect, long nOldBottom );
+ const SwRect &rOldRect, tools::Long nOldBottom );
bool PaintWithoutFlys( const SwRect &, const SwContentFrame *,
const SwPageFrame * );
inline bool PaintContent_( const SwContentFrame *, const SwPageFrame *,
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 1a725dc3477e..3f73602e6bfa 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -56,7 +56,7 @@ protected:
virtual SwTwips ShrinkFrame( SwTwips, bool bTst = false, bool bInfo = false ) override;
virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
- long CalcRel( const SwFormatFrameSize &rSz ) const;
+ tools::Long CalcRel( const SwFormatFrameSize &rSz ) const;
public:
// --> #i28701#
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index a9f642c1f03e..4a337b168230 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -106,7 +106,7 @@ protected:
virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
/// Calculate the content height of a page (without columns).
- size_t GetContentHeight(const long nTop, const long nBottom) const;
+ size_t GetContentHeight(const tools::Long nTop, const tools::Long nBottom) const;
public:
SwPageFrame( SwFrameFormat*, SwFrame*, SwPageDesc* );
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index a1d2622f3c11..74a015c90d53 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -93,7 +93,7 @@ class SAL_DLLPUBLIC_RTTI SwRootFrame: public SwLayoutFrame
// the rectangle is extended to the top/bottom/left/right
// for pages located at the outer margins
SwRect maPagesArea; // the area covered by the pages
- long mnViewWidth; // the current page layout bases on this view width
+ tools::Long mnViewWidth; // the current page layout bases on this view width
sal_uInt16 mnColumns; // the current page layout bases on this number of columns
bool mbBookMode; // the current page layout is in book view
bool mbSidebarChanged; // the notes sidebar state has changed
@@ -124,7 +124,7 @@ class SAL_DLLPUBLIC_RTTI SwRootFrame: public SwLayoutFrame
* mnBrowseWidth is the outer margin of the object most to the right.
* The page's right edge should not be smaller than this value.
*/
- long mnBrowseWidth;
+ tools::Long mnBrowseWidth;
/// If we only have to format one ContentFrame, its in mpTurbo
const SwContentFrame *mpTurbo;
@@ -362,7 +362,7 @@ public:
static void SetNoVirDev(const bool bNew) { s_isNoVirDev = bNew; }
- inline long GetBrowseWidth() const;
+ inline tools::Long GetBrowseWidth() const;
inline void InvalidateBrowseWidth();
bool IsNewLayout() const { return mbIsNewLayout; }
@@ -418,7 +418,7 @@ public:
void SetHideRedlines(bool);
};
-inline long SwRootFrame::GetBrowseWidth() const
+inline tools::Long SwRootFrame::GetBrowseWidth() const
{
if ( !mbBrowseWidthValid )
const_cast<SwRootFrame*>(this)->ImplCalcBrowseWidth();
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index ead531c5c0c3..7e660309aa54 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -26,6 +26,7 @@
#include <rtl/ustrbuf.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <i18nlangtag/lang.h>
+#include <tools/long.hxx>
#include "TextFrameIndex.hxx"
class SwTextNode;
@@ -269,7 +270,7 @@ public:
// HIDDEN TEXT STUFF END
// modifies the kerning array according to a given compress value
- long Compress( long* pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen,
+ tools::Long Compress( tools::Long* pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen,
const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
const bool bCentered,
Point* pPoint = nullptr ) const;
@@ -290,8 +291,8 @@ public:
The value which has to be added to a kashida opportunity.
@return The number of kashida opportunities in the given range
*/
- sal_Int32 KashidaJustify( long* pKernArray, long* pScrArray,
- TextFrameIndex nStt, TextFrameIndex nLen, long nSpaceAdd = 0) const;
+ sal_Int32 KashidaJustify( tools::Long* pKernArray, tools::Long* pScrArray,
+ TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd = 0) const;
/** Clears array of kashidas marked as invalid
*/
@@ -363,19 +364,19 @@ public:
The value which has to be added to the cells.
@return The number of extra spaces in the given range
*/
- static TextFrameIndex ThaiJustify( const OUString& rText, long* pKernArray,
- long* pScrArray, TextFrameIndex nIdx,
+ static TextFrameIndex ThaiJustify( const OUString& rText, tools::Long* pKernArray,
+ tools::Long* pScrArray, TextFrameIndex nIdx,
TextFrameIndex nLen,
TextFrameIndex nNumberOfBlanks = TextFrameIndex(0),
- long nSpaceAdd = 0 );
+ tools::Long nSpaceAdd = 0 );
static TextFrameIndex CountCJKCharacters(const OUString &rText,
TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang);
- static void CJKJustify( const OUString& rText, long* pKernArray,
- long* pScrArray, TextFrameIndex nStt,
+ static void CJKJustify( const OUString& rText, tools::Long* pKernArray,
+ tools::Long* pScrArray, TextFrameIndex nStt,
TextFrameIndex nLen, LanguageType aLang,
- long nSpaceAdd, bool bIsSpaceStop );
+ tools::Long nSpaceAdd, bool bIsSpaceStop );
/// return a frame for the node, ScriptInfo is its member...
/// (many clients need both frame and SI, and both have to match)
diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx
index 92b678c07e52..fba72413c829 100644
--- a/sw/source/core/inc/swcache.hxx
+++ b/sw/source/core/inc/swcache.hxx
@@ -47,6 +47,7 @@
#include <vector>
#include <rtl/string.hxx>
+#include <tools/long.hxx>
class SwCacheObj;
@@ -65,19 +66,19 @@ class SwCache
#ifdef DBG_UTIL
OString m_aName;
- long m_nAppend; /// number of entries appended
- long m_nInsertFree; /// number of entries inserted on freed position
- long m_nReplace; /// number of LRU replacements
- long m_nGetSuccess;
- long m_nGetFail;
- long m_nToTop; /// number of reordering (LRU)
- long m_nDelete; /// number of explicit deletes
- long m_nGetSeek; /// number of gets without index
- long m_nAverageSeekCnt; /// number of seeks for all gets without index
- long m_nFlushCnt; /// number of flush calls
- long m_nFlushedObjects;
- long m_nIncreaseMax; /// number of cache size increases
- long m_nDecreaseMax; /// number of cache size decreases
+ tools::Long m_nAppend; /// number of entries appended
+ tools::Long m_nInsertFree; /// number of entries inserted on freed position
+ tools::Long m_nReplace; /// number of LRU replacements
+ tools::Long m_nGetSuccess;
+ tools::Long m_nGetFail;
+ tools::Long m_nToTop; /// number of reordering (LRU)
+ tools::Long m_nDelete; /// number of explicit deletes
+ tools::Long m_nGetSeek; /// number of gets without index
+ tools::Long m_nAverageSeekCnt; /// number of seeks for all gets without index
+ tools::Long m_nFlushCnt; /// number of flush calls
+ tools::Long m_nFlushedObjects;
+ tools::Long m_nIncreaseMax; /// number of cache size increases
+ tools::Long m_nDecreaseMax; /// number of cache size decreases
void Check();
#endif
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 7753f0373a9b..96d1fbe187b5 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -277,7 +277,7 @@ public:
sal_uInt8 GetPropr() const { return m_aSub[m_nActual].GetPropr(); }
FontItalic GetItalic() const { return m_aSub[m_nActual].GetItalic(); }
LanguageType GetLanguage() const { return m_aSub[m_nActual].GetLanguage(); }
- long GetHeight() const { return m_aSub[m_nActual].GetFontSize().Height(); }
+ tools::Long GetHeight() const { return m_aSub[m_nActual].GetFontSize().Height(); }
FontWeight GetWeight() const { return m_aSub[m_nActual].GetWeight(); }
FontEmphasisMark GetEmphasisMark() const
{ return m_aSub[m_nActual].GetEmphasisMark(); }
@@ -290,7 +290,7 @@ public:
{ return m_aSub[nWhich].GetLanguage(); }
rtl_TextEncoding GetCharSet( const SwFontScript nWhich ) const
{ return m_aSub[nWhich].GetCharSet(); }
- long GetHeight( const SwFontScript nWhich ) const
+ tools::Long GetHeight( const SwFontScript nWhich ) const
{ return m_aSub[nWhich].GetFontSize().Height(); }
// makes the logical font be effective in the OutputDevice
@@ -298,7 +298,7 @@ public:
TextFrameIndex GetCapitalBreak( SwViewShell const* pSh, const OutputDevice* pOut,
const SwScriptInfo* pScript, const OUString& rText,
- long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen);
+ tools::Long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen);
void DoOnCapitals( SwDoCapitals &rDo )
{ m_aSub[m_nActual].DoOnCapitals( rDo ); }
@@ -306,7 +306,7 @@ public:
Size GetTextSize_( SwDrawTextInfo& rInf )
{ rInf.SetFont( this ); return m_aSub[m_nActual].GetTextSize_( rInf ); }
- TextFrameIndex GetTextBreak( SwDrawTextInfo const & rInf, long nTextWidth );
+ TextFrameIndex GetTextBreak( SwDrawTextInfo const & rInf, tools::Long nTextWidth );
TextFrameIndex GetModelPositionForViewPoint_( SwDrawTextInfo& rInf )
{ return m_aSub[m_nActual].GetModelPositionForViewPoint_( rInf ); }
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 325515755fe8..d0eb807297a1 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -212,8 +212,8 @@ public:
bool CalcFlyOffsets(
SwTwips& rUpper,
- long& rLeftOffset,
- long& rRightOffset ) const;
+ tools::Long& rLeftOffset,
+ tools::Long& rRightOffset ) const;
SwTwips CalcHeightOfFirstContentLine() const;
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 9b059eea61c8..095c5a3c458c 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -162,7 +162,7 @@ public:
const SwFrameFormat& GetOldFormat() const { return *m_pOldFormat; }
- SwFrameFormat* GetFormat( long nWidth ) const;
+ SwFrameFormat* GetFormat( tools::Long nWidth ) const;
SwFrameFormat* GetFormat( const SfxPoolItem& rItem ) const;
void AddFormat( SwFrameFormat& rFormat );
/// @returns true, if we can delete
@@ -181,7 +181,7 @@ public:
SwShareBoxFormats() {}
~SwShareBoxFormats();
- SwFrameFormat* GetFormat( const SwFrameFormat& rFormat, long nWidth ) const;
+ SwFrameFormat* GetFormat( const SwFrameFormat& rFormat, tools::Long nWidth ) const;
SwFrameFormat* GetFormat( const SwFrameFormat& rFormat, const SfxPoolItem& ) const;
void AddFormat( const SwFrameFormat& rOld, SwFrameFormat& rNew );
diff --git a/sw/source/core/inc/txtfly.hxx b/sw/source/core/inc/txtfly.hxx
index c8c645e543e1..f6d5f8f50dd2 100644
--- a/sw/source/core/inc/txtfly.hxx
+++ b/sw/source/core/inc/txtfly.hxx
@@ -58,9 +58,9 @@ class SwContourCache
std::unique_ptr<TextRanger> mxTextRanger;
};
std::vector<CacheItem> mvItems;
- long mnPointCount;
+ tools::Long mnPointCount;
SwRect ContourRect( const SwFormat* pFormat, const SdrObject* pObj,
- const SwTextFrame* pFrame, const SwRect &rLine, const long nXPos,
+ const SwTextFrame* pFrame, const SwRect &rLine, const tools::Long nXPos,
const bool bRight );
public:
@@ -80,7 +80,7 @@ public:
static SwRect CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
const SwRect &rLine,
const SwTextFrame* pFrame,
- const long nXPos,
+ const tools::Long nXPos,
const bool bRight );
};
@@ -124,8 +124,8 @@ class SwTextFly
const SwTextFrame * m_pMaster;
std::unique_ptr<SwAnchoredObjList> mpAnchoredObjList;
- long m_nMinBottom;
- long m_nNextTop; /// Stores the upper edge of the "next" frame
+ tools::Long m_nMinBottom;
+ tools::Long m_nNextTop; /// Stores the upper edge of the "next" frame
sal_uLong m_nCurrFrameNodeIndex;
bool m_bOn : 1;
@@ -230,8 +230,8 @@ public:
const SwTextFrame* GetMaster() const;
// This temporary variable needs to be manipulated in const methods
- long GetNextTop() const;
- void SetNextTop( long nNew ) const;
+ tools::Long GetNextTop() const;
+ void SetNextTop( tools::Long nNew ) const;
/**
Determines the demanded rectangle for an anchored object,
@@ -343,12 +343,12 @@ inline const SwTextFrame* SwTextFly::GetMaster() const
return m_pMaster ? m_pMaster : const_cast<SwTextFly*>(this)->GetMaster_();
}
-inline long SwTextFly::GetNextTop() const
+inline tools::Long SwTextFly::GetNextTop() const
{
return m_nNextTop;
}
-inline void SwTextFly::SetNextTop( long nNew ) const
+inline void SwTextFly::SetNextTop( tools::Long nNew ) const
{
const_cast<SwTextFly*>(this)->m_nNextTop = nNew;
}
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 577fa8deea26..389adb8c92ad 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -162,7 +162,7 @@ class SW_DLLPUBLIC SwTextFrame: public SwContentFrame
/// will still be set; GetFormatted() is the function that forces
/// recreation of the SwLineLayout by Format() if necessary.
static SwCache *s_pTextCache;
- static constexpr long nMinPrtLine = 0; // This Line must not be underrun when printing
+ static constexpr tools::Long nMinPrtLine = 0; // This Line must not be underrun when printing
// Hack for table cells stretching multiple pages
sal_uLong mnAllLines :24; // Line count for the Paint (including nThisLines)
@@ -205,8 +205,8 @@ class SW_DLLPUBLIC SwTextFrame: public SwContentFrame
// Evaluates the Preps in Format()
bool CalcPreps();
void PrepWidows( const sal_uInt16 nNeed, bool bNotify );
- void InvalidateRange_( const SwCharRange &, const long = 0);
- inline void InvalidateRange( const SwCharRange &, const long = 0);
+ void InvalidateRange_( const SwCharRange &, const tools::Long = 0);
+ inline void InvalidateRange( const SwCharRange &, const tools::Long = 0);
// WidowsAndOrphans, AdjustFrame, AdjustFollow
void FormatAdjust( SwTextFormatter &rLine, WidowsAndOrphans &rFrameBreak,
@@ -599,7 +599,7 @@ public:
static SwCache *GetTextCache() { return s_pTextCache; }
static void SetTextCache( SwCache *pNew ) { s_pTextCache = pNew; }
- static long GetMinPrtLine() { return nMinPrtLine; }
+ static tools::Long GetMinPrtLine() { return nMinPrtLine; }
sal_uInt16 GetCacheIdx() const { return mnCacheIndex; }
void SetCacheIdx( const sal_uInt16 nNew ) { mnCacheIndex = nNew; }
@@ -637,7 +637,7 @@ public:
* @param _bNoPropLineSpacing: control, whether the value of a
* proportional line spacing is returned or not
*/
- long GetLineSpace( const bool _bNoPropLineSpacing = false ) const;
+ tools::Long GetLineSpace( const bool _bNoPropLineSpacing = false ) const;
/// Returns the first line height
sal_uInt16 FirstLineHeight() const;
@@ -687,7 +687,7 @@ public:
* Calculates the limit value when switching from
* horizontal to vertical layout
*/
- long SwitchHorizontalToVertical( long nLimit ) const;
+ tools::Long SwitchHorizontalToVertical( tools::Long nLimit ) const;
/**
* Calculates the coordinates of a rectangle when switching from
@@ -705,7 +705,7 @@ public:
* Calculates the a limit value when switching from
* vertical to horizontal layout
*/
- long SwitchVerticalToHorizontal( long nLimit ) const;
+ tools::Long SwitchVerticalToHorizontal( tools::Long nLimit ) const;
/**
* Calculates the coordinates of a rectangle when switching from
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 81f5e6aa495b..b48e307858e9 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -629,7 +629,7 @@ namespace
// With mirrored margins, when relating the size of an object from the inside margin for example, on the
// first page we calculate the new size of the object using the size of the right margin,
// on second page the left margin, third page right margin, etc.
- long getInsideOutsideRelativeWidth(bool isOutside, const SwPageFrame* const pPageFrame)
+ tools::Long getInsideOutsideRelativeWidth(bool isOutside, const SwPageFrame* const pPageFrame)
{
// Alternating between the only two possible cases: inside and outside.
// Inside = false, Outside = true.
@@ -650,10 +650,10 @@ SwRect SwAnchoredDrawObject::GetObjBoundRect() const
{
tools::Rectangle aCurrObjRect = GetDrawObj()->GetCurrentBoundRect();
- long nTargetWidth = aCurrObjRect.GetWidth( );
+ tools::Long nTargetWidth = aCurrObjRect.GetWidth( );
if ( GetDrawObj( )->GetRelativeWidth( ) )
{
- long nWidth = 0;
+ tools::Long nWidth = 0;
if (GetDrawObj()->GetRelativeWidthRelation() == text::RelOrientation::FRAME)
// Exclude margins.
nWidth = GetPageFrame()->getFramePrintArea().SVRect().GetWidth();
@@ -689,10 +689,10 @@ SwRect SwAnchoredDrawObject::GetObjBoundRect() const
bCheck = !pObjCustomShape || !pObjCustomShape->IsAutoGrowHeight();
}
- long nTargetHeight = aCurrObjRect.GetHeight();
+ tools::Long nTargetHeight = aCurrObjRect.GetHeight();
if (bCheck)
{
- long nHeight = 0;
+ tools::Long nHeight = 0;
if (GetDrawObj()->GetRelativeHeightRelation() == text::RelOrientation::FRAME)
// Exclude margins.
nHeight = GetPageFrame()->getFramePrintArea().SVRect().GetHeight();
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index 5492832663d7..4fb8b578451f 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -172,7 +172,7 @@ SwTwips SwAnchoredObject::GetRelCharY( const SwFrame* pFrame ) const
return maLastCharRect.Bottom() - pFrame->getFrameArea().Top();
}
-void SwAnchoredObject::AddLastCharY( long nDiff )
+void SwAnchoredObject::AddLastCharY( tools::Long nDiff )
{
maLastCharRect.Pos().AdjustY(nDiff );
}
@@ -575,7 +575,7 @@ const SwRect& SwAnchoredObject::GetObjRectWithSpaces() const
const SvxULSpaceItem& rUL = rFormat.GetULSpace();
const SvxLRSpaceItem& rLR = rFormat.GetLRSpace();
{
- maObjRectWithSpaces.Top ( std::max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L ));
+ maObjRectWithSpaces.Top ( std::max( maObjRectWithSpaces.Top() - tools::Long(rUL.GetUpper()), 0L ));
maObjRectWithSpaces.Left( std::max( maObjRectWithSpaces.Left()- rLR.GetLeft(), 0L ));
maObjRectWithSpaces.AddHeight(rUL.GetLower() );
maObjRectWithSpaces.AddWidth(rLR.GetRight() );
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index eb08c396e885..1c4569d15f6c 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -209,7 +209,7 @@ static void lcl_DelHFFormat( SwClient *pToRemove, SwFrameFormat *pFormat )
delete pFormat;
}
-void SwFormatFrameSize::ScaleMetrics(long lMult, long lDiv) {
+void SwFormatFrameSize::ScaleMetrics(tools::Long lMult, tools::Long lDiv) {
// Don't inherit the SvxSizeItem override (might or might not be relevant; added "just in case"
// when changing SwFormatFrameSize to derive from SvxSizeItem instead of directly from
// SfxPoolItem):
@@ -1008,7 +1008,7 @@ sal_uInt16 SwFormatCol::CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
assert(nCol < m_aColumns.size());
if ( m_nWidth != nAct )
{
- long nW = m_aColumns[nCol].GetWishWidth();
+ tools::Long nW = m_aColumns[nCol].GetWishWidth();
nW *= nAct;
nW /= m_nWidth;
return sal_uInt16(nW);
@@ -1078,7 +1078,7 @@ void SwFormatCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct )
//Convert the current width to the requested width.
for (SwColumn &rCol: m_aColumns)
{
- long nTmp = rCol.GetWishWidth();
+ tools::Long nTmp = rCol.GetWishWidth();
nTmp *= GetWishWidth();
nTmp /= nAct;
rCol.SetWishWidth(sal_uInt16(nTmp));
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 170384800c46..b5511d83682c 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -707,15 +707,15 @@ void SwFrame::MakePos()
}
// #i28701# - new type <SwSortedObjs>
-static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, long& rBot)
+static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, tools::Long& rBot)
{
// And then there can be paragraph anchored frames that sit below their paragraph.
- long nMax = 0;
+ tools::Long nMax = 0;
for (SwAnchoredObject* pObj : rSortedObjs)
{
// #i28701# - consider changed type of <SwSortedObjs>
// entries.
- long nTmp = 0;
+ tools::Long nTmp = 0;
if ( auto pFly = dynamic_cast<SwFlyFrame*>( pObj) )
{
if( pFly->getFrameArea().Top() != FAR_AWAY &&
@@ -735,17 +735,17 @@ static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, l
rBot = std::max( rBot, nMax );
}
-size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const
+size_t SwPageFrame::GetContentHeight(const tools::Long nTop, const tools::Long nBottom) const
{
OSL_ENSURE(!(FindBodyCont() && FindBodyCont()->Lower() && FindBodyCont()->Lower()->IsColumnFrame()),
"SwPageFrame::GetContentHeight(): No support for columns.");
// In pages without columns, the content defines the size.
- long nBot = getFrameArea().Top() + nTop;
+ tools::Long nBot = getFrameArea().Top() + nTop;
const SwFrame *pFrame = Lower();
while (pFrame)
{
- long nTmp = 0;
+ tools::Long nTmp = 0;
const SwFrame *pCnt = static_cast<const SwLayoutFrame*>(pFrame)->ContainsAny();
while (pCnt && (pCnt->GetUpper() == pFrame ||
static_cast<const SwLayoutFrame*>(pFrame)->IsAnLower(pCnt)))
@@ -851,10 +851,10 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
{
// In BrowseView, we use fixed settings
const Size aBorder = pRenderContext->PixelToLogic( pSh->GetBrowseBorder() );
- const long nTop = pAttrs->CalcTopLine() + aBorder.Height();
- const long nBottom = pAttrs->CalcBottomLine()+ aBorder.Height();
+ const tools::Long nTop = pAttrs->CalcTopLine() + aBorder.Height();
+ const tools::Long nBottom = pAttrs->CalcBottomLine()+ aBorder.Height();
- long nWidth = GetUpper() ? static_cast<SwRootFrame*>(GetUpper())->GetBrowseWidth() : 0;
+ tools::Long nWidth = GetUpper() ? static_cast<SwRootFrame*>(GetUpper())->GetBrowseWidth() : 0;
const auto nDefWidth = pSh->GetBrowseWidth();
if (nWidth < nDefWidth)
nWidth = nDefWidth;
@@ -874,7 +874,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
else
{
// In pages without columns, the content defines the size.
- long nBot = GetContentHeight(nTop, nBottom);
+ tools::Long nBot = GetContentHeight(nTop, nBottom);
// #i35143# - If second page frame
// exists, the first page doesn't have to fulfill the
@@ -903,7 +903,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
else if (pSh && pSh->GetViewOptions()->IsWhitespaceHidden() && pRootFrame->GetLastPage() != this)
{
- long height = 0;
+ tools::Long height = 0;
SwLayoutFrame *pBody = FindBodyCont();
if ( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrame() )
{
@@ -1001,7 +1001,7 @@ void SwLayoutFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
nPrtWidth -= pNxt->getFrameArea().Height();
}
- const long nDiff = nPrtWidth - (getFrameArea().*fnRect->fnGetWidth)();
+ const tools::Long nDiff = nPrtWidth - (getFrameArea().*fnRect->fnGetWidth)();
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
if( IsNeighbourFrame() && IsRightToLeft() )
@@ -1104,8 +1104,8 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
// At the FixSize, the surrounding Frame enforces the size;
// the borders are simply subtracted.
- const long nLeft = rAttrs.CalcLeft( this );
- const long nRight = rAttrs.CalcRight( this );
+ const tools::Long nLeft = rAttrs.CalcLeft( this );
+ const tools::Long nRight = rAttrs.CalcRight( this );
aRectFnSet.SetXMargins( *this, nLeft, nRight );
SwViewShell *pSh = getRootFrame()->GetCurrShell();
@@ -1117,7 +1117,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
// Do not protrude the edge of the visible area. The page may be
// wider, because there may be objects with excess width
// (RootFrame::ImplCalcBrowseWidth())
- long nMinWidth = 0;
+ tools::Long nMinWidth = 0;
for (size_t i = 0; GetDrawObjs() && i < GetDrawObjs()->size(); ++i)
{
@@ -1141,7 +1141,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
}
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
- long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() );
+ tools::Long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() );
nWidth -= aRectFnSet.GetLeft(getFramePrintArea());
nWidth -= rAttrs.CalcRightLine();
nWidth = std::max( nMinWidth, nWidth );
@@ -1155,7 +1155,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
// The PrtArea should already be at least MINLAY wide, matching the
// minimal values of the UI
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
- aRectFnSet.SetWidth( aPrt, std::min( long(MINLAY), aRectFnSet.GetWidth(getFrameArea()) ) );
+ aRectFnSet.SetWidth( aPrt, std::min( tools::Long(MINLAY), aRectFnSet.GetWidth(getFrameArea()) ) );
SwTwips nTmp = aRectFnSet.GetWidth(getFrameArea()) - aRectFnSet.GetWidth(aPrt);
if( aRectFnSet.GetLeft(aPrt) > nTmp )
@@ -1239,7 +1239,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
auto xDeleteGuard = std::make_unique<SwFrameDeleteGuard>(this);
LockJoin();
- long nFormatCount = 0;
+ tools::Long nFormatCount = 0;
// - loop prevention
int nConsecutiveFormatsWithoutChange = 0;
PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr )
@@ -1449,7 +1449,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
}
if ( !isFramePrintAreaValid() )
{
- const long nOldW = aRectFnSet.GetWidth(getFramePrintArea());
+ const tools::Long nOldW = aRectFnSet.GetWidth(getFramePrintArea());
// #i34730# - keep current frame height
const SwTwips nOldH = aRectFnSet.GetHeight(getFrameArea());
MakePrtArea( rAttrs );
@@ -1572,7 +1572,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
if ( !isFramePrintAreaValid() )
{
- const long nOldW = aRectFnSet.GetWidth(getFramePrintArea());
+ const tools::Long nOldW = aRectFnSet.GetWidth(getFramePrintArea());
MakePrtArea( rAttrs );
if( nOldW != aRectFnSet.GetWidth(getFramePrintArea()) )
Prepare( PrepareHint::FixSizeChanged, nullptr, false );
@@ -1667,8 +1667,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
// Attention: because height == 0, it's better to use Top()+Height() instead of
// Bottom(). This might happen with undersized TextFrames on the lower edge of a
// multi-column section
- const long nPrtBottom = aRectFnSet.GetPrtBottom(*GetUpper());
- long nBottomDist = aRectFnSet.BottomDist(getFrameArea(), nPrtBottom);
+ const tools::Long nPrtBottom = aRectFnSet.GetPrtBottom(*GetUpper());
+ tools::Long nBottomDist = aRectFnSet.BottomDist(getFrameArea(), nPrtBottom);
// Hide whitespace may require not to insert a new page.
SwPageFrame* pPageFrame = FindPageFrame();
@@ -1735,8 +1735,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
{
if( !bMoveable && IsInTab() )
{
- long nDiff = -aRectFnSet.BottomDist( getFrameArea(), aRectFnSet.GetPrtBottom(*GetUpper()) );
- long nReal = GetUpper()->Grow( nDiff );
+ tools::Long nDiff = -aRectFnSet.BottomDist( getFrameArea(), aRectFnSet.GetPrtBottom(*GetUpper()) );
+ tools::Long nReal = GetUpper()->Grow( nDiff );
if( nReal )
continue;
}
@@ -1825,7 +1825,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
}
const bool bCheckForGrownBody = pOldUp->IsBodyFrame();
- const long nOldBodyHeight = aRectFnSet.GetHeight(pOldUp->getFrameArea());
+ const tools::Long nOldBodyHeight = aRectFnSet.GetHeight(pOldUp->getFrameArea());
if ( !bMovedFwd && !MoveFwd( bMakePage, false ) )
bMakePage = false;
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 2ef9539aff5d..2040d4f9bf93 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -313,7 +313,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu
pAttr = &GetFormat()->GetCol();
if ( !bAdjustAttributes )
{
- long nAvail = (getFramePrintArea().*fnRect->fnGetWidth)();
+ tools::Long nAvail = (getFramePrintArea().*fnRect->fnGetWidth)();
for ( SwLayoutFrame *pCol = static_cast<SwLayoutFrame*>(Lower());
pCol;
pCol = static_cast<SwLayoutFrame*>(pCol->GetNext()) )
@@ -336,7 +336,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu
// bOrtho means we have to adjust the column frames manually. Otherwise
// we may use the values returned by CalcColWidth:
const bool bOrtho = pAttr->IsOrtho() && pAttr->GetNumCols() > 0;
- long nGutter = 0;
+ tools::Long nGutter = 0;
for ( sal_uInt16 i = 0; i < pAttr->GetNumCols() && pCol; ++i ) //i118878, value returned by GetNumCols() can't be trusted
{
@@ -414,7 +414,7 @@ void SwLayoutFrame::AdjustColumns( const SwFormatCol *pAttr, bool bAdjustAttribu
if( !bOrtho )
return;
- long nInnerWidth = ( nAvail - nGutter ) / pAttr->GetNumCols();
+ tools::Long nInnerWidth = ( nAvail - nGutter ) / pAttr->GetNumCols();
pCol = Lower();
for( sal_uInt16 i = 0; i < pAttr->GetNumCols() && pCol; pCol = pCol->GetNext(), ++i ) //i118878, value returned by GetNumCols() can't be trusted
{
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 4d365dd39afa..7816ed9c3c0e 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -195,7 +195,7 @@ namespace {
class SwSizeEnterLeave : public SwImplEnterLeave
{
- long m_nFrameHeight;
+ tools::Long m_nFrameHeight;
public:
SwSizeEnterLeave(const SwFrame* pF, PROT nFunct, DbgAction nAct, void* pPar)
@@ -490,7 +490,7 @@ static void lcl_Padded(OStringBuffer& rOut, const OString& s, size_t length)
}
}
-static void lcl_Padded(OStringBuffer& rOut, const long n, size_t length = 5)
+static void lcl_Padded(OStringBuffer& rOut, const tools::Long n, size_t length = 5)
{
char sz[RTL_STR_MAX_VALUEOFINT64];
rtl_str_valueOfInt64(sz, n, 10);
@@ -703,7 +703,7 @@ void SwImplProtocol::Record_( const SwFrame* pFrame, PROT nFunction, DbgAction n
if( pParam )
{
aOut.append(' ');
- aOut.append(static_cast<sal_Int64>(*static_cast<long*>(pParam)));
+ aOut.append(static_cast<sal_Int64>(*static_cast<tools::Long*>(pParam)));
}
break;
case PROT::PrintArea: aOut.append("PROT::PrintArea");
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 13aad81eafaf..29dd86b63a23 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1593,7 +1593,7 @@ SwCellFrame* SwCellFrame::GetFollowCell() const
// NEW TABLES
// Covered cells do not have follow cells!
- const long nRowSpan = GetLayoutRowSpan();
+ const tools::Long nRowSpan = GetLayoutRowSpan();
if ( nRowSpan < 1 )
return nullptr;
@@ -1616,7 +1616,7 @@ SwCellFrame* SwCellFrame::GetFollowCell() const
if ( nRowSpan > 1 )
{
// optimization: Will end of row span be in last row or exceed row?
- long nMax = 0;
+ tools::Long nMax = 0;
while ( pRow->GetNext() && ++nMax < nRowSpan )
pRow = pRow->GetNext();
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 69686729543d..ae100af25d46 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1500,8 +1500,8 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs,
else
{
nUpper = bContextualSpacing ? 0 : std::max(
- bHalfContextualSpacingPrev ? 0 : static_cast<long>(nPrevLowerSpace),
- bHalfContextualSpacing ? 0 : static_cast<long>(pAttrs->GetULSpace().GetUpper()) );
+ bHalfContextualSpacingPrev ? 0 : static_cast<tools::Long>(nPrevLowerSpace),
+ bHalfContextualSpacing ? 0 : static_cast<tools::Long>(pAttrs->GetULSpace().GetUpper()) );
// i#11859 - consideration of the line spacing
// for the upper spacing of a text frame
@@ -1589,7 +1589,7 @@ SwTwips SwFlowFrame::GetUpperSpaceAmountConsideredForPageGrid_(
const SwFrame* pBodyFrame = pPageFrame->FindBodyCont();
if ( pBodyFrame )
{
- const long nGridLineHeight =
+ const tools::Long nGridLineHeight =
pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
SwRectFnSet aRectFnSet(&m_rThis);
@@ -2170,7 +2170,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
!pFlow->IsInDocBody() ) );
if ( pFlow )
{
- long nDiff = pOldPage->GetPhyPageNum() - pFlow->GetPhyPageNum();
+ tools::Long nDiff = pOldPage->GetPhyPageNum() - pFlow->GetPhyPageNum();
if ( nDiff > 1 )
{
if ( static_cast<SwPageFrame*>(pOldPage->GetPrev())->IsEmptyPage() )
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 8cffa05679f6..d6441aa4679a 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -409,7 +409,7 @@ void SwFlyFrame::ChainFrames( SwFlyFrame *pMaster, SwFlyFrame *pFollow )
// To get a text flow we need to invalidate
SwFrame *pInva = pMaster->FindLastLower();
SwRectFnSet aRectFnSet(pMaster);
- const long nBottom = aRectFnSet.GetPrtBottom(*pMaster);
+ const tools::Long nBottom = aRectFnSet.GetPrtBottom(*pMaster);
while ( pInva )
{
if( aRectFnSet.BottomDist( pInva->getFrameArea(), nBottom ) <= 0 )
@@ -777,7 +777,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
SwRect aNew( GetObjRectWithSpaces() );
SwRect aOld( getFrameArea() );
const SvxULSpaceItem &rUL = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetULSpace();
- aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
+ aOld.Top( std::max( aOld.Top() - tools::Long(rUL.GetUpper()), 0L ) );
aOld.AddHeight(rUL.GetLower() );
const SvxLRSpaceItem &rLR = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetLRSpace();
aOld.Left ( std::max( aOld.Left() - rLR.GetLeft(), 0L ) );
@@ -879,7 +879,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
if ( RES_UL_SPACE == nWhich )
{
const SvxULSpaceItem &rUL = *static_cast<const SvxULSpaceItem*>(pNew);
- aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
+ aOld.Top( std::max( aOld.Top() - tools::Long(rUL.GetUpper()), 0L ) );
aOld.AddHeight(rUL.GetLower() );
}
else
@@ -1216,7 +1216,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
SwRectFnSet aRectFnSet(this);
if( !HasFixSize() )
{
- long nMinHeight = 0;
+ tools::Long nMinHeight = 0;
if( IsMinHeight() )
nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
@@ -1713,7 +1713,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs )
Size aRelSize( CalcRel( GetFormat()->GetFrameSize() ) );
SwRectFnSet aRectFnSet(this);
- long nMinHeight = 0;
+ tools::Long nMinHeight = 0;
if( IsMinHeight() )
nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
@@ -1836,9 +1836,9 @@ bool SwFlyFrame::IsShowUnfloatButton(SwWrtShell* pWrtSh) const
if (pBody == nullptr)
return false;
- long nBodyHeight = pBody->getFrameArea().Height();
- long nTableHeight = pTable->getFrameArea().Height();
- long nFrameOffset = std::abs(GetAnchorFrame()->getFrameArea().Top() - pBody->getFrameArea().Top());
+ tools::Long nBodyHeight = pBody->getFrameArea().Height();
+ tools::Long nTableHeight = pTable->getFrameArea().Height();
+ tools::Long nFrameOffset = std::abs(GetAnchorFrame()->getFrameArea().Top() - pBody->getFrameArea().Top());
return nBodyHeight < nTableHeight + nFrameOffset;
}
@@ -2441,7 +2441,7 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const
const SwFrame *pRel = IsFlyLayFrame() ? GetAnchorFrame() : GetAnchorFrame()->GetUpper();
if( pRel ) // LAYER_IMPL
{
- long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX;
+ tools::Long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX;
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
if ( ( pRel->IsBodyFrame() || pRel->IsPageFrame() ) &&
pSh && pSh->GetViewOptions()->getBrowseMode() &&
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 41dd6e67d4b5..2f96c72c4170 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -486,10 +486,10 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
::CalcClipRect( pObj, aTmpStretch, false );
aClip.Intersection_( aTmpStretch );
- const long nBot = getFrameArea().Top() + getFrameArea().Height();
- const long nRig = getFrameArea().Left() + getFrameArea().Width();
- const long nClipBot = aClip.Top() + aClip.Height();
- const long nClipRig = aClip.Left() + aClip.Width();
+ const tools::Long nBot = getFrameArea().Top() + getFrameArea().Height();
+ const tools::Long nRig = getFrameArea().Left() + getFrameArea().Width();
+ const tools::Long nClipBot = aClip.Top() + aClip.Height();
+ const tools::Long nClipRig = aClip.Left() + aClip.Width();
const bool bBot = nBot > nClipBot;
const bool bRig = nRig > nClipRig;
@@ -507,7 +507,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
// now the flyframe can change its position and so on ...
if ( !pHeader || !pHeader->IsHeaderFrame() )
{
- const long nOld = getFrameArea().Top();
+ const tools::Long nOld = getFrameArea().Top();
// tdf#112443 disable positioning if content is completely off page
bool bDisableOffPagePositioning = GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
@@ -527,7 +527,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
}
if ( bRig )
{
- const long nOld = getFrameArea().Left();
+ const tools::Long nOld = getFrameArea().Left();
// tdf#112443 disable positioning if content is completely off page
bool bDisableOffPagePositioning = GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING);
@@ -573,7 +573,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
if ( bBot )
{
- long nDiff = nClipBot;
+ tools::Long nDiff = nClipBot;
nDiff -= aFrameRect.Top(); // nDiff represents the available distance
nDiff = aFrameRect.Height() - nDiff;
aFrameRect.Height( aFrameRect.Height() - nDiff );
@@ -581,7 +581,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
}
if ( bRig )
{
- long nDiff = nClipRig;
+ tools::Long nDiff = nClipRig;
nDiff -= aFrameRect.Left();// nDiff represents the available distance
nDiff = aFrameRect.Width() - nDiff;
aFrameRect.Width( aFrameRect.Width() - nDiff );
@@ -654,14 +654,14 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
// Now change the Frame; for columns, we put the new values into the attributes,
// otherwise we'll end up with unwanted side-effects/oscillations
- const long nPrtHeightDiff = getFrameArea().Height() - getFramePrintArea().Height();
- const long nPrtWidthDiff = getFrameArea().Width() - getFramePrintArea().Width();
+ const tools::Long nPrtHeightDiff = getFrameArea().Height() - getFramePrintArea().Height();
+ const tools::Long nPrtWidthDiff = getFrameArea().Width() - getFramePrintArea().Width();
maUnclippedFrame = getFrameArea();
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
aFrm.Height( aFrameRect.Height() );
- aFrm.Width ( std::max( long(MINLAY), aFrameRect.Width() ) );
+ aFrm.Width ( std::max( tools::Long(MINLAY), aFrameRect.Width() ) );
}
if ( Lower() && Lower()->IsColumnFrame() )
@@ -1394,8 +1394,8 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
// of body frame:
aRectFnSet.SetRight( rRect, aRectFnSet.GetRight(pUp->GetUpper()->getFrameArea()) );
}
- long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
- long nTop;
+ tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
+ tools::Long nTop;
const SwFormat *pFormat = GetUserCall(pSdrObj)->GetFormat();
const SvxULSpaceItem &rUL = pFormat->GetULSpace();
if( bMove )
@@ -1403,7 +1403,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
nTop = aRectFnSet.IsVert() ? static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X() :
static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y();
nTop = aRectFnSet.YInc( nTop, -nHeight );
- long nWidth = aRectFnSet.GetWidth(pFly->getFrameArea());
+ tools::Long nWidth = aRectFnSet.GetWidth(pFly->getFrameArea());
aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().Y() :
static_cast<const SwFlyInContentFrame*>(pFly)->GetRefPoint().X(), nWidth );
@@ -1437,16 +1437,16 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove )
rRect = pUp->getFramePrintArea();
rRect += pUp->getFrameArea().Pos();
SwRectFnSet aRectFnSet(pAnchorFrame);
- long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
- long nTop;
+ tools::Long nHeight = (9*aRectFnSet.GetHeight(rRect))/10;
+ tools::Long nTop;
const SvxULSpaceItem &rUL = pFormat->GetULSpace();
SwRect aSnapRect( pSdrObj->GetSnapRect() );
- long nTmpH = 0;
+ tools::Long nTmpH = 0;
if( bMove )
{
nTop = aRectFnSet.YInc( aRectFnSet.IsVert() ? pSdrObj->GetAnchorPos().X() :
pSdrObj->GetAnchorPos().Y(), -nHeight );
- long nWidth = aRectFnSet.GetWidth(aSnapRect);
+ tools::Long nWidth = aRectFnSet.GetWidth(aSnapRect);
aRectFnSet.SetLeftAndWidth( rRect, aRectFnSet.IsVert() ?
pSdrObj->GetAnchorPos().Y() :
pSdrObj->GetAnchorPos().X(), nWidth );
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 3fa8a1a38452..baba2d3fe7f4 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -154,8 +154,8 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE
}
else if ( !pFlow->HasFollow() )
{
- long nOldHeight = aRectFnSet.GetHeight(maFrame);
- long nNewHeight = aRectFnSet.GetHeight(mpFrame->getFrameArea());
+ tools::Long nOldHeight = aRectFnSet.GetHeight(maFrame);
+ tools::Long nNewHeight = aRectFnSet.GetHeight(mpFrame->getFrameArea());
if( (nOldHeight > nNewHeight) || (!nOldHeight && nNewHeight) )
pFlow->CheckKeep();
}
@@ -461,7 +461,7 @@ SwLayNotify::~SwLayNotify()
if ( pLay->IsRowFrame() )
{
bInvaPercent = true;
- long nNew = aRectFnSet.GetHeight(pLay->getFramePrintArea());
+ tools::Long nNew = aRectFnSet.GetHeight(pLay->getFramePrintArea());
if( nNew != aRectFnSet.GetHeight(maPrt) )
static_cast<SwRowFrame*>(pLay)->AdjustCells( nNew, true);
if( aRectFnSet.GetWidth(pLay->getFramePrintArea())
@@ -2214,9 +2214,9 @@ void SwBorderAttrs::CalcBottom_()
m_bBottom = false;
}
-long SwBorderAttrs::CalcRight( const SwFrame* pCaller ) const
+tools::Long SwBorderAttrs::CalcRight( const SwFrame* pCaller ) const
{
- long nRight=0;
+ tools::Long nRight=0;
if (!pCaller->IsTextFrame() || !static_cast<const SwTextFrame*>(pCaller)->GetDoc().GetDocumentSettingManager().get(DocumentSettingId::INVERT_BORDER_SPACING)) {
// OD 23.01.2003 #106895# - for cell frame in R2L text direction the left
@@ -2261,9 +2261,9 @@ static bool lcl_hasTabFrame(const SwTextFrame* pTextFrame)
return false;
}
-long SwBorderAttrs::CalcLeft( const SwFrame *pCaller ) const
+tools::Long SwBorderAttrs::CalcLeft( const SwFrame *pCaller ) const
{
- long nLeft=0;
+ tools::Long nLeft=0;
if (!pCaller->IsTextFrame() || !static_cast<const SwTextFrame*>(pCaller)->GetDoc().GetDocumentSettingManager().get(DocumentSettingId::INVERT_BORDER_SPACING))
{
@@ -3553,10 +3553,10 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrame *pCell )
SwFrame *pLow = pCell->Lower();
if ( pLow && (pLow->IsContentFrame() || pLow->IsSctFrame()) )
{
- long nHeight = 0, nFlyAdd = 0;
+ tools::Long nHeight = 0, nFlyAdd = 0;
do
{
- long nLow = pLow->getFrameArea().Height();
+ tools::Long nLow = pLow->getFrameArea().Height();
if( pLow->IsTextFrame() && static_cast<SwTextFrame*>(pLow)->IsUndersized() )
nLow += static_cast<SwTextFrame*>(pLow)->GetParHeight()-pLow->getFramePrintArea().Height();
else if( pLow->IsSctFrame() && static_cast<SwSectionFrame*>(pLow)->IsUndersized() )
@@ -3578,7 +3578,7 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrame *pCell )
}
else
{
- long nRstHeight = 0;
+ tools::Long nRstHeight = 0;
while (pLow && pLow->IsLayoutFrame())
{
nRstHeight += ::CalcRowRstHeight(static_cast<SwLayoutFrame*>(pLow));
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 809a8ea528e0..414615267676 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -189,9 +189,9 @@ SwFootnoteFrame* SwFootnoteContFrame::AddChained(bool bAppend, SwFrame* pThis, b
// lcl_Undersize(..) walks over a SwFrame and its contents
// and returns the sum of all requested TextFrame magnifications.
-static long lcl_Undersize( const SwFrame* pFrame )
+static tools::Long lcl_Undersize( const SwFrame* pFrame )
{
- long nRet = 0;
+ tools::Long nRet = 0;
SwRectFnSet aRectFnSet(pFrame);
if( pFrame->IsTextFrame() )
{
@@ -367,7 +367,7 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
// do not use more space than the body has
nDist = aRectFnSet.GetHeight(GetPrev()->getFrameArea());
- long nAvail = 0;
+ tools::Long nAvail = 0;
if ( bBrowseMode )
{
nAvail = GetUpper()->getFramePrintArea().Height();
@@ -390,7 +390,7 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
aFrm.Pos().AdjustX( -nDist );
}
}
- long nGrow = nDist - nAvail,
+ tools::Long nGrow = nDist - nAvail,
nReal = 0;
if ( nGrow > 0 )
{
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 79132b2c68c3..922aab7dcd55 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -426,7 +426,7 @@ void SwHeadFootFrame::Format(vcl::RenderContext* pRenderContext, const SwBorderA
{
lcl_LayoutFrameEnsureMinHeight(*this);
- long nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
+ tools::Long nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
if ( !isFramePrintAreaValid() )
FormatPrt(nUL, pAttrs);
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 605ec7fdeaef..93f3da8da9e8 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -197,7 +197,7 @@ inline bool SwLayAction::PaintContent_( const SwContentFrame *pContent,
void SwLayAction::PaintContent( const SwContentFrame *pCnt,
const SwPageFrame *pPage,
const SwRect &rOldRect,
- long nOldBottom )
+ tools::Long nOldBottom )
{
SwRectFnSet aRectFnSet(pCnt);
@@ -211,8 +211,8 @@ void SwLayAction::PaintContent( const SwContentFrame *pCnt,
{
// paint the area between printing bottom and frame bottom and
// the area left and right beside the frame, if its height changed.
- long nOldHeight = aRectFnSet.GetHeight(rOldRect);
- long nNewHeight = aRectFnSet.GetHeight(pCnt->getFrameArea());
+ tools::Long nOldHeight = aRectFnSet.GetHeight(rOldRect);
+ tools::Long nNewHeight = aRectFnSet.GetHeight(pCnt->getFrameArea());
const bool bHeightDiff = nOldHeight != nNewHeight;
if( bHeightDiff )
{
@@ -682,7 +682,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
// set flag for interrupt content formatting
mbFormatContentOnInterrupt = IsInterrupt();
- long nBottom = rVis.Bottom();
+ tools::Long nBottom = rVis.Bottom();
// #i42586# - format current page, if idle action is active
// This is an optimization for the case that the interrupt is created by
// the move of a form control object, which is represented by a window.
@@ -779,7 +779,7 @@ bool SwLayAction::TurboAction_( const SwContentFrame *pCnt )
if ( !pCnt->isFrameAreaDefinitionValid() || pCnt->IsCompletePaint() || pCnt->IsRetouche() )
{
const SwRect aOldRect( pCnt->UnionFrame( true ) );
- const long nOldBottom = pCnt->getFrameArea().Top() + pCnt->getFramePrintArea().Bottom();
+ const tools::Long nOldBottom = pCnt->getFrameArea().Top() + pCnt->getFramePrintArea().Bottom();
pCnt->Calc(m_pImp->GetShell()->GetOut());
if ( pCnt->getFrameArea().Bottom() < aOldRect.Bottom() )
pCnt->SetRetouche();
@@ -843,13 +843,13 @@ bool SwLayAction::TurboAction()
return bRet;
}
-static bool lcl_IsInvaLay( const SwFrame *pFrame, long nBottom )
+static bool lcl_IsInvaLay( const SwFrame *pFrame, tools::Long nBottom )
{
return !pFrame->isFrameAreaDefinitionValid() ||
(pFrame->IsCompletePaint() && ( pFrame->getFrameArea().Top() < nBottom ) );
}
-static const SwFrame *lcl_FindFirstInvaLay( const SwFrame *pFrame, long nBottom )
+static const SwFrame *lcl_FindFirstInvaLay( const SwFrame *pFrame, tools::Long nBottom )
{
OSL_ENSURE( pFrame->IsLayoutFrame(), "FindFirstInvaLay, no LayFrame" );
@@ -871,7 +871,7 @@ static const SwFrame *lcl_FindFirstInvaLay( const SwFrame *pFrame, long nBottom
return nullptr;
}
-static const SwFrame *lcl_FindFirstInvaContent( const SwLayoutFrame *pLay, long nBottom,
+static const SwFrame *lcl_FindFirstInvaContent( const SwLayoutFrame *pLay, tools::Long nBottom,
const SwContentFrame *pFirst )
{
const SwContentFrame *pCnt = pFirst ? pFirst->GetNextContentFrame() :
@@ -917,7 +917,7 @@ static const SwFrame *lcl_FindFirstInvaContent( const SwLayoutFrame *pLay, long
// consider drawing objects
static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrame* _pPage,
- long _nBottom )
+ tools::Long _nBottom )
{
OSL_ENSURE( _pPage->GetSortedObjs(), "FindFirstInvaObj, no Objs" );
@@ -1142,7 +1142,7 @@ bool SwLayAction::IsShortCut( SwPageFrame *&prPage )
if ( !bRet && bBrowse )
{
- const long nBottom = rVis.Bottom();
+ const tools::Long nBottom = rVis.Bottom();
const SwAnchoredObject* pObj( nullptr );
if ( prPage->GetSortedObjs() &&
(prPage->IsInvalidFlyLayout() || prPage->IsInvalidFlyContent()) &&
@@ -1725,7 +1725,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage )
if ( bBrowse && !IsIdle() && !IsCalcLayout() && !IsComplete() &&
pContent->getFrameArea().Top() > m_pImp->GetShell()->VisArea().Bottom())
{
- const long nBottom = m_pImp->GetShell()->VisArea().Bottom();
+ const tools::Long nBottom = m_pImp->GetShell()->VisArea().Bottom();
const SwFrame *pTmp = lcl_FindFirstInvaContent( pPage,
nBottom, pContent );
if ( !pTmp )
@@ -1774,7 +1774,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage )
if ( bBrowse && !IsIdle() && !IsCalcLayout() && !IsComplete() &&
pContent->getFrameArea().Top() > m_pImp->GetShell()->VisArea().Bottom())
{
- const long nBottom = m_pImp->GetShell()->VisArea().Bottom();
+ const tools::Long nBottom = m_pImp->GetShell()->VisArea().Bottom();
const SwFrame *pTmp = lcl_FindFirstInvaContent( pPage,
nBottom, pContent );
if ( !pTmp )
@@ -1807,7 +1807,7 @@ void SwLayAction::FormatContent_( const SwContentFrame *pContent, const SwPageFr
if ( !bDrawObjsOnly && IsPaint() )
{
const SwRect aOldRect( pContent->UnionFrame() );
- const long nOldBottom = aRectFnSet.GetPrtBottom(*pContent);
+ const tools::Long nOldBottom = aRectFnSet.GetPrtBottom(*pContent);
pContent->OptCalc();
if( IsAgain() )
return;
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index b4d21a3fdc15..25858f49ac4b 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -208,7 +208,7 @@ class SwFlyCache : public SwRect // position and size
public:
sal_uLong nOrdNum; ///< Id to recognize text frames
sal_uInt16 nPageNum; ///< page number
- SwFlyCache( sal_uInt16 nP, sal_uLong nO, long nXL, long nYL, long nWL, long nHL ) :
+ SwFlyCache( sal_uInt16 nP, sal_uLong nO, tools::Long nXL, tools::Long nYL, tools::Long nWL, tools::Long nHL ) :
SwRect( nXL, nYL, nWL, nHL ), nOrdNum( nO ), nPageNum( nP ){}
};
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index a24a23bc9f30..397de1daf5fb 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -48,13 +48,13 @@ bool SwRootFrame::s_isNoVirDev = false;
SwCache *SwFrame::mpCache = nullptr;
-static long FirstMinusSecond( long nFirst, long nSecond )
+static tools::Long FirstMinusSecond( tools::Long nFirst, tools::Long nSecond )
{ return nFirst - nSecond; }
-static long SecondMinusFirst( long nFirst, long nSecond )
+static tools::Long SecondMinusFirst( tools::Long nFirst, tools::Long nSecond )
{ return nSecond - nFirst; }
-static long SwIncrement( long nA, long nAdd )
+static tools::Long SwIncrement( tools::Long nA, tools::Long nAdd )
{ return nA + nAdd; }
-static long SwDecrement( long nA, long nSub )
+static tools::Long SwDecrement( tools::Long nA, tools::Long nSub )
{ return nA - nSub; }
static SwRectFnCollection aHorizontal = {
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 73ca8c534e5f..af4a5e1680ab 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -120,10 +120,10 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
if( pGrid )
{
bNoGrid = false;
- long nSum = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
+ tools::Long nSum = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
SwRectFnSet aRectFnSet(this);
- long nSize = aRectFnSet.GetWidth(getFrameArea());
- long nBorder = 0;
+ tools::Long nSize = aRectFnSet.GetWidth(getFrameArea());
+ tools::Long nBorder = 0;
if( GRID_LINES_CHARS == pGrid->GetGridType() )
{
//for textgrid refactor
@@ -141,7 +141,7 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
nBorder = aRectFnSet.GetHeight(getFrameArea());
// Number of possible lines in area of body frame:
- long nNumberOfLines = nBorder / nSum;
+ tools::Long nNumberOfLines = nBorder / nSum;
if( nNumberOfLines > pGrid->GetLines() )
nNumberOfLines = pGrid->GetLines();
@@ -204,7 +204,7 @@ SwPageFrame::SwPageFrame( SwFrameFormat *pFormat, SwFrame* pSib, SwPageDesc *pPg
if ( bBrowseMode )
{
aFrm.Height( 0 );
- long nWidth = pSh->VisArea().Width();
+ tools::Long nWidth = pSh->VisArea().Width();
if ( !nWidth )
{
@@ -647,8 +647,8 @@ void SwPageFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
- aFrm.Height( std::max( rSz.GetHeight(), long(MINLAY) ) );
- aFrm.Width ( std::max( rSz.GetWidth(), long(MINLAY) ) );
+ aFrm.Height( std::max( rSz.GetHeight(), tools::Long(MINLAY) ) );
+ aFrm.Width ( std::max( rSz.GetWidth(), tools::Long(MINLAY) ) );
}
if ( GetUpper() )
@@ -1433,7 +1433,7 @@ void SwRootFrame::RemoveSuperfluous()
mbCheckSuperfluous = false;
SwPageFrame *pPage = GetLastPage();
- long nDocPos = LONG_MAX;
+ tools::Long nDocPos = LONG_MAX;
// Check the corresponding last page if it is empty and stop loop at the last non-empty page.
do
@@ -1771,7 +1771,7 @@ void SwRootFrame::ImplCalcBrowseWidth()
SwBorderAttrAccess aAccess( SwFrame::GetCache(), pFrame );
const SwBorderAttrs &rAttrs = *aAccess.Get();
const SwFormatHoriOrient &rHori = rAttrs.GetAttrSet().GetHoriOrient();
- long nWidth = rAttrs.GetSize().Width();
+ tools::Long nWidth = rAttrs.GetSize().Width();
if ( nWidth < int(USHRT_MAX)-2000 && //-2k, because USHRT_MAX gets missing while trying to resize! (and cast to int to avoid -Wsign-compare due to broken USHRT_MAX on Android)
text::HoriOrientation::FULL != rHori.GetHoriOrient() )
{
@@ -1810,7 +1810,7 @@ void SwRootFrame::ImplCalcBrowseWidth()
continue;
}
- long nWidth = 0;
+ tools::Long nWidth = 0;
switch ( rFormat.GetAnchor().GetAnchorId() )
{
case RndStdIds::FLY_AS_CHAR:
@@ -2111,9 +2111,9 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
maPageRects.clear();
- const long nBorder = getFrameArea().Pos().getX();
- const long nVisWidth = mnViewWidth - 2 * nBorder;
- const long nGapBetweenPages = pViewOpt ? pViewOpt->GetGapBetweenPages()
+ const tools::Long nBorder = getFrameArea().Pos().getX();
+ const tools::Long nVisWidth = mnViewWidth - 2 * nBorder;
+ const tools::Long nGapBetweenPages = pViewOpt ? pViewOpt->GetGapBetweenPages()
: (pSh ? pSh->GetViewOptions()->GetGapBetweenPages()
: SwViewOption::defGapBetweenPages);
@@ -2122,16 +2122,16 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
// will contain the number of pages per row. 0 means that
// the page does not fit.
- long nWidthRemain = nVisWidth;
+ tools::Long nWidthRemain = nVisWidth;
// after one row has been processed, these variables contain
// the width of the row and the maximum of the page heights
- long nCurrentRowHeight = 0;
- long nCurrentRowWidth = 0;
+ tools::Long nCurrentRowHeight = 0;
+ tools::Long nCurrentRowWidth = 0;
// these variables are used to finally set the size of the
// root frame
- long nSumRowHeight = 0;
+ tools::Long nSumRowHeight = 0;
SwTwips nMinPageLeft = TWIPS_MAX;
SwTwips nMaxPageRight = 0;
SwPageFrame* pStartOfRow = pPageFrame;
@@ -2153,8 +2153,8 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
const bool bEmptyPage = pPageFrame->IsEmptyPage() && !mbBookMode;
// no half doc border space for first page in each row and
- long nPageWidth = 0;
- long nPageHeight = 0;
+ tools::Long nPageWidth = 0;
+ tools::Long nPageHeight = 0;
if ( mbBookMode )
{
@@ -2245,15 +2245,15 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
}
// center page if possible
- long nSizeDiff = 0;
+ tools::Long nSizeDiff = 0;
if (nVisWidth > nCurrentRowWidth && !comphelper::LibreOfficeKit::isActive())
nSizeDiff = ( nVisWidth - nCurrentRowWidth ) / 2;
// adjust positions of pages in current row
- long nX = nSizeDiff;
+ tools::Long nX = nSizeDiff;
- const long nRowStart = nBorder + nSizeDiff;
- const long nRowEnd = nRowStart + nCurrentRowWidth;
+ const tools::Long nRowStart = nBorder + nSizeDiff;
+ const tools::Long nRowEnd = nRowStart + nCurrentRowWidth;
if ( bFirstRow && mbBookMode )
{
@@ -2283,7 +2283,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
// RTL view layout: Calculate mirrored page position
if ( bRTL )
{
- const long nXOffsetInRow = aNewPagePos.getX() - nRowStart;
+ const tools::Long nXOffsetInRow = aNewPagePos.getX() - nRowStart;
aNewPagePos.setX(nRowEnd - nXOffsetInRow - nCurrentPageWidth);
aNewPagePosWithLeftOffset = aNewPagePos;
aNewPagePosWithLeftOffset.setX(aNewPagePosWithLeftOffset.getX() + nLeftPageAddOffset);
@@ -2311,7 +2311,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
pPageToAdjust->getFrameArea().SSize().Width() + nGapBetweenPages + nSidebarWidth,
nCurrentRowHeight );
- static const long nOuterClickDiff = 1000000;
+ static const tools::Long nOuterClickDiff = 1000000;
// adjust borders for these special cases:
if ( (bFirstColumn && !bRTL) || (bLastColumn && bRTL) )
@@ -2436,8 +2436,8 @@ const SwPageFrame& SwPageFrame::GetFormatPage() const
bool SwPageFrame::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rControl ) const
{
- long nUpperLimit = 0;
- long nLowerLimit = 0;
+ tools::Long nUpperLimit = 0;
+ tools::Long nLowerLimit = 0;
const SwFrame* pFrame = Lower();
while ( pFrame )
{
@@ -2498,7 +2498,7 @@ bool SwPageFrame::CheckPageHeightValidForHideWhitespace(SwTwips nDiff)
// Content frame doesn't fit the actual size, check if it fits the nominal one.
const SwFrameFormat* pPageFormat = static_cast<const SwFrameFormat*>(GetDep());
const Size& rPageSize = pPageFormat->GetFrameSize().GetSize();
- long nWhitespace = rPageSize.getHeight() - getFrameArea().Height();
+ tools::Long nWhitespace = rPageSize.getHeight() - getFrameArea().Height();
if (nWhitespace > -nDiff)
{
// It does: don't move it and invalidate our page frame so
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 39bc05d4d806..fdfe346772f7 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -285,12 +285,12 @@ struct SwPaintProperties {
// Sizes of a pixel and the corresponding halves. Will be reset when
// entering SwRootFrame::PaintSwFrame
- long nSPixelSzW;
- long nSPixelSzH;
- long nSHalfPixelSzW;
- long nSHalfPixelSzH;
- long nSMinDistPixelW;
- long nSMinDistPixelH;
+ tools::Long nSPixelSzW;
+ tools::Long nSPixelSzH;
+ tools::Long nSHalfPixelSzW;
+ tools::Long nSHalfPixelSzH;
+ tools::Long nSMinDistPixelW;
+ tools::Long nSMinDistPixelH;
Color aSGlobalRetoucheColor;
@@ -534,7 +534,7 @@ bool SwLineRect::MakeUnion( const SwRect &rRect, SwPaintProperties const & prope
if ( Left() == rRect.Left() && Width() == rRect.Width() )
{
// Merge when there is no gap between the lines
- const long nAdd = properties.nSPixelSzW + properties.nSHalfPixelSzW;
+ const tools::Long nAdd = properties.nSPixelSzW + properties.nSHalfPixelSzW;
if ( Bottom() + nAdd >= rRect.Top() &&
Top() - nAdd <= rRect.Bottom() )
{
@@ -549,7 +549,7 @@ bool SwLineRect::MakeUnion( const SwRect &rRect, SwPaintProperties const & prope
if ( Top() == rRect.Top() && Height() == rRect.Height() )
{
// Merge when there is no gap between the lines
- const long nAdd = properties.nSPixelSzW + properties.nSHalfPixelSzW;
+ const tools::Long nAdd = properties.nSPixelSzW + properties.nSHalfPixelSzW;
if ( Right() + nAdd >= rRect.Left() &&
Left() - nAdd <= rRect.Right() )
{
@@ -593,7 +593,7 @@ void SwLineRects::ConnectEdges( OutputDevice const *pOut, SwPaintProperties cons
return;
}
- static const long nAdd = 20;
+ static const tools::Long nAdd = 20;
std::vector<SwLineRect*> aCheck;
@@ -606,7 +606,7 @@ void SwLineRects::ConnectEdges( OutputDevice const *pOut, SwPaintProperties cons
aCheck.clear();
const bool bVert = rL1.Height() > rL1.Width();
- long nL1a, nL1b, nL1c, nL1d;
+ tools::Long nL1a, nL1b, nL1c, nL1d;
if ( bVert )
{
@@ -629,7 +629,7 @@ void SwLineRects::ConnectEdges( OutputDevice const *pOut, SwPaintProperties cons
(bVert == (rL2.Height() > rL2.Width())) )
continue;
- long nL2a, nL2b, nL2c, nL2d;
+ tools::Long nL2a, nL2b, nL2c, nL2d;
if ( bVert )
{
nL2a = rL2.Top(); nL2b = rL2.Left();
@@ -799,7 +799,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S
if ( aSubsRect.Left() <= rLine.Right() &&
aSubsRect.Right() >= rLine.Left() )
{
- long nTmp = rLine.Top()-(properties.nSPixelSzH+1);
+ tools::Long nTmp = rLine.Top()-(properties.nSPixelSzH+1);
if ( aSubsLineRect.Top() < nTmp )
{
SwRect aNewSubsRect( aSubsLineRect );
@@ -825,7 +825,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S
if ( aSubsRect.Top() <= rLine.Bottom() &&
aSubsRect.Bottom() >= rLine.Top() )
{
- long nTmp = rLine.Left()-(properties.nSPixelSzW+1);
+ tools::Long nTmp = rLine.Left()-(properties.nSPixelSzW+1);
if ( aSubsLineRect.Left() < nTmp )
{
SwRect aNewSubsRect( aSubsLineRect );
@@ -859,12 +859,12 @@ void SwLineRects::LockLines( bool bLock )
static void lcl_DrawDashedRect( OutputDevice * pOut, SwLineRect const & rLRect )
{
- long startX = rLRect.Left( ), endX;
- long startY = rLRect.Top( ), endY;
+ tools::Long startX = rLRect.Left( ), endX;
+ tools::Long startY = rLRect.Top( ), endY;
// Discriminate vertically stretched rect from horizontally stretched
// and restrict minimum nHalfLWidth to 1
- long nHalfLWidth = std::max( static_cast<long>(std::min( rLRect.Width( ), rLRect.Height( ) ) / 2), 1L );
+ tools::Long nHalfLWidth = std::max( static_cast<tools::Long>(std::min( rLRect.Width( ), rLRect.Height( ) ) / 2), 1L );
if ( rLRect.Height( ) > rLRect.Width( ) )
{
@@ -1028,8 +1028,8 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
{
if ( bVerticalSubs )
{
- long nLi = rLi.Right();
- long nLk = rLk.Right();
+ tools::Long nLi = rLi.Right();
+ tools::Long nLk = rLk.Right();
if ( rLi.Top() == rLk.Top() &&
((nLi < rLk.Left() && nLi+21 > rLk.Left()) ||
(nLk < rLi.Left() && nLk+21 > rLi.Left())))
@@ -1043,8 +1043,8 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
}
else
{
- long nLi = rLi.Bottom();
- long nLk = rLk.Bottom();
+ tools::Long nLi = rLi.Bottom();
+ tools::Long nLk = rLk.Bottom();
if ( rLi.Left() == rLk.Left() &&
((nLi < rLk.Top() && nLi+21 > rLk.Top()) ||
(nLk < rLi.Top() && nLk+21 > rLi.Top())))
@@ -1230,11 +1230,11 @@ void SwAlignGrfRect( SwRect *pGrfRect, const vcl::RenderContext &rOut )
pGrfRect->SSize( rOut.PixelToLogic( aPxRect.GetSize() ) );
}
-static long lcl_AlignWidth( const long nWidth, SwPaintProperties const & properties )
+static tools::Long lcl_AlignWidth( const tools::Long nWidth, SwPaintProperties const & properties )
{
if ( nWidth )
{
- const long nW = nWidth % properties.nSPixelSzW;
+ const tools::Long nW = nWidth % properties.nSPixelSzW;
if ( !nW || nW > properties.nSHalfPixelSzW )
return std::max(1L, nWidth - properties.nSHalfPixelSzW);
@@ -1242,11 +1242,11 @@ static long lcl_AlignWidth( const long nWidth, SwPaintProperties const & propert
return nWidth;
}
-static long lcl_AlignHeight( const long nHeight, SwPaintProperties const & properties )
+static tools::Long lcl_AlignHeight( const tools::Long nHeight, SwPaintProperties const & properties )
{
if ( nHeight )
{
- const long nH = nHeight % properties.nSPixelSzH;
+ const tools::Long nH = nHeight % properties.nSPixelSzH;
if ( !nH || nH > properties.nSHalfPixelSzH )
return std::max(1L, nHeight - properties.nSHalfPixelSzH);
@@ -2365,7 +2365,7 @@ void SwTabFramePainter::HandleFrame(const SwLayoutFrame& rLayoutFrame, const SwR
{
const SwCellFrame* pThisCell = static_cast<const SwCellFrame*>(&rLayoutFrame);
const SwRowFrame* pRowFrame = static_cast<const SwRowFrame*>(pThisCell->GetUpper());
- const long nRowSpan = pThisCell->GetTabBox()->getRowSpan();
+ const tools::Long nRowSpan = pThisCell->GetTabBox()->getRowSpan();
if ( !pRowFrame->IsRowSpanLine() || nRowSpan > 1 || nRowSpan < -1 )
{
SwBorderAttrAccess aAccess( SwFrame::GetCache(), &rLayoutFrame );
@@ -3314,7 +3314,7 @@ namespace {
class SwShortCut
{
SwRectDist fnCheck;
- long nLimit;
+ tools::Long nLimit;
public:
SwShortCut( const SwFrame& rFrame, const SwRect& rRect );
bool Stop( const SwRect& rRect ) const
@@ -3638,7 +3638,7 @@ void SwColumnFrame::PaintBreak( ) const
tools::Rectangle aTextRect;
pOut->GetTextBoundRect( aTextRect, aBreakText );
- long nTextOff = ( nWidth - aTextRect.GetWidth() ) / 2;
+ tools::Long nTextOff = ( nWidth - aTextRect.GetWidth() ) / 2;
basegfx::B2DHomMatrix aTextMatrix( basegfx::utils::createScaleTranslateB2DHomMatrix(
aFontSize.getX(), aFontSize.getY(),
@@ -3699,7 +3699,7 @@ void SwPageFrame::PaintDecorators( ) const
bool bRtl = AllSettings::GetLayoutRTL();
const SwRect& rVisArea = gProp.pSGlobalShell->VisArea();
- long nXOff = std::min( aBodyRect.Right(), rVisArea.Right() );
+ tools::Long nXOff = std::min( aBodyRect.Right(), rVisArea.Right() );
if ( bRtl )
nXOff = std::max( aBodyRect.Left(), rVisArea.Left() );
@@ -3710,7 +3710,7 @@ void SwPageFrame::PaintDecorators( ) const
if ( !pHeaderFrame->IsHeaderFrame() )
pHeaderFrame = nullptr;
- long nHeaderYOff = aBodyRect.Top();
+ tools::Long nHeaderYOff = aBodyRect.Top();
Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nHeaderYOff ) );
rEditWin.GetFrameControlsManager().SetHeaderFooterControl( this, FrameControlType::Header, nOutputOff );
}
@@ -3727,7 +3727,7 @@ void SwPageFrame::PaintDecorators( ) const
pFootnoteContFrame = pFootnoteContFrame->GetNext();
}
- long nFooterYOff = aBodyRect.Bottom();
+ tools::Long nFooterYOff = aBodyRect.Bottom();
Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nFooterYOff ) );
rEditWin.GetFrameControlsManager().SetHeaderFooterControl( this, FrameControlType::Footer, nOutputOff );
}
@@ -4229,8 +4229,8 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect,
const bool bLeft, const bool bRight,
SwPaintProperties const & properties)
{
- const long nWidth = ::lcl_AlignWidth ( rShadow.GetWidth(), properties );
- const long nHeight = ::lcl_AlignHeight( rShadow.GetWidth(), properties );
+ const tools::Long nWidth = ::lcl_AlignWidth ( rShadow.GetWidth(), properties );
+ const tools::Long nHeight = ::lcl_AlignHeight( rShadow.GetWidth(), properties );
SwRects aRegion;
SwRect aOut( rOutRect );
@@ -5263,7 +5263,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect,
SwTwips nPrtWidth = aRectFnSet.GetWidth(getFramePrintArea());
Fraction aFract( nPrtWidth, 1 );
aFract *= rInf.GetWidth();
- const SwTwips nWidth = static_cast<long>(aFract);
+ const SwTwips nWidth = static_cast<tools::Long>(aFract);
SwTwips nX = aRectFnSet.GetPrtLeft(*this);
switch ( rInf.GetAdj() )
@@ -5366,11 +5366,11 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
bool bGrid = pGrid->GetRubyTextBelow();
bool bCell = GRID_LINES_CHARS == pGrid->GetGridType();
- long nGrid = pGrid->GetBaseHeight();
+ tools::Long nGrid = pGrid->GetBaseHeight();
const SwDoc* pDoc = GetFormat()->GetDoc();
- long nGridWidth = GetGridWidth(*pGrid, *pDoc);
- long nRuby = pGrid->GetRubyHeight();
- long nSum = nGrid + nRuby;
+ tools::Long nGridWidth = GetGridWidth(*pGrid, *pDoc);
+ tools::Long nRuby = pGrid->GetRubyHeight();
+ tools::Long nSum = nGrid + nRuby;
const Color *pCol = &pGrid->GetColor();
SwTwips nRight = aInter.Left() + aInter.Width();
@@ -5720,7 +5720,7 @@ bool SwPageFrame::IsLeftShadowNeeded() const
::SwAlignRect( aAlignedPageRect, _pViewShell, pRenderContext );
SwRect aPagePxRect = pRenderContext->LogicToPixel( aAlignedPageRect.SVRect() );
- long lShadowAdjustment = mnShadowPxWidth - 1; // TODO: extract this
+ tools::Long lShadowAdjustment = mnShadowPxWidth - 1; // TODO: extract this
_orHorizontalShadowRect.Chg(
Point( aPagePxRect.Left() + (bPaintLeftShadow ? lShadowAdjustment : 0), 0 ),
@@ -5773,8 +5773,8 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
tools::Rectangle aComplete(aPoint, aSize);
Size aTileSize(BORDER_TILE_SIZE, BORDER_TILE_SIZE);
- long iterX = eArea != RIGHT && eArea != LEFT ? BORDER_TILE_SIZE : 0;
- long iterY = eArea == RIGHT || eArea == LEFT ? BORDER_TILE_SIZE : 0;
+ tools::Long iterX = eArea != RIGHT && eArea != LEFT ? BORDER_TILE_SIZE : 0;
+ tools::Long iterY = eArea == RIGHT || eArea == LEFT ? BORDER_TILE_SIZE : 0;
for (tools::Rectangle aTile(aPoint, aTileSize); true; aTile.Move(iterX, iterY))
{
@@ -5896,8 +5896,8 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
if (aPagePxRect.Height() > 2 * mnShadowPxWidth)
{
- const long nWidth = aPageRightShadow.GetSizePixel().Width();
- const long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
+ const tools::Long nWidth = aPageRightShadow.GetSizePixel().Width();
+ const tools::Long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
if (aPageRightShadow.GetSizePixel().Height() < BORDER_TILE_SIZE)
aPageRightShadow.Scale(Size(nWidth, BORDER_TILE_SIZE), BmpScaleFlag::Fast);
@@ -5911,14 +5911,14 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
// Left shadows and corners
if(bPaintLeftShadow)
{
- const long lLeft = aPaintRect.Left() - aPageBottomLeftShadow.GetSizePixel().Width();
+ const tools::Long lLeft = aPaintRect.Left() - aPageBottomLeftShadow.GetSizePixel().Width();
pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft,
aPagePxRect.Bottom() + 1 + mnShadowPxWidth - aPageBottomLeftShadow.GetSizePixel().Height() ) ), aPageBottomLeftShadow );
pOut->DrawBitmapEx( pOut->PixelToLogic( Point( lLeft, aPagePxRect.Top() - mnShadowPxWidth ) ), aPageTopLeftShadow );
if (aPagePxRect.Height() > 2 * mnShadowPxWidth)
{
- const long nWidth = aPageLeftShadow.GetSizePixel().Width();
- const long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
+ const tools::Long nWidth = aPageLeftShadow.GetSizePixel().Width();
+ const tools::Long nHeight = aPagePxRect.Height() - 2 * (mnShadowPxWidth - 1);
if (aPageLeftShadow.GetSizePixel().Height() < BORDER_TILE_SIZE)
aPageLeftShadow.Scale(Size(nWidth, BORDER_TILE_SIZE), BmpScaleFlag::Fast);
@@ -5930,7 +5930,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
}
// Bottom shadow
- const long nBottomHeight = aPageBottomShadow.GetSizePixel().Height();
+ const tools::Long nBottomHeight = aPageBottomShadow.GetSizePixel().Height();
if (aPageBottomShadow.GetSizePixel().Width() < BORDER_TILE_SIZE)
aPageBottomShadow.Scale(Size(BORDER_TILE_SIZE, nBottomHeight), BmpScaleFlag::Fast);
@@ -5940,7 +5940,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
aPageBottomShadow, BOTTOM);
// Top shadow
- const long nTopHeight = aPageTopShadow.GetSizePixel().Height();
+ const tools::Long nTopHeight = aPageTopShadow.GetSizePixel().Height();
if (aPageTopShadow.GetSizePixel().Width() < BORDER_TILE_SIZE)
aPageTopShadow.Scale(Size(BORDER_TILE_SIZE, nTopHeight), BmpScaleFlag::Fast);
@@ -6508,7 +6508,7 @@ static void lcl_RefreshLine( const SwLayoutFrame *pLay,
// use pointers to member function in order to unify flow
typedef long (Point::*pmfPtGet)() const;
- typedef void (Point::*pmfPtSet)(long);
+ typedef void (Point::*pmfPtSet)(tools::Long);
const pmfPtGet pDirPtX = &Point::X;
const pmfPtGet pDirPtY = &Point::Y;
const pmfPtGet pDirPt = bHori ? pDirPtX : pDirPtY;
@@ -6568,17 +6568,17 @@ static void lcl_RefreshLine( const SwLayoutFrame *pLay,
}
//Is the Obj placed on the line
- const long nP1OthPt = !bHori ? rP1.X() : rP1.Y();
+ const tools::Long nP1OthPt = !bHori ? rP1.X() : rP1.Y();
const tools::Rectangle &rBound = pObj->GetCurrentBoundRect();
const Point aDrPt( rBound.TopLeft() );
- const long nDrOthPt = !bHori ? aDrPt.X() : aDrPt.Y();
+ const tools::Long nDrOthPt = !bHori ? aDrPt.X() : aDrPt.Y();
const Size aDrSz( rBound.GetSize() );
- const long nDrOthSz = !bHori ? aDrSz.Width() : aDrSz.Height();
+ const tools::Long nDrOthSz = !bHori ? aDrSz.Width() : aDrSz.Height();
if ( nP1OthPt >= nDrOthPt && nP1OthPt <= nDrOthPt + nDrOthSz )
{
- const long nDrDirPt = bHori ? aDrPt.X() : aDrPt.Y();
- const long nDrDirSz = bHori ? aDrSz.Width() : aDrSz.Height();
+ const tools::Long nDrDirPt = bHori ? aDrPt.X() : aDrPt.Y();
+ const tools::Long nDrDirSz = bHori ? aDrSz.Width() : aDrSz.Height();
if ( (aP1.*pDirPt)() >= nDrDirPt && (aP1.*pDirPt)() <= nDrDirPt + nDrDirSz )
(aP1.*pDirPtSet)( nDrDirPt + nDrDirSz );
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index e6daa4b65ee8..e293be36a2ed 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -117,7 +117,7 @@ void SwSectionFrame::Init()
{
assert(GetUpper() && "SwSectionFrame::Init before insertion?!");
SwRectFnSet aRectFnSet(this);
- long nWidth = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea());
+ tools::Long nWidth = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea());
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
@@ -1069,7 +1069,7 @@ void SwSectionFrame::CollectEndnotes( SwLayouter* pLayouter )
void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize )
{
SwRectFnSet aRectFnSet(this);
- long nDiff;
+ tools::Long nDiff;
SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper());
if( bGrow && ( !IsInFly() || !GetUpper()->IsColBodyFrame() ||
!FindFlyFrame()->IsLocked() ) )
@@ -1079,7 +1079,7 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize )
nDiff += Undersize();
if( nDiff > 0 )
{
- long nAdd = GetUpper()->Grow( nDiff );
+ tools::Long nAdd = GetUpper()->Grow( nDiff );
if( aRectFnSet.IsVert() )
nDeadLine -= nAdd;
else
@@ -1118,7 +1118,7 @@ void SwSectionFrame::CheckClipping( bool bGrow, bool bMaximize )
if( nDiff < 0 )
nDeadLine = aRectFnSet.GetTop(getFrameArea());
const Size aOldSz( getFramePrintArea().SSize() );
- long nTop = aRectFnSet.GetTopMargin(*this);
+ tools::Long nTop = aRectFnSet.GetTopMargin(*this);
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
@@ -1182,8 +1182,8 @@ void SwSectionFrame::SimpleFormat()
aRectFnSet.SetBottom( aFrm, nDeadLine );
}
- long nHeight = aRectFnSet.GetHeight(getFrameArea());
- long nTop = CalcUpperSpace();
+ tools::Long nHeight = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nTop = CalcUpperSpace();
if( nTop > nHeight )
nTop = nHeight;
aRectFnSet.SetYMargins( *this, nTop, 0 );
@@ -1368,7 +1368,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA
return;
PROTOCOL_ENTER( this, PROT::Size, DbgAction::NONE, nullptr )
- const long nOldHeight = aRectFnSet.GetHeight(getFrameArea());
+ const tools::Long nOldHeight = aRectFnSet.GetHeight(getFrameArea());
bool bOldLock = IsColLocked();
ColLock();
@@ -1403,7 +1403,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA
if( GetUpper() )
{
- const long nWidth = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea());
+ const tools::Long nWidth = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea());
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
@@ -1482,9 +1482,9 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA
{
SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper());
{
- long nBottom = aRectFnSet.GetBottom(getFrameArea());
+ tools::Long nBottom = aRectFnSet.GetBottom(getFrameArea());
nBottom = aRectFnSet.YInc( nBottom, -nDiff );
- long nTmpDiff = aRectFnSet.YDiff( nBottom, nDeadLine );
+ tools::Long nTmpDiff = aRectFnSet.YDiff( nBottom, nDeadLine );
if( nTmpDiff > 0 )
{
nTmpDiff = GetUpper()->Grow( nTmpDiff, true );
@@ -1499,8 +1499,8 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA
}
if( nDiff )
{
- long nTmp = nRemaining - aRectFnSet.GetHeight(getFrameArea());
- long nTop = aRectFnSet.GetTopMargin(*this);
+ tools::Long nTmp = nRemaining - aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nTop = aRectFnSet.GetTopMargin(*this);
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
@@ -1548,7 +1548,7 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA
CheckClipping( true, bMaximize );
if( !bOldLock )
ColUnlock();
- long nDiff = nOldHeight - aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nDiff = nOldHeight - aRectFnSet.GetHeight(getFrameArea());
if( nDiff > 0 )
{
@@ -2154,7 +2154,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
if ( !IsColLocked() && !HasFixSize() )
{
SwRectFnSet aRectFnSet(this);
- long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) )
nDist = LONG_MAX - nFrameHeight;
@@ -2228,7 +2228,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
}
{
- const long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea()) + nGrow;
+ const tools::Long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea()) + nGrow;
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aRectFnSet.SetHeight( aPrt, nPrtHeight );
}
@@ -2296,7 +2296,7 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst )
else
{
SwRectFnSet aRectFnSet(this);
- long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
if ( nDist > nFrameHeight )
nDist = nFrameHeight;
@@ -2324,7 +2324,7 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst )
}
{
- const long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea()) - nDist;
+ const tools::Long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea()) - nDist;
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aRectFnSet.SetHeight( aPrt, nPrtHeight );
}
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 7fe3bc82b9fa..9f0da8f708b6 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -36,24 +36,24 @@
#include <ndtxt.hxx>
// No inline cause we need the function pointers
-long SwFrame::GetTopMargin() const
+tools::Long SwFrame::GetTopMargin() const
{ return getFramePrintArea().Top(); }
-long SwFrame::GetBottomMargin() const
+tools::Long SwFrame::GetBottomMargin() const
{ return getFrameArea().Height() -getFramePrintArea().Height() -getFramePrintArea().Top(); }
-long SwFrame::GetLeftMargin() const
+tools::Long SwFrame::GetLeftMargin() const
{ return getFramePrintArea().Left(); }
-long SwFrame::GetRightMargin() const
+tools::Long SwFrame::GetRightMargin() const
{ return getFrameArea().Width() - getFramePrintArea().Width() - getFramePrintArea().Left(); }
-long SwFrame::GetPrtLeft() const
+tools::Long SwFrame::GetPrtLeft() const
{ return getFrameArea().Left() + getFramePrintArea().Left(); }
-long SwFrame::GetPrtBottom() const
+tools::Long SwFrame::GetPrtBottom() const
{ return getFrameArea().Top() + getFramePrintArea().Height() + getFramePrintArea().Top(); }
-long SwFrame::GetPrtRight() const
+tools::Long SwFrame::GetPrtRight() const
{ return getFrameArea().Left() + getFramePrintArea().Width() + getFramePrintArea().Left(); }
-long SwFrame::GetPrtTop() const
+tools::Long SwFrame::GetPrtTop() const
{ return getFrameArea().Top() + getFramePrintArea().Top(); }
-bool SwFrame::SetMinLeft( long nDeadline )
+bool SwFrame::SetMinLeft( tools::Long nDeadline )
{
SwTwips nDiff = nDeadline - getFrameArea().Left();
if( nDiff > 0 )
@@ -69,7 +69,7 @@ bool SwFrame::SetMinLeft( long nDeadline )
return false;
}
-bool SwFrame::SetMaxBottom( long nDeadline )
+bool SwFrame::SetMaxBottom( tools::Long nDeadline )
{
SwTwips nDiff = getFrameArea().Top() + getFrameArea().Height() - nDeadline;
if( nDiff > 0 )
@@ -85,7 +85,7 @@ bool SwFrame::SetMaxBottom( long nDeadline )
return false;
}
-bool SwFrame::SetMaxRight( long nDeadline )
+bool SwFrame::SetMaxRight( tools::Long nDeadline )
{
SwTwips nDiff = getFrameArea().Left() + getFrameArea().Width() - nDeadline;
if( nDiff > 0 )
@@ -165,21 +165,21 @@ void SwFrame::MakeRightPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotif
}
}
-void SwFrame::SetTopBottomMargins( long nTop, long nBot )
+void SwFrame::SetTopBottomMargins( tools::Long nTop, tools::Long nBot )
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Top( nTop );
aPrt.Height( getFrameArea().Height() - nTop - nBot );
}
-void SwFrame::SetLeftRightMargins( long nLeft, long nRight)
+void SwFrame::SetLeftRightMargins( tools::Long nLeft, tools::Long nRight)
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Left( nLeft );
aPrt.Width( getFrameArea().Width() - nLeft - nRight );
}
-void SwFrame::SetRightLeftMargins( long nRight, long nLeft)
+void SwFrame::SetRightLeftMargins( tools::Long nRight, tools::Long nLeft)
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Left( nLeft );
@@ -586,19 +586,19 @@ SwRect SwFrame::GetPaintArea() const
const bool bVert = IsVertical();
SwRectFn fnRect = bVert ? ( IsVertLR() ? (IsVertLRBT() ? fnRectVertL2RB2T : fnRectVertL2R) : fnRectVert ) : fnRectHori;
SwRectFnSet aRectFnSet(this);
- long nRight = (aRect.*fnRect->fnGetRight)();
- long nLeft = (aRect.*fnRect->fnGetLeft)();
+ tools::Long nRight = (aRect.*fnRect->fnGetRight)();
+ tools::Long nLeft = (aRect.*fnRect->fnGetLeft)();
const SwFrame* pTmp = this;
bool bLeft = true;
bool bRight = true;
- long nRowSpan = 0;
+ tools::Long nRowSpan = 0;
while( pTmp )
{
if( pTmp->IsCellFrame() && pTmp->GetUpper() &&
pTmp->GetUpper()->IsVertical() != pTmp->IsVertical() )
nRowSpan = static_cast<const SwCellFrame*>(pTmp)->GetTabBox()->getRowSpan();
- long nTmpRight = (pTmp->getFrameArea().*fnRect->fnGetRight)();
- long nTmpLeft = (pTmp->getFrameArea().*fnRect->fnGetLeft)();
+ tools::Long nTmpRight = (pTmp->getFrameArea().*fnRect->fnGetRight)();
+ tools::Long nTmpLeft = (pTmp->getFrameArea().*fnRect->fnGetLeft)();
if( pTmp->IsRowFrame() && nRowSpan > 1 )
{
const SwFrame* pNxt = pTmp;
@@ -689,10 +689,10 @@ SwRect SwFrame::UnionFrame( bool bBorder ) const
{
bool bVert = IsVertical();
SwRectFn fnRect = bVert ? ( IsVertLR() ? (IsVertLRBT() ? fnRectVertL2RB2T : fnRectVertL2R) : fnRectVert ) : fnRectHori;
- long nLeft = (getFrameArea().*fnRect->fnGetLeft)();
- long nWidth = (getFrameArea().*fnRect->fnGetWidth)();
- long nPrtLeft = (getFramePrintArea().*fnRect->fnGetLeft)();
- long nPrtWidth = (getFramePrintArea().*fnRect->fnGetWidth)();
+ tools::Long nLeft = (getFrameArea().*fnRect->fnGetLeft)();
+ tools::Long nWidth = (getFrameArea().*fnRect->fnGetWidth)();
+ tools::Long nPrtLeft = (getFramePrintArea().*fnRect->fnGetLeft)();
+ tools::Long nPrtWidth = (getFramePrintArea().*fnRect->fnGetWidth)();
SwRectFnSet aRectFnSet(this);
if (aRectFnSet.XInc(nPrtLeft, nPrtWidth) > nWidth)
nWidth = nPrtLeft + nPrtWidth;
@@ -702,7 +702,7 @@ SwRect SwFrame::UnionFrame( bool bBorder ) const
nWidth -= nPrtLeft;
}
SwTwips nRight = aRectFnSet.XInc(nLeft, nWidth);
- long nAdd = 0;
+ tools::Long nAdd = 0;
if( bBorder )
{
SwBorderAttrAccess aAccess( SwFrame::GetCache(), this );
@@ -725,7 +725,7 @@ SwRect SwFrame::UnionFrame( bool bBorder ) const
}
if( IsTextFrame() && static_cast<const SwTextFrame*>(this)->HasPara() )
{
- long nTmp = static_cast<const SwTextFrame*>(this)->HangingMargin();
+ tools::Long nTmp = static_cast<const SwTextFrame*>(this)->HangingMargin();
if( nTmp > nAdd )
nAdd = nTmp;
}
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 103f8260037a..052b51b1b42d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -171,13 +171,13 @@ void SwTabFrame::RegistFlys()
}
}
-static void SwInvalidateAll( SwFrame *pFrame, long nBottom );
-static void lcl_RecalcRow( SwRowFrame& rRow, long nBottom );
-static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva );
+static void SwInvalidateAll( SwFrame *pFrame, tools::Long nBottom );
+static void lcl_RecalcRow( SwRowFrame& rRow, tools::Long nBottom );
+static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, tools::Long lYStart, bool bInva );
// #i26945# - add parameter <_bOnlyRowsAndCells> to control
// that only row and cell frames are formatted.
static bool lcl_InnerCalcLayout( SwFrame *pFrame,
- long nBottom,
+ tools::Long nBottom,
bool _bOnlyRowsAndCells = false );
// OD 2004-02-18 #106629# - correct type of 1st parameter
// #i26945# - add parameter <_bConsiderObjs> in order to
@@ -189,7 +189,7 @@ static SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrame&, const SwBorderA
static SwTwips lcl_calcHeightOfRowBeforeThisFrame(const SwRowFrame& rRow);
-static SwTwips lcl_GetHeightOfRows( const SwFrame* pStart, long nCount )
+static SwTwips lcl_GetHeightOfRows( const SwFrame* pStart, tools::Long nCount )
{
if ( !nCount || !pStart)
return 0;
@@ -524,7 +524,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrame& rTab, SwRowFrame& rLastLine,
// Check if we can move pTmpLastLineRow to the follow table,
// or if we have to split the line:
bool bTableLayoutTooComplex = false;
- long nMinHeight = 0;
+ tools::Long nMinHeight = 0;
// We have to take into account:
// 1. The fixed height of the row
@@ -819,12 +819,12 @@ static void lcl_AdjustRowSpanCells( SwRowFrame* pRow )
SwCellFrame* pCellFrame = static_cast<SwCellFrame*>(pRow->GetLower());
while ( pCellFrame )
{
- const long nLayoutRowSpan = pCellFrame->GetLayoutRowSpan();
+ const tools::Long nLayoutRowSpan = pCellFrame->GetLayoutRowSpan();
if ( nLayoutRowSpan > 1 )
{
// calculate height of cell:
- const long nNewCellHeight = lcl_GetHeightOfRows( pRow, nLayoutRowSpan );
- const long nDiff = nNewCellHeight - aRectFnSet.GetHeight(pCellFrame->getFrameArea());
+ const tools::Long nNewCellHeight = lcl_GetHeightOfRows( pRow, nLayoutRowSpan );
+ const tools::Long nDiff = nNewCellHeight - aRectFnSet.GetHeight(pCellFrame->getFrameArea());
if ( nDiff )
{
@@ -839,9 +839,9 @@ static void lcl_AdjustRowSpanCells( SwRowFrame* pRow )
// Returns the maximum layout row span of the row
// Looking for the next row that contains no covered cells:
-static long lcl_GetMaximumLayoutRowSpan( const SwRowFrame& rRow )
+static tools::Long lcl_GetMaximumLayoutRowSpan( const SwRowFrame& rRow )
{
- long nRet = 1;
+ tools::Long nRet = 1;
const SwRowFrame* pCurrentRowFrame = static_cast<const SwRowFrame*>(rRow.GetNext());
bool bNextRow = false;
@@ -904,7 +904,7 @@ bool SwTabFrame::RemoveFollowFlowLine()
// NEW TABLES
// If a row span follow flow line is removed, we want to move the whole span
// to the master:
- long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pFollowFlowLine );
+ tools::Long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pFollowFlowLine );
if ( nRowsToMove > 1 )
{
@@ -1392,7 +1392,7 @@ void SwTabFrame::Join()
Grow( nHeight );
}
-static void SwInvalidatePositions( SwFrame *pFrame, long nBottom )
+static void SwInvalidatePositions( SwFrame *pFrame, tools::Long nBottom )
{
// LONG_MAX == nBottom means we have to calculate all
bool bAll = LONG_MAX == nBottom;
@@ -1417,7 +1417,7 @@ static void SwInvalidatePositions( SwFrame *pFrame, long nBottom )
aRectFnSet.YDiff( aRectFnSet.GetTop(pFrame->getFrameArea()), nBottom ) < 0 ) );
}
-void SwInvalidateAll( SwFrame *pFrame, long nBottom )
+void SwInvalidateAll( SwFrame *pFrame, tools::Long nBottom )
{
// LONG_MAX == nBottom means we have to calculate all
bool bAll = LONG_MAX == nBottom;
@@ -1477,7 +1477,7 @@ static void lcl_InvalidateAllLowersPrt( SwLayoutFrame* pLayFrame )
}
bool SwContentFrame::CalcLowers(SwLayoutFrame & rLay, SwLayoutFrame const& rDontLeave,
- long nBottom, bool bSkipRowSpanCells )
+ tools::Long nBottom, bool bSkipRowSpanCells )
{
vcl::RenderContext* pRenderContext = rLay.getRootFrame()->GetCurrShell()->GetOut();
// LONG_MAX == nBottom means we have to calculate all
@@ -1571,7 +1571,7 @@ bool SwContentFrame::CalcLowers(SwLayoutFrame & rLay, SwLayoutFrame const& rDont
// #i26945# - add parameter <_bOnlyRowsAndCells> to control
// that only row and cell frames are formatted.
static bool lcl_InnerCalcLayout( SwFrame *pFrame,
- long nBottom,
+ tools::Long nBottom,
bool _bOnlyRowsAndCells )
{
vcl::RenderContext* pRenderContext = pFrame->getRootFrame()->GetCurrShell() ? pFrame->getRootFrame()->GetCurrShell()->GetOut() : nullptr;
@@ -1614,7 +1614,7 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame,
return bRet;
}
-static void lcl_RecalcRow(SwRowFrame & rRow, long const nBottom)
+static void lcl_RecalcRow(SwRowFrame & rRow, tools::Long const nBottom)
{
// FME 2007-08-30 #i81146# new loop control
int nLoopControlRuns_1 = 0;
@@ -2046,7 +2046,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
//We need to know the height of the first row, because the master needs
//to be invalidated if it shrinks and then absorb the row if possible.
- long n1StLineHeight = 0;
+ tools::Long n1StLineHeight = 0;
if ( IsFollow() )
{
SwFrame* pFrame = GetFirstNonHeadlineRow();
@@ -2056,8 +2056,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
if ( !isFrameAreaSizeValid() || !isFramePrintAreaValid() )
{
- const long nOldPrtWidth = aRectFnSet.GetWidth(getFramePrintArea());
- const long nOldFrameWidth = aRectFnSet.GetWidth(getFrameArea());
+ const tools::Long nOldPrtWidth = aRectFnSet.GetWidth(getFramePrintArea());
+ const tools::Long nOldFrameWidth = aRectFnSet.GetWidth(getFrameArea());
const Point aOldPrtPos = aRectFnSet.GetPos(getFramePrintArea());
Format( getRootFrame()->GetCurrShell()->GetOut(), pAttrs );
@@ -2107,7 +2107,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true );
if ( bReformat || bKeep )
{
- long nOldTop = aRectFnSet.GetTop(getFrameArea());
+ tools::Long nOldTop = aRectFnSet.GetTop(getFrameArea());
MakePos();
if( nOldTop != aRectFnSet.GetTop(getFrameArea()) )
{
@@ -2231,7 +2231,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
const SwTwips nOld = aRectFnSet.GetHeight(getFrameArea());
- long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pRow );
+ tools::Long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pRow );
SwFrame* pRowToMove = pRow;
while ( pRowToMove && nRowsToMove-- > 0 )
@@ -2716,8 +2716,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
/// Calculate the offsets arising because of FlyFrames
bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
- long& rLeftOffset,
- long& rRightOffset ) const
+ tools::Long& rLeftOffset,
+ tools::Long& rRightOffset ) const
{
bool bInvalidatePrtArea = false;
const SwPageFrame *pPage = FindPageFrame();
@@ -2734,10 +2734,10 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
{
SwRectFnSet aRectFnSet(this);
const bool bConsiderWrapOnObjPos = rIDSA.get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION);
- long nPrtPos = aRectFnSet.GetTop(getFrameArea());
+ tools::Long nPrtPos = aRectFnSet.GetTop(getFrameArea());
nPrtPos = aRectFnSet.YInc( nPrtPos, rUpper );
SwRect aRect( getFrameArea() );
- long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(getFramePrintArea()), rUpper );
+ tools::Long nYDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(getFramePrintArea()), rUpper );
if( nYDiff > 0 )
aRectFnSet.AddBottom( aRect, -nYDiff );
@@ -2842,7 +2842,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
if (bShiftDown)
{
- long nBottom = aRectFnSet.GetBottom(aFlyRect);
+ tools::Long nBottom = aRectFnSet.GetBottom(aFlyRect);
if( aRectFnSet.YDiff( nPrtPos, nBottom ) < 0 )
nPrtPos = nBottom;
bInvalidatePrtArea = true;
@@ -2851,7 +2851,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
css::text::WrapTextMode_PARALLEL == rSur.GetSurround())&&
text::HoriOrientation::LEFT == rHori.GetHoriOrient() )
{
- const long nWidth = aRectFnSet.XDiff(
+ const tools::Long nWidth = aRectFnSet.XDiff(
aRectFnSet.GetRight(aFlyRect),
aRectFnSet.GetLeft(pFly->GetAnchorFrame()->getFrameArea()) );
rLeftOffset = std::max( rLeftOffset, nWidth );
@@ -2861,7 +2861,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
css::text::WrapTextMode_PARALLEL == rSur.GetSurround())&&
text::HoriOrientation::RIGHT == rHori.GetHoriOrient() )
{
- const long nWidth = aRectFnSet.XDiff(
+ const tools::Long nWidth = aRectFnSet.XDiff(
aRectFnSet.GetRight(pFly->GetAnchorFrame()->getFrameArea()),
aRectFnSet.GetLeft(aFlyRect) );
rRightOffset = std::max( rRightOffset, nWidth );
@@ -2885,7 +2885,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
SwRectFnSet aRectFnSet(this);
if ( !isFrameAreaSizeValid() )
{
- long nDiff = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea()) -
+ tools::Long nDiff = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea()) -
aRectFnSet.GetWidth(getFrameArea());
if( nDiff )
{
@@ -2904,14 +2904,14 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
// 1. There are flys with SurroundNone, dodge them completely
// 2. There are flys which only wrap on the right or the left side and
// those are right or left aligned, those set the minimum for the margins
- long nTmpRight = -1000000,
+ tools::Long nTmpRight = -1000000,
nLeftOffset = 0;
if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) )
{
setFramePrintAreaValid(false);
}
- long nRightOffset = std::max( 0L, nTmpRight );
+ tools::Long nRightOffset = std::max( 0L, nTmpRight );
SwTwips nLower = pAttrs->CalcBottomLine();
// #i29550#
@@ -3109,7 +3109,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
//Don't go beyond the edge of the visible area.
//The page width can be bigger because objects with
//"over-size" are possible (RootFrame::ImplCalcBrowseWidth())
- long nWidth = pSh->GetBrowseWidth();
+ tools::Long nWidth = pSh->GetBrowseWidth();
nWidth -= getFramePrintArea().Left();
nWidth -= pAttrs->CalcRightLine();
@@ -3172,7 +3172,7 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
if ( nReal < nDist )
{
- long nTmp = GetUpper()->Grow( nDist - std::max<long>(nReal, 0), bTst, bInfo );
+ tools::Long nTmp = GetUpper()->Grow( nDist - std::max<long>(nReal, 0), bTst, bInfo );
if ( IsRestrictTableGrowth() )
{
@@ -3519,9 +3519,9 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool &rReformat )
if ( !SwFlowFrame::IsMoveBwdJump() )
{
- long nOldWidth = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea());
+ tools::Long nOldWidth = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea());
SwRectFnSet fnRectX(pNewUpper);
- long nNewWidth = fnRectX.GetWidth(pNewUpper->getFramePrintArea());
+ tools::Long nNewWidth = fnRectX.GetWidth(pNewUpper->getFramePrintArea());
if( std::abs( nNewWidth - nOldWidth ) < 2 )
{
bMoveAnyway = BwdMoveNecessary( pOldPage, getFrameArea() ) > 1;
@@ -3865,10 +3865,10 @@ void SwRowFrame::MakeAll(vcl::RenderContext* pRenderContext)
SwLayoutFrame::MakeAll(pRenderContext);
}
-long CalcHeightWithFlys( const SwFrame *pFrame )
+tools::Long CalcHeightWithFlys( const SwFrame *pFrame )
{
SwRectFnSet aRectFnSet(pFrame);
- long nHeight = 0;
+ tools::Long nHeight = 0;
const SwFrame* pTmp = pFrame->IsSctFrame() ?
static_cast<const SwSectionFrame*>(pFrame)->ContainsContent() : pFrame;
while( pTmp )
@@ -4022,7 +4022,7 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrame *_pCell,
const SwFrame* pLow = _pCell->Lower();
if ( pLow )
{
- long nFlyAdd = 0;
+ tools::Long nFlyAdd = 0;
while ( pLow )
{
if ( pLow->IsRowFrame() )
@@ -4033,7 +4033,7 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrame *_pCell,
}
else
{
- long nLowHeight = aRectFnSet.GetHeight(pLow->getFrameArea());
+ tools::Long nLowHeight = aRectFnSet.GetHeight(pLow->getFrameArea());
nHeight += nLowHeight;
// #i26945#
if ( _bConsiderObjs )
@@ -4092,7 +4092,7 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* _pRow,
while ( pLow )
{
SwTwips nTmp = 0;
- const long nRowSpan = pLow->GetLayoutRowSpan();
+ const tools::Long nRowSpan = pLow->GetLayoutRowSpan();
// --> NEW TABLES
// Consider height of
// 1. current cell if RowSpan == 1
@@ -4459,7 +4459,7 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight )
if ( pCellFrame->GetTabBox()->getRowSpan() < 1 )
{
// Set height of current (covered) cell to new line height.
- const long nDiff = nHeight - aRectFnSet.GetHeight(pCellFrame->getFrameArea());
+ const tools::Long nDiff = nHeight - aRectFnSet.GetHeight(pCellFrame->getFrameArea());
if ( nDiff )
{
{
@@ -4488,7 +4488,7 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight )
}
// Set height of master cell to height of all lines spanned by this line.
- long nRowSpan = pToAdjust->GetLayoutRowSpan();
+ tools::Long nRowSpan = pToAdjust->GetLayoutRowSpan();
SwTwips nSumRowHeight = 0;
while ( pToAdjustRow )
{
@@ -4506,7 +4506,7 @@ void SwRowFrame::AdjustCells( const SwTwips nHeight, const bool bHeight )
if ( pToAdjustRow && pToAdjustRow != this )
pToAdjustRow->InvalidateSize_();
- const long nDiff = nSumRowHeight - aRectFnSet.GetHeight(pToAdjust->getFrameArea());
+ const tools::Long nDiff = nSumRowHeight - aRectFnSet.GetHeight(pToAdjust->getFrameArea());
if ( nDiff )
{
aOldFrame = pToAdjust->getFrameArea();
@@ -4808,19 +4808,19 @@ SwCellFrame::~SwCellFrame()
{
}
-static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva )
+static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, tools::Long lYStart, bool bInva )
{
bool bRet = false;
SwFrame *pFrame = pLay->Lower();
SwRectFnSet aRectFnSet(pLay);
while ( pFrame )
{
- long nFrameTop = aRectFnSet.GetTop(pFrame->getFrameArea());
+ tools::Long nFrameTop = aRectFnSet.GetTop(pFrame->getFrameArea());
if( nFrameTop != lYStart )
{
bRet = true;
- const long lDiff = aRectFnSet.YDiff( lYStart, nFrameTop );
- const long lDiffX = lYStart - nFrameTop;
+ const tools::Long lDiff = aRectFnSet.YDiff( lYStart, nFrameTop );
+ const tools::Long lDiffX = lYStart - nFrameTop;
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pFrame);
@@ -5073,7 +5073,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
}
}
// #i26945#
- long nRemaining = GetTabBox()->getRowSpan() >= 1 ?
+ tools::Long nRemaining = GetTabBox()->getRowSpan() >= 1 ?
::lcl_CalcMinCellHeight( this, pTab->IsConsiderObjsForMinCellHeight(), pAttrs ) :
0;
if ( !isFrameAreaSizeValid() )
@@ -5098,7 +5098,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
OSL_ENSURE( nWidth <= nWish, "Width of cell larger than table." );
OSL_ENSURE( nWidth > 0, "Box without width" );
- const long nPrtWidth = aRectFnSet.GetWidth(pTab->getFramePrintArea());
+ const tools::Long nPrtWidth = aRectFnSet.GetWidth(pTab->getFramePrintArea());
if ( nWish != nPrtWidth )
{
// Avoid rounding problems, at least for the new table model
@@ -5158,7 +5158,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
}
}
- const long nDiff = nWidth - aRectFnSet.GetWidth(getFrameArea());
+ const tools::Long nDiff = nWidth - aRectFnSet.GetWidth(getFrameArea());
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
@@ -5179,7 +5179,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
}
//Adjust the height, it's defined through the content and the margins.
- const long nDiffHeight = nRemaining - aRectFnSet.GetHeight(getFrameArea());
+ const tools::Long nDiffHeight = nRemaining - aRectFnSet.GetHeight(getFrameArea());
if ( nDiffHeight )
{
if ( nDiffHeight > 0 )
@@ -5271,14 +5271,14 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
}
}
- long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
+ tools::Long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
if( ( bVertDir && ( nRemaining -= lcl_CalcTopAndBottomMargin( *this, *pAttrs ) ) < nPrtHeight ) ||
aRectFnSet.GetTop(Lower()->getFrameArea()) != aRectFnSet.GetPrtTop(*this) )
{
- long nDiff = aRectFnSet.GetHeight(getFramePrintArea()) - nRemaining;
+ tools::Long nDiff = aRectFnSet.GetHeight(getFramePrintArea()) - nRemaining;
if ( nDiff >= 0 )
{
- long lTopOfst = 0;
+ tools::Long lTopOfst = 0;
if ( bVertDir )
{
switch ( rOri.GetVertOrient() )
@@ -5288,7 +5288,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
default: break;
}
}
- long nTmp = aRectFnSet.YInc(
+ tools::Long nTmp = aRectFnSet.YInc(
aRectFnSet.GetPrtTop(*this), lTopOfst );
if ( lcl_ArrangeLowers( this, nTmp, !bVertDir ) )
SetCompletePaint();
@@ -5300,7 +5300,7 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
//Was an old alignment taken into account?
if ( Lower()->IsContentFrame() )
{
- const long lYStart = aRectFnSet.GetPrtTop(*this);
+ const tools::Long lYStart = aRectFnSet.GetPrtTop(*this);
lcl_ArrangeLowers( this, lYStart, true );
}
}
@@ -5343,7 +5343,7 @@ void SwCellFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
Lower() && Lower()->IsContentFrame() )
{
SwRectFnSet aRectFnSet(this);
- const long lYStart = aRectFnSet.GetPrtTop(*this);
+ const tools::Long lYStart = aRectFnSet.GetPrtTop(*this);
bInva = lcl_ArrangeLowers( this, lYStart, false );
}
if ( bInva )
@@ -5393,10 +5393,10 @@ void SwCellFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SwLayoutFrame::Modify( pOld, pNew );
}
-long SwCellFrame::GetLayoutRowSpan() const
+tools::Long SwCellFrame::GetLayoutRowSpan() const
{
const SwTableBox *pTabBox = GetTabBox();
- long nRet = pTabBox ? pTabBox->getRowSpan() : 0;
+ tools::Long nRet = pTabBox ? pTabBox->getRowSpan() : 0;
if ( nRet < 1 )
{
const SwFrame* pRow = GetUpper();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 745cec996b5c..c1fb4b3bffc3 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -402,7 +402,7 @@ bool SwPageFrame::FillSelection( SwSelectionList& rList, const SwRect& rRect ) c
bool SwRootFrame::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) const
{
const SwFrame *pPage = Lower();
- const long nBottom = rRect.Bottom();
+ const tools::Long nBottom = rRect.Bottom();
while( pPage )
{
if( pPage->getFrameArea().Top() < nBottom )
@@ -783,14 +783,14 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart,
if (pTable && !pTable->GetUpper()->IsInTab())
{
const bool bRTL = pTable->IsRightToLeft();
- const long nPrtLeft = bRTL ?
+ const tools::Long nPrtLeft = bRTL ?
aRectFnSet.GetPrtRight(*pTable) :
aRectFnSet.GetPrtLeft(*pTable);
if (bRTL != (aRectFnSet.XDiff(nPrtLeft, nX) > 0))
nX = nPrtLeft;
else
{
- const long nPrtRight = bRTL ?
+ const tools::Long nPrtRight = bRTL ?
aRectFnSet.GetPrtLeft(*pTable) :
aRectFnSet.GetPrtRight(*pTable);
if (bRTL != (aRectFnSet.XDiff(nX, nPrtRight) > 0))
@@ -888,7 +888,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart,
Point aInsideCnt;
if ( pCell )
{
- long nTmpTop = aRectFnSet.GetTop(pCell->getFrameArea());
+ tools::Long nTmpTop = aRectFnSet.GetTop(pCell->getFrameArea());
if ( aRectFnSet.IsVert() )
{
if ( nTmpTop )
@@ -900,7 +900,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart,
aInsideCell = Point( nX, nTmpTop );
}
- long nTmpTop = aRectFnSet.GetTop(pCnt->getFrameArea());
+ tools::Long nTmpTop = aRectFnSet.GetTop(pCnt->getFrameArea());
if ( aRectFnSet.IsVert() )
{
if ( nTmpTop )
@@ -2164,9 +2164,9 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
aRectFnSet.GetWidth(pSt2Pos->aPortion2) )
{
// nested bidi portion
- long nRightAbs = aRectFnSet.GetRight(pSt2Pos->aPortion);
+ tools::Long nRightAbs = aRectFnSet.GetRight(pSt2Pos->aPortion);
nRightAbs -= aRectFnSet.GetLeft(pSt2Pos->aPortion2);
- long nLeftAbs = nRightAbs - aRectFnSet.GetWidth(pSt2Pos->aPortion2);
+ tools::Long nLeftAbs = nRightAbs - aRectFnSet.GetWidth(pSt2Pos->aPortion2);
aRectFnSet.SetRight( aTmp, nRightAbs );
@@ -2234,9 +2234,9 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
fnRectX.GetWidth(pEnd2Pos->aPortion2) )
{
// nested bidi portion
- long nRightAbs = fnRectX.GetRight(pEnd2Pos->aPortion);
+ tools::Long nRightAbs = fnRectX.GetRight(pEnd2Pos->aPortion);
nRightAbs = nRightAbs - fnRectX.GetLeft(pEnd2Pos->aPortion2);
- long nLeftAbs = nRightAbs - fnRectX.GetWidth(pEnd2Pos->aPortion2);
+ tools::Long nLeftAbs = nRightAbs - fnRectX.GetWidth(pEnd2Pos->aPortion2);
fnRectX.SetLeft( aTmp, nLeftAbs );
@@ -2307,9 +2307,9 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
if ( aRectFnSet.GetWidth(pSt2Pos->aPortion2) )
{
SwRect aTmp( aStRect );
- long nRightAbs = aRectFnSet.GetRight(pSt2Pos->aPortion);
+ tools::Long nRightAbs = aRectFnSet.GetRight(pSt2Pos->aPortion);
nRightAbs -= aRectFnSet.GetLeft(pSt2Pos->aPortion2);
- long nLeftAbs = nRightAbs - aRectFnSet.GetWidth(pSt2Pos->aPortion2);
+ tools::Long nLeftAbs = nRightAbs - aRectFnSet.GetWidth(pSt2Pos->aPortion2);
aRectFnSet.SetRight( aTmp, nRightAbs );
aTmp.Intersection( aStFrame );
@@ -2324,9 +2324,9 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
if ( fnRectX.GetWidth(pEnd2Pos->aPortion2) )
{
SwRect aTmp( aEndRect );
- long nRightAbs = fnRectX.GetRight(pEnd2Pos->aPortion);
+ tools::Long nRightAbs = fnRectX.GetRight(pEnd2Pos->aPortion);
nRightAbs -= fnRectX.GetLeft(pEnd2Pos->aPortion2);
- long nLeftAbs = nRightAbs - fnRectX.GetWidth(pEnd2Pos->aPortion2);
+ tools::Long nLeftAbs = nRightAbs - fnRectX.GetWidth(pEnd2Pos->aPortion2);
fnRectX.SetLeft( aTmp, nLeftAbs );
aTmp.Intersection( aEndFrame );
@@ -2376,13 +2376,13 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
{
if( aTmpSt.Y() > aTmpEnd.Y() )
{
- long nTmpY = aTmpEnd.Y();
+ tools::Long nTmpY = aTmpEnd.Y();
aTmpEnd.setY( aTmpSt.Y() );
aTmpSt.setY( nTmpY );
}
if( aTmpSt.X() > aTmpEnd.X() )
{
- long nTmpX = aTmpEnd.X();
+ tools::Long nTmpX = aTmpEnd.X();
aTmpEnd.setX( aTmpSt.X() );
aTmpSt.setX( nTmpX );
}
@@ -2397,7 +2397,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
pEndPos->nContent.GetIndex() )
{
OutputDevice* pOut = pSh->GetOut();
- long nCursorWidth = pOut->GetSettings().GetStyleSettings().
+ tools::Long nCursorWidth = pOut->GetSettings().GetStyleSettings().
GetCursorSize();
aRectFnSet.SetWidth( aTmp, pOut->PixelToLogic(
Size( nCursorWidth, 0 ) ).Width() );
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 67ec529a92a7..3927f405048c 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -736,8 +736,8 @@ Size SwFrame::ChgSize( const Size& aNewSize )
(aFrm.*fnRect->fnSetWidth)( (aNew.*fnRect->fnGetWidth)() );
}
- long nNew = (aNew.*fnRect->fnGetHeight)();
- long nDiff = nNew - (getFrameArea().*fnRect->fnGetHeight)();
+ tools::Long nNew = (aNew.*fnRect->fnGetHeight)();
+ tools::Long nDiff = nNew - (getFrameArea().*fnRect->fnGetHeight)();
if( nDiff )
{
@@ -1294,7 +1294,7 @@ void SwContentFrame::Cut()
else
{
SwRectFnSet aRectFnSet(this);
- long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
if( nFrameHeight )
pUp->Shrink( nFrameHeight );
}
@@ -1590,13 +1590,13 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
return 0;
//In BrowseView mode the PageFrame can handle some of the requests.
- long nBrowseAdd = 0;
+ tools::Long nBrowseAdd = 0;
if ( bBrowse && GetUpper()->IsPageFrame() ) // only (Page-)BodyFrames
{
SwViewShell *pViewShell = getRootFrame()->GetCurrShell();
SwLayoutFrame *pUp = GetUpper();
- long nChg;
- const long nUpPrtBottom = pUp->getFrameArea().Height() -
+ tools::Long nChg;
+ const tools::Long nUpPrtBottom = pUp->getFrameArea().Height() -
pUp->getFramePrintArea().Height() - pUp->getFramePrintArea().Top();
SwRect aInva( pUp->getFrameArea() );
if ( pViewShell )
@@ -1616,7 +1616,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
{
//First minimize Body, it will grow again later.
SwFrame *pBody = static_cast<SwFootnoteBossFrame*>(pUp)->FindBodyCont();
- const long nTmp = nChg - pBody->getFramePrintArea().Height();
+ const tools::Long nTmp = nChg - pBody->getFramePrintArea().Height();
if ( !bTst )
{
{
@@ -1635,7 +1635,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
}
}
- const long nTmp = nUpPrtBottom + 20;
+ const tools::Long nTmp = nUpPrtBottom + 20;
aInva.Top( aInva.Bottom() - nTmp );
aInva.Height( nChg + nTmp );
}
@@ -1644,7 +1644,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
//The page can shrink to 0. The first page keeps the same size like
//VisArea.
nChg = nDiff;
- long nInvaAdd = 0;
+ tools::Long nInvaAdd = 0;
if ( pViewShell && !pUp->GetPrev() &&
pUp->getFrameArea().Height() + nDiff < pViewShell->VisArea().Height() )
{
@@ -1654,7 +1654,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
}
//Invalidate including bottom border.
- long nBorder = nUpPrtBottom + 20;
+ tools::Long nBorder = nUpPrtBottom + 20;
nBorder -= nChg;
aInva.Top( aInva.Bottom() - (nBorder+nInvaAdd) );
if ( !IsBodyFrame() )
@@ -1707,8 +1707,8 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
//its Lower may be called. The values should not be changed
//because the caller takes care of the adjustment of Frame and
//Prt.
- const long nOldFrameHeight = getFrameArea().Height();
- const long nOldPrtHeight = getFramePrintArea().Height();
+ const tools::Long nOldFrameHeight = getFrameArea().Height();
+ const tools::Long nOldPrtHeight = getFramePrintArea().Height();
const bool bOldComplete = IsCompletePaint();
if ( IsBodyFrame() )
@@ -2118,7 +2118,7 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
if ( !bTst )
{
//Contents are always resized to the wished value.
- long nOld = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nOld = aRectFnSet.GetHeight(getFrameArea());
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
@@ -2785,7 +2785,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
{
if( !Lower()->IsNeighbourFrame() )
{ const SwFrame *pFrame = Lower();
- const long nTmp = aRectFnSet.GetHeight(getFramePrintArea());
+ const tools::Long nTmp = aRectFnSet.GetHeight(getFramePrintArea());
while( pFrame && nMin < nTmp )
{ nMin += aRectFnSet.GetHeight(pFrame->getFrameArea());
pFrame = pFrame->GetNext();
@@ -3421,8 +3421,8 @@ void SwLayoutFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord
nRemaining += nBorder;
nRemaining = std::max( nRemaining, nMinHeight );
const SwTwips nDiff = nRemaining-(getFrameArea().*fnRect->fnGetHeight)();
- const long nOldLeft = (getFrameArea().*fnRect->fnGetLeft)();
- const long nOldTop = (getFrameArea().*fnRect->fnGetTop)();
+ const tools::Long nOldLeft = (getFrameArea().*fnRect->fnGetLeft)();
+ const tools::Long nOldTop = (getFrameArea().*fnRect->fnGetTop)();
if ( nDiff )
{
if ( nDiff > 0 )
@@ -3537,21 +3537,21 @@ void SwLayoutFrame::InvaPercentLowers( SwTwips nDiff )
} while ( pFrame && IsAnLower( pFrame ) ) ;
}
-long SwLayoutFrame::CalcRel( const SwFormatFrameSize &rSz ) const
+tools::Long SwLayoutFrame::CalcRel( const SwFormatFrameSize &rSz ) const
{
- long nRet = rSz.GetWidth(),
+ tools::Long nRet = rSz.GetWidth(),
nPercent = rSz.GetWidthPercent();
if ( nPercent )
{
const SwFrame *pRel = GetUpper();
- long nRel = LONG_MAX;
+ tools::Long nRel = LONG_MAX;
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if( pRel->IsPageBodyFrame() && pSh && bBrowseMode && pSh->VisArea().Width() )
{
nRel = pSh->GetBrowseWidth();
- long nDiff = nRel - pRel->getFramePrintArea().Width();
+ tools::Long nDiff = nRel - pRel->getFramePrintArea().Width();
if ( nDiff > 0 )
nRel -= nDiff;
}
@@ -3563,9 +3563,9 @@ long SwLayoutFrame::CalcRel( const SwFormatFrameSize &rSz ) const
// Local helpers for SwLayoutFrame::FormatWidthCols()
-static long lcl_CalcMinColDiff( SwLayoutFrame *pLayFrame )
+static tools::Long lcl_CalcMinColDiff( SwLayoutFrame *pLayFrame )
{
- long nDiff = 0, nFirstDiff = 0;
+ tools::Long nDiff = 0, nFirstDiff = 0;
SwLayoutFrame *pCol = static_cast<SwLayoutFrame*>(pLayFrame->Lower());
OSL_ENSURE( pCol, "Where's the columnframe?" );
SwFrame *pFrame = pCol->Lower();
@@ -3575,7 +3575,7 @@ static long lcl_CalcMinColDiff( SwLayoutFrame *pLayFrame )
pFrame = static_cast<SwBodyFrame*>(pFrame)->Lower();
if ( pFrame && pFrame->IsTextFrame() )
{
- const long nTmp = static_cast<SwTextFrame*>(pFrame)->FirstLineHeight();
+ const tools::Long nTmp = static_cast<SwTextFrame*>(pFrame)->FirstLineHeight();
if ( nTmp != USHRT_MAX )
{
if ( pCol == pLayFrame->Lower() )
@@ -3672,8 +3672,8 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
// is more or less the smallest first line height and doesn't seem ideal
// as minimum value.
- long nMinimum = nMinHeight;
- long nMaximum;
+ tools::Long nMinimum = nMinHeight;
+ tools::Long nMaximum;
bool bNoBalance = false;
SwRectFnSet aRectFnSet(this);
if( IsSctFrame() )
@@ -3697,7 +3697,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
if( bNoBalance ||
( !aRectFnSet.GetHeight(getFrameArea()) && pAny ) )
{
- long nTop = aRectFnSet.GetTopMargin(*this);
+ tools::Long nTop = aRectFnSet.GetTopMargin(*this);
// #i23129# - correction
// to the calculated maximum height.
{
@@ -3834,7 +3834,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
if ( nDiff || ::lcl_IsFlyHeightClipped( this ) ||
( IsSctFrame() && static_cast<SwSectionFrame*>(this)->CalcMinDiff( nMinDiff ) ) )
{
- long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
+ tools::Long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
// The minimum must not be smaller than our PrtHeight as
// long as something juts over.
if( nMinimum < nPrtHeight )
@@ -3847,7 +3847,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
nDiff = nMinDiff;
// If we should grow more than by nMinDiff we split it over
// the columns
- if ( std::abs(nDiff - nMinDiff) > nNumCols && nDiff > static_cast<long>(nNumCols) )
+ if ( std::abs(nDiff - nMinDiff) > nNumCols && nDiff > static_cast<tools::Long>(nNumCols) )
nDiff /= nNumCols;
if ( bMinDiff )
@@ -3856,7 +3856,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
// minimal FrameHeight and PrtHeight is smaller than
// nMindiff we grow in a way that PrtHeight is exactly
// nMinDiff afterwards.
- long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
if ( nFrameHeight > nMinHeight || nPrtHeight >= nMinDiff )
nDiff = std::max( nDiff, nMinDiff );
else if( nDiff < nMinDiff )
@@ -3870,7 +3870,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
}
else if( nMaximum > nMinimum ) // We fit, do we still have some margin?
{
- long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
+ tools::Long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
if ( nMaximum < nPrtHeight )
nDiff = nMaximum - nPrtHeight; // We grew over a working
// height and shrink back to it, but will this ever
@@ -3906,7 +3906,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
if( nDiff ) // now we shrink or grow...
{
Size aOldSz( getFramePrintArea().SSize() );
- long nTop = aRectFnSet.GetTopMargin(*this);
+ tools::Long nTop = aRectFnSet.GetTopMargin(*this);
nDiff = aRectFnSet.GetHeight(getFramePrintArea()) + nDiff + nBorder - aRectFnSet.GetHeight(getFrameArea());
{
diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index 19ad5ac611f6..5ec6e30609ea 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -122,8 +122,8 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
if ( !bFlyAtFly && GetAnchorFrame().IsPageFrame() &&
pSh && pSh->GetViewOptions()->getBrowseMode() )
{
- const long nAnchorBottom = GetAnchorFrame().getFrameArea().Bottom();
- const long nBottom = GetAnchorFrame().getFrameArea().Top() +
+ const tools::Long nAnchorBottom = GetAnchorFrame().getFrameArea().Bottom();
+ const tools::Long nBottom = GetAnchorFrame().getFrameArea().Top() +
aRelPos.Y() + aObjBoundRect.Height();
if ( nAnchorBottom < nBottom )
{
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 2f2a484c645b..c0e4cbf9bae2 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -68,7 +68,7 @@ class SwBoxSelection
{
public:
std::vector<SwSelBoxes> maBoxes;
- long mnMergeWidth;
+ tools::Long mnMergeWidth;
SwBoxSelection() : mnMergeWidth(0) {}
bool isEmpty() const { return maBoxes.empty(); }
void push_back(const SwSelBoxes& rNew) { maBoxes.push_back(rNew); }
@@ -124,7 +124,7 @@ if bSet is true, rMin and rMax will be set to the left and right border of the b
*/
-static void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, size_t nCheck, bool bSet )
+static void lcl_CheckMinMax( tools::Long& rMin, tools::Long& rMax, const SwTableLine& rLine, size_t nCheck, bool bSet )
{
++nCheck;
if( rLine.GetTabBoxes().size() < nCheck )
@@ -133,8 +133,8 @@ static void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, s
nCheck = rLine.GetTabBoxes().size();
}
- long nNew = 0; // will be the right border of the current box
- long nWidth = 0; // the width of the current box
+ tools::Long nNew = 0; // will be the right border of the current box
+ tools::Long nWidth = 0; // the width of the current box
for( size_t nCurrBox = 0; nCurrBox < nCheck; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
@@ -162,11 +162,11 @@ is the requested table box
*/
-static long lcl_Box2LeftBorder( const SwTableBox& rBox )
+static tools::Long lcl_Box2LeftBorder( const SwTableBox& rBox )
{
if( !rBox.GetUpper() )
return 0;
- long nLeft = 0;
+ tools::Long nLeft = 0;
const SwTableLine &rLine = *rBox.GetUpper();
const size_t nCount = rLine.GetTabBoxes().size();
for( size_t nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
@@ -197,11 +197,11 @@ the row (table line) to be scanned
*/
-static SwTableBox* lcl_LeftBorder2Box( long nLeft, const SwTableLine* pLine )
+static SwTableBox* lcl_LeftBorder2Box( tools::Long nLeft, const SwTableLine* pLine )
{
if( !pLine )
return nullptr;
- long nCurrLeft = 0;
+ tools::Long nCurrLeft = 0;
const size_t nCount = pLine->GetTabBoxes().size();
for( size_t nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
@@ -257,7 +257,7 @@ false is also needed for deleted rows
*/
-static void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
+static void lcl_ChangeRowSpan( const SwTable& rTable, const tools::Long nDiff,
sal_uInt16 nRowIdx, const bool bSingle )
{
if( !nDiff || nRowIdx >= rTable.GetTabLines().size() )
@@ -270,7 +270,7 @@ static void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
// because the row span ends before the critical area.
// When the inserted rows should not be overlapped by row spans which ends
// exactly in the row above, the trick is to start with a distance of 1.
- long nDistance = bSingle ? 1 : 0;
+ tools::Long nDistance = bSingle ? 1 : 0;
do
{
bGoOn = false; // will be set to true if we found a non-master cell
@@ -279,8 +279,8 @@ static void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
const size_t nBoxCount = pLine->GetTabBoxes().size();
for( size_t nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
- long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
- long nAbsSpan = nRowSpan > 0 ? nRowSpan : -nRowSpan;
+ tools::Long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
+ tools::Long nAbsSpan = nRowSpan > 0 ? nRowSpan : -nRowSpan;
// Check if the last overlapped cell is above or below
// the critical area
if( nAbsSpan > nDistance )
@@ -342,7 +342,7 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam
const size_t nLines = m_aLines.size();
size_t nTop = 0;
size_t nBottom = 0;
- long nMin = 0, nMax = 0;
+ tools::Long nMin = 0, nMax = 0;
int nFound = 0;
for( size_t nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
{
@@ -375,29 +375,29 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam
return nullptr;
bool bOkay = true;
- long nMid = ( nMin + nMax ) / 2;
+ tools::Long nMid = ( nMin + nMax ) / 2;
auto pRet(std::make_unique<SwBoxSelection>());
std::vector< std::pair< SwTableBox*, long > > aNewWidthVector;
size_t nCheckBottom = nBottom;
- long nLeftSpan = 0;
- long nRightSpan = 0;
- long nLeftSpanCnt = 0;
- long nRightSpanCnt = 0;
+ tools::Long nLeftSpan = 0;
+ tools::Long nRightSpan = 0;
+ tools::Long nLeftSpanCnt = 0;
+ tools::Long nRightSpanCnt = 0;
for( size_t nRow = nTop; nRow <= nBottom && bOkay && nRow < nLines; ++nRow )
{
SwTableLine* pLine = m_aLines[nRow];
OSL_ENSURE( pLine, "Missing table line" );
SwSelBoxes aBoxes;
- long nRight = 0;
+ tools::Long nRight = 0;
const size_t nCount = pLine->GetTabBoxes().size();
for( size_t nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
OSL_ENSURE( pBox, "Missing table box" );
- long nLeft = nRight;
+ tools::Long nLeft = nRight;
nRight += pBox->GetFrameFormat()->GetFrameSize().GetWidth();
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( nRight <= nMin )
{
if( nRight == nMin && nLeftSpanCnt )
@@ -407,8 +407,8 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam
SwTableBox* pInnerBox = nullptr;
SwTableBox* pLeftBox = nullptr;
SwTableBox* pRightBox = nullptr;
- long nDiff = 0;
- long nDiff2 = 0;
+ tools::Long nDiff = 0;
+ tools::Long nDiff2 = 0;
if( nLeft < nMin )
{
if( nRight >= nMid || nRight + nLeft >= nMin + nMin )
@@ -488,7 +488,7 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam
{
if( nRow == nBottom )
{
- long nTmpSpan = pInnerBox->getRowSpan();
+ tools::Long nTmpSpan = pInnerBox->getRowSpan();
if( nTmpSpan > 1 )
nBottom += nTmpSpan - 1;
else if( nTmpSpan < -1 )
@@ -499,7 +499,7 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam
{
if( pOuterBox )
{
- long nOutSpan = pOuterBox->getRowSpan();
+ tools::Long nOutSpan = pOuterBox->getRowSpan();
if( nOutSpan != 1 )
{
size_t nCheck = nRow;
@@ -575,7 +575,7 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam
for (auto const& newWidth : aNewWidthVector)
{
SwFrameFormat* pFormat = newWidth.first->ClaimFrameFormat();
- long nNewWidth = pFormat->GetFrameSize().GetWidth() + newWidth.second;
+ tools::Long nNewWidth = pFormat->GetFrameSize().GetWidth() + newWidth.second;
pFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nNewWidth, 0 ) );
}
}
@@ -608,16 +608,16 @@ static void lcl_InvalidateCellFrame( const SwTableBox& rBox )
when a selection of cells is given and returns the average cell widths
*/
-static long lcl_InsertPosition( SwTable &rTable, std::vector<sal_uInt16>& rInsPos,
+static tools::Long lcl_InsertPosition( SwTable &rTable, std::vector<sal_uInt16>& rInsPos,
const SwSelBoxes& rBoxes, bool bBehind )
{
sal_Int32 nAddWidth = 0;
- long nCount = 0;
+ tools::Long nCount = 0;
for (size_t j = 0; j < rBoxes.size(); ++j)
{
SwTableBox *pBox = rBoxes[j];
SwTableLine* pLine = pBox->GetUpper();
- long nWidth = rBoxes[j]->GetFrameFormat()->GetFrameSize().GetWidth();
+ tools::Long nWidth = rBoxes[j]->GetFrameFormat()->GetFrameSize().GetWidth();
nAddWidth += nWidth;
sal_uInt16 nCurrBox = pLine->GetBoxPos( pBox );
sal_uInt16 nCurrLine = rTable.GetTabLines().GetPos( pLine );
@@ -660,7 +660,7 @@ bool SwTable::NewInsertCol( SwDoc& rDoc, const SwSelBoxes& rBoxes,
return false;
CHECK_TABLE( *this )
- long nNewBoxWidth = 0;
+ tools::Long nNewBoxWidth = 0;
std::vector< sal_uInt16 > aInsPos( m_aLines.size(), USHRT_MAX );
{ // Calculation of the insert positions and the width of the new boxes
sal_uInt64 nTableWidth = 0;
@@ -681,11 +681,11 @@ bool SwTable::NewInsertCol( SwDoc& rDoc, const SwSelBoxes& rBoxes,
if( !nResultingWidth )
return false;
nAddWidth = (nAddWidth * nTableWidth) / nResultingWidth;
- nNewBoxWidth = long( nAddWidth / nCnt ); // Rounding
+ nNewBoxWidth = tools::Long( nAddWidth / nCnt ); // Rounding
nAddWidth = nNewBoxWidth * nCnt; // Rounding
if( !nAddWidth || nAddWidth >= nTableWidth )
return false;
- AdjustWidths( static_cast< long >(nTableWidth), static_cast< long >(nTableWidth - nAddWidth) );
+ AdjustWidths( static_cast< tools::Long >(nTableWidth), static_cast< tools::Long >(nTableWidth - nAddWidth) );
}
FndBox_ aFndBox( nullptr, nullptr );
@@ -695,7 +695,7 @@ bool SwTable::NewInsertCol( SwDoc& rDoc, const SwSelBoxes& rBoxes,
SwTableNode* pTableNd = GetTableNode();
std::vector<SwTableBoxFormat*> aInsFormat( nCnt, nullptr );
size_t nLastLine = SAL_MAX_SIZE;
- long nLastRowSpan = 1;
+ tools::Long nLastRowSpan = 1;
for( size_t i = 0; i < m_aLines.size(); ++i )
{
@@ -707,8 +707,8 @@ bool SwTable::NewInsertCol( SwDoc& rDoc, const SwSelBoxes& rBoxes,
++nInsPos;
SwTableBoxFormat* pBoxFrameFormat = static_cast<SwTableBoxFormat*>(pBox->GetFrameFormat());
::InsTableBox( rDoc, pTableNd, pLine, pBoxFrameFormat, pBox, nInsPos, nCnt );
- long nRowSpan = pBox->getRowSpan();
- long nDiff = i - nLastLine;
+ tools::Long nRowSpan = pBox->getRowSpan();
+ tools::Long nDiff = i - nLastLine;
bool bNewSpan = false;
if( nLastLine != SAL_MAX_SIZE && nDiff <= nLastRowSpan &&
nRowSpan != nDiff - nLastRowSpan )
@@ -773,7 +773,7 @@ bool SwTable::NewInsertCol( SwDoc& rDoc, const SwSelBoxes& rBoxes,
#if OSL_DEBUG_LEVEL > 0
{
const SwTableBoxes &rTabBoxes = m_aLines[0]->GetTabBoxes();
- long nNewWidth = 0;
+ tools::Long nNewWidth = 0;
for( size_t i = 0; i < rTabBoxes.size(); ++i )
nNewWidth += rTabBoxes[i]->GetFrameFormat()->GetFrameSize().GetWidth();
OSL_ENSURE( nNewWidth > 0, "Very small" );
@@ -846,7 +846,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
// The number of lines in the selection rectangle: nLineCount
const size_t nLineCount = pSel->maBoxes.size();
// BTW: nLineCount is the rowspan of the new master cell
- long nRowSpan = static_cast<long>(nLineCount);
+ tools::Long nRowSpan = static_cast<tools::Long>(nLineCount);
// We will need the first and last line of the selection
// to check if there any superfluous row after merging
SwTableLine* pFirstLn = nullptr;
@@ -1034,7 +1034,7 @@ SwTableBox& SwTableBox::FindStartOfRowSpan( const SwTable& rTable, sal_uInt16 nM
if( getRowSpan() > 0 || !nMaxStep )
return *this;
- long nLeftBorder = lcl_Box2LeftBorder( *this );
+ tools::Long nLeftBorder = lcl_Box2LeftBorder( *this );
SwTableBox* pBox = this;
const SwTableLine* pMyUpper = GetUpper();
sal_uInt16 nLine = rTable.GetTabLines().GetPos( pMyUpper );
@@ -1058,7 +1058,7 @@ SwTableBox& SwTableBox::FindStartOfRowSpan( const SwTable& rTable, sal_uInt16 nM
SwTableBox& SwTableBox::FindEndOfRowSpan( const SwTable& rTable, sal_uInt16 nMaxStep )
{
- long nAbsSpan = getRowSpan();
+ tools::Long nAbsSpan = getRowSpan();
if( nAbsSpan < 0 )
nAbsSpan = -nAbsSpan;
if( nAbsSpan == 1 || !nMaxStep )
@@ -1071,7 +1071,7 @@ SwTableBox& SwTableBox::FindEndOfRowSpan( const SwTable& rTable, sal_uInt16 nMax
nMaxStep = nLine + nMaxStep;
if( nMaxStep >= rTable.GetTabLines().size() )
nMaxStep = rTable.GetTabLines().size() - 1;
- long nLeftBorder = lcl_Box2LeftBorder( *this );
+ tools::Long nLeftBorder = lcl_Box2LeftBorder( *this );
SwTableBox* pBox =
lcl_LeftBorder2Box( nLeftBorder, rTable.GetTabLines()[ nMaxStep ] );
if ( !pBox )
@@ -1092,7 +1092,7 @@ static void lcl_getAllMergedBoxes( const SwTable& rTable, SwSelBoxes& rBoxes, Sw
return;
const SwTableLine* pMyUpper = pBox->GetUpper();
sal_uInt16 nLine = rTable.GetTabLines().GetPos( pMyUpper );
- long nLeftBorder = lcl_Box2LeftBorder( *pBox );
+ tools::Long nLeftBorder = lcl_Box2LeftBorder( *pBox );
sal_uInt16 nCount = rTable.GetTabLines().size();
while( ++nLine < nCount && pBox && pBox->getRowSpan() != -1 )
{
@@ -1181,7 +1181,7 @@ void SwTable::InsertSpannedRow( SwDoc& rDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt
if( SwFrameSize::Variable != aFSz.GetHeightSizeType() )
{
SwFrameFormat* pFrameFormat = rLine.ClaimFrameFormat();
- long nNewHeight = aFSz.GetHeight() / ( nCnt + 1 );
+ tools::Long nNewHeight = aFSz.GetHeight() / ( nCnt + 1 );
if( !nNewHeight )
++nNewHeight;
aFSz.SetHeight( nNewHeight );
@@ -1194,7 +1194,7 @@ void SwTable::InsertSpannedRow( SwDoc& rDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt
SwTableLine *pNewLine = GetTabLines()[ nRowIdx + nCnt - n ];
for( size_t nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
- long nRowSpan = rLine.GetTabBoxes()[nCurrBox]->getRowSpan();
+ tools::Long nRowSpan = rLine.GetTabBoxes()[nCurrBox]->getRowSpan();
if( nRowSpan > 0 )
nRowSpan = - nRowSpan;
pNewLine->GetTabBoxes()[ nCurrBox ]->setRowSpan( nRowSpan - n );
@@ -1386,7 +1386,7 @@ static sal_uInt16 lcl_LineIndex( const SwTable& rTable, const SwSelBoxes& rBoxes
{
if( nPos > nDirect || nDirect == USHRT_MAX )
nDirect = nPos;
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan < 2 )
nSpan = 0;
else if( nSpan )
@@ -1517,7 +1517,7 @@ bool SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableLine *pNewLine = GetTabLines()[ nRowIdx+nCnt-n-nOfs];
for( size_t nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
- long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
+ tools::Long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
if( bBehind )
{
if( nRowSpan == 1 || nRowSpan == -1 )
@@ -1576,10 +1576,10 @@ void SwTable::PrepareDelBoxes( const SwSelBoxes& rBoxes )
for (size_t i = 0; i < rBoxes.size(); ++i)
{
SwTableBox* pBox = rBoxes[i];
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan != 1 && pBox->GetFrameFormat()->GetFrameSize().GetWidth() )
{
- long nLeft = lcl_Box2LeftBorder( *pBox );
+ tools::Long nLeft = lcl_Box2LeftBorder( *pBox );
SwTableLine *pLine = pBox->GetUpper();
sal_uInt16 nLinePos = GetTabLines().GetPos( pLine);
OSL_ENSURE( nLinePos < USHRT_MAX, "Box/table mismatch" );
@@ -1626,18 +1626,18 @@ void SwTable::PrepareDelBoxes( const SwSelBoxes& rBoxes )
if it overlaps with the given x-position range
*/
-static void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, long nMax,
+static void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, tools::Long nMin, tools::Long nMax,
SwTableLine& rLine, bool bChkProtected, bool bColumn )
{
- long nLeft = 0;
- long nRight = 0;
- long nMid = ( nMax + nMin )/ 2;
+ tools::Long nLeft = 0;
+ tools::Long nRight = 0;
+ tools::Long nMid = ( nMax + nMin )/ 2;
const size_t nCount = rLine.GetTabBoxes().size();
for( size_t nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
OSL_ENSURE( pBox, "Missing table box" );
- long nWidth = pBox->GetFrameFormat()->GetFrameSize().GetWidth();
+ tools::Long nWidth = pBox->GetFrameFormat()->GetFrameSize().GetWidth();
nRight += nWidth;
if( nRight > nMin )
{
@@ -1647,7 +1647,7 @@ static void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nM
nRight - nMin > nMin - nLeft;
else
bAdd = nLeft <= nMid || nRight - nMax < nMax - nLeft;
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( bAdd &&
( !bChkProtected ||
!pBox->GetFrameFormat()->GetProtect().IsContentProtected() ) )
@@ -1701,8 +1701,8 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
// nUpperMin becomes the left border value of the upper box
// nUpperMax becomes the right border of the upper box
// nLowerMin and nLowerMax the borders of the lower box
- long nUpperMin = 0, nUpperMax = 0;
- long nLowerMin = 0, nLowerMax = 0;
+ tools::Long nUpperMin = 0, nUpperMax = 0;
+ tools::Long nLowerMin = 0, nLowerMax = 0;
// nFound will incremented if a box is found
// 0 => no box found; 1 => the upper box has been found; 2 => both found
int nFound = 0;
@@ -1770,8 +1770,8 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
bool bCombine = nTop == nBottom;
if( !bCombine )
{
- long nMinWidth = nUpperMax - nUpperMin;
- long nTmp = nLowerMax - nLowerMin;
+ tools::Long nMinWidth = nUpperMax - nUpperMin;
+ tools::Long nTmp = nLowerMax - nLowerMin;
if( nMinWidth > nTmp )
nMinWidth = nTmp;
nTmp = std::min(nLowerMax, nUpperMax);
@@ -1801,8 +1801,8 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
}
{
- long nMin = std::min(nUpperMin, nLowerMin);
- long nMax = nUpperMax < nLowerMax ? nLowerMax : nUpperMax;
+ tools::Long nMin = std::min(nUpperMin, nLowerMin);
+ tools::Long nMax = nUpperMax < nLowerMax ? nLowerMax : nUpperMax;
for( size_t i = nTop; i <= nBottom; ++i )
lcl_SearchSelBox( *this, rBoxes, nMin, nMax, *m_aLines[i],
bChkProtected, bColumn );
@@ -1819,7 +1819,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
assure that at least one cell of every row is part of the selection.
*/
-void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax ) const
+void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, tools::Long &rMin, tools::Long &rMax ) const
{
OSL_ENSURE( m_bNewModel, "Don't call me for old tables" );
rMin = 0;
@@ -1851,10 +1851,10 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
{
SwTableLine* pLine = m_aLines[nRow];
const size_t nCols = pLine->GetTabBoxes().size();
- long nRight = 0;
+ tools::Long nRight = 0;
for( size_t nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
{
- long nLeft = nRight;
+ tools::Long nLeft = nRight;
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
nRight += pBox->GetFrameFormat()->GetFrameSize().GetWidth();
if( nLeft >= rMin && nRight <= rMax )
@@ -1866,12 +1866,12 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
/** SwTable::PrepareDeleteCol(..) adjusts the widths of the neighbour cells of
a cell selection for an upcoming (column) deletion
*/
-void SwTable::PrepareDeleteCol( long nMin, long nMax )
+void SwTable::PrepareDeleteCol( tools::Long nMin, tools::Long nMax )
{
OSL_ENSURE( m_bNewModel, "Don't call me for old tables" );
if( m_aLines.empty() || nMax < nMin )
return;
- long nMid = nMin ? ( nMin + nMax ) / 2 : 0;
+ tools::Long nMid = nMin ? ( nMin + nMax ) / 2 : 0;
const SwTwips nTabSize = GetFrameFormat()->GetFrameSize().GetWidth();
if( nTabSize == nMax )
nMid = nMax;
@@ -1880,17 +1880,17 @@ void SwTable::PrepareDeleteCol( long nMin, long nMax )
{
SwTableLine* pLine = m_aLines[nRow];
const size_t nCols = pLine->GetTabBoxes().size();
- long nRight = 0;
+ tools::Long nRight = 0;
for( size_t nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
{
- long nLeft = nRight;
+ tools::Long nLeft = nRight;
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
nRight += pBox->GetFrameFormat()->GetFrameSize().GetWidth();
if( nRight < nMin )
continue;
if( nLeft > nMax )
break;
- long nNewWidth = -1;
+ tools::Long nNewWidth = -1;
if( nLeft < nMin )
{
if( nRight <= nMax )
@@ -1920,7 +1920,7 @@ void SwTable::ExpandSelection( SwSelBoxes& rBoxes ) const
for (size_t i = 0; i < rBoxes.size(); ++i)
{
SwTableBox *pBox = rBoxes[i];
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan != 1 )
{
SwTableBox *pMasterBox = nRowSpan > 0 ? pBox
@@ -2007,7 +2007,7 @@ SwSaveRowSpan::SwSaveRowSpan( SwTableBoxes& rBoxes, sal_uInt16 nSplitLn )
{
SwTableBox* pBox = rBoxes[nCurrCol];
OSL_ENSURE( pBox, "Missing Table Box" );
- long nRowSp = pBox->getRowSpan();
+ tools::Long nRowSp = pBox->getRowSpan();
mnRowSpans[ nCurrCol ] = nRowSp;
if( nRowSp < 0 )
{
@@ -2042,7 +2042,7 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
OSL_ENSURE( pBox, "Missing Table Box" );
- long nRowSp = pBox->getRowSpan();
+ tools::Long nRowSp = pBox->getRowSpan();
if( nRowSp != rSave.mnRowSpans[ nCurrCol ] )
{
OSL_ENSURE( -nRowSp == rSave.mnRowSpans[ nCurrCol ], "Pardon me?!" );
@@ -2052,7 +2052,7 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
sal_uInt16 nLine = rSave.mnSplitLine;
if( nLine )
{
- long nLeftBorder = lcl_Box2LeftBorder( *pBox );
+ tools::Long nLeftBorder = lcl_Box2LeftBorder( *pBox );
SwTableBox* pNext;
do
{
@@ -2060,7 +2060,7 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
if( pNext )
{
pBox = pNext;
- long nNewSpan = pBox->getRowSpan();
+ tools::Long nNewSpan = pBox->getRowSpan();
if( pBox->getRowSpan() < 1 )
nNewSpan -= nRowSp;
else
@@ -2098,12 +2098,12 @@ void SwTable::CleanUpBottomRowSpan( sal_uInt16 nDelLines )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
OSL_ENSURE( pBox, "Missing Table Box" );
- long nRowSp = pBox->getRowSpan();
+ tools::Long nRowSp = pBox->getRowSpan();
if( nRowSp < 0 )
nRowSp = -nRowSp;
if( nRowSp > 1 )
{
- lcl_ChangeRowSpan( *this, -static_cast<long>(nDelLines),
+ lcl_ChangeRowSpan( *this, -static_cast<tools::Long>(nDelLines),
static_cast<sal_uInt16>(nLastLine), false );
break;
}
@@ -2136,7 +2136,7 @@ void SwTable::ConvertSubtableBox(sal_uInt16 const nRow, sal_uInt16 const nBox)
assert(!pSubTableBox->GetTabLines().empty());
// are relative (%) heights possible? apparently not
SwFormatFrameSize const outerSize(pSourceLine->GetFrameFormat()->GetFrameSize());
- long minHeights(0);
+ tools::Long minHeights(0);
{
SwFormatFrameSize const* pSize(nullptr);
SwFrameFormat const& rSubLineFormat(*pSubTableBox->GetTabLines()[0]->GetFrameFormat());
@@ -2246,8 +2246,8 @@ void SwTable::ConvertSubtableBox(sal_uInt16 const nRow, sal_uInt16 const nBox)
// -2 -> -(N+1) ; -N .. -2
// 1 -> N ; -(N-1) .. -1
// 2 -> N+1 ; -N .. -2
- long newSourceRowSpan(pSourceBox->getRowSpan());
- long newBoxRowSpan;
+ tools::Long newSourceRowSpan(pSourceBox->getRowSpan());
+ tools::Long newBoxRowSpan;
if (newSourceRowSpan < 0)
{
newSourceRowSpan -= pSubTableBox->GetTabLines().size() - 1;
@@ -2397,7 +2397,7 @@ namespace {
struct RowSpanCheck
{
- long nRowSpan;
+ tools::Long nRowSpan;
SwTwips nLeft;
SwTwips nRight;
};
@@ -2431,7 +2431,7 @@ void SwTable::CheckConsistency() const
index = *index.GetNode().EndOfSectionNode();
++index;
SwTwips nNewWidth = pBox->GetFrameFormat()->GetFrameSize().GetWidth() + nWidth;
- long nRowSp = pBox->getRowSpan();
+ tools::Long nRowSp = pBox->getRowSpan();
if( nRowSp < 0 )
{
SAL_WARN_IF( aIter == aRowSpanCells.end(),
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 043f1bb0bc74..003dd062aaaf 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -97,12 +97,12 @@ inline void SwTableBox::SetSaveNumFormatColor( const Color* p )
mpNumFormatColor.reset();
}
-long SwTableBox::getRowSpan() const
+tools::Long SwTableBox::getRowSpan() const
{
return mnRowSpan;
}
-void SwTableBox::setRowSpan( long nNewRowSpan )
+void SwTableBox::setRowSpan( tools::Long nNewRowSpan )
{
mnRowSpan = nNewRowSpan;
}
@@ -188,7 +188,7 @@ void InsTableBox( SwDoc& rDoc, SwTableNode* pTableNd,
rDoc.GetDfltTextFormatColl(), nullptr,
nInsPos, nCnt );
- long nRowSpan = pBox->getRowSpan();
+ tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan != 1 )
{
SwTableBoxes& rTableBoxes = pLine->GetTabBoxes();
@@ -276,11 +276,11 @@ static void FormatInArr( std::vector<SwFormat*>& rFormatArr, SwFormat* pBoxForma
rFormatArr.push_back( pBoxFormat );
}
-static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
- const long nNew, std::vector<SwFormat*>& rFormatArr );
+static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const tools::Long nOld,
+ const tools::Long nNew, std::vector<SwFormat*>& rFormatArr );
-static void lcl_ModifyLines( SwTableLines &rLines, const long nOld,
- const long nNew, std::vector<SwFormat*>& rFormatArr, const bool bCheckSum )
+static void lcl_ModifyLines( SwTableLines &rLines, const tools::Long nOld,
+ const tools::Long nNew, std::vector<SwFormat*>& rFormatArr, const bool bCheckSum )
{
for ( size_t i = 0; i < rLines.size(); ++i )
::lcl_ModifyBoxes( rLines[i]->GetTabBoxes(), nOld, nNew, rFormatArr );
@@ -297,8 +297,8 @@ static void lcl_ModifyLines( SwTableLines &rLines, const long nOld,
}
}
-static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
- const long nNew, std::vector<SwFormat*>& rFormatArr )
+static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const tools::Long nOld,
+ const tools::Long nNew, std::vector<SwFormat*>& rFormatArr )
{
sal_uInt64 nSum = 0; // To avoid rounding errors we summarize all box widths
sal_uInt64 nOriginalSum = 0; // Sum of original widths
@@ -373,7 +373,7 @@ void SwTable::SwClientNotify(const SwModify&, const SfxHint& rHint)
AdjustWidths(pOldSize->GetWidth(), pNewSize->GetWidth());
}
-void SwTable::AdjustWidths( const long nOld, const long nNew )
+void SwTable::AdjustWidths( const tools::Long nOld, const tools::Long nNew )
{
std::vector<SwFormat*> aFormatArr;
aFormatArr.reserve( m_aLines[0]->GetTabBoxes().size() );
@@ -384,7 +384,7 @@ static void lcl_RefreshHidden( SwTabCols &rToFill, size_t nPos )
{
for ( size_t i = 0; i < rToFill.Count(); ++i )
{
- if ( std::abs(static_cast<long>(nPos) - rToFill[i]) <= COLFUZZY )
+ if ( std::abs(static_cast<tools::Long>(nPos) - rToFill[i]) <= COLFUZZY )
{
rToFill.SetHidden( i, false );
break;
@@ -396,20 +396,20 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const SwFrameFormat *pTabFormat, const bool bHidden,
const bool bRefreshHidden )
{
- const long nWish = pTabFormat->GetFrameSize().GetWidth();
+ const tools::Long nWish = pTabFormat->GetFrameSize().GetWidth();
OSL_ENSURE(nWish, "weird <= 0 width frmfrm");
// The value for the left edge of the box is calculated from the
// widths of the previous boxes.
- long nPos = 0;
- long nLeftMin = 0;
- long nRightMax = 0;
+ tools::Long nPos = 0;
+ tools::Long nLeftMin = 0;
+ tools::Long nRightMax = 0;
if (nWish != 0) //fdo#33012 0 width frmfmt
{
SwTwips nSum = 0;
const SwTableBox *pCur = pBox;
const SwTableLine *pLine = pBox->GetUpper();
- const long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why?
+ const tools::Long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why?
while ( pLine )
{
@@ -418,7 +418,7 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
{
const SwTwips nWidth = rBoxes[i]->GetFrameFormat()->GetFrameSize().GetWidth();
nSum += nWidth;
- const long nTmp = lcl_MulDiv64<long>(nSum, nAct, nWish);
+ const tools::Long nTmp = lcl_MulDiv64<long>(nSum, nAct, nWish);
if (rBoxes[i] != pCur)
{
@@ -442,7 +442,7 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
bool bInsert = !bRefreshHidden;
for ( size_t j = 0; bInsert && (j < rToFill.Count()); ++j )
{
- long nCmp = rToFill[j];
+ tools::Long nCmp = rToFill[j];
if ( (nPos >= ((nCmp >= COLFUZZY) ? nCmp - COLFUZZY : nCmp)) &&
(nPos <= (nCmp + COLFUZZY)) )
{
@@ -472,17 +472,17 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
for ( size_t j = 0; !(bFoundPos && bFoundMax ) && j < rToFill.Count(); ++j )
{
SwTabColsEntry& rEntry = rToFill.GetEntry( j );
- long nCmp = rToFill[j];
+ tools::Long nCmp = rToFill[j];
if ( (nPos >= ((nCmp >= COLFUZZY) ? nCmp - COLFUZZY : nCmp)) &&
(nPos <= (nCmp + COLFUZZY)) )
{
// check if nLeftMin is > old minimum for entry nPos:
- const long nOldMin = rEntry.nMin;
+ const tools::Long nOldMin = rEntry.nMin;
if ( nLeftMin > nOldMin )
rEntry.nMin = nLeftMin;
// check if nRightMin is < old maximum for entry nPos:
- const long nOldMax = rEntry.nMax;
+ const tools::Long nOldMax = rEntry.nMax;
if ( nRightMax < nOldMax )
rEntry.nMax = nRightMax;
@@ -492,7 +492,7 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
(nRightMax <= (nCmp + COLFUZZY)) )
{
// check if nPos is > old minimum for entry nRightMax:
- const long nOldMin = rEntry.nMin;
+ const tools::Long nOldMin = rEntry.nMin;
if ( nPos > nOldMin )
rEntry.nMin = nPos;
@@ -620,7 +620,7 @@ struct Parm
{
const SwTabCols &rNew;
const SwTabCols &rOld;
- long nNewWish,
+ tools::Long nNewWish,
nOldWish;
std::deque<SwTableBox*> aBoxArr;
SwShareBoxFormats aShareFormats;
@@ -660,12 +660,12 @@ static void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
// the new TabCols. If the adjusted edge has no neighbour we also
// adjust all superior boxes.
- const long nOldAct = rParm.rOld.GetRight() -
+ const tools::Long nOldAct = rParm.rOld.GetRight() -
rParm.rOld.GetLeft(); // +1 why?
// The value for the left edge of the box is calculated from the
// widths of the previous boxes plus the left edge.
- long nLeft = rParm.rOld.GetLeft();
+ tools::Long nLeft = rParm.rOld.GetLeft();
const SwTableBox *pCur = pBox;
const SwTableLine *pLine = pBox->GetUpper();
@@ -681,15 +681,15 @@ static void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
pCur = pLine->GetUpper();
pLine = pCur ? pCur->GetUpper() : nullptr;
}
- long nLeftDiff = 0;
- long nRightDiff = 0;
+ tools::Long nLeftDiff = 0;
+ tools::Long nRightDiff = 0;
if ( nLeft != rParm.rOld.GetLeft() ) // There are still boxes before this.
{
// Right edge is left edge plus width.
- const long nWidth = lcl_MulDiv64<long>(
+ const tools::Long nWidth = lcl_MulDiv64<long>(
pBox->GetFrameFormat()->GetFrameSize().GetWidth(),
nOldAct, rParm.nOldWish);
- const long nRight = nLeft + nWidth;
+ const tools::Long nRight = nLeft + nWidth;
size_t nLeftPos = 0;
size_t nRightPos = 0;
bool bFoundLeftPos = false;
@@ -720,10 +720,10 @@ static void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
if ( rParm.rOld.Count() )
{
// Calculate the difference to the edge touching the first box.
- const long nWidth = lcl_MulDiv64<long>(
+ const tools::Long nWidth = lcl_MulDiv64<long>(
pBox->GetFrameFormat()->GetFrameSize().GetWidth(),
nOldAct, rParm.nOldWish);
- const long nTmp = nWidth + rParm.rOld.GetLeft();
+ const tools::Long nTmp = nWidth + rParm.rOld.GetLeft();
for ( size_t i = 0; i < rParm.rOld.Count(); ++i )
{
if ( nTmp >= (rParm.rOld[i] - COLFUZZY) &&
@@ -755,12 +755,12 @@ static void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
// tables, it does not make sense to adjust the attributes of the
// boxes by this amount. The difference amount needs to be converted
// accordingly.
- long nTmp = rParm.rNew.GetRight() - rParm.rNew.GetLeft(); // +1 why?
+ tools::Long nTmp = rParm.rNew.GetRight() - rParm.rNew.GetLeft(); // +1 why?
nLeftDiff *= rParm.nNewWish;
nLeftDiff /= nTmp;
nRightDiff *= rParm.nNewWish;
nRightDiff /= nTmp;
- long nDiff = nLeftDiff + nRightDiff;
+ tools::Long nDiff = nLeftDiff + nRightDiff;
// Adjust the box and all superiors by the difference amount.
while ( pBox )
@@ -813,9 +813,9 @@ static void lcl_ProcessBoxPtr( SwTableBox *pBox, std::deque<SwTableBox*> &rBoxAr
rBoxArr.push_back( pBox );
}
-static void lcl_AdjustBox( SwTableBox *pBox, const long nDiff, Parm &rParm );
+static void lcl_AdjustBox( SwTableBox *pBox, const tools::Long nDiff, Parm &rParm );
-static void lcl_AdjustLines( SwTableLines &rLines, const long nDiff, Parm &rParm )
+static void lcl_AdjustLines( SwTableLines &rLines, const tools::Long nDiff, Parm &rParm )
{
for ( size_t i = 0; i < rLines.size(); ++i )
{
@@ -825,7 +825,7 @@ static void lcl_AdjustLines( SwTableLines &rLines, const long nDiff, Parm &rParm
}
}
-static void lcl_AdjustBox( SwTableBox *pBox, const long nDiff, Parm &rParm )
+static void lcl_AdjustBox( SwTableBox *pBox, const tools::Long nDiff, Parm &rParm )
{
if ( !pBox->GetTabLines().empty() )
::lcl_AdjustLines( pBox->GetTabLines(), nDiff, rParm );
@@ -892,8 +892,8 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
}
pFormat->SetFormatAttr( aOri );
}
- const long nAct = rOld.GetRight() - rOld.GetLeft(); // +1 why?
- long nTabDiff = 0;
+ const tools::Long nAct = rOld.GetRight() - rOld.GetLeft(); // +1 why?
+ tools::Long nTabDiff = 0;
if ( rOld.GetLeft() != rNew.GetLeft() )
{
@@ -903,7 +903,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
}
if ( rOld.GetRight() != rNew.GetRight() )
{
- long nDiff = rNew.GetRight() - rOld.GetRight();
+ tools::Long nDiff = rNew.GetRight() - rOld.GetRight();
nDiff *= aParm.nOldWish;
nDiff /= nAct;
nTabDiff += nDiff;
@@ -1048,7 +1048,7 @@ static void lcl_AdjustWidthsInLine( SwTableLine* pLine, ChangeList& rOldNew,
}
static void lcl_CalcNewWidths( std::vector<sal_uInt16> &rSpanPos, ChangeList& rChanges,
- SwTableLine* pLine, long nWish, long nWidth, bool bTop )
+ SwTableLine* pLine, tools::Long nWish, tools::Long nWidth, bool bTop )
{
if( rChanges.empty() )
{
@@ -1074,7 +1074,7 @@ static void lcl_CalcNewWidths( std::vector<sal_uInt16> &rSpanPos, ChangeList& rC
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
SwTwips nCurrWidth = pBox->GetFrameFormat()->GetFrameSize().GetWidth();
- const long nRowSpan = pBox->getRowSpan();
+ const tools::Long nRowSpan = pBox->getRowSpan();
const bool bCurrRowSpan = bTop ? nRowSpan < 0 :
( nRowSpan > 1 || nRowSpan < -1 );
if( bRowSpan || bCurrRowSpan )
@@ -1180,14 +1180,14 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
#endif
// First step: evaluate which lines have been moved/which widths changed
ChangeList aOldNew;
- const long nNewWidth = rParm.rNew.GetRight() - rParm.rNew.GetLeft();
- const long nOldWidth = rParm.rOld.GetRight() - rParm.rOld.GetLeft();
+ const tools::Long nNewWidth = rParm.rNew.GetRight() - rParm.rNew.GetLeft();
+ const tools::Long nOldWidth = rParm.rOld.GetRight() - rParm.rOld.GetLeft();
if( nNewWidth < 1 || nOldWidth < 1 )
return;
for( size_t i = 0; i <= rOld.Count(); ++i )
{
- long nNewPos;
- long nOldPos;
+ tools::Long nNewPos;
+ tools::Long nOldPos;
if( i == rOld.Count() )
{
nOldPos = rParm.rOld.GetRight() - rParm.rOld.GetLeft();
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 243bc39544f5..6e8f19a98e72 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -703,8 +703,8 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
const TableColumnsMapEntry& rCols = SwEnhancedPDFExportHelper::GetTableColumnsMap()[ pTable ];
- const long nLeft = fnRectX.GetLeft(pThisCell->getFrameArea());
- const long nRight = fnRectX.GetRight(pThisCell->getFrameArea());
+ const tools::Long nLeft = fnRectX.GetLeft(pThisCell->getFrameArea());
+ const tools::Long nRight = fnRectX.GetRight(pThisCell->getFrameArea());
const TableColumnsMapEntry::const_iterator aLeftIter = rCols.find( nLeft );
const TableColumnsMapEntry::const_iterator aRightIter = rCols.find( nRight );
@@ -1191,12 +1191,12 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
{
const SwFrame* pCellFrame = pRowFrame->GetLower();
- const long nLeft = aRectFnSet.GetLeft(pCellFrame->getFrameArea());
+ const tools::Long nLeft = aRectFnSet.GetLeft(pCellFrame->getFrameArea());
rCols.insert( nLeft );
while ( pCellFrame )
{
- const long nRight = aRectFnSet.GetRight(pCellFrame->getFrameArea());
+ const tools::Long nRight = aRectFnSet.GetRight(pCellFrame->getFrameArea());
rCols.insert( nRight );
pCellFrame = pCellFrame->GetNext();
}
@@ -1521,9 +1521,9 @@ tools::Rectangle SwEnhancedPDFExportHelper::SwRectToPDFRect(const SwPageFrame* p
double fScale = 0.75;
aRectSize.setWidth( aRectSize.Width() * fScale );
aRectSize.setHeight( aRectSize.Height() * fScale );
- long nOrigHeight = pCurrPage->getFrameArea().Height();
- long nNewHeight = nOrigHeight*fScale;
- long nShiftY = (nOrigHeight-nNewHeight)/2;
+ tools::Long nOrigHeight = pCurrPage->getFrameArea().Height();
+ tools::Long nNewHeight = nOrigHeight*fScale;
+ tools::Long nShiftY = (nOrigHeight-nNewHeight)/2;
aRect.SetLeft( aRect.Left() * fScale );
aRect.SetTop( aRect.Top() * fScale );
aRect.Move(0, nShiftY);
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 6a823760a189..48ba68d3a81f 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -534,11 +534,11 @@ struct SwFillData
nLineWidth( 0 ), bFirstLine( true ), bInner( false ), bColumn( false ),
bEmpty( true ){}
SwFillMode Mode() const { return pCMS->m_pFill->eMode; }
- long X() const { return rPoint.X(); }
- long Y() const { return rPoint.Y(); }
- long Left() const { return aFrame.Left(); }
- long Right() const { return aFrame.Right(); }
- long Bottom() const { return aFrame.Bottom(); }
+ tools::Long X() const { return rPoint.X(); }
+ tools::Long Y() const { return rPoint.Y(); }
+ tools::Long Left() const { return aFrame.Left(); }
+ tools::Long Right() const { return aFrame.Right(); }
+ tools::Long Bottom() const { return aFrame.Bottom(); }
SwFillCursorPos &Fill() const { return *pCMS->m_pFill; }
void SetTab( sal_uInt16 nNew ) { pCMS->m_pFill->nTabCnt = nNew; }
void SetSpace( sal_uInt16 nNew ) { pCMS->m_pFill->nSpaceCnt = nNew; }
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1a18447cd6f7..731ecdc324bf 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -320,7 +320,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
OSL_ENSURE( pOldUp == GetUpper(), "SwTextFrame::CalcFollow: heavy follow" );
#endif
- const long nRemaining =
+ const tools::Long nRemaining =
- aRectFnSet.BottomDist( GetUpper()->getFrameArea(), nOldBottom );
if ( nRemaining > 0 && !GetUpper()->IsSctFrame() &&
nRemaining != ( aRectFnSet.IsVert() ?
@@ -469,7 +469,7 @@ void SwTextFrame::AdjustFrame( const SwTwips nChgHght, bool bHasToFit )
( GetUpper()->Lower() == this ||
GetUpper()->Lower()->isFrameAreaDefinitionValid() ) )
{
- long nAdd = aRectFnSet.YDiff( aRectFnSet.GetTop(GetUpper()->Lower()->getFrameArea()),
+ tools::Long nAdd = aRectFnSet.YDiff( aRectFnSet.GetTop(GetUpper()->Lower()->getFrameArea()),
aRectFnSet.GetPrtTop(*GetUpper()) );
OSL_ENSURE( nAdd >= 0, "Ey" );
nRstHeight += nAdd;
@@ -1043,7 +1043,7 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine,
const SwFrame *pBodyFrame = FindBodyFrame();
- const long nBodyHeight = pBodyFrame ? ( IsVertical() ?
+ const tools::Long nBodyHeight = pBodyFrame ? ( IsVertical() ?
pBodyFrame->getFrameArea().Width() :
pBodyFrame->getFrameArea().Height() ) : 0;
@@ -1199,7 +1199,7 @@ bool SwTextFrame::FormatLine( SwTextFormatter &rLine, const bool bPrev )
bOldHyph == pNew->IsEndHyph();
if ( bUnChg && !bPrev )
{
- const long nWidthDiff = nOldWidth > pNew->Width()
+ const tools::Long nWidthDiff = nOldWidth > pNew->Width()
? nOldWidth - pNew->Width()
: pNew->Width() - nOldWidth;
@@ -1758,7 +1758,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr
// If MustFit is set, we shrink to the Upper's bottom edge if needed.
// Else we just take a standard size of 12 Pt. (240 twip).
SwTextLineAccess aAccess( this );
- long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
+ tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
if( aAccess.GetPara()->IsPrepMustFit() )
{
@@ -1777,7 +1777,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr
}
nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
- const long nTop = aRectFnSet.GetTopMargin(*this);
+ const tools::Long nTop = aRectFnSet.GetTopMargin(*this);
if( nTop > nFrameHeight )
{
@@ -1809,7 +1809,7 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr
// Attention: Format() could be triggered by GetFormatted()
if( IsHiddenNow() )
{
- long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
+ tools::Long nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
if( nPrtHeight )
{
HideHidden();
diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx
index 4879cd1159be..92b287d7bd16 100644
--- a/sw/source/core/text/frminf.cxx
+++ b/sw/source/core/text/frminf.cxx
@@ -79,7 +79,7 @@ bool SwTextFrameInfo::IsFilled( const sal_uInt8 nPercent ) const
if( !pLay )
return false;
- long nWidth = m_pFrame->getFramePrintArea().Width();
+ tools::Long nWidth = m_pFrame->getFramePrintArea().Width();
nWidth *= nPercent;
nWidth /= 100;
return o3tl::make_unsigned(nWidth) <= pLay->Width();
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 77be33698d44..2a24b76dd1a5 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -87,8 +87,8 @@ public:
return !(m_nLineNr % m_rLineInf.GetDividerCountBy());
}
- void PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed, const OUString* pRedlineText = nullptr );
- void PaintRedline( SwTwips nY, long nMax );
+ void PaintExtra( SwTwips nY, tools::Long nAsc, tools::Long nMax, bool bRed, const OUString* pRedlineText = nullptr );
+ void PaintRedline( SwTwips nY, tools::Long nMax );
};
}
@@ -183,7 +183,7 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
pTmpFrame->getFrameArea().Right() + REDLINE_DISTANCE;
}
-void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed, const OUString* pRedlineText )
+void SwExtraPainter::PaintExtra( SwTwips nY, tools::Long nAsc, tools::Long nMax, bool bRed, const OUString* pRedlineText )
{
const OUString aTmp( pRedlineText
// Tracked change is stronger than the line number
@@ -263,13 +263,13 @@ void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed, co
delete pTmpFnt;
if( bRed )
{
- long nDiff = m_bGoLeft ? m_nRedX - m_nX : m_nX - m_nRedX;
+ tools::Long nDiff = m_bGoLeft ? m_nRedX - m_nX : m_nX - m_nRedX;
if( nDiff > REDLINE_MINDIST )
PaintRedline( nY, nMax );
}
}
-void SwExtraPainter::PaintRedline( SwTwips nY, long nMax )
+void SwExtraPainter::PaintRedline( SwTwips nY, tools::Long nMax )
{
Point aStart( m_nRedX, nY );
Point aEnd( m_nRedX, nY + nMax );
@@ -364,7 +364,7 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const
}
}
- long nBottom = rRect.Bottom();
+ tools::Long nBottom = rRect.Bottom();
bool bNoPrtLine = 0 == GetMinPrtLine();
if( !bNoPrtLine )
@@ -455,7 +455,7 @@ SwRect SwTextFrame::GetPaintSwRect()
// We return the right paint rect. Use the calculated PaintOfst as the
// left margin
SwRepaint& rRepaint = GetPara()->GetRepaint();
- long l;
+ tools::Long l;
if ( IsVertLR() && !IsVertLRBT()) // mba: the following line was added, but we don't need it for the existing directions; kept for IsVertLR(), but should be checked
rRepaint.Chg( GetUpper()->getFrameArea().Pos() + GetUpper()->getFramePrintArea().Pos(), GetUpper()->getFramePrintArea().SSize() );
@@ -713,7 +713,7 @@ void SwTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const&
// adapt rRect (Top + 1, Bottom - 1)
// Because the Iterator attaches the Lines without a gap to each other
aLine.TwipsToLine( rRect.Top() + 1 );
- long nBottom = rRect.Bottom();
+ tools::Long nBottom = rRect.Bottom();
bool bNoPrtLine = 0 == GetMinPrtLine();
if( !bNoPrtLine )
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 9d3ce8eb2ed4..f3ebd605d918 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -430,7 +430,7 @@ void SwTextSizeInfo::GetTextSize( const SwScriptInfo* pSI, const TextFrameIndex
nMinSize = aSize.Width();
}
-TextFrameIndex SwTextSizeInfo::GetTextBreak( const long nLineWidth,
+TextFrameIndex SwTextSizeInfo::GetTextBreak( const tools::Long nLineWidth,
const TextFrameIndex nMaxLen,
const sal_uInt16 nComp,
vcl::TextLayoutCache const*const pCache) const
@@ -450,7 +450,7 @@ TextFrameIndex SwTextSizeInfo::GetTextBreak( const long nLineWidth,
return m_pFnt->GetTextBreak( aDrawInf, nLineWidth );
}
-TextFrameIndex SwTextSizeInfo::GetTextBreak( const long nLineWidth,
+TextFrameIndex SwTextSizeInfo::GetTextBreak( const tools::Long nLineWidth,
const TextFrameIndex nMaxLen,
const sal_uInt16 nComp,
TextFrameIndex& rExtraCharPos,
@@ -652,7 +652,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo
aDrawInf.SetUnderFnt( m_pUnderFnt );
- const long nSpaceAdd = ( rPor.IsBlankPortion() || rPor.IsDropPortion() ||
+ const tools::Long nSpaceAdd = ( rPor.IsBlankPortion() || rPor.IsDropPortion() ||
rPor.InNumberGrp() ) ? 0 : GetSpaceAdd();
if ( nSpaceAdd )
{
@@ -768,7 +768,7 @@ void SwTextPaintInfo::CalcRect( const SwLinePortion& rPor,
if( IsRotated() )
{
- long nTmp = aSize.Width();
+ tools::Long nTmp = aSize.Width();
aSize.setWidth( aSize.Height() );
aSize.setHeight( nTmp );
if ( 1 == GetDirection() )
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 83c173e2db54..835600f22fdf 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -72,7 +72,7 @@ class SwLineInfo
SvxParaVertAlignItem::Align nVertAlign;
sal_uInt16 nDefTabStop;
bool bListTabStopIncluded;
- long nListTabStopPosition;
+ tools::Long nListTabStopPosition;
void CtorInitLineInfo( const SwAttrSet& rAttrSet,
const SwTextNode& rTextNode );
@@ -102,7 +102,7 @@ public:
{
return bListTabStopIncluded;
}
- long GetListTabStopPosition() const
+ tools::Long GetListTabStopPosition() const
{
return nListTabStopPosition;
}
@@ -263,11 +263,11 @@ public:
TextFrameIndex nLen) const;
inline SwPosSize GetTextSize( const OUString &rText ) const;
- TextFrameIndex GetTextBreak( const long nLineWidth,
+ TextFrameIndex GetTextBreak( const tools::Long nLineWidth,
const TextFrameIndex nMaxLen,
const sal_uInt16 nComp,
vcl::TextLayoutCache const*) const;
- TextFrameIndex GetTextBreak( const long nLineWidth,
+ TextFrameIndex GetTextBreak( const tools::Long nLineWidth,
const TextFrameIndex nMaxLen,
const sal_uInt16 nComp,
TextFrameIndex& rExtraCharPos,
@@ -383,7 +383,7 @@ public:
SwTextPaintInfo( SwTextFrame *pFrame, const SwRect &rPaint );
SwTwips X() const { return aPos.X(); }
- void X( const long nNew ) { aPos.setX(nNew); }
+ void X( const tools::Long nNew ) { aPos.setX(nNew); }
SwTwips Y() const { return aPos.Y(); }
void Y( const SwTwips nNew ) { aPos.setY(nNew); }
@@ -444,7 +444,7 @@ public:
void SetSpaceIdx( sal_uInt16 nNew ) { nSpaceIdx = nNew; }
void IncSpaceIdx() { ++nSpaceIdx; }
void RemoveFirstSpaceAdd() { pSpaceAdd->erase( pSpaceAdd->begin() ); }
- long GetSpaceAdd() const
+ tools::Long GetSpaceAdd() const
{ return ( pSpaceAdd && nSpaceIdx < pSpaceAdd->size() )
? (*pSpaceAdd)[nSpaceIdx] : 0; }
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 64a53c3c4481..a5944e49e357 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -189,7 +189,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
}
static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwTextIter& rItr, sal_Int32& rKashidas,
- TextFrameIndex& nGluePortion, const long nGluePortionWidth, long& nSpaceAdd )
+ TextFrameIndex& nGluePortion, const tools::Long nGluePortionWidth, tools::Long& nSpaceAdd )
{
// check kashida width
// if width is smaller than minimal kashida width allowed by fonts in the current line
@@ -214,7 +214,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT
nNext = nEnd;
sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, nIdx, nNext - nIdx );
- long nFontMinKashida = rInf.GetOut()->GetMinKashida();
+ tools::Long nFontMinKashida = rInf.GetOut()->GetMinKashida();
if ( nFontMinKashida && nKashidasInAttr > 0 && SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - nIdx ) )
{
sal_Int32 nKashidasDropped = 0;
@@ -345,7 +345,7 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
if ( nSpaceIdx == pCurrent->GetLLSpaceAddCount() )
pCurrent->SetLLSpaceAdd( 0, nSpaceIdx );
- const long nGluePortionWidth = static_cast<SwGluePortion*>(pPos)->GetPrtGlue() *
+ const tools::Long nGluePortionWidth = static_cast<SwGluePortion*>(pPos)->GetPrtGlue() *
SPACING_PRECISION_FACTOR;
sal_Int32 nKashidas = 0;
@@ -366,7 +366,7 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
if( nGluePortion )
{
- long nSpaceAdd = nGluePortionWidth / sal_Int32(nGluePortion);
+ tools::Long nSpaceAdd = nGluePortionWidth / sal_Int32(nGluePortion);
// i60594
if( rSI.CountKashida() && !bSkipKashida )
@@ -387,7 +387,7 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
}
else if (IsOneBlock() && nCharCnt > TextFrameIndex(1))
{
- const long nSpaceAdd = - nGluePortionWidth / (sal_Int32(nCharCnt) - 1);
+ const tools::Long nSpaceAdd = - nGluePortionWidth / (sal_Int32(nCharCnt) - 1);
pCurrent->SetLLSpaceAdd( nSpaceAdd, nSpaceIdx );
pPos->Width( static_cast<SwGluePortion*>(pPos)->GetFixWidth() );
}
@@ -418,7 +418,7 @@ SwTwips SwTextAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
const sal_uInt16 nNull = 0;
size_t nKanaIdx = 0;
- long nKanaDiffSum = 0;
+ tools::Long nKanaDiffSum = 0;
SwTwips nRepaintOfst = 0;
SwTwips nX = 0;
bool bNoCompression = false;
@@ -453,7 +453,7 @@ SwTwips SwTextAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
if ( nKanaIdx == pCurrent->GetKanaComp().size() )
pCurrent->GetKanaComp().push_back( nNull );
- long nRest;
+ tools::Long nRest;
if ( pPos->InTabGrp() )
{
@@ -503,7 +503,7 @@ SwTwips SwTextAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
nKanaIdx = 0;
sal_uInt16 nCompress = ( pCurrent->GetKanaComp() )[ nKanaIdx ];
pPos = pCurrent->GetNextPortion();
- long nDecompress = 0;
+ tools::Long nDecompress = 0;
while( pPos )
{
@@ -544,7 +544,7 @@ SwTwips SwTextAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
SwMarginPortion *SwTextAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
SwTwips nReal )
{
- long nRealWidth;
+ tools::Long nRealWidth;
const sal_uInt16 nRealHeight = GetLineHeight();
const sal_uInt16 nLineHeight = pCurrent->Height();
@@ -557,12 +557,12 @@ SwMarginPortion *SwTextAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
{
nRealWidth = GetLineWidth();
// For each FlyFrame extending into the right margin, we create a FlyPortion.
- const long nLeftMar = GetLeftMargin();
+ const tools::Long nLeftMar = GetLeftMargin();
SwRect aCurrRect( nLeftMar + nPrtWidth, Y() + nRealHeight - nLineHeight,
nRealWidth - nPrtWidth, nLineHeight );
SwFlyPortion *pFly = CalcFlyPortion( nRealWidth, aCurrRect );
- while( pFly && long( nPrtWidth )< nRealWidth )
+ while( pFly && tools::Long( nPrtWidth )< nRealWidth )
{
pLast->Append( pFly );
pLast = pFly;
@@ -578,7 +578,7 @@ SwMarginPortion *SwTextAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
SwMarginPortion *pRight = new SwMarginPortion;
pLast->Append( pRight );
- if( long( nPrtWidth )< nRealWidth )
+ if( tools::Long( nPrtWidth )< nRealWidth )
pRight->PrtWidth( sal_uInt16( nRealWidth - nPrtWidth ) );
// pCurrent->Width() is set to the real size, because we attach the
@@ -697,7 +697,7 @@ void SwTextAdjuster::CalcAdjLine( SwLineLayout *pCurrent )
// adding the word, that still fits onto the line! For this reason the FlyPortion's
// width is still correct if we get a deadlock-situation of:
// bFirstWord && !WORDFITS
-SwFlyPortion *SwTextAdjuster::CalcFlyPortion( const long nRealWidth,
+SwFlyPortion *SwTextAdjuster::CalcFlyPortion( const tools::Long nRealWidth,
const SwRect &rCurrRect )
{
SwTextFly aTextFly( GetTextFrame() );
@@ -729,7 +729,7 @@ SwFlyPortion *SwTextAdjuster::CalcFlyPortion( const long nRealWidth,
aLocal.Left( nCurrWidth );
// If the rect is wider than the line, we adjust it to the right size
- const long nLocalWidth = aLocal.Left() + aLocal.Width();
+ const tools::Long nLocalWidth = aLocal.Left() + aLocal.Width();
if( nRealWidth < nLocalWidth )
aLocal.Width( nRealWidth - aLocal.Left() );
GetInfo().GetParaPortion()->SetFly();
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index ce61e23db883..bc39bccc995e 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -787,15 +787,15 @@ public:
SwViewShell const * pSh;
sal_uLong &rMin;
sal_uLong &rAbsMin;
- long nRowWidth;
- long nWordWidth;
- long nWordAdd;
+ tools::Long nRowWidth;
+ tools::Long nWordWidth;
+ tools::Long nWordAdd;
sal_Int32 nNoLineBreak;
SwMinMaxArgs( OutputDevice* pOutI, SwViewShell const * pShI, sal_uLong& rMinI, sal_uLong &rAbsI )
: pOut( pOutI ), pSh( pShI ), rMin( rMinI ), rAbsMin( rAbsI ), nRowWidth(0),
nWordWidth(0), nWordAdd(0), nNoLineBreak(COMPLETE_STRING)
{ }
- void Minimum( long nNew ) const { if( static_cast<long>(rMin) < nNew ) rMin = nNew; }
+ void Minimum( tools::Long nNew ) const { if( static_cast<tools::Long>(rMin) < nNew ) rMin = nNew; }
void NewWord() { nWordAdd = nWordWidth = 0; }
};
@@ -824,14 +824,14 @@ static bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const OUString &
nStop = nEnd;
SwDrawTextInfo aDrawInf(rArg.pSh, *rArg.pOut, rText, nIdx, nStop - nIdx);
- long nCurrentWidth = pFnt->GetTextSize_( aDrawInf ).Width();
+ tools::Long nCurrentWidth = pFnt->GetTextSize_( aDrawInf ).Width();
rArg.nRowWidth += nCurrentWidth;
if( bClear )
rArg.NewWord();
else
{
rArg.nWordWidth += nCurrentWidth;
- if( static_cast<long>(rArg.rAbsMin) < rArg.nWordWidth )
+ if( static_cast<tools::Long>(rArg.rAbsMin) < rArg.nWordWidth )
rArg.rAbsMin = rArg.nWordWidth;
rArg.Minimum( rArg.nWordWidth + rArg.nWordAdd );
bRet = true;
@@ -855,13 +855,13 @@ class SwMinMaxNodeArgs
{
public:
sal_uLong nMaxWidth; // sum of all frame widths
- long nMinWidth; // biggest frame
- long nLeftRest; // space not already covered by frames in the left margin
- long nRightRest; // space not already covered by frames in the right margin
- long nLeftDiff; // Min/Max-difference of the frame in the left margin
- long nRightDiff; // Min/Max-difference of the frame in the right margin
+ tools::Long nMinWidth; // biggest frame
+ tools::Long nLeftRest; // space not already covered by frames in the left margin
+ tools::Long nRightRest; // space not already covered by frames in the right margin
+ tools::Long nLeftDiff; // Min/Max-difference of the frame in the left margin
+ tools::Long nRightDiff; // Min/Max-difference of the frame in the right margin
sal_uLong nIndx; // index of the node
- void Minimum( long nNew ) { if( nNew > nMinWidth ) nMinWidth = nNew; }
+ void Minimum( tools::Long nNew ) { if( nNew > nMinWidth ) nMinWidth = nNew; }
};
}
@@ -881,7 +881,7 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn )
if (!pPos || !pIn || pIn->nIndx != pPos->nNode.GetIndex())
return;
- long nMin, nMax;
+ tools::Long nMin, nMax;
SwHTMLTableLayout *pLayout = nullptr;
const bool bIsDrawFrameFormat = pNd->Which()==RES_DRAWFRMFMT;
if( !bIsDrawFrameFormat )
@@ -906,7 +906,7 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn )
const SwFormatHoriOrient& rOrient = pNd->GetHoriOrient();
sal_Int16 eHoriOri = rOrient.GetHoriOrient();
- long nDiff;
+ tools::Long nDiff;
if( pLayout )
{
nMin = pLayout->GetMin();
@@ -1010,7 +1010,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
rAbsMin = 0;
const SvxLRSpaceItem &rSpace = GetSwAttrSet().GetLRSpace();
- long nLROffset = rSpace.GetTextLeft() + GetLeftMarginWithNum( true );
+ tools::Long nLROffset = rSpace.GetTextLeft() + GetLeftMarginWithNum( true );
short nFLOffs;
// For enumerations a negative first line indentation is probably filled already
if( !GetFirstLineOfsWithNum( nFLOffs ) || nFLOffs > nLROffset )
@@ -1050,8 +1050,8 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
TextFrameIndex nIdx(0);
aIter.SeekAndChgAttrIter( nIdx, pOut );
TextFrameIndex nLen(m_Text.getLength());
- long nCurrentWidth = 0;
- long nAdd = 0;
+ tools::Long nCurrentWidth = 0;
+ tools::Long nAdd = 0;
SwMinMaxArgs aArg( pOut, pSh, rMin, rAbsMin );
while( nIdx < nLen )
{
@@ -1091,7 +1091,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
{
case CH_BREAK :
{
- if( static_cast<long>(rMax) < aArg.nRowWidth )
+ if( static_cast<tools::Long>(rMax) < aArg.nRowWidth )
rMax = aArg.nRowWidth;
aArg.nRowWidth = 0;
aArg.NewWord();
@@ -1116,7 +1116,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
nCurrentWidth = aIter.GetFnt()->GetTextSize_( aDrawInf ).Width();
aArg.nWordWidth += nCurrentWidth;
aArg.nRowWidth += nCurrentWidth;
- if( static_cast<long>(rAbsMin) < aArg.nWordWidth )
+ if( static_cast<tools::Long>(rAbsMin) < aArg.nWordWidth )
rAbsMin = aArg.nWordWidth;
aArg.Minimum( aArg.nWordWidth + aArg.nWordAdd );
aArg.nNoLineBreak = sal_Int32(nIdx++);
@@ -1127,8 +1127,8 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
{
if( !pHint )
break;
- long nOldWidth = aArg.nWordWidth;
- long nOldAdd = aArg.nWordAdd;
+ tools::Long nOldWidth = aArg.nWordWidth;
+ tools::Long nOldAdd = aArg.nWordAdd;
aArg.NewWord();
switch( pHint->Which() )
@@ -1167,7 +1167,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
aArg.nWordAdd = nOldWidth + nOldAdd;
aArg.nWordWidth = nCurrentWidth;
aArg.nRowWidth += nCurrentWidth;
- if( static_cast<long>(rAbsMin) < aArg.nWordWidth )
+ if( static_cast<tools::Long>(rAbsMin) < aArg.nWordWidth )
rAbsMin = aArg.nWordWidth;
aArg.Minimum( aArg.nWordWidth + aArg.nWordAdd );
break;
@@ -1210,7 +1210,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
break;
}
}
- if( static_cast<long>(rMax) < aArg.nRowWidth )
+ if( static_cast<tools::Long>(rMax) < aArg.nRowWidth )
rMax = aArg.nRowWidth;
nLROffset += rSpace.GetRight();
@@ -1219,9 +1219,9 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
rAbsMin += nAdd;
rMin += nLROffset;
rMin += nAdd;
- if( static_cast<long>(rMin) < aNodeArgs.nMinWidth )
+ if( static_cast<tools::Long>(rMin) < aNodeArgs.nMinWidth )
rMin = aNodeArgs.nMinWidth;
- if( static_cast<long>(rAbsMin) < aNodeArgs.nMinWidth )
+ if( static_cast<tools::Long>(rAbsMin) < aNodeArgs.nMinWidth )
rAbsMin = aNodeArgs.nMinWidth;
rMax += aNodeArgs.nMaxWidth;
rMax += nLROffset;
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index a7e7752796f7..283116b50a06 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -216,7 +216,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
else
{
nLeft = m_pFrame->getFrameArea().Left() +
- std::max( long( rSpace.GetTextLeft() + nLMWithNum ),
+ std::max( tools::Long( rSpace.GetTextLeft() + nLMWithNum ),
m_pFrame->getFramePrintArea().Left() );
}
}
@@ -240,7 +240,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
else
{
short nFLOfst = 0;
- long nFirstLineOfs = 0;
+ tools::Long nFirstLineOfs = 0;
if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) &&
rSpace.IsAutoFirst() )
{
@@ -274,7 +274,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
break;
case SvxInterLineSpaceRule::Prop:
{
- long nTmp = pSpace->GetPropLineSpace();
+ tools::Long nTmp = pSpace->GetPropLineSpace();
// 50% is the minimum, at 0% we switch to
// the default value 100%...
if( nTmp < 50 )
@@ -398,7 +398,7 @@ void SwTextCursor::CtorInitTextCursor( SwTextFrame *pNewFrame, SwTextSizeInfo *p
// 1170: Ancient bug: Shift-End forgets the last character ...
void SwTextCursor::GetEndCharRect(SwRect* pOrig, const TextFrameIndex nOfst,
- SwCursorMoveState* pCMS, const long nMax )
+ SwCursorMoveState* pCMS, const tools::Long nMax )
{
// 1170: Ambiguity of document positions
bRightMargin = true;
@@ -424,8 +424,8 @@ void SwTextCursor::GetEndCharRect(SwRect* pOrig, const TextFrameIndex nOfst,
// If necessary, as catch up, do the adjustment
GetAdjusted();
- long nX = 0;
- long nLast = 0;
+ tools::Long nX = 0;
+ tools::Long nLast = 0;
SwLinePortion *pPor = m_pCurr->GetFirstPortion();
sal_uInt16 nTmpHeight, nTmpAscent;
@@ -516,7 +516,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst,
std::deque<sal_uInt16>* pKanaComp = m_pCurr->GetpKanaComp();
sal_uInt16 nSpaceIdx = 0;
size_t nKanaIdx = 0;
- long nSpaceAdd = m_pCurr->IsSpaceAdd() ? m_pCurr->GetLLSpaceAdd( 0 ) : 0;
+ tools::Long nSpaceAdd = m_pCurr->IsSpaceAdd() ? m_pCurr->GetLLSpaceAdd( 0 ) : 0;
bool bNoText = true;
@@ -811,7 +811,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst,
if( static_cast<SwMultiPortion*>(pPor)->HasRotation() )
{
GetInfo().SetMulti( false );
- long nTmp = pOrig->Width();
+ tools::Long nTmp = pOrig->Width();
pOrig->Width( pOrig->Height() );
pOrig->Height( nTmp );
nTmp = pOrig->Left() - aOldPos.X();
@@ -1176,7 +1176,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst,
}
void SwTextCursor::GetCharRect( SwRect* pOrig, TextFrameIndex const nOfst,
- SwCursorMoveState* pCMS, const long nMax )
+ SwCursorMoveState* pCMS, const tools::Long nMax )
{
CharCursorToLine(nOfst);
@@ -1238,7 +1238,7 @@ void SwTextCursor::GetCharRect( SwRect* pOrig, TextFrameIndex const nOfst,
}
if ( pCMS && pCMS->m_bRealHeight && pCMS->m_aRealHeight.Y() >= 0 )
{
- long nTmp = pCMS->m_aRealHeight.X() + pOrig->Top();
+ tools::Long nTmp = pCMS->m_aRealHeight.X() + pOrig->Top();
if( nTmp >= nMax )
{
pCMS->m_aRealHeight.setX( nMax - pOrig->Top() );
@@ -1248,7 +1248,7 @@ void SwTextCursor::GetCharRect( SwRect* pOrig, TextFrameIndex const nOfst,
pCMS->m_aRealHeight.setY( nMax - nTmp );
}
}
- long nOut = pOrig->Right() - GetTextFrame()->getFrameArea().Right();
+ tools::Long nOut = pOrig->Right() - GetTextFrame()->getFrameArea().Right();
if( nOut > 0 )
{
if( GetTextFrame()->getFrameArea().Width() < GetTextFrame()->getFramePrintArea().Left()
@@ -1324,7 +1324,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con
TextFrameIndex const nOldIdx = GetInfo().GetIdx();
sal_uInt16 nSpaceIdx = 0;
size_t nKanaIdx = 0;
- long nSpaceAdd = m_pCurr->IsSpaceAdd() ? m_pCurr->GetLLSpaceAdd( 0 ) : 0;
+ tools::Long nSpaceAdd = m_pCurr->IsSpaceAdd() ? m_pCurr->GetLLSpaceAdd( 0 ) : 0;
short nKanaComp = pKanaComp ? (*pKanaComp)[0] : 0;
// nWidth is the width of the line, or the width of
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index d6de4e28849e..42a43d4ca744 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -61,7 +61,7 @@ using namespace ::com::sun::star;
namespace {
//! Calculates and sets optimal repaint offset for the current line
- long lcl_CalcOptRepaint( SwTextFormatter &rThis,
+ tools::Long lcl_CalcOptRepaint( SwTextFormatter &rThis,
SwLineLayout const &rCurr,
TextFrameIndex nOldLineEnd,
const std::vector<long> &rFlyStarts );
@@ -506,7 +506,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
const SwLayoutFrame* pBody = pPageFrame->FindBodyCont();
SwRectFnSet aRectFnSet(pPageFrame);
- const long nGridOrigin = pBody ?
+ const tools::Long nGridOrigin = pBody ?
aRectFnSet.GetPrtLeft(*pBody) :
aRectFnSet.GetPrtLeft(*pPageFrame);
@@ -1598,7 +1598,7 @@ TextFrameIndex SwTextFormatter::FormatLine(TextFrameIndex const nStartPos)
if ( bOptimizeRepaint && m_pCurr->IsFly() )
{
SwLinePortion* pPor = m_pCurr->GetFirstPortion();
- long nPOfst = 0;
+ tools::Long nPOfst = 0;
while ( pPor )
{
if ( pPor->IsFlyPortion() )
@@ -1657,7 +1657,7 @@ TextFrameIndex SwTextFormatter::FormatLine(TextFrameIndex const nStartPos)
{
sal_uInt16 nTmpAscent, nTmpHeight;
CalcAscentAndHeight( nTmpAscent, nTmpHeight );
- AlignFlyInCntBase( Y() + long( nTmpAscent ) );
+ AlignFlyInCntBase( Y() + tools::Long( nTmpAscent ) );
m_pCurr->CalcLine( *this, GetInfo() );
CalcRealHeight();
}
@@ -1832,7 +1832,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
pSpace->GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop
&& GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE))
{
- long nTmp = pSpace->GetPropLineSpace();
+ tools::Long nTmp = pSpace->GetPropLineSpace();
// Word will render < 50% too but it's just not readable
if( nTmp < 50 )
nTmp = nTmp ? 50 : 100;
@@ -1886,7 +1886,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
break;
case SvxInterLineSpaceRule::Prop:
{
- long nTmp = pSpace->GetPropLineSpace();
+ tools::Long nTmp = pSpace->GetPropLineSpace();
// 50% is the minimum, if 0% we switch to the
// default value 100% ...
if( nTmp < 50 )
@@ -2069,7 +2069,7 @@ void SwTextFormatter::CalcUnclipped( SwTwips& rTop, SwTwips& rBottom )
OSL_ENSURE( ! m_pFrame->IsVertical() || m_pFrame->IsSwapped(),
"SwTextFormatter::CalcUnclipped with unswapped frame" );
- long nFlyAsc, nFlyDesc;
+ tools::Long nFlyAsc, nFlyDesc;
m_pCurr->MaxAscentDescent( rTop, rBottom, nFlyAsc, nFlyDesc );
rTop = Y() + GetCurr()->GetAscent();
rBottom = rTop + nFlyDesc;
@@ -2096,7 +2096,7 @@ void SwTextFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
aTmpInf.SetIdx( nStartIdx );
aTmpInf.SetPos( aStart );
- long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
+ tools::Long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
pCurrent->MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc );
const sal_uInt16 nTmpHeight = pCurrent->GetRealHeight();
@@ -2198,7 +2198,7 @@ void SwTextFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
}
}
-void SwTextFormatter::AlignFlyInCntBase( long nBaseLine ) const
+void SwTextFormatter::AlignFlyInCntBase( tools::Long nBaseLine ) const
{
OSL_ENSURE( ! m_pFrame->IsVertical() || m_pFrame->IsSwapped(),
"SwTextFormatter::AlignFlyInCntBase with unswapped frame" );
@@ -2215,7 +2215,7 @@ void SwTextFormatter::AlignFlyInCntBase( long nBaseLine ) const
nFlags |= AsCharFlags::Reverse;
}
- long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
+ tools::Long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
while( pPos )
{
@@ -2344,9 +2344,9 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
const SwLinePortion *pLast = rInf.GetLast();
- long nAscent;
- long nTop = Y();
- long nHeight;
+ tools::Long nAscent;
+ tools::Long nTop = Y();
+ tools::Long nHeight;
if( rInf.GetLineHeight() )
{
@@ -2372,8 +2372,8 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
nHeight = m_pCurr->GetRealHeight();
}
- const long nLeftMar = GetLeftMargin();
- const long nLeftMin = (rInf.X() || GetDropLeft()) ? nLeftMar : GetLeftMin();
+ const tools::Long nLeftMar = GetLeftMargin();
+ const tools::Long nLeftMin = (rInf.X() || GetDropLeft()) ? nLeftMar : GetLeftMin();
SwRect aLine( rInf.X() + nLeftMin, nTop, rInf.RealWidth() - rInf.X()
+ nLeftMar - nLeftMin , nHeight );
@@ -2384,7 +2384,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS)
&& IsFirstTextLine())
{
- const long nUpper = m_pFrame->getFramePrintArea().Top();
+ const tools::Long nUpper = m_pFrame->getFramePrintArea().Top();
// Increase the rectangle
if( nUpper > 0 && nTop >= nUpper )
aLine.SubTop( nUpper );
@@ -2426,7 +2426,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
if( aInter.Left() < nFrameLeft )
aInter.Left( nFrameLeft );
- long nAddMar = 0;
+ tools::Long nAddMar = 0;
if ( m_pFrame->IsRightToLeft() )
{
nAddMar = m_pFrame->getFrameArea().Right() - Right();
@@ -2487,7 +2487,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
// or the next margin's top edge, which we need to respect.
// That means we can comfortably grow up to this value; that's how
// we save a few empty lines.
- long nNextTop = rTextFly.GetNextTop();
+ tools::Long nNextTop = rTextFly.GetNextTop();
if ( m_pFrame->IsVertical() )
nNextTop = m_pFrame->SwitchVerticalToHorizontal( nNextTop );
if( nNextTop > aInter.Bottom() )
@@ -2533,7 +2533,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
SwRectFnSet aRectFnSet(pPageFrame);
- const long nGridOrigin = pBody ?
+ const tools::Long nGridOrigin = pBody ?
aRectFnSet.GetPrtLeft(*pBody) :
aRectFnSet.GetPrtLeft(*pPageFrame);
@@ -2553,7 +2553,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
const sal_uLong i = nTmpWidth / nGridWidth + 1;
- const long nNewWidth = ( i - 1 ) * nGridWidth - nOfst;
+ const tools::Long nNewWidth = ( i - 1 ) * nGridWidth - nOfst;
if ( nNewWidth > 0 )
rInf.Width( static_cast<sal_uInt16>(nNewWidth) );
else
@@ -2577,7 +2577,7 @@ SwFlyCntPortion *SwTextFormatter::NewFlyCntPortion( SwTextFormatInfo &rInf,
// aBase.X() = Offset in the line after the current position
// aBase.Y() = LineIter.Y() + Ascent of the current position
- long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
+ tools::Long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
// i#11859 - use new method <SwLineLayout::MaxAscentDescent(..)>
// to change line spacing behaviour at paragraph - Compatibility to MS Word
//SwLinePortion *pPos = pCurr->GetFirstPortion();
@@ -2769,7 +2769,7 @@ void SwTextFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwLinePorti
namespace {
// calculates and sets optimal repaint offset for the current line
- long lcl_CalcOptRepaint( SwTextFormatter &rThis,
+ tools::Long lcl_CalcOptRepaint( SwTextFormatter &rThis,
SwLineLayout const &rCurr,
TextFrameIndex const nOldLineEnd,
const std::vector<long> &rFlyStarts )
@@ -2790,7 +2790,7 @@ namespace {
// for example: the beginning of the first right tab stop
// if this value is 0, this means that we do not have an upper
// limit for the repaint offset
- const long nFormatRepaint = txtFormatInfo.GetPaintOfst();
+ const tools::Long nFormatRepaint = txtFormatInfo.GetPaintOfst();
if (nReformat < txtFormatInfo.GetLineStart() + TextFrameIndex(3))
return 0;
@@ -2837,9 +2837,9 @@ namespace {
// we compare the former and the new fly positions in this line
// if anything has changed, we carefully have to adjust the right
// repaint position
- long nPOfst = 0;
+ tools::Long nPOfst = 0;
size_t nCnt = 0;
- long nX = 0;
+ tools::Long nX = 0;
TextFrameIndex nIdx = rThis.GetInfo().GetLineStart();
SwLinePortion* pPor = rCurr.GetFirstPortion();
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index c9a14f566741..2e6e88587bdc 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -117,7 +117,7 @@ class SwTextFormatter : public SwTextPainter
Set all anchored as character objects to the passed BaseLine
(in Y direction).
*/
- void AlignFlyInCntBase( long nBaseLine ) const;
+ void AlignFlyInCntBase( tools::Long nBaseLine ) const;
/**
This is called after the real height of the line has been calculated
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 28eb142d63af..6c3e7a2e4eeb 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -88,7 +88,7 @@ SwLinePortion *SwTextPainter::CalcPaintOfst( const SwRect &rPaint )
{
if( pPor->InSpaceGrp() && GetInfo().GetSpaceAdd() )
{
- long nTmp = GetInfo().X() +pPor->Width() +
+ tools::Long nTmp = GetInfo().X() +pPor->Width() +
pPor->CalcSpacing( GetInfo().GetSpaceAdd(), GetInfo() );
if( nTmp + (pPor->Height()/2) >= nPaintOfst )
break;
@@ -478,7 +478,7 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
}
void SwTextPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
- long nAdjustBaseLine )
+ tools::Long nAdjustBaseLine )
{
// Check if common underline should not be continued
if ( IsUnderlineBreak( *pPor, *m_pFont ) )
diff --git a/sw/source/core/text/itrpaint.hxx b/sw/source/core/text/itrpaint.hxx
index 2256c392896a..155f67efef64 100644
--- a/sw/source/core/text/itrpaint.hxx
+++ b/sw/source/core/text/itrpaint.hxx
@@ -30,7 +30,7 @@ class SwTextPainter : public SwTextCursor
SwLinePortion *CalcPaintOfst( const SwRect &rPaint );
void CheckSpecialUnderline( const SwLinePortion* pPor,
- long nAdjustBaseLine = 0 );
+ tools::Long nAdjustBaseLine = 0 );
protected:
void CtorInitTextPainter( SwTextFrame *pFrame, SwTextPaintInfo *pInf );
explicit SwTextPainter(SwTextNode const * pTextNode)
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 81e67503d3fb..52bbbe06fd4a 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -232,7 +232,7 @@ class SwTextAdjuster : public SwTextMargin
SwMarginPortion* CalcRightMargin( SwLineLayout *pCurr, SwTwips nReal = 0 );
// Calculate the adjustment (FlyPortions)
- SwFlyPortion *CalcFlyPortion( const long nRealWidth,
+ SwFlyPortion *CalcFlyPortion( const tools::Long nRealWidth,
const SwRect &rCurrRect );
protected:
@@ -277,9 +277,9 @@ public:
CtorInitTextCursor(pTextFrame, pTextSizeInf);
}
void GetCharRect(SwRect *, TextFrameIndex, SwCursorMoveState* = nullptr,
- const long nMax = 0 );
+ const tools::Long nMax = 0 );
void GetEndCharRect(SwRect *, TextFrameIndex, SwCursorMoveState* = nullptr,
- const long nMax = 0 );
+ const tools::Long nMax = 0 );
TextFrameIndex GetModelPositionForViewPoint( SwPosition *pPos, const Point &rPoint,
bool bChgNode, SwCursorMoveState* = nullptr ) const;
// Respects ambiguities: For the implementation see below
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 0c77fdcd09d0..963ab8e3910f 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -546,7 +546,7 @@ bool SwNumberPortion::Format( SwTextFormatInfo &rInf )
// SetAscent( rInf.GetAscent() );
OSL_ENSURE( Height() && nAscent, "NumberPortions without Height | Ascent" );
- long nDiff( 0 );
+ tools::Long nDiff( 0 );
if ( !mbLabelAlignmentPosAndSpaceModeActive )
{
@@ -845,7 +845,7 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo &rInf )
}
rInf.SetNumDone( true );
// long nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
- long nDiff = mbLabelAlignmentPosAndSpaceModeActive
+ tools::Long nDiff = mbLabelAlignmentPosAndSpaceModeActive
? 0
: rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
// The TextPortion should at least always start on the
@@ -891,7 +891,7 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
return;
}
Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE );
- long nTmpWidth = std::max( long(0), static_cast<long>(nFixWidth - 2 * GRFNUM_SECURE) );
+ tools::Long nTmpWidth = std::max( tools::Long(0), static_cast<tools::Long>(nFixWidth - 2 * GRFNUM_SECURE) );
Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE );
const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive ||
@@ -919,7 +919,7 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
if( m_bReplace )
{
- const long nTmpH = GetNextPortion() ? GetNextPortion()->GetAscent() : 120;
+ const tools::Long nTmpH = GetNextPortion() ? GetNextPortion()->GetAscent() : 120;
aSize = Size( nTmpH, nTmpH );
aPos.setY( rInf.Y() - nTmpH );
}
@@ -998,8 +998,8 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
}
}
-void SwGrfNumPortion::SetBase( long nLnAscent, long nLnDescent,
- long nFlyAsc, long nFlyDesc )
+void SwGrfNumPortion::SetBase( tools::Long nLnAscent, tools::Long nLnDescent,
+ tools::Long nFlyAsc, tools::Long nFlyDesc )
{
if ( GetOrient() == text::VertOrientation::NONE )
return;
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index cca2b87cf6a8..2aa554ca81e3 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -159,7 +159,7 @@ public:
class SwGrfNumPortion : public SwNumberPortion
{
std::unique_ptr<SvxBrushItem> pBrush;
- long nId; // For StopAnimation
+ tools::Long nId; // For StopAnimation
SwTwips nYPos; // _Always_ contains the current RelPos
SwTwips nGrfHeight;
sal_Int16 eOrient;
@@ -177,15 +177,15 @@ public:
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
virtual bool Format( SwTextFormatInfo &rInf ) override;
- void SetBase( long nLnAscent, long nLnDescent,
- long nFlyAscent, long nFlyDescent );
+ void SetBase( tools::Long nLnAscent, tools::Long nLnDescent,
+ tools::Long nFlyAscent, tools::Long nFlyDescent );
void StopAnimation( const OutputDevice* pOut );
bool IsAnimated() const { return m_bAnimated; }
void SetAnimated( bool bNew ) { m_bAnimated = bNew; }
void SetRelPos( SwTwips nNew ) { nYPos = nNew; }
- void SetId( long nNew ) const
+ void SetId( tools::Long nNew ) const
{ const_cast<SwGrfNumPortion*>(this)->nId = nNew; }
SwTwips GetRelPos() const { return nYPos; }
SwTwips GetGrfHeight() const { return nGrfHeight; }
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index a352984aba18..24961c08b68d 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -268,14 +268,14 @@ sw::DrawFlyCntPortion::DrawFlyCntPortion(SwFrameFormat const & rFormat)
assert(m_pContact);
}
-sw::FlyContentPortion* sw::FlyContentPortion::Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, long nLnAscent, long nLnDescent, long nFlyAsc, long nFlyDesc, AsCharFlags nFlags)
+sw::FlyContentPortion* sw::FlyContentPortion::Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
{
auto pNew(new sw::FlyContentPortion(pFly));
pNew->SetBase(rFrame, rBase, nLnAscent, nLnDescent, nFlyAsc, nFlyDesc, nFlags | AsCharFlags::UlSpace | AsCharFlags::Init);
return pNew;
}
-sw::DrawFlyCntPortion* sw::DrawFlyCntPortion::Create(const SwTextFrame& rFrame, SwFrameFormat const & rFormat, const Point& rBase, long nLnAscent, long nLnDescent, long nFlyAsc, long nFlyDesc, AsCharFlags nFlags)
+sw::DrawFlyCntPortion* sw::DrawFlyCntPortion::Create(const SwTextFrame& rFrame, SwFrameFormat const & rFormat, const Point& rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
{
auto pNew(new DrawFlyCntPortion(rFormat));
pNew->SetBase(rFrame, rBase, nLnAscent, nLnDescent, nFlyAsc, nFlyDesc, nFlags | AsCharFlags::UlSpace | AsCharFlags::Init);
@@ -316,8 +316,8 @@ SdrObject* sw::DrawFlyCntPortion::GetSdrObj(const SwTextFrame& rFrame)
* @param rBase CAUTION: needs to be an absolute value!
*/
void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase,
- long nLnAscent, long nLnDescent,
- long nFlyAsc, long nFlyDesc,
+ tools::Long nLnAscent, tools::Long nLnDescent,
+ tools::Long nFlyAsc, tools::Long nFlyDesc,
AsCharFlags nFlags )
{
// Use new class to position object
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index c01abd4994fa..1a318691c7c2 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -56,7 +56,7 @@ public:
sw::LineAlign GetAlign() const { return m_eAlign; }
void SetAlign(sw::LineAlign eAlign) { m_eAlign = eAlign; }
void SetMax(bool bMax) { m_bMax = bMax; }
- void SetBase(const SwTextFrame& rFrame, const Point& rBase, long nLnAscent, long nLnDescent, long nFlyAscent, long nFlyDescent, AsCharFlags nFlags);
+ void SetBase(const SwTextFrame& rFrame, const Point& rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent, AsCharFlags nFlags);
virtual bool Format(SwTextFormatInfo& rInf) override;
};
@@ -68,7 +68,7 @@ namespace sw
virtual SdrObject* GetSdrObj(const SwTextFrame&) override;
public:
FlyContentPortion(SwFlyInContentFrame* pFly);
- static FlyContentPortion* Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, long nAscent, long nDescent, long nFlyAsc, long nFlyDesc, AsCharFlags nFlags);
+ static FlyContentPortion* Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, tools::Long nAscent, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags);
SwFlyInContentFrame* GetFlyFrame() { return m_pFly; }
void GetFlyCursorOfst(Point& rPoint, SwPosition& rPos, SwCursorMoveState* pCMS) const { m_pFly->GetModelPositionForViewPoint(&rPos, rPoint, pCMS); };
virtual void Paint(const SwTextPaintInfo& rInf) const override;
@@ -80,7 +80,7 @@ namespace sw
virtual SdrObject* GetSdrObj(const SwTextFrame&) override;
public:
DrawFlyCntPortion(SwFrameFormat const & rFormat);
- static DrawFlyCntPortion* Create(const SwTextFrame& rFrame, SwFrameFormat const & rFormat, const Point& rBase, long nAsc, long nDescent, long nFlyAsc, long nFlyDesc, AsCharFlags nFlags);
+ static DrawFlyCntPortion* Create(const SwTextFrame& rFrame, SwFrameFormat const & rFormat, const Point& rBase, tools::Long nAsc, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags);
virtual void Paint(const SwTextPaintInfo& rInf) const override;
virtual ~DrawFlyCntPortion() override;
};
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 822da9ef1672..84688c69f3f5 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -105,7 +105,7 @@ void SwGluePortion::Paint( const SwTextPaintInfo &rInf ) const
}
}
-void SwGluePortion::MoveGlue( SwGluePortion *pTarget, const long nPrtGlue )
+void SwGluePortion::MoveGlue( SwGluePortion *pTarget, const tools::Long nPrtGlue )
{
auto nPrt = std::min( nPrtGlue, GetPrtGlue() );
if( 0 < nPrt )
diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx
index 27e9b0dabb52..c2c9cd25204c 100644
--- a/sw/source/core/text/porglue.hxx
+++ b/sw/source/core/text/porglue.hxx
@@ -33,10 +33,10 @@ public:
void Join( SwGluePortion *pVictim );
- inline long GetPrtGlue() const;
+ inline tools::Long GetPrtGlue() const;
sal_uInt16 GetFixWidth() const { return nFixWidth; }
void SetFixWidth( const sal_uInt16 nNew ) { nFixWidth = nNew; }
- void MoveGlue( SwGluePortion *pTarget, const long nPrtGlue );
+ void MoveGlue( SwGluePortion *pTarget, const tools::Long nPrtGlue );
inline void MoveAllGlue( SwGluePortion *pTarget );
inline void MoveHalfGlue( SwGluePortion *pTarget );
inline void AdjFixWidth();
@@ -63,7 +63,7 @@ public:
void AdjustRight( const SwLineLayout* pCurr );
};
-inline long SwGluePortion::GetPrtGlue() const
+inline tools::Long SwGluePortion::GetPrtGlue() const
{ return Width() - nFixWidth; }
// The FixWidth MUST NEVER be larger than the accumulated width!
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 4524751a1ddb..7e9c2c25cbdc 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -306,7 +306,7 @@ void SwLineLayout::InitSpaceAdd()
SetLLSpaceAdd( 0, 0 );
}
-void SwLineLayout::CreateSpaceAdd( const long nInit )
+void SwLineLayout::CreateSpaceAdd( const tools::Long nInit )
{
m_pLLSpaceAdd.reset( new std::vector<long> );
SetLLSpaceAdd( nInit, 0 );
@@ -1939,7 +1939,7 @@ size_t SwScriptInfo::HasKana(TextFrameIndex const nStart, TextFrameIndex const n
return SAL_MAX_SIZE;
}
-long SwScriptInfo::Compress(long* pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen,
+tools::Long SwScriptInfo::Compress(tools::Long* pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen,
const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
bool bCenter,
Point* pPoint ) const
@@ -1951,7 +1951,7 @@ long SwScriptInfo::Compress(long* pKernArray, TextFrameIndex nIdx, TextFrameInde
// In asian typography, there are full width and half width characters.
// Full width punctuation characters can be compressed by 50%
// to determine this, we compare the font width with 75% of its height
- const long nMinWidth = ( 3 * nFontHeight ) / 4;
+ const tools::Long nMinWidth = ( 3 * nFontHeight ) / 4;
size_t nCompIdx = HasKana( nIdx, nLen );
@@ -1974,8 +1974,8 @@ long SwScriptInfo::Compress(long* pKernArray, TextFrameIndex nIdx, TextFrameInde
if( nIdx > nLen || nCompIdx >= nCompCount )
return 0;
- long nSub = 0;
- long nLast = nI ? pKernArray[ nI - 1 ] : 0;
+ tools::Long nSub = 0;
+ tools::Long nLast = nI ? pKernArray[ nI - 1 ] : 0;
do
{
const CompType nType = GetCompType( nCompIdx );
@@ -2001,7 +2001,7 @@ long SwScriptInfo::Compress(long* pKernArray, TextFrameIndex nIdx, TextFrameInde
nLast -= pKernArray[ nI ];
nLast *= nCompress;
- long nMove = 0;
+ tools::Long nMove = 0;
if( SwScriptInfo::KANA != nType )
{
nLast /= 24000;
@@ -2056,11 +2056,11 @@ long SwScriptInfo::Compress(long* pKernArray, TextFrameIndex nIdx, TextFrameInde
// total number of kashida positions, or the number of kashida positions after some positions
// have been dropped, depending on the state of the m_KashidaInvalid set.
-sal_Int32 SwScriptInfo::KashidaJustify( long* pKernArray,
- long* pScrArray,
+sal_Int32 SwScriptInfo::KashidaJustify( tools::Long* pKernArray,
+ tools::Long* pScrArray,
TextFrameIndex const nStt,
TextFrameIndex const nLen,
- long nSpaceAdd ) const
+ tools::Long nSpaceAdd ) const
{
SAL_WARN_IF( !nLen, "sw.core", "Kashida justification without text?!" );
@@ -2107,7 +2107,7 @@ sal_Int32 SwScriptInfo::KashidaJustify( long* pKernArray,
TextFrameIndex nIdx = nCntKash < nCntKashEnd && IsKashidaValid(nCntKash)
? GetKashida(nCntKash)
: nEnd;
- long nKashAdd = nSpaceAdd;
+ tools::Long nKashAdd = nSpaceAdd;
while ( nIdx < nEnd )
{
@@ -2315,18 +2315,18 @@ void SwScriptInfo::MarkKashidasInvalid(sal_Int32 const nCnt,
}
}
-TextFrameIndex SwScriptInfo::ThaiJustify( const OUString& rText, long* pKernArray,
- long* pScrArray, TextFrameIndex const nStt,
+TextFrameIndex SwScriptInfo::ThaiJustify( const OUString& rText, tools::Long* pKernArray,
+ tools::Long* pScrArray, TextFrameIndex const nStt,
TextFrameIndex const nLen,
TextFrameIndex nNumberOfBlanks,
- long nSpaceAdd )
+ tools::Long nSpaceAdd )
{
SAL_WARN_IF( nStt + nLen > TextFrameIndex(rText.getLength()), "sw.core", "String in ThaiJustify too small" );
SwTwips nNumOfTwipsToDistribute = nSpaceAdd * sal_Int32(nNumberOfBlanks) /
SPACING_PRECISION_FACTOR;
- long nSpaceSum = 0;
+ tools::Long nSpaceSum = 0;
TextFrameIndex nCnt(0);
for (sal_Int32 nI = 0; nI < sal_Int32(nLen); ++nI)
@@ -2654,16 +2654,16 @@ TextFrameIndex SwScriptInfo::CountCJKCharacters(const OUString &rText,
return nCount;
}
-void SwScriptInfo::CJKJustify( const OUString& rText, long* pKernArray,
- long* pScrArray, TextFrameIndex const nStt,
+void SwScriptInfo::CJKJustify( const OUString& rText, tools::Long* pKernArray,
+ tools::Long* pScrArray, TextFrameIndex const nStt,
TextFrameIndex const nLen, LanguageType aLang,
- long nSpaceAdd, bool bIsSpaceStop )
+ tools::Long nSpaceAdd, bool bIsSpaceStop )
{
assert( pKernArray != nullptr && sal_Int32(nStt) >= 0 );
if (sal_Int32(nLen) <= 0)
return;
- long nSpaceSum = 0;
+ tools::Long nSpaceSum = 0;
const lang::Locale &rLocale = g_pBreakIt->GetLocale( aLang );
sal_Int32 nDone = 0;
sal_Int32 nNext(nStt);
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 56ed00e693e8..ca2c4e0ae22f 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -175,17 +175,17 @@ public:
// Stuff for justified alignment
bool IsSpaceAdd() const { return m_pLLSpaceAdd != nullptr; }
void InitSpaceAdd(); // Creates pLLSpaceAdd if necessary
- void CreateSpaceAdd( const long nInit = 0 );
+ void CreateSpaceAdd( const tools::Long nInit = 0 );
void FinishSpaceAdd() { m_pLLSpaceAdd.reset(); }
sal_uInt16 GetLLSpaceAddCount() const { return sal::static_int_cast< sal_uInt16 >(m_pLLSpaceAdd->size()); }
- void SetLLSpaceAdd( long nNew, sal_uInt16 nIdx )
+ void SetLLSpaceAdd( tools::Long nNew, sal_uInt16 nIdx )
{
if ( nIdx == GetLLSpaceAddCount() )
m_pLLSpaceAdd->push_back( nNew );
else
(*m_pLLSpaceAdd)[ nIdx ] = nNew;
}
- long GetLLSpaceAdd( sal_uInt16 nIdx ) { return (*m_pLLSpaceAdd)[ nIdx ]; }
+ tools::Long GetLLSpaceAdd( sal_uInt16 nIdx ) { return (*m_pLLSpaceAdd)[ nIdx ]; }
void RemoveFirstLLSpaceAdd() { m_pLLSpaceAdd->erase( m_pLLSpaceAdd->begin() ); }
std::vector<long>* GetpLLSpaceAdd() const { return m_pLLSpaceAdd.get(); }
@@ -246,7 +246,7 @@ class SwParaPortion : public SwLineLayout
SwScriptInfo m_aScriptInfo;
// Fraction aZoom;
- long m_nDelta;
+ tools::Long m_nDelta;
// If a SwTextFrame is locked, no changes occur to the formatting data (under
// pLine) (compare with Orphans)
@@ -276,8 +276,8 @@ public:
const SwRepaint& GetRepaint() const { return m_aRepaint; }
SwCharRange& GetReformat() { return m_aReformat; }
const SwCharRange& GetReformat() const { return m_aReformat; }
- long& GetDelta() { return m_nDelta; }
- const long& GetDelta() const { return m_nDelta; }
+ tools::Long& GetDelta() { return m_nDelta; }
+ const tools::Long& GetDelta() const { return m_nDelta; }
SwScriptInfo& GetScriptInfo() { return m_aScriptInfo; }
const SwScriptInfo& GetScriptInfo() const { return m_aScriptInfo; }
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index a9b057faa454..ab48848c7510 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -302,7 +302,7 @@ void SwLinePortion::Move( SwTextPaintInfo &rInf )
rInf.SetIdx( rInf.GetIdx() + GetLen() );
}
-long SwLinePortion::CalcSpacing( long , const SwTextSizeInfo & ) const
+tools::Long SwLinePortion::CalcSpacing( tools::Long , const SwTextSizeInfo & ) const
{
return 0;
}
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 615c90022d23..50b19ad0782c 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -160,7 +160,7 @@ public:
virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &rInf ) const;
// for text- and multi-portions
- virtual long CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const;
+ virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const;
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 925f5f4e354a..59cff49d2f69 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -119,12 +119,12 @@ void SwMultiPortion::CalcSize( SwTextFormatter& rLine, SwTextFormatInfo &rInf )
SetAscent( nTmp );
}
-long SwMultiPortion::CalcSpacing( long , const SwTextSizeInfo & ) const
+tools::Long SwMultiPortion::CalcSpacing( tools::Long , const SwTextSizeInfo & ) const
{
return 0;
}
-bool SwMultiPortion::ChgSpaceAdd( SwLineLayout*, long ) const
+bool SwMultiPortion::ChgSpaceAdd( SwLineLayout*, tools::Long ) const
{
return false;
}
@@ -193,12 +193,12 @@ SwBidiPortion::SwBidiPortion(TextFrameIndex const nEnd, sal_uInt8 nLv)
SetDirection( DIR_LEFT2RIGHT );
}
-long SwBidiPortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo& rInf ) const
+tools::Long SwBidiPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo& rInf ) const
{
return HasTabulator() ? 0 : sal_Int32(GetSpaceCnt(rInf)) * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
-bool SwBidiPortion::ChgSpaceAdd( SwLineLayout* pCurr, long nSpaceAdd ) const
+bool SwBidiPortion::ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const
{
if( !HasTabulator() && nSpaceAdd > 0 && !pCurr->IsSpaceAdd() )
{
@@ -333,7 +333,7 @@ SwDoubleLinePortion::SwDoubleLinePortion(
// the open bracket sets position behind itself,
// the close bracket in front of itself.
void SwDoubleLinePortion::PaintBracket( SwTextPaintInfo &rInf,
- long nSpaceAdd,
+ tools::Long nSpaceAdd,
bool bOpen ) const
{
sal_Unicode cCh = bOpen ? pBracket->cPre : pBracket->cPost;
@@ -479,7 +479,7 @@ void SwDoubleLinePortion::CalcBlanks( SwTextFormatInfo &rInf )
rInf.SetIdx( nStart );
}
-long SwDoubleLinePortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo & ) const
+tools::Long SwDoubleLinePortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo & ) const
{
return HasTabulator() ? 0 : sal_Int32(GetSpaceCnt()) * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
@@ -491,7 +491,7 @@ long SwDoubleLinePortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo & )
// contains no tabulator, it is necessary to create/manipulate the inner
// space arrays.
bool SwDoubleLinePortion::ChgSpaceAdd( SwLineLayout* pCurr,
- long nSpaceAdd ) const
+ tools::Long nSpaceAdd ) const
{
bool bRet = false;
if( !HasTabulator() && nSpaceAdd > 0 )
@@ -1413,14 +1413,14 @@ class SwSpaceManipulator
SwMultiPortion& rMulti;
std::vector<long>* pOldSpaceAdd;
sal_uInt16 nOldSpIdx;
- long nSpaceAdd;
+ tools::Long nSpaceAdd;
bool bSpaceChg;
sal_uInt8 nOldDir;
public:
SwSpaceManipulator( SwTextPaintInfo& rInf, SwMultiPortion& rMult );
~SwSpaceManipulator();
void SecondLine();
- long GetSpaceAdd() const { return nSpaceAdd; }
+ tools::Long GetSpaceAdd() const { return nSpaceAdd; }
};
}
@@ -2513,7 +2513,7 @@ SwTextCursorSave::SwTextCursorSave( SwTextCursor* pCursor,
SwTwips nY,
sal_uInt16& nX,
TextFrameIndex const nCurrStart,
- long nSpaceAdd )
+ tools::Long nSpaceAdd )
: pTextCursor(pCursor),
pCurr(pCursor->m_pCurr),
nStart(pCursor->m_nStart)
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index 8a0d352dfa9a..84ef2e314a65 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -137,8 +137,8 @@ public:
void ActualizeTabulator();
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
- virtual long CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
- virtual bool ChgSpaceAdd( SwLineLayout* pCurr, long nSpaceAdd ) const;
+ virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual bool ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const;
// Summarize the internal lines to calculate the (external) size
void CalcSize( SwTextFormatter& rLine, SwTextFormatInfo &rInf );
@@ -165,7 +165,7 @@ public:
SwBracket* GetBrackets() const { return pBracket.get(); }
void SetBrackets( const SwDoubleLinePortion& rDouble );
- void PaintBracket( SwTextPaintInfo& rInf, long nSpaceAdd, bool bOpen ) const;
+ void PaintBracket( SwTextPaintInfo& rInf, tools::Long nSpaceAdd, bool bOpen ) const;
void FormatBrackets( SwTextFormatInfo &rInf, SwTwips& nMaxWidth );
sal_uInt16 PreWidth() const { return pBracket->nPreWidth; };
sal_uInt16 PostWidth() const { return pBracket->nPostWidth; }
@@ -181,8 +181,8 @@ public:
TextFrameIndex GetSmallerSpaceCnt() const
{ return ( nLineDiff < 0 ) ? nBlank1 : nBlank2; }
- virtual long CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
- virtual bool ChgSpaceAdd( SwLineLayout* pCurr, long nSpaceAdd ) const override;
+ virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual bool ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const override;
};
class SwRubyPortion : public SwMultiPortion
@@ -225,9 +225,9 @@ public:
// Get number of blanks for justified alignment
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf) const;
// Calculates extra spacing based on number of blanks
- virtual long CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
// Manipulate the spacing array at pCurr
- virtual bool ChgSpaceAdd( SwLineLayout* pCurr, long nSpaceAdd ) const override;
+ virtual bool ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const override;
};
// For cursor travelling in multiportions
@@ -242,7 +242,7 @@ class SwTextCursorSave
bool bSpaceChg;
public:
SwTextCursorSave( SwTextCursor* pTextCursor, SwMultiPortion* pMulti,
- SwTwips nY, sal_uInt16& nX, TextFrameIndex nCurrStart, long nSpaceAdd);
+ SwTwips nY, sal_uInt16& nX, TextFrameIndex nCurrStart, tools::Long nSpaceAdd);
~SwTextCursorSave();
};
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index ec7d14e5e605..3d220f42cf2f 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -429,7 +429,7 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
break;
case SvxInterLineSpaceRule::Prop:
{
- long nTmp = rSpace.GetPropLineSpace();
+ tools::Long nTmp = rSpace.GetPropLineSpace();
if( nTmp < 50 )
nTmp = nTmp ? 50 : 100;
nTmp *= rRegDiff;
@@ -455,7 +455,7 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
}
}
}
- const long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
+ const tools::Long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
if ( aRectFnSet.IsVert() )
rRegStart -= nTmpDiff;
else
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 0959ef314948..9fbfcd7bb776 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -608,7 +608,7 @@ TextFrameIndex SwTextPortion::GetSpaceCnt(const SwTextSizeInfo &rInf,
return nCnt;
}
-long SwTextPortion::CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const
+tools::Long SwTextPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const
{
TextFrameIndex nCnt(0);
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 88e81a358e67..4d08f8dcbc48 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -39,7 +39,7 @@ public:
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override;
virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
- virtual long CalcSpacing( long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
// Counts the spaces for justified paragraph
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex& rCnt) const;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 38b6c8be3457..023ffee1b32a 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -69,8 +69,8 @@ class SwDropSave
SwTextPaintInfo* pInf;
sal_Int32 nIdx;
sal_Int32 nLen;
- long nX;
- long nY;
+ tools::Long nX;
+ tools::Long nY;
public:
explicit SwDropSave( const SwTextPaintInfo &rInf );
@@ -669,7 +669,7 @@ void SwTextPainter::PaintDropPortion()
// MarginPortion and Adjustment!
const SwLinePortion *pPor = m_pCurr->GetFirstPortion();
- long nX = 0;
+ tools::Long nX = 0;
while( pPor && !pPor->IsDropPortion() )
{
nX = nX + pPor->Width();
@@ -724,8 +724,8 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
TextFrameIndex nIdx = rInf.GetIdx();
OUString aStr(rInf.GetText().copy(sal_Int32(nIdx), sal_Int32(pCurrPart->GetLen())));
- long nDescent = 0;
- long nFactor = -1;
+ tools::Long nDescent = 0;
+ tools::Long nFactor = -1;
if ( bUseCache )
{
@@ -751,15 +751,15 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
nIndex %= DROP_CACHE_SIZE;
nTmpIdx = nIndex;
- long nWishedHeight = pDrop->GetDropHeight();
- long nAscent = 0;
+ tools::Long nWishedHeight = pDrop->GetDropHeight();
+ tools::Long nAscent = 0;
// find out biggest font size for initial scaling factor
- long nMaxFontHeight = 1;
+ tools::Long nMaxFontHeight = 1;
while ( pCurrPart )
{
const SwFont& rFnt = pCurrPart->GetFont();
- const long nCurrHeight = rFnt.GetHeight( rFnt.GetActual() );
+ const tools::Long nCurrHeight = rFnt.GetHeight( rFnt.GetActual() );
if ( nCurrHeight > nMaxFontHeight )
nMaxFontHeight = nCurrHeight;
@@ -781,8 +781,8 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
bool bGrow = (pDrop->GetLen() != TextFrameIndex(0));
// for growing control
- long nMax = USHRT_MAX;
- long nMin = 0;
+ tools::Long nMax = USHRT_MAX;
+ tools::Long nMin = 0;
#if OSL_DEBUG_LEVEL > 1
long nGrow = 0;
#endif
@@ -810,7 +810,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
SwFont& rFnt = pCurrPart->GetFont();
// Get height including proportion
- const long nCurrHeight = rFnt.GetHeight( rFnt.GetActual() );
+ const tools::Long nCurrHeight = rFnt.GetHeight( rFnt.GetActual() );
// Get without proportion
const sal_uInt8 nOldProp = rFnt.GetPropr();
@@ -917,7 +917,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
if ( nAscent < 0 )
nAscent = -nAscent;
- const long nHght = nAscent + nDescent;
+ const tools::Long nHght = nAscent + nDescent;
if ( nHght )
{
if ( nHght > nWishedHeight )
@@ -995,7 +995,7 @@ bool SwDropPortion::Format( SwTextFormatInfo &rInf )
// adjust font sizes to fit into the rectangle
pDropCapCache->CalcFontSize( this, rInf );
- const long nOldX = rInf.X();
+ const tools::Long nOldX = rInf.X();
{
SwDropSave aSave( rInf );
SwDropPortionPart* pCurrPart = pPart.get();
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 2d198d893d85..e4211667ba5b 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -610,8 +610,8 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con
rNumFormat.GetGraphicSize(),
bLeft, bCenter, nMinDist,
bLabelAlignmentPosAndSpaceModeActive );
- long nTmpA = rInf.GetLast()->GetAscent();
- long nTmpD = rInf.GetLast()->Height() - nTmpA;
+ tools::Long nTmpA = rInf.GetLast()->GetAscent();
+ tools::Long nTmpD = rInf.GetLast()->Height() - nTmpA;
if( !rInf.IsTest() )
static_cast<SwGrfNumPortion*>(pRet)->SetBase( nTmpA, nTmpD, nTmpA, nTmpD );
}
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 8556869c8726..b1f9333ba04a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -155,7 +155,7 @@ void ClrContourCache()
SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
const SwRect &rLine,
const SwTextFrame* pFrame,
- const long nXPos,
+ const tools::Long nXPos,
const bool bRight )
{
SwRect aRet;
@@ -202,7 +202,7 @@ SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
const SdrObject* pObj, const SwTextFrame* pFrame, const SwRect &rLine,
- const long nXPos, const bool bRight )
+ const tools::Long nXPos, const bool bRight )
{
SwRect aRet;
sal_uInt16 nPos = 0; // Search in the Cache
@@ -267,9 +267,9 @@ SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
mvItems.insert(mvItems.begin(), std::move(item));
}
SwRectFnSet aRectFnSet(pFrame);
- long nTmpTop = aRectFnSet.GetTop(rLine);
+ tools::Long nTmpTop = aRectFnSet.GetTop(rLine);
// fnGetBottom is top + height
- long nTmpBottom = aRectFnSet.GetBottom(rLine);
+ tools::Long nTmpBottom = aRectFnSet.GetBottom(rLine);
Range aRange( std::min( nTmpTop, nTmpBottom ), std::max( nTmpTop, nTmpBottom ) );
@@ -867,8 +867,8 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
// Make ourselves a little smaller than we are,
// so that 1-Twip-overlappings are ignored (#49532)
SwRectFnSet aRectFnSet(m_pCurrFrame);
- const long nRight = aRectFnSet.GetRight(aRect) - 1;
- const long nLeft = aRectFnSet.GetLeft(aRect) + 1;
+ const tools::Long nRight = aRectFnSet.GetRight(aRect) - 1;
+ const tools::Long nLeft = aRectFnSet.GetLeft(aRect) + 1;
const bool bR2L = m_pCurrFrame->IsRightToLeft();
const IDocumentDrawModelAccess& rIDDMA = m_pCurrFrame->GetDoc().getIDocumentDrawModelAccess();
@@ -1162,7 +1162,7 @@ void SwTextFly::CalcRightMargin( SwRect &rFly,
// Especially in HTML documents there are often (dummy) paragraphs in
// 2 pt font, and they used to only evade big frames after huge numbers
// of empty lines.
- const long nTmpTop = aRectFnSet.GetTop(aTmp);
+ const tools::Long nTmpTop = aRectFnSet.GetTop(aTmp);
if( aRectFnSet.YDiff( nTmpTop, aRectFnSet.GetTop(aLine) ) > 0 )
{
if( aRectFnSet.YDiff( m_nNextTop, nTmpTop ) > 0 )
@@ -1264,7 +1264,7 @@ SwRect SwTextFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
{
SwRectFnSet aRectFnSet(m_pCurrFrame);
- const long nXPos = m_pCurrFrame->IsRightToLeft() ?
+ const tools::Long nXPos = m_pCurrFrame->IsRightToLeft() ?
rLine.Right() :
aRectFnSet.GetLeft(rLine);
@@ -1358,18 +1358,18 @@ css::text::WrapTextMode SwTextFly::GetSurroundForTextWrap( const SwAnchoredObjec
if ( css::text::WrapTextMode_DYNAMIC == eSurroundForTextWrap )
{
SwRectFnSet aRectFnSet(m_pCurrFrame);
- const long nCurrLeft = aRectFnSet.GetPrtLeft(*m_pCurrFrame);
- const long nCurrRight = aRectFnSet.GetPrtRight(*m_pCurrFrame);
+ const tools::Long nCurrLeft = aRectFnSet.GetPrtLeft(*m_pCurrFrame);
+ const tools::Long nCurrRight = aRectFnSet.GetPrtRight(*m_pCurrFrame);
const SwRect& aRect( pAnchoredObj->GetObjRectWithSpaces() );
- long nFlyLeft = aRectFnSet.GetLeft(aRect);
- long nFlyRight = aRectFnSet.GetRight(aRect);
+ tools::Long nFlyLeft = aRectFnSet.GetLeft(aRect);
+ tools::Long nFlyRight = aRectFnSet.GetRight(aRect);
if ( nFlyRight < nCurrLeft || nFlyLeft > nCurrRight )
eSurroundForTextWrap = css::text::WrapTextMode_PARALLEL;
else
{
- long nLeft = nFlyLeft - nCurrLeft;
- long nRight = nCurrRight - nFlyRight;
+ tools::Long nLeft = nFlyLeft - nCurrLeft;
+ tools::Long nRight = nCurrRight - nFlyRight;
if( nFlyRight - nFlyLeft > FRAME_MAX )
{
if( nLeft < nRight )
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index ed04a3e42c47..b9dfd52fa9cb 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -422,7 +422,7 @@ void SwTextFrame::SwapWidthAndHeight()
if ( ! mbIsSwapped )
{
- const long nPrtOfstX = aPrt.Pos().X();
+ const tools::Long nPrtOfstX = aPrt.Pos().X();
aPrt.Pos().setX( aPrt.Pos().Y() );
if( IsVertLR() )
@@ -436,7 +436,7 @@ void SwTextFrame::SwapWidthAndHeight()
}
else
{
- const long nPrtOfstY = aPrt.Pos().Y();
+ const tools::Long nPrtOfstY = aPrt.Pos().Y();
aPrt.Pos().setY( aPrt.Pos().X() );
if( IsVertLR() )
@@ -449,13 +449,13 @@ void SwTextFrame::SwapWidthAndHeight()
}
}
- const long nPrtWidth = aPrt.Width();
+ const tools::Long nPrtWidth = aPrt.Width();
aPrt.Width( aPrt.Height() );
aPrt.Height( nPrtWidth );
}
{
- const long nFrameWidth = getFrameArea().Width();
+ const tools::Long nFrameWidth = getFrameArea().Width();
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
aFrm.Width( aFrm.Height() );
aFrm.Height( nFrameWidth );
@@ -471,7 +471,7 @@ void SwTextFrame::SwapWidthAndHeight()
void SwTextFrame::SwitchHorizontalToVertical( SwRect& rRect ) const
{
// calc offset inside frame
- long nOfstX, nOfstY;
+ tools::Long nOfstX, nOfstY;
if ( IsVertLR() )
{
if (IsVertLRBT())
@@ -493,8 +493,8 @@ void SwTextFrame::SwitchHorizontalToVertical( SwRect& rRect ) const
nOfstY = rRect.Top() + rRect.Height() - getFrameArea().Top();
}
- const long nWidth = rRect.Width();
- const long nHeight = rRect.Height();
+ const tools::Long nWidth = rRect.Width();
+ const tools::Long nHeight = rRect.Height();
if ( IsVertLR() )
{
@@ -544,8 +544,8 @@ void SwTextFrame::SwitchHorizontalToVertical( Point& rPoint ) const
}
// calc offset inside frame
- const long nOfstX = rPoint.X() - getFrameArea().Left();
- const long nOfstY = rPoint.Y() - getFrameArea().Top();
+ const tools::Long nOfstX = rPoint.X() - getFrameArea().Left();
+ const tools::Long nOfstY = rPoint.Y() - getFrameArea().Top();
if ( IsVertLR() )
rPoint.setX( getFrameArea().Left() + nOfstY );
else
@@ -564,7 +564,7 @@ void SwTextFrame::SwitchHorizontalToVertical( Point& rPoint ) const
* Calculates the a limit value when switching from
* horizontal to vertical layout.
*/
-long SwTextFrame::SwitchHorizontalToVertical( long nLimit ) const
+tools::Long SwTextFrame::SwitchHorizontalToVertical( tools::Long nLimit ) const
{
Point aTmp( 0, nLimit );
SwitchHorizontalToVertical( aTmp );
@@ -577,7 +577,7 @@ long SwTextFrame::SwitchHorizontalToVertical( long nLimit ) const
*/
void SwTextFrame::SwitchVerticalToHorizontal( SwRect& rRect ) const
{
- long nOfstX;
+ tools::Long nOfstX;
// calc offset inside frame
if ( IsVertLR() )
@@ -590,7 +590,7 @@ void SwTextFrame::SwitchVerticalToHorizontal( SwRect& rRect ) const
nOfstX = getFrameArea().Left() + getFrameArea().Width() - ( rRect.Left() + rRect.Width() );
}
- long nOfstY;
+ tools::Long nOfstY;
if (IsVertLRBT())
{
// Note that mbIsSwapped only affects the frame area, not rRect, so rRect.Height() is used
@@ -602,8 +602,8 @@ void SwTextFrame::SwitchVerticalToHorizontal( SwRect& rRect ) const
}
else
nOfstY = rRect.Top() - getFrameArea().Top();
- const long nWidth = rRect.Height();
- const long nHeight = rRect.Width();
+ const tools::Long nWidth = rRect.Height();
+ const tools::Long nHeight = rRect.Width();
// calc rotated coords
rRect.Left( getFrameArea().Left() + nOfstY );
@@ -618,7 +618,7 @@ void SwTextFrame::SwitchVerticalToHorizontal( SwRect& rRect ) const
*/
void SwTextFrame::SwitchVerticalToHorizontal( Point& rPoint ) const
{
- long nOfstX;
+ tools::Long nOfstX;
// calc offset inside frame
if ( IsVertLR() )
@@ -633,7 +633,7 @@ void SwTextFrame::SwitchVerticalToHorizontal( Point& rPoint ) const
nOfstX = getFrameArea().Left() + getFrameArea().Width() - rPoint.X();
}
- long nOfstY;
+ tools::Long nOfstY;
if (IsVertLRBT())
{
// Y offset is bottom - Y.
@@ -655,7 +655,7 @@ void SwTextFrame::SwitchVerticalToHorizontal( Point& rPoint ) const
* Calculates the a limit value when switching from
* vertical to horizontal layout.
*/
-long SwTextFrame::SwitchVerticalToHorizontal( long nLimit ) const
+tools::Long SwTextFrame::SwitchVerticalToHorizontal( tools::Long nLimit ) const
{
Point aTmp( nLimit, 0 );
SwitchVerticalToHorizontal( aTmp );
@@ -682,7 +682,7 @@ void SwTextFrame::SwitchLTRtoRTL( SwRect& rRect ) const
{
SwSwapIfNotSwapped swap(const_cast<SwTextFrame *>(this));
- long nWidth = rRect.Width();
+ tools::Long nWidth = rRect.Width();
rRect.Left( 2 * ( getFrameArea().Left() + getFramePrintArea().Left() ) +
getFramePrintArea().Width() - rRect.Right() - 1 );
@@ -1674,13 +1674,13 @@ bool SwTextFrame::IsIdxInside(TextFrameIndex const nPos, TextFrameIndex const nL
return pPara && ( nPos <= nMax + pPara->GetLen() );
}
-inline void SwTextFrame::InvalidateRange(const SwCharRange &aRange, const long nD)
+inline void SwTextFrame::InvalidateRange(const SwCharRange &aRange, const tools::Long nD)
{
if ( IsIdxInside( aRange.Start(), aRange.Len() ) )
InvalidateRange_( aRange, nD );
}
-void SwTextFrame::InvalidateRange_( const SwCharRange &aRange, const long nD)
+void SwTextFrame::InvalidateRange_( const SwCharRange &aRange, const tools::Long nD)
{
if ( !HasPara() )
{ InvalidateSize();
@@ -2104,7 +2104,7 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
&& m_pMergedPara->pFirstNode->GetIndex() <= pMoveText->pDestNode->GetIndex()
&& pMoveText->pDestNode->GetIndex() <= m_pMergedPara->pLastNode->GetIndex())
{ // if it's not 2 nodes in merged frame, assume the target node doesn't have frames at all
- assert(std::abs(static_cast<long>(rNode.GetIndex()) - static_cast<long>(pMoveText->pDestNode->GetIndex())) == 1);
+ assert(std::abs(static_cast<tools::Long>(rNode.GetIndex()) - static_cast<tools::Long>(pMoveText->pDestNode->GetIndex())) == 1);
UpdateMergedParaForMove(*m_pMergedPara,
*this,
bRecalcFootnoteFlag,
@@ -3674,9 +3674,9 @@ void SwTextFrame::CalcHeightOfLastLine( const bool _bUseFont )
* value of a proportional line spacing is
* returned or not
*/
-long SwTextFrame::GetLineSpace( const bool _bNoPropLineSpace ) const
+tools::Long SwTextFrame::GetLineSpace( const bool _bNoPropLineSpace ) const
{
- long nRet = 0;
+ tools::Long nRet = 0;
const SvxLineSpacingItem &rSpace = GetTextNodeForParaProps()->GetSwAttrSet().GetLineSpacing();
@@ -3693,7 +3693,7 @@ long SwTextFrame::GetLineSpace( const bool _bNoPropLineSpace ) const
// - compatibility to MS Word
nRet = GetHeightOfLastLine();
- long nTmp = nRet;
+ tools::Long nTmp = nRet;
nTmp *= rSpace.GetPropLineSpace();
nTmp /= 100;
nTmp -= nRet;
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 05f71a25bf74..1d340d4a2d81 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -689,7 +689,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
SwFrame *pCont = pFootnoteFrame->GetUpper();
SwRectFnSet aRectFnSet(pCont);
- long nDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->getFrameArea()),
+ tools::Long nDiff = aRectFnSet.YDiff( aRectFnSet.GetTop(pCont->getFrameArea()),
nDeadLine );
if( nDiff >= 0 )
@@ -883,7 +883,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf,
SwRectFnSet aRectFnSet(pFootnoteCont);
- const long nDiff = aRectFnSet.YDiff(
+ const tools::Long nDiff = aRectFnSet.YDiff(
aRectFnSet.GetTop(pFootnoteCont->getFrameArea()),
nTmpBot );
@@ -1172,7 +1172,7 @@ TextFrameIndex SwTextFormatter::FormatQuoVadis(TextFrameIndex const nOffset)
case SvxAdjust::Center:
{
nQuoWidth = nQuoWidth + pQuo->GetAscent();
- long nDiff = nLastLeft - nQuoWidth;
+ tools::Long nDiff = nLastLeft - nQuoWidth;
if( nDiff < 0 )
{
nLastLeft = pQuo->GetAscent();
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 02d948c795cf..273dd5b688c1 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -184,7 +184,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
// - the determined next tab stop is a default tab stop position OR
// the determined next tab stop is beyond the left margin
{
- long nLeftMarginTabPos = 0;
+ tools::Long nLeftMarginTabPos = 0;
{
if ( !bTabsRelativeToIndent )
{
diff --git a/sw/source/core/tox/ToxTabStopTokenHandler.cxx b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
index e54271c9dd82..685a8f173d66 100644
--- a/sw/source/core/tox/ToxTabStopTokenHandler.cxx
+++ b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
@@ -52,7 +52,7 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken(
if (SvxTabAdjust::End > aToken.eTabAlign) {
const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( targetNode.SwContentNode::GetAttr(RES_LR_SPACE) );
- long nTabPosition = aToken.nTabStopPosition;
+ tools::Long nTabPosition = aToken.nTabStopPosition;
if (!mTabPositionIsRelativeToParagraphIndent && rLR.GetTextLeft()) {
nTabPosition -= rLR.GetTextLeft();
}
@@ -64,7 +64,7 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken(
if (CanUseLayoutRectangle(targetNode, currentLayout)) {
aNdRect = targetNode.FindLayoutRect(true);
}
- long nRightMargin;
+ tools::Long nRightMargin;
if (aNdRect.IsEmpty()) {
nRightMargin = CalculatePageMarginFromPageDescription(targetNode);
} else {
@@ -82,7 +82,7 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken(
return result;
}
-long
+tools::Long
DefaultToxTabStopTokenHandler::CalculatePageMarginFromPageDescription(const SwTextNode& targetNode) const
{
size_t nPgDescNdIdx = targetNode.GetIndex() + 1;
@@ -93,7 +93,7 @@ DefaultToxTabStopTokenHandler::CalculatePageMarginFromPageDescription(const SwTe
pPageDesc = &mDefaultPageDescription;
}
const SwFrameFormat& rPgDscFormat = pPageDesc->GetMaster();
- long result = rPgDscFormat.GetFrameSize().GetWidth() - rPgDscFormat.GetLRSpace().GetLeft()
+ tools::Long result = rPgDscFormat.GetFrameSize().GetWidth() - rPgDscFormat.GetLRSpace().GetLeft()
- rPgDscFormat.GetLRSpace().GetRight();
// Also consider borders
const SvxBoxItem& rBox = rPgDscFormat.GetBox();
diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx
index 058d83b8db79..b318b54c182a 100644
--- a/sw/source/core/tox/toxhlp.cxx
+++ b/sw/source/core/tox/toxhlp.cxx
@@ -85,7 +85,7 @@ css::uno::Sequence< OUString > IndexEntrySupplierWrapper::GetAlgorithmList( cons
bool IndexEntrySupplierWrapper::LoadAlgorithm(
const css::lang::Locale& rLcl,
- const OUString& sSortAlgorithm, long nOptions ) const
+ const OUString& sSortAlgorithm, tools::Long nOptions ) const
{
bool bRet = false;
try {
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index b55821032936..16b88d3fef39 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -67,14 +67,14 @@ SwFntObj *pLastFont = nullptr;
constexpr Color gWaveCol(COL_GRAY);
-long SwFntObj::nPixWidth;
+tools::Long SwFntObj::nPixWidth;
MapMode* SwFntObj::pPixMap = nullptr;
static vcl::DeleteOnDeinit< VclPtr<OutputDevice> > s_pFntObjPixOut( new VclPtr<OutputDevice> );
namespace
{
-long EvalGridWidthAdd( const SwTextGridItem *const pGrid, const SwDrawTextInfo &rInf )
+tools::Long EvalGridWidthAdd( const SwTextGridItem *const pGrid, const SwDrawTextInfo &rInf )
{
SwDocShell* pDocShell = rInf.GetShell()->GetDoc()->GetDocShell();
SfxStyleSheetBasePool* pBasePool = pDocShell->GetStyleSheetPool();
@@ -86,7 +86,7 @@ long EvalGridWidthAdd( const SwTextGridItem *const pGrid, const SwDrawTextInfo &
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
const sal_uInt32 nFontHeight = aDefaultFontItem.GetHeight();
- const long nGridWidthAdd = nGridWidth > nFontHeight ? nGridWidth - nFontHeight : 0;
+ const tools::Long nGridWidthAdd = nGridWidth > nFontHeight ? nGridWidth - nFontHeight : 0;
if( SwFontScript::Latin == rInf.GetFont()->GetActual() )
return nGridWidthAdd / 2;
@@ -252,13 +252,13 @@ struct CalcLinePosData
const bool bSwitchH2V;
const bool bSwitchH2VLRBT;
const bool bSwitchL2R;
- long nHalfSpace;
- long* pKernArray;
+ tools::Long nHalfSpace;
+ tools::Long* pKernArray;
const bool bBidiPor;
CalcLinePosData( SwDrawTextInfo& _rInf, vcl::Font& _rFont,
TextFrameIndex const _nCnt, const bool _bSwitchH2V, const bool _bSwitchH2VLRBT, const bool _bSwitchL2R,
- long _nHalfSpace, long* _pKernArray, const bool _bBidiPor) :
+ tools::Long _nHalfSpace, tools::Long* _pKernArray, const bool _bBidiPor) :
rInf( _rInf ),
rFont( _rFont ),
nCnt( _nCnt ),
@@ -279,9 +279,9 @@ struct CalcLinePosData
static void lcl_calcLinePos( const CalcLinePosData &rData,
Point &rStart, Point &rEnd, TextFrameIndex const nStart, TextFrameIndex const nWrLen)
{
- long nBlank = 0;
+ tools::Long nBlank = 0;
const TextFrameIndex nEnd = nStart + nWrLen;
- const long nTmpSpaceAdd = rData.rInf.GetSpace() / SPACING_PRECISION_FACTOR;
+ const tools::Long nTmpSpaceAdd = rData.rInf.GetSpace() / SPACING_PRECISION_FACTOR;
if ( nEnd < rData.nCnt
&& CH_BLANK == rData.rInf.GetText()[sal_Int32(rData.rInf.GetIdx() + nEnd)] )
@@ -399,7 +399,7 @@ sal_uInt16 SwFntObj::GetFontHeight( const SwViewShell* pSh, const OutputDevice&
#if OSL_DEBUG_LEVEL > 0
// Check if vcl did not change the meaning of GetTextHeight
const FontMetric aOutMet( rRefDev.GetFontMetric() );
- long nTmpPrtHeight = static_cast<sal_uInt16>(aOutMet.GetAscent()) + aOutMet.GetDescent();
+ tools::Long nTmpPrtHeight = static_cast<sal_uInt16>(aOutMet.GetAscent()) + aOutMet.GetDescent();
// #i106098#: do not compare with == here due to rounding error
OSL_ENSURE( std::abs(nTmpPrtHeight - m_nPrtHeight) < 3,
"GetTextHeight != Ascent + Descent" );
@@ -538,12 +538,12 @@ void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
// In case the zoom factor of the output device differs from the
// one in the ViewOptions, this Font must not be cached,
// hence set zoom factor to an invalid value
- long nTmp;
+ tools::Long nTmp;
if( pOut->GetMapMode().GetScaleX().IsValid() &&
pOut->GetMapMode().GetScaleY().IsValid() &&
pOut->GetMapMode().GetScaleX() == pOut->GetMapMode().GetScaleY() )
{
- nTmp = long(100 * pOut->GetMapMode().GetScaleX());
+ nTmp = tools::Long(100 * pOut->GetMapMode().GetScaleX());
}
else
nTmp = 0;
@@ -694,8 +694,8 @@ static sal_uInt8 lcl_WhichPunctuation( sal_Unicode cChar )
static bool lcl_IsMonoSpaceFont( const vcl::RenderContext& rOut )
{
- const long nWidth1 = rOut.GetTextWidth( OUString( u'\x3008' ) );
- const long nWidth2 = rOut.GetTextWidth( OUString( u'\x307C' ) );
+ const tools::Long nWidth1 = rOut.GetTextWidth( OUString( u'\x3008' ) );
+ const tools::Long nWidth2 = rOut.GetTextWidth( OUString( u'\x307C' ) );
return nWidth1 == nWidth2;
}
@@ -728,7 +728,7 @@ static void lcl_DrawLineForWrongListData(
return;
}
- long nHght = rInf.GetOut().LogicToPixel( rPrtFontSize ).Height();
+ tools::Long nHght = rInf.GetOut().LogicToPixel( rPrtFontSize ).Height();
// Draw wavy lines for spell and grammar errors only if font is large enough.
// Lines for smart tags will always be drawn.
@@ -1022,7 +1022,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// multiple this ratio to give the new avg width - which in this case
// gives a new grid width unit size
- long nAvgWidthPerChar = pKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen());
+ tools::Long nAvgWidthPerChar = pKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen());
const sal_uLong nRatioAvgWidthCharToGridWidth = nAvgWidthPerChar ?
( nAvgWidthPerChar - 1 ) / nGridWidth + 1:
@@ -1031,10 +1031,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
nAvgWidthPerChar = nRatioAvgWidthCharToGridWidth * nGridWidth;
// the absolute end position of the first character is also its width
- long nCharWidth = pKernArray[ 0 ];
+ tools::Long nCharWidth = pKernArray[ 0 ];
sal_uLong nHalfWidth = nAvgWidthPerChar / 2;
- long nNextFix=0;
+ tools::Long nNextFix=0;
// we work out the start position (origin) of the first character,
// and we set the next "fix" offset to half the width of the char.
@@ -1066,7 +1066,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// calculate offsets
for (sal_Int32 j = 1; j < sal_Int32(rInf.GetLen()); ++j)
{
- long nCurrentCharWidth = pKernArray[ j ] - pKernArray[ j - 1 ];
+ tools::Long nCurrentCharWidth = pKernArray[ j ] - pKernArray[ j - 1 ];
nNextFix += nAvgWidthPerChar;
// almost the same as getting the offset for the first character:
@@ -1113,7 +1113,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// ASIAN LINE AND CHARACTER GRID MODE - do not snap to characters
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
+ const tools::Long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
std::unique_ptr<long[]> pKernArray(new long[sal_Int32(rInf.GetLen())]);
@@ -1127,7 +1127,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos );
if ( rInf.GetSpace() || rInf.GetKanaComp())
{
- long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
+ tools::Long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
if ( rInf.GetFont() && rInf.GetLen() )
{
bool bSpecialJust = false;
@@ -1148,7 +1148,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
LanguageType aLang = rInf.GetFont()->GetLanguage( SwFontScript::CJK );
if (!MsLangId::isKorean(aLang))
{
- long nSpaceSum = nSpaceAdd;
+ tools::Long nSpaceSum = nSpaceAdd;
for (sal_Int32 nI = 0; nI < sal_Int32(rInf.GetLen()); ++nI)
{
pKernArray[ nI ] += nSpaceSum;
@@ -1158,12 +1158,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
nSpaceAdd = 0;
}
}
- long nGridAddSum = nGridWidthAdd;
+ tools::Long nGridAddSum = nGridWidthAdd;
for (sal_Int32 i = 0; i < sal_Int32(rInf.GetLen()); i++, nGridAddSum += nGridWidthAdd )
{
pKernArray[i] += nGridAddSum;
}
- long nKernSum = rInf.GetKern();
+ tools::Long nKernSum = rInf.GetKern();
if ( bSpecialJust || rInf.GetKern() )
{
for (sal_Int32 i = 0; i < sal_Int32(rInf.GetLen()); i++, nKernSum += rInf.GetKern())
@@ -1203,7 +1203,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
else
{
sal_Int32 i;
- long nSpaceSum = 0;
+ tools::Long nSpaceSum = 0;
for (i = 0; i < sal_Int32(rInf.GetLen()); i++)
{
if(CH_BLANK == rInf.GetText()[sal_Int32(rInf.GetIdx()) + i])
@@ -1222,8 +1222,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
else
{
//long nKernAdd = rInf.GetKern();
- long nKernAdd = 0;
- long nGridAddSum = nGridWidthAdd + nKernAdd;
+ tools::Long nKernAdd = 0;
+ tools::Long nGridAddSum = nGridWidthAdd + nKernAdd;
for (sal_Int32 i = 0; i < sal_Int32(rInf.GetLen());
i++, nGridAddSum += nGridWidthAdd + nKernAdd)
{
@@ -1264,10 +1264,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if( bStretch )
{
sal_Int32 nZwi = sal_Int32(rInf.GetLen()) - 1;
- long nDiff = rInf.GetWidth() - pKernArray[ nZwi ]
+ tools::Long nDiff = rInf.GetWidth() - pKernArray[ nZwi ]
- sal_Int32(rInf.GetLen()) * rInf.GetKern();
- long nRest = nDiff % nZwi;
- long nAdd;
+ tools::Long nRest = nDiff % nZwi;
+ tools::Long nAdd;
if( nRest < 0 )
{
nAdd = -1;
@@ -1279,7 +1279,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
nRest = nZwi - nRest;
}
nDiff /= nZwi;
- long nSum = nDiff;
+ tools::Long nSum = nDiff;
for( sal_Int32 i = 0; i < nZwi; )
{
pKernArray[ i ] += nSum;
@@ -1291,7 +1291,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// Modify Array for special justifications
- long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
+ tools::Long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
bool bSpecialJust = false;
if ( rInf.GetFont() && rInf.GetLen() )
@@ -1361,7 +1361,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
}
- long nKernSum = rInf.GetKern();
+ tools::Long nKernSum = rInf.GetKern();
if ( bStretch || m_bPaintBlank || rInf.GetKern() || bSpecialJust )
{
@@ -1424,7 +1424,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
else if( bStretch )
{
- long nTmpWidth = rInf.GetWidth();
+ tools::Long nTmpWidth = rInf.GetWidth();
if( rInf.GetKern() && rInf.GetLen() && nTmpWidth > rInf.GetKern() )
nTmpWidth -= rInf.GetKern();
rInf.GetOut().DrawStretchText( aTextOriginPos, nTmpWidth,
@@ -1433,7 +1433,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
else if( rInf.GetKern() )
{
- const long nTmpWidth = GetTextSize( rInf ).Width();
+ const tools::Long nTmpWidth = GetTextSize( rInf ).Width();
const Color aSaveColor( pTmpFont->GetColor() );
const bool bColorChanged = rInf.ApplyAutoColor( pTmpFont );
@@ -1467,7 +1467,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
bBullet = false;
std::unique_ptr<long[]> pKernArray(new long[sal_Int32(rInf.GetLen())]);
CreateScrFont( *rInf.GetShell(), rInf.GetOut() );
- long nScrPos;
+ tools::Long nScrPos;
// get screen array
std::unique_ptr<long[]> pScrArray(new long[sal_Int32(rInf.GetLen())]);
@@ -1499,7 +1499,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// Modify Printer and ScreenArrays for special justifications
- long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
+ tools::Long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
bool bNoHalfSpace = false;
if ( rInf.GetFont() && rInf.GetLen() )
@@ -1616,7 +1616,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
else
nCnt = nCnt - rInf.GetIdx();
nCnt = std::min(nCnt, rInf.GetLen());
- long nKernSum = rInf.GetKern();
+ tools::Long nKernSum = rInf.GetKern();
sal_Unicode cChPrev = rInf.GetText()[sal_Int32(rInf.GetIdx())];
// In case of a single underlined space in justified text,
@@ -1658,10 +1658,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// A Space at the beginning or end of the text must be positioned
// before (resp. after) the whole intermediate space, otherwise
// the underline/strike-through would have gaps.
- long nSpaceSum = 0;
+ tools::Long nSpaceSum = 0;
// in word line mode and for Arabic, we disable the half space trick:
- const long nHalfSpace = m_pPrtFont->IsWordLineMode() || bNoHalfSpace ? 0 : nSpaceAdd / 2;
- const long nOtherHalf = nSpaceAdd - nHalfSpace;
+ const tools::Long nHalfSpace = m_pPrtFont->IsWordLineMode() || bNoHalfSpace ? 0 : nSpaceAdd / 2;
+ const tools::Long nOtherHalf = nSpaceAdd - nHalfSpace;
if ( nSpaceAdd && ( cChPrev == CH_BLANK ) )
nSpaceSum = nHalfSpace;
for (sal_Int32 i = 1; i < sal_Int32(nCnt); ++i, nKernSum += rInf.GetKern())
@@ -1669,7 +1669,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
nCh = rInf.GetText()[sal_Int32(rInf.GetIdx()) + i];
OSL_ENSURE( pScrArray, "Where is the screen array?" );
- long nScr;
+ tools::Long nScr;
nScr = pScrArray[ i ] - pScrArray[ i - 1 ];
// If there is an (ex-)Space before us, position optimally,
@@ -1720,7 +1720,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
if( rInf.GetLen() )
{
- long nHght = rInf.GetOut().LogicToPixel(
+ tools::Long nHght = rInf.GetOut().LogicToPixel(
m_pPrtFont->GetFontSize() ).Height();
if( WRONG_SHOW_MIN < nHght )
{
@@ -1733,7 +1733,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
rInf.GetOut().SetLineColor( gWaveCol );
Point aEnd;
- long nKernVal = pKernArray[sal_Int32(rInf.GetLen()) - 1];
+ tools::Long nKernVal = pKernArray[sal_Int32(rInf.GetLen()) - 1];
const sal_uInt16 nDir = bBidiPor
? 1800
@@ -1843,10 +1843,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
pTmpFont->SetOverline(LINESTYLE_NONE);
pTmpFont->SetStrikeout(STRIKEOUT_NONE);
rInf.GetOut().SetFont( *pTmpFont );
- long nShift = rInf.GetOut( ).GetFontMetric( ).GetBulletOffset( );
+ tools::Long nShift = rInf.GetOut( ).GetFontMetric( ).GetBulletOffset( );
if ( nShift )
{
- long nAdd = 0;
+ tools::Long nAdd = 0;
if (aBulletOverlay.getLength() > nTmpIdx &&
aBulletOverlay[ nTmpIdx ] == CH_BULLET )
@@ -1922,7 +1922,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
aTextSize.setHeight( pOutDev->GetTextHeight() +
GetFontLeading( rInf.GetShell(), rInf.GetOut() ) );
- long nAvgWidthPerChar = aTextSize.Width() / sal_Int32(nLn);
+ tools::Long nAvgWidthPerChar = aTextSize.Width() / sal_Int32(nLn);
const sal_uLong i = nAvgWidthPerChar ?
( nAvgWidthPerChar - 1 ) / nGridWidth + 1:
@@ -1940,7 +1940,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetFrame()->FindPageFrame()));
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
+ const tools::Long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
OutputDevice* pOutDev;
if ( m_pPrinter )
{
@@ -1986,7 +1986,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
CreateScrFont( *rInf.GetShell(), rInf.GetOut() );
if( !GetScrFont()->IsSameInstance( rInf.GetOut().GetFont() ) )
rInf.GetOut().SetFont( *m_pScrFont );
- long nScrPos;
+ tools::Long nScrPos;
m_pPrinter->GetTextArray(rInf.GetText(), pKernArray.get(),
sal_Int32(rInf.GetIdx()), sal_Int32(nLn));
@@ -2022,7 +2022,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
for (sal_Int32 i = 1; i < sal_Int32(nCnt); i++)
{
nCh = rInf.GetText()[ sal_Int32(rInf.GetIdx()) + i ];
- long nScr;
+ tools::Long nScr;
nScr = pScrArray[ i ] - pScrArray[ i - 1 ];
if ( nCh == CH_BLANK )
nScrPos = pKernArray[i-1]+nScr;
@@ -2083,9 +2083,9 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
{
- long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
- const long nSperren = -rInf.GetSperren() / SPACING_PRECISION_FACTOR;
- long nKern = rInf.GetKern();
+ tools::Long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
+ const tools::Long nSperren = -rInf.GetSperren() / SPACING_PRECISION_FACTOR;
+ tools::Long nKern = rInf.GetKern();
if( 0 != nSperren )
nKern -= nSperren;
@@ -2167,11 +2167,11 @@ TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
}
}
- long nLeft = 0;
- long nRight = 0;
+ tools::Long nLeft = 0;
+ tools::Long nRight = 0;
TextFrameIndex nCnt(0);
- long nSpaceSum = 0;
- long nKernSum = 0;
+ tools::Long nSpaceSum = 0;
+ tools::Long nKernSum = 0;
if ( rInf.GetFrame() && rInf.GetLen() && rInf.SnapToGrid() &&
rInf.GetFont() && SwFontScript::CJK == rInf.GetFont()->GetActual() )
@@ -2182,7 +2182,7 @@ TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
- long nAvgWidthPerChar = pKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen());
+ tools::Long nAvgWidthPerChar = pKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen());
sal_uLong i = nAvgWidthPerChar ?
( nAvgWidthPerChar - 1 ) / nGridWidth + 1:
@@ -2206,11 +2206,11 @@ TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
+ const tools::Long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
for (TextFrameIndex j(0); j < rInf.GetLen(); j++)
{
- long nScr = pKernArray[sal_Int32(j)] + (nSpaceAdd + nGridWidthAdd) * (sal_Int32(j) + 1);
+ tools::Long nScr = pKernArray[sal_Int32(j)] + (nSpaceAdd + nGridWidthAdd) * (sal_Int32(j) + 1);
if( nScr >= rInf.GetOffset())
{
nCnt = j;
@@ -2230,7 +2230,7 @@ TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
// skip character cells for all script types
LanguageType aLang = rInf.GetFont()->GetLanguage();
- while ( ( nRight < long( rInf.GetOffset() ) ) && ( nIdx < nEnd ) )
+ while ( ( nRight < tools::Long( rInf.GetOffset() ) ) && ( nIdx < nEnd ) )
{
if (nSpaceAdd && CH_BLANK == rInf.GetText()[ sal_Int32(nIdx)])
nSpaceSum += nSpaceAdd;
@@ -2255,7 +2255,7 @@ TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
// or if we do not want to go to the next character
if ( nIdx > rInf.GetIdx() &&
( rInf.IsPosMatchesBounds() ||
- ( ( nRight > long( rInf.GetOffset() ) ) &&
+ ( ( nRight > tools::Long( rInf.GetOffset() ) ) &&
( nRight - rInf.GetOffset() > rInf.GetOffset() - nLeft ) ) ) )
nCnt = nLastIdx - rInf.GetIdx(); // first half
else
@@ -2379,7 +2379,7 @@ SwCacheObj *SwFntAccess::NewObj( )
return new SwFntObj( *static_cast<SwSubFont const *>(m_pOwner), ++fontCacheIdCounter, m_pShell );
}
-TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth)
+TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, tools::Long nTextWidth)
{
ChgFnt( rInf.GetShell(), rInf.GetOut() );
@@ -2393,7 +2393,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth
CountCompChg()), "Compression without info" );
TextFrameIndex nTextBreak(0);
- long nKern = 0;
+ tools::Long nKern = 0;
TextFrameIndex nLn = rInf.GetLen() == TextFrameIndex(COMPLETE_STRING)
? TextFrameIndex(rInf.GetText().getLength()) : rInf.GetLen();
@@ -2411,14 +2411,14 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray.get(),
sal_Int32(rInf.GetIdx()), sal_Int32(rInf.GetLen()));
- long nAvgWidthPerChar = pKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen());
+ tools::Long nAvgWidthPerChar = pKernArray[sal_Int32(rInf.GetLen()) - 1] / sal_Int32(rInf.GetLen());
const sal_uLong i = nAvgWidthPerChar ?
( nAvgWidthPerChar - 1 ) / nGridWidth + 1:
1;
nAvgWidthPerChar = i * nGridWidth;
- long nCurrPos = nAvgWidthPerChar;
+ tools::Long nCurrPos = nAvgWidthPerChar;
while( nTextBreak < rInf.GetLen() && nTextWidth >= nCurrPos )
{
@@ -2436,12 +2436,12 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetFrame()->FindPageFrame()));
if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && !pGrid->IsSnapToChars() )
{
- const long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
+ const tools::Long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
std::unique_ptr<long[]> pKernArray(new long[sal_Int32(rInf.GetLen())] );
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray.get(),
sal_Int32(rInf.GetIdx()), sal_Int32(rInf.GetLen()));
- long nCurrPos = pKernArray[sal_Int32(nTextBreak)] + nGridWidthAdd;
+ tools::Long nCurrPos = pKernArray[sal_Int32(nTextBreak)] + nGridWidthAdd;
while (++nTextBreak < rInf.GetLen() && nTextWidth >= nCurrPos)
{
nCurrPos = pKernArray[sal_Int32(nTextBreak)] + nGridWidthAdd * (sal_Int32(nTextBreak) + 1);
@@ -2561,7 +2561,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth
rInf.GetKanaComp(), static_cast<sal_uInt16>(GetHeight( m_nActual )),
lcl_IsFullstopCentered( rInf.GetOut() ) ) )
{
- long nKernAdd = nKern;
+ tools::Long nKernAdd = nKern;
TextFrameIndex const nTmpBreak = nTextBreak2;
if( nKern && nTextBreak2 )
nKern *= sal_Int32(nTextBreak2) - 1;
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 3a64db9c82e6..18cfb5f3ac10 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -138,7 +138,7 @@ void SwDoGetCapitalSize::Do()
Size SwSubFont::GetCapitalSize( SwDrawTextInfo& rInf )
{
// Start:
- const long nOldKern = rInf.GetKern();
+ const tools::Long nOldKern = rInf.GetKern();
rInf.SetKern( CheckKerning() );
rInf.SetPos( Point() );
rInf.SetSpace( 0 );
@@ -162,11 +162,11 @@ namespace {
class SwDoGetCapitalBreak : public SwDoCapitals
{
protected:
- long nTextWidth;
+ tools::Long nTextWidth;
TextFrameIndex m_nBreak;
public:
- SwDoGetCapitalBreak( SwDrawTextInfo &rInfo, long const nWidth)
+ SwDoGetCapitalBreak( SwDrawTextInfo &rInfo, tools::Long const nWidth)
: SwDoCapitals ( rInfo )
, nTextWidth( nWidth )
, m_nBreak( -1 )
@@ -218,7 +218,7 @@ void SwDoGetCapitalBreak::Do()
}
TextFrameIndex SwFont::GetCapitalBreak( SwViewShell const * pSh, const OutputDevice* pOut,
- const SwScriptInfo* pScript, const OUString& rText, long const nTextWidth,
+ const SwScriptInfo* pScript, const OUString& rText, tools::Long const nTextWidth,
TextFrameIndex const nIdx, TextFrameIndex const nLen)
{
// Start:
@@ -287,7 +287,7 @@ void SwDoDrawCapital::Do()
void SwDoDrawCapital::DrawSpace( Point &rPos )
{
- long nDiff = rInf.GetPos().X() - rPos.X();
+ tools::Long nDiff = rInf.GetPos().X() - rPos.X();
Point aPos( rPos );
const bool bSwitchL2R = rInf.GetFrame()->IsRightToLeft() &&
@@ -359,7 +359,7 @@ void SwDoCapitalCursorOfst::Do()
if ( !nOfst )
return;
- if ( static_cast<long>(nOfst) > rInf.GetSize().Width() )
+ if ( static_cast<tools::Long>(nOfst) > rInf.GetSize().Width() )
{
nOfst -= rInf.GetSize().Width();
nCursor = nCursor + rInf.GetLen();
@@ -393,7 +393,7 @@ void SwDoCapitalCursorOfst::Do()
TextFrameIndex SwSubFont::GetCapitalCursorOfst( SwDrawTextInfo& rInf )
{
- const long nOldKern = rInf.GetKern();
+ const tools::Long nOldKern = rInf.GetKern();
rInf.SetKern( CheckKerning() );
SwDoCapitalCursorOfst aDo( rInf, rInf.GetOffset() );
rInf.SetPos( Point() );
@@ -426,12 +426,12 @@ public:
void SwDoDrawStretchCapital::Do()
{
SV_STAT( nDrawStretchText );
- long nPartWidth = rInf.GetSize().Width();
+ tools::Long nPartWidth = rInf.GetSize().Width();
if( rInf.GetLen() )
{
// small caps and kerning
- long nDiff = long(nOrgWidth) - long(nCapWidth);
+ tools::Long nDiff = tools::Long(nOrgWidth) - tools::Long(nCapWidth);
if( nDiff )
{
nDiff *= sal_Int32(rInf.GetLen());
@@ -486,7 +486,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
{
OSL_ENSURE( pLastFont, "SwFont::DoOnCapitals: No LastFont?!" );
- long nKana = 0;
+ tools::Long nKana = 0;
const OUString aText( CalcCaseMap( rDo.GetInf().GetText() ) );
TextFrameIndex nMaxPos = std::min(
TextFrameIndex(rDo.GetInf().GetText().getLength()) - rDo.GetInf().GetIdx(),
@@ -522,7 +522,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|| aFont.GetStrikeout() != STRIKEOUT_NONE;
const bool bWordWise = bTextLines && aFont.IsWordLineMode() &&
rDo.GetInf().GetDrawSpace();
- const long nTmpKern = rDo.GetInf().GetKern();
+ const tools::Long nTmpKern = rDo.GetInf().GetKern();
if ( bTextLines )
{
@@ -636,7 +636,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
// The upper ones...
if( nOldPos != nPos )
{
- const long nSpaceAdd = rDo.GetInf().GetSpace() / SPACING_PRECISION_FACTOR;
+ const tools::Long nSpaceAdd = rDo.GetInf().GetSpace() / SPACING_PRECISION_FACTOR;
do
{
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 00032f256242..2b565f2b4021 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3124,9 +3124,9 @@ OUString SwTextNode::GetNumString( const bool _bInclPrefixAndSuffixStrings,
return OUString();
}
-long SwTextNode::GetLeftMarginWithNum( bool bTextLeft ) const
+tools::Long SwTextNode::GetLeftMarginWithNum( bool bTextLeft ) const
{
- long nRet = 0;
+ tools::Long nRet = 0;
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : nullptr;
if( pRule )
{
@@ -3271,9 +3271,9 @@ void SwTextNode::ClearLRSpaceItemDueToListLevelIndents( std::shared_ptr<SvxLRSpa
}
// #i91133#
-long SwTextNode::GetLeftMarginForTabCalculation() const
+tools::Long SwTextNode::GetLeftMarginForTabCalculation() const
{
- long nLeftMarginForTabCalc = 0;
+ tools::Long nLeftMarginForTabCalc = 0;
bool bLeftMarginForTabCalcSetToListLevelIndent( false );
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : nullptr;
@@ -4452,7 +4452,7 @@ bool SwTextNode::AreListLevelIndentsApplicable() const
@return boolean - indicating, if a list tab stop position is provided
*/
-bool SwTextNode::GetListTabStopPosition( long& nListTabStopPosition ) const
+bool SwTextNode::GetListTabStopPosition( tools::Long& nListTabStopPosition ) const
{
bool bListTabStopPositionProvided(false);
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 60d22422cd07..a67b8922b49d 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -483,8 +483,8 @@ sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const
if( DFLT_ESC_AUTO_SUPER != GetEscapement() &&
DFLT_ESC_AUTO_SUB != GetEscapement() )
{
- const long nAscent = nOldAscent +
- ( static_cast<long>(m_nOrgHeight) * GetEscapement() ) / 100;
+ const tools::Long nAscent = nOldAscent +
+ ( static_cast<tools::Long>(m_nOrgHeight) * GetEscapement() ) / 100;
if ( nAscent>0 )
return std::max<sal_uInt16>( nAscent, m_nOrgAscent );
}
@@ -996,8 +996,8 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight,
if( DFLT_ESC_AUTO_SUPER != GetEscapement() &&
DFLT_ESC_AUTO_SUB != GetEscapement() )
{
- long nDescent = nOldHeight - nOldAscent -
- ( static_cast<long>(m_nOrgHeight) * GetEscapement() ) / 100;
+ tools::Long nDescent = nOldHeight - nOldAscent -
+ ( static_cast<tools::Long>(m_nOrgHeight) * GetEscapement() ) / 100;
const sal_uInt16 nDesc = nDescent>0
? std::max<sal_uInt16>( nDescent, m_nOrgHeight - m_nOrgAscent)
: m_nOrgHeight - m_nOrgAscent;
@@ -1055,7 +1055,7 @@ Size SwSubFont::GetTextSize_( SwDrawTextInfo& rInf )
else
{
SV_STAT( nGetTextSize );
- long nOldKern = rInf.GetKern();
+ tools::Long nOldKern = rInf.GetKern();
const OUString oldText = rInf.GetText();
rInf.SetKern( CheckKerning() );
if ( !IsCaseMap() )
@@ -1102,7 +1102,7 @@ Size SwSubFont::GetTextSize_( SwDrawTextInfo& rInf )
const sal_uInt16 nAscent = pLastFont->GetFontAscent( rInf.GetShell(),
rInf.GetOut() );
aTextSize.setHeight(
- static_cast<long>(CalcEscHeight( static_cast<sal_uInt16>(aTextSize.Height()), nAscent)) );
+ static_cast<tools::Long>(CalcEscHeight( static_cast<sal_uInt16>(aTextSize.Height()), nAscent)) );
}
}
@@ -1220,7 +1220,7 @@ void SwSubFont::DrawText_( SwDrawTextInfo &rInf, const bool bGrey )
TextFrameIndex const nOldIdx = rInf.GetIdx();
TextFrameIndex const nOldLen = rInf.GetLen();
- long nSpace = 0;
+ tools::Long nSpace = 0;
if( rInf.GetSpace() )
{
TextFrameIndex nTmpEnd = nOldIdx + nOldLen;
@@ -1370,7 +1370,7 @@ TextFrameIndex SwSubFont::GetModelPositionForViewPoint_( SwDrawTextInfo& rInf )
else
{
const OUString oldText = rInf.GetText();
- long nOldKern = rInf.GetKern();
+ tools::Long nOldKern = rInf.GetKern();
rInf.SetKern( CheckKerning() );
SV_STAT( nGetTextSize );
if ( !IsCaseMap() )
@@ -1388,7 +1388,7 @@ TextFrameIndex SwSubFont::GetModelPositionForViewPoint_( SwDrawTextInfo& rInf )
void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos )
{
- long nOfst;
+ tools::Long nOfst;
bool bVert = false;
bool bVertLRBT = false;
@@ -1439,7 +1439,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo const & rInf, Point& rPos )
break;
default :
- nOfst = (static_cast<long>(m_nOrgHeight) * GetEscapement()) / 100;
+ nOfst = (static_cast<tools::Long>(m_nOrgHeight) * GetEscapement()) / 100;
switch ( nDir )
{
@@ -1507,7 +1507,7 @@ SwUnderlineFont::~SwUnderlineFont()
}
/// Helper for filters to find true lineheight of a font
-long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
+tools::Long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
const SwAttrSet &rSet,
const vcl::RenderContext &rOut, sal_Int16 nScript)
{
@@ -1532,7 +1532,7 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
const vcl::Font aOldFont(rMutableOut.GetFont());
rMutableOut.SetFont(aFont.GetActualFont());
- long nHeight = rMutableOut.GetTextHeight();
+ tools::Long nHeight = rMutableOut.GetTextHeight();
rMutableOut.SetFont(aOldFont);
return nHeight;
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index 95f3182b6ab3..aed2397937c7 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -202,7 +202,7 @@ void SwUndoDelNum::AddNode( const SwTextNode& rNd )
}
}
-SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, bool bIsOutlMv )
+SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, tools::Long nOff, bool bIsOutlMv )
: SwUndo( bIsOutlMv ? SwUndoId::OUTLINE_UD : SwUndoId::MOVENUM, &rPam.GetDoc() ),
SwUndRng( rPam ),
m_nNewStart( 0 ), m_nOffset( nOff )
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 7c11f4596690..214ada23b3a3 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -383,7 +383,7 @@ void SwUndoTransliterate::AddChanges( SwTextNode& rTNd,
sal_Int32 nStart, sal_Int32 nLen,
uno::Sequence <sal_Int32> const & rOffsets )
{
- long nOffsLen = rOffsets.getLength();
+ tools::Long nOffsLen = rOffsets.getLength();
UndoTransliterate_Data* pNew = new UndoTransliterate_Data(
rTNd.GetIndex(), nStart, static_cast<sal_Int32>(nOffsLen),
rTNd.GetText().copy(nStart, nLen));
@@ -393,14 +393,14 @@ void SwUndoTransliterate::AddChanges( SwTextNode& rTNd,
const sal_Int32* pOffsets = rOffsets.getConstArray();
// where did we need less memory ?
const sal_Int32* p = pOffsets;
- for( long n = 0; n < nOffsLen; ++n, ++p )
+ for( tools::Long n = 0; n < nOffsLen; ++n, ++p )
if( *p != ( nStart + n ))
{
// create the Offset array
pNew->pOffsets.reset( new Sequence <sal_Int32> ( nLen ) );
sal_Int32* pIdx = pNew->pOffsets->getArray();
p = pOffsets;
- long nMyOff, nNewVal = nStart;
+ tools::Long nMyOff, nNewVal = nStart;
for( n = 0, nMyOff = nStart; n < nOffsLen; ++p, ++n, ++nMyOff )
{
if( *p < nMyOff )
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 7a70f07eb0ab..6e21b7ca9fc7 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -159,7 +159,7 @@ class SaveBox
SaveBox* pNext;
sal_uLong nSttNode;
- long nRowSpan;
+ tools::Long nRowSpan;
sal_uInt16 nItemSet;
union
{
@@ -1470,7 +1470,7 @@ void SwUndoTableAutoFormat::RedoImpl(::sw::UndoRedoContext & rContext)
SwUndoTableNdsChg::SwUndoTableNdsChg( SwUndoId nAction,
const SwSelBoxes& rBoxes,
const SwTableNode& rTableNd,
- long nMn, long nMx,
+ tools::Long nMn, tools::Long nMx,
sal_uInt16 nCnt, bool bFlg, bool bSmHght )
: SwUndo( nAction, &rTableNd.GetDoc() ),
m_nMin( nMn ), m_nMax( nMx ),
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 4fdd9544a402..0fd3f9535bd4 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1487,7 +1487,7 @@ void SAL_CALL SwXTextField::attach(
break;
case SwServiceType::FieldTypeAuthor:
{
- long nFormat = m_pImpl->m_pProps->bBool1 ? AF_NAME : AF_SHORTCUT;
+ tools::Long nFormat = m_pImpl->m_pProps->bBool1 ? AF_NAME : AF_SHORTCUT;
if (m_pImpl->m_pProps->bBool2)
nFormat |= AF_FIXED;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index e0562aec456d..0049636a85d7 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1227,7 +1227,7 @@ sal_Int64 SAL_CALL SwXStyle::getSomething(const uno::Sequence<sal_Int8>& rId)
uno::Sequence< OUString > SwXStyle::getSupportedServiceNames()
{
- long nCount = 1;
+ tools::Long nCount = 1;
if(SfxStyleFamily::Para == m_rEntry.m_eFamily)
{
nCount = 5;
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index f58ee3dad7e0..35f3eea3ad0c 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -659,7 +659,7 @@ static void lcl_SetTableSeparators(const uno::Any& rVal, SwTable* pTable, SwTabl
return;
SwTabCols aCols(aOldCols);
const text::TableColumnSeparator* pArray = pSepSeq->getConstArray();
- long nLastValue = 0;
+ tools::Long nLastValue = 0;
//sal_Int32 nTableWidth = aCols.GetRight() - aCols.GetLeft();
for(size_t i = 0; i < nOldCount; ++i)
{
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 8dfbf6689566..590141a5693e 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1885,7 +1885,7 @@ void SwXText::Impl::ConvertCell(
{
// increment on each StartNode and decrement on each EndNode
// we must reach zero at the end and must not go below zero
- long nOpenNodeBlock = 0;
+ tools::Long nOpenNodeBlock = 0;
SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode;
while (aCellIndex < aEndCellPam.End()->nNode.GetIndex())
{
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index b3b08c25a513..02f0e988172e 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -209,7 +209,7 @@ void SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
{
// adjust scaling for Drawing layer.
aYScale *= Fraction( 1000, 1 );
- long nNewNuminator = aYScale.operator long();
+ tools::Long nNewNuminator = aYScale.operator long();
if( nNewNuminator < 1 )
nNewNuminator = 1;
aYScale = Fraction( nNewNuminator, 1000 );
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index 20b078080819..98df16715059 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -160,7 +160,7 @@ void SwViewShell::PrintProspect(
{
// Round percentages for Drawings so that these can paint their objects properly
aScY *= Fraction( 1000, 1 );
- long nTmp = static_cast<long>(aScY);
+ tools::Long nTmp = static_cast<tools::Long>(aScY);
if( 1 < nTmp )
--nTmp;
else
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 59f4b809686b..cac98fffaace 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -576,7 +576,7 @@ void SwViewShell::MakeVisible( const SwRect &rRect )
{
const SwFrame* pRoot = GetLayout();
int nLoopCnt = 3;
- long nOldH;
+ tools::Long nOldH;
do{
nOldH = pRoot->getFrameArea().Height();
StartAction();
@@ -989,7 +989,7 @@ void SwViewShell::CalcLayout()
const bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == nullptr;
if ( bEndProgress )
{
- long nEndPage = GetLayout()->GetPageNum();
+ tools::Long nEndPage = GetLayout()->GetPageNum();
nEndPage += nEndPage * 10 / 100;
::StartProgress( STR_STATSTR_REFORMAT, 0, nEndPage, GetDoc()->GetDocShell() );
}
@@ -1110,8 +1110,8 @@ void SwViewShell::VisPortChgd( const SwRect &rRect)
else
{
//Calculate amount to be scrolled.
- const long nXDiff = aPrevArea.Left() - VisArea().Left();
- const long nYDiff = aPrevArea.Top() - VisArea().Top();
+ const tools::Long nXDiff = aPrevArea.Left() - VisArea().Left();
+ const tools::Long nYDiff = aPrevArea.Top() - VisArea().Top();
if( !nXDiff && !GetViewOptions()->getBrowseMode() &&
(!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
@@ -1161,7 +1161,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect)
//selected and have handles attached.
if ( pPage->GetSortedObjs() )
{
- const long nOfst = GetOut()->PixelToLogic(
+ const tools::Long nOfst = GetOut()->PixelToLogic(
Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width();
for (SwAnchoredObject* pObj : *pPage->GetSortedObjs())
{
@@ -1244,13 +1244,13 @@ void SwViewShell::VisPortChgd( const SwRect &rRect)
Imp()->UpdateAccessible();
}
-bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle *pRect )
+bool SwViewShell::SmoothScroll( tools::Long lXDiff, tools::Long lYDiff, const tools::Rectangle *pRect )
{
#if !defined(MACOSX) && !defined(ANDROID) && !defined(IOS)
// #i98766# - disable smooth scrolling for Mac
const sal_uLong nBitCnt = mpOut->GetBitCount();
- long lMult = 1, lMax = LONG_MAX;
+ tools::Long lMult = 1, lMax = LONG_MAX;
if ( nBitCnt == 16 )
{
lMax = 7000;
@@ -1355,7 +1355,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle
// or is it better to get the scrollfactor from the User
// as option?
// ??????????????????????
- long lMaDelta = aPixSz.Height();
+ tools::Long lMaDelta = aPixSz.Height();
if ( std::abs(lYDiff) > ( maVisArea.Height() / 3 ) )
lMaDelta *= 6;
else
@@ -1366,10 +1366,10 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle
if ( lYDiff < 0 )
lMaDelta = -lMaDelta;
- long lDiff = lYDiff;
+ tools::Long lDiff = lYDiff;
while ( lDiff )
{
- long lScroll;
+ tools::Long lScroll;
if ( Imp()->m_bStopSmooth || std::abs(lDiff) <= std::abs(lMaDelta) )
{
lScroll = lDiff;
@@ -1513,7 +1513,7 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect
SwRect aLeft( rRect ), aRight( rRect );
while ( pPage )
{
- long nTmp = pPage->getFrameArea().Left();
+ tools::Long nTmp = pPage->getFrameArea().Left();
if ( nTmp < aLeft.Right() )
aLeft.Right( nTmp );
nTmp = pPage->getFrameArea().Right();
@@ -1893,7 +1893,7 @@ void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
}
}
-void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, long tileWidth, long tileHeight)
+void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contextHeight, int tilePosX, int tilePosY, tools::Long tileWidth, tools::Long tileHeight)
{
// SwViewShell's output device setup
// TODO clean up SwViewShell's approach to output devices (the many of
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 946f39c58a7e..44e632c5d4d0 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -142,7 +142,7 @@ void SwViewShell::Init( const SwViewOption *pNewOpt )
/// CTor for the first Shell.
SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
const SwViewOption *pNewOpt, OutputDevice *pOutput,
- long nFlags )
+ tools::Long nFlags )
:
maBrowseBorder(),
mpSfxViewShell( nullptr ),
@@ -212,7 +212,7 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
/// CTor for further Shells on a document.
SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
- OutputDevice * pOutput, long const nFlags)
+ OutputDevice * pOutput, tools::Long const nFlags)
: Ring( &rShell ) ,
maBrowseBorder( rShell.maBrowseBorder ),
mpSfxViewShell( nullptr ),
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index be02dcfce5d8..bc92e9c58d13 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -541,9 +541,9 @@ bool SwViewShell::PrintOrPDFExport(
//Now scale the recorded page down so the notes
//will fit in the final page
double fScale = 0.75;
- long nOrigHeight = pStPage->getFrameArea().Height();
- long nNewHeight = nOrigHeight*fScale;
- long nShiftY = (nOrigHeight-nNewHeight)/2;
+ tools::Long nOrigHeight = pStPage->getFrameArea().Height();
+ tools::Long nNewHeight = nOrigHeight*fScale;
+ tools::Long nShiftY = (nOrigHeight-nNewHeight)/2;
pMetaFile->Scale( fScale, fScale );
pMetaFile->WindStart();
//Move the scaled page down to center it
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index a82104dbf594..b58f268547ef 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -54,7 +54,7 @@ class SwASCIIParser
std::unique_ptr<char[]> pArr;
const SwAsciiOptions& rOpt;
std::unique_ptr<SfxItemSet> pItemSet;
- long nFileSize;
+ tools::Long nFileSize;
SvtScriptType nScript;
bool bNewDoc;
@@ -243,7 +243,7 @@ ErrCode SwASCIIParser::CallParser()
ErrCode SwASCIIParser::ReadChars()
{
sal_Unicode *pStt = nullptr, *pEnd = nullptr, *pLastStt = nullptr;
- long nReadCnt = 0, nLineLen = 0;
+ tools::Long nReadCnt = 0, nLineLen = 0;
sal_Unicode cLastCR = 0;
bool bSwapUnicode = false;
@@ -269,10 +269,10 @@ ErrCode SwASCIIParser::ReadChars()
{
aEmpty.SetCharSet(eCharSet);
aEmpty.SetParaFlags(eLineEnd);
- rInput.SeekRel(-(long(nLen)));
+ rInput.SeekRel(-(tools::Long(nLen)));
}
else
- rInput.SeekRel(-(long(nOrig)));
+ rInput.SeekRel(-(tools::Long(nOrig)));
pUseMe=&aEmpty;
}
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx
index fa99ce7c6d95..d9933628a773 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -99,7 +99,7 @@ ErrCode SwASCWriter::WriteStream()
case LINEEND_CRLF: m_sLineEnd = "\015\012"; break;
}
- long nMaxNode = m_pDoc->GetNodes().Count();
+ tools::Long nMaxNode = m_pDoc->GetNodes().Count();
if( m_bShowProgress )
::StartProgress( STR_STATSTR_W4WWRITE, 0, nMaxNode, m_pDoc->GetDocShell() );
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 4093ae3999be..b799dee2da06 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -347,7 +347,7 @@ void SwFltControlStack::KillUnlockedAttrs(const SwPosition& rPos)
// be applied to the document and removed from the stack.
// Returns if there were any selected attributes on the stack
SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
- sal_uInt16 nAttrId, bool bTstEnd, long nHand,
+ sal_uInt16 nAttrId, bool bTstEnd, tools::Long nHand,
bool consumedByField)
{
SwFltStackEntry *pRet = nullptr;
@@ -995,7 +995,7 @@ SwFltRedline* SwFltRedline::Clone( SfxItemPool* ) const
// methods of SwFltBookmark follow
SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa,
- long nHand, const bool bIsTOCBookmark )
+ tools::Long nHand, const bool bIsTOCBookmark )
: SfxPoolItem( RES_FLTR_BOOKMARK )
, mnHandle( nHand )
, maName( rNa )
@@ -1048,12 +1048,12 @@ SwFltRDFMark* SwFltRDFMark::Clone(SfxItemPool*) const
return new SwFltRDFMark(*this);
}
-void SwFltRDFMark::SetHandle(long nHandle)
+void SwFltRDFMark::SetHandle(tools::Long nHandle)
{
m_nHandle = nHandle;
}
-long SwFltRDFMark::GetHandle() const
+tools::Long SwFltRDFMark::GetHandle() const
{
return m_nHandle;
}
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 8cb32cc97e4e..7b1a5cc19be3 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -366,7 +366,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp,
Strm().WriteOString( sOut.makeStringAndClear() );
}
-static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
+static void AddUnitPropertyValue(OStringBuffer &rOut, tools::Long nVal,
FieldUnit eUnit)
{
if( nVal < 0 )
@@ -377,9 +377,9 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
}
// the recalculated unit results from (x * nMul)/(nDiv*nFac*10)
- long nMul = 1000;
- long nDiv = 1;
- long nFac = 100;
+ tools::Long nMul = 1000;
+ tools::Long nDiv = 1;
+ tools::Long nFac = 100;
const char *pUnit;
switch( eUnit )
{
@@ -441,7 +441,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
break;
}
- long nLongVal = 0;
+ tools::Long nLongVal = 0;
bool bOutLongVal = true;
if( nVal > LONG_MAX / nMul )
{
@@ -454,7 +454,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
if( nBigVal <= LONG_MAX )
{
// a long is sufficient
- nLongVal = static_cast<long>(nBigVal);
+ nLongVal = static_cast<tools::Long>(nBigVal);
}
else
{
@@ -496,14 +496,14 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
rOut.append(pUnit);
}
-void SwHTMLWriter::OutCSS1_UnitProperty( const char *pProp, long nVal )
+void SwHTMLWriter::OutCSS1_UnitProperty( const char *pProp, tools::Long nVal )
{
OStringBuffer sOut;
AddUnitPropertyValue(sOut, nVal, m_eCSS1Unit);
OutCSS1_PropertyAscii(pProp, sOut.makeStringAndClear());
}
-void SwHTMLWriter::OutCSS1_PixelProperty( const char *pProp, long nVal,
+void SwHTMLWriter::OutCSS1_PixelProperty( const char *pProp, tools::Long nVal,
bool bVert )
{
OString sOut(OString::number(ToPixel(nVal,bVert)) + sCSS1_UNIT_px);
@@ -1684,7 +1684,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc,
aRefSz = pRefPageDesc->GetMaster().GetFrameSize().GetSize();
if( bRefLandscape != rPageDesc.GetLandscape() )
{
- long nTmp = aRefSz.Height();
+ tools::Long nTmp = aRefSz.Height();
aRefSz.setHeight( aRefSz.Width() );
aRefSz.setWidth( nTmp );
}
@@ -1871,9 +1871,9 @@ Writer& OutCSS1_NumberBulletListStyleOpt( Writer& rWrt, const SwNumRule& rNumRul
const SwNumFormat& rNumFormat = rNumRule.Get( nLevel );
- long nLSpace = rNumFormat.GetAbsLSpace();
- long nFirstLineOffset = rNumFormat.GetFirstLineOffset();
- long nDfltFirstLineOffset = HTML_NUMBER_BULLET_INDENT;
+ tools::Long nLSpace = rNumFormat.GetAbsLSpace();
+ tools::Long nFirstLineOffset = rNumFormat.GetFirstLineOffset();
+ tools::Long nDfltFirstLineOffset = HTML_NUMBER_BULLET_INDENT;
if( nLevel > 0 )
{
const SwNumFormat& rPrevNumFormat = rNumRule.Get( nLevel-1 );
@@ -1942,7 +1942,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat
// case the Orient-Attribute contains the correct position.
// top
- long nXPos=0, nYPos=0;
+ tools::Long nXPos=0, nYPos=0;
bool bOutXPos = false, bOutYPos = false;
if( RES_DRAWFRMFMT == rFrameFormat.Which() )
{
@@ -2724,7 +2724,7 @@ static Writer& OutCSS1_SvxLineSpacing( Writer& rWrt, const SfxPoolItem& rHt )
}
if( nHeight )
- rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, static_cast<long>(nHeight) );
+ rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, static_cast<tools::Long>(nHeight) );
else if( nPercentHeight &&
!(nPercentHeight < 115 && rHTMLWrt.m_bParaDotLeaders )) // avoid HTML scrollbars and missing descenders
{
@@ -2896,14 +2896,14 @@ static Writer& OutCSS1_SvxLRSpace( Writer& rWrt, const SfxPoolItem& rHt )
// match that of the current template
// A left margin can exist because of a list nearby
- long nLeftMargin = rLRItem.GetTextLeft() - rHTMLWrt.m_nLeftMargin;
+ tools::Long nLeftMargin = rLRItem.GetTextLeft() - rHTMLWrt.m_nLeftMargin;
if( rHTMLWrt.m_nDfltLeftMargin != nLeftMargin )
{
rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_left, nLeftMargin );
// max-width = max-width - margin-left for TOC paragraphs with dot leaders
if( rHTMLWrt.m_bParaDotLeaders )
- rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_max_width, long(DOT_LEADERS_MAX_WIDTH/2.54*72*20) - nLeftMargin );
+ rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_max_width, tools::Long(DOT_LEADERS_MAX_WIDTH/2.54*72*20) - nLeftMargin );
}
@@ -2913,7 +2913,7 @@ static Writer& OutCSS1_SvxLRSpace( Writer& rWrt, const SfxPoolItem& rHt )
}
// The LineIndent of the first line might contain the room for numbering
- long nFirstLineIndent = static_cast<long>(rLRItem.GetTextFirstLineOffset()) -
+ tools::Long nFirstLineIndent = static_cast<tools::Long>(rLRItem.GetTextFirstLineOffset()) -
rHTMLWrt.m_nFirstLineIndent;
if( rHTMLWrt.m_nDfltFirstLineIndent != nFirstLineIndent )
{
@@ -2933,13 +2933,13 @@ static Writer& OutCSS1_SvxULSpace( Writer& rWrt, const SfxPoolItem& rHt )
if( rHTMLWrt.m_nDfltTopMargin != rULItem.GetUpper() )
{
rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_top,
- static_cast<long>(rULItem.GetUpper()) );
+ static_cast<tools::Long>(rULItem.GetUpper()) );
}
if( rHTMLWrt.m_nDfltBottomMargin != rULItem.GetLower() )
{
rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_bottom,
- static_cast<long>(rULItem.GetLower()) );
+ static_cast<tools::Long>(rULItem.GetLower()) );
}
return rWrt;
@@ -3402,10 +3402,10 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt )
OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border_right, pRight );
}
- long nTopDist = pTop ? rBoxItem.GetDistance( SvxBoxItemLine::TOP ) : 0;
- long nBottomDist = pBottom ? rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) : 0;
- long nLeftDist = pLeft ? rBoxItem.GetDistance( SvxBoxItemLine::LEFT ) : 0;
- long nRightDist = pRight ? rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) : 0;
+ tools::Long nTopDist = pTop ? rBoxItem.GetDistance( SvxBoxItemLine::TOP ) : 0;
+ tools::Long nBottomDist = pBottom ? rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) : 0;
+ tools::Long nLeftDist = pLeft ? rBoxItem.GetDistance( SvxBoxItemLine::LEFT ) : 0;
+ tools::Long nRightDist = pRight ? rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) : 0;
if( nTopDist == nBottomDist && nLeftDist == nRightDist )
{
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 9a96233407b4..4c5f335597a0 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2057,7 +2057,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode )
const SvxLRSpaceItem& rLR = rPgFormat.GetLRSpace();
const SwFormatCol& rCol = rPgFormat.GetCol();
- long nPageWidth = rSz.GetWidth() - rLR.GetLeft() - rLR.GetRight();
+ tools::Long nPageWidth = rSz.GetWidth() - rLR.GetLeft() - rLR.GetRight();
if( 1 < rCol.GetNumCols() )
nPageWidth /= rCol.GetNumCols();
diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx
index a3c2f4989c6a..1f09a40cf09b 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -248,7 +248,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
OUString aId, aStyle, aClass;
- long nWidth=0, nHeight=0;
+ tools::Long nWidth=0, nHeight=0;
bool bPercentWidth = false, bDirection = false, bBGColor = false;
Size aSpace( 0, 0 );
sal_Int16 eVertOri = text::VertOrientation::TOP;
@@ -493,7 +493,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
}
else
{
- long nBrowseWidth = GetCurrentBrowseWidth();
+ tools::Long nBrowseWidth = GetCurrentBrowseWidth();
aTwipSz.setWidth( !nWidth ? nBrowseWidth
: (nWidth*nBrowseWidth) / 100 );
}
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index b7eb5308030e..46b29ebf2e51 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -1397,7 +1397,7 @@ void SwHTMLParser::InsertInput()
bool bDisabled = false, bValue = false;
bool bSetGrfWidth = false, bSetGrfHeight = false;
bool bHidden = false;
- long nWidth=0, nHeight=0;
+ tools::Long nWidth=0, nHeight=0;
sal_Int16 eVertOri = text::VertOrientation::TOP;
sal_Int16 eHoriOri = text::HoriOrientation::NONE;
SvKeyValueIterator *pHeaderAttrs = m_pFormImpl->GetHeaderAttrs();
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index f60a7dda459f..41d1e07f7df8 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -323,8 +323,8 @@ void SwHTMLParser::InsertImage()
sal_Int16 eVertOri = text::VertOrientation::TOP;
sal_Int16 eHoriOri = text::HoriOrientation::NONE;
bool bWidthProvided=false, bHeightProvided=false;
- long nWidth=0, nHeight=0;
- long nVSpace=0, nHSpace=0;
+ tools::Long nWidth=0, nHeight=0;
+ tools::Long nVSpace=0, nHSpace=0;
sal_uInt16 nBorder = (m_xAttrTab->pINetFormat ? 1 : 0);
bool bIsMap = false;
@@ -538,11 +538,11 @@ IMAGE_SETEVENT:
Reader::ResetFrameFormatAttrs( aFrameSet );
// set the border
- long nHBorderWidth = 0, nVBorderWidth = 0;
+ tools::Long nHBorderWidth = 0, nVBorderWidth = 0;
if( nBorder )
{
- nHBorderWidth = static_cast<long>(nBorder);
- nVBorderWidth = static_cast<long>(nBorder);
+ nHBorderWidth = static_cast<tools::Long>(nBorder);
+ nVBorderWidth = static_cast<tools::Long>(nBorder);
SvxCSS1Parser::PixelToTwip( nVBorderWidth, nHBorderWidth );
::editeng::SvxBorderLine aHBorderLine( nullptr, nHBorderWidth );
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index e3dab319f9a6..feaee46f4cb3 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -263,7 +263,7 @@ void SwHTMLParser::NewNumberBulletList( HtmlTokenId nToken )
if( aPropInfo.m_bLeftMargin )
{
// Default indent has already been added
- long nAbsLSpace =
+ tools::Long nAbsLSpace =
aNumFormat.GetAbsLSpace() - HTML_NUMBER_BULLET_MARGINLEFT;
if( aPropInfo.m_nLeftMargin < 0 &&
nAbsLSpace < -aPropInfo.m_nLeftMargin )
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 645ecbd1b358..65e0419f4ed9 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -396,23 +396,23 @@ bool SwHTMLParser::InsertEmbed()
if( USHRT_MAX==aSize.Width() )
{
bPercentWidth = (rOption.GetString().indexOf('%') != -1);
- aSize.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
}
break;
case HtmlOptionId::HEIGHT:
if( USHRT_MAX==aSize.Height() )
{
bPercentHeight = (rOption.GetString().indexOf('%') != -1);
- aSize.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
}
break;
case HtmlOptionId::HSPACE:
if( USHRT_MAX==aSpace.Width() )
- aSpace.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::VSPACE:
if( USHRT_MAX==aSpace.Height() )
- aSpace.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::DATA:
if (m_bXHTML && aURL.isEmpty())
@@ -742,11 +742,11 @@ void SwHTMLParser::NewObject()
break;
case HtmlOptionId::WIDTH:
bPercentWidth = (rOption.GetString().indexOf('%') != -1);
- aSize.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::HEIGHT:
bPercentHeight = (rOption.GetString().indexOf('%') != -1);
- aSize.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::ALIGN:
eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
@@ -757,10 +757,10 @@ void SwHTMLParser::NewObject()
case HtmlOptionId::NAME:
break;
case HtmlOptionId::HSPACE:
- aSpace.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::VSPACE:
- aSpace.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::BORDER:
break;
@@ -902,17 +902,17 @@ void SwHTMLParser::InsertApplet()
break;
case HtmlOptionId::WIDTH:
bPercentWidth = (rOption.GetString().indexOf('%') != -1);
- aSize.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::HEIGHT:
bPercentHeight = (rOption.GetString().indexOf('%') != -1);
- aSize.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::HSPACE:
- aSpace.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::VSPACE:
- aSpace.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::MAYSCRIPT:
bMayScript = true;
@@ -1051,17 +1051,17 @@ void SwHTMLParser::InsertFloatingFrame()
break;
case HtmlOptionId::WIDTH:
bPercentWidth = (rOption.GetString().indexOf('%') != -1);
- aSize.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::HEIGHT:
bPercentHeight = (rOption.GetString().indexOf('%') != -1);
- aSize.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::HSPACE:
- aSpace.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::VSPACE:
- aSpace.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
default: break;
}
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 024464355ac0..c9208357ceee 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -553,7 +553,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss )
{
OUString aId;
OUString aStyle, aClass, aLang, aDir;
- long nWidth = 100;
+ tools::Long nWidth = 100;
sal_uInt16 nCols = columnsFromCss, nGutter = 10;
bool bPercentWidth = true;
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 6207967f3677..5c3131e878fe 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -936,10 +936,10 @@ void HTMLTable::InitCtor(const HTMLTableOptions& rOptions)
const Color& rBorderColor = rOptions.aBorderColor;
- long nBorderOpt = static_cast<long>(rOptions.nBorder);
- long nPWidth = nBorderOpt==USHRT_MAX ? NETSCAPE_DFLT_BORDER
+ tools::Long nBorderOpt = static_cast<tools::Long>(rOptions.nBorder);
+ tools::Long nPWidth = nBorderOpt==USHRT_MAX ? NETSCAPE_DFLT_BORDER
: nBorderOpt;
- long nPHeight = nBorderOpt==USHRT_MAX ? 0 : nBorderOpt;
+ tools::Long nPHeight = nBorderOpt==USHRT_MAX ? 0 : nBorderOpt;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
// nBorder tells the width of the border as it's used in the width calculation of NetScape
@@ -1341,7 +1341,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
bool bSet = (m_nCellPadding > 0);
SvxBoxItem aBoxItem( RES_BOX );
- long nInnerFrameWidth = nFrameWidth;
+ tools::Long nInnerFrameWidth = nFrameWidth;
if( bTopLine )
{
@@ -1604,7 +1604,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper,
// The HTML tables represent a box. So we need to split behind that box
nSplitCol = nCol + 1;
- long nBoxRowSpan = rCell2.GetRowSpan();
+ tools::Long nBoxRowSpan = rCell2.GetRowSpan();
if (!rCell2.GetContents() || rCell2.IsCovered())
{
if (rCell2.IsCovered())
@@ -2462,7 +2462,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail,
sal_uInt16 nWidth2, nDummy;
m_xLayoutInfo->GetAvail( nCol, nColSpan, nWidth2, nDummy );
- nWidth2 = static_cast< sal_uInt16 >((static_cast<long>(m_nWidth) * nPercentWidth) / 100);
+ nWidth2 = static_cast< sal_uInt16 >((static_cast<tools::Long>(m_nWidth) * nPercentWidth) / 100);
SwHTMLParser::ResizeDrawObject( pObj, nWidth2 );
}
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index f7d5951ae585..4c83319747b7 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -79,7 +79,7 @@ class SwHTMLWrtTable : public SwWriteTable
bool bTop, bool bBottom, bool bLeft, bool bRight );
public:
- SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth,
+ SwHTMLWrtTable( const SwTableLines& rLines, tools::Long nWidth, sal_uInt32 nBWidth,
bool bRel, sal_uInt16 nLeftSub, sal_uInt16 nRightSub,
sal_uInt16 nNumOfRowsToRepeat );
explicit SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo );
@@ -92,7 +92,7 @@ public:
}
-SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, long nWidth,
+SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, tools::Long nWidth,
sal_uInt32 nBWidth, bool bRel,
sal_uInt16 nLSub, sal_uInt16 nRSub,
sal_uInt16 nNumOfRowsToRepeat )
@@ -318,7 +318,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
append("=\"").append(static_cast<sal_Int32>(nColSpan)).append("\"");
}
- long nWidth = 0;
+ tools::Long nWidth = 0;
bool bOutWidth = true;
sal_uInt32 nPercentWidth = SAL_MAX_UINT32;
@@ -347,7 +347,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
// ReqIF implies strict XHTML: no width for <td>.
bOutWidth = false;
- long nHeight = pCell->GetHeight() > 0
+ tools::Long nHeight = pCell->GetHeight() > 0
? GetAbsHeight( pCell->GetHeight(), nRow, nRowSpan )
: 0;
Size aPixelSz( nWidth, nHeight );
@@ -876,7 +876,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode,
sal_Int16 eFlyHoriOri = text::HoriOrientation::NONE;
css::text::WrapTextMode eSurround = css::text::WrapTextMode_NONE;
sal_uInt8 nFlyPercentWidth = 0;
- long nFlyWidth = 0;
+ tools::Long nFlyWidth = 0;
sal_uInt16 nFlyHSpace = 0;
sal_uInt16 nFlyVSpace = 0;
if( pFlyFrameFormat )
@@ -909,7 +909,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode,
SwFrameFormat *pFormat = rTable.GetFrameFormat();
const SwFormatFrameSize& rFrameSize = pFormat->GetFrameSize();
- long nWidth = rFrameSize.GetSize().Width();
+ tools::Long nWidth = rFrameSize.GetSize().Width();
sal_uInt8 nPercentWidth = rFrameSize.GetWidthPercent();
sal_uInt16 nBaseWidth = static_cast<sal_uInt16>(nWidth);
@@ -954,7 +954,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode,
{
// Without a right margin also an absolute width is maintained.
// We still try to define the actual width via the layout.
- long nRealWidth = pFormat->FindLayoutRect(true).Width();
+ tools::Long nRealWidth = pFormat->FindLayoutRect(true).Width();
if( nRealWidth )
nWidth = nRealWidth;
}
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index c2286f949b04..9ff8244ca50b 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -870,7 +870,7 @@ bool SvxCSS1Parser::GetEnum( const CSS1PropertyEnum *pPropTable,
return (pPropTable->pName != nullptr);
}
-void SvxCSS1Parser::PixelToTwip( long &rWidth, long &rHeight )
+void SvxCSS1Parser::PixelToTwip( tools::Long &rWidth, tools::Long &rHeight )
{
if( Application::GetDefaultDevice() )
{
@@ -1000,8 +1000,8 @@ static void ParseCSS1_font_size( const CSS1Expression *pExpr,
double fHeight = pExpr->GetNumber();
if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
{
- long nPHeight = static_cast<long>(fHeight);
- long nPWidth = 0;
+ tools::Long nPHeight = static_cast<tools::Long>(fHeight);
+ tools::Long nPWidth = 0;
SvxCSS1Parser::PixelToTwip(nPWidth, nPHeight);
nHeight = static_cast<sal_uLong>(nPHeight);
}
@@ -1601,8 +1601,8 @@ static void ParseCSS1_line_height( const CSS1Expression *pExpr,
double fHeight = pExpr->GetNumber();
if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
{
- long nPHeight = static_cast<long>(fHeight);
- long nPWidth = 0;
+ tools::Long nPHeight = static_cast<tools::Long>(fHeight);
+ tools::Long nPWidth = 0;
SvxCSS1Parser::PixelToTwip(nPWidth, nPHeight);
nHeight = static_cast<sal_uInt16>(nPHeight);
}
@@ -1784,8 +1784,8 @@ static void ParseCSS1_letter_spacing( const CSS1Expression *pExpr,
double fHeight = pExpr->GetNumber();
if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
{
- long nPWidth = static_cast<long>(fHeight);
- long nPHeight = 0;
+ tools::Long nPWidth = static_cast<tools::Long>(fHeight);
+ tools::Long nPHeight = 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
rItemSet.Put( SvxKerningItem( static_cast<short>(nPWidth), aItemIds.nKerning ) );
}
@@ -1959,8 +1959,8 @@ static void ParseCSS1_text_indent( const CSS1Expression *pExpr,
double fWidth = pExpr->GetNumber();
if (fWidth < SAL_MAX_INT32/2.0 && fWidth > SAL_MIN_INT32/2.0)
{
- long nPWidth = static_cast<long>(fWidth);
- long nPHeight = 0;
+ tools::Long nPWidth = static_cast<tools::Long>(fWidth);
+ tools::Long nPHeight = 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
nIndent = static_cast<short>(nPWidth);
bSet = true;
@@ -2001,7 +2001,7 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr,
{
OSL_ENSURE( pExpr, "no expression" );
- long nLeft = 0;
+ tools::Long nLeft = 0;
bool bSet = false;
switch( pExpr->GetType() )
{
@@ -2016,8 +2016,8 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr,
double fLeft = pExpr->GetNumber();
if (fLeft < SAL_MAX_INT32/2.0 && fLeft > SAL_MIN_INT32/2.0)
{
- nLeft = static_cast<long>(fLeft);
- long nPHeight = 0;
+ nLeft = static_cast<tools::Long>(fLeft);
+ tools::Long nPHeight = 0;
SvxCSS1Parser::PixelToTwip( nLeft, nPHeight );
bSet = true;
}
@@ -2064,7 +2064,7 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr,
{
OSL_ENSURE( pExpr, "no expression" );
- long nRight = 0;
+ tools::Long nRight = 0;
bool bSet = false;
switch( pExpr->GetType() )
{
@@ -2079,8 +2079,8 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr,
double fRight = pExpr->GetNumber();
if (fRight < SAL_MAX_INT32/2.0 && fRight > SAL_MIN_INT32/2.0)
{
- nRight = static_cast<long>(fRight);
- long nPHeight = 0;
+ nRight = static_cast<tools::Long>(fRight);
+ tools::Long nPHeight = 0;
SvxCSS1Parser::PixelToTwip( nRight, nPHeight );
bSet = true;
}
@@ -2129,7 +2129,7 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
{
case CSS1_LENGTH:
{
- long nTmp = pExpr->GetSLength();
+ tools::Long nTmp = pExpr->GetSLength();
if( nTmp < 0 )
nTmp = 0;
nUpper = static_cast<sal_uInt16>(nTmp);
@@ -2141,8 +2141,8 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
double fHeight = pExpr->GetNumber();
if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
{
- long nPWidth = 0;
- long nPHeight = static_cast<long>(fHeight);
+ tools::Long nPWidth = 0;
+ tools::Long nPHeight = static_cast<tools::Long>(fHeight);
if( nPHeight < 0 )
nPHeight = 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
@@ -2191,7 +2191,7 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr,
{
case CSS1_LENGTH:
{
- long nTmp = pExpr->GetSLength();
+ tools::Long nTmp = pExpr->GetSLength();
if( nTmp < 0 )
nTmp = 0;
nLower = static_cast<sal_uInt16>(nTmp);
@@ -2203,8 +2203,8 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr,
double fHeight = pExpr->GetNumber();
if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
{
- long nPWidth = 0;
- long nPHeight = static_cast<long>(fHeight);
+ tools::Long nPWidth = 0;
+ tools::Long nPHeight = static_cast<tools::Long>(fHeight);
if( nPHeight < 0 )
nPHeight = 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
@@ -2247,13 +2247,13 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr,
{
OSL_ENSURE( pExpr, "no expression" );
- long nMargins[4] = { 0, 0, 0, 0 };
+ tools::Long nMargins[4] = { 0, 0, 0, 0 };
bool bSetMargins[4] = { false, false, false, false };
for( int i=0; pExpr && i<4 && !pExpr->GetOp(); ++i )
{
bool bSetThis = false;
- long nMargin = 0;
+ tools::Long nMargin = 0;
switch( pExpr->GetType() )
{
@@ -2268,8 +2268,8 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr,
double fMargin = pExpr->GetNumber();
if (fMargin < SAL_MAX_INT32/2.0 && fMargin > SAL_MIN_INT32/2.0)
{
- nMargin = static_cast<long>(fMargin);
- long nPWidth = 0;
+ nMargin = static_cast<tools::Long>(fMargin);
+ tools::Long nPWidth = 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nMargin );
bSetThis = true;
}
@@ -2401,7 +2401,7 @@ static bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr,
{
case CSS1_LENGTH:
{
- long nTmp = pExpr->GetSLength();
+ tools::Long nTmp = pExpr->GetSLength();
if( nTmp < 0 )
nTmp = 0;
else if( nTmp > SvxCSS1PropertyInfo::UNSET_BORDER_DISTANCE-1 )
@@ -2415,8 +2415,8 @@ static bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr,
double fWidth = pExpr->GetNumber();
if (fWidth < SAL_MAX_INT32/2.0 && fWidth > SAL_MIN_INT32/2.0)
{
- long nPWidth = static_cast<long>(fWidth);
- long nPHeight = 0;
+ tools::Long nPWidth = static_cast<tools::Long>(fWidth);
+ tools::Long nPHeight = 0;
if( nPWidth < 0 )
nPWidth = 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
@@ -2561,8 +2561,8 @@ static void ParseCSS1_border_xxx( const CSS1Expression *pExpr,
bool bHori = nWhichLine == SvxBoxItemLine::TOP ||
nWhichLine == SvxBoxItemLine::BOTTOM;
- long nPWidth = bHori ? 0 : fWidth;
- long nPHeight = bHori ? fWidth : 0;
+ tools::Long nPWidth = bHori ? 0 : fWidth;
+ tools::Long nPHeight = bHori ? fWidth : 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
nWidth = static_cast<sal_uInt16>(bHori ? nPHeight : nPWidth);
}
@@ -2633,13 +2633,13 @@ static void ParseCSS1_border_xxx_width( const CSS1Expression *pExpr,
double fLength = pExpr->GetNumber();
if (fLength < SAL_MAX_INT32/2.0 && fLength > SAL_MIN_INT32/2.0)
{
- long nWidthL = static_cast<long>(fLength);
+ tools::Long nWidthL = static_cast<tools::Long>(fLength);
bool bHori = nWhichLine == SvxBoxItemLine::TOP ||
nWhichLine == SvxBoxItemLine::BOTTOM;
- long nPWidth = bHori ? 0 : nWidthL;
- long nPHeight = bHori ? nWidthL : 0;
+ tools::Long nPWidth = bHori ? 0 : nWidthL;
+ tools::Long nPHeight = bHori ? nWidthL : 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
nWidth = static_cast<sal_uInt16>(bHori ? nPHeight : nPWidth);
}
@@ -2826,7 +2826,7 @@ static void ParseCSS1_position( const CSS1Expression *pExpr,
}
static void ParseCSS1_length( const CSS1Expression *pExpr,
- long& rLength,
+ tools::Long& rLength,
SvxCSS1LengthType& rLengthType,
bool bHori )
{
@@ -2851,9 +2851,9 @@ static void ParseCSS1_length( const CSS1Expression *pExpr,
double fLength = pExpr->GetNumber();
if (fLength < SAL_MAX_INT32/2.0 && fLength > SAL_MIN_INT32/2.0)
{
- long nWidthL = static_cast<long>(fLength);
- long nPWidth = bHori ? 0 : nWidthL;
- long nPHeight = bHori ? nWidthL : 0;
+ tools::Long nWidthL = static_cast<tools::Long>(fLength);
+ tools::Long nPWidth = bHori ? 0 : nWidthL;
+ tools::Long nPHeight = bHori ? nWidthL : 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
rLength = (bHori ? nPHeight : nPWidth);
rLengthType = SVX_CSS1_LTYPE_TWIP;
@@ -2862,7 +2862,7 @@ static void ParseCSS1_length( const CSS1Expression *pExpr,
break;
case CSS1_PERCENTAGE:
- rLength = static_cast<long>(pExpr->GetNumber());
+ rLength = static_cast<tools::Long>(pExpr->GetNumber());
if( rLength > 100 )
rLength = 100;
rLengthType = SVX_CSS1_LTYPE_PERCENTAGE;
@@ -2939,8 +2939,8 @@ static void ParseCSS1_size( const CSS1Expression *pExpr,
double fHeight = pExpr->GetNumber();
if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0)
{
- long nPHeight = static_cast<long>(fHeight);
- long nPWidth = n==0 ? nPHeight : 0;
+ tools::Long nPHeight = static_cast<tools::Long>(fHeight);
+ tools::Long nPWidth = n==0 ? nPHeight : 0;
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
rPropInfo.m_nHeight = nPHeight;
if( n==0 )
diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx
index 8bc1f47b380a..e7888ff39813 100644
--- a/sw/source/filter/html/svxcss1.hxx
+++ b/sw/source/filter/html/svxcss1.hxx
@@ -130,9 +130,9 @@ public:
sal_uInt16 m_nColumnCount;
- long m_nLeft, m_nTop;
- long m_nWidth, m_nHeight;
- long m_nLeftMargin, m_nRightMargin;
+ tools::Long m_nLeft, m_nTop;
+ tools::Long m_nWidth, m_nHeight;
+ tools::Long m_nLeftMargin, m_nRightMargin;
SvxCSS1LengthType m_eLeftType, m_eTopType;
SvxCSS1LengthType m_eWidthType, m_eHeightType;
@@ -257,7 +257,7 @@ public:
static bool GetEnum( const CSS1PropertyEnum *pPropTable,
const OUString& rValue, sal_uInt16 &rEnum );
- static void PixelToTwip( long &nWidth, long &nHeight );
+ static void PixelToTwip( tools::Long &nWidth, tools::Long &nHeight );
// determine the font height of a certain font size (0-6)
virtual sal_uInt32 GetFontHeight( sal_uInt16 nSize ) const;
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index d5cd46f5e3db..c7810ee60ad6 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4843,7 +4843,7 @@ void SwHTMLParser::InsertSpacer()
sal_Int16 eVertOri = text::VertOrientation::TOP;
sal_Int16 eHoriOri = text::HoriOrientation::NONE;
Size aSize( 0, 0);
- long nSize = 0;
+ tools::Long nSize = 0;
bool bPercentWidth = false;
bool bPercentHeight = false;
sal_uInt16 nType = HTML_SPTYPE_HORI;
@@ -4868,12 +4868,12 @@ void SwHTMLParser::InsertSpacer()
case HtmlOptionId::WIDTH:
// First only save as pixel value!
bPercentWidth = (rOption.GetString().indexOf('%') != -1);
- aSize.setWidth( static_cast<long>(rOption.GetNumber()) );
+ aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::HEIGHT:
// First only save as pixel value!
bPercentHeight = (rOption.GetString().indexOf('%') != -1);
- aSize.setHeight( static_cast<long>(rOption.GetNumber()) );
+ aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) );
break;
case HtmlOptionId::SIZE:
// First only save as pixel value!
@@ -5011,7 +5011,7 @@ sal_uInt16 SwHTMLParser::ToTwips( sal_uInt16 nPixel )
{
if( nPixel && Application::GetDefaultDevice() )
{
- long nTwips = Application::GetDefaultDevice()->PixelToLogic(
+ tools::Long nTwips = Application::GetDefaultDevice()->PixelToLogic(
Size( nPixel, nPixel ), MapMode( MapUnit::MapTwip ) ).Width();
return static_cast<sal_uInt16>(std::min(nTwips, SwTwips(SAL_MAX_UINT16)));
}
@@ -5291,8 +5291,8 @@ void SwHTMLParser::InsertHorzRule()
SvxBorderLine aBorderLine( &aColor );
if( nSize )
{
- long nPWidth = 0;
- long nPHeight = static_cast<long>(nSize);
+ tools::Long nPWidth = 0;
+ tools::Long nPHeight = static_cast<tools::Long>(nSize);
SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight );
if ( !bNoShade )
{
@@ -5324,17 +5324,17 @@ void SwHTMLParser::InsertHorzRule()
if (!m_xTable)
{
// fake length and alignment of line above paragraph indents
- long nBrowseWidth = GetCurrentBrowseWidth();
+ tools::Long nBrowseWidth = GetCurrentBrowseWidth();
nWidth = bPercentWidth ? static_cast<sal_uInt16>((nWidth*nBrowseWidth) / 100)
: ToTwips( static_cast<sal_uInt16>(nBrowseWidth) );
if( nWidth < MINLAY )
nWidth = MINLAY;
- const SwFormatColl *pColl = (static_cast<long>(nWidth) < nBrowseWidth) ? GetCurrFormatColl() : nullptr;
+ const SwFormatColl *pColl = (static_cast<tools::Long>(nWidth) < nBrowseWidth) ? GetCurrFormatColl() : nullptr;
if (pColl)
{
SvxLRSpaceItem aLRItem( pColl->GetLRSpace() );
- long nDist = nBrowseWidth - nWidth;
+ tools::Long nDist = nBrowseWidth - nWidth;
switch( eAdjust )
{
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 8227668f8dde..ab282ba652ff 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -458,8 +458,8 @@ public:
inline void OutCSS1_Property( const char *pProp, const OUString& rVal );
void OutCSS1_Property( const char *pProp, const char *pVal,
const OUString *pSVal );
- void OutCSS1_UnitProperty( const char *pProp, long nVal );
- void OutCSS1_PixelProperty( const char *pProp, long nVal, bool bVert );
+ void OutCSS1_UnitProperty( const char *pProp, tools::Long nVal );
+ void OutCSS1_PixelProperty( const char *pProp, tools::Long nVal, bool bVert );
void OutCSS1_SfxItemSet( const SfxItemSet& rItemSet, bool bDeep=true );
// events of BODY tag from SFX configuration
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 338de25fcddd..2dbf2d6fae1e 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -165,7 +165,7 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr );
- virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, long nHand = LONG_MAX, bool consumedByField=false);
+ virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, tools::Long nHand = LONG_MAX, bool consumedByField=false);
void StealAttr(const SwNodeIndex& rNode);
void MarkAllAttrsOld();
@@ -234,7 +234,7 @@ class SW_DLLPUBLIC SwFltBookmark : public SfxPoolItem
{
private:
- long mnHandle;
+ tools::Long mnHandle;
OUString maName;
OUString maVal;
bool mbIsTOCBookmark;
@@ -242,14 +242,14 @@ private:
public:
SwFltBookmark( const OUString& rNa,
const OUString& rVa,
- long nHand,
+ tools::Long nHand,
const bool bIsTOCBookmark = false );
// "purely virtual methods" of SfxPoolItem
virtual bool operator==(const SfxPoolItem&) const override;
virtual SwFltBookmark* Clone(SfxItemPool* = nullptr) const override;
- long GetHandle() const { return mnHandle; }
+ tools::Long GetHandle() const { return mnHandle; }
const OUString& GetName() const { return maName; }
const OUString& GetValSys() const { return maVal; }
bool IsTOCBookmark() const
@@ -261,7 +261,7 @@ public:
/// Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph).
class SW_DLLPUBLIC SwFltRDFMark : public SfxPoolItem
{
- long m_nHandle;
+ tools::Long m_nHandle;
std::vector< std::pair<OUString, OUString> > m_aAttributes;
public:
@@ -270,8 +270,8 @@ public:
virtual bool operator==(const SfxPoolItem&) const override;
virtual SwFltRDFMark* Clone(SfxItemPool* = nullptr) const override;
- void SetHandle(long nHandle);
- long GetHandle() const;
+ void SetHandle(tools::Long nHandle);
+ tools::Long GetHandle() const;
void SetAttributes(const std::vector< std::pair<OUString, OUString> >& rAttributes);
const std::vector< std::pair<OUString, OUString> >& GetAttributes() const;
};
@@ -313,7 +313,7 @@ class ImportProgress
private:
SwDocShell *m_pDocShell;
public:
- ImportProgress(SwDocShell *pDocShell, long nStartVal, long nEndVal)
+ ImportProgress(SwDocShell *pDocShell, tools::Long nStartVal, tools::Long nEndVal)
: m_pDocShell(pDocShell)
{
::StartProgress(STR_STATSTR_W4WREAD, nStartVal, nEndVal, m_pDocShell);
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index 27710a11b842..33cfe6782fba 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -48,7 +48,7 @@ class SW_DLLPUBLIC SwWriteTableCell
const SwTableBox *pBox; // SwTableBox of the cell
const SvxBrushItem *pBackground; // inherited background of a row
- long nHeight; // fix/minimum height of a row
+ tools::Long nHeight; // fix/minimum height of a row
sal_uInt32 nWidthOpt; // width from option;
@@ -63,7 +63,7 @@ class SW_DLLPUBLIC SwWriteTableCell
public:
SwWriteTableCell(const SwTableBox *pB, sal_uInt16 nR, sal_uInt16 nC, sal_uInt16 nRSpan,
- sal_uInt16 nCSpan, long nHght, const SvxBrushItem *pBGround)
+ sal_uInt16 nCSpan, tools::Long nHght, const SvxBrushItem *pBGround)
: pBox( pB ), pBackground( pBGround ), nHeight( nHght ), nWidthOpt( 0 ),
nRow( nR ), nCol( nC ), nRowSpan( nRSpan ), nColSpan( nCSpan ),
bPercentWidthOpt( false )
@@ -77,7 +77,7 @@ public:
sal_uInt16 GetRowSpan() const { return nRowSpan; }
sal_uInt16 GetColSpan() const { return nColSpan; }
- long GetHeight() const { return nHeight; }
+ tools::Long GetHeight() const { return nHeight; }
sal_Int16 GetVertOri() const;
const SvxBrushItem *GetBackground() const { return pBackground; }
@@ -98,7 +98,7 @@ class SwWriteTableRow final
SwWriteTableCells m_Cells; ///< all cells of the rows
const SvxBrushItem *pBackground; // background
- long nPos; // end position (twips) of the row
+ tools::Long nPos; // end position (twips) of the row
bool mbUseLayoutHeights;
SwWriteTableRow & operator= (const SwWriteTableRow &) = delete;
@@ -114,12 +114,12 @@ public:
bool bTopBorder : 1; // which borders are there?
bool bBottomBorder : 1;
- SwWriteTableRow( long nPos, bool bUseLayoutHeights );
+ SwWriteTableRow( tools::Long nPos, bool bUseLayoutHeights );
SwWriteTableCell *AddCell( const SwTableBox *pBox,
sal_uInt16 nRow, sal_uInt16 nCol,
sal_uInt16 nRowSpan, sal_uInt16 nColSpan,
- long nHeight,
+ tools::Long nHeight,
const SvxBrushItem *pBackground );
void SetBackground( const SvxBrushItem *pBGround )
@@ -247,15 +247,15 @@ protected:
virtual bool ShouldExpandSub( const SwTableBox *pBox,
bool bExpandedBefore, sal_uInt16 nDepth ) const;
- void CollectTableRowsCols( long nStartRPos, sal_uInt32 nStartCPos,
- long nParentLineHeight,
+ void CollectTableRowsCols( tools::Long nStartRPos, sal_uInt32 nStartCPos,
+ tools::Long nParentLineHeight,
sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
sal_uInt16 nDepth );
- void FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
+ void FillTableRowsCols( tools::Long nStartRPos, sal_uInt16 nStartRow,
sal_uInt32 nStartCPos, sal_uInt16 nStartCol,
- long nParentLineHeight,
+ tools::Long nParentLineHeight,
sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
const SvxBrushItem* pLineBrush,
@@ -280,12 +280,12 @@ public:
sal_uInt16 GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const;
sal_uInt16 GetPercentWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const;
- long GetAbsHeight(long nRawWidth, size_t nRow, sal_uInt16 nRowSpan) const;
+ tools::Long GetAbsHeight(tools::Long nRawWidth, size_t nRow, sal_uInt16 nRowSpan) const;
double GetAbsWidthRatio() const { return m_nTabWidth == m_nBaseWidth ? 1.0 : double(m_nTabWidth) / m_nBaseWidth; }
protected:
- long GetLineHeight( const SwTableLine *pLine );
- static long GetLineHeight( const SwTableBox *pBox );
+ tools::Long GetLineHeight( const SwTableLine *pLine );
+ static tools::Long GetLineHeight( const SwTableBox *pBox );
static const SvxBrushItem *GetLineBrush( const SwTableBox *pBox,
SwWriteTableRow *pRow );
@@ -293,7 +293,7 @@ protected:
sal_uInt16 GetRightSpace(size_t nCol, sal_uInt16 nColSpan) const;
public:
- SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth,
+ SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, tools::Long nWidth, sal_uInt32 nBWidth,
bool bRel, sal_uInt16 nMaxDepth = USHRT_MAX,
sal_uInt16 nLeftSub=0, sal_uInt16 nRightSub=0, sal_uInt32 nNumOfRowsToRepeat=0);
SwWriteTable(const SwTable* pTable, const SwHTMLTableLayout *pLayoutInfo);
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 8319f5181024..2311111fe39a 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -223,7 +223,7 @@ void Writer::SetStream(SvStream *const pStream)
m_pImpl->m_pStream = pStream;
}
-SvStream& Writer::OutLong( SvStream& rStrm, long nVal )
+SvStream& Writer::OutLong( SvStream& rStrm, tools::Long nVal )
{
const bool bNeg = nVal < 0;
if (bNeg)
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 5135ee64ef58..3c9c031c16fb 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -54,7 +54,7 @@ sal_Int16 SwWriteTableCell::GetVertOri() const
return eCellVertOri;
}
-SwWriteTableRow::SwWriteTableRow( long nPosition, bool bUseLayoutHeights )
+SwWriteTableRow::SwWriteTableRow( tools::Long nPosition, bool bUseLayoutHeights )
: pBackground(nullptr), nPos(nPosition), mbUseLayoutHeights(bUseLayoutHeights),
nTopBorder(USHRT_MAX), nBottomBorder(USHRT_MAX), bTopBorder(true),
bBottomBorder(true)
@@ -64,7 +64,7 @@ SwWriteTableRow::SwWriteTableRow( long nPosition, bool bUseLayoutHeights )
SwWriteTableCell *SwWriteTableRow::AddCell( const SwTableBox *pBox,
sal_uInt16 nRow, sal_uInt16 nCol,
sal_uInt16 nRowSpan, sal_uInt16 nColSpan,
- long nHeight,
+ tools::Long nHeight,
const SvxBrushItem *pBackgroundBrush )
{
SwWriteTableCell *pCell =
@@ -90,14 +90,14 @@ sal_uInt32 SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
return sal::static_int_cast<sal_uInt32>(aFrameSize.GetSize().Width());
}
-long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
+tools::Long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
{
#ifdef DBG_UTIL
bool bOldGetLineHeightCalled = m_bGetLineHeightCalled;
m_bGetLineHeightCalled = true;
#endif
- long nHeight = 0;
+ tools::Long nHeight = 0;
if( m_bUseLayoutHeights )
{
// At first we try to get the height of the layout.
@@ -127,7 +127,7 @@ long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
}
else
{
- long nTmp = 0;
+ tools::Long nTmp = 0;
const SwTableLines &rLines = pBox->GetTabLines();
for( size_t nLine=0; nLine<rLines.size(); nLine++ )
{
@@ -141,7 +141,7 @@ long SwWriteTable::GetLineHeight( const SwTableLine *pLine )
return nHeight;
}
-long SwWriteTable::GetLineHeight( const SwTableBox *pBox )
+tools::Long SwWriteTable::GetLineHeight( const SwTableBox *pBox )
{
const SwTableLine *pLine = pBox->GetUpper();
@@ -152,7 +152,7 @@ long SwWriteTable::GetLineHeight( const SwTableBox *pBox )
const SfxPoolItem* pItem;
const SfxItemSet& rItemSet = pLineFrameFormat->GetAttrSet();
- long nHeight = 0;
+ tools::Long nHeight = 0;
if( SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ))
nHeight = static_cast<const SwFormatFrameSize*>(pItem)->GetHeight();
@@ -341,23 +341,23 @@ sal_uInt16 SwWriteTable::GetAbsWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) con
sal_uInt16 SwWriteTable::GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const
{
- long nWidth = GetRawWidth( nCol, nColSpan );
+ tools::Long nWidth = GetRawWidth( nCol, nColSpan );
- return static_cast<sal_uInt16>(static_cast<long>(Fraction( nWidth*256 + GetBaseWidth()/2,
+ return static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction( nWidth*256 + GetBaseWidth()/2,
GetBaseWidth() )));
}
sal_uInt16 SwWriteTable::GetPercentWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const
{
- long nWidth = GetRawWidth( nCol, nColSpan );
+ tools::Long nWidth = GetRawWidth( nCol, nColSpan );
// Looks funny, but is nothing more than
// [(100 * nWidth) + .5] without rounding errors
- return static_cast<sal_uInt16>(static_cast<long>(Fraction( nWidth*100 + GetBaseWidth()/2,
+ return static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction( nWidth*100 + GetBaseWidth()/2,
GetBaseWidth() )));
}
-long SwWriteTable::GetAbsHeight(long nRawHeight, size_t const nRow,
+tools::Long SwWriteTable::GetAbsHeight(tools::Long nRawHeight, size_t const nRow,
sal_uInt16 nRowSpan ) const
{
nRawHeight -= (2*m_nCellPadding + m_nCellSpacing);
@@ -396,9 +396,9 @@ bool SwWriteTable::ShouldExpandSub(const SwTableBox *pBox, bool /*bExpandedBefor
// FillTableRowsCols which is called immediately afterwards
// is -extremely- unpleasant and potentially problematic.
-void SwWriteTable::CollectTableRowsCols( long nStartRPos,
+void SwWriteTable::CollectTableRowsCols( tools::Long nStartRPos,
sal_uInt32 nStartCPos,
- long nParentLineHeight,
+ tools::Long nParentLineHeight,
sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
sal_uInt16 nDepth )
@@ -410,16 +410,16 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
sal_uInt32 nEndCPos = 0;
#endif
- long nRPos = nStartRPos;
+ tools::Long nRPos = nStartRPos;
for( SwTableLines::size_type nLine = 0; nLine < nLines; ++nLine )
{
/*const*/ SwTableLine *pLine = rLines[nLine];
- long nOldRPos = nRPos;
+ tools::Long nOldRPos = nRPos;
if( nLine < nLines-1 || nParentLineHeight==0 )
{
- long nLineHeight = GetLineHeight( pLine );
+ tools::Long nLineHeight = GetLineHeight( pLine );
nRPos += nLineHeight;
if( nParentLineHeight && nStartRPos + nParentLineHeight <= nRPos )
{
@@ -439,7 +439,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
else
{
#if OSL_DEBUG_LEVEL > 0
- long nCheckPos = nRPos + GetLineHeight( pLine );
+ tools::Long nCheckPos = nRPos + GetLineHeight( pLine );
#endif
nRPos = nStartRPos + nParentLineHeight;
#if OSL_DEBUG_LEVEL > 0
@@ -520,9 +520,9 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
}
}
-void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
+void SwWriteTable::FillTableRowsCols( tools::Long nStartRPos, sal_uInt16 nStartRow,
sal_uInt32 nStartCPos, sal_uInt16 nStartCol,
- long nParentLineHeight,
+ tools::Long nParentLineHeight,
sal_uInt32 nParentLineWidth,
const SwTableLines& rLines,
const SvxBrushItem* pParentBrush,
@@ -533,7 +533,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
bool bSubExpanded = false;
// Specifying the border
- long nRPos = nStartRPos;
+ tools::Long nRPos = nStartRPos;
sal_uInt16 nRow = nStartRow;
for( SwTableLines::size_type nLine = 0; nLine < nLines; ++nLine )
@@ -541,10 +541,10 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
const SwTableLine *pLine = rLines[nLine];
// Determine the position of the last covered row
- long nOldRPos = nRPos;
+ tools::Long nOldRPos = nRPos;
if( nLine < nLines-1 || nParentLineHeight==0 )
{
- long nLineHeight = GetLineHeight( pLine );
+ tools::Long nLineHeight = GetLineHeight( pLine );
nRPos += nLineHeight;
if( nParentLineHeight && nStartRPos + nParentLineHeight <= nRPos )
{
@@ -589,7 +589,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
const SfxPoolItem* pItem;
const SfxItemSet& rItemSet = pLineFrameFormat->GetAttrSet();
- long nHeight = 0;
+ tools::Long nHeight = 0;
if( SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ))
nHeight = static_cast<const SwFormatFrameSize*>(pItem)->GetHeight();
@@ -657,7 +657,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
sal_uInt16 nRowSpan = nRow - nOldRow + 1;
// The new table model may have true row span attributes
- const long nAttrRowSpan = pBox->getRowSpan();
+ const tools::Long nAttrRowSpan = pBox->getRowSpan();
if ( 1 < nAttrRowSpan )
nRowSpan = static_cast<sal_uInt16>(nAttrRowSpan);
else if ( nAttrRowSpan < 1 )
@@ -728,7 +728,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
}
}
-SwWriteTable::SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, long nWidth,
+SwWriteTable::SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, tools::Long nWidth,
sal_uInt32 nBWidth, bool bRel, sal_uInt16 nMaxDepth, sal_uInt16 nLSub, sal_uInt16 nRSub, sal_uInt32 nNumOfRowsToRepeat)
: m_pTable(pTable), m_nBorderColor(sal_uInt32(-1)), m_nCellSpacing(0), m_nCellPadding(0), m_nBorder(0),
m_nInnerBorder(0), m_nBaseWidth(nBWidth), m_nHeadEndRow(USHRT_MAX),
@@ -838,7 +838,7 @@ SwWriteTable::SwWriteTable(const SwTable* pTable, const SwHTMLTableLayout *pLayo
OSL_ENSURE( pBox,
"Table in Table can not be exported over layout" );
- long nHeight = bHeightExported ? 0 : GetLineHeight( pBox );
+ tools::Long nHeight = bHeightExported ? 0 : GetLineHeight( pBox );
const SvxBrushItem *pBrushItem = GetLineBrush( pBox, pRow );
SwWriteTableCell *pCell =
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 7eb51d6f287c..98217348baf9 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -201,7 +201,7 @@ GridColsPtr WW8TableNodeInfoInner::getGridColsOfRow(AttributeOutputBase & rBase,
const SwFormatFrameSize &rSize = pFormat->GetFrameSize();
unsigned long nTableSz = static_cast<unsigned long>(rSize.GetWidth());
- long nPageSize = 0;
+ tools::Long nPageSize = 0;
bool bRelBoxSize = false;
rBase.GetTablePageSize( this, nPageSize, bRelBoxSize );
@@ -1033,7 +1033,7 @@ WW8TableCellGrid::~WW8TableCellGrid()
{
}
-WW8TableCellGridRow::Pointer_t WW8TableCellGrid::getRow(long nTop, bool bCreate)
+WW8TableCellGridRow::Pointer_t WW8TableCellGrid::getRow(tools::Long nTop, bool bCreate)
{
WW8TableCellGridRow::Pointer_t pResult;
@@ -1064,12 +1064,12 @@ WW8TableCellGrid::RowTops_t::const_iterator WW8TableCellGrid::getRowTopsEnd() co
return m_aRowTops.end();
}
-CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsBegin(long nTop)
+CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsBegin(tools::Long nTop)
{
return getRow(nTop)->begin();
}
-CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(long nTop)
+CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(tools::Long nTop)
{
return getRow(nTop)->end();
}
@@ -1103,7 +1103,7 @@ void WW8TableCellGrid::addShadowCells()
bool bBeginningOfCell = true;
bool bVertMerge = false;
SwRect aRect = aCellIt->getRect();
- long nRowSpan = 1;
+ tools::Long nRowSpan = 1;
while (aCellIt != aCellEndIt)
{
WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo();
@@ -1181,7 +1181,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds)
sal_uInt32 nDepthInCell = 0;
while (aCellIt != aCellEndIt)
{
- long nCellX = aCellIt->left();
+ tools::Long nCellX = aCellIt->left();
WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo();
if (pNodeInfo)
{
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index 1f344d4f019e..ca2cfb2c9252 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -130,12 +130,12 @@ public:
bool operator < (const CellInfo & aCellInfo) const;
- long top() const { return m_aRect.Top(); }
- long bottom() const { return m_aRect.Bottom(); }
- long left() const { return m_aRect.Left(); }
- long right() const { return m_aRect.Right(); }
- long width() const { return m_aRect.Width(); }
- long height() const { return m_aRect.Height(); }
+ tools::Long top() const { return m_aRect.Top(); }
+ tools::Long bottom() const { return m_aRect.Bottom(); }
+ tools::Long left() const { return m_aRect.Left(); }
+ tools::Long right() const { return m_aRect.Right(); }
+ tools::Long width() const { return m_aRect.Width(); }
+ tools::Long height() const { return m_aRect.Height(); }
const SwRect& getRect() const { return m_aRect; }
WW8TableNodeInfo * getTableNodeInfo() const
{ return m_pNodeInfo; }
@@ -261,11 +261,11 @@ class WW8TableCellGrid
RowTops_t m_aRowTops;
Rows_t m_aRows;
- WW8TableCellGridRow::Pointer_t getRow(long nTop, bool bCreate = true);
+ WW8TableCellGridRow::Pointer_t getRow(tools::Long nTop, bool bCreate = true);
RowTops_t::const_iterator getRowTopsBegin() const;
RowTops_t::const_iterator getRowTopsEnd() const;
- CellInfoMultiSet::const_iterator getCellsBegin(long nTop);
- CellInfoMultiSet::const_iterator getCellsEnd(long nTop);
+ CellInfoMultiSet::const_iterator getCellsBegin(tools::Long nTop);
+ CellInfoMultiSet::const_iterator getCellsEnd(tools::Long nTop);
public:
typedef std::shared_ptr<WW8TableCellGrid> Pointer_t;
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 89865c7de7f5..327f1fa9d26d 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -666,7 +666,7 @@ public:
void GetTablePageSize
( ww8::WW8TableNodeInfoInner const * pTableTextNodeInfoInner,
- long& rPageSize, bool& rRelBoxSize );
+ tools::Long& rPageSize, bool& rRelBoxSize );
virtual void MaybeOutputBrushItem(SfxItemSet const&) { }
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 59656cce9d3e..76c40c207e36 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3623,7 +3623,7 @@ void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t
if (m_xTableWrt && pTable == m_xTableWrt->GetTable())
return;
- long nPageSize = 0;
+ tools::Long nPageSize = 0;
bool bRelBoxSize = false;
// Create the SwWriteTable instance to use col spans (and maybe other infos)
@@ -3868,7 +3868,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
// prepend the properties before the run
m_pSerializer->mark(Tag_TableDefinition, comphelper::containerToSequence(aOrder));
- long nPageSize = 0;
+ tools::Long nPageSize = 0;
const char* widthType = "dxa";
// If actual width of table is relative it should export is as "pct".`
@@ -4039,7 +4039,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
// from lcl_DecrementHoriOrientPosition() in writerfilter
if (const editeng::SvxBorderLine* pLeftBorder = rBox.GetLeft())
{
- long nWidth = pLeftBorder->GetWidth();
+ tools::Long nWidth = pLeftBorder->GetWidth();
nValue += (nWidth / 2);
}
@@ -5673,7 +5673,7 @@ void DocxAttributeOutput::WriteOLEShape(const SwFlyFrameFormat& rFrameFormat, co
{
//Get the left border color and width
const Color aLineColor = rBox.GetLeft()->GetColor();
- const long aLineWidth = rBox.GetLeft()->GetWidth();
+ const tools::Long aLineWidth = rBox.GetLeft()->GetWidth();
//Convert the left OLE border style to OOXML
//FIXME improve if it's necessary
@@ -8443,7 +8443,7 @@ void DocxAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows )
}
static void impl_WriteTabElement( FSHelperPtr const & pSerializer,
- const SvxTabStop& rTab, long tabsOffset )
+ const SvxTabStop& rTab, tools::Long tabsOffset )
{
FastAttributeList *pTabElementAttrList = FastSerializerHelper::createAttrList();
@@ -8518,7 +8518,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop )
// Get offset for tabs
// In DOCX, w:pos specifies the position of the current custom tab stop with respect to the current page margins.
// But in ODT, zero position could be page margins or paragraph indent according to used settings.
- long tabsOffset = 0;
+ tools::Long tabsOffset = 0;
if (m_rExport.m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT))
tabsOffset = m_rExport.GetItem(RES_LR_SPACE).GetTextLeft();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index d18c1daafd30..a1656ea75fab 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -428,7 +428,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
awt::Point aPos(pFrameFormat->GetHoriOrient().GetPos(),
pFrameFormat->GetVertOrient().GetPos());
const SdrObject* pObj = pFrameFormat->FindRealSdrObject();
- long nRotation = 0;
+ tools::Long nRotation = 0;
if (pObj != nullptr)
{
// SdrObjects know their layer, consider that instead of the frame format.
@@ -713,9 +713,9 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
* 2147483647( MAX_INTEGER_VALUE ).
* Therefore changing the following accordingly so that LO sync's up with MSO.
**/
- sal_uInt64 cx = TwipsToEMU(std::clamp(rSize.Width(), 0L, long(SAL_MAX_INT32)));
+ sal_uInt64 cx = TwipsToEMU(std::clamp(rSize.Width(), 0L, tools::Long(SAL_MAX_INT32)));
OString aWidth(OString::number(std::min(cx, sal_uInt64(SAL_MAX_INT32))));
- sal_uInt64 cy = TwipsToEMU(std::clamp(rSize.Height(), 0L, long(SAL_MAX_INT32)));
+ sal_uInt64 cy = TwipsToEMU(std::clamp(rSize.Height(), 0L, tools::Long(SAL_MAX_INT32)));
OString aHeight(OString::number(std::min(cy, sal_uInt64(SAL_MAX_INT32))));
m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_extent, XML_cx, aWidth, XML_cy, aHeight);
diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index 6bdb7d03b450..91f90685a18e 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -96,7 +96,7 @@ private:
protected:
WW8Export& rWrt;
SvStream* pEscherStrm;
- long mnEmuMul, mnEmuDiv;
+ tools::Long mnEmuMul, mnEmuDiv;
virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eShapeType,
EscherPropertyContainer& rPropOpt);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index c91acb378f6d..9e76b3d3fd48 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -963,7 +963,7 @@ void RtfAttributeOutput::InitTableHelper(
if (m_pTableWrt && pTable == m_pTableWrt->GetTable())
return;
- long nPageSize = 0;
+ tools::Long nPageSize = 0;
bool bRelBoxSize = false;
// Create the SwWriteTable instance to use col spans
@@ -2930,7 +2930,7 @@ void RtfAttributeOutput::ParaWidows(const SvxWidowsItem& rWidows)
void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop)
{
- long nOffset = 0;
+ tools::Long nOffset = 0;
// Tabs are absolute by default.
if (m_rExport.m_rDoc.getIDocumentSettingAccess().get(
DocumentSettingId::TABS_RELATIVE_TO_INDENT))
@@ -3955,8 +3955,8 @@ static OString ExportPICT(const SwFlyFrameFormat* pFlyFrameFormat, const Size& r
aRet.append("}"); //"}"
}
- long nXCroppedSize = rOrig.Width() - (rCr.GetLeft() + rCr.GetRight());
- long nYCroppedSize = rOrig.Height() - (rCr.GetTop() + rCr.GetBottom());
+ tools::Long nXCroppedSize = rOrig.Width() - (rCr.GetLeft() + rCr.GetRight());
+ tools::Long nYCroppedSize = rOrig.Height() - (rCr.GetTop() + rCr.GetBottom());
/* Graphic with a zero height or width, typically copied from webpages, caused crashes. */
if (!nXCroppedSize)
nXCroppedSize = 100;
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index bc07a5c4d0ac..d5041849da32 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1074,7 +1074,7 @@ void RtfExport::resetStream() { m_pStream.reset(); }
SvStream& RtfExport::OutULong(sal_uLong nVal) { return Writer::OutULong(Strm(), nVal); }
-SvStream& RtfExport::OutLong(long nVal) { return Writer::OutLong(Strm(), nVal); }
+SvStream& RtfExport::OutLong(tools::Long nVal) { return Writer::OutLong(Strm(), nVal); }
void RtfExport::OutUnicode(const char* pToken, const OUString& rContent, bool bUpr)
{
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 3b4f3b4b79d5..f95e75c5dbfb 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -184,7 +184,7 @@ public:
/// Return back to the real stream.
void resetStream();
SvStream& OutULong(sal_uLong nVal);
- SvStream& OutLong(long nVal);
+ SvStream& OutLong(tools::Long nVal);
void OutUnicode(const char* pToken, const OUString& rContent, bool bUpr = false);
void OutDateTime(const char* pStr, const css::util::DateTime& rDT);
void OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage);
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 81978c9bb106..87a559ed60f9 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -658,8 +658,8 @@ sal_Int32 RtfSdrExport::StartShape()
rItemSet.GetItem(SID_ATTR_CHAR_FONTHEIGHT));
if (pFontHeight)
{
- long nFontHeight = TransformMetric(pFontHeight->GetHeight(), FieldUnit::TWIP,
- FieldUnit::POINT);
+ tools::Long nFontHeight = TransformMetric(pFontHeight->GetHeight(),
+ FieldUnit::TWIP, FieldUnit::POINT);
lcl_AppendSP(
m_rAttrOutput.RunText(), "gtextSize",
msfilter::rtfutil::OutString(OUString::number(nFontHeight * RTF_MULTIPLIER),
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 7416b176bbef..97f09efba839 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -682,7 +682,7 @@ namespace sw
const Size &rSize = pNd->GetTwipSize();
Fraction aMoveHack(ww::nWrap100Percent, rSize.Width());
aMoveHack *= Fraction(15, 1);
- long nMove(aMoveHack);
+ tools::Long nMove(aMoveHack);
Fraction aHackX(ww::nWrap100Percent + nMove,
ww::nWrap100Percent);
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 988890f66fd7..ce38776ac52d 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -65,7 +65,7 @@ namespace myImplHelpers
Otherwise we have to get the real layout rendered
height, which is totally nonoptimum, but the best we can do.
*/
- long nDist=0;
+ tools::Long nDist=0;
const SwFormatFrameSize& rSz = rFormat.GetFrameSize();
const SwHeaderAndFooterEatSpacingItem &rSpacingCtrl =
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 426a0d094e13..97437d754923 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -553,7 +553,7 @@ sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
return bRet;
}
-static bool RTLDrawingsHack(long &rLeft,
+static bool RTLDrawingsHack(tools::Long &rLeft,
sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
SwTwips nPageRight, SwTwips nPageSize)
{
@@ -677,12 +677,12 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
aRect = pObj->GetLogicRect();
// rotating to vertical means swapping height and width as seen in SvxMSDffManager::ImportShape
- const long nAngle = NormAngle36000( pObj->GetRotateAngle() );
+ const tools::Long nAngle = NormAngle36000( pObj->GetRotateAngle() );
const bool bAllowSwap = pObj->GetObjIdentifier() != OBJ_LINE && pObj->GetObjIdentifier() != OBJ_GRUP;
if ( bAllowSwap && (( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 )) )
{
- const long nWidth = aRect.getWidth();
- const long nHeight = aRect.getHeight();
+ const tools::Long nWidth = aRect.getWidth();
+ const tools::Long nHeight = aRect.getHeight();
aRect.setWidth( nHeight );
aRect.setHeight( nWidth );
bHasHeightWidthSwapped = true;
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f853af98aa83..b28c2bd4d2cf 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -227,9 +227,9 @@ void WW8_WrtBookmarks::Append( WW8_CP nStartCp, const OUString& rNm)
if (aResult.second)
{
BKMK aBK(false,rNm);
- BKMKCP* pBKCP = new BKMKCP(static_cast<long>(nStartCp),aBK);
+ BKMKCP* pBKCP = new BKMKCP(static_cast<tools::Long>(nStartCp),aBK);
aSttCps.insert(std::pair<long,BKMKCP*>(nStartCp,pBKCP));
- aResult.first->second = static_cast<long>(nStartCp);
+ aResult.first->second = static_cast<tools::Long>(nStartCp);
}
else
{
@@ -240,7 +240,7 @@ void WW8_WrtBookmarks::Append( WW8_CP nStartCp, const OUString& rNm)
{
if (aItr->second->second.first)
nStartCp--;
- aItr->second->first = static_cast<long>(nStartCp);
+ aItr->second->first = static_cast<tools::Long>(nStartCp);
break;
}
}
@@ -251,7 +251,7 @@ void WW8_WrtBookmarks::Write( WW8Export& rWrt)
{
if (aSttCps.empty())
return;
- long n;
+ tools::Long n;
std::vector<OUString> aNames;
SvMemoryStream aTempStrm1(65535,65535);
SvMemoryStream aTempStrm2(65535,65535);
@@ -307,7 +307,7 @@ void WW8_WrtBookmarks::MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo)
{
if (aItr->second)
{
- if (aItr->second->first == static_cast<long>(nFrom))
+ if (aItr->second->first == static_cast<tools::Long>(nFrom))
{
aItr->second->second.first = true;
aItr->second->first = nTo;
@@ -985,7 +985,7 @@ void WW8_WrPlcPn::AppendFkpEntry(WW8_FC nEndFc,short nVarLen,const sal_uInt8* pS
*p++ = *pSprms++;
nVarLen -= 2;
- long nDataPos = rWrt.pDataStrm->Tell();
+ tools::Long nDataPos = rWrt.pDataStrm->Tell();
SwWW8Writer::WriteShort( *rWrt.pDataStrm, nVarLen );
rWrt.pDataStrm->WriteBytes(pSprms, nVarLen);
@@ -2175,7 +2175,7 @@ void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTab
const SwFrameFormat * pLineFormat = pTabLine->GetFrameFormat();
// output line height sprmTDyaRowHeight
- long nHeight = 0;
+ tools::Long nHeight = 0;
const SwFormatFrameSize& rLSz = pLineFormat->GetFrameSize();
if ( SwFrameSize::Variable != rLSz.GetHeightSizeType() && rLSz.GetHeight() )
{
@@ -2430,9 +2430,9 @@ ww8::WidthsPtr AttributeOutputBase::GetColumnWidths( ww8::WW8TableNodeInfoInner:
return pTableTextNodeInfoInner->getGridColsOfRow(*this, true);
}
-void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner const * pTableTextNodeInfoInner, long& rPageSize, bool& rRelBoxSize )
+void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner const * pTableTextNodeInfoInner, tools::Long& rPageSize, bool& rRelBoxSize )
{
- long nPageSize = 0;
+ tools::Long nPageSize = 0;
const SwNode *pTextNd = pTableTextNodeInfoInner->getNode( );
const SwTable *pTable = pTableTextNodeInfoInner->getTable( );
@@ -3779,7 +3779,7 @@ ErrCode SwWW8Writer::WriteStorageImpl()
if( pViewShell != nullptr )
pViewShell->CalcLayout();
- long nMaxNode = m_pDoc->GetNodes().Count();
+ tools::Long nMaxNode = m_pDoc->GetNodes().Count();
::StartProgress( STR_STATSTR_W4WWRITE, 0, nMaxNode, m_pDoc->GetDocShell() );
// Respect table at the beginning of the document
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 73d31b68245b..aaa5dcead827 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -118,7 +118,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, tools::SvRef<SotStora
don't need to store another preview
*/
GDIMetaFile aWMF;
- long nX=0,nY=0;
+ tools::Long nX=0,nY=0;
if (!bGraphicNeeded && SwWW8ImplReader::ImportOleWMF(xOleStg,aWMF,nX,nY))
{
// bGraphicNeeded set to true is right / fixes #i51670#.
@@ -411,7 +411,7 @@ void WW8Export::OutGrf(const ww8::Frame &rFrame)
SwTwips nHeight = rFlyFormat.GetFrameSize().GetHeight();
nHeight/=20; //nHeight was in twips, want it in half points, but
//then half of total height.
- long nFontHeight = GetItem(RES_CHRATR_FONTSIZE).GetHeight();
+ tools::Long nFontHeight = GetItem(RES_CHRATR_FONTSIZE).GetHeight();
nHeight-=nFontHeight/20;
Set_UInt16( pArr, NS_sprm::CHpsPos::val );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 068601af0637..9604d4237269 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3164,7 +3164,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
sal_uInt16 nScript = g_pBreakIt->GetBreakIter()->getScriptType( pField->GetPar1(), 0);
- long nHeight = static_cast<const SvxFontHeightItem&>((GetExport().GetItem(
+ tools::Long nHeight = static_cast<const SvxFontHeightItem&>((GetExport().GetItem(
GetWhichOfScript(RES_CHRATR_FONTSIZE,nScript)))).GetHeight();
nHeight = (nHeight + 10) / 20; //Font Size in points;
@@ -4917,8 +4917,8 @@ class SwWW8WrTabu
public:
SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax);
- void Add(const SvxTabStop &rTS, long nAdjustment);
- void Del(const SvxTabStop &rTS, long nAdjustment);
+ void Add(const SvxTabStop &rTS, tools::Long nAdjustment);
+ void Del(const SvxTabStop &rTS, tools::Long nAdjustment);
void PutAll(WW8Export& rWW8Wrt);
};
@@ -4936,7 +4936,7 @@ SwWW8WrTabu::SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax)
/**
* insert a tab in the WW structure
*/
-void SwWW8WrTabu::Add(const SvxTabStop & rTS, long nAdjustment)
+void SwWW8WrTabu::Add(const SvxTabStop & rTS, tools::Long nAdjustment)
{
// insert tab position
ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment),
@@ -4988,7 +4988,7 @@ void SwWW8WrTabu::Add(const SvxTabStop & rTS, long nAdjustment)
/**
* Insert a to be deleted tab in the WW structure
*/
-void SwWW8WrTabu::Del(const SvxTabStop &rTS, long nAdjustment)
+void SwWW8WrTabu::Del(const SvxTabStop &rTS, tools::Long nAdjustment)
{
// insert tab position
ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment),
@@ -5028,7 +5028,7 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt)
static void ParaTabStopAdd( WW8Export& rWrt,
const SvxTabStopItem& rTStops,
- const long nLParaMgn )
+ const tools::Long nLParaMgn )
{
SwWW8WrTabu aTab( 0, rTStops.Count());
@@ -5042,8 +5042,8 @@ static void ParaTabStopAdd( WW8Export& rWrt,
aTab.PutAll( rWrt );
}
-static bool lcl_IsEqual(long nOneLeft, const SvxTabStop &rOne,
- long nTwoLeft, const SvxTabStop &rTwo)
+static bool lcl_IsEqual(tools::Long nOneLeft, const SvxTabStop &rOne,
+ tools::Long nTwoLeft, const SvxTabStop &rTwo)
{
return(
nOneLeft == nTwoLeft &&
@@ -5055,9 +5055,9 @@ static bool lcl_IsEqual(long nOneLeft, const SvxTabStop &rOne,
static void ParaTabStopDelAdd( WW8Export& rWrt,
const SvxTabStopItem& rTStyle,
- const long nLStypeMgn,
+ const tools::Long nLStypeMgn,
const SvxTabStopItem& rTNew,
- const long nLParaMgn )
+ const tools::Long nLParaMgn )
{
SwWW8WrTabu aTab(rTStyle.Count(), rTNew.Count());
@@ -5066,7 +5066,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
do {
const SvxTabStop* pTO;
- long nOP;
+ tools::Long nOP;
if( nO < rTStyle.Count() ) // old not yet at the end?
{
pTO = &rTStyle[ nO ];
@@ -5084,7 +5084,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
}
const SvxTabStop* pTN;
- long nNP;
+ tools::Long nNP;
if( nN < rTNew.Count() ) // new not yet at the end
{
pTN = &rTNew[ nN ];
@@ -5137,7 +5137,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
{
const bool bTabsRelativeToIndex = m_rWW8Export.m_pCurPam->GetDoc().getIDocumentSettingAccess().get( DocumentSettingId::TABS_RELATIVE_TO_INDENT );
- long nCurrentLeft = 0;
+ tools::Long nCurrentLeft = 0;
if ( bTabsRelativeToIndex )
{
const SfxPoolItem* pLR = m_rWW8Export.HasItem( RES_LR_SPACE );
@@ -5161,7 +5161,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
}
// #i120938# - consider left indentation of style and its parent style
- long nParentLeft = 0;
+ tools::Long nParentLeft = 0;
if ( bTabsRelativeToIndex )
{
const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>( pParentStyle->GetAttrSet(), RES_LR_SPACE );
@@ -5184,7 +5184,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
}
else
{
- long nStyleLeft = 0;
+ tools::Long nStyleLeft = 0;
if ( bTabsRelativeToIndex )
{
const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>(*m_rWW8Export.m_pStyAttr, RES_LR_SPACE);
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 2bb012ea6782..2a98d6ad3570 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -462,7 +462,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD const * pHd, SfxAllItemSet &
return pObj;
}
-static ESelection GetESelection(EditEngine const &rDrawEditEngine, long nCpStart, long nCpEnd)
+static ESelection GetESelection(EditEngine const &rDrawEditEngine, tools::Long nCpStart, tools::Long nCpEnd)
{
sal_Int32 nPCnt = rDrawEditEngine.GetParagraphCount();
sal_Int32 nSP = 0;
@@ -561,15 +561,15 @@ class Chunk
{
private:
OUString msURL;
- long mnStartPos; // 0x13
- long mnEndPos; // 0x15
+ tools::Long mnStartPos; // 0x13
+ tools::Long mnEndPos; // 0x15
public:
- explicit Chunk(long nStart, const OUString &rURL)
+ explicit Chunk(tools::Long nStart, const OUString &rURL)
: msURL(rURL), mnStartPos(nStart), mnEndPos(0) {}
- void SetEndPos(long nEnd) { mnEndPos = nEnd; }
- long GetStartPos() const {return mnStartPos;}
- long GetEndPos() const {return mnEndPos;}
+ void SetEndPos(tools::Long nEnd) { mnEndPos = nEnd; }
+ tools::Long GetStartPos() const {return mnStartPos;}
+ tools::Long GetEndPos() const {return mnEndPos;}
const OUString &GetURL() const {return msURL;}
void Adjust(sal_Int32 nAdjust)
{
@@ -836,8 +836,8 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
// special case: entire chain should be determined - done!
if( USHRT_MAX > nSequence )
{
- long nMinStartCp = rStartCp;
- long nMaxEndCp = rEndCp;
+ tools::Long nMinStartCp = rStartCp;
+ tools::Long nMaxEndCp = rEndCp;
// quickly grab the TextBox-Break-Descriptor-PLCF
pT = m_xPlcxMan->GetTxbxBkd();
if (!pT) // It can occur on occasion, Caolan
@@ -882,7 +882,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
// TxbxText() grabs the text from the WW file and returns that along with
// the StartCp and the corrected (by -2, or -1 for version 8) EndCp.
-sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, long nStartCp, long nEndCp, ManTypes eType)
+sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, tools::Long nStartCp, tools::Long nEndCp, ManTypes eType)
{
WW8_CP nOffset = 0;
m_xWwFib->GetBaseCp(eType, &nOffset); //TODO: check return value
@@ -1003,9 +1003,9 @@ std::unique_ptr<OutlinerParaObject> SwWW8ImplReader::ImportAsOutliner(OUString &
// InsertTxbxText() adds the Text and the Attributes for TextBoxes and CaptionBoxes
void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
- Size const * pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp,
+ Size const * pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence, tools::Long nPosCp,
SwFrameFormat const * pOldFlyFormat, bool bMakeSdrGrafObj, bool& rbEraseTextObj,
- bool* pbTestTxbxContainsText, long* pnStartCp, long* pnEndCp,
+ bool* pbTestTxbxContainsText, tools::Long* pnStartCp, tools::Long* pnEndCp,
bool* pbContainsGraphics, SvxMSDffImportRec const * pRecord)
{
SwFrameFormat* pFlyFormat = nullptr;
@@ -1206,8 +1206,8 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
*pbContainsGraphics = bContainsGraphics;
}
-bool SwWW8ImplReader::TxbxChainContainsRealText(sal_uInt16 nTxBxS, long& rStartCp,
- long& rEndCp)
+bool SwWW8ImplReader::TxbxChainContainsRealText(sal_uInt16 nTxBxS, tools::Long& rStartCp,
+ tools::Long& rEndCp)
{
bool bErase, bContainsText;
InsertTxbxText( nullptr,nullptr,nTxBxS,USHRT_MAX,0,nullptr,false, bErase, &bContainsText,
@@ -1239,7 +1239,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &r
Size aSize( static_cast<sal_Int16>(SVBT16ToUInt16( pHd->dxa )) ,
static_cast<sal_Int16>(SVBT16ToUInt16( pHd->dya )) );
- long nStartCpFly,nEndCpFly;
+ tools::Long nStartCpFly,nEndCpFly;
bool bContainsGraphics;
InsertTxbxText(pObj, &aSize, 0, 0, 0, nullptr, false,
bDummy,nullptr,&nStartCpFly,&nEndCpFly,&bContainsGraphics);
@@ -1419,7 +1419,7 @@ SdrObject* SwWW8ImplReader::ReadGrafPrimitive(short& rLeft, SfxAllItemSet &rSet)
return pRet;
}
-void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp )
+void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, tools::Long nGrafAnchorCp )
{
pPF->SeekPos( nGrafAnchorCp );
WW8_FC nStartFc;
@@ -2050,7 +2050,7 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(SvxMSDffImportRec const * pRecord,
*/
Fraction aMoveHack(ww::nWrap100Percent, rSize.Width());
aMoveHack *= Fraction(15, 1);
- long nMove(aMoveHack);
+ tools::Long nMove(aMoveHack);
aPoly.Move(nMove, 0);
Fraction aHackX(ww::nWrap100Percent, ww::nWrap100Percent + nMove);
@@ -2352,7 +2352,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
// convert 'left to page' to 'from left -<width> to page text area'
eHoriOri = text::HoriOrientation::NONE;
eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
- const long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft;
+ const tools::Long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft;
pFSPA->nXaLeft = -nWidth;
pFSPA->nXaRight = 0;
}
@@ -2361,7 +2361,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
// convert 'right to page' to 'from left 0 to right page border'
eHoriOri = text::HoriOrientation::NONE;
eHoriRel = text::RelOrientation::PAGE_RIGHT;
- const long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft;
+ const tools::Long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft;
pFSPA->nXaLeft = 0;
pFSPA->nXaRight = nWidth;
}
@@ -2418,7 +2418,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
// Below line in word is a positive value, while in writer its
// negative
- long nYPos = pFSPA->nYaTop;
+ tools::Long nYPos = pFSPA->nYaTop;
// #i22673#
if ((eVertRel == text::RelOrientation::TEXT_LINE) && (eVertOri == text::VertOrientation::NONE))
nYPos = -nYPos;
@@ -2501,7 +2501,7 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTable
return bIsObjectLayoutInTableCell;
}
-SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
+SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp )
{
if( m_nIniFlags & WW8FL_NO_GRAFLAYER )
return nullptr;
@@ -2522,7 +2522,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
if( m_bVer67 )
{
- long nOldPos = m_pStrm->Tell();
+ tools::Long nOldPos = m_pStrm->Tell();
m_nDrawXOfs = m_nDrawYOfs = 0;
ReadGrafLayer1( pPF, nGrafAnchorCp );
@@ -2863,7 +2863,7 @@ SwFrameFormat *SwWW8ImplReader::AddAutoAnchor(SwFrameFormat *pFormat)
}
SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SvxMSDffImportRec *pRecord,
- long nGrafAnchorCp, SwFrameFormat* pRetFrameFormat)
+ tools::Long nGrafAnchorCp, SwFrameFormat* pRetFrameFormat)
{
SdrObject* pTrueObject = pRecord->pObj;
@@ -2962,8 +2962,8 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject,
WW8_FSPA const *pF, SfxItemSet &rFlySet)
{
SwFlyFrameFormat* pRetFrameFormat = nullptr;
- long nStartCp;
- long nEndCp;
+ tools::Long nStartCp;
+ tools::Long nEndCp;
// Check if this textbox chain contains text as conversion of an empty
// chain would not make sense.
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index a540648b85f4..3cb16f6422b8 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -267,7 +267,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, std::unique_ptr<Graphic>
// the first 512 Bytes which are not relevant in a MAC-PICT (they are not
// interpreted)
bOk = false;
- long nData = rPic.lcb - ( pSt->Tell() - nPosFc );
+ tools::Long nData = rPic.lcb - ( pSt->Tell() - nPosFc );
if (nData > 0)
{
rpGraphic.reset(new Graphic());
@@ -281,7 +281,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, std::unique_ptr<Graphic>
struct WW8PicDesc
{
sal_Int16 nCL, nCR, nCT, nCB;
- long nWidth, nHeight;
+ tools::Long nWidth, nHeight;
explicit WW8PicDesc( const WW8_PIC& rPic );
};
@@ -293,12 +293,12 @@ WW8PicDesc::WW8PicDesc( const WW8_PIC& rPic )
nCB(rPic.dyaCropBottom)
{
//See #i21190# before fiddling with this method
- long nOriWidth = rPic.dxaGoal; //Size in 1/100 mm before crop
- long nOriHeight = rPic.dyaGoal;
+ tools::Long nOriWidth = rPic.dxaGoal; //Size in 1/100 mm before crop
+ tools::Long nOriHeight = rPic.dyaGoal;
- long nCurrentWidth = nOriWidth - (nCL + nCR); // Size after crop
- long nCurrentHeight = nOriHeight - (nCT + nCB);
+ tools::Long nCurrentWidth = nOriWidth - (nCL + nCR); // Size after crop
+ tools::Long nCurrentHeight = nOriHeight - (nCT + nCB);
if (!nCurrentWidth)
nCurrentWidth = 1;
if (!nCurrentHeight)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 450e2f62916f..c535dd054588 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -751,7 +751,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
{
if (nTextRotationAngle == 9000)
{
- long nWidth = rTextRect.GetWidth();
+ tools::Long nWidth = rTextRect.GetWidth();
rTextRect.SetRight( rTextRect.Left() + rTextRect.GetHeight() );
rTextRect.SetBottom( rTextRect.Top() + nWidth );
@@ -767,7 +767,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
}
else if (nTextRotationAngle == 27000)
{
- long nWidth = rTextRect.GetWidth();
+ tools::Long nWidth = rTextRect.GetWidth();
rTextRect.SetRight( rTextRect.Left() + rTextRect.GetHeight() );
rTextRect.SetBottom( rTextRect.Top() + nWidth );
@@ -924,7 +924,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
{
if ( nTextRotationAngle )
{
- long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
+ tools::Long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
rTextRect.GetWidth() : rTextRect.GetHeight();
nMinWH /= 2;
Point aPivot(rTextRect.TopLeft());
@@ -1192,7 +1192,7 @@ void SwWW8FltControlStack::NewAttr(const SwPosition& rPos,
}
SwFltStackEntry* SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId,
- bool bTstEnd, long nHand, bool )
+ bool bTstEnd, tools::Long nHand, bool )
{
SwFltStackEntry *pRet = nullptr;
// Doing a textbox, and using the control stack only as a temporary
@@ -1216,13 +1216,13 @@ SwFltStackEntry* SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt1
return pRet;
}
-long GetListFirstLineIndent(const SwNumFormat &rFormat)
+tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat)
{
OSL_ENSURE( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION,
"<GetListFirstLineIndent> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" );
SvxAdjust eAdj = rFormat.GetNumAdjust();
- long nReverseListIndented;
+ tools::Long nReverseListIndented;
if (eAdj == SvxAdjust::Right)
nReverseListIndented = -rFormat.GetCharTextDistance();
else if (eAdj == SvxAdjust::Center)
@@ -1232,19 +1232,19 @@ long GetListFirstLineIndent(const SwNumFormat &rFormat)
return nReverseListIndented;
}
-static long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFormat &rFormat,
- long &rFirstLinePos)
+static tools::Long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFormat &rFormat,
+ tools::Long &rFirstLinePos)
{
OSL_ENSURE( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION,
"<lcl_GetTrueMargin> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" );
- const long nBodyIndent = rLR.GetTextLeft();
- const long nFirstLineDiff = rLR.GetTextFirstLineOffset();
+ const tools::Long nBodyIndent = rLR.GetTextLeft();
+ const tools::Long nFirstLineDiff = rLR.GetTextFirstLineOffset();
rFirstLinePos = nBodyIndent + nFirstLineDiff;
const auto nPseudoListBodyIndent = rFormat.GetAbsLSpace();
- const long nReverseListIndented = GetListFirstLineIndent(rFormat);
- long nExtraListIndent = nPseudoListBodyIndent + nReverseListIndented;
+ const tools::Long nReverseListIndented = GetListFirstLineIndent(rFormat);
+ tools::Long nExtraListIndent = nPseudoListBodyIndent + nReverseListIndented;
return std::max<long>(nExtraListIndent, 0);
}
@@ -1258,8 +1258,8 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
{
if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
- long nWantedFirstLinePos;
- long nExtraListIndent = lcl_GetTrueMargin(rLR, rFormat, nWantedFirstLinePos);
+ tools::Long nWantedFirstLinePos;
+ tools::Long nExtraListIndent = lcl_GetTrueMargin(rLR, rFormat, nWantedFirstLinePos);
rLR.SetTextLeft(nWantedFirstLinePos - nExtraListIndent);
rLR.SetTextFirstLineOffset(0);
}
@@ -1852,7 +1852,7 @@ void SwWW8ImplReader::ImportDop()
DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA, true);
// Import Default Tabs
- long nDefTabSiz = m_xWDop->dxaTab;
+ tools::Long nDefTabSiz = m_xWDop->dxaTab;
if( nDefTabSiz < 56 )
nDefTabSiz = 709;
@@ -2126,7 +2126,7 @@ void SwWW8ImplReader::Read_HdFtFootnoteText( const SwNodeIndex* pSttIdx,
/**
* Use authornames, if not available fall back to initials.
*/
-long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
+tools::Long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
{
WW8PLCFx_SubDoc* pSD = m_xPlcxMan->GetAtn();
if (!pSD)
@@ -3498,10 +3498,10 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString)
/**
* Return value: true for para end
*/
-bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd,
- long nCpOfs)
+bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, tools::Long nTextEnd,
+ tools::Long nCpOfs)
{
- long nEnd = ( nNextAttr < nTextEnd ) ? nNextAttr : nTextEnd;
+ tools::Long nEnd = ( nNextAttr < nTextEnd ) ? nNextAttr : nTextEnd;
if (m_bSymbol || m_bIgnoreText)
{
@@ -3586,7 +3586,7 @@ bool SwWW8ImplReader::HandlePageBreakChar()
return bParaEndAdded;
}
-bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
+bool SwWW8ImplReader::ReadChar(tools::Long nPosCp, tools::Long nCpOfs)
{
bool bNewParaEnd = false;
// Reset Unicode flag and correct FilePos if needed.
@@ -3708,7 +3708,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
bool bReadObj = IsInlineEscherHack();
if( bReadObj )
{
- long nCurPos = m_pStrm->Tell();
+ tools::Long nCurPos = m_pStrm->Tell();
sal_uInt16 nWordCode(0);
if( m_bIsUnicode )
@@ -3853,9 +3853,9 @@ void SwWW8ImplReader::ProcessCurrentCollChange(WW8PLCFManResult& rRes,
}
}
-long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStartLine, int nDepthGuard)
+tools::Long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, tools::Long nTextEnd, bool& rbStartLine, int nDepthGuard)
{
- long nSkipChars = 0;
+ tools::Long nSkipChars = 0;
WW8PLCFManResult aRes;
OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode");
@@ -3884,7 +3884,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar
}
// position of last CP that's to be ignored
- long nSkipPos = -1;
+ tools::Long nSkipPos = -1;
if( 0 < aRes.nSprmId ) // Ignore empty Attrs
{
@@ -3930,7 +3930,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar
m_bIgnoreText = true;
sal_uInt16 nOldColl = m_nCurrentColl;
bool bDoPlcxManPlusPLus = true;
- long nNext;
+ tools::Long nNext;
do
{
if( bDoPlcxManPlusPLus )
@@ -3999,7 +3999,7 @@ void SwWW8ImplReader::ClearParaEndPosition()
m_aEndParaPos.clear();
}
-void SwWW8ImplReader::ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, long nTextEnd, bool& rbStartLine)
+void SwWW8ImplReader::ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, tools::Long nTextEnd, bool& rbStartLine)
{
// Do we have attributes?
if( rTextPos >= rNext )
@@ -4067,7 +4067,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
m_bPgSecBreak = false;
m_xPlcxMan = std::make_shared<WW8PLCFMan>(m_xSBase.get(), nType, nStartCp);
- long nCpOfs = m_xPlcxMan->GetCpOfs(); // Offset for Header/Footer, Footnote
+ tools::Long nCpOfs = m_xPlcxMan->GetCpOfs(); // Offset for Header/Footer, Footnote
WW8_CP nNext = m_xPlcxMan->Where();
m_pPreviousNode = nullptr;
@@ -4912,7 +4912,7 @@ void WW8Customizations::Import( SwDocShell* pShell )
try
{
Tcg aTCG;
- long nCur = mpTableStream->Tell();
+ tools::Long nCur = mpTableStream->Tell();
if (!checkSeek(*mpTableStream, mWw8Fib.m_fcCmds)) // point at tgc record
{
SAL_WARN("sw.ww8", "** Seek to Customization data failed!!!! ");
@@ -6092,10 +6092,10 @@ const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
m_pAtnNames.reset(new std::vector<OUString>);
SvStream& rStrm = *m_pTableStream;
- long nOldPos = rStrm.Tell();
+ tools::Long nOldPos = rStrm.Tell();
rStrm.Seek( m_xWwFib->m_fcGrpStAtnOwners );
- long nRead = 0, nCount = m_xWwFib->m_lcbGrpStAtnOwners;
+ tools::Long nRead = 0, nCount = m_xWwFib->m_lcbGrpStAtnOwners;
while (nRead < nCount && rStrm.good())
{
if( m_bVer67 )
@@ -6545,7 +6545,7 @@ bool SwMSDffManager::GetOLEStorageName(sal_uInt32 nOLEId, OUString& rStorageName
// We should then find the EmbeddedField and the corresponding Sprms
// in that Area.
// We only need the Sprm for the Picture Id.
- long nOldPos = rReader.m_pStrm->Tell();
+ tools::Long nOldPos = rReader.m_pStrm->Tell();
{
// #i32596# - consider return value of method
// <rReader.GetTxbxTextSttEndCp(..)>. If it returns false, method
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index cad9f5e9b03d..37ff8b1275ae 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -228,7 +228,7 @@ public:
SwFormat* m_pFormat;
std::shared_ptr<WW8FlyPara> m_xWWFly;
SwNumRule* m_pOutlineNumrule;
- long m_nFilePos;
+ tools::Long m_nFilePos;
sal_uInt16 m_nBase;
sal_uInt16 m_nFollow;
sal_uInt16 m_nLFOIndex;
@@ -389,7 +389,7 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr);
- virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, long nHand=LONG_MAX, bool consumedByField=false) override;
+ virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, tools::Long nHand=LONG_MAX, bool consumedByField=false) override;
void SetToggleAttr(sal_uInt8 nId, bool bOn)
{
@@ -889,7 +889,7 @@ public:
void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode);
sal_uInt16 CurrentSectionColCount() const;
bool WillHavePageDescHere(const SwNodeIndex& rIdx) const;
- void CreateSep(const long nTextPos);
+ void CreateSep(const tools::Long nTextPos);
void InsertSegments();
void JoinNode(const SwPosition &rPos, const SwNode &rNode);
sal_uInt32 GetPageLeft() const;
@@ -1420,9 +1420,9 @@ private:
void emulateMSWordAddTextToParagraph(const OUString& rAddString);
void simpleAddTextToParagraph(const OUString& rAddString);
bool HandlePageBreakChar();
- bool ReadChar(long nPosCp, long nCpOfs);
+ bool ReadChar(tools::Long nPosCp, tools::Long nCpOfs);
bool ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCpOfs);
- bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, long nCpOfs);
+ bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, tools::Long nTextEnd, tools::Long nCpOfs);
static bool LangUsesHindiNumbers(LanguageType nLang);
static sal_Unicode TranslateToHindiNumbers(sal_Unicode);
@@ -1430,8 +1430,8 @@ private:
void ProcessCurrentCollChange(WW8PLCFManResult& rRes, bool* pStartAttr,
bool bCallProcessSpecial);
- long ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStartLine, int nDepthGuard = 0);
- void ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, long nTextEnd, bool& rbStartLine);
+ tools::Long ReadTextAttr(WW8_CP& rTextPos, tools::Long nTextEnd, bool& rbStartLine, int nDepthGuard = 0);
+ void ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, tools::Long nTextEnd, bool& rbStartLine);
void CloseAttrEnds();
bool ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType);
@@ -1593,28 +1593,28 @@ private:
bool GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, sal_uInt16 nTxBxS,
sal_uInt16 nSequence);
- sal_Int32 GetRangeAsDrawingString(OUString& rString, long StartCp, long nEndCp, ManTypes eType);
+ sal_Int32 GetRangeAsDrawingString(OUString& rString, tools::Long StartCp, tools::Long nEndCp, ManTypes eType);
std::unique_ptr<OutlinerParaObject> ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType);
void InsertTxbxText(SdrTextObj* pTextObj, Size const * pObjSiz,
- sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, SwFrameFormat const * pFlyFormat,
+ sal_uInt16 nTxBxS, sal_uInt16 nSequence, tools::Long nPosCp, SwFrameFormat const * pFlyFormat,
bool bMakeSdrGrafObj, bool& rbEraseTextObj,
- bool* pbTestTxbxContainsText = nullptr, long* pnStartCp = nullptr,
- long* pnEndCp = nullptr, bool* pbContainsGraphics = nullptr,
+ bool* pbTestTxbxContainsText = nullptr, tools::Long* pnStartCp = nullptr,
+ tools::Long* pnEndCp = nullptr, bool* pbContainsGraphics = nullptr,
SvxMSDffImportRec const * pRecord = nullptr);
bool TxbxChainContainsRealText( sal_uInt16 nTxBxS,
- long& rStartCp,
- long& rEndCp );
+ tools::Long& rStartCp,
+ tools::Long& rEndCp );
SdrObject *ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet);
SdrObject *ReadCaptionBox(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet);
SdrObject *ReadGroup(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet);
SdrObject *ReadGrafPrimitive(short& rLeft, SfxAllItemSet &rSet);
- void ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp );
+ void ReadGrafLayer1( WW8PLCFspecial* pPF, tools::Long nGrafAnchorCp );
SdrObject* CreateContactObject(SwFrameFormat* pFlyFormat);
RndStdIds ProcessEscherAlign(SvxMSDffImportRec* pRecord, WW8_FSPA *pFSPA,
SfxItemSet &rFlySet);
bool MiserableRTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
sal_Int16 eHoriOri, sal_Int16 eHoriRel);
- SwFrameFormat* Read_GrafLayer( long nGrafAnchorCp );
+ SwFrameFormat* Read_GrafLayer( tools::Long nGrafAnchorCp );
SwFlyFrameFormat* ImportReplaceableDrawables( SdrObject* &rpObject,
SdrObject* &rpOurNewObject, SvxMSDffImportRec* pRecord, WW8_FSPA *pF,
SfxItemSet &rFlySet );
@@ -1622,7 +1622,7 @@ private:
SdrObject* &rpOurNewObject, SvxMSDffImportRec const * pRecord,
RndStdIds eAnchor, WW8_FSPA const *pF, SfxItemSet &rFlySet );
SwFrameFormat* MungeTextIntoDrawBox(SvxMSDffImportRec *pRecord,
- long nGrafAnchorCp, SwFrameFormat *pRetFrameFormat);
+ tools::Long nGrafAnchorCp, SwFrameFormat *pRetFrameFormat);
void GrafikCtor();
void GrafikDtor();
@@ -1634,7 +1634,7 @@ private:
OUString ConvertFFileName(const OUString& rRaw);
WW8_CP Read_F_Tag(WW8FieldDesc* pF);
void InsertTagField( const sal_uInt16 nId, const OUString& rTagText );
- long ImportExtSprm(WW8PLCFManResult* pRes);
+ tools::Long ImportExtSprm(WW8PLCFManResult* pRes);
void EndExtSprm(sal_uInt16 nSprmId);
void ReadDocInfo();
@@ -1708,14 +1708,14 @@ public: // really private, but can only be done public
//Clear the para end position recorded in reader intermittently for the least impact on loading performance
void ClearParaEndPosition();
- long Read_Footnote(WW8PLCFManResult* pRes);
+ tools::Long Read_Footnote(WW8PLCFManResult* pRes);
sal_uInt16 End_Footnote();
- long Read_Field(WW8PLCFManResult* pRes);
+ tools::Long Read_Field(WW8PLCFManResult* pRes);
sal_uInt16 End_Field();
- long Read_Book(WW8PLCFManResult*);
- long Read_And(WW8PLCFManResult* pRes);
- long Read_AtnBook(WW8PLCFManResult*);
- long Read_FactoidBook(WW8PLCFManResult*);
+ tools::Long Read_Book(WW8PLCFManResult*);
+ tools::Long Read_And(WW8PLCFManResult* pRes);
+ tools::Long Read_AtnBook(WW8PLCFManResult*);
+ tools::Long Read_FactoidBook(WW8PLCFManResult*);
// attributes
@@ -1832,7 +1832,7 @@ public: // really private, but can only be done public
void Read_TextVerticalAdjustment(sal_uInt16, const sal_uInt8* pData, short nLen);
void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen);
- long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName,
+ tools::Long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName,
const OUString &rData);
OUString GetMappedBookmark(const OUString &rOrigName);
@@ -1899,8 +1899,8 @@ public: // really private, but can only be done public
static bool GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc);
static void PicRead( SvStream *pDataStream, WW8_PIC *pPic, bool bVer67);
- static bool ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, long& rX,
- long& rY);
+ static bool ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, tools::Long& rX,
+ tools::Long& rY);
static Color GetCol(sal_uInt8 nIco);
SwWW8ImplReader( sal_uInt8 nVersionPara, SotStorage* pStorage, SvStream* pSt,
@@ -1928,7 +1928,7 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
const SwNumFormat &rFormat,
const bool bFirstLineOfStSet,
const bool bLeftIndentSet );
-long GetListFirstLineIndent(const SwNumFormat &rFormat);
+tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat);
OUString BookmarkToWriter(const OUString &rBookmark);
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index d689ab36acb6..71ef80c27b52 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -284,7 +284,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote()
return 0;
}
-long SwWW8ImplReader::Read_Footnote(WW8PLCFManResult* pRes)
+tools::Long SwWW8ImplReader::Read_Footnote(WW8PLCFManResult* pRes)
{
/*
Ignoring Footnote outside of the normal Text. People will put footnotes
@@ -2406,7 +2406,7 @@ void WW8TabDesc::CreateSwTable()
// Because SW cannot handle multi-page floating frames,
// _any unnecessary_ floating tables have been converted to inline.
- long nLeft = 0;
+ tools::Long nLeft = 0;
if ( m_pIo->m_xSFlyPara && !m_pIo->m_xSFlyPara->pFlyFormat )
{
// Get the table orientation from the fly
@@ -2783,7 +2783,7 @@ void WW8TabDesc::FinishSwTable()
auto& rRow = groupIt->row(n);
for (size_t i = 0; i<rRow.size(); ++i)
{
- const long nRowSpanSet = (n == 0) && (i == 0) ?
+ const tools::Long nRowSpanSet = (n == 0) && (i == 0) ?
nRowSpan :
(-1 * (nRowSpan - n));
SwTableBox* pCurrentBox = rRow[i];
@@ -3923,7 +3923,7 @@ void WW8RStyle::Import1Style( sal_uInt16 nNr )
bool bOldNoImp = PrepareStyle(rSI, static_cast<ww::sti>(xStd->sti), nNr, xStd->istdNext);
// if something is interpreted wrong, this should make it work again
- long nPos = mpStStrm->Tell();
+ tools::Long nPos = mpStStrm->Tell();
//Variable parts of the STD start at even byte offsets, but "inside
//the STD", which I take to meaning even in relation to the starting
diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx
index bd3de34179b4..ac35b4813b8f 100644
--- a/sw/source/filter/ww8/ww8par2.hxx
+++ b/sw/source/filter/ww8/ww8par2.hxx
@@ -65,7 +65,7 @@ struct WW8SwFlyPara
sal_uInt8 nXBind, nYBind; // bound relative to what
// part 2: changes found during reading
- long nNewNetWidth;
+ tools::Long nNewNetWidth;
std::unique_ptr<SwPosition> xMainTextPos; // to return to main text after apo
sal_uInt16 nLineSpace; // line space in tw for graf apos
bool bAutoWidth;
@@ -80,7 +80,7 @@ struct WW8SwFlyPara
const sal_Int32 nIniFlyDx,
const sal_Int32 nIniFlyDy );
- void BoxUpWidth( long nWidth );
+ void BoxUpWidth( tools::Long nWidth );
std::unique_ptr<SwWW8FltAnchorStack> xOldAnchorStck;
};
@@ -141,7 +141,7 @@ public:
WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW,
const WW8SwFlyPara* pFS, bool bGraf);
WW8FlySet(SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic,
- long nWidth, long nHeight);
+ tools::Long nWidth, tools::Long nHeight);
};
// Gets filled in WW8TabDesc::MergeCells().
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 6ce373838e23..175f7b948613 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1125,7 +1125,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
// create Arrays
bool bLVLOk = true;
- long nOriginalPos = rSt.Tell();
+ tools::Long nOriginalPos = rSt.Tell();
// 1. read PLCF LST and create list templates in Writer
@@ -1654,7 +1654,7 @@ void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
const auto nAbsLSpace = rFormat.GetAbsLSpace();
- const long nListFirstLineIndent = GetListFirstLineIndent(rFormat);
+ const tools::Long nListFirstLineIndent = GetListFirstLineIndent(rFormat);
SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.m_pFormat, RES_LR_SPACE));
aLR.SetTextLeft(nAbsLSpace);
aLR.SetTextFirstLineOffset(writer_cast<short>(nListFirstLineIndent));
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 6517edb55463..1c5bc2a09b6c 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -64,7 +64,7 @@ struct OLE_MFP
using namespace ::com::sun::star;
-static bool SwWw8ReadScaling(long& rX, long& rY, tools::SvRef<SotStorage> const & rSrc1)
+static bool SwWw8ReadScaling(tools::Long& rX, tools::Long& rY, tools::SvRef<SotStorage> const & rSrc1)
{
// Getting the scaling factor:
// Information in the PIC-stream (by trying out)
@@ -302,7 +302,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf,
}
bool SwWW8ImplReader::ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF,
- long& rX, long& rY)
+ tools::Long& rX, tools::Long& rY)
{
bool bOk = false;
OLE_MFP aMfp;
@@ -335,7 +335,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
::SetProgressState( m_nProgress, m_rDoc.GetDocShell() ); // Update
- long nX=0, nY=0; // nX, nY is graphic size
+ tools::Long nX=0, nY=0; // nX, nY is graphic size
bool bOleOk = true;
// results in the name "_4711"
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 94fd99994dea..c37ee40fb6de 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -113,7 +113,7 @@ namespace
}
}
-long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
+tools::Long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
{
// should also work via pRes.nCo2OrIdx
WW8PLCFx_Book* pB = m_xPlcxMan->GetBook();
@@ -150,11 +150,11 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
if( SwFltGetFlag( m_nFieldFlags, SwFltControlStack::BOOK_TO_VAR_REF ) )
{
// set variable for translation bookmark
- long nLen = pB->GetLen();
+ tools::Long nLen = pB->GetLen();
if( nLen > MAX_FIELDLEN )
nLen = MAX_FIELDLEN;
- long nOldPos = m_pStrm->Tell();
+ tools::Long nOldPos = m_pStrm->Tell();
m_xSBase->WW8ReadString( *m_pStrm, aVal, pB->GetStartPos(), nLen,
m_eStructCharSet );
m_pStrm->Seek( nOldPos );
@@ -229,7 +229,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
return 0;
}
-long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*)
+tools::Long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*)
{
if (WW8PLCFx_AtnBook* pAtnBook = m_xPlcxMan->GetAtnBook())
{
@@ -241,7 +241,7 @@ long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*)
return 0;
}
-long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*)
+tools::Long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*)
{
if (WW8PLCFx_FactoidBook* pFactoidBook = m_xPlcxMan->GetFactoidBook())
{
@@ -753,7 +753,7 @@ void WW8FieldEntry::SetBookmarkCode(const OUString& bookmarkCode)
// Read_Field reads a field or returns 0 if the field cannot be read,
// so that the calling function reads the field in text format.
// Returnvalue: Total length of field
-long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
+tools::Long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
{
typedef eF_ResT (SwWW8ImplReader::*FNReadField)( WW8FieldDesc*, OUString& );
enum Limits {eMax = 96};
@@ -950,7 +950,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
if (aF.bResNest && !AcceptableNestedField(aF.nId))
return aF.nLen; // Result nested -> unusable
- long nOldPos = m_pStrm->Tell();
+ tools::Long nOldPos = m_pStrm->Tell();
OUString aStr;
aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
aF.nSCode, aF.nLCode, m_eTextCharSet );
@@ -1129,7 +1129,7 @@ void SwWW8ImplReader::InsertTagField( const sal_uInt16 nId, const OUString& rTag
WW8_CP SwWW8ImplReader::Read_F_Tag( WW8FieldDesc* pF )
{
- long nOldPos = m_pStrm->Tell();
+ tools::Long nOldPos = m_pStrm->Tell();
WW8_CP nStart = pF->nSCode - 1; // starting with 0x19
WW8_CP nL = pF->nLen; // Total length with result and nest
@@ -1189,7 +1189,7 @@ eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, OUString& rStr )
// GetFieldResult allocates a string and reads the resulted field
OUString SwWW8ImplReader::GetFieldResult( WW8FieldDesc const * pF )
{
- long nOldPos = m_pStrm->Tell();
+ tools::Long nOldPos = m_pStrm->Tell();
WW8_CP nStart = pF->nSRes; // result start
WW8_CP nL = pF->nLRes; // result length
@@ -1277,11 +1277,11 @@ the set/ask field, and end them directly afterwards. MapBookmarkVariables
returns an identifier of the bookmark attribute to close after inserting
the appropriate set/ask field.
*/
-long SwWW8ImplReader::MapBookmarkVariables(const WW8FieldDesc* pF,
+tools::Long SwWW8ImplReader::MapBookmarkVariables(const WW8FieldDesc* pF,
OUString &rOrigName, const OUString &rData)
{
OSL_ENSURE(m_xPlcxMan, "No pPlcxMan");
- long nNo;
+ tools::Long nNo;
/*
If there was no bookmark associated with this set field, then we create a
pseudo one and insert it in the document.
@@ -1396,7 +1396,7 @@ eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, OUString& rStr )
aQ += aDef;
}
- const long nNo = MapBookmarkVariables(pF, sOrigName, aResult);
+ const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, aResult);
SwSetExpFieldType* pFT = static_cast<SwSetExpFieldType*>(m_rDoc.getIDocumentFieldsAccess().InsertFieldType(
SwSetExpFieldType(&m_rDoc, sOrigName, nsSwGetSetExpType::GSE_STRING)));
@@ -2012,7 +2012,7 @@ eF_ResT SwWW8ImplReader::Read_F_Set( WW8FieldDesc* pF, OUString& rStr )
}
}
- const long nNo = MapBookmarkVariables(pF, sOrigName, sVal);
+ const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, sVal);
SwFieldType* pFT = m_rDoc.getIDocumentFieldsAccess().InsertFieldType( SwSetExpFieldType( &m_rDoc, sOrigName,
nsSwGetSetExpType::GSE_STRING ) );
@@ -3669,7 +3669,7 @@ void SwWW8ImplReader::Read_FieldVanish( sal_uInt16, const sal_uInt8*, short nLen
return;
m_bIgnoreText = true;
- long nOldPos = m_pStrm->Tell();
+ tools::Long nOldPos = m_pStrm->Tell();
WW8_CP nStartCp = m_xPlcxMan->Where() + m_xPlcxMan->GetCpOfs();
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index b72ca39c84fe..849d68ca1dbb 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -523,7 +523,7 @@ void wwSectionManager::SetPage(SwPageDesc &rInPageDesc, SwFrameFormat &rFormat,
namespace {
// Returns corrected (ODF) margin size
-long SetBorderDistance(bool bFromEdge, SvxBoxItem& aBox, SvxBoxItemLine eLine, long nMSMargin)
+tools::Long SetBorderDistance(bool bFromEdge, SvxBoxItem& aBox, SvxBoxItemLine eLine, tools::Long nMSMargin)
{
const editeng::SvxBorderLine* pLine = aBox.GetLine(eLine);
if (!pLine)
@@ -740,10 +740,10 @@ SwSectionFormat *wwSectionManager::InsertSection(
SwFrameFormat& rFormat = pPage->GetMaster();
const SvxLRSpaceItem& rLR = rFormat.GetLRSpace();
- long nPageLeft = rLR.GetLeft();
- long nPageRight = rLR.GetRight();
- long nSectionLeft = rSection.GetPageLeft() - nPageLeft;
- long nSectionRight = rSection.GetPageRight() - nPageRight;
+ tools::Long nPageLeft = rLR.GetLeft();
+ tools::Long nPageRight = rLR.GetRight();
+ tools::Long nSectionLeft = rSection.GetPageLeft() - nPageLeft;
+ tools::Long nSectionRight = rSection.GetPageRight() - nPageRight;
if ((nSectionLeft != 0) || (nSectionRight != 0))
{
SvxLRSpaceItem aLR(nSectionLeft, nSectionRight, 0, 0, RES_LR_SPACE);
@@ -836,7 +836,7 @@ void wwSectionManager::SetNumberingType(const wwSection &rNewSection,
// fills it/them with attributes and KF texts.
// This has become necessary because the translation of the various
// page attributes is interconnected too much.
-void wwSectionManager::CreateSep(const long nTextPos)
+void wwSectionManager::CreateSep(const tools::Long nTextPos)
{
/*
#i1909# section/page breaks should not occur in tables or subpage
@@ -2112,7 +2112,7 @@ bTogglePos(false)
// by modifying the Fly width (fixed in SW) afterwards.
// This can increase or decrease the Fly width, because the default value
// is set without knowledge of the contents.
-void WW8SwFlyPara::BoxUpWidth( long nInWidth )
+void WW8SwFlyPara::BoxUpWidth( tools::Long nInWidth )
{
if( bAutoWidth && nInWidth > nNewNetWidth )
nNewNetWidth = nInWidth;
@@ -2177,7 +2177,7 @@ WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW,
// WW8FlySet-ctor for character bound graphics
WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM,
- const WW8_PIC& rPic, long nWidth, long nHeight )
+ const WW8_PIC& rPic, tools::Long nWidth, tools::Long nHeight )
: SfxItemSet(rReader.m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>{})
{
Init(rReader, pPaM);
@@ -2675,7 +2675,7 @@ void SwWW8ImplReader::StopApo()
// frame´s size.
if (m_xSFlyPara->nNewNetWidth > MINFLY && m_xSFlyPara->pFlyFormat) // BoxUpWidth ?
{
- long nW = m_xSFlyPara->nNewNetWidth;
+ tools::Long nW = m_xSFlyPara->nNewNetWidth;
nW += m_xSFlyPara->nWidth - m_xSFlyPara->nNetWidth; // border for it
m_xSFlyPara->pFlyFormat->SetFormatAttr(
SwFormatFrameSize(m_xSFlyPara->eHeightFix, nW, m_xSFlyPara->nHeight));
@@ -4347,7 +4347,7 @@ void SwWW8ImplReader::Read_LineSpace( sal_uInt16, const sal_uInt8* pData, short
if( 1 == nMulti ) // MultilineSpace ( proportional )
{
- long n = nSpace * 10 / 24; // WW: 240 = 100%, SW: 100 = 100%
+ tools::Long n = nSpace * 10 / 24; // WW: 240 = 100%, SW: 100 = 100%
// here n is in [0..13653]
aLSpc.SetPropLineSpace( static_cast<sal_uInt16>(n) );
@@ -5253,7 +5253,7 @@ bool SwWW8ImplReader::ParseTabPos(WW8_TablePos *pTabPos, WW8PLCFx_Cp_FKP* pPap)
// page attribute won't be used as attribute anymore
// ( except OLST )
-long SwWW8ImplReader::ImportExtSprm(WW8PLCFManResult* pRes)
+tools::Long SwWW8ImplReader::ImportExtSprm(WW8PLCFManResult* pRes)
{
// array for reading of the extended ( self-defined ) SPRMs
typedef long (SwWW8ImplReader::*FNReadRecordExt)(WW8PLCFManResult*);
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index e8a9a6450330..cba66a28dbf5 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1173,7 +1173,7 @@ WW8_CP WW8PLCFx_PCD::Where()
return pPcdI ? pPcdI->Where() : WW8_CP_MAX;
}
-long WW8PLCFx_PCD::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
+tools::Long WW8PLCFx_PCD::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
{
void* pData;
rLen = 0;
@@ -2086,7 +2086,7 @@ OUString read_uInt16_BeltAndBracesString(SvStream& rStrm)
}
sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr,
- WW8_CP nCurrentStartCp, long nTotalLen, rtl_TextEncoding eEnc ) const
+ WW8_CP nCurrentStartCp, tools::Long nTotalLen, rtl_TextEncoding eEnc ) const
{
// Read in plain text, which can extend over several pieces
rStr.clear();
@@ -2096,7 +2096,7 @@ sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr,
WW8_CP nBehindTextCp = nCurrentStartCp + nTotalLen;
WW8_CP nNextPieceCp = nBehindTextCp; // Initialization, important for Ver6
- long nTotalRead = 0;
+ tools::Long nTotalRead = 0;
do
{
bool bIsUnicode(false), bPosOk(false);
@@ -2174,7 +2174,7 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos,
// that begins before nPos and ends after nPos.
// Suitable for normal attributes. However, the beginning of the attribute is not corrected onto
// the position nPos.
-bool WW8PLCFspecial::SeekPos(long nP)
+bool WW8PLCFspecial::SeekPos(tools::Long nP)
{
if( nP < pPLCF_PosArray[0] )
{
@@ -2186,8 +2186,8 @@ bool WW8PLCFspecial::SeekPos(long nP)
if ((nIdx < 1) || (nP < pPLCF_PosArray[nIdx - 1]))
nIdx = 1;
- long nI = nIdx;
- long nEnd = nIMax;
+ tools::Long nI = nIdx;
+ tools::Long nEnd = nIMax;
for(int n = (1==nIdx ? 1 : 2); n; --n )
{
@@ -2209,7 +2209,7 @@ bool WW8PLCFspecial::SeekPos(long nP)
// WW8PLCFspecial::SeekPosExact() like SeekPos(), but it is ensured that no attribute is cut,
// i.e. the next given attribute begins at or after nPos.
// Is used for fields and bookmarks.
-bool WW8PLCFspecial::SeekPosExact(long nP)
+bool WW8PLCFspecial::SeekPosExact(tools::Long nP)
{
if( nP < pPLCF_PosArray[0] )
{
@@ -2220,8 +2220,8 @@ bool WW8PLCFspecial::SeekPosExact(long nP)
if( nP <=pPLCF_PosArray[nIdx] )
nIdx = 0;
- long nI = nIdx ? nIdx-1 : 0;
- long nEnd = nIMax;
+ tools::Long nI = nIdx ? nIdx-1 : 0;
+ tools::Long nEnd = nIMax;
for(int n = (0==nIdx ? 1 : 2); n; --n )
{
@@ -2245,7 +2245,7 @@ bool WW8PLCFspecial::Get(WW8_CP& rPos, void*& rpValue) const
return GetData( nIdx, rPos, rpValue );
}
-bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const
+bool WW8PLCFspecial::GetData(tools::Long nInIdx, WW8_CP& rPos, void*& rpValue) const
{
if ( nInIdx >= nIMax )
{
@@ -2549,16 +2549,16 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
}
// If nStartPos < 0, the first element of PLCFs will be taken
-WW8PLCFpcd_Iter::WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, long nStartPos )
+WW8PLCFpcd_Iter::WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, tools::Long nStartPos )
:rPLCF( rPLCFpcd ), nIdx( 0 )
{
if( nStartPos >= 0 )
SeekPos( nStartPos );
}
-bool WW8PLCFpcd_Iter::SeekPos(long nPos)
+bool WW8PLCFpcd_Iter::SeekPos(tools::Long nPos)
{
- long nP = nPos;
+ tools::Long nP = nPos;
if( nP < rPLCF.pPLCF_PosArray[0] )
{
@@ -2569,8 +2569,8 @@ bool WW8PLCFpcd_Iter::SeekPos(long nPos)
if ((nIdx < 1) || (nP < rPLCF.pPLCF_PosArray[nIdx - 1]))
nIdx = 1;
- long nI = nIdx;
- long nEnd = rPLCF.nIMax;
+ tools::Long nI = nIdx;
+ tools::Long nEnd = rPLCF.nIMax;
for(int n = (1==nIdx ? 1 : 2); n; --n )
{
@@ -2646,7 +2646,7 @@ void WW8PLCFx_Fc_FKP::WW8Fkp::FillEntry(WW8PLCFx_Fc_FKP::WW8Fkp::Entry &rEntry,
}
WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt,
- SvStream* pDataSt, long _nFilePos, long nItemSiz, ePLCFT ePl,
+ SvStream* pDataSt, tools::Long _nFilePos, tools::Long nItemSiz, ePLCFT ePl,
WW8_FC nStartFc)
: nItemSize(nItemSiz), nFilePos(_nFilePos), mnIdx(0), ePLCF(ePl)
, mnMustRemainCached(0), maSprmParser(rFib)
@@ -3018,7 +3018,7 @@ void WW8PLCFx::GetSprms( WW8PLCFxDesc* p )
p->bRealLineEnd = false;
}
-long WW8PLCFx::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
+tools::Long WW8PLCFx::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
{
OSL_ENSURE( false, "Called wrong GetNoSprms" );
rStart = rEnd = WW8_CP_MAX;
@@ -3041,9 +3041,9 @@ namespace {
class SamePos
{
private:
- long mnPo;
+ tools::Long mnPo;
public:
- explicit SamePos(long nPo) : mnPo(nPo) {}
+ explicit SamePos(tools::Long nPo) : mnPo(nPo) {}
bool operator()(const std::unique_ptr<WW8PLCFx_Fc_FKP::WW8Fkp>& pFkp)
{return mnPo == pFkp->GetFilePos();}
};
@@ -3094,10 +3094,10 @@ bool WW8PLCFx_Fc_FKP::NewFkp()
return false; // PLCF completely processed
}
pPLCF->advance();
- long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) );
+ tools::Long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) );
nPo <<= 9; // shift as LONG
- long nCurrentFkpFilePos = pFkp ? pFkp->GetFilePos() : -1;
+ tools::Long nCurrentFkpFilePos = pFkp ? pFkp->GetFilePos() : -1;
if (nCurrentFkpFilePos == nPo)
pFkp->Reset(GetStartFc());
else
@@ -3136,7 +3136,7 @@ WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream* pSt, SvStream* pTableSt,
, pFkp(nullptr), ePLCF(ePl)
{
SetStartFc(nStartFcL);
- long nLenStruct = (8 > rFib.m_nVersion) ? 2 : 4;
+ tools::Long nLenStruct = (8 > rFib.m_nVersion) ? 2 : 4;
if (ePl == CHP)
{
pPLCF.reset(new WW8PLCF(*pTableSt, rFib.m_fcPlcfbteChpx, rFib.m_lcbPlcfbteChpx,
@@ -3196,7 +3196,7 @@ bool WW8PLCFx_Fc_FKP::SeekPos(WW8_FC nFcPos)
void* pPage;
if( pFkp && pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ) )
{
- long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) );
+ tools::Long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) );
nPo <<= 9; // shift as LONG
if (nPo != pFkp->GetFilePos())
pFkp = nullptr;
@@ -3800,7 +3800,7 @@ SprmResult WW8PLCFx_SEPX::HasSprm(sal_uInt16 nId) const
}
SprmResult WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms,
- long nOtherSprmSiz ) const
+ tools::Long nOtherSprmSiz ) const
{
SprmResult aRet;
if (pPLCF)
@@ -3876,8 +3876,8 @@ SprmResult WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const
}
WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib,
- WW8_CP nStartCp, long nFcRef, long nLenRef, long nFcText, long nLenText,
- long nStruct)
+ WW8_CP nStartCp, tools::Long nFcRef, tools::Long nLenRef, tools::Long nFcText, tools::Long nLenText,
+ tools::Long nStruct)
: WW8PLCFx(rFib, true)
{
if( nLenRef && nLenText )
@@ -4061,7 +4061,7 @@ bool WW8PLCFx_FLD::EndPosIsFieldEnd(WW8_CP& nCP)
if (pPLCF)
{
- long n = pPLCF->GetIdx();
+ tools::Long n = pPLCF->GetIdx();
pPLCF->advance();
@@ -4092,7 +4092,7 @@ void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p)
return;
}
- long n = pPLCF->GetIdx();
+ tools::Long n = pPLCF->GetIdx();
sal_Int32 nP;
void *pData;
@@ -4126,13 +4126,13 @@ void WW8PLCFx_FLD::advance()
pPLCF->advance();
}
-bool WW8PLCFx_FLD::GetPara(long nIdx, WW8FieldDesc& rF)
+bool WW8PLCFx_FLD::GetPara(tools::Long nIdx, WW8FieldDesc& rF)
{
SAL_WARN_IF(!pPLCF, "sw.ww8", "Call without PLCFspecial field");
if( !pPLCF )
return false;
- long n = pPLCF->GetIdx();
+ tools::Long n = pPLCF->GetIdx();
pPLCF->SetIdx(nIdx);
bool bOk = WW8GetFieldPara(*pPLCF, rF);
@@ -4346,7 +4346,7 @@ WW8_CP WW8PLCFx_Book::Where()
return pBook[nIsEnd]->Where();
}
-long WW8PLCFx_Book::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
+tools::Long WW8PLCFx_Book::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
{
void* pData;
rEnd = WW8_CP_MAX;
@@ -4391,7 +4391,7 @@ void WW8PLCFx_Book::advance()
else
{
const void * p = pBook[0]->GetData(pBook[0]->GetIdx());
- long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p));
+ tools::Long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p));
if (nPairFor == pBook[1]->GetIdx())
nIsEnd = 0;
else
@@ -4399,7 +4399,7 @@ void WW8PLCFx_Book::advance()
}
}
-long WW8PLCFx_Book::GetLen() const
+tools::Long WW8PLCFx_Book::GetLen() const
{
if( nIsEnd )
{
@@ -4414,7 +4414,7 @@ long WW8PLCFx_Book::GetLen() const
return 0;
}
const sal_uInt16 nEndIdx = SVBT16ToUInt16( *static_cast<SVBT16*>(p) );
- long nNum = pBook[1]->GetPos( nEndIdx );
+ tools::Long nNum = pBook[1]->GetPos( nEndIdx );
nNum -= nStartPos;
return nNum;
}
@@ -4431,11 +4431,11 @@ eBookStatus WW8PLCFx_Book::GetStatus() const
{
if (aStatus.empty())
return BOOK_NORMAL;
- long nEndIdx = GetHandle();
+ tools::Long nEndIdx = GetHandle();
return ( nEndIdx < nIMax ) ? aStatus[nEndIdx] : BOOK_NORMAL;
}
-long WW8PLCFx_Book::GetHandle() const
+tools::Long WW8PLCFx_Book::GetHandle() const
{
if( !pBook[0] || !pBook[1] )
return LONG_MAX;
@@ -4451,7 +4451,7 @@ long WW8PLCFx_Book::GetHandle() const
}
}
-OUString WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex)
+OUString WW8PLCFx_Book::GetBookmark(tools::Long nStart,tools::Long nEnd, sal_uInt16 &nIndex)
{
bool bFound = false;
sal_uInt16 i = 0;
@@ -4599,7 +4599,7 @@ WW8_CP WW8PLCFx_AtnBook::Where()
return m_pBook[static_cast<int>(m_bIsEnd)]->Where();
}
-long WW8PLCFx_AtnBook::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
+tools::Long WW8PLCFx_AtnBook::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen )
{
void* pData;
rEnd = WW8_CP_MAX;
@@ -4631,7 +4631,7 @@ void WW8PLCFx_AtnBook::advance()
else
{
const void * p = m_pBook[0]->GetData(m_pBook[0]->GetIdx());
- long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p));
+ tools::Long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p));
if (nPairFor == m_pBook[1]->GetIdx())
m_bIsEnd = false;
else
@@ -4639,7 +4639,7 @@ void WW8PLCFx_AtnBook::advance()
}
}
-long WW8PLCFx_AtnBook::getHandle() const
+tools::Long WW8PLCFx_AtnBook::getHandle() const
{
if (!m_pBook[0] || !m_pBook[1])
return LONG_MAX;
@@ -4728,7 +4728,7 @@ WW8_CP WW8PLCFx_FactoidBook::Where()
return m_pBook[static_cast<int>(m_bIsEnd)]->Where();
}
-long WW8PLCFx_FactoidBook::GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen)
+tools::Long WW8PLCFx_FactoidBook::GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen)
{
void* pData;
rEnd = WW8_CP_MAX;
@@ -4760,7 +4760,7 @@ void WW8PLCFx_FactoidBook::advance()
else
{
const void * p = m_pBook[0]->GetData(m_pBook[0]->GetIdx());
- long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p));
+ tools::Long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p));
if (nPairFor == m_pBook[1]->GetIdx())
m_bIsEnd = false;
else
@@ -4768,7 +4768,7 @@ void WW8PLCFx_FactoidBook::advance()
}
}
-long WW8PLCFx_FactoidBook::getHandle() const
+tools::Long WW8PLCFx_FactoidBook::getHandle() const
{
if (!m_pBook[0] || !m_pBook[1])
return LONG_MAX;
@@ -4915,7 +4915,7 @@ sal_uInt16 WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const
return nId;
}
-WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, long nStartCp,
+WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, tools::Long nStartCp,
bool bDoingDrawTextBox)
: maSprmParser(*pBase->m_pWw8Fib),
m_nLineEnd(WW8_CP_MAX),
@@ -5147,7 +5147,7 @@ WW8_CP WW8PLCFMan::Where() const
return l;
}
-void WW8PLCFMan::SeekPos( long nNewCp )
+void WW8PLCFMan::SeekPos( tools::Long nNewCp )
{
m_pChp->pPLCFx->SeekPos( nNewCp + m_nCpO ); // create new attr
m_pPap->pPLCFx->SeekPos( nNewCp + m_nCpO );
@@ -5186,7 +5186,7 @@ void WW8PLCFMan::RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave )
namespace
{
- bool IsSizeLegal(long nSprmLen, sal_Int32 nSprmsLen)
+ bool IsSizeLegal(tools::Long nSprmLen, sal_Int32 nSprmsLen)
{
if (nSprmLen > nSprmsLen)
{
@@ -6211,7 +6211,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset):
identify the values for PLCF and PLF LFO
and PLCF for the textbox break descriptors
*/
- long nOldPos = rSt.Tell();
+ tools::Long nOldPos = rSt.Tell();
rSt.Seek( 0x02da );
rSt.ReadInt32( m_fcSttbFnm );
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index d6672ad94cc5..b9beb92652e0 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -203,9 +203,9 @@ struct WW8PLCFxSave1
{
sal_uInt32 nPLCFxPos;
sal_uInt32 nPLCFxPos2; ///< for PLCF_Cp_Fkp: PieceIter-Pos
- long nPLCFxMemOfs;
+ tools::Long nPLCFxMemOfs;
WW8_CP nStartCp; ///< for cp based iterator like PAP and CHP
- long nCpOfs;
+ tools::Long nCpOfs;
WW8_FC nStartFC;
WW8_CP nAttrStart;
WW8_CP nAttrEnd;
@@ -221,8 +221,8 @@ class WW8PLCFspecial // iterator for PLCFs
private:
std::unique_ptr<sal_Int32[]> pPLCF_PosArray; ///< pointer to Pos-array and to the whole structure
sal_uInt8* pPLCF_Contents; ///< pointer to content-array-part of Pos-array
- long nIMax; ///< number of elements
- long nIdx; ///< marker where we currently are
+ tools::Long nIMax; ///< number of elements
+ tools::Long nIdx; ///< marker where we currently are
sal_uInt32 nStru;
WW8PLCFspecial(const WW8PLCFspecial&) = delete;
@@ -231,23 +231,23 @@ private:
public:
WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos, sal_uInt32 nPLCF,
sal_uInt32 nStruct);
- long GetIdx() const { return nIdx; }
- void SetIdx( long nI ) { nIdx = nI; }
- long GetIMax() const { return nIMax; }
- bool SeekPos(long nPos); // walks over FC- or CP-value
+ tools::Long GetIdx() const { return nIdx; }
+ void SetIdx( tools::Long nI ) { nIdx = nI; }
+ tools::Long GetIMax() const { return nIMax; }
+ bool SeekPos(tools::Long nPos); // walks over FC- or CP-value
// resp. next biggest value
- bool SeekPosExact(long nPos);
+ bool SeekPosExact(tools::Long nPos);
sal_Int32 Where() const
{ return ( nIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nIdx]; }
bool Get(WW8_CP& rStart, void*& rpValue) const;
- bool GetData(long nIdx, WW8_CP& rPos, void*& rpValue) const;
+ bool GetData(tools::Long nIdx, WW8_CP& rPos, void*& rpValue) const;
- const void* GetData( long nInIdx ) const
+ const void* GetData( tools::Long nInIdx ) const
{
return ( nInIdx >= nIMax ) ? nullptr
: static_cast<const void*>(&pPLCF_Contents[nInIdx * nStru]);
}
- sal_Int32 GetPos( long nInIdx ) const
+ sal_Int32 GetPos( tools::Long nInIdx ) const
{ return ( nInIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nInIdx]; }
void advance()
@@ -360,17 +360,17 @@ class WW8PLCFpcd_Iter
{
private:
WW8PLCFpcd& rPLCF;
- long nIdx;
+ tools::Long nIdx;
WW8PLCFpcd_Iter(const WW8PLCFpcd_Iter&) = delete;
WW8PLCFpcd_Iter& operator=(const WW8PLCFpcd_Iter&) = delete;
public:
- WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, long nStartPos = -1 );
- long GetIdx() const { return nIdx; }
- void SetIdx( long nI ) { nIdx = nI; }
- long GetIMax() const { return rPLCF.nIMax; }
- bool SeekPos(long nPos);
+ WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, tools::Long nStartPos = -1 );
+ tools::Long GetIdx() const { return nIdx; }
+ void SetIdx( tools::Long nI ) { nIdx = nI; }
+ tools::Long GetIMax() const { return rPLCF.nIMax; }
+ bool SeekPos(tools::Long nPos);
sal_Int32 Where() const;
bool Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const;
void advance()
@@ -417,7 +417,7 @@ public:
virtual bool SeekPos(WW8_CP nCpPos) = 0;
virtual WW8_FC Where() = 0;
virtual void GetSprms( WW8PLCFxDesc* p );
- virtual long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen );
+ virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen );
virtual void advance() = 0;
virtual sal_uInt16 GetIstd() const { return 0xffff; }
virtual void Save( WW8PLCFxSave1& rSave ) const;
@@ -474,7 +474,7 @@ public:
virtual void SetIdx(sal_uInt32 nI) override;
virtual bool SeekPos(WW8_CP nCpPos) override;
virtual WW8_CP Where() override;
- virtual long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen ) override;
+ virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen ) override;
virtual void advance() override;
WW8_CP CurrentPieceStartFc2Cp( WW8_FC nStartPos );
WW8_FC CurrentPieceStartCp2Fc( WW8_CP nCp );
@@ -484,7 +484,7 @@ public:
void SetClipStart(WW8_CP nIn) { nClipStart = nIn; }
WW8_CP GetClipStart() const { return nClipStart; }
- static sal_Int32 TransformPieceAddress(long nfc, bool& bIsUnicodeAddress)
+ static sal_Int32 TransformPieceAddress(tools::Long nfc, bool& bIsUnicodeAddress)
{
bIsUnicodeAddress = 0 == (0x40000000 & nfc);
return bIsUnicodeAddress ? nfc : (nfc & 0x3fffFFFF) / 2;
@@ -522,10 +522,10 @@ public:
sal_uInt8 maRawData[512];
std::vector<Entry> maEntries;
- long nItemSize; // either 1 Byte or a complete BX
+ tools::Long nItemSize; // either 1 Byte or a complete BX
// Offset in Stream where last read of 512 bytes took place
- long nFilePos;
+ tools::Long nFilePos;
sal_uInt8 mnIdx; // Pos marker
ePLCFT ePLCF;
sal_uInt8 mnIMax; // number of entries
@@ -538,10 +538,10 @@ public:
public:
WW8Fkp (const WW8Fib& rFib, SvStream* pFKPStrm,
- SvStream* pDataStrm, long _nFilePos, long nItemSiz, ePLCFT ePl,
+ SvStream* pDataStrm, tools::Long _nFilePos, tools::Long nItemSiz, ePLCFT ePl,
WW8_FC nStartFc);
void Reset(WW8_FC nPos);
- long GetFilePos() const { return nFilePos; }
+ tools::Long GetFilePos() const { return nFilePos; }
sal_uInt8 GetIdx() const { return mnIdx; }
void SetIdx(sal_uInt8 nI);
bool SeekPos(WW8_FC nFc);
@@ -685,7 +685,7 @@ public:
SprmResult HasSprm( sal_uInt16 nId ) const;
SprmResult HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const;
SprmResult HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms,
- long nOtherSprmSiz ) const;
+ tools::Long nOtherSprmSiz ) const;
bool Find4Sprms(sal_uInt16 nId1, sal_uInt16 nId2, sal_uInt16 nId3, sal_uInt16 nId4,
SprmResult& r1, SprmResult& r2, SprmResult& r3, SprmResult& r4) const;
};
@@ -702,7 +702,7 @@ private:
public:
WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib, WW8_CP nStartCp,
- long nFcRef, long nLenRef, long nFcText, long nLenText, long nStruc);
+ tools::Long nFcRef, tools::Long nLenRef, tools::Long nFcText, tools::Long nLenText, tools::Long nStruc);
virtual ~WW8PLCFx_SubDoc() override;
virtual sal_uInt32 GetIdx() const override;
virtual void SetIdx(sal_uInt32 nIdx) override;
@@ -717,7 +717,7 @@ public:
virtual void GetSprms(WW8PLCFxDesc* p) override;
virtual void advance() override;
- long Count() const { return pRef ? pRef->GetIMax() : 0; }
+ tools::Long Count() const { return pRef ? pRef->GetIMax() : 0; }
};
/// Iterator for fields
@@ -740,7 +740,7 @@ public:
virtual void advance() override;
bool StartPosIsFieldStart();
bool EndPosIsFieldEnd(WW8_CP&);
- bool GetPara(long nIdx, WW8FieldDesc& rF);
+ bool GetPara(tools::Long nIdx, WW8FieldDesc& rF);
};
enum eBookStatus { BOOK_NORMAL = 0, BOOK_IGNORE = 0x1, BOOK_FIELD = 0x2 };
@@ -752,7 +752,7 @@ private:
std::unique_ptr<WW8PLCFspecial> pBook[2]; // Start and End Position
std::vector<OUString> aBookNames; // Name
std::vector<eBookStatus> aStatus;
- long nIMax; // Number of Booknotes
+ tools::Long nIMax; // Number of Booknotes
sal_uInt16 nIsEnd;
sal_Int32 nBookmarkId; // counter incremented by GetUniqueBookmarkName.
@@ -762,24 +762,24 @@ private:
public:
WW8PLCFx_Book(SvStream* pTableSt,const WW8Fib& rFib);
virtual ~WW8PLCFx_Book() override;
- long GetIMax() const { return nIMax; }
+ tools::Long GetIMax() const { return nIMax; }
virtual sal_uInt32 GetIdx() const override;
virtual void SetIdx(sal_uInt32 nI) override;
virtual sal_uInt32 GetIdx2() const override;
virtual void SetIdx2(sal_uInt32 nIdx) override;
virtual bool SeekPos(WW8_CP nCpPos) override;
virtual WW8_CP Where() override;
- virtual long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override;
+ virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override;
virtual void advance() override;
const OUString* GetName() const;
WW8_CP GetStartPos() const
{ return nIsEnd ? WW8_CP_MAX : pBook[0]->Where(); }
- long GetLen() const;
+ tools::Long GetLen() const;
bool GetIsEnd() const { return nIsEnd != 0; }
- long GetHandle() const;
+ tools::Long GetHandle() const;
void SetStatus( sal_uInt16 nIndex, eBookStatus eStat );
void MapName(OUString& rName);
- OUString GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex);
+ OUString GetBookmark(tools::Long nStart,tools::Long nEnd, sal_uInt16 &nIndex);
eBookStatus GetStatus() const;
OUString GetUniqueBookmarkName(const OUString &rSuggestedName);
};
@@ -806,11 +806,11 @@ public:
virtual void SetIdx2(sal_uInt32 nIdx) override;
virtual bool SeekPos(WW8_CP nCpPos) override;
virtual WW8_CP Where() override;
- virtual long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override;
+ virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override;
virtual void advance() override;
/// Handle is the unique ID of an annotation mark.
- long getHandle() const;
+ tools::Long getHandle() const;
bool getIsEnd() const;
};
@@ -836,11 +836,11 @@ public:
virtual void SetIdx2(sal_uInt32 nIdx) override;
virtual bool SeekPos(WW8_CP nCpPos) override;
virtual WW8_CP Where() override;
- virtual long GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen) override;
+ virtual tools::Long GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen) override;
virtual void advance() override;
/// Handle is the unique ID of a factoid mark.
- long getHandle() const;
+ tools::Long getHandle() const;
bool getIsEnd() const;
};
@@ -850,8 +850,8 @@ public:
struct WW8PLCFManResult
{
WW8_CP nCpPos; // attribute starting position
- long nMemLen; // length for previous
- long nCp2OrIdx; // footnote-textpos or index in PLCF
+ tools::Long nMemLen; // length for previous
+ tools::Long nCp2OrIdx; // footnote-textpos or index in PLCF
WW8_CP nCurrentCp; // only used by caller
const sal_uInt8* pMemPos;// Mem-Pos for Sprms
sal_uInt16 nSprmId; // Sprm-Id ( 0 = invalid Id -> skip! )
@@ -880,7 +880,7 @@ struct WW8PLCFxDesc
WW8PLCFx* pPLCFx;
std::stack<sal_uInt16>* pIdStack; // memory for Attr-Id for Attr-end(s)
const sal_uInt8* pMemPos;// where are the Sprm(s)
- long nOrigSprmsLen;
+ tools::Long nOrigSprmsLen;
WW8_CP nStartPos;
WW8_CP nEndPos;
@@ -899,7 +899,7 @@ struct WW8PLCFxDesc
WW8_CP nCp2OrIdx; // where are the NoSprm(s)
sal_Int32 nSprmsLen; // how many bytes for further Sprms / length of footnote
- long nCpOfs; // for Offset Header .. Footnote
+ tools::Long nCpOfs; // for Offset Header .. Footnote
bool bFirstSprm; // for recognizing the first Sprm of a group
bool bRealLineEnd; // false for Pap-Piece-end
sal_Int16 nRelativeJustify;
@@ -969,7 +969,7 @@ private:
bool IsSprmLegalForCategory(sal_uInt16 nSprmId, short nIdx) const;
public:
- WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, long nStartCp,
+ WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, tools::Long nStartCp,
bool bDoingDrawTextBox = false);
~WW8PLCFMan();
@@ -988,7 +988,7 @@ public:
WW8PLCFx_Book* GetBook() const { return static_cast<WW8PLCFx_Book*>(m_pBkm->pPLCFx); }
WW8PLCFx_AtnBook* GetAtnBook() const { return static_cast<WW8PLCFx_AtnBook*>(m_pAtnBkm->pPLCFx); }
WW8PLCFx_FactoidBook* GetFactoidBook() const { return static_cast<WW8PLCFx_FactoidBook*>(m_pFactoidBkm->pPLCFx); }
- long GetCpOfs() const { return m_pChp->nCpOfs; } // for Header/Footer...
+ tools::Long GetCpOfs() const { return m_pChp->nCpOfs; } // for Header/Footer...
/* asks, if *current paragraph* has an Sprm of this type */
SprmResult HasParaSprm(sal_uInt16 nId) const;
@@ -1005,7 +1005,7 @@ public:
{ return static_cast<WW8PLCFx_SEPX*>(m_pSep->pPLCFx); }
WW8PLCFxDesc* GetPap() const { return m_pPap; }
void TransferOpenSprms(std::stack<sal_uInt16> &rStack);
- void SeekPos( long nNewCp );
+ void SeekPos( tools::Long nNewCp );
void SaveAllPLCFx( WW8PLCFxSaveAll& rSave ) const;
void RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave );
WW8PLCFspecial* GetFdoa() const { return m_pFdoa; }
@@ -1031,7 +1031,7 @@ friend WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(const WW8Fib& rFib,
friend WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream*, SvStream*, SvStream*,
const WW8ScannerBase&, ePLCFT );
-friend WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase*, ManTypes, long, bool);
+friend WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase*, ManTypes, tools::Long, bool);
friend class SwWW8FltControlStack;
private:
@@ -1091,7 +1091,7 @@ public:
WW8_CP* pNextPieceCp = nullptr, bool* pTestFlag = nullptr) const;
sal_Int32 WW8ReadString(SvStream& rStrm, OUString& rStr, WW8_CP nCurrentStartCp,
- long nTotalLen, rtl_TextEncoding eEnc ) const;
+ tools::Long nTotalLen, rtl_TextEncoding eEnc ) const;
};
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index f41121945dd2..fea93ae66850 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -118,7 +118,7 @@ bool SwCTBWrapper::Read( SvStream& rS )
Tcg255SubStruct::Read( rS );
rS.ReadUInt16( reserved2 ).ReadUChar( reserved3 ).ReadUInt16( reserved4 ).ReadUInt16( reserved5 );
rS.ReadInt16( cbTBD ).ReadUInt16( cCust ).ReadInt32( cbDTBC );
- long nExpectedPos = rS.Tell() + cbDTBC;
+ tools::Long nExpectedPos = rS.Tell() + cbDTBC;
if ( cbDTBC )
{
// cbDTBC is the size in bytes of the SwTBC array
@@ -138,12 +138,12 @@ bool SwCTBWrapper::Read( SvStream& rS )
bytesToRead = cbDTBC - ( rS.Tell() - nStart );
} while ( bytesToRead > 0 );
}
- if ( static_cast< long >( rS.Tell() ) != nExpectedPos )
+ if ( static_cast< tools::Long >( rS.Tell() ) != nExpectedPos )
{
// Strange error condition, shouldn't happen ( but does in at least
// one test document ) In the case where it happens the SwTBC &
// TBCHeader records seem blank??? ( and incorrect )
- SAL_WARN_IF( static_cast< long >(rS.Tell()) != nExpectedPos, "sw.ww8","### Error: Expected pos not equal to actual pos after reading rtbdc");
+ SAL_WARN_IF( static_cast< tools::Long >(rS.Tell()) != nExpectedPos, "sw.ww8","### Error: Expected pos not equal to actual pos after reading rtbdc");
SAL_INFO("sw.ww8","\tPos now is 0x" << std::hex << rS.Tell() << " should be 0x" << std::hex << nExpectedPos );
// seek to correct position after rtbdc
rS.Seek( nExpectedPos );
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index dc819e7ffb21..d458936a0116 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -603,7 +603,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
const sal_uInt16 nDistance = pTop->GetDistance();
const sal_uInt16 nInWidth = pTop->GetInWidth();
const sal_uInt16 nOutWidth = pTop->GetOutWidth();
- const long nWidth = pTop->GetWidth();
+ const tools::Long nWidth = pTop->GetWidth();
bEqual = nDistance == pLeft->GetDistance() &&
nInWidth == pLeft->GetInWidth() &&
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 1ce3ec93a63e..752125c3c2ab 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1251,25 +1251,25 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
if ( rValue.Name == "ViewAreaTop" )
{
rValue.Value >>= nTmp;
- aRect.setY( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
+ aRect.setY( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
}
else if ( rValue.Name == "ViewAreaLeft" )
{
rValue.Value >>= nTmp;
- aRect.setX( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
+ aRect.setX( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
}
else if ( rValue.Name == "ViewAreaWidth" )
{
rValue.Value >>= nTmp;
Size aSize( aRect.GetSize() );
- aSize.setWidth( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
+ aSize.setWidth( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
aRect.SetSize( aSize );
}
else if ( rValue.Name == "ViewAreaHeight" )
{
rValue.Value >>= nTmp;
Size aSize( aRect.GetSize() );
- aSize.setHeight( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
+ aSize.setHeight( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
aRect.SetSize( aSize );
}
else if ( rValue.Name == "ShowRedlineChanges" )
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 68dbde33016d..50528f430448 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -916,7 +916,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
const SwTableBox *pBox = rBoxes[nBox];
// NEW TABLES
- const long nRowSpan = pBox->getRowSpan();
+ const tools::Long nRowSpan = pBox->getRowSpan();
if( nRowSpan < 1 )
{
SvXMLElementExport aElem2( *this, rTableInfo.GetPrefix(),
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 87e0eb9c712f..b580749c2911 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2252,7 +2252,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
( pCell->GetStartNode() || pCell->GetSubTable() ) )
{
// insert new empty cell for covered cells:
- long nBoxRowSpan = 1;
+ tools::Long nBoxRowSpan = 1;
if ( !m_bHasSubTables )
{
nBoxRowSpan = pCell->GetRowSpan();
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index f407db4b49bc..92a0ed6cebf9 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -114,7 +114,7 @@ static OUString GetDefaultString(sal_Int32 nChars)
return aStr.makeStringAndClear();
}
-static void calcFontHeightAnyAscent(vcl::RenderContext& rWin, vcl::Font const & _rFont, long& _nHeight, long& _nAscent)
+static void calcFontHeightAnyAscent(vcl::RenderContext& rWin, vcl::Font const & _rFont, tools::Long& _nHeight, tools::Long& _nAscent)
{
if ( !_nHeight )
{
@@ -283,7 +283,7 @@ void SwDropCapsPict::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
aOutputSizePixel.Height() - 2 * BORDER))));
OSL_ENSURE(mnLineH > 0, "We cannot make it that small");
- long nY0 = (aOutputSizePixel.Height() - (LINES * mnTotLineH)) / 2;
+ tools::Long nY0 = (aOutputSizePixel.Height() - (LINES * mnTotLineH)) / 2;
rRenderContext.SetFillColor(maTextLineColor);
@@ -294,7 +294,7 @@ void SwDropCapsPict::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
}
// Text background with gap (240 twips ~ 1 line height)
- const long nDistW = (((static_cast<long>(mnDistance) * 100) / 240) * mnTotLineH) / 100;
+ const tools::Long nDistW = (((static_cast<tools::Long>(mnDistance) * 100) / 240) * mnTotLineH) / 100;
rRenderContext.SetFillColor(maBackColor);
if (mpPage && mpPage->m_xDropCapsBox->get_active())
{
@@ -384,13 +384,13 @@ Size SwDropCapsPict::CalcTextSize()
sal_Int32 nStart;
sal_Int32 nEnd;
GetFirstScriptSegment(nStart, nEnd, nScript);
- long nTextWidth = 0;
- long nCJKHeight = 0;
- long nCTLHeight = 0;
- long nHeight = 0;
- long nAscent = 0;
- long nCJKAscent = 0;
- long nCTLAscent = 0;
+ tools::Long nTextWidth = 0;
+ tools::Long nCJKHeight = 0;
+ tools::Long nCTLHeight = 0;
+ tools::Long nHeight = 0;
+ tools::Long nAscent = 0;
+ tools::Long nCJKAscent = 0;
+ tools::Long nCTLAscent = 0;
do
{
SvxFont& rFnt = (nScript == css::i18n::ScriptType::ASIAN)
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 25b93c773e15..05dafb14430a 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -355,7 +355,7 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl, weld::ComboBox&, void)
// Double-Cast for VA3.0
FieldUnit eFieldUnit = static_cast<FieldUnit>(m_xMetricLB->get_id(nMPos).toUInt32());
bool bModified = m_xTabMF->get_value_changed_from_saved();
- long nVal = bModified ?
+ tools::Long nVal = bModified ?
sal::static_int_cast<sal_Int32, sal_Int64 >( m_xTabMF->denormalize( m_xTabMF->get_value( FieldUnit::TWIP ) )) :
m_nLastTab;
::SetFieldUnit( *m_xTabMF, eFieldUnit );
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 4cba683ec396..54f5729206e8 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1431,18 +1431,18 @@ void SwMarkPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Recta
// Page
aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
- const long nOutWPix = aPage.GetWidth();
- const long nOutHPix = aPage.GetHeight();
+ const tools::Long nOutWPix = aPage.GetWidth();
+ const tools::Long nOutHPix = aPage.GetHeight();
// PrintArea
- const long nLBorder = 8;
- const long nRBorder = 8;
- const long nTBorder = 4;
- const long nBBorder = 4;
+ const tools::Long nLBorder = 8;
+ const tools::Long nRBorder = 8;
+ const tools::Long nTBorder = 4;
+ const tools::Long nBBorder = 4;
aLeftPagePrtArea = tools::Rectangle(Point(nLBorder, nTBorder), Point((nOutWPix - 1) - nRBorder, (nOutHPix - 1) - nBBorder));
- const long nWidth = aLeftPagePrtArea.GetWidth();
- const long nCorr = (nWidth & 1) != 0 ? 0 : 1;
+ const tools::Long nWidth = aLeftPagePrtArea.GetWidth();
+ const tools::Long nCorr = (nWidth & 1) != 0 ? 0 : 1;
aLeftPagePrtArea.SetSize(Size(nWidth / 2 - (nLBorder + nRBorder) / 2 + nCorr, aLeftPagePrtArea.GetHeight()));
aRightPagePrtArea = aLeftPagePrtArea;
@@ -1507,11 +1507,11 @@ void SwMarkPreview::PaintPage(vcl::RenderContext& rRenderContext, const tools::R
aTextLine.AdjustRight( -4 );
aTextLine.Move(0, 4);
- const long nStep = aTextLine.GetHeight() + 2;
- const long nLines = rRect.GetHeight() / (aTextLine.GetHeight() + 2) - 1;
+ const tools::Long nStep = aTextLine.GetHeight() + 2;
+ const tools::Long nLines = rRect.GetHeight() / (aTextLine.GetHeight() + 2) - 1;
// simulate text
- for (long i = 0; i < nLines; ++i)
+ for (tools::Long i = 0; i < nLines; ++i)
{
if (i == (nLines - 1))
aTextLine.SetSize(Size(aTextLine.GetWidth() / 2, aTextLine.GetHeight()));
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index a630874b4a92..d0a42a4bfbb3 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -642,7 +642,7 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, TableFormatHdl, weld::Button&, void)
SwGetCurColNumPara aPara;
const sal_uInt16 nNum = rSh.GetCurColNum( &aPara );
- long nWidth;
+ tools::Long nWidth;
if( nNum )
{
@@ -651,14 +651,14 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, TableFormatHdl, weld::Button&, void)
const SwColumns& rCols = rCol.GetColumns();
// initialise nStart and nEnd for nNum == 0
- long nWidth1 = 0,
+ tools::Long nWidth1 = 0,
nStart1 = 0,
nEnd1 = nWidth;
for( sal_uInt16 i = 0; i < nNum; ++i )
{
const SwColumn* pCol = &rCols[i];
nStart1 = pCol->GetLeft() + nWidth1;
- nWidth1 += static_cast<long>(rCol.CalcColWidth( i, static_cast<sal_uInt16>(nWidth) ));
+ nWidth1 += static_cast<tools::Long>(rCol.CalcColWidth( i, static_cast<sal_uInt16>(nWidth) ));
nEnd1 = nWidth1 - pCol->GetRight();
}
if(nStart1 || nEnd1 != nWidth)
@@ -688,7 +688,7 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, TableFormatHdl, weld::Button&, void)
if (nCols != pRep->GetAllColCount() && nCols > 0)
{
// Number of columns has changed: then the TabCols have to be adjusted
- long nWidth = pRep->GetWidth();
+ tools::Long nWidth = pRep->GetWidth();
--nCols;
SwTabCols aTabCols( nCols );
aTabCols.SetRight( nWidth );
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 6c196b9d5816..2793ddfe0a28 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -192,8 +192,8 @@ void SwMailMergeLayoutPage::Activate()
}
else
{
- long nLeft = static_cast< long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
- long nTop = static_cast< long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
+ tools::Long nLeft = static_cast< tools::Long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
+ tools::Long nTop = static_cast< tools::Long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
m_pAddressBlockFormat = InsertAddressFrame(
*m_pExampleWrtShell, m_pWizard->GetConfigItem(),
Point(nLeft, nTop),
@@ -209,8 +209,8 @@ bool SwMailMergeLayoutPage::commitPage(::vcl::WizardTypes::CommitPageReason eRea
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
if (eReason == ::vcl::WizardTypes::eTravelForward || eReason == ::vcl::WizardTypes::eFinish)
{
- long nLeft = static_cast< long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
- long nTop = static_cast< long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
+ tools::Long nLeft = static_cast< tools::Long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
+ tools::Long nTop = static_cast< tools::Long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
InsertAddressAndGreeting(
m_pWizard->GetSwView(),
rConfigItem,
@@ -402,7 +402,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
//go to start of the doc, directly!
rShell.SttEndDoc(true);
//and go by paragraph until the position is reached
- long nYPos = rShell.GetCharRect().Top();
+ tools::Long nYPos = rShell.GetCharRect().Top();
while(nYPos < GREETING_TOP_DISTANCE)
{
if(!rShell.FwdPara())
@@ -655,8 +655,8 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, weld::MetricSpinBu
if(!(m_pExampleWrtShell && m_pAddressBlockFormat))
return;
- long nLeft = static_cast< long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
- long nTop = static_cast< long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
+ tools::Long nLeft = static_cast< tools::Long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP)));
+ tools::Long nTop = static_cast< tools::Long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP)));
SfxItemSet aSet(
m_pExampleWrtShell->GetAttrPool(),
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 790254fc9496..843083c99eb4 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1013,7 +1013,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl, weld::Button&, void)
SwSectionFormats aOrigArray(rDocFormats);
SwSectionFormat* pFormat = aOrigArray[pSectRepr->GetArrPos()];
- long nWidth = rSh.GetSectionWidth(*pFormat);
+ tools::Long nWidth = rSh.GetSectionWidth(*pFormat);
aOrigArray.clear();
if (!nWidth)
nWidth = USHRT_MAX;
@@ -1360,7 +1360,7 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
AddTabPage("indents", SwSectionIndentTabPage::Create, nullptr);
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = rHtmlOpt.GetExportMode();
+ tools::Long nHtmlMode = rHtmlOpt.GetExportMode();
bool bWeb = dynamic_cast<SwWebDocShell*>( rSh.GetView().GetDocShell() ) != nullptr ;
if(bWeb)
@@ -1996,7 +1996,7 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
AddTabPage("indents", SwSectionIndentTabPage::Create, nullptr);
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = rHtmlOpt.GetExportMode();
+ tools::Long nHtmlMode = rHtmlOpt.GetExportMode();
bool bWeb = dynamic_cast<SwWebDocShell*>( rSh.GetView().GetDocShell() ) != nullptr ;
if(bWeb)
{
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 38945a3a8cbc..d691c96fc892 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -106,8 +106,8 @@ namespace {
}
-static long lUserW = 5669; // 10 cm
-static long lUserH = 5669; // 10 cm
+static tools::Long lUserW = 5669; // 10 cm
+static tools::Long lUserH = 5669; // 10 cm
SwEnvFormatPage::SwEnvFormatPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
: SfxTabPage(pPage, pController, "modules/swriter/ui/envformatpage.ui", "EnvFormatPage", &rSet)
@@ -275,7 +275,7 @@ void SwEnvFormatPage::Edit(const OString& rIdent, bool bSender)
aTmpSet.Put( aTabPos );
// left border as offset
- const long nOff = aTmpSet.Get( RES_LR_SPACE ).GetTextLeft();
+ const tools::Long nOff = aTmpSet.Get( RES_LR_SPACE ).GetTextLeft();
SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
aTmpSet.Put( aOff );
@@ -347,12 +347,12 @@ SfxItemSet *SwEnvFormatPage::GetCollItemSet(SwTextFormatColl const * pColl, bool
IMPL_LINK_NOARG(SwEnvFormatPage, FormatHdl, weld::ComboBox&, void)
{
- long lWidth;
- long lHeight;
- long lSendFromLeft;
- long lSendFromTop;
- long lAddrFromLeft;
- long lAddrFromTop;
+ tools::Long lWidth;
+ tools::Long lHeight;
+ tools::Long lSendFromLeft;
+ tools::Long lSendFromTop;
+ tools::Long lAddrFromLeft;
+ tools::Long lAddrFromTop;
const sal_uInt16 nPaper = m_aIDs[m_xSizeFormatBox->get_active()];
if (nPaper != sal_uInt16(PAPER_USER))
@@ -388,10 +388,10 @@ IMPL_LINK_NOARG(SwEnvFormatPage, FormatHdl, weld::ComboBox&, void)
void SwEnvFormatPage::SetMinMax()
{
- long lWVal = static_cast< long >(getfieldval(*m_xSizeWidthField ));
- long lHVal = static_cast< long >(getfieldval(*m_xSizeHeightField));
+ tools::Long lWVal = static_cast< tools::Long >(getfieldval(*m_xSizeWidthField ));
+ tools::Long lHVal = static_cast< tools::Long >(getfieldval(*m_xSizeHeightField));
- long lWidth = std::max(lWVal, lHVal),
+ tools::Long lWidth = std::max(lWVal, lHVal),
lHeight = std::min(lWVal, lHVal);
// Min and Max
@@ -434,15 +434,15 @@ void SwEnvFormatPage::FillItem(SwEnvItem& rItem)
const sal_uInt16 nPaper = m_aIDs[m_xSizeFormatBox->get_active()];
if (nPaper == sal_uInt16(PAPER_USER))
{
- long lWVal = static_cast< long >(getfieldval(*m_xSizeWidthField ));
- long lHVal = static_cast< long >(getfieldval(*m_xSizeHeightField));
+ tools::Long lWVal = static_cast< tools::Long >(getfieldval(*m_xSizeWidthField ));
+ tools::Long lHVal = static_cast< tools::Long >(getfieldval(*m_xSizeHeightField));
rItem.m_nWidth = std::max(lWVal, lHVal);
rItem.m_nHeight = std::min(lWVal, lHVal);
}
else
{
- long lWVal = SvxPaperInfo::GetPaperSize(static_cast<Paper>(nPaper)).Width ();
- long lHVal = SvxPaperInfo::GetPaperSize(static_cast<Paper>(nPaper)).Height();
+ tools::Long lWVal = SvxPaperInfo::GetPaperSize(static_cast<Paper>(nPaper)).Width ();
+ tools::Long lHVal = SvxPaperInfo::GetPaperSize(static_cast<Paper>(nPaper)).Height();
rItem.m_nWidth = std::max(lWVal, lHVal);
rItem.m_nHeight = std::min(lWVal, lHVal);
}
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index 0f2e69f8e862..d01848470f1d 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -61,8 +61,8 @@ void SwEnvPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
const SwEnvItem& rItem = m_pDialog->aEnvItem;
- const long nPageW = std::max(rItem.m_nWidth, rItem.m_nHeight);
- const long nPageH = std::min(rItem.m_nWidth, rItem.m_nHeight);
+ const tools::Long nPageW = std::max(rItem.m_nWidth, rItem.m_nHeight);
+ const tools::Long nPageH = std::min(rItem.m_nWidth, rItem.m_nHeight);
Size aSize(GetOutputSizePixel());
@@ -79,38 +79,38 @@ void SwEnvPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
rRenderContext.SetLineColor(aFront);
// Envelope
- const long nW = static_cast<long>(f * nPageW);
- const long nH = static_cast<long>(f * nPageH);
- const long nX = (aSize.Width () - nW) / 2;
- const long nY = (aSize.Height() - nH) / 2;
+ const tools::Long nW = static_cast<tools::Long>(f * nPageW);
+ const tools::Long nH = static_cast<tools::Long>(f * nPageH);
+ const tools::Long nX = (aSize.Width () - nW) / 2;
+ const tools::Long nY = (aSize.Height() - nH) / 2;
rRenderContext.SetFillColor(aBack);
rRenderContext.DrawRect(tools::Rectangle(Point(nX, nY), Size(nW, nH)));
// Sender
if (rItem.m_bSend)
{
- const long nSendX = nX + static_cast<long>(f * rItem.m_nSendFromLeft);
- const long nSendY = nY + static_cast<long>(f * rItem.m_nSendFromTop );
- const long nSendW = static_cast<long>(f * (rItem.m_nAddrFromLeft - rItem.m_nSendFromLeft));
- const long nSendH = static_cast<long>(f * (rItem.m_nAddrFromTop - rItem.m_nSendFromTop - 566));
+ const tools::Long nSendX = nX + static_cast<tools::Long>(f * rItem.m_nSendFromLeft);
+ const tools::Long nSendY = nY + static_cast<tools::Long>(f * rItem.m_nSendFromTop );
+ const tools::Long nSendW = static_cast<tools::Long>(f * (rItem.m_nAddrFromLeft - rItem.m_nSendFromLeft));
+ const tools::Long nSendH = static_cast<tools::Long>(f * (rItem.m_nAddrFromTop - rItem.m_nSendFromTop - 566));
rRenderContext.SetFillColor(aMedium);
rRenderContext.DrawRect(tools::Rectangle(Point(nSendX, nSendY), Size(nSendW, nSendH)));
}
// Addressee
- const long nAddrX = nX + static_cast<long>(f * rItem.m_nAddrFromLeft);
- const long nAddrY = nY + static_cast<long>(f * rItem.m_nAddrFromTop );
- const long nAddrW = static_cast<long>(f * (nPageW - rItem.m_nAddrFromLeft - 566));
- const long nAddrH = static_cast<long>(f * (nPageH - rItem.m_nAddrFromTop - 566));
+ const tools::Long nAddrX = nX + static_cast<tools::Long>(f * rItem.m_nAddrFromLeft);
+ const tools::Long nAddrY = nY + static_cast<tools::Long>(f * rItem.m_nAddrFromTop );
+ const tools::Long nAddrW = static_cast<tools::Long>(f * (nPageW - rItem.m_nAddrFromLeft - 566));
+ const tools::Long nAddrH = static_cast<tools::Long>(f * (nPageH - rItem.m_nAddrFromTop - 566));
rRenderContext.SetFillColor(aMedium);
rRenderContext.DrawRect(tools::Rectangle(Point(nAddrX, nAddrY), Size(nAddrW, nAddrH)));
// Stamp
- const long nStmpW = static_cast<long>(f * 1417 /* 2,5 cm */);
- const long nStmpH = static_cast<long>(f * 1701 /* 3,0 cm */);
- const long nStmpX = nX + nW - static_cast<long>(f * 566) - nStmpW;
- const long nStmpY = nY + static_cast<long>(f * 566);
+ const tools::Long nStmpW = static_cast<tools::Long>(f * 1417 /* 2,5 cm */);
+ const tools::Long nStmpH = static_cast<tools::Long>(f * 1701 /* 3,0 cm */);
+ const tools::Long nStmpX = nX + nW - static_cast<tools::Long>(f * 566) - nStmpW;
+ const tools::Long nStmpY = nY + static_cast<tools::Long>(f * 566);
rRenderContext.SetFillColor(aBack);
rRenderContext.DrawRect(tools::Rectangle(Point(nStmpX, nStmpY), Size(nStmpW, nStmpH)));
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index afb54c7df414..8aa1d8de9fc9 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -239,7 +239,7 @@ SwLabPage::SwLabPage(weld::Container* pPage, weld::DialogController* pController
m_xWritingEdit->get_height_rows(10));
m_xHiddenSortTypeBox->make_sorted();
- long nListBoxWidth = m_xWritingEdit->get_approximate_digit_width() * 25;
+ tools::Long nListBoxWidth = m_xWritingEdit->get_approximate_digit_width() * 25;
m_xTableLB->set_size_request(nListBoxWidth, -1);
m_xDatabaseLB->set_size_request(nListBoxWidth, -1);
m_xDBFieldLB->set_size_request(nListBoxWidth, -1);
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 5011c4799e43..730d275901d7 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -40,7 +40,7 @@ using namespace utl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
-#define ROUND(x) static_cast<long>((x) + .5)
+#define ROUND(x) static_cast<tools::Long>((x) + .5)
namespace {
@@ -139,14 +139,14 @@ void SwLabPreview::SetDrawingArea(weld::DrawingArea* pWidget)
void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
const Size aSize(GetOutputSizePixel());
- const long lOutWPix = aSize.Width();
- const long lOutHPix = aSize.Height();
+ const tools::Long lOutWPix = aSize.Width();
+ const tools::Long lOutHPix = aSize.Height();
// Scale factor
const double fxpix = double(lOutWPix - (2 * (m_lLeftWidth + 15))) / double(lOutWPix);
- const long lOutWPix23 = long(double(lOutWPix) * fxpix);
- const long lOutHPix23 = long(double(lOutHPix) * fxpix);
+ const tools::Long lOutWPix23 = tools::Long(double(lOutWPix) * fxpix);
+ const tools::Long lOutHPix23 = tools::Long(double(lOutHPix) * fxpix);
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
const Color& rWinColor = rStyleSettings.GetWindowColor();
@@ -167,11 +167,11 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
rRenderContext.SetFont(aPaintFont);
// size of region to be displayed
- const long lDispW = m_aItem.m_lLeft + m_aItem.m_lHDist + ((m_aItem.m_nCols == 1)
+ const tools::Long lDispW = m_aItem.m_lLeft + m_aItem.m_lHDist + ((m_aItem.m_nCols == 1)
? m_aItem.m_lLeft
: ROUND(m_aItem.m_lHDist / 10.0));
- const long lDispH = m_aItem.m_lUpper + m_aItem.m_lVDist + ((m_aItem.m_nRows == 1)
+ const tools::Long lDispH = m_aItem.m_lUpper + m_aItem.m_lVDist + ((m_aItem.m_nRows == 1)
? m_aItem.m_lUpper
: ROUND(m_aItem.m_lVDist / 10.0));
@@ -181,17 +181,17 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
const float f = std::min(fx, fy);
// zero point
- const long lOutlineW = ROUND(f * lDispW);
- const long lOutlineH = ROUND(f * lDispH);
-
- const long lX0 = (lOutWPix - lOutlineW) / 2;
- const long lY0 = (lOutHPix - lOutlineH) / 2;
- const long lX1 = lX0 + ROUND(f * m_aItem.m_lLeft );
- const long lY1 = lY0 + ROUND(f * m_aItem.m_lUpper);
- const long lX2 = lX0 + ROUND(f * (m_aItem.m_lLeft + m_aItem.m_lWidth ));
- const long lY2 = lY0 + ROUND(f * (m_aItem.m_lUpper + m_aItem.m_lHeight));
- const long lX3 = lX0 + ROUND(f * (m_aItem.m_lLeft + m_aItem.m_lHDist ));
- const long lY3 = lY0 + ROUND(f * (m_aItem.m_lUpper + m_aItem.m_lVDist ));
+ const tools::Long lOutlineW = ROUND(f * lDispW);
+ const tools::Long lOutlineH = ROUND(f * lDispH);
+
+ const tools::Long lX0 = (lOutWPix - lOutlineW) / 2;
+ const tools::Long lY0 = (lOutHPix - lOutlineH) / 2;
+ const tools::Long lX1 = lX0 + ROUND(f * m_aItem.m_lLeft );
+ const tools::Long lY1 = lY0 + ROUND(f * m_aItem.m_lUpper);
+ const tools::Long lX2 = lX0 + ROUND(f * (m_aItem.m_lLeft + m_aItem.m_lWidth ));
+ const tools::Long lY2 = lY0 + ROUND(f * (m_aItem.m_lUpper + m_aItem.m_lHeight));
+ const tools::Long lX3 = lX0 + ROUND(f * (m_aItem.m_lLeft + m_aItem.m_lHDist ));
+ const tools::Long lY3 = lY0 + ROUND(f * (m_aItem.m_lUpper + m_aItem.m_lVDist ));
// draw outline (area)
rRenderContext.DrawRect(tools::Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH)));
@@ -221,7 +221,7 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
// annotation: left border
if (m_aItem.m_lLeft)
{
- long lX = (lX0 + lX1) / 2;
+ tools::Long lX = (lX0 + lX1) / 2;
DrawArrow(rRenderContext, Point(lX0, lY0 - 5), Point(lX1, lY0 - 5), false);
DrawArrow(rRenderContext, Point(lX, lY0 - 10), Point(lX, lY0 - 5), true);
rRenderContext.DrawText(Point(lX1 - m_lLeftWidth, lY0 - 10 - m_lXHeight), m_aLeftStr);
@@ -236,8 +236,8 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
// annotation: width and height
{
- long lX = lX2 - m_lXWidth / 2 - m_lHeightWidth / 2;
- long lY = lY1 + m_lXHeight;
+ tools::Long lX = lX2 - m_lXWidth / 2 - m_lHeightWidth / 2;
+ tools::Long lY = lY1 + m_lXHeight;
rRenderContext.DrawLine(Point(lX1, lY), Point(lX2 - 1, lY));
rRenderContext.DrawLine(Point(lX, lY1), Point(lX, lY2 - 1));
@@ -249,7 +249,7 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
// annotation: horizontal gap
if (m_aItem.m_nCols > 1)
{
- long lX = (lX1 + lX3) / 2;
+ tools::Long lX = (lX1 + lX3) / 2;
DrawArrow(rRenderContext, Point(lX1, lY0 - 5), Point(lX3, lY0 - 5), false);
DrawArrow(rRenderContext, Point(lX, lY0 - 10), Point(lX, lY0 - 5), true);
rRenderContext.DrawText(Point(lX - m_lHDistWidth / 2, lY0 - 10 - m_lXHeight), m_aHDistStr);
@@ -264,14 +264,14 @@ void SwLabPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
// annotation: columns
{
- long lY = lY0 + lOutlineH + 4;
+ tools::Long lY = lY0 + lOutlineH + 4;
DrawArrow(rRenderContext, Point(lX0, lY), Point(lX0 + lOutlineW - 1, lY), true);
rRenderContext.DrawText(Point((lX0 + lX0 + lOutlineW - 1) / 2 - m_lColsWidth / 2, lY + 5), m_aColsStr);
}
// annotation: lines
{
- long lX = lX0 + lOutlineW + 4;
+ tools::Long lX = lX0 + lOutlineW + 4;
DrawArrow(rRenderContext, Point(lX, lY0), Point(lX, lY0 + lOutlineH - 1), true);
rRenderContext.DrawText(Point(lX + 5, (lY0 + lY0 + lOutlineH - 1 - m_lXHeight / 2) / 2), m_aRowsStr);
}
@@ -364,42 +364,42 @@ IMPL_LINK_NOARG(SwLabFormatPage, PreviewHdl, Timer *, void)
void SwLabFormatPage::ChangeMinMax()
{
- long lMax = 31748; // 56 cm
- long nMinSize = 10; // 0,1cm
+ tools::Long lMax = 31748; // 56 cm
+ tools::Long nMinSize = 10; // 0,1cm
// Min and Max
int nCols = m_xColsField->get_value(),
nRows = m_xRowsField->get_value();
- long lLeft = static_cast< long >(getfldval(*m_xLeftField )),
- lUpper = static_cast< long >(getfldval(*m_xUpperField)),
- lHDist = static_cast< long >(getfldval(*m_xHDistField)),
- lVDist = static_cast< long >(getfldval(*m_xVDistField)),
- lWidth = static_cast< long >(getfldval(*m_xWidthField)),
- lHeight = static_cast< long >(getfldval(*m_xHeightField)),
+ tools::Long lLeft = static_cast< tools::Long >(getfldval(*m_xLeftField )),
+ lUpper = static_cast< tools::Long >(getfldval(*m_xUpperField)),
+ lHDist = static_cast< tools::Long >(getfldval(*m_xHDistField)),
+ lVDist = static_cast< tools::Long >(getfldval(*m_xVDistField)),
+ lWidth = static_cast< tools::Long >(getfldval(*m_xWidthField)),
+ lHeight = static_cast< tools::Long >(getfldval(*m_xHeightField)),
lMinPWidth = lLeft + (nCols - 1) * lHDist + lWidth,
lMinPHeight = lUpper + (nRows - 1) * lVDist + lHeight;
m_xHDistField->set_min(nMinSize, FieldUnit::CM);
m_xVDistField->set_min(nMinSize, FieldUnit::CM);
- m_xHDistField->set_max(long(100) * ((lMax - lLeft ) / std::max(1L, static_cast<long>(nCols))), FieldUnit::TWIP);
- m_xVDistField->set_max(long(100) * ((lMax - lUpper) / std::max(1L, static_cast<long>(nRows))), FieldUnit::TWIP);
+ m_xHDistField->set_max(tools::Long(100) * ((lMax - lLeft ) / std::max(1L, static_cast<tools::Long>(nCols))), FieldUnit::TWIP);
+ m_xVDistField->set_max(tools::Long(100) * ((lMax - lUpper) / std::max(1L, static_cast<tools::Long>(nRows))), FieldUnit::TWIP);
m_xWidthField->set_min(nMinSize, FieldUnit::CM);
m_xHeightField->set_min(nMinSize, FieldUnit::CM);
- m_xWidthField->set_max(long(100) * lHDist, FieldUnit::TWIP);
- m_xHeightField->set_max(long(100) * lVDist, FieldUnit::TWIP);
+ m_xWidthField->set_max(tools::Long(100) * lHDist, FieldUnit::TWIP);
+ m_xHeightField->set_max(tools::Long(100) * lVDist, FieldUnit::TWIP);
- m_xLeftField->set_max(long(100) * (lMax - nCols * lHDist), FieldUnit::TWIP);
- m_xUpperField->set_max(long(100) * (lMax - nRows * lVDist), FieldUnit::TWIP);
+ m_xLeftField->set_max(tools::Long(100) * (lMax - nCols * lHDist), FieldUnit::TWIP);
+ m_xUpperField->set_max(tools::Long(100) * (lMax - nRows * lVDist), FieldUnit::TWIP);
m_xColsField->set_range(1, (lMax - lLeft ) / std::max(1L, lHDist));
m_xRowsField->set_range(1, (lMax - lUpper) / std::max(1L, lVDist));
- m_xPWidthField->set_range(long(100) * lMinPWidth, long(100) * lMax, FieldUnit::TWIP);
- m_xPHeightField->set_range(long(100) * lMinPHeight, long(100) * lMax, FieldUnit::TWIP);
+ m_xPWidthField->set_range(tools::Long(100) * lMinPWidth, tools::Long(100) * lMax, FieldUnit::TWIP);
+ m_xPHeightField->set_range(tools::Long(100) * lMinPHeight, tools::Long(100) * lMax, FieldUnit::TWIP);
}
std::unique_ptr<SfxTabPage> SwLabFormatPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
@@ -429,16 +429,16 @@ void SwLabFormatPage::FillItem(SwLabItem& rItem)
rItem.m_aMake = rItem.m_aType = SwResId(STR_CUSTOM_LABEL);
SwLabRec& rRec = *GetParentSwLabDlg()->Recs()[0];
- rItem.m_lHDist = rRec.m_nHDist = static_cast< long >(getfldval(*m_xHDistField ));
- rItem.m_lVDist = rRec.m_nVDist = static_cast< long >(getfldval(*m_xVDistField ));
- rItem.m_lWidth = rRec.m_nWidth = static_cast< long >(getfldval(*m_xWidthField ));
- rItem.m_lHeight = rRec.m_nHeight = static_cast< long >(getfldval(*m_xHeightField));
- rItem.m_lLeft = rRec.m_nLeft = static_cast< long >(getfldval(*m_xLeftField ));
- rItem.m_lUpper = rRec.m_nUpper = static_cast< long >(getfldval(*m_xUpperField ));
+ rItem.m_lHDist = rRec.m_nHDist = static_cast< tools::Long >(getfldval(*m_xHDistField ));
+ rItem.m_lVDist = rRec.m_nVDist = static_cast< tools::Long >(getfldval(*m_xVDistField ));
+ rItem.m_lWidth = rRec.m_nWidth = static_cast< tools::Long >(getfldval(*m_xWidthField ));
+ rItem.m_lHeight = rRec.m_nHeight = static_cast< tools::Long >(getfldval(*m_xHeightField));
+ rItem.m_lLeft = rRec.m_nLeft = static_cast< tools::Long >(getfldval(*m_xLeftField ));
+ rItem.m_lUpper = rRec.m_nUpper = static_cast< tools::Long >(getfldval(*m_xUpperField ));
rItem.m_nCols = rRec.m_nCols = static_cast< sal_Int32 >(m_xColsField->get_value());
rItem.m_nRows = rRec.m_nRows = static_cast< sal_Int32 >(m_xRowsField->get_value());
- rItem.m_lPWidth = rRec.m_nPWidth = static_cast< long >(getfldval(*m_xPWidthField ));
- rItem.m_lPHeight = rRec.m_nPHeight = static_cast< long >(getfldval(*m_xPHeightField));
+ rItem.m_lPWidth = rRec.m_nPWidth = static_cast< tools::Long >(getfldval(*m_xPWidthField ));
+ rItem.m_lPHeight = rRec.m_nPHeight = static_cast< tools::Long >(getfldval(*m_xPHeightField));
}
@@ -486,16 +486,16 @@ void SwLabFormatPage::Reset(const SfxItemSet* )
IMPL_LINK_NOARG(SwLabFormatPage, SaveHdl, weld::Button&, void)
{
SwLabRec aRec;
- aRec.m_nHDist = static_cast< long >(getfldval(*m_xHDistField));
- aRec.m_nVDist = static_cast< long >(getfldval(*m_xVDistField ));
- aRec.m_nWidth = static_cast< long >(getfldval(*m_xWidthField ));
- aRec.m_nHeight = static_cast< long >(getfldval(*m_xHeightField));
- aRec.m_nLeft = static_cast< long >(getfldval(*m_xLeftField ));
- aRec.m_nUpper = static_cast< long >(getfldval(*m_xUpperField ));
+ aRec.m_nHDist = static_cast< tools::Long >(getfldval(*m_xHDistField));
+ aRec.m_nVDist = static_cast< tools::Long >(getfldval(*m_xVDistField ));
+ aRec.m_nWidth = static_cast< tools::Long >(getfldval(*m_xWidthField ));
+ aRec.m_nHeight = static_cast< tools::Long >(getfldval(*m_xHeightField));
+ aRec.m_nLeft = static_cast< tools::Long >(getfldval(*m_xLeftField ));
+ aRec.m_nUpper = static_cast< tools::Long >(getfldval(*m_xUpperField ));
aRec.m_nCols = static_cast< sal_Int32 >(m_xColsField->get_value());
aRec.m_nRows = static_cast< sal_Int32 >(m_xRowsField->get_value());
- aRec.m_nPWidth = static_cast< long >(getfldval(*m_xPWidthField ));
- aRec.m_nPHeight = static_cast< long >(getfldval(*m_xPHeightField));
+ aRec.m_nPWidth = static_cast< tools::Long >(getfldval(*m_xPWidthField ));
+ aRec.m_nPHeight = static_cast< tools::Long >(getfldval(*m_xPHeightField));
aRec.m_bCont = aItem.m_bCont;
SwSaveLabelDlg aSaveDlg(GetParentSwLabDlg(), aRec);
aSaveDlg.SetLabel(aItem.m_aLstMake, aItem.m_aLstType);
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index 8e6d6a1a2cea..0f4243aacac1 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -42,15 +42,15 @@ class SwLabPreview : public weld::CustomWidgetController
OUString m_aColsStr;
OUString m_aRowsStr;
- long m_lHDistWidth;
- long m_lVDistWidth;
- long m_lHeightWidth;
- long m_lLeftWidth;
- long m_lUpperWidth;
- long m_lColsWidth;
-
- long m_lXWidth;
- long m_lXHeight;
+ tools::Long m_lHDistWidth;
+ tools::Long m_lVDistWidth;
+ tools::Long m_lHeightWidth;
+ tools::Long m_lLeftWidth;
+ tools::Long m_lUpperWidth;
+ tools::Long m_lColsWidth;
+
+ tools::Long m_lXWidth;
+ tools::Long m_lXHeight;
SwLabItem m_aItem;
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index d86416f68df3..5c6bc57e70aa 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -561,7 +561,7 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
case SwFieldTypesEnum::Time:
{
nFormat = m_xNumFormatLB->GetFormat();
- long nVal = static_cast< long >(m_xDateOffsetED->get_value());
+ tools::Long nVal = static_cast< tools::Long >(m_xDateOffsetED->get_value());
if (nTypeId == SwFieldTypesEnum::Date)
aVal = OUString::number(nVal * 60 * 24);
else
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 8e4c471ddef7..ac63432eb60c 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -223,7 +223,7 @@ void SwColumnDlg::ObjectHdl(const weld::ComboBox* pBox)
}
weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox();
m_nOldSelection = pApplyToLB->get_active_id().toInt32();
- long nWidth = m_nSelectionWidth;
+ tools::Long nWidth = m_nSelectionWidth;
switch(m_nOldSelection)
{
case LISTBOX_SELECTION :
@@ -364,7 +364,7 @@ void SwColumnPage::ResetColWidth()
const sal_uInt16 nWidth = GetMaxWidth( m_xColMgr.get(), m_nCols ) / m_nCols;
for(sal_uInt16 i = 0; i < m_nCols; ++i)
- m_nColWidth[i] = static_cast<long>(nWidth);
+ m_nColWidth[i] = static_cast<tools::Long>(nWidth);
}
}
@@ -490,7 +490,7 @@ SwColumnPage::SwColumnPage(weld::Container* pPage, weld::DialogController* pCont
SvxBorderLineStyle::DASHED );
sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::POINT);
- nLineWidth = static_cast<long>(vcl::ConvertDoubleValue(
+ nLineWidth = static_cast<tools::Long>(vcl::ConvertDoubleValue(
nLineWidth,
m_xLineWidthEdit->get_digits(),
FieldUnit::POINT, MapUnit::MapTwip ));
@@ -513,9 +513,9 @@ SwColumnPage::~SwColumnPage()
m_xTextDirectionLB.reset();
}
-void SwColumnPage::SetPageWidth(long nPageWidth)
+void SwColumnPage::SetPageWidth(tools::Long nPageWidth)
{
- long nNewMaxWidth = static_cast< long >(m_xEd1->NormalizePercent(nPageWidth));
+ tools::Long nNewMaxWidth = static_cast< tools::Long >(m_xEd1->NormalizePercent(nPageWidth));
m_xDistEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
m_xDistEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
@@ -639,12 +639,12 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void )
{
if (!m_xColMgr)
return;
- long nGutterWidth = m_xColMgr->GetGutterWidth();
+ tools::Long nGutterWidth = m_xColMgr->GetGutterWidth();
if (m_nCols > 1)
{
// Determine whether the most narrow column is too narrow
// for the adjusted column gap
- long nMin = m_nColWidth[0];
+ tools::Long nMin = m_nColWidth[0];
for( sal_uInt16 i = 1; i < m_nCols; ++i )
nMin = std::min(nMin, m_nColWidth[i]);
@@ -655,7 +655,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void )
m_xColMgr->SetAutoWidth(false);
// when the user didn't allocate the whole width,
// add the missing amount to the last column.
- long nSum = 0;
+ tools::Long nSum = 0;
for(sal_uInt16 i = 0; i < m_nCols; ++i)
nSum += m_nColWidth[i];
nGutterWidth = 0;
@@ -663,7 +663,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void )
nGutterWidth += m_nColDist[i];
nSum += nGutterWidth;
- long nMaxW = m_xColMgr->GetActualSize();
+ tools::Long nMaxW = m_xColMgr->GetActualSize();
if( nSum < nMaxW )
m_nColWidth[m_nCols - 1] += nMaxW - nSum;
@@ -671,7 +671,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void )
m_xColMgr->SetColWidth( 0, static_cast< sal_uInt16 >(m_nColWidth[0] + m_nColDist[0]/2) );
for( sal_uInt16 i = 1; i < m_nCols-1; ++i )
{
- long nActDist = (m_nColDist[i] + m_nColDist[i - 1]) / 2;
+ tools::Long nActDist = (m_nColDist[i] + m_nColDist[i - 1]) / 2;
m_xColMgr->SetColWidth( i, static_cast< sal_uInt16 >(m_nColWidth[i] + nActDist ));
}
m_xColMgr->SetColWidth( m_nCols-1, static_cast< sal_uInt16 >(m_nColWidth[m_nCols-1] + m_nColDist[m_nCols -2]/2) );
@@ -687,7 +687,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void )
m_xLineColorLbl->set_sensitive(bEnable);
sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::PERCENT);
- nLineWidth = static_cast<long>(vcl::ConvertDoubleValue(
+ nLineWidth = static_cast<tools::Long>(vcl::ConvertDoubleValue(
nLineWidth,
m_xLineWidthEdit->get_digits(),
m_xLineWidthEdit->get_unit(), MapUnit::MapTwip ));
@@ -722,7 +722,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void )
//set maximum values
m_xCLNrEdt->set_max(std::max(1L,
- std::min(long(nMaxCols), long( m_xColMgr->GetActualSize() / (nGutterWidth + MINLAY)) )));
+ std::min(tools::Long(nMaxCols), tools::Long( m_xColMgr->GetActualSize() / (nGutterWidth + MINLAY)) )));
//prompt example window
if(!m_bLockUpdate)
@@ -796,7 +796,7 @@ void SwColumnPage::Init()
// set maximum number of columns
// values below 1 are not allowed
m_xCLNrEdt->set_max(std::max(1L,
- std::min(long(nMaxCols), long( m_xColMgr->GetActualSize() / g_nMinWidth) )));
+ std::min(tools::Long(nMaxCols), tools::Long( m_xColMgr->GetActualSize() / g_nMinWidth) )));
}
bool SwColumnPage::isLineNotNone() const
@@ -921,7 +921,7 @@ void SwColumnPage::ColModify(const weld::SpinButton* pNF)
if (pNF)
m_aDefaultVS.SetNoSelection();
- long nDist = static_cast< long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
+ tools::Long nDist = static_cast< tools::Long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
for(sal_uInt16 i = 0; i < m_nCols; i++)
m_nColDist[i] = nDist;
@@ -944,10 +944,10 @@ IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void)
return;
SwPercentField *pField = m_aPercentFieldsMap[&rMetricField];
assert(pField);
- long nActValue = static_cast< long >(pField->DenormalizePercent(pField->get_value(FieldUnit::TWIP)));
+ tools::Long nActValue = static_cast< tools::Long >(pField->DenormalizePercent(pField->get_value(FieldUnit::TWIP)));
if (m_xAutoWidthBox->get_active())
{
- const long nMaxGap = static_cast< long >
+ const tools::Long nMaxGap = static_cast< tools::Long >
((m_xColMgr->GetActualSize() - m_nCols * MINLAY)/(m_nCols - 1));
if(nActValue > nMaxGap)
{
@@ -964,11 +964,11 @@ IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void)
else
{
const sal_uInt16 nVis = m_nFirstVis + ((pField == m_xDistEd2.get()) ? 1 : 0);
- long nDiff = nActValue - m_nColDist[nVis];
+ tools::Long nDiff = nActValue - m_nColDist[nVis];
if(nDiff)
{
- long nLeft = m_nColWidth[nVis];
- long nRight = m_nColWidth[nVis + 1];
+ tools::Long nLeft = m_nColWidth[nVis];
+ tools::Long nRight = m_nColWidth[nVis + 1];
if(nLeft + nRight + 2 * MINLAY < nDiff)
nDiff = nLeft + nRight - 2 * MINLAY;
if(nDiff < nRight - MINLAY)
@@ -977,7 +977,7 @@ IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void)
}
else
{
- long nTemp = nDiff - nRight + MINLAY;
+ tools::Long nTemp = nDiff - nRight + MINLAY;
nRight = MINLAY;
if(nLeft > nTemp - MINLAY)
{
@@ -1016,7 +1016,7 @@ IMPL_LINK(SwColumnPage, EdModify, weld::MetricSpinButton&, rEdit, void)
// no explicit values for the column width can be entered.
IMPL_LINK(SwColumnPage, AutoWidthHdl, weld::ToggleButton&, rBox, void)
{
- long nDist = static_cast< long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
+ tools::Long nDist = static_cast< tools::Long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
for(sal_uInt16 i = 0; i < m_nCols; i++)
m_nColDist[i] = nDist;
@@ -1066,15 +1066,15 @@ void SwColumnPage::Timeout()
else if (m_pModifiedField == m_xEd3.get())
nChanged += 2;
- long nNewWidth = static_cast< long >
+ tools::Long nNewWidth = static_cast< tools::Long >
(m_pModifiedField->DenormalizePercent(m_pModifiedField->get_value(FieldUnit::TWIP)));
- long nDiff = nNewWidth - m_nColWidth[nChanged];
+ tools::Long nDiff = nNewWidth - m_nColWidth[nChanged];
// when it's the last column
if(nChanged == m_nCols - 1)
{
m_nColWidth[0] -= nDiff;
- if(m_nColWidth[0] < static_cast<long>(g_nMinWidth))
+ if(m_nColWidth[0] < static_cast<tools::Long>(g_nMinWidth))
{
nNewWidth -= g_nMinWidth - m_nColWidth[0];
m_nColWidth[0] = g_nMinWidth;
@@ -1084,7 +1084,7 @@ void SwColumnPage::Timeout()
else if(nDiff)
{
m_nColWidth[nChanged + 1] -= nDiff;
- if(m_nColWidth[nChanged + 1] < static_cast<long>(g_nMinWidth))
+ if(m_nColWidth[nChanged + 1] < static_cast<tools::Long>(g_nMinWidth))
{
nNewWidth -= g_nMinWidth - m_nColWidth[nChanged + 1];
m_nColWidth[nChanged + 1] = g_nMinWidth;
@@ -1214,7 +1214,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet)
nTotalWish = FRAME_FORMAT_WIDTH;
else
{
- long const nDistance = rBox.GetSmallestDistance();
+ tools::Long const nDistance = rBox.GetSmallestDistance();
nTotalWish = (!bVertical ? rSize.GetWidth() : rSize.GetHeight()) - 2 * nDistance;
}
@@ -1280,7 +1280,7 @@ IMPL_LINK(SwColumnPage, SetDefaultsHdl, ValueSet *, pVS, void)
m_xDistEd1->set_value(50, FieldUnit::CM);
ColModify(nullptr);
// now set the width ratio to 2 : 1 or 1 : 2 respectively
- const long nSmall = static_cast< long >(m_xColMgr->GetActualSize() / 3);
+ const tools::Long nSmall = static_cast< tools::Long >(m_xColMgr->GetActualSize() / 3);
if(nItem == 4)
{
m_xEd2->set_value(m_xEd2->NormalizePercent(nSmall), FieldUnit::TWIP);
@@ -1318,8 +1318,8 @@ void ColumnValueSet::UserDraw(const UserDrawEvent& rUDEvt)
tools::Rectangle aRect = rUDEvt.GetRect();
const sal_uInt16 nItemId = rUDEvt.GetItemId();
- long nRectWidth = aRect.GetWidth();
- long nRectHeight = aRect.GetHeight();
+ tools::Long nRectWidth = aRect.GetWidth();
+ tools::Long nRectHeight = aRect.GetHeight();
Point aBLPos = aRect.TopLeft();
Color aFillColor(pDev->GetFillColor());
@@ -1327,11 +1327,11 @@ void ColumnValueSet::UserDraw(const UserDrawEvent& rUDEvt)
pDev->SetFillColor(rStyleSettings.GetFieldColor());
pDev->SetLineColor(rStyleSettings.GetFieldTextColor());
- long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11);
- long nTop = (nRectHeight - 11 * nStep ) / 2;
+ tools::Long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11);
+ tools::Long nTop = (nRectHeight - 11 * nStep ) / 2;
sal_uInt16 nCols = 0;
- long nStarts[3];
- long nEnds[3];
+ tools::Long nStarts[3];
+ tools::Long nEnds[3];
nStarts[0] = nRectWidth * 10 / 100;
switch( nItemId )
{
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 4ffdab33c776..341dc317f2a9 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1230,8 +1230,8 @@ void SwFramePage::InitPos(RndStdIds eId,
sal_Int16 nHRel,
sal_Int16 nV,
sal_Int16 nVRel,
- long nX,
- long nY)
+ tools::Long nX,
+ tools::Long nY)
{
auto nPos = m_xVerticalDLB->get_active();
if (nPos != -1 && m_pVMap)
@@ -1786,9 +1786,9 @@ void SwFramePage::RangeModifyHdl()
else
aVal.nVertOrient = text::VertOrientation::NONE;
- const long nAtHorzPosVal = static_cast< long >(
+ const tools::Long nAtHorzPosVal = static_cast< tools::Long >(
m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)) );
- const long nAtVertPosVal = static_cast< long >(
+ const tools::Long nAtVertPosVal = static_cast< tools::Long >(
m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)) );
aVal.nHPos = nAtHorzPosVal;
@@ -2604,16 +2604,16 @@ void BmpWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
if (!aGrfSize.Width() && !aGrfSize.Height())
aGrfSize = rRenderContext.PixelToLogic(aBmp.GetSizePixel());
- long nRelGrf = aGrfSize.Width() * 100 / aGrfSize.Height();
- long nRelWin = aPntSz.Width() * 100 / aPntSz.Height();
+ tools::Long nRelGrf = aGrfSize.Width() * 100 / aGrfSize.Height();
+ tools::Long nRelWin = aPntSz.Width() * 100 / aPntSz.Height();
if (nRelGrf < nRelWin)
{
- const long nWidth = aPntSz.Width();
+ const tools::Long nWidth = aPntSz.Width();
// if we use a replacement preview, try to draw at original size
if (!bGraphic && (aGrfSize.Width() <= aPntSz.Width())
&& (aGrfSize.Height() <= aPntSz.Height()))
{
- const long nHeight = aPntSz.Height();
+ const tools::Long nHeight = aPntSz.Height();
aPntSz.setWidth( aGrfSize.Width() );
aPntSz.setHeight( aGrfSize.Height() );
aPntPos.AdjustY((nHeight - aPntSz.Height()) / 2 );
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index 1353cbeae114..05d9ee2e0e84 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -265,8 +265,8 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
{
OUString sTokenType;
uno::Sequence< beans::PropertyValues> aSequPropVals(10);
- long nTokenIndex = 0;
- long nParamCount = 2;
+ tools::Long nTokenIndex = 0;
+ tools::Long nParamCount = 2;
// #i24377#
SwFormTokens aPattern = pForm->GetPattern(nCurrLevel);
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 0d7454f2410a..55235e71437d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -142,14 +142,14 @@ class SwEntryBrowseBox : public SwEntryBrowseBox_Base
::svt::CellControllerRef m_xController;
::svt::CellControllerRef m_xCheckController;
- long m_nCurrentRow;
+ tools::Long m_nCurrentRow;
bool m_bModified;
protected:
- virtual bool SeekRow( long nRow ) override;
+ virtual bool SeekRow( tools::Long nRow ) override;
virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId) const override;
- virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol) override;
- virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override;
+ virtual void InitController(::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol) override;
+ virtual ::svt::CellController* GetController(tools::Long nRow, sal_uInt16 nCol) override;
virtual bool SaveModified() override;
std::vector<long> GetOptimalColWidths() const;
@@ -163,7 +163,7 @@ public:
bool IsModified()const override;
- virtual OUString GetCellText( long nRow, sal_uInt16 nColumn ) const override;
+ virtual OUString GetCellText( tools::Long nRow, sal_uInt16 nColumn ) const override;
virtual void Resize() override;
virtual Size GetOptimalSize() const override;
};
@@ -820,7 +820,7 @@ bool SwTOXSelectTabPage::FillItemSet( SfxItemSet* )
return true;
}
-static long lcl_TOXTypesToUserData(CurTOXType eType)
+static tools::Long lcl_TOXTypesToUserData(CurTOXType eType)
{
sal_uInt16 nRet = TOX_INDEX;
switch(eType.eType)
@@ -3010,7 +3010,7 @@ void SwTokenWindow::AdjustPositions()
AdjustScrolling();
}
-void SwTokenWindow::MoveControls(long nOffset)
+void SwTokenWindow::MoveControls(tools::Long nOffset)
{
m_xScrollWin->hadjustment_set_value(nOffset);
}
@@ -3065,7 +3065,7 @@ IMPL_LINK(SwTokenWindow, ScrollBtnHdl, weld::Button&, rBtn, void)
const auto nWidth = m_xScrollWin->hadjustment_get_upper();
const auto nLeft = m_xScrollWin->hadjustment_get_value();
- long nMove = nLeft;
+ tools::Long nMove = nLeft;
if (&rBtn == m_xLeftScrollWin.get())
{
//find the first completely visible control (left edge visible)
@@ -3598,7 +3598,7 @@ SwEntryBrowseBox::SwEntryBrowseBox(const css::uno::Reference<css::awt::XWindow>
&sWordOnly
};
- long nWidth = GetSizePixel().Width();
+ tools::Long nWidth = GetSizePixel().Width();
nWidth /=7;
--nWidth;
for(sal_uInt16 i = 1; i < 8; i++)
@@ -3621,10 +3621,10 @@ void SwEntryBrowseBox::Resize()
{
SwEntryBrowseBox_Base::Resize();
- long nWidth = GetSizePixel().Width();
+ tools::Long nWidth = GetSizePixel().Width();
std::vector<long> aWidths = GetOptimalColWidths();
- long nNaturalWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
- long nExcess = ((nWidth - nNaturalWidth) / aWidths.size()) - 1;
+ tools::Long nNaturalWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
+ tools::Long nExcess = ((nWidth - nNaturalWidth) / aWidths.size()) - 1;
for (size_t i = 0; i < aWidths.size(); ++i)
SetColumnWidth(i+1, aWidths[i] + nExcess);
@@ -3634,13 +3634,13 @@ std::vector<long> SwEntryBrowseBox::GetOptimalColWidths() const
{
std::vector<long> aWidths;
- long nStandardColMinWidth = approximate_digit_width() * 15;
- long nYesNoWidth = approximate_digit_width() * 5;
+ tools::Long nStandardColMinWidth = approximate_digit_width() * 15;
+ tools::Long nYesNoWidth = approximate_digit_width() * 5;
nYesNoWidth = std::max(nYesNoWidth, GetTextWidth(m_sYes));
nYesNoWidth = std::max(nYesNoWidth, GetTextWidth(m_sNo));
for (sal_uInt16 i = 1; i < 6; i++)
{
- long nColWidth = std::max(nStandardColMinWidth,
+ tools::Long nColWidth = std::max(nStandardColMinWidth,
GetTextWidth(GetColumnTitle(i)));
nColWidth += 12;
aWidths.push_back(nColWidth);
@@ -3648,7 +3648,7 @@ std::vector<long> SwEntryBrowseBox::GetOptimalColWidths() const
for (sal_uInt16 i = 6; i < 8; i++)
{
- long nColWidth = std::max(nYesNoWidth,
+ tools::Long nColWidth = std::max(nYesNoWidth,
GetTextWidth(GetColumnTitle(i)));
nColWidth += 12;
aWidths.push_back(nColWidth);
@@ -3663,20 +3663,20 @@ Size SwEntryBrowseBox::GetOptimalSize() const
std::vector<long> aWidths = GetOptimalColWidths();
- long nWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
+ tools::Long nWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
aSize.setWidth( std::max(aSize.Width(), nWidth) );
return aSize;
}
-bool SwEntryBrowseBox::SeekRow( long nRow )
+bool SwEntryBrowseBox::SeekRow( tools::Long nRow )
{
m_nCurrentRow = nRow;
return true;
}
-OUString SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const
+OUString SwEntryBrowseBox::GetCellText(tools::Long nRow, sal_uInt16 nColumn) const
{
OUString pRet;
if (o3tl::make_unsigned(nRow) < m_Entries.size())
@@ -3703,7 +3703,7 @@ void SwEntryBrowseBox::PaintCell(OutputDevice& rDev,
rDev.DrawText( rRect, GetCellText( m_nCurrentRow, nColumnId ), nStyle );
}
-::svt::CellController* SwEntryBrowseBox::GetController(long /*nRow*/, sal_uInt16 nCol)
+::svt::CellController* SwEntryBrowseBox::GetController(tools::Long /*nRow*/, sal_uInt16 nCol)
{
return nCol < ITEM_CASE ? m_xController.get() : m_xCheckController.get();
}
@@ -3754,7 +3754,7 @@ bool SwEntryBrowseBox::SaveModified()
}
void SwEntryBrowseBox::InitController(
- ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol)
+ ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol)
{
const OUString rText = GetCellText( nRow, nCol );
if(nCol < ITEM_CASE)
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 1dce5e2bcf90..53d763a39e44 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -155,7 +155,7 @@ void SwNumPositionTabPage::InitControls()
const SwNumFormat* aNumFormatArr[MAXLEVEL];
sal_uInt16 nMask = 1;
sal_uInt16 nLvl = USHRT_MAX;
- long nFirstBorderTextRelative = -1;
+ tools::Long nFirstBorderTextRelative = -1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
aNumFormatArr[i] = &pActNum->Get(i);
@@ -173,7 +173,7 @@ void SwNumPositionTabPage::InitControls()
{
if(bRelative)
{
- const long nBorderTextRelative =
+ const tools::Long nBorderTextRelative =
aNumFormatArr[i]->GetAbsLSpace() + aNumFormatArr[i]->GetFirstLineOffset() -
aNumFormatArr[i - 1]->GetAbsLSpace() + aNumFormatArr[i - 1]->GetFirstLineOffset();
if (nFirstBorderTextRelative == -1)
@@ -215,16 +215,16 @@ void SwNumPositionTabPage::InitControls()
}
if(bSameDistBorderNum)
{
- long nDistBorderNum;
+ tools::Long nDistBorderNum;
if(bRelative)
{
- nDistBorderNum = static_cast<long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
+ nDistBorderNum = static_cast<tools::Long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
if(nLvl)
- nDistBorderNum -= static_cast<long>(aNumFormatArr[nLvl - 1]->GetAbsLSpace())+ aNumFormatArr[nLvl - 1]->GetFirstLineOffset();
+ nDistBorderNum -= static_cast<tools::Long>(aNumFormatArr[nLvl - 1]->GetAbsLSpace())+ aNumFormatArr[nLvl - 1]->GetFirstLineOffset();
}
else
{
- nDistBorderNum = static_cast<long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
+ nDistBorderNum = static_cast<tools::Long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
}
m_xDistBorderMF->set_value(m_xDistBorderMF->normalize(nDistBorderNum),FieldUnit::TWIP);
}
@@ -591,7 +591,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
{
if(bInInintControl)
return;
- long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
@@ -610,7 +610,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
}
else
{
- long nTmp = pActNum->Get( i - 1 ).GetAbsLSpace() +
+ tools::Long nTmp = pActNum->Get( i - 1 ).GetAbsLSpace() +
pActNum->Get( i - 1 ).GetFirstLineOffset() -
pActNum->Get( i ).GetFirstLineOffset();
@@ -629,7 +629,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
else if (&rField == m_xIndentMF.get())
{
// now AbsLSpace also has to be modified by FirstLineOffset
- long nDiff = nValue + aNumFormat.GetFirstLineOffset();
+ tools::Long nDiff = nValue + aNumFormat.GetFirstLineOffset();
auto const nAbsLSpace = aNumFormat.GetAbsLSpace();
aNumFormat.SetAbsLSpace( nAbsLSpace + nDiff );
aNumFormat.SetFirstLineOffset( -nValue );
@@ -650,7 +650,7 @@ IMPL_LINK( SwNumPositionTabPage, RelativeHdl, weld::ToggleButton&, rBox, void )
bool bOn = rBox.get_active();
bool bSingleSelection = m_xLevelLB->n_children() == 1 && USHRT_MAX != nActNumLvl;
bool bSetValue = false;
- long nValue = 0;
+ tools::Long nValue = 0;
if(bOn || bSingleSelection)
{
sal_uInt16 nMask = 1;
@@ -749,7 +749,7 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, LabelFollowedByHdl_Impl, weld::ComboBox&,
IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rField, void )
{
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ const tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -770,7 +770,7 @@ IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rF
IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rField, void )
{
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ const tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -779,7 +779,7 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFiel
if ( nActNumLvl & nMask )
{
SwNumFormat aNumFormat( pActNum->Get(i) );
- const long nFirstLineIndent = nValue - aNumFormat.GetIndentAt();
+ const tools::Long nFirstLineIndent = nValue - aNumFormat.GetIndentAt();
aNumFormat.SetFirstLineIndent( nFirstLineIndent );
pActNum->Set( i, aNumFormat );
}
@@ -792,7 +792,7 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFiel
IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, weld::MetricSpinButton&, rField, void )
{
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ const tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -801,10 +801,10 @@ IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, weld::MetricSpinButton&, rFie
if ( nActNumLvl & nMask )
{
SwNumFormat aNumFormat( pActNum->Get(i) );
- const long nAlignedAt = aNumFormat.GetIndentAt() +
+ const tools::Long nAlignedAt = aNumFormat.GetIndentAt() +
aNumFormat.GetFirstLineIndent();
aNumFormat.SetIndentAt( nValue );
- const long nNewFirstLineIndent = nAlignedAt - nValue;
+ const tools::Long nNewFirstLineIndent = nAlignedAt - nValue;
aNumFormat.SetFirstLineIndent( nNewFirstLineIndent );
pActNum->Set( i, aNumFormat );
}
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 099b901148cf..bef52a28777c 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -817,7 +817,7 @@ void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType
StartModified(*m_xStartEdit);
}
-static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, long nXStart, long nYStart, const Size& rSize)
+static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
{
vcl::Font aTmpFont(pVDev->GetFont());
@@ -842,19 +842,19 @@ static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat
pVDev->SetFont( aFont );
sal_UCS4 cBullet = rFormat.GetBulletChar();
OUString aText(&cBullet, 1);
- long nY = nYStart;
+ tools::Long nY = nYStart;
nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
pVDev->DrawText( Point(nXStart, nY), aText );
- long nRet = pVDev->GetTextWidth(aText);
+ tools::Long nRet = pVDev->GetTextWidth(aText);
pVDev->SetFont(aTmpFont);
return nRet;
}
-static long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat &rFormat, long nXStart, long nYStart, long nDivision)
+static tools::Long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
{
const SvxBrushItem* pBrushItem = rFormat.GetBrush();
- long nRet = 0;
+ tools::Long nRet = 0;
if (pBrushItem)
{
const Graphic* pGraphic = pBrushItem->GetGraphic();
@@ -885,7 +885,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
if (pActNum)
{
- long nWidthRelation = 30; // chapter dialog
+ tools::Long nWidthRelation = 30; // chapter dialog
if(nPageWidth)
{
nWidthRelation = nPageWidth / aSize.Width();
@@ -896,22 +896,22 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
}
// height per level
- const long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
- const long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
- long nYStart = 4;
+ const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
+ const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
+ tools::Long nYStart = 4;
aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
GetDefaultFontFlags::OnlyOne, &rRenderContext);
// #101524# OJ
aStdFont.SetColor(SwViewOption::GetFontColor());
- const long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
+ const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
aStdFont.SetFontSize(Size( 0, nFontHeight ));
- long nPreNum = pActNum->Get(0).GetStart();
+ tools::Long nPreNum = pActNum->Get(0).GetStart();
if (bPosition)
{
- const long nLineHeight = nFontHeight * 8 / 7;
+ const tools::Long nLineHeight = nFontHeight * 8 / 7;
sal_uInt8 nStart = 0;
while (!(nActLevel & (1 << nStart)))
{
@@ -927,15 +927,15 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
const SwNumFormat &rFormat = pActNum->Get(nLevel);
aNumVector.push_back(rFormat.GetStart());
- long nXStart( 0 );
- long nTextOffset( 0 );
- long nNumberXPos( 0 );
+ tools::Long nXStart( 0 );
+ tools::Long nTextOffset( 0 );
+ tools::Long nNumberXPos( 0 );
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
nNumberXPos = nXStart;
- const long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
+ const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
if(nFirstLineOffset <= nNumberXPos)
nNumberXPos -= nFirstLineOffset;
@@ -944,11 +944,11 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
}
else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT)
{
- const long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
+ const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
}
- long nBulletWidth = 0;
+ tools::Long nBulletWidth = 0;
if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
nBulletWidth = lcl_DrawGraphic(pVDev.get(), rFormat, nNumberXPos,
@@ -978,7 +978,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
nBulletWidth += pVDev->GetTextWidth(aText);
}
- long nTextXPos(0);
+ tools::Long nTextXPos(0);
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
nTextXPos = nXStart;
@@ -1024,24 +1024,24 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
else
{
SwNumberTree::tNumberVector aNumVector;
- const long nLineHeight = nFontHeight * 3 / 2;
+ const tools::Long nLineHeight = nFontHeight * 3 / 2;
for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
{
const SwNumFormat &rFormat = pActNum->Get(nLevel);
aNumVector.push_back(rFormat.GetStart());
- long nXStart(0);
+ tools::Long nXStart(0);
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
}
else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT)
{
- const long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
+ const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
}
nXStart /= 2;
nXStart += 2;
- long nTextOffset;
+ tools::Long nTextOffset;
if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
lcl_DrawGraphic(pVDev.get(), rFormat, nXStart, nYStart, nWidthRelation);
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index a90b15e2a26d..4415ae8ab7a2 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -116,7 +116,7 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p
::SetFieldUnit(*m_xDistEdit, aMetric);
::SetFieldUnit(*m_xLineDistEdit, aMetric);
MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
- long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134;
+ tools::Long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134;
m_xMaxHeightEdit->set_value(m_xMaxHeightEdit->normalize(nHeightValue),FieldUnit::TWIP);
}
@@ -201,7 +201,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
// width
Fraction aTmp( 100, 1 );
aTmp *= pFootnoteInfo->GetWidth();
- m_xLineLengthEdit->set_value(static_cast<long>(aTmp), FieldUnit::PERCENT);
+ m_xLineLengthEdit->set_value(static_cast<tools::Long>(aTmp), FieldUnit::PERCENT);
// gap footnote area
m_xDistEdit->set_value(m_xDistEdit->normalize(pFootnoteInfo->GetTopDist()), FieldUnit::TWIP);
@@ -236,7 +236,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
// Separator width
sal_Int64 nWidth = m_xLineWidthEdit->get_value(FieldUnit::NONE);
- nWidth = static_cast<long>(vcl::ConvertDoubleValue(
+ nWidth = static_cast<tools::Long>(vcl::ConvertDoubleValue(
nWidth,
m_xLineWidthEdit->get_digits(),
m_xLineWidthEdit->get_unit(), MapUnit::MapTwip ));
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index fcc9dc343d84..88d045d31a6d 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -246,8 +246,8 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
m_bHRulerChanged = true;
}
m_bVRulerChanged = true;
- pView->GetHRuler().SetCharWidth(static_cast<long>(m_xCharWidthMF->get_value(FieldUnit::TWIP)/56.7));
- pView->GetVRuler().SetLineHeight(static_cast<long>(m_xTextSizeMF->get_value(FieldUnit::TWIP)/56.7));
+ pView->GetHRuler().SetCharWidth(static_cast<tools::Long>(m_xCharWidthMF->get_value(FieldUnit::TWIP)/56.7));
+ pView->GetVRuler().SetLineHeight(static_cast<tools::Long>(m_xTextSizeMF->get_value(FieldUnit::TWIP)/56.7));
}
}
diff --git a/sw/source/ui/table/autoformatpreview.cxx b/sw/source/ui/table/autoformatpreview.cxx
index 5726b6e3784e..907e02f2fa63 100644
--- a/sw/source/ui/table/autoformatpreview.cxx
+++ b/sw/source/ui/table/autoformatpreview.cxx
@@ -239,7 +239,7 @@ void AutoFormatPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nC
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY()));
Point aPos = cellRect.TopLeft();
- long nRightX = 0;
+ tools::Long nRightX = 0;
Size theMaxStrSize(cellRect.GetWidth() - FRAME_OFFSET, cellRect.GetHeight() - FRAME_OFFSET);
if (maCurrentData.IsFont())
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 09be137b1838..24cb02c5f67c 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -665,8 +665,8 @@ DeactivateRC SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet )
}
if(nColSum != pTableData->GetWidth())
{
- SwTwips nMinWidth = std::min( long(MINLAY),
- static_cast<long>(pTableData->GetWidth() /
+ SwTwips nMinWidth = std::min( tools::Long(MINLAY),
+ static_cast<tools::Long>(pTableData->GetWidth() /
pTableData->GetColCount() - 1));
SwTwips nDiff = nColSum - pTableData->GetWidth();
while ( std::abs(nDiff) > pTableData->GetColCount() + 1 )
@@ -1043,7 +1043,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nCurrentPos )
//All columns will be changed proportionally with,
//the table width is adjusted accordingly.
OSL_ENSURE(nDiff * m_nNoOfVisibleCols <= m_pTableData->GetSpace() - m_nTableWidth, "wrong maximum" );
- long nAdd = nDiff;
+ tools::Long nAdd = nDiff;
if(nDiff * m_nNoOfVisibleCols > m_pTableData->GetSpace() - m_nTableWidth)
{
nAdd = (m_pTableData->GetSpace() - m_nTableWidth) / m_nNoOfVisibleCols;
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index 09cb387871c1..9e4adddfe4cb 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -28,6 +28,7 @@
#include <basic/sberrors.hxx>
#include <cppuhelper/implbase.hxx>
#include <sal/log.hxx>
+#include <tools/long.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -78,7 +79,7 @@ private:
public:
explicit SwVbaReadFieldParams( const OUString& rData );
- long SkipToNextToken();
+ tools::Long SkipToNextToken();
sal_Int32 FindNextStringPiece( sal_Int32 _nStart );
@@ -119,9 +120,9 @@ OUString SwVbaReadFieldParams::GetResult() const
}
// ret: -2: NOT a '\' parameter but normal Text
-long SwVbaReadFieldParams::SkipToNextToken()
+tools::Long SwVbaReadFieldParams::SkipToNextToken()
{
- long nRet = -1; // end
+ tools::Long nRet = -1; // end
if (
(-1 != nNext) && (nLen > nNext) &&
-1 != (nFnd = FindNextStringPiece(nNext))
@@ -351,7 +352,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const OUS
sal_Int16 nFileFormat = text::FilenameDisplayFormat::NAME_AND_EXT;
if( !_text.isEmpty() )
{
- long nRet;
+ tools::Long nRet;
SwVbaReadFieldParams aReadParam( _text );
while (-1 != (nRet = aReadParam.SkipToNextToken()))
{
@@ -422,7 +423,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const
{
OUString aDocProperty;
SwVbaReadFieldParams aReadParam( _text );
- long nRet;
+ tools::Long nRet;
while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
{
switch( nRet )
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index d580ada05714..e3627af148e0 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -267,7 +267,7 @@ void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32
aCols[ GetRightSeparator( aCols, nCol-1 ) ] -= nDiff;
}
else
- aCols.SetRight( std::min( static_cast<long>(nNewWidth), aCols.GetRightMax()) );
+ aCols.SetRight( std::min( static_cast<tools::Long>(nNewWidth), aCols.GetRightMax()) );
pTable->SetTabCols(aCols, aOldCols, pStart, bCurRowOnly );
}
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index 784720d8f353..a5ba5cb27c9c 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -330,7 +330,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
if ( aPaperSize.Width() > aPaperSize.Height() )
Swap( aPaperSize );
- long lLeft = rItem.m_nShiftRight,
+ tools::Long lLeft = rItem.m_nShiftRight,
lUpper = rItem.m_nShiftDown;
sal_uInt16 nPageW = static_cast<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)),
@@ -339,13 +339,13 @@ void SwModule::InsertEnv( SfxRequest& rReq )
switch (rItem.m_eAlign)
{
case ENV_HOR_LEFT: break;
- case ENV_HOR_CNTR: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)) / 2;
+ case ENV_HOR_CNTR: lLeft += std::max(0L, tools::Long(aPaperSize.Width() - nPageW)) / 2;
break;
- case ENV_HOR_RGHT: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW));
+ case ENV_HOR_RGHT: lLeft += std::max(0L, tools::Long(aPaperSize.Width() - nPageW));
break;
- case ENV_VER_LEFT: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH));
+ case ENV_VER_LEFT: lUpper += std::max(0L, tools::Long(aPaperSize.Width() - nPageH));
break;
- case ENV_VER_CNTR: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)) / 2;
+ case ENV_VER_CNTR: lUpper += std::max(0L, tools::Long(aPaperSize.Width() - nPageH)) / 2;
break;
case ENV_VER_RGHT: break;
}
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 77534197e1e6..fda48d4e007f 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -239,7 +239,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
aDesc.SetUseOn(UseOnPage::All); // Site numbering
// Set page size
- long lPgWidth, lPgHeight;
+ tools::Long lPgWidth, lPgHeight;
lPgWidth = std::max<sal_Int32>(rItem.m_lPWidth, MINLAY);
lPgHeight = std::max<sal_Int32>(rItem.m_lPHeight, MINLAY);
rFormat.SetFormatAttr( SwFormatFrameSize( SwFrameSize::Fixed, lPgWidth, lPgHeight ));
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index d918df4b3a37..64564cb39c9b 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -895,7 +895,7 @@ void SwDocShell::SetVisArea( const tools::Rectangle &rRect )
{
Size aSz( m_pView->GetDocSz() );
aSz.AdjustWidth(DOCUMENTBORDER ); aSz.AdjustHeight(DOCUMENTBORDER );
- long nMoveX = 0, nMoveY = 0;
+ tools::Long nMoveX = 0, nMoveY = 0;
if ( aRect.Right() > aSz.Width() )
nMoveX = aSz.Width() - aRect.Right();
if ( aRect.Bottom() > aSz.Height() )
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 479eed290aad..a2342c9f3d0e 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -609,7 +609,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
nFlags = aNewFileDlg.GetTemplateFlags();
rReq.AppendItem( SfxStringItem( SID_TEMPLATE_NAME, aFileName ) );
- rReq.AppendItem( SfxInt32Item( SID_TEMPLATE_LOAD, static_cast<long>(nFlags) ) );
+ rReq.AppendItem( SfxInt32Item( SID_TEMPLATE_LOAD, static_cast<tools::Long>(nFlags) ) );
}
if( !aFileName.isEmpty() )
diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx
index df4d9a908d63..dbb6da6e405e 100644
--- a/sw/source/uibase/app/mainwn.cxx
+++ b/sw/source/uibase/app/mainwn.cxx
@@ -29,7 +29,7 @@ namespace {
struct SwProgress
{
- long nStartValue,
+ tools::Long nStartValue,
nStartCount;
SwDocShell *pDocShell;
std::unique_ptr<SfxProgress> pProgress;
@@ -49,7 +49,7 @@ static SwProgress *lcl_SwFindProgress( SwDocShell const *pDocShell )
return nullptr;
}
-void StartProgress( const char* pMessResId, long nStartValue, long nEndValue,
+void StartProgress( const char* pMessResId, tools::Long nStartValue, tools::Long nEndValue,
SwDocShell *pDocShell )
{
if( SW_MOD()->IsEmbeddedLoadSave() )
@@ -79,7 +79,7 @@ void StartProgress( const char* pMessResId, long nStartValue, long nEndValue,
pProgress->nStartValue = nStartValue;
}
-void SetProgressState( long nPosition, SwDocShell const *pDocShell )
+void SetProgressState( tools::Long nPosition, SwDocShell const *pDocShell )
{
if( pProgressContainer && !SW_MOD()->IsEmbeddedLoadSave() )
{
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index e4f398a42ac4..2026942e90ad 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -335,7 +335,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<sdbc::XDat
}
}
-static bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
+static bool lcl_MoveAbsolute(SwDSParam* pParam, tools::Long nAbsPos)
{
bool bRet = false;
try
@@ -600,8 +600,8 @@ void SwDBManager::ImportDBEntry(SwWrtShell* pSh)
OUStringBuffer sStr;
uno::Sequence<OUString> aColNames = xCols->getElementNames();
const OUString* pColNames = aColNames.getConstArray();
- long nLength = aColNames.getLength();
- for(long i = 0; i < nLength; i++)
+ tools::Long nLength = aColNames.getLength();
+ for(tools::Long i = 0; i < nLength; i++)
{
uno::Any aCol = xCols->getByName(pColNames[i]);
uno::Reference< beans::XPropertySet > xColumnProp;
@@ -1259,7 +1259,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
static_cast<CreateMonitor*>(xProgressDlg.get())->SetTotalCount(nMaxDocs);
}
- long nStartRow, nEndRow;
+ tools::Long nStartRow, nEndRow;
bool bFreezedLayouts = false;
// to collect temporary email files
std::vector< OUString> aFilesToRemove;
diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx
index 45cc86b4f9b7..e53df293fda3 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -54,7 +54,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
SwRect aRect;
rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
- long nWidth = aRect.Width();
+ tools::Long nWidth = aRect.Width();
aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth));
// height=width for more consistent preview (analog to edit region)
@@ -90,7 +90,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
SwFormatCol aCol;
SwRect aRect;
rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
- long nWidth = aRect.Width();
+ tools::Long nWidth = aRect.Width();
sal_uInt16 nCol = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
if(nCol)
@@ -164,7 +164,7 @@ void SwWrtShell::StartInsertRegionDialog(const SwSectionData& rSectionData)
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>{});
SwRect aRect;
CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
- long nWidth = aRect.Width();
+ tools::Long nWidth = aRect.Width();
aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth));
// height=width for more consistent preview (analog to edit region)
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.cxx b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
index 74ed52b93441..69c8ce3ad758 100644
--- a/sw/source/uibase/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
@@ -25,6 +25,7 @@
#include <svx/sdrpaintwindow.hxx>
#include <svx/svdview.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <tools/long.hxx>
#include <sw_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/primitivetools2d.hxx>
@@ -178,7 +179,7 @@ ImplPrimitive2DIDBlock(AnchorPrimitive, PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE)
/*static*/ std::unique_ptr<AnchorOverlayObject> AnchorOverlayObject::CreateAnchorOverlayObject(
SwView const & rDocView,
const SwRect& aAnchorRect,
- long aPageBorder,
+ tools::Long aPageBorder,
const Point& aLineStart,
const Point& aLineEnd,
const Color& aColorAnchor )
diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.hxx b/sw/source/uibase/docvw/AnchorOverlayObject.hxx
index 180d017577a8..6618f9575bd2 100644
--- a/sw/source/uibase/docvw/AnchorOverlayObject.hxx
+++ b/sw/source/uibase/docvw/AnchorOverlayObject.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_SW_SOURCE_UIBASE_DOCVW_ANCHOROVERLAYOBJECT_HXX
#include <svx/sdr/overlay/overlayobject.hxx>
-
+#include <tools/long.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
class SwView;
@@ -42,7 +42,7 @@ class AnchorOverlayObject final : public sdr::overlay::OverlayObjectWithBasePosi
public:
static std::unique_ptr<AnchorOverlayObject> CreateAnchorOverlayObject( SwView const & rDocView,
const SwRect& aAnchorRect,
- long aPageBorder,
+ tools::Long aPageBorder,
const Point& aLineStart,
const Point& aLineEnd,
const Color& aColorAnchor );
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index 663141839d00..a38cba50aa04 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -194,14 +194,14 @@ void AnnotationMenuButton::Paint(vcl::RenderContext& rRenderContext, const tools
tools::Rectangle aSymbolRect(aRect);
// 25% distance to the left and right button border
- const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000;
+ const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000;
aSymbolRect.AdjustLeft(nBorderDistanceLeftAndRight );
aSymbolRect.AdjustRight( -nBorderDistanceLeftAndRight );
// 40% distance to the top button border
- const long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000;
+ const tools::Long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000;
aSymbolRect.AdjustTop(nBorderDistanceTop );
// 15% distance to the bottom button border
- const long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000;
+ const tools::Long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000;
aSymbolRect.AdjustBottom( -nBorderDistanceBottom );
DecorationView aDecoView(&rRenderContext);
aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, (bHighContrast ? COL_WHITE : COL_BLACK));
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index e252f0fed78c..4f4677971c01 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -408,8 +408,8 @@ void SwAnnotationWin::MouseButtonUp(const MouseEvent& rMouseEvent)
}
}
-void SwAnnotationWin::SetPosSizePixelRect(long nX, long nY, long nWidth, long nHeight,
- const SwRect& aAnchorRect, const long aPageBorder)
+void SwAnnotationWin::SetPosSizePixelRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
+ const SwRect& aAnchorRect, const tools::Long aPageBorder)
{
mPosSize = tools::Rectangle(Point(nX,nY),Size(nWidth,nHeight));
if (!mAnchorRect.IsEmpty() && mAnchorRect != aAnchorRect)
@@ -428,7 +428,7 @@ void SwAnnotationWin::SetVirtualPosSize( const Point& aPoint, const Size& aSize)
mPosSize = tools::Rectangle(aPoint,aSize);
}
-void SwAnnotationWin::TranslateTopPosition(const long aAmount)
+void SwAnnotationWin::TranslateTopPosition(const tools::Long aAmount)
{
mPosSize.Move(0,aAmount);
}
@@ -634,21 +634,21 @@ void SwAnnotationWin::Rescale()
if ( mpMetadataAuthor )
{
vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction);
+ sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataAuthor->SetControlFont( aFont );
}
if ( mpMetadataDate )
{
vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction);
+ sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataDate->SetControlFont( aFont );
}
if ( mpMetadataResolved )
{
vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetLabelFont() );
- sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction);
+ sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction);
aFont.SetFontHeight( nHeight );
mpMetadataResolved->SetControlFont( aFont );
}
@@ -890,8 +890,8 @@ void SwAnnotationWin::SetPosAndSize()
void SwAnnotationWin::DoResize()
{
- long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height();
- long aHeight = GetSizePixel().Height();
+ tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height();
+ tools::Long aHeight = GetSizePixel().Height();
unsigned long aWidth = GetSizePixel().Width();
aHeight -= GetMetaHeight();
@@ -959,10 +959,10 @@ void SwAnnotationWin::DoResize()
const Fraction& fy( GetMapMode().GetScaleY() );
const Point aPos( mpMetadataAuthor->GetPosPixel());
- mpMenuButton->setPosSizePixel( long(aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10)*fx),
- long(aPos.Y()+5*fy),
- long(METABUTTON_WIDTH*fx),
- long(METABUTTON_HEIGHT*fy) );
+ mpMenuButton->setPosSizePixel( tools::Long(aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10)*fx),
+ tools::Long(aPos.Y()+5*fy),
+ tools::Long(METABUTTON_WIDTH*fx),
+ tools::Long(METABUTTON_HEIGHT*fy) );
}
void SwAnnotationWin::SetSizePixel( const Size& rNewSize )
@@ -982,17 +982,17 @@ void SwAnnotationWin::SetScrollbar()
mpVScrollbar->SetThumbPos(mpOutlinerView->GetVisArea().Top());
}
-void SwAnnotationWin::ResizeIfNecessary(long aOldHeight, long aNewHeight)
+void SwAnnotationWin::ResizeIfNecessary(tools::Long aOldHeight, tools::Long aNewHeight)
{
if (aOldHeight != aNewHeight)
{
//check for lower border or next note
- long aBorder = mrMgr.GetNextBorder();
+ tools::Long aBorder = mrMgr.GetNextBorder();
if (aBorder != -1)
{
if (aNewHeight > GetMinimumSizeWithoutMeta())
{
- long aNewLowerValue = GetPosPixel().Y() + aNewHeight + GetMetaHeight();
+ tools::Long aNewLowerValue = GetPosPixel().Y() + aNewHeight + GetMetaHeight();
if (aNewLowerValue < aBorder)
SetSizePixel(Size(GetSizePixel().Width(),aNewHeight+GetMetaHeight()));
else
@@ -1329,7 +1329,7 @@ SwEditWin& SwAnnotationWin::EditWin()
return mrView.GetEditWin();
}
-long SwAnnotationWin::GetPostItTextHeight()
+tools::Long SwAnnotationWin::GetPostItTextHeight()
{
return mpOutliner ? LogicToPixel(mpOutliner->CalcTextSize()).Height() : 0;
}
@@ -1396,7 +1396,7 @@ void SwAnnotationWin::UnsetActiveSidebarWin()
IMPL_LINK(SwAnnotationWin, ScrollHdl, ScrollBar*, pScroll, void)
{
- long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos();
+ tools::Long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos();
GetOutlinerView()->Scroll( 0, nDiff );
}
@@ -1426,14 +1426,14 @@ sal_Int32 SwAnnotationWin::GetScrollbarWidth() const
sal_Int32 SwAnnotationWin::GetMetaButtonAreaWidth() const
{
const Fraction& f( GetMapMode().GetScaleX() );
- return long(METABUTTON_AREA_WIDTH * f);
+ return tools::Long(METABUTTON_AREA_WIDTH * f);
}
sal_Int32 SwAnnotationWin::GetMetaHeight() const
{
const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
const int fields = GetNumFields();
- return long(fields*POSTIT_META_FIELD_HEIGHT*f);
+ return tools::Long(fields*POSTIT_META_FIELD_HEIGHT*f);
}
sal_Int32 SwAnnotationWin::GetNumFields() const
@@ -1449,7 +1449,7 @@ sal_Int32 SwAnnotationWin::GetMinimumSizeWithMeta() const
sal_Int32 SwAnnotationWin::GetMinimumSizeWithoutMeta() const
{
const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
- return long(POSTIT_MINIMUMSIZE_WITHOUT_META * f);
+ return tools::Long(POSTIT_MINIMUMSIZE_WITHOUT_META * f);
}
void SwAnnotationWin::SetSpellChecking()
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 45dfb48da60b..f9a63c449a08 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -213,7 +213,7 @@ void SwHeaderFooterWin::dispose()
SwFrameMenuButtonBase::dispose();
}
-void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEnd)
+void SwHeaderFooterWin::SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd)
{
// Compute the text to show
const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc();
@@ -243,7 +243,7 @@ void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEn
Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
aFontMetric.GetLineHeight() + TEXT_PADDING * 2 );
- long nYFooterOff = 0;
+ tools::Long nYFooterOff = 0;
if (!m_bIsHeader)
nYFooterOff = aBoxSize.Height();
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 9360ea3b7ea1..8172713fc47e 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -348,7 +348,7 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt)
::tools::Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrame->GetBoundRect(GetEditWin()).SVRect() );
::tools::Rectangle aFrameRect = GetEditWin()->LogicToPixel( pPageFrame->getFrameArea().SVRect() );
- long nYLineOffset = ( aBoundRect.Top() + aFrameRect.Top() ) / 2;
+ tools::Long nYLineOffset = ( aBoundRect.Top() + aFrameRect.Top() ) / 2;
if ( pPrevPage )
{
::tools::Rectangle aPrevFrameRect = GetEditWin()->LogicToPixel( pPrevPage->getFrameArea().SVRect() );
@@ -356,8 +356,8 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt)
}
// Get the page + sidebar coords
- long nPgLeft = aFrameRect.Left();
- long nPgRight = aFrameRect.Right();
+ tools::Long nPgLeft = aFrameRect.Left();
+ tools::Long nPgRight = aFrameRect.Right();
unsigned long nSidebarWidth = 0;
const SwPostItMgr* pPostItMngr = GetEditWin()->GetView().GetWrtShell().GetPostItMgr();
@@ -374,9 +374,9 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt)
// Place the button on the left or right?
::tools::Rectangle aVisArea = GetEditWin()->LogicToPixel( GetEditWin()->GetView().GetVisArea() );
- long nLineLeft = std::max( nPgLeft, aVisArea.Left() );
- long nLineRight = std::min( nPgRight, aVisArea.Right() );
- long nBtnLeft = nLineLeft;
+ tools::Long nLineLeft = std::max( nPgLeft, aVisArea.Left() );
+ tools::Long nLineRight = std::min( nPgRight, aVisArea.Right() );
+ tools::Long nBtnLeft = nLineLeft;
if ( m_xMousePt )
{
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 607d94c3e33f..4041609b56d6 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -618,7 +618,7 @@ bool SwPostItMgr::CalcRects()
if (!bChange && mpWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE))
{
- long nLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout() );
+ tools::Long nLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout() );
if( nLayoutHeight > mbLayoutHeight )
{
if (mPages[0]->bScrollbar || HasScrollbars())
@@ -653,13 +653,13 @@ bool SwPostItMgr::HasScrollbars() const
void SwPostItMgr::PreparePageContainer()
{
// we do not just delete the SwPostItPageItem, so offset/scrollbar is not lost
- long lPageSize = mpWrtShell->GetNumPages();
- long lContainerSize = mPages.size();
+ tools::Long lPageSize = mpWrtShell->GetNumPages();
+ tools::Long lContainerSize = mPages.size();
if (lContainerSize < lPageSize)
{
mPages.reserve(lPageSize);
- for (long i=0; i<lPageSize - lContainerSize;i++)
+ for (tools::Long i=0; i<lPageSize - lContainerSize;i++)
mPages.emplace_back( new SwPostItPageItem());
}
else if (lContainerSize > lPageSize)
@@ -700,8 +700,8 @@ void SwPostItMgr::LayoutPostIts()
{
std::vector<SwAnnotationWin*> aVisiblePostItList;
unsigned long lNeededHeight = 0;
- long mlPageBorder = 0;
- long mlPageEnd = 0;
+ tools::Long mlPageBorder = 0;
+ tools::Long mlPageEnd = 0;
for (auto const& pItem : pPage->mvSidebarItems)
{
@@ -730,8 +730,8 @@ void SwPostItMgr::LayoutPostIts()
if (pItem->mbShow)
{
- long Y = mpEditWin->LogicToPixel( Point(0,pItem->maLayoutInfo.mPosition.Bottom())).Y();
- long aPostItHeight = 0;
+ tools::Long Y = mpEditWin->LogicToPixel( Point(0,pItem->maLayoutInfo.mPosition.Bottom())).Y();
+ tools::Long aPostItHeight = 0;
if (!pPostIt)
{
pPostIt = pItem->GetSidebarWindow( mpView->GetEditWin(),
@@ -796,13 +796,13 @@ void SwPostItMgr::LayoutPostIts()
else if (sal_Int32 nScrollSize = GetScrollSize())
{
//when we changed our zoom level, the offset value can be too big, so lets check for the largest possible zoom value
- long aAvailableHeight = mpEditWin->LogicToPixel(Size(0,pPage->mPageRect.Height())).Height() - 2 * GetSidebarScrollerHeight();
- long lOffset = -1 * nScrollSize * (aVisiblePostItList.size() - aAvailableHeight / nScrollSize);
+ tools::Long aAvailableHeight = mpEditWin->LogicToPixel(Size(0,pPage->mPageRect.Height())).Height() - 2 * GetSidebarScrollerHeight();
+ tools::Long lOffset = -1 * nScrollSize * (aVisiblePostItList.size() - aAvailableHeight / nScrollSize);
if (pPage->lOffset < lOffset)
pPage->lOffset = lOffset;
}
bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate;
- const long aSidebarheight = pPage->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
+ const tools::Long aSidebarheight = pPage->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
/*
TODO
- enlarge all notes till GetNextBorder(), as we resized to average value before
@@ -946,8 +946,8 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
OSL_ENSURE ((*aItem)->mpPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
if ((*aItem)->mpPostIt)
{
- const long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
- const long aEndValue = mpEditWin->PixelToLogic(Point(0,(*aItem)->mpPostIt->GetPosPixel().Y()+(*aItem)->mpPostIt->GetSizePixel().Height())).Y();
+ const tools::Long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
+ const tools::Long aEndValue = mpEditWin->PixelToLogic(Point(0,(*aItem)->mpPostIt->GetPosPixel().Y()+(*aItem)->mpPostIt->GetSizePixel().Height())).Y();
return aEndValue <= mPages[aPage-1]->mPageRect.Bottom()-aSidebarheight;
}
else
@@ -995,7 +995,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext)
}
}
-void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
+void SwPostItMgr::Scroll(const tools::Long lScroll,const unsigned long aPage)
{
OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
// do not scroll more than necessary up or down
@@ -1004,7 +1004,7 @@ void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
const bool bOldUp = ArrowEnabled(KEY_PAGEUP,aPage);
const bool bOldDown = ArrowEnabled(KEY_PAGEDOWN,aPage);
- const long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height();
+ const tools::Long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height();
for (auto const& item : mPages[aPage-1]->mvSidebarItems)
{
SwAnnotationWin* pPostIt = item->mpPostIt;
@@ -1053,25 +1053,25 @@ void SwPostItMgr::AutoScroll(const SwAnnotationWin* pPostIt,const unsigned long
if (!mPages[aPage-1]->bScrollbar)
return;
- const long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height();
+ const tools::Long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height();
const bool bBottom = mpEditWin->PixelToLogic(Point(0,pPostIt->GetPosPixel().Y()+pPostIt->GetSizePixel().Height())).Y() <= (mPages[aPage-1]->mPageRect.Bottom()-aSidebarheight);
const bool bTop = mpEditWin->PixelToLogic(Point(0,pPostIt->GetPosPixel().Y())).Y() >= (mPages[aPage-1]->mPageRect.Top()+aSidebarheight);
if ( !(bBottom && bTop))
{
- const long aDiff = bBottom ? mpEditWin->LogicToPixel(Point(0,mPages[aPage-1]->mPageRect.Top() + aSidebarheight)).Y() - pPostIt->GetPosPixel().Y() :
+ const tools::Long aDiff = bBottom ? mpEditWin->LogicToPixel(Point(0,mPages[aPage-1]->mPageRect.Top() + aSidebarheight)).Y() - pPostIt->GetPosPixel().Y() :
mpEditWin->LogicToPixel(Point(0,mPages[aPage-1]->mPageRect.Bottom() - aSidebarheight)).Y() - (pPostIt->GetPosPixel().Y()+pPostIt->GetSizePixel().Height());
// this just adds the missing value to get the next a* GetScrollSize() after aDiff
// e.g aDiff= 61 POSTIT_SCROLL=50 --> lScroll = 100
const auto nScrollSize = GetScrollSize();
assert(nScrollSize);
- const long lScroll = bBottom ? (aDiff + ( nScrollSize - (aDiff % nScrollSize))) : (aDiff - (nScrollSize + (aDiff % nScrollSize)));
+ const tools::Long lScroll = bBottom ? (aDiff + ( nScrollSize - (aDiff % nScrollSize))) : (aDiff - (nScrollSize + (aDiff % nScrollSize)));
Scroll(lScroll, aPage);
}
}
void SwPostItMgr::MakeVisible(const SwAnnotationWin* pPostIt )
{
- long aPage = -1;
+ tools::Long aPage = -1;
// we don't know the page yet, lets find it ourselves
std::vector<SwPostItPageItem*>::size_type n=0;
for (auto const& page : mPages)
@@ -1124,7 +1124,7 @@ Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,unsigned long aPage) cons
}
}
-bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList, const tools::Rectangle& rBorder, long lNeededHeight)
+bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList, const tools::Rectangle& rBorder, tools::Long lNeededHeight)
{
/*** General layout idea:***/
// - if we have space left, we always move the current one up,
@@ -1134,18 +1134,18 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList
//rBorder is the page rect
const tools::Rectangle aBorder = mpEditWin->LogicToPixel(rBorder);
- long lTopBorder = aBorder.Top() + 5;
- long lBottomBorder = aBorder.Bottom() - 5;
- const long lVisibleHeight = lBottomBorder - lTopBorder; //aBorder.GetHeight() ;
+ tools::Long lTopBorder = aBorder.Top() + 5;
+ tools::Long lBottomBorder = aBorder.Bottom() - 5;
+ const tools::Long lVisibleHeight = lBottomBorder - lTopBorder; //aBorder.GetHeight() ;
const size_t nPostItListSize = aVisiblePostItList.size();
- long lTranslatePos = 0;
+ tools::Long lTranslatePos = 0;
bool bScrollbars = false;
// do all necessary resizings
if (nPostItListSize > 0 && lVisibleHeight < lNeededHeight)
{
// ok, now we have to really resize and adding scrollbars
- const long lAverageHeight = (lVisibleHeight - nPostItListSize*GetSpaceBetween()) / nPostItListSize;
+ const tools::Long lAverageHeight = (lVisibleHeight - nPostItListSize*GetSpaceBetween()) / nPostItListSize;
if (lAverageHeight<GetMinimumSizeWithMeta())
{
bScrollbars = true;
@@ -1174,7 +1174,7 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList
{
loop++;
bDone = true;
- long lSpaceUsed = lTopBorder + GetSpaceBetween();
+ tools::Long lSpaceUsed = lTopBorder + GetSpaceBetween();
for(auto i = aVisiblePostItList.begin(); i != aVisiblePostItList.end() ; ++i)
{
auto aNextPostIt = i;
@@ -1202,7 +1202,7 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList
}
else
{
- long lMoveUp = (*i)->VirtualPos().Y() - lTopBorder;
+ tools::Long lMoveUp = (*i)->VirtualPos().Y() - lTopBorder;
(*i)->TranslateTopPosition(-1* lMoveUp);
if ((*aNextPostIt)->IsFollow())
(*aNextPostIt)->TranslateTopPosition( (lTranslatePos+ANCHORLINE_WIDTH) - lMoveUp);
@@ -1224,7 +1224,7 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList
// the first one could overlap the topborder instead of a second note
if (i==aVisiblePostItList.begin())
{
- long lMoveDown = lTopBorder - (*i)->VirtualPos().Y();
+ tools::Long lMoveDown = lTopBorder - (*i)->VirtualPos().Y();
if (lMoveDown>0)
{
bDone = false;
@@ -1824,7 +1824,7 @@ SwAnnotationWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection,
return nullptr;
}
-long SwPostItMgr::GetNextBorder()
+tools::Long SwPostItMgr::GetNextBorder()
{
for (auto const& pPage : mPages)
{
@@ -2025,7 +2025,7 @@ bool SwPostItMgr::ScrollbarHit(const unsigned long aPage,const Point &aPoint)
if (aRectBottom.IsInside(aPoint))
{
- if (aPoint.X() < long((aPointBottom.X() + GetSidebarWidth()/3)))
+ if (aPoint.X() < tools::Long((aPointBottom.X() + GetSidebarWidth()/3)))
Scroll( GetScrollSize(),aPage);
else
Scroll( -1*GetScrollSize(), aPage);
@@ -2033,7 +2033,7 @@ bool SwPostItMgr::ScrollbarHit(const unsigned long aPage,const Point &aPoint)
}
else if (aRectTop.IsInside(aPoint))
{
- if (aPoint.X() < long((aPointTop.X() + GetSidebarWidth()/3*2)))
+ if (aPoint.X() < tools::Long((aPointTop.X() + GetSidebarWidth()/3*2)))
Scroll(GetScrollSize(), aPage);
else
Scroll(-1*GetScrollSize(), aPage);
@@ -2062,17 +2062,17 @@ void SwPostItMgr::CorrectPositions()
// yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it
// check, if anchor overlay object exists.
- const long aAnchorX = pFirstPostIt->Anchor()
- ? mpEditWin->LogicToPixel( Point(static_cast<long>(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X()
+ const tools::Long aAnchorX = pFirstPostIt->Anchor()
+ ? mpEditWin->LogicToPixel( Point(static_cast<tools::Long>(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X()
: 0;
- const long aAnchorY = pFirstPostIt->Anchor()
- ? mpEditWin->LogicToPixel( Point(0,static_cast<long>(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1
+ const tools::Long aAnchorY = pFirstPostIt->Anchor()
+ ? mpEditWin->LogicToPixel( Point(0,static_cast<tools::Long>(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1
: 0;
if (Point(aAnchorX,aAnchorY) == pFirstPostIt->GetPosPixel())
return;
- long aAnchorPosX = 0;
- long aAnchorPosY = 0;
+ tools::Long aAnchorPosX = 0;
+ tools::Long aAnchorPosY = 0;
for (const std::unique_ptr<SwPostItPageItem>& pPage : mPages)
{
for (auto const& item : pPage->mvSidebarItems)
@@ -2081,9 +2081,9 @@ void SwPostItMgr::CorrectPositions()
if ( item->mbShow && item->mpPostIt && item->mpPostIt->Anchor() )
{
aAnchorPosX = pPage->eSidebarPosition == sw::sidebarwindows::SidebarPosition::LEFT
- ? mpEditWin->LogicToPixel( Point(static_cast<long>(item->mpPostIt->Anchor()->GetSeventhPosition().getX()),0)).X()
- : mpEditWin->LogicToPixel( Point(static_cast<long>(item->mpPostIt->Anchor()->GetSixthPosition().getX()),0)).X();
- aAnchorPosY = mpEditWin->LogicToPixel( Point(0,static_cast<long>(item->mpPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1;
+ ? mpEditWin->LogicToPixel( Point(static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSeventhPosition().getX()),0)).X()
+ : mpEditWin->LogicToPixel( Point(static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSixthPosition().getX()),0)).X();
+ aAnchorPosY = mpEditWin->LogicToPixel( Point(0,static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1;
item->mpPostIt->SetPosPixel(Point(aAnchorPosX,aAnchorPosY));
}
}
@@ -2120,7 +2120,7 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const
if (bEnableMapMode)
// The output device is the window.
mpWrtShell->GetOut()->EnableMapMode();
- long nRet = mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width();
+ tools::Long nRet = mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width();
if (bEnableMapMode)
mpWrtShell->GetOut()->EnableMapMode(false);
return nRet;
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index b1f4f8879f23..c33e07e999e1 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -253,7 +253,7 @@ void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt )
if (comphelper::LibreOfficeKit::isActive())
SetMapMode(oldMapMode);
- long aOldHeight = mrSidebarWin.GetPostItTextHeight();
+ tools::Long aOldHeight = mrSidebarWin.GetPostItTextHeight();
bool bDone = false;
/// HACK: need to switch off processing of Undo/Redo in Outliner
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 08bc94f91ca1..f28599ccf030 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -170,8 +170,8 @@ static SdrHdlKind g_eSdrMoveHdl = SdrHdlKind::User;
QuickHelpData* SwEditWin::m_pQuickHlpData = nullptr;
-long SwEditWin::m_nDDStartPosY = 0;
-long SwEditWin::m_nDDStartPosX = 0;
+tools::Long SwEditWin::m_nDDStartPosY = 0;
+tools::Long SwEditWin::m_nDDStartPosX = 0;
static SfxShell* lcl_GetTextShellFromDispatcher( SwView const & rView );
@@ -681,11 +681,11 @@ void SwEditWin::JustifyAreaTimer()
{
const tools::Rectangle &rVisArea = GetView().GetVisArea();
#ifdef UNX
- const long coMinLen = 100;
+ const tools::Long coMinLen = 100;
#else
const long coMinLen = 50;
#endif
- long const nTimeout = 800,
+ tools::Long const nTimeout = 800,
nDiff = std::max(
std::max( m_aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - m_aMovePos.Y() ),
std::max( m_aMovePos.X() - rVisArea.Right(), rVisArea.Left() - m_aMovePos.X()));
@@ -760,7 +760,7 @@ bool SwEditWin::IsInputSequenceCheckingRequired( const OUString &rText, const Sw
SwBreakIt *pBreakIter = SwBreakIt::Get();
uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->GetBreakIter();
assert(xBI.is());
- long nCTLScriptPos = -1;
+ tools::Long nCTLScriptPos = -1;
if (xBI->getScriptType( rText, 0 ) == i18n::ScriptType::COMPLEX)
nCTLScriptPos = 0;
@@ -1076,10 +1076,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
pToCharContentPos, bFollowTextFlow,
false, &aRefPoint );
}
- long nLeft = std::min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() );
- long nRight = std::min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() );
- long nUp = std::min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() );
- long nDown = std::min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() );
+ tools::Long nLeft = std::min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() );
+ tools::Long nRight = std::min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() );
+ tools::Long nUp = std::min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() );
+ tools::Long nDown = std::min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() );
switch ( nDir )
{
@@ -1116,7 +1116,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
bool bSet = false;
if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
{
- long aDiff = aTmp.Top() - aRefPoint.Y();
+ tools::Long aDiff = aTmp.Top() - aRefPoint.Y();
if( aDiff > 0 )
aDiff = 0;
else if ( aDiff < -aTmp.Height() )
@@ -1205,8 +1205,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
SwWrtShell &rSh = m_rView.GetWrtShell();
rSh.StartUndo();
- long nX = 0;
- long nY = 0;
+ tools::Long nX = 0;
+ tools::Long nY = 0;
const bool bOnePixel(
MOVE_LEFT_SMALL == nDir ||
MOVE_UP_SMALL == nDir ||
@@ -5790,7 +5790,7 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
{
aEEPos -= rOutputArea.TopRight();
//invert the horizontal direction and exchange X and Y
- long nTemp = -aEEPos.X();
+ tools::Long nTemp = -aEEPos.X();
aEEPos.setX( aEEPos.Y() );
aEEPos.setY( nTemp );
}
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index 064ddee8de01..5ee7e763fcb9 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -86,8 +86,8 @@ static OUString lcl_GetRedlineHelp( const SwRangeRedline& rRedl, bool bBalloon )
OUString SwEditWin::ClipLongToolTip(const OUString& rText)
{
OUString sDisplayText(rText);
- long nTextWidth = GetTextWidth(sDisplayText);
- long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3;
+ tools::Long nTextWidth = GetTextWidth(sDisplayText);
+ tools::Long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3;
nMaxWidth = PixelToLogic(Size(nMaxWidth, 0)).Width();
if (nTextWidth > nMaxWidth)
sDisplayText = GetEllipsisString(sDisplayText, nMaxWidth, DrawTextFlags::CenterEllipsis);
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index d103de0b74f4..33f7a33435d1 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -323,10 +323,10 @@ void SwSrcEditWindow::Resize()
if ( !m_pTextView )
return;
- long nVisY = m_pTextView->GetStartDocPos().Y();
+ tools::Long nVisY = m_pTextView->GetStartDocPos().Y();
m_pTextView->ShowCursor();
Size aOutSz( GetOutputSizePixel() );
- long nMaxVisAreaStart = m_pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height();
+ tools::Long nMaxVisAreaStart = m_pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height();
if ( nMaxVisAreaStart < 0 )
nMaxVisAreaStart = 0;
if ( m_pTextView->GetStartDocPos().Y() > nMaxVisAreaStart )
@@ -336,7 +336,7 @@ void SwSrcEditWindow::Resize()
m_pTextView->SetStartDocPos( aStartDocPos );
m_pTextView->ShowCursor();
}
- long nScrollStd = GetSettings().GetStyleSettings().GetScrollBarSize();
+ tools::Long nScrollStd = GetSettings().GetStyleSettings().GetScrollBarSize();
Size aScrollSz(aOutSz.Width() - nScrollStd, nScrollStd );
Point aScrollPos(0, aOutSz.Height() - nScrollStd);
@@ -570,14 +570,14 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll, void)
{
if(pScroll == m_pVScrollbar)
{
- long nDiff = m_pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos();
+ tools::Long nDiff = m_pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos();
GetTextView()->Scroll( 0, nDiff );
m_pTextView->ShowCursor( false );
pScroll->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
}
else
{
- long nDiff = m_pTextView->GetStartDocPos().X() - pScroll->GetThumbPos();
+ tools::Long nDiff = m_pTextView->GetStartDocPos().X() - pScroll->GetThumbPos();
GetTextView()->Scroll( nDiff, 0 );
m_pTextView->ShowCursor( false );
pScroll->SetThumbPos( m_pTextView->GetStartDocPos().X() );
@@ -633,7 +633,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer*, pIdle, void )
pIdle->Start();
// SyntaxTimerHdl is called when text changed
// => good opportunity to determine text width!
- long nPrevTextWidth = m_nCurTextWidth;
+ tools::Long nPrevTextWidth = m_nCurTextWidth;
m_nCurTextWidth = m_pTextEngine->CalcTextWidth() + 25; // small tolerance
if ( m_nCurTextWidth != nPrevTextWidth )
SetScrollBarRanges();
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 583f5baad33b..479311332f75 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -196,8 +196,8 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr
if (!nColumnCount)
return;
- long nL = GetLeft();
- long nR = GetRight();
+ tools::Long nL = GetLeft();
+ tools::Long nR = GetRight();
if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
{
@@ -269,7 +269,7 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr
if (pColMgr->GetLineHeightPercent() != 100)
{
- long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X();
+ tools::Long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X();
nLength -= nLength * pColMgr->GetLineHeightPercent() / 100;
switch (pColMgr->GetAdjust())
{
@@ -369,7 +369,7 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools:
rRenderContext.SetFillColor(aGrayColor);
//column separator?
- long nLength = aLogSize.Height() - 2 * aTL.Y();
+ tools::Long nLength = aLogSize.Height() - 2 * aTL.Y();
Point aUp(aTL);
Point aDown(aTL.X(), nLength);
bool bLines = false;
@@ -402,7 +402,7 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools:
rRenderContext.DrawRect(aRect);
rRenderContext.SetFillColor(rFieldColor);
tools::Rectangle aFrameRect(aTL, m_aFrameSize);
- long nSum = aTL.X();
+ tools::Long nSum = aTL.X();
for (sal_uInt16 i = 0; i < nColCount; i++)
{
const SwColumn* pCol = &rCols[i];
@@ -430,22 +430,22 @@ void SwColumnOnlyExample::SetColumns(const SwFormatCol& rCol)
{
m_aCols = rCol;
sal_uInt16 nWishSum = m_aCols.GetWishWidth();
- long nFrameWidth = m_aFrameSize.Width();
+ tools::Long nFrameWidth = m_aFrameSize.Width();
SwColumns& rCols = m_aCols.GetColumns();
sal_uInt16 nColCount = rCols.size();
for(sal_uInt16 i = 0; i < nColCount; i++)
{
SwColumn* pCol = &rCols[i];
- long nWish = pCol->GetWishWidth();
+ tools::Long nWish = pCol->GetWishWidth();
nWish *= nFrameWidth;
nWish /= nWishSum;
pCol->SetWishWidth(static_cast<sal_uInt16>(nWish));
- long nLeft = pCol->GetLeft();
+ tools::Long nLeft = pCol->GetLeft();
nLeft *= nFrameWidth;
nLeft /= nWishSum;
pCol->SetLeft(static_cast<sal_uInt16>(nLeft));
- long nRight = pCol->GetRight();
+ tools::Long nRight = pCol->GetRight();
nRight *= nFrameWidth;
nRight /= nWishSum;
pCol->SetRight(static_cast<sal_uInt16>(nRight));
@@ -511,8 +511,8 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point
aLineColor.Invert();
}
rRenderContext.SetLineColor(aLineColor);
- long nL = GetLeft();
- long nR = GetRight();
+ tools::Long nL = GetLeft();
+ tools::Long nR = GetRight();
if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
{
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx
index 146ab05384c8..35abd6baa560 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -279,7 +279,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
if ( m_bIsInVertical || m_bIsInVerticalL2R )
{
Point aPos(aBoundRect.Pos());
- long nTmp = aPos.X();
+ tools::Long nTmp = aPos.X();
aPos.setX( aPos.Y() );
aPos.setY( nTmp );
Size aSize(aBoundRect.SSize());
@@ -477,7 +477,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
if ( m_bIsInVertical || m_bIsInVerticalL2R )
{
//restore width/height exchange
- long nTmp = rVal.nWidth;
+ tools::Long nTmp = rVal.nWidth;
rVal.nWidth = rVal.nHeight;
rVal.nHeight = nTmp;
}
@@ -523,7 +523,7 @@ void SwFlyFrameAttrMgr::DelAttr( sal_uInt16 nId )
m_aSet.ClearItem( nId );
}
-void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight )
+void SwFlyFrameAttrMgr::SetLRSpace( tools::Long nLeft, tools::Long nRight )
{
OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" );
@@ -535,7 +535,7 @@ void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight )
m_aSet.Put( aTmp );
}
-void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom )
+void SwFlyFrameAttrMgr::SetULSpace( tools::Long nTop, tools::Long nBottom )
{
OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" );
@@ -600,7 +600,7 @@ void SwFlyFrameAttrMgr::SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size
void SwFlyFrameAttrMgr::SetSize( const Size& rSize )
{
SwFormatFrameSize aSize( GetFrameSize() );
- aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY))));
+ aSize.SetSize(Size(std::max(rSize.Width(), tools::Long(MINFLY)), std::max(rSize.Height(), tools::Long(MINFLY))));
m_aSet.Put( aSize );
}
diff --git a/sw/source/uibase/inc/HeaderFooterWin.hxx b/sw/source/uibase/inc/HeaderFooterWin.hxx
index dc1cee8cc0ae..b874e870e702 100644
--- a/sw/source/uibase/inc/HeaderFooterWin.hxx
+++ b/sw/source/uibase/inc/HeaderFooterWin.hxx
@@ -48,7 +48,7 @@ public:
virtual ~SwHeaderFooterWin( ) override;
virtual void dispose() override;
- void SetOffset( Point aOffset, long nXLineStart, long nXLineEnd );
+ void SetOffset( Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd );
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
diff --git a/sw/source/uibase/inc/autoformatpreview.hxx b/sw/source/uibase/inc/autoformatpreview.hxx
index a5f41e4d9248..8617e35e02f8 100644
--- a/sw/source/uibase/inc/autoformatpreview.hxx
+++ b/sw/source/uibase/inc/autoformatpreview.hxx
@@ -46,10 +46,10 @@ private:
bool mbFitWidth;
bool mbRTL;
Size maPreviousSize;
- long mnLabelColumnWidth;
- long mnDataColumnWidth1;
- long mnDataColumnWidth2;
- long mnRowHeight;
+ tools::Long mnLabelColumnWidth;
+ tools::Long mnDataColumnWidth1;
+ tools::Long mnDataColumnWidth2;
+ tools::Long mnRowHeight;
const OUString maStringJan;
const OUString maStringFeb;
const OUString maStringMar;
diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx
index 1b799c1c2c90..fd3e391e639d 100644
--- a/sw/source/uibase/inc/column.hxx
+++ b/sw/source/uibase/inc/column.hxx
@@ -43,9 +43,9 @@ class SwColumnDlg : public SfxDialogController
std::unique_ptr<SfxItemSet> m_pSelectionSet;
SfxItemSet* m_pFrameSet;
- long m_nOldSelection;
- long m_nSelectionWidth;
- long m_nPageWidth;
+ tools::Long m_nOldSelection;
+ tools::Long m_nSelectionWidth;
+ tools::Long m_nPageWidth;
bool m_bPageChanged : 1;
bool m_bSectionChanged : 1;
@@ -88,8 +88,8 @@ class SwColumnPage : public SfxTabPage
sal_uInt16 m_nFirstVis;
sal_uInt16 m_nCols;
- long m_nColWidth[nMaxCols];
- long m_nColDist[nMaxCols];
+ tools::Long m_nColWidth[nMaxCols];
+ tools::Long m_nColDist[nMaxCols];
SwPercentField* m_pModifiedField;
std::map<weld::MetricSpinButton*, SwPercentField*> m_aPercentFieldsMap;
@@ -178,7 +178,7 @@ public:
virtual void Reset(const SfxItemSet *rSet) override;
void SetFrameMode(bool bMod);
- void SetPageWidth(long nPageWidth);
+ void SetPageWidth(tools::Long nPageWidth);
void SetFormatUsed(bool bFormatUsed)
{
diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index 414db7068dcb..05a02a095b90 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -44,7 +44,7 @@ class SwOutlineContent : public SwContent
SwOutlineNodes::size_type nArrPos,
sal_uInt8 nLevel,
bool bMove,
- long nYPos) :
+ tools::Long nYPos) :
SwContent(pCnt, rName, nYPos),
nOutlinePos(nArrPos), nOutlineLevel(nLevel), bIsMoveable(bMove) {}
@@ -62,7 +62,7 @@ class SwRegionContent : public SwContent
SwRegionContent( const SwContentType* pCnt,
const OUString& rName,
sal_uInt8 nLevel,
- long nYPos) :
+ tools::Long nYPos) :
SwContent(pCnt, rName, nYPos),
nRegionLevel(nLevel){}
sal_uInt8 GetRegionLevel() const {return nRegionLevel;}
@@ -78,7 +78,7 @@ public:
const OUString& rName,
const OUString& rURL,
const SwTextINetFormat* pAttr,
- long nYPos )
+ tools::Long nYPos )
: SwContent( pCnt, rName, nYPos ), sURL( rURL ), pINetAttr( pAttr )
{}
@@ -94,7 +94,7 @@ public:
SwPostItContent( const SwContentType* pCnt,
const OUString& rName,
const SwFormatField* pFormatField,
- long nYPos )
+ tools::Long nYPos )
: SwContent(pCnt, rName, nYPos)
, pField(pFormatField)
{}
@@ -107,7 +107,7 @@ class SwGraphicContent : public SwContent
{
OUString sLink;
public:
- SwGraphicContent(const SwContentType* pCnt, const OUString& rName, const OUString& rLink, long nYPos)
+ SwGraphicContent(const SwContentType* pCnt, const OUString& rName, const OUString& rLink, tools::Long nYPos)
: SwContent( pCnt, rName, nYPos ), sLink( rLink )
{}
virtual ~SwGraphicContent() override;
@@ -119,7 +119,7 @@ class SwTOXBaseContent : public SwContent
{
const SwTOXBase* pBase;
public:
- SwTOXBaseContent(const SwContentType* pCnt, const OUString& rName, long nYPos, const SwTOXBase& rBase)
+ SwTOXBaseContent(const SwContentType* pCnt, const OUString& rName, tools::Long nYPos, const SwTOXBase& rBase)
: SwContent( pCnt, rName, nYPos ), pBase(&rBase)
{}
virtual ~SwTOXBaseContent() override;
diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx
index 2ff081427d31..39479738cde8 100644
--- a/sw/source/uibase/inc/drpcps.hxx
+++ b/sw/source/uibase/inc/drpcps.hxx
@@ -44,9 +44,9 @@ class SwDropCapsPict : public weld::CustomWidgetController
Color maBackColor;
Color maTextLineColor;
sal_uInt8 mnLines;
- long mnTotLineH;
- long mnLineH;
- long mnTextH;
+ tools::Long mnTotLineH;
+ tools::Long mnLineH;
+ tools::Long mnTextH;
sal_uInt16 mnDistance;
VclPtr<Printer> mpPrinter;
bool mbDelPrinter;
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index 9406b75803fd..ec8994cf791e 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -60,8 +60,8 @@ class SW_DLLPUBLIC SwEditWin final : public vcl::Window,
{
static QuickHelpData* m_pQuickHlpData;
- static long m_nDDStartPosX;
- static long m_nDDStartPosY;
+ static tools::Long m_nDDStartPosX;
+ static tools::Long m_nDDStartPosY;
Color m_aWaterCanTextColor; // text color; for the watering can
Color m_aWaterCanTextBackColor; // text background; for the watering can
@@ -245,8 +245,8 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
- static long GetDDStartPosX() { return m_nDDStartPosX; }
- static long GetDDStartPosY() { return m_nDDStartPosY; }
+ static tools::Long GetDDStartPosX() { return m_nDDStartPosX; }
+ static tools::Long GetDDStartPosY() { return m_nDDStartPosY; }
static void InitStaticData();
static void FinitStaticData();
diff --git a/sw/source/uibase/inc/frmmgr.hxx b/sw/source/uibase/inc/frmmgr.hxx
index 8cd1ee303a06..fc038f96d77d 100644
--- a/sw/source/uibase/inc/frmmgr.hxx
+++ b/sw/source/uibase/inc/frmmgr.hxx
@@ -96,10 +96,10 @@ public:
void SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size& rUnrotatedSize);
// space to content
- void SetLRSpace( long nLeft,
- long nRight );
- void SetULSpace( long nTop,
- long nBottom );
+ void SetLRSpace( tools::Long nLeft,
+ tools::Long nRight );
+ void SetULSpace( tools::Long nTop,
+ tools::Long nBottom );
void SetCol( const SwFormatCol &rCol);
@@ -131,8 +131,8 @@ public:
inline const SvxBoxItem &GetBox() const;
inline const SwFormatFrameSize &GetFrameSize() const;
- long CalcWidthBorder() { return CalcLeftSpace()+CalcRightSpace(); }
- long CalcHeightBorder() { return CalcTopSpace()+CalcBottomSpace(); }
+ tools::Long CalcWidthBorder() { return CalcLeftSpace()+CalcRightSpace(); }
+ tools::Long CalcHeightBorder() { return CalcTopSpace()+CalcBottomSpace(); }
};
inline const Size& SwFlyFrameAttrMgr::GetSize() const
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 6aba31a44348..077e088b0bc2 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -133,7 +133,7 @@ class SwFramePage: public SfxTabPage
DECL_LINK(RelHdl, weld::ComboBox&, void);
void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel,
sal_Int16 nV, sal_Int16 nVRel,
- long nX, long nY);
+ tools::Long nX, tools::Long nY);
DECL_LINK(RealSizeHdl, weld::Button&, void);
DECL_LINK(RelSizeClickHdl, weld::ToggleButton&, void);
diff --git a/sw/source/uibase/inc/labrec.hxx b/sw/source/uibase/inc/labrec.hxx
index 1810ff476dba..3a32734e4a5e 100644
--- a/sw/source/uibase/inc/labrec.hxx
+++ b/sw/source/uibase/inc/labrec.hxx
@@ -37,14 +37,14 @@ public:
OUString m_aMake;
OUString m_aType;
- long m_nHDist;
- long m_nVDist;
- long m_nWidth;
- long m_nHeight;
- long m_nLeft;
- long m_nUpper;
- long m_nPWidth;
- long m_nPHeight;
+ tools::Long m_nHDist;
+ tools::Long m_nVDist;
+ tools::Long m_nWidth;
+ tools::Long m_nHeight;
+ tools::Long m_nLeft;
+ tools::Long m_nUpper;
+ tools::Long m_nPWidth;
+ tools::Long m_nPHeight;
sal_Int32 m_nCols;
sal_Int32 m_nRows;
bool m_bCont;
diff --git a/sw/source/uibase/inc/mmconfigitem.hxx b/sw/source/uibase/inc/mmconfigitem.hxx
index bae35cfdcb14..62e30dd67ba7 100644
--- a/sw/source/uibase/inc/mmconfigitem.hxx
+++ b/sw/source/uibase/inc/mmconfigitem.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/view/XSelectionChangeListener.hpp>
+#include <tools/long.hxx>
#include <memory>
#include <set>
#include <vector>
@@ -46,7 +47,7 @@ namespace sw::mark { class IMark; }
struct SwDocMergeInfo
{
sw::mark::IMark* startPageInTarget;
- long nDBRow;
+ tools::Long nDBRow;
};
class SW_DLLPUBLIC SwMailMergeConfigItem
diff --git a/sw/source/uibase/inc/navicont.hxx b/sw/source/uibase/inc/navicont.hxx
index b6842ad91b6a..b5e02ce75f77 100644
--- a/sw/source/uibase/inc/navicont.hxx
+++ b/sw/source/uibase/inc/navicont.hxx
@@ -35,7 +35,7 @@ class NaviContentBookmark
{
OUString aUrl; // URL including jump mark
OUString aDescr; // description
- long nDocSh; // address of DocShell
+ tools::Long nDocSh; // address of DocShell
RegionMode nDefDrag; // description contains defaultDragType
public:
diff --git a/sw/source/uibase/inc/numprevw.hxx b/sw/source/uibase/inc/numprevw.hxx
index a5510a6d454f..af86246d6a46 100644
--- a/sw/source/uibase/inc/numprevw.hxx
+++ b/sw/source/uibase/inc/numprevw.hxx
@@ -29,7 +29,7 @@ class NumberingPreview : public weld::CustomWidgetController
{
const SwNumRule* pActNum;
vcl::Font aStdFont;
- long nPageWidth;
+ tools::Long nPageWidth;
const OUString* pOutlineNames;
bool bPosition;
sal_uInt16 nActLevel;
@@ -53,7 +53,7 @@ public:
Invalidate();
}
- void SetPageWidth(long nPgWidth)
+ void SetPageWidth(tools::Long nPgWidth)
{nPageWidth = nPgWidth;}
void SetOutlineNames(const OUString* pNames)
{pOutlineNames = pNames;}
diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx
index c174aee48b01..36f2bdfb4ea0 100644
--- a/sw/source/uibase/inc/pgfnote.hxx
+++ b/sw/source/uibase/inc/pgfnote.hxx
@@ -40,7 +40,7 @@ public:
private:
- long lMaxHeight;
+ tools::Long lMaxHeight;
std::unique_ptr<weld::RadioButton> m_xMaxHeightPageBtn;
std::unique_ptr<weld::RadioButton> m_xMaxHeightBtn;
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index 38f743f9c71c..6a2c898069f0 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -141,7 +141,7 @@ public:
return maPaintedPreviewDocRect;
}
- void Scroll(long nXMove, long nYMove, ScrollFlags nFlags = ScrollFlags::NONE) override;
+ void Scroll(tools::Long nXMove, tools::Long nYMove, ScrollFlags nFlags = ScrollFlags::NONE) override;
/** Method to enable/disable book preview
@param _bBookPreview
diff --git a/sw/source/uibase/inc/shdwcrsr.hxx b/sw/source/uibase/inc/shdwcrsr.hxx
index 2bd51c69ced3..9c516f47405e 100644
--- a/sw/source/uibase/inc/shdwcrsr.hxx
+++ b/sw/source/uibase/inc/shdwcrsr.hxx
@@ -30,18 +30,18 @@ class SwShadowCursor
VclPtr<vcl::Window> pWin;
Color aCol;
Point aOldPt;
- long nOldHeight;
+ tools::Long nOldHeight;
sal_uInt16 nOldMode;
- void DrawTri( const Point& rPt, long nHeight, bool bLeft );
- void DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMode );
+ void DrawTri( const Point& rPt, tools::Long nHeight, bool bLeft );
+ void DrawCursor( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode );
public:
SwShadowCursor( vcl::Window& rWin, const Color& rCol )
: pWin( &rWin ), aCol( rCol ), nOldHeight(0), nOldMode( USHRT_MAX ) {}
~SwShadowCursor();
- void SetPos( const Point& rPt, long nHeight, sal_uInt16 nMode );
+ void SetPos( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode );
void Paint();
diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx
index e48226f351b6..2cdefb908f41 100644
--- a/sw/source/uibase/inc/srcedtw.hxx
+++ b/sw/source/uibase/inc/srcedtw.hxx
@@ -75,7 +75,7 @@ private:
css::uno::Reference< css::beans::XMultiPropertySet >
m_xNotifier;
- long m_nCurTextWidth;
+ tools::Long m_nCurTextWidth;
sal_uInt16 m_nStartLine;
rtl_TextEncoding m_eSourceEncoding;
bool m_bReadonly;
diff --git a/sw/source/uibase/inc/swcont.hxx b/sw/source/uibase/inc/swcont.hxx
index 76efc6d88df2..3d9aa56e53c9 100644
--- a/sw/source/uibase/inc/swcont.hxx
+++ b/sw/source/uibase/inc/swcont.hxx
@@ -71,13 +71,13 @@ class SwContent : public SwTypeNumber
{
const SwContentType* pParent;
OUString sContentName;
- long nYPosition;
+ tools::Long nYPosition;
// some subclasses appear to use this for a tools/gen.hxx-style
// geometric Y position, while e.g. SwOutlineContent wants to store
// the index in its subtree
bool bInvisible;
public:
- SwContent(const SwContentType* pCnt, const OUString& rName, long nYPos );
+ SwContent(const SwContentType* pCnt, const OUString& rName, tools::Long nYPos );
virtual bool IsProtect() const;
const SwContentType* GetParent() const {return pParent;}
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index 5274a5f99558..117da38f3f03 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -263,7 +263,7 @@ class SwTokenWindow
SwTOXWidget* InsertItem(const OUString& rText, const SwFormToken& aToken);
void AdjustPositions();
void AdjustScrolling();
- void MoveControls(long nOffset);
+ void MoveControls(tools::Long nOffset);
public:
SwTokenWindow(std::unique_ptr<weld::Container> xParent);
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 1b70623ccb33..e0d8c517cda6 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -114,16 +114,16 @@ public:
using SwEditShell::Insert;
- long CallSetCursor(const Point* pPt, bool bProp) { return (this->*m_fnSetCursor)(pPt, bProp); }
+ tools::Long CallSetCursor(const Point* pPt, bool bProp) { return (this->*m_fnSetCursor)(pPt, bProp); }
void Drag (const Point* pPt, bool bProp) { (this->*m_fnDrag)(pPt, bProp); }
void EndDrag (const Point* pPt, bool bProp) { (this->*m_fnEndDrag)(pPt, bProp); }
- long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); }
+ tools::Long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); }
bool IsSplitVerticalByDefault() const;
void SetSplitVerticalByDefault(bool value);
// reset all selections
- long ResetSelect( const Point *, bool );
+ tools::Long ResetSelect( const Point *, bool );
// resets the cursorstack after movement with PageUp/-Down if a stack is built up
inline void ResetCursorStack();
@@ -338,7 +338,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
sal_uInt16 nSlotId = 0); // SlotId for dialog
bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrameFormat **pFlyFrameFormat = nullptr );
- void LaunchOLEObj( long nVerb = 0 ); // start server
+ void LaunchOLEObj( tools::Long nVerb = 0 ); // start server
virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ) override;
virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
const SwRect *pFlyPrtRect = nullptr,
@@ -585,9 +585,9 @@ private:
SAL_DLLPRIVATE void ResetCursorStack_();
using SwCursorShell::SetCursor;
- SAL_DLLPRIVATE long SetCursor(const Point *, bool bProp=false );
+ SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false );
- SAL_DLLPRIVATE long SetCursorKillSel(const Point *, bool bProp );
+ SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp );
SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp );
SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp );
@@ -603,7 +603,7 @@ private:
SAL_DLLPRIVATE void SttLeaveSelect();
SAL_DLLPRIVATE void AddLeaveSelect();
- SAL_DLLPRIVATE long Ignore(const Point *, bool bProp );
+ SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp );
SAL_DLLPRIVATE void LeaveExtSel() { m_bSelWrd = m_bSelLn = false;}
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx
index 2d23fa468056..23974dfa109a 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -238,7 +238,7 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText,
// offset to calculate the position in the text taking into
// account that text may have been replaced with new text of
// different length. Negative values allowed!
- long nCorrectionOffset = 0;
+ tools::Long nCorrectionOffset = 0;
OSL_ENSURE(nIndices == 0 || nIndices == nConvTextLen,
"mismatch between string length and sequence length!" );
diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index fb117e8e3b95..841578834e96 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -41,8 +41,8 @@ namespace
* \param Color arrow color
* \param bCollapsed if the arrow should display the collapsed state
*/
-void ImplDrawArrow(vcl::RenderContext& rRenderContext, long nX, long nY, long nSize,
- const Color& rColor, bool bCollapsed)
+void ImplDrawArrow(vcl::RenderContext& rRenderContext, tools::Long nX, tools::Long nY,
+ tools::Long nSize, const Color& rColor, bool bCollapsed)
{
tools::Polygon aTrianglePolygon(4);
@@ -152,8 +152,8 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext)
// calculate label and arrow positions
const OUString aLabel = SwResId(STR_COMMENTS_LABEL);
- const long nTriangleSize = maVirDev->GetTextHeight() / 2 + 1;
- const long nTrianglePad = maVirDev->GetTextHeight() / 4;
+ const tools::Long nTriangleSize = maVirDev->GetTextHeight() / 2 + 1;
+ const tools::Long nTrianglePad = maVirDev->GetTextHeight() / 4;
Point aLabelPos(0, (aControlRect.GetHeight() - maVirDev->GetTextHeight()) / 2);
Point aArrowPos(0, (aControlRect.GetHeight() - nTriangleSize) / 2);
@@ -165,7 +165,7 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext)
}
else // RTL => | Comments < |
{
- const long nLabelWidth = maVirDev->GetTextWidth(aLabel);
+ const tools::Long nLabelWidth = maVirDev->GetTextWidth(aLabel);
if (!bIsCollapsed)
{
aArrowPos.setX(aControlRect.GetWidth() - 1 - nTrianglePad - CONTROL_BORDER_WIDTH
@@ -322,17 +322,17 @@ tools::Rectangle SwCommentRuler::GetCommentControlRegion()
const unsigned long nSidebarWidth = pPostItMgr->GetSidebarWidth(true);
//FIXME When the page width is larger then screen, the ruler is misplaced by one pixel
- long nLeft = GetPageOffset();
+ tools::Long nLeft = GetPageOffset();
if (GetTextRTL())
nLeft += GetBorderOffset() - nSidebarWidth;
else
nLeft += GetWinOffset() + mpSwWin->LogicToPixel(Size(GetPageWidth(), 0)).Width();
// Ruler::ImplDraw uses RULER_OFF (value: 3px) as offset, and Ruler::ImplFormat adds one extra pixel
- long nTop = 4;
+ tools::Long nTop = 4;
// Somehow pPostItMgr->GetSidebarBorderWidth() returns border width already doubled
- long nRight = nLeft + nSidebarWidth + pPostItMgr->GetSidebarBorderWidth(true);
- long nBottom = nTop + GetRulerVirHeight() - 3;
+ tools::Long nRight = nLeft + nSidebarWidth + pPostItMgr->GetSidebarBorderWidth(true);
+ tools::Long nBottom = nTop + GetRulerVirHeight() - 3;
tools::Rectangle aRect(nLeft, nTop, nRight, nBottom);
return aRect;
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index b84681e353f9..c5dfa9dc1366 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -110,7 +110,7 @@ SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispat
Size aSizeTbx = CalcWindowSizePixel();
Size aEditSize = mxEdit->GetSizePixel();
tools::Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) );
- long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight());
+ tools::Long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight());
if( nMaxHeight+2 > aSizeTbx.Height() )
aSizeTbx.setHeight( nMaxHeight+2 );
Size aSize = GetSizePixel();
@@ -174,11 +174,11 @@ void SwInputWindow::Resize()
{
ToolBox::Resize();
- long nWidth = GetSizePixel().Width();
- long nLeft = mxEdit->GetPosPixel().X();
+ tools::Long nWidth = GetSizePixel().Width();
+ tools::Long nLeft = mxEdit->GetPosPixel().X();
Size aEditSize = mxEdit->GetSizePixel();
- aEditSize.setWidth( std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ) );
+ aEditSize.setWidth( std::max( static_cast<tools::Long>(nWidth - nLeft - 5), tools::Long(0) ) );
mxEdit->SetSizePixel( aEditSize );
}
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index f45a9a8233ea..f4f7fc9488d1 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -868,7 +868,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest const &rReq)
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
- long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight();
+ tools::Long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight();
sal_uInt16 nSlot = rReq.GetSlot();
switch (nSlot)
{
@@ -1496,7 +1496,7 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
SwWrtShell &rSh = rView.GetWrtShell();
SwUndoId nUndoId(SwUndoId::EMPTY);
- long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin()
+ tools::Long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin()
? rView.GetPostItMgr()->GetActiveSidebarWin()->GetPostItTextHeight()
: 0;
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index fea15d78428a..65f95858a480 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -912,7 +912,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation,
if(bIsInVertical)
{
Point aPos(aBoundRect.Pos());
- long nTmp = aPos.X();
+ tools::Long nTmp = aPos.X();
aPos.setX( aPos.Y() );
aPos.setY( nTmp );
Size aSize(aBoundRect.SSize());
@@ -1054,7 +1054,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation,
if(bIsInVertical)
{
//restore width/height exchange
- long nTmp = rValidation.nWidth;
+ tools::Long nTmp = rValidation.nWidth;
rValidation.nWidth = rValidation.nHeight;
rValidation.nHeight = nTmp;
}
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 23fd983166e3..594a018828da 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -871,12 +871,12 @@ void SwTableShell::Execute(SfxRequest &rReq)
::GetTableSel( rSh, aBoxes );
if ( !aBoxes.empty() )
{
- long maxX = 0;
- long maxY = 0;
- long minX = std::numeric_limits<long>::max();
- long minY = std::numeric_limits<long>::max();
- long nbBoxes = aBoxes.size();
- for ( long i = 0; i < nbBoxes; i++ )
+ tools::Long maxX = 0;
+ tools::Long maxY = 0;
+ tools::Long minX = std::numeric_limits<long>::max();
+ tools::Long minY = std::numeric_limits<long>::max();
+ tools::Long nbBoxes = aBoxes.size();
+ for ( tools::Long i = 0; i < nbBoxes; i++ )
{
Point aCoord ( aBoxes[i]->GetCoordinates() );
if ( aCoord.X() < minX ) minX = aCoord.X();
@@ -965,7 +965,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
}
case FN_TABLE_SPLIT_CELLS:
{
- long nCount=0;
+ tools::Long nCount=0;
bool bHorizontal=true;
bool bProportional = false;
const SfxInt32Item* pSplit = rReq.GetArg<SfxInt32Item>(FN_TABLE_SPLIT_CELLS);
@@ -982,7 +982,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
else
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- const long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY;
+ const tools::Long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY;
ScopedVclPtr<SvxAbstractSplitTableDialog> pDlg(pFact->CreateSvxSplitTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert));
if(rSh.IsSplitVerticalByDefault())
pDlg->SetSplitVerticalByDefault();
@@ -1117,7 +1117,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
const SfxUInt32Item* pItem2 = rReq.GetArg<SfxUInt32Item>(SID_ATTR_TABLE_ROW_HEIGHT);
if (pItem2)
{
- long nNewHeight = pItem2->GetValue();
+ tools::Long nNewHeight = pItem2->GetValue();
std::unique_ptr<SwFormatFrameSize> pHeight = rSh.GetRowHeight();
if ( pHeight )
{
@@ -1134,7 +1134,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
const SfxUInt32Item* pItem2 = rReq.GetArg<SfxUInt32Item>(SID_ATTR_TABLE_COLUMN_WIDTH);
if (pItem2)
{
- long nNewWidth = pItem2->GetValue();
+ tools::Long nNewWidth = pItem2->GetValue();
SwTableFUNC aFunc( &rSh );
aFunc.InitTabCols();
aFunc.SetColWidth(aFunc.GetCurColNum(), nNewWidth);
@@ -1422,7 +1422,7 @@ void SwTableShell::GetState(SfxItemSet &rSet)
std::unique_ptr<SwFormatFrameSize> pHeight = rSh.GetRowHeight();
if (pHeight)
{
- long nHeight = pHeight->GetHeight();
+ tools::Long nHeight = pHeight->GetHeight();
aRowHeight.SetValue(nHeight);
rSet.Put(aRowHeight);
diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx
index 8247dbdbfbb9..b577547347e6 100644
--- a/sw/source/uibase/shells/textidx.cxx
+++ b/sw/source/uibase/shells/textidx.cxx
@@ -105,7 +105,7 @@ void SwTextShell::ExecIdx(SfxRequest const &rReq)
SwRect aRect;
rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
- long nWidth = aRect.Width();
+ tools::Long nWidth = aRect.Width();
aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth));
// Height = width for a more consistent preview (analogous to edit range)
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 14844e1134c1..17550dc717f3 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -365,12 +365,12 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
case SID_UNICODE_NOTATION_TOGGLE:
{
- long nMaxUnits = 256;
+ tools::Long nMaxUnits = 256;
sal_Int32 nSelLength = rWrtSh.GetSelText().getLength();
if( rWrtSh.IsSelection() && !rWrtSh.IsMultiSelection() && (nSelLength < nMaxUnits) )
nMaxUnits = nSelLength;
- long index = 0;
+ tools::Long index = 0;
ToggleUnicodeCodepoint aToggle;
while( nMaxUnits-- && aToggle.AllowMoreInput(rWrtSh.GetChar(true, index-1)) )
--index;
@@ -1029,7 +1029,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
// Left border as offset
//#i24363# tab stops relative to indent
- const long nOff = rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ?
+ const tools::Long nOff = rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ?
aCoreSet.Get( RES_LR_SPACE ).GetTextLeft() : 0;
SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
aCoreSet.Put( aOff );
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 7a13c6553fde..45019db48e9d 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -347,14 +347,14 @@ FieldUnit PageFormatPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolIte
return eUnit;
}
-void PageFormatPanel::ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin )
+void PageFormatPanel::ExecuteMarginLRChange( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin )
{
mpPageLRMarginItem->SetLeft( nPageLeftMargin );
mpPageLRMarginItem->SetRight( nPageRightMargin );
mpBindings->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE, SfxCallMode::RECORD, { mpPageLRMarginItem.get() });
}
-void PageFormatPanel::ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin)
+void PageFormatPanel::ExecuteMarginULChange(const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin)
{
mpPageULMarginItem->SetUpper( nPageTopMargin );
mpPageULMarginItem->SetLower( nPageBottomMargin );
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.hxx b/sw/source/uibase/sidebar/PageFormatPanel.hxx
index 4ea09bb503a1..7c2a505618c8 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.hxx
@@ -89,17 +89,17 @@ private:
FieldUnit meFUnit;
MapUnit meUnit;
- long mnPageLeftMargin;
- long mnPageRightMargin;
- long mnPageTopMargin;
- long mnPageBottomMargin;
+ tools::Long mnPageLeftMargin;
+ tools::Long mnPageRightMargin;
+ tools::Long mnPageTopMargin;
+ tools::Long mnPageBottomMargin;
OUString aCustomEntry;
void Initialize();
void SetMarginFieldUnit();
void UpdateMarginBox();
- void ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin );
- void ExecuteMarginULChange( const long nPageTopMargin, const long nPageBottomMargin);
+ void ExecuteMarginLRChange( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin );
+ void ExecuteMarginULChange( const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin);
DECL_LINK(PaperFormatModifyHdl, weld::ComboBox&, void);
DECL_LINK(PaperSizeModifyHdl, weld::MetricSpinButton&, void);
DECL_LINK(PaperModifyMarginHdl, weld::ComboBox&, void );
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 2ef8b200aae4..d3f2a0d91642 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -238,16 +238,16 @@ PageMarginControl::~PageMarginControl()
void PageMarginControl::SetMetricFieldMaxValues( const Size& rPageSize )
{
- const long nML = m_xLeftMarginEdit->denormalize( m_xLeftMarginEdit->get_value( FieldUnit::TWIP ) );
- const long nMR = m_xRightMarginEdit->denormalize( m_xRightMarginEdit->get_value( FieldUnit::TWIP ) );
- const long nMT = m_xTopMarginEdit->denormalize( m_xTopMarginEdit->get_value( FieldUnit::TWIP ) );
- const long nMB = m_xBottomMarginEdit->denormalize( m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) );
+ const tools::Long nML = m_xLeftMarginEdit->denormalize( m_xLeftMarginEdit->get_value( FieldUnit::TWIP ) );
+ const tools::Long nMR = m_xRightMarginEdit->denormalize( m_xRightMarginEdit->get_value( FieldUnit::TWIP ) );
+ const tools::Long nMT = m_xTopMarginEdit->denormalize( m_xTopMarginEdit->get_value( FieldUnit::TWIP ) );
+ const tools::Long nMB = m_xBottomMarginEdit->denormalize( m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) );
- const long nPH = OutputDevice::LogicToLogic( rPageSize.Height(), m_eUnit, MapUnit::MapTwip );
- const long nPW = OutputDevice::LogicToLogic( rPageSize.Width(), m_eUnit, MapUnit::MapTwip );
+ const tools::Long nPH = OutputDevice::LogicToLogic( rPageSize.Height(), m_eUnit, MapUnit::MapTwip );
+ const tools::Long nPW = OutputDevice::LogicToLogic( rPageSize.Width(), m_eUnit, MapUnit::MapTwip );
// Left
- long nMax = nPW - nMR - MINBODY;
+ tools::Long nMax = nPW - nMR - MINBODY;
m_xLeftMarginEdit->set_max( m_xLeftMarginEdit->normalize( nMax ), FieldUnit::TWIP );
// Right
@@ -420,8 +420,8 @@ IMPL_LINK( PageMarginControl, SelectMarginHdl, weld::Button&, rControl, void )
}
void PageMarginControl::ExecuteMarginLRChange(
- const long nPageLeftMargin,
- const long nPageRightMargin )
+ const tools::Long nPageLeftMargin,
+ const tools::Long nPageRightMargin )
{
if ( SfxViewFrame::Current() )
{
@@ -435,8 +435,8 @@ void PageMarginControl::ExecuteMarginLRChange(
}
void PageMarginControl::ExecuteMarginULChange(
- const long nPageTopMargin,
- const long nPageBottomMargin )
+ const tools::Long nPageTopMargin,
+ const tools::Long nPageBottomMargin )
{
if ( SfxViewFrame::Current() )
{
diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx
index a702d7c8e808..88e2d0e11e97 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.hxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.hxx
@@ -28,7 +28,7 @@
#define SWPAGE_WIDE_VALUE3 1800
// #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and svx/source/dialog/hdft.cxx
-const long MINBODY = 56; // 1mm in twips rounded
+const tools::Long MINBODY = 56; // 1mm in twips rounded
class PageMarginPopup;
@@ -63,10 +63,10 @@ private:
rtl::Reference<PageMarginPopup> m_xControl;
- long m_nPageLeftMargin;
- long m_nPageRightMargin;
- long m_nPageTopMargin;
- long m_nPageBottomMargin;
+ tools::Long m_nPageLeftMargin;
+ tools::Long m_nPageRightMargin;
+ tools::Long m_nPageTopMargin;
+ tools::Long m_nPageBottomMargin;
bool m_bMirrored;
const MapUnit m_eUnit;
@@ -74,10 +74,10 @@ private:
Size m_aPageSize;
bool m_bUserCustomValuesAvailable;
- long m_nUserCustomPageLeftMargin;
- long m_nUserCustomPageRightMargin;
- long m_nUserCustomPageTopMargin;
- long m_nUserCustomPageBottomMargin;
+ tools::Long m_nUserCustomPageLeftMargin;
+ tools::Long m_nUserCustomPageRightMargin;
+ tools::Long m_nUserCustomPageTopMargin;
+ tools::Long m_nUserCustomPageBottomMargin;
bool m_bUserCustomMirrored;
bool m_bCustomValuesUsed;
@@ -87,11 +87,11 @@ private:
DECL_LINK( ModifyULMarginHdl, weld::MetricSpinButton&, void );
static void ExecuteMarginLRChange(
- const long nPageLeftMargin,
- const long nPageRightMargin );
+ const tools::Long nPageLeftMargin,
+ const tools::Long nPageRightMargin );
static void ExecuteMarginULChange(
- const long nPageTopMargin,
- const long nPageBottomMargin );
+ const tools::Long nPageTopMargin,
+ const tools::Long nPageBottomMargin );
static void ExecutePageLayoutChange( const bool bMirrored );
void SetMetricFieldMaxValues(const Size& rPageSize);
diff --git a/sw/source/uibase/sidebar/PageMarginUtils.hxx b/sw/source/uibase/sidebar/PageMarginUtils.hxx
index 1361361a18a1..cdef6eb7e687 100644
--- a/sw/source/uibase/sidebar/PageMarginUtils.hxx
+++ b/sw/source/uibase/sidebar/PageMarginUtils.hxx
@@ -28,8 +28,8 @@
namespace sw::sidebar{
-bool IsNone( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsNone( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_NO_MARGIN) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_NO_MARGIN ) <= SWPAGE_UNIT_THRESHOLD &&
@@ -38,8 +38,8 @@ bool IsNone( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetNone( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetNone( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_NO_MARGIN;
nPageRightMargin = SWPAGE_NO_MARGIN;
@@ -48,8 +48,8 @@ void SetNone( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsNarrow( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsNarrow( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_NARROW_VALUE) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_NARROW_VALUE) <= SWPAGE_UNIT_THRESHOLD &&
@@ -58,8 +58,8 @@ bool IsNarrow( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetNarrow( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetNarrow( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_NARROW_VALUE;
nPageRightMargin = SWPAGE_NARROW_VALUE;
@@ -68,8 +68,8 @@ void SetNarrow( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsModerate( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsModerate( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_MODERATE_LR) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_MODERATE_LR) <= SWPAGE_UNIT_THRESHOLD &&
@@ -78,8 +78,8 @@ bool IsModerate( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetModerate( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetModerate( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_MODERATE_LR;
nPageRightMargin = SWPAGE_MODERATE_LR;
@@ -88,8 +88,8 @@ void SetModerate( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsNormal075( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsNormal075( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_NORMAL_VALUE) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_NORMAL_VALUE) <= SWPAGE_UNIT_THRESHOLD &&
@@ -98,8 +98,8 @@ bool IsNormal075( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetNormal075( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetNormal075( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_NORMAL_VALUE;
nPageRightMargin = SWPAGE_NORMAL_VALUE;
@@ -108,8 +108,8 @@ void SetNormal075( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsNormal100( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsNormal100( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE1) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE1) <= SWPAGE_UNIT_THRESHOLD &&
@@ -118,8 +118,8 @@ bool IsNormal100( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetNormal100( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetNormal100( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_WIDE_VALUE1;
nPageRightMargin = SWPAGE_WIDE_VALUE1;
@@ -128,8 +128,8 @@ void SetNormal100( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsNormal125( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsNormal125( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE3) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE3) <= SWPAGE_UNIT_THRESHOLD &&
@@ -138,8 +138,8 @@ bool IsNormal125( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetNormal125( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetNormal125( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_WIDE_VALUE3;
nPageRightMargin = SWPAGE_WIDE_VALUE3;
@@ -148,8 +148,8 @@ void SetNormal125( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsWide( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsWide( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE2) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE2) <= SWPAGE_UNIT_THRESHOLD &&
@@ -158,8 +158,8 @@ bool IsWide( const long nPageLeftMargin, const long nPageRightMargin,
!bMirrored );
}
-void SetWide( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetWide( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_WIDE_VALUE2;
nPageRightMargin = SWPAGE_WIDE_VALUE2;
@@ -168,8 +168,8 @@ void SetWide( long& nPageLeftMargin, long& nPageRightMargin,
bMirrored = false;
}
-bool IsMirrored( const long nPageLeftMargin, const long nPageRightMargin,
- const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored)
+bool IsMirrored( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin,
+ const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored)
{
return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE3) <= SWPAGE_UNIT_THRESHOLD &&
std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE1) <= SWPAGE_UNIT_THRESHOLD &&
@@ -178,8 +178,8 @@ bool IsMirrored( const long nPageLeftMargin, const long nPageRightMargin,
bMirrored );
}
-void SetMirrored( long& nPageLeftMargin, long& nPageRightMargin,
- long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored)
+void SetMirrored( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin,
+ tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored)
{
nPageLeftMargin = SWPAGE_WIDE_VALUE3;
nPageRightMargin = SWPAGE_WIDE_VALUE1;
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx
index d44dd3a5b2ca..b6f8aa78fff0 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.cxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx
@@ -73,8 +73,8 @@ PageOrientationControl::~PageOrientationControl()
}
void PageOrientationControl::ExecuteMarginLRChange(
- const long nPageLeftMargin,
- const long nPageRightMargin )
+ const tools::Long nPageLeftMargin,
+ const tools::Long nPageRightMargin )
{
mpPageLRMarginItem->SetLeft( nPageLeftMargin );
mpPageLRMarginItem->SetRight( nPageRightMargin );
@@ -83,8 +83,8 @@ void PageOrientationControl::ExecuteMarginLRChange(
}
void PageOrientationControl::ExecuteMarginULChange(
- const long nPageTopMargin,
- const long nPageBottomMargin )
+ const tools::Long nPageTopMargin,
+ const tools::Long nPageBottomMargin )
{
mpPageULMarginItem->SetUpper( nPageTopMargin );
mpPageULMarginItem->SetLower( nPageBottomMargin );
@@ -123,8 +123,8 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape )
mpPageItem->SetLandscape( bLandscape );
// swap the width and height of the page size
- const long nRotatedWidth = mpPageSizeItem->GetSize().Height();
- const long nRotatedHeight = mpPageSizeItem->GetSize().Width();
+ const tools::Long nRotatedWidth = mpPageSizeItem->GetSize().Height();
+ const tools::Long nRotatedHeight = mpPageSizeItem->GetSize().Width();
mpPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight));
// apply changed attributes
@@ -138,11 +138,11 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape )
// check, if margin values still fit to the changed page size.
// if not, adjust margin values
{
- const long nML = mpPageLRMarginItem->GetLeft();
- const long nMR = mpPageLRMarginItem->GetRight();
- const long nTmpPW = nML + nMR + MINBODY;
+ const tools::Long nML = mpPageLRMarginItem->GetLeft();
+ const tools::Long nMR = mpPageLRMarginItem->GetRight();
+ const tools::Long nTmpPW = nML + nMR + MINBODY;
- const long nPW = mpPageSizeItem->GetSize().Width();
+ const tools::Long nPW = mpPageSizeItem->GetSize().Width();
if ( nTmpPW > nPW )
{
@@ -156,11 +156,11 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape )
}
}
- const long nMT = mpPageULMarginItem->GetUpper();
- const long nMB = mpPageULMarginItem->GetLower();
- const long nTmpPH = nMT + nMB + MINBODY;
+ const tools::Long nMT = mpPageULMarginItem->GetUpper();
+ const tools::Long nMB = mpPageULMarginItem->GetLower();
+ const tools::Long nTmpPH = nMT + nMB + MINBODY;
- const long nPH = mpPageSizeItem->GetSize().Height();
+ const tools::Long nPH = mpPageSizeItem->GetSize().Height();
if ( nTmpPH > nPH )
{
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.hxx b/sw/source/uibase/sidebar/PageOrientationControl.hxx
index 7cb825406fbc..5f71ca925894 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.hxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.hxx
@@ -46,8 +46,8 @@ private:
std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
- void ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin);
- void ExecuteMarginLRChange(const long nPageLeftMargin, const long nPageRightMargin);
+ void ExecuteMarginULChange(const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin);
+ void ExecuteMarginLRChange(const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin);
void ExecuteOrientationChange(const bool bLandscape);
DECL_LINK(ImplOrientationHdl, weld::Button&, void);
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index 4d82afe29349..f24bf135c706 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -75,7 +75,7 @@ BitmapEx GenerateStylePreview(SfxObjectShell& rSource, OUString const & aName)
pVirtualDev->SetLineColor(COL_LIGHTGRAY);
pVirtualDev->SetFillColor();
- long y = 0;
+ tools::Long y = 0;
{
pVirtualDev->SetFillColor(COL_LIGHTGRAY);
tools::Rectangle aNameRect(0, y, nPreviewWidth, nNameHeight);
diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx
index 2a91ec6b3bfb..de053ddaa837 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.cxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -54,7 +54,7 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState
const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pState);
if (pItem)
{
- long nNewHeight = pItem->GetValue();
+ tools::Long nNewHeight = pItem->GetValue();
nNewHeight = m_xRowHeightEdit->normalize(nNewHeight);
m_xRowHeightEdit->set_value(nNewHeight, FieldUnit::TWIP);
}
@@ -74,7 +74,7 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState
const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pState);
if (pItem)
{
- long nNewWidth = pItem->GetValue();
+ tools::Long nNewWidth = pItem->GetValue();
nNewWidth = m_xColumnWidthEdit->normalize(nNewWidth);
m_xColumnWidthEdit->set_value(nNewWidth, FieldUnit::TWIP);
}
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 290ca4106fb3..f4c4951f6546 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -43,7 +43,7 @@ public:
class ColorVariable
{
public:
- long mnIndex;
+ tools::Long mnIndex;
sal_Int16 mnTintShade;
ColorVariable()
@@ -51,7 +51,7 @@ public:
, mnTintShade()
{}
- ColorVariable(long nIndex, sal_Int16 nTintShade)
+ ColorVariable(tools::Long nIndex, sal_Int16 nTintShade)
: mnIndex(nIndex)
, mnTintShade(nTintShade)
{}
@@ -367,15 +367,15 @@ BitmapEx GenerateColorPreview(const svx::ColorSet& rColorSet)
{
ScopedVclPtrInstance<VirtualDevice> pVirtualDev(*Application::GetDefaultDevice());
float fScaleFactor = pVirtualDev->GetDPIScaleFactor();
- long BORDER = 2 * fScaleFactor;
- long SIZE = 12 * fScaleFactor;
+ tools::Long BORDER = 2 * fScaleFactor;
+ tools::Long SIZE = 12 * fScaleFactor;
Size aSize(BORDER * 7 + SIZE * 6, BORDER * 3 + SIZE * 2);
pVirtualDev->SetOutputSizePixel(aSize);
- long x = BORDER;
- long y1 = BORDER;
- long y2 = y1 + SIZE + BORDER;
+ tools::Long x = BORDER;
+ tools::Long y1 = BORDER;
+ tools::Long y2 = y1 + SIZE + BORDER;
pVirtualDev->SetLineColor(COL_LIGHTGRAY);
diff --git a/sw/source/uibase/table/swtablerep.cxx b/sw/source/uibase/table/swtablerep.cxx
index a7518c14ebb5..4eac6343b58d 100644
--- a/sw/source/uibase/table/swtablerep.cxx
+++ b/sw/source/uibase/table/swtablerep.cxx
@@ -60,7 +60,7 @@ SwTableRep::~SwTableRep()
bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
{
- long nOldLeft = rTabCols.GetLeft(),
+ tools::Long nOldLeft = rTabCols.GetLeft(),
nOldRight = rTabCols.GetRight();
bool bSingleLine = false;
diff --git a/sw/source/uibase/uitest/uiobject.cxx b/sw/source/uibase/uitest/uiobject.cxx
index 4ac900ec635c..867083edb6e2 100644
--- a/sw/source/uibase/uitest/uiobject.cxx
+++ b/sw/source/uibase/uitest/uiobject.cxx
@@ -212,8 +212,8 @@ void CommentUIObject::execute(const OUString& rAction,
if (rParameters.find("FROM") != rParameters.end() &&
rParameters.find("TO") != rParameters.end())
{
- long nMin = rParameters.find("FROM")->second.toInt32();
- long nMax = rParameters.find("TO")->second.toInt32();
+ tools::Long nMin = rParameters.find("FROM")->second.toInt32();
+ tools::Long nMax = rParameters.find("TO")->second.toInt32();
ESelection aNewSelection( 0 , nMin, mxCommentUIObject->GetOutliner()->GetParagraphCount()-1, nMax );
mxCommentUIObject->GetOutlinerView()->SetSelection( aNewSelection );
}
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 362b08bfc54d..038428d9290e 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1286,7 +1286,7 @@ bool SwPagePreview::ChgPage( int eMvMode, bool bUpdateScrollbar )
void SwPagePreview::CalcAndSetBorderPixel( SvBorder &rToFill )
{
const StyleSettings &rSet = m_pViewWin->GetSettings().GetStyleSettings();
- const long nTmp = rSet.GetScrollBarSize();
+ const tools::Long nTmp = rSet.GetScrollBarSize();
if ( m_pVScrollbar->IsVisible( true ) )
rToFill.Right() = nTmp;
if ( m_pHScrollbar->IsVisible( true ) )
@@ -1393,7 +1393,7 @@ IMPL_LINK( SwPagePreview, ScrollHdl, ScrollBar *, p, void )
{
// Scroll how many pages??
OUString sStateStr(m_sPageStr);
- long nThmbPos = pScrollbar->GetThumbPos();
+ tools::Long nThmbPos = pScrollbar->GetThumbPos();
if( 1 == m_pViewWin->GetCol() || !nThmbPos )
++nThmbPos;
sStateStr += OUString::number( nThmbPos );
@@ -1481,13 +1481,13 @@ IMPL_LINK( SwPagePreview, EndScrollHdl, ScrollBar *, p, void )
}
else
{
- long nThmbPos = pScrollbar->GetThumbPos();
+ tools::Long nThmbPos = pScrollbar->GetThumbPos();
m_pViewWin->Scroll(0, nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Top());
}
}
else
{
- long nThmbPos = pScrollbar->GetThumbPos();
+ tools::Long nThmbPos = pScrollbar->GetThumbPos();
m_pViewWin->Scroll(nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Left(), 0);
}
// additional invalidate page status.
@@ -1576,7 +1576,7 @@ void SwPagePreview::ScrollViewSzChg()
const Size& rPreviewSize =
GetViewShell()->PagePreviewLayout()->GetPreviewDocSize();
m_pVScrollbar->SetRangeMax(rPreviewSize.Height()) ;
- long nVisHeight = rDocRect.GetHeight();
+ tools::Long nVisHeight = rDocRect.GetHeight();
m_pVScrollbar->SetVisibleSize( nVisHeight );
m_pVScrollbar->SetThumbPos( rDocRect.Top() );
m_pVScrollbar->SetLineSize( nVisHeight / 10 );
@@ -1601,8 +1601,8 @@ void SwPagePreview::ScrollViewSzChg()
{
bShowHScrollbar = true;
- long nVisWidth = rDocRect.GetWidth();
- long nThumb = rDocRect.Left();
+ tools::Long nVisWidth = rDocRect.GetWidth();
+ tools::Long nThumb = rDocRect.Left();
aRange = Range(0, rPreviewSize.Width());
m_pHScrollbar->SetRange( aRange );
@@ -1762,7 +1762,7 @@ void SwPagePreviewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
* when less than the desired number of rows fits into
* the view
*/
-void SwPagePreviewWin::Scroll(long nXMove, long nYMove, ScrollFlags /*nFlags*/)
+void SwPagePreviewWin::Scroll(tools::Long nXMove, tools::Long nYMove, ScrollFlags /*nFlags*/)
{
maPaintedPreviewDocRect.Move(nXMove, nYMove);
mpPgPreviewLayout->Prepare( 0, maPaintedPreviewDocRect.TopLeft(),
diff --git a/sw/source/uibase/uiview/scroll.cxx b/sw/source/uibase/uiview/scroll.cxx
index e44154b34222..1bd4bd1e9338 100644
--- a/sw/source/uibase/uiview/scroll.cxx
+++ b/sw/source/uibase/uiview/scroll.cxx
@@ -52,7 +52,7 @@ void SwScrollbar::DocSzChgd( const Size &rSize )
void SwScrollbar::ViewPortChgd( const tools::Rectangle &rRect )
{
- long nThumb, nVisible;
+ tools::Long nThumb, nVisible;
if( bHori )
{
nThumb = rRect.Left();
@@ -103,8 +103,8 @@ void SwScrollbar::SetAuto(bool bSet)
void SwScrollbar::AutoShow()
{
- long nVis = GetVisibleSize();
- long nLen = GetRange().Len();
+ tools::Long nVis = GetVisibleSize();
+ tools::Long nLen = GetRange().Len();
if( nVis >= nLen - 1)
{
if(ScrollBar::IsVisible())
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 62f306a9dcf7..6709689e556b 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -123,19 +123,19 @@ static void lcl_PrintHeader( vcl::RenderContext &rOutDev, sal_Int32 nPages, sal_
aFont.SetAlignment( ALIGN_BOTTOM );
rOutDev.SetFont( aFont );
- long nFontHeight = rOutDev.GetTextHeight();
+ tools::Long nFontHeight = rOutDev.GetTextHeight();
// 1.Border => Line, 2+3 Border = Space.
- long nYTop = TMARGPRN-3*nBorder-nFontHeight;
+ tools::Long nYTop = TMARGPRN-3*nBorder-nFontHeight;
- long nXLeft = nLeftMargin-nBorder;
- long nXRight = aSz.Width()-RMARGPRN+nBorder;
+ tools::Long nXLeft = nLeftMargin-nBorder;
+ tools::Long nXRight = aSz.Width()-RMARGPRN+nBorder;
rOutDev.DrawRect( tools::Rectangle(
Point( nXLeft, nYTop ),
Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) );
- long nY = TMARGPRN-2*nBorder;
+ tools::Long nY = TMARGPRN-2*nBorder;
Point aPos( nLeftMargin, nY );
rOutDev.DrawText( aPos, rTitle );
if ( nPages != 1 )
@@ -684,16 +684,16 @@ sal_Int32 SwSrcView::PrintSource(
OUString aTitle( GetViewFrame()->GetWindow().GetText() );
- const long nLineHeight = pOutDev->GetTextHeight(); // slightly more
- const long nParaSpace = 10;
+ const tools::Long nLineHeight = pOutDev->GetTextHeight(); // slightly more
+ const tools::Long nParaSpace = 10;
Size aPaperSz = pOutDev->GetOutputSize();
aPaperSz.AdjustWidth( -(LMARGPRN + RMARGPRN) );
aPaperSz.AdjustHeight( -(TMARGPRN + BMARGPRN) );
// nLinepPage is not true, if lines have to be wrapped...
- const long nLinespPage = nLineHeight ? aPaperSz.Height() / nLineHeight : 1;
- const long nCharWidth = pOutDev->GetTextWidth("X");
+ const tools::Long nLinespPage = nLineHeight ? aPaperSz.Height() / nLineHeight : 1;
+ const tools::Long nCharWidth = pOutDev->GetTextWidth("X");
const sal_Int32 nCharspLine = nCharWidth ? static_cast<sal_Int32>(aPaperSz.Width() / nCharWidth) : 1;
const sal_uInt32 nParas = pTextEngine->GetParagraphCount();
diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx
index 05f5f6ccc95a..02dc88cade38 100644
--- a/sw/source/uibase/uiview/swcli.cxx
+++ b/sw/source/uibase/uiview/swcli.cxx
@@ -67,8 +67,8 @@ void SwOleClient::RequestNewObjectArea( tools::Rectangle& aLogRect )
MapMode aObjectMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) );
MapMode aClientMap( GetEditWin()->GetMapMode().GetMapUnit() );
- Size aNewObjSize( long( aLogRect.GetWidth() / GetScaleWidth() ),
- long( aLogRect.GetHeight() / GetScaleHeight() ) );
+ Size aNewObjSize( tools::Long( aLogRect.GetWidth() / GetScaleWidth() ),
+ tools::Long( aLogRect.GetHeight() / GetScaleHeight() ) );
// convert to logical coordinates of the embedded object
Size aNewSize = GetEditWin()->LogicToLogic( aNewObjSize, &aClientMap, &aObjectMap );
@@ -141,8 +141,8 @@ void SwOleClient::ViewChanged()
const MapMode aObjMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) );
aVisSize = OutputDevice::LogicToLogic( aVisSize, aObjMap, aMyMap );
- aVisSize.setWidth( long(aVisSize.Width() * GetScaleWidth()) );
- aVisSize.setHeight( long(aVisSize.Height() * GetScaleHeight()) );
+ aVisSize.setWidth( tools::Long(aVisSize.Width() * GetScaleWidth()) );
+ aVisSize.setHeight( tools::Long(aVisSize.Height() * GetScaleHeight()) );
SwRect aRect( Point( LONG_MIN, LONG_MIN ), aVisSize );
rSh.LockView( true ); // Prevent scrolling in the EndAction
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index a61a96af71d6..0a9fde5beb18 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1174,19 +1174,19 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
// No it is *not* a good idea to call GetToken within Point constr. immediately,
// because which parameter is evaluated first?
- long nX = rUserData.getToken( 0, ';', nPos ).toInt32(),
+ tools::Long nX = rUserData.getToken( 0, ';', nPos ).toInt32(),
nY = rUserData.getToken( 0, ';', nPos ).toInt32();
Point aCursorPos( nX, nY );
sal_uInt16 nZoomFactor =
static_cast< sal_uInt16 >( rUserData.getToken(0, ';', nPos ).toInt32() );
- long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(),
+ tools::Long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(),
nTop = rUserData.getToken(0, ';', nPos ).toInt32(),
nRight = rUserData.getToken(0, ';', nPos ).toInt32(),
nBottom= rUserData.getToken(0, ';', nPos ).toInt32();
- const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if ( nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
return;
@@ -1244,8 +1244,8 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
if( !m_sNewCursorPos.isEmpty() )
{
sal_Int32 nIdx{ 0 };
- const long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
- const long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
+ const tools::Long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
+ const tools::Long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32();
Point aCursorPos2( nXTmp, nYTmp );
bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 );
@@ -1388,7 +1388,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
return;
Point aCursorPos( nX, nY );
- const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if (nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
return;
@@ -1491,7 +1491,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
else
{
//check if the values are possible
- long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize();
+ tools::Long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize();
if( aTopLeft.X() > nXMax )
aTopLeft.setX( nXMax < 0 ? 0 : nXMax );
}
@@ -1567,7 +1567,7 @@ void SwView::ShowCursor( bool bOn )
m_pWrtShell->LockView( false );
}
-ErrCode SwView::DoVerb( long nVerb )
+ErrCode SwView::DoVerb( tools::Long nVerb )
{
if ( !GetViewFrame()->GetFrame().IsInPlace() )
{
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 6866c8b4788a..b0e133d92403 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -586,7 +586,7 @@ void SwView::Execute(SfxRequest &rReq)
case SID_ZOOM_IN:
case SID_ZOOM_OUT:
{
- long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
+ tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
if (SID_ZOOM_OUT == nSlot)
nFact = basegfx::zoomtools::zoomIn(nFact);
else
@@ -894,7 +894,7 @@ void SwView::Execute(SfxRequest &rReq)
}
m_pViewImpl->InitRequest( rReq );
- long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion );
+ tools::Long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion );
if ( bHasFileName )
{
@@ -1562,13 +1562,13 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
const Size& rEditSize = GetEditWin().GetOutputSizePixel();
const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
- const long nOf = pVOpt->GetDocumentBorder() * 2;
- long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
+ const tools::Long nOf = pVOpt->GetDocumentBorder() * 2;
+ tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
nTmpWidth += nOf;
aPageSize.AdjustHeight(nOf );
- long nFac = aWindowSize.Width() * 100 / nTmpWidth;
+ tools::Long nFac = aWindowSize.Width() * 100 / nTmpWidth;
- long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
+ tools::Long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
nFac = std::min( nFac, nVisPercent );
if (nFac >= MINZOOM)
@@ -2205,7 +2205,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem )
sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue();
bool bHasFileName = !sFile.isEmpty();
- long nFound = InsertDoc( nSlot, sFile, sFilter );
+ tools::Long nFound = InsertDoc( nSlot, sFile, sFilter );
if ( bHasFileName )
{
@@ -2215,7 +2215,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem )
}
}
-long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion )
+tools::Long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion )
{
std::unique_ptr<SfxMedium> pMed;
SwDocShell* pDocSh = GetDocShell();
@@ -2255,10 +2255,10 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUS
return InsertMedium( nSlotId, std::move(pMed), nVersion );
}
-long SwView::InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion )
+tools::Long SwView::InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion )
{
bool bInsert = false, bCompare = false;
- long nFound = 0;
+ tools::Long nFound = 0;
SwDocShell* pDocSh = GetDocShell();
switch( nSlotId )
@@ -2571,7 +2571,7 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void )
}
const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot();
- long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() );
+ tools::Long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() );
if ( SID_INSERTDOC == nSlot )
{
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index 398d8369370f..30aed9abf826 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -93,7 +93,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
{ // start of SwActContext scope
SwActContext aActContext(m_pWrtShell.get());
- long nFac = nFactor;
+ tools::Long nFac = nFactor;
const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr;
SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb));
@@ -101,7 +101,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
const SwPageDesc &rDesc = m_pWrtShell->GetPageDesc( m_pWrtShell->GetCurPageDesc() );
const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace();
const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
- long lLeftMargin = 0;
+ tools::Long lLeftMargin = 0;
if( eZoomType != SvxZoomType::PERCENT )
{
@@ -135,26 +135,26 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
}
else if(SvxZoomType::WHOLEPAGE == eZoomType || SvxZoomType::PAGEWIDTH == eZoomType )
{
- const long nOf = DOCUMENTBORDER * 2;
- long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
+ const tools::Long nOf = DOCUMENTBORDER * 2;
+ tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
nTmpWidth += nOf;
aPageSize.AdjustHeight(nOf );
nFac = aWindowSize.Width() * 100 / nTmpWidth;
if ( SvxZoomType::WHOLEPAGE == eZoomType )
{
- long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
+ tools::Long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
nFac = std::min( nFac, nVisPercent );
}
}
else
{
- const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
+ const tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
nFac = aWindowSize.Width() * 100 / nTmpWidth;
}
}
- nFac = std::max( long( MINZOOM ), nFac );
+ nFac = std::max( tools::Long( MINZOOM ), nFac );
const sal_uInt16 nZoomFac = static_cast<sal_uInt16>(nFac);
SwViewOption aOpt( *pOpt );
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 66df1f44c950..679e08fc8025 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -60,10 +60,10 @@ bool SwView::IsDocumentBorder()
SvxZoomType::PAGEWIDTH_NOBORDER == m_pWrtShell->GetViewOptions()->GetZoomType();
}
-static long GetLeftMargin( SwView const &rView )
+static tools::Long GetLeftMargin( SwView const &rView )
{
SvxZoomType eType = rView.GetWrtShell().GetViewOptions()->GetZoomType();
- long lRet = rView.GetWrtShell().GetAnyCurRect(CurRectType::PagePrt).Left();
+ tools::Long lRet = rView.GetWrtShell().GetAnyCurRect(CurRectType::PagePrt).Left();
return eType == SvxZoomType::PERCENT ? lRet + DOCUMENTBORDER :
eType == SvxZoomType::PAGEWIDTH || eType == SvxZoomType::PAGEWIDTH_NOBORDER ? 0 :
lRet + DOCUMENTBORDER + nLeftOfst;
@@ -77,17 +77,17 @@ static void lcl_GetPos(SwView const * pView,
SwWrtShell &rSh = pView->GetWrtShell();
const Size aDocSz( rSh.GetDocSize() );
- const long lBorder = bBorder ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
+ const tools::Long lBorder = bBorder ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
const bool bHori = pScrollbar->IsHoriScroll();
- const long lPos = pScrollbar->GetThumbPos() + (bBorder ? DOCUMENTBORDER : 0);
+ const tools::Long lPos = pScrollbar->GetThumbPos() + (bBorder ? DOCUMENTBORDER : 0);
- long lDelta = lPos - (bHori ? rSh.VisArea().Pos().X() : rSh.VisArea().Pos().Y());
+ tools::Long lDelta = lPos - (bHori ? rSh.VisArea().Pos().X() : rSh.VisArea().Pos().Y());
- const long lSize = (bHori ? aDocSz.Width() : aDocSz.Height()) + lBorder;
+ const tools::Long lSize = (bHori ? aDocSz.Width() : aDocSz.Height()) + lBorder;
// Should right or below are too much space,
// then they must be subtracted out of the VisArea!
- long nTmp = pView->GetVisArea().Right()+lDelta;
+ tools::Long nTmp = pView->GetVisArea().Right()+lDelta;
if ( bHori && nTmp > lSize )
lDelta -= nTmp - lSize;
nTmp = pView->GetVisArea().Bottom()+lDelta;
@@ -124,20 +124,20 @@ void SwView::InvalidateRulerPos()
// Limits the scrolling so far that only a quarter of the
// screen can be scrolled up before the end of the document.
-long SwView::SetHScrollMax( long lMax )
+tools::Long SwView::SetHScrollMax( tools::Long lMax )
{
- const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
- const long lSize = GetDocSz().Width() + lBorder - m_aVisArea.GetWidth();
+ const tools::Long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
+ const tools::Long lSize = GetDocSz().Width() + lBorder - m_aVisArea.GetWidth();
// At negative values the document is completely visible.
// In this case, no scrolling.
return std::max( std::min( lMax, lSize ), 0L );
}
-long SwView::SetVScrollMax( long lMax )
+tools::Long SwView::SetVScrollMax( tools::Long lMax )
{
- const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
- long lSize = GetDocSz().Height() + lBorder - m_aVisArea.GetHeight();
+ const tools::Long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
+ tools::Long lSize = GetDocSz().Height() + lBorder - m_aVisArea.GetHeight();
return std::max( std::min( lMax, lSize), 0L ); // see horizontal
}
@@ -291,7 +291,7 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar )
// Let's see how far we get with half BrushSize.
Point aPt = GetEditWin().LogicToPixel( rPt );
#if HAVE_FEATURE_DESKTOP
- const long nTmp = GetWrtShell().IsFrameView() ? 4 : 8;
+ const tools::Long nTmp = GetWrtShell().IsFrameView() ? 4 : 8;
aPt.AdjustX( -(aPt.X() % nTmp) );
aPt.AdjustY( -(aPt.Y() % nTmp) );
#endif
@@ -300,8 +300,8 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar )
if ( aPt == m_aVisArea.TopLeft() )
return;
- const long lXDiff = m_aVisArea.Left() - aPt.X();
- const long lYDiff = m_aVisArea.Top() - aPt.Y();
+ const tools::Long lXDiff = m_aVisArea.Left() - aPt.X();
+ const tools::Long lYDiff = m_aVisArea.Top() - aPt.Y();
SetVisArea( tools::Rectangle( aPt,
Point( m_aVisArea.Right() - lXDiff, m_aVisArea.Bottom() - lYDiff ) ),
bUpdateScrollbar);
@@ -339,9 +339,9 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect,
const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0;
- long nYScroll = GetYScroll();
- long nDesHeight = rRect.GetHeight();
- long nCurHeight = m_aVisArea.GetHeight();
+ tools::Long nYScroll = GetYScroll();
+ tools::Long nDesHeight = rRect.GetHeight();
+ tools::Long nCurHeight = m_aVisArea.GetHeight();
nYScroll = std::min(nYScroll, nCurHeight - nDesHeight); // If it is scarce, then scroll not too much.
if(nDesHeight > nCurHeight) // the height is not sufficient, then nYScroll is no longer of interest
{
@@ -360,7 +360,7 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect,
nRangeY : nYScroll ) );
pPt->setY( SetVScrollMax( pPt->Y() ) );
}
- long nXScroll = GetXScroll();
+ tools::Long nXScroll = GetXScroll();
if ( rRect.Right() > m_aVisArea.Right() ) // Shift right
{
pPt->setX( rRect.Right() -
@@ -390,7 +390,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
return;
tools::Rectangle aOldVisArea( m_aVisArea );
- long nDiffY = 0;
+ tools::Long nDiffY = 0;
weld::Window* pCareDialog = SwViewShell::GetCareDialog(GetWrtShell());
if (pCareDialog)
@@ -418,8 +418,8 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
return;
// Is above or below the dialogue more space?
- long nTopDiff = aDlgRect.Top() - m_aVisArea.Top();
- long nBottomDiff = m_aVisArea.Bottom() - aDlgRect.Bottom();
+ tools::Long nTopDiff = aDlgRect.Top() - m_aVisArea.Top();
+ tools::Long nBottomDiff = m_aVisArea.Bottom() - aDlgRect.Bottom();
if ( nTopDiff < nBottomDiff )
{
if ( nBottomDiff > 0 ) // Is there room below at all?
@@ -460,7 +460,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
if( m_bTopCursor )
{
- const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0;
+ const tools::Long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0;
aPt.setY( std::min( std::max( nBorder, rRect.Top() ),
m_aDocSz.Height() + nBorder -
m_aVisArea.GetHeight() ) );
@@ -477,7 +477,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
if( m_bTopCursor )
{
- const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0;
+ const tools::Long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0;
aPt.setY( std::min( std::max( nBorder, rRect.Top() ),
m_aDocSz.Height() + nBorder -
m_aVisArea.GetHeight() ) );
@@ -527,7 +527,7 @@ bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const
if ( !m_aVisArea.Top() || !m_aVisArea.GetHeight() )
return false;
- long nYScrl = GetYScroll() / 2;
+ tools::Long nYScrl = GetYScroll() / 2;
rOff = -(m_aVisArea.GetHeight() - nYScrl);
// Do not scroll before the beginning of the document.
if( m_aVisArea.Top() - rOff < 0 )
@@ -550,7 +550,7 @@ bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const
if ( !m_aVisArea.GetHeight() ||
(m_aVisArea.GetHeight() > m_aDocSz.Height()) )
return false;
- long nYScrl = GetYScroll() / 2;
+ tools::Long nYScrl = GetYScroll() / 2;
rOff = m_aVisArea.GetHeight() - nYScrl;
// Do not scroll past the end of the document.
if ( m_aVisArea.Top() + rOff > m_aDocSz.Height() )
@@ -775,23 +775,23 @@ void SwView::CalcVisArea( const Size &rOutPixel )
// The shifts to the right and/or below can now be incorrect
// (e.g. change zoom level, change view size).
- const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const tools::Long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if ( aRect.Left() )
{
- const long lWidth = GetWrtShell().GetDocSize().Width() + lBorder;
+ const tools::Long lWidth = GetWrtShell().GetDocSize().Width() + lBorder;
if ( aRect.Right() > lWidth )
{
- long lDelta = aRect.Right() - lWidth;
+ tools::Long lDelta = aRect.Right() - lWidth;
aRect.AdjustLeft( -lDelta );
aRect.AdjustRight( -lDelta );
}
}
if ( aRect.Top() )
{
- const long lHeight = GetWrtShell().GetDocSize().Height() + lBorder;
+ const tools::Long lHeight = GetWrtShell().GetDocSize().Height() + lBorder;
if ( aRect.Bottom() > lHeight )
{
- long lDelta = aRect.Bottom() - lHeight;
+ tools::Long lDelta = aRect.Bottom() - lHeight;
aRect.AdjustTop( -lDelta );
aRect.AdjustBottom( -lDelta );
}
@@ -808,7 +808,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill )
bool bRightVRuler = m_pWrtShell->GetViewOptions()->IsVRulerRight();
if ( m_pVRuler->IsVisible() )
{
- long nWidth = m_pVRuler->GetSizePixel().Width();
+ tools::Long nWidth = m_pVRuler->GetSizePixel().Width();
if(bRightVRuler)
rToFill.Right() = nWidth;
else
@@ -820,7 +820,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill )
rToFill.Top() = m_pHRuler->GetSizePixel().Height();
const StyleSettings &rSet = GetEditWin().GetSettings().GetStyleSettings();
- const long nTmp = rSet.GetScrollBarSize();
+ const tools::Long nTmp = rSet.GetScrollBarSize();
if( m_pVScrollbar->IsVisible(true) )
{
if(bRightVRuler)
@@ -848,15 +848,15 @@ void ViewResizePixel( const vcl::RenderContext &rRef,
// ViewResizePixel is also used by Preview!!!
const bool bHRuler = pHRuler && pHRuler->IsVisible();
- const long nHLinSzHeight = bHRuler ?
+ const tools::Long nHLinSzHeight = bHRuler ?
pHRuler->GetSizePixel().Height() : 0;
const bool bVRuler = pVRuler && pVRuler->IsVisible();
- const long nVLinSzWidth = bVRuler ?
+ const tools::Long nVLinSzWidth = bVRuler ?
pVRuler->GetSizePixel().Width() : 0;
- const long nScrollBarSize = rRef.GetSettings().GetStyleSettings().GetScrollBarSize();
- const long nHBSzHeight = rHScrollbar.IsVisible(true) ? nScrollBarSize : 0;
- const long nVBSzWidth = rVScrollbar.IsVisible(true) ? nScrollBarSize : 0;
+ const tools::Long nScrollBarSize = rRef.GetSettings().GetStyleSettings().GetScrollBarSize();
+ const tools::Long nHBSzHeight = rHScrollbar.IsVisible(true) ? nScrollBarSize : 0;
+ const tools::Long nVBSzWidth = rVScrollbar.IsVisible(true) ? nScrollBarSize : 0;
if(pVRuler)
{
@@ -988,9 +988,9 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool )
if( m_pHRuler->IsVisible() || m_pVRuler->IsVisible() )
{
const Fraction& rFrac = GetEditWin().GetMapMode().GetScaleX();
- long nZoom = 100;
+ tools::Long nZoom = 100;
if (rFrac.IsValid())
- nZoom = long(rFrac * 100);
+ nZoom = tools::Long(rFrac * 100);
const Fraction aFrac( nZoom, 100 );
m_pVRuler->SetZoom( aFrac );
@@ -1062,7 +1062,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
CurrShell aCurr( m_pWrtShell.get() );
bool bRepeat = false;
- long nCnt = 0;
+ tools::Long nCnt = 0;
bool bUnLockView = !m_pWrtShell->IsViewLocked();
m_pWrtShell->LockView( true );
@@ -1140,7 +1140,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY )
{
const Fraction &rFrac = rX < rY ? rX : rY;
- SetZoom( SvxZoomType::PERCENT, static_cast<short>(long(rFrac * Fraction( 100, 1 ))) );
+ SetZoom( SvxZoomType::PERCENT, static_cast<short>(tools::Long(rFrac * Fraction( 100, 1 ))) );
// To minimize rounding errors we also adjust the odd values
// of the base class if necessary.
@@ -1162,7 +1162,7 @@ bool SwView::UpdateScrollbars()
}
Size aTmpSz( m_aDocSz );
- const long lOfst = bBorder ? 0 : DOCUMENTBORDER * 2;
+ const tools::Long lOfst = bBorder ? 0 : DOCUMENTBORDER * 2;
aTmpSz.AdjustWidth(lOfst ); aTmpSz.AdjustHeight(lOfst );
{
@@ -1197,11 +1197,11 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
const CommandWheelData* pWData = rCEvt.GetWheelData();
if (pWData && CommandWheelMode::ZOOM == pWData->GetMode())
{
- long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
+ tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
if( 0L > pWData->GetDelta() )
- nFact = std::max( long(20), basegfx::zoomtools::zoomOut( nFact ));
+ nFact = std::max( tools::Long(20), basegfx::zoomtools::zoomOut( nFact ));
else
- nFact = std::min( long(600), basegfx::zoomtools::zoomIn( nFact ));
+ nFact = std::min( tools::Long(600), basegfx::zoomtools::zoomIn( nFact ));
SetZoom( SvxZoomType::PERCENT, nFact );
bOk = true;
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 8c267d180350..5849365ea243 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -72,9 +72,9 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_ZOOM_IN:
case SID_ZOOM_OUT:
{
- long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
- if ((SID_ZOOM_OUT == nWhich && nFact >= long(600)) ||
- (SID_ZOOM_IN == nWhich && nFact <= long(20)))
+ tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
+ if ((SID_ZOOM_OUT == nWhich && nFact >= tools::Long(600)) ||
+ (SID_ZOOM_IN == nWhich && nFact <= tools::Long(20)))
{
rSet.DisableItem(nWhich);
}
@@ -430,8 +430,8 @@ void SwView::GetState(SfxItemSet &rSet)
break;
case SID_MAIL_SCROLLBODY_PAGEDOWN:
{
- const long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
- const long nAct = GetVisArea().Bottom();
+ const tools::Long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
+ const tools::Long nAct = GetVisArea().Bottom();
rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom ));
}
break;
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index d62f7f806139..7924d5b04ca7 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -66,14 +66,14 @@ using namespace ::com::sun::star;
// Pack columns
static void lcl_FillSvxColumn(const SwFormatCol& rCol,
- long nTotalWidth,
+ tools::Long nTotalWidth,
SvxColumnItem& rColItem,
- long nDistance)
+ tools::Long nDistance)
{
const SwColumns& rCols = rCol.GetColumns();
bool bOrtho = rCol.IsOrtho() && !rCols.empty();
- long nInnerWidth = 0;
+ tools::Long nInnerWidth = 0;
if( bOrtho )
{
nInnerWidth = nTotalWidth;
@@ -87,16 +87,16 @@ static void lcl_FillSvxColumn(const SwFormatCol& rCol,
nInnerWidth /= rCols.size();
}
- long nWidth = 0;
+ tools::Long nWidth = 0;
for ( size_t i = 0; i < rCols.size(); ++i )
{
const SwColumn* pCol = &rCols[i];
- const long nStart = pCol->GetLeft() + nWidth + nDistance;
+ const tools::Long nStart = pCol->GetLeft() + nWidth + nDistance;
if( bOrtho )
nWidth += nInnerWidth + pCol->GetLeft() + pCol->GetRight();
else
nWidth += rCol.CalcColWidth(i, static_cast< sal_uInt16 >(nTotalWidth));
- const long nEnd = nWidth - pCol->GetRight() + nDistance;
+ const tools::Long nEnd = nWidth - pCol->GetRight() + nDistance;
SvxColumnDescription aColDesc(nStart, nEnd, true);
rColItem.Append(aColDesc);
@@ -105,7 +105,7 @@ static void lcl_FillSvxColumn(const SwFormatCol& rCol,
// Transfer ColumnItem in ColumnInfo
static void lcl_ConvertToCols(const SvxColumnItem& rColItem,
- long nTotalWidth,
+ tools::Long nTotalWidth,
SwFormatCol& rCols)
{
OSL_ENSURE( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" );
@@ -123,13 +123,13 @@ static void lcl_ConvertToCols(const SvxColumnItem& rColItem,
for( sal_uInt16 i=0; i < rColItem.Count()-1; ++i )
{
OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" );
- const long nStart = std::max(rColItem[i+1].nStart, rColItem[i].nEnd);
+ const tools::Long nStart = std::max(rColItem[i+1].nStart, rColItem[i].nEnd);
const sal_uInt16 nRight = static_cast<sal_uInt16>((nStart - rColItem[i].nEnd) / 2);
- const long nWidth = rColItem[i].nEnd - rColItem[i].nStart + nLeft + nRight;
+ const tools::Long nWidth = rColItem[i].nEnd - rColItem[i].nStart + nLeft + nRight;
SwColumn* pCol = &rArr[i];
- pCol->SetWishWidth( sal_uInt16(long(rCols.GetWishWidth()) * nWidth / nTotalWidth ));
+ pCol->SetWishWidth( sal_uInt16(tools::Long(rCols.GetWishWidth()) * nWidth / nTotalWidth ));
pCol->SetLeft( nLeft );
pCol->SetRight( nRight );
nSumAll += pCol->GetWishWidth();
@@ -170,7 +170,7 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace)
if ( rDesc.GetUseOn() == UseOnPage::Mirror && (nPhyPage % 2) == 0 )
{
- long nTmp = rLRSpace.GetRight();
+ tools::Long nTmp = rLRSpace.GetRight();
rLRSpace.SetRight( rLRSpace.GetLeft() );
rLRSpace.SetLeft( nTmp );
}
@@ -178,30 +178,30 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace)
// If the frame border is moved, the column separator
// should stay in the same absolute position.
-static void lcl_Scale(long& nVal, long nScale)
+static void lcl_Scale(tools::Long& nVal, tools::Long nScale)
{
nVal *= nScale;
nVal >>= 8;
}
static void ResizeFrameCols(SwFormatCol& rCol,
- long nOldWidth,
- long nNewWidth,
- long nLeftDelta )
+ tools::Long nOldWidth,
+ tools::Long nNewWidth,
+ tools::Long nLeftDelta )
{
SwColumns& rArr = rCol.GetColumns();
- long nWishSum = static_cast<long>(rCol.GetWishWidth());
- long nWishDiff = (nWishSum * 100/nOldWidth * nNewWidth) / 100 - nWishSum;
- long nNewWishWidth = nWishSum + nWishDiff;
+ tools::Long nWishSum = static_cast<tools::Long>(rCol.GetWishWidth());
+ tools::Long nWishDiff = (nWishSum * 100/nOldWidth * nNewWidth) / 100 - nWishSum;
+ tools::Long nNewWishWidth = nWishSum + nWishDiff;
if(nNewWishWidth > 0xffffl)
{
// If the desired width is getting too large, then all values
// must be scaled appropriately.
- long nScale = (0xffffl << 8)/ nNewWishWidth;
+ tools::Long nScale = (0xffffl << 8)/ nNewWishWidth;
for(SwColumn & i : rArr)
{
SwColumn* pCol = &i;
- long nVal = pCol->GetWishWidth();
+ tools::Long nVal = pCol->GetWishWidth();
lcl_Scale(nVal, nScale);
pCol->SetWishWidth(static_cast<sal_uInt16>(nVal));
nVal = pCol->GetLeft();
@@ -249,8 +249,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
const SwFormatFrameSize &rFrameSize = rDesc.GetMaster().GetFrameSize();
const SwRect& rPageRect = rSh.GetAnyCurRect(CurRectType::Page);
- const long nPageWidth = bBrowse ? rPageRect.Width() : rFrameSize.GetWidth();
- const long nPageHeight = bBrowse ? rPageRect.Height() : rFrameSize.GetHeight();
+ const tools::Long nPageWidth = bBrowse ? rPageRect.Width() : rFrameSize.GetWidth();
+ const tools::Long nPageHeight = bBrowse ? rPageRect.Height() : rFrameSize.GetHeight();
bool bUnlockView = false;
rSh.StartAllAction();
@@ -277,7 +277,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
rSh.IsFrameVertical(true, bRTL, bVertL2R) ) ||
( !bFrameSelection && bVerticalWriting);
}
- long nDeltaX = bVerticalFrame ?
+ tools::Long nDeltaX = bVerticalFrame ?
rRect.Right() - rPageRect.Right() + aLongLR.GetRight() :
rPageRect.Left() + aLongLR.GetLeft() - rRect.Left();
@@ -301,13 +301,13 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
}
SwFormatFrameSize aSize( pFormat->GetFrameSize() );
- long nOldWidth = aSize.GetWidth();
+ tools::Long nOldWidth = aSize.GetWidth();
if(aSize.GetWidthPercent())
{
SwRect aRect;
rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
- long nPrtWidth = aRect.Width();
+ tools::Long nPrtWidth = aRect.Width();
aSize.SetWidthPercent(sal_uInt8((nPageWidth - aLongLR.GetLeft() - aLongLR.GetRight()) * 100 /nPrtWidth));
}
else
@@ -339,7 +339,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
else if ( nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER ))
{
// Subtract out page margins
- long nOld = rDesc.GetMaster().GetLRSpace().GetLeft();
+ tools::Long nOld = rDesc.GetMaster().GetLRSpace().GetLeft();
aLongLR.SetLeft( nOld > aLongLR.GetLeft() ? 0 : aLongLR.GetLeft() - nOld );
nOld = rDesc.GetMaster().GetLRSpace().GetRight();
@@ -366,8 +366,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt);
const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section);
aSectRect.Pos() += aTmpRect.Pos();
- long nLeftDiff = aLongLR.GetLeft() - static_cast<long>(aSectRect.Left() - rPageRect.Left() );
- long nRightDiff = aLongLR.GetRight() - static_cast<long>( rPageRect.Right() - aSectRect.Right());
+ tools::Long nLeftDiff = aLongLR.GetLeft() - static_cast<tools::Long>(aSectRect.Left() - rPageRect.Left() );
+ tools::Long nRightDiff = aLongLR.GetRight() - static_cast<tools::Long>( rPageRect.Right() - aSectRect.Right());
//change the LRSpaceItem of the section accordingly
const SwSection* pCurrSect = rSh.GetCurrSection();
const SwSectionFormat* pSectFormat = pCurrSect->GetFormat();
@@ -380,7 +380,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if(bSect)
{
SwFormatCol aCols( pSectFormat->GetCol() );
- long nDiffWidth = nLeftDiff + nRightDiff;
+ tools::Long nDiffWidth = nLeftDiff + nRightDiff;
::ResizeFrameCols(aCols, aSectRect.Width(), aSectRect.Width() - nDiffWidth, nLeftDiff );
aSet.Put( aCols );
}
@@ -427,8 +427,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
{
SwFrameFormat* pFormat = rSh.GetFlyFrameFormat();
const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded);
- const long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top();
- const long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower());
+ const tools::Long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top();
+ const tools::Long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower());
SfxItemSet aSet( GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE,
RES_VERT_ORIENT, RES_HORI_ORIENT>{} );
@@ -456,7 +456,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
{
SwRect aRect;
rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
- long nPrtHeight = aRect.Height();
+ tools::Long nPrtHeight = aRect.Height();
aSize.SetHeightPercent(sal_uInt8(nHeight * 100 /nPrtHeight));
}
else
@@ -479,8 +479,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt);
const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section);
aSectRect.Pos() += aTmpRect.Pos();
- const long nLeftDiff = aLongULSpace.GetUpper() - static_cast<long>(aSectRect.Top() - rPageRect.Top());
- const long nRightDiff = aLongULSpace.GetLower() - static_cast<long>(nPageHeight - aSectRect.Bottom() + rPageRect.Top());
+ const tools::Long nLeftDiff = aLongULSpace.GetUpper() - static_cast<tools::Long>(aSectRect.Top() - rPageRect.Top());
+ const tools::Long nRightDiff = aLongULSpace.GetLower() - static_cast<tools::Long>(nPageHeight - aSectRect.Bottom() + rPageRect.Top());
//change the LRSpaceItem of the section accordingly
const SwSection* pCurrSect = rSh.GetCurrSection();
const SwSectionFormat* pSectFormat = pCurrSect->GetFormat();
@@ -493,7 +493,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if(bSect)
{
SwFormatCol aCols( pSectFormat->GetCol() );
- long nDiffWidth = nLeftDiff + nRightDiff;
+ tools::Long nDiffWidth = nLeftDiff + nRightDiff;
::ResizeFrameCols(aCols, aSectRect.Height(), aSectRect.Height() - nDiffWidth, nLeftDiff );
aSet.Put( aCols );
}
@@ -583,9 +583,9 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
const sal_uInt16 nGutterWidth = 0;
const SvxLRSpaceItem aLR( rDesc.GetMaster().GetLRSpace() );
- const long nLeft = aLR.GetLeft();
- const long nRight = aLR.GetRight();
- const long nWidth = nPageWidth - nLeft - nRight;
+ const tools::Long nLeft = aLR.GetLeft();
+ const tools::Long nRight = aLR.GetRight();
+ const tools::Long nWidth = nPageWidth - nLeft - nRight;
SwFormatCol aCols( rDesc.GetMaster().GetCol() );
aCols.Init( nCount, nGutterWidth, nWidth );
@@ -593,18 +593,18 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
aCols.SetGutterWidth( nGutterWidth, nWidth );
aCols.SetOrtho( false, nGutterWidth, nWidth );
- long nColumnLeft = 0;
- long nColumnRight = 0;
+ tools::Long nColumnLeft = 0;
+ tools::Long nColumnRight = 0;
if ( nPageColumnType == 4 )
{
- nColumnRight = static_cast<long>(nWidth/3);
+ nColumnRight = static_cast<tools::Long>(nWidth/3);
nColumnLeft = nWidth - nColumnRight;
aCols.GetColumns()[0].SetWishWidth( nColumnLeft );
aCols.GetColumns()[1].SetWishWidth( nColumnRight );
}
else if ( nPageColumnType == 5 )
{
- nColumnLeft = static_cast<long>(nWidth/3);
+ nColumnLeft = static_cast<tools::Long>(nWidth/3);
nColumnRight = nWidth - nColumnLeft;
aCols.GetColumns()[0].SetWishWidth( nColumnLeft );
aCols.GetColumns()[1].SetWishWidth( nColumnRight );
@@ -911,7 +911,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
rSh.GetTabCols(aTabCols);
// left table border
- long nBorder = static_cast<long>(aColItem.GetLeft() - aTabCols.GetLeftMin());
+ tools::Long nBorder = static_cast<tools::Long>(aColItem.GetLeft() - aTabCols.GetLeftMin());
aTabCols.SetLeft( nBorder );
nBorder = (bVerticalWriting ? nPageHeight : nPageWidth) - aTabCols.GetLeftMin() - aColItem.GetRight();
@@ -981,7 +981,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
pSectFormat->GetCol() :
aSet.Get( RES_COL, false ));
SwRect aCurRect = rSh.GetAnyCurRect(bSect ? CurRectType::SectionPrt : CurRectType::FlyEmbeddedPrt);
- const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width();
+ const tools::Long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width();
::lcl_ConvertToCols( aColItem, lWidth, aCols );
aSet.Put( aCols );
if(bSect)
@@ -1039,7 +1039,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
}
else
{
- long nBorder = nPageHeight - aTabCols.GetLeftMin() - aColItem.GetRight();
+ tools::Long nBorder = nPageHeight - aTabCols.GetLeftMin() - aColItem.GetRight();
aTabCols.SetRight( nBorder );
}
@@ -1049,7 +1049,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
for ( size_t i = nColItems; i; --i )
{
const SvxColumnDescription& rCol = aColItem[i - 1];
- long nColumnPos = aTabCols.GetRight() - rCol.nEnd ;
+ tools::Long nColumnPos = aTabCols.GetRight() - rCol.nEnd ;
aTabCols[i - 1] = nColumnPos;
aTabCols.SetHidden( i - 1, !rCol.bVisible );
}
@@ -1088,7 +1088,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
const SfxPoolItem *pBorderType;
const SfxPoolItem *pIndex;
const SfxPoolItem *pOffset;
- constexpr long constDistanceOffset = 40;
+ constexpr tools::Long constDistanceOffset = 40;
if (pReqArgs->GetItemState(SID_TABLE_BORDER_TYPE, true, &pBorderType) == SfxItemState::SET
&& pReqArgs->GetItemState(SID_TABLE_BORDER_INDEX, true, &pIndex) == SfxItemState::SET
@@ -1106,22 +1106,22 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if (sType == "column-left")
{
auto & rEntry = aTabCols.GetEntry(0);
- long nNewPosition = aTabCols.GetLeft() + long(nOffset);
- long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
+ tools::Long nNewPosition = aTabCols.GetLeft() + tools::Long(nOffset);
+ tools::Long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
aTabCols.SetLeft(nPosition);
}
else if (sType == "column-right")
{
auto & rEntry = aTabCols.GetEntry(aTabCols.Count() - 1);
- long nNewPosition = aTabCols.GetRight() + long(nOffset);
- long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
+ tools::Long nNewPosition = aTabCols.GetRight() + tools::Long(nOffset);
+ tools::Long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
aTabCols.SetRight(nPosition);
}
else if (sType == "column-middle" && nIndex < aTabCols.Count())
{
auto & rEntry = aTabCols.GetEntry(nIndex);
- long nNewPosition = rEntry.nPos + long(nOffset);
- long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
+ tools::Long nNewPosition = rEntry.nPos + tools::Long(nOffset);
+ tools::Long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
rEntry.nPos = nPosition;
}
@@ -1135,22 +1135,22 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if (sType == "row-left")
{
auto & rEntry = aTabRows.GetEntry(0);
- long nNewPosition = aTabRows.GetLeft() + long(nOffset);
- long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
+ tools::Long nNewPosition = aTabRows.GetLeft() + tools::Long(nOffset);
+ tools::Long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
aTabRows.SetLeft(nPosition);
}
else if (sType == "row-right")
{
auto & rEntry = aTabRows.GetEntry(aTabRows.Count() - 1);
- long nNewPosition = aTabRows.GetRight() + long(nOffset);
- long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
+ tools::Long nNewPosition = aTabRows.GetRight() + tools::Long(nOffset);
+ tools::Long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
aTabRows.SetRight(nPosition);
}
else if (sType == "row-middle" && nIndex < aTabRows.Count())
{
auto & rEntry = aTabRows.GetEntry(nIndex);
- long nNewPosition = rEntry.nPos + long(nOffset);
- long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
+ tools::Long nNewPosition = rEntry.nPos + tools::Long(nOffset);
+ tools::Long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
rEntry.nPos = nPosition;
}
@@ -1358,8 +1358,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
// PageOffset/limiter
const SwRect& rPageRect = rSh.GetAnyCurRect( CurRectType::Page, pPt );
const SwRect& rPagePrtRect = rSh.GetAnyCurRect( CurRectType::PagePrt, pPt );
- const long nPageWidth = rPageRect.Width();
- const long nPageHeight = rPageRect.Height();
+ const tools::Long nPageWidth = rPageRect.Width();
+ const tools::Long nPageHeight = rPageRect.Height();
const SwPageDesc& rDesc = rSh.GetPageDesc(
IsTabColFromDoc() || m_bTabRowFromDoc ?
@@ -1503,8 +1503,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
// Page margin top bottom
SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
- SvxLongULSpaceItem aLongUL( static_cast<long>(aUL.GetUpper()),
- static_cast<long>(aUL.GetLower()),
+ SvxLongULSpaceItem aLongUL( static_cast<tools::Long>(aUL.GetUpper()),
+ static_cast<tools::Long>(aUL.GetLower()),
SID_ATTR_LONG_ULSPACE);
if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY )
@@ -1541,8 +1541,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
SvxLongULSpaceItem aLongUL(
- static_cast<long>(aUL.GetUpper()),
- static_cast<long>(aUL.GetLower()),
+ static_cast<tools::Long>(aUL.GetUpper()),
+ static_cast<tools::Long>(aUL.GetLower()),
SID_ATTR_PAGE_ULSPACE );
rSet.Put( aLongUL );
@@ -1570,7 +1570,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
const SvxTabStopItem& rDefTabs = rSh.GetDefault(RES_PARATR_TABSTOP);
OSL_ENSURE(m_pHRuler, "why is there no ruler?");
- const long nDefTabDist = ::GetTabDist(rDefTabs);
+ const tools::Long nDefTabDist = ::GetTabDist(rDefTabs);
m_pHRuler->SetDefTabDist( nDefTabDist );
m_pVRuler->SetDefTabDist( nDefTabDist );
::lcl_EraseDefTabs(aTabStops);
@@ -1864,8 +1864,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxColumnItem aColItem(nNum, nL, nR);
- long nStart = 0;
- long nEnd = 0;
+ tools::Long nStart = 0;
+ tools::Long nEnd = 0;
//columns in right-to-left tables need to be mirrored
bool bIsTableRTL =
@@ -1980,9 +1980,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
const SwRect &rSizeRect = rSh.GetAnyCurRect(CurRectType::FlyEmbeddedPrt, pPt);
bool bUseVertical = bFrameHasVerticalColumns || (!bFrameSelection && bVerticalWriting);
- const long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width();
+ const tools::Long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width();
const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt);
- long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2;
+ tools::Long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2;
::lcl_FillSvxColumn(rCol, lWidth, aColItem, nDist2);
if(bUseVertical)
@@ -2016,7 +2016,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxColumnItem aColItem(nNum);
const SwRect aPrtRect = rSh.GetAnyCurRect(CurRectType::PagePrt, pPt);
const SvxBoxItem& rBox = rMaster.GetFormatAttr(RES_BOX);
- long nDist = rBox.GetSmallestDistance();
+ tools::Long nDist = rBox.GetSmallestDistance();
lcl_FillSvxColumn(
aCol,
@@ -2101,8 +2101,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxColumnItem aColItem(0, nL, nR);
- long nStart = 0;
- long nEnd = 0;
+ tools::Long nStart = 0;
+ tools::Long nEnd = 0;
for ( size_t i = 0; i < aTabCols.Count(); ++i )
{
@@ -2355,7 +2355,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
}
else
{
- long nLeft = rPagePrtRect.Left();
+ tools::Long nLeft = rPagePrtRect.Left();
aRectangle.SetLeft( nStart + nLeft );
aRectangle.SetRight( nPageWidth - nEnd - nLeft );
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index e28496725c5e..c77f92073b20 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1038,7 +1038,7 @@ static OUString lcl_CreateOutlineString( size_t nIndex,
nLevel <= pTextNd->GetActualListLevel();
nLevel++ )
{
- long nVal = aNumVector[nLevel];
+ tools::Long nVal = aNumVector[nLevel];
nVal ++;
nVal -= pOutlRule->Get(nLevel).GetStart();
sEntry.append(OUString::number( nVal ));
@@ -3132,7 +3132,7 @@ void SwXTextDocument::removePasteEventListener(
void SwXTextDocument::paintTile( VirtualDevice &rDevice,
int nOutputWidth, int nOutputHeight,
int nTilePosX, int nTilePosY,
- long nTileWidth, long nTileHeight )
+ tools::Long nTileWidth, tools::Long nTileHeight )
{
SwViewShell* pViewShell = m_pDocShell->GetWrtShell();
pViewShell->PaintTile(rDevice, nOutputWidth, nOutputHeight,
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 97317e9ed67c..6a0aa7edde25 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -901,11 +901,11 @@ awt::Point SwXTextViewCursor::getPosition()
const SwFrameFormat& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster();
const SvxULSpaceItem& rUL = rMaster.GetULSpace();
- const long nY = aCharRect.Top() - (rUL.GetUpper() + DOCUMENTBORDER);
+ const tools::Long nY = aCharRect.Top() - (rUL.GetUpper() + DOCUMENTBORDER);
aRet.Y = convertTwipToMm100(nY);
const SvxLRSpaceItem& rLR = rMaster.GetLRSpace();
- const long nX = aCharRect.Left() - (rLR.GetLeft() + DOCUMENTBORDER);
+ const tools::Long nX = aCharRect.Left() - (rLR.GetLeft() + DOCUMENTBORDER);
aRet.X = convertTwipToMm100(nX);
return aRet;
diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx
index 98c092246a81..334417377106 100644
--- a/sw/source/uibase/utlui/attrdesc.cxx
+++ b/sw/source/uibase/utlui/attrdesc.cxx
@@ -484,7 +484,7 @@ bool SwFormatCol::GetPresentation
rText = OUString::number(nCnt) + " " + SwResId( STR_COLUMNS );
if ( COLADJ_NONE != GetLineAdj() )
{
- const long nWdth = static_cast<long>(GetLineWidth());
+ const tools::Long nWdth = static_cast<tools::Long>(GetLineWidth());
rText += " " + SwResId( STR_LINE_WIDTH ) + " " +
::GetMetricText( nWdth, eCoreUnit,
MapUnit::MapPoint, &rIntl );
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index bc801c5af2d0..fad3aa2a4a2c 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -172,7 +172,7 @@ namespace
// Content, contains names and reference at the content type.
-SwContent::SwContent(const SwContentType* pCnt, const OUString& rName, long nYPos) :
+SwContent::SwContent(const SwContentType* pCnt, const OUString& rName, tools::Long nYPos) :
SwTypeNumber(CTYPE_CNT),
pParent(pCnt),
sContentName(rName),
@@ -807,7 +807,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
if (!pTemp->GetName().isEmpty())
{
SwContact* pContact = static_cast<SwContact*>(pTemp->GetUserCall());
- long nYPos = 0;
+ tools::Long nYPos = 0;
const Point aNullPt;
if(pContact && pContact->GetFormat())
nYPos = pContact->GetFormat()->FindLayoutRect(false, &aNullPt).Top();
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index 115f98fddc5e..88b2b27b344a 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -256,7 +256,7 @@ void SwNumFormatBase::SetFormatType(const SvNumFormatType nFormatType)
const sal_uInt32 nSysLongDateFormat = pFormatter->GetFormatIndex(
NF_DATE_SYSTEM_LONG, eCurLanguage );
- for( long nIndex = eOffsetStart; nIndex <= eOffsetEnd; ++nIndex )
+ for( tools::Long nIndex = eOffsetStart; nIndex <= eOffsetEnd; ++nIndex )
{
const sal_uInt32 nFormat = pFormatter->GetFormatIndex(
static_cast<NfIndexTableOffset>(nIndex), eCurLanguage );
diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx
index dbdf78b49ccb..dfe40700d726 100644
--- a/sw/source/uibase/utlui/shdwcrsr.cxx
+++ b/sw/source/uibase/utlui/shdwcrsr.cxx
@@ -29,7 +29,7 @@ SwShadowCursor::~SwShadowCursor()
DrawCursor( aOldPt, nOldHeight, nOldMode );
}
-void SwShadowCursor::SetPos( const Point& rPt, long nHeight, sal_uInt16 nMode )
+void SwShadowCursor::SetPos( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode )
{
Point aPt( pWin->LogicToPixel( rPt ));
nHeight = pWin->LogicToPixel( Size( 0, nHeight )).Height();
@@ -45,17 +45,17 @@ void SwShadowCursor::SetPos( const Point& rPt, long nHeight, sal_uInt16 nMode )
}
}
-void SwShadowCursor::DrawTri( const Point& rPt, long nHeight, bool bLeft )
+void SwShadowCursor::DrawTri( const Point& rPt, tools::Long nHeight, bool bLeft )
{
- long nLineDiff = nHeight / 2;
- long nLineDiffHalf = nLineDiff / 2;
+ tools::Long nLineDiff = nHeight / 2;
+ tools::Long nLineDiffHalf = nLineDiff / 2;
// Dot above
Point aPt1( (bLeft ? rPt.X() - 3 : rPt.X() + 3),
rPt.Y() + nLineDiffHalf );
// Dot below
Point aPt2( aPt1.X(), aPt1.Y() + nHeight - nLineDiff - 1 );
- long nDiff = bLeft ? -1 : 1;
+ tools::Long nDiff = bLeft ? -1 : 1;
while( aPt1.Y() <= aPt2.Y() )
{
pWin->DrawLine( aPt1, aPt2 );
@@ -65,7 +65,7 @@ void SwShadowCursor::DrawTri( const Point& rPt, long nHeight, bool bLeft )
}
}
-void SwShadowCursor::DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMode )
+void SwShadowCursor::DrawCursor( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode )
{
nHeight = (((nHeight / 4)+1) * 4) + 1;
@@ -97,11 +97,11 @@ void SwShadowCursor::Paint()
tools::Rectangle SwShadowCursor::GetRect() const
{
- long nH = nOldHeight;
+ tools::Long nH = nOldHeight;
Point aPt( aOldPt );
nH = (((nH / 4)+1) * 4) + 1;
- long nWidth = nH / 4 + 3 + 1;
+ tools::Long nWidth = nH / 4 + 3 + 1;
Size aSz( nWidth, nH );
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index fbb098e74605..de816541cb07 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -86,7 +86,7 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
Fraction aTmp( 100, 1 );
aTmp *= aFootnoteInfo.GetWidth();
- rVal <<= static_cast<sal_Int8>(static_cast<long>(aTmp));
+ rVal <<= static_cast<sal_Int8>(static_cast<tools::Long>(aTmp));
}
break;
case MID_LINE_ADJUST : rVal <<= static_cast<sal_Int16>(aFootnoteInfo.GetAdj());break;//text::HorizontalAdjust
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index bdb18bbb376e..9f010e73861d 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -96,12 +96,12 @@ void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt )
const bool bAutomatic = 1 == mpImpl->mnState;
const bool bBookMode = 2 == mpImpl->mnState;
- const long nImageWidthSum = mpImpl->maImageSingleColumn.GetSizePixel().Width() +
+ const tools::Long nImageWidthSum = mpImpl->maImageSingleColumn.GetSizePixel().Width() +
mpImpl->maImageAutomatic.GetSizePixel().Width() +
mpImpl->maImageBookMode.GetSizePixel().Width();
- const long nXOffset = (aRect.GetWidth() - nImageWidthSum) / 2;
- const long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height()) / 2;
+ const tools::Long nXOffset = (aRect.GetWidth() - nImageWidthSum) / 2;
+ const tools::Long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height()) / 2;
aRect.AdjustLeft( nXOffset );
aRect.AdjustTop( nYOffset );
@@ -122,17 +122,17 @@ bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt )
{
const tools::Rectangle aRect = getControlRect();
const Point aPoint = rEvt.GetPosPixel();
- const long nXDiff = aPoint.X() - aRect.Left();
+ const tools::Long nXDiff = aPoint.X() - aRect.Left();
sal_uInt16 nColumns = 1;
bool bBookMode = false;
- const long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width();
- const long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width();
- const long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width();
- const long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
+ const tools::Long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width();
+ const tools::Long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width();
+ const tools::Long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width();
+ const tools::Long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
- const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2;
+ const tools::Long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2;
if ( nXDiff < nXOffset + nImageWidthSingle )
{
@@ -170,14 +170,14 @@ bool SwViewLayoutControl::MouseMove( const MouseEvent & rEvt )
{
const tools::Rectangle aRect = getControlRect();
const Point aPoint = rEvt.GetPosPixel();
- const long nXDiff = aPoint.X() - aRect.Left();
+ const tools::Long nXDiff = aPoint.X() - aRect.Left();
- const long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width();
- const long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width();
- const long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width();
- const long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
+ const tools::Long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width();
+ const tools::Long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width();
+ const tools::Long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width();
+ const tools::Long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
- const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2;
+ const tools::Long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2;
if ( nXDiff < nXOffset + nImageWidthSingle )
{
diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx
index 14070c71ef8e..491a2fcbdb2a 100644
--- a/sw/source/uibase/wrtsh/move.cxx
+++ b/sw/source/uibase/wrtsh/move.cxx
@@ -37,7 +37,7 @@
- EndSelect()
*/
-const long nReadOnlyScrollOfst = 10;
+const tools::Long nReadOnlyScrollOfst = 10;
namespace {
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index dc47cb73acdb..2c61e51c1deb 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -46,7 +46,7 @@ namespace com::sun::star::util {
using namespace ::com::sun::star::util;
-static long nStartDragX = 0, nStartDragY = 0;
+static tools::Long nStartDragX = 0, nStartDragY = 0;
static bool bStartDrag = false;
void SwWrtShell::Invalidate()
@@ -300,7 +300,7 @@ void SwWrtShell::PopMode()
// eponymous methods in the CursorShell, the second removes
// all selections at first.
-long SwWrtShell::SetCursor(const Point *pPt, bool bTextOnly)
+tools::Long SwWrtShell::SetCursor(const Point *pPt, bool bTextOnly)
{
// Remove a possibly present selection at the position
// of the mouseclick
@@ -312,7 +312,7 @@ long SwWrtShell::SetCursor(const Point *pPt, bool bTextOnly)
return SwCursorShell::SetCursor(*pPt, bTextOnly);
}
-long SwWrtShell::SetCursorKillSel(const Point *pPt, bool bTextOnly )
+tools::Long SwWrtShell::SetCursorKillSel(const Point *pPt, bool bTextOnly )
{
SwActContext aActContext(this);
ResetSelect(pPt,false);
@@ -329,7 +329,7 @@ void SwWrtShell::UnSelectFrame()
// Remove of all selections
-long SwWrtShell::ResetSelect(const Point *,bool)
+tools::Long SwWrtShell::ResetSelect(const Point *,bool)
{
if(IsSelFrameMode())
{
@@ -375,7 +375,7 @@ void SwWrtShell::SetSplitVerticalByDefault(bool value)
// Do nothing
-long SwWrtShell::Ignore(const Point *, bool ) {
+tools::Long SwWrtShell::Ignore(const Point *, bool ) {
return 1;
}
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 69fad015bbde..5fb1b42f75d2 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -611,7 +611,7 @@ bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrame
// The current selected OLE object will be loaded with the
// verb into the server.
-void SwWrtShell::LaunchOLEObj( long nVerb )
+void SwWrtShell::LaunchOLEObj( tools::Long nVerb )
{
if ( GetCntType() != CNT_OLE ||
GetView().GetViewFrame()->GetFrame().IsInPlace() )
@@ -810,7 +810,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
aObjArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ).SSize();
// differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
- long nX, nY;
+ tools::Long nX, nY;
SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
_aVisArea.Width() + nX >= aObjArea.Width() &&
@@ -863,8 +863,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
{
- aArea.Width ( long( aArea.Width() / pCli->GetScaleWidth() ) );
- aArea.Height( long( aArea.Height() / pCli->GetScaleHeight() ) );
+ aArea.Width ( tools::Long( aArea.Width() / pCli->GetScaleWidth() ) );
+ aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) );
}
pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );