[Libreoffice-commits] core.git: 2 commits - sc/source sd/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Feb 27 09:24:38 UTC 2018


 sc/source/core/data/drwlayer.cxx                    |   42 +++++++-------------
 sc/source/core/data/postit.cxx                      |    2 
 sc/source/filter/excel/xlpage.cxx                   |    7 ++-
 sc/source/ui/cctrl/cbuttonw.cxx                     |    6 +-
 sc/source/ui/cctrl/tbzoomsliderctrl.cxx             |    2 
 sc/source/ui/docshell/docsh4.cxx                    |   24 ++++++-----
 sc/source/ui/view/gridwin.cxx                       |    2 
 sc/source/ui/view/notemark.cxx                      |    2 
 sc/source/ui/view/output.cxx                        |    2 
 sc/source/ui/view/output3.cxx                       |    8 ++-
 sc/source/ui/view/preview.cxx                       |    2 
 sc/source/ui/view/printfun.cxx                      |    6 +-
 sc/source/ui/view/tabview5.cxx                      |    4 -
 sd/source/ui/animations/CustomAnimationList.cxx     |    2 
 sd/source/ui/dlg/RemoteDialogClientBox.cxx          |    2 
 sd/source/ui/func/fusel.cxx                         |    2 
 sd/source/ui/func/fuzoom.cxx                        |    6 +-
 sd/source/ui/slideshow/slideshowviewimpl.cxx        |    2 
 sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx |    2 
 sd/source/ui/view/DocumentRenderer.cxx              |   34 ++++++++--------
 sd/source/ui/view/viewoverlaymanager.cxx            |    8 +--
 21 files changed, 84 insertions(+), 83 deletions(-)

New commits:
commit be5af6cefea2fa43479ec6124e2c847956144a6d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Feb 26 13:27:48 2018 +0200

    drop old tools/gen.hxx methods in sd
    
    Change-Id: I8af9c5c0085f5e6f8e498c48bae69f8247ef88ed
    Reviewed-on: https://gerrit.libreoffice.org/50362
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 086162e99fdb..c2908041be6d 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -421,7 +421,7 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD
 
     aOutRect.AdjustLeft(nHorzBorder );
     aOutRect.AdjustRight( -nHorzBorder );
-    aOutRect.Top() += nVertBorder;
+    aOutRect.AdjustTop( nVertBorder );
     aOutRect.AdjustBottom( -nVertBorder );
 
     rRenderContext.DrawText(aOutRect, rRenderContext.GetEllipsisString(msDescription, aOutRect.GetWidth()));
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 1fbd88cef57f..f5618622d042 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -152,7 +152,7 @@ void ClientBox::CalcActiveHeight()
     if ( m_bHasScrollBar )
         aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) );
 
-    aSize.Width() -= ICON_OFFSET;
+    aSize.AdjustWidth( -ICON_OFFSET );
 
     aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
                                MapMode( MapUnit::MapAppFont ) );
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 3746ebacb4d6..968fde162a44 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -1222,7 +1222,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
 
     aHitPosR.AdjustX(n2HitLog );
     aHitPosL.AdjustX( -n2HitLog );
-    aHitPosT.Y() += n2HitLog;
+    aHitPosT.AdjustY( n2HitLog );
     aHitPosB.AdjustY( -n2HitLog );
 
     if ( !bClosed                                      ||
diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx
index a6d5011e1923..e71452847a9d 100644
--- a/sd/source/ui/func/fuzoom.cxx
+++ b/sd/source/ui/func/fuzoom.cxx
@@ -118,7 +118,7 @@ bool FuZoom::MouseMove(const MouseEvent& rMEvt)
                 Size aWorkSize = mpView->GetWorkArea().GetSize();
                 Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize();
                 aScroll.setX( aScroll.X() / ( aWorkSize.Width()  / aPageSize.Width()) );
-                aScroll.Y() /= aWorkSize.Height() / aPageSize.Height();
+                aScroll.setY( aScroll.Y() / ( aWorkSize.Height() / aPageSize.Height()) );
                 mpViewShell->Scroll(aScroll.X(), aScroll.Y());
                 aBeginPosPix = aPosPix;
             }
