extensions/source/propctrlr/standardcontrol.cxx | 6 - officecfg/Configuration_officecfg.mk | 1 officecfg/registry/data/org/openoffice/Office/Paths.xcu | 8 +- postprocess/CustomTarget_registry.mk | 4 + reportdesign/source/ui/inc/ViewsWindow.hxx | 4 - reportdesign/source/ui/report/ViewsWindow.cxx | 5 - sc/source/ui/view/prevwsh.cxx | 6 + sd/source/filter/eppt/epptso.cxx | 6 + sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 8 +- sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx | 7 + svtools/source/contnr/svimpbox.cxx | 5 - svtools/source/graphic/grfcache.cxx | 8 +- svtools/source/graphic/grfmgr2.cxx | 8 +- svtools/source/table/tablecontrol_impl.cxx | 5 - svx/source/dialog/framelink.cxx | 16 ++-- svx/source/fmcomp/gridctrl.cxx | 3 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 8 +- sw/source/core/doc/docnum.cxx | 3 sw/source/core/docnode/ndtbl.cxx | 7 + sw/source/core/table/swnewtable.cxx | 3 sw/source/core/txtnode/fntcache.cxx | 6 + sw/source/ui/docvw/SidebarWin.cxx | 6 + sw/source/ui/sidebar/PageMarginControl.cxx | 36 +++++----- sw/source/ui/sidebar/PagePropertyPanel.cxx | 36 +++++----- vcl/generic/print/common_gfx.cxx | 7 + vcl/source/window/syswin.cxx | 6 + vcl/source/window/toolbox.cxx | 9 +- vcl/unx/generic/dtrans/X11_selection.cxx | 5 + 28 files changed, 149 insertions(+), 83 deletions(-)
New commits: commit b2371492dfd5c8003f89ed8acf3dbc690d6af8d0 Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Mar 3 18:27:00 2014 +0100 Use cstdlib std::abs instead of stdlib.h abs ...because the latter lacks the abs(long) overload in some popular environments, cf. <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60401> "stdlib.h does not provide abs(long) overload." Similarly, stdlib.h lacks the abs(float), abs(double), abs(long double) overloads compared to cmath there, whose use was apparently intended in sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx. Rewrote that to use CPPUNIT_ASSERT_DOUBLES_EQUAL instead, which revealed that the comparisons need rather large deltas of .1 resp. .2 (which the original code hid with an implicit conversion to integral type, thus using an effective delta of 1). Discovered with -Wabsolute-value ("absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value") recently introduced on Clang trunk towards 3.5. Change-Id: I4c41575ffdccb2944498b662bd3a53fd510cb0c0 diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 7d7d38a..b12261e 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -46,7 +46,7 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> - +#include <cstdlib> #include <limits> #include <boost/bind.hpp> #include <boost/scoped_ptr.hpp> @@ -392,8 +392,8 @@ namespace pcr void HyperlinkInput::impl_checkEndClick( const ::MouseEvent rMEvt ) { const MouseSettings& rMouseSettings( GetSettings().GetMouseSettings() ); - if ( ( abs( rMEvt.GetPosPixel().X() - m_aMouseButtonDownPos.X() ) < rMouseSettings.GetStartDragWidth() ) - && ( abs( rMEvt.GetPosPixel().Y() - m_aMouseButtonDownPos.Y() ) < rMouseSettings.GetStartDragHeight() ) + if ( ( std::abs( rMEvt.GetPosPixel().X() - m_aMouseButtonDownPos.X() ) < rMouseSettings.GetStartDragWidth() ) + && ( std::abs( rMEvt.GetPosPixel().Y() - m_aMouseButtonDownPos.Y() ) < rMouseSettings.GetStartDragHeight() ) ) Application::PostUserEvent( m_aClickHandler ); } diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index b62c0f0..c63728a 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -65,9 +65,9 @@ namespace rptui case POS_DOWN: return lhs.Bottom() >= rhs.Bottom(); case POS_CENTER_HORIZONTAL: - return abs(m_aRefPoint.X() - lhs.Center().X()) < abs(m_aRefPoint.X() - rhs.Center().X()); + return std::abs(m_aRefPoint.X() - lhs.Center().X()) < std::abs(m_aRefPoint.X() - rhs.Center().X()); case POS_CENTER_VERTICAL: - return abs(lhs.Center().Y() - m_aRefPoint.Y()) < abs(rhs.Center().Y() - m_aRefPoint.Y()); + return std::abs(lhs.Center().Y() - m_aRefPoint.Y()) < std::abs(rhs.Center().Y() - m_aRefPoint.Y()); } return false; } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 161726b..9ca6852 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -47,6 +47,7 @@ #include <svx/svdundo.hxx> #include <toolkit/helper/convert.hxx> #include <algorithm> +#include <cstdlib> #include <numeric> #include <o3tl/compat_functional.hxx> @@ -1096,8 +1097,8 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi aNewObjPos.Y() += nSectionHeight; } - const sal_Int32 nDeltaX = abs(aLeftTop.X() - aAbsolutePnt.X()); - const sal_Int32 nDeltaY = abs(aLeftTop.Y() - aAbsolutePnt.Y()); + const sal_Int32 nDeltaX = std::abs(aLeftTop.X() - aAbsolutePnt.X()); + const sal_Int32 nDeltaY = std::abs(aLeftTop.Y() - aAbsolutePnt.Y()); m_aDragDelta.X() = nDeltaX; m_aDragDelta.Y() = nDeltaY; diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 0d08c9f..174520a 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include "scitems.hxx" #include <comphelper/string.hxx> #include <editeng/eeitem.hxx> @@ -1072,7 +1076,7 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) aCurPos.Y() -= nVPage; break; case SID_CURSORPAGEDOWN: - if( (abs(nVPage+nThumbPos-nRangeMax)<10) || nMaxVertPos<0 ) + if( (std::abs(nVPage+nThumbPos-nRangeMax)<10) || nMaxVertPos<0 ) { long nPage = pPreview->GetPageNo(); long nTotal = pPreview->GetTotalPages(); diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 304c2b2..d36590a 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <osl/endian.h> #include <eppt.hxx> #include "text.hxx" @@ -1245,7 +1249,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u nDefaultTabSizeSrc = nTabStop; } const sal_uInt32 nDefaultTabSize = MapSize( awt::Size( nDefaultTabSizeSrc, 1 ) ).Width; - sal_uInt32 nDefaultTabs = abs( maRect.GetWidth() ) / nDefaultTabSize; + sal_uInt32 nDefaultTabs = std::abs( maRect.GetWidth() ) / nDefaultTabSize; if ( nTabs ) nDefaultTabs -= (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize ); if ( (sal_Int32)nDefaultTabs < 0 ) diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 746e940a..647e251 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include "controller/SlsSelectionFunction.hxx" #include "SlideSorter.hxx" @@ -1361,8 +1365,8 @@ bool NormalModeHandler::ProcessMotionEvent ( { const sal_Int32 nDistance (maButtonDownLocation ? ::std::max ( - abs(maButtonDownLocation->X() - rDescriptor.maMousePosition.X()), - abs(maButtonDownLocation->Y() - rDescriptor.maMousePosition.Y())) + std::abs(maButtonDownLocation->X() - rDescriptor.maMousePosition.X()), + std::abs(maButtonDownLocation->Y() - rDescriptor.maMousePosition.Y())) : 0); if (nDistance > 3) StartDrag( diff --git a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx index 48b0898..c6a4f1e 100644 --- a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> #include "controller/SlsVisibleAreaManager.hxx" #include "controller/SlideSorterController.hxx" @@ -270,14 +273,14 @@ VisibleAreaScroller::VisibleAreaScroller ( // When the distance to scroll is larger than a threshold then first // jump to within this distance of the final value and start the // animation from there. - if (abs(aStart.X()-aEnd.X()) > gnMaxScrollDistance) + if (std::abs(aStart.X()-aEnd.X()) > gnMaxScrollDistance) { if (aStart.X() < aEnd.X()) maStart.X() = aEnd.X()-gnMaxScrollDistance; else maStart.X() = aEnd.X()+gnMaxScrollDistance; } - if (abs(aStart.Y()-aEnd.Y()) > gnMaxScrollDistance) + if (std::abs(aStart.Y()-aEnd.Y()) > gnMaxScrollDistance) { if (aStart.Y() < aEnd.Y()) maStart.Y() = aEnd.Y()-gnMaxScrollDistance; diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index dac2f9866..d6312cb 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -22,6 +22,7 @@ #include <vcl/help.hxx> #include <vcl/settings.hxx> +#include <cstdlib> #include <stack> #include <svtools/treelistbox.hxx> @@ -3141,8 +3142,8 @@ IMPL_LINK_NOARG(SvImpLBox, EditTimerCall) if ( bIsMouseTriggered ) { Point aCurrentMousePos = pView->GetPointerPosPixel(); - if ( ( abs( aCurrentMousePos.X() - aEditClickPos.X() ) > 5 ) - || ( abs( aCurrentMousePos.Y() - aEditClickPos.Y() ) > 5 ) + if ( ( std::abs( aCurrentMousePos.X() - aEditClickPos.X() ) > 5 ) + || ( std::abs( aCurrentMousePos.Y() - aEditClickPos.Y() ) > 5 ) ) { return 0L; diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index c1f4324..89bfb60 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <salhelper/timer.hxx> #include <svtools/grfmgr.hxx> #include <tools/debug.hxx> @@ -494,8 +498,8 @@ static void checkMetadataBitmap( const BitmapEx& rBmpEx, } if( rDestSize != rRefSize ) { if( rBmpEx.GetSizePixel().Width() > 100 && rBmpEx.GetSizePixel().Height() > 100 - && abs( rDestSize.Width() - rRefSize.Width()) < 5 - && abs( rDestSize.Height() - rRefSize.Height()) < 5 ) + && std::abs( rDestSize.Width() - rRefSize.Width()) < 5 + && std::abs( rDestSize.Height() - rRefSize.Height()) < 5 ) ; // ok, assume it's close enough else { // fall back to mtf rendering diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index e439ca7..f1048e1 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <vcl/bmpacc.hxx> #include <tools/poly.hxx> #include <vcl/outdev.hxx> @@ -1007,8 +1011,8 @@ static BitmapEx checkMetadataBitmap( const BitmapEx& rBmpEx, // caused by this small difference). This will allow caching of the resulting // (scaled) pixmap, which can make a noticeable performance difference. if( rBmpEx.GetSizePixel().Width() > 100 && rBmpEx.GetSizePixel().Height() > 100 - && abs( rDestSize.Width() - rRefSize.Width()) < 5 - && abs( rDestSize.Height() - rRefSize.Height()) < 5 ) + && std::abs( rDestSize.Width() - rRefSize.Width()) < 5 + && std::abs( rDestSize.Height() - rRefSize.Height()) < 5 ) ; // ok, assume it's close enough else { // fall back to mtf rendering diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 4565a1e..31372d0 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -39,6 +39,7 @@ #include <vcl/image.hxx> #include <tools/diagnose_ex.h> +#include <cstdlib> #include <functional> #include <numeric> @@ -2338,7 +2339,7 @@ namespace svt { namespace table Rectangle aDataArea( Point( 0, m_nColHeaderHeightPixel ), m_pDataWindow->GetOutputSizePixel() ); if ( m_pDataWindow->GetBackground().IsScrollable() - && abs( nPixelDelta ) < aDataArea.GetHeight() + && std::abs( nPixelDelta ) < aDataArea.GetHeight() ) { m_pDataWindow->Scroll( 0, (long)-nPixelDelta, aDataArea, SCROLL_CLIP | SCROLL_UPDATE | SCROLL_CHILDREN); @@ -2418,7 +2419,7 @@ namespace svt { namespace table // scroll the window content (if supported and possible), or invalidate the complete window if ( m_pDataWindow->GetBackground().IsScrollable() - && abs( nPixelDelta ) < aDataArea.GetWidth() + && std::abs( nPixelDelta ) < aDataArea.GetWidth() ) { m_pDataWindow->Scroll( nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE ); diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx index e30155e..a6a4f72 100644 --- a/svx/source/dialog/framelink.cxx +++ b/svx/source/dialog/framelink.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <svx/framelink.hxx> #include <math.h> @@ -765,9 +769,9 @@ void lclDrawHorLine( LinePoints aTPoints( rLPos + lclToMapUnit( rLRes.mnOffs1, nTOffs ), rRPos + lclToMapUnit( rRRes.mnOffs1, nTOffs ) ); LinePoints aBPoints( rLPos + lclToMapUnit( rLRes.mnOffs2, nBOffs ), rRPos + lclToMapUnit( rRRes.mnOffs2, nBOffs ) ); - sal_uInt32 nWidth = lclToMapUnit( abs( nTOffs ) ) + lclToMapUnit( abs( nBOffs ) ); + sal_uInt32 nWidth = lclToMapUnit( std::abs( nTOffs ) ) + lclToMapUnit( std::abs( nBOffs ) ); if ( ( nTOffs >= 0 && nBOffs >= 0 ) || ( nTOffs <= 0 && nBOffs <= 0 ) ) - nWidth = abs( lclToMapUnit( nTOffs ) - lclToMapUnit( nBOffs ) ) + 1; + nWidth = std::abs( lclToMapUnit( nTOffs ) - lclToMapUnit( nBOffs ) ) + 1; Point rLMid = ( aTPoints.maBeg + aBPoints.maBeg ) / 2; Point rRMid = ( aTPoints.maEnd + aBPoints.maEnd ) / 2; @@ -835,9 +839,9 @@ void lclDrawVerLine( LinePoints aLPoints( rTPos + lclToMapUnit( nLOffs, rTRes.mnOffs1 ), rBPos + lclToMapUnit( nLOffs, rBRes.mnOffs1 ) ); LinePoints aRPoints( rTPos + lclToMapUnit( nROffs, rTRes.mnOffs2 ), rBPos + lclToMapUnit( nROffs, rBRes.mnOffs2 ) ); - sal_uInt32 nWidth = lclToMapUnit( abs( nLOffs ) ) + lclToMapUnit( abs( nROffs ) ); + sal_uInt32 nWidth = lclToMapUnit( std::abs( nLOffs ) ) + lclToMapUnit( std::abs( nROffs ) ); if ( ( nLOffs >= 0 && nROffs >= 0 ) || ( nLOffs <= 0 && nROffs <= 0 ) ) - nWidth = abs( lclToMapUnit( nLOffs ) - lclToMapUnit( nROffs ) ) + 1; + nWidth = std::abs( lclToMapUnit( nLOffs ) - lclToMapUnit( nROffs ) ) + 1; Point rTMid = ( aLPoints.maBeg + aRPoints.maBeg ) / 2; Point rBMid = ( aLPoints.maEnd + aRPoints.maEnd ) / 2; @@ -1023,9 +1027,9 @@ void lclDrawDiagLine( Point aSMid( ( aLPoints.maBeg + aL2Points.maBeg ) / 2 ); Point aEMid( ( aLPoints.maEnd + aL2Points.maEnd ) / 2 ); - sal_uInt32 nWidth = lclToMapUnit( abs( nDiagOffs1 ) ) + lclToMapUnit( abs( nDiagOffs2 ) ); + sal_uInt32 nWidth = lclToMapUnit( std::abs( nDiagOffs1 ) ) + lclToMapUnit( std::abs( nDiagOffs2 ) ); if ( ( nDiagOffs1 <= 0 && nDiagOffs2 <= 0 ) || ( nDiagOffs1 >=0 && nDiagOffs2 >=0 ) ) - nWidth = lclToMapUnit( abs( nDiagOffs1 - nDiagOffs2 ) ); + nWidth = lclToMapUnit( std::abs( nDiagOffs1 - nDiagOffs2 ) ); svtools::DrawLine( rDev, aSMid, aEMid, nWidth, nDashing ); rDev.Pop(); // clipping region diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index cf23512..82ff2bc 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -56,6 +56,7 @@ #include <comphelper/property.hxx> #include <algorithm> +#include <cstdlib> #include <map> using namespace ::svxform; @@ -2302,7 +2303,7 @@ sal_Bool DbGridControl::SeekCursor(long nRow, sal_Bool bAbsolute) DBG_ASSERT( !m_pSeekCursor->isAfterLast() && !m_pSeekCursor->isBeforeFirst(), "DbGridControl::SeekCursor: how did the seek cursor get to this position?!" ); nSteps = nRow - (m_pSeekCursor->getRow() - 1); - bAbsolute = bAbsolute || (abs(nSteps) > 100); + bAbsolute = bAbsolute || (std::abs(nSteps) > 100); } if ( bAbsolute ) diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 8dc0ef5..e9ef928 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -517,22 +517,22 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx") if( aStyleCommandName.equals( "margin-left" ) ) { float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); - CPPUNIT_ASSERT_EQUAL(0, abs(97.6 - fValue)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(97.6, fValue, 0.1); } else if( aStyleCommandName.equals( "margin-top" ) ) { float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); - CPPUNIT_ASSERT_EQUAL(0, abs(165 - fValue)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(165.0, fValue, 0.2); } else if( aStyleCommandName.equals( "width" ) ) { float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); - CPPUNIT_ASSERT_EQUAL(0, abs(283.4 - fValue)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(283.4, fValue, 0.1); } else if( aStyleCommandName.equals( "height" ) ) { float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat(); - CPPUNIT_ASSERT_EQUAL(0, abs(141.7 - fValue)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(141.7, fValue, 0.1); } } while( nextTokenPos != -1 ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 79aa45d..05ec96d 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -52,6 +52,7 @@ #include <switerator.hxx> #include <comphelper/string.hxx> +#include <cstdlib> #include <map> namespace { @@ -1758,7 +1759,7 @@ bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, bool bIsOutlMv ) else { // Impossible to move to negative index - if( sal_uLong(abs( nOffset )) > nStIdx) + if( sal_uLong(std::abs( nOffset )) > nStIdx) return false; nInEndIdx = nStIdx - 1; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 4a7f4e5..4cd0278 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -79,6 +79,7 @@ #include <unochart.hxx> #include <node.hxx> #include <ndtxt.hxx> +#include <cstdlib> #include <map> #include <algorithm> #include <rootfrm.hxx> @@ -2516,7 +2517,7 @@ struct FuzzyCompare bool FuzzyCompare::operator() ( long s1, long s2 ) const { - return ( s1 < s2 && abs( s1 - s2 ) > ROWFUZZY ); + return ( s1 < s2 && std::abs( s1 - s2 ) > ROWFUZZY ); } static bool lcl_IsFrmInColumn( const SwCellFrm& rFrm, SwSelBoxes& rBoxes ) @@ -2801,7 +2802,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur const long nNewRowHeight = nNewRowEnd - nNewRowStart; const long nDiff = nNewRowHeight - nOldRowHeight; - if ( abs( nDiff ) >= ROWFUZZY ) + if ( std::abs( nDiff ) >= ROWFUZZY ) { // For the old table model pTxtFrm and pLine will be set for every box. // For the new table model pTxtFrm will be set if the box is not covered, @@ -2819,7 +2820,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur { const long nLowerBorder = (pFrm->Frm().*fnRect->fnGetBottom)(); const sal_uLong nTabTop = (pTab->*fnRect->fnGetPrtTop)(); - if ( abs( (*fnRect->fnYInc)( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY ) + if ( std::abs( (*fnRect->fnYInc)( nTabTop, nOldRowEnd ) - nLowerBorder ) <= ROWFUZZY ) { if ( !bCurColOnly || pFrm == pBoxFrm ) { diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index ff26c7b..26a445a 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -29,6 +29,7 @@ #include <fmtfsize.hxx> #include <doc.hxx> #include <IDocumentUndoRedo.hxx> +#include <cstdlib> #include <vector> #include <set> #include <list> @@ -2141,7 +2142,7 @@ void SwTable::CheckConsistency() const SAL_WARN_IF( nWidth != nLineWidth, "sw.core", "Different Line Widths: first: " << nLineWidth << " current [" << nCurrLine << "]: " << nWidth); - SAL_WARN_IF( abs(nWidth - nTabSize) > 1 /* how tolerant? */, "sw.core", + SAL_WARN_IF( std::abs(nWidth - nTabSize) > 1 /* how tolerant? */, "sw.core", "Line width differs from table width: " << nTabSize << " current [" << nCurrLine << "]: " << nWidth); SAL_WARN_IF( nWidth < 0 || nWidth > USHRT_MAX, "sw.core", diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 78362c3..3bcbb08 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <i18nlangtag/mslangid.hxx> #include <vcl/outdev.hxx> #include <vcl/print.hxx> @@ -348,7 +352,7 @@ sal_uInt16 SwFntObj::GetFontHeight( const SwViewShell* pSh, const OutputDevice& long nTmpPrtHeight = (sal_uInt16)aOutMet.GetAscent() + aOutMet.GetDescent(); (void) nTmpPrtHeight; // #i106098#: do not compare with == here due to rounding error - OSL_ENSURE( abs(nTmpPrtHeight - nPrtHeight) < 3, + OSL_ENSURE( std::abs(nTmpPrtHeight - nPrtHeight) < 3, "GetTextHeight != Ascent + Descent" ); #endif diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index f05fd72..503549e 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <SidebarWin.hxx> #include <SidebarWinAcc.hxx> #include <PostItMgr.hxx> @@ -462,7 +466,7 @@ void SwSidebarWin::SetPosAndSize() DoResize(); } - if (GetPosPixel().X() != mPosSize.TopLeft().X() || (abs(GetPosPixel().Y() - mPosSize.TopLeft().Y()) > 5) ) + if (GetPosPixel().X() != mPosSize.TopLeft().X() || (std::abs(GetPosPixel().Y() - mPosSize.TopLeft().Y()) > 5) ) { bChange = true; SetPosPixel(mPosSize.TopLeft()); diff --git a/sw/source/ui/sidebar/PageMarginControl.cxx b/sw/source/ui/sidebar/PageMarginControl.cxx index 717a185..dd3d031 100644 --- a/sw/source/ui/sidebar/PageMarginControl.cxx +++ b/sw/source/ui/sidebar/PageMarginControl.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include "PageMarginControl.hxx" #include "PagePropertyPanel.hxx" #include "PagePropertyPanel.hrc" @@ -259,34 +263,34 @@ void PageMarginControl::SelectValueSetItem() { const long cTolerance = 5; - if( abs(mnPageLeftMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - abs(mnPageRightMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - abs(mnPageTopMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - abs(mnPageBottomMargin - SWPAGE_NARROW_VALUE) <= cTolerance && + if( std::abs(mnPageLeftMargin - SWPAGE_NARROW_VALUE) <= cTolerance && + std::abs(mnPageRightMargin - SWPAGE_NARROW_VALUE) <= cTolerance && + std::abs(mnPageTopMargin - SWPAGE_NARROW_VALUE) <= cTolerance && + std::abs(mnPageBottomMargin - SWPAGE_NARROW_VALUE) <= cTolerance && !mbMirrored ) { mpMarginValueSet->SelectItem(1); } - else if( abs(mnPageLeftMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - abs(mnPageRightMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - abs(mnPageTopMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - abs(mnPageBottomMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && + else if( std::abs(mnPageLeftMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && + std::abs(mnPageRightMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && + std::abs(mnPageTopMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && + std::abs(mnPageBottomMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && !mbMirrored ) { mpMarginValueSet->SelectItem(2); } - else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE2) <= cTolerance && - abs(mnPageRightMargin - SWPAGE_WIDE_VALUE2) <= cTolerance && - abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && + else if( std::abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE2) <= cTolerance && + std::abs(mnPageRightMargin - SWPAGE_WIDE_VALUE2) <= cTolerance && + std::abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && + std::abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && !mbMirrored ) { mpMarginValueSet->SelectItem(3); } - else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE3) <= cTolerance && - abs(mnPageRightMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && + else if( std::abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE3) <= cTolerance && + std::abs(mnPageRightMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && + std::abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && + std::abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && mbMirrored ) { mpMarginValueSet->SelectItem(4); diff --git a/sw/source/ui/sidebar/PagePropertyPanel.cxx b/sw/source/ui/sidebar/PagePropertyPanel.cxx index 156a1cb..a5d0238 100644 --- a/sw/source/ui/sidebar/PagePropertyPanel.cxx +++ b/sw/source/ui/sidebar/PagePropertyPanel.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include "PagePropertyPanel.hxx" #include "PagePropertyPanel.hrc" @@ -566,31 +570,31 @@ void PagePropertyPanel::ChangeMarginImage() const long cTolerance = 5; const sal_uInt16 nIdMargin = mpToolBoxMargin->GetItemId(UNO_MARGIN); - if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NARROW_VALUE) <= cTolerance && - abs(mpPageLRMarginItem->GetRight() - SWPAGE_NARROW_VALUE) <= cTolerance && - abs(mpPageULMarginItem->GetUpper() - SWPAGE_NARROW_VALUE) <= cTolerance && - abs(mpPageULMarginItem->GetLower() - SWPAGE_NARROW_VALUE) <= cTolerance && + if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NARROW_VALUE) <= cTolerance && + std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_NARROW_VALUE) <= cTolerance && + std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_NARROW_VALUE) <= cTolerance && + std::abs(mpPageULMarginItem->GetLower() - SWPAGE_NARROW_VALUE) <= cTolerance && mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR ) mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgNarrow_L : mImgNarrow ); - else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NORMAL_VALUE) <= cTolerance && - abs(mpPageLRMarginItem->GetRight() - SWPAGE_NORMAL_VALUE) <= cTolerance && - abs(mpPageULMarginItem->GetUpper() - SWPAGE_NORMAL_VALUE) <= cTolerance && - abs(mpPageULMarginItem->GetLower() - SWPAGE_NORMAL_VALUE) <= cTolerance && + else if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NORMAL_VALUE) <= cTolerance && + std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_NORMAL_VALUE) <= cTolerance && + std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_NORMAL_VALUE) <= cTolerance && + std::abs(mpPageULMarginItem->GetLower() - SWPAGE_NORMAL_VALUE) <= cTolerance && mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR ) mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgNormal_L : mImgNormal ); - else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE2) <= cTolerance && - abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE2) <= cTolerance && - abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance && - abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance && + else if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE2) <= cTolerance && + std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE2) <= cTolerance && + std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance && + std::abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance && mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR ) mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgWide_L : mImgWide ); - else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE3) <= cTolerance && - abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE1) <= cTolerance && - abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance && - abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance && + else if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE3) <= cTolerance && + std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE1) <= cTolerance && + std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance && + std::abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance && mpPageItem->GetPageUsage() == SVX_PAGE_MIRROR ) mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgMirrored_L : mImgMirrored ); diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx index e7bb644..9988ea8 100644 --- a/vcl/generic/print/common_gfx.cxx +++ b/vcl/generic/print/common_gfx.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> #include "psputil.hxx" #include "glyphset.hxx" @@ -194,8 +197,8 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it, ) { if( aLastRect.GetHeight() > 1 || - abs( aLastRect.Left() - nextit->Left() ) > 2 || - abs( aLastRect.Right() - nextit->Right() ) > 2 + std::abs( aLastRect.Left() - nextit->Left() ) > 2 || + std::abs( aLastRect.Right() - nextit->Right() ) > 2 ) { leftside.push_back( Point( aLastRect.Left(), aLastRect.Bottom()+1 ) ); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 6274cfc..4d6063f 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> + #include <tools/debug.hxx> #include <vcl/svapp.hxx> @@ -714,7 +718,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible ) { SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry(); - if( abs(g.nX-aState.mnX) < 2 && abs(g.nY-aState.mnY) < 5 ) + if( std::abs(g.nX-aState.mnX) < 2 && std::abs(g.nY-aState.mnY) < 5 ) { long displacement = g.nTopDecoration ? g.nTopDecoration : 20; if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() || diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index f749509..77c0e3d 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -45,6 +45,7 @@ #include <svsys.h> #endif +#include <cstdlib> #include <string.h> #include <vector> #include <math.h> @@ -2206,11 +2207,11 @@ Size ToolBox::ImplGetOptimalFloatingSize() return aSize2; // set the size with the smallest delta as the current size - long dx1 = abs( mnDX - aSize1.Width() ); - long dy1 = abs( mnDY - aSize1.Height() ); + long dx1 = std::abs( mnDX - aSize1.Width() ); + long dy1 = std::abs( mnDY - aSize1.Height() ); - long dx2 = abs( mnDX - aSize2.Width() ); - long dy2 = abs( mnDY - aSize2.Height() ); + long dx2 = std::abs( mnDX - aSize2.Width() ); + long dy2 = std::abs( mnDY - aSize2.Height() ); if( dx1*dy1 < dx2*dy2 ) aCurrentSize = aSize1; diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 4072e83..0e5a3ce 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cstdlib> #include "unx/saldisp.hxx" #include "unx/saldata.hxx" @@ -1246,7 +1249,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > it = m_aSelections.find( selection ); if( it != m_aSelections.end() && it->second->m_aTypes.getLength() && - abs( it->second->m_nLastTimestamp - time( NULL ) ) < 2 + std::abs( it->second->m_nLastTimestamp - time( NULL ) ) < 2 ) { rTypes = it->second->m_aTypes; commit 768ea2924680fc4beb75a782cb0faf26695fee53 Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Mar 3 18:19:01 2014 +0100 install:module <value>s must be mutually exclusive ...so that only a single one ends up in the .xcd data. (In the given case, introduced with 838b77f5f3d6d8fd98891e99a23ff78a6a357cb2 "Resolves: rhbz#1065807 use xdg ~/Templates for default Template location," the duplication for the unixdesktop case happened to be harmless, as the non-unixdesktop <value> appeared in a block in main.xcd before the unixdesktop-specific <value>, so the former was effectively ignored when reading main.xcd.) Change-Id: I5199556ee3e6decaa07beb14a0503e1b5661f5df diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk index d0a7239..497fc27 100644 --- a/officecfg/Configuration_officecfg.mk +++ b/officecfg/Configuration_officecfg.mk @@ -101,6 +101,7 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat org/openoffice/Office/Paths-macosx.xcu \ org/openoffice/Office/Paths-unxwnt.xcu \ org/openoffice/Office/Paths-unixdesktop.xcu \ + org/openoffice/Office/Paths-notunixdesktop.xcu \ org/openoffice/Office/Paths-internallibexttextcatdata.xcu \ org/openoffice/Office/Paths-externallibexttextcatdata.xcu \ org/openoffice/Office/Writer-cjk.xcu \ diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu index 2a9eb5c..e8c44d1 100644 --- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu @@ -162,7 +162,7 @@ <node oor:name="$(insturl)/@LIBO_SHARE_FOLDER@/template/$(vlang)" oor:op="fuse"/> </node> <!-- - On unix check of we have a ~/Templates and use that as the write path. + On unix check if we have a ~/Templates and use that as the write path. On other platforms, or if ~/Templates doesn't exist, use the traditional $(userurl)/template path. @@ -171,11 +171,11 @@ in that dir. --> <prop oor:name="WritePath"> - <value>$(userurl)/template</value> + <value install:module="notunixdesktop">$(userurl)/template</value> <value install:module="unixdesktop" oor:external="com.sun.star.configuration.backend.DesktopBackend TemplatePathVariable"/> </prop> - <prop oor:name="UserPaths"> - <value install:module="unixdesktop">$(userurl)/template</value> + <prop oor:name="UserPaths" install:module="unixdesktop"> + <value>$(userurl)/template</value> </prop> </node> <node oor:name="UIConfig" oor:op="fuse" oor:mandatory="true"> diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk index 388793e..ebd2afe 100644 --- a/postprocess/CustomTarget_registry.mk +++ b/postprocess/CustomTarget_registry.mk @@ -331,6 +331,10 @@ postprocess_FILES_main += \ # Inet-wnt.xcu must come after Inet.xcu postprocess_DRIVERS += ado endif +ifneq (unx,$(GUIBASE)) +postprocess_FILES_main += \ + $(postprocess_MOD)/org/openoffice/Office/Paths-notunixdesktop.xcu +endif ifeq ($(DISABLE_NEON),$(false)) postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/ucb/Configuration-neon.xcu endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits