summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/viewer/mediawindow_impl.cxx2
-rw-r--r--canvas/source/vcl/spritehelper.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx8
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx8
-rw-r--r--cui/source/options/optcolor.cxx2
-rw-r--r--cui/source/options/optjava.cxx2
-rw-r--r--cui/source/tabpages/tpbitmap.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/JoinController.cxx8
-rw-r--r--editeng/source/editeng/editdbg.cxx16
-rw-r--r--editeng/source/editeng/editeng.cxx6
-rw-r--r--editeng/source/editeng/impedit2.cxx8
-rw-r--r--editeng/source/editeng/impedit3.cxx12
-rw-r--r--emfio/source/reader/emfreader.cxx8
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx4
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx22
-rw-r--r--include/tools/gen.hxx225
-rw-r--r--include/vcl/fixed.hxx4
-rw-r--r--include/vcl/outdev.hxx12
-rw-r--r--include/vcl/salbtype.hxx8
-rw-r--r--include/vcl/salgtype.hxx24
-rw-r--r--oox/source/export/vmlexport.cxx8
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx2
-rw-r--r--sc/qa/unit/bugfix-test.cxx4
-rw-r--r--sc/qa/unit/filters-test.cxx8
-rw-r--r--sc/qa/unit/helper/qahelper.cxx4
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx2
-rw-r--r--sc/source/core/data/drawpage.cxx2
-rw-r--r--sc/source/filter/excel/xepage.cxx4
-rw-r--r--sc/source/filter/html/htmlexp2.cxx8
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx3
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx8
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx6
-rw-r--r--sc/source/ui/cctrl/cbuttonw.cxx2
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx4
-rw-r--r--sc/source/ui/docshell/docsh4.cxx20
-rw-r--r--sc/source/ui/docshell/docsh6.cxx6
-rw-r--r--sc/source/ui/view/hdrcont.cxx8
-rw-r--r--sc/source/ui/view/printfun.cxx4
-rw-r--r--sc/source/ui/view/tabview3.cxx4
-rw-r--r--sd/qa/unit/import-tests.cxx14
-rw-r--r--sd/source/ui/slidesorter/view/SlsFramePainter.cxx8
-rw-r--r--sd/source/ui/unoidl/unopage.cxx4
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx4
-rw-r--r--sd/source/ui/view/drviews3.cxx2
-rw-r--r--sd/source/ui/view/frmview.cxx24
-rw-r--r--sfx2/source/appl/newhelp.cxx2
-rw-r--r--sfx2/source/doc/iframe.cxx4
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx2
-rw-r--r--starmath/source/view.cxx2
-rw-r--r--svtools/source/brwbox/brwbox1.cxx4
-rw-r--r--svtools/source/brwbox/brwbox2.cxx8
-rw-r--r--svtools/source/brwbox/brwbox3.cxx2
-rw-r--r--svtools/source/brwbox/datwin.cxx2
-rw-r--r--svtools/source/contnr/imivctl.hxx4
-rw-r--r--svtools/source/contnr/imivctl1.cxx10
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/ctrlbox.cxx2
-rw-r--r--svtools/source/control/scriptedtext.cxx6
-rw-r--r--svtools/source/control/toolbarmenu.cxx6
-rw-r--r--svtools/source/control/valueset.cxx2
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx2
-rw-r--r--svtools/source/misc/imap2.cxx8
-rw-r--r--svtools/source/svhtml/htmlout.cxx20
-rw-r--r--svx/source/dialog/pagectrl.cxx2
-rw-r--r--svx/source/dialog/swframeexample.cxx4
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx4
-rw-r--r--svx/source/fmcomp/fmgridif.cxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx4
-rw-r--r--svx/source/sidebar/PanelLayout.cxx4
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx2
-rw-r--r--sw/inc/ndarr.hxx2
-rw-r--r--sw/inc/swrect.hxx140
-rw-r--r--sw/inc/swtypes.hxx6
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx2
-rw-r--r--sw/qa/extras/rtfexport/rtfexport2.cxx4
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx4
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx4
-rw-r--r--sw/source/core/access/acccontext.cxx2
-rw-r--r--sw/source/core/bastyp/swrect.cxx70
-rw-r--r--sw/source/core/bastyp/tabcol.cxx2
-rw-r--r--sw/source/core/doc/htmltbl.cxx4
-rw-r--r--sw/source/core/doc/notxtfrm.cxx6
-rw-r--r--sw/source/core/doc/tblrwcl.cxx6
-rw-r--r--sw/source/core/docnode/ndtbl.cxx14
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx4
-rw-r--r--sw/source/core/draw/dflyobj.cxx2
-rw-r--r--sw/source/core/frmedt/fefly1.cxx2
-rw-r--r--sw/source/core/frmedt/feshview.cxx4
-rw-r--r--sw/source/core/frmedt/fetab.cxx4
-rw-r--r--sw/source/core/frmedt/tblsel.cxx10
-rw-r--r--sw/source/core/inc/frame.hxx126
-rw-r--r--sw/source/core/inc/frmtool.hxx4
-rw-r--r--sw/source/core/inc/tabfrm.hxx4
-rw-r--r--sw/source/core/layout/calcmove.cxx24
-rw-r--r--sw/source/core/layout/colfrm.cxx4
-rw-r--r--sw/source/core/layout/flowfrm.cxx8
-rw-r--r--sw/source/core/layout/fly.cxx14
-rw-r--r--sw/source/core/layout/flycnt.cxx38
-rw-r--r--sw/source/core/layout/flylay.cxx10
-rw-r--r--sw/source/core/layout/frmtool.cxx2
-rw-r--r--sw/source/core/layout/ftnfrm.cxx20
-rw-r--r--sw/source/core/layout/hffrm.cxx4
-rw-r--r--sw/source/core/layout/newfrm.cxx10
-rw-r--r--sw/source/core/layout/pagechg.cxx18
-rw-r--r--sw/source/core/layout/paintfrm.cxx16
-rw-r--r--sw/source/core/layout/sectfrm.cxx10
-rw-r--r--sw/source/core/layout/ssfrm.cxx28
-rw-r--r--sw/source/core/layout/tabfrm.cxx90
-rw-r--r--sw/source/core/layout/trvlfrm.cxx8
-rw-r--r--sw/source/core/layout/wsfrm.cxx30
-rw-r--r--sw/source/core/text/frmcrsr.cxx12
-rw-r--r--sw/source/core/text/frmform.cxx4
-rw-r--r--sw/source/core/text/itrcrsr.cxx8
-rw-r--r--sw/source/core/text/itrform2.cxx10
-rw-r--r--sw/source/core/text/txtfly.cxx4
-rw-r--r--sw/source/core/text/txtfrm.cxx6
-rw-r--r--sw/source/core/text/txtftn.cxx6
-rw-r--r--sw/source/core/text/widorp.cxx2
-rw-r--r--sw/source/core/text/xmldump.cxx24
-rw-r--r--sw/source/core/unocore/unostyle.cxx4
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx6
-rw-r--r--sw/source/core/view/viewsh.cxx14
-rw-r--r--sw/source/core/view/vnew.cxx2
-rw-r--r--sw/source/filter/basflt/shellio.cxx4
-rw-r--r--sw/source/filter/html/css1atr.cxx4
-rw-r--r--sw/source/filter/html/htmldrawwriter.cxx4
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx16
-rw-r--r--sw/source/filter/html/htmlforw.cxx14
-rw-r--r--sw/source/filter/html/htmlplug.cxx4
-rw-r--r--sw/source/filter/html/htmltabw.cxx8
-rw-r--r--sw/source/filter/html/swhtml.cxx2
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx26
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx8
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx4
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx6
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par.hxx2
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx12
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx2
-rw-r--r--sw/source/filter/xml/xmltexte.cxx4
-rw-r--r--sw/source/filter/xml/xmltexti.cxx4
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx4
-rw-r--r--sw/source/ui/envelp/label1.cxx2
-rw-r--r--sw/source/ui/fldui/flddok.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx20
-rw-r--r--sw/source/ui/index/cnttab.cxx2
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx4
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx4
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx8
-rw-r--r--sw/source/uibase/frmdlg/frmmgr.cxx14
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx6
-rw-r--r--sw/source/uibase/ribbar/drawbase.cxx4
-rw-r--r--sw/source/uibase/shells/textsh.cxx4
-rw-r--r--sw/source/uibase/table/tablemgr.cxx2
-rw-r--r--sw/source/uibase/uiview/swcli.cxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx4
-rw-r--r--sw/source/uibase/uiview/view2.cxx2
-rw-r--r--sw/source/uibase/uiview/viewport.cxx18
-rw-r--r--sw/source/uibase/wrtsh/select.cxx2
-rw-r--r--tools/qa/cppunit/test_rectangle.cxx24
-rw-r--r--tools/source/generic/gen.cxx4
-rw-r--r--tools/source/generic/point.cxx22
-rw-r--r--vcl/headless/svpframe.cxx2
-rw-r--r--vcl/inc/headless/svpframe.hxx2
-rw-r--r--vcl/inc/osx/salframe.h2
-rw-r--r--vcl/inc/osx/salprn.h2
-rw-r--r--vcl/inc/salframe.hxx2
-rw-r--r--vcl/inc/salgdi.hxx38
-rw-r--r--vcl/inc/salprn.hxx2
-rw-r--r--vcl/inc/unx/genprn.h2
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx2
-rw-r--r--vcl/inc/unx/salbmp.h10
-rw-r--r--vcl/inc/unx/salframe.h2
-rw-r--r--vcl/opengl/gdiimpl.cxx16
-rw-r--r--vcl/osx/salframe.cxx2
-rw-r--r--vcl/osx/salprn.cxx2
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx36
-rw-r--r--vcl/qa/cppunit/graphicfilter/filters-test.cxx6
-rw-r--r--vcl/qa/cppunit/jpeg/JpegReaderTest.cxx12
-rw-r--r--vcl/source/control/button.cxx2
-rw-r--r--vcl/source/control/combobox.cxx4
-rw-r--r--vcl/source/control/edit.cxx12
-rw-r--r--vcl/source/control/field.cxx2
-rw-r--r--vcl/source/control/field2.cxx18
-rw-r--r--vcl/source/control/fixed.cxx2
-rw-r--r--vcl/source/control/imp_listbox.cxx6
-rw-r--r--vcl/source/control/listbox.cxx2
-rw-r--r--vcl/source/control/notebookbar.cxx4
-rw-r--r--vcl/source/control/tabctrl.cxx8
-rw-r--r--vcl/source/gdi/bmpacc.cxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx64
-rw-r--r--vcl/source/gdi/salgdilayout.cxx36
-rw-r--r--vcl/source/graphic/GraphicObject.cxx4
-rw-r--r--vcl/source/outdev/rect.cxx4
-rw-r--r--vcl/source/outdev/text.cxx8
-rw-r--r--vcl/source/outdev/textline.cxx16
-rw-r--r--vcl/source/window/layout.cxx4
-rw-r--r--vcl/source/window/menu.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx18
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/source/window/winproc.cxx4
-rw-r--r--vcl/unx/generic/app/i18n_status.cxx2
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx10
-rw-r--r--vcl/unx/generic/print/common_gfx.cxx21
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx2
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx2
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx4
213 files changed, 1120 insertions, 1117 deletions
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index 1d1f5fe946cb..f8864d92c3ca 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -530,7 +530,7 @@ void MediaWindowImpl::Resize()
if (mpMediaWindowControl)
{
const sal_Int32 nControlHeight = mpMediaWindowControl->GetSizePixel().Height();
- const sal_Int32 nControlY = std::max(aCurSize.Height() - nControlHeight - nOffset, 0L);
+ const sal_Int32 nControlY = std::max<sal_Int32>(aCurSize.Height() - nControlHeight - nOffset, 0);
aPlayerWindowSize.setHeight( nControlY - (nOffset << 1) );
mpMediaWindowControl->SetPosSizePixel(Point(nOffset, nControlY ), Size(aCurSize.Width() - (nOffset << 1), nControlHeight));
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 366d0a5b9829..f8f3a59b0fa2 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -306,7 +306,7 @@ namespace vclcanvas
// paint sprite prio
vcl::Font aVCLFont;
- aVCLFont.SetFontHeight( std::min(long(20),aOutputSize.Height()) );
+ aVCLFont.SetFontHeight( std::min<sal_Int32>(20,aOutputSize.Height()) );
aVCLFont.SetColor( COL_RED );
rTargetSurface.SetTextAlign(ALIGN_TOP);
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 83dfc4a1a0c0..4225a269c535 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -2035,10 +2035,10 @@ void ChartController::sendPopupRequest(OUString const & rCID, tools::Rectangle a
sal_Int32 nDimensionIndex = sDimensionIndex.toInt32();
awt::Rectangle xRectangle {
- sal_Int32(aRectangle.Left()),
- sal_Int32(aRectangle.Top()),
- sal_Int32(aRectangle.GetWidth()),
- sal_Int32(aRectangle.GetHeight())
+ aRectangle.Left(),
+ aRectangle.Top(),
+ aRectangle.GetWidth(),
+ aRectangle.GetHeight()
};
uno::Sequence<beans::PropertyValue> aCallbackData = comphelper::InitPropertySequence(
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 806353dbe543..01d479a27449 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -1564,8 +1564,8 @@ namespace cppcanvas
// least one dimension
// Remark the 1L cannot be replaced, that would cause max to compare long/int
- const Size aMtfSizePix( std::max( aMtfSizePixPre.Width(), 1L ),
- std::max( aMtfSizePixPre.Height(), 1L ) );
+ const Size aMtfSizePix( std::max<sal_Int32>( aMtfSizePixPre.Width(), 1 ),
+ std::max<sal_Int32>( aMtfSizePixPre.Height(), 1 ) );
// Setup local transform, such that the
// metafile renders itself into the given
@@ -2878,8 +2878,8 @@ namespace cppcanvas
// #i44110# correct null-sized output - there are shapes
// which have zero size in at least one dimension
// Remark the 1L cannot be replaced, that would cause max to compare long/int
- const Size aMtfSizePix( std::max( aMtfSizePixPre.Width(), 1L ),
- std::max( aMtfSizePixPre.Height(), 1L ) );
+ const Size aMtfSizePix( std::max<sal_Int32>( aMtfSizePixPre.Width(), 1 ),
+ std::max<sal_Int32>( aMtfSizePixPre.Height(), 1 ) );
sal_Int32 nCurrActions(0);
ActionFactoryParameters aParms(aStateStack,
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index a273888772c6..ca131aec41d8 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -508,7 +508,7 @@ void ColorConfigWindow_Impl::CreateEntries()
ScopedVclPtrInstance< FixedText > aFixedText(this);
aCheckBox->SetText(sSampleText);
aFixedText->SetText(sSampleText);
- Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff));
+ Size aCheckSize(aCheckBox->CalcMinimumSize(RECT_MAX));
Size aFixedSize(aFixedText->CalcMinimumSize());
nCheckBoxLabelOffset = aCheckSize.Width() - aFixedSize.Width();
}
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 79e210f125a3..79df56db16b4 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -82,7 +82,7 @@ public:
HeaderBar &rBar = GetTheHeaderBar();
if (rBar.GetItemCount() < 4)
return;
- long nCheckWidth = std::max(GetControlColumnWidth() + 12,
+ long nCheckWidth = std::max<sal_Int32>(GetControlColumnWidth() + 12,
rBar.LogicToPixel(Size(15, 0), MapMode(MapUnit::MapAppFont)).Width());
long nVersionWidth = 12 +
std::max(rBar.GetTextWidth(rBar.GetItemText(3)),
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 1d0854cbe255..5b46a5ba2fbf 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -316,8 +316,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
{
BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
Size aTempBitmapSize = aBmpEx.GetSizePixel();
- rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
- rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
+ rBitmapSize.setWidth( (OutputDevice::LogicToLogic(aTempBitmapSize.Width(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
+ rBitmapSize.setHeight( (OutputDevice::LogicToLogic(aTempBitmapSize.Height(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
CalculateBitmapPresetSize();
}
@@ -531,8 +531,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
Size aTempBitmapSize = aBmpEx.GetSizePixel();
const double fUIScale = ( (mpView && mpView->GetModel()) ? double(mpView->GetModel()->GetUIScale()) : 1.0);
- rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
- rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
+ rBitmapSize.setWidth( (OutputDevice::LogicToLogic(aTempBitmapSize.Width(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
+ rBitmapSize.setHeight( (OutputDevice::LogicToLogic(aTempBitmapSize.Height(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
CalculateBitmapPresetSize();
ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
ModifyBitmapPositionHdl( *m_pPositionLB );
diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx
index 8e056acb2186..7ba38b159bb1 100644
--- a/dbaccess/source/ui/querydesign/JoinController.cxx
+++ b/dbaccess/source/ui/querydesign/JoinController.cxx
@@ -394,10 +394,10 @@ void OJoinController::saveTableWindows( ::comphelper::NamedValueCollection& o_rV
aWindowData.put( "ComposedName", elem->GetComposedName() );
aWindowData.put( "TableName", elem->GetTableName() );
aWindowData.put( "WindowName", elem->GetWinName() );
- aWindowData.put( "WindowTop", static_cast<sal_Int32>(elem->GetPosition().Y()) );
- aWindowData.put( "WindowLeft", static_cast<sal_Int32>(elem->GetPosition().X()) );
- aWindowData.put( "WindowWidth", static_cast<sal_Int32>(elem->GetSize().Width()) );
- aWindowData.put( "WindowHeight", static_cast<sal_Int32>(elem->GetSize().Height()) );
+ aWindowData.put( "WindowTop", elem->GetPosition().Y() );
+ aWindowData.put( "WindowLeft", elem->GetPosition().X() );
+ aWindowData.put( "WindowWidth", elem->GetSize().Width() );
+ aWindowData.put( "WindowHeight", elem->GetSize().Height() );
aWindowData.put( "ShowAll", elem->IsShowAll() );
const OUString sTableName( "Table" + OUString::number( i++ ) );
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 3dbdadb6af22..6b929d7f1358 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -212,7 +212,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
- aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
+ aDebStr.append(aSz.Height());
}
break;
case EE_CHAR_FONTWIDTH:
@@ -282,7 +282,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
- aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
+ aDebStr.append(aSz.Height());
}
break;
case EE_CHAR_WLM:
@@ -389,7 +389,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
aPortionStr.append(' ');
aPortionStr.append(rPortion.GetLen());
aPortionStr.append('(');
- aPortionStr.append(static_cast<sal_Int32>(rPortion.GetSize().Width()));
+ aPortionStr.append(rPortion.GetSize().Width());
aPortionStr.append(')');
aPortionStr.append('[');
aPortionStr.append(static_cast<sal_Int32>(rPortion.GetKind()));
@@ -456,9 +456,9 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
fprintf( fp, "\n================================================================================" );
fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
fprintf( fp, "\nRefMapMode: %i", int( pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
- fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
- fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
- fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
+ fprintf( fp, "\nPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
+ fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
+ fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() );
for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ )
@@ -467,9 +467,9 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
DBG_ASSERT( pV, "View not found!" );
fprintf( fp, "\nView %zu: Focus=%i", nView, pV->GetWindow()->HasFocus() );
tools::Rectangle aR( pV->GetOutputArea() );
- fprintf( fp, "\n OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
+ fprintf( fp, "\n OutputArea: nX=%" SAL_PRIdINT32 ", nY=%" SAL_PRIdINT32 ", dX=%" SAL_PRIdINT32 ", dY=%" SAL_PRIdINT32 ", MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
aR = pV->GetVisArea();
- fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
+ fprintf( fp, "\n VisArea: nX=%" SAL_PRIdINT32 ", nY=%" SAL_PRIdINT32 ", dX=%" SAL_PRIdINT32 ", dY=%" SAL_PRIdINT32, aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
ESelection aSel = pV->GetSelection();
fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
}
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 5566d31c7f9c..6c6a0257993f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1790,17 +1790,17 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )
void EditEngine::StripPortions()
{
ScopedVclPtrInstance< VirtualDevice > aTmpDev;
- tools::Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) );
+ tools::Rectangle aBigRect( Point( 0, 0 ), Size( RECT_MAX, RECT_MAX ) );
if ( IsVertical() )
{
if( IsTopToBottom() )
{
aBigRect.SetRight( 0 );
- aBigRect.SetLeft( -0x7FFFFFFF );
+ aBigRect.SetLeft( RECT_MIN );
}
else
{
- aBigRect.SetTop( -0x7FFFFFFF );
+ aBigRect.SetTop( RECT_MIN );
aBigRect.SetBottom( 0 );
}
}
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index ae4290f7eeb9..9d5658a68109 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -87,9 +87,9 @@ static sal_uInt16 lcl_CalcExtraSpace( const SvxLineSpacingItem& rLSItem )
ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
pSharedVCL(EditDLL::Get().GetSharedVclResources()),
- aPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ),
+ aPaperSize( RECT_MAX, RECT_MAX ),
aMinAutoPaperSize( 0x0, 0x0 ),
- aMaxAutoPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ),
+ aMaxAutoPaperSize( RECT_MAX, RECT_MAX ),
aEditDoc( pItemPool ),
aWordDelimiters(" .,;:-`'?!_=\"{}()[]"),
bKernAsianPunctuation(false),
@@ -4251,9 +4251,9 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz )
aPaperSize = rNewSz;
long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0;
- long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF;
+ long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : RECT_MAX;
long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0;
- long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF;
+ long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : RECT_MAX;
// Minimum/Maximum width:
if ( aPaperSize.Width() < nMinWidth )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 7cc6dfddb695..369017cac794 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -404,7 +404,7 @@ void ImpEditEngine::FormatDoc()
if ( aInvalidRect.IsEmpty() )
{
// For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()...
- long nWidth = std::max( long(1), ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
+ long nWidth = std::max<sal_Int32>( 1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
Range aInvRange( GetInvalidYOffsets( pParaPortion ) );
aInvalidRect = tools::Rectangle( Point( 0, nY+aInvRange.Min() ),
Size( nWidth, aInvRange.Len() ) );
@@ -733,7 +733,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
if ( aBulletArea.Right() > 0 )
- pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( aBulletArea.Right() )) );
+ pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( long(aBulletArea.Right()) )) );
else
pParaPortion->SetBulletX( 0 ); // if Bullet is set incorrectly
}
@@ -1711,7 +1711,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
{
aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
if ( aBulletArea.Right() > 0 )
- pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( aBulletArea.Right() )) );
+ pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( long(aBulletArea.Right()) )) );
else
pParaPortion->SetBulletX( 0 ); // If Bullet set incorrectly.
if ( pParaPortion->GetBulletX() > nStartX )
@@ -4038,8 +4038,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew
{
// in this case one can redraw directly without invalidating the
// Portions
- sal_Int32 nFirstPortion = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
- sal_Int32 nLastPortion = std::max( static_cast<sal_Int32>(aOldPositions.Max()), nNewPos );
+ sal_Int32 nFirstPortion = std::min( aOldPositions.Min(), nNewPos );
+ sal_Int32 nLastPortion = std::max( aOldPositions.Max(), nNewPos );
ParaPortion* pUpperPortion = GetParaPortions().SafeGetObject( nFirstPortion );
ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion );
@@ -4057,7 +4057,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew
else
{
// redraw from the upper invalid position
- sal_Int32 nFirstInvPara = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
+ sal_Int32 nFirstInvPara = std::min( aOldPositions.Min(), nNewPos );
InvalidateFromParagraph( nFirstInvPara );
}
return aSel;
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 1d62fb1e342d..e1cf68d5669e 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -750,6 +750,9 @@ namespace emfio
case EMR_SETWINDOWEXTEX :
{
mpInputStream->ReadUInt32( nW ).ReadUInt32( nH );
+ // clamp to valid range
+ nW = std::max<sal_Int32>(std::min<sal_Int32>(nW, RECT_MAX), RECT_MIN);
+ nH = std::max<sal_Int32>(std::min<sal_Int32>(nH, RECT_MAX), RECT_MIN);
SetWinExt( Size( nW, nH ), true);
}
break;
@@ -1926,6 +1929,11 @@ namespace emfio
SetrclFrame(rclFrame);
SetrclBounds(rclBounds);
+ // clamp to valid range
+ nPixX = std::max<sal_Int32>(std::min<sal_Int32>(nPixX, RECT_MAX), RECT_MIN);
+ nPixY = std::max<sal_Int32>(std::min<sal_Int32>(nPixY, RECT_MAX), RECT_MIN);
+ nMillX = std::max<sal_Int32>(std::min<sal_Int32>(nMillX, RECT_MAX), RECT_MIN);
+ nMillY = std::max<sal_Int32>(std::min<sal_Int32>(nMillY, RECT_MAX), RECT_MIN);
SetRefPix(Size( nPixX, nPixY ) );
SetRefMill(Size( nMillX, nMillY ) );
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 3eed6268f3f0..1c3cf233d12e 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -2343,7 +2343,7 @@ bool LayoutManager::implts_doLayout( bool bForceRequestBorderSpace, bool bOuterR
// Position the status bar
if ( aStatusBarSize.Height() > 0 )
{
- implts_setStatusBarPosSize( ::Point( 0, std::max(( aContainerSize.Height() ), long( 0 ))),
+ implts_setStatusBarPosSize( ::Point( 0, std::max<sal_Int32>( aContainerSize.Height(), 0 )),
::Size( aContainerSize.Width(),aStatusBarSize.Height() ));
}
@@ -2466,7 +2466,7 @@ void LayoutManager::implts_setDockingAreaWindowSizes()
// Position the status bar
if ( aStatusBarSize.Height() > 0 )
{
- implts_setStatusBarPosSize( ::Point( 0, std::max(( aContainerClientSize.Height - aStatusBarSize.Height() ), long( 0 ))),
+ implts_setStatusBarPosSize( ::Point( 0, std::max<sal_Int32>(( aContainerClientSize.Height - aStatusBarSize.Height() ), 0)),
::Size( aContainerClientSize.Width, aStatusBarSize.Height() ));
}
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index e8925e9de098..2048f9a9b3ae 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -2211,7 +2211,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D
if ( nSpace > 0 )
{
- sal_Int32 nMove = std::min( nSpace, static_cast<sal_Int32>(aFrontDockingRect.getWidth()) );
+ sal_Int32 nMove = std::min( nSpace, aFrontDockingRect.getWidth() );
if ( bHorzDockArea )
aFrontDockingRect.Move( -nMove, 0 );
else
@@ -2700,7 +2700,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
if ( bHorizontalDockArea )
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( aContainerWinSize.Width() - aWindowRect.Left() ),
- sal_Int32( aTrackingRect.getWidth() )));
+ aTrackingRect.getWidth() ));
if ( nSize == 0 )
nSize = aWindowRect.getWidth();
@@ -2715,7 +2715,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32(
nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Top() ),
- sal_Int32( aTrackingRect.getHeight() )));
+ aTrackingRect.getHeight() ));
if ( nSize == 0 )
nSize = aWindowRect.getHeight();
@@ -2737,7 +2737,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
if ( bHorizontalDockArea )
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32(( aContainerWinSize.Width() ) - aWindowRect.Right() ),
- sal_Int32( aTrackingRect.getWidth() )));
+ aTrackingRect.getWidth() ));
if ( nSize == 0 )
{
aUIElementRect.SetPos( ::Point( aContainerWinSize.Width() - aTrackingRect.getWidth(), aWindowRect.Top() ));
@@ -2758,7 +2758,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
else
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Bottom() ),
- sal_Int32( aTrackingRect.getHeight() )));
+ aTrackingRect.getHeight() ));
aUIElementRect.SetPos( ::Point( aWindowRect.Left(), aWindowRect.Bottom() ));
aUIElementRect.SetSize( ::Size( aWindowRect.getWidth(), nSize ));
@@ -2852,14 +2852,14 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
if ( bHorizontalDockArea )
{
- sal_Int32 nPosX( std::max( sal_Int32( rTrackingRect.Left()), sal_Int32( 0 )));
+ sal_Int32 nPosX( std::max( rTrackingRect.Left(), sal_Int32( 0 )));
if (( nPosX + rTrackingRect.getWidth()) > aContainerWinSize.Width() )
nPosX = std::min( nPosX,
std::max( sal_Int32( aContainerWinSize.Width() - rTrackingRect.getWidth() ),
sal_Int32( 0 )));
sal_Int32 nSize = std::min( aContainerWinSize.Width(), rTrackingRect.getWidth() );
- sal_Int32 nDockHeight = std::max( static_cast<sal_Int32>(aDockingAreaRect.getHeight()), sal_Int32( 0 ));
+ sal_Int32 nDockHeight = std::max<sal_Int32>( aDockingAreaRect.getHeight(), 0 );
if ( nDockHeight == 0 )
{
sal_Int32 nPosY( std::max( aDockingAreaRect.Top(), aDockingAreaRect.Bottom() ));
@@ -2904,8 +2904,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
std::max<sal_Int32>( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ),
nTopDockingAreaSize ));
- sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast<sal_Int32>(aTrackingRect.getHeight()) );
- sal_Int32 nDockWidth = std::max( static_cast<sal_Int32>(aDockingAreaRect.getWidth()), sal_Int32( 0 ));
+ sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() );
+ sal_Int32 nDockWidth = std::max<sal_Int32>( aDockingAreaRect.getWidth(), 0 );
if ( nDockWidth == 0 )
{
sal_Int32 nPosX( std::max( aDockingAreaRect.Left(), aDockingAreaRect.Right() ));
@@ -3009,7 +3009,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d
::tools::Rectangle aTrackingRect( rTrackingRect );
if ( bHorizontalDockArea )
{
- sal_Int32 nPosX( std::max( sal_Int32( rTrackingRect.Left()), sal_Int32( 0 )));
+ sal_Int32 nPosX( std::max<sal_Int32>( rTrackingRect.Left(), 0 ));
if (( nPosX + rTrackingRect.getWidth()) > rContainerWinSize.Width() )
nPosX = std::min( nPosX,
std::max( sal_Int32( rContainerWinSize.Width() - rTrackingRect.getWidth() ),
@@ -3035,7 +3035,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d
std::max<sal_Int32>( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ),
nTopDockingAreaSize ));
- sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast<sal_Int32>(aTrackingRect.getHeight()) );
+ sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() );
aTrackingRect.SetPos( ::Point( rRowColumnRect.Left(), nPosY ));
aTrackingRect.setWidth( rRowColumnRect.getWidth() );
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 90486536c401..3254d2cba844 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -25,6 +25,7 @@
#include <algorithm>
#include <ostream>
#include <cstdlib>
+#include <cassert>
class SvStream;
namespace rtl
@@ -34,27 +35,30 @@ namespace rtl
enum TriState { TRISTATE_FALSE, TRISTATE_TRUE, TRISTATE_INDET };
+#define RECT_MAX (SAL_MAX_INT32)
+#define RECT_MIN (SAL_MIN_INT32)
+
// Pair
class SAL_WARN_UNUSED Pair
{
public:
Pair() : nA(0), nB(0) {}
- Pair( long _nA, long _nB ) : nA(_nA), nB(_nB) {}
+ Pair( sal_Int32 _nA, sal_Int32 _nB ) : nA(_nA), nB(_nB) {}
- long A() const { return nA; }
- long B() const { return nB; }
+ sal_Int32 A() const { return nA; }
+ sal_Int32 B() const { return nB; }
- long& A() { return nA; }
- long& B() { return nB; }
+ sal_Int32& A() { return nA; }
+ sal_Int32& B() { return nB; }
TOOLS_DLLPUBLIC rtl::OString toString() const;
TOOLS_DLLPUBLIC friend SvStream& ReadPair( SvStream& rIStream, Pair& rPair );
TOOLS_DLLPUBLIC friend SvStream& WritePair( SvStream& rOStream, const Pair& rPair );
protected:
- long nA;
- long nB;
+ sal_Int32 nA;
+ sal_Int32 nB;
};
namespace tools { namespace detail {
@@ -74,33 +78,35 @@ class SAL_WARN_UNUSED SAL_DLLPUBLIC_EXPORT Point final : protected Pair
{
public:
Point() {}
- Point( long nX, long nY ) : Pair( nX, nY ) {}
+ Point( sal_Int32 nX, sal_Int32 nY ) : Pair( nX, nY )
+ {
+ }
- long X() const { return nA; }
- long Y() const { return nB; }
+ sal_Int32 X() const { return nA; }
+ sal_Int32 Y() const { return nB; }
- void Move( long nHorzMove, long nVertMove );
+ void Move( sal_Int32 nHorzMove, sal_Int32 nVertMove );
void Move( Size const & s );
- long AdjustX( long nHorzMove ) { nA += nHorzMove; return nA; }
- long AdjustY( long nVertMove ) { nB += nVertMove; return nB; }
+ sal_Int32 AdjustX( sal_Int32 nHorzMove ) { nA += nHorzMove; return nA; }
+ sal_Int32 AdjustY( sal_Int32 nVertMove ) { nB += nVertMove; return nB; }
- void RotateAround( long& rX, long& rY, short nOrientation ) const;
+ void RotateAround( sal_Int32& rX, sal_Int32& rY, short nOrientation ) const;
void RotateAround( Point&, short nOrientation ) const;
Point& operator += ( const Point& rPoint );
Point& operator -= ( const Point& rPoint );
- Point& operator *= ( const long nVal );
- Point& operator /= ( const long nVal );
+ Point& operator *= ( const sal_Int32 nVal );
+ Point& operator /= ( const sal_Int32 nVal );
friend inline Point operator+( const Point &rVal1, const Point &rVal2 );
friend inline Point operator-( const Point &rVal1, const Point &rVal2 );
- friend inline Point operator*( const Point &rVal1, const long nVal2 );
- friend inline Point operator/( const Point &rVal1, const long nVal2 );
+ friend inline Point operator*( const Point &rVal1, const sal_Int32 nVal2 );
+ friend inline Point operator/( const Point &rVal1, const sal_Int32 nVal2 );
- long getX() const { return X(); }
- long getY() const { return Y(); }
- void setX(long nX) { nA = nX; }
- void setY(long nY) { nB = nY; }
+ sal_Int32 getX() const { return X(); }
+ sal_Int32 getY() const { return Y(); }
+ void setX(sal_Int32 nX) { nA = nX; }
+ void setY(sal_Int32 nY) { nB = nY; }
Pair const & toPair() const { return *this; }
Pair & toPair() { return *this; }
@@ -108,7 +114,7 @@ public:
using Pair::toString;
};
-inline void Point::Move( long nHorzMove, long nVertMove )
+inline void Point::Move( sal_Int32 nHorzMove, sal_Int32 nVertMove )
{
nA += nHorzMove;
nB += nVertMove;
@@ -128,14 +134,14 @@ inline Point& Point::operator -= ( const Point& rPoint )
return *this;
}
-inline Point& Point::operator *= ( const long nVal )
+inline Point& Point::operator *= ( const sal_Int32 nVal )
{
nA *= nVal;
nB *= nVal;
return *this;
}
-inline Point& Point::operator /= ( const long nVal )
+inline Point& Point::operator /= ( const sal_Int32 nVal )
{
nA /= nVal;
nB /= nVal;
@@ -152,12 +158,12 @@ inline Point operator-( const Point &rVal1, const Point &rVal2 )
return Point( rVal1.nA-rVal2.nA, rVal1.nB-rVal2.nB );
}
-inline Point operator*( const Point &rVal1, const long nVal2 )
+inline Point operator*( const Point &rVal1, const sal_Int32 nVal2 )
{
return Point( rVal1.nA*nVal2, rVal1.nB*nVal2 );
}
-inline Point operator/( const Point &rVal1, const long nVal2 )
+inline Point operator/( const Point &rVal1, const sal_Int32 nVal2 )
{
return Point( rVal1.nA/nVal2, rVal1.nB/nVal2 );
}
@@ -185,18 +191,20 @@ class SAL_WARN_UNUSED Size final : protected Pair
{
public:
Size() {}
- Size( long nWidth, long nHeight ) : Pair( nWidth, nHeight ) {}
+ Size( sal_Int32 nWidth, sal_Int32 nHeight ) : Pair( nWidth, nHeight )
+ {
+ }
- long Width() const { return nA; }
- long Height() const { return nB; }
+ sal_Int32 Width() const { return nA; }
+ sal_Int32 Height() const { return nB; }
- long AdjustWidth( long n ) { nA += n; return nA; }
- long AdjustHeight( long n ) { nB += n; return nB; }
+ sal_Int32 AdjustWidth( sal_Int32 n ) { nA += n; return nA; }
+ sal_Int32 AdjustHeight( sal_Int32 n ) { nB += n; return nB; }
- long getWidth() const { return Width(); }
- long getHeight() const { return Height(); }
- void setWidth(long nWidth) { nA = nWidth; }
- void setHeight(long nHeight) { nB = nHeight; }
+ sal_Int32 getWidth() const { return Width(); }
+ sal_Int32 getHeight() const { return Height(); }
+ void setWidth(sal_Int32 nWidth) { nA = nWidth; }
+ void setHeight(sal_Int32 nHeight) { nB = nHeight; }
Pair const & toPair() const { return *this; }
Pair & toPair() { return *this; }
@@ -229,22 +237,22 @@ inline void Point::Move( Size const & s )
// Range
-#define RANGE_MAX LONG_MAX
+#define RANGE_MAX SAL_MAX_INT32
class SAL_WARN_UNUSED Range final : protected Pair
{
public:
Range() {}
- Range( long nMin, long nMax ) : Pair( nMin, nMax ) {}
+ Range( sal_Int32 nMin, sal_Int32 nMax ) : Pair( nMin, nMax ) {}
- long Min() const { return nA; }
- long Max() const { return nB; }
- long Len() const { return nB - nA + 1; }
+ sal_Int32 Min() const { return nA; }
+ sal_Int32 Max() const { return nB; }
+ sal_Int32 Len() const { return nB - nA + 1; }
- long& Min() { return nA; }
- long& Max() { return nB; }
+ sal_Int32& Min() { return nA; }
+ sal_Int32& Max() { return nB; }
- bool IsInside( long nIs ) const;
+ bool IsInside( sal_Int32 nIs ) const;
void Justify();
@@ -254,7 +262,7 @@ public:
using Pair::toString;
};
-inline bool Range::IsInside( long nIs ) const
+inline bool Range::IsInside( sal_Int32 nIs ) const
{
return ((nA <= nIs) && (nIs <= nB ));
}
@@ -263,7 +271,7 @@ inline void Range::Justify()
{
if ( nA > nB )
{
- long nHelp = nA;
+ sal_Int32 nHelp = nA;
nA = nB;
nB = nHelp;
}
@@ -288,32 +296,32 @@ inline std::basic_ostream<charT, traits> & operator <<(
// Selection
-#define SELECTION_MIN LONG_MIN
-#define SELECTION_MAX LONG_MAX
+#define SELECTION_MIN SAL_MIN_INT32
+#define SELECTION_MAX SAL_MAX_INT32
class SAL_WARN_UNUSED Selection final : protected Pair
{
public:
Selection() {}
- Selection( long nPos ) : Pair( nPos, nPos ) {}
- Selection( long nMin, long nMax ) : Pair( nMin, nMax ) {}
+ Selection( sal_Int32 nPos ) : Pair( nPos, nPos ) {}
+ Selection( sal_Int32 nMin, sal_Int32 nMax ) : Pair( nMin, nMax ) {}
- long Min() const { return nA; }
- long Max() const { return nB; }
- long Len() const { return nB - nA; }
+ sal_Int32 Min() const { return nA; }
+ sal_Int32 Max() const { return nB; }
+ sal_Int32 Len() const { return nB - nA; }
- long& Min() { return nA; }
- long& Max() { return nB; }
+ sal_Int32& Min() { return nA; }
+ sal_Int32& Max() { return nB; }
- bool IsInside( long nIs ) const;
+ bool IsInside( sal_Int32 nIs ) const;
void Justify();
bool operator !() const { return !Len(); }
- long getMin() const { return Min(); }
- void setMin(long nMin) { Min() = nMin; }
- void setMax(long nMax) { Max() = nMax; }
+ sal_Int32 getMin() const { return Min(); }
+ void setMin(sal_Int32 nMin) { Min() = nMin; }
+ void setMax(sal_Int32 nMax) { Max() = nMax; }
Pair const & toPair() const { return *this; }
Pair & toPair() { return *this; }
@@ -321,7 +329,7 @@ public:
using Pair::toString;
};
-inline bool Selection::IsInside( long nIs ) const
+inline bool Selection::IsInside( sal_Int32 nIs ) const
{
return ((nA <= nIs) && (nIs < nB ));
}
@@ -330,7 +338,7 @@ inline void Selection::Justify()
{
if ( nA > nB )
{
- long nHelp = nA;
+ sal_Int32 nHelp = nA;
nA = nB;
nB = nHelp;
}
@@ -354,9 +362,6 @@ inline std::basic_ostream<charT, traits> & operator <<(
}
// Rectangle
-#define RECT_MAX LONG_MAX
-#define RECT_MIN LONG_MIN
-
/// Note: this class is a true marvel of engineering: because the author
/// could not decide whether it's better to have a closed or half-open
/// interval, they just implemented *both* in the same class!
@@ -368,27 +373,28 @@ inline std::basic_ostream<charT, traits> & operator <<(
/// Ok, now is the time for despair.
namespace tools
{
+
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Rectangle final
{
- static constexpr short RECT_EMPTY = -32767;
+ static constexpr sal_Int32 RECT_EMPTY = -32767;
public:
Rectangle();
Rectangle( const Point& rLT, const Point& rRB );
- Rectangle( long nLeft, long nTop,
- long nRight, long nBottom );
+ Rectangle( sal_Int32 nLeft, sal_Int32 nTop,
+ sal_Int32 nRight, sal_Int32 nBottom );
/// Constructs an empty Rectangle, with top/left at the specified params
- Rectangle( long nLeft, long nTop );
+ Rectangle( sal_Int32 nLeft, sal_Int32 nTop );
Rectangle( const Point& rLT, const Size& rSize );
- long Left() const { return nLeft; }
- long Right() const { return nRight; }
- long Top() const { return nTop; }
- long Bottom() const { return nBottom; }
+ sal_Int32 Left() const { return nLeft; }
+ sal_Int32 Right() const { return nRight; }
+ sal_Int32 Top() const { return nTop; }
+ sal_Int32 Bottom() const { return nBottom; }
- void SetLeft(long v) { nLeft = v; }
- void SetRight(long v) { nRight = v; }
- void SetTop(long v) { nTop = v; }
- void SetBottom(long v) { nBottom = v; }
+ void SetLeft(sal_Int32 v) { nLeft = v; }
+ void SetRight(sal_Int32 v) { nRight = v; }
+ void SetTop(sal_Int32 v) { nTop = v; }
+ void SetBottom(sal_Int32 v) { nBottom = v; }
inline Point TopLeft() const;
inline Point TopRight() const;
@@ -401,20 +407,21 @@ public:
inline Point Center() const;
/// Move the top and left edges by a delta, preserving width and height
- inline void Move( long nHorzMoveDelta, long nVertMoveDelta );
+ inline void Move( sal_Int32 nHorzMoveDelta, sal_Int32 nVertMoveDelta );
void Move( Size const & s ) { Move(s.Width(), s.Height()); }
- long AdjustLeft( long nHorzMoveDelta ) { nLeft += nHorzMoveDelta; return nLeft; }
- long AdjustRight( long nHorzMoveDelta ) { nRight += nHorzMoveDelta; return nRight; }
- long AdjustTop( long nVertMoveDelta ) { nTop += nVertMoveDelta; return nTop; }
- long AdjustBottom( long nVertMoveDelta ) { nBottom += nVertMoveDelta; return nBottom; }
+ sal_Int32 AdjustLeft( sal_Int32 nHorzMoveDelta ) { nLeft += nHorzMoveDelta; return nLeft; }
+ sal_Int32 AdjustRight( sal_Int32 nHorzMoveDelta ) { nRight += nHorzMoveDelta; return nRight; }
+ sal_Int32 AdjustTop( sal_Int32 nVertMoveDelta ) { nTop += nVertMoveDelta; return nTop; }
+ sal_Int32 AdjustBottom( sal_Int32 nVertMoveDelta ) { nBottom += nVertMoveDelta; return nBottom; }
+
inline void SetPos( const Point& rPoint );
void SetSize( const Size& rSize );
inline Size GetSize() const;
/// Returns the difference between right and left, assuming the range is inclusive.
- inline long GetWidth() const;
+ inline sal_Int32 GetWidth() const;
/// Returns the difference between bottom and top, assuming the range is inclusive.
- inline long GetHeight() const;
+ inline sal_Int32 GetHeight() const;
tools::Rectangle& Union( const tools::Rectangle& rRect );
tools::Rectangle& Intersection( const tools::Rectangle& rRect );
@@ -447,39 +454,39 @@ public:
TOOLS_DLLPUBLIC friend SvStream& WriteRectangle( SvStream& rOStream, const tools::Rectangle& rRect );
// ONE
- long getX() const { return nLeft; }
- long getY() const { return nTop; }
+ sal_Int32 getX() const { return nLeft; }
+ sal_Int32 getY() const { return nTop; }
/// Returns the difference between right and left, assuming the range includes one end, but not the other.
- long getWidth() const { return nRight - nLeft; }
+ sal_Int32 getWidth() const { return nRight - nLeft; }
/// Returns the difference between bottom and top, assuming the range includes one end, but not the other.
- long getHeight() const { return nBottom - nTop; }
+ sal_Int32 getHeight() const { return nBottom - nTop; }
/// Set the left edge of the rectangle to x, preserving the width
- void setX( long x ) { nRight += x - nLeft; nLeft = x; }
+ void setX( sal_Int32 x ) { nRight += x - nLeft; nLeft = x; }
/// Set the top edge of the rectangle to y, preserving the height
- void setY( long y ) { nBottom += y - nTop; nTop = y; }
- void setWidth( long n ) { nRight = nLeft + n; }
- void setHeight( long n ) { nBottom = nTop + n; }
+ void setY( sal_Int32 y ) { nBottom += y - nTop; nTop = y; }
+ void setWidth( sal_Int32 n ) { nRight = nLeft + n; }
+ void setHeight( sal_Int32 n ) { nBottom = nTop + n; }
/// Returns the string representation of the rectangle, format is "x, y, width, height".
rtl::OString toString() const;
/**
* Expands the rectangle in all directions by the input value.
*/
- inline void expand(long nExpandBy);
- inline void shrink(long nShrinkBy);
+ inline void expand(sal_Int32 nExpandBy);
+ inline void shrink(sal_Int32 nShrinkBy);
/**
* Sanitizing variants for handling data from the outside
*/
void SaturatingSetSize(const Size& rSize);
- void SaturatingSetX(long x);
- void SaturatingSetY(long y);
+ void SaturatingSetX(sal_Int32 x);
+ void SaturatingSetY(sal_Int32 y);
private:
- long nLeft;
- long nTop;
- long nRight;
- long nBottom;
+ sal_Int32 nLeft;
+ sal_Int32 nTop;
+ sal_Int32 nRight;
+ sal_Int32 nBottom;
};
}
@@ -497,8 +504,8 @@ inline tools::Rectangle::Rectangle( const Point& rLT, const Point& rRB )
nBottom = rRB.Y();
}
-inline tools::Rectangle::Rectangle( long _nLeft, long _nTop,
- long _nRight, long _nBottom )
+inline tools::Rectangle::Rectangle( sal_Int32 _nLeft, sal_Int32 _nTop,
+ sal_Int32 _nRight, sal_Int32 _nBottom )
{
nLeft = _nLeft;
nTop = _nTop;
@@ -506,7 +513,7 @@ inline tools::Rectangle::Rectangle( long _nLeft, long _nTop,
nBottom = _nBottom;
}
-inline tools::Rectangle::Rectangle( long _nLeft, long _nTop )
+inline tools::Rectangle::Rectangle( sal_Int32 _nLeft, sal_Int32 _nTop )
{
nLeft = _nLeft;
nTop = _nTop;
@@ -589,7 +596,7 @@ inline Point tools::Rectangle::Center() const
return Point( nLeft+(nRight-nLeft)/2 , nTop+(nBottom-nTop)/2 );
}
-inline void tools::Rectangle::Move( long nHorzMove, long nVertMove )
+inline void tools::Rectangle::Move( sal_Int32 nHorzMove, sal_Int32 nVertMove )
{
nLeft += nHorzMove;
nTop += nVertMove;
@@ -609,9 +616,9 @@ inline void tools::Rectangle::SetPos( const Point& rPoint )
nTop = rPoint.Y();
}
-inline long tools::Rectangle::GetWidth() const
+inline sal_Int32 tools::Rectangle::GetWidth() const
{
- long n;
+ sal_Int32 n;
if ( nRight == RECT_EMPTY )
n = 0;
else
@@ -626,9 +633,9 @@ inline long tools::Rectangle::GetWidth() const
return n;
}
-inline long tools::Rectangle::GetHeight() const
+inline sal_Int32 tools::Rectangle::GetHeight() const
{
- long n;
+ sal_Int32 n;
if ( nBottom == RECT_EMPTY )
n = 0;
else
@@ -717,7 +724,7 @@ inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt )
}
}
-inline void tools::Rectangle::expand(long nExpandBy)
+inline void tools::Rectangle::expand(sal_Int32 nExpandBy)
{
nLeft -= nExpandBy;
nTop -= nExpandBy;
@@ -725,7 +732,7 @@ inline void tools::Rectangle::expand(long nExpandBy)
nBottom += nExpandBy;
}
-inline void tools::Rectangle::shrink(long nShrinkBy)
+inline void tools::Rectangle::shrink(sal_Int32 nShrinkBy)
{
nLeft += nShrinkBy;
nTop += nShrinkBy;
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index 49fdef75ddef..77b529b14671 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -69,9 +69,9 @@ public:
void setMaxWidthChars(sal_Int32 nWidth);
void setMinWidthChars(sal_Int32 nWidth);
- static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = 0x7fffffff);
+ static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = RECT_MAX);
static Size getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth);
- Size CalcMinimumSize(long nMaxWidth = 0x7fffffff) const;
+ Size CalcMinimumSize(long nMaxWidth = RECT_MAX) const;
virtual Size GetOptimalSize() const override;
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
void set_mnemonic_widget(vcl::Window *pWindow);
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 649faa6388ef..3dcc52de5355 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -356,14 +356,14 @@ private:
long mnOutOffX;
/// Output offset for device output in pixel (pseudo window offset within window system's frames)
long mnOutOffY;
- long mnOutWidth;
- long mnOutHeight;
+ sal_Int32 mnOutWidth;
+ sal_Int32 mnOutHeight;
sal_Int32 mnDPIX;
sal_Int32 mnDPIY;
sal_Int32 mnDPIScalePercentage; ///< For Hi-DPI displays, we want to draw elements for a percentage larger
/// font specific text alignment offsets in pixel units
- mutable long mnTextOffX;
- mutable long mnTextOffY;
+ mutable sal_Int32 mnTextOffX;
+ mutable sal_Int32 mnTextOffY;
mutable long mnEmphasisAscent;
mutable long mnEmphasisDescent;
DrawModeFlags mnDrawMode;
@@ -1177,13 +1177,13 @@ private:
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight );
- SAL_DLLPRIVATE static void ImplDrawWavePixel( long nOriginX, long nOriginY, long nCurX, long nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
+ SAL_DLLPRIVATE static void ImplDrawWavePixel( long nOriginX, long nOriginY, sal_Int32 nCurX, sal_Int32 nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
bool bDrawPixAsRect, long nPixWidth, long nPixHeight );
SAL_DLLPRIVATE void ImplDrawWaveLine( long nBaseX, long nBaseY, long nStartX, long nStartY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor );
SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStrikeoutLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
- SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
+ SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, sal_Int32 nX, sal_Int32 nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
SAL_DLLPRIVATE static bool ImplIsUnderlineAbove( const vcl::Font& );
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 1a940214501d..78628616f7a9 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -327,10 +327,10 @@ public:
struct VCL_DLLPUBLIC BitmapBuffer
{
- ScanlineFormat mnFormat;
- long mnWidth;
- long mnHeight;
- long mnScanlineSize;
+ ScanlineFormat mnFormat;
+ sal_Int32 mnWidth;
+ sal_Int32 mnHeight;
+ sal_Int32 mnScanlineSize;
sal_uInt16 mnBitCount;
ColorMask maColorMask;
BitmapPalette maPalette;
diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx
index 0e37300f3dbd..d6c8dd8e11d5 100644
--- a/include/vcl/salgtype.hxx
+++ b/include/vcl/salgtype.hxx
@@ -38,25 +38,25 @@ constexpr ::Color SALCOLOR_NONE ( 0xFF, 0xFF, 0xFF, 0xFF );
// must equal to class Point
struct SalPoint
{
- long mnX;
- long mnY;
+ sal_Int32 mnX;
+ sal_Int32 mnY;
};
typedef const SalPoint* PCONSTSALPOINT;
struct SalTwoRect
{
- long mnSrcX;
- long mnSrcY;
- long mnSrcWidth;
- long mnSrcHeight;
- long mnDestX;
- long mnDestY;
- long mnDestWidth;
- long mnDestHeight;
+ sal_Int32 mnSrcX;
+ sal_Int32 mnSrcY;
+ sal_Int32 mnSrcWidth;
+ sal_Int32 mnSrcHeight;
+ sal_Int32 mnDestX;
+ sal_Int32 mnDestY;
+ sal_Int32 mnDestWidth;
+ sal_Int32 mnDestHeight;
- SalTwoRect(long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight,
- long nDestX, long nDestY, long nDestWidth, long nDestHeight)
+ SalTwoRect(sal_Int32 nSrcX, sal_Int32 nSrcY, sal_Int32 nSrcWidth, sal_Int32 nSrcHeight,
+ sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight)
: mnSrcX(nSrcX), mnSrcY(nSrcY), mnSrcWidth(nSrcWidth), mnSrcHeight(nSrcHeight)
, mnDestX(nDestX), mnDestY(nDestY), mnDestWidth(nDestWidth), mnDestHeight(nDestHeight)
{
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 2ec6992381a6..90284382ad22 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -158,13 +158,13 @@ sal_uInt32 VMLExport::EnterGroup( const OUString& rShapeName, const tools::Recta
if ( pRect && ( mnGroupLevel == 1 ) )
{
pAttrList->add( XML_coordorigin,
- OStringBuffer( 20 ).append( sal_Int32( pRect->Left() ) )
- .append( "," ).append( sal_Int32( pRect->Top() ) )
+ OStringBuffer( 20 ).append( pRect->Left() )
+ .append( "," ).append( pRect->Top() )
.makeStringAndClear() );
pAttrList->add( XML_coordsize,
- OStringBuffer( 20 ).append( sal_Int32( pRect->Right() ) - sal_Int32( pRect->Left() ) )
- .append( "," ).append( sal_Int32( pRect->Bottom() ) - sal_Int32( pRect->Top() ) )
+ OStringBuffer( 20 ).append( pRect->Right() - pRect->Left() )
+ .append( "," ).append( pRect->Bottom() - pRect->Top() )
.makeStringAndClear() );
}
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 208c07c97f99..a0af522a616c 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -392,7 +392,7 @@ void OObjectBase::SetPropsFromRect(const tools::Rectangle& _rRect)
{
uno::Reference<report::XSection> xSection = pPage->getSection();
assert(_rRect.getHeight() >= 0);
- const sal_uInt32 newHeight( ::std::max(0l, _rRect.getHeight()+_rRect.Top()) );
+ const sal_uInt32 newHeight( ::std::max<sal_Int32>(0, _rRect.getHeight()+_rRect.Top()) );
if ( xSection.is() && ( newHeight > xSection->getHeight() ) )
xSection->setHeight( newHeight );
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 94fa2d188189..d59b78d4a586 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -163,8 +163,8 @@ void ScFiltersTest::testTdf91979()
Point aPos = aViewData.GetScrPos(MAXCOL - 1, 10000, SC_SPLIT_TOPLEFT, true);
int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(0, 0), aViewData.GetPPTX());
int nRowHeight = ScViewData::ToPixel(pDoc->GetRowHeight(0, 0), aViewData.GetPPTY());
- CPPUNIT_ASSERT_EQUAL(static_cast<long>((MAXCOL - 1) * nColWidth), aPos.getX());
- CPPUNIT_ASSERT_EQUAL(static_cast<long>(10000 * nRowHeight), aPos.getY());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32((MAXCOL - 1) * nColWidth), aPos.getX());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10000 * nRowHeight), aPos.getY());
xComponent->dispose();
}
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 0c4eeb808145..705627e79f75 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -445,13 +445,13 @@ void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle
SdrObject* pObj = pPage->GetObj(0);
const tools::Rectangle& aSnap = pObj->GetSnapRect();
- printf("expected height %ld actual %ld\n", aRect.GetHeight(), aSnap.GetHeight() );
+ printf("expected height %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.GetHeight(), aSnap.GetHeight() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetHeight(), aSnap.GetHeight(), TOLERANCE ) );
- printf("expected width %ld actual %ld\n", aRect.GetWidth(), aSnap.GetWidth() );
+ printf("expected width %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.GetWidth(), aSnap.GetWidth() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetWidth(), aSnap.GetWidth(), TOLERANCE ) );
- printf("expected left %ld actual %ld\n", aRect.Left(), aSnap.Left() );
+ printf("expected left %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.Left(), aSnap.Left() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Left(), aSnap.Left(), TOLERANCE ) );
- printf("expected right %ld actual %ld\n", aRect.Top(), aSnap.Top() );
+ printf("expected right %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.Top(), aSnap.Top() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Top(), aSnap.Top(), TOLERANCE ) );
ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj );
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 3f7c93198312..279664b401ca 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -178,11 +178,11 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
pPattern = pDoc->GetPattern(0,0,1);
vcl::Font aFont;
pPattern->GetFont(aFont,SC_AUTOCOL_RAW);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetFontSize().getHeight());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", sal_Int32(200), aFont.GetFontSize().getHeight());
CPPUNIT_ASSERT_EQUAL_MESSAGE("font color should be black", COL_AUTO, aFont.GetColor());
pPattern = pDoc->GetPattern(0,1,1);
pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, aFont.GetFontSize().getHeight());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", sal_Int32(240), aFont.GetFontSize().getHeight());
pPattern = pDoc->GetPattern(0,2,1);
pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be italic", ITALIC_NORMAL, aFont.GetItalic());
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2e876434ce49..3e602c95b8af 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -1678,7 +1678,7 @@ void ScFiltersTest::testChartImportXLS()
const SdrOle2Obj* pOleObj = getSingleChartObject(rDoc, 0);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd sheet.", pOleObj);
- CPPUNIT_ASSERT_EQUAL(11137L, pOleObj->GetLogicRect().getWidth());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(11137), pOleObj->GetLogicRect().getWidth());
CPPUNIT_ASSERT(8640L > pOleObj->GetLogicRect().getHeight());
xDocSh->DoClose();
diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx
index 7a39eb1c9989..5d445983b69e 100644
--- a/sc/source/core/data/drawpage.cxx
+++ b/sc/source/core/data/drawpage.cxx
@@ -27,7 +27,7 @@
ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage) :
FmFormPage(rNewModel, bMasterPage)
{
- SetSize( Size( LONG_MAX, LONG_MAX ) );
+ SetSize( Size( RECT_MAX, RECT_MAX ) );
}
ScDrawPage::ScDrawPage(const ScDrawPage& rSrcPage)
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 0e0ce7163354..6d7d65edbf43 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -283,7 +283,7 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
// dynamic height: calculate header height, add header <-> sheet area distance
(aHFConv.GetTotalHeight() + rHdrItemSet.Get( ATTR_ULSPACE ).GetLower()) :
// static height: ATTR_PAGE_SIZE already includes header <-> sheet area distance
- static_cast< sal_Int32 >( rHdrItemSet.Get( ATTR_PAGE_SIZE ).GetSize().Height() );
+ ( rHdrItemSet.Get( ATTR_PAGE_SIZE ).GetSize().Height() );
maData.mfHeaderMargin = maData.mfTopMargin;
maData.mfTopMargin += XclTools::GetInchFromTwips( nHdrHeight );
}
@@ -300,7 +300,7 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
// dynamic height: calculate footer height, add sheet area <-> footer distance
(aHFConv.GetTotalHeight() + rFtrItemSet.Get( ATTR_ULSPACE ).GetUpper()) :
// static height: ATTR_PAGE_SIZE already includes sheet area <-> footer distance
- static_cast< sal_Int32 >( rFtrItemSet.Get( ATTR_PAGE_SIZE ).GetSize().Height() );
+ ( rFtrItemSet.Get( ATTR_PAGE_SIZE ).GetSize().Height() );
maData.mfFooterMargin = maData.mfBottomMargin;
maData.mfBottomMargin += XclTools::GetInchFromTwips( nFtrHeight );
}
diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx
index dc827ce2fdd3..a6b73fd76631 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -119,15 +119,15 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
SdrObject* pObject = pE->pObject;
OStringBuffer aBuf;
aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).append('=').
- append(static_cast<sal_Int32>(pE->aSize.Width()));
+ append(pE->aSize.Width());
aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).append('=').
- append(static_cast<sal_Int32>(pE->aSize.Height()));
+ append(pE->aSize.Height());
if ( pE->bInCell )
{
aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace).append('=').
- append(static_cast<sal_Int32>(pE->aSpace.Width()));
+ append(pE->aSpace.Width());
aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace).append('=').
- append(static_cast<sal_Int32>(pE->aSpace.Height()));
+ append(pE->aSpace.Height());
}
OString aOpt = aBuf.makeStringAndClear();
switch ( pObject->GetObjIdentifier() )
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index a4ecfd8860fe..5151e39c77f5 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -653,7 +653,8 @@ void VmlCommentExporter::EndShape( sal_Int32 nShapeElement )
{
char pAnchor[100];
sax_fastparser::FSHelperPtr pVmlDrawing = GetFS();
- snprintf( pAnchor, 100, "%ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld",
+ snprintf( pAnchor, 100, "%" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32
+ ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32,
maFrom.Left(), maFrom.Top(), maFrom.Right(), maFrom.Bottom(),
maTo.Left(), maTo.Top(), maTo.Right(), maTo.Bottom() );
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 1289cd238473..42b24e02812f 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4882,13 +4882,13 @@ void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
tools::Rectangle aRect(pEmbeddedObj->GetVisArea());
sal_uInt16 i(0);
pProps[i].Name = "VisibleAreaTop";
- pProps[i].Value <<= static_cast<sal_Int32>(aRect.getY());
+ pProps[i].Value <<= aRect.getY();
pProps[++i].Name = "VisibleAreaLeft";
- pProps[i].Value <<= static_cast<sal_Int32>(aRect.getX());
+ pProps[i].Value <<= aRect.getX();
pProps[++i].Name = "VisibleAreaWidth";
- pProps[i].Value <<= static_cast<sal_Int32>(aRect.getWidth());
+ pProps[i].Value <<= aRect.getWidth();
pProps[++i].Name = "VisibleAreaHeight";
- pProps[i].Value <<= static_cast<sal_Int32>(aRect.getHeight());
+ pProps[i].Value <<= aRect.getHeight();
}
}
}
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 66bcc5f4ad88..b61983665892 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -750,9 +750,9 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
const SfxInt32Item* pItem = rDoc.GetAttr( aCellPos, ATTR_ROTATE_VALUE );
if( pItem && (pItem->GetValue() != 0) )
{
- pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
+ pEditEngine->SetPaperSize( Size( RECT_MAX, aSize.getHeight() ) );
long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
- aSize.setWidth( std::max( aSize.getWidth(), nTxtWidth + 2 ) );
+ aSize.setWidth( std::max<sal_Int32>( aSize.getWidth(), nTxtWidth + 2 ) );
}
else
{
@@ -762,7 +762,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder()
if ( !bLineBreak )
{
long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() );
- aSize.setWidth( ::std::max( aSize.getWidth(), nTxtWidth ) );
+ aSize.setWidth( ::std::max<sal_Int32>( aSize.getWidth(), nTxtWidth ) );
}
}
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index c4067be67f3a..afce592d640e 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -45,7 +45,7 @@ void ScDDComboBoxButton::SetOutputDevice( OutputDevice* pOutputDevice )
void ScDDComboBoxButton::SetOptSizePixel()
{
aBtnSize = pOut->LogicToPixel(Size(8, 11), MapMode(MapUnit::MapAppFont));
- aBtnSize.setWidth( std::max(aBtnSize.Width(), pOut->GetSettings().GetStyleSettings().GetScrollBarSize()) );
+ aBtnSize.setWidth( std::max<sal_Int32>(aBtnSize.Width(), pOut->GetSettings().GetStyleSettings().GetScrollBarSize()) );
}
void ScDDComboBoxButton::Draw( const Point& rAt,
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index fcffd7809543..d52230d080fc 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -995,7 +995,7 @@ void ScCheckListMenuWindow::getSectionPosSize(
break;
case CHECK_TOGGLE_ALL:
{
- long h = std::min(maChkToggleAll->CalcMinimumSize().Height(), 26L);
+ long h = std::min<sal_Int32>(maChkToggleAll->CalcMinimumSize().Height(), 26);
rPos = Point(nListBoxMargin, nSingleBtnAreaY);
rPos.AdjustX(5 );
rPos.AdjustY((nSingleItemBtnAreaHeight - h)/2 );
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index a714f116f9c5..022cc66bb257 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -149,8 +149,8 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const
long nMaxSize = 18 * fScaleFactor; // Button max size in either dimension
- long nW = std::min(maSize.getWidth() / 2, nMaxSize);
- long nH = std::min(maSize.getHeight(), nMaxSize);
+ long nW = std::min<sal_Int32>(maSize.getWidth() / 2, nMaxSize);
+ long nH = std::min<sal_Int32>(maSize.getHeight(), nMaxSize);
// #i114944# AutoFilter button is left-aligned in RTL.
// DataPilot button is always right-aligned for now, so text output isn't affected.
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 81f321dd5c51..ebd9651ff537 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2120,14 +2120,14 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
namespace {
SAL_WARN_UNUSED_RESULT
-long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol )
+sal_Int32 SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCCOL& rStartCol )
{
SCCOL nCol = 0;
- long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
- long nSnap = 0;
+ sal_Int32 nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
+ sal_Int32 nSnap = 0;
while ( nCol<MAXCOL )
{
- long nAdd = rDoc.GetColWidth(nCol, nTab);
+ sal_Int32 nAdd = rDoc.GetColWidth(nCol, nTab);
if ( nSnap + nAdd/2 < nTwips || nCol < rStartCol )
{
nSnap += nAdd;
@@ -2136,17 +2136,17 @@ long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStar
else
break;
}
- nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
+ nVal = nSnap * HMM_PER_TWIPS;
rStartCol = nCol;
return nVal;
}
SAL_WARN_UNUSED_RESULT
-long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow )
+sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCROW& rStartRow )
{
SCROW nRow = 0;
- long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
- long nSnap = 0;
+ sal_Int32 nTwips = static_cast<sal_Int32>(nVal / HMM_PER_TWIPS);
+ sal_Int32 nSnap = 0;
bool bFound = false;
for (SCROW i = nRow; i <= MAXROW; ++i)
@@ -2159,7 +2159,7 @@ long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartR
}
nRow = i;
- long nAdd = rDoc.GetRowHeight(i, nTab);
+ sal_Int32 nAdd = rDoc.GetRowHeight(i, nTab);
if ( nSnap + nAdd/2 < nTwips || nRow < rStartRow )
{
nSnap += nAdd;
@@ -2174,7 +2174,7 @@ long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartR
if (!bFound)
nRow = MAXROW; // all hidden down to the bottom
- nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
+ nVal = nSnap * HMM_PER_TWIPS;
rStartRow = nRow;
return nVal;
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 8e3a28280e2a..e08b18801609 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -86,15 +86,15 @@ void ScDocShell::SetVisAreaOrSize( const tools::Rectangle& rVisArea )
// Move the VisArea, otherwise only the upper left position would
// be changed in SnapVisArea, and the size would be wrong.
- Point aNewPos( 0, std::max( aArea.Top(), long(0) ) );
+ Point aNewPos( 0, std::max<sal_Int32>( aArea.Top(), 0 ) );
if ( bNegativePage )
{
- aNewPos.setX( std::min( aArea.Right(), long(0) ) );
+ aNewPos.setX( std::min<sal_Int32>( aArea.Right(), 0 ) );
lcl_SetTopRight( aArea, aNewPos );
}
else
{
- aNewPos.setX( std::max( aArea.Left(), long(0) ) );
+ aNewPos.setX( std::max<sal_Int32>( aArea.Left(), 0 ) );
aArea.SetPos( aNewPos );
}
}
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 6a46c87e47a5..b2146106f40e 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -709,13 +709,13 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
tools::Rectangle aVis( Point(), GetOutputSizePixel() );
if (bVertical)
{
- aVis.SetLeft( LONG_MIN );
- aVis.SetRight( LONG_MAX );
+ aVis.SetLeft( RECT_MIN );
+ aVis.SetRight( RECT_MAX );
}
else
{
- aVis.SetTop( LONG_MIN );
- aVis.SetBottom( LONG_MAX );
+ aVis.SetTop( RECT_MIN );
+ aVis.SetBottom( RECT_MAX );
}
pSelEngine->SetVisibleArea( aVis );
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 09819b9c2f2c..cdafc4580165 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -518,8 +518,8 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
// if no lines, still space for the outline frame (20 Twips = 1pt)
// (HasLines initializes aLines to 0,0,0,0)
- nTwipsSizeX += aLines.Left() + std::max( aLines.Right(), 20L );
- nTwipsSizeY += aLines.Top() + std::max( aLines.Bottom(), 20L );
+ nTwipsSizeX += aLines.Left() + std::max<sal_Int32>( aLines.Right(), 20 );
+ nTwipsSizeY += aLines.Top() + std::max<sal_Int32>( aLines.Bottom(), 20 );
double nScaleX = static_cast<double>(nDevSizeX) / nTwipsSizeX;
double nScaleY = static_cast<double>(nDevSizeY) / nTwipsSizeY;
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 41bd76e976ad..94c71db6ec69 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2817,7 +2817,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
pColBar[eNewH]->SetIgnoreMove(false);
pHdrSelEng->SetWindow( pColBar[eNewH] );
long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
- pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, LONG_MIN, nWidth-1, LONG_MAX ) );
+ pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, RECT_MIN, nWidth-1, RECT_MAX ) );
pColBar[eNewH]->CaptureMouse();
}
if ( bLeftCap && pRowBar[eNewV] )
@@ -2826,7 +2826,7 @@ void ScTabView::ActivatePart( ScSplitPos eWhich )
pRowBar[eNewV]->SetIgnoreMove(false);
pHdrSelEng->SetWindow( pRowBar[eNewV] );
long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
- pHdrSelEng->SetVisibleArea( tools::Rectangle( LONG_MIN, 0, LONG_MAX, nHeight-1 ) );
+ pHdrSelEng->SetVisibleArea( tools::Rectangle( RECT_MIN, 0, RECT_MAX, nHeight-1 ) );
pRowBar[eNewV]->CaptureMouse();
}
aHdrFunc.SetWhich(eWhich);
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 27265d21bb21..8e4cc6798b54 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1561,10 +1561,10 @@ void SdImportTest::testTdf103473()
SdrTextObj *const pObj = dynamic_cast<SdrTextObj *const>(pPage->GetObj(0));
CPPUNIT_ASSERT(pObj);
::tools::Rectangle aRect = pObj->GetGeoRect();
- CPPUNIT_ASSERT_EQUAL(3629L, aRect.Left());
- CPPUNIT_ASSERT_EQUAL(4431L, aRect.Top());
- CPPUNIT_ASSERT_EQUAL(8353L, aRect.Right());
- CPPUNIT_ASSERT_EQUAL(9155L, aRect.Bottom());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3629), aRect.Left());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4431), aRect.Top());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8353), aRect.Right());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(9155), aRect.Bottom());
xDocShRef->DoClose();
}
@@ -1903,8 +1903,8 @@ bool SdImportTest::checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeN
ReadDIB(aBitmap, aBitmapStream, true);
}
}
- CPPUNIT_ASSERT_EQUAL(8L, aBitmap.GetSizePixel().Width());
- CPPUNIT_ASSERT_EQUAL(8L, aBitmap.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBitmap.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBitmap.GetSizePixel().Height());
return checkPatternValues(rExpected, aBitmap);
}
@@ -2341,7 +2341,7 @@ void SdImportTest::testTdf114913()
CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr);
const SvxNumBulletItem *pItem = pTxtObj->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pItem);
- CPPUNIT_ASSERT_EQUAL(long(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight());
xDocShRef->DoClose();
}
diff --git a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
index 07027c1d1e18..6ad0831b7e49 100644
--- a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx
@@ -182,7 +182,7 @@ void FramePainter::OffsetBitmap::PaintSide (
{
rDevice.DrawBitmapEx(
Point(nX,nY),
- Size(std::min(aBitmapSize.Width(),static_cast<long>(nRight-nX+1)),aBitmapSize.Height()),
+ Size(std::min(aBitmapSize.Width(),nRight-nX+1),aBitmapSize.Height()),
maBitmap);
}
}
@@ -202,7 +202,7 @@ void FramePainter::OffsetBitmap::PaintSide (
{
rDevice.DrawBitmapEx(
Point(nX,nY),
- Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), static_cast<long>(nBottom-nY+1))),
+ Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), nBottom-nY+1)),
maBitmap);
}
}
@@ -223,8 +223,8 @@ void FramePainter::OffsetBitmap::PaintCenter (
rDevice.DrawBitmapEx(
Point(nX,nY),
Size(
- ::std::min(aBitmapSize.Width(), rBox.Right()-nX+1),
- std::min(aBitmapSize.Height(), rBox.Bottom()-nY+1)),
+ ::std::min<sal_Int32>(aBitmapSize.Width(), rBox.Right()-nX+1),
+ std::min<sal_Int32>(aBitmapSize.Height(), rBox.Bottom()-nY+1)),
maBitmap);
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 6597616e8e21..619d84254a7d 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -1034,10 +1034,10 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
aAny <<= GetPage()->GetLowerBorder();
break;
case WID_PAGE_WIDTH:
- aAny <<= static_cast<sal_Int32>( GetPage()->GetSize().getWidth() );
+ aAny <<= GetPage()->GetSize().getWidth();
break;
case WID_PAGE_HEIGHT:
- aAny <<= static_cast<sal_Int32>( GetPage()->GetSize().getHeight() );
+ aAny <<= GetPage()->GetSize().getHeight();
break;
case WID_PAGE_ORIENT:
aAny <<= view::PaperOrientation(
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 22dcf4538640..67c74771fc16 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -478,8 +478,8 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, b
aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) );
Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel(aObjSize, MapMode(MapUnit::Map100thMM));
SfxViewShell::SetZoomFactor(
- Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast<long int>(1) ) ),
- Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast<long int>(1)) ) );
+ Fraction( aSize.Width(), std::max<sal_Int32>( aObjSizePixel.Width(), 1 ) ),
+ Fraction( aSize.Height(), std::max<sal_Int32>( aObjSizePixel.Height(), 1) ) );
}
mpImpl->ResizePixel(rOrigin, rSize, false);
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 14f4fac32271..af0b99c0a7f0 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -861,7 +861,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
if( mpDrawView->IsTextEdit() )
{
Point aPnt1 = GetActiveWindow()->GetWinViewPos();
- ::tools::Rectangle aMinMaxRect = ::tools::Rectangle( aPnt1, Size(ULONG_MAX, ULONG_MAX) );
+ ::tools::Rectangle aMinMaxRect = ::tools::Rectangle( aPnt1, Size(RECT_MAX, RECT_MAX) );
rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
}
else
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index decd3e3b935a..3795f9e09b4f 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -349,17 +349,17 @@ static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines )
{
case SdrHelpLineKind::Point:
aLines.append( 'P' );
- aLines.append( static_cast<sal_Int32>(rPos.X()) );
+ aLines.append( rPos.X() );
aLines.append( ',' );
- aLines.append( static_cast<sal_Int32>(rPos.Y()) );
+ aLines.append( rPos.Y() );
break;
case SdrHelpLineKind::Vertical:
aLines.append( 'V' );
- aLines.append( static_cast<sal_Int32>(rPos.X()) );
+ aLines.append( rPos.X() );
break;
case SdrHelpLineKind::Horizontal:
aLines.append( 'H' );
- aLines.append( static_cast<sal_Int32>(rPos.Y()) );
+ aLines.append( rPos.Y() );
break;
default:
OSL_FAIL( "Unsupported helpline Kind!" );
@@ -427,16 +427,16 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert
{
const ::tools::Rectangle aVisArea = GetVisArea();
- aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( static_cast<sal_Int32>(aVisArea.Top()) ) );
- aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( static_cast<sal_Int32>(aVisArea.Left()) ) );
- aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( static_cast<sal_Int32>(aVisArea.GetWidth()) ) );
- aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( static_cast<sal_Int32>(aVisArea.GetHeight()) ) );
+ aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( aVisArea.Top() ) );
+ aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( aVisArea.Left() ) );
+ aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( aVisArea.GetWidth() ) );
+ aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( aVisArea.GetHeight() ) );
}
- aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( static_cast<sal_Int32>(GetGridCoarse().Width()) ) );
- aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( static_cast<sal_Int32>(GetGridCoarse().Height()) ) );
- aUserData.addValue( sUNO_View_GridFineWidth, makeAny( static_cast<sal_Int32>(GetGridFine().Width()) ) );
- aUserData.addValue( sUNO_View_GridFineHeight, makeAny( static_cast<sal_Int32>(GetGridFine().Height()) ) );
+ aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( GetGridCoarse().Width() ) );
+ aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( GetGridCoarse().Height() ) );
+ aUserData.addValue( sUNO_View_GridFineWidth, makeAny( GetGridFine().Width() ) );
+ aUserData.addValue( sUNO_View_GridFineHeight, makeAny( GetGridFine().Height() ) );
aUserData.addValue( sUNO_View_GridSnapWidthXNumerator, makeAny( GetSnapGridWidthX().GetNumerator() ) );
aUserData.addValue( sUNO_View_GridSnapWidthXDenominator, makeAny( GetSnapGridWidthX().GetDenominator() ) );
aUserData.addValue( sUNO_View_GridSnapWidthYNumerator, makeAny( GetSnapGridWidthY().GetNumerator() ) );
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 7f63abc6b860..07d5b927a31e 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2085,7 +2085,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
void SfxHelpTextWindow_Impl::SetOnStartupBoxPosition()
{
- long nX = std::max( GetOutputSizePixel().Width() - aOnStartupCB->GetSizePixel().Width(), nMinPos );
+ long nX = std::max<sal_Int32>( GetOutputSizePixel().Width() - aOnStartupCB->GetSizePixel().Width(), nMinPos );
Point aPos = aOnStartupCB->GetPosPixel();
aPos.setX( nX );
aOnStartupCB->SetPosPixel( aPos );
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 4e111a759dd6..5a05e36aeec4 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -361,12 +361,12 @@ uno::Any SAL_CALL IFrameObject::getPropertyValue(const OUString& aPropertyName)
break;
case WID_FRAME_MARGIN_WIDTH:
{
- aAny <<= static_cast<sal_Int32>(maFrmDescr.GetMargin().Width());
+ aAny <<= maFrmDescr.GetMargin().Width();
}
break;
case WID_FRAME_MARGIN_HEIGHT:
{
- aAny <<= static_cast<sal_Int32>(maFrmDescr.GetMargin().Height());
+ aAny <<= maFrmDescr.GetMargin().Height();
}
break;
default: ;
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index ba44d821371e..467f360fdddc 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -118,7 +118,7 @@ void SidebarToolBox::InsertItem(const OUString& rCommand,
ToolBox::InsertItem(aCommand, rFrame, nBits, rRequestedSize, nPos);
- CreateController(GetItemId(aCommand), rFrame, std::max(rRequestedSize.Width(), 0L));
+ CreateController(GetItemId(aCommand), rFrame, std::max<sal_Int32>(rRequestedSize.Width(), 0));
RegisterHandlers();
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 979ac6ab8df4..4da22fca82c9 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -977,7 +977,7 @@ Size SmViewShell::GetTextSize(OutputDevice const & rDevice, const OUString& rTex
aLine = aLine.replaceAt(0, m, "");
aSize = GetTextLineSize(rDevice, aText);
aTextSize.AdjustHeight(aSize.Height() );
- aTextSize.setWidth( std::max(aTextSize.Width(), std::min(aSize.Width(), MaxWidth)) );
+ aTextSize.setWidth( std::max(aTextSize.Width(), std::min<sal_Int32>(aSize.Width(), MaxWidth)) );
aLine = comphelper::string::stripStart(aLine, ' ');
aLine = comphelper::string::stripStart(aLine, '\t');
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index ee4326154038..3f3f1d600c85 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -2034,8 +2034,8 @@ tools::Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId
// assemble the Rectangle relative to DataWin
return tools::Rectangle(
Point( nColX + MIN_COLUMNWIDTH, nRowY ),
- Size( (pCols[nCol]->Width() == LONG_MAX
- ? LONG_MAX - (nColX + MIN_COLUMNWIDTH) : pCols[ nCol ]->Width() - 2*MIN_COLUMNWIDTH),
+ Size( (pCols[nCol]->Width() == RECT_MAX
+ ? RECT_MAX - (nColX + MIN_COLUMNWIDTH) : pCols[ nCol ]->Width() - 2*MIN_COLUMNWIDTH),
GetDataRowHeight() - 1 ) );
}
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 89c3babea3c7..a26159073aac 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -941,7 +941,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
if (nY <= aOverallAreaBRPos.Y())
_rOut.DrawLine( Point( nHLineX, nY ),
Point( bVLines
- ? std::min(long(aPos.X() - 1), aOverallAreaBRPos.X())
+ ? std::min<sal_Int32>(aPos.X() - 1, aOverallAreaBRPos.X())
: aOverallAreaBRPos.X(),
nY ) );
_rOut.Pop();
@@ -1357,7 +1357,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
// event occurred out of data area
if ( rEvt.IsRight() )
pDataWin->Command(
- CommandEvent( Point( 1, LONG_MAX ), CommandEventId::ContextMenu, true ) );
+ CommandEvent( Point( 1, RECT_MAX ), CommandEventId::ContextMenu, true ) );
else
SetNoSelection();
}
@@ -1392,7 +1392,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
pDataWin->HideTracking() ;
// check allowed width and new delta
- nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX );
+ nDragX = std::max<sal_Int32>( rEvt.GetPosPixel().X(), nMinResizeX );
long nDeltaX = nDragX - nResizeX;
sal_uInt16 nId = GetColumnId(nResizeCol);
sal_uLong nOldWidth = GetColumnWidth(nId);
@@ -1422,7 +1422,7 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
pDataWin->HideTracking();
// width changed?
- nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX );
+ nDragX = std::max<sal_Int32>( rEvt.GetPosPixel().X(), nMinResizeX );
if ( (nDragX - nResizeX) != static_cast<long>(pCols[ nResizeCol ]->Width()) )
{
// resize column
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index e43f634e36bd..12a4772af1cf 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -507,7 +507,7 @@ void BrowseBox::GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumn
{
const Range& rRange = pColumnSel->GetRange( nRange );
// loop has to include aRange.Max()
- for( sal_Int32 nCol = rRange.Min(); nCol <= static_cast<sal_Int32>(rRange.Max()); ++nCol )
+ for( sal_Int32 nCol = rRange.Min(); nCol <= rRange.Max(); ++nCol )
{
DBG_ASSERT( nIndex < nCount,
"GetAllSelectedColumns - range overflow" );
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 881396dfa853..4598b9f8af3c 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -153,7 +153,7 @@ void BrowserColumn::Draw( BrowseBox const & rBox, OutputDevice& rDev, const Poin
else
{
// paint data column
- long nWidth = Width() == LONG_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width();
+ long nWidth = Width() == RECT_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width();
rBox.DoPaintField( rDev,
tools::Rectangle(
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index 12e574e345f9..df71c7bcabad 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -386,10 +386,10 @@ public:
const tools::Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
void InvalidateBoundingRect( tools::Rectangle& rRect )
{
- rRect.SetRight(LONG_MAX);
+ rRect.SetRight(RECT_MAX);
bBoundRectsDirty = true;
}
- static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != LONG_MAX ); }
+ static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != RECT_MAX ); }
void PaintEmphasis(const tools::Rectangle& rRect1, bool bSelected,
bool bDropTarget, bool bCursored, vcl::RenderContext& rRenderContext );
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 48c65c97deb6..059948681d62 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -289,7 +289,7 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t
// If the UpdateMode is true, don't set all bounding rectangles to
// 'to be checked', but only the bounding rectangle of the new entry.
// Thus, don't call InvalidateBoundingRect!
- pEntry->aRect.SetRight( LONG_MAX );
+ pEntry->aRect.SetRight( RECT_MAX );
if( bUpdateMode )
{
FindBoundingRect( pEntry );
@@ -1859,7 +1859,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingWidth() const
switch( nWinBits & VIEWMODE_MASK )
{
case WB_ICON:
- nWidth = std::max( nStringWidth, aImageSize.Width() );
+ nWidth = std::max<sal_Int32>( nStringWidth, aImageSize.Width() );
break;
case WB_SMALLICON:
@@ -1887,7 +1887,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingHeight() const
case WB_SMALLICON:
case WB_DETAILS:
- nHeight = std::max( aImageSize.Height(), nStringHeight );
+ nHeight = std::max<sal_Int32>( aImageSize.Height(), nStringHeight );
break;
}
if( nHeight > nMaxBoundHeight )
@@ -2349,7 +2349,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtr
if( aBoundRect.Left() > aBoundRect.Right())
aBoundRect.SetLeft( aBoundRect.Right() );
if( pEntry->GetTextMode() == SvxIconChoiceCtrlTextMode::Full )
- aBoundRect.SetBottom( LONG_MAX );
+ aBoundRect.SetBottom( RECT_MAX );
}
else
{
@@ -3267,7 +3267,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
return false;
tools::Rectangle aOptTextRect( aTextRect );
- aOptTextRect.SetBottom( LONG_MAX );
+ aOptTextRect.SetBottom( RECT_MAX );
DrawTextFlags nNewFlags = nCurTextDrawFlags;
nNewFlags &= ~DrawTextFlags( DrawTextFlags::Clip | DrawTextFlags::EndEllipsis );
aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 49ac834eecac..c8771a383b25 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3159,7 +3159,7 @@ Size SvTreeListBox::GetOptimalSize() const
aRet.AdjustHeight(rStyleSettings.GetBorderSize() * 2 );
}
long nMinWidth = nMinWidthInChars * approximate_char_width();
- aRet.setWidth( std::max(aRet.Width(), nMinWidth) );
+ aRet.setWidth( std::max<sal_Int32>(aRet.Width(), nMinWidth) );
return aRet;
}
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 82cd893e9710..918b6984845e 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -415,7 +415,7 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance,
//line within that
long nMinWidth = GetTextWidth("----------");
Size aSize = CalcSubEditSize();
- aSize.setWidth( std::max(nMinWidth, aSize.Width()) );
+ aSize.setWidth( std::max<sal_Int32>(nMinWidth, aSize.Width()) );
aSize.AdjustWidth( -(aTxtSize.Width()) );
aSize.AdjustWidth( -6 );
aSize.setHeight( aTxtSize.Height() );
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index 16b90aedd764..9b3eb3e95749 100644
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -138,11 +138,11 @@ void SvtScriptedTextHelper_Impl::CalculateSizes()
// calculate maximum font height
SetOutDevFont( i18n::ScriptType::LATIN );
- maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
+ maTextSize.setHeight( std::max<sal_Int32>( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
SetOutDevFont( i18n::ScriptType::ASIAN );
- maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
+ maTextSize.setHeight( std::max<sal_Int32>( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
SetOutDevFont( i18n::ScriptType::COMPLEX );
- maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
+ maTextSize.setHeight( std::max<sal_Int32>( maTextSize.Height(), mrOutDevice.GetTextHeight() ) );
mrOutDevice.Pop();
}
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index dd94ed5fd8f3..048208233b97 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -541,7 +541,7 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderCon
)
{
rRadioHeight = aNativeBounds.GetHeight();
- rMaxWidth = std::max (rMaxWidth, aNativeContent.GetWidth());
+ rMaxWidth = std::max<sal_Int32>(rMaxWidth, aNativeContent.GetWidth());
}
}
return std::max(rCheckHeight, rRadioHeight);
@@ -570,7 +570,7 @@ Size ToolbarMenu::implCalcSize()
if( pEntry && pEntry->mbHasImage )
{
Size aImgSz( pEntry->maImage.GetSizePixel() );
- nMinMenuItemHeight = std::max( nMinMenuItemHeight, aImgSz.Height() + 6 );
+ nMinMenuItemHeight = std::max<sal_Int32>( nMinMenuItemHeight, aImgSz.Height() + 6 );
aMaxImgSz.setWidth( std::max( aMaxImgSz.Width(), aImgSz.Width() ) );
}
}
@@ -604,7 +604,7 @@ Size ToolbarMenu::implCalcSize()
{
Size aControlSize( pEntry->mpControl->GetOutputSizePixel() );
- nMaxTextWidth = std::max( aControlSize.Width(), nMaxTextWidth );
+ nMaxTextWidth = std::max<sal_Int32>( aControlSize.Width(), nMaxTextWidth );
pEntry->maSize.setHeight( aControlSize.Height() + 1 );
}
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 54d7e3bbbf02..85823fd25e5b 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -2244,7 +2244,7 @@ Size ValueSet::GetLargestItemSize()
{
aSize.AdjustHeight(3 * NAME_LINE_HEIGHT +
maVirDev->GetTextHeight() );
- aSize.setWidth( std::max(aSize.Width(),
+ aSize.setWidth( std::max<sal_Int32>(aSize.Width(),
maVirDev->GetTextWidth(pItem->maText) + NAME_OFFSET) );
}
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 2ea05073f492..a576181f1f12 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -566,7 +566,7 @@ void AssignmentPersistentData::ImplCommit()
long nListBoxWidth = m_pImpl->pFields[0]->approximate_char_width() * 20;
for (auto const& fieldLabel : m_pImpl->aFieldLabels)
{
- nLabelWidth = std::max(nLabelWidth, FixedText::getTextDimensions(m_pImpl->pFieldLabels[0], fieldLabel, 0x7FFFFFFF).Width());
+ nLabelWidth = std::max<sal_Int32>(nLabelWidth, FixedText::getTextDimensions(m_pImpl->pFieldLabels[0], fieldLabel, 0x7FFFFFFF).Width());
}
for (sal_Int32 row=0; row<FIELD_PAIRS_VISIBLE; ++row)
{
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index e1424f5d47b4..d8a6f5a9e312 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -42,9 +42,9 @@ void IMapObject::AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100)
const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) );
rBuf.append('(');
- rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
+ rBuf.append(aPixPt.X());
rBuf.append(',');
- rBuf.append(static_cast<sal_Int32>(aPixPt.Y()));
+ rBuf.append(aPixPt.Y());
rBuf.append(") ");
}
@@ -52,9 +52,9 @@ void IMapObject::AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100)
{
const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) );
- rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
+ rBuf.append(aPixPt.X());
rBuf.append(',');
- rBuf.append(static_cast<sal_Int32>(aPixPt.Y()));
+ rBuf.append(aPixPt.Y());
rBuf.append(' ');
}
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 8ee63d19b757..8253334243c9 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -647,13 +647,13 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
tools::Rectangle aRect( pRectObj->GetRectangle() );
aCoords = OStringBuffer()
- .append(static_cast<sal_Int32>(aRect.Left()))
+ .append(aRect.Left())
.append(',')
- .append(static_cast<sal_Int32>(aRect.Top()))
+ .append(aRect.Top())
.append(',')
- .append(static_cast<sal_Int32>(aRect.Right()))
+ .append(aRect.Right())
.append(',')
- .append(static_cast<sal_Int32>(aRect.Bottom()))
+ .append(aRect.Bottom())
.makeStringAndClear();
}
break;
@@ -666,9 +666,9 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
long nOff = pCirc->GetRadius();
aCoords = OStringBuffer()
- .append(static_cast<sal_Int32>(aCenter.X()))
+ .append(aCenter.X())
.append(',')
- .append(static_cast<sal_Int32>(aCenter.Y()))
+ .append(aCenter.Y())
.append(',')
.append(static_cast<sal_Int32>(nOff))
.makeStringAndClear();
@@ -685,17 +685,17 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
if( nCount>0 )
{
const Point& rPoint = aPoly[0];
- aTmpBuf.append(static_cast<sal_Int32>(rPoint.X()))
+ aTmpBuf.append(rPoint.X())
.append(',')
- .append(static_cast<sal_Int32>(rPoint.Y()));
+ .append(rPoint.Y());
}
for( sal_uInt16 j=1; j<nCount; j++ )
{
const Point& rPoint = aPoly[j];
aTmpBuf.append(',')
- .append(static_cast<sal_Int32>(rPoint.X()))
+ .append(rPoint.X())
.append(',')
- .append(static_cast<sal_Int32>(rPoint.Y()));
+ .append(rPoint.Y());
}
aCoords = aTmpBuf.makeStringAndClear();
}
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index eb2fc6ef92fd..e141a664f48f 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -91,7 +91,7 @@ VCL_BUILDER_FACTORY(SvxPageWindow)
void SvxPageWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
Fraction aXScale(aWinSize.Width(), std::max(long(aSize.Width() * 2 + aSize.Width() / 8), 1L));
- Fraction aYScale(aWinSize.Height(), std::max(aSize.Height(), 1L));
+ Fraction aYScale(aWinSize.Height(), std::max<sal_Int32>(aSize.Height(), 1));
MapMode aMapMode(rRenderContext.GetMapMode());
if(aYScale < aXScale)
diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx
index ceacc555d0e6..e7e3e157a5bb 100644
--- a/svx/source/dialog/swframeexample.cxx
+++ b/svx/source/dialog/swframeexample.cxx
@@ -216,8 +216,8 @@ void SvxSwFrameExample::InitAllRects_Impl(vcl::RenderContext& rRenderContext)
aFrmSize = Size(nLBorder - 3, (aTextLine.GetHeight() + 2) * 3);
break;
}
- aFrmSize.setWidth( std::max(5L, aFrmSize.Width()) );
- aFrmSize.setHeight( std::max(5L, aFrmSize.Height()) );
+ aFrmSize.setWidth( std::max<sal_Int32>(5, aFrmSize.Width()) );
+ aFrmSize.setHeight( std::max<sal_Int32>(5, aFrmSize.Height()) );
}
else
{
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 83e507a54eb2..b36fa382badb 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -1494,7 +1494,7 @@ void FmGridControl::RowHeightChanged()
try
{
sal_Int32 nUnzoomedPixelHeight = CalcReverseZoom( GetDataRowHeight() );
- Any aProperty = makeAny( static_cast<sal_Int32>(PixelToLogic( Point(0, nUnzoomedPixelHeight), MapMode(MapUnit::Map10thMM)).Y()) );
+ Any aProperty = makeAny( PixelToLogic( Point(0, nUnzoomedPixelHeight), MapMode(MapUnit::Map10thMM)).Y() );
xModel->setPropertyValue( FM_PROP_ROWHEIGHT, aProperty );
}
catch( const Exception& )
@@ -1517,7 +1517,7 @@ void FmGridControl::ColumnResized(sal_uInt16 nId)
sal_Int32 nColumnWidth = GetColumnWidth(nId);
nColumnWidth = CalcReverseZoom(nColumnWidth);
// convert to 10THMM
- aWidth <<= static_cast<sal_Int32>(PixelToLogic(Point(nColumnWidth, 0), MapMode(MapUnit::Map10thMM)).X());
+ aWidth <<= PixelToLogic(Point(nColumnWidth, 0), MapMode(MapUnit::Map10thMM)).X();
xColModel->setPropertyValue(FM_PROP_WIDTH, aWidth);
}
}
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 32bdc76ab2c9..5611196b2000 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -2049,7 +2049,7 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName )
sal_Int32 nPixelHeight = pGrid->GetDataRowHeight();
// take the zoom factor into account
nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight);
- aProp <<= static_cast<sal_Int32>(pGrid->PixelToLogic(Point(0, nPixelHeight), MapMode(MapUnit::Map10thMM)).Y());
+ aProp <<= pGrid->PixelToLogic(Point(0, nPixelHeight), MapMode(MapUnit::Map10thMM)).Y();
}
else if ( _rPropertyName == FM_PROP_HASNAVIGATION )
{
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 32fee03bee82..8ff45be133d5 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -959,8 +959,8 @@ sal_uInt32 GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point&
}
}
- rSelPos.setX( std::max( std::min( rSelPos.X(), aOutputSizePixel.Width() - 1 ), 0L ) );
- rSelPos.setY( std::max( std::min( rSelPos.Y(), aOutputSizePixel.Height() - 1 ), 0L ) );
+ rSelPos.setX( std::max<sal_Int32>( std::min<sal_Int32>( rSelPos.X(), aOutputSizePixel.Width() - 1 ), 0 ) );
+ rSelPos.setY( std::max<sal_Int32>( std::min<sal_Int32>( rSelPos.Y(), aOutputSizePixel.Height() - 1 ), 0 ) );
if( nRet && ( !mpCurTheme || ( nRet > mpCurTheme->GetObjectCount() ) ) )
{
diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx
index 90bbd328da8b..91d5e588e805 100644
--- a/svx/source/sidebar/PanelLayout.cxx
+++ b/svx/source/sidebar/PanelLayout.cxx
@@ -94,9 +94,9 @@ void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P
Size aSize(GetOptimalSize());
if (!bCanHandleSmallerWidth)
- nWidth = std::max(nWidth,aSize.Width());
+ nWidth = std::max<sal_Int32>(nWidth,aSize.Width());
if (!bCanHandleSmallerHeight)
- nHeight = std::max(nHeight,aSize.Height());
+ nHeight = std::max<sal_Int32>(nHeight,aSize.Height());
Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 45e01138f885..18fb1e52544e 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -677,7 +677,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
SdrOutliner& rOutliner = ImpGetDrawOutliner();
rOutliner.SetUpdateMode(true);
rOutliner.Clear();
- rOutliner.SetPaperSize(Size(LONG_MAX,LONG_MAX));
+ rOutliner.SetPaperSize(Size(RECT_MAX,RECT_MAX));
rOutliner.SetText(rSdrPathTextPrimitive.getOutlinerParaObject());
// set visualizing page at Outliner; needed e.g. for PageNumberField decomposition
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index fdbebe125cec..cd0a3f02397d 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -285,7 +285,7 @@ public:
All base lines behind it are moved to a new table/ -node.
Is the flag bCalcNewSize set to TRUE, the new SSize for both
tables is calculated from the Maximum of the boxes, provided
- SSize is set "absolute" (LONG_MAX).
+ SSize is set "absolute" (RECT_MAX).
(Momentarily this is needed only for the RTF-parser.) */
SwTableNode* SplitTable( const SwNodeIndex& rPos, bool bAfter = true,
bool bCalcNewSize = false );
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index c4b1889ae4ae..3c6818c5f807 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -40,7 +40,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( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height );
//SV-SS e.g. SwRect( pWin->GetClipRect() );
SwRect( const tools::Rectangle &rRect );
@@ -48,25 +48,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 sal_Int32 nNewX, const sal_Int32 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 sal_Int32 nHeight, const sal_Int32 nWidth );
+ inline void Width( sal_Int32 nNew );
+ inline void Height( sal_Int32 nNew );
+ inline void Left( const sal_Int32 nLeft );
+ inline void Right( const sal_Int32 nRight );
+ inline void Top( const sal_Int32 nTop );
+ inline void Bottom( const sal_Int32 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 sal_Int32 Width() const;
+ inline sal_Int32 Height() const;
+ inline sal_Int32 Left() const;
+ inline sal_Int32 Right() const;
+ inline sal_Int32 Top() const;
+ inline sal_Int32 Bottom() const;
// In order to be able to access the members of Pos and SSize from the layout side.
inline Point &Pos();
@@ -83,7 +83,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, sal_Int32 nTolerance ) const;
bool IsInside( const SwRect& rRect ) const;
bool IsOver( const SwRect& rRect ) const;
inline bool HasArea() const;
@@ -105,30 +105,30 @@ public:
friend SvStream& WriteSwRect( SvStream &rStream, const SwRect &rRect );
- 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 AddBottom( 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 sal_Int32 nTop );
+ void Bottom_( const sal_Int32 nBottom );
+ void Left_( const sal_Int32 nLeft );
+ void Right_( const sal_Int32 nRight );
+ void Width_( const sal_Int32 nNew );
+ void Height_( const sal_Int32 nNew );
+ sal_Int32 Top_() const;
+ sal_Int32 Bottom_() const;
+ sal_Int32 Left_() const;
+ sal_Int32 Right_() const;
+ sal_Int32 Width_() const;
+ sal_Int32 Height_() const;
+ void SubTop( const sal_Int32 nSub );
+ void AddBottom( const sal_Int32 nAdd );
+ void SubLeft( const sal_Int32 nSub );
+ void AddRight( const sal_Int32 nAdd );
+ void AddWidth( const sal_Int32 nAdd );
+ void AddHeight( const sal_Int32 nAdd );
+ void SetPosX( const sal_Int32 nNew );
+ void SetPosY( const sal_Int32 nNew );
+ void SetLeftAndWidth( sal_Int32 nLeft, sal_Int32 nNew );
+ void SetTopAndHeight( sal_Int32 nTop, sal_Int32 nNew );
+ void SetRightAndWidth( sal_Int32 nRight, sal_Int32 nNew );
+ void SetBottomAndHeight( sal_Int32 nBottom, sal_Int32 nNew );
void SetUpperLeftCorner( const Point& rNew );
void SetUpperRightCorner( const Point& rNew );
void SetLowerLeftCorner( const Point& rNew );
@@ -138,23 +138,23 @@ public:
const Point BottomLeft() const;
const Point BottomRight() const;
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;
+ sal_Int32 GetLeftDistance( sal_Int32 ) const;
+ sal_Int32 GetBottomDistance( sal_Int32 ) const;
+ sal_Int32 GetRightDistance( sal_Int32 ) const;
+ sal_Int32 GetTopDistance( sal_Int32 ) const;
+ bool OverStepLeft( sal_Int32 ) const;
+ bool OverStepBottom( sal_Int32 ) const;
+ bool OverStepTop( sal_Int32 ) const;
+ bool OverStepRight( sal_Int32 ) const;
};
-typedef void (SwRect:: *SwRectSet)( const long nNew );
-typedef long (SwRect:: *SwRectGet)() const;
+typedef void (SwRect:: *SwRectSet)( const sal_Int32 nNew );
+typedef sal_Int32 (SwRect:: *SwRectGet)() const;
typedef const Point (SwRect:: *SwRectPoint)() const;
typedef const 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)( sal_Int32 ) const;
+typedef sal_Int32 (SwRect:: *SwRectDist)( sal_Int32 ) const;
+typedef void (SwRect:: *SwRectSetTwice)( sal_Int32, sal_Int32 );
typedef void (SwRect:: *SwRectSetPos)( const Point& );
// Set-Methods
@@ -167,7 +167,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 sal_Int32 nNewX, const sal_Int32 nNewY )
{
m_Point.setX(nNewX);
m_Point.setY(nNewY);
@@ -176,34 +176,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 sal_Int32 nNewHeight, const sal_Int32 nNewWidth )
{
m_Size.setWidth(nNewWidth);
m_Size.setHeight(nNewHeight);
}
-inline void SwRect::Width( long nNew )
+inline void SwRect::Width( sal_Int32 nNew )
{
m_Size.setWidth(nNew);
}
-inline void SwRect::Height( long nNew )
+inline void SwRect::Height( sal_Int32 nNew )
{
m_Size.setHeight(nNew);
}
-inline void SwRect::Left( const long nLeft )
+inline void SwRect::Left( const sal_Int32 nLeft )
{
m_Size.AdjustWidth( m_Point.getX() - nLeft );
m_Point.setX(nLeft);
}
-inline void SwRect::Right( const long nRight )
+inline void SwRect::Right( const sal_Int32 nRight )
{
m_Size.setWidth(nRight - m_Point.getX() + 1);
}
-inline void SwRect::Top( const long nTop )
+inline void SwRect::Top( const sal_Int32 nTop )
{
m_Size.AdjustHeight( m_Point.getY() - nTop );
m_Point.setY(nTop);
}
-inline void SwRect::Bottom( const long nBottom )
+inline void SwRect::Bottom( const sal_Int32 nBottom )
{
m_Size.setHeight(nBottom - m_Point.getY() + 1);
}
@@ -225,27 +225,27 @@ inline Size &SwRect::SSize()
{
return m_Size;
}
-inline long SwRect::Width() const
+inline sal_Int32 SwRect::Width() const
{
return m_Size.Width();
}
-inline long SwRect::Height() const
+inline sal_Int32 SwRect::Height() const
{
return m_Size.Height();
}
-inline long SwRect::Left() const
+inline sal_Int32 SwRect::Left() const
{
return m_Point.X();
}
-inline long SwRect::Right() const
+inline sal_Int32 SwRect::Right() const
{
return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : m_Point.getX();
}
-inline long SwRect::Top() const
+inline sal_Int32 SwRect::Top() const
{
return m_Point.Y();
}
-inline long SwRect::Bottom() const
+inline sal_Int32 SwRect::Bottom() const
{
return m_Size.getHeight() ? m_Point.getY() + m_Size.getHeight() - 1 : m_Point.getY();
}
@@ -282,8 +282,8 @@ inline tools::Rectangle SwRect::SVRect() const
{
SAL_WARN_IF( IsEmpty(), "sw", "SVRect() without Width or Height" );
return tools::Rectangle( m_Point.getX(), m_Point.getY(),
- m_Point.getX() + m_Size.getWidth() - 1, //Right()
- m_Point.getY() + m_Size.getHeight() - 1 ); //Bottom()
+ m_Point.getX() + (m_Size.getWidth() - 1), //Right()
+ m_Point.getY() + (m_Size.getHeight() - 1) ); //Bottom()
}
inline bool SwRect::HasArea() const
@@ -323,7 +323,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( sal_Int32 X, sal_Int32 Y, sal_Int32 W, sal_Int32 H ) :
m_Point( X, Y ),
m_Size( W, H )
{
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 613f258fe192..2fde7b6bb55a 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -46,9 +46,9 @@ class CharClass;
class CollatorWrapper;
class LanguageTag;
-typedef long SwTwips;
-#define INVALID_TWIPS LONG_MAX
-#define TWIPS_MAX (LONG_MAX - 1)
+typedef sal_Int32 SwTwips;
+#define INVALID_TWIPS RECT_MAX
+#define TWIPS_MAX (RECT_MAX - 1)
// Converts Millimeters to Twips (1 mm == 56.905479 twips).
template <typename T = SwTwips>
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 7f10e4befa90..1ba766356cad 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -397,7 +397,7 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleImg, "reqif-ole-img.xhtml")
Size aLogic(pDevice->PixelToLogic(aPixel, MapMode(MapUnit::Map100thMM)));
awt::Size aSize = xShape->getSize();
// This was only 1247, size was not set explicitly.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(aLogic.getWidth()), aSize.Width);
+ CPPUNIT_ASSERT_EQUAL(aLogic.getWidth(), aSize.Width);
// Check mime/media types.
CPPUNIT_ASSERT_EQUAL(OUString("image/png"), getProperty<OUString>(xGraphic, "MimeType"));
diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx
index 571c96e5d6a2..6f2180da49ea 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -125,11 +125,11 @@ DECLARE_RTFEXPORT_TEST(testN192129, "n192129.rtf")
awt::Size aActualSize(xShape->getSize());
if ((aExpectedSize.Width() - aActualSize.Width) / 2 != 0)
{
- CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width);
+ CPPUNIT_ASSERT_EQUAL(aExpectedSize.Width(), aActualSize.Width);
}
if ((aExpectedSize.Height() - aActualSize.Height) / 2 != 0)
{
- CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height);
+ CPPUNIT_ASSERT_EQUAL(aExpectedSize.Height(), aActualSize.Height);
}
}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index ee9b1711f165..e4af20ddc392 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1364,8 +1364,8 @@ DECLARE_RTFIMPORT_TEST(testWatermark, "watermark.rtf")
uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY);
awt::Size aActualSize(xShape->getSize());
- CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height);
+ CPPUNIT_ASSERT_EQUAL(aExpectedSize.Width(), aActualSize.Width);
+ CPPUNIT_ASSERT_EQUAL(aExpectedSize.Height(), aActualSize.Height);
}
DECLARE_RTFIMPORT_TEST(testTdf104016, "tdf104016.rtf")
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 394036c6d955..06a7ae836033 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -523,8 +523,8 @@ void SwTiledRenderingTest::testSearchViewArea()
{
{"SearchItem.SearchString", uno::makeAny(OUString("Heading"))},
{"SearchItem.Backward", uno::makeAny(false)},
- {"SearchItem.SearchStartPointX", uno::makeAny(static_cast<sal_Int32>(aPoint.getX()))},
- {"SearchItem.SearchStartPointY", uno::makeAny(static_cast<sal_Int32>(aPoint.getY()))}
+ {"SearchItem.SearchStartPointX", uno::makeAny(aPoint.getX())},
+ {"SearchItem.SearchStartPointY", uno::makeAny(aPoint.getY())}
}));
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
// This was just "Heading", i.e. SwView::SearchAndWrap() did not search from only the top of the second page.
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 628ad727dc47..ef7ee44374e0 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -1382,7 +1382,7 @@ bool SwAccessibleContext::Select( SwPaM *pPaM, SdrObject *pObj,
if( pFEShell && (pFEShell->IsFrameSelected() ||
pFEShell->IsObjSelected()) )
{
- Point aPt( LONG_MIN, LONG_MIN );
+ Point aPt( RECT_MIN, RECT_MIN );
pFEShell->SelectObj( aPt );
bCallShowCursor = true;
}
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 8702d8f15733..a8d228288f15 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -116,7 +116,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, sal_Int32 nTolerance ) const
{
bool bIsNearby = (((Left() - nTolerance) <= rPoint.X()) &&
((Top() - nTolerance) <= rPoint.Y()) &&
@@ -148,28 +148,28 @@ 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::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::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 sal_Int32 nNew ) { m_Size.setWidth(nNew); }
+void SwRect::Height_( const sal_Int32 nNew ) { m_Size.setHeight(nNew); }
+void SwRect::Left_( const sal_Int32 nLeft ){ m_Size.AdjustWidth(m_Point.getX() - nLeft ); m_Point.setX(nLeft); }
+void SwRect::Right_( const sal_Int32 nRight ){ m_Size.setWidth(nRight - m_Point.getX()); }
+void SwRect::Top_( const sal_Int32 nTop ){ m_Size.AdjustHeight(m_Point.getY() - nTop ); m_Point.setY(nTop); }
+void SwRect::Bottom_( const sal_Int32 nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); }
+
+sal_Int32 SwRect::Width_() const{ return m_Size.getWidth(); }
+sal_Int32 SwRect::Height_() const{ return m_Size.getHeight(); }
+sal_Int32 SwRect::Left_() const{ return m_Point.getX(); }
+sal_Int32 SwRect::Right_() const{ return m_Point.getX() + m_Size.getWidth(); }
+sal_Int32 SwRect::Top_() const{ return m_Point.getY(); }
+sal_Int32 SwRect::Bottom_() const{ return m_Point.getY() + m_Size.getHeight(); }
+
+void SwRect::AddWidth( const sal_Int32 nAdd ) { m_Size.AdjustWidth(nAdd ); }
+void SwRect::AddHeight( const sal_Int32 nAdd ) { m_Size.AdjustHeight(nAdd ); }
+void SwRect::SubLeft( const sal_Int32 nSub ){ m_Size.AdjustWidth(nSub ); m_Point.setX(m_Point.getX() - nSub); }
+void SwRect::AddRight( const sal_Int32 nAdd ){ m_Size.AdjustWidth(nAdd ); }
+void SwRect::SubTop( const sal_Int32 nSub ){ m_Size.AdjustHeight(nSub ); m_Point.setY(m_Point.getY() - nSub); }
+void SwRect::AddBottom( const sal_Int32 nAdd ){ m_Size.AdjustHeight(nAdd ); }
+void SwRect::SetPosX( const sal_Int32 nNew ){ m_Point.setX(nNew); }
+void SwRect::SetPosY( const sal_Int32 nNew ){ m_Point.setY(nNew); }
const Size SwRect::Size_() const { return SSize(); }
const Size SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); }
@@ -180,36 +180,36 @@ const Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.g
const 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(); }
+sal_Int32 SwRect::GetLeftDistance( sal_Int32 nLimit ) const { return m_Point.getX() - nLimit; }
+sal_Int32 SwRect::GetBottomDistance( sal_Int32 nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();}
+sal_Int32 SwRect::GetTopDistance( sal_Int32 nLimit ) const { return m_Point.getY() - nLimit; }
+sal_Int32 SwRect::GetRightDistance( sal_Int32 nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); }
-bool SwRect::OverStepLeft( long nLimit ) const
+bool SwRect::OverStepLeft( sal_Int32 nLimit ) const
{ return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
-bool SwRect::OverStepBottom( long nLimit ) const
+bool SwRect::OverStepBottom( sal_Int32 nLimit ) const
{ return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
-bool SwRect::OverStepTop( long nLimit ) const
+bool SwRect::OverStepTop( sal_Int32 nLimit ) const
{ return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; }
-bool SwRect::OverStepRight( long nLimit ) const
+bool SwRect::OverStepRight( sal_Int32 nLimit ) const
{ return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; }
-void SwRect::SetLeftAndWidth( long nLeft, long nNew )
+void SwRect::SetLeftAndWidth( sal_Int32 nLeft, sal_Int32 nNew )
{
m_Point.setX(nLeft);
m_Size.setWidth(nNew);
}
-void SwRect::SetTopAndHeight( long nTop, long nNew )
+void SwRect::SetTopAndHeight( sal_Int32 nTop, sal_Int32 nNew )
{
m_Point.setY(nTop);
m_Size.setHeight(nNew);
}
-void SwRect::SetRightAndWidth( long nRight, long nNew )
+void SwRect::SetRightAndWidth( sal_Int32 nRight, sal_Int32 nNew )
{
m_Point.setX(nRight - nNew);
m_Size.setWidth(nNew);
}
-void SwRect::SetBottomAndHeight( long nBottom, long nNew )
+void SwRect::SetBottomAndHeight( sal_Int32 nBottom, sal_Int32 nNew )
{
m_Point.setY(nBottom - nNew);
m_Size.setHeight(nNew);
diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx
index c17a0a87dc22..e74953eeb5dd 100644
--- a/sw/source/core/bastyp/tabcol.cxx
+++ b/sw/source/core/bastyp/tabcol.cxx
@@ -71,7 +71,7 @@ void SwTabCols::Insert( long nValue, bool bValue, size_t nPos )
SwTabColsEntry aEntry;
aEntry.nPos = nValue;
aEntry.nMin = 0;
- aEntry.nMax = LONG_MAX;
+ aEntry.nMax = SAL_MAX_INT32;
aEntry.bHidden = bValue;
aData.insert( aData.begin() + nPos, aEntry );
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index fdc029cfb177..da0233037251 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -363,8 +363,8 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrame(
}
SwTwips nUpperDummy = 0;
- long nRightOffset = 0,
- nLeftOffset = 0;
+ sal_Int32 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 4aae97a40690..98a85228130b 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -389,8 +389,8 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
}
else
{
- nLeftCrop = std::max( aOrigSz.Width() -
- (rCrop.GetRight() + rCrop.GetLeft()), long(1) );
+ nLeftCrop = std::max<sal_Int32>( aOrigSz.Width() -
+ (rCrop.GetRight() + rCrop.GetLeft()), 1 );
const double nScale = double(aFramePrintArea.Width()) / double(nLeftCrop);
nLeftCrop = long(nScale * -rCrop.GetLeft() );
nRightCrop = long(nScale * -rCrop.GetRight() );
@@ -412,7 +412,7 @@ void SwNoTextFrame::GetGrfArea( SwRect &rRect, SwRect* pOrigRect ) const
}
else
{
- nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) );
+ nTopCrop = std::max<sal_Int32>( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), 1 );
const double nScale = double(aFramePrintArea.Height()) / double(nTopCrop);
nTopCrop = long(nScale * -rCrop.GetTop() );
nBottomCrop= long(nScale * -rCrop.GetBottom() );
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 5544487788a2..9b6c27d3ea83 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -250,7 +250,7 @@ struct CpyPara
CpyPara( SwTableNode* pNd, sal_uInt16 nCopies, CpyTabFrames& rFrameArr )
: pDoc( pNd->GetDoc() ), pTableNd( pNd ), rTabFrameArr(rFrameArr),
pInsLine(nullptr), pInsBox(nullptr), nOldSize(0), nNewSize(0),
- nMinLeft(ULONG_MAX), nMaxRight(0),
+ nMinLeft(SAL_MAX_UINT32), nMaxRight(0),
nCpyCnt(nCopies), nInsPos(0),
nLnIdx(0), nBoxIdx(0),
nDelBorderFlag(0), bCpyContent( true )
@@ -3500,7 +3500,7 @@ bool SwTable::SetColWidth( SwTableBox& rCurrentBox, TableChgWidthHeightType eTyp
else if( ppUndo )
*ppUndo = new SwUndoAttrTable( *aParam.pTableNd, true );
- long nFrameWidth = LONG_MAX;
+ long nFrameWidth = SAL_MAX_INT32;
LockModify();
SwFormatFrameSize aSz( rSz );
SvxLRSpaceItem aLR( rLR );
@@ -3585,7 +3585,7 @@ bool SwTable::SetColWidth( SwTableBox& rCurrentBox, TableChgWidthHeightType eTyp
// If the Table happens to contain relative values (USHORT_MAX),
// we need to convert them to absolute ones now.
// Bug 61494
- if( LONG_MAX != nFrameWidth )
+ if( SAL_MAX_INT32 != nFrameWidth )
{
SwFormatFrameSize aAbsSz( aSz );
aAbsSz.SetWidth( nFrameWidth );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 4fc498d41cb8..422e2c45c780 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2581,9 +2581,9 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
const long nLeftMin = ( aRectFnSet.IsVert() ?
pTab->GetPrtLeft() - pPage->getFrameArea().Left() :
pTab->GetPrtTop() - pPage->getFrameArea().Top() );
- const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0;
+ const long nLeft = aRectFnSet.IsVert() ? SAL_MAX_INT32 : 0;
const long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea());
- const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX;
+ const long nRightMax = aRectFnSet.IsVert() ? nRight : SAL_MAX_INT32;
rFill.SetLeftMin( nLeftMin );
rFill.SetLeft( nLeft );
@@ -2611,7 +2611,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
aIter = aBoundaries.find( nUpperBorder );
if ( aIter == aBoundaries.end() )
{
- aPair.first = nUpperBorder; aPair.second = LONG_MAX;
+ aPair.first = nUpperBorder; aPair.second = SAL_MAX_INT32;
aBoundaries[ nUpperBorder ] = aPair;
}
@@ -2619,13 +2619,13 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame )
aIter = aBoundaries.find( nLowerBorder );
if ( aIter == aBoundaries.end() )
{
- aPair.first = nUpperBorder; aPair.second = LONG_MAX;
+ aPair.first = nUpperBorder; aPair.second = SAL_MAX_INT32;
}
else
{
nLowerBorder = (*aIter).first;
long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder );
- aPair.first = nNewLowerBorderUpperBoundary; aPair.second = LONG_MAX;
+ aPair.first = nNewLowerBorderUpperBoundary; aPair.second = SAL_MAX_INT32;
}
aBoundaries[ nLowerBorder ] = aPair;
@@ -2757,7 +2757,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
if ( aRectFnSet.IsVert() )
{
nLeftMin = pTab->GetPrtLeft() - pPage->getFrameArea().Left();
- aOld.SetLeft ( LONG_MAX );
+ aOld.SetLeft ( SAL_MAX_INT32 );
aOld.SetRightMax( aOld.GetRight() );
}
@@ -2765,7 +2765,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
{
nLeftMin = pTab->GetPrtTop() - pPage->getFrameArea().Top();
aOld.SetLeft ( 0 );
- aOld.SetRightMax( LONG_MAX );
+ aOld.SetRightMax( SAL_MAX_INT32 );
}
aOld.SetLeftMin ( nLeftMin );
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index d5070c99cf6b..f7a4ccfd5a94 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -433,7 +433,7 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly )
{
if( !bTstOnly )
{
- long nHeight = 0;
+ sal_Int32 nHeight = 0;
for ( auto pLn : aRowArr )
{
@@ -1293,7 +1293,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<sal_Int32>( MINLAY, nRet ));
}
/* The Line is within the Selection but not outlined by the TabCols.
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index cc96d70a4513..93a58d2a4fb1 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -1045,7 +1045,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const
}
nMin -= MINFLY;
}
- aSz.setWidth( std::max( aSz.Width(), nMin ) );
+ aSz.setWidth( std::max<sal_Int32>( aSz.Width(), nMin ) );
}
SwFrameFormat *pFormat = GetFormat();
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index f6b731ba2be1..9f8f24e5cdf9 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1353,7 +1353,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
// allocated values
Point aPt( pFly->getFramePrintArea().Pos() );
aPt += pFly->getFrameArea().Pos();
- if ( rRect.Top() != LONG_MIN && rRect.Pos() != aPt && !bPosProt )
+ if ( rRect.Top() != RECT_MIN && rRect.Pos() != aPt && !bPosProt )
{
aPt = rRect.Pos();
aPt.setX(aPt.getX() - pFly->getFramePrintArea().Left());
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index c1aa0935a071..842d9250f869 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1465,7 +1465,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool
const SdrObject *pBest = nullptr,
*pTop = nullptr;
- const long nTmp = bNext ? LONG_MAX : 0;
+ const long nTmp = bNext ? RECT_MAX : 0;
Point aBestPos( nTmp, nTmp );
Point aTopPos( nTmp, nTmp );
Point aCurPos;
@@ -1629,7 +1629,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool
}
}
// unfortunately nothing found
- if( bNext ? (aBestPos.getX() == LONG_MAX) : (aBestPos.getX() == 0) )
+ if( bNext ? (aBestPos.getX() == RECT_MAX) : (aBestPos.getX() == 0) )
pBest = pTop;
}
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 4f4f64453f93..d820a4c7e7f2 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -585,9 +585,9 @@ void SwFEShell::GetTabRows_(SwTabCols &rToFill, const SwFrame *pBox) const
const long nLeftMin = ( aRectFnSet.IsVert() ?
pTab->GetPrtLeft() - pPage->getFrameArea().Left() :
pTab->GetPrtTop() - pPage->getFrameArea().Top() );
- const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0;
+ const long nLeft = aRectFnSet.IsVert() ? SAL_MAX_INT32 : 0;
const long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea());
- const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX;
+ const long nRightMax = aRectFnSet.IsVert() ? nRight : SAL_MAX_INT32;
if (m_pRowCache->pLastTabFrame != pTab || m_pRowCache->pLastCellFrame != pBox)
bDel = true;
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 23553e79ae16..2561528e94b8 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -260,9 +260,9 @@ void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd,
SwSelUnions aUnions;
::MakeSelUnions( aUnions, pStart, pEnd, eSearchType );
- Point aCurrentTopLeft( LONG_MAX, LONG_MAX );
- Point aCurrentTopRight( 0, LONG_MAX );
- Point aCurrentBottomLeft( LONG_MAX, 0 );
+ Point aCurrentTopLeft( RECT_MAX, RECT_MAX );
+ Point aCurrentTopRight( 0, RECT_MAX );
+ Point aCurrentBottomLeft( RECT_MAX, 0 );
Point aCurrentBottomRight( 0, 0 );
const SwCellFrame* pCurrentTopLeftFrame = nullptr;
const SwCellFrame* pCurrentTopRightFrame = nullptr;
@@ -573,7 +573,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
// they're all adjacent
size_t n;
sal_uInt16 nCellCnt = 0;
- long nYPos = LONG_MAX;
+ long nYPos = SAL_MAX_INT32;
long nXPos = 0;
long nHeight = 0;
@@ -1809,7 +1809,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart,
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 long nWish = std::max<sal_Int32>( 1, pTable->GetFormat()->GetFrameSize().GetWidth() );
while ( pTable )
{
SwRectFnSet aRectFnSet(pTable);
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ee21f12bd6f0..d9c88684d9d0 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -846,20 +846,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 );
+ sal_Int32 GetTopMargin() const;
+ sal_Int32 GetBottomMargin() const;
+ sal_Int32 GetLeftMargin() const;
+ sal_Int32 GetRightMargin() const;
+ void SetTopBottomMargins( sal_Int32, sal_Int32 );
+ void SetLeftRightMargins( sal_Int32, sal_Int32 );
+ void SetRightLeftMargins( sal_Int32, sal_Int32 );
+ sal_Int32 GetPrtLeft() const;
+ sal_Int32 GetPrtBottom() const;
+ sal_Int32 GetPrtRight() const;
+ sal_Int32 GetPrtTop() const;
+ bool SetMinLeft( sal_Int32 );
+ bool SetMaxBottom( sal_Int32 );
+ bool SetMaxRight( sal_Int32 );
void MakeBelowPos( const SwFrame*, const SwFrame*, bool );
void MakeLeftPos( const SwFrame*, const SwFrame*, bool );
void MakeRightPos( const SwFrame*, const SwFrame*, bool );
@@ -1224,11 +1224,11 @@ public:
}
};
-typedef long (SwFrame:: *SwFrameGet)() const;
-typedef bool (SwFrame:: *SwFrameMax)( long );
+typedef sal_Int32 (SwFrame:: *SwFrameGet)() const;
+typedef bool (SwFrame:: *SwFrameMax)( sal_Int32 );
typedef void (SwFrame:: *SwFrameMakePos)( const SwFrame*, const SwFrame*, bool );
-typedef long (*SwOperator)( long, long );
-typedef void (SwFrame:: *SwFrameSet)( long, long );
+typedef sal_Int32 (*SwOperator)( sal_Int32, sal_Int32 );
+typedef void (SwFrame:: *SwFrameSet)( sal_Int32, sal_Int32 );
struct SwRectFnCollection
{
@@ -1316,58 +1316,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)(); }
+ sal_Int32 GetTop (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetTop) (); }
+ sal_Int32 GetBottom(const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetBottom)(); }
+ sal_Int32 GetLeft (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetLeft) (); }
+ sal_Int32 GetRight (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetRight) (); }
+ sal_Int32 GetWidth (const SwRect& rRect) const { return (rRect.*m_fnRect->fnGetWidth) (); }
+ sal_Int32 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, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetTop) (nNew); }
+ void SetBottom(SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetBottom)(nNew); }
+ void SetLeft (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetLeft) (nNew); }
+ void SetRight (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetRight) (nNew); }
+ void SetWidth (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetWidth) (nNew); }
+ void SetHeight(SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetHeight)(nNew); }
+
+ void SubTop (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSubTop) (nNew); }
+ void AddBottom(SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnAddBottom)(nNew); }
+ void SubLeft (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSubLeft) (nNew); }
+ void AddRight (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnAddRight) (nNew); }
+ void AddWidth (SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnAddWidth) (nNew); }
+ void AddHeight(SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnAddHeight)(nNew); }
+
+ void SetPosX(SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetPosX)(nNew); }
+ void SetPosY(SwRect& rRect, sal_Int32 nNew) const { (rRect.*m_fnRect->fnSetPosY)(nNew); }
+
+ sal_Int32 GetTopMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetTopMargin) (); }
+ sal_Int32 GetBottomMargin(const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetBottomMargin)(); }
+ sal_Int32 GetLeftMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetLeftMargin) (); }
+ sal_Int32 GetRightMargin (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetRightMargin) (); }
+ void SetXMargins(SwFrame& rFrame, sal_Int32 nLeft, sal_Int32 nRight) const { (rFrame.*m_fnRect->fnSetXMargins)(nLeft, nRight); }
+ void SetYMargins(SwFrame& rFrame, sal_Int32 nTop, sal_Int32 nBottom) const { (rFrame.*m_fnRect->fnSetYMargins)(nTop, nBottom); }
+ sal_Int32 GetPrtTop (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtTop) (); }
+ sal_Int32 GetPrtBottom (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtBottom) (); }
+ sal_Int32 GetPrtLeft (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtLeft) (); }
+ sal_Int32 GetPrtRight (const SwFrame& rFrame) const { return (rFrame.*m_fnRect->fnGetPrtRight) (); }
+ sal_Int32 TopDist (const SwRect& rRect, sal_Int32 nPos) const { return (rRect.*m_fnRect->fnTopDist) (nPos); }
+ sal_Int32 BottomDist(const SwRect& rRect, sal_Int32 nPos) const { return (rRect.*m_fnRect->fnBottomDist) (nPos); }
+ sal_Int32 LeftDist (const SwRect& rRect, sal_Int32 nPos) const { return (rRect.*m_fnRect->fnLeftDist) (nPos); }
+ sal_Int32 RightDist (const SwRect& rRect, sal_Int32 nPos) const { return (rRect.*m_fnRect->fnRightDist) (nPos); }
+ void SetLimit (SwFrame& rFrame, sal_Int32 nNew) const { (rFrame.*m_fnRect->fnSetLimit) (nNew); }
+ bool OverStep (const SwRect& rRect, sal_Int32 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); }
+ sal_Int32 XDiff(sal_Int32 n1, sal_Int32 n2) const { return (m_fnRect->fnXDiff) (n1, n2); }
+ sal_Int32 YDiff(sal_Int32 n1, sal_Int32 n2) const { return (m_fnRect->fnYDiff) (n1, n2); }
+ sal_Int32 XInc (sal_Int32 n1, sal_Int32 n2) const { return (m_fnRect->fnXInc) (n1, n2); }
+ sal_Int32 YInc (sal_Int32 n1, sal_Int32 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, sal_Int32 nLeft, sal_Int32 nWidth) const { (rRect.*m_fnRect->fnSetLeftAndWidth)(nLeft, nWidth); }
+ void SetTopAndHeight(SwRect& rRect, sal_Int32 nTop, sal_Int32 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 c0ecd3463b02..98fdfaf85588 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -47,7 +47,7 @@ class SwFrameFormats;
class SwRegionRects;
#define FAR_AWAY (SAL_MAX_INT32 - 20000) // initial position of a Fly
-#define BROWSE_HEIGHT (56700L * 10L) // 10 Meters
+#define BROWSE_HEIGHT (56700 * 10) // 10 Meters
#define GRFNUM_NO 0
#define GRFNUM_YES 1
#define GRFNUM_REPLACE 2
@@ -125,7 +125,7 @@ extern bool bDontCreateObjects;
extern bool bSetCompletePaintOnInvalidate;
// for table settings via keyboard
-long CalcRowRstHeight( SwLayoutFrame *pRow );
+SwTwips CalcRowRstHeight( SwLayoutFrame *pRow );
long CalcHeightWithFlys( const SwFrame *pFrame );
SwPageFrame *InsertNewPage( SwPageDesc &rDesc, SwFrame *pUpper,
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 288055e9e30a..dfa8452a135c 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -201,8 +201,8 @@ public:
bool CalcFlyOffsets(
SwTwips& rUpper,
- long& rLeftOffset,
- long& rRightOffset ) const;
+ sal_Int32& rLeftOffset,
+ sal_Int32& rRightOffset ) const;
SwTwips CalcHeightOfFirstContentLine() const;
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 87142b7f0e6f..c9a275d989d5 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -157,7 +157,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & )
( pNewUpper->IsColBodyFrame() &&
!pNewUpper->GetUpper()->GetPrev() &&
!pNewUpper->GetUpper()->GetNext() ) ) ) )
- nSpace += pNewUpper->Grow( LONG_MAX, true );
+ nSpace += pNewUpper->Grow( SAL_MAX_INT32, true );
if ( nMoveAnyway < 3 )
{
@@ -644,15 +644,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, sal_Int32& rBot)
{
// And then there can be paragraph anchored frames that sit below their paragraph.
- long nMax = 0;
+ sal_Int32 nMax = 0;
for (SwAnchoredObject* pObj : rSortedObjs)
{
// #i28701# - consider changed type of <SwSortedObjs>
// entries.
- long nTmp = 0;
+ sal_Int32 nTmp = 0;
if ( dynamic_cast<const SwFlyFrame*>( pObj) != nullptr )
{
SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pObj);
@@ -679,11 +679,11 @@ size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const
"SwPageFrame::GetContentHeight(): No support for columns.");
// In pages without columns, the content defines the size.
- long nBot = getFrameArea().Top() + nTop;
+ sal_Int32 nBot = getFrameArea().Top() + nTop;
const SwFrame *pFrame = Lower();
while (pFrame)
{
- long nTmp = 0;
+ sal_Int32 nTmp = 0;
const SwFrame *pCnt = static_cast<const SwLayoutFrame*>(pFrame)->ContainsAny();
while (pCnt && (pCnt->GetUpper() == pFrame ||
static_cast<const SwLayoutFrame*>(pFrame)->IsAnLower(pCnt)))
@@ -812,7 +812,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
else
{
// In pages without columns, the content defines the size.
- long nBot = GetContentHeight(nTop, nBottom);
+ sal_Int32 nBot = GetContentHeight(nTop, nBottom);
// #i35143# - If second page frame
// exists, the first page doesn't have to fulfill the
@@ -823,7 +823,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
// #i35143# - Assure, that the page
// doesn't exceed the defined browse height.
- aFrm.Height( std::min( nBot, BROWSE_HEIGHT ) );
+ aFrm.Height( std::min<sal_Int32>( nBot, BROWSE_HEIGHT ) );
}
}
@@ -1053,7 +1053,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;
+ sal_Int32 nMinWidth = 0;
for (size_t i = 0; GetDrawObjs() && i < GetDrawObjs()->size(); ++i)
{
@@ -1070,14 +1070,14 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
if ( RndStdIds::FLY_AS_CHAR == rFormat.GetAnchor().GetAnchorId() )
{
- nMinWidth = std::max( nMinWidth,
+ nMinWidth = std::max<sal_Int32>( nMinWidth,
bFly ? rFormat.GetFrameSize().GetWidth()
: pObj->GetObjRect().Width() );
}
}
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
- long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() );
+ sal_Int32 nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() );
nWidth -= aRectFnSet.GetLeft(getFramePrintArea());
nWidth -= rAttrs.CalcRightLine();
nWidth = std::max( nMinWidth, nWidth );
@@ -1091,7 +1091,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<sal_Int32>( MINLAY, aRectFnSet.GetWidth(getFrameArea()) ) );
SwTwips nTmp = aRectFnSet.GetWidth(getFrameArea()) - aRectFnSet.GetWidth(aPrt);
if( aRectFnSet.GetLeft(aPrt) > nTmp )
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index efb776eaaef4..7ab121525bae 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -39,7 +39,7 @@ SwColumnFrame::SwColumnFrame( SwFrameFormat *pFormat, SwFrame* pSib ):
mnFrameType = SwFrameType::Column;
SwBodyFrame* pColBody = new SwBodyFrame( pFormat->GetDoc()->GetDfltFrameFormat(), pSib );
pColBody->InsertBehind( this, nullptr ); // ColumnFrames now with BodyFrame
- SetMaxFootnoteHeight( LONG_MAX );
+ SetMaxFootnoteHeight( SAL_MAX_INT32 );
}
void SwColumnFrame::DestroyImpl()
@@ -132,7 +132,7 @@ static bool lcl_AddColumns( SwLayoutFrame *pCont, sal_uInt16 nCount )
bool bRet;
SwTwips nMax = pCont->IsPageBodyFrame() ?
- pCont->FindPageFrame()->GetMaxFootnoteHeight() : LONG_MAX;
+ pCont->FindPageFrame()->GetMaxFootnoteHeight() : SAL_MAX_INT32;
if ( pNeighbourCol )
{
bRet = false;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 75a064fa6e55..8427c9920a66 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1427,7 +1427,7 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs,
// former consideration
if ( pOwn->IsTextFrame() )
{
- nAdd = std::max( nAdd, static_cast<SwTextFrame*>(pOwn)->GetLineSpace() );
+ nAdd = std::max<sal_Int32>( nAdd, static_cast<SwTextFrame*>(pOwn)->GetLineSpace() );
}
nUpper += nAdd;
}
@@ -1453,7 +1453,7 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs,
}
else
{
- nAdd = std::max( nAdd, static_cast<SwTextFrame*>(pOwn)->GetLineSpace( true ) );
+ nAdd = std::max<sal_Int32>( nAdd, static_cast<SwTextFrame*>(pOwn)->GetLineSpace( true ) );
}
}
nUpper += nAdd;
@@ -1469,7 +1469,7 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs,
{
// former consideration
if ( pOwn->IsTextFrame() )
- nUpper = std::max( nUpper, static_cast<SwTextFrame*>(pOwn)->GetLineSpace() );
+ nUpper = std::max<sal_Int32>( nUpper, static_cast<SwTextFrame*>(pOwn)->GetLineSpace() );
if ( nPrevLineSpacing != 0 )
{
nUpper = std::max( nUpper, nPrevLineSpacing );
@@ -1499,7 +1499,7 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs,
}
else
{
- nAdd = std::max( nAdd, static_cast<SwTextFrame*>(pOwn)->GetLineSpace( true ) );
+ nAdd = std::max<sal_Int32>( nAdd, static_cast<SwTextFrame*>(pOwn)->GetLineSpace( true ) );
}
}
nUpper += nAdd;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index cfdcec89b779..fb3a33f105c4 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1054,7 +1054,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos )
SwFrameFormat *pFormat = GetFormat();
const bool bVert = GetAnchorFrame()->IsVertical();
const SwTwips nNewY = bVert ? rNewPos.X() : rNewPos.Y();
- SwTwips nTmpY = nNewY == LONG_MAX ? 0 : nNewY;
+ SwTwips nTmpY = nNewY == SAL_MAX_INT32 ? 0 : nNewY;
if( bVert )
nTmpY = -nTmpY;
SfxItemSet aSet( pFormat->GetDoc()->GetAttrPool(),
@@ -1079,7 +1079,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos )
{
if( text::RelOrientation::CHAR == aVert.GetRelationOrient() && IsAutoPos() )
{
- if( LONG_MAX != nNewY )
+ if( SAL_MAX_INT32 != nNewY )
{
aVert.SetVertOrient( text::VertOrientation::NONE );
sal_Int32 nOfs =
@@ -1113,7 +1113,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos )
if ( !IsFlyInContentFrame() )
{
const SwTwips nNewX = bVert ? rNewPos.Y() : rNewPos.X();
- SwTwips nTmpX = nNewX == LONG_MAX ? 0 : nNewX;
+ SwTwips nTmpX = nNewX == SAL_MAX_INT32 ? 0 : nNewX;
SwFormatHoriOrient aHori( pFormat->GetHoriOrient() );
// #i34948# - handle also at-page and at-fly anchored
// Writer fly frames
@@ -1134,7 +1134,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos )
aHori.SetHoriOrient( text::HoriOrientation::NONE );
if( text::RelOrientation::CHAR == aHori.GetRelationOrient() && IsAutoPos() )
{
- if( LONG_MAX != nNewX )
+ if( SAL_MAX_INT32 != nNewX )
{
if( !pAutoFrame )
{
@@ -1762,8 +1762,8 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst )
if ( Lower() && !IsColLocked() && !HasFixSize() )
{
SwTwips nSize = aRectFnSet.GetHeight(getFrameArea());
- if( nSize > 0 && nDist > ( LONG_MAX - nSize ) )
- nDist = LONG_MAX - nSize;
+ if( nSize > 0 && nDist > ( SAL_MAX_INT32 - nSize ) )
+ nDist = SAL_MAX_INT32 - nSize;
if ( nDist <= 0 )
return 0;
@@ -2335,7 +2335,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;
+ sal_Int32 nRelWidth = SAL_MAX_INT32, nRelHeight = SAL_MAX_INT32;
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
if ( ( pRel->IsBodyFrame() || pRel->IsPageFrame() ) &&
pSh && pSh->GetViewOptions()->getBrowseMode() &&
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 71cdcc029235..2b11e5cab57d 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -599,7 +599,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet,
{
// <rPt> point is above environment of given content frame
// correct for vertical layout?
- rRet.nMain = LONG_MAX;
+ rRet.nMain = SAL_MAX_INT32;
}
else if( rPt.X() < pUp->getFrameArea().Left() &&
rPt.Y() <= ( bVert ? pUp->getFrameArea().Top() : pUp->getFrameArea().Bottom() ) )
@@ -625,7 +625,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet,
return pCnt;
}
else
- rRet.nMain = LONG_MAX;
+ rRet.nMain = SAL_MAX_INT32;
}
else
{
@@ -844,7 +844,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet,
return pLay;
}
else
- rRet.nMain = LONG_MAX;
+ rRet.nMain = SAL_MAX_INT32;
}
}
return nullptr;
@@ -876,10 +876,10 @@ static sal_uInt64 lcl_FindCntDiff( const Point &rPt, const SwLayoutFrame *pLay,
{
//Calculate the distance between those two points.
//'delta' X^2 + 'delta' Y^2 = 'distance'^2
- sal_uInt64 dX = std::max( pCnt->getFrameArea().Left(), rPt.X() ) -
- std::min( pCnt->getFrameArea().Left(), rPt.X() ),
- dY = std::max( pCnt->getFrameArea().Top(), rPt.Y() ) -
- std::min( pCnt->getFrameArea().Top(), rPt.Y() );
+ sal_uInt64 dX = std::max<sal_Int32>( pCnt->getFrameArea().Left(), rPt.X() ) -
+ std::min<sal_Int32>( pCnt->getFrameArea().Left(), rPt.X() ),
+ dY = std::max<sal_Int32>( pCnt->getFrameArea().Top(), rPt.Y() ) -
+ std::min<sal_Int32>( pCnt->getFrameArea().Top(), rPt.Y() );
// square of the difference will do fine here
const sal_uInt64 nDiff = (dX * dX) + (dY * dY);
if ( pCnt->getFrameArea().Top() <= rPt.Y() )
@@ -1098,8 +1098,8 @@ const SwContentFrame *FindAnchor( const SwFrame *pOldAnch, const Point &rNew,
}
}
if ( !pUpFrame )
- nUp.nMain = LONG_MAX;
- if ( nUp.nMain >= 0 && LONG_MAX != nUp.nMain )
+ nUp.nMain = SAL_MAX_INT32;
+ if ( nUp.nMain >= 0 && SAL_MAX_INT32 != nUp.nMain )
{
bNegAllowed = false;
if ( nUpLst.nMain < 0 ) //don't take the wrong one, if the value
@@ -1114,7 +1114,7 @@ const SwContentFrame *FindAnchor( const SwFrame *pOldAnch, const Point &rNew,
const SwContentFrame *pDownFrame = pCnt;
SwDistance nDownLst;
if ( nDown.nMain < 0 )
- nDown.nMain = LONG_MAX;
+ nDown.nMain = SAL_MAX_INT32;
do
{
pDownLst = pDownFrame; nDownLst = nDown;
@@ -1126,31 +1126,31 @@ const SwContentFrame *FindAnchor( const SwFrame *pOldAnch, const Point &rNew,
{
::lcl_CalcDownDist( nDown, aNew, pDownFrame );
if ( nDown.nMain < 0 )
- nDown.nMain = LONG_MAX;
+ nDown.nMain = SAL_MAX_INT32;
//It makes sense to search further, if the distance grows inside
//a table.
if ( pDownLst->IsInTab() && pDownFrame->IsInTab() )
{
- while ( pDownFrame && ( ( nDown.nMain != LONG_MAX && pDownFrame->IsInTab()) || bBody != pDownFrame->IsInDocBody() ) )
+ while ( pDownFrame && ( ( nDown.nMain != SAL_MAX_INT32 && pDownFrame->IsInTab()) || bBody != pDownFrame->IsInDocBody() ) )
{
pDownFrame = pDownFrame->GetNextContentFrame();
if ( pDownFrame )
::lcl_CalcDownDist( nDown, aNew, pDownFrame );
if ( nDown.nMain < 0 )
- nDown.nMain = LONG_MAX;
+ nDown.nMain = SAL_MAX_INT32;
}
}
}
if ( !pDownFrame )
- nDown.nMain = LONG_MAX;
+ nDown.nMain = SAL_MAX_INT32;
} while ( pDownFrame && nDown <= nDownLst &&
- nDown.nMain != LONG_MAX && nDownLst.nMain != LONG_MAX );
+ nDown.nMain != SAL_MAX_INT32 && nDownLst.nMain != SAL_MAX_INT32 );
//If we couldn't find one in both directions, we'll search the Content whose
//left upper corner is the nearest to the point. Such a situation may
//happen, if the point doesn't lay in the text flow but in any margin.
- if ( nDownLst.nMain == LONG_MAX && nUpLst.nMain == LONG_MAX )
+ if ( nDownLst.nMain == SAL_MAX_INT32 && nUpLst.nMain == SAL_MAX_INT32 )
{
// If an OLE objects, which is contained in a fly frame
// is resized in inplace mode and the new Position is outside the
@@ -1274,7 +1274,7 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew )
nX = pCnt->getFrameArea().Left() - pOriginal->getFrameArea().Left();
}
- if ( nY == LONG_MAX )
+ if ( nY == SAL_MAX_INT32 )
{
// #i70582#
const SwTwips nTopForObjPos = lcl_GetTopForObjPos(pCnt, bVert, bVertL2R);
@@ -1343,9 +1343,9 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew )
}
ResetLastCharRectHeight();
if( text::RelOrientation::CHAR == pFormat->GetVertOrient().GetRelationOrient() )
- nY = LONG_MAX;
+ nY = SAL_MAX_INT32;
if( text::RelOrientation::CHAR == pFormat->GetHoriOrient().GetRelationOrient() )
- nX = LONG_MAX;
+ nX = SAL_MAX_INT32;
}
else
{
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 2a20c9c70e9d..b1c67634618b 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -485,10 +485,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 sal_Int32 nBot = getFrameArea().Top() + getFrameArea().Height();
+ const sal_Int32 nRig = getFrameArea().Left() + getFrameArea().Width();
+ const sal_Int32 nClipBot = aClip.Top() + aClip.Height();
+ const sal_Int32 nClipRig = aClip.Left() + aClip.Width();
const bool bBot = nBot > nClipBot;
const bool bRig = nRig > nClipRig;
@@ -660,7 +660,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
aFrm.Height( aFrameRect.Height() );
- aFrm.Width ( std::max( long(MINLAY), aFrameRect.Width() ) );
+ aFrm.Width ( std::max<sal_Int32>( MINLAY, aFrameRect.Width() ) );
}
if ( Lower() && Lower()->IsColumnFrame() )
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 0df9ee9c5900..ab4bd72e3b04 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3160,7 +3160,7 @@ SwTwips CalcRowRstHeight( SwLayoutFrame *pRow )
{
return 0;
}
- SwTwips nRstHeight = LONG_MAX;
+ SwTwips nRstHeight = RECT_MAX;
while (pLow && pLow->IsLayoutFrame())
{
nRstHeight = std::min(nRstHeight, ::lcl_CalcCellRstHeight(static_cast<SwLayoutFrame*>(pLow)));
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index e8eddce278c1..5a0a5a942665 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -216,7 +216,7 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const
bGrow = false;
}
if( bGrow )
- Grow( LONG_MAX );
+ Grow( SAL_MAX_INT32 );
else
{
// VarSize is determined based on the content plus the borders
@@ -261,7 +261,7 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const
SwTwips nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
if( nPrtHeight < 0 )
{
- const SwTwips nTmpDiff = std::max( aRectFnSet.GetTop(getFramePrintArea()), -nPrtHeight );
+ const SwTwips nTmpDiff = std::max<sal_Int32>( aRectFnSet.GetTop(getFramePrintArea()), -nPrtHeight );
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aRectFnSet.SubTop( aPrt, nTmpDiff );
}
@@ -275,14 +275,14 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const
SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
{
// No check if FixSize since FootnoteContainer are variable up to their max. height.
- // If the max. height is LONG_MAX, take as much space as needed.
+ // If the max. height is SAL_MAX_INT32, take as much space as needed.
// If the page is a special footnote page, take also as much as possible.
assert(GetUpper() && GetUpper()->IsFootnoteBossFrame());
SwRectFnSet aRectFnSet(this);
if( aRectFnSet.GetHeight(getFrameArea()) > 0 &&
- nDist > ( LONG_MAX - aRectFnSet.GetHeight(getFrameArea()) ) )
- nDist = LONG_MAX - aRectFnSet.GetHeight(getFrameArea());
+ nDist > ( SAL_MAX_INT32 - aRectFnSet.GetHeight(getFrameArea()) ) )
+ nDist = SAL_MAX_INT32 - aRectFnSet.GetHeight(getFrameArea());
SwFootnoteBossFrame *pBoss = static_cast<SwFootnoteBossFrame*>(GetUpper());
if( IsInSct() )
@@ -303,9 +303,9 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
SwPageFrame *pPage = pBoss->FindPageFrame();
if ( bBrowseMode || !pPage->IsFootnotePage() )
{
- if ( pBoss->GetMaxFootnoteHeight() != LONG_MAX )
+ if ( pBoss->GetMaxFootnoteHeight() != SAL_MAX_INT32 )
{
- nDist = std::min( nDist, pBoss->GetMaxFootnoteHeight()
+ nDist = std::min<sal_Int32>( nDist, pBoss->GetMaxFootnoteHeight()
- aRectFnSet.GetHeight(getFrameArea()) );
if ( nDist <= 0 )
return 0;
@@ -2414,13 +2414,13 @@ void SwFootnoteBossFrame::SetFootnoteDeadLine( const SwTwips nDeadLine )
const SwViewShell *pSh = getRootFrame() ? getRootFrame()->GetCurrShell() : nullptr;
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
- m_nMaxFootnoteHeight += pBody->Grow( LONG_MAX, true );
+ m_nMaxFootnoteHeight += pBody->Grow( SAL_MAX_INT32, true );
if ( IsInSct() )
- m_nMaxFootnoteHeight += FindSctFrame()->Grow( LONG_MAX, true );
+ m_nMaxFootnoteHeight += FindSctFrame()->Grow( SAL_MAX_INT32, true );
if ( m_nMaxFootnoteHeight < 0 )
m_nMaxFootnoteHeight = 0;
- if ( nMax != LONG_MAX && m_nMaxFootnoteHeight > nMax )
+ if ( nMax != SAL_MAX_INT32 && m_nMaxFootnoteHeight > nMax )
m_nMaxFootnoteHeight = nMax;
}
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index c2d2a46718c6..b3443ed68450 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -237,7 +237,7 @@ void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
ColLock();
- SwTwips nMaxHeight = LONG_MAX;
+ SwTwips nMaxHeight = SAL_MAX_INT32;
SwTwips nRemaining, nOldHeight;
// #i64301#
// use the position of the footer printing area to control invalidation
@@ -428,7 +428,7 @@ void SwHeadFootFrame::Format(vcl::RenderContext* pRenderContext, const SwBorderA
{
lcl_LayoutFrameEnsureMinHeight(*this);
- long nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
+ SwTwips nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
if ( !isFramePrintAreaValid() )
FormatPrt(nUL, pAttrs);
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 1bab86af7333..efe1a065c2e4 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -49,13 +49,13 @@ bool SwRootFrame::s_isNoVirDev = false;
SwCache *SwFrame::mpCache = nullptr;
-long FirstMinusSecond( long nFirst, long nSecond )
+sal_Int32 FirstMinusSecond( sal_Int32 nFirst, sal_Int32 nSecond )
{ return nFirst - nSecond; }
-long SecondMinusFirst( long nFirst, long nSecond )
+sal_Int32 SecondMinusFirst( sal_Int32 nFirst, sal_Int32 nSecond )
{ return nSecond - nFirst; }
-long SwIncrement( long nA, long nAdd )
+sal_Int32 SwIncrement( sal_Int32 nA, sal_Int32 nAdd )
{ return nA + nAdd; }
-long SwDecrement( long nA, long nSub )
+sal_Int32 SwDecrement( sal_Int32 nA, sal_Int32 nSub )
{ return nA - nSub; }
static SwRectFnCollection aHorizontal = {
@@ -107,7 +107,7 @@ static SwRectFnCollection aHorizontal = {
/*.fnXDiff =*/&FirstMinusSecond,
/*.fnYDiff =*/&FirstMinusSecond,
/*.fnXInc =*/&SwIncrement,
- /*.fnYInc =*/&o3tl::saturating_add<long>,
+ /*.fnYInc =*/&o3tl::saturating_add<sal_Int32>,
/*.fnSetLeftAndWidth =*/&SwRect::SetLeftAndWidth,
/*.fnSetTopAndHeight =*/&SwRect::SetTopAndHeight
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 238f44cc1afb..d787389b1934 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -184,7 +184,7 @@ SwPageFrame::SwPageFrame( SwFrameFormat *pFormat, SwFrame* pSib, SwPageDesc *pPg
else
m_bHasGrid = false;
SetMaxFootnoteHeight( pPgDsc->GetFootnoteInfo().GetHeight() ?
- pPgDsc->GetFootnoteInfo().GetHeight() : LONG_MAX );
+ pPgDsc->GetFootnoteInfo().GetHeight() : SAL_MAX_INT32 );
mnFrameType = SwFrameType::Page;
m_bInvalidLayout = m_bInvalidContent = m_bInvalidSpelling = m_bInvalidSmartTags = m_bInvalidAutoCmplWrds = m_bInvalidWordCount = true;
m_bInvalidFlyLayout = m_bInvalidFlyContent = m_bInvalidFlyInCnt = m_bFootnotePage = m_bEndNotePage = false;
@@ -551,7 +551,7 @@ void SwPageFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous();
SetMaxFootnoteHeight(m_pDesc->GetFootnoteInfo().GetHeight());
if(!GetMaxFootnoteHeight())
- SetMaxFootnoteHeight(LONG_MAX);
+ SetMaxFootnoteHeight(SAL_MAX_INT32);
SetColMaxFootnoteHeight();
// here, the page might be destroyed:
static_cast<SwRootFrame*>(GetUpper())->RemoveFootnotes(nullptr, false, true);
@@ -648,8 +648,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<sal_Int32>( rSz.GetHeight(), MINLAY ) );
+ aFrm.Width ( std::max<sal_Int32>( rSz.GetWidth(), MINLAY ) );
}
if ( GetUpper() )
@@ -1018,7 +1018,7 @@ void SwFrame::CheckPageDescs( SwPageFrame *pStart, bool bNotifyFields, SwPageFra
// For the update of page numbering fields, nDocPos provides
// the page position from where invalidation should start.
- SwTwips nDocPos = LONG_MAX;
+ SwTwips nDocPos = SAL_MAX_INT32;
SwRootFrame *pRoot = static_cast<SwRootFrame*>(pStart->GetUpper());
SwDoc* pDoc = pStart->GetFormat()->GetDoc();
@@ -1052,7 +1052,7 @@ void SwFrame::CheckPageDescs( SwPageFrame *pStart, bool bNotifyFields, SwPageFra
pImp->CheckWaitCursor();
// invalidate the field, starting from here
- if ( nDocPos == LONG_MAX )
+ if ( nDocPos == SAL_MAX_INT32 )
nDocPos = pPrevPage ? pPrevPage->getFrameArea().Top() : pPage->getFrameArea().Top();
// Cases:
@@ -1422,7 +1422,7 @@ void SwRootFrame::RemoveSuperfluous()
mbCheckSuperfluous = false;
SwPageFrame *pPage = GetLastPage();
- long nDocPos = LONG_MAX;
+ long nDocPos = SAL_MAX_INT32;
// Check the corresponding last page if it is empty and stop loop at the last non-empty page.
do
@@ -1488,7 +1488,7 @@ void SwRootFrame::RemoveSuperfluous()
} while ( pPage );
SwViewShell *pSh = getRootFrame()->GetCurrShell();
- if ( nDocPos != LONG_MAX &&
+ if ( nDocPos != SAL_MAX_INT32 &&
(!pSh || !pSh->Imp()->IsUpdateExpFields()) )
{
SwDocPosUpdate aMsgHint( nDocPos );
@@ -2291,7 +2291,7 @@ void SwRootFrame::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* p
const bool bLastColumn = pPageToAdjust->GetNext() == pEndOfRow;
const bool bLastRow = !pEndOfRow;
- nMinPageLeft = std::min( nMinPageLeft, aNewPagePos.getX() );
+ nMinPageLeft = std::min<sal_Int32>( nMinPageLeft, aNewPagePos.getX() );
nMaxPageRight = std::max( nMaxPageRight, aNewPagePos.getX() + nCurrentPageWidth);
// border of nGapBetweenPages around the current page:
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index f8baf5e1903e..1e1cb34a0a54 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5322,7 +5322,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
{
nY -= nGrid;
SwTwips nPosY = std::max( aInter.Left(), nY );
- SwTwips nHeight = std::min(nRight, aTmp.Pos().X())-nPosY;
+ SwTwips nHeight = std::min<sal_Int32>(nRight, aTmp.Pos().X())-nPosY;
if( nHeight > 0 )
{
if( bCell )
@@ -5355,7 +5355,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
if( bBorder )
{
SwTwips nPos = std::max( aInter.Left(), nY );
- SwTwips nW = std::min(nRight, aTmp.Pos().X()) - nPos;
+ SwTwips nW = std::min<sal_Int32>(nRight, aTmp.Pos().X()) - nPos;
SwRect aVert( Point( nPos, aGrid.Top() ),
Size( nW, 1 ) );
if( nW > 0 )
@@ -5413,7 +5413,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
if( bBorder )
{
SwTwips nPos = std::max( aInter.Left(), nY );
- SwTwips nW = std::min(nRight, aTmp.Pos().X()) - nPos;
+ SwTwips nW = std::min<sal_Int32>(nRight, aTmp.Pos().X()) - nPos;
SwRect aVert( Point( nPos, aGrid.Top() ),
Size( nW, 1 ) );
if( nW > 0 )
@@ -5452,7 +5452,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
if( bGrid )
{
nY += nGrid;
- SwTwips nPosY = std::max( aInter.Top(), aTmp.Pos().getY() );
+ SwTwips nPosY = std::max<sal_Int32>( aInter.Top(), aTmp.Pos().getY() );
SwTwips nHeight = std::min(nBottom, nY ) - nPosY;
if( nHeight )
{
@@ -5485,7 +5485,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
nY += nRuby;
if( bBorder )
{
- SwTwips nPos = std::max(aInter.Top(),aTmp.Pos().getY());
+ SwTwips nPos = std::max<sal_Int32>(aInter.Top(),aTmp.Pos().getY());
SwTwips nH = std::min( nBottom, nY ) - nPos;
SwRect aVert( Point( aGrid.Left(), nPos ),
Size( 1, nH ) );
@@ -5542,7 +5542,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
nY += nRuby;
if( bBorder )
{
- SwTwips nPos = std::max(aInter.Top(),aTmp.Pos().Y());
+ SwTwips nPos = std::max<sal_Int32>(aInter.Top(),aTmp.Pos().Y());
SwTwips nH = std::min( nBottom, nY ) - nPos;
SwRect aVert( Point( aGrid.Left(), nPos ),
Size( 1, nH ) );
@@ -6432,8 +6432,8 @@ static void lcl_RefreshLine( const SwLayoutFrame *pLay,
const bool bHori = rP1.Y() == rP2.Y();
// use pointers to member function in order to unify flow
- typedef long (Point:: *pmfPtGet)() const;
- typedef void (Point:: *pmfPtSet)(long);
+ typedef sal_Int32 (Point:: *pmfPtGet)() const;
+ typedef void (Point:: *pmfPtSet)(sal_Int32);
const pmfPtGet pDirPtX = &Point::X;
const pmfPtGet pDirPtY = &Point::Y;
const pmfPtGet pDirPt = bHori ? pDirPtX : pDirPtY;
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 8f68adf082c7..d338431054bf 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -782,7 +782,7 @@ void SwSectionFrame::MakeAll(vcl::RenderContext* pRenderContext)
bCanContainSplitSection = CanContainSplitSection(GetUpper());
if( pSh && (pSh->GetViewOptions()->getBrowseMode() || bCanContainSplitSection) &&
- ( Grow( LONG_MAX, true ) > 0 ) )
+ ( Grow( SAL_MAX_INT32, true ) > 0 ) )
{
while( GetFollow() )
{
@@ -2103,7 +2103,7 @@ bool SwSectionFrame::Growable() const
aRectFnSet.GetBottom(getFrameArea()) ) > 0 )
return true;
- return ( GetUpper() && const_cast<SwFrame*>(static_cast<SwFrame const *>(GetUpper()))->Grow( LONG_MAX, true ) );
+ return ( GetUpper() && const_cast<SwFrame*>(static_cast<SwFrame const *>(GetUpper()))->Grow( SAL_MAX_INT32, true ) );
}
SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
@@ -2112,8 +2112,8 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
{
SwRectFnSet aRectFnSet(this);
long nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
- if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) )
- nDist = LONG_MAX - nFrameHeight;
+ if( nFrameHeight > 0 && nDist > (SAL_MAX_INT32 - nFrameHeight) )
+ nDist = SAL_MAX_INT32 - nFrameHeight;
if ( nDist <= 0 )
return 0;
@@ -2140,7 +2140,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
SwTwips nSpace = nGrow;
if( !bInCalcContent && nGrow < nDist && GetUpper() )
nGrow = o3tl::saturating_add(
- nGrow, GetUpper()->Grow( LONG_MAX, true ));
+ nGrow, GetUpper()->Grow( SAL_MAX_INT32, true ));
if( nGrow > nDist )
nGrow = nDist;
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 8fceca4e8bd9..5242c953c828 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -33,24 +33,24 @@
#include <hints.hxx>
// No inline cause we need the function pointers
-long SwFrame::GetTopMargin() const
+sal_Int32 SwFrame::GetTopMargin() const
{ return getFramePrintArea().Top(); }
-long SwFrame::GetBottomMargin() const
+sal_Int32 SwFrame::GetBottomMargin() const
{ return getFrameArea().Height() -getFramePrintArea().Height() -getFramePrintArea().Top(); }
-long SwFrame::GetLeftMargin() const
+sal_Int32 SwFrame::GetLeftMargin() const
{ return getFramePrintArea().Left(); }
-long SwFrame::GetRightMargin() const
+sal_Int32 SwFrame::GetRightMargin() const
{ return getFrameArea().Width() - getFramePrintArea().Width() - getFramePrintArea().Left(); }
-long SwFrame::GetPrtLeft() const
+sal_Int32 SwFrame::GetPrtLeft() const
{ return getFrameArea().Left() + getFramePrintArea().Left(); }
-long SwFrame::GetPrtBottom() const
+sal_Int32 SwFrame::GetPrtBottom() const
{ return getFrameArea().Top() + getFramePrintArea().Height() + getFramePrintArea().Top(); }
-long SwFrame::GetPrtRight() const
+sal_Int32 SwFrame::GetPrtRight() const
{ return getFrameArea().Left() + getFramePrintArea().Width() + getFramePrintArea().Left(); }
-long SwFrame::GetPrtTop() const
+sal_Int32 SwFrame::GetPrtTop() const
{ return getFrameArea().Top() + getFramePrintArea().Top(); }
-bool SwFrame::SetMinLeft( long nDeadline )
+bool SwFrame::SetMinLeft( sal_Int32 nDeadline )
{
SwTwips nDiff = nDeadline - getFrameArea().Left();
if( nDiff > 0 )
@@ -66,7 +66,7 @@ bool SwFrame::SetMinLeft( long nDeadline )
return false;
}
-bool SwFrame::SetMaxBottom( long nDeadline )
+bool SwFrame::SetMaxBottom( sal_Int32 nDeadline )
{
SwTwips nDiff = getFrameArea().Top() + getFrameArea().Height() - nDeadline;
if( nDiff > 0 )
@@ -82,7 +82,7 @@ bool SwFrame::SetMaxBottom( long nDeadline )
return false;
}
-bool SwFrame::SetMaxRight( long nDeadline )
+bool SwFrame::SetMaxRight( sal_Int32 nDeadline )
{
SwTwips nDiff = getFrameArea().Left() + getFrameArea().Width() - nDeadline;
if( nDiff > 0 )
@@ -162,21 +162,21 @@ void SwFrame::MakeRightPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotif
}
}
-void SwFrame::SetTopBottomMargins( long nTop, long nBot )
+void SwFrame::SetTopBottomMargins( sal_Int32 nTop, sal_Int32 nBot )
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Top( nTop );
aPrt.Height( getFrameArea().Height() - nTop - nBot );
}
-void SwFrame::SetLeftRightMargins( long nLeft, long nRight)
+void SwFrame::SetLeftRightMargins( sal_Int32 nLeft, sal_Int32 nRight)
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Left( nLeft );
aPrt.Width( getFrameArea().Width() - nLeft - nRight );
}
-void SwFrame::SetRightLeftMargins( long nRight, long nLeft)
+void SwFrame::SetRightLeftMargins( sal_Int32 nRight, sal_Int32 nLeft)
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
aPrt.Left( nLeft );
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 67ee9cc37a18..39e730d73e2d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -515,7 +515,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;
+ sal_Int32 nMinHeight = 0;
// We have to take into account:
// 1. The fixed height of the row
@@ -611,7 +611,7 @@ static void lcl_PostprocessRowsInCells( SwTabFrame& rTab, SwRowFrame& rLastLine
lcl_MoveRowContent( *pFollowRow, *pRowFrame );
pFollowRow->Cut();
SwFrame::DestroyFrame(pFollowRow);
- ::SwInvalidateAll( pCurrMasterCell, LONG_MAX );
+ ::SwInvalidateAll( pCurrMasterCell, SAL_MAX_INT32 );
}
}
@@ -655,7 +655,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
rTab.SetConsiderObjsForMinCellHeight( true );
// invalidate last line
- ::SwInvalidateAll( &rLastLine, LONG_MAX );
+ ::SwInvalidateAll( &rLastLine, SAL_MAX_INT32 );
// Shrink the table to account for the shrunk last row, as well as lower rows
// that had been moved to follow table in SwTabFrame::Split.
@@ -681,7 +681,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
rLastLine.SetInSplit();
// Do the recalculation
- lcl_RecalcRow( &rLastLine, LONG_MAX );
+ lcl_RecalcRow( &rLastLine, SAL_MAX_INT32 );
// #115759# - force a format of the last line in order to
// get the correct height.
rLastLine.InvalidateSize();
@@ -754,14 +754,14 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine,
{
// Everything looks fine. Splitting seems to be successful. We invalidate
// rFollowLine to force a new formatting.
- ::SwInvalidateAll( &rFollowLine, LONG_MAX );
+ ::SwInvalidateAll( &rFollowLine, SAL_MAX_INT32 );
}
else
{
// Splitting the table row gave us an unexpected result.
// Everything has to be prepared for a second try to split
// the table, this time without splitting the row.
- ::SwInvalidateAll( &rLastLine, LONG_MAX );
+ ::SwInvalidateAll( &rLastLine, SAL_MAX_INT32 );
}
rTab.SetRebuildLastLine( false );
@@ -972,7 +972,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK
Lower()->InvalidatePos_();
// #i43913# - correction
// call method <lcl_InnerCalcLayout> with first lower.
- lcl_InnerCalcLayout( Lower(), LONG_MAX, true );
+ lcl_InnerCalcLayout( Lower(), SAL_MAX_INT32, true );
}
//In order to be able to compare the positions of the cells with CutPos,
@@ -1337,8 +1337,8 @@ bool SwTabFrame::Join()
void SwInvalidatePositions( SwFrame *pFrame, long nBottom )
{
- // LONG_MAX == nBottom means we have to calculate all
- bool bAll = LONG_MAX == nBottom;
+ // SAL_MAX_INT32 == nBottom means we have to calculate all
+ bool bAll = SAL_MAX_INT32 == nBottom;
SwRectFnSet aRectFnSet(pFrame);
do
{ pFrame->InvalidatePos_();
@@ -1362,8 +1362,8 @@ void SwInvalidatePositions( SwFrame *pFrame, long nBottom )
void SwInvalidateAll( SwFrame *pFrame, long nBottom )
{
- // LONG_MAX == nBottom means we have to calculate all
- bool bAll = LONG_MAX == nBottom;
+ // SAL_MAX_INT32 == nBottom means we have to calculate all
+ bool bAll = SAL_MAX_INT32 == nBottom;
SwRectFnSet aRectFnSet(pFrame);
do
{
@@ -1426,8 +1426,8 @@ bool SwContentFrame::CalcLowers( SwLayoutFrame* pLay, const SwLayoutFrame* pDont
return true;
vcl::RenderContext* pRenderContext = pLay->getRootFrame()->GetCurrShell()->GetOut();
- // LONG_MAX == nBottom means we have to calculate all
- bool bAll = LONG_MAX == nBottom;
+ // SAL_MAX_INT32 == nBottom means we have to calculate all
+ bool bAll = SAL_MAX_INT32 == nBottom;
bool bRet = false;
SwContentFrame *pCnt = pLay->ContainsContent();
SwRectFnSet aRectFnSet(pLay);
@@ -1516,8 +1516,8 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame,
bool _bOnlyRowsAndCells )
{
vcl::RenderContext* pRenderContext = pFrame->getRootFrame()->GetCurrShell() ? pFrame->getRootFrame()->GetCurrShell()->GetOut() : nullptr;
- // LONG_MAX == nBottom means we have to calculate all
- bool bAll = LONG_MAX == nBottom;
+ // SAL_MAX_INT32 == nBottom means we have to calculate all
+ bool bAll = SAL_MAX_INT32 == nBottom;
bool bRet = false;
const SwFrame* pOldUp = pFrame->GetUpper();
SwRectFnSet aRectFnSet(pFrame);
@@ -1673,8 +1673,8 @@ static void lcl_RecalcTable( SwTabFrame& rTab,
pFirstRow = static_cast<SwLayoutFrame*>(rTab.Lower());
rNotify.SetLowersComplete( true );
}
- ::SwInvalidatePositions( pFirstRow, LONG_MAX );
- lcl_RecalcRow( static_cast<SwRowFrame*>(pFirstRow), LONG_MAX );
+ ::SwInvalidatePositions( pFirstRow, SAL_MAX_INT32 );
+ lcl_RecalcRow( static_cast<SwRowFrame*>(pFirstRow), SAL_MAX_INT32 );
}
}
@@ -2124,7 +2124,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
SwFrame *pTmp = GetUpper();
SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*pTmp);
if ( bBrowseMode )
- nDeadLine += pTmp->Grow( LONG_MAX, true );
+ nDeadLine += pTmp->Grow( SAL_MAX_INT32, true );
bool bFits = aRectFnSet.BottomDist(getFrameArea(), nDeadLine) > 0;
if (!bFits && aRectFnSet.GetHeight(GetFollow()->getFrameArea()) == 0)
// The follow should move backwards, so allow the case
@@ -2141,9 +2141,9 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// invalidate and rebuild last row
if ( pLastLine )
{
- ::SwInvalidateAll( pLastLine, LONG_MAX );
+ ::SwInvalidateAll( pLastLine, SAL_MAX_INT32 );
SetRebuildLastLine( true );
- lcl_RecalcRow( static_cast<SwRowFrame*>(pLastLine), LONG_MAX );
+ lcl_RecalcRow( static_cast<SwRowFrame*>(pLastLine), SAL_MAX_INT32 );
SetRebuildLastLine( false );
}
@@ -2266,7 +2266,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
else if (m_bONECalcLowers)
{
- lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), LONG_MAX );
+ lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), SAL_MAX_INT32 );
m_bONECalcLowers = false;
}
}
@@ -2289,7 +2289,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
else if (m_bONECalcLowers)
{
- lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), LONG_MAX );
+ lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), SAL_MAX_INT32 );
m_bONECalcLowers = false;
}
@@ -2351,7 +2351,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper());
if( IsInSct() || GetUpper()->IsInTab() ) // TABLE IN TABLE)
nDeadLine = aRectFnSet.YInc( nDeadLine,
- GetUpper()->Grow( LONG_MAX, true ) );
+ GetUpper()->Grow( SAL_MAX_INT32, true ) );
{
SetInRecalcLowerRow( true );
@@ -2459,7 +2459,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// to nDeadLine may not be enough.
if ( bSplitError && bTryToSplit ) // no restart if we did not try to split: i72847, i79426
{
- lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), LONG_MAX );
+ lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), SAL_MAX_INT32 );
setFrameAreaPositionValid(false);
bTryToSplit = false;
continue;
@@ -2641,8 +2641,8 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
/// Calculate the offsets arising because of FlyFrames
bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
- long& rLeftOffset,
- long& rRightOffset ) const
+ sal_Int32& rLeftOffset,
+ sal_Int32& rRightOffset ) const
{
bool bInvalidatePrtArea = false;
const SwPageFrame *pPage = FindPageFrame();
@@ -2747,7 +2747,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
css::text::WrapTextMode_PARALLEL == rSur.GetSurround())&&
text::HoriOrientation::LEFT == rHori.GetHoriOrient() )
{
- const long nWidth = aRectFnSet.XDiff(
+ const sal_Int32 nWidth = aRectFnSet.XDiff(
aRectFnSet.GetRight(aFlyRect),
aRectFnSet.GetLeft(pFly->GetAnchorFrame()->getFrameArea()) );
rLeftOffset = std::max( rLeftOffset, nWidth );
@@ -2757,7 +2757,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
css::text::WrapTextMode_PARALLEL == rSur.GetSurround())&&
text::HoriOrientation::RIGHT == rHori.GetHoriOrient() )
{
- const long nWidth = aRectFnSet.XDiff(
+ const sal_Int32 nWidth = aRectFnSet.XDiff(
aRectFnSet.GetRight(pFly->GetAnchorFrame()->getFrameArea()),
aRectFnSet.GetLeft(aFlyRect) );
rRightOffset = std::max( rRightOffset, nWidth );
@@ -2781,7 +2781,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
SwRectFnSet aRectFnSet(this);
if ( !isFrameAreaSizeValid() )
{
- long nDiff = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea()) -
+ sal_Int32 nDiff = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea()) -
aRectFnSet.GetWidth(getFrameArea());
if( nDiff )
{
@@ -2800,14 +2800,14 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
//1. There are borders with SurroundNone, dodge them completely
//2. There are borders which only float on the right or the left side and
// are right or left aligned, those set the minimum for the borders.
- long nTmpRight = -1000000,
+ sal_Int32 nTmpRight = -1000000,
nLeftOffset = 0;
if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) )
{
setFramePrintAreaValid(false);
}
- long nRightOffset = std::max( 0L, nTmpRight );
+ sal_Int32 nRightOffset = std::max<sal_Int32>( 0, nTmpRight );
SwTwips nLower = pAttrs->CalcBottomLine();
// #i29550#
@@ -2874,7 +2874,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
nRightSpacing = nRightLine +
( ( (nWishRight+nLeftOffset) < 0 ) ?
(nWishRight+nLeftOffset) :
- std::max( 0L, nWishRight ) );
+ std::max<sal_Int32>( 0, nWishRight ) );
}
}
break;
@@ -2905,7 +2905,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
nLeftSpacing = nLeftLine +
( ( (nWishLeft+nRightOffset) < 0 ) ?
(nWishLeft+nRightOffset) :
- std::max( 0L, nWishLeft ) );
+ std::max<sal_Int32>( 0, nWishLeft ) );
}
}
break;
@@ -3006,7 +3006,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
//Don't overlap 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();
+ sal_Int32 nWidth = pSh->GetBrowseWidth();
nWidth -= getFramePrintArea().Left();
nWidth -= pAttrs->CalcRightLine();
@@ -3047,8 +3047,8 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
{
SwRectFnSet aRectFnSet(this);
SwTwips nHeight = aRectFnSet.GetHeight(getFrameArea());
- if( nHeight > 0 && nDist > ( LONG_MAX - nHeight ) )
- nDist = LONG_MAX - nHeight;
+ if( nHeight > 0 && nDist > ( SAL_MAX_INT32 - nHeight ) )
+ nDist = SAL_MAX_INT32 - nHeight;
if ( bTst && !IsRestrictTableGrowth() )
return nDist;
@@ -3069,7 +3069,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 );
+ sal_Int32 nTmp = GetUpper()->Grow( nDist - std::max<long>(nReal, 0), bTst, bInfo );
if ( IsRestrictTableGrowth() )
{
@@ -3435,7 +3435,7 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool &rReformat
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
- nSpace += pNewUpper->Grow( LONG_MAX, true );
+ nSpace += pNewUpper->Grow( SAL_MAX_INT32, true );
}
}
else if (!m_bLockBackMove)
@@ -3749,7 +3749,7 @@ void SwRowFrame::MakeAll(vcl::RenderContext* pRenderContext)
long CalcHeightWithFlys( const SwFrame *pFrame )
{
SwRectFnSet aRectFnSet(pFrame);
- long nHeight = 0;
+ sal_Int32 nHeight = 0;
const SwFrame* pTmp = pFrame->IsSctFrame() ?
static_cast<const SwSectionFrame*>(pFrame)->ContainsContent() : pFrame;
while( pTmp )
@@ -4504,8 +4504,8 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
const SwFormatFrameSize &rSz = pMod->GetFrameSize();
SwTwips nMinHeight = 0;
if (rSz.GetHeightSizeType() == ATT_MIN_SIZE)
- nMinHeight = std::max(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*this),
- 0L);
+ nMinHeight = std::max<sal_Int32>(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*this),
+ 0);
// Only necessary to calculate minimal row height if height
// of pRow is at least nMinHeight. Otherwise nMinHeight is the
@@ -5380,7 +5380,7 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrame& rSourceLine )
// In this case we have to return the maximum of the heights
// of the first lines in rSourceLine.
bool bIsInFollowFlowLine = rSourceLine.IsInFollowFlowRow();
- SwTwips nHeight = bIsInFollowFlowLine ? LONG_MAX : 0;
+ SwTwips nHeight = bIsInFollowFlowLine ? SAL_MAX_INT32 : 0;
while ( pCurrSourceCell )
{
@@ -5507,7 +5507,7 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrame& rSourceLine )
pCurrSourceCell = static_cast<const SwCellFrame*>(pCurrSourceCell->GetNext());
}
- return ( LONG_MAX == nHeight ) ? 0 : nHeight;
+ return ( SAL_MAX_INT32 == nHeight ) ? 0 : nHeight;
}
/// Function to calculate height of first text row
@@ -5618,8 +5618,8 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const
SwTwips nMinRowHeight = 0;
if (rSz.GetHeightSizeType() == ATT_MIN_SIZE)
{
- nMinRowHeight = std::max(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*pFirstRow),
- 0L);
+ nMinRowHeight = std::max<sal_Int32>(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*pFirstRow),
+ 0);
}
nTmpHeight += std::max( nHeightOfFirstContentLine, nMinRowHeight );
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index f322cc9d9cc6..b191afc0c709 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -178,10 +178,10 @@ bool SwPageFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint,
// check, if we have to adjust the point
if ( !getFrameArea().IsInside( aPoint ) )
{
- aPoint.setX( std::max( aPoint.X(), getFrameArea().Left() ) );
- aPoint.setX( std::min( aPoint.X(), getFrameArea().Right() ) );
- aPoint.setY( std::max( aPoint.Y(), getFrameArea().Top() ) );
- aPoint.setY( std::min( aPoint.Y(), getFrameArea().Bottom() ) );
+ aPoint.setX( std::max<sal_Int32>( aPoint.X(), getFrameArea().Left() ) );
+ aPoint.setX( std::min<sal_Int32>( aPoint.X(), getFrameArea().Right() ) );
+ aPoint.setY( std::max<sal_Int32>( aPoint.Y(), getFrameArea().Top() ) );
+ aPoint.setY( std::min<sal_Int32>( aPoint.Y(), getFrameArea().Bottom() ) );
}
bool bTextRet = false;
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 1107da6c4e94..a6e0a538055f 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1436,8 +1436,8 @@ SwTwips SwFrame::Grow( SwTwips nDist, bool bTst, bool bInfo )
SwRectFnSet aRectFnSet(this);
SwTwips nPrtHeight = aRectFnSet.GetHeight(getFramePrintArea());
- if( nPrtHeight > 0 && nDist > (LONG_MAX - nPrtHeight) )
- nDist = LONG_MAX - nPrtHeight;
+ if( nPrtHeight > 0 && nDist > (SAL_MAX_INT32 - nPrtHeight) )
+ nDist = SAL_MAX_INT32 - nPrtHeight;
if ( IsFlyFrame() )
return static_cast<SwFlyFrame*>(this)->Grow_( nDist, bTst );
@@ -1554,7 +1554,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
{
SwViewShell *pViewShell = getRootFrame()->GetCurrShell();
SwLayoutFrame *pUp = GetUpper();
- long nChg;
+ sal_Int32 nChg;
const long nUpPrtBottom = pUp->getFrameArea().Height() -
pUp->getFramePrintArea().Height() - pUp->getFramePrintArea().Top();
SwRect aInva( pUp->getFrameArea() );
@@ -1580,7 +1580,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
{
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pBody);
- aFrm.Height(std::max( 0L, aFrm.Height() - nChg ));
+ aFrm.Height(std::max<sal_Int32>( 0, aFrm.Height() - nChg ));
}
pBody->InvalidatePrt_();
@@ -2029,8 +2029,8 @@ SwTwips SwContentFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
SwTwips nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
if( nFrameHeight > 0 &&
- nDist > (LONG_MAX - nFrameHeight ) )
- nDist = LONG_MAX - nFrameHeight;
+ nDist > (SAL_MAX_INT32 - nFrameHeight ) )
+ nDist = SAL_MAX_INT32 - nFrameHeight;
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
const bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
@@ -2161,7 +2161,7 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
if( nRstHeight < 0 )
{
SwTwips nNextHeight = 0;
- if( GetUpper()->IsSctFrame() && nDist > LONG_MAX/2 )
+ if( GetUpper()->IsSctFrame() && nDist > SAL_MAX_INT32/2 )
{
SwFrame *pNxt = GetNext();
while( pNxt )
@@ -2552,8 +2552,8 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
const SwTwips nFrameHeight = aRectFnSet.GetHeight(getFrameArea());
const SwTwips nFramePos = getFrameArea().Pos().X();
- if ( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) )
- nDist = LONG_MAX - nFrameHeight;
+ if ( nFrameHeight > 0 && nDist > (SAL_MAX_INT32 - nFrameHeight) )
+ nDist = SAL_MAX_INT32 - nFrameHeight;
SwTwips nMin = 0;
if ( GetUpper() && !IsCellFrame() )
@@ -2747,7 +2747,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
{
if( !Lower()->IsNeighbourFrame() )
{ const SwFrame *pFrame = Lower();
- const long nTmp = aRectFnSet.GetHeight(getFramePrintArea());
+ const sal_Int32 nTmp = aRectFnSet.GetHeight(getFramePrintArea());
while( pFrame && nMin < nTmp )
{ nMin += aRectFnSet.GetHeight(pFrame->getFrameArea());
pFrame = pFrame->GetNext();
@@ -3507,7 +3507,7 @@ long SwLayoutFrame::CalcRel( const SwFormatFrameSize &rSz ) const
if ( nPercent )
{
const SwFrame *pRel = GetUpper();
- long nRel = LONG_MAX;
+ sal_Int32 nRel = SAL_MAX_INT32;
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if( pRel->IsPageBodyFrame() && pSh && bBrowseMode && pSh->VisArea().Width() )
@@ -3612,7 +3612,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
// nMinimum starts with the passed minimum height and is then remembered
// as the maximum height on which column content still juts out of a
// column.
- // nMaximum starts with LONG_MAX and is then remembered as the minimum
+ // nMaximum starts with SAL_MAX_INT32 and is then remembered as the minimum
// width on which the content fitted.
// In column based sections nMaximum starts at the maximum value which
// the surrounding defines, this can certainly be a value on which
@@ -3643,7 +3643,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
{
nMaximum = aRectFnSet.GetHeight(getFrameArea()) - nBorder +
aRectFnSet.BottomDist(getFrameArea(), aRectFnSet.GetPrtBottom(*GetUpper()));
- nMaximum += GetUpper()->Grow( LONG_MAX, true );
+ nMaximum += GetUpper()->Grow( SAL_MAX_INT32, true );
if( nMaximum < nMinimum )
{
if( nMaximum < 0 )
@@ -3687,7 +3687,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
}
}
else
- nMaximum = LONG_MAX;
+ nMaximum = SAL_MAX_INT32;
// #i3317# - reset temporarily consideration
// of wrapping style influence
@@ -3746,7 +3746,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs,
// OD 28.03.2003 #108446# - initialize local variable
SwTwips nDiff = 0;
SwTwips nMaxFree = 0;
- SwTwips nAllFree = LONG_MAX;
+ SwTwips nAllFree = SAL_MAX_INT32;
// set bFoundLower if there is at least one non-empty column
bool bFoundLower = false;
while( pCol )
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 2d2dd975ed65..50ba4487b4b8 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -530,11 +530,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(); }
+ sal_Int32 X() const { return rPoint.X(); }
+ sal_Int32 Y() const { return rPoint.Y(); }
+ sal_Int32 Left() const { return aFrame.Left(); }
+ sal_Int32 Right() const { return aFrame.Right(); }
+ sal_Int32 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; }
@@ -1403,7 +1403,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
nFirst = nFirst - nDist;
else
nFirst = 0;
- nDist = std::max( nDist, GetLineSpace() );
+ nDist = std::max<sal_Int32>( nDist, GetLineSpace() );
nDist += nLineHeight;
nDiff -= nFirst;
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index b6203899aee0..84f13c4ce4d0 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -231,11 +231,11 @@ bool SwTextFrame::CalcFollow( const sal_Int32 nTextOfst )
}
// The footnote area must not get larger
- SwSaveFootnoteHeight aSave( FindFootnoteBossFrame( true ), LONG_MAX );
+ SwSaveFootnoteHeight aSave( FindFootnoteBossFrame( true ), SAL_MAX_INT32 );
pMyFollow->CalcFootnoteFlag();
if ( !pMyFollow->GetNext() && !pMyFollow->HasFootnote() )
- nOldBottom = aRectFnSet.IsVert() ? 0 : LONG_MAX;
+ nOldBottom = aRectFnSet.IsVert() ? 0 : SAL_MAX_INT32;
while( true )
{
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index e90ad9126a13..4abf0cb7a153 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -183,7 +183,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
// 5. paragraph border
// Note: These values have already been used during calculation
// of the printing area of the paragraph.
- const int nLMWithNum = pNode->GetLeftMarginWithNum( true );
+ const sal_Int32 nLMWithNum = pNode->GetLeftMarginWithNum( true );
if ( m_pFrame->IsRightToLeft() )
{
// this calculation is identical this the calculation for L2R layout - see below
@@ -219,7 +219,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
else
{
nLeft = m_pFrame->getFrameArea().Left() +
- std::max( long( rSpace.GetTextLeft() + nLMWithNum ),
+ std::max<sal_Int32>( rSpace.GetTextLeft() + nLMWithNum,
m_pFrame->getFramePrintArea().Left() );
}
}
@@ -243,7 +243,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
else
{
short nFLOfst = 0;
- long nFirstLineOfs = 0;
+ sal_Int32 nFirstLineOfs = 0;
if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) &&
rSpace.IsAutoFirst() )
{
@@ -312,7 +312,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
else
{
nFirst = m_pFrame->getFrameArea().Left() +
- std::max( rSpace.GetTextLeft() + nLMWithNum+ nFirstLineOfs,
+ std::max<sal_Int32>( rSpace.GetTextLeft() + nLMWithNum+ nFirstLineOfs,
m_pFrame->getFramePrintArea().Left() );
}
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 7fc2ae4005df..bc3e03924115 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1969,7 +1969,7 @@ void SwTextFormatter::CalcUnclipped( SwTwips& rTop, SwTwips& rBottom )
OSL_ENSURE( ! m_pFrame->IsVertical() || m_pFrame->IsSwapped(),
"SwTextFormatter::CalcUnclipped with unswapped frame" );
- long nFlyAsc, nFlyDesc;
+ sal_Int32 nFlyAsc, nFlyDesc;
m_pCurr->MaxAscentDescent( rTop, rBottom, nFlyAsc, nFlyDesc );
rTop = Y() + GetCurr()->GetAscent();
rBottom = rTop + nFlyDesc;
@@ -1996,7 +1996,7 @@ void SwTextFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
aTmpInf.SetIdx( nStartIdx );
aTmpInf.SetPos( aStart );
- long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
+ sal_Int32 nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
pCurrent->MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc );
const sal_uInt16 nTmpHeight = pCurrent->GetRealHeight();
@@ -2115,7 +2115,7 @@ void SwTextFormatter::AlignFlyInCntBase( long nBaseLine ) const
nFlags |= AsCharFlags::Reverse;
}
- long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
+ sal_Int32 nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
while( pPos )
{
@@ -2456,7 +2456,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;
+ sal_Int32 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();
@@ -2705,7 +2705,7 @@ namespace {
rThis.GetCharRect( &aRect, nReformat );
txtFormatInfo.SetMulti( bOldMulti );
- return nFormatRepaint ? std::min( aRect.Left(), nFormatRepaint ) :
+ return nFormatRepaint ? std::min<sal_Int32>( aRect.Left(), nFormatRepaint ) :
aRect.Left();
}
else
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index d15a398ffa43..7e352a3d7cde 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -950,8 +950,8 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
pAnchoredObj->GetFrameFormat().GetVertOrient();
if( text::VertOrientation::BOTTOM != rTmpFormat.GetVertOrient() )
nMinBottom = ( aRectFnSet.IsVert() && nMinBottom ) ?
- std::min( nMinBottom, aBound.Left() ) :
- std::max( nMinBottom, aRectFnSet.GetBottom(aBound) );
+ std::min<sal_Int32>( nMinBottom, aBound.Left() ) :
+ std::max<sal_Int32>( nMinBottom, aRectFnSet.GetBottom(aBound) );
}
bOn = true;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index c1e953725fc8..51dd1dc41561 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1900,7 +1900,7 @@ SwTestFormat::SwTestFormat( SwTextFrame* pTextFrame, const SwFrame* pPre, SwTwip
{
SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*pFrame);
- aRectFnSet.SetHeight( aPrt, std::max( 0L , aRectFnSet.GetHeight(pFrame->getFrameArea()) - aRectFnSet.GetTop(aPrt) - nLower ) );
+ aRectFnSet.SetHeight( aPrt, std::max<sal_Int32>( 0 , aRectFnSet.GetHeight(pFrame->getFrameArea()) - aRectFnSet.GetTop(aPrt) - nLower ) );
aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(pFrame->getFrameArea()) - ( rAttrs.CalcLeft( pFrame ) + rAttrs.CalcRight( pFrame ) ) );
}
@@ -2002,7 +2002,7 @@ bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
// force a MoveFwd
if( IsWidow() || ( aRectFnSet.IsVert() ?
( 0 == getFrameArea().Left() ) :
- ( LONG_MAX - 20000 < getFrameArea().Bottom() ) ) )
+ ( SAL_MAX_INT32 - 20000 < getFrameArea().Bottom() ) ) )
{
SetWidow(false);
if ( GetFollow() )
@@ -2011,7 +2011,7 @@ bool SwTextFrame::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
// whether there's a Follow with a real height at all.
// Else (e.g. for newly created SctFrames) we ignore the IsWidow() and
// still check if we can find enough room
- if( ( ( ! aRectFnSet.IsVert() && LONG_MAX - 20000 >= getFrameArea().Bottom() ) ||
+ if( ( ( ! aRectFnSet.IsVert() && SAL_MAX_INT32 - 20000 >= getFrameArea().Bottom() ) ||
( aRectFnSet.IsVert() && 0 < getFrameArea().Left() ) ) &&
( GetFollow()->IsVertical() ?
!GetFollow()->getFrameArea().Width() :
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index e44642494175..a204caf9bd82 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -221,7 +221,7 @@ static SwTwips lcl_GetFootnoteLower( const SwTextFrame* pFrame, SwTwips nLower )
// the deadline should consider their lower borders.
const SwFrame* pStartFrame = pFrame->GetUpper()->GetLower();
OSL_ENSURE( pStartFrame, "Upper has no lower" );
- SwTwips nFlyLower = aRectFnSet.IsVert() ? LONG_MAX : 0;
+ SwTwips nFlyLower = aRectFnSet.IsVert() ? SAL_MAX_INT32 : 0;
while ( pStartFrame != pFrame )
{
OSL_ENSURE( pStartFrame, "Frame chain is broken" );
@@ -342,10 +342,10 @@ SwTwips SwTextFrame::GetFootnoteFrameHeight_() const
if ( !pRef->IsInFootnoteConnect() )
{
SwSaveFootnoteHeight aSave( const_cast<SwFootnoteBossFrame*>(pBoss), nHeight );
- nHeight = const_cast<SwFootnoteContFrame*>(static_cast<const SwFootnoteContFrame*>(pCont))->Grow( LONG_MAX, true );
+ nHeight = const_cast<SwFootnoteContFrame*>(static_cast<const SwFootnoteContFrame*>(pCont))->Grow( SAL_MAX_INT32, true );
}
else
- nHeight = const_cast<SwFootnoteContFrame*>(static_cast<const SwFootnoteContFrame*>(pCont))->Grow( LONG_MAX, true );
+ nHeight = const_cast<SwFootnoteContFrame*>(static_cast<const SwFootnoteContFrame*>(pCont))->Grow( SAL_MAX_INT32, true );
nHeight += nTmp;
if( nHeight < 0 )
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index 6ffc9324853e..c8906a8f425a 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -153,7 +153,7 @@ bool SwTextFrameBreak::IsInside( SwTextMargin const &rLine ) const
// The LineHeight exceeds the current Frame height.
// Call a test Grow to detect if the Frame could
// grow the requested area.
- nHeight += m_pFrame->GrowTst( LONG_MAX );
+ nHeight += m_pFrame->GrowTst( SAL_MAX_INT32 );
// The Grow() returns the height by which the Upper of the TextFrame
// would let the TextFrame grow.
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 484f52405dd3..e76d52b834ab 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -378,10 +378,10 @@ void SwFrame::dumpInfosAsXml( xmlTextWriterPtr writer ) const
{
// output the Frame
xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", getFrameArea().Left() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", getFrameArea().Top() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", getFrameArea().Width() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", getFrameArea().Height() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%" SAL_PRIdINT32, getFrameArea().Left() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%" SAL_PRIdINT32, getFrameArea().Top() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%" SAL_PRIdINT32, getFrameArea().Width() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%" SAL_PRIdINT32, getFrameArea().Height() );
xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFixSize"), BAD_CAST(OString::boolean(HasFixSize()).getStr()));
xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidPos"), BAD_CAST(OString::boolean(isFrameAreaPositionValid()).getStr()));
xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidSize"), BAD_CAST(OString::boolean(isFrameAreaSizeValid()).getStr()));
@@ -390,10 +390,10 @@ void SwFrame::dumpInfosAsXml( xmlTextWriterPtr writer ) const
// output the Prt
xmlTextWriterStartElement( writer, BAD_CAST( "prtBounds" ) );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", getFramePrintArea().Left() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", getFramePrintArea().Top() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", getFramePrintArea().Width() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", getFramePrintArea().Height() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%" SAL_PRIdINT32, getFramePrintArea().Left() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%" SAL_PRIdINT32, getFramePrintArea().Top() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%" SAL_PRIdINT32, getFramePrintArea().Width() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%" SAL_PRIdINT32, getFramePrintArea().Height() );
xmlTextWriterEndElement( writer );
}
@@ -457,10 +457,10 @@ void SwAnchoredObject::dumpAsXml( xmlTextWriterPtr writer ) const
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", GetObjBoundRect().Left() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", GetObjBoundRect().Top() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", GetObjBoundRect().Width() );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", GetObjBoundRect().Height() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%" SAL_PRIdINT32, GetObjBoundRect().Left() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%" SAL_PRIdINT32, GetObjBoundRect().Top() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%" SAL_PRIdINT32, GetObjBoundRect().Width() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%" SAL_PRIdINT32, GetObjBoundRect().Height() );
xmlTextWriterEndElement( writer );
if (const SdrObject* pObject = GetDrawObj())
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index dcbdf4a79d76..eb16c5c28a8f 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2551,8 +2551,8 @@ uno::Sequence<beans::PropertyState> SwXStyle::getPropertyStates(const uno::Seque
const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
sal_uInt8 nMemberId = pEntry->nMemberId & 0x7f;
- if((LONG_MAX == rSize.GetSize().Width() && (MID_SIZE_WIDTH == nMemberId || MID_SIZE_SIZE == nMemberId)) ||
- (LONG_MAX == rSize.GetSize().Height() && MID_SIZE_HEIGHT == nMemberId))
+ if((SAL_MAX_INT32 == rSize.GetSize().Width() && (MID_SIZE_WIDTH == nMemberId || MID_SIZE_SIZE == nMemberId)) ||
+ (SAL_MAX_INT32 == rSize.GetSize().Height() && MID_SIZE_HEIGHT == nMemberId))
{
pStates[i] = beans::PropertyState_DEFAULT_VALUE;
}
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index f7fdcc0efae4..d4702d186b60 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -514,13 +514,13 @@ void SwPagePreviewLayout::CalcDocPreviewPaintRect()
Size aSize;
if ( mbDoesLayoutColsFitIntoWindow )
- aSize.setWidth( std::min( mnPreviewLayoutWidth,
+ aSize.setWidth( std::min<sal_Int32>( mnPreviewLayoutWidth,
maPreviewDocRect.GetWidth() - aTopLeftPos.X() ) );
else
aSize.setWidth( std::min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(),
maWinSize.Width() - maAdditionalPaintOffset.X() ) );
if ( mbDoesLayoutRowsFitIntoWindow )
- aSize.setHeight( std::min( mnPreviewLayoutHeight,
+ aSize.setHeight( std::min<sal_Int32>( mnPreviewLayoutHeight,
maPreviewDocRect.GetHeight() - aTopLeftPos.Y() ) );
else
aSize.setHeight( std::min( maPreviewDocRect.GetHeight() - aTopLeftPos.Y(),
@@ -774,7 +774,7 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale(
// check, if new y-position is outside document preview
if ( aNewPaintStartPos.Y() > maPreviewDocRect.Bottom() )
aNewPaintStartPos.setY(
- std::max( 0L, maPreviewDocRect.Bottom() - mnPreviewLayoutHeight ) );
+ std::max<sal_Int32>( 0, maPreviewDocRect.Bottom() - mnPreviewLayoutHeight ) );
}
}
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7c536e86117f..5fa122a19c04 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -348,9 +348,9 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
aTmp1 = GetOut()->LogicToPixel( aTmp1 );
tools::Rectangle aTmp2( GetOut()->PixelToLogic( aTmp1 ) );
if ( aTmp2.Left() > aRect.Left() )
- aTmp1.SetLeft( std::max( 0L, aTmp1.Left() - 1 ) );
+ aTmp1.SetLeft( std::max<sal_Int32>( 0, aTmp1.Left() - 1 ) );
if ( aTmp2.Top() > aRect.Top() )
- aTmp1.SetTop( std::max( 0L, aTmp1.Top() - 1 ) );
+ aTmp1.SetTop( std::max<sal_Int32>( 0, aTmp1.Top() - 1 ) );
aTmp1.AdjustRight(1 );
aTmp1.AdjustBottom(1 );
aTmp1 = GetOut()->PixelToLogic( aTmp1 );
@@ -1224,7 +1224,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle
// #i98766# - disable smooth scrolling for Mac
const sal_uLong nBitCnt = mpOut->GetBitCount();
- long lMult = 1, lMax = LONG_MAX;
+ long lMult = 1, lMax = SAL_MAX_INT32;
if ( nBitCnt == 16 )
{
lMax = 7000;
@@ -1271,14 +1271,14 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const tools::Rectangle
aRect.Height( aSize.Height() );
if ( pRect )
{
- aRect.Pos().setX( std::max(aRect.Left(),pRect->Left()-aPixSz.Width()) );
- aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width()));
+ aRect.Pos().setX( std::max<sal_Int32>(aRect.Left(),pRect->Left()-aPixSz.Width()) );
+ aRect.Right( std::min<sal_Int32>(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width()));
}
else
aRect.SSize().AdjustWidth(2*aPixSz.Width() );
aRect.Pos().setY( lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height()
: aRect.Top() - aSize.Height() + aPixSz.Height() );
- aRect.Pos().setX( std::max( 0L, aRect.Left()-aPixSz.Width() ) );
+ aRect.Pos().setX( std::max<sal_Int32>( 0, aRect.Left()-aPixSz.Width() ) );
aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos()));
aRect.SSize()= GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize()));
maVisArea = aRect;
@@ -2230,7 +2230,7 @@ void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
if( bBrowseModeChanged || bHideWhitespaceModeChanged )
{
// #i44963# Good occasion to check if page sizes in
- // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
+ // page descriptions are still set to (SAL_MAX_INT32, SAL_MAX_INT32) (html import)
mxDoc->CheckDefaultPageFormat();
InvalidateLayout( true );
}
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 4c74acecdd09..a9c589963b7c 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -93,7 +93,7 @@ void SwViewShell::Init( const SwViewOption *pNewOpt )
InitPrt( pPDFOut );
// i#44963 Good occasion to check if page sizes in
- // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
+ // page descriptions are still set to (SAL_MAX_INT32, SAL_MAX_INT32) (html import)
if ( !bBrowseMode )
{
mxDoc->CheckDefaultPageFormat();
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 3e98da244e51..b95215fb50ee 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -825,8 +825,8 @@ ErrCode SwWriter::Write( WriterRef const & rxWriter, const OUString* pRealFileNa
//const SwPageDesc& rPgDsc = *pOutDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD );
const SwFormatFrameSize& rSz = rPgDsc.GetMaster().GetFrameSize();
// Clipboard-Document is always created w/o printer; thus the
- // default PageDesc is always aug LONG_MAX !! Set then to DIN A4
- if( LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth() )
+ // default PageDesc is always aug SAL_MAX_INT32 !! Set then to DIN A4
+ if( SAL_MAX_INT32 == rSz.GetHeight() || SAL_MAX_INT32 == rSz.GetWidth() )
{
SwPageDesc aNew( rPgDsc );
SwFormatFrameSize aNewSz( rSz );
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index b3125aff5e75..e5d538ccfddd 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -412,7 +412,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
long nLongVal = 0;
bool bOutLongVal = true;
- if( nVal > LONG_MAX / nMul )
+ if( nVal > SAL_MAX_INT32 / nMul )
{
sal_Int64 nBigVal( nVal );
nBigVal *= nMul;
@@ -420,7 +420,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal,
nBigVal += 5;
nBigVal /= 10;
- if( nBigVal <= LONG_MAX )
+ if( nBigVal <= SAL_MAX_INT32 )
{
// a long is sufficient
nLongVal = static_cast<long>(nBigVal);
diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx
index efebccefa116..f1473961a1e3 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -244,13 +244,13 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt,
if( aPixelSz.Width() )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).
- append("=\"").append(static_cast<sal_Int32>(aPixelSz.Width())).append("\"");
+ append("=\"").append(aPixelSz.Width()).append("\"");
}
if( aPixelSz.Height() )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).
- append("=\"").append(static_cast<sal_Int32>(aPixelSz.Height())).append("\"");
+ append("=\"").append(aPixelSz.Height()).append("\"");
}
}
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 3d349bc1ddb0..545efee3062c 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -635,13 +635,13 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
if( aPixelSpc.Width() )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace).
- append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Width())).append("\"");
+ append("=\"").append(aPixelSpc.Width()).append("\"");
}
if( aPixelSpc.Height() )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace).
- append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Height())).append("\"");
+ append("=\"").append(aPixelSpc.Height()).append("\"");
}
}
@@ -714,7 +714,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
if( nPrcWidth )
sOut.append(static_cast<sal_Int32>(nPrcWidth)).append('%');
else
- sOut.append(static_cast<sal_Int32>(aPixelSz.Width()));
+ sOut.append(aPixelSz.Width());
sOut.append("\"");
}
@@ -726,7 +726,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
if( nPrcHeight )
sOut.append(static_cast<sal_Int32>(nPrcHeight)).append('%');
else
- sOut.append(static_cast<sal_Int32>(aPixelSz.Height()));
+ sOut.append(aPixelSz.Height());
sOut.append("\"");
}
}
@@ -902,12 +902,12 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
if (aPixelSpc.Width())
{
- aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_hspace, static_cast<sal_Int32>(aPixelSpc.Width()));
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_hspace, aPixelSpc.Width());
}
if (aPixelSpc.Height())
{
- aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_vspace, static_cast<sal_Int32>(aPixelSpc.Height()));
+ aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_vspace, aPixelSpc.Height());
}
}
@@ -979,7 +979,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
if (nPrcWidth)
sWidth = OString::number(static_cast<sal_Int32>(nPrcWidth)) + "%";
else
- sWidth = OString::number(static_cast<sal_Int32>(aPixelSz.Width()));
+ sWidth = OString::number(aPixelSz.Width());
aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_width, sWidth);
}
@@ -990,7 +990,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
if (nPrcHeight)
sHeight = OString::number(static_cast<sal_Int32>(nPrcHeight)) + "%";
else
- sHeight = OString::number(static_cast<sal_Int32>(aPixelSz.Height()));
+ sHeight = OString::number(aPixelSz.Height());
aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_height, sHeight);
}
}
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index cb49ab3ebd3a..e6752e0c2dd9 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -789,7 +789,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
if( aSz.Height() )
{
sOptions += " " OOO_STRING_SVTOOLS_HTML_O_size "=\"" +
- OString::number(static_cast<sal_Int32>(aSz.Height())) + "\"";
+ OString::number(aSz.Height()) + "\"";
}
auto aTmp2 = xPropSet->getPropertyValue( "MultiSelection" );
@@ -827,12 +827,12 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
if( aSz.Height() )
{
sOptions += " " OOO_STRING_SVTOOLS_HTML_O_rows "=\"" +
- OString::number(static_cast<sal_Int32>(aSz.Height())) + "\"";
+ OString::number(aSz.Height()) + "\"";
}
if( aSz.Width() )
{
sOptions += " " OOO_STRING_SVTOOLS_HTML_O_cols "=\"" +
- OString::number(static_cast<sal_Int32>(aSz.Width())) + "\"";
+ OString::number(aSz.Width()) + "\"";
}
aTmp = xPropSet->getPropertyValue( "HScroll" );
@@ -866,7 +866,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
if( aSz.Width() )
{
sOptions += " " OOO_STRING_SVTOOLS_HTML_O_size "=\"" +
- OString::number(static_cast<sal_Int32>(aSz.Width())) + "\"";
+ OString::number(aSz.Width()) + "\"";
}
aTmp = xPropSet->getPropertyValue( "MaxTextLen" );
@@ -903,7 +903,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
if( aSz.Width() )
{
sOptions += " " OOO_STRING_SVTOOLS_HTML_O_size "=\"" +
- OString::number(static_cast<sal_Int32>(aSz.Width())) + "\"";
+ OString::number(aSz.Width()) + "\"";
}
// VALUE vim form: don't export because of security reasons
@@ -996,13 +996,13 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
if( aPixelSz.Width() )
{
sOut += " " OOO_STRING_SVTOOLS_HTML_O_width "=\"" +
- OString::number(static_cast<sal_Int32>(aPixelSz.Width())) + "\"";
+ OString::number(aPixelSz.Width()) + "\"";
}
if( aPixelSz.Height() )
{
sOut += " " OOO_STRING_SVTOOLS_HTML_O_height "=\"" +
- OString::number(static_cast<sal_Int32>(aPixelSz.Height())) + "\"";
+ OString::number(aPixelSz.Height()) + "\"";
}
}
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 296b68a3b901..7fe37f6e70f5 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1021,10 +1021,10 @@ void SwHTMLParser::InsertFloatingFrame()
uno::makeAny( bHasBorder ) );
xSet->setPropertyValue("FrameMarginWidth",
- uno::makeAny( sal_Int32( aMargin.Width() ) ) );
+ uno::makeAny( aMargin.Width() ) );
xSet->setPropertyValue("FrameMarginHeight",
- uno::makeAny( sal_Int32( aMargin.Height() ) ) );
+ uno::makeAny( aMargin.Height() ) );
}
}
}
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 60a913e1ac7a..1af4cdf178e8 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -368,7 +368,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
}
else
{
- sOut.append(static_cast<sal_Int32>(aPixelSz.Width()));
+ sOut.append(aPixelSz.Width());
}
sOut.append("\"");
}
@@ -376,7 +376,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
if( nHeight )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height)
- .append("=\"").append(static_cast<sal_Int32>(aPixelSz.Height())).append("\"");
+ .append("=\"").append(aPixelSz.Height()).append("\"");
}
const SfxItemSet& rItemSet = pBox->GetFrameFormat()->GetAttrSet();
@@ -671,13 +671,13 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
if( aPixelSpc.Width() )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace).
- append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Width())).append("\"");
+ append("=\"").append(aPixelSpc.Width()).append("\"");
}
if( aPixelSpc.Height() )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace).
- append("=\"").append(static_cast<sal_Int32>(aPixelSpc.Height())).append("\"");
+ append("=\"").append(aPixelSpc.Height()).append("\"");
}
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 63c6c8c53ea5..7be5f2ecc89f 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5030,7 +5030,7 @@ sal_uInt16 SwHTMLParser::ToTwips( sal_uInt16 nPixel )
{
long nTwips = Application::GetDefaultDevice()->PixelToLogic(
Size( nPixel, nPixel ), MapMode( MapUnit::MapTwip ) ).Width();
- return static_cast<sal_uInt16>(std::min(nTwips, SwTwips(SAL_MAX_UINT16)));
+ return static_cast<sal_uInt16>(std::min<sal_uInt16>(nTwips, SwTwips(SAL_MAX_UINT16)));
}
else
return nPixel;
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index e1a8503d657d..97a4ee144c72 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -167,7 +167,7 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr );
- virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand = LONG_MAX, bool consumedByField=false);
+ virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand = SAL_MAX_INT32, bool consumedByField=false);
void StealAttr(const SwNodeIndex& rNode);
void MarkAllAttrsOld();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index a5bd0bc8f571..feca015b656b 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -601,29 +601,15 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
// the 'Size' type uses 'long' for width and height, so on
// platforms where 'long' is 32 bits they can obviously never be
// larger than the max signed 32-bit integer.
-#if SAL_TYPES_SIZEOFLONG > 4
- if (rSize.Width() > MAX_INTEGER_VALUE)
- cx = MAX_INTEGER_VALUE;
+ if (0 > rSize.Width())
+ cx = 0;
else
-#endif
- {
- if (0 > rSize.Width())
- cx = 0;
- else
- cx = rSize.Width();
- }
+ cx = rSize.Width();
-#if SAL_TYPES_SIZEOFLONG > 4
- if (rSize.Height() > MAX_INTEGER_VALUE)
- cy = MAX_INTEGER_VALUE;
+ if (0 > rSize.Height())
+ cy = 0;
else
-#endif
- {
- if (0 > rSize.Height())
- cy = 0;
- else
- cy = rSize.Height();
- }
+ cy = rSize.Height();
OString aWidth(OString::number(TwipsToEMU(cx)));
//we explicitly check the converted EMU value for the range as mentioned in above comment.
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index ff0257873bc4..0508d2b8ec99 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3798,14 +3798,14 @@ static OString ExportPICT(const SwFlyFrameFormat* pFlyFrameFormat, const Size& r
aRet.append(rCr.GetBottom());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICW);
- aRet.append(static_cast<sal_Int32>(rMapped.Width()));
+ aRet.append(rMapped.Width());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICH);
- aRet.append(static_cast<sal_Int32>(rMapped.Height()));
+ aRet.append(rMapped.Height());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICWGOAL);
- aRet.append(static_cast<sal_Int32>(rOrig.Width()));
+ aRet.append(rOrig.Width());
aRet.append(OOO_STRING_SVTOOLS_RTF_PICHGOAL);
- aRet.append(static_cast<sal_Int32>(rOrig.Height()));
+ aRet.append(rOrig.Height());
aRet.append(pBLIPType);
if (bIsWMF)
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index f6dcdf3cecf8..f37e7e8ce415 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -802,8 +802,8 @@ void RtfExport::ExportDocument_Impl()
const SwFormatFrameSize& rSz = rFormatPage.GetFrameSize();
// Clipboard document is always created without a printer, then
- // the size will be always LONG_MAX! Solution then is to use A4
- if (LONG_MAX == rSz.GetHeight() || LONG_MAX == rSz.GetWidth())
+ // the size will be always SAL_MAX_INT32! Solution then is to use A4
+ if (SAL_MAX_INT32 == rSz.GetHeight() || SAL_MAX_INT32 == rSz.GetWidth())
{
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PAPERH);
Size a4 = SvxPaperInfo::GetPaperSize(PAPER_A4);
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index ab63e083da44..b19bb1402d74 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -530,10 +530,8 @@ void RtfSdrExport::impl_writeGraphic()
// Add it to the properties.
RtfStringBuffer aBuf;
aBuf->append('{').append(OOO_STRING_SVTOOLS_RTF_PICT).append(OOO_STRING_SVTOOLS_RTF_PNGBLIP);
- aBuf->append(OOO_STRING_SVTOOLS_RTF_PICW).append(sal_Int32(aMapped.Width()));
- aBuf->append(OOO_STRING_SVTOOLS_RTF_PICH)
- .append(sal_Int32(aMapped.Height()))
- .append(SAL_NEWLINE_STRING);
+ aBuf->append(OOO_STRING_SVTOOLS_RTF_PICW).append(aMapped.Width());
+ aBuf->append(OOO_STRING_SVTOOLS_RTF_PICH).append(aMapped.Height()).append(SAL_NEWLINE_STRING);
aBuf->append(msfilter::rtfutil::WriteHex(pGraphicAry, nSize));
aBuf->append('}');
m_aShapeProps.insert(std::pair<OString, OString>("pib", aBuf.makeStringAndClear()));
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 75f74fa61b7d..7406f153a67f 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -565,7 +565,7 @@ sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
return bRet;
}
-bool RTLDrawingsHack(long &rLeft,
+bool RTLDrawingsHack(sal_Int32 &rLeft,
sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft,
SwTwips nPageRight, SwTwips nPageSize)
{
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 1cbbeebf27f6..8bcc97c768ed 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5028,7 +5028,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
else
{
pTO = nullptr;
- nOP = LONG_MAX;
+ nOP = SAL_MAX_INT32;
}
const SvxTabStop* pTN;
@@ -5046,10 +5046,10 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
else
{
pTN = nullptr;
- nNP = LONG_MAX;
+ nNP = SAL_MAX_INT32;
}
- if( nOP == LONG_MAX && nNP == LONG_MAX )
+ if( nOP == SAL_MAX_INT32 && nNP == SAL_MAX_INT32 )
break; // everything done
if( nOP < nNP ) // next tab is old
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index a7153844ec71..273ee9b48f65 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -383,7 +383,7 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr);
- virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand=LONG_MAX, bool consumedByField=false) override;
+ virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand=SAL_MAX_INT32, bool consumedByField=false) override;
void SetToggleAttr(sal_uInt8 nId, bool bOn)
{
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 64312c378894..a71630fbf03e 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4427,7 +4427,7 @@ eBookStatus WW8PLCFx_Book::GetStatus() const
long WW8PLCFx_Book::GetHandle() const
{
if( !pBook[0] || !pBook[1] )
- return LONG_MAX;
+ return SAL_MAX_INT32;
if( nIsEnd )
return pBook[1]->GetIdx();
@@ -4436,7 +4436,7 @@ long WW8PLCFx_Book::GetHandle() const
if (const void* p = pBook[0]->GetData(pBook[0]->GetIdx()))
return SVBT16ToShort( *static_cast<SVBT16 const *>(p) );
else
- return LONG_MAX;
+ return SAL_MAX_INT32;
}
}
@@ -4634,7 +4634,7 @@ void WW8PLCFx_AtnBook::advance()
long WW8PLCFx_AtnBook::getHandle() const
{
if (!m_pBook[0] || !m_pBook[1])
- return LONG_MAX;
+ return SAL_MAX_INT32;
if (m_bIsEnd)
return m_pBook[1]->GetIdx();
@@ -4643,7 +4643,7 @@ long WW8PLCFx_AtnBook::getHandle() const
if (const void* p = m_pBook[0]->GetData(m_pBook[0]->GetIdx()))
return SVBT16ToShort(*static_cast<const SVBT16*>(p));
else
- return LONG_MAX;
+ return SAL_MAX_INT32;
}
}
@@ -4766,7 +4766,7 @@ void WW8PLCFx_FactoidBook::advance()
long WW8PLCFx_FactoidBook::getHandle() const
{
if (!m_pBook[0] || !m_pBook[1])
- return LONG_MAX;
+ return SAL_MAX_INT32;
if (m_bIsEnd)
return m_pBook[1]->GetIdx();
@@ -4775,7 +4775,7 @@ long WW8PLCFx_FactoidBook::getHandle() const
if (const void* p = m_pBook[0]->GetData(m_pBook[0]->GetIdx()))
return SVBT16ToShort(*static_cast<const SVBT16*>(p));
else
- return LONG_MAX;
+ return SAL_MAX_INT32;
}
}
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index c9216ed1cbe6..ecd0ccfeb022 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WW8SCAN_HXX
#define INCLUDED_SW_SOURCE_FILTER_WW8_WW8SCAN_HXX
-#ifndef LONG_MAX
+#ifndef SAL_MAX_INT32
#include <limits.h>
#endif
#include <algorithm>
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 7ca7c63922cc..29b8486d8f9f 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -134,10 +134,10 @@ static void lcl_addOutplaceProperties(
*pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_TOP ), Any(sal_Int32(0)) );
pStates++;
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), Any(static_cast<sal_Int32>(aSize.Width())) );
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), Any(aSize.Width()) );
pStates++;
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any(static_cast<sal_Int32>(aSize.Height())) );
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any(aSize.Height()) );
}
}
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index cf4f328c47b3..a951e0b41887 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -871,10 +871,10 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
makeAny( true ) );
xSet->setPropertyValue("FrameMarginWidth",
- makeAny( sal_Int32( aMargin.Width() ) ) );
+ makeAny( aMargin.Width() ) );
xSet->setPropertyValue("FrameMarginHeight",
- makeAny( sal_Int32( aMargin.Height() ) ) );
+ makeAny( aMargin.Height() ) );
}
SwFrameFormat *const pFrameFormat =
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 1bc236dccaa6..c0fb5669a089 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -592,8 +592,8 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableToFromHdl, Button*, pButton, void )
if( !aField.isEmpty() )
{
OUString aStr( m_pEdDbText->GetText() );
- sal_Int32 nPos = static_cast<sal_Int32>(m_pEdDbText->GetSelection().Min());
- const sal_Int32 nSel = static_cast<sal_Int32>(m_pEdDbText->GetSelection().Max()) - nPos;
+ sal_Int32 nPos = m_pEdDbText->GetSelection().Min();
+ const sal_Int32 nSel = m_pEdDbText->GetSelection().Max() - nPos;
if( nSel )
// first delete the existing selection
aStr = aStr.replaceAt( nPos, nSel, "" );
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 3f8daf71e599..32bb037eae04 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -439,7 +439,7 @@ void SwLabPage::DisplayFormat()
SetMetric(*aField.get(), aMetric);
aField->SetDecimalDigits(2);
aField->SetMin (0);
- aField->SetMax (LONG_MAX);
+ aField->SetMax (SAL_MAX_INT32);
SwLabRec* pRec = GetSelectedEntryPos();
aItem.m_aLstType = pRec->m_aType;
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index fe827cf1f560..06f5c4e4fa15 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -70,8 +70,8 @@ SwFieldDokPage::SwFieldDokPage(vcl::Window* pParent, const SfxItemSet *const pCo
m_pNumFormatLB->SetDoubleClickHdl(LINK(this, SwFieldDokPage, NumFormatHdl));
m_pLevelED->SetMax(MAXLEVEL);
- m_pDateOffsetED->SetMin(LONG_MIN);
- m_pDateOffsetED->SetMax(LONG_MAX);
+ m_pDateOffsetED->SetMin(SAL_MIN_INT32);
+ m_pDateOffsetED->SetMax(SAL_MAX_INT32);
//enable 'active' language selection
m_pNumFormatLB->SetShowLanguageControl(true);
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 269f54d4a17c..7f8a428ef4dc 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1361,12 +1361,12 @@ void SwFramePage::InitPos(RndStdIds eId,
if (!bEnable)
{
m_pAtHorzPosED->SetValue( 0, FUNIT_TWIP );
- if (nX != LONG_MAX && m_bHtmlMode)
+ if (nX != SAL_MAX_INT32 && m_bHtmlMode)
m_pAtHorzPosED->SetModifyFlag();
}
else
{
- if (nX != LONG_MAX)
+ if (nX != SAL_MAX_INT32)
m_pAtHorzPosED->SetValue( m_pAtHorzPosED->Normalize(nX), FUNIT_TWIP );
}
m_pAtHorzPosFT->Enable( bEnable );
@@ -1376,19 +1376,19 @@ void SwFramePage::InitPos(RndStdIds eId,
if ( !bEnable )
{
m_pAtVertPosED->SetValue( 0, FUNIT_TWIP );
- if(nY != LONG_MAX && m_bHtmlMode)
+ if(nY != SAL_MAX_INT32 && m_bHtmlMode)
m_pAtVertPosED->SetModifyFlag();
}
else
{
if ( eId == RndStdIds::FLY_AS_CHAR )
{
- if ( nY == LONG_MAX )
+ if ( nY == SAL_MAX_INT32 )
nY = 0;
else
nY *= -1;
}
- if ( nY != LONG_MAX )
+ if ( nY != SAL_MAX_INT32 )
m_pAtVertPosED->SetValue( m_pAtVertPosED->Normalize(nY), FUNIT_TWIP );
}
m_pAtVertPosFT->Enable( bEnable && m_bAllowVertPositioning );
@@ -1766,7 +1766,7 @@ DeactivateRC SwFramePage::DeactivatePage(SfxItemSet * _pSet)
IMPL_LINK_NOARG(SwFramePage, MirrorHdl, Button*, void)
{
RndStdIds eId = GetAnchor();
- InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
+ InitPos( eId, -1, 0, -1, 0, SAL_MAX_INT32, SAL_MAX_INT32);
}
IMPL_LINK( SwFramePage, RelSizeClickHdl, Button *, p, void )
@@ -1891,10 +1891,10 @@ void SwFramePage::RangeModifyHdl()
if (aVal.bAutoHeight && (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog"))
{
- SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight);
+ SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max<sal_Int32>(nHeight, 1), nMaxHeight);
m_aWidthED.SetMax(m_aWidthED.NormalizePercent(nTmp), FUNIT_TWIP);
- nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), nMaxWidth);
+ nTmp = std::min(nHeight * nMaxWidth / std::max<sal_Int32>(nWidth, 1), nMaxWidth);
m_aHeightED.SetMax(m_aWidthED.NormalizePercent(nTmp), FUNIT_TWIP);
}
else
@@ -1936,7 +1936,7 @@ IMPL_LINK_NOARG(SwFramePage, AnchorTypeHdl, Button*, void)
RndStdIds eId = GetAnchor();
- InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
+ InitPos( eId, -1, 0, -1, 0, SAL_MAX_INT32, SAL_MAX_INT32);
RangeModifyHdl();
if(m_bHtmlMode)
@@ -2272,7 +2272,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset)
RndStdIds eAnchorId = GetAnchor();
if ( m_bNew && !m_bFormat )
- InitPos(eAnchorId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
+ InitPos(eAnchorId, -1, 0, -1, 0, SAL_MAX_INT32, SAL_MAX_INT32);
else
{
const SwFormatHoriOrient& rHori = rSet.Get(RES_HORI_ORIENT);
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index e3fd606cc073..e3aef8c719e9 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3977,7 +3977,7 @@ Size SwEntryBrowseBox::GetOptimalSize() const
long nWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
- aSize.setWidth( std::max(aSize.Width(), nWidth) );
+ aSize.setWidth( std::max<sal_Int32>(aSize.Width(), nWidth) );
return aSize;
}
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index 0b7daa49b5d7..f9d6f9a3f88a 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -134,7 +134,7 @@ static void lcl_LeaveDrawText(SwWrtShell& rSh)
if(rSh.GetDrawView())
{
rSh.GetDrawView()->SdrEndTextEdit( true );
- Point aPt(LONG_MIN, LONG_MIN);
+ Point aPt(SAL_MIN_INT32, SAL_MIN_INT32);
// go out of the frame
rSh.SelectObj(aPt, SW_LEAVE_FRAME);
rSh.EnterStdMode();
@@ -701,7 +701,7 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
else
{
rView.LeaveDrawCreate();
- Point aPt(LONG_MIN, LONG_MIN);
+ Point aPt(SAL_MIN_INT32, SAL_MIN_INT32);
// go out of the frame
rShell.SelectObj(aPt, SW_LEAVE_FRAME);
SfxBindings& rBind = rView.GetViewFrame()->GetBindings();
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index a629f2cc5742..10ebf51b4991 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -368,8 +368,8 @@ void SwPageBreakWin::UpdatePosition( const Point* pEvtPt )
// 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 nLineLeft = std::max<sal_Int32>( nPgLeft, aVisArea.Left() );
+ long nLineRight = std::min<sal_Int32>( nPgRight, aVisArea.Right() );
long nBtnLeft = nLineLeft;
if ( m_pMousePt )
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 5f0f0bfbd21f..d16cf9d3808b 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1066,10 +1066,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() );
+ long nLeft = std::min<sal_Int32>( aTmp.Left() - aBoundRect.Left(), aSnap.Width() );
+ long nRight = std::min<sal_Int32>( aBoundRect.Right() - aTmp.Right(), aSnap.Width() );
+ long nUp = std::min<sal_Int32>( aTmp.Top() - aBoundRect.Top(), aSnap.Height() );
+ long nDown = std::min<sal_Int32>( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() );
switch ( nDir )
{
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx
index 1debb81ca787..1813fe7e2115 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -516,24 +516,24 @@ void SwFlyFrameAttrMgr::DelAttr( sal_uInt16 nId )
void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight )
{
- OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" );
+ OSL_ENSURE( SAL_MAX_INT32 != nLeft && SAL_MAX_INT32 != nRight, "Which border to set?" );
SvxLRSpaceItem aTmp( m_aSet.Get( RES_LR_SPACE ) );
- if( LONG_MAX != nLeft )
+ if( SAL_MAX_INT32 != nLeft )
aTmp.SetLeft( sal_uInt16(nLeft) );
- if( LONG_MAX != nRight )
+ if( SAL_MAX_INT32 != nRight )
aTmp.SetRight( sal_uInt16(nRight) );
m_aSet.Put( aTmp );
}
void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom )
{
- OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" );
+ OSL_ENSURE(SAL_MAX_INT32 != nTop && SAL_MAX_INT32 != nBottom, "Which border to set?" );
SvxULSpaceItem aTmp( m_aSet.Get( RES_UL_SPACE ) );
- if( LONG_MAX != nTop )
+ if( SAL_MAX_INT32 != nTop )
aTmp.SetUpper( sal_uInt16(nTop) );
- if( LONG_MAX != nBottom )
+ if( SAL_MAX_INT32 != nBottom )
aTmp.SetLower( sal_uInt16(nBottom) );
m_aSet.Put( aTmp );
}
@@ -591,7 +591,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<sal_Int32>(rSize.Width(), MINFLY), std::max<sal_Int32>(rSize.Height(), MINFLY)));
m_aSet.Put( aSize );
}
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 6d1c67493655..d7df870ce44a 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -778,7 +778,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept )
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
SvTreeListEntry* pEntry = bSelect ? m_pTable->FirstSelected() : m_pTable->First();
- sal_uLong nPos = LONG_MAX;
+ sal_uLong nPos = SAL_MAX_INT32;
typedef std::vector<SvTreeListEntry*> ListBoxEntries_t;
ListBoxEntries_t aRedlines;
@@ -793,7 +793,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept )
{
if( !m_pTable->GetParent( pEntry ) )
{
- if( bSelect && LONG_MAX == nPos )
+ if( bSelect && SAL_MAX_INT32 == nPos )
nPos = m_pTable->GetModel()->GetAbsPos( pEntry );
RedlinData *pData = static_cast<RedlinData *>(pEntry->GetUserData());
@@ -854,7 +854,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept )
m_bInhibitActivate = false;
Activate();
- if( ULONG_MAX != nPos && m_pTable->GetEntryCount() )
+ if( SAL_MAX_UINT32 != nPos && m_pTable->GetEntryCount() )
{
if( nPos >= m_pTable->GetEntryCount() )
nPos = m_pTable->GetEntryCount() - 1;
diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx
index bb5fd3b9a5e9..f3d69e8b99a7 100644
--- a/sw/source/uibase/ribbar/drawbase.cxx
+++ b/sw/source/uibase/ribbar/drawbase.cxx
@@ -189,7 +189,7 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
{
bool bUnlockView = !m_pSh->IsViewLocked();
m_pSh->LockView( true ); //lock visible section
- m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // deselect all
+ m_pSh->SelectObj(Point(SAL_MAX_INT32, SAL_MAX_INT32)); // deselect all
if( bUnlockView )
m_pSh->LockView( false );
}
@@ -375,7 +375,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
if (aPnt == m_aStartPos)
{
if (!m_pSh->IsObjSelectable(aPnt))
- m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX));
+ m_pSh->SelectObj(Point(SAL_MAX_INT32, SAL_MAX_INT32));
else if (!bReturn)
{
if (!rMEvt.IsShift())
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index c2747c86243e..ce4fa5dd2767 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -294,10 +294,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
if ( pMarginItem )
{
xSet->setPropertyValue("FrameMarginWidth",
- uno::makeAny( sal_Int32( aMargin.Width() ) ) );
+ uno::makeAny( aMargin.Width() ) );
xSet->setPropertyValue("FrameMarginHeight",
- uno::makeAny( sal_Int32( aMargin.Height() ) ) );
+ uno::makeAny( aMargin.Height() ) );
}
}
catch (const uno::Exception&)
diff --git a/sw/source/uibase/table/tablemgr.cxx b/sw/source/uibase/table/tablemgr.cxx
index 52b49a483e7d..7e3c94d3769e 100644
--- a/sw/source/uibase/table/tablemgr.cxx
+++ b/sw/source/uibase/table/tablemgr.cxx
@@ -151,7 +151,7 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth )
aCols[ GetRightSeparator(nNum-1) ] -= nDiff;
}
else
- aCols.SetRight( std::min( nNewWidth, aCols.GetRightMax()) );
+ aCols.SetRight( std::min<sal_Int32>( nNewWidth, aCols.GetRightMax()) );
pSh->StartAllAction();
pSh->SetTabCols( aCols, bCurrentOnly );
diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx
index 4d896b52792b..bc9905f82a4f 100644
--- a/sw/source/uibase/uiview/swcli.cxx
+++ b/sw/source/uibase/uiview/swcli.cxx
@@ -146,7 +146,7 @@ void SwOleClient::ViewChanged()
aVisSize.setWidth( long(aVisSize.Width() * GetScaleWidth()) );
aVisSize.setHeight( long(aVisSize.Height() * GetScaleHeight()) );
- SwRect aRect( Point( LONG_MIN, LONG_MIN ), aVisSize );
+ SwRect aRect( Point( SAL_MIN_INT32, SAL_MIN_INT32 ), aVisSize );
rSh.LockView( true ); // Prevent scrolling in the EndAction
rSh.StartAllAction();
rSh.RequestObjectResize( aRect, GetObject() );
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index eb010a49f94d..99df87c3e8ba 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1250,8 +1250,8 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
- sal_Int64 nRight = LONG_MIN;
- sal_Int64 nBottom = LONG_MIN;
+ sal_Int64 nRight = SAL_MIN_INT32;
+ sal_Int64 nBottom = SAL_MIN_INT32;
sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index c48970cb8e86..26fdb197f3cf 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -816,7 +816,7 @@ void SwView::Execute(SfxRequest &rReq)
if(pSdrView)
{
LeaveDrawCreate();
- Point aPt(LONG_MIN, LONG_MIN);
+ Point aPt(SAL_MIN_INT32, SAL_MIN_INT32);
//go out of the frame
m_pWrtShell->SelectObj(aPt, SW_LEAVE_FRAME);
SfxBindings& rBind = GetViewFrame()->GetBindings();
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index dba6610de692..c3f672e34561 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -354,12 +354,12 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect,
if(nDesHeight > nCurHeight) // the height is not sufficient, then nYScroll is no longer of interest
{
pPt->setY( rRect.Top() );
- pPt->setY( std::max( lMin, pPt->Y() ) );
+ pPt->setY( std::max<sal_Int32>( lMin, pPt->Y() ) );
}
else if ( rRect.Top() < m_aVisArea.Top() ) // Upward shift
{
pPt->setY( rRect.Top() - (nRangeY != USHRT_MAX ? nRangeY : nYScroll) );
- pPt->setY( std::max( lMin, pPt->Y() ) );
+ pPt->setY( std::max<sal_Int32>( lMin, pPt->Y() ) );
}
else if( rRect.Bottom() > m_aVisArea.Bottom() ) // Downward shift
{
@@ -379,9 +379,9 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect,
else if ( rRect.Left() < m_aVisArea.Left() ) // Shift left
{
pPt->setX( rRect.Left() - (nRangeX != USHRT_MAX ? nRangeX : nXScroll) );
- pPt->setX( std::max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ) );
- pPt->setX( std::min( rRect.Left() - nScrollX, pPt->X() ) );
- pPt->setX( std::max( 0L, pPt->X() ) );
+ pPt->setX( std::max<sal_Int32>( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ) );
+ pPt->setX( std::min<sal_Int32>( rRect.Left() - nScrollX, pPt->X() ) );
+ pPt->setX( std::max<sal_Int32>( 0, pPt->X() ) );
}
}
@@ -462,7 +462,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
if( m_bTopCursor )
{
const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0;
- aPt.setY( std::min( std::max( nBorder, rRect.Top() ),
+ aPt.setY( std::min<sal_Int32>( std::max<sal_Int32>( nBorder, rRect.Top() ),
m_aDocSz.Height() + nBorder -
m_aVisArea.GetHeight() ) );
}
@@ -479,7 +479,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
if( m_bTopCursor )
{
const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0;
- aPt.setY( std::min( std::max( nBorder, rRect.Top() ),
+ aPt.setY( std::min<sal_Int32>( std::max<sal_Int32>( nBorder, rRect.Top() ),
m_aDocSz.Height() + nBorder -
m_aVisArea.GetHeight() ) );
}
@@ -502,7 +502,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt
- m_aVisArea.Left() - m_aVisArea.Right() ) / 2 );
aPnt.setX( SetHScrollMax( aPnt.X() ) );
const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0;
- aPnt.setX( std::max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ) );
+ aPnt.setX( std::max<sal_Int32>( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ) );
}
m_aVisArea = aOldVisArea;
if( pCareWn )
@@ -570,7 +570,7 @@ long SwView::PageUp()
Point aPos(m_aVisArea.TopLeft());
aPos.AdjustY( -(m_aVisArea.GetHeight() - (GetYScroll() / 2)) );
- aPos.setY( std::max(0L, aPos.Y()) );
+ aPos.setY( std::max<sal_Int32>(0, aPos.Y()) );
SetVisArea( aPos );
return 1;
}
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index bad0b82dfefb..9b4368737caf 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -326,7 +326,7 @@ long SwWrtShell::SetCursorKillSel(const Point *pPt, bool bTextOnly )
void SwWrtShell::UnSelectFrame()
{
// Remove Frame selection with guaranteed invalid position
- Point aPt(LONG_MIN, LONG_MIN);
+ Point aPt(SAL_MIN_INT32, SAL_MIN_INT32);
SelectObj(aPt);
SwTransferable::ClearSelection( *this );
}
diff --git a/tools/qa/cppunit/test_rectangle.cxx b/tools/qa/cppunit/test_rectangle.cxx
index c4b321d388eb..4729d3140df4 100644
--- a/tools/qa/cppunit/test_rectangle.cxx
+++ b/tools/qa/cppunit/test_rectangle.cxx
@@ -32,28 +32,28 @@ void Test::test_rectangle()
{
tools::Rectangle aRect(1,1,1,1);
- CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth());
- CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetHeight());
- CPPUNIT_ASSERT_EQUAL(long(0), aRect.getWidth());
- CPPUNIT_ASSERT_EQUAL(long(0), aRect.getHeight());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.getWidth());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.getHeight());
}
{
tools::Rectangle aRect(Point(), Size(1,1));
- CPPUNIT_ASSERT_EQUAL(long(0), aRect.Left());
- CPPUNIT_ASSERT_EQUAL(long(0), aRect.Top());
- CPPUNIT_ASSERT_EQUAL(long(0), aRect.Right());
- CPPUNIT_ASSERT_EQUAL(long(0), aRect.Bottom());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.Left());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.Top());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.Right());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.Bottom());
- CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth());
- CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetHeight());
aRect.setX(12);
- CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetHeight());
aRect.setY(12);
- CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetWidth());
}
}
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index ea855f98e9f0..a7c649cecd7d 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -85,13 +85,13 @@ void tools::Rectangle::SaturatingSetSize(const Size& rSize)
nBottom = RECT_EMPTY;
}
-void tools::Rectangle::SaturatingSetX(long x)
+void tools::Rectangle::SaturatingSetX(sal_Int32 x)
{
nRight = o3tl::saturating_add(nRight, x - nLeft);
nLeft = x;
}
-void tools::Rectangle::SaturatingSetY(long y)
+void tools::Rectangle::SaturatingSetY(sal_Int32 y)
{
nBottom = o3tl::saturating_add(nBottom, y - nTop);
nTop = y;
diff --git a/tools/source/generic/point.cxx b/tools/source/generic/point.cxx
index 1b470c6065ec..7530baf4fdc9 100644
--- a/tools/source/generic/point.cxx
+++ b/tools/source/generic/point.cxx
@@ -25,18 +25,18 @@
void Point::RotateAround( Point& rPoint,
short nOrientation ) const
{
- long nX = rPoint.X();
- long nY = rPoint.Y();
+ sal_Int32 nX = rPoint.X();
+ sal_Int32 nY = rPoint.Y();
RotateAround(nX, nY, nOrientation);
rPoint.setX(nX);
rPoint.setY(nY);
}
-void Point::RotateAround( long& rX, long& rY,
+void Point::RotateAround( sal_Int32& rX, sal_Int32& rY,
short nOrientation ) const
{
- const long nOriginX = X();
- const long nOriginY = Y();
+ const sal_Int32 nOriginX = X();
+ const sal_Int32 nOriginY = Y();
if ( (nOrientation >= 0) && !(nOrientation % 900) )
{
@@ -50,7 +50,7 @@ void Point::RotateAround( long& rX, long& rY,
if ( nOrientation == 900 )
{
- long nTemp = rX;
+ sal_Int32 nTemp = rX;
rX = rY;
rY = -nTemp;
}
@@ -61,7 +61,7 @@ void Point::RotateAround( long& rX, long& rY,
}
else /* ( nOrientation == 2700 ) */
{
- long nTemp = rX;
+ sal_Int32 nTemp = rX;
rX = -rY;
rY = nTemp;
}
@@ -77,12 +77,12 @@ void Point::RotateAround( long& rX, long& rY,
double nSin = sin( nRealOrientation );
// Translation...
- long nX = rX-nOriginX;
- long nY = rY-nOriginY;
+ sal_Int32 nX = rX-nOriginX;
+ sal_Int32 nY = rY-nOriginY;
// Rotation...
- rX = + static_cast<long>(nCos*nX + nSin*nY) + nOriginX;
- rY = - static_cast<long>(nSin*nX - nCos*nY) + nOriginY;
+ rX = + static_cast<sal_Int32>(nCos*nX + nSin*nY) + nOriginX;
+ rY = - static_cast<sal_Int32>(nSin*nX - nCos*nY) + nOriginY;
}
}
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 724220ad60a9..30c80ef16905 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -285,7 +285,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
#endif
}
-void SvpSalFrame::GetClientSize( long& rWidth, long& rHeight )
+void SvpSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight )
{
rWidth = maGeometry.nWidth;
rHeight = maGeometry.nHeight;
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index 16de568794f8..6c5dc905a3e9 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -82,7 +82,7 @@ public:
virtual void SetMinClientSize( long nWidth, long nHeight ) override;
virtual void SetMaxClientSize( long nWidth, long nHeight ) override;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override;
- virtual void GetClientSize( long& rWidth, long& rHeight ) override;
+ virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override;
virtual void GetWorkArea( tools::Rectangle& rRect ) override;
virtual SalFrame* GetParent() const override;
virtual void SetWindowState( const SalFrameState* pState ) override;
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index c2b53e270648..30571d2cf077 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -124,7 +124,7 @@ public:
virtual void SetMinClientSize( long nWidth, long nHeight ) override;
virtual void SetMaxClientSize( long nWidth, long nHeight ) override;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override;
- virtual void GetClientSize( long& rWidth, long& rHeight ) override;
+ virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override;
virtual void GetWorkArea( tools::Rectangle& rRect ) override;
virtual SalFrame* GetParent() const override;
virtual void SetWindowState( const SalFrameState* pState ) override;
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 8f9c04017a66..cc668f0d2f66 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -72,7 +72,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
virtual bool SetPrinterData( ImplJobSetup* pSetupData ) override;
virtual bool SetData( JobSetFlags i_nFlags, ImplJobSetup* i_pSetupData ) override;
virtual void GetPageInfo( const ImplJobSetup* i_pSetupData,
- long& o_rOutWidth, long& o_rOutHeight,
+ sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight,
Point& rPageOffset,
Size& rPaperSize ) override;
virtual sal_uInt32 GetCapabilities( const ImplJobSetup* i_pSetupData, PrinterCapType i_nType ) override;
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index c04f0a8f767e..4da52068ca58 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -147,7 +147,7 @@ public:
virtual void SetMinClientSize( long nWidth, long nHeight ) = 0;
virtual void SetMaxClientSize( long nWidth, long nHeight ) = 0;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) = 0;
- virtual void GetClientSize( long& rWidth, long& rHeight ) = 0;
+ virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) = 0;
virtual void GetWorkArea( tools::Rectangle& rRect ) = 0;
virtual SalFrame* GetParent() const = 0;
// Note: x will be mirrored at parent if UI mirroring is active
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 71ef1eae1c08..70f2b1a4bf9c 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -202,11 +202,11 @@ public:
SalLayoutFlags GetLayout() const { return m_nLayout; }
void SetLayout( SalLayoutFlags aLayout ) { m_nLayout = aLayout;}
- void mirror( long& nX, const OutputDevice *pOutDev ) const;
+ void mirror( sal_Int32& nX, const OutputDevice *pOutDev ) const;
// only called mirror2 to avoid ambiguity
SAL_WARN_UNUSED_RESULT
- long mirror2( long nX, const OutputDevice *pOutDev ) const;
- void mirror( long& nX, long nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
+ sal_Int32 mirror2( sal_Int32 nX, const OutputDevice *pOutDev ) const;
+ void mirror( sal_Int32& nX, sal_Int32 nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
bool mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const;
void mirror( tools::Rectangle& rRect, const OutputDevice*, bool bBack = false ) const;
void mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const;
@@ -220,12 +220,12 @@ public:
bool SetClipRegion( const vcl::Region&, const OutputDevice *pOutDev );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
- void DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
- void DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev );
+ void DrawPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev );
+ void DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev );
- void DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev );
+ void DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev );
- void DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
+ void DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev );
void DrawPolyLine( sal_uInt32 nPoints, SalPoint const * pPtAry, const OutputDevice *pOutDev );
@@ -277,9 +277,9 @@ public:
// CopyArea --> No RasterOp, but ClipRegion
void CopyArea(
- long nDestX, long nDestY,
- long nSrcX, long nSrcY,
- long nSrcWidth, long nSrcHeight,
+ sal_Int32 nDestX, sal_Int32 nDestY,
+ sal_Int32 nSrcX, sal_Int32 nSrcY,
+ sal_Int32 nSrcWidth, sal_Int32 nSrcHeight,
const OutputDevice *pOutDev );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
@@ -308,18 +308,18 @@ public:
const OutputDevice *pOutDev );
SalBitmap* GetBitmap(
- long nX, long nY,
- long nWidth, long nHeight,
+ sal_Int32 nX, sal_Int32 nY,
+ sal_Int32 nWidth, sal_Int32 nHeight,
const OutputDevice *pOutDev );
Color GetPixel(
- long nX, long nY,
+ sal_Int32 nX, sal_Int32 nY,
const OutputDevice *pOutDev );
// invert --> ClipRegion (only Windows)
void Invert(
- long nX, long nY,
- long nWidth, long nHeight,
+ sal_Int32 nX, sal_Int32 nY,
+ sal_Int32 nWidth, sal_Int32 nHeight,
SalInvert nFlags,
const OutputDevice *pOutDev );
@@ -330,8 +330,8 @@ public:
const OutputDevice *pOutDev );
bool DrawEPS(
- long nX, long nY,
- long nWidth, long nHeight,
+ sal_Int32 nX, sal_Int32 nY,
+ sal_Int32 nWidth, sal_Int32 nHeight,
void* pPtr,
sal_uLong nSize,
const OutputDevice *pOutDev );
@@ -417,8 +417,8 @@ public:
const OutputDevice* pOutDev );
bool DrawAlphaRect(
- long nX, long nY,
- long nWidth, long nHeight,
+ sal_Int32 nX, sal_Int32 nY,
+ sal_Int32 nWidth, sal_Int32 nHeight,
sal_uInt8 nTransparency,
const OutputDevice *pOutDev );
diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx
index d9da1a6d80ed..5a70751c9112 100644
--- a/vcl/inc/salprn.hxx
+++ b/vcl/inc/salprn.hxx
@@ -71,7 +71,7 @@ public:
virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) = 0;
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
- long& rOutWidth, long& rOutHeight,
+ sal_Int32& rOutWidth, sal_Int32& rOutHeight,
Point& rPageOffset,
Size& rPaperSize ) = 0;
virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) = 0;
diff --git a/vcl/inc/unx/genprn.h b/vcl/inc/unx/genprn.h
index 9d80de32f99b..c00b589471dc 100644
--- a/vcl/inc/unx/genprn.h
+++ b/vcl/inc/unx/genprn.h
@@ -44,7 +44,7 @@ public:
virtual bool SetPrinterData( ImplJobSetup* pSetupData ) override;
virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) override;
virtual void GetPageInfo( const ImplJobSetup* pSetupData,
- long& rOutWidth, long& rOutHeight,
+ sal_Int32& rOutWidth, sal_Int32& rOutHeight,
Point& rPageOffset,
Size& rPaperSize ) override;
virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) override;
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 3db18f03fbcf..dc6f512c4526 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -462,7 +462,7 @@ public:
virtual void SetMinClientSize( long nWidth, long nHeight ) override;
virtual void SetMaxClientSize( long nWidth, long nHeight ) override;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override;
- virtual void GetClientSize( long& rWidth, long& rHeight ) override;
+ virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override;
virtual void GetWorkArea( tools::Rectangle& rRect ) override;
virtual SalFrame* GetParent() const override;
virtual void SetWindowState( const SalFrameState* pState ) override;
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index 3f45cd5d853c..0dd228c0b13f 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -49,11 +49,11 @@ private:
static BitmapBuffer* ImplCreateDIB(
Drawable aDrawable,
SalX11Screen nXScreen,
- long nDrawableDepth,
- long nX,
- long nY,
- long nWidth,
- long nHeight,
+ sal_Int32 nDrawableDepth,
+ sal_Int32 nX,
+ sal_Int32 nY,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
bool bGrey
);
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index 92bfcbfb9d31..5deb7f009325 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -221,7 +221,7 @@ public:
virtual void SetMinClientSize( long nWidth, long nHeight ) override;
virtual void SetMaxClientSize( long nWidth, long nHeight ) override;
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override;
- virtual void GetClientSize( long& rWidth, long& rHeight ) override;
+ virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override;
virtual void GetWorkArea( tools::Rectangle& rRect ) override;
virtual SalFrame* GetParent() const override;
virtual void SetWindowState( const SalFrameState* pState ) override;
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index df4996a6ca09..0730a1991c81 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -852,10 +852,10 @@ void OpenGLSalGraphicsImpl::DrawTrapezoid( const basegfx::B2DTrapezoid& trapezoi
void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeight )
{
- long nX1( nX );
- long nY1( nY );
- long nX2( nX + nWidth );
- long nY2( nY + nHeight );
+ sal_Int32 nX1( nX );
+ sal_Int32 nY1( nY );
+ sal_Int32 nX2( nX + nWidth );
+ sal_Int32 nY2( nY + nHeight );
const SalPoint aPoints[] = { { nX1, nY2 }, { nX1, nY1 },
{ nX2, nY1 }, { nX2, nY2 }};
@@ -864,10 +864,10 @@ void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeigh
void OpenGLSalGraphicsImpl::DrawRect( const tools::Rectangle& rRect )
{
- long nX1( rRect.Left() );
- long nY1( rRect.Top() );
- long nX2( rRect.Right() );
- long nY2( rRect.Bottom() );
+ sal_Int32 nX1( rRect.Left() );
+ sal_Int32 nY1( rRect.Top() );
+ sal_Int32 nX2( rRect.Right() );
+ sal_Int32 nY2( rRect.Bottom() );
const SalPoint aPoints[] = { { nX1, nY2 }, { nX1, nY1 },
{ nX2, nY1 }, { nX2, nY2 }};
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 7b5b203668d8..d8bf6be5ba7f 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -531,7 +531,7 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
}
}
-void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight )
+void AquaSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight )
{
if( mbShown || mbInitShow )
{
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index b87585de91db..b16984387464 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -293,7 +293,7 @@ sal_uInt32 AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup*, PrinterCapT
}
void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
- long& o_rOutWidth, long& o_rOutHeight,
+ sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight,
Point& rPageOffset,
Size& rPaperSize )
{
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index f835c7b78bc3..c92d1753c6ff 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -61,8 +61,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp;
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(0), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(0), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(0), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(0), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Not empty", aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(0),
@@ -76,8 +76,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp(Size(10, 10), 1);
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(1),
@@ -91,8 +91,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp(Size(10, 10), 4);
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(4),
@@ -106,8 +106,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp(Size(10, 10), 8);
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(8),
@@ -121,8 +121,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp(Size(10, 10), 16);
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24),
@@ -136,8 +136,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp(Size(10, 10), 24);
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24),
@@ -151,8 +151,8 @@ void BitmapTest::testCreation()
{
Bitmap aBmp(Size(10, 10), 32);
Size aSize = aBmp.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width());
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize());
CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24),
@@ -407,8 +407,8 @@ void BitmapTest::testScale()
BitmapSymmetryCheck aBitmapSymmetryCheck;
- CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Width());
- CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Height());
// Check symmetry of the bitmap
CPPUNIT_ASSERT(BitmapSymmetryCheck::check(aBitmap24Bit));
@@ -422,8 +422,8 @@ void BitmapTest::testScale()
aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast);
- CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Width());
- CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Height());
// After scaling the bitmap should still be symmetrical. This check guarantees that
// scaling doesn't misalign the bitmap.
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index a423a17081e8..9399dd43f339 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -95,7 +95,7 @@ void VclFiltersTest::testScaling()
fprintf( stderr, "scale with type %d\n", int( i ) );
CPPUNIT_ASSERT( aBitmapEx.Scale( 0.1937046, 0.193154, i ) );
Size aAfter( aBitmapEx.GetSizePixel() );
- fprintf( stderr, "size %ld, %ld\n", aAfter.Width(), aAfter.Height() );
+ fprintf( stderr, "size %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 "\n", aAfter.Width(), aAfter.Height() );
CPPUNIT_ASSERT( labs (aAfter.Height() - aAfter.Width()) <= 1 );
}
}
@@ -129,8 +129,8 @@ void VclFiltersTest::checkExportImport(const OUString& aFilterShortName)
BitmapEx aLoadedBitmapEx = aLoadedGraphic.GetBitmapEx();
Size aSize = aLoadedBitmapEx.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL(100L, aSize.Width());
- CPPUNIT_ASSERT_EQUAL(100L, aSize.Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Height());
}
void VclFiltersTest::testExportImport()
diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
index 4cae79645bd6..7727a13c18ad 100644
--- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
+++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
@@ -106,8 +106,8 @@ void JpegReaderTest::testReadRGB()
{
Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestRGB.jpeg"));
Size aSize = aBitmap.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL(12L, aSize.Width());
- CPPUNIT_ASSERT_EQUAL(12L, aSize.Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height());
int nMaxDelta = 1; // still acceptable color error
CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), nMaxDelta));
@@ -120,8 +120,8 @@ void JpegReaderTest::testReadGray()
{
Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestGray.jpeg"));
Size aSize = aBitmap.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL(12L, aSize.Width());
- CPPUNIT_ASSERT_EQUAL(12L, aSize.Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height());
aBitmap.Convert(BmpConversion::N24Bit); // convert to 24bit so we don't need to deal with palette
@@ -136,8 +136,8 @@ void JpegReaderTest::testReadCMYK()
{
Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestCMYK.jpeg"));
Size aSize = aBitmap.GetSizePixel();
- CPPUNIT_ASSERT_EQUAL(12L, aSize.Width());
- CPPUNIT_ASSERT_EQUAL(12L, aSize.Height());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height());
int maxDelta = 1;
CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), maxDelta));
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 35400b70ed8a..7c3238979e7d 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1639,7 +1639,7 @@ Size PushButton::CalcMinimumSize() const
Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ),
PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize();
aSize.AdjustWidth(textSize.Width() );
- aSize.setHeight( std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ) );
+ aSize.setHeight( std::max<sal_Int32>( aSize.Height(), sal_Int32( textSize.Height() * 1.15 ) ) );
}
// cf. ImplDrawPushButton ...
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 7b14c8da64c2..abb0a5e0c677 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -311,7 +311,7 @@ IMPL_LINK(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void)
{
OUString aFullText = rEdit.GetText();
- OUString aStartText = aFullText.copy( 0, static_cast<sal_Int32>(aSel.Max()) );
+ OUString aStartText = aFullText.copy( 0, aSel.Max() );
sal_Int32 nStart = m_pImplLB->GetCurrentPos();
if ( nStart == LISTBOX_ENTRY_NOTFOUND )
@@ -1039,7 +1039,7 @@ Size ComboBox::CalcMinimumSize() const
if (m_pImpl->m_nMaxWidthChars != -1)
{
long nMaxWidth = m_pImpl->m_nMaxWidthChars * approximate_char_width();
- aSz.setWidth( std::min(aSz.Width(), nMaxWidth) );
+ aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) );
}
if (IsDropDownBox())
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 42dd22296585..e6c8e07bb824 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -743,7 +743,7 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI
}
}
- maText.remove( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) );
+ maText.remove( aSelection.Min(), aSelection.Len() );
maSelection.Min() = aSelection.Min();
maSelection.Max() = aSelection.Min();
ImplAlignAndPaint();
@@ -807,9 +807,9 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool
ImplClearLayoutData();
if ( aSelection.Len() )
- maText.remove( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) );
+ maText.remove( aSelection.Min(), aSelection.Len() );
else if ( !mbInsertMode && (aSelection.Max() < maText.getLength()) )
- maText.remove( static_cast<sal_Int32>(aSelection.Max()), 1 );
+ maText.remove( aSelection.Max(), 1 );
// take care of input-sequence-checking now
if (bIsUserInput && !rStr.isEmpty())
@@ -829,7 +829,7 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool
if (bIsInputSequenceChecking && (xISC = ImplGetInputSequenceChecker()).is())
{
sal_Unicode cChar = rStr[0];
- sal_Int32 nTmpPos = static_cast< sal_Int32 >( aSelection.Min() );
+ sal_Int32 nTmpPos = aSelection.Min();
sal_Int16 nCheckMode = officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get()?
i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
@@ -876,7 +876,7 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool
}
if ( !aNewText.isEmpty() )
- maText.insert( static_cast<sal_Int32>(aSelection.Min()), aNewText );
+ maText.insert( aSelection.Min(), aNewText );
if ( !pNewSel )
{
@@ -2036,7 +2036,7 @@ void Edit::Command( const CommandEvent& rCEvt )
{
DeleteSelected();
delete mpIMEInfos;
- sal_Int32 nPos = static_cast<sal_Int32>(maSelection.Max());
+ sal_Int32 nPos = maSelection.Max();
mpIMEInfos = new Impl_IMEInfos( nPos, OUString(maText.getStr() + nPos ) );
mpIMEInfos->bWasCursorOverwrite = !IsInsertMode();
}
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index a59557dcbb9b..13fe3a348a96 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -713,7 +713,7 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue )
aSelection.Justify();
OUString aText = GetField()->GetText();
// leave it as is if selected until end
- if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() )
+ if ( aSelection.Max() == aText.getLength() )
{
if ( !aSelection.Len() )
aSelection.Min() = SELECTION_MAX;
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index e438fb0a7efa..e05960b660f0 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -467,7 +467,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
sal_Unicode cChar = rKEvt.GetCharCode();
sal_uInt16 nKeyCode = aCode.GetCode();
bool bShift = aCode.IsShift();
- sal_Int32 nCursorPos = static_cast<sal_Int32>(aOldSel.Max());
+ sal_Int32 nCursorPos = aOldSel.Max();
sal_Int32 nNewPos;
sal_Int32 nTempPos;
@@ -524,7 +524,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
// all was selected by the focus
Selection aSel( aOldSel );
aSel.Justify();
- nCursorPos = static_cast<sal_Int32>(aSel.Min());
+ nCursorPos = aSel.Min();
ImplPatternMaxPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
aSel.Max() = nNewPos;
if ( bShift )
@@ -541,16 +541,16 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
Selection aSel = aOldSel;
aSel.Justify();
- nNewPos = static_cast<sal_Int32>(aSel.Min());
+ nNewPos = aSel.Min();
// if selection then delete it
if ( aSel.Len() )
{
if ( bSameMask )
- aStr.remove( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) );
+ aStr.remove( aSel.Min(), aSel.Len() );
else
{
- OUString aRep = rLiteralMask.copy( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) );
+ OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() );
aStr.remove( aSel.Min(), aRep.getLength() );
aStr.insert( aSel.Min(), aRep );
}
@@ -1324,7 +1324,7 @@ void DateField::ImplDateSpinArea( bool bUp )
Selection aSelection = GetField()->GetSelection();
aSelection.Justify();
OUString aText( GetText() );
- if ( static_cast<sal_Int32>(aSelection.Len()) == aText.getLength() )
+ if ( aSelection.Len() == aText.getLength() )
ImplDateIncrementDay( aDate, bUp );
else
{
@@ -1344,7 +1344,7 @@ void DateField::ImplDateSpinArea( bool bUp )
for ( sal_Int8 i = 1; i <= 3; i++ )
{
nPos = aText.indexOf( aDateSep, nPos );
- if (nPos < 0 || nPos >= static_cast<sal_Int32>(aSelection.Max()))
+ if (nPos < 0 || nPos >= aSelection.Max())
{
nDateArea = i;
break;
@@ -1585,7 +1585,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate )
OUString aText = GetField()->GetText();
// If selected until the end then keep it that way
- if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() )
+ if ( aSelection.Max() == aText.getLength() )
{
if ( !aSelection.Len() )
aSelection.Min() = SELECTION_MAX;
@@ -2364,7 +2364,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime )
OUString aText = GetField()->GetText();
// If selected until the end then keep it that way
- if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() )
+ if ( aSelection.Max() == aText.getLength() )
{
if ( !aSelection.Len() )
aSelection.Min() = SELECTION_MAX;
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index f998285abc1a..f82d1dc992f5 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -316,7 +316,7 @@ Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt,
if ( !( pControl->GetStyle() & WB_NOLABEL ) )
nStyle |= DrawTextFlags::Mnemonic;
- return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)),
+ return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, RECT_MAX)),
rTxt, nStyle).GetSize();
}
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 171b75afd151..6f510684b866 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -661,10 +661,10 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
}
if ( IsUserDrawEnabled() || aMetrics.bImage )
{
- aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, maUserItemSize.Width() );
+ aMetrics.nEntryWidth = std::max<sal_Int32>( aMetrics.nImgWidth, maUserItemSize.Width() );
if ( aMetrics.bText )
aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE;
- aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2,
+ aMetrics.nEntryHeight = std::max<sal_Int32>( std::max<sal_Int32>( mnMaxImgHeight, maUserItemSize.Height() ) + 2,
aMetrics.nEntryHeight );
}
@@ -1802,7 +1802,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32
if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled()))
{
- long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width());
+ sal_Int32 nImageWidth = std::max<sal_Int32>(mnMaxImgWidth, maUserItemSize.Width());
aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE );
}
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index ef945a087659..17d1c9c8cefc 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -1230,7 +1230,7 @@ Size ListBox::CalcSubEditSize() const
if (m_nMaxWidthChars != -1)
{
long nMaxWidth = m_nMaxWidthChars * approximate_char_width();
- aSz.setWidth( std::min(aSz.Width(), nMaxWidth) );
+ aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) );
}
// Do not create ultrathin ListBoxes, it doesn't look good
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index 54931df82557..370891802b9f 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -112,9 +112,9 @@ void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P
Size aSize(GetOptimalSize());
if (!bCanHandleSmallerWidth)
- nWidth = std::max(nWidth, aSize.Width());
+ nWidth = std::max<sal_Int32>(nWidth, aSize.Width());
if (!bCanHandleSmallerHeight)
- nHeight = std::max(nHeight, aSize.Height());
+ nHeight = std::max<sal_Int32>(nHeight, aSize.Height());
Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index a4f06757c2ea..a1bcc29273c6 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2142,7 +2142,7 @@ Size TabControl::calculateRequisition() const
{
TabControl* pThis = const_cast<TabControl*>(this);
- tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX);
+ tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX);
if (aTabRect.Bottom() > nTabLabelsBottom)
nTabLabelsBottom = aTabRect.Bottom();
if (aTabRect.Right() > nTabLabelsRight)
@@ -2151,7 +2151,7 @@ Size TabControl::calculateRequisition() const
Size aOptimalSize(aOptimalPageSize);
aOptimalSize.AdjustHeight(nTabLabelsBottom );
- aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) );
+ aOptimalSize.setWidth( std::max<sal_Int32>(nTabLabelsRight, aOptimalSize.Width()) );
aOptimalSize.AdjustWidth(TAB_OFFSET * 2 );
aOptimalSize.AdjustHeight(TAB_OFFSET * 2 );
@@ -2671,7 +2671,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const
{
NotebookbarTabControlBase* pThis = const_cast<NotebookbarTabControlBase*>(this);
- tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX);
+ tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX);
if (aTabRect.Bottom() > nTabLabelsBottom)
{
nTabLabelsBottom = aTabRect.Bottom();
@@ -2683,7 +2683,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const
Size aOptimalSize(aOptimalPageSize);
aOptimalSize.AdjustHeight(nTabLabelsBottom );
- aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) );
+ aOptimalSize.setWidth( std::max<sal_Int32>(nTabLabelsRight, aOptimalSize.Width()) );
aOptimalSize.AdjustWidth(TAB_OFFSET * 2 );
aOptimalSize.AdjustHeight(TAB_OFFSET * 2 );
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index 34919a3149bf..50d201d32e02 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -346,7 +346,7 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc
// TODO: use fastbmp infrastructure
Scanline pScanline = GetScanline( nY );
Scanline pScanlineRead = rReadAcc.GetScanline(nY);
- for( long nX = 0, nWidth = std::min( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ )
+ for( long nX = 0, nWidth = std::min<sal_Int32>( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ )
SetPixelOnData( pScanline, nX, rReadAcc.GetPixelFromData( pScanlineRead, nX ) );
}
}
@@ -418,13 +418,13 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc )
if( ( GetScanlineFormat() == rReadAcc.GetScanlineFormat() ) &&
( GetScanlineSize() == rReadAcc.GetScanlineSize() ) )
{
- const long nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() );
+ const long nHeight = std::min<sal_Int32>( mpBuffer->mnHeight, rReadAcc.Height() );
const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize;
memcpy( mpBuffer->mpBits, rReadAcc.GetBuffer(), nCount );
}
else
- for( long nY = 0, nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ )
+ for( long nY = 0, nHeight = std::min<sal_Int32>( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ )
CopyScanline( nY, rReadAcc );
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 915a3b2de479..9c153d986790 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1395,9 +1395,9 @@ void PDFWriterImpl::PDFPage::appendRect( const tools::Rectangle& rRect, OStringB
{
appendPoint( rRect.BottomLeft() + Point( 0, 1 ), rBuffer );
rBuffer.append( ' ' );
- appendMappedLength( static_cast<sal_Int32>(rRect.GetWidth()), rBuffer, false );
+ appendMappedLength( rRect.GetWidth(), rBuffer, false );
rBuffer.append( ' ' );
- appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), rBuffer );
+ appendMappedLength( rRect.GetHeight(), rBuffer );
rBuffer.append( " re" );
}
@@ -2768,10 +2768,10 @@ bool PDFWriterImpl::emitTilings()
emitComment( "PDFWriterImpl::emitTilings" );
}
- sal_Int32 nX = static_cast<sal_Int32>(tiling.m_aRectangle.Left());
- sal_Int32 nY = static_cast<sal_Int32>(tiling.m_aRectangle.Top());
- sal_Int32 nW = static_cast<sal_Int32>(tiling.m_aRectangle.GetWidth());
- sal_Int32 nH = static_cast<sal_Int32>(tiling.m_aRectangle.GetHeight());
+ sal_Int32 nX = tiling.m_aRectangle.Left();
+ sal_Int32 nY = tiling.m_aRectangle.Top();
+ sal_Int32 nW = tiling.m_aRectangle.GetWidth();
+ sal_Int32 nH = tiling.m_aRectangle.GetHeight();
if( tiling.m_aCellSize.Width() == 0 )
tiling.m_aCellSize.setWidth( nW );
if( tiling.m_aCellSize.Height() == 0 )
@@ -3144,11 +3144,11 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font
aLine.append( "\n"
"/FontBBox[" );
// note: Top and Bottom are reversed in VCL and PDF rectangles
- aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.TopLeft().X()) );
+ aLine.append( rInfo.m_aFontBBox.TopLeft().X() );
aLine.append( ' ' );
- aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.TopLeft().Y()) );
+ aLine.append( rInfo.m_aFontBBox.TopLeft().Y() );
aLine.append( ' ' );
- aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.BottomRight().X()) );
+ aLine.append( rInfo.m_aFontBBox.BottomRight().X() );
aLine.append( ' ' );
aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.BottomRight().Y()+1) );
aLine.append( "]/ItalicAngle " );
@@ -4403,7 +4403,7 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( ' ' );
- m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aCheckRect.GetHeight() ), aDA );
+ m_aPages[ m_nCurrentPage ].appendMappedLength( aCheckRect.GetHeight(), aDA );
aDA.append( " Tf\n" );
m_aPages[ m_nCurrentPage ].appendMappedLength( nCharXOffset, aDA );
aDA.append( " " );
@@ -4503,7 +4503,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
aDA.append( ' ' );
aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( ' ' );
- m_aPages[m_nCurrentPage].appendMappedLength( sal_Int32( aCheckRect.GetHeight() ), aDA );
+ m_aPages[m_nCurrentPage].appendMappedLength( aCheckRect.GetHeight(), aDA );
aDA.append( " Tf\n0 0 Td\nET\nQ\n" );
writeBuffer( aDA.getStr(), aDA.getLength() );
setFillColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ) );
@@ -8654,9 +8654,9 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject )
aLine.append('3');
break;
default:
- aLine.append( static_cast<sal_Int32>(aSize.Width()) );
+ aLine.append( aSize.Width() );
aLine.append( ' ' );
- aLine.append( static_cast<sal_Int32>(aSize.Height()) );
+ aLine.append( aSize.Height() );
}
aLine.append( " ]\n"
"/BitsPerSample 8\n"
@@ -8788,13 +8788,13 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject )
aPoly[1] = aBoundRect.TopCenter();
aPoly.Rotate( aCenter, 3600 - nAngle );
- aLine.append( static_cast<sal_Int32>(aPoly[0].X()) );
+ aLine.append( aPoly[0].X() );
aLine.append( " " );
- aLine.append( static_cast<sal_Int32>(aPoly[0].Y()) );
+ aLine.append( aPoly[0].Y() );
aLine.append( " " );
- aLine.append( static_cast<sal_Int32>(aPoly[1].X()));
+ aLine.append( aPoly[1].X() );
aLine.append( " ");
- aLine.append( static_cast<sal_Int32>(aPoly[1].Y()));
+ aLine.append( aPoly[1].Y() );
aLine.append( " ]\n");
aLine.append("/Extend [true true]\n");
break;
@@ -8802,9 +8802,9 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject )
default:
aLine.append("/Domain[ 0 1 0 1 ]\n"
"/Matrix[ " );
- aLine.append( static_cast<sal_Int32>(aSize.Width()) );
+ aLine.append( aSize.Width() );
aLine.append( " 0 0 " );
- aLine.append( static_cast<sal_Int32>(aSize.Height()) );
+ aLine.append( aSize.Height() );
aLine.append( " 0 0 ]\n");
}
aLine.append("/Function " );
@@ -8857,9 +8857,9 @@ void PDFWriterImpl::writeJPG( JPGEmit& rObject )
aLine.append( rObject.m_nObject );
aLine.append( " 0 obj\n"
"<</Type/XObject/Subtype/Image/Width " );
- aLine.append( static_cast<sal_Int32>(rObject.m_aID.m_aPixelSize.Width()) );
+ aLine.append( rObject.m_aID.m_aPixelSize.Width() );
aLine.append( " /Height " );
- aLine.append( static_cast<sal_Int32>(rObject.m_aID.m_aPixelSize.Height()) );
+ aLine.append( rObject.m_aID.m_aPixelSize.Height() );
aLine.append( " /BitsPerComponent 8 " );
if( rObject.m_bTrueColor )
aLine.append( "/ColorSpace/DeviceRGB" );
@@ -9444,9 +9444,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
aLine.append( rObject.m_nObject );
aLine.append( " 0 obj\n"
"<</Type/XObject/Subtype/Image/Width " );
- aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Width()) );
+ aLine.append( aBitmap.GetSizePixel().Width() );
aLine.append( "/Height " );
- aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Height()) );
+ aLine.append( aBitmap.GetSizePixel().Height() );
aLine.append( "/BitsPerComponent " );
aLine.append( nBitsPerComponent );
aLine.append( "/Length " );
@@ -9461,7 +9461,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
else
{
aLine.append( "/Filter/CCITTFaxDecode/DecodeParms<</K -1/BlackIs1 true/Columns " );
- aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Width()) );
+ aLine.append( aBitmap.GetSizePixel().Width() );
aLine.append( ">>\n" );
}
}
@@ -9765,10 +9765,10 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
aLine.append( "q " );
sal_Int32 nCheckWidth = 0;
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rTargetArea.GetWidth()), aLine, false, &nCheckWidth );
+ m_aPages.back().appendMappedLength( rTargetArea.GetWidth(), aLine, false, &nCheckWidth );
aLine.append( " 0 0 " );
sal_Int32 nCheckHeight = 0;
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rTargetArea.GetHeight()), aLine, true, &nCheckHeight );
+ m_aPages.back().appendMappedLength( rTargetArea.GetHeight(), aLine, true, &nCheckHeight );
aLine.append( ' ' );
m_aPages.back().appendPoint( rTargetArea.BottomLeft(), aLine );
aLine.append( " cm\n/Im" );
@@ -9804,10 +9804,10 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
aLine.append( ' ' );
}
sal_Int32 nCheckWidth = 0;
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rDestSize.Width()), aLine, false, &nCheckWidth );
+ m_aPages.back().appendMappedLength( rDestSize.Width(), aLine, false, &nCheckWidth );
aLine.append( " 0 0 " );
sal_Int32 nCheckHeight = 0;
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rDestSize.Height()), aLine, true, &nCheckHeight );
+ m_aPages.back().appendMappedLength( rDestSize.Height(), aLine, true, &nCheckHeight );
aLine.append( ' ' );
m_aPages.back().appendPoint( rDestPoint + Point( 0, rDestSize.Height()-1 ), aLine );
aLine.append( " cm\n/Im" );
@@ -9952,9 +9952,9 @@ void PDFWriterImpl::drawGradient( const tools::Rectangle& rRect, const Gradient&
if( m_aGraphicsStack.front().m_aLineColor != COL_TRANSPARENT )
aLine.append( "q " );
aLine.append( "0 0 " );
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetWidth()), aLine, false );
+ m_aPages.back().appendMappedLength( rRect.GetWidth(), aLine, false );
aLine.append( ' ' );
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), aLine );
+ m_aPages.back().appendMappedLength( rRect.GetHeight(), aLine );
aLine.append( " re W n\n" );
aLine.append( "/P" );
@@ -9963,9 +9963,9 @@ void PDFWriterImpl::drawGradient( const tools::Rectangle& rRect, const Gradient&
if( m_aGraphicsStack.front().m_aLineColor != COL_TRANSPARENT )
{
aLine.append( "Q 0 0 " );
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetWidth()), aLine, false );
+ m_aPages.back().appendMappedLength( rRect.GetWidth(), aLine, false );
aLine.append( ' ' );
- m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), aLine );
+ m_aPages.back().appendMappedLength( rRect.GetHeight(), aLine );
aLine.append( " re S " );
}
aLine.append( "Q\n" );
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 49cc105d5d54..2887158ea67b 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -106,13 +106,13 @@ bool SalGraphics::drawTransformedBitmap(
return false;
}
-long SalGraphics::mirror2( long x, const OutputDevice *pOutDev ) const
+sal_Int32 SalGraphics::mirror2( sal_Int32 x, const OutputDevice *pOutDev ) const
{
mirror(x, pOutDev);
return x;
}
-void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const
+void SalGraphics::mirror( sal_Int32& x, const OutputDevice *pOutDev ) const
{
long w;
if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
@@ -142,7 +142,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const
}
}
-void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, bool bBack ) const
+void SalGraphics::mirror( sal_Int32& x, sal_Int32 nWidth, const OutputDevice *pOutDev, bool bBack ) const
{
long w;
if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV )
@@ -267,9 +267,9 @@ void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
void SalGraphics::mirror( tools::Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
{
- long nWidth = rRect.GetWidth();
- long x = rRect.Left();
- long x_org = x;
+ sal_Int32 nWidth = rRect.GetWidth();
+ sal_Int32 x = rRect.Left();
+ sal_Int32 x_org = x;
mirror( x, nWidth, pOutDev, bBack );
rRect.Move( x - x_org, 0 );
@@ -366,21 +366,21 @@ bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice
return setClipRegion( i_rClip );
}
-void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
+void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, pOutDev );
drawPixel( nX, nY );
}
-void SalGraphics::DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev )
+void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, pOutDev );
drawPixel( nX, nY, nColor );
}
-void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev )
+void SalGraphics::DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
@@ -390,7 +390,7 @@ void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const Output
drawLine( nX1, nY1, nX2, nY2 );
}
-void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+void SalGraphics::DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
@@ -535,9 +535,9 @@ bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradi
return drawGradient( rPolyPoly, rGradient );
}
-void SalGraphics::CopyArea( long nDestX, long nDestY,
- long nSrcX, long nSrcY,
- long nSrcWidth, long nSrcHeight,
+void SalGraphics::CopyArea( sal_Int32 nDestX, sal_Int32 nDestY,
+ sal_Int32 nSrcX, sal_Int32 nSrcY,
+ sal_Int32 nSrcWidth, sal_Int32 nSrcHeight,
const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
@@ -606,21 +606,21 @@ void SalGraphics::DrawMask( const SalTwoRect& rPosAry,
drawMask( rPosAry, rSalBitmap, nMaskColor );
}
-SalBitmap* SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+SalBitmap* SalGraphics::GetBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
return getBitmap( nX, nY, nWidth, nHeight );
}
-Color SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
+Color SalGraphics::GetPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, pOutDev );
return getPixel( nX, nY );
}
-void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
@@ -639,7 +639,7 @@ void SalGraphics::Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert
invert( nPoints, pPtAry, nFlags );
}
-bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev )
+bool SalGraphics::DrawEPS( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
mirror( nX, nWidth, pOutDev );
@@ -806,7 +806,7 @@ bool SalGraphics::DrawTransformedBitmap(
}
}
-bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
+bool SalGraphics::DrawAlphaRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight,
sal_uInt8 nTransparency, const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index d302d6952877..1d54de94ee71 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -565,8 +565,8 @@ void GraphicObject::DrawTiled( OutputDevice* pOut, const tools::Rectangle& rArea
const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() );
// #106258# Clamp size to 1 for zero values. This is okay, since
// logical size of zero is handled above already
- const Size aOutTileSize( ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ),
- ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) );
+ const Size aOutTileSize( ::std::max<sal_Int32>( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ),
+ ::std::max<sal_Int32>( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) );
//#i69780 clip final tile size to a sane max size
while ((static_cast<sal_Int64>(rSize.Width()) * nTileCacheSize1D) > SAL_MAX_UINT16)
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index c9f0e7c460ce..78b0a5382a59 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -244,8 +244,8 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D
if( mbOutputClipped )
return;
- const long nDistX = std::max( rDist.Width(), 1L );
- const long nDistY = std::max( rDist.Height(), 1L );
+ const long nDistX = std::max<sal_Int32>( rDist.Width(), 1 );
+ const long nDistY = std::max<sal_Int32>( rDist.Height(), 1 );
long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX );
long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY );
const long nRight = aDstRect.Right();
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index a3547b1bb491..7c8a81bd8de2 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -156,8 +156,8 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout )
{
Point aPoint = rSalLayout.GetDrawPosition();
- long nX = aPoint.X();
- long nY = aPoint.Y();
+ sal_Int32 nX = aPoint.X();
+ sal_Int32 nY = aPoint.Y();
long nWidth = rSalLayout.GetTextWidth();
long nHeight = mpFontInstance->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
@@ -169,8 +169,8 @@ tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout
long nBaseX = nX, nBaseY = nY;
if ( !(mpFontInstance->mnOrientation % 900) )
{
- long nX2 = nX+nWidth;
- long nY2 = nY+nHeight;
+ sal_Int32 nX2 = nX+nWidth;
+ sal_Int32 nY2 = nY+nHeight;
Point aBasePt( nBaseX, nBaseY );
aBasePt.RotateAround( nX, nY, mpFontInstance->mnOrientation );
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index bff62fe6e660..009651c7b4a3 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -61,7 +61,7 @@ void OutputDevice::ImplInitAboveTextLineSize()
}
void OutputDevice::ImplDrawWavePixel( long nOriginX, long nOriginY,
- long nCurX, long nCurY,
+ sal_Int32 nCurX, sal_Int32 nCurY,
short nOrientation,
SalGraphics* pGraphics,
OutputDevice const * pOutDev,
@@ -94,8 +94,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
if ( !nHeight )
return;
- long nStartX = nBaseX + nDistX;
- long nStartY = nBaseY + nDistY;
+ sal_Int32 nStartX = nBaseX + nDistX;
+ sal_Int32 nStartY = nBaseY + nDistY;
// If the height is 1 pixel, it's enough output a line
if ( (nLineWidth == 1) && (nHeight == 1) )
@@ -103,8 +103,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
mpGraphics->SetLineColor( rColor );
mbInitLineColor = true;
- long nEndX = nStartX+nWidth;
- long nEndY = nStartY;
+ sal_Int32 nEndX = nStartX+nWidth;
+ sal_Int32 nEndY = nStartY;
if ( nOrientation )
{
Point aOriginPt( nBaseX, nBaseY );
@@ -579,7 +579,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
}
void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
- long nDistX, long nDistY, long nWidth,
+ sal_Int32 nDistX, sal_Int32 nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
@@ -996,8 +996,8 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos )
Point aEndPt = ImplLogicToDevicePixel( rEndPos );
long nStartX = aStartPt.X();
long nStartY = aStartPt.Y();
- long nEndX = aEndPt.X();
- long nEndY = aEndPt.Y();
+ sal_Int32 nEndX = aEndPt.X();
+ sal_Int32 nEndY = aEndPt.Y();
short nOrientation = 0;
// when rotated
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index ef3437eba967..08e5d6924e8f 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1146,9 +1146,9 @@ static void calcMaxs(const array_type &A, std::vector<VclGrid::Value> &rWidths,
{
Size aChildSize = VclContainer::getLayoutRequisition(*pChild);
if (nWidth == 1)
- rWidths[x].m_nValue = std::max(rWidths[x].m_nValue, aChildSize.Width());
+ rWidths[x].m_nValue = std::max<sal_Int32>(rWidths[x].m_nValue, aChildSize.Width());
if (nHeight == 1)
- rHeights[y].m_nValue = std::max(rHeights[y].m_nValue, aChildSize.Height());
+ rHeights[y].m_nValue = std::max<sal_Int32>(rHeights[y].m_nValue, aChildSize.Height());
}
}
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 6c6c4715047e..7ae0f8e41d68 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1518,7 +1518,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
aSz.AdjustWidth(pData->aSz.Width() );
}
else
- pData->aSz.setHeight( std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ) );
+ pData->aSz.setHeight( std::max<sal_Int32>( std::max<sal_Int32>( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ) );
nWidth += nTextWidth;
}
@@ -1538,7 +1538,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
if ( nFontHeight > nWidth )
nWidth += nFontHeight;
- pData->aSz.setHeight( std::max( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ) );
+ pData->aSz.setHeight( std::max<sal_Int32>( std::max<sal_Int32>( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ) );
}
pData->aSz.AdjustHeight(EXTRAITEMHEIGHT ); // little bit more distance
@@ -1594,7 +1594,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
nImgOrChkWidth = aMaxSize.Height() + nExtra;
else // non NWF case
nImgOrChkWidth = nFontHeight/2 + gfxExtra;
- nImgOrChkWidth = std::max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra );
+ nImgOrChkWidth = std::max<sal_Int32>( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra );
nTextPos = static_cast<sal_uInt16>(nImgOrChkPos + nImgOrChkWidth);
nTextPos = nTextPos + gfxExtra;
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 5e7b424c1392..094d9cc1589a 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1387,7 +1387,7 @@ ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const
return nullptr;
}
-static void ImplAddButtonBorder( long &rWidth, long& rHeight, bool bNativeButtons )
+static void ImplAddButtonBorder( sal_Int32 &rWidth, sal_Int32& rHeight, bool bNativeButtons )
{
rWidth += SMALLBUTTON_HSIZE;
rHeight += SMALLBUTTON_VSIZE;
@@ -1411,8 +1411,8 @@ bool ToolBox::ImplCalcItem()
long nDefWidth;
long nDefHeight;
- long nMaxWidth = 0;
- long nMaxHeight = 0;
+ sal_Int32 nMaxWidth = 0;
+ sal_Int32 nMaxHeight = 0;
long nMinWidth = 6;
long nMinHeight = 6;
long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
@@ -1625,16 +1625,16 @@ bool ToolBox::ImplCalcItem()
if ( item.meType == ToolBoxItemType::BUTTON || item.meType == ToolBoxItemType::SPACE )
{
// add borders
- long w = item.maItemSize.Width();
- long h = item.maItemSize.Height();
+ sal_Int32 w = item.maItemSize.Width();
+ sal_Int32 h = item.maItemSize.Height();
ImplAddButtonBorder( w, h, mpData->mbNativeButtons );
item.maItemSize.setWidth(w);
item.maItemSize.setHeight(h);
if( item.meType == ToolBoxItemType::BUTTON )
{
- long nMinW = std::max(nMinWidth, item.maMinimalItemSize.Width());
- long nMinH = std::max(nMinHeight, item.maMinimalItemSize.Height());
+ long nMinW = std::max<sal_Int32>(nMinWidth, item.maMinimalItemSize.Width());
+ long nMinH = std::max<sal_Int32>(nMinHeight, item.maMinimalItemSize.Height());
long nGrowContentWidth = 0;
long nGrowContentHeight = 0;
@@ -1679,8 +1679,8 @@ bool ToolBox::ImplCalcItem()
// as this is used for alignment of multiple toolbars
// it is only required for docked toolbars
- long nFixedWidth = nDefWidth+nDropDownArrowWidth;
- long nFixedHeight = nDefHeight;
+ sal_Int32 nFixedWidth = nDefWidth+nDropDownArrowWidth;
+ sal_Int32 nFixedHeight = nDefHeight;
ImplAddButtonBorder( nFixedWidth, nFixedHeight, mpData->mbNativeButtons );
if( mbHorz )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f5548205b846..11d48b3ada08 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2352,8 +2352,8 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
// a system resize
if ( mpWindowImpl->mbWaitSystemResize )
{
- long nOutWidth;
- long nOutHeight;
+ sal_Int32 nOutWidth;
+ sal_Int32 nOutHeight;
mpWindowImpl->mpFrame->GetClientSize( nOutWidth, nOutHeight );
ImplHandleResize( this, nOutWidth, nOutHeight );
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index b838f08f848b..c1ba01a0ca24 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2415,8 +2415,8 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE
case SalEvent::Resize:
{
- long nNewWidth;
- long nNewHeight;
+ sal_Int32 nNewWidth;
+ sal_Int32 nNewHeight;
pWindow->ImplGetWindowImpl()->mpFrame->GetClientSize( nNewWidth, nNewHeight );
ImplHandleResize( pWindow, nNewWidth, nNewHeight );
}
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index c80846e621ca..9406b94a8c45 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -371,7 +371,7 @@ void I18NStatus::setStatusText( const OUString& rText )
bool bVisible = true;
if( m_pParent )
{
- long w, h;
+ sal_Int32 w, h;
m_pParent->GetClientSize( w, h );
if( w == 0 || h == 0 )
{
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index e5db7853548f..92b0b4eb2fe9 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -236,11 +236,11 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB(
BitmapBuffer* X11SalBitmap::ImplCreateDIB(
Drawable aDrawable,
SalX11Screen nScreen,
- long nDrawableDepth,
- long nX,
- long nY,
- long nWidth,
- long nHeight,
+ sal_Int32 nDrawableDepth,
+ sal_Int32 nX,
+ sal_Int32 nY,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
bool bGrey
) {
BitmapBuffer* pDIB = nullptr;
diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx
index 85984e835736..67bed525c5ea 100644
--- a/vcl/unx/generic/print/common_gfx.cxx
+++ b/vcl/unx/generic/print/common_gfx.cxx
@@ -484,7 +484,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po
PSSetColor ();
PSSetLineWidth ();
- snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPath[0].X(), pPath[0].Y());
WritePS(mpPageBody, pString);
// Handle the drawing of mixed lines mixed with curves
@@ -494,7 +494,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po
{
if (pFlgAry[i] != PolyFlags::Control) //If the next point is a PolyFlags::Normal, we're drawing a line
{
- snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y());
i++;
}
else //Otherwise we're drawing a spline
@@ -504,7 +504,8 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po
if ((pFlgAry[i] == PolyFlags::Control) && (pFlgAry[i+1] == PolyFlags::Control) &&
(pFlgAry[i+2] != PolyFlags::Control))
{
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32
+ " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n",
pPath[i].X(), pPath[i].Y(),
pPath[i+1].X(), pPath[i+1].Y(),
pPath[i+2].X(), pPath[i+2].Y());
@@ -532,13 +533,13 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol
if (nPoints <= 0 || (pPath == nullptr) || !(maFillColor.Is() || maLineColor.Is()))
return;
- snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPath[0].X(), pPath[0].Y());
WritePS(mpPageBody, pString); //Move to the starting point for the PolyPolygon
for (unsigned int i=1; i < nPoints;)
{
if (pFlgAry[i] != PolyFlags::Control)
{
- snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y());
WritePS(mpPageBody, pString);
i++;
}
@@ -549,7 +550,8 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol
if ((pFlgAry[i] == PolyFlags::Control) && (pFlgAry[i+1] == PolyFlags::Control) &&
(pFlgAry[i+2] != PolyFlags::Control))
{
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32
+ " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n",
pPath[i].X(), pPath[i].Y(),
pPath[i+1].X(), pPath[i+1].Y(),
pPath[i+2].X(), pPath[i+2].Y());
@@ -594,7 +596,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
if( nPoints == 0 || pPtAry[i] == nullptr )
continue;
- snprintf(pString, nBezString, "%li %li moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point
WritePS(mpPageBody, pString);
for (unsigned int j=1; j < nPoints;)
{
@@ -602,7 +604,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
// polygon without beziers
if ( ! pFlgAry[i] || pFlgAry[i][j] != PolyFlags::Control)
{
- snprintf(pString, nBezString, "%li %li lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y());
WritePS(mpPageBody, pString);
j++;
}
@@ -612,7 +614,8 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
break; //Error: wrong sequence of control/normal points somehow
if ((pFlgAry[i][j] == PolyFlags::Control) && (pFlgAry[i][j+1] == PolyFlags::Control) && (pFlgAry[i][j+2] != PolyFlags::Control))
{
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
+ snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32
+ " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n",
pPtAry[i][j].X(), pPtAry[i][j].Y(),
pPtAry[i][j+1].X(), pPtAry[i][j+1].Y(),
pPtAry[i][j+2].X(), pPtAry[i][j+2].Y());
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index f8951f4ea160..3b2659c5bcef 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -697,7 +697,7 @@ bool PspSalInfoPrinter::SetData(
void PspSalInfoPrinter::GetPageInfo(
const ImplJobSetup* pJobSetup,
- long& rOutWidth, long& rOutHeight,
+ sal_Int32& rOutWidth, sal_Int32& rOutHeight,
Point& rPageOffset,
Size& rPaperSize )
{
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 8f8bc056e054..872d8ca947ac 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -1442,7 +1442,7 @@ void X11SalFrame::GetWorkArea( tools::Rectangle& rWorkArea )
rWorkArea = pDisplay_->getWMAdaptor()->getWorkArea( 0 );
}
-void X11SalFrame::GetClientSize( long &rWidth, long &rHeight )
+void X11SalFrame::GetClientSize( sal_Int32 &rWidth, sal_Int32 &rHeight )
{
if( ! bViewable_ )
{
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index d95fa6ec60ac..404f45bf8015 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -1683,7 +1683,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
TriggerPaintEvent();
}
-void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight )
+void GtkSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight )
{
if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) )
{
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 4ba26b017ed4..78bb5c2bd93d 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1671,7 +1671,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
m_bDefaultPos = false;
}
-void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight )
+void GtkSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight )
{
if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) )
{
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 841cc2103cd8..a8616e8118df 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1784,7 +1784,7 @@ public:
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override
{
mrRenderer.SetSizePixel(GetSizePixel());
- fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight());
+ fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ")\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight());
if (mrRenderer.getIterCount() == 0)
mrRenderer.drawToDevice(rRenderContext, GetSizePixel(), false);
else
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 7755480dffed..af6b5685ed45 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1650,9 +1650,9 @@ void DomainMapper_Impl::appendStarMath( const Value& val )
if( oox::FormulaImportBase* formulaimport = dynamic_cast< oox::FormulaImportBase* >( xInterface.get()))
size = formulaimport->getFormulaSize();
xStarMathProperties->setPropertyValue(getPropertyName( PROP_WIDTH ),
- uno::makeAny( sal_Int32(size.Width())));
+ uno::makeAny( size.Width() ));
xStarMathProperties->setPropertyValue(getPropertyName( PROP_HEIGHT ),
- uno::makeAny( sal_Int32(size.Height())));
+ uno::makeAny( size.Height() ));
// mimic the treatment of graphics here.. it seems anchoring as character
// gives a better ( visually ) result
xStarMathProperties->setPropertyValue(getPropertyName( PROP_ANCHOR_TYPE ),