@@ -164,12 +164,12 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
             if ( rMEvt.IsMod1() )
             {
                 aSize.setWidth( aSize.Width() * 2 );
-                aSize.Height() *= 2;
+                aSize.setHeight( aSize.Height() * 2 );
             }
             else
             {
                 aSize.setWidth( aSize.Width() / 2 );
-                aSize.Height() /= 2;
+                aSize.setHeight( aSize.Height() / 2 );
             }
             aPos.AdjustX( -(aSize.Width() / 2) );
             aPos.AdjustY( -(aSize.Height() / 2) );
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx
index 236035c1f73d..f63e1012c749 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx
@@ -355,7 +355,7 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation(  )
     // render one pixel wider and higher as aPageSize below specifies
     // (when shapes of page size have visible border lines)
     aOutputSize.AdjustWidth( -1 );
-    aOutputSize.Height() --;
+    aOutputSize.AdjustHeight( -1 );
 
     // Record mTranslationOffset
     mTranslationOffset.Height = aOutputOffset.Y();
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
index 31be00214317..377b0932438c 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx
@@ -57,7 +57,7 @@ Bitmap BitmapFactory::CreateBitmap (
         // Supersampling factor
         int aSuperSamplingFactor = 2;
         aSize.setWidth( aSize.Width() * aSuperSamplingFactor );
-        aSize.Height() *= aSuperSamplingFactor;
+        aSize.setHeight( aSize.Height() * aSuperSamplingFactor );
     }
 
     Bitmap aPreview (maRenderer.RenderPage (
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index a88448666f2a..91377f2b69f2 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1939,8 +1939,8 @@ private:
                     && aPageWidth > aPageHeight ) )
             {
                 const sal_Int32 nTmp (rInfo.maPrintSize.Width());
-                rInfo.maPrintSize.Width() = rInfo.maPrintSize.Height();
-                rInfo.maPrintSize.Height() = nTmp;
+                rInfo.maPrintSize.setWidth( rInfo.maPrintSize.Height() );
+                rInfo.maPrintSize.setHeight( nTmp );
             }
 
             if (mpOptions->IsTilePage()
@@ -1970,22 +1970,22 @@ private:
         Size aPageSize_2 (rInfo.maPageSize);
 
         if (rInfo.meOrientation == Orientation::Landscape)
-            aPrintSize_2.Width() >>= 1;
+            aPrintSize_2.setWidth( aPrintSize_2.Width() >> 1 );
         else
-            aPrintSize_2.Height() >>= 1;
+            aPrintSize_2.setHeight( aPrintSize_2.Height() >> 1 );
 
         const double fPageWH = static_cast<double>(aPageSize_2.Width()) / aPageSize_2.Height();
         const double fPrintWH = static_cast<double>(aPrintSize_2.Width()) / aPrintSize_2.Height();
 
         if( fPageWH < fPrintWH )
         {
-            aPageSize_2.Width() = static_cast<long>( aPrintSize_2.Height() * fPageWH );
-            aPageSize_2.Height()= aPrintSize_2.Height();
+            aPageSize_2.setWidth(  static_cast<long>( aPrintSize_2.Height() * fPageWH ) );
+            aPageSize_2.setHeight( aPrintSize_2.Height() );
         }
         else
         {
-            aPageSize_2.Width() = aPrintSize_2.Width();
-            aPageSize_2.Height() = static_cast<long>( aPrintSize_2.Width() / fPageWH );
+            aPageSize_2.setWidth( aPrintSize_2.Width() );
+            aPageSize_2.setHeight( static_cast<long>( aPrintSize_2.Width() / fPageWH ) );
         }
 
         MapMode aMap (rInfo.maMap);
@@ -2000,13 +2000,13 @@ private:
 
         if (rInfo.meOrientation == Orientation::Landscape)
         {
-            aOffset.X() = ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1;
-            aOffset.Y() = ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1;
+            aOffset.setX( ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1 );
+            aOffset.setY( ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1 );
         }
         else
         {
-            aOffset.X() = ( aAdjustedPrintSize.Width() - rInfo.maPageSize.Width() ) >> 1;
-            aOffset.Y() = ( ( aAdjustedPrintSize.Height() >> 1 ) - rInfo.maPageSize.Height() ) >> 1;
+            aOffset.setX( ( aAdjustedPrintSize.Width() - rInfo.maPageSize.Width() ) >> 1 );
+            aOffset.setY( ( ( aAdjustedPrintSize.Height() >> 1 ) - rInfo.maPageSize.Height() ) >> 1 );
         }
 
         // create vector of pages to print
@@ -2059,9 +2059,9 @@ private:
                 const std::pair<sal_uInt16, sal_uInt16> aPair (aPairVector[nIndex]);
                 Point aSecondOffset (aOffset);
                 if (rInfo.meOrientation == Orientation::Landscape)
-                    aSecondOffset.X() += aAdjustedPrintSize.Width() / 2;
+                    aSecondOffset.AdjustX( aAdjustedPrintSize.Width() / 2 );
                 else
-                    aSecondOffset.Y() += aAdjustedPrintSize.Height() / 2;
+                    aSecondOffset.AdjustY( aAdjustedPrintSize.Height() / 2 );
                 maPrinterPages.push_back(
                     std::shared_ptr<PrinterPage>(
                         new BookletPrinterPage(
@@ -2171,11 +2171,11 @@ private:
 
             for (Point aPageOrigin = aOrigin;
                  -aPageOrigin.Y()<nPageHeight;
-                 aPageOrigin.Y() -= rInfo.maPrintSize.Height())
+                 aPageOrigin.AdjustY( -rInfo.maPrintSize.Height() ))
             {
-                for (aPageOrigin.X()=aOrigin.X();
+                for (aPageOrigin.setX(aOrigin.X());
                      -aPageOrigin.X()<nPageWidth;
-                     aPageOrigin.X() -= rInfo.maPrintSize.Width())
+                     aPageOrigin.AdjustX(-rInfo.maPrintSize.Width()))
                 {
                     aMap.SetOrigin(aPageOrigin);
                     maPrinterPages.push_back(
diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx
index 7db5e61a6929..f7646704b3fb 100644
--- a/sd/source/ui/view/viewoverlaymanager.cxx
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -223,8 +223,8 @@ void ImageButtonHdl::CreateB2dIAObject()
 
     BitmapEx aBitmapEx( mxChangePlaceholderTag->createOverlayImage( mnHighlightId ) ); // maImageMO.GetBitmapEx() : maImage.GetBitmapEx() );
     maImageSize = aBitmapEx.GetSizePixel();
-    maImageSize.Width() >>= 1;
-    maImageSize.Height() >>= 1;
+    maImageSize.setWidth( maImageSize.Width() >> 1 );
+    maImageSize.setHeight( maImageSize.Height() >> 1 );
 
     if(pHdlList)
     {
@@ -384,8 +384,8 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList )
         long all_height = nRows * aButtonSize.Height();
 
         Point aPos( rSnapRect.Center() );
-        aPos.X() -= all_width >> 1;
-        aPos.Y() -= all_height >> 1;
+        aPos.AdjustX( -(all_width >> 1) );
+        aPos.AdjustY( -(all_height >> 1) );
 
         ImageButtonHdl* pHdl = new ImageButtonHdl( xThis, aPoint );
         pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
commit 8be5a49f377e5451da953aee598fd22f9665fbd6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Feb 26 13:27:35 2018 +0200

    drop old tools/gen.hxx methods in sc
    
    Change-Id: I3652c0a35a6873e80ee22d908a8969d09410776b
    Reviewed-on: https://gerrit.libreoffice.org/50361
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 537e99791005..9ed0568b45fe 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -214,22 +214,12 @@ inline long HmmToTwips (long nVal)
             FUNIT_100TH_MM, FUNIT_TWIP) );
 }
 
-inline void TwipsToMM( long& nVal )
-{
-    nVal = TwipsToHmm (nVal);
-}
-
-inline void ReverseTwipsToMM( long& nVal )
-{
-    nVal = HmmToTwips (nVal);
-}
-
 static void lcl_ReverseTwipsToMM( tools::Rectangle& rRect )
 {
-    ReverseTwipsToMM( rRect.Left() );
-    ReverseTwipsToMM( rRect.Right() );
-    ReverseTwipsToMM( rRect.Top() );
-    ReverseTwipsToMM( rRect.Bottom() );
+    rRect.SetLeft( HmmToTwips( rRect.Left() ) );
+    rRect.SetRight( HmmToTwips( rRect.Right() ) );
+    rRect.SetTop( HmmToTwips( rRect.Top()) );
+    rRect.SetBottom( HmmToTwips(rRect.Bottom()) );
 }
 
 ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) :
@@ -643,15 +633,15 @@ void ScDrawLayer::ResizeLastRectFromAnchor( const SdrObject* pObj, ScDrawObjData
     SCROW nRow2 = rData.maEnd.Row();
     SCTAB nTab2 = rData.maEnd.Tab();
     Point aPos( pDoc->GetColOffset( nCol1, nTab1, bHiddenAsZero ), pDoc->GetRowOffset( nRow1, nTab1, bHiddenAsZero ) );
-    TwipsToMM( aPos.X() );
-    TwipsToMM( aPos.Y() );
+    aPos.setX(TwipsToHmm( aPos.X() ));
+    aPos.setY(TwipsToHmm( aPos.Y() ));
     aPos += lcl_calcAvailableDiff(*pDoc, nCol1, nRow1, nTab1, rData.maStartOffset);
 
     if( bCanResize )
     {
         Point aEnd( pDoc->GetColOffset( nCol2, nTab2, bHiddenAsZero ), pDoc->GetRowOffset( nRow2, nTab2, bHiddenAsZero ) );
-        TwipsToMM( aEnd.X() );
-        TwipsToMM( aEnd.Y() );
+        aEnd.setX(TwipsToHmm( aEnd.X() ));
+        aEnd.setY(TwipsToHmm( aEnd.Y() ));
         aEnd += lcl_calcAvailableDiff(*pDoc, nCol2, nRow2, nTab2, rData.maEndOffset);
 
         tools::Rectangle aNew = tools::Rectangle( aPos, aEnd );
@@ -707,8 +697,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
         rData.maLastRect = pObj->GetLogicRect();
 
         Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
-        TwipsToMM( aPos.X() );
-        TwipsToMM( aPos.Y() );
+        aPos.setX(TwipsToHmm( aPos.X() ));
+        aPos.setY(TwipsToHmm( aPos.Y() ));
 
         // Calculations and values as in detfunc.cxx
 
@@ -749,8 +739,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
                 aPos.AdjustX(pDoc->GetColWidth( nCol1, nTab1 ) / 4 );
             if (!pDoc->RowHidden(nRow1, nTab1, nullptr, &nLastRow))
                 aPos.AdjustY(pDoc->GetRowHeight( nRow1, nTab1 ) / 2 );
-            TwipsToMM( aPos.X() );
-            TwipsToMM( aPos.Y() );
+            aPos.setX(TwipsToHmm( aPos.X() ));
+            aPos.setY(TwipsToHmm( aPos.Y() ));
             Point aStartPos = aPos;
             if ( bNegativePage )
                 aStartPos.setX( -aStartPos.X() );     // don't modify aPos - used below
@@ -787,8 +777,8 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
                 aPos.AdjustX(pDoc->GetColWidth( nCol2, nTab2 ) / 4 );
             if (!pDoc->RowHidden(nRow2, nTab2, nullptr, &nLastRow))
                 aPos.AdjustY(pDoc->GetRowHeight( nRow2, nTab2 ) / 2 );
-            TwipsToMM( aPos.X() );
-            TwipsToMM( aPos.Y() );
+            aPos.setX(TwipsToHmm( aPos.X() ));
+            aPos.setY(TwipsToHmm( aPos.Y() ));
             Point aEndPos = aPos;
             if ( bNegativePage )
                 aEndPos.setX( -aEndPos.X() );         // don't modify aPos - used below
@@ -1225,10 +1215,10 @@ bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
     {
         aTestRect.SetBottom( aTestRect.Top() );
         aTestRect.AdjustBottom(pDoc->GetRowHeight( nStartRow, nEndRow, nTab) );
-        TwipsToMM( aTestRect.Bottom() );
+        aTestRect.SetBottom(TwipsToHmm( aTestRect.Bottom() ));
     }
 
-    TwipsToMM( aTestRect.Top() );
+    aTestRect.SetTop(TwipsToHmm( aTestRect.Top() ));
 
     aTestRect.SetLeft( 0 );
     aTestRect.SetRight( MAXMM );
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index f46e619c201e..d9c87af47391 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -366,7 +366,7 @@ Point ScCaptionCreator::CalcTailPos( bool bTailFront )
     Point aTailPos = bTailLeft ? maCellRect.TopLeft() : maCellRect.TopRight();
     // move caption point 1/10 mm inside cell
     if( bTailLeft ) aTailPos.AdjustX(10 ); else aTailPos.AdjustX( -10 );
-    aTailPos.Y() += 10;
+    aTailPos.AdjustY(10);
     return aTailPos;
 }
 
diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx
index 08327c90bbcc..ef9c68ca65e5 100644
--- a/sc/source/filter/excel/xlpage.cxx
+++ b/sc/source/filter/excel/xlpage.cxx
@@ -220,7 +220,12 @@ Size XclPageData::GetScPaperSize() const
         aSize = SvxPaperInfo::GetDefaultPaperSize();
 
     if( !mbPortrait )
-        ::std::swap( aSize.Width(), aSize.Height() );
+    {
+        // swap width and height
+        long n = aSize.Width();
+        aSize.setWidth(aSize.Height());
+        aSize.setHeight(n);
+    }
 
     return aSize;
 }
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index 0b0965f61e90..acca81ea9266 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -71,7 +71,7 @@ void ScDDComboBoxButton::Draw( const Point& rAt,
     aInnerRect.AdjustLeft(1 );
     aInnerRect.AdjustTop(1 );
     aInnerRect.AdjustRight( -1 );
-    aInnerRect.Bottom() -= 1;
+    aInnerRect.AdjustBottom( -1 );
 
     Size  aInnerSize   = aInnerRect.GetSize();
     Point aInnerCenter = aInnerRect.Center();
@@ -128,8 +128,8 @@ void ScDDComboBoxButton::ImpDrawArrow( const tools::Rectangle& rRect )
     while( aPos1.X() <= aPos2.X() )
     {
         pOut->DrawLine( aPos1, aPos2 );
-        aPos1.AdjustX( 1 ); aPos2.X()--;
-        aPos1.AdjustY( 1 ); aPos2.Y()++;
+        aPos1.AdjustX( 1 ); aPos2.AdjustX( -1 );
+        aPos1.AdjustY( 1 ); aPos2.AdjustY( 1 );
     }
 
     pOut->DrawLine( Point( aCenter.X() - aSize3.Width(), aPos1.Y()+1 ),
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 09ae675c052a..b0e7c6d3d8c0 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -463,7 +463,7 @@ void ScZoomSliderWnd::DoPaint(vcl::RenderContext& rRenderContext)
     Point aImagePoint = aRect.TopLeft();
     aImagePoint.AdjustX(Zoom2Offset(mpImpl->mnCurrentZoom) );
     aImagePoint.AdjustX( -(nButtonWidth / 2) );
-    aImagePoint.Y() += (aSliderWindowSize.Height() - nButtonHeight) / 2;
+    aImagePoint.AdjustY( (aSliderWindowSize.Height() - nButtonHeight) / 2 );
     pVDev->DrawImage(aImagePoint, mpImpl->maSliderButton);
 
     // draw decrease button
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 17f597270876..f9e78ba99034 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2111,10 +2111,11 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
 
 namespace {
 
-void SnapHor( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCCOL& rStartCol )
+SAL_WARN_UNUSED_RESULT
+long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol )
 {
     SCCOL nCol = 0;
-    long nTwips = static_cast<long>(rVal / HMM_PER_TWIPS);
+    long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
     long nSnap = 0;
     while ( nCol<MAXCOL )
     {
@@ -2127,14 +2128,16 @@ void SnapHor( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCCOL& rStartCol )
         else
             break;
     }
-    rVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
+    nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
     rStartCol = nCol;
+    return nVal;
 }
 
-void SnapVer( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCROW& rStartRow )
+SAL_WARN_UNUSED_RESULT
+long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow )
 {
     SCROW nRow = 0;
-    long nTwips = static_cast<long>(rVal / HMM_PER_TWIPS);
+    long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
     long nSnap = 0;
 
     bool bFound = false;
@@ -2163,8 +2166,9 @@ void SnapVer( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCROW& rStartRow )
     if (!bFound)
         nRow = MAXROW;  // all hidden down to the bottom
 
-    rVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
+    nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
     rStartRow = nRow;
+    return nVal;
 }
 
 }
@@ -2177,14 +2181,14 @@ void ScDocShell::SnapVisArea( tools::Rectangle& rRect ) const
         ScDrawLayer::MirrorRectRTL( rRect );        // calculate with positive (LTR) values
 
     SCCOL nCol = 0;
-    SnapHor( aDocument, nTab, rRect.Left(), nCol );
+    rRect.SetLeft( SnapHorizontal( aDocument, nTab, rRect.Left(), nCol ) );
     ++nCol;                                         // at least one column
-    SnapHor( aDocument, nTab, rRect.Right(), nCol );
+    rRect.SetRight( SnapHorizontal( aDocument, nTab, rRect.Right(), nCol ) );
 
     SCROW nRow = 0;
-    SnapVer( aDocument, nTab, rRect.Top(), nRow );
+    rRect.SetTop( SnapVertical( aDocument, nTab, rRect.Top(), nRow ) );
     ++nRow;                                         // at least one row
-    SnapVer( aDocument, nTab, rRect.Bottom(), nRow );
+    rRect.SetBottom( SnapVertical( aDocument, nTab, rRect.Bottom(), nRow ) );
 
     if ( bNegativePage )
         ScDrawLayer::MirrorRectRTL( rRect );        // back to real rectangle
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 33a2d1626596..fb2ac988fd25 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1038,7 +1038,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
     tools::Rectangle aCellRect( OutputToScreenPixel(aPos), Size(nSizeX,nSizeY) );
 
     aPos.AdjustX( -1 );
-    aPos.Y() += nSizeY - 1;
+    aPos.AdjustY( nSizeY - 1 );
 
     mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER)));
     mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl));
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index d8b3021168eb..fe6f89476de2 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -145,7 +145,7 @@ static MapMode lcl_MoveMapMode( const MapMode& rMap, const Size& rMove )
     MapMode aNew = rMap;
     Point aOrigin = aNew.GetOrigin();
     aOrigin.AdjustX( -(rMove.Width()) );
-    aOrigin.Y() -= rMove.Height();
+    aOrigin.AdjustY( -rMove.Height() );
     aNew.SetOrigin(aOrigin);
     return aNew;
 }
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index e01710039ad3..9bf0c94d3b88 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -833,7 +833,7 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD
     tools::Rectangle aPaintRect = rRect;
     aPaintRect.AdjustTop(2 * nOneY );
     aPaintRect.AdjustBottom( -(2 * nOneY) );
-    aPaintRect.Left() += 2 * nOneX;
+    aPaintRect.AdjustLeft( 2 * nOneX );
     aPaintRect.AdjustRight( -(2 * nOneX) );
     if(pOldDataBarInfo->mnZero)
     {
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index d86fcb3fcc36..270d974e3a0b 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -45,7 +45,7 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
 
     for (nCol=0; nCol<nX1; nCol++)
         aOffset.AdjustX( -(mpDoc->GetColWidth( nCol, nTab ) * nLayoutSign) );
-    aOffset.Y() -= mpDoc->GetRowHeight( 0, nY1-1, nTab );
+    aOffset.AdjustY( -sal_Int32(mpDoc->GetRowHeight( 0, nY1-1, nTab )) );
 
     long nDataWidth = 0;
     for (nCol=nX1; nCol<=nX2; nCol++)
@@ -54,8 +54,10 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
     if ( bLayoutRTL )
         aOffset.AdjustX(nDataWidth );
 
-    aRect.Left() = aRect.Right()  = -aOffset.X();
-    aRect.Top()  = aRect.Bottom() = -aOffset.Y();
+    aRect.SetLeft( -aOffset.X() );
+    aRect.SetRight( -aOffset.X() );
+    aRect.SetTop( -aOffset.Y() );
+    aRect.SetBottom( -aOffset.Y() );
 
     Point aMMOffset( aOffset );
     aMMOffset.setX( static_cast<long>(aMMOffset.X() * HMM_PER_TWIPS) );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index b3bf1aa0db7e..ae4a3fc029cf 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -815,7 +815,7 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly)
     //  -> add only 0.10cm, so there is some margin in all cases.
     Size aMarginSize( LogicToPixel(Size(100, 100), MapMode(MapUnit::Map100thMM)) );
     aWinSize.AdjustWidth( -(2 * aMarginSize.Width()) );
-    aWinSize.Height() -= 2 * aMarginSize.Height();
+    aWinSize.AdjustHeight( -(2 * aMarginSize.Height()) );
 
     Size aLocalPageSize = lcl_GetDocPageSize( &pDocShell->GetDocument(), nTab );
     if ( aLocalPageSize.Width() && aLocalPageSize.Height() )
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index e4c6dc309a80..09819b9c2f2c 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1093,7 +1093,7 @@ Size ScPrintFunc::GetDataSize() const
 {
     Size aSize = aPageSize;
     aSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
-    aSize.Height() -= nTopMargin + nBottomMargin;
+    aSize.AdjustHeight( -(nTopMargin + nBottomMargin) );
     aSize.AdjustHeight( -(aHdr.nHeight + aFtr.nHeight) );
     return aSize;
 }
@@ -1102,7 +1102,7 @@ void ScPrintFunc::GetScaleData( Size& rPhysSize, long& rDocHdr, long& rDocFtr )
 {
     rPhysSize = aPageSize;
     rPhysSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
-    rPhysSize.Height() -= nTopMargin + nBottomMargin;
+    rPhysSize.AdjustHeight( -(nTopMargin + nBottomMargin) );
 
     rDocHdr = aHdr.nHeight;
     rDocFtr = aFtr.nHeight;
@@ -1538,7 +1538,7 @@ void ScPrintFunc::LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
     Point aTwipOffset;
     for (nCol=0; nCol<nX1; nCol++)
         aTwipOffset.AdjustX( -(pDoc->GetColWidth( nCol, nPrintTab )) );
-    aTwipOffset.Y() -= pDoc->GetRowHeight( 0, nY1-1, nPrintTab );
+    aTwipOffset.AdjustY( -sal_Int32(pDoc->GetRowHeight( 0, nY1-1, nPrintTab )) );
 
     Point aMMOffset( aTwipOffset );
     aMMOffset.setX( static_cast<long>(aMMOffset.X() * HMM_PER_TWIPS) );
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 59c12f27a39d..f263f3daaff3 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -668,9 +668,9 @@ void ScTabView::OnLOKNoteStateChanged(const ScPostIt* pNote)
     const int nBorderSize = 200;
     tools::Rectangle aInvalidRect = aRect;
     aInvalidRect.AdjustLeft( -nBorderSize );
-    aInvalidRect.Right() += nBorderSize;
+    aInvalidRect.AdjustRight( nBorderSize );
     aInvalidRect.AdjustTop( -nBorderSize );
-    aInvalidRect.Bottom() += nBorderSize;
+    aInvalidRect.AdjustBottom( nBorderSize );
 
     SfxViewShell* pViewShell = SfxViewShell::GetFirst();
     while (pViewShell)


More information about the Libreoffice-commits mailing list