From d36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 7 Apr 2018 11:45:13 +0200 Subject: Revert "long->sal_Int32 in tools/gen.hxx" This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- avmedia/source/viewer/mediawindow_impl.cxx | 2 +- canvas/source/vcl/spritehelper.cxx | 2 +- .../controller/main/ChartController_Window.cxx | 8 +- cppcanvas/source/mtfrenderer/implrenderer.cxx | 8 +- cui/source/options/optcolor.cxx | 2 +- cui/source/options/optjava.cxx | 2 +- cui/source/tabpages/tpbitmap.cxx | 8 +- dbaccess/source/ui/querydesign/JoinController.cxx | 8 +- editeng/source/editeng/editdbg.cxx | 16 +- editeng/source/editeng/editeng.cxx | 6 +- editeng/source/editeng/impedit2.cxx | 8 +- editeng/source/editeng/impedit3.cxx | 12 +- emfio/source/reader/emfreader.cxx | 8 - framework/source/layoutmanager/layoutmanager.cxx | 4 +- .../source/layoutmanager/toolbarlayoutmanager.cxx | 22 +- include/tools/gen.hxx | 225 ++++++++++----------- include/vcl/fixed.hxx | 4 +- include/vcl/outdev.hxx | 12 +- include/vcl/salbtype.hxx | 8 +- include/vcl/salgtype.hxx | 24 +-- oox/source/export/vmlexport.cxx | 8 +- reportdesign/source/core/sdr/RptObject.cxx | 2 +- sc/qa/unit/bugfix-test.cxx | 4 +- sc/qa/unit/filters-test.cxx | 8 +- sc/qa/unit/helper/qahelper.cxx | 4 +- sc/qa/unit/subsequent_filters-test.cxx | 2 +- sc/source/core/data/drawpage.cxx | 2 +- sc/source/filter/excel/xepage.cxx | 4 +- sc/source/filter/html/htmlexp2.cxx | 8 +- sc/source/filter/xcl97/xcl97rec.cxx | 3 +- sc/source/filter/xml/xmlexprt.cxx | 8 +- sc/source/ui/Accessibility/AccessibleText.cxx | 6 +- sc/source/ui/cctrl/cbuttonw.cxx | 2 +- sc/source/ui/cctrl/checklistmenu.cxx | 2 +- sc/source/ui/cctrl/dpcontrol.cxx | 4 +- sc/source/ui/docshell/docsh4.cxx | 20 +- sc/source/ui/docshell/docsh6.cxx | 6 +- sc/source/ui/view/hdrcont.cxx | 8 +- sc/source/ui/view/printfun.cxx | 4 +- sc/source/ui/view/tabview3.cxx | 4 +- sd/qa/unit/import-tests.cxx | 14 +- sd/source/ui/slidesorter/view/SlsFramePainter.cxx | 8 +- sd/source/ui/unoidl/unopage.cxx | 4 +- sd/source/ui/view/ViewShellBase.cxx | 4 +- sd/source/ui/view/drviews3.cxx | 2 +- sd/source/ui/view/frmview.cxx | 24 +-- sfx2/source/appl/newhelp.cxx | 2 +- sfx2/source/doc/iframe.cxx | 4 +- sfx2/source/sidebar/SidebarToolBox.cxx | 2 +- starmath/source/view.cxx | 2 +- svtools/source/brwbox/brwbox1.cxx | 4 +- svtools/source/brwbox/brwbox2.cxx | 8 +- svtools/source/brwbox/brwbox3.cxx | 2 +- svtools/source/brwbox/datwin.cxx | 2 +- svtools/source/contnr/imivctl.hxx | 4 +- svtools/source/contnr/imivctl1.cxx | 10 +- svtools/source/contnr/treelistbox.cxx | 2 +- svtools/source/control/ctrlbox.cxx | 2 +- svtools/source/control/scriptedtext.cxx | 6 +- svtools/source/control/toolbarmenu.cxx | 6 +- svtools/source/control/valueset.cxx | 2 +- svtools/source/dialogs/addresstemplate.cxx | 2 +- svtools/source/misc/imap2.cxx | 8 +- svtools/source/svhtml/htmlout.cxx | 20 +- svx/source/dialog/pagectrl.cxx | 2 +- svx/source/dialog/swframeexample.cxx | 4 +- svx/source/fmcomp/fmgridcl.cxx | 4 +- svx/source/fmcomp/fmgridif.cxx | 2 +- svx/source/gallery2/galbrws2.cxx | 4 +- svx/source/sidebar/PanelLayout.cxx | 4 +- svx/source/svdraw/svdotextpathdecomposition.cxx | 2 +- sw/inc/ndarr.hxx | 2 +- sw/inc/swrect.hxx | 140 ++++++------- sw/inc/swtypes.hxx | 6 +- sw/qa/extras/htmlexport/htmlexport.cxx | 2 +- sw/qa/extras/rtfexport/rtfexport2.cxx | 4 +- sw/qa/extras/rtfimport/rtfimport.cxx | 4 +- sw/qa/extras/tiledrendering/tiledrendering.cxx | 4 +- sw/source/core/access/acccontext.cxx | 2 +- sw/source/core/bastyp/swrect.cxx | 70 +++---- sw/source/core/bastyp/tabcol.cxx | 2 +- sw/source/core/doc/htmltbl.cxx | 4 +- sw/source/core/doc/notxtfrm.cxx | 6 +- sw/source/core/doc/tblrwcl.cxx | 6 +- sw/source/core/docnode/ndtbl.cxx | 14 +- sw/source/core/docnode/ndtbl1.cxx | 4 +- sw/source/core/draw/dflyobj.cxx | 2 +- sw/source/core/frmedt/fefly1.cxx | 2 +- sw/source/core/frmedt/feshview.cxx | 4 +- sw/source/core/frmedt/fetab.cxx | 4 +- sw/source/core/frmedt/tblsel.cxx | 10 +- sw/source/core/inc/frame.hxx | 126 ++++++------ sw/source/core/inc/frmtool.hxx | 4 +- sw/source/core/inc/tabfrm.hxx | 4 +- sw/source/core/layout/calcmove.cxx | 24 +-- sw/source/core/layout/colfrm.cxx | 4 +- sw/source/core/layout/flowfrm.cxx | 8 +- sw/source/core/layout/fly.cxx | 14 +- sw/source/core/layout/flycnt.cxx | 38 ++-- sw/source/core/layout/flylay.cxx | 10 +- sw/source/core/layout/frmtool.cxx | 2 +- sw/source/core/layout/ftnfrm.cxx | 20 +- sw/source/core/layout/hffrm.cxx | 4 +- sw/source/core/layout/newfrm.cxx | 10 +- sw/source/core/layout/pagechg.cxx | 18 +- sw/source/core/layout/paintfrm.cxx | 16 +- sw/source/core/layout/sectfrm.cxx | 10 +- sw/source/core/layout/ssfrm.cxx | 28 +-- sw/source/core/layout/tabfrm.cxx | 90 ++++----- sw/source/core/layout/trvlfrm.cxx | 8 +- sw/source/core/layout/wsfrm.cxx | 30 +-- sw/source/core/text/frmcrsr.cxx | 12 +- sw/source/core/text/frmform.cxx | 4 +- sw/source/core/text/itrcrsr.cxx | 8 +- sw/source/core/text/itrform2.cxx | 10 +- sw/source/core/text/txtfly.cxx | 4 +- sw/source/core/text/txtfrm.cxx | 6 +- sw/source/core/text/txtftn.cxx | 6 +- sw/source/core/text/widorp.cxx | 2 +- sw/source/core/text/xmldump.cxx | 24 +-- sw/source/core/unocore/unostyle.cxx | 4 +- sw/source/core/view/pagepreviewlayout.cxx | 6 +- sw/source/core/view/viewsh.cxx | 14 +- sw/source/core/view/vnew.cxx | 2 +- sw/source/filter/basflt/shellio.cxx | 4 +- sw/source/filter/html/css1atr.cxx | 4 +- sw/source/filter/html/htmldrawwriter.cxx | 4 +- sw/source/filter/html/htmlflywriter.cxx | 16 +- sw/source/filter/html/htmlforw.cxx | 14 +- sw/source/filter/html/htmlplug.cxx | 4 +- sw/source/filter/html/htmltabw.cxx | 8 +- sw/source/filter/html/swhtml.cxx | 2 +- sw/source/filter/inc/fltshell.hxx | 2 +- sw/source/filter/ww8/docxsdrexport.cxx | 26 ++- sw/source/filter/ww8/rtfattributeoutput.cxx | 8 +- sw/source/filter/ww8/rtfexport.cxx | 4 +- sw/source/filter/ww8/rtfsdrexport.cxx | 6 +- sw/source/filter/ww8/wrtw8esh.cxx | 2 +- sw/source/filter/ww8/ww8atr.cxx | 6 +- sw/source/filter/ww8/ww8par.hxx | 2 +- sw/source/filter/ww8/ww8scan.cxx | 12 +- sw/source/filter/ww8/ww8scan.hxx | 2 +- sw/source/filter/xml/xmltexte.cxx | 4 +- sw/source/filter/xml/xmltexti.cxx | 4 +- sw/source/ui/dbui/dbinsdlg.cxx | 4 +- sw/source/ui/envelp/label1.cxx | 2 +- sw/source/ui/fldui/flddok.cxx | 4 +- sw/source/ui/frmdlg/frmpage.cxx | 20 +- sw/source/ui/index/cnttab.cxx | 2 +- .../uibase/dialog/SwSpellDialogChildWindow.cxx | 4 +- sw/source/uibase/docvw/PageBreakWin.cxx | 4 +- sw/source/uibase/docvw/edtwin.cxx | 8 +- sw/source/uibase/frmdlg/frmmgr.cxx | 14 +- sw/source/uibase/misc/redlndlg.cxx | 6 +- sw/source/uibase/ribbar/drawbase.cxx | 4 +- sw/source/uibase/shells/textsh.cxx | 4 +- sw/source/uibase/table/tablemgr.cxx | 2 +- sw/source/uibase/uiview/swcli.cxx | 2 +- sw/source/uibase/uiview/view.cxx | 4 +- sw/source/uibase/uiview/view2.cxx | 2 +- sw/source/uibase/uiview/viewport.cxx | 18 +- sw/source/uibase/wrtsh/select.cxx | 2 +- tools/qa/cppunit/test_rectangle.cxx | 24 +-- tools/source/generic/gen.cxx | 4 +- tools/source/generic/point.cxx | 22 +- vcl/headless/svpframe.cxx | 2 +- vcl/inc/headless/svpframe.hxx | 2 +- vcl/inc/osx/salframe.h | 2 +- vcl/inc/osx/salprn.h | 2 +- vcl/inc/salframe.hxx | 2 +- vcl/inc/salgdi.hxx | 38 ++-- vcl/inc/salprn.hxx | 2 +- vcl/inc/unx/genprn.h | 2 +- vcl/inc/unx/gtk/gtkframe.hxx | 2 +- vcl/inc/unx/salbmp.h | 10 +- vcl/inc/unx/salframe.h | 2 +- vcl/opengl/gdiimpl.cxx | 16 +- vcl/osx/salframe.cxx | 2 +- vcl/osx/salprn.cxx | 2 +- vcl/qa/cppunit/BitmapTest.cxx | 36 ++-- vcl/qa/cppunit/graphicfilter/filters-test.cxx | 6 +- vcl/qa/cppunit/jpeg/JpegReaderTest.cxx | 12 +- vcl/qt5/Qt5Frame.cxx | 2 +- vcl/qt5/Qt5Frame.hxx | 2 +- vcl/source/control/button.cxx | 2 +- vcl/source/control/combobox.cxx | 4 +- vcl/source/control/edit.cxx | 12 +- vcl/source/control/field.cxx | 2 +- vcl/source/control/field2.cxx | 18 +- vcl/source/control/fixed.cxx | 2 +- vcl/source/control/imp_listbox.cxx | 6 +- vcl/source/control/listbox.cxx | 2 +- vcl/source/control/notebookbar.cxx | 4 +- vcl/source/control/tabctrl.cxx | 8 +- vcl/source/gdi/bmpacc.cxx | 6 +- vcl/source/gdi/pdfwriter_impl.cxx | 64 +++--- vcl/source/gdi/salgdilayout.cxx | 36 ++-- vcl/source/graphic/GraphicObject.cxx | 4 +- vcl/source/outdev/rect.cxx | 4 +- vcl/source/outdev/text.cxx | 8 +- vcl/source/outdev/textline.cxx | 16 +- vcl/source/window/layout.cxx | 4 +- vcl/source/window/menu.cxx | 6 +- vcl/source/window/toolbox.cxx | 18 +- vcl/source/window/window.cxx | 4 +- vcl/source/window/winproc.cxx | 4 +- vcl/unx/generic/app/i18n_status.cxx | 2 +- vcl/unx/generic/gdi/salbmp.cxx | 10 +- vcl/unx/generic/print/common_gfx.cxx | 21 +- vcl/unx/generic/print/genprnpsp.cxx | 2 +- vcl/unx/generic/window/salframe.cxx | 2 +- vcl/unx/gtk/gtksalframe.cxx | 2 +- vcl/unx/gtk3/gtk3gtkframe.cxx | 2 +- vcl/workben/vcldemo.cxx | 2 +- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 +- 215 files changed, 1119 insertions(+), 1122 deletions(-) diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index ce5efb11cf97..da0d87ba5ad8 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -529,7 +529,7 @@ void MediaWindowImpl::Resize() if (mpMediaWindowControl) { const sal_Int32 nControlHeight = mpMediaWindowControl->GetSizePixel().Height(); - const sal_Int32 nControlY = std::max(aCurSize.Height() - nControlHeight - nOffset, 0); + const sal_Int32 nControlY = std::max(aCurSize.Height() - nControlHeight - nOffset, 0L); 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 f8f3a59b0fa2..366d0a5b9829 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(20,aOutputSize.Height()) ); + aVCLFont.SetFontHeight( std::min(long(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 4225a269c535..83dfc4a1a0c0 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 { - aRectangle.Left(), - aRectangle.Top(), - aRectangle.GetWidth(), - aRectangle.GetHeight() + sal_Int32(aRectangle.Left()), + sal_Int32(aRectangle.Top()), + sal_Int32(aRectangle.GetWidth()), + sal_Int32(aRectangle.GetHeight()) }; uno::Sequence aCallbackData = comphelper::InitPropertySequence( diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 01d479a27449..806353dbe543 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(), 1 ), - std::max( aMtfSizePixPre.Height(), 1 ) ); + const Size aMtfSizePix( std::max( aMtfSizePixPre.Width(), 1L ), + std::max( aMtfSizePixPre.Height(), 1L ) ); // 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(), 1 ), - std::max( aMtfSizePixPre.Height(), 1 ) ); + const Size aMtfSizePix( std::max( aMtfSizePixPre.Width(), 1L ), + std::max( aMtfSizePixPre.Height(), 1L ) ); sal_Int32 nCurrActions(0); ActionFactoryParameters aParms(aStateStack, diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index ca131aec41d8..a273888772c6 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(RECT_MAX)); + Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff)); Size aFixedSize(aFixedText->CalcMinimumSize()); nCheckBoxLabelOffset = aCheckSize.Width() - aFixedSize.Width(); } diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 2d9618f7f128..2534247494aa 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(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 4d4093f210a8..b2ced9344e0b 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(aTempBitmapSize.Width(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); - rBitmapSize.setHeight( (OutputDevice::LogicToLogic(aTempBitmapSize.Height(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); + rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); + rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast(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(aTempBitmapSize.Width(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); - rBitmapSize.setHeight( (OutputDevice::LogicToLogic(aTempBitmapSize.Height(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); + rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); + rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast(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 7ba38b159bb1..8e056acb2186 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", elem->GetPosition().Y() ); - aWindowData.put( "WindowLeft", elem->GetPosition().X() ); - aWindowData.put( "WindowWidth", elem->GetSize().Width() ); - aWindowData.put( "WindowHeight", elem->GetSize().Height() ); + aWindowData.put( "WindowTop", static_cast(elem->GetPosition().Y()) ); + aWindowData.put( "WindowLeft", static_cast(elem->GetPosition().X()) ); + aWindowData.put( "WindowWidth", static_cast(elem->GetSize().Width()) ); + aWindowData.put( "WindowHeight", static_cast(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 6b929d7f1358..3dbdadb6af22 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(aSz.Height()); + aDebStr.append(static_cast(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(aSz.Height()); + aDebStr.append(static_cast(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(rPortion.GetSize().Width()); + aPortionStr.append(static_cast(rPortion.GetSize().Width())); aPortionStr.append(')'); aPortionStr.append('['); aPortionStr.append(static_cast(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: %" 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, "\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, "\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=%" 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() ) ); + 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() ) ); aR = pV->GetVisArea(); - 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() ); + fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", 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 01bc8dadc7e2..6e7ffce529f3 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1813,17 +1813,17 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara ) void EditEngine::StripPortions() { ScopedVclPtrInstance< VirtualDevice > aTmpDev; - tools::Rectangle aBigRect( Point( 0, 0 ), Size( RECT_MAX, RECT_MAX ) ); + tools::Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) ); if ( IsVertical() ) { if( IsTopToBottom() ) { aBigRect.SetRight( 0 ); - aBigRect.SetLeft( RECT_MIN ); + aBigRect.SetLeft( -0x7FFFFFFF ); } else { - aBigRect.SetTop( RECT_MIN ); + aBigRect.SetTop( -0x7FFFFFFF ); aBigRect.SetBottom( 0 ); } } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index c58c76b4e8a5..19e035fafccd 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( RECT_MAX, RECT_MAX ), + aPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), aMinAutoPaperSize( 0x0, 0x0 ), - aMaxAutoPaperSize( RECT_MAX, RECT_MAX ), + aMaxAutoPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), aEditDoc( pItemPool ), aWordDelimiters(" .,;:-`'?!_=\"{}()[]"), bKernAsianPunctuation(false), @@ -4265,9 +4265,9 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz ) aPaperSize = rNewSz; long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0; - long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : RECT_MAX; + long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF; long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0; - long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : RECT_MAX; + long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF; // Minimum/Maximum width: if ( aPaperSize.Width() < nMinWidth ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 369017cac794..7cc6dfddb695 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( 1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) ); + long nWidth = std::max( long(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(GetXValue( long(aBulletArea.Right()) )) ); + pParaPortion->SetBulletX( static_cast(GetXValue( 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(GetXValue( long(aBulletArea.Right()) )) ); + pParaPortion->SetBulletX( static_cast(GetXValue( 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( aOldPositions.Min(), nNewPos ); - sal_Int32 nLastPortion = std::max( aOldPositions.Max(), nNewPos ); + sal_Int32 nFirstPortion = std::min( static_cast(aOldPositions.Min()), nNewPos ); + sal_Int32 nLastPortion = std::max( static_cast(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( aOldPositions.Min(), nNewPos ); + sal_Int32 nFirstInvPara = std::min( static_cast(aOldPositions.Min()), nNewPos ); InvalidateFromParagraph( nFirstInvPara ); } return aSel; diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index bc13659a2631..5164450bcece 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -750,9 +750,6 @@ namespace emfio case EMR_SETWINDOWEXTEX : { mpInputStream->ReadUInt32( nW ).ReadUInt32( nH ); - // clamp to valid range - nW = std::max(std::min(nW, RECT_MAX), RECT_MIN); - nH = std::max(std::min(nH, RECT_MAX), RECT_MIN); SetWinExt( Size( nW, nH ), true); } break; @@ -1930,11 +1927,6 @@ namespace emfio SetrclFrame(rclFrame); SetrclBounds(rclBounds); - // clamp to valid range - nPixX = std::max(std::min(nPixX, RECT_MAX), RECT_MIN); - nPixY = std::max(std::min(nPixY, RECT_MAX), RECT_MIN); - nMillX = std::max(std::min(nMillX, RECT_MAX), RECT_MIN); - nMillY = std::max(std::min(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 1c3cf233d12e..3eed6268f3f0 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(), 0 )), + implts_setStatusBarPosSize( ::Point( 0, std::max(( aContainerSize.Height() ), long( 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() ), 0)), + implts_setStatusBarPosSize( ::Point( 0, std::max(( aContainerClientSize.Height - aStatusBarSize.Height() ), long( 0 ))), ::Size( aContainerClientSize.Width, aStatusBarSize.Height() )); } } diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 2048f9a9b3ae..e8925e9de098 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, aFrontDockingRect.getWidth() ); + sal_Int32 nMove = std::min( nSpace, static_cast(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() ), - aTrackingRect.getWidth() )); + sal_Int32( 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() ), - aTrackingRect.getHeight() )); + sal_Int32( 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() ), - aTrackingRect.getWidth() )); + sal_Int32( 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() ), - aTrackingRect.getHeight() )); + sal_Int32( 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( rTrackingRect.Left(), sal_Int32( 0 ))); + sal_Int32 nPosX( std::max( sal_Int32( 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( aDockingAreaRect.getHeight(), 0 ); + sal_Int32 nDockHeight = std::max( static_cast(aDockingAreaRect.getHeight()), sal_Int32( 0 )); if ( nDockHeight == 0 ) { sal_Int32 nPosY( std::max( aDockingAreaRect.Top(), aDockingAreaRect.Bottom() )); @@ -2904,8 +2904,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( std::max( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ), nTopDockingAreaSize )); - sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() ); - sal_Int32 nDockWidth = std::max( aDockingAreaRect.getWidth(), 0 ); + sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast(aTrackingRect.getHeight()) ); + sal_Int32 nDockWidth = std::max( static_cast(aDockingAreaRect.getWidth()), sal_Int32( 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( rTrackingRect.Left(), 0 )); + sal_Int32 nPosX( std::max( sal_Int32( rTrackingRect.Left()), sal_Int32( 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( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ), nTopDockingAreaSize )); - sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() ); + sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast(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 3254d2cba844..90486536c401 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -25,7 +25,6 @@ #include #include #include -#include class SvStream; namespace rtl @@ -35,30 +34,27 @@ 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( sal_Int32 _nA, sal_Int32 _nB ) : nA(_nA), nB(_nB) {} + Pair( long _nA, long _nB ) : nA(_nA), nB(_nB) {} - sal_Int32 A() const { return nA; } - sal_Int32 B() const { return nB; } + long A() const { return nA; } + long B() const { return nB; } - sal_Int32& A() { return nA; } - sal_Int32& B() { return nB; } + long& A() { return nA; } + long& 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: - sal_Int32 nA; - sal_Int32 nB; + long nA; + long nB; }; namespace tools { namespace detail { @@ -78,35 +74,33 @@ class SAL_WARN_UNUSED SAL_DLLPUBLIC_EXPORT Point final : protected Pair { public: Point() {} - Point( sal_Int32 nX, sal_Int32 nY ) : Pair( nX, nY ) - { - } + Point( long nX, long nY ) : Pair( nX, nY ) {} - sal_Int32 X() const { return nA; } - sal_Int32 Y() const { return nB; } + long X() const { return nA; } + long Y() const { return nB; } - void Move( sal_Int32 nHorzMove, sal_Int32 nVertMove ); + void Move( long nHorzMove, long nVertMove ); void Move( Size const & s ); - sal_Int32 AdjustX( sal_Int32 nHorzMove ) { nA += nHorzMove; return nA; } - sal_Int32 AdjustY( sal_Int32 nVertMove ) { nB += nVertMove; return nB; } + long AdjustX( long nHorzMove ) { nA += nHorzMove; return nA; } + long AdjustY( long nVertMove ) { nB += nVertMove; return nB; } - void RotateAround( sal_Int32& rX, sal_Int32& rY, short nOrientation ) const; + void RotateAround( long& rX, long& rY, short nOrientation ) const; void RotateAround( Point&, short nOrientation ) const; Point& operator += ( const Point& rPoint ); Point& operator -= ( const Point& rPoint ); - Point& operator *= ( const sal_Int32 nVal ); - Point& operator /= ( const sal_Int32 nVal ); + Point& operator *= ( const long nVal ); + Point& operator /= ( const long 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 sal_Int32 nVal2 ); - friend inline Point operator/( const Point &rVal1, const sal_Int32 nVal2 ); + friend inline Point operator*( const Point &rVal1, const long nVal2 ); + friend inline Point operator/( const Point &rVal1, const long nVal2 ); - 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; } + long getX() const { return X(); } + long getY() const { return Y(); } + void setX(long nX) { nA = nX; } + void setY(long nY) { nB = nY; } Pair const & toPair() const { return *this; } Pair & toPair() { return *this; } @@ -114,7 +108,7 @@ public: using Pair::toString; }; -inline void Point::Move( sal_Int32 nHorzMove, sal_Int32 nVertMove ) +inline void Point::Move( long nHorzMove, long nVertMove ) { nA += nHorzMove; nB += nVertMove; @@ -134,14 +128,14 @@ inline Point& Point::operator -= ( const Point& rPoint ) return *this; } -inline Point& Point::operator *= ( const sal_Int32 nVal ) +inline Point& Point::operator *= ( const long nVal ) { nA *= nVal; nB *= nVal; return *this; } -inline Point& Point::operator /= ( const sal_Int32 nVal ) +inline Point& Point::operator /= ( const long nVal ) { nA /= nVal; nB /= nVal; @@ -158,12 +152,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 sal_Int32 nVal2 ) +inline Point operator*( const Point &rVal1, const long nVal2 ) { return Point( rVal1.nA*nVal2, rVal1.nB*nVal2 ); } -inline Point operator/( const Point &rVal1, const sal_Int32 nVal2 ) +inline Point operator/( const Point &rVal1, const long nVal2 ) { return Point( rVal1.nA/nVal2, rVal1.nB/nVal2 ); } @@ -191,20 +185,18 @@ class SAL_WARN_UNUSED Size final : protected Pair { public: Size() {} - Size( sal_Int32 nWidth, sal_Int32 nHeight ) : Pair( nWidth, nHeight ) - { - } + Size( long nWidth, long nHeight ) : Pair( nWidth, nHeight ) {} - sal_Int32 Width() const { return nA; } - sal_Int32 Height() const { return nB; } + long Width() const { return nA; } + long Height() const { return nB; } - sal_Int32 AdjustWidth( sal_Int32 n ) { nA += n; return nA; } - sal_Int32 AdjustHeight( sal_Int32 n ) { nB += n; return nB; } + long AdjustWidth( long n ) { nA += n; return nA; } + long AdjustHeight( long n ) { nB += n; return nB; } - 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; } + long getWidth() const { return Width(); } + long getHeight() const { return Height(); } + void setWidth(long nWidth) { nA = nWidth; } + void setHeight(long nHeight) { nB = nHeight; } Pair const & toPair() const { return *this; } Pair & toPair() { return *this; } @@ -237,22 +229,22 @@ inline void Point::Move( Size const & s ) // Range -#define RANGE_MAX SAL_MAX_INT32 +#define RANGE_MAX LONG_MAX class SAL_WARN_UNUSED Range final : protected Pair { public: Range() {} - Range( sal_Int32 nMin, sal_Int32 nMax ) : Pair( nMin, nMax ) {} + Range( long nMin, long nMax ) : Pair( nMin, nMax ) {} - sal_Int32 Min() const { return nA; } - sal_Int32 Max() const { return nB; } - sal_Int32 Len() const { return nB - nA + 1; } + long Min() const { return nA; } + long Max() const { return nB; } + long Len() const { return nB - nA + 1; } - sal_Int32& Min() { return nA; } - sal_Int32& Max() { return nB; } + long& Min() { return nA; } + long& Max() { return nB; } - bool IsInside( sal_Int32 nIs ) const; + bool IsInside( long nIs ) const; void Justify(); @@ -262,7 +254,7 @@ public: using Pair::toString; }; -inline bool Range::IsInside( sal_Int32 nIs ) const +inline bool Range::IsInside( long nIs ) const { return ((nA <= nIs) && (nIs <= nB )); } @@ -271,7 +263,7 @@ inline void Range::Justify() { if ( nA > nB ) { - sal_Int32 nHelp = nA; + long nHelp = nA; nA = nB; nB = nHelp; } @@ -296,32 +288,32 @@ inline std::basic_ostream & operator <<( // Selection -#define SELECTION_MIN SAL_MIN_INT32 -#define SELECTION_MAX SAL_MAX_INT32 +#define SELECTION_MIN LONG_MIN +#define SELECTION_MAX LONG_MAX class SAL_WARN_UNUSED Selection final : protected Pair { public: Selection() {} - Selection( sal_Int32 nPos ) : Pair( nPos, nPos ) {} - Selection( sal_Int32 nMin, sal_Int32 nMax ) : Pair( nMin, nMax ) {} + Selection( long nPos ) : Pair( nPos, nPos ) {} + Selection( long nMin, long nMax ) : Pair( nMin, nMax ) {} - sal_Int32 Min() const { return nA; } - sal_Int32 Max() const { return nB; } - sal_Int32 Len() const { return nB - nA; } + long Min() const { return nA; } + long Max() const { return nB; } + long Len() const { return nB - nA; } - sal_Int32& Min() { return nA; } - sal_Int32& Max() { return nB; } + long& Min() { return nA; } + long& Max() { return nB; } - bool IsInside( sal_Int32 nIs ) const; + bool IsInside( long nIs ) const; void Justify(); bool operator !() const { return !Len(); } - sal_Int32 getMin() const { return Min(); } - void setMin(sal_Int32 nMin) { Min() = nMin; } - void setMax(sal_Int32 nMax) { Max() = nMax; } + long getMin() const { return Min(); } + void setMin(long nMin) { Min() = nMin; } + void setMax(long nMax) { Max() = nMax; } Pair const & toPair() const { return *this; } Pair & toPair() { return *this; } @@ -329,7 +321,7 @@ public: using Pair::toString; }; -inline bool Selection::IsInside( sal_Int32 nIs ) const +inline bool Selection::IsInside( long nIs ) const { return ((nA <= nIs) && (nIs < nB )); } @@ -338,7 +330,7 @@ inline void Selection::Justify() { if ( nA > nB ) { - sal_Int32 nHelp = nA; + long nHelp = nA; nA = nB; nB = nHelp; } @@ -362,6 +354,9 @@ inline std::basic_ostream & 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! @@ -373,28 +368,27 @@ inline std::basic_ostream & operator <<( /// Ok, now is the time for despair. namespace tools { - class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Rectangle final { - static constexpr sal_Int32 RECT_EMPTY = -32767; + static constexpr short RECT_EMPTY = -32767; public: Rectangle(); Rectangle( const Point& rLT, const Point& rRB ); - Rectangle( sal_Int32 nLeft, sal_Int32 nTop, - sal_Int32 nRight, sal_Int32 nBottom ); + Rectangle( long nLeft, long nTop, + long nRight, long nBottom ); /// Constructs an empty Rectangle, with top/left at the specified params - Rectangle( sal_Int32 nLeft, sal_Int32 nTop ); + Rectangle( long nLeft, long nTop ); Rectangle( const Point& rLT, const Size& rSize ); - sal_Int32 Left() const { return nLeft; } - sal_Int32 Right() const { return nRight; } - sal_Int32 Top() const { return nTop; } - sal_Int32 Bottom() const { return nBottom; } + long Left() const { return nLeft; } + long Right() const { return nRight; } + long Top() const { return nTop; } + long Bottom() const { return nBottom; } - 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; } + void SetLeft(long v) { nLeft = v; } + void SetRight(long v) { nRight = v; } + void SetTop(long v) { nTop = v; } + void SetBottom(long v) { nBottom = v; } inline Point TopLeft() const; inline Point TopRight() const; @@ -407,21 +401,20 @@ public: inline Point Center() const; /// Move the top and left edges by a delta, preserving width and height - inline void Move( sal_Int32 nHorzMoveDelta, sal_Int32 nVertMoveDelta ); + inline void Move( long nHorzMoveDelta, long nVertMoveDelta ); void Move( Size const & s ) { Move(s.Width(), s.Height()); } - 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; } - + 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; } 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 sal_Int32 GetWidth() const; + inline long GetWidth() const; /// Returns the difference between bottom and top, assuming the range is inclusive. - inline sal_Int32 GetHeight() const; + inline long GetHeight() const; tools::Rectangle& Union( const tools::Rectangle& rRect ); tools::Rectangle& Intersection( const tools::Rectangle& rRect ); @@ -454,39 +447,39 @@ public: TOOLS_DLLPUBLIC friend SvStream& WriteRectangle( SvStream& rOStream, const tools::Rectangle& rRect ); // ONE - sal_Int32 getX() const { return nLeft; } - sal_Int32 getY() const { return nTop; } + long getX() const { return nLeft; } + long getY() const { return nTop; } /// Returns the difference between right and left, assuming the range includes one end, but not the other. - sal_Int32 getWidth() const { return nRight - nLeft; } + long getWidth() const { return nRight - nLeft; } /// Returns the difference between bottom and top, assuming the range includes one end, but not the other. - sal_Int32 getHeight() const { return nBottom - nTop; } + long getHeight() const { return nBottom - nTop; } /// Set the left edge of the rectangle to x, preserving the width - void setX( sal_Int32 x ) { nRight += x - nLeft; nLeft = x; } + void setX( long x ) { nRight += x - nLeft; nLeft = x; } /// Set the top edge of the rectangle to y, preserving the height - 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; } + void setY( long y ) { nBottom += y - nTop; nTop = y; } + void setWidth( long n ) { nRight = nLeft + n; } + void setHeight( long 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(sal_Int32 nExpandBy); - inline void shrink(sal_Int32 nShrinkBy); + inline void expand(long nExpandBy); + inline void shrink(long nShrinkBy); /** * Sanitizing variants for handling data from the outside */ void SaturatingSetSize(const Size& rSize); - void SaturatingSetX(sal_Int32 x); - void SaturatingSetY(sal_Int32 y); + void SaturatingSetX(long x); + void SaturatingSetY(long y); private: - sal_Int32 nLeft; - sal_Int32 nTop; - sal_Int32 nRight; - sal_Int32 nBottom; + long nLeft; + long nTop; + long nRight; + long nBottom; }; } @@ -504,8 +497,8 @@ inline tools::Rectangle::Rectangle( const Point& rLT, const Point& rRB ) nBottom = rRB.Y(); } -inline tools::Rectangle::Rectangle( sal_Int32 _nLeft, sal_Int32 _nTop, - sal_Int32 _nRight, sal_Int32 _nBottom ) +inline tools::Rectangle::Rectangle( long _nLeft, long _nTop, + long _nRight, long _nBottom ) { nLeft = _nLeft; nTop = _nTop; @@ -513,7 +506,7 @@ inline tools::Rectangle::Rectangle( sal_Int32 _nLeft, sal_Int32 _nTop, nBottom = _nBottom; } -inline tools::Rectangle::Rectangle( sal_Int32 _nLeft, sal_Int32 _nTop ) +inline tools::Rectangle::Rectangle( long _nLeft, long _nTop ) { nLeft = _nLeft; nTop = _nTop; @@ -596,7 +589,7 @@ inline Point tools::Rectangle::Center() const return Point( nLeft+(nRight-nLeft)/2 , nTop+(nBottom-nTop)/2 ); } -inline void tools::Rectangle::Move( sal_Int32 nHorzMove, sal_Int32 nVertMove ) +inline void tools::Rectangle::Move( long nHorzMove, long nVertMove ) { nLeft += nHorzMove; nTop += nVertMove; @@ -616,9 +609,9 @@ inline void tools::Rectangle::SetPos( const Point& rPoint ) nTop = rPoint.Y(); } -inline sal_Int32 tools::Rectangle::GetWidth() const +inline long tools::Rectangle::GetWidth() const { - sal_Int32 n; + long n; if ( nRight == RECT_EMPTY ) n = 0; else @@ -633,9 +626,9 @@ inline sal_Int32 tools::Rectangle::GetWidth() const return n; } -inline sal_Int32 tools::Rectangle::GetHeight() const +inline long tools::Rectangle::GetHeight() const { - sal_Int32 n; + long n; if ( nBottom == RECT_EMPTY ) n = 0; else @@ -724,7 +717,7 @@ inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt ) } } -inline void tools::Rectangle::expand(sal_Int32 nExpandBy) +inline void tools::Rectangle::expand(long nExpandBy) { nLeft -= nExpandBy; nTop -= nExpandBy; @@ -732,7 +725,7 @@ inline void tools::Rectangle::expand(sal_Int32 nExpandBy) nBottom += nExpandBy; } -inline void tools::Rectangle::shrink(sal_Int32 nShrinkBy) +inline void tools::Rectangle::shrink(long nShrinkBy) { nLeft += nShrinkBy; nTop += nShrinkBy; diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx index 77b529b14671..49fdef75ddef 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 = RECT_MAX); + static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = 0x7fffffff); static Size getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth); - Size CalcMinimumSize(long nMaxWidth = RECT_MAX) const; + Size CalcMinimumSize(long nMaxWidth = 0x7fffffff) 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 3dcc52de5355..649faa6388ef 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; - sal_Int32 mnOutWidth; - sal_Int32 mnOutHeight; + long mnOutWidth; + long 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 sal_Int32 mnTextOffX; - mutable sal_Int32 mnTextOffY; + mutable long mnTextOffX; + mutable long 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, sal_Int32 nCurX, sal_Int32 nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev, + SAL_DLLPRIVATE static void ImplDrawWavePixel( long nOriginX, long nOriginY, long nCurX, long 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, sal_Int32 nX, sal_Int32 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 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 78628616f7a9..1a940214501d 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -327,10 +327,10 @@ public: struct VCL_DLLPUBLIC BitmapBuffer { - ScanlineFormat mnFormat; - sal_Int32 mnWidth; - sal_Int32 mnHeight; - sal_Int32 mnScanlineSize; + ScanlineFormat mnFormat; + long mnWidth; + long mnHeight; + long mnScanlineSize; sal_uInt16 mnBitCount; ColorMask maColorMask; BitmapPalette maPalette; diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx index d6c8dd8e11d5..0e37300f3dbd 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 { - sal_Int32 mnX; - sal_Int32 mnY; + long mnX; + long mnY; }; typedef const SalPoint* PCONSTSALPOINT; struct SalTwoRect { - sal_Int32 mnSrcX; - sal_Int32 mnSrcY; - sal_Int32 mnSrcWidth; - sal_Int32 mnSrcHeight; - sal_Int32 mnDestX; - sal_Int32 mnDestY; - sal_Int32 mnDestWidth; - sal_Int32 mnDestHeight; + long mnSrcX; + long mnSrcY; + long mnSrcWidth; + long mnSrcHeight; + long mnDestX; + long mnDestY; + long mnDestWidth; + long mnDestHeight; - 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) + SalTwoRect(long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, + long nDestX, long nDestY, long nDestWidth, long 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 90284382ad22..2ec6992381a6 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( pRect->Left() ) - .append( "," ).append( pRect->Top() ) + OStringBuffer( 20 ).append( sal_Int32( pRect->Left() ) ) + .append( "," ).append( sal_Int32( pRect->Top() ) ) .makeStringAndClear() ); pAttrList->add( XML_coordsize, - OStringBuffer( 20 ).append( pRect->Right() - pRect->Left() ) - .append( "," ).append( pRect->Bottom() - pRect->Top() ) + OStringBuffer( 20 ).append( sal_Int32( pRect->Right() ) - sal_Int32( pRect->Left() ) ) + .append( "," ).append( sal_Int32( pRect->Bottom() ) - sal_Int32( pRect->Top() ) ) .makeStringAndClear() ); } diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 737c87e3b1fe..8d38b5ddf478 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -407,7 +407,7 @@ void OObjectBase::SetPropsFromRect(const tools::Rectangle& _rRect) { uno::Reference xSection = pPage->getSection(); assert(_rRect.getHeight() >= 0); - const sal_uInt32 newHeight( ::std::max(0, _rRect.getHeight()+_rRect.Top()) ); + const sal_uInt32 newHeight( ::std::max(0l, _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 d59b78d4a586..94fa2d188189 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(sal_Int32((MAXCOL - 1) * nColWidth), aPos.getX()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(10000 * nRowHeight), aPos.getY()); + CPPUNIT_ASSERT_EQUAL(static_cast((MAXCOL - 1) * nColWidth), aPos.getX()); + CPPUNIT_ASSERT_EQUAL(static_cast(10000 * nRowHeight), aPos.getY()); xComponent->dispose(); } diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 705627e79f75..0c4eeb808145 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 %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.GetHeight(), aSnap.GetHeight() ); + printf("expected height %ld actual %ld\n", aRect.GetHeight(), aSnap.GetHeight() ); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetHeight(), aSnap.GetHeight(), TOLERANCE ) ); - printf("expected width %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.GetWidth(), aSnap.GetWidth() ); + printf("expected width %ld actual %ld\n", aRect.GetWidth(), aSnap.GetWidth() ); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetWidth(), aSnap.GetWidth(), TOLERANCE ) ); - printf("expected left %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.Left(), aSnap.Left() ); + printf("expected left %ld actual %ld\n", aRect.Left(), aSnap.Left() ); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Left(), aSnap.Left(), TOLERANCE ) ); - printf("expected right %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.Top(), aSnap.Top() ); + printf("expected right %ld actual %ld\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 279664b401ca..3f7c93198312 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", sal_Int32(200), aFont.GetFontSize().getHeight()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, 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", sal_Int32(240), aFont.GetFontSize().getHeight()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, 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 3e602c95b8af..2e876434ce49 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(sal_Int32(11137), pOleObj->GetLogicRect().getWidth()); + CPPUNIT_ASSERT_EQUAL(11137L, 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 5ccd3cdd5598..302f0e93ff45 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( RECT_MAX, RECT_MAX ) ); + SetSize( Size( LONG_MAX, LONG_MAX ) ); } ScDrawPage::~ScDrawPage() diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 6d7d65edbf43..0e0ce7163354 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 - ( rHdrItemSet.Get( ATTR_PAGE_SIZE ).GetSize().Height() ); + static_cast< sal_Int32 >( 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 - ( rFtrItemSet.Get( ATTR_PAGE_SIZE ).GetSize().Height() ); + static_cast< sal_Int32 >( 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 d6887744f517..45743fb88518 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(pE->aSize.Width()); + append(static_cast(pE->aSize.Width())); aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).append('='). - append(pE->aSize.Height()); + append(static_cast(pE->aSize.Height())); if ( pE->bInCell ) { aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace).append('='). - append(pE->aSpace.Width()); + append(static_cast(pE->aSpace.Width())); aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace).append('='). - append(pE->aSpace.Height()); + append(static_cast(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 5151e39c77f5..a4ecfd8860fe 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -653,8 +653,7 @@ void VmlCommentExporter::EndShape( sal_Int32 nShapeElement ) { char pAnchor[100]; sax_fastparser::FSHelperPtr pVmlDrawing = GetFS(); - snprintf( pAnchor, 100, "%" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 - ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32, + snprintf( pAnchor, 100, "%ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld", 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 42b24e02812f..1289cd238473 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4882,13 +4882,13 @@ void ScXMLExport::GetViewSettings(uno::Sequence& rProps) tools::Rectangle aRect(pEmbeddedObj->GetVisArea()); sal_uInt16 i(0); pProps[i].Name = "VisibleAreaTop"; - pProps[i].Value <<= aRect.getY(); + pProps[i].Value <<= static_cast(aRect.getY()); pProps[++i].Name = "VisibleAreaLeft"; - pProps[i].Value <<= aRect.getX(); + pProps[i].Value <<= static_cast(aRect.getX()); pProps[++i].Name = "VisibleAreaWidth"; - pProps[i].Value <<= aRect.getWidth(); + pProps[i].Value <<= static_cast(aRect.getWidth()); pProps[++i].Name = "VisibleAreaHeight"; - pProps[i].Value <<= aRect.getHeight(); + pProps[i].Value <<= static_cast(aRect.getHeight()); } } } diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index b61983665892..66bcc5f4ad88 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( RECT_MAX, aSize.getHeight() ) ); + pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) ); long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() ); - aSize.setWidth( std::max( aSize.getWidth(), nTxtWidth + 2 ) ); + aSize.setWidth( std::max( 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( aSize.getWidth(), nTxtWidth ) ); } } diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx index afce592d640e..c4067be67f3a 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(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 d52230d080fc..fcffd7809543 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(), 26); + long h = std::min(maChkToggleAll->CalcMinimumSize().Height(), 26L); 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 022cc66bb257..a714f116f9c5 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(maSize.getWidth() / 2, nMaxSize); + long nH = std::min(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 a0b2cf8b8678..c5d96d47b00b 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 -sal_Int32 SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCCOL& rStartCol ) +long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol ) { SCCOL nCol = 0; - sal_Int32 nTwips = static_cast(nVal / HMM_PER_TWIPS); - sal_Int32 nSnap = 0; + long nTwips = static_cast(nVal / HMM_PER_TWIPS); + long nSnap = 0; while ( nCol( nSnap * HMM_PER_TWIPS ); rStartCol = nCol; return nVal; } SAL_WARN_UNUSED_RESULT -sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCROW& rStartRow ) +long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow ) { SCROW nRow = 0; - sal_Int32 nTwips = static_cast(nVal / HMM_PER_TWIPS); - sal_Int32 nSnap = 0; + long nTwips = static_cast(nVal / HMM_PER_TWIPS); + long nSnap = 0; bool bFound = false; for (SCROW i = nRow; i <= MAXROW; ++i) @@ -2159,7 +2159,7 @@ sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCRO } nRow = i; - sal_Int32 nAdd = rDoc.GetRowHeight(i, nTab); + long nAdd = rDoc.GetRowHeight(i, nTab); if ( nSnap + nAdd/2 < nTwips || nRow < rStartRow ) { nSnap += nAdd; @@ -2174,7 +2174,7 @@ sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCRO if (!bFound) nRow = MAXROW; // all hidden down to the bottom - nVal = nSnap * HMM_PER_TWIPS; + nVal = static_cast( 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 e08b18801609..8e3a28280e2a 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(), 0 ) ); + Point aNewPos( 0, std::max( aArea.Top(), long(0) ) ); if ( bNegativePage ) { - aNewPos.setX( std::min( aArea.Right(), 0 ) ); + aNewPos.setX( std::min( aArea.Right(), long(0) ) ); lcl_SetTopRight( aArea, aNewPos ); } else { - aNewPos.setX( std::max( aArea.Left(), 0 ) ); + aNewPos.setX( std::max( aArea.Left(), long(0) ) ); aArea.SetPos( aNewPos ); } } diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index b2146106f40e..6a46c87e47a5 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( RECT_MIN ); - aVis.SetRight( RECT_MAX ); + aVis.SetLeft( LONG_MIN ); + aVis.SetRight( LONG_MAX ); } else { - aVis.SetTop( RECT_MIN ); - aVis.SetBottom( RECT_MAX ); + aVis.SetTop( LONG_MIN ); + aVis.SetBottom( LONG_MAX ); } pSelEngine->SetVisibleArea( aVis ); diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 58316cf16907..7728f7fcfa3e 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(), 20 ); - nTwipsSizeY += aLines.Top() + std::max( aLines.Bottom(), 20 ); + nTwipsSizeX += aLines.Left() + std::max( aLines.Right(), 20L ); + nTwipsSizeY += aLines.Top() + std::max( aLines.Bottom(), 20L ); double nScaleX = static_cast(nDevSizeX) / nTwipsSizeX; double nScaleY = static_cast(nDevSizeY) / nTwipsSizeY; diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 94c71db6ec69..41bd76e976ad 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, RECT_MIN, nWidth-1, RECT_MAX ) ); + pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, LONG_MIN, nWidth-1, LONG_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( RECT_MIN, 0, RECT_MAX, nHeight-1 ) ); + pHdrSelEng->SetVisibleArea( tools::Rectangle( LONG_MIN, 0, LONG_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 33c2e47e49f7..39129f2540a3 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1563,10 +1563,10 @@ void SdImportTest::testTdf103473() SdrTextObj *const pObj = dynamic_cast(pPage->GetObj(0)); CPPUNIT_ASSERT(pObj); ::tools::Rectangle aRect = pObj->GetGeoRect(); - 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()); + CPPUNIT_ASSERT_EQUAL(3629L, aRect.Left()); + CPPUNIT_ASSERT_EQUAL(4431L, aRect.Top()); + CPPUNIT_ASSERT_EQUAL(8353L, aRect.Right()); + CPPUNIT_ASSERT_EQUAL(9155L, aRect.Bottom()); xDocShRef->DoClose(); } @@ -1905,8 +1905,8 @@ bool SdImportTest::checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeN ReadDIB(aBitmap, aBitmapStream, true); } } - CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBitmap.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBitmap.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(8L, aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(8L, aBitmap.GetSizePixel().Height()); return checkPatternValues(rExpected, aBitmap); } @@ -2343,7 +2343,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(sal_Int32(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight()); + CPPUNIT_ASSERT_EQUAL(long(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 6ad0831b7e49..07027c1d1e18 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(),nRight-nX+1),aBitmapSize.Height()), + Size(std::min(aBitmapSize.Width(),static_cast(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(), nBottom-nY+1)), + Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), static_cast(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(aBitmapSize.Width(), rBox.Right()-nX+1), + std::min(aBitmapSize.Height(), rBox.Bottom()-nY+1)), maBitmap); } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 7a34f2a80277..e5e48f13d411 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1030,10 +1030,10 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) aAny <<= GetPage()->GetLowerBorder(); break; case WID_PAGE_WIDTH: - aAny <<= GetPage()->GetSize().getWidth(); + aAny <<= static_cast( GetPage()->GetSize().getWidth() ); break; case WID_PAGE_HEIGHT: - aAny <<= GetPage()->GetSize().getHeight(); + aAny <<= static_cast( 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 67c74771fc16..22dcf4538640 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(), 1 ) ), - Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), 1) ) ); + Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast(1) ) ), + Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast(1)) ) ); } mpImpl->ResizePixel(rOrigin, rSize, false); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index af0b99c0a7f0..14f4fac32271 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(RECT_MAX, RECT_MAX) ); + ::tools::Rectangle aMinMaxRect = ::tools::Rectangle( aPnt1, Size(ULONG_MAX, ULONG_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 b08896abf358..ffaf3d3ab582 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( rPos.X() ); + aLines.append( static_cast(rPos.X()) ); aLines.append( ',' ); - aLines.append( rPos.Y() ); + aLines.append( static_cast(rPos.Y()) ); break; case SdrHelpLineKind::Vertical: aLines.append( 'V' ); - aLines.append( rPos.X() ); + aLines.append( static_cast(rPos.X()) ); break; case SdrHelpLineKind::Horizontal: aLines.append( 'H' ); - aLines.append( rPos.Y() ); + aLines.append( static_cast(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( 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_VisibleAreaTop, makeAny( static_cast(aVisArea.Top()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( static_cast(aVisArea.Left()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( static_cast(aVisArea.GetWidth()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( static_cast(aVisArea.GetHeight()) ) ); } - 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_GridCoarseWidth, makeAny( static_cast(GetGridCoarse().Width()) ) ); + aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( static_cast(GetGridCoarse().Height()) ) ); + aUserData.addValue( sUNO_View_GridFineWidth, makeAny( static_cast(GetGridFine().Width()) ) ); + aUserData.addValue( sUNO_View_GridFineHeight, makeAny( static_cast(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 1458fed74c2b..47f5a4c09c77 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -2086,7 +2086,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox() void SfxHelpTextWindow_Impl::SetOnStartupBoxPosition() { - long nX = std::max( GetOutputSizePixel().Width() - aOnStartupCB->GetSizePixel().Width(), nMinPos ); + long nX = std::max( 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 fced99a75c0b..7d7fdb02ad98 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 <<= maFrmDescr.GetMargin().Width(); + aAny <<= static_cast(maFrmDescr.GetMargin().Width()); } break; case WID_FRAME_MARGIN_HEIGHT: { - aAny <<= maFrmDescr.GetMargin().Height(); + aAny <<= static_cast(maFrmDescr.GetMargin().Height()); } break; default: ; diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx index 467f360fdddc..ba44d821371e 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(), 0)); + CreateController(GetItemId(aCommand), rFrame, std::max(rRequestedSize.Width(), 0L)); RegisterHandlers(); } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 23420cd111aa..d7a52d82caa3 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(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 3f3f1d600c85..ee4326154038 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() == RECT_MAX - ? RECT_MAX - (nColX + MIN_COLUMNWIDTH) : pCols[ nCol ]->Width() - 2*MIN_COLUMNWIDTH), + Size( (pCols[nCol]->Width() == LONG_MAX + ? LONG_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 a26159073aac..89c3babea3c7 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(aPos.X() - 1, aOverallAreaBRPos.X()) + ? std::min(long(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, RECT_MAX ), CommandEventId::ContextMenu, true ) ); + CommandEvent( Point( 1, LONG_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( 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( rEvt.GetPosPixel().X(), nMinResizeX ); if ( (nDragX - nResizeX) != static_cast(pCols[ nResizeCol ]->Width()) ) { // resize column diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 12a4772af1cf..e43f634e36bd 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 <= rRange.Max(); ++nCol ) + for( sal_Int32 nCol = rRange.Min(); nCol <= static_cast(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 4598b9f8af3c..881396dfa853 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() == RECT_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width(); + long nWidth = Width() == LONG_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 df71c7bcabad..12e574e345f9 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(RECT_MAX); + rRect.SetRight(LONG_MAX); bBoundRectsDirty = true; } - static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != RECT_MAX ); } + static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != LONG_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 059948681d62..48c65c97deb6 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( RECT_MAX ); + pEntry->aRect.SetRight( LONG_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( 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( 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( RECT_MAX ); + aBoundRect.SetBottom( LONG_MAX ); } else { @@ -3267,7 +3267,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) return false; tools::Rectangle aOptTextRect( aTextRect ); - aOptTextRect.SetBottom( RECT_MAX ); + aOptTextRect.SetBottom( LONG_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 c8771a383b25..49ac834eecac 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(aRet.Width(), nMinWidth) ); return aRet; } diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 918b6984845e..82cd893e9710 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(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 9b3eb3e95749..16b90aedd764 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( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); SetOutDevFont( i18n::ScriptType::ASIAN ); - maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); + maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); SetOutDevFont( i18n::ScriptType::COMPLEX ); - maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); + maTextSize.setHeight( std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ) ); mrOutDevice.Pop(); } diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 048208233b97..dd94ed5fd8f3 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 (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( 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( aControlSize.Width(), nMaxTextWidth ); pEntry->maSize.setHeight( aControlSize.Height() + 1 ); } diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 85823fd25e5b..54d7e3bbbf02 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(aSize.Width(), maVirDev->GetTextWidth(pItem->maText) + NAME_OFFSET) ); } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index a576181f1f12..2ea05073f492 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(nLabelWidth, FixedText::getTextDimensions(m_pImpl->pFieldLabels[0], fieldLabel, 0x7FFFFFFF).Width()); } for (sal_Int32 row=0; rowLogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) ); rBuf.append('('); - rBuf.append(aPixPt.X()); + rBuf.append(static_cast(aPixPt.X())); rBuf.append(','); - rBuf.append(aPixPt.Y()); + rBuf.append(static_cast(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(aPixPt.X()); + rBuf.append(static_cast(aPixPt.X())); rBuf.append(','); - rBuf.append(aPixPt.Y()); + rBuf.append(static_cast(aPixPt.Y())); rBuf.append(' '); } diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 8253334243c9..8ee63d19b757 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(aRect.Left()) + .append(static_cast(aRect.Left())) .append(',') - .append(aRect.Top()) + .append(static_cast(aRect.Top())) .append(',') - .append(aRect.Right()) + .append(static_cast(aRect.Right())) .append(',') - .append(aRect.Bottom()) + .append(static_cast(aRect.Bottom())) .makeStringAndClear(); } break; @@ -666,9 +666,9 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, long nOff = pCirc->GetRadius(); aCoords = OStringBuffer() - .append(aCenter.X()) + .append(static_cast(aCenter.X())) .append(',') - .append(aCenter.Y()) + .append(static_cast(aCenter.Y())) .append(',') .append(static_cast(nOff)) .makeStringAndClear(); @@ -685,17 +685,17 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, if( nCount>0 ) { const Point& rPoint = aPoly[0]; - aTmpBuf.append(rPoint.X()) + aTmpBuf.append(static_cast(rPoint.X())) .append(',') - .append(rPoint.Y()); + .append(static_cast(rPoint.Y())); } for( sal_uInt16 j=1; j(rPoint.X())) .append(',') - .append(rPoint.Y()); + .append(static_cast(rPoint.Y())); } aCoords = aTmpBuf.makeStringAndClear(); } diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index e141a664f48f..eb2fc6ef92fd 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(), 1)); + Fraction aYScale(aWinSize.Height(), std::max(aSize.Height(), 1L)); MapMode aMapMode(rRenderContext.GetMapMode()); if(aYScale < aXScale) diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index e7e3e157a5bb..ceacc555d0e6 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(5, aFrmSize.Width()) ); - aFrmSize.setHeight( std::max(5, aFrmSize.Height()) ); + aFrmSize.setWidth( std::max(5L, aFrmSize.Width()) ); + aFrmSize.setHeight( std::max(5L, aFrmSize.Height()) ); } else { diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index b36fa382badb..83e507a54eb2 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( PixelToLogic( Point(0, nUnzoomedPixelHeight), MapMode(MapUnit::Map10thMM)).Y() ); + Any aProperty = makeAny( static_cast(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 <<= PixelToLogic(Point(nColumnWidth, 0), MapMode(MapUnit::Map10thMM)).X(); + aWidth <<= static_cast(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 5611196b2000..32bdc76ab2c9 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 <<= pGrid->PixelToLogic(Point(0, nPixelHeight), MapMode(MapUnit::Map10thMM)).Y(); + aProp <<= static_cast(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 8ff45be133d5..32fee03bee82 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 ), 0 ) ); - rSelPos.setY( std::max( std::min( rSelPos.Y(), aOutputSizePixel.Height() - 1 ), 0 ) ); + rSelPos.setX( std::max( std::min( rSelPos.X(), aOutputSizePixel.Width() - 1 ), 0L ) ); + rSelPos.setY( std::max( std::min( rSelPos.Y(), aOutputSizePixel.Height() - 1 ), 0L ) ); if( nRet && ( !mpCurTheme || ( nRet > mpCurTheme->GetObjectCount() ) ) ) { diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index 91d5e588e805..90bbd328da8b 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(nWidth,aSize.Width()); if (!bCanHandleSmallerHeight) - nHeight = std::max(nHeight,aSize.Height()); + nHeight = std::max(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 18fb1e52544e..45e01138f885 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(RECT_MAX,RECT_MAX)); + rOutliner.SetPaperSize(Size(LONG_MAX,LONG_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 2ab4d146005d..2bf38363434d 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" (RECT_MAX). + SSize is set "absolute" (LONG_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 3c6818c5f807..c4b1889ae4ae 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( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ); + inline SwRect( long X, long Y, long Width, long 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 sal_Int32 nNewX, const sal_Int32 nNewY ); + inline void Pos( const long nNewX, const long nNewY ); inline void SSize( const Size& rNew ); - 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 ); + 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 ); //Get-Methods inline const Point &Pos() const; inline const Size &SSize() 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; + inline long Width() const; + inline long Height() const; + inline long Left() const; + inline long Right() const; + inline long Top() const; + inline long 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, sal_Int32 nTolerance ) const; + bool IsNear(const Point& rPoint, long 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 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 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 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; - 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; + 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; }; -typedef void (SwRect:: *SwRectSet)( const sal_Int32 nNew ); -typedef sal_Int32 (SwRect:: *SwRectGet)() const; +typedef void (SwRect:: *SwRectSet)( const long nNew ); +typedef long (SwRect:: *SwRectGet)() const; typedef const Point (SwRect:: *SwRectPoint)() const; typedef const Size (SwRect:: *SwRectSize)() const; -typedef bool (SwRect:: *SwRectMax)( sal_Int32 ) const; -typedef sal_Int32 (SwRect:: *SwRectDist)( sal_Int32 ) const; -typedef void (SwRect:: *SwRectSetTwice)( sal_Int32, sal_Int32 ); +typedef bool (SwRect:: *SwRectMax)( long ) const; +typedef long (SwRect:: *SwRectDist)( long ) const; +typedef void (SwRect:: *SwRectSetTwice)( long, long ); 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 sal_Int32 nNewX, const sal_Int32 nNewY ) +inline void SwRect::Pos( const long nNewX, const long 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 sal_Int32 nNewHeight, const sal_Int32 nNewWidth ) +inline void SwRect::SSize( const long nNewHeight, const long nNewWidth ) { m_Size.setWidth(nNewWidth); m_Size.setHeight(nNewHeight); } -inline void SwRect::Width( sal_Int32 nNew ) +inline void SwRect::Width( long nNew ) { m_Size.setWidth(nNew); } -inline void SwRect::Height( sal_Int32 nNew ) +inline void SwRect::Height( long nNew ) { m_Size.setHeight(nNew); } -inline void SwRect::Left( const sal_Int32 nLeft ) +inline void SwRect::Left( const long nLeft ) { m_Size.AdjustWidth( m_Point.getX() - nLeft ); m_Point.setX(nLeft); } -inline void SwRect::Right( const sal_Int32 nRight ) +inline void SwRect::Right( const long nRight ) { m_Size.setWidth(nRight - m_Point.getX() + 1); } -inline void SwRect::Top( const sal_Int32 nTop ) +inline void SwRect::Top( const long nTop ) { m_Size.AdjustHeight( m_Point.getY() - nTop ); m_Point.setY(nTop); } -inline void SwRect::Bottom( const sal_Int32 nBottom ) +inline void SwRect::Bottom( const long nBottom ) { m_Size.setHeight(nBottom - m_Point.getY() + 1); } @@ -225,27 +225,27 @@ inline Size &SwRect::SSize() { return m_Size; } -inline sal_Int32 SwRect::Width() const +inline long SwRect::Width() const { return m_Size.Width(); } -inline sal_Int32 SwRect::Height() const +inline long SwRect::Height() const { return m_Size.Height(); } -inline sal_Int32 SwRect::Left() const +inline long SwRect::Left() const { return m_Point.X(); } -inline sal_Int32 SwRect::Right() const +inline long SwRect::Right() const { return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : m_Point.getX(); } -inline sal_Int32 SwRect::Top() const +inline long SwRect::Top() const { return m_Point.Y(); } -inline sal_Int32 SwRect::Bottom() const +inline long 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( sal_Int32 X, sal_Int32 Y, sal_Int32 W, sal_Int32 H ) : +inline SwRect::SwRect( long X, long Y, long W, long H ) : m_Point( X, Y ), m_Size( W, H ) { diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index f8b1a6175167..d2ce6af47540 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -46,9 +46,9 @@ class CharClass; class CollatorWrapper; class LanguageTag; -typedef sal_Int32 SwTwips; -#define INVALID_TWIPS RECT_MAX -#define TWIPS_MAX (RECT_MAX - 1) +typedef long SwTwips; +#define INVALID_TWIPS LONG_MAX +#define TWIPS_MAX (LONG_MAX - 1) // Converts Millimeters to Twips (1 mm == 56.905479 twips). template diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 1ba766356cad..7f10e4befa90 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(aLogic.getWidth(), aSize.Width); + CPPUNIT_ASSERT_EQUAL(static_cast(aLogic.getWidth()), aSize.Width); // Check mime/media types. CPPUNIT_ASSERT_EQUAL(OUString("image/png"), getProperty(xGraphic, "MimeType")); diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 6f2180da49ea..571c96e5d6a2 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(aExpectedSize.Width(), aActualSize.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width); } if ((aExpectedSize.Height() - aActualSize.Height) / 2 != 0) { - CPPUNIT_ASSERT_EQUAL(aExpectedSize.Height(), aActualSize.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height); } } diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 4211c88429e7..54b42e9f9b59 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1372,8 +1372,8 @@ DECLARE_RTFIMPORT_TEST(testWatermark, "watermark.rtf") uno::Reference xShape(getShape(1), uno::UNO_QUERY); awt::Size aActualSize(xShape->getSize()); - CPPUNIT_ASSERT_EQUAL(aExpectedSize.Width(), aActualSize.Width); - CPPUNIT_ASSERT_EQUAL(aExpectedSize.Height(), aActualSize.Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(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 6d1dbaed5d27..df913f7f9e7f 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -525,8 +525,8 @@ void SwTiledRenderingTest::testSearchViewArea() { {"SearchItem.SearchString", uno::makeAny(OUString("Heading"))}, {"SearchItem.Backward", uno::makeAny(false)}, - {"SearchItem.SearchStartPointX", uno::makeAny(aPoint.getX())}, - {"SearchItem.SearchStartPointY", uno::makeAny(aPoint.getY())} + {"SearchItem.SearchStartPointX", uno::makeAny(static_cast(aPoint.getX()))}, + {"SearchItem.SearchStartPointY", uno::makeAny(static_cast(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 ef7ee44374e0..628ad727dc47 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( RECT_MIN, RECT_MIN ); + Point aPt( LONG_MIN, LONG_MIN ); pFEShell->SelectObj( aPt ); bCallShowCursor = true; } diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index a8d228288f15..8702d8f15733 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, sal_Int32 nTolerance ) const +bool SwRect::IsNear( const Point& rPoint, long 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 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); } +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); } 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() ); } -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(); } +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(); } -bool SwRect::OverStepLeft( sal_Int32 nLimit ) const +bool SwRect::OverStepLeft( long nLimit ) const { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; } -bool SwRect::OverStepBottom( sal_Int32 nLimit ) const +bool SwRect::OverStepBottom( long nLimit ) const { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; } -bool SwRect::OverStepTop( sal_Int32 nLimit ) const +bool SwRect::OverStepTop( long nLimit ) const { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; } -bool SwRect::OverStepRight( sal_Int32 nLimit ) const +bool SwRect::OverStepRight( long nLimit ) const { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; } -void SwRect::SetLeftAndWidth( sal_Int32 nLeft, sal_Int32 nNew ) +void SwRect::SetLeftAndWidth( long nLeft, long nNew ) { m_Point.setX(nLeft); m_Size.setWidth(nNew); } -void SwRect::SetTopAndHeight( sal_Int32 nTop, sal_Int32 nNew ) +void SwRect::SetTopAndHeight( long nTop, long nNew ) { m_Point.setY(nTop); m_Size.setHeight(nNew); } -void SwRect::SetRightAndWidth( sal_Int32 nRight, sal_Int32 nNew ) +void SwRect::SetRightAndWidth( long nRight, long nNew ) { m_Point.setX(nRight - nNew); m_Size.setWidth(nNew); } -void SwRect::SetBottomAndHeight( sal_Int32 nBottom, sal_Int32 nNew ) +void SwRect::SetBottomAndHeight( long nBottom, long 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 e74953eeb5dd..c17a0a87dc22 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 = SAL_MAX_INT32; + aEntry.nMax = LONG_MAX; 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 da0233037251..fdc029cfb177 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; - sal_Int32 nRightOffset = 0, - nLeftOffset = 0; + long nRightOffset = 0, + nLeftOffset = 0; rTabFrame.CalcFlyOffsets( nUpperDummy, nLeftOffset, nRightOffset ); nWidth -= (nLeftOffset + nRightOffset); diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 98a85228130b..4aae97a40690 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()), 1 ); + nLeftCrop = std::max( aOrigSz.Width() - + (rCrop.GetRight() + rCrop.GetLeft()), long(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()), 1 ); + nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(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 9b6c27d3ea83..5544487788a2 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(SAL_MAX_UINT32), nMaxRight(0), + nMinLeft(ULONG_MAX), 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 = SAL_MAX_INT32; + long nFrameWidth = LONG_MAX; 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( SAL_MAX_INT32 != nFrameWidth ) + if( LONG_MAX != nFrameWidth ) { SwFormatFrameSize aAbsSz( aSz ); aAbsSz.SetWidth( nFrameWidth ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 422e2c45c780..4fc498d41cb8 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() ? SAL_MAX_INT32 : 0; + const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0; const long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea()); - const long nRightMax = aRectFnSet.IsVert() ? nRight : SAL_MAX_INT32; + const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX; 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 = SAL_MAX_INT32; + aPair.first = nUpperBorder; aPair.second = LONG_MAX; 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 = SAL_MAX_INT32; + aPair.first = nUpperBorder; aPair.second = LONG_MAX; } else { nLowerBorder = (*aIter).first; long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder ); - aPair.first = nNewLowerBorderUpperBoundary; aPair.second = SAL_MAX_INT32; + aPair.first = nNewLowerBorderUpperBoundary; aPair.second = LONG_MAX; } 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 ( SAL_MAX_INT32 ); + aOld.SetLeft ( LONG_MAX ); 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( SAL_MAX_INT32 ); + aOld.SetRightMax( LONG_MAX ); } aOld.SetLeftMin ( nLeftMin ); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index f7a4ccfd5a94..d5070c99cf6b 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 ) { - sal_Int32 nHeight = 0; + long 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(std::max( MINLAY, nRet )); + return static_cast(std::max( long(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 cd74e92fa23c..eeebd9531207 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -1047,7 +1047,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const } nMin -= MINFLY; } - aSz.setWidth( std::max( aSz.Width(), nMin ) ); + aSz.setWidth( std::max( aSz.Width(), nMin ) ); } SwFrameFormat *pFormat = GetFormat(); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 9f8f24e5cdf9..f6b731ba2be1 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() != RECT_MIN && rRect.Pos() != aPt && !bPosProt ) + if ( rRect.Top() != LONG_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 250fec87a4dd..c96acf814448 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1466,7 +1466,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool const SdrObject *pBest = nullptr, *pTop = nullptr; - const long nTmp = bNext ? RECT_MAX : 0; + const long nTmp = bNext ? LONG_MAX : 0; Point aBestPos( nTmp, nTmp ); Point aTopPos( nTmp, nTmp ); Point aCurPos; @@ -1630,7 +1630,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, GotoObjFlags eType, bool } } // unfortunately nothing found - if( bNext ? (aBestPos.getX() == RECT_MAX) : (aBestPos.getX() == 0) ) + if( bNext ? (aBestPos.getX() == LONG_MAX) : (aBestPos.getX() == 0) ) pBest = pTop; } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index d820a4c7e7f2..4f4f64453f93 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() ? SAL_MAX_INT32 : 0; + const long nLeft = aRectFnSet.IsVert() ? LONG_MAX : 0; const long nRight = aRectFnSet.GetHeight(pTab->getFramePrintArea()); - const long nRightMax = aRectFnSet.IsVert() ? nRight : SAL_MAX_INT32; + const long nRightMax = aRectFnSet.IsVert() ? nRight : LONG_MAX; 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 2561528e94b8..23553e79ae16 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( RECT_MAX, RECT_MAX ); - Point aCurrentTopRight( 0, RECT_MAX ); - Point aCurrentBottomLeft( RECT_MAX, 0 ); + Point aCurrentTopLeft( LONG_MAX, LONG_MAX ); + Point aCurrentTopRight( 0, LONG_MAX ); + Point aCurrentBottomLeft( LONG_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 = SAL_MAX_INT32; + long nYPos = LONG_MAX; 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( 1, pTable->GetFormat()->GetFrameSize().GetWidth() ); + const long nWish = std::max( 1L, 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 d9c88684d9d0..ee21f12bd6f0 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 - 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 ); + 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 ); 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 sal_Int32 (SwFrame:: *SwFrameGet)() const; -typedef bool (SwFrame:: *SwFrameMax)( sal_Int32 ); +typedef long (SwFrame:: *SwFrameGet)() const; +typedef bool (SwFrame:: *SwFrameMax)( long ); typedef void (SwFrame:: *SwFrameMakePos)( const SwFrame*, const SwFrame*, bool ); -typedef sal_Int32 (*SwOperator)( sal_Int32, sal_Int32 ); -typedef void (SwFrame:: *SwFrameSet)( sal_Int32, sal_Int32 ); +typedef long (*SwOperator)( long, long ); +typedef void (SwFrame:: *SwFrameSet)( long, long ); struct SwRectFnCollection { @@ -1316,58 +1316,58 @@ public: || (rRect1.*m_fnRect->fnGetLeft)() != (rRect2.*m_fnRect->fnGetLeft)()); } - 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)(); } + 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)(); } 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, 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 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 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); } - 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); } + 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); } - 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); } + 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); } private: bool m_bVert; diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 98fdfaf85588..c0ecd3463b02 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 (56700 * 10) // 10 Meters +#define BROWSE_HEIGHT (56700L * 10L) // 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 -SwTwips CalcRowRstHeight( SwLayoutFrame *pRow ); +long 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 dfa8452a135c..288055e9e30a 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -201,8 +201,8 @@ public: bool CalcFlyOffsets( SwTwips& rUpper, - sal_Int32& rLeftOffset, - sal_Int32& rRightOffset ) const; + long& rLeftOffset, + long& rRightOffset ) const; SwTwips CalcHeightOfFirstContentLine() const; diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index c9a275d989d5..87142b7f0e6f 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( SAL_MAX_INT32, true ); + nSpace += pNewUpper->Grow( LONG_MAX, true ); if ( nMoveAnyway < 3 ) { @@ -644,15 +644,15 @@ void SwFrame::MakePos() } // #i28701# - new type -static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, sal_Int32& rBot) +static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, long& rBot) { // And then there can be paragraph anchored frames that sit below their paragraph. - sal_Int32 nMax = 0; + long nMax = 0; for (SwAnchoredObject* pObj : rSortedObjs) { // #i28701# - consider changed type of // entries. - sal_Int32 nTmp = 0; + long nTmp = 0; if ( dynamic_cast( pObj) != nullptr ) { SwFlyFrame *pFly = static_cast(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. - sal_Int32 nBot = getFrameArea().Top() + nTop; + long nBot = getFrameArea().Top() + nTop; const SwFrame *pFrame = Lower(); while (pFrame) { - sal_Int32 nTmp = 0; + long nTmp = 0; const SwFrame *pCnt = static_cast(pFrame)->ContainsAny(); while (pCnt && (pCnt->GetUpper() == pFrame || static_cast(pFrame)->IsAnLower(pCnt))) @@ -812,7 +812,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) else { // In pages without columns, the content defines the size. - sal_Int32 nBot = GetContentHeight(nTop, nBottom); + long 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( 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()) - sal_Int32 nMinWidth = 0; + long 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( nMinWidth, bFly ? rFormat.GetFrameSize().GetWidth() : pObj->GetObjRect().Width() ); } } const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); - sal_Int32 nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); + long 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( MINLAY, aRectFnSet.GetWidth(getFrameArea()) ) ); + aRectFnSet.SetWidth( aPrt, std::min( long(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 7ab121525bae..efb776eaaef4 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( SAL_MAX_INT32 ); + SetMaxFootnoteHeight( LONG_MAX ); } 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() : SAL_MAX_INT32; + pCont->FindPageFrame()->GetMaxFootnoteHeight() : LONG_MAX; if ( pNeighbourCol ) { bRet = false; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 8427c9920a66..75a064fa6e55 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(pOwn)->GetLineSpace() ); + nAdd = std::max( nAdd, static_cast(pOwn)->GetLineSpace() ); } nUpper += nAdd; } @@ -1453,7 +1453,7 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nAdd = std::max( nAdd, static_cast(pOwn)->GetLineSpace( true ) ); + nAdd = std::max( nAdd, static_cast(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(pOwn)->GetLineSpace() ); + nUpper = std::max( nUpper, static_cast(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(pOwn)->GetLineSpace( true ) ); + nAdd = std::max( nAdd, static_cast(pOwn)->GetLineSpace( true ) ); } } nUpper += nAdd; diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index fb3a33f105c4..cfdcec89b779 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 == SAL_MAX_INT32 ? 0 : nNewY; + SwTwips nTmpY = nNewY == LONG_MAX ? 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( SAL_MAX_INT32 != nNewY ) + if( LONG_MAX != 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 == SAL_MAX_INT32 ? 0 : nNewX; + SwTwips nTmpX = nNewX == LONG_MAX ? 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( SAL_MAX_INT32 != nNewX ) + if( LONG_MAX != 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 > ( SAL_MAX_INT32 - nSize ) ) - nDist = SAL_MAX_INT32 - nSize; + if( nSize > 0 && nDist > ( LONG_MAX - nSize ) ) + nDist = LONG_MAX - 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 { - sal_Int32 nRelWidth = SAL_MAX_INT32, nRelHeight = SAL_MAX_INT32; + long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX; const SwViewShell *pSh = getRootFrame()->GetCurrShell(); if ( ( pRel->IsBodyFrame() || pRel->IsPageFrame() ) && pSh && pSh->GetViewOptions()->getBrowseMode() && diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 2b11e5cab57d..71cdcc029235 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, { // point is above environment of given content frame // correct for vertical layout? - rRet.nMain = SAL_MAX_INT32; + rRet.nMain = LONG_MAX; } 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 = SAL_MAX_INT32; + rRet.nMain = LONG_MAX; } else { @@ -844,7 +844,7 @@ static const SwFrame * lcl_CalcDownDist( SwDistance &rRet, return pLay; } else - rRet.nMain = SAL_MAX_INT32; + rRet.nMain = LONG_MAX; } } 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( 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() ); // 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 = SAL_MAX_INT32; - if ( nUp.nMain >= 0 && SAL_MAX_INT32 != nUp.nMain ) + nUp.nMain = LONG_MAX; + if ( nUp.nMain >= 0 && LONG_MAX != 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 = SAL_MAX_INT32; + nDown.nMain = LONG_MAX; 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 = SAL_MAX_INT32; + nDown.nMain = LONG_MAX; //It makes sense to search further, if the distance grows inside //a table. if ( pDownLst->IsInTab() && pDownFrame->IsInTab() ) { - while ( pDownFrame && ( ( nDown.nMain != SAL_MAX_INT32 && pDownFrame->IsInTab()) || bBody != pDownFrame->IsInDocBody() ) ) + while ( pDownFrame && ( ( nDown.nMain != LONG_MAX && pDownFrame->IsInTab()) || bBody != pDownFrame->IsInDocBody() ) ) { pDownFrame = pDownFrame->GetNextContentFrame(); if ( pDownFrame ) ::lcl_CalcDownDist( nDown, aNew, pDownFrame ); if ( nDown.nMain < 0 ) - nDown.nMain = SAL_MAX_INT32; + nDown.nMain = LONG_MAX; } } } if ( !pDownFrame ) - nDown.nMain = SAL_MAX_INT32; + nDown.nMain = LONG_MAX; } while ( pDownFrame && nDown <= nDownLst && - nDown.nMain != SAL_MAX_INT32 && nDownLst.nMain != SAL_MAX_INT32 ); + nDown.nMain != LONG_MAX && nDownLst.nMain != LONG_MAX ); //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 == SAL_MAX_INT32 && nUpLst.nMain == SAL_MAX_INT32 ) + if ( nDownLst.nMain == LONG_MAX && nUpLst.nMain == LONG_MAX ) { // 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 == SAL_MAX_INT32 ) + if ( nY == LONG_MAX ) { // #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 = SAL_MAX_INT32; + nY = LONG_MAX; if( text::RelOrientation::CHAR == pFormat->GetHoriOrient().GetRelationOrient() ) - nX = SAL_MAX_INT32; + nX = LONG_MAX; } else { diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index b1c67634618b..2a20c9c70e9d 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 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 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 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( MINLAY, aFrameRect.Width() ) ); + aFrm.Width ( std::max( long(MINLAY), aFrameRect.Width() ) ); } if ( Lower() && Lower()->IsColumnFrame() ) diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index ab4bd72e3b04..0df9ee9c5900 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 = RECT_MAX; + SwTwips nRstHeight = LONG_MAX; while (pLow && pLow->IsLayoutFrame()) { nRstHeight = std::min(nRstHeight, ::lcl_CalcCellRstHeight(static_cast(pLow))); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 5a0a5a942665..e8eddce278c1 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( SAL_MAX_INT32 ); + Grow( LONG_MAX ); 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( 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 SAL_MAX_INT32, take as much space as needed. + // If the max. height is LONG_MAX, 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 > ( SAL_MAX_INT32 - aRectFnSet.GetHeight(getFrameArea()) ) ) - nDist = SAL_MAX_INT32 - aRectFnSet.GetHeight(getFrameArea()); + nDist > ( LONG_MAX - aRectFnSet.GetHeight(getFrameArea()) ) ) + nDist = LONG_MAX - aRectFnSet.GetHeight(getFrameArea()); SwFootnoteBossFrame *pBoss = static_cast(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() != SAL_MAX_INT32 ) + if ( pBoss->GetMaxFootnoteHeight() != LONG_MAX ) { - nDist = std::min( nDist, pBoss->GetMaxFootnoteHeight() + nDist = std::min( 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( SAL_MAX_INT32, true ); + m_nMaxFootnoteHeight += pBody->Grow( LONG_MAX, true ); if ( IsInSct() ) - m_nMaxFootnoteHeight += FindSctFrame()->Grow( SAL_MAX_INT32, true ); + m_nMaxFootnoteHeight += FindSctFrame()->Grow( LONG_MAX, true ); if ( m_nMaxFootnoteHeight < 0 ) m_nMaxFootnoteHeight = 0; - if ( nMax != SAL_MAX_INT32 && m_nMaxFootnoteHeight > nMax ) + if ( nMax != LONG_MAX && m_nMaxFootnoteHeight > nMax ) m_nMaxFootnoteHeight = nMax; } diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index b3443ed68450..c2d2a46718c6 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 = SAL_MAX_INT32; + SwTwips nMaxHeight = LONG_MAX; 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); - SwTwips nUL = pAttrs->CalcTop() + pAttrs->CalcBottom(); + long 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 efe1a065c2e4..1bab86af7333 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; -sal_Int32 FirstMinusSecond( sal_Int32 nFirst, sal_Int32 nSecond ) +long FirstMinusSecond( long nFirst, long nSecond ) { return nFirst - nSecond; } -sal_Int32 SecondMinusFirst( sal_Int32 nFirst, sal_Int32 nSecond ) +long SecondMinusFirst( long nFirst, long nSecond ) { return nSecond - nFirst; } -sal_Int32 SwIncrement( sal_Int32 nA, sal_Int32 nAdd ) +long SwIncrement( long nA, long nAdd ) { return nA + nAdd; } -sal_Int32 SwDecrement( sal_Int32 nA, sal_Int32 nSub ) +long SwDecrement( long nA, long nSub ) { return nA - nSub; } static SwRectFnCollection aHorizontal = { @@ -107,7 +107,7 @@ static SwRectFnCollection aHorizontal = { /*.fnXDiff =*/&FirstMinusSecond, /*.fnYDiff =*/&FirstMinusSecond, /*.fnXInc =*/&SwIncrement, - /*.fnYInc =*/&o3tl::saturating_add, + /*.fnYInc =*/&o3tl::saturating_add, /*.fnSetLeftAndWidth =*/&SwRect::SetLeftAndWidth, /*.fnSetTopAndHeight =*/&SwRect::SetTopAndHeight diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index d787389b1934..238f44cc1afb 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() : SAL_MAX_INT32 ); + pPgDsc->GetFootnoteInfo().GetHeight() : LONG_MAX ); 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(GetUpper())->SetSuperfluous(); SetMaxFootnoteHeight(m_pDesc->GetFootnoteInfo().GetHeight()); if(!GetMaxFootnoteHeight()) - SetMaxFootnoteHeight(SAL_MAX_INT32); + SetMaxFootnoteHeight(LONG_MAX); SetColMaxFootnoteHeight(); // here, the page might be destroyed: static_cast(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(), MINLAY ) ); - aFrm.Width ( std::max( rSz.GetWidth(), MINLAY ) ); + aFrm.Height( std::max( rSz.GetHeight(), long(MINLAY) ) ); + aFrm.Width ( std::max( rSz.GetWidth(), long(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 = SAL_MAX_INT32; + SwTwips nDocPos = LONG_MAX; SwRootFrame *pRoot = static_cast(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 == SAL_MAX_INT32 ) + if ( nDocPos == LONG_MAX ) nDocPos = pPrevPage ? pPrevPage->getFrameArea().Top() : pPage->getFrameArea().Top(); // Cases: @@ -1422,7 +1422,7 @@ void SwRootFrame::RemoveSuperfluous() mbCheckSuperfluous = false; SwPageFrame *pPage = GetLastPage(); - long nDocPos = SAL_MAX_INT32; + long nDocPos = LONG_MAX; // 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 != SAL_MAX_INT32 && + if ( nDocPos != LONG_MAX && (!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( 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 592a8a7a9cb2..35ce1d5148af 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(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(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(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( 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(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(aInter.Top(),aTmp.Pos().Y()); SwTwips nH = std::min( nBottom, nY ) - nPos; SwRect aVert( Point( aGrid.Left(), nPos ), Size( 1, nH ) ); @@ -6434,8 +6434,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 sal_Int32 (Point:: *pmfPtGet)() const; - typedef void (Point:: *pmfPtSet)(sal_Int32); + typedef long (Point:: *pmfPtGet)() const; + typedef void (Point:: *pmfPtSet)(long); 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 d338431054bf..8f68adf082c7 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( SAL_MAX_INT32, true ) > 0 ) ) + ( Grow( LONG_MAX, true ) > 0 ) ) { while( GetFollow() ) { @@ -2103,7 +2103,7 @@ bool SwSectionFrame::Growable() const aRectFnSet.GetBottom(getFrameArea()) ) > 0 ) return true; - return ( GetUpper() && const_cast(static_cast(GetUpper()))->Grow( SAL_MAX_INT32, true ) ); + return ( GetUpper() && const_cast(static_cast(GetUpper()))->Grow( LONG_MAX, 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 > (SAL_MAX_INT32 - nFrameHeight) ) - nDist = SAL_MAX_INT32 - nFrameHeight; + if( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) ) + nDist = LONG_MAX - 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( SAL_MAX_INT32, true )); + nGrow, GetUpper()->Grow( LONG_MAX, true )); if( nGrow > nDist ) nGrow = nDist; diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 5242c953c828..8fceca4e8bd9 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -33,24 +33,24 @@ #include // No inline cause we need the function pointers -sal_Int32 SwFrame::GetTopMargin() const +long SwFrame::GetTopMargin() const { return getFramePrintArea().Top(); } -sal_Int32 SwFrame::GetBottomMargin() const +long SwFrame::GetBottomMargin() const { return getFrameArea().Height() -getFramePrintArea().Height() -getFramePrintArea().Top(); } -sal_Int32 SwFrame::GetLeftMargin() const +long SwFrame::GetLeftMargin() const { return getFramePrintArea().Left(); } -sal_Int32 SwFrame::GetRightMargin() const +long SwFrame::GetRightMargin() const { return getFrameArea().Width() - getFramePrintArea().Width() - getFramePrintArea().Left(); } -sal_Int32 SwFrame::GetPrtLeft() const +long SwFrame::GetPrtLeft() const { return getFrameArea().Left() + getFramePrintArea().Left(); } -sal_Int32 SwFrame::GetPrtBottom() const +long SwFrame::GetPrtBottom() const { return getFrameArea().Top() + getFramePrintArea().Height() + getFramePrintArea().Top(); } -sal_Int32 SwFrame::GetPrtRight() const +long SwFrame::GetPrtRight() const { return getFrameArea().Left() + getFramePrintArea().Width() + getFramePrintArea().Left(); } -sal_Int32 SwFrame::GetPrtTop() const +long SwFrame::GetPrtTop() const { return getFrameArea().Top() + getFramePrintArea().Top(); } -bool SwFrame::SetMinLeft( sal_Int32 nDeadline ) +bool SwFrame::SetMinLeft( long nDeadline ) { SwTwips nDiff = nDeadline - getFrameArea().Left(); if( nDiff > 0 ) @@ -66,7 +66,7 @@ bool SwFrame::SetMinLeft( sal_Int32 nDeadline ) return false; } -bool SwFrame::SetMaxBottom( sal_Int32 nDeadline ) +bool SwFrame::SetMaxBottom( long nDeadline ) { SwTwips nDiff = getFrameArea().Top() + getFrameArea().Height() - nDeadline; if( nDiff > 0 ) @@ -82,7 +82,7 @@ bool SwFrame::SetMaxBottom( sal_Int32 nDeadline ) return false; } -bool SwFrame::SetMaxRight( sal_Int32 nDeadline ) +bool SwFrame::SetMaxRight( long 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( sal_Int32 nTop, sal_Int32 nBot ) +void SwFrame::SetTopBottomMargins( long nTop, long nBot ) { SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); aPrt.Top( nTop ); aPrt.Height( getFrameArea().Height() - nTop - nBot ); } -void SwFrame::SetLeftRightMargins( sal_Int32 nLeft, sal_Int32 nRight) +void SwFrame::SetLeftRightMargins( long nLeft, long nRight) { SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); aPrt.Left( nLeft ); aPrt.Width( getFrameArea().Width() - nLeft - nRight ); } -void SwFrame::SetRightLeftMargins( sal_Int32 nRight, sal_Int32 nLeft) +void SwFrame::SetRightLeftMargins( long nRight, long 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 39e730d73e2d..67ee9cc37a18 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; - sal_Int32 nMinHeight = 0; + long 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, SAL_MAX_INT32 ); + ::SwInvalidateAll( pCurrMasterCell, LONG_MAX ); } } @@ -655,7 +655,7 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, SwRowFrame& rFollowLine, rTab.SetConsiderObjsForMinCellHeight( true ); // invalidate last line - ::SwInvalidateAll( &rLastLine, SAL_MAX_INT32 ); + ::SwInvalidateAll( &rLastLine, LONG_MAX ); // 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, SAL_MAX_INT32 ); + lcl_RecalcRow( &rLastLine, LONG_MAX ); // #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, SAL_MAX_INT32 ); + ::SwInvalidateAll( &rFollowLine, LONG_MAX ); } 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, SAL_MAX_INT32 ); + ::SwInvalidateAll( &rLastLine, LONG_MAX ); } rTab.SetRebuildLastLine( false ); @@ -972,7 +972,7 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK Lower()->InvalidatePos_(); // #i43913# - correction // call method with first lower. - lcl_InnerCalcLayout( Lower(), SAL_MAX_INT32, true ); + lcl_InnerCalcLayout( Lower(), LONG_MAX, 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 ) { - // SAL_MAX_INT32 == nBottom means we have to calculate all - bool bAll = SAL_MAX_INT32 == nBottom; + // LONG_MAX == nBottom means we have to calculate all + bool bAll = LONG_MAX == nBottom; SwRectFnSet aRectFnSet(pFrame); do { pFrame->InvalidatePos_(); @@ -1362,8 +1362,8 @@ void SwInvalidatePositions( SwFrame *pFrame, long nBottom ) void SwInvalidateAll( SwFrame *pFrame, long nBottom ) { - // SAL_MAX_INT32 == nBottom means we have to calculate all - bool bAll = SAL_MAX_INT32 == nBottom; + // LONG_MAX == nBottom means we have to calculate all + bool bAll = LONG_MAX == 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(); - // SAL_MAX_INT32 == nBottom means we have to calculate all - bool bAll = SAL_MAX_INT32 == nBottom; + // LONG_MAX == nBottom means we have to calculate all + bool bAll = LONG_MAX == 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; - // SAL_MAX_INT32 == nBottom means we have to calculate all - bool bAll = SAL_MAX_INT32 == nBottom; + // LONG_MAX == nBottom means we have to calculate all + bool bAll = LONG_MAX == 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(rTab.Lower()); rNotify.SetLowersComplete( true ); } - ::SwInvalidatePositions( pFirstRow, SAL_MAX_INT32 ); - lcl_RecalcRow( static_cast(pFirstRow), SAL_MAX_INT32 ); + ::SwInvalidatePositions( pFirstRow, LONG_MAX ); + lcl_RecalcRow( static_cast(pFirstRow), LONG_MAX ); } } @@ -2124,7 +2124,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) SwFrame *pTmp = GetUpper(); SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*pTmp); if ( bBrowseMode ) - nDeadLine += pTmp->Grow( SAL_MAX_INT32, true ); + nDeadLine += pTmp->Grow( LONG_MAX, 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, SAL_MAX_INT32 ); + ::SwInvalidateAll( pLastLine, LONG_MAX ); SetRebuildLastLine( true ); - lcl_RecalcRow( static_cast(pLastLine), SAL_MAX_INT32 ); + lcl_RecalcRow( static_cast(pLastLine), LONG_MAX ); SetRebuildLastLine( false ); } @@ -2266,7 +2266,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) } else if (m_bONECalcLowers) { - lcl_RecalcRow( static_cast(Lower()), SAL_MAX_INT32 ); + lcl_RecalcRow( static_cast(Lower()), LONG_MAX ); m_bONECalcLowers = false; } } @@ -2289,7 +2289,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) } else if (m_bONECalcLowers) { - lcl_RecalcRow( static_cast(Lower()), SAL_MAX_INT32 ); + lcl_RecalcRow( static_cast(Lower()), LONG_MAX ); 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( SAL_MAX_INT32, true ) ); + GetUpper()->Grow( LONG_MAX, 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(Lower()), SAL_MAX_INT32 ); + lcl_RecalcRow( static_cast(Lower()), LONG_MAX ); 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, - sal_Int32& rLeftOffset, - sal_Int32& rRightOffset ) const + long& rLeftOffset, + long& 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 sal_Int32 nWidth = aRectFnSet.XDiff( + const long 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 sal_Int32 nWidth = aRectFnSet.XDiff( + const long 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() ) { - sal_Int32 nDiff = aRectFnSet.GetWidth(GetUpper()->getFramePrintArea()) - + long 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. - sal_Int32 nTmpRight = -1000000, + long nTmpRight = -1000000, nLeftOffset = 0; if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) ) { setFramePrintAreaValid(false); } - sal_Int32 nRightOffset = std::max( 0, nTmpRight ); + long nRightOffset = std::max( 0L, 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( 0, nWishRight ) ); + std::max( 0L, nWishRight ) ); } } break; @@ -2905,7 +2905,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA nLeftSpacing = nLeftLine + ( ( (nWishLeft+nRightOffset) < 0 ) ? (nWishLeft+nRightOffset) : - std::max( 0, nWishLeft ) ); + std::max( 0L, 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()) - sal_Int32 nWidth = pSh->GetBrowseWidth(); + long 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 > ( SAL_MAX_INT32 - nHeight ) ) - nDist = SAL_MAX_INT32 - nHeight; + if( nHeight > 0 && nDist > ( LONG_MAX - nHeight ) ) + nDist = LONG_MAX - nHeight; if ( bTst && !IsRestrictTableGrowth() ) return nDist; @@ -3069,7 +3069,7 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo ) if ( nReal < nDist ) { - sal_Int32 nTmp = GetUpper()->Grow( nDist - std::max(nReal, 0), bTst, bInfo ); + long nTmp = GetUpper()->Grow( nDist - std::max(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( SAL_MAX_INT32, true ); + nSpace += pNewUpper->Grow( LONG_MAX, true ); } } else if (!m_bLockBackMove) @@ -3749,7 +3749,7 @@ void SwRowFrame::MakeAll(vcl::RenderContext* pRenderContext) long CalcHeightWithFlys( const SwFrame *pFrame ) { SwRectFnSet aRectFnSet(pFrame); - sal_Int32 nHeight = 0; + long nHeight = 0; const SwFrame* pTmp = pFrame->IsSctFrame() ? static_cast(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), - 0); + nMinHeight = std::max(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*this), + 0L); // 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 ? SAL_MAX_INT32 : 0; + SwTwips nHeight = bIsInFollowFlowLine ? LONG_MAX : 0; while ( pCurrSourceCell ) { @@ -5507,7 +5507,7 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrame& rSourceLine ) pCurrSourceCell = static_cast(pCurrSourceCell->GetNext()); } - return ( SAL_MAX_INT32 == nHeight ) ? 0 : nHeight; + return ( LONG_MAX == 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), - 0); + nMinRowHeight = std::max(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*pFirstRow), + 0L); } nTmpHeight += std::max( nHeightOfFirstContentLine, nMinRowHeight ); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index b191afc0c709..f322cc9d9cc6 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( 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() ) ); } bool bTextRet = false; diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index a6e0a538055f..1107da6c4e94 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 > (SAL_MAX_INT32 - nPrtHeight) ) - nDist = SAL_MAX_INT32 - nPrtHeight; + if( nPrtHeight > 0 && nDist > (LONG_MAX - nPrtHeight) ) + nDist = LONG_MAX - nPrtHeight; if ( IsFlyFrame() ) return static_cast(this)->Grow_( nDist, bTst ); @@ -1554,7 +1554,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) { SwViewShell *pViewShell = getRootFrame()->GetCurrShell(); SwLayoutFrame *pUp = GetUpper(); - sal_Int32 nChg; + long 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( 0, aFrm.Height() - nChg )); + aFrm.Height(std::max( 0L, 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 > (SAL_MAX_INT32 - nFrameHeight ) ) - nDist = SAL_MAX_INT32 - nFrameHeight; + nDist > (LONG_MAX - nFrameHeight ) ) + nDist = LONG_MAX - 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 > SAL_MAX_INT32/2 ) + if( GetUpper()->IsSctFrame() && nDist > LONG_MAX/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 > (SAL_MAX_INT32 - nFrameHeight) ) - nDist = SAL_MAX_INT32 - nFrameHeight; + if ( nFrameHeight > 0 && nDist > (LONG_MAX - nFrameHeight) ) + nDist = LONG_MAX - 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 sal_Int32 nTmp = aRectFnSet.GetHeight(getFramePrintArea()); + const long 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(); - sal_Int32 nRel = SAL_MAX_INT32; + long nRel = LONG_MAX; 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 SAL_MAX_INT32 and is then remembered as the minimum + // nMaximum starts with LONG_MAX 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( SAL_MAX_INT32, true ); + nMaximum += GetUpper()->Grow( LONG_MAX, true ); if( nMaximum < nMinimum ) { if( nMaximum < 0 ) @@ -3687,7 +3687,7 @@ void SwLayoutFrame::FormatWidthCols( const SwBorderAttrs &rAttrs, } } else - nMaximum = SAL_MAX_INT32; + nMaximum = LONG_MAX; // #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 = SAL_MAX_INT32; + SwTwips nAllFree = LONG_MAX; // 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 50ba4487b4b8..2d2dd975ed65 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; } - 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(); } + 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(); } 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( nDist, GetLineSpace() ); nDist += nLineHeight; nDiff -= nFirst; diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 84f13c4ce4d0..b6203899aee0 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 ), SAL_MAX_INT32 ); + SwSaveFootnoteHeight aSave( FindFootnoteBossFrame( true ), LONG_MAX ); pMyFollow->CalcFootnoteFlag(); if ( !pMyFollow->GetNext() && !pMyFollow->HasFootnote() ) - nOldBottom = aRectFnSet.IsVert() ? 0 : SAL_MAX_INT32; + nOldBottom = aRectFnSet.IsVert() ? 0 : LONG_MAX; while( true ) { diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 750492f7e83e..cf0783ed1606 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 sal_Int32 nLMWithNum = pNode->GetLeftMarginWithNum( true ); + const int 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( rSpace.GetTextLeft() + nLMWithNum, + std::max( long( rSpace.GetTextLeft() + nLMWithNum ), m_pFrame->getFramePrintArea().Left() ); } } @@ -243,7 +243,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p else { short nFLOfst = 0; - sal_Int32 nFirstLineOfs = 0; + long 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( 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 bc3e03924115..7fc2ae4005df 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" ); - sal_Int32 nFlyAsc, nFlyDesc; + long 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 ); - sal_Int32 nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc; + long 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; } - sal_Int32 nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc; + long 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 - sal_Int32 nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc; + long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc; // i#11859 - use new method // 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( aRect.Left(), nFormatRepaint ) : aRect.Left(); } else diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 7e352a3d7cde..d15a398ffa43 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( nMinBottom, aBound.Left() ) : + std::max( nMinBottom, aRectFnSet.GetBottom(aBound) ); } bOn = true; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 51dd1dc41561..c1e953725fc8 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( 0 , aRectFnSet.GetHeight(pFrame->getFrameArea()) - aRectFnSet.GetTop(aPrt) - nLower ) ); + aRectFnSet.SetHeight( aPrt, std::max( 0L , 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() ) : - ( SAL_MAX_INT32 - 20000 < getFrameArea().Bottom() ) ) ) + ( LONG_MAX - 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() && SAL_MAX_INT32 - 20000 >= getFrameArea().Bottom() ) || + if( ( ( ! aRectFnSet.IsVert() && LONG_MAX - 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 a204caf9bd82..e44642494175 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() ? SAL_MAX_INT32 : 0; + SwTwips nFlyLower = aRectFnSet.IsVert() ? LONG_MAX : 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(pBoss), nHeight ); - nHeight = const_cast(static_cast(pCont))->Grow( SAL_MAX_INT32, true ); + nHeight = const_cast(static_cast(pCont))->Grow( LONG_MAX, true ); } else - nHeight = const_cast(static_cast(pCont))->Grow( SAL_MAX_INT32, true ); + nHeight = const_cast(static_cast(pCont))->Grow( LONG_MAX, true ); nHeight += nTmp; if( nHeight < 0 ) diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index c8906a8f425a..6ffc9324853e 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( SAL_MAX_INT32 ); + nHeight += m_pFrame->GrowTst( LONG_MAX ); // 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 e76d52b834ab..484f52405dd3 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" ), "%" 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() ); + 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() ); 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" ), "%" 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() ); + 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() ); 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" ), "%" 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() ); + 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() ); xmlTextWriterEndElement( writer ); if (const SdrObject* pObject = GetDrawObj()) diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index eb16c5c28a8f..dcbdf4a79d76 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2551,8 +2551,8 @@ uno::Sequence SwXStyle::getPropertyStates(const uno::Seque const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE); sal_uInt8 nMemberId = pEntry->nMemberId & 0x7f; - 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)) + if((LONG_MAX == rSize.GetSize().Width() && (MID_SIZE_WIDTH == nMemberId || MID_SIZE_SIZE == nMemberId)) || + (LONG_MAX == 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 d4702d186b60..f7fdcc0efae4 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( 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( 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( 0, maPreviewDocRect.Bottom() - mnPreviewLayoutHeight ) ); + std::max( 0L, maPreviewDocRect.Bottom() - mnPreviewLayoutHeight ) ); } } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 5fa122a19c04..7c536e86117f 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( 0, aTmp1.Left() - 1 ) ); + aTmp1.SetLeft( std::max( 0L, aTmp1.Left() - 1 ) ); if ( aTmp2.Top() > aRect.Top() ) - aTmp1.SetTop( std::max( 0, aTmp1.Top() - 1 ) ); + aTmp1.SetTop( std::max( 0L, 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 = SAL_MAX_INT32; + long lMult = 1, lMax = LONG_MAX; 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(aRect.Left(),pRect->Left()-aPixSz.Width()) ); + aRect.Right( std::min(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( 0, aRect.Left()-aPixSz.Width() ) ); + aRect.Pos().setX( std::max( 0L, 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 (SAL_MAX_INT32, SAL_MAX_INT32) (html import) + // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) mxDoc->CheckDefaultPageFormat(); InvalidateLayout( true ); } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index a9c589963b7c..4c74acecdd09 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 (SAL_MAX_INT32, SAL_MAX_INT32) (html import) + // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) if ( !bBrowseMode ) { mxDoc->CheckDefaultPageFormat(); diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index b95215fb50ee..3e98da244e51 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 SAL_MAX_INT32 !! Set then to DIN A4 - if( SAL_MAX_INT32 == rSz.GetHeight() || SAL_MAX_INT32 == rSz.GetWidth() ) + // default PageDesc is always aug LONG_MAX !! Set then to DIN A4 + if( LONG_MAX == rSz.GetHeight() || LONG_MAX == 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 e5d538ccfddd..b3125aff5e75 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 > SAL_MAX_INT32 / nMul ) + if( nVal > LONG_MAX / nMul ) { sal_Int64 nBigVal( nVal ); nBigVal *= nMul; @@ -420,7 +420,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal, nBigVal += 5; nBigVal /= 10; - if( nBigVal <= SAL_MAX_INT32 ) + if( nBigVal <= LONG_MAX ) { // a long is sufficient nLongVal = static_cast(nBigVal); diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index f1473961a1e3..efebccefa116 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(aPixelSz.Width()).append("\""); + append("=\"").append(static_cast(aPixelSz.Width())).append("\""); } if( aPixelSz.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). - append("=\"").append(aPixelSz.Height()).append("\""); + append("=\"").append(static_cast(aPixelSz.Height())).append("\""); } } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 545efee3062c..3d349bc1ddb0 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(aPixelSpc.Width()).append("\""); + append("=\"").append(static_cast(aPixelSpc.Width())).append("\""); } if( aPixelSpc.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace). - append("=\"").append(aPixelSpc.Height()).append("\""); + append("=\"").append(static_cast(aPixelSpc.Height())).append("\""); } } @@ -714,7 +714,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, if( nPrcWidth ) sOut.append(static_cast(nPrcWidth)).append('%'); else - sOut.append(aPixelSz.Width()); + sOut.append(static_cast(aPixelSz.Width())); sOut.append("\""); } @@ -726,7 +726,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, if( nPrcHeight ) sOut.append(static_cast(nPrcHeight)).append('%'); else - sOut.append(aPixelSz.Height()); + sOut.append(static_cast(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, aPixelSpc.Width()); + aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_hspace, static_cast(aPixelSpc.Width())); } if (aPixelSpc.Height()) { - aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_vspace, aPixelSpc.Height()); + aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_vspace, static_cast(aPixelSpc.Height())); } } @@ -979,7 +979,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma if (nPrcWidth) sWidth = OString::number(static_cast(nPrcWidth)) + "%"; else - sWidth = OString::number(aPixelSz.Width()); + sWidth = OString::number(static_cast(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(nPrcHeight)) + "%"; else - sHeight = OString::number(aPixelSz.Height()); + sHeight = OString::number(static_cast(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 e6752e0c2dd9..cb49ab3ebd3a 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(aSz.Height()) + "\""; + OString::number(static_cast(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(aSz.Height()) + "\""; + OString::number(static_cast(aSz.Height())) + "\""; } if( aSz.Width() ) { sOptions += " " OOO_STRING_SVTOOLS_HTML_O_cols "=\"" + - OString::number(aSz.Width()) + "\""; + OString::number(static_cast(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(aSz.Width()) + "\""; + OString::number(static_cast(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(aSz.Width()) + "\""; + OString::number(static_cast(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(aPixelSz.Width()) + "\""; + OString::number(static_cast(aPixelSz.Width())) + "\""; } if( aPixelSz.Height() ) { sOut += " " OOO_STRING_SVTOOLS_HTML_O_height "=\"" + - OString::number(aPixelSz.Height()) + "\""; + OString::number(static_cast(aPixelSz.Height())) + "\""; } } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 7fe37f6e70f5..296b68a3b901 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( aMargin.Width() ) ); + uno::makeAny( sal_Int32( aMargin.Width() ) ) ); xSet->setPropertyValue("FrameMarginHeight", - uno::makeAny( aMargin.Height() ) ); + uno::makeAny( sal_Int32( aMargin.Height() ) ) ); } } } diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 1af4cdf178e8..60a913e1ac7a 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(aPixelSz.Width()); + sOut.append(static_cast(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(aPixelSz.Height()).append("\""); + .append("=\"").append(static_cast(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(aPixelSpc.Width()).append("\""); + append("=\"").append(static_cast(aPixelSpc.Width())).append("\""); } if( aPixelSpc.Height() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace). - append("=\"").append(aPixelSpc.Height()).append("\""); + append("=\"").append(static_cast(aPixelSpc.Height())).append("\""); } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 7be5f2ecc89f..63c6c8c53ea5 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(std::min(nTwips, SwTwips(SAL_MAX_UINT16))); + return static_cast(std::min(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 97a4ee144c72..e1a8503d657d 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 = SAL_MAX_INT32, bool consumedByField=false); + virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand = LONG_MAX, 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 feca015b656b..a5bd0bc8f571 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -601,15 +601,29 @@ 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 (0 > rSize.Width()) - cx = 0; +#if SAL_TYPES_SIZEOFLONG > 4 + if (rSize.Width() > MAX_INTEGER_VALUE) + cx = MAX_INTEGER_VALUE; else - cx = rSize.Width(); +#endif + { + if (0 > rSize.Width()) + cx = 0; + else + cx = rSize.Width(); + } - if (0 > rSize.Height()) - cy = 0; +#if SAL_TYPES_SIZEOFLONG > 4 + if (rSize.Height() > MAX_INTEGER_VALUE) + cy = MAX_INTEGER_VALUE; else - cy = rSize.Height(); +#endif + { + if (0 > rSize.Height()) + cy = 0; + else + 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 0508d2b8ec99..ff0257873bc4 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(rMapped.Width()); + aRet.append(static_cast(rMapped.Width())); aRet.append(OOO_STRING_SVTOOLS_RTF_PICH); - aRet.append(rMapped.Height()); + aRet.append(static_cast(rMapped.Height())); aRet.append(OOO_STRING_SVTOOLS_RTF_PICWGOAL); - aRet.append(rOrig.Width()); + aRet.append(static_cast(rOrig.Width())); aRet.append(OOO_STRING_SVTOOLS_RTF_PICHGOAL); - aRet.append(rOrig.Height()); + aRet.append(static_cast(rOrig.Height())); aRet.append(pBLIPType); if (bIsWMF) diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index f37e7e8ce415..f6dcdf3cecf8 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 SAL_MAX_INT32! Solution then is to use A4 - if (SAL_MAX_INT32 == rSz.GetHeight() || SAL_MAX_INT32 == rSz.GetWidth()) + // the size will be always LONG_MAX! Solution then is to use A4 + if (LONG_MAX == rSz.GetHeight() || LONG_MAX == 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 b19bb1402d74..ab63e083da44 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -530,8 +530,10 @@ 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(aMapped.Width()); - aBuf->append(OOO_STRING_SVTOOLS_RTF_PICH).append(aMapped.Height()).append(SAL_NEWLINE_STRING); + 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(msfilter::rtfutil::WriteHex(pGraphicAry, nSize)); aBuf->append('}'); m_aShapeProps.insert(std::pair("pib", aBuf.makeStringAndClear())); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index c27173b1fc0d..bae87a51e518 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(sal_Int32 &rLeft, +bool RTLDrawingsHack(long &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 0e285081d079..4e405f5d5e37 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 = SAL_MAX_INT32; + nOP = LONG_MAX; } const SvxTabStop* pTN; @@ -5046,10 +5046,10 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, else { pTN = nullptr; - nNP = SAL_MAX_INT32; + nNP = LONG_MAX; } - if( nOP == SAL_MAX_INT32 && nNP == SAL_MAX_INT32 ) + if( nOP == LONG_MAX && nNP == LONG_MAX ) 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 0fa4d4b499ef..036841791673 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=SAL_MAX_INT32, bool consumedByField=false) override; + virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnde=true, long nHand=LONG_MAX, 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 a71630fbf03e..64312c378894 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 SAL_MAX_INT32; + return LONG_MAX; 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(p) ); else - return SAL_MAX_INT32; + return LONG_MAX; } } @@ -4634,7 +4634,7 @@ void WW8PLCFx_AtnBook::advance() long WW8PLCFx_AtnBook::getHandle() const { if (!m_pBook[0] || !m_pBook[1]) - return SAL_MAX_INT32; + return LONG_MAX; 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(p)); else - return SAL_MAX_INT32; + return LONG_MAX; } } @@ -4766,7 +4766,7 @@ void WW8PLCFx_FactoidBook::advance() long WW8PLCFx_FactoidBook::getHandle() const { if (!m_pBook[0] || !m_pBook[1]) - return SAL_MAX_INT32; + return LONG_MAX; 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(p)); else - return SAL_MAX_INT32; + return LONG_MAX; } } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index ecd0ccfeb022..c9216ed1cbe6 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 SAL_MAX_INT32 +#ifndef LONG_MAX #include #endif #include diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 29b8486d8f9f..7ca7c63922cc 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(aSize.Width()) ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), Any(static_cast(aSize.Width())) ); pStates++; - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any(aSize.Height()) ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any(static_cast(aSize.Height())) ); } } diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index a951e0b41887..cf4f328c47b3 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( aMargin.Width() ) ); + makeAny( sal_Int32( aMargin.Width() ) ) ); xSet->setPropertyValue("FrameMarginHeight", - makeAny( aMargin.Height() ) ); + makeAny( sal_Int32( aMargin.Height() ) ) ); } SwFrameFormat *const pFrameFormat = diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index c0fb5669a089..1bc236dccaa6 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 = m_pEdDbText->GetSelection().Min(); - const sal_Int32 nSel = m_pEdDbText->GetSelection().Max() - nPos; + sal_Int32 nPos = static_cast(m_pEdDbText->GetSelection().Min()); + const sal_Int32 nSel = static_cast(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 32bb037eae04..3f8daf71e599 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 (SAL_MAX_INT32); + aField->SetMax (LONG_MAX); 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 06f5c4e4fa15..fe827cf1f560 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(SAL_MIN_INT32); - m_pDateOffsetED->SetMax(SAL_MAX_INT32); + m_pDateOffsetED->SetMin(LONG_MIN); + m_pDateOffsetED->SetMax(LONG_MAX); //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 2fcbde2a34b2..2742b3512337 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 != SAL_MAX_INT32 && m_bHtmlMode) + if (nX != LONG_MAX && m_bHtmlMode) m_pAtHorzPosED->SetModifyFlag(); } else { - if (nX != SAL_MAX_INT32) + if (nX != LONG_MAX) 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 != SAL_MAX_INT32 && m_bHtmlMode) + if(nY != LONG_MAX && m_bHtmlMode) m_pAtVertPosED->SetModifyFlag(); } else { if ( eId == RndStdIds::FLY_AS_CHAR ) { - if ( nY == SAL_MAX_INT32 ) + if ( nY == LONG_MAX ) nY = 0; else nY *= -1; } - if ( nY != SAL_MAX_INT32 ) + if ( nY != LONG_MAX ) 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, SAL_MAX_INT32, SAL_MAX_INT32); + InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX); } 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, 1), nMaxHeight); + SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight); m_aWidthED.SetMax(m_aWidthED.NormalizePercent(nTmp), FUNIT_TWIP); - nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1), nMaxWidth); + nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), 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, SAL_MAX_INT32, SAL_MAX_INT32); + InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX); 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, SAL_MAX_INT32, SAL_MAX_INT32); + InitPos(eAnchorId, -1, 0, -1, 0, LONG_MAX, LONG_MAX); 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 c18a49ec2a82..eb863bdfb4c1 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(aSize.Width(), nWidth) ); return aSize; } diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index f9d6f9a3f88a..0b7daa49b5d7 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(SAL_MIN_INT32, SAL_MIN_INT32); + Point aPt(LONG_MIN, LONG_MIN); // 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(SAL_MIN_INT32, SAL_MIN_INT32); + Point aPt(LONG_MIN, LONG_MIN); // 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 10ebf51b4991..a629f2cc5742 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( nPgLeft, aVisArea.Left() ); + long nLineRight = std::min( 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 c4a7013b504c..73ae25a0277d 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( 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() ); switch ( nDir ) { diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 1813fe7e2115..1debb81ca787 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( SAL_MAX_INT32 != nLeft && SAL_MAX_INT32 != nRight, "Which border to set?" ); + OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" ); SvxLRSpaceItem aTmp( m_aSet.Get( RES_LR_SPACE ) ); - if( SAL_MAX_INT32 != nLeft ) + if( LONG_MAX != nLeft ) aTmp.SetLeft( sal_uInt16(nLeft) ); - if( SAL_MAX_INT32 != nRight ) + if( LONG_MAX != nRight ) aTmp.SetRight( sal_uInt16(nRight) ); m_aSet.Put( aTmp ); } void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom ) { - OSL_ENSURE(SAL_MAX_INT32 != nTop && SAL_MAX_INT32 != nBottom, "Which border to set?" ); + OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" ); SvxULSpaceItem aTmp( m_aSet.Get( RES_UL_SPACE ) ); - if( SAL_MAX_INT32 != nTop ) + if( LONG_MAX != nTop ) aTmp.SetUpper( sal_uInt16(nTop) ); - if( SAL_MAX_INT32 != nBottom ) + if( LONG_MAX != 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(), MINFLY), std::max(rSize.Height(), MINFLY))); + aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY)))); m_aSet.Put( aSize ); } diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index d7df870ce44a..6d1c67493655 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 = SAL_MAX_INT32; + sal_uLong nPos = LONG_MAX; typedef std::vector ListBoxEntries_t; ListBoxEntries_t aRedlines; @@ -793,7 +793,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) { if( !m_pTable->GetParent( pEntry ) ) { - if( bSelect && SAL_MAX_INT32 == nPos ) + if( bSelect && LONG_MAX == nPos ) nPos = m_pTable->GetModel()->GetAbsPos( pEntry ); RedlinData *pData = static_cast(pEntry->GetUserData()); @@ -854,7 +854,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) m_bInhibitActivate = false; Activate(); - if( SAL_MAX_UINT32 != nPos && m_pTable->GetEntryCount() ) + if( ULONG_MAX != 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 f3d69e8b99a7..bb5fd3b9a5e9 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(SAL_MAX_INT32, SAL_MAX_INT32)); // deselect all + m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // 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(SAL_MAX_INT32, SAL_MAX_INT32)); + m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); else if (!bReturn) { if (!rMEvt.IsShift()) diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index ce4fa5dd2767..c2747c86243e 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( aMargin.Width() ) ); + uno::makeAny( sal_Int32( aMargin.Width() ) ) ); xSet->setPropertyValue("FrameMarginHeight", - uno::makeAny( aMargin.Height() ) ); + uno::makeAny( sal_Int32( aMargin.Height() ) ) ); } } catch (const uno::Exception&) diff --git a/sw/source/uibase/table/tablemgr.cxx b/sw/source/uibase/table/tablemgr.cxx index 7e3c94d3769e..52b49a483e7d 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( 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 bc9905f82a4f..4d896b52792b 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( SAL_MIN_INT32, SAL_MIN_INT32 ), aVisSize ); + SwRect aRect( Point( LONG_MIN, LONG_MIN ), 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 99df87c3e8ba..eb010a49f94d 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 = SAL_MIN_INT32; - sal_Int64 nBottom = SAL_MIN_INT32; + sal_Int64 nRight = LONG_MIN; + sal_Int64 nBottom = LONG_MIN; 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 713e369d7148..83b2da910dd4 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(SAL_MIN_INT32, SAL_MIN_INT32); + Point aPt(LONG_MIN, LONG_MIN); //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 c3f672e34561..dba6610de692 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( 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( 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( 0, pPt->X() ) ); + 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() ) ); } } @@ -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( std::max( 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( std::max( 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( (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(0, aPos.Y()) ); + aPos.setY( std::max(0L, aPos.Y()) ); SetVisArea( aPos ); return 1; } diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index 9b4368737caf..bad0b82dfefb 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(SAL_MIN_INT32, SAL_MIN_INT32); + Point aPt(LONG_MIN, LONG_MIN); SelectObj(aPt); SwTransferable::ClearSelection( *this ); } diff --git a/tools/qa/cppunit/test_rectangle.cxx b/tools/qa/cppunit/test_rectangle.cxx index 4729d3140df4..c4b321d388eb 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(sal_Int32(1), aRect.GetWidth()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetHeight()); + CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth()); + CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.getWidth()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aRect.getHeight()); + CPPUNIT_ASSERT_EQUAL(long(0), aRect.getWidth()); + CPPUNIT_ASSERT_EQUAL(long(0), aRect.getHeight()); } { tools::Rectangle aRect(Point(), Size(1,1)); - 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(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(1), aRect.GetWidth()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetHeight()); + CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth()); + CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight()); aRect.setX(12); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetHeight()); + CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetHeight()); aRect.setY(12); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aRect.GetWidth()); + CPPUNIT_ASSERT_EQUAL(long(1), aRect.GetWidth()); } } diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index a7c649cecd7d..ea855f98e9f0 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(sal_Int32 x) +void tools::Rectangle::SaturatingSetX(long x) { nRight = o3tl::saturating_add(nRight, x - nLeft); nLeft = x; } -void tools::Rectangle::SaturatingSetY(sal_Int32 y) +void tools::Rectangle::SaturatingSetY(long 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 7530baf4fdc9..1b470c6065ec 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 { - sal_Int32 nX = rPoint.X(); - sal_Int32 nY = rPoint.Y(); + long nX = rPoint.X(); + long nY = rPoint.Y(); RotateAround(nX, nY, nOrientation); rPoint.setX(nX); rPoint.setY(nY); } -void Point::RotateAround( sal_Int32& rX, sal_Int32& rY, +void Point::RotateAround( long& rX, long& rY, short nOrientation ) const { - const sal_Int32 nOriginX = X(); - const sal_Int32 nOriginY = Y(); + const long nOriginX = X(); + const long nOriginY = Y(); if ( (nOrientation >= 0) && !(nOrientation % 900) ) { @@ -50,7 +50,7 @@ void Point::RotateAround( sal_Int32& rX, sal_Int32& rY, if ( nOrientation == 900 ) { - sal_Int32 nTemp = rX; + long nTemp = rX; rX = rY; rY = -nTemp; } @@ -61,7 +61,7 @@ void Point::RotateAround( sal_Int32& rX, sal_Int32& rY, } else /* ( nOrientation == 2700 ) */ { - sal_Int32 nTemp = rX; + long nTemp = rX; rX = -rY; rY = nTemp; } @@ -77,12 +77,12 @@ void Point::RotateAround( sal_Int32& rX, sal_Int32& rY, double nSin = sin( nRealOrientation ); // Translation... - sal_Int32 nX = rX-nOriginX; - sal_Int32 nY = rY-nOriginY; + long nX = rX-nOriginX; + long nY = rY-nOriginY; // Rotation... - rX = + static_cast(nCos*nX + nSin*nY) + nOriginX; - rY = - static_cast(nSin*nX - nCos*nY) + nOriginY; + rX = + static_cast(nCos*nX + nSin*nY) + nOriginX; + rY = - static_cast(nSin*nX - nCos*nY) + nOriginY; } } diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 30c80ef16905..724220ad60a9 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( sal_Int32& rWidth, sal_Int32& rHeight ) +void SvpSalFrame::GetClientSize( long& rWidth, long& rHeight ) { rWidth = maGeometry.nWidth; rHeight = maGeometry.nHeight; diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx index 6c5dc905a3e9..16de568794f8 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( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& 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 30571d2cf077..c2b53e270648 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( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& 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 cc668f0d2f66..8f9c04017a66 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, - sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight, + long& o_rOutWidth, long& 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 4da52068ca58..c04f0a8f767e 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( sal_Int32& rWidth, sal_Int32& rHeight ) = 0; + virtual void GetClientSize( long& rWidth, long& 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 70f2b1a4bf9c..71ef1eae1c08 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( sal_Int32& nX, const OutputDevice *pOutDev ) const; + void mirror( long& nX, const OutputDevice *pOutDev ) const; // only called mirror2 to avoid ambiguity SAL_WARN_UNUSED_RESULT - 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; + long mirror2( long nX, const OutputDevice *pOutDev ) const; + void mirror( long& nX, long 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( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ); - void DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev ); + void DrawPixel( long nX, long nY, const OutputDevice *pOutDev ); + void DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev ); - void DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev ); + void DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev ); - void DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ); + void DrawRect( long nX, long nY, long nWidth, long 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( - sal_Int32 nDestX, sal_Int32 nDestY, - sal_Int32 nSrcX, sal_Int32 nSrcY, - sal_Int32 nSrcWidth, sal_Int32 nSrcHeight, + long nDestX, long nDestY, + long nSrcX, long nSrcY, + long nSrcWidth, long nSrcHeight, const OutputDevice *pOutDev ); // CopyBits and DrawBitmap --> RasterOp and ClipRegion @@ -308,18 +308,18 @@ public: const OutputDevice *pOutDev ); SalBitmap* GetBitmap( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, const OutputDevice *pOutDev ); Color GetPixel( - sal_Int32 nX, sal_Int32 nY, + long nX, long nY, const OutputDevice *pOutDev ); // invert --> ClipRegion (only Windows) void Invert( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev ); @@ -330,8 +330,8 @@ public: const OutputDevice *pOutDev ); bool DrawEPS( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ); @@ -417,8 +417,8 @@ public: const OutputDevice* pOutDev ); bool DrawAlphaRect( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, sal_uInt8 nTransparency, const OutputDevice *pOutDev ); diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx index 5a70751c9112..d9da1a6d80ed 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, - sal_Int32& rOutWidth, sal_Int32& rOutHeight, + long& rOutWidth, long& 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 c00b589471dc..9d80de32f99b 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, - sal_Int32& rOutWidth, sal_Int32& rOutHeight, + long& rOutWidth, long& 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 dc6f512c4526..3db18f03fbcf 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( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& 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 0dd228c0b13f..3f45cd5d853c 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, - sal_Int32 nDrawableDepth, - sal_Int32 nX, - sal_Int32 nY, - sal_Int32 nWidth, - sal_Int32 nHeight, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, bool bGrey ); diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index 5deb7f009325..92bfcbfb9d31 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( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& 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 0730a1991c81..df4996a6ca09 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 ) { - sal_Int32 nX1( nX ); - sal_Int32 nY1( nY ); - sal_Int32 nX2( nX + nWidth ); - sal_Int32 nY2( nY + nHeight ); + long nX1( nX ); + long nY1( nY ); + long nX2( nX + nWidth ); + long 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 ) { - sal_Int32 nX1( rRect.Left() ); - sal_Int32 nY1( rRect.Top() ); - sal_Int32 nX2( rRect.Right() ); - sal_Int32 nY2( rRect.Bottom() ); + long nX1( rRect.Left() ); + long nY1( rRect.Top() ); + long nX2( rRect.Right() ); + long 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 d8bf6be5ba7f..7b5b203668d8 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( sal_Int32& rWidth, sal_Int32& rHeight ) +void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight ) { if( mbShown || mbInitShow ) { diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index b16984387464..b87585de91db 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*, - sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight, + long& o_rOutWidth, long& o_rOutHeight, Point& rPageOffset, Size& rPaperSize ) { diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index c92d1753c6ff..f835c7b78bc3 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(0), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(0), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(0), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(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(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(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(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(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(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(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(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(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(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(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(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast(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(24), @@ -407,8 +407,8 @@ void BitmapTest::testScale() BitmapSymmetryCheck aBitmapSymmetryCheck; - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast(10), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast(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(sal_Int32(20), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast(20), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast(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 9399dd43f339..a423a17081e8 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 %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 "\n", aAfter.Width(), aAfter.Height() ); + fprintf( stderr, "size %ld, %ld\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(sal_Int32(100), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(100L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(100L, aSize.Height()); } void VclFiltersTest::testExportImport() diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index 7727a13c18ad..4cae79645bd6 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(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, 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(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, 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(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); int maxDelta = 1; CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), maxDelta)); diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 151e8adca44f..c8f8609ea14e 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -318,7 +318,7 @@ void Qt5Frame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt1 m_bDefaultPos = false; } -void Qt5Frame::GetClientSize(sal_Int32& rWidth, sal_Int32& rHeight) +void Qt5Frame::GetClientSize(long& rWidth, long& rHeight) { rWidth = m_pQWidget->width(); rHeight = m_pQWidget->height(); diff --git a/vcl/qt5/Qt5Frame.hxx b/vcl/qt5/Qt5Frame.hxx index 474990352eee..b5f31387b3e2 100644 --- a/vcl/qt5/Qt5Frame.hxx +++ b/vcl/qt5/Qt5Frame.hxx @@ -96,7 +96,7 @@ public: 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(sal_Int32& rWidth, sal_Int32& rHeight) override; + virtual void GetClientSize(long& rWidth, long& 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/source/control/button.cxx b/vcl/source/control/button.cxx index 7c3238979e7d..35400b70ed8a 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(), sal_Int32( textSize.Height() * 1.15 ) ) ); + aSize.setHeight( std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ) ); } // cf. ImplDrawPushButton ... diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index abb0a5e0c677..7b14c8da64c2 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, aSel.Max() ); + OUString aStartText = aFullText.copy( 0, static_cast(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(aSz.Width(), nMaxWidth) ); } if (IsDropDownBox()) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index e6c8e07bb824..42dd22296585 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( aSelection.Min(), aSelection.Len() ); + maText.remove( static_cast(aSelection.Min()), static_cast(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( aSelection.Min(), aSelection.Len() ); + maText.remove( static_cast(aSelection.Min()), static_cast(aSelection.Len()) ); else if ( !mbInsertMode && (aSelection.Max() < maText.getLength()) ) - maText.remove( aSelection.Max(), 1 ); + maText.remove( static_cast(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 = aSelection.Min(); + sal_Int32 nTmpPos = static_cast< sal_Int32 >( 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( aSelection.Min(), aNewText ); + maText.insert( static_cast(aSelection.Min()), aNewText ); if ( !pNewSel ) { @@ -2036,7 +2036,7 @@ void Edit::Command( const CommandEvent& rCEvt ) { DeleteSelected(); delete mpIMEInfos; - sal_Int32 nPos = maSelection.Max(); + sal_Int32 nPos = static_cast(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 13fe3a348a96..a59557dcbb9b 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 ( aSelection.Max() == aText.getLength() ) + if ( static_cast(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 c57449aec148..dff8cee200b5 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -466,7 +466,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 = aOldSel.Max(); + sal_Int32 nCursorPos = static_cast(aOldSel.Max()); sal_Int32 nNewPos; sal_Int32 nTempPos; @@ -523,7 +523,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // all was selected by the focus Selection aSel( aOldSel ); aSel.Justify(); - nCursorPos = aSel.Min(); + nCursorPos = static_cast(aSel.Min()); ImplPatternMaxPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos ); aSel.Max() = nNewPos; if ( bShift ) @@ -540,16 +540,16 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, Selection aSel = aOldSel; aSel.Justify(); - nNewPos = aSel.Min(); + nNewPos = static_cast(aSel.Min()); // if selection then delete it if ( aSel.Len() ) { if ( bSameMask ) - aStr.remove( aSel.Min(), aSel.Len() ); + aStr.remove( static_cast(aSel.Min()), static_cast(aSel.Len()) ); else { - OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() ); + OUString aRep = rLiteralMask.copy( static_cast(aSel.Min()), static_cast(aSel.Len()) ); aStr.remove( aSel.Min(), aRep.getLength() ); aStr.insert( aSel.Min(), aRep ); } @@ -1323,7 +1323,7 @@ void DateField::ImplDateSpinArea( bool bUp ) Selection aSelection = GetField()->GetSelection(); aSelection.Justify(); OUString aText( GetText() ); - if ( aSelection.Len() == aText.getLength() ) + if ( static_cast(aSelection.Len()) == aText.getLength() ) ImplDateIncrementDay( aDate, bUp ); else { @@ -1343,7 +1343,7 @@ void DateField::ImplDateSpinArea( bool bUp ) for ( sal_Int8 i = 1; i <= 3; i++ ) { nPos = aText.indexOf( aDateSep, nPos ); - if (nPos < 0 || nPos >= aSelection.Max()) + if (nPos < 0 || nPos >= static_cast(aSelection.Max())) { nDateArea = i; break; @@ -1584,7 +1584,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast(aSelection.Max()) == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; @@ -2363,7 +2363,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast(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 f82d1dc992f5..f998285abc1a 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, RECT_MAX)), + return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)), rTxt, nStyle).GetSize(); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 6f510684b866..171b75afd151 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( 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( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, aMetrics.nEntryHeight ); } @@ -1802,7 +1802,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled())) { - sal_Int32 nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); + long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE ); } diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 17d1c9c8cefc..ef945a087659 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(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 370891802b9f..54931df82557 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(nWidth, aSize.Width()); if (!bCanHandleSmallerHeight) - nHeight = std::max(nHeight, aSize.Height()); + nHeight = std::max(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 a1bcc29273c6..a4f06757c2ea 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(this); - tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_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(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(this); - tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_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(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 50d201d32e02..34919a3149bf 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( 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( 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( 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 9c153d986790..915a3b2de479 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( rRect.GetWidth(), rBuffer, false ); + appendMappedLength( static_cast(rRect.GetWidth()), rBuffer, false ); rBuffer.append( ' ' ); - appendMappedLength( rRect.GetHeight(), rBuffer ); + appendMappedLength( static_cast(rRect.GetHeight()), rBuffer ); rBuffer.append( " re" ); } @@ -2768,10 +2768,10 @@ bool PDFWriterImpl::emitTilings() emitComment( "PDFWriterImpl::emitTilings" ); } - 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(); + sal_Int32 nX = static_cast(tiling.m_aRectangle.Left()); + sal_Int32 nY = static_cast(tiling.m_aRectangle.Top()); + sal_Int32 nW = static_cast(tiling.m_aRectangle.GetWidth()); + sal_Int32 nH = static_cast(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( rInfo.m_aFontBBox.TopLeft().X() ); + aLine.append( static_cast(rInfo.m_aFontBBox.TopLeft().X()) ); aLine.append( ' ' ); - aLine.append( rInfo.m_aFontBBox.TopLeft().Y() ); + aLine.append( static_cast(rInfo.m_aFontBBox.TopLeft().Y()) ); aLine.append( ' ' ); - aLine.append( rInfo.m_aFontBBox.BottomRight().X() ); + aLine.append( static_cast(rInfo.m_aFontBBox.BottomRight().X()) ); aLine.append( ' ' ); aLine.append( static_cast(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( aCheckRect.GetHeight(), aDA ); + m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( 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( aCheckRect.GetHeight(), aDA ); + m_aPages[m_nCurrentPage].appendMappedLength( sal_Int32( 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( aSize.Width() ); + aLine.append( static_cast(aSize.Width()) ); aLine.append( ' ' ); - aLine.append( aSize.Height() ); + aLine.append( static_cast(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( aPoly[0].X() ); + aLine.append( static_cast(aPoly[0].X()) ); aLine.append( " " ); - aLine.append( aPoly[0].Y() ); + aLine.append( static_cast(aPoly[0].Y()) ); aLine.append( " " ); - aLine.append( aPoly[1].X() ); + aLine.append( static_cast(aPoly[1].X())); aLine.append( " "); - aLine.append( aPoly[1].Y() ); + aLine.append( static_cast(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( aSize.Width() ); + aLine.append( static_cast(aSize.Width()) ); aLine.append( " 0 0 " ); - aLine.append( aSize.Height() ); + aLine.append( static_cast(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" "<(rObject.m_aID.m_aPixelSize.Width()) ); aLine.append( " /Height " ); - aLine.append( rObject.m_aID.m_aPixelSize.Height() ); + aLine.append( static_cast(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" "<(aBitmap.GetSizePixel().Width()) ); aLine.append( "/Height " ); - aLine.append( aBitmap.GetSizePixel().Height() ); + aLine.append( static_cast(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<(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( rTargetArea.GetWidth(), aLine, false, &nCheckWidth ); + m_aPages.back().appendMappedLength( static_cast(rTargetArea.GetWidth()), aLine, false, &nCheckWidth ); aLine.append( " 0 0 " ); sal_Int32 nCheckHeight = 0; - m_aPages.back().appendMappedLength( rTargetArea.GetHeight(), aLine, true, &nCheckHeight ); + m_aPages.back().appendMappedLength( static_cast(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( rDestSize.Width(), aLine, false, &nCheckWidth ); + m_aPages.back().appendMappedLength( static_cast(rDestSize.Width()), aLine, false, &nCheckWidth ); aLine.append( " 0 0 " ); sal_Int32 nCheckHeight = 0; - m_aPages.back().appendMappedLength( rDestSize.Height(), aLine, true, &nCheckHeight ); + m_aPages.back().appendMappedLength( static_cast(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( rRect.GetWidth(), aLine, false ); + m_aPages.back().appendMappedLength( static_cast(rRect.GetWidth()), aLine, false ); aLine.append( ' ' ); - m_aPages.back().appendMappedLength( rRect.GetHeight(), aLine ); + m_aPages.back().appendMappedLength( static_cast(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( rRect.GetWidth(), aLine, false ); + m_aPages.back().appendMappedLength( static_cast(rRect.GetWidth()), aLine, false ); aLine.append( ' ' ); - m_aPages.back().appendMappedLength( rRect.GetHeight(), aLine ); + m_aPages.back().appendMappedLength( static_cast(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 2887158ea67b..49cc105d5d54 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -106,13 +106,13 @@ bool SalGraphics::drawTransformedBitmap( return false; } -sal_Int32 SalGraphics::mirror2( sal_Int32 x, const OutputDevice *pOutDev ) const +long SalGraphics::mirror2( long x, const OutputDevice *pOutDev ) const { mirror(x, pOutDev); return x; } -void SalGraphics::mirror( sal_Int32& x, const OutputDevice *pOutDev ) const +void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const { long w; if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) @@ -142,7 +142,7 @@ void SalGraphics::mirror( sal_Int32& x, const OutputDevice *pOutDev ) const } } -void SalGraphics::mirror( sal_Int32& x, sal_Int32 nWidth, const OutputDevice *pOutDev, bool bBack ) const +void SalGraphics::mirror( long& x, long 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 { - sal_Int32 nWidth = rRect.GetWidth(); - sal_Int32 x = rRect.Left(); - sal_Int32 x_org = x; + long nWidth = rRect.GetWidth(); + long x = rRect.Left(); + long 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( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ) +void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); drawPixel( nX, nY ); } -void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev ) +void SalGraphics::DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); drawPixel( nX, nY, nColor ); } -void SalGraphics::DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev ) +void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { @@ -390,7 +390,7 @@ void SalGraphics::DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int drawLine( nX1, nY1, nX2, nY2 ); } -void SalGraphics::DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ) +void SalGraphics::DrawRect( long nX, long nY, long nWidth, long 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( sal_Int32 nDestX, sal_Int32 nDestY, - sal_Int32 nSrcX, sal_Int32 nSrcY, - sal_Int32 nSrcWidth, sal_Int32 nSrcHeight, +void SalGraphics::CopyArea( long nDestX, long nDestY, + long nSrcX, long nSrcY, + long nSrcWidth, long 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( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ) +SalBitmap* SalGraphics::GetBitmap( long nX, long nY, long nWidth, long 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( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ) +Color SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); return getPixel( nX, nY ); } -void SalGraphics::Invert( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, SalInvert nFlags, const OutputDevice *pOutDev ) +void SalGraphics::Invert( long nX, long nY, long nWidth, long 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( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ) +bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long 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( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, +bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long 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 1d54de94ee71..d302d6952877 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( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), - ::std::max( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) ); + const Size aOutTileSize( ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), + ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) ); //#i69780 clip final tile size to a sane max size while ((static_cast(rSize.Width()) * nTileCacheSize1D) > SAL_MAX_UINT16) diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx index 78b0a5382a59..c9f0e7c460ce 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(), 1 ); - const long nDistY = std::max( rDist.Height(), 1 ); + const long nDistX = std::max( rDist.Width(), 1L ); + const long nDistY = std::max( rDist.Height(), 1L ); 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 7c8a81bd8de2..a3547b1bb491 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(); - sal_Int32 nX = aPoint.X(); - sal_Int32 nY = aPoint.Y(); + long nX = aPoint.X(); + long 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) ) { - sal_Int32 nX2 = nX+nWidth; - sal_Int32 nY2 = nY+nHeight; + long nX2 = nX+nWidth; + long 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 009651c7b4a3..bff62fe6e660 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, - sal_Int32 nCurX, sal_Int32 nCurY, + long nCurX, long nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev, @@ -94,8 +94,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, if ( !nHeight ) return; - sal_Int32 nStartX = nBaseX + nDistX; - sal_Int32 nStartY = nBaseY + nDistY; + long nStartX = nBaseX + nDistX; + long 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; - sal_Int32 nEndX = nStartX+nWidth; - sal_Int32 nEndY = nStartY; + long nEndX = nStartX+nWidth; + long 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, - sal_Int32 nDistX, sal_Int32 nDistY, long nWidth, + long nDistX, long 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(); - sal_Int32 nEndX = aEndPt.X(); - sal_Int32 nEndY = aEndPt.Y(); + long nEndX = aEndPt.X(); + long nEndY = aEndPt.Y(); short nOrientation = 0; // when rotated diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 08e5d6924e8f..ef3437eba967 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 &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(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(rHeights[y].m_nValue, aChildSize.Height()); } } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 7ae0f8e41d68..6c6c4715047e 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( std::max( 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( std::max( 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( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); nTextPos = static_cast(nImgOrChkPos + nImgOrChkWidth); nTextPos = nTextPos + gfxExtra; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 2785f5889d35..1c92a392e1c2 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( sal_Int32 &rWidth, sal_Int32& rHeight, bool bNativeButtons ) +static void ImplAddButtonBorder( long &rWidth, long& rHeight, bool bNativeButtons ) { rWidth += SMALLBUTTON_HSIZE; rHeight += SMALLBUTTON_VSIZE; @@ -1411,8 +1411,8 @@ bool ToolBox::ImplCalcItem() long nDefWidth; long nDefHeight; - sal_Int32 nMaxWidth = 0; - sal_Int32 nMaxHeight = 0; + long nMaxWidth = 0; + long nMaxHeight = 0; long nMinWidth = 6; long nMinHeight = 6; long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; @@ -1617,16 +1617,16 @@ bool ToolBox::ImplCalcItem() if ( item.meType == ToolBoxItemType::BUTTON || item.meType == ToolBoxItemType::SPACE ) { // add borders - sal_Int32 w = item.maItemSize.Width(); - sal_Int32 h = item.maItemSize.Height(); + long w = item.maItemSize.Width(); + long 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(nMinWidth, item.maMinimalItemSize.Width()); + long nMinH = std::max(nMinHeight, item.maMinimalItemSize.Height()); long nGrowContentWidth = 0; long nGrowContentHeight = 0; @@ -1671,8 +1671,8 @@ bool ToolBox::ImplCalcItem() // as this is used for alignment of multiple toolbars // it is only required for docked toolbars - sal_Int32 nFixedWidth = nDefWidth+nDropDownArrowWidth; - sal_Int32 nFixedHeight = nDefHeight; + long nFixedWidth = nDefWidth+nDropDownArrowWidth; + long nFixedHeight = nDefHeight; ImplAddButtonBorder( nFixedWidth, nFixedHeight, mpData->mbNativeButtons ); if( mbHorz ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 11d48b3ada08..f5548205b846 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 ) { - sal_Int32 nOutWidth; - sal_Int32 nOutHeight; + long nOutWidth; + long 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 c1ba01a0ca24..b838f08f848b 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: { - sal_Int32 nNewWidth; - sal_Int32 nNewHeight; + long nNewWidth; + long 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 9406b94a8c45..c80846e621ca 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 ) { - sal_Int32 w, h; + long 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 92b0b4eb2fe9..e5db7853548f 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, - sal_Int32 nDrawableDepth, - sal_Int32 nX, - sal_Int32 nY, - sal_Int32 nWidth, - sal_Int32 nHeight, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long 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 67bed525c5ea..85984e835736 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, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPath[0].X(), pPath[0].Y()); + snprintf(pString, nBezString, "%li %li 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, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y()); + snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y()); i++; } else //Otherwise we're drawing a spline @@ -504,8 +504,7 @@ 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, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 - " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", + snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n", pPath[i].X(), pPath[i].Y(), pPath[i+1].X(), pPath[i+1].Y(), pPath[i+2].X(), pPath[i+2].Y()); @@ -533,13 +532,13 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol if (nPoints <= 0 || (pPath == nullptr) || !(maFillColor.Is() || maLineColor.Is())) return; - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPath[0].X(), pPath[0].Y()); + snprintf(pString, nBezString, "%li %li 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, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y()); + snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y()); WritePS(mpPageBody, pString); i++; } @@ -550,8 +549,7 @@ 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, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 - " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", + snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n", pPath[i].X(), pPath[i].Y(), pPath[i+1].X(), pPath[i+1].Y(), pPath[i+2].X(), pPath[i+2].Y()); @@ -596,7 +594,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, if( nPoints == 0 || pPtAry[i] == nullptr ) continue; - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point + snprintf(pString, nBezString, "%li %li 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;) { @@ -604,7 +602,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, // polygon without beziers if ( ! pFlgAry[i] || pFlgAry[i][j] != PolyFlags::Control) { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y()); + snprintf(pString, nBezString, "%li %li lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y()); WritePS(mpPageBody, pString); j++; } @@ -614,8 +612,7 @@ 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, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 - " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", + snprintf(pString, nBezString, "%li %li %li %li %li %li 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 3b2659c5bcef..f8951f4ea160 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, - sal_Int32& rOutWidth, sal_Int32& rOutHeight, + long& rOutWidth, long& rOutHeight, Point& rPageOffset, Size& rPaperSize ) { diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 872d8ca947ac..8f8bc056e054 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( sal_Int32 &rWidth, sal_Int32 &rHeight ) +void X11SalFrame::GetClientSize( long &rWidth, long &rHeight ) { if( ! bViewable_ ) { diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index 404f45bf8015..d95fa6ec60ac 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( sal_Int32& rWidth, sal_Int32& rHeight ) +void GtkSalFrame::GetClientSize( long& rWidth, long& 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 78bb5c2bd93d..4ba26b017ed4 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( sal_Int32& rWidth, sal_Int32& rHeight ) +void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight ) { if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) { diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index a8616e8118df..841cc2103cd8 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(%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ")\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight()); + fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\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 af6b5685ed45..7755480dffed 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( size.Width() )); + uno::makeAny( sal_Int32(size.Width()))); xStarMathProperties->setPropertyValue(getPropertyName( PROP_HEIGHT ), - uno::makeAny( size.Height() )); + uno::makeAny( sal_Int32(size.Height()))); // mimic the treatment of graphics here.. it seems anchoring as character // gives a better ( visually ) result xStarMathProperties->setPropertyValue(getPropertyName( PROP_ANCHOR_TYPE ), -- cgit v1.2.